@pilot-status/sdk 0.2.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/README.md +86 -14
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +10 -1
- package/dist/client.js.map +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/api-keys.d.ts +19 -2
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +19 -11
- package/dist/resources/api-keys.js.map +1 -1
- package/dist/resources/calls.d.ts +72 -0
- package/dist/resources/calls.d.ts.map +1 -0
- package/dist/resources/calls.js +151 -0
- package/dist/resources/calls.js.map +1 -0
- package/dist/resources/media.d.ts +8 -0
- package/dist/resources/media.d.ts.map +1 -0
- package/dist/resources/media.js +14 -0
- package/dist/resources/media.js.map +1 -0
- package/dist/resources/messages.d.ts +2 -2
- package/dist/resources/messages.d.ts.map +1 -1
- package/dist/resources/messages.js +23 -10
- package/dist/resources/messages.js.map +1 -1
- package/dist/resources/numbers.d.ts +10 -8
- package/dist/resources/numbers.d.ts.map +1 -1
- package/dist/resources/numbers.js +11 -14
- package/dist/resources/numbers.js.map +1 -1
- package/dist/resources/remote-pairing.d.ts +10 -0
- package/dist/resources/remote-pairing.d.ts.map +1 -0
- package/dist/resources/remote-pairing.js +25 -0
- package/dist/resources/remote-pairing.js.map +1 -0
- package/dist/types.d.ts +201 -48
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -1
- package/dist/types.js.map +1 -1
- package/dist/webhooks/parse.d.ts.map +1 -1
- package/dist/webhooks/parse.js +121 -130
- package/dist/webhooks/parse.js.map +1 -1
- package/dist/webhooks/types.d.ts +169 -140
- package/dist/webhooks/types.d.ts.map +1 -1
- package/dist/webhooks/types.js +7 -0
- package/dist/webhooks/types.js.map +1 -1
- package/package.json +4 -3
package/dist/webhooks/types.d.ts
CHANGED
|
@@ -1,185 +1,214 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Customer webhook event types — schema v3 (camelCase, no legacy field names).
|
|
3
|
+
*
|
|
4
|
+
* Phones are always E.164 with a leading `+`. `numberId` is the public id of the
|
|
5
|
+
* number that handled the message/event (the same id `/v1/numbers` exposes).
|
|
6
|
+
* `createdAt` is the ISO-8601 timestamp of the event itself.
|
|
7
|
+
*/
|
|
8
|
+
export type WhatsAppMessageType = "text" | "image" | "audio" | "video" | "document" | "location" | "contacts" | "sticker" | "reaction";
|
|
9
|
+
type MessageEventBase = {
|
|
10
|
+
/** Public id of the number that handled the message. */
|
|
11
|
+
numberId: string;
|
|
12
|
+
/** Provider message id (null until the provider assigns one). */
|
|
13
|
+
messageId: string | null;
|
|
14
|
+
/** Pilot Status internal message id. */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Derived message kind. Omitted only when truly indeterminable. */
|
|
17
|
+
type?: WhatsAppMessageType;
|
|
18
|
+
fromMe: boolean;
|
|
19
|
+
/** ISO-8601 timestamp of the event. */
|
|
20
|
+
createdAt: string;
|
|
21
|
+
/** Present when correlating to `POST /v1/messages/send` (HTTP 202). */
|
|
22
|
+
correlationId?: string;
|
|
23
|
+
content?: string;
|
|
24
|
+
};
|
|
2
25
|
export type MessageSentEvent = {
|
|
3
26
|
event: "message.sent";
|
|
4
|
-
data: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
destinationNumber: string;
|
|
11
|
-
content: string;
|
|
12
|
-
status: Extract<MessageStatus, "SENT">;
|
|
13
|
-
sentAt: string;
|
|
27
|
+
data: MessageEventBase & {
|
|
28
|
+
/** Own number (omitted when not cheaply resolvable). */
|
|
29
|
+
from?: string;
|
|
30
|
+
/** Destination contact (E.164). */
|
|
31
|
+
to: string;
|
|
32
|
+
fromMe: true;
|
|
14
33
|
};
|
|
15
34
|
};
|
|
16
35
|
export type MessageDeliveredEvent = {
|
|
17
36
|
event: "message.delivered";
|
|
18
|
-
data: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
environment: Environment;
|
|
23
|
-
destinationNumber: string;
|
|
24
|
-
content: string;
|
|
25
|
-
status: Extract<MessageStatus, "DELIVERED">;
|
|
26
|
-
deliveredAt: string;
|
|
37
|
+
data: MessageEventBase & {
|
|
38
|
+
from?: string;
|
|
39
|
+
to: string;
|
|
40
|
+
fromMe: true;
|
|
27
41
|
};
|
|
28
42
|
};
|
|
29
43
|
export type MessageReadEvent = {
|
|
30
44
|
event: "message.read";
|
|
31
|
-
data: {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
environment: Environment;
|
|
36
|
-
destinationNumber: string;
|
|
37
|
-
content: string;
|
|
38
|
-
status: Extract<MessageStatus, "READ">;
|
|
39
|
-
readAt: string;
|
|
45
|
+
data: MessageEventBase & {
|
|
46
|
+
from?: string;
|
|
47
|
+
to: string;
|
|
48
|
+
fromMe: true;
|
|
40
49
|
};
|
|
41
50
|
};
|
|
42
51
|
export type MessageFailedEvent = {
|
|
43
52
|
event: "message.failed";
|
|
44
|
-
data: {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
content: string;
|
|
51
|
-
status: Extract<MessageStatus, "FAILED">;
|
|
52
|
-
failedAt: string;
|
|
53
|
-
errorMessage: string;
|
|
53
|
+
data: MessageEventBase & {
|
|
54
|
+
from?: string;
|
|
55
|
+
to: string;
|
|
56
|
+
fromMe: true;
|
|
57
|
+
error: string;
|
|
58
|
+
errorCode?: string;
|
|
54
59
|
};
|
|
55
60
|
};
|
|
56
|
-
export type
|
|
57
|
-
event: "message.
|
|
58
|
-
data: {
|
|
61
|
+
export type MessageReceivedEvent = {
|
|
62
|
+
event: "message.received";
|
|
63
|
+
data: MessageEventBase & {
|
|
64
|
+
/** Sender / contact (E.164). */
|
|
59
65
|
from: string;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
receivedAt: string;
|
|
64
|
-
messageId: string | null;
|
|
65
|
-
quotedMessageId: string | null;
|
|
66
|
-
messageRepliedId: string | null;
|
|
67
|
-
correlationId?: string;
|
|
68
|
-
environment: Environment;
|
|
69
|
-
buttonId?: string | null;
|
|
66
|
+
/** Own number (E.164). */
|
|
67
|
+
to: string;
|
|
68
|
+
participantName?: string | null;
|
|
70
69
|
};
|
|
71
70
|
};
|
|
72
|
-
export type
|
|
73
|
-
event: "message.
|
|
74
|
-
data: {
|
|
75
|
-
fromMe: boolean;
|
|
71
|
+
export type MessageReplyEvent = {
|
|
72
|
+
event: "message.reply";
|
|
73
|
+
data: MessageEventBase & {
|
|
76
74
|
from: string;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
correlationId?: string;
|
|
83
|
-
environment: Environment;
|
|
84
|
-
whatsappInstanceName?: string | null;
|
|
75
|
+
to: string;
|
|
76
|
+
participantName?: string | null;
|
|
77
|
+
/** Text of the quoted (replied-to) message. */
|
|
78
|
+
contentReplied?: string;
|
|
79
|
+
quotedMessageId?: string | null;
|
|
85
80
|
};
|
|
86
81
|
};
|
|
87
82
|
export type MessageGroupEvent = {
|
|
88
83
|
event: "message.group";
|
|
89
|
-
data: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
environment: Environment;
|
|
96
|
-
messageId: string | null;
|
|
84
|
+
data: MessageEventBase & {
|
|
85
|
+
/** Participant (E.164). */
|
|
86
|
+
from: string;
|
|
87
|
+
/** Own number (E.164). */
|
|
88
|
+
to: string;
|
|
89
|
+
participantName?: string | null;
|
|
97
90
|
groupId?: string;
|
|
98
|
-
|
|
91
|
+
groupName?: string | null;
|
|
99
92
|
};
|
|
100
93
|
};
|
|
101
94
|
export type MessageNewsletterEvent = {
|
|
102
95
|
event: "message.newsletter";
|
|
103
|
-
data: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
environment: Environment;
|
|
110
|
-
messageId: string | null;
|
|
111
|
-
newsletterId: string;
|
|
112
|
-
happenedAt: string;
|
|
96
|
+
data: MessageEventBase & {
|
|
97
|
+
from: string;
|
|
98
|
+
to: string;
|
|
99
|
+
participantName?: string | null;
|
|
100
|
+
newsletterId?: string;
|
|
101
|
+
newsletterName?: string | null;
|
|
113
102
|
};
|
|
114
103
|
};
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
firstOptInAt: string;
|
|
127
|
-
lastSeenAt: string;
|
|
128
|
-
};
|
|
104
|
+
type NumberEventBase = {
|
|
105
|
+
/** Public id of the number (same id `/v1/numbers` exposes). */
|
|
106
|
+
numberId: string;
|
|
107
|
+
/** E.164 with leading `+`. */
|
|
108
|
+
phone: string;
|
|
109
|
+
displayName: string;
|
|
110
|
+
/** ISO-8601 timestamp of the event. */
|
|
111
|
+
createdAt: string;
|
|
112
|
+
profileName?: string;
|
|
113
|
+
error?: string;
|
|
114
|
+
errorCode?: string;
|
|
129
115
|
};
|
|
130
116
|
export type NumberCreatedEvent = {
|
|
131
117
|
event: "number.created";
|
|
132
|
-
data:
|
|
133
|
-
numberId: string;
|
|
134
|
-
whatsappInstanceName: string;
|
|
135
|
-
displayName: string;
|
|
136
|
-
number: string;
|
|
137
|
-
status: string;
|
|
138
|
-
createdAt: string;
|
|
139
|
-
environment: Environment;
|
|
140
|
-
};
|
|
118
|
+
data: NumberEventBase;
|
|
141
119
|
};
|
|
142
120
|
export type NumberConnectedEvent = {
|
|
143
121
|
event: "number.connected";
|
|
144
|
-
data:
|
|
145
|
-
numberId: string;
|
|
146
|
-
whatsappInstanceName: string;
|
|
147
|
-
displayName: string;
|
|
148
|
-
number: string | null;
|
|
149
|
-
previousState: string;
|
|
150
|
-
nextState: string;
|
|
151
|
-
connectedAt: string;
|
|
152
|
-
environment: Environment;
|
|
153
|
-
};
|
|
122
|
+
data: NumberEventBase;
|
|
154
123
|
};
|
|
155
124
|
export type NumberDisconnectedEvent = {
|
|
156
125
|
event: "number.disconnected";
|
|
157
|
-
data:
|
|
158
|
-
numberId: string;
|
|
159
|
-
whatsappInstanceName: string;
|
|
160
|
-
displayName: string;
|
|
161
|
-
number: string | null;
|
|
162
|
-
/** Emitted after health-check confirmation, not on every transient Evolution signal. */
|
|
163
|
-
source: "healthcheck";
|
|
164
|
-
previousState: string;
|
|
165
|
-
nextState: string;
|
|
166
|
-
connectionState: string | null;
|
|
167
|
-
presenceStatus: number;
|
|
168
|
-
disconnectedAt: string;
|
|
169
|
-
environment: Environment;
|
|
170
|
-
};
|
|
126
|
+
data: NumberEventBase;
|
|
171
127
|
};
|
|
172
128
|
export type NumberRemovedEvent = {
|
|
173
129
|
event: "number.removed";
|
|
174
|
-
data:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
130
|
+
data: NumberEventBase;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* WhatsApp Business Calling events — Meta Cloud API AND web (Pilot Status)
|
|
134
|
+
* numbers (`call.permission_updated` is Meta-only). Unlike `message.*` /
|
|
135
|
+
* `number.*`, the normalized `call.*` payloads are FLAT — the fields sit next
|
|
136
|
+
* to `event` with no `data` wrapper.
|
|
137
|
+
*/
|
|
138
|
+
type CallEventBase = {
|
|
139
|
+
/** Pilot Status call id (use with GET /v1/calls/{callId}). */
|
|
140
|
+
callId: string | null;
|
|
141
|
+
/**
|
|
142
|
+
* Provider call id (Meta `wacid...` or the Evolution GO CallID) —
|
|
143
|
+
* correlates with the provider's native call envelope.
|
|
144
|
+
*/
|
|
145
|
+
externalCallId?: string | null;
|
|
146
|
+
/** INBOUND (user-initiated) or OUTBOUND (business-initiated). */
|
|
147
|
+
direction: string | null;
|
|
148
|
+
/** Call status (RINGING/ACCEPTED/COMPLETED/FAILED/MISSED/REJECTED) or permission status. */
|
|
149
|
+
status: string;
|
|
150
|
+
from: string | null;
|
|
151
|
+
to: string | null;
|
|
152
|
+
/** ISO-8601 timestamp of the event. */
|
|
153
|
+
timestamp: string;
|
|
154
|
+
/** Call duration in seconds (call.ended, only when the call was answered). */
|
|
155
|
+
duration?: number;
|
|
156
|
+
};
|
|
157
|
+
export type CallRingingEvent = CallEventBase & {
|
|
158
|
+
event: "call.ringing";
|
|
159
|
+
};
|
|
160
|
+
export type CallConnectedEvent = CallEventBase & {
|
|
161
|
+
event: "call.connected";
|
|
162
|
+
};
|
|
163
|
+
export type CallEndedEvent = CallEventBase & {
|
|
164
|
+
event: "call.ended";
|
|
165
|
+
};
|
|
166
|
+
export type CallMissedEvent = CallEventBase & {
|
|
167
|
+
event: "call.missed";
|
|
168
|
+
};
|
|
169
|
+
/** `status` is the permission status: NO_PERMISSION | TEMPORARY | PERMANENT. Meta-only. */
|
|
170
|
+
export type CallPermissionUpdatedEvent = CallEventBase & {
|
|
171
|
+
event: "call.permission_updated";
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Native Evolution GO call events — the webhook vocabulary of numbers migrated
|
|
175
|
+
* from an Evolution GO server. Delivered verbatim as `{ event, instance, data }`
|
|
176
|
+
* with whatsmeow PascalCase `data` fields; these are NOT part of the normalized
|
|
177
|
+
* schema-v3 union and are NOT handled by `parseCustomerWebhook`. Web numbers
|
|
178
|
+
* also receive the normalized `call.*` events above.
|
|
179
|
+
*/
|
|
180
|
+
export type EvolutionGoCallEventData = {
|
|
181
|
+
/** Provider call id — matches `externalCallId` on the normalized `call.*` events. */
|
|
182
|
+
CallID: string;
|
|
183
|
+
/** Peer JID (e.g. "5511888888888@s.whatsapp.net"). */
|
|
184
|
+
From: string;
|
|
185
|
+
/** JID of the party that created the call. */
|
|
186
|
+
CallCreator?: string;
|
|
187
|
+
/** ISO-8601 timestamp. */
|
|
188
|
+
Timestamp?: string;
|
|
189
|
+
/** CallOffer/CallAccept only. */
|
|
190
|
+
RemotePlatform?: string;
|
|
191
|
+
/** CallOffer/CallAccept only. */
|
|
192
|
+
RemoteVersion?: string;
|
|
193
|
+
/** CallTerminate only (e.g. "timeout", "reject"). */
|
|
194
|
+
Reason?: string;
|
|
195
|
+
};
|
|
196
|
+
export type EvolutionGoCallOfferEvent = {
|
|
197
|
+
event: "CallOffer";
|
|
198
|
+
instance?: string;
|
|
199
|
+
data: EvolutionGoCallEventData;
|
|
200
|
+
};
|
|
201
|
+
export type EvolutionGoCallAcceptEvent = {
|
|
202
|
+
event: "CallAccept";
|
|
203
|
+
instance?: string;
|
|
204
|
+
data: EvolutionGoCallEventData;
|
|
205
|
+
};
|
|
206
|
+
export type EvolutionGoCallTerminateEvent = {
|
|
207
|
+
event: "CallTerminate";
|
|
208
|
+
instance?: string;
|
|
209
|
+
data: EvolutionGoCallEventData;
|
|
183
210
|
};
|
|
184
|
-
export type
|
|
211
|
+
export type EvolutionGoCallEvent = EvolutionGoCallOfferEvent | EvolutionGoCallAcceptEvent | EvolutionGoCallTerminateEvent;
|
|
212
|
+
export type CustomerWebhookEvent = MessageSentEvent | MessageDeliveredEvent | MessageReadEvent | MessageFailedEvent | MessageReplyEvent | MessageReceivedEvent | MessageGroupEvent | MessageNewsletterEvent | NumberCreatedEvent | NumberConnectedEvent | NumberDisconnectedEvent | NumberRemovedEvent | CallRingingEvent | CallConnectedEvent | CallEndedEvent | CallMissedEvent | CallPermissionUpdatedEvent;
|
|
213
|
+
export {};
|
|
185
214
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/webhooks/types.ts"],"names":[],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KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IACxC,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC1B,yBAAyB,GACzB,0BAA0B,GAC1B,6BAA6B,CAAC;AAEpC,MAAM,MAAM,oBAAoB,GAC1B,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,iBAAiB,GACjB,sBAAsB,GACtB,kBAAkB,GAClB,oBAAoB,GACpB,uBAAuB,GACvB,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,GACf,0BAA0B,CAAC"}
|
package/dist/webhooks/types.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Customer webhook event types — schema v3 (camelCase, no legacy field names).
|
|
3
|
+
*
|
|
4
|
+
* Phones are always E.164 with a leading `+`. `numberId` is the public id of the
|
|
5
|
+
* number that handled the message/event (the same id `/v1/numbers` exposes).
|
|
6
|
+
* `createdAt` is the ISO-8601 timestamp of the event itself.
|
|
7
|
+
*/
|
|
1
8
|
export {};
|
|
2
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/webhooks/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/webhooks/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilot-status/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Official TypeScript SDK for the Pilot Status public API.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/pilot-status/pilot-status.git"
|
|
9
9
|
},
|
|
10
|
-
"homepage": "https://pilotstatus.
|
|
10
|
+
"homepage": "https://pilotstatus.com.br",
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/pilot-status/pilot-status/issues"
|
|
13
13
|
},
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"build": "tsc -p tsconfig.json",
|
|
36
36
|
"prepublishOnly": "npm run build",
|
|
37
37
|
"test": "vitest run",
|
|
38
|
-
"test:watch": "vitest"
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"test:coverage": "vitest run -c vitest.coverage.config.ts"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=18.0.0"
|