firebase-admin 12.6.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +1 -2
  2. package/lib/app/core.d.ts +1 -2
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +1 -2
  5. package/lib/app/credential-factory.js +5 -6
  6. package/lib/app/credential-internal.d.ts +37 -35
  7. package/lib/app/credential-internal.js +194 -294
  8. package/lib/app/credential.d.ts +1 -1
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/firebase-app.d.ts +1 -1
  11. package/lib/app/firebase-app.js +1 -1
  12. package/lib/app/firebase-namespace.d.ts +1 -1
  13. package/lib/app/firebase-namespace.js +1 -1
  14. package/lib/app/index.d.ts +1 -1
  15. package/lib/app/index.js +1 -1
  16. package/lib/app/lifecycle.d.ts +1 -1
  17. package/lib/app/lifecycle.js +6 -6
  18. package/lib/app-check/app-check-api-client-internal.d.ts +1 -1
  19. package/lib/app-check/app-check-api-client-internal.js +1 -1
  20. package/lib/app-check/app-check-api.d.ts +1 -1
  21. package/lib/app-check/app-check-api.js +1 -1
  22. package/lib/app-check/app-check-namespace.d.ts +1 -1
  23. package/lib/app-check/app-check-namespace.js +1 -1
  24. package/lib/app-check/app-check.d.ts +1 -1
  25. package/lib/app-check/app-check.js +1 -1
  26. package/lib/app-check/index.d.ts +1 -1
  27. package/lib/app-check/index.js +3 -3
  28. package/lib/app-check/token-generator.d.ts +1 -1
  29. package/lib/app-check/token-generator.js +3 -3
  30. package/lib/app-check/token-verifier.d.ts +1 -1
  31. package/lib/app-check/token-verifier.js +1 -1
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +1 -1
  34. package/lib/auth/auth-api-request.d.ts +1 -1
  35. package/lib/auth/auth-api-request.js +5 -5
  36. package/lib/auth/auth-config.d.ts +41 -17
  37. package/lib/auth/auth-config.js +114 -27
  38. package/lib/auth/auth-namespace.d.ts +1 -1
  39. package/lib/auth/auth-namespace.js +1 -1
  40. package/lib/auth/auth.d.ts +1 -1
  41. package/lib/auth/auth.js +1 -1
  42. package/lib/auth/base-auth.d.ts +1 -1
  43. package/lib/auth/base-auth.js +3 -3
  44. package/lib/auth/identifier.d.ts +1 -1
  45. package/lib/auth/identifier.js +5 -6
  46. package/lib/auth/index.d.ts +2 -2
  47. package/lib/auth/index.js +3 -3
  48. package/lib/auth/project-config-manager.d.ts +1 -1
  49. package/lib/auth/project-config-manager.js +1 -1
  50. package/lib/auth/project-config.d.ts +8 -8
  51. package/lib/auth/project-config.js +9 -9
  52. package/lib/auth/tenant-manager.d.ts +1 -1
  53. package/lib/auth/tenant-manager.js +1 -1
  54. package/lib/auth/tenant.d.ts +4 -4
  55. package/lib/auth/tenant.js +4 -4
  56. package/lib/auth/token-generator.d.ts +1 -2
  57. package/lib/auth/token-generator.js +3 -3
  58. package/lib/auth/token-verifier.d.ts +1 -1
  59. package/lib/auth/token-verifier.js +5 -5
  60. package/lib/auth/user-import-builder.d.ts +1 -2
  61. package/lib/auth/user-import-builder.js +3 -3
  62. package/lib/auth/user-record.d.ts +1 -1
  63. package/lib/auth/user-record.js +1 -1
  64. package/lib/credential/index.d.ts +1 -1
  65. package/lib/credential/index.js +1 -1
  66. package/lib/data-connect/data-connect-api-client-internal.d.ts +1 -1
  67. package/lib/data-connect/data-connect-api-client-internal.js +1 -1
  68. package/lib/data-connect/data-connect-api.d.ts +1 -1
  69. package/lib/data-connect/data-connect-api.js +1 -1
  70. package/lib/data-connect/data-connect.d.ts +1 -1
  71. package/lib/data-connect/data-connect.js +1 -1
  72. package/lib/data-connect/index.d.ts +1 -1
  73. package/lib/data-connect/index.js +3 -3
  74. package/lib/database/database-namespace.d.ts +1 -1
  75. package/lib/database/database-namespace.js +1 -1
  76. package/lib/database/database.d.ts +1 -2
  77. package/lib/database/database.js +1 -1
  78. package/lib/database/index.d.ts +1 -1
  79. package/lib/database/index.js +4 -4
  80. package/lib/default-namespace.d.ts +1 -1
  81. package/lib/default-namespace.js +1 -1
  82. package/lib/eventarc/cloudevent.d.ts +1 -1
  83. package/lib/eventarc/cloudevent.js +1 -1
  84. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  85. package/lib/eventarc/eventarc-client-internal.js +1 -1
  86. package/lib/eventarc/eventarc-utils.d.ts +1 -1
  87. package/lib/eventarc/eventarc-utils.js +3 -3
  88. package/lib/eventarc/eventarc.d.ts +1 -1
  89. package/lib/eventarc/eventarc.js +1 -1
  90. package/lib/eventarc/index.d.ts +1 -1
  91. package/lib/eventarc/index.js +3 -3
  92. package/lib/extensions/extensions-api-client-internal.d.ts +1 -1
  93. package/lib/extensions/extensions-api-client-internal.js +1 -1
  94. package/lib/extensions/extensions-api.d.ts +1 -1
  95. package/lib/extensions/extensions-api.js +1 -1
  96. package/lib/extensions/extensions.d.ts +1 -1
  97. package/lib/extensions/extensions.js +1 -1
  98. package/lib/extensions/index.d.ts +1 -1
  99. package/lib/extensions/index.js +3 -3
  100. package/lib/firebase-namespace-api.d.ts +1 -1
  101. package/lib/firebase-namespace-api.js +1 -1
  102. package/lib/firestore/firestore-internal.d.ts +1 -1
  103. package/lib/firestore/firestore-internal.js +3 -3
  104. package/lib/firestore/firestore-namespace.d.ts +1 -1
  105. package/lib/firestore/firestore-namespace.js +1 -1
  106. package/lib/firestore/index.d.ts +1 -1
  107. package/lib/firestore/index.js +4 -4
  108. package/lib/functions/functions-api-client-internal.d.ts +1 -1
  109. package/lib/functions/functions-api-client-internal.js +7 -6
  110. package/lib/functions/functions-api.d.ts +1 -1
  111. package/lib/functions/functions-api.js +1 -1
  112. package/lib/functions/functions.d.ts +1 -1
  113. package/lib/functions/functions.js +1 -1
  114. package/lib/functions/index.d.ts +1 -1
  115. package/lib/functions/index.js +3 -3
  116. package/lib/index.d.ts +1 -1
  117. package/lib/index.js +1 -1
  118. package/lib/installations/index.d.ts +1 -1
  119. package/lib/installations/index.js +3 -3
  120. package/lib/installations/installations-namespace.d.ts +1 -1
  121. package/lib/installations/installations-namespace.js +1 -1
  122. package/lib/installations/installations-request-handler.d.ts +1 -1
  123. package/lib/installations/installations-request-handler.js +1 -1
  124. package/lib/installations/installations.d.ts +1 -1
  125. package/lib/installations/installations.js +1 -1
  126. package/lib/instance-id/index.d.ts +1 -1
  127. package/lib/instance-id/index.js +3 -3
  128. package/lib/instance-id/instance-id-namespace.d.ts +1 -1
  129. package/lib/instance-id/instance-id-namespace.js +1 -1
  130. package/lib/instance-id/instance-id.d.ts +1 -1
  131. package/lib/instance-id/instance-id.js +1 -1
  132. package/lib/machine-learning/index.d.ts +1 -1
  133. package/lib/machine-learning/index.js +3 -3
  134. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  135. package/lib/machine-learning/machine-learning-api-client.js +3 -3
  136. package/lib/machine-learning/machine-learning-namespace.d.ts +1 -1
  137. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  138. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  139. package/lib/machine-learning/machine-learning-utils.js +1 -1
  140. package/lib/machine-learning/machine-learning.d.ts +1 -1
  141. package/lib/machine-learning/machine-learning.js +1 -1
  142. package/lib/messaging/index.d.ts +2 -2
  143. package/lib/messaging/index.js +3 -3
  144. package/lib/messaging/messaging-api-request-internal.d.ts +2 -12
  145. package/lib/messaging/messaging-api-request-internal.js +4 -38
  146. package/lib/messaging/messaging-api.d.ts +8 -94
  147. package/lib/messaging/messaging-api.js +1 -1
  148. package/lib/messaging/messaging-errors-internal.d.ts +1 -1
  149. package/lib/messaging/messaging-errors-internal.js +3 -4
  150. package/lib/messaging/messaging-internal.d.ts +1 -1
  151. package/lib/messaging/messaging-internal.js +4 -3
  152. package/lib/messaging/messaging-namespace.d.ts +2 -22
  153. package/lib/messaging/messaging-namespace.js +1 -1
  154. package/lib/messaging/messaging.d.ts +3 -149
  155. package/lib/messaging/messaging.js +2 -539
  156. package/lib/project-management/android-app.d.ts +1 -1
  157. package/lib/project-management/android-app.js +1 -1
  158. package/lib/project-management/app-metadata.d.ts +1 -1
  159. package/lib/project-management/app-metadata.js +1 -1
  160. package/lib/project-management/index.d.ts +1 -1
  161. package/lib/project-management/index.js +3 -3
  162. package/lib/project-management/ios-app.d.ts +1 -1
  163. package/lib/project-management/ios-app.js +1 -1
  164. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  165. package/lib/project-management/project-management-api-request-internal.js +3 -3
  166. package/lib/project-management/project-management-namespace.d.ts +1 -1
  167. package/lib/project-management/project-management-namespace.js +1 -1
  168. package/lib/project-management/project-management.d.ts +1 -1
  169. package/lib/project-management/project-management.js +1 -1
  170. package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
  171. package/lib/remote-config/condition-evaluator-internal.js +6 -14
  172. package/lib/remote-config/index.d.ts +1 -1
  173. package/lib/remote-config/index.js +3 -3
  174. package/lib/remote-config/internal/value-impl.d.ts +1 -1
  175. package/lib/remote-config/internal/value-impl.js +1 -1
  176. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  177. package/lib/remote-config/remote-config-api-client-internal.js +1 -1
  178. package/lib/remote-config/remote-config-api.d.ts +1 -1
  179. package/lib/remote-config/remote-config-api.js +1 -1
  180. package/lib/remote-config/remote-config-namespace.d.ts +1 -1
  181. package/lib/remote-config/remote-config-namespace.js +1 -1
  182. package/lib/remote-config/remote-config.d.ts +1 -1
  183. package/lib/remote-config/remote-config.js +1 -1
  184. package/lib/security-rules/index.d.ts +1 -1
  185. package/lib/security-rules/index.js +3 -3
  186. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  187. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  188. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  189. package/lib/security-rules/security-rules-internal.js +1 -1
  190. package/lib/security-rules/security-rules-namespace.d.ts +1 -1
  191. package/lib/security-rules/security-rules-namespace.js +1 -1
  192. package/lib/security-rules/security-rules.d.ts +1 -2
  193. package/lib/security-rules/security-rules.js +1 -1
  194. package/lib/storage/index.d.ts +1 -1
  195. package/lib/storage/index.js +4 -4
  196. package/lib/storage/storage-namespace.d.ts +1 -1
  197. package/lib/storage/storage-namespace.js +1 -1
  198. package/lib/storage/storage.d.ts +1 -1
  199. package/lib/storage/storage.js +1 -1
  200. package/lib/storage/utils.d.ts +1 -1
  201. package/lib/storage/utils.js +2 -3
  202. package/lib/utils/api-request.d.ts +1 -5
  203. package/lib/utils/api-request.js +23 -8
  204. package/lib/utils/crypto-signer.d.ts +1 -2
  205. package/lib/utils/crypto-signer.js +3 -3
  206. package/lib/utils/deep-copy.d.ts +1 -1
  207. package/lib/utils/deep-copy.js +3 -4
  208. package/lib/utils/error.d.ts +1 -1
  209. package/lib/utils/error.js +1 -1
  210. package/lib/utils/index.d.ts +2 -2
  211. package/lib/utils/index.js +19 -16
  212. package/lib/utils/jwt.d.ts +1 -2
  213. package/lib/utils/jwt.js +5 -5
  214. package/lib/utils/validator.d.ts +1 -2
  215. package/lib/utils/validator.js +20 -21
  216. package/package.json +14 -13
  217. package/CHANGELOG.md +0 -4
  218. package/lib/messaging/batch-request-internal.d.ts +0 -55
  219. package/lib/messaging/batch-request-internal.js +0 -127
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -17,15 +17,13 @@
17
17
  */
