@signalhousellc/sdk 1.0.61 → 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 +1 -1
- package/src/SignalHouseSDK.js +1 -1
- package/src/domains/Brands.js +273 -205
- package/src/domains/Campaigns.js +417 -226
- package/src/domains/Messages.js +37 -1
- package/src/domains/Numbers.js +457 -378
- package/src/domains/voice/SipTrunks.js +37 -0
package/package.json
CHANGED
package/src/SignalHouseSDK.js
CHANGED
|
@@ -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);
|
package/src/domains/Brands.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {string} BrandLookupId - Carrier Brand ID (B
|
|
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
|
*/
|
|
@@ -98,221 +98,289 @@
|
|
|
98
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)
|
|
99
99
|
*/
|
|
100
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
|
+
|
|
101
118
|
export class Brands {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
+
}
|
|
107
176
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
*/
|
|
123
|
-
async getBrands({ id, subgroupId, groupId, page, limit, status, registrationType, options = {} }) {
|
|
124
|
-
const filters = { id, subgroupId, groupId, page, limit, status, registrationType };
|
|
125
|
-
const queryString = this.client._getQueryString(filters);
|
|
126
|
-
return this.client(`/brand${queryString}`, { method: "GET", ...options });
|
|
127
|
-
}
|
|
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
|
+
}
|
|
128
191
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return this.client(`/brand/externalvetting/${safeBrandId}`, { method: "GET", ...options });
|
|
143
|
-
}
|
|
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
|
+
}
|
|
144
205
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
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
|
+
}
|
|
159
219
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
+
}
|
|
174
238
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
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
|
+
}
|
|
191
255
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
+
}
|
|
207
271
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
+
}
|
|
230
298
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
+
}
|
|
247
315
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
+
}
|
|
263
331
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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
|
+
}
|
|
279
347
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
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
|
+
}
|
|
295
363
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
+
}
|
|
318
386
|
}
|