@opens/gateways 1.5.1 → 1.7.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/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 +15 -615
- package/dist/index.d.ts +15 -615
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,98 +1,14 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
utc: string;
|
|
13
|
-
check_bad_password: boolean;
|
|
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.js';
|
|
3
|
+
export { CompanyData, ManagedUser, User, WorkGroup, WorkGroupMember } from './customer-service/contracts/index.js';
|
|
4
|
+
import { ProviderListResponse, GetConfigsByProviderParams, ConfigListByProviderResponse, Queue, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, FindOrCreateQueueRuleRequest, QueueRule } from './chat-config/contracts/index.js';
|
|
5
|
+
export { Config, ConfigProvider, DistributionType, MetaTemplateButton, Provider, QueueListResponse, QueueMember } from './chat-config/contracts/index.js';
|
|
6
|
+
import { CampaignQueryParams, CampaignPaginatedResponse, Campaign, CreateCampaignRequest, PatchCampaignRequest, CampaignContactQueryParams, CampaignContactPaginatedResponse, CampaignContactResponse, CreateCampaignContactRequest, PatchCampaignContactRequest, CampaignUser, CampaignWorkGroupQueryParams, CampaignWorkGroupPaginatedResponse, CreateCampaignWorkGroupRequest, CampaignWorkGroup } from './campaigns/contracts/index.js';
|
|
7
|
+
export { CampaignContactCampaignStatus, CampaignContactDispatchStatus, CampaignContactFilter, CampaignContactLikeQueryOperators, CampaignContactQueryOperators, CampaignContactQueryValue, CampaignContactSortDirection, CampaignContactSortParams, CampaignProvider, CampaignSchedule, CampaignStatus, WhatsAppPayload, WhatsAppTemplateComponent } from './campaigns/contracts/index.js';
|
|
8
|
+
import { GetConfigTemplatesParams, GetConfigTemplatesResponse } from './chat-adapter/contracts/index.js';
|
|
9
|
+
export { ConfigTemplatesPaging, MessageTemplate, MessageTemplateComponent } from './chat-adapter/contracts/index.js';
|
|
10
|
+
import { GetPresignedUrlRequest, UploadPresignedUrlResponse, AudioConvertResponse } from './assets/contracts/index.js';
|
|
11
|
+
export { IUploadPresignedUrlResponse } from './assets/contracts/index.js';
|
|
96
12
|
|
|
97
13
|
/**
|
|
98
14
|
* Gateway for interacting with the Customer Service API.
|
|
@@ -132,206 +48,6 @@ declare class CustomerServiceGateway {
|
|
|
132
48
|
getManagedUsers(managerId: string): Promise<GetManagedUsersResponse>;
|
|
133
49
|
}
|
|
134
50
|
|
|
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
51
|
/**
|
|
336
52
|
* Gateway for interacting with the Chat Config API.
|
|
337
53
|
*/
|
|
@@ -378,225 +94,6 @@ declare class ChatConfigGateway {
|
|
|
378
94
|
findOrCreateQueueRule(payload: FindOrCreateQueueRuleRequest): Promise<QueueRule>;
|
|
379
95
|
}
|
|
380
96
|
|
|
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
97
|
/**
|
|
601
98
|
* Gateway for interacting with the Campaigns API.
|
|
602
99
|
*/
|
|
@@ -667,72 +164,9 @@ declare class CampaignsGateway {
|
|
|
667
164
|
*/
|
|
668
165
|
removeCampaignContact(id: string): Promise<CampaignContactResponse>;
|
|
669
166
|
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;
|
|
167
|
+
listWorkGroups(query?: CampaignWorkGroupQueryParams): Promise<CampaignWorkGroupPaginatedResponse>;
|
|
168
|
+
createWorkGroup(payload: CreateCampaignWorkGroupRequest): Promise<CampaignWorkGroup>;
|
|
169
|
+
deleteWorkGroup(id: string): Promise<CampaignWorkGroup>;
|
|
736
170
|
}
|
|
737
171
|
|
|
738
172
|
/**
|
|
@@ -751,38 +185,6 @@ declare class ChatAdapterGateway {
|
|
|
751
185
|
getConfigTemplates(configId: string, params?: GetConfigTemplatesParams): Promise<GetConfigTemplatesResponse>;
|
|
752
186
|
}
|
|
753
187
|
|
|
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
188
|
/**
|
|
787
189
|
* Gateway for interacting with the Assets API.
|
|
788
190
|
*/
|
|
@@ -802,9 +204,7 @@ declare class AssetsGateway {
|
|
|
802
204
|
* @param params.file - The audio file to upload for conversion.
|
|
803
205
|
* @returns The converted audio response with base64-encoded data, mimetype, extension and filename.
|
|
804
206
|
*/
|
|
805
|
-
convertAudioToM4A(
|
|
806
|
-
file: File;
|
|
807
|
-
}): Promise<AudioConvertResponse>;
|
|
207
|
+
convertAudioToM4A(formData: any): Promise<AudioConvertResponse>;
|
|
808
208
|
}
|
|
809
209
|
|
|
810
210
|
/**
|
|
@@ -874,4 +274,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
874
274
|
*/
|
|
875
275
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
876
276
|
|
|
877
|
-
export {
|
|
277
|
+
export { AudioConvertResponse, Campaign, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CompanyResponse, ConfigListByProviderResponse, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, FindOrCreateQueueRuleRequest, GetAllUsersParams, GetAllUsersResponse, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetManagedUsersResponse, GetPresignedUrlRequest, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PatchCampaignContactRequest, PatchCampaignRequest, ProviderListResponse, Queue, QueueRule, UploadPresignedUrlResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|