mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 04:26:00 +00:00
Modules
This commit is contained in:
117
node_modules/@google-cloud/promisify/CHANGELOG.md
generated
vendored
Normal file
117
node_modules/@google-cloud/promisify/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,117 @@
|
||||
# Changelog
|
||||
|
||||
[npm history][1]
|
||||
|
||||
[1]: https://www.npmjs.com/package/nodejs-promisify?activeTab=versions
|
||||
|
||||
### [1.0.4](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.3...v1.0.4) (2019-12-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **deps:** pin TypeScript below 3.7.0 ([e48750e](https://www.github.com/googleapis/nodejs-promisify/commit/e48750ef96aa20eb3a2b73fe2f062d04430468a7))
|
||||
|
||||
### [1.0.3](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.2...v1.0.3) (2019-11-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docs:** add jsdoc-region-tag plugin ([#146](https://www.github.com/googleapis/nodejs-promisify/issues/146)) ([ff0ee74](https://www.github.com/googleapis/nodejs-promisify/commit/ff0ee7408f50e8f7147b8ccf7e10337aa5920076))
|
||||
|
||||
### [1.0.2](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.1...v1.0.2) (2019-06-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docs:** link to reference docs section on googleapis.dev ([#128](https://www.github.com/googleapis/nodejs-promisify/issues/128)) ([5a8bd90](https://www.github.com/googleapis/nodejs-promisify/commit/5a8bd90))
|
||||
|
||||
### [1.0.1](https://www.github.com/googleapis/nodejs-promisify/compare/v1.0.0...v1.0.1) (2019-06-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **docs:** move to new client docs URL ([#124](https://www.github.com/googleapis/nodejs-promisify/issues/124)) ([34d18cd](https://www.github.com/googleapis/nodejs-promisify/commit/34d18cd))
|
||||
|
||||
## [1.0.0](https://www.github.com/googleapis/nodejs-promisify/compare/v0.4.0...v1.0.0) (2019-05-02)
|
||||
|
||||
|
||||
### Build System
|
||||
|
||||
* upgrade engines field to >=8.10.0 ([#108](https://www.github.com/googleapis/nodejs-promisify/issues/108)) ([78ab89c](https://www.github.com/googleapis/nodejs-promisify/commit/78ab89c))
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* upgrade engines field to >=8.10.0 (#108)
|
||||
|
||||
## v0.4.0
|
||||
|
||||
02-12-2019 19:44 PST
|
||||
|
||||
### New features
|
||||
- feat: add callbackify() and callbackifyAll() methods ([#82](https://github.com/googleapis/nodejs-promisify/pull/82))
|
||||
|
||||
### Documentation
|
||||
- docs: update contributing path in README ([#86](https://github.com/googleapis/nodejs-promisify/pull/86))
|
||||
- chore: move CONTRIBUTING.md to root ([#85](https://github.com/googleapis/nodejs-promisify/pull/85))
|
||||
- docs: add lint/fix example to contributing guide ([#83](https://github.com/googleapis/nodejs-promisify/pull/83))
|
||||
|
||||
### Internal / Testing Changes
|
||||
- build: create docs test npm scripts ([#88](https://github.com/googleapis/nodejs-promisify/pull/88))
|
||||
- build: test using @grpc/grpc-js in CI ([#87](https://github.com/googleapis/nodejs-promisify/pull/87))
|
||||
- build: ignore googleapis.com in doc link check ([#81](https://github.com/googleapis/nodejs-promisify/pull/81))
|
||||
- build: check broken links in generated docs ([#79](https://github.com/googleapis/nodejs-promisify/pull/79))
|
||||
- chore(deps): update dependency @types/sinon to v7 ([#78](https://github.com/googleapis/nodejs-promisify/pull/78))
|
||||
- chore(build): inject yoshi automation key ([#77](https://github.com/googleapis/nodejs-promisify/pull/77))
|
||||
- chore: update nyc and eslint configs ([#76](https://github.com/googleapis/nodejs-promisify/pull/76))
|
||||
- chore: fix publish.sh permission +x ([#74](https://github.com/googleapis/nodejs-promisify/pull/74))
|
||||
- fix(build): fix Kokoro release script ([#73](https://github.com/googleapis/nodejs-promisify/pull/73))
|
||||
- build: add Kokoro configs for autorelease ([#72](https://github.com/googleapis/nodejs-promisify/pull/72))
|
||||
- chore: always nyc report before calling codecov ([#69](https://github.com/googleapis/nodejs-promisify/pull/69))
|
||||
- chore: nyc ignore build/test by default ([#68](https://github.com/googleapis/nodejs-promisify/pull/68))
|
||||
- chore(build): update prettier config ([#66](https://github.com/googleapis/nodejs-promisify/pull/66))
|
||||
- fix: get the build passing ([#65](https://github.com/googleapis/nodejs-promisify/pull/65))
|
||||
- chore: update license file ([#64](https://github.com/googleapis/nodejs-promisify/pull/64))
|
||||
- fix(build): fix system key decryption ([#60](https://github.com/googleapis/nodejs-promisify/pull/60))
|
||||
- chore(deps): update dependency @types/sinon to v5.0.7 ([#58](https://github.com/googleapis/nodejs-promisify/pull/58))
|
||||
- fix: Pin @types/sinon to last compatible version ([#57](https://github.com/googleapis/nodejs-promisify/pull/57))
|
||||
- chore: add synth.metadata
|
||||
- chore(deps): update dependency gts to ^0.9.0 ([#54](https://github.com/googleapis/nodejs-promisify/pull/54))
|
||||
- chore: update eslintignore config ([#53](https://github.com/googleapis/nodejs-promisify/pull/53))
|
||||
- chore: use latest npm on Windows ([#52](https://github.com/googleapis/nodejs-promisify/pull/52))
|
||||
- chore: update CircleCI config ([#51](https://github.com/googleapis/nodejs-promisify/pull/51))
|
||||
- chore: include build in eslintignore ([#48](https://github.com/googleapis/nodejs-promisify/pull/48))
|
||||
- chore: update issue templates ([#44](https://github.com/googleapis/nodejs-promisify/pull/44))
|
||||
- chore: remove old issue template ([#42](https://github.com/googleapis/nodejs-promisify/pull/42))
|
||||
- build: run tests on node11 ([#41](https://github.com/googleapis/nodejs-promisify/pull/41))
|
||||
- chores(build): do not collect sponge.xml from windows builds ([#40](https://github.com/googleapis/nodejs-promisify/pull/40))
|
||||
- chores(build): run codecov on continuous builds ([#39](https://github.com/googleapis/nodejs-promisify/pull/39))
|
||||
- chore: update new issue template ([#38](https://github.com/googleapis/nodejs-promisify/pull/38))
|
||||
- chore(deps): update dependency sinon to v7 ([#33](https://github.com/googleapis/nodejs-promisify/pull/33))
|
||||
- build: fix codecov uploading on Kokoro ([#34](https://github.com/googleapis/nodejs-promisify/pull/34))
|
||||
- Update kokoro config ([#30](https://github.com/googleapis/nodejs-promisify/pull/30))
|
||||
- Update CI config ([#28](https://github.com/googleapis/nodejs-promisify/pull/28))
|
||||
- Don't publish sourcemaps ([#26](https://github.com/googleapis/nodejs-promisify/pull/26))
|
||||
- Update kokoro config ([#24](https://github.com/googleapis/nodejs-promisify/pull/24))
|
||||
- test: remove appveyor config ([#23](https://github.com/googleapis/nodejs-promisify/pull/23))
|
||||
- Update CI config ([#22](https://github.com/googleapis/nodejs-promisify/pull/22))
|
||||
- Enable prefer-const in the eslint config ([#21](https://github.com/googleapis/nodejs-promisify/pull/21))
|
||||
- Enable no-var in eslint ([#19](https://github.com/googleapis/nodejs-promisify/pull/19))
|
||||
- Update CI config ([#18](https://github.com/googleapis/nodejs-promisify/pull/18))
|
||||
|
||||
## v0.3.1
|
||||
|
||||
### Internal / Testing Changes
|
||||
- Add synth script and update CI (#14)
|
||||
- chore(deps): update dependency nyc to v13 (#12)
|
||||
- chore: ignore package-lock.json (#11)
|
||||
- chore(deps): lock file maintenance (#10)
|
||||
- chore: update renovate config (#9)
|
||||
- remove that whitespace (#8)
|
||||
- chore(deps): lock file maintenance (#7)
|
||||
- chore(deps): update dependency typescript to v3 (#6)
|
||||
- chore: assert.deelEqual => assert.deepStrictEqual (#5)
|
||||
- chore: move mocha options to mocha.opts (#4)
|
||||
- chore(deps): update dependency gts to ^0.8.0 (#1)
|
||||
- chore(deps): lock file maintenance (#3)
|
||||
- chore(deps): lock file maintenance (#2)
|
202
node_modules/@google-cloud/promisify/LICENSE
generated
vendored
Normal file
202
node_modules/@google-cloud/promisify/LICENSE
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
127
node_modules/@google-cloud/promisify/README.md
generated
vendored
Normal file
127
node_modules/@google-cloud/promisify/README.md
generated
vendored
Normal file
@ -0,0 +1,127 @@
|
||||
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
|
||||
[//]: # "To regenerate it, use `python -m synthtool`."
|
||||
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
|
||||
|
||||
# [Google Cloud Common Promisify: Node.js Client](https://github.com/googleapis/nodejs-promisify)
|
||||
|
||||
[](https://cloud.google.com/terms/launch-stages)
|
||||
[](https://www.npmjs.org/package/@google-cloud/promisify)
|
||||
[](https://codecov.io/gh/googleapis/nodejs-promisify)
|
||||
|
||||
|
||||
|
||||
|
||||
A simple utility for promisifying functions and classes.
|
||||
|
||||
|
||||
* [Google Cloud Common Promisify Node.js Client API Reference][client-docs]
|
||||
|
||||
* [github.com/googleapis/nodejs-promisify](https://github.com/googleapis/nodejs-promisify)
|
||||
|
||||
Read more about the client libraries for Cloud APIs, including the older
|
||||
Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
||||
|
||||
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
|
||||
|
||||
**Table of contents:**
|
||||
|
||||
|
||||
* [Quickstart](#quickstart)
|
||||
|
||||
* [Installing the client library](#installing-the-client-library)
|
||||
* [Using the client library](#using-the-client-library)
|
||||
* [Samples](#samples)
|
||||
* [Versioning](#versioning)
|
||||
* [Contributing](#contributing)
|
||||
* [License](#license)
|
||||
|
||||
## Quickstart
|
||||
|
||||
### Installing the client library
|
||||
|
||||
```bash
|
||||
npm install @google-cloud/promisify
|
||||
```
|
||||
|
||||
|
||||
### Using the client library
|
||||
|
||||
```javascript
|
||||
const {promisify} = require('@google-cloud/promisify');
|
||||
|
||||
/**
|
||||
* This is a very basic example function that accepts a callback.
|
||||
*/
|
||||
function someCallbackFunction(name, callback) {
|
||||
if (!name) {
|
||||
callback(new Error('Name is required!'));
|
||||
} else {
|
||||
callback(null, `Well hello there, ${name}!`);
|
||||
}
|
||||
}
|
||||
|
||||
// let's promisify it!
|
||||
const somePromiseFunction = promisify(someCallbackFunction);
|
||||
|
||||
async function quickstart() {
|
||||
// now we can just `await` the function to use it like a promisified method
|
||||
const [result] = await somePromiseFunction('nodestronaut');
|
||||
console.log(result);
|
||||
}
|
||||
quickstart();
|
||||
|
||||
```
|
||||
It's unlikely you will need to install this package directly, as it will be
|
||||
installed as a dependency when you install other `@google-cloud` packages.
|
||||
|
||||
|
||||
## Samples
|
||||
|
||||
Samples are in the [`samples/`](https://github.com/googleapis/nodejs-promisify/tree/master/samples) directory. The samples' `README.md`
|
||||
has instructions for running the samples.
|
||||
|
||||
| Sample | Source Code | Try it |
|
||||
| --------------------------- | --------------------------------- | ------ |
|
||||
| Quickstart | [source code](https://github.com/googleapis/nodejs-promisify/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-promisify&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
|
||||
|
||||
|
||||
|
||||
The [Google Cloud Common Promisify Node.js Client API Reference][client-docs] documentation
|
||||
also contains samples.
|
||||
|
||||
## Versioning
|
||||
|
||||
This library follows [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
This library is considered to be **General Availability (GA)**. This means it
|
||||
is stable; the code surface will not change in backwards-incompatible ways
|
||||
unless absolutely necessary (e.g. because of critical security issues) or with
|
||||
an extensive deprecation period. Issues and requests against **GA** libraries
|
||||
are addressed with the highest priority.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
||||
|
||||
[launch_stages]: https://cloud.google.com/terms/launch-stages
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-promisify/blob/master/CONTRIBUTING.md).
|
||||
|
||||
## License
|
||||
|
||||
Apache Version 2.0
|
||||
|
||||
See [LICENSE](https://github.com/googleapis/nodejs-promisify/blob/master/LICENSE)
|
||||
|
||||
[client-docs]: https://googleapis.dev/nodejs/promisify/latest
|
||||
|
||||
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
|
||||
[projects]: https://console.cloud.google.com/project
|
||||
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
|
||||
|
||||
[auth]: https://cloud.google.com/docs/authentication/getting-started
|
61
node_modules/@google-cloud/promisify/build/src/index.d.ts
generated
vendored
Normal file
61
node_modules/@google-cloud/promisify/build/src/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
export interface PromisifyAllOptions extends PromisifyOptions {
|
||||
/**
|
||||
* Array of methods to ignore when promisifying.
|
||||
*/
|
||||
exclude?: string[];
|
||||
}
|
||||
export interface PromisifyOptions {
|
||||
/**
|
||||
* Resolve the promise with single arg instead of an array.
|
||||
*/
|
||||
singular?: boolean;
|
||||
}
|
||||
export interface PromiseMethod extends Function {
|
||||
promisified_?: boolean;
|
||||
}
|
||||
export interface WithPromise {
|
||||
Promise?: PromiseConstructor;
|
||||
}
|
||||
export interface CallbackifyAllOptions {
|
||||
/**
|
||||
* Array of methods to ignore when callbackifying.
|
||||
*/
|
||||
exclude?: string[];
|
||||
}
|
||||
export interface CallbackMethod extends Function {
|
||||
callbackified_?: boolean;
|
||||
}
|
||||
/**
|
||||
* Wraps a callback style function to conditionally return a promise.
|
||||
*
|
||||
* @param {function} originalMethod - The method to promisify.
|
||||
* @param {object=} options - Promise options.
|
||||
* @param {boolean} options.singular - Resolve the promise with single arg instead of an array.
|
||||
* @return {function} wrapped
|
||||
*/
|
||||
export declare function promisify(originalMethod: PromiseMethod, options?: PromisifyOptions): any;
|
||||
/**
|
||||
* Promisifies certain Class methods. This will not promisify private or
|
||||
* streaming methods.
|
||||
*
|
||||
* @param {module:common/service} Class - Service class.
|
||||
* @param {object=} options - Configuration object.
|
||||
*/
|
||||
export declare function promisifyAll(Class: Function, options?: PromisifyAllOptions): void;
|
||||
/**
|
||||
* Wraps a promisy type function to conditionally call a callback function.
|
||||
*
|
||||
* @param {function} originalMethod - The method to callbackify.
|
||||
* @param {object=} options - Callback options.
|
||||
* @param {boolean} options.singular - Pass to the callback a single arg instead of an array.
|
||||
* @return {function} wrapped
|
||||
*/
|
||||
export declare function callbackify(originalMethod: CallbackMethod): CallbackMethod;
|
||||
/**
|
||||
* Callbackifies certain Class methods. This will not callbackify private or
|
||||
* streaming methods.
|
||||
*
|
||||
* @param {module:common/service} Class - Service class.
|
||||
* @param {object=} options - Configuration object.
|
||||
*/
|
||||
export declare function callbackifyAll(Class: Function, options?: CallbackifyAllOptions): void;
|
159
node_modules/@google-cloud/promisify/build/src/index.js
generated
vendored
Normal file
159
node_modules/@google-cloud/promisify/build/src/index.js
generated
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
"use strict";
|
||||
// Copyright 2014 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* Wraps a callback style function to conditionally return a promise.
|
||||
*
|
||||
* @param {function} originalMethod - The method to promisify.
|
||||
* @param {object=} options - Promise options.
|
||||
* @param {boolean} options.singular - Resolve the promise with single arg instead of an array.
|
||||
* @return {function} wrapped
|
||||
*/
|
||||
function promisify(originalMethod, options) {
|
||||
if (originalMethod.promisified_) {
|
||||
return originalMethod;
|
||||
}
|
||||
options = options || {};
|
||||
const slice = Array.prototype.slice;
|
||||
// tslint:disable-next-line:no-any
|
||||
const wrapper = function () {
|
||||
const context = this;
|
||||
let last;
|
||||
for (last = arguments.length - 1; last >= 0; last--) {
|
||||
const arg = arguments[last];
|
||||
if (typeof arg === 'undefined') {
|
||||
continue; // skip trailing undefined.
|
||||
}
|
||||
if (typeof arg !== 'function') {
|
||||
break; // non-callback last argument found.
|
||||
}
|
||||
return originalMethod.apply(context, arguments);
|
||||
}
|
||||
// peel trailing undefined.
|
||||
const args = slice.call(arguments, 0, last + 1);
|
||||
// tslint:disable-next-line:variable-name
|
||||
let PromiseCtor = Promise;
|
||||
// Because dedupe will likely create a single install of
|
||||
// @google-cloud/common to be shared amongst all modules, we need to
|
||||
// localize it at the Service level.
|
||||
if (context && context.Promise) {
|
||||
PromiseCtor = context.Promise;
|
||||
}
|
||||
return new PromiseCtor((resolve, reject) => {
|
||||
// tslint:disable-next-line:no-any
|
||||
args.push((...args) => {
|
||||
const callbackArgs = slice.call(args);
|
||||
const err = callbackArgs.shift();
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
if (options.singular && callbackArgs.length === 1) {
|
||||
resolve(callbackArgs[0]);
|
||||
}
|
||||
else {
|
||||
resolve(callbackArgs);
|
||||
}
|
||||
});
|
||||
originalMethod.apply(context, args);
|
||||
});
|
||||
};
|
||||
wrapper.promisified_ = true;
|
||||
return wrapper;
|
||||
}
|
||||
exports.promisify = promisify;
|
||||
/**
|
||||
* Promisifies certain Class methods. This will not promisify private or
|
||||
* streaming methods.
|
||||
*
|
||||
* @param {module:common/service} Class - Service class.
|
||||
* @param {object=} options - Configuration object.
|
||||
*/
|
||||
// tslint:disable-next-line:variable-name
|
||||
function promisifyAll(Class, options) {
|
||||
const exclude = (options && options.exclude) || [];
|
||||
const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
|
||||
const methods = ownPropertyNames.filter(methodName => {
|
||||
// clang-format off
|
||||
return (typeof Class.prototype[methodName] === 'function' && // is it a function?
|
||||
!/(^_|(Stream|_)|promise$)|^constructor$/.test(methodName) && // is it promisable?
|
||||
exclude.indexOf(methodName) === -1); // is it blacklisted?
|
||||
// clang-format on
|
||||
});
|
||||
methods.forEach(methodName => {
|
||||
const originalMethod = Class.prototype[methodName];
|
||||
if (!originalMethod.promisified_) {
|
||||
Class.prototype[methodName] = exports.promisify(originalMethod, options);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.promisifyAll = promisifyAll;
|
||||
/**
|
||||
* Wraps a promisy type function to conditionally call a callback function.
|
||||
*
|
||||
* @param {function} originalMethod - The method to callbackify.
|
||||
* @param {object=} options - Callback options.
|
||||
* @param {boolean} options.singular - Pass to the callback a single arg instead of an array.
|
||||
* @return {function} wrapped
|
||||
*/
|
||||
function callbackify(originalMethod) {
|
||||
if (originalMethod.callbackified_) {
|
||||
return originalMethod;
|
||||
}
|
||||
// tslint:disable-next-line:no-any
|
||||
const wrapper = function () {
|
||||
const context = this;
|
||||
if (typeof arguments[arguments.length - 1] !== 'function') {
|
||||
return originalMethod.apply(context, arguments);
|
||||
}
|
||||
const cb = Array.prototype.pop.call(arguments);
|
||||
originalMethod.apply(context, arguments).then(
|
||||
// tslint:disable-next-line:no-any
|
||||
(res) => {
|
||||
res = Array.isArray(res) ? res : [res];
|
||||
cb(null, ...res);
|
||||
}, (err) => cb(err));
|
||||
};
|
||||
wrapper.callbackified_ = true;
|
||||
return wrapper;
|
||||
}
|
||||
exports.callbackify = callbackify;
|
||||
/**
|
||||
* Callbackifies certain Class methods. This will not callbackify private or
|
||||
* streaming methods.
|
||||
*
|
||||
* @param {module:common/service} Class - Service class.
|
||||
* @param {object=} options - Configuration object.
|
||||
*/
|
||||
function callbackifyAll(
|
||||
// tslint:disable-next-line:variable-name
|
||||
Class, options) {
|
||||
const exclude = (options && options.exclude) || [];
|
||||
const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
|
||||
const methods = ownPropertyNames.filter(methodName => {
|
||||
// clang-format off
|
||||
return (typeof Class.prototype[methodName] === 'function' && // is it a function?
|
||||
!/^_|(Stream|_)|^constructor$/.test(methodName) && // is it callbackifyable?
|
||||
exclude.indexOf(methodName) === -1); // is it blacklisted?
|
||||
// clang-format on
|
||||
});
|
||||
methods.forEach(methodName => {
|
||||
const originalMethod = Class.prototype[methodName];
|
||||
if (!originalMethod.callbackified_) {
|
||||
Class.prototype[methodName] = exports.callbackify(originalMethod);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.callbackifyAll = callbackifyAll;
|
||||
//# sourceMappingURL=index.js.map
|
86
node_modules/@google-cloud/promisify/package.json
generated
vendored
Normal file
86
node_modules/@google-cloud/promisify/package.json
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
{
|
||||
"_from": "@google-cloud/promisify@^1.0.0",
|
||||
"_id": "@google-cloud/promisify@1.0.4",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VccZDcOql77obTnFh0TbNED/6ZbbmHDf8UMNnzO1d5g9V0Htfm4k5cllY8P1tJsRKC3zWYGRLaViiupcgVjBoQ==",
|
||||
"_location": "/@google-cloud/promisify",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "@google-cloud/promisify@^1.0.0",
|
||||
"name": "@google-cloud/promisify",
|
||||
"escapedName": "@google-cloud%2fpromisify",
|
||||
"scope": "@google-cloud",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@google-cloud/common",
|
||||
"/@google-cloud/storage"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-1.0.4.tgz",
|
||||
"_shasum": "ce86ffa94f9cfafa2e68f7b3e4a7fad194189723",
|
||||
"_spec": "@google-cloud/promisify@^1.0.0",
|
||||
"_where": "C:\\Users\\matia\\Documents\\GitHub\\Musix\\node_modules\\@google-cloud\\storage",
|
||||
"author": {
|
||||
"name": "Google Inc."
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/googleapis/nodejs-promisify/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "A simple utility for promisifying functions and classes.",
|
||||
"devDependencies": {
|
||||
"@compodoc/compodoc": "^1.1.9",
|
||||
"@types/mocha": "^5.2.4",
|
||||
"@types/node": "^10.5.2",
|
||||
"@types/sinon": "^7.0.0",
|
||||
"codecov": "^3.0.4",
|
||||
"gts": "^1.0.0",
|
||||
"hard-rejection": "^2.0.0",
|
||||
"intelli-espower-loader": "^1.0.1",
|
||||
"linkinator": "^1.5.0",
|
||||
"mocha": "^6.0.0",
|
||||
"nyc": "^14.0.0",
|
||||
"sinon": "^7.0.0",
|
||||
"source-map-support": "^0.5.6",
|
||||
"typescript": "3.6.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
},
|
||||
"files": [
|
||||
"build/src",
|
||||
"!build/src/**/*.map"
|
||||
],
|
||||
"homepage": "https://github.com/googleapis/nodejs-promisify#readme",
|
||||
"keywords": [],
|
||||
"license": "Apache-2.0",
|
||||
"main": "build/src/index.js",
|
||||
"name": "@google-cloud/promisify",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/googleapis/nodejs-promisify.git"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "gts clean",
|
||||
"compile": "tsc -p .",
|
||||
"docs": "compodoc src/",
|
||||
"docs-test": "linkinator docs",
|
||||
"fix": "gts fix",
|
||||
"lint": "gts check",
|
||||
"posttest": "npm run lint",
|
||||
"predocs-test": "npm run docs",
|
||||
"prepare": "npm run compile",
|
||||
"presystem-test": "npm run compile",
|
||||
"pretest": "npm run compile",
|
||||
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
|
||||
"system-test": "mocha build/system-test",
|
||||
"test": "nyc mocha build/test"
|
||||
},
|
||||
"types": "build/src/index.d.ts",
|
||||
"version": "1.0.4"
|
||||
}
|
Reference in New Issue
Block a user