firebase-admin 9.100.0-alpha.0 → 10.0.2
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 +7 -3
- package/lib/app/core.d.ts +15 -22
- package/lib/app/core.js +1 -1
- package/lib/app/credential-factory.d.ts +17 -33
- package/lib/app/credential-factory.js +17 -33
- package/lib/app/credential-internal.d.ts +10 -9
- package/lib/app/credential-internal.js +15 -13
- package/lib/app/credential.d.ts +3 -9
- package/lib/app/credential.js +1 -1
- package/lib/app/firebase-app.d.ts +6 -30
- package/lib/app/firebase-app.js +72 -216
- package/lib/app/firebase-namespace.d.ts +28 -34
- package/lib/app/firebase-namespace.js +119 -99
- package/lib/app/index.d.ts +6 -1
- package/lib/app/index.js +1 -1
- package/lib/app/lifecycle.d.ts +24 -3
- package/lib/app/lifecycle.js +119 -25
- package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
- package/lib/app-check/app-check-api-client-internal.js +197 -0
- package/lib/app-check/app-check-api.d.ts +95 -0
- package/lib/app-check/app-check-api.js +19 -0
- package/lib/app-check/app-check-namespace.d.ts +65 -0
- package/lib/app-check/app-check-namespace.js +18 -0
- package/lib/app-check/app-check.d.ts +49 -0
- package/lib/app-check/app-check.js +82 -0
- package/lib/app-check/index.d.ts +53 -0
- package/lib/app-check/index.js +63 -0
- package/lib/app-check/token-generator.d.ts +25 -0
- package/lib/app-check/token-generator.js +159 -0
- package/lib/app-check/token-verifier.d.ts +17 -0
- package/lib/app-check/token-verifier.js +151 -0
- package/lib/auth/action-code-settings-builder.d.ts +1 -1
- package/lib/auth/action-code-settings-builder.js +2 -2
- package/lib/auth/auth-api-request.d.ts +28 -32
- package/lib/auth/auth-api-request.js +167 -125
- package/lib/auth/auth-config.d.ts +123 -21
- package/lib/auth/auth-config.js +85 -34
- package/lib/auth/auth-namespace.d.ts +157 -4
- package/lib/auth/auth-namespace.js +1 -1
- package/lib/auth/auth.d.ts +5 -3
- package/lib/auth/auth.js +6 -4
- package/lib/auth/base-auth.d.ts +134 -116
- package/lib/auth/base-auth.js +213 -143
- package/lib/auth/identifier.d.ts +5 -5
- package/lib/auth/identifier.js +1 -1
- package/lib/auth/index.d.ts +10 -5
- package/lib/auth/index.js +9 -4
- package/lib/auth/tenant-manager.d.ts +19 -19
- package/lib/auth/tenant-manager.js +21 -25
- package/lib/auth/tenant.d.ts +14 -5
- package/lib/auth/tenant.js +19 -11
- package/lib/auth/token-generator.d.ts +7 -108
- package/lib/auth/token-generator.js +52 -145
- package/lib/auth/token-verifier.d.ts +3 -4
- package/lib/auth/token-verifier.js +96 -145
- package/lib/auth/user-import-builder.d.ts +11 -11
- package/lib/auth/user-import-builder.js +9 -9
- package/lib/auth/user-record.d.ts +23 -15
- package/lib/auth/user-record.js +30 -20
- package/lib/credential/index.d.ts +18 -35
- package/lib/credential/index.js +17 -33
- package/lib/database/database-namespace.d.ts +39 -10
- package/lib/database/database-namespace.js +1 -1
- package/lib/database/database.d.ts +16 -6
- package/lib/database/database.js +61 -6
- package/lib/database/index.d.ts +19 -18
- package/lib/database/index.js +21 -23
- package/lib/default-namespace.d.ts +7 -1
- package/lib/default-namespace.js +4 -4
- package/lib/esm/app/index.js +10 -0
- package/lib/esm/app-check/index.js +4 -0
- package/lib/esm/auth/index.js +14 -0
- package/lib/esm/database/index.js +6 -0
- package/lib/esm/firestore/index.js +24 -0
- package/lib/esm/installations/index.js +4 -0
- package/lib/esm/instance-id/index.js +4 -0
- package/lib/esm/machine-learning/index.js +5 -0
- package/lib/esm/messaging/index.js +4 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/project-management/index.js +8 -0
- package/lib/esm/remote-config/index.js +4 -0
- package/lib/esm/security-rules/index.js +6 -0
- package/lib/esm/storage/index.js +4 -0
- package/lib/firebase-namespace-api.d.ts +12 -6
- package/lib/firebase-namespace-api.js +5 -1
- package/lib/firestore/firestore-internal.d.ts +2 -2
- package/lib/firestore/firestore-internal.js +2 -2
- package/lib/firestore/firestore-namespace.d.ts +6 -1
- package/lib/firestore/firestore-namespace.js +2 -1
- package/lib/firestore/index.d.ts +36 -4
- package/lib/firestore/index.js +29 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/installations/index.d.ts +52 -0
- package/lib/installations/index.js +62 -0
- package/lib/installations/installations-namespace.d.ts +55 -0
- package/lib/installations/installations-namespace.js +18 -0
- package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
- package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
- package/lib/installations/installations.d.ts +38 -0
- package/lib/installations/installations.js +63 -0
- package/lib/instance-id/index.d.ts +20 -9
- package/lib/instance-id/index.js +20 -9
- package/lib/instance-id/instance-id-namespace.d.ts +9 -8
- package/lib/instance-id/instance-id-namespace.js +1 -1
- package/lib/instance-id/instance-id.d.ts +8 -6
- package/lib/instance-id/instance-id.js +20 -11
- package/lib/machine-learning/index.d.ts +29 -27
- package/lib/machine-learning/index.js +29 -27
- package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
- package/lib/machine-learning/machine-learning-api-client.js +4 -4
- package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
- 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 +19 -19
- package/lib/machine-learning/machine-learning.js +20 -20
- package/lib/messaging/batch-request-internal.d.ts +3 -3
- package/lib/messaging/batch-request-internal.js +9 -9
- package/lib/messaging/index.d.ts +11 -9
- package/lib/messaging/index.js +11 -9
- package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
- package/lib/messaging/messaging-api-request-internal.js +8 -8
- package/lib/messaging/messaging-api.d.ts +79 -75
- package/lib/messaging/messaging-api.js +1 -1
- package/lib/messaging/messaging-errors-internal.d.ts +5 -5
- package/lib/messaging/messaging-errors-internal.js +7 -7
- package/lib/messaging/messaging-internal.d.ts +1 -1
- package/lib/messaging/messaging-internal.js +6 -31
- package/lib/messaging/messaging-namespace.d.ts +105 -8
- package/lib/messaging/messaging-namespace.js +1 -1
- package/lib/messaging/messaging.d.ts +70 -86
- package/lib/messaging/messaging.js +76 -89
- package/lib/project-management/android-app.d.ts +11 -12
- package/lib/project-management/android-app.js +13 -14
- 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 +11 -9
- package/lib/project-management/index.js +11 -9
- package/lib/project-management/ios-app.d.ts +6 -7
- package/lib/project-management/ios-app.js +6 -7
- package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
- package/lib/project-management/project-management-api-request-internal.js +14 -14
- package/lib/project-management/project-management-namespace.d.ts +31 -9
- package/lib/project-management/project-management-namespace.js +1 -1
- package/lib/project-management/project-management.d.ts +18 -21
- package/lib/project-management/project-management.js +19 -22
- package/lib/remote-config/index.d.ts +12 -10
- package/lib/remote-config/index.js +11 -9
- package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
- package/lib/remote-config/remote-config-api-client-internal.js +2 -2
- package/lib/remote-config/remote-config-api.d.ts +12 -2
- package/lib/remote-config/remote-config-api.js +1 -1
- package/lib/remote-config/remote-config-namespace.d.ts +50 -9
- package/lib/remote-config/remote-config-namespace.js +1 -1
- package/lib/remote-config/remote-config.d.ts +19 -21
- package/lib/remote-config/remote-config.js +25 -25
- package/lib/security-rules/index.d.ts +12 -10
- package/lib/security-rules/index.js +12 -10
- 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 +43 -28
- package/lib/security-rules/security-rules-namespace.js +1 -1
- package/lib/security-rules/security-rules.d.ts +39 -42
- package/lib/security-rules/security-rules.js +38 -39
- package/lib/storage/index.d.ts +9 -7
- package/lib/storage/index.js +9 -7
- package/lib/storage/storage-namespace.d.ts +7 -6
- package/lib/storage/storage-namespace.js +1 -1
- package/lib/storage/storage.d.ts +3 -3
- package/lib/storage/storage.js +14 -4
- package/lib/utils/api-request.d.ts +24 -24
- package/lib/utils/api-request.js +25 -25
- package/lib/utils/crypto-signer.d.ts +128 -0
- package/lib/utils/crypto-signer.js +237 -0
- package/lib/utils/deep-copy.d.ts +6 -6
- package/lib/utils/deep-copy.js +6 -6
- package/lib/utils/error.d.ts +69 -36
- package/lib/utils/error.js +98 -43
- package/lib/utils/index.d.ts +30 -19
- package/lib/utils/index.js +47 -20
- package/lib/utils/jwt.d.ts +131 -0
- package/lib/utils/jwt.js +355 -0
- package/lib/utils/validator.d.ts +37 -37
- package/lib/utils/validator.js +37 -37
- package/package.json +126 -53
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -50,25 +50,25 @@ export declare class MachineLearning {
|
|
|
50
50
|
private readonly client;
|
|
51
51
|
private readonly appInternal;
|
|
52
52
|
/**
|
|
53
|
-
* The {@link app
|
|
53
|
+
* The {@link firebase-admin.app#App} associated with the current `MachineLearning`
|
|
54
54
|
* service instance.
|
|
55
55
|
*/
|
|
56
56
|
get app(): App;
|
|
57
57
|
/**
|
|
58
58
|
* Creates a model in the current Firebase project.
|
|
59
59
|
*
|
|
60
|
-
* @param model The model to create.
|
|
60
|
+
* @param model - The model to create.
|
|
61
61
|
*
|
|
62
|
-
* @
|
|
62
|
+
* @returns A Promise fulfilled with the created model.
|
|
63
63
|
*/
|
|
64
64
|
createModel(model: ModelOptions): Promise<Model>;
|
|
65
65
|
/**
|
|
66
66
|
* Updates a model's metadata or model file.
|
|
67
67
|
*
|
|
68
|
-
* @param modelId The ID of the model to update.
|
|
69
|
-
* @param model The model fields to update.
|
|
68
|
+
* @param modelId - The ID of the model to update.
|
|
69
|
+
* @param model - The model fields to update.
|
|
70
70
|
*
|
|
71
|
-
* @
|
|
71
|
+
* @returns A Promise fulfilled with the updated model.
|
|
72
72
|
*/
|
|
73
73
|
updateModel(modelId: string, model: ModelOptions): Promise<Model>;
|
|
74
74
|
/**
|
|
@@ -76,33 +76,33 @@ export declare class MachineLearning {
|
|
|
76
76
|
*
|
|
77
77
|
* A published model can be downloaded to client apps.
|
|
78
78
|
*
|
|
79
|
-
* @param modelId The ID of the model to publish.
|
|
79
|
+
* @param modelId - The ID of the model to publish.
|
|
80
80
|
*
|
|
81
|
-
* @
|
|
81
|
+
* @returns A Promise fulfilled with the published model.
|
|
82
82
|
*/
|
|
83
83
|
publishModel(modelId: string): Promise<Model>;
|
|
84
84
|
/**
|
|
85
85
|
* Unpublishes a Firebase ML model.
|
|
86
86
|
*
|
|
87
|
-
* @param modelId The ID of the model to unpublish.
|
|
87
|
+
* @param modelId - The ID of the model to unpublish.
|
|
88
88
|
*
|
|
89
|
-
* @
|
|
89
|
+
* @returns A Promise fulfilled with the unpublished model.
|
|
90
90
|
*/
|
|
91
91
|
unpublishModel(modelId: string): Promise<Model>;
|
|
92
92
|
/**
|
|
93
93
|
* Gets the model specified by the given ID.
|
|
94
94
|
*
|
|
95
|
-
* @param modelId The ID of the model to get.
|
|
95
|
+
* @param modelId - The ID of the model to get.
|
|
96
96
|
*
|
|
97
|
-
* @
|
|
97
|
+
* @returns A Promise fulfilled with the model object.
|
|
98
98
|
*/
|
|
99
99
|
getModel(modelId: string): Promise<Model>;
|
|
100
100
|
/**
|
|
101
101
|
* Lists the current project's models.
|
|
102
102
|
*
|
|
103
|
-
* @param options The listing options.
|
|
103
|
+
* @param options - The listing options.
|
|
104
104
|
*
|
|
105
|
-
* @
|
|
105
|
+
* @returns A promise that
|
|
106
106
|
* resolves with the current (filtered) list of models and the next page
|
|
107
107
|
* token. For the last page, an empty list of models and no page token
|
|
108
108
|
* are returned.
|
|
@@ -111,7 +111,7 @@ export declare class MachineLearning {
|
|
|
111
111
|
/**
|
|
112
112
|
* Deletes a model from the current project.
|
|
113
113
|
*
|
|
114
|
-
* @param modelId The ID of the model to delete.
|
|
114
|
+
* @param modelId - The ID of the model to delete.
|
|
115
115
|
*/
|
|
116
116
|
deleteModel(modelId: string): Promise<void>;
|
|
117
117
|
private setPublishStatus;
|
|
@@ -158,7 +158,7 @@ export declare class Model {
|
|
|
158
158
|
get tfliteModel(): TFLiteModel | undefined;
|
|
159
159
|
/**
|
|
160
160
|
* True if the model is locked by a server-side operation. You can't make
|
|
161
|
-
* changes to a locked model. See {@link waitForUnlocked
|
|
161
|
+
* changes to a locked model. See {@link Model.waitForUnlocked}.
|
|
162
162
|
*/
|
|
163
163
|
get locked(): boolean;
|
|
164
164
|
/**
|
|
@@ -170,10 +170,10 @@ export declare class Model {
|
|
|
170
170
|
/**
|
|
171
171
|
* Wait for the model to be unlocked.
|
|
172
172
|
*
|
|
173
|
-
* @param maxTimeMillis The maximum time in milliseconds to wait.
|
|
173
|
+
* @param maxTimeMillis - The maximum time in milliseconds to wait.
|
|
174
174
|
* If not specified, a default maximum of 2 minutes is used.
|
|
175
175
|
*
|
|
176
|
-
* @
|
|
176
|
+
* @returns A promise that resolves when the model is unlocked
|
|
177
177
|
* or the maximum wait time has passed.
|
|
178
178
|
*/
|
|
179
179
|
waitForUnlocked(maxTimeMillis?: number): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -29,7 +29,7 @@ var machine_learning_utils_1 = require("./machine-learning-utils");
|
|
|
29
29
|
*/
|
|
30
30
|
var MachineLearning = /** @class */ (function () {
|
|
31
31
|
/**
|
|
32
|
-
* @param app The app for this ML service.
|
|
32
|
+
* @param app - The app for this ML service.
|
|
33
33
|
* @constructor
|
|
34
34
|
* @internal
|
|
35
35
|
*/
|
|
@@ -46,7 +46,7 @@ var MachineLearning = /** @class */ (function () {
|
|
|
46
46
|
}
|
|
47
47
|
Object.defineProperty(MachineLearning.prototype, "app", {
|
|
48
48
|
/**
|
|
49
|
-
* The {@link app
|
|
49
|
+
* The {@link firebase-admin.app#App} associated with the current `MachineLearning`
|
|
50
50
|
* service instance.
|
|
51
51
|
*/
|
|
52
52
|
get: function () {
|
|
@@ -58,9 +58,9 @@ var MachineLearning = /** @class */ (function () {
|
|
|
58
58
|
/**
|
|
59
59
|
* Creates a model in the current Firebase project.
|
|
60
60
|
*
|
|
61
|
-
* @param model The model to create.
|
|
61
|
+
* @param model - The model to create.
|
|
62
62
|
*
|
|
63
|
-
* @
|
|
63
|
+
* @returns A Promise fulfilled with the created model.
|
|
64
64
|
*/
|
|
65
65
|
MachineLearning.prototype.createModel = function (model) {
|
|
66
66
|
var _this = this;
|
|
@@ -72,10 +72,10 @@ var MachineLearning = /** @class */ (function () {
|
|
|
72
72
|
/**
|
|
73
73
|
* Updates a model's metadata or model file.
|
|
74
74
|
*
|
|
75
|
-
* @param modelId The ID of the model to update.
|
|
76
|
-
* @param model The model fields to update.
|
|
75
|
+
* @param modelId - The ID of the model to update.
|
|
76
|
+
* @param model - The model fields to update.
|
|
77
77
|
*
|
|
78
|
-
* @
|
|
78
|
+
* @returns A Promise fulfilled with the updated model.
|
|
79
79
|
*/
|
|
80
80
|
MachineLearning.prototype.updateModel = function (modelId, model) {
|
|
81
81
|
var _this = this;
|
|
@@ -90,9 +90,9 @@ var MachineLearning = /** @class */ (function () {
|
|
|
90
90
|
*
|
|
91
91
|
* A published model can be downloaded to client apps.
|
|
92
92
|
*
|
|
93
|
-
* @param modelId The ID of the model to publish.
|
|
93
|
+
* @param modelId - The ID of the model to publish.
|
|
94
94
|
*
|
|
95
|
-
* @
|
|
95
|
+
* @returns A Promise fulfilled with the published model.
|
|
96
96
|
*/
|
|
97
97
|
MachineLearning.prototype.publishModel = function (modelId) {
|
|
98
98
|
return this.setPublishStatus(modelId, true);
|
|
@@ -100,9 +100,9 @@ var MachineLearning = /** @class */ (function () {
|
|
|
100
100
|
/**
|
|
101
101
|
* Unpublishes a Firebase ML model.
|
|
102
102
|
*
|
|
103
|
-
* @param modelId The ID of the model to unpublish.
|
|
103
|
+
* @param modelId - The ID of the model to unpublish.
|
|
104
104
|
*
|
|
105
|
-
* @
|
|
105
|
+
* @returns A Promise fulfilled with the unpublished model.
|
|
106
106
|
*/
|
|
107
107
|
MachineLearning.prototype.unpublishModel = function (modelId) {
|
|
108
108
|
return this.setPublishStatus(modelId, false);
|
|
@@ -110,9 +110,9 @@ var MachineLearning = /** @class */ (function () {
|
|
|
110
110
|
/**
|
|
111
111
|
* Gets the model specified by the given ID.
|
|
112
112
|
*
|
|
113
|
-
* @param modelId The ID of the model to get.
|
|
113
|
+
* @param modelId - The ID of the model to get.
|
|
114
114
|
*
|
|
115
|
-
* @
|
|
115
|
+
* @returns A Promise fulfilled with the model object.
|
|
116
116
|
*/
|
|
117
117
|
MachineLearning.prototype.getModel = function (modelId) {
|
|
118
118
|
var _this = this;
|
|
@@ -122,9 +122,9 @@ var MachineLearning = /** @class */ (function () {
|
|
|
122
122
|
/**
|
|
123
123
|
* Lists the current project's models.
|
|
124
124
|
*
|
|
125
|
-
* @param options The listing options.
|
|
125
|
+
* @param options - The listing options.
|
|
126
126
|
*
|
|
127
|
-
* @
|
|
127
|
+
* @returns A promise that
|
|
128
128
|
* resolves with the current (filtered) list of models and the next page
|
|
129
129
|
* token. For the last page, an empty list of models and no page token
|
|
130
130
|
* are returned.
|
|
@@ -151,7 +151,7 @@ var MachineLearning = /** @class */ (function () {
|
|
|
151
151
|
/**
|
|
152
152
|
* Deletes a model from the current project.
|
|
153
153
|
*
|
|
154
|
-
* @param modelId The ID of the model to delete.
|
|
154
|
+
* @param modelId - The ID of the model to delete.
|
|
155
155
|
*/
|
|
156
156
|
MachineLearning.prototype.deleteModel = function (modelId) {
|
|
157
157
|
return this.client.deleteModel(modelId);
|
|
@@ -307,7 +307,7 @@ var Model = /** @class */ (function () {
|
|
|
307
307
|
Object.defineProperty(Model.prototype, "locked", {
|
|
308
308
|
/**
|
|
309
309
|
* True if the model is locked by a server-side operation. You can't make
|
|
310
|
-
* changes to a locked model. See {@link waitForUnlocked
|
|
310
|
+
* changes to a locked model. See {@link Model.waitForUnlocked}.
|
|
311
311
|
*/
|
|
312
312
|
get: function () {
|
|
313
313
|
var _a, _b;
|
|
@@ -347,10 +347,10 @@ var Model = /** @class */ (function () {
|
|
|
347
347
|
/**
|
|
348
348
|
* Wait for the model to be unlocked.
|
|
349
349
|
*
|
|
350
|
-
* @param maxTimeMillis The maximum time in milliseconds to wait.
|
|
350
|
+
* @param maxTimeMillis - The maximum time in milliseconds to wait.
|
|
351
351
|
* If not specified, a default maximum of 2 minutes is used.
|
|
352
352
|
*
|
|
353
|
-
* @
|
|
353
|
+
* @returns A promise that resolves when the model is unlocked
|
|
354
354
|
* or the maximum wait time has passed.
|
|
355
355
|
*/
|
|
356
356
|
Model.prototype.waitForUnlocked = function (maxTimeMillis) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2019 Google Inc.
|
|
4
4
|
*
|
|
@@ -47,8 +47,8 @@ export declare class BatchRequestClient {
|
|
|
47
47
|
* Sends the given array of sub requests as a single batch, and parses the results into an array
|
|
48
48
|
* of HttpResponse objects.
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
51
|
-
* @
|
|
50
|
+
* @param requests - An array of sub requests to send.
|
|
51
|
+
* @returns A promise that resolves when the send operation is complete.
|
|
52
52
|
*/
|
|
53
53
|
send(requests: SubRequest[]): Promise<HttpResponse[]>;
|
|
54
54
|
private getMultipartPayload;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2019 Google Inc.
|
|
@@ -44,8 +44,8 @@ var BatchRequestClient = /** @class */ (function () {
|
|
|
44
44
|
* Sends the given array of sub requests as a single batch, and parses the results into an array
|
|
45
45
|
* of HttpResponse objects.
|
|
46
46
|
*
|
|
47
|
-
* @param
|
|
48
|
-
* @
|
|
47
|
+
* @param requests - An array of sub requests to send.
|
|
48
|
+
* @returns A promise that resolves when the send operation is complete.
|
|
49
49
|
*/
|
|
50
50
|
BatchRequestClient.prototype.send = function (requests) {
|
|
51
51
|
var _this = this;
|
|
@@ -89,10 +89,10 @@ exports.BatchRequestClient = BatchRequestClient;
|
|
|
89
89
|
* API, sets the content-type header to application/http, and the content-transfer-encoding to
|
|
90
90
|
* binary.
|
|
91
91
|
*
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @
|
|
92
|
+
* @param request - A sub request that will be used to populate the part.
|
|
93
|
+
* @param boundary - Multipart boundary string.
|
|
94
|
+
* @param idx - An index number that is used to set the content-id header.
|
|
95
|
+
* @returns The part as a string that can be included in the HTTP body.
|
|
96
96
|
*/
|
|
97
97
|
function createPart(request, boundary, idx) {
|
|
98
98
|
var serializedRequest = serializeSubRequest(request);
|
|
@@ -110,8 +110,8 @@ function createPart(request, boundary, idx) {
|
|
|
110
110
|
* format of the string is the wire format of a typical HTTP request, consisting of a header and a
|
|
111
111
|
* body.
|
|
112
112
|
*
|
|
113
|
-
* @param request
|
|
114
|
-
* @
|
|
113
|
+
* @param request - The sub request to be serialized.
|
|
114
|
+
* @returns String representation of the SubRequest.
|
|
115
115
|
*/
|
|
116
116
|
function serializeSubRequest(request) {
|
|
117
117
|
var requestBody = JSON.stringify(request.body);
|
package/lib/messaging/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,19 +14,21 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Firebase Cloud Messaging (FCM).
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
17
22
|
import { App } from '../app';
|
|
18
23
|
import { Messaging } from './messaging';
|
|
19
24
|
export { Messaging, } from './messaging';
|
|
20
25
|
export { AndroidConfig, AndroidFcmOptions, AndroidNotification, ApnsConfig, ApnsFcmOptions, ApnsPayload, Aps, ApsAlert, BaseMessage, BatchResponse, CriticalSound, ConditionMessage, FcmOptions, LightSettings, Message, MessagingTopicManagementResponse, MulticastMessage, Notification, SendResponse, TokenMessage, TopicMessage, WebpushConfig, WebpushFcmOptions, WebpushNotification, DataMessagePayload, MessagingConditionResponse, MessagingDeviceGroupResponse, MessagingDeviceResult, MessagingDevicesResponse, MessagingOptions, MessagingPayload, MessagingTopicResponse, NotificationMessagePayload, } from './messaging-api';
|
|
21
26
|
/**
|
|
22
|
-
* Gets the {@link
|
|
23
|
-
* default app or a given app.
|
|
27
|
+
* Gets the {@link Messaging} service for the default app or a given app.
|
|
24
28
|
*
|
|
25
29
|
* `admin.messaging()` can be called with no arguments to access the default
|
|
26
|
-
* app's
|
|
27
|
-
* `
|
|
28
|
-
* {@link messaging.Messaging `Messaging`} service associated with a
|
|
29
|
-
* specific app.
|
|
30
|
+
* app's `Messaging` service or as `admin.messaging(app)` to access the
|
|
31
|
+
* `Messaging` service associated with aspecific app.
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
32
34
|
* ```javascript
|
|
@@ -40,10 +42,10 @@ export { AndroidConfig, AndroidFcmOptions, AndroidNotification, ApnsConfig, Apns
|
|
|
40
42
|
* const otherMessaging = getMessaging(otherApp);
|
|
41
43
|
* ```
|
|
42
44
|
*
|
|
43
|
-
* @param app Optional app whose `Messaging` service to
|
|
45
|
+
* @param app - Optional app whose `Messaging` service to
|
|
44
46
|
* return. If not provided, the default `Messaging` service will be returned.
|
|
45
47
|
*
|
|
46
|
-
* @
|
|
48
|
+
* @returns The default `Messaging` service if no
|
|
47
49
|
* app is provided or the `Messaging` service associated with the provided
|
|
48
50
|
* app.
|
|
49
51
|
*/
|
package/lib/messaging/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2020 Google Inc.
|
|
@@ -17,19 +17,21 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.getMessaging = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* Firebase Cloud Messaging (FCM).
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
20
25
|
var app_1 = require("../app");
|
|
21
26
|
var messaging_1 = require("./messaging");
|
|
22
27
|
var messaging_2 = require("./messaging");
|
|
23
28
|
Object.defineProperty(exports, "Messaging", { enumerable: true, get: function () { return messaging_2.Messaging; } });
|
|
24
29
|
/**
|
|
25
|
-
* Gets the {@link
|
|
26
|
-
* default app or a given app.
|
|
30
|
+
* Gets the {@link Messaging} service for the default app or a given app.
|
|
27
31
|
*
|
|
28
32
|
* `admin.messaging()` can be called with no arguments to access the default
|
|
29
|
-
* app's
|
|
30
|
-
* `
|
|
31
|
-
* {@link messaging.Messaging `Messaging`} service associated with a
|
|
32
|
-
* specific app.
|
|
33
|
+
* app's `Messaging` service or as `admin.messaging(app)` to access the
|
|
34
|
+
* `Messaging` service associated with aspecific app.
|
|
33
35
|
*
|
|
34
36
|
* @example
|
|
35
37
|
* ```javascript
|
|
@@ -43,10 +45,10 @@ Object.defineProperty(exports, "Messaging", { enumerable: true, get: function ()
|
|
|
43
45
|
* const otherMessaging = getMessaging(otherApp);
|
|
44
46
|
* ```
|
|
45
47
|
*
|
|
46
|
-
* @param app Optional app whose `Messaging` service to
|
|
48
|
+
* @param app - Optional app whose `Messaging` service to
|
|
47
49
|
* return. If not provided, the default `Messaging` service will be returned.
|
|
48
50
|
*
|
|
49
|
-
* @
|
|
51
|
+
* @returns The default `Messaging` service if no
|
|
50
52
|
* app is provided or the `Messaging` service associated with the provided
|
|
51
53
|
* app.
|
|
52
54
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google Inc.
|
|
@@ -25,25 +25,25 @@ export declare class FirebaseMessagingRequestHandler {
|
|
|
25
25
|
private readonly httpClient;
|
|
26
26
|
private readonly batchClient;
|
|
27
27
|
/**
|
|
28
|
-
* @param app The app used to fetch access tokens to sign API requests.
|
|
28
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
29
29
|
* @constructor
|
|
30
30
|
*/
|
|
31
31
|
constructor(app: App);
|
|
32
32
|
/**
|
|
33
33
|
* Invokes the request handler with the provided request data.
|
|
34
34
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @
|
|
35
|
+
* @param host - The host to which to send the request.
|
|
36
|
+
* @param path - The path to which to send the request.
|
|
37
|
+
* @param requestData - The request data.
|
|
38
|
+
* @returns A promise that resolves with the response.
|
|
39
39
|
*/
|
|
40
40
|
invokeRequestHandler(host: string, path: string, requestData: object): Promise<object>;
|
|
41
41
|
/**
|
|
42
42
|
* Sends the given array of sub requests as a single batch to FCM, and parses the result into
|
|
43
43
|
* a BatchResponse object.
|
|
44
44
|
*
|
|
45
|
-
* @param
|
|
46
|
-
* @
|
|
45
|
+
* @param requests - An array of sub requests to send.
|
|
46
|
+
* @returns A promise that resolves when the send operation is complete.
|
|
47
47
|
*/
|
|
48
48
|
sendBatchRequest(requests: SubRequest[]): Promise<BatchResponse>;
|
|
49
49
|
private buildSendResponse;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -38,7 +38,7 @@ var LEGACY_FIREBASE_MESSAGING_HEADERS = {
|
|
|
38
38
|
*/
|
|
39
39
|
var FirebaseMessagingRequestHandler = /** @class */ (function () {
|
|
40
40
|
/**
|
|
41
|
-
* @param app The app used to fetch access tokens to sign API requests.
|
|
41
|
+
* @param app - The app used to fetch access tokens to sign API requests.
|
|
42
42
|
* @constructor
|
|
43
43
|
*/
|
|
44
44
|
function FirebaseMessagingRequestHandler(app) {
|
|
@@ -48,10 +48,10 @@ var FirebaseMessagingRequestHandler = /** @class */ (function () {
|
|
|
48
48
|
/**
|
|
49
49
|
* Invokes the request handler with the provided request data.
|
|
50
50
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @
|
|
51
|
+
* @param host - The host to which to send the request.
|
|
52
|
+
* @param path - The path to which to send the request.
|
|
53
|
+
* @param requestData - The request data.
|
|
54
|
+
* @returns A promise that resolves with the response.
|
|
55
55
|
*/
|
|
56
56
|
FirebaseMessagingRequestHandler.prototype.invokeRequestHandler = function (host, path, requestData) {
|
|
57
57
|
var request = {
|
|
@@ -86,8 +86,8 @@ var FirebaseMessagingRequestHandler = /** @class */ (function () {
|
|
|
86
86
|
* Sends the given array of sub requests as a single batch to FCM, and parses the result into
|
|
87
87
|
* a BatchResponse object.
|
|
88
88
|
*
|
|
89
|
-
* @param
|
|
90
|
-
* @
|
|
89
|
+
* @param requests - An array of sub requests to send.
|
|
90
|
+
* @returns A promise that resolves when the send operation is complete.
|
|
91
91
|
*/
|
|
92
92
|
FirebaseMessagingRequestHandler.prototype.sendBatchRequest = function (requests) {
|
|
93
93
|
var _this = this;
|