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.
Files changed (188) hide show
  1. package/README.md +7 -3
  2. package/lib/app/core.d.ts +15 -22
  3. package/lib/app/core.js +1 -1
  4. package/lib/app/credential-factory.d.ts +17 -33
  5. package/lib/app/credential-factory.js +17 -33
  6. package/lib/app/credential-internal.d.ts +10 -9
  7. package/lib/app/credential-internal.js +15 -13
  8. package/lib/app/credential.d.ts +3 -9
  9. package/lib/app/credential.js +1 -1
  10. package/lib/app/firebase-app.d.ts +6 -30
  11. package/lib/app/firebase-app.js +72 -216
  12. package/lib/app/firebase-namespace.d.ts +28 -34
  13. package/lib/app/firebase-namespace.js +119 -99
  14. package/lib/app/index.d.ts +6 -1
  15. package/lib/app/index.js +1 -1
  16. package/lib/app/lifecycle.d.ts +24 -3
  17. package/lib/app/lifecycle.js +119 -25
  18. package/lib/app-check/app-check-api-client-internal.d.ts +32 -0
  19. package/lib/app-check/app-check-api-client-internal.js +197 -0
  20. package/lib/app-check/app-check-api.d.ts +95 -0
  21. package/lib/app-check/app-check-api.js +19 -0
  22. package/lib/app-check/app-check-namespace.d.ts +65 -0
  23. package/lib/app-check/app-check-namespace.js +18 -0
  24. package/lib/app-check/app-check.d.ts +49 -0
  25. package/lib/app-check/app-check.js +82 -0
  26. package/lib/app-check/index.d.ts +53 -0
  27. package/lib/app-check/index.js +63 -0
  28. package/lib/app-check/token-generator.d.ts +25 -0
  29. package/lib/app-check/token-generator.js +159 -0
  30. package/lib/app-check/token-verifier.d.ts +17 -0
  31. package/lib/app-check/token-verifier.js +151 -0
  32. package/lib/auth/action-code-settings-builder.d.ts +1 -1
  33. package/lib/auth/action-code-settings-builder.js +2 -2
  34. package/lib/auth/auth-api-request.d.ts +28 -32
  35. package/lib/auth/auth-api-request.js +167 -125
  36. package/lib/auth/auth-config.d.ts +123 -21
  37. package/lib/auth/auth-config.js +85 -34
  38. package/lib/auth/auth-namespace.d.ts +157 -4
  39. package/lib/auth/auth-namespace.js +1 -1
  40. package/lib/auth/auth.d.ts +5 -3
  41. package/lib/auth/auth.js +6 -4
  42. package/lib/auth/base-auth.d.ts +134 -116
  43. package/lib/auth/base-auth.js +213 -143
  44. package/lib/auth/identifier.d.ts +5 -5
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +10 -5
  47. package/lib/auth/index.js +9 -4
  48. package/lib/auth/tenant-manager.d.ts +19 -19
  49. package/lib/auth/tenant-manager.js +21 -25
  50. package/lib/auth/tenant.d.ts +14 -5
  51. package/lib/auth/tenant.js +19 -11
  52. package/lib/auth/token-generator.d.ts +7 -108
  53. package/lib/auth/token-generator.js +52 -145
  54. package/lib/auth/token-verifier.d.ts +3 -4
  55. package/lib/auth/token-verifier.js +96 -145
  56. package/lib/auth/user-import-builder.d.ts +11 -11
  57. package/lib/auth/user-import-builder.js +9 -9
  58. package/lib/auth/user-record.d.ts +23 -15
  59. package/lib/auth/user-record.js +30 -20
  60. package/lib/credential/index.d.ts +18 -35
  61. package/lib/credential/index.js +17 -33
  62. package/lib/database/database-namespace.d.ts +39 -10
  63. package/lib/database/database-namespace.js +1 -1
  64. package/lib/database/database.d.ts +16 -6
  65. package/lib/database/database.js +61 -6
  66. package/lib/database/index.d.ts +19 -18
  67. package/lib/database/index.js +21 -23
  68. package/lib/default-namespace.d.ts +7 -1
  69. package/lib/default-namespace.js +4 -4
  70. package/lib/esm/app/index.js +10 -0
  71. package/lib/esm/app-check/index.js +4 -0
  72. package/lib/esm/auth/index.js +14 -0
  73. package/lib/esm/database/index.js +6 -0
  74. package/lib/esm/firestore/index.js +24 -0
  75. package/lib/esm/installations/index.js +4 -0
  76. package/lib/esm/instance-id/index.js +4 -0
  77. package/lib/esm/machine-learning/index.js +5 -0
  78. package/lib/esm/messaging/index.js +4 -0
  79. package/lib/esm/package.json +1 -0
  80. package/lib/esm/project-management/index.js +8 -0
  81. package/lib/esm/remote-config/index.js +4 -0
  82. package/lib/esm/security-rules/index.js +6 -0
  83. package/lib/esm/storage/index.js +4 -0
  84. package/lib/firebase-namespace-api.d.ts +12 -6
  85. package/lib/firebase-namespace-api.js +5 -1
  86. package/lib/firestore/firestore-internal.d.ts +2 -2
  87. package/lib/firestore/firestore-internal.js +2 -2
  88. package/lib/firestore/firestore-namespace.d.ts +6 -1
  89. package/lib/firestore/firestore-namespace.js +2 -1
  90. package/lib/firestore/index.d.ts +36 -4
  91. package/lib/firestore/index.js +29 -1
  92. package/lib/index.d.ts +1 -1
  93. package/lib/index.js +1 -1
  94. package/lib/installations/index.d.ts +52 -0
  95. package/lib/installations/index.js +62 -0
  96. package/lib/installations/installations-namespace.d.ts +55 -0
  97. package/lib/installations/installations-namespace.js +18 -0
  98. package/lib/{instance-id/instance-id-request-internal.d.ts → installations/installations-request-handler.d.ts} +8 -8
  99. package/lib/{instance-id/instance-id-request-internal.js → installations/installations-request-handler.js} +23 -23
  100. package/lib/installations/installations.d.ts +38 -0
  101. package/lib/installations/installations.js +63 -0
  102. package/lib/instance-id/index.d.ts +20 -9
  103. package/lib/instance-id/index.js +20 -9
  104. package/lib/instance-id/instance-id-namespace.d.ts +9 -8
  105. package/lib/instance-id/instance-id-namespace.js +1 -1
  106. package/lib/instance-id/instance-id.d.ts +8 -6
  107. package/lib/instance-id/instance-id.js +20 -11
  108. package/lib/machine-learning/index.d.ts +29 -27
  109. package/lib/machine-learning/index.js +29 -27
  110. package/lib/machine-learning/machine-learning-api-client.d.ts +1 -1
  111. package/lib/machine-learning/machine-learning-api-client.js +4 -4
  112. package/lib/machine-learning/machine-learning-namespace.d.ts +33 -8
  113. package/lib/machine-learning/machine-learning-namespace.js +1 -1
  114. package/lib/machine-learning/machine-learning-utils.d.ts +1 -1
  115. package/lib/machine-learning/machine-learning-utils.js +1 -1
  116. package/lib/machine-learning/machine-learning.d.ts +19 -19
  117. package/lib/machine-learning/machine-learning.js +20 -20
  118. package/lib/messaging/batch-request-internal.d.ts +3 -3
  119. package/lib/messaging/batch-request-internal.js +9 -9
  120. package/lib/messaging/index.d.ts +11 -9
  121. package/lib/messaging/index.js +11 -9
  122. package/lib/messaging/messaging-api-request-internal.d.ts +8 -8
  123. package/lib/messaging/messaging-api-request-internal.js +8 -8
  124. package/lib/messaging/messaging-api.d.ts +79 -75
  125. package/lib/messaging/messaging-api.js +1 -1
  126. package/lib/messaging/messaging-errors-internal.d.ts +5 -5
  127. package/lib/messaging/messaging-errors-internal.js +7 -7
  128. package/lib/messaging/messaging-internal.d.ts +1 -1
  129. package/lib/messaging/messaging-internal.js +6 -31
  130. package/lib/messaging/messaging-namespace.d.ts +105 -8
  131. package/lib/messaging/messaging-namespace.js +1 -1
  132. package/lib/messaging/messaging.d.ts +70 -86
  133. package/lib/messaging/messaging.js +76 -89
  134. package/lib/project-management/android-app.d.ts +11 -12
  135. package/lib/project-management/android-app.js +13 -14
  136. package/lib/project-management/app-metadata.d.ts +1 -1
  137. package/lib/project-management/app-metadata.js +1 -1
  138. package/lib/project-management/index.d.ts +11 -9
  139. package/lib/project-management/index.js +11 -9
  140. package/lib/project-management/ios-app.d.ts +6 -7
  141. package/lib/project-management/ios-app.js +6 -7
  142. package/lib/project-management/project-management-api-request-internal.d.ts +1 -80
  143. package/lib/project-management/project-management-api-request-internal.js +14 -14
  144. package/lib/project-management/project-management-namespace.d.ts +31 -9
  145. package/lib/project-management/project-management-namespace.js +1 -1
  146. package/lib/project-management/project-management.d.ts +18 -21
  147. package/lib/project-management/project-management.js +19 -22
  148. package/lib/remote-config/index.d.ts +12 -10
  149. package/lib/remote-config/index.js +11 -9
  150. package/lib/remote-config/remote-config-api-client-internal.d.ts +1 -1
  151. package/lib/remote-config/remote-config-api-client-internal.js +2 -2
  152. package/lib/remote-config/remote-config-api.d.ts +12 -2
  153. package/lib/remote-config/remote-config-api.js +1 -1
  154. package/lib/remote-config/remote-config-namespace.d.ts +50 -9
  155. package/lib/remote-config/remote-config-namespace.js +1 -1
  156. package/lib/remote-config/remote-config.d.ts +19 -21
  157. package/lib/remote-config/remote-config.js +25 -25
  158. package/lib/security-rules/index.d.ts +12 -10
  159. package/lib/security-rules/index.js +12 -10
  160. package/lib/security-rules/security-rules-api-client-internal.d.ts +1 -1
  161. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  162. package/lib/security-rules/security-rules-internal.d.ts +1 -1
  163. package/lib/security-rules/security-rules-internal.js +1 -1
  164. package/lib/security-rules/security-rules-namespace.d.ts +43 -28
  165. package/lib/security-rules/security-rules-namespace.js +1 -1
  166. package/lib/security-rules/security-rules.d.ts +39 -42
  167. package/lib/security-rules/security-rules.js +38 -39
  168. package/lib/storage/index.d.ts +9 -7
  169. package/lib/storage/index.js +9 -7
  170. package/lib/storage/storage-namespace.d.ts +7 -6
  171. package/lib/storage/storage-namespace.js +1 -1
  172. package/lib/storage/storage.d.ts +3 -3
  173. package/lib/storage/storage.js +14 -4
  174. package/lib/utils/api-request.d.ts +24 -24
  175. package/lib/utils/api-request.js +25 -25
  176. package/lib/utils/crypto-signer.d.ts +128 -0
  177. package/lib/utils/crypto-signer.js +237 -0
  178. package/lib/utils/deep-copy.d.ts +6 -6
  179. package/lib/utils/deep-copy.js +6 -6
  180. package/lib/utils/error.d.ts +69 -36
  181. package/lib/utils/error.js +98 -43
  182. package/lib/utils/index.d.ts +30 -19
  183. package/lib/utils/index.js +47 -20
  184. package/lib/utils/jwt.d.ts +131 -0
  185. package/lib/utils/jwt.js +355 -0
  186. package/lib/utils/validator.d.ts +37 -37
  187. package/lib/utils/validator.js +37 -37
  188. package/package.json +126 -53
