@opens/gateways 1.6.0 → 1.8.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/assets/contracts/index.d.mts +33 -0
- package/dist/assets/contracts/index.d.ts +33 -0
- package/dist/assets/contracts/index.js +19 -0
- package/dist/assets/contracts/index.js.map +1 -0
- package/dist/assets/contracts/index.mjs +1 -0
- package/dist/assets/contracts/index.mjs.map +1 -0
- package/dist/campaigns/contracts/index.d.mts +248 -0
- package/dist/campaigns/contracts/index.d.ts +248 -0
- package/dist/campaigns/contracts/index.js +19 -0
- package/dist/campaigns/contracts/index.js.map +1 -0
- package/dist/campaigns/contracts/index.mjs +1 -0
- package/dist/campaigns/contracts/index.mjs.map +1 -0
- package/dist/chat-adapter/contracts/index.d.mts +67 -0
- package/dist/chat-adapter/contracts/index.d.ts +67 -0
- package/dist/chat-adapter/contracts/index.js +19 -0
- package/dist/chat-adapter/contracts/index.js.map +1 -0
- package/dist/chat-adapter/contracts/index.mjs +1 -0
- package/dist/chat-adapter/contracts/index.mjs.map +1 -0
- package/dist/chat-config/contracts/index.d.mts +201 -0
- package/dist/chat-config/contracts/index.d.ts +201 -0
- package/dist/chat-config/contracts/index.js +19 -0
- package/dist/chat-config/contracts/index.js.map +1 -0
- package/dist/chat-config/contracts/index.mjs +1 -0
- package/dist/chat-config/contracts/index.mjs.map +1 -0
- package/dist/contact-list/contracts/index.d.mts +46 -0
- package/dist/contact-list/contracts/index.d.ts +46 -0
- package/dist/contact-list/contracts/index.js +19 -0
- package/dist/contact-list/contracts/index.js.map +1 -0
- package/dist/contact-list/contracts/index.mjs +1 -0
- package/dist/contact-list/contracts/index.mjs.map +1 -0
- package/dist/customer-service/contracts/index.d.mts +95 -0
- package/dist/customer-service/contracts/index.d.ts +95 -0
- package/dist/customer-service/contracts/index.js +19 -0
- package/dist/customer-service/contracts/index.js.map +1 -0
- package/dist/customer-service/contracts/index.mjs +1 -0
- package/dist/customer-service/contracts/index.mjs.map +1 -0
- package/dist/index.d.mts +46 -612
- package/dist/index.d.ts +46 -612
- package/dist/index.js +69 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +69 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,98 +1,16 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
limit_bad_password: number;
|
|
15
|
-
watching: boolean;
|
|
16
|
-
trial: boolean;
|
|
17
|
-
support_widget_id: string;
|
|
18
|
-
createdAt: string;
|
|
19
|
-
updatedAt: string;
|
|
20
|
-
}
|
|
21
|
-
/** Response returned by the Customer Service API when fetching a company. */
|
|
22
|
-
interface CompanyResponse {
|
|
23
|
-
company: CompanyData;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/** A work group entity nested within {@link WorkGroupListResponse} and {@link WorkGroupResponse}. */
|
|
27
|
-
interface WorkGroup {
|
|
28
|
-
id: string;
|
|
29
|
-
name: string;
|
|
30
|
-
description: string | null;
|
|
31
|
-
type: 'default' | 'user';
|
|
32
|
-
company_id: string;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
}
|
|
36
|
-
/** Response returned by the Customer Service API when fetching the work groups list. */
|
|
37
|
-
interface WorkGroupListResponse extends CompanyData {
|
|
38
|
-
workgroups: WorkGroup[];
|
|
39
|
-
}
|
|
40
|
-
/** A user membership entity nested within {@link WorkGroupResponse}. */
|
|
41
|
-
interface WorkGroupMember {
|
|
42
|
-
id: string;
|
|
43
|
-
username: string;
|
|
44
|
-
email: string;
|
|
45
|
-
profile: 'p_admin' | 'p_manager' | 'p_corporative' | 'p_agent';
|
|
46
|
-
status: 'new' | 'activated' | 'disabled';
|
|
47
|
-
avatar: string | null;
|
|
48
|
-
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
|
-
}
|
|
51
|
-
/** Response returned by the Customer Service API when fetching a single work group. */
|
|
52
|
-
interface WorkGroupResponse {
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
description: string | null;
|
|
56
|
-
type: 'default' | 'user';
|
|
57
|
-
company_id: string;
|
|
58
|
-
createdAt: string;
|
|
59
|
-
updatedAt: string;
|
|
60
|
-
workgroups_users: WorkGroupMember[];
|
|
61
|
-
}
|
|
62
|
-
/** Response returned by the Customer Service API when fetching members of a work group. */
|
|
63
|
-
type WorkGroupMembersResponse = WorkGroupMember[];
|
|
64
|
-
|
|
65
|
-
interface User {
|
|
66
|
-
id: string;
|
|
67
|
-
username: string;
|
|
68
|
-
email: string;
|
|
69
|
-
profile: 'p_admin' | 'p_manager' | 'p_corporative' | 'p_agent';
|
|
70
|
-
status: 'new' | 'activated' | 'disabled';
|
|
71
|
-
avatar: string | null;
|
|
72
|
-
type: string;
|
|
73
|
-
companyId: string;
|
|
74
|
-
createdAt: string;
|
|
75
|
-
updatedAt: string;
|
|
76
|
-
}
|
|
77
|
-
interface GetAllUsersParams {
|
|
78
|
-
status?: string;
|
|
79
|
-
includeWorkGroups?: boolean;
|
|
80
|
-
withoutOpensUsers?: boolean;
|
|
81
|
-
}
|
|
82
|
-
interface GetAllUsersResponse {
|
|
83
|
-
users: User[];
|
|
84
|
-
}
|
|
85
|
-
interface ManagedUser {
|
|
86
|
-
id: string;
|
|
87
|
-
username: string;
|
|
88
|
-
email: string;
|
|
89
|
-
profile: string;
|
|
90
|
-
status: string;
|
|
91
|
-
companyId: string;
|
|
92
|
-
createdAt: string;
|
|
93
|
-
updatedAt: string;
|
|
94
|
-
}
|
|
95
|
-
type GetManagedUsersResponse = ManagedUser[];
|
|
2
|
+
import { CompanyResponse, WorkGroupListResponse, WorkGroupResponse, WorkGroupMembersResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse } from './customer-service/contracts/index.mjs';
|
|
3
|
+
export { CompanyData, ManagedUser, User, WorkGroup, WorkGroupMember } from './customer-service/contracts/index.mjs';
|
|
4
|
+
import { ProviderListResponse, GetConfigsByProviderParams, ConfigListByProviderResponse, Queue, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, FindOrCreateQueueRuleRequest, QueueRule } from './chat-config/contracts/index.mjs';
|
|
5
|
+
export { Config, ConfigProvider, DistributionType, MetaTemplateButton, Provider, QueueListResponse, QueueMember } from './chat-config/contracts/index.mjs';
|
|
6
|
+
import { CampaignQueryParams, CampaignPaginatedResponse, Campaign, CreateCampaignRequest, PatchCampaignRequest, CampaignContactQueryParams, CampaignContactPaginatedResponse, CampaignContactResponse, CreateCampaignContactRequest, PatchCampaignContactRequest, CampaignUser, CampaignWorkGroupQueryParams, CampaignWorkGroupPaginatedResponse, CreateCampaignWorkGroupRequest, CampaignWorkGroup } from './campaigns/contracts/index.mjs';
|
|
7
|
+
export { CampaignContactCampaignStatus, CampaignContactDispatchStatus, CampaignContactFilter, CampaignContactLikeQueryOperators, CampaignContactQueryOperators, CampaignContactQueryValue, CampaignContactSortDirection, CampaignContactSortParams, CampaignProvider, CampaignSchedule, CampaignStatus, WhatsAppPayload, WhatsAppTemplateComponent } from './campaigns/contracts/index.mjs';
|
|
8
|
+
import { GetConfigTemplatesParams, GetConfigTemplatesResponse } from './chat-adapter/contracts/index.mjs';
|
|
9
|
+
export { ConfigTemplatesPaging, MessageTemplate, MessageTemplateComponent } from './chat-adapter/contracts/index.mjs';
|
|
10
|
+
import { GetPresignedUrlRequest, UploadPresignedUrlResponse, AudioConvertResponse } from './assets/contracts/index.mjs';
|
|
11
|
+
export { IUploadPresignedUrlResponse } from './assets/contracts/index.mjs';
|
|
12
|
+
import { GetContactPhonesParams, ContactPhoneSearchResponse, ContactCategoryResponse } from './contact-list/contracts/index.mjs';
|
|
13
|
+
export { ContactPhoneResponse } from './contact-list/contracts/index.mjs';
|
|
96
14
|
|
|
97
15
|
/**
|
|
98
16
|
* Gateway for interacting with the Customer Service API.
|
|
@@ -132,206 +50,6 @@ declare class CustomerServiceGateway {
|
|
|
132
50
|
getManagedUsers(managerId: string): Promise<GetManagedUsersResponse>;
|
|
133
51
|
}
|
|
134
52
|
|
|
135
|
-
/** A provider entity returned by the Chat Config API. */
|
|
136
|
-
interface Provider {
|
|
137
|
-
id: string;
|
|
138
|
-
name: string;
|
|
139
|
-
configurationsSchema: Record<string, unknown> | null;
|
|
140
|
-
defaultSession: number;
|
|
141
|
-
type: string;
|
|
142
|
-
createdAt: string;
|
|
143
|
-
updatedAt: string;
|
|
144
|
-
}
|
|
145
|
-
/** Response returned by the Chat Config API when listing providers. */
|
|
146
|
-
type ProviderListResponse = Provider[];
|
|
147
|
-
|
|
148
|
-
/** A provider entity nested within a configuration response. */
|
|
149
|
-
interface ConfigProvider {
|
|
150
|
-
id: string;
|
|
151
|
-
name: string;
|
|
152
|
-
type: string;
|
|
153
|
-
defaultSession: number;
|
|
154
|
-
configurationsSchema: Record<string, unknown> | null;
|
|
155
|
-
createdAt: string;
|
|
156
|
-
updatedAt: string;
|
|
157
|
-
}
|
|
158
|
-
/** A configuration entity returned by the Chat Config API. */
|
|
159
|
-
interface Config {
|
|
160
|
-
id: string;
|
|
161
|
-
isAssistanceEnabled: boolean;
|
|
162
|
-
rewind: number | null;
|
|
163
|
-
companyId: string;
|
|
164
|
-
active: boolean;
|
|
165
|
-
configurations: Record<string, unknown>;
|
|
166
|
-
priority: number | null;
|
|
167
|
-
inbound: boolean;
|
|
168
|
-
outbound: boolean;
|
|
169
|
-
deletedAt: string | null;
|
|
170
|
-
providers: ConfigProvider;
|
|
171
|
-
}
|
|
172
|
-
/** Response returned by the Chat Config API when listing configurations by provider. */
|
|
173
|
-
interface ConfigListByProviderResponse {
|
|
174
|
-
configurations: Config[];
|
|
175
|
-
}
|
|
176
|
-
/** Query parameters for filtering configurations by provider. */
|
|
177
|
-
interface GetConfigsByProviderParams {
|
|
178
|
-
isAssistanceEnabled?: boolean;
|
|
179
|
-
rewind?: number;
|
|
180
|
-
active?: boolean;
|
|
181
|
-
priority?: number;
|
|
182
|
-
inbound?: boolean;
|
|
183
|
-
outbound?: boolean;
|
|
184
|
-
providerType?: string;
|
|
185
|
-
providerName?: string;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
interface QueueMember {
|
|
189
|
-
id: string;
|
|
190
|
-
memberId: string;
|
|
191
|
-
priority: number;
|
|
192
|
-
permission: string;
|
|
193
|
-
lastAttendance: string;
|
|
194
|
-
lastInvite: string;
|
|
195
|
-
paused: boolean;
|
|
196
|
-
activeChat: number;
|
|
197
|
-
online: boolean;
|
|
198
|
-
companyId: string;
|
|
199
|
-
avatar: string;
|
|
200
|
-
username: string;
|
|
201
|
-
createdAt: string;
|
|
202
|
-
updatedAt: string;
|
|
203
|
-
queueId: string;
|
|
204
|
-
}
|
|
205
|
-
type DistributionType = {
|
|
206
|
-
id: string;
|
|
207
|
-
alias: string;
|
|
208
|
-
description: string;
|
|
209
|
-
createdAt: string;
|
|
210
|
-
updatedAt: string;
|
|
211
|
-
};
|
|
212
|
-
interface Queue {
|
|
213
|
-
id: string;
|
|
214
|
-
distributionTypeId: string;
|
|
215
|
-
companyId: string;
|
|
216
|
-
name: string;
|
|
217
|
-
strategy: 'leastrecent' | 'roundrobin' | 'random';
|
|
218
|
-
defaultQueue: boolean;
|
|
219
|
-
unlimitedService: boolean;
|
|
220
|
-
serviceLimit: number;
|
|
221
|
-
timeLimit: number;
|
|
222
|
-
skipOncallUsers: boolean;
|
|
223
|
-
csat: boolean;
|
|
224
|
-
csatAnswer: string;
|
|
225
|
-
csatTTL: number;
|
|
226
|
-
outsideBusinessHourMessage: string;
|
|
227
|
-
createCallbackOnExpired: boolean;
|
|
228
|
-
createCallbackOnOutsideBusinessHours: boolean;
|
|
229
|
-
archived: boolean;
|
|
230
|
-
isPrivate: boolean;
|
|
231
|
-
createdAt: string;
|
|
232
|
-
updatedAt: string;
|
|
233
|
-
members: QueueMember[];
|
|
234
|
-
distributionType: DistributionType;
|
|
235
|
-
}
|
|
236
|
-
/** Response returned when listing queues. */
|
|
237
|
-
interface QueueListResponse {
|
|
238
|
-
queues: Queue[];
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/** Representation of a button in a Meta template. */
|
|
242
|
-
interface MetaTemplateButton {
|
|
243
|
-
/** Unique identifier of the button. */
|
|
244
|
-
id: string;
|
|
245
|
-
/** Type of the button (e.g. 'URL', 'PHONE_NUMBER', 'QUICK_REPLY'). */
|
|
246
|
-
type: string;
|
|
247
|
-
/** Text displayed on the button. */
|
|
248
|
-
text: string;
|
|
249
|
-
/** Value of the button (e.g. URL or phone number). */
|
|
250
|
-
value?: string | null;
|
|
251
|
-
/** Dynamic variable of the button. */
|
|
252
|
-
variable?: string | null;
|
|
253
|
-
/** ID of the template configuration to which the button belongs. */
|
|
254
|
-
templateConfigId: string;
|
|
255
|
-
/** Creation date of the record. */
|
|
256
|
-
createdAt?: string;
|
|
257
|
-
/** Update date of the record. */
|
|
258
|
-
updatedAt?: string;
|
|
259
|
-
}
|
|
260
|
-
/** Detailed configuration of a Meta template. */
|
|
261
|
-
interface MetaTemplateConfigResponse {
|
|
262
|
-
/** Unique identifier of the template configuration. */
|
|
263
|
-
id: string;
|
|
264
|
-
/** Name of the template in Meta. */
|
|
265
|
-
name: string;
|
|
266
|
-
/** Identifier of the template in Meta. */
|
|
267
|
-
templateId: string;
|
|
268
|
-
/** Company identifier in Meta. */
|
|
269
|
-
companyId: string;
|
|
270
|
-
/** Format of the template (e.g. TEXT, IMAGE, VIDEO). */
|
|
271
|
-
format?: string | null;
|
|
272
|
-
/** Content of the template header. */
|
|
273
|
-
headerContent?: string | null;
|
|
274
|
-
/** Defines if the header has dynamic content (parameters). */
|
|
275
|
-
isDynamicHeader: boolean;
|
|
276
|
-
/** Type of the header (e.g. TEXT, IMAGE, DOCUMENT, VIDEO). */
|
|
277
|
-
headerType?: string | null;
|
|
278
|
-
/** Content of the template body. */
|
|
279
|
-
bodyContent?: string | null;
|
|
280
|
-
/** Type of the body (e.g. TEXT). */
|
|
281
|
-
bodyType?: string | null;
|
|
282
|
-
/** Content of the template footer. */
|
|
283
|
-
footerContent?: string | null;
|
|
284
|
-
/** Type of the footer (e.g. TEXT). */
|
|
285
|
-
footerType?: string | null;
|
|
286
|
-
/** ID of the configuration associated with the template. */
|
|
287
|
-
configId?: string | null;
|
|
288
|
-
/** ID of the provider associated with the template. */
|
|
289
|
-
providerId?: string | null;
|
|
290
|
-
/** Creation date of the record. */
|
|
291
|
-
createdAt?: string;
|
|
292
|
-
/** Update date of the record. */
|
|
293
|
-
updatedAt?: string;
|
|
294
|
-
/** List of buttons in the template. */
|
|
295
|
-
buttons?: MetaTemplateButton[];
|
|
296
|
-
}
|
|
297
|
-
/** Response containing the list of template configurations associated with a configuration. */
|
|
298
|
-
interface MetaTemplateConfigsResponse {
|
|
299
|
-
/** List of Meta template configurations. */
|
|
300
|
-
templatesConfig: MetaTemplateConfigResponse[];
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/** Request payload for finding or creating a queue rule. */
|
|
304
|
-
interface FindOrCreateQueueRuleRequest {
|
|
305
|
-
companyId: string;
|
|
306
|
-
queueId: string;
|
|
307
|
-
configId: string;
|
|
308
|
-
}
|
|
309
|
-
/** Response returned when finding or creating a queue rule. */
|
|
310
|
-
interface QueueRule {
|
|
311
|
-
id: string;
|
|
312
|
-
companyId: string;
|
|
313
|
-
name: string;
|
|
314
|
-
action: string;
|
|
315
|
-
message?: string;
|
|
316
|
-
automaticMessage?: Record<string, unknown>;
|
|
317
|
-
callOnQueue?: Record<string, unknown>;
|
|
318
|
-
uraDescription: string;
|
|
319
|
-
interactiveMessageId: string | null;
|
|
320
|
-
configId?: string;
|
|
321
|
-
queueId?: string;
|
|
322
|
-
redirectQueue: Record<string, unknown> | null;
|
|
323
|
-
redirectRuleId?: string;
|
|
324
|
-
questionnaire?: Record<string, unknown>;
|
|
325
|
-
webhook?: Record<string, unknown>;
|
|
326
|
-
isRoot: boolean;
|
|
327
|
-
redirectDefault: boolean;
|
|
328
|
-
redirectTimeout?: number;
|
|
329
|
-
delay?: number;
|
|
330
|
-
createdAt: string;
|
|
331
|
-
updatedAt: string;
|
|
332
|
-
flow?: Record<string, unknown>[];
|
|
333
|
-
}
|
|
334
|
-
|
|
335
53
|
/**
|
|
336
54
|
* Gateway for interacting with the Chat Config API.
|
|
337
55
|
*/
|
|
@@ -378,225 +96,6 @@ declare class ChatConfigGateway {
|
|
|
378
96
|
findOrCreateQueueRule(payload: FindOrCreateQueueRuleRequest): Promise<QueueRule>;
|
|
379
97
|
}
|
|
380
98
|
|
|
381
|
-
/** Campaign status literals. */
|
|
382
|
-
type CampaignStatus = 'ongoing' | 'finished' | 'paused' | 'scheduled';
|
|
383
|
-
/** Campaign provider literals. */
|
|
384
|
-
type CampaignProvider = 'whatsapp';
|
|
385
|
-
/** WhatsApp template component structure. */
|
|
386
|
-
interface WhatsAppTemplateComponent {
|
|
387
|
-
type: string;
|
|
388
|
-
parameters: {
|
|
389
|
-
type: string;
|
|
390
|
-
text?: string;
|
|
391
|
-
}[];
|
|
392
|
-
}
|
|
393
|
-
/** WhatsApp payload used when dispatching campaign messages. */
|
|
394
|
-
interface WhatsAppPayload {
|
|
395
|
-
template: {
|
|
396
|
-
name: string;
|
|
397
|
-
components: WhatsAppTemplateComponent[];
|
|
398
|
-
language: string;
|
|
399
|
-
status: string;
|
|
400
|
-
category: string;
|
|
401
|
-
id: string;
|
|
402
|
-
};
|
|
403
|
-
templateOptions: {
|
|
404
|
-
buttonsVariablesValues?: (string | null)[] | null;
|
|
405
|
-
bodyVariablesValues?: string[];
|
|
406
|
-
headerVariablesValues?: string[];
|
|
407
|
-
headerFileInfos?: {
|
|
408
|
-
filename: string;
|
|
409
|
-
fileUrl: string;
|
|
410
|
-
parsedFilename: string;
|
|
411
|
-
};
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
/** Contact filter applied when adding contacts to a campaign. */
|
|
415
|
-
interface CampaignContactFilter {
|
|
416
|
-
excludeDeclinedMarketing?: boolean;
|
|
417
|
-
}
|
|
418
|
-
/** Schedule configuration for a campaign. */
|
|
419
|
-
interface CampaignSchedule {
|
|
420
|
-
startAt?: string;
|
|
421
|
-
repeat?: {
|
|
422
|
-
delay?: number;
|
|
423
|
-
count?: number;
|
|
424
|
-
until?: string;
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
/** Campaign entity returned by the Campaigns API. */
|
|
428
|
-
interface Campaign {
|
|
429
|
-
id: string;
|
|
430
|
-
sid: number;
|
|
431
|
-
companyId: string;
|
|
432
|
-
createdBy: string;
|
|
433
|
-
assignedTo: string;
|
|
434
|
-
name?: string;
|
|
435
|
-
provider: CampaignProvider;
|
|
436
|
-
providerId: number;
|
|
437
|
-
providerConfigId: string;
|
|
438
|
-
associatedRuleId?: string;
|
|
439
|
-
payload: WhatsAppPayload;
|
|
440
|
-
conversionRuleIds: string[];
|
|
441
|
-
status: CampaignStatus;
|
|
442
|
-
expiresAt?: string;
|
|
443
|
-
createdAt: string;
|
|
444
|
-
updatedAt: string;
|
|
445
|
-
failedCampaignAttempts: number;
|
|
446
|
-
queuedCampaignAttempts: number;
|
|
447
|
-
deliveredCampaignAttempts: number;
|
|
448
|
-
convertedCampaignAttempts: number;
|
|
449
|
-
categoryId?: number;
|
|
450
|
-
contactFilter?: CampaignContactFilter;
|
|
451
|
-
schedule?: CampaignSchedule;
|
|
452
|
-
}
|
|
453
|
-
/** Paginated response returned by the Campaigns API for list endpoints. */
|
|
454
|
-
interface CampaignPaginatedResponse {
|
|
455
|
-
total: number;
|
|
456
|
-
limit: number;
|
|
457
|
-
skip: number;
|
|
458
|
-
data: Campaign[];
|
|
459
|
-
}
|
|
460
|
-
/** Request payload for creating a campaign. */
|
|
461
|
-
interface CreateCampaignRequest {
|
|
462
|
-
name: string;
|
|
463
|
-
payload: WhatsAppPayload;
|
|
464
|
-
provider: CampaignProvider;
|
|
465
|
-
companyId: string;
|
|
466
|
-
createdBy: string;
|
|
467
|
-
providerId: number;
|
|
468
|
-
providerConfigId: string;
|
|
469
|
-
schedule: CampaignSchedule;
|
|
470
|
-
associatedRuleId?: string;
|
|
471
|
-
assignedTo?: string;
|
|
472
|
-
expiresAt?: string;
|
|
473
|
-
}
|
|
474
|
-
/** Request payload for updating a campaign. */
|
|
475
|
-
interface PatchCampaignRequest {
|
|
476
|
-
name?: string;
|
|
477
|
-
expiresAt?: string;
|
|
478
|
-
status?: CampaignStatus;
|
|
479
|
-
categoryId?: number;
|
|
480
|
-
contactFilter?: CampaignContactFilter;
|
|
481
|
-
}
|
|
482
|
-
/** Query parameters for listing campaigns. */
|
|
483
|
-
interface CampaignQueryParams {
|
|
484
|
-
companyId?: string;
|
|
485
|
-
status?: CampaignStatus;
|
|
486
|
-
createdBy?: string;
|
|
487
|
-
assignedTo?: string;
|
|
488
|
-
name?: string;
|
|
489
|
-
$limit?: number;
|
|
490
|
-
$skip?: number;
|
|
491
|
-
}
|
|
492
|
-
/** User entity returned by the Campaigns API. */
|
|
493
|
-
interface CampaignUser {
|
|
494
|
-
id: string;
|
|
495
|
-
name: string;
|
|
496
|
-
status: 'new' | 'activated' | 'disabled';
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/** Dispatch status literals for a campaign contact. */
|
|
500
|
-
type CampaignContactDispatchStatus = 'scheduled' | 'queued' | 'delivered' | 'converted' | 'failed';
|
|
501
|
-
/** Campaign status literals accepted by campaign contact queries. */
|
|
502
|
-
type CampaignContactCampaignStatus = 'ongoing' | 'finished';
|
|
503
|
-
/** Primitive values accepted by REST query filters. */
|
|
504
|
-
type CampaignContactQueryValue = string | number | boolean;
|
|
505
|
-
/** Sort direction accepted by REST query parameters. */
|
|
506
|
-
type CampaignContactSortDirection = 1 | -1;
|
|
507
|
-
/** Query operators accepted by REST query filters. */
|
|
508
|
-
type CampaignContactQueryOperators<T extends CampaignContactQueryValue> = {
|
|
509
|
-
$eq?: T;
|
|
510
|
-
$ne?: T;
|
|
511
|
-
$in?: T[];
|
|
512
|
-
$nin?: T[];
|
|
513
|
-
$lt?: T;
|
|
514
|
-
$lte?: T;
|
|
515
|
-
$gt?: T;
|
|
516
|
-
$gte?: T;
|
|
517
|
-
};
|
|
518
|
-
/** Case-insensitive LIKE operator accepted by contact name and endpoint filters. */
|
|
519
|
-
type CampaignContactLikeQueryOperators = {
|
|
520
|
-
$ilike?: string;
|
|
521
|
-
};
|
|
522
|
-
/** Campaign contact entity returned by the Campaign Contacts API. */
|
|
523
|
-
interface CampaignContactResponse {
|
|
524
|
-
id: string;
|
|
525
|
-
contactId: string;
|
|
526
|
-
campaignId: string;
|
|
527
|
-
createdAt: string;
|
|
528
|
-
updatedAt: string;
|
|
529
|
-
contactEndpointId?: string;
|
|
530
|
-
dispatchStatusMessage: string;
|
|
531
|
-
contactName?: string;
|
|
532
|
-
contactEndpoint?: string;
|
|
533
|
-
metadata?: unknown;
|
|
534
|
-
communicationChannelId: string;
|
|
535
|
-
dispatchStatus: CampaignContactDispatchStatus;
|
|
536
|
-
isMessageRead?: boolean;
|
|
537
|
-
}
|
|
538
|
-
/** Paginated response returned by the Campaign Contacts API for list endpoints. */
|
|
539
|
-
type CampaignContactPaginatedResponse = {
|
|
540
|
-
total: number;
|
|
541
|
-
limit: number;
|
|
542
|
-
skip: number;
|
|
543
|
-
data: CampaignContactResponse[];
|
|
544
|
-
};
|
|
545
|
-
/** Request payload for creating a campaign contact. */
|
|
546
|
-
type CreateCampaignContactRequest = {
|
|
547
|
-
contactId: string;
|
|
548
|
-
campaignId: string;
|
|
549
|
-
contactEndpointId?: string;
|
|
550
|
-
contactName?: string;
|
|
551
|
-
contactEndpoint?: string;
|
|
552
|
-
metadata?: unknown;
|
|
553
|
-
};
|
|
554
|
-
/** Request payload for partially updating a campaign contact. */
|
|
555
|
-
type PatchCampaignContactRequest = {
|
|
556
|
-
id?: string;
|
|
557
|
-
contactId?: string;
|
|
558
|
-
campaignId?: string;
|
|
559
|
-
createdAt?: string;
|
|
560
|
-
updatedAt?: string;
|
|
561
|
-
contactEndpointId?: string;
|
|
562
|
-
dispatchStatusMessage?: string;
|
|
563
|
-
contactName?: string;
|
|
564
|
-
contactEndpoint?: string;
|
|
565
|
-
metadata?: unknown;
|
|
566
|
-
communicationChannelId?: string;
|
|
567
|
-
dispatchStatus?: CampaignContactDispatchStatus;
|
|
568
|
-
isMessageRead?: boolean;
|
|
569
|
-
};
|
|
570
|
-
/** Sort fields accepted when listing campaign contacts. */
|
|
571
|
-
type CampaignContactSortParams = {
|
|
572
|
-
contactId?: CampaignContactSortDirection;
|
|
573
|
-
createdAt?: CampaignContactSortDirection;
|
|
574
|
-
updatedAt?: CampaignContactSortDirection;
|
|
575
|
-
campaignId?: CampaignContactSortDirection;
|
|
576
|
-
dispatchStatus?: CampaignContactSortDirection;
|
|
577
|
-
contactName?: CampaignContactSortDirection;
|
|
578
|
-
contactEndpoint?: CampaignContactSortDirection;
|
|
579
|
-
contactEndpointId?: CampaignContactSortDirection;
|
|
580
|
-
communicationChannelId?: CampaignContactSortDirection;
|
|
581
|
-
};
|
|
582
|
-
/** Query parameters for listing campaign contacts. */
|
|
583
|
-
type CampaignContactQueryParams = {
|
|
584
|
-
contactId?: string | CampaignContactQueryOperators<string>;
|
|
585
|
-
createdAt?: string | CampaignContactQueryOperators<string>;
|
|
586
|
-
updatedAt?: string | CampaignContactQueryOperators<string>;
|
|
587
|
-
campaignId?: string | CampaignContactQueryOperators<string>;
|
|
588
|
-
dispatchStatus?: CampaignContactDispatchStatus | CampaignContactQueryOperators<CampaignContactDispatchStatus>;
|
|
589
|
-
contactName?: string | CampaignContactQueryOperators<string> | CampaignContactLikeQueryOperators;
|
|
590
|
-
contactEndpoint?: string | CampaignContactQueryOperators<string> | CampaignContactLikeQueryOperators;
|
|
591
|
-
contactEndpointId?: string | CampaignContactQueryOperators<string>;
|
|
592
|
-
communicationChannelId?: string | CampaignContactQueryOperators<string>;
|
|
593
|
-
'campaign.status'?: CampaignContactCampaignStatus | CampaignContactQueryOperators<CampaignContactCampaignStatus>;
|
|
594
|
-
$limit?: number;
|
|
595
|
-
$skip?: number;
|
|
596
|
-
$sort?: CampaignContactSortParams;
|
|
597
|
-
$select?: (keyof CampaignContactResponse)[];
|
|
598
|
-
};
|
|
599
|
-
|
|
600
99
|
/**
|
|
601
100
|
* Gateway for interacting with the Campaigns API.
|
|
602
101
|
*/
|
|
@@ -653,6 +152,12 @@ declare class CampaignsGateway {
|
|
|
653
152
|
* @returns The created campaign contact.
|
|
654
153
|
*/
|
|
655
154
|
createCampaignContact(payload: CreateCampaignContactRequest): Promise<CampaignContactResponse>;
|
|
155
|
+
/**
|
|
156
|
+
* Adds multiple contacts to a campaign in a single request.
|
|
157
|
+
* @param payload - The list of campaign contacts to create.
|
|
158
|
+
* @returns The created campaign contacts.
|
|
159
|
+
*/
|
|
160
|
+
addContactsToCampaign(payload: CreateCampaignContactRequest[]): Promise<CampaignContactResponse[]>;
|
|
656
161
|
/**
|
|
657
162
|
* Partially updates an existing campaign contact.
|
|
658
163
|
* @param id - The unique identifier of the campaign contact.
|
|
@@ -667,72 +172,9 @@ declare class CampaignsGateway {
|
|
|
667
172
|
*/
|
|
668
173
|
removeCampaignContact(id: string): Promise<CampaignContactResponse>;
|
|
669
174
|
getUsers(): Promise<CampaignUser[]>;
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
interface GetConfigTemplatesParams {
|
|
674
|
-
/** Optional template name filter. */
|
|
675
|
-
templateName?: string;
|
|
676
|
-
/** Optional maximum number of templates to return. */
|
|
677
|
-
limit?: number;
|
|
678
|
-
/** Optional status filter (e.g. 'APPROVED', 'REJECTED', 'PENDING'). */
|
|
679
|
-
status?: string;
|
|
680
|
-
/** Optional category filter (e.g. 'UTILITY', 'MARKETING', 'AUTHENTICATION'). */
|
|
681
|
-
category?: string;
|
|
682
|
-
/** Optional pagination cursor token/URL. */
|
|
683
|
-
next?: string;
|
|
684
|
-
/** Optional pagination cursor 'after' parameter. */
|
|
685
|
-
after?: string;
|
|
686
|
-
}
|
|
687
|
-
/** Component of a message template. */
|
|
688
|
-
interface MessageTemplateComponent {
|
|
689
|
-
/** Type of the component (e.g. 'HEADER', 'BODY', 'FOOTER', 'BUTTONS'). */
|
|
690
|
-
type: string;
|
|
691
|
-
/** Format of the component (e.g. 'TEXT', 'IMAGE', 'DOCUMENT', 'VIDEO'). */
|
|
692
|
-
format?: string;
|
|
693
|
-
/** Text content of the component. */
|
|
694
|
-
text?: string;
|
|
695
|
-
/** List of buttons in the component if type is 'BUTTONS'. */
|
|
696
|
-
buttons?: Array<{
|
|
697
|
-
type: string;
|
|
698
|
-
text: string;
|
|
699
|
-
url?: string;
|
|
700
|
-
phoneNumber?: string;
|
|
701
|
-
}>;
|
|
702
|
-
}
|
|
703
|
-
/** Details of a message template. */
|
|
704
|
-
interface MessageTemplate {
|
|
705
|
-
/** Name of the message template. */
|
|
706
|
-
name: string;
|
|
707
|
-
/** Status of the template (e.g. 'APPROVED', 'REJECTED', 'PENDING'). */
|
|
708
|
-
status: string;
|
|
709
|
-
/** Category of the template (e.g. 'UTILITY', 'MARKETING', 'AUTHENTICATION'). */
|
|
710
|
-
category: string;
|
|
711
|
-
/** Language locale of the template (e.g. 'pt_BR', 'en_US'). */
|
|
712
|
-
language: string;
|
|
713
|
-
/** Components that build up the template content. */
|
|
714
|
-
components: MessageTemplateComponent[];
|
|
715
|
-
/** Unique identifier of the template. */
|
|
716
|
-
id: string;
|
|
717
|
-
}
|
|
718
|
-
/** Pagination information for the template query response. */
|
|
719
|
-
interface ConfigTemplatesPaging {
|
|
720
|
-
/** Cursors used to paginate results. */
|
|
721
|
-
cursors?: {
|
|
722
|
-
/** Cursor pointing to the start of the current range. */
|
|
723
|
-
before?: string;
|
|
724
|
-
/** Cursor pointing to the end of the current range. */
|
|
725
|
-
after?: string;
|
|
726
|
-
};
|
|
727
|
-
/** URL for the next page of results. */
|
|
728
|
-
next?: string;
|
|
729
|
-
}
|
|
730
|
-
/** Response containing the list of message templates configured. */
|
|
731
|
-
interface GetConfigTemplatesResponse {
|
|
732
|
-
/** List of message templates. */
|
|
733
|
-
data: MessageTemplate[];
|
|
734
|
-
/** Pagination information. */
|
|
735
|
-
paging?: ConfigTemplatesPaging;
|
|
175
|
+
listWorkGroups(query?: CampaignWorkGroupQueryParams): Promise<CampaignWorkGroupPaginatedResponse>;
|
|
176
|
+
createWorkGroup(payload: CreateCampaignWorkGroupRequest): Promise<CampaignWorkGroup>;
|
|
177
|
+
deleteWorkGroup(id: string): Promise<CampaignWorkGroup>;
|
|
736
178
|
}
|
|
737
179
|
|
|
738
180
|
/**
|
|
@@ -751,38 +193,6 @@ declare class ChatAdapterGateway {
|
|
|
751
193
|
getConfigTemplates(configId: string, params?: GetConfigTemplatesParams): Promise<GetConfigTemplatesResponse>;
|
|
752
194
|
}
|
|
753
195
|
|
|
754
|
-
/** Request payload for obtaining a presigned upload URL. */
|
|
755
|
-
interface GetPresignedUrlRequest {
|
|
756
|
-
/** The name of the file to upload. */
|
|
757
|
-
fileName: string;
|
|
758
|
-
/** The destination key for the file in the bucket. */
|
|
759
|
-
key: string;
|
|
760
|
-
/** The unique identifier of the company. */
|
|
761
|
-
companyId: string;
|
|
762
|
-
}
|
|
763
|
-
/** Response returned when generating a presigned URL. */
|
|
764
|
-
interface UploadPresignedUrlResponse {
|
|
765
|
-
/** The destination key for the file. */
|
|
766
|
-
key: string;
|
|
767
|
-
/** The destination bucket. */
|
|
768
|
-
bucket: string;
|
|
769
|
-
/** The presigned URL to upload the file to. */
|
|
770
|
-
presignedUrl: string;
|
|
771
|
-
}
|
|
772
|
-
/** Alias for UploadPresignedUrlResponse to support legacy imports. */
|
|
773
|
-
type IUploadPresignedUrlResponse = UploadPresignedUrlResponse;
|
|
774
|
-
/** Response returned by the Assets API when converting an audio file to M4A. */
|
|
775
|
-
interface AudioConvertResponse {
|
|
776
|
-
/** The MIME type of the converted audio (e.g. 'audio/mp4'). */
|
|
777
|
-
mimetype: string;
|
|
778
|
-
/** The file extension of the converted audio (e.g. 'm4a'). */
|
|
779
|
-
extension: string;
|
|
780
|
-
/** The base64-encoded audio data. */
|
|
781
|
-
data: string;
|
|
782
|
-
/** The filename of the converted audio. */
|
|
783
|
-
filename: string;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
196
|
/**
|
|
787
197
|
* Gateway for interacting with the Assets API.
|
|
788
198
|
*/
|
|
@@ -805,6 +215,26 @@ declare class AssetsGateway {
|
|
|
805
215
|
convertAudioToM4A(formData: any): Promise<AudioConvertResponse>;
|
|
806
216
|
}
|
|
807
217
|
|
|
218
|
+
/**
|
|
219
|
+
* Gateway for interacting with the Contact List API.
|
|
220
|
+
*/
|
|
221
|
+
declare class ContactListGateway {
|
|
222
|
+
private readonly httpClient;
|
|
223
|
+
private readonly baseUrl;
|
|
224
|
+
constructor(httpClient: AxiosInstance, baseUrl: string);
|
|
225
|
+
/**
|
|
226
|
+
* Searches for contact phones with optional filtering and pagination.
|
|
227
|
+
* @param params - The query parameters for the search.
|
|
228
|
+
* @returns The paginated contact phones response.
|
|
229
|
+
*/
|
|
230
|
+
getContactsPhones(params: GetContactPhonesParams): Promise<ContactPhoneSearchResponse>;
|
|
231
|
+
/**
|
|
232
|
+
* Retrieves all contact categories.
|
|
233
|
+
* @returns An array of contact categories.
|
|
234
|
+
*/
|
|
235
|
+
getCategoryList(): Promise<ContactCategoryResponse[]>;
|
|
236
|
+
}
|
|
237
|
+
|
|
808
238
|
/**
|
|
809
239
|
* Maps service identifiers to their corresponding gateway types.
|
|
810
240
|
* Used by the `gateway()` function to infer the correct return type
|
|
@@ -819,6 +249,7 @@ type GatewayMap = {
|
|
|
819
249
|
'campaigns': CampaignsGateway;
|
|
820
250
|
'chat-adapter': ChatAdapterGateway;
|
|
821
251
|
'assets': AssetsGateway;
|
|
252
|
+
'contact-list': ContactListGateway;
|
|
822
253
|
};
|
|
823
254
|
/**
|
|
824
255
|
* Parameters required to configure the SDK client.
|
|
@@ -846,6 +277,9 @@ interface GatewayClientParams {
|
|
|
846
277
|
assets?: {
|
|
847
278
|
baseUrl: string;
|
|
848
279
|
};
|
|
280
|
+
contactList?: {
|
|
281
|
+
baseUrl: string;
|
|
282
|
+
};
|
|
849
283
|
};
|
|
850
284
|
}
|
|
851
285
|
|
|
@@ -872,4 +306,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
872
306
|
*/
|
|
873
307
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
874
308
|
|
|
875
|
-
export {
|
|
309
|
+
export { AudioConvertResponse, Campaign, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CompanyResponse, ConfigListByProviderResponse, ContactCategoryResponse, ContactPhoneSearchResponse, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, FindOrCreateQueueRuleRequest, GetAllUsersParams, GetAllUsersResponse, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetContactPhonesParams, GetManagedUsersResponse, GetPresignedUrlRequest, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PatchCampaignContactRequest, PatchCampaignRequest, ProviderListResponse, Queue, QueueRule, UploadPresignedUrlResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|