diff --git a/packages/x-components/src/views/adapter.ts b/packages/x-components/src/views/adapter.ts index eddca538c9..d3c265acc3 100644 --- a/packages/x-components/src/views/adapter.ts +++ b/packages/x-components/src/views/adapter.ts @@ -1,4 +1,10 @@ -import { PlatformAdapter, platformAdapter } from '@empathyco/x-adapter-platform'; +import { + PlatformAdapter, + PlatformExperienceControlsResponse, + experienceControlsResponseSchema, + platformAdapter +} from '@empathyco/x-adapter-platform'; +import { ExperienceControlsResponse } from '@empathyco/x-types'; import { e2eAdapter } from '../adapter/e2e-adapter'; export const adapterConfig = { @@ -11,6 +17,18 @@ const experienceControlsAdapter = platformAdapter.experienceControls.extends({ platformAdapter.experienceControls = experienceControlsAdapter; +experienceControlsResponseSchema.$override< + PlatformExperienceControlsResponse, + Partial +>({ + events: response => ({ + SemanticQueryNewConfig: { + threshold: response['resultsPerCarousels'], + maxItemsToRequest: response['numberOfCarousels'] + } + }) +}); + export const adapter = new Proxy(platformAdapter, { get: (obj: PlatformAdapter, prop: keyof PlatformAdapter) => adapterConfig.e2e ? e2eAdapter[prop] : obj[prop]