firebase-admin
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { Credential } from './credential'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -52,3 +52,3 @@ var validator = require('../utils/validator'); | ||
typeof request.displayName !== 'string') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_DISPLAY_NAME); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_DISPLAY_NAME); | ||
} | ||
@@ -58,7 +58,7 @@ if (typeof request.localId !== 'undefined' && !validator.isUid(request.localId)) { | ||
// uid externally. So the error message should use the client facing name. | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_UID); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_UID); | ||
} | ||
// email should be a string and a valid email. | ||
if (typeof request.email !== 'undefined' && !validator.isEmail(request.email)) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_EMAIL); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_EMAIL); | ||
} | ||
@@ -68,3 +68,3 @@ // password should be a string and a minimum of 6 chars. | ||
!validator.isPassword(request.password)) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_PASSWORD); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_PASSWORD); | ||
} | ||
@@ -76,3 +76,3 @@ // rawPassword should be a string and a minimum of 6 chars. | ||
// password externally. So the error message should use the client facing name. | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_PASSWORD); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_PASSWORD); | ||
} | ||
@@ -82,3 +82,3 @@ // emailVerified should be a boolean. | ||
typeof request.emailVerified !== 'boolean') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_EMAIL_VERIFIED); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_EMAIL_VERIFIED); | ||
} | ||
@@ -90,3 +90,3 @@ // photoUrl should be a URL. | ||
// photoURL externally. So the error message should use the client facing name. | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_PHOTO_URL); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_PHOTO_URL); | ||
} | ||
@@ -96,3 +96,3 @@ // disabled should be a boolean. | ||
typeof request.disabled !== 'boolean') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_DISABLED_FIELD); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_DISABLED_FIELD); | ||
} | ||
@@ -104,3 +104,3 @@ // disableUser should be a boolean. | ||
// disabled externally. So the error message should use the client facing name. | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_DISABLED_FIELD); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_DISABLED_FIELD); | ||
} | ||
@@ -113,3 +113,3 @@ } | ||
if (!request.localId && !request.email) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
} | ||
@@ -119,3 +119,3 @@ }) | ||
if (!response.users) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.USER_NOT_FOUND); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.USER_NOT_FOUND); | ||
} | ||
@@ -127,3 +127,3 @@ }); | ||
if (!request.localId) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
} | ||
@@ -136,3 +136,3 @@ }); | ||
if (typeof request.localId === 'undefined') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
} | ||
@@ -144,3 +144,3 @@ validateCreateEditRequest(request); | ||
if (!response.localId) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.USER_NOT_FOUND); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.USER_NOT_FOUND); | ||
} | ||
@@ -171,3 +171,3 @@ }); | ||
!request.users.length) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid uploadAccount request. No users provider.'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid uploadAccount request. No users provider.'); | ||
} | ||
@@ -179,3 +179,3 @@ // Validate each user within users. | ||
if (typeof user.localId === 'undefined') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Server request is missing user identifier'); | ||
} | ||
@@ -196,5 +196,5 @@ // Validate user. | ||
// Duplicate user error | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.UID_ALREADY_EXISTS, response.error[0].message); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.UID_ALREADY_EXISTS, response.error[0].message); | ||
} | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: ' + response.error[0].message); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: ' + response.error[0].message); | ||
} | ||
@@ -211,3 +211,3 @@ }); | ||
if (typeof request.localId !== 'undefined') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: User identifier must not be specified'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: User identifier must not be specified'); | ||
} | ||
@@ -219,3 +219,3 @@ validateCreateEditRequest(request); | ||
if (!response.localId) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to create new user'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Unable to create new user'); | ||
} | ||
@@ -222,0 +222,0 @@ }); |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { Credential } from './credential'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -30,3 +30,3 @@ var token_generator_1 = require('./token-generator'); | ||
else { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_SERVICE_ACCOUNT); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_SERVICE_ACCOUNT); | ||
} | ||
@@ -43,3 +43,3 @@ } | ||
if (typeof app !== 'object' || !('options' in app)) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_ARGUMENT, 'First parameter to Auth constructor must be an instance of FirebaseApp'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_ARGUMENT, 'First parameter to Auth constructor must be an instance of FirebaseApp'); | ||
} | ||
@@ -49,3 +49,3 @@ this.app_ = app; | ||
if (credential && typeof credential.getAccessToken !== 'function') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_CREDENTIAL, 'Called initializeApp() with an invalid credential parameter'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CREDENTIAL, 'Called initializeApp() with an invalid credential parameter'); | ||
} | ||
@@ -99,3 +99,3 @@ this.authTokenManager_ = new AuthTokenManager(credential); | ||
if (typeof this.tokenGenerator_ === 'undefined') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_SERVICE_ACCOUNT, 'Must initialize FirebaseApp with a service account to call auth().createCustomToken()'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CREDENTIAL, 'Must initialize app with a cert credential to call auth().createCustomToken()'); | ||
} | ||
@@ -114,3 +114,3 @@ return this.tokenGenerator_.createCustomToken(uid, developerClaims); | ||
if (typeof this.tokenGenerator_ === 'undefined') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_SERVICE_ACCOUNT, 'Must initialize FirebaseApp with a service account to call auth().verifyIdToken()'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CREDENTIAL, 'Must initialize app with a cert credential to call auth().verifyIdToken()'); | ||
} | ||
@@ -166,3 +166,3 @@ return this.tokenGenerator_.verifyIdToken(idToken); | ||
// Something must have happened after creating the user and then retrieving it. | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'Unable to create the user record provided.'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'Unable to create the user record provided.'); | ||
} | ||
@@ -324,3 +324,3 @@ throw error; | ||
typeof result.access_token !== 'string') { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INVALID_CREDENTIAL, 'initializeApp() was called with a credential ' + | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CREDENTIAL, 'initializeApp() was called with a credential ' + | ||
'that creates invalid access tokens: ' + JSON.stringify(result)); | ||
@@ -327,0 +327,0 @@ } |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ export declare class RefreshToken { |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var jwt = require('jsonwebtoken'); |
@@ -1,5 +0,5 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
import { FirebaseServiceInterface } from '../firebase-service'; | ||
import { FirebaseServiceNamespace } from '../firebase-namespace'; | ||
export default function (): FirebaseServiceNamespace<FirebaseServiceInterface>; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var auth_1 = require('./auth'); |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { Certificate } from './credential'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var jwt = require('jsonwebtoken'); |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -35,3 +35,3 @@ var error_1 = require('../utils/error'); | ||
if (!this.createdAtInternal) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid metadata response'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid metadata response'); | ||
} | ||
@@ -78,3 +78,3 @@ this.lastSignedInAtInternal = parseDate(response.lastLoginAt); | ||
if (!response.rawId || !response.providerId) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user info response'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user info response'); | ||
} | ||
@@ -152,3 +152,3 @@ this.uidInternal = response.rawId; | ||
if (!response.localId) { | ||
throw new error_1.FirebaseAuthError(error_1.AUTH_CLIENT_ERROR_CODE.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user response'); | ||
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INTERNAL_ERROR, 'INTERNAL ASSERT FAILED: Invalid user response'); | ||
} | ||
@@ -155,0 +155,0 @@ this.uidInternal = response.localId; |
@@ -1,5 +0,5 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
import { FirebaseNamespace } from './firebase-namespace'; | ||
declare let firebaseAdmin: FirebaseNamespace; | ||
export = firebaseAdmin; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var firebase_namespace_1 = require('./firebase-namespace'); |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { Credential } from './auth/credential'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -24,12 +24,11 @@ var deep_copy_1 = require('./utils/deep-copy'); | ||
if (!hasCredential && !hasServiceAccount) { | ||
errorMessage = 'The first argument passed to initializeApp() must be an object containing ' + | ||
'at least a "credential" property.'; | ||
errorMessage = 'Options must be an object containing at least a "credential" property.'; | ||
} | ||
else if (hasCredential && hasServiceAccount) { | ||
errorMessage = 'The first argument passed to initializeApp() cannot specify both the ' + | ||
'"credential" and "serviceAccount" properties.'; | ||
errorMessage = 'Options cannot specify both the "credential" and "serviceAccount" properties.'; | ||
} | ||
// TODO(jwenger): NEXT MAJOR RELEASE - throw error if the "credential" property is not specified | ||
if (typeof errorMessage !== 'undefined') { | ||
throw new Error("Invalid Firebase app options passed as the first argument to initializeApp(). " + errorMessage); | ||
throw new Error("Invalid Firebase app options passed as the first argument to initializeApp() for the " + | ||
("app named \"" + this.name_ + "\". " + errorMessage)); | ||
} | ||
@@ -55,7 +54,7 @@ // TODO(jwenger): NEXT MAJOR RELEASE - remove "serviceAccount" property deprecation warning | ||
FirebaseApp.prototype.auth = function () { | ||
throw new Error('Firebase auth() service has not been registered'); | ||
throw new Error('INTERNAL ASSERT FAILED: Firebase auth() service has not been registered.'); | ||
}; | ||
/* istanbul ignore next */ | ||
FirebaseApp.prototype.database = function () { | ||
throw new Error('Firebase database() service has not been registered'); | ||
throw new Error('INTERNAL ASSERT FAILED: Firebase database() service has not been registered.'); | ||
}; | ||
@@ -129,3 +128,3 @@ Object.defineProperty(FirebaseApp.prototype, "name", { | ||
if (this.isDeleted_) { | ||
throw new Error("Firebase app named '" + this.name_ + "' has already been deleted."); | ||
throw new Error("Firebase app named \"" + this.name_ + "\" has already been deleted."); | ||
} | ||
@@ -132,0 +131,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { AppHook, FirebaseApp, FirebaseAppOptions } from './firebase-app'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -29,6 +29,6 @@ var deep_copy_1 = require('./utils/deep-copy'); | ||
if (typeof appName !== 'string' || appName === '') { | ||
throw new Error("Illegal Firebase app name '" + appName + "' provided. App name must be a non-empty string."); | ||
throw new Error("Illegal Firebase app name \"" + appName + "\" provided. App name must be a non-empty string."); | ||
} | ||
else if (appName in this.apps_) { | ||
throw new Error("Firebase app named '" + appName + "' already exists."); | ||
throw new Error("Firebase app named \"" + appName + "\" already exists."); | ||
} | ||
@@ -50,6 +50,6 @@ var app = new firebase_app_1.FirebaseApp(options, appName, this); | ||
if (typeof appName !== 'string' || appName === '') { | ||
throw new Error("Illegal Firebase app name '" + appName + "' provided. App name must be a non-empty string."); | ||
throw new Error("Illegal Firebase app name \"" + appName + "\" provided. App name must be a non-empty string."); | ||
} | ||
else if (!(appName in this.apps_)) { | ||
throw new Error("No Firebase app named '" + appName + "' exists."); | ||
throw new Error("Firebase app named \"" + appName + "\" does not exist."); | ||
} | ||
@@ -100,6 +100,6 @@ return this.apps_[appName]; | ||
else if (typeof serviceName !== 'string' || serviceName === '') { | ||
throw new Error("Illegal service name '" + serviceName + "' provided. Service name must be a non-empty string."); | ||
throw new Error("Illegal service name \"" + serviceName + "\" provided. Service name must be a non-empty string."); | ||
} | ||
else if (serviceName in this.serviceFactories) { | ||
throw new Error("Firebase service named '" + serviceName + "' has already been registered."); | ||
throw new Error("Firebase service named \"" + serviceName + "\" has already been registered."); | ||
} | ||
@@ -175,3 +175,3 @@ this.serviceFactories[serviceName] = createService; | ||
this.credential = firebaseCredential; | ||
this.SDK_VERSION = '4.0.1'; | ||
this.SDK_VERSION = '4.0.2'; | ||
/* tslint:disable */ | ||
@@ -190,7 +190,7 @@ // TODO(jwenger): Database is the only consumer of firebase.Promise. We should update it to use | ||
FirebaseNamespace.prototype.auth = function () { | ||
throw new Error('Firebase auth() service has not been registered'); | ||
throw new Error('INTERNAL ASSERT FAILED: Firebase auth() service has not been registered.'); | ||
}; | ||
/* istanbul ignore next */ | ||
FirebaseNamespace.prototype.database = function () { | ||
throw new Error('Firebase database() service has not been registered'); | ||
throw new Error('INTERNAL ASSERT FAILED: Firebase database() service has not been registered.'); | ||
}; | ||
@@ -197,0 +197,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { FirebaseApp } from './firebase-app'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; |
@@ -1,4 +0,4 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
import * as firebase from './default-namespace'; | ||
export = firebase; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var firebase = require('./default-namespace'); |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="chai" /> | ||
@@ -4,0 +4,0 @@ import { Credential } from '../auth/credential'; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var __extends = (this && this.__extends) || function (d, b) { |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/** | ||
@@ -4,0 +4,0 @@ * Returns a deep copy of an object or array. |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ /** |
@@ -1,7 +0,5 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/// <reference types="node" /> | ||
/// <reference types="chai" /> | ||
/** Error code type. */ | ||
declare type ErrorCode = 'INVALID_ARGUMENT' | 'EMAIL_ALREADY_EXISTS' | 'INTERNAL_ERROR' | 'INVALID_CREDENTIAL' | 'INVALID_DISABLED_FIELD' | 'INVALID_DISPLAY_NAME' | 'INVALID_EMAIL_VERIFIED' | 'INVALID_EMAIL' | 'INVALID_PASSWORD' | 'INVALID_PHOTO_URL' | 'INVALID_SERVICE_ACCOUNT' | 'INVALID_UID' | 'MISSING_UID' | 'OPERATION_NOT_ALLOWED' | 'PROJECT_NOT_FOUND' | 'UID_ALREADY_EXISTS' | 'USER_NOT_FOUND'; | ||
/** | ||
@@ -15,8 +13,2 @@ * Defines error info type. This includes a code and message string. | ||
/** | ||
* Type that represents a map that stores all error codes (ErrorInfo enum). | ||
*/ | ||
declare type ErrorCodeMap = { | ||
[code: ErrorCode]: ErrorInfo; | ||
}; | ||
/** | ||
* Firebase error code structure. This extends Error. | ||
@@ -57,4 +49,73 @@ * | ||
} | ||
/** @const {ErrorCodeMap} Auth client error codes and their default messages. */ | ||
declare const AUTH_CLIENT_ERROR_CODE: ErrorCodeMap; | ||
export { ErrorCode, ErrorCodeMap, ErrorInfo, FirebaseError, FirebaseAuthError, AUTH_CLIENT_ERROR_CODE }; | ||
/** @const {TODO} Auth client error codes and their default messages. */ | ||
declare class AuthClientErrorCode { | ||
static INVALID_ARGUMENT: { | ||
code: string; | ||
message: string; | ||
}; | ||
static EMAIL_ALREADY_EXISTS: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INTERNAL_ERROR: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_CREDENTIAL: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_DISABLED_FIELD: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_DISPLAY_NAME: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_EMAIL_VERIFIED: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_EMAIL: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_PASSWORD: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_PHOTO_URL: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_SERVICE_ACCOUNT: { | ||
code: string; | ||
message: string; | ||
}; | ||
static INVALID_UID: { | ||
code: string; | ||
message: string; | ||
}; | ||
static MISSING_UID: { | ||
code: string; | ||
message: string; | ||
}; | ||
static OPERATION_NOT_ALLOWED: { | ||
code: string; | ||
message: string; | ||
}; | ||
static PROJECT_NOT_FOUND: { | ||
code: string; | ||
message: string; | ||
}; | ||
static UID_ALREADY_EXISTS: { | ||
code: string; | ||
message: string; | ||
}; | ||
static USER_NOT_FOUND: { | ||
code: string; | ||
message: string; | ||
}; | ||
} | ||
export { ErrorInfo, FirebaseError, FirebaseAuthError, AuthClientErrorCode }; |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -73,3 +73,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
var clientCodeKey = AUTH_SERVER_TO_CLIENT_CODE[serverErrorCode] || 'INTERNAL_ERROR'; | ||
var error = deep_copy_1.deepCopy(AUTH_CLIENT_ERROR_CODE[clientCodeKey]); | ||
var error = deep_copy_1.deepCopy(AuthClientErrorCode[clientCodeKey]); | ||
error.message = message || error.message; | ||
@@ -81,57 +81,59 @@ return new FirebaseAuthError(error); | ||
exports.FirebaseAuthError = FirebaseAuthError; | ||
/** @const {ErrorCodeMap} Auth client error codes and their default messages. */ | ||
var AUTH_CLIENT_ERROR_CODE = { | ||
INVALID_ARGUMENT: { | ||
/** @const {TODO} Auth client error codes and their default messages. */ | ||
var AuthClientErrorCode = (function () { | ||
function AuthClientErrorCode() { | ||
} | ||
AuthClientErrorCode.INVALID_ARGUMENT = { | ||
code: 'argument-error', | ||
message: 'Invalid argument provided.', | ||
}, | ||
EMAIL_ALREADY_EXISTS: { | ||
}; | ||
AuthClientErrorCode.EMAIL_ALREADY_EXISTS = { | ||
code: 'email-already-exists', | ||
message: 'The email address is already in use by another account.', | ||
}, | ||
INTERNAL_ERROR: { | ||
}; | ||
AuthClientErrorCode.INTERNAL_ERROR = { | ||
code: 'internal-error', | ||
message: 'An internal error has occurred.', | ||
}, | ||
INVALID_CREDENTIAL: { | ||
}; | ||
AuthClientErrorCode.INVALID_CREDENTIAL = { | ||
code: 'invalid-credential', | ||
message: 'Invalid credential object provided.', | ||
}, | ||
INVALID_DISABLED_FIELD: { | ||
}; | ||
AuthClientErrorCode.INVALID_DISABLED_FIELD = { | ||
code: 'invalid-disabled-field', | ||
message: 'The disabled field must be a boolean.', | ||
}, | ||
INVALID_DISPLAY_NAME: { | ||
}; | ||
AuthClientErrorCode.INVALID_DISPLAY_NAME = { | ||
code: 'invalid-display-name', | ||
message: 'The displayName field must be a valid string.', | ||
}, | ||
INVALID_EMAIL_VERIFIED: { | ||
}; | ||
AuthClientErrorCode.INVALID_EMAIL_VERIFIED = { | ||
code: 'invalid-email-verified', | ||
message: 'The emailVerified field must be a boolean.', | ||
}, | ||
INVALID_EMAIL: { | ||
}; | ||
AuthClientErrorCode.INVALID_EMAIL = { | ||
code: 'invalid-email', | ||
message: 'The email address is improperly formatted.', | ||
}, | ||
INVALID_PASSWORD: { | ||
}; | ||
AuthClientErrorCode.INVALID_PASSWORD = { | ||
code: 'invalid-password', | ||
message: 'The password must be a string with at least 6 characters.', | ||
}, | ||
INVALID_PHOTO_URL: { | ||
}; | ||
AuthClientErrorCode.INVALID_PHOTO_URL = { | ||
code: 'invalid-photo-url', | ||
message: 'The photoURL field must be a valid URL.', | ||
}, | ||
INVALID_SERVICE_ACCOUNT: { | ||
}; | ||
AuthClientErrorCode.INVALID_SERVICE_ACCOUNT = { | ||
code: 'invalid-service-account', | ||
message: 'The service account provided is invalid.', | ||
}, | ||
INVALID_UID: { | ||
}; | ||
AuthClientErrorCode.INVALID_UID = { | ||
code: 'invalid-uid', | ||
message: 'The uid must be a non-empty string with at most 128 alphanumeric characters.', | ||
}, | ||
MISSING_UID: { | ||
}; | ||
AuthClientErrorCode.MISSING_UID = { | ||
code: 'missing-uid', | ||
message: 'A uid identifier is required for the current operation.', | ||
}, | ||
OPERATION_NOT_ALLOWED: { | ||
}; | ||
AuthClientErrorCode.OPERATION_NOT_ALLOWED = { | ||
code: 'operation-not-allowed', | ||
@@ -141,17 +143,19 @@ message: 'The given sign-in provider is disabled for this Firebase project. ' + | ||
'Auth section.', | ||
}, | ||
PROJECT_NOT_FOUND: { | ||
}; | ||
AuthClientErrorCode.PROJECT_NOT_FOUND = { | ||
code: 'project-not-found', | ||
message: 'No Firebase project was found for the provided credential.', | ||
}, | ||
UID_ALREADY_EXISTS: { | ||
}; | ||
AuthClientErrorCode.UID_ALREADY_EXISTS = { | ||
code: 'uid-already-exists', | ||
message: 'The user with the provided uid already exists.', | ||
}, | ||
USER_NOT_FOUND: { | ||
}; | ||
AuthClientErrorCode.USER_NOT_FOUND = { | ||
code: 'user-not-found', | ||
message: 'There is no user record corresponding to the provided identifier.', | ||
}, | ||
}; | ||
exports.AUTH_CLIENT_ERROR_CODE = AUTH_CLIENT_ERROR_CODE; | ||
}; | ||
return AuthClientErrorCode; | ||
}()); | ||
exports.AuthClientErrorCode = AuthClientErrorCode; | ||
; | ||
/** @const {ServerToClientCode} Auth server to client enum error codes. */ | ||
@@ -158,0 +162,0 @@ var AUTH_SERVER_TO_CLIENT_CODE = { |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
/** | ||
@@ -4,0 +4,0 @@ * Validates that a string is alpha numeric. |
@@ -1,3 +0,3 @@ | ||
/*! firebase-admin v4.0.1 | ||
https://developers.google.com/terms */ | ||
/*! firebase-admin v4.0.2 | ||
https://firebase.google.com/terms/ */ | ||
"use strict"; | ||
@@ -4,0 +4,0 @@ var url = require('url'); |
{ | ||
"name": "firebase-admin", | ||
"version": "4.0.0", | ||
"version": "4.0.2", | ||
"dependencies": { | ||
@@ -21,34 +21,14 @@ "@types/jsonwebtoken": { | ||
"base64url": { | ||
"version": "1.0.6", | ||
"from": "base64url@>=1.0.4 <1.1.0", | ||
"resolved": "https://registry.npmjs.org/base64url/-/base64url-1.0.6.tgz" | ||
"version": "2.0.0", | ||
"from": "base64url@>=2.0.0 <3.0.0", | ||
"resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz" | ||
}, | ||
"buffer-equal-constant-time": { | ||
"version": "1.0.1", | ||
"from": "buffer-equal-constant-time@>=1.0.1 <2.0.0", | ||
"from": "buffer-equal-constant-time@1.0.1", | ||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz" | ||
}, | ||
"camelcase": { | ||
"version": "1.2.1", | ||
"from": "camelcase@>=1.0.1 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz" | ||
}, | ||
"camelcase-keys": { | ||
"version": "1.0.0", | ||
"from": "camelcase-keys@>=1.0.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz" | ||
}, | ||
"concat-stream": { | ||
"version": "1.4.10", | ||
"from": "concat-stream@>=1.4.7 <1.5.0", | ||
"resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.10.tgz" | ||
}, | ||
"core-util-is": { | ||
"version": "1.0.2", | ||
"from": "core-util-is@>=1.0.0 <1.1.0", | ||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" | ||
}, | ||
"ecdsa-sig-formatter": { | ||
"version": "1.0.7", | ||
"from": "ecdsa-sig-formatter@>=1.0.0 <2.0.0", | ||
"from": "ecdsa-sig-formatter@1.0.7", | ||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.7.tgz" | ||
@@ -61,7 +41,2 @@ }, | ||
}, | ||
"get-stdin": { | ||
"version": "4.0.1", | ||
"from": "get-stdin@>=4.0.1 <5.0.0", | ||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz" | ||
}, | ||
"hoek": { | ||
@@ -72,22 +47,2 @@ "version": "2.16.3", | ||
}, | ||
"indent-string": { | ||
"version": "1.2.2", | ||
"from": "indent-string@>=1.1.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/indent-string/-/indent-string-1.2.2.tgz" | ||
}, | ||
"inherits": { | ||
"version": "2.0.3", | ||
"from": "inherits@>=2.0.1 <2.1.0", | ||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" | ||
}, | ||
"is-finite": { | ||
"version": "1.0.2", | ||
"from": "is-finite@>=1.0.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" | ||
}, | ||
"isarray": { | ||
"version": "0.0.1", | ||
"from": "isarray@0.0.1", | ||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" | ||
}, | ||
"isemail": { | ||
@@ -109,10 +64,10 @@ "version": "1.2.0", | ||
"jwa": { | ||
"version": "1.1.3", | ||
"from": "jwa@>=1.1.2 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.3.tgz" | ||
"version": "1.1.4", | ||
"from": "jwa@>=1.1.4 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.4.tgz" | ||
}, | ||
"jws": { | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"from": "jws@>=3.1.3 <4.0.0", | ||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.1.3.tgz" | ||
"resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz" | ||
}, | ||
@@ -124,21 +79,6 @@ "lodash.once": { | ||
}, | ||
"map-obj": { | ||
"version": "1.0.1", | ||
"from": "map-obj@>=1.0.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz" | ||
}, | ||
"meow": { | ||
"version": "2.0.0", | ||
"from": "meow@>=2.0.0 <2.1.0", | ||
"resolved": "https://registry.npmjs.org/meow/-/meow-2.0.0.tgz" | ||
}, | ||
"minimist": { | ||
"version": "1.2.0", | ||
"from": "minimist@>=1.1.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz" | ||
}, | ||
"moment": { | ||
"version": "2.15.2", | ||
"version": "2.16.0", | ||
"from": "moment@>=2.0.0 <3.0.0", | ||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.15.2.tgz" | ||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.16.0.tgz" | ||
}, | ||
@@ -150,27 +90,7 @@ "ms": { | ||
}, | ||
"number-is-nan": { | ||
"version": "1.0.1", | ||
"from": "number-is-nan@>=1.0.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" | ||
"safe-buffer": { | ||
"version": "5.0.1", | ||
"from": "safe-buffer@>=5.0.1 <6.0.0", | ||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz" | ||
}, | ||
"object-assign": { | ||
"version": "1.0.0", | ||
"from": "object-assign@>=1.0.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-1.0.0.tgz" | ||
}, | ||
"readable-stream": { | ||
"version": "1.1.14", | ||
"from": "readable-stream@>=1.1.9 <1.2.0", | ||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz" | ||
}, | ||
"repeating": { | ||
"version": "1.1.3", | ||
"from": "repeating@>=1.1.0 <2.0.0", | ||
"resolved": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz" | ||
}, | ||
"string_decoder": { | ||
"version": "0.10.31", | ||
"from": "string_decoder@>=0.10.0 <0.11.0", | ||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" | ||
}, | ||
"topo": { | ||
@@ -181,7 +101,2 @@ "version": "1.1.0", | ||
}, | ||
"typedarray": { | ||
"version": "0.0.6", | ||
"from": "typedarray@>=0.0.5 <0.1.0", | ||
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" | ||
}, | ||
"websocket-driver": { | ||
@@ -188,0 +103,0 @@ "version": "0.6.5", |
{ | ||
"name": "firebase-admin", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Firebase admin SDK for Node.js", | ||
"author": "Firebase (https://firebase.google.com/)", | ||
"license": "SEE LICENSE IN https://developers.google.com/terms", | ||
"license": "SEE LICENSE IN https://firebase.google.com/terms/", | ||
"homepage": "https://firebase.google.com/", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -51,3 +51,3 @@ # Firebase Admin Node.js SDK | ||
* [Authentication Guide](https://firebase.google.com/docs/auth/admin/) | ||
* [API Reference](https://firebase.google.com/docs/reference/admin/node) | ||
* [API Reference](https://firebase.google.com/docs/reference/admin/node/) | ||
@@ -58,3 +58,3 @@ | ||
Release Notes for the Firebase Admin Node.js SDK are available | ||
[here](https://firebase.google.com/support/releases/). | ||
[here](https://firebase.google.com/support/release-notes/admin/node/). | ||
@@ -72,3 +72,3 @@ | ||
The Firebase Admin Node.js SDK is covered by the | ||
[Google APIs Terms of Service](https://developers.google.com/terms/). | ||
[Terms of Service for Firebase Services](https://firebase.google.com/terms/). | ||
Sorry, the diff of this file is too big to display
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
265429
4067