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
@@ -0,0 +1,85 @@
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
+ /**
18
+ * Platforms with which a Firebase App can be associated.
19
+ */
20
+ export declare enum AppPlatform {
21
+ /**
22
+ * Unknown state. This is only used for distinguishing unset values.
23
+ */
24
+ PLATFORM_UNKNOWN = "PLATFORM_UNKNOWN",
25
+ /**
26
+ * The Firebase App is associated with iOS.
27
+ */
28
+ IOS = "IOS",
29
+ /**
30
+ * The Firebase App is associated with Android.
31
+ */
32
+ ANDROID = "ANDROID"
33
+ }
34
+ /**
35
+ * Metadata about a Firebase app.
36
+ */
37
+ export interface AppMetadata {
38
+ /**
39
+ * The globally unique, Firebase-assigned identifier of the app.
40
+ *
41
+ * @example
42
+ * ```javascript
43
+ * var appId = appMetadata.appId;
44
+ * ```
45
+ */
46
+ appId: string;
47
+ /**
48
+ * The optional user-assigned display name of the app.
49
+ *
50
+ * @example
51
+ * ```javascript
52
+ * var displayName = appMetadata.displayName;
53
+ * ```
54
+ */
55
+ displayName?: string;
56
+ /**
57
+ * The development platform of the app. Supporting Android and iOS app platforms.
58
+ *
59
+ * @example
60
+ * ```javascript
61
+ * var platform = AppPlatform.ANDROID;
62
+ * ```
63
+ */
64
+ platform: AppPlatform;
65
+ /**
66
+ * The globally unique, user-assigned ID of the parent project for the app.
67
+ *
68
+ * @example
69
+ * ```javascript
70
+ * var projectId = appMetadata.projectId;
71
+ * ```
72
+ */
73
+ projectId: string;
74
+ /**
75
+ * The fully-qualified resource name that identifies this app.
76
+ *
77
+ * This is useful when manually constructing requests for Firebase's public API.
78
+ *
79
+ * @example
80
+ * ```javascript
81
+ * var resourceName = androidAppMetadata.resourceName;
82
+ * ```
83
+ */
84
+ resourceName: string;
85
+ }
@@ -0,0 +1,37 @@
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 });
19
+ exports.AppPlatform = void 0;
20
+ /**
21
+ * Platforms with which a Firebase App can be associated.
22
+ */
23
+ var AppPlatform;
24
+ (function (AppPlatform) {
25
+ /**
26
+ * Unknown state. This is only used for distinguishing unset values.
27
+ */
28
+ AppPlatform["PLATFORM_UNKNOWN"] = "PLATFORM_UNKNOWN";
29
+ /**
30
+ * The Firebase App is associated with iOS.
31
+ */
32
+ AppPlatform["IOS"] = "IOS";
33
+ /**
34
+ * The Firebase App is associated with Android.
35
+ */
36
+ AppPlatform["ANDROID"] = "ANDROID";
37
+ })(AppPlatform = exports.AppPlatform || (exports.AppPlatform = {}));
@@ -1,4 +1,4 @@
1
- /*! firebase-admin v9.12.0 */
1
+ /*! firebase-admin v10.0.0 */
2
2
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -14,350 +14,40 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import { app } from '../firebase-namespace-api';
18
17
  /**
19
- * Gets the {@link projectManagement.ProjectManagement
20
- * `ProjectManagement`} service for the default app or a given app.
18
+ * Firebase project management.
21
19
  *
22
- * `admin.projectManagement()` can be called with no arguments to access the
23
- * default app's {@link projectManagement.ProjectManagement
24
- * `ProjectManagement`} service, or as `admin.projectManagement(app)` to access
25
- * the {@link projectManagement.ProjectManagement `ProjectManagement`}
26
- * service associated with a specific app.
20
+ * @packageDocumentation
21
+ */
22
+ import { App } from '../app';
23
+ import { ProjectManagement } from './project-management';
24
+ export { AppMetadata, AppPlatform } from './app-metadata';
25
+ export { ProjectManagement } from './project-management';
26
+ export { AndroidApp, AndroidAppMetadata, ShaCertificate } from './android-app';
27
+ export { IosApp, IosAppMetadata } from './ios-app';
28
+ /**
29
+ * Gets the {@link ProjectManagement} service for the default app or a given app.
30
+ *
31
+ * `getProjectManagement()` can be called with no arguments to access the
32
+ * default app's `ProjectManagement` service, or as `getProjectManagement(app)` to access
33
+ * the `ProjectManagement` service associated with a specific app.
27
34
  *
28
35
  * @example
29
36
  * ```javascript
30
37
  * // Get the ProjectManagement service for the default app
31
- * var defaultProjectManagement = admin.projectManagement();
38
+ * const defaultProjectManagement = getProjectManagement();
32
39
  * ```
33
40
  *
34
41
  * @example
35
42
  * ```javascript
36
43
  * // Get the ProjectManagement service for a given app
37
- * var otherProjectManagement = admin.projectManagement(otherApp);
44
+ * const otherProjectManagement = getProjectManagement(otherApp);
38
45
  * ```
39
46
  *
40
- * @param app Optional app whose `ProjectManagement` service
47
+ * @param app - Optional app whose `ProjectManagement` service
41
48
  * to return. If not provided, the default `ProjectManagement` service will
42
49
  * be returned. *
43
- * @return The default `ProjectManagement` service if no app is provided or the
50
+ * @returns The default `ProjectManagement` service if no app is provided or the
44
51
  * `ProjectManagement` service associated with the provided app.
45
52
  */
