Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

97
node_modules/googleapis/README.md generated vendored
View File

@@ -2,7 +2,6 @@
# Google APIs Node.js Client
[![Release Level][releaselevelimg]][releaselevel]
[![npm version][npmimg]][npm]
[![Code Coverage][codecovimg]][codecov]
[![Downloads][downloadsimg]][downloads]
@@ -20,7 +19,8 @@
* [Authentication and authorization](#authentication-and-authorization)
* [OAuth2 client](#oauth2-client)
* [Using API keys](#using-api-keys)
* [Service <--> Service authentication](#service-to-service-authentication)
* [Application default credentials](#application-default-credentials)
* [Service account credentials](#service-account-credentials)
* [Setting global or service-level auth](#setting-global-or-service-level-auth)
* [Usage](#usage)
* [Specifying request body](#specifying-request-body)
@@ -29,6 +29,7 @@
* [Using a Proxy](#using-a-proxy)
* [Supported APIs](#getting-supported-apis)
* [TypeScript](#typescript)
* [HTTP/2](#http2)
* [License](#license)
* [Contributing](#contributing)
* [Questions/problems?](#questionsproblems)
@@ -67,7 +68,7 @@ const blogger = google.blogger({
});
const params = {
blogId: 3213900
blogId: '3213900'
};
// get the blog details
@@ -109,20 +110,29 @@ There are a lot of [samples](https://github.com/googleapis/google-api-nodejs-cli
This library has a full set of [API Reference Documentation](https://googleapis.dev/nodejs/googleapis/latest). This documentation is auto-generated, and the location may change.
## Authentication and authorization
There are three primary ways to authenticate to Google APIs. Some service support all authentication methods, other may only support one or two.
There are multiple ways to authenticate to Google APIs. Some service support all authentication methods, other may only support one or two.
- **OAuth2** - This allows you to make API calls on behalf of a given user. In this model, the user visits your application, signs in with their Google account, and provides your application with authorization against a set of scopes. [Learn more](#oauth2-client).
- **Service <--> Service** - In this model, your application talks directly to Google APIs using a Service Account. It's useful when you have a backend application that will talk directly to Google APIs from the backend. [Learn more](#service-to-service-authentication).
- **API Key** - With an API key, you can access your service from a client or the server. Typically less secure, this is only available on a small subset of services with limited scopes. [Learn more](#using-api-keys).
- **Application default credentials** - Provides automatic access to Google APIs using the [Google Cloud SDK](https://cloud.google.com/sdk/) for local development, or the [GCE Metadata Server](https://cloud.google.com/compute/docs/storing-retrieving-metadata) for applications deployed to Google Cloud Platform. [Learn more](#application-default-credentials).
- **Service account credentials** - In this model, your application talks directly to Google APIs using a Service Account. It's useful when you have a backend application that will talk directly to Google APIs from the backend. [Learn more](#service-account-credentials).
To learn more about the authentication client, see the [Google Auth Library](https://github.com/googleapis/google-auth-library-nodejs).
### OAuth2 client
This client comes with an [OAuth2][oauth] client that allows you to retrieve an access token, refresh it, and retry the request seamlessly. The basics of Google's OAuth2 implementation is explained on [Google Authorization and Authentication documentation][authdocs].
This module comes with an [OAuth2][oauth] client that allows you to retrieve an access token, refresh it, and retry the request seamlessly. The basics of Google's OAuth2 implementation is explained on [Google Authorization and Authentication documentation][authdocs].
In the following examples, you may need a `CLIENT_ID`, `CLIENT_SECRET` and `REDIRECT_URL`. You can find these pieces of information by going to the [Developer Console][devconsole], clicking your project --> APIs & auth --> credentials.
- Navigate to the Cloud Console and [Create a new OAuth2 Client Id](https://console.cloud.google.com/apis/credentials/oauthclient)
- Select `Web Application` for the application type
- Add an authorized redirect URI with the value `http://localhost:3000/oauth2callback` (or applicable value for your scenario)
- Click `Create`, and `Ok` on the following screen
- Click the `Download` icon next to your newly created OAuth2 Client Id
Make sure to store this file in safe place, and *do not check this file into source control!*
For more information about OAuth2 and how it works, [see here][oauth].
@@ -211,7 +221,7 @@ const blogger = google.blogger_v3({
});
const params = {
blogId: 3213900
blogId: '3213900'
};
async function main(params) {
@@ -224,21 +234,25 @@ main().catch(console.error);
To learn more about API keys, please see the [documentation][usingkeys].
#### Service to Service Authentication
#### Application default credentials
Rather than manually creating an OAuth2 client, JWT client, or Compute client, the auth library can create the correct credential type for you, depending upon the environment your code is running under.
For example, a JWT auth client will be created when your code is running on your local developer machine, and a Compute client will be created when the same code is running on a configured instance of Google Compute Engine.
For example, a JWT auth client will be created when your code is running on your local developer machine, and a Compute client will be created when the same code is running on a configured instance of Google Compute Engine. The code below shows how to retrieve a default credential type, depending upon the runtime environment.
The code below shows how to retrieve a default credential type, depending upon the runtime environment. The createScopedRequired must be called to determine when you need to pass in the scopes manually, and when they have been set for you automatically based on the configured runtime environment.
To use Application default credentials locally with the [Google Cloud SDK](https://cloud.google.com/sdk/), run:
```sh
$ gcloud auth application-default login
```
When running in GCP, service authorize is automatically provided via the GCE Metadata server.
```js
const {google} = require('googleapis');
const compute = google.compute('v1');
async function main () {
// This method looks for the GCLOUD_PROJECT and GOOGLE_APPLICATION_CREDENTIALS
// environment variables.
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/compute']
@@ -256,6 +270,35 @@ async function main () {
main().catch(console.error);
```
### Service account credentials
Service accounts allow you to perform server to server, app-level authentication using a robot account. You will create a service account, download a keyfile, and use that to authenticate to Google APIs. To create a service account:
- Go to the [Create Service Account Key page](https://console.cloud.google.com/apis/credentials/serviceaccountkey)
- Select `New Service Account` in the drop down
- Click the `Create` button
Save the service account credential file somewhere safe, and *do not check this file into source control*! To reference the service account credential file, you have a few options.
#### Using the `GOOGLE_APPLICATION_CREDENTIALS` env var
You can start process with an environment variable named `GOOGLE_APPLICATION_CREDENTIALS`. The value of this env var should be the full path to the service account credential file:
```
$ GOOGLE_APPLICATION_CREDENTIALS=./your-secret-key.json node server.js
```
#### Using the `keyFile` property
Alternatively, you can specify the path to the service account credential file via the `keyFile` property in the `GoogleAuth` constructor:
```js
const {google} = require('googleapis');
const auth = new google.auth.GoogleAuth({
keyFile: '/path/to/your-secret-key.json',
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
```
### Setting global or service-level auth
You can set the `auth` as a global or service-level option so you don't need to specify it every request. For example, you can set `auth` as a global option:
@@ -365,9 +408,9 @@ For more examples of creation and modification requests with media attachments,
### Request Options
For more fine-tuned control over how your API calls are made, we provide you with the ability to specify additional options that can be applied directly to the ['gaxios'][gaxios] object used in this library to make network calls to the API.
You may specify additional options either in the global `google` object or on a service client basis. The options you specify are attached to the `gaxios` object so whatever `gaxios` supports, this library supports. You may also specify global or per-service request parameters that will be attached to all API calls you make.
You may specify additional options either in the global `google` object or on a service client basis. The options you specify are attached to the `gaxios` object so whatever `gaxios` supports, this library supports. You may also specify global or per-service request parameters that will be attached to all API calls you make.
A full list of supported options can be [found here][requestopts].
A full list of supported options can be [found here](https://github.com/googleapis/gaxios/#request-options).
#### Global options
You can choose default options that will be sent with each request. These options will be used for every service instantiated by the google client. In this example, the `timeout` property of `GaxiosOptions` will be set for every request:
@@ -418,7 +461,7 @@ const blogger = google.blogger({
// All requests made with this service client will contain the
// blogId query parameter unless overridden in individual API calls.
params: {
blogId: 3213900
blogId: '3213900'
}
});
@@ -487,7 +530,7 @@ You can use the following environment variables to proxy HTTP and HTTPS requests
When HTTP_PROXY / http_proxy are set, they will be used to proxy non-SSL requests that do not have an explicit proxy configuration option present. Similarly, HTTPS_PROXY / https_proxy will be respected for SSL requests that do not have an explicit proxy configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the proxy configuration option.
### Getting Supported APIs
You can programatically obtain the list of supported APIs, and all available versions:
You can programmatically obtain the list of supported APIs, and all available versions:
```js
const {google} = require('googleapis');
@@ -497,12 +540,24 @@ const apis = google.getSupportedAPIs();
This will return an object with the API name as object property names, and an array of version strings as the object values;
### TypeScript
This library is written in TypeScript, and provides types out of the box. All classes and interfaces generated for each API are exported under the `${apiName}_${version}` namespace. For example, the Drive v3 API types are all available from the `drive_v3` namespace:
This library is written in TypeScript, and provides types out of the box. All classes and interfaces generated for each API are exported under the `${apiName}_${version}` namespace. For example, the Drive v3 API types are all available from the `drive_v3` namespace:
```ts
import { drive_v3 } from 'googleapis';
```
### HTTP/2
This library has **experimental** support for [HTTP/2](https://developers.google.com/web/fundamentals/performance/http2). This support is experimental, and should not be used in production. To enable it for testing purposes, use the `http2` option anywhere request parameters are accepted:
```js
const {google} = require('googleapis');
google.options({
http2: true,
});
```
HTTP/2 is often more performant, as it allows multiplexing of multiple concurrent requests over a single socket. In a traditional HTTP/2 API, the client is directly responsible for opening and closing the sessions made to make requests. To maintain compatibility with the existing API, this module will automatically re-use existing sessions, which are collected after idling for 500ms. Much of the performance gains will be visible in batch style workloads, and tight loops. To provide feedback on the experimental API surface, please comment on [this issue](https://github.com/googleapis/google-api-nodejs-client/issues/1130).
## Release Notes & Breaking Changes
You can find a detailed list of breaking changes and new features in our [Release Notes][releasenotes]. If you've used this library before `25.x`, see our [Release Notes][releasenotes] to learn about migrating your code from `24.x.x` to `25.x.x`. It's pretty easy :)
@@ -523,10 +578,6 @@ We love contributions! Before submitting a Pull Request, it's always good to sta
[david-url]: https://david-dm.org/googleapis/google-api-nodejs-client
[npmimg]: https://img.shields.io/npm/v/googleapis.svg
[npm]: https://www.npmjs.org/package/googleapis
[circle]: https://circleci.com/gh/googleapis/google-api-nodejs-client
[circleimg]: https://circleci.com/gh/googleapis/google-api-nodejs-client.svg?style=shield
[releaselevel]: https://cloud.google.com/terms/launch-stages
[releaselevelimg]: https://img.shields.io/badge/Release%20Level-Alpha-ff69b4.svg
[bugs]: https://github.com/googleapis/google-api-nodejs-client/issues
[node]: http://nodejs.org/
[stackoverflow]: http://stackoverflow.com/questions/tagged/google-api-nodejs-client
@@ -548,4 +599,4 @@ We love contributions! Before submitting a Pull Request, it's always good to sta
[codecovimg]: https://codecov.io/github/googleapis/google-api-nodejs-client/coverage.svg?branch=master
[codecov]: https://codecov.io/github/googleapis/google-api-nodejs-client?branch=master
[downloadsimg]: https://img.shields.io/npm/dm/googleapis.svg
[downloads]: https://nodei.co/npm/googleapis/
[downloads]: https://www.npmjs.com/package/googleapis