@livechat/customer-sdk 4.0.2 → 5.0.1

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/types/index.d.ts CHANGED
@@ -1,9 +1,4 @@
1
- import { UploadFileOptions } from './uploadFile';
2
1
  import * as actions from './actions';
3
- import { RequestBodyResumeChatData, RequestBodyStartChatData } from './clientDataParsers';
4
- import { Config, Env, Page, SortOrder } from './types';
5
- import * as clientEntities from './types/clientEntities';
6
- export { default as debug } from './debug';
7
2
  import * as connectionStatuses from './constants/connectionStatuses';
8
3
  import * as eventTypes from './constants/eventTypes';
9
4
  import * as serverDisconnectionReasons from './constants/serverDisconnectionReasons';
@@ -11,13 +6,21 @@ import * as serverErrorCodes from './constants/serverErrorCodes';
11
6
  import * as serverPushActions from './constants/serverPushActions';
12
7
  import * as sortOrders from './constants/sortOrders';
13
8
  import * as userTypes from './constants/userTypes';
9
+ import * as clientEntities from './types/clientEntities';
10
+ import { RequestBodyResumeChatData, RequestBodyStartChatData } from './clientDataParsers';
11
+ import { SendCustomerActionsOptions } from './sendCustomerActions';
12
+ import { SendGreetingButtonClickedOptions } from './sendGreetingButtonClicked';
13
+ import { Config, Page, SortOrder } from './types';
14
+ import { UploadFileOptions } from './uploadFile';
15
+ export { default as debug } from './debug';
14
16
  export { connectionStatuses, eventTypes, serverDisconnectionReasons, serverErrorCodes, serverPushActions, sortOrders, userTypes, };
15
17
  export * from './types/clientEntities';
16
18
  export type { CustomerSessionFields, CustomerData, CustomerDataProvider, IdentityProvider, Config, ConnectionStatus, Page, SortOrder, SubscribablePush, } from './types/index';
17
19
  export type { CustomerAuth, CustomerAuthToken } from '@livechat/customer-auth';
20
+ export type { SendCustomerActionsAction, SendCustomerActionsOptions } from './sendCustomerActions';
18
21
  export * from './serverEventParser';
19
22
  export { parseForm } from './serverFrameParser';
