@sentdm/sentdm 0.32.0 → 0.34.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/client.d.mts +11 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/contacts.d.mts +66 -1
  12. package/resources/contacts.d.mts.map +1 -1
  13. package/resources/contacts.d.ts +66 -1
  14. package/resources/contacts.d.ts.map +1 -1
  15. package/resources/contacts.js +24 -0
  16. package/resources/contacts.js.map +1 -1
  17. package/resources/contacts.mjs +24 -0
  18. package/resources/contacts.mjs.map +1 -1
  19. package/resources/conversations.d.mts +160 -0
  20. package/resources/conversations.d.mts.map +1 -0
  21. package/resources/conversations.d.ts +160 -0
  22. package/resources/conversations.d.ts.map +1 -0
  23. package/resources/conversations.js +59 -0
  24. package/resources/conversations.js.map +1 -0
  25. package/resources/conversations.mjs +55 -0
  26. package/resources/conversations.mjs.map +1 -0
  27. package/resources/index.d.mts +5 -4
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +5 -4
  30. package/resources/index.d.ts.map +1 -1
  31. package/resources/index.js +3 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs +1 -0
  34. package/resources/index.mjs.map +1 -1
  35. package/resources/messages.d.mts +7 -3
  36. package/resources/messages.d.mts.map +1 -1
  37. package/resources/messages.d.ts +7 -3
  38. package/resources/messages.d.ts.map +1 -1
  39. package/resources/messages.js +6 -1
  40. package/resources/messages.js.map +1 -1
  41. package/resources/messages.mjs +6 -1
  42. package/resources/messages.mjs.map +1 -1
  43. package/resources/profiles/campaigns.d.mts +112 -83
  44. package/resources/profiles/campaigns.d.mts.map +1 -1
  45. package/resources/profiles/campaigns.d.ts +112 -83
  46. package/resources/profiles/campaigns.d.ts.map +1 -1
  47. package/resources/profiles/campaigns.js +6 -5
  48. package/resources/profiles/campaigns.js.map +1 -1
  49. package/resources/profiles/campaigns.mjs +6 -5
  50. package/resources/profiles/campaigns.mjs.map +1 -1
  51. package/resources/profiles/index.d.mts +2 -2
  52. package/resources/profiles/index.d.mts.map +1 -1
  53. package/resources/profiles/index.d.ts +2 -2
  54. package/resources/profiles/index.d.ts.map +1 -1
  55. package/resources/profiles/profiles.d.mts +151 -139
  56. package/resources/profiles/profiles.d.mts.map +1 -1
  57. package/resources/profiles/profiles.d.ts +151 -139
  58. package/resources/profiles/profiles.d.ts.map +1 -1
  59. package/resources/profiles/profiles.js +39 -21
  60. package/resources/profiles/profiles.js.map +1 -1
  61. package/resources/profiles/profiles.mjs +39 -21
  62. package/resources/profiles/profiles.mjs.map +1 -1
  63. package/resources/templates.d.mts +87 -87
  64. package/resources/templates.d.mts.map +1 -1
  65. package/resources/templates.d.ts +87 -87
  66. package/resources/templates.d.ts.map +1 -1
  67. package/resources/users.d.mts +5 -3
  68. package/resources/users.d.mts.map +1 -1
  69. package/resources/users.d.ts +5 -3
  70. package/resources/users.d.ts.map +1 -1
  71. package/resources/users.js +5 -3
  72. package/resources/users.js.map +1 -1
  73. package/resources/users.mjs +5 -3
  74. package/resources/users.mjs.map +1 -1
  75. package/resources/webhooks.d.mts +226 -2
  76. package/resources/webhooks.d.mts.map +1 -1
  77. package/resources/webhooks.d.ts +226 -2
  78. package/resources/webhooks.d.ts.map +1 -1
  79. package/src/client.ts +53 -18
  80. package/src/resources/contacts.ts +96 -0
  81. package/src/resources/conversations.ts +238 -0
  82. package/src/resources/index.ts +25 -9
  83. package/src/resources/messages.ts +7 -3
  84. package/src/resources/profiles/campaigns.ts +160 -132
  85. package/src/resources/profiles/index.ts +8 -8
  86. package/src/resources/profiles/profiles.ts +185 -175
  87. package/src/resources/templates.ts +105 -105
  88. package/src/resources/users.ts +5 -3
  89. package/src/resources/webhooks.ts +269 -1
  90. package/src/version.ts +1 -1
  91. package/version.d.mts +1 -1
  92. package/version.d.ts +1 -1
  93. package/version.js +1 -1
  94. package/version.mjs +1 -1
