@unboundcx/sdk 2.4.0 → 2.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unboundcx/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.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",
@@ -452,6 +452,36 @@ export class PhoneNumbersService {
452
452
  return result;
453
453
  }
454
454
 
455
+ /**
456
+ * Remove a specific phone number from a porting order
457
+ * - Only works on draft orders (not submitted orders)
458
+ * - Cannot remove the last phone number (delete entire order instead)
459
+ * - Validates that phone number exists in the order
460
+ * @param {string} portingOrderId - Porting order ID
461
+ * @param {string} phoneNumber - Phone number to remove (+E.164 format)
462
+ * @returns {Promise<Object>} Removal confirmation with updated counts
463
+ * @example
464
+ * await sdk.phoneNumbers.removePhoneNumberFromOrder(
465
+ * "port_123...",
466
+ * "+15551234567"
467
+ * );
468
+ */
469
+ async removePhoneNumberFromOrder(portingOrderId, phoneNumber) {
470
+ this.sdk.validateParams(
471
+ { portingOrderId, phoneNumber },
472
+ {
473
+ portingOrderId: { type: 'string', required: true },
474
+ phoneNumber: { type: 'string', required: true },
475
+ },
476
+ );
477
+
478
+ const result = await this.sdk._fetch(
479
+ `/phoneNumbers/porting/orders/${encodeURIComponent(portingOrderId)}/numbers/${encodeURIComponent(phoneNumber)}`,
480
+ 'DELETE'
481
+ );
482
+ return result;
483
+ }
484
+
455
485
  async uploadPortingDocument({
456
486
  filename,
457
487
  fileContent,