firebase-admin 9.3.0 → 9.5.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 (82) hide show
  1. package/lib/auth/action-code-settings-builder.js +1 -1
  2. package/lib/auth/auth-api-request.js +98 -25
  3. package/lib/auth/auth-config.js +15 -15
  4. package/lib/auth/auth.js +82 -61
  5. package/lib/auth/identifier.js +3 -2
  6. package/lib/auth/index.d.ts +1868 -0
  7. package/lib/{credential/credential-interfaces.js → auth/index.js} +1 -1
  8. package/lib/auth/tenant-manager.js +1 -1
  9. package/lib/auth/tenant.js +7 -1
  10. package/lib/auth/token-generator.js +6 -4
  11. package/lib/auth/token-verifier.js +32 -36
  12. package/lib/auth/user-import-builder.js +18 -15
  13. package/lib/auth/user-record.js +4 -4
  14. package/lib/credential/credential-internal.js +1 -2
  15. package/lib/credential/credential.js +8 -122
  16. package/lib/credential/index.d.ts +169 -0
  17. package/lib/credential/index.js +5 -17
  18. package/lib/database/database-internal.js +19 -26
  19. package/lib/database/index.d.ts +89 -0
  20. package/lib/database/index.js +12 -28
  21. package/lib/default-namespace.js +2 -1
  22. package/lib/firebase-app.js +26 -48
  23. package/lib/firebase-namespace-api.d.ts +238 -0
  24. package/lib/{firebase-service.js → firebase-namespace-api.js} +2 -2
  25. package/lib/{database/database.js → firebase-namespace.d.ts} +14 -7
  26. package/lib/firebase-namespace.js +22 -92
  27. package/lib/firestore/firestore-internal.js +2 -19
  28. package/lib/firestore/index.d.ts +50 -0
  29. package/lib/firestore/index.js +28 -43
  30. package/lib/index.d.ts +3 -932
  31. package/lib/index.js +2 -1
  32. package/lib/instance-id/index.d.ts +81 -0
  33. package/lib/instance-id/index.js +1 -10
  34. package/lib/instance-id/instance-id-request-internal.js +2 -1
  35. package/lib/instance-id/instance-id.js +1 -19
  36. package/lib/machine-learning/index.d.ts +249 -0
  37. package/lib/{messaging/messaging-types.js → machine-learning/index.js} +2 -2
  38. package/lib/machine-learning/machine-learning-api-client.js +1 -1
  39. package/lib/machine-learning/machine-learning-utils.js +1 -1
  40. package/lib/machine-learning/machine-learning.js +3 -22
  41. package/lib/messaging/batch-request-internal.js +1 -1
  42. package/lib/messaging/index.d.ts +1174 -0
  43. package/lib/messaging/index.js +1 -24
  44. package/lib/messaging/messaging-api-request-internal.js +2 -1
  45. package/lib/messaging/messaging-errors-internal.js +1 -1
  46. package/lib/messaging/messaging-internal.js +1 -1
  47. package/lib/messaging/messaging.js +21 -25
  48. package/lib/project-management/android-app.js +7 -6
  49. package/lib/project-management/index.d.ts +363 -0
  50. package/lib/project-management/index.js +23 -25
  51. package/lib/project-management/ios-app.js +5 -4
  52. package/lib/project-management/project-management-api-request-internal.js +5 -5
  53. package/lib/project-management/project-management.js +9 -26
  54. package/lib/remote-config/index.d.ts +359 -0
  55. package/lib/remote-config/index.js +1 -26
  56. package/lib/remote-config/remote-config-api-client-internal.js +3 -3
  57. package/lib/remote-config/remote-config.js +15 -32
  58. package/lib/security-rules/index.d.ts +216 -0
  59. package/lib/security-rules/index.js +1 -24
  60. package/lib/security-rules/security-rules-api-client-internal.js +1 -1
  61. package/lib/security-rules/security-rules-internal.js +1 -1
  62. package/lib/security-rules/security-rules.js +6 -15
  63. package/lib/storage/index.d.ts +60 -0
  64. package/lib/storage/index.js +1 -10
  65. package/lib/storage/storage.js +2 -19
  66. package/lib/utils/api-request.js +10 -3
  67. package/lib/utils/deep-copy.js +2 -1
  68. package/lib/utils/error.js +2 -1
  69. package/lib/utils/index.js +6 -5
  70. package/lib/utils/validator.js +2 -1
  71. package/package.json +15 -12
  72. package/lib/auth.d.ts +0 -2016
  73. package/lib/credential.d.ts +0 -150
  74. package/lib/database.d.ts +0 -1663
  75. package/lib/instance-id.d.ts +0 -37
  76. package/lib/messaging.d.ts +0 -1341
  77. package/lib/project-management/app-metadata.js +0 -37
  78. package/lib/project-management.d.ts +0 -361
  79. package/lib/remote-config/remote-config-api-client.js +0 -36
  80. package/lib/remote-config.d.ts +0 -350
  81. package/lib/security-rules.d.ts +0 -192
  82. package/lib/storage.d.ts +0 -40
