-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: deprecate the getDefaultProjectId
method
#402
Conversation
Codecov Report
@@ Coverage Diff @@
## master #402 +/- ##
==========================================
+ Coverage 94.85% 94.93% +0.07%
==========================================
Files 15 15
Lines 952 967 +15
Branches 220 224 +4
==========================================
+ Hits 903 918 +15
Misses 49 49
Continue to review full report at Codecov.
|
src/messages.ts
Outdated
|
||
export const DEFAULT_PROJECT_ID_DEPRECATED = | ||
`The 'getDefaultProjectId' method has been deprecated, and will be removed | ||
in the 3.0 release of this library. Please use the 'getProjectId' method instead.`; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/auth/googleauth.ts
Outdated
*/ | ||
getDefaultProjectId(): Promise<string>; | ||
getDefaultProjectId(callback: ProjectIdCallback): void; | ||
getDefaultProjectId(callback?: ProjectIdCallback): Promise<string|null>|void { | ||
process.emitWarning(messages.DEFAULT_PROJECT_ID_DEPRECATED); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/messages.ts
Outdated
|
||
export const PROBLEMATIC_CREDENTIALS_WARNING = { | ||
code: 'google-auth-library:DEP001', | ||
type: 'DeprecationWarning', |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@ofrobots lets try this again :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ 🙀
this.getDefaultProjectIdAsync() | ||
.then(r => callback(null, r)) | ||
.catch(callback); | ||
this.getProjectIdAsync().then(r => callback(null, r)).catch(callback); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
getProjectId(callback: ProjectIdCallback): void; | ||
getProjectId(callback?: ProjectIdCallback): Promise<string|null>|void { | ||
if (callback) { | ||
this.getProjectIdAsync().then(r => callback(null, r)).catch(callback); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
No description provided.