-
Notifications
You must be signed in to change notification settings - Fork 356
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
feat(rc): Add Remote Config Version Management API #920
Changes from 6 commits
e7af8bb
773add8
5762470
bde53cc
16b20f1
cf10110
a1e589f
0438241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -878,6 +878,11 @@ declare namespace admin.remoteConfig { | |
* ETag of the current Remote Config template (readonly). | ||
*/ | ||
readonly etag: string; | ||
|
||
/** | ||
* Version information of the current Remote Config template. | ||
*/ | ||
version?: Version; | ||
} | ||
|
||
/** | ||
|
@@ -982,6 +987,123 @@ declare namespace admin.remoteConfig { | |
*/ | ||
type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue; | ||
|
||
/** | ||
* Interface representing a Remote Config template version. | ||
* Output only, except for the version description. Contains metadata about a particular | ||
* version of the Remote Config template. All fields are set at the time the specified Remote | ||
* Config template was published. A version's description field may be specified in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest "is published" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated! |
||
* `publishTemplate` calls. | ||
*/ | ||
export interface Version { | ||
/** | ||
* The version number of a Remote Config template. | ||
*/ | ||
versionNumber?: string; | ||
|
||
/** | ||
* The timestamp of when this version of the Remote Config template was written to the | ||
* Remote Config server. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest "backend" instead of server, unless it's inaccurate. We use backend a lot in the guide docs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. |
||
*/ | ||
updateTime?: string; | ||
|
||
/** | ||
* The source of origin of the template update action. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest just "origin" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
*/ | ||
updateOrigin?: ('REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED' | 'CONSOLE' | | ||
'REST_API' | 'ADMIN_SDK_NODE'); | ||
|
||
/** | ||
* The type of the template update action. | ||
*/ | ||
updateType?: ('REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED' | | ||
'INCREMENTAL_UPDATE' | 'FORCED_UPDATE' | 'ROLLBACK'); | ||
|
||
/** | ||
* Aggregation of all metadata fields about the account that performed the update. | ||
*/ | ||
updateUser?: RemoteConfigUser; | ||
|
||
/** | ||
* The user-provided description of the corresponding Remote Config template. | ||
*/ | ||
description?: string; | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest a bit of a rewrite: "The version number of Is this accurate? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is accurate! Thanks. Updated. |
||
* Only present if this version is the result of a rollback, and will be the version number of | ||
* the Remote Config template that was rolled-back to. | ||
*/ | ||
rollbackSource?: string; | ||
|
||
/** | ||
* Indicates weather this Remote Config template was published before version history was | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo -- "whether" |
||
* supported. | ||
*/ | ||
isLegacy?: boolean; | ||
} | ||
|
||
/** Interface representing a list of Remote Config template versions. */ | ||
export interface ListVersionsResult { | ||
/** | ||
* A list of version metadata objects, sorted in reverse chronological order. | ||
*/ | ||
versions: Version[]; | ||
|
||
/** | ||
* Token to retrieve the next page of results, or empty if there are no more results | ||
* in the list. | ||
*/ | ||
nextPageToken?: string; | ||
} | ||
|
||
/** Interface representing a Remote Config list version options. */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be "list version options for a template" ? It sounds a little funny this way -- "a options" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are actually
Let me know what you think. |
||
export interface ListVersionsOptions { | ||
/** | ||
* The maximum number of items to return per page. | ||
*/ | ||
pageSize?: number; | ||
|
||
/** | ||
* The `nextPageToken` value returned from a previous list versions request, if any. | ||
*/ | ||
pageToken?: string; | ||
|
||
/** | ||
* Specify the newest version number to include in the results. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest "Specifies" here and below. |
||
* If specified, must be greater than zero. Defaults to the newest version. | ||
*/ | ||
endVersionNumber?: string | number; | ||
|
||
/** | ||
* Specify the earliest update time to include in the results. Any entries updated before this | ||
* time are omitted. | ||
*/ | ||
startTime?: Date | string; | ||
|
||
/** | ||
* Specify the latest update time to include in the results. Any entries updated on or after | ||
* this time are omitted. | ||
*/ | ||
endTime?: Date | string; | ||
} | ||
|
||
/** Interface representing a Remote Config user.*/ | ||
export interface RemoteConfigUser { | ||
/** | ||
* Email address. Output only. | ||
*/ | ||
email: string; | ||
|
||
/** | ||
* Display name. Output only. | ||
*/ | ||
name?: string; | ||
|
||
/** | ||
* Image URL. Output only. | ||
*/ | ||
imageUrl?: string; | ||
} | ||
|
||
/** | ||
* The Firebase `RemoteConfig` service interface. | ||
* | ||
|
@@ -994,11 +1116,21 @@ declare namespace admin.remoteConfig { | |
/** | ||
* Gets the current active version of the {@link admin.remoteConfig.RemoteConfigTemplate | ||
* `RemoteConfigTemplate`} of the project. | ||
* | ||
* | ||
* @return A promise that fulfills with a `RemoteConfigTemplate`. | ||
*/ | ||
getTemplate(): Promise<RemoteConfigTemplate>; | ||
|
||
/** | ||
* Gets the requested version of the {@link admin.remoteConfig.RemoteConfigTemplate | ||
* `RemoteConfigTemplate`} of the project. | ||
* | ||
* @param versionNumber Version number of the Remote Config template to look up. | ||
* | ||
* @return A promise that fulfills with a `RemoteConfigTemplate`. | ||
*/ | ||
getTemplateAtVersion(versionNumber: number | string): Promise<RemoteConfigTemplate>; | ||
|
||
/** | ||
* Validates a {@link admin.remoteConfig.RemoteConfigTemplate `RemoteConfigTemplate`}. | ||
* | ||
|
@@ -1023,6 +1155,30 @@ declare namespace admin.remoteConfig { | |
*/ | ||
publishTemplate(template: RemoteConfigTemplate, options?: { force: boolean }): Promise<RemoteConfigTemplate>; | ||
|
||
/** | ||
* Rolls back a project's published Remote Config template to the specified version. | ||
* A rollback is equivalent to getting a previously published Remote Config | ||
* template and re-publishing it using a force update. | ||
* | ||
* @param versionNumber The version number of the Remote Config template to rollback to. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest "roll back to" |
||
* The specified version number must be lower than the current version number, and not have | ||
* been deleted due to staleness. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the limit on this? 300 versions/90 days? Might be good to mention here, not sure. It's right below as well :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added 300 versions/90 days text here as well |
||
* @return A promise that fulfills with the published `RemoteConfigTemplate`. | ||
*/ | ||
rollback(versionNumber: string | number): Promise<RemoteConfigTemplate>; | ||
|
||
/** | ||
* Gets a list of Remote Config template versions that have been published, sorted in reverse | ||
* chronological order. Only the last 300 versions are stored. | ||
* All versions that correspond to non-active Remote Config templates (i.e., all except the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest "that is, all except . . ." |
||
* template that is being fetched by clients) are also deleted if they are older than 90 days. | ||
* | ||
* @param options Optional {@link admin.remoteConfig.ListVersionsOptions `ListVersionsOptions`} | ||
* object for getting a list of tempalte versions. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! Thanks! |
||
* @return A promise that fulfills with a `ListVersionsResult`. | ||
*/ | ||
listVersions(options?: ListVersionsOptions): Promise<ListVersionsResult>; | ||
|
||
/** | ||
* Creates and returns a new Remote Config template from a JSON string. | ||
* | ||
|
@@ -1108,7 +1264,7 @@ declare namespace admin.machineLearning { | |
* | ||
* Example: `tfliteModel: { gcsTfliteUri: 'gs://your-bucket/your-model.tflite' }` | ||
*/ | ||
tfliteModel?: {gcsTfliteUri: string}; | ||
tfliteModel?: { gcsTfliteUri: string }; | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this return just a number?
I lean toward "information for" unless it's just a "version number of"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It is not just a number. Changed to
information for
.