Socket
Socket
Sign inDemoInstall

firebase-admin

Package Overview
Dependencies
205
Maintainers
4
Versions
130
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 11.9.0 to 11.10.0

lib/storage/utils.d.ts

2

lib/app-check/app-check-api-client-internal.d.ts

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -968,11 +968,11 @@ /*!

}
if (typeof options.constraints.requireUppercase !== undefined &&
if (typeof options.constraints.requireUppercase !== 'undefined' &&
!validator.isBoolean(options.constraints.requireUppercase)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.requireUppercase" must be a boolean.');
}
if (typeof options.constraints.requireLowercase !== undefined &&
if (typeof options.constraints.requireLowercase !== 'undefined' &&
!validator.isBoolean(options.constraints.requireLowercase)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.requireLowercase" must be a boolean.');
}
if (typeof options.constraints.requireNonAlphanumeric !== undefined &&
if (typeof options.constraints.requireNonAlphanumeric !== 'undefined' &&
!validator.isBoolean(options.constraints.requireNonAlphanumeric)) {

@@ -982,15 +982,12 @@ throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.requireNonAlphanumeric"' +

}
if (typeof options.constraints.requireNumeric !== undefined &&
if (typeof options.constraints.requireNumeric !== 'undefined' &&
!validator.isBoolean(options.constraints.requireNumeric)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.requireNumeric" must be a boolean.');
}
if (!validator.isNumber(options.constraints.minLength)) {
if (typeof options.constraints.minLength === 'undefined') {
options.constraints.minLength = 6;
}
else if (!validator.isNumber(options.constraints.minLength)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.minLength" must be a number.');
}
if (!validator.isNumber(options.constraints.maxLength)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.maxLength" must be a number.');
}
if (options.constraints.minLength === undefined) {
options.constraints.minLength = 6;
}
else {

@@ -1003,5 +1000,8 @@ if (!(options.constraints.minLength >= 6

}
if (options.constraints.maxLength === undefined) {
if (typeof options.constraints.maxLength === 'undefined') {
options.constraints.maxLength = 4096;
}
else if (!validator.isNumber(options.constraints.maxLength)) {
throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_CONFIG, '"PasswordPolicyConfig.constraints.maxLength" must be a number.');
}
else {

@@ -1008,0 +1008,0 @@ if (!(options.constraints.maxLength >= options.constraints.minLength &&

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
import { ProjectConfig, UpdateProjectConfigRequest } from './project-config';

@@ -3,0 +3,0 @@ /**

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
import { SmsRegionConfig, MultiFactorConfig, MultiFactorAuthServerConfig, RecaptchaConfig, PasswordPolicyAuthServerConfig, PasswordPolicyConfig } from './auth-config';

@@ -3,0 +3,0 @@ /**

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -22,5 +22,9 @@ * @license

phoneInfo?: string;
totpInfo?: TotpInfoResponse;
enrolledAt?: string;
[key: string]: any;
[key: string]: unknown;
}
export interface TotpInfoResponse {
[key: string]: unknown;
}
export interface ProviderUserInfoResponse {

@@ -68,3 +72,5 @@ rawId: string;

/**
* The type identifier of the second factor. For SMS second factors, this is `phone`.
* The type identifier of the second factor.
* For SMS second factors, this is `phone`.
* For TOTP second factors, this is `totp`.
*/

@@ -103,2 +109,20 @@ readonly factorId: string;

/**
* `TotpInfo` struct associated with a second factor
*/
export declare class TotpInfo {
}
/**
* Interface representing a TOTP specific user-enrolled second factor.
*/
export declare class TotpMultiFactorInfo extends MultiFactorInfo {
/**
* `TotpInfo` struct associated with a second factor
*/
readonly totpInfo: TotpInfo;
/**
* {@inheritdoc MultiFactorInfo.toJSON}
*/
toJSON(): object;
}
/**
* The multi-factor related user settings.

@@ -109,3 +133,3 @@ */

* List of second factors enrolled with the current user.
* Currently only phone second factors are supported.
* Currently only phone and TOTP second factors are supported.
*/