@@ -0,0 +1,38 @@
1
+ /*! firebase-admin v10.0.2 */
2
+ /*!
3
+ * Copyright 2021 Google Inc.
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 `Installations` service for the current app.
20
+ */
21
+ export declare class Installations {
22
+ private app_;
23
+ private requestHandler;
24
+ /**
25
+ * Deletes the specified installation ID and the associated data from Firebase.
26
+ *
27
+ * @param fid - The Firebase installation ID to be deleted.
28
+ *
29
+ * @returns A promise fulfilled when the installation ID is deleted.
30
+ */
31
+ deleteInstallation(fid: string): Promise<void>;
32
+ /**
33
+ * Returns the app associated with this Installations instance.
34
+ *
35
+ * @returns The app associated with this Installations instance.
36
+ */
37
+ get app(): App;
38
+ }
@@ -0,0 +1,63 @@
1
+ /*! firebase-admin v10.0.2 */
2
+ "use strict";
3
+ /*!
4
+ * Copyright 2021 Google Inc.
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.Installations = void 0;
20
+ var error_1 = require("../utils/error");
21
+ var installations_request_handler_1 = require("./installations-request-handler");
22
+ var validator = require("../utils/validator");
23
+ /**
24
+ * The `Installations` service for the current app.
25
+ */
26
+ var Installations = /** @class */ (function () {
27
+ /**
28
+ * @param app - The app for this Installations service.
29
+ * @constructor
30
+ * @internal
31
+ */
32
+ function Installations(app) {
33
+ if (!validator.isNonNullObject(app) || !('options' in app)) {
34
+ throw new error_1.FirebaseInstallationsError(error_1.InstallationsClientErrorCode.INVALID_ARGUMENT, 'First argument passed to admin.installations() must be a valid Firebase app instance.');
35
+ }
36
+ this.app_ = app;
37
+ this.requestHandler = new installations_request_handler_1.FirebaseInstallationsRequestHandler(app);
38
+ }
39
+ /**
40
+ * Deletes the specified installation ID and the associated data from Firebase.
41
+ *
42
+ * @param fid - The Firebase installation ID to be deleted.
43
+ *
44
+ * @returns A promise fulfilled when the installation ID is deleted.
45
+ */
46
+ Installations.prototype.deleteInstallation = function (fid) {
47
+ return this.requestHandler.deleteInstallation(fid);
48
+ };
49
+ Object.defineProperty(Installations.prototype, "app", {
50
+ /**
51
+ * Returns the app associated with this Installations instance.
52
+ *
53
+ * @returns The app associated with this Installations instance.
54
+ */
55
+ get: function () {
56
+ return this.app_;
57
+ },
58
+ enumerable: false,
59
+ configurable: true
60
+ });
61
+ return Installations;
62
+ }());
63
+ exports.Installations = Installations;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -14,18 +14,24 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ /**
18
+ * Firebase Instance ID service.
19
+ *
20
+ * @packageDocumentation
21
+ */
17
22
  import { App } from '../app/index';
