@platforma-sdk/block-tools 2.1.11 → 2.3.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.
Files changed (94) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +113 -71
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/cmd/index.d.ts +2 -0
  6. package/dist/cmd/index.d.ts.map +1 -1
  7. package/dist/cmd/publish.d.ts +11 -0
  8. package/dist/cmd/publish.d.ts.map +1 -0
  9. package/dist/config-B1U40s2a.js +3 -0
  10. package/dist/config-B1U40s2a.js.map +1 -0
  11. package/dist/config-YukCegnp.mjs +1587 -0
  12. package/dist/config-YukCegnp.mjs.map +1 -0
  13. package/dist/index.js +1 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/index.mjs +170 -38
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/io/folder_reader.d.ts +24 -0
  18. package/dist/io/folder_reader.d.ts.map +1 -0
  19. package/dist/io/index.d.ts +3 -0
  20. package/dist/io/index.d.ts.map +1 -0
  21. package/dist/io/storage.d.ts.map +1 -0
  22. package/dist/lib.d.ts +1 -0
  23. package/dist/lib.d.ts.map +1 -1
  24. package/dist/registry_v1/config_schema.d.ts +13 -13
  25. package/dist/registry_v1/registry.d.ts +1 -1
  26. package/dist/registry_v1/registry.d.ts.map +1 -1
  27. package/dist/registry_v1/v1_repo_schema.d.ts +1 -1
  28. package/dist/registry_v1/v1_repo_schema.d.ts.map +1 -1
  29. package/dist/v2/build_dist.d.ts +2 -1
  30. package/dist/v2/build_dist.d.ts.map +1 -1
  31. package/dist/v2/index.d.ts +1 -0
  32. package/dist/v2/index.d.ts.map +1 -1
  33. package/dist/v2/model/block_components.d.ts +170 -178
  34. package/dist/v2/model/block_components.d.ts.map +1 -1
  35. package/dist/v2/model/block_description.d.ts +2873 -0
  36. package/dist/v2/model/block_description.d.ts.map +1 -0
  37. package/dist/v2/model/{meta.d.ts → block_meta.d.ts} +555 -3
  38. package/dist/v2/model/block_meta.d.ts.map +1 -0
  39. package/dist/v2/model/content_conversion.d.ts +7 -2
  40. package/dist/v2/model/content_conversion.d.ts.map +1 -1
  41. package/dist/v2/model/index.d.ts +3 -2079
  42. package/dist/v2/model/index.d.ts.map +1 -1
  43. package/dist/v2/registry/index.d.ts +4 -0
  44. package/dist/v2/registry/index.d.ts.map +1 -0
  45. package/dist/v2/registry/registry.d.ts +16 -0
  46. package/dist/v2/registry/registry.d.ts.map +1 -0
  47. package/dist/v2/registry/registry_reader.d.ts +12 -0
  48. package/dist/v2/registry/registry_reader.d.ts.map +1 -0
  49. package/dist/v2/registry/schema_internal.d.ts +7 -0
  50. package/dist/v2/registry/schema_internal.d.ts.map +1 -0
  51. package/dist/v2/registry/schema_public.d.ts +4499 -0
  52. package/dist/v2/registry/schema_public.d.ts.map +1 -0
  53. package/package.json +8 -5
  54. package/src/cmd/build-meta.ts +2 -2
  55. package/src/cmd/index.ts +2 -0
  56. package/src/cmd/publish.ts +69 -0
  57. package/src/io/folder_reader.test.ts +21 -0
  58. package/src/io/folder_reader.ts +77 -0
  59. package/src/io/index.ts +2 -0
  60. package/src/lib.ts +1 -0
  61. package/src/registry_v1/config.ts +1 -1
  62. package/src/registry_v1/registry.test.ts +1 -1
  63. package/src/registry_v1/registry.ts +1 -1
  64. package/src/registry_v1/v1_repo_schema.ts +1 -1
  65. package/src/v2/build_dist.ts +16 -12
  66. package/src/v2/index.ts +1 -0
  67. package/src/v2/model/block_components.ts +14 -10
  68. package/src/v2/model/block_description.ts +49 -0
  69. package/src/v2/model/{meta.ts → block_meta.ts} +23 -5
  70. package/src/v2/model/content_conversion.ts +78 -10
  71. package/src/v2/model/index.ts +3 -44
  72. package/src/v2/registry/index.ts +3 -0
  73. package/src/v2/registry/registry.ts +240 -0
  74. package/src/v2/registry/registry_reader.ts +71 -0
  75. package/src/v2/registry/schema_internal.ts +13 -0
  76. package/src/v2/registry/schema_public.ts +112 -0
  77. package/dist/config-Br5DwFuM.mjs +0 -1317
  78. package/dist/config-Br5DwFuM.mjs.map +0 -1
  79. package/dist/config-DMAm68Pm.js +0 -3
  80. package/dist/config-DMAm68Pm.js.map +0 -1
  81. package/dist/lib/storage.d.ts.map +0 -1
  82. package/dist/v2/model/common.d.ts +0 -3
  83. package/dist/v2/model/common.d.ts.map +0 -1
  84. package/dist/v2/model/content_types.d.ts +0 -478
  85. package/dist/v2/model/content_types.d.ts.map +0 -1
  86. package/dist/v2/model/meta.d.ts.map +0 -1
  87. package/dist/v2/registry/schema.d.ts +0 -15
  88. package/dist/v2/registry/schema.d.ts.map +0 -1
  89. package/src/v2/model/common.ts +0 -2
  90. package/src/v2/model/content_types.ts +0 -233
  91. package/src/v2/registry/schema.ts +0 -29
  92. /package/dist/{lib → io}/storage.d.ts +0 -0
  93. /package/src/{lib → io}/storage.test.ts +0 -0
  94. /package/src/{lib → io}/storage.ts +0 -0
