@platforma-sdk/block-tools 2.2.0 → 2.3.1

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 (73) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +94 -238
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/config-BbxbO3Iw.mjs +1601 -0
  6. package/dist/config-BbxbO3Iw.mjs.map +1 -0
  7. package/dist/config-BczgUC2N.js +3 -0
  8. package/dist/config-BczgUC2N.js.map +1 -0
  9. package/dist/index.js +1 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +184 -40
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/io/folder_reader.d.ts +10 -0
  14. package/dist/io/folder_reader.d.ts.map +1 -0
  15. package/dist/io/index.d.ts +3 -0
  16. package/dist/io/index.d.ts.map +1 -0
  17. package/dist/io/storage.d.ts.map +1 -0
  18. package/dist/lib.d.ts +1 -0
  19. package/dist/lib.d.ts.map +1 -1
  20. package/dist/registry_v1/registry.d.ts +1 -1
  21. package/dist/registry_v1/registry.d.ts.map +1 -1
  22. package/dist/registry_v1/v1_repo_schema.d.ts +1 -1
  23. package/dist/registry_v1/v1_repo_schema.d.ts.map +1 -1
  24. package/dist/util.d.ts +1 -0
  25. package/dist/util.d.ts.map +1 -1
  26. package/dist/v2/build_dist.d.ts.map +1 -1
  27. package/dist/v2/index.d.ts +1 -0
  28. package/dist/v2/index.d.ts.map +1 -1
  29. package/dist/v2/model/block_components.d.ts +298 -20
  30. package/dist/v2/model/block_components.d.ts.map +1 -1
  31. package/dist/v2/model/block_description.d.ts +329 -110
  32. package/dist/v2/model/block_description.d.ts.map +1 -1
  33. package/dist/v2/model/block_meta.d.ts +554 -2
  34. package/dist/v2/model/block_meta.d.ts.map +1 -1
  35. package/dist/v2/model/content_conversion.d.ts +3 -1
  36. package/dist/v2/model/content_conversion.d.ts.map +1 -1
  37. package/dist/v2/registry/index.d.ts +4 -0
  38. package/dist/v2/registry/index.d.ts.map +1 -0
  39. package/dist/v2/registry/registry.d.ts +1 -1
  40. package/dist/v2/registry/registry.d.ts.map +1 -1
  41. package/dist/v2/registry/registry_reader.d.ts +14 -0
  42. package/dist/v2/registry/registry_reader.d.ts.map +1 -0
  43. package/dist/v2/registry/schema_public.d.ts +2048 -259
  44. package/dist/v2/registry/schema_public.d.ts.map +1 -1
  45. package/package.json +7 -4
  46. package/src/cmd/build-meta.ts +2 -2
  47. package/src/cmd/publish.ts +1 -1
  48. package/src/io/folder_reader.test.ts +21 -0
  49. package/src/io/folder_reader.ts +85 -0
  50. package/src/io/index.ts +2 -0
  51. package/src/lib.ts +1 -0
  52. package/src/registry_v1/config.ts +1 -1
  53. package/src/registry_v1/registry.test.ts +1 -1
  54. package/src/registry_v1/registry.ts +1 -1
  55. package/src/registry_v1/v1_repo_schema.ts +1 -1
  56. package/src/util.ts +6 -0
  57. package/src/v2/build_dist.ts +2 -1
  58. package/src/v2/index.ts +1 -0
  59. package/src/v2/model/block_components.ts +10 -8
  60. package/src/v2/model/block_meta.ts +23 -5
  61. package/src/v2/model/content_conversion.ts +30 -1
  62. package/src/v2/registry/index.ts +3 -0
  63. package/src/v2/registry/registry.ts +19 -15
  64. package/src/v2/registry/registry_reader.ts +81 -0
  65. package/src/v2/registry/schema_public.ts +36 -10
  66. package/dist/config-DJqN5LSx.js +0 -3
  67. package/dist/config-DJqN5LSx.js.map +0 -1
  68. package/dist/config-rGaQLD-7.mjs +0 -1350
  69. package/dist/config-rGaQLD-7.mjs.map +0 -1
  70. package/dist/lib/storage.d.ts.map +0 -1
  71. /package/dist/{lib → io}/storage.d.ts +0 -0
  72. /package/src/{lib → io}/storage.test.ts +0 -0
  73. /package/src/{lib → io}/storage.ts +0 -0
