@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,339 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as CampaignsAPI from "./campaigns.mjs";
3
+ import * as WebhooksAPI from "../webhooks.mjs";
4
+ import { APIPromise } from "../../core/api-promise.mjs";
5
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
+ /**
7
+ * Manage organization profiles
8
+ */
9
+ export declare class Campaigns extends APIResource {
10
+ /**
11
+ * Creates a new campaign scoped under the brand of the specified profile. Each
12
+ * campaign must include at least one use case with sample messages.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const apiResponseOfTcrCampaignWithUseCases =
17
+ * await client.profiles.campaigns.create(
18
+ * '770e8400-e29b-41d4-a716-446655440002',
19
+ * {
20
+ * campaign: {
21
+ * description:
22
+ * 'Appointment reminders and account notifications',
23
+ * name: 'Customer Notifications',
24
+ * type: 'App',
25
+ * useCases: [
26
+ * {
27
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
28
+ * sampleMessages: [
29
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
30
+ * 'Your order #{order_id} has been shipped. Track at {url}',
31
+ * ],
32
+ * },
33
+ * ],
34
+ * },
35
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ create(profileID: string, params: CampaignCreateParams, options?: RequestOptions): APIPromise<APIResponseOfTcrCampaignWithUseCases>;
40
+ /**
41
+ * Updates an existing campaign under the brand of the specified profile. Cannot
42
+ * update campaigns that have already been submitted to TCR.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const apiResponseOfTcrCampaignWithUseCases =
47
+ * await client.profiles.campaigns.update(
48
+ * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
49
+ * {
50
+ * profileId: '770e8400-e29b-41d4-a716-446655440002',
51
+ * campaign: {
52
+ * description:
53
+ * 'Updated appointment reminders and account notifications',
54
+ * name: 'Customer Notifications Updated',
55
+ * type: 'App',
56
+ * useCases: [
57
+ * {
58
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
59
+ * sampleMessages: [
60
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
61
+ * 'Your order #{order_id} has been shipped. Track at {url}',
62
+ * ],
63
+ * },
64
+ * ],
65
+ * },
66
+ * },
67
+ * );
68
+ * ```
69
+ */
70
+ update(campaignID: string, params: CampaignUpdateParams, options?: RequestOptions): APIPromise<APIResponseOfTcrCampaignWithUseCases>;
71
+ /**
72
+ * Retrieves all campaigns linked to the profile's brand, including use cases and
73
+ * sample messages. Returns inherited campaigns if inherit_tcr_campaign=true.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const campaigns = await client.profiles.campaigns.list(
78
+ * '770e8400-e29b-41d4-a716-446655440002',
79
+ * );
80
+ * ```
81
+ */
82
+ list(profileID: string, params?: CampaignListParams | null | undefined, options?: RequestOptions): APIPromise<CampaignListResponse>;
83
+ /**
84
+ * Deletes a campaign by ID from the brand of the specified profile. The profile
85
+ * must belong to the authenticated organization.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * await client.profiles.campaigns.delete(
90
+ * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
91
+ * {
92
+ * profileId: '770e8400-e29b-41d4-a716-446655440002',
93
+ * body: {},
94
+ * },
95
+ * );
96
+ * ```
97
+ */
98
+ delete(campaignID: string, params: CampaignDeleteParams, options?: RequestOptions): APIPromise<void>;
99
+ }
100
+ /**
101
+ * Standard API response envelope for all v3 endpoints
102
+ */
103
+ export interface APIResponseOfTcrCampaignWithUseCases {
104
+ /**
105
+ * The response data (null if error)
106
+ */
107
+ data?: TcrCampaignWithUseCases | null;
108
+ /**
109
+ * Error information
110
+ */
111
+ error?: WebhooksAPI.ErrorDetail | null;
112
+ /**
113
+ * Request and response metadata
114
+ */
115
+ meta?: WebhooksAPI.APIMeta;
116
+ /**
117
+ * Indicates whether the request was successful
118
+ */
119
+ success?: boolean;
120
+ }
121
+ export interface BaseDto {
122
+ /**
123
+ * Unique identifier
124
+ */
125
+ id?: string;
126
+ createdAt?: string;
127
+ updatedAt?: string | null;
128
+ }
129
+ /**
130
+ * Campaign data for create or update operation
131
+ */
132
+ export interface CampaignData {
133
+ /**
134
+ * Campaign description
135
+ */
136
+ description: string;
137
+ /**
138
+ * Campaign name
139
+ */
140
+ name: string;
141
+ /**
142
+ * Campaign type (e.g., "KYC", "App")
143
+ */
144
+ type: string;
145
+ /**
146
+ * List of use cases with sample messages
147
+ */
148
+ useCases: Array<SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData>;
149
+ /**
150
+ * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
151
+ */
152
+ helpKeywords?: string | null;
153
+ /**
154
+ * Message sent when user requests help
155
+ */
156
+ helpMessage?: string | null;
157
+ /**
158
+ * Description of how messages flow in the campaign
159
+ */
160
+ messageFlow?: string | null;
161
+ /**
162
+ * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
163
+ */
164
+ optinKeywords?: string | null;
165
+ /**
166
+ * Message sent when user opts in
167
+ */
168
+ optinMessage?: string | null;
169
+ /**
170
+ * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
171
+ */
172
+ optoutKeywords?: string | null;
173
+ /**
174
+ * Message sent when user opts out
175
+ */
176
+ optoutMessage?: string | null;
177
+ /**
178
+ * URL to privacy policy
179
+ */
180
+ privacyPolicyLink?: string | null;
181
+ /**
182
+ * URL to terms and conditions
183
+ */
184
+ termsAndConditionsLink?: string | null;
185
+ }
186
+ export type MessagingUseCaseUs = 'MARKETING' | 'ACCOUNT_NOTIFICATION' | 'CUSTOMER_CARE' | 'FRAUD_ALERT' | 'TWO_FA' | 'DELIVERY_NOTIFICATION' | 'SECURITY_ALERT' | 'M2M' | 'MIXED' | 'HIGHER_EDUCATION' | 'POLLING_VOTING' | 'PUBLIC_SERVICE_ANNOUNCEMENT' | 'LOW_VOLUME';
187
+ /**
188
+ * Campaign use case with sample messages
189
+ */
190
+ export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData {
191
+ messagingUseCaseUs: MessagingUseCaseUs;
192
+ /**
193
+ * Sample messages for this use case (1-5 messages, max 1024 characters each)
194
+ */
195
+ sampleMessages: Array<string>;
196
+ }
197
+ export interface TcrCampaignWithUseCases extends BaseDto {
198
+ billedDate?: string | null;
199
+ brandId?: string | null;
200
+ cost?: number | null;
201
+ cspId?: string | null;
202
+ customerId?: string;
203
+ description?: string;
204
+ helpKeywords?: string | null;
205
+ helpMessage?: string | null;
206
+ kycSubmissionFormId?: string | null;
207
+ messageFlow?: string | null;
208
+ name?: string;
209
+ optinKeywords?: string | null;
210
+ optinMessage?: string | null;
211
+ optoutKeywords?: string | null;
212
+ optoutMessage?: string | null;
213
+ privacyPolicyLink?: string | null;
214
+ resellerId?: string | null;
215
+ sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
216
+ status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
217
+ submittedAt?: string | null;
218
+ submittedToTCR?: boolean;
219
+ tcrCampaignId?: string | null;
220
+ tcrSyncError?: string | null;
221
+ telnyxCampaignId?: string | null;
222
+ termsAndConditionsLink?: string | null;
223
+ type?: string;
224
+ upstreamCnpId?: string | null;
225
+ useCases?: Array<TcrCampaignWithUseCases.UseCase>;
226
+ }
227
+ export declare namespace TcrCampaignWithUseCases {
228
+ interface UseCase extends CampaignsAPI.BaseDto {
229
+ campaignId?: string;
230
+ customerId?: string;
231
+ messagingUseCaseUs?: CampaignsAPI.MessagingUseCaseUs;
232
+ sampleMessages?: Array<string>;
233
+ }
234
+ }
235
+ /**
236
+ * Standard API response envelope for all v3 endpoints
237
+ */
238
+ export interface CampaignListResponse {
239
+ /**
240
+ * The response data (null if error)
241
+ */
242
+ data?: Array<TcrCampaignWithUseCases> | null;
243
+ /**
244
+ * Error information
245
+ */
246
+ error?: WebhooksAPI.ErrorDetail | null;
247
+ /**
248
+ * Request and response metadata
249
+ */
250
+ meta?: WebhooksAPI.APIMeta;
251
+ /**
252
+ * Indicates whether the request was successful
253
+ */
254
+ success?: boolean;
255
+ }
256
+ export interface CampaignCreateParams {
257
+ /**
258
+ * Body param: Campaign data for create or update operation
259
+ */
260
+ campaign: CampaignData;
261
+ /**
262
+ * Body param: Sandbox flag - when true, the operation is simulated without side
263
+ * effects Useful for testing integrations without actual execution
264
+ */
265
+ sandbox?: boolean;
266
+ /**
267
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
268
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
269
+ * hours per key per customer.
270
+ */
271
+ 'Idempotency-Key'?: string;
272
+ /**
273
+ * Header param: Profile UUID to scope the request to a child profile. Only
274
+ * organization API keys can use this header. The profile must belong to the
275
+ * calling organization.
276
+ */
277
+ 'x-profile-id'?: string;
278
+ }
279
+ export interface CampaignUpdateParams {
280
+ /**
281
+ * Path param: Profile ID from route
282
+ */
283
+ profileId: string;
284
+ /**
285
+ * Body param: Campaign data for create or update operation
286
+ */
287
+ campaign: CampaignData;
288
+ /**
289
+ * Body param: Sandbox flag - when true, the operation is simulated without side
290
+ * effects Useful for testing integrations without actual execution
291
+ */
292
+ sandbox?: boolean;
293
+ /**
294
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
295
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
296
+ * hours per key per customer.
297
+ */
298
+ 'Idempotency-Key'?: string;
299
+ /**
300
+ * Header param: Profile UUID to scope the request to a child profile. Only
301
+ * organization API keys can use this header. The profile must belong to the
302
+ * calling organization.
303
+ */
304
+ 'x-profile-id'?: string;
305
+ }
306
+ export interface CampaignListParams {
307
+ /**
308
+ * Profile UUID to scope the request to a child profile. Only organization API keys
309
+ * can use this header. The profile must belong to the calling organization.
310
+ */
311
+ 'x-profile-id'?: string;
312
+ }
313
+ export interface CampaignDeleteParams {
314
+ /**
315
+ * Path param: Profile ID from route parameter
316
+ */
317
+ profileId: string;
318
+ /**
319
+ * Body param: Request to delete a campaign from a brand
320
+ */
321
+ body: CampaignDeleteParams.Body;
322
+ /**
323
+ * Header param: Profile UUID to scope the request to a child profile. Only
324
+ * organization API keys can use this header. The profile must belong to the
325
+ * calling organization.
326
+ */
327
+ 'x-profile-id'?: string;
328
+ }
329
+ export declare namespace CampaignDeleteParams {
330
+ /**
331
+ * Request to delete a campaign from a brand
332
+ */
333
+ interface Body extends WebhooksAPI.MutationRequest {
334
+ }
335
+ }
336
+ export declare namespace Campaigns {
337
+ export { type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases, type BaseDto as BaseDto, type CampaignData as CampaignData, type MessagingUseCaseUs as MessagingUseCaseUs, type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData, type TcrCampaignWithUseCases as TcrCampaignWithUseCases, type CampaignListResponse as CampaignListResponse, type CampaignCreateParams as CampaignCreateParams, type CampaignUpdateParams as CampaignUpdateParams, type CampaignListParams as CampaignListParams, type CampaignDeleteParams as CampaignDeleteParams, };
338
+ }
339
+ //# sourceMappingURL=campaigns.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"campaigns.d.mts","sourceRoot":"","sources":["../../src/resources/profiles/campaigns.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,YAAY;OACjB,KAAK,WAAW;OAChB,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oCAAoC,CAAC;IAenD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oCAAoC,CAAC;IAenD;;;;;;;;;;OAUG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EAClD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAWnC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;CAWrG;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD;;OAEG;IACH,IAAI,CAAC,EAAE,uBAAuB,GAAG,IAAI,CAAC;IAEtC;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC,WAAW,GAAG,IAAI,CAAC;IAEvC;;OAEG;IACH,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CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAC;IAEvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC;IAEhC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yBAAiB,oBAAoB,CAAC;IACpC;;OAEG;IACH,UAAiB,IAAK,SAAQ,WAAW,CAAC,eAAe;KAAG;CAC7D;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,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,339 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as CampaignsAPI from "./campaigns.js";
3
+ import * as WebhooksAPI from "../webhooks.js";
4
+ import { APIPromise } from "../../core/api-promise.js";
5
+ import { RequestOptions } from "../../internal/request-options.js";
6
+ /**
7
+ * Manage organization profiles
8
+ */
9
+ export declare class Campaigns extends APIResource {
10
+ /**
11
+ * Creates a new campaign scoped under the brand of the specified profile. Each
12
+ * campaign must include at least one use case with sample messages.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const apiResponseOfTcrCampaignWithUseCases =
17
+ * await client.profiles.campaigns.create(
18
+ * '770e8400-e29b-41d4-a716-446655440002',
19
+ * {
20
+ * campaign: {
21
+ * description:
22
+ * 'Appointment reminders and account notifications',
23
+ * name: 'Customer Notifications',
24
+ * type: 'App',
25
+ * useCases: [
26
+ * {
27
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
28
+ * sampleMessages: [
29
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
30
+ * 'Your order #{order_id} has been shipped. Track at {url}',
31
+ * ],
32
+ * },
33
+ * ],
34
+ * },
35
+ * },
36
+ * );
37
+ * ```
38
+ */
39
+ create(profileID: string, params: CampaignCreateParams, options?: RequestOptions): APIPromise<APIResponseOfTcrCampaignWithUseCases>;
40
+ /**
41
+ * Updates an existing campaign under the brand of the specified profile. Cannot
42
+ * update campaigns that have already been submitted to TCR.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const apiResponseOfTcrCampaignWithUseCases =
47
+ * await client.profiles.campaigns.update(
48
+ * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
49
+ * {
50
+ * profileId: '770e8400-e29b-41d4-a716-446655440002',
51
+ * campaign: {
52
+ * description:
53
+ * 'Updated appointment reminders and account notifications',
54
+ * name: 'Customer Notifications Updated',
55
+ * type: 'App',
56
+ * useCases: [
57
+ * {
58
+ * messagingUseCaseUs: 'ACCOUNT_NOTIFICATION',
59
+ * sampleMessages: [
60
+ * 'Hi {name}, your appointment is confirmed for {date} at {time}.',
61
+ * 'Your order #{order_id} has been shipped. Track at {url}',
62
+ * ],
63
+ * },
64
+ * ],
65
+ * },
66
+ * },
67
+ * );
68
+ * ```
69
+ */
70
+ update(campaignID: string, params: CampaignUpdateParams, options?: RequestOptions): APIPromise<APIResponseOfTcrCampaignWithUseCases>;
71
+ /**
72
+ * Retrieves all campaigns linked to the profile's brand, including use cases and
73
+ * sample messages. Returns inherited campaigns if inherit_tcr_campaign=true.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * const campaigns = await client.profiles.campaigns.list(
78
+ * '770e8400-e29b-41d4-a716-446655440002',
79
+ * );
80
+ * ```
81
+ */
82
+ list(profileID: string, params?: CampaignListParams | null | undefined, options?: RequestOptions): APIPromise<CampaignListResponse>;
83
+ /**
84
+ * Deletes a campaign by ID from the brand of the specified profile. The profile
85
+ * must belong to the authenticated organization.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * await client.profiles.campaigns.delete(
90
+ * 'b2c3d4e5-f6a7-8901-bcde-f12345678901',
91
+ * {
92
+ * profileId: '770e8400-e29b-41d4-a716-446655440002',
93
+ * body: {},
94
+ * },
95
+ * );
96
+ * ```
97
+ */
98
+ delete(campaignID: string, params: CampaignDeleteParams, options?: RequestOptions): APIPromise<void>;
99
+ }
100
+ /**
101
+ * Standard API response envelope for all v3 endpoints
102
+ */
103
+ export interface APIResponseOfTcrCampaignWithUseCases {
104
+ /**
105
+ * The response data (null if error)
106
+ */
107
+ data?: TcrCampaignWithUseCases | null;
108
+ /**
109
+ * Error information
110
+ */
111
+ error?: WebhooksAPI.ErrorDetail | null;
112
+ /**
113
+ * Request and response metadata
114
+ */
115
+ meta?: WebhooksAPI.APIMeta;
116
+ /**
117
+ * Indicates whether the request was successful
118
+ */
119
+ success?: boolean;
120
+ }
121
+ export interface BaseDto {
122
+ /**
123
+ * Unique identifier
124
+ */
125
+ id?: string;
126
+ createdAt?: string;
127
+ updatedAt?: string | null;
128
+ }
129
+ /**
130
+ * Campaign data for create or update operation
131
+ */
132
+ export interface CampaignData {
133
+ /**
134
+ * Campaign description
135
+ */
136
+ description: string;
137
+ /**
138
+ * Campaign name
139
+ */
140
+ name: string;
141
+ /**
142
+ * Campaign type (e.g., "KYC", "App")
143
+ */
144
+ type: string;
145
+ /**
146
+ * List of use cases with sample messages
147
+ */
148
+ useCases: Array<SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData>;
149
+ /**
150
+ * Comma-separated keywords that trigger help message (e.g., "HELP, INFO, SUPPORT")
151
+ */
152
+ helpKeywords?: string | null;
153
+ /**
154
+ * Message sent when user requests help
155
+ */
156
+ helpMessage?: string | null;
157
+ /**
158
+ * Description of how messages flow in the campaign
159
+ */
160
+ messageFlow?: string | null;
161
+ /**
162
+ * Comma-separated keywords that trigger opt-in (e.g., "YES, START, SUBSCRIBE")
163
+ */
164
+ optinKeywords?: string | null;
165
+ /**
166
+ * Message sent when user opts in
167
+ */
168
+ optinMessage?: string | null;
169
+ /**
170
+ * Comma-separated keywords that trigger opt-out (e.g., "STOP, UNSUBSCRIBE, END")
171
+ */
172
+ optoutKeywords?: string | null;
173
+ /**
174
+ * Message sent when user opts out
175
+ */
176
+ optoutMessage?: string | null;
177
+ /**
178
+ * URL to privacy policy
179
+ */
180
+ privacyPolicyLink?: string | null;
181
+ /**
182
+ * URL to terms and conditions
183
+ */
184
+ termsAndConditionsLink?: string | null;
185
+ }
186
+ export type MessagingUseCaseUs = 'MARKETING' | 'ACCOUNT_NOTIFICATION' | 'CUSTOMER_CARE' | 'FRAUD_ALERT' | 'TWO_FA' | 'DELIVERY_NOTIFICATION' | 'SECURITY_ALERT' | 'M2M' | 'MIXED' | 'HIGHER_EDUCATION' | 'POLLING_VOTING' | 'PUBLIC_SERVICE_ANNOUNCEMENT' | 'LOW_VOLUME';
187
+ /**
188
+ * Campaign use case with sample messages
189
+ */
190
+ export interface SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData {
191
+ messagingUseCaseUs: MessagingUseCaseUs;
192
+ /**
193
+ * Sample messages for this use case (1-5 messages, max 1024 characters each)
194
+ */
195
+ sampleMessages: Array<string>;
196
+ }
197
+ export interface TcrCampaignWithUseCases extends BaseDto {
198
+ billedDate?: string | null;
199
+ brandId?: string | null;
200
+ cost?: number | null;
201
+ cspId?: string | null;
202
+ customerId?: string;
203
+ description?: string;
204
+ helpKeywords?: string | null;
205
+ helpMessage?: string | null;
206
+ kycSubmissionFormId?: string | null;
207
+ messageFlow?: string | null;
208
+ name?: string;
209
+ optinKeywords?: string | null;
210
+ optinMessage?: string | null;
211
+ optoutKeywords?: string | null;
212
+ optoutMessage?: string | null;
213
+ privacyPolicyLink?: string | null;
214
+ resellerId?: string | null;
215
+ sharingStatus?: 'PENDING' | 'ACCEPTED' | 'DECLINED' | null;
216
+ status?: 'SENT_CREATED' | 'ACTIVE' | 'EXPIRED' | null;
217
+ submittedAt?: string | null;
218
+ submittedToTCR?: boolean;
219
+ tcrCampaignId?: string | null;
220
+ tcrSyncError?: string | null;
221
+ telnyxCampaignId?: string | null;
222
+ termsAndConditionsLink?: string | null;
223
+ type?: string;
224
+ upstreamCnpId?: string | null;
225
+ useCases?: Array<TcrCampaignWithUseCases.UseCase>;
226
+ }
227
+ export declare namespace TcrCampaignWithUseCases {
228
+ interface UseCase extends CampaignsAPI.BaseDto {
229
+ campaignId?: string;
230
+ customerId?: string;
231
+ messagingUseCaseUs?: CampaignsAPI.MessagingUseCaseUs;
232
+ sampleMessages?: Array<string>;
233
+ }
234
+ }
235
+ /**
236
+ * Standard API response envelope for all v3 endpoints
237
+ */
238
+ export interface CampaignListResponse {
239
+ /**
240
+ * The response data (null if error)
241
+ */
242
+ data?: Array<TcrCampaignWithUseCases> | null;
243
+ /**
244
+ * Error information
245
+ */
246
+ error?: WebhooksAPI.ErrorDetail | null;
247
+ /**
248
+ * Request and response metadata
249
+ */
250
+ meta?: WebhooksAPI.APIMeta;
251
+ /**
252
+ * Indicates whether the request was successful
253
+ */
254
+ success?: boolean;
255
+ }
256
+ export interface CampaignCreateParams {
257
+ /**
258
+ * Body param: Campaign data for create or update operation
259
+ */
260
+ campaign: CampaignData;
261
+ /**
262
+ * Body param: Sandbox flag - when true, the operation is simulated without side
263
+ * effects Useful for testing integrations without actual execution
264
+ */
265
+ sandbox?: boolean;
266
+ /**
267
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
268
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
269
+ * hours per key per customer.
270
+ */
271
+ 'Idempotency-Key'?: string;
272
+ /**
273
+ * Header param: Profile UUID to scope the request to a child profile. Only
274
+ * organization API keys can use this header. The profile must belong to the
275
+ * calling organization.
276
+ */
277
+ 'x-profile-id'?: string;
278
+ }
279
+ export interface CampaignUpdateParams {
280
+ /**
281
+ * Path param: Profile ID from route
282
+ */
283
+ profileId: string;
284
+ /**
285
+ * Body param: Campaign data for create or update operation
286
+ */
287
+ campaign: CampaignData;
288
+ /**
289
+ * Body param: Sandbox flag - when true, the operation is simulated without side
290
+ * effects Useful for testing integrations without actual execution
291
+ */
292
+ sandbox?: boolean;
293
+ /**
294
+ * Header param: Unique key to ensure idempotent request processing. Must be 1-255
295
+ * alphanumeric characters, hyphens, or underscores. Responses are cached for 24
296
+ * hours per key per customer.
297
+ */
298
+ 'Idempotency-Key'?: string;
299
+ /**
300
+ * Header param: Profile UUID to scope the request to a child profile. Only
301
+ * organization API keys can use this header. The profile must belong to the
302
+ * calling organization.
303
+ */
304
+ 'x-profile-id'?: string;
305
+ }
306
+ export interface CampaignListParams {
307
+ /**
308
+ * Profile UUID to scope the request to a child profile. Only organization API keys
309
+ * can use this header. The profile must belong to the calling organization.
310
+ */
311
+ 'x-profile-id'?: string;
312
+ }
313
+ export interface CampaignDeleteParams {
314
+ /**
315
+ * Path param: Profile ID from route parameter
316
+ */
317
+ profileId: string;
318
+ /**
319
+ * Body param: Request to delete a campaign from a brand
320
+ */
321
+ body: CampaignDeleteParams.Body;
322
+ /**
323
+ * Header param: Profile UUID to scope the request to a child profile. Only
324
+ * organization API keys can use this header. The profile must belong to the
325
+ * calling organization.
326
+ */
327
+ 'x-profile-id'?: string;
328
+ }
329
+ export declare namespace CampaignDeleteParams {
330
+ /**
331
+ * Request to delete a campaign from a brand
332
+ */
333
+ interface Body extends WebhooksAPI.MutationRequest {
334
+ }
335
+ }
336
+ export declare namespace Campaigns {
337
+ export { type APIResponseOfTcrCampaignWithUseCases as APIResponseOfTcrCampaignWithUseCases, type BaseDto as BaseDto, type CampaignData as CampaignData, type MessagingUseCaseUs as MessagingUseCaseUs, type SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData as SentDmServicesEndpointsCustomerApIv3ContractsRequestsCampaignsCampaignUseCaseData, type TcrCampaignWithUseCases as TcrCampaignWithUseCases, type CampaignListResponse as CampaignListResponse, type CampaignCreateParams as CampaignCreateParams, type CampaignUpdateParams as CampaignUpdateParams, type CampaignListParams as CampaignListParams, type CampaignDeleteParams as CampaignDeleteParams, };
338
+ }
339
+ //# sourceMappingURL=campaigns.d.ts.map