@unboundcx/sdk 4.1.3 → 4.2.0
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/README.md +36 -0
- package/package.json +18 -5
- package/schemas/layouts/SCHEMA.md +5100 -0
- package/schemas/layouts/action.js +17 -0
- package/schemas/layouts/compact.js +11 -0
- package/schemas/layouts/field.js +103 -0
- package/schemas/layouts/format.js +23 -0
- package/schemas/layouts/index.js +16 -0
- package/schemas/layouts/join.js +33 -0
- package/schemas/layouts/kanban.js +94 -0
- package/schemas/layouts/layoutDoc.js +35 -0
- package/schemas/layouts/migrations/deriveActions.js +70 -0
- package/schemas/layouts/migrations/deriveCompactFields.js +19 -0
- package/schemas/layouts/migrations/index.js +43 -0
- package/schemas/layouts/migrations/migrateV1toV2.js +162 -0
- package/schemas/layouts/migrations/normalizeJoin.js +44 -0
- package/schemas/layouts/migrations/normalizeKanban.js +54 -0
- package/schemas/layouts/migrations/promoteRelatedLists.js +67 -0
- package/schemas/layouts/primitives.js +44 -0
- package/schemas/layouts/relatedList.js +48 -0
- package/schemas/layouts/section.js +104 -0
- package/schemas/layouts/selectDynamic.js +40 -0
- package/schemas/layouts/validate.js +18 -0
- package/services/layouts.js +142 -1
- package/services/liveQuery.js +26 -5
- package/services/objects.js +2 -0
package/README.md
CHANGED
|
@@ -206,6 +206,42 @@ row-evaluable). Heartbeats, reconnect-resubscribe, and sequence-gap resync
|
|
|
206
206
|
are handled internally. Server caps: 25 subscriptions per socket, 500 per
|
|
207
207
|
account.
|
|
208
208
|
|
|
209
|
+
**UOQL form** — pass a `uoql` string instead of `object`/`filter`/`fields`/
|
|
210
|
+
`recordTypeId` (mutually exclusive; the SDK throws synchronously if both, or
|
|
211
|
+
neither, are given). The server parses and classifies the query for you:
|
|
212
|
+
|
|
213
|
+
```javascript
|
|
214
|
+
// Simple single-object query with a flat WHERE -> classifies FINE, same
|
|
215
|
+
// row-level 'enter'/'change'/'leave' events as the object/filter form above.
|
|
216
|
+
const handle = await api.objects.liveQuery({
|
|
217
|
+
socket,
|
|
218
|
+
uoql: "SELECT id, name, status FROM contacts WHERE companyId = 'company-123'",
|
|
219
|
+
onEvent: (frame) => {},
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
// Relationship paths / aggregates -> classifies COARSE: you only get
|
|
223
|
+
// debounced 'refresh' hints (no row-level frames), so re-run the query
|
|
224
|
+
// yourself each time onEvent fires with frame.type === 'refresh'.
|
|
225
|
+
// (UOQL expresses joins as dot-notation relationship paths, not JOIN syntax.)
|
|
226
|
+
const relatedUoql =
|
|
227
|
+
"SELECT name, companyId.name FROM contacts WHERE companyId.industry = 'tech'";
|
|
228
|
+
const relatedHandle = await api.objects.liveQuery({
|
|
229
|
+
socket,
|
|
230
|
+
uoql: relatedUoql,
|
|
231
|
+
onEvent: async (frame) => {
|
|
232
|
+
if (frame.type === 'refresh' || frame.type === 'resync') {
|
|
233
|
+
const results = await api.objects.queryV2({ query: relatedUoql });
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
relatedHandle.unsubscribe();
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Resubscribe-on-reconnect re-sends the same `uoql` string verbatim, so the
|
|
242
|
+
server re-classifies it fresh each time (mode can't drift out from under a
|
|
243
|
+
long-lived handle).
|
|
244
|
+
|
|
209
245
|
#### Messaging (`api.messaging`)
|
|
210
246
|
|
|
211
247
|
```javascript
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
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",
|
|
@@ -42,6 +42,8 @@
|
|
|
42
42
|
"transports/**/*.js",
|
|
43
43
|
"types/**/*.d.ts",
|
|
44
44
|
"proto/**/*.proto",
|
|
45
|
+
"schemas/**/*.js",
|
|
46
|
+
"schemas/**/*.md",
|
|
45
47
|
"README.md",
|
|
46
48
|
"LICENSE"
|
|
47
49
|
],
|
|
@@ -55,19 +57,28 @@
|
|
|
55
57
|
},
|
|
56
58
|
"./services/*": {
|
|
57
59
|
"import": "./services/*.js"
|
|
60
|
+
},
|
|
61
|
+
"./schemas/layouts": {
|
|
62
|
+
"import": "./schemas/layouts/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./schemas/*": {
|
|
65
|
+
"import": "./schemas/*.js"
|
|
58
66
|
}
|
|
59
67
|
},
|
|
60
68
|
"scripts": {
|
|
61
69
|
"build": "echo 'Build complete - ESM modules ready'",
|
|
62
70
|
"test": "node --test 'test/*.test.js'",
|
|
63
71
|
"lint": "echo 'Linting would run here'",
|
|
72
|
+
"docs:layouts": "node scripts/generate-layout-schema-docs.js",
|
|
64
73
|
"prepublishOnly": "npm run build"
|
|
65
74
|
},
|
|
66
|
-
"dependencies": {
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"zod": "^3.23.8"
|
|
77
|
+
},
|
|
67
78
|
"optionalDependencies": {
|
|
68
|
-
"mime-types": "^2.1.35",
|
|
69
79
|
"@grpc/grpc-js": "^1.14.1",
|
|
70
|
-
"@grpc/proto-loader": "^0.7.15"
|
|
80
|
+
"@grpc/proto-loader": "^0.7.15",
|
|
81
|
+
"mime-types": "^2.1.35"
|
|
71
82
|
},
|
|
72
83
|
"peerDependencies": {
|
|
73
84
|
"socket.io-client": "^4.0.0"
|
|
@@ -77,7 +88,9 @@
|
|
|
77
88
|
"optional": true
|
|
78
89
|
}
|
|
79
90
|
},
|
|
80
|
-
"devDependencies": {
|
|
91
|
+
"devDependencies": {
|
|
92
|
+
"zod-to-json-schema": "^3.23.0"
|
|
93
|
+
},
|
|
81
94
|
"browserslist": [
|
|
82
95
|
"defaults",
|
|
83
96
|
"not IE 11",
|