@milaboratories/pl-model-middle-layer 1.21.0 → 1.23.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 (45) hide show
  1. package/dist/block_meta/block_components.cjs +19 -26
  2. package/dist/block_meta/block_components.cjs.map +1 -1
  3. package/dist/block_meta/block_components.d.ts +46 -428
  4. package/dist/block_meta/block_components.d.ts.map +1 -1
  5. package/dist/block_meta/block_components.js +19 -23
  6. package/dist/block_meta/block_components.js.map +1 -1
  7. package/dist/block_meta/block_description.cjs +5 -3
  8. package/dist/block_meta/block_description.cjs.map +1 -1
  9. package/dist/block_meta/block_description.d.ts +240 -752
  10. package/dist/block_meta/block_description.d.ts.map +1 -1
  11. package/dist/block_meta/block_description.js +5 -3
  12. package/dist/block_meta/block_description.js.map +1 -1
  13. package/dist/block_meta/block_id.d.ts +4 -4
  14. package/dist/block_meta/block_manifest.cjs +10 -1
  15. package/dist/block_meta/block_manifest.cjs.map +1 -1
  16. package/dist/block_meta/block_manifest.d.ts +395 -973
  17. package/dist/block_meta/block_manifest.d.ts.map +1 -1
  18. package/dist/block_meta/block_manifest.js +11 -2
  19. package/dist/block_meta/block_manifest.js.map +1 -1
  20. package/dist/block_meta/block_meta.cjs.map +1 -1
  21. package/dist/block_meta/block_meta.d.ts +128 -210
  22. package/dist/block_meta/block_meta.d.ts.map +1 -1
  23. package/dist/block_meta/block_meta.js.map +1 -1
  24. package/dist/block_meta/content_types.cjs +25 -77
  25. package/dist/block_meta/content_types.cjs.map +1 -1
  26. package/dist/block_meta/content_types.d.ts +65 -381
  27. package/dist/block_meta/content_types.d.ts.map +1 -1
  28. package/dist/block_meta/content_types.js +26 -64
  29. package/dist/block_meta/content_types.js.map +1 -1
  30. package/dist/block_meta/index.d.ts +3 -3
  31. package/dist/block_registry/block_pack_spec.d.ts +16 -16
  32. package/dist/block_registry/overview.d.ts +1540 -1540
  33. package/dist/block_registry/registry_spec.d.ts +12 -12
  34. package/dist/index.cjs +1 -18
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +3 -3
  37. package/dist/pframe/internal_api/table.d.ts +1 -5
  38. package/dist/pframe/internal_api/table.d.ts.map +1 -1
  39. package/package.json +4 -4
  40. package/src/block_meta/block_components.ts +67 -42
  41. package/src/block_meta/block_description.ts +18 -3
  42. package/src/block_meta/block_manifest.ts +14 -3
  43. package/src/block_meta/block_meta.ts +40 -6
  44. package/src/block_meta/content_types.ts +149 -207
  45. package/src/pframe/internal_api/table.ts +1 -7
@@ -1,295 +1,92 @@
1
1
  import { z } from "zod";
2
2
 
3
3
  //#region src/block_meta/content_types.d.ts
