Skip to content

Commit 02c0559

Browse files
authored
Support SSRC conditions (#2487)
1 parent 7246526 commit 02c0559

File tree

10 files changed

+2261
-650
lines changed

10 files changed

+2261
-650
lines changed

etc/firebase-admin.remote-config.api.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
import { Agent } from 'http';
1010

11+
// @public
12+
export interface AndCondition {
13+
conditions?: Array<OneOfCondition>;
14+
}
15+
16+
// @public
17+
export type EvaluationContext = {
18+
randomizationId?: string;
19+
};
20+
1121
// @public
1222
export interface ExplicitParameterValue {
1323
value: string;
@@ -38,14 +48,51 @@ export interface ListVersionsResult {
3848
versions: Version[];
3949
}
4050

51+
// @public
52+
export interface MicroPercentRange {
53+
microPercentLowerBound?: number;
54+
microPercentUpperBound?: number;
55+
}
56+
4157
// @public
4258
export interface NamedCondition {
59+
condition: OneOfCondition;
4360
name: string;
4461
}
4562

63+
// @public
64+
export interface OneOfCondition {
65+
andCondition?: AndCondition;
66+
false?: Record<string, never>;
67+
orCondition?: OrCondition;
68+
percent?: PercentCondition;
69+
true?: Record<string, never>;
70+
}
71+
72+
// @public
73+
export interface OrCondition {
74+
conditions?: Array<OneOfCondition>;
75+
}
76+
4677
// @public
4778
export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON';
4879

80+
// @public
81+
export interface PercentCondition {
82+
microPercent?: number;
83+
microPercentRange?: MicroPercentRange;
84+
percentOperator?: PercentConditionOperator;
85+
seed?: string;
86+
}
87+
88+
// @public
89+
export enum PercentConditionOperator {
90+
BETWEEN = "BETWEEN",
91+
GREATER_THAN = "GREATER_THAN",
92+
LESS_OR_EQUAL = "LESS_OR_EQUAL",
93+
UNKNOWN = "UNKNOWN"
94+
}
95+
4996
// @public
5097
export class RemoteConfig {
5198
// (undocumented)
@@ -120,7 +167,7 @@ export type ServerConfig = {
120167
export interface ServerTemplate {
121168
cache: ServerTemplateData;
122169
defaultConfig: ServerConfig;
123-
evaluate(): ServerConfig;
170+
evaluate(context?: EvaluationContext): ServerConfig;
124171
load(): Promise<void>;
125172
}
126173

0 commit comments

Comments
 (0)