@signalhousellc/sdk 1.5.1 → 1.7.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 (54) hide show
  1. package/README.md +5 -56
  2. package/index.d.ts +1 -0
  3. package/index.js +2 -0
  4. package/package.json +32 -34
  5. package/voice-browser.d.ts +1 -0
  6. package/voice-browser.js +2 -0
  7. package/warn.js +7 -0
  8. package/webhooks.d.ts +1 -0
  9. package/webhooks.js +2 -0
  10. package/scripts/install-skills.mjs +0 -329
  11. package/skills/VENDORED.json +0 -22
  12. package/skills/signalhouse-10dlc/SKILL.md +0 -172
  13. package/skills/signalhouse-10dlc/examples/brightsmile-onboarding.md +0 -62
  14. package/skills/signalhouse-10dlc/references/tcr-rejection-causes.md +0 -104
  15. package/skills/signalhouse-advisor/SKILL.md +0 -84
  16. package/skills/signalhouse-numbers/SKILL.md +0 -82
  17. package/skills/signalhouse-setup/SKILL.md +0 -121
  18. package/skills/signalhouse-sms/SKILL.md +0 -81
  19. package/skills/signalhouse-webhooks/SKILL.md +0 -148
  20. package/src/SignalHouseSDK.js +0 -201
  21. package/src/domains/Agents.js +0 -987
  22. package/src/domains/Auth.js +0 -225
  23. package/src/domains/Billing.js +0 -265
  24. package/src/domains/Brands.js +0 -566
  25. package/src/domains/Campaigns.js +0 -691
  26. package/src/domains/Dnc.js +0 -168
  27. package/src/domains/Groups.js +0 -187
  28. package/src/domains/Landings.js +0 -237
  29. package/src/domains/Messages.js +0 -609
  30. package/src/domains/Notifications.js +0 -62
  31. package/src/domains/Numbers.js +0 -574
  32. package/src/domains/Onboarding.js +0 -128
  33. package/src/domains/Registrations.js +0 -246
  34. package/src/domains/Shortlinks.js +0 -80
  35. package/src/domains/Subgroups.js +0 -136
  36. package/src/domains/Subscriptions.js +0 -164
  37. package/src/domains/Templates.js +0 -403
  38. package/src/domains/Tickets.js +0 -100
  39. package/src/domains/Users.js +0 -228
  40. package/src/domains/Voice.js +0 -41
  41. package/src/domains/Webhooks.js +0 -125
  42. package/src/domains/voice/Analytics.js +0 -82
  43. package/src/domains/voice/CallLogs.js +0 -111
  44. package/src/domains/voice/Calls.js +0 -118
  45. package/src/domains/voice/GlobalVoiceSettings.js +0 -54
  46. package/src/domains/voice/NumberRoutes.js +0 -82
  47. package/src/domains/voice/ProgrammableVoiceProfiles.js +0 -191
  48. package/src/domains/voice/SipProfiles.js +0 -203
  49. package/src/domains/voice/SipTrunks.js +0 -203
  50. package/src/domains/voice/Tokens.js +0 -96
  51. package/src/domains/voice/browser/Call.js +0 -366
  52. package/src/domains/voice/browser/Device.js +0 -484
  53. package/src/domains/voice/browser/index.js +0 -17
  54. package/src/webhooks/verifySignature.js +0 -66