18
18
  import { App } from '../app';
19
19
  import { Http2SessionHandler } from '../utils/api-request';
20
- import { SubRequest } from './batch-request-internal';
21
- import { SendResponse, BatchResponse } from './messaging-api';
20
+ import { SendResponse } from './messaging-api';
22
21
  /**
23
22
  * Class that provides a mechanism to send requests to the Firebase Cloud Messaging backend.
24
23
  */
25
24
  export declare class FirebaseMessagingRequestHandler {
26
25
  private readonly httpClient;
27
26
  private readonly http2Client;
28
- private readonly batchClient;
29
27
  /**
30
28
  * @param app - The app used to fetch access tokens to sign API requests.
31
29
  * @constructor
@@ -58,14 +56,6 @@ export declare class FirebaseMessagingRequestHandler {
58
56
  * @returns A promise that resolves with the {@link SendResponse}.
59
57
  */
60
58
  invokeHttp2RequestHandlerForSendResponse(host: string, path: string, requestData: object, http2SessionHandler: Http2SessionHandler): Promise<SendResponse>;
61
- /**
62
- * Sends the given array of sub requests as a single batch to FCM, and parses the result into
63
- * a `BatchResponse` object.
64
- *
65
- * @param requests - An array of sub requests to send.
66
- * @returns A promise that resolves when the send operation is complete.
67
- */
68
- sendBatchRequest(requests: SubRequest[]): Promise<BatchResponse>;
69
59
  private buildSendResponse;
70
60
  private buildSendResponseFromError;
71
61
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -20,17 +20,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.FirebaseMessagingRequestHandler = void 0;
21
21
  const api_request_1 = require("../utils/api-request");
22
22
  const messaging_errors_internal_1 = require("./messaging-errors-internal");
23
- const batch_request_internal_1 = require("./batch-request-internal");
24
23
  const index_1 = require("../utils/index");
25
24
  // FCM backend constants
26
25
  const FIREBASE_MESSAGING_TIMEOUT = 15000;
27
- const FIREBASE_MESSAGING_BATCH_URL = 'https://fcm.googleapis.com/batch';
28
26
  const FIREBASE_MESSAGING_HTTP_METHOD = 'POST';
29
27
  const FIREBASE_MESSAGING_HEADERS = {
30
28
  'X-Firebase-Client': `fire-admin-node/${(0, index_1.getSdkVersion)()}`,
31
- };
32
- const LEGACY_FIREBASE_MESSAGING_HEADERS = {
33
- 'X-Firebase-Client': `fire-admin-node/${(0, index_1.getSdkVersion)()}`,
34
29
  'access_token_auth': 'true',
35
30
  };
36
31
  /**
@@ -44,7 +39,6 @@ class FirebaseMessagingRequestHandler {
44
39
  constructor(app) {
45
40
  this.httpClient = new api_request_1.AuthorizedHttpClient(app);
46
41
  this.http2Client = new api_request_1.AuthorizedHttp2Client(app);
47
- this.batchClient = new batch_request_internal_1.BatchRequestClient(this.httpClient, FIREBASE_MESSAGING_BATCH_URL, FIREBASE_MESSAGING_HEADERS);
48
42
  }
49
43
  /**
50
44
  * Invokes the request handler with the provided request data.
@@ -59,7 +53,7 @@ class FirebaseMessagingRequestHandler {
59
53
  method: FIREBASE_MESSAGING_HTTP_METHOD,
60
54
  url: `https://${host}${path}`,
61
55
  data: requestData,
62
- headers: LEGACY_FIREBASE_MESSAGING_HEADERS,
56
+ headers: FIREBASE_MESSAGING_HEADERS,
63
57
  timeout: FIREBASE_MESSAGING_TIMEOUT,
64
58
  };
65
59
  return this.httpClient.send(request).then((response) => {
@@ -96,7 +90,7 @@ class FirebaseMessagingRequestHandler {
96
90
  method: FIREBASE_MESSAGING_HTTP_METHOD,
97
91
  url: `https://${host}${path}`,
98
92
  data: requestData,
99
- headers: LEGACY_FIREBASE_MESSAGING_HEADERS,
93
+ headers: FIREBASE_MESSAGING_HEADERS,
100
94
  timeout: FIREBASE_MESSAGING_TIMEOUT,
101
95
  };
102
96
  return this.httpClient.send(request).then((response) => {
@@ -123,7 +117,7 @@ class FirebaseMessagingRequestHandler {
123
117
  method: FIREBASE_MESSAGING_HTTP_METHOD,
124
118
  url: `https://${host}${path}`,
125
119
  data: requestData,
126
- headers: LEGACY_FIREBASE_MESSAGING_HEADERS,
120
+ headers: FIREBASE_MESSAGING_HEADERS,
127
121
  timeout: FIREBASE_MESSAGING_TIMEOUT,
128
122
  http2SessionHandler: http2SessionHandler
129
123
  };
@@ -138,34 +132,6 @@ class FirebaseMessagingRequestHandler {
138
132
  throw err;
139
133
  });
140
134
  }
141
- /**
142
- * Sends the given array of sub requests as a single batch to FCM, and parses the result into
143
- * a `BatchResponse` object.
144
- *
145
- * @param requests - An array of sub requests to send.
146
- * @returns A promise that resolves when the send operation is complete.
147
- */
148
- sendBatchRequest(requests) {
149
- return this.batchClient.send(requests)
150
- .then((responses) => {
151
- return responses.map((part) => {
152
- return this.buildSendResponse(part);
153
- });
154
- }).then((responses) => {
155
- const successCount = responses.filter((resp) => resp.success).length;
156
- return {
157
- responses,
158
- successCount,
159
- failureCount: responses.length - successCount,
160
- };
161
- }).catch((err) => {
162
- if (err instanceof api_request_1.RequestResponseError) {
163
- throw (0, messaging_errors_internal_1.createFirebaseError)(err);
164
- }
165
- // Re-throw the error if it already has the proper format.
166
- throw err;
167
- });
168
- }
169
135
  buildSendResponse(response) {
170
136
  const result = {
171
137
  success: response.status === 200,
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2021 Google Inc.
@@ -41,7 +41,7 @@ export interface ConditionMessage extends BaseMessage {
41
41
  */
42
42
  export type Message = TokenMessage | TopicMessage | ConditionMessage;
43
43
  /**
44
- * Payload for the {@link Messaging.sendMulticast} method. The payload contains all the fields
44
+ * Payload for the {@link Messaging.sendEachForMulticast} method. The payload contains all the fields
45
45
  * in the BaseMessage type, and a list of tokens.
46
46
  */
47
47
  export interface MulticastMessage extends BaseMessage {
@@ -364,6 +364,11 @@ export interface AndroidConfig {
364
364
  * Options for features provided by the FCM SDK for Android.
365
365
  */
366
366
  fcmOptions?: AndroidFcmOptions;
367
+ /**
368
+ * A boolean indicating whether messages will be allowed to be delivered to
369
+ * the app while the device is in direct boot mode.
370
+ */
371
+ directBootOk?: boolean;
367
372
  }
368
373
  /**
369
374
  * Represents the Android-specific notification options that can be included in
@@ -830,97 +835,6 @@ export interface MessagingOptions {
830
835
  restrictedPackageName?: string;
831
836
  [key: string]: any | undefined;
832
837
  }
833
- /**
834
- * Individual status response payload from single devices
835
- *
836
- * @deprecated Returned by {@link Messaging#sendToDevice}, which is also deprecated.
837
- */
838
- export interface MessagingDeviceResult {
839
- /**
840
- * The error that occurred when processing the message for the recipient.
841
- */
842
- error?: FirebaseError;
843
- /**
844
- * A unique ID for the successfully processed message.
845
- */
846
- messageId?: string;
847
- /**
848
- * The canonical registration token for the client app that the message was
849
- * processed and sent to. You should use this value as the registration token
850
- * for future requests. Otherwise, future messages might be rejected.
851
- */
852
- canonicalRegistrationToken?: string;
853
- }
854
- /**
855
- * Interface representing the status of a message sent to an individual device
856
- * via the FCM legacy APIs.
857
- *
858
- * See
859
- * {@link https://firebase.google.com/docs/cloud-messaging/admin/send-messages#send_to_individual_devices |
860
- * Send to individual devices} for code samples and detailed documentation.
861
- *
862
- * @deprecated Returned by {@link Messaging.sendToDevice}, which is also deprecated.
863
- */
864
- export interface MessagingDevicesResponse {
865
- canonicalRegistrationTokenCount: number;
866
- failureCount: number;
867
- multicastId: number;
868
- results: MessagingDeviceResult[];
869
- successCount: number;
870
- }
871
- /**
872
- * Interface representing the server response from the {@link Messaging.sendToDeviceGroup}
873
- * method.
874
- *
875
- * See
876
- * {@link https://firebase.google.com/docs/cloud-messaging/send-message?authuser=0#send_messages_to_device_groups |
877
- * Send messages to device groups} for code samples and detailed documentation.
878
- *
879
- * @deprecated Returned by {@link Messaging.sendToDeviceGroup}, which is also deprecated.
880
- */
881
- export interface MessagingDeviceGroupResponse {
882
- /**
883
- * The number of messages that could not be processed and resulted in an error.
884
- */
885
- successCount: number;
886
- /**
887
- * The number of messages that could not be processed and resulted in an error.
888
- */
889
- failureCount: number;
890
- /**
891
- * An array of registration tokens that failed to receive the message.
892
- */
893
- failedRegistrationTokens: string[];
894
- }
895
- /**
896
- * Interface representing the server response from the legacy {@link Messaging.sendToTopic} method.
897
- *
898
- * See
899
- * {@link https://firebase.google.com/docs/cloud-messaging/admin/send-messages#send_to_a_topic |
900
- * Send to a topic} for code samples and detailed documentation.
901
- */
902
- export interface MessagingTopicResponse {
903
- /**
904
- * The message ID for a successfully received request which FCM will attempt to
905
- * deliver to all subscribed devices.
906
- */
907
- messageId: number;
908
- }
909
- /**
910
- * Interface representing the server response from the legacy
911
- * {@link Messaging.sendToCondition} method.
912
- *
913
- * See
914
- * {@link https://firebase.google.com/docs/cloud-messaging/admin/send-messages#send_to_a_condition |
915
- * Send to a condition} for code samples and detailed documentation.
916
- */
917
- export interface MessagingConditionResponse {
918
- /**
919
- * The message ID for a successfully received request which FCM will attempt to
920
- * deliver to all subscribed devices.
921
- */
922
- messageId: number;
923
- }
924
838
  /**
925
839
  * Interface representing the server response from the
926
840
  * {@link Messaging.subscribeToTopic} and {@link Messaging.unsubscribeFromTopic}
@@ -949,7 +863,7 @@ export interface MessagingTopicManagementResponse {
949
863
  }
950
864
  /**
951
865
  * Interface representing the server response from the
952
- * {@link Messaging.sendAll} and {@link Messaging.sendMulticast} methods.
866
+ * {@link Messaging.sendEach} and {@link Messaging.sendEachForMulticast} methods.
953
867
  */
954
868
  export interface BatchResponse {
955
869
  /**
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * @license
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * Copyright 2019 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2019 Google Inc.
@@ -16,7 +16,8 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.getErrorCode = exports.createFirebaseError = void 0;
19
+ exports.createFirebaseError = createFirebaseError;
20
+ exports.getErrorCode = getErrorCode;
20
21
  const error_1 = require("../utils/error");
21
22
  const validator = require("../utils/validator");
22
23
  /**
@@ -60,7 +61,6 @@ function createFirebaseError(err) {
60
61
  `${err.response.status}.`,
61
62
  });
62
63
  }
63
- exports.createFirebaseError = createFirebaseError;
64
64
  /**
65
65
  * @param response - The response to check for errors.
66
66
  * @returns The error code if present; null otherwise.
@@ -88,7 +88,6 @@ function getErrorCode(response) {
88
88
  }
89
89
  return null;
90
90
  }
91
- exports.getErrorCode = getErrorCode;
92
91
  /**
93
92
  * Extracts error message from the given response object.
94
93
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -16,7 +16,8 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.validateMessage = exports.BLACKLISTED_OPTIONS_KEYS = exports.BLACKLISTED_DATA_PAYLOAD_KEYS = void 0;
19
+ exports.BLACKLISTED_OPTIONS_KEYS = exports.BLACKLISTED_DATA_PAYLOAD_KEYS = void 0;
20
+ exports.validateMessage = validateMessage;
20
21
  const index_1 = require("../utils/index");
21
22
  const error_1 = require("../utils/error");
22
23
  const validator = require("../utils/validator");
@@ -59,7 +60,6 @@ function validateMessage(message) {
59
60
  validateFcmOptions(message.fcmOptions);
60
61
  validateNotification(message.notification);
61
62
  }
62
- exports.validateMessage = validateMessage;
63
63
  /**
64
64
  * Checks if the given object only contains strings as child values.
65
65
  *
@@ -337,6 +337,7 @@ function validateAndroidConfig(config) {
337
337
  const propertyMappings = {
338
338
  collapseKey: 'collapse_key',
339
339
  restrictedPackageName: 'restricted_package_name',
340
+ directBootOk: 'direct_boot_ok',
340
341
  };
341
342
  (0, index_1.renameProperties)(config, propertyMappings);
342
343
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * Copyright 2021 Google Inc.
4
4
  *
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { App } from '../app';
18
18
  import { Messaging as TMessaging } from './messaging';
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';
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, MessagingOptions as TMessagingOptions, MessagingPayload as TMessagingPayload, NotificationMessagePayload as TNotificationMessagePayload } from './messaging-api';
20
20
  /**
21
21
  * Gets the {@link firebase-admin.messaging#Messaging} service for the
22
22
  * default app or a given app.
@@ -146,22 +146,6 @@ export declare namespace messaging {
146
146
  * Type alias to {@link firebase-admin.messaging#DataMessagePayload}.
147
147
  */
148
148
  type DataMessagePayload = TDataMessagePayload;
149
- /**
150
- * Type alias to {@link firebase-admin.messaging#MessagingConditionResponse}.
151
- */
152
- type MessagingConditionResponse = TMessagingConditionResponse;
153
- /**
154
- * Type alias to {@link firebase-admin.messaging#MessagingDeviceGroupResponse}.
155
- */
156
- type MessagingDeviceGroupResponse = TMessagingDeviceGroupResponse;
157
- /**
158
- * Type alias to {@link firebase-admin.messaging#MessagingDeviceResult}.
159
- */
160
- type MessagingDeviceResult = TMessagingDeviceResult;
161
- /**
162
- * Type alias to {@link firebase-admin.messaging#MessagingDevicesResponse}.
163
- */
164
- type MessagingDevicesResponse = TMessagingDevicesResponse;
165
149
  /**
166
150
  * Type alias to {@link firebase-admin.messaging#MessagingOptions}.
167
151
  */
@@ -170,10 +154,6 @@ export declare namespace messaging {
170
154
  * Type alias to {@link firebase-admin.messaging#MessagingPayload}.
171
155
  */
172
156
  type MessagingPayload = TMessagingPayload;
173
- /**
174
- * Type alias to {@link firebase-admin.messaging#MessagingTopicResponse}.
175
- */
176
- type MessagingTopicResponse = TMessagingTopicResponse;
177
157
  /**
178
158
  * Type alias to {@link firebase-admin.messaging#NotificationMessagePayload}.
179
159
  */
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v12.6.0 */
1
+ /*! firebase-admin v13.0.0 */
2
2
  /*!
3
3
  * @license
4
4
  * Copyright 2017 Google Inc.
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  import { App } from '../app';
19
- import { BatchResponse, Message, MessagingTopicManagementResponse, MulticastMessage, MessagingDevicesResponse, MessagingDeviceGroupResponse, MessagingPayload, MessagingOptions, MessagingTopicResponse, MessagingConditionResponse } from './messaging-api';
19
+ import { BatchResponse, Message, MessagingTopicManagementResponse, MulticastMessage } from './messaging-api';
20
20
  /**
21
21
  * Messaging service bound to the provided app.
22
22
  */
@@ -63,7 +63,7 @@ export declare class Messaging {
63
63
  /**
64
64
  * Sends each message in the given array via Firebase Cloud Messaging.
65
65
  *
66
- * Unlike {@link Messaging.sendAll}, this method makes a single RPC call for each message
66
+ * This method makes a single RPC call for each message
67
67
  * in the given array.
68
68
  *
69
69
  * The responses list obtained from the return value corresponds to the order of `messages`.
@@ -98,127 +98,6 @@ export declare class Messaging {
98
98
  * send operation.
99
99
  */
100
100
  sendEachForMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
101
- /**
102
- * Sends all the messages in the given array via Firebase Cloud Messaging.
103
- * Employs batching to send the entire list as a single RPC call. Compared
104
- * to the `send()` method, this method is a significantly more efficient way
105
- * to send multiple messages.
106
- *
107
- * The responses list obtained from the return value
108
- * corresponds to the order of tokens in the `MulticastMessage`. An error
109
- * from this method indicates a total failure, meaning that none of the messages
110
- * in the list could be sent. Partial failures are indicated by a `BatchResponse`
111
- * return value.
112
- *
113
- * @param messages - A non-empty array
114
- * containing up to 500 messages.
115
- * @param dryRun - Whether to send the messages in the dry-run
116
- * (validation only) mode.
117
- * @returns A Promise fulfilled with an object representing the result of the
118
- * send operation.
119
- *
120
- * @deprecated Use {@link Messaging.sendEach} instead.
121
- */
122
- sendAll(messages: Message[], dryRun?: boolean): Promise<BatchResponse>;
123
- /**
124
- * Sends the given multicast message to all the FCM registration tokens
125
- * specified in it.
126
- *
127
- * This method uses the `sendAll()` API under the hood to send the given
128
- * message to all the target recipients. The responses list obtained from the
129
- * return value corresponds to the order of tokens in the `MulticastMessage`.
130
- * An error from this method indicates a total failure, meaning that the message
131
- * was not sent to any of the tokens in the list. Partial failures are indicated
132
- * by a `BatchResponse` return value.
133
- *
134
- * @param message - A multicast message
135
- * containing up to 500 tokens.
136
- * @param dryRun - Whether to send the message in the dry-run
137
- * (validation only) mode.
138
- * @returns A Promise fulfilled with an object representing the result of the
139
- * send operation.
140
- *
141
- * @deprecated Use {@link Messaging.sendEachForMulticast} instead.
142
- */
143
- sendMulticast(message: MulticastMessage, dryRun?: boolean): Promise<BatchResponse>;
144
- /**
145
- * Sends an FCM message to a single device corresponding to the provided
146
- * registration token.
147
- *
148
- * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_individual_devices |
149
- * Send to individual devices}
150
- * for code samples and detailed documentation. Takes either a
151
- * `registrationToken` to send to a single device or a
152
- * `registrationTokens` parameter containing an array of tokens to send
153
- * to multiple devices.
154
- *
155
- * @param registrationToken - A device registration token or an array of
156
- * device registration tokens to which the message should be sent.
157
- * @param payload - The message payload.
158
- * @param options - Optional options to
159
- * alter the message.
160
- *
161
- * @returns A promise fulfilled with the server's response after the message
162
- * has been sent.
163
- *
164
- * @deprecated Use {@link Messaging.send} instead.
165
- */
166
- sendToDevice(registrationTokenOrTokens: string | string[], payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingDevicesResponse>;
167
- /**
168
- * Sends an FCM message to a device group corresponding to the provided
169
- * notification key.
170
- *
171
- * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_device_group |
172
- * Send to a device group} for code samples and detailed documentation.
173
- *
174
- * @param notificationKey - The notification key for the device group to
175
- * which to send the message.
176
- * @param payload - The message payload.
177
- * @param options - Optional options to
178
- * alter the message.
179
- *
180
- * @returns A promise fulfilled with the server's response after the message
181
- * has been sent.
182
- *
183
- * @deprecated Use {@link Messaging.send} instead.
184
- */
185
- sendToDeviceGroup(notificationKey: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingDeviceGroupResponse>;
186
- /**
187
- * Sends an FCM message to a topic.
188
- *
189
- * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_topic |
190
- * Send to a topic} for code samples and detailed documentation.
191
- *
192
- * @param topic - The topic to which to send the message.
193
- * @param payload - The message payload.
194
- * @param options - Optional options to
195
- * alter the message.
196
- *
197
- * @returns A promise fulfilled with the server's response after the message
198
- * has been sent.
199
- *
200
- * @deprecated Use {@link Messaging.send} instead.
201
- */
202
- sendToTopic(topic: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingTopicResponse>;
203
- /**
204
- * Sends an FCM message to a condition.
205
- *
206
- * See {@link https://firebase.google.com/docs/cloud-messaging/admin/legacy-fcm#send_to_a_condition |
207
- * Send to a condition}
208
- * for code samples and detailed documentation.
209
- *
210
- * @param condition - The condition determining to which topics to send
211
- * the message.
212
- * @param payload - The message payload.
213
- * @param options - Optional options to
214
- * alter the message.
215
- *
216
- * @returns A promise fulfilled with the server's response after the message
217
- * has been sent.
218
- *
219
- * @deprecated Use {@link Messaging.send} instead.
220
- */
221
- sendToCondition(condition: string, payload: MessagingPayload, options?: MessagingOptions): Promise<MessagingConditionResponse>;
222
101
  /**
223
102
  * Subscribes a device to an FCM topic.
224
103
  *
@@ -265,31 +144,6 @@ export declare class Messaging {
265
144
  * response.
266
145
  */
267
146
  private sendTopicManagementRequest;
268
- /**
269
- * Validates the types of the messaging payload and options. If invalid, an error will be thrown.
270
- *
271
- * @param payload - The messaging payload to validate.
272
- * @param options - The messaging options to validate.
273
- */
274
- private validateMessagingPayloadAndOptionsTypes;
275
- /**
276
- * Validates the messaging payload. If invalid, an error will be thrown.
277
- *
278
- * @param payload - The messaging payload to validate.
279
- *
280
- * @returns A copy of the provided payload with whitelisted properties switched
281
- * from camelCase to underscore_case.
282
- */
283
- private validateMessagingPayload;
284
- /**
285
- * Validates the messaging options. If invalid, an error will be thrown.
286
- *
287
- * @param options - The messaging options to validate.
288
- *
289
- * @returns A copy of the provided options with whitelisted properties switched
290
- * from camelCase to underscore_case.
291
- */
292
- private validateMessagingOptions;
293
147
  /**
294
148
  * Validates the type of the provided registration token(s). If invalid, an error will be thrown.
295
149
  *