Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define SSRC API #2456

Merged
merged 2 commits into from
Feb 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 79 additions & 1 deletion src/remote-config/remote-config-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ export interface RemoteConfigCondition {
tagColor?: TagColor;
}

/**
* Interface representing a Remote Config condition in the data-plane.
* A condition targets a specific group of users. A list of these conditions make up
* part of a Remote Config template.
*/
export interface RemoteConfigServerCondition {

/**
* A non-empty and unique name of this condition.
*/
name: string;

/**
* The logic of this condition.
* See the documentation on
* {@link https://firebase.google.com/docs/remote-config/condition-reference | condition expressions}
* for the expected syntax of this field.
*/
expression: string;
}

/**
* Interface representing an explicit parameter value.
*/
Expand Down Expand Up @@ -135,7 +156,7 @@ export interface RemoteConfigParameterGroup {
}

/**
* Interface representing a Remote Config template.
* Interface representing a Remote Config client template.
*/
export interface RemoteConfigTemplate {
/**
Expand Down Expand Up @@ -167,6 +188,58 @@ export interface RemoteConfigTemplate {
version?: Version;
}

/**
* Interface representing the data in a Remote Config server template.
*/
export interface RemoteConfigServerTemplateData {
/**
* A list of conditions in descending order by priority.
*/
conditions: RemoteConfigServerCondition[];

/**
* Map of parameter keys to their optional default values and optional conditional values.
*/
parameters: { [key: string]: RemoteConfigParameter };

/**
* ETag of the current Remote Config template (readonly).
*/
readonly etag: string;

/**
* Version information for the current Remote Config template.
*/
version?: Version;
}

/**
* Interface representing a stateful abstraction for a Remote Config server template.
*/
export interface RemoteConfigServerTemplate {

/**
* Cached {@link RemoteConfigServerTemplateData}
*/
cache: RemoteConfigServerTemplateData;

/**
* A {@link RemoteConfigServerConfig} containing default values for Config
*/
defaultConfig: RemoteConfigServerConfig;

/**
* Evaluates the current template to produce a {@link RemoteConfigServerConfig}
*/
evaluate(): RemoteConfigServerConfig;

/**
* Fetches and caches the current active version of the
* {@link RemoteConfigServerTemplate} of the project.
*/
load(): Promise<void>;
}

/**
* Interface representing a Remote Config user.
*/
Expand Down Expand Up @@ -289,3 +362,8 @@ export interface ListVersionsOptions {
*/
endTime?: Date | string;
}

/**
* Type representing the configuration produced by evaluating a server template.
*/
export type RemoteConfigServerConfig = { [key: string]: string | boolean | number }