firebase-admin 9.12.0 → 10.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 (189) hide show
  1. package/README.md +7 -3
  2. package/lib/app/core.d.ts +188 -0
  3. package/lib/app/core.js +19 -0
  4. package/lib/app/credential-factory.d.ts +123 -0
  5. package/lib/app/credential-factory.js +150 -0
  6. package/lib/app/credential-internal.d.ts +90 -0
  7. package/lib/{credential → app}/credential-internal.js +15 -13
  8. package/lib/app/credential.d.ts +45 -0
  9. package/lib/app/credential.js +19 -0
  10. package/lib/app/firebase-app.d.ts +51 -0
  11. package/lib/{firebase-app.js → app/firebase-app.js} +26 -156
  12. package/lib/app/firebase-namespace.d.ts +163 -0
  13. package/lib/{firebase-namespace.js → app/firebase-namespace.js} +99 -111
  14. package/lib/app/index.d.ts +27 -0
  15. package/lib/app/index.js +31 -0
  16. package/lib/app/lifecycle.d.ts +60 -0
  17. package/lib/app/lifecycle.js +165 -0
  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 +10 -10
  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 +13 -10
  26. package/lib/app-check/index.d.ts +19 -126
  27. package/lib/app-check/index.js +45 -1
  28. package/lib/app-check/token-generator.d.ts +25 -0
  29. package/lib/app-check/token-generator.js +9 -9
  30. package/lib/app-check/token-verifier.d.ts +17 -0
  31. package/lib/app-check/token-verifier.js +6 -6
  32. package/lib/auth/action-code-settings-builder.d.ts +87 -0
  33. package/lib/auth/action-code-settings-builder.js +4 -2
  34. package/lib/auth/auth-api-request.d.ts +174 -0
  35. package/lib/auth/auth-api-request.js +197 -124
  36. package/lib/auth/auth-config.d.ts +575 -0
  37. package/lib/auth/auth-config.js +43 -34
  38. package/lib/auth/auth-namespace.d.ts +255 -0
  39. package/lib/auth/auth-namespace.js +18 -0
  40. package/lib/auth/auth.d.ts +40 -0
  41. package/lib/auth/auth.js +12 -772
  42. package/lib/auth/base-auth.d.ts +613 -0
  43. package/lib/auth/base-auth.js +951 -0
  44. package/lib/auth/identifier.d.ts +57 -0
  45. package/lib/auth/identifier.js +1 -1
  46. package/lib/auth/index.d.ts +25 -1897
  47. package/lib/auth/index.js +54 -1
  48. package/lib/auth/tenant-manager.d.ts +146 -0
  49. package/lib/auth/tenant-manager.js +151 -39
  50. package/lib/auth/tenant.d.ts +130 -0
  51. package/lib/auth/tenant.js +62 -16
  52. package/lib/auth/token-generator.d.ts +44 -0
  53. package/lib/auth/token-generator.js +11 -9
  54. package/lib/auth/token-verifier.d.ts +150 -0
  55. package/lib/auth/token-verifier.js +27 -15
  56. package/lib/auth/user-import-builder.d.ts +322 -0
  57. package/lib/auth/user-import-builder.js +9 -9
  58. package/lib/auth/user-record.d.ts +265 -0
  59. package/lib/auth/user-record.js +80 -45
  60. package/lib/credential/index.d.ts +24 -66
  61. package/lib/credential/index.js +101 -1
  62. package/lib/database/database-namespace.d.ts +95 -0
  63. package/lib/database/database-namespace.js +23 -0
  64. package/lib/database/database.d.ts +66 -0
  65. package/lib/database/{database-internal.js → database.js} +16 -9
  66. package/lib/database/index.d.ts +55 -54
  67. package/lib/database/index.js +84 -13
  68. package/lib/{firebase-namespace.d.ts → default-namespace.d.ts} +7 -14
  69. package/lib/default-namespace.js +4 -5
  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 +23 -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 +34 -186
  85. package/lib/firebase-namespace-api.js +37 -2
  86. package/lib/firestore/firestore-internal.d.ts +32 -0
  87. package/lib/firestore/firestore-internal.js +3 -3
  88. package/lib/firestore/firestore-namespace.d.ts +50 -0
  89. package/lib/firestore/firestore-namespace.js +47 -0
  90. package/lib/firestore/index.d.ts +37 -35
  91. package/lib/firestore/index.js +61 -30
  92. package/lib/index.d.ts +2 -2
  93. package/lib/index.js +1 -1
  94. package/lib/installations/index.d.ts +34 -63
  95. package/lib/installations/index.js +45 -1
  96. package/lib/installations/installations-namespace.d.ts +55 -0
  97. package/lib/installations/installations-namespace.js +18 -0
  98. package/lib/installations/installations-request-handler.d.ts +43 -0
  99. package/lib/installations/installations-request-handler.js +4 -4
  100. package/lib/installations/installations.d.ts +38 -0
  101. package/lib/installations/installations.js +6 -5
  102. package/lib/instance-id/index.d.ts +23 -45
  103. package/lib/instance-id/index.js +54 -1
  104. package/lib/instance-id/instance-id-namespace.d.ts +38 -0
  105. package/lib/instance-id/instance-id-namespace.js +3 -0
  106. package/lib/instance-id/instance-id.d.ts +47 -0
  107. package/lib/instance-id/instance-id.js +14 -19
  108. package/lib/machine-learning/index.d.ts +19 -216
  109. package/lib/machine-learning/index.js +46 -1
  110. package/lib/machine-learning/machine-learning-api-client.d.ts +102 -0
  111. package/lib/machine-learning/machine-learning-api-client.js +6 -6
  112. package/lib/machine-learning/machine-learning-namespace.d.ts +85 -0
  113. package/lib/machine-learning/machine-learning-namespace.js +18 -0
  114. package/lib/machine-learning/machine-learning-utils.d.ts +22 -0
  115. package/lib/machine-learning/machine-learning-utils.js +1 -1
  116. package/lib/machine-learning/machine-learning.d.ts +181 -0
  117. package/lib/machine-learning/machine-learning.js +72 -37
  118. package/lib/messaging/batch-request-internal.d.ts +55 -0
  119. package/lib/messaging/batch-request-internal.js +9 -9
  120. package/lib/messaging/index.d.ts +18 -1140
  121. package/lib/messaging/index.js +45 -1
  122. package/lib/messaging/messaging-api-request-internal.d.ts +50 -0
  123. package/lib/messaging/messaging-api-request-internal.js +8 -8
  124. package/lib/messaging/messaging-api.d.ts +980 -0
  125. package/lib/messaging/messaging-api.js +19 -0
  126. package/lib/messaging/messaging-errors-internal.d.ts +31 -0
  127. package/lib/messaging/messaging-errors-internal.js +7 -7
  128. package/lib/messaging/messaging-internal.d.ts +27 -0
  129. package/lib/messaging/messaging-internal.js +2 -2
  130. package/lib/messaging/messaging-namespace.d.ts +181 -0
  131. package/lib/messaging/messaging-namespace.js +18 -0
  132. package/lib/messaging/messaging.d.ts +269 -0
  133. package/lib/messaging/messaging.js +83 -91
  134. package/lib/project-management/android-app.d.ts +110 -0
  135. package/lib/project-management/android-app.js +24 -15
  136. package/lib/project-management/app-metadata.d.ts +85 -0
  137. package/lib/project-management/app-metadata.js +37 -0
  138. package/lib/project-management/index.d.ts +21 -331
  139. package/lib/project-management/index.js +51 -24
  140. package/lib/project-management/ios-app.d.ts +66 -0
  141. package/lib/project-management/ios-app.js +15 -8
  142. package/lib/project-management/project-management-api-request-internal.d.ts +17 -0
  143. package/lib/project-management/project-management-api-request-internal.js +15 -15
  144. package/lib/project-management/project-management-namespace.d.ts +82 -0
  145. package/lib/project-management/project-management-namespace.js +18 -0
  146. package/lib/project-management/project-management.d.ts +115 -0
  147. package/lib/project-management/project-management.js +22 -25
  148. package/lib/remote-config/index.d.ts +19 -336
  149. package/lib/remote-config/index.js +45 -1
  150. package/lib/remote-config/remote-config-api-client-internal.d.ts +28 -0
  151. package/lib/remote-config/remote-config-api-client-internal.js +3 -3
  152. package/lib/remote-config/remote-config-api.d.ts +258 -0
  153. package/lib/remote-config/remote-config-api.js +18 -0
  154. package/lib/remote-config/remote-config-namespace.d.ts +105 -0
  155. package/lib/remote-config/remote-config-namespace.js +18 -0
  156. package/lib/remote-config/remote-config.d.ts +94 -0
  157. package/lib/remote-config/remote-config.js +27 -26
  158. package/lib/security-rules/index.d.ts +18 -184
  159. package/lib/security-rules/index.js +46 -1
  160. package/lib/security-rules/security-rules-api-client-internal.d.ts +73 -0
  161. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  162. package/lib/security-rules/security-rules-internal.d.ts +21 -0
  163. package/lib/security-rules/security-rules-internal.js +1 -1
  164. package/lib/security-rules/security-rules-namespace.d.ts +69 -0
  165. package/lib/security-rules/security-rules-namespace.js +18 -0
  166. package/lib/security-rules/security-rules.d.ts +196 -0
  167. package/lib/security-rules/security-rules.js +73 -55
  168. package/lib/storage/index.d.ts +16 -32
  169. package/lib/storage/index.js +38 -1
  170. package/lib/storage/storage-namespace.d.ts +45 -0
  171. package/lib/storage/storage-namespace.js +18 -0
  172. package/lib/storage/storage.d.ts +42 -0
  173. package/lib/storage/storage.js +9 -6
  174. package/lib/utils/api-request.d.ts +230 -0
  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 +9 -9
  178. package/lib/utils/deep-copy.d.ts +40 -0
  179. package/lib/utils/deep-copy.js +6 -6
  180. package/lib/utils/error.d.ts +650 -0
  181. package/lib/utils/error.js +34 -34
  182. package/lib/utils/index.d.ts +105 -0
  183. package/lib/utils/index.js +22 -21
  184. package/lib/utils/jwt.d.ts +131 -0
  185. package/lib/utils/jwt.js +11 -11
  186. package/lib/utils/validator.d.ts +144 -0
  187. package/lib/utils/validator.js +37 -37
  188. package/package.json +110 -8
  189. package/lib/credential/credential.js +0 -44
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.12.0 */
1
+ /*! firebase-admin v10.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -20,9 +20,16 @@ exports.IosApp = void 0;
20
20
  var error_1 = require("../utils/error");
21
21
  var validator = require("../utils/validator");
22
22
  var project_management_api_request_internal_1 = require("./project-management-api-request-internal");
23
- var index_1 = require("./index");
24
- var AppPlatform = index_1.projectManagement.AppPlatform;
23
+ var app_metadata_1 = require("./app-metadata");
24
+ /**
25
+ * A reference to a Firebase iOS app.
26
+ *
27
+ * Do not call this constructor directly. Instead, use {@link ProjectManagement.iosApp}.
28
+ */
25
29
  var IosApp = /** @class */ (function () {
30
+ /**
31
+ * @internal
32
+ */
26
33
  function IosApp(appId, requestHandler) {
27
34
  this.appId = appId;
28
35
  this.requestHandler = requestHandler;
@@ -34,7 +41,7 @@ var IosApp = /** @class */ (function () {
34
41
  /**
35
42
  * Retrieves metadata about this iOS app.
36
43
  *
37
- * @return {!Promise<admin.projectManagement.IosAppMetadata>} A promise that
44
+ * @returns A promise that
38
45
  * resolves to the retrieved metadata about this iOS app.
39
46
  */
40
47
  IosApp.prototype.getMetadata = function () {
@@ -46,7 +53,7 @@ var IosApp = /** @class */ (function () {
46
53
  project_management_api_request_internal_1.assertServerResponse(validator.isNonEmptyString(responseData[requiredField]), responseData, "getMetadata()'s responseData." + requiredField + " must be a non-empty string.");
47
54
  });
48
55
  var metadata = {
49
- platform: AppPlatform.IOS,
56
+ platform: app_metadata_1.AppPlatform.IOS,
50
57
  resourceName: responseData.name,
51
58
  appId: responseData.appId,
52
59
  displayName: responseData.displayName || null,
@@ -59,9 +66,9 @@ var IosApp = /** @class */ (function () {
59
66
  /**
60
67
  * Sets the optional user-assigned display name of the app.
61
68
  *
62
- * @param newDisplayName The new display name to set.
69
+ * @param newDisplayName - The new display name to set.
63
70
  *
64
- * @return A promise that resolves when the display name has
71
+ * @returns A promise that resolves when the display name has
65
72
  * been set.
66
73
  */
67
74
  IosApp.prototype.setDisplayName = function (newDisplayName) {
@@ -70,7 +77,7 @@ var IosApp = /** @class */ (function () {
70
77
  /**
71
78
  * Gets the configuration artifact associated with this app.
72
79
  *
73
- * @return A promise that resolves to the iOS app's Firebase
80
+ * @returns A promise that resolves to the iOS app's Firebase
74
81
  * config file, in UTF-8 string format. This string is typically intended to
75
82
  * be written to a plist file that gets shipped with your iOS app.
76
83
  */
@@ -0,0 +1,17 @@
1
+ /*! firebase-admin v10.0.0 */
2
+ /*!
3
+ * Copyright 2018 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
+ export declare function assertServerResponse(condition: boolean, responseData: object, message: string): void;
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.12.0 */
1
+ /*! firebase-admin v10.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -19,8 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.ProjectManagementRequestHandler = exports.assertServerResponse = void 0;
20
20
  var api_request_1 = require("../utils/api-request");
21
21
  var error_1 = require("../utils/error");
22
- var validator = require("../utils/validator");
23
22
  var index_1 = require("../utils/index");
23
+ var validator = require("../utils/validator");
24
24
  /** Project management backend host and port. */
25
25
  var PROJECT_MANAGEMENT_HOST_AND_PORT = 'firebase.googleapis.com:443';
26
26
  /** Project management backend path. */
@@ -48,11 +48,11 @@ exports.assertServerResponse = assertServerResponse;
48
48
  * Class that provides mechanism to send requests to the Firebase project management backend
49
49
  * endpoints.
50
50
  *
51
- * @private
51
+ * @internal
52
52
  */
53
53
  var ProjectManagementRequestHandler = /** @class */ (function () {
54
54
  /**
55
- * @param {FirebaseApp} app The app used to fetch access tokens to sign API requests.
55
+ * @param app - The app used to fetch access tokens to sign API requests.
56
56
  * @constructor
57
57
  */
58
58
  function ProjectManagementRequestHandler(app) {
@@ -102,7 +102,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
102
102
  throw new error_1.FirebaseProjectManagementError(errorCode, errorMessage + " Status code: " + errStatusCode + ". Raw server response: \"" + errText + "\".");
103
103
  };
104
104
  /**
105
- * @param {string} parentResourceName Fully-qualified resource name of the project whose Android
105
+ * @param parentResourceName - Fully-qualified resource name of the project whose Android
106
106
  * apps you want to list.
107
107
  */
108
108
  ProjectManagementRequestHandler.prototype.listAndroidApps = function (parentResourceName) {
@@ -110,7 +110,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
110
110
  /* requestData */ null, 'v1beta1');
111
111
  };
112
112
  /**
113
- * @param {string} parentResourceName Fully-qualified resource name of the project whose iOS apps
113
+ * @param parentResourceName - Fully-qualified resource name of the project whose iOS apps
114
114
  * you want to list.
115
115
  */
116
116
  ProjectManagementRequestHandler.prototype.listIosApps = function (parentResourceName) {
@@ -118,7 +118,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
118
118
  /* requestData */ null, 'v1beta1');
119
119
  };
120
120
  /**
121
- * @param {string} parentResourceName Fully-qualified resource name of the project whose iOS apps
121
+ * @param parentResourceName - Fully-qualified resource name of the project whose iOS apps
122
122
  * you want to list.
123
123
  */
124
124
  ProjectManagementRequestHandler.prototype.listAppMetadata = function (parentResourceName) {
@@ -126,7 +126,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
126
126
  /* requestData */ null, 'v1beta1');
127
127
  };
128
128
  /**
129
- * @param {string} parentResourceName Fully-qualified resource name of the project that you want
129
+ * @param parentResourceName - Fully-qualified resource name of the project that you want
130
130
  * to create the Android app within.
131
131
  */
132
132
  ProjectManagementRequestHandler.prototype.createAndroidApp = function (parentResourceName, packageName, displayName) {
@@ -146,7 +146,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
146
146
  });
147
147
  };
148
148
  /**
149
- * @param {string} parentResourceName Fully-qualified resource name of the project that you want
149
+ * @param parentResourceName - Fully-qualified resource name of the project that you want
150
150
  * to create the iOS app within.
151
151
  */
152
152
  ProjectManagementRequestHandler.prototype.createIosApp = function (parentResourceName, bundleId, displayName) {
@@ -166,7 +166,7 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
166
166
  });
167
167
  };
168
168
  /**
169
- * @param {string} resourceName Fully-qualified resource name of the entity whose display name you
169
+ * @param resourceName - Fully-qualified resource name of the entity whose display name you
170
170
  * want to set.
171
171
  */
172
172
  ProjectManagementRequestHandler.prototype.setDisplayName = function (resourceName, newDisplayName) {
@@ -178,14 +178,14 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
178
178
  .then(function () { return undefined; });
179
179
  };
180
180
  /**
181
- * @param {string} parentResourceName Fully-qualified resource name of the Android app whose SHA
181
+ * @param parentResourceName - Fully-qualified resource name of the Android app whose SHA
182
182
  * certificates you want to get.
183
183
  */
184
184
  ProjectManagementRequestHandler.prototype.getAndroidShaCertificates = function (parentResourceName) {
185
185
  return this.invokeRequestHandler('GET', parentResourceName + "/sha", /* requestData */ null, 'v1beta1');
186
186
  };
187
187
  /**
188
- * @param {string} parentResourceName Fully-qualified resource name of the Android app that you
188
+ * @param parentResourceName - Fully-qualified resource name of the Android app that you
189
189
  * want to add the given SHA certificate to.
190
190
  */
191
191
  ProjectManagementRequestHandler.prototype.addAndroidShaCertificate = function (parentResourceName, certificate) {
@@ -198,21 +198,21 @@ var ProjectManagementRequestHandler = /** @class */ (function () {
198
198
  .then(function () { return undefined; });
199
199
  };
200
200
  /**
201
- * @param {string} parentResourceName Fully-qualified resource name of the app whose config you
201
+ * @param parentResourceName - Fully-qualified resource name of the app whose config you
202
202
  * want to get.
203
203
  */
204
204
  ProjectManagementRequestHandler.prototype.getConfig = function (parentResourceName) {
205
205
  return this.invokeRequestHandler('GET', parentResourceName + "/config", /* requestData */ null, 'v1beta1');
206
206
  };
207
207
  /**
208
- * @param {string} parentResourceName Fully-qualified resource name of the entity that you want to
208
+ * @param parentResourceName - Fully-qualified resource name of the entity that you want to
209
209
  * get.
210
210
  */
211
211
  ProjectManagementRequestHandler.prototype.getResource = function (parentResourceName) {
212
212
  return this.invokeRequestHandler('GET', parentResourceName, /* requestData */ null, 'v1beta1');
213
213
  };
214
214
  /**
215
- * @param {string} resourceName Fully-qualified resource name of the entity that you want to
215
+ * @param resourceName - Fully-qualified resource name of the entity that you want to
216
216
  * delete.
217
217
  */
218
218
  ProjectManagementRequestHandler.prototype.deleteResource = function (resourceName) {
@@ -0,0 +1,82 @@
1
+ /*! firebase-admin v10.0.0 */
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';
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
+ }
@@ -0,0 +1,18 @@
1
+ /*! firebase-admin v10.0.0 */
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 });
@@ -0,0 +1,115 @@
1
+ /*! firebase-admin v10.0.0 */
2
+ /*!
3
+ * Copyright 2018 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';
18
+ import { AndroidApp, ShaCertificate } from './android-app';
19
+ import { IosApp } from './ios-app';
20
+ import { AppMetadata } from './app-metadata';
21
+ /**
22
+ * The Firebase ProjectManagement service interface.
23
+ */
24
+ export declare class ProjectManagement {
25
+ readonly app: App;
26
+ private readonly requestHandler;
27
+ private projectId;
28
+ /**
29
+ * Lists up to 100 Firebase Android apps associated with this Firebase project.
30
+ *
31
+ * @returns The list of Android apps.
32
+ */
33
+ listAndroidApps(): Promise<AndroidApp[]>;
34
+ /**
35
+ * Lists up to 100 Firebase iOS apps associated with this Firebase project.
36
+ *
37
+ * @returns The list of iOS apps.
38
+ */
39
+ listIosApps(): Promise<IosApp[]>;
40
+ /**
41
+ * Creates an `AndroidApp` object, referencing the specified Android app within
42
+ * this Firebase project.
43
+ *
44
+ * This method does not perform an RPC.
45
+ *
46
+ * @param appId - The `appId` of the Android app to reference.
47
+ *
48
+ * @returns An `AndroidApp` object that references the specified Firebase Android app.
49
+ */
50
+ androidApp(appId: string): AndroidApp;
51
+ /**
52
+ * Creates an `iOSApp` object, referencing the specified iOS app within
53
+ * this Firebase project.
54
+ *
55
+ * This method does not perform an RPC.
56
+ *
57
+ * @param appId - The `appId` of the iOS app to reference.
58
+ *
59
+ * @returns An `iOSApp` object that references the specified Firebase iOS app.
60
+ */
61
+ iosApp(appId: string): IosApp;
62
+ /**
63
+ * Creates a `ShaCertificate` object.
64
+ *
65
+ * This method does not perform an RPC.
66
+ *
67
+ * @param shaHash - The SHA-1 or SHA-256 hash for this certificate.
68
+ *
69
+ * @returns A `ShaCertificate` object contains the specified SHA hash.
70
+ */
71
+ shaCertificate(shaHash: string): ShaCertificate;
72
+ /**
73
+ * Creates a new Firebase Android app associated with this Firebase project.
74
+ *
75
+ * @param packageName - The canonical package name of the Android App,
76
+ * as would appear in the Google Play Developer Console.
77
+ * @param displayName - An optional user-assigned display name for this
78
+ * new app.
79
+ *
80
+ * @returns A promise that resolves to the newly created Android app.
81
+ */
82
+ createAndroidApp(packageName: string, displayName?: string): Promise<AndroidApp>;
83
+ /**
84
+ * Creates a new Firebase iOS app associated with this Firebase project.
85
+ *
86
+ * @param bundleId - The iOS app bundle ID to use for this new app.
87
+ * @param displayName - An optional user-assigned display name for this
88
+ * new app.
89
+ *
90
+ * @returns A promise that resolves to the newly created iOS app.
91
+ */
92
+ createIosApp(bundleId: string, displayName?: string): Promise<IosApp>;
93
+ /**
94
+ * Lists up to 100 Firebase apps associated with this Firebase project.
95
+ *
96
+ * @returns A promise that resolves to the metadata list of the apps.
97
+ */
98
+ listAppMetadata(): Promise<AppMetadata[]>;
99
+ /**
100
+ * Update the display name of this Firebase project.
101
+ *
102
+ * @param newDisplayName - The new display name to be updated.
103
+ *
104
+ * @returns A promise that resolves when the project display name has been updated.
105
+ */
106
+ setDisplayName(newDisplayName: string): Promise<void>;
107
+ private transformResponseToAppMetadata;
108
+ private getResourceName;
109
+ private getProjectId;
110
+ /**
111
+ * Lists up to 100 Firebase apps for a specified platform, associated with this Firebase project.
112
+ */
113
+ private listPlatformApps;
114
+ private assertListAppsResponseData;
115
+ }
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.12.0 */
1
+ /*! firebase-admin v10.0.0 */
2
2
  "use strict";
3
3
  /*!
4
4
  * Copyright 2018 Google Inc.
@@ -23,18 +23,15 @@ var validator = require("../utils/validator");
23
23
  var android_app_1 = require("./android-app");
24
24
  var ios_app_1 = require("./ios-app");
25
25
  var project_management_api_request_internal_1 = require("./project-management-api-request-internal");
26
- var index_1 = require("./index");
27
- var AppPlatform = index_1.projectManagement.AppPlatform;
26
+ var app_metadata_1 = require("./app-metadata");
28
27
  /**
29
28
  * The Firebase ProjectManagement service interface.
30
- *
31
- * Do not call this constructor directly. Instead, use
32
- * [`admin.projectManagement()`](projectManagement#projectManagement).
33
29
  */
34
30
  var ProjectManagement = /** @class */ (function () {
35
31
  /**
36
- * @param {object} app The app for this ProjectManagement service.
32
+ * @param app - The app for this ProjectManagement service.
37
33
  * @constructor
34
+ * @internal
38
35
  */
39
36
  function ProjectManagement(app) {
40
37
  this.app = app;
@@ -47,7 +44,7 @@ var ProjectManagement = /** @class */ (function () {
47
44
  /**
48
45
  * Lists up to 100 Firebase Android apps associated with this Firebase project.
49
46
  *
50
- * @return The list of Android apps.
47
+ * @returns The list of Android apps.
51
48
  */
52
49
  ProjectManagement.prototype.listAndroidApps = function () {
53
50
  return this.listPlatformApps('android', 'listAndroidApps()');
@@ -55,7 +52,7 @@ var ProjectManagement = /** @class */ (function () {
55
52
  /**
56
53
  * Lists up to 100 Firebase iOS apps associated with this Firebase project.
57
54
  *
58
- * @return The list of iOS apps.
55
+ * @returns The list of iOS apps.
59
56
  */
60
57
  ProjectManagement.prototype.listIosApps = function () {
61
58
  return this.listPlatformApps('ios', 'listIosApps()');
@@ -66,9 +63,9 @@ var ProjectManagement = /** @class */ (function () {
66
63
  *
67
64
  * This method does not perform an RPC.
68
65
  *
69
- * @param appId The `appId` of the Android app to reference.
66
+ * @param appId - The `appId` of the Android app to reference.
70
67
  *
71
- * @return An `AndroidApp` object that references the specified Firebase Android app.
68
+ * @returns An `AndroidApp` object that references the specified Firebase Android app.
72
69
  */
73
70
  ProjectManagement.prototype.androidApp = function (appId) {
74
71
  return new android_app_1.AndroidApp(appId, this.requestHandler);
@@ -79,9 +76,9 @@ var ProjectManagement = /** @class */ (function () {
79
76
  *
80
77
  * This method does not perform an RPC.
81
78
  *
82
- * @param appId The `appId` of the iOS app to reference.
79
+ * @param appId - The `appId` of the iOS app to reference.
83
80
  *
84
- * @return An `iOSApp` object that references the specified Firebase iOS app.
81
+ * @returns An `iOSApp` object that references the specified Firebase iOS app.
85
82
  */
86
83
  ProjectManagement.prototype.iosApp = function (appId) {
87
84
  return new ios_app_1.IosApp(appId, this.requestHandler);
@@ -91,9 +88,9 @@ var ProjectManagement = /** @class */ (function () {
91
88
  *
92
89
  * This method does not perform an RPC.
93
90
  *
94
- * @param shaHash The SHA-1 or SHA-256 hash for this certificate.
91
+ * @param shaHash - The SHA-1 or SHA-256 hash for this certificate.
95
92
  *
96
- * @return A `ShaCertificate` object contains the specified SHA hash.
93
+ * @returns A `ShaCertificate` object contains the specified SHA hash.
97
94
  */
98
95
  ProjectManagement.prototype.shaCertificate = function (shaHash) {
99
96
  return new android_app_1.ShaCertificate(shaHash);
@@ -101,12 +98,12 @@ var ProjectManagement = /** @class */ (function () {
101
98
  /**
102
99
  * Creates a new Firebase Android app associated with this Firebase project.
103
100
  *
104
- * @param packageName The canonical package name of the Android App,
101
+ * @param packageName - The canonical package name of the Android App,
105
102
  * as would appear in the Google Play Developer Console.
106
- * @param displayName An optional user-assigned display name for this
103
+ * @param displayName - An optional user-assigned display name for this
107
104
  * new app.
108
105
  *
109
- * @return A promise that resolves to the newly created Android app.
106
+ * @returns A promise that resolves to the newly created Android app.
110
107
  */
111
108
  ProjectManagement.prototype.createAndroidApp = function (packageName, displayName) {
112
109
  var _this = this;
@@ -123,11 +120,11 @@ var ProjectManagement = /** @class */ (function () {
123
120
  /**
124
121
  * Creates a new Firebase iOS app associated with this Firebase project.
125
122
  *
126
- * @param bundleId The iOS app bundle ID to use for this new app.
127
- * @param displayName An optional user-assigned display name for this
123
+ * @param bundleId - The iOS app bundle ID to use for this new app.
124
+ * @param displayName - An optional user-assigned display name for this
128
125
  * new app.
129
126
  *
130
- * @return A promise that resolves to the newly created iOS app.
127
+ * @returns A promise that resolves to the newly created iOS app.
131
128
  */
132
129
  ProjectManagement.prototype.createIosApp = function (bundleId, displayName) {
133
130
  var _this = this;
@@ -144,7 +141,7 @@ var ProjectManagement = /** @class */ (function () {
144
141
  /**
145
142
  * Lists up to 100 Firebase apps associated with this Firebase project.
146
143
  *
147
- * @return A promise that resolves to the metadata list of the apps.
144
+ * @returns A promise that resolves to the metadata list of the apps.
148
145
  */
149
146
  ProjectManagement.prototype.listAppMetadata = function () {
150
147
  var _this = this;
@@ -162,9 +159,9 @@ var ProjectManagement = /** @class */ (function () {
162
159
  /**
163
160
  * Update the display name of this Firebase project.
164
161
  *
165
- * @param newDisplayName The new display name to be updated.
162
+ * @param newDisplayName - The new display name to be updated.
166
163
  *
167
- * @return A promise that resolves when the project display name has been updated.
164
+ * @returns A promise that resolves when the project display name has been updated.
168
165
  */
169
166
  ProjectManagement.prototype.setDisplayName = function (newDisplayName) {
170
167
  var _this = this;
@@ -183,7 +180,7 @@ var ProjectManagement = /** @class */ (function () {
183
180
  project_management_api_request_internal_1.assertServerResponse(validator.isNonEmptyString(appJson.platform), responseData, '"apps[].platform" field must be present in the listAppMetadata() response data.');
184
181
  var metadata = {
185
182
  appId: appJson.appId,
186
- platform: AppPlatform[appJson.platform] || AppPlatform.PLATFORM_UNKNOWN,
183
+ platform: app_metadata_1.AppPlatform[appJson.platform] || app_metadata_1.AppPlatform.PLATFORM_UNKNOWN,
187
184
  projectId: projectId,
188
185
  resourceName: appJson.name,
189
186
  };