@unboundcx/sdk 2.6.7 → 2.6.8

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.6.7",
3
+ "version": "2.6.8",
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",
@@ -761,6 +761,55 @@ export class PhoneNumbersService {
761
761
  );
762
762
  return result;
763
763
  }
764
+
765
+ /**
766
+ * Auto-create porting orders by grouping phone numbers by carrier
767
+ *
768
+ * Analyzes phone numbers using internal LRN lookup, groups them by carrier,
769
+ * and either previews the groupings (dry run) or creates separate porting
770
+ * orders for each carrier group.
771
+ *
772
+ * @param {Object} params
773
+ * @param {string[]} params.phoneNumbers - Array of +E.164 formatted phone numbers (max 100)
774
+ * @param {string} params.name - Base name for orders (will be appended with carrier names)
775
+ * @param {boolean} [params.dryRun=false] - If true, returns preview without creating orders
776
+ * @returns {Promise<Object>} Carrier groups and creation results
777
+ * @example
778
+ * // Preview carrier groupings
779
+ * const preview = await sdk.phoneNumbers.autoCreateOrders({
780
+ * phoneNumbers: ['+15551234567', '+15551234568', '+15551234569'],
781
+ * name: 'Q1 2025 Port',
782
+ * dryRun: true
783
+ * });
784
+ * // Returns carrier groups with proposed order names
785
+ *
786
+ * // Create orders for each carrier
787
+ * const result = await sdk.phoneNumbers.autoCreateOrders({
788
+ * phoneNumbers: ['+15551234567', '+15551234568', '+15551234569'],
789
+ * name: 'Q1 2025 Port',
790
+ * dryRun: false
791
+ * });
792
+ * // Returns created orders and any errors
793
+ */
794
+ async autoCreateOrders({ phoneNumbers, name, dryRun = false }) {
795
+ this.sdk.validateParams(
796
+ { phoneNumbers, name },
797
+ {
798
+ phoneNumbers: { type: 'array', required: true },
799
+ name: { type: 'string', required: true },
800
+ dryRun: { type: 'boolean', required: false },
801
+ },
802
+ );
803
+
804
+ const result = await this.sdk._fetch(
805
+ '/phoneNumbers/porting/auto-create-orders',
806
+ 'POST',
807
+ {
808
+ body: { phoneNumbers, name, dryRun },
809
+ },
810
+ );
811
+ return result;
812
+ }
764
813
  }
765
814
 
766
815
  export class PhoneNumberCarrierService {