Skip to content

Commit

Permalink
update region to match analytics naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Jun 28, 2023
1 parent e894d49 commit 36cab68
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions docs/chat-core.region.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export declare enum Region

| Member | Value | Description |
| --- | --- | --- |
| EU | <code>&quot;eu&quot;</code> | |
| US | <code>&quot;us&quot;</code> | |
| EU | <code>&quot;EU&quot;</code> | |
| US | <code>&quot;US&quot;</code> | |

4 changes: 2 additions & 2 deletions etc/chat-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export type RawResponse = Response | Response_2;
// @public
export enum Region {
// (undocumented)
EU = "eu",
EU = "EU",
// (undocumented)
US = "us"
US = "US"
}

// @public
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/chat-core",
"version": "0.5.1",
"version": "0.5.2",
"description": "Typescript Networking Library for the Yext Chat API",
"main": "./dist/commonjs/index.js",
"module": "./dist/esm/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/models/endpoints/Region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* @public
*/
export enum Region {
US = "us",
EU = "eu",
US = "US",
EU = "EU",
}
2 changes: 1 addition & 1 deletion test-browser-esm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-node-cjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/ChatCore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ it("returns message response on successful API response", async () => {
botId: "my-bot",
apiKey: "my-api-key",
version: "STAGING",
env: "prod",
region: "us",
env: "PRODUCTION",
region: "US",
businessId: 1234567,
});
const res = await chatCore.getNextMessage(mockedMessageRequest);
Expand Down
4 changes: 2 additions & 2 deletions tests/infra/EndPointFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ it("provides proper endpoint for custom env", () => {
it("provides proper endpoint for custom region", () => {
const endpoints = EndpointsFactory.getEndpoints({
botId: "my-bot",
region: "eu",
region: "EU",
});
expect(endpoints).toEqual({
chat: `https://cdn.eu.yextapis.com/v2/accounts/me/chat/my-bot/message`,
Expand All @@ -47,7 +47,7 @@ it("throws error on invalid region + env", () => {
expect(() =>
EndpointsFactory.getEndpoints({
botId: "my-bot",
region: "eu",
region: "EU",
env: "SANDBOX",
})
).toThrow('Unsupported domain: invalid environment "SANDBOX" for region EU');
Expand Down

0 comments on commit 36cab68

Please sign in to comment.