@signalhousellc/sdk 1.0.9 → 1.0.11

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": "@signalhousellc/sdk",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Signal House SDK for use with the Signal House platform",
5
5
  "type": "module",
6
6
  "main": "src/SignalHouseSDK.js",
@@ -62,9 +62,34 @@ export class Numbers {
62
62
  */
63
63
  async purchasePhoneNumber({ phoneNumbers, subgroupId, options = {} }) {
64
64
  this.client._require({ phoneNumbers, subgroupId });
65
- return this.client(`/number/`, { method: "POST", body: { phoneNumbers, subgroupId }, ...options });
65
+ return this.client(`/number`, { method: "POST", body: { phoneNumbers, subgroupId }, ...options });
66
66
  }
67
67
 
68
+ /**
69
+ * Update an existing phone number's details (e.g., setting a friendly name)
70
+ * @async
71
+ * @roles api, admin, developer, user
72
+ * @param {Object} params - The parameters for updating the phone number
73
+ * @param {string} params.phoneNumber - The phone number to update
74
+ * @param {Object} params.updateData - The data to update for the phone number
75
+ * @param {string} [params.updateData.friendlyName] - An optional friendly name for the phone number
76
+ * @param {import('../SignalHouseSDK').RequestOptions} [params.options] - Additional options for the request
77
+ * @throws {Error} Throws an error if the phoneNumber or updateData parameter is missing
78
+ * @returns {Promise<Object>} A promise that resolves to the updated phone number object
79
+ */
80
+ async updatePhoneNumber({ phoneNumber, updateData, options = {} }) {
81
+ this.client._require({ phoneNumber, updateData });
82
+
83
+ // Safely encode the phone number for the URL path
84
+ const safePhoneNumber = encodeURIComponent(phoneNumber);
85
+
86
+ return this.client(`/number/${safePhoneNumber}`, {
87
+ method: "PUT",
88
+ body: updateData,
89
+ ...options
90
+ });
91
+ }
92
+
68
93
  /**
69
94
  * Port in a phone number by providing the necessary information for porting. Note: This operation is not currently supported and will throw an error if called.
70
95
  * @async