@botpress/webchat-client 0.4.0 → 0.5.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.
- package/.turbo/turbo-build.log +3 -3
- package/dist/index.d.ts +430 -366
- package/package.json +3 -3
- package/src/client/client.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat-client@0.
|
|
2
|
+
> @botpress/webchat-client@0.5.0 build /home/runner/work/genisys/genisys/packages/webchat-client
|
|
3
3
|
> openapi-ts && vite build
|
|
4
4
|
|
|
5
5
|
⏳ Generating from raw OpenAPI specification
|
|
@@ -24,6 +24,6 @@ computing gzip size...
|
|
|
24
24
|
[vite:dts] Start rollup declaration files...
|
|
25
25
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
26
26
|
*** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
|
|
27
|
-
[vite:dts] Declaration files built in
|
|
27
|
+
[vite:dts] Declaration files built in 6217ms.
|
|
28
28
|
|
|
29
|
-
[32m✓ built in 6.
|
|
29
|
+
[32m✓ built in 6.53s[39m
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adds feedback to a [Message](#schema_message).
|
|
3
3
|
*/
|
|
4
|
-
declare const addMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<AddMessageFeedbackData, ThrowOnError>) => RequestResult<{
|
|
5
|
-
|
|
4
|
+
declare const addMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<AddMessageFeedbackData, ThrowOnError>) => RequestResult< {
|
|
5
|
+
[key: string]: never;
|
|
6
6
|
}, {
|
|
7
|
-
|
|
7
|
+
[key: string]: never;
|
|
8
8
|
}, ThrowOnError>;
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -61,10 +61,10 @@ export declare type AddMessageFeedbackResponses = {
|
|
|
61
61
|
/**
|
|
62
62
|
* Add a [Participant](#schema_user) to a [Conversation](#schema_conversation).
|
|
63
63
|
*/
|
|
64
|
-
declare const addParticipant: <ThrowOnError extends boolean = false>(options: Options<AddParticipantData, ThrowOnError>) => RequestResult<{
|
|
65
|
-
|
|
64
|
+
declare const addParticipant: <ThrowOnError extends boolean = false>(options: Options<AddParticipantData, ThrowOnError>) => RequestResult< {
|
|
65
|
+
participant: User;
|
|
66
66
|
}, {
|
|
67
|
-
|
|
67
|
+
participant: User;
|
|
68
68
|
}, ThrowOnError>;
|
|
69
69
|
|
|
70
70
|
/**
|
|
@@ -187,7 +187,7 @@ export declare type Client = {
|
|
|
187
187
|
deleteMessage: (params: MessageIdParam) => Promise<ClientTypes_2.DeleteMessageResponse>;
|
|
188
188
|
createFile: (params: ClientTypes_2.CreateFileBody) => Promise<ClientTypes_2.CreateFileResponse>;
|
|
189
189
|
getUser: () => Promise<ClientTypes_2.GetUserResponse>;
|
|
190
|
-
updateUser: (params: ClientTypes_2.
|
|
190
|
+
updateUser: (params: ClientTypes_2.UpdateUserBody) => Promise<ClientTypes_2.UpdateUserResponse>;
|
|
191
191
|
deleteUser: (params: UserIdParam) => Promise<ClientTypes_2.DeleteUserResponse>;
|
|
192
192
|
createEvent: (params: ClientTypes_2.CreateEventBody) => Promise<ClientTypes_2.CreateEventResponse>;
|
|
193
193
|
getEvent: (params: EventIdParam) => Promise<ClientTypes_2.GetEventResponse>;
|
|
@@ -513,6 +513,7 @@ export declare type Conversation = {
|
|
|
513
513
|
*/
|
|
514
514
|
payload: {
|
|
515
515
|
audioUrl: string;
|
|
516
|
+
fileId?: string;
|
|
516
517
|
type: 'audio';
|
|
517
518
|
} | {
|
|
518
519
|
title: string;
|
|
@@ -555,9 +556,11 @@ export declare type Conversation = {
|
|
|
555
556
|
} | {
|
|
556
557
|
fileUrl: string;
|
|
557
558
|
title?: string;
|
|
559
|
+
fileId?: string;
|
|
558
560
|
type: 'file';
|
|
559
561
|
} | {
|
|
560
562
|
imageUrl: string;
|
|
563
|
+
fileId?: string;
|
|
561
564
|
type: 'image';
|
|
562
565
|
} | {
|
|
563
566
|
latitude: number;
|
|
@@ -571,6 +574,7 @@ export declare type Conversation = {
|
|
|
571
574
|
type: 'text';
|
|
572
575
|
} | {
|
|
573
576
|
videoUrl: string;
|
|
577
|
+
fileId?: string;
|
|
574
578
|
type: 'video';
|
|
575
579
|
} | {
|
|
576
580
|
items: Array<{
|
|
@@ -588,22 +592,26 @@ export declare type Conversation = {
|
|
|
588
592
|
type: 'image';
|
|
589
593
|
payload: {
|
|
590
594
|
imageUrl: string;
|
|
595
|
+
fileId?: string;
|
|
591
596
|
};
|
|
592
597
|
} | {
|
|
593
598
|
type: 'audio';
|
|
594
599
|
payload: {
|
|
595
600
|
audioUrl: string;
|
|
601
|
+
fileId?: string;
|
|
596
602
|
};
|
|
597
603
|
} | {
|
|
598
604
|
type: 'video';
|
|
599
605
|
payload: {
|
|
600
606
|
videoUrl: string;
|
|
607
|
+
fileId?: string;
|
|
601
608
|
};
|
|
602
609
|
} | {
|
|
603
610
|
type: 'file';
|
|
604
611
|
payload: {
|
|
605
612
|
fileUrl: string;
|
|
606
613
|
title?: string;
|
|
614
|
+
fileId?: string;
|
|
607
615
|
};
|
|
608
616
|
} | {
|
|
609
617
|
type: 'location';
|
|
@@ -668,10 +676,10 @@ export declare const createClient: ({ userKey, clientId, apiUrl, customHeaders,
|
|
|
668
676
|
/**
|
|
669
677
|
* Creates a new [Conversation](#schema_conversation)
|
|
670
678
|
*/
|
|
671
|
-
declare const createConversation: <ThrowOnError extends boolean = false>(options: Options<CreateConversationData, ThrowOnError>) => RequestResult<{
|
|
672
|
-
|
|
679
|
+
declare const createConversation: <ThrowOnError extends boolean = false>(options: Options<CreateConversationData, ThrowOnError>) => RequestResult< {
|
|
680
|
+
conversation: Conversation;
|
|
673
681
|
}, {
|
|
674
|
-
|
|
682
|
+
conversation: Conversation;
|
|
675
683
|
}, ThrowOnError>;
|
|
676
684
|
|
|
677
685
|
/**
|
|
@@ -722,10 +730,10 @@ export declare type CreateConversationResponses = {
|
|
|
722
730
|
/**
|
|
723
731
|
* Creates a new [Event](#schema_event)
|
|
724
732
|
*/
|
|
725
|
-
declare const createEvent: <ThrowOnError extends boolean = false>(options: Options<CreateEventData, ThrowOnError>) => RequestResult<{
|
|
726
|
-
|
|
733
|
+
declare const createEvent: <ThrowOnError extends boolean = false>(options: Options<CreateEventData, ThrowOnError>) => RequestResult< {
|
|
734
|
+
event: Event_2;
|
|
727
735
|
}, {
|
|
728
|
-
|
|
736
|
+
event: Event_2;
|
|
729
737
|
}, ThrowOnError>;
|
|
730
738
|
|
|
731
739
|
/**
|
|
@@ -797,10 +805,10 @@ export declare type CreateEventResponses = {
|
|
|
797
805
|
/**
|
|
798
806
|
* Creates a new file and returns it's upload URL.
|
|
799
807
|
*/
|
|
800
|
-
declare const createFile: <ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>) => RequestResult<{
|
|
801
|
-
|
|
808
|
+
declare const createFile: <ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>) => RequestResult< {
|
|
809
|
+
file: File_2;
|
|
802
810
|
}, {
|
|
803
|
-
|
|
811
|
+
file: File_2;
|
|
804
812
|
}, ThrowOnError>;
|
|
805
813
|
|
|
806
814
|
/**
|
|
@@ -880,10 +888,10 @@ export declare type CreateFileResponses = {
|
|
|
880
888
|
/**
|
|
881
889
|
* Creates a new [Message](#schema_message)
|
|
882
890
|
*/
|
|
883
|
-
declare const createMessage: <ThrowOnError extends boolean = false>(options: Options<CreateMessageData, ThrowOnError>) => RequestResult<{
|
|
884
|
-
|
|
891
|
+
declare const createMessage: <ThrowOnError extends boolean = false>(options: Options<CreateMessageData, ThrowOnError>) => RequestResult< {
|
|
892
|
+
message: Message;
|
|
885
893
|
}, {
|
|
886
|
-
|
|
894
|
+
message: Message;
|
|
887
895
|
}, ThrowOnError>;
|
|
888
896
|
|
|
889
897
|
/**
|
|
@@ -895,6 +903,7 @@ export declare type CreateMessageBody = {
|
|
|
895
903
|
*/
|
|
896
904
|
payload: {
|
|
897
905
|
audioUrl: string;
|
|
906
|
+
fileId?: string;
|
|
898
907
|
type: 'audio';
|
|
899
908
|
} | {
|
|
900
909
|
title: string;
|
|
@@ -937,9 +946,11 @@ export declare type CreateMessageBody = {
|
|
|
937
946
|
} | {
|
|
938
947
|
fileUrl: string;
|
|
939
948
|
title?: string;
|
|
949
|
+
fileId?: string;
|
|
940
950
|
type: 'file';
|
|
941
951
|
} | {
|
|
942
952
|
imageUrl: string;
|
|
953
|
+
fileId?: string;
|
|
943
954
|
type: 'image';
|
|
944
955
|
} | {
|
|
945
956
|
latitude: number;
|
|
@@ -953,6 +964,7 @@ export declare type CreateMessageBody = {
|
|
|
953
964
|
type: 'text';
|
|
954
965
|
} | {
|
|
955
966
|
videoUrl: string;
|
|
967
|
+
fileId?: string;
|
|
956
968
|
type: 'video';
|
|
957
969
|
} | {
|
|
958
970
|
items: Array<{
|
|
@@ -970,22 +982,26 @@ export declare type CreateMessageBody = {
|
|
|
970
982
|
type: 'image';
|
|
971
983
|
payload: {
|
|
972
984
|
imageUrl: string;
|
|
985
|
+
fileId?: string;
|
|
973
986
|
};
|
|
974
987
|
} | {
|
|
975
988
|
type: 'audio';
|
|
976
989
|
payload: {
|
|
977
990
|
audioUrl: string;
|
|
991
|
+
fileId?: string;
|
|
978
992
|
};
|
|
979
993
|
} | {
|
|
980
994
|
type: 'video';
|
|
981
995
|
payload: {
|
|
982
996
|
videoUrl: string;
|
|
997
|
+
fileId?: string;
|
|
983
998
|
};
|
|
984
999
|
} | {
|
|
985
1000
|
type: 'file';
|
|
986
1001
|
payload: {
|
|
987
1002
|
fileUrl: string;
|
|
988
1003
|
title?: string;
|
|
1004
|
+
fileId?: string;
|
|
989
1005
|
};
|
|
990
1006
|
} | {
|
|
991
1007
|
type: 'location';
|
|
@@ -1071,12 +1087,12 @@ export declare const createUser: ({ clientId, apiUrl, adminSecret, customHeaders
|
|
|
1071
1087
|
/**
|
|
1072
1088
|
* Creates a new [User](#schema_user)
|
|
1073
1089
|
*/
|
|
1074
|
-
declare const createUser_2: <ThrowOnError extends boolean = false>(options?: Options<CreateUserData, ThrowOnError>) => RequestResult<{
|
|
1075
|
-
|
|
1076
|
-
|
|
1090
|
+
declare const createUser_2: <ThrowOnError extends boolean = false>(options?: Options<CreateUserData, ThrowOnError>) => RequestResult< {
|
|
1091
|
+
user: User;
|
|
1092
|
+
key: string;
|
|
1077
1093
|
}, {
|
|
1078
|
-
|
|
1079
|
-
|
|
1094
|
+
user: User;
|
|
1095
|
+
key: string;
|
|
1080
1096
|
}, ThrowOnError>;
|
|
1081
1097
|
|
|
1082
1098
|
/**
|
|
@@ -1092,9 +1108,9 @@ export declare type CreateUserBody = {
|
|
|
1092
1108
|
*/
|
|
1093
1109
|
pictureUrl?: string;
|
|
1094
1110
|
/**
|
|
1095
|
-
* User data
|
|
1111
|
+
* User data. An object or a signed JWT token
|
|
1096
1112
|
*/
|
|
1097
|
-
userData?: {};
|
|
1113
|
+
userData?: {} | string;
|
|
1098
1114
|
};
|
|
1099
1115
|
|
|
1100
1116
|
export declare type CreateUserData = {
|
|
@@ -1149,10 +1165,10 @@ declare type Custom = {
|
|
|
1149
1165
|
/**
|
|
1150
1166
|
* Permanently deletes a [Conversation](#schema_conversation). It cannot be undone. Also immediately deletes corresponding [Messages](#schema_message).
|
|
1151
1167
|
*/
|
|
1152
|
-
declare const deleteConversation: <ThrowOnError extends boolean = false>(options: Options<DeleteConversationData, ThrowOnError>) => RequestResult<{
|
|
1153
|
-
|
|
1168
|
+
declare const deleteConversation: <ThrowOnError extends boolean = false>(options: Options<DeleteConversationData, ThrowOnError>) => RequestResult< {
|
|
1169
|
+
[key: string]: never;
|
|
1154
1170
|
}, {
|
|
1155
|
-
|
|
1171
|
+
[key: string]: never;
|
|
1156
1172
|
}, ThrowOnError>;
|
|
1157
1173
|
|
|
1158
1174
|
export declare type DeleteConversationData = {
|
|
@@ -1198,10 +1214,10 @@ export declare type DeleteConversationResponses = {
|
|
|
1198
1214
|
/**
|
|
1199
1215
|
* Permanently deletes a [Message](#schema_message). It cannot be undone.
|
|
1200
1216
|
*/
|
|
1201
|
-
declare const deleteMessage: <ThrowOnError extends boolean = false>(options: Options<DeleteMessageData, ThrowOnError>) => RequestResult<{
|
|
1202
|
-
|
|
1217
|
+
declare const deleteMessage: <ThrowOnError extends boolean = false>(options: Options<DeleteMessageData, ThrowOnError>) => RequestResult< {
|
|
1218
|
+
[key: string]: never;
|
|
1203
1219
|
}, {
|
|
1204
|
-
|
|
1220
|
+
[key: string]: never;
|
|
1205
1221
|
}, ThrowOnError>;
|
|
1206
1222
|
|
|
1207
1223
|
export declare type DeleteMessageData = {
|
|
@@ -1247,10 +1263,10 @@ export declare type DeleteMessageResponses = {
|
|
|
1247
1263
|
/**
|
|
1248
1264
|
* Permanently deletes a [User](#schema_user). It cannot be undone.
|
|
1249
1265
|
*/
|
|
1250
|
-
declare const deleteUser: <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => RequestResult<{
|
|
1251
|
-
|
|
1266
|
+
declare const deleteUser: <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => RequestResult< {
|
|
1267
|
+
[key: string]: never;
|
|
1252
1268
|
}, {
|
|
1253
|
-
|
|
1269
|
+
[key: string]: never;
|
|
1254
1270
|
}, ThrowOnError>;
|
|
1255
1271
|
|
|
1256
1272
|
export declare type DeleteUserData = {
|
|
@@ -1374,10 +1390,10 @@ export declare const generateUserKey: ({ adminSecret, expiresAt, userId, apiUrl,
|
|
|
1374
1390
|
/**
|
|
1375
1391
|
* Generates a new user authentication key. Can only be called by an administrator and when an admin key is configured.
|
|
1376
1392
|
*/
|
|
1377
|
-
declare const generateUserKey_2: <ThrowOnError extends boolean = false>(options?: Options<GenerateUserKeyData, ThrowOnError>) => RequestResult<{
|
|
1378
|
-
|
|
1393
|
+
declare const generateUserKey_2: <ThrowOnError extends boolean = false>(options?: Options<GenerateUserKeyData, ThrowOnError>) => RequestResult< {
|
|
1394
|
+
key: string;
|
|
1379
1395
|
}, {
|
|
1380
|
-
|
|
1396
|
+
key: string;
|
|
1381
1397
|
}, ThrowOnError>;
|
|
1382
1398
|
|
|
1383
1399
|
/**
|
|
@@ -1435,10 +1451,10 @@ export declare type GenerateUserKeyResponses = {
|
|
|
1435
1451
|
/**
|
|
1436
1452
|
* Retrieves the [Conversation](#schema_conversation) object for a valid identifier.
|
|
1437
1453
|
*/
|
|
1438
|
-
declare const getConversation: <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>) => RequestResult<{
|
|
1439
|
-
|
|
1454
|
+
declare const getConversation: <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>) => RequestResult< {
|
|
1455
|
+
conversation: Conversation;
|
|
1440
1456
|
}, {
|
|
1441
|
-
|
|
1457
|
+
conversation: Conversation;
|
|
1442
1458
|
}, ThrowOnError>;
|
|
1443
1459
|
|
|
1444
1460
|
export declare type GetConversationData = {
|
|
@@ -1484,10 +1500,10 @@ export declare type GetConversationResponses = {
|
|
|
1484
1500
|
/**
|
|
1485
1501
|
* Retrieves the [Event](#schema_event) object for a valid identifier.
|
|
1486
1502
|
*/
|
|
1487
|
-
declare const getEvent: <ThrowOnError extends boolean = false>(options: Options<GetEventData, ThrowOnError>) => RequestResult<{
|
|
1488
|
-
|
|
1503
|
+
declare const getEvent: <ThrowOnError extends boolean = false>(options: Options<GetEventData, ThrowOnError>) => RequestResult< {
|
|
1504
|
+
event: Event_2;
|
|
1489
1505
|
}, {
|
|
1490
|
-
|
|
1506
|
+
event: Event_2;
|
|
1491
1507
|
}, ThrowOnError>;
|
|
1492
1508
|
|
|
1493
1509
|
export declare type GetEventData = {
|
|
@@ -1533,10 +1549,10 @@ export declare type GetEventResponses = {
|
|
|
1533
1549
|
/**
|
|
1534
1550
|
* Retrieves the [Message](#schema_message) object for a valid identifier.
|
|
1535
1551
|
*/
|
|
1536
|
-
declare const getMessage: <ThrowOnError extends boolean = false>(options: Options<GetMessageData, ThrowOnError>) => RequestResult<{
|
|
1537
|
-
|
|
1552
|
+
declare const getMessage: <ThrowOnError extends boolean = false>(options: Options<GetMessageData, ThrowOnError>) => RequestResult< {
|
|
1553
|
+
message: Message;
|
|
1538
1554
|
}, {
|
|
1539
|
-
|
|
1555
|
+
message: Message;
|
|
1540
1556
|
}, ThrowOnError>;
|
|
1541
1557
|
|
|
1542
1558
|
export declare type GetMessageData = {
|
|
@@ -1582,10 +1598,10 @@ export declare type GetMessageResponses = {
|
|
|
1582
1598
|
/**
|
|
1583
1599
|
* Retrieves a [Participant](#schema_user) from a [Conversation](#schema_conversation).
|
|
1584
1600
|
*/
|
|
1585
|
-
declare const getParticipant: <ThrowOnError extends boolean = false>(options: Options<GetParticipantData, ThrowOnError>) => RequestResult<{
|
|
1586
|
-
|
|
1601
|
+
declare const getParticipant: <ThrowOnError extends boolean = false>(options: Options<GetParticipantData, ThrowOnError>) => RequestResult< {
|
|
1602
|
+
participant: User;
|
|
1587
1603
|
}, {
|
|
1588
|
-
|
|
1604
|
+
participant: User;
|
|
1589
1605
|
}, ThrowOnError>;
|
|
1590
1606
|
|
|
1591
1607
|
export declare type GetParticipantData = {
|
|
@@ -1635,10 +1651,10 @@ export declare type GetParticipantResponses = {
|
|
|
1635
1651
|
/**
|
|
1636
1652
|
* Retrieves the [User](#schema_user) object for a valid identifier.
|
|
1637
1653
|
*/
|
|
1638
|
-
declare const getUser: <ThrowOnError extends boolean = false>(options: Options<GetUserData, ThrowOnError>) => RequestResult<{
|
|
1639
|
-
|
|
1654
|
+
declare const getUser: <ThrowOnError extends boolean = false>(options: Options<GetUserData, ThrowOnError>) => RequestResult< {
|
|
1655
|
+
user: User;
|
|
1640
1656
|
}, {
|
|
1641
|
-
|
|
1657
|
+
user: User;
|
|
1642
1658
|
}, ThrowOnError>;
|
|
1643
1659
|
|
|
1644
1660
|
export declare type GetUserData = {
|
|
@@ -1699,10 +1715,10 @@ export declare const initialize: ({ conversationId, userToken, clientId, apiUrl,
|
|
|
1699
1715
|
/**
|
|
1700
1716
|
* Creates a SSE stream to receive messages and events. The first event will be a payload containing the conversation details.
|
|
1701
1717
|
*/
|
|
1702
|
-
declare const initializeConversation: <ThrowOnError extends boolean = false>(options?: Options<InitializeConversationData, ThrowOnError>) => RequestResult<{
|
|
1703
|
-
|
|
1718
|
+
declare const initializeConversation: <ThrowOnError extends boolean = false>(options?: Options<InitializeConversationData, ThrowOnError>) => RequestResult< {
|
|
1719
|
+
[key: string]: never;
|
|
1704
1720
|
}, {
|
|
1705
|
-
|
|
1721
|
+
[key: string]: never;
|
|
1706
1722
|
}, ThrowOnError>;
|
|
1707
1723
|
|
|
1708
1724
|
export declare type InitializeConversationData = {
|
|
@@ -1772,16 +1788,16 @@ declare class Interceptors<Interceptor> {
|
|
|
1772
1788
|
/**
|
|
1773
1789
|
* Retrieves the conversation's [Messages](#schema_message)
|
|
1774
1790
|
*/
|
|
1775
|
-
declare const listConversationMessages: <ThrowOnError extends boolean = false>(options: Options<ListConversationMessagesData, ThrowOnError>) => RequestResult<{
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1791
|
+
declare const listConversationMessages: <ThrowOnError extends boolean = false>(options: Options<ListConversationMessagesData, ThrowOnError>) => RequestResult< {
|
|
1792
|
+
messages: Array<Message>;
|
|
1793
|
+
meta: {
|
|
1794
|
+
nextToken?: string;
|
|
1795
|
+
};
|
|
1780
1796
|
}, {
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1797
|
+
messages: Array<Message>;
|
|
1798
|
+
meta: {
|
|
1799
|
+
nextToken?: string;
|
|
1800
|
+
};
|
|
1785
1801
|
}, ThrowOnError>;
|
|
1786
1802
|
|
|
1787
1803
|
export declare type ListConversationMessagesData = {
|
|
@@ -1844,276 +1860,292 @@ export declare type ListConversationMessagesResponses = {
|
|
|
1844
1860
|
/**
|
|
1845
1861
|
* Returns a list of [Conversation](#schema_conversation) objects
|
|
1846
1862
|
*/
|
|
1847
|
-
declare const listConversations: <ThrowOnError extends boolean = false>(options: Options<ListConversationsData, ThrowOnError>) => RequestResult<{
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1863
|
+
declare const listConversations: <ThrowOnError extends boolean = false>(options: Options<ListConversationsData, ThrowOnError>) => RequestResult< {
|
|
1864
|
+
conversations: Array<{
|
|
1865
|
+
id: string;
|
|
1866
|
+
createdAt: string;
|
|
1867
|
+
updatedAt: string;
|
|
1868
|
+
lastMessage?: {
|
|
1869
|
+
id: string;
|
|
1870
|
+
createdAt: string;
|
|
1871
|
+
payload: {
|
|
1872
|
+
audioUrl: string;
|
|
1873
|
+
fileId?: string;
|
|
1874
|
+
type: "audio";
|
|
1875
|
+
} | {
|
|
1876
|
+
title: string;
|
|
1877
|
+
subtitle?: string;
|
|
1878
|
+
imageUrl?: string;
|
|
1879
|
+
actions: Array<{
|
|
1880
|
+
action: "postback" | "url" | "say";
|
|
1881
|
+
label: string;
|
|
1882
|
+
value: string;
|
|
1883
|
+
}>;
|
|
1884
|
+
type: "card";
|
|
1885
|
+
} | {
|
|
1886
|
+
items: Array<{
|
|
1887
|
+
title: string;
|
|
1888
|
+
subtitle?: string;
|
|
1889
|
+
imageUrl?: string;
|
|
1890
|
+
actions: Array<{
|
|
1891
|
+
action: "postback" | "url" | "say";
|
|
1892
|
+
label: string;
|
|
1893
|
+
value: string;
|
|
1894
|
+
}>;
|
|
1895
|
+
}>;
|
|
1896
|
+
type: "carousel";
|
|
1897
|
+
} | {
|
|
1898
|
+
text: string;
|
|
1899
|
+
options: Array<{
|
|
1900
|
+
label: string;
|
|
1901
|
+
value: string;
|
|
1902
|
+
}>;
|
|
1903
|
+
disableFreeText?: boolean;
|
|
1904
|
+
type: "choice";
|
|
1905
|
+
} | {
|
|
1906
|
+
text: string;
|
|
1907
|
+
options: Array<{
|
|
1908
|
+
label: string;
|
|
1909
|
+
value: string;
|
|
1910
|
+
}>;
|
|
1911
|
+
disableFreeText?: boolean;
|
|
1912
|
+
type: "dropdown";
|
|
1913
|
+
} | {
|
|
1914
|
+
fileUrl: string;
|
|
1915
|
+
title?: string;
|
|
1916
|
+
fileId?: string;
|
|
1917
|
+
type: "file";
|
|
1918
|
+
} | {
|
|
1919
|
+
imageUrl: string;
|
|
1920
|
+
fileId?: string;
|
|
1921
|
+
type: "image";
|
|
1922
|
+
} | {
|
|
1923
|
+
latitude: number;
|
|
1924
|
+
longitude: number;
|
|
1925
|
+
address?: string;
|
|
1926
|
+
title?: string;
|
|
1927
|
+
type: "location";
|
|
1928
|
+
} | {
|
|
1929
|
+
text: string;
|
|
1930
|
+
value?: string;
|
|
1931
|
+
type: "text";
|
|
1932
|
+
} | {
|
|
1933
|
+
videoUrl: string;
|
|
1934
|
+
fileId?: string;
|
|
1935
|
+
type: "video";
|
|
1936
|
+
} | {
|
|
1937
|
+
items: Array<{
|
|
1938
|
+
type: "text";
|
|
1939
|
+
payload: {
|
|
1940
|
+
text: string;
|
|
1941
|
+
value?: string;
|
|
1942
|
+
};
|
|
1943
|
+
} | {
|
|
1944
|
+
type: "markdown";
|
|
1945
|
+
payload: {
|
|
1946
|
+
markdown: string;
|
|
1947
|
+
};
|
|
1948
|
+
} | {
|
|
1949
|
+
type: "image";
|
|
1950
|
+
payload: {
|
|
1951
|
+
imageUrl: string;
|
|
1952
|
+
fileId?: string;
|
|
1953
|
+
};
|
|
1954
|
+
} | {
|
|
1955
|
+
type: "audio";
|
|
1956
|
+
payload: {
|
|
1957
|
+
audioUrl: string;
|
|
1958
|
+
fileId?: string;
|
|
1959
|
+
};
|
|
1960
|
+
} | {
|
|
1961
|
+
type: "video";
|
|
1962
|
+
payload: {
|
|
1963
|
+
videoUrl: string;
|
|
1964
|
+
fileId?: string;
|
|
1965
|
+
};
|
|
1966
|
+
} | {
|
|
1967
|
+
type: "file";
|
|
1968
|
+
payload: {
|
|
1969
|
+
fileUrl: string;
|
|
1970
|
+
title?: string;
|
|
1971
|
+
fileId?: string;
|
|
1972
|
+
};
|
|
1973
|
+
} | {
|
|
1974
|
+
type: "location";
|
|
1975
|
+
payload: {
|
|
1976
|
+
latitude: number;
|
|
1977
|
+
longitude: number;
|
|
1978
|
+
address?: string;
|
|
1979
|
+
title?: string;
|
|
1980
|
+
};
|
|
1981
|
+
}>;
|
|
1982
|
+
type: "bloc";
|
|
1983
|
+
} | {
|
|
1984
|
+
markdown: string;
|
|
1985
|
+
type: "markdown";
|
|
1986
|
+
} | {
|
|
1987
|
+
url: string;
|
|
1988
|
+
name: string;
|
|
1989
|
+
data?: unknown;
|
|
1990
|
+
type: "custom";
|
|
1991
|
+
};
|
|
1992
|
+
userId: string;
|
|
1993
|
+
conversationId: string;
|
|
1994
|
+
metadata?: {};
|
|
1995
|
+
replyTo?: string;
|
|
1996
|
+
selectedBy?: string;
|
|
1997
|
+
feedback?: {
|
|
1998
|
+
value: "positive" | "negative";
|
|
1999
|
+
comment?: string;
|
|
2000
|
+
};
|
|
2001
|
+
};
|
|
2002
|
+
}>;
|
|
2003
|
+
meta: {
|
|
2004
|
+
nextToken?: string;
|
|
2005
|
+
};
|
|
1982
2006
|
}, {
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2007
|
+
conversations: Array<{
|
|
2008
|
+
id: string;
|
|
2009
|
+
createdAt: string;
|
|
2010
|
+
updatedAt: string;
|
|
2011
|
+
lastMessage?: {
|
|
2012
|
+
id: string;
|
|
2013
|
+
createdAt: string;
|
|
2014
|
+
payload: {
|
|
2015
|
+
audioUrl: string;
|
|
2016
|
+
fileId?: string;
|
|
2017
|
+
type: "audio";
|
|
2018
|
+
} | {
|
|
2019
|
+
title: string;
|
|
2020
|
+
subtitle?: string;
|
|
2021
|
+
imageUrl?: string;
|
|
2022
|
+
actions: Array<{
|
|
2023
|
+
action: "postback" | "url" | "say";
|
|
2024
|
+
label: string;
|
|
2025
|
+
value: string;
|
|
2026
|
+
}>;
|
|
2027
|
+
type: "card";
|
|
2028
|
+
} | {
|
|
2029
|
+
items: Array<{
|
|
2030
|
+
title: string;
|
|
2031
|
+
subtitle?: string;
|
|
2032
|
+
imageUrl?: string;
|
|
2033
|
+
actions: Array<{
|
|
2034
|
+
action: "postback" | "url" | "say";
|
|
2035
|
+
label: string;
|
|
2036
|
+
value: string;
|
|
2037
|
+
}>;
|
|
2038
|
+
}>;
|
|
2039
|
+
type: "carousel";
|
|
2040
|
+
} | {
|
|
2041
|
+
text: string;
|
|
2042
|
+
options: Array<{
|
|
2043
|
+
label: string;
|
|
2044
|
+
value: string;
|
|
2045
|
+
}>;
|
|
2046
|
+
disableFreeText?: boolean;
|
|
2047
|
+
type: "choice";
|
|
2048
|
+
} | {
|
|
2049
|
+
text: string;
|
|
2050
|
+
options: Array<{
|
|
2051
|
+
label: string;
|
|
2052
|
+
value: string;
|
|
2053
|
+
}>;
|
|
2054
|
+
disableFreeText?: boolean;
|
|
2055
|
+
type: "dropdown";
|
|
2056
|
+
} | {
|
|
2057
|
+
fileUrl: string;
|
|
2058
|
+
title?: string;
|
|
2059
|
+
fileId?: string;
|
|
2060
|
+
type: "file";
|
|
2061
|
+
} | {
|
|
2062
|
+
imageUrl: string;
|
|
2063
|
+
fileId?: string;
|
|
2064
|
+
type: "image";
|
|
2065
|
+
} | {
|
|
2066
|
+
latitude: number;
|
|
2067
|
+
longitude: number;
|
|
2068
|
+
address?: string;
|
|
2069
|
+
title?: string;
|
|
2070
|
+
type: "location";
|
|
2071
|
+
} | {
|
|
2072
|
+
text: string;
|
|
2073
|
+
value?: string;
|
|
2074
|
+
type: "text";
|
|
2075
|
+
} | {
|
|
2076
|
+
videoUrl: string;
|
|
2077
|
+
fileId?: string;
|
|
2078
|
+
type: "video";
|
|
2079
|
+
} | {
|
|
2080
|
+
items: Array<{
|
|
2081
|
+
type: "text";
|
|
2082
|
+
payload: {
|
|
2083
|
+
text: string;
|
|
2084
|
+
value?: string;
|
|
2085
|
+
};
|
|
2086
|
+
} | {
|
|
2087
|
+
type: "markdown";
|
|
2088
|
+
payload: {
|
|
2089
|
+
markdown: string;
|
|
2090
|
+
};
|
|
2091
|
+
} | {
|
|
2092
|
+
type: "image";
|
|
2093
|
+
payload: {
|
|
2094
|
+
imageUrl: string;
|
|
2095
|
+
fileId?: string;
|
|
2096
|
+
};
|
|
2097
|
+
} | {
|
|
2098
|
+
type: "audio";
|
|
2099
|
+
payload: {
|
|
2100
|
+
audioUrl: string;
|
|
2101
|
+
fileId?: string;
|
|
2102
|
+
};
|
|
2103
|
+
} | {
|
|
2104
|
+
type: "video";
|
|
2105
|
+
payload: {
|
|
2106
|
+
videoUrl: string;
|
|
2107
|
+
fileId?: string;
|
|
2108
|
+
};
|
|
2109
|
+
} | {
|
|
2110
|
+
type: "file";
|
|
2111
|
+
payload: {
|
|
2112
|
+
fileUrl: string;
|
|
2113
|
+
title?: string;
|
|
2114
|
+
fileId?: string;
|
|
2115
|
+
};
|
|
2116
|
+
} | {
|
|
2117
|
+
type: "location";
|
|
2118
|
+
payload: {
|
|
2119
|
+
latitude: number;
|
|
2120
|
+
longitude: number;
|
|
2121
|
+
address?: string;
|
|
2122
|
+
title?: string;
|
|
2123
|
+
};
|
|
2124
|
+
}>;
|
|
2125
|
+
type: "bloc";
|
|
2126
|
+
} | {
|
|
2127
|
+
markdown: string;
|
|
2128
|
+
type: "markdown";
|
|
2129
|
+
} | {
|
|
2130
|
+
url: string;
|
|
2131
|
+
name: string;
|
|
2132
|
+
data?: unknown;
|
|
2133
|
+
type: "custom";
|
|
2134
|
+
};
|
|
2135
|
+
userId: string;
|
|
2136
|
+
conversationId: string;
|
|
2137
|
+
metadata?: {};
|
|
2138
|
+
replyTo?: string;
|
|
2139
|
+
selectedBy?: string;
|
|
2140
|
+
feedback?: {
|
|
2141
|
+
value: "positive" | "negative";
|
|
2142
|
+
comment?: string;
|
|
2143
|
+
};
|
|
2144
|
+
};
|
|
2145
|
+
}>;
|
|
2146
|
+
meta: {
|
|
2147
|
+
nextToken?: string;
|
|
2148
|
+
};
|
|
2117
2149
|
}, ThrowOnError>;
|
|
2118
2150
|
|
|
2119
2151
|
export declare type ListConversationsData = {
|
|
@@ -2171,6 +2203,7 @@ export declare type ListConversationsErrors = {
|
|
|
2171
2203
|
*/
|
|
2172
2204
|
payload: {
|
|
2173
2205
|
audioUrl: string;
|
|
2206
|
+
fileId?: string;
|
|
2174
2207
|
type: 'audio';
|
|
2175
2208
|
} | {
|
|
2176
2209
|
title: string;
|
|
@@ -2213,9 +2246,11 @@ export declare type ListConversationsErrors = {
|
|
|
2213
2246
|
} | {
|
|
2214
2247
|
fileUrl: string;
|
|
2215
2248
|
title?: string;
|
|
2249
|
+
fileId?: string;
|
|
2216
2250
|
type: 'file';
|
|
2217
2251
|
} | {
|
|
2218
2252
|
imageUrl: string;
|
|
2253
|
+
fileId?: string;
|
|
2219
2254
|
type: 'image';
|
|
2220
2255
|
} | {
|
|
2221
2256
|
latitude: number;
|
|
@@ -2229,6 +2264,7 @@ export declare type ListConversationsErrors = {
|
|
|
2229
2264
|
type: 'text';
|
|
2230
2265
|
} | {
|
|
2231
2266
|
videoUrl: string;
|
|
2267
|
+
fileId?: string;
|
|
2232
2268
|
type: 'video';
|
|
2233
2269
|
} | {
|
|
2234
2270
|
items: Array<{
|
|
@@ -2246,22 +2282,26 @@ export declare type ListConversationsErrors = {
|
|
|
2246
2282
|
type: 'image';
|
|
2247
2283
|
payload: {
|
|
2248
2284
|
imageUrl: string;
|
|
2285
|
+
fileId?: string;
|
|
2249
2286
|
};
|
|
2250
2287
|
} | {
|
|
2251
2288
|
type: 'audio';
|
|
2252
2289
|
payload: {
|
|
2253
2290
|
audioUrl: string;
|
|
2291
|
+
fileId?: string;
|
|
2254
2292
|
};
|
|
2255
2293
|
} | {
|
|
2256
2294
|
type: 'video';
|
|
2257
2295
|
payload: {
|
|
2258
2296
|
videoUrl: string;
|
|
2297
|
+
fileId?: string;
|
|
2259
2298
|
};
|
|
2260
2299
|
} | {
|
|
2261
2300
|
type: 'file';
|
|
2262
2301
|
payload: {
|
|
2263
2302
|
fileUrl: string;
|
|
2264
2303
|
title?: string;
|
|
2304
|
+
fileId?: string;
|
|
2265
2305
|
};
|
|
2266
2306
|
} | {
|
|
2267
2307
|
type: 'location';
|
|
@@ -2357,6 +2397,7 @@ export declare type ListConversationsResponses = {
|
|
|
2357
2397
|
*/
|
|
2358
2398
|
payload: {
|
|
2359
2399
|
audioUrl: string;
|
|
2400
|
+
fileId?: string;
|
|
2360
2401
|
type: 'audio';
|
|
2361
2402
|
} | {
|
|
2362
2403
|
title: string;
|
|
@@ -2399,9 +2440,11 @@ export declare type ListConversationsResponses = {
|
|
|
2399
2440
|
} | {
|
|
2400
2441
|
fileUrl: string;
|
|
2401
2442
|
title?: string;
|
|
2443
|
+
fileId?: string;
|
|
2402
2444
|
type: 'file';
|
|
2403
2445
|
} | {
|
|
2404
2446
|
imageUrl: string;
|
|
2447
|
+
fileId?: string;
|
|
2405
2448
|
type: 'image';
|
|
2406
2449
|
} | {
|
|
2407
2450
|
latitude: number;
|
|
@@ -2415,6 +2458,7 @@ export declare type ListConversationsResponses = {
|
|
|
2415
2458
|
type: 'text';
|
|
2416
2459
|
} | {
|
|
2417
2460
|
videoUrl: string;
|
|
2461
|
+
fileId?: string;
|
|
2418
2462
|
type: 'video';
|
|
2419
2463
|
} | {
|
|
2420
2464
|
items: Array<{
|
|
@@ -2432,22 +2476,26 @@ export declare type ListConversationsResponses = {
|
|
|
2432
2476
|
type: 'image';
|
|
2433
2477
|
payload: {
|
|
2434
2478
|
imageUrl: string;
|
|
2479
|
+
fileId?: string;
|
|
2435
2480
|
};
|
|
2436
2481
|
} | {
|
|
2437
2482
|
type: 'audio';
|
|
2438
2483
|
payload: {
|
|
2439
2484
|
audioUrl: string;
|
|
2485
|
+
fileId?: string;
|
|
2440
2486
|
};
|
|
2441
2487
|
} | {
|
|
2442
2488
|
type: 'video';
|
|
2443
2489
|
payload: {
|
|
2444
2490
|
videoUrl: string;
|
|
2491
|
+
fileId?: string;
|
|
2445
2492
|
};
|
|
2446
2493
|
} | {
|
|
2447
2494
|
type: 'file';
|
|
2448
2495
|
payload: {
|
|
2449
2496
|
fileUrl: string;
|
|
2450
2497
|
title?: string;
|
|
2498
|
+
fileId?: string;
|
|
2451
2499
|
};
|
|
2452
2500
|
} | {
|
|
2453
2501
|
type: 'location';
|
|
@@ -2509,10 +2557,10 @@ export declare type ListConversationsResponses = {
|
|
|
2509
2557
|
/**
|
|
2510
2558
|
* Creates a SSE stream to receive messages and events from a conversation
|
|
2511
2559
|
*/
|
|
2512
|
-
declare const listenConversation: <ThrowOnError extends boolean = false>(options: Options<ListenConversationData, ThrowOnError>) => RequestResult<{
|
|
2513
|
-
|
|
2560
|
+
declare const listenConversation: <ThrowOnError extends boolean = false>(options: Options<ListenConversationData, ThrowOnError>) => RequestResult< {
|
|
2561
|
+
[key: string]: never;
|
|
2514
2562
|
}, {
|
|
2515
|
-
|
|
2563
|
+
[key: string]: never;
|
|
2516
2564
|
}, ThrowOnError>;
|
|
2517
2565
|
|
|
2518
2566
|
export declare type ListenConversationData = {
|
|
@@ -2558,16 +2606,16 @@ export declare type ListenConversationResponses = {
|
|
|
2558
2606
|
/**
|
|
2559
2607
|
* Retrieves a list of [Participants](#schema_user) for a given [Conversation](#schema_conversation).
|
|
2560
2608
|
*/
|
|
2561
|
-
declare const listParticipants: <ThrowOnError extends boolean = false>(options: Options<ListParticipantsData, ThrowOnError>) => RequestResult<{
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2609
|
+
declare const listParticipants: <ThrowOnError extends boolean = false>(options: Options<ListParticipantsData, ThrowOnError>) => RequestResult< {
|
|
2610
|
+
participants: Array<User>;
|
|
2611
|
+
meta: {
|
|
2612
|
+
nextToken?: string;
|
|
2613
|
+
};
|
|
2566
2614
|
}, {
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2615
|
+
participants: Array<User>;
|
|
2616
|
+
meta: {
|
|
2617
|
+
nextToken?: string;
|
|
2618
|
+
};
|
|
2571
2619
|
}, ThrowOnError>;
|
|
2572
2620
|
|
|
2573
2621
|
export declare type ListParticipantsData = {
|
|
@@ -2644,6 +2692,7 @@ export declare type Message = {
|
|
|
2644
2692
|
*/
|
|
2645
2693
|
payload: {
|
|
2646
2694
|
audioUrl: string;
|
|
2695
|
+
fileId?: string;
|
|
2647
2696
|
type: 'audio';
|
|
2648
2697
|
} | {
|
|
2649
2698
|
title: string;
|
|
@@ -2686,9 +2735,11 @@ export declare type Message = {
|
|
|
2686
2735
|
} | {
|
|
2687
2736
|
fileUrl: string;
|
|
2688
2737
|
title?: string;
|
|
2738
|
+
fileId?: string;
|
|
2689
2739
|
type: 'file';
|
|
2690
2740
|
} | {
|
|
2691
2741
|
imageUrl: string;
|
|
2742
|
+
fileId?: string;
|
|
2692
2743
|
type: 'image';
|
|
2693
2744
|
} | {
|
|
2694
2745
|
latitude: number;
|
|
@@ -2702,6 +2753,7 @@ export declare type Message = {
|
|
|
2702
2753
|
type: 'text';
|
|
2703
2754
|
} | {
|
|
2704
2755
|
videoUrl: string;
|
|
2756
|
+
fileId?: string;
|
|
2705
2757
|
type: 'video';
|
|
2706
2758
|
} | {
|
|
2707
2759
|
items: Array<{
|
|
@@ -2719,22 +2771,26 @@ export declare type Message = {
|
|
|
2719
2771
|
type: 'image';
|
|
2720
2772
|
payload: {
|
|
2721
2773
|
imageUrl: string;
|
|
2774
|
+
fileId?: string;
|
|
2722
2775
|
};
|
|
2723
2776
|
} | {
|
|
2724
2777
|
type: 'audio';
|
|
2725
2778
|
payload: {
|
|
2726
2779
|
audioUrl: string;
|
|
2780
|
+
fileId?: string;
|
|
2727
2781
|
};
|
|
2728
2782
|
} | {
|
|
2729
2783
|
type: 'video';
|
|
2730
2784
|
payload: {
|
|
2731
2785
|
videoUrl: string;
|
|
2786
|
+
fileId?: string;
|
|
2732
2787
|
};
|
|
2733
2788
|
} | {
|
|
2734
2789
|
type: 'file';
|
|
2735
2790
|
payload: {
|
|
2736
2791
|
fileUrl: string;
|
|
2737
2792
|
title?: string;
|
|
2793
|
+
fileId?: string;
|
|
2738
2794
|
};
|
|
2739
2795
|
} | {
|
|
2740
2796
|
type: 'location';
|
|
@@ -3444,10 +3500,10 @@ declare interface QuerySerializerOptions {
|
|
|
3444
3500
|
/**
|
|
3445
3501
|
* Removes feedback from a [Message](#schema_message).
|
|
3446
3502
|
*/
|
|
3447
|
-
declare const removeMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<RemoveMessageFeedbackData, ThrowOnError>) => RequestResult<{
|
|
3448
|
-
|
|
3503
|
+
declare const removeMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<RemoveMessageFeedbackData, ThrowOnError>) => RequestResult< {
|
|
3504
|
+
[key: string]: never;
|
|
3449
3505
|
}, {
|
|
3450
|
-
|
|
3506
|
+
[key: string]: never;
|
|
3451
3507
|
}, ThrowOnError>;
|
|
3452
3508
|
|
|
3453
3509
|
export declare type RemoveMessageFeedbackData = {
|
|
@@ -3493,10 +3549,10 @@ export declare type RemoveMessageFeedbackResponses = {
|
|
|
3493
3549
|
/**
|
|
3494
3550
|
* Remove a [Participant](#schema_user) from a [Conversation](#schema_conversation).
|
|
3495
3551
|
*/
|
|
3496
|
-
declare const removeParticipant: <ThrowOnError extends boolean = false>(options: Options<RemoveParticipantData, ThrowOnError>) => RequestResult<{
|
|
3497
|
-
|
|
3552
|
+
declare const removeParticipant: <ThrowOnError extends boolean = false>(options: Options<RemoveParticipantData, ThrowOnError>) => RequestResult< {
|
|
3553
|
+
[key: string]: never;
|
|
3498
3554
|
}, {
|
|
3499
|
-
|
|
3555
|
+
[key: string]: never;
|
|
3500
3556
|
}, ThrowOnError>;
|
|
3501
3557
|
|
|
3502
3558
|
export declare type RemoveParticipantData = {
|
|
@@ -3585,10 +3641,10 @@ declare type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, o
|
|
|
3585
3641
|
/**
|
|
3586
3642
|
* Updates a [Message](#schema_message) sent by any user to mark it as already selected. A message can only be selected once.
|
|
3587
3643
|
*/
|
|
3588
|
-
declare const selectMessage: <ThrowOnError extends boolean = false>(options: Options<SelectMessageData, ThrowOnError>) => RequestResult<{
|
|
3589
|
-
|
|
3644
|
+
declare const selectMessage: <ThrowOnError extends boolean = false>(options: Options<SelectMessageData, ThrowOnError>) => RequestResult< {
|
|
3645
|
+
[key: string]: never;
|
|
3590
3646
|
}, {
|
|
3591
|
-
|
|
3647
|
+
[key: string]: never;
|
|
3592
3648
|
}, ThrowOnError>;
|
|
3593
3649
|
|
|
3594
3650
|
/**
|
|
@@ -3648,10 +3704,10 @@ export declare const sendPerfMetrics: (clientId: string, body: ClientTypes_2.Sen
|
|
|
3648
3704
|
/**
|
|
3649
3705
|
* Sends performance metrics to the server.
|
|
3650
3706
|
*/
|
|
3651
|
-
declare const sendPerfMetrics_2: <ThrowOnError extends boolean = false>(options?: Options<SendPerfMetricsData, ThrowOnError>) => RequestResult<{
|
|
3652
|
-
|
|
3707
|
+
declare const sendPerfMetrics_2: <ThrowOnError extends boolean = false>(options?: Options<SendPerfMetricsData, ThrowOnError>) => RequestResult< {
|
|
3708
|
+
[key: string]: never;
|
|
3653
3709
|
}, {
|
|
3654
|
-
|
|
3710
|
+
[key: string]: never;
|
|
3655
3711
|
}, ThrowOnError>;
|
|
3656
3712
|
|
|
3657
3713
|
/**
|
|
@@ -3728,10 +3784,10 @@ declare type TypingStopped = {
|
|
|
3728
3784
|
/**
|
|
3729
3785
|
* Updates a [Message](#schema_message). The bot won't be aware of the changes.
|
|
3730
3786
|
*/
|
|
3731
|
-
declare const updateMessage: <ThrowOnError extends boolean = false>(options: Options<UpdateMessageData, ThrowOnError>) => RequestResult<{
|
|
3732
|
-
|
|
3787
|
+
declare const updateMessage: <ThrowOnError extends boolean = false>(options: Options<UpdateMessageData, ThrowOnError>) => RequestResult< {
|
|
3788
|
+
message: Message;
|
|
3733
3789
|
}, {
|
|
3734
|
-
|
|
3790
|
+
message: Message;
|
|
3735
3791
|
}, ThrowOnError>;
|
|
3736
3792
|
|
|
3737
3793
|
/**
|
|
@@ -3743,6 +3799,7 @@ export declare type UpdateMessageBody = {
|
|
|
3743
3799
|
*/
|
|
3744
3800
|
payload?: {
|
|
3745
3801
|
audioUrl: string;
|
|
3802
|
+
fileId?: string;
|
|
3746
3803
|
type: 'audio';
|
|
3747
3804
|
} | {
|
|
3748
3805
|
title: string;
|
|
@@ -3785,9 +3842,11 @@ export declare type UpdateMessageBody = {
|
|
|
3785
3842
|
} | {
|
|
3786
3843
|
fileUrl: string;
|
|
3787
3844
|
title?: string;
|
|
3845
|
+
fileId?: string;
|
|
3788
3846
|
type: 'file';
|
|
3789
3847
|
} | {
|
|
3790
3848
|
imageUrl: string;
|
|
3849
|
+
fileId?: string;
|
|
3791
3850
|
type: 'image';
|
|
3792
3851
|
} | {
|
|
3793
3852
|
latitude: number;
|
|
@@ -3801,6 +3860,7 @@ export declare type UpdateMessageBody = {
|
|
|
3801
3860
|
type: 'text';
|
|
3802
3861
|
} | {
|
|
3803
3862
|
videoUrl: string;
|
|
3863
|
+
fileId?: string;
|
|
3804
3864
|
type: 'video';
|
|
3805
3865
|
} | {
|
|
3806
3866
|
items: Array<{
|
|
@@ -3818,22 +3878,26 @@ export declare type UpdateMessageBody = {
|
|
|
3818
3878
|
type: 'image';
|
|
3819
3879
|
payload: {
|
|
3820
3880
|
imageUrl: string;
|
|
3881
|
+
fileId?: string;
|
|
3821
3882
|
};
|
|
3822
3883
|
} | {
|
|
3823
3884
|
type: 'audio';
|
|
3824
3885
|
payload: {
|
|
3825
3886
|
audioUrl: string;
|
|
3887
|
+
fileId?: string;
|
|
3826
3888
|
};
|
|
3827
3889
|
} | {
|
|
3828
3890
|
type: 'video';
|
|
3829
3891
|
payload: {
|
|
3830
3892
|
videoUrl: string;
|
|
3893
|
+
fileId?: string;
|
|
3831
3894
|
};
|
|
3832
3895
|
} | {
|
|
3833
3896
|
type: 'file';
|
|
3834
3897
|
payload: {
|
|
3835
3898
|
fileUrl: string;
|
|
3836
3899
|
title?: string;
|
|
3900
|
+
fileId?: string;
|
|
3837
3901
|
};
|
|
3838
3902
|
} | {
|
|
3839
3903
|
type: 'location';
|
|
@@ -3906,10 +3970,10 @@ export declare type UpdateMessageResponses = {
|
|
|
3906
3970
|
/**
|
|
3907
3971
|
* Update [User](#schema_user)
|
|
3908
3972
|
*/
|
|
3909
|
-
declare const updateUser: <ThrowOnError extends boolean = false>(options: Options<UpdateUserData, ThrowOnError>) => RequestResult<{
|
|
3910
|
-
|
|
3973
|
+
declare const updateUser: <ThrowOnError extends boolean = false>(options: Options<UpdateUserData, ThrowOnError>) => RequestResult< {
|
|
3974
|
+
user: User;
|
|
3911
3975
|
}, {
|
|
3912
|
-
|
|
3976
|
+
user: User;
|
|
3913
3977
|
}, ThrowOnError>;
|
|
3914
3978
|
|
|
3915
3979
|
/**
|
|
@@ -3925,9 +3989,9 @@ export declare type UpdateUserBody = {
|
|
|
3925
3989
|
*/
|
|
3926
3990
|
pictureUrl?: string;
|
|
3927
3991
|
/**
|
|
3928
|
-
* User data
|
|
3992
|
+
* User data. An object or a signed JWT token
|
|
3929
3993
|
*/
|
|
3930
|
-
userData?: {} | null;
|
|
3994
|
+
userData?: {} | string | null;
|
|
3931
3995
|
};
|
|
3932
3996
|
|
|
3933
3997
|
export declare type UpdateUserData = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/webchat-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"eventsource": "^3.0.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@bpinternal/webchat-http-client": "0.
|
|
33
|
+
"@bpinternal/webchat-http-client": "0.10.0",
|
|
34
34
|
"@hey-api/client-fetch": "^0.10.0",
|
|
35
35
|
"@hey-api/openapi-ts": "^0.66.4",
|
|
36
36
|
"@repo/eslint-config": "workspace:*",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"glob": "^11.0.1",
|
|
41
41
|
"rollup-plugin-tree-shakeable": "^1.0.3",
|
|
42
42
|
"vite": "^5.4.8",
|
|
43
|
-
"vite-plugin-dts": "^
|
|
43
|
+
"vite-plugin-dts": "^4.5.4"
|
|
44
44
|
}
|
|
45
45
|
}
|
package/src/client/client.ts
CHANGED
|
@@ -65,7 +65,7 @@ export type Client = {
|
|
|
65
65
|
deleteMessage: (params: MessageIdParam) => Promise<ClientTypes.DeleteMessageResponse>
|
|
66
66
|
createFile: (params: ClientTypes.CreateFileBody) => Promise<ClientTypes.CreateFileResponse>
|
|
67
67
|
getUser: () => Promise<ClientTypes.GetUserResponse>
|
|
68
|
-
updateUser: (params: ClientTypes.
|
|
68
|
+
updateUser: (params: ClientTypes.UpdateUserBody) => Promise<ClientTypes.UpdateUserResponse>
|
|
69
69
|
deleteUser: (params: UserIdParam) => Promise<ClientTypes.DeleteUserResponse>
|
|
70
70
|
createEvent: (params: ClientTypes.CreateEventBody) => Promise<ClientTypes.CreateEventResponse>
|
|
71
71
|
getEvent: (params: EventIdParam) => Promise<ClientTypes.GetEventResponse>
|