@@ -1,12 +1,30 @@
1
1
  import { z } from 'zod';
2
2
  export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObject<{
3
- workflow: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, {
3
+ workflow: z.ZodUnion<[z.ZodPipeline<z.ZodEffects<z.ZodEffects<z.ZodString, {
4
4
  type: "absolute-file";
5
5
  file: string;
6
6
  }, string>, {
7
- type: string;
8
- main: any;
9
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
7
+ type: "workflow-v1";
8
+ main: {
9
+ type: "absolute-file";
10
+ file: string;
11
+ };
12
+ }, string>, z.ZodObject<{
13
+ type: z.ZodLiteral<"workflow-v1">;
14
+ main: z.ZodEffects<z.ZodString, {
15
+ type: "absolute-file";
16
+ file: string;
17
+ }, string>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "workflow-v1";
20
+ main: {
21
+ type: "absolute-file";
22
+ file: string;
23
+ };
24
+ }, {
25
+ type: "workflow-v1";
26
+ main: string;
27
+ }>>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10
28
  type: z.ZodLiteral<"workflow-v1">;
11
29
  main: z.ZodEffects<z.ZodString, {
12
30
  type: "absolute-file";
@@ -32,8 +50,11 @@ export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObj
32
50
  }, string>;
33
51
  }, "strip", z.ZodTypeAny, {
34
52
  workflow: {
35
- type: string;
36
- main: any;
53
+ type: "workflow-v1";
54
+ main: {
55
+ type: "absolute-file";
56
+ file: string;
57
+ };
37
58
  } | {
38
59
  type: "workflow-v1";
39
60
  main: {
@@ -59,7 +80,7 @@ export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObj
59
80
  }>;
60
81
  export type BlockComponentsDescription = z.infer<ReturnType<typeof BlockComponentsDescription>>;
61
82
  export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumulator?: string[]): z.ZodPipeline<z.ZodObject<{
62
- workflow: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
83
+ workflow: z.ZodUnion<[z.ZodPipeline<z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
63
84
  type: z.ZodLiteral<"explicit-base64">;
64
85
  mimeType: z.ZodString;
65
86
  content: z.ZodString;
@@ -95,8 +116,15 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
95
116
  type: "absolute-file";
96
117
  file: string;
97
118
  }>, {
98
- type: string;
99
- main: any;
119
+ type: "workflow-v1";
120
+ main: {
121
+ type: "relative";
122
+ path: string;
123
+ } | {
124
+ type: "explicit-base64";
125
+ content: string;
126
+ mimeType: string;
127
+ };
100
128
  }, {
101
129
  type: "explicit-base64";
102
130
  content: string;
@@ -104,7 +132,65 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
104
132
  } | {
105
133
  type: "absolute-file";
106
134
  file: string;
107
- }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
135
+ }>, z.ZodObject<{
136
+ type: z.ZodLiteral<"workflow-v1">;
137
+ main: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
138
+ type: z.ZodLiteral<"explicit-base64">;
139
+ mimeType: z.ZodString;
140
+ content: z.ZodString;
141
+ }, "strict", z.ZodTypeAny, {
142
+ type: "explicit-base64";
143
+ content: string;
144
+ mimeType: string;
145
+ }, {
146
+ type: "explicit-base64";
147
+ content: string;
148
+ mimeType: string;
149
+ }>, z.ZodObject<{
150
+ type: z.ZodLiteral<"absolute-file">;
151
+ file: z.ZodString;
152
+ }, "strict", z.ZodTypeAny, {
153
+ type: "absolute-file";
154
+ file: string;
155
+ }, {
156
+ type: "absolute-file";
157
+ file: string;
158
+ }>]>, {
159
+ type: "relative";
160
+ path: string;
161
+ } | {
162
+ type: "explicit-base64";
163
+ content: string;
164
+ mimeType: string;
165
+ }, {
166
+ type: "explicit-base64";
167
+ content: string;
168
+ mimeType: string;
169
+ } | {
170
+ type: "absolute-file";
171
+ file: string;
172
+ }>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ type: "workflow-v1";
175
+ main: {
176
+ type: "relative";
177
+ path: string;
178
+ } | {
179
+ type: "explicit-base64";
180
+ content: string;
181
+ mimeType: string;
182
+ };
183
+ }, {
184
+ type: "workflow-v1";
185
+ main: {
186
+ type: "explicit-base64";
187
+ content: string;
188
+ mimeType: string;
189
+ } | {
190
+ type: "absolute-file";
191
+ file: string;
192
+ };
193
+ }>>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
108
194
  type: z.ZodLiteral<"workflow-v1">;
109
195
  main: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
110
196
  type: z.ZodLiteral<"explicit-base64">;
@@ -217,8 +303,15 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
217
303
  }>;
