@opencx/widget 3.0.74 → 3.0.76

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.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-DUaeXkNb.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-D_eeZ2xk.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as i, W as a } from "./widget.ctx-COUAUyWX.js";
1
+ import { P as i, W as a } from "./widget.ctx-W1JQt9cl.js";
2
2
  export {
3
3
  i as PrimitiveState,
4
4
  a as WidgetCtx
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-Cm-L4gPy.cjs");function g(t,i,s){const{widgetCtx:{api:u}}=e.useWidget();return e._default(async r=>u.vote({action:r==="up"?"upvote":"downvote",messagePublicId:t,sessionId:i}).then(s),[u,t,i,s])}exports.WidgetProvider=e.WidgetProvider;exports.WidgetTriggerProvider=e.WidgetTriggerProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useWidgetTrigger=e.useWidgetTrigger;exports.useVote=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-D-OdmCtY.cjs");function g(t,i,s){const{widgetCtx:{api:u}}=e.useWidget();return e._default(async r=>u.vote({action:r==="up"?"upvote":"downvote",messagePublicId:t,sessionId:i}).then(s),[u,t,i,s])}exports.WidgetProvider=e.WidgetProvider;exports.WidgetTriggerProvider=e.WidgetTriggerProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useWidgetTrigger=e.useWidgetTrigger;exports.useVote=g;
2
2
  //# sourceMappingURL=react.cjs.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { u, _ as r } from "./useWidgetTrigger-D4GbzpPs.js";
2
- import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-D4GbzpPs.js";
1
+ import { u, _ as r } from "./useWidgetTrigger-CJFrgKrO.js";
2
+ import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-CJFrgKrO.js";
3
3
  function g(e, s, t) {
4
4
  const {
5
5
  widgetCtx: { api: a }
@@ -82,7 +82,7 @@ export declare const TestUtils: {
82
82
  email?: string;
83
83
  non_verified_name?: string;
84
84
  non_verified_custom_data?: {
85
- [key: string]: string;
85
+ [key: string]: string | number | boolean;
86
86
  };
87
87
  };
88
88
  }, `${string}/${string}`>> | undefined): void;
@@ -159,13 +159,16 @@ export declare const TestUtils: {
159
159
  uuid: string;
160
160
  content: string;
161
161
  session_id: string;
162
+ bot_token: string;
162
163
  headers?: {
163
164
  [key: string]: string;
164
165
  } | null;
165
- bot_token: string;
166
166
  query_params?: {
167
167
  [key: string]: string;
168
168
  } | null;
169
+ body_properties?: {
170
+ [key: string]: unknown;
171
+ } | null;
169
172
  language?: string | null;
170
173
  attachments?: {
171
174
  id: string;
@@ -116,13 +116,16 @@ export declare class ApiCaller {
116
116
  uuid: string;
117
117
  content: string;
118
118
  session_id: string;
119
+ bot_token: string;
119
120
  headers?: {
120
121
  [key: string]: string;
121
122
  } | null;
122
- bot_token: string;
123
123
  query_params?: {
124
124
  [key: string]: string;
125
125
  } | null;
126
+ body_properties?: {
127
+ [key: string]: unknown;
128
+ } | null;
126
129
  language?: string | null;
127
130
  attachments?: {
128
131
  id: string;
@@ -179,7 +182,7 @@ export declare class ApiCaller {
179
182
  email?: string;
180
183
  non_verified_name?: string;
181
184
  non_verified_custom_data?: {
182
- [key: string]: string;
185
+ [key: string]: string | number | boolean;
183
186
  };
184
187
  };
185
188
  }, `${string}/${string}`>>;
@@ -171,7 +171,7 @@ export interface components {
171
171
  email?: string;
172
172
  non_verified_name?: string;
173
173
  non_verified_custom_data?: {
174
- [key: string]: string;
174
+ [key: string]: string | number | boolean;
175
175
  };
176
176
  };
177
177
  CreateWidgetSessionDto: {
@@ -186,7 +186,7 @@ export interface components {
186
186
  HandleContactMessageOutputDto: {
187
187
  /** @enum {boolean} */
188
188
  success: true;
189
- code?: string | 'session_assigned_to_human_agent';
189
+ code?: string | 'session_assigned_to_human_agent' | 'response_cancelled';
190
190
  autopilotResponse?: {
191
191
  /** @enum {string} */
192
192
  type: 'text';
@@ -196,6 +196,7 @@ export interface components {
196
196
  };
197
197
  id?: string;
198
198
  mightSolveUserIssue: boolean;
199
+ completelyAndFullyCoveredUserIssue: boolean;
199
200
  };
200
201
  uiResponse?: {
201
202
  /** @enum {string} */
@@ -245,13 +246,19 @@ export interface components {
245
246
  uuid: string;
246
247
  content: string;
247
248
  session_id: string;
249
+ bot_token: string;
250
+ /** @description Additional headers to be included in the request of action calls */
248
251
  headers?: {
249
252
  [key: string]: string;
250
253
  } | null;
251
- bot_token: string;
254
+ /** @description Additional query parameters to be included in the query of action calls */
252
255
  query_params?: {
253
256
  [key: string]: string;
254
257
  } | null;
258
+ /** @description Additional body properties to be included in the body of action calls */
259
+ body_properties?: {
260
+ [key: string]: unknown;
261
+ } | null;
255
262
  language?: string | null;
256
263
  attachments?: {
257
264
  id: string;
@@ -0,0 +1,7 @@
1
+ type JsonArray = JsonValue[];
2
+ type JsonObject = {
3
+ [x: string]: JsonValue | undefined;
4
+ };
5
+ type JsonPrimitive = boolean | number | string | null;
6
+ export type JsonValue = JsonArray | JsonObject | JsonPrimitive;
7
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { AgentOrBotType } from './agent-or-bot';
2
+ import { JsonValue } from './json-value';
2
3
  type UserBaseConfig = {
3
4
  token: string;
4
5
  data?: never;
@@ -220,19 +221,20 @@ export interface WidgetConfig {
220
221
  */
221
222
  anchorTarget?: '_blank' | '_top';
222
223
  /**
223
- * Headers to be sent with each send-message request from the widget.
224
- * These headers will be sent with each AI action (AI tools) that the LLM can call.
225
- * This is useful if your AI actions require authentication specific to each contact.
224
+ * Headers to be added to every Http AI action taken.
226
225
  * @default undefined
227
226
  */
228
227
  headers?: Record<string, string>;
229
228
  /**
230
- * Query params to be sent with each send-message request from the widget.
231
- * These query params will be sent with each AI action (AI tools) that the LLM can call.
232
- * This is useful if you want to send extra information with each AI action.
229
+ * Query params to be added to every Http AI action taken.
233
230
  * @default undefined
234
231
  */
235
232
  queryParams?: Record<string, string>;
233
+ /**
234
+ * Properties to be added to the `body` of every Http AI action taken.
235
+ * @default undefined
236
+ */
237
+ bodyProperties?: Record<string, JsonValue>;
236
238
  /**
237
239
  * Dynamic context to be sent with each send-message request from the widget.
238
240
  * Useful if you want to send data regarding the current page the user is viewing.
@@ -1,8 +1,8 @@
1
1
  import z, { createContext as Fe, useRef as W, useState as Me, useMemo as Ne, useEffect as he, useContext as Ue, useSyncExternalStore as kt, useLayoutEffect as Jt, useCallback as ve, useDebugValue as Xt } from "react";
2
2
  import { v4 as Qt } from "uuid";
3
3
  import { jsx as it } from "react/jsx-runtime";
4
- import { W as Zt } from "./widget.ctx-COUAUyWX.js";
5
- const en = "3.0.74";
4
+ import { W as Zt } from "./widget.ctx-W1JQt9cl.js";
5
+ const en = "3.0.76";
6
6
  class tn {
7
7
  constructor(t) {
8
8
  this.components = [];
@@ -1347,4 +1347,4 @@ export {
1347
1347
  nr as m,
1348
1348
  Y as u
1349
1349
  };
1350
- //# sourceMappingURL=useWidgetTrigger-D4GbzpPs.js.map
1350
+ //# sourceMappingURL=useWidgetTrigger-CJFrgKrO.js.map