firebase-admin 13.9.0 → 14.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 (281) hide show
  1. package/README.md +1 -2
  2. package/lib/app/core.d.ts +2 -38
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +1 -1
  5. package/lib/app/credential-factory.js +1 -1
  6. package/lib/app/credential-internal.d.ts +1 -1
  7. package/lib/app/credential-internal.js +48 -17
  8. package/lib/app/credential.d.ts +1 -1
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/error.d.ts +47 -0
  11. package/lib/app/error.js +57 -0
  12. package/lib/app/firebase-app.d.ts +1 -1
  13. package/lib/app/firebase-app.js +28 -12
  14. package/lib/app/index.d.ts +4 -3
  15. package/lib/app/index.js +6 -4
  16. package/lib/app/lifecycle.d.ts +2 -2
  17. package/lib/app/lifecycle.js +46 -21
  18. package/lib/app-check/app-check-api-client-internal.d.ts +2 -16
  19. package/lib/app-check/app-check-api-client-internal.js +71 -47
  20. package/lib/app-check/app-check-api.d.ts +19 -1
  21. package/lib/app-check/app-check-api.js +1 -1
  22. package/lib/app-check/app-check.d.ts +1 -1
  23. package/lib/app-check/app-check.js +7 -3
  24. package/lib/app-check/error.d.ts +47 -0
  25. package/lib/app-check/error.js +65 -0
  26. package/lib/app-check/index.d.ts +2 -1
  27. package/lib/app-check/index.js +5 -2
  28. package/lib/app-check/token-generator.d.ts +1 -1
  29. package/lib/app-check/token-generator.js +43 -13
  30. package/lib/app-check/token-verifier.d.ts +1 -1
  31. package/lib/app-check/token-verifier.js +39 -11
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +16 -16
  34. package/lib/auth/auth-api-request.d.ts +6 -4
  35. package/lib/auth/auth-api-request.js +277 -166
  36. package/lib/auth/auth-config.d.ts +31 -2
  37. package/lib/auth/auth-config.js +103 -103
  38. package/lib/auth/auth.d.ts +1 -1
  39. package/lib/auth/auth.js +1 -1
  40. package/lib/auth/base-auth.d.ts +2 -1
  41. package/lib/auth/base-auth.js +29 -27
  42. package/lib/auth/error.d.ts +137 -0
  43. package/lib/auth/error.js +690 -0
  44. package/lib/auth/identifier.d.ts +1 -1
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +2 -2
  47. package/lib/auth/index.js +4 -4
  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 +1 -1
  51. package/lib/auth/project-config.js +4 -4
  52. package/lib/auth/tenant-manager.d.ts +2 -1
  53. package/lib/auth/tenant-manager.js +13 -10
  54. package/lib/auth/tenant.d.ts +1 -1
  55. package/lib/auth/tenant.js +7 -7
  56. package/lib/auth/token-generator.d.ts +1 -1
  57. package/lib/auth/token-generator.js +13 -13
  58. package/lib/auth/token-verifier.d.ts +1 -1
  59. package/lib/auth/token-verifier.js +22 -22
  60. package/lib/auth/user-import-builder.d.ts +1 -1
  61. package/lib/auth/user-import-builder.js +22 -22
  62. package/lib/auth/user-record.d.ts +1 -1
  63. package/lib/auth/user-record.js +6 -6
  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 -16
  67. package/lib/data-connect/data-connect-api-client-internal.js +122 -65
  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/error.d.ts +47 -0
  73. package/lib/data-connect/error.js +66 -0
  74. package/lib/data-connect/index.d.ts +2 -1
  75. package/lib/data-connect/index.js +5 -2
  76. package/lib/data-connect/validate-admin-args.d.ts +1 -1
  77. package/lib/data-connect/validate-admin-args.js +6 -3
  78. package/lib/database/database.d.ts +1 -1
  79. package/lib/database/database.js +11 -6
  80. package/lib/database/error.d.ts +39 -0
  81. package/lib/database/error.js +49 -0
  82. package/lib/database/index.d.ts +2 -2
  83. package/lib/database/index.js +4 -3
  84. package/lib/esm/app/index.js +2 -1
  85. package/lib/esm/app-check/index.js +2 -0
  86. package/lib/esm/auth/index.js +1 -1
  87. package/lib/esm/data-connect/index.js +2 -0
  88. package/lib/esm/database/index.js +1 -0
  89. package/lib/esm/eventarc/index.js +2 -0
  90. package/lib/esm/extensions/index.js +2 -0
  91. package/lib/esm/firebase-admin/index.js +13 -0
  92. package/lib/esm/firestore/index.js +1 -0
  93. package/lib/esm/functions/index.js +2 -0
  94. package/lib/esm/installations/index.js +1 -1
  95. package/lib/esm/machine-learning/index.js +2 -0
  96. package/lib/esm/messaging/index.js +1 -1
  97. package/lib/esm/phone-number-verification/index.js +2 -0
  98. package/lib/esm/project-management/index.js +1 -0
  99. package/lib/esm/remote-config/index.js +2 -0
  100. package/lib/esm/security-rules/index.js +2 -0
  101. package/lib/esm/storage/index.js +2 -0
  102. package/lib/eventarc/cloudevent.d.ts +1 -1
  103. package/lib/eventarc/cloudevent.js +1 -1
  104. package/lib/eventarc/error.d.ts +38 -0
  105. package/lib/eventarc/error.js +47 -0
  106. package/lib/eventarc/eventarc-client-internal.d.ts +1 -1
  107. package/lib/eventarc/eventarc-client-internal.js +24 -9
  108. package/lib/eventarc/eventarc-utils.d.ts +1 -13
  109. package/lib/eventarc/eventarc-utils.js +36 -26
  110. package/lib/eventarc/eventarc.d.ts +1 -1
  111. package/lib/eventarc/eventarc.js +18 -6
  112. package/lib/eventarc/index.d.ts +2 -1
  113. package/lib/eventarc/index.js +5 -2
  114. package/lib/extensions/error.d.ts +41 -0
  115. package/lib/extensions/error.js +50 -0
  116. package/lib/extensions/extensions-api-client-internal.d.ts +1 -13
  117. package/lib/extensions/extensions-api-client-internal.js +40 -28
  118. package/lib/extensions/extensions-api.d.ts +1 -1
  119. package/lib/extensions/extensions-api.js +1 -1
  120. package/lib/extensions/extensions.d.ts +1 -1
  121. package/lib/extensions/extensions.js +18 -5
  122. package/lib/extensions/index.d.ts +2 -1
  123. package/lib/extensions/index.js +5 -2
  124. package/lib/firestore/error.d.ts +41 -0
  125. package/lib/firestore/error.js +51 -0
  126. package/lib/firestore/firestore-internal.d.ts +2 -1
  127. package/lib/firestore/firestore-internal.js +6 -6
  128. package/lib/firestore/index.d.ts +2 -2
  129. package/lib/firestore/index.js +7 -7
  130. package/lib/functions/error.d.ts +48 -0
  131. package/lib/functions/error.js +67 -0
  132. package/lib/functions/functions-api-client-internal.d.ts +1 -16
  133. package/lib/functions/functions-api-client-internal.js +111 -71
  134. package/lib/functions/functions-api.d.ts +1 -1
  135. package/lib/functions/functions-api.js +1 -1
  136. package/lib/functions/functions.d.ts +1 -1
  137. package/lib/functions/functions.js +14 -4
  138. package/lib/functions/index.d.ts +2 -1
  139. package/lib/functions/index.js +5 -2
  140. package/lib/index.d.ts +13 -8
  141. package/lib/index.js +19 -3
  142. package/lib/installations/error.d.ts +48 -0
  143. package/lib/installations/error.js +73 -0
  144. package/lib/installations/index.d.ts +2 -2
  145. package/lib/installations/index.js +4 -4
  146. package/lib/installations/installations-request-handler.d.ts +1 -1
  147. package/lib/installations/installations-request-handler.js +11 -5
  148. package/lib/installations/installations.d.ts +1 -1
  149. package/lib/installations/installations.js +3 -3
  150. package/lib/machine-learning/error.d.ts +53 -0
  151. package/lib/machine-learning/error.js +84 -0
  152. package/lib/machine-learning/index.d.ts +2 -1
  153. package/lib/machine-learning/index.js +5 -2
  154. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  155. package/lib/machine-learning/machine-learning-api-client.js +61 -24
  156. package/lib/machine-learning/machine-learning.d.ts +1 -1
  157. package/lib/machine-learning/machine-learning.js +21 -9
  158. package/lib/messaging/error.d.ts +63 -0
  159. package/lib/messaging/error.js +286 -0
  160. package/lib/messaging/index.d.ts +3 -3
  161. package/lib/messaging/index.js +4 -4
  162. package/lib/messaging/messaging-api-request-internal.d.ts +1 -1
  163. package/lib/messaging/messaging-api-request-internal.js +1 -1
  164. package/lib/messaging/messaging-api.d.ts +1 -280
  165. package/lib/messaging/messaging-api.js +1 -1
  166. package/lib/messaging/messaging-errors-internal.d.ts +2 -2
  167. package/lib/messaging/messaging-errors-internal.js +11 -8
  168. package/lib/messaging/messaging-internal.d.ts +1 -1
  169. package/lib/messaging/messaging-internal.js +48 -48
  170. package/lib/messaging/messaging.d.ts +1 -1
  171. package/lib/messaging/messaging.js +47 -50
  172. package/lib/phone-number-verification/error.d.ts +43 -0
  173. package/lib/phone-number-verification/error.js +48 -0
  174. package/lib/phone-number-verification/index.d.ts +2 -1
  175. package/lib/phone-number-verification/index.js +5 -2
  176. package/lib/phone-number-verification/phone-number-verification-api-client-internal.d.ts +1 -18
  177. package/lib/phone-number-verification/phone-number-verification-api-client-internal.js +2 -26
  178. package/lib/phone-number-verification/phone-number-verification-api.d.ts +2 -2
  179. package/lib/phone-number-verification/phone-number-verification-api.js +5 -4
  180. package/lib/phone-number-verification/phone-number-verification.d.ts +1 -1
  181. package/lib/phone-number-verification/phone-number-verification.js +1 -1
  182. package/lib/phone-number-verification/token-verifier.d.ts +1 -1
  183. package/lib/phone-number-verification/token-verifier.js +68 -20
  184. package/lib/project-management/android-app.d.ts +1 -1
  185. package/lib/project-management/android-app.js +15 -6
  186. package/lib/project-management/app-metadata.d.ts +1 -1
  187. package/lib/project-management/app-metadata.js +1 -1
  188. package/lib/project-management/error.d.ts +45 -0
  189. package/lib/project-management/error.js +55 -0
  190. package/lib/project-management/index.d.ts +2 -2
  191. package/lib/project-management/index.js +4 -3
  192. package/lib/project-management/ios-app.d.ts +1 -1
  193. package/lib/project-management/ios-app.js +6 -3
  194. package/lib/project-management/project-management-api-request-internal.d.ts +1 -1
  195. package/lib/project-management/project-management-api-request-internal.js +18 -6
  196. package/lib/project-management/project-management.d.ts +1 -1
  197. package/lib/project-management/project-management.js +13 -7
  198. package/lib/remote-config/condition-evaluator-internal.d.ts +1 -1
  199. package/lib/remote-config/condition-evaluator-internal.js +4 -4
  200. package/lib/remote-config/error.d.ts +49 -0
  201. package/lib/remote-config/error.js +70 -0
  202. package/lib/remote-config/index.d.ts +2 -1
  203. package/lib/remote-config/index.js +5 -2
  204. package/lib/remote-config/internal/value-impl.d.ts +1 -1
  205. package/lib/remote-config/internal/value-impl.js +1 -1
  206. package/lib/remote-config/remote-config-api-client-internal.d.ts +2 -13
  207. package/lib/remote-config/remote-config-api-client-internal.js +80 -52
  208. package/lib/remote-config/remote-config-api.d.ts +1 -1
  209. package/lib/remote-config/remote-config-api.js +1 -1
  210. package/lib/remote-config/remote-config.d.ts +1 -1
  211. package/lib/remote-config/remote-config.js +92 -23
  212. package/lib/security-rules/error.d.ts +45 -0
  213. package/lib/security-rules/error.js +54 -0
  214. package/lib/security-rules/index.d.ts +2 -1
  215. package/lib/security-rules/index.js +5 -2
  216. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  217. package/lib/security-rules/security-rules-api-client-internal.js +50 -18
  218. package/lib/security-rules/security-rules.d.ts +1 -1
  219. package/lib/security-rules/security-rules.js +32 -11
  220. package/lib/storage/error.d.ts +41 -0
  221. package/lib/storage/error.js +50 -0
  222. package/lib/storage/index.d.ts +2 -1
  223. package/lib/storage/index.js +8 -5
  224. package/lib/storage/storage.d.ts +1 -1
  225. package/lib/storage/storage.js +12 -12
  226. package/lib/storage/utils.d.ts +1 -1
  227. package/lib/storage/utils.js +1 -1
  228. package/lib/utils/api-request.d.ts +12 -12
  229. package/lib/utils/api-request.js +97 -55
  230. package/lib/utils/crypto-signer.d.ts +1 -1
  231. package/lib/utils/crypto-signer.js +2 -7
  232. package/lib/utils/deep-copy.d.ts +1 -1
  233. package/lib/utils/deep-copy.js +1 -1
  234. package/lib/utils/error.d.ts +75 -570
  235. package/lib/utils/error.js +53 -1047
  236. package/lib/utils/index.d.ts +1 -1
  237. package/lib/utils/index.js +2 -2
  238. package/lib/utils/jwt.d.ts +1 -1
  239. package/lib/utils/jwt.js +1 -2
  240. package/lib/utils/validator.d.ts +1 -1
  241. package/lib/utils/validator.js +1 -1
  242. package/package.json +25 -33
  243. package/lib/app/firebase-namespace.d.ts +0 -163
  244. package/lib/app/firebase-namespace.js +0 -335
  245. package/lib/app-check/app-check-namespace.d.ts +0 -72
  246. package/lib/app-check/app-check-namespace.js +0 -18
  247. package/lib/auth/auth-namespace.d.ts +0 -257
  248. package/lib/auth/auth-namespace.js +0 -18
  249. package/lib/database/database-namespace.d.ts +0 -95
  250. package/lib/database/database-namespace.js +0 -23
  251. package/lib/default-namespace.d.ts +0 -24
  252. package/lib/default-namespace.js +0 -30
  253. package/lib/esm/instance-id/index.js +0 -6
  254. package/lib/firebase-namespace-api.d.ts +0 -91
  255. package/lib/firebase-namespace-api.js +0 -58
  256. package/lib/firestore/firestore-namespace.d.ts +0 -71
  257. package/lib/firestore/firestore-namespace.js +0 -52
  258. package/lib/installations/installations-namespace.d.ts +0 -55
  259. package/lib/installations/installations-namespace.js +0 -18
  260. package/lib/instance-id/index.d.ts +0 -62
  261. package/lib/instance-id/index.js +0 -74
  262. package/lib/instance-id/instance-id-namespace.d.ts +0 -38
  263. package/lib/instance-id/instance-id-namespace.js +0 -3
  264. package/lib/instance-id/instance-id.d.ts +0 -47
  265. package/lib/instance-id/instance-id.js +0 -77
  266. package/lib/machine-learning/machine-learning-namespace.d.ts +0 -81
  267. package/lib/machine-learning/machine-learning-namespace.js +0 -18
  268. package/lib/machine-learning/machine-learning-utils.d.ts +0 -22
  269. package/lib/machine-learning/machine-learning-utils.js +0 -47
  270. package/lib/messaging/messaging-namespace.d.ts +0 -161
  271. package/lib/messaging/messaging-namespace.js +0 -18
  272. package/lib/project-management/project-management-namespace.d.ts +0 -82
  273. package/lib/project-management/project-management-namespace.js +0 -18
  274. package/lib/remote-config/remote-config-namespace.d.ts +0 -141
  275. package/lib/remote-config/remote-config-namespace.js +0 -18
  276. package/lib/security-rules/security-rules-internal.d.ts +0 -21
  277. package/lib/security-rules/security-rules-internal.js +0 -26
  278. package/lib/security-rules/security-rules-namespace.d.ts +0 -69
  279. package/lib/security-rules/security-rules-namespace.js +0 -18
  280. package/lib/storage/storage-namespace.d.ts +0 -45
  281. package/lib/storage/storage-namespace.js +0 -18
