@unboundcx/sdk 4.8.3 → 4.8.5

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": "4.8.3",
3
+ "version": "4.8.5",
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/inbox.js CHANGED
@@ -91,4 +91,24 @@ export class InboxService {
91
91
  const result = await this.sdk._fetch('/inbox/stats', 'GET');
92
92
  return result;
93
93
  }
94
+
95
+ /**
96
+ * Trigger transcription for a voicemail that has a recording but no
97
+ * transcript (fire-and-forget server-side; poll the record for the
98
+ * resulting `transcription` / `transcriptionStatus`).
99
+ *
100
+ * @param {string} voicemailMessageId
101
+ * @returns {Promise<{accepted?: boolean, skipped?: boolean}>}
102
+ */
103
+ async transcribeVoicemail(voicemailMessageId) {
104
+ this.sdk.validateParams(
105
+ { voicemailMessageId },
106
+ { voicemailMessageId: { type: 'string', required: true } },
107
+ );
108
+ return await this.sdk._fetch(
109
+ `/inbox/voicemail/${voicemailMessageId}/transcribe`,
110
+ 'POST',
111
+ { body: {} },
112
+ );
113
+ }
94
114
  }
@@ -436,6 +436,58 @@ export class ObjectsService {
436
436
  return result;
437
437
  }
438
438
 
439
+ /**
440
+ * List saved list-views for an object (system + shared + own).
441
+ * @param {Object} params
442
+ * @param {string} params.objectName - Object the views belong to.
443
+ * @returns {Promise<{results: Object[]}>}
444
+ */
445
+ async listViews({ objectName }) {
446
+ this.sdk.validateParams(
447
+ { objectName },
448
+ { objectName: { type: 'string', required: true } },
449
+ );
450
+ return await this.sdk._fetch('/object/views', 'GET', {
451
+ query: { objectName },
452
+ });
453
+ }
454
+
455
+ /**
456
+ * Create a saved list-view.
457
+ * @param {Object} params
458
+ * @param {string} params.objectName
459
+ * @param {string} params.name
460
+ * @param {Array} params.filters
461
+ * @param {string} [params.visibility] - 'user' (default) or 'shared'.
462
+ * @returns {Promise<Object>}
463
+ */
464
+ async createView({ objectName, name, filters, visibility }) {
465
+ this.sdk.validateParams(
466
+ { objectName, name, filters },
467
+ {
468
+ objectName: { type: 'string', required: true },
469
+ name: { type: 'string', required: true },
470
+ filters: { type: 'array', required: true },
471
+ },
472
+ );
473
+ const body = { objectName, name, filters };
474
+ if (visibility !== undefined) body.visibility = visibility;
475
+ return await this.sdk._fetch('/object/views', 'POST', { body });
476
+ }
477
+
478
+ /**
479
+ * Delete a saved list-view by id.
480
+ * @param {string} viewId
481
+ * @returns {Promise<Object>}
482
+ */
483
+ async deleteView(viewId) {
484
+ this.sdk.validateParams(
485
+ { viewId },
486
+ { viewId: { type: 'string', required: true } },
487
+ );
488
+ return await this.sdk._fetch(`/object/views/${viewId}`, 'DELETE');
489
+ }
490
+
439
491
  async botSchema() {
440
492
  const result = await this.sdk._fetch(
441
493
  '/object/manage/bot-schema',