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
  /*!
3
3
  * Copyright 2020 Google Inc.
4
4
  *
@@ -14,356 +14,39 @@
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 remoteConfig.RemoteConfig `RemoteConfig`} service for the
20
- * default app or a given app.
18
+ * Firebase Remote Config.
21
19
  *
22
- * `admin.remoteConfig()` can be called with no arguments to access the default
23
- * app's {@link remoteConfig.RemoteConfig `RemoteConfig`} service or as
24
- * `admin.remoteConfig(app)` to access the
25
- * {@link remoteConfig.RemoteConfig `RemoteConfig`} service associated with a
26
- * specific app.
20
+ * @packageDocumentation
21
+ */
22
+ import { App } from '../app';
23
+ import { RemoteConfig } from './remote-config';
24
+ export { ExplicitParameterValue, InAppDefaultValue, ListVersionsOptions, ListVersionsResult, ParameterValueType, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, RemoteConfigUser, TagColor, Version, } from './remote-config-api';
25
+ export { RemoteConfig } from './remote-config';
26
+ /**
27
+ * Gets the {@link RemoteConfig} service for the default app or a given app.
28
+ *
29
+ * `getRemoteConfig()` can be called with no arguments to access the default
30
+ * app's `RemoteConfig` service or as `getRemoteConfig(app)` to access the
31
+ * `RemoteConfig` service associated with a specific app.
27
32
  *
28
33
  * @example
29
34
  * ```javascript
30
35
  * // Get the `RemoteConfig` service for the default app
31
- * var defaultRemoteConfig = admin.remoteConfig();
36
+ * const defaultRemoteConfig = getRemoteConfig();
32
37
  * ```
33
38
  *
34
39
  * @example
35
40
  * ```javascript
36
41
  * // Get the `RemoteConfig` service for a given app
37
- * var otherRemoteConfig = admin.remoteConfig(otherApp);
42
+ * const otherRemoteConfig = getRemoteConfig(otherApp);
38
43
  * ```
39
44
  *
40
- * @param app Optional app for which to return the `RemoteConfig` service.
45
+ * @param app - Optional app for which to return the `RemoteConfig` service.
41
46
  * If not provided, the default `RemoteConfig` service is returned.
42
47
  *
43
- * @return The default `RemoteConfig` service if no
48
+ * @returns The default `RemoteConfig` service if no
44
49
  * app is provided, or the `RemoteConfig` service associated with the provided
45
50
  * app.
46
51
  */
