Projektstart
This commit is contained in:
202
backend/node_modules/googleapis-common/LICENSE
generated
vendored
Normal file
202
backend/node_modules/googleapis-common/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.
|
||||
118
backend/node_modules/googleapis-common/README.md
generated
vendored
Normal file
118
backend/node_modules/googleapis-common/README.md
generated
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
[//]: # "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 APIs Common Module: Node.js Client](https://github.com/googleapis/nodejs-googleapis-common)
|
||||
|
||||
[](https://cloud.google.com/terms/launch-stages)
|
||||
[](https://www.npmjs.org/package/googleapis-common)
|
||||
|
||||
|
||||
|
||||
|
||||
A common tooling library used by the googleapis npm module. You probably don't want to use this directly.
|
||||
|
||||
|
||||
A comprehensive list of changes in each version may be found in
|
||||
[the CHANGELOG](https://github.com/googleapis/nodejs-googleapis-common/blob/main/CHANGELOG.md).
|
||||
|
||||
* [Google APIs Common Module Node.js Client API Reference][client-docs]
|
||||
|
||||
* [github.com/googleapis/nodejs-googleapis-common](https://github.com/googleapis/nodejs-googleapis-common)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
* [Versioning](#versioning)
|
||||
* [Contributing](#contributing)
|
||||
* [License](#license)
|
||||
|
||||
## Quickstart
|
||||
|
||||
### Installing the client library
|
||||
|
||||
```bash
|
||||
npm install googleapis-common
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
The [Google APIs Common Module Node.js Client API Reference][client-docs] documentation
|
||||
also contains samples.
|
||||
|
||||
## Supported Node.js Versions
|
||||
|
||||
Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).
|
||||
Libraries are compatible with all current _active_ and _maintenance_ versions of
|
||||
Node.js.
|
||||
If you are using an end-of-life version of Node.js, we recommend that you update
|
||||
as soon as possible to an actively supported LTS version.
|
||||
|
||||
Google's client libraries support legacy versions of Node.js runtimes on a
|
||||
best-efforts basis with the following warnings:
|
||||
|
||||
* Legacy versions are not tested in continuous integration.
|
||||
* Some security patches and features cannot be backported.
|
||||
* Dependencies cannot be kept up-to-date.
|
||||
|
||||
Client libraries targeting some end-of-life versions of Node.js are available, and
|
||||
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
|
||||
The dist-tags follow the naming convention `legacy-(version)`.
|
||||
For example, `npm install googleapis-common@legacy-8` installs client libraries
|
||||
for versions compatible with Node.js 8.
|
||||
|
||||
## Versioning
|
||||
|
||||
This library follows [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
|
||||
This library is considered to be **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 **stable** 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-googleapis-common/blob/main/CONTRIBUTING.md).
|
||||
|
||||
Please note that this `README.md`, the `samples/README.md`,
|
||||
and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
||||
are generated from a central template. To edit one of these files, make an edit
|
||||
to its templates in
|
||||
[directory](https://github.com/googleapis/synthtool).
|
||||
|
||||
## License
|
||||
|
||||
Apache Version 2.0
|
||||
|
||||
See [LICENSE](https://github.com/googleapis/nodejs-googleapis-common/blob/main/LICENSE)
|
||||
|
||||
[client-docs]: https://cloud.google.com/nodejs/docs/reference/googleapis-common/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/external/set-up-adc-local
|
||||
55
backend/node_modules/googleapis-common/build/src/api.d.ts
generated
vendored
Normal file
55
backend/node_modules/googleapis-common/build/src/api.d.ts
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import { GaxiosOptions } from 'gaxios';
|
||||
import { OAuth2Client, GoogleAuth, BaseExternalAccountClient } from 'google-auth-library';
|
||||
import { Endpoint } from './endpoint';
|
||||
import { GaxiosResponseWithHTTP2 } from './http2';
|
||||
export interface APIRequestParams<T = any> {
|
||||
options: MethodOptions;
|
||||
params: T;
|
||||
requiredParams: string[];
|
||||
pathParams: string[];
|
||||
context: APIRequestContext;
|
||||
mediaUrl?: string | null;
|
||||
}
|
||||
export interface GoogleConfigurable {
|
||||
_options: GlobalOptions;
|
||||
}
|
||||
export interface APIRequestContext {
|
||||
google?: GoogleConfigurable;
|
||||
_options: GlobalOptions;
|
||||
}
|
||||
/**
|
||||
* This interface is a mix of the AxiosRequestConfig options
|
||||
* and our `auth` options.
|
||||
*/
|
||||
export interface GlobalOptions extends MethodOptions {
|
||||
auth?: GoogleAuth | OAuth2Client | BaseExternalAccountClient | string;
|
||||
universeDomain?: string;
|
||||
universe_domain?: string;
|
||||
}
|
||||
export interface MethodOptions extends GaxiosOptions {
|
||||
apiVersion?: string;
|
||||
rootUrl?: string;
|
||||
http2?: boolean;
|
||||
userAgentDirectives?: UserAgentDirective[];
|
||||
}
|
||||
export interface StreamMethodOptions extends MethodOptions {
|
||||
responseType: 'stream';
|
||||
}
|
||||
/**
|
||||
* An additional directive to add to the user agent header.
|
||||
* Directives come in the form of:
|
||||
* User-Agent: <product> / <product-version> <comment>
|
||||
*
|
||||
* For more information, see:
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent
|
||||
*/
|
||||
export interface UserAgentDirective {
|
||||
product: string;
|
||||
version: string;
|
||||
comment?: string;
|
||||
}
|
||||
export interface ServiceOptions extends GlobalOptions {
|
||||
version?: string;
|
||||
}
|
||||
export type BodyResponseCallback<T> = (err: Error | null, res?: GaxiosResponseWithHTTP2<T> | null) => void;
|
||||
export type APIEndpoint = Readonly<Endpoint & any>;
|
||||
15
backend/node_modules/googleapis-common/build/src/api.js
generated
vendored
Normal file
15
backend/node_modules/googleapis-common/build/src/api.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
//# sourceMappingURL=api.js.map
|
||||
4
backend/node_modules/googleapis-common/build/src/apiIndex.d.ts
generated
vendored
Normal file
4
backend/node_modules/googleapis-common/build/src/apiIndex.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import { GoogleConfigurable, ServiceOptions } from '.';
|
||||
export declare function getAPI<T>(api: string, options: ServiceOptions | string, versions: {
|
||||
[index: string]: any;
|
||||
}, context?: GoogleConfigurable): T;
|
||||
40
backend/node_modules/googleapis-common/build/src/apiIndex.js
generated
vendored
Normal file
40
backend/node_modules/googleapis-common/build/src/apiIndex.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.getAPI = getAPI;
|
||||
function getAPI(api, options,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
versions, context) {
|
||||
let version;
|
||||
if (typeof options === 'string') {
|
||||
version = options;
|
||||
options = {};
|
||||
}
|
||||
else if (typeof options === 'object') {
|
||||
version = options.version;
|
||||
delete options.version;
|
||||
}
|
||||
else {
|
||||
throw new Error('Argument error: Accepts only string or object');
|
||||
}
|
||||
try {
|
||||
const ctr = versions[version];
|
||||
const ep = new ctr(options, context);
|
||||
return Object.freeze(ep);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Unable to load endpoint ${api}("${version}"): ${e.message}`);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=apiIndex.js.map
|
||||
9
backend/node_modules/googleapis-common/build/src/apirequest.d.ts
generated
vendored
Normal file
9
backend/node_modules/googleapis-common/build/src/apirequest.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { APIRequestParams, BodyResponseCallback } from './api';
|
||||
import { GaxiosResponseWithHTTP2 } from './http2';
|
||||
/**
|
||||
* Create and send request to Google API
|
||||
* @param parameters Parameters used to form request
|
||||
* @param callback Callback when request finished or error found
|
||||
*/
|
||||
export declare function createAPIRequest<T>(parameters: APIRequestParams): Promise<GaxiosResponseWithHTTP2<T>>;
|
||||
export declare function createAPIRequest<T>(parameters: APIRequestParams, callback: BodyResponseCallback<T>): void;
|
||||
344
backend/node_modules/googleapis-common/build/src/apirequest.js
generated
vendored
Normal file
344
backend/node_modules/googleapis-common/build/src/apirequest.js
generated
vendored
Normal file
@@ -0,0 +1,344 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.createAPIRequest = createAPIRequest;
|
||||
const gaxios_1 = require("gaxios");
|
||||
const qs = require("qs");
|
||||
const stream = require("stream");
|
||||
const urlTemplate = require("url-template");
|
||||
const extend = require("extend");
|
||||
const isbrowser_1 = require("./isbrowser");
|
||||
const h2 = require("./http2");
|
||||
const util_1 = require("./util");
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pkg = require('../../package.json');
|
||||
const randomUUID = () => globalThis.crypto?.randomUUID() || require('crypto').randomUUID();
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function isReadableStream(obj) {
|
||||
return (obj !== null &&
|
||||
typeof obj === 'object' &&
|
||||
typeof obj.pipe === 'function' &&
|
||||
obj.readable !== false &&
|
||||
typeof obj._read === 'function' &&
|
||||
typeof obj._readableState === 'object');
|
||||
}
|
||||
function getMissingParams(params, required) {
|
||||
const missing = new Array();
|
||||
required.forEach(param => {
|
||||
// Is the required param in the params object?
|
||||
if (params[param] === undefined) {
|
||||
missing.push(param);
|
||||
}
|
||||
});
|
||||
// If there are any required params missing, return their names in array,
|
||||
// otherwise return null
|
||||
return missing.length > 0 ? missing : null;
|
||||
}
|
||||
function createAPIRequest(parameters, callback) {
|
||||
if (callback) {
|
||||
createAPIRequestAsync(parameters).then(r => callback(null, r), callback);
|
||||
}
|
||||
else {
|
||||
return createAPIRequestAsync(parameters);
|
||||
}
|
||||
}
|
||||
async function createAPIRequestAsync(parameters) {
|
||||
// Combine the GaxiosOptions options passed with this specific
|
||||
// API call with the global options configured at the API Context
|
||||
// level, or at the global level.
|
||||
const options = extend(true, {}, // Ensure we don't leak settings upstream
|
||||
parameters.context.google?._options || {}, // Google level options
|
||||
parameters.context._options || {}, // Per-API options
|
||||
parameters.options);
|
||||
const params = extend(true, {}, // New base object
|
||||
options.params, // Combined global/per-api params
|
||||
parameters.params);
|
||||
options.userAgentDirectives = options.userAgentDirectives || [];
|
||||
const media = params.media || {};
|
||||
/**
|
||||
* In a previous version of this API, the request body was stuffed in a field
|
||||
* named `resource`. This caused lots of problems, because it's not uncommon
|
||||
* to have an actual named parameter required which is also named `resource`.
|
||||
* This meant that users would have to use `resource_` in those cases, which
|
||||
* pretty much nobody figures out on their own. The request body is now
|
||||
* documented as being in the `requestBody` property, but we also need to keep
|
||||
* using `resource` for reasons of back-compat. Cases that need to be covered
|
||||
* here:
|
||||
* - user provides just a `resource` with a request body
|
||||
* - user provides both a `resource` and a `resource_`
|
||||
* - user provides just a `requestBody`
|
||||
* - user provides both a `requestBody` and a `resource`
|
||||
*/
|
||||
let resource = params.requestBody;
|
||||
if (!params.requestBody &&
|
||||
params.resource &&
|
||||
(!parameters.requiredParams.includes('resource') ||
|
||||
typeof params.resource !== 'string')) {
|
||||
resource = params.resource;
|
||||
delete params.resource;
|
||||
}
|
||||
delete params.requestBody;
|
||||
let authClient = params.auth || options.auth;
|
||||
const defaultMime = typeof media.body === 'string' ? 'text/plain' : 'application/octet-stream';
|
||||
delete params.media;
|
||||
delete params.auth;
|
||||
// Grab headers from user provided options
|
||||
const headers = (0, util_1.headersToClassicHeaders)(params.headers || {});
|
||||
populateAPIHeader(headers, options.apiVersion);
|
||||
delete params.headers;
|
||||
// Un-alias parameters that were modified due to conflicts with reserved names
|
||||
Object.keys(params).forEach(key => {
|
||||
if (key.slice(-1) === '_') {
|
||||
const newKey = key.slice(0, -1);
|
||||
params[newKey] = params[key];
|
||||
delete params[key];
|
||||
}
|
||||
});
|
||||
// Check for missing required parameters in the API request
|
||||
const missingParams = getMissingParams(params, parameters.requiredParams);
|
||||
if (missingParams) {
|
||||
// Some params are missing - stop further operations and inform the
|
||||
// developer which required params are not included in the request
|
||||
throw new Error('Missing required parameters: ' + missingParams.join(', '));
|
||||
}
|
||||
// Parse urls
|
||||
if (options.url) {
|
||||
let url = options.url;
|
||||
if (typeof url === 'object') {
|
||||
url = url.toString();
|
||||
}
|
||||
options.url = urlTemplate.parse(url).expand(params);
|
||||
}
|
||||
if (parameters.mediaUrl) {
|
||||
parameters.mediaUrl = urlTemplate.parse(parameters.mediaUrl).expand(params);
|
||||
}
|
||||
// Rewrite url if rootUrl is globally set
|
||||
if (parameters.context._options.rootUrl !== undefined &&
|
||||
options.url !== undefined) {
|
||||
const originalUrl = new URL(options.url);
|
||||
const path = originalUrl.href.substr(originalUrl.origin.length);
|
||||
options.url = new URL(path, parameters.context._options.rootUrl).href;
|
||||
}
|
||||
// When forming the querystring, override the serializer so that array
|
||||
// values are serialized like this:
|
||||
// myParams: ['one', 'two'] ---> 'myParams=one&myParams=two'
|
||||
// This serializer also encodes spaces in the querystring as `%20`,
|
||||
// whereas the default serializer in gaxios encodes to a `+`.
|
||||
options.paramsSerializer = params => {
|
||||
return qs.stringify(params, { arrayFormat: 'repeat' });
|
||||
};
|
||||
// delete path params from the params object so they do not end up in query
|
||||
parameters.pathParams.forEach(param => delete params[param]);
|
||||
// if authClient is actually a string, use it as an API KEY
|
||||
if (typeof authClient === 'string') {
|
||||
params.key = params.key || authClient;
|
||||
authClient = undefined;
|
||||
}
|
||||
function multipartUpload(multipart) {
|
||||
const boundary = randomUUID();
|
||||
const finale = `--${boundary}--`;
|
||||
const rStream = new stream.PassThrough({
|
||||
flush(callback) {
|
||||
this.push('\r\n');
|
||||
this.push(finale);
|
||||
callback();
|
||||
},
|
||||
});
|
||||
const pStream = new ProgressStream();
|
||||
const isStream = isReadableStream(multipart[1].body);
|
||||
headers['content-type'] = `multipart/related; boundary=${boundary}`;
|
||||
for (const part of multipart) {
|
||||
const preamble = `--${boundary}\r\ncontent-type: ${part['content-type']}\r\n\r\n`;
|
||||
rStream.push(preamble);
|
||||
if (typeof part.body === 'string') {
|
||||
rStream.push(part.body);
|
||||
rStream.push('\r\n');
|
||||
}
|
||||
else {
|
||||
// Gaxios does not natively support onUploadProgress in node.js.
|
||||
// Pipe through the pStream first to read the number of bytes read
|
||||
// for the purpose of tracking progress.
|
||||
pStream.on('progress', bytesRead => {
|
||||
if (options.onUploadProgress) {
|
||||
options.onUploadProgress({ bytesRead });
|
||||
}
|
||||
});
|
||||
part.body.pipe(pStream).pipe(rStream);
|
||||
}
|
||||
}
|
||||
if (!isStream) {
|
||||
rStream.push(finale);
|
||||
rStream.push(null);
|
||||
}
|
||||
options.data = rStream;
|
||||
}
|
||||
function browserMultipartUpload(multipart) {
|
||||
const boundary = randomUUID();
|
||||
const finale = `--${boundary}--`;
|
||||
headers['content-type'] = `multipart/related; boundary=${boundary}`;
|
||||
let content = '';
|
||||
for (const part of multipart) {
|
||||
const preamble = `--${boundary}\r\ncontent-type: ${part['content-type']}\r\n\r\n`;
|
||||
content += preamble;
|
||||
if (typeof part.body === 'string') {
|
||||
content += part.body;
|
||||
content += '\r\n';
|
||||
}
|
||||
}
|
||||
content += finale;
|
||||
options.data = content;
|
||||
}
|
||||
if (parameters.mediaUrl && media.body) {
|
||||
options.url = parameters.mediaUrl;
|
||||
if (resource) {
|
||||
params.uploadType = 'multipart';
|
||||
const multipart = [
|
||||
{ 'content-type': 'application/json', body: JSON.stringify(resource) },
|
||||
{
|
||||
'content-type': media.mimeType || (resource && resource.mimeType) || defaultMime,
|
||||
body: media.body,
|
||||
},
|
||||
];
|
||||
if (!(0, isbrowser_1.isBrowser)()) {
|
||||
// gaxios doesn't support multipart/related uploads, so it has to
|
||||
// be implemented here.
|
||||
multipartUpload(multipart);
|
||||
}
|
||||
else {
|
||||
browserMultipartUpload(multipart);
|
||||
}
|
||||
}
|
||||
else {
|
||||
params.uploadType = 'media';
|
||||
Object.assign(headers, { 'content-type': media.mimeType || defaultMime });
|
||||
options.data = media.body;
|
||||
}
|
||||
}
|
||||
else {
|
||||
options.data = resource || undefined;
|
||||
}
|
||||
options.headers = gaxios_1.Gaxios.mergeHeaders(options.headers || {}, headers);
|
||||
options.params = params;
|
||||
if (!(0, isbrowser_1.isBrowser)()) {
|
||||
options.headers.set('Accept-Encoding', 'gzip');
|
||||
options.userAgentDirectives.push({
|
||||
product: 'google-api-nodejs-client',
|
||||
version: pkg.version,
|
||||
comment: 'gzip',
|
||||
});
|
||||
const userAgent = options.userAgentDirectives
|
||||
.map(d => {
|
||||
let line = `${d.product}/${d.version}`;
|
||||
if (d.comment) {
|
||||
line += ` (${d.comment})`;
|
||||
}
|
||||
return line;
|
||||
})
|
||||
.join(' ');
|
||||
options.headers.set('User-Agent', userAgent);
|
||||
}
|
||||
// By default gaxios treats any 2xx as valid, and all non 2xx status
|
||||
// codes as errors. This is a problem for HTTP 304s when used along
|
||||
// with an eTag.
|
||||
if (!options.validateStatus) {
|
||||
options.validateStatus = status => {
|
||||
return (status >= 200 && status < 300) || status === 304;
|
||||
};
|
||||
}
|
||||
// Retry by default
|
||||
options.retry = options.retry === undefined ? true : options.retry;
|
||||
delete options.auth; // is overridden by our auth code
|
||||
// Determine TPC universe
|
||||
if (options.universeDomain &&
|
||||
options.universe_domain &&
|
||||
options.universeDomain !== options.universe_domain) {
|
||||
throw new Error('Please set either universe_domain or universeDomain, but not both.');
|
||||
}
|
||||
const universeDomainEnvVar = typeof process === 'object' && typeof process.env === 'object'
|
||||
? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']
|
||||
: undefined;
|
||||
const universeDomain = options.universeDomain ??
|
||||
options.universe_domain ??
|
||||
universeDomainEnvVar ??
|
||||
'googleapis.com';
|
||||
// Update URL to point to the given TPC universe
|
||||
if (universeDomain !== 'googleapis.com' && options.url) {
|
||||
const url = new URL(options.url);
|
||||
if (url.hostname.endsWith('.googleapis.com')) {
|
||||
url.hostname = url.hostname.replace(/googleapis\.com$/, universeDomain);
|
||||
options.url = url.toString();
|
||||
}
|
||||
}
|
||||
// An empty params would add a querystring on a spec-compliant serializer
|
||||
if (!Object.keys(options.params).length) {
|
||||
delete options.params;
|
||||
delete options.paramsSerializer;
|
||||
}
|
||||
// Perform the HTTP request. NOTE: this function used to return a
|
||||
// mikeal/request object. Since the transition to Axios, the method is
|
||||
// now void. This may be a source of confusion for users upgrading from
|
||||
// version 24.0 -> 25.0 or up.
|
||||
if (authClient && typeof authClient === 'object') {
|
||||
// Validate TPC universe
|
||||
const universeFromAuth = typeof authClient.getUniverseDomain === 'function'
|
||||
? await authClient.getUniverseDomain()
|
||||
: undefined;
|
||||
if (universeFromAuth && universeDomain !== universeFromAuth) {
|
||||
throw new Error(`The configured universe domain (${universeDomain}) does not match the universe domain found in the credentials (${universeFromAuth}). ` +
|
||||
"If you haven't configured the universe domain explicitly, googleapis.com is the default.");
|
||||
}
|
||||
if (options.http2) {
|
||||
const authHeaders = await authClient.getRequestHeaders(options.url);
|
||||
const mooOpts = Object.assign({}, options);
|
||||
mooOpts.headers = gaxios_1.Gaxios.mergeHeaders(mooOpts.headers, authHeaders);
|
||||
return h2.request(mooOpts);
|
||||
}
|
||||
else {
|
||||
const res = await authClient.request(options);
|
||||
return (0, util_1.marshallGaxiosResponse)(res);
|
||||
}
|
||||
}
|
||||
else {
|
||||
return new gaxios_1.Gaxios()
|
||||
.request(options)
|
||||
.then(res => (0, util_1.marshallGaxiosResponse)(res));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Basic Passthrough Stream that records the number of bytes read
|
||||
* every time the cursor is moved.
|
||||
*/
|
||||
class ProgressStream extends stream.Transform {
|
||||
bytesRead = 0;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
_transform(chunk, encoding, callback) {
|
||||
this.bytesRead += chunk.length;
|
||||
this.emit('progress', this.bytesRead);
|
||||
this.push(chunk);
|
||||
callback();
|
||||
}
|
||||
}
|
||||
function populateAPIHeader(headers, apiVersion) {
|
||||
// TODO: we should eventually think about adding browser support for this
|
||||
// populating the gl-web header (web support should also be added to
|
||||
// google-auth-library-nodejs).
|
||||
if (!(0, isbrowser_1.isBrowser)()) {
|
||||
headers['x-goog-api-client'] =
|
||||
`gdcl/${pkg.version} gl-node/${process.versions.node}`;
|
||||
}
|
||||
if (apiVersion) {
|
||||
headers['x-goog-api-version'] = apiVersion;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=apirequest.js.map
|
||||
22
backend/node_modules/googleapis-common/build/src/authplus.d.ts
generated
vendored
Normal file
22
backend/node_modules/googleapis-common/build/src/authplus.d.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { AwsClient, BaseExternalAccountClient, Compute, ExternalAccountClient, GoogleAuth, GoogleAuthOptions, IdentityPoolClient, Impersonated, JWT, OAuth2Client, ProjectIdCallback, UserRefreshClient } from 'google-auth-library';
|
||||
export declare class AuthPlus extends GoogleAuth {
|
||||
JWT: typeof JWT;
|
||||
Compute: typeof Compute;
|
||||
OAuth2: typeof OAuth2Client;
|
||||
GoogleAuth: typeof GoogleAuth;
|
||||
AwsClient: typeof AwsClient;
|
||||
IdentityPoolClient: typeof IdentityPoolClient;
|
||||
ExternalAccountClient: typeof ExternalAccountClient;
|
||||
private _cachedAuth?;
|
||||
/**
|
||||
* Override getClient(), memoizing an instance of auth for
|
||||
* subsequent calls to getProjectId().
|
||||
*/
|
||||
getClient(options?: GoogleAuthOptions): Promise<Compute | JWT | UserRefreshClient | BaseExternalAccountClient | Impersonated>;
|
||||
/**
|
||||
* Override getProjectId(), using the most recently configured
|
||||
* auth instance when fetching projectId.
|
||||
*/
|
||||
getProjectId(): Promise<string>;
|
||||
getProjectId(callback: ProjectIdCallback): void;
|
||||
}
|
||||
49
backend/node_modules/googleapis-common/build/src/authplus.js
generated
vendored
Normal file
49
backend/node_modules/googleapis-common/build/src/authplus.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.AuthPlus = void 0;
|
||||
const google_auth_library_1 = require("google-auth-library");
|
||||
class AuthPlus extends google_auth_library_1.GoogleAuth {
|
||||
JWT = google_auth_library_1.JWT;
|
||||
Compute = google_auth_library_1.Compute;
|
||||
OAuth2 = google_auth_library_1.OAuth2Client;
|
||||
GoogleAuth = google_auth_library_1.GoogleAuth;
|
||||
AwsClient = google_auth_library_1.AwsClient;
|
||||
IdentityPoolClient = google_auth_library_1.IdentityPoolClient;
|
||||
ExternalAccountClient = google_auth_library_1.ExternalAccountClient;
|
||||
_cachedAuth;
|
||||
/**
|
||||
* Override getClient(), memoizing an instance of auth for
|
||||
* subsequent calls to getProjectId().
|
||||
*/
|
||||
async getClient(options) {
|
||||
this._cachedAuth = new google_auth_library_1.GoogleAuth(options);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return this._cachedAuth.getClient();
|
||||
}
|
||||
getProjectId(callback) {
|
||||
if (callback) {
|
||||
return this._cachedAuth
|
||||
? this._cachedAuth.getProjectId(callback)
|
||||
: super.getProjectId(callback);
|
||||
}
|
||||
else {
|
||||
return this._cachedAuth
|
||||
? this._cachedAuth.getProjectId()
|
||||
: super.getProjectId();
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.AuthPlus = AuthPlus;
|
||||
//# sourceMappingURL=authplus.js.map
|
||||
42
backend/node_modules/googleapis-common/build/src/discovery.d.ts
generated
vendored
Normal file
42
backend/node_modules/googleapis-common/build/src/discovery.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { GlobalOptions } from './api';
|
||||
import { Endpoint } from './endpoint';
|
||||
export type EndpointCreator = (options: GlobalOptions, google: {}) => Endpoint;
|
||||
export interface DiscoveryOptions {
|
||||
includePrivate?: boolean;
|
||||
debug?: boolean;
|
||||
}
|
||||
export declare class Discovery {
|
||||
private transporter;
|
||||
private options;
|
||||
/**
|
||||
* Discovery for discovering API endpoints
|
||||
*
|
||||
* @param options Options for discovery
|
||||
*/
|
||||
constructor(options: DiscoveryOptions);
|
||||
/**
|
||||
* Generate and Endpoint from an endpoint schema object.
|
||||
*
|
||||
* @param schema The schema from which to generate the Endpoint.
|
||||
* @return A function that creates an endpoint.
|
||||
*/
|
||||
private makeEndpoint;
|
||||
/**
|
||||
* Log output of generator. Works just like console.log
|
||||
*/
|
||||
private log;
|
||||
/**
|
||||
* Generate all APIs and return as in-memory object.
|
||||
* @param discoveryUrl
|
||||
*/
|
||||
discoverAllAPIs(discoveryUrl: string): Promise<{}>;
|
||||
/**
|
||||
* Generate API file given discovery URL
|
||||
*
|
||||
* @param apiDiscoveryUrl URL or filename of discovery doc for API
|
||||
* @returns A promise that resolves with a function that creates the endpoint
|
||||
*/
|
||||
discoverAPI(apiDiscoveryUrl: string | {
|
||||
url?: string;
|
||||
}): Promise<EndpointCreator>;
|
||||
}
|
||||
143
backend/node_modules/googleapis-common/build/src/discovery.js
generated
vendored
Normal file
143
backend/node_modules/googleapis-common/build/src/discovery.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.Discovery = void 0;
|
||||
const fs = require("fs");
|
||||
const gaxios_1 = require("gaxios");
|
||||
const resolve = require("url");
|
||||
const util = require("util");
|
||||
const apirequest_1 = require("./apirequest");
|
||||
const endpoint_1 = require("./endpoint");
|
||||
const readFile = util.promisify(fs.readFile);
|
||||
class Discovery {
|
||||
transporter = new gaxios_1.Gaxios();
|
||||
options;
|
||||
/**
|
||||
* Discovery for discovering API endpoints
|
||||
*
|
||||
* @param options Options for discovery
|
||||
*/
|
||||
constructor(options) {
|
||||
this.options = options || {};
|
||||
}
|
||||
/**
|
||||
* Generate and Endpoint from an endpoint schema object.
|
||||
*
|
||||
* @param schema The schema from which to generate the Endpoint.
|
||||
* @return A function that creates an endpoint.
|
||||
*/
|
||||
makeEndpoint(schema) {
|
||||
return (options) => {
|
||||
const ep = new endpoint_1.Endpoint(options);
|
||||
ep.applySchema(ep, schema, schema, ep);
|
||||
return ep;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Log output of generator. Works just like console.log
|
||||
*/
|
||||
log(...args) {
|
||||
if (this.options && this.options.debug) {
|
||||
console.log(...args);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Generate all APIs and return as in-memory object.
|
||||
* @param discoveryUrl
|
||||
*/
|
||||
async discoverAllAPIs(discoveryUrl) {
|
||||
const headers = new Headers(this.options.includePrivate ? {} : { 'X-User-Ip': '0.0.0.0' });
|
||||
const res = await this.transporter.request({
|
||||
url: discoveryUrl,
|
||||
headers,
|
||||
});
|
||||
const items = res.data.items;
|
||||
const apis = await Promise.all(items.map(async (api) => {
|
||||
const endpointCreator = await this.discoverAPI(api.discoveryRestUrl);
|
||||
return { api, endpointCreator };
|
||||
}));
|
||||
const versionIndex = {};
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const apisIndex = {};
|
||||
for (const set of apis) {
|
||||
if (!apisIndex[set.api.name]) {
|
||||
versionIndex[set.api.name] = {};
|
||||
apisIndex[set.api.name] = (options) => {
|
||||
const type = typeof options;
|
||||
let version;
|
||||
if (type === 'string') {
|
||||
version = options;
|
||||
options = {};
|
||||
}
|
||||
else if (type === 'object') {
|
||||
version = options.version;
|
||||
delete options.version;
|
||||
}
|
||||
else {
|
||||
throw new Error('Argument error: Accepts only string or object');
|
||||
}
|
||||
try {
|
||||
const ep = set.endpointCreator(options, this);
|
||||
return Object.freeze(ep); // create new & freeze
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(util.format('Unable to load endpoint %s("%s"): %s', set.api.name, version, e.message));
|
||||
}
|
||||
};
|
||||
}
|
||||
versionIndex[set.api.name][set.api.version] = set.endpointCreator;
|
||||
}
|
||||
return apisIndex;
|
||||
}
|
||||
/**
|
||||
* Generate API file given discovery URL
|
||||
*
|
||||
* @param apiDiscoveryUrl URL or filename of discovery doc for API
|
||||
* @returns A promise that resolves with a function that creates the endpoint
|
||||
*/
|
||||
async discoverAPI(apiDiscoveryUrl) {
|
||||
if (typeof apiDiscoveryUrl === 'string') {
|
||||
const parts = resolve.parse(apiDiscoveryUrl);
|
||||
if (apiDiscoveryUrl && !parts.protocol) {
|
||||
this.log('Reading from file ' + apiDiscoveryUrl);
|
||||
const file = await readFile(apiDiscoveryUrl, { encoding: 'utf8' });
|
||||
return this.makeEndpoint(JSON.parse(file));
|
||||
}
|
||||
else {
|
||||
this.log('Requesting ' + apiDiscoveryUrl);
|
||||
const res = await this.transporter.request({
|
||||
url: apiDiscoveryUrl,
|
||||
});
|
||||
return this.makeEndpoint(res.data);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const options = apiDiscoveryUrl;
|
||||
this.log('Requesting ' + options.url);
|
||||
const url = options.url;
|
||||
delete options.url;
|
||||
const parameters = {
|
||||
options: { url, method: 'GET' },
|
||||
requiredParams: [],
|
||||
pathParams: [],
|
||||
params: options,
|
||||
context: { google: { _options: {} }, _options: {} },
|
||||
};
|
||||
const res = await (0, apirequest_1.createAPIRequest)(parameters);
|
||||
return this.makeEndpoint(res.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Discovery = Discovery;
|
||||
//# sourceMappingURL=discovery.js.map
|
||||
42
backend/node_modules/googleapis-common/build/src/endpoint.d.ts
generated
vendored
Normal file
42
backend/node_modules/googleapis-common/build/src/endpoint.d.ts
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
import { APIRequestContext, GlobalOptions } from './api';
|
||||
import { Schema, SchemaResource } from './schema';
|
||||
export interface Target {
|
||||
[index: string]: {};
|
||||
}
|
||||
export declare class Endpoint implements Target, APIRequestContext {
|
||||
_options: GlobalOptions;
|
||||
google: any;
|
||||
[index: string]: {};
|
||||
constructor(options: {});
|
||||
/**
|
||||
* Given a schema, add methods and resources to a target.
|
||||
*
|
||||
* @param {object} target The target to which to apply the schema.
|
||||
* @param {object} rootSchema The top-level schema, so we don't lose track of it
|
||||
* during recursion.
|
||||
* @param {object} schema The current schema from which to extract methods and
|
||||
* resources.
|
||||
* @param {object} context The context to add to each method.
|
||||
*/
|
||||
applySchema(target: Target, rootSchema: Schema, schema: SchemaResource, context: APIRequestContext): void;
|
||||
/**
|
||||
* Given a schema, add methods to a target.
|
||||
*
|
||||
* @param {object} target The target to which to apply the methods.
|
||||
* @param {object} rootSchema The top-level schema, so we don't lose track of it
|
||||
* during recursion.
|
||||
* @param {object} schema The current schema from which to extract methods.
|
||||
* @param {object} context The context to add to each method.
|
||||
*/
|
||||
private applyMethodsFromSchema;
|
||||
/**
|
||||
* Given a method schema, add a method to a target.
|
||||
*
|
||||
* @param target The target to which to add the method.
|
||||
* @param schema The top-level schema that contains the rootUrl, etc.
|
||||
* @param method The method schema from which to generate the method.
|
||||
* @param context The context to add to the method.
|
||||
*/
|
||||
private makeMethod;
|
||||
private getPathParams;
|
||||
}
|
||||
132
backend/node_modules/googleapis-common/build/src/endpoint.js
generated
vendored
Normal file
132
backend/node_modules/googleapis-common/build/src/endpoint.js
generated
vendored
Normal file
@@ -0,0 +1,132 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.Endpoint = void 0;
|
||||
const apirequest_1 = require("./apirequest");
|
||||
class Endpoint {
|
||||
_options;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
google;
|
||||
constructor(options) {
|
||||
this._options = options || {};
|
||||
}
|
||||
/**
|
||||
* Given a schema, add methods and resources to a target.
|
||||
*
|
||||
* @param {object} target The target to which to apply the schema.
|
||||
* @param {object} rootSchema The top-level schema, so we don't lose track of it
|
||||
* during recursion.
|
||||
* @param {object} schema The current schema from which to extract methods and
|
||||
* resources.
|
||||
* @param {object} context The context to add to each method.
|
||||
*/
|
||||
applySchema(target, rootSchema, schema, context) {
|
||||
this.applyMethodsFromSchema(target, rootSchema, schema, context);
|
||||
if (schema.resources) {
|
||||
for (const resourceName in schema.resources) {
|
||||
if (Object.prototype.hasOwnProperty.call(schema.resources, resourceName)) {
|
||||
const resource = schema.resources[resourceName];
|
||||
if (!target[resourceName]) {
|
||||
target[resourceName] = {};
|
||||
}
|
||||
this.applySchema(target[resourceName], rootSchema, resource, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Given a schema, add methods to a target.
|
||||
*
|
||||
* @param {object} target The target to which to apply the methods.
|
||||
* @param {object} rootSchema The top-level schema, so we don't lose track of it
|
||||
* during recursion.
|
||||
* @param {object} schema The current schema from which to extract methods.
|
||||
* @param {object} context The context to add to each method.
|
||||
*/
|
||||
applyMethodsFromSchema(target, rootSchema, schema, context) {
|
||||
if (schema.methods) {
|
||||
for (const name in schema.methods) {
|
||||
if (Object.prototype.hasOwnProperty.call(schema.methods, name)) {
|
||||
const method = schema.methods[name];
|
||||
target[name] = this.makeMethod(rootSchema, method, context);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Given a method schema, add a method to a target.
|
||||
*
|
||||
* @param target The target to which to add the method.
|
||||
* @param schema The top-level schema that contains the rootUrl, etc.
|
||||
* @param method The method schema from which to generate the method.
|
||||
* @param context The context to add to the method.
|
||||
*/
|
||||
makeMethod(schema, method, context) {
|
||||
return (paramsOrCallback, callback) => {
|
||||
const params = typeof paramsOrCallback === 'function' ? {} : paramsOrCallback;
|
||||
callback =
|
||||
typeof paramsOrCallback === 'function'
|
||||
? paramsOrCallback
|
||||
: callback;
|
||||
const schemaUrl = buildurl(schema.rootUrl + schema.servicePath + method.path);
|
||||
const parameters = {
|
||||
options: {
|
||||
url: schemaUrl.substring(1, schemaUrl.length - 1),
|
||||
method: method.httpMethod,
|
||||
apiVersion: method.apiVersion,
|
||||
},
|
||||
params,
|
||||
requiredParams: method.parameterOrder || [],
|
||||
pathParams: this.getPathParams(method.parameters),
|
||||
context,
|
||||
};
|
||||
if (method.mediaUpload &&
|
||||
method.mediaUpload.protocols &&
|
||||
method.mediaUpload.protocols.simple &&
|
||||
method.mediaUpload.protocols.simple.path) {
|
||||
const mediaUrl = buildurl(schema.rootUrl + method.mediaUpload.protocols.simple.path);
|
||||
parameters.mediaUrl = mediaUrl.substring(1, mediaUrl.length - 1);
|
||||
}
|
||||
if (!callback) {
|
||||
return (0, apirequest_1.createAPIRequest)(parameters);
|
||||
}
|
||||
(0, apirequest_1.createAPIRequest)(parameters, callback);
|
||||
return;
|
||||
};
|
||||
}
|
||||
getPathParams(params) {
|
||||
const pathParams = new Array();
|
||||
if (typeof params !== 'object') {
|
||||
params = {};
|
||||
}
|
||||
Object.keys(params).forEach(key => {
|
||||
if (params[key].location === 'path') {
|
||||
pathParams.push(key);
|
||||
}
|
||||
});
|
||||
return pathParams;
|
||||
}
|
||||
}
|
||||
exports.Endpoint = Endpoint;
|
||||
/**
|
||||
* Build a string used to create a URL from the discovery doc provided URL.
|
||||
* replace double slashes with single slash (except in https://)
|
||||
* @private
|
||||
* @param input URL to build from
|
||||
* @return Resulting built URL
|
||||
*/
|
||||
function buildurl(input) {
|
||||
return input ? `'${input}'`.replace(/([^:]\/)\/+/g, '$1') : '';
|
||||
}
|
||||
//# sourceMappingURL=endpoint.js.map
|
||||
31
backend/node_modules/googleapis-common/build/src/http2.d.ts
generated
vendored
Normal file
31
backend/node_modules/googleapis-common/build/src/http2.d.ts
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import * as http2 from 'http2';
|
||||
import { URL } from 'url';
|
||||
import { GaxiosResponse, GaxiosOptions } from 'gaxios';
|
||||
/**
|
||||
* Reference to the ClientHttp2Session and a timeout handler.
|
||||
* @private
|
||||
*/
|
||||
export interface SessionData {
|
||||
session: http2.ClientHttp2Session;
|
||||
timeoutHandle?: NodeJS.Timeout;
|
||||
}
|
||||
/**
|
||||
* List of sessions current in use.
|
||||
* @private
|
||||
*/
|
||||
export declare const sessions: {
|
||||
[index: string]: SessionData;
|
||||
};
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
export interface GaxiosResponseWithHTTP2<T = ReturnType<JSON['parse']>> extends Omit<GaxiosResponse<T>, 'headers'> {
|
||||
request?: http2.ClientHttp2Stream;
|
||||
headers: http2.IncomingHttpHeaders & http2.IncomingHttpStatusHeader;
|
||||
}
|
||||
/**
|
||||
* Public method to make an http2 request.
|
||||
* @param config - Request options.
|
||||
*/
|
||||
export declare function request<T>(config: GaxiosOptions): Promise<GaxiosResponseWithHTTP2<T>>;
|
||||
export declare function closeSession(url: URL): Promise<void>;
|
||||
240
backend/node_modules/googleapis-common/build/src/http2.js
generated
vendored
Normal file
240
backend/node_modules/googleapis-common/build/src/http2.js
generated
vendored
Normal file
@@ -0,0 +1,240 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.sessions = void 0;
|
||||
exports.request = request;
|
||||
exports.closeSession = closeSession;
|
||||
const http2 = require("http2");
|
||||
const zlib = require("zlib");
|
||||
const url_1 = require("url");
|
||||
const qs = require("qs");
|
||||
const extend = require("extend");
|
||||
const stream_1 = require("stream");
|
||||
const util = require("util");
|
||||
const process = require("process");
|
||||
const util_1 = require("./util");
|
||||
const { HTTP2_HEADER_CONTENT_ENCODING, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_STATUS, } = http2.constants;
|
||||
const DEBUG = !!process.env.HTTP2_DEBUG;
|
||||
/**
|
||||
* List of sessions current in use.
|
||||
* @private
|
||||
*/
|
||||
exports.sessions = {};
|
||||
/**
|
||||
* Public method to make an http2 request.
|
||||
* @param config - Request options.
|
||||
*/
|
||||
async function request(config) {
|
||||
const opts = extend(true, {}, config);
|
||||
opts.validateStatus = opts.validateStatus || validateStatus;
|
||||
opts.responseType = opts.responseType || 'json';
|
||||
const url = new url_1.URL(opts.url);
|
||||
// Check for an existing session to this host, or go create a new one.
|
||||
const sessionData = _getClient(url.host);
|
||||
// Since we're using this session, clear the timeout handle to ensure
|
||||
// it stays in memory and connected for a while further.
|
||||
if (sessionData.timeoutHandle !== undefined) {
|
||||
clearTimeout(sessionData.timeoutHandle);
|
||||
}
|
||||
// Assemble the querystring based on config.params. We're using the
|
||||
// `qs` module to make life a little easier.
|
||||
let pathWithQs = url.pathname;
|
||||
if (config.params && Object.keys(config.params).length > 0) {
|
||||
const serializer = config.paramsSerializer || qs.stringify;
|
||||
const q = serializer(opts.params);
|
||||
pathWithQs += `?${q}`;
|
||||
}
|
||||
// Assemble the headers based on basic HTTP2 primitives (path, method) and
|
||||
// custom headers sent from the consumer. Note: the native `Headers` type does
|
||||
// not support HTTP2 header names (e.g. ':status')
|
||||
const headers = (0, util_1.headersToClassicHeaders)(opts.headers);
|
||||
headers[HTTP2_HEADER_PATH] = pathWithQs;
|
||||
headers[HTTP2_HEADER_METHOD] = config.method || 'GET';
|
||||
opts.headers = headers;
|
||||
// NOTE: This is working around an upstream bug in `apirequest.ts`. The
|
||||
// request path assumes that the `content-type` header is going to be set in
|
||||
// the underlying HTTP Client. This hack provides bug for bug compatability
|
||||
// with this bug in gaxios:
|
||||
// https://github.com/googleapis/gaxios/blob/main/src/gaxios.ts#L202
|
||||
if (!headers[HTTP2_HEADER_CONTENT_TYPE]) {
|
||||
if (opts.responseType !== 'text') {
|
||||
headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/json';
|
||||
}
|
||||
}
|
||||
const res = {
|
||||
config,
|
||||
headers: {},
|
||||
status: 0,
|
||||
data: {},
|
||||
statusText: '',
|
||||
};
|
||||
const chunks = [];
|
||||
const session = sessionData.session;
|
||||
let req;
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
req = session
|
||||
.request(headers)
|
||||
.on('response', responseHeaders => {
|
||||
Object.assign(res, {
|
||||
headers: responseHeaders,
|
||||
status: responseHeaders[HTTP2_HEADER_STATUS],
|
||||
});
|
||||
let stream = req;
|
||||
if (responseHeaders[HTTP2_HEADER_CONTENT_ENCODING] === 'gzip') {
|
||||
stream = req.pipe(zlib.createGunzip());
|
||||
}
|
||||
if (opts.responseType === 'stream') {
|
||||
res.data = stream;
|
||||
resolve(res);
|
||||
return;
|
||||
}
|
||||
stream
|
||||
.on('data', d => {
|
||||
chunks.push(d);
|
||||
})
|
||||
.on('error', err => {
|
||||
reject(err);
|
||||
return;
|
||||
})
|
||||
.on('end', () => {
|
||||
const buf = Buffer.concat(chunks);
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
let data = buf;
|
||||
if (buf) {
|
||||
if (opts.responseType === 'json') {
|
||||
try {
|
||||
data = JSON.parse(buf.toString('utf8'));
|
||||
}
|
||||
catch {
|
||||
data = buf.toString('utf8');
|
||||
}
|
||||
}
|
||||
else if (opts.responseType === 'text') {
|
||||
data = buf.toString('utf8');
|
||||
}
|
||||
else if (opts.responseType === 'arraybuffer') {
|
||||
data = buf.buffer;
|
||||
}
|
||||
res.data = data;
|
||||
}
|
||||
if (!opts.validateStatus(res.status)) {
|
||||
let message = `Request failed with status code ${res.status}. `;
|
||||
if (res.data && typeof res.data === 'object') {
|
||||
const body = util.inspect(res.data, { depth: 5 });
|
||||
message = `${message}\n'${body}`;
|
||||
}
|
||||
reject(new Error(message, { cause: res }));
|
||||
}
|
||||
resolve(res);
|
||||
return;
|
||||
});
|
||||
})
|
||||
.on('error', e => {
|
||||
reject(e);
|
||||
return;
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
closeSession(url)
|
||||
.then(() => reject(e))
|
||||
.catch(reject);
|
||||
return;
|
||||
}
|
||||
res.request = req;
|
||||
// If data was provided, write it to the request in the form of
|
||||
// a stream, string data, or a basic object.
|
||||
if (config.data) {
|
||||
if (config.data instanceof stream_1.Stream) {
|
||||
config.data.pipe(req);
|
||||
}
|
||||
else if (typeof config.data === 'string') {
|
||||
const data = Buffer.from(config.data);
|
||||
req.end(data);
|
||||
}
|
||||
else if (typeof config.data === 'object') {
|
||||
const data = JSON.stringify(config.data);
|
||||
req.end(data);
|
||||
}
|
||||
}
|
||||
// Create a timeout so the Http2Session will be cleaned up after
|
||||
// a period of non-use. 500 milliseconds was chosen because it's
|
||||
// a nice round number, and I don't know what would be a better
|
||||
// choice. Keeping this channel open will hold a file descriptor
|
||||
// which will prevent the process from exiting.
|
||||
sessionData.timeoutHandle = setTimeout(() => closeSession(url), 500);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* By default, throw for any non-2xx status code
|
||||
* @param status - status code from the HTTP response
|
||||
*/
|
||||
function validateStatus(status) {
|
||||
return status >= 200 && status < 300;
|
||||
}
|
||||
/**
|
||||
* Obtain an existing h2 session or go create a new one.
|
||||
* @param host - The hostname to which the session belongs.
|
||||
*/
|
||||
function _getClient(host) {
|
||||
if (!exports.sessions[host]) {
|
||||
if (DEBUG) {
|
||||
console.log(`Creating client for ${host}`);
|
||||
}
|
||||
const session = http2.connect(`https://${host}`);
|
||||
session
|
||||
.on('error', e => {
|
||||
console.error(`*ERROR*: ${e}`);
|
||||
delete exports.sessions[host];
|
||||
})
|
||||
.on('goaway', (errorCode, lastStreamId) => {
|
||||
console.error(`*GOAWAY*: ${errorCode} : ${lastStreamId}`);
|
||||
delete exports.sessions[host];
|
||||
});
|
||||
exports.sessions[host] = { session };
|
||||
}
|
||||
else {
|
||||
if (DEBUG) {
|
||||
console.log(`Used cached client for ${host}`);
|
||||
}
|
||||
}
|
||||
return exports.sessions[host];
|
||||
}
|
||||
async function closeSession(url) {
|
||||
const sessionData = exports.sessions[url.host];
|
||||
if (!sessionData) {
|
||||
return;
|
||||
}
|
||||
const { session } = sessionData;
|
||||
delete exports.sessions[url.host];
|
||||
if (DEBUG) {
|
||||
console.error(`Closing ${url.host}`);
|
||||
}
|
||||
session.close(() => {
|
||||
if (DEBUG) {
|
||||
console.error(`Closed ${url.host}`);
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (session && !session.destroyed) {
|
||||
if (DEBUG) {
|
||||
console.log(`Forcing close ${url.host}`);
|
||||
}
|
||||
if (session) {
|
||||
session.destroy();
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
//# sourceMappingURL=http2.js.map
|
||||
13
backend/node_modules/googleapis-common/build/src/index.d.ts
generated
vendored
Normal file
13
backend/node_modules/googleapis-common/build/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export * as googleAuthLibrary from 'google-auth-library';
|
||||
export * as gaxios from 'gaxios';
|
||||
export { OAuth2Client, JWT, Compute, UserRefreshClient, GoogleAuth, ExternalAccountClient, BaseExternalAccountClient, IdentityPoolClient, AwsClient, } from 'google-auth-library';
|
||||
export { GaxiosPromise, Gaxios, GaxiosError, GaxiosOptions, GaxiosResponse, RetryConfig, } from 'gaxios';
|
||||
export { APIEndpoint, APIRequestContext, APIRequestParams, BodyResponseCallback, GlobalOptions, GoogleConfigurable, MethodOptions, StreamMethodOptions, ServiceOptions, } from './api';
|
||||
export { getAPI } from './apiIndex';
|
||||
export { createAPIRequest } from './apirequest';
|
||||
export { AuthPlus } from './authplus';
|
||||
export { Discovery, DiscoveryOptions, EndpointCreator } from './discovery';
|
||||
export { Endpoint, Target } from './endpoint';
|
||||
export { FragmentResponse, HttpMethod, ParameterFormat, Schema, SchemaItem, SchemaItems, SchemaMethod, SchemaMethods, SchemaParameter, SchemaParameters, SchemaResource, SchemaResources, Schemas, SchemaType, } from './schema';
|
||||
export { GaxiosResponseWithHTTP2 } from './http2';
|
||||
export * from './util';
|
||||
57
backend/node_modules/googleapis-common/build/src/index.js
generated
vendored
Normal file
57
backend/node_modules/googleapis-common/build/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Endpoint = exports.Discovery = exports.AuthPlus = exports.createAPIRequest = exports.getAPI = exports.GaxiosError = exports.Gaxios = exports.AwsClient = exports.IdentityPoolClient = exports.BaseExternalAccountClient = exports.ExternalAccountClient = exports.GoogleAuth = exports.UserRefreshClient = exports.Compute = exports.JWT = exports.OAuth2Client = exports.gaxios = exports.googleAuthLibrary = void 0;
|
||||
// re-exporting key dependencies
|
||||
exports.googleAuthLibrary = require("google-auth-library");
|
||||
exports.gaxios = require("gaxios");
|
||||
var google_auth_library_1 = require("google-auth-library");
|
||||
Object.defineProperty(exports, "OAuth2Client", { enumerable: true, get: function () { return google_auth_library_1.OAuth2Client; } });
|
||||
Object.defineProperty(exports, "JWT", { enumerable: true, get: function () { return google_auth_library_1.JWT; } });
|
||||
Object.defineProperty(exports, "Compute", { enumerable: true, get: function () { return google_auth_library_1.Compute; } });
|
||||
Object.defineProperty(exports, "UserRefreshClient", { enumerable: true, get: function () { return google_auth_library_1.UserRefreshClient; } });
|
||||
Object.defineProperty(exports, "GoogleAuth", { enumerable: true, get: function () { return google_auth_library_1.GoogleAuth; } });
|
||||
Object.defineProperty(exports, "ExternalAccountClient", { enumerable: true, get: function () { return google_auth_library_1.ExternalAccountClient; } });
|
||||
Object.defineProperty(exports, "BaseExternalAccountClient", { enumerable: true, get: function () { return google_auth_library_1.BaseExternalAccountClient; } });
|
||||
Object.defineProperty(exports, "IdentityPoolClient", { enumerable: true, get: function () { return google_auth_library_1.IdentityPoolClient; } });
|
||||
Object.defineProperty(exports, "AwsClient", { enumerable: true, get: function () { return google_auth_library_1.AwsClient; } });
|
||||
var gaxios_1 = require("gaxios");
|
||||
Object.defineProperty(exports, "Gaxios", { enumerable: true, get: function () { return gaxios_1.Gaxios; } });
|
||||
Object.defineProperty(exports, "GaxiosError", { enumerable: true, get: function () { return gaxios_1.GaxiosError; } });
|
||||
var apiIndex_1 = require("./apiIndex");
|
||||
Object.defineProperty(exports, "getAPI", { enumerable: true, get: function () { return apiIndex_1.getAPI; } });
|
||||
var apirequest_1 = require("./apirequest");
|
||||
Object.defineProperty(exports, "createAPIRequest", { enumerable: true, get: function () { return apirequest_1.createAPIRequest; } });
|
||||
var authplus_1 = require("./authplus");
|
||||
Object.defineProperty(exports, "AuthPlus", { enumerable: true, get: function () { return authplus_1.AuthPlus; } });
|
||||
var discovery_1 = require("./discovery");
|
||||
Object.defineProperty(exports, "Discovery", { enumerable: true, get: function () { return discovery_1.Discovery; } });
|
||||
var endpoint_1 = require("./endpoint");
|
||||
Object.defineProperty(exports, "Endpoint", { enumerable: true, get: function () { return endpoint_1.Endpoint; } });
|
||||
__exportStar(require("./util"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/googleapis-common/build/src/isbrowser.d.ts
generated
vendored
Normal file
1
backend/node_modules/googleapis-common/build/src/isbrowser.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function isBrowser(): boolean;
|
||||
19
backend/node_modules/googleapis-common/build/src/isbrowser.js
generated
vendored
Normal file
19
backend/node_modules/googleapis-common/build/src/isbrowser.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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 });
|
||||
exports.isBrowser = isBrowser;
|
||||
function isBrowser() {
|
||||
return typeof window !== 'undefined';
|
||||
}
|
||||
//# sourceMappingURL=isbrowser.js.map
|
||||
128
backend/node_modules/googleapis-common/build/src/schema.d.ts
generated
vendored
Normal file
128
backend/node_modules/googleapis-common/build/src/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* These are a collection of interfaces that represent the GoogleApis
|
||||
* Discovery json formats.
|
||||
*/
|
||||
export interface Schemas {
|
||||
discoveryVersion: string;
|
||||
kind: string;
|
||||
items: Schema[];
|
||||
}
|
||||
export interface Schema {
|
||||
auth: {
|
||||
oauth2: {
|
||||
scopes: {
|
||||
[index: string]: {
|
||||
description: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
basePath: string;
|
||||
baseUrl: string;
|
||||
batchPath: string;
|
||||
description: string;
|
||||
discoveryVersion: string;
|
||||
discoveryRestUrl: string;
|
||||
documentationLink: string;
|
||||
etag: string;
|
||||
icons: {
|
||||
x16: string;
|
||||
x32: string;
|
||||
};
|
||||
id: string;
|
||||
kind: string;
|
||||
methods: SchemaMethods;
|
||||
name: string;
|
||||
ownerDomain: string;
|
||||
ownerName: string;
|
||||
parameters: SchemaParameters;
|
||||
protocol: string;
|
||||
resources: SchemaResources;
|
||||
revision: string;
|
||||
rootUrl: string;
|
||||
schemas: SchemaItems;
|
||||
servicePath: string;
|
||||
title: string;
|
||||
version: string;
|
||||
}
|
||||
export interface SchemaResources {
|
||||
[index: string]: SchemaResource;
|
||||
}
|
||||
export interface SchemaResource {
|
||||
methods?: SchemaMethods;
|
||||
resources?: SchemaResources;
|
||||
}
|
||||
export interface SchemaItems {
|
||||
[index: string]: SchemaItem;
|
||||
}
|
||||
export interface SchemaItem {
|
||||
description?: string;
|
||||
default?: string;
|
||||
id?: string;
|
||||
properties?: {
|
||||
[index: string]: SchemaItem;
|
||||
};
|
||||
additionalProperties?: {
|
||||
[index: string]: SchemaItem;
|
||||
};
|
||||
items?: {
|
||||
[index: string]: SchemaItem;
|
||||
};
|
||||
type?: SchemaType;
|
||||
format?: ParameterFormat;
|
||||
$ref?: string;
|
||||
}
|
||||
export interface SchemaParameters {
|
||||
[index: string]: SchemaParameter;
|
||||
}
|
||||
export interface SchemaParameter {
|
||||
default: string;
|
||||
description: string;
|
||||
location: string;
|
||||
enum: string[];
|
||||
enumDescription: string[];
|
||||
type: SchemaType;
|
||||
format: ParameterFormat;
|
||||
required: boolean;
|
||||
}
|
||||
export interface SchemaMethods {
|
||||
[index: string]: SchemaMethod;
|
||||
}
|
||||
export interface SchemaMethod {
|
||||
description: string;
|
||||
httpMethod: HttpMethod;
|
||||
id: string;
|
||||
parameterOrder?: string[];
|
||||
parameters?: {
|
||||
[index: string]: SchemaParameter;
|
||||
};
|
||||
path: string;
|
||||
request: {
|
||||
$ref: string;
|
||||
};
|
||||
response: {
|
||||
$ref: string;
|
||||
};
|
||||
sampleUrl: string;
|
||||
scopes: string[];
|
||||
fragment: string;
|
||||
mediaUpload: {
|
||||
protocols: {
|
||||
simple: {
|
||||
path: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
supportsMediaDownload?: boolean;
|
||||
apiVersion?: string;
|
||||
}
|
||||
export interface FragmentResponse {
|
||||
codeFragment: {
|
||||
[index: string]: {
|
||||
fragment: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
export type ParameterFormat = 'int32';
|
||||
export type HttpMethod = 'GET' | 'PATCH' | 'PUT';
|
||||
export type SchemaType = 'object' | 'integer' | 'string' | 'array' | 'boolean';
|
||||
19
backend/node_modules/googleapis-common/build/src/schema.js
generated
vendored
Normal file
19
backend/node_modules/googleapis-common/build/src/schema.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
// Copyright 2020 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.
|
||||
/**
|
||||
* These are a collection of interfaces that represent the GoogleApis
|
||||
* Discovery json formats.
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=schema.js.map
|
||||
17
backend/node_modules/googleapis-common/build/src/util.d.ts
generated
vendored
Normal file
17
backend/node_modules/googleapis-common/build/src/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import { GaxiosResponse } from 'gaxios';
|
||||
import { GaxiosResponseWithHTTP2 } from './http2';
|
||||
export type HeadersInit = ConstructorParameters<typeof Headers>[0];
|
||||
/**
|
||||
* A utility for converting potential {@link Headers `Headers`} objects to plain headers objects.
|
||||
*
|
||||
* @param headers any compatible `HeadersInit` (`Headers`, (string, string)[], {})
|
||||
* @returns the headers in `Record<string, string>` form.
|
||||
*/
|
||||
export declare function headersToClassicHeaders<T extends Record<string, string>>(headers: HeadersInit): T;
|
||||
/**
|
||||
* marshall a GaxiosResponse into a library-friendly type.
|
||||
*
|
||||
* @param res the Gaxios Response
|
||||
* @returns the GaxiosResponse with HTTP2-ready/compatible headers
|
||||
*/
|
||||
export declare function marshallGaxiosResponse<T extends GaxiosResponse>(res?: T): GaxiosResponseWithHTTP2;
|
||||
56
backend/node_modules/googleapis-common/build/src/util.js
generated
vendored
Normal file
56
backend/node_modules/googleapis-common/build/src/util.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
// Copyright 2025 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 });
|
||||
exports.headersToClassicHeaders = headersToClassicHeaders;
|
||||
exports.marshallGaxiosResponse = marshallGaxiosResponse;
|
||||
/**
|
||||
* A utility for converting potential {@link Headers `Headers`} objects to plain headers objects.
|
||||
*
|
||||
* @param headers any compatible `HeadersInit` (`Headers`, (string, string)[], {})
|
||||
* @returns the headers in `Record<string, string>` form.
|
||||
*/
|
||||
function headersToClassicHeaders(headers) {
|
||||
let classicHeaders = {};
|
||||
if (headers instanceof Headers) {
|
||||
headers.forEach((value, key) => {
|
||||
classicHeaders[key] = value;
|
||||
});
|
||||
}
|
||||
else if (Array.isArray(headers)) {
|
||||
for (const [key, value] of headers) {
|
||||
classicHeaders[key] = value;
|
||||
}
|
||||
}
|
||||
else {
|
||||
classicHeaders = headers || {};
|
||||
}
|
||||
return classicHeaders;
|
||||
}
|
||||
/**
|
||||
* marshall a GaxiosResponse into a library-friendly type.
|
||||
*
|
||||
* @param res the Gaxios Response
|
||||
* @returns the GaxiosResponse with HTTP2-ready/compatible headers
|
||||
*/
|
||||
function marshallGaxiosResponse(res) {
|
||||
return Object.defineProperties(res || {}, {
|
||||
headers: {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
value: headersToClassicHeaders(res?.headers),
|
||||
},
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=util.js.map
|
||||
95
backend/node_modules/googleapis-common/package.json
generated
vendored
Normal file
95
backend/node_modules/googleapis-common/package.json
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
{
|
||||
"name": "googleapis-common",
|
||||
"version": "8.0.1",
|
||||
"description": "A common tooling library used by the googleapis npm module. You probably don't want to use this directly.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"directory": "packages/nodejs-googleapis-common",
|
||||
"url": "https://github.com/googleapis/google-cloud-node-core.git"
|
||||
},
|
||||
"main": "build/src/index.js",
|
||||
"types": "build/src/index.d.ts",
|
||||
"files": [
|
||||
"build/src",
|
||||
"!build/src/**/*.map"
|
||||
],
|
||||
"scripts": {
|
||||
"prebenchmark": "npm run compile",
|
||||
"benchmark": "node build/benchmark/bench.js",
|
||||
"compile": "tsc -p .",
|
||||
"test": "c8 mocha build/test",
|
||||
"system-test": "c8 mocha build/system-test --timeout 600000",
|
||||
"presystem-test": "npm run compile",
|
||||
"fix": "gts fix",
|
||||
"prepare": "npm run compile",
|
||||
"pretest": "npm run compile",
|
||||
"lint": "gts check",
|
||||
"samples-test": "mocha build/samples-test",
|
||||
"docs": "jsdoc -c .jsdoc.js",
|
||||
"predocs-test": "npm run docs",
|
||||
"docs-test": "linkinator docs",
|
||||
"webpack": "webpack",
|
||||
"browser-test": "karma start",
|
||||
"prelint": "cd samples; npm link ../; npm install",
|
||||
"clean": "gts clean",
|
||||
"precompile": "gts clean"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Google LLC",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"extend": "^3.0.2",
|
||||
"gaxios": "^7.0.0-rc.4",
|
||||
"google-auth-library": "^10.1.0",
|
||||
"qs": "^6.7.0",
|
||||
"url-template": "^2.0.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
||||
"@types/extend": "^3.0.1",
|
||||
"@types/mocha": "^10.0.10",
|
||||
"@types/mv": "^2.1.0",
|
||||
"@types/ncp": "^2.0.1",
|
||||
"@types/nock": "^11.0.0",
|
||||
"@types/proxyquire": "^1.3.28",
|
||||
"@types/qs": "^6.5.3",
|
||||
"@types/sinon": "^17.0.0",
|
||||
"@types/tmp": "0.2.6",
|
||||
"@types/url-template": "^2.0.28",
|
||||
"c8": "^10.1.3",
|
||||
"codecov": "^3.5.0",
|
||||
"gts": "^6.0.2",
|
||||
"http2spy": "^2.0.0",
|
||||
"is-docker": "^2.0.0",
|
||||
"jsdoc": "^4.0.0",
|
||||
"jsdoc-fresh": "^3.0.0",
|
||||
"jsdoc-region-tag": "^3.0.0",
|
||||
"karma": "^6.0.0",
|
||||
"karma-chrome-launcher": "^3.0.0",
|
||||
"karma-coverage": "^2.0.0",
|
||||
"karma-firefox-launcher": "^2.0.0",
|
||||
"karma-mocha": "^2.0.0",
|
||||
"karma-remap-coverage": "^0.1.5",
|
||||
"karma-sourcemap-loader": "^0.4.0",
|
||||
"karma-webpack": "^4.0.0",
|
||||
"linkinator": "^6.1.2",
|
||||
"mocha": "^11.1.0",
|
||||
"mv": "^2.1.1",
|
||||
"ncp": "^2.0.0",
|
||||
"nock": "^14.0.1",
|
||||
"null-loader": "^4.0.0",
|
||||
"path-to-regexp": "^6.0.0",
|
||||
"proxyquire": "^2.1.3",
|
||||
"puppeteer": "^18.2.1",
|
||||
"sinon": "^17.0.0",
|
||||
"tmp": "^0.2.0",
|
||||
"ts-loader": "^8.0.0",
|
||||
"typescript": "^5.8.2",
|
||||
"webpack": "^4.0.0",
|
||||
"webpack-cli": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/googleapis/google-cloud-node-core/tree/main/packages/nodejs-googleapis-common"
|
||||
}
|
||||
Reference in New Issue
Block a user