@@ -112,0 +136,0 @@ enrolledFactors: MultiFactorInfo[];

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -20,3 +20,3 @@ /*!

Object.defineProperty(exports, "__esModule", { value: true });
exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactorSettings = exports.PhoneMultiFactorInfo = exports.MultiFactorInfo = void 0;
exports.UserRecord = exports.UserInfo = exports.UserMetadata = exports.MultiFactorSettings = exports.TotpMultiFactorInfo = exports.TotpInfo = exports.PhoneMultiFactorInfo = exports.MultiFactorInfo = void 0;
const deep_copy_1 = require("../utils/deep-copy");

@@ -51,2 +51,3 @@ const validator_1 = require("../utils/validator");

MultiFactorId["Phone"] = "phone";
MultiFactorId["Totp"] = "totp";
})(MultiFactorId || (MultiFactorId = {}));

@@ -66,5 +67,13 @@ /**

let multiFactorInfo = null;
// Only PhoneMultiFactorInfo currently available.
// PhoneMultiFactorInfo, TotpMultiFactorInfo currently available.
try {
multiFactorInfo = new PhoneMultiFactorInfo(response);
if (response.phoneInfo !== undefined) {
multiFactorInfo = new PhoneMultiFactorInfo(response);
}
else if (response.totpInfo !== undefined) {
multiFactorInfo = new TotpMultiFactorInfo(response);
}
else {
// Ignore the other SDK unsupported MFA factors to prevent blocking developers using the current SDK.
}
}

@@ -163,2 +172,45 @@ catch (e) {

/**
* `TotpInfo` struct associated with a second factor
*/
class TotpInfo {
}
exports.TotpInfo = TotpInfo;
/**
* Interface representing a TOTP specific user-enrolled second factor.
*/
class TotpMultiFactorInfo extends MultiFactorInfo {
/**
* Initializes the `TotpMultiFactorInfo` object using the server side response.
*
* @param response - The server side response.
* @constructor
* @internal
*/
constructor(response) {
super(response);
utils.addReadonlyGetter(this, 'totpInfo', response.totpInfo);
}
/**
* {@inheritdoc MultiFactorInfo.toJSON}
*/
toJSON() {
return Object.assign(super.toJSON(), {
totpInfo: this.totpInfo,
});
}
/**
* Returns the factor ID based on the response provided.
*
* @param response - The server side response.
* @returns The multi-factor ID associated with the provided response. If the response is
* not associated with any known multi-factor ID, `null` is returned.
*
* @internal
*/
getFactorId(response) {
return (response && response.totpInfo) ? MultiFactorId.Totp : null;
}
}
exports.TotpMultiFactorInfo = TotpMultiFactorInfo;
/**
* The multi-factor related user settings.

@@ -168,3 +220,3 @@ */

