firebase-admin 12.7.0 → 13.0.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/README.md +1 -2
- package/lib/app/core.d.ts +1 -2
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +1 -2
- package/lib/app/credential-factory.js +5 -6
- package/lib/app/credential-internal.d.ts +37 -35
- package/lib/app/credential-internal.js +194 -294
- 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 +6 -6
- 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 +3 -3
- package/lib/app-check/token-generator.d.ts +1 -1
- package/lib/app-check/token-generator.js +3 -3
- 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 +3 -4
- package/lib/auth/auth-config.d.ts +1 -1
- package/lib/auth/auth-config.js +3 -3
- 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 +3 -3
- package/lib/auth/identifier.d.ts +1 -1
- package/lib/auth/identifier.js +5 -6
- package/lib/auth/index.d.ts +1 -1
- package/lib/auth/index.js +3 -3
- 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 -2
- package/lib/auth/token-generator.js +3 -3
- package/lib/auth/token-verifier.d.ts +1 -1
- package/lib/auth/token-verifier.js +5 -5
- package/lib/auth/user-import-builder.d.ts +1 -2
- package/lib/auth/user-import-builder.js +3 -3
- 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 +3 -3
- package/lib/database/database-namespace.d.ts +1 -1
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +1 -2
- package/lib/database/database.js +1 -1
- package/lib/database/index.d.ts +1 -1
- package/lib/database/index.js +4 -4
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +4 -4
- package/lib/functions/functions-api-client-internal.d.ts +1 -1
- package/lib/functions/functions-api-client-internal.js +3 -2
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- 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 +3 -3
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +3 -3
- 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 +2 -2
- package/lib/messaging/index.js +3 -3
- package/lib/messaging/messaging-api-request-internal.d.ts +2 -12
- package/lib/messaging/messaging-api-request-internal.js +4 -40
- package/lib/messaging/messaging-api.d.ts +8 -94
- 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 +3 -4
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +4 -3
- package/lib/messaging/messaging-namespace.d.ts +2 -22
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +3 -149
- package/lib/messaging/messaging.js +2 -539
- 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 +3 -3
- 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 +3 -3
- 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 +6 -14
- package/lib/remote-config/index.d.ts +1 -1
- package/lib/remote-config/index.js +3 -3
- 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 +3 -3
- 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 -2
- package/lib/security-rules/security-rules.js +1 -1
- package/lib/storage/index.d.ts +1 -1
- package/lib/storage/index.js +4 -4
- 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 +2 -3
- package/lib/utils/api-request.d.ts +1 -5
- package/lib/utils/api-request.js +23 -8
- package/lib/utils/crypto-signer.d.ts +1 -2
- package/lib/utils/crypto-signer.js +3 -3
- package/lib/utils/deep-copy.d.ts +1 -1
- package/lib/utils/deep-copy.js +3 -4
- package/lib/utils/error.d.ts +1 -1
- package/lib/utils/error.js +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +19 -16
- package/lib/utils/jwt.d.ts +1 -2
- package/lib/utils/jwt.js +5 -5
- package/lib/utils/validator.d.ts +1 -2
- package/lib/utils/validator.js +20 -21
- package/package.json +14 -13
- package/CHANGELOG.md +0 -4
- package/lib/messaging/batch-request-internal.d.ts +0 -55
- package/lib/messaging/batch-request-internal.js +0 -127
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ProjectManagementRequestHandler =
|
|
19
|
+
exports.ProjectManagementRequestHandler = void 0;
|
|
20
|
+
exports.assertServerResponse = assertServerResponse;
|
|
20
21
|
const api_request_1 = require("../utils/api-request");
|
|
21
22
|
const error_1 = require("../utils/error");
|
|
22
23
|
const index_1 = require("../utils/index");
|
|
@@ -43,7 +44,6 @@ function assertServerResponse(condition, responseData, message) {
|
|
|
43
44
|
throw new error_1.FirebaseProjectManagementError('invalid-server-response', `${message} Response data: ${JSON.stringify(responseData, null, 2)}`);
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
|
-
exports.assertServerResponse = assertServerResponse;
|
|
47
47
|
/**
|
|
48
48
|
* Class that provides mechanism to send requests to the Firebase project management backend
|
|
49
49
|
* endpoints.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2024 Google Inc.
|
|
4
4
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.ConditionEvaluator = void 0;
|
|
20
20
|
const remote_config_api_1 = require("./remote-config-api");
|
|
21
|
-
const
|
|
21
|
+
const crypto_1 = require("crypto");
|
|
22
22
|
/**
|
|
23
23
|
* Encapsulates condition evaluation logic to simplify organization and
|
|
24
24
|
* facilitate testing.
|
|
@@ -104,8 +104,8 @@ class ConditionEvaluator {
|
|
|
104
104
|
const normalizedMicroPercentLowerBound = microPercentRange?.microPercentLowerBound || 0;
|
|
105
105
|
const seedPrefix = seed && seed.length > 0 ? `${seed}.` : '';
|
|
106
106
|
const stringToHash = `${seedPrefix}${context.randomizationId}`;
|
|
107
|
-
const
|
|
108
|
-
const instanceMicroPercentile =
|
|
107
|
+
const hash = ConditionEvaluator.hashSeededRandomizationId(stringToHash);
|
|
108
|
+
const instanceMicroPercentile = hash % BigInt(100 * 1000000);
|
|
109
109
|
switch (percentOperator) {
|
|
110
110
|
case remote_config_api_1.PercentConditionOperator.LESS_OR_EQUAL:
|
|
111
111
|
return instanceMicroPercentile <= normalizedMicroPercent;
|
|
@@ -122,16 +122,8 @@ class ConditionEvaluator {
|
|
|
122
122
|
return false;
|
|
123
123
|
}
|
|
124
124
|
static hashSeededRandomizationId(seededRandomizationId) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// as a signed value.
|
|
128
|
-
let hash64 = BigInt.asIntN(64, farmhash.fingerprint64(seededRandomizationId));
|
|
129
|
-
// Manually negate the hash if its value is less than 0, since Math.abs doesn't
|
|
130
|
-
// support BigInt.
|
|
131
|
-
if (hash64 < 0) {
|
|
132
|
-
hash64 = -hash64;
|
|
133
|
-
}
|
|
134
|
-
return hash64;
|
|
125
|
+
const hex = (0, crypto_1.createHash)('sha256').update(seededRandomizationId).digest('hex');
|
|
126
|
+
return BigInt(`0x${hex}`);
|
|
135
127
|
}
|
|
136
128
|
evaluateCustomSignalCondition(customSignalCondition, context) {
|
|
137
129
|
const { customSignalOperator, customSignalKey, targetCustomSignalValues, } = customSignalCondition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.RemoteConfig = exports.PercentConditionOperator = exports.CustomSignalOperator = void 0;
|
|
20
|
+
exports.getRemoteConfig = getRemoteConfig;
|
|
20
21
|
/**
|
|
21
22
|
* Firebase Remote Config.
|
|
22
23
|
*
|
|
@@ -62,4 +63,3 @@ function getRemoteConfig(app) {
|
|
|
62
63
|
const firebaseApp = app;
|
|
63
64
|
return firebaseApp.getOrInitService('remoteConfig', (app) => new remote_config_1.RemoteConfig(app));
|
|
64
65
|
}
|
|
65
|
-
exports.getRemoteConfig = getRemoteConfig;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.SecurityRules = exports.RulesetMetadataList = exports.Ruleset = void 0;
|
|
20
|
+
exports.getSecurityRules = getSecurityRules;
|
|
20
21
|
/**
|
|
21
22
|
* Security Rules for Cloud Firestore and Cloud Storage.
|
|
22
23
|
*
|
|
@@ -60,4 +61,3 @@ function getSecurityRules(app) {
|
|
|
60
61
|
const firebaseApp = app;
|
|
61
62
|
return firebaseApp.getOrInitService('securityRules', (app) => new security_rules_1.SecurityRules(app));
|
|
62
63
|
}
|
|
63
|
-
exports.getSecurityRules = getSecurityRules;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2019 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
/// <reference types="node" />
|
|
18
17
|
import { App } from '../app';
|
|
19
18
|
/**
|
|
20
19
|
* A source file containing some Firebase security rules. The content includes raw
|
package/lib/storage/index.d.ts
CHANGED
package/lib/storage/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.Storage = void 0;
|
|
20
|
+
exports.getStorage = getStorage;
|
|
21
|
+
exports.getDownloadURL = getDownloadURL;
|
|
20
22
|
const app_1 = require("../app");
|
|
21
23
|
const storage_1 = require("./storage");
|
|
22
24
|
const error_1 = require("../utils/error");
|
|
@@ -49,7 +51,6 @@ function getStorage(app) {
|
|
|
49
51
|
const firebaseApp = app;
|
|
50
52
|
return firebaseApp.getOrInitService('storage', (app) => new storage_1.Storage(app));
|
|
51
53
|
}
|
|
52
|
-
exports.getStorage = getStorage;
|
|
53
54
|
/**
|
|
54
55
|
* Gets the download URL for the given {@link https://cloud.google.com/nodejs/docs/reference/storage/latest/storage/file | File}.
|
|
55
56
|
*
|
|
@@ -74,4 +75,3 @@ async function getDownloadURL(file) {
|
|
|
74
75
|
const [token] = downloadTokens.split(',');
|
|
75
76
|
return `${endpoint}/b/${file.bucket.name}/o/${encodeURIComponent(file.name)}?alt=media&token=${token}`;
|
|
76
77
|
}
|
|
77
|
-
exports.getDownloadURL = getDownloadURL;
|
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,7 +1,7 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getFirebaseMetadata =
|
|
4
|
+
exports.getFirebaseMetadata = getFirebaseMetadata;
|
|
5
5
|
function getFirebaseMetadata(endpoint, file) {
|
|
6
6
|
const uri = `${endpoint}/b/${file.bucket.name}/o/${encodeURIComponent(file.name)}`;
|
|
7
7
|
return new Promise((resolve, reject) => {
|
|
@@ -18,4 +18,3 @@ function getFirebaseMetadata(endpoint, file) {
|
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
exports.getFirebaseMetadata = getFirebaseMetadata;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
/// <reference types="node" />
|
|
19
|
-
/// <reference types="node" />
|
|
20
|
-
/// <reference types="node" />
|
|
21
|
-
/// <reference types="node" />
|
|
22
18
|
import { FirebaseApp } from '../app/firebase-app';
|
|
23
19
|
import http = require('http');
|
|
24
20
|
import http2 = require('http2');
|
package/lib/utils/api-request.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Http2SessionHandler = exports.ExponentialBackoffPoller = exports.ApiSettings = exports.AuthorizedHttp2Client = exports.AuthorizedHttpClient = exports.
|
|
20
|
+
exports.Http2SessionHandler = exports.ExponentialBackoffPoller = exports.ApiSettings = exports.AuthorizedHttp2Client = exports.AuthorizedHttpClient = exports.Http2Client = exports.HttpClient = exports.RequestClient = exports.RequestResponseError = void 0;
|
|
21
|
+
exports.defaultRetryConfig = defaultRetryConfig;
|
|
22
|
+
exports.parseHttpResponse = parseHttpResponse;
|
|
21
23
|
const error_1 = require("./error");
|
|
22
24
|
const validator = require("./validator");
|
|
23
25
|
const http = require("http");
|
|
@@ -25,6 +27,8 @@ const https = require("https");
|
|
|
25
27
|
const http2 = require("http2");
|
|
26
28
|
const url = require("url");
|
|
27
29
|
const events_1 = require("events");
|
|
30
|
+
const credential_internal_1 = require("../app/credential-internal");
|
|
31
|
+
const index_1 = require("../utils/index");
|
|
28
32
|
class DefaultRequestResponse {
|
|
29
33
|
/**
|
|
30
34
|
* Constructs a new `RequestResponse` from the given `LowLevelResponse`.
|
|
@@ -101,7 +105,6 @@ function defaultRetryConfig() {
|
|
|
101
105
|
maxDelayInMillis: 60 * 1000,
|
|
102
106
|
};
|
|
103
107
|
}
|
|
104
|
-
exports.defaultRetryConfig = defaultRetryConfig;
|
|
105
108
|
/**
|
|
106
109
|
* Ensures that the given `RetryConfig` object is valid.
|
|
107
110
|
*
|
|
@@ -360,7 +363,6 @@ function parseHttpResponse(response, config) {
|
|
|
360
363
|
}
|
|
361
364
|
return new DefaultRequestResponse(lowLevelResponse);
|
|
362
365
|
}
|
|
363
|
-
exports.parseHttpResponse = parseHttpResponse;
|
|
364
366
|
/**
|
|
365
367
|
* A helper class for common functionality needed to send requests over the wire.
|
|
366
368
|
* It also wraps the callback API of the Node.js standard library in a more flexible Promise API.
|
|
@@ -792,14 +794,18 @@ class AuthorizedHttpClient extends HttpClient {
|
|
|
792
794
|
requestCopy.headers = Object.assign({}, request.headers);
|
|
793
795
|
const authHeader = 'Authorization';
|
|
794
796
|
requestCopy.headers[authHeader] = `Bearer ${token}`;
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
797
|
+
let quotaProjectId;
|
|
798
|
+
if (this.app.options.credential instanceof credential_internal_1.ApplicationDefaultCredential) {
|
|
799
|
+
quotaProjectId = this.app.options.credential.getQuotaProjectId();
|
|
800
|
+
}
|
|
801
|
+
quotaProjectId = process.env.GOOGLE_CLOUD_QUOTA_PROJECT || quotaProjectId;
|
|
802
|
+
if (!requestCopy.headers['x-goog-user-project'] && validator.isNonEmptyString(quotaProjectId)) {
|
|
803
|
+
requestCopy.headers['x-goog-user-project'] = quotaProjectId;
|
|
799
804
|
}
|
|
800
805
|
if (!requestCopy.httpAgent && this.app.options.httpAgent) {
|
|
801
806
|
requestCopy.httpAgent = this.app.options.httpAgent;
|
|
802
807
|
}
|
|
808
|
+
requestCopy.headers['X-Goog-Api-Client'] = (0, index_1.getMetricsHeader)();
|
|
803
809
|
return super.send(requestCopy);
|
|
804
810
|
});
|
|
805
811
|
}
|
|
@@ -820,6 +826,15 @@ class AuthorizedHttp2Client extends Http2Client {
|
|
|
820
826
|
requestCopy.headers = Object.assign({}, request.headers);
|
|
821
827
|
const authHeader = 'Authorization';
|
|
822
828
|
requestCopy.headers[authHeader] = `Bearer ${token}`;
|
|
829
|
+
let quotaProjectId;
|
|
830
|
+
if (this.app.options.credential instanceof credential_internal_1.ApplicationDefaultCredential) {
|
|
831
|
+
quotaProjectId = this.app.options.credential.getQuotaProjectId();
|
|
832
|
+
}
|
|
833
|
+
quotaProjectId = process.env.GOOGLE_CLOUD_QUOTA_PROJECT || quotaProjectId;
|
|
834
|
+
if (!requestCopy.headers['x-goog-user-project'] && validator.isNonEmptyString(quotaProjectId)) {
|
|
835
|
+
requestCopy.headers['x-goog-user-project'] = quotaProjectId;
|
|
836
|
+
}
|
|
837
|
+
requestCopy.headers['X-Goog-Api-Client'] = (0, index_1.getMetricsHeader)();
|
|
823
838
|
return super.send(requestCopy);
|
|
824
839
|
});
|
|
825
840
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google Inc.
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
/// <reference types="node" />
|
|
19
18
|
import { App } from '../app';
|
|
20
19
|
import { ServiceAccountCredential } from '../app/credential-internal';
|
|
21
20
|
import { AuthorizedHttpClient } from './api-request';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.CryptoSignerErrorCode = exports.CryptoSignerError = exports.
|
|
20
|
+
exports.CryptoSignerErrorCode = exports.CryptoSignerError = exports.IAMSigner = exports.ServiceAccountSigner = void 0;
|
|
21
|
+
exports.cryptoSignerFromApp = cryptoSignerFromApp;
|
|
21
22
|
const credential_internal_1 = require("../app/credential-internal");
|
|
22
23
|
const api_request_1 = require("./api-request");
|
|
23
24
|
const validator = require("../utils/validator");
|
|
@@ -159,7 +160,6 @@ function cryptoSignerFromApp(app) {
|
|
|
159
160
|
}
|
|
160
161
|
return new IAMSigner(new api_request_1.AuthorizedHttpClient(app), app.options.serviceAccountId);
|
|
161
162
|
}
|
|
162
|
-
exports.cryptoSignerFromApp = cryptoSignerFromApp;
|
|
163
163
|
/**
|
|
164
164
|
* CryptoSigner error code structure.
|
|
165
165
|
*
|
package/lib/utils/deep-copy.d.ts
CHANGED
package/lib/utils/deep-copy.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
20
|
+
exports.deepCopy = deepCopy;
|
|
21
|
+
exports.deepExtend = deepExtend;
|
|
21
22
|
/**
|
|
22
23
|
* Returns a deep copy of an object or array.
|
|
23
24
|
*
|
|
@@ -27,7 +28,6 @@ exports.deepExtend = exports.deepCopy = void 0;
|
|
|
27
28
|
function deepCopy(value) {
|
|
28
29
|
return deepExtend(undefined, value);
|
|
29
30
|
}
|
|
30
|
-
exports.deepCopy = deepCopy;
|
|
31
31
|
/**
|
|
32
32
|
* Copies properties from source to target (recursively allows extension of objects and arrays).
|
|
33
33
|
* Scalar values in the target are over-written. If target is undefined, an object of the
|
|
@@ -75,4 +75,3 @@ function deepExtend(target, source) {
|
|
|
75
75
|
}
|
|
76
76
|
return target;
|
|
77
77
|
}
|
|
78
|
-
exports.deepExtend = deepExtend;
|
package/lib/utils/error.d.ts
CHANGED
package/lib/utils/error.js
CHANGED
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v13.0.0 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
/// <reference types="node" />
|
|
19
18
|
import { App } from '../app/index';
|
|
20
19
|
export declare function getSdkVersion(): string;
|
|
20
|
+
export declare function getMetricsHeader(): string;
|
|
21
21
|
/**
|
|
22
22
|
* Renames properties on an object given a mapping from old to new property names.
|
|
23
23
|
*
|