18
23
  import { InstanceId } from './instance-id';
19
24
  export { InstanceId };
20
25
  /**
21
- * Gets the {@link InstanceId `InstanceId`} service for the
22
- * default app or a given app.
26
+ * Gets the {@link InstanceId} service for the default app or a given app.
27
+ *
28
+ * This API is deprecated. Developers are advised to use the
29
+ * {@link firebase-admin.installations#getInstallations}
30
+ * API to delete their instance IDs and Firebase installation IDs.
23
31
  *
24
32
  * `getInstanceId()` can be called with no arguments to access the default
25
- * app's {@link InstanceId `InstanceId`} service or as
26
- * `getInstanceId(app)` to access the
27
- * {@link InstanceId `InstanceId`} service associated with a
28
- * specific app.
33
+ * app's `InstanceId` service or as `getInstanceId(app)` to access the
34
+ * `InstanceId` service associated with a specific app.
29
35
  *
30
36
  * @example
31
37
  * ```javascript
@@ -39,12 +45,17 @@ export { InstanceId };
39
45
  * const otherInstanceId = getInstanceId(otherApp);
40
46
  *```
41
47
  *
42
- * @param app Optional app whose `InstanceId` service to
48
+ * This API is deprecated. Developers are advised to use the `admin.installations()`
49
+ * API to delete their instance IDs and Firebase installation IDs.
50
+ *
51
+ * @param app - Optional app whose `InstanceId` service to
43
52
  * return. If not provided, the default `InstanceId` service will be
44
53
  * returned.
45
54
  *
46
- * @return The default `InstanceId` service if
55
+ * @returns The default `InstanceId` service if
47
56
  * no app is provided or the `InstanceId` service associated with the
48
57
  * provided app.
58
+ *
59
+ * @deprecated Use {@link firebase-admin.installations#getInstallations} instead.
49
60
  */
