googleapis-common
Advanced tools
Comparing version 2.0.4 to 3.0.0
@@ -1,2 +0,2 @@ | ||
import { Compute, GoogleAuth, JWT, OAuth2Client } from 'google-auth-library'; | ||
import { Compute, GoogleAuth, GoogleAuthOptions, JWT, OAuth2Client, ProjectIdCallback, UserRefreshClient } from 'google-auth-library'; | ||
export declare class AuthPlus extends GoogleAuth { | ||
@@ -6,2 +6,15 @@ JWT: typeof JWT; | ||
OAuth2: typeof OAuth2Client; | ||
GoogleAuth: typeof GoogleAuth; | ||
private _cachedAuth?; | ||
/** | ||
* Override getClient(), memoizing an instance of auth for | ||
* subsequent calls to getProjectId(). | ||
*/ | ||
getClient(options?: GoogleAuthOptions): Promise<Compute | JWT | UserRefreshClient>; | ||
/** | ||
* Override getProjectId(), using the most recently configured | ||
* auth instance when fetching projectId. | ||
*/ | ||
getProjectId(): Promise<string>; | ||
getProjectId(callback: ProjectIdCallback): void; | ||
} |
@@ -25,5 +25,27 @@ "use strict"; | ||
this.OAuth2 = google_auth_library_1.OAuth2Client; | ||
// tslint:disable-next-line: variable-name | ||
this.GoogleAuth = google_auth_library_1.GoogleAuth; | ||
} | ||
/** | ||
* Override getClient(), memoizing an instance of auth for | ||
* subsequent calls to getProjectId(). | ||
*/ | ||
async getClient(options) { | ||
this._cachedAuth = new google_auth_library_1.GoogleAuth(options); | ||
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 |
@@ -7,2 +7,13 @@ # Changelog | ||
## [3.0.0](https://www.github.com/googleapis/nodejs-googleapis-common/compare/v2.0.4...v3.0.0) (2019-07-24) | ||
### ⚠ BREAKING CHANGES | ||
* pulls in breaking API changes in google-auth-library. getProjectId() and getProjectId() have been modified to make the impact of these changes less noticeable on the legacy googleapis module (getClient() is idempotent, but getProjectId() will use the last configuration). | ||
### Features | ||
* expose GoogleAuth constructor on AuthPlus class ([#154](https://www.github.com/googleapis/nodejs-googleapis-common/issues/154)) ([7d7a961](https://www.github.com/googleapis/nodejs-googleapis-common/commit/7d7a961)) | ||
### [2.0.4](https://www.github.com/googleapis/nodejs-googleapis-common/compare/v2.0.3...v2.0.4) (2019-07-01) | ||
@@ -9,0 +20,0 @@ |
{ | ||
"name": "googleapis-common", | ||
"version": "2.0.4", | ||
"version": "3.0.0", | ||
"description": "A common tooling library used by the googleapis npm module. You probably don't want to use this directly.", | ||
@@ -76,3 +76,3 @@ "repository": "googleapis/nodejs-googleapis-common", | ||
"gaxios": "^2.0.1", | ||
"google-auth-library": "^4.2.5", | ||
"google-auth-library": "^5.1.0", | ||
"qs": "^6.7.0", | ||
@@ -79,0 +79,0 @@ "url-template": "^2.0.8", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64656
1008
+ Addedgcp-metadata@3.5.0(transitive)
+ Addedgoogle-auth-library@5.10.1(transitive)
+ Addedgtoken@4.1.4(transitive)
+ Addedjwa@2.0.0(transitive)
+ Addedjws@4.0.0(transitive)
- Removedgcp-metadata@2.0.4(transitive)
- Removedgoogle-auth-library@4.2.6(transitive)
- Removedgtoken@3.0.2(transitive)
- Removedjwa@1.4.1(transitive)
- Removedjws@3.2.2(transitive)
Updatedgoogle-auth-library@^5.1.0