From dc793760fdd12948098a989c825a8a77846b455c Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:25:36 +0100 Subject: [PATCH 01/14] feat: add util to override adapter endpoints --- src/adapter/docker.adapter.ts | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/adapter/docker.adapter.ts diff --git a/src/adapter/docker.adapter.ts b/src/adapter/docker.adapter.ts new file mode 100644 index 00000000..180cae9b --- /dev/null +++ b/src/adapter/docker.adapter.ts @@ -0,0 +1,77 @@ +import { + searchEndpointAdapter, + PlatformAdapter, + nextQueriesEndpointAdapter, + identifierResultsEndpointAdapter, + popularSearchesEndpointAdapter, + recommendationsEndpointAdapter, + querySuggestionsEndpointAdapter, + relatedTagsEndpointAdapter, + semanticQueriesEndpointAdapter, + experienceControlsEndpointAdapter +} from '@empathyco/x-adapter-platform'; +import { XComponentsAdapter } from '@empathyco/x-types'; + +/** + * Mutates adapter to point to environment context. + * + * @param adapter - PlatformAdapter the adapter to mutate. + */ +export function overrideAdapter(adapter: PlatformAdapter): void { + adapter.search = searchEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('search', extraParams!) + }); + adapter.popularSearches = popularSearchesEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('popularSearches', extraParams!) + }); + adapter.recommendations = recommendationsEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('recommendations', extraParams!) + }); + adapter.nextQueries = nextQueriesEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('nextQueries', extraParams!) + }); + adapter.querySuggestions = querySuggestionsEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('querySuggestions', extraParams!) + }); + adapter.relatedTags = relatedTagsEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('relatedTags', extraParams!) + }); + adapter.identifierResults = identifierResultsEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('identifierResults', extraParams!) + }); + adapter.semanticQueries = semanticQueriesEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('semanticQueries', extraParams!) + }); + adapter.experienceControls = experienceControlsEndpointAdapter.extends({ + endpoint: ({ extraParams }) => resolveEmpathyEndpoint('experienceControls', extraParams!) + }); +} + +type DockerEndpoints = Exclude; + +/** + * Function that returns the url for each empathy's endpoints according to the environment context. + * + * @param endpoint - The endpoint to resolve the url. + * @param context - The environment context where to retrieve the information + * needed to resolve the endpoint. + * + * @returns The url for the given endpoint. + */ +function resolveEmpathyEndpoint(endpoint: DockerEndpoints, context: Record): string { + const { empathyAPIHost, instance } = context; + const endpointHost: string = empathyAPIHost ? empathyAPIHost : 'localhost:8080'; + const endpointInstance: string = instance ? instance : 'empathy'; + const empathyEndpoints: Record = { + search: `https:/${endpointHost}/search/v1/query/${endpointInstance}/search`, + popularSearches: `https:/${endpointHost}/search/v1/query/${endpointInstance}/empathize`, + recommendations: `https:/${endpointHost}/search/v1/query/${endpointInstance}/topclicked`, + nextQueries: `https:${endpointHost}/nextqueries/${endpointInstance}`, + querySuggestions: `https:/${endpointHost}/search/v1/query/${endpointInstance}/empathize`, + relatedTags: `https:/${endpointHost}/relatedtags/${endpointInstance}`, + identifierResults: `https:/${endpointHost}/search/v1/query/${endpointInstance}/skusearch`, + semanticQueries: `https:/${endpointHost}/semantics-api/search_single/${endpointInstance}`, + experienceControls: `https://${endpointHost}/config/v1/public/configs` + }; + return empathyEndpoints[endpoint]; +} From 9127f8a3456424ea9899420f50628349d50ac883 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:26:21 +0100 Subject: [PATCH 02/14] feat: override adapter if VUE_APP_DEVELOPMENT_DOCKER is set --- src/main.ts | 6 +-- src/x-components/plugin.options.ts | 81 +++++++++++++++++------------- 2 files changed, 49 insertions(+), 38 deletions(-) diff --git a/src/main.ts b/src/main.ts index 8feb1157..e48e2245 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,7 @@ -import { CssInjector } from "@empathyco/x-archetype-utils"; +import { CssInjector } from '@empathyco/x-archetype-utils'; import { XInstaller } from '@empathyco/x-components'; import Vue from 'vue'; -import { installXOptions } from './x-components/plugin.options'; +import { getInstallXOptions } from './x-components/plugin.options'; declare global { interface Window { @@ -13,4 +13,4 @@ Vue.config.productionTip = false; Vue.config.devtools = window.__enableVueDevtools__ ?? false; new CssInjector(true); -new XInstaller(installXOptions).init(); +getInstallXOptions().then(installXOptions => new XInstaller(installXOptions).init()); diff --git a/src/x-components/plugin.options.ts b/src/x-components/plugin.options.ts index d4b2522f..869db86c 100644 --- a/src/x-components/plugin.options.ts +++ b/src/x-components/plugin.options.ts @@ -9,45 +9,56 @@ import { mergeSemanticQueriesConfigWire } from './wiring/semantic-queries.wiring const device = useDevice(); -export const installXOptions: InstallXOptions = { - adapter, - store, - app: App, - domElement: getDomElement, - xModules: { - facets: { - config: { - filtersStrategyForRequest: 'leaves-only' - } - }, - semanticQueries: { - config: { - threshold: 50, - maxItemsToRequest: 10 +/** + * Function that returns the options to install x-components. + * + * Returns - the InstallXOptions. + */ +export async function getInstallXOptions(): Promise { + if (process.env.VUE_APP_DEVELOPMENT_DOCKER) { + const { overrideAdapter } = await import('../adapter/docker.adapter'); + overrideAdapter(adapter); + } + return { + adapter, + store, + app: App, + domElement: getDomElement, + xModules: { + facets: { + config: { + filtersStrategyForRequest: 'leaves-only' + } }, - wiring: { - SemanticQueriesConfigProvided: { - mergeSemanticQueriesConfigWire + semanticQueries: { + config: { + threshold: 50, + maxItemsToRequest: 10 + }, + wiring: { + SemanticQueriesConfigProvided: { + mergeSemanticQueriesConfigWire + } } } - } - }, - async installExtraPlugins({ vue, snippet }) { - const i18n = await I18n.create({ - locale: snippet.uiLang, - device: (snippet.device as string) ?? device.deviceName.value, - fallbackLocale: 'en', - messages - }); - vue.use(i18n); - vue.prototype.$setLocale = i18n.setLocale.bind(i18n); - vue.prototype.$setLocaleDevice = i18n.setDevice.bind(i18n); + }, + async installExtraPlugins({ vue, snippet }) { + const i18n = await I18n.create({ + locale: snippet.uiLang, + device: (snippet.device as string) ?? device.deviceName.value, + fallbackLocale: 'en', + messages + }); + vue.use(i18n); + vue.prototype.$setLocale = i18n.setLocale.bind(i18n); + vue.prototype.$setLocaleDevice = i18n.setDevice.bind(i18n); - return { - i18n: i18n.vueI18n - }; - } -}; + return { + i18n: i18n.vueI18n + }; + } + }; +} /** * Creates a DOM element to mount the X Components app. From b88c0e29d9eec2875dcff892726fa67e627e6287 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:26:46 +0100 Subject: [PATCH 03/14] build: prepare dist build for docker --- build/instrumentation.build.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/instrumentation.build.mjs b/build/instrumentation.build.mjs index b6a5bb21..ee3021b8 100644 --- a/build/instrumentation.build.mjs +++ b/build/instrumentation.build.mjs @@ -74,6 +74,9 @@ export function createConfig({ replace( mergeConfig('replace', { 'process.env.NODE_ENV': JSON.stringify('production'), + 'process.env.VUE_APP_DEVELOPMENT_DOCKER': process.env.VUE_APP_DEVELOPMENT_DOCKER + ? JSON.stringify(true) + : JSON.stringify(false), STRIP_SSR_INJECTOR: true, preventAssignment: true }) From 43d7b37734e2b7f1dac0daa3942795f14d87caa6 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:27:10 +0100 Subject: [PATCH 04/14] chore: allow format in `main.ts` --- .prettierignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.prettierignore b/.prettierignore index 67165d87..e69de29b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +0,0 @@ -main.ts \ No newline at end of file From 11efd5b31d1df100f5bfb1182f2e91793d7f2ae6 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:27:36 +0100 Subject: [PATCH 05/14] build: allow local development for docker environment --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 5ee24656..9d18a398 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,9 @@ "private": true, "scripts": { "serve": "vue-cli-service serve --skip-plugins eslint", + "serve:docker": "VUE_APP_DEVELOPMENT_DOCKER=true vue-cli-service serve --skip-plugins eslint", "build": "rollup -c", + "build:docker": "VUE_APP_DEVELOPMENT_DOCKER=true rollup -c", "build:serve": "concurrently \"rollup -c -w\" \"npm run serve:dist\"", "serve:dist": "http-server dist -a localhost --cors", "cy:open": "cypress open", From 8e9ffef0be9afb66fc81419fc865690989d5003f Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:28:19 +0100 Subject: [PATCH 06/14] build: add dockerfile --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..50f4a4bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM nginx:alpine3.18-slim + +RUN mkdir -p /opt/empathy +WORKDIR /opt/empathy +ADD dist dist + +COPY dist /usr/share/nginx/html \ No newline at end of file From 16af4f045941fb5668fb3c9c440385ee77e7a855 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Thu, 14 Mar 2024 17:42:11 +0100 Subject: [PATCH 07/14] ci: add gh workflow to deploy docker image --- .github/workflows/deploy-docker.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/deploy-docker.yml diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml new file mode 100644 index 00000000..54e74254 --- /dev/null +++ b/.github/workflows/deploy-docker.yml @@ -0,0 +1,23 @@ +name: Release docker image on demand +on: [workflow_dispatch] +jobs: + deploy-docker-image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '18' + - name: Installing dependencies + run: npm ci + shell: bash + - name: Build project + run: npm run build:docker + shell: bash + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + tags: empathyco/x-archetype:latest + push: true From bd23388218d34252f0c35bf180c043a59706352e Mon Sep 17 00:00:00 2001 From: kaskol10 Date: Mon, 18 Mar 2024 14:36:08 +0100 Subject: [PATCH 08/14] Set ghcr.io Docker image --- .github/workflows/deploy-docker.yml | 45 ++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index 54e74254..18ac77d3 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -1,10 +1,26 @@ -name: Release docker image on demand +name: Create and publish a Docker image + +# Configures this workflow to run every time a change is pushed to the branch called `release`. on: [workflow_dispatch] + +# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: - deploy-docker-image: + build-and-push-image: runs-on: ubuntu-latest + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + # steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 + # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - uses: actions/setup-node@v4 with: node-version: '18' @@ -14,10 +30,25 @@ jobs: - name: Build project run: npm run build:docker shell: bash - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. + # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. + # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 with: - tags: empathyco/x-archetype:latest + context: . push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 6a69bea5db39c504f6dc9a926a9e551a2da4550f Mon Sep 17 00:00:00 2001 From: kaskol10 Date: Mon, 18 Mar 2024 14:42:03 +0100 Subject: [PATCH 09/14] Fix typo dash --- src/adapter/docker.adapter.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/adapter/docker.adapter.ts b/src/adapter/docker.adapter.ts index 180cae9b..0135b424 100644 --- a/src/adapter/docker.adapter.ts +++ b/src/adapter/docker.adapter.ts @@ -63,14 +63,14 @@ function resolveEmpathyEndpoint(endpoint: DockerEndpoints, context: Record = { - search: `https:/${endpointHost}/search/v1/query/${endpointInstance}/search`, - popularSearches: `https:/${endpointHost}/search/v1/query/${endpointInstance}/empathize`, - recommendations: `https:/${endpointHost}/search/v1/query/${endpointInstance}/topclicked`, - nextQueries: `https:${endpointHost}/nextqueries/${endpointInstance}`, - querySuggestions: `https:/${endpointHost}/search/v1/query/${endpointInstance}/empathize`, - relatedTags: `https:/${endpointHost}/relatedtags/${endpointInstance}`, - identifierResults: `https:/${endpointHost}/search/v1/query/${endpointInstance}/skusearch`, - semanticQueries: `https:/${endpointHost}/semantics-api/search_single/${endpointInstance}`, + search: `https://${endpointHost}/search/v1/query/${endpointInstance}/search`, + popularSearches: `https://${endpointHost}/search/v1/query/${endpointInstance}/empathize`, + recommendations: `https://${endpointHost}/search/v1/query/${endpointInstance}/topclicked`, + nextQueries: `https://${endpointHost}/nextqueries/${endpointInstance}`, + querySuggestions: `https://${endpointHost}/search/v1/query/${endpointInstance}/empathize`, + relatedTags: `https://${endpointHost}/relatedtags/${endpointInstance}`, + identifierResults: `https://${endpointHost}/search/v1/query/${endpointInstance}/skusearch`, + semanticQueries: `https://${endpointHost}/semantics-api/search_single/${endpointInstance}`, experienceControls: `https://${endpointHost}/config/v1/public/configs` }; return empathyEndpoints[endpoint]; From 3185c2049ce4fe0f001f9fe78bda488a1530435e Mon Sep 17 00:00:00 2001 From: kaskol10 Date: Mon, 18 Mar 2024 14:45:08 +0100 Subject: [PATCH 10/14] Try branch push --- .github/workflows/deploy-docker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docker.yml b/.github/workflows/deploy-docker.yml index 18ac77d3..a28f46a6 100644 --- a/.github/workflows/deploy-docker.yml +++ b/.github/workflows/deploy-docker.yml @@ -1,7 +1,9 @@ name: Create and publish a Docker image # Configures this workflow to run every time a change is pushed to the branch called `release`. -on: [workflow_dispatch] +on: + push: + branches: ['feat/EMP-3684-create-docker-image'] # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: From 5b8e4a334e61e1b4f2d462fa8d9891c36a75c367 Mon Sep 17 00:00:00 2001 From: AnaGciaSchz Date: Tue, 26 Mar 2024 11:41:53 +0100 Subject: [PATCH 11/14] EMP-3684 changing urls for docker-adapter --- src/adapter/docker.adapter.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adapter/docker.adapter.ts b/src/adapter/docker.adapter.ts index 0135b424..a55ec061 100644 --- a/src/adapter/docker.adapter.ts +++ b/src/adapter/docker.adapter.ts @@ -61,15 +61,15 @@ type DockerEndpoints = Exclude; function resolveEmpathyEndpoint(endpoint: DockerEndpoints, context: Record): string { const { empathyAPIHost, instance } = context; const endpointHost: string = empathyAPIHost ? empathyAPIHost : 'localhost:8080'; - const endpointInstance: string = instance ? instance : 'empathy'; + const endpointInstance: string = instance ? instance : 'imdb'; const empathyEndpoints: Record = { - search: `https://${endpointHost}/search/v1/query/${endpointInstance}/search`, - popularSearches: `https://${endpointHost}/search/v1/query/${endpointInstance}/empathize`, - recommendations: `https://${endpointHost}/search/v1/query/${endpointInstance}/topclicked`, + search: `https://${endpointHost}/query/${endpointInstance}/search`, + popularSearches: `https://${endpointHost}/query/${endpointInstance}/empathize`, + recommendations: `https://${endpointHost}/query/${endpointInstance}/topclicked`, nextQueries: `https://${endpointHost}/nextqueries/${endpointInstance}`, - querySuggestions: `https://${endpointHost}/search/v1/query/${endpointInstance}/empathize`, + querySuggestions: `https://${endpointHost}/query/${endpointInstance}/empathize`, relatedTags: `https://${endpointHost}/relatedtags/${endpointInstance}`, - identifierResults: `https://${endpointHost}/search/v1/query/${endpointInstance}/skusearch`, + identifierResults: `https://${endpointHost}/query/${endpointInstance}/skusearch`, semanticQueries: `https://${endpointHost}/semantics-api/search_single/${endpointInstance}`, experienceControls: `https://${endpointHost}/config/v1/public/configs` }; From 04f338c55d4c5dfe025011ff2cd7bb09563f404e Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Wed, 27 Mar 2024 09:52:02 +0100 Subject: [PATCH 12/14] set lang to es for docker environment --- src/x-components/plugin.options.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/x-components/plugin.options.ts b/src/x-components/plugin.options.ts index 869db86c..c6e54f29 100644 --- a/src/x-components/plugin.options.ts +++ b/src/x-components/plugin.options.ts @@ -18,6 +18,9 @@ export async function getInstallXOptions(): Promise { if (process.env.VUE_APP_DEVELOPMENT_DOCKER) { const { overrideAdapter } = await import('../adapter/docker.adapter'); overrideAdapter(adapter); + if (typeof window.initX === 'object') { + window.initX.lang = 'es'; + } } return { adapter, From accfbec3535125e47ac71d05377e1f7e7d540f58 Mon Sep 17 00:00:00 2001 From: Diego Pascual Date: Wed, 27 Mar 2024 11:21:01 +0100 Subject: [PATCH 13/14] fix build --- src/x-components/plugin.options.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/x-components/plugin.options.ts b/src/x-components/plugin.options.ts index c6e54f29..5be6f9e7 100644 --- a/src/x-components/plugin.options.ts +++ b/src/x-components/plugin.options.ts @@ -18,9 +18,7 @@ export async function getInstallXOptions(): Promise { if (process.env.VUE_APP_DEVELOPMENT_DOCKER) { const { overrideAdapter } = await import('../adapter/docker.adapter'); overrideAdapter(adapter); - if (typeof window.initX === 'object') { - window.initX.lang = 'es'; - } + (window.initX as SnippetConfig).lang = 'es'; } return { adapter, From 40305f97cdb0404b4cce9dd4b372c3b37b34f799 Mon Sep 17 00:00:00 2001 From: AnaGciaSchz Date: Wed, 27 Mar 2024 15:02:15 +0100 Subject: [PATCH 14/14] EMP-3684 Using http to access search services --- src/adapter/docker.adapter.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/adapter/docker.adapter.ts b/src/adapter/docker.adapter.ts index a55ec061..37e66d07 100644 --- a/src/adapter/docker.adapter.ts +++ b/src/adapter/docker.adapter.ts @@ -63,15 +63,15 @@ function resolveEmpathyEndpoint(endpoint: DockerEndpoints, context: Record = { - search: `https://${endpointHost}/query/${endpointInstance}/search`, - popularSearches: `https://${endpointHost}/query/${endpointInstance}/empathize`, - recommendations: `https://${endpointHost}/query/${endpointInstance}/topclicked`, - nextQueries: `https://${endpointHost}/nextqueries/${endpointInstance}`, - querySuggestions: `https://${endpointHost}/query/${endpointInstance}/empathize`, - relatedTags: `https://${endpointHost}/relatedtags/${endpointInstance}`, - identifierResults: `https://${endpointHost}/query/${endpointInstance}/skusearch`, - semanticQueries: `https://${endpointHost}/semantics-api/search_single/${endpointInstance}`, - experienceControls: `https://${endpointHost}/config/v1/public/configs` + search: `http://${endpointHost}/query/${endpointInstance}/search`, + popularSearches: `http://${endpointHost}/query/${endpointInstance}/empathize`, + recommendations: `http://${endpointHost}/query/${endpointInstance}/topclicked`, + nextQueries: `http://${endpointHost}/nextqueries/${endpointInstance}`, + querySuggestions: `http://${endpointHost}/query/${endpointInstance}/empathize`, + relatedTags: `http://${endpointHost}/relatedtags/${endpointInstance}`, + identifierResults: `http://${endpointHost}/query/${endpointInstance}/skusearch`, + semanticQueries: `http://${endpointHost}/semantics-api/search_single/${endpointInstance}`, + experienceControls: `http://${endpointHost}/config/v1/public/configs` }; return empathyEndpoints[endpoint]; }