4
- declare const ContentExplicitString: z.ZodObject<{
5
- type: z.ZodLiteral<"explicit-string">;
6
- content: z.ZodString;
7
- }, "strict", z.ZodTypeAny, {
8
- type: "explicit-string";
9
- content: string;
10
- }, {
4
+ /** Inlined plain string (e.g. a short text snippet or markdown body). */
5
+ type ContentExplicitString = {
11
6
  type: "explicit-string";
12
7
  content: string;
13
- }>;
14
- type ContentExplicitString = z.infer<typeof ContentExplicitString>;
15
- declare const ContentExplicitBase64: z.ZodObject<{
16
- type: z.ZodLiteral<"explicit-base64">;
17
- mimeType: z.ZodString;
18
- content: z.ZodString;
19
- }, "strict", z.ZodTypeAny, {
20
- type: "explicit-base64";
21
- content: string;
22
- mimeType: string;
23
- }, {
24
- type: "explicit-base64";
8
+ };
9
+ /** Inlined binary blob carried as base64 (e.g. a serialized logo image). */
10
+ type ContentExplicitBase64 = {
11
+ type: "explicit-base64"; /** MIME type used to interpret `content`. */
12
+ mimeType: string; /** Base64-encoded binary payload. */
25
13
  content: string;
14
+ };
15
+ /** Inlined binary blob carried as raw bytes. Wire form only; not used in JSON. */
16
+ type ContentExplicitBytes = {
17
+ type: "explicit-bytes"; /** MIME type used to interpret `content`. */
26
18
  mimeType: string;
27
- }>;
28
- type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;
29
- declare const ContentRelative: z.ZodObject<{
30
- type: z.ZodLiteral<"relative">;
31
- path: z.ZodString;
32
- }, "strict", z.ZodTypeAny, {
19
+ content: Uint8Array;
20
+ };
21
+ /** Reference to a file by path relative to the carrying structure. */
22
+ type ContentRelative = {
33
23
  type: "relative";
34
24
  path: string;
35
- }, {
36
- type: "relative";
37
- path: string;
38
- }>;
39
- type ContentRelative = z.infer<typeof ContentRelative>;
40
- declare const ContentAbsoluteFile: z.ZodObject<{
41
- type: z.ZodLiteral<"absolute-file">;
42
- file: z.ZodString;
43
- }, "strict", z.ZodTypeAny, {
25
+ };
26
+ /** Reference to a file at an absolute local path. */
27
+ type ContentAbsoluteFile = {
44
28
  type: "absolute-file";
45
29
  file: string;
46
- }, {
47
- type: "absolute-file";
48
- file: string;
49
- }>;
50
- type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;
51
- declare const ContentAbsoluteUrl: z.ZodObject<{
52
- type: z.ZodLiteral<"absolute-url">;
53
- url: z.ZodString;
54
- }, "strict", z.ZodTypeAny, {
55
- type: "absolute-url";
56
- url: string;
57
- }, {
58
- type: "absolute-url";
59
- url: string;
60
- }>;
61
- type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;
62
- declare const ContentExplicitBytes: z.ZodObject<{
63
- type: z.ZodLiteral<"explicit-bytes">;
64
- mimeType: z.ZodString;
65
- content: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
66
- }, "strict", z.ZodTypeAny, {
67
- type: "explicit-bytes";
68
- content: Uint8Array<ArrayBuffer>;
69
- mimeType: string;
70
- }, {
71
- type: "explicit-bytes";
72
- content: Uint8Array<ArrayBuffer>;
73
- mimeType: string;
74
- }>;
75
- type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;
76
- declare const ContentAbsoluteFolder: z.ZodObject<{
77
- type: z.ZodLiteral<"absolute-folder">;
78
- folder: z.ZodString;
79
- }, "strict", z.ZodTypeAny, {
30
+ };
31
+ /**
32
+ * Reference to a folder at an absolute local path. Used for UI bundles
33
+ * delivered as folders; the desktop "add block" dialog reads such folders on
34
+ * demand instead of pulling every UI bundle eagerly.
35
+ */
36
+ type ContentAbsoluteFolder = {
80
37
  type: "absolute-folder";
81
38
  folder: string;
82
- }, {
83
- type: "absolute-folder";
84
- folder: string;
85
- }>;
86
- type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;
87
- declare const ContentAny: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
88
- type: z.ZodLiteral<"explicit-string">;
89
- content: z.ZodString;
90
- }, "strict", z.ZodTypeAny, {
91
- type: "explicit-string";
92
- content: string;
93
- }, {
94
- type: "explicit-string";
95
- content: string;
96
- }>, z.ZodObject<{
97
- type: z.ZodLiteral<"explicit-base64">;
98
- mimeType: z.ZodString;
99
- content: z.ZodString;
100
- }, "strict", z.ZodTypeAny, {
101
- type: "explicit-base64";
102
- content: string;
103
- mimeType: string;
104
- }, {
105
- type: "explicit-base64";
106
- content: string;
107
- mimeType: string;
108
- }>, z.ZodObject<{
109
- type: z.ZodLiteral<"relative">;
110
- path: z.ZodString;
111
- }, "strict", z.ZodTypeAny, {
112
- type: "relative";
113
- path: string;
114
- }, {
115
- type: "relative";
116
- path: string;
117
- }>, z.ZodObject<{
118
- type: z.ZodLiteral<"absolute-file">;
119
- file: z.ZodString;
120
- }, "strict", z.ZodTypeAny, {
121
- type: "absolute-file";
122
- file: string;
123
- }, {
124
- type: "absolute-file";
125
- file: string;
126
- }>, z.ZodObject<{
127
- type: z.ZodLiteral<"absolute-url">;
128
- url: z.ZodString;
129
- }, "strict", z.ZodTypeAny, {
130
- type: "absolute-url";
131
- url: string;
132
- }, {
39
+ };
40
+ /** Reference to a file by remote URL (e.g. served from the registry). */
41
+ type ContentAbsoluteUrl = {
133
42
  type: "absolute-url";
134
43
  url: string;
135
- }>]>;
136
- type ContentAny = z.infer<typeof ContentAny>;
137
- declare const ContentExplicitOrRelative: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
138
- type: z.ZodLiteral<"explicit-string">;
139
- content: z.ZodString;
140
- }, "strict", z.ZodTypeAny, {
141
- type: "explicit-string";
142
- content: string;
143
- }, {
144
- type: "explicit-string";
145
- content: string;
146
- }>, z.ZodObject<{
147
- type: z.ZodLiteral<"explicit-base64">;
148
- mimeType: z.ZodString;
149
- content: z.ZodString;
150
- }, "strict", z.ZodTypeAny, {
151
- type: "explicit-base64";
152
- content: string;
153
- mimeType: string;
154
- }, {
155
- type: "explicit-base64";
156
- content: string;
157
- mimeType: string;
158
- }>, z.ZodObject<{
159
- type: z.ZodLiteral<"relative">;
160
- path: z.ZodString;
161
- }, "strict", z.ZodTypeAny, {
162
- type: "relative";
163
- path: string;
164
- }, {
165
- type: "relative";
166
- path: string;
167
- }>]>;
168
- type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;
169
- declare const ContentAnyLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
170
- type: z.ZodLiteral<"explicit-string">;
171
- content: z.ZodString;
172
- }, "strict", z.ZodTypeAny, {
173
- type: "explicit-string";
174
- content: string;
175
- }, {
176
- type: "explicit-string";
177
- content: string;
178
- }>, z.ZodObject<{
44
+ };
45
+ /** Canonical union of every content carrier shape used across the platform. */
46
+ type Content = ContentExplicitString | ContentExplicitBase64 | ContentExplicitBytes | ContentRelative | ContentAbsoluteFile | ContentAbsoluteFolder | ContentAbsoluteUrl;
47
+ /** Inlined or relative-path content (text/binary inlined, or relative path). */
48
+ type ContentExplicitOrRelative = ContentExplicitString | ContentExplicitBase64 | ContentRelative;
49
+ /** Any locally-resolvable content (inlined, relative path, or absolute file). */
50
+ type ContentAnyLocal = ContentExplicitString | ContentExplicitBase64 | ContentRelative | ContentAbsoluteFile;
51
+ /** Text content available locally (inlined, relative path, or absolute file). */
52
+ type ContentAnyTextLocal = ContentExplicitString | ContentRelative | ContentAbsoluteFile;
53
+ /** Binary content available locally (inlined base64, relative path, or absolute file). */
54
+ type ContentAnyBinaryLocal = ContentExplicitBase64 | ContentRelative | ContentAbsoluteFile;
55
+ /** Binary content fully resolved (inlined base64 or absolute file). */
56
+ type ContentAbsoluteBinaryLocal = ContentExplicitBase64 | ContentAbsoluteFile;
57
+ /** Text content fully resolved (inlined string or absolute file). */
58
+ type ContentAbsoluteTextLocal = ContentExplicitString | ContentAbsoluteFile;
59
+ /** Binary content in manifest form (inlined base64 or path relative to the manifest). */
60
+ type ContentRelativeBinary = ContentExplicitBase64 | ContentRelative;
61
+ /** Text content in manifest form (inlined string or path relative to the manifest). */
62
+ type ContentRelativeText = ContentExplicitString | ContentRelative;
63
+ declare const ContentExplicitBase64: z.ZodObject<{
179
64
  type: z.ZodLiteral<"explicit-base64">;
180
65
  mimeType: z.ZodString;
181
66
  content: z.ZodString;
182
67
  }, "strict", z.ZodTypeAny, {
183
68
  type: "explicit-base64";
184
- content: string;
185
- mimeType: string;
186
- }, {
187
- type: "explicit-base64";
188
- content: string;
189
69
  mimeType: string;
190
- }>, z.ZodObject<{
191
- type: z.ZodLiteral<"relative">;
192
- path: z.ZodString;
193
- }, "strict", z.ZodTypeAny, {
194
- type: "relative";
195
- path: string;
196
- }, {
197
- type: "relative";
198
- path: string;
199
- }>, z.ZodObject<{
200
- type: z.ZodLiteral<"absolute-file">;
201
- file: z.ZodString;
202
- }, "strict", z.ZodTypeAny, {
203
- type: "absolute-file";
204
- file: string;
205
- }, {
206
- type: "absolute-file";
207
- file: string;
208
- }>]>;
209
- type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;
210
- declare const ContentAnyRemote: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
211
- type: z.ZodLiteral<"explicit-string">;
212
- content: z.ZodString;
213
- }, "strict", z.ZodTypeAny, {
214
- type: "explicit-string";
215
70
  content: string;
216
71
  }, {
217
- type: "explicit-string";
218
- content: string;
219
- }>, z.ZodObject<{
220
- type: z.ZodLiteral<"explicit-base64">;
221
- mimeType: z.ZodString;
222
- content: z.ZodString;
223
- }, "strict", z.ZodTypeAny, {
224
72
  type: "explicit-base64";
225
- content: string;
226
73
  mimeType: string;
227
- }, {
228
- type: "explicit-base64";
229
74
  content: string;
230
- mimeType: string;
231
- }>, z.ZodObject<{
232
- type: z.ZodLiteral<"relative">;
233
- path: z.ZodString;
234
- }, "strict", z.ZodTypeAny, {
235
- type: "relative";
236
- path: string;
237
- }, {
238
- type: "relative";
239
- path: string;
240
- }>, z.ZodObject<{
241
- type: z.ZodLiteral<"absolute-url">;
242
- url: z.ZodString;
243
- }, "strict", z.ZodTypeAny, {
244
- type: "absolute-url";
245
- url: string;
246
- }, {
247
- type: "absolute-url";
248
- url: string;
249
- }>]>;
250
- type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;
251
- declare const ContentAnyBinaryLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
252
- type: z.ZodLiteral<"explicit-base64">;
75
+ }>;
76
+ declare const ContentExplicitBytes: z.ZodObject<{
77
+ type: z.ZodLiteral<"explicit-bytes">;
253
78
  mimeType: z.ZodString;
254
- content: z.ZodString;
79
+ content: z.ZodType<Uint8Array<ArrayBuffer>, z.ZodTypeDef, Uint8Array<ArrayBuffer>>;
255
80
  }, "strict", z.ZodTypeAny, {
256
- type: "explicit-base64";
257
- content: string;
81
+ type: "explicit-bytes";
258
82
  mimeType: string;
83
+ content: Uint8Array<ArrayBuffer>;
259
84
  }, {
260
- type: "explicit-base64";
261
- content: string;
85
+ type: "explicit-bytes";
262
86
  mimeType: string;
263
- }>, z.ZodObject<{
264
- type: z.ZodLiteral<"relative">;
265
- path: z.ZodString;
266
- }, "strict", z.ZodTypeAny, {
267
- type: "relative";
268
- path: string;
269
- }, {
270
- type: "relative";
271
- path: string;
272
- }>, z.ZodObject<{
273
- type: z.ZodLiteral<"absolute-file">;
274
- file: z.ZodString;
275
- }, "strict", z.ZodTypeAny, {
276
- type: "absolute-file";
277
- file: string;
278
- }, {
279
- type: "absolute-file";
280
- file: string;
281
- }>]>;
282
- type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;
283
- declare const ContentAnyTextLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
284
- type: z.ZodLiteral<"explicit-string">;
285
- content: z.ZodString;
286
- }, "strict", z.ZodTypeAny, {
287
- type: "explicit-string";
288
- content: string;
289
- }, {
290
- type: "explicit-string";
291
- content: string;
292
- }>, z.ZodObject<{
87
+ content: Uint8Array<ArrayBuffer>;
88
+ }>;
89
+ declare const ContentRelative: z.ZodObject<{
293
90
  type: z.ZodLiteral<"relative">;
294
91
  path: z.ZodString;
295
92
  }, "strict", z.ZodTypeAny, {
@@ -298,115 +95,19 @@ declare const ContentAnyTextLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
298
95
  }, {
299
96
  type: "relative";
300
97
  path: string;
301
- }>, z.ZodObject<{
302
- type: z.ZodLiteral<"absolute-file">;
303
- file: z.ZodString;
304
- }, "strict", z.ZodTypeAny, {
305
- type: "absolute-file";
306
- file: string;
307
- }, {
308
- type: "absolute-file";
309
- file: string;
310
- }>]>;
311
- type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;
312
- declare const ContentAbsoluteBinaryRemote: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
313
- type: z.ZodLiteral<"explicit-base64">;
314
- mimeType: z.ZodString;
315
- content: z.ZodString;
316
- }, "strict", z.ZodTypeAny, {
317
- type: "explicit-base64";
318
- content: string;
319
- mimeType: string;
320
- }, {
321
- type: "explicit-base64";
322
- content: string;
323
- mimeType: string;
324
- }>, z.ZodObject<{
325
- type: z.ZodLiteral<"absolute-url">;
326
- url: z.ZodString;
327
- }, "strict", z.ZodTypeAny, {
328
- type: "absolute-url";
329
- url: string;
330
- }, {
331
- type: "absolute-url";
332
- url: string;
333
- }>]>;
334
- type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;
335
- declare const ContentAbsoluteBinaryLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
98
+ }>;
99
+ declare const ContentRelativeBinary: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
336
100
  type: z.ZodLiteral<"explicit-base64">;
