@signalhousellc/sdk 1.0.56 → 1.0.62

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signalhousellc/sdk",
3
- "version": "1.0.56",
3
+ "version": "1.0.62",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -61,7 +61,7 @@ export class SignalHouseSDK {
61
61
  this.groups = new Groups(client, this.enableAdmin);
62
62
  this.landings = new Landings(client, multipartClient, this.enableAdmin);
63
63
  this.messages = new Messages(client, multipartClient, this.enableAdmin);
64
- this.numbers = new Numbers(client, this.enableAdmin);
64
+ this.numbers = new Numbers(client, multipartClient, this.enableAdmin);
65
65
  this.onboarding = new Onboarding(client, this.enableAdmin);
66
66
  this.shortlinks = new Shortlinks(client, this.enableAdmin);
67
67
  this.subgroups = new Subgroups(client, this.enableAdmin);
@@ -33,13 +33,15 @@ export class Auth {
33
33
  * @param {string} [params.volume] - Estimated monthly message volume
34
34
  * @param {string[]} [params.products] - Products the account intends to integrate
35
35
  * @param {boolean} [params.acceptedTermsOfService] - Whether the user accepted the Terms of Service
36
+ * @param {string} [params.psXid] - PartnerStack click id (ps_xid) captured from a referral link
37
+ * @param {string} [params.psPartnerKey] - PartnerStack partner key (ps_partner_key) captured from a referral link
36
38
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
37
39
  * @returns {Promise<Object>} The response from the server (contains the JWT token)
38
40
  */
39
- async register({ businessName, fullName, email, password, phone, dialCode, country, volume, products, acceptedTermsOfService, options = {} }) {
41
+ async register({ businessName, fullName, email, password, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey, options = {} }) {
40
42
  return this.client(`/auth/register`, {
41
43
  method: "POST",
42
- body: { businessName, fullName, email, password, phone, dialCode, country, volume, products, acceptedTermsOfService },
44
+ body: { businessName, fullName, email, password, phone, dialCode, country, volume, products, acceptedTermsOfService, psXid, psPartnerKey },
43
45
  ...options,
44
46
  });
45
47
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef {string} BrandLookupId - Carrier Brand ID (B… or TFNB…), Mongo `_id`, or internal reference UUID.
2
+ * @typedef {string} BrandLookupId - Carrier Brand ID (B…, TFNB…, or SCB…), Mongo `_id`, or internal reference UUID.
3
3
  * Use on update, delete, revet, vetting, appeal, and transfer routes. Pending brands return `brandId: null`
4
4
  * in read/create responses — poll `GET /brand?id=<Mongo _id>` until a carrier Brand ID is assigned.
5
5
  */
@@ -59,7 +59,7 @@
59
59
  * @property {string} [altBusinessIdType] - The type of the alternative business identifier ("NONE", "DUNS", "LEI", "GIIN")
60
60
  * @property {string} [brandRelationship] - Not in use - reserved for future use
61
61
  * @property {string} [businessContactEmail] - The email address of the business contact for the brand (required if entityType is PUBLIC_PROFIT or NON_PROFIT)
62
- * @property {Object} [tollFree] - Toll-Free editable fields, used when updating a Toll-Free brand. Optional sub-fields: legalEntityType, businessRegistrationType, taxId, countryCode, supportPhone, taxIdIssuingCountry, businessDBA. (Toll-Free brands sync to Infobip; only DCA_PENDING/DCA_ACTIVE brands are editable and subgroupId is immutable.)
62
+ * @property {Object} [tollFree] - Toll-Free editable fields, used when updating a Toll-Free brand. Optional sub-fields: legalEntityType, businessRegistrationType, taxId, countryCode, supportPhone, taxIdIssuingCountry, businessDBA, businessWebsite. (Toll-Free brands sync to Infobip; only DCA_PENDING/DCA_ACTIVE brands are editable and subgroupId is immutable.)
63
63
  */
64
64
 
65
65
  /**
@@ -71,6 +71,7 @@
71
71
  * @property {string} supportPhone - The customer-support phone number (required, at most 20 characters)
72
72
  * @property {string} [taxIdIssuingCountry] - The country that issued the tax ID (optional, 2-letter ISO code)
73
73
  * @property {string} [businessDBA] - The business "doing business as" name (optional, at most 255 characters)
74
+ * @property {string} [businessWebsite] - The customer's real website, sent to Infobip for brand verification (optional, valid URL, at most 255 characters; distinct from the top-level website / landing URL)
74
75
  */
75
76
 
76
77
  /**
@@ -97,221 +98,289 @@
97
98
  * @property {string} [country] - The country code of the primary contact for the brand (optional, 2-letter code; when "US", state must be a valid 2-letter US state code)
98
99
  */
99
100
 
101
+ /**
102
+ * @typedef {Object} CreateShortCodeBrandData
103
+ * @property {string} subgroupId - The ID of the subgroup to create the brand under.
104
+ * @property {string} displayName - The Short Code brand display name.
105
+ * @property {string} companyName - The official company name.
106
+ * @property {string} street - The street address.
107
+ * @property {string} city - The city.
108
+ * @property {string} state - The state or province.
109
+ * @property {string} postalCode - The postal code.
110
+ * @property {string} country - The 2-letter country code.
111
+ * @property {string} email - The support email address.
112
+ * @property {string} firstName - The contact's first name.
113
+ * @property {string} lastName - The contact's last name.
114
+ * @property {string} website - The company website URL.
115
+ * @property {{ businessRegistrationType: string, legalEntityType: string, taxId: string, countryCode: string, supportPhone: string }} shortCode - Short Code registration details.
116
+ */
117
+
100
118
  export class Brands {
101
- constructor(client, multipartClient, enableAdmin) {
102
- this.client = client;
103
- this.multipartClient = multipartClient;
104
- this.enableAdmin = enableAdmin;
105
- }
119
+ constructor(client, multipartClient, enableAdmin) {
120
+ this.client = client;
121
+ this.multipartClient = multipartClient;
122
+ this.enableAdmin = enableAdmin;
123
+ }
124
+
125
+ /**
126
+ * Get a list of brands with optional filters
127
+ * @async
128
+ * @roles api, admin, developer, user
129
+ * @param {Object} params - The parameters for filtering the brands
130
+ * @param {string} [params.id] - Brand lookup id (carrier Brand ID, Mongo _id, or internal reference)
131
+ * @param {string} [params.subgroupId] - The ID of the subgroup to filter by
132
+ * @param {string} [params.groupId] - The ID of the group to filter by
133
+ * @param {number} [params.page] - The page number for pagination
134
+ * @param {number} [params.limit] - The number of items per page
135
+ * @param {string} [params.status] - The status of the brand to filter by (PENDING_CREATION, PENDING_APPROVAL, UNVERIFIED, VERIFIED, VETTED_VERIFIED, PENDING_DELETE, DELETED)
136
+ * @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC", "TOLL_FREE", or "SHORT_CODE")
137
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
138
+ * @returns {Promise<Array<{ _id: string, brandId: string|null, status: string, registrationType: string, [key: string]: any }>>} Brand records. For 10DLC brands in PENDING_CREATION (or rejected before carrier assignment), brandId is null — poll by _id until status advances and brandId is assigned.
139
+ */
140
+ async getBrands({ id, subgroupId, groupId, page, limit, status, registrationType, options = {} }) {
141
+ const filters = { id, subgroupId, groupId, page, limit, status, registrationType };
142
+ const queryString = this.client._getQueryString(filters);
143
+ return this.client(`/brand${queryString}`, { method: 'GET', ...options });
144
+ }
145
+
146
+ /**
147
+ * Get external vetting information for a brand
148
+ * @async
149
+ * @roles api, admin, developer, user
150
+ * @param {Object} params - The parameters for getting the external vetting information
151
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
152
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
153
+ * @throws {Error} Throws an error if the brandId parameter is missing
154
+ * @returns {Promise<Object>} The response from the server
155
+ */
156
+ async getExternalVetting({ brandId, options = {} }) {
157
+ this.client._require({ brandId });
158
+ const safeBrandId = encodeURIComponent(brandId);
159
+ return this.client(`/brand/externalvetting/${safeBrandId}`, { method: 'GET', ...options });
160
+ }
161
+
162
+ /**
163
+ * Create a new brand
164
+ * @async
165
+ * @roles api, admin, developer, billing, user
166
+ * @param {Object} params - The parameters for creating the brand (see CreateBrandData typedef for details)
167
+ * @param {CreateBrandData} params.brandData - The data for the brand to be created
168
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
169
+ * @throws {Error} Throws an error if the brandData parameter is missing or if required fields in brandData are missing
170
+ * @returns {Promise<Object>} Brand entity. `brandId` is `null` until the carrier assigns a Brand ID — use `_id` to poll status.
171
+ */
172
+ async createBrand({ brandData, options = {} }) {
173
+ this.client._require({ brandData: brandData });
174
+ return this.client(`/brand`, { method: 'POST', body: brandData, ...options });
175
+ }
106
176
 
107
- /**
108
- * Get a list of brands with optional filters
109
- * @async
110
- * @roles api, admin, developer, user
111
- * @param {Object} params - The parameters for filtering the brands
112
- * @param {string} [params.id] - Brand lookup id (carrier Brand ID, Mongo _id, or internal reference)
113
- * @param {string} [params.subgroupId] - The ID of the subgroup to filter by
114
- * @param {string} [params.groupId] - The ID of the group to filter by
115
- * @param {number} [params.page] - The page number for pagination
116
- * @param {number} [params.limit] - The number of items per page
117
- * @param {string} [params.status] - The status of the brand to filter by (PENDING_CREATION, PENDING_APPROVAL, UNVERIFIED, VERIFIED, VETTED_VERIFIED, PENDING_DELETE, DELETED)
118
- * @param {string} [params.registrationType] - Filter by registration type ("TEN_DLC" or "TOLL_FREE")
119
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
120
- * @returns {Promise<Array<{ _id: string, brandId: string|null, status: string, registrationType: string, [key: string]: any }>>} Brand records. For 10DLC brands in PENDING_CREATION (or rejected before carrier assignment), brandId is null — poll by _id until status advances and brandId is assigned.
121
- */
122
- async getBrands({ id, subgroupId, groupId, page, limit, status, registrationType, options = {} }) {
123
- const filters = { id, subgroupId, groupId, page, limit, status, registrationType };
124
- const queryString = this.client._getQueryString(filters);
125
- return this.client(`/brand${queryString}`, { method: "GET", ...options });
126
- }
177
+ /**
178
+ * Create a new Toll-Free (TFN) brand
179
+ * @async
180
+ * @roles api, admin, developer, billing, user
181
+ * @param {Object} params - The parameters for creating the toll-free brand
182
+ * @param {CreateTollFreeBrandData} params.brandData - The data for the toll-free brand to be created (see CreateTollFreeBrandData typedef for details; TFN-specific fields live under brandData.tollFree, and registrationType is forced server-side by the route)
183
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
184
+ * @throws {Error} Throws an error if the brandData parameter is missing
185
+ * @returns {Promise<Object>} Brand entity. For Toll-Free, `brandId` is a TFNB-prefixed id when assigned; otherwise `null` — use `_id` to poll.
186
+ */
187
+ async createTollFreeBrand({ brandData, options = {} }) {
188
+ this.client._require({ brandData });
189
+ return this.client(`/brand/toll-free`, { method: 'POST', body: brandData, ...options });
190
+ }
127
191
 
128
- /**
129
- * Get external vetting information for a brand
130
- * @async
131
- * @roles api, admin, developer, user
132
- * @param {Object} params - The parameters for getting the external vetting information
133
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
134
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
135
- * @throws {Error} Throws an error if the brandId parameter is missing
136
- * @returns {Promise<Object>} The response from the server
137
- */
138
- async getExternalVetting({ brandId, options = {} }) {
139
- this.client._require({ brandId });
140
- const safeBrandId = encodeURIComponent(brandId);
141
- return this.client(`/brand/externalvetting/${safeBrandId}`, { method: "GET", ...options });
142
- }
192
+ /**
193
+ * Create a local Short Code brand for manual Signal House review.
194
+ * @async
195
+ * @roles api, admin, developer, billing, user
196
+ * @param {Object} params - The creation parameters.
197
+ * @param {CreateShortCodeBrandData} params.brandData - The Short Code brand data. The route forces registrationType server-side.
198
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
199
+ * @returns {Promise<Object>} A 201-created Short Code brand with a stable SCB-prefixed ID and PENDING_APPROVAL status.
200
+ */
201
+ async createShortCodeBrand({ brandData, options = {} }) {
202
+ this.client._require({ brandData });
203
+ return this.client(`/brand/short-code`, { method: 'POST', body: brandData, ...options });
204
+ }
143
205
 
144
- /**
145
- * Create a new brand
146
- * @async
147
- * @roles api, admin, developer, billing, user
148
- * @param {Object} params - The parameters for creating the brand (see CreateBrandData typedef for details)
149
- * @param {CreateBrandData} params.brandData - The data for the brand to be created
150
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
151
- * @throws {Error} Throws an error if the brandData parameter is missing or if required fields in brandData are missing
152
- * @returns {Promise<Object>} Brand entity. `brandId` is `null` until the carrier assigns a Brand ID — use `_id` to poll status.
153
- */
154
- async createBrand({ brandData, options = {} }) {
155
- this.client._require({ brandData: brandData });
156
- return this.client(`/brand`, { method: "POST", body: brandData, ...options });
157
- }
206
+ /**
207
+ * Approve a pending Short Code brand.
208
+ * @async
209
+ * @roles signalhouse_admin
210
+ * @param {Object} params - The approval parameters.
211
+ * @param {BrandLookupId} params.brandId - The pending Short Code brand lookup ID.
212
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
213
+ * @returns {Promise<Object>} The verified Short Code brand.
214
+ */
215
+ async approveShortCodeBrand({ brandId, options = {} }) {
216
+ this.client._require({ brandId });
217
+ return this.client(`/brand/approve/${encodeURIComponent(brandId)}`, { method: 'POST', ...options });
218
+ }
158
219
 
159
- /**
160
- * Create a new Toll-Free (TFN) brand
161
- * @async
162
- * @roles api, admin, developer, billing, user
163
- * @param {Object} params - The parameters for creating the toll-free brand
164
- * @param {CreateTollFreeBrandData} params.brandData - The data for the toll-free brand to be created (see CreateTollFreeBrandData typedef for details; TFN-specific fields live under brandData.tollFree, and registrationType is forced server-side by the route)
165
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
166
- * @throws {Error} Throws an error if the brandData parameter is missing
167
- * @returns {Promise<Object>} Brand entity. For Toll-Free, `brandId` is a TFNB-prefixed id when assigned; otherwise `null` — use `_id` to poll.
168
- */
169
- async createTollFreeBrand({ brandData, options = {} }) {
170
- this.client._require({ brandData });
171
- return this.client(`/brand/toll-free`, { method: "POST", body: brandData, ...options });
172
- }
220
+ /**
221
+ * Reject a pending Short Code brand with a customer-visible reason.
222
+ * @async
223
+ * @roles signalhouse_admin
224
+ * @param {Object} params - The rejection parameters.
225
+ * @param {BrandLookupId} params.brandId - The pending Short Code brand lookup ID.
226
+ * @param {string} params.internalRejectionReason - Required customer-visible rejection reason.
227
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request.
228
+ * @returns {Promise<Object>} The rejected Short Code brand.
229
+ */
230
+ async rejectShortCodeBrand({ brandId, internalRejectionReason, options = {} }) {
231
+ this.client._require({ brandId, internalRejectionReason });
232
+ return this.client(`/brand/reject/${encodeURIComponent(brandId)}`, {
233
+ method: 'POST',
234
+ body: { internalRejectionReason },
235
+ ...options,
236
+ });
237
+ }
173
238
 
174
- /**
175
- * Transfer one or more brands to a different subgroup
176
- * @async
177
- * @roles api, admin, developer, billing, user
178
- * @param {Object} params - The parameters for transferring the brands
179
- * @param {string} params.subgroupId - The ID of the subgroup to transfer the brands to
180
- * @param {BrandLookupId[]} params.brandIds - Brand lookup ids to transfer (carrier id, Mongo `_id`, or internal reference).
181
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
182
- * @throws {Error} Throws an error if the subgroupId or brandIds parameters are missing
183
- * @returns {Promise<Object>} The response from the server
184
- */
185
- async transferBrand({ subgroupId, brandIds, options = {} }) {
186
- this.client._require({ subgroupId, brandIds });
187
- const safeSubgroupId = encodeURIComponent(subgroupId);
188
- return this.client(`/brand/transfer/${safeSubgroupId}`, { method: "POST", body: { brandIds }, ...options });
189
- }
239
+ /**
240
+ * Transfer one or more brands to a different subgroup
241
+ * @async
242
+ * @roles api, admin, developer, billing, user
243
+ * @param {Object} params - The parameters for transferring the brands
244
+ * @param {string} params.subgroupId - The ID of the subgroup to transfer the brands to
245
+ * @param {BrandLookupId[]} params.brandIds - Brand lookup ids to transfer (carrier id, Mongo `_id`, or internal reference).
246
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
247
+ * @throws {Error} Throws an error if the subgroupId or brandIds parameters are missing
248
+ * @returns {Promise<Object>} The response from the server
249
+ */
250
+ async transferBrand({ subgroupId, brandIds, options = {} }) {
251
+ this.client._require({ subgroupId, brandIds });
252
+ const safeSubgroupId = encodeURIComponent(subgroupId);
253
+ return this.client(`/brand/transfer/${safeSubgroupId}`, { method: 'POST', body: { brandIds }, ...options });
254
+ }
190
255
 
191
- /**
192
- * Create external vetting for a brand
193
- * @async
194
- * @roles api, admin, developer, billing, user
195
- * @param {Object} params - The parameters for creating external vetting
196
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
197
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
198
- * @throws {Error} Throws an error if the brandId parameter is missing
199
- * @returns {Promise<Object>} The response from the server
200
- */
201
- async createExternalVetting({ brandId, options = {} }) {
202
- this.client._require({ brandId });
203
- const safeBrandId = encodeURIComponent(brandId);
204
- return this.client(`/brand/externalvetting/${safeBrandId}`, { method: "POST", ...options });
205
- }
256
+ /**
257
+ * Create external vetting for a brand
258
+ * @async
259
+ * @roles api, admin, developer, billing, user
260
+ * @param {Object} params - The parameters for creating external vetting
261
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
262
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
263
+ * @throws {Error} Throws an error if the brandId parameter is missing
264
+ * @returns {Promise<Object>} The response from the server
265
+ */
266
+ async createExternalVetting({ brandId, options = {} }) {
267
+ this.client._require({ brandId });
268
+ const safeBrandId = encodeURIComponent(brandId);
269
+ return this.client(`/brand/externalvetting/${safeBrandId}`, { method: 'POST', ...options });
270
+ }
206
271
 
207
- /**
208
- * Import an existing external vetting record for a brand
209
- *
210
- * Unlike createExternalVetting (which orders a new, billable vetting), this attaches a vetting the
211
- * brand already completed directly with the provider, using the provider-issued vettingId and
212
- * vettingToken. It is synchronous and not billable.
213
- * @async
214
- * @roles api, admin, developer, billing, user
215
- * @param {Object} params - The parameters for importing external vetting
216
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
217
- * @param {string} params.vettingProviderId - The external vetting provider (AEGIS, WMC, CV)
218
- * @param {string} params.vettingId - The provider-issued vetting / transaction ID to import
219
- * @param {string} [params.vettingToken] - The provider-issued vetting token (required by some providers, e.g. AEGIS)
220
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
221
- * @throws {Error} Throws an error if brandId, vettingProviderId, or vettingId is missing
222
- * @returns {Promise<Object>} The response from the server
223
- */
224
- async importExternalVetting({ brandId, vettingProviderId, vettingId, vettingToken, options = {} }) {
225
- this.client._require({ brandId, vettingProviderId, vettingId });
226
- const safeBrandId = encodeURIComponent(brandId);
227
- return this.client(`/brand/externalvetting/import/${safeBrandId}`, { method: "POST", body: { vettingProviderId, vettingId, vettingToken }, ...options });
228
- }
272
+ /**
273
+ * Import an existing external vetting record for a brand
274
+ *
275
+ * Unlike createExternalVetting (which orders a new, billable vetting), this attaches a vetting the
276
+ * brand already completed directly with the provider, using the provider-issued vettingId and
277
+ * vettingToken. It is synchronous and not billable.
278
+ * @async
279
+ * @roles api, admin, developer, billing, user
280
+ * @param {Object} params - The parameters for importing external vetting
281
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
282
+ * @param {string} params.vettingProviderId - The external vetting provider (AEGIS, WMC, CV)
283
+ * @param {string} params.vettingId - The provider-issued vetting / transaction ID to import
284
+ * @param {string} [params.vettingToken] - The provider-issued vetting token (required by some providers, e.g. AEGIS)
285
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
286
+ * @throws {Error} Throws an error if brandId, vettingProviderId, or vettingId is missing
287
+ * @returns {Promise<Object>} The response from the server
288
+ */
289
+ async importExternalVetting({ brandId, vettingProviderId, vettingId, vettingToken, options = {} }) {
290
+ this.client._require({ brandId, vettingProviderId, vettingId });
291
+ const safeBrandId = encodeURIComponent(brandId);
292
+ return this.client(`/brand/externalvetting/import/${safeBrandId}`, {
293
+ method: 'POST',
294
+ body: { vettingProviderId, vettingId, vettingToken },
295
+ ...options,
296
+ });
297
+ }
229
298
 
230
- /**
231
- * Update a brand's information
232
- * @async
233
- * @roles api, admin, developer, billing, user
234
- * @param {Object} params - The parameters for updating the brand (see UpdateBrandData typedef for details)
235
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
236
- * @param {UpdateBrandData} params.brandData - The data for the brand to be updated
237
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
238
- * @throws {Error} Throws an error if the brandId parameter is missing
239
- * @returns {Promise<Object>} The response from the server
240
- */
241
- async updateBrand({ brandId, brandData, options = {} }) {
242
- this.client._require({ brandId });
243
- const safeBrandId = encodeURIComponent(brandId);
244
- return this.client(`/brand/${safeBrandId}`, { method: "PUT", body: brandData, ...options });
245
- }
299
+ /**
300
+ * Update a brand's information
301
+ * @async
302
+ * @roles api, admin, developer, billing, user
303
+ * @param {Object} params - The parameters for updating the brand (see UpdateBrandData typedef for details)
304
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
305
+ * @param {UpdateBrandData} params.brandData - The data for the brand to be updated
306
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
307
+ * @throws {Error} Throws an error if the brandId parameter is missing
308
+ * @returns {Promise<Object>} The response from the server
309
+ */
310
+ async updateBrand({ brandId, brandData, options = {} }) {
311
+ this.client._require({ brandId });
312
+ const safeBrandId = encodeURIComponent(brandId);
313
+ return this.client(`/brand/${safeBrandId}`, { method: 'PUT', body: brandData, ...options });
314
+ }
246
315
 
247
- /**
248
- * Revet a brand that is in UNVERIFIED status due to an update afer it was previously VERIFIED or VETTED_VERIFIED
249
- * @async
250
- * @roles api, admin, developer, billing, user
251
- * @param {Object} params - The parameters for reverting the brand
252
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
253
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
254
- * @throws {Error} Throws an error if the brandId parameter is missing
255
- * @returns {Promise<Object>} The response from the server
256
- */
257
- async revetBrand({ brandId, options = {} }) {
258
- this.client._require({ brandId });
259
- const safeBrandId = encodeURIComponent(brandId);
260
- return this.client(`/brand/revet/${safeBrandId}`, { method: "PUT", ...options });
261
- }
316
+ /**
317
+ * Revet a brand that is in UNVERIFIED status due to an update afer it was previously VERIFIED or VETTED_VERIFIED
318
+ * @async
319
+ * @roles api, admin, developer, billing, user
320
+ * @param {Object} params - The parameters for reverting the brand
321
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
322
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
323
+ * @throws {Error} Throws an error if the brandId parameter is missing
324
+ * @returns {Promise<Object>} The response from the server
325
+ */
326
+ async revetBrand({ brandId, options = {} }) {
327
+ this.client._require({ brandId });
328
+ const safeBrandId = encodeURIComponent(brandId);
329
+ return this.client(`/brand/revet/${safeBrandId}`, { method: 'PUT', ...options });
330
+ }
262
331
 
263
- /**
264
- * Delete a brand (mark it as DELETED). The brand will still be retrievable
265
- * @async
266
- * @roles api, admin, developer, billing, user
267
- * @param {Object} params - The parameters for deleting the brand
268
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
269
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
270
- * @throws {Error} Throws an error if the brandId parameter is missing
271
- * @returns {Promise<Object>} The response from the server
272
- */
273
- async deleteBrand({ brandId, options = {} }) {
274
- this.client._require({ brandId });
275
- const safeBrandId = encodeURIComponent(brandId);
276
- return this.client(`/brand/${safeBrandId}`, { method: "DELETE", ...options });
277
- }
332
+ /**
333
+ * Delete a brand (mark it as DELETED). The brand will still be retrievable
334
+ * @async
335
+ * @roles api, admin, developer, billing, user
336
+ * @param {Object} params - The parameters for deleting the brand
337
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
338
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
339
+ * @throws {Error} Throws an error if the brandId parameter is missing
340
+ * @returns {Promise<Object>} The response from the server
341
+ */
342
+ async deleteBrand({ brandId, options = {} }) {
343
+ this.client._require({ brandId });
344
+ const safeBrandId = encodeURIComponent(brandId);
345
+ return this.client(`/brand/${safeBrandId}`, { method: 'DELETE', ...options });
346
+ }
278
347
 
279
- /**
280
- * Get appeal history for a brand
281
- * @async
282
- * @roles api, admin, developer, billing, user
283
- * @param {Object} params - The parameters for getting the appeal history
284
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
285
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
286
- * @throws {Error} Throws an error if the brandId parameter is missing
287
- * @returns {Promise<Array>} Array of BrandAppeal objects
288
- */
289
- async getAppealHistory({ brandId, options = {} }) {
290
- this.client._require({ brandId });
291
- const safeBrandId = encodeURIComponent(brandId);
292
- return this.client(`/brand/appeal/${safeBrandId}`, { method: "GET", ...options });
293
- }
348
+ /**
349
+ * Get appeal history for a brand
350
+ * @async
351
+ * @roles api, admin, developer, billing, user
352
+ * @param {Object} params - The parameters for getting the appeal history
353
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
354
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
355
+ * @throws {Error} Throws an error if the brandId parameter is missing
356
+ * @returns {Promise<Array>} Array of BrandAppeal objects
357
+ */
358
+ async getAppealHistory({ brandId, options = {} }) {
359
+ this.client._require({ brandId });
360
+ const safeBrandId = encodeURIComponent(brandId);
361
+ return this.client(`/brand/appeal/${safeBrandId}`, { method: 'GET', ...options });
362
+ }
294
363
 
295
- /**
296
- * Submit a brand identity status appeal with supporting documentation
297
- * @async
298
- * @roles api, admin, developer, billing, user
299
- * @param {Object} params - The parameters for submitting the appeal
300
- * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
301
- * @param {Array<string>} params.appealCategories - Array of appeal categories (VERIFY_TAX_ID, VERIFY_NON_PROFIT, VERIFY_GOVERNMENT)
302
- * @param {string} params.explanation - Required explanation justifying the appeal
303
- * @param {File|Blob} params.file - The supporting document file
304
- * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
305
- * @throws {Error} Throws an error if required parameters are missing
306
- * @returns {Promise<Object>} The response from the server
307
- */
308
- async submitAppeal({ brandId, appealCategories, explanation, file, options = {} }) {
309
- this.client._require({ brandId, appealCategories, explanation, file });
310
- const safeBrandId = encodeURIComponent(brandId);
311
- const formData = new FormData();
312
- formData.append("appealCategories", JSON.stringify(appealCategories));
313
- formData.append("explanation", explanation);
314
- formData.append("file", file);
315
- return this.multipartClient(`/brand/appeal/${safeBrandId}`, { method: "POST", body: formData, ...options });
316
- }
364
+ /**
365
+ * Submit a brand identity status appeal with supporting documentation
366
+ * @async
367
+ * @roles api, admin, developer, billing, user
368
+ * @param {Object} params - The parameters for submitting the appeal
369
+ * @param {BrandLookupId} params.brandId - Brand lookup id (carrier Brand ID, Mongo `_id`, or internal reference).
370
+ * @param {Array<string>} params.appealCategories - Array of appeal categories (VERIFY_TAX_ID, VERIFY_NON_PROFIT, VERIFY_GOVERNMENT)
371
+ * @param {string} params.explanation - Required explanation justifying the appeal
372
+ * @param {File|Blob} params.file - The supporting document file
373
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
374
+ * @throws {Error} Throws an error if required parameters are missing
375
+ * @returns {Promise<Object>} The response from the server
376
+ */
377
+ async submitAppeal({ brandId, appealCategories, explanation, file, options = {} }) {
378
+ this.client._require({ brandId, appealCategories, explanation, file });
379
+ const safeBrandId = encodeURIComponent(brandId);
380
+ const formData = new FormData();
381
+ formData.append('appealCategories', JSON.stringify(appealCategories));
382
+ formData.append('explanation', explanation);
383
+ formData.append('file', file);
384
+ return this.multipartClient(`/brand/appeal/${safeBrandId}`, { method: 'POST', body: formData, ...options });
385
+ }
317
386
  }