| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bb1fb6f commit 82391d5
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1014,6 +1014,7 @@ export namespace remoteConfig { | |||
| 1014 | 1014 | nextPageToken?: string; | |
| 1015 | 1015 | versions: Version[]; | |
| 1016 | 1016 | } | |
| 1017 | + export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON'; | ||
| 1017 | 1018 | export interface RemoteConfig { | |
| 1018 | 1019 | // (undocumented) | |
| 1019 | 1020 | app: app.App; | |
@@ -1038,6 +1039,7 @@ export namespace remoteConfig { | |||
| 1038 | 1039 | }; | |
| 1039 | 1040 | defaultValue?: RemoteConfigParameterValue; | |
| 1040 | 1041 | description?: string; | |
| 1042 | + valueType?: ParameterValueType; | ||
| 1041 | 1043 | } | |
| 1042 | 1044 | export interface RemoteConfigParameterGroup { | |
| 1043 | 1045 | description?: string; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -150,6 +150,12 @@ export namespace remoteConfig { | |||
| 150 | 150 | * Unicode characters. | |
| 151 | 151 | */ | |
| 152 | 152 | description?: string; | |
| 153 | + | ||
| 154 | + /** | ||
| 155 | + * The data type for all values of this parameter in the current version of the template. | ||
| 156 | + * Defaults to `ParameterValueType.STRING` if unspecified. | ||
| 157 | + */ | ||
| 158 | + valueType?: ParameterValueType; | ||
| 153 | 159 | } | |
| 154 | 160 | ||
| 155 | 161 | /** | |
@@ -259,6 +265,12 @@ export namespace remoteConfig { | |||
| 259 | 265 | export type TagColor = 'BLUE' | 'BROWN' | 'CYAN' | 'DEEP_ORANGE' | 'GREEN' | | |
| 260 | 266 | 'INDIGO' | 'LIME' | 'ORANGE' | 'PINK' | 'PURPLE' | 'TEAL'; | |
| 261 | 267 | ||
| 268 | + /** | ||
| 269 | + * Type representing a Remote Config parameter value data type. | ||
| 270 | + * Defaults to `STRING` if unspecified. | ||
| 271 | + */ | ||
| 272 | + export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON' | ||
| 273 | + | ||
| 262 | 274 | /** | |
| 263 | 275 | * Interface representing a Remote Config template version. | |
| 264 | 276 | * Output only, except for the version description. Contains metadata about a particular | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,11 +28,13 @@ const VALID_PARAMETERS = { | |||
| 28 | 28 | // eslint-disable-next-line @typescript-eslint/camelcase | |
| 29 | 29 | holiday_promo_enabled: { | |
| 30 | 30 | defaultValue: { useInAppDefault: true }, | |
| 31 | - description: 'promo indicator' | ||
| 31 | + description: 'promo indicator', | ||
| 32 | + valueType: 'STRING' as admin.remoteConfig.ParameterValueType, | ||
| 32 | 33 | }, | |
| 33 | 34 | // eslint-disable-next-line @typescript-eslint/camelcase | |
| 34 | 35 | welcome_message: { | |
| 35 | 36 | defaultValue: { value: `welcome text ${Date.now()}` }, | |
| 37 | + valueType: 'STRING' as admin.remoteConfig.ParameterValueType, | ||
| 36 | 38 | conditionalValues: { | |
| 37 | 39 | ios: { value: 'welcome ios text' }, | |
| 38 | 40 | android: { value: 'welcome android text' }, | |
@@ -52,6 +54,7 @@ const VALID_PARAMETER_GROUPS = { | |||
| 52 | 54 | 'android': { value: 'A Droid must love a pumpkin spice latte.' }, | |
| 53 | 55 | }, | |
| 54 | 56 | description: 'Description of the parameter.', | |
| 57 | + valueType: 'STRING' as admin.remoteConfig.ParameterValueType, | ||
| 55 | 58 | }, | |
| 56 | 59 | }, | |
| 57 | 60 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,7 +73,7 @@ describe('RemoteConfigApiClient', () => { | |||
| 73 | 73 | ||
| 74 | 74 | const TEST_RESPONSE = { | |
| 75 | 75 | conditions: [{ name: 'ios', expression: 'exp' }], | |
| 76 | - parameters: { param: { defaultValue: { value: 'true' } } }, | ||
| 76 | + parameters: { param: { defaultValue: { value: 'true' }, valueType: 'BOOLEAN' } }, | ||
| 77 | 77 | parameterGroups: { group: { parameters: { paramabc: { defaultValue: { value: 'true' } } }, } }, | |
| 78 | 78 | version: VERSION_INFO, | |
| 79 | 79 | }; | |
@@ -132,6 +132,7 @@ describe('RemoteConfigApiClient', () => { | |||
| 132 | 132 | defaultValue: { value: 'true' }, | |
| 133 | 133 | conditionalValues: { ios: { useInAppDefault: true } }, | |
| 134 | 134 | description: 'this is a promo', | |
| 135 | + valueType: 'BOOLEAN' | ||
| 135 | 136 | }, | |
| 136 | 137 | }, | |
| 137 | 138 | parameterGroups: { | |
@@ -429,7 +430,7 @@ describe('RemoteConfigApiClient', () => { | |||
| 429 | 430 | }); | |
| 430 | 431 | ||
| 431 | 432 | VALIDATION_ERROR_MESSAGES.forEach((message) => { | |
| 432 | - it('should reject with failed-precondition when a validation error occurres', () => { | ||
| 433 | + it('should reject with failed-precondition when a validation error occurs', () => { | ||
| 433 | 434 | const stub = sinon | |
| 434 | 435 | .stub(HttpClient.prototype, 'send') | |
| 435 | 436 | .rejects(utils.errorFrom({ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,6 +51,7 @@ describe('RemoteConfig', () => { | |||
| 51 | 51 | 'android_en': { value: 'A Droid must love a pumpkin spice latte.' }, | |
| 52 | 52 | }, | |
| 53 | 53 | description: 'Description of the parameter.', | |
| 54 | + valueType: 'STRING' as remoteConfig.ParameterValueType, | ||
| 54 | 55 | }, | |
| 55 | 56 | }, | |
| 56 | 57 | }, | |
@@ -91,6 +92,7 @@ describe('RemoteConfig', () => { | |||
| 91 | 92 | defaultValue: { value: 'true' }, | |
| 92 | 93 | conditionalValues: { ios: { useInAppDefault: true } }, | |
| 93 | 94 | description: 'this is a promo', | |
| 95 | + valueType: 'BOOLEAN', | ||
| 94 | 96 | }, | |
| 95 | 97 | }, | |
| 96 | 98 | parameterGroups: PARAMETER_GROUPS, | |
@@ -110,6 +112,7 @@ describe('RemoteConfig', () => { | |||
| 110 | 112 | defaultValue: { value: 'true' }, | |
| 111 | 113 | conditionalValues: { ios: { useInAppDefault: true } }, | |
| 112 | 114 | description: 'this is a promo', | |
| 115 | + valueType: 'BOOLEAN', | ||
| 113 | 116 | }, | |
| 114 | 117 | }, | |
| 115 | 118 | parameterGroups: PARAMETER_GROUPS, | |
@@ -383,7 +386,7 @@ describe('RemoteConfig', () => { | |||
| 383 | 386 | }); | |
| 384 | 387 | }); | |
| 385 | 388 | ||
| 386 | - it('should resolve with an empty versions list if the no results are availble for requested list options', () => { | ||
| 389 | + it('should resolve with an empty versions list if no results are available for requested list options', () => { | ||
| 387 | 390 | const stub = sinon | |
| 388 | 391 | .stub(RemoteConfigApiClient.prototype, 'listVersions') | |
| 389 | 392 | .resolves({} as any); | |
@@ -498,6 +501,7 @@ describe('RemoteConfig', () => { | |||
| 498 | 501 | expect(p1.defaultValue).deep.equals({ value: 'true' }); | |
| 499 | 502 | expect(p1.conditionalValues).deep.equals({ ios: { useInAppDefault: true } }); | |
| 500 | 503 | expect(p1.description).equals('this is a promo'); | |
| 504 | + expect(p1.valueType).equals('BOOLEAN'); | ||
| 501 | 505 | ||
| 502 | 506 | expect(newTemplate.parameterGroups).deep.equals(PARAMETER_GROUPS); | |
| 503 | 507 | ||
@@ -662,6 +666,7 @@ describe('RemoteConfig', () => { | |||
| 662 | 666 | expect(p1.defaultValue).deep.equals({ value: 'true' }); | |
| 663 | 667 | expect(p1.conditionalValues).deep.equals({ ios: { useInAppDefault: true } }); | |
| 664 | 668 | expect(p1.description).equals('this is a promo'); | |
| 669 | + expect(p1.valueType).equals('BOOLEAN'); | ||
| 665 | 670 | ||
| 666 | 671 | expect(template.parameterGroups).deep.equals(PARAMETER_GROUPS); | |
| 667 | 672 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments