@opencx/widget 2.4.4-rn.0 → 2.4.4-rn.2
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/basic.cjs +31 -31
- package/dist/basic.cjs.map +1 -1
- package/dist/basic.js +37 -38
- package/dist/basic.js.map +1 -1
- package/dist/core/client/api.d.ts +6 -15
- package/dist/core/client/chat.d.ts +10 -10
- package/dist/core/client/contact.d.ts +2 -2
- package/dist/core/index.d.ts +2 -0
- package/dist/core/types/helpers.d.ts +1 -1
- package/dist/core/types/index.d.ts +2 -3
- package/dist/core/types/schemas-v2.d.ts +92 -91
- package/dist/core/types/schemas.d.ts +123 -69
- package/dist/{index-Cjs7ckCU.js → index-B-VyJuQ9.js} +964 -864
- package/dist/index-B-VyJuQ9.js.map +1 -0
- package/dist/index-D2PGs8oF.cjs +18 -0
- package/dist/index-D2PGs8oF.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +337 -282
- package/dist/index.js.map +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/react-web/hooks/useAbstractChat.d.ts +22 -21
- package/dist/react-web/hooks/useAxiosInstance.d.ts +35 -23
- package/dist/react-web/hooks/useUploadFiles.d.ts +1 -1
- package/dist/react-web/providers/ChatProvider.d.ts +24 -24
- package/dist/react-web/providers/ContactProvider.d.ts +4 -4
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/schemas-v2-BiJWHypc.cjs +2 -0
- package/dist/schemas-v2-BiJWHypc.cjs.map +1 -0
- package/dist/schemas-v2-DZ3nwfID.js +138 -0
- package/dist/schemas-v2-DZ3nwfID.js.map +1 -0
- package/dist/src/components/RenderFile.d.ts +1 -1
- package/dist/src/components/dialog.d.ts +2 -2
- package/dist-embed/script.js +107 -107
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
- package/dist/index-BVoLVQCZ.cjs +0 -18
- package/dist/index-BVoLVQCZ.cjs.map +0 -1
- package/dist/index-Cjs7ckCU.js.map +0 -1
- package/dist/schemas-BBAV6Sd_.js +0 -122
- package/dist/schemas-BBAV6Sd_.js.map +0 -1
- package/dist/schemas-wky4fpbc.cjs +0 -2
- package/dist/schemas-wky4fpbc.cjs.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { HttpChatInputSchema, WidgetHistorySchema, WidgetPreludeSchema, WidgetSessionSchema } from '../types/schemas-v2';
|
|
2
|
-
import { ConsumerType } from '../types';
|
|
3
2
|
import { NormalizedConfig } from './config';
|
|
4
3
|
export interface ApiCallerOptions {
|
|
5
4
|
config: NormalizedConfig;
|
|
@@ -17,43 +16,35 @@ export declare class ApiCaller {
|
|
|
17
16
|
success: true;
|
|
18
17
|
code?: string | undefined;
|
|
19
18
|
options?: {
|
|
20
|
-
value: string[];
|
|
21
19
|
type: "options";
|
|
20
|
+
value: string[];
|
|
22
21
|
} | undefined;
|
|
23
22
|
autopilotResponse?: {
|
|
23
|
+
type: "text";
|
|
24
24
|
value: {
|
|
25
25
|
content: string;
|
|
26
26
|
error: boolean;
|
|
27
27
|
};
|
|
28
|
-
type: "text";
|
|
29
28
|
id?: string | undefined;
|
|
30
29
|
} | undefined;
|
|
31
30
|
uiResponse?: {
|
|
31
|
+
type: "ui";
|
|
32
32
|
value: {
|
|
33
33
|
type: "ui_component";
|
|
34
34
|
name: string;
|
|
35
|
-
request_response?: unknown;
|
|
36
35
|
content?: string | undefined;
|
|
36
|
+
request_response?: unknown;
|
|
37
37
|
};
|
|
38
|
-
type: "ui";
|
|
39
38
|
} | undefined;
|
|
40
39
|
sessionIsHandedOff?: boolean | undefined;
|
|
41
40
|
} | {
|
|
41
|
+
success: false;
|
|
42
42
|
error: {
|
|
43
|
-
message?: string | undefined;
|
|
44
43
|
code?: string | undefined;
|
|
44
|
+
message?: string | undefined;
|
|
45
45
|
};
|
|
46
|
-
success: false;
|
|
47
46
|
}>;
|
|
48
47
|
getSessionHistory(sessionId: string, lastMessageTimestamp?: string): Promise<WidgetHistorySchema[]>;
|
|
49
48
|
createSession(): Promise<WidgetSessionSchema>;
|
|
50
49
|
getSession(sessionId: string): Promise<WidgetSessionSchema>;
|
|
51
|
-
createContact(user: {
|
|
52
|
-
external_id?: string;
|
|
53
|
-
name?: string;
|
|
54
|
-
email?: string;
|
|
55
|
-
phone?: string;
|
|
56
|
-
customData?: Record<string, string>;
|
|
57
|
-
avatarUrl?: string;
|
|
58
|
-
}): Promise<ConsumerType>;
|
|
59
50
|
}
|
|
@@ -23,28 +23,28 @@ export declare function createChat(options: ChatOptions): {
|
|
|
23
23
|
chatState: PubSub<ChatState>;
|
|
24
24
|
sessionState: PubSub<{
|
|
25
25
|
id: string;
|
|
26
|
-
channel: string;
|
|
27
|
-
assignee: {
|
|
28
|
-
name: string | null;
|
|
29
|
-
kind: "unknown" | "ai" | "none" | "human";
|
|
30
|
-
};
|
|
31
26
|
createdAt: Date;
|
|
32
27
|
updatedAt: Date;
|
|
33
28
|
isHandedOff: boolean;
|
|
34
29
|
isOpened: boolean;
|
|
35
|
-
} | null>;
|
|
36
|
-
sendMessage: (input: SomeOptional<Omit<HttpChatInputSchema, "bot_token">, "session_id" | "user">) => Promise<boolean>;
|
|
37
|
-
createSession: () => Promise<{
|
|
38
|
-
id: string;
|
|
39
|
-
channel: string;
|
|
40
30
|
assignee: {
|
|
41
31
|
name: string | null;
|
|
42
32
|
kind: "unknown" | "ai" | "none" | "human";
|
|
43
33
|
};
|
|
34
|
+
channel: string;
|
|
35
|
+
} | null>;
|
|
36
|
+
sendMessage: (input: SomeOptional<Omit<HttpChatInputSchema, "bot_token">, "session_id" | "user">) => Promise<boolean>;
|
|
37
|
+
createSession: () => Promise<{
|
|
38
|
+
id: string;
|
|
44
39
|
createdAt: Date;
|
|
45
40
|
updatedAt: Date;
|
|
46
41
|
isHandedOff: boolean;
|
|
47
42
|
isOpened: boolean;
|
|
43
|
+
assignee: {
|
|
44
|
+
name: string | null;
|
|
45
|
+
kind: "unknown" | "ai" | "none" | "human";
|
|
46
|
+
};
|
|
47
|
+
channel: string;
|
|
48
48
|
} | null>;
|
|
49
49
|
clearSession: () => Promise<void>;
|
|
50
50
|
cleanup: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PubSub } from '../types/pub-sub';
|
|
2
|
-
import { ConsumerType } from '../types';
|
|
3
2
|
import { ApiCaller } from './api';
|
|
4
3
|
import { Platform } from '../platform';
|
|
5
4
|
import { LoadingState, ErrorState } from '../types/helpers';
|
|
6
5
|
import { ConfigInstance } from './config';
|
|
6
|
+
import { ConsumerType } from '@core/types/schemas';
|
|
7
7
|
type ContactState = {
|
|
8
8
|
contact: ConsumerType | null;
|
|
9
9
|
loading: LoadingState;
|
|
@@ -22,9 +22,9 @@ export declare function createContact(options: ContactOptions): {
|
|
|
22
22
|
};
|
|
23
23
|
loadContact: () => Promise<any>;
|
|
24
24
|
saveContact: (contactData: Partial<ConsumerType>) => Promise<{
|
|
25
|
-
email: string | null;
|
|
26
25
|
id: string;
|
|
27
26
|
name: string | null;
|
|
27
|
+
email: string | null;
|
|
28
28
|
avatar_url: string | null;
|
|
29
29
|
created_at: string;
|
|
30
30
|
} | null>;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export { createChat } from './client/chat';
|
|
|
5
5
|
export { createContact } from './client/contact';
|
|
6
6
|
export { createConfig } from './client/config';
|
|
7
7
|
export { ApiCaller } from './client/api';
|
|
8
|
+
export { createLogger } from './platform/logger';
|
|
9
|
+
export { PubSub } from './types/pub-sub';
|
|
@@ -3,7 +3,7 @@ export type FunctionReturningPromise = (...args: any[]) => Promise<any>;
|
|
|
3
3
|
export type MakeKeysNotNullable<T, K extends keyof T> = Omit<T, K> & {
|
|
4
4
|
[P in K]-?: NonNullable<T[P]>;
|
|
5
5
|
};
|
|
6
|
-
export type LoadingReason = '
|
|
6
|
+
export type LoadingReason = 'sending_message_to_bot' | 'sending_message_to_agent' | 'creating_session' | 'polling' | 'loading_contact' | 'saving_contact' | 'cleaning_up' | null;
|
|
7
7
|
export type LoadingState = {
|
|
8
8
|
isLoading: boolean;
|
|
9
9
|
reason?: LoadingReason;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChatAttachmentType } from './schemas';
|
|
1
|
+
import { ChatAttachmentType } from './schemas-v2';
|
|
2
2
|
export * from './messages';
|
|
3
|
-
export * from './schemas';
|
|
3
|
+
export * from './schemas-v2';
|
|
4
4
|
export * from './pub-sub';
|
|
5
5
|
export * from './helpers';
|
|
6
6
|
export interface User {
|
|
@@ -23,7 +23,6 @@ export interface SendMessageInput extends Record<string, unknown> {
|
|
|
23
23
|
export interface CoreOptions {
|
|
24
24
|
token: string;
|
|
25
25
|
apiUrl?: string;
|
|
26
|
-
socketUrl?: string;
|
|
27
26
|
headers?: Record<string, string>;
|
|
28
27
|
queryParams?: Record<string, string>;
|
|
29
28
|
pathParams?: Record<string, string>;
|
|
@@ -122,11 +122,11 @@ declare const widgetPreludeSchema: z.ZodObject<{
|
|
|
122
122
|
from: string;
|
|
123
123
|
to: string;
|
|
124
124
|
} | undefined;
|
|
125
|
-
|
|
125
|
+
Everyday?: {
|
|
126
126
|
from: string;
|
|
127
127
|
to: string;
|
|
128
128
|
} | undefined;
|
|
129
|
-
|
|
129
|
+
WeekDays?: {
|
|
130
130
|
from: string;
|
|
131
131
|
to: string;
|
|
132
132
|
} | undefined;
|
|
@@ -159,11 +159,11 @@ declare const widgetPreludeSchema: z.ZodObject<{
|
|
|
159
159
|
from: string;
|
|
160
160
|
to: string;
|
|
161
161
|
} | undefined;
|
|
162
|
-
|
|
162
|
+
Everyday?: {
|
|
163
163
|
from: string;
|
|
164
164
|
to: string;
|
|
165
165
|
} | undefined;
|
|
166
|
-
|
|
166
|
+
WeekDays?: {
|
|
167
167
|
from: string;
|
|
168
168
|
to: string;
|
|
169
169
|
} | undefined;
|
|
@@ -202,11 +202,11 @@ declare const widgetPreludeSchema: z.ZodObject<{
|
|
|
202
202
|
from: string;
|
|
203
203
|
to: string;
|
|
204
204
|
} | undefined;
|
|
205
|
-
|
|
205
|
+
Everyday?: {
|
|
206
206
|
from: string;
|
|
207
207
|
to: string;
|
|
208
208
|
} | undefined;
|
|
209
|
-
|
|
209
|
+
WeekDays?: {
|
|
210
210
|
from: string;
|
|
211
211
|
to: string;
|
|
212
212
|
} | undefined;
|
|
@@ -245,11 +245,11 @@ declare const widgetPreludeSchema: z.ZodObject<{
|
|
|
245
245
|
from: string;
|
|
246
246
|
to: string;
|
|
247
247
|
} | undefined;
|
|
248
|
-
|
|
248
|
+
Everyday?: {
|
|
249
249
|
from: string;
|
|
250
250
|
to: string;
|
|
251
251
|
} | undefined;
|
|
252
|
-
|
|
252
|
+
WeekDays?: {
|
|
253
253
|
from: string;
|
|
254
254
|
to: string;
|
|
255
255
|
} | undefined;
|
|
@@ -264,14 +264,14 @@ export declare const chatAttachmentSchema: z.ZodObject<{
|
|
|
264
264
|
type: z.ZodString;
|
|
265
265
|
url: z.ZodString;
|
|
266
266
|
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
id: string;
|
|
268
267
|
type: string;
|
|
268
|
+
id: string;
|
|
269
269
|
name: string;
|
|
270
270
|
size: number;
|
|
271
271
|
url: string;
|
|
272
272
|
}, {
|
|
273
|
-
id: string;
|
|
274
273
|
type: string;
|
|
274
|
+
id: string;
|
|
275
275
|
name: string;
|
|
276
276
|
size: number;
|
|
277
277
|
url: string;
|
|
@@ -299,11 +299,11 @@ declare const widgetHistorySchema: z.ZodObject<{
|
|
|
299
299
|
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
300
300
|
avatar: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
301
301
|
}, "strip", z.ZodTypeAny, {
|
|
302
|
-
kind: "unknown" | "
|
|
302
|
+
kind: "unknown" | "user" | "agent" | "ai" | "none";
|
|
303
303
|
name?: string | null | undefined;
|
|
304
304
|
avatar?: string | null | undefined;
|
|
305
305
|
}, {
|
|
306
|
-
kind: "unknown" | "
|
|
306
|
+
kind: "unknown" | "user" | "agent" | "ai" | "none";
|
|
307
307
|
name?: string | null | undefined;
|
|
308
308
|
avatar?: string | null | undefined;
|
|
309
309
|
}>;
|
|
@@ -335,66 +335,66 @@ declare const widgetHistorySchema: z.ZodObject<{
|
|
|
335
335
|
type: z.ZodString;
|
|
336
336
|
url: z.ZodString;
|
|
337
337
|
}, "strip", z.ZodTypeAny, {
|
|
338
|
-
id: string;
|
|
339
338
|
type: string;
|
|
339
|
+
id: string;
|
|
340
340
|
name: string;
|
|
341
341
|
size: number;
|
|
342
342
|
url: string;
|
|
343
343
|
}, {
|
|
344
|
-
id: string;
|
|
345
344
|
type: string;
|
|
345
|
+
id: string;
|
|
346
346
|
name: string;
|
|
347
347
|
size: number;
|
|
348
348
|
url: string;
|
|
349
349
|
}>, "many">>>;
|
|
350
350
|
}, "strip", z.ZodTypeAny, {
|
|
351
351
|
type: MessageTypeEnum;
|
|
352
|
-
content: {
|
|
353
|
-
text?: string | null | undefined;
|
|
354
|
-
};
|
|
355
352
|
sender: {
|
|
356
|
-
kind: "unknown" | "
|
|
353
|
+
kind: "unknown" | "user" | "agent" | "ai" | "none";
|
|
357
354
|
name?: string | null | undefined;
|
|
358
355
|
avatar?: string | null | undefined;
|
|
359
356
|
};
|
|
357
|
+
content: {
|
|
358
|
+
text?: string | null | undefined;
|
|
359
|
+
};
|
|
360
360
|
publicId?: string | null | undefined;
|
|
361
|
-
attachments?: {
|
|
362
|
-
id: string;
|
|
363
|
-
type: string;
|
|
364
|
-
name: string;
|
|
365
|
-
size: number;
|
|
366
|
-
url: string;
|
|
367
|
-
}[] | null | undefined;
|
|
368
361
|
sentAt?: string | null | undefined;
|
|
369
362
|
actionCalls?: {
|
|
370
363
|
actionName: string;
|
|
371
364
|
args: Record<string, unknown>;
|
|
372
365
|
result?: Record<string, unknown> | null | undefined;
|
|
373
366
|
}[] | null | undefined;
|
|
367
|
+
attachments?: {
|
|
368
|
+
type: string;
|
|
369
|
+
id: string;
|
|
370
|
+
name: string;
|
|
371
|
+
size: number;
|
|
372
|
+
url: string;
|
|
373
|
+
}[] | null | undefined;
|
|
374
374
|
}, {
|
|
375
375
|
type: MessageTypeEnum;
|
|
376
|
-
content: {
|
|
377
|
-
text?: string | null | undefined;
|
|
378
|
-
};
|
|
379
376
|
sender: {
|
|
380
|
-
kind: "unknown" | "
|
|
377
|
+
kind: "unknown" | "user" | "agent" | "ai" | "none";
|
|
381
378
|
name?: string | null | undefined;
|
|
382
379
|
avatar?: string | null | undefined;
|
|
383
380
|
};
|
|
381
|
+
content: {
|
|
382
|
+
text?: string | null | undefined;
|
|
383
|
+
};
|
|
384
384
|
publicId?: string | null | undefined;
|
|
385
|
-
attachments?: {
|
|
386
|
-
id: string;
|
|
387
|
-
type: string;
|
|
388
|
-
name: string;
|
|
389
|
-
size: number;
|
|
390
|
-
url: string;
|
|
391
|
-
}[] | null | undefined;
|
|
392
385
|
sentAt?: string | null | undefined;
|
|
393
386
|
actionCalls?: {
|
|
394
387
|
actionName: string;
|
|
395
388
|
args: Record<string, unknown>;
|
|
396
389
|
result?: Record<string, unknown> | null | undefined;
|
|
397
390
|
}[] | null | undefined;
|
|
391
|
+
attachments?: {
|
|
392
|
+
type: string;
|
|
393
|
+
id: string;
|
|
394
|
+
name: string;
|
|
395
|
+
size: number;
|
|
396
|
+
url: string;
|
|
397
|
+
}[] | null | undefined;
|
|
398
398
|
}>;
|
|
399
399
|
declare const widgetSessionSchema: z.ZodObject<{
|
|
400
400
|
id: z.ZodString;
|
|
@@ -415,26 +415,26 @@ declare const widgetSessionSchema: z.ZodObject<{
|
|
|
415
415
|
channel: z.ZodString;
|
|
416
416
|
}, "strip", z.ZodTypeAny, {
|
|
417
417
|
id: string;
|
|
418
|
-
channel: string;
|
|
419
|
-
assignee: {
|
|
420
|
-
name: string | null;
|
|
421
|
-
kind: "unknown" | "ai" | "none" | "human";
|
|
422
|
-
};
|
|
423
418
|
createdAt: Date;
|
|
424
419
|
updatedAt: Date;
|
|
425
420
|
isHandedOff: boolean;
|
|
426
421
|
isOpened: boolean;
|
|
427
|
-
}, {
|
|
428
|
-
id: string;
|
|
429
|
-
channel: string;
|
|
430
422
|
assignee: {
|
|
431
423
|
name: string | null;
|
|
432
424
|
kind: "unknown" | "ai" | "none" | "human";
|
|
433
425
|
};
|
|
426
|
+
channel: string;
|
|
427
|
+
}, {
|
|
428
|
+
id: string;
|
|
434
429
|
createdAt: Date;
|
|
435
430
|
updatedAt: Date;
|
|
436
431
|
isHandedOff: boolean;
|
|
437
432
|
isOpened: boolean;
|
|
433
|
+
assignee: {
|
|
434
|
+
name: string | null;
|
|
435
|
+
kind: "unknown" | "ai" | "none" | "human";
|
|
436
|
+
};
|
|
437
|
+
channel: string;
|
|
438
438
|
}>;
|
|
439
439
|
declare const httpChatInputDto: z.ZodObject<{
|
|
440
440
|
content: z.ZodString;
|
|
@@ -449,15 +449,15 @@ declare const httpChatInputDto: z.ZodObject<{
|
|
|
449
449
|
avatar: z.ZodOptional<z.ZodString>;
|
|
450
450
|
customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
451
451
|
}, "strip", z.ZodTypeAny, {
|
|
452
|
-
email?: string | undefined;
|
|
453
452
|
name?: string | undefined;
|
|
454
453
|
avatar?: string | undefined;
|
|
454
|
+
email?: string | undefined;
|
|
455
455
|
phone?: string | undefined;
|
|
456
456
|
customData?: Record<string, string> | undefined;
|
|
457
457
|
}, {
|
|
458
|
-
email?: string | undefined;
|
|
459
458
|
name?: string | undefined;
|
|
460
459
|
avatar?: string | undefined;
|
|
460
|
+
email?: string | undefined;
|
|
461
461
|
phone?: string | undefined;
|
|
462
462
|
customData?: Record<string, string> | undefined;
|
|
463
463
|
}>>>;
|
|
@@ -469,60 +469,60 @@ declare const httpChatInputDto: z.ZodObject<{
|
|
|
469
469
|
type: z.ZodString;
|
|
470
470
|
url: z.ZodString;
|
|
471
471
|
}, "strip", z.ZodTypeAny, {
|
|
472
|
-
id: string;
|
|
473
472
|
type: string;
|
|
473
|
+
id: string;
|
|
474
474
|
name: string;
|
|
475
475
|
size: number;
|
|
476
476
|
url: string;
|
|
477
477
|
}, {
|
|
478
|
-
id: string;
|
|
479
478
|
type: string;
|
|
479
|
+
id: string;
|
|
480
480
|
name: string;
|
|
481
481
|
size: number;
|
|
482
482
|
url: string;
|
|
483
483
|
}>, "many">>>;
|
|
484
484
|
}, "strip", z.ZodTypeAny, {
|
|
485
|
-
session_id: string;
|
|
486
485
|
content: string;
|
|
486
|
+
session_id: string;
|
|
487
487
|
bot_token: string;
|
|
488
|
-
language?: string | null | undefined;
|
|
489
|
-
attachments?: {
|
|
490
|
-
id: string;
|
|
491
|
-
type: string;
|
|
492
|
-
name: string;
|
|
493
|
-
size: number;
|
|
494
|
-
url: string;
|
|
495
|
-
}[] | null | undefined;
|
|
496
488
|
user?: {
|
|
497
|
-
email?: string | undefined;
|
|
498
489
|
name?: string | undefined;
|
|
499
490
|
avatar?: string | undefined;
|
|
491
|
+
email?: string | undefined;
|
|
500
492
|
phone?: string | undefined;
|
|
501
493
|
customData?: Record<string, string> | undefined;
|
|
502
494
|
} | null | undefined;
|
|
503
|
-
headers?: Record<string, string> | null | undefined;
|
|
504
|
-
query_params?: Record<string, string> | null | undefined;
|
|
505
|
-
}, {
|
|
506
|
-
session_id: string;
|
|
507
|
-
content: string;
|
|
508
|
-
bot_token: string;
|
|
509
|
-
language?: string | null | undefined;
|
|
510
495
|
attachments?: {
|
|
511
|
-
id: string;
|
|
512
496
|
type: string;
|
|
497
|
+
id: string;
|
|
513
498
|
name: string;
|
|
514
499
|
size: number;
|
|
515
500
|
url: string;
|
|
516
501
|
}[] | null | undefined;
|
|
502
|
+
headers?: Record<string, string> | null | undefined;
|
|
503
|
+
query_params?: Record<string, string> | null | undefined;
|
|
504
|
+
language?: string | null | undefined;
|
|
505
|
+
}, {
|
|
506
|
+
content: string;
|
|
507
|
+
session_id: string;
|
|
508
|
+
bot_token: string;
|
|
517
509
|
user?: {
|
|
518
|
-
email?: string | undefined;
|
|
519
510
|
name?: string | undefined;
|
|
520
511
|
avatar?: string | undefined;
|
|
512
|
+
email?: string | undefined;
|
|
521
513
|
phone?: string | undefined;
|
|
522
514
|
customData?: Record<string, string> | undefined;
|
|
523
515
|
} | null | undefined;
|
|
516
|
+
attachments?: {
|
|
517
|
+
type: string;
|
|
518
|
+
id: string;
|
|
519
|
+
name: string;
|
|
520
|
+
size: number;
|
|
521
|
+
url: string;
|
|
522
|
+
}[] | null | undefined;
|
|
524
523
|
headers?: Record<string, string> | null | undefined;
|
|
525
524
|
query_params?: Record<string, string> | null | undefined;
|
|
525
|
+
language?: string | null | undefined;
|
|
526
526
|
}>;
|
|
527
527
|
declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success", [z.ZodObject<{
|
|
528
528
|
success: z.ZodLiteral<true>;
|
|
@@ -531,11 +531,11 @@ declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success
|
|
|
531
531
|
type: z.ZodLiteral<"options">;
|
|
532
532
|
value: z.ZodArray<z.ZodString, "many">;
|
|
533
533
|
}, "strip", z.ZodTypeAny, {
|
|
534
|
-
value: string[];
|
|
535
534
|
type: "options";
|
|
536
|
-
}, {
|
|
537
535
|
value: string[];
|
|
536
|
+
}, {
|
|
538
537
|
type: "options";
|
|
538
|
+
value: string[];
|
|
539
539
|
}>>;
|
|
540
540
|
autopilotResponse: z.ZodOptional<z.ZodObject<{
|
|
541
541
|
type: z.ZodLiteral<"text">;
|
|
@@ -551,18 +551,18 @@ declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success
|
|
|
551
551
|
}>;
|
|
552
552
|
id: z.ZodOptional<z.ZodString>;
|
|
553
553
|
}, "strip", z.ZodTypeAny, {
|
|
554
|
+
type: "text";
|
|
554
555
|
value: {
|
|
555
556
|
content: string;
|
|
556
557
|
error: boolean;
|
|
557
558
|
};
|
|
558
|
-
type: "text";
|
|
559
559
|
id?: string | undefined;
|
|
560
560
|
}, {
|
|
561
|
+
type: "text";
|
|
561
562
|
value: {
|
|
562
563
|
content: string;
|
|
563
564
|
error: boolean;
|
|
564
565
|
};
|
|
565
|
-
type: "text";
|
|
566
566
|
id?: string | undefined;
|
|
567
567
|
}>>;
|
|
568
568
|
uiResponse: z.ZodOptional<z.ZodObject<{
|
|
@@ -575,80 +575,80 @@ declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success
|
|
|
575
575
|
}, "strip", z.ZodTypeAny, {
|
|
576
576
|
type: "ui_component";
|
|
577
577
|
name: string;
|
|
578
|
-
request_response?: unknown;
|
|
579
578
|
content?: string | undefined;
|
|
579
|
+
request_response?: unknown;
|
|
580
580
|
}, {
|
|
581
581
|
type: "ui_component";
|
|
582
582
|
name: string;
|
|
583
|
-
request_response?: unknown;
|
|
584
583
|
content?: string | undefined;
|
|
584
|
+
request_response?: unknown;
|
|
585
585
|
}>;
|
|
586
586
|
}, "strip", z.ZodTypeAny, {
|
|
587
|
+
type: "ui";
|
|
587
588
|
value: {
|
|
588
589
|
type: "ui_component";
|
|
589
590
|
name: string;
|
|
590
|
-
request_response?: unknown;
|
|
591
591
|
content?: string | undefined;
|
|
592
|
+
request_response?: unknown;
|
|
592
593
|
};
|
|
593
|
-
type: "ui";
|
|
594
594
|
}, {
|
|
595
|
+
type: "ui";
|
|
595
596
|
value: {
|
|
596
597
|
type: "ui_component";
|
|
597
598
|
name: string;
|
|
598
|
-
request_response?: unknown;
|
|
599
599
|
content?: string | undefined;
|
|
600
|
+
request_response?: unknown;
|
|
600
601
|
};
|
|
601
|
-
type: "ui";
|
|
602
602
|
}>>;
|
|
603
603
|
sessionIsHandedOff: z.ZodOptional<z.ZodBoolean>;
|
|
604
604
|
}, "strip", z.ZodTypeAny, {
|
|
605
605
|
success: true;
|
|
606
606
|
code?: string | undefined;
|
|
607
607
|
options?: {
|
|
608
|
-
value: string[];
|
|
609
608
|
type: "options";
|
|
609
|
+
value: string[];
|
|
610
610
|
} | undefined;
|
|
611
611
|
autopilotResponse?: {
|
|
612
|
+
type: "text";
|
|
612
613
|
value: {
|
|
613
614
|
content: string;
|
|
614
615
|
error: boolean;
|
|
615
616
|
};
|
|
616
|
-
type: "text";
|
|
617
617
|
id?: string | undefined;
|
|
618
618
|
} | undefined;
|
|
619
619
|
uiResponse?: {
|
|
620
|
+
type: "ui";
|
|
620
621
|
value: {
|
|
621
622
|
type: "ui_component";
|
|
622
623
|
name: string;
|
|
623
|
-
request_response?: unknown;
|
|
624
624
|
content?: string | undefined;
|
|
625
|
+
request_response?: unknown;
|
|
625
626
|
};
|
|
626
|
-
type: "ui";
|
|
627
627
|
} | undefined;
|
|
628
628
|
sessionIsHandedOff?: boolean | undefined;
|
|
629
629
|
}, {
|
|
630
630
|
success: true;
|
|
631
631
|
code?: string | undefined;
|
|
632
632
|
options?: {
|
|
633
|
-
value: string[];
|
|
634
633
|
type: "options";
|
|
634
|
+
value: string[];
|
|
635
635
|
} | undefined;
|
|
636
636
|
autopilotResponse?: {
|
|
637
|
+
type: "text";
|
|
637
638
|
value: {
|
|
638
639
|
content: string;
|
|
639
640
|
error: boolean;
|
|
640
641
|
};
|
|
641
|
-
type: "text";
|
|
642
642
|
id?: string | undefined;
|
|
643
643
|
} | undefined;
|
|
644
644
|
uiResponse?: {
|
|
645
|
+
type: "ui";
|
|
645
646
|
value: {
|
|
646
647
|
type: "ui_component";
|
|
647
648
|
name: string;
|
|
648
|
-
request_response?: unknown;
|
|
649
649
|
content?: string | undefined;
|
|
650
|
+
request_response?: unknown;
|
|
650
651
|
};
|
|
651
|
-
type: "ui";
|
|
652
652
|
} | undefined;
|
|
653
653
|
sessionIsHandedOff?: boolean | undefined;
|
|
654
654
|
}>, z.ZodObject<{
|
|
@@ -657,24 +657,24 @@ declare const handleContactMessageOutputSchema: z.ZodDiscriminatedUnion<"success
|
|
|
657
657
|
code: z.ZodOptional<z.ZodString>;
|
|
658
658
|
message: z.ZodOptional<z.ZodString>;
|
|
659
659
|
}, "strip", z.ZodTypeAny, {
|
|
660
|
-
message?: string | undefined;
|
|
661
660
|
code?: string | undefined;
|
|
662
|
-
}, {
|
|
663
661
|
message?: string | undefined;
|
|
662
|
+
}, {
|
|
664
663
|
code?: string | undefined;
|
|
664
|
+
message?: string | undefined;
|
|
665
665
|
}>;
|
|
666
666
|
}, "strip", z.ZodTypeAny, {
|
|
667
|
+
success: false;
|
|
667
668
|
error: {
|
|
668
|
-
message?: string | undefined;
|
|
669
669
|
code?: string | undefined;
|
|
670
|
+
message?: string | undefined;
|
|
670
671
|
};
|
|
671
|
-
success: false;
|
|
672
672
|
}, {
|
|
673
|
+
success: false;
|
|
673
674
|
error: {
|
|
674
|
-
message?: string | undefined;
|
|
675
675
|
code?: string | undefined;
|
|
676
|
+
message?: string | undefined;
|
|
676
677
|
};
|
|
677
|
-
success: false;
|
|
678
678
|
}>]>;
|
|
679
679
|
declare const widgetVoteSchema: z.ZodObject<{
|
|
680
680
|
action: z.ZodEnum<["upvote", "downvote"]>;
|
|
@@ -706,4 +706,5 @@ export type WidgetSessionSchema = z.infer<typeof widgetSessionSchema>;
|
|
|
706
706
|
export type WidgetHistorySchema = z.infer<typeof widgetHistorySchema>;
|
|
707
707
|
export type WidgetPreludeSchema = z.infer<typeof widgetPreludeSchema>;
|
|
708
708
|
export type WidgetVoteSchema = z.infer<typeof widgetVoteSchema>;
|
|
709
|
+
export type ChatAttachmentType = z.infer<typeof chatAttachmentSchema>;
|
|
709
710
|
export {};
|