/**
* Initializes the MultiFactor object using the server side or JWT format response.
* Initializes the `MultiFactor` object using the server side or JWT format response.
*

@@ -208,3 +260,3 @@ * @param response - The server side response.

/**
* @param response - The server side response returned from the getAccountInfo
* @param response - The server side response returned from the `getAccountInfo`
* endpoint.

@@ -211,0 +263,0 @@ * @constructor

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

import mod from "../../storage/index.js";
export const Storage = mod.Storage;
export const getDownloadURL = mod.getDownloadURL;
export const getStorage = mod.getStorage;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -28,12 +28,8 @@ * Copyright 2020 Google Inc.

/**
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* Gets the default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the default app.
*
* `getFirestore()` can be called with no arguments to access the default
* app's `Firestore` service or as `getFirestore(app)` to access the
* `Firestore` service associated with a specific app.
*
* @example
* ```javascript
* // Get the Firestore service for the default app
* // Get the default Firestore service for the default app
* const defaultFirestore = getFirestore();

@@ -43,30 +39,59 @@ * ```

* @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service if no app is provided or the `Firestore` service associated with the
* provided app.
* service for the default app.
*/
export declare function getFirestore(): Firestore;
/**
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* Gets the default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the given app.
*
* `getFirestore()` can be called with no arguments to access the default
* app's `Firestore` service or as `getFirestore(app)` to access the
* `Firestore` service associated with a specific app.
*
* @example
* ```javascript
* // Get the Firestore service for a specific app
* // Get the default Firestore service for a specific app
* const otherFirestore = getFirestore(app);
* ```
*
* @param App - which `Firestore` service to
* return. If not provided, the default `Firestore` service will be returned.
* @param app - which `Firestore` service to return.
*
* @returns The default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service if no app is provided or the `Firestore` service associated with the
* provided app.
* service associated with the provided app.
*/
export declare function getFirestore(app: App): Firestore;
/**
* Gets the {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* Gets the named {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the default app.
*
* @example
* ```javascript
* // Get the Firestore service for a named database and default app
* const otherFirestore = getFirestore('otherDb');
* ```
*
* @param databaseId - name of database to return.
*
* @returns The named {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the default app.
* @beta
*/
export declare function getFirestore(databaseId: string): Firestore;
/**
* Gets the named {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the given app.
*
* @example
* ```javascript
* // Get the Firestore service for a named database and specific app.
* const otherFirestore = getFirestore('otherDb');
* ```
*
* @param app - which `Firestore` service to return.
*
* @param databaseId - name of database to return.
*
* @returns The named {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service associated with the provided app.
* @beta
*/
export declare function getFirestore(app: App, databaseId: string): Firestore;
/**
* Gets the default {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the given app, passing extra parameters to its constructor.

@@ -80,9 +105,28 @@ *

*
* @param App - which `Firestore` service to
* return. If not provided, the default `Firestore` service will be returned.
* @param app - which `Firestore` service to return.
*
* @param settings - Settings object to be passed to the constructor.
*
* @returns The `Firestore` service associated with the provided app and settings.
* @returns The default `Firestore` service associated with the provided app and settings.
*/
export declare function initializeFirestore(app: App, settings?: FirestoreSettings): Firestore;
/**
* Gets the named {@link https://googleapis.dev/nodejs/firestore/latest/Firestore.html | Firestore}
* service for the given app, passing extra parameters to its constructor.
*
* @example
* ```javascript
* // Get the Firestore service for a specific app, require HTTP/1.1 REST transport
* const otherFirestore = initializeFirestore(app, {preferRest: true}, 'otherDb');
* ```
*
* @param app - which `Firestore` service to return.
*
* @param settings - Settings object to be passed to the constructor.
*
* @param databaseId - name of database to return.
*
* @returns The named `Firestore` service associated with the provided app and settings.
* @beta
*/
export declare function initializeFirestore(app: App, settings: FirestoreSettings, databaseId: string): Firestore;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -24,2 +24,3 @@ * @license

