@unboundcx/sdk 2.2.5 → 2.2.6
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/services/phoneNumbers.js +22 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "Official JavaScript SDK for the Unbound API - A comprehensive toolkit for integrating with Unbound's communication, AI, and data management services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/services/phoneNumbers.js
CHANGED
|
@@ -220,11 +220,8 @@ export class PhoneNumbersService {
|
|
|
220
220
|
activationSettings,
|
|
221
221
|
webhookUrl,
|
|
222
222
|
...additionalData
|
|
223
|
-
}) {
|
|
224
|
-
|
|
225
|
-
throw new Error('Either phoneNumbers or phoneNumberBlocks is required');
|
|
226
|
-
}
|
|
227
|
-
|
|
223
|
+
} = {}) {
|
|
224
|
+
// No validation - creates draft order that can be built incrementally
|
|
228
225
|
const body = {
|
|
229
226
|
...additionalData
|
|
230
227
|
};
|
|
@@ -299,6 +296,26 @@ export class PhoneNumbersService {
|
|
|
299
296
|
return result;
|
|
300
297
|
}
|
|
301
298
|
|
|
299
|
+
async submitPortingOrder(id, submissionData = {}) {
|
|
300
|
+
this.sdk.validateParams(
|
|
301
|
+
{ id },
|
|
302
|
+
{
|
|
303
|
+
id: { type: 'string', required: true },
|
|
304
|
+
},
|
|
305
|
+
);
|
|
306
|
+
|
|
307
|
+
// Add the submit status to trigger validation and Telnyx submission
|
|
308
|
+
const body = {
|
|
309
|
+
...submissionData,
|
|
310
|
+
status: 'submit'
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
const result = await this.sdk._fetch(`/phoneNumbers/porting/orders/${id}`, 'PUT', {
|
|
314
|
+
body: body
|
|
315
|
+
});
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
|
|
302
319
|
async uploadPortingDocument({
|
|
303
320
|
filename,
|
|
304
321
|
fileContent,
|