@signalhousellc/sdk 1.0.27 → 1.0.28

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,19 +1,19 @@
1
- {
2
- "name": "@signalhousellc/sdk",
3
- "version": "1.0.27",
4
- "description": "Signal House SDK for use with the Signal House platform",
5
- "type": "module",
6
- "main": "src/SignalHouseSDK.js",
7
- "exports": {
8
- ".": "./src/SignalHouseSDK.js"
9
- },
10
- "files": [
11
- "src/",
12
- "README.md"
13
- ],
14
- "author": "Signal House LLC",
15
- "license": "ISC",
16
- "dependencies": {
17
- "axios": "^1.13.5"
18
- }
19
- }
1
+ {
2
+ "name": "@signalhousellc/sdk",
3
+ "version": "1.0.28",
4
+ "description": "Signal House SDK for use with the Signal House platform",
5
+ "type": "module",
6
+ "main": "src/SignalHouseSDK.js",
7
+ "exports": {
8
+ ".": "./src/SignalHouseSDK.js"
9
+ },
10
+ "files": [
11
+ "src/",
12
+ "README.md"
13
+ ],
14
+ "author": "Signal House LLC",
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "axios": "^1.13.5"
18
+ }
19
+ }
@@ -52,7 +52,7 @@ export class SignalHouseSDK {
52
52
  // API Domains
53
53
  this.auth = new Auth(client, this.enableAdmin);
54
54
  this.billing = new Billing(client, this.enableAdmin);
55
- this.brands = new Brands(client, this.enableAdmin);
55
+ this.brands = new Brands(client, multipartClient, this.enableAdmin);
56
56
  this.campaigns = new Campaigns(client, this.enableAdmin);
57
57
  this.groups = new Groups(client, this.enableAdmin);
58
58
  this.landings = new Landings(client, multipartClient, this.enableAdmin);
@@ -56,8 +56,9 @@
56
56
  */
57
57
 
58
58
  export class Brands {
59
- constructor(client, enableAdmin) {
59
+ constructor(client, multipartClient, enableAdmin) {
60
60
  this.client = client;
61
+ this.multipartClient = multipartClient;
61
62
  this.enableAdmin = enableAdmin;
62
63
  }
63
64
 
@@ -193,4 +194,43 @@ export class Brands {
193
194
  const safeBrandId = encodeURIComponent(brandId);
194
195
  return this.client(`/brand/${safeBrandId}`, { method: "DELETE", ...options });
195
196
  }
197
+
198
+ /**
199
+ * Get appeal history for a brand
200
+ * @async
201
+ * @roles api, admin, developer, billing, user
202
+ * @param {Object} params - The parameters for getting the appeal history
203
+ * @param {string} params.brandId - The ID of the brand to get appeal history for
204
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
205
+ * @throws {Error} Throws an error if the brandId parameter is missing
206
+ * @returns {Promise<Array>} Array of BrandAppeal objects
207
+ */
208
+ async getAppealHistory({ brandId, options = {} }) {
209
+ this.client._require({ brandId });
210
+ const safeBrandId = encodeURIComponent(brandId);
211
+ return this.client(`/brand/appeal/${safeBrandId}`, { method: "GET", ...options });
212
+ }
213
+
214
+ /**
215
+ * Submit a brand identity status appeal with supporting documentation
216
+ * @async
217
+ * @roles api, admin, developer, billing, user
218
+ * @param {Object} params - The parameters for submitting the appeal
219
+ * @param {string} params.brandId - The ID of the brand to appeal
220
+ * @param {Array<string>} params.appealCategories - Array of appeal categories (VERIFY_TAX_ID, VERIFY_NON_PROFIT, VERIFY_GOVERNMENT)
221
+ * @param {string} params.explanation - Required explanation justifying the appeal
222
+ * @param {File|Blob} params.file - The supporting document file
223
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
224
+ * @throws {Error} Throws an error if required parameters are missing
225
+ * @returns {Promise<Object>} The response from the server
226
+ */
227
+ async submitAppeal({ brandId, appealCategories, explanation, file, options = {} }) {
228
+ this.client._require({ brandId, appealCategories, explanation, file });
229
+ const safeBrandId = encodeURIComponent(brandId);
230
+ const formData = new FormData();
231
+ formData.append("appealCategories", JSON.stringify(appealCategories));
232
+ formData.append("explanation", explanation);
233
+ formData.append("file", file);
234
+ return this.multipartClient(`/brand/appeal/${safeBrandId}`, { method: "POST", body: formData, ...options });
235
+ }
196
236
  }