@sentdm/sentdm 0.32.0 → 0.33.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 (80) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/client.d.mts +9 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -6
  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 +4 -3
  28. package/resources/index.d.mts.map +1 -1
  29. package/resources/index.d.ts +4 -3
  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 +5 -3
  36. package/resources/messages.d.mts.map +1 -1
  37. package/resources/messages.d.ts +5 -3
  38. package/resources/messages.d.ts.map +1 -1
  39. package/resources/messages.js +4 -1
  40. package/resources/messages.js.map +1 -1
  41. package/resources/messages.mjs +4 -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 +138 -135
  56. package/resources/profiles/profiles.d.mts.map +1 -1
  57. package/resources/profiles/profiles.d.ts +138 -135
  58. package/resources/profiles/profiles.d.ts.map +1 -1
  59. package/resources/profiles/profiles.js +30 -18
  60. package/resources/profiles/profiles.js.map +1 -1
  61. package/resources/profiles/profiles.mjs +30 -18
  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/src/client.ts +41 -18
  68. package/src/resources/contacts.ts +96 -0
  69. package/src/resources/conversations.ts +238 -0
  70. package/src/resources/index.ts +19 -9
  71. package/src/resources/messages.ts +5 -3
  72. package/src/resources/profiles/campaigns.ts +160 -132
  73. package/src/resources/profiles/index.ts +8 -8
  74. package/src/resources/profiles/profiles.ts +172 -171
  75. package/src/resources/templates.ts +105 -105
  76. package/src/version.ts +1 -1
  77. package/version.d.mts +1 -1
  78. package/version.d.ts +1 -1
  79. package/version.js +1 -1
  80. package/version.mjs +1 -1
@@ -5,18 +5,18 @@ import * as ProfilesAPI from './profiles';
5
5
  import * as WebhooksAPI from '../webhooks';
6
6
  import * as CampaignsAPI from './campaigns';
7
7
  import {
8
- APIResponseOfTcrCampaignWithUseCases,
9
- BaseDto,
8
+ APIResponseOfBrandCampaign,
9
+ APIResponseOfListOfBrandCampaign,
10
+ BrandCampaign,
10
11
  CampaignCreateParams,
11
12
  CampaignData,
12
13
  CampaignDeleteParams,
13
14
  CampaignListParams,
14
- CampaignListResponse,
15
15
  CampaignUpdateParams,
16
+ CampaignUseCase,
17
+ CampaignUseCaseData,
16
18
  Campaigns,
17
19
  MessagingUseCaseUs,
18
- SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
19
- TcrCampaignWithUseCases,
20
20
  } from './campaigns';
21
21
  import { APIPromise } from '../../core/api-promise';
22
22
  import { buildHeaders } from '../../internal/headers';
@@ -206,24 +206,36 @@ export class Profiles extends APIResource {
206
206
  }
207
207
 
