@signalhousellc/sdk 1.0.27 → 1.0.29

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.29",
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);
@@ -11,6 +11,8 @@ export class Billing {
11
11
  * @param {Object} params - The parameters for filtering the transaction history
12
12
  * @param {string} [params.groupId] - The ID of the group to filter by
13
13
  * @param {string} [params.subgroupId] - The ID of the subgroup to filter by
14
+ * @param {string} [params.brandId] - The brand ID to filter by
15
+ * @param {string} [params.campaignId] - The campaign ID to filter by
14
16
  * @param {string} [params.entryType] - The type of entry to filter by
15
17
  * @param {string} [params.transactionType] - The type of transaction to filter by
16
18
  * @param {string} [params.startDate] - The start date for the filter
@@ -18,8 +20,8 @@ export class Billing {
18
20
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
19
21
  * @returns {Promise<Array>} The response from the server
20
22
  */
21
- async getTransactionHistory({ groupId, subgroupId, entryType, transactionType, startDate, endDate, options = {} }) {
22
- const filters = { groupId, subgroupId, entryType, transactionType, startDate, endDate };
23
+ async getTransactionHistory({ groupId, subgroupId, brandId, campaignId, entryType, transactionType, startDate, endDate, options = {} }) {
24
+ const filters = { groupId, subgroupId, brandId, campaignId, entryType, transactionType, startDate, endDate };
23
25
  const queryString = this.client._getQueryString(filters);
24
26
  return this.client(`/billing/wallet/transactionHistory${queryString}`, { method: "GET", ...options });
25
27
  }
@@ -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
  }
@@ -175,4 +175,36 @@ export class Campaigns {
175
175
  const safeCampaignId = encodeURIComponent(campaignId);
176
176
  return this.client(`/campaign/${safeCampaignId}`, { method: "DELETE", ...options });
177
177
  }
178
+
179
+ /**
180
+ * Appeal a DCA-rejected campaign
181
+ * @async
182
+ * @roles api, admin, developer, billing, user
183
+ * @param {Object} params - The parameters for appealing the campaign rejection
184
+ * @param {string} params.campaignId - The ID of the campaign to appeal
185
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request (body should include { reason })
186
+ * @throws {Error} Throws an error if the campaignId parameter is missing
187
+ * @returns {Promise<Object>} The response from the server
188
+ */
189
+ async appealDcaRejection({ campaignId, options = {} }) {
190
+ this.client._require({ campaignId: campaignId });
191
+ const safeCampaignId = encodeURIComponent(campaignId);
192
+ return this.client(`/campaign/appealDcaRejection/${safeCampaignId}`, { method: "POST", ...options });
193
+ }
194
+
195
+ /**
196
+ * Nudge a connectivity partner to prioritize review of a campaign in PENDING_DCA_APPROVAL status
197
+ * @async
198
+ * @roles api, admin, developer, billing, user
199
+ * @param {Object} params - The parameters for nudging the campaign
200
+ * @param {string} params.campaignId - The ID of the campaign to nudge
201
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
202
+ * @throws {Error} Throws an error if the campaignId parameter is missing
203
+ * @returns {Promise<Object>} The response from the server
204
+ */
205
+ async nudgeDcaForCampaign({ campaignId, options = {} }) {
206
+ this.client._require({ campaignId: campaignId });
207
+ const safeCampaignId = encodeURIComponent(campaignId);
208
+ return this.client(`/campaign/nudge/${safeCampaignId}`, { method: "POST", ...options });
209
+ }
178
210
  }
@@ -91,19 +91,37 @@ export class Numbers {
91
91
  }
92
92
 
93
93
  /**
94
- * Port in a phone number by providing the necessary information for porting. Note: This operation is not currently supported and will throw an error if called.
94
+ * Submit a port-in request for one or more phone numbers from another provider
95
95
  * @async
96
96
  * @roles api, admin, developer, billing, user
97
- * @param {Object} params - The parameters for porting in a phone number
98
- * @param {Object} params.numberData - The data for the phone number to be ported
97
+ * @param {Object} params - The parameters for the port-in request
98
+ * @param {Object} params.numberData - The port-in request data including owner info, address, phone numbers, and signature
99
99
  * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
100
- * @throws {Error} Throws an error indicating that porting is not supported
101
- * @returns {Promise<Object>} A promise that would resolve to the result of the porting operation if it were supported
100
+ * @throws {Error} Throws an error if the numberData parameter is missing
101
+ * @returns {Promise<Object>} A promise that resolves to the created port-in request
102
102
  */
103
103
  async portInPhoneNumber({ numberData, options = {} }) {
104
- throw new Error("Porting phone numbers is not currently supported. Please contact support for assistance.");
105
- // this.client._require({ numberData });
106
- // return this.client(`/number/portin`, { method: "POST", body: numberData, ...options });
104
+ this.client._require({ numberData });
105
+ return this.client(`/number/portin`, { method: "POST", body: numberData, ...options });
106
+ }
107
+
108
+ /**
109
+ * Get port-in requests with optional filters. Signal House staff can view all requests; regular users see only their group's requests.
110
+ * @async
111
+ * @roles api, admin, developer, billing, user
112
+ * @param {Object} [params] - The parameters for filtering port-in requests
113
+ * @param {string} [params.groupId] - Filter by group ID
114
+ * @param {string} [params.phoneNumber] - Filter by phone number
115
+ * @param {string} [params.status] - Filter by status (PENDING, IN_PROGRESS, COMPLETED, REJECTED, CANCELLED)
116
+ * @param {number} [params.page] - The page number for pagination (default: 1)
117
+ * @param {number} [params.limit] - The number of items per page (default: 20)
118
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
119
+ * @returns {Promise<Object>} A promise that resolves to the paginated list of port-in requests
120
+ */
121
+ async getPortRequests({ groupId, phoneNumber, status, page, limit, options = {} } = {}) {
122
+ const filters = { groupId, phoneNumber, status, page, limit };
123
+ const queryString = this.client._getQueryString(filters);
124
+ return this.client(`/number/portin${queryString}`, { method: "GET", ...options });
107
125
  }
108
126
 
109
127
  /**