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 2021 Google Inc.
|
|
4
4
|
*
|
|
@@ -18,14 +18,12 @@ import { App } from '../app';
|
|
|
18
18
|
import { Messaging as TMessaging } from './messaging';
|
|
19
19
|
import { AndroidConfig as TAndroidConfig, AndroidFcmOptions as TAndroidFcmOptions, AndroidNotification as TAndroidNotification, ApnsConfig as TApnsConfig, ApnsFcmOptions as TApnsFcmOptions, ApnsPayload as TApnsPayload, Aps as TAps, ApsAlert as TApsAlert, BatchResponse as TBatchResponse, CriticalSound as TCriticalSound, ConditionMessage as TConditionMessage, FcmOptions as TFcmOptions, LightSettings as TLightSettings, Message as TMessage, MessagingTopicManagementResponse as TMessagingTopicManagementResponse, MulticastMessage as TMulticastMessage, Notification as TNotification, SendResponse as TSendResponse, TokenMessage as TTokenMessage, TopicMessage as TTopicMessage, WebpushConfig as TWebpushConfig, WebpushFcmOptions as TWebpushFcmOptions, WebpushNotification as TWebpushNotification, DataMessagePayload as TDataMessagePayload, MessagingConditionResponse as TMessagingConditionResponse, MessagingDeviceGroupResponse as TMessagingDeviceGroupResponse, MessagingDeviceResult as TMessagingDeviceResult, MessagingDevicesResponse as TMessagingDevicesResponse, MessagingOptions as TMessagingOptions, MessagingPayload as TMessagingPayload, MessagingTopicResponse as TMessagingTopicResponse, NotificationMessagePayload as TNotificationMessagePayload } from './messaging-api';
|
|
20
20
|
/**
|
|
21
|
-
* Gets the {@link messaging
|
|
21
|
+
* Gets the {@link firebase-admin.messaging#Messaging} service for the
|
|
22
22
|
* default app or a given app.
|
|
23
23
|
*
|
|
24
24
|
* `admin.messaging()` can be called with no arguments to access the default
|
|
25
|
-
* app's
|
|
26
|
-
* `
|
|
27
|
-
* {@link messaging.Messaging `Messaging`} service associated with a
|
|
28
|
-
* specific app.
|
|
25
|
+
* app's `Messaging` service or as `admin.messaging(app)` to access the
|
|
26
|
+
* `Messaging` service associated with a specific app.
|
|
29
27
|
*
|
|
30
28
|
* @example
|
|
31
29
|
* ```javascript
|
|
@@ -39,46 +37,145 @@ import { AndroidConfig as TAndroidConfig, AndroidFcmOptions as TAndroidFcmOption
|
|
|
39
37
|
* var otherMessaging = admin.messaging(otherApp);
|
|
40
38
|
* ```
|
|
41
39
|
*
|
|
42
|
-
* @param app Optional app whose `Messaging` service to
|
|
40
|
+
* @param app - Optional app whose `Messaging` service to
|
|
43
41
|
* return. If not provided, the default `Messaging` service will be returned.
|
|
44
42
|
*
|
|
45
|
-
* @
|
|
43
|
+
* @returns The default `Messaging` service if no
|
|
46
44
|
* app is provided or the `Messaging` service associated with the provided
|
|
47
45
|
* app.
|
|
48
46
|
*/
|
|
49
47
|
export declare function messaging(app?: App): messaging.Messaging;
|
|
50
48
|
export declare namespace messaging {
|
|
49
|
+
/**
|
|
50
|
+
* Type alias to {@link firebase-admin.messaging#Messaging}.
|
|
51
|
+
*/
|
|
51
52
|
type Messaging = TMessaging;
|
|
53
|
+
/**
|
|
54
|
+
* Type alias to {@link firebase-admin.messaging#AndroidConfig}.
|
|
55
|
+
*/
|
|
52
56
|
type AndroidConfig = TAndroidConfig;
|
|
57
|
+
/**
|
|
58
|
+
* Type alias to {@link firebase-admin.messaging#AndroidFcmOptions}.
|
|
59
|
+
*/
|
|
53
60
|
type AndroidFcmOptions = TAndroidFcmOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Type alias to {@link firebase-admin.messaging#AndroidNotification}.
|
|
63
|
+
*/
|
|
54
64
|
type AndroidNotification = TAndroidNotification;
|
|
65
|
+
/**
|
|
66
|
+
* Type alias to {@link firebase-admin.messaging#ApnsConfig}.
|
|
67
|
+
*/
|
|
55
68
|
type ApnsConfig = TApnsConfig;
|
|
69
|
+
/**
|
|
70
|
+
* Type alias to {@link firebase-admin.messaging#ApnsFcmOptions}.
|
|
71
|
+
*/
|
|
56
72
|
type ApnsFcmOptions = TApnsFcmOptions;
|
|
73
|
+
/**
|
|
74
|
+
* Type alias to {@link firebase-admin.messaging#ApnsPayload}.
|
|
75
|
+
*/
|
|
57
76
|
type ApnsPayload = TApnsPayload;
|
|
77
|
+
/**
|
|
78
|
+
* Type alias to {@link firebase-admin.messaging#Aps}.
|
|
79
|
+
*/
|
|
58
80
|
type Aps = TAps;
|
|
81
|
+
/**
|
|
82
|
+
* Type alias to {@link firebase-admin.messaging#ApsAlert}.
|
|
83
|
+
*/
|
|
59
84
|
type ApsAlert = TApsAlert;
|
|
85
|
+
/**
|
|
86
|
+
* Type alias to {@link firebase-admin.messaging#BatchResponse}.
|
|
87
|
+
*/
|
|
60
88
|
type BatchResponse = TBatchResponse;
|
|
89
|
+
/**
|
|
90
|
+
* Type alias to {@link firebase-admin.messaging#CriticalSound}.
|
|
91
|
+
*/
|
|
61
92
|
type CriticalSound = TCriticalSound;
|
|
93
|
+
/**
|
|
94
|
+
* Type alias to {@link firebase-admin.messaging#ConditionMessage}.
|
|
95
|
+
*/
|
|
62
96
|
type ConditionMessage = TConditionMessage;
|
|
97
|
+
/**
|
|
98
|
+
* Type alias to {@link firebase-admin.messaging#FcmOptions}.
|
|
99
|
+
*/
|
|
63
100
|
type FcmOptions = TFcmOptions;
|
|
101
|
+
/**
|
|
102
|
+
* Type alias to {@link firebase-admin.messaging#LightSettings}.
|
|
103
|
+
*/
|
|
64
104
|
type LightSettings = TLightSettings;
|
|
105
|
+
/**
|
|
106
|
+
* Type alias to {@link firebase-admin.messaging#Message}.
|
|
107
|
+
*/
|
|
65
108
|
type Message = TMessage;
|
|
109
|
+
/**
|
|
110
|
+
* Type alias to {@link firebase-admin.messaging#MessagingTopicManagementResponse}.
|
|
111
|
+
*/
|
|
66
112
|
type MessagingTopicManagementResponse = TMessagingTopicManagementResponse;
|
|
113
|
+
/**
|
|
114
|
+
* Type alias to {@link firebase-admin.messaging#MulticastMessage}.
|
|
115
|
+
*/
|
|
67
116
|
type MulticastMessage = TMulticastMessage;
|
|
117
|
+
/**
|
|
118
|
+
* Type alias to {@link firebase-admin.messaging#Notification}.
|
|
119
|
+
*/
|
|
68
120
|
type Notification = TNotification;
|
|
121
|
+
/**
|
|
122
|
+
* Type alias to {@link firebase-admin.messaging#SendResponse}.
|
|
123
|
+
*/
|
|
69
124
|
type SendResponse = TSendResponse;
|
|
125
|
+
/**
|
|
126
|
+
* Type alias to {@link firebase-admin.messaging#TokenMessage}.
|
|
127
|
+
*/
|
|
70
128
|
type TokenMessage = TTokenMessage;
|
|
129
|
+
/**
|
|
130
|
+
* Type alias to {@link firebase-admin.messaging#TopicMessage}.
|
|
131
|
+
*/
|
|
71
132
|
type TopicMessage = TTopicMessage;
|
|
133
|
+
/**
|
|
134
|
+
* Type alias to {@link firebase-admin.messaging#WebpushConfig}.
|
|
135
|
+
*/
|
|
72
136
|
type WebpushConfig = TWebpushConfig;
|
|
137
|
+
/**
|
|
138
|
+
* Type alias to {@link firebase-admin.messaging#WebpushFcmOptions}.
|
|
139
|
+
*/
|
|
73
140
|
type WebpushFcmOptions = TWebpushFcmOptions;
|
|
141
|
+
/**
|
|
142
|
+
* Type alias to {@link firebase-admin.messaging#WebpushNotification}.
|
|
143
|
+
*/
|
|
74
144
|
type WebpushNotification = TWebpushNotification;
|
|
145
|
+
/**
|
|
146
|
+
* Type alias to {@link firebase-admin.messaging#DataMessagePayload}.
|
|
147
|
+
*/
|
|
75
148
|
type DataMessagePayload = TDataMessagePayload;
|
|
149
|
+
/**
|
|
150
|
+
* Type alias to {@link firebase-admin.messaging#MessagingConditionResponse}.
|
|
151
|
+
*/
|
|
76
152
|
type MessagingConditionResponse = TMessagingConditionResponse;
|
|
153
|
+
/**
|
|
154
|
+
* Type alias to {@link firebase-admin.messaging#MessagingDeviceGroupResponse}.
|
|
155
|
+
*/
|
|
77
156
|
type MessagingDeviceGroupResponse = TMessagingDeviceGroupResponse;
|
|
157
|
+
/**
|
|
158
|
+
* Type alias to {@link firebase-admin.messaging#MessagingDeviceResult}.
|
|
159
|
+
*/
|
|
78
160
|
type MessagingDeviceResult = TMessagingDeviceResult;
|
|
161
|
+
/**
|
|
162
|
+
* Type alias to {@link firebase-admin.messaging#MessagingDevicesResponse}.
|
|
163
|
+
*/
|
|
79
164
|
type MessagingDevicesResponse = TMessagingDevicesResponse;
|
|
165
|
+
/**
|
|
166
|
+
* Type alias to {@link firebase-admin.messaging#MessagingOptions}.
|
|
167
|
+
*/
|
|
80
168
|
type MessagingOptions = TMessagingOptions;
|
|
169
|
+
/**
|
|
170
|
+
* Type alias to {@link firebase-admin.messaging#MessagingPayload}.
|
|
171
|
+
*/
|
|
81
172
|
type MessagingPayload = TMessagingPayload;
|
|
173
|
+
/**
|
|
174
|
+
* Type alias to {@link firebase-admin.messaging#MessagingTopicResponse}.
|
|
175
|
+
*/
|
|
82
176
|
type MessagingTopicResponse = TMessagingTopicResponse;
|
|
177
|
+
/**
|
|
178
|
+
* Type alias to {@link firebase-admin.messaging#NotificationMessagePayload}.
|
|
179
|
+
*/
|
|
83
180
|
type NotificationMessagePayload = TNotificationMessagePayload;
|
|
84
181
|
}
|
|
@@ -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,21 +25,7 @@ export declare class Messaging {
|
|
|
25
25
|
private readonly appInternal;
|
|
26
26
|
private readonly messagingRequestHandler;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
* current app.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```javascript
|
|
33
|
-
* var messaging = app.messaging();
|
|
34
|
-
* // The above is shorthand for:
|
|
35
|
-
* // var messaging = admin.messaging(app);
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @return The `Messaging` service for the current app.
|
|
39
|
-
*/
|
|
40
|
-
constructor(app: App);
|
|
41
|
-
/**
|
|
42
|
-
* The {@link app.App app} associated with the current `Messaging` service
|
|
28
|
+
* The {@link firebase-admin.app#App} associated with the current `Messaging` service
|
|
43
29
|
* instance.
|
|
44
30
|
*
|
|
45
31
|
* @example
|
|
@@ -51,10 +37,10 @@ export declare class Messaging {
|
|
|
51
37
|
/**
|
|
52
38
|
* Sends the given message via FCM.
|
|
53
39
|
*
|
|
54
|
-
* @param message The message payload.
|
|
55
|
-
* @param dryRun Whether to send the message in the dry-run
|
|
40
|
+
* @param message - The message payload.
|
|
41
|
+
* @param dryRun - Whether to send the message in the dry-run
|
|
56
42
|
* (validation only) mode.
|
|
57
|
-
* @
|
|
43
|
+
* @returns A promise fulfilled with a unique message ID
|
|
58
44
|
* string after the message has been successfully handed off to the FCM
|
|
59
45
|
* service for delivery.
|
|
60
46
|
*/
|
|
@@ -71,11 +57,11 @@ export declare class Messaging {
|
|
|
71
57
|
* the list could be sent. Partial failures are indicated by a `BatchResponse`
|
|
72
58
|
* return value.
|
|
73
59
|
*
|
|
74
|
-
* @param messages A non-empty array
|
|
60
|
+
* @param messages - A non-empty array
|
|
75
61
|
* containing up to 500 messages.
|
|
76
|
-
* @param dryRun Whether to send the messages in the dry-run
|
|
62
|
+
* @param dryRun - Whether to send the messages in the dry-run
|
|
77
63
|
* (validation only) mode.
|
|
78
|
-
* @
|
|
64
|
+
* @returns A Promise fulfilled with an object representing the result of the
|
|
79
65
|
* send operation.
|
|
80
66
|
*/
|
|
81
67
|
sendAll(messages: Message[], dryRun?: boolean): Promise<BatchResponse>;
|
|
@@ -90,11 +76,11 @@ export declare class Messaging {
|
|
|
90
76
|
* not sent to any of the tokens in the list. Partial failures are indicated by
|
|
91
77
|
* a `BatchResponse` return value.
|
|
92
78
|
*
|
|
93
|
-
* @param message A multicast message
|
|
79
|
+
* @param message - A multicast message
|
|
94
80
|
* containing up to 500 tokens.
|
|
95
|
-
* @param dryRun Whether to send the message in the dry-run
|
|
81
|
+
* @param dryRun - Whether to send the message in the dry-run
|
|
96
82
|
* (validation only) mode.
|
|
97
|
-
* @
|
|
83
|
+
* @returns A Promise fulfilled with an object representing the result of the
|
|
98
84
|
* send operation.
|
|
99
85
|
*/
|
|
100
86
|
sendMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
|
|
@@ -102,20 +88,20 @@ export declare class Messaging {
|
|
|
102
88
|
* Sends an FCM message to a single device corresponding to the provided
|
|
103
89
|
* registration token.
|
|
104
90
|
*
|
|
105
|
-
* See
|
|
106
|
-
*
|
|
91
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_individual_devices |
|
|
92
|
+
* Send to individual devices}
|
|
107
93
|
* for code samples and detailed documentation. Takes either a
|
|
108
94
|
* `registrationToken` to send to a single device or a
|
|
109
95
|
* `registrationTokens` parameter containing an array of tokens to send
|
|
110
96
|
* to multiple devices.
|
|
111
97
|
*
|
|
112
|
-
* @param registrationToken A device registration token or an array of
|
|
98
|
+
* @param registrationToken - A device registration token or an array of
|
|
113
99
|
* device registration tokens to which the message should be sent.
|
|
114
|
-
* @param payload The message payload.
|
|
115
|
-
* @param options Optional options to
|
|
100
|
+
* @param payload - The message payload.
|
|
101
|
+
* @param options - Optional options to
|
|
116
102
|
* alter the message.
|
|
117
103
|
*
|
|
118
|
-
* @
|
|
104
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
119
105
|
* has been sent.
|
|
120
106
|
*/
|
|
121
107
|
sendToDevice(registrationTokenOrTokens: string | string[], payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingDevicesResponse>;
|
|
@@ -123,82 +109,80 @@ export declare class Messaging {
|
|
|
123
109
|
* Sends an FCM message to a device group corresponding to the provided
|
|
124
110
|
* notification key.
|
|
125
111
|
*
|
|
126
|
-
* See
|
|
127
|
-
*
|
|
128
|
-
* for code samples and detailed documentation.
|
|
112
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_device_group |
|
|
113
|
+
* Send to a device group} for code samples and detailed documentation.
|
|
129
114
|
*
|
|
130
|
-
* @param notificationKey The notification key for the device group to
|
|
115
|
+
* @param notificationKey - The notification key for the device group to
|
|
131
116
|
* which to send the message.
|
|
132
|
-
* @param payload The message payload.
|
|
133
|
-
* @param options Optional options to
|
|
117
|
+
* @param payload - The message payload.
|
|
118
|
+
* @param options - Optional options to
|
|
134
119
|
* alter the message.
|
|
135
120
|
*
|
|
136
|
-
* @
|
|
121
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
137
122
|
* has been sent.
|
|
138
123
|
*/
|
|
139
124
|
sendToDeviceGroup(notificationKey: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingDeviceGroupResponse>;
|
|
140
125
|
/**
|
|
141
126
|
* Sends an FCM message to a topic.
|
|
142
127
|
*
|
|
143
|
-
* See
|
|
144
|
-
*
|
|
145
|
-
* for code samples and detailed documentation.
|
|
128
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_topic |
|
|
129
|
+
* Send to a topic} for code samples and detailed documentation.
|
|
146
130
|
*
|
|
147
|
-
* @param topic The topic to which to send the message.
|
|
148
|
-
* @param payload The message payload.
|
|
149
|
-
* @param options Optional options to
|
|
131
|
+
* @param topic - The topic to which to send the message.
|
|
132
|
+
* @param payload - The message payload.
|
|
133
|
+
* @param options - Optional options to
|
|
150
134
|
* alter the message.
|
|
151
135
|
*
|
|
152
|
-
* @
|
|
136
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
153
137
|
* has been sent.
|
|
154
138
|
*/
|
|
155
139
|
sendToTopic(topic: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingTopicResponse>;
|
|
156
140
|
/**
|
|
157
141
|
* Sends an FCM message to a condition.
|
|
158
142
|
*
|
|
159
|
-
* See
|
|
160
|
-
*
|
|
143
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_condition |
|
|
144
|
+
* Send to a condition}
|
|
161
145
|
* for code samples and detailed documentation.
|
|
162
146
|
*
|
|
163
|
-
* @param condition The condition determining to which topics to send
|
|
147
|
+
* @param condition - The condition determining to which topics to send
|
|
164
148
|
* the message.
|
|
165
|
-
* @param payload The message payload.
|
|
166
|
-
* @param options Optional options to
|
|
149
|
+
* @param payload - The message payload.
|
|
150
|
+
* @param options - Optional options to
|
|
167
151
|
* alter the message.
|
|
168
152
|
*
|
|
169
|
-
* @
|
|
153
|
+
* @returns A promise fulfilled with the server's response after the message
|
|
170
154
|
* has been sent.
|
|
171
155
|
*/
|
|
172
156
|
sendToCondition(condition: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingConditionResponse>;
|
|
173
157
|
/**
|
|
174
158
|
* Subscribes a device to an FCM topic.
|
|
175
159
|
*
|
|
176
|
-
* See
|
|
177
|
-
* topic
|
|
160
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/manage-topics#suscribe_and_unsubscribe_using_the |
|
|
161
|
+
* Subscribe to a topic}
|
|
178
162
|
* for code samples and detailed documentation. Optionally, you can provide an
|
|
179
163
|
* array of tokens to subscribe multiple devices.
|
|
180
164
|
*
|
|
181
|
-
* @param registrationTokens A token or array of registration tokens
|
|
165
|
+
* @param registrationTokens - A token or array of registration tokens
|
|
182
166
|
* for the devices to subscribe to the topic.
|
|
183
|
-
* @param topic The topic to which to subscribe.
|
|
167
|
+
* @param topic - The topic to which to subscribe.
|
|
184
168
|
*
|
|
185
|
-
* @
|
|
169
|
+
* @returns A promise fulfilled with the server's response after the device has been
|
|
186
170
|
* subscribed to the topic.
|
|
187
171
|
*/
|
|
188
172
|
subscribeToTopic(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
|
|
189
173
|
/**
|
|
190
174
|
* Unsubscribes a device from an FCM topic.
|
|
191
175
|
*
|
|
192
|
-
* See
|
|
193
|
-
* topic
|
|
176
|
+
* See {@link https://firebase.google.com/docs/cloud-messaging/admin/manage-topic-subscriptions#unsubscribe_from_a_topic |
|
|
177
|
+
* Unsubscribe from a topic}
|
|
194
178
|
* for code samples and detailed documentation. Optionally, you can provide an
|
|
195
179
|
* array of tokens to unsubscribe multiple devices.
|
|
196
180
|
*
|
|
197
|
-
* @param registrationTokens A device registration token or an array of
|
|
181
|
+
* @param registrationTokens - A device registration token or an array of
|
|
198
182
|
* device registration tokens to unsubscribe from the topic.
|
|
199
|
-
* @param topic The topic from which to unsubscribe.
|
|
183
|
+
* @param topic - The topic from which to unsubscribe.
|
|
200
184
|
*
|
|
201
|
-
* @
|
|
185
|
+
* @returns A promise fulfilled with the server's response after the device has been
|
|
202
186
|
* unsubscribed from the topic.
|
|
203
187
|
*/
|
|
204
188
|
unsubscribeFromTopic(registrationTokenOrTokens: string | string[], topic: string): Promise<MessagingTopicManagementResponse>;
|
|
@@ -206,80 +190,80 @@ export declare class Messaging {
|
|
|
206
190
|
/**
|
|
207
191
|
* Helper method which sends and handles topic subscription management requests.
|
|
208
192
|
*
|
|
209
|
-
* @param
|
|
193
|
+
* @param registrationTokenOrTokens - The registration token or an array of
|
|
210
194
|
* registration tokens to unsubscribe from the topic.
|
|
211
|
-
* @param
|
|
212
|
-
* @param
|
|
213
|
-
* @param
|
|
195
|
+
* @param topic - The topic to which to subscribe.
|
|
196
|
+
* @param methodName - The name of the original method called.
|
|
197
|
+
* @param path - The endpoint path to use for the request.
|
|
214
198
|
*
|
|
215
|
-
* @
|
|
199
|
+
* @returns A Promise fulfilled with the parsed server
|
|
216
200
|
* response.
|
|
217
201
|
*/
|
|
218
202
|
private sendTopicManagementRequest;
|
|
219
203
|
/**
|
|
220
204
|
* Validates the types of the messaging payload and options. If invalid, an error will be thrown.
|
|
221
205
|
*
|
|
222
|
-
* @param
|
|
223
|
-
* @param
|
|
206
|
+
* @param payload - The messaging payload to validate.
|
|
207
|
+
* @param options - The messaging options to validate.
|
|
224
208
|
*/
|
|
225
209
|
private validateMessagingPayloadAndOptionsTypes;
|
|
226
210
|
/**
|
|
227
211
|
* Validates the messaging payload. If invalid, an error will be thrown.
|
|
228
212
|
*
|
|
229
|
-
* @param
|
|
213
|
+
* @param payload - The messaging payload to validate.
|
|
230
214
|
*
|
|
231
|
-
* @
|
|
215
|
+
* @returns A copy of the provided payload with whitelisted properties switched
|
|
232
216
|
* from camelCase to underscore_case.
|
|
233
217
|
*/
|
|
234
218
|
private validateMessagingPayload;
|
|
235
219
|
/**
|
|
236
220
|
* Validates the messaging options. If invalid, an error will be thrown.
|
|
237
221
|
*
|
|
238
|
-
* @param
|
|
222
|
+
* @param options - The messaging options to validate.
|
|
239
223
|
*
|
|
240
|
-
* @
|
|
224
|
+
* @returns A copy of the provided options with whitelisted properties switched
|
|
241
225
|
* from camelCase to underscore_case.
|
|
242
226
|
*/
|
|
243
227
|
private validateMessagingOptions;
|
|
244
228
|
/**
|
|
245
229
|
* Validates the type of the provided registration token(s). If invalid, an error will be thrown.
|
|
246
230
|
*
|
|
247
|
-
* @param
|
|
248
|
-
* @param
|
|
249
|
-
* @param
|
|
231
|
+
* @param registrationTokenOrTokens - The registration token(s) to validate.
|
|
232
|
+
* @param method - The method name to use in error messages.
|
|
233
|
+
* @param errorInfo - The error info to use if the registration tokens are invalid.
|
|
250
234
|
*/
|
|
251
235
|
private validateRegistrationTokensType;
|
|
252
236
|
/**
|
|
253
237
|
* Validates the provided registration tokens. If invalid, an error will be thrown.
|
|
254
238
|
*
|
|
255
|
-
* @param
|
|
239
|
+
* @param registrationTokenOrTokens - The registration token or an array of
|
|
256
240
|
* registration tokens to validate.
|
|
257
|
-
* @param
|
|
258
|
-
* @param
|
|
241
|
+
* @param method - The method name to use in error messages.
|
|
242
|
+
* @param errorInfo - The error info to use if the registration tokens are invalid.
|
|
259
243
|
*/
|
|
260
244
|
private validateRegistrationTokens;
|
|
261
245
|
/**
|
|
262
246
|
* Validates the type of the provided topic. If invalid, an error will be thrown.
|
|
263
247
|
*
|
|
264
|
-
* @param
|
|
265
|
-
* @param
|
|
266
|
-
* @param
|
|
248
|
+
* @param topic - The topic to validate.
|
|
249
|
+
* @param method - The method name to use in error messages.
|
|
250
|
+
* @param errorInfo - The error info to use if the topic is invalid.
|
|
267
251
|
*/
|
|
268
252
|
private validateTopicType;
|
|
269
253
|
/**
|
|
270
254
|
* Validates the provided topic. If invalid, an error will be thrown.
|
|
271
255
|
*
|
|
272
|
-
* @param
|
|
273
|
-
* @param
|
|
274
|
-
* @param
|
|
256
|
+
* @param topic - The topic to validate.
|
|
257
|
+
* @param method - The method name to use in error messages.
|
|
258
|
+
* @param errorInfo - The error info to use if the topic is invalid.
|
|
275
259
|
*/
|
|
276
260
|
private validateTopic;
|
|
277
261
|
/**
|
|
278
262
|
* Normalizes the provided topic name by prepending it with '/topics/', if necessary.
|
|
279
263
|
*
|
|
280
|
-
* @param
|
|
264
|
+
* @param topic - The topic name to normalize.
|
|
281
265
|
*
|
|
282
|
-
* @
|
|
266
|
+
* @returns The normalized topic name.
|
|
283
267
|
*/
|
|
284
268
|
private normalizeTopic;
|
|
285
269
|
}
|