@dawntech/blip-tools 0.6.0 → 0.6.2
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/exceptions/index.d.ts +1 -4
- package/dist/helpers/create-uri.d.ts +1 -0
- package/dist/index.cjs +134 -7
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +133 -7
- package/dist/modules/blip-campaign.d.ts +15 -0
- package/dist/modules/blip-contact.d.ts +5 -0
- package/dist/modules/blip-dispatch.d.ts +4 -3
- package/dist/modules/blip-main.d.ts +2 -0
- package/dist/modules/blip-monitoring.d.ts +2 -1
- package/dist/modules/blip-ticket.d.ts +4 -2
- package/dist/modules/index.d.ts +2 -1
- package/dist/types/campaign.d.ts +14 -0
- package/dist/types/campaing-request.d.ts +1 -0
- package/dist/types/contact.d.ts +2 -0
- package/dist/types/index.d.ts +3 -2
- package/dist/types/monitoring.d.ts +9 -0
- package/package.json +1 -1
- package/dist/types/ticket-search-result.d.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function createUri(url: string, params: Record<string, unknown>): string;
|
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,6 @@ function handleError(error) {
|
|
|
40
40
|
if (error.response?.data.code) {
|
|
41
41
|
throw new BlipError(error.response?.data.description, error.response?.data.code);
|
|
42
42
|
}
|
|
43
|
-
throw new BlipError(error.message, 0);
|
|
44
43
|
}
|
|
45
44
|
throw error;
|
|
46
45
|
}
|
|
@@ -204,6 +203,14 @@ class BlipAttendance {
|
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
205
|
|
|
206
|
+
function createUri(url, params) {
|
|
207
|
+
const encodedParams = encodeBlipParams(params);
|
|
208
|
+
if (encodedParams) {
|
|
209
|
+
return `${url}?${encodedParams}`;
|
|
210
|
+
}
|
|
211
|
+
return url;
|
|
212
|
+
}
|
|
213
|
+
|
|
207
214
|
class BlipContact {
|
|
208
215
|
api;
|
|
209
216
|
constructor(context) {
|
|
@@ -243,6 +250,26 @@ class BlipContact {
|
|
|
243
250
|
throw handleError(error);
|
|
244
251
|
}
|
|
245
252
|
}
|
|
253
|
+
async search({ filter, skip, take } = {}) {
|
|
254
|
+
const params = {
|
|
255
|
+
$filter: filter,
|
|
256
|
+
$skip: skip,
|
|
257
|
+
$take: take,
|
|
258
|
+
};
|
|
259
|
+
try {
|
|
260
|
+
const response = await this.api.post('/commands', {
|
|
261
|
+
id: crypto.randomUUID(),
|
|
262
|
+
to: 'postmaster@crm.msging.net',
|
|
263
|
+
method: 'get',
|
|
264
|
+
uri: createUri('/contacts', params),
|
|
265
|
+
});
|
|
266
|
+
validateResponse(response);
|
|
267
|
+
return response.data.resource.items;
|
|
268
|
+
}
|
|
269
|
+
catch (error) {
|
|
270
|
+
throw handleError(error);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
246
273
|
}
|
|
247
274
|
|
|
248
275
|
class BlipContext {
|
|
@@ -313,7 +340,7 @@ class BlipDispatch {
|
|
|
313
340
|
/**
|
|
314
341
|
* Sends a template-based message to any user. For sending messages to clients who are active, use `sendTemplateMessage` instead.
|
|
315
342
|
*/
|
|
316
|
-
async sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params = [], }) {
|
|
343
|
+
async sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params = [], scheduled, }) {
|
|
317
344
|
const body = {
|
|
318
345
|
id: crypto.randomUUID(),
|
|
319
346
|
to: 'postmaster@activecampaign.msging.net',
|
|
@@ -328,9 +355,10 @@ class BlipDispatch {
|
|
|
328
355
|
flowId,
|
|
329
356
|
stateId,
|
|
330
357
|
channelType,
|
|
358
|
+
scheduled: scheduled?.toISOString(),
|
|
331
359
|
},
|
|
332
360
|
audience: {
|
|
333
|
-
recipient: `+${phone}`,
|
|
361
|
+
recipient: `+${phone.replace('+', '')}`,
|
|
334
362
|
},
|
|
335
363
|
message: {
|
|
336
364
|
messageTemplate: templateName,
|
|
@@ -498,7 +526,7 @@ class BlipTicket {
|
|
|
498
526
|
constructor(context) {
|
|
499
527
|
this.api = context.api;
|
|
500
528
|
}
|
|
501
|
-
async search({ filter, skip, take }) {
|
|
529
|
+
async search({ filter, skip, take } = {}) {
|
|
502
530
|
try {
|
|
503
531
|
const params = {
|
|
504
532
|
$filter: filter,
|
|
@@ -509,7 +537,7 @@ class BlipTicket {
|
|
|
509
537
|
id: crypto.randomUUID(),
|
|
510
538
|
to: 'postmaster@desk.msging.net',
|
|
511
539
|
method: 'get',
|
|
512
|
-
uri:
|
|
540
|
+
uri: createUri('/tickets', params),
|
|
513
541
|
};
|
|
514
542
|
const response = await this.api.post('/commands', body);
|
|
515
543
|
validateResponse(response);
|
|
@@ -519,6 +547,22 @@ class BlipTicket {
|
|
|
519
547
|
throw handleError(error);
|
|
520
548
|
}
|
|
521
549
|
}
|
|
550
|
+
async getTicket(ticketId) {
|
|
551
|
+
try {
|
|
552
|
+
const body = {
|
|
553
|
+
id: crypto.randomUUID(),
|
|
554
|
+
to: 'postmaster@desk.msging.net',
|
|
555
|
+
method: 'get',
|
|
556
|
+
uri: `/ticket/${ticketId}`,
|
|
557
|
+
};
|
|
558
|
+
const response = await this.api.post('/commands', body);
|
|
559
|
+
validateResponse(response);
|
|
560
|
+
return response.data.resource;
|
|
561
|
+
}
|
|
562
|
+
catch (error) {
|
|
563
|
+
throw handleError(error);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
522
566
|
}
|
|
523
567
|
|
|
524
568
|
class BlipWhatsapp {
|
|
@@ -558,10 +602,70 @@ class BlipWhatsapp {
|
|
|
558
602
|
}
|
|
559
603
|
}
|
|
560
604
|
|
|
561
|
-
|
|
605
|
+
class BlipCampaign {
|
|
606
|
+
api;
|
|
607
|
+
constructor(context) {
|
|
608
|
+
this.api = context.api;
|
|
609
|
+
}
|
|
610
|
+
async search({ filter, skip, take } = {}) {
|
|
611
|
+
try {
|
|
612
|
+
const params = {
|
|
613
|
+
$filter: filter,
|
|
614
|
+
$skip: skip,
|
|
615
|
+
$take: take,
|
|
616
|
+
};
|
|
617
|
+
const body = {
|
|
618
|
+
id: crypto.randomUUID(),
|
|
619
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
620
|
+
method: 'get',
|
|
621
|
+
uri: createUri('/campaigns', params),
|
|
622
|
+
};
|
|
623
|
+
const response = await this.api.post('/commands', body);
|
|
624
|
+
validateResponse(response);
|
|
625
|
+
return response.data.resource.items;
|
|
626
|
+
}
|
|
627
|
+
catch (error) {
|
|
628
|
+
throw handleError(error);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
async get(campaignId) {
|
|
632
|
+
try {
|
|
633
|
+
const body = {
|
|
634
|
+
id: crypto.randomUUID(),
|
|
635
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
636
|
+
method: 'get',
|
|
637
|
+
uri: `/campaigns/${campaignId}`,
|
|
638
|
+
};
|
|
639
|
+
const response = await this.api.post('/commands', body);
|
|
640
|
+
validateResponse(response);
|
|
641
|
+
return response.data.resource;
|
|
642
|
+
}
|
|
643
|
+
catch (error) {
|
|
644
|
+
throw handleError(error);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
async deleteCampaign(campaignId) {
|
|
648
|
+
try {
|
|
649
|
+
const body = {
|
|
650
|
+
id: crypto.randomUUID(),
|
|
651
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
652
|
+
method: 'delete',
|
|
653
|
+
uri: `/campaigns/${campaignId}`,
|
|
654
|
+
};
|
|
655
|
+
const response = await this.api.post('/commands', body);
|
|
656
|
+
validateResponse(response);
|
|
657
|
+
}
|
|
658
|
+
catch (error) {
|
|
659
|
+
throw handleError(error);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
562
665
|
__proto__: null,
|
|
563
666
|
BlipAttendance: BlipAttendance,
|
|
564
667
|
BlipBucket: BlipBucket,
|
|
668
|
+
BlipCampaign: BlipCampaign,
|
|
565
669
|
BlipContact: BlipContact,
|
|
566
670
|
BlipContext: BlipContext,
|
|
567
671
|
BlipDispatch: BlipDispatch,
|
|
@@ -631,6 +735,21 @@ class BlipMonitoring {
|
|
|
631
735
|
throw handleError(error);
|
|
632
736
|
}
|
|
633
737
|
}
|
|
738
|
+
async getWaitingTicketsMetrics() {
|
|
739
|
+
try {
|
|
740
|
+
const response = await this.api.post('/commands', {
|
|
741
|
+
id: crypto.randomUUID(),
|
|
742
|
+
to: 'postmaster@desk.msging.net',
|
|
743
|
+
method: 'get',
|
|
744
|
+
uri: '/monitoring/waiting-tickets',
|
|
745
|
+
});
|
|
746
|
+
validateResponse(response);
|
|
747
|
+
return response.data.resource.items;
|
|
748
|
+
}
|
|
749
|
+
catch (error) {
|
|
750
|
+
throw handleError(error);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
634
753
|
}
|
|
635
754
|
|
|
636
755
|
class BlipAnalytics {
|
|
@@ -700,6 +819,7 @@ class Blip {
|
|
|
700
819
|
whatsapp;
|
|
701
820
|
monitoring;
|
|
702
821
|
analytics;
|
|
822
|
+
campaign;
|
|
703
823
|
constructor(params) {
|
|
704
824
|
validateInstance(params);
|
|
705
825
|
this.api = axios.create({
|
|
@@ -721,8 +841,15 @@ class Blip {
|
|
|
721
841
|
this.whatsapp = new BlipWhatsapp({ api: this.api });
|
|
722
842
|
this.monitoring = new BlipMonitoring({ api: this.api });
|
|
723
843
|
this.analytics = new BlipAnalytics({ api: this.api });
|
|
844
|
+
this.campaign = new BlipCampaign({ api: this.api });
|
|
724
845
|
}
|
|
725
846
|
}
|
|
726
847
|
|
|
848
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
849
|
+
__proto__: null,
|
|
850
|
+
BlipError: BlipError
|
|
851
|
+
});
|
|
852
|
+
|
|
727
853
|
exports.Blip = Blip;
|
|
728
|
-
exports.
|
|
854
|
+
exports.Exceptions = index;
|
|
855
|
+
exports.Modules = index$1;
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -38,7 +38,6 @@ function handleError(error) {
|
|
|
38
38
|
if (error.response?.data.code) {
|
|
39
39
|
throw new BlipError(error.response?.data.description, error.response?.data.code);
|
|
40
40
|
}
|
|
41
|
-
throw new BlipError(error.message, 0);
|
|
42
41
|
}
|
|
43
42
|
throw error;
|
|
44
43
|
}
|
|
@@ -202,6 +201,14 @@ class BlipAttendance {
|
|
|
202
201
|
}
|
|
203
202
|
}
|
|
204
203
|
|
|
204
|
+
function createUri(url, params) {
|
|
205
|
+
const encodedParams = encodeBlipParams(params);
|
|
206
|
+
if (encodedParams) {
|
|
207
|
+
return `${url}?${encodedParams}`;
|
|
208
|
+
}
|
|
209
|
+
return url;
|
|
210
|
+
}
|
|
211
|
+
|
|
205
212
|
class BlipContact {
|
|
206
213
|
api;
|
|
207
214
|
constructor(context) {
|
|
@@ -241,6 +248,26 @@ class BlipContact {
|
|
|
241
248
|
throw handleError(error);
|
|
242
249
|
}
|
|
243
250
|
}
|
|
251
|
+
async search({ filter, skip, take } = {}) {
|
|
252
|
+
const params = {
|
|
253
|
+
$filter: filter,
|
|
254
|
+
$skip: skip,
|
|
255
|
+
$take: take,
|
|
256
|
+
};
|
|
257
|
+
try {
|
|
258
|
+
const response = await this.api.post('/commands', {
|
|
259
|
+
id: randomUUID(),
|
|
260
|
+
to: 'postmaster@crm.msging.net',
|
|
261
|
+
method: 'get',
|
|
262
|
+
uri: createUri('/contacts', params),
|
|
263
|
+
});
|
|
264
|
+
validateResponse(response);
|
|
265
|
+
return response.data.resource.items;
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
throw handleError(error);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
244
271
|
}
|
|
245
272
|
|
|
246
273
|
class BlipContext {
|
|
@@ -311,7 +338,7 @@ class BlipDispatch {
|
|
|
311
338
|
/**
|
|
312
339
|
* Sends a template-based message to any user. For sending messages to clients who are active, use `sendTemplateMessage` instead.
|
|
313
340
|
*/
|
|
314
|
-
async sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params = [], }) {
|
|
341
|
+
async sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params = [], scheduled, }) {
|
|
315
342
|
const body = {
|
|
316
343
|
id: randomUUID(),
|
|
317
344
|
to: 'postmaster@activecampaign.msging.net',
|
|
@@ -326,9 +353,10 @@ class BlipDispatch {
|
|
|
326
353
|
flowId,
|
|
327
354
|
stateId,
|
|
328
355
|
channelType,
|
|
356
|
+
scheduled: scheduled?.toISOString(),
|
|
329
357
|
},
|
|
330
358
|
audience: {
|
|
331
|
-
recipient: `+${phone}`,
|
|
359
|
+
recipient: `+${phone.replace('+', '')}`,
|
|
332
360
|
},
|
|
333
361
|
message: {
|
|
334
362
|
messageTemplate: templateName,
|
|
@@ -496,7 +524,7 @@ class BlipTicket {
|
|
|
496
524
|
constructor(context) {
|
|
497
525
|
this.api = context.api;
|
|
498
526
|
}
|
|
499
|
-
async search({ filter, skip, take }) {
|
|
527
|
+
async search({ filter, skip, take } = {}) {
|
|
500
528
|
try {
|
|
501
529
|
const params = {
|
|
502
530
|
$filter: filter,
|
|
@@ -507,7 +535,7 @@ class BlipTicket {
|
|
|
507
535
|
id: randomUUID(),
|
|
508
536
|
to: 'postmaster@desk.msging.net',
|
|
509
537
|
method: 'get',
|
|
510
|
-
uri:
|
|
538
|
+
uri: createUri('/tickets', params),
|
|
511
539
|
};
|
|
512
540
|
const response = await this.api.post('/commands', body);
|
|
513
541
|
validateResponse(response);
|
|
@@ -517,6 +545,22 @@ class BlipTicket {
|
|
|
517
545
|
throw handleError(error);
|
|
518
546
|
}
|
|
519
547
|
}
|
|
548
|
+
async getTicket(ticketId) {
|
|
549
|
+
try {
|
|
550
|
+
const body = {
|
|
551
|
+
id: randomUUID(),
|
|
552
|
+
to: 'postmaster@desk.msging.net',
|
|
553
|
+
method: 'get',
|
|
554
|
+
uri: `/ticket/${ticketId}`,
|
|
555
|
+
};
|
|
556
|
+
const response = await this.api.post('/commands', body);
|
|
557
|
+
validateResponse(response);
|
|
558
|
+
return response.data.resource;
|
|
559
|
+
}
|
|
560
|
+
catch (error) {
|
|
561
|
+
throw handleError(error);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
520
564
|
}
|
|
521
565
|
|
|
522
566
|
class BlipWhatsapp {
|
|
@@ -556,10 +600,70 @@ class BlipWhatsapp {
|
|
|
556
600
|
}
|
|
557
601
|
}
|
|
558
602
|
|
|
559
|
-
|
|
603
|
+
class BlipCampaign {
|
|
604
|
+
api;
|
|
605
|
+
constructor(context) {
|
|
606
|
+
this.api = context.api;
|
|
607
|
+
}
|
|
608
|
+
async search({ filter, skip, take } = {}) {
|
|
609
|
+
try {
|
|
610
|
+
const params = {
|
|
611
|
+
$filter: filter,
|
|
612
|
+
$skip: skip,
|
|
613
|
+
$take: take,
|
|
614
|
+
};
|
|
615
|
+
const body = {
|
|
616
|
+
id: randomUUID(),
|
|
617
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
618
|
+
method: 'get',
|
|
619
|
+
uri: createUri('/campaigns', params),
|
|
620
|
+
};
|
|
621
|
+
const response = await this.api.post('/commands', body);
|
|
622
|
+
validateResponse(response);
|
|
623
|
+
return response.data.resource.items;
|
|
624
|
+
}
|
|
625
|
+
catch (error) {
|
|
626
|
+
throw handleError(error);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
async get(campaignId) {
|
|
630
|
+
try {
|
|
631
|
+
const body = {
|
|
632
|
+
id: randomUUID(),
|
|
633
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
634
|
+
method: 'get',
|
|
635
|
+
uri: `/campaigns/${campaignId}`,
|
|
636
|
+
};
|
|
637
|
+
const response = await this.api.post('/commands', body);
|
|
638
|
+
validateResponse(response);
|
|
639
|
+
return response.data.resource;
|
|
640
|
+
}
|
|
641
|
+
catch (error) {
|
|
642
|
+
throw handleError(error);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
async deleteCampaign(campaignId) {
|
|
646
|
+
try {
|
|
647
|
+
const body = {
|
|
648
|
+
id: randomUUID(),
|
|
649
|
+
to: 'postmaster@activecampaign.msging.net',
|
|
650
|
+
method: 'delete',
|
|
651
|
+
uri: `/campaigns/${campaignId}`,
|
|
652
|
+
};
|
|
653
|
+
const response = await this.api.post('/commands', body);
|
|
654
|
+
validateResponse(response);
|
|
655
|
+
}
|
|
656
|
+
catch (error) {
|
|
657
|
+
throw handleError(error);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
560
663
|
__proto__: null,
|
|
561
664
|
BlipAttendance: BlipAttendance,
|
|
562
665
|
BlipBucket: BlipBucket,
|
|
666
|
+
BlipCampaign: BlipCampaign,
|
|
563
667
|
BlipContact: BlipContact,
|
|
564
668
|
BlipContext: BlipContext,
|
|
565
669
|
BlipDispatch: BlipDispatch,
|
|
@@ -629,6 +733,21 @@ class BlipMonitoring {
|
|
|
629
733
|
throw handleError(error);
|
|
630
734
|
}
|
|
631
735
|
}
|
|
736
|
+
async getWaitingTicketsMetrics() {
|
|
737
|
+
try {
|
|
738
|
+
const response = await this.api.post('/commands', {
|
|
739
|
+
id: randomUUID(),
|
|
740
|
+
to: 'postmaster@desk.msging.net',
|
|
741
|
+
method: 'get',
|
|
742
|
+
uri: '/monitoring/waiting-tickets',
|
|
743
|
+
});
|
|
744
|
+
validateResponse(response);
|
|
745
|
+
return response.data.resource.items;
|
|
746
|
+
}
|
|
747
|
+
catch (error) {
|
|
748
|
+
throw handleError(error);
|
|
749
|
+
}
|
|
750
|
+
}
|
|
632
751
|
}
|
|
633
752
|
|
|
634
753
|
class BlipAnalytics {
|
|
@@ -698,6 +817,7 @@ class Blip {
|
|
|
698
817
|
whatsapp;
|
|
699
818
|
monitoring;
|
|
700
819
|
analytics;
|
|
820
|
+
campaign;
|
|
701
821
|
constructor(params) {
|
|
702
822
|
validateInstance(params);
|
|
703
823
|
this.api = axios.create({
|
|
@@ -719,7 +839,13 @@ class Blip {
|
|
|
719
839
|
this.whatsapp = new BlipWhatsapp({ api: this.api });
|
|
720
840
|
this.monitoring = new BlipMonitoring({ api: this.api });
|
|
721
841
|
this.analytics = new BlipAnalytics({ api: this.api });
|
|
842
|
+
this.campaign = new BlipCampaign({ api: this.api });
|
|
722
843
|
}
|
|
723
844
|
}
|
|
724
845
|
|
|
725
|
-
|
|
846
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
847
|
+
__proto__: null,
|
|
848
|
+
BlipError: BlipError
|
|
849
|
+
});
|
|
850
|
+
|
|
851
|
+
export { Blip, index as Exceptions, index$1 as Modules };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Campaign } from '../types';
|
|
3
|
+
export default class BlipCampaign {
|
|
4
|
+
private api;
|
|
5
|
+
constructor(context: {
|
|
6
|
+
api: AxiosInstance;
|
|
7
|
+
});
|
|
8
|
+
search({ filter, skip, take }?: {
|
|
9
|
+
filter?: string;
|
|
10
|
+
skip?: number;
|
|
11
|
+
take?: number;
|
|
12
|
+
}): Promise<Campaign[]>;
|
|
13
|
+
get(campaignId: string): Promise<Campaign>;
|
|
14
|
+
deleteCampaign(campaignId: string): Promise<void>;
|
|
15
|
+
}
|
|
@@ -10,15 +10,16 @@ export default class BlipDispatch {
|
|
|
10
10
|
/**
|
|
11
11
|
* Sends a template-based message to any user. For sending messages to clients who are active, use `sendTemplateMessage` instead.
|
|
12
12
|
*/
|
|
13
|
-
sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params, }: {
|
|
13
|
+
sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params, scheduled, }: {
|
|
14
14
|
campaignName: string;
|
|
15
15
|
masterState: string;
|
|
16
16
|
flowId: string;
|
|
17
17
|
stateId: string;
|
|
18
|
-
channelType: string;
|
|
18
|
+
channelType: 'whatsapp' | string;
|
|
19
19
|
phone: string;
|
|
20
20
|
templateName: string;
|
|
21
|
-
params
|
|
21
|
+
params?: string[];
|
|
22
|
+
scheduled?: Date;
|
|
22
23
|
}): Promise<CampaignNotification>;
|
|
23
24
|
getCampaignNotificationStatus({ campaignNotificationId }: {
|
|
24
25
|
campaignNotificationId: string;
|
|
@@ -11,6 +11,7 @@ import BlipWhatsapp from './blip-whatsapp';
|
|
|
11
11
|
import BlipContact from './blip-contact';
|
|
12
12
|
import BlipMonitoring from './blip-monitoring';
|
|
13
13
|
import BlipAnalytics from './blip-analytics';
|
|
14
|
+
import BlipCampaign from './blip-campaign';
|
|
14
15
|
export declare class Blip {
|
|
15
16
|
private api;
|
|
16
17
|
bucket: BlipBucket;
|
|
@@ -25,5 +26,6 @@ export declare class Blip {
|
|
|
25
26
|
whatsapp: BlipWhatsapp;
|
|
26
27
|
monitoring: BlipMonitoring;
|
|
27
28
|
analytics: BlipAnalytics;
|
|
29
|
+
campaign: BlipCampaign;
|
|
28
30
|
constructor(params: BlipConstructor);
|
|
29
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { MonitoredAttendantStatusMetrics, MonitoredTicketMetrics, MonitoredTickets } from '../types/monitoring';
|
|
2
|
+
import { MonitoredAttendantStatusMetrics, MonitoredTicketMetrics, MonitoredTickets, MonitoredWaitingTicketsMetrics } from '../types/monitoring';
|
|
3
3
|
export default class BlipMonitoring {
|
|
4
4
|
private api;
|
|
5
5
|
constructor(context: {
|
|
@@ -8,4 +8,5 @@ export default class BlipMonitoring {
|
|
|
8
8
|
getTickets(): Promise<MonitoredTickets>;
|
|
9
9
|
getTicketMetrics(): Promise<MonitoredTicketMetrics>;
|
|
10
10
|
getAttendantStatusMetrics(): Promise<MonitoredAttendantStatusMetrics>;
|
|
11
|
+
getWaitingTicketsMetrics(): Promise<MonitoredWaitingTicketsMetrics[]>;
|
|
11
12
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { Ticket } from '../types';
|
|
2
3
|
export default class BlipTicket {
|
|
3
4
|
private api;
|
|
4
5
|
constructor(context: {
|
|
5
6
|
api: AxiosInstance;
|
|
6
7
|
});
|
|
7
|
-
search({ filter, skip, take }
|
|
8
|
+
search({ filter, skip, take }?: {
|
|
8
9
|
filter?: string;
|
|
9
10
|
skip?: number;
|
|
10
11
|
take?: number;
|
|
11
|
-
}): Promise<
|
|
12
|
+
}): Promise<Ticket[]>;
|
|
13
|
+
getTicket(ticketId: string): Promise<Ticket>;
|
|
12
14
|
}
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ import BlipEvent from './blip-event';
|
|
|
8
8
|
import BlipInteraction from './blip-interaction';
|
|
9
9
|
import BlipTicket from './blip-ticket';
|
|
10
10
|
import BlipWhatsapp from './blip-whatsapp';
|
|
11
|
-
|
|
11
|
+
import BlipCampaign from './blip-campaign';
|
|
12
|
+
export { BlipMedia, BlipBucket, BlipAttendance, BlipContact, BlipContext, BlipDispatch, BlipEvent, BlipInteraction, BlipTicket, BlipWhatsapp, BlipCampaign, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Campaign {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
campaignType: string;
|
|
5
|
+
masterState: string;
|
|
6
|
+
flowId: string;
|
|
7
|
+
stateId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
created: string;
|
|
10
|
+
scheduled: string;
|
|
11
|
+
isToUseLiteApi: boolean;
|
|
12
|
+
channelType: string;
|
|
13
|
+
canSendWithOpenTicket: boolean;
|
|
14
|
+
}
|
package/dist/types/contact.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { AttendanceHourContainer } from './attendance-hour-container';
|
|
|
2
2
|
import { BlipConstructor } from './blip-constructor';
|
|
3
3
|
import { BlipRequestBody, BlipResponse, BlipArrayBody } from './blip';
|
|
4
4
|
import { Parameter, Component, Template } from './template';
|
|
5
|
-
import { TicketSearchResult } from './ticket-search-result';
|
|
6
5
|
import { Ticket } from './ticket';
|
|
7
6
|
import { MonitoredTickets, MonitoredTicketMetrics, MonitoredAttendantStatusMetrics } from './monitoring';
|
|
8
7
|
import { TicketAnalyticsReport, TicketAnalyticsTimings } from './analytics';
|
|
9
|
-
|
|
8
|
+
import { Campaign } from './campaign';
|
|
9
|
+
import { Contact } from './contact';
|
|
10
|
+
export { AttendanceHourContainer, BlipConstructor, BlipRequestBody, BlipResponse, BlipArrayBody, Parameter, Component, Template, TicketAnalyticsReport, MonitoredTickets, MonitoredTicketMetrics, MonitoredAttendantStatusMetrics, TicketAnalyticsTimings, Ticket, Campaign, Contact, };
|
|
@@ -25,3 +25,12 @@ export interface MonitoredAttendantStatusMetrics {
|
|
|
25
25
|
invisible: number;
|
|
26
26
|
offline: number;
|
|
27
27
|
}
|
|
28
|
+
export interface MonitoredWaitingTicketsMetrics {
|
|
29
|
+
id: string;
|
|
30
|
+
sequentialId: number;
|
|
31
|
+
customerIdentity: string;
|
|
32
|
+
customerName: string;
|
|
33
|
+
team: string;
|
|
34
|
+
queueTime: string;
|
|
35
|
+
priority: number;
|
|
36
|
+
}
|
package/package.json
CHANGED