@botpress/webchat-client 0.3.0 → 0.4.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
@@ -186,13 +186,12 @@ export declare type Client = {
186
186
  getMessage: (params: MessageIdParam) => Promise<ClientTypes_2.GetMessageResponse>;
187
187
  deleteMessage: (params: MessageIdParam) => Promise<ClientTypes_2.DeleteMessageResponse>;
188
188
  createFile: (params: ClientTypes_2.CreateFileBody) => Promise<ClientTypes_2.CreateFileResponse>;
189
- createUser: (params: ClientTypes_2.CreateUserBody) => Promise<ClientTypes_2.CreateUserResponse>;
190
189
  getUser: () => Promise<ClientTypes_2.GetUserResponse>;
191
190
  updateUser: (params: ClientTypes_2.CreateUserBody) => Promise<ClientTypes_2.UpdateUserResponse>;
192
191
  deleteUser: (params: UserIdParam) => Promise<ClientTypes_2.DeleteUserResponse>;
193
192
  createEvent: (params: ClientTypes_2.CreateEventBody) => Promise<ClientTypes_2.CreateEventResponse>;
194
193
  getEvent: (params: EventIdParam) => Promise<ClientTypes_2.GetEventResponse>;
195
- listenConversation: (params: ConversationIdParam) => EventEmitter<Record<Event_3['type'], Event_3['data']>>['on'];
194
+ listenConversation: (params: ConversationIdParam) => EventEmitter<EventMap>['on'];
196
195
  addMessageFeedback: (params: MessageIdParam & ClientTypes_2.AddMessageFeedbackBody) => Promise<ClientTypes_2.AddMessageFeedbackResponse>;
197
196
  removeMessageFeedback: (params: MessageIdParam) => Promise<ClientTypes_2.RemoveMessageFeedbackResponse>;
198
197
  generateUserKey: (params: ClientTypes_2.GenerateUserKeyBody & {
@@ -220,6 +219,7 @@ declare namespace ClientTypes_2 {
220
219
  Message,
221
220
  Event_2 as Event,
222
221
  File_2 as File,
222
+ Perf,
223
223
  CreateConversationBody,
224
224
  AddParticipantBody,
225
225
  CreateMessageBody,
@@ -231,6 +231,7 @@ declare namespace ClientTypes_2 {
231
231
  UpdateUserBody,
232
232
  CreateEventBody,
233
233
  CreateFileBody,
234
+ SendPerfMetricsBody,
234
235
  DeleteConversationData,
235
236
  DeleteConversationErrors,
236
237
  DeleteConversationError,
@@ -361,6 +362,11 @@ declare namespace ClientTypes_2 {
361
362
  InitializeConversationError,
362
363
  InitializeConversationResponses,
363
364
  InitializeConversationResponse,
365
+ SendPerfMetricsData,
366
+ SendPerfMetricsErrors,
367
+ SendPerfMetricsError,
368
+ SendPerfMetricsResponses,
369
+ SendPerfMetricsResponse,
364
370
  ClientOptions,
365
371
  Options,
366
372
  deleteConversation,
@@ -388,7 +394,8 @@ declare namespace ClientTypes_2 {
388
394
  getEvent,
389
395
  createEvent,
390
396
  createFile,
391
- initializeConversation
397
+ initializeConversation,
398
+ sendPerfMetrics_2 as sendPerfMetrics
392
399
  }
393
400
  }
394
401
 
@@ -489,16 +496,173 @@ export declare type Conversation = {
489
496
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
490
497
  */
491
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
+ type: 'audio';
517
+ } | {
518
+ title: string;
519
+ subtitle?: string;
520
+ imageUrl?: string;
521
+ actions: Array<{
522
+ action: 'postback' | 'url' | 'say';
523
+ label: string;
524
+ value: string;
525
+ }>;
526
+ type: 'card';
527
+ } | {
528
+ items: Array<{
529
+ title: string;
530
+ subtitle?: string;
531
+ imageUrl?: string;
532
+ actions: Array<{
533
+ action: 'postback' | 'url' | 'say';
534
+ label: string;
535
+ value: string;
536
+ }>;
537
+ }>;
538
+ type: 'carousel';
539
+ } | {
540
+ text: string;
541
+ options: Array<{
542
+ label: string;
543
+ value: string;
544
+ }>;
545
+ disableFreeText?: boolean;
546
+ type: 'choice';
547
+ } | {
548
+ text: string;
549
+ options: Array<{
550
+ label: string;
551
+ value: string;
552
+ }>;
553
+ disableFreeText?: boolean;
554
+ type: 'dropdown';
555
+ } | {
556
+ fileUrl: string;
557
+ title?: string;
558
+ type: 'file';
559
+ } | {
560
+ imageUrl: string;
561
+ type: 'image';
562
+ } | {
563
+ latitude: number;
564
+ longitude: number;
565
+ address?: string;
566
+ title?: string;
567
+ type: 'location';
568
+ } | {
569
+ text: string;
570
+ value?: string;
571
+ type: 'text';
572
+ } | {
573
+ videoUrl: string;
574
+ type: 'video';
575
+ } | {
576
+ items: Array<{
577
+ type: 'text';
578
+ payload: {
579
+ text: string;
580
+ value?: string;
581
+ };
582
+ } | {
583
+ type: 'markdown';
584
+ payload: {
585
+ markdown: string;
586
+ };
587
+ } | {
588
+ type: 'image';
589
+ payload: {
590
+ imageUrl: string;
591
+ };
592
+ } | {
593
+ type: 'audio';
594
+ payload: {
595
+ audioUrl: string;
596
+ };
597
+ } | {
598
+ type: 'video';
599
+ payload: {
600
+ videoUrl: string;
601
+ };
602
+ } | {
603
+ type: 'file';
604
+ payload: {
605
+ fileUrl: string;
606
+ title?: string;
607
+ };
608
+ } | {
609
+ type: 'location';
610
+ payload: {
611
+ latitude: number;
612
+ longitude: number;
613
+ address?: string;
614
+ title?: string;
615
+ };
616
+ }>;
617
+ type: 'bloc';
618
+ } | {
619
+ markdown: string;
620
+ type: 'markdown';
621
+ } | {
622
+ url: string;
623
+ name: string;
624
+ data?: unknown;
625
+ type: 'custom';
626
+ };
627
+ /**
628
+ * ID of the [User](#schema_user)
629
+ */
630
+ userId: string;
631
+ /**
632
+ * ID of the [Conversation](#schema_conversation)
633
+ */
634
+ conversationId: string;
635
+ /**
636
+ * Metadata of the message
637
+ */
638
+ metadata?: {};
639
+ /**
640
+ * ID of the message this message is replying to
641
+ */
642
+ replyTo?: string;
643
+ /**
644
+ * ID of the user who selected this message. Undefined if not selected.
645
+ */
646
+ selectedBy?: string;
647
+ /**
648
+ * Feedback of the message
649
+ */
650
+ feedback?: {
651
+ value: 'positive' | 'negative';
652
+ comment?: string;
653
+ };
654
+ };
492
655
  };
493
656
 
494
657
  declare type ConversationIdParam = {
495
658
  conversationId: string;
496
659
  };
497
660
 
498
- export declare const createClient: ({ userKey, clientId, apiUrl, }: {
661
+ export declare const createClient: ({ userKey, clientId, apiUrl, customHeaders, }: {
499
662
  userKey: string;
500
663
  clientId: string;
501
664
  apiUrl?: string;
665
+ customHeaders?: Record<string, string>;
502
666
  }) => Client;
503
667
 
504
668
  /**
@@ -894,11 +1058,12 @@ export declare type CreateMessageResponses = {
894
1058
  };
895
1059
  };
896
1060
 
897
- export declare const createUser: ({ clientId, apiUrl, adminSecret, }: {
1061
+ export declare const createUser: ({ clientId, apiUrl, adminSecret, customHeaders, ...body }: {
898
1062
  clientId: string;
899
1063
  apiUrl?: string;
900
1064
  adminSecret?: string;
901
- }) => Promise<{
1065
+ customHeaders?: Record<string, string>;
1066
+ } & ClientTypes_2.CreateUserBody) => Promise<{
902
1067
  user: ClientTypes_2.User;
903
1068
  key: string;
904
1069
  }>;
@@ -1172,6 +1337,10 @@ declare type EventIdParam = {
1172
1337
  eventId: string;
1173
1338
  };
1174
1339
 
1340
+ declare type EventMap = {
1341
+ [E in Event_3 as E['type']]: E['data'];
1342
+ };
1343
+
1175
1344
  declare type File_2 = {
1176
1345
  id: string;
1177
1346
  botId: string;
@@ -1514,17 +1683,18 @@ declare type Initialize = {
1514
1683
  messages: ListConversationMessagesResponse['messages'];
1515
1684
  participants: ListParticipantsResponse['participants'];
1516
1685
  user: GetUserResponse['user'] & {
1517
- userKey?: string;
1686
+ userKey: string;
1518
1687
  };
1519
1688
  };
1520
1689
  };
1521
1690
 
1522
- export declare const initialize: ({ conversationId, userToken, clientId, apiUrl, }: {
1691
+ export declare const initialize: ({ conversationId, userToken, clientId, apiUrl, adminSecret, }: {
1523
1692
  conversationId?: string;
1524
1693
  userToken?: string;
1525
1694
  apiUrl?: string;
1526
1695
  clientId: string;
1527
- }) => <U extends "custom" | "error" | "message_created" | "message_updated" | "typing_started" | "typing_stopped" | "webchat_config" | "webchat_visibility" | "participant_added" | "participant_removed" | "message_status_changed" | "init" | "open">(event: U, callback: (args: Record<"custom" | "error" | "message_created" | "message_updated" | "typing_started" | "typing_stopped" | "webchat_config" | "webchat_visibility" | "participant_added" | "participant_removed" | "message_status_changed" | "init" | "open", any>[U]) => void) => () => void;
1696
+ adminSecret?: string;
1697
+ }) => <U extends "custom" | "error" | "message_created" | "message_updated" | "typing_started" | "typing_stopped" | "webchat_config" | "webchat_visibility" | "participant_added" | "participant_removed" | "message_status_changed" | "init" | "open">(event: U, callback: (args: EventMap[U]) => void) => () => void;
1528
1698
 
1529
1699
  /**
1530
1700
  * Creates a SSE stream to receive messages and events. The first event will be a payload containing the conversation details.
@@ -1542,6 +1712,10 @@ export declare type InitializeConversationData = {
1542
1712
  * Authentication Key
1543
1713
  */
1544
1714
  'x-user-key'?: string;
1715
+ /**
1716
+ * Admin Key for managing users
1717
+ */
1718
+ 'x-admin-secret'?: string;
1545
1719
  };
1546
1720
  path?: never;
1547
1721
  query?: {
@@ -1675,6 +1849,132 @@ declare const listConversations: <ThrowOnError extends boolean = false>(options:
1675
1849
  id: string;
1676
1850
  createdAt: string;
1677
1851
  updatedAt: string;
1852
+ lastMessage?: {
1853
+ id: string;
1854
+ createdAt: string;
1855
+ payload: {
1856
+ audioUrl: string;
1857
+ type: "audio";
1858
+ } | {
1859
+ title: string;
1860
+ subtitle?: string;
1861
+ imageUrl?: string;
1862
+ actions: Array<{
1863
+ action: "postback" | "url" | "say";
1864
+ label: string;
1865
+ value: string;
1866
+ }>;
1867
+ type: "card";
1868
+ } | {
1869
+ items: Array<{
1870
+ title: string;
1871
+ subtitle?: string;
1872
+ imageUrl?: string;
1873
+ actions: Array<{
1874
+ action: "postback" | "url" | "say";
1875
+ label: string;
1876
+ value: string;
1877
+ }>;
1878
+ }>;
1879
+ type: "carousel";
1880
+ } | {
1881
+ text: string;
1882
+ options: Array<{
1883
+ label: string;
1884
+ value: string;
1885
+ }>;
1886
+ disableFreeText?: boolean;
1887
+ type: "choice";
1888
+ } | {
1889
+ text: string;
1890
+ options: Array<{
1891
+ label: string;
1892
+ value: string;
1893
+ }>;
1894
+ disableFreeText?: boolean;
1895
+ type: "dropdown";
1896
+ } | {
1897
+ fileUrl: string;
1898
+ title?: string;
1899
+ type: "file";
1900
+ } | {
1901
+ imageUrl: string;
1902
+ type: "image";
1903
+ } | {
1904
+ latitude: number;
1905
+ longitude: number;
1906
+ address?: string;
1907
+ title?: string;
1908
+ type: "location";
1909
+ } | {
1910
+ text: string;
1911
+ value?: string;
1912
+ type: "text";
1913
+ } | {
1914
+ videoUrl: string;
1915
+ type: "video";
1916
+ } | {
1917
+ items: Array<{
1918
+ type: "text";
1919
+ payload: {
1920
+ text: string;
1921
+ value?: string;
1922
+ };
1923
+ } | {
1924
+ type: "markdown";
1925
+ payload: {
1926
+ markdown: string;
1927
+ };
1928
+ } | {
1929
+ type: "image";
1930
+ payload: {
1931
+ imageUrl: string;
1932
+ };
1933
+ } | {
1934
+ type: "audio";
1935
+ payload: {
1936
+ audioUrl: string;
1937
+ };
1938
+ } | {
1939
+ type: "video";
1940
+ payload: {
1941
+ videoUrl: string;
1942
+ };
1943
+ } | {
1944
+ type: "file";
1945
+ payload: {
1946
+ fileUrl: string;
1947
+ title?: string;
1948
+ };
1949
+ } | {
1950
+ type: "location";
1951
+ payload: {
1952
+ latitude: number;
1953
+ longitude: number;
1954
+ address?: string;
1955
+ title?: string;
1956
+ };
1957
+ }>;
1958
+ type: "bloc";
1959
+ } | {
1960
+ markdown: string;
1961
+ type: "markdown";
1962
+ } | {
1963
+ url: string;
1964
+ name: string;
1965
+ data?: unknown;
1966
+ type: "custom";
1967
+ };
1968
+ userId: string;
1969
+ conversationId: string;
1970
+ metadata?: {};
1971
+ replyTo?: string;
1972
+ selectedBy?: string;
1973
+ feedback?: {
1974
+ value: "positive" | "negative";
1975
+ comment?: string;
1976
+ };
1977
+ };
1678
1978
  }>;
1679
1979
  meta: {
1680
1980
  nextToken?: string;
@@ -1684,6 +1984,132 @@ declare const listConversations: <ThrowOnError extends boolean = false>(options:
1684
1984
  id: string;
1685
1985
  createdAt: string;
1686
1986
  updatedAt: string;
1987
+ lastMessage?: {
1988
+ id: string;
1989
+ createdAt: string;
1990
+ payload: {
1991
+ audioUrl: string;
1992
+ type: "audio";
1993
+ } | {
1994
+ title: string;
1995
+ subtitle?: string;
1996
+ imageUrl?: string;
1997
+ actions: Array<{
1998
+ action: "postback" | "url" | "say";
1999
+ label: string;
2000
+ value: string;
2001
+ }>;
2002
+ type: "card";
2003
+ } | {
2004
+ items: Array<{
2005
+ title: string;
2006
+ subtitle?: string;
2007
+ imageUrl?: string;
2008
+ actions: Array<{
2009
+ action: "postback" | "url" | "say";
2010
+ label: string;
2011
+ value: string;
2012
+ }>;
2013
+ }>;
2014
+ type: "carousel";
2015
+ } | {
2016
+ text: string;
2017
+ options: Array<{
2018
+ label: string;
2019
+ value: string;
2020
+ }>;
2021
+ disableFreeText?: boolean;
2022
+ type: "choice";
2023
+ } | {
2024
+ text: string;
2025
+ options: Array<{
2026
+ label: string;
2027
+ value: string;
2028
+ }>;
2029
+ disableFreeText?: boolean;
2030
+ type: "dropdown";
2031
+ } | {
2032
+ fileUrl: string;
2033
+ title?: string;
2034
+ type: "file";
2035
+ } | {
2036
+ imageUrl: string;
2037
+ type: "image";
2038
+ } | {
2039
+ latitude: number;
2040
+ longitude: number;
2041
+ address?: string;
2042
+ title?: string;
2043
+ type: "location";
2044
+ } | {
2045
+ text: string;
2046
+ value?: string;
2047
+ type: "text";
2048
+ } | {
2049
+ videoUrl: string;
2050
+ type: "video";
2051
+ } | {
2052
+ items: Array<{
2053
+ type: "text";
2054
+ payload: {
2055
+ text: string;
2056
+ value?: string;
2057
+ };
2058
+ } | {
2059
+ type: "markdown";
2060
+ payload: {
2061
+ markdown: string;
2062
+ };
2063
+ } | {
2064
+ type: "image";
2065
+ payload: {
2066
+ imageUrl: string;
2067
+ };
2068
+ } | {
2069
+ type: "audio";
2070
+ payload: {
2071
+ audioUrl: string;
2072
+ };
2073
+ } | {
2074
+ type: "video";
2075
+ payload: {
2076
+ videoUrl: string;
2077
+ };
2078
+ } | {
2079
+ type: "file";
2080
+ payload: {
2081
+ fileUrl: string;
2082
+ title?: string;
2083
+ };
2084
+ } | {
2085
+ type: "location";
2086
+ payload: {
2087
+ latitude: number;
2088
+ longitude: number;
2089
+ address?: string;
2090
+ title?: string;
2091
+ };
2092
+ }>;
2093
+ type: "bloc";
2094
+ } | {
2095
+ markdown: string;
2096
+ type: "markdown";
2097
+ } | {
2098
+ url: string;
2099
+ name: string;
2100
+ data?: unknown;
2101
+ type: "custom";
2102
+ };
2103
+ userId: string;
2104
+ conversationId: string;
2105
+ metadata?: {};
2106
+ replyTo?: string;
2107
+ selectedBy?: string;
2108
+ feedback?: {
2109
+ value: "positive" | "negative";
2110
+ comment?: string;
2111
+ };
2112
+ };
1687
2113
  }>;
1688
2114
  meta: {
1689
2115
  nextToken?: string;
@@ -1728,6 +2154,162 @@ export declare type ListConversationsErrors = {
1728
2154
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
1729
2155
  */
1730
2156
  updatedAt: string;
2157
+ /**
2158
+ * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation)
2159
+ */
2160
+ lastMessage?: {
2161
+ /**
2162
+ * Id of the [Message](#schema_message)
2163
+ */
2164
+ id: string;
2165
+ /**
2166
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
2167
+ */
2168
+ createdAt: string;
2169
+ /**
2170
+ * Payload is the content of the message.
2171
+ */
2172
+ payload: {
2173
+ audioUrl: string;
2174
+ type: 'audio';
2175
+ } | {
2176
+ title: string;
2177
+ subtitle?: string;
2178
+ imageUrl?: string;
2179
+ actions: Array<{
2180
+ action: 'postback' | 'url' | 'say';
2181
+ label: string;
2182
+ value: string;
2183
+ }>;
2184
+ type: 'card';
2185
+ } | {
2186
+ items: Array<{
2187
+ title: string;
2188
+ subtitle?: string;
2189
+ imageUrl?: string;
2190
+ actions: Array<{
2191
+ action: 'postback' | 'url' | 'say';
2192
+ label: string;
2193
+ value: string;
2194
+ }>;
2195
+ }>;
2196
+ type: 'carousel';
2197
+ } | {
2198
+ text: string;
2199
+ options: Array<{
2200
+ label: string;
2201
+ value: string;
2202
+ }>;
2203
+ disableFreeText?: boolean;
2204
+ type: 'choice';
2205
+ } | {
2206
+ text: string;
2207
+ options: Array<{
2208
+ label: string;
2209
+ value: string;
2210
+ }>;
2211
+ disableFreeText?: boolean;
2212
+ type: 'dropdown';
2213
+ } | {
2214
+ fileUrl: string;
2215
+ title?: string;
2216
+ type: 'file';
2217
+ } | {
2218
+ imageUrl: string;
2219
+ type: 'image';
2220
+ } | {
2221
+ latitude: number;
2222
+ longitude: number;
2223
+ address?: string;
2224
+ title?: string;
2225
+ type: 'location';
2226
+ } | {
2227
+ text: string;
2228
+ value?: string;
2229
+ type: 'text';
2230
+ } | {
2231
+ videoUrl: string;
2232
+ type: 'video';
2233
+ } | {
2234
+ items: Array<{
2235
+ type: 'text';
2236
+ payload: {
2237
+ text: string;
2238
+ value?: string;
2239
+ };
2240
+ } | {
2241
+ type: 'markdown';
2242
+ payload: {
2243
+ markdown: string;
2244
+ };
2245
+ } | {
2246
+ type: 'image';
2247
+ payload: {
2248
+ imageUrl: string;
2249
+ };
2250
+ } | {
2251
+ type: 'audio';
2252
+ payload: {
2253
+ audioUrl: string;
2254
+ };
2255
+ } | {
2256
+ type: 'video';
2257
+ payload: {
2258
+ videoUrl: string;
2259
+ };
2260
+ } | {
2261
+ type: 'file';
2262
+ payload: {
2263
+ fileUrl: string;
2264
+ title?: string;
2265
+ };
2266
+ } | {
2267
+ type: 'location';
2268
+ payload: {
2269
+ latitude: number;
2270
+ longitude: number;
2271
+ address?: string;
2272
+ title?: string;
2273
+ };
2274
+ }>;
2275
+ type: 'bloc';
2276
+ } | {
2277
+ markdown: string;
2278
+ type: 'markdown';
2279
+ } | {
2280
+ url: string;
2281
+ name: string;
2282
+ data?: unknown;
2283
+ type: 'custom';
2284
+ };
2285
+ /**
2286
+ * ID of the [User](#schema_user)
2287
+ */
2288
+ userId: string;
2289
+ /**
2290
+ * ID of the [Conversation](#schema_conversation)
2291
+ */
2292
+ conversationId: string;
2293
+ /**
2294
+ * Metadata of the message
2295
+ */
2296
+ metadata?: {};
2297
+ /**
2298
+ * ID of the message this message is replying to
2299
+ */
2300
+ replyTo?: string;
2301
+ /**
2302
+ * ID of the user who selected this message. Undefined if not selected.
2303
+ */
2304
+ selectedBy?: string;
2305
+ /**
2306
+ * Feedback of the message
2307
+ */
2308
+ feedback?: {
2309
+ value: 'positive' | 'negative';
2310
+ comment?: string;
2311
+ };
2312
+ };
1731
2313
  }>;
1732
2314
  meta: {
1733
2315
  /**
@@ -1758,6 +2340,162 @@ export declare type ListConversationsResponses = {
1758
2340
  * Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
1759
2341
  */
1760
2342
  updatedAt: string;
2343
+ /**
2344
+ * The last [Message](#schema_message) sent in the [Conversation](#schema_conversation)
2345
+ */
2346
+ lastMessage?: {
2347
+ /**
2348
+ * Id of the [Message](#schema_message)
2349
+ */
2350
+ id: string;
2351
+ /**
2352
+ * Creation date of the [Message](#schema_message) in ISO 8601 format
2353
+ */
2354
+ createdAt: string;
2355
+ /**
2356
+ * Payload is the content of the message.
2357
+ */
2358
+ payload: {
2359
+ audioUrl: string;
2360
+ type: 'audio';
2361
+ } | {
2362
+ title: string;
2363
+ subtitle?: string;
2364
+ imageUrl?: string;
2365
+ actions: Array<{
2366
+ action: 'postback' | 'url' | 'say';
2367
+ label: string;
2368
+ value: string;
2369
+ }>;
2370
+ type: 'card';
2371
+ } | {
2372
+ items: Array<{
2373
+ title: string;
2374
+ subtitle?: string;
2375
+ imageUrl?: string;
2376
+ actions: Array<{
2377
+ action: 'postback' | 'url' | 'say';
2378
+ label: string;
2379
+ value: string;
2380
+ }>;
2381
+ }>;
2382
+ type: 'carousel';
2383
+ } | {
2384
+ text: string;
2385
+ options: Array<{
2386
+ label: string;
2387
+ value: string;
2388
+ }>;
2389
+ disableFreeText?: boolean;
2390
+ type: 'choice';
2391
+ } | {
2392
+ text: string;
2393
+ options: Array<{
2394
+ label: string;
2395
+ value: string;
2396
+ }>;
2397
+ disableFreeText?: boolean;
2398
+ type: 'dropdown';
2399
+ } | {
2400
+ fileUrl: string;
2401
+ title?: string;
2402
+ type: 'file';
2403
+ } | {
2404
+ imageUrl: string;
2405
+ type: 'image';
2406
+ } | {
2407
+ latitude: number;
2408
+ longitude: number;
2409
+ address?: string;
2410
+ title?: string;
2411
+ type: 'location';
2412
+ } | {
2413
+ text: string;
2414
+ value?: string;
2415
+ type: 'text';
2416
+ } | {
2417
+ videoUrl: string;
2418
+ type: 'video';
2419
+ } | {
2420
+ items: Array<{
2421
+ type: 'text';
2422
+ payload: {
2423
+ text: string;
2424
+ value?: string;
2425
+ };
2426
+ } | {
2427
+ type: 'markdown';
2428
+ payload: {
2429
+ markdown: string;
2430
+ };
2431
+ } | {
2432
+ type: 'image';
2433
+ payload: {
2434
+ imageUrl: string;
2435
+ };
2436
+ } | {
2437
+ type: 'audio';
2438
+ payload: {
2439
+ audioUrl: string;
2440
+ };
2441
+ } | {
2442
+ type: 'video';
2443
+ payload: {
2444
+ videoUrl: string;
2445
+ };
2446
+ } | {
2447
+ type: 'file';
2448
+ payload: {
2449
+ fileUrl: string;
2450
+ title?: string;
2451
+ };
2452
+ } | {
2453
+ type: 'location';
2454
+ payload: {
2455
+ latitude: number;
2456
+ longitude: number;
2457
+ address?: string;
2458
+ title?: string;
2459
+ };
2460
+ }>;
2461
+ type: 'bloc';
2462
+ } | {
2463
+ markdown: string;
2464
+ type: 'markdown';
2465
+ } | {
2466
+ url: string;
2467
+ name: string;
2468
+ data?: unknown;
2469
+ type: 'custom';
2470
+ };
2471
+ /**
2472
+ * ID of the [User](#schema_user)
2473
+ */
2474
+ userId: string;
2475
+ /**
2476
+ * ID of the [Conversation](#schema_conversation)
2477
+ */
2478
+ conversationId: string;
2479
+ /**
2480
+ * Metadata of the message
2481
+ */
2482
+ metadata?: {};
2483
+ /**
2484
+ * ID of the message this message is replying to
2485
+ */
2486
+ replyTo?: string;
2487
+ /**
2488
+ * ID of the user who selected this message. Undefined if not selected.
2489
+ */
2490
+ selectedBy?: string;
2491
+ /**
2492
+ * Feedback of the message
2493
+ */
2494
+ feedback?: {
2495
+ value: 'positive' | 'negative';
2496
+ comment?: string;
2497
+ };
2498
+ };
1761
2499
  }>;
1762
2500
  meta: {
1763
2501
  /**
@@ -2689,6 +3427,12 @@ declare type ParticipantRemoved = {
2689
3427
  };
2690
3428
  };
2691
3429
 
3430
+ export declare type Perf = {
3431
+ duration: number;
3432
+ event: string;
3433
+ properties: {};
3434
+ };
3435
+
2692
3436
  declare type QuerySerializer = (query: Record<string, unknown>) => string;
2693
3437
 
2694
3438
  declare interface QuerySerializerOptions {
@@ -2897,6 +3641,60 @@ export declare type SelectMessageResponses = {
2897
3641
  };
2898
3642
  };
2899
3643
 
3644
+ export declare const sendPerfMetrics: (clientId: string, body: ClientTypes_2.SendPerfMetricsBody, apiUrl?: string, customHeaders?: Record<string, string>) => Promise<{
3645
+ [key: string]: never;
3646
+ }>;
3647
+
3648
+ /**
3649
+ * Sends performance metrics to the server.
3650
+ */
3651
+ declare const sendPerfMetrics_2: <ThrowOnError extends boolean = false>(options?: Options<SendPerfMetricsData, ThrowOnError>) => RequestResult<{
3652
+ [key: string]: never;
3653
+ }, {
3654
+ [key: string]: never;
3655
+ }, ThrowOnError>;
3656
+
3657
+ /**
3658
+ * Performance metrics
3659
+ */
3660
+ export declare type SendPerfMetricsBody = {
3661
+ duration: number;
3662
+ event: string;
3663
+ properties: {};
3664
+ };
3665
+
3666
+ export declare type SendPerfMetricsData = {
3667
+ /**
3668
+ * Performance metrics
3669
+ */
3670
+ body?: SendPerfMetricsBody;
3671
+ path?: never;
3672
+ query?: never;
3673
+ url: '/p';
3674
+ };
3675
+
3676
+ export declare type SendPerfMetricsError = SendPerfMetricsErrors[keyof SendPerfMetricsErrors];
3677
+
3678
+ export declare type SendPerfMetricsErrors = {
3679
+ /**
3680
+ * Returns nothing
3681
+ */
3682
+ default: {
3683
+ [key: string]: never;
3684
+ };
3685
+ };
3686
+
3687
+ export declare type SendPerfMetricsResponse = SendPerfMetricsResponses[keyof SendPerfMetricsResponses];
3688
+
3689
+ export declare type SendPerfMetricsResponses = {
3690
+ /**
3691
+ * Returns nothing
3692
+ */
3693
+ 200: {
3694
+ [key: string]: never;
3695
+ };
3696
+ };
3697
+
2900
3698
  declare interface SerializerOptions<T> {
2901
3699
  /**
2902
3700
  * @default true