export interface Task {
name?: string;
scheduleTime?: string;

@@ -41,3 +42,3 @@ dispatchDeadline?: string;

};
export type FunctionsErrorCode = 'aborted' | 'invalid-argument' | 'invalid-credential' | 'internal-error' | 'failed-precondition' | 'permission-denied' | 'unauthenticated' | 'not-found' | 'unknown-error';
export type FunctionsErrorCode = 'aborted' | 'invalid-argument' | 'invalid-credential' | 'internal-error' | 'failed-precondition' | 'permission-denied' | 'unauthenticated' | 'not-found' | 'unknown-error' | 'task-already-exists';
/**

@@ -44,0 +45,0 @@ * Firebase Functions error code structure. This extends PrefixedFirebaseError.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -26,3 +26,4 @@ /*!

const credential_internal_1 = require("../app/credential-internal");
const CLOUD_TASKS_API_URL_FORMAT = 'https://cloudtasks.googleapis.com/v2/projects/{projectId}/locations/{locationId}/queues/{resourceId}/tasks';
const CLOUD_TASKS_API_RESOURCE_PATH = 'projects/{projectId}/locations/{locationId}/queues/{resourceId}/tasks';
const CLOUD_TASKS_API_URL_FORMAT = 'https://cloudtasks.googleapis.com/v2/' + CLOUD_TASKS_API_RESOURCE_PATH;
const FIREBASE_FUNCTION_URL_FORMAT = 'https://{locationId}-{projectId}.cloudfunctions.net/{resourceId}';

@@ -48,2 +49,54 @@ const FIREBASE_FUNCTIONS_CONFIG_HEADERS = {

/**
* Deletes a task from a queue.
*
* @param id - The ID of the task to delete.
* @param functionName - The function name of the queue.
* @param extensionId - Optional canonical ID of the extension.
*/
async delete(id, functionName, extensionId) {
if (!validator.isNonEmptyString(functionName)) {
throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a non empty string');
}
if (!validator.isTaskId(id)) {
throw new FirebaseFunctionsError('invalid-argument', 'id can contain only letters ([A-Za-z]), numbers ([0-9]), '
+ 'hyphens (-), or underscores (_). The maximum length is 500 characters.');
}
let resources;
try {
resources = utils.parseResourceName(functionName, 'functions');
}
catch (err) {
throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a single string or a qualified resource name');
}
resources.projectId = resources.projectId || await this.getProjectId();
resources.locationId = resources.locationId || DEFAULT_LOCATION;
if (!validator.isNonEmptyString(resources.resourceId)) {
throw new FirebaseFunctionsError('invalid-argument', 'No valid function name specified to enqueue tasks for.');
}
if (typeof extensionId !== 'undefined' && validator.isNonEmptyString(extensionId)) {
resources.resourceId = `ext-${extensionId}-${resources.resourceId}`;
}
try {
const serviceUrl = await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT.concat('/', id));
const request = {
method: 'DELETE',
url: serviceUrl,
headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
};
await this.httpClient.send(request);
}
catch (err) {
if (err instanceof api_request_1.HttpError) {
if (err.response.status === 404) {
// if no task with the provided ID exists, then ignore the delete.
return;
}
throw this.toFirebaseError(err);
}
else {
throw err;
}
}
}
/**
* Creates a task and adds it to a queue.

@@ -56,7 +109,6 @@ *

*/
enqueue(data, functionName, extensionId, opts) {
async enqueue(data, functionName, extensionId, opts) {
if (!validator.isNonEmptyString(functionName)) {
throw new FirebaseFunctionsError('invalid-argument', 'Function name must be a non empty string');
}
const task = this.validateTaskOptions(data, opts);
let resources;

@@ -69,26 +121,37 @@ try {

}
resources.projectId = resources.projectId || await this.getProjectId();
resources.locationId = resources.locationId || DEFAULT_LOCATION;
if (!validator.isNonEmptyString(resources.resourceId)) {
throw new FirebaseFunctionsError('invalid-argument', 'No valid function name specified to enqueue tasks for.');
}
if (typeof extensionId !== 'undefined' && validator.isNonEmptyString(extensionId)) {
resources.resourceId = `ext-${extensionId}-${resources.resourceId}`;
}
return this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT)
.then((serviceUrl) => {
return this.updateTaskPayload(task, resources, extensionId)
.then((task) => {
const request = {
method: 'POST',
url: serviceUrl,
headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
data: {
task,
}
};
return this.httpClient.send(request);
});
})
.then(() => {
return;
})
.catch((err) => {
throw this.toFirebaseError(err);
});
const task = this.validateTaskOptions(data, resources, opts);
try {
const serviceUrl = await this.getUrl(resources, CLOUD_TASKS_API_URL_FORMAT);
const taskPayload = await this.updateTaskPayload(task, resources, extensionId);
const request = {
method: 'POST',
url: serviceUrl,
headers: FIREBASE_FUNCTIONS_CONFIG_HEADERS,
data: {
task: taskPayload,
}
};
await this.httpClient.send(request);
}
catch (err) {
if (err instanceof api_request_1.HttpError) {
if (err.response.status === 409) {
throw new FirebaseFunctionsError('task-already-exists', `A task with ID ${opts?.id} already exists`);
}
else {
throw this.toFirebaseError(err);
}
}
else {
throw err;
}
}
}

