@sentdm/sentdm 0.7.1 → 0.14.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 +125 -0
- package/README.md +71 -34
- package/client.d.mts +49 -21
- package/client.d.mts.map +1 -1
- package/client.d.ts +49 -21
- package/client.d.ts.map +1 -1
- package/client.js +59 -38
- package/client.js.map +1 -1
- package/client.mjs +59 -38
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +7 -1
- package/resources/contacts.d.mts +243 -49
- package/resources/contacts.d.mts.map +1 -1
- package/resources/contacts.d.ts +243 -49
- package/resources/contacts.d.ts.map +1 -1
- package/resources/contacts.js +112 -15
- package/resources/contacts.js.map +1 -1
- package/resources/contacts.mjs +112 -15
- package/resources/contacts.mjs.map +1 -1
- package/resources/index.d.mts +8 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -1
- package/resources/index.mjs.map +1 -1
- package/resources/me.d.mts +269 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +269 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +40 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +36 -0
- package/resources/me.mjs.map +1 -0
- package/resources/messages.d.mts +239 -133
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +239 -133
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +42 -50
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +42 -50
- package/resources/messages.mjs.map +1 -1
- package/resources/numbers.d.mts +70 -0
- package/resources/numbers.d.mts.map +1 -0
- package/resources/numbers.d.ts +70 -0
- package/resources/numbers.d.ts.map +1 -0
- package/resources/numbers.js +36 -0
- package/resources/numbers.js.map +1 -0
- package/resources/numbers.mjs +32 -0
- package/resources/numbers.mjs.map +1 -0
- package/resources/profiles/campaigns.d.mts +339 -0
- package/resources/profiles/campaigns.d.mts.map +1 -0
- package/resources/profiles/campaigns.d.ts +339 -0
- package/resources/profiles/campaigns.d.ts.map +1 -0
- package/resources/profiles/campaigns.js +148 -0
- package/resources/profiles/campaigns.js.map +1 -0
- package/resources/profiles/campaigns.mjs +144 -0
- package/resources/profiles/campaigns.mjs.map +1 -0
- package/resources/profiles/index.d.mts +3 -0
- package/resources/profiles/index.d.mts.map +1 -0
- package/resources/profiles/index.d.ts +3 -0
- package/resources/profiles/index.d.ts.map +1 -0
- package/resources/profiles/index.js +9 -0
- package/resources/profiles/index.js.map +1 -0
- package/resources/profiles/index.mjs +4 -0
- package/resources/profiles/index.mjs.map +1 -0
- package/resources/profiles/profiles.d.mts +967 -0
- package/resources/profiles/profiles.d.mts.map +1 -0
- package/resources/profiles/profiles.d.ts +967 -0
- package/resources/profiles/profiles.d.ts.map +1 -0
- package/resources/profiles/profiles.js +227 -0
- package/resources/profiles/profiles.js.map +1 -0
- package/resources/profiles/profiles.mjs +222 -0
- package/resources/profiles/profiles.mjs.map +1 -0
- package/resources/profiles.d.mts +2 -0
- package/resources/profiles.d.mts.map +1 -0
- package/resources/profiles.d.ts +2 -0
- package/resources/profiles.d.ts.map +1 -0
- package/resources/profiles.js +6 -0
- package/resources/profiles.js.map +1 -0
- package/resources/profiles.mjs +3 -0
- package/resources/profiles.mjs.map +1 -0
- package/resources/templates.d.mts +327 -191
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +327 -191
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +80 -35
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +80 -35
- package/resources/templates.mjs.map +1 -1
- package/resources/users.d.mts +251 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +251 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +124 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +120 -0
- package/resources/users.mjs.map +1 -0
- package/resources/webhooks.d.mts +639 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +639 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +237 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +233 -0
- package/resources/webhooks.mjs.map +1 -0
- package/src/client.ts +235 -79
- package/src/internal/utils/log.ts +0 -1
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -0
- package/src/resources/contacts.ts +335 -57
- package/src/resources/index.ts +81 -12
- package/src/resources/me.ts +333 -0
- package/src/resources/messages.ts +306 -147
- package/src/resources/numbers.ts +102 -0
- package/src/resources/profiles/campaigns.ts +501 -0
- package/src/resources/profiles/index.ts +38 -0
- package/src/resources/profiles/profiles.ts +1302 -0
- package/src/resources/profiles.ts +3 -0
- package/src/resources/templates.ts +424 -202
- package/src/resources/users.ts +366 -0
- package/src/resources/webhooks.ts +923 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/number-lookup.d.mts +0 -59
- package/resources/number-lookup.d.mts.map +0 -1
- package/resources/number-lookup.d.ts +0 -59
- package/resources/number-lookup.d.ts.map +0 -1
- package/resources/number-lookup.js +0 -17
- package/resources/number-lookup.js.map +0 -1
- package/resources/number-lookup.mjs +0 -13
- package/resources/number-lookup.mjs.map +0 -1
- package/src/resources/number-lookup.ts +0 -80
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as MeAPI from './me';
|
|
5
|
+
import * as WebhooksAPI from './webhooks';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { buildHeaders } from '../internal/headers';
|
|
8
|
+
import { RequestOptions } from '../internal/request-options';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Retrieve account details
|
|
12
|
+
*/
|
|
13
|
+
export class Me extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Returns the account associated with the provided API key. The response includes
|
|
16
|
+
* account identity, contact information, messaging channel configuration, and —
|
|
17
|
+
* depending on the account type — either a list of child profiles or the profile's
|
|
18
|
+
* own settings.
|
|
19
|
+
*
|
|
20
|
+
* **Account types:**
|
|
21
|
+
*
|
|
22
|
+
* - `organization` — Has child profiles. The `profiles` array is populated.
|
|
23
|
+
* - `user` — Standalone account with no profiles.
|
|
24
|
+
* - `profile` — Child of an organization. Includes `organization_id`,
|
|
25
|
+
* `short_name`, `status`, and `settings`.
|
|
26
|
+
*
|
|
27
|
+
* **Channels:** The `channels` object always includes `sms`, `whatsapp`, and
|
|
28
|
+
* `rcs`. Each channel has a `configured` boolean. Configured channels expose
|
|
29
|
+
* additional details such as `phone_number`.
|
|
30
|
+
*/
|
|
31
|
+
retrieve(
|
|
32
|
+
params: MeRetrieveParams | null | undefined = {},
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): APIPromise<MeRetrieveResponse> {
|
|
35
|
+
const { 'x-profile-id': xProfileID } = params ?? {};
|
|
36
|
+
return this._client.get('/v3/me', {
|
|
37
|
+
...options,
|
|
38
|
+
headers: buildHeaders([
|
|
39
|
+
{ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
|
|
40
|
+
options?.headers,
|
|
41
|
+
]),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Profile configuration settings
|
|
48
|
+
*/
|
|
49
|
+
export interface ProfileSettings {
|
|
50
|
+
/**
|
|
51
|
+
* Whether contacts are shared across profiles in the organization
|
|
52
|
+
*/
|
|
53
|
+
allow_contact_sharing?: boolean | null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Whether templates are shared across profiles in the organization
|
|
57
|
+
*/
|
|
58
|
+
allow_template_sharing?: boolean | null;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Billing model: profile, organization, or profile_and_organization
|
|
62
|
+
*/
|
|
63
|
+
billing_model?: string | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Whether this profile inherits contacts from the organization
|
|
67
|
+
*/
|
|
68
|
+
inherit_contacts?: boolean | null;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Whether this profile inherits TCR brand from the organization
|
|
72
|
+
*/
|
|
73
|
+
inherit_tcr_brand?: boolean | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Whether this profile inherits TCR campaign from the organization
|
|
77
|
+
*/
|
|
78
|
+
inherit_tcr_campaign?: boolean | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Whether this profile inherits templates from the organization
|
|
82
|
+
*/
|
|
83
|
+
inherit_templates?: boolean | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Standard API response envelope for all v3 endpoints
|
|
88
|
+
*/
|
|
89
|
+
export interface MeRetrieveResponse {
|
|
90
|
+
/**
|
|
91
|
+
* Account response for GET /v3/me endpoint. Returns organization (with profiles),
|
|
92
|
+
* user (standalone), or profile (child of an organization) data depending on the
|
|
93
|
+
* API key type. Always includes messaging channel configuration.
|
|
94
|
+
*/
|
|
95
|
+
data?: MeRetrieveResponse.Data | null;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Error information
|
|
99
|
+
*/
|
|
100
|
+
error?: WebhooksAPI.ErrorDetail | null;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Request and response metadata
|
|
104
|
+
*/
|
|
105
|
+
meta?: WebhooksAPI.APIMeta;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Indicates whether the request was successful
|
|
109
|
+
*/
|
|
110
|
+
success?: boolean;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export namespace MeRetrieveResponse {
|
|
114
|
+
/**
|
|
115
|
+
* Account response for GET /v3/me endpoint. Returns organization (with profiles),
|
|
116
|
+
* user (standalone), or profile (child of an organization) data depending on the
|
|
117
|
+
* API key type. Always includes messaging channel configuration.
|
|
118
|
+
*/
|
|
119
|
+
export interface Data {
|
|
120
|
+
/**
|
|
121
|
+
* Customer ID (organization, account, or profile)
|
|
122
|
+
*/
|
|
123
|
+
id?: string;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Messaging channel configuration. All three channels are always present. Each
|
|
127
|
+
* channel has a "configured" flag; configured channels expose additional details.
|
|
128
|
+
*/
|
|
129
|
+
channels?: Data.Channels;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* When the account was created
|
|
133
|
+
*/
|
|
134
|
+
created_at?: string;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Account description
|
|
138
|
+
*/
|
|
139
|
+
description?: string | null;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Contact email address
|
|
143
|
+
*/
|
|
144
|
+
email?: string | null;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Account icon URL
|
|
148
|
+
*/
|
|
149
|
+
icon?: string | null;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Account name
|
|
153
|
+
*/
|
|
154
|
+
name?: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Organization ID (only for profile type — the parent organization)
|
|
158
|
+
*/
|
|
159
|
+
organization_id?: string | null;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* List of profiles (populated for organization type, empty for user and profile
|
|
163
|
+
* types)
|
|
164
|
+
*/
|
|
165
|
+
profiles?: Array<Data.Profile>;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Profile configuration settings
|
|
169
|
+
*/
|
|
170
|
+
settings?: MeAPI.ProfileSettings | null;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Short name / abbreviation (only for profile type)
|
|
174
|
+
*/
|
|
175
|
+
short_name?: string | null;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Profile status (only for profile type): incomplete, pending_review, approved,
|
|
179
|
+
* etc.
|
|
180
|
+
*/
|
|
181
|
+
status?: string | null;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Account type: "organization" (has profiles), "user" (no profiles), or "profile"
|
|
185
|
+
* (child of an organization)
|
|
186
|
+
*/
|
|
187
|
+
type?: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export namespace Data {
|
|
191
|
+
/**
|
|
192
|
+
* Messaging channel configuration. All three channels are always present. Each
|
|
193
|
+
* channel has a "configured" flag; configured channels expose additional details.
|
|
194
|
+
*/
|
|
195
|
+
export interface Channels {
|
|
196
|
+
/**
|
|
197
|
+
* RCS channel configuration. When configured, includes the RCS phone number.
|
|
198
|
+
*/
|
|
199
|
+
rcs?: Channels.Rcs;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* SMS channel configuration. When configured, includes the sending phone number.
|
|
203
|
+
*/
|
|
204
|
+
sms?: Channels.SMS;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* WhatsApp Business channel configuration. When configured, includes the WhatsApp
|
|
208
|
+
* phone number and business name.
|
|
209
|
+
*/
|
|
210
|
+
whatsapp?: Channels.Whatsapp;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export namespace Channels {
|
|
214
|
+
/**
|
|
215
|
+
* RCS channel configuration. When configured, includes the RCS phone number.
|
|
216
|
+
*/
|
|
217
|
+
export interface Rcs {
|
|
218
|
+
/**
|
|
219
|
+
* Whether RCS is configured for this account
|
|
220
|
+
*/
|
|
221
|
+
configured?: boolean;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* RCS-enabled phone number in E.164 format
|
|
225
|
+
*/
|
|
226
|
+
phone_number?: string | null;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* SMS channel configuration. When configured, includes the sending phone number.
|
|
231
|
+
*/
|
|
232
|
+
export interface SMS {
|
|
233
|
+
/**
|
|
234
|
+
* Whether SMS is configured for this account
|
|
235
|
+
*/
|
|
236
|
+
configured?: boolean;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Sending phone number in E.164 format
|
|
240
|
+
*/
|
|
241
|
+
phone_number?: string | null;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* WhatsApp Business channel configuration. When configured, includes the WhatsApp
|
|
246
|
+
* phone number and business name.
|
|
247
|
+
*/
|
|
248
|
+
export interface Whatsapp {
|
|
249
|
+
/**
|
|
250
|
+
* WhatsApp Business display name
|
|
251
|
+
*/
|
|
252
|
+
business_name?: string | null;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Whether WhatsApp is configured for this account
|
|
256
|
+
*/
|
|
257
|
+
configured?: boolean;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* WhatsApp phone number in E.164 format
|
|
261
|
+
*/
|
|
262
|
+
phone_number?: string | null;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Profile (sender profile) response for v3 API
|
|
268
|
+
*/
|
|
269
|
+
export interface Profile {
|
|
270
|
+
/**
|
|
271
|
+
* Profile unique identifier
|
|
272
|
+
*/
|
|
273
|
+
id?: string;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* When the profile was created
|
|
277
|
+
*/
|
|
278
|
+
created_at?: string;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Profile description
|
|
282
|
+
*/
|
|
283
|
+
description?: string | null;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Profile icon URL
|
|
287
|
+
*/
|
|
288
|
+
icon?: string | null;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Profile name
|
|
292
|
+
*/
|
|
293
|
+
name?: string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* User's role in this profile: admin, billing, developer (inherited from
|
|
297
|
+
* organization if not explicitly set)
|
|
298
|
+
*/
|
|
299
|
+
role?: string | null;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Profile configuration settings
|
|
303
|
+
*/
|
|
304
|
+
settings?: MeAPI.ProfileSettings;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Profile short name (abbreviation)
|
|
308
|
+
*/
|
|
309
|
+
short_name?: string | null;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Profile setup status: incomplete, pending_review, approved, rejected
|
|
313
|
+
*/
|
|
314
|
+
status?: string | null;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface MeRetrieveParams {
|
|
320
|
+
/**
|
|
321
|
+
* Profile UUID to scope the request to a child profile. Only organization API keys
|
|
322
|
+
* can use this header. The profile must belong to the calling organization.
|
|
323
|
+
*/
|
|
324
|
+
'x-profile-id'?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export declare namespace Me {
|
|
328
|
+
export {
|
|
329
|
+
type ProfileSettings as ProfileSettings,
|
|
330
|
+
type MeRetrieveResponse as MeRetrieveResponse,
|
|
331
|
+
type MeRetrieveParams as MeRetrieveParams,
|
|
332
|
+
};
|
|
333
|
+
}
|