20
- export declare const init: (config: Config, env: Env | undefined, licenseId: number) => Readonly<{
23
+ export declare const init: (config: Config) => Readonly<{
21
24
  acceptGreeting({ greetingId, uniqueId }: {
22
25
  greetingId: number;
23
26
  uniqueId: string;
@@ -107,9 +110,6 @@ export declare const init: (config: Config, env: Env | undefined, licenseId: num
107
110
  };
108
111
  enabled: true;
109
112
  }>;
110
- getPredictedAgent(params?: {
111
- groupId?: number;
112
- }): Promise<clientEntities.PredictedAgent>;
113
113
  getUrlInfo({ url }: {
114
114
  url: string;
115
115
  }): Promise<clientEntities.UrlInfo>;
@@ -193,8 +193,26 @@ export declare const init: (config: Config, env: Env | undefined, licenseId: num
193
193
  }): Promise<Readonly<{
194
194
  readonly success: true;
195
195
  }>>;
196
+ requestWelcomeMessage({ id }?: {
197
+ id?: string | undefined;
198
+ }): Promise<{
199
+ id: string;
200
+ predictedAgent: {
201
+ avatar: string;
202
+ id: string;
203
+ name: string;
204
+ jobTitle: string;
205
+ type: "agent";
206
+ isBot: boolean;
207
+ } & {
208
+ botType: "chatbot" | "ai_agent";
209
+ };
210
+ queue: boolean;
211
+ }>;
196
212
  resumeChat(data: RequestBodyResumeChatData): Promise<clientEntities.IncomingChat>;
197
213
  sendEvent(params: Parameters<typeof actions.sendEvent>[0]): Promise<clientEntities.Event>;
214
+ sendGreetingButtonClicked(options: SendGreetingButtonClickedOptions): Promise<void>;
215
+ sendCustomerActions(options: SendCustomerActionsOptions): Promise<void>;
198
216
  sendRichMessagePostback({ chatId, threadId, eventId, postback, }: {
199
217
  chatId: string;
200
218
  threadId: string;
@@ -1,3 +1,4 @@
1
+ /// <reference types="ts-toolbelt" />
1
2
  import { Action } from './types/actions';
2
3
  import { InitialStateData, State } from './types/state';
3
4
  export declare const getAllRequests: (state: State) => Record<string, {
@@ -6,6 +7,17 @@ export declare const getAllRequests: (state: State) => Record<string, {
6
7
  resolve: (val: any) => void;
7
8
  reject: (err: any) => void;
8
9
  request: import("Object/Pick")._Pick<{
10
+ request_id: string;
11
+ version?: string | undefined;
12
+ action: "list_threads";
13
+ payload: {
14
+ chat_id: string;
15
+ sort_order?: "asc" | "desc" | undefined;
16
+ limit?: number | undefined;
17
+ page_id?: string | undefined;
18
+ min_events_count?: number | undefined;
19
+ };
20
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
9
21
  request_id: string;
10
22
  version?: string | undefined;
11
23
  action: "accept_greeting";
@@ -13,21 +25,21 @@ export declare const getAllRequests: (state: State) => Record<string, {
13
25
  greeting_id: number;
14
26
  unique_id: string;
15
27
  };
16
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
28
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
17
29
  request_id: string;
18
30
  version?: string | undefined;
19
31
  action: "cancel_greeting";
20
32
  payload: {
21
33
  unique_id: string;
22
34
  };
23
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
35
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
24
36
  request_id: string;
25
37
  version?: string | undefined;
26
38
  action: "deactivate_chat";
27
39
  payload: {
28
40
  id: string;
29
41
  };
30
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
42
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
31
43
  request_id: string;
32
44
  version?: string | undefined;
33
45
  action: "delete_chat_properties";
@@ -35,7 +47,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
35
47
  id: string;
36
48
  properties: Record<string, string[]>;
37
49
  };
38
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
50
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
39
51
  request_id: string;
40
52
  version?: string | undefined;
41
53
  action: "delete_event_properties";
@@ -45,7 +57,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
45
57
  event_id: string;
46
58
  properties: Record<string, string[]>;
47
59
  };
48
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
60
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
49
61
  request_id: string;
50
62
  version?: string | undefined;
51
63
  action: "delete_thread_properties";
@@ -54,7 +66,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
54
66
  thread_id: string;
55
67
  properties: Record<string, string[]>;
56
68
  };
57
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
69
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
58
70
  request_id: string;
59
71
  version?: string | undefined;
60
72
  action: "get_chat";
@@ -62,14 +74,14 @@ export declare const getAllRequests: (state: State) => Record<string, {
62
74
  chat_id: string;
63
75
  thread_id?: string | undefined;
64
76
  };
65
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
77
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
66
78
  request_id: string;
67
79
  version?: string | undefined;
68
80
  action: "get_customer";
69
81
  payload: {
70
82
  [x: string]: never;
71
83
  };
72
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
84
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
73
85
  request_id: string;
74
86
  version?: string | undefined;
75
87
  action: "get_form";
@@ -77,21 +89,14 @@ export declare const getAllRequests: (state: State) => Record<string, {
77
89
  type: import("./types/serverEntities").FormType;
78
90
  group_id: number;
79
91
  };
80
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
81
- request_id: string;
82
- version?: string | undefined;
83
- action: "get_predicted_agent";
84
- payload: {
85
- group_id?: number | undefined;
86
- };
87
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
92
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
88
93
  request_id: string;
89
94
  version?: string | undefined;
90
95
  action: "get_url_info";
91
96
  payload: {
92
97
  url: string;
93
98
  };
94
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
99
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
95
100
  request_id: string;
96
101
  version?: string | undefined;
97
102
  action: "list_group_statuses";
@@ -100,7 +105,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
100
105
  } | {
101
106
  all: true;
102
107
  };
103
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
108
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
104
109
  request_id: string;
105
110
  version?: string | undefined;
106
111
  action: "list_chats";
@@ -108,18 +113,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
108
113
  limit?: number | undefined;
109
114
  page_id?: string | undefined;
110
115
  };
111
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
112
- request_id: string;
113
- version?: string | undefined;
114
- action: "list_threads";
115
- payload: {
116
- chat_id: string;
117
- sort_order?: "asc" | "desc" | undefined;
118
- limit?: number | undefined;
119
- page_id?: string | undefined;
120
- min_events_count?: number | undefined;
121
- };
122
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
116
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
123
117
  request_id: string;
124
118
  version?: string | undefined;
125
119
  action: "login";
@@ -139,9 +133,10 @@ export declare const getAllRequests: (state: State) => Record<string, {
139
133
  is_mobile?: boolean | undefined;
140
134
  group_id?: number | undefined;
141
135
  referrer?: string | undefined;
136
+ tab_id?: string | undefined;
142
137
  pushes?: Record<string, readonly import("./types").SubscribablePush[]> | undefined;
143
138
  };
144
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
139
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
145
140
  request_id: string;
146
141
  version?: string | undefined;
147
142
  action: "mark_events_as_seen";
@@ -149,7 +144,14 @@ export declare const getAllRequests: (state: State) => Record<string, {
149
144
  chat_id: string;
150
145
  seen_up_to: string;
151
146
  };
152
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
147
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
148
+ request_id: string;
149
+ version?: string | undefined;
150
+ action: "request_welcome_message";
151
+ payload: {
152
+ id?: string | undefined;
153
+ };
154
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
153
155
  request_id: string;
154
156
  version?: string | undefined;
155
157
  action: "resume_chat";
@@ -166,7 +168,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
166
168
  };
167
169
  continuous?: boolean | undefined;
168
170
  };