@@ -149,3 +212,3 @@ getUrl(resourceName, urlFormat) {

}
validateTaskOptions(data, opts) {
validateTaskOptions(data, resources, opts) {
const task = {

@@ -158,3 +221,6 @@ httpRequest: {

body: Buffer.from(JSON.stringify({ data })).toString('base64'),
headers: { 'Content-Type': 'application/json' }
headers: {
'Content-Type': 'application/json',
...opts?.headers,
}
}

@@ -192,2 +258,14 @@ };

}
if ('id' in opts && typeof opts.id !== 'undefined') {
if (!validator.isTaskId(opts.id)) {
throw new FirebaseFunctionsError('invalid-argument', 'id can contain only letters ([A-Za-z]), numbers ([0-9]), '
+ 'hyphens (-), or underscores (_). The maximum length is 500 characters.');
}
const resourcePath = utils.formatString(CLOUD_TASKS_API_RESOURCE_PATH, {
projectId: resources.projectId,
locationId: resources.locationId,
resourceId: resources.resourceId,
});
task.name = resourcePath.concat('/', opts.id);
}
if (typeof opts.uri !== 'undefined') {

@@ -194,0 +272,0 @@ if (!validator.isURL(opts.uri)) {

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -57,2 +57,34 @@ * @license

dispatchDeadlineSeconds?: number;
/**
* The ID to use for the enqueued event.
* If not provided, one will be automatically generated.
* If provided, an explicitly specified task ID enables task de-duplication. If a task's ID is
* identical to that of an existing task or a task that was deleted or executed recently then
* the call will throw an error with code "functions/task-already-exists". Another task with
* the same ID can't be created for ~1hour after the original task was deleted or executed.
*
* Because there is an extra lookup cost to identify duplicate task IDs, setting ID
* significantly increases latency. Using hashed strings for the task ID or for the prefix of
* the task ID is recommended. Choosing task IDs that are sequential or have sequential
* prefixes, for example using a timestamp, causes an increase in latency and error rates in
* all task commands. The infrastructure relies on an approximately uniform distribution of
* task IDs to store and serve tasks efficiently.
*
* "Push IDs" from the Firebase Realtime Database make poor IDs because they are based on
* timestamps and will cause contention (slowdowns) in your task queue. Reversed push IDs
* however form a perfect distribution and are an ideal key. To reverse a string in
* javascript use `someString.split("").reverse().join("")`
*/
id?: string;
/**
* HTTP request headers to include in the request to the task queue function.
* These headers represent a subset of the headers that will accompany the task's HTTP
* request. Some HTTP request headers will be ignored or replaced, e.g. Authorization, Host, Content-Length,
* User-Agent etc. cannot be overridden.
*
* By default, Content-Type is set to 'application/json'.
*
* The size of the headers must be less than 80KB.
*/
headers?: Record<string, string>;
};

@@ -59,0 +91,0 @@ /**

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -63,2 +63,8 @@ * @license

enqueue(data: Args, opts?: TaskOptions): Promise<void>;
/**
* Deletes an enqueued task if it has not yet completed.
* @param id - the ID of the task, relative to this queue.
* @returns A promise that resolves when the task has been deleted.
*/
delete(id: string): Promise<void>;
}

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -96,3 +96,11 @@ /*!

}
/**
* Deletes an enqueued task if it has not yet completed.
* @param id - the ID of the task, relative to this queue.
* @returns A promise that resolves when the task has been deleted.
*/
delete(id) {
return this.client.delete(id, this.functionName, this.extensionId);
}
}
exports.TaskQueue = TaskQueue;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -25,3 +25,3 @@ * @license

import { Functions } from './functions';
export { DelayDelivery, AbsoluteDelivery, DeliverySchedule, TaskOptions, TaskOptionsExperimental } from './functions-api';
export { DelayDelivery, AbsoluteDelivery, DeliverySchedule, TaskOptions, TaskOptionsExperimental, } from './functions-api';
export { Functions, TaskQueue } from './functions';

@@ -28,0 +28,0 @@ /**

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
import { App } from '../app/index';

@@ -3,0 +3,0 @@ import { InstanceId as TInstanceId } from './instance-id';

@@ -1,3 +0,3 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2018 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2020 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2019 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -22,2 +22,3 @@ * Copyright 2020 Google Inc.

*/
import { File } from '@google-cloud/storage';
import { App } from '../app';

@@ -46,1 +47,13 @@ import { Storage } from './storage';

export declare function getStorage(app?: App): Storage;
/**
* Gets the download URL for the given {@link https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file | File}.
*
* @example
* ```javascript
* // Get the downloadUrl for a given file ref
* const storage = getStorage();
* const myRef = ref(storage, 'images/mountains.jpg');
* const downloadUrl = await getDownloadURL(myRef);
* ```
*/
export declare function getDownloadURL(file: File): Promise<string>;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -19,10 +19,7 @@ /*!

Object.defineProperty(exports, "__esModule", { value: true });
exports.getStorage = exports.Storage = void 0;
/**
* Cloud Storage for Firebase.
*
* @packageDocumentation
*/
exports.getDownloadURL = exports.getStorage = exports.Storage = void 0;
const app_1 = require("../app");
const storage_1 = require("./storage");
const error_1 = require("../utils/error");
const utils_1 = require("./utils");
var storage_2 = require("./storage");