337
101
  mimeType: z.ZodString;
338
102
  content: z.ZodString;
339
103
  }, "strict", z.ZodTypeAny, {
340
104
  type: "explicit-base64";
341
- content: string;
342
105
  mimeType: string;
343
- }, {
344
- type: "explicit-base64";
345
106
  content: string;
346
- mimeType: string;
347
- }>, z.ZodObject<{
348
- type: z.ZodLiteral<"absolute-file">;
349
- file: z.ZodString;
350
- }, "strict", z.ZodTypeAny, {
351
- type: "absolute-file";
352
- file: string;
353
107
  }, {
354
- type: "absolute-file";
355
- file: string;
356
- }>]>;
357
- type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;
358
- declare const ContentAbsoluteTextRemote: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
359
- type: z.ZodLiteral<"explicit-string">;
360
- content: z.ZodString;
361
- }, "strict", z.ZodTypeAny, {
362
- type: "explicit-string";
363
- content: string;
364
- }, {
365
- type: "explicit-string";
366
- content: string;
367
- }>, z.ZodObject<{
368
- type: z.ZodLiteral<"absolute-url">;
369
- url: z.ZodString;
370
- }, "strict", z.ZodTypeAny, {
371
- type: "absolute-url";
372
- url: string;
373
- }, {
374
- type: "absolute-url";
375
- url: string;
376
- }>]>;
377
- type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;
378
- declare const ContentAbsoluteTextLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
379
- type: z.ZodLiteral<"explicit-string">;
380
- content: z.ZodString;
381
- }, "strict", z.ZodTypeAny, {
382
- type: "explicit-string";
383
- content: string;
384
- }, {
385
- type: "explicit-string";
386
- content: string;
387
- }>, z.ZodObject<{
388
- type: z.ZodLiteral<"absolute-file">;
389
- file: z.ZodString;
390
- }, "strict", z.ZodTypeAny, {
391
- type: "absolute-file";
392
- file: string;
393
- }, {
394
- type: "absolute-file";
395
- file: string;
396
- }>]>;
397
- type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;
398
- declare const ContentRelativeBinary: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
399
- type: z.ZodLiteral<"explicit-base64">;
400
- mimeType: z.ZodString;
401
- content: z.ZodString;
402
- }, "strict", z.ZodTypeAny, {
403
108
  type: "explicit-base64";
404
- content: string;
405
109
  mimeType: string;
406
- }, {
407
- type: "explicit-base64";
408
110
  content: string;
409
- mimeType: string;
410
111
  }>, z.ZodObject<{
411
112
  type: z.ZodLiteral<"relative">;
412
113
  path: z.ZodString;
@@ -417,7 +118,6 @@ declare const ContentRelativeBinary: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
417
118
  type: "relative";
418
119
  path: string;
419
120
  }>]>;