@@ -1,37 +0,0 @@
1
- /*! firebase-admin v9.3.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2019 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,361 +0,0 @@
1
- /*! firebase-admin v9.3.0 */
2
- import * as _admin from './index.d';
3
-
4
- export namespace admin.projectManagement {
5
-
6
- /**
7
- * A SHA-1 or SHA-256 certificate.
8
- *
9
- * Do not call this constructor directly. Instead, use
10
- * [`projectManagement.shaCertificate()`](admin.projectManagement.ProjectManagement#shaCertificate).
11
- */
12
- interface ShaCertificate {
13
-
14
- /**
15
- * The SHA certificate type.
16
- *
17
- * @example
18
- * ```javascript
19
- * var certType = shaCertificate.certType;
20
- * ```
21
- */
22
- certType: ('sha1' | 'sha256');
23
-
24
- /**
25
- * The SHA-1 or SHA-256 hash for this certificate.
26
- *
27
- * @example
28
- * ```javascript
29
- * var shaHash = shaCertificate.shaHash;
30
- * ```
31
- */
32
- shaHash: string;
33
-
34
- /**
35
- * The fully-qualified resource name that identifies this sha-key.
36
- *
37
- * This is useful when manually constructing requests for Firebase's public API.
38
- *
39
- * @example
40
- * ```javascript
41
- * var resourceName = shaCertificate.resourceName;
42
- * ```
43
- */
44
- resourceName?: string;
45
- }
46
-
47
- /**
48
- * Metadata about a Firebase app.
49
- */
50
- interface AppMetadata {
51
-
52
- /**
53
- * The globally unique, Firebase-assigned identifier of the app.
54
- *
55
- * @example
56
- * ```javascript
57
- * var appId = appMetadata.appId;
58
- * ```
59
- */
60
- appId: string;
61
-
62
- /**
63
- * The optional user-assigned display name of the app.
64
- *
65
- * @example
66
- * ```javascript
67
- * var displayName = appMetadata.displayName;
68
- * ```
69
- */
70
- displayName?: string;
71
-
72
- /**
73
- * The development platform of the app. Supporting Android and iOS app platforms.
74
- *
75
- * @example
76
- * ```javascript
77
- * var platform = AppPlatform.ANDROID;
78
- * ```
79
- */
80
- platform: AppPlatform;
81
-
82
- /**
83
- * The globally unique, user-assigned ID of the parent project for the app.
84
- *
85
- * @example
86
- * ```javascript
87
- * var projectId = appMetadata.projectId;
88
- * ```
89
- */
90
- projectId: string;
91
-
92
- /**
93
- * The fully-qualified resource name that identifies this app.
94
- *
95
- * This is useful when manually constructing requests for Firebase's public API.
96
- *
97
- * @example
98
- * ```javascript
99
- * var resourceName = androidAppMetadata.resourceName;
100
- * ```
101
- */
102
- resourceName: string;
103
- }
104
-
105
- /**
106
- * Platforms with which a Firebase App can be associated.
107
- */
108
- enum AppPlatform {
109
-
110
- /**
111
- * Unknown state. This is only used for distinguishing unset values.
112
- */
113
- PLATFORM_UNKNOWN = 'PLATFORM_UNKNOWN',
114
-
115
- /**
116
- * The Firebase App is associated with iOS.
117
- */
118
- IOS = 'IOS',
119
-
120
- /**
121
- * The Firebase App is associated with Android.
122
- */
123
- ANDROID = 'ANDROID',
124
- }
125
-
126
- /**
127
- * Metadata about a Firebase Android App.
128
- */
129
- interface AndroidAppMetadata extends AppMetadata {
130
-
131
- platform: AppPlatform.ANDROID;
132
-
133
- /**
134
- * The canonical package name of the Android App, as would appear in the Google Play Developer
135
- * Console.
136
- *
137
- * @example
138
- * ```javascript
139
- * var packageName = androidAppMetadata.packageName;
140
- * ```
141
- */
142
- packageName: string;
143
- }
144
-
145
- /**
146
- * Metadata about a Firebase iOS App.
147
- */
148
- interface IosAppMetadata extends AppMetadata {
149
- platform: AppPlatform.IOS;
150
-
151
- /**
152
- * The canonical bundle ID of the iOS App as it would appear in the iOS App Store.
153
- *
154
- * @example
155
- * ```javascript
156
- * var bundleId = iosAppMetadata.bundleId;
157
- *```
158
- */
159
- bundleId: string;
160
- }
161
-
162
- /**
163
- * A reference to a Firebase Android app.
164
- *
165
- * Do not call this constructor directly. Instead, use
166
- * [`projectManagement.androidApp()`](admin.projectManagement.ProjectManagement#androidApp).
167
- */
168
- interface AndroidApp {
169
- appId: string;
170
-
171
- /**
172
- * Retrieves metadata about this Android app.
173
- *
174
- * @return A promise that resolves to the retrieved metadata about this Android app.
175
- */
176
- getMetadata(): Promise<admin.projectManagement.AndroidAppMetadata>;
177
-
178
- /**
179
- * Sets the optional user-assigned display name of the app.
180
- *
181
- * @param newDisplayName The new display name to set.
182
- *
183
- * @return A promise that resolves when the display name has been set.
184
- */
185
- setDisplayName(newDisplayName: string): Promise<void>;
186
-
187
- /**
188
- * Gets the list of SHA certificates associated with this Android app in Firebase.
189
- *
190
- * @return The list of SHA-1 and SHA-256 certificates associated with this Android app in
191
- * Firebase.
192
- */
193
- getShaCertificates(): Promise<admin.projectManagement.ShaCertificate[]>;
194
-
195
- /**
196
- * Adds the given SHA certificate to this Android app.
197
- *
198
- * @param certificateToAdd The SHA certificate to add.
199
- *
200
- * @return A promise that resolves when the given certificate
201
- * has been added to the Android app.
202
- */
203
- addShaCertificate(certificateToAdd: ShaCertificate): Promise<void>;
204
-
205
- /**
206
- * Deletes the specified SHA certificate from this Android app.
207
- *
208
- * @param certificateToDelete The SHA certificate to delete.
209
- *
210
- * @return A promise that resolves when the specified
211
- * certificate has been removed from the Android app.
212
- */
213
- deleteShaCertificate(certificateToRemove: ShaCertificate): Promise<void>;
214
-
215
- /**
216
- * Gets the configuration artifact associated with this app.
217
- *
218
- * @return A promise that resolves to the Android app's
219
- * Firebase config file, in UTF-8 string format. This string is typically
220
- * intended to be written to a JSON file that gets shipped with your Android
221
- * app.
222
- */
223
- getConfig(): Promise<string>;
224
- }
225
-
226
- /**
227
- * A reference to a Firebase iOS app.
228
- *
229
- * Do not call this constructor directly. Instead, use
230
- * [`projectManagement.iosApp()`](admin.projectManagement.ProjectManagement#iosApp).
231
- */
232
- interface IosApp {
233
- appId: string;
234
-
235
- /**
236
- * Retrieves metadata about this iOS app.
237
- *
238
- * @return {!Promise<admin.projectManagement.IosAppMetadata>} A promise that
239
- * resolves to the retrieved metadata about this iOS app.
240
- */
241
- getMetadata(): Promise<admin.projectManagement.IosAppMetadata>;
242
-
243
- /**
244
- * Sets the optional user-assigned display name of the app.
245
- *
246
- * @param newDisplayName The new display name to set.
247
- *
248
- * @return A promise that resolves when the display name has
249
- * been set.
250
- */
251
- setDisplayName(newDisplayName: string): Promise<void>;
252
-
253
- /**
254
- * Gets the configuration artifact associated with this app.
255
- *
256
- * @return A promise that resolves to the iOS app's Firebase
257
- * config file, in UTF-8 string format. This string is typically intended to
258
- * be written to a plist file that gets shipped with your iOS app.
259
- */
260
- getConfig(): Promise<string>;
261
- }
262
-
263
- /**
264
- * The Firebase ProjectManagement service interface.
265
- *
266
- * Do not call this constructor directly. Instead, use
267
- * [`admin.projectManagement()`](admin.projectManagement#projectManagement).
268
- */
269
- interface ProjectManagement {
270
- app: _admin.app.App;
271
-
272
- /**
273
- * Lists up to 100 Firebase apps associated with this Firebase project.
274
- *
275
- * @return A promise that resolves to the metadata list of the apps.
276
- */
277
- listAppMetadata(): Promise<admin.projectManagement.AppMetadata[]>;
278
-
279
- /**
280
- * Lists up to 100 Firebase Android apps associated with this Firebase project.
281
- *
282
- * @return The list of Android apps.
283
- */
284
- listAndroidApps(): Promise<admin.projectManagement.AndroidApp[]>;
285
-
286
- /**
287
- * Lists up to 100 Firebase iOS apps associated with this Firebase project.
288
- *
289
- * @return The list of iOS apps.
290
- */
291
- listIosApps(): Promise<admin.projectManagement.IosApp[]>;
292
-
293
- /**
294
- * Creates an `AndroidApp` object, referencing the specified Android app within
295
- * this Firebase project.
296
- *
297
- * This method does not perform an RPC.
298
- *
299
- * @param appId The `appId` of the Android app to reference.
300
- *
301
- * @return An `AndroidApp` object that references the specified Firebase Android app.
302
- */
303
- androidApp(appId: string): admin.projectManagement.AndroidApp;
304
-
305
- /**
306
- * Update the display name of this Firebase project.
307
- *
308
- * @param newDisplayName The new display name to be updated.
309
- *
310
- * @return A promise that resolves when the project display name has been updated.
311
- */
312
- setDisplayName(newDisplayName: string): Promise<void>;
313
-
314
- /**
315
- * Creates an `iOSApp` object, referencing the specified iOS app within
316
- * this Firebase project.
317
- *
318
- * This method does not perform an RPC.
319
- *
320
- * @param appId The `appId` of the iOS app to reference.
321
- *
322
- * @return An `iOSApp` object that references the specified Firebase iOS app.
323
- */
324
- iosApp(appId: string): admin.projectManagement.IosApp;
325
-
326
- /**
327
- * Creates a `ShaCertificate` object.
328
- *
329
- * This method does not perform an RPC.
330
- *
331
- * @param shaHash The SHA-1 or SHA-256 hash for this certificate.
332
- *
333
- * @return A `ShaCertificate` object contains the specified SHA hash.
334
- */
335
- shaCertificate(shaHash: string): admin.projectManagement.ShaCertificate;
336
-
337
- /**
338
- * Creates a new Firebase Android app associated with this Firebase project.
339
- *
340
- * @param packageName The canonical package name of the Android App,
341
- * as would appear in the Google Play Developer Console.
342
- * @param displayName An optional user-assigned display name for this
343
- * new app.
344
- *
345
- * @return A promise that resolves to the newly created Android app.
346
- */
347
- createAndroidApp(
348
- packageName: string, displayName?: string): Promise<admin.projectManagement.AndroidApp>;
349
-
350
- /**
351
- * Creates a new Firebase iOS app associated with this Firebase project.
352
- *
353
- * @param bundleId The iOS app bundle ID to use for this new app.
354
- * @param displayName An optional user-assigned display name for this
355
- * new app.
356
- *
357
- * @return A promise that resolves to the newly created iOS app.
358
- */
359
- createIosApp(bundleId: string, displayName?: string): Promise<admin.projectManagement.IosApp>;
360
- }
361
- }
@@ -1,36 +0,0 @@
1
- /*! firebase-admin v9.3.0 */
2
- "use strict";
3
- /*!
4
- * Copyright 2020 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.TagColor = void 0;
20
- /**
21
- * Colors that are associated with conditions for display purposes.
22
- */
23
- var TagColor;
24
- (function (TagColor) {
25
- TagColor["BLUE"] = "Blue";
26
- TagColor["BROWN"] = "Brown";
27
- TagColor["CYAN"] = "Cyan";
28
- TagColor["DEEP_ORANGE"] = "Red Orange";
29
- TagColor["GREEN"] = "Green";
30
- TagColor["INDIGO"] = "Indigo";
31
- TagColor["LIME"] = "Lime";
32
- TagColor["ORANGE"] = "Orange";
33
- TagColor["PINK"] = "Pink";
34
- TagColor["PURPLE"] = "Purple";
35
- TagColor["TEAL"] = "Teal";
36
- })(TagColor = exports.TagColor || (exports.TagColor = {}));