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,258 @@
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
+ * Colors that are associated with conditions for display purposes.
19
+ */
20
+ export declare type TagColor = 'BLUE' | 'BROWN' | 'CYAN' | 'DEEP_ORANGE' | 'GREEN' | 'INDIGO' | 'LIME' | 'ORANGE' | 'PINK' | 'PURPLE' | 'TEAL';
21
+ /**
22
+ * Type representing a Remote Config parameter value data type.
23
+ * Defaults to `STRING` if unspecified.
24
+ */
25
+ export declare type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';
26
+ /**
27
+ * Interface representing a Remote Config condition.
28
+ * A condition targets a specific group of users. A list of these conditions make up
29
+ * part of a Remote Config template.
30
+ */
31
+ export interface RemoteConfigCondition {
32
+ /**
33
+ * A non-empty and unique name of this condition.
34
+ */
35
+ name: string;
36
+ /**
37
+ * The logic of this condition.
38
+ * See the documentation on
39
+ * {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
40
+ * for the expected syntax of this field.
41
+ */
42
+ expression: string;
43
+ /**
44
+ * The color associated with this condition for display purposes in the Firebase Console.
45
+ * Not specifying this value results in the console picking an arbitrary color to associate
46
+ * with the condition.
47
+ */
48
+ tagColor?: TagColor;
49
+ }
50
+ /**
51
+ * Interface representing an explicit parameter value.
52
+ */
53
+ export interface ExplicitParameterValue {
54
+ /**
55
+ * The `string` value that the parameter is set to.
56
+ */
57
+ value: string;
58
+ }
59
+ /**
60
+ * Interface representing an in-app-default value.
61
+ */
62
+ export interface InAppDefaultValue {
63
+ /**
64
+ * If `true`, the parameter is omitted from the parameter values returned to a client.
65
+ */
66
+ useInAppDefault: boolean;
67
+ }
68
+ /**
69
+ * Type representing a Remote Config parameter value.
70
+ * A `RemoteConfigParameterValue` could be either an `ExplicitParameterValue` or
71
+ * an `InAppDefaultValue`.
72
+ */
73
+ export declare type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue;
74
+ /**
75
+ * Interface representing a Remote Config parameter.
76
+ * At minimum, a `defaultValue` or a `conditionalValues` entry must be present for the
77
+ * parameter to have any effect.
78
+ */
79
+ export interface RemoteConfigParameter {
80
+ /**
81
+ * The value to set the parameter to, when none of the named conditions evaluate to `true`.
82
+ */
83
+ defaultValue?: RemoteConfigParameterValue;
84
+ /**
85
+ * A `(condition name, value)` map. The condition name of the highest priority
86
+ * (the one listed first in the Remote Config template's conditions list) determines the value of
87
+ * this parameter.
88
+ */
89
+ conditionalValues?: {
90
+ [key: string]: RemoteConfigParameterValue;
91
+ };
92
+ /**
93
+ * A description for this parameter. Should not be over 100 characters and may contain any
94
+ * Unicode characters.
95
+ */
96
+ description?: string;
97
+ /**
98
+ * The data type for all values of this parameter in the current version of the template.
99
+ * Defaults to `ParameterValueType.STRING` if unspecified.
100
+ */
101
+ valueType?: ParameterValueType;
102
+ }
103
+ /**
104
+ * Interface representing a Remote Config parameter group.
105
+ * Grouping parameters is only for management purposes and does not affect client-side
106
+ * fetching of parameter values.
107
+ */
108
+ export interface RemoteConfigParameterGroup {
109
+ /**
110
+ * A description for the group. Its length must be less than or equal to 256 characters.
111
+ * A description may contain any Unicode characters.
112
+ */
113
+ description?: string;
114
+ /**
115
+ * Map of parameter keys to their optional default values and optional conditional values for
116
+ * parameters that belong to this group. A parameter only appears once per
117
+ * Remote Config template. An ungrouped parameter appears at the top level, whereas a
118
+ * parameter organized within a group appears within its group's map of parameters.
119
+ */
120
+ parameters: {
121
+ [key: string]: RemoteConfigParameter;
122
+ };
123
+ }
124
+ /**
125
+ * Interface representing a Remote Config template.
126
+ */
127
+ export interface RemoteConfigTemplate {
128
+ /**
129
+ * A list of conditions in descending order by priority.
130
+ */
131
+ conditions: RemoteConfigCondition[];
132
+ /**
133
+ * Map of parameter keys to their optional default values and optional conditional values.
134
+ */
135
+ parameters: {
136
+ [key: string]: RemoteConfigParameter;
137
+ };
138
+ /**
139
+ * Map of parameter group names to their parameter group objects.
140
+ * A group's name is mutable but must be unique among groups in the Remote Config template.
141
+ * The name is limited to 256 characters and intended to be human-readable. Any Unicode
142
+ * characters are allowed.
143
+ */
144
+ parameterGroups: {
145
+ [key: string]: RemoteConfigParameterGroup;
146
+ };
147
+ /**
148
+ * ETag of the current Remote Config template (readonly).
149
+ */
150
+ readonly etag: string;
151
+ /**
152
+ * Version information for the current Remote Config template.
153
+ */
154
+ version?: Version;
155
+ }
156
+ /**
157
+ * Interface representing a Remote Config user.
158
+ */
159
+ export interface RemoteConfigUser {
160
+ /**
161
+ * Email address. Output only.
162
+ */
163
+ email: string;
164
+ /**
165
+ * Display name. Output only.
166
+ */
167
+ name?: string;
168
+ /**
169
+ * Image URL. Output only.
170
+ */
171
+ imageUrl?: string;
172
+ }
173
+ /**
174
+ * Interface representing a Remote Config template version.
175
+ * Output only, except for the version description. Contains metadata about a particular
176
+ * version of the Remote Config template. All fields are set at the time the specified Remote
177
+ * Config template is published. A version's description field may be specified in
178
+ * `publishTemplate` calls.
179
+ */
180
+ export interface Version {
181
+ /**
182
+ * The version number of a Remote Config template.
183
+ */
184
+ versionNumber?: string;
185
+ /**
186
+ * The timestamp of when this version of the Remote Config template was written to the
187
+ * Remote Config backend.
188
+ */
189
+ updateTime?: string;
190
+ /**
191
+ * The origin of the template update action.
192
+ */
193
+ updateOrigin?: ('REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED' | 'CONSOLE' | 'REST_API' | 'ADMIN_SDK_NODE');
194
+ /**
195
+ * The type of the template update action.
196
+ */
197
+ updateType?: ('REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED' | 'INCREMENTAL_UPDATE' | 'FORCED_UPDATE' | 'ROLLBACK');
198
+ /**
199
+ * Aggregation of all metadata fields about the account that performed the update.
200
+ */
201
+ updateUser?: RemoteConfigUser;
202
+ /**
203
+ * The user-provided description of the corresponding Remote Config template.
204
+ */
205
+ description?: string;
206
+ /**
207
+ * The version number of the Remote Config template that has become the current version
208
+ * due to a rollback. Only present if this version is the result of a rollback.
209
+ */
210
+ rollbackSource?: string;
211
+ /**
212
+ * Indicates whether this Remote Config template was published before version history was
213
+ * supported.
214
+ */
215
+ isLegacy?: boolean;
216
+ }
217
+ /**
218
+ * Interface representing a list of Remote Config template versions.
219
+ */
220
+ export interface ListVersionsResult {
221
+ /**
222
+ * A list of version metadata objects, sorted in reverse chronological order.
223
+ */
224
+ versions: Version[];
225
+ /**
226
+ * Token to retrieve the next page of results, or empty if there are no more results
227
+ * in the list.
228
+ */
229
+ nextPageToken?: string;
230
+ }
231
+ /**
232
+ * Interface representing options for Remote Config list versions operation.
233
+ */
234
+ export interface ListVersionsOptions {
235
+ /**
236
+ * The maximum number of items to return per page.
237
+ */
238
+ pageSize?: number;
239
+ /**
240
+ * The `nextPageToken` value returned from a previous list versions request, if any.
241
+ */
242
+ pageToken?: string;
243
+ /**
244
+ * Specifies the newest version number to include in the results.
245
+ * If specified, must be greater than zero. Defaults to the newest version.
246
+ */
247
+ endVersionNumber?: string | number;
248
+ /**
249
+ * Specifies the earliest update time to include in the results. Any entries updated before this
250
+ * time are omitted.
251
+ */
252
+ startTime?: Date | string;
253
+ /**
254
+ * Specifies the latest update time to include in the results. Any entries updated on or after
255
+ * this time are omitted.
256
+ */
257
+ endTime?: Date | string;
258
+ }
@@ -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,105 @@
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 { ExplicitParameterValue as TExplicitParameterValue, InAppDefaultValue as TInAppDefaultValue, ListVersionsOptions as TListVersionsOptions, ListVersionsResult as TListVersionsResult, ParameterValueType as TParameterValueType, RemoteConfigCondition as TRemoteConfigCondition, RemoteConfigParameter as TRemoteConfigParameter, RemoteConfigParameterGroup as TRemoteConfigParameterGroup, RemoteConfigParameterValue as TRemoteConfigParameterValue, RemoteConfigTemplate as TRemoteConfigTemplate, RemoteConfigUser as TRemoteConfigUser, TagColor as TTagColor, Version as TVersion } from './remote-config-api';
19
+ import { RemoteConfig as TRemoteConfig } from './remote-config';
20
+ /**
21
+ * Gets the {@link firebase-admin.remote-config#RemoteConfig} service for the
22
+ * default app or a given app.
23
+ *
24
+ * `admin.remoteConfig()` can be called with no arguments to access the default
25
+ * app's `RemoteConfig` service or as `admin.remoteConfig(app)` to access the
26
+ * `RemoteConfig` service associated with a specific app.
27
+ *
28
+ * @example
29
+ * ```javascript
30
+ * // Get the `RemoteConfig` service for the default app
31
+ * var defaultRemoteConfig = admin.remoteConfig();
32
+ * ```
33
+ *
34
+ * @example
35
+ * ```javascript
36
+ * // Get the `RemoteConfig` service for a given app
37
+ * var otherRemoteConfig = admin.remoteConfig(otherApp);
38
+ * ```
39
+ *
40
+ * @param app - Optional app for which to return the `RemoteConfig` service.
41
+ * If not provided, the default `RemoteConfig` service is returned.
42
+ *
43
+ * @returns The default `RemoteConfig` service if no
44
+ * app is provided, or the `RemoteConfig` service associated with the provided
45
+ * app.
46
+ */
47
+ export declare function remoteConfig(app?: App): remoteConfig.RemoteConfig;
48
+ export declare namespace remoteConfig {
49
+ /**
50
+ * Type alias to {@link firebase-admin.remote-config#ExplicitParameterValue}.
51
+ */
52
+ type ExplicitParameterValue = TExplicitParameterValue;
53
+ /**
54
+ * Type alias to {@link firebase-admin.remote-config#InAppDefaultValue}.
55
+ */
56
+ type InAppDefaultValue = TInAppDefaultValue;
57
+ /**
58
+ * Type alias to {@link firebase-admin.remote-config#ListVersionsOptions}.
59
+ */
60
+ type ListVersionsOptions = TListVersionsOptions;
61
+ /**
62
+ * Type alias to {@link firebase-admin.remote-config#ListVersionsResult}.
63
+ */
64
+ type ListVersionsResult = TListVersionsResult;
65
+ /**
66
+ * Type alias to {@link firebase-admin.remote-config#ParameterValueType}.
67
+ */
68
+ type ParameterValueType = TParameterValueType;
69
+ /**
70
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfig}.
71
+ */
72
+ type RemoteConfig = TRemoteConfig;
73
+ /**
74
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigCondition}.
75
+ */
76
+ type RemoteConfigCondition = TRemoteConfigCondition;
77
+ /**
78
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigParameter}.
79
+ */
80
+ type RemoteConfigParameter = TRemoteConfigParameter;
81
+ /**
82
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigParameterGroup}.
83
+ */
84
+ type RemoteConfigParameterGroup = TRemoteConfigParameterGroup;
85
+ /**
86
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigParameterValue}.
87
+ */
88
+ type RemoteConfigParameterValue = TRemoteConfigParameterValue;
89
+ /**
90
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigTemplate}.
91
+ */
92
+ type RemoteConfigTemplate = TRemoteConfigTemplate;
93
+ /**
94
+ * Type alias to {@link firebase-admin.remote-config#RemoteConfigUser}.
95
+ */
96
+ type RemoteConfigUser = TRemoteConfigUser;
97
+ /**
98
+ * Type alias to {@link firebase-admin.remote-config#TagColor}.
99
+ */
100
+ type TagColor = TTagColor;
101
+ /**
102
+ * Type alias to {@link firebase-admin.remote-config#Version}.
103
+ */
104
+ type Version = TVersion;
105
+ }
@@ -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,94 @@
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 { App } from '../app';
18
+ import { ListVersionsOptions, ListVersionsResult, RemoteConfigTemplate } from './remote-config-api';
19
+ /**
20
+ * The Firebase `RemoteConfig` service interface.
21
+ */
22
+ export declare class RemoteConfig {
23
+ readonly app: App;
24
+ private readonly client;
25
+ /**
26
+ * Gets the current active version of the {@link RemoteConfigTemplate} of the project.
27
+ *
28
+ * @returns A promise that fulfills with a `RemoteConfigTemplate`.
29
+ */
30
+ getTemplate(): Promise<RemoteConfigTemplate>;
31
+ /**
32
+ * Gets the requested version of the {@link RemoteConfigTemplate} of the project.
33
+ *
34
+ * @param versionNumber - Version number of the Remote Config template to look up.
35
+ *
36
+ * @returns A promise that fulfills with a `RemoteConfigTemplate`.
37
+ */
38
+ getTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>;
39
+ /**
40
+ * Validates a {@link RemoteConfigTemplate}.
41
+ *
42
+ * @param template - The Remote Config template to be validated.
43
+ * @returns A promise that fulfills with the validated `RemoteConfigTemplate`.
44
+ */
45
+ validateTemplate(template: RemoteConfigTemplate): Promise<RemoteConfigTemplate>;
46
+ /**
47
+ * Publishes a Remote Config template.
48
+ *
49
+ * @param template - The Remote Config template to be published.
50
+ * @param options - Optional options object when publishing a Remote Config template:
51
+ * - `force`: Setting this to `true` forces the Remote Config template to
52
+ * be updated and circumvent the ETag. This approach is not recommended
53
+ * because it risks causing the loss of updates to your Remote Config
54
+ * template if multiple clients are updating the Remote Config template.
55
+ * See {@link https://firebase.google.com/docs/remote-config/use-config-rest#etag_usage_and_forced_updates |
56
+ * ETag usage and forced updates}.
57
+ *
58
+ * @returns A Promise that fulfills with the published `RemoteConfigTemplate`.
59
+ */
60
+ publishTemplate(template: RemoteConfigTemplate, options?: {
61
+ force: boolean;
62
+ }): Promise<RemoteConfigTemplate>;
63
+ /**
64
+ * Rolls back a project's published Remote Config template to the specified version.
65
+ * A rollback is equivalent to getting a previously published Remote Config
66
+ * template and re-publishing it using a force update.
67
+ *
68
+ * @param versionNumber - The version number of the Remote Config template to roll back to.
69
+ * The specified version number must be lower than the current version number, and not have
70
+ * been deleted due to staleness. Only the last 300 versions are stored.
71
+ * All versions that correspond to non-active Remote Config templates (that is, all except the
72
+ * template that is being fetched by clients) are also deleted if they are more than 90 days old.
73
+ * @returns A promise that fulfills with the published `RemoteConfigTemplate`.
74
+ */
75
+ rollback(versionNumber: number | string): Promise<RemoteConfigTemplate>;
76
+ /**
77
+ * Gets a list of Remote Config template versions that have been published, sorted in reverse
78
+ * chronological order. Only the last 300 versions are stored.
79
+ * All versions that correspond to non-active Remote Config templates (i.e., all except the
80
+ * template that is being fetched by clients) are also deleted if they are older than 90 days.
81
+ *
82
+ * @param options - Optional options object for getting a list of versions.
83
+ * @returns A promise that fulfills with a `ListVersionsResult`.
84
+ */
85
+ listVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>;
86
+ /**
87
+ * Creates and returns a new Remote Config template from a JSON string.
88
+ *
89
+ * @param json - The JSON string to populate a Remote Config template.
90
+ *
91
+ * @returns A new template instance.
92
+ */
93
+ createTemplateFromJSON(json: string): RemoteConfigTemplate;
94
+ }
@@ -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.
@@ -20,22 +20,22 @@ exports.RemoteConfig = void 0;
20
20
  var validator = require("../utils/validator");
