@ada-support/embed2 1.6.18 → 1.6.19

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.
@@ -1,5 +1,5 @@
1
1
  import type { StartOptions } from "@ada-support/embed-types";
2
2
  import type { TrackEventParams } from "common/types";
3
3
  import type { BusinessEvent } from "./types";
4
- export declare function trackEventImpl(adaSettings: StartOptions, chatterToken: string, params: TrackEventParams): void;
4
+ export declare function trackEventImpl(adaSettings: StartOptions, chatterToken: string | undefined, params: TrackEventParams): void;
5
5
  export declare const getEventsToTrigger: (businessEvents: BusinessEvent[]) => BusinessEvent[];
@@ -3,7 +3,7 @@ import type { MessageService } from "client/lib/message-service";
3
3
  import type { MarketingCampaign } from "./types";
4
4
  interface TriggerCampaignImplParams {
5
5
  adaSettings: StartOptions;
6
- chatterToken: string;
6
+ chatterToken?: string;
7
7
  campaign: MarketingCampaign;
8
8
  ignoreStatus: boolean;
9
9
  ignoreFrequency: boolean;
@@ -39,7 +39,7 @@ export declare type EmbedRequestEvent = keyof EmbedRequestPayloadByEvent;
39
39
  export interface EmbedResponsePayloadByEvent {
40
40
  ALL_FRAMES_LOADED: unknown;
41
41
  BROWSER_HAS_NOTIFICATIONS_RESPONSE: unknown;
42
- CREATE_PROACTIVE_RESPONSE: string;
42
+ CREATE_PROACTIVE_RESPONSE: string | null;
43
43
  DELETE_HISTORY: unknown;
44
44
  DELETE_HISTORY_RESPONSE: unknown;
45
45
  DISPATCH_RESPONSE: StoreState;
@@ -3,8 +3,8 @@ import type { ConnectionState } from "common/constants/events";
3
3
  import type { Client } from "common/models/client";
4
4
  import type { AdaCluster } from "common/types";
5
5
  export interface StoreState extends StartOptionsNoFunction {
6
- chatterCreated?: string | null;
7
- chatterToken?: string | null;
6
+ chatterCreated: string | undefined;
7
+ chatterToken: string | undefined;
8
8
  sessionToken?: string | null;
9
9
  client?: Client;
10
10
  enabledLanguages: string[];
@@ -15917,7 +15917,7 @@ const client = new error_tracker_BrowserClient({
15917
15917
  },
15918
15918
 
15919
15919
  environment: "production",
15920
- release: "1.6.18-f330d4f",
15920
+ release: "1.6.19-5459dcd",
15921
15921
  sampleRate: 0.25,
15922
15922
  autoSessionTracking: false,
15923
15923
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16366,7 +16366,7 @@ class CustomEventChannel extends Channel {
16366
16366
 
16367
16367
  constructObjectToSend(type, payload, id, status) {
16368
16368
  return {
16369
- type: type || "",
16369
+ type,
16370
16370
  payload,
16371
16371
  id,
16372
16372
  status
@@ -16547,7 +16547,7 @@ function getEmbedURL(_ref) {
16547
16547
  host = "http://".concat(window.location.hostname, ":9001");
16548
16548
  }
16549
16549
 
16550
- return "".concat(host, "/embed/").concat(frameName, "/").concat("f330d4f", "/index.html");
16550
+ return "".concat(host, "/embed/").concat(frameName, "/").concat("5459dcd", "/index.html");
16551
16551
  }
16552
16552
 
16553
16553
  function constructQueryString(query) {
@@ -16928,14 +16928,9 @@ class Store {
16928
16928
  }
16929
16929
 
16930
16930
  commitStateChanges(channelToUpdate, newState, id) {
16931
- if (!newState) {
16932
- return;
16933
- }
16934
16931
  /**
16935
16932
  * To help debug state issues. We do not want this in production.
16936
16933
  */
16937
-
16938
-
16939
16934
  if (false) {}
16940
16935
 
16941
16936
  const channels = this.messageService.getAllChannels();
@@ -17586,8 +17581,7 @@ function triggerCampaignImpl(_ref) {
17586
17581
  handle,
17587
17582
  cluster: cluster,
17588
17583
  domain
17589
- }); // eslint-disable-next-line @typescript-eslint/ban-types
17590
-
17584
+ });
17591
17585
  httpRequest({
17592
17586
  url,
17593
17587
  method: "POST",
@@ -18205,9 +18199,9 @@ async function log(message, extra, options) {
18205
18199
  service: "embed",
18206
18200
  env: "production",
18207
18201
  embedVersion: 2,
18208
- version: "1.6.18",
18202
+ version: "1.6.19",
18209
18203
  isNpm: true,
18210
- commitHash: "f330d4f"
18204
+ commitHash: "5459dcd"
18211
18205
  }))
18212
18206
  });
18213
18207
  }
@@ -18777,7 +18771,7 @@ class ChatFrame extends d {
18777
18771
  const hostPageUrlParams = new (url_default())(window.location.href).searchParams;
18778
18772
  const smsToken = hostPageUrlParams.get("adaSMSToken");
18779
18773
  const queryParams = {
18780
- embedVersion: "f330d4f".slice(0, 7),
18774
+ embedVersion: "5459dcd".slice(0, 7),
18781
18775
  greeting,
18782
18776
  language,
18783
18777
  skipGreeting,
@@ -20259,8 +20253,8 @@ class Container extends d {
20259
20253
  dist/* adaSessionStorage.removeItem */.Dp.removeItem(CHATTER_CREATED_STORAGE_KEY); // And from state
20260
20254
 
20261
20255
  newState = Container_objectSpread(Container_objectSpread({}, newState), {}, {
20262
- chatterToken: null,
20263
- chatterCreated: null
20256
+ chatterToken: undefined,
20257
+ chatterCreated: undefined
20264
20258
  });
20265
20259
  }
20266
20260
 
@@ -20297,8 +20291,8 @@ class Container extends d {
20297
20291
  dist/* adaSessionStorage.removeItem */.Dp.removeItem(CHATTER_CREATED_STORAGE_KEY); // And from state
20298
20292
 
20299
20293
  await setState({
20300
- chatterToken: null,
20301
- chatterCreated: null
20294
+ chatterToken: undefined,
20295
+ chatterCreated: undefined
20302
20296
  });
20303
20297
  xStorageChannel.postMessage(DELETE_HISTORY_EVENT, undefined);
20304
20298
  localChannel.postMessage(DELETE_HISTORY_RESPONSE, null, id);
@@ -20993,7 +20987,7 @@ class Embed {
20993
20987
 
20994
20988
  }
20995
20989
 
20996
- _defineProperty(Embed, "embed2Version", "f330d4f");
20990
+ _defineProperty(Embed, "embed2Version", "5459dcd");
20997
20991
  ;// CONCATENATED MODULE: ./src/common/helpers/startup.ts
20998
20992
 
20999
20993
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.6.18",
3
+ "version": "1.6.19",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -11,7 +11,7 @@
11
11
  "build": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production npx webpack --config webpack.prod.ts",
12
12
  "build:npm-types": "tsc --project tsconfig.npm.json --declaration --outDir dist/npm-entry --emitDeclarationOnly --allowJs false --checkJs false",
13
13
  "build:npm": "./npm-build.sh",
14
- "lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 17",
14
+ "lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 14",
15
15
  "lint:fix": "yarn lint --fix",
16
16
  "test": "jest --detectOpenHandles",
17
17
  "check-types": "./node_modules/typescript/bin/tsc --project ./tsconfig.json --noEmit --strict false",