esoul-sdk 0.3.0 → 0.6.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 +135 -24
- package/dist/audience.d.ts +103 -0
- package/dist/audience.js +142 -0
- package/dist/bindings.d.ts +164 -0
- package/dist/bindings.js +163 -0
- package/dist/db/client-core.d.ts +154 -0
- package/dist/db/client-core.js +274 -0
- package/dist/db/compile-rules.d.ts +199 -0
- package/dist/db/compile-rules.js +390 -0
- package/dist/db/memory-client.d.ts +136 -0
- package/dist/db/memory-client.js +323 -0
- package/dist/db/schema-gen.d.ts +103 -0
- package/dist/db/schema-gen.js +329 -0
- package/dist/helpers.d.ts +67 -0
- package/dist/helpers.js +125 -8
- package/dist/index.d.ts +24 -0
- package/dist/index.js +22 -0
- package/dist/manifest.d.ts +445 -13
- package/dist/manifest.js +211 -5
- package/dist/react.d.ts +29 -0
- package/dist/react.js +10 -0
- package/dist/roles.d.ts +43 -0
- package/dist/roles.js +56 -0
- package/dist/server.d.ts +165 -0
- package/dist/server.js +80 -0
- package/dist/testing/db.d.ts +69 -0
- package/dist/testing/db.js +94 -0
- package/dist/testing/index.d.ts +14 -0
- package/dist/testing/index.js +9 -0
- package/dist/testing/ops.d.ts +84 -0
- package/dist/testing/ops.js +76 -0
- package/dist/types.d.ts +22 -1
- package/docs/04-tools.md +5 -2
- package/docs/05-ui.md +30 -0
- package/docs/06-server.md +49 -0
- package/docs/07-background-tasks.md +29 -3
- package/docs/10-testing.md +18 -0
- package/docs/12-rules.md +3 -2
- package/docs/13-people-and-access.md +148 -0
- package/docs/14-database.md +115 -0
- package/docs/15-realtime.md +88 -0
- package/docs/16-bindings.md +79 -0
- package/llms-full.txt +715 -31
- package/llms.txt +4 -0
- package/package.json +7 -3
- package/schemas/plugin.schema.json +323 -9
package/llms.txt
CHANGED
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
- docs/10-testing.md — Testing — the fold contract as tests
|
|
19
19
|
- docs/11-shipping.md — Shipping — submit, review, release, install
|
|
20
20
|
- docs/12-rules.md — Rules and failures — every rule with the failure that earned it
|
|
21
|
+
- docs/13-people-and-access.md — # 13 · People and access
|
|
22
|
+
- docs/14-database.md — # 14 · Your own tables
|
|
23
|
+
- docs/15-realtime.md — # 15 · Realtime, and who hears it
|
|
24
|
+
- docs/16-bindings.md — # 16 · Bindings — leaning on another app
|
|
21
25
|
|
|
22
26
|
The one rule behind the others: events are the truth — pure idempotent processors, ids minted in
|
|
23
27
|
dataCreators, collapse keys on bursts, and an app reaches the platform only through esoul-sdk.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esoul-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Build ExternalSoul
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "Build a full product on ExternalSoul: your own tables with per-person rules, a viewer on every seam, app roles, access levels, realtime with audiences, durable tasks, and bindings to other apps.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -66,7 +66,11 @@
|
|
|
66
66
|
"plugin",
|
|
67
67
|
"sdk",
|
|
68
68
|
"agent",
|
|
69
|
-
"event-sourcing"
|
|
69
|
+
"event-sourcing",
|
|
70
|
+
"full-stack",
|
|
71
|
+
"multi-tenant",
|
|
72
|
+
"access-control",
|
|
73
|
+
"realtime"
|
|
70
74
|
],
|
|
71
75
|
"repository": {
|
|
72
76
|
"type": "git",
|
|
@@ -58,10 +58,40 @@
|
|
|
58
58
|
"additionalProperties": false
|
|
59
59
|
},
|
|
60
60
|
"kickableTasks": {
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
"anyOf": [
|
|
62
|
+
{
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"pattern": "^[a-z][a-zA-Z0-9_-]*$"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"properties": {
|
|
74
|
+
"access": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": [
|
|
77
|
+
"write",
|
|
78
|
+
"read",
|
|
79
|
+
"public"
|
|
80
|
+
],
|
|
81
|
+
"default": "write"
|
|
82
|
+
},
|
|
83
|
+
"requires": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"const": "account"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
},
|
|
90
|
+
"propertyNames": {
|
|
91
|
+
"pattern": "^[a-z][a-zA-Z0-9_-]*$"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
],
|
|
65
95
|
"default": []
|
|
66
96
|
},
|
|
67
97
|
"webhooks": {
|
|
@@ -73,11 +103,77 @@
|
|
|
73
103
|
"default": []
|
|
74
104
|
},
|
|
75
105
|
"ops": {
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
"anyOf": [
|
|
107
|
+
{
|
|
108
|
+
"type": "array",
|
|
109
|
+
"items": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "object",
|
|
116
|
+
"additionalProperties": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"access": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"enum": [
|
|
122
|
+
"write",
|
|
123
|
+
"read",
|
|
124
|
+
"public"
|
|
125
|
+
],
|
|
126
|
+
"default": "write"
|
|
127
|
+
},
|
|
128
|
+
"requires": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"const": "account"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"additionalProperties": false
|
|
134
|
+
},
|
|
135
|
+
"propertyNames": {
|
|
136
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"default": []
|
|
141
|
+
},
|
|
142
|
+
"routes": {
|
|
143
|
+
"anyOf": [
|
|
144
|
+
{
|
|
145
|
+
"type": "array",
|
|
146
|
+
"items": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"access": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"enum": [
|
|
159
|
+
"write",
|
|
160
|
+
"read",
|
|
161
|
+
"public"
|
|
162
|
+
],
|
|
163
|
+
"default": "write"
|
|
164
|
+
},
|
|
165
|
+
"requires": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"const": "account"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"additionalProperties": false
|
|
171
|
+
},
|
|
172
|
+
"propertyNames": {
|
|
173
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
],
|
|
81
177
|
"default": []
|
|
82
178
|
},
|
|
83
179
|
"pollTasks": {
|
|
@@ -126,6 +222,56 @@
|
|
|
126
222
|
},
|
|
127
223
|
"default": []
|
|
128
224
|
},
|
|
225
|
+
"roles": {
|
|
226
|
+
"type": "object",
|
|
227
|
+
"properties": {
|
|
228
|
+
"vocabulary": {
|
|
229
|
+
"type": "array",
|
|
230
|
+
"items": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
233
|
+
},
|
|
234
|
+
"minItems": 1,
|
|
235
|
+
"maxItems": 12
|
|
236
|
+
},
|
|
237
|
+
"default": {
|
|
238
|
+
"type": "object",
|
|
239
|
+
"properties": {
|
|
240
|
+
"owner": {
|
|
241
|
+
"type": "string"
|
|
242
|
+
},
|
|
243
|
+
"member-edit": {
|
|
244
|
+
"type": "string"
|
|
245
|
+
},
|
|
246
|
+
"member-readonly": {
|
|
247
|
+
"type": "string"
|
|
248
|
+
},
|
|
249
|
+
"visitor": {
|
|
250
|
+
"type": "string"
|
|
251
|
+
},
|
|
252
|
+
"anonymous": {
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
"agent": {
|
|
256
|
+
"type": "string"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"additionalProperties": false,
|
|
260
|
+
"default": {}
|
|
261
|
+
},
|
|
262
|
+
"describe": {
|
|
263
|
+
"type": "object",
|
|
264
|
+
"additionalProperties": {
|
|
265
|
+
"type": "string",
|
|
266
|
+
"maxLength": 200
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"required": [
|
|
271
|
+
"vocabulary"
|
|
272
|
+
],
|
|
273
|
+
"additionalProperties": false
|
|
274
|
+
},
|
|
129
275
|
"workspaceTools": {
|
|
130
276
|
"type": "array",
|
|
131
277
|
"items": {
|
|
@@ -245,6 +391,174 @@
|
|
|
245
391
|
"additionalProperties": false
|
|
246
392
|
},
|
|
247
393
|
"default": []
|
|
394
|
+
},
|
|
395
|
+
"uses": {
|
|
396
|
+
"type": "object",
|
|
397
|
+
"additionalProperties": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"properties": {
|
|
400
|
+
"contract": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"pattern": "^[a-z][a-z0-9-]*\\/v\\d+$"
|
|
403
|
+
},
|
|
404
|
+
"label": {
|
|
405
|
+
"type": "string",
|
|
406
|
+
"minLength": 1,
|
|
407
|
+
"maxLength": 60
|
|
408
|
+
},
|
|
409
|
+
"optional": {
|
|
410
|
+
"type": "boolean"
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
"required": [
|
|
414
|
+
"contract"
|
|
415
|
+
],
|
|
416
|
+
"additionalProperties": false
|
|
417
|
+
},
|
|
418
|
+
"propertyNames": {
|
|
419
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"provides": {
|
|
423
|
+
"type": "object",
|
|
424
|
+
"additionalProperties": {
|
|
425
|
+
"type": "object",
|
|
426
|
+
"properties": {
|
|
427
|
+
"tools": {
|
|
428
|
+
"type": "array",
|
|
429
|
+
"items": {
|
|
430
|
+
"type": "string"
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
"events": {
|
|
434
|
+
"type": "array",
|
|
435
|
+
"items": {
|
|
436
|
+
"type": "string"
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
"models": {
|
|
440
|
+
"type": "array",
|
|
441
|
+
"items": {
|
|
442
|
+
"type": "string"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
"additionalProperties": false
|
|
447
|
+
},
|
|
448
|
+
"propertyNames": {
|
|
449
|
+
"pattern": "^[a-z][a-z0-9-]*\\/v\\d+$"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"channel": {
|
|
453
|
+
"type": "object",
|
|
454
|
+
"properties": {
|
|
455
|
+
"topics": {
|
|
456
|
+
"type": "object",
|
|
457
|
+
"additionalProperties": {
|
|
458
|
+
"type": "object",
|
|
459
|
+
"properties": {
|
|
460
|
+
"audience": {
|
|
461
|
+
"anyOf": [
|
|
462
|
+
{
|
|
463
|
+
"type": "string",
|
|
464
|
+
"const": "all"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"type": "string",
|
|
468
|
+
"const": "viewer"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"type": "string",
|
|
472
|
+
"pattern": "^role:[a-z][a-z0-9-]*$"
|
|
473
|
+
}
|
|
474
|
+
]
|
|
475
|
+
},
|
|
476
|
+
"mayAddress": {
|
|
477
|
+
"type": "array",
|
|
478
|
+
"items": {
|
|
479
|
+
"type": "string"
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
"description": {
|
|
483
|
+
"type": "string",
|
|
484
|
+
"maxLength": 200
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"additionalProperties": false
|
|
488
|
+
},
|
|
489
|
+
"propertyNames": {
|
|
490
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"required": [
|
|
495
|
+
"topics"
|
|
496
|
+
],
|
|
497
|
+
"additionalProperties": false
|
|
498
|
+
},
|
|
499
|
+
"db": {
|
|
500
|
+
"type": "object",
|
|
501
|
+
"additionalProperties": {
|
|
502
|
+
"type": "object",
|
|
503
|
+
"properties": {
|
|
504
|
+
"scope": {
|
|
505
|
+
"type": "string",
|
|
506
|
+
"enum": [
|
|
507
|
+
"instance",
|
|
508
|
+
"workspace",
|
|
509
|
+
"user"
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
"owner": {
|
|
513
|
+
"type": "string",
|
|
514
|
+
"const": "creator"
|
|
515
|
+
},
|
|
516
|
+
"fields": {
|
|
517
|
+
"type": "object",
|
|
518
|
+
"additionalProperties": {
|
|
519
|
+
"type": "string"
|
|
520
|
+
},
|
|
521
|
+
"propertyNames": {
|
|
522
|
+
"pattern": "^[a-z][A-Za-z0-9]*$"
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"sealed": {
|
|
526
|
+
"type": "array",
|
|
527
|
+
"items": {
|
|
528
|
+
"type": "string"
|
|
529
|
+
}
|
|
530
|
+
},
|
|
531
|
+
"unique": {
|
|
532
|
+
"type": "array",
|
|
533
|
+
"items": {
|
|
534
|
+
"type": "array",
|
|
535
|
+
"items": {
|
|
536
|
+
"type": "string"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
"indexes": {
|
|
541
|
+
"type": "array",
|
|
542
|
+
"items": {
|
|
543
|
+
"type": "array",
|
|
544
|
+
"items": {
|
|
545
|
+
"type": "string"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
},
|
|
549
|
+
"rules": {
|
|
550
|
+
"type": "object",
|
|
551
|
+
"additionalProperties": {}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
"required": [
|
|
555
|
+
"fields"
|
|
556
|
+
],
|
|
557
|
+
"additionalProperties": false
|
|
558
|
+
},
|
|
559
|
+
"propertyNames": {
|
|
560
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$"
|
|
561
|
+
}
|
|
248
562
|
}
|
|
249
563
|
},
|
|
250
564
|
"required": [
|