@@ -57,1 +54,26 @@ Object.defineProperty(exports, "Storage", { enumerable: true, get: function () { return storage_2.Storage; } });

exports.getStorage = getStorage;
/**
* Gets the download URL for the given {@link https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file | File}.
*
* @example
* ```javascript
* // Get the downloadUrl for a given file ref
* const storage = getStorage();
* const myRef = ref(storage, 'images/mountains.jpg');
* const downloadUrl = await getDownloadURL(myRef);
* ```
*/
async function getDownloadURL(file) {
const endpoint = (process.env.STORAGE_EMULATOR_HOST ||
'https://firebasestorage.googleapis.com') + '/v0';
const { downloadTokens } = await (0, utils_1.getFirebaseMetadata)(endpoint, file);
if (!downloadTokens) {
throw new error_1.FirebaseError({
code: 'storage/no-download-token',
message: 'No download token available. Please create one in the Firebase Console.',
});
}
const [token] = downloadTokens.split(',');
return `${endpoint}/b/${file.bucket.name}/o/${encodeURIComponent(file.name)}?alt=media&token=${token}`;
}
exports.getDownloadURL = getDownloadURL;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -350,10 +350,2 @@ /*!

req.setTimeout(timeout, timeoutCallback);
req.on('socket', (socket) => {
socket.setMaxListeners(socket.getMaxListeners() + 1);
socket.setTimeout(timeout, timeoutCallback);
socket.on('end', () => {
socket.setTimeout(0);
socket.setMaxListeners(Math.max(socket.getMaxListeners() - 1, 0));
});
});
}

@@ -360,0 +352,0 @@ // Send the request

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * @license

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -3,0 +3,0 @@ * Copyright 2021 Google Inc.

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -3,0 +3,0 @@ /*!

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
/*!

@@ -145,1 +145,9 @@ * @license

export declare function isTopic(topic: any): boolean;
/**
* Validates that the provided string can be used as a task ID
* for Cloud Tasks.
*
* @param taskId - the task ID to validate.
* @returns Whether the provided task ID is valid.
*/
export declare function isTaskId(taskId: any): boolean;

@@ -1,2 +0,2 @@

/*! firebase-admin v11.9.0 */
/*! firebase-admin v11.10.0 */
"use strict";

@@ -20,3 +20,3 @@ /*!

Object.defineProperty(exports, "__esModule", { value: true });
exports.isTopic = exports.isURL = exports.isUTCDateString = exports.isISODateString = exports.isPhoneNumber = exports.isEmail = exports.isPassword = exports.isUid = exports.isNonNullObject = exports.isObject = exports.isNonEmptyString = exports.isBase64String = exports.isString = exports.isNumber = exports.isBoolean = exports.isNonEmptyArray = exports.isArray = exports.isBuffer = void 0;
exports.isTaskId = exports.isTopic = exports.isURL = exports.isUTCDateString = exports.isISODateString = exports.isPhoneNumber = exports.isEmail = exports.isPassword = exports.isUid = exports.isNonNullObject = exports.isObject = exports.isNonEmptyString = exports.isBase64String = exports.isString = exports.isNumber = exports.isBoolean = exports.isNonEmptyArray = exports.isArray = exports.isBuffer = void 0;
const url = require("url");

@@ -273,1 +273,16 @@ /**

exports.isTopic = isTopic;
/**
* Validates that the provided string can be used as a task ID
* for Cloud Tasks.
*
* @param taskId - the task ID to validate.
* @returns Whether the provided task ID is valid.
*/
function isTaskId(taskId) {
if (typeof taskId !== 'string') {
return false;
}
const VALID_TASK_ID_REGEX = /^[A-Za-z0-9_-]+$/;
return VALID_TASK_ID_REGEX.test(taskId);
}
exports.isTaskId = isTaskId;
{
"name": "firebase-admin",
"version": "11.9.0",
"version": "11.10.0",
"description": "Firebase admin SDK for Node.js",

@@ -200,4 +200,4 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",

"@fastify/busboy": "^1.2.1",
"@firebase/database-compat": "^0.3.4",
"@firebase/database-types": "^0.10.4",
"@firebase/database-compat": "^1.0.0",
"@firebase/database-types": "^1.0.0",
"@types/node": ">=12.12.47",

@@ -204,0 +204,0 @@ "jsonwebtoken": "^9.0.0",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc