@sentdm/sentdm 0.36.0 → 0.38.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/CHANGELOG.md +24 -0
- package/README.md +31 -0
- package/client.d.mts +28 -14
- package/client.d.mts.map +1 -1
- package/client.d.ts +28 -14
- package/client.d.ts.map +1 -1
- package/client.js +10 -0
- package/client.js.map +1 -1
- package/client.mjs +10 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +164 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +164 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +212 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +202 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/package.json +11 -1
- package/pagination.d.mts +3 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +3 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -0
- package/resources/contacts.d.mts +79 -626
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +79 -626
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +12 -11
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +12 -11
- package/resources/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +72 -346
- package/resources/conversations.d.mts.map +1 -1
- package/resources/conversations.d.ts +72 -346
- package/resources/conversations.d.ts.map +1 -1
- package/resources/conversations.js +16 -13
- package/resources/conversations.js.map +1 -1
- package/resources/conversations.mjs +16 -13
- package/resources/conversations.mjs.map +1 -1
- package/resources/index.d.mts +7 -7
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +7 -7
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +48 -129
- package/resources/me.d.mts.map +1 -1
- package/resources/me.d.ts +48 -129
- package/resources/me.d.ts.map +1 -1
- package/resources/me.js.map +1 -1
- package/resources/me.mjs.map +1 -1
- package/resources/messages.d.mts +8 -171
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +8 -171
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +3 -42
- package/resources/numbers.d.mts.map +1 -1
- package/resources/numbers.d.ts +3 -42
- package/resources/numbers.d.ts.map +1 -1
- package/resources/numbers.js.map +1 -1
- package/resources/numbers.mjs.map +1 -1
- package/resources/profiles/campaigns.d.mts +149 -544
- package/resources/profiles/campaigns.d.mts.map +1 -1
- package/resources/profiles/campaigns.d.ts +149 -544
- package/resources/profiles/campaigns.d.ts.map +1 -1
- package/resources/profiles/index.d.mts +2 -2
- package/resources/profiles/index.d.mts.map +1 -1
- package/resources/profiles/index.d.ts +2 -2
- package/resources/profiles/index.d.ts.map +1 -1
- package/resources/profiles/index.js.map +1 -1
- package/resources/profiles/index.mjs.map +1 -1
- package/resources/profiles/profiles.d.mts +411 -1821
- package/resources/profiles/profiles.d.mts.map +1 -1
- package/resources/profiles/profiles.d.ts +411 -1821
- package/resources/profiles/profiles.d.ts.map +1 -1
- package/resources/profiles/profiles.js.map +1 -1
- package/resources/profiles/profiles.mjs.map +1 -1
- package/resources/templates.d.mts +87 -532
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +87 -532
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +11 -10
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +11 -10
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +47 -437
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +47 -437
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +3 -3
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +3 -3
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +192 -856
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +192 -856
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +23 -19
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +23 -19
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +124 -45
- package/src/core/pagination.ts +428 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/contacts.ts +89 -726
- package/src/resources/conversations.ts +99 -427
- package/src/resources/index.ts +31 -23
- package/src/resources/me.ts +59 -148
- package/src/resources/messages.ts +8 -194
- package/src/resources/numbers.ts +3 -47
- package/src/resources/profiles/campaigns.ts +174 -673
- package/src/resources/profiles/index.ts +14 -6
- package/src/resources/profiles/profiles.ts +529 -2216
- package/src/resources/templates.ts +110 -629
- package/src/resources/users.ts +48 -505
- package/src/resources/webhooks.ts +307 -1091
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
|
-
import
|
|
4
|
+
import * as WebhooksAPI from './webhooks';
|
|
5
|
+
import { ConversationsPage, type ConversationsPageParams, PagePromise } from '../core/pagination';
|
|
5
6
|
import { buildHeaders } from '../internal/headers';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
@@ -20,15 +21,18 @@ export class Conversations extends APIResource {
|
|
|
20
21
|
*
|
|
21
22
|
* @example
|
|
22
23
|
* ```ts
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* }
|
|
24
|
+
* // Automatically fetches more pages as needed.
|
|
25
|
+
* for await (const conversation of client.conversations.list()) {
|
|
26
|
+
* // ...
|
|
27
|
+
* }
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
|
-
list(
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
list(
|
|
31
|
+
params: ConversationListParams | null | undefined = {},
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): PagePromise<ConversationMessagesListMessagesConversationsPage, ConversationMessagesList.Message> {
|
|
34
|
+
const { 'x-profile-id': xProfileID, ...query } = params ?? {};
|
|
35
|
+
return this._client.getAPIList('/v3/conversations', ConversationsPage<ConversationMessagesList.Message>, {
|
|
32
36
|
query,
|
|
33
37
|
...options,
|
|
34
38
|
headers: buildHeaders([
|
|
@@ -44,47 +48,56 @@ export class Conversations extends APIResource {
|
|
|
44
48
|
*
|
|
45
49
|
* @example
|
|
46
50
|
* ```ts
|
|
47
|
-
*
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const conversation of client.conversations.listMessages(
|
|
48
53
|
* '08fab313-c9e2-502c-975e-08b0356c432e',
|
|
49
|
-
*
|
|
50
|
-
*
|
|
54
|
+
* )) {
|
|
55
|
+
* // ...
|
|
56
|
+
* }
|
|
51
57
|
* ```
|
|
52
58
|
*/
|
|
53
59
|
listMessages(
|
|
54
60
|
id: string,
|
|
55
|
-
params: ConversationListMessagesParams,
|
|
61
|
+
params: ConversationListMessagesParams | null | undefined = {},
|
|
56
62
|
options?: RequestOptions,
|
|
57
|
-
):
|
|
58
|
-
const { 'x-profile-id': xProfileID, ...query } = params;
|
|
59
|
-
return this._client.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
options
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
): PagePromise<ConversationMessagesListMessagesConversationsPage, ConversationMessagesList.Message> {
|
|
64
|
+
const { 'x-profile-id': xProfileID, ...query } = params ?? {};
|
|
65
|
+
return this._client.getAPIList(
|
|
66
|
+
path`/v3/conversations/${id}`,
|
|
67
|
+
ConversationsPage<ConversationMessagesList.Message>,
|
|
68
|
+
{
|
|
69
|
+
query,
|
|
70
|
+
...options,
|
|
71
|
+
headers: buildHeaders([
|
|
72
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
73
|
+
options?.headers,
|
|
74
|
+
]),
|
|
75
|
+
},
|
|
76
|
+
);
|
|
67
77
|
}
|
|
68
78
|
}
|
|
69
79
|
|
|
80
|
+
export type ConversationMessagesListMessagesConversationsPage =
|
|
81
|
+
ConversationsPage<ConversationMessagesList.Message>;
|
|
82
|
+
|
|
70
83
|
/**
|
|
71
84
|
* Standard API response envelope for all v3 endpoints
|
|
72
85
|
*/
|
|
73
|
-
export interface
|
|
86
|
+
export interface APIResponseOfConversationMessagesList {
|
|
74
87
|
/**
|
|
75
88
|
* A paginated list of messages — used by both conversation read endpoints.
|
|
76
89
|
*/
|
|
77
|
-
data?:
|
|
90
|
+
data?: ConversationMessagesList | null;
|
|
78
91
|
|
|
79
92
|
/**
|
|
80
93
|
* Error information
|
|
81
94
|
*/
|
|
82
|
-
error?:
|
|
95
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
83
96
|
|
|
84
97
|
/**
|
|
85
98
|
* Request and response metadata
|
|
86
99
|
*/
|
|
87
|
-
meta?:
|
|
100
|
+
meta?: WebhooksAPI.APIMeta;
|
|
88
101
|
|
|
89
102
|
/**
|
|
90
103
|
* Indicates whether the request was successful
|
|
@@ -92,438 +105,106 @@ export interface ConversationListResponse {
|
|
|
92
105
|
success?: boolean;
|
|
93
106
|
}
|
|
94
107
|
|
|
95
|
-
export namespace ConversationListResponse {
|
|
96
|
-
/**
|
|
97
|
-
* A paginated list of messages — used by both conversation read endpoints.
|
|
98
|
-
*/
|
|
99
|
-
export interface Data {
|
|
100
|
-
/**
|
|
101
|
-
* The messages on this page.
|
|
102
|
-
*/
|
|
103
|
-
messages?: Array<Data.Message>;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Pagination metadata for list responses
|
|
107
|
-
*/
|
|
108
|
-
pagination?: Data.Pagination;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export namespace Data {
|
|
112
|
-
/**
|
|
113
|
-
* Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
114
|
-
*/
|
|
115
|
-
export interface Message {
|
|
116
|
-
id?: string;
|
|
117
|
-
|
|
118
|
-
active_contact_price?: number | null;
|
|
119
|
-
|
|
120
|
-
channel?: string;
|
|
121
|
-
|
|
122
|
-
contact_id?: string;
|
|
123
|
-
|
|
124
|
-
created_at?: string;
|
|
125
|
-
|
|
126
|
-
customer_id?: string;
|
|
127
|
-
|
|
128
|
-
direction?: string;
|
|
129
|
-
|
|
130
|
-
events?: Array<Message.Event> | null;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Structured message body format for database storage. Preserves channel-specific
|
|
134
|
-
* components (header, body, footer, buttons).
|
|
135
|
-
*/
|
|
136
|
-
message_body?: Message.MessageBody | null;
|
|
137
|
-
|
|
138
|
-
phone?: string;
|
|
139
|
-
|
|
140
|
-
phone_international?: string;
|
|
141
|
-
|
|
142
|
-
price?: number | null;
|
|
143
|
-
|
|
144
|
-
region_code?: string;
|
|
145
|
-
|
|
146
|
-
status?: string;
|
|
147
|
-
|
|
148
|
-
template_category?: string | null;
|
|
149
|
-
|
|
150
|
-
template_id?: string | null;
|
|
151
|
-
|
|
152
|
-
template_name?: string | null;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export namespace Message {
|
|
156
|
-
/**
|
|
157
|
-
* Represents a status change event in a message's lifecycle (v3)
|
|
158
|
-
*/
|
|
159
|
-
export interface Event {
|
|
160
|
-
status: string;
|
|
161
|
-
|
|
162
|
-
timestamp: string;
|
|
163
|
-
|
|
164
|
-
description?: string | null;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Structured message body format for database storage. Preserves channel-specific
|
|
169
|
-
* components (header, body, footer, buttons).
|
|
170
|
-
*/
|
|
171
|
-
export interface MessageBody {
|
|
172
|
-
buttons?: Array<MessageBody.Button> | null;
|
|
173
|
-
|
|
174
|
-
content?: string;
|
|
175
|
-
|
|
176
|
-
footer?: string | null;
|
|
177
|
-
|
|
178
|
-
header?: string | null;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export namespace MessageBody {
|
|
182
|
-
export interface Button {
|
|
183
|
-
postbackData?: string | null;
|
|
184
|
-
|
|
185
|
-
text?: string | null;
|
|
186
|
-
|
|
187
|
-
type?: string;
|
|
188
|
-
|
|
189
|
-
value?: string;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Pagination metadata for list responses
|
|
196
|
-
*/
|
|
197
|
-
export interface Pagination {
|
|
198
|
-
/**
|
|
199
|
-
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
200
|
-
*/
|
|
201
|
-
cursors?: Pagination.Cursors | null;
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Whether there are more pages after this one
|
|
205
|
-
*/
|
|
206
|
-
has_more?: boolean;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Current page number (1-indexed)
|
|
210
|
-
*/
|
|
211
|
-
page?: number;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Number of items per page
|
|
215
|
-
*/
|
|
216
|
-
page_size?: number;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Total number of items across all pages
|
|
220
|
-
*/
|
|
221
|
-
total_count?: number;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Total number of pages
|
|
225
|
-
*/
|
|
226
|
-
total_pages?: number;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export namespace Pagination {
|
|
230
|
-
/**
|
|
231
|
-
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
232
|
-
*/
|
|
233
|
-
export interface Cursors {
|
|
234
|
-
/**
|
|
235
|
-
* Cursor to fetch the next page.
|
|
236
|
-
*/
|
|
237
|
-
after?: string | null;
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Cursor to fetch the previous page.
|
|
241
|
-
*/
|
|
242
|
-
before?: string | null;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Error information
|
|
249
|
-
*/
|
|
250
|
-
export interface Error {
|
|
251
|
-
/**
|
|
252
|
-
* Machine-readable error code (e.g., "RESOURCE_001")
|
|
253
|
-
*/
|
|
254
|
-
code?: string;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Additional validation error details (field-level errors)
|
|
258
|
-
*/
|
|
259
|
-
details?: { [key: string]: Array<string> } | null;
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* URL to documentation about this error
|
|
263
|
-
*/
|
|
264
|
-
doc_url?: string | null;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Human-readable error message
|
|
268
|
-
*/
|
|
269
|
-
message?: string;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Request and response metadata
|
|
274
|
-
*/
|
|
275
|
-
export interface Meta {
|
|
276
|
-
/**
|
|
277
|
-
* Unique identifier for this request (for tracing and support)
|
|
278
|
-
*/
|
|
279
|
-
request_id?: string;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Server timestamp when the response was generated
|
|
283
|
-
*/
|
|
284
|
-
timestamp?: string;
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* API version used for this request
|
|
288
|
-
*/
|
|
289
|
-
version?: string;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
108
|
/**
|
|
294
|
-
*
|
|
109
|
+
* A paginated list of messages — used by both conversation read endpoints.
|
|
295
110
|
*/
|
|
296
|
-
export interface
|
|
297
|
-
/**
|
|
298
|
-
* A paginated list of messages — used by both conversation read endpoints.
|
|
299
|
-
*/
|
|
300
|
-
data?: ConversationListMessagesResponse.Data | null;
|
|
301
|
-
|
|
111
|
+
export interface ConversationMessagesList {
|
|
302
112
|
/**
|
|
303
|
-
*
|
|
304
|
-
*/
|
|
305
|
-
error?: ConversationListMessagesResponse.Error | null;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Request and response metadata
|
|
113
|
+
* The messages on this page.
|
|
309
114
|
*/
|
|
310
|
-
|
|
115
|
+
messages?: Array<ConversationMessagesList.Message>;
|
|
311
116
|
|
|
312
117
|
/**
|
|
313
|
-
*
|
|
118
|
+
* Pagination metadata for list responses
|
|
314
119
|
*/
|
|
315
|
-
|
|
120
|
+
pagination?: WebhooksAPI.PaginationMeta;
|
|
316
121
|
}
|
|
317
122
|
|
|
318
|
-
export namespace
|
|
123
|
+
export namespace ConversationMessagesList {
|
|
319
124
|
/**
|
|
320
|
-
*
|
|
125
|
+
* Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
321
126
|
*/
|
|
322
|
-
export interface
|
|
323
|
-
|
|
324
|
-
* The messages on this page.
|
|
325
|
-
*/
|
|
326
|
-
messages?: Array<Data.Message>;
|
|
127
|
+
export interface Message {
|
|
128
|
+
id?: string;
|
|
327
129
|
|
|
328
|
-
|
|
329
|
-
* Pagination metadata for list responses
|
|
330
|
-
*/
|
|
331
|
-
pagination?: Data.Pagination;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export namespace Data {
|
|
335
|
-
/**
|
|
336
|
-
* Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
337
|
-
*/
|
|
338
|
-
export interface Message {
|
|
339
|
-
id?: string;
|
|
340
|
-
|
|
341
|
-
active_contact_price?: number | null;
|
|
342
|
-
|
|
343
|
-
channel?: string;
|
|
344
|
-
|
|
345
|
-
contact_id?: string;
|
|
346
|
-
|
|
347
|
-
created_at?: string;
|
|
348
|
-
|
|
349
|
-
customer_id?: string;
|
|
350
|
-
|
|
351
|
-
direction?: string;
|
|
130
|
+
active_contact_price?: number | null;
|
|
352
131
|
|
|
353
|
-
|
|
132
|
+
channel?: string;
|
|
354
133
|
|
|
355
|
-
|
|
356
|
-
* Structured message body format for database storage. Preserves channel-specific
|
|
357
|
-
* components (header, body, footer, buttons).
|
|
358
|
-
*/
|
|
359
|
-
message_body?: Message.MessageBody | null;
|
|
134
|
+
contact_id?: string;
|
|
360
135
|
|
|
361
|
-
|
|
136
|
+
created_at?: string;
|
|
362
137
|
|
|
363
|
-
|
|
138
|
+
customer_id?: string;
|
|
364
139
|
|
|
365
|
-
|
|
140
|
+
direction?: string;
|
|
366
141
|
|
|
367
|
-
|
|
142
|
+
events?: Array<Message.Event> | null;
|
|
368
143
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
template_name?: string | null;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export namespace Message {
|
|
379
|
-
/**
|
|
380
|
-
* Represents a status change event in a message's lifecycle (v3)
|
|
381
|
-
*/
|
|
382
|
-
export interface Event {
|
|
383
|
-
status: string;
|
|
384
|
-
|
|
385
|
-
timestamp: string;
|
|
386
|
-
|
|
387
|
-
description?: string | null;
|
|
388
|
-
}
|
|
144
|
+
/**
|
|
145
|
+
* Structured message body format for database storage. Preserves channel-specific
|
|
146
|
+
* components (header, body, footer, buttons).
|
|
147
|
+
*/
|
|
148
|
+
message_body?: Message.MessageBody | null;
|
|
389
149
|
|
|
390
|
-
|
|
391
|
-
* Structured message body format for database storage. Preserves channel-specific
|
|
392
|
-
* components (header, body, footer, buttons).
|
|
393
|
-
*/
|
|
394
|
-
export interface MessageBody {
|
|
395
|
-
buttons?: Array<MessageBody.Button> | null;
|
|
150
|
+
phone?: string;
|
|
396
151
|
|
|
397
|
-
|
|
152
|
+
phone_international?: string;
|
|
398
153
|
|
|
399
|
-
|
|
154
|
+
price?: number | null;
|
|
400
155
|
|
|
401
|
-
|
|
402
|
-
}
|
|
156
|
+
region_code?: string;
|
|
403
157
|
|
|
404
|
-
|
|
405
|
-
export interface Button {
|
|
406
|
-
postbackData?: string | null;
|
|
158
|
+
status?: string;
|
|
407
159
|
|
|
408
|
-
|
|
160
|
+
template_category?: string | null;
|
|
409
161
|
|
|
410
|
-
|
|
162
|
+
template_id?: string | null;
|
|
411
163
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
}
|
|
164
|
+
template_name?: string | null;
|
|
165
|
+
}
|
|
416
166
|
|
|
167
|
+
export namespace Message {
|
|
417
168
|
/**
|
|
418
|
-
*
|
|
169
|
+
* Represents a status change event in a message's lifecycle (v3)
|
|
419
170
|
*/
|
|
420
|
-
export interface
|
|
421
|
-
|
|
422
|
-
* @deprecated Cursor-based pagination. Never populated — see Cursors.
|
|
423
|
-
*/
|
|
424
|
-
cursors?: Pagination.Cursors | null;
|
|
425
|
-
|
|
426
|
-
/**
|
|
427
|
-
* Whether there are more pages after this one
|
|
428
|
-
*/
|
|
429
|
-
has_more?: boolean;
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Current page number (1-indexed)
|
|
433
|
-
*/
|
|
434
|
-
page?: number;
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Number of items per page
|
|
438
|
-
*/
|
|
439
|
-
page_size?: number;
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Total number of items across all pages
|
|
443
|
-
*/
|
|
444
|
-
total_count?: number;
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Total number of pages
|
|
448
|
-
*/
|
|
449
|
-
total_pages?: number;
|
|
450
|
-
}
|
|
171
|
+
export interface Event {
|
|
172
|
+
status: string;
|
|
451
173
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
*/
|
|
456
|
-
export interface Cursors {
|
|
457
|
-
/**
|
|
458
|
-
* Cursor to fetch the next page.
|
|
459
|
-
*/
|
|
460
|
-
after?: string | null;
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* Cursor to fetch the previous page.
|
|
464
|
-
*/
|
|
465
|
-
before?: string | null;
|
|
466
|
-
}
|
|
174
|
+
timestamp: string;
|
|
175
|
+
|
|
176
|
+
description?: string | null;
|
|
467
177
|
}
|
|
468
|
-
}
|
|
469
178
|
|
|
470
|
-
/**
|
|
471
|
-
* Error information
|
|
472
|
-
*/
|
|
473
|
-
export interface Error {
|
|
474
179
|
/**
|
|
475
|
-
*
|
|
180
|
+
* Structured message body format for database storage. Preserves channel-specific
|
|
181
|
+
* components (header, body, footer, buttons).
|
|
476
182
|
*/
|
|
477
|
-
|
|
183
|
+
export interface MessageBody {
|
|
184
|
+
buttons?: Array<MessageBody.Button> | null;
|
|
478
185
|
|
|
479
|
-
|
|
480
|
-
* Additional validation error details (field-level errors)
|
|
481
|
-
*/
|
|
482
|
-
details?: { [key: string]: Array<string> } | null;
|
|
186
|
+
content?: string;
|
|
483
187
|
|
|
484
|
-
|
|
485
|
-
* URL to documentation about this error
|
|
486
|
-
*/
|
|
487
|
-
doc_url?: string | null;
|
|
188
|
+
footer?: string | null;
|
|
488
189
|
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
*/
|
|
492
|
-
message?: string;
|
|
493
|
-
}
|
|
190
|
+
header?: string | null;
|
|
191
|
+
}
|
|
494
192
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
export interface Meta {
|
|
499
|
-
/**
|
|
500
|
-
* Unique identifier for this request (for tracing and support)
|
|
501
|
-
*/
|
|
502
|
-
request_id?: string;
|
|
193
|
+
export namespace MessageBody {
|
|
194
|
+
export interface Button {
|
|
195
|
+
postbackData?: string | null;
|
|
503
196
|
|
|
504
|
-
|
|
505
|
-
* Server timestamp when the response was generated
|
|
506
|
-
*/
|
|
507
|
-
timestamp?: string;
|
|
197
|
+
text?: string | null;
|
|
508
198
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
199
|
+
type?: string;
|
|
200
|
+
|
|
201
|
+
value?: string;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
513
204
|
}
|
|
514
205
|
}
|
|
515
206
|
|
|
516
|
-
export interface ConversationListParams {
|
|
517
|
-
/**
|
|
518
|
-
* Query param
|
|
519
|
-
*/
|
|
520
|
-
page: number;
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Query param
|
|
524
|
-
*/
|
|
525
|
-
page_size: number;
|
|
526
|
-
|
|
207
|
+
export interface ConversationListParams extends ConversationsPageParams {
|
|
527
208
|
/**
|
|
528
209
|
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
529
210
|
* organization API keys can use this header. The profile must belong to the
|
|
@@ -532,17 +213,7 @@ export interface ConversationListParams {
|
|
|
532
213
|
'x-profile-id'?: string;
|
|
533
214
|
}
|
|
534
215
|
|
|
535
|
-
export interface ConversationListMessagesParams {
|
|
536
|
-
/**
|
|
537
|
-
* Query param
|
|
538
|
-
*/
|
|
539
|
-
page: number;
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* Query param
|
|
543
|
-
*/
|
|
544
|
-
page_size: number;
|
|
545
|
-
|
|
216
|
+
export interface ConversationListMessagesParams extends ConversationsPageParams {
|
|
546
217
|
/**
|
|
547
218
|
* Header param: Profile UUID to scope the request to a child profile. Only
|
|
548
219
|
* organization API keys can use this header. The profile must belong to the
|
|
@@ -553,8 +224,9 @@ export interface ConversationListMessagesParams {
|
|
|
553
224
|
|
|
554
225
|
export declare namespace Conversations {
|
|
555
226
|
export {
|
|
556
|
-
type
|
|
557
|
-
type
|
|
227
|
+
type APIResponseOfConversationMessagesList as APIResponseOfConversationMessagesList,
|
|
228
|
+
type ConversationMessagesList as ConversationMessagesList,
|
|
229
|
+
type ConversationMessagesListMessagesConversationsPage as ConversationMessagesListMessagesConversationsPage,
|
|
558
230
|
type ConversationListParams as ConversationListParams,
|
|
559
231
|
type ConversationListMessagesParams as ConversationListMessagesParams,
|
|
560
232
|
};
|