@@ -1,74 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2020 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.InstanceIdClientErrorCode = exports.FirebaseInstanceIdError = exports.InstanceId = void 0;
20
- exports.getInstanceId = getInstanceId;
21
- /**
22
- * Firebase Instance ID service.
23
- *
24
- * @packageDocumentation
25
- */
26
- const index_1 = require("../app/index");
27
- const instance_id_1 = require("./instance-id");
28
- Object.defineProperty(exports, "InstanceId", { enumerable: true, get: function () { return instance_id_1.InstanceId; } });
29
- /**
30
- * Gets the {@link InstanceId} service for the default app or a given app.
31
- *
32
- * This API is deprecated. Developers are advised to use the
33
- * {@link firebase-admin.installations#getInstallations}
34
- * API to delete their instance IDs and Firebase installation IDs.
35
- *
36
- * `getInstanceId()` can be called with no arguments to access the default
37
- * app's `InstanceId` service or as `getInstanceId(app)` to access the
38
- * `InstanceId` service associated with a specific app.
39
- *
40
- * @example
41
- * ```javascript
42
- * // Get the Instance ID service for the default app
43
- * const defaultInstanceId = getInstanceId();
44
- * ```
45
- *
46
- * @example
47
- * ```javascript
48
- * // Get the Instance ID service for a given app
49
- * const otherInstanceId = getInstanceId(otherApp);
50
- *```
51
- *
52
- * This API is deprecated. Developers are advised to use the `admin.installations()`
53
- * API to delete their instance IDs and Firebase installation IDs.
54
- *
55
- * @param app - Optional app whose `InstanceId` service to
56
- * return. If not provided, the default `InstanceId` service will be
57
- * returned.
58
- *
59
- * @returns The default `InstanceId` service if
60
- * no app is provided or the `InstanceId` service associated with the
61
- * provided app.
62
- *
63
- * @deprecated Use {@link firebase-admin.installations#getInstallations} instead.
64
- */
65
- function getInstanceId(app) {
66
- if (typeof app === 'undefined') {
67
- app = (0, index_1.getApp)();
68
- }
69
- const firebaseApp = app;
70
- return firebaseApp.getOrInitService('instanceId', (app) => new instance_id_1.InstanceId(app));
71
- }
72
- var error_1 = require("../utils/error");
73
- Object.defineProperty(exports, "FirebaseInstanceIdError", { enumerable: true, get: function () { return error_1.FirebaseInstanceIdError; } });
74
- Object.defineProperty(exports, "InstanceIdClientErrorCode", { enumerable: true, get: function () { return error_1.InstanceIdClientErrorCode; } });
@@ -1,38 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- import { App } from '../app/index';
3
- import { InstanceId as TInstanceId } from './instance-id';
4
- /**
5
- * Gets the {@link firebase-admin.instance-id#InstanceId} service for the
6
- * default app or a given app.
7
- *
8
- * `admin.instanceId()` can be called with no arguments to access the default
9
- * app's `InstanceId` service or as `admin.instanceId(app)` to access the
10
- * `InstanceId` service associated with a specific app.
11
- *
12
- * @example
13
- * ```javascript
14
- * // Get the Instance ID service for the default app
15
- * var defaultInstanceId = admin.instanceId();
16
- * ```
17
- *
18
- * @example
19
- * ```javascript
20
- * // Get the Instance ID service for a given app
21
- * var otherInstanceId = admin.instanceId(otherApp);
22
- *```
23
- *
24
- * @param app - Optional app whose `InstanceId` service to
25
- * return. If not provided, the default `InstanceId` service will be
26
- * returned.
27
- *
28
- * @returns The default `InstanceId` service if
29
- * no app is provided or the `InstanceId` service associated with the
30
- * provided app.
31
- */
32
- export declare function instanceId(app?: App): instanceId.InstanceId;
33
- export declare namespace instanceId {
34
- /**
35
- * Type alias to {@link firebase-admin.instance-id#InstanceId}.
36
- */
37
- type InstanceId = TInstanceId;
38
- }
@@ -1,3 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,47 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- /*!
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { App } from '../app/index';
18
- /**
19
- * The `InstanceId` service enables deleting the Firebase instance IDs
20
- * associated with Firebase client app instances.
21
- *
22
- * @deprecated Use {@link firebase-admin.installations#Installations} instead.
23
- */
24
- export declare class InstanceId {
25
- private app_;
26
- /**
27
- * Deletes the specified instance ID and the associated data from Firebase.
28
- *
29
- * Note that Google Analytics for Firebase uses its own form of Instance ID to
30
- * keep track of analytics data. Therefore deleting a Firebase Instance ID does
31
- * not delete Analytics data. See
32
- * {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
33
- * Delete an Instance ID}
34
- * for more information.
35
- *
36
- * @param instanceId - The instance ID to be deleted.
37
- *
38
- * @returns A promise fulfilled when the instance ID is deleted.
39
- */
40
- deleteInstanceId(instanceId: string): Promise<void>;
41
- /**
42
- * Returns the app associated with this InstanceId instance.
43
- *
44
- * @returns The app associated with this InstanceId instance.
45
- */
46
- get app(): App;
47
- }
@@ -1,77 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2020 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.InstanceId = void 0;
20
- const installations_1 = require("../installations");
21
- const error_1 = require("../utils/error");
22
- const validator = require("../utils/validator");
23
- /**
24
- * The `InstanceId` service enables deleting the Firebase instance IDs
25
- * associated with Firebase client app instances.
26
- *
27
- * @deprecated Use {@link firebase-admin.installations#Installations} instead.
28
- */
29
- class InstanceId {
30
- /**
31
- * @param app - The app for this InstanceId service.
32
- * @constructor
33
- * @internal
34
- */
35
- constructor(app) {
36
- if (!validator.isNonNullObject(app) || !('options' in app)) {
37
- throw new error_1.FirebaseInstanceIdError(error_1.InstanceIdClientErrorCode.INVALID_ARGUMENT, 'First argument passed to instanceId() must be a valid Firebase app instance.');
38
- }
39
- this.app_ = app;
40
- }
41
- /**
42
- * Deletes the specified instance ID and the associated data from Firebase.
43
- *
44
- * Note that Google Analytics for Firebase uses its own form of Instance ID to
45
- * keep track of analytics data. Therefore deleting a Firebase Instance ID does
46
- * not delete Analytics data. See
47
- * {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
48
- * Delete an Instance ID}
49
- * for more information.
50
- *
51
- * @param instanceId - The instance ID to be deleted.
52
- *
53
- * @returns A promise fulfilled when the instance ID is deleted.
54
- */
55
- deleteInstanceId(instanceId) {
56
- return (0, installations_1.getInstallations)(this.app).deleteInstallation(instanceId)
57
- .catch((err) => {
58
- if (err instanceof error_1.FirebaseInstallationsError) {
59
- let code = err.code.replace('installations/', '');
60
- if (code === error_1.InstallationsClientErrorCode.INVALID_INSTALLATION_ID.code) {
61
- code = error_1.InstanceIdClientErrorCode.INVALID_INSTANCE_ID.code;
62
- }
63
- throw new error_1.FirebaseInstanceIdError({ code, message: err.message });
64
- }
65
- throw err;
66
- });
67
- }
68
- /**
69
- * Returns the app associated with this InstanceId instance.
70
- *
71
- * @returns The app associated with this InstanceId instance.
72
- */
73
- get app() {
74
- return this.app_;
75
- }
76
- }
77
- exports.InstanceId = InstanceId;
@@ -1,81 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- /*!
3
- * Copyright 2021 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { App } from '../app';
18
- import { ListModelsResult as TListModelsResult, MachineLearning as TMachineLearning, Model as TModel, TFLiteModel as TTFLiteModel } from './machine-learning';
19
- import { GcsTfliteModelOptions as TGcsTfliteModelOptions, ListModelsOptions as TListModelsOptions, ModelOptions as TModelOptions, ModelOptionsBase as TModelOptionsBase } from './machine-learning-api-client';
20
- /**
21
- * Gets the {@link firebase-admin.machine-learning#MachineLearning} service for the
22
- * default app or a given app.
23
- *
24
- * `admin.machineLearning()` can be called with no arguments to access the
25
- * default app's `MachineLearning` service or as `admin.machineLearning(app)` to access
26
- * the `MachineLearning` service associated with a specific app.
27
- *
28
- * @example
29
- * ```javascript
30
- * // Get the MachineLearning service for the default app
31
- * var defaultMachineLearning = admin.machineLearning();
32
- * ```
33
- *
34
- * @example
35
- * ```javascript
36
- * // Get the MachineLearning service for a given app
37
- * var otherMachineLearning = admin.machineLearning(otherApp);
38
- * ```
39
- *
40
- * @param app - Optional app whose `MachineLearning` service to
41
- * return. If not provided, the default `MachineLearning` service
42
- * will be returned.
43
- *
44
- * @returns The default `MachineLearning` service if no app is provided or the
45
- * `MachineLearning` service associated with the provided app.
46
- */
47
- export declare function machineLearning(app?: App): machineLearning.MachineLearning;
48
- export declare namespace machineLearning {
49
- /**
50
- * Type alias to {@link firebase-admin.machine-learning#ListModelsResult}.
51
- */
52
- type ListModelsResult = TListModelsResult;
53
- /**
54
- * Type alias to {@link firebase-admin.machine-learning#MachineLearning}.
55
- */
56
- type MachineLearning = TMachineLearning;
57
- /**
58
- * Type alias to {@link firebase-admin.machine-learning#Model}.
59
- */
60
- type Model = TModel;
61
- /**
62
- * Type alias to {@link firebase-admin.machine-learning#TFLiteModel}.
63
- */
64
- type TFLiteModel = TTFLiteModel;
65
- /**
66
- * Type alias to {@link firebase-admin.machine-learning#GcsTfliteModelOptions}.
67
- */
68
- type GcsTfliteModelOptions = TGcsTfliteModelOptions;
69
- /**
70
- * Type alias to {@link firebase-admin.machine-learning#ListModelsOptions}.
71
- */
72
- type ListModelsOptions = TListModelsOptions;
73
- /**
74
- * Type alias to {@link firebase-admin.machine-learning#ModelOptions}.
75
- */
76
- type ModelOptions = TModelOptions;
77
- /**
78
- * Type alias to {@link firebase-admin.machine-learning#ModelOptionsBase}.
79
- */
80
- type ModelOptionsBase = TModelOptionsBase;
81
- }
@@ -1,18 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2021 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- /*!
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { PrefixedFirebaseError } from '../utils/error';
18
- export type MachineLearningErrorCode = 'already-exists' | 'authentication-error' | 'internal-error' | 'invalid-argument' | 'invalid-server-response' | 'not-found' | 'resource-exhausted' | 'service-unavailable' | 'unknown-error' | 'cancelled' | 'deadline-exceeded' | 'permission-denied' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'data-loss' | 'unauthenticated';
19
- export declare class FirebaseMachineLearningError extends PrefixedFirebaseError {
20
- static fromOperationError(code: number, message: string): FirebaseMachineLearningError;
21
- constructor(code: MachineLearningErrorCode, message: string);
22
- }
@@ -1,47 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2020 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.FirebaseMachineLearningError = void 0;
20
- const error_1 = require("../utils/error");
21
- class FirebaseMachineLearningError extends error_1.PrefixedFirebaseError {
22
- static fromOperationError(code, message) {
23
- switch (code) {
24
- case 1: return new FirebaseMachineLearningError('cancelled', message);
25
- case 2: return new FirebaseMachineLearningError('unknown-error', message);
26
- case 3: return new FirebaseMachineLearningError('invalid-argument', message);
27
- case 4: return new FirebaseMachineLearningError('deadline-exceeded', message);
28
- case 5: return new FirebaseMachineLearningError('not-found', message);
29
- case 6: return new FirebaseMachineLearningError('already-exists', message);
30
- case 7: return new FirebaseMachineLearningError('permission-denied', message);
31
- case 8: return new FirebaseMachineLearningError('resource-exhausted', message);
32
- case 9: return new FirebaseMachineLearningError('failed-precondition', message);
33
- case 10: return new FirebaseMachineLearningError('aborted', message);
34
- case 11: return new FirebaseMachineLearningError('out-of-range', message);
35
- case 13: return new FirebaseMachineLearningError('internal-error', message);
36
- case 14: return new FirebaseMachineLearningError('service-unavailable', message);
37
- case 15: return new FirebaseMachineLearningError('data-loss', message);
38
- case 16: return new FirebaseMachineLearningError('unauthenticated', message);
39
- default:
40
- return new FirebaseMachineLearningError('unknown-error', message);
41
- }
42
- }
43
- constructor(code, message) {
44
- super('machine-learning', code, message);
45
- }
46
- }
47
- exports.FirebaseMachineLearningError = FirebaseMachineLearningError;
@@ -1,161 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- /*!
3
- * Copyright 2021 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { App } from '../app';
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, MessagingOptions as TMessagingOptions, MessagingPayload as TMessagingPayload, NotificationMessagePayload as TNotificationMessagePayload } from './messaging-api';
20
- /**
21
- * Gets the {@link firebase-admin.messaging#Messaging} service for the
22
- * default app or a given app.
23
- *
24
- * `admin.messaging()` can be called with no arguments to access the default
25
- * app's `Messaging` service or as `admin.messaging(app)` to access the
26
- * `Messaging` service associated with a specific app.
27
- *
28
- * @example
29
- * ```javascript
30
- * // Get the Messaging service for the default app
31
- * var defaultMessaging = admin.messaging();
32
- * ```
33
- *
34
- * @example
35
- * ```javascript
36
- * // Get the Messaging service for a given app
37
- * var otherMessaging = admin.messaging(otherApp);
38
- * ```
39
- *
40
- * @param app - Optional app whose `Messaging` service to
41
- * return. If not provided, the default `Messaging` service will be returned.
42
- *
43
- * @returns The default `Messaging` service if no
44
- * app is provided or the `Messaging` service associated with the provided
45
- * app.
46
- */
47
- export declare function messaging(app?: App): messaging.Messaging;
48
- export declare namespace messaging {
49
- /**
50
- * Type alias to {@link firebase-admin.messaging#Messaging}.
51
- */
52
- type Messaging = TMessaging;
53
- /**
54
- * Type alias to {@link firebase-admin.messaging#AndroidConfig}.
55
- */
56
- type AndroidConfig = TAndroidConfig;
57
- /**
58
- * Type alias to {@link firebase-admin.messaging#AndroidFcmOptions}.
59
- */
60
- type AndroidFcmOptions = TAndroidFcmOptions;
61
- /**
62
- * Type alias to {@link firebase-admin.messaging#AndroidNotification}.
63
- */
64
- type AndroidNotification = TAndroidNotification;
65
- /**
66
- * Type alias to {@link firebase-admin.messaging#ApnsConfig}.
67
- */
68
- type ApnsConfig = TApnsConfig;
69
- /**
70
- * Type alias to {@link firebase-admin.messaging#ApnsFcmOptions}.
71
- */
72
- type ApnsFcmOptions = TApnsFcmOptions;
73
- /**
74
- * Type alias to {@link firebase-admin.messaging#ApnsPayload}.
75
- */
76
- type ApnsPayload = TApnsPayload;
77
- /**
78
- * Type alias to {@link firebase-admin.messaging#Aps}.
79
- */
80
- type Aps = TAps;
81
- /**
82
- * Type alias to {@link firebase-admin.messaging#ApsAlert}.
83
- */
84
- type ApsAlert = TApsAlert;
85
- /**
86
- * Type alias to {@link firebase-admin.messaging#BatchResponse}.
87
- */
88
- type BatchResponse = TBatchResponse;
89
- /**
90
- * Type alias to {@link firebase-admin.messaging#CriticalSound}.
91
- */
92
- type CriticalSound = TCriticalSound;
93
- /**
94
- * Type alias to {@link firebase-admin.messaging#ConditionMessage}.
95
- */
96
- type ConditionMessage = TConditionMessage;
97
- /**
98
- * Type alias to {@link firebase-admin.messaging#FcmOptions}.
99
- */
100
- type FcmOptions = TFcmOptions;
101
- /**
102
- * Type alias to {@link firebase-admin.messaging#LightSettings}.
103
- */
104
- type LightSettings = TLightSettings;
105
- /**
106
- * Type alias to {@link firebase-admin.messaging#Message}.
107
- */
108
- type Message = TMessage;
109
- /**
110
- * Type alias to {@link firebase-admin.messaging#MessagingTopicManagementResponse}.
111
- */
112
- type MessagingTopicManagementResponse = TMessagingTopicManagementResponse;
113
- /**
114
- * Type alias to {@link firebase-admin.messaging#MulticastMessage}.
115
- */
116
- type MulticastMessage = TMulticastMessage;
117
- /**
118
- * Type alias to {@link firebase-admin.messaging#Notification}.
119
- */
120
- type Notification = TNotification;
121
- /**
122
- * Type alias to {@link firebase-admin.messaging#SendResponse}.
123
- */
124
- type SendResponse = TSendResponse;
125
- /**
126
- * Type alias to {@link firebase-admin.messaging#TokenMessage}.
127
- */
128
- type TokenMessage = TTokenMessage;
129
- /**
130
- * Type alias to {@link firebase-admin.messaging#TopicMessage}.
131
- */
132
- type TopicMessage = TTopicMessage;
133
- /**
134
- * Type alias to {@link firebase-admin.messaging#WebpushConfig}.
135
- */
136
- type WebpushConfig = TWebpushConfig;
137
- /**
138
- * Type alias to {@link firebase-admin.messaging#WebpushFcmOptions}.
139
- */
140
- type WebpushFcmOptions = TWebpushFcmOptions;
141
- /**
142
- * Type alias to {@link firebase-admin.messaging#WebpushNotification}.
143
- */
144
- type WebpushNotification = TWebpushNotification;
145
- /**
146
- * Type alias to {@link firebase-admin.messaging#DataMessagePayload}.
147
- */
148
- type DataMessagePayload = TDataMessagePayload;
149
- /**
150
- * Type alias to {@link firebase-admin.messaging#MessagingOptions}.
151
- */
152
- type MessagingOptions = TMessagingOptions;
153
- /**
154
- * Type alias to {@link firebase-admin.messaging#MessagingPayload}.
155
- */
156
- type MessagingPayload = TMessagingPayload;
157
- /**
158
- * Type alias to {@link firebase-admin.messaging#NotificationMessagePayload}.
159
- */
160
- type NotificationMessagePayload = TNotificationMessagePayload;
161
- }
@@ -1,18 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2021 Google LLC
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,82 +0,0 @@
1
- /*! firebase-admin v13.9.0 */
2
- /*!
3
- * Copyright 2021 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { App } from '../app';
18
- import { AppMetadata as TAppMetadata, AppPlatform as TAppPlatform } from './app-metadata';
19
- import { ProjectManagement as TProjectManagement } from './project-management';
20
- import { AndroidApp as TAndroidApp, AndroidAppMetadata as TAndroidAppMetadata, ShaCertificate as TShaCertificate } from './android-app';
21
- import { IosApp as TIosApp, IosAppMetadata as TIosAppMetadata } from './ios-app';
22
- /**
23
- * Gets the {@link firebase-admin.project-management#ProjectManagement} service for the
24
- * default app or a given app.
25
- *
26
- * `admin.projectManagement()` can be called with no arguments to access the
27
- * default app's `ProjectManagement` service, or as `admin.projectManagement(app)` to access
28
- * the `ProjectManagement` service associated with a specific app.
29
- *
30
- * @example
31
- * ```javascript
32
- * // Get the ProjectManagement service for the default app
33
- * var defaultProjectManagement = admin.projectManagement();
34
- * ```
35
- *
36
- * @example
37
- * ```javascript
38
- * // Get the ProjectManagement service for a given app
39
- * var otherProjectManagement = admin.projectManagement(otherApp);
40
- * ```
41
- *
42
- * @param app - Optional app whose `ProjectManagement` service
43
- * to return. If not provided, the default `ProjectManagement` service will
44
- * be returned. *
45
- * @returns The default `ProjectManagement` service if no app is provided or the
46
- * `ProjectManagement` service associated with the provided app.
47
- */
48
- export declare function projectManagement(app?: App): projectManagement.ProjectManagement;
49
- export declare namespace projectManagement {
50
- /**
51
- * Type alias to {@link firebase-admin.project-management#AppMetadata}.
52
- */
53
- type AppMetadata = TAppMetadata;
54
- /**
55
- * Type alias to {@link firebase-admin.project-management#AppPlatform}.
56
- */
57
- type AppPlatform = TAppPlatform;
58
- /**
59
- * Type alias to {@link firebase-admin.project-management#ProjectManagement}.
60
- */
61
- type ProjectManagement = TProjectManagement;
62
- /**
63
- * Type alias to {@link firebase-admin.project-management#IosApp}.
64
- */
65
- type IosApp = TIosApp;
66
- /**
67
- * Type alias to {@link firebase-admin.project-management#IosAppMetadata}.
68
- */
69
- type IosAppMetadata = TIosAppMetadata;
70
- /**
71
- * Type alias to {@link firebase-admin.project-management#AndroidApp}.
72
- */
73
- type AndroidApp = TAndroidApp;
74
- /**
75
- * Type alias to {@link firebase-admin.project-management#AndroidAppMetadata}.
76
- */
77
- type AndroidAppMetadata = TAndroidAppMetadata;
78
- /**
79
- * Type alias to {@link firebase-admin.project-management#ShaCertificate}.
80
- */
81
- type ShaCertificate = TShaCertificate;
82
- }