46
- export declare function projectManagement(app?: app.App): projectManagement.ProjectManagement;
47
- export declare namespace projectManagement {
48
- /**
49
- * Metadata about a Firebase Android App.
50
- */
51
- interface AndroidAppMetadata extends AppMetadata {
52
- platform: AppPlatform.ANDROID;
53
- /**
54
- * The canonical package name of the Android App, as would appear in the Google Play Developer
55
- * Console.
56
- *
57
- * @example
58
- * ```javascript
59
- * var packageName = androidAppMetadata.packageName;
60
- * ```
61
- */
62
- packageName: string;
63
- }
64
- /**
65
- * Metadata about a Firebase app.
66
- */
67
- interface AppMetadata {
68
- /**
69
- * The globally unique, Firebase-assigned identifier of the app.
70
- *
71
- * @example
72
- * ```javascript
73
- * var appId = appMetadata.appId;
74
- * ```
75
- */
76
- appId: string;
77
- /**
78
- * The optional user-assigned display name of the app.
79
- *
80
- * @example
81
- * ```javascript
82
- * var displayName = appMetadata.displayName;
83
- * ```
84
- */
85
- displayName?: string;
86
- /**
87
- * The development platform of the app. Supporting Android and iOS app platforms.
88
- *
89
- * @example
90
- * ```javascript
91
- * var platform = AppPlatform.ANDROID;
92
- * ```
93
- */
94
- platform: AppPlatform;
95
- /**
96
- * The globally unique, user-assigned ID of the parent project for the app.
97
- *
98
- * @example
99
- * ```javascript
100
- * var projectId = appMetadata.projectId;
101
- * ```
102
- */
103
- projectId: string;
104
- /**
105
- * The fully-qualified resource name that identifies this app.
106
- *
107
- * This is useful when manually constructing requests for Firebase's public API.
108
- *
109
- * @example
110
- * ```javascript
111
- * var resourceName = androidAppMetadata.resourceName;
112
- * ```
113
- */
114
- resourceName: string;
115
- }
116
- /**
117
- * Platforms with which a Firebase App can be associated.
118
- */
119
- enum AppPlatform {
120
- /**
121
- * Unknown state. This is only used for distinguishing unset values.
122
- */
123
- PLATFORM_UNKNOWN = "PLATFORM_UNKNOWN",
124
- /**
125
- * The Firebase App is associated with iOS.
126
- */
127
- IOS = "IOS",
128
- /**
129
- * The Firebase App is associated with Android.
130
- */
131
- ANDROID = "ANDROID"
132
- }
133
- /**
134
- * Metadata about a Firebase iOS App.
135
- */
136
- interface IosAppMetadata extends AppMetadata {
137
- platform: AppPlatform.IOS;
138
- /**
139
- * The canonical bundle ID of the iOS App as it would appear in the iOS App Store.
140
- *
141
- * @example
142
- * ```javascript
143
- * var bundleId = iosAppMetadata.bundleId;
144
- *```
145
- */
146
- bundleId: string;
147
- }
148
- /**
149
- * A reference to a Firebase Android app.
150
- *
151
- * Do not call this constructor directly. Instead, use
152
- * [`projectManagement.androidApp()`](projectManagement.ProjectManagement#androidApp).
153
- */
154
- interface AndroidApp {
155
- appId: string;
156
- /**
157
- * Retrieves metadata about this Android app.
158
- *
159
- * @return A promise that resolves to the retrieved metadata about this Android app.
160
- */
161
- getMetadata(): Promise<AndroidAppMetadata>;
162
- /**
163
- * Sets the optional user-assigned display name of the app.
164
- *
165
- * @param newDisplayName The new display name to set.
166
- *
167
- * @return A promise that resolves when the display name has been set.
168
- */
169
- setDisplayName(newDisplayName: string): Promise<void>;
170
- /**
171
- * Gets the list of SHA certificates associated with this Android app in Firebase.
172
- *
173
- * @return The list of SHA-1 and SHA-256 certificates associated with this Android app in
174
- * Firebase.
175
- */
176
- getShaCertificates(): Promise<ShaCertificate[]>;
177
- /**
178
- * Adds the given SHA certificate to this Android app.
179
- *
180
- * @param certificateToAdd The SHA certificate to add.
181
- *
182
- * @return A promise that resolves when the given certificate
183
- * has been added to the Android app.
184
- */
185
- addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;
186
- /**
187
- * Deletes the specified SHA certificate from this Android app.
188
- *
189
- * @param certificateToDelete The SHA certificate to delete.
190
- *
191
- * @return A promise that resolves when the specified
192
- * certificate has been removed from the Android app.
193
- */
194
- deleteShaCertificate(certificateToRemove: ShaCertificate): Promise<void>;
195
- /**
196
- * Gets the configuration artifact associated with this app.
197
- *
198
- * @return A promise that resolves to the Android app's
199
- * Firebase config file, in UTF-8 string format. This string is typically
200
- * intended to be written to a JSON file that gets shipped with your Android
201
- * app.
202
- */
203
- getConfig(): Promise<string>;
204
- }
205
- /**
206
- * A reference to a Firebase iOS app.
207
- *
208
- * Do not call this constructor directly. Instead, use
209
- * [`projectManagement.iosApp()`](projectManagement.ProjectManagement#iosApp).
210
- */
211
- interface IosApp {
212
- appId: string;
213
- /**
214
- * Retrieves metadata about this iOS app.
215
- *
216
- * @return {!Promise<admin.projectManagement.IosAppMetadata>} A promise that
217
- * resolves to the retrieved metadata about this iOS app.
218
- */
219
- getMetadata(): Promise<IosAppMetadata>;
220
- /**
221
- * Sets the optional user-assigned display name of the app.
222
- *
223
- * @param newDisplayName The new display name to set.
224
- *
225
- * @return A promise that resolves when the display name has
226
- * been set.
227
- */
228
- setDisplayName(newDisplayName: string): Promise<void>;
229
- /**
230
- * Gets the configuration artifact associated with this app.
231
- *
232
- * @return A promise that resolves to the iOS app's Firebase
233
- * config file, in UTF-8 string format. This string is typically intended to
234
- * be written to a plist file that gets shipped with your iOS app.
235
- */
236
- getConfig(): Promise<string>;
237
- }
238
- /**
239
- * A SHA-1 or SHA-256 certificate.
240
- *
241
- * Do not call this constructor directly. Instead, use
242
- * [`projectManagement.shaCertificate()`](projectManagement.ProjectManagement#shaCertificate).
243
- */
244
- interface ShaCertificate {
245
- /**
246
- * The SHA certificate type.
247
- *
248
- * @example
249
- * ```javascript
250
- * var certType = shaCertificate.certType;
251
- * ```
252
- */
253
- certType: ('sha1' | 'sha256');
254
- /**
255
- * The SHA-1 or SHA-256 hash for this certificate.
256
- *
257
- * @example
258
- * ```javascript
259
- * var shaHash = shaCertificate.shaHash;
260
- * ```
261
- */
262
- shaHash: string;
263
- /**
264
- * The fully-qualified resource name that identifies this sha-key.
265
- *
266
- * This is useful when manually constructing requests for Firebase's public API.
267
- *
268
- * @example
269
- * ```javascript
270
- * var resourceName = shaCertificate.resourceName;
271
- * ```
272
- */
273
- resourceName?: string;
274
- }
275
- /**
276
- * The Firebase ProjectManagement service interface.
277
- *
278
- * Do not call this constructor directly. Instead, use
279
- * [`admin.projectManagement()`](projectManagement#projectManagement).
280
- */
281
- interface ProjectManagement {
282
- app: app.App;
283
- /**
284
- * Lists up to 100 Firebase apps associated with this Firebase project.
285
- *
286
- * @return A promise that resolves to the metadata list of the apps.
287
- */
288
- listAppMetadata(): Promise<AppMetadata[]>;
289
- /**
290
- * Lists up to 100 Firebase Android apps associated with this Firebase project.
291
- *
292
- * @return The list of Android apps.
293
- */
294
- listAndroidApps(): Promise<AndroidApp[]>;
295
- /**
296
- * Lists up to 100 Firebase iOS apps associated with this Firebase project.
297
- *
298
- * @return The list of iOS apps.
299
- */
300
- listIosApps(): Promise<IosApp[]>;
301
- /**
302
- * Creates an `AndroidApp` object, referencing the specified Android app within
303
- * this Firebase project.
304
- *
305
- * This method does not perform an RPC.
306
- *
307
- * @param appId The `appId` of the Android app to reference.
308
- *
309
- * @return An `AndroidApp` object that references the specified Firebase Android app.
310
- */
311
- androidApp(appId: string): AndroidApp;
312
- /**
313
- * Update the display name of this Firebase project.
314
- *
315
- * @param newDisplayName The new display name to be updated.
316
- *
317
- * @return A promise that resolves when the project display name has been updated.
318
- */
319
- setDisplayName(newDisplayName: string): Promise<void>;
320
- /**
321
- * Creates an `iOSApp` object, referencing the specified iOS app within
322
- * this Firebase project.
323
- *
324
- * This method does not perform an RPC.
325
- *
326
- * @param appId The `appId` of the iOS app to reference.
327
- *
328
- * @return An `iOSApp` object that references the specified Firebase iOS app.
329
- */
330
- iosApp(appId: string): IosApp;
331
- /**
332
- * Creates a `ShaCertificate` object.
333
- *
334
- * This method does not perform an RPC.
335
- *
336
- * @param shaHash The SHA-1 or SHA-256 hash for this certificate.
337
- *
338
- * @return A `ShaCertificate` object contains the specified SHA hash.
339
- */
340
- shaCertificate(shaHash: string): ShaCertificate;
341
- /**
342
- * Creates a new Firebase Android app associated with this Firebase project.
343
- *
344
- * @param packageName The canonical package name of the Android App,
345
- * as would appear in the Google Play Developer Console.
346
- * @param displayName An optional user-assigned display name for this
347
- * new app.
348
- *
349
- * @return A promise that resolves to the newly created Android app.
350
- */
351
- createAndroidApp(packageName: string, displayName?: string): Promise<AndroidApp>;
352
- /**
353
- * Creates a new Firebase iOS app associated with this Firebase project.
354
- *
355
- * @param bundleId The iOS app bundle ID to use for this new app.
356
- * @param displayName An optional user-assigned display name for this
357
- * new app.
358
- *
359
- * @return A promise that resolves to the newly created iOS app.
360
- */
361
- createIosApp(bundleId: string, displayName?: string): Promise<IosApp>;
362
- }
363
- }
53
+ export declare function getProjectManagement(app?: App): ProjectManagement;
@@ -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 2020 Google Inc.
@@ -16,26 +16,53 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.projectManagement = void 0;
20
- /* eslint-disable @typescript-eslint/no-namespace */
21
- var projectManagement;
22
- (function (projectManagement) {
23
- /**
24
- * Platforms with which a Firebase App can be associated.
25
- */
26
- var AppPlatform;
27
- (function (AppPlatform) {
28
- /**
29
- * Unknown state. This is only used for distinguishing unset values.
30
- */
31
- AppPlatform["PLATFORM_UNKNOWN"] = "PLATFORM_UNKNOWN";
32
- /**
33
- * The Firebase App is associated with iOS.
34
- */
35
- AppPlatform["IOS"] = "IOS";
36
- /**
37
- * The Firebase App is associated with Android.
38
- */
39
- AppPlatform["ANDROID"] = "ANDROID";
40
- })(AppPlatform = projectManagement.AppPlatform || (projectManagement.AppPlatform = {}));
41
- })(projectManagement = exports.projectManagement || (exports.projectManagement = {}));
19
+ exports.getProjectManagement = void 0;
20
+ /**
21
+ * Firebase project management.
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ var app_1 = require("../app");
26
+ var project_management_1 = require("./project-management");
27
+ var app_metadata_1 = require("./app-metadata");
28
+ Object.defineProperty(exports, "AppPlatform", { enumerable: true, get: function () { return app_metadata_1.AppPlatform; } });
29
+ var project_management_2 = require("./project-management");
30
+ Object.defineProperty(exports, "ProjectManagement", { enumerable: true, get: function () { return project_management_2.ProjectManagement; } });
31
+ var android_app_1 = require("./android-app");
32
+ Object.defineProperty(exports, "AndroidApp", { enumerable: true, get: function () { return android_app_1.AndroidApp; } });
33
+ Object.defineProperty(exports, "ShaCertificate", { enumerable: true, get: function () { return android_app_1.ShaCertificate; } });
34
+ var ios_app_1 = require("./ios-app");
35
+ Object.defineProperty(exports, "IosApp", { enumerable: true, get: function () { return ios_app_1.IosApp; } });
36
+ /**
37
+ * Gets the {@link ProjectManagement} service for the default app or a given app.
38
+ *
39
+ * `getProjectManagement()` can be called with no arguments to access the
40
+ * default app's `ProjectManagement` service, or as `getProjectManagement(app)` to access
41
+ * the `ProjectManagement` service associated with a specific app.
42
+ *
43
+ * @example
44
+ * ```javascript
45
+ * // Get the ProjectManagement service for the default app
46
+ * const defaultProjectManagement = getProjectManagement();
47
+ * ```
48
+ *
49
+ * @example
50
+ * ```javascript
51
+ * // Get the ProjectManagement service for a given app
52
+ * const otherProjectManagement = getProjectManagement(otherApp);
53
+ * ```
54
+ *
55
+ * @param app - Optional app whose `ProjectManagement` service
56
+ * to return. If not provided, the default `ProjectManagement` service will
57
+ * be returned. *
58
+ * @returns The default `ProjectManagement` service if no app is provided or the
59
+ * `ProjectManagement` service associated with the provided app.
60
+ */
61
+ function getProjectManagement(app) {
62
+ if (typeof app === 'undefined') {
63
+ app = app_1.getApp();
64
+ }
65
+ var firebaseApp = app;
66
+ return firebaseApp.getOrInitService('projectManagement', function (app) { return new project_management_1.ProjectManagement(app); });
67
+ }
68
+ exports.getProjectManagement = getProjectManagement;
@@ -0,0 +1,66 @@
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 { AppMetadata, AppPlatform } from './app-metadata';
18
+ /**
19
+ * Metadata about a Firebase iOS App.
20
+ */
21
+ export interface IosAppMetadata extends AppMetadata {
22
+ platform: AppPlatform.IOS;
23
+ /**
24
+ * The canonical bundle ID of the iOS App as it would appear in the iOS App Store.
25
+ *
26
+ * @example
27
+ * ```javascript
28
+ * var bundleId = iosAppMetadata.bundleId;
29
+ *```
30
+ */
31
+ bundleId: string;
32
+ }
33
+ /**
34
+ * A reference to a Firebase iOS app.
35
+ *
36
+ * Do not call this constructor directly. Instead, use {@link ProjectManagement.iosApp}.
37
+ */
38
+ export declare class IosApp {
39
+ readonly appId: string;
40
+ private readonly requestHandler;
41
+ private readonly resourceName;
42
+ /**
43
+ * Retrieves metadata about this iOS app.
44
+ *
45
+ * @returns A promise that
46
+ * resolves to the retrieved metadata about this iOS app.
47
+ */
48
+ getMetadata(): Promise<IosAppMetadata>;
49
+ /**
50
+ * Sets the optional user-assigned display name of the app.
51
+ *
52
+ * @param newDisplayName - The new display name to set.
53
+ *
54
+ * @returns A promise that resolves when the display name has
55
+ * been set.
56
+ */
57
+ setDisplayName(newDisplayName: string): Promise<void>;
58
+ /**
59
+ * Gets the configuration artifact associated with this app.
60
+ *
61
+ * @returns A promise that resolves to the iOS app's Firebase
62
+ * config file, in UTF-8 string format. This string is typically intended to
63
+ * be written to a plist file that gets shipped with your iOS app.
64
+ */
65
+ getConfig(): Promise<string>;
66
+ }