Socket
Socket
Sign inDemoInstall

firebase-admin

Package Overview
Dependencies
177
Maintainers
4
Versions
130
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 12.0.0 to 12.1.0

lib/remote-config/condition-evaluator-internal.d.ts

2

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
import { ProjectConfig, UpdateProjectConfigRequest } from './project-config';

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
import { SmsRegionConfig, MultiFactorConfig, MultiFactorAuthServerConfig, RecaptchaConfig, PasswordPolicyAuthServerConfig, PasswordPolicyConfig, EmailPrivacyConfig } from './auth-config';

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

@@ -228,12 +228,18 @@ /*!

}
else if (typeof payload.sub !== 'string') {
errorMessage = `${this.tokenInfo.jwtName} has no "sub" (subject) claim.` + verifyJwtTokenDocsMessage;
else if (!(payload.event_type !== undefined &&
(payload.event_type === 'beforeSendSms' || payload.event_type === 'beforeSendEmail'))) {
// excluding `beforeSendSms` and `beforeSendEmail` from processing `sub` as there is no user record available.
// `sub` is the same as `uid` which is part of the user record.
if (typeof payload.sub !== 'string') {
errorMessage = `${this.tokenInfo.jwtName} has no "sub" (subject) claim.` + verifyJwtTokenDocsMessage;
}
else if (payload.sub === '') {
errorMessage = `${this.tokenInfo.jwtName} has an empty "sub" (subject) claim.` +
verifyJwtTokenDocsMessage;
}
else if (payload.sub.length > 128) {
errorMessage = `${this.tokenInfo.jwtName} has a "sub" (subject) claim longer than 128 characters.` +
verifyJwtTokenDocsMessage;
}
}
else if (payload.sub === '') {
errorMessage = `${this.tokenInfo.jwtName} has an empty string "sub" (subject) claim.` + verifyJwtTokenDocsMessage;
}
else if (payload.sub.length > 128) {
errorMessage = `${this.tokenInfo.jwtName} has "sub" (subject) claim longer than 128 characters.` +
verifyJwtTokenDocsMessage;
}
if (errorMessage) {

@@ -240,0 +246,0 @@ throw new error_1.FirebaseAuthError(error_1.AuthClientErrorCode.INVALID_ARGUMENT, errorMessage);

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

@@ -56,41 +56,41 @@ * Copyright 2021 Google Inc.

/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot | DataSnapshot}
* type from the `@firebase/database` package.
* Type alias to {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.DataSnapshot | DataSnapshot}
* type from the `@firebase/database-compat` package.
*/
type DataSnapshot = rtdb.DataSnapshot;
/**
* Type alias to the {@link https://firebase.google.com/docs/reference/js/firebase.database#eventtype | EventType}
* type from the `@firebase/database` package.
* Type alias to the {@link https://firebase.google.com/docs/reference/js/v8/firebase.database#eventtype | EventType}
* type from the `@firebase/database-compat` package.
*/
type EventType = rtdb.EventType;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect | OnDisconnect}
* type from the `@firebase/database` package.
* Type alias to {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.OnDisconnect | OnDisconnect}
* type from the `@firebase/database-compat` package.
*/
type OnDisconnect = rtdb.OnDisconnect;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.Query | Query}
* type from the `@firebase/database` package.
* Type alias to {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.Query | Query}
* type from the `@firebase/database-compat` package.
*/
type Query = rtdb.Query;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference | Reference}
* type from the `@firebase/database` package.
* Type alias to {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.Reference | Reference}
* type from the `@firebase/database-compat` package.
*/
type Reference = rtdb.Reference;
/**
* Type alias to {@link https://firebase.google.com/docs/reference/js/firebase.database.ThenableReference |
* ThenableReference} type from the `@firebase/database` package.
* Type alias to {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.ThenableReference |
* ThenableReference} type from the `@firebase/database-compat` package.
*/
type ThenableReference = rtdb.ThenableReference;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database-compat` package.
*/
const enableLogging: typeof rtdb.enableLogging;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database-compat` package.
*/
const ServerValue: rtdb.ServerValue;
}

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