@@ -1,691 +0,0 @@
1
- /** @typedef {import('../SignalHouseSDK.js').RequestOptions} RequestOptions */
2
- /**
3
- * @template T
4
- * @typedef {import('../SignalHouseSDK.js').SdkResponse<T>} SdkResponse
5
- */
6
-
7
- /**
8
- * @typedef {Object} CreateCampaignData
9
- * @property {string} brandId - The ID of the brand associated with the campaign (required)
10
- * @property {string} usecase - The use case for the campaign (2FA, ACCOUNT_NOTIFICATION, AGENTS_FRANCHISES, CARRIER_EXEMPT, CHARITY, CUSTOMER_CARE, DELIVERY_NOTIFICATION, EMERGENCY, FRAUD_ALERT, HIGHER_EDUCATION, K12_EDUCATION, LOW_VOLUME, M2M, MARKETING, MIXED, POLITICAL, POLLING_VOTING, PROXY, PUBLIC_SAFETY_RESTRICTED, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, SOCIAL, SOLE_PROPRIETOR, SWEEPSTAKE, TRIAL, UCAAS_HIGH, UCAAS_LOW)
11
- * @property {Array<string>} [subUsecases] - An array of sub-use cases for the campaign (2FA, ACCOUNT_NOTIFICATION, AGENTS_FRANCHISES, CARRIER_EXEMPT, CHARITY, CUSTOMER_CARE, DELIVERY_NOTIFICATION, EMERGENCY, FRAUD_ALERT, HIGHER_EDUCATION, K12_EDUCATION, LOW_VOLUME, M2M, MARKETING, MIXED, POLITICAL, POLLING_VOTING, PROXY, PUBLIC_SAFETY_RESTRICTED, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, SOLE_PROPRIETOR, SWEEPSTAKE, TRIAL, UCAAS_HIGH, UCAAS_LOW — NOT SOCIAL, which TCR rejects as a sub-usecase for every parent usecase even though it is valid as the top-level `usecase`)
12
- * @property {string} description - A detailed description of the campaign (required, must be between 40 and 4096 characters)
13
- * @property {boolean} [embeddedLink=true] - Whether the campaign includes an embedded link (optional, defaults to true)
14
- * @property {boolean} [embeddedPhone=false] - Whether the campaign includes an embedded phone number (optional, defaults to false)
15
- * @property {boolean} [termsAndConditions=true] - Whether the campaign includes terms and conditions (optional, defaults to true)
16
- * @property {boolean} [numberPool=false] - Whether the campaign uses a number pool (optional, defaults to false)
17
- * @property {boolean} [ageGated=false] - Whether the campaign is age-gated (optional, defaults to false)
18
- * @property {boolean} [directLending=false] - Whether the campaign uses direct lending (optional, defaults to false)
19
- * @property {boolean} [subscriberOptIn=true] - Whether the campaign requires subscriber opt-in (optional, defaults to true)
20
- * @property {boolean} [subscriberOptOut=true] - Whether the campaign allows subscriber opt-out (optional, defaults to true)
21
- * @property {boolean} [subscriberHelp=true] - Whether the campaign provides subscriber help (optional, defaults to true)
22
- * @property {string} [sample1] - Sample message 1 for the campaign (optional, must be between 20 and 1024 characters if provided)
23
- * @property {string} [sample2] - Sample message 2 for the campaign (optional, must be between 20 and 1024 characters if provided)
24
- * @property {string} [sample3] - Sample message 3 for the campaign (optional, must be between 20 and 1024 characters if provided)
25
- * @property {string} [sample4] - Sample message 4 for the campaign (optional, must be between 20 and 1024 characters if provided)
26
- * @property {string} [sample5] - Sample message 5 for the campaign (optional, must be between 20 and 1024 characters if provided)
27
- * @property {string} messageFlow - A detailed description of the message flow for the campaign (required, must be between 40 and 4096 characters)
28
- * @property {string} [helpMessage] - A message providing help information for the campaign (optional)
29
- * @property {boolean} [autoRenewal=true] - Whether the campaign should auto-renew (optional, defaults to true)
30
- * @property {string} [tag] - A tag for the campaign (optional, must be at most 255 characters)
31
- * @property {string} [optinKeywords="START,SUBSCRIBE"] - A comma-separated list of keywords for opting in to the campaign (optional, defaults to "START,SUBSCRIBE", must be at most 255 characters)
32
- * @property {string} [optoutKeywords="STOP,UNSUBSCRIBE"] - A comma-separated list of keywords for opting out of the campaign (optional, defaults to "STOP,UNSUBSCRIBE", must be at most 255 characters)
33
- * @property {string} [helpKeywords="HELP"] - A comma-separated list of keywords for getting help with the campaign (optional, defaults to "HELP", must be at most 255 characters)
34
- * @property {string} [optinMessage] - A message sent to users when they opt in to the campaign (optional, must be between 20 and 1024 characters if provided)
35
- * @property {string} [optoutMessage] - A message sent to users when they opt out of the campaign (optional, must be between 20 and 1024 characters if provided)
36
- * @property {string} privacyPolicyLink - A URL linking to the privacy policy for the campaign (required, must be at most 2048 characters)
37
- * @property {string} termsAndConditionsLink - A URL linking to the terms and conditions for the campaign (required, must be at most 2048 characters)
38
- * @property {string} [embeddedLinkSample] - A sample of the embedded link used in the campaign (optional, must be at most 255 characters)
39
- * @property {string[]} [sampleMediaIds] - Up to 5 mediaIds from uploadSampleMedia: sample MMS media shown to carrier and TCR reviewers (10DLC only)
40
- * @property {Array<string>} phoneNumbers - An array of phone numbers associated with the campaign (required, each number must be at least 10 digits and contain only digits, a maximum of 5000 numbers is allowed)
41
- */
42
-
43
- /**
44
- * @typedef {Object} UpdateCampaignData
45
- * @property {string} [usecase] - The use case for the campaign (2FA, ACCOUNT_NOTIFICATION, AGENTS_FRANCHISES, CARRIER_EXEMPT, CHARITY, CUSTOMER_CARE, DELIVERY_NOTIFICATION, EMERGENCY, FRAUD_ALERT, HIGHER_EDUCATION, K12_EDUCATION, LOW_VOLUME, M2M, MARKETING, MIXED, POLITICAL, POLLING_VOTING, PROXY, PUBLIC_SAFETY_RESTRICTED, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, SOCIAL, SOLE_PROPRIETOR, SWEEPSTAKE, TRIAL, UCAAS_HIGH, UCAAS_LOW)
46
- * @property {Array<string>} [subUsecases] - An array of sub-use cases for the campaign (2FA, ACCOUNT_NOTIFICATION, AGENTS_FRANCHISES, CARRIER_EXEMPT, CHARITY, CUSTOMER_CARE, DELIVERY_NOTIFICATION, EMERGENCY, FRAUD_ALERT, HIGHER_EDUCATION, K12_EDUCATION, LOW_VOLUME, M2M, MARKETING, MIXED, POLITICAL, POLLING_VOTING, PROXY, PUBLIC_SAFETY_RESTRICTED, PUBLIC_SERVICE_ANNOUNCEMENT, SECURITY_ALERT, SOLE_PROPRIETOR, SWEEPSTAKE, TRIAL, UCAAS_HIGH, UCAAS_LOW — NOT SOCIAL, which TCR rejects as a sub-usecase for every parent usecase even though it is valid as the top-level `usecase`)
47
- * @property {string} [description] - A detailed description of the campaign (optional, must be between 40 and 4096 characters if provided)
48
- * @property {boolean} [embeddedLink] - Whether the campaign includes an embedded link (optional)
49
- * @property {boolean} [embeddedPhone] - Whether the campaign includes an embedded phone number (optional)
50
- * @property {boolean} [termsAndConditions] - Whether the campaign includes terms and conditions (optional)
51
- * @property {boolean} [numberPool] - Whether the campaign uses a number pool (optional)
52
- * @property {boolean} [ageGated] - Whether the campaign is age-gated (optional)
53
- * @property {boolean} [directLending] - Whether the campaign uses direct lending (optional)
54
- * @property {boolean} [subscriberOptIn] - Whether the campaign requires subscriber opt-in (optional)
55
- * @property {boolean} [subscriberOptOut] - Whether the campaign allows subscriber opt-out (optional)
56
- * @property {boolean} [subscriberHelp] - Whether the campaign provides subscriber help (optional)
57
- * @property {string} [sample1] - Sample message 1 for the campaign (optional, must be between 20 and 1024 characters if provided)
58
- * @property {string} [sample2] - Sample message 2 for the campaign (optional, must be between 20 and 1024 characters if provided)
59
- * @property {string} [sample3] - Sample message 3 for the campaign (optional, must be between 20 and 1024 characters if provided)
60
- * @property {string} [sample4] - Sample message 4 for the campaign (optional, must be between 20 and 1024 characters if provided)
61
- * @property {string} [sample5] - Sample message 5 for the campaign (optional, must be between 20 and 1024 characters if provided)
62
- * @property {string} [messageFlow] - A detailed description of the message flow for the campaign (optional, must be between 40 and 4096 characters if provided)
63
- * @property {string} [helpMessage] - A message providing help information for the campaign (optional)
64
- * @property {boolean} [autoRenewal] - Whether the campaign should auto-renew (optional)
65
- * @property {string} [tag] - A tag for the campaign (optional, must be at most 255 characters)
66
- * @property {string} [optinKeywords] - A comma-separated list of keywords for opting in to the campaign (optional, must be at most 255 characters)
67
- * @property {string} [optoutKeywords] - A comma-separated list of keywords for opting out of the campaign (optional, must be at most 255 characters)
68
- * @property {string} [helpKeywords] - A comma-separated list of keywords for getting help with the campaign (optional, must be at most 255 characters)
69
- * @property {string} [optinMessage] - A message sent to users when they opt in to the campaign (optional, must be between 20 and 1024 characters if provided)
70
- * @property {string} [optoutMessage] - A message sent to users when they opt out of the campaign (optional, must be between 20 and 1024 characters if provided)
71
- * @property {string} [privacyPolicyLink] - A URL linking to the privacy policy for the campaign (optional, must be at most 2048 characters if provided)
72
- * @property {string} [termsAndConditionsLink] - A URL linking to the terms and conditions for the campaign (optional, must be at most 2048 characters if provided)
73
- * @property {string} [embeddedLinkSample] - A sample of the embedded link used in the campaign (optional, must be at most 255 characters if provided)
74
- * @property {string[]} [sampleMediaIds] - Up to 5 mediaIds from uploadSampleMedia: sample MMS media shown to carrier and TCR reviewers (10DLC only)
75
- * @property {Object} [tollFree] - Toll-Free editable fields, used when updating a Toll-Free campaign. Mirrors the CreateTollFreeCampaignData `tollFree` object with every field optional (useCase, messageVolume, programSummary (40-500), exampleMessage (≤1000), customerCareEmail, optInImageURLs, optIns, multiNumberReason (≤500), useCases, channels, landingId). Phone numbers cannot be changed via update — Toll-Free numbers are locked to their campaign.
76
- */
77
-
78
- /**
79
- * @typedef {Object} TollFreeOptIn
80
- * @property {string} [callToAction] - The opt-in call-to-action text for this channel (optional, 20-1024 characters when provided)
81
- * @property {string} [url] - The opt-in web URL (web channel only, optional, at most 2048 characters)
82
- * @property {Array<string>} [keywords] - The opt-in keywords (keyword channel only, optional)
83
- */
84
-
85
- /**
86
- * @typedef {Object} TollFreeCampaignDetails
87
- * @property {string} useCase - The Toll-Free use case (required, e.g. TWO_FA, GENERAL_MARKETING, HEALTHCARE, MIXED — one of the Toll-Free use-case values)
88
- * @property {string} messageVolume - The estimated monthly message volume tier (required, one of TEN, HUNDRED, THOUSAND, TEN_THOUSAND, HUNDRED_THOUSAND, TWO_HUNDRED_FIFTY_THOUSAND, FIVE_HUNDRED_THOUSAND, SEVEN_HUNDRED_FIFTY_THOUSAND, ONE_MILLION, FIVE_MILLION, TEN_MILLION_PLUS)
89
- * @property {string} programSummary - A summary of the messaging program (required, 40-500 characters)
90
- * @property {string} exampleMessage - An example message (required, at most 1000 characters; holds one sample per use case, stored verbatim, no STOP/HELP appended by the server)
91
- * @property {string} customerCareEmail - A customer-care contact email (required, valid email)
92
- * @property {Array<string>} optInImageURLs - URLs to opt-in proof images (required, at least one, each at most 2048 characters)
93
- * @property {Object} [optIns] - Opt-in method details. Each channel is optional.
94
- * @property {TollFreeOptIn} [optIns.verbal] - Verbal opt-in details
95
- * @property {TollFreeOptIn} [optIns.web] - Online (web) opt-in details
96
- * @property {TollFreeOptIn} [optIns.keyword] - Keyword opt-in details
97
- * @property {TollFreeOptIn} [optIns.interactiveVoiceResponse] - IVR opt-in details
98
- * @property {string} [multiNumberReason] - Internally-stored reason the customer requested more than one Toll-Free number on the campaign (optional, at most 500 characters). Required when more than one phone number is assigned; captured for Signal House review only and never sent to the carrier.
99
- * @property {string[]} [useCases] - The sender's real use-case picks (optional). `useCase` above carries the single value the carrier accepts (MIXED when there is more than one); these are what a Signal House landing page renders a consent checkbox per. Carriers that need specific use cases rather than MIXED take them from here when present; other carriers never receive them.
100
- * @property {string[]} [channels] - The channels consent covers ("SMS", "MMS", "VOICE") (optional). Never forwarded to the carrier.
101
- * @property {string} [landingId] - The Signal House landing page whose consent boxes this campaign's call-to-action describes (optional). Must be an ACTIVE page owned by the same brand and group.
102
- */
103
-
104
- /**
105
- * @typedef {Object} CreateTollFreeCampaignData
106
- * @property {string} brandId - The ID of the Toll-Free brand associated with the campaign (required, at least 7 characters)
107
- * @property {TollFreeCampaignDetails} tollFree - The Toll-Free campaign details (required)
108
- * @property {string} [privacyPolicyLink] - A URL linking to the privacy policy (at most 2048 characters). Required when the brand's `tollFree.requiresPrivacyPolicy` is true and the brand has no `privacyPolicyLink` of its own; optional otherwise.
109
- * @property {string} [termsAndConditionsLink] - A URL linking to the terms and conditions (at most 2048 characters). Required when the brand's `tollFree.requiresTermsAndConditions` is true and the brand has no `termsAndConditionsLink` of its own; optional otherwise.
110
- * @property {string} [tag] - A tag for the campaign (optional, at most 255 characters)
111
- * @property {boolean} [autoRenewal=true] - Whether the campaign should auto-renew (optional, defaults to true)
112
- * @property {Array<string>} phoneNumbers - The Toll-Free numbers to assign to the campaign (required, 1 up to the brand's tollFree.maxNumbersPerCampaign and at most 5, each at least 10 digits and digits only). The numbers must be on the brand's toll-free carrier, or the campaign is refused. Numbers are locked to the campaign once assigned and cannot be moved or added afterward.
113
- */
114
-
115
- /**
116
- * @typedef {Object} ShortCodeDetails
117
- * @property {Array<string>} useCases - Selected use cases (required, at least 1; ALERTS, CHAT, DONATION, FRAUD_ALERTS, PROMOTIONAL_MARKETING, PUBLIC_SERVICE_ANNOUNCEMENT, SWEEPSTAKES_CONTEST, TWO_FACTOR_AUTHENTICATION, VOTING_POLLING, POLITICAL, EMERGENCY_NOTIFICATIONS, DELIVERY_NOTIFICATIONS, SECURITY_ALERTS)
118
- * @property {Array<string>} optInMethods - Selected opt-in methods (required, at least 1; IVR_POS, WEB, TV, PRINT, KEYWORD, VERBAL, RADIO)
119
- * @property {Object<string, string>} optInMethodDescriptions - Generated-but-editable description per selected opt-in method, keyed by the method value (each 20-2048 characters, required for every selected method)
120
- * @property {string} messageFrequency - "RECURRING" or "SINGLE" (required)
121
- * @property {string} pricingTier - "STANDARD" or "FTEU" (required)
122
- * @property {boolean} [adultContent=false] - Whether the campaign contains adult (SHAFT) content
123
- * @property {string} [doubleOptInMessage] - Required when adultContent is true (20-1024 characters)
124
- * @property {string} programSummary - Generated-but-editable campaign/program summary (required, 40-2048 characters)
125
- * @property {string} optInConfirmationMessage - The opt-in confirmation message (required, 20-1024 characters)
126
- * @property {string} optInUrl - Public HTTPS URL for the live opt-in experience, shown to reviewers as a link (required; private, local, and credentialed URLs are rejected)
127
- * @property {string} screenshotUrl - Hosted opt-in proof screenshot URL returned by `uploadOptInImage` (required). Must be a Signal House-hosted opt-in image owned by your group; external URLs are rejected
128
- */
129
-
130
- /**
131
- * @typedef {Object} CreateShortCodeCampaignData
132
- * @property {string} brandId - The ID of the approved (VERIFIED) Short Code brand (required, at least 7 characters)
133
- * @property {string} privacyPolicyLink - A URL linking to the privacy policy (required, at most 2048 characters)
134
- * @property {string} termsAndConditionsLink - A URL linking to the terms and conditions (required, at most 2048 characters)
135
- * @property {string} optinMessage - Opt-in response message (required, 20-1024 characters)
136
- * @property {string} optoutMessage - Opt-out response message (required, 20-1024 characters)
137
- * @property {string} helpMessage - HELP response message (required, 20-1024 characters)
138
- * @property {string} sample1 - Sample message 1 (required, 20-1024 characters)
139
- * @property {string} sample2 - Sample message 2 (required, 20-1024 characters)
140
- * @property {string} sample3 - Sample message 3 (required, 20-1024 characters)
141
- * @property {string} [tag] - A tag for the campaign (optional, at most 255 characters)
142
- * @property {ShortCodeDetails} shortCode - The Short Code campaign details (required)
143
- */
144
-
145
- export class Campaigns {
146
- constructor(client, multipartClient, enableAdmin) {
147
- this.client = client;
148
- this.multipartClient = multipartClient;
149
- this.enableAdmin = enableAdmin;
150
-
151
- if (enableAdmin) {
152
- this.admin = {
153
- /**
154
- * Approve a campaign that is pending approval
155
- * @async
156
- * @roles signalhouse
157
- * @param {Object} params - The parameters for approving the campaign
158
- * @param {string} params.campaignId - The ID of the campaign to approve
159
- * @param {RequestOptions} [params.options] - Additional options for the request
160
- * @throws {Error} Throws an error if the campaignId parameter is missing
161
- * @returns {Promise<SdkResponse<any>>} The response from the server
162
- */
163
- approveCampaign: async ({ campaignId, options = {} }) => {
164
- this.client._require({ campaignId });
165
- const safeCampaignId = encodeURIComponent(campaignId);
166
- return this.client(`/campaign/approve/${safeCampaignId}`, { method: 'POST', ...options });
167
- },
168
- /**
169
- * Reject a campaign that is pending approval
170
- * @async
171
- * @roles signalhouse
172
- * @param {Object} params - The parameters for rejecting the campaign
173
- * @param {string} params.campaignId - The ID of the campaign to reject
174
- * @param {RequestOptions} [params.options] - Additional options for the request (body should include { rejectionReason })
175
- * @throws {Error} Throws an error if the campaignId parameter is missing
176
- * @returns {Promise<SdkResponse<any>>} The response from the server
177
- */
178
- rejectCampaign: async ({ campaignId, options = {} }) => {
179
- this.client._require({ campaignId });
180
- const safeCampaignId = encodeURIComponent(campaignId);
181
- return this.client(`/campaign/reject/${safeCampaignId}`, { method: 'POST', ...options });
182
- },
183
- /**
184
- * Get CNP campaigns shared with Signal House
185
- * @async
186
- * @roles signalhouse
187
- * @param {Object} params - The parameters for retrieving CNP campaigns
188
- * @param {RequestOptions} [params.options] - Additional options for the request
189
- * @returns {Promise<SdkResponse<Array>>} The response from the server
190
- */
191
- getCNPCampaigns: async ({ options = {} } = {}) => {
192
- return this.client(`/campaign/cnp`, { method: 'GET', ...options });
193
- },
194
- /**
195
- * Transition a Short Code campaign's review status (SHGHL-2225). A customer-visible reason is
196
- * required for both rejection states ("REJECTED" = Signal House Rejected, "DCA_REJECTED" =
197
- * Rejected). Selecting "PENDING_DCA_APPROVAL" runs the guarded carrier-review transition;
198
- * fulfillment remains a separate staff operation.
199
- * @async
200
- * @roles signalhouse
201
- * @param {Object} params - The parameters for the status transition
202
- * @param {string} params.campaignId - The ID of the campaign to transition
203
- * @param {string} params.status - The target status: "PENDING_REVIEW", "REJECTED", "PENDING_DCA_APPROVAL", "DCA_REJECTED", or "ACTIVE". "PENDING_DCA_APPROVAL" requires a Signal House-approved Short Code brand, issued code, and captured opt-in proof.
204
- * @param {string} [params.rejectionReason] - Required, nonblank reason for "REJECTED"/"DCA_REJECTED" (max 1024 characters)
205
- * @param {RequestOptions} [params.options] - Additional options for the request
206
- * @throws {Error} Throws an error if the campaignId or status parameter is missing
207
- * @returns {Promise<SdkResponse<any>>} The updated campaign
208
- */
209
- updateShortCodeCampaignStatus: async ({ campaignId, status, rejectionReason, options = {} }) => {
210
- this.client._require({ campaignId, status });
211
- const safeCampaignId = encodeURIComponent(campaignId);
212
- return this.client(`/campaign/short-code/${safeCampaignId}/status`, {
213
- method: 'PUT',
214
- body: { status, rejectionReason },
215
- ...options,
216
- });
217
- },
218
- /**
219
- * Fulfill a campaign-bound Signal House Short Code request.
220
- * @async
221
- * @roles signalhouse
222
- * @param {Object} params - Fulfillment parameters.
223
- * @param {string} params.campaignId - Campaign identifier.
224
- * @param {string} params.actualCode - Issued five- or six-digit Short Code.
225
- * @param {string} params.leaseEndDate - Fixed future lease end date. A YYYY-MM-DD value expires at 23:59:59 UTC; timestamps retain their supplied time.
226
- * @param {string} [params.internalNotes] - Staff-only fulfillment notes.
227
- * @param {RequestOptions} [params.options] - Additional options.
228
- * @returns {Promise<SdkResponse<any>>} The updated campaign.
229
- */
230
- fulfillShortCodeCampaign: async ({ campaignId, actualCode, leaseEndDate, internalNotes, options = {} }) => {
231
- this.client._require({ campaignId, actualCode, leaseEndDate });
232
- const safeCampaignId = encodeURIComponent(campaignId);
233
- return this.client(`/campaign/short-code/${safeCampaignId}/fulfill`, {
234
- method: 'POST',
235
- body: { actualCode, leaseEndDate, internalNotes },
236
- ...options,
237
- });
238
- },
239
- /**
240
- * Submit an internally approved Short Code campaign to carrier review.
241
- * @async
242
- * @roles signalhouse
243
- * @param {Object} params - Submission parameters.
244
- * @param {string} params.campaignId - Campaign identifier.
245
- * @param {RequestOptions} [params.options] - Additional options.
246
- * @returns {Promise<SdkResponse<any>>} The updated campaign.
247
- */
248
- submitShortCodeCampaignToCarrier: async ({ campaignId, options = {} }) => {
249
- this.client._require({ campaignId });
250
- const safeCampaignId = encodeURIComponent(campaignId);
251
- return this.client(`/campaign/short-code/${safeCampaignId}/submit-to-carrier`, {
252
- method: 'POST',
253
- ...options,
254
- });
255
- },
256
- /**
257
- * Confirm Registry offboarding and complete a pending Short Code cancellation.
258
- * @async
259
- * @param {Object} params - Request parameters.
260
- * @param {string} params.campaignId - Campaign identifier.
261
- * @param {string} params.requestId - The pending cancellation request to complete.
262
- * @param {string} [params.note] - Operator note recorded with the completion.
263
- * @param {RequestOptions} [params.options] - Additional options.
264
- * @returns {Promise<SdkResponse<any>>} The updated campaign.
265
- */
266
- completeShortCodeCancellation: async ({ campaignId, requestId, note, options = {} }) => {
267
- this.client._require({ campaignId, requestId });
268
- const safeCampaignId = encodeURIComponent(campaignId);
269
- return this.client(`/campaign/short-code/${safeCampaignId}/cancellation/complete`, {
270
- method: 'POST',
271
- body: { requestId, note },
272
- ...options,
273
- });
274
- },
275
- /**
276
- * Dismiss a pending Short Code cancellation and restore its prior lifecycle state.
277
- * @async
278
- * @param {Object} params - Request parameters.
279
- * @param {string} params.campaignId - Campaign identifier.
280
- * @param {string} params.requestId - The pending cancellation request to dismiss.
281
- * @param {string} [params.note] - Operator note recorded with the dismissal.
282
- * @param {RequestOptions} [params.options] - Additional options.
283
- * @returns {Promise<SdkResponse<any>>} The updated campaign.
284
- */
285
- dismissShortCodeCancellation: async ({ campaignId, requestId, note, options = {} }) => {
286
- this.client._require({ campaignId, requestId });
287
- const safeCampaignId = encodeURIComponent(campaignId);
288
- return this.client(`/campaign/short-code/${safeCampaignId}/cancellation/dismiss`, {
289
- method: 'POST',
290
- body: { requestId, note },
291
- ...options,
292
- });
293
- },
294
- /**
295
- * Read expired Short Code leases awaiting manual Registry offboarding.
296
- * @async
297
- * @param {Object} [params] - Request parameters.
298
- * @param {number} [params.page] - Page number for pagination.
299
- * @param {number} [params.limit] - Results per page.
300
- * @param {RequestOptions} [params.options] - Additional options.
301
- * @returns {Promise<SdkResponse<any>>} The expired leases page.
302
- */
303
- getExpiredShortCodeLeases: async ({ page, limit, options = {} } = {}) => {
304
- const query = this.client._getQueryString({ page, limit });
305
- return this.client(`/campaign/short-code/expired-leases${query}`, { method: 'GET', ...options });
306
- },
307
- /**
308
- * Confirm Registry offboarding and mark an expired Short Code released.
309
- * @async
310
- * @param {Object} params - Request parameters.
311
- * @param {string} params.campaignId - Campaign identifier.
312
- * @param {string} [params.note] - Operator note recorded with the release.
313
- * @param {RequestOptions} [params.options] - Additional options.
314
- * @returns {Promise<SdkResponse<any>>} The updated campaign.
315
- */
316
- releaseExpiredShortCodeLease: async ({ campaignId, note, options = {} }) => {
317
- this.client._require({ campaignId });
318
- const safeCampaignId = encodeURIComponent(campaignId);
319
- return this.client(`/campaign/short-code/${safeCampaignId}/expired-lease/release`, {
320
- method: 'POST', body: { note }, ...options,
321
- });
322
- },
323
- };
324
- }
325
- }
326
-
327
- /**
328
- * Get a list of campaigns with optional filters
329
- * @async
330
- * @roles api, admin, developer, billing, user
331
- * @param {Object} params - The parameters for filtering the campaigns
332
- * @param {string} [params.id] - The ID of the campaign to filter by
333
- * @param {string} [params.brandId] - The ID of the brand to filter by
334
- * @param {string} [params.subgroupId] - The ID of the subgroup to filter by
335
- * @param {string} [params.groupId] - The ID of the group to filter by
336
- * @param {number} [params.page] - The page number for pagination
337
- * @param {number} [params.limit] - The number of items per page
338
- * @param {string} [params.status] - The status of the campaign to filter by
339
- * @param {string} [params.search] - Search term to filter campaigns by campaignId or brandId
340
- * @param {string} [params.sortBy] - Field to sort by (e.g. "createdAt", "campaignId", "brandId", "groupId", "subgroupId", "usecase", "status")
341
- * @param {string} [params.sortOrder] - Sort direction ("asc" or "desc")
342
- * @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
343
- * @param {RequestOptions} [params.options] - Additional options for the request
344
- *
345
- * Every record carries a `sentiment` object -- trailing 7-day and 30-day inbound reply sentiment,
346
- * refreshed periodically from analytics rather than computed per request: `{ sevenDay, thirtyDay,
347
- * updatedAt }`, each window being `{ score, label, scoredCount, positive, neutral, negative }`. The
348
- * object is always present and fully populated, so it can be read without a presence check.
349
- * `score` is a volume-weighted average in -100..100 and is null when nothing was scored in the
350
- * window, which is not the same as a score of 0 -- null means nobody replied, 0 means replies
351
- * averaged neutral. `updatedAt` is null until the first rollup writes the record, and it tracks when
352
- * the figures last CHANGED, not when the job last ran.
353
- *
354
- * Every record also carries a `health` object -- trailing 7-day and 30-day delivery/opt-out health from
355
- * the same periodic refresh: `{ sevenDay, thirtyDay, updatedAt }`, each window being `{ score,
356
- * deliveryRate, optOutRate, deliveryScore, optOutScore, messagesSent, messagesDelivered, messagesFailed,
357
- * optOuts }`. `score` is 1.0..10.0 (the mean of the two bucket scores) and is null when nothing was sent
358
- * in the window; the volumes say how much traffic sits behind it. A campaign's figure is scored from the
359
- * campaign's own summed counters, never averaged from its numbers. For a live figure use GET /number/health
360
- * or GET /campaign/health.
361
- * @returns {Promise<SdkResponse<Array|Object>>} The response from the server - array when unpaginated, or { data, total, page, limit, totalPages } when paginated
362
- */
363
- async getCampaigns({
364
- id,
365
- brandId,
366
- subgroupId,
367
- groupId,
368
- page,
369
- limit,
370
- status,
371
- search,
372
- sortBy,
373
- sortOrder,
374
- registrationType,
375
- options = {},
376
- }) {
377
- const filters = {
378
- id,
379
- brandId,
380
- subgroupId,
381
- groupId,
382
- page,
383
- limit,
384
- status,
385
- search,
386
- sortBy,
387
- sortOrder,
388
- registrationType,
389
- };
390
- const queryString = this.client._getQueryString(filters);
391
- return this.client(`/campaign${queryString}`, { method: 'GET', ...options });
392
- }
393
-
394
- /**
395
- * Get aggregated campaign health (7-day and 30-day windows) for a campaign.
396
- * @async
397
- * @roles api, admin, developer, billing, user
398
- * @param {Object} params - Parameters for reading campaign health
399
- * @param {string} params.campaignId - Campaign identifier
400
- * @param {boolean} [params.includeNumbers=false] - When true, include per-number health entries
401
- * @param {RequestOptions} [params.options] - Additional request options
402
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ campaignId, sevenDay, thirtyDay, numbers? }`
403
- */
404
- async getCampaignHealth({ campaignId, includeNumbers = false, options = {} }) {
405
- this.client._require({ campaignId });
406
- const queryString = this.client._getQueryString({ campaignId, includeNumbers });
407
- return this.client(`/campaign/health${queryString}`, { method: 'GET', ...options });
408
- }
409
-
410
- /**
411
- * Get the carrier throughput ceilings a campaign is currently sending under: the AT&T per-minute limit
412
- * (per campaign, held 10% under the published ceiling) and the T-Mobile daily cap (per brand), each with
413
- * its current tier and the next rung on the ladder, plus today's T-Mobile usage. Resolved from the same
414
- * brand status / brand score rules the send path enforces with.
415
- * @async
416
- * @roles api, admin, developer, billing, user
417
- * @param {Object} params - Parameters for reading campaign throughput limits
418
- * @param {string} params.campaignId - Campaign identifier
419
- * @param {RequestOptions} [params.options] - Additional request options
420
- * @throws {Error} Throws an error if the campaignId parameter is missing
421
- * @returns {Promise<SdkResponse<any>>} A promise that resolves to `{ campaignId, brandId, usecase, brand: { status, brandScore, entityType }, att: { tier, scope, unit, sms: { limit }, mms: { limit }, marginPercent, nextTier }, tmobile: { tier, scope, unit, dailyLimit, thresholds, nextTier, usedToday: { date, segments, resetsAt } | null } }`. A null tier/limit means the carrier ladder does not apply (unverified brand, GOVERNMENT entity, PUBLIC_SAFETY_RESTRICTED usecase); a null nextTier means the top rung or a usecase-capped (LOW_VOLUME) campaign.
422
- */
423
- async getCampaignThroughputLimits({ campaignId, options = {} }) {
424
- this.client._require({ campaignId });
425
- const queryString = this.client._getQueryString({ campaignId });
426
- return this.client(`/campaign/throughput-limits${queryString}`, { method: 'GET', ...options });
427
- }
428
-
429
- /**
430
- * Create a new campaign
431
- * @async
432
- * @roles api, admin, developer, billing, user
433
- * @param {Object} params - The parameters for creating the campaign (see CreateCampaignData typedef for details)
434
- * @param {CreateCampaignData} params.campaignData - The data for the campaign to be created (see CreateCampaignData typedef for details)
435
- * @param {RequestOptions} [params.options] - Additional options for the request
436
- * @throws {Error} Throws an error if the campaignData parameter is missing or if required fields in campaignData are missing
437
- * @returns {Promise<SdkResponse<any>>} The response from the server
438
- */
439
- async createCampaign({ campaignData, options = {} }) {
440
- this.client._require({ campaignData: campaignData });
441
- return this.client(`/campaign`, { method: 'POST', body: campaignData, ...options });
442
- }
443
-
444
- /**
445
- * Create a new Toll-Free (TFN) campaign and submit it for Signal House review
446
- * @async
447
- * @roles api, admin, developer, user
448
- * @param {Object} params - The parameters for creating the toll-free campaign
449
- * @param {CreateTollFreeCampaignData} params.campaignData - The data for the toll-free campaign to be created (see CreateTollFreeCampaignData typedef for details)
450
- * @param {RequestOptions} [params.options] - Additional options for the request
451
- * @throws {Error} Throws an error if the campaignData parameter is missing
452
- * @returns {Promise<SdkResponse<any>>} The response from the server
453
- */
454
- async createTollFreeCampaign({ campaignData, options = {} }) {
455
- this.client._require({ campaignData });
456
- return this.client(`/campaign/toll-free`, { method: 'POST', body: campaignData, ...options });
457
- }
458
-
459
- /**
460
- * Create a new Short Code campaign and submit it for Signal House review (SHGHL-2225). Requires an
461
- * approved (VERIFIED) Short Code brand. Upload the opt-in proof screenshot first with `uploadOptInImage`
462
- * and pass the returned URL as `campaignData.shortCode.screenshotUrl` (required). Request or register the
463
- * campaign's Short Code separately through `numbers.requestShortCodeAcquisition` after creation.
464
- * @async
465
- * @roles api, admin, developer, user
466
- * @param {Object} params - The parameters for creating the Short Code campaign
467
- * @param {CreateShortCodeCampaignData} params.campaignData - The Short Code campaign data (see CreateShortCodeCampaignData typedef for details)
468
- * @param {RequestOptions} [params.options] - Additional options for the request
469
- * @throws {Error} Throws an error if the campaignData parameter is missing
470
- * @returns {Promise<SdkResponse<any>>} The response from the server
471
- */
472
- async createShortCodeCampaign({ campaignData, options = {} }) {
473
- this.client._require({ campaignData });
474
- const formData = new FormData();
475
- formData.append('campaignData', JSON.stringify(campaignData));
476
- return this.multipartClient(`/campaign/short-code`, { method: 'POST', body: formData, ...options });
477
- }
478
-
479
- /**
480
- * Update a Short Code campaign's editable fields (SHGHL-2225). Only permitted while the campaign is in
481
- * Signal House Review or Signal House Rejected status; the number source cannot be changed once submitted.
482
- * @async
483
- * @roles api, admin, developer, user
484
- * @param {Object} params - The parameters for updating the Short Code campaign
485
- * @param {string} params.campaignId - The ID of the campaign to update
486
- * @param {Object} params.updateData - The fields to update (top-level campaign fields plus an optional `shortCode` object of editable Short Code fields; pass a new `uploadOptInImage` URL as `shortCode.screenshotUrl` to replace the opt-in proof)
487
- * @param {RequestOptions} [params.options] - Additional options for the request
488
- * @throws {Error} Throws an error if the campaignId parameter is missing
489
- * @returns {Promise<SdkResponse<any>>} The updated campaign
490
- */
491
- async updateShortCodeCampaign({ campaignId, updateData, options = {} }) {
492
- this.client._require({ campaignId });
493
- const safeCampaignId = encodeURIComponent(campaignId);
494
- return this.client(`/campaign/short-code/${safeCampaignId}`, { method: 'PUT', body: updateData, ...options });
495
- }
496
-
497
- /**
498
- * Cancel a Short Code campaign. A customer cancellation for an issued Short Code returns
499
- * PENDING_DELETE (displayed as Cancellation Pending) until Signal House confirms Registry offboarding.
500
- * Unissued RANDOM/VANITY requests, plus staff-confirmed cancellations, return EXPIRED immediately.
501
- * @async
502
- * @roles api, admin, developer, user
503
- * @param {Object} params - The parameters for cancelling the campaign
504
- * @param {string} params.campaignId - The ID of the campaign to cancel
505
- * @param {RequestOptions} [params.options] - Additional options for the request
506
- * @throws {Error} Throws an error if the campaignId parameter is missing
507
- * @returns {Promise<SdkResponse<any>>} The cancelled campaign
508
- */
509
- async cancelShortCodeCampaign({ campaignId, options = {} }) {
510
- this.client._require({ campaignId });
511
- const safeCampaignId = encodeURIComponent(campaignId);
512
- return this.client(`/campaign/short-code/${safeCampaignId}/cancel`, { method: 'POST', ...options });
513
- }
514
-
515
- /**
516
- * Download a private Short Code external lease receipt. Opt-in screenshots are public at the
517
- * `shortCode.screenshotUrl` returned on the campaign. Authorized receipt users should pass
518
- * `options: { responseType: "blob" }` (browser) or an equivalent binary response type for your HTTP
519
- * client to receive the raw file bytes instead of attempting to parse them as JSON.
520
- * @async
521
- * @roles api, admin, developer, user
522
- * @param {Object} params - The parameters for downloading the artifact
523
- * @param {string} params.artifactId - The receipt identifier from `numberSource.externalLease.receiptArtifactId`
524
- * @param {RequestOptions} [params.options] - Additional options for the request
525
- * @throws {Error} Throws an error if the artifactId parameter is missing
526
- * @returns {Promise<SdkResponse<any>>} The response from the server (raw file bytes as `data` when a binary responseType is used)
527
- */
528
- async readCampaignArtifact({ artifactId, options = {} }) {
529
- this.client._require({ artifactId });
530
- const safeArtifactId = encodeURIComponent(artifactId);
531
- return this.client(`/campaign/short-code/artifact/${safeArtifactId}`, { method: 'GET', ...options });
532
- }
533
-
534
- /**
535
- * Upload a sample media file (JPEG, PNG, GIF, MP4 or MP3, up to 5MB) for a 10DLC campaign. Reference the
536
- * returned mediaId in sampleMediaIds on campaign create or update; it is attached to the TCR campaign for
537
- * carrier review
538
- * @async
539
- * @roles api, admin, developer, user
540
- * @param {Object} params - The parameters for uploading the sample media
541
- * @param {Blob|File} params.file - The media file to upload, provided as a Blob/File
542
- * @param {string} [params.groupId] - The group the file belongs to. Required with a staff (signalhouse_*) key, which has no active group; otherwise optional and must be your own group
543
- * @param {RequestOptions} [params.options] - Additional options for the request
544
- * @throws {Error} Throws an error if the file parameter is missing
545
- * @returns {Promise<SdkResponse<any>>} The response from the server containing the mediaId, fileName, mimeType and size
546
- */
547
- async uploadSampleMedia({ file, groupId, options = {} }) {
548
- this.client._require({ file });
549
- const formData = new FormData();
550
- if (groupId) formData.append('groupId', groupId);
551
- formData.append('file', file);
552
- return this.multipartClient(`/campaign/sample-media`, { method: 'POST', body: formData, ...options });
553
- }
554
-
555
- /**
556
- * Download a campaign sample media file your group owns
557
- * @async
558
- * @roles api, admin, developer, user
559
- * @param {Object} params - The parameters for downloading the sample media
560
- * @param {string} params.mediaId - The mediaId returned by uploadSampleMedia
561
- * @param {RequestOptions} [params.options] - Additional options for the request
562
- * @throws {Error} Throws an error if the mediaId parameter is missing
563
- * @returns {Promise<SdkResponse<any>>} The response from the server containing the file bytes
564
- */
565
- async readSampleMedia({ mediaId, options = {} }) {
566
- this.client._require({ mediaId });
567
- const safeMediaId = encodeURIComponent(mediaId);
568
- return this.client(`/campaign/sample-media/${safeMediaId}`, { method: 'GET', ...options });
569
- }
570
-
571
- /**
572
- * Upload an opt-in proof image to be hosted on-platform, returning a publicly-fetchable URL suitable for a
573
- * Toll-Free campaign's optInImageURLs or a Short Code campaign's shortCode.screenshotUrl
574
- * @async
575
- * @roles api, admin, developer, user
576
- * @param {Object} params - The parameters for uploading the opt-in image
577
- * @param {Blob|File} params.file - The image file to upload, provided as a Blob/File
578
- * @param {RequestOptions} [params.options] - Additional options for the request
579
- * @throws {Error} Throws an error if the file parameter is missing
580
- * @returns {Promise<SdkResponse<any>>} The response from the server containing the hosted image's id and URL
581
- */
582
- async uploadOptInImage({ file, options = {} }) {
583
- this.client._require({ file });
584
- const formData = new FormData();
585
- formData.append('file', file);
586
- return this.multipartClient(`/campaign/opt-in-image`, { method: 'POST', body: formData, ...options });
587
- }
588
-
589
- /**
590
- * Auto-capture an opt-in proof image from a brand's generated landing page and host it on-platform,
591
- * returning a publicly-fetchable URL suitable for a Toll-Free campaign's optInImageURLs
592
- * @async
593
- * @roles api, admin, developer, user
594
- * @param {Object} params - The parameters for capturing the opt-in image
595
- * @param {string} params.brandId - The ID of the brand whose generated landing page should be captured
596
- * @param {string} [params.landingId] - The specific page to capture. Required for Toll-Free brands, which have
597
- * one page per campaign — omitted, the request is refused rather than guessing which page to shoot. A 10DLC
598
- * brand has a single page, so it may be omitted there
599
- * @param {RequestOptions} [params.options] - Additional options for the request
600
- * @throws {Error} Throws an error if the brandId parameter is missing
601
- * @returns {Promise<SdkResponse<any>>} The response from the server containing the hosted image's id and URL
602
- */
603
- async captureOptInImageFromLanding({ brandId, landingId, options = {} }) {
604
- this.client._require({ brandId });
605
- const body = { brandId };
606
- if (landingId) body.landingId = landingId;
607
- return this.client(`/campaign/opt-in-image/from-landing`, { method: 'POST', body, ...options });
608
- }
609
-
610
- /**
611
- * Update an existing campaign
612
- * @async
613
- * @roles api, admin, developer, billing, user
614
- * @param {Object} params - The parameters for updating the campaign (see UpdateCampaignData typedef for details)
615
- * @param {string} params.campaignId - The ID of the campaign to update
616
- * @param {UpdateCampaignData} params.campaignData - The data for the campaign to be updated (see UpdateCampaignData typedef for details)
617
- * @param {RequestOptions} [params.options] - Additional options for the request
618
- * @throws {Error} Throws an error if the campaignId parameter is missing or if required fields in campaignData are missing
619
- * @returns {Promise<SdkResponse<any>>} The response from the server
620
- */
621
- async updateCampaign({ campaignId, campaignData, options = {} }) {
622
- this.client._require({ campaignId: campaignId });
623
- const safeCampaignId = encodeURIComponent(campaignId);
624
- return this.client(`/campaign/${safeCampaignId}`, { method: 'PUT', body: campaignData, ...options });
625
- }
626
-
627
- /**
628
- * Add an internal comment/note to a campaign
629
- * @async
630
- * @roles signalhouse_admin, signalhouse_user
631
- * @param {Object} params - The parameters for adding the comment
632
- * @param {string} params.campaignId - The ID of the campaign
633
- * @param {string} params.comment - The comment/note text
634
- * @param {RequestOptions} [params.options] - Additional options for the request
635
- * @throws {Error} Throws an error if the campaignId or comment parameter is missing
636
- * @returns {Promise<SdkResponse<any>>} The updated campaign object
637
- */
638
- async addCampaignComment({ campaignId, comment, options = {} }) {
639
- this.client._require({ campaignId, comment });
640
- const safeCampaignId = encodeURIComponent(campaignId);
641
- return this.client(`/campaign/${safeCampaignId}/comments`, { method: 'POST', body: { comment }, ...options });
642
- }
643
-
644
- /**
645
- * Delete an existing campaign (mark it as EXPIRED). The campaign will still be retrievable
646
- * @async
647
- * @roles api, admin, developer, billing, user
648
- * @param {Object} params - The parameters for deleting the campaign
649
- * @param {string} params.campaignId - The ID of the campaign to delete
650
- * @param {RequestOptions} [params.options] - Additional options for the request
651
- * @throws {Error} Throws an error if the campaignId parameter is missing
652
- * @returns {Promise<SdkResponse<any>>} The response from the server
653
- */
654
- async deleteCampaign({ campaignId, options = {} }) {
655
- this.client._require({ campaignId: campaignId });
656
- const safeCampaignId = encodeURIComponent(campaignId);
657
- return this.client(`/campaign/${safeCampaignId}`, { method: 'DELETE', ...options });
658
- }
659
-
660
- /**
661
- * Appeal a DCA-rejected campaign
662
- * @async
663
- * @roles api, admin, developer, billing, user
664
- * @param {Object} params - The parameters for appealing the campaign rejection
665
- * @param {string} params.campaignId - The ID of the campaign to appeal
666
- * @param {RequestOptions} [params.options] - Additional options for the request (body should include { reason })
667
- * @throws {Error} Throws an error if the campaignId parameter is missing
668
- * @returns {Promise<SdkResponse<any>>} The response from the server
669
- */
670
- async appealDcaRejection({ campaignId, options = {} }) {
671
- this.client._require({ campaignId: campaignId });
672
- const safeCampaignId = encodeURIComponent(campaignId);
673
- return this.client(`/campaign/appealDcaRejection/${safeCampaignId}`, { method: 'POST', ...options });
674
- }
675
-
676
- /**
677
- * Nudge a connectivity partner to prioritize review of a campaign in PENDING_DCA_APPROVAL status
678
- * @async
679
- * @roles api, admin, developer, billing, user
680
- * @param {Object} params - The parameters for nudging the campaign
681
- * @param {string} params.campaignId - The ID of the campaign to nudge
682
- * @param {RequestOptions} [params.options] - Additional options for the request
683
- * @throws {Error} Throws an error if the campaignId parameter is missing
684
- * @returns {Promise<SdkResponse<any>>} The response from the server
685
- */
686
- async nudgeDcaForCampaign({ campaignId, options = {} }) {
687
- this.client._require({ campaignId: campaignId });
688
- const safeCampaignId = encodeURIComponent(campaignId);
689
- return this.client(`/campaign/nudge/${safeCampaignId}`, { method: 'POST', ...options });
690
- }
691
- }