firebase-admin-edge 3.0.2 → 3.1.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.
- package/README.md +17 -14
- package/THIRD_PARTY_NOTICES.md +62 -0
- package/dist/firebase-edge-server.d.ts +2 -0
- package/dist/firebase-edge-server.d.ts.map +1 -1
- package/dist/firebase-edge-server.js +7 -0
- package/dist/firebase-edge-server.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/remote-config/condition-evaluator.d.ts +6 -0
- package/dist/remote-config/condition-evaluator.d.ts.map +1 -0
- package/dist/remote-config/condition-evaluator.js +122 -0
- package/dist/remote-config/condition-evaluator.js.map +1 -0
- package/dist/remote-config/remote-config-endpoints.d.ts +22 -0
- package/dist/remote-config/remote-config-endpoints.d.ts.map +1 -0
- package/dist/remote-config/remote-config-endpoints.js +161 -0
- package/dist/remote-config/remote-config-endpoints.js.map +1 -0
- package/dist/remote-config/remote-config-fetch-response.d.ts +8 -0
- package/dist/remote-config/remote-config-fetch-response.d.ts.map +1 -0
- package/dist/remote-config/remote-config-fetch-response.js +26 -0
- package/dist/remote-config/remote-config-fetch-response.js.map +1 -0
- package/dist/remote-config/remote-config-results.d.ts +15 -0
- package/dist/remote-config/remote-config-results.d.ts.map +1 -0
- package/dist/remote-config/remote-config-results.js +26 -0
- package/dist/remote-config/remote-config-results.js.map +1 -0
- package/dist/remote-config/remote-config-template.d.ts +20 -0
- package/dist/remote-config/remote-config-template.d.ts.map +1 -0
- package/dist/remote-config/remote-config-template.js +129 -0
- package/dist/remote-config/remote-config-template.js.map +1 -0
- package/dist/remote-config/remote-config-types.d.ts +807 -0
- package/dist/remote-config/remote-config-types.d.ts.map +1 -0
- package/dist/remote-config/remote-config-types.js +119 -0
- package/dist/remote-config/remote-config-types.js.map +1 -0
- package/dist/remote-config/remote-config.d.ts +34 -0
- package/dist/remote-config/remote-config.d.ts.map +1 -0
- package/dist/remote-config/remote-config.js +112 -0
- package/dist/remote-config/remote-config.js.map +1 -0
- package/dist/remote-config/server-template.d.ts +33 -0
- package/dist/remote-config/server-template.d.ts.map +1 -0
- package/dist/remote-config/server-template.js +145 -0
- package/dist/remote-config/server-template.js.map +1 -0
- package/dist/rest-fetch.d.ts +1 -1
- package/dist/rest-fetch.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Google LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Colors that are associated with conditions for display purposes.
|
|
18
|
+
*/
|
|
19
|
+
export type TagColor = 'BLUE' | 'BROWN' | 'CYAN' | 'DEEP_ORANGE' | 'GREEN' | 'INDIGO' | 'LIME' | 'ORANGE' | 'PINK' | 'PURPLE' | 'TEAL';
|
|
20
|
+
/**
|
|
21
|
+
* Type representing a Remote Config parameter value data type.
|
|
22
|
+
* Defaults to `STRING` if unspecified.
|
|
23
|
+
*/
|
|
24
|
+
export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';
|
|
25
|
+
/**
|
|
26
|
+
* Interface representing a Remote Config condition.
|
|
27
|
+
* A condition targets a specific group of users. A list of these conditions make up
|
|
28
|
+
* part of a Remote Config template.
|
|
29
|
+
*/
|
|
30
|
+
export interface RemoteConfigCondition {
|
|
31
|
+
/**
|
|
32
|
+
* A non-empty and unique name of this condition.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
/**
|
|
36
|
+
* The logic of this condition.
|
|
37
|
+
* See the documentation on
|
|
38
|
+
* {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
|
|
39
|
+
* for the expected syntax of this field.
|
|
40
|
+
*/
|
|
41
|
+
expression: string;
|
|
42
|
+
/**
|
|
43
|
+
* The color associated with this condition for display purposes in the Firebase Console.
|
|
44
|
+
* Not specifying this value results in the console picking an arbitrary color to associate
|
|
45
|
+
* with the condition.
|
|
46
|
+
*/
|
|
47
|
+
tagColor?: TagColor;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Represents a Remote Config condition in the dataplane.
|
|
51
|
+
* A condition targets a specific group of users. A list of these conditions
|
|
52
|
+
* comprise part of a Remote Config template.
|
|
53
|
+
*/
|
|
54
|
+
export interface NamedCondition {
|
|
55
|
+
/**
|
|
56
|
+
* A non-empty and unique name of this condition.
|
|
57
|
+
*/
|
|
58
|
+
name: string;
|
|
59
|
+
/**
|
|
60
|
+
* The logic of this condition.
|
|
61
|
+
* See the documentation on
|
|
62
|
+
* {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
|
|
63
|
+
* for the expected syntax of this field.
|
|
64
|
+
*/
|
|
65
|
+
condition: OneOfCondition;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Represents a condition that may be one of several types.
|
|
69
|
+
* Only the first defined field will be processed.
|
|
70
|
+
*/
|
|
71
|
+
export interface OneOfCondition {
|
|
72
|
+
/**
|
|
73
|
+
* Makes this condition an OR condition.
|
|
74
|
+
*/
|
|
75
|
+
orCondition?: OrCondition;
|
|
76
|
+
/**
|
|
77
|
+
* Makes this condition an AND condition.
|
|
78
|
+
*/
|
|
79
|
+
andCondition?: AndCondition;
|
|
80
|
+
/**
|
|
81
|
+
* Makes this condition a constant true.
|
|
82
|
+
*/
|
|
83
|
+
true?: Record<string, never>;
|
|
84
|
+
/**
|
|
85
|
+
* Makes this condition a constant false.
|
|
86
|
+
*/
|
|
87
|
+
false?: Record<string, never>;
|
|
88
|
+
/**
|
|
89
|
+
* Makes this condition a percent condition.
|
|
90
|
+
*/
|
|
91
|
+
percent?: PercentCondition;
|
|
92
|
+
/**
|
|
93
|
+
* Makes this condition a custom signal condition.
|
|
94
|
+
*/
|
|
95
|
+
customSignal?: CustomSignalCondition;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Represents a collection of conditions that evaluate to true if all are true.
|
|
99
|
+
*/
|
|
100
|
+
export interface AndCondition {
|
|
101
|
+
/**
|
|
102
|
+
* The collection of conditions.
|
|
103
|
+
*/
|
|
104
|
+
conditions?: Array<OneOfCondition>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Represents a collection of conditions that evaluate to true if any are true.
|
|
108
|
+
*/
|
|
109
|
+
export interface OrCondition {
|
|
110
|
+
/**
|
|
111
|
+
* The collection of conditions.
|
|
112
|
+
*/
|
|
113
|
+
conditions?: Array<OneOfCondition>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Defines supported operators for percent conditions.
|
|
117
|
+
*/
|
|
118
|
+
export declare enum PercentConditionOperator {
|
|
119
|
+
/**
|
|
120
|
+
* A catchall error case.
|
|
121
|
+
*/
|
|
122
|
+
UNKNOWN = "UNKNOWN",
|
|
123
|
+
/**
|
|
124
|
+
* Target percentiles less than or equal to the target percent.
|
|
125
|
+
* A condition using this operator must specify microPercent.
|
|
126
|
+
*/
|
|
127
|
+
LESS_OR_EQUAL = "LESS_OR_EQUAL",
|
|
128
|
+
/**
|
|
129
|
+
* Target percentiles greater than the target percent.
|
|
130
|
+
* A condition using this operator must specify microPercent.
|
|
131
|
+
*/
|
|
132
|
+
GREATER_THAN = "GREATER_THAN",
|
|
133
|
+
/**
|
|
134
|
+
* Target percentiles within an interval defined by a lower bound and an
|
|
135
|
+
* upper bound. The lower bound is an exclusive (open) bound and the
|
|
136
|
+
* micro_percent_range_upper_bound is an inclusive (closed) bound.
|
|
137
|
+
* A condition using this operator must specify microPercentRange.
|
|
138
|
+
*/
|
|
139
|
+
BETWEEN = "BETWEEN"
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Represents the limit of percentiles to target in micro-percents.
|
|
143
|
+
* The value must be in the range [0 and 100000000]
|
|
144
|
+
*/
|
|
145
|
+
export interface MicroPercentRange {
|
|
146
|
+
/**
|
|
147
|
+
* The lower limit of percentiles to target in micro-percents.
|
|
148
|
+
* The value must be in the range [0 and 100000000].
|
|
149
|
+
*/
|
|
150
|
+
microPercentLowerBound?: number;
|
|
151
|
+
/**
|
|
152
|
+
* The upper limit of percentiles to target in micro-percents.
|
|
153
|
+
* The value must be in the range [0 and 100000000].
|
|
154
|
+
*/
|
|
155
|
+
microPercentUpperBound?: number;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Represents a condition that compares the instance pseudo-random
|
|
159
|
+
* percentile to a given limit.
|
|
160
|
+
*/
|
|
161
|
+
export interface PercentCondition {
|
|
162
|
+
/**
|
|
163
|
+
* The choice of percent operator to determine how to compare targets
|
|
164
|
+
* to percent(s).
|
|
165
|
+
*/
|
|
166
|
+
percentOperator?: PercentConditionOperator;
|
|
167
|
+
/**
|
|
168
|
+
* The limit of percentiles to target in micro-percents when
|
|
169
|
+
* using the LESS_OR_EQUAL and GREATER_THAN operators. The value must
|
|
170
|
+
* be in the range [0 and 100000000].
|
|
171
|
+
*/
|
|
172
|
+
microPercent?: number;
|
|
173
|
+
/**
|
|
174
|
+
* The seed used when evaluating the hash function to map an instance to
|
|
175
|
+
* a value in the hash space. This is a string which can have 0 - 32
|
|
176
|
+
* characters and can contain ASCII characters [-_.0-9a-zA-Z].The string
|
|
177
|
+
* is case-sensitive.
|
|
178
|
+
*/
|
|
179
|
+
seed?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The micro-percent interval to be used with the
|
|
182
|
+
* BETWEEN operator.
|
|
183
|
+
*/
|
|
184
|
+
microPercentRange?: MicroPercentRange;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Defines supported operators for custom signal conditions.
|
|
188
|
+
*/
|
|
189
|
+
export declare enum CustomSignalOperator {
|
|
190
|
+
/**
|
|
191
|
+
* A catchall error case.
|
|
192
|
+
*/
|
|
193
|
+
UNKNOWN = "UNKNOWN",
|
|
194
|
+
/**
|
|
195
|
+
* Matches a numeric value less than the target value.
|
|
196
|
+
*/
|
|
197
|
+
NUMERIC_LESS_THAN = "NUMERIC_LESS_THAN",
|
|
198
|
+
/**
|
|
199
|
+
* Matches a numeric value less than or equal to the target value.
|
|
200
|
+
*/
|
|
201
|
+
NUMERIC_LESS_EQUAL = "NUMERIC_LESS_EQUAL",
|
|
202
|
+
/**
|
|
203
|
+
* Matches a numeric value equal to the target value.
|
|
204
|
+
*/
|
|
205
|
+
NUMERIC_EQUAL = "NUMERIC_EQUAL",
|
|
206
|
+
/**
|
|
207
|
+
* Matches a numeric value not equal to the target value.
|
|
208
|
+
*/
|
|
209
|
+
NUMERIC_NOT_EQUAL = "NUMERIC_NOT_EQUAL",
|
|
210
|
+
/**
|
|
211
|
+
* Matches a numeric value greater than the target value.
|
|
212
|
+
*/
|
|
213
|
+
NUMERIC_GREATER_THAN = "NUMERIC_GREATER_THAN",
|
|
214
|
+
/**
|
|
215
|
+
* Matches a numeric value greater than or equal to the target value.
|
|
216
|
+
*/
|
|
217
|
+
NUMERIC_GREATER_EQUAL = "NUMERIC_GREATER_EQUAL",
|
|
218
|
+
/**
|
|
219
|
+
* Matches if at least one of the target values is a substring of the actual custom
|
|
220
|
+
* signal value (e.g. "abc" contains the string "a", "bc").
|
|
221
|
+
*/
|
|
222
|
+
STRING_CONTAINS = "STRING_CONTAINS",
|
|
223
|
+
/**
|
|
224
|
+
* Matches if none of the target values is a substring of the actual custom signal value.
|
|
225
|
+
*/
|
|
226
|
+
STRING_DOES_NOT_CONTAIN = "STRING_DOES_NOT_CONTAIN",
|
|
227
|
+
/**
|
|
228
|
+
* Matches if the actual value exactly matches at least one of the target values.
|
|
229
|
+
*/
|
|
230
|
+
STRING_EXACTLY_MATCHES = "STRING_EXACTLY_MATCHES",
|
|
231
|
+
/**
|
|
232
|
+
* The target regular expression matches at least one of the actual values.
|
|
233
|
+
* The regex conforms to RE2 format. See https://github.com/google/re2/wiki/Syntax
|
|
234
|
+
*/
|
|
235
|
+
STRING_CONTAINS_REGEX = "STRING_CONTAINS_REGEX",
|
|
236
|
+
/**
|
|
237
|
+
* Matches if the actual version value is less than the target value.
|
|
238
|
+
*/
|
|
239
|
+
SEMANTIC_VERSION_LESS_THAN = "SEMANTIC_VERSION_LESS_THAN",
|
|
240
|
+
/**
|
|
241
|
+
* Matches if the actual version value is less than or equal to the target value.
|
|
242
|
+
*/
|
|
243
|
+
SEMANTIC_VERSION_LESS_EQUAL = "SEMANTIC_VERSION_LESS_EQUAL",
|
|
244
|
+
/**
|
|
245
|
+
* Matches if the actual version value is equal to the target value.
|
|
246
|
+
*/
|
|
247
|
+
SEMANTIC_VERSION_EQUAL = "SEMANTIC_VERSION_EQUAL",
|
|
248
|
+
/**
|
|
249
|
+
* Matches if the actual version value is not equal to the target value.
|
|
250
|
+
*/
|
|
251
|
+
SEMANTIC_VERSION_NOT_EQUAL = "SEMANTIC_VERSION_NOT_EQUAL",
|
|
252
|
+
/**
|
|
253
|
+
* Matches if the actual version value is greater than the target value.
|
|
254
|
+
*/
|
|
255
|
+
SEMANTIC_VERSION_GREATER_THAN = "SEMANTIC_VERSION_GREATER_THAN",
|
|
256
|
+
/**
|
|
257
|
+
* Matches if the actual version value is greater than or equal to the target value.
|
|
258
|
+
*/
|
|
259
|
+
SEMANTIC_VERSION_GREATER_EQUAL = "SEMANTIC_VERSION_GREATER_EQUAL"
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Represents a condition that compares provided signals against a target value.
|
|
263
|
+
*/
|
|
264
|
+
export interface CustomSignalCondition {
|
|
265
|
+
/**
|
|
266
|
+
* The choice of custom signal operator to determine how to compare targets
|
|
267
|
+
* to value(s).
|
|
268
|
+
*/
|
|
269
|
+
customSignalOperator?: CustomSignalOperator;
|
|
270
|
+
/**
|
|
271
|
+
* The key of the signal set in the EvaluationContext
|
|
272
|
+
*/
|
|
273
|
+
customSignalKey?: string;
|
|
274
|
+
/**
|
|
275
|
+
* A list of at most 100 target custom signal values. For numeric operators,
|
|
276
|
+
* this will have exactly ONE target value.
|
|
277
|
+
*/
|
|
278
|
+
targetCustomSignalValues?: string[];
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Interface representing an explicit parameter value.
|
|
282
|
+
*/
|
|
283
|
+
export interface ExplicitParameterValue {
|
|
284
|
+
/**
|
|
285
|
+
* The `string` value that the parameter is set to.
|
|
286
|
+
*/
|
|
287
|
+
value: string;
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Interface representing an in-app-default value.
|
|
291
|
+
*/
|
|
292
|
+
export interface InAppDefaultValue {
|
|
293
|
+
/**
|
|
294
|
+
* If `true`, the parameter is omitted from the parameter values returned to a client.
|
|
295
|
+
*/
|
|
296
|
+
useInAppDefault: boolean;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Interface representing a value that is linked to a Rollout.
|
|
300
|
+
*/
|
|
301
|
+
export interface RolloutValue {
|
|
302
|
+
/**
|
|
303
|
+
* The ID of the Rollout to which the value is linked.
|
|
304
|
+
*/
|
|
305
|
+
rolloutId: string;
|
|
306
|
+
/**
|
|
307
|
+
* The value that is being rolled out.
|
|
308
|
+
*/
|
|
309
|
+
value: string;
|
|
310
|
+
/**
|
|
311
|
+
* The rollout percentage representing the exposure of the rollout value in
|
|
312
|
+
* the target audience.
|
|
313
|
+
*/
|
|
314
|
+
percent: number;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Interface representing a value returned by Personalization.
|
|
318
|
+
*/
|
|
319
|
+
export interface PersonalizationValue {
|
|
320
|
+
/**
|
|
321
|
+
* The ID of the Personalization to which the value is linked.
|
|
322
|
+
*/
|
|
323
|
+
personalizationId: string;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Interface representing a specific variant value within an Experiment.
|
|
327
|
+
*/
|
|
328
|
+
export interface ExperimentVariantExplicitValue {
|
|
329
|
+
/**
|
|
330
|
+
* ID of the variant value within an Experiment.
|
|
331
|
+
*/
|
|
332
|
+
variantId: string;
|
|
333
|
+
/**
|
|
334
|
+
* Value of the variant within an Experiment.
|
|
335
|
+
*/
|
|
336
|
+
value: string;
|
|
337
|
+
/**
|
|
338
|
+
* Represents an unset `noChange` value. To set `noChange`, use
|
|
339
|
+
* `ExperimentVariantNoChange` instead.
|
|
340
|
+
*/
|
|
341
|
+
noChange?: never;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Represents a no-change variant value within an Experiment.
|
|
345
|
+
*/
|
|
346
|
+
export interface ExperimentVariantNoChange {
|
|
347
|
+
/**
|
|
348
|
+
* ID of the variant value within an Experiment.
|
|
349
|
+
*/
|
|
350
|
+
variantId: string;
|
|
351
|
+
/**
|
|
352
|
+
* Represents an unset value as only one of `noChange` or `value` can be set.
|
|
353
|
+
* To set a variant value, use `ExperimentVariantExplicitValue` instead.
|
|
354
|
+
*/
|
|
355
|
+
value?: never;
|
|
356
|
+
/**
|
|
357
|
+
* Represents a no-change variant value within an Experiment. If `true`,
|
|
358
|
+
* the variant served to the client is equal to the value against the
|
|
359
|
+
* next condition in the evaluation order (or the default value if no
|
|
360
|
+
* conditions are applicable).
|
|
361
|
+
*/
|
|
362
|
+
noChange: true;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Type representing an Experiment variant value.
|
|
366
|
+
* An `ExperimentVariantValue` could be either an
|
|
367
|
+
* `ExperimentVariantExplicitValue` or an `ExperimentVariantNoChange`.
|
|
368
|
+
*/
|
|
369
|
+
export type ExperimentVariantValue = ExperimentVariantExplicitValue | ExperimentVariantNoChange;
|
|
370
|
+
/**
|
|
371
|
+
* Represents an Experiment value.
|
|
372
|
+
*/
|
|
373
|
+
export interface ExperimentValue {
|
|
374
|
+
/**
|
|
375
|
+
* ID of the Experiment to which the value is linked.
|
|
376
|
+
*/
|
|
377
|
+
experimentId: string;
|
|
378
|
+
/**
|
|
379
|
+
* Collection of `ExperimentVariantValue`s that represents the variants
|
|
380
|
+
* served by the Experiment.
|
|
381
|
+
*/
|
|
382
|
+
variantValue: ExperimentVariantValue[];
|
|
383
|
+
/**
|
|
384
|
+
* The percentage of users included in the Experiment, represented as a number
|
|
385
|
+
* between 0 and 100.
|
|
386
|
+
*/
|
|
387
|
+
exposurePercent?: number;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Interface representing a parameter value linked to a Rollout.
|
|
391
|
+
*/
|
|
392
|
+
export interface RolloutParameterValue {
|
|
393
|
+
/**
|
|
394
|
+
* The value returned by a Rollout.
|
|
395
|
+
*/
|
|
396
|
+
rolloutValue: RolloutValue;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Interface representing a parameter value linked to a Personalization.
|
|
400
|
+
*/
|
|
401
|
+
export interface PersonalizationParameterValue {
|
|
402
|
+
/**
|
|
403
|
+
* The value returned by a Personalization.
|
|
404
|
+
*/
|
|
405
|
+
personalizationValue: PersonalizationValue;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Interface representing a parameter value linked to an Experiment.
|
|
409
|
+
*/
|
|
410
|
+
export interface ExperimentParameterValue {
|
|
411
|
+
/**
|
|
412
|
+
* The value returned by an Experiment.
|
|
413
|
+
*/
|
|
414
|
+
experimentValue: ExperimentValue;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Type representing a Remote Config parameter value.
|
|
418
|
+
* A `RemoteConfigParameterValue` could be either an `ExplicitParameterValue` or
|
|
419
|
+
* an `InAppDefaultValue`.
|
|
420
|
+
*/
|
|
421
|
+
export type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue | RolloutParameterValue | PersonalizationParameterValue | ExperimentParameterValue;
|
|
422
|
+
/**
|
|
423
|
+
* Interface representing a Remote Config parameter.
|
|
424
|
+
* At minimum, a `defaultValue` or a `conditionalValues` entry must be present for the
|
|
425
|
+
* parameter to have any effect.
|
|
426
|
+
*/
|
|
427
|
+
export interface RemoteConfigParameter {
|
|
428
|
+
/**
|
|
429
|
+
* The value to set the parameter to, when none of the named conditions evaluate to `true`.
|
|
430
|
+
*/
|
|
431
|
+
defaultValue?: RemoteConfigParameterValue;
|
|
432
|
+
/**
|
|
433
|
+
* A `(condition name, value)` map. The condition name of the highest priority
|
|
434
|
+
* (the one listed first in the Remote Config template's conditions list) determines the value of
|
|
435
|
+
* this parameter.
|
|
436
|
+
*/
|
|
437
|
+
conditionalValues?: {
|
|
438
|
+
[key: string]: RemoteConfigParameterValue;
|
|
439
|
+
};
|
|
440
|
+
/**
|
|
441
|
+
* A description for this parameter. Should not be over 100 characters and may contain any
|
|
442
|
+
* Unicode characters.
|
|
443
|
+
*/
|
|
444
|
+
description?: string;
|
|
445
|
+
/**
|
|
446
|
+
* The data type for all values of this parameter in the current version of the template.
|
|
447
|
+
* Defaults to `ParameterValueType.STRING` if unspecified.
|
|
448
|
+
*/
|
|
449
|
+
valueType?: ParameterValueType;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Interface representing a Remote Config parameter group.
|
|
453
|
+
* Grouping parameters is only for management purposes and does not affect client-side
|
|
454
|
+
* fetching of parameter values.
|
|
455
|
+
*/
|
|
456
|
+
export interface RemoteConfigParameterGroup {
|
|
457
|
+
/**
|
|
458
|
+
* A description for the group. Its length must be less than or equal to 256 characters.
|
|
459
|
+
* A description may contain any Unicode characters.
|
|
460
|
+
*/
|
|
461
|
+
description?: string;
|
|
462
|
+
/**
|
|
463
|
+
* Map of parameter keys to their optional default values and optional conditional values for
|
|
464
|
+
* parameters that belong to this group. A parameter only appears once per
|
|
465
|
+
* Remote Config template. An ungrouped parameter appears at the top level, whereas a
|
|
466
|
+
* parameter organized within a group appears within its group's map of parameters.
|
|
467
|
+
*/
|
|
468
|
+
parameters: {
|
|
469
|
+
[key: string]: RemoteConfigParameter;
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Represents a Remote Config client template.
|
|
474
|
+
*/
|
|
475
|
+
export interface RemoteConfigTemplate {
|
|
476
|
+
/**
|
|
477
|
+
* A list of conditions in descending order by priority.
|
|
478
|
+
*/
|
|
479
|
+
conditions: RemoteConfigCondition[];
|
|
480
|
+
/**
|
|
481
|
+
* Map of parameter keys to their optional default values and optional conditional values.
|
|
482
|
+
*/
|
|
483
|
+
parameters: {
|
|
484
|
+
[key: string]: RemoteConfigParameter;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* Map of parameter group names to their parameter group objects.
|
|
488
|
+
* A group's name is mutable but must be unique among groups in the Remote Config template.
|
|
489
|
+
* The name is limited to 256 characters and intended to be human-readable. Any Unicode
|
|
490
|
+
* characters are allowed.
|
|
491
|
+
*/
|
|
492
|
+
parameterGroups: {
|
|
493
|
+
[key: string]: RemoteConfigParameterGroup;
|
|
494
|
+
};
|
|
495
|
+
/**
|
|
496
|
+
* ETag of the current Remote Config template (readonly).
|
|
497
|
+
*/
|
|
498
|
+
readonly etag: string;
|
|
499
|
+
/**
|
|
500
|
+
* Version information for the current Remote Config template.
|
|
501
|
+
*/
|
|
502
|
+
version?: Version;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Represents the data in a Remote Config server template.
|
|
506
|
+
*/
|
|
507
|
+
export interface ServerTemplateData {
|
|
508
|
+
/**
|
|
509
|
+
* A list of conditions in descending order by priority.
|
|
510
|
+
*/
|
|
511
|
+
conditions: NamedCondition[];
|
|
512
|
+
/**
|
|
513
|
+
* Map of parameter keys to their optional default values and optional conditional values.
|
|
514
|
+
*/
|
|
515
|
+
parameters: {
|
|
516
|
+
[key: string]: RemoteConfigParameter;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* Current Remote Config template ETag (read-only).
|
|
520
|
+
*/
|
|
521
|
+
readonly etag: string;
|
|
522
|
+
/**
|
|
523
|
+
* Version information for the current Remote Config template.
|
|
524
|
+
*/
|
|
525
|
+
version?: Version;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Represents optional arguments that can be used when instantiating {@link ServerTemplate}.
|
|
529
|
+
*/
|
|
530
|
+
export interface GetServerTemplateOptions {
|
|
531
|
+
/**
|
|
532
|
+
* Defines in-app default parameter values, so that your app behaves as
|
|
533
|
+
* intended before it connects to the Remote Config backend, and so that
|
|
534
|
+
* default values are available if none are set on the backend.
|
|
535
|
+
*/
|
|
536
|
+
defaultConfig?: DefaultConfig;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Represents the type of a Remote Config server template that can be set on
|
|
540
|
+
* {@link ServerTemplate}. This can either be a {@link ServerTemplateData} object
|
|
541
|
+
* or a template JSON string.
|
|
542
|
+
*/
|
|
543
|
+
export type ServerTemplateDataType = ServerTemplateData | string;
|
|
544
|
+
/**
|
|
545
|
+
* Represents optional arguments that can be used when instantiating
|
|
546
|
+
* {@link ServerTemplate} synchronously.
|
|
547
|
+
*/
|
|
548
|
+
export interface InitServerTemplateOptions extends GetServerTemplateOptions {
|
|
549
|
+
/**
|
|
550
|
+
* Enables integrations to use template data loaded independently. For
|
|
551
|
+
* example, customers can reduce initialization latency by pre-fetching and
|
|
552
|
+
* caching template data and then using this option to initialize the SDK with
|
|
553
|
+
* that data.
|
|
554
|
+
*/
|
|
555
|
+
template?: ServerTemplateDataType;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Represents a stateful abstraction for a Remote Config server template.
|
|
559
|
+
*/
|
|
560
|
+
export type { ServerTemplate } from './server-template.js';
|
|
561
|
+
/**
|
|
562
|
+
* Generic map of developer-defined signals used as evaluation input signals.
|
|
563
|
+
*/
|
|
564
|
+
export type UserProvidedSignals = {
|
|
565
|
+
[key: string]: string | number;
|
|
566
|
+
};
|
|
567
|
+
/**
|
|
568
|
+
* Predefined template evaluation input signals.
|
|
569
|
+
*/
|
|
570
|
+
export type PredefinedSignals = {
|
|
571
|
+
/**
|
|
572
|
+
* Defines the identifier to use when splitting a group. For example,
|
|
573
|
+
* this is used by the percent condition.
|
|
574
|
+
*/
|
|
575
|
+
randomizationId?: string;
|
|
576
|
+
};
|
|
577
|
+
/**
|
|
578
|
+
* Represents template evaluation input signals.
|
|
579
|
+
*/
|
|
580
|
+
export type EvaluationContext = UserProvidedSignals & PredefinedSignals;
|
|
581
|
+
/**
|
|
582
|
+
* Interface representing a Remote Config user.
|
|
583
|
+
*/
|
|
584
|
+
export interface RemoteConfigUser {
|
|
585
|
+
/**
|
|
586
|
+
* Email address. Output only.
|
|
587
|
+
*/
|
|
588
|
+
email: string;
|
|
589
|
+
/**
|
|
590
|
+
* Display name. Output only.
|
|
591
|
+
*/
|
|
592
|
+
name?: string;
|
|
593
|
+
/**
|
|
594
|
+
* Image URL. Output only.
|
|
595
|
+
*/
|
|
596
|
+
imageUrl?: string;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Interface representing a Remote Config template version.
|
|
600
|
+
* Output only, except for the version description. Contains metadata about a particular
|
|
601
|
+
* version of the Remote Config template. All fields are set at the time the specified Remote
|
|
602
|
+
* Config template is published. A version's description field may be specified in
|
|
603
|
+
* `publishTemplate` calls.
|
|
604
|
+
*/
|
|
605
|
+
export interface Version {
|
|
606
|
+
/**
|
|
607
|
+
* The version number of a Remote Config template.
|
|
608
|
+
*/
|
|
609
|
+
versionNumber?: string;
|
|
610
|
+
/**
|
|
611
|
+
* The timestamp of when this version of the Remote Config template was written to the
|
|
612
|
+
* Remote Config backend.
|
|
613
|
+
*/
|
|
614
|
+
updateTime?: string;
|
|
615
|
+
/**
|
|
616
|
+
* The origin of the template update action.
|
|
617
|
+
*/
|
|
618
|
+
updateOrigin?: 'REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED' | 'CONSOLE' | 'REST_API' | 'ADMIN_SDK_NODE';
|
|
619
|
+
/**
|
|
620
|
+
* The type of the template update action.
|
|
621
|
+
*/
|
|
622
|
+
updateType?: 'REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED' | 'INCREMENTAL_UPDATE' | 'FORCED_UPDATE' | 'ROLLBACK';
|
|
623
|
+
/**
|
|
624
|
+
* Aggregation of all metadata fields about the account that performed the update.
|
|
625
|
+
*/
|
|
626
|
+
updateUser?: RemoteConfigUser;
|
|
627
|
+
/**
|
|
628
|
+
* The user-provided description of the corresponding Remote Config template.
|
|
629
|
+
*/
|
|
630
|
+
description?: string;
|
|
631
|
+
/**
|
|
632
|
+
* The version number of the Remote Config template that has become the current version
|
|
633
|
+
* due to a rollback. Only present if this version is the result of a rollback.
|
|
634
|
+
*/
|
|
635
|
+
rollbackSource?: string;
|
|
636
|
+
/**
|
|
637
|
+
* Indicates whether this Remote Config template was published before version history was
|
|
638
|
+
* supported.
|
|
639
|
+
*/
|
|
640
|
+
isLegacy?: boolean;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Interface representing a list of Remote Config template versions.
|
|
644
|
+
*/
|
|
645
|
+
export interface ListVersionsResult {
|
|
646
|
+
/**
|
|
647
|
+
* A list of version metadata objects, sorted in reverse chronological order.
|
|
648
|
+
*/
|
|
649
|
+
versions: Version[];
|
|
650
|
+
/**
|
|
651
|
+
* Token to retrieve the next page of results, or empty if there are no more results
|
|
652
|
+
* in the list.
|
|
653
|
+
*/
|
|
654
|
+
nextPageToken?: string;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Interface representing options for Remote Config list versions operation.
|
|
658
|
+
*/
|
|
659
|
+
export interface ListVersionsOptions {
|
|
660
|
+
/**
|
|
661
|
+
* The maximum number of items to return per page.
|
|
662
|
+
*/
|
|
663
|
+
pageSize?: number;
|
|
664
|
+
/**
|
|
665
|
+
* The `nextPageToken` value returned from a previous list versions request, if any.
|
|
666
|
+
*/
|
|
667
|
+
pageToken?: string;
|
|
668
|
+
/**
|
|
669
|
+
* Specifies the newest version number to include in the results.
|
|
670
|
+
* If specified, must be greater than zero. Defaults to the newest version.
|
|
671
|
+
*/
|
|
672
|
+
endVersionNumber?: string | number;
|
|
673
|
+
/**
|
|
674
|
+
* Specifies the earliest update time to include in the results. Any entries updated before this
|
|
675
|
+
* time are omitted.
|
|
676
|
+
*/
|
|
677
|
+
startTime?: Date | string;
|
|
678
|
+
/**
|
|
679
|
+
* Specifies the latest update time to include in the results. Any entries updated on or after
|
|
680
|
+
* this time are omitted.
|
|
681
|
+
*/
|
|
682
|
+
endTime?: Date | string;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Represents the configuration produced by evaluating a server template.
|
|
686
|
+
*/
|
|
687
|
+
export interface ServerConfig {
|
|
688
|
+
/**
|
|
689
|
+
* Gets the value for the given key as a boolean.
|
|
690
|
+
*
|
|
691
|
+
* Convenience method for calling <code>serverConfig.getValue(key).asBoolean()</code>.
|
|
692
|
+
*
|
|
693
|
+
* @param key - The name of the parameter.
|
|
694
|
+
*
|
|
695
|
+
* @returns The value for the given key as a boolean.
|
|
696
|
+
*/
|
|
697
|
+
getBoolean(key: string): boolean;
|
|
698
|
+
/**
|
|
699
|
+
* Gets the value for the given key as a number.
|
|
700
|
+
*
|
|
701
|
+
* Convenience method for calling <code>serverConfig.getValue(key).asNumber()</code>.
|
|
702
|
+
*
|
|
703
|
+
* @param key - The name of the parameter.
|
|
704
|
+
*
|
|
705
|
+
* @returns The value for the given key as a number.
|
|
706
|
+
*/
|
|
707
|
+
getNumber(key: string): number;
|
|
708
|
+
/**
|
|
709
|
+
* Gets the value for the given key as a string.
|
|
710
|
+
* Convenience method for calling <code>serverConfig.getValue(key).asString()</code>.
|
|
711
|
+
*
|
|
712
|
+
* @param key - The name of the parameter.
|
|
713
|
+
*
|
|
714
|
+
* @returns The value for the given key as a string.
|
|
715
|
+
*/
|
|
716
|
+
getString(key: string): string;
|
|
717
|
+
/**
|
|
718
|
+
* Gets the {@link Value} for the given key.
|
|
719
|
+
*
|
|
720
|
+
* Ensures application logic will always have a type-safe reference,
|
|
721
|
+
* even if the parameter is removed remotely.
|
|
722
|
+
*
|
|
723
|
+
* @param key - The name of the parameter.
|
|
724
|
+
*
|
|
725
|
+
* @returns The value for the given key.
|
|
726
|
+
*/
|
|
727
|
+
getValue(key: string): Value;
|
|
728
|
+
/**
|
|
729
|
+
* Returns all config values.
|
|
730
|
+
*
|
|
731
|
+
* @returns A map of all config keys to their values.
|
|
732
|
+
*/
|
|
733
|
+
getAll(): {
|
|
734
|
+
[key: string]: Value;
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* JSON-serializable representation of evaluated config values. This can be consumed by
|
|
739
|
+
* Remote Config web client SDKs.
|
|
740
|
+
*/
|
|
741
|
+
export interface FetchResponseData {
|
|
742
|
+
/**
|
|
743
|
+
* The HTTP status, which is useful for differentiating success responses with data from
|
|
744
|
+
* those without.
|
|
745
|
+
*
|
|
746
|
+
* This use of 200 and 304 response codes is consistent with Remote Config's server
|
|
747
|
+
* implementation.
|
|
748
|
+
*/
|
|
749
|
+
status: number;
|
|
750
|
+
/**
|
|
751
|
+
* Defines the ETag response header value. Only defined for 200 and 304 responses.
|
|
752
|
+
*
|
|
753
|
+
* This is consistent with Remote Config's server eTag implementation.
|
|
754
|
+
*/
|
|
755
|
+
eTag?: string;
|
|
756
|
+
/**
|
|
757
|
+
* Defines the map of parameters returned as "entries" in the fetch response body.
|
|
758
|
+
*/
|
|
759
|
+
config?: {
|
|
760
|
+
[key: string]: string;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Wraps a parameter value with metadata and type-safe getters.
|
|
765
|
+
*
|
|
766
|
+
* Type-safe getters insulate application logic from remote
|
|
767
|
+
* changes to parameter names and types.
|
|
768
|
+
*/
|
|
769
|
+
export interface Value {
|
|
770
|
+
/**
|
|
771
|
+
* Gets the value as a boolean.
|
|
772
|
+
*
|
|
773
|
+
* The following values (case insensitive) are interpreted as true:
|
|
774
|
+
* "1", "true", "t", "yes", "y", "on". Other values are interpreted as false.
|
|
775
|
+
*/
|
|
776
|
+
asBoolean(): boolean;
|
|
777
|
+
/**
|
|
778
|
+
* Gets the value as a number. Comparable to calling <code>Number(value) || 0</code>.
|
|
779
|
+
*/
|
|
780
|
+
asNumber(): number;
|
|
781
|
+
/**
|
|
782
|
+
* Gets the value as a string.
|
|
783
|
+
*/
|
|
784
|
+
asString(): string;
|
|
785
|
+
/**
|
|
786
|
+
* Gets the {@link ValueSource} for the given key.
|
|
787
|
+
*/
|
|
788
|
+
getSource(): ValueSource;
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* Indicates the source of a value.
|
|
792
|
+
*
|
|
793
|
+
* <ul>
|
|
794
|
+
* <li>"static" indicates the value was defined by a static constant.</li>
|
|
795
|
+
* <li>"default" indicates the value was defined by default config.</li>
|
|
796
|
+
* <li>"remote" indicates the value was defined by config produced by
|
|
797
|
+
* evaluating a template.</li>
|
|
798
|
+
* </ul>
|
|
799
|
+
*/
|
|
800
|
+
export type ValueSource = 'static' | 'default' | 'remote';
|
|
801
|
+
/**
|
|
802
|
+
* Defines the format for in-app default parameter values.
|
|
803
|
+
*/
|
|
804
|
+
export type DefaultConfig = {
|
|
805
|
+
[key: string]: string | number | boolean;
|
|
806
|
+
};
|
|
807
|
+
//# sourceMappingURL=remote-config-types.d.ts.map
|