218
304
  }, "strip", z.ZodTypeAny, {
219
305
  workflow: {
220
- type: string;
221
- main: any;
306
+ type: "workflow-v1";
307
+ main: {
308
+ type: "relative";
309
+ path: string;
310
+ } | {
311
+ type: "explicit-base64";
312
+ content: string;
313
+ mimeType: string;
314
+ };
222
315
  } | {
223
316
  type: "workflow-v1";
224
317
  main: {
@@ -274,7 +367,7 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
274
367
  folder: string;
275
368
  };
276
369
  }>, z.ZodObject<{
277
- workflow: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
370
+ workflow: z.ZodUnion<[z.ZodPipeline<z.ZodEffects<z.ZodObject<{
278
371
  type: z.ZodLiteral<"relative">;
279
372
  path: z.ZodString;
280
373
  }, "strict", z.ZodTypeAny, {
@@ -284,12 +377,39 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
284
377
  type: "relative";
285
378
  path: string;
286
379
  }>, {
287
- type: string;
288
- main: any;
380
+ type: "workflow-v1";
381
+ main: {
382
+ type: "relative";
383
+ path: string;
384
+ };
289
385
  }, {
290
386
  type: "relative";
291
387
  path: string;
292
- }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
388
+ }>, z.ZodObject<{
389
+ type: z.ZodLiteral<"workflow-v1">;
390
+ main: z.ZodObject<{
391
+ type: z.ZodLiteral<"relative">;
392
+ path: z.ZodString;
393
+ }, "strict", z.ZodTypeAny, {
394
+ type: "relative";
395
+ path: string;
396
+ }, {
397
+ type: "relative";
398
+ path: string;
399
+ }>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ type: "workflow-v1";
402
+ main: {
403
+ type: "relative";
404
+ path: string;
405
+ };
406
+ }, {
407
+ type: "workflow-v1";
408
+ main: {
409
+ type: "relative";
410
+ path: string;
411
+ };
412
+ }>>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
293
413
  type: z.ZodLiteral<"workflow-v1">;
294
414
  main: z.ZodObject<{
295
415
  type: z.ZodLiteral<"relative">;
@@ -335,13 +455,25 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
335
455
  path: string;
336
456
  }>;
337
457
  }, "strip", z.ZodTypeAny, {
458
+ workflow: {
459
+ type: "workflow-v1";
460
+ main: {
461
+ type: "relative";
462
+ path: string;
463
+ };
464
+ };
465
+ model: {
466
+ type: "relative";
467
+ path: string;
468
+ };
338
469
  ui: {
339
470
  type: "relative";
340
471
  path: string;
341
472
  };
473
+ }, {
342
474
  workflow: {
343
- type: string;
344
- main: any;
475
+ type: "relative";
476
+ path: string;
345
477
  } | {
346
478
  type: "workflow-v1";
347
479
  main: {
@@ -353,11 +485,152 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
353
485
  type: "relative";
354
486
  path: string;
355
487
  };
356
- }, {
357
488
  ui: {
358
489
  type: "relative";
359
490
  path: string;
360
491
  };
492
+ }>>;
493
+ export declare function BlockComponentsAbsoluteUrl(prefix: string): z.ZodObject<{
494
+ workflow: z.ZodUnion<[z.ZodPipeline<z.ZodEffects<z.ZodEffects<z.ZodObject<{
495
+ type: z.ZodLiteral<"relative">;
496
+ path: z.ZodString;
497
+ }, "strict", z.ZodTypeAny, {
498
+ type: "relative";
499
+ path: string;
500
+ }, {
501
+ type: "relative";
502
+ path: string;
503
+ }>, {
504
+ type: "absolute-url";
505
+ url: string;
506
+ }, {
507
+ type: "relative";
508
+ path: string;
509
+ }>, {
510
+ type: "workflow-v1";
511
+ main: {
512
+ type: "absolute-url";
513
+ url: string;
514
+ };
515
+ }, {
516
+ type: "relative";
517
+ path: string;
518
+ }>, z.ZodObject<{
519
+ type: z.ZodLiteral<"workflow-v1">;
520
+ main: z.ZodEffects<z.ZodObject<{
521
+ type: z.ZodLiteral<"relative">;
522
+ path: z.ZodString;
523
+ }, "strict", z.ZodTypeAny, {
524
+ type: "relative";
525
+ path: string;
526
+ }, {
527
+ type: "relative";
528
+ path: string;
529
+ }>, {
530
+ type: "absolute-url";
531
+ url: string;
532
+ }, {
533
+ type: "relative";
534
+ path: string;
535
+ }>;
536
+ }, "strip", z.ZodTypeAny, {
537
+ type: "workflow-v1";
538
+ main: {
539
+ type: "absolute-url";
540
+ url: string;
541
+ };
542
+ }, {
543
+ type: "workflow-v1";
544
+ main: {
545
+ type: "relative";
546
+ path: string;
547
+ };
548
+ }>>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
549
+ type: z.ZodLiteral<"workflow-v1">;
550
+ main: z.ZodEffects<z.ZodObject<{
551
+ type: z.ZodLiteral<"relative">;
552
+ path: z.ZodString;
553
+ }, "strict", z.ZodTypeAny, {
554
+ type: "relative";
555
+ path: string;
556
+ }, {
557
+ type: "relative";
558
+ path: string;
559
+ }>, {
560
+ type: "absolute-url";
561
+ url: string;
562
+ }, {
563
+ type: "relative";
564
+ path: string;
565
+ }>;
566
+ }, "strip", z.ZodTypeAny, {
567
+ type: "workflow-v1";
568
+ main: {
569
+ type: "absolute-url";
570
+ url: string;
571
+ };
572
+ }, {
573
+ type: "workflow-v1";
574
+ main: {
575
+ type: "relative";
576
+ path: string;
577
+ };
578
+ }>]>]>;
579
+ model: z.ZodEffects<z.ZodObject<{
580
+ type: z.ZodLiteral<"relative">;
581
+ path: z.ZodString;
582
+ }, "strict", z.ZodTypeAny, {
583
+ type: "relative";
584
+ path: string;
585
+ }, {
586
+ type: "relative";
587
+ path: string;
588
+ }>, {
589
+ type: "absolute-url";
590
+ url: string;
591
+ }, {
592
+ type: "relative";
593
+ path: string;
594
+ }>;
595
+ ui: z.ZodEffects<z.ZodObject<{
596
+ type: z.ZodLiteral<"relative">;
597
+ path: z.ZodString;
598
+ }, "strict", z.ZodTypeAny, {
599
+ type: "relative";
600
+ path: string;
601
+ }, {
602
+ type: "relative";
603
+ path: string;
604
+ }>, {
605
+ type: "absolute-url";
606
+ url: string;
607
+ }, {
608
+ type: "relative";
609
+ path: string;
610
+ }>;
611
+ }, "strip", z.ZodTypeAny, {
612
+ workflow: {
613
+ type: "workflow-v1";
614
+ main: {
615
+ type: "absolute-url";
616
+ url: string;
617
+ };
618
+ } | {
619
+ type: "workflow-v1";
620
+ main: {
621
+ type: "absolute-url";
622
+ url: string;
623
+ };
624
+ };
625
+ model: {
626
+ type: "absolute-url";
627
+ url: string;
628
+ };
629
+ ui: {
630
+ type: "absolute-url";
631
+ url: string;
632
+ };
633
+ }, {
361
634
  workflow: {
362
635
  type: "relative";
363
636
  path: string;
@@ -372,5 +645,10 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
372
645
  type: "relative";
373
646
  path: string;
374
647
  };
375
- }>>;
648
+ ui: {
649
+ type: "relative";
650
+ path: string;
651
+ };
652
+ }>;
653
+ export type BlockComponentsAbsoluteUrl = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;
376
654
  //# sourceMappingURL=block_components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block_components.d.ts","sourceRoot":"","sources":["../../../src/v2/model/block_components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK5D;AACD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,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