Skip to content
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

Merged
merged 5 commits into from
Jul 4, 2018
Merged

fix: deprecate the getDefaultProjectId method #402

merged 5 commits into from
Jul 4, 2018

Conversation

JustinBeckwith
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 2, 2018
@codecov-io
Copy link

codecov-io commented Jul 3, 2018

Codecov Report

Merging #402 into master will increase coverage by 0.07%.
The diff coverage is 92%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
src/messages.ts 100% <100%> (ø) ⬆️
src/auth/googleauth.ts 94.66% <83.33%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6a013fe...23affe8. Read the comment docs.

@JustinBeckwith JustinBeckwith requested review from ofrobots and a team July 3, 2018 00:02
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.

*/
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.

src/messages.ts Outdated

export const PROBLEMATIC_CREDENTIALS_WARNING = {
code: 'google-auth-library:DEP001',
type: 'DeprecationWarning',

This comment was marked as spam.

@JustinBeckwith
Copy link
Contributor Author

@ofrobots lets try this again :)

Copy link
Contributor

@ofrobots ofrobots left a 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants