@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.
Files changed (161) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +71 -34
  3. package/client.d.mts +49 -21
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +49 -21
  6. package/client.d.ts.map +1 -1
  7. package/client.js +59 -38
  8. package/client.js.map +1 -1
  9. package/client.mjs +59 -38
  10. package/client.mjs.map +1 -1
  11. package/internal/tslib.js +17 -17
  12. package/internal/utils/log.d.mts.map +1 -1
  13. package/internal/utils/log.d.ts.map +1 -1
  14. package/internal/utils/log.js +0 -1
  15. package/internal/utils/log.js.map +1 -1
  16. package/internal/utils/log.mjs +0 -1
  17. package/internal/utils/log.mjs.map +1 -1
  18. package/internal/utils/query.d.mts +5 -0
  19. package/internal/utils/query.d.mts.map +1 -0
  20. package/internal/utils/query.d.ts +5 -0
  21. package/internal/utils/query.d.ts.map +1 -0
  22. package/internal/utils/query.js +23 -0
  23. package/internal/utils/query.js.map +1 -0
  24. package/internal/utils/query.mjs +20 -0
  25. package/internal/utils/query.mjs.map +1 -0
  26. package/internal/utils.d.mts +1 -0
  27. package/internal/utils.d.ts +1 -0
  28. package/internal/utils.js +1 -0
  29. package/internal/utils.js.map +1 -1
  30. package/internal/utils.mjs +1 -0
  31. package/package.json +7 -1
  32. package/resources/contacts.d.mts +243 -49
  33. package/resources/contacts.d.mts.map +1 -1
  34. package/resources/contacts.d.ts +243 -49
  35. package/resources/contacts.d.ts.map +1 -1
  36. package/resources/contacts.js +112 -15
  37. package/resources/contacts.js.map +1 -1
  38. package/resources/contacts.mjs +112 -15
  39. package/resources/contacts.mjs.map +1 -1
  40. package/resources/index.d.mts +8 -4
  41. package/resources/index.d.mts.map +1 -1
  42. package/resources/index.d.ts +8 -4
  43. package/resources/index.d.ts.map +1 -1
  44. package/resources/index.js +11 -3
  45. package/resources/index.js.map +1 -1
  46. package/resources/index.mjs +5 -1
  47. package/resources/index.mjs.map +1 -1
  48. package/resources/me.d.mts +269 -0
  49. package/resources/me.d.mts.map +1 -0
  50. package/resources/me.d.ts +269 -0
  51. package/resources/me.d.ts.map +1 -0
  52. package/resources/me.js +40 -0
  53. package/resources/me.js.map +1 -0
  54. package/resources/me.mjs +36 -0
  55. package/resources/me.mjs.map +1 -0
  56. package/resources/messages.d.mts +239 -133
  57. package/resources/messages.d.mts.map +1 -1
  58. package/resources/messages.d.ts +239 -133
  59. package/resources/messages.d.ts.map +1 -1
  60. package/resources/messages.js +42 -50
  61. package/resources/messages.js.map +1 -1
  62. package/resources/messages.mjs +42 -50
  63. package/resources/messages.mjs.map +1 -1
  64. package/resources/numbers.d.mts +70 -0
  65. package/resources/numbers.d.mts.map +1 -0
  66. package/resources/numbers.d.ts +70 -0
  67. package/resources/numbers.d.ts.map +1 -0
  68. package/resources/numbers.js +36 -0
  69. package/resources/numbers.js.map +1 -0
  70. package/resources/numbers.mjs +32 -0
  71. package/resources/numbers.mjs.map +1 -0
  72. package/resources/profiles/campaigns.d.mts +339 -0
  73. package/resources/profiles/campaigns.d.mts.map +1 -0
  74. package/resources/profiles/campaigns.d.ts +339 -0
  75. package/resources/profiles/campaigns.d.ts.map +1 -0
  76. package/resources/profiles/campaigns.js +148 -0
  77. package/resources/profiles/campaigns.js.map +1 -0
  78. package/resources/profiles/campaigns.mjs +144 -0
  79. package/resources/profiles/campaigns.mjs.map +1 -0
  80. package/resources/profiles/index.d.mts +3 -0
  81. package/resources/profiles/index.d.mts.map +1 -0
  82. package/resources/profiles/index.d.ts +3 -0
  83. package/resources/profiles/index.d.ts.map +1 -0
  84. package/resources/profiles/index.js +9 -0
  85. package/resources/profiles/index.js.map +1 -0
  86. package/resources/profiles/index.mjs +4 -0
  87. package/resources/profiles/index.mjs.map +1 -0
  88. package/resources/profiles/profiles.d.mts +967 -0
  89. package/resources/profiles/profiles.d.mts.map +1 -0
  90. package/resources/profiles/profiles.d.ts +967 -0
  91. package/resources/profiles/profiles.d.ts.map +1 -0
  92. package/resources/profiles/profiles.js +227 -0
  93. package/resources/profiles/profiles.js.map +1 -0
  94. package/resources/profiles/profiles.mjs +222 -0
  95. package/resources/profiles/profiles.mjs.map +1 -0
  96. package/resources/profiles.d.mts +2 -0
  97. package/resources/profiles.d.mts.map +1 -0
  98. package/resources/profiles.d.ts +2 -0
  99. package/resources/profiles.d.ts.map +1 -0
  100. package/resources/profiles.js +6 -0
  101. package/resources/profiles.js.map +1 -0
  102. package/resources/profiles.mjs +3 -0
  103. package/resources/profiles.mjs.map +1 -0
  104. package/resources/templates.d.mts +327 -191
  105. package/resources/templates.d.mts.map +1 -1
  106. package/resources/templates.d.ts +327 -191
  107. package/resources/templates.d.ts.map +1 -1
  108. package/resources/templates.js +80 -35
  109. package/resources/templates.js.map +1 -1
  110. package/resources/templates.mjs +80 -35
  111. package/resources/templates.mjs.map +1 -1
  112. package/resources/users.d.mts +251 -0
  113. package/resources/users.d.mts.map +1 -0
  114. package/resources/users.d.ts +251 -0
  115. package/resources/users.d.ts.map +1 -0
  116. package/resources/users.js +124 -0
  117. package/resources/users.js.map +1 -0
  118. package/resources/users.mjs +120 -0
  119. package/resources/users.mjs.map +1 -0
  120. package/resources/webhooks.d.mts +639 -0
  121. package/resources/webhooks.d.mts.map +1 -0
  122. package/resources/webhooks.d.ts +639 -0
  123. package/resources/webhooks.d.ts.map +1 -0
  124. package/resources/webhooks.js +237 -0
  125. package/resources/webhooks.js.map +1 -0
  126. package/resources/webhooks.mjs +233 -0
  127. package/resources/webhooks.mjs.map +1 -0
  128. package/src/client.ts +235 -79
  129. package/src/internal/utils/log.ts +0 -1
  130. package/src/internal/utils/query.ts +23 -0
  131. package/src/internal/utils.ts +1 -0
  132. package/src/resources/contacts.ts +335 -57
  133. package/src/resources/index.ts +81 -12
  134. package/src/resources/me.ts +333 -0
  135. package/src/resources/messages.ts +306 -147
  136. package/src/resources/numbers.ts +102 -0
  137. package/src/resources/profiles/campaigns.ts +501 -0
  138. package/src/resources/profiles/index.ts +38 -0
  139. package/src/resources/profiles/profiles.ts +1302 -0
  140. package/src/resources/profiles.ts +3 -0
  141. package/src/resources/templates.ts +424 -202
  142. package/src/resources/users.ts +366 -0
  143. package/src/resources/webhooks.ts +923 -0
  144. package/src/version.ts +1 -1
  145. package/version.d.mts +1 -1
  146. package/version.d.mts.map +1 -1
  147. package/version.d.ts +1 -1
  148. package/version.d.ts.map +1 -1
  149. package/version.js +1 -1
  150. package/version.js.map +1 -1
  151. package/version.mjs +1 -1
  152. package/version.mjs.map +1 -1
  153. package/resources/number-lookup.d.mts +0 -59
  154. package/resources/number-lookup.d.mts.map +0 -1
  155. package/resources/number-lookup.d.ts +0 -59
  156. package/resources/number-lookup.d.ts.map +0 -1
  157. package/resources/number-lookup.js +0 -17
  158. package/resources/number-lookup.js.map +0 -1
  159. package/resources/number-lookup.mjs +0 -13
  160. package/resources/number-lookup.mjs.map +0 -1
  161. package/src/resources/number-lookup.ts +0 -80
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/resources/profiles/profiles.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,WAAW;OAChB,KAAK,WAAW;OAChB,KAAK,YAAY;OACjB,EACL,oCAAoC,EACpC,OAAO,EACP,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,iFAAiF,EACjF,uBAAuB,EACxB;OACM,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC,SAAS,EAAE,YAAY,CAAC,SAAS,CAA4C;IAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;IACH,MAAM,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAA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AC7C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,4EAA4E,IAAI,4EAA4E,EACjK,KAAK,8EAA8E,IAAI,8EAA8E,EACrK,KAAK,2EAA2E,IAAI,2EAA2E,EAC/J,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,SAAS,IAAI,SAAS,EACtB,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,OAAO,IAAI,OAAO,EACvB,KAAK,YAAY,IAAI,YAAY,EACjC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,iFAAiF,IAAI,iFAAiF,EAC3K,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Profiles = void 0;
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
+ const CampaignsAPI = tslib_1.__importStar(require("./campaigns.js"));
8
+ const campaigns_1 = require("./campaigns.js");
9
+ const headers_1 = require("../../internal/headers.js");
10
+ const path_1 = require("../../internal/utils/path.js");
11
+ /**
12
+ * Manage organization profiles
13
+ */
14
+ class Profiles extends resource_1.APIResource {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.campaigns = new CampaignsAPI.Campaigns(this._client);
18
+ }
19
+ /**
20
+ * Creates a new sender profile within an organization. Profiles represent
21
+ * different brands, departments, or use cases, each with their own messaging
22
+ * configuration and settings. Requires admin role in the organization.
23
+ *
24
+ * ## WhatsApp Business Account
25
+ *
26
+ * Every profile must be linked to a WhatsApp Business Account. There are two ways
27
+ * to do this:
28
+ *
29
+ * **1. Inherit from organization (default)** — Omit the
30
+ * `whatsapp_business_account` field. The profile will share the organization's
31
+ * WhatsApp Business Account, which must have been set up via WhatsApp Embedded
32
+ * Signup. This is the recommended path for most use cases.
33
+ *
34
+ * **2. Direct credentials** — Provide a `whatsapp_business_account` object with
35
+ * `waba_id`, `phone_number_id`, and `access_token`. Use this when the profile
36
+ * needs its own independent WhatsApp Business Account. Obtain these from Meta
37
+ * Business Manager by creating a System User with `whatsapp_business_messaging`
38
+ * and `whatsapp_business_management` permissions.
39
+ *
40
+ * If the `whatsapp_business_account` field is omitted and the organization has no
41
+ * WhatsApp Business Account configured, the request will be rejected with
42
+ * HTTP 422.
43
+ *
44
+ * ## Brand
45
+ *
46
+ * Include the optional `brand` field to create the brand for this profile at the
47
+ * same time. Cannot be used when `inherit_tcr_brand` is `true`.
48
+ *
49
+ * ## Payment Details
50
+ *
51
+ * When `billing_model` is `"profile"` or `"profile_and_organization"` you may
52
+ * include a `payment_details` object containing the card number, expiry (MM/YY),
53
+ * CVC, and billing ZIP code. Payment details are **never stored** on our servers
54
+ * and are forwarded directly to the payment processor. Providing `payment_details`
55
+ * when `billing_model` is `"organization"` is not allowed.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const apiResponseOfProfileDetail =
60
+ * await client.profiles.create();
61
+ * ```
62
+ */
63
+ create(params, options) {
64
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
65
+ return this._client.post('/v3/profiles', {
66
+ body,
67
+ ...options,
68
+ headers: (0, headers_1.buildHeaders)([
69
+ {
70
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
71
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
72
+ },
73
+ options?.headers,
74
+ ]),
75
+ });
76
+ }
77
+ /**
78
+ * Retrieves detailed information about a specific sender profile within an
79
+ * organization, including brand and KYC information if a brand has been
80
+ * configured.
81
+ *
82
+ * @example
83
+ * ```ts
84
+ * const apiResponseOfProfileDetail =
85
+ * await client.profiles.retrieve('profileId');
86
+ * ```
87
+ */
88
+ retrieve(profileID, params = {}, options) {
89
+ const { 'x-profile-id': xProfileID } = params ?? {};
90
+ return this._client.get((0, path_1.path) `/v3/profiles/${profileID}`, {
91
+ ...options,
92
+ headers: (0, headers_1.buildHeaders)([
93
+ { ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
94
+ options?.headers,
95
+ ]),
96
+ });
97
+ }
98
+ /**
99
+ * Updates a profile's configuration and settings. Requires admin role in the
100
+ * organization. Only provided fields will be updated (partial update).
101
+ *
102
+ * ## Brand Management
103
+ *
104
+ * Include the optional `brand` field to create or update the brand associated with
105
+ * this profile. The brand holds KYC and TCR compliance data (legal business info,
106
+ * contact details, messaging vertical). Once a brand has been submitted to TCR it
107
+ * cannot be modified. Setting `inherit_tcr_brand: true` and providing `brand` in
108
+ * the same request is not allowed.
109
+ *
110
+ * ## Payment Details
111
+ *
112
+ * When `billing_model` is `"profile"` or `"profile_and_organization"` you may
113
+ * include a `payment_details` object containing the card number, expiry (MM/YY),
114
+ * CVC, and billing ZIP code. Payment details are **never stored** on our servers
115
+ * and are forwarded directly to the payment processor. Providing `payment_details`
116
+ * when `billing_model` is `"organization"` is not allowed.
117
+ *
118
+ * @example
119
+ * ```ts
120
+ * const apiResponseOfProfileDetail =
121
+ * await client.profiles.update('profileId');
122
+ * ```
123
+ */
124
+ update(profileID, params, options) {
125
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
126
+ return this._client.patch((0, path_1.path) `/v3/profiles/${profileID}`, {
127
+ body,
128
+ ...options,
129
+ headers: (0, headers_1.buildHeaders)([
130
+ {
131
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
132
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
133
+ },
134
+ options?.headers,
135
+ ]),
136
+ });
137
+ }
138
+ /**
139
+ * Retrieves all sender profiles within an organization, including brand
140
+ * information for each profile. Profiles represent different brands, departments,
141
+ * or use cases within an organization, each with their own messaging
142
+ * configuration.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * const profiles = await client.profiles.list();
147
+ * ```
148
+ */
149
+ list(params = {}, options) {
150
+ const { 'x-profile-id': xProfileID } = params ?? {};
151
+ return this._client.get('/v3/profiles', {
152
+ ...options,
153
+ headers: (0, headers_1.buildHeaders)([
154
+ { ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
155
+ options?.headers,
156
+ ]),
157
+ });
158
+ }
159
+ /**
160
+ * Soft deletes a sender profile. The profile will be marked as deleted but data is
161
+ * retained. Requires admin role in the organization.
162
+ *
163
+ * @example
164
+ * ```ts
165
+ * await client.profiles.delete('profileId', { body: {} });
166
+ * ```
167
+ */
168
+ delete(profileID, params, options) {
169
+ const { body, 'x-profile-id': xProfileID } = params;
170
+ return this._client.delete((0, path_1.path) `/v3/profiles/${profileID}`, {
171
+ body: body,
172
+ ...options,
173
+ headers: (0, headers_1.buildHeaders)([
174
+ { Accept: '*/*', ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
175
+ options?.headers,
176
+ ]),
177
+ });
178
+ }
179
+ /**
180
+ * Final step in profile compliance workflow. Validates all prerequisites (general
181
+ * data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
182
+ * based on configuration. The process runs in the background and calls the
183
+ * provided webhook URL when finished.
184
+ *
185
+ * Prerequisites:
186
+ * - Profile must be completed
187
+ * - If inheritTcrBrand=false: Profile must have existing brand
188
+ * - If inheritTcrBrand=true: Parent must have existing brand
189
+ * - If TCR application: Must have at least one campaign (own or inherited)
190
+ * - If inheritTcrCampaign=false: Profile should have campaigns
191
+ * - If inheritTcrCampaign=true: Parent must have campaigns
192
+ *
193
+ * Status Logic:
194
+ * - If both SMS and WhatsApp channels are missing → SUBMITTED
195
+ * - If TCR application and not inheriting brand/campaigns → SUBMITTED
196
+ * - If non-TCR with destination country (IsMain=true) → SUBMITTED
197
+ * - Otherwise → COMPLETED
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * const response = await client.profiles.complete(
202
+ * '660e8400-e29b-41d4-a716-446655440000',
203
+ * {
204
+ * webHookUrl:
205
+ * 'https://your-app.com/webhook/profile-complete',
206
+ * },
207
+ * );
208
+ * ```
209
+ */
210
+ complete(profileID, params, options) {
211
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
212
+ return this._client.post((0, path_1.path) `/v3/profiles/${profileID}/complete`, {
213
+ body,
214
+ ...options,
215
+ headers: (0, headers_1.buildHeaders)([
216
+ {
217
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
218
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
219
+ },
220
+ options?.headers,
221
+ ]),
222
+ });
223
+ }
224
+ }
225
+ exports.Profiles = Profiles;
226
+ Profiles.Campaigns = campaigns_1.Campaigns;
227
+ //# sourceMappingURL=profiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/resources/profiles/profiles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAGlD,qEAA4C;AAC5C,8CAaqB;AAErB,uDAAsD;AAE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222 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import * as CampaignsAPI from "./campaigns.mjs";
4
+ import { Campaigns, } from "./campaigns.mjs";
5
+ import { buildHeaders } from "../../internal/headers.mjs";
6
+ import { path } from "../../internal/utils/path.mjs";
7
+ /**
8
+ * Manage organization profiles
9
+ */
10
+ export class Profiles extends APIResource {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.campaigns = new CampaignsAPI.Campaigns(this._client);
14
+ }
15
+ /**
16
+ * Creates a new sender profile within an organization. Profiles represent
17
+ * different brands, departments, or use cases, each with their own messaging
18
+ * configuration and settings. Requires admin role in the organization.
19
+ *
20
+ * ## WhatsApp Business Account
21
+ *
22
+ * Every profile must be linked to a WhatsApp Business Account. There are two ways
23
+ * to do this:
24
+ *
25
+ * **1. Inherit from organization (default)** — Omit the
26
+ * `whatsapp_business_account` field. The profile will share the organization's
27
+ * WhatsApp Business Account, which must have been set up via WhatsApp Embedded
28
+ * Signup. This is the recommended path for most use cases.
29
+ *
30
+ * **2. Direct credentials** — Provide a `whatsapp_business_account` object with
31
+ * `waba_id`, `phone_number_id`, and `access_token`. Use this when the profile
32
+ * needs its own independent WhatsApp Business Account. Obtain these from Meta
33
+ * Business Manager by creating a System User with `whatsapp_business_messaging`
34
+ * and `whatsapp_business_management` permissions.
35
+ *
36
+ * If the `whatsapp_business_account` field is omitted and the organization has no
37
+ * WhatsApp Business Account configured, the request will be rejected with
38
+ * HTTP 422.
39
+ *
40
+ * ## Brand
41
+ *
42
+ * Include the optional `brand` field to create the brand for this profile at the
43
+ * same time. Cannot be used when `inherit_tcr_brand` is `true`.
44
+ *
45
+ * ## Payment Details
46
+ *
47
+ * When `billing_model` is `"profile"` or `"profile_and_organization"` you may
48
+ * include a `payment_details` object containing the card number, expiry (MM/YY),
49
+ * CVC, and billing ZIP code. Payment details are **never stored** on our servers
50
+ * and are forwarded directly to the payment processor. Providing `payment_details`
51
+ * when `billing_model` is `"organization"` is not allowed.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const apiResponseOfProfileDetail =
56
+ * await client.profiles.create();
57
+ * ```
58
+ */
59
+ create(params, options) {
60
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
61
+ return this._client.post('/v3/profiles', {
62
+ body,
63
+ ...options,
64
+ headers: buildHeaders([
65
+ {
66
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
67
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
68
+ },
69
+ options?.headers,
70
+ ]),
71
+ });
72
+ }
73
+ /**
74
+ * Retrieves detailed information about a specific sender profile within an
75
+ * organization, including brand and KYC information if a brand has been
76
+ * configured.
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const apiResponseOfProfileDetail =
81
+ * await client.profiles.retrieve('profileId');
82
+ * ```
83
+ */
84
+ retrieve(profileID, params = {}, options) {
85
+ const { 'x-profile-id': xProfileID } = params ?? {};
86
+ return this._client.get(path `/v3/profiles/${profileID}`, {
87
+ ...options,
88
+ headers: buildHeaders([
89
+ { ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
90
+ options?.headers,
91
+ ]),
92
+ });
93
+ }
94
+ /**
95
+ * Updates a profile's configuration and settings. Requires admin role in the
96
+ * organization. Only provided fields will be updated (partial update).
97
+ *
98
+ * ## Brand Management
99
+ *
100
+ * Include the optional `brand` field to create or update the brand associated with
101
+ * this profile. The brand holds KYC and TCR compliance data (legal business info,
102
+ * contact details, messaging vertical). Once a brand has been submitted to TCR it
103
+ * cannot be modified. Setting `inherit_tcr_brand: true` and providing `brand` in
104
+ * the same request is not allowed.
105
+ *
106
+ * ## Payment Details
107
+ *
108
+ * When `billing_model` is `"profile"` or `"profile_and_organization"` you may
109
+ * include a `payment_details` object containing the card number, expiry (MM/YY),
110
+ * CVC, and billing ZIP code. Payment details are **never stored** on our servers
111
+ * and are forwarded directly to the payment processor. Providing `payment_details`
112
+ * when `billing_model` is `"organization"` is not allowed.
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * const apiResponseOfProfileDetail =
117
+ * await client.profiles.update('profileId');
118
+ * ```
119
+ */
120
+ update(profileID, params, options) {
121
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
122
+ return this._client.patch(path `/v3/profiles/${profileID}`, {
123
+ body,
124
+ ...options,
125
+ headers: buildHeaders([
126
+ {
127
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
128
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
129
+ },
130
+ options?.headers,
131
+ ]),
132
+ });
133
+ }
134
+ /**
135
+ * Retrieves all sender profiles within an organization, including brand
136
+ * information for each profile. Profiles represent different brands, departments,
137
+ * or use cases within an organization, each with their own messaging
138
+ * configuration.
139
+ *
140
+ * @example
141
+ * ```ts
142
+ * const profiles = await client.profiles.list();
143
+ * ```
144
+ */
145
+ list(params = {}, options) {
146
+ const { 'x-profile-id': xProfileID } = params ?? {};
147
+ return this._client.get('/v3/profiles', {
148
+ ...options,
149
+ headers: buildHeaders([
150
+ { ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
151
+ options?.headers,
152
+ ]),
153
+ });
154
+ }
155
+ /**
156
+ * Soft deletes a sender profile. The profile will be marked as deleted but data is
157
+ * retained. Requires admin role in the organization.
158
+ *
159
+ * @example
160
+ * ```ts
161
+ * await client.profiles.delete('profileId', { body: {} });
162
+ * ```
163
+ */
164
+ delete(profileID, params, options) {
165
+ const { body, 'x-profile-id': xProfileID } = params;
166
+ return this._client.delete(path `/v3/profiles/${profileID}`, {
167
+ body: body,
168
+ ...options,
169
+ headers: buildHeaders([
170
+ { Accept: '*/*', ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined) },
171
+ options?.headers,
172
+ ]),
173
+ });
174
+ }
175
+ /**
176
+ * Final step in profile compliance workflow. Validates all prerequisites (general
177
+ * data, brand, campaigns), connects profile to Telnyx/WhatsApp, and sets status
178
+ * based on configuration. The process runs in the background and calls the
179
+ * provided webhook URL when finished.
180
+ *
181
+ * Prerequisites:
182
+ * - Profile must be completed
183
+ * - If inheritTcrBrand=false: Profile must have existing brand
184
+ * - If inheritTcrBrand=true: Parent must have existing brand
185
+ * - If TCR application: Must have at least one campaign (own or inherited)
186
+ * - If inheritTcrCampaign=false: Profile should have campaigns
187
+ * - If inheritTcrCampaign=true: Parent must have campaigns
188
+ *
189
+ * Status Logic:
190
+ * - If both SMS and WhatsApp channels are missing → SUBMITTED
191
+ * - If TCR application and not inheriting brand/campaigns → SUBMITTED
192
+ * - If non-TCR with destination country (IsMain=true) → SUBMITTED
193
+ * - Otherwise → COMPLETED
194
+ *
195
+ * @example
196
+ * ```ts
197
+ * const response = await client.profiles.complete(
198
+ * '660e8400-e29b-41d4-a716-446655440000',
199
+ * {
200
+ * webHookUrl:
201
+ * 'https://your-app.com/webhook/profile-complete',
202
+ * },
203
+ * );
204
+ * ```
205
+ */
206
+ complete(profileID, params, options) {
207
+ const { 'Idempotency-Key': idempotencyKey, 'x-profile-id': xProfileID, ...body } = params;
208
+ return this._client.post(path `/v3/profiles/${profileID}/complete`, {
209
+ body,
210
+ ...options,
211
+ headers: buildHeaders([
212
+ {
213
+ ...(idempotencyKey != null ? { 'Idempotency-Key': idempotencyKey } : undefined),
214
+ ...(xProfileID != null ? { 'x-profile-id': xProfileID } : undefined),
215
+ },
216
+ options?.headers,
217
+ ]),
218
+ });
219
+ }
220
+ }
221
+ Profiles.Campaigns = Campaigns;
222
+ //# sourceMappingURL=profiles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.mjs","sourceRoot":"","sources":["../../src/resources/profiles/profiles.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,YAAY;OACjB,EASL,SAAS,GAIV;OAEM,EAAE,YAAY,EAAE;OAEhB,EAAE,I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 {"version":3,"file":"profiles.d.mts","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from "./profiles/index.js";
2
+ //# sourceMappingURL=profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("../internal/tslib.js");
5
+ tslib_1.__exportStar(require("./profiles/index.js"), exports);
6
+ //# sourceMappingURL=profiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAAiC"}
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from "./profiles/index.mjs";
3
+ //# sourceMappingURL=profiles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.mjs","sourceRoot":"","sources":["../src/resources/profiles.ts"],"names":[],"mappings":"AAAA,sFAAsF"}