@unboundcx/sdk 2.5.0 → 2.5.1
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 +23 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.1",
|
|
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
|
@@ -500,29 +500,40 @@ export class PhoneNumbersService {
|
|
|
500
500
|
return result;
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
503
|
+
/**
|
|
504
|
+
* Attach or update a document for a porting order
|
|
505
|
+
*
|
|
506
|
+
* @param {Object} params
|
|
507
|
+
* @param {string} params.portingOrderId - Porting order ID
|
|
508
|
+
* @param {string} [params.storageId] - Storage ID of uploaded file (null to clear)
|
|
509
|
+
* @param {string} [params.documentType='loa'] - Document type (loa, bill, csr, etc.)
|
|
510
|
+
* @param {boolean} [params.isRequired=false] - Whether document is required
|
|
511
|
+
* @param {string} [params.documentId] - Optional: Update existing document by ID
|
|
512
|
+
* @returns {Promise<Object>} Document attachment result with action (created/updated)
|
|
513
|
+
*/
|
|
514
|
+
async attachPortingDocument({
|
|
508
515
|
portingOrderId,
|
|
516
|
+
storageId = null,
|
|
517
|
+
documentType = 'loa',
|
|
518
|
+
isRequired = false,
|
|
519
|
+
documentId = null
|
|
509
520
|
}) {
|
|
510
521
|
this.sdk.validateParams(
|
|
511
|
-
{
|
|
522
|
+
{ portingOrderId, documentType },
|
|
512
523
|
{
|
|
513
|
-
|
|
514
|
-
|
|
524
|
+
portingOrderId: { type: 'string', required: true },
|
|
525
|
+
documentType: { type: 'string', required: true },
|
|
515
526
|
},
|
|
516
527
|
);
|
|
517
528
|
|
|
518
529
|
const body = {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
contentType,
|
|
530
|
+
portingOrderId,
|
|
531
|
+
storageId,
|
|
522
532
|
documentType,
|
|
533
|
+
isRequired
|
|
523
534
|
};
|
|
524
535
|
|
|
525
|
-
if (
|
|
536
|
+
if (documentId) body.documentId = documentId;
|
|
526
537
|
|
|
527
538
|
const result = await this.sdk._fetch(
|
|
528
539
|
'/phoneNumbers/porting/documents',
|