@@ -22,4 +22,4 @@ * Copyright 2020 Google Inc.

* The Firebase Database service interface. Extends the
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Database | Database}
* interface provided by the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.Database | Database}
* interface provided by the `@firebase/database-compat` package.
*/

@@ -26,0 +26,0 @@ export interface Database extends FirebaseDatabase {

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

@@ -28,9 +28,9 @@ * Copyright 2020 Google Inc.

/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database-compat` package.
*/
export declare const enableLogging: typeof rtdb.enableLogging;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database-compat` package.
*/

@@ -37,0 +37,0 @@ export declare const ServerValue: rtdb.ServerValue;

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

@@ -25,9 +25,9 @@ /*!

/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database#enablelogging | enableLogging}
* function from the `@firebase/database-compat` package.
*/
exports.enableLogging = standalone_1.enableLogging;
/**
* {@link https://firebase.google.com/docs/reference/js/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database` package.
* {@link https://firebase.google.com/docs/reference/js/v8/firebase.database.ServerValue | ServerValue}
* constant from the `@firebase/database-compat` package.
*/

@@ -34,0 +34,0 @@ // eslint-disable-next-line @typescript-eslint/naming-convention

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

import mod from "../../remote-config/index.js";
export const PercentConditionOperator = mod.PercentConditionOperator;
export const RemoteConfig = mod.RemoteConfig;
export const getRemoteConfig = mod.getRemoteConfig;

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
import { App } from '../app/index';

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

.then((urlPath) => {
const requests = copy.map((message) => {
const requests = copy.map(async (message) => {
(0, messaging_internal_1.validateMessage)(message);

@@ -241,0 +241,0 @@ const request = { message };

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

import { RemoteConfig } from './remote-config';
export { ExplicitParameterValue, InAppDefaultValue, ListVersionsOptions, ListVersionsResult, ParameterValueType, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, TagColor, Version, } from './remote-config-api';
export { AndCondition, DefaultConfig, EvaluationContext, ExplicitParameterValue, GetServerTemplateOptions, InAppDefaultValue, InitServerTemplateOptions, ListVersionsOptions, ListVersionsResult, MicroPercentRange, NamedCondition, OneOfCondition, OrCondition, ParameterValueType, PercentConditionOperator, PercentCondition, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, ServerConfig, ServerTemplate, ServerTemplateData, ServerTemplateDataType, TagColor, Value, ValueSource, Version, } from './remote-config-api';
export { RemoteConfig } from './remote-config';

@@ -27,0 +27,0 @@ /**

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getRemoteConfig = exports.RemoteConfig = void 0;
exports.getRemoteConfig = exports.RemoteConfig = exports.PercentConditionOperator = void 0;
/**

@@ -28,2 +28,4 @@ * Firebase Remote Config.

const remote_config_1 = require("./remote-config");
var remote_config_api_1 = require("./remote-config-api");
Object.defineProperty(exports, "PercentConditionOperator", { enumerable: true, get: function () { return remote_config_api_1.PercentConditionOperator; } });
var remote_config_2 = require("./remote-config");

@@ -30,0 +32,0 @@ Object.defineProperty(exports, "RemoteConfig", { enumerable: true, get: function () { return remote_config_2.RemoteConfig; } });

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

// Remote Config backend constants
const FIREBASE_REMOTE_CONFIG_V1_API = 'https://firebaseremoteconfig.googleapis.com/v1';
/**
* Allows the `FIREBASE_REMOTE_CONFIG_URL_BASE` environment
* variable to override the default API endpoint URL.
*/
const FIREBASE_REMOTE_CONFIG_URL_BASE = process.env.FIREBASE_REMOTE_CONFIG_URL_BASE || 'https://firebaseremoteconfig.googleapis.com';
const FIREBASE_REMOTE_CONFIG_HEADERS = {

@@ -155,2 +159,19 @@ 'X-Firebase-Client': `fire-admin-node/${utils.getSdkVersion()}`,

}
getServerTemplate() {
return this.getUrl()
.then((url) => {
const request = {
method: 'GET',
url: `${url}/namespaces/firebase-server/serverRemoteConfig`,
headers: FIREBASE_REMOTE_CONFIG_HEADERS
};
return this.httpClient.send(request);
})
.then((resp) => {
return this.toRemoteConfigServerTemplate(resp);
})
.catch((err) => {
throw this.toFirebaseError(err);
});
}
sendPutRequest(template, etag, validateOnly) {

@@ -180,3 +201,3 @@ let path = 'remoteConfig';

.then((projectIdPrefix) => {
return `${FIREBASE_REMOTE_CONFIG_V1_API}/${projectIdPrefix}`;
return `${FIREBASE_REMOTE_CONFIG_URL_BASE}/v1/${projectIdPrefix}`;
});

@@ -234,2 +255,19 @@ }

/**
* Creates a RemoteConfigServerTemplate from the API response.
* If provided, customEtag is used instead of the etag returned in the API response.
*
* @param {HttpResponse} resp API response object.
* @param {string} customEtag A custom etag to replace the etag fom the API response (Optional).
*/
toRemoteConfigServerTemplate(resp, customEtag) {
const etag = (typeof customEtag === 'undefined') ? resp.headers['etag'] : customEtag;
this.validateEtag(etag);
return {
conditions: resp.data.conditions,
parameters: resp.data.parameters,
etag,
version: resp.data.version,
};
}
/**
* Checks if the given RemoteConfigTemplate object is valid.

@@ -236,0 +274,0 @@ * The object must have valid parameters, parameter groups, conditions, and an etag.

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

@@ -51,2 +51,135 @@ * Copyright 2021 Google Inc.

/**
* Represents a Remote Config condition in the dataplane.
* A condition targets a specific group of users. A list of these conditions
* comprise part of a Remote Config template.
*/
export interface NamedCondition {
/**
* A non-empty and unique name of this condition.
*/
name: string;
/**
* The logic of this condition.
* See the documentation on
* {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
* for the expected syntax of this field.
*/
condition: OneOfCondition;
}
/**
* Represents a condition that may be one of several types.
* Only the first defined field will be processed.
*/
export interface OneOfCondition {
/**
* Makes this condition an OR condition.
*/
orCondition?: OrCondition;
/**
* Makes this condition an AND condition.
*/
andCondition?: AndCondition;
/**
* Makes this condition a constant true.
*/
true?: Record<string, never>;
/**
* Makes this condition a constant false.
*/
false?: Record<string, never>;
/**
* Makes this condition a percent condition.
*/
percent?: PercentCondition;
}
/**
* Represents a collection of conditions that evaluate to true if all are true.
*/
export interface AndCondition {
/**
* The collection of conditions.
*/
conditions?: Array<OneOfCondition>;
}
/**
* Represents a collection of conditions that evaluate to true if any are true.
*/
export interface OrCondition {
/**
* The collection of conditions.
*/
conditions?: Array<OneOfCondition>;
}
/**
* Defines supported operators for percent conditions.
*/
export declare enum PercentConditionOperator {
/**
* A catchall error case.
*/
UNKNOWN = "UNKNOWN",
/**
* Target percentiles less than or equal to the target percent.
* A condition using this operator must specify microPercent.
*/
LESS_OR_EQUAL = "LESS_OR_EQUAL",
/**
* Target percentiles greater than the target percent.
* A condition using this operator must specify microPercent.
*/
GREATER_THAN = "GREATER_THAN",
/**
* Target percentiles within an interval defined by a lower bound and an
* upper bound. The lower bound is an exclusive (open) bound and the
* micro_percent_range_upper_bound is an inclusive (closed) bound.
* A condition using this operator must specify microPercentRange.
*/
BETWEEN = "BETWEEN"
}
/**
* Represents the limit of percentiles to target in micro-percents.
* The value must be in the range [0 and 100000000]
*/
export interface MicroPercentRange {
/**
* The lower limit of percentiles to target in micro-percents.
* The value must be in the range [0 and 100000000].
*/
microPercentLowerBound?: number;
/**
* The upper limit of percentiles to target in micro-percents.
* The value must be in the range [0 and 100000000].
*/
microPercentUpperBound?: number;
}
/**
* Represents a condition that compares the instance pseudo-random
* percentile to a given limit.
*/
export interface PercentCondition {
/**
* The choice of percent operator to determine how to compare targets
* to percent(s).
*/
percentOperator?: PercentConditionOperator;
/**
* The limit of percentiles to target in micro-percents when
* using the LESS_OR_EQUAL and GREATER_THAN operators. The value must
* be in the range [0 and 100000000].
*/
microPercent?: number;
/**
* The seed used when evaluating the hash function to map an instance to
* a value in the hash space. This is a string which can have 0 - 32
* characters and can contain ASCII characters [-_.0-9a-zA-Z].The string
* is case-sensitive.
*/
seed?: string;
/**
* The micro-percent interval to be used with the
* BETWEEN operator.
*/
microPercentRange?: MicroPercentRange;
}
/**
* Interface representing an explicit parameter value.

@@ -126,3 +259,3 @@ */

/**
* Interface representing a Remote Config template.
* Represents a Remote Config client template.
*/

@@ -159,2 +292,88 @@ export interface RemoteConfigTemplate {

/**
* Represents the data in a Remote Config server template.
*/
export interface ServerTemplateData {
/**
* A list of conditions in descending order by priority.
*/
conditions: NamedCondition[];
/**
* Map of parameter keys to their optional default values and optional conditional values.
*/
parameters: {
[key: string]: RemoteConfigParameter;
};
/**
* Current Remote Config template ETag (read-only).
*/
readonly etag: string;
/**
* Version information for the current Remote Config template.
*/
version?: Version;
}
/**
* Represents optional arguments that can be used when instantiating {@link ServerTemplate}.
*/
export interface GetServerTemplateOptions {
/**
* Defines in-app default parameter values, so that your app behaves as
* intended before it connects to the Remote Config backend, and so that
* default values are available if none are set on the backend.
*/
defaultConfig?: DefaultConfig;
}
/**
* Represents the type of a Remote Config server template that can be set on
* {@link ServerTemplate}. This can either be a {@link ServerTemplateData} object
* or a template JSON string.
*/
export type ServerTemplateDataType = ServerTemplateData | string;
/**
* Represents optional arguments that can be used when instantiating
* {@link ServerTemplate} synchronously.
*/
export interface InitServerTemplateOptions extends GetServerTemplateOptions {
/**
* Enables integrations to use template data loaded independently. For
* example, customers can reduce initialization latency by pre-fetching and
* caching template data and then using this option to initialize the SDK with
* that data.
*/
template?: ServerTemplateDataType;
}
/**
* Represents a stateful abstraction for a Remote Config server template.
*/
export interface ServerTemplate {
/**
* Evaluates the current template to produce a {@link ServerConfig}.
*/
evaluate(context?: EvaluationContext): ServerConfig;
/**
* Fetches and caches the current active version of the
* project's {@link ServerTemplate}.
*/
load(): Promise<void>;
/**
* Sets and caches a {@link ServerTemplateData} or a JSON string representing
* the server template
*/
set(template: ServerTemplateDataType): void;
/**
* Returns a JSON representation of {@link ServerTemplateData}
*/
toJSON(): ServerTemplateData;
}
/**
* Represents template evaluation input signals.
*/
export type EvaluationContext = {
/**
* Defines the identifier to use when splitting a group. For example,
* this is used by the percent condition.
*/
randomizationId?: string;
};
/**
* Interface representing a Remote Config user.

@@ -262,1 +481,90 @@ */

}
/**
* Represents the configuration produced by evaluating a server template.
*/
export interface ServerConfig {
/**
* Gets the value for the given key as a boolean.
*
* Convenience method for calling <code>serverConfig.getValue(key).asBoolean()</code>.
*
* @param key - The name of the parameter.
*
* @returns The value for the given key as a boolean.
*/
getBoolean(key: string): boolean;
/**
* Gets the value for the given key as a number.
*
* Convenience method for calling <code>serverConfig.getValue(key).asNumber()</code>.
*
* @param key - The name of the parameter.
*
* @returns The value for the given key as a number.
*/
getNumber(key: string): number;
/**
* Gets the value for the given key as a string.
* Convenience method for calling <code>serverConfig.getValue(key).asString()</code>.
*
* @param key - The name of the parameter.
*
* @returns The value for the given key as a string.
*/
getString(key: string): string;
/**
* Gets the {@link Value} for the given key.
*
* Ensures application logic will always have a type-safe reference,
* even if the parameter is removed remotely.
*
* @param key - The name of the parameter.
*
* @returns The value for the given key.
*/
getValue(key: string): Value;
}
/**
* Wraps a parameter value with metadata and type-safe getters.
*
* Type-safe getters insulate application logic from remote
* changes to parameter names and types.
*/
export interface Value {
/**
* Gets the value as a boolean.
*
* The following values (case insensitive) are interpreted as true:
* "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.
*/
asBoolean(): boolean;
/**
* Gets the value as a number. Comparable to calling <code>Number(value) || 0</code>.
*/
asNumber(): number;
/**
* Gets the value as a string.
*/
asString(): string;
/**
* Gets the {@link ValueSource} for the given key.
*/
getSource(): ValueSource;
}
/**
* Indicates the source of a value.
*
* <ul>
* <li>"static" indicates the value was defined by a static constant.</li>
* <li>"default" indicates the value was defined by default config.</li>
* <li>"remote" indicates the value was defined by config produced by
* evaluating a template.</li>
* </ul>
*/
export type ValueSource = 'static' | 'default' | 'remote';
/**
* Defines the format for in-app default parameter values.
*/
export type DefaultConfig = {
[key: string]: string | number | boolean;
};

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

@@ -19,1 +19,29 @@ /*!

Object.defineProperty(exports, "__esModule", { value: true });
exports.PercentConditionOperator = void 0;
/**
* Defines supported operators for percent conditions.
*/
var PercentConditionOperator;
(function (PercentConditionOperator) {
/**
* A catchall error case.
*/
PercentConditionOperator["UNKNOWN"] = "UNKNOWN";
/**
* Target percentiles less than or equal to the target percent.
* A condition using this operator must specify microPercent.
*/
PercentConditionOperator["LESS_OR_EQUAL"] = "LESS_OR_EQUAL";
/**
* Target percentiles greater than the target percent.
* A condition using this operator must specify microPercent.
*/
PercentConditionOperator["GREATER_THAN"] = "GREATER_THAN";
/**
* Target percentiles within an interval defined by a lower bound and an
* upper bound. The lower bound is an exclusive (open) bound and the
* micro_percent_range_upper_bound is an inclusive (closed) bound.
* A condition using this operator must specify microPercentRange.
*/
PercentConditionOperator["BETWEEN"] = "BETWEEN";
})(PercentConditionOperator || (exports.PercentConditionOperator = PercentConditionOperator = {}));

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

import { App } from '../app';
import { ListVersionsOptions, ListVersionsResult, RemoteConfigTemplate } from './remote-config-api';
import { ListVersionsOptions, ListVersionsResult, ServerTemplate, RemoteConfigTemplate, GetServerTemplateOptions, InitServerTemplateOptions } from './remote-config-api';
/**

@@ -95,2 +95,11 @@ * The Firebase `RemoteConfig` service interface.

createTemplateFromJSON(json: string): RemoteConfigTemplate;
/**
* Instantiates {@link ServerTemplate} and then fetches and caches the latest
* template version of the project.
*/
getServerTemplate(options?: GetServerTemplateOptions): Promise<ServerTemplate>;
/**
* Synchronously instantiates {@link ServerTemplate}.
*/
initServerTemplate(options?: InitServerTemplateOptions): ServerTemplate;
}

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

@@ -22,2 +22,4 @@ /*!

const remote_config_api_client_internal_1 = require("./remote-config-api-client-internal");
const condition_evaluator_internal_1 = require("./condition-evaluator-internal");
const value_impl_1 = require("./internal/value-impl");
/**

@@ -148,2 +150,21 @@ * The Firebase `RemoteConfig` service interface.

}
/**
* Instantiates {@link ServerTemplate} and then fetches and caches the latest
* template version of the project.
*/
async getServerTemplate(options) {
const template = this.initServerTemplate(options);
await template.load();
return template;
}
/**
* Synchronously instantiates {@link ServerTemplate}.
*/
initServerTemplate(options) {
const template = new ServerTemplateImpl(this.client, new condition_evaluator_internal_1.ConditionEvaluator(), options?.defaultConfig);
if (options?.template) {
template.set(options?.template);
}
return template;
}
}

@@ -216,2 +237,156 @@ exports.RemoteConfig = RemoteConfig;

/**
* Remote Config dataplane template data implementation.
*/
class ServerTemplateImpl {
constructor(apiClient, conditionEvaluator, defaultConfig = {}) {
this.apiClient = apiClient;
this.conditionEvaluator = conditionEvaluator;
this.defaultConfig = defaultConfig;
this.stringifiedDefaultConfig = {};
// RC stores all remote values as string, but it's more intuitive
// to declare default values with specific types, so this converts
// the external declaration to an internal string representation.
for (const key in defaultConfig) {
this.stringifiedDefaultConfig[key] = String(defaultConfig[key]);
}
}
/**
* Fetches and caches the current active version of the project's {@link ServerTemplate}.
*/
load() {
return this.apiClient.getServerTemplate()
.then((template) => {
this.cache = new ServerTemplateDataImpl(template);
});
}
/**
* Parses a {@link ServerTemplateDataType} and caches it.
*/
set(template) {
let parsed;
if (validator.isString(template)) {
try {
parsed = JSON.parse(template);
}
catch (e) {
// Transforms JSON parse errors to Firebase error.
throw new remote_config_api_client_internal_1.FirebaseRemoteConfigError('invalid-argument', `Failed to parse the JSON string: ${template}. ` + e);
}
}
else {
parsed = template;
}
// Throws template parse errors.
this.cache = new ServerTemplateDataImpl(parsed);
}
/**
* Evaluates the current template in cache to produce a {@link ServerConfig}.
*/
evaluate(context = {}) {
if (!this.cache) {
// This is the only place we should throw during evaluation, since it's under the
// control of application logic. To preserve forward-compatibility, we should only
// return false in cases where the SDK is unsure how to evaluate the fetched template.
throw new remote_config_api_client_internal_1.FirebaseRemoteConfigError('failed-precondition', 'No Remote Config Server template in cache. Call load() before calling evaluate().');
}
const evaluatedConditions = this.conditionEvaluator.evaluateConditions(this.cache.conditions, context);
const configValues = {};
// Initializes config Value objects with default values.
for (const key in this.stringifiedDefaultConfig) {
configValues[key] = new value_impl_1.ValueImpl('default', this.stringifiedDefaultConfig[key]);
}
// Overlays config Value objects derived by evaluating the template.
for (const [key, parameter] of Object.entries(this.cache.parameters)) {
const { conditionalValues, defaultValue } = parameter;
// Supports parameters with no conditional values.
const normalizedConditionalValues = conditionalValues || {};
let parameterValueWrapper = undefined;
// Iterates in order over condition list. If there is a value associated
// with a condition, this checks if the condition is true.
for (const [conditionName, conditionEvaluation] of evaluatedConditions) {
if (normalizedConditionalValues[conditionName] && conditionEvaluation) {
parameterValueWrapper = normalizedConditionalValues[conditionName];
break;
}
}
if (parameterValueWrapper && parameterValueWrapper.useInAppDefault) {
// TODO: add logging once we have a wrapped logger.
continue;
}
if (parameterValueWrapper) {
const parameterValue = parameterValueWrapper.value;
configValues[key] = new value_impl_1.ValueImpl('remote', parameterValue);
continue;
}
if (!defaultValue) {
// TODO: add logging once we have a wrapped logger.
continue;
}
if (defaultValue.useInAppDefault) {
// TODO: add logging once we have a wrapped logger.
continue;
}
const parameterDefaultValue = defaultValue.value;
configValues[key] = new value_impl_1.ValueImpl('remote', parameterDefaultValue);
}
return new ServerConfigImpl(configValues);
}
/**
* @returns JSON representation of the server template
*/
toJSON() {
return this.cache;
}
}
class ServerConfigImpl {
constructor(configValues) {
this.configValues = configValues;
}
getBoolean(key) {
return this.getValue(key).asBoolean();
}
getNumber(key) {
return this.getValue(key).asNumber();
}
getString(key) {
return this.getValue(key).asString();
}
getValue(key) {
return this.configValues[key] || new value_impl_1.ValueImpl('static');
}
}
/**
* Remote Config dataplane template data implementation.
*/
class ServerTemplateDataImpl {
constructor(template) {
if (!validator.isNonNullObject(template) ||
!validator.isNonEmptyString(template.etag)) {
throw new remote_config_api_client_internal_1.FirebaseRemoteConfigError('invalid-argument', `Invalid Remote Config template: ${JSON.stringify(template)}`);
}
this.etag = template.etag;
if (typeof template.parameters !== 'undefined') {
if (!validator.isNonNullObject(template.parameters)) {
throw new remote_config_api_client_internal_1.FirebaseRemoteConfigError('invalid-argument', 'Remote Config parameters must be a non-null object');
}
this.parameters = template.parameters;
}
else {
this.parameters = {};
}
if (typeof template.conditions !== 'undefined') {
if (!validator.isArray(template.conditions)) {
throw new remote_config_api_client_internal_1.FirebaseRemoteConfigError('invalid-argument', 'Remote Config conditions must be an array');
}
this.conditions = template.conditions;
}
else {
this.conditions = [];
}
if (typeof template.version !== 'undefined') {
this.version = new VersionImpl(template.version);
}
}
}
/**
* Remote Config Version internal implementation.

@@ -218,0 +393,0 @@ */

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
import { File } from '@google-cloud/storage';

@@ -3,0 +3,0 @@ export interface FirebaseMetadata {

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
/*!

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

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

/*! firebase-admin v12.0.0 */
/*! firebase-admin v12.1.0 */
"use strict";

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

{
"name": "firebase-admin",
"version": "12.0.0",
"version": "12.1.0",
"description": "Firebase admin SDK for Node.js",

@@ -199,8 +199,10 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",

"dependencies": {
"@fastify/busboy": "^1.2.1",
"@fastify/busboy": "^2.1.0",
"@firebase/database-compat": "^1.0.2",
"@firebase/database-types": "^1.0.0",
"@types/node": "^20.10.3",
"farmhash": "^3.3.0",
"jsonwebtoken": "^9.0.0",
"jwks-rsa": "^3.0.1",
"long": "^5.2.3",
"node-forge": "^1.3.1",

@@ -214,3 +216,3 @@ "uuid": "^9.0.0"

"devDependencies": {
"@firebase/api-documenter": "^0.3.0",
"@firebase/api-documenter": "^0.4.0",
"@firebase/app-compat": "^0.2.1",

@@ -245,3 +247,3 @@ "@firebase/auth-compat": "^0.4.1",

"firebase-token-generator": "^2.0.0",
"gulp": "^4.0.2",
"gulp": "^5.0.0",
"gulp-filter": "^7.0.0",

@@ -248,0 +250,0 @@ "gulp-header": "^2.0.9",

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