@signalhousellc/sdk 1.0.28 → 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 +1 -1
- package/src/domains/Billing.js +4 -2
- package/src/domains/Campaigns.js +32 -0
- package/src/domains/Numbers.js +26 -8
package/package.json
CHANGED
package/src/domains/Billing.js
CHANGED
|
@@ -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
|
}
|
package/src/domains/Campaigns.js
CHANGED
|
@@ -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
|
}
|
package/src/domains/Numbers.js
CHANGED
|
@@ -91,19 +91,37 @@ export class Numbers {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
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
|
|
98
|
-
* @param {Object} params.numberData - The data
|
|
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
|
|
101
|
-
* @returns {Promise<Object>} A promise that
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
/**
|