@@ -1,9 +1,27 @@
1
1
  import { z } from 'zod';
2
2
  export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObject<{
3
- workflow: z.ZodEffects<z.ZodString, {
3
+ workflow: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, {
4
4
  type: "absolute-file";
5
5
  file: string;
6
- }, string>;
6
+ }, string>, {
7
+ type: string;
8
+ main: any;
9
+ }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
10
+ type: z.ZodLiteral<"workflow-v1">;
11
+ main: z.ZodEffects<z.ZodString, {
12
+ type: "absolute-file";
13
+ file: string;
14
+ }, string>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: "workflow-v1";
17
+ main: {
18
+ type: "absolute-file";
19
+ file: string;
20
+ };
21
+ }, {
22
+ type: "workflow-v1";
23
+ main: string;
24
+ }>]>]>;
7
25
  model: z.ZodEffects<z.ZodString, {
8
26
  type: "absolute-file";
9
27
  file: string;
@@ -14,8 +32,14 @@ export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObj
14
32
  }, string>;
15
33
  }, "strip", z.ZodTypeAny, {
16
34
  workflow: {
17
- type: "absolute-file";
18
- file: string;
35
+ type: string;
36
+ main: any;
37
+ } | {
38
+ type: "workflow-v1";
39
+ main: {
40
+ type: "absolute-file";
41
+ file: string;
42
+ };
19
43
  };
20
44
  model: {
21
45
  type: "absolute-file";
@@ -26,13 +50,16 @@ export declare function BlockComponentsDescription(moduleRoot: string): z.ZodObj
26
50
  folder: string;
27
51
  };
28
52
  }, {
29
- workflow: string;
53
+ workflow: string | {
54
+ type: "workflow-v1";
55
+ main: string;
56
+ };
30
57
  model: string;
31
58
  ui: string;
32
59
  }>;
33
60
  export type BlockComponentsDescription = z.infer<ReturnType<typeof BlockComponentsDescription>>;
34
61
  export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumulator?: string[]): z.ZodPipeline<z.ZodObject<{
35
- workflow: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
62
+ workflow: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
36
63
  type: z.ZodLiteral<"explicit-base64">;
37
64
  mimeType: z.ZodString;
38
65
  content: z.ZodString;
@@ -67,7 +94,75 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
67
94
  } | {
68
95
  type: "absolute-file";
69
96
  file: string;
70
- }>;
97
+ }>, {
98
+ type: string;
99
+ main: any;
100
+ }, {
101
+ type: "explicit-base64";
102
+ content: string;
103
+ mimeType: string;
104
+ } | {
105
+ type: "absolute-file";
106
+ file: string;
107
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
108
+ type: z.ZodLiteral<"workflow-v1">;
109
+ main: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
110
+ type: z.ZodLiteral<"explicit-base64">;
111
+ mimeType: z.ZodString;
112
+ content: z.ZodString;
113
+ }, "strict", z.ZodTypeAny, {
114
+ type: "explicit-base64";
115
+ content: string;
116
+ mimeType: string;
117
+ }, {
118
+ type: "explicit-base64";
119
+ content: string;
120
+ mimeType: string;
121
+ }>, z.ZodObject<{
122
+ type: z.ZodLiteral<"absolute-file">;
123
+ file: z.ZodString;
124
+ }, "strict", z.ZodTypeAny, {
125
+ type: "absolute-file";
126
+ file: string;
127
+ }, {
128
+ type: "absolute-file";
129
+ file: string;
130
+ }>]>, {
131
+ type: "relative";
132
+ path: string;
133
+ } | {
134
+ type: "explicit-base64";
135
+ content: string;
136
+ mimeType: string;
137
+ }, {
138
+ type: "explicit-base64";
139
+ content: string;
140
+ mimeType: string;
141
+ } | {
142
+ type: "absolute-file";
143
+ file: string;
144
+ }>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: "workflow-v1";
147
+ main: {
148
+ type: "relative";
149
+ path: string;
150
+ } | {
151
+ type: "explicit-base64";
152
+ content: string;
153
+ mimeType: string;
154
+ };
155
+ }, {
156
+ type: "workflow-v1";
157
+ main: {
158
+ type: "explicit-base64";
159
+ content: string;
160
+ mimeType: string;
161
+ } | {
162
+ type: "absolute-file";
163
+ file: string;
164
+ };
165
+ }>]>]>;
71
166
  model: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