208
208
  /**
209
- * Final step in profile compliance workflow. Validates all prerequisites (general
210
- * data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
211
- * based on configuration. The process runs in the background and calls the
212
- * provided webhook URL when finished.
209
+ * Final step in the profile compliance workflow. Validates all prerequisites (KYC,
210
+ * brand, campaigns, required documents), connects the profile to the SMS and
211
+ * WhatsApp channels, and sets its status based on configuration. Prerequisites are
212
+ * always validated first: if any fail the call returns 400. If they pass and the
213
+ * profile is already completed, the call returns 200 and does nothing. Otherwise
214
+ * it returns 202 and calls the provided webhook URL when background processing
215
+ * finishes.
213
216
  *
214
- * Prerequisites:
215
- * - Profile must be completed
216
- * - If inheritTcrBrand=false: Profile must have existing brand
217
- * - If inheritTcrBrand=true: Parent must have existing brand
218
- * - If TCR application: Must have at least one campaign (own or inherited)
219
- * - If inheritTcrCampaign=false: Profile should have campaigns
220
- * - If inheritTcrCampaign=true: Parent must have campaigns
217
+ * Prerequisites:
221
218
  *
222
- * Status Logic:
223
- * - If both SMS and WhatsApp channels are missing → SUBMITTED
224
- * - If TCR application and not inheriting brand/campaigns → SUBMITTED
225
- * - If non-TCR with destination country (IsMain=true) → SUBMITTED
226
- * - Otherwise → COMPLETED
219
+ * - Profile must have a name, short name, and description (short name max 50
220
+ * characters, description max 5000)
221
+ * - webHookUrl must be supplied on the request
222
+ * - A KYC form submission is required
223
+ * - A brand is required, either on the profile or inherited from the parent
224
+ * organization
225
+ * - TCR applications must have at least one campaign, own or inherited
226
+ * - Destination countries marked as main must have their required compliance
227
+ * documents uploaded
228
+ *
229
+ * Resulting status:
230
+ *
231
+ * - If either the SMS or WhatsApp channel is unconfigured, the profile is
232
+ * SUBMITTED
233
+ * - For a TCR application that inherits both its brand and its campaigns, the
234
+ * profile is COMPLETED
235
+ * - For a TCR application that owns either its brand or its campaigns, the profile
236
+ * is COMPLETED once both have been submitted to TCR, and SUBMITTED until then
237
+ * - For a non-TCR application, the profile is SUBMITTED when a main destination
238
+ * country is set, and COMPLETED otherwise
227
239
  *
228
240
  * @example
229
241
  * ```ts
@@ -308,6 +320,132 @@ export interface BillingContactInfo {
308
320
  phone?: string | null;
309
321
  }
310
322
 
323
+ /**
324
+ * Business details and address for brand KYC
325
+ */
326
+ export interface BrandBusinessInfo {
327
+ /**
328
+ * City
329
+ */
330
+ city?: string | null;
331
+
332
+ /**
333
+ * Country code (e.g., US, CA)
334
+ */
335
+ country?: string | null;
336
+
337
+ /**
338
+ * Country where the business is registered
339
+ */
340
+ countryOfRegistration?: string | null;
341
+
342
+ entityType?: 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'SOLE_PROPRIETOR' | 'GOVERNMENT' | null;
343
+
344
+ /**
345
+ * Legal business name
346
+ */
347
+ legalName?: string | null;
348
+
349
+ /**
350
+ * Postal/ZIP code
351
+ */
352
+ postalCode?: string | null;
353
+
354
+ /**
355
+ * State/province code
356
+ */
357
+ state?: string | null;
358
+
359
+ /**
360
+ * Street address
361
+ */
362
+ street?: string | null;
363
+
364
+ /**
365
+ * Tax ID/EIN number
366
+ */
367
+ taxId?: string | null;
368
+
369
+ /**
370
+ * Type of tax ID (e.g., us_ein, ca_bn)
371
+ */
372
+ taxIdType?: string | null;
373
+
374
+ /**
375
+ * Business website URL
376
+ */
377
+ url?: string | null;
378
+ }
379
+
380
+ /**
381
+ * Compliance and TCR information for brand registration
382
+ */
383
+ export interface BrandComplianceInfo {
384
+ brandRelationship: TcrBrandRelationship;
385
+
386
+ vertical: TcrVertical;
387
+
388
+ /**
389
+ * List of destination countries for messaging
390
+ */
391
+ destinationCountries?: Array<DestinationCountry> | null;
392
+
393
+ /**
394
+ * Whether this is a TCR (Campaign Registry) application
395
+ */
396
+ isTcrApplication?: boolean | null;
397
+
398
+ /**
399
+ * Additional notes about the business or use case
400
+ */
401
+ notes?: string | null;
402
+
403
+ /**
404
+ * Phone number prefix for messaging (e.g., "+1")
405
+ */
406
+ phoneNumberPrefix?: string | null;
407
+
408
+ /**
409
+ * Primary messaging use case description
410
+ */
411
+ primaryUseCase?: string | null;
412
+ }
413
+
414
+ /**
415
+ * Contact information for brand KYC
416
+ */
417
+ export interface BrandContactInfo {
418
+ /**
419
+ * Primary contact name (required)
420
+ */
421
+ name: string;
422
+
423
+ /**
424
+ * Business/brand name
425
+ */
426
+ businessName?: string | null;
427
+
428
+ /**
429
+ * Contact email address
430
+ */
431
+ email?: string | null;
432
+
433
+ /**
434
+ * Contact phone number in E.164 format
435
+ */
436
+ phone?: string | null;
437
+
438
+ /**
439
+ * Contact phone country code (e.g., "1" for US)
440
+ */
441
+ phoneCountryCode?: string | null;
442
+
443
+ /**
444
+ * Contact's role in the business
445
+ */
446
+ role?: string | null;
447
+ }
448
+
311
449
  /**
312
450
  * Brand and KYC data grouped into contact, business, and compliance sections
313
451
  */
@@ -315,17 +453,17 @@ export interface BrandsBrandData {
315
453
  /**
316
454
  * Compliance and TCR information for brand registration
317
455
  */
318
- compliance: SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo;
456
+ compliance: BrandComplianceInfo;
319
457
 
320
458
  /**
321
459
  * Contact information for brand KYC
322
460
  */
323
- contact: SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo;
461
+ contact: BrandContactInfo;
324
462
 
325
463
  /**
326
464
  * Business details and address for brand KYC
327
465
  */
328
- business?: SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo | null;
466
+ business?: BrandBusinessInfo | null;
329
467
  }
330
468
 
331
469
  export interface DestinationCountry {
@@ -457,7 +595,7 @@ export interface ProfileDetail {
457
595
  sending_phone_number?: string | null;
458
596
 
459
597
  /**
460
- * Reference to another profile for SMS/Telnyx configuration
598
+ * Reference to another profile whose SMS configuration this profile uses
461
599
  */
462
600
  sending_phone_number_profile_id?: string | null;
463
601
 
@@ -650,11 +788,6 @@ export namespace ProfileDetail {
650
788
  */
651
789
  destination_countries?: Array<ProfilesAPI.DestinationCountry>;
652
790
 
653
- /**
654
- * Expected daily messaging volume
655
- */
656
- expected_messaging_volume?: string | null;
657
-
658
791
  /**
659
792
  * Whether this is a TCR (Campaign Registry) application
660
793
  */
@@ -715,137 +848,6 @@ export namespace ProfileDetail {
715
848
  }
716
849
  }
717
850
 
718
- /**
719
- * Business details and address for brand KYC
720
- */
721
- export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo {
722
- /**
723
- * City
724
- */
725
- city?: string | null;
726
-
727
- /**
728
- * Country code (e.g., US, CA)
729
- */
730
- country?: string | null;
731
-
732
- /**
733
- * Country where the business is registered
734
- */
735
- countryOfRegistration?: string | null;
736
-
737
- entityType?: 'PRIVATE_PROFIT' | 'PUBLIC_PROFIT' | 'NON_PROFIT' | 'SOLE_PROPRIETOR' | 'GOVERNMENT' | null;
738
-
739
- /**
740
- * Legal business name
741
- */
742
- legalName?: string | null;
743
-
744
- /**
745
- * Postal/ZIP code
746
- */
747
- postalCode?: string | null;
748
-
749
- /**
750
- * State/province code
751
- */
752
- state?: string | null;
753
-
754
- /**
755
- * Street address
756
- */
757
- street?: string | null;
758
-
759
- /**
760
- * Tax ID/EIN number
761
- */
762
- taxId?: string | null;
763
-
764
- /**
765
- * Type of tax ID (e.g., us_ein, ca_bn)
766
- */
767
- taxIdType?: string | null;
768
-
769
- /**
770
- * Business website URL
771
- */
772
- url?: string | null;
773
- }
774
-
775
- /**
776
- * Compliance and TCR information for brand registration
777
- */
778
- export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo {
779
- brandRelationship: TcrBrandRelationship;
780
-
781
- vertical: TcrVertical;
782
-
783
- /**
784
- * List of destination countries for messaging
785
- */
786
- destinationCountries?: Array<DestinationCountry> | null;
787
-
788
- /**
789
- * Expected daily messaging volume
790
- */
791
- expectedMessagingVolume?: string | null;
792
-
793
- /**
794
- * Whether this is a TCR (Campaign Registry) application
795
- */
796
- isTcrApplication?: boolean | null;
797
-
798
- /**
799
- * Additional notes about the business or use case
800
- */
801
- notes?: string | null;
802
-
803
- /**
804
- * Phone number prefix for messaging (e.g., "+1")
805
- */
806
- phoneNumberPrefix?: string | null;
807
-
808
- /**
809
- * Primary messaging use case description
810
- */
811
- primaryUseCase?: string | null;
812
- }
813
-
814
- /**
815
- * Contact information for brand KYC
816
- */
817
- export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo {
818
- /**
819
- * Primary contact name (required)
820
- */
821
- name: string;
822
-
823
- /**
824
- * Business/brand name
825
- */
826
- businessName?: string | null;
827
-
828
- /**
829
- * Contact email address
830
- */
831
- email?: string | null;
832
-
833
- /**
834
- * Contact phone number in E.164 format
835
- */
836
- phone?: string | null;
837
-
838
- /**
839
- * Contact phone country code (e.g., "1" for US)
840
- */
841
- phoneCountryCode?: string | null;
842
-
843
- /**
844
- * Contact's role in the business
845
- */
846
- role?: string | null;
847
- }
848
-
849
851
  export type TcrBrandRelationship =
850
852
  | 'BASIC_ACCOUNT'
851
853
  | 'MEDIUM_ACCOUNT'
@@ -1212,8 +1214,7 @@ export interface ProfileUpdateParams {
1212
1214
  sending_phone_number?: string | null;
1213
1215
 
1214
1216
  /**
1215
- * Body param: Reference to another profile to use for SMS/Telnyx configuration
1216
- * (optional)
1217
+ * Body param: Reference to another profile to use for SMS configuration (optional)
1217
1218
  */
1218
1219
  sending_phone_number_profile_id?: string | null;
1219
1220
 
@@ -1307,13 +1308,13 @@ export declare namespace Profiles {
1307
1308
  export {
1308
1309
  type APIResponseOfProfileDetail as APIResponseOfProfileDetail,
1309
1310
  type BillingContactInfo as BillingContactInfo,
1311
+ type BrandBusinessInfo as BrandBusinessInfo,
1312
+ type BrandComplianceInfo as BrandComplianceInfo,
1313
+ type BrandContactInfo as BrandContactInfo,
1310
1314
  type BrandsBrandData as BrandsBrandData,
1311
1315
  type DestinationCountry as DestinationCountry,
1312
1316
  type PaymentDetails as PaymentDetails,
1313
1317
  type ProfileDetail as ProfileDetail,
1314
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo as SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandBusinessInfo,
1315
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo as SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandComplianceInfo,
1316
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo as SentDmServicesEndpointsCustomerApIv3ContractsRequestsBrandsBrandContactInfo,
1317
1318
  type TcrBrandRelationship as TcrBrandRelationship,
1318
1319
  type TcrVertical as TcrVertical,
1319
1320
  type ProfileListResponse as ProfileListResponse,
@@ -1328,13 +1329,13 @@ export declare namespace Profiles {
1328
1329
 
1329
1330
  export {
1330
1331
  Campaigns as Campaigns,
1331
- type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases,
1332
- type BaseDto as BaseDto,
1332
+ type APIResponseOfBrandCampaign as APIResponseOfBrandCampaign,
1333
+ type APIResponseOfListOfBrandCampaign as APIResponseOfListOfBrandCampaign,
1334
+ type BrandCampaign as BrandCampaign,
1333
1335
  type CampaignData as CampaignData,
1336
+ type CampaignUseCase as CampaignUseCase,
1337
+ type CampaignUseCaseData as CampaignUseCaseData,
1334
1338
  type MessagingUseCaseUs as MessagingUseCaseUs,
1335
- type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData,
1336
- type TcrCampaignWithUseCases as TcrCampaignWithUseCases,
1337
- type CampaignListResponse as CampaignListResponse,
1338
1339
  type CampaignCreateParams as CampaignCreateParams,
1339
1340
  type CampaignUpdateParams as CampaignUpdateParams,
1340
1341
  type CampaignListParams as CampaignListParams,