-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Changes:** - Adds new cloudChoice config property #277
- Loading branch information
Showing
12 changed files
with
128 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [CloudChoice](./search-core.cloudchoice.md) | ||
|
||
## CloudChoice enum | ||
|
||
Defines the cloud choice of the API domains. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare enum CloudChoice | ||
``` | ||
|
||
## Enumeration Members | ||
|
||
| Member | Value | Description | | ||
| --- | --- | --- | | ||
| GLOBAL\_GCP | <code>"GLOBAL-GCP"</code> | | | ||
| GLOBAL\_MULTI | <code>"GLOBAL-MULTI"</code> | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/search-core](./search-core.md) > [ServingConfig](./search-core.servingconfig.md) > [cloudChoice](./search-core.servingconfig.cloudchoice.md) | ||
|
||
## ServingConfig.cloudChoice property | ||
|
||
Defines the cloud choice of the API domains. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
cloudChoice?: CloudChoice; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* Defines the cloud choice of the API domains. | ||
* | ||
* @public | ||
*/ | ||
export enum CloudChoice { | ||
GLOBAL_MULTI = 'GLOBAL-MULTI', //All available cloud regions | ||
GLOBAL_GCP = 'GLOBAL-GCP', //Only available GCP-backed cloud regions | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { EndpointsFactory } from '../src/provideEndpoints'; | ||
import { CloudChoice, CloudRegion, Environment } from '../src'; | ||
|
||
it('Sandbox, US, Multi produces expected endpoint', () => { | ||
const endPoints = new EndpointsFactory({ | ||
environment: Environment.SANDBOX, | ||
cloudRegion: CloudRegion.US, | ||
cloudChoice: CloudChoice.GLOBAL_MULTI | ||
}).getEndpoints(); | ||
expect(endPoints).toHaveProperty('universalSearch', 'https://sbx-cdn.us.yextapis.com/v2/accounts/me/search/query'); | ||
}); | ||
|
||
it('Prod, US, Multi produces expected endpoint', () => { | ||
const endPoints = new EndpointsFactory({ | ||
environment: Environment.PROD, | ||
cloudRegion: CloudRegion.US, | ||
cloudChoice: CloudChoice.GLOBAL_MULTI | ||
}).getEndpoints(); | ||
expect(endPoints).toHaveProperty('verticalSearch', 'https://prod-cdn.us.yextapis.com/v2/accounts/me/search/vertical/query'); | ||
}); | ||
|
||
it('Prod, US, GCP produces expected endpoint', () => { | ||
const endPoints = new EndpointsFactory({ | ||
environment: Environment.PROD, | ||
cloudRegion: CloudRegion.US, | ||
cloudChoice: CloudChoice.GLOBAL_GCP | ||
}).getEndpoints(); | ||
expect(endPoints).toHaveProperty('universalAutocomplete', 'https://prod-cdn-gcp.us.yextapis.com/v2/accounts/me/search/autocomplete'); | ||
}); | ||
|
||
it('Prod, EU, Multi produces expected endpoint', () => { | ||
const endPoints = new EndpointsFactory({ | ||
environment: Environment.PROD, | ||
cloudRegion: CloudRegion.EU, | ||
cloudChoice: CloudChoice.GLOBAL_MULTI | ||
}).getEndpoints(); | ||
expect(endPoints).toHaveProperty('verticalAutocomplete', 'https://prod-cdn.eu.yextapis.com/v2/accounts/me/search/vertical/autocomplete'); | ||
}); | ||
|
||
it('Prod, EU, GCP produces expected endpoint', () => { | ||
const endPoints = new EndpointsFactory({ | ||
environment: Environment.PROD, | ||
cloudRegion: CloudRegion.EU, | ||
cloudChoice: CloudChoice.GLOBAL_GCP | ||
}).getEndpoints(); | ||
expect(endPoints).toHaveProperty('filterSearch', 'https://prod-cdn-gcp.eu.yextapis.com/v2/accounts/me/search/filtersearch'); | ||
}); |