@milaboratories/pl-model-middle-layer 1.20.0 → 1.22.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/dist/block_meta/block_components.cjs +19 -26
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +46 -428
- package/dist/block_meta/block_components.d.ts.map +1 -1
- package/dist/block_meta/block_components.js +19 -23
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +5 -3
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +277 -789
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_description.js +5 -3
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +10 -1
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +700 -1278
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.js +11 -2
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +92 -174
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/content_types.cjs +25 -77
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +67 -383
- package/dist/block_meta/content_types.d.ts.map +1 -1
- package/dist/block_meta/content_types.js +26 -64
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.d.ts +3 -3
- package/dist/block_registry/block_pack_spec.d.ts +8 -8
- package/dist/block_registry/overview.d.ts +200 -200
- package/dist/block_registry/registry_spec.d.ts +20 -20
- package/dist/index.cjs +1 -18
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +36 -2
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +40 -3
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +5 -5
- package/dist/pframe/internal_api/pframe.d.ts +21 -3
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +51 -1
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/block_meta/block_components.ts +67 -42
- package/src/block_meta/block_description.ts +18 -3
- package/src/block_meta/block_manifest.ts +14 -3
- package/src/block_meta/block_meta.ts +40 -6
- package/src/block_meta/content_types.ts +149 -207
- package/src/pframe/internal_api/api_factory.ts +44 -0
- package/src/pframe/internal_api/api_read.ts +48 -1
- package/src/pframe/internal_api/pframe.ts +23 -2
- package/src/pframe/internal_api/table.ts +54 -0
|
@@ -1,17 +1,65 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/block_meta/content_types.d.ts
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
content: z.ZodString;
|
|
7
|
-
}, "strict", z.ZodTypeAny, {
|
|
4
|
+
/** Inlined plain string (e.g. a short text snippet or markdown body). */
|
|
5
|
+
type ContentExplicitString = {
|
|
8
6
|
type: "explicit-string";
|
|
9
7
|
content: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
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. */
|
|
12
13
|
content: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
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`. */
|
|
18
|
+
mimeType: string;
|
|
19
|
+
content: Uint8Array;
|
|
20
|
+
};
|
|
21
|
+
/** Reference to a file by path relative to the carrying structure. */
|
|
22
|
+
type ContentRelative = {
|
|
23
|
+
type: "relative";
|
|
24
|
+
path: string;
|
|
25
|
+
};
|
|
26
|
+
/** Reference to a file at an absolute local path. */
|
|
27
|
+
type ContentAbsoluteFile = {
|
|
28
|
+
type: "absolute-file";
|
|
29
|
+
file: string;
|
|
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 = {
|
|
37
|
+
type: "absolute-folder";
|
|
38
|
+
folder: string;
|
|
39
|
+
};
|
|
40
|
+
/** Reference to a file by remote URL (e.g. served from the registry). */
|
|
41
|
+
type ContentAbsoluteUrl = {
|
|
42
|
+
type: "absolute-url";
|
|
43
|
+
url: string;
|
|
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;
|
|
15
63
|
declare const ContentExplicitBase64: z.ZodObject<{
|
|
16
64
|
type: z.ZodLiteral<"explicit-base64">;
|
|
17
65
|
mimeType: z.ZodString;
|
|
@@ -25,40 +73,6 @@ declare const ContentExplicitBase64: z.ZodObject<{
|
|
|
25
73
|
mimeType: string;
|
|
26
74
|
content: string;
|
|
27
75
|
}>;
|
|
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, {
|
|
33
|
-
type: "relative";
|
|
34
|
-
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, {
|
|
44
|
-
type: "absolute-file";
|
|
45
|
-
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
76
|
declare const ContentExplicitBytes: z.ZodObject<{
|
|
63
77
|
type: z.ZodLiteral<"explicit-bytes">;
|
|
64
78
|
mimeType: z.ZodString;
|
|
@@ -72,183 +86,17 @@ declare const ContentExplicitBytes: z.ZodObject<{
|
|
|
72
86
|
mimeType: string;
|
|
73
87
|
content: Uint8Array<ArrayBuffer>;
|
|
74
88
|
}>;
|
|
75
|
-
|
|
76
|
-
declare const ContentAbsoluteFolder: z.ZodObject<{
|
|
77
|
-
type: z.ZodLiteral<"absolute-folder">;
|
|
78
|
-
folder: z.ZodString;
|
|
79
|
-
}, "strict", z.ZodTypeAny, {
|
|
80
|
-
type: "absolute-folder";
|
|
81
|
-
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
|
-
mimeType: string;
|
|
103
|
-
content: string;
|
|
104
|
-
}, {
|
|
105
|
-
type: "explicit-base64";
|
|
106
|
-
mimeType: string;
|
|
107
|
-
content: 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
|
-
}, {
|
|
133
|
-
type: "absolute-url";
|
|
134
|
-
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
|
-
mimeType: string;
|
|
153
|
-
content: string;
|
|
154
|
-
}, {
|
|
155
|
-
type: "explicit-base64";
|
|
156
|
-
mimeType: string;
|
|
157
|
-
content: 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<{
|
|
179
|
-
type: z.ZodLiteral<"explicit-base64">;
|
|
180
|
-
mimeType: z.ZodString;
|
|
181
|
-
content: z.ZodString;
|
|
182
|
-
}, "strict", z.ZodTypeAny, {
|
|
183
|
-
type: "explicit-base64";
|
|
184
|
-
mimeType: string;
|
|
185
|
-
content: string;
|
|
186
|
-
}, {
|
|
187
|
-
type: "explicit-base64";
|
|
188
|
-
mimeType: string;
|
|
189
|
-
content: string;
|
|
190
|
-
}>, z.ZodObject<{
|
|
89
|
+
declare const ContentRelative: z.ZodObject<{
|
|
191
90
|
type: z.ZodLiteral<"relative">;
|
|
192
91
|
path: z.ZodString;
|
|
193
92
|
}, "strict", z.ZodTypeAny, {
|
|
194
|
-
type: "relative";
|
|
195
93
|
path: string;
|
|
196
|
-
}, {
|
|
197
94
|
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
|
-
content: string;
|
|
216
|
-
}, {
|
|
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
|
-
type: "explicit-base64";
|
|
225
|
-
mimeType: string;
|
|
226
|
-
content: string;
|
|
227
95
|
}, {
|
|
228
|
-
type: "explicit-base64";
|
|
229
|
-
mimeType: string;
|
|
230
|
-
content: string;
|
|
231
|
-
}>, z.ZodObject<{
|
|
232
|
-
type: z.ZodLiteral<"relative">;
|
|
233
|
-
path: z.ZodString;
|
|
234
|
-
}, "strict", z.ZodTypeAny, {
|
|
235
|
-
type: "relative";
|
|
236
96
|
path: string;
|
|
237
|
-
}, {
|
|
238
97
|
type: "relative";
|
|
239
|
-
|
|
240
|
-
|
|
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<{
|
|
98
|
+
}>;
|
|
99
|
+
declare const ContentRelativeBinary: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
252
100
|
type: z.ZodLiteral<"explicit-base64">;
|
|
253
101
|
mimeType: z.ZodString;
|
|
254
102
|
content: z.ZodString;
|
|
@@ -264,118 +112,13 @@ declare const ContentAnyBinaryLocal: z.ZodDiscriminatedUnion<"type", [z.ZodObjec
|
|
|
264
112
|
type: z.ZodLiteral<"relative">;
|
|
265
113
|
path: z.ZodString;
|
|
266
114
|
}, "strict", z.ZodTypeAny, {
|
|
267
|
-
type: "relative";
|
|
268
115
|
path: string;
|
|
269
|
-
}, {
|
|
270
116
|
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
117
|
}, {
|
|
290
|
-
type: "explicit-string";
|
|
291
|
-
content: string;
|
|
292
|
-
}>, z.ZodObject<{
|
|
293
|
-
type: z.ZodLiteral<"relative">;
|
|
294
|
-
path: z.ZodString;
|
|
295
|
-
}, "strict", z.ZodTypeAny, {
|
|
296
|
-
type: "relative";
|
|
297
118
|
path: string;
|
|
298
|
-
}, {
|
|
299
119
|
type: "relative";
|
|
300
|
-
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
120
|
}>]>;
|
|
311
|
-
|
|
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
|
-
mimeType: string;
|
|
319
|
-
content: string;
|
|
320
|
-
}, {
|
|
321
|
-
type: "explicit-base64";
|
|
322
|
-
mimeType: string;
|
|
323
|
-
content: 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<{
|
|
336
|
-
type: z.ZodLiteral<"explicit-base64">;
|
|
337
|
-
mimeType: z.ZodString;
|
|
338
|
-
content: z.ZodString;
|
|
339
|
-
}, "strict", z.ZodTypeAny, {
|
|
340
|
-
type: "explicit-base64";
|
|
341
|
-
mimeType: string;
|
|
342
|
-
content: string;
|
|
343
|
-
}, {
|
|
344
|
-
type: "explicit-base64";
|
|
345
|
-
mimeType: string;
|
|
346
|
-
content: 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
|
-
}, {
|
|
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<{
|
|
121
|
+
declare const ContentRelativeText: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
379
122
|
type: z.ZodLiteral<"explicit-string">;
|
|
380
123
|
content: z.ZodString;
|
|
381
124
|
}, "strict", z.ZodTypeAny, {
|
|
@@ -384,68 +127,17 @@ declare const ContentAbsoluteTextLocal: z.ZodDiscriminatedUnion<"type", [z.ZodOb
|
|
|
384
127
|
}, {
|
|
385
128
|
type: "explicit-string";
|
|
386
129
|
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
|
-
type: "explicit-base64";
|
|
404
|
-
mimeType: string;
|
|
405
|
-
content: string;
|
|
406
|
-
}, {
|
|
407
|
-
type: "explicit-base64";
|
|
408
|
-
mimeType: string;
|
|
409
|
-
content: string;
|
|
410
130
|
}>, z.ZodObject<{
|
|
411
131
|
type: z.ZodLiteral<"relative">;
|
|
412
132
|
path: z.ZodString;
|
|
413
133
|
}, "strict", z.ZodTypeAny, {
|
|
414
|
-
type: "relative";
|
|
415
134
|
path: string;
|
|
416
|
-
}, {
|
|
417
135
|
type: "relative";
|
|
418
|
-
path: string;
|
|
419
|
-
}>]>;
|
|
420
|
-
type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;
|
|
421
|
-
declare const ContentRelativeText: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
422
|
-
type: z.ZodLiteral<"explicit-string">;
|
|
423
|
-
content: z.ZodString;
|
|
424
|
-
}, "strict", z.ZodTypeAny, {
|
|
425
|
-
type: "explicit-string";
|
|
426
|
-
content: string;
|
|
427
136
|
}, {
|
|
428
|
-
type: "explicit-string";
|
|
429
|
-
content: string;
|
|
430
|
-
}>, z.ZodObject<{
|
|
431
|
-
type: z.ZodLiteral<"relative">;
|
|
432
|
-
path: z.ZodString;
|
|
433
|
-
}, "strict", z.ZodTypeAny, {
|
|
434
|
-
type: "relative";
|
|
435
137
|
path: string;
|
|
436
|
-
}, {
|
|
437
138
|
type: "relative";
|
|
438
|
-
path: string;
|
|
439
139
|
}>]>;
|
|
440
|
-
|
|
441
|
-
declare const DescriptionContentBinary: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
442
|
-
type: "explicit-base64";
|
|
443
|
-
mimeType: string;
|
|
444
|
-
content: string;
|
|
445
|
-
} | {
|
|
446
|
-
type: "relative";
|
|
447
|
-
path: 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;
|
|
@@ -461,11 +153,11 @@ declare const DescriptionContentBinary: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
|
461
153
|
type: z.ZodLiteral<"relative">;
|
|
462
154
|
path: z.ZodString;
|
|
463
155
|
}, "strict", z.ZodTypeAny, {
|
|
464
|
-
type: "relative";
|
|
465
156
|
path: string;
|
|
466
|
-
}, {
|
|
467
157
|
type: "relative";
|
|
158
|
+
}, {
|
|
468
159
|
path: string;
|
|
160
|
+
type: "relative";
|
|
469
161
|
}>, z.ZodObject<{
|
|
470
162
|
type: z.ZodLiteral<"absolute-file">;
|
|
471
163
|
file: 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
|
-
|
|
480
|
-
declare const DescriptionContentText: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
481
|
-
type: "explicit-string";
|
|
482
|
-
content: string;
|
|
483
|
-
} | {
|
|
484
|
-
type: "relative";
|
|
485
|
-
path: 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, {
|
|
@@ -496,11 +181,11 @@ declare const DescriptionContentText: z.ZodUnion<[z.ZodEffects<z.ZodString, {
|
|
|
496
181
|
type: z.ZodLiteral<"relative">;
|
|
497
182
|
path: z.ZodString;
|
|
498
183
|
}, "strict", z.ZodTypeAny, {
|
|
499
|
-
type: "relative";
|
|
500
184
|
path: string;
|
|
501
|
-
}, {
|
|
502
185
|
type: "relative";
|
|
186
|
+
}, {
|
|
503
187
|
path: string;
|
|
188
|
+
type: "relative";
|
|
504
189
|
}>, z.ZodObject<{
|
|
505
190
|
type: z.ZodLiteral<"absolute-file">;
|
|
506
191
|
file: z.ZodString;
|
|
@@ -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 {
|
|
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":"
|
|
1
|
+
{"version":3,"file":"content_types.d.ts","names":[],"sources":["../../src/block_meta/content_types.ts"],"mappings":";;;;KAUY,qBAAA;EACV,IAAA;EACA,OAAA;AAAA;;KAIU,qBAAA;EACV,IAAA,qBAD+B;EAG/B,QAAA,UAH+B;EAK/B,OAAA;AAAA;;KAIU,oBAAA;EACV,IAAA,oBADU;EAGV,QAAA;EACA,OAAA,EAAS,UAAA;AAAA;;KAIC,eAAA;EACV,IAAA;EACA,IAAA;AAAA;;KAIU,mBAAA;EACV,IAAA;EACA,IAAA;AAAA;;AAFF;;;;KAUY,qBAAA;EACV,IAAA;EACA,MAAA;AAAA;;KAIU,kBAAA;EACV,IAAA;EACA,GAAA;AAAA;;KAIU,OAAA,GACR,qBAAA,GACA,qBAAA,GACA,oBAAA,GACA,eAAA,GACA,mBAAA,GACA,qBAAA,GACA,kBAAA;AAPJ;AAAA,KAeY,yBAAA,GACR,qBAAA,GACA,qBAAA,GACA,eAAA;;KAGQ,eAAA,GACR,qBAAA,GACA,qBAAA,GACA,eAAA,GACA,mBAAA;;KAGQ,mBAAA,GAAsB,qBAAA,GAAwB,eAAA,GAAkB,mBAAA;;KAGhE,qBAAA,GAAwB,qBAAA,GAAwB,eAAA,GAAkB,mBAAA;;KAGlE,0BAAA,GAA6B,qBAAA,GAAwB,mBAAA;;KAGrD,wBAAA,GAA2B,qBAAA,GAAwB,mBAAA;;KAGnD,qBAAA,GAAwB,qBAAA,GAAwB,eAAA;;KAGhD,mBAAA,GAAsB,qBAAA,GAAwB,eAAA;AAAA,cAkB7C,qBAAA,EAAqB,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAQrB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;cAQpB,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;cAcf,qBAAA,EAAqB,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;cAKrB,mBAAA,EAAmB,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;cAYnB,wBAAA,EAAwB,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,SAAA,EAAA,qBAAA,WAAA,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWxB,sBAAA,EAAsB,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,SAAA,EAAA,mBAAA,WAAA,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA"}
|
|
@@ -1,91 +1,53 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
//#region src/block_meta/content_types.ts
|
|
3
|
-
const
|
|
3
|
+
const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
|
|
4
|
+
const contentExplicitStringSchema = z.object({
|
|
4
5
|
type: z.literal("explicit-string"),
|
|
5
|
-
content: z.string()
|
|
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]+/)
|
|
10
|
-
content: z.string().base64()
|
|
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()
|
|
20
|
+
path: z.string()
|
|
15
21
|
}).strict();
|
|
16
|
-
const
|
|
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")
|
|
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", [
|
|
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
|
-
})),
|
|
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
|
-
|
|
41
|
+
return {
|
|
84
42
|
type: "explicit-string",
|
|
85
43
|
content: value
|
|
86
44
|
};
|
|
87
|
-
}),
|
|
45
|
+
}), z.discriminatedUnion("type", [
|
|
46
|
+
contentExplicitStringSchema,
|
|
47
|
+
ContentRelative,
|
|
48
|
+
contentAbsoluteFileSchema
|
|
49
|
+
])]);
|
|
88
50
|
//#endregion
|
|
89
|
-
export {
|
|
51
|
+
export { ContentExplicitBase64, ContentExplicitBytes, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
|
|
90
52
|
|
|
91
53
|
//# sourceMappingURL=content_types.js.map
|