169
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
171
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
170
172
  request_id: string;
171
173
  version?: string | undefined;
172
174
  action: "send_event";
@@ -175,7 +177,15 @@ export declare const getAllRequests: (state: State) => Record<string, {
175
177
  event: import("./types/serverEntities").RequestBodyEvent;
176
178
  attach_to_last_thread?: boolean | undefined;
177
179
  };
178
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
180
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
181
+ request_id: string;
182
+ version?: string | undefined;
183
+ action: "send_greeting_button_clicked";
184
+ payload: {
185
+ greeting_unique_id: string;
186
+ button_id: string;
187
+ };
188
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
179
189
  request_id: string;
180
190
  version?: string | undefined;
181
191
  action: "send_rich_message_postback";
@@ -188,7 +198,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
188
198
  toggled: boolean;
189
199
  };
190
200
  };
191
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
201
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
192
202
  request_id: string;
193
203
  version?: string | undefined;
194
204
  action: "send_sneak_peek";
@@ -196,14 +206,14 @@ export declare const getAllRequests: (state: State) => Record<string, {
196
206
  chat_id: string;
197
207
  sneak_peek_text: string;
198
208
  };
199
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
209
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
200
210
  request_id: string;
201
211
  version?: string | undefined;
202
212
  action: "set_customer_session_fields";
203
213
  payload: {
204
214
  session_fields: import("./types/serverEntities").CustomerSessionFields;
205
215
  };
206
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
216
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
207
217
  request_id: string;
208
218
  version?: string | undefined;
209
219
  action: "start_chat";
@@ -219,7 +229,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
219
229
  } | undefined;
220
230
  continuous?: boolean | undefined;
221
231
  };
222
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
232
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
223
233
  request_id: string;
224
234
  version?: string | undefined;
225
235
  action: "update_chat_properties";
@@ -227,7 +237,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
227
237
  id: string;
228
238
  properties: import("./types/serverEntities").Properties;
229
239
  };
230
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
240
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
231
241
  request_id: string;
232
242
  version?: string | undefined;
233
243
  action: "update_customer_page";
@@ -235,7 +245,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
235
245
  url: string;
236
246
  title?: string | undefined;
237
247
  };
238
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
248
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
239
249
  request_id: string;
240
250
  version?: string | undefined;
241
251
  action: "update_customer";
@@ -245,7 +255,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
245
255
  email?: string | undefined;
246
256
  fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
247
257
  };
248
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
258
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
249
259
  request_id: string;
250
260
  version?: string | undefined;
251
261
  action: "update_event_properties";
@@ -255,7 +265,7 @@ export declare const getAllRequests: (state: State) => Record<string, {
255
265
  event_id: string;
256
266
  properties: import("./types/serverEntities").Properties;
257
267
  };
258
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
268
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
259
269
  request_id: string;
260
270
  version?: string | undefined;
261
271
  action: "update_thread_properties";
@@ -264,15 +274,26 @@ export declare const getAllRequests: (state: State) => Record<string, {
264
274
  thread_id: string;
265
275
  properties: import("./types/serverEntities").Properties;
266
276
  };
267
- }, "action" | "payload">;
277
+ }, "payload" | "action">;
268
278
  }>;
269
- export declare const getConnectionStatus: (state: State) => "connected" | "destroyed" | "disconnected" | "paused" | "reconnecting";
279
+ export declare const getConnectionStatus: (state: State) => "disconnected" | "connected" | "destroyed" | "paused" | "reconnecting";
270
280
  export declare const getRequest: (state: State, id: string) => {
271
281
  id: string;
272
282
  promise: Promise<any>;
273
283
  resolve: (val: any) => void;
274
284
  reject: (err: any) => void;
275
285
  request: import("Object/Pick")._Pick<{
286
+ request_id: string;
287
+ version?: string | undefined;
288
+ action: "list_threads";
289
+ payload: {
290
+ chat_id: string;
291
+ sort_order?: "asc" | "desc" | undefined;
292
+ limit?: number | undefined;
293
+ page_id?: string | undefined;
294
+ min_events_count?: number | undefined;
295
+ };
296
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
276
297
  request_id: string;
277
298
  version?: string | undefined;
278
299
  action: "accept_greeting";
@@ -280,21 +301,21 @@ export declare const getRequest: (state: State, id: string) => {
280
301
  greeting_id: number;
281
302
  unique_id: string;
282
303
  };
283
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
304
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
284
305
  request_id: string;
285
306
  version?: string | undefined;
286
307
  action: "cancel_greeting";
287
308
  payload: {
288
309
  unique_id: string;
289
310
  };
290
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
311
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
291
312
  request_id: string;
292
313
  version?: string | undefined;
293
314
  action: "deactivate_chat";
294
315
  payload: {
295
316
  id: string;
296
317
  };
297
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
318
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
298
319
  request_id: string;
299
320
  version?: string | undefined;
300
321
  action: "delete_chat_properties";
@@ -302,7 +323,7 @@ export declare const getRequest: (state: State, id: string) => {
302
323
  id: string;
303
324
  properties: Record<string, string[]>;
304
325
  };
305
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
326
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
306
327
  request_id: string;
307
328
  version?: string | undefined;
308
329
  action: "delete_event_properties";
@@ -312,7 +333,7 @@ export declare const getRequest: (state: State, id: string) => {
312
333
  event_id: string;
313
334
  properties: Record<string, string[]>;
314
335
  };
315
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
336
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
316
337
  request_id: string;
317
338
  version?: string | undefined;
318
339
  action: "delete_thread_properties";
@@ -321,7 +342,7 @@ export declare const getRequest: (state: State, id: string) => {
321
342
  thread_id: string;
322
343
  properties: Record<string, string[]>;
323
344
  };
324
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
345
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
325
346
  request_id: string;
326
347
  version?: string | undefined;
327
348
  action: "get_chat";
@@ -329,14 +350,14 @@ export declare const getRequest: (state: State, id: string) => {
329
350
  chat_id: string;
330
351
  thread_id?: string | undefined;
331
352
  };
332
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
353
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
333
354
  request_id: string;
334
355
  version?: string | undefined;
335
356
  action: "get_customer";
336
357
  payload: {
337
358
  [x: string]: never;
338
359
  };
339
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
360
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
340
361
  request_id: string;
341
362
  version?: string | undefined;
342
363
  action: "get_form";
@@ -344,21 +365,14 @@ export declare const getRequest: (state: State, id: string) => {
344
365
  type: import("./types/serverEntities").FormType;
345
366
  group_id: number;
346
367
  };
347
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
348
- request_id: string;
349
- version?: string | undefined;
350
- action: "get_predicted_agent";
351
- payload: {
352
- group_id?: number | undefined;
353
- };
354
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
368
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
355
369
  request_id: string;
356
370
  version?: string | undefined;
357
371
  action: "get_url_info";
358
372
  payload: {
359
373
  url: string;
360
374
  };
361
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
375
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
362
376
  request_id: string;
363
377
  version?: string | undefined;
364
378
  action: "list_group_statuses";
@@ -367,7 +381,7 @@ export declare const getRequest: (state: State, id: string) => {
367
381
  } | {
368
382
  all: true;
369
383
  };
370
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
384
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
371
385
  request_id: string;
372
386
  version?: string | undefined;
373
387
  action: "list_chats";
@@ -375,18 +389,7 @@ export declare const getRequest: (state: State, id: string) => {
375
389
  limit?: number | undefined;
376
390
  page_id?: string | undefined;
377
391
  };
378
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
379
- request_id: string;
380
- version?: string | undefined;
381
- action: "list_threads";
382
- payload: {
383
- chat_id: string;
384
- sort_order?: "asc" | "desc" | undefined;
385
- limit?: number | undefined;
386
- page_id?: string | undefined;
387
- min_events_count?: number | undefined;
388
- };
389
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
392
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
390
393
  request_id: string;
391
394
  version?: string | undefined;
392
395
  action: "login";
@@ -406,9 +409,10 @@ export declare const getRequest: (state: State, id: string) => {
406
409
  is_mobile?: boolean | undefined;
407
410
  group_id?: number | undefined;
408
411
  referrer?: string | undefined;
412
+ tab_id?: string | undefined;
409
413
  pushes?: Record<string, readonly import("./types").SubscribablePush[]> | undefined;
410
414
  };
411
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
415
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
412
416
  request_id: string;
413
417
  version?: string | undefined;
414
418
  action: "mark_events_as_seen";
@@ -416,7 +420,14 @@ export declare const getRequest: (state: State, id: string) => {
416
420
  chat_id: string;
417
421
  seen_up_to: string;
418
422
  };
419
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
423
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
424
+ request_id: string;
425
+ version?: string | undefined;
426
+ action: "request_welcome_message";
427
+ payload: {
428
+ id?: string | undefined;
429
+ };
430
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
420
431
  request_id: string;
421
432
  version?: string | undefined;
422
433
  action: "resume_chat";
@@ -433,7 +444,7 @@ export declare const getRequest: (state: State, id: string) => {
433
444
  };
434
445
  continuous?: boolean | undefined;
435
446
  };
436
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
447
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
437
448
  request_id: string;
438
449
  version?: string | undefined;
439
450
  action: "send_event";
@@ -442,7 +453,15 @@ export declare const getRequest: (state: State, id: string) => {
442
453
  event: import("./types/serverEntities").RequestBodyEvent;
443
454
  attach_to_last_thread?: boolean | undefined;
444
455
  };
445
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
456
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
457
+ request_id: string;
458
+ version?: string | undefined;
459
+ action: "send_greeting_button_clicked";
460
+ payload: {
461
+ greeting_unique_id: string;
462
+ button_id: string;
463
+ };
464
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
446
465
  request_id: string;
447
466
  version?: string | undefined;
448
467
  action: "send_rich_message_postback";
@@ -455,7 +474,7 @@ export declare const getRequest: (state: State, id: string) => {
455
474
  toggled: boolean;
456
475
  };
457
476
  };
