@botpress/webchat-client 0.3.1 → 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/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
- [key: string]: never;
4
+ declare const addMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<AddMessageFeedbackData, ThrowOnError>) => RequestResult< {
5
+ [key: string]: never;
6
6
  }, {
7
- [key: string]: never;
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
- participant: User;
64
+ declare const addParticipant: <ThrowOnError extends boolean = false>(options: Options<AddParticipantData, ThrowOnError>) => RequestResult< {
65
+ participant: User;
66
66
  }, {
67
- participant: User;
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.CreateUserBody) => Promise<ClientTypes_2.UpdateUserResponse>;
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>;
@@ -496,6 +496,170 @@ export declare type Conversation = {
496
496
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
497
497
  */
498
498
  updatedAt: string;
499
+ /**
500
+ * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation)
501
+ */
502
+ lastMessage?: {
503
+ /**
504
+ * Id of the [Message](#schema_message)
505
+ */
506
+ id: string;
507
+ /**
508
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
509
+ */
510
+ createdAt: string;
511
+ /**
512
+ * Payload is the content of the message.
513
+ */
514
+ payload: {
515
+ audioUrl: string;
516
+ fileId?: string;
517
+ type: 'audio';
518
+ } | {
519
+ title: string;
520
+ subtitle?: string;
521
+ imageUrl?: string;
522
+ actions: Array<{
523
+ action: 'postback' | 'url' | 'say';
524
+ label: string;
525
+ value: string;
526
+ }>;
527
+ type: 'card';
528
+ } | {
529
+ items: Array<{
530
+ title: string;
531
+ subtitle?: string;
532
+ imageUrl?: string;
533
+ actions: Array<{
534
+ action: 'postback' | 'url' | 'say';
535
+ label: string;
536
+ value: string;
537
+ }>;
538
+ }>;
539
+ type: 'carousel';
540
+ } | {
541
+ text: string;
542
+ options: Array<{
543
+ label: string;
544
+ value: string;
545
+ }>;
546
+ disableFreeText?: boolean;
547
+ type: 'choice';
548
+ } | {
549
+ text: string;
550
+ options: Array<{
551
+ label: string;
552
+ value: string;
553
+ }>;
554
+ disableFreeText?: boolean;
555
+ type: 'dropdown';
556
+ } | {
557
+ fileUrl: string;
558
+ title?: string;
559
+ fileId?: string;
560
+ type: 'file';
561
+ } | {
562
+ imageUrl: string;
563
+ fileId?: string;
564
+ type: 'image';
565
+ } | {
566
+ latitude: number;
567
+ longitude: number;
568
+ address?: string;
569
+ title?: string;
570
+ type: 'location';
571
+ } | {
572
+ text: string;
573
+ value?: string;
574
+ type: 'text';
575
+ } | {
576
+ videoUrl: string;
577
+ fileId?: string;
578
+ type: 'video';
579
+ } | {
580
+ items: Array<{
581
+ type: 'text';
582
+ payload: {
583
+ text: string;
584
+ value?: string;
585
+ };
586
+ } | {
587
+ type: 'markdown';
588
+ payload: {
589
+ markdown: string;
590
+ };
591
+ } | {
592
+ type: 'image';
593
+ payload: {
594
+ imageUrl: string;
595
+ fileId?: string;
596
+ };
597
+ } | {
598
+ type: 'audio';
599
+ payload: {
600
+ audioUrl: string;
601
+ fileId?: string;
602
+ };
603
+ } | {
604
+ type: 'video';
605
+ payload: {
606
+ videoUrl: string;
607
+ fileId?: string;
608
+ };
609
+ } | {
610
+ type: 'file';
611
+ payload: {
612
+ fileUrl: string;
613
+ title?: string;
614
+ fileId?: string;
615
+ };
616
+ } | {
617
+ type: 'location';
618
+ payload: {
619
+ latitude: number;
620
+ longitude: number;
621
+ address?: string;
622
+ title?: string;
623
+ };
624
+ }>;
625
+ type: 'bloc';
626
+ } | {
627
+ markdown: string;
628
+ type: 'markdown';
629
+ } | {
630
+ url: string;
631
+ name: string;
632
+ data?: unknown;
633
+ type: 'custom';
634
+ };
635
+ /**
636
+ * ID of the [User](#schema_user)
637
+ */
638
+ userId: string;
639
+ /**
640
+ * ID of the [Conversation](#schema_conversation)
641
+ */
642
+ conversationId: string;
643
+ /**
644
+ * Metadata of the message
645
+ */
646
+ metadata?: {};
647
+ /**
648
+ * ID of the message this message is replying to
649
+ */
650
+ replyTo?: string;
651
+ /**
652
+ * ID of the user who selected this message. Undefined if not selected.
653
+ */
654
+ selectedBy?: string;
655
+ /**
656
+ * Feedback of the message
657
+ */
658
+ feedback?: {
659
+ value: 'positive' | 'negative';
660
+ comment?: string;
661
+ };
662
+ };
499
663
  };
500
664
 
501
665
  declare type ConversationIdParam = {
@@ -512,10 +676,10 @@ export declare const createClient: ({ userKey, clientId, apiUrl, customHeaders,
512
676
  /**
513
677
  * Creates a new [Conversation](#schema_conversation)
514
678
  */
515
- declare const createConversation: <ThrowOnError extends boolean = false>(options: Options<CreateConversationData, ThrowOnError>) => RequestResult<{
516
- conversation: Conversation;
679
+ declare const createConversation: <ThrowOnError extends boolean = false>(options: Options<CreateConversationData, ThrowOnError>) => RequestResult< {
680
+ conversation: Conversation;
517
681
  }, {
518
- conversation: Conversation;
682
+ conversation: Conversation;
519
683
  }, ThrowOnError>;
520
684
 
521
685
  /**
@@ -566,10 +730,10 @@ export declare type CreateConversationResponses = {
566
730
  /**
567
731
  * Creates a new [Event](#schema_event)
568
732
  */
569
- declare const createEvent: <ThrowOnError extends boolean = false>(options: Options<CreateEventData, ThrowOnError>) => RequestResult<{
570
- event: Event_2;
733
+ declare const createEvent: <ThrowOnError extends boolean = false>(options: Options<CreateEventData, ThrowOnError>) => RequestResult< {
734
+ event: Event_2;
571
735
  }, {
572
- event: Event_2;
736
+ event: Event_2;
573
737
  }, ThrowOnError>;
574
738
 
575
739
  /**
@@ -641,10 +805,10 @@ export declare type CreateEventResponses = {
641
805
  /**
642
806
  * Creates a new file and returns it's upload URL.
643
807
  */
644
- declare const createFile: <ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>) => RequestResult<{
645
- file: File_2;
808
+ declare const createFile: <ThrowOnError extends boolean = false>(options: Options<CreateFileData, ThrowOnError>) => RequestResult< {
809
+ file: File_2;
646
810
  }, {
647
- file: File_2;
811
+ file: File_2;
648
812
  }, ThrowOnError>;
649
813
 
650
814
  /**
@@ -724,10 +888,10 @@ export declare type CreateFileResponses = {
724
888
  /**
725
889
  * Creates a new [Message](#schema_message)
726
890
  */
727
- declare const createMessage: <ThrowOnError extends boolean = false>(options: Options<CreateMessageData, ThrowOnError>) => RequestResult<{
728
- message: Message;
891
+ declare const createMessage: <ThrowOnError extends boolean = false>(options: Options<CreateMessageData, ThrowOnError>) => RequestResult< {
892
+ message: Message;
729
893
  }, {
730
- message: Message;
894
+ message: Message;
731
895
  }, ThrowOnError>;
732
896
 
733
897
  /**
@@ -739,6 +903,7 @@ export declare type CreateMessageBody = {
739
903
  */
740
904
  payload: {
741
905
  audioUrl: string;
906
+ fileId?: string;
742
907
  type: 'audio';
743
908
  } | {
744
909
  title: string;
@@ -781,9 +946,11 @@ export declare type CreateMessageBody = {
781
946
  } | {
782
947
  fileUrl: string;
783
948
  title?: string;
949
+ fileId?: string;
784
950
  type: 'file';
785
951
  } | {
786
952
  imageUrl: string;
953
+ fileId?: string;
787
954
  type: 'image';
788
955
  } | {
789
956
  latitude: number;
@@ -797,6 +964,7 @@ export declare type CreateMessageBody = {
797
964
  type: 'text';
798
965
  } | {
799
966
  videoUrl: string;
967
+ fileId?: string;
800
968
  type: 'video';
801
969
  } | {
802
970
  items: Array<{
@@ -814,22 +982,26 @@ export declare type CreateMessageBody = {
814
982
  type: 'image';
815
983
  payload: {
816
984
  imageUrl: string;
985
+ fileId?: string;
817
986
  };
818
987
  } | {
819
988
  type: 'audio';
820
989
  payload: {
821
990
  audioUrl: string;
991
+ fileId?: string;
822
992
  };
823
993
  } | {
824
994
  type: 'video';
825
995
  payload: {
826
996
  videoUrl: string;
997
+ fileId?: string;
827
998
  };
828
999
  } | {
829
1000
  type: 'file';
830
1001
  payload: {
831
1002
  fileUrl: string;
832
1003
  title?: string;
1004
+ fileId?: string;
833
1005
  };
834
1006
  } | {
835
1007
  type: 'location';
@@ -915,12 +1087,12 @@ export declare const createUser: ({ clientId, apiUrl, adminSecret, customHeaders
915
1087
  /**
916
1088
  * Creates a new [User](#schema_user)
917
1089
  */
918
- declare const createUser_2: <ThrowOnError extends boolean = false>(options?: Options<CreateUserData, ThrowOnError>) => RequestResult<{
919
- user: User;
920
- key: string;
1090
+ declare const createUser_2: <ThrowOnError extends boolean = false>(options?: Options<CreateUserData, ThrowOnError>) => RequestResult< {
1091
+ user: User;
1092
+ key: string;
921
1093
  }, {
922
- user: User;
923
- key: string;
1094
+ user: User;
1095
+ key: string;
924
1096
  }, ThrowOnError>;
925
1097
 
926
1098
  /**
@@ -936,9 +1108,9 @@ export declare type CreateUserBody = {
936
1108
  */
937
1109
  pictureUrl?: string;
938
1110
  /**
939
- * User data
1111
+ * User data. An object or a signed JWT token
940
1112
  */
941
- userData?: {};
1113
+ userData?: {} | string;
942
1114
  };
943
1115
 
944
1116
  export declare type CreateUserData = {
@@ -993,10 +1165,10 @@ declare type Custom = {
993
1165
  /**
994
1166
  * Permanently deletes a [Conversation](#schema_conversation). It cannot be undone. Also immediately deletes corresponding [Messages](#schema_message).
995
1167
  */
996
- declare const deleteConversation: <ThrowOnError extends boolean = false>(options: Options<DeleteConversationData, ThrowOnError>) => RequestResult<{
997
- [key: string]: never;
1168
+ declare const deleteConversation: <ThrowOnError extends boolean = false>(options: Options<DeleteConversationData, ThrowOnError>) => RequestResult< {
1169
+ [key: string]: never;
998
1170
  }, {
999
- [key: string]: never;
1171
+ [key: string]: never;
1000
1172
  }, ThrowOnError>;
1001
1173
 
1002
1174
  export declare type DeleteConversationData = {
@@ -1042,10 +1214,10 @@ export declare type DeleteConversationResponses = {
1042
1214
  /**
1043
1215
  * Permanently deletes a [Message](#schema_message). It cannot be undone.
1044
1216
  */
1045
- declare const deleteMessage: <ThrowOnError extends boolean = false>(options: Options<DeleteMessageData, ThrowOnError>) => RequestResult<{
1046
- [key: string]: never;
1217
+ declare const deleteMessage: <ThrowOnError extends boolean = false>(options: Options<DeleteMessageData, ThrowOnError>) => RequestResult< {
1218
+ [key: string]: never;
1047
1219
  }, {
1048
- [key: string]: never;
1220
+ [key: string]: never;
1049
1221
  }, ThrowOnError>;
1050
1222
 
1051
1223
  export declare type DeleteMessageData = {
@@ -1091,10 +1263,10 @@ export declare type DeleteMessageResponses = {
1091
1263
  /**
1092
1264
  * Permanently deletes a [User](#schema_user). It cannot be undone.
1093
1265
  */
1094
- declare const deleteUser: <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => RequestResult<{
1095
- [key: string]: never;
1266
+ declare const deleteUser: <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => RequestResult< {
1267
+ [key: string]: never;
1096
1268
  }, {
1097
- [key: string]: never;
1269
+ [key: string]: never;
1098
1270
  }, ThrowOnError>;
1099
1271
 
1100
1272
  export declare type DeleteUserData = {
@@ -1218,10 +1390,10 @@ export declare const generateUserKey: ({ adminSecret, expiresAt, userId, apiUrl,
1218
1390
  /**
1219
1391
  * Generates a new user authentication key. Can only be called by an administrator and when an admin key is configured.
1220
1392
  */
1221
- declare const generateUserKey_2: <ThrowOnError extends boolean = false>(options?: Options<GenerateUserKeyData, ThrowOnError>) => RequestResult<{
1222
- key: string;
1393
+ declare const generateUserKey_2: <ThrowOnError extends boolean = false>(options?: Options<GenerateUserKeyData, ThrowOnError>) => RequestResult< {
1394
+ key: string;
1223
1395
  }, {
1224
- key: string;
1396
+ key: string;
1225
1397
  }, ThrowOnError>;
1226
1398
 
1227
1399
  /**
@@ -1279,10 +1451,10 @@ export declare type GenerateUserKeyResponses = {
1279
1451
  /**
1280
1452
  * Retrieves the [Conversation](#schema_conversation) object for a valid identifier.
1281
1453
  */
1282
- declare const getConversation: <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>) => RequestResult<{
1283
- conversation: Conversation;
1454
+ declare const getConversation: <ThrowOnError extends boolean = false>(options: Options<GetConversationData, ThrowOnError>) => RequestResult< {
1455
+ conversation: Conversation;
1284
1456
  }, {
1285
- conversation: Conversation;
1457
+ conversation: Conversation;
1286
1458
  }, ThrowOnError>;
1287
1459
 
1288
1460
  export declare type GetConversationData = {
@@ -1328,10 +1500,10 @@ export declare type GetConversationResponses = {
1328
1500
  /**
1329
1501
  * Retrieves the [Event](#schema_event) object for a valid identifier.
1330
1502
  */
1331
- declare const getEvent: <ThrowOnError extends boolean = false>(options: Options<GetEventData, ThrowOnError>) => RequestResult<{
1332
- event: Event_2;
1503
+ declare const getEvent: <ThrowOnError extends boolean = false>(options: Options<GetEventData, ThrowOnError>) => RequestResult< {
1504
+ event: Event_2;
1333
1505
  }, {
1334
- event: Event_2;
1506
+ event: Event_2;
1335
1507
  }, ThrowOnError>;
1336
1508
 
1337
1509
  export declare type GetEventData = {
@@ -1377,10 +1549,10 @@ export declare type GetEventResponses = {
1377
1549
  /**
1378
1550
  * Retrieves the [Message](#schema_message) object for a valid identifier.
1379
1551
  */
1380
- declare const getMessage: <ThrowOnError extends boolean = false>(options: Options<GetMessageData, ThrowOnError>) => RequestResult<{
1381
- message: Message;
1552
+ declare const getMessage: <ThrowOnError extends boolean = false>(options: Options<GetMessageData, ThrowOnError>) => RequestResult< {
1553
+ message: Message;
1382
1554
  }, {
1383
- message: Message;
1555
+ message: Message;
1384
1556
  }, ThrowOnError>;
1385
1557
 
1386
1558
  export declare type GetMessageData = {
@@ -1426,10 +1598,10 @@ export declare type GetMessageResponses = {
1426
1598
  /**
1427
1599
  * Retrieves a [Participant](#schema_user) from a [Conversation](#schema_conversation).
1428
1600
  */
1429
- declare const getParticipant: <ThrowOnError extends boolean = false>(options: Options<GetParticipantData, ThrowOnError>) => RequestResult<{
1430
- participant: User;
1601
+ declare const getParticipant: <ThrowOnError extends boolean = false>(options: Options<GetParticipantData, ThrowOnError>) => RequestResult< {
1602
+ participant: User;
1431
1603
  }, {
1432
- participant: User;
1604
+ participant: User;
1433
1605
  }, ThrowOnError>;
1434
1606
 
1435
1607
  export declare type GetParticipantData = {
@@ -1479,10 +1651,10 @@ export declare type GetParticipantResponses = {
1479
1651
  /**
1480
1652
  * Retrieves the [User](#schema_user) object for a valid identifier.
1481
1653
  */
1482
- declare const getUser: <ThrowOnError extends boolean = false>(options: Options<GetUserData, ThrowOnError>) => RequestResult<{
1483
- user: User;
1654
+ declare const getUser: <ThrowOnError extends boolean = false>(options: Options<GetUserData, ThrowOnError>) => RequestResult< {
1655
+ user: User;
1484
1656
  }, {
1485
- user: User;
1657
+ user: User;
1486
1658
  }, ThrowOnError>;
1487
1659
 
1488
1660
  export declare type GetUserData = {
@@ -1543,10 +1715,10 @@ export declare const initialize: ({ conversationId, userToken, clientId, apiUrl,
1543
1715
  /**
1544
1716
  * Creates a SSE stream to receive messages and events. The first event will be a payload containing the conversation details.
1545
1717
  */
1546
- declare const initializeConversation: <ThrowOnError extends boolean = false>(options?: Options<InitializeConversationData, ThrowOnError>) => RequestResult<{
1547
- [key: string]: never;
1718
+ declare const initializeConversation: <ThrowOnError extends boolean = false>(options?: Options<InitializeConversationData, ThrowOnError>) => RequestResult< {
1719
+ [key: string]: never;
1548
1720
  }, {
1549
- [key: string]: never;
1721
+ [key: string]: never;
1550
1722
  }, ThrowOnError>;
1551
1723
 
1552
1724
  export declare type InitializeConversationData = {
@@ -1556,6 +1728,10 @@ export declare type InitializeConversationData = {
1556
1728
  * Authentication Key
1557
1729
  */
1558
1730
  'x-user-key'?: string;
1731
+ /**
1732
+ * Admin Key for managing users
1733
+ */
1734
+ 'x-admin-secret'?: string;
1559
1735
  };
1560
1736
  path?: never;
1561
1737
  query?: {
@@ -1612,16 +1788,16 @@ declare class Interceptors<Interceptor> {
1612
1788
  /**
1613
1789
  * Retrieves the conversation's [Messages](#schema_message)
1614
1790
  */
1615
- declare const listConversationMessages: <ThrowOnError extends boolean = false>(options: Options<ListConversationMessagesData, ThrowOnError>) => RequestResult<{
1616
- messages: Array<Message>;
1617
- meta: {
1618
- nextToken?: string;
1619
- };
1791
+ declare const listConversationMessages: <ThrowOnError extends boolean = false>(options: Options<ListConversationMessagesData, ThrowOnError>) => RequestResult< {
1792
+ messages: Array<Message>;
1793
+ meta: {
1794
+ nextToken?: string;
1795
+ };
1620
1796
  }, {
1621
- messages: Array<Message>;
1622
- meta: {
1623
- nextToken?: string;
1624
- };
1797
+ messages: Array<Message>;
1798
+ meta: {
1799
+ nextToken?: string;
1800
+ };
1625
1801
  }, ThrowOnError>;
1626
1802
 
1627
1803
  export declare type ListConversationMessagesData = {
@@ -1684,24 +1860,292 @@ export declare type ListConversationMessagesResponses = {
1684
1860
  /**
1685
1861
  * Returns a list of [Conversation](#schema_conversation) objects
1686
1862
  */
1687
- declare const listConversations: <ThrowOnError extends boolean = false>(options: Options<ListConversationsData, ThrowOnError>) => RequestResult<{
1688
- conversations: Array<{
1689
- id: string;
1690
- createdAt: string;
1691
- updatedAt: string;
1692
- }>;
1693
- meta: {
1694
- nextToken?: string;
1695
- };
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
+ };
1696
2006
  }, {
1697
- conversations: Array<{
1698
- id: string;
1699
- createdAt: string;
1700
- updatedAt: string;
1701
- }>;
1702
- meta: {
1703
- nextToken?: string;
1704
- };
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
+ };
1705
2149
  }, ThrowOnError>;
1706
2150
 
1707
2151
  export declare type ListConversationsData = {
@@ -1742,6 +2186,170 @@ export declare type ListConversationsErrors = {
1742
2186
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
1743
2187
  */
1744
2188
  updatedAt: string;
2189
+ /**
2190
+ * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation)
2191
+ */
2192
+ lastMessage?: {
2193
+ /**
2194
+ * Id of the [Message](#schema_message)
2195
+ */
2196
+ id: string;
2197
+ /**
2198
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
2199
+ */
2200
+ createdAt: string;
2201
+ /**
2202
+ * Payload is the content of the message.
2203
+ */
2204
+ payload: {
2205
+ audioUrl: string;
2206
+ fileId?: string;
2207
+ type: 'audio';
2208
+ } | {
2209
+ title: string;
2210
+ subtitle?: string;
2211
+ imageUrl?: string;
2212
+ actions: Array<{
2213
+ action: 'postback' | 'url' | 'say';
2214
+ label: string;
2215
+ value: string;
2216
+ }>;
2217
+ type: 'card';
2218
+ } | {
2219
+ items: Array<{
2220
+ title: string;
2221
+ subtitle?: string;
2222
+ imageUrl?: string;
2223
+ actions: Array<{
2224
+ action: 'postback' | 'url' | 'say';
2225
+ label: string;
2226
+ value: string;
2227
+ }>;
2228
+ }>;
2229
+ type: 'carousel';
2230
+ } | {
2231
+ text: string;
2232
+ options: Array<{
2233
+ label: string;
2234
+ value: string;
2235
+ }>;
2236
+ disableFreeText?: boolean;
2237
+ type: 'choice';
2238
+ } | {
2239
+ text: string;
2240
+ options: Array<{
2241
+ label: string;
2242
+ value: string;
2243
+ }>;
2244
+ disableFreeText?: boolean;
2245
+ type: 'dropdown';
2246
+ } | {
2247
+ fileUrl: string;
2248
+ title?: string;
2249
+ fileId?: string;
2250
+ type: 'file';
2251
+ } | {
2252
+ imageUrl: string;
2253
+ fileId?: string;
2254
+ type: 'image';
2255
+ } | {
2256
+ latitude: number;
2257
+ longitude: number;
2258
+ address?: string;
2259
+ title?: string;
2260
+ type: 'location';
2261
+ } | {
2262
+ text: string;
2263
+ value?: string;
2264
+ type: 'text';
2265
+ } | {
2266
+ videoUrl: string;
2267
+ fileId?: string;
2268
+ type: 'video';
2269
+ } | {
2270
+ items: Array<{
2271
+ type: 'text';
2272
+ payload: {
2273
+ text: string;
2274
+ value?: string;
2275
+ };
2276
+ } | {
2277
+ type: 'markdown';
2278
+ payload: {
2279
+ markdown: string;
2280
+ };
2281
+ } | {
2282
+ type: 'image';
2283
+ payload: {
2284
+ imageUrl: string;
2285
+ fileId?: string;
2286
+ };
2287
+ } | {
2288
+ type: 'audio';
2289
+ payload: {
2290
+ audioUrl: string;
2291
+ fileId?: string;
2292
+ };
2293
+ } | {
2294
+ type: 'video';
2295
+ payload: {
2296
+ videoUrl: string;
2297
+ fileId?: string;
2298
+ };
2299
+ } | {
2300
+ type: 'file';
2301
+ payload: {
2302
+ fileUrl: string;
2303
+ title?: string;
2304
+ fileId?: string;
2305
+ };
2306
+ } | {
2307
+ type: 'location';
2308
+ payload: {
2309
+ latitude: number;
2310
+ longitude: number;
2311
+ address?: string;
2312
+ title?: string;
2313
+ };
2314
+ }>;
2315
+ type: 'bloc';
2316
+ } | {
2317
+ markdown: string;
2318
+ type: 'markdown';
2319
+ } | {
2320
+ url: string;
2321
+ name: string;
2322
+ data?: unknown;
2323
+ type: 'custom';
2324
+ };
2325
+ /**
2326
+ * ID of the [User](#schema_user)
2327
+ */
2328
+ userId: string;
2329
+ /**
2330
+ * ID of the [Conversation](#schema_conversation)
2331
+ */
2332
+ conversationId: string;
2333
+ /**
2334
+ * Metadata of the message
2335
+ */
2336
+ metadata?: {};
2337
+ /**
2338
+ * ID of the message this message is replying to
2339
+ */
2340
+ replyTo?: string;
2341
+ /**
2342
+ * ID of the user who selected this message. Undefined if not selected.
2343
+ */
2344
+ selectedBy?: string;
2345
+ /**
2346
+ * Feedback of the message
2347
+ */
2348
+ feedback?: {
2349
+ value: 'positive' | 'negative';
2350
+ comment?: string;
2351
+ };
2352
+ };
1745
2353
  }>;
1746
2354
  meta: {
1747
2355
  /**
@@ -1772,6 +2380,170 @@ export declare type ListConversationsResponses = {
1772
2380
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
1773
2381
  */
1774
2382
  updatedAt: string;
2383
+ /**
2384
+ * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation)
2385
+ */
2386
+ lastMessage?: {
2387
+ /**
2388
+ * Id of the [Message](#schema_message)
2389
+ */
2390
+ id: string;
2391
+ /**
2392
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
2393
+ */
2394
+ createdAt: string;
2395
+ /**
2396
+ * Payload is the content of the message.
2397
+ */
2398
+ payload: {
2399
+ audioUrl: string;
2400
+ fileId?: string;
2401
+ type: 'audio';
2402
+ } | {
2403
+ title: string;
2404
+ subtitle?: string;
2405
+ imageUrl?: string;
2406
+ actions: Array<{
2407
+ action: 'postback' | 'url' | 'say';
2408
+ label: string;
2409
+ value: string;
2410
+ }>;
2411
+ type: 'card';
2412
+ } | {
2413
+ items: Array<{
2414
+ title: string;
2415
+ subtitle?: string;
2416
+ imageUrl?: string;
2417
+ actions: Array<{
2418
+ action: 'postback' | 'url' | 'say';
2419
+ label: string;
2420
+ value: string;
2421
+ }>;
2422
+ }>;
2423
+ type: 'carousel';
2424
+ } | {
2425
+ text: string;
2426
+ options: Array<{
2427
+ label: string;
2428
+ value: string;
2429
+ }>;
2430
+ disableFreeText?: boolean;
2431
+ type: 'choice';
2432
+ } | {
2433
+ text: string;
2434
+ options: Array<{
2435
+ label: string;
2436
+ value: string;
2437
+ }>;
2438
+ disableFreeText?: boolean;
2439
+ type: 'dropdown';
2440
+ } | {
2441
+ fileUrl: string;
2442
+ title?: string;
2443
+ fileId?: string;
2444
+ type: 'file';
2445
+ } | {
2446
+ imageUrl: string;
2447
+ fileId?: string;
2448
+ type: 'image';
2449
+ } | {
2450
+ latitude: number;
2451
+ longitude: number;
2452
+ address?: string;
2453
+ title?: string;
2454
+ type: 'location';
2455
+ } | {
2456
+ text: string;
2457
+ value?: string;
2458
+ type: 'text';
2459
+ } | {
2460
+ videoUrl: string;
2461
+ fileId?: string;
2462
+ type: 'video';
2463
+ } | {
2464
+ items: Array<{
2465
+ type: 'text';
2466
+ payload: {
2467
+ text: string;
2468
+ value?: string;
2469
+ };
2470
+ } | {
2471
+ type: 'markdown';
2472
+ payload: {
2473
+ markdown: string;
2474
+ };
2475
+ } | {
2476
+ type: 'image';
2477
+ payload: {
2478
+ imageUrl: string;
2479
+ fileId?: string;
2480
+ };
2481
+ } | {
2482
+ type: 'audio';
2483
+ payload: {
2484
+ audioUrl: string;
2485
+ fileId?: string;
2486
+ };
2487
+ } | {
2488
+ type: 'video';
2489
+ payload: {
2490
+ videoUrl: string;
2491
+ fileId?: string;
2492
+ };
2493
+ } | {
2494
+ type: 'file';
2495
+ payload: {
2496
+ fileUrl: string;
2497
+ title?: string;
2498
+ fileId?: string;
2499
+ };
2500
+ } | {
2501
+ type: 'location';
2502
+ payload: {
2503
+ latitude: number;
2504
+ longitude: number;
2505
+ address?: string;
2506
+ title?: string;
2507
+ };
2508
+ }>;
2509
+ type: 'bloc';
2510
+ } | {
2511
+ markdown: string;
2512
+ type: 'markdown';
2513
+ } | {
2514
+ url: string;
2515
+ name: string;
2516
+ data?: unknown;
2517
+ type: 'custom';
2518
+ };
2519
+ /**
2520
+ * ID of the [User](#schema_user)
2521
+ */
2522
+ userId: string;
2523
+ /**
2524
+ * ID of the [Conversation](#schema_conversation)
2525
+ */
2526
+ conversationId: string;
2527
+ /**
2528
+ * Metadata of the message
2529
+ */
2530
+ metadata?: {};
2531
+ /**
2532
+ * ID of the message this message is replying to
2533
+ */
2534
+ replyTo?: string;
2535
+ /**
2536
+ * ID of the user who selected this message. Undefined if not selected.
2537
+ */
2538
+ selectedBy?: string;
2539
+ /**
2540
+ * Feedback of the message
2541
+ */
2542
+ feedback?: {
2543
+ value: 'positive' | 'negative';
2544
+ comment?: string;
2545
+ };
2546
+ };
1775
2547
  }>;
1776
2548
  meta: {
1777
2549
  /**
@@ -1785,10 +2557,10 @@ export declare type ListConversationsResponses = {
1785
2557
  /**
1786
2558
  * Creates a SSE stream to receive messages and events from a conversation
1787
2559
  */
1788
- declare const listenConversation: <ThrowOnError extends boolean = false>(options: Options<ListenConversationData, ThrowOnError>) => RequestResult<{
1789
- [key: string]: never;
2560
+ declare const listenConversation: <ThrowOnError extends boolean = false>(options: Options<ListenConversationData, ThrowOnError>) => RequestResult< {
2561
+ [key: string]: never;
1790
2562
  }, {
1791
- [key: string]: never;
2563
+ [key: string]: never;
1792
2564
  }, ThrowOnError>;
1793
2565
 
1794
2566
  export declare type ListenConversationData = {
@@ -1834,16 +2606,16 @@ export declare type ListenConversationResponses = {
1834
2606
  /**
1835
2607
  * Retrieves a list of [Participants](#schema_user) for a given [Conversation](#schema_conversation).
1836
2608
  */
1837
- declare const listParticipants: <ThrowOnError extends boolean = false>(options: Options<ListParticipantsData, ThrowOnError>) => RequestResult<{
1838
- participants: Array<User>;
1839
- meta: {
1840
- nextToken?: string;
1841
- };
2609
+ declare const listParticipants: <ThrowOnError extends boolean = false>(options: Options<ListParticipantsData, ThrowOnError>) => RequestResult< {
2610
+ participants: Array<User>;
2611
+ meta: {
2612
+ nextToken?: string;
2613
+ };
1842
2614
  }, {
1843
- participants: Array<User>;
1844
- meta: {
1845
- nextToken?: string;
1846
- };
2615
+ participants: Array<User>;
2616
+ meta: {
2617
+ nextToken?: string;
2618
+ };
1847
2619
  }, ThrowOnError>;
1848
2620
 
1849
2621
  export declare type ListParticipantsData = {
@@ -1920,6 +2692,7 @@ export declare type Message = {
1920
2692
  */
1921
2693
  payload: {
1922
2694
  audioUrl: string;
2695
+ fileId?: string;
1923
2696
  type: 'audio';
1924
2697
  } | {
1925
2698
  title: string;
@@ -1962,9 +2735,11 @@ export declare type Message = {
1962
2735
  } | {
1963
2736
  fileUrl: string;
1964
2737
  title?: string;
2738
+ fileId?: string;
1965
2739
  type: 'file';
1966
2740
  } | {
1967
2741
  imageUrl: string;
2742
+ fileId?: string;
1968
2743
  type: 'image';
1969
2744
  } | {
1970
2745
  latitude: number;
@@ -1978,6 +2753,7 @@ export declare type Message = {
1978
2753
  type: 'text';
1979
2754
  } | {
1980
2755
  videoUrl: string;
2756
+ fileId?: string;
1981
2757
  type: 'video';
1982
2758
  } | {
1983
2759
  items: Array<{
@@ -1995,22 +2771,26 @@ export declare type Message = {
1995
2771
  type: 'image';
1996
2772
  payload: {
1997
2773
  imageUrl: string;
2774
+ fileId?: string;
1998
2775
  };
1999
2776
  } | {
2000
2777
  type: 'audio';
2001
2778
  payload: {
2002
2779
  audioUrl: string;
2780
+ fileId?: string;
2003
2781
  };
2004
2782
  } | {
2005
2783
  type: 'video';
2006
2784
  payload: {
2007
2785
  videoUrl: string;
2786
+ fileId?: string;
2008
2787
  };
2009
2788
  } | {
2010
2789
  type: 'file';
2011
2790
  payload: {
2012
2791
  fileUrl: string;
2013
2792
  title?: string;
2793
+ fileId?: string;
2014
2794
  };
2015
2795
  } | {
2016
2796
  type: 'location';
@@ -2720,10 +3500,10 @@ declare interface QuerySerializerOptions {
2720
3500
  /**
2721
3501
  * Removes feedback from a [Message](#schema_message).
2722
3502
  */
2723
- declare const removeMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<RemoveMessageFeedbackData, ThrowOnError>) => RequestResult<{
2724
- [key: string]: never;
3503
+ declare const removeMessageFeedback: <ThrowOnError extends boolean = false>(options: Options<RemoveMessageFeedbackData, ThrowOnError>) => RequestResult< {
3504
+ [key: string]: never;
2725
3505
  }, {
2726
- [key: string]: never;
3506
+ [key: string]: never;
2727
3507
  }, ThrowOnError>;
2728
3508
 
2729
3509
  export declare type RemoveMessageFeedbackData = {
@@ -2769,10 +3549,10 @@ export declare type RemoveMessageFeedbackResponses = {
2769
3549
  /**
2770
3550
  * Remove a [Participant](#schema_user) from a [Conversation](#schema_conversation).
2771
3551
  */
2772
- declare const removeParticipant: <ThrowOnError extends boolean = false>(options: Options<RemoveParticipantData, ThrowOnError>) => RequestResult<{
2773
- [key: string]: never;
3552
+ declare const removeParticipant: <ThrowOnError extends boolean = false>(options: Options<RemoveParticipantData, ThrowOnError>) => RequestResult< {
3553
+ [key: string]: never;
2774
3554
  }, {
2775
- [key: string]: never;
3555
+ [key: string]: never;
2776
3556
  }, ThrowOnError>;
2777
3557
 
2778
3558
  export declare type RemoveParticipantData = {
@@ -2861,10 +3641,10 @@ declare type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, o
2861
3641
  /**
2862
3642
  * Updates a [Message](#schema_message) sent by any user to mark it as already selected. A message can only be selected once.
2863
3643
  */
2864
- declare const selectMessage: <ThrowOnError extends boolean = false>(options: Options<SelectMessageData, ThrowOnError>) => RequestResult<{
2865
- [key: string]: never;
3644
+ declare const selectMessage: <ThrowOnError extends boolean = false>(options: Options<SelectMessageData, ThrowOnError>) => RequestResult< {
3645
+ [key: string]: never;
2866
3646
  }, {
2867
- [key: string]: never;
3647
+ [key: string]: never;
2868
3648
  }, ThrowOnError>;
2869
3649
 
2870
3650
  /**
@@ -2924,10 +3704,10 @@ export declare const sendPerfMetrics: (clientId: string, body: ClientTypes_2.Sen
2924
3704
  /**
2925
3705
  * Sends performance metrics to the server.
2926
3706
  */
2927
- declare const sendPerfMetrics_2: <ThrowOnError extends boolean = false>(options?: Options<SendPerfMetricsData, ThrowOnError>) => RequestResult<{
2928
- [key: string]: never;
3707
+ declare const sendPerfMetrics_2: <ThrowOnError extends boolean = false>(options?: Options<SendPerfMetricsData, ThrowOnError>) => RequestResult< {
3708
+ [key: string]: never;
2929
3709
  }, {
2930
- [key: string]: never;
3710
+ [key: string]: never;
2931
3711
  }, ThrowOnError>;
2932
3712
 
2933
3713
  /**
@@ -3004,10 +3784,10 @@ declare type TypingStopped = {
3004
3784
  /**
3005
3785
  * Updates a [Message](#schema_message). The bot won't be aware of the changes.
3006
3786
  */
3007
- declare const updateMessage: <ThrowOnError extends boolean = false>(options: Options<UpdateMessageData, ThrowOnError>) => RequestResult<{
3008
- message: Message;
3787
+ declare const updateMessage: <ThrowOnError extends boolean = false>(options: Options<UpdateMessageData, ThrowOnError>) => RequestResult< {
3788
+ message: Message;
3009
3789
  }, {
3010
- message: Message;
3790
+ message: Message;
3011
3791
  }, ThrowOnError>;
3012
3792
 
3013
3793
  /**
@@ -3019,6 +3799,7 @@ export declare type UpdateMessageBody = {
3019
3799
  */
3020
3800
  payload?: {
3021
3801
  audioUrl: string;
3802
+ fileId?: string;
3022
3803
  type: 'audio';
3023
3804
  } | {
3024
3805
  title: string;
@@ -3061,9 +3842,11 @@ export declare type UpdateMessageBody = {
3061
3842
  } | {
3062
3843
  fileUrl: string;
3063
3844
  title?: string;
3845
+ fileId?: string;
3064
3846
  type: 'file';
3065
3847
  } | {
3066
3848
  imageUrl: string;
3849
+ fileId?: string;
3067
3850
  type: 'image';
3068
3851
  } | {
3069
3852
  latitude: number;
@@ -3077,6 +3860,7 @@ export declare type UpdateMessageBody = {
3077
3860
  type: 'text';
3078
3861
  } | {
3079
3862
  videoUrl: string;
3863
+ fileId?: string;
3080
3864
  type: 'video';
3081
3865
  } | {
3082
3866
  items: Array<{
@@ -3094,22 +3878,26 @@ export declare type UpdateMessageBody = {
3094
3878
  type: 'image';
3095
3879
  payload: {
3096
3880
  imageUrl: string;
3881
+ fileId?: string;
3097
3882
  };
3098
3883
  } | {
3099
3884
  type: 'audio';
3100
3885
  payload: {
3101
3886
  audioUrl: string;
3887
+ fileId?: string;
3102
3888
  };
3103
3889
  } | {
3104
3890
  type: 'video';
3105
3891
  payload: {
3106
3892
  videoUrl: string;
3893
+ fileId?: string;
3107
3894
  };
3108
3895
  } | {
3109
3896
  type: 'file';
3110
3897
  payload: {
3111
3898
  fileUrl: string;
3112
3899
  title?: string;
3900
+ fileId?: string;
3113
3901
  };
3114
3902
  } | {
3115
3903
  type: 'location';
@@ -3182,10 +3970,10 @@ export declare type UpdateMessageResponses = {
3182
3970
  /**
3183
3971
  * Update [User](#schema_user)
3184
3972
  */
3185
- declare const updateUser: <ThrowOnError extends boolean = false>(options: Options<UpdateUserData, ThrowOnError>) => RequestResult<{
3186
- user: User;
3973
+ declare const updateUser: <ThrowOnError extends boolean = false>(options: Options<UpdateUserData, ThrowOnError>) => RequestResult< {
3974
+ user: User;
3187
3975
  }, {
3188
- user: User;
3976
+ user: User;
3189
3977
  }, ThrowOnError>;
3190
3978
 
3191
3979
  /**
@@ -3201,9 +3989,9 @@ export declare type UpdateUserBody = {
3201
3989
  */
3202
3990
  pictureUrl?: string;
3203
3991
  /**
3204
- * User data
3992
+ * User data. An object or a signed JWT token
3205
3993
  */
3206
- userData?: {} | null;
3994
+ userData?: {} | string | null;
3207
3995
  };
3208
3996
 
3209
3997
  export declare type UpdateUserData = {