420
- type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;
421
121
  declare const ContentRelativeText: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
422
122
  type: z.ZodLiteral<"explicit-string">;
423
123
  content: z.ZodString;
@@ -437,26 +137,18 @@ declare const ContentRelativeText: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
437
137
  type: "relative";
438
138
  path: string;
439
139
  }>]>;
440
- type ContentRelativeText = z.infer<typeof ContentRelativeText>;
441
- declare const DescriptionContentBinary: z.ZodUnion<[z.ZodEffects<z.ZodString, {
442
- type: "relative";
443
- path: string;
444
- } | {
445
- type: "explicit-base64";
446
- content: string;
447
- mimeType: string;
448
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
140
+ declare const DescriptionContentBinary: z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeBinary, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
449
141
  type: z.ZodLiteral<"explicit-base64">;
450
142
  mimeType: z.ZodString;
451
143
  content: z.ZodString;
452
144
  }, "strict", z.ZodTypeAny, {
453
145
  type: "explicit-base64";
454
- content: string;
455
146
  mimeType: string;
147
+ content: string;
456
148
  }, {
457
149
  type: "explicit-base64";
458
- content: string;
459
150
  mimeType: string;
151
+ content: string;
460
152
  }>, z.ZodObject<{
461
153
  type: z.ZodLiteral<"relative">;
462
154
  path: z.ZodString;
@@ -476,14 +168,7 @@ declare const DescriptionContentBinary: z.ZodUnion<[z.ZodEffects<z.ZodString, {
476
168
  type: "absolute-file";
477
169
  file: string;
478
170
  }>]>]>;
479
- type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;
480
- declare const DescriptionContentText: z.ZodUnion<[z.ZodEffects<z.ZodString, {
481
- type: "relative";
482
- path: string;
483
- } | {
484
- type: "explicit-string";
485
- content: string;
486
- }, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
171
+ declare const DescriptionContentText: z.ZodUnion<[z.ZodEffects<z.ZodString, ContentRelativeText, string>, z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
487
172
  type: z.ZodLiteral<"explicit-string">;
488
173
  content: z.ZodString;
489
174
  }, "strict", z.ZodTypeAny, {
@@ -511,7 +196,6 @@ declare const DescriptionContentText: z.ZodUnion<[z.ZodEffects<z.ZodString, {
511
196
  type: "absolute-file";
512
197
  file: string;
513
198
  }>]>]>;
514
- type DescriptionContentText = z.infer<typeof DescriptionContentText>;
515
199
  //#endregion
516
- export { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
200
+ export { Content, ContentAbsoluteBinaryLocal, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteUrl, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
517
201
  //# sourceMappingURL=content_types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content_types.d.ts","names":[],"sources":["../../src/block_meta/content_types.ts"],"mappings":";;;cAMa,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;KAMtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEtC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;KAUtB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEtC,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;KAUhB,eAAA,GAAkB,CAAA,CAAE,KAAA,QAAa,eAAA;AAAA,cAIhC,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;KASpB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAEpC,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;;;;;;;KAMnB,kBAAA,GAAqB,CAAA,CAAE,KAAA,QAAa,kBAAA;AAAA,cAMnC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;KAUrB,oBAAA,GAAuB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAErC,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;KAStB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAMtC,UAAA,EAAU,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOX,UAAA,GAAa,CAAA,CAAE,KAAA,QAAa,UAAA;AAAA,cAE3B,yBAAA,EAAyB,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAK1B,yBAAA,GA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\\\)`);
4
+ const contentExplicitStringSchema = z.object({
4
5
  type: z.literal("explicit-string"),
5
- content: z.string().describe("Actual string value")
6
+ content: z.string()
6
7
  }).strict();
7
8
  const ContentExplicitBase64 = z.object({
8
9
  type: z.literal("explicit-base64"),
9
- mimeType: z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
10
- content: z.string().base64().describe("Base64 encoded binary value")
10
+ mimeType: z.string().regex(/\w+\/[-+.\w]+/),
11
+ content: z.string().base64()
12
+ }).strict();
13
+ const ContentExplicitBytes = z.object({
14
+ type: z.literal("explicit-bytes"),
15
+ mimeType: z.string().regex(/\w+\/[-+.\w]+/),
16
+ content: z.instanceof(Uint8Array)
11
17
  }).strict();
12
18
  const ContentRelative = z.object({
13
19
  type: z.literal("relative"),
14
- path: z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")
20
+ path: z.string()
15
21
  }).strict();
16
- const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
17
- const ContentAbsoluteFile = z.object({
22
+ const contentAbsoluteFileSchema = z.object({
18
23
  type: z.literal("absolute-file"),
19
- file: z.string().regex(absPathRegex, "path to file must be absolute").describe("Absolute address of the file in local file system")
20
- }).strict();
21
- const ContentAbsoluteUrl = z.object({
22
- type: z.literal("absolute-url"),
23
- url: z.string().url().describe("Global URL to reach the requested file")
24
+ file: z.string().regex(absPathRegex, "path to file must be absolute")
24
25
  }).strict();
25
- const ContentExplicitBytes = z.object({
26
- type: z.literal("explicit-bytes"),
27
- mimeType: z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
28
- content: z.instanceof(Uint8Array).describe("Raw content")
29
- }).strict();
30
- const ContentAbsoluteFolder = z.object({
31
- type: z.literal("absolute-folder"),
32
- folder: z.string().regex(absPathRegex, "path to folder must be absolute").describe("Absolute address of the folder in local file system")
33
- }).strict();
34
- const ContentAny = z.discriminatedUnion("type", [
35
- ContentExplicitString,
36
- ContentExplicitBase64,
37
- ContentRelative,
38
- ContentAbsoluteFile,
39
- ContentAbsoluteUrl
40
- ]);
41
- const ContentExplicitOrRelative = z.discriminatedUnion("type", [
42
- ContentExplicitString,
43
- ContentExplicitBase64,
44
- ContentRelative
45
- ]);
46
- const ContentAnyLocal = z.discriminatedUnion("type", [
47
- ContentExplicitString,
48
- ContentExplicitBase64,
49
- ContentRelative,
50
- ContentAbsoluteFile
51
- ]);
52
- const ContentAnyRemote = z.discriminatedUnion("type", [
53
- ContentExplicitString,
54
- ContentExplicitBase64,
55
- ContentRelative,
56
- ContentAbsoluteUrl
57
- ]);
58
- const ContentAnyBinaryLocal = z.discriminatedUnion("type", [
59
- ContentExplicitBase64,
60
- ContentRelative,
61
- ContentAbsoluteFile
62
- ]);
63
- const ContentAnyTextLocal = z.discriminatedUnion("type", [
64
- ContentExplicitString,
65
- ContentRelative,
66
- ContentAbsoluteFile
67
- ]);
68
- const ContentAbsoluteBinaryRemote = z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteUrl]);
69
- const ContentAbsoluteBinaryLocal = z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteFile]);
70
- const ContentAbsoluteTextRemote = z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteUrl]);
71
- const ContentAbsoluteTextLocal = z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteFile]);
72
26
  const ContentRelativeBinary = z.discriminatedUnion("type", [ContentExplicitBase64, ContentRelative]);