72
167
  type: z.ZodLiteral<"explicit-base64">;
73
168
  mimeType: z.ZodString;
@@ -122,12 +217,18 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
122
217
  }>;
123
218
  }, "strip", z.ZodTypeAny, {
124
219
  workflow: {
125
- type: "relative";
126
- path: string;
220
+ type: string;
221
+ main: any;
127
222
  } | {
128
- type: "explicit-base64";
129
- content: string;
130
- mimeType: string;
223
+ type: "workflow-v1";
224
+ main: {
225
+ type: "relative";
226
+ path: string;
227
+ } | {
228
+ type: "explicit-base64";
229
+ content: string;
230
+ mimeType: string;
231
+ };
131
232
  };
132
233
  model: {
133
234
  type: "relative";
@@ -149,6 +250,16 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
149
250
  } | {
150
251
  type: "absolute-file";
151
252
  file: string;
253
+ } | {
254
+ type: "workflow-v1";
255
+ main: {
256
+ type: "explicit-base64";
257
+ content: string;
258
+ mimeType: string;
259
+ } | {
260
+ type: "absolute-file";
261
+ file: string;
262
+ };
152
263
  };
153
264
  model: {
154
265
  type: "explicit-base64";
@@ -163,7 +274,7 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
163
274
  folder: string;
164
275
  };
165
276
  }>, z.ZodObject<{
166
- workflow: z.ZodObject<{
277
+ workflow: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
167
278
  type: z.ZodLiteral<"relative">;
168
279
  path: z.ZodString;
169
280
  }, "strict", z.ZodTypeAny, {
@@ -172,7 +283,37 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
172
283
  }, {
173
284
  type: "relative";
174
285
  path: string;
175
- }>;
286
+ }>, {
287
+ type: string;
288
+ main: any;
289
+ }, {
290
+ type: "relative";
291
+ path: string;
292
+ }>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
293
+ type: z.ZodLiteral<"workflow-v1">;
294
+ main: z.ZodObject<{
295
+ type: z.ZodLiteral<"relative">;
296
+ path: z.ZodString;
297
+ }, "strict", z.ZodTypeAny, {
298
+ type: "relative";
299
+ path: string;
300
+ }, {
301
+ type: "relative";
302
+ path: string;
303
+ }>;
304
+ }, "strip", z.ZodTypeAny, {
305
+ type: "workflow-v1";
306
+ main: {
307
+ type: "relative";
308
+ path: string;
309
+ };
310
+ }, {
311
+ type: "workflow-v1";
312
+ main: {
313
+ type: "relative";
314
+ path: string;
315
+ };
316
+ }>]>]>;
176
317
  model: z.ZodObject<{
177
318
  type: z.ZodLiteral<"relative">;
178
319
  path: z.ZodString;
@@ -194,191 +335,42 @@ export declare function BlockComponentsConsolidate(dstFolder: string, fileAccumu
194
335
  path: string;
195
336
  }>;
196
337
  }, "strip", z.ZodTypeAny, {
197
- ui: {
198
- type: "relative";
199
- path: string;
200
- };
201
338
  workflow: {
202
- type: "relative";
203
- path: string;
339
+ type: string;
340
+ main: any;
341
+ } | {
342
+ type: "workflow-v1";
343
+ main: {
344
+ type: "relative";
345
+ path: string;
346
+ };
204
347
  };
205
348
  model: {
206
349
  type: "relative";
207
350
  path: string;
208
351
  };
209
- }, {
210
352
  ui: {
211
353
  type: "relative";
212
354
  path: string;
213
355
  };
214
- workflow: {
215
- type: "relative";
216
- path: string;
217
- };
218
- model: {
219
- type: "relative";
220
- path: string;
221
- };
222
- }>>;
223
- export declare function BlockComponentsAbsoluteUrl(prefix: string): z.ZodObject<{
224
- workflow: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
225
- type: z.ZodLiteral<"explicit-base64">;
226
- mimeType: z.ZodString;
227
- content: z.ZodString;
228
- }, "strict", z.ZodTypeAny, {
229
- type: "explicit-base64";
230
- content: string;
231
- mimeType: string;
232
- }, {
233
- type: "explicit-base64";
234
- content: string;
235
- mimeType: string;
236
- }>, z.ZodObject<{
237
- type: z.ZodLiteral<"relative">;
238
- path: z.ZodString;
239
- }, "strict", z.ZodTypeAny, {
240
- type: "relative";
241
- path: string;
242
- }, {
243
- type: "relative";
244
- path: string;
245
- }>]>, {
246
- type: "absolute-url";
247
- url: string;
248
- } | {
249
- type: "explicit-base64";
250
- content: string;
251
- mimeType: string;
252
- }, {
253
- type: "explicit-base64";
254
- content: string;
255
- mimeType: string;
256
- } | {
257
- type: "relative";
258
- path: string;
259
- }>;
260
- model: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
261
- type: z.ZodLiteral<"explicit-base64">;
262
- mimeType: z.ZodString;
263
- content: z.ZodString;
264
- }, "strict", z.ZodTypeAny, {
265
- type: "explicit-base64";
266
- content: string;
267
- mimeType: string;
268
- }, {
269
- type: "explicit-base64";
270
- content: string;
271
- mimeType: string;
272
- }>, z.ZodObject<{
273
- type: z.ZodLiteral<"relative">;
274
- path: z.ZodString;
275
- }, "strict", z.ZodTypeAny, {
276
- type: "relative";
277
- path: string;
278
- }, {
279
- type: "relative";
280
- path: string;
281
- }>]>, {
282
- type: "absolute-url";
283
- url: string;
284
- } | {
285
- type: "explicit-base64";
286
- content: string;
287
- mimeType: string;
288
- }, {
289
- type: "explicit-base64";
290
- content: string;
291
- mimeType: string;
292
- } | {
293
- type: "relative";
294
- path: string;
295
- }>;
296
- ui: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
297
- type: z.ZodLiteral<"explicit-base64">;
298
- mimeType: z.ZodString;
299
- content: z.ZodString;
300
- }, "strict", z.ZodTypeAny, {
301
- type: "explicit-base64";
302
- content: string;
303
- mimeType: string;
304
- }, {
305
- type: "explicit-base64";
306
- content: string;
307
- mimeType: string;
308
- }>, z.ZodObject<{
309
- type: z.ZodLiteral<"relative">;
310
- path: z.ZodString;
311
- }, "strict", z.ZodTypeAny, {
312
- type: "relative";
313
- path: string;
314
- }, {
315
- type: "relative";
316
- path: string;
317
- }>]>, {
318
- type: "absolute-url";
319
- url: string;
320
- } | {
321
- type: "explicit-base64";
322
- content: string;
323
- mimeType: string;
324
- }, {
325
- type: "explicit-base64";
326
- content: string;
327
- mimeType: string;
328
- } | {
329
- type: "relative";
330
- path: string;
331
- }>;
332
- }, "strip", z.ZodTypeAny, {
333
- workflow: {
334
- type: "absolute-url";
335
- url: string;
336
- } | {
337
- type: "explicit-base64";
338
- content: string;
339
- mimeType: string;
340
- };
341
- model: {
342
- type: "absolute-url";
343
- url: string;
344
- } | {
345
- type: "explicit-base64";
346
- content: string;
347
- mimeType: string;
348
- };
349
- ui: {
350
- type: "absolute-url";
351
- url: string;
352
- } | {
353
- type: "explicit-base64";
354
- content: string;
355
- mimeType: string;
356
- };
357
356
  }, {
358
357
  workflow: {
359
- type: "explicit-base64";
360
- content: string;
361
- mimeType: string;
362
- } | {
363
358
  type: "relative";
364
359
  path: string;
360
+ } | {
361
+ type: "workflow-v1";
362
+ main: {
363
+ type: "relative";
364
+ path: string;
365
+ };
365
366
  };
366
367
  model: {
367
- type: "explicit-base64";
368
- content: string;
369
- mimeType: string;
370
- } | {
371
368
  type: "relative";
372
369
  path: string;
373
370
  };
374
371
  ui: {
375
- type: "explicit-base64";
376
- content: string;
377
- mimeType: string;
378
- } | {
379
372
  type: "relative";
380
373
  path: string;
381
374
  };
382
- }>;
383
- export type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;
375
+ }>>;
384
376
  //# 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;AAUxB,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK5D;AACD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC;AAEhG,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKvF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKxD;AACD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC"}
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,KAAK,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC,CAAC;AAEhG,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKvF"}