@unboundcx/sdk 4.13.12 → 4.13.14

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.13.12",
3
+ "version": "4.13.14",
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",
@@ -13,6 +13,7 @@ export class DocumentTemplatesService {
13
13
  * @param {string[]} [params.uses] - Consumer surfaces (`fax`). Empty = all.
14
14
  * @param {'generative'|'overlay'} [params.engine='generative']
15
15
  * @param {string} [params.sourcePdfStorageId] - Required when engine is overlay
16
+ * @param {Object[]} [params.objects] - `[{objectName, recordTypeIds}]`. Empty/omitted = applies to every object.
16
17
  * @param {Object} [params.draftSchemaJson]
17
18
  * @param {Object} [params.draftLayoutJson]
18
19
  * @param {Object} [params.draftPageJson]
@@ -26,6 +27,7 @@ export class DocumentTemplatesService {
26
27
  uses,
27
28
  engine,
28
29
  sourcePdfStorageId,
30
+ objects,
29
31
  draftSchemaJson,
30
32
  draftLayoutJson,
31
33
  draftPageJson,
@@ -40,6 +42,7 @@ export class DocumentTemplatesService {
40
42
  uses: { type: 'object', required: false },
41
43
  engine: { type: 'string', required: false },
42
44
  sourcePdfStorageId: { type: 'string', required: false },
45
+ objects: { type: 'object', required: false },
43
46
  draftSchemaJson: { type: 'object', required: false },
44
47
  draftLayoutJson: { type: 'object', required: false },
45
48
  draftPageJson: { type: 'object', required: false },
@@ -55,6 +58,7 @@ export class DocumentTemplatesService {
55
58
  if (sourcePdfStorageId !== undefined) {
56
59
  body.sourcePdfStorageId = sourcePdfStorageId;
57
60
  }
61
+ if (objects !== undefined) body.objects = objects;
58
62
  if (draftSchemaJson !== undefined) body.draftSchemaJson = draftSchemaJson;
59
63
  if (draftLayoutJson !== undefined) body.draftLayoutJson = draftLayoutJson;
60
64
  if (draftPageJson !== undefined) body.draftPageJson = draftPageJson;
@@ -69,14 +73,18 @@ export class DocumentTemplatesService {
69
73
  * @param {string} [params.tag]
70
74
  * @param {string} [params.status]
71
75
  * @param {string} [params.use] - Consumer surface (`fax`). Empty uses match all.
76
+ * @param {string} [params.object] - Target object name (e.g. `people`). Filters to templates that apply to it.
77
+ * @param {string} [params.recordTypeId] - Record type within `object`; ignored without `object`.
72
78
  * @param {number} [params.limit]
73
79
  * @returns {Promise<{results: Object[]}>}
74
80
  */
75
- async list({ tag, status, use, limit } = {}) {
81
+ async list({ tag, status, use, object, recordTypeId, limit } = {}) {
76
82
  const query = {};
77
83
  if (tag) query.tag = tag;
78
84
  if (status) query.status = status;
79
85
  if (use) query.use = use;
86
+ if (object) query.object = object;
87
+ if (recordTypeId) query.recordTypeId = recordTypeId;
80
88
  if (limit) query.limit = limit;
81
89
  return internalRequest(this.sdk, '/documents/templates', 'GET', { query });
82
90
  }
@@ -99,6 +107,7 @@ export class DocumentTemplatesService {
99
107
  * @param {string} [params.description]
100
108
  * @param {string} [params.tag]
101
109
  * @param {string[]} [params.uses]
110
+ * @param {Object[]} [params.objects] - `[{objectName, recordTypeIds}]`. Empty/omitted = applies to every object.
102
111
  * @param {Object} [params.draftSchemaJson]
103
112
  * @param {Object} [params.draftLayoutJson]
104
113
  * @param {Object} [params.draftPageJson]
@@ -113,6 +122,7 @@ export class DocumentTemplatesService {
113
122
  tag,
114
123
  uses,
115
124
  recordTypeId,
125
+ objects,
116
126
  draftSchemaJson,
117
127
  draftLayoutJson,
118
128
  draftPageJson,
@@ -128,6 +138,7 @@ export class DocumentTemplatesService {
128
138
  tag: { type: 'string', required: false },
129
139
  uses: { type: 'object', required: false },
130
140
  recordTypeId: { type: 'string', required: false },
141
+ objects: { type: 'object', required: false },
131
142
  draftSchemaJson: { type: 'object', required: false },
132
143
  draftLayoutJson: { type: 'object', required: false },
133
144
  draftPageJson: { type: 'object', required: false },
@@ -141,6 +152,7 @@ export class DocumentTemplatesService {
141
152
  if (tag !== undefined) body.tag = tag;
142
153
  if (uses !== undefined) body.uses = uses;
143
154
  if (recordTypeId !== undefined) body.recordTypeId = recordTypeId;
155
+ if (objects !== undefined) body.objects = objects;
144
156
  if (draftSchemaJson !== undefined) body.draftSchemaJson = draftSchemaJson;
145
157
  if (draftLayoutJson !== undefined) body.draftLayoutJson = draftLayoutJson;
146
158
  if (draftPageJson !== undefined) body.draftPageJson = draftPageJson;
package/services/voice.js CHANGED
@@ -51,9 +51,27 @@ export class VoiceService {
51
51
  return result;
52
52
  }
53
53
 
54
- async call({ to, from, destination, app, timeout, customHeaders, statusWebhook }) {
54
+ async call({
55
+ to,
56
+ from,
57
+ destination,
58
+ app,
59
+ timeout,
60
+ customHeaders,
61
+ statusWebhook,
62
+ parentCallId,
63
+ }) {
55
64
  this.sdk.validateParams(
56
- { to, from, destination, app, timeout, customHeaders, statusWebhook },
65
+ {
66
+ to,
67
+ from,
68
+ destination,
69
+ app,
70
+ timeout,
71
+ customHeaders,
72
+ statusWebhook,
73
+ parentCallId,
74
+ },
57
75
  {
58
76
  to: { type: 'string', required: true },
59
77
  from: { type: 'string', required: true },
@@ -65,6 +83,11 @@ export class VoiceService {
65
83
  // events (trying/ringing/answered/failed) with `static` fields
66
84
  // merged into each POST body
67
85
  statusWebhook: { type: 'object', required: false },
86
+ // SIP call id of an in-progress call this outbound leg is placed on
87
+ // behalf of (e.g. task-router ringing an agent for a queued caller).
88
+ // Links the leg as a child so sip-processor cascade-cancels it if
89
+ // that caller hangs up while it's still ringing.
90
+ parentCallId: { type: 'string', required: false },
68
91
  },
69
92
  );
70
93
 
@@ -77,6 +100,7 @@ export class VoiceService {
77
100
  timeout,
78
101
  customHeaders,
79
102
  statusWebhook,
103
+ parentCallId,
80
104
  },
81
105
  };
82
106