458
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
477
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
459
478
  request_id: string;
460
479
  version?: string | undefined;
461
480
  action: "send_sneak_peek";
@@ -463,14 +482,14 @@ export declare const getRequest: (state: State, id: string) => {
463
482
  chat_id: string;
464
483
  sneak_peek_text: string;
465
484
  };
466
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
485
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
467
486
  request_id: string;
468
487
  version?: string | undefined;
469
488
  action: "set_customer_session_fields";
470
489
  payload: {
471
490
  session_fields: import("./types/serverEntities").CustomerSessionFields;
472
491
  };
473
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
492
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
474
493
  request_id: string;
475
494
  version?: string | undefined;
476
495
  action: "start_chat";
@@ -486,7 +505,7 @@ export declare const getRequest: (state: State, id: string) => {
486
505
  } | undefined;
487
506
  continuous?: boolean | undefined;
488
507
  };
489
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
508
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
490
509
  request_id: string;
491
510
  version?: string | undefined;
492
511
  action: "update_chat_properties";
@@ -494,7 +513,7 @@ export declare const getRequest: (state: State, id: string) => {
494
513
  id: string;
495
514
  properties: import("./types/serverEntities").Properties;
496
515
  };
497
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
516
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
498
517
  request_id: string;
499
518
  version?: string | undefined;
