firebase-admin 13.2.0 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/core.d.ts +1 -1
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -1
- package/lib/app/credential-factory.js +1 -1
- package/lib/app/credential-internal.d.ts +1 -1
- package/lib/app/credential-internal.js +1 -1
- package/lib/app/credential.d.ts +1 -1
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +1 -1
- package/lib/app/firebase-app.js +1 -1
- package/lib/app/firebase-namespace.d.ts +1 -1
- package/lib/app/firebase-namespace.js +1 -1
- package/lib/app/index.d.ts +1 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +1 -1
- package/lib/app/lifecycle.js +1 -1
- package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
- package/lib/app-check/app-check-api-client-internal.js +1 -1
- package/lib/app-check/app-check-api.d.ts +1 -1
- package/lib/app-check/app-check-api.js +1 -1
- package/lib/app-check/app-check-namespace.d.ts +1 -1
- package/lib/app-check/app-check-namespace.js +1 -1
- package/lib/app-check/app-check.d.ts +1 -1
- package/lib/app-check/app-check.js +1 -1
- package/lib/app-check/index.d.ts +1 -1
- package/lib/app-check/index.js +1 -1
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +1 -1
- package/lib/app-check/token-verifier.d.ts +1 -1
- package/lib/app-check/token-verifier.js +1 -1
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +1 -1
- package/lib/auth/auth-api-request.d.ts +1 -1
- package/lib/auth/auth-api-request.js +1 -1
- package/lib/auth/auth-config.d.ts +1 -1
- package/lib/auth/auth-config.js +1 -1
- package/lib/auth/auth-namespace.d.ts +1 -1
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +1 -1
- package/lib/auth/auth.js +1 -1
- package/lib/auth/base-auth.d.ts +1 -1
- package/lib/auth/base-auth.js +1 -1
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +1 -1
- package/lib/auth/index.js +1 -1
- package/lib/auth/project-config-manager.d.ts +1 -1
- package/lib/auth/project-config-manager.js +1 -1
- package/lib/auth/project-config.d.ts +1 -1
- package/lib/auth/project-config.js +1 -1
- package/lib/auth/tenant-manager.d.ts +1 -1
- package/lib/auth/tenant-manager.js +1 -1
- package/lib/auth/tenant.d.ts +1 -1
- package/lib/auth/tenant.js +1 -1
- package/lib/auth/token-generator.d.ts +1 -1
- package/lib/auth/token-generator.js +1 -1
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +1 -1
- package/lib/auth/user-import-builder.d.ts +1 -1
- package/lib/auth/user-import-builder.js +1 -1
- package/lib/auth/user-record.d.ts +1 -1
- package/lib/auth/user-record.js +1 -1
- package/lib/credential/index.d.ts +1 -1
- package/lib/credential/index.js +1 -1
- package/lib/data-connect/data-connect-api-client-internal.d.ts +1 -1
- package/lib/data-connect/data-connect-api-client-internal.js +1 -1
- package/lib/data-connect/data-connect-api.d.ts +1 -1
- package/lib/data-connect/data-connect-api.js +1 -1
- package/lib/data-connect/data-connect.d.ts +1 -1
- package/lib/data-connect/data-connect.js +1 -1
- package/lib/data-connect/index.d.ts +1 -1
- package/lib/data-connect/index.js +1 -1
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -1
- package/lib/database/database.js +1 -1
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +1 -1
- package/lib/default-namespace.d.ts +1 -1
- package/lib/default-namespace.js +1 -1
- package/lib/eventarc/cloudevent.d.ts +1 -1
- package/lib/eventarc/cloudevent.js +1 -1
- package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
- package/lib/eventarc/eventarc-client-internal.js +1 -1
- package/lib/eventarc/eventarc-utils.d.ts +1 -1
- package/lib/eventarc/eventarc-utils.js +1 -1
- package/lib/eventarc/eventarc.d.ts +1 -1
- package/lib/eventarc/eventarc.js +1 -1
- package/lib/eventarc/index.d.ts +1 -1
- package/lib/eventarc/index.js +1 -1
- package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
- package/lib/extensions/extensions-api-client-internal.js +1 -1
- package/lib/extensions/extensions-api.d.ts +1 -1
- package/lib/extensions/extensions-api.js +1 -1
- package/lib/extensions/extensions.d.ts +1 -1
- package/lib/extensions/extensions.js +1 -1
- package/lib/extensions/index.d.ts +1 -1
- package/lib/extensions/index.js +1 -1
- package/lib/firebase-namespace-api.d.ts +1 -1
- package/lib/firebase-namespace-api.js +1 -1
- package/lib/firestore/firestore-internal.d.ts +1 -1
- package/lib/firestore/firestore-internal.js +1 -1
- package/lib/firestore/firestore-namespace.d.ts +1 -1
- package/lib/firestore/firestore-namespace.js +1 -1
- package/lib/firestore/index.d.ts +1 -1
- package/lib/firestore/index.js +1 -1
- package/lib/functions/functions-api-client-internal.d.ts +1 -1
- package/lib/functions/functions-api-client-internal.js +1 -1
- package/lib/functions/functions-api.d.ts +1 -1
- package/lib/functions/functions-api.js +1 -1
- package/lib/functions/functions.d.ts +1 -1
- package/lib/functions/functions.js +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +1 -1
- package/lib/installations/index.js +1 -1
- package/lib/installations/installations-namespace.d.ts +1 -1
- package/lib/installations/installations-namespace.js +1 -1
- package/lib/installations/installations-request-handler.d.ts +1 -1
- package/lib/installations/installations-request-handler.js +1 -1
- package/lib/installations/installations.d.ts +1 -1
- package/lib/installations/installations.js +1 -1
- package/lib/instance-id/index.d.ts +1 -1
- package/lib/instance-id/index.js +1 -1
- package/lib/instance-id/instance-id-namespace.d.ts +1 -1
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +1 -1
- package/lib/instance-id/instance-id.js +1 -1
- package/lib/machine-learning/index.d.ts +1 -1
- package/lib/machine-learning/index.js +1 -1
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +1 -1
- package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
- package/lib/machine-learning/machine-learning-namespace.js +1 -1
- package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
- package/lib/machine-learning/machine-learning-utils.js +1 -1
- package/lib/machine-learning/machine-learning.d.ts +1 -1
- package/lib/machine-learning/machine-learning.js +1 -1
- package/lib/messaging/index.d.ts +1 -1
- package/lib/messaging/index.js +1 -1
- package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
- package/lib/messaging/messaging-api-request-internal.js +1 -1
- package/lib/messaging/messaging-api.d.ts +9 -2
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +1 -1
- package/lib/messaging/messaging-errors-internal.js +1 -1
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +5 -1
- package/lib/messaging/messaging-namespace.d.ts +1 -1
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +2 -1
- package/lib/messaging/messaging.js +52 -32
- package/lib/project-management/android-app.d.ts +1 -1
- package/lib/project-management/android-app.js +1 -1
- package/lib/project-management/app-metadata.d.ts +1 -1
- package/lib/project-management/app-metadata.js +1 -1
- package/lib/project-management/index.d.ts +1 -1
- package/lib/project-management/index.js +1 -1
- package/lib/project-management/ios-app.d.ts +1 -1
- package/lib/project-management/ios-app.js +1 -1
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
- package/lib/project-management/project-management-api-request-internal.js +1 -1
- package/lib/project-management/project-management-namespace.d.ts +1 -1
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +1 -1
- package/lib/project-management/project-management.js +1 -1
- package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
- package/lib/remote-config/condition-evaluator-internal.js +1 -1
- package/lib/remote-config/index.d.ts +1 -1
- package/lib/remote-config/index.js +1 -1
- package/lib/remote-config/internal/value-impl.d.ts +1 -1
- package/lib/remote-config/internal/value-impl.js +1 -1
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +1 -1
- package/lib/remote-config/remote-config-api.d.ts +1 -1
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +1 -1
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +1 -1
- package/lib/remote-config/remote-config.js +1 -1
- package/lib/security-rules/index.d.ts +1 -1
- package/lib/security-rules/index.js +1 -1
- package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-api-client-internal.js +1 -1
- package/lib/security-rules/security-rules-internal.d.ts +1 -1
- package/lib/security-rules/security-rules-internal.js +1 -1
- package/lib/security-rules/security-rules-namespace.d.ts +1 -1
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +1 -1
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +1 -1
- package/lib/storage/storage-namespace.d.ts +1 -1
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +1 -1
- package/lib/storage/storage.js +1 -1
- package/lib/storage/utils.d.ts +1 -1
- package/lib/storage/utils.js +1 -1
- package/lib/utils/api-request.d.ts +5 -1
- package/lib/utils/api-request.js +24 -4
- package/lib/utils/crypto-signer.d.ts +1 -1
- package/lib/utils/crypto-signer.js +1 -1
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +1 -1
- package/lib/utils/error.d.ts +7 -1
- package/lib/utils/error.js +31 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/jwt.d.ts +1 -1
- package/lib/utils/jwt.js +1 -1
- package/lib/utils/validator.d.ts +1 -1
- package/lib/utils/validator.js +1 -1
- package/package.json +1 -1
package/lib/storage/index.d.ts
CHANGED
package/lib/storage/index.js
CHANGED
package/lib/storage/storage.d.ts
CHANGED
package/lib/storage/storage.js
CHANGED
package/lib/storage/utils.d.ts
CHANGED
package/lib/storage/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v13.
|
|
1
|
+
/*! firebase-admin v13.3.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -311,8 +311,12 @@ export declare class ExponentialBackoffPoller<T> extends EventEmitter {
|
|
|
311
311
|
}
|
|
312
312
|
export declare class Http2SessionHandler {
|
|
313
313
|
private http2Session;
|
|
314
|
+
protected promise: Promise<void>;
|
|
315
|
+
protected resolve: () => void;
|
|
316
|
+
protected reject: (_: any) => void;
|
|
314
317
|
constructor(url: string);
|
|
315
318
|
createSession(url: string): http2.ClientHttp2Session;
|
|
319
|
+
invoke(): Promise<void>;
|
|
316
320
|
get session(): http2.ClientHttp2Session;
|
|
317
321
|
get isClosed(): boolean;
|
|
318
322
|
close(): void;
|
package/lib/utils/api-request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v13.
|
|
1
|
+
/*! firebase-admin v13.3.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -774,6 +774,7 @@ class Http2RequestConfigImpl extends BaseRequestConfigImpl {
|
|
|
774
774
|
}
|
|
775
775
|
buildRequestOptions() {
|
|
776
776
|
const parsed = this.buildUrl();
|
|
777
|
+
// TODO(b/401051826)
|
|
777
778
|
const protocol = parsed.protocol;
|
|
778
779
|
return {
|
|
779
780
|
protocol,
|
|
@@ -995,7 +996,11 @@ class ExponentialBackoffPoller extends events_1.EventEmitter {
|
|
|
995
996
|
exports.ExponentialBackoffPoller = ExponentialBackoffPoller;
|
|
996
997
|
class Http2SessionHandler {
|
|
997
998
|
constructor(url) {
|
|
998
|
-
this.
|
|
999
|
+
this.promise = new Promise((resolve, reject) => {
|
|
1000
|
+
this.resolve = resolve;
|
|
1001
|
+
this.reject = reject;
|
|
1002
|
+
this.http2Session = this.createSession(url);
|
|
1003
|
+
});
|
|
999
1004
|
}
|
|
1000
1005
|
createSession(url) {
|
|
1001
1006
|
if (!this.http2Session || this.isClosed) {
|
|
@@ -1006,15 +1011,30 @@ class Http2SessionHandler {
|
|
|
1006
1011
|
};
|
|
1007
1012
|
const http2Session = http2.connect(url, opts);
|
|
1008
1013
|
http2Session.on('goaway', (errorCode, _, opaqueData) => {
|
|
1009
|
-
|
|
1014
|
+
this.reject(new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, `Error while making requests: GOAWAY - ${opaqueData?.toString()}, Error code: ${errorCode}`));
|
|
1010
1015
|
});
|
|
1011
1016
|
http2Session.on('error', (error) => {
|
|
1012
|
-
|
|
1017
|
+
let errorMessage;
|
|
1018
|
+
if (error.name == 'AggregateError' && error.errors) {
|
|
1019
|
+
errorMessage = `Session error while making requests: ${error.code} - ${error.name}: ` +
|
|
1020
|
+
`[${error.errors.map((error) => error.message).join(', ')}]`;
|
|
1021
|
+
}
|
|
1022
|
+
else {
|
|
1023
|
+
errorMessage = `Session error while making requests: ${error.code} - ${error.message} `;
|
|
1024
|
+
}
|
|
1025
|
+
this.reject(new error_1.FirebaseAppError(error_1.AppErrorCodes.NETWORK_ERROR, errorMessage));
|
|
1026
|
+
});
|
|
1027
|
+
http2Session.on('close', () => {
|
|
1028
|
+
// Resolve current promise
|
|
1029
|
+
this.resolve();
|
|
1013
1030
|
});
|
|
1014
1031
|
return http2Session;
|
|
1015
1032
|
}
|
|
1016
1033
|
return this.http2Session;
|
|
1017
1034
|
}
|
|
1035
|
+
invoke() {
|
|
1036
|
+
return this.promise;
|
|
1037
|
+
}
|
|
1018
1038
|
get session() {
|
|
1019
1039
|
return this.http2Session;
|
|
1020
1040
|
}
|
package/lib/utils/deep-copy.d.ts
CHANGED
package/lib/utils/deep-copy.js
CHANGED
package/lib/utils/error.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v13.
|
|
1
|
+
/*! firebase-admin v13.3.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
import { FirebaseError as FirebaseErrorInterface } from '../app';
|
|
19
|
+
import { BatchResponse } from '../messaging/messaging-api';
|
|
19
20
|
/**
|
|
20
21
|
* Defines error info type. This includes a code and message string.
|
|
21
22
|
*/
|
|
@@ -84,6 +85,11 @@ export declare class FirebaseInstallationsError extends FirebaseError {
|
|
|
84
85
|
*/
|
|
85
86
|
export declare class FirebaseMessagingError extends PrefixedFirebaseError {
|
|
86
87
|
}
|
|
88
|
+
export declare class FirebaseMessagingSessionError extends FirebaseMessagingError {
|
|
89
|
+
pendingBatchResponse?: Promise<BatchResponse>;
|
|
90
|
+
/** @returns The object representation of the error. */
|
|
91
|
+
toJSON(): object;
|
|
92
|
+
}
|
|
87
93
|
/**
|
|
88
94
|
* Firebase project management error code structure. This extends PrefixedFirebaseError.
|
|
89
95
|
*/
|
package/lib/utils/error.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin v13.
|
|
1
|
+
/*! firebase-admin v13.3.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.InstanceIdClientErrorCode = exports.InstallationsClientErrorCode = exports.MessagingClientErrorCode = exports.AuthClientErrorCode = exports.AppErrorCodes = exports.FirebaseProjectManagementError = exports.FirebaseMessagingError = exports.FirebaseInstallationsError = exports.FirebaseInstanceIdError = exports.FirebaseFirestoreError = exports.FirebaseDatabaseError = exports.FirebaseAuthError = exports.FirebaseAppError = exports.PrefixedFirebaseError = exports.FirebaseError = void 0;
|
|
20
|
+
exports.InstanceIdClientErrorCode = exports.InstallationsClientErrorCode = exports.MessagingClientErrorCode = exports.AuthClientErrorCode = exports.AppErrorCodes = exports.FirebaseProjectManagementError = exports.FirebaseMessagingSessionError = exports.FirebaseMessagingError = exports.FirebaseInstallationsError = exports.FirebaseInstanceIdError = exports.FirebaseFirestoreError = exports.FirebaseDatabaseError = exports.FirebaseAuthError = exports.FirebaseAppError = exports.PrefixedFirebaseError = exports.FirebaseError = void 0;
|
|
21
21
|
const deep_copy_1 = require("../utils/deep-copy");
|
|
22
22
|
/**
|
|
23
23
|
* Firebase error code structure. This extends Error.
|
|
@@ -304,6 +304,35 @@ class FirebaseMessagingError extends PrefixedFirebaseError {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
exports.FirebaseMessagingError = FirebaseMessagingError;
|
|
307
|
+
class FirebaseMessagingSessionError extends FirebaseMessagingError {
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* @param info - The error code info.
|
|
311
|
+
* @param message - The error message. This will override the default message if provided.
|
|
312
|
+
* @param pendingBatchResponse - BatchResponse for pending messages when session error occured.
|
|
313
|
+
* @constructor
|
|
314
|
+
* @internal
|
|
315
|
+
*/
|
|
316
|
+
constructor(info, message, pendingBatchResponse) {
|
|
317
|
+
// Override default message if custom message provided.
|
|
318
|
+
super(info, message || info.message);
|
|
319
|
+
this.pendingBatchResponse = pendingBatchResponse;
|
|
320
|
+
/* tslint:disable:max-line-length */
|
|
321
|
+
// Set the prototype explicitly. See the following link for more details:
|
|
322
|
+
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
323
|
+
/* tslint:enable:max-line-length */
|
|
324
|
+
this.__proto__ = FirebaseMessagingSessionError.prototype;
|
|
325
|
+
}
|
|
326
|
+
/** @returns The object representation of the error. */
|
|
327
|
+
toJSON() {
|
|
328
|
+
return {
|
|
329
|
+
code: this.code,
|
|
330
|
+
message: this.message,
|
|
331
|
+
pendingBatchResponse: this.pendingBatchResponse,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
exports.FirebaseMessagingSessionError = FirebaseMessagingSessionError;
|
|
307
336
|
/**
|
|
308
337
|
* Firebase project management error code structure. This extends PrefixedFirebaseError.
|
|
309
338
|
*/
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/lib/utils/jwt.d.ts
CHANGED
package/lib/utils/jwt.js
CHANGED
package/lib/utils/validator.d.ts
CHANGED
package/lib/utils/validator.js
CHANGED