@unboundcx/sdk 4.13.11 → 4.13.13

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.11",
3
+ "version": "4.13.13",
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",
@@ -17,6 +17,7 @@ export const LayoutDoc = z.object({
17
17
  sections: z.array(SectionSpec).default([]),
18
18
  feeds: ToggleSpec.optional(),
19
19
  notes: ToggleSpec.optional(),
20
+ email: ToggleSpec.optional(),
20
21
  aiInsights: ToggleSpec.optional(),
21
22
  aiGoals: ToggleSpec.optional(),
22
23
  googleDrive: z.object({
@@ -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;