47
- export declare function remoteConfig(app?: app.App): remoteConfig.RemoteConfig;
48
- export declare namespace remoteConfig {
49
- /**
50
- * Interface representing options for Remote Config list versions operation.
51
- */
52
- interface ListVersionsOptions {
53
- /**
54
- * The maximum number of items to return per page.
55
- */
56
- pageSize?: number;
57
- /**
58
- * The `nextPageToken` value returned from a previous list versions request, if any.
59
- */
60
- pageToken?: string;
61
- /**
62
- * Specifies the newest version number to include in the results.
63
- * If specified, must be greater than zero. Defaults to the newest version.
64
- */
65
- endVersionNumber?: string | number;
66
- /**
67
- * Specifies the earliest update time to include in the results. Any entries updated before this
68
- * time are omitted.
69
- */
70
- startTime?: Date | string;
71
- /**
72
- * Specifies the latest update time to include in the results. Any entries updated on or after
73
- * this time are omitted.
74
- */
75
- endTime?: Date | string;
76
- }
77
- /**
78
- * Interface representing a list of Remote Config template versions.
79
- */
80
- interface ListVersionsResult {
81
- /**
82
- * A list of version metadata objects, sorted in reverse chronological order.
83
- */
84
- versions: Version[];
85
- /**
86
- * Token to retrieve the next page of results, or empty if there are no more results
87
- * in the list.
88
- */
89
- nextPageToken?: string;
90
- }
91
- /**
92
- * Interface representing a Remote Config condition.
93
- * A condition targets a specific group of users. A list of these conditions make up
94
- * part of a Remote Config template.
95
- */
96
- interface RemoteConfigCondition {
97
- /**
98
- * A non-empty and unique name of this condition.
99
- */
100
- name: string;
101
- /**
102
- * The logic of this condition.
103
- * See the documentation on
104
- * {@link https://firebase.google.com/docs/remote-config/condition-reference condition expressions}
105
- * for the expected syntax of this field.
106
- */
107
- expression: string;
108
- /**
109
- * The color associated with this condition for display purposes in the Firebase Console.
110
- * Not specifying this value results in the console picking an arbitrary color to associate
111
- * with the condition.
112
- */
113
- tagColor?: TagColor;
114
- }
115
- /**
116
- * Interface representing a Remote Config parameter.
117
- * At minimum, a `defaultValue` or a `conditionalValues` entry must be present for the
118
- * parameter to have any effect.
119
- */
120
- interface RemoteConfigParameter {
121
- /**
122
- * The value to set the parameter to, when none of the named conditions evaluate to `true`.
123
- */
124
- defaultValue?: RemoteConfigParameterValue;
125
- /**
126
- * A `(condition name, value)` map. The condition name of the highest priority
127
- * (the one listed first in the Remote Config template's conditions list) determines the value of
128
- * this parameter.
129
- */
130
- conditionalValues?: {
131
- [key: string]: RemoteConfigParameterValue;
132
- };
133
- /**
134
- * A description for this parameter. Should not be over 100 characters and may contain any
135
- * Unicode characters.
136
- */
137
- description?: string;
138
- /**
139
- * The data type for all values of this parameter in the current version of the template.
140
- * Defaults to `ParameterValueType.STRING` if unspecified.
141
- */
142
- valueType?: ParameterValueType;
143
- }
144
- /**
145
- * Interface representing a Remote Config parameter group.
146
- * Grouping parameters is only for management purposes and does not affect client-side
147
- * fetching of parameter values.
148
- */
149
- interface RemoteConfigParameterGroup {
150
- /**
151
- * A description for the group. Its length must be less than or equal to 256 characters.
152
- * A description may contain any Unicode characters.
153
- */
154
- description?: string;
155
- /**
156
- * Map of parameter keys to their optional default values and optional conditional values for
157
- * parameters that belong to this group. A parameter only appears once per
158
- * Remote Config template. An ungrouped parameter appears at the top level, whereas a
159
- * parameter organized within a group appears within its group's map of parameters.
160
- */
161
- parameters: {
162
- [key: string]: RemoteConfigParameter;
163
- };
164
- }
165
- /**
166
- * Interface representing an explicit parameter value.
167
- */
168
- interface ExplicitParameterValue {
169
- /**
170
- * The `string` value that the parameter is set to.
171
- */
172
- value: string;
173
- }
174
- /**
175
- * Interface representing an in-app-default value.
176
- */
177
- interface InAppDefaultValue {
178
- /**
179
- * If `true`, the parameter is omitted from the parameter values returned to a client.
180
- */
181
- useInAppDefault: boolean;
182
- }
183
- /**
184
- * Type representing a Remote Config parameter value.
185
- * A `RemoteConfigParameterValue` could be either an `ExplicitParameterValue` or
186
- * an `InAppDefaultValue`.
187
- */
188
- type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue;
189
- /**
190
- * Interface representing a Remote Config template.
191
- */
192
- interface RemoteConfigTemplate {
193
- /**
194
- * A list of conditions in descending order by priority.
195
- */
196
- conditions: RemoteConfigCondition[];
197
- /**
198
- * Map of parameter keys to their optional default values and optional conditional values.
199
- */
200
- parameters: {
201
- [key: string]: RemoteConfigParameter;
202
- };
203
- /**
204
- * Map of parameter group names to their parameter group objects.
205
- * A group's name is mutable but must be unique among groups in the Remote Config template.
206
- * The name is limited to 256 characters and intended to be human-readable. Any Unicode
207
- * characters are allowed.
208
- */
209
- parameterGroups: {
210
- [key: string]: RemoteConfigParameterGroup;
211
- };
212
- /**
213
- * ETag of the current Remote Config template (readonly).
214
- */
215
- readonly etag: string;
216
- /**
217
- * Version information for the current Remote Config template.
218
- */
219
- version?: Version;
220
- }
221
- /**
222
- * Interface representing a Remote Config user.
223
- */
224
- interface RemoteConfigUser {
225
- /**
226
- * Email address. Output only.
227
- */
228
- email: string;
229
- /**
230
- * Display name. Output only.
231
- */
232
- name?: string;
233
- /**
234
- * Image URL. Output only.
235
- */
236
- imageUrl?: string;
237
- }
238
- /**
239
- * Colors that are associated with conditions for display purposes.
240
- */
241
- type TagColor = 'BLUE' | 'BROWN' | 'CYAN' | 'DEEP_ORANGE' | 'GREEN' | 'INDIGO' | 'LIME' | 'ORANGE' | 'PINK' | 'PURPLE' | 'TEAL';
242
- /**
243
- * Type representing a Remote Config parameter value data type.
244
- * Defaults to `STRING` if unspecified.
245
- */
246
- type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';
247
- /**
248
- * Interface representing a Remote Config template version.
249
- * Output only, except for the version description. Contains metadata about a particular
250
- * version of the Remote Config template. All fields are set at the time the specified Remote
251
- * Config template is published. A version's description field may be specified in
252
- * `publishTemplate` calls.
253
- */
254
- interface Version {
255
- /**
256
- * The version number of a Remote Config template.
257
- */
258
- versionNumber?: string;
259
- /**
260
- * The timestamp of when this version of the Remote Config template was written to the
261
- * Remote Config backend.
262
- */
263
- updateTime?: string;
264
- /**
265
- * The origin of the template update action.
266
- */
267
- updateOrigin?: ('REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED' | 'CONSOLE' | 'REST_API' | 'ADMIN_SDK_NODE');
268
- /**
269
- * The type of the template update action.
270
- */
271
- updateType?: ('REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED' | 'INCREMENTAL_UPDATE' | 'FORCED_UPDATE' | 'ROLLBACK');
272
- /**
273
- * Aggregation of all metadata fields about the account that performed the update.
274
- */
275
- updateUser?: RemoteConfigUser;
276
- /**
277
- * The user-provided description of the corresponding Remote Config template.
278
- */
279
- description?: string;
280
- /**
281
- * The version number of the Remote Config template that has become the current version
282
- * due to a rollback. Only present if this version is the result of a rollback.
283
- */
284
- rollbackSource?: string;
285
- /**
286
- * Indicates whether this Remote Config template was published before version history was
287
- * supported.
288
- */
289
- isLegacy?: boolean;
290
- }
291
- /**
292
- * The Firebase `RemoteConfig` service interface.
293
- */
294
- interface RemoteConfig {
295
- app: app.App;
296
- /**
297
- * Gets the current active version of the {@link remoteConfig.RemoteConfigTemplate
298
- * `RemoteConfigTemplate`} of the project.
299
- *
300
- * @return A promise that fulfills with a `RemoteConfigTemplate`.
301
- */
302
- getTemplate(): Promise<RemoteConfigTemplate>;
303
- /**
304
- * Gets the requested version of the {@link remoteConfig.RemoteConfigTemplate
305
- * `RemoteConfigTemplate`} of the project.
306
- *
307
- * @param versionNumber Version number of the Remote Config template to look up.
308
- *
309
- * @return A promise that fulfills with a `RemoteConfigTemplate`.
310
- */
311
- getTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>;
312
- /**
313
- * Validates a {@link remoteConfig.RemoteConfigTemplate `RemoteConfigTemplate`}.
314
- *
315
- * @param template The Remote Config template to be validated.
316
- * @returns A promise that fulfills with the validated `RemoteConfigTemplate`.
317
- */
318
- validateTemplate(template: RemoteConfigTemplate): Promise<RemoteConfigTemplate>;
319
- /**
320
- * Publishes a Remote Config template.
321
- *
322
- * @param template The Remote Config template to be published.
323
- * @param options Optional options object when publishing a Remote Config template:
324
- * - {boolean} `force` Setting this to `true` forces the Remote Config template to
325
- * be updated and circumvent the ETag. This approach is not recommended
326
- * because it risks causing the loss of updates to your Remote Config
327
- * template if multiple clients are updating the Remote Config template.
328
- * See {@link https://firebase.google.com/docs/remote-config/use-config-rest#etag_usage_and_forced_updates
329
- * ETag usage and forced updates}.
330
- *
331
- * @return A Promise that fulfills with the published `RemoteConfigTemplate`.
332
- */
333
- publishTemplate(template: RemoteConfigTemplate, options?: {
334
- force: boolean;
335
- }): Promise<RemoteConfigTemplate>;
336
- /**
337
- * Rolls back a project's published Remote Config template to the specified version.
338
- * A rollback is equivalent to getting a previously published Remote Config
339
- * template and re-publishing it using a force update.
340
- *
341
- * @param versionNumber The version number of the Remote Config template to roll back to.
342
- * The specified version number must be lower than the current version number, and not have
343
- * been deleted due to staleness. Only the last 300 versions are stored.
344
- * All versions that correspond to non-active Remote Config templates (that is, all except the
345
- * template that is being fetched by clients) are also deleted if they are more than 90 days old.
346
- * @return A promise that fulfills with the published `RemoteConfigTemplate`.
347
- */
348
- rollback(versionNumber: string | number): Promise<RemoteConfigTemplate>;
349
- /**
350
- * Gets a list of Remote Config template versions that have been published, sorted in reverse
351
- * chronological order. Only the last 300 versions are stored.
352
- * All versions that correspond to non-active Remote Config templates (that is, all except the
353
- * template that is being fetched by clients) are also deleted if they are more than 90 days old.
354
- *
355
- * @param options Optional {@link remoteConfig.ListVersionsOptions `ListVersionsOptions`}
356
- * object for getting a list of template versions.
357
- * @return A promise that fulfills with a `ListVersionsResult`.
358
- */
359
- listVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>;
360
- /**
361
- * Creates and returns a new Remote Config template from a JSON string.
362
- *
363
- * @param json The JSON string to populate a Remote Config template.
364
- *
365
- * @return A new template instance.
366
- */
367
- createTemplateFromJSON(json: string): RemoteConfigTemplate;
368
- }
369
- }
52
+ export declare function getRemoteConfig(app?: App): RemoteConfig;
@@ -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,3 +16,47 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.getRemoteConfig = void 0;
20
+ /**
21
+ * Firebase Remote Config.
22
+ *
23
+ * @packageDocumentation
24
+ */
25
+ var app_1 = require("../app");
26
+ var remote_config_1 = require("./remote-config");
27
+ var remote_config_2 = require("./remote-config");
28
+ Object.defineProperty(exports, "RemoteConfig", { enumerable: true, get: function () { return remote_config_2.RemoteConfig; } });
29
+ /**
30
+ * Gets the {@link RemoteConfig} service for the default app or a given app.
31
+ *
32
+ * `getRemoteConfig()` can be called with no arguments to access the default
33
+ * app's `RemoteConfig` service or as `getRemoteConfig(app)` to access the
34
+ * `RemoteConfig` service associated with a specific app.
35
+ *
36
+ * @example
37
+ * ```javascript
38
+ * // Get the `RemoteConfig` service for the default app
39
+ * const defaultRemoteConfig = getRemoteConfig();
40
+ * ```
41
+ *
42
+ * @example
43
+ * ```javascript
44
+ * // Get the `RemoteConfig` service for a given app
45
+ * const otherRemoteConfig = getRemoteConfig(otherApp);
46
+ * ```
47
+ *
48
+ * @param app - Optional app for which to return the `RemoteConfig` service.
49
+ * If not provided, the default `RemoteConfig` service is returned.
50
+ *
51
+ * @returns The default `RemoteConfig` service if no
52
+ * app is provided, or the `RemoteConfig` service associated with the provided
53
+ * app.
54
+ */
55
+ function getRemoteConfig(app) {
56
+ if (typeof app === 'undefined') {
57
+ app = app_1.getApp();
58
+ }
59
+ var firebaseApp = app;
60
+ return firebaseApp.getOrInitService('remoteConfig', function (app) { return new remote_config_1.RemoteConfig(app); });
61
+ }
62
+ exports.getRemoteConfig = getRemoteConfig;
@@ -0,0 +1,28 @@
1
+ /*! firebase-admin v10.0.0 */
2
+ /*!
3
+ * Copyright 2020 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 { PrefixedFirebaseError } from '../utils/error';
18
+ export declare type RemoteConfigErrorCode = 'aborted' | 'already-exists' | 'failed-precondition' | 'internal-error' | 'invalid-argument' | 'not-found' | 'out-of-range' | 'permission-denied' | 'resource-exhausted' | 'unauthenticated' | 'unknown-error';
19
+ /**
20
+ * Firebase Remote Config error code structure. This extends PrefixedFirebaseError.
21
+ *
22
+ * @param {RemoteConfigErrorCode} code The error code.
23
+ * @param {string} message The error message.
24
+ * @constructor
25
+ */
26
+ export declare class FirebaseRemoteConfigError extends PrefixedFirebaseError {
27
+ constructor(code: RemoteConfigErrorCode, message: string);
28
+ }
@@ -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.
@@ -59,7 +59,7 @@ var FIREBASE_REMOTE_CONFIG_HEADERS = {
59
59
  /**
60
60
  * Class that facilitates sending requests to the Firebase Remote Config backend API.
61
61
  *
62
- * @private
62
+ * @internal
63
63
  */
64
64
  var RemoteConfigApiClient = /** @class */ (function () {
65
65
  function RemoteConfigApiClient(app) {
@@ -322,7 +322,7 @@ var RemoteConfigApiClient = /** @class */ (function () {
322
322
  *
323
323
  * @param {ListVersionsOptions} options An options object to be validated.
324
324
  *
325
- * @return {ListVersionsOptions} A copy of the provided options object with timestamps converted
325
+ * @returns {ListVersionsOptions} A copy of the provided options object with timestamps converted
326
326
  * to UTC Zulu format.
327
327
  */
328
328
  RemoteConfigApiClient.prototype.validateListVersionsOptions = function (options) {