@dawntech/blip-tools 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exceptions/index.d.ts +5 -0
- package/dist/helpers/validate-instance.d.ts +1 -1
- package/dist/index.cjs +619 -0
- package/dist/index.d.ts +4 -110
- package/dist/{index.js → index.mjs} +423 -149
- package/dist/modules/blip-attendance.d.ts +11 -0
- package/dist/modules/blip-bucket.d.ts +3 -1
- package/dist/modules/blip-contact.d.ts +15 -0
- package/dist/modules/blip-context.d.ts +19 -0
- package/dist/modules/blip-dispatch.d.ts +63 -0
- package/dist/modules/blip-event.d.ts +12 -0
- package/dist/modules/blip-interaction.d.ts +13 -0
- package/dist/modules/blip-main.d.ts +25 -0
- package/dist/modules/blip-media.d.ts +9 -1
- package/dist/modules/blip-ticket.d.ts +12 -0
- package/dist/modules/blip-whatsapp.d.ts +10 -0
- package/dist/modules/index.d.ts +11 -0
- package/dist/types/attendance-hour-container.d.ts +25 -0
- package/dist/types/blip-constructor.d.ts +4 -0
- package/dist/types/blip.d.ts +26 -0
- package/dist/types/campaign-notification-status.d.ts +21 -0
- package/dist/types/campaign-notification.d.ts +14 -0
- package/dist/types/campaing-request.d.ts +26 -0
- package/dist/types/contact.d.ts +8 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/template.d.ts +18 -0
- package/dist/types/ticket-search-result.d.ts +6 -0
- package/dist/types/ticket.d.ts +17 -0
- package/package.json +20 -5
- package/dist/exceptions/blip-error.js +0 -7
- package/dist/helpers/encode-blip-params.js +0 -11
- package/dist/helpers/encode-strings.js +0 -3
- package/dist/helpers/format-template-params.js +0 -6
- package/dist/helpers/handle-error.js +0 -14
- package/dist/helpers/validate-instance.js +0 -9
- package/dist/helpers/validate-response.js +0 -6
- package/dist/modules/blip-bucket.js +0 -88
- package/dist/modules/blip-media.js +0 -33
package/dist/index.d.ts
CHANGED
|
@@ -1,110 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { AttendanceHourContainer } from './types/attendance-hour-container.js';
|
|
6
|
-
import { Ticket } from './types/ticket.js';
|
|
7
|
-
import { CampaignNotification } from './types/campaign-notification.js';
|
|
8
|
-
import { CampaignNotificationStatus } from './types/campaign-notification-status.js';
|
|
9
|
-
import BlipBucket from './modules/blip-bucket.js';
|
|
10
|
-
import BlipMedia from './modules/blip-media.js';
|
|
11
|
-
export { BlipError, type Ticket, type AttendanceHourContainer, type Contact, type Template };
|
|
12
|
-
export default class Blip {
|
|
13
|
-
private api;
|
|
14
|
-
bucket: BlipBucket;
|
|
15
|
-
media: BlipMedia;
|
|
16
|
-
constructor(params: BlipConstructor);
|
|
17
|
-
/**
|
|
18
|
-
* Sends a template-based message to any user. For sending messages to clients who are active, use `sendTemplateMessage` instead.
|
|
19
|
-
*/
|
|
20
|
-
sendIndividualActiveCampaign({ campaignName, masterState, flowId, stateId, channelType, phone, templateName, params, }: {
|
|
21
|
-
campaignName: string;
|
|
22
|
-
masterState: string;
|
|
23
|
-
flowId: string;
|
|
24
|
-
stateId: string;
|
|
25
|
-
channelType: string;
|
|
26
|
-
phone: string;
|
|
27
|
-
templateName: string;
|
|
28
|
-
params: string[];
|
|
29
|
-
}): Promise<CampaignNotification>;
|
|
30
|
-
getCampaignNotificationStatus({ campaignNotificationId }: {
|
|
31
|
-
campaignNotificationId: string;
|
|
32
|
-
}): Promise<CampaignNotificationStatus[]>;
|
|
33
|
-
getContextVariable({ identity, variableName }: {
|
|
34
|
-
identity: string;
|
|
35
|
-
variableName: string;
|
|
36
|
-
}): Promise<unknown>;
|
|
37
|
-
getAvailableContextVariables({ identity }: {
|
|
38
|
-
identity: string;
|
|
39
|
-
}): Promise<Record<string, unknown>>;
|
|
40
|
-
/**
|
|
41
|
-
* Sends a template-based message to an active user. For sending messages to clients who have never interacted or are inactive, use `sendTemplate` instead.
|
|
42
|
-
*/
|
|
43
|
-
sendTemplateMessage({ identity, template, metadata, }: {
|
|
44
|
-
identity: string;
|
|
45
|
-
template: Template;
|
|
46
|
-
metadata?: string;
|
|
47
|
-
}): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Sends a simple text message to an active user. For sending messages to clients who have never interacted or are inactive, use `sendTemplate` instead.
|
|
50
|
-
*/
|
|
51
|
-
sendSimpleMessage({ identity, content, metadata }: {
|
|
52
|
-
identity: string;
|
|
53
|
-
content: string;
|
|
54
|
-
metadata?: string;
|
|
55
|
-
}): Promise<void>;
|
|
56
|
-
/**
|
|
57
|
-
* Sends a text message to an active user with a midia. For sending messages to clients who have never interacted or are inactive, use `sendTemplate` instead.
|
|
58
|
-
*/
|
|
59
|
-
sendMediaMessage({ identity, text, metadata, uri, type, title, aspectRatio, size, previewUri, }: {
|
|
60
|
-
type?: string;
|
|
61
|
-
uri: string;
|
|
62
|
-
identity: string;
|
|
63
|
-
text: string;
|
|
64
|
-
metadata?: string;
|
|
65
|
-
title: string;
|
|
66
|
-
aspectRatio?: string;
|
|
67
|
-
size?: number;
|
|
68
|
-
previewUri?: string;
|
|
69
|
-
previewType?: string;
|
|
70
|
-
}): Promise<void>;
|
|
71
|
-
sendMessageWithButtons({ identity, message, buttons, metadata, }: {
|
|
72
|
-
identity: string;
|
|
73
|
-
message: string;
|
|
74
|
-
buttons: string[];
|
|
75
|
-
metadata?: string;
|
|
76
|
-
}): Promise<void>;
|
|
77
|
-
updateContact({ identity, contactData }: {
|
|
78
|
-
identity: string;
|
|
79
|
-
contactData: Record<string, unknown>;
|
|
80
|
-
}): Promise<void>;
|
|
81
|
-
getContact({ identity }: {
|
|
82
|
-
identity: string;
|
|
83
|
-
}): Promise<Contact>;
|
|
84
|
-
getWhatsAppTemplates(): Promise<Template[]>;
|
|
85
|
-
setContextVariable({ value, variableName, identity, }: {
|
|
86
|
-
variableName: string;
|
|
87
|
-
value: unknown;
|
|
88
|
-
identity: string;
|
|
89
|
-
}): Promise<void>;
|
|
90
|
-
moveUser({ identity, botIdentity, botFlowId, botStateId, }: {
|
|
91
|
-
identity: string;
|
|
92
|
-
botIdentity: string;
|
|
93
|
-
botFlowId: string;
|
|
94
|
-
botStateId: string;
|
|
95
|
-
}): Promise<void>;
|
|
96
|
-
getWhatsAppIdentity(phone: string): Promise<string>;
|
|
97
|
-
createTrackEvent({ category, action, identity }: {
|
|
98
|
-
category: string;
|
|
99
|
-
action: string;
|
|
100
|
-
identity?: string;
|
|
101
|
-
}): Promise<void>;
|
|
102
|
-
getAttendanceHourContainer({ attendanceContainerId }: {
|
|
103
|
-
attendanceContainerId: string;
|
|
104
|
-
}): Promise<AttendanceHourContainer>;
|
|
105
|
-
searchTickets({ filter, skip, take }: {
|
|
106
|
-
filter?: string;
|
|
107
|
-
skip?: number;
|
|
108
|
-
take?: number;
|
|
109
|
-
}): Promise<Ticket[]>;
|
|
110
|
-
}
|
|
1
|
+
import * as Modules from './modules/index';
|
|
2
|
+
import type * as Types from './types/index';
|
|
3
|
+
import { Blip } from './modules/blip-main';
|
|
4
|
+
export { Types, Blip, Modules };
|