@zveltio/sdk 3.0.0-beta.124 → 3.0.0-beta.133

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/dist/build/index.d.ts.map +1 -1
  3. package/dist/build/index.js +9 -4
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +10 -3
  6. package/dist/extension/index.d.ts +15 -3
  7. package/dist/extension/index.d.ts.map +1 -1
  8. package/dist/extension/reserved-paths.d.ts +5 -1
  9. package/dist/extension/reserved-paths.d.ts.map +1 -1
  10. package/dist/extension/reserved-paths.js +8 -1
  11. package/dist/sync-manager.d.ts +5 -0
  12. package/dist/sync-manager.d.ts.map +1 -1
  13. package/dist/sync-manager.js +23 -4
  14. package/dist/tests/client.test.js +19 -0
  15. package/dist/tests/reserved-paths.test.js +4 -1
  16. package/dist/tests/runtime-deps.test.d.ts +2 -0
  17. package/dist/tests/runtime-deps.test.d.ts.map +1 -0
  18. package/dist/tests/runtime-deps.test.js +41 -0
  19. package/dist/tests/sync-manager.test.js +42 -0
  20. package/dist/tests/validate-manifest-actions.test.js +12 -0
  21. package/dist/tests/validate-manifest-routes.test.js +5 -0
  22. package/dist/tests/validate-sdui-data-endpoints.test.js +19 -3
  23. package/dist/tests/view-runtime.test.js +36 -2
  24. package/dist/tests/view.test.js +122 -3
  25. package/dist/validate/index.d.ts.map +1 -1
  26. package/dist/validate/index.js +178 -6
  27. package/dist/view/index.d.ts +17 -0
  28. package/dist/view/index.d.ts.map +1 -1
  29. package/dist/view/index.js +110 -1
  30. package/dist/view/runtime.d.ts +26 -0
  31. package/dist/view/runtime.d.ts.map +1 -1
  32. package/dist/view/runtime.js +60 -6
  33. package/dist/view/schema.d.ts.map +1 -1
  34. package/dist/view/schema.js +29 -5
  35. package/dist/view/types.generated.d.ts +17 -3
  36. package/dist/view/types.generated.d.ts.map +1 -1
  37. package/package.json +7 -4
  38. package/schemas/extension-manifest.schema.json +588 -0
  39. package/schemas/view-2.schema.json +73 -3
