From 48a29899466607ebef254b30d550e87c178077f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 Sep 2024 12:39:20 +0000 Subject: [PATCH 1/2] v1.17.5 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b919d079e..0c0f79ec8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@yext/answers-search-ui", - "version": "1.17.4", + "version": "1.17.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@yext/answers-search-ui", - "version": "1.17.4", + "version": "1.17.5", "license": "BSD-3-Clause", "dependencies": { "@mapbox/mapbox-gl-language": "^0.10.1", diff --git a/package.json b/package.json index 3a95eb07f..375440d98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@yext/answers-search-ui", - "version": "1.17.4", + "version": "1.17.5", "description": "Javascript Search Programming Interface", "main": "dist/answers-umd.js", "repository": { From 9460d9ec5a2af3b9441b2565dfe5ebed0eba81cc Mon Sep 17 00:00:00 2001 From: Fondryext <160865254+Fondryext@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:18:26 -0400 Subject: [PATCH 2/2] Answers SDK: add cloudChoice support (#1896) Now that cloudChoice is a param inside of search-core, this CR adds support for setting it in the SDK, in the init() function, including setting the old behavior as the default. It is not needed elsewhere like with the CLOUD_REGION setting, as that is used for things like analytics tracking. J=WAT-4375 TEST=auto Ran test suite --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- THIRD-PARTY-NOTICES | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- src/core/core.js | 9 ++++++++- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index 8e19a6315..b0e8d25a9 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -487,7 +487,7 @@ CDN The following NPM package may be included in this product: - - @yext/search-core@2.5.1 + - @yext/search-core@2.5.4 This package contains the following license and notice below: diff --git a/package-lock.json b/package-lock.json index 0c0f79ec8..fe23cdb8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@mapbox/mapbox-gl-language": "^0.10.1", "@yext/answers-storage": "^1.1.0", "@yext/rtf-converter": "^1.7.1", - "@yext/search-core": "^2.5.1", + "@yext/search-core": "^2.5.4", "bowser": "^2.11.0", "cross-fetch": "^3.1.5", "css-vars-ponyfill": "^2.4.3", @@ -3611,9 +3611,9 @@ } }, "node_modules/@yext/search-core": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.5.1.tgz", - "integrity": "sha512-Xdq5k1xuf1iueADcsoAGdtX5PV4NcZlMj03RYuDP9Jylm7rSSw+KDIUIh/lC7sFpzp3jKDW5jgH3NHz2dB3fZA==", + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.5.4.tgz", + "integrity": "sha512-KvBeBlBMq9rVrC83gvXw1JOpoILxiXdL1jndILvQbKsvVB8jK0qIa92khU3jUnRYkB9bRX9Iylzy8DIALjlCFw==", "dependencies": { "@babel/runtime-corejs3": "^7.12.5", "cross-fetch": "^3.1.5" @@ -25779,9 +25779,9 @@ } }, "@yext/search-core": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.5.1.tgz", - "integrity": "sha512-Xdq5k1xuf1iueADcsoAGdtX5PV4NcZlMj03RYuDP9Jylm7rSSw+KDIUIh/lC7sFpzp3jKDW5jgH3NHz2dB3fZA==", + "version": "2.5.4", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-2.5.4.tgz", + "integrity": "sha512-KvBeBlBMq9rVrC83gvXw1JOpoILxiXdL1jndILvQbKsvVB8jK0qIa92khU3jUnRYkB9bRX9Iylzy8DIALjlCFw==", "requires": { "@babel/runtime-corejs3": "^7.12.5", "cross-fetch": "^3.1.5" diff --git a/package.json b/package.json index 375440d98..73e3eb898 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "@mapbox/mapbox-gl-language": "^0.10.1", "@yext/answers-storage": "^1.1.0", "@yext/rtf-converter": "^1.7.1", - "@yext/search-core": "^2.5.1", + "@yext/search-core": "^2.5.4", "bowser": "^2.11.0", "cross-fetch": "^3.1.5", "css-vars-ponyfill": "^2.4.3", diff --git a/src/core/core.js b/src/core/core.js index 7d3fb16de..05265b001 100644 --- a/src/core/core.js +++ b/src/core/core.js @@ -1,7 +1,7 @@ /** @module Core */ import { provideCore } from '@yext/search-core/lib/commonjs'; // Using the ESM build for importing the Environment enum due to an issue importing the commonjs version -import { Environment } from '@yext/search-core'; +import { CloudChoice, Environment } from '@yext/search-core'; import { generateUUID } from './utils/uuid'; import SearchDataTransformer from './search/searchdatatransformer'; @@ -120,6 +120,12 @@ export default class Core { */ this._cloudRegion = CLOUD_REGION; + /** + * Determines the cloud choice of the api endpoints used when making search requests. + * @type {string} + */ + this._cloudChoice = config.cloudChoice || CloudChoice.GLOBAL_MULTI; + /** @type {string} */ this._verticalKey = config.verticalKey; @@ -154,6 +160,7 @@ export default class Core { jsLibVersion: LIB_VERSION }, cloudRegion: this._cloudRegion, + cloudChoice: this._cloudChoice, environment, ...config };