@ada-support/embed2 1.12.4 → 1.13.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.
@@ -4,15 +4,4 @@ export interface Hosts {
4
4
  export interface Ports {
5
5
  [key: string]: number;
6
6
  }
7
- export declare const ports: {
8
- readonly localhost: {
9
- readonly api: 8000;
10
- readonly chat: 8002;
11
- readonly default: 9001;
12
- };
13
- readonly e2ereference: {
14
- readonly api: 8000;
15
- readonly chat: 8002;
16
- readonly default: 9001;
17
- };
18
- };
7
+ export declare const ports: Hosts;
@@ -15919,7 +15919,7 @@ const client = new BrowserClient({
15919
15919
  return event;
15920
15920
  },
15921
15921
  environment: "production",
15922
- release: "1.12.4-1c18649",
15922
+ release: "1.13.0-a6606d6",
15923
15923
  sampleRate: 0.25,
15924
15924
  autoSessionTracking: false,
15925
15925
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16460,16 +16460,23 @@ function httpRequest(obj) {
16460
16460
  ;// CONCATENATED MODULE: ./src/common/helpers/config-info.ts
16461
16461
  const isProduction = "production" === "production";
16462
16462
  ;// CONCATENATED MODULE: ./src/common/helpers/url/constants.ts
16463
+ // These ports are only used in development (localhost URL construction).
16464
+ // Production code paths check `isProduction` first and never read these values.
16465
+ //
16466
+ // The values come from DefinePlugin globals (DEV_API_PORT, DEV_CHAT_PORT,
16467
+ // DEV_FRAMES_PORT) which default to 8000, 8002, 9001 respectively when the
16468
+ // env vars are not set. So running `yarn start` without any env vars produces
16469
+ // the same ports as before — this is not a behavior change for normal dev.
16463
16470
  const ports = {
16464
16471
  localhost: {
16465
- api: 8000,
16466
- chat: 8002,
16467
- default: 9001
16472
+ api: Number(DEV_API_PORT),
16473
+ chat: Number(DEV_CHAT_PORT),
16474
+ default: Number(DEV_FRAMES_PORT)
16468
16475
  },
16469
16476
  e2ereference: {
16470
- api: 8000,
16471
- chat: 8002,
16472
- default: 9001
16477
+ api: Number(DEV_API_PORT),
16478
+ chat: Number(DEV_CHAT_PORT),
16479
+ default: Number(DEV_FRAMES_PORT)
16473
16480
  }
16474
16481
  };
16475
16482
  ;// CONCATENATED MODULE: ./src/common/helpers/url/index.ts
@@ -16500,9 +16507,9 @@ function getEmbedURL(_ref) {
16500
16507
  if (isProduction) {
16501
16508
  host = `https://${handle}${clusterString}.${domainString}.support`;
16502
16509
  } else {
16503
- host = `http://${handle}.localhost:9001`;
16510
+ host = `http://${handle}.localhost:${ports.localhost.default}`;
16504
16511
  }
16505
- return `${host}/embed/${frameName}/${"1c18649"}/index.html`;
16512
+ return `${host}/embed/${frameName}/${"a6606d6"}/index.html`;
16506
16513
  }
16507
16514
  function constructQueryString(query) {
16508
16515
  return Object.keys(query).map(key => {
@@ -16566,7 +16573,7 @@ function getChatURL(_ref3) {
16566
16573
  if (domainName === "localhost") {
16567
16574
  // Chat should be on a different domain (even though the port is different).
16568
16575
  // We need this to test Embed+Chat behaviour when third-party cookies are disabled (incognito mode).
16569
- return `${window.location.protocol}//${handle}.chat:8002/${questionSym}${queryString}`;
16576
+ return `${window.location.protocol}//${handle}.chat:${ports.localhost.chat}/${questionSym}${queryString}`;
16570
16577
  }
16571
16578
  const host = `${window.location.hostname}:${ports[domainName].chat}`;
16572
16579
  return `http://${host}/${questionSym}${queryString}`;
@@ -17690,9 +17697,9 @@ async function log(message, extra, options) {
17690
17697
  service: "embed",
17691
17698
  env: "production",
17692
17699
  embedVersion: 2,
17693
- version: "1.12.4",
17700
+ version: "1.13.0",
17694
17701
  isNpm: true,
17695
- commitHash: "1c18649"
17702
+ commitHash: "a6606d6"
17696
17703
  }))
17697
17704
  });
17698
17705
  }
@@ -19428,7 +19435,7 @@ class ChatFrame extends preact_module_d {
19428
19435
  log("Chat frame mount", {
19429
19436
  handle,
19430
19437
  chatUrl: this.url,
19431
- embedVersion: "1c18649".slice(0, 7),
19438
+ embedVersion: "a6606d6".slice(0, 7),
19432
19439
  embedSettings: adaSettings
19433
19440
  });
19434
19441
 
@@ -19516,7 +19523,7 @@ class ChatFrame extends preact_module_d {
19516
19523
  const hostPageUrlParams = new URL(window.location.href).searchParams;
19517
19524
  const smsToken = hostPageUrlParams.get("adaSMSToken");
19518
19525
  const queryParams = {
19519
- embedVersion: "1c18649".slice(0, 7),
19526
+ embedVersion: "a6606d6".slice(0, 7),
19520
19527
  greeting,
19521
19528
  language,
19522
19529
  skipGreeting,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.12.4",
3
+ "version": "1.13.0",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",