50
61
  export declare function getInstanceId(app?: App): InstanceId;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -17,18 +17,24 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.getInstanceId = exports.InstanceId = void 0;
20
+ /**
21
+ * Firebase Instance ID service.
22
+ *
23
+ * @packageDocumentation
24
+ */
20
25
  var index_1 = require("../app/index");
21
26
  var instance_id_1 = require("./instance-id");
22
27
  Object.defineProperty(exports, "InstanceId", { enumerable: true, get: function () { return instance_id_1.InstanceId; } });
23
28
  /**
24
- * Gets the {@link InstanceId `InstanceId`} service for the
25
- * default app or a given app.
29
+ * Gets the {@link InstanceId} service for the default app or a given app.
30
+ *
31
+ * This API is deprecated. Developers are advised to use the
32
+ * {@link firebase-admin.installations#getInstallations}
33
+ * API to delete their instance IDs and Firebase installation IDs.
26
34
  *
27
35
  * `getInstanceId()` can be called with no arguments to access the default
28
- * app's {@link InstanceId `InstanceId`} service or as
29
- * `getInstanceId(app)` to access the
30
- * {@link InstanceId `InstanceId`} service associated with a
31
- * specific app.
36
+ * app's `InstanceId` service or as `getInstanceId(app)` to access the
37
+ * `InstanceId` service associated with a specific app.
32
38
  *
33
39
  * @example
34
40
  * ```javascript
@@ -42,13 +48,18 @@ Object.defineProperty(exports, "InstanceId", { enumerable: true, get: function (
42
48
  * const otherInstanceId = getInstanceId(otherApp);
43
49
  *```
44
50
  *
45
- * @param app Optional app whose `InstanceId` service to
51
+ * This API is deprecated. Developers are advised to use the `admin.installations()`
52
+ * API to delete their instance IDs and Firebase installation IDs.
53
+ *
54
+ * @param app - Optional app whose `InstanceId` service to
46
55
  * return. If not provided, the default `InstanceId` service will be
47
56
  * returned.
48
57
  *
49
- * @return The default `InstanceId` service if
58
+ * @returns The default `InstanceId` service if
50
59
  * no app is provided or the `InstanceId` service associated with the
51
60
  * provided app.
61
+ *
62
+ * @deprecated Use {@link firebase-admin.installations#getInstallations} instead.
52
63
  */
