@ada-support/embed2 1.6.34 → 1.6.37

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 | undefined, params: TrackEventParams): void;
4
+ export declare function trackEventImpl(adaSettings: StartOptions, chatterToken: string | undefined, sessionToken: string | undefined, params: TrackEventParams): void;
5
5
  export declare const getEventsToTrigger: (businessEvents: BusinessEvent[]) => BusinessEvent[];
@@ -5,7 +5,7 @@ import type { AdaCluster } from "common/types";
5
5
  export interface StoreState extends StartOptionsNoFunction {
6
6
  chatterCreated: string | undefined;
7
7
  chatterToken: string | undefined;
8
- sessionToken?: string | null;
8
+ sessionToken: string | undefined;
9
9
  client?: Client;
10
10
  enabledLanguages: string[];
11
11
  isDrawerOpen: boolean;
@@ -13260,7 +13260,7 @@ const client = new error_tracker_BrowserClient({
13260
13260
  return event;
13261
13261
  },
13262
13262
  environment: "production",
13263
- release: "1.6.34-59e32c8",
13263
+ release: "1.6.37-7120077",
13264
13264
  sampleRate: 0.25,
13265
13265
  autoSessionTracking: false,
13266
13266
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -13832,7 +13832,7 @@ function getEmbedURL(_ref) {
13832
13832
  } else {
13833
13833
  host = `http://${window.location.hostname}:9001`;
13834
13834
  }
13835
- return `${host}/embed/${frameName}/${"59e32c8"}/index.html`;
13835
+ return `${host}/embed/${frameName}/${"7120077"}/index.html`;
13836
13836
  }
13837
13837
  function constructQueryString(query) {
13838
13838
  return Object.keys(query).map(key => {
@@ -13962,6 +13962,10 @@ const actions = {
13962
13962
  httpRequest({
13963
13963
  url: `${url}business_events/track`,
13964
13964
  method: "POST",
13965
+ headers: {
13966
+ "Session-Auth": currentState.sessionToken || "",
13967
+ "Chatter-Token": currentState.chatterToken || ""
13968
+ },
13965
13969
  body: JSON.stringify({
13966
13970
  event_key: `ada:message_opened:${currentState.latestCampaignKey}`,
13967
13971
  value: 0,
@@ -14424,7 +14428,7 @@ function businessEvent_objectSpread(target) { for (var i = 1; i < arguments.leng
14424
14428
 
14425
14429
 
14426
14430
 
14427
- function trackEventImpl(adaSettings, chatterToken, params) {
14431
+ function trackEventImpl(adaSettings, chatterToken, sessionToken, params) {
14428
14432
  const {
14429
14433
  handle,
14430
14434
  cluster,
@@ -14436,7 +14440,7 @@ function trackEventImpl(adaSettings, chatterToken, params) {
14436
14440
  cluster: cluster,
14437
14441
  domain
14438
14442
  });
14439
- if (!chatterToken) {
14443
+ if (!chatterToken || !sessionToken) {
14440
14444
  return;
14441
14445
  }
14442
14446
  const {
@@ -14449,6 +14453,10 @@ function trackEventImpl(adaSettings, chatterToken, params) {
14449
14453
  httpRequest({
14450
14454
  url: `${baseApiUrl}business_events/track`,
14451
14455
  method: "POST",
14456
+ headers: {
14457
+ "Session-Auth": sessionToken,
14458
+ "Chatter-Token": chatterToken
14459
+ },
14452
14460
  body: JSON.stringify({
14453
14461
  event_key: eventKey,
14454
14462
  value,
@@ -15296,9 +15304,9 @@ async function log(message, extra, options) {
15296
15304
  service: "embed",
15297
15305
  env: "production",
15298
15306
  embedVersion: 2,
15299
- version: "1.6.34",
15307
+ version: "1.6.37",
15300
15308
  isNpm: true,
15301
- commitHash: "59e32c8"
15309
+ commitHash: "7120077"
15302
15310
  }))
15303
15311
  });
15304
15312
  }
@@ -15827,7 +15835,7 @@ class ChatFrame extends d {
15827
15835
  const hostPageUrlParams = new URL(window.location.href).searchParams;
15828
15836
  const smsToken = hostPageUrlParams.get("adaSMSToken");
15829
15837
  const queryParams = {
15830
- embedVersion: "59e32c8".slice(0, 7),
15838
+ embedVersion: "7120077".slice(0, 7),
15831
15839
  greeting,
15832
15840
  language,
15833
15841
  skipGreeting,
@@ -16982,9 +16990,10 @@ class Container extends d {
16982
16990
  trackEvent(trackEventParams) {
16983
16991
  const {
16984
16992
  adaSettings,
16985
- chatterToken
16993
+ chatterToken,
16994
+ sessionToken
16986
16995
  } = this.props;
16987
- trackEventImpl(adaSettings, chatterToken, trackEventParams);
16996
+ trackEventImpl(adaSettings, chatterToken, sessionToken, trackEventParams);
16988
16997
  }
16989
16998
  evaluateBusinessEventConditions() {
16990
16999
  const {
@@ -17663,6 +17672,7 @@ function Container_mapStateToProps(storeState) {
17663
17672
  isChatWebsocketConnected,
17664
17673
  isDrawerOpen,
17665
17674
  chatterToken,
17675
+ sessionToken,
17666
17676
  appConnectionState,
17667
17677
  drawerHasBeenOpened,
17668
17678
  chatterInLiveChat,
@@ -17679,6 +17689,7 @@ function Container_mapStateToProps(storeState) {
17679
17689
  isChatWebsocketConnected,
17680
17690
  isDrawerOpen,
17681
17691
  chatterToken,
17692
+ sessionToken,
17682
17693
  appConnectionState,
17683
17694
  drawerHasBeenOpened,
17684
17695
  chatterInLiveChat,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.6.34",
3
+ "version": "1.6.37",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",