@unboundcx/sdk 2.6.1 → 2.6.2
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 +37 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
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
|
@@ -597,6 +597,43 @@ export class PhoneNumbersService {
|
|
|
597
597
|
const result = await this.sdk._fetch(url, 'GET');
|
|
598
598
|
return result;
|
|
599
599
|
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Get available activation dates for a porting order
|
|
603
|
+
* - Creates the porting order in external system if not already created
|
|
604
|
+
* - Updates the order data to ensure it's current before fetching dates
|
|
605
|
+
* - Returns list of available activation dates for user selection
|
|
606
|
+
* - Validates that phone numbers and required order details are complete
|
|
607
|
+
* @param {string} id - Porting order ID
|
|
608
|
+
* @returns {Promise<Object>} Available activation dates and order status
|
|
609
|
+
* @example
|
|
610
|
+
* const dates = await sdk.phoneNumbers.getFocWindows("port_123...");
|
|
611
|
+
* // Returns:
|
|
612
|
+
* // {
|
|
613
|
+
* // id: "port_123...",
|
|
614
|
+
* // status: "draft",
|
|
615
|
+
* // availableDates: [
|
|
616
|
+
* // { date: "2025-08-30T00:00:00.000Z", type: "Standard", available: true },
|
|
617
|
+
* // { date: "2025-09-02T00:00:00.000Z", type: "Express", available: true }
|
|
618
|
+
* // ],
|
|
619
|
+
* // phoneNumbersCount: 1,
|
|
620
|
+
* // orderReady: true
|
|
621
|
+
* // }
|
|
622
|
+
*/
|
|
623
|
+
async getFocWindows(id) {
|
|
624
|
+
this.sdk.validateParams(
|
|
625
|
+
{ id },
|
|
626
|
+
{
|
|
627
|
+
id: { type: 'string', required: true },
|
|
628
|
+
},
|
|
629
|
+
);
|
|
630
|
+
|
|
631
|
+
const result = await this.sdk._fetch(
|
|
632
|
+
`/phoneNumbers/porting/orders/${id}/foc-windows`,
|
|
633
|
+
'GET'
|
|
634
|
+
);
|
|
635
|
+
return result;
|
|
636
|
+
}
|
|
600
637
|
}
|
|
601
638
|
|
|
602
639
|
export class PhoneNumberCarrierService {
|