@@ -1,7 +1,6 @@
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 * as CampaignsAPI from './campaigns';
5
4
  import * as WebhooksAPI from '../webhooks';
6
5
  import { APIPromise } from '../../core/api-promise';
7
6
  import { buildHeaders } from '../../internal/headers';
@@ -18,7 +17,7 @@ export class Campaigns extends APIResource {
18
17
  *
19
18
  * @example
20
19
  * ```ts
21
- * const apiResponseOfTcrCampaignWithUseCases =
20
+ * const apiResponseOfBrandCampaign =
22
21
  * await client.profiles.campaigns.create(
23
22
  * '770e8400-e29b-41d4-a716-446655440002',
24
23
  * {
@@ -45,7 +44,7 @@ export class Campaigns extends APIResource {
45
44
  profileID: string,
46
45
  params: CampaignCreateParams,
47
46
  options?: RequestOptions,
48
- ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
47
+ ): APIPromise<APIResponseOfBrandCampaign> {
49
48
  const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
50
49
  return this._client.post(path`/v3/profiles/${profileID}/campaigns`, {
51
50
  body,
@@ -66,7 +65,7 @@ export class Campaigns extends APIResource {
66
65
  *
67
66
  * @example
68
67
  * ```ts
69
- * const apiResponseOfTcrCampaignWithUseCases =
68
+ * const apiResponseOfBrandCampaign =
70
69
  * await client.profiles.campaigns.update(
71
70
  * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
72
71
  * {
@@ -94,7 +93,7 @@ export class Campaigns extends APIResource {
94
93
  campaignID: string,
95
94
  params: CampaignUpdateParams,
96
95
  options?: RequestOptions,
97
- ): APIPromise<APIResponseOfTcrCampaignWithUseCases> {
96
+ ): APIPromise<APIResponseOfBrandCampaign> {
98
97
  const { profileId, 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
99
98
  return this._client.put(path`/v3/profiles/${profileId}/campaigns/${campaignID}`, {
100
99
  body,
@@ -115,16 +114,17 @@ export class Campaigns extends APIResource {
115
114
  *
116
115
  * @example
117
116
  * ```ts
118
- * const campaigns = await client.profiles.campaigns.list(
119
- * '770e8400-e29b-41d4-a716-446655440002',
120
- * );
117
+ * const apiResponseOfListOfBrandCampaign =
118
+ * await client.profiles.campaigns.list(
119
+ * '770e8400-e29b-41d4-a716-446655440002',
120
+ * );
121
121
  * ```
122
122
  */
123
123
  list(
124
124
  profileID: string,
125
125
  params: CampaignListParams | null | undefined = {},
126
126
  options?: RequestOptions,
127
- ): APIPromise<CampaignListResponse> {
127
+ ): APIPromise<APIResponseOfListOfBrandCampaign> {
128
128
  const { 'x-profile-id': xProfileID } = params ?? {};
129
129
  return this._client.get(path`/v3/profiles/${profileID}/campaigns`, {
130
130
  ...options,
@@ -163,11 +163,11 @@ export class Campaigns extends APIResource {
163
163
  /**
164
164
  * Standard API response envelope for all v3 endpoints
165
165
  */
166
- export interface APIResponseOfTcrCampaignWithUseCases {
166
+ export interface APIResponseOfBrandCampaign {
167
167
  /**
168
- * The response data (null if error)
168
+ * A 10DLC campaign registered for a brand.
169
169
  */
170
- data?: TcrCampaignWithUseCases | null;
170
+ data?: BrandCampaign | null;
171
171
 
172
172
  /**
173
173
  * Error information
@@ -185,15 +185,114 @@ export interface APIResponseOfTcrCampaignWithUseCases {
185
185
  success?: boolean;
186
186
  }
187
187
 
188
- export interface BaseDto {
188
+ /**
189
+ * Standard API response envelope for all v3 endpoints
190
+ */
191
+ export interface APIResponseOfListOfBrandCampaign {
192
+ /**
193
+ * The response data (null if error)
194
+ */
195
+ data?: Array<BrandCampaign> | null;
196
+
197
+ /**
198
+ * Error information
199
+ */
200
+ error?: WebhooksAPI.ErrorDetail | null;
201
+
189
202
  /**
190
- * Unique identifier
203
+ * Request and response metadata
191
204
  */
205
+ meta?: WebhooksAPI.APIMeta;
206
+
207
+ /**
208
+ * Indicates whether the request was successful
209
+ */
210
+ success?: boolean;
211
+ }
212
+
213
+ /**
214
+ * A 10DLC campaign registered for a brand.
215
+ */
216
+ export interface BrandCampaign {
192
217
  id?: string;
193
218
 
219
+ billedDate?: string | null;
220
+
221
+ brandId?: string | null;
222
+
223
+ cost?: number | null;
224
+
194
225
  createdAt?: string;
195
226
 
227
+ customerId?: string;
228
+
229
+ /**
230
+ * True once every carrier has completed its DCA election and the campaign is
231
+ * operationally ready for traffic.
232
+ */
233
+ dcaElectionsComplete?: boolean | null;
234
+
235
+ dcaElectionsCompletedAt?: string | null;
236
+
237
+ description?: string;
238
+
239
+ /**
240
+ * True when the one-time campaign submission fee has already been charged.
241
+ */
242
+ hasSubmissionTransaction?: boolean;
243
+
244
+ helpKeywords?: string | null;
245
+
246
+ helpMessage?: string | null;
247
+
248
+ messageFlow?: string | null;
249
+
250
+ name?: string;
251
+
252
+ optinKeywords?: string | null;
253
+
254
+ optinMessage?: string | null;
255
+
256
+ optoutKeywords?: string | null;
257
+
258
+ optoutMessage?: string | null;
259
+
260
+ privacyPolicyLink?: string | null;
261
+
262
+ status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
263
+
264
+ submittedAt?: string | null;
265
+
266
+ submittedToTCR?: boolean;
267
+
268
+ /**
269
+ * The Campaign Registry identifier, once the campaign has been accepted.
270
+ */
271
+ tcrCampaignId?: string | null;
272
+
273
+ /**
274
+ * Surfaced so customers can see why a submission did not reach the registry.
275
+ */
276
+ tcrSyncError?: string | null;
277
+
278
+ termsAndConditionsLink?: string | null;
279
+
280
+ /**
281
+ * Campaign type (for example KYC or App).
282
+ */
283
+ type?: string;
284
+
196
285
  updatedAt?: string | null;
286
+
287
+ useCases?: Array<CampaignUseCase>;
288
+
289
+ /**
290
+ * Expected messaging volume for this campaign — customer-supplied on
291
+ * create/update, and the input to both the TCR usecase classification (LOW_VOLUME
292
+ * vs MIXED/specific) and the campaign fee tier. Surfaced so customers can read
293
+ * back the value they set.
294
+ */
295
+ volume?: string | null;
197
296
  }
198
297
 
199
298
  /**
@@ -218,7 +317,7 @@ export interface CampaignData {
218
317
  /**
219
318
  * List of use cases with sample messages
220
319
  */
221
- useCases: Array<SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData>;
320
+ useCases: Array<CampaignUseCaseData>;
222
321
 
223
322
  /**
224
323
  * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
@@ -264,141 +363,70 @@ export interface CampaignData {
264
363
  * URL to terms and conditions
265
364
  */
266
365
  termsAndConditionsLink?: string | null;
267
- }
268
-
269
- export type MessagingUseCaseUs =
270
- | 'MARKETING'
271
- | 'ACCOUNT_NOTIFICATION'
272
- | 'CUSTOMER_CARE'
273
- | 'FRAUD_ALERT'
274
- | 'TWO_FA'
275
- | 'DELIVERY_NOTIFICATION'
276
- | 'SECURITY_ALERT'
277
- | 'M2M'
278
- | 'MIXED'
279
- | 'HIGHER_EDUCATION'
280
- | 'POLLING_VOTING'
281
- | 'PUBLIC_SERVICE_ANNOUNCEMENT'
282
- | 'LOW_VOLUME';
283
-
284
- /**
285
- * Campaign use case with sample messages
286
- */
287
- export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData {
288
- messagingUseCaseUs: MessagingUseCaseUs;
289
366
 
290
367
  /**
291
- * Sample messages for this use case (1-5 messages, max 1024 characters each)
368
+ * Expected messaging volume for this campaign. Numeric string (e.g. "1999",
369
+ * "5000"). Values below 2000 bill at the low-volume tier.
292
370
  */
293
- sampleMessages: Array<string>;
371
+ volume?: string | null;
294
372
  }
295
373
 
296
- export interface TcrCampaignWithUseCases extends BaseDto {
297
- description: string;
298
-
299
- name: string;
300
-
301
- type: string;
302
-
303
- billedDate?: string | null;
374
+ /**
375
+ * Customer-facing use-case representation for the public v3 campaign contract.
376
+ * Exists for the same reason as BrandCampaignV3Response: nesting the
377
+ * TcrCampaignUseCase database entity in a public response means any column added
378
+ * to that table silently becomes part of the customer-facing contract. This DTO is
379
+ * an explicit allowlist, so a new column stays invisible until it is added here on
380
+ * purpose. This mirrors exactly the fields the entity already serialized, so it
381
+ * removes nothing from the current response shape. It only closes the future-leak
382
+ * path.
383
+ */
384
+ export interface CampaignUseCase {
385
+ id?: string;
304
386
 
305
- brandId?: string | null;
387
+ campaignId?: string;
306
388
 
307
- cost?: number | null;
308
-
309
- cspId?: string | null;
389
+ createdAt?: string;
310
390
 
311
391
  customerId?: string;
312
392
 
313
- dcaElectionsComplete?: boolean | null;
314
-
315
- dcaElectionsCompletedAt?: string | null;
393
+ messagingUseCaseUs?: MessagingUseCaseUs;
316
394
 
317
395
  /**
318
- * True when this campaign already has a billing transaction of reference type
319
- * TCR_CAMPAIGN_SUBMISSION (the one-time submission fee was charged). Populated
320
- * only by the campaigns-list path; defaults false on other responses.
396
+ * Sample messages submitted to the registry for this use case.
321
397
  */
322
- hasSubmissionTransaction?: boolean;
323
-
324
- helpKeywords?: string | null;
325
-
326
- helpMessage?: string | null;
327
-
328
- kycSubmissionFormId?: string | null;
329
-
330
- messageFlow?: string | null;
331
-
332
- optinKeywords?: string | null;
333
-
334
- optinMessage?: string | null;
335
-
336
- optoutKeywords?: string | null;
337
-
338
- optoutMessage?: string | null;
339
-
340
- privacyPolicyLink?: string | null;
341
-
342
- resellerId?: string | null;
343
-
344
- sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
345
-
346
- status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
347
-
348
- submittedAt?: string | null;
349
-
350
- submittedToTCR?: boolean;
398
+ sampleMessages?: Array<string>;
351
399
 
352
- tcrCampaignId?: string | null;
353
-
354
- tcrSyncError?: string | null;
355
-
356
- telnyxCampaignId?: string | null;
357
-
358
- termsAndConditionsLink?: string | null;
359
-
360
- upstreamCnpId?: string | null;
361
-
362
- useCases?: Array<TcrCampaignWithUseCases.UseCase>;
363
- }
364
-
365
- export namespace TcrCampaignWithUseCases {
366
- export interface UseCase extends CampaignsAPI.BaseDto {
367
- sampleMessages: Array<string>;
368
-
369
- campaignId?: string;
370
-
371
- customerId?: string;
372
-
373
- messagingUseCaseUs?: CampaignsAPI.MessagingUseCaseUs;
374
- }
400
+ updatedAt?: string | null;
375
401
  }
376
402
 
377
403
  /**
378
- * Standard API response envelope for all v3 endpoints
404
+ * Campaign use case with sample messages
379
405
  */
380
- export interface CampaignListResponse {
381
- /**
382
- * The response data (null if error)
383
- */
384
- data?: Array<TcrCampaignWithUseCases> | null;
385
-
386
- /**
387
- * Error information
388
- */
389
- error?: WebhooksAPI.ErrorDetail | null;
390
-
391
- /**
392
- * Request and response metadata
393
- */
394
- meta?: WebhooksAPI.APIMeta;
406
+ export interface CampaignUseCaseData {
407
+ messagingUseCaseUs: MessagingUseCaseUs;
395
408
 
396
409
  /**
397
- * Indicates whether the request was successful
410
+ * Sample messages for this use case (1-5 messages, max 1024 characters each)
398
411
  */
399
- success?: boolean;
412
+ sampleMessages: Array<string>;
400
413
  }
401
414
 
415
+ export type MessagingUseCaseUs =
416
+ | 'MARKETING'
417
+ | 'ACCOUNT_NOTIFICATION'
418
+ | 'CUSTOMER_CARE'
419
+ | 'FRAUD_ALERT'
420
+ | 'TWO_FA'
421
+ | 'DELIVERY_NOTIFICATION'
422
+ | 'SECURITY_ALERT'
423
+ | 'M2M'
424
+ | 'MIXED'
425
+ | 'HIGHER_EDUCATION'
426
+ | 'POLLING_VOTING'
427
+ | 'PUBLIC_SERVICE_ANNOUNCEMENT'
428
+ | 'LOW_VOLUME';
429
+
402
430
  export interface CampaignCreateParams {
403
431
  /**
404
432
  * Body param: Campaign data for create or update operation
@@ -488,13 +516,13 @@ export interface CampaignDeleteParams {
488
516
 
489
517
  export declare namespace Campaigns {
490
518
  export {
491
- type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases,
492
- type BaseDto as BaseDto,
519
+ type APIResponseOfBrandCampaign as APIResponseOfBrandCampaign,
520
+ type APIResponseOfListOfBrandCampaign as APIResponseOfListOfBrandCampaign,
521
+ type BrandCampaign as BrandCampaign,
493
522
  type CampaignData as CampaignData,
523
+ type CampaignUseCase as CampaignUseCase,
524
+ type CampaignUseCaseData as CampaignUseCaseData,
494
525
  type MessagingUseCaseUs as MessagingUseCaseUs,
495
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
496
- type TcrCampaignWithUseCases as TcrCampaignWithUseCases,
497
- type CampaignListResponse as CampaignListResponse,
498
526
  type CampaignCreateParams as CampaignCreateParams,
499
527
  type CampaignUpdateParams as CampaignUpdateParams,
500
528
  type CampaignListParams as CampaignListParams,
@@ -2,13 +2,13 @@
2
2
 
3
3
  export {
4
4
  Campaigns,
5
- type APIResponseOfTcrCampaignWithUseCases,
6
- type BaseDto,
5
+ type APIResponseOfBrandCampaign,
6
+ type APIResponseOfListOfBrandCampaign,
7
+ type BrandCampaign,
7
8
  type CampaignData,
9
+ type CampaignUseCase,
10
+ type CampaignUseCaseData,
8
11
  type MessagingUseCaseUs,
9
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
10
- type TcrCampaignWithUseCases,
11
- type CampaignListResponse,
12
12
  type CampaignCreateParams,
13
13
  type CampaignUpdateParams,
14
14
  type CampaignListParams,
@@ -18,13 +18,13 @@ export {
18
18
  Profiles,
19
19
  type APIResponseOfProfileDetail,
20
20
  type BillingContactInfo,
21
+ type BrandBusinessInfo,
22
+ type BrandComplianceInfo,
23
+ type BrandContactInfo,
21
24
  type BrandsBrandData,
22
25
  type DestinationCountry,
23
26
  type PaymentDetails,
24
27
  type ProfileDetail,
25
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo,
26
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo,
27
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo,
28
28
  type TcrBrandRelationship,
29
29
  type TcrVertical,
30
30
  type ProfileListResponse,