73
- const ContentRelativeText = z.discriminatedUnion("type", [ContentExplicitString, ContentRelative]);
27
+ const ContentRelativeText = z.discriminatedUnion("type", [contentExplicitStringSchema, ContentRelative]);
74
28
  const DescriptionContentBinary = z.union([z.string().startsWith("file:").transform((value) => ({
75
29
  type: "relative",
76
30
  path: value.slice(5)
77
- })), ContentAnyBinaryLocal]);
31
+ })), z.discriminatedUnion("type", [
32
+ ContentExplicitBase64,
33
+ ContentRelative,
34
+ contentAbsoluteFileSchema
35
+ ])]);
78
36
  const DescriptionContentText = z.union([z.string().transform((value) => {
79
37
  if (value.startsWith("file:")) return {
80
38
  type: "relative",
81
39
  path: value.slice(5)
82
40
  };
83
- else return {
41
+ return {
84
42
  type: "explicit-string",
85
43
  content: value
86
44
  };
87
- }), ContentAnyTextLocal]);
45
+ }), z.discriminatedUnion("type", [
46
+ contentExplicitStringSchema,
47
+ ContentRelative,
48
+ contentAbsoluteFileSchema
49
+ ])]);
88
50
  //#endregion
89
- export { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
51
+ export { ContentExplicitBase64, ContentExplicitBytes, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
90
52
 
91
53
  //# sourceMappingURL=content_types.js.map