diff --git a/etc/firebase-admin.remote-config.api.md b/etc/firebase-admin.remote-config.api.md index 614fc5dfeb..98c1883ab1 100644 --- a/etc/firebase-admin.remote-config.api.md +++ b/etc/firebase-admin.remote-config.api.md @@ -38,6 +38,11 @@ export interface ListVersionsResult { versions: Version[]; } +// @public +export interface NamedCondition { + name: string; +} + // @public export type ParameterValueType = 'STRING' | 'BOOLEAN' | 'NUMBER' | 'JSON'; @@ -46,10 +51,10 @@ export class RemoteConfig { // (undocumented) readonly app: App; createTemplateFromJSON(json: string): RemoteConfigTemplate; - getServerTemplate(options?: RemoteConfigServerTemplateOptions): Promise; + getServerTemplate(options?: ServerTemplateOptions): Promise; getTemplate(): Promise; getTemplateAtVersion(versionNumber: number | string): Promise; - initServerTemplate(options?: RemoteConfigServerTemplateOptions): RemoteConfigServerTemplate; + initServerTemplate(options?: ServerTemplateOptions): ServerTemplate; listVersions(options?: ListVersionsOptions): Promise; publishTemplate(template: RemoteConfigTemplate, options?: { force: boolean; @@ -87,28 +92,12 @@ export interface RemoteConfigParameterGroup { export type RemoteConfigParameterValue = ExplicitParameterValue | InAppDefaultValue; // @public -export interface RemoteConfigServerCondition { - expression: string; - name: string; -} - -// @public -export type RemoteConfigServerConfig = { - [key: string]: string | boolean | number; -}; - -// @public -export interface RemoteConfigServerTemplate { - cache: RemoteConfigServerTemplateData; - defaultConfig: RemoteConfigServerConfig; - evaluate(): RemoteConfigServerConfig; - load(): Promise; -} - -// @public -export interface RemoteConfigServerTemplateData { - conditions: RemoteConfigServerCondition[]; +export interface RemoteConfigTemplate { + conditions: RemoteConfigCondition[]; readonly etag: string; + parameterGroups: { + [key: string]: RemoteConfigParameterGroup; + }; parameters: { [key: string]: RemoteConfigParameter; }; @@ -116,18 +105,29 @@ export interface RemoteConfigServerTemplateData { } // @public -export interface RemoteConfigServerTemplateOptions { - defaultConfig?: RemoteConfigServerConfig; - template?: RemoteConfigServerTemplateData; +export interface RemoteConfigUser { + email: string; + imageUrl?: string; + name?: string; } // @public -export interface RemoteConfigTemplate { - conditions: RemoteConfigCondition[]; +export type ServerConfig = { + [key: string]: string | boolean | number; +}; + +// @public +export interface ServerTemplate { + cache: ServerTemplateData; + defaultConfig: ServerConfig; + evaluate(): ServerConfig; + load(): Promise; +} + +// @public +export interface ServerTemplateData { + conditions: NamedCondition[]; readonly etag: string; - parameterGroups: { - [key: string]: RemoteConfigParameterGroup; - }; parameters: { [key: string]: RemoteConfigParameter; }; @@ -135,10 +135,9 @@ export interface RemoteConfigTemplate { } // @public -export interface RemoteConfigUser { - email: string; - imageUrl?: string; - name?: string; +export interface ServerTemplateOptions { + defaultConfig?: ServerConfig; + template?: ServerTemplateData; } // @public diff --git a/src/remote-config/index.ts b/src/remote-config/index.ts index 194929641c..aa09a8e18a 100644 --- a/src/remote-config/index.ts +++ b/src/remote-config/index.ts @@ -29,18 +29,18 @@ export { InAppDefaultValue, ListVersionsOptions, ListVersionsResult, + NamedCondition, ParameterValueType, RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, RemoteConfigParameterValue, RemoteConfigTemplate, - RemoteConfigServerCondition, - RemoteConfigServerConfig, - RemoteConfigServerTemplate, - RemoteConfigServerTemplateData, - RemoteConfigServerTemplateOptions, RemoteConfigUser, + ServerConfig, + ServerTemplate, + ServerTemplateData, + ServerTemplateOptions, TagColor, Version, } from './remote-config-api'; diff --git a/src/remote-config/remote-config-api-client-internal.ts b/src/remote-config/remote-config-api-client-internal.ts index 6331eaa1b1..f1a0ad1c10 100644 --- a/src/remote-config/remote-config-api-client-internal.ts +++ b/src/remote-config/remote-config-api-client-internal.ts @@ -25,7 +25,7 @@ import { ListVersionsOptions, ListVersionsResult, RemoteConfigTemplate, - RemoteConfigServerTemplateData + ServerTemplateData } from './remote-config-api'; // Remote Config backend constants @@ -175,7 +175,7 @@ export class RemoteConfigApiClient { }); } - public getServerTemplate(): Promise { + public getServerTemplate(): Promise { return this.getUrl() .then((url) => { const request: HttpRequestConfig = { @@ -289,7 +289,7 @@ export class RemoteConfigApiClient { * @param {HttpResponse} resp API response object. * @param {string} customEtag A custom etag to replace the etag fom the API response (Optional). */ - private toRemoteConfigServerTemplate(resp: HttpResponse, customEtag?: string): RemoteConfigServerTemplateData { + private toRemoteConfigServerTemplate(resp: HttpResponse, customEtag?: string): ServerTemplateData { const etag = (typeof customEtag === 'undefined') ? resp.headers['etag'] : customEtag; this.validateEtag(etag); return { diff --git a/src/remote-config/remote-config-api.ts b/src/remote-config/remote-config-api.ts index a5d0287d80..2ad15eedd5 100644 --- a/src/remote-config/remote-config-api.ts +++ b/src/remote-config/remote-config-api.ts @@ -59,20 +59,12 @@ export interface RemoteConfigCondition { * A condition targets a specific group of users. A list of these conditions make up * part of a Remote Config template. */ -export interface RemoteConfigServerCondition { +export interface NamedCondition { /** * 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; } /** @@ -191,11 +183,11 @@ export interface RemoteConfigTemplate { /** * Represents the data in a Remote Config server template. */ -export interface RemoteConfigServerTemplateData { +export interface ServerTemplateData { /** * A list of conditions in descending order by priority. */ - conditions: RemoteConfigServerCondition[]; + conditions: NamedCondition[]; /** * Map of parameter keys to their optional default values and optional conditional values. @@ -214,16 +206,16 @@ export interface RemoteConfigServerTemplateData { } /** - * Represents optional arguments that can be used when instantiating {@link RemoteConfigServerTemplate}. + * Represents optional arguments that can be used when instantiating {@link ServerTemplate}. */ -export interface RemoteConfigServerTemplateOptions { +export interface ServerTemplateOptions { /** * Defines in-app default parameter values, so that your app behaves as * intended before it connects to the Remote Config backend, and so that * default values are available if none are set on the backend. */ - defaultConfig?: RemoteConfigServerConfig, + defaultConfig?: ServerConfig, /** * Enables integrations to use template data loaded independently. For @@ -231,32 +223,32 @@ export interface RemoteConfigServerTemplateOptions { * caching template data and then using this option to initialize the SDK with * that data. */ - template?: RemoteConfigServerTemplateData, + template?: ServerTemplateData, } /** * Represents a stateful abstraction for a Remote Config server template. */ -export interface RemoteConfigServerTemplate { +export interface ServerTemplate { /** - * Cached {@link RemoteConfigServerTemplateData}. + * Cached {@link ServerTemplateData}. */ - cache: RemoteConfigServerTemplateData; + cache: ServerTemplateData; /** - * A {@link RemoteConfigServerConfig} that contains default Config values. + * A {@link ServerConfig} that contains default Config values. */ - defaultConfig: RemoteConfigServerConfig; + defaultConfig: ServerConfig; /** - * Evaluates the current template to produce a {@link RemoteConfigServerConfig}. + * Evaluates the current template to produce a {@link ServerConfig}. */ - evaluate(): RemoteConfigServerConfig; + evaluate(): ServerConfig; /** * Fetches and caches the current active version of the - * project's {@link RemoteConfigServerTemplate}. + * project's {@link ServerTemplate}. */ load(): Promise; } @@ -387,4 +379,4 @@ export interface ListVersionsOptions { /** * Represents the configuration produced by evaluating a server template. */ -export type RemoteConfigServerConfig = { [key: string]: string | boolean | number } +export type ServerConfig = { [key: string]: string | boolean | number } diff --git a/src/remote-config/remote-config.ts b/src/remote-config/remote-config.ts index cfd965d27b..afd9d68d3c 100644 --- a/src/remote-config/remote-config.ts +++ b/src/remote-config/remote-config.ts @@ -23,16 +23,17 @@ import { RemoteConfigCondition, RemoteConfigParameter, RemoteConfigParameterGroup, - RemoteConfigServerTemplate, + ServerTemplate, RemoteConfigTemplate, RemoteConfigUser, Version, ExplicitParameterValue, InAppDefaultValue, ParameterValueType, - RemoteConfigServerConfig, - RemoteConfigServerTemplateData, - RemoteConfigServerTemplateOptions, + ServerConfig, + ServerTemplateData, + ServerTemplateOptions, + NamedCondition, } from './remote-config-api'; /** @@ -177,20 +178,20 @@ export class RemoteConfig { } /** - * Instantiates {@link RemoteConfigServerTemplate} and then fetches and caches the latest + * Instantiates {@link ServerTemplate} and then fetches and caches the latest * template version of the project. */ - public async getServerTemplate(options?: RemoteConfigServerTemplateOptions): Promise { + public async getServerTemplate(options?: ServerTemplateOptions): Promise { const template = this.initServerTemplate(options); await template.load(); return template; } /** - * Synchronously instantiates {@link RemoteConfigServerTemplate}. + * Synchronously instantiates {@link ServerTemplate}. */ - public initServerTemplate(options?: RemoteConfigServerTemplateOptions): RemoteConfigServerTemplate { - const template = new RemoteConfigServerTemplateImpl(this.client, options?.defaultConfig); + public initServerTemplate(options?: ServerTemplateOptions): ServerTemplate { + const template = new ServerTemplateImpl(this.client, options?.defaultConfig); if (options?.template) { template.cache = options?.template; } @@ -285,35 +286,35 @@ class RemoteConfigTemplateImpl implements RemoteConfigTemplate { /** * Remote Config dataplane template data implementation. */ -class RemoteConfigServerTemplateImpl implements RemoteConfigServerTemplate { - public cache: RemoteConfigServerTemplateData; +class ServerTemplateImpl implements ServerTemplate { + public cache: ServerTemplateData; constructor( private readonly apiClient: RemoteConfigApiClient, - public readonly defaultConfig: RemoteConfigServerConfig = {} + public readonly defaultConfig: ServerConfig = {} ) { } /** - * Fetches and caches the current active version of the project's {@link RemoteConfigServerTemplate}. + * Fetches and caches the current active version of the project's {@link ServerTemplate}. */ public load(): Promise { return this.apiClient.getServerTemplate() .then((template) => { - this.cache = new RemoteConfigServerTemplateDataImpl(template); + this.cache = new ServerTemplateDataImpl(template); }); } /** - * Evaluates the current template in cache to produce a {@link RemoteConfigServerConfig}. + * Evaluates the current template in cache to produce a {@link ServerConfig}. */ - public evaluate(): RemoteConfigServerConfig { + public evaluate(): ServerConfig { if (!this.cache) { throw new FirebaseRemoteConfigError( 'failed-precondition', 'No Remote Config Server template in cache. Call load() before calling evaluate().'); } - const evaluatedConfig: RemoteConfigServerConfig = {}; + const evaluatedConfig: ServerConfig = {}; for (const [key, parameter] of Object.entries(this.cache.parameters)) { const { defaultValue, valueType } = parameter; @@ -339,7 +340,7 @@ class RemoteConfigServerTemplateImpl implements RemoteConfigServerTemplate { // Enables config to be a convenient object, but with the ability to perform additional // functionality when a value is retrieved. const proxyHandler = { - get(target: RemoteConfigServerConfig, prop: string) { + get(target: ServerConfig, prop: string) { return target[prop]; } }; @@ -374,14 +375,14 @@ class RemoteConfigServerTemplateImpl implements RemoteConfigServerTemplate { /** * Remote Config dataplane template data implementation. */ -class RemoteConfigServerTemplateDataImpl implements RemoteConfigServerTemplateData { +class ServerTemplateDataImpl implements ServerTemplateData { public parameters: { [key: string]: RemoteConfigParameter }; public parameterGroups: { [key: string]: RemoteConfigParameterGroup }; - public conditions: RemoteConfigCondition[]; + public conditions: NamedCondition[]; public readonly etag: string; public version?: Version; - constructor(template: RemoteConfigServerTemplateData) { + constructor(template: ServerTemplateData) { if (!validator.isNonNullObject(template) || !validator.isNonEmptyString(template.etag)) { throw new FirebaseRemoteConfigError( diff --git a/test/unit/remote-config/remote-config-api-client.spec.ts b/test/unit/remote-config/remote-config-api-client.spec.ts index da2c87c639..52abb968c1 100644 --- a/test/unit/remote-config/remote-config-api-client.spec.ts +++ b/test/unit/remote-config/remote-config-api-client.spec.ts @@ -33,7 +33,7 @@ import { getSdkVersion } from '../../../src/utils/index'; import { RemoteConfigTemplate, Version, ListVersionsResult, } from '../../../src/remote-config/index'; -import { RemoteConfigServerTemplateData } from '../../../src/remote-config/remote-config-api'; +import { ServerTemplateData } from '../../../src/remote-config/remote-config-api'; const expect = chai.expect; @@ -708,7 +708,7 @@ describe('RemoteConfigApiClient', () => { }); } - function runEtagHeaderTests(rcOperation: () => Promise): void { + function runEtagHeaderTests(rcOperation: () => Promise): void { it('should reject when the etag is not present in the response', () => { const stub = sinon .stub(HttpClient.prototype, 'send') @@ -722,7 +722,7 @@ describe('RemoteConfigApiClient', () => { } function runErrorResponseTests( - rcOperation: () => Promise): void { + rcOperation: () => Promise): void { it('should reject when a full platform error response is received', () => { const stub = sinon .stub(HttpClient.prototype, 'send') diff --git a/test/unit/remote-config/remote-config.spec.ts b/test/unit/remote-config/remote-config.spec.ts index 71fcf87f84..a78febcc81 100644 --- a/test/unit/remote-config/remote-config.spec.ts +++ b/test/unit/remote-config/remote-config.spec.ts @@ -35,7 +35,7 @@ import { } from '../../../src/remote-config/remote-config-api-client-internal'; import { deepCopy } from '../../../src/utils/deep-copy'; import { - RemoteConfigServerCondition, RemoteConfigServerTemplate, RemoteConfigServerTemplateData + NamedCondition, ServerTemplate, ServerTemplateData } from '../../../src/remote-config/remote-config-api'; const expect = chai.expect; @@ -106,15 +106,14 @@ describe('RemoteConfig', () => { // to allow easier use from within the tests. An improvement would be to // alter this into a helper that creates customized RemoteConfigTemplateContent based // on the needs of the test, as that would ensure type-safety. - conditions?: Array<{ name: string; expression: string; }>; + conditions?: Array<{ name: string; }>; parameters?: object | null; etag: string; version?: object; } = { conditions: [ { - name: 'ios', - expression: 'device.os == \'ios\'' + name: 'ios' }, ], parameters: { @@ -557,14 +556,13 @@ describe('RemoteConfig', () => { it('should resolve a server template on success', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(SERVER_REMOTE_CONFIG_RESPONSE as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .then((template) => { expect(template.cache.conditions.length).to.equal(1); expect(template.cache.conditions[0].name).to.equal('ios'); - expect(template.cache.conditions[0].expression).to.equal('device.os == \'ios\''); expect(template.cache.etag).to.equal('etag-123456789012-5'); const version = template.cache.version!; @@ -586,9 +584,8 @@ describe('RemoteConfig', () => { const c = template.cache.conditions.find((c) => c.name === 'ios'); expect(c).to.be.not.undefined; - const cond = c as RemoteConfigServerCondition; + const cond = c as NamedCondition; expect(cond.name).to.equal('ios'); - expect(cond.expression).to.equal('device.os == \'ios\''); const parsed = JSON.parse(JSON.stringify(template.cache)); const expectedTemplate = deepCopy(SERVER_REMOTE_CONFIG_RESPONSE); @@ -607,7 +604,7 @@ describe('RemoteConfig', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(SERVER_REMOTE_CONFIG_RESPONSE as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate({ defaultConfig }) @@ -620,7 +617,7 @@ describe('RemoteConfig', () => { describe('initServerTemplate', () => { it('should set and instantiates template when passed', () => { - const template = deepCopy(SERVER_REMOTE_CONFIG_RESPONSE) as RemoteConfigServerTemplateData; + const template = deepCopy(SERVER_REMOTE_CONFIG_RESPONSE) as ServerTemplateData; template.parameters = { dog_type: { defaultValue: { @@ -706,7 +703,7 @@ describe('RemoteConfig', () => { response.etag = ''; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .should.eventually.be.rejected.and.have.property( @@ -718,7 +715,7 @@ describe('RemoteConfig', () => { response.parameters = null; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .should.eventually.be.rejected.and.have.property( @@ -730,7 +727,7 @@ describe('RemoteConfig', () => { response.conditions = Object(); const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .should.eventually.be.rejected.and.have.property( @@ -742,7 +739,7 @@ describe('RemoteConfig', () => { response.parameters = undefined; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .then((template) => { @@ -756,7 +753,7 @@ describe('RemoteConfig', () => { response.conditions = undefined; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .then((template) => { @@ -768,14 +765,13 @@ describe('RemoteConfig', () => { it('should resolve a server template on success', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(SERVER_REMOTE_CONFIG_RESPONSE as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() .then((template) => { expect(template.cache.conditions.length).to.equal(1); expect(template.cache.conditions[0].name).to.equal('ios'); - expect(template.cache.conditions[0].expression).to.equal('device.os == \'ios\''); expect(template.cache.etag).to.equal('etag-123456789012-5'); const version = template.cache.version!; @@ -797,9 +793,8 @@ describe('RemoteConfig', () => { const c = template.cache.conditions.find((c) => c.name === 'ios'); expect(c).to.be.not.undefined; - const cond = c as RemoteConfigServerCondition; + const cond = c as NamedCondition; expect(cond.name).to.equal('ios'); - expect(cond.expression).to.equal('device.os == \'ios\''); const parsed = JSON.parse(JSON.stringify(template.cache)); const expectedTemplate = deepCopy(SERVER_REMOTE_CONFIG_RESPONSE); @@ -817,7 +812,7 @@ describe('RemoteConfig', () => { response.version = versionInfo; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() @@ -843,7 +838,7 @@ describe('RemoteConfig', () => { response.version = versionInfo; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() @@ -869,7 +864,7 @@ describe('RemoteConfig', () => { response.version = versionInfo; const stub = sinon .stub(RemoteConfigApiClient.prototype, operationName) - .resolves(response as RemoteConfigServerTemplateData); + .resolves(response as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() @@ -893,10 +888,10 @@ describe('RemoteConfig', () => { it('returns a config when template is present in cache', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, 'getServerTemplate') - .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate() - .then((template: RemoteConfigServerTemplate) => { + .then((template: ServerTemplate) => { const config = template.evaluate!(); expect(config.dog_type).to.equal('corgi'); expect(config.dog_type_enabled).to.equal(true); @@ -908,14 +903,14 @@ describe('RemoteConfig', () => { it('uses local default if parameter not in template', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, 'getServerTemplate') - .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate({ defaultConfig: { dog_coat: 'blue merle', } }) - .then((template: RemoteConfigServerTemplate) => { + .then((template: ServerTemplate) => { const config = template.evaluate!(); expect(config.dog_coat).to.equal(template.defaultConfig.dog_coat); }); @@ -924,14 +919,14 @@ describe('RemoteConfig', () => { it('uses local default when parameter is in template but default value is undefined', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, 'getServerTemplate') - .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate({ defaultConfig: { dog_no_remote_default_value: 'local default' } }) - .then((template: RemoteConfigServerTemplate) => { + .then((template: ServerTemplate) => { const config = template.evaluate!(); expect(config.dog_no_remote_default_value).to.equal(template.defaultConfig.dog_no_remote_default_value); }); @@ -940,14 +935,14 @@ describe('RemoteConfig', () => { it('uses local default when in-app default value specified', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, 'getServerTemplate') - .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate({ defaultConfig: { dog_use_inapp_default: '🐕' } }) - .then((template: RemoteConfigServerTemplate) => { + .then((template: ServerTemplate) => { const config = template.evaluate!(); expect(config.dog_use_inapp_default).to.equal(template.defaultConfig.dog_use_inapp_default); }); @@ -956,14 +951,14 @@ describe('RemoteConfig', () => { it('overrides local default when value exists', () => { const stub = sinon .stub(RemoteConfigApiClient.prototype, 'getServerTemplate') - .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as RemoteConfigServerTemplateData); + .resolves(SERVER_REMOTE_CONFIG_RESPONSE_2 as ServerTemplateData); stubs.push(stub); return remoteConfig.getServerTemplate({ defaultConfig: { dog_type_enabled: false } }) - .then((template: RemoteConfigServerTemplate) => { + .then((template: ServerTemplate) => { const config = template.evaluate!(); expect(config.dog_type_enabled).to.equal(template.defaultConfig.dog_type_enabled); });