@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 +1 -1
- package/src/SignalHouseSDK.js +1 -1
- package/src/domains/Auth.js +4 -2
- package/src/domains/Brands.js +275 -206
- 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.js +13 -4
- package/src/domains/voice/CallLogs.js +105 -0
- package/src/domains/voice/GlobalVoiceSettings.js +48 -0
- package/src/domains/voice/ProgrammableVoiceProfiles.js +181 -0
- 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/Auth.js
CHANGED
|
@@ -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
|
}
|
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
|
*/
|
|
@@ -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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
}
|