@moveo-ai/web-client 0.114.0 → 0.115.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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @moveo-ai/web-client v0.114.0
3
+ * @moveo-ai/web-client v0.115.0
4
4
  * Copyright (c) Moveo.ai (TM)
5
5
  *
6
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moveo-ai/web-client",
3
- "version": "0.114.0",
3
+ "version": "0.115.0",
4
4
  "description": "Client side library to load the moveo chat widget and connect it with your agent",
5
5
  "main": "dist/web-client.min.js",
6
6
  "types": "web-client.d.ts",
@@ -13,7 +13,7 @@
13
13
  "lint": "npm run lint:js && npm run lint:css",
14
14
  "lint:js": "eslint .",
15
15
  "lint:css": "npx stylelint \"{src,test}/**/*.css\"",
16
- "prepare": "npm run build",
16
+ "prepare": "node scripts/prepare.mjs",
17
17
  "prettier": "prettier --write \"{src,test}/**/*.{ts,tsx,css,json}\"",
18
18
  "setup:certs": "node scripts/setup-certs.mjs",
19
19
  "start": "webpack serve",
package/web-client.d.ts CHANGED
@@ -84,20 +84,24 @@ export type Context = {
84
84
  /** Normalized before sending: trimmed, transliterated, deduplicated. */
85
85
  tags?: string[];
86
86
  /**
87
- * Host-page identity (`qm_*`, `client_*`) is shipped by the widget when
87
+ * Host-page identity, shipped as plain context vars when
88
88
  * `feature_flags.fiserv_web_activity` is on. `qm_session_id` comes from the
89
- * in-frame session replay, never the host page.
89
+ * in-frame session replay, never the host page. `null` on `qm_subscription`
90
+ * and `qm_user_id` is the opt-out tombstone.
90
91
  */
92
+ qm_partner_id?: string;
93
+ qm_client_id?: string;
94
+ qm_config_id?: string;
95
+ qm_page_template?: string;
96
+ qm_subscription?: string | null;
97
+ qm_user_id?: string | null;
98
+ qm_session_id?: string;
99
+ /** The walk (`client_*`) and the widget's own page fields. Nothing vendor-specific. */
91
100
  global?: {
92
101
  client_url?: string;
93
102
  ref?: string;
94
103
  disclaimer_accepted?: boolean;
95
104
  visitor_form_completed?: boolean;
96
- qm_partner_id?: string;
97
- qm_client_id?: string;
98
- qm_config_id?: string;
99
- qm_page_template?: string;
100
- qm_session_id?: string;
101
105
  client_path?: string;
102
106
  client_journey?: string;
103
107
  [key: string]: unknown;
@@ -108,12 +112,20 @@ export type Context = {
108
112
  export interface WidgetController {
109
113
  openWindow(): void;
110
114
  closeWindow(): void;
111
- /** Ends the conversation; the widget hides unless `hide` is `false`. */
115
+ /**
116
+ * Ends the conversation; the widget hides unless `hide` is `false`. Any
117
+ * context update still queued is sent first.
118
+ */
112
119
  closeConversation(options: { hide?: boolean }): void;
113
120
  /** Sends `text` into the conversation as the visitor. */
114
121
  sendMessage(message: { text: string }): void;
115
122
  /** Shows the teaser bubble, with the configured message when none is given. */
116
123
  showTeaserMessage(message?: string): void;
124
+ /**
125
+ * Merges `context` into the conversation. Calls inside a 300 ms window
126
+ * coalesce into one update; arrays replace the stored value. A call made
127
+ * before a conversation exists is held until the session opens.
128
+ */
117
129
  updateContext(context: Context): void;
118
130
  /** Overrides widget theme variables, e.g. `{ '--color-accent': '#f00' }`. */
119
131
  setCSSVariables(variables: Record<string, string>): void;