@unboundcx/sdk 4.13.137 → 4.13.138
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 +24 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.138",
|
|
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
|
@@ -189,27 +189,44 @@ export class PhoneNumbersService {
|
|
|
189
189
|
return result;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
async updateCnam(
|
|
192
|
+
async updateCnam(id, { enabled, name }) {
|
|
193
193
|
this.sdk.validateParams(
|
|
194
|
-
{
|
|
194
|
+
{ id, enabled, name },
|
|
195
195
|
{
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
id: { type: 'string', required: true },
|
|
197
|
+
enabled: { type: 'boolean', required: true },
|
|
198
|
+
name: { type: 'string', required: false },
|
|
198
199
|
},
|
|
199
200
|
);
|
|
200
201
|
|
|
201
202
|
const params = {
|
|
202
|
-
body: {
|
|
203
|
+
body: { enabled, ...(name !== undefined ? { name } : {}) },
|
|
203
204
|
};
|
|
204
205
|
|
|
205
|
-
const result = await internalRequest(this.sdk,
|
|
206
|
-
`/phoneNumbers
|
|
206
|
+
const result = await internalRequest(this.sdk,
|
|
207
|
+
`/phoneNumbers/${id}/cnam`,
|
|
207
208
|
'PUT',
|
|
208
209
|
params,
|
|
209
210
|
);
|
|
210
211
|
return result;
|
|
211
212
|
}
|
|
212
213
|
|
|
214
|
+
async checkCnam(id) {
|
|
215
|
+
this.sdk.validateParams(
|
|
216
|
+
{ id },
|
|
217
|
+
{
|
|
218
|
+
id: { type: 'string', required: true },
|
|
219
|
+
},
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
const result = await internalRequest(this.sdk,
|
|
223
|
+
`/phoneNumbers/${id}/cnam/check`,
|
|
224
|
+
'POST',
|
|
225
|
+
{},
|
|
226
|
+
);
|
|
227
|
+
return result;
|
|
228
|
+
}
|
|
229
|
+
|
|
213
230
|
async format(number) {
|
|
214
231
|
this.sdk.validateParams(
|
|
215
232
|
{ number },
|