500
519
  action: "update_customer_page";
@@ -502,7 +521,7 @@ export declare const getRequest: (state: State, id: string) => {
502
521
  url: string;
503
522
  title?: string | undefined;
504
523
  };
505
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
524
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
506
525
  request_id: string;
507
526
  version?: string | undefined;
508
527
  action: "update_customer";
@@ -512,7 +531,7 @@ export declare const getRequest: (state: State, id: string) => {
512
531
  email?: string | undefined;
513
532
  fields?: import("./types/serverEntities").CustomerSessionFields | undefined;
514
533
  };
515
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
534
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
516
535
  request_id: string;
517
536
  version?: string | undefined;
518
537
  action: "update_event_properties";
@@ -522,7 +541,7 @@ export declare const getRequest: (state: State, id: string) => {
522
541
  event_id: string;
523
542
  properties: import("./types/serverEntities").Properties;
524
543
  };
525
- }, "action" | "payload"> | import("Object/Pick")._Pick<{
544
+ }, "payload" | "action"> | import("Object/Pick")._Pick<{
526
545
  request_id: string;
527
546
  version?: string | undefined;
528
547
  action: "update_thread_properties";
@@ -531,12 +550,17 @@ export declare const getRequest: (state: State, id: string) => {
531
550
  thread_id: string;
532
551
  properties: import("./types/serverEntities").Properties;
533
552
  };
534
- }, "action" | "payload">;
553
+ }, "payload" | "action">;
535
554
  };
536
555
  export declare const getSelfId: (state: State) => string | null;
537
556
  export declare const isChatActive: (state: State, chatId: string) => boolean;
538
557
  export declare const isConnected: (state: State) => boolean;
539
558
  export declare const isDestroyed: (state: State) => boolean;
559
+ export declare const getRegionParam: <O extends {
560
+ region?: string | null | undefined;
561
+ }>(options: O) => {
562
+ 'x-region': string;
563
+ } | Record<string, never>;
540
564
  export declare const getApiOrigin: (state: State) => string;
541
565
  export declare const getServerUrl: (state: State) => string;
542
566
  export declare const createInitialState: (initialStateData: InitialStateData) => State;
@@ -0,0 +1,17 @@
1
+ import { CustomerAuth } from '@livechat/customer-auth';
2
+ import { Store } from './types';
3
+ type SendCustomerActionsDependencies = {
4
+ auth: CustomerAuth;
5
+ store: Store;
6
+ };
7
+ export type SendCustomerActionsAction = {
8
+ type: 'click' | 'submit';
9
+ timestamp: string;
10
+ properties: Record<string, any>;
11
+ };
12
+ export type SendCustomerActionsOptions = {
13
+ actions: SendCustomerActionsAction[];
14
+ };
15
+ declare const sendCustomerActions: ({ auth, store }: SendCustomerActionsDependencies, { actions }: SendCustomerActionsOptions) => Promise<void>;
16
+ export default sendCustomerActions;
17
+ //# sourceMappingURL=sendCustomerActions.d.ts.map
@@ -0,0 +1,13 @@
1
+ import { CustomerAuth } from '@livechat/customer-auth';
2
+ import { Store } from './types';
3
+ type SendGreetingButtonClickedDependencies = {
4
+ auth: CustomerAuth;
5
+ store: Store;
6
+ };
7
+ export type SendGreetingButtonClickedOptions = {
8
+ greetingUniqueId: string;
9
+ buttonId: string;
10
+ };
11
+ declare const sendGreetingButtonClicked: ({ auth, store }: SendGreetingButtonClickedDependencies, { greetingUniqueId, buttonId }: SendGreetingButtonClickedOptions) => Promise<void>;
12
+ export default sendGreetingButtonClicked;
13
+ //# sourceMappingURL=sendGreetingButtonClicked.d.ts.map