@ada-support/embed2 1.14.16 → 1.14.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.
@@ -22,6 +22,7 @@ export interface EmbedRequestPayloadByEvent {
22
22
  proactiveConfig?: {
23
23
  key: string;
24
24
  params: Record<string, string>;
25
+ playbook_id?: string | null;
25
26
  };
26
27
  };
27
28
  DELETE_HISTORY: undefined;
@@ -16125,7 +16125,7 @@ const client = new BrowserClient({
16125
16125
  return event;
16126
16126
  },
16127
16127
  environment: "production",
16128
- release: "1.14.16-3d56f98",
16128
+ release: "1.14.19-b77b8fe",
16129
16129
  sampleRate: 0.25,
16130
16130
  autoSessionTracking: false,
16131
16131
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16751,7 +16751,7 @@ function getEmbedURL(_ref) {
16751
16751
  } else {
16752
16752
  host = `http://${handle}.localhost:${ports.localhost.default}`;
16753
16753
  }
16754
- return `${host}/embed/${frameName}/${"3d56f98"}/index.html`;
16754
+ return `${host}/embed/${frameName}/${"b77b8fe"}/index.html`;
16755
16755
  }
16756
16756
  function constructQueryString(query) {
16757
16757
  return Object.keys(query).map(key => {
@@ -17591,9 +17591,9 @@ async function log(message, extra, options) {
17591
17591
  service: "embed",
17592
17592
  env: "production",
17593
17593
  embedVersion: 2,
17594
- version: "1.14.16",
17594
+ version: "1.14.19",
17595
17595
  isNpm: true,
17596
- commitHash: "3d56f98"
17596
+ commitHash: "b77b8fe"
17597
17597
  }))
17598
17598
  });
17599
17599
  }
@@ -18951,7 +18951,8 @@ function proactiveTriggerImpl(_ref3) {
18951
18951
  cta,
18952
18952
  proactiveConfig: {
18953
18953
  key: messageKey,
18954
- params
18954
+ params,
18955
+ playbook_id: proactiveConversation.playbook_id
18955
18956
  }
18956
18957
  });
18957
18958
  log("Proactive message displayed", {
@@ -20385,7 +20386,7 @@ class ChatFrame extends d {
20385
20386
  log("Chat frame mount", {
20386
20387
  handle,
20387
20388
  chatUrl: this.url,
20388
- embedVersion: "3d56f98".slice(0, 7),
20389
+ embedVersion: "b77b8fe".slice(0, 7),
20389
20390
  embedSettings: adaSettings
20390
20391
  });
20391
20392
 
@@ -20473,7 +20474,7 @@ class ChatFrame extends d {
20473
20474
  const hostPageUrlParams = new URL(window.location.href).searchParams;
20474
20475
  const smsToken = hostPageUrlParams.get("adaSMSToken");
20475
20476
  const queryParams = {
20476
- embedVersion: "3d56f98".slice(0, 7),
20477
+ embedVersion: "b77b8fe".slice(0, 7),
20477
20478
  greeting,
20478
20479
  language,
20479
20480
  skipGreeting,
@@ -22408,7 +22409,11 @@ class Container extends d {
22408
22409
  return;
22409
22410
  }
22410
22411
  const alternativeBot = primaryBotClient.alternative_bot;
22411
- const assignedClient = await fetchClientUsingAlternativeBotRollout(primaryBotClient, alternativeBot, adaSettings);
22412
+
22413
+ // A test-mode session must always exercise the bot it names, so it opts out of
22414
+ // launch-controls reassignment: otherwise a 0%-rollout bot pointing at an alternative_bot
22415
+ // sends the tester to that other bot (or to its domain-not-approved page).
22416
+ const assignedClient = adaSettings.testMode ? primaryBotClient : await fetchClientUsingAlternativeBotRollout(primaryBotClient, alternativeBot, adaSettings);
22412
22417
  if (!assignedClient) {
22413
22418
  this.unmount();
22414
22419
  return;
@@ -22547,8 +22552,12 @@ class Container extends d {
22547
22552
  const {
22548
22553
  campaignToTrigger,
22549
22554
  followUpResponseId,
22550
- chatVersion
22555
+ chatVersion,
22556
+ recentProactiveConversationConfig
22551
22557
  } = this.state;
22558
+ const {
22559
+ proactiveEngaged
22560
+ } = this.props;
22552
22561
  if (!this.shouldRenderChatFrame) {
22553
22562
  return null;
22554
22563
  }
@@ -22559,7 +22568,7 @@ class Container extends d {
22559
22568
  store: store,
22560
22569
  messageService: messageService,
22561
22570
  resetChat: this.resetChatBound,
22562
- skipGreeting: Boolean(campaignToTrigger || followUpResponseId)
22571
+ skipGreeting: Boolean(campaignToTrigger || followUpResponseId || proactiveEngaged && (recentProactiveConversationConfig === null || recentProactiveConversationConfig === void 0 ? void 0 : recentProactiveConversationConfig.playbook_id))
22563
22572
  });
22564
22573
  }
22565
22574
  renderIntroFrame() {
@@ -26,6 +26,7 @@ export interface ProactiveConversation {
26
26
  is_template: boolean;
27
27
  params?: Record<string, string>;
28
28
  key?: string;
29
+ playbook_id?: string | null;
29
30
  images?: {
30
31
  [language: string]: ProactiveConversationImage[];
31
32
  };
@@ -38,6 +39,7 @@ export interface ProactiveConversations {
38
39
  export interface RecentProactiveConversationConfig {
39
40
  key: string;
40
41
  params: Record<string, string>;
42
+ playbook_id?: string | null;
41
43
  }
42
44
  export type ProactiveConversationFrequency = "always" | "session" | "user";
43
45
  export type ProactiveConversationUrlTriggerConditionType = "equals" | "ends-with" | "regex" | "contains";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.14.16",
3
+ "version": "1.14.19",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",