53
64
  function getInstanceId(app) {
54
65
  if (typeof app === 'undefined') {
@@ -1,15 +1,13 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  import { App } from '../app/index';
3
3
  import { InstanceId as TInstanceId } from './instance-id';
4
4
  /**
5
- * Gets the {@link instanceId.InstanceId `InstanceId`} service for the
5
+ * Gets the {@link firebase-admin.instance-id#InstanceId} service for the
6
6
  * default app or a given app.
7
7
  *
8
8
  * `admin.instanceId()` can be called with no arguments to access the default
9
- * app's {@link instanceId.InstanceId `InstanceId`} service or as
10
- * `admin.instanceId(app)` to access the
11
- * {@link instanceId.InstanceId `InstanceId`} service associated with a
12
- * specific app.
9
+ * app's `InstanceId` service or as `admin.instanceId(app)` to access the
10
+ * `InstanceId` service associated with a specific app.
13
11
  *
14
12
  * @example
15
13
  * ```javascript
@@ -23,15 +21,18 @@ import { InstanceId as TInstanceId } from './instance-id';
23
21
  * var otherInstanceId = admin.instanceId(otherApp);
24
22
  *```
25
23
  *
26
- * @param app Optional app whose `InstanceId` service to
24
+ * @param app - Optional app whose `InstanceId` service to
27
25
  * return. If not provided, the default `InstanceId` service will be
28
26
  * returned.
29
27
  *
30
- * @return The default `InstanceId` service if
28
+ * @returns The default `InstanceId` service if
31
29
  * no app is provided or the `InstanceId` service associated with the
32
30
  * provided app.
33
31
  */
34
32
  export declare function instanceId(app?: App): instanceId.InstanceId;
35
33
  export declare namespace instanceId {
34
+ /**
35
+ * Type alias to {@link firebase-admin.instance-id#InstanceId}.
36
+ */
36
37
  type InstanceId = TInstanceId;
37
38
  }
@@ -1,3 +1,3 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -18,28 +18,30 @@ import { App } from '../app/index';
18
18
  /**
19
19
  * The `InstanceId` service enables deleting the Firebase instance IDs
20
20
  * associated with Firebase client app instances.
21
+ *
22
+ * @deprecated Use {@link firebase-admin.installations#Installations} instead.
21
23
  */
22
24
  export declare class InstanceId {
23
25
  private app_;
24
- private requestHandler;
25
26
  /**
26
27
  * Deletes the specified instance ID and the associated data from Firebase.
27
28
  *
28
29
  * Note that Google Analytics for Firebase uses its own form of Instance ID to
29
30
  * keep track of analytics data. Therefore deleting a Firebase Instance ID does
30
31
  * not delete Analytics data. See
31
- * [Delete an Instance ID](/support/privacy/manage-iids#delete_an_instance_id)
32
+ * {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
33
+ * Delete an Instance ID}
32
34
  * for more information.
33
35
  *
34
- * @param instanceId The instance ID to be deleted.
36
+ * @param instanceId - The instance ID to be deleted.
35
37
  *
36
- * @return A promise fulfilled when the instance ID is deleted.
38
+ * @returns A promise fulfilled when the instance ID is deleted.
37
39
  */
38
40
  deleteInstanceId(instanceId: string): Promise<void>;
39
41
  /**
40
42
  * Returns the app associated with this InstanceId instance.
41
43
  *
42
- * @return The app associated with this InstanceId instance.
44
+ * @returns The app associated with this InstanceId instance.
43
45
  */
44
46
  get app(): App;
45
47
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -17,16 +17,18 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.InstanceId = void 0;
20
+ var installations_1 = require("../installations");
20
21
  var error_1 = require("../utils/error");
21
- var instance_id_request_internal_1 = require("./instance-id-request-internal");
22
22
  var validator = require("../utils/validator");
23
23
  /**
24
24
  * The `InstanceId` service enables deleting the Firebase instance IDs
25
25
  * associated with Firebase client app instances.
26
+ *
27
+ * @deprecated Use {@link firebase-admin.installations#Installations} instead.
26
28
  */
27
29
  var InstanceId = /** @class */ (function () {
28
30
  /**
29
- * @param app The app for this InstanceId service.
31
+ * @param app - The app for this InstanceId service.
30
32
  * @constructor
31
33
  * @internal
32
34
  */
@@ -35,7 +37,6 @@ var InstanceId = /** @class */ (function () {
35
37
  throw new error_1.FirebaseInstanceIdError(error_1.InstanceIdClientErrorCode.INVALID_ARGUMENT, 'First argument passed to instanceId() must be a valid Firebase app instance.');
36
38
  }
37
39
  this.app_ = app;
38
- this.requestHandler = new instance_id_request_internal_1.FirebaseInstanceIdRequestHandler(app);
39
40
  }
40
41
  /**
41
42
  * Deletes the specified instance ID and the associated data from Firebase.
@@ -43,24 +44,32 @@ var InstanceId = /** @class */ (function () {
43
44
  * Note that Google Analytics for Firebase uses its own form of Instance ID to
44
45
  * keep track of analytics data. Therefore deleting a Firebase Instance ID does
45
46
  * not delete Analytics data. See
46
- * [Delete an Instance ID](/support/privacy/manage-iids#delete_an_instance_id)
47
+ * {@link https://firebase.google.com/support/privacy/manage-iids#delete_an_instance_id |
48
+ * Delete an Instance ID}
47
49
  * for more information.
48
50
  *
49
- * @param instanceId The instance ID to be deleted.
51
+ * @param instanceId - The instance ID to be deleted.
50
52
  *
51
- * @return A promise fulfilled when the instance ID is deleted.
53
+ * @returns A promise fulfilled when the instance ID is deleted.
52
54
  */
53
55
  InstanceId.prototype.deleteInstanceId = function (instanceId) {
54
- return this.requestHandler.deleteInstanceId(instanceId)
55
- .then(function () {
56
- // Return nothing on success
56
+ return installations_1.getInstallations(this.app).deleteInstallation(instanceId)
57
+ .catch(function (err) {
58
+ if (err instanceof error_1.FirebaseInstallationsError) {
59
+ var 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: code, message: err.message });
64
+ }
65
+ throw err;
57
66
  });
58
67
  };
59
68
  Object.defineProperty(InstanceId.prototype, "app", {
60
69
  /**
61
70
  * Returns the app associated with this InstanceId instance.
62
71
  *
63
- * @return The app associated with this InstanceId instance.
72
+ * @returns The app associated with this InstanceId instance.
64
73
  */
65
74
  get: function () {
66
75
  return this.app_;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -14,37 +14,39 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
+ /**
18
+ * Firebase Machine Learning.
19
+ *
20
+ * @packageDocumentation
21
+ */
17
22
  import { App } from '../app';
18
23
  import { MachineLearning } from './machine-learning';
19
24
  export { MachineLearning, ListModelsResult, Model, TFLiteModel, } from './machine-learning';
20
25
  export { AutoMLTfliteModelOptions, GcsTfliteModelOptions, ListModelsOptions, ModelOptions, ModelOptionsBase, } from './machine-learning-api-client';
21
26
  /**
22
- * Gets the {@link machineLearning.MachineLearning `MachineLearning`} service for the
23
- * default app or a given app.
27
+ * Gets the {@link MachineLearning} service for the default app or a given app.
24
28
  *
25
29
  * `getMachineLearning()` can be called with no arguments to access the
26
- * default app's {@link machineLearning.MachineLearning
27
- * `MachineLearning`} service or as `getMachineLearning(app)` to access
28
- * the {@link machineLearning.MachineLearning `MachineLearning`}
29
- * service associated with a specific app.
30
- *
31
- * @example
32
- * ```javascript
33
- * // Get the MachineLearning service for the default app
34
- * const defaultMachineLearning = getMachineLearning();
35
- * ```
36
- *
37
- * @example
38
- * ```javascript
39
- * // Get the MachineLearning service for a given app
40
- * const otherMachineLearning = getMachineLearning(otherApp);
41
- * ```
42
- *
43
- * @param app Optional app whose `MachineLearning` service to
44
- * return. If not provided, the default `MachineLearning` service
45
- * will be returned.
46
- *
47
- * @return The default `MachineLearning` service if no app is provided or the
48
- * `MachineLearning` service associated with the provided app.
49
- */
30
+ * default app's `MachineLearning` service or as `getMachineLearning(app)` to access
31
+ * the `MachineLearning` service associated with a specific app.
32
+ *
33
+ * @example
34
+ * ```javascript
35
+ * // Get the MachineLearning service for the default app
36
+ * const defaultMachineLearning = getMachineLearning();
37
+ * ```
38
+ *
39
+ * @example
40
+ * ```javascript
41
+ * // Get the MachineLearning service for a given app
42
+ * const otherMachineLearning = getMachineLearning(otherApp);
43
+ * ```
44
+ *
45
+ * @param app - Optional app whose `MachineLearning` service to
46
+ * return. If not provided, the default `MachineLearning` service
47
+ * will be returned.
48
+ *
49
+ * @returns The default `MachineLearning` service if no app is provided or the
50
+ * `MachineLearning` service associated with the provided app.
51
+ */
50
52
  export declare function getMachineLearning(app?: App): MachineLearning;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -17,40 +17,42 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.getMachineLearning = void 0;
20
+ /**
21
+ * Firebase Machine Learning.
22
+ *
23
+ * @packageDocumentation
24
+ */
20
25
  var app_1 = require("../app");
21
26
  var machine_learning_1 = require("./machine-learning");
22
27
  var machine_learning_2 = require("./machine-learning");
23
28
  Object.defineProperty(exports, "MachineLearning", { enumerable: true, get: function () { return machine_learning_2.MachineLearning; } });
24
29
  Object.defineProperty(exports, "Model", { enumerable: true, get: function () { return machine_learning_2.Model; } });
25
30
  /**
26
- * Gets the {@link machineLearning.MachineLearning `MachineLearning`} service for the
27
- * default app or a given app.
31
+ * Gets the {@link MachineLearning} service for the default app or a given app.
28
32
  *
29
33
  * `getMachineLearning()` can be called with no arguments to access the
30
- * default app's {@link machineLearning.MachineLearning
31
- * `MachineLearning`} service or as `getMachineLearning(app)` to access
32
- * the {@link machineLearning.MachineLearning `MachineLearning`}
33
- * service associated with a specific app.
34
- *
35
- * @example
36
- * ```javascript
37
- * // Get the MachineLearning service for the default app
38
- * const defaultMachineLearning = getMachineLearning();
39
- * ```
40
- *
41
- * @example
42
- * ```javascript
43
- * // Get the MachineLearning service for a given app
44
- * const otherMachineLearning = getMachineLearning(otherApp);
45
- * ```
46
- *
47
- * @param app Optional app whose `MachineLearning` service to
48
- * return. If not provided, the default `MachineLearning` service
49
- * will be returned.
50
- *
51
- * @return The default `MachineLearning` service if no app is provided or the
52
- * `MachineLearning` service associated with the provided app.
53
- */
34
+ * default app's `MachineLearning` service or as `getMachineLearning(app)` to access
35
+ * the `MachineLearning` service associated with a specific app.
36
+ *
37
+ * @example
38
+ * ```javascript
39
+ * // Get the MachineLearning service for the default app
40
+ * const defaultMachineLearning = getMachineLearning();
41
+ * ```
42
+ *
43
+ * @example
44
+ * ```javascript
45
+ * // Get the MachineLearning service for a given app
46
+ * const otherMachineLearning = getMachineLearning(otherApp);
47
+ * ```
48
+ *
49
+ * @param app - Optional app whose `MachineLearning` service to
50
+ * return. If not provided, the default `MachineLearning` service
51
+ * will be returned.
52
+ *
53
+ * @returns The default `MachineLearning` service if no app is provided or the
54
+ * `MachineLearning` service associated with the provided app.
55
+ */
54
56
  function getMachineLearning(app) {
55
57
  if (typeof app === 'undefined') {
56
58
  app = app_1.getApp();
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.
@@ -152,8 +152,8 @@ var MachineLearningApiClient = /** @class */ (function () {
152
152
  /**
153
153
  * Handles a Long Running Operation coming back from the server.
154
154
  *
155
- * @param op The operation to handle
156
- * @param options The options for polling
155
+ * @param op - The operation to handle
156
+ * @param options - The options for polling
157
157
  */
158
158
  MachineLearningApiClient.prototype.handleOperation = function (op, options) {
159
159
  if (op.done) {
@@ -221,7 +221,7 @@ var MachineLearningApiClient = /** @class */ (function () {
221
221
  /**
222
222
  * Gets the specified resource from the ML API. Resource names must be the full names including project
223
223
  * number prefix.
224
- * @param fullName Full resource name of the resource to get. e.g. projects/123465/operations/987654
224
+ * @param fullName - Full resource name of the resource to get. e.g. projects/123465/operations/987654
225
225
  * @returns {Promise<T>} A promise that fulfulls with the resource.
226
226
  */
227
227
  MachineLearningApiClient.prototype.getResourceWithFullName = function (fullName) {
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
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 { ListModelsResult as TListModelsResult, MachineLearning as TMachineLearning, Model as TModel, TFLiteModel as TTFLiteModel } from './machine-learning';
19
19
  import { AutoMLTfliteModelOptions as TAutoMLTfliteModelOptions, GcsTfliteModelOptions as TGcsTfliteModelOptions, ListModelsOptions as TListModelsOptions, ModelOptions as TModelOptions, ModelOptionsBase as TModelOptionsBase } from './machine-learning-api-client';
20
20
  /**
21
- * Gets the {@link machineLearning.MachineLearning `MachineLearning`} service for the
21
+ * Gets the {@link firebase-admin.machine-learning#MachineLearning} service for the
22
22
  * default app or a given app.
23
23
  *
24
24
  * `admin.machineLearning()` can be called with no arguments to access the
25
- * default app's {@link machineLearning.MachineLearning
26
- * `MachineLearning`} service or as `admin.machineLearning(app)` to access
27
- * the {@link machineLearning.MachineLearning `MachineLearning`}
28
- * service associated with a specific app.
25
+ * default app's `MachineLearning` service or as `admin.machineLearning(app)` to access
26
+ * the `MachineLearning` service associated with a specific app.
29
27
  *
30
28
  * @example
31
29
  * ```javascript
@@ -39,22 +37,49 @@ import { AutoMLTfliteModelOptions as TAutoMLTfliteModelOptions, GcsTfliteModelOp
39
37
  * var otherMachineLearning = admin.machineLearning(otherApp);
40
38
  * ```
41
39
  *
42
- * @param app Optional app whose `MachineLearning` service to
40
+ * @param app - Optional app whose `MachineLearning` service to
43
41
  * return. If not provided, the default `MachineLearning` service
44
42
  * will be returned.
45
43
  *
46
- * @return The default `MachineLearning` service if no app is provided or the
44
+ * @returns The default `MachineLearning` service if no app is provided or the
47
45
  * `MachineLearning` service associated with the provided app.
48
46
  */
49
47
  export declare function machineLearning(app?: App): machineLearning.MachineLearning;
50
48
  export declare namespace machineLearning {
49
+ /**
50
+ * Type alias to {@link firebase-admin.machine-learning#ListModelsResult}.
51
+ */
51
52
  type ListModelsResult = TListModelsResult;
53
+ /**
54
+ * Type alias to {@link firebase-admin.machine-learning#MachineLearning}.
55
+ */
52
56
  type MachineLearning = TMachineLearning;
57
+ /**
58
+ * Type alias to {@link firebase-admin.machine-learning#Model}.
59
+ */
53
60
  type Model = TModel;
61
+ /**
62
+ * Type alias to {@link firebase-admin.machine-learning#TFLiteModel}.
63
+ */
54
64
  type TFLiteModel = TTFLiteModel;
65
+ /**
66
+ * Type alias to {@link firebase-admin.machine-learning#AutoMLTfliteModelOptions}.
67
+ */
55
68
  type AutoMLTfliteModelOptions = TAutoMLTfliteModelOptions;
69
+ /**
70
+ * Type alias to {@link firebase-admin.machine-learning#GcsTfliteModelOptions}.
71
+ */
56
72
  type GcsTfliteModelOptions = TGcsTfliteModelOptions;
73
+ /**
74
+ * Type alias to {@link firebase-admin.machine-learning#ListModelsOptions}.
75
+ */
57
76
  type ListModelsOptions = TListModelsOptions;
77
+ /**
78
+ * Type alias to {@link firebase-admin.machine-learning#ModelOptions}.
79
+ */
58
80
  type ModelOptions = TModelOptions;
81
+ /**
82
+ * Type alias to {@link firebase-admin.machine-learning#ModelOptionsBase}.
83
+ */
59
84
  type ModelOptionsBase = TModelOptionsBase;
60
85
  }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2021 Google Inc.
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.100.0-alpha.0 */
1
+ /*! firebase-admin v10.0.2 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2020 Google Inc.