@unboundcx/sdk 4.1.2 → 4.4.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 +30 -0
- package/index.js +3 -0
- package/package.json +16 -3
- 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 +38 -0
- package/schemas/layouts/relatedList.js +48 -0
- package/schemas/layouts/section.js +100 -0
- package/schemas/layouts/selectDynamic.js +40 -0
- package/schemas/layouts/validate.js +18 -0
- package/services/layouts.js +142 -1
- package/services/permissions.js +377 -0
package/README.md
CHANGED
|
@@ -176,6 +176,36 @@ await api.objects.describe('contacts'); // Get schema
|
|
|
176
176
|
await api.objects.list(); // List all object types
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
#### Live Queries (`api.objects.liveQuery`)
|
|
180
|
+
|
|
181
|
+
Real-time, server-evaluated subscriptions over App1 Database objects. The
|
|
182
|
+
server matches every mutation against your filter and pushes only relevant
|
|
183
|
+
events — no client-side polling or firehose filtering.
|
|
184
|
+
|
|
185
|
+
```javascript
|
|
186
|
+
const handle = await api.objects.liveQuery({
|
|
187
|
+
socket, // an authed socket.io-client instance (required until the SDK ships its own transport)
|
|
188
|
+
object: 'contacts',
|
|
189
|
+
filter: { companyId: 'company-123' }, // bare value = equals; 'op::term' strings for other operators
|
|
190
|
+
onEvent: (frame) => {
|
|
191
|
+
// frame.type: 'enter' | 'change' | 'leave' | 'refresh' | 'resync' | 'revoked'
|
|
192
|
+
// 'enter' -> frame.record (full row now matches your filter)
|
|
193
|
+
// 'change' -> frame.changedFields ONLY (patch, never the full row)
|
|
194
|
+
// 'leave' -> frame.recordId no longer matches (or was deleted)
|
|
195
|
+
// 'refresh'/'resync' -> re-run your query (coarse mode or gap recovery)
|
|
196
|
+
},
|
|
197
|
+
onStateChange: (state) => {}, // 'active' | 'resubscribing' | 'revoked'
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
handle.unsubscribe(); // always tear down when done
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Notes: the resolved `handle.mode` is `'fine'` (row-level events) or
|
|
204
|
+
`'coarse'` (debounced refresh hints — used when the filter isn't
|
|
205
|
+
row-evaluable). Heartbeats, reconnect-resubscribe, and sequence-gap resync
|
|
206
|
+
are handled internally. Server caps: 25 subscriptions per socket, 500 per
|
|
207
|
+
account.
|
|
208
|
+
|
|
179
209
|
#### Messaging (`api.messaging`)
|
|
180
210
|
|
|
181
211
|
```javascript
|
package/index.js
CHANGED
|
@@ -27,6 +27,7 @@ import { EngagementMetricsService } from './services/engagementMetrics.js';
|
|
|
27
27
|
import { TaskRouterService } from './services/taskRouter.js';
|
|
28
28
|
import { KnowledgeBaseService } from './services/knowledgeBase.js';
|
|
29
29
|
import { FaxService } from './services/fax.js';
|
|
30
|
+
import { PermissionsService } from './services/permissions.js';
|
|
30
31
|
|
|
31
32
|
class UnboundSDK extends BaseSDK {
|
|
32
33
|
constructor(options = {}) {
|
|
@@ -95,6 +96,7 @@ class UnboundSDK extends BaseSDK {
|
|
|
95
96
|
this.taskRouter = new TaskRouterService(this);
|
|
96
97
|
this.knowledgeBase = new KnowledgeBaseService(this);
|
|
97
98
|
this.fax = new FaxService(this);
|
|
99
|
+
this.permissions = new PermissionsService(this);
|
|
98
100
|
|
|
99
101
|
// Add additional services that might be missing
|
|
100
102
|
this._initializeAdditionalServices();
|
|
@@ -274,4 +276,5 @@ export { TaskRouterService } from './services/taskRouter.js';
|
|
|
274
276
|
export { WorkerService } from './services/taskRouter/WorkerService.js';
|
|
275
277
|
export { KnowledgeBaseService } from './services/knowledgeBase.js';
|
|
276
278
|
export { FaxService } from './services/fax.js';
|
|
279
|
+
export { PermissionsService } from './services/permissions.js';
|
|
277
280
|
export { BaseSDK } from './base.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unboundcx/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.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,15 +57,24 @@
|
|
|
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
79
|
"mime-types": "^2.1.35",
|
|
69
80
|
"@grpc/grpc-js": "^1.14.1",
|
|
@@ -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",
|