@voiflow/sdk 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +82 -2
- package/dist/cjs/client.js +43 -0
- package/dist/cjs/errors.js +49 -0
- package/dist/cjs/http.js +280 -0
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/pagination.js +15 -0
- package/dist/cjs/resources.generated.js +573 -0
- package/dist/cjs/sse.js +46 -0
- package/dist/cjs/webhooks.js +46 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.js +18 -0
- package/dist/errors.d.ts +37 -0
- package/dist/errors.js +43 -0
- package/dist/http.d.ts +66 -0
- package/dist/http.js +276 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pagination.d.ts +7 -0
- package/dist/pagination.js +12 -0
- package/dist/resources.generated.d.ts +1999 -0
- package/dist/resources.generated.js +544 -0
- package/dist/sse.d.ts +7 -0
- package/dist/sse.js +43 -0
- package/dist/webhooks.d.ts +26 -0
- package/dist/webhooks.js +40 -0
- package/package.json +45 -4
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
import { paginate } from "./pagination.js";
|
|
2
|
+
import { parseEventStream } from "./sse.js";
|
|
3
|
+
export class Businesses {
|
|
4
|
+
http;
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
list(params = {}) {
|
|
9
|
+
return paginate((cursor) => this.http.request("GET", `/businesses`, { query: { ...params.extraQuery, ...{}, cursor } }).then((r) => r.data));
|
|
10
|
+
}
|
|
11
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
12
|
+
create(body, options = {}) {
|
|
13
|
+
return this.http.request("POST", `/businesses`, { body, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
14
|
+
}
|
|
15
|
+
retrieve(businessId, params = {}) {
|
|
16
|
+
return this.http.request("GET", `/businesses/${encodeURIComponent(businessId)}`, { query: { ...params.extraQuery, ...{} } }).then((r) => r.data.data);
|
|
17
|
+
}
|
|
18
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
19
|
+
update(businessId, body) {
|
|
20
|
+
return this.http.request("PATCH", `/businesses/${encodeURIComponent(businessId)}`, { body }).then((r) => r.data.data);
|
|
21
|
+
}
|
|
22
|
+
readiness(businessId, params = {}) {
|
|
23
|
+
return this.http.request("GET", `/businesses/${encodeURIComponent(businessId)}/readiness`, { query: { ...params.extraQuery, ...{} } }).then((r) => r.data.data);
|
|
24
|
+
}
|
|
25
|
+
settings(businessId, params = {}) {
|
|
26
|
+
return this.http.request("GET", `/businesses/${encodeURIComponent(businessId)}/settings`, { query: { ...params.extraQuery, ...{} } }).then((r) => r.data.data);
|
|
27
|
+
}
|
|
28
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
29
|
+
updateSettings(businessId, body = {}, options = {}) {
|
|
30
|
+
return this.http.request("PATCH", `/businesses/${encodeURIComponent(businessId)}/settings`, { body, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export class Agents {
|
|
34
|
+
http;
|
|
35
|
+
constructor(http) {
|
|
36
|
+
this.http = http;
|
|
37
|
+
}
|
|
38
|
+
list(params = {}) {
|
|
39
|
+
return paginate((cursor) => this.http.request("GET", `/agents`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
40
|
+
}
|
|
41
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
42
|
+
create(body = {}, options = {}) {
|
|
43
|
+
return this.http.request("POST", `/agents`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
44
|
+
}
|
|
45
|
+
retrieve(agentId, params = {}) {
|
|
46
|
+
return this.http.request("GET", `/agents/${encodeURIComponent(agentId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
47
|
+
}
|
|
48
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
49
|
+
update(agentId, body = {}, options = {}) {
|
|
50
|
+
return this.http.request("PUT", `/agents/${encodeURIComponent(agentId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
51
|
+
}
|
|
52
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
53
|
+
delete(agentId, options = {}) {
|
|
54
|
+
return this.http.request("DELETE", `/agents/${encodeURIComponent(agentId)}`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
55
|
+
}
|
|
56
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
57
|
+
publish(agentId, body = {}, options = {}) {
|
|
58
|
+
return this.http.request("POST", `/agents/${encodeURIComponent(agentId)}/publish`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
59
|
+
}
|
|
60
|
+
voiceOptions(agentId, params = {}) {
|
|
61
|
+
return this.http.request("GET", `/agents/${encodeURIComponent(agentId)}/voice-options`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class Journeys {
|
|
65
|
+
http;
|
|
66
|
+
constructor(http) {
|
|
67
|
+
this.http = http;
|
|
68
|
+
}
|
|
69
|
+
list(params = {}) {
|
|
70
|
+
return paginate((cursor) => this.http.request("GET", `/journeys`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
71
|
+
}
|
|
72
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
73
|
+
create(body = {}, options = {}) {
|
|
74
|
+
return this.http.request("POST", `/journeys`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
75
|
+
}
|
|
76
|
+
retrieve(journeyId, params = {}) {
|
|
77
|
+
return this.http.request("GET", `/journeys/${encodeURIComponent(journeyId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
78
|
+
}
|
|
79
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
80
|
+
update(journeyId, body = {}, options = {}) {
|
|
81
|
+
return this.http.request("PUT", `/journeys/${encodeURIComponent(journeyId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
82
|
+
}
|
|
83
|
+
draft(journeyId, params = {}) {
|
|
84
|
+
return this.http.request("GET", `/journeys/${encodeURIComponent(journeyId)}/draft`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
85
|
+
}
|
|
86
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
87
|
+
saveDraft(journeyId, body, options = {}) {
|
|
88
|
+
return this.http.request("POST", `/journeys/${encodeURIComponent(journeyId)}/draft`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
89
|
+
}
|
|
90
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
91
|
+
createVersion(journeyId, body, options = {}) {
|
|
92
|
+
return this.http.request("POST", `/journeys/${encodeURIComponent(journeyId)}/versions`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
93
|
+
}
|
|
94
|
+
retrieveVersion(journeyId, version, params = {}) {
|
|
95
|
+
return this.http.request("GET", `/journeys/${encodeURIComponent(journeyId)}/versions/${encodeURIComponent(version)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
96
|
+
}
|
|
97
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
98
|
+
publish(journeyId, body, options = {}) {
|
|
99
|
+
return this.http.request("POST", `/journeys/${encodeURIComponent(journeyId)}/publish`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
100
|
+
}
|
|
101
|
+
impact(journeyId, params = {}) {
|
|
102
|
+
return this.http.request("GET", `/journeys/${encodeURIComponent(journeyId)}/impact`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export class Connections {
|
|
106
|
+
http;
|
|
107
|
+
constructor(http) {
|
|
108
|
+
this.http = http;
|
|
109
|
+
}
|
|
110
|
+
list(params = {}) {
|
|
111
|
+
return paginate((cursor) => this.http.request("GET", `/connections`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
112
|
+
}
|
|
113
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
114
|
+
create(body, options = {}) {
|
|
115
|
+
return this.http.request("POST", `/connections`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
116
|
+
}
|
|
117
|
+
retrieve(connectionId, params = {}) {
|
|
118
|
+
return this.http.request("GET", `/connections/${encodeURIComponent(connectionId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
119
|
+
}
|
|
120
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
121
|
+
update(connectionId, body = {}, options = {}) {
|
|
122
|
+
return this.http.request("PATCH", `/connections/${encodeURIComponent(connectionId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
123
|
+
}
|
|
124
|
+
readiness(connectionId, params = {}) {
|
|
125
|
+
return this.http.request("GET", `/connections/${encodeURIComponent(connectionId)}/readiness`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class Integrations {
|
|
129
|
+
http;
|
|
130
|
+
constructor(http) {
|
|
131
|
+
this.http = http;
|
|
132
|
+
}
|
|
133
|
+
list(params = {}) {
|
|
134
|
+
return this.http.request("GET", `/integrations`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export class ChannelAccounts {
|
|
138
|
+
http;
|
|
139
|
+
constructor(http) {
|
|
140
|
+
this.http = http;
|
|
141
|
+
}
|
|
142
|
+
list(params = {}) {
|
|
143
|
+
return paginate((cursor) => this.http.request("GET", `/channel-accounts`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
144
|
+
}
|
|
145
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
146
|
+
create(body, options = {}) {
|
|
147
|
+
return this.http.request("POST", `/channel-accounts`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export class Lines {
|
|
151
|
+
http;
|
|
152
|
+
constructor(http) {
|
|
153
|
+
this.http = http;
|
|
154
|
+
}
|
|
155
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
156
|
+
update(lineId, body = {}, options = {}) {
|
|
157
|
+
return this.http.request("PUT", `/lines/${encodeURIComponent(lineId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
158
|
+
}
|
|
159
|
+
list(params = {}) {
|
|
160
|
+
return this.http.request("GET", `/lines`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
export class Contacts {
|
|
164
|
+
http;
|
|
165
|
+
constructor(http) {
|
|
166
|
+
this.http = http;
|
|
167
|
+
}
|
|
168
|
+
list(params = {}) {
|
|
169
|
+
return paginate((cursor) => this.http.request("GET", `/contacts`, { query: { ...params.extraQuery, ...{ search: params.search, stage: params.stage, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
170
|
+
}
|
|
171
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
172
|
+
create(body = {}, options = {}) {
|
|
173
|
+
return this.http.request("POST", `/contacts`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
174
|
+
}
|
|
175
|
+
retrieve(contactId, params = {}) {
|
|
176
|
+
return this.http.request("GET", `/contacts/${encodeURIComponent(contactId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
177
|
+
}
|
|
178
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
179
|
+
update(contactId, body = {}, options = {}) {
|
|
180
|
+
return this.http.request("PUT", `/contacts/${encodeURIComponent(contactId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
181
|
+
}
|
|
182
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
183
|
+
setDnc(contactId, body = {}, options = {}) {
|
|
184
|
+
return this.http.request("POST", `/contacts/${encodeURIComponent(contactId)}/dnc`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export class Enquiries {
|
|
188
|
+
http;
|
|
189
|
+
constructor(http) {
|
|
190
|
+
this.http = http;
|
|
191
|
+
}
|
|
192
|
+
list(params = {}) {
|
|
193
|
+
return paginate((cursor) => this.http.request("GET", `/enquiries`, { query: { ...params.extraQuery, ...{ state: params.state, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
194
|
+
}
|
|
195
|
+
retrieve(requestId, params = {}) {
|
|
196
|
+
return this.http.request("GET", `/enquiries/${encodeURIComponent(requestId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export class Appointments {
|
|
200
|
+
http;
|
|
201
|
+
constructor(http) {
|
|
202
|
+
this.http = http;
|
|
203
|
+
}
|
|
204
|
+
list(params = {}) {
|
|
205
|
+
return paginate((cursor) => this.http.request("GET", `/calendar/appointments`, { query: { ...params.extraQuery, ...{ from_ms: params.fromMs, to_ms: params.toMs, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
206
|
+
}
|
|
207
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
208
|
+
create(body, options = {}) {
|
|
209
|
+
return this.http.request("POST", `/calendar/appointments`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
export class Calendar {
|
|
213
|
+
http;
|
|
214
|
+
constructor(http) {
|
|
215
|
+
this.http = http;
|
|
216
|
+
}
|
|
217
|
+
availability(params = {}) {
|
|
218
|
+
return this.http.request("GET", `/calendar/availability`, { query: { ...params.extraQuery, ...{ from_ms: params.fromMs, to_ms: params.toMs, resource_id: params.resourceId, service: params.service, business_id: params.businessId } } }).then((r) => r.data.data);
|
|
219
|
+
}
|
|
220
|
+
resources(params = {}) {
|
|
221
|
+
return this.http.request("GET", `/calendar/resources`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export class Knowledge {
|
|
225
|
+
http;
|
|
226
|
+
constructor(http) {
|
|
227
|
+
this.http = http;
|
|
228
|
+
}
|
|
229
|
+
list(params = {}) {
|
|
230
|
+
return paginate((cursor) => this.http.request("GET", `/knowledge`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
231
|
+
}
|
|
232
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
233
|
+
create(body = {}, options = {}) {
|
|
234
|
+
return this.http.request("POST", `/knowledge`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
235
|
+
}
|
|
236
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
237
|
+
update(itemId, body = {}, options = {}) {
|
|
238
|
+
return this.http.request("PUT", `/knowledge/${encodeURIComponent(itemId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
239
|
+
}
|
|
240
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
241
|
+
publish(itemId, options = {}) {
|
|
242
|
+
return this.http.request("POST", `/knowledge/${encodeURIComponent(itemId)}/publish`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export class Files {
|
|
246
|
+
http;
|
|
247
|
+
constructor(http) {
|
|
248
|
+
this.http = http;
|
|
249
|
+
}
|
|
250
|
+
list(params = {}) {
|
|
251
|
+
return paginate((cursor) => this.http.request("GET", `/files`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
252
|
+
}
|
|
253
|
+
/** Multipart upload: `file` is the document; `metadata` is optional JSON (title, description, ...). */
|
|
254
|
+
upload(file, options = {}) {
|
|
255
|
+
return this.http.uploadMultipart("POST", `/files`, file, options).then((r) => r.data.data);
|
|
256
|
+
}
|
|
257
|
+
retrieve(docId, params = {}) {
|
|
258
|
+
return this.http.request("GET", `/files/${encodeURIComponent(docId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
259
|
+
}
|
|
260
|
+
/** The stored original as raw bytes. */
|
|
261
|
+
download(docId, params = {}) {
|
|
262
|
+
return this.http.requestBinary("GET", `/files/${encodeURIComponent(docId)}/content`, { query: { business_id: params.businessId } });
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
export class Projects {
|
|
266
|
+
http;
|
|
267
|
+
constructor(http) {
|
|
268
|
+
this.http = http;
|
|
269
|
+
}
|
|
270
|
+
list(params = {}) {
|
|
271
|
+
return paginate((cursor) => this.http.request("GET", `/projects`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
272
|
+
}
|
|
273
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
274
|
+
create(body, options = {}) {
|
|
275
|
+
return this.http.request("POST", `/projects`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
export class Campaigns {
|
|
279
|
+
http;
|
|
280
|
+
constructor(http) {
|
|
281
|
+
this.http = http;
|
|
282
|
+
}
|
|
283
|
+
list(params = {}) {
|
|
284
|
+
return paginate((cursor) => this.http.request("GET", `/campaigns`, { query: { ...params.extraQuery, ...{ project_id: params.projectId, status: params.status, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
285
|
+
}
|
|
286
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
287
|
+
create(body, options = {}) {
|
|
288
|
+
return this.http.request("POST", `/campaigns`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
289
|
+
}
|
|
290
|
+
retrieve(campaignId, params = {}) {
|
|
291
|
+
return this.http.request("GET", `/campaigns/${encodeURIComponent(campaignId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
292
|
+
}
|
|
293
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
294
|
+
update(campaignId, body = {}, options = {}) {
|
|
295
|
+
return this.http.request("PUT", `/campaigns/${encodeURIComponent(campaignId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
296
|
+
}
|
|
297
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
298
|
+
setStatus(campaignId, body, options = {}) {
|
|
299
|
+
return this.http.request("POST", `/campaigns/${encodeURIComponent(campaignId)}/status`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
300
|
+
}
|
|
301
|
+
stats(campaignId, params = {}) {
|
|
302
|
+
return this.http.request("GET", `/campaigns/${encodeURIComponent(campaignId)}/stats`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
export class Runs {
|
|
306
|
+
http;
|
|
307
|
+
constructor(http) {
|
|
308
|
+
this.http = http;
|
|
309
|
+
}
|
|
310
|
+
retrieve(runId, params = {}) {
|
|
311
|
+
return this.http.request("GET", `/runs/${encodeURIComponent(runId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
312
|
+
}
|
|
313
|
+
stats(runId, params = {}) {
|
|
314
|
+
return this.http.request("GET", `/runs/${encodeURIComponent(runId)}/stats`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
315
|
+
}
|
|
316
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
317
|
+
create(body, options = {}) {
|
|
318
|
+
return this.http.request("POST", `/runs`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
export class Calls {
|
|
322
|
+
http;
|
|
323
|
+
constructor(http) {
|
|
324
|
+
this.http = http;
|
|
325
|
+
}
|
|
326
|
+
list(params = {}) {
|
|
327
|
+
return paginate((cursor) => this.http.request("GET", `/calls`, { query: { ...params.extraQuery, ...{ agent_id: params.agentId, direction: params.direction, days: params.days, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
328
|
+
}
|
|
329
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
330
|
+
create(body, options = {}) {
|
|
331
|
+
return this.http.request("POST", `/calls`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
332
|
+
}
|
|
333
|
+
retrieve(callId, params = {}) {
|
|
334
|
+
return this.http.request("GET", `/calls/${encodeURIComponent(callId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
335
|
+
}
|
|
336
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
337
|
+
end(callId, options = {}) {
|
|
338
|
+
return this.http.request("POST", `/calls/${encodeURIComponent(callId)}/end`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
339
|
+
}
|
|
340
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
341
|
+
steer(callId, body, options = {}) {
|
|
342
|
+
return this.http.request("POST", `/calls/${encodeURIComponent(callId)}/steer`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
343
|
+
}
|
|
344
|
+
transcript(callId, params = {}) {
|
|
345
|
+
return paginate((cursor) => this.http.request("GET", `/calls/${encodeURIComponent(callId)}/transcript`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
346
|
+
}
|
|
347
|
+
recording(callId, params = {}) {
|
|
348
|
+
return this.http.request("GET", `/calls/${encodeURIComponent(callId)}/recording`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
349
|
+
}
|
|
350
|
+
async *stream(params, options = {}) {
|
|
351
|
+
const body = await this.http.openStream(`/events/stream`, { call: params.call, business_id: params.businessId }, { signal: options.signal, lastEventId: options.lastEventId });
|
|
352
|
+
yield* parseEventStream(body);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
export class Conversations {
|
|
356
|
+
http;
|
|
357
|
+
constructor(http) {
|
|
358
|
+
this.http = http;
|
|
359
|
+
}
|
|
360
|
+
list(params = {}) {
|
|
361
|
+
return paginate((cursor) => this.http.request("GET", `/conversations`, { query: { ...params.extraQuery, ...{ channel: params.channel, contact_id: params.contactId, state: params.state, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
362
|
+
}
|
|
363
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
364
|
+
create(body, options = {}) {
|
|
365
|
+
return this.http.request("POST", `/conversations`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
366
|
+
}
|
|
367
|
+
retrieve(cid, params = {}) {
|
|
368
|
+
return this.http.request("GET", `/conversations/${encodeURIComponent(cid)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
369
|
+
}
|
|
370
|
+
listMessages(cid, params = {}) {
|
|
371
|
+
return paginate((cursor) => this.http.request("GET", `/conversations/${encodeURIComponent(cid)}/messages`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
372
|
+
}
|
|
373
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
374
|
+
sendMessage(cid, body = {}, options = {}) {
|
|
375
|
+
return this.http.request("POST", `/conversations/${encodeURIComponent(cid)}/messages`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
376
|
+
}
|
|
377
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
378
|
+
takeover(cid, options = {}) {
|
|
379
|
+
return this.http.request("POST", `/conversations/${encodeURIComponent(cid)}/takeover`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
380
|
+
}
|
|
381
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
382
|
+
resumeAi(cid, options = {}) {
|
|
383
|
+
return this.http.request("POST", `/conversations/${encodeURIComponent(cid)}/resume-ai`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
export class AiWork {
|
|
387
|
+
http;
|
|
388
|
+
constructor(http) {
|
|
389
|
+
this.http = http;
|
|
390
|
+
}
|
|
391
|
+
list(params = {}) {
|
|
392
|
+
return paginate((cursor) => this.http.request("GET", `/promises`, { query: { ...params.extraQuery, ...{ state: params.state, channel: params.channel, contact_id: params.contactId, origin_kind: params.originKind, origin_id: params.originId, from_ts: params.fromTs, to_ts: params.toTs, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
393
|
+
}
|
|
394
|
+
retrieve(promiseId, params = {}) {
|
|
395
|
+
return this.http.request("GET", `/promises/${encodeURIComponent(promiseId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
396
|
+
}
|
|
397
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
398
|
+
cancel(promiseId, options = {}) {
|
|
399
|
+
return this.http.request("POST", `/promises/${encodeURIComponent(promiseId)}/cancel`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
400
|
+
}
|
|
401
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
402
|
+
requeue(promiseId, options = {}) {
|
|
403
|
+
return this.http.request("POST", `/promises/${encodeURIComponent(promiseId)}/requeue`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
export class WebhookEndpoints {
|
|
407
|
+
http;
|
|
408
|
+
constructor(http) {
|
|
409
|
+
this.http = http;
|
|
410
|
+
}
|
|
411
|
+
list(params = {}) {
|
|
412
|
+
return paginate((cursor) => this.http.request("GET", `/webhook-endpoints`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
413
|
+
}
|
|
414
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
415
|
+
create(body, options = {}) {
|
|
416
|
+
return this.http.request("POST", `/webhook-endpoints`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
417
|
+
}
|
|
418
|
+
retrieve(endpointId, params = {}) {
|
|
419
|
+
return this.http.request("GET", `/webhook-endpoints/${encodeURIComponent(endpointId)}`, { query: { ...params.extraQuery, ...{ business_id: params.businessId } } }).then((r) => r.data.data);
|
|
420
|
+
}
|
|
421
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
422
|
+
update(endpointId, body = {}, options = {}) {
|
|
423
|
+
return this.http.request("PATCH", `/webhook-endpoints/${encodeURIComponent(endpointId)}`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
424
|
+
}
|
|
425
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
426
|
+
delete(endpointId, options = {}) {
|
|
427
|
+
return this.http.request("DELETE", `/webhook-endpoints/${encodeURIComponent(endpointId)}`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
428
|
+
}
|
|
429
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
430
|
+
rotateSecret(endpointId, options = {}) {
|
|
431
|
+
return this.http.request("POST", `/webhook-endpoints/${encodeURIComponent(endpointId)}/rotate-secret`, { query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
432
|
+
}
|
|
433
|
+
listDeliveries(endpointId, params = {}) {
|
|
434
|
+
return paginate((cursor) => this.http.request("GET", `/webhook-endpoints/${encodeURIComponent(endpointId)}/deliveries`, { query: { ...params.extraQuery, ...{ business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
export class Events {
|
|
438
|
+
http;
|
|
439
|
+
constructor(http) {
|
|
440
|
+
this.http = http;
|
|
441
|
+
}
|
|
442
|
+
list(params = {}) {
|
|
443
|
+
return paginate((cursor) => this.http.request("GET", `/events`, { query: { ...params.extraQuery, ...{ event_type: params.eventType, business_id: params.businessId }, cursor } }).then((r) => r.data));
|
|
444
|
+
}
|
|
445
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
446
|
+
replay(eventId, options = {}) {
|
|
447
|
+
return this.http.request("POST", `/events/${encodeURIComponent(eventId)}/replay`, { query: { endpoint_id: options.endpointId, business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
export class Sessions {
|
|
451
|
+
http;
|
|
452
|
+
constructor(http) {
|
|
453
|
+
this.http = http;
|
|
454
|
+
}
|
|
455
|
+
/** May throw VoiFlowOperationPending (HTTP 202): the outcome is not yet known — do not repeat under a new key. */
|
|
456
|
+
create(body, options = {}) {
|
|
457
|
+
return this.http.request("POST", `/sessions`, { body, query: { business_id: options.businessId }, idempotencyKey: options.idempotencyKey, idempotent: true }).then((r) => r.data.data);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
export class Usage {
|
|
461
|
+
http;
|
|
462
|
+
constructor(http) {
|
|
463
|
+
this.http = http;
|
|
464
|
+
}
|
|
465
|
+
get(params = {}) {
|
|
466
|
+
return this.http.request("GET", `/usage`, { query: { ...params.extraQuery, ...{ days: params.days, from_ms: params.fromMs, to_ms: params.toMs, business_id: params.businessId } } }).then((r) => r.data.data);
|
|
467
|
+
}
|
|
468
|
+
costs(params = {}) {
|
|
469
|
+
return this.http.request("GET", `/usage/costs`, { query: { ...params.extraQuery, ...{ days: params.days, business_id: params.businessId } } }).then((r) => r.data.data);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
export class Operations {
|
|
473
|
+
http;
|
|
474
|
+
constructor(http) {
|
|
475
|
+
this.http = http;
|
|
476
|
+
}
|
|
477
|
+
retrieve(operationId, params = {}) {
|
|
478
|
+
return this.http.request("GET", `/operations/${encodeURIComponent(operationId)}`, { query: { ...params.extraQuery, ...{} } }).then((r) => r.data.data);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
export class Limits {
|
|
482
|
+
http;
|
|
483
|
+
constructor(http) {
|
|
484
|
+
this.http = http;
|
|
485
|
+
}
|
|
486
|
+
get(params = {}) {
|
|
487
|
+
return this.http.request("GET", `/limits`, { query: { ...params.extraQuery, ...{} } }).then((r) => r.data.data);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
/** One property per published resource group; VoiFlowClient extends this. */
|
|
491
|
+
export class GeneratedResources {
|
|
492
|
+
businesses;
|
|
493
|
+
agents;
|
|
494
|
+
journeys;
|
|
495
|
+
connections;
|
|
496
|
+
integrations;
|
|
497
|
+
channelAccounts;
|
|
498
|
+
lines;
|
|
499
|
+
contacts;
|
|
500
|
+
enquiries;
|
|
501
|
+
appointments;
|
|
502
|
+
calendar;
|
|
503
|
+
knowledge;
|
|
504
|
+
files;
|
|
505
|
+
projects;
|
|
506
|
+
campaigns;
|
|
507
|
+
runs;
|
|
508
|
+
calls;
|
|
509
|
+
conversations;
|
|
510
|
+
aiWork;
|
|
511
|
+
webhookEndpoints;
|
|
512
|
+
events;
|
|
513
|
+
sessions;
|
|
514
|
+
usage;
|
|
515
|
+
operations;
|
|
516
|
+
limits;
|
|
517
|
+
constructor(http) {
|
|
518
|
+
this.businesses = new Businesses(http);
|
|
519
|
+
this.agents = new Agents(http);
|
|
520
|
+
this.journeys = new Journeys(http);
|
|
521
|
+
this.connections = new Connections(http);
|
|
522
|
+
this.integrations = new Integrations(http);
|
|
523
|
+
this.channelAccounts = new ChannelAccounts(http);
|
|
524
|
+
this.lines = new Lines(http);
|
|
525
|
+
this.contacts = new Contacts(http);
|
|
526
|
+
this.enquiries = new Enquiries(http);
|
|
527
|
+
this.appointments = new Appointments(http);
|
|
528
|
+
this.calendar = new Calendar(http);
|
|
529
|
+
this.knowledge = new Knowledge(http);
|
|
530
|
+
this.files = new Files(http);
|
|
531
|
+
this.projects = new Projects(http);
|
|
532
|
+
this.campaigns = new Campaigns(http);
|
|
533
|
+
this.runs = new Runs(http);
|
|
534
|
+
this.calls = new Calls(http);
|
|
535
|
+
this.conversations = new Conversations(http);
|
|
536
|
+
this.aiWork = new AiWork(http);
|
|
537
|
+
this.webhookEndpoints = new WebhookEndpoints(http);
|
|
538
|
+
this.events = new Events(http);
|
|
539
|
+
this.sessions = new Sessions(http);
|
|
540
|
+
this.usage = new Usage(http);
|
|
541
|
+
this.operations = new Operations(http);
|
|
542
|
+
this.limits = new Limits(http);
|
|
543
|
+
}
|
|
544
|
+
}
|
package/dist/sse.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SSEEvent {
|
|
2
|
+
id?: string;
|
|
3
|
+
event?: string;
|
|
4
|
+
data: string;
|
|
5
|
+
}
|
|
6
|
+
/** Parses a text/event-stream body into discrete events, one yield per blank-line-terminated block. */
|
|
7
|
+
export declare function parseEventStream(stream: ReadableStream<Uint8Array>): AsyncGenerator<SSEEvent, void, void>;
|
package/dist/sse.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Parses a text/event-stream body into discrete events, one yield per blank-line-terminated block. */
|
|
2
|
+
export async function* parseEventStream(stream) {
|
|
3
|
+
const reader = stream.getReader();
|
|
4
|
+
const decoder = new TextDecoder();
|
|
5
|
+
let buffer = "";
|
|
6
|
+
try {
|
|
7
|
+
while (true) {
|
|
8
|
+
const { value, done } = await reader.read();
|
|
9
|
+
if (done)
|
|
10
|
+
break;
|
|
11
|
+
buffer += decoder.decode(value, { stream: true });
|
|
12
|
+
let boundary;
|
|
13
|
+
while ((boundary = buffer.indexOf("\n\n")) !== -1) {
|
|
14
|
+
const block = buffer.slice(0, boundary);
|
|
15
|
+
buffer = buffer.slice(boundary + 2);
|
|
16
|
+
const event = parseBlock(block);
|
|
17
|
+
if (event)
|
|
18
|
+
yield event;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
// Closes the underlying connection too, not just the local reader lock — important when the
|
|
24
|
+
// caller breaks out of a for-await loop early (SSE streams are otherwise long-lived).
|
|
25
|
+
await reader.cancel().catch(() => undefined);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function parseBlock(block) {
|
|
29
|
+
let id;
|
|
30
|
+
let eventName;
|
|
31
|
+
const dataLines = [];
|
|
32
|
+
for (const line of block.split("\n")) {
|
|
33
|
+
if (line.startsWith("id:"))
|
|
34
|
+
id = line.slice(3).trim();
|
|
35
|
+
else if (line.startsWith("event:"))
|
|
36
|
+
eventName = line.slice(6).trim();
|
|
37
|
+
else if (line.startsWith("data:"))
|
|
38
|
+
dataLines.push(line.slice(5).trim());
|
|
39
|
+
}
|
|
40
|
+
if (dataLines.length === 0)
|
|
41
|
+
return undefined;
|
|
42
|
+
return { id, event: eventName, data: dataLines.join("\n") };
|
|
43
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const SIGNATURE_HEADER = "VoiFlow-Signature";
|
|
2
|
+
export declare class WebhookSignatureError extends Error {
|
|
3
|
+
}
|
|
4
|
+
export interface VerifyOptions {
|
|
5
|
+
/** Tolerance in seconds between the signed timestamp and now. Default 300 (5 minutes). */
|
|
6
|
+
toleranceSeconds?: number;
|
|
7
|
+
now?: () => number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Verifies `VoiFlow-Signature: t=<unix_seconds>,v1=<hex_hmac_sha256>` against the raw request
|
|
11
|
+
* body bytes. Signed payload is the UTF-8 timestamp, a literal period, then the raw bytes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function verifyWebhookSignature(rawBody: Buffer | Uint8Array, signatureHeader: string, secret: string, options?: VerifyOptions): void;
|
|
14
|
+
export interface VoiFlowEvent {
|
|
15
|
+
id: string;
|
|
16
|
+
type: string;
|
|
17
|
+
occurred_ts: number;
|
|
18
|
+
environment: string;
|
|
19
|
+
business_id: string;
|
|
20
|
+
schema_version: string;
|
|
21
|
+
/** null when the payload is redacted or past retention; see `unavailable_reason`. */
|
|
22
|
+
data: Record<string, unknown> | null;
|
|
23
|
+
unavailable_reason?: "redacted" | "beyond_retention";
|
|
24
|
+
}
|
|
25
|
+
/** Parses the verified webhook body. Call verifyWebhookSignature first. */
|
|
26
|
+
export declare function parseWebhookEvent(rawBody: Buffer | Uint8Array): VoiFlowEvent;
|