@@ -0,0 +1,588 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://zveltio.com/schemas/extension-manifest.schema.json",
4
+ "title": "Zveltio extension manifest",
5
+ "description": "manifest.json of a Zveltio extension. Generated from the engine ManifestSchema by scripts/gen-manifest-schema.ts; shapes only, the engine checks the rest at load.",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "minLength": 1
11
+ },
12
+ "version": {
13
+ "default": "1.0.0",
14
+ "type": "string",
15
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
16
+ },
17
+ "category": {
18
+ "default": "custom",
19
+ "type": "string"
20
+ },
21
+ "zveltioMinVersion": {
22
+ "type": "string"
23
+ },
24
+ "zveltioMaxVersion": {
25
+ "type": [
26
+ "string",
27
+ "null"
28
+ ]
29
+ },
30
+ "dependencies": {
31
+ "default": [],
32
+ "type": "array",
33
+ "items": {
34
+ "type": "object",
35
+ "properties": {
36
+ "name": {
37
+ "type": "string"
38
+ },
39
+ "minVersion": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ "required": [
44
+ "name"
45
+ ]
46
+ }
47
+ },
48
+ "optionalDependencies": {
49
+ "default": [],
50
+ "type": "array",
51
+ "items": {
52
+ "type": "object",
53
+ "properties": {
54
+ "name": {
55
+ "type": "string"
56
+ },
57
+ "minVersion": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ "required": [
62
+ "name"
63
+ ]
64
+ }
65
+ },
66
+ "peerDependencies": {
67
+ "type": "object",
68
+ "propertyNames": {
69
+ "type": "string"
70
+ },
71
+ "additionalProperties": {
72
+ "type": "string"
73
+ }
74
+ },
75
+ "requires": {
76
+ "type": "object",
77
+ "properties": {
78
+ "postgres_extensions": {
79
+ "type": "array",
80
+ "items": {
81
+ "type": "string"
82
+ }
83
+ }
84
+ }
85
+ },
86
+ "permissions": {
87
+ "default": [],
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "capabilityContract": {
94
+ "type": "integer",
95
+ "exclusiveMinimum": 0,
96
+ "maximum": 9007199254740991
97
+ },
98
+ "publicRoutes": {
99
+ "default": [],
100
+ "type": "array",
101
+ "items": {
102
+ "type": "string"
103
+ }
104
+ },
105
+ "routes": {
106
+ "default": [],
107
+ "type": "array",
108
+ "items": {
109
+ "type": "object",
110
+ "properties": {
111
+ "method": {
112
+ "type": "string",
113
+ "enum": [
114
+ "GET",
115
+ "POST",
116
+ "PUT",
117
+ "PATCH",
118
+ "DELETE"
119
+ ]
120
+ },
121
+ "path": {
122
+ "type": "string",
123
+ "pattern": "^\\/$|^(\\/([A-Za-z0-9._~-]+|:[A-Za-z_][A-Za-z0-9_]*))+$"
124
+ },
125
+ "access": {
126
+ "type": "string",
127
+ "enum": [
128
+ "public",
129
+ "caller"
130
+ ]
131
+ },
132
+ "handler": {
133
+ "type": "string",
134
+ "pattern": "^[a-z][a-zA-Z0-9]*$"
135
+ }
136
+ },
137
+ "required": [
138
+ "method",
139
+ "path",
140
+ "access",
141
+ "handler"
142
+ ],
143
+ "additionalProperties": false
144
+ }
145
+ },
146
+ "signInProviders": {
147
+ "default": [],
148
+ "type": "array",
149
+ "items": {
150
+ "type": "object",
151
+ "properties": {
152
+ "id": {
153
+ "type": "string",
154
+ "pattern": "^[a-z][a-z0-9-]{0,63}$"
155
+ },
156
+ "label": {
157
+ "type": "string",
158
+ "minLength": 1,
159
+ "maxLength": 100
160
+ },
161
+ "kind": {
162
+ "type": "string",
163
+ "enum": [
164
+ "credentials",
165
+ "redirect"
166
+ ]
167
+ },
168
+ "route": {
169
+ "type": "string",
170
+ "pattern": "^\\/$|^(\\/([A-Za-z0-9._~-]+|:[A-Za-z_][A-Za-z0-9_]*))+$"
171
+ }
172
+ },
173
+ "required": [
174
+ "id",
175
+ "label",
176
+ "kind",
177
+ "route"
178
+ ],
179
+ "additionalProperties": false
180
+ }
181
+ },
182
+ "apiKeyRoutes": {
183
+ "default": [],
184
+ "type": "array",
185
+ "items": {
186
+ "type": "string",
187
+ "pattern": "^(GET|POST|PUT|PATCH|DELETE) \\S+$"
188
+ }
189
+ },
190
+ "forwardCredentials": {
191
+ "default": {},
192
+ "type": "object",
193
+ "propertyNames": {
194
+ "type": "string"
195
+ },
196
+ "additionalProperties": {
197
+ "type": "array",
198
+ "items": {
199
+ "type": "string",
200
+ "enum": [
201
+ "authorization",
202
+ "cookie",
203
+ "proxy-authorization",
204
+ "x-api-key"
205
+ ]
206
+ }
207
+ }
208
+ },
209
+ "globalRoutes": {
210
+ "default": [],
211
+ "type": "array",
212
+ "items": {
213
+ "type": "string"
214
+ }
215
+ },
216
+ "globalRoutesDynamic": {
217
+ "default": false,
218
+ "type": "boolean"
219
+ },
220
+ "i18nPrefixes": {
221
+ "default": [],
222
+ "type": "array",
223
+ "items": {
224
+ "type": "string",
225
+ "pattern": "^[a-z][a-zA-Z0-9-]*(\\.[a-zA-Z0-9_-]+)*$"
226
+ }
227
+ },
228
+ "resources": {
229
+ "default": [],
230
+ "type": "array",
231
+ "items": {
232
+ "type": "string"
233
+ }
234
+ },
235
+ "sensitiveResources": {
236
+ "default": [],
237
+ "type": "array",
238
+ "items": {
239
+ "type": "string"
240
+ }
241
+ },
242
+ "actions": {
243
+ "default": [],
244
+ "type": "array",
245
+ "items": {
246
+ "type": "object",
247
+ "properties": {
248
+ "name": {
249
+ "type": "string",
250
+ "pattern": "^[a-z][a-zA-Z0-9]*$"
251
+ },
252
+ "permission": {
253
+ "type": "object",
254
+ "properties": {
255
+ "resource": {
256
+ "type": "string",
257
+ "minLength": 1
258
+ },
259
+ "action": {
260
+ "default": "execute",
261
+ "type": "string",
262
+ "minLength": 1
263
+ }
264
+ },
265
+ "required": [
266
+ "resource"
267
+ ]
268
+ },
269
+ "input": {
270
+ "type": "object",
271
+ "propertyNames": {
272
+ "type": "string"
273
+ },
274
+ "additionalProperties": {}
275
+ },
276
+ "reads": {
277
+ "default": [],
278
+ "type": "array",
279
+ "items": {
280
+ "type": "string"
281
+ }
282
+ },
283
+ "writes": {
284
+ "default": [],
285
+ "type": "array",
286
+ "items": {
287
+ "type": "string"
288
+ }
289
+ },
290
+ "enqueues": {
291
+ "default": [],
292
+ "type": "array",
293
+ "items": {
294
+ "type": "string"
295
+ }
296
+ },
297
+ "calls": {
298
+ "default": [],
299
+ "type": "array",
300
+ "items": {
301
+ "type": "string"
302
+ }
303
+ }
304
+ },
305
+ "required": [
306
+ "name",
307
+ "permission",
308
+ "input"
309
+ ]
310
+ }
311
+ },
312
+ "jobs": {
313
+ "default": [],
314
+ "type": "array",
315
+ "items": {
316
+ "type": "object",
317
+ "properties": {
318
+ "name": {
319
+ "type": "string",
320
+ "pattern": "^[a-z][a-zA-Z0-9]*$"
321
+ },
322
+ "input": {
323
+ "type": "object",
324
+ "propertyNames": {
325
+ "type": "string"
326
+ },
327
+ "additionalProperties": {}
328
+ },
329
+ "reads": {
330
+ "default": [],
331
+ "type": "array",
332
+ "items": {
333
+ "type": "string"
334
+ }
335
+ },
336
+ "writes": {
337
+ "default": [],
338
+ "type": "array",
339
+ "items": {
340
+ "type": "string"
341
+ }
342
+ },
343
+ "fromPublicRoutes": {
344
+ "default": [],
345
+ "type": "array",
346
+ "items": {
347
+ "type": "string"
348
+ }
349
+ },
350
+ "retry": {
351
+ "default": {
352
+ "limit": 2,
353
+ "backoff": true
354
+ },
355
+ "type": "object",
356
+ "properties": {
357
+ "limit": {
358
+ "default": 2,
359
+ "type": "integer",
360
+ "minimum": 0,
361
+ "maximum": 10
362
+ },
363
+ "backoff": {
364
+ "default": true,
365
+ "type": "boolean"
366
+ }
367
+ }
368
+ },
369
+ "egress": {
370
+ "default": [],
371
+ "type": "array",
372
+ "items": {
373
+ "type": "string"
374
+ }
375
+ },
376
+ "egressSlots": {
377
+ "default": [],
378
+ "type": "array",
379
+ "items": {
380
+ "anyOf": [
381
+ {
382
+ "type": "string",
383
+ "pattern": "^[a-z][a-z0-9_]*$"
384
+ },
385
+ {
386
+ "type": "object",
387
+ "properties": {
388
+ "name": {
389
+ "type": "string",
390
+ "pattern": "^[a-z][a-z0-9_]*$"
391
+ },
392
+ "kind": {
393
+ "default": "http",
394
+ "type": "string",
395
+ "enum": [
396
+ "http",
397
+ "tcp"
398
+ ]
399
+ }
400
+ },
401
+ "required": [
402
+ "name"
403
+ ],
404
+ "additionalProperties": false
405
+ }
406
+ ]
407
+ }
408
+ },
409
+ "memoryMb": {
410
+ "default": 128,
411
+ "type": "integer",
412
+ "minimum": 32,
413
+ "maximum": 512
414
+ },
415
+ "timeoutSeconds": {
416
+ "default": 60,
417
+ "type": "integer",
418
+ "minimum": 1,
419
+ "maximum": 900
420
+ },
421
+ "schedule": {
422
+ "type": "string"
423
+ }
424
+ },
425
+ "required": [
426
+ "name",
427
+ "input"
428
+ ]
429
+ }
430
+ },
431
+ "collections": {
432
+ "default": [],
433
+ "type": "array",
434
+ "items": {
435
+ "type": "string",
436
+ "maxLength": 63,
437
+ "pattern": "^[a-z][a-z0-9_]*$"
438
+ }
439
+ },
440
+ "contributes": {
441
+ "type": "object",
442
+ "properties": {
443
+ "engine": {
444
+ "default": true,
445
+ "type": "boolean"
446
+ },
447
+ "studio": {
448
+ "default": false,
449
+ "type": "boolean"
450
+ },
451
+ "client": {
452
+ "default": false,
453
+ "type": "boolean"
454
+ },
455
+ "fieldTypes": {
456
+ "default": [],
457
+ "type": "array",
458
+ "items": {
459
+ "type": "string"
460
+ }
461
+ },
462
+ "stepTypes": {
463
+ "default": [],
464
+ "type": "array",
465
+ "items": {
466
+ "type": "string"
467
+ }
468
+ },
469
+ "collections": {
470
+ "default": [],
471
+ "type": "array",
472
+ "items": {
473
+ "type": "string"
474
+ }
475
+ },
476
+ "slots": {
477
+ "default": [],
478
+ "type": "array",
479
+ "items": {
480
+ "type": "string"
481
+ }
482
+ }
483
+ }
484
+ },
485
+ "quotas": {
486
+ "type": "object",
487
+ "properties": {
488
+ "bundleSizeKbMax": {
489
+ "default": 50000,
490
+ "type": "integer",
491
+ "exclusiveMinimum": 0,
492
+ "maximum": 9007199254740991
493
+ },
494
+ "nodeModulesSizeMbMax": {
495
+ "default": 200,
496
+ "type": "integer",
497
+ "exclusiveMinimum": 0,
498
+ "maximum": 9007199254740991
499
+ },
500
+ "migrationsMax": {
501
+ "default": 100,
502
+ "type": "integer",
503
+ "exclusiveMinimum": 0,
504
+ "maximum": 9007199254740991
505
+ }
506
+ }
507
+ },
508
+ "runtime": {
509
+ "default": "js",
510
+ "type": "string",
511
+ "const": "js"
512
+ },
513
+ "engine": {
514
+ "type": "object",
515
+ "properties": {
516
+ "entry": {
517
+ "type": "string"
518
+ },
519
+ "format": {
520
+ "default": "esm",
521
+ "type": "string",
522
+ "const": "esm"
523
+ },
524
+ "target": {
525
+ "default": "bun",
526
+ "type": "string",
527
+ "enum": [
528
+ "bun",
529
+ "node",
530
+ "*"
531
+ ]
532
+ },
533
+ "bundled": {
534
+ "type": "boolean"
535
+ },
536
+ "bundlePeers": {
537
+ "default": false,
538
+ "type": "boolean"
539
+ },
540
+ "isolation": {
541
+ "default": "inline",
542
+ "type": "string",
543
+ "enum": [
544
+ "inline",
545
+ "worker"
546
+ ]
547
+ }
548
+ },
549
+ "required": [
550
+ "entry",
551
+ "bundled"
552
+ ]
553
+ },
554
+ "integrity": {
555
+ "type": "object",
556
+ "properties": {
557
+ "engineSha256": {
558
+ "type": "string",
559
+ "pattern": "^[a-f0-9]{64}$"
560
+ },
561
+ "schemaSha256": {
562
+ "type": "string",
563
+ "pattern": "^[a-f0-9]{64}$"
564
+ },
565
+ "jobsSha256": {
566
+ "type": "string",
567
+ "pattern": "^[a-f0-9]{64}$"
568
+ },
569
+ "archiveSha256": {
570
+ "anyOf": [
571
+ {
572
+ "type": "string",
573
+ "const": ""
574
+ },
575
+ {
576
+ "type": "string",
577
+ "pattern": "^[a-f0-9]{64}$"
578
+ }
579
+ ]
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "required": [
585
+ "name"
586
+ ],
587
+ "additionalProperties": {}
588
+ }