@vouchfor/embeds 8.7.3 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vouchfor/embeds",
3
- "version": "8.7.3",
3
+ "version": "8.8.0",
4
4
  "license": "MIT",
5
5
  "author": "Aaron Williams",
6
6
  "main": "dist/es/embeds.js",
@@ -75,7 +75,7 @@ const Dialog: Story = {
75
75
  argTypes: {
76
76
  env: {
77
77
  control: 'radio',
78
- options: ['local', 'dev', 'staging', 'prod']
78
+ options: ['local', 'dev', 'usdev', 'staging', 'prod', 'usprod']
79
79
  },
80
80
  preload: {
81
81
  control: 'radio',
@@ -119,7 +119,7 @@ const MultiPlayer: Story = {
119
119
  argTypes: {
120
120
  env: {
121
121
  control: 'radio',
122
- options: ['local', 'dev', 'staging', 'prod']
122
+ options: ['local', 'dev', 'usdev', 'staging', 'prod', 'usprod']
123
123
  },
124
124
  preload: {
125
125
  control: 'radio',
@@ -79,7 +79,7 @@ const Player: Story = {
79
79
  argTypes: {
80
80
  env: {
81
81
  control: 'radio',
82
- options: ['local', 'dev', 'staging', 'prod']
82
+ options: ['local', 'dev', 'usdev', 'staging', 'prod', 'usprod']
83
83
  },
84
84
  preload: {
85
85
  control: 'radio',
package/src/utils/env.ts CHANGED
@@ -1,4 +1,4 @@
1
- type Environment = 'local' | 'dev' | 'staging' | 'prod';
1
+ type Environment = 'local' | 'dev' | 'usdev' | 'staging' | 'prod' | 'usprod';
2
2
 
3
3
  type GetEnvUrlsReturn = {
4
4
  videoUrl: string;
@@ -9,21 +9,27 @@ type GetEnvUrlsReturn = {
9
9
  const devVideoUrl = 'https://d2rxhdlm2q91uk.cloudfront.net';
10
10
  const stagingVideoUrl = 'https://d1ix11aj5kfygl.cloudfront.net';
11
11
  const prodVideoUrl = 'https://d157jlwnudd93d.cloudfront.net';
12
+ const usdevVideoUrl = 'https://d17hr4vx9tg3y1.cloudfront.net';
13
+ const usprodVideoUrl = 'https://d1mc31k0nyn3vx.cloudfront.net';
12
14
 
13
- const devPublicApiUrl = 'https://bshyfw4h5a.execute-api.ap-southeast-2.amazonaws.com/dev';
14
- const stagingPublicApiUrl = 'https://gyzw7rpbq3.execute-api.ap-southeast-2.amazonaws.com/staging';
15
- const prodPublicApiUrl = 'https://vfcjuim1l3.execute-api.ap-southeast-2.amazonaws.com/prod';
15
+ const devPublicApiUrl = 'https://public-dev.vouchfor.com';
16
+ const stagingPublicApiUrl = 'https://public-staging.vouchfor.com';
17
+ const prodPublicApiUrl = 'https://public.vouchfor.com';
18
+ const usdevPublicApiUrl = 'https://public-usdev.vouchfor.com';
19
+ const usprodPublicApiUrl = 'https://public-us.vouchfor.com';
16
20
 
17
21
  const localEmbedApiUrl = 'http://localhost:6060/v2';
18
22
  const devEmbedApiUrl = 'https://embed-dev.vouchfor.com/v2';
19
23
  const stagingEmbedApiUrl = 'https://embed-staging.vouchfor.com/v2';
20
24
  const prodEmbedApiUrl = 'https://embed.vouchfor.com/v2';
25
+ const usdevEmbedApiUrl = 'https://embed-usdev.vouchfor.com/v2';
26
+ const usprodEmbedApiUrl = 'https://embed-us.vouchfor.com/v2';
21
27
 
22
28
  // We are handling the case where env is an unknown string so the ts error is a lie
23
29
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
24
30
  // @ts-ignore
25
31
  function getEnvUrls(env: Environment): GetEnvUrlsReturn {
26
- if (!['local', 'dev', 'staging', 'prod'].includes(env)) {
32
+ if (!['local', 'dev', 'usdev', 'staging', 'prod', 'usprod'].includes(env)) {
27
33
  throw new Error(`Unknown environment: ${env}`);
28
34
  }
29
35
 
@@ -43,6 +49,14 @@ function getEnvUrls(env: Environment): GetEnvUrlsReturn {
43
49
  };
44
50
  }
45
51
 
52
+ if (env === 'usdev') {
53
+ return {
54
+ videoUrl: usdevVideoUrl,
55
+ publicApiUrl: usdevPublicApiUrl,
56
+ embedApiUrl: usdevEmbedApiUrl
57
+ };
58
+ }
59
+
46
60
  if (env === 'staging') {
47
61
  return {
48
62
  videoUrl: stagingVideoUrl,
@@ -58,6 +72,14 @@ function getEnvUrls(env: Environment): GetEnvUrlsReturn {
58
72
  embedApiUrl: prodEmbedApiUrl
59
73
  };
60
74
  }
75
+
76
+ if (env === 'usprod') {
77
+ return {
78
+ videoUrl: usprodVideoUrl,
79
+ publicApiUrl: usprodPublicApiUrl,
80
+ embedApiUrl: usprodEmbedApiUrl
81
+ };
82
+ }
61
83
  }
62
84
 
63
85
  export { devEmbedApiUrl, stagingEmbedApiUrl, prodEmbedApiUrl, getEnvUrls };