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
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* @license
|
|
@@ -35,7 +35,6 @@ var utils = require("../utils");
|
|
|
35
35
|
var validator = require("../utils/validator");
|
|
36
36
|
var messaging_internal_1 = require("./messaging-internal");
|
|
37
37
|
var messaging_api_request_internal_1 = require("./messaging-api-request-internal");
|
|
38
|
-
/* eslint-disable @typescript-eslint/camelcase */
|
|
39
38
|
// FCM endpoints
|
|
40
39
|
var FCM_SEND_HOST = 'fcm.googleapis.com';
|
|
41
40
|
var FCM_SEND_PATH = '/fcm/send';
|
|
@@ -90,9 +89,9 @@ var MESSAGING_CONDITION_RESPONSE_KEYS_MAP = {
|
|
|
90
89
|
/**
|
|
91
90
|
* Maps a raw FCM server response to a MessagingDevicesResponse object.
|
|
92
91
|
*
|
|
93
|
-
* @param
|
|
92
|
+
* @param response - The raw FCM server response to map.
|
|
94
93
|
*
|
|
95
|
-
* @
|
|
94
|
+
* @returns The mapped MessagingDevicesResponse object.
|
|
96
95
|
*/
|
|
97
96
|
function mapRawResponseToDevicesResponse(response) {
|
|
98
97
|
// Rename properties on the server response
|
|
@@ -112,9 +111,9 @@ function mapRawResponseToDevicesResponse(response) {
|
|
|
112
111
|
/**
|
|
113
112
|
* Maps a raw FCM server response to a MessagingDeviceGroupResponse object.
|
|
114
113
|
*
|
|
115
|
-
* @param
|
|
114
|
+
* @param response - The raw FCM server response to map.
|
|
116
115
|
*
|
|
117
|
-
* @
|
|
116
|
+
* @returns The mapped MessagingDeviceGroupResponse object.
|
|
118
117
|
*/
|
|
119
118
|
function mapRawResponseToDeviceGroupResponse(response) {
|
|
120
119
|
// Rename properties on the server response
|
|
@@ -129,7 +128,7 @@ function mapRawResponseToDeviceGroupResponse(response) {
|
|
|
129
128
|
*
|
|
130
129
|
* @param {object} response The raw FCM server response to map.
|
|
131
130
|
*
|
|
132
|
-
* @
|
|
131
|
+
* @returns {MessagingTopicManagementResponse} The mapped MessagingTopicManagementResponse object.
|
|
133
132
|
*/
|
|
134
133
|
function mapRawResponseToTopicManagementResponse(response) {
|
|
135
134
|
// Add the success and failure counts.
|
|
@@ -161,17 +160,7 @@ function mapRawResponseToTopicManagementResponse(response) {
|
|
|
161
160
|
*/
|
|
162
161
|
var Messaging = /** @class */ (function () {
|
|
163
162
|
/**
|
|
164
|
-
*
|
|
165
|
-
* current app.
|
|
166
|
-
*
|
|
167
|
-
* @example
|
|
168
|
-
* ```javascript
|
|
169
|
-
* var messaging = app.messaging();
|
|
170
|
-
* // The above is shorthand for:
|
|
171
|
-
* // var messaging = admin.messaging(app);
|
|
172
|
-
* ```
|
|
173
|
-
*
|
|
174
|
-
* @return The `Messaging` service for the current app.
|
|
163
|
+
* @internal
|
|
175
164
|
*/
|
|
176
165
|
function Messaging(app) {
|
|
177
166
|
if (!validator.isNonNullObject(app) || !('options' in app)) {
|
|
@@ -182,7 +171,7 @@ var Messaging = /** @class */ (function () {
|
|
|
182
171
|
}
|
|
183
172
|
Object.defineProperty(Messaging.prototype, "app", {
|
|
184
173
|
/**
|
|
185
|
-
* The {@link app
|
|
174
|
+
* The {@link firebase-admin.app#App} associated with the current `Messaging` service
|
|
186
175
|
* instance.
|
|
187
176
|
*
|
|
188
177
|
* @example
|
|
@@ -199,10 +188,10 @@ var Messaging = /** @class */ (function () {
|
|
|
199
188
|
/**
|
|
200
189
|
* Sends the given message via FCM.
|
|
201
190
|
*
|
|
202
|
-
* @param message The message payload.
|
|
203
|
-
* @param dryRun Whether to send the message in the dry-run
|
|
191
|
+
* @param message - The message payload.
|
|
192
|
+
* @param dryRun - Whether to send the message in the dry-run
|
|
204
193
|
* (validation only) mode.
|
|
205
|
-
* @
|
|
194
|
+
* @returns A promise fulfilled with a unique message ID
|
|
206
195
|
* string after the message has been successfully handed off to the FCM
|
|
207
196
|
* service for delivery.
|
|
208
197
|
*/
|
|
@@ -237,11 +226,11 @@ var Messaging = /** @class */ (function () {
|
|
|
237
226
|
* the list could be sent. Partial failures are indicated by a `BatchResponse`
|
|
238
227
|
* return value.
|
|
239
228
|
*
|
|
240
|
-
* @param messages A non-empty array
|
|
229
|
+
* @param messages - A non-empty array
|
|
241
230
|
* containing up to 500 messages.
|
|
242
|
-
* @param dryRun Whether to send the messages in the dry-run
|
|
231
|
+
* @param dryRun - Whether to send the messages in the dry-run
|
|
243
232
|
* (validation only) mode.
|
|
244
|
-
* @
|
|
233
|
+
* @returns A Promise fulfilled with an object representing the result of the
|
|
245
234
|
* send operation.
|
|
246
235
|
*/
|
|
247
236
|
Messaging.prototype.sendAll = function (messages, dryRun) {
|
|
@@ -289,11 +278,11 @@ var Messaging = /** @class */ (function () {
|
|
|
289
278
|
* not sent to any of the tokens in the list. Partial failures are indicated by
|
|
290
279
|
* a `BatchResponse` return value.
|
|
291
280
|
*
|
|
292
|
-
* @param message A multicast message
|
|
281
|
+
* @param message - A multicast message
|
|
293
282
|
* containing up to 500 tokens.
|
|
294
|
-
* @param dryRun Whether to send the message in the dry-run
|
|
283
|
+
* @param dryRun - Whether to send the message in the dry-run
|
|
295
284
|
* (validation only) mode.
|
|
296
|
-
* @
|
|
285
|
+
* @returns A Promise fulfilled with an object representing the result of the
|
|
297
286
|
* send operation.
|
|
298
287
|
*/
|
|
299
288
|
Messaging.prototype.sendMulticast = function (message, dryRun) {
|
|
@@ -324,20 +313,20 @@ var Messaging = /** @class */ (function () {
|
|
|
324
313
|
* Sends an FCM message to a single device corresponding to the provided
|
|
325
314
|
* registration token.
|
|
326
315
|
*
|
|
327
|
-
* See
|
|
328
|
-
*
|
|
316
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_individual_devices |
|
|
317
|
+
* Send to individual devices}
|
|
329
318
|
* for code samples and detailed documentation. Takes either a
|
|
330
319
|
* `registrationToken` to send to a single device or a
|
|
331
320
|
* `registrationTokens` parameter containing an array of tokens to send
|
|
332
321
|
* to multiple devices.
|
|
333
322
|
*
|
|
334
|
-
* @param registrationToken A device registration token or an array of
|
|
323
|
+
* @param registrationToken - A device registration token or an array of
|
|
335
324
|
* device registration tokens to which the message should be sent.
|
|
336
|
-
* @param payload The message payload.
|
|
337
|
-
* @param options Optional options to
|
|
325
|
+
* @param payload - The message payload.
|
|
326
|
+
* @param options - Optional options to
|
|
338
327
|
* alter the message.
|
|
339
328
|
*
|
|
340
|
-
* @
|
|
329
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
341
330
|
* has been sent.
|
|
342
331
|
*/
|
|
343
332
|
Messaging.prototype.sendToDevice = function (registrationTokenOrTokens, payload, options) {
|
|
@@ -383,17 +372,16 @@ var Messaging = /** @class */ (function () {
|
|
|
383
372
|
* Sends an FCM message to a device group corresponding to the provided
|
|
384
373
|
* notification key.
|
|
385
374
|
*
|
|
386
|
-
* See
|
|
387
|
-
*
|
|
388
|
-
* for code samples and detailed documentation.
|
|
375
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_device_group |
|
|
376
|
+
* Send to a device group} for code samples and detailed documentation.
|
|
389
377
|
*
|
|
390
|
-
* @param notificationKey The notification key for the device group to
|
|
378
|
+
* @param notificationKey - The notification key for the device group to
|
|
391
379
|
* which to send the message.
|
|
392
|
-
* @param payload The message payload.
|
|
393
|
-
* @param options Optional options to
|
|
380
|
+
* @param payload - The message payload.
|
|
381
|
+
* @param options - Optional options to
|
|
394
382
|
* alter the message.
|
|
395
383
|
*
|
|
396
|
-
* @
|
|
384
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
397
385
|
* has been sent.
|
|
398
386
|
*/
|
|
399
387
|
Messaging.prototype.sendToDeviceGroup = function (notificationKey, payload, options) {
|
|
@@ -449,16 +437,15 @@ var Messaging = /** @class */ (function () {
|
|
|
449
437
|
/**
|
|
450
438
|
* Sends an FCM message to a topic.
|
|
451
439
|
*
|
|
452
|
-
* See
|
|
453
|
-
*
|
|
454
|
-
* for code samples and detailed documentation.
|
|
440
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_topic |
|
|
441
|
+
* Send to a topic} for code samples and detailed documentation.
|
|
455
442
|
*
|
|
456
|
-
* @param topic The topic to which to send the message.
|
|
457
|
-
* @param payload The message payload.
|
|
458
|
-
* @param options Optional options to
|
|
443
|
+
* @param topic - The topic to which to send the message.
|
|
444
|
+
* @param payload - The message payload.
|
|
445
|
+
* @param options - Optional options to
|
|
459
446
|
* alter the message.
|
|
460
447
|
*
|
|
461
|
-
* @
|
|
448
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
462
449
|
* has been sent.
|
|
463
450
|
*/
|
|
464
451
|
Messaging.prototype.sendToTopic = function (topic, payload, options) {
|
|
@@ -491,17 +478,17 @@ var Messaging = /** @class */ (function () {
|
|
|
491
478
|
/**
|
|
492
479
|
* Sends an FCM message to a condition.
|
|
493
480
|
*
|
|
494
|
-
* See
|
|
495
|
-
*
|
|
481
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_condition |
|
|
482
|
+
* Send to a condition}
|
|
496
483
|
* for code samples and detailed documentation.
|
|
497
484
|
*
|
|
498
|
-
* @param condition The condition determining to which topics to send
|
|
485
|
+
* @param condition - The condition determining to which topics to send
|
|
499
486
|
* the message.
|
|
500
|
-
* @param payload The message payload.
|
|
501
|
-
* @param options Optional options to
|
|
487
|
+
* @param payload - The message payload.
|
|
488
|
+
* @param options - Optional options to
|
|
502
489
|
* alter the message.
|
|
503
490
|
*
|
|
504
|
-
* @
|
|
491
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
505
492
|
* has been sent.
|
|
506
493
|
*/
|
|
507
494
|
Messaging.prototype.sendToCondition = function (condition, payload, options) {
|
|
@@ -538,16 +525,16 @@ var Messaging = /** @class */ (function () {
|
|
|
538
525
|
/**
|
|
539
526
|
* Subscribes a device to an FCM topic.
|
|
540
527
|
*
|
|
541
|
-
* See
|
|
542
|
-
* topic
|
|
528
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/manage-topics#suscribe_and_unsubscribe_using_the |
|
|
529
|
+
* Subscribe to a topic}
|
|
543
530
|
* for code samples and detailed documentation. Optionally, you can provide an
|
|
544
531
|
* array of tokens to subscribe multiple devices.
|
|
545
532
|
*
|
|
546
|
-
* @param registrationTokens A token or array of registration tokens
|
|
533
|
+
* @param registrationTokens - A token or array of registration tokens
|
|
547
534
|
* for the devices to subscribe to the topic.
|
|
548
|
-
* @param topic The topic to which to subscribe.
|
|
535
|
+
* @param topic - The topic to which to subscribe.
|
|
549
536
|
*
|
|
550
|
-
* @
|
|
537
|
+
* @returns A promise fulfilled with the server's response after the device has been
|
|
551
538
|
* subscribed to the topic.
|
|
552
539
|
*/
|
|
553
540
|
Messaging.prototype.subscribeToTopic = function (registrationTokenOrTokens, topic) {
|
|
@@ -556,16 +543,16 @@ var Messaging = /** @class */ (function () {
|
|
|
556
543
|
/**
|
|
557
544
|
* Unsubscribes a device from an FCM topic.
|
|
558
545
|
*
|
|
559
|
-
* See
|
|
560
|
-
* topic
|
|
546
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/manage-topic-subscriptions#unsubscribe_from_a_topic |
|
|
547
|
+
* Unsubscribe from a topic}
|
|
561
548
|
* for code samples and detailed documentation. Optionally, you can provide an
|
|
562
549
|
* array of tokens to unsubscribe multiple devices.
|
|
563
550
|
*
|
|
564
|
-
* @param registrationTokens A device registration token or an array of
|
|
551
|
+
* @param registrationTokens - A device registration token or an array of
|
|
565
552
|
* device registration tokens to unsubscribe from the topic.
|
|
566
|
-
* @param topic The topic from which to unsubscribe.
|
|
553
|
+
* @param topic - The topic from which to unsubscribe.
|
|
567
554
|
*
|
|
568
|
-
* @
|
|
555
|
+
* @returns A promise fulfilled with the server's response after the device has been
|
|
569
556
|
* unsubscribed from the topic.
|
|
570
557
|
*/
|
|
571
558
|
Messaging.prototype.unsubscribeFromTopic = function (registrationTokenOrTokens, topic) {
|
|
@@ -591,13 +578,13 @@ var Messaging = /** @class */ (function () {
|
|
|
591
578
|
/**
|
|
592
579
|
* Helper method which sends and handles topic subscription management requests.
|
|
593
580
|
*
|
|
594
|
-
* @param
|
|
581
|
+
* @param registrationTokenOrTokens - The registration token or an array of
|
|
595
582
|
* registration tokens to unsubscribe from the topic.
|
|
596
|
-
* @param
|
|
597
|
-
* @param
|
|
598
|
-
* @param
|
|
583
|
+
* @param topic - The topic to which to subscribe.
|
|
584
|
+
* @param methodName - The name of the original method called.
|
|
585
|
+
* @param path - The endpoint path to use for the request.
|
|
599
586
|
*
|
|
600
|
-
* @
|
|
587
|
+
* @returns A Promise fulfilled with the parsed server
|
|
601
588
|
* response.
|
|
602
589
|
*/
|
|
603
590
|
Messaging.prototype.sendTopicManagementRequest = function (registrationTokenOrTokens, topic, methodName, path) {
|
|
@@ -630,8 +617,8 @@ var Messaging = /** @class */ (function () {
|
|
|
630
617
|
/**
|
|
631
618
|
* Validates the types of the messaging payload and options. If invalid, an error will be thrown.
|
|
632
619
|
*
|
|
633
|
-
* @param
|
|
634
|
-
* @param
|
|
620
|
+
* @param payload - The messaging payload to validate.
|
|
621
|
+
* @param options - The messaging options to validate.
|
|
635
622
|
*/
|
|
636
623
|
Messaging.prototype.validateMessagingPayloadAndOptionsTypes = function (payload, options) {
|
|
637
624
|
// Validate the payload is an object
|
|
@@ -646,9 +633,9 @@ var Messaging = /** @class */ (function () {
|
|
|
646
633
|
/**
|
|
647
634
|
* Validates the messaging payload. If invalid, an error will be thrown.
|
|
648
635
|
*
|
|
649
|
-
* @param
|
|
636
|
+
* @param payload - The messaging payload to validate.
|
|
650
637
|
*
|
|
651
|
-
* @
|
|
638
|
+
* @returns A copy of the provided payload with whitelisted properties switched
|
|
652
639
|
* from camelCase to underscore_case.
|
|
653
640
|
*/
|
|
654
641
|
Messaging.prototype.validateMessagingPayload = function (payload) {
|
|
@@ -711,9 +698,9 @@ var Messaging = /** @class */ (function () {
|
|
|
711
698
|
/**
|
|
712
699
|
* Validates the messaging options. If invalid, an error will be thrown.
|
|
713
700
|
*
|
|
714
|
-
* @param
|
|
701
|
+
* @param options - The messaging options to validate.
|
|
715
702
|
*
|
|
716
|
-
* @
|
|
703
|
+
* @returns A copy of the provided options with whitelisted properties switched
|
|
717
704
|
* from camelCase to underscore_case.
|
|
718
705
|
*/
|
|
719
706
|
Messaging.prototype.validateMessagingOptions = function (options) {
|
|
@@ -767,9 +754,9 @@ var Messaging = /** @class */ (function () {
|
|
|
767
754
|
/**
|
|
768
755
|
* Validates the type of the provided registration token(s). If invalid, an error will be thrown.
|
|
769
756
|
*
|
|
770
|
-
* @param
|
|
771
|
-
* @param
|
|
772
|
-
* @param
|
|
757
|
+
* @param registrationTokenOrTokens - The registration token(s) to validate.
|
|
758
|
+
* @param method - The method name to use in error messages.
|
|
759
|
+
* @param errorInfo - The error info to use if the registration tokens are invalid.
|
|
773
760
|
*/
|
|
774
761
|
Messaging.prototype.validateRegistrationTokensType = function (registrationTokenOrTokens, methodName, errorInfo) {
|
|
775
762
|
if (errorInfo === void 0) { errorInfo = error_1.MessagingClientErrorCode.INVALID_ARGUMENT; }
|
|
@@ -782,10 +769,10 @@ var Messaging = /** @class */ (function () {
|
|
|
782
769
|
/**
|
|
783
770
|
* Validates the provided registration tokens. If invalid, an error will be thrown.
|
|
784
771
|
*
|
|
785
|
-
* @param
|
|
772
|
+
* @param registrationTokenOrTokens - The registration token or an array of
|
|
786
773
|
* registration tokens to validate.
|
|
787
|
-
* @param
|
|
788
|
-
* @param
|
|
774
|
+
* @param method - The method name to use in error messages.
|
|
775
|
+
* @param errorInfo - The error info to use if the registration tokens are invalid.
|
|
789
776
|
*/
|
|
790
777
|
Messaging.prototype.validateRegistrationTokens = function (registrationTokenOrTokens, methodName, errorInfo) {
|
|
791
778
|
if (errorInfo === void 0) { errorInfo = error_1.MessagingClientErrorCode.INVALID_ARGUMENT; }
|
|
@@ -807,9 +794,9 @@ var Messaging = /** @class */ (function () {
|
|
|
807
794
|
/**
|
|
808
795
|
* Validates the type of the provided topic. If invalid, an error will be thrown.
|
|
809
796
|
*
|
|
810
|
-
* @param
|
|
811
|
-
* @param
|
|
812
|
-
* @param
|
|
797
|
+
* @param topic - The topic to validate.
|
|
798
|
+
* @param method - The method name to use in error messages.
|
|
799
|
+
* @param errorInfo - The error info to use if the topic is invalid.
|
|
813
800
|
*/
|
|
814
801
|
Messaging.prototype.validateTopicType = function (topic, methodName, errorInfo) {
|
|
815
802
|
if (errorInfo === void 0) { errorInfo = error_1.MessagingClientErrorCode.INVALID_ARGUMENT; }
|
|
@@ -821,9 +808,9 @@ var Messaging = /** @class */ (function () {
|
|
|
821
808
|
/**
|
|
822
809
|
* Validates the provided topic. If invalid, an error will be thrown.
|
|
823
810
|
*
|
|
824
|
-
* @param
|
|
825
|
-
* @param
|
|
826
|
-
* @param
|
|
811
|
+
* @param topic - The topic to validate.
|
|
812
|
+
* @param method - The method name to use in error messages.
|
|
813
|
+
* @param errorInfo - The error info to use if the topic is invalid.
|
|
827
814
|
*/
|
|
828
815
|
Messaging.prototype.validateTopic = function (topic, methodName, errorInfo) {
|
|
829
816
|
if (errorInfo === void 0) { errorInfo = error_1.MessagingClientErrorCode.INVALID_ARGUMENT; }
|
|
@@ -835,9 +822,9 @@ var Messaging = /** @class */ (function () {
|
|
|
835
822
|
/**
|
|
836
823
|
* Normalizes the provided topic name by prepending it with '/topics/', if necessary.
|
|
837
824
|
*
|
|
838
|
-
* @param
|
|
825
|
+
* @param topic - The topic name to normalize.
|
|
839
826
|
*
|
|
840
|
-
* @
|
|
827
|
+
* @returns The normalized topic name.
|
|
841
828
|
*/
|
|
842
829
|
Messaging.prototype.normalizeTopic = function (topic) {
|
|
843
830
|
if (!/^\/topics\//.test(topic)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2018 Google Inc.
|
|
4
4
|
*
|
|
@@ -34,8 +34,7 @@ export interface AndroidAppMetadata extends AppMetadata {
|
|
|
34
34
|
/**
|
|
35
35
|
* A reference to a Firebase Android app.
|
|
36
36
|
*
|
|
37
|
-
* Do not call this constructor directly. Instead, use
|
|
38
|
-
* [`projectManagement.androidApp()`](projectManagement.ProjectManagement#androidApp).
|
|
37
|
+
* Do not call this constructor directly. Instead, use {@link ProjectManagement.androidApp}.
|
|
39
38
|
*/
|
|
40
39
|
export declare class AndroidApp {
|
|
41
40
|
readonly appId: string;
|
|
@@ -44,46 +43,46 @@ export declare class AndroidApp {
|
|
|
44
43
|
/**
|
|
45
44
|
* Retrieves metadata about this Android app.
|
|
46
45
|
*
|
|
47
|
-
* @
|
|
46
|
+
* @returns A promise that resolves to the retrieved metadata about this Android app.
|
|
48
47
|
*/
|
|
49
48
|
getMetadata(): Promise<AndroidAppMetadata>;
|
|
50
49
|
/**
|
|
51
50
|
* Sets the optional user-assigned display name of the app.
|
|
52
51
|
*
|
|
53
|
-
* @param newDisplayName The new display name to set.
|
|
52
|
+
* @param newDisplayName - The new display name to set.
|
|
54
53
|
*
|
|
55
|
-
* @
|
|
54
|
+
* @returns A promise that resolves when the display name has been set.
|
|
56
55
|
*/
|
|
57
56
|
setDisplayName(newDisplayName: string): Promise<void>;
|
|
58
57
|
/**
|
|
59
58
|
* Gets the list of SHA certificates associated with this Android app in Firebase.
|
|
60
59
|
*
|
|
61
|
-
* @
|
|
60
|
+
* @returns The list of SHA-1 and SHA-256 certificates associated with this Android app in
|
|
62
61
|
* Firebase.
|
|
63
62
|
*/
|
|
64
63
|
getShaCertificates(): Promise<ShaCertificate[]>;
|
|
65
64
|
/**
|
|
66
65
|
* Adds the given SHA certificate to this Android app.
|
|
67
66
|
*
|
|
68
|
-
* @param certificateToAdd The SHA certificate to add.
|
|
67
|
+
* @param certificateToAdd - The SHA certificate to add.
|
|
69
68
|
*
|
|
70
|
-
* @
|
|
69
|
+
* @returns A promise that resolves when the given certificate
|
|
71
70
|
* has been added to the Android app.
|
|
72
71
|
*/
|
|
73
72
|
addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;
|
|
74
73
|
/**
|
|
75
74
|
* Deletes the specified SHA certificate from this Android app.
|
|
76
75
|
*
|
|
77
|
-
* @param
|
|
76
|
+
* @param certificateToDelete - The SHA certificate to delete.
|
|
78
77
|
*
|
|
79
|
-
* @
|
|
78
|
+
* @returns A promise that resolves when the specified
|
|
80
79
|
* certificate has been removed from the Android app.
|
|
81
80
|
*/
|
|
82
81
|
deleteShaCertificate(certificateToDelete: ShaCertificate): Promise<void>;
|
|
83
82
|
/**
|
|
84
83
|
* Gets the configuration artifact associated with this app.
|
|
85
84
|
*
|
|
86
|
-
* @
|
|
85
|
+
* @returns A promise that resolves to the Android app's
|
|
87
86
|
* Firebase config file, in UTF-8 string format. This string is typically
|
|
88
87
|
* intended to be written to a JSON file that gets shipped with your Android
|
|
89
88
|
* app.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
"use strict";
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -24,8 +24,7 @@ var app_metadata_1 = require("./app-metadata");
|
|
|
24
24
|
/**
|
|
25
25
|
* A reference to a Firebase Android app.
|
|
26
26
|
*
|
|
27
|
-
* Do not call this constructor directly. Instead, use
|
|
28
|
-
* [`projectManagement.androidApp()`](projectManagement.ProjectManagement#androidApp).
|
|
27
|
+
* Do not call this constructor directly. Instead, use {@link ProjectManagement.androidApp}.
|
|
29
28
|
*/
|
|
30
29
|
var AndroidApp = /** @class */ (function () {
|
|
31
30
|
/**
|
|
@@ -42,7 +41,7 @@ var AndroidApp = /** @class */ (function () {
|
|
|
42
41
|
/**
|
|
43
42
|
* Retrieves metadata about this Android app.
|
|
44
43
|
*
|
|
45
|
-
* @
|
|
44
|
+
* @returns A promise that resolves to the retrieved metadata about this Android app.
|
|
46
45
|
*/
|
|
47
46
|
AndroidApp.prototype.getMetadata = function () {
|
|
48
47
|
return this.requestHandler.getResource(this.resourceName)
|
|
@@ -66,9 +65,9 @@ var AndroidApp = /** @class */ (function () {
|
|
|
66
65
|
/**
|
|
67
66
|
* Sets the optional user-assigned display name of the app.
|
|
68
67
|
*
|
|
69
|
-
* @param newDisplayName The new display name to set.
|
|
68
|
+
* @param newDisplayName - The new display name to set.
|
|
70
69
|
*
|
|
71
|
-
* @
|
|
70
|
+
* @returns A promise that resolves when the display name has been set.
|
|
72
71
|
*/
|
|
73
72
|
AndroidApp.prototype.setDisplayName = function (newDisplayName) {
|
|
74
73
|
return this.requestHandler.setDisplayName(this.resourceName, newDisplayName);
|
|
@@ -76,7 +75,7 @@ var AndroidApp = /** @class */ (function () {
|
|
|
76
75
|
/**
|
|
77
76
|
* Gets the list of SHA certificates associated with this Android app in Firebase.
|
|
78
77
|
*
|
|
79
|
-
* @
|
|
78
|
+
* @returns The list of SHA-1 and SHA-256 certificates associated with this Android app in
|
|
80
79
|
* Firebase.
|
|
81
80
|
*/
|
|
82
81
|
AndroidApp.prototype.getShaCertificates = function () {
|
|
@@ -100,9 +99,9 @@ var AndroidApp = /** @class */ (function () {
|
|
|
100
99
|
/**
|
|
101
100
|
* Adds the given SHA certificate to this Android app.
|
|
102
101
|
*
|
|
103
|
-
* @param certificateToAdd The SHA certificate to add.
|
|
102
|
+
* @param certificateToAdd - The SHA certificate to add.
|
|
104
103
|
*
|
|
105
|
-
* @
|
|
104
|
+
* @returns A promise that resolves when the given certificate
|
|
106
105
|
* has been added to the Android app.
|
|
107
106
|
*/
|
|
108
107
|
AndroidApp.prototype.addShaCertificate = function (certificateToAdd) {
|
|
@@ -111,9 +110,9 @@ var AndroidApp = /** @class */ (function () {
|
|
|
111
110
|
/**
|
|
112
111
|
* Deletes the specified SHA certificate from this Android app.
|
|
113
112
|
*
|
|
114
|
-
* @param
|
|
113
|
+
* @param certificateToDelete - The SHA certificate to delete.
|
|
115
114
|
*
|
|
116
|
-
* @
|
|
115
|
+
* @returns A promise that resolves when the specified
|
|
117
116
|
* certificate has been removed from the Android app.
|
|
118
117
|
*/
|
|
119
118
|
AndroidApp.prototype.deleteShaCertificate = function (certificateToDelete) {
|
|
@@ -126,7 +125,7 @@ var AndroidApp = /** @class */ (function () {
|
|
|
126
125
|
/**
|
|
127
126
|
* Gets the configuration artifact associated with this app.
|
|
128
127
|
*
|
|
129
|
-
* @
|
|
128
|
+
* @returns A promise that resolves to the Android app's
|
|
130
129
|
* Firebase config file, in UTF-8 string format. This string is typically
|
|
131
130
|
* intended to be written to a JSON file that gets shipped with your Android
|
|
132
131
|
* app.
|
|
@@ -154,12 +153,12 @@ var ShaCertificate = /** @class */ (function () {
|
|
|
154
153
|
* Creates a ShaCertificate using the given hash. The ShaCertificate's type (eg. 'sha256') is
|
|
155
154
|
* automatically determined from the hash itself.
|
|
156
155
|
*
|
|
157
|
-
* @param shaHash The sha256 or sha1 hash for this certificate.
|
|
156
|
+
* @param shaHash - The sha256 or sha1 hash for this certificate.
|
|
158
157
|
* @example
|
|
159
158
|
* ```javascript
|
|
160
159
|
* var shaHash = shaCertificate.shaHash;
|
|
161
160
|
* ```
|
|
162
|
-
* @param resourceName The Firebase resource name for this certificate. This does not need to be
|
|
161
|
+
* @param resourceName - The Firebase resource name for this certificate. This does not need to be
|
|
163
162
|
* set when creating a new certificate.
|
|
164
163
|
* @example
|
|
165
164
|
* ```javascript
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! firebase-admin
|
|
1
|
+
/*! firebase-admin v10.0.2 */
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright 2020 Google Inc.
|
|
4
4
|
*
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
/**
|
|
18
|
+
* Firebase project management.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
17
22
|
import { App } from '../app';
|
|
18
23
|
import { ProjectManagement } from './project-management';
|
|
19
24
|
export { AppMetadata, AppPlatform } from './app-metadata';
|
|
@@ -21,14 +26,11 @@ export { ProjectManagement } from './project-management';
|
|
|
21
26
|
export { AndroidApp, AndroidAppMetadata, ShaCertificate } from './android-app';
|
|
22
27
|
export { IosApp, IosAppMetadata } from './ios-app';
|
|
23
28
|
/**
|
|
24
|
-
* Gets the {@link
|
|
25
|
-
* `ProjectManagement`} service for the default app or a given app.
|
|
29
|
+
* Gets the {@link ProjectManagement} service for the default app or a given app.
|
|
26
30
|
*
|
|
27
31
|
* `getProjectManagement()` can be called with no arguments to access the
|
|
28
|
-
* default app's
|
|
29
|
-
* `ProjectManagement`
|
|
30
|
-
* the {@link projectManagement.ProjectManagement `ProjectManagement`}
|
|
31
|
-
* service associated with a specific app.
|
|
32
|
+
* default app's `ProjectManagement` service, or as `getProjectManagement(app)` to access
|
|
33
|
+
* the `ProjectManagement` service associated with a specific app.
|
|
32
34
|
*
|
|
33
35
|
* @example
|
|
34
36
|
* ```javascript
|
|
@@ -42,10 +44,10 @@ export { IosApp, IosAppMetadata } from './ios-app';
|
|
|
42
44
|
* const otherProjectManagement = getProjectManagement(otherApp);
|
|
43
45
|
* ```
|
|
44
46
|
*
|
|
45
|
-
* @param app Optional app whose `ProjectManagement` service
|
|
47
|
+
* @param app - Optional app whose `ProjectManagement` service
|
|
46
48
|
* to return. If not provided, the default `ProjectManagement` service will
|
|
47
49
|
* be returned. *
|
|
48
|
-
* @
|
|
50
|
+
* @returns The default `ProjectManagement` service if no app is provided or the
|
|
49
51
|
* `ProjectManagement` service associated with the provided app.
|
|
50
52
|
*/
|
|
51
53
|
export declare function getProjectManagement(app?: App): ProjectManagement;
|
|
@@ -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,6 +17,11 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.getProjectManagement = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* Firebase project management.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
*/
|
|
20
25
|
var app_1 = require("../app");
|
|
21
26
|
var project_management_1 = require("./project-management");
|
|
22
27
|
var app_metadata_1 = require("./app-metadata");
|
|
@@ -29,14 +34,11 @@ Object.defineProperty(exports, "ShaCertificate", { enumerable: true, get: functi
|
|
|
29
34
|
var ios_app_1 = require("./ios-app");
|
|
30
35
|
Object.defineProperty(exports, "IosApp", { enumerable: true, get: function () { return ios_app_1.IosApp; } });
|
|
31
36
|
/**
|
|
32
|
-
* Gets the {@link
|
|
33
|
-
* `ProjectManagement`} service for the default app or a given app.
|
|
37
|
+
* Gets the {@link ProjectManagement} service for the default app or a given app.
|
|
34
38
|
*
|
|
35
39
|
* `getProjectManagement()` can be called with no arguments to access the
|
|
36
|
-
* default app's
|
|
37
|
-
* `ProjectManagement`
|
|
38
|
-
* the {@link projectManagement.ProjectManagement `ProjectManagement`}
|
|
39
|
-
* service associated with a specific app.
|
|
40
|
+
* default app's `ProjectManagement` service, or as `getProjectManagement(app)` to access
|
|
41
|
+
* the `ProjectManagement` service associated with a specific app.
|
|
40
42
|
*
|
|
41
43
|
* @example
|
|
42
44
|
* ```javascript
|
|
@@ -50,10 +52,10 @@ Object.defineProperty(exports, "IosApp", { enumerable: true, get: function () {
|
|
|
50
52
|
* const otherProjectManagement = getProjectManagement(otherApp);
|
|
51
53
|
* ```
|
|
52
54
|
*
|
|
53
|
-
* @param app Optional app whose `ProjectManagement` service
|
|
55
|
+
* @param app - Optional app whose `ProjectManagement` service
|
|
54
56
|
* to return. If not provided, the default `ProjectManagement` service will
|
|
55
57
|
* be returned. *
|
|
56
|
-
* @
|
|
58
|
+
* @returns The default `ProjectManagement` service if no app is provided or the
|
|
57
59
|
* `ProjectManagement` service associated with the provided app.
|
|
58
60
|
*/
|
|
59
61
|
function getProjectManagement(app) {
|