21
21
  var remote_config_api_client_internal_1 = require("./remote-config-api-client-internal");
22
22
  /**
23
- * Remote Config service bound to the provided app.
23
+ * The Firebase `RemoteConfig` service interface.
24
24
  */
25
25
  var RemoteConfig = /** @class */ (function () {
26
26
  /**
27
- * @param app The app for this RemoteConfig service.
27
+ * @param app - The app for this RemoteConfig service.
28
28
  * @constructor
29
+ * @internal
29
30
  */
30
31
  function RemoteConfig(app) {
31
32
  this.app = app;
32
33
  this.client = new remote_config_api_client_internal_1.RemoteConfigApiClient(app);
33
34
  }
34
35
  /**
35
- * Gets the current active version of the {@link remoteConfig.RemoteConfigTemplate
36
- * `RemoteConfigTemplate`} of the project.
36
+ * Gets the current active version of the {@link RemoteConfigTemplate} of the project.
37
37
  *
38
- * @return A promise that fulfills with a `RemoteConfigTemplate`.
38
+ * @returns A promise that fulfills with a `RemoteConfigTemplate`.
39
39
  */
40
40
  RemoteConfig.prototype.getTemplate = function () {
41
41
  return this.client.getTemplate()
@@ -44,12 +44,11 @@ var RemoteConfig = /** @class */ (function () {
44
44
  });
45
45
  };
46
46
  /**
47
- * Gets the requested version of the {@link remoteConfig.RemoteConfigTemplate
48
- * `RemoteConfigTemplate`} of the project.
47
+ * Gets the requested version of the {@link RemoteConfigTemplate} of the project.
49
48
  *
50
- * @param versionNumber Version number of the Remote Config template to look up.
49
+ * @param versionNumber - Version number of the Remote Config template to look up.
51
50
  *
52
- * @return A promise that fulfills with a `RemoteConfigTemplate`.
51
+ * @returns A promise that fulfills with a `RemoteConfigTemplate`.
53
52
  */
54
53
  RemoteConfig.prototype.getTemplateAtVersion = function (versionNumber) {
55
54
  return this.client.getTemplateAtVersion(versionNumber)
@@ -58,9 +57,9 @@ var RemoteConfig = /** @class */ (function () {
58
57
  });
59
58
  };
60
59
  /**
61
- * Validates a {@link remoteConfig.RemoteConfigTemplate `RemoteConfigTemplate`}.
60
+ * Validates a {@link RemoteConfigTemplate}.
62
61
  *
63
- * @param template The Remote Config template to be validated.
62
+ * @param template - The Remote Config template to be validated.
64
63
  * @returns A promise that fulfills with the validated `RemoteConfigTemplate`.
65
64
  */
66
65
  RemoteConfig.prototype.validateTemplate = function (template) {
@@ -72,16 +71,16 @@ var RemoteConfig = /** @class */ (function () {
72
71
  /**
73
72
  * Publishes a Remote Config template.
74
73
  *
75
- * @param template The Remote Config template to be published.
76
- * @param options Optional options object when publishing a Remote Config template:
77
- * - {boolean} `force` Setting this to `true` forces the Remote Config template to
74
+ * @param template - The Remote Config template to be published.
75
+ * @param options - Optional options object when publishing a Remote Config template:
76
+ * - `force`: Setting this to `true` forces the Remote Config template to
78
77
  * be updated and circumvent the ETag. This approach is not recommended
79
78
  * because it risks causing the loss of updates to your Remote Config
80
79
  * template if multiple clients are updating the Remote Config template.
81
- * See {@link https://firebase.google.com/docs/remote-config/use-config-rest#etag_usage_and_forced_updates
80
+ * See {@link https://firebase.google.com/docs/remote-config/use-config-rest#etag_usage_and_forced_updates |
82
81
  * ETag usage and forced updates}.
83
82
  *
84
- * @return A Promise that fulfills with the published `RemoteConfigTemplate`.
83
+ * @returns A Promise that fulfills with the published `RemoteConfigTemplate`.
85
84
  */
86
85
  RemoteConfig.prototype.publishTemplate = function (template, options) {
87
86
  return this.client.publishTemplate(template, options)
@@ -94,12 +93,12 @@ var RemoteConfig = /** @class */ (function () {
94
93
  * A rollback is equivalent to getting a previously published Remote Config
95
94
  * template and re-publishing it using a force update.
96
95
  *
97
- * @param versionNumber The version number of the Remote Config template to roll back to.
96
+ * @param versionNumber - The version number of the Remote Config template to roll back to.
98
97
  * The specified version number must be lower than the current version number, and not have
99
98
  * been deleted due to staleness. Only the last 300 versions are stored.
100
99
  * All versions that correspond to non-active Remote Config templates (that is, all except the
101
100
  * template that is being fetched by clients) are also deleted if they are more than 90 days old.
102
- * @return A promise that fulfills with the published `RemoteConfigTemplate`.
101
+ * @returns A promise that fulfills with the published `RemoteConfigTemplate`.
103
102
  */
104
103
  RemoteConfig.prototype.rollback = function (versionNumber) {
105
104
  return this.client.rollback(versionNumber)
@@ -113,8 +112,8 @@ var RemoteConfig = /** @class */ (function () {
113
112
  * All versions that correspond to non-active Remote Config templates (i.e., all except the
114
113
  * template that is being fetched by clients) are also deleted if they are older than 90 days.
115
114
  *
116
- * @param options Optional options object for getting a list of versions.
117
- * @return A promise that fulfills with a `ListVersionsResult`.
115
+ * @param options - Optional options object for getting a list of versions.
116
+ * @returns A promise that fulfills with a `ListVersionsResult`.
118
117
  */
119
118
  RemoteConfig.prototype.listVersions = function (options) {
120
119
  return this.client.listVersions(options)
@@ -129,9 +128,9 @@ var RemoteConfig = /** @class */ (function () {
129
128
  /**
130
129
  * Creates and returns a new Remote Config template from a JSON string.
131
130
  *
132
- * @param json The JSON string to populate a Remote Config template.
131
+ * @param json - The JSON string to populate a Remote Config template.
133
132
  *
134
- * @return A new template instance.
133
+ * @returns A new template instance.
135
134
  */
136
135
  RemoteConfig.prototype.createTemplateFromJSON = function (json) {
137
136
  if (!validator.isNonEmptyString(json)) {
@@ -194,7 +193,7 @@ var RemoteConfigTemplateImpl = /** @class */ (function () {
194
193
  /**
195
194
  * Gets the ETag of the template.
196
195
  *
197
- * @return {string} The ETag of the Remote Config template.
196
+ * @returns The ETag of the Remote Config template.
198
197
  */
199
198
  get: function () {
200
199
  return this.etagInternal;
@@ -203,7 +202,9 @@ var RemoteConfigTemplateImpl = /** @class */ (function () {
203
202
  configurable: true
204
203
  });
205
204
  /**
206
- * @return {RemoteConfigTemplate} A JSON-serializable representation of this object.
205
+ * Returns a JSON-serializable representation of this object.
206
+ *
207
+ * @returns A JSON-serializable representation of this object.
207
208
  */
208
209
  RemoteConfigTemplateImpl.prototype.toJSON = function () {
209
210
  return {
@@ -281,7 +282,7 @@ var VersionImpl = /** @class */ (function () {
281
282
  }
282
283
  }
283
284
  /**
284
- * @return {Version} A JSON-serializable representation of this object.
285
+ * @returns A JSON-serializable representation of this object.
285
286
  */
286
287
  VersionImpl.prototype.toJSON = function () {
287
288
  return {