@milaboratories/pl-model-middle-layer 1.12.7 → 1.12.9
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/_virtual/_rolldown/runtime.cjs +43 -0
- package/dist/_virtual/_rolldown/runtime.js +18 -0
- package/dist/author_marker.d.ts +2 -5
- package/dist/block_meta/block_components.cjs +21 -29
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +537 -533
- package/dist/block_meta/block_components.js +20 -27
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +22 -25
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +1815 -1812
- package/dist/block_meta/block_description.js +20 -22
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_id.cjs +21 -28
- package/dist/block_meta/block_id.cjs.map +1 -1
- package/dist/block_meta/block_id.d.ts +30 -26
- package/dist/block_meta/block_id.js +20 -26
- package/dist/block_meta/block_id.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +24 -29
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +4778 -4773
- package/dist/block_meta/block_manifest.js +20 -24
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs +35 -50
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +810 -806
- package/dist/block_meta/block_meta.js +31 -45
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/common.d.ts +5 -2
- package/dist/block_meta/content_conversion.cjs +19 -16
- package/dist/block_meta/content_conversion.cjs.map +1 -1
- package/dist/block_meta/content_conversion.d.ts +7 -3
- package/dist/block_meta/content_conversion.js +19 -15
- package/dist/block_meta/content_conversion.js.map +1 -1
- package/dist/block_meta/content_types.cjs +77 -187
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +382 -378
- package/dist/block_meta/content_types.js +76 -185
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.cjs +8 -0
- package/dist/block_meta/index.d.ts +9 -10
- package/dist/block_meta/index.js +8 -0
- package/dist/block_meta/semver.cjs +6 -9
- package/dist/block_meta/semver.cjs.map +1 -1
- package/dist/block_meta/semver.d.ts +5 -1
- package/dist/block_meta/semver.js +5 -7
- package/dist/block_meta/semver.js.map +1 -1
- package/dist/block_registry/block_pack_spec.cjs +30 -34
- package/dist/block_registry/block_pack_spec.cjs.map +1 -1
- package/dist/block_registry/block_pack_spec.d.ts +172 -168
- package/dist/block_registry/block_pack_spec.js +29 -32
- package/dist/block_registry/block_pack_spec.js.map +1 -1
- package/dist/block_registry/index.cjs +3 -0
- package/dist/block_registry/index.d.ts +3 -4
- package/dist/block_registry/index.js +3 -0
- package/dist/block_registry/overview.cjs +55 -66
- package/dist/block_registry/overview.cjs.map +1 -1
- package/dist/block_registry/overview.d.ts +10345 -10340
- package/dist/block_registry/overview.js +54 -64
- package/dist/block_registry/overview.js.map +1 -1
- package/dist/block_registry/registry_spec.cjs +17 -16
- package/dist/block_registry/registry_spec.cjs.map +1 -1
- package/dist/block_registry/registry_spec.d.ts +147 -143
- package/dist/block_registry/registry_spec.js +16 -14
- package/dist/block_registry/registry_spec.js.map +1 -1
- package/dist/block_settings.cjs +3 -2
- package/dist/block_settings.cjs.map +1 -1
- package/dist/block_settings.d.ts +12 -10
- package/dist/block_settings.js +3 -1
- package/dist/block_settings.js.map +1 -1
- package/dist/block_state.d.ts +14 -14
- package/dist/index.cjs +102 -99
- package/dist/index.d.ts +25 -12
- package/dist/index.js +18 -16
- package/dist/json.cjs +16 -13
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts +11 -7
- package/dist/json.js +14 -11
- package/dist/json.js.map +1 -1
- package/dist/pframe/index.d.ts +1 -2
- package/dist/pframe/internal_api/api_factory.cjs +3 -2
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +40 -36
- package/dist/pframe/internal_api/api_factory.js +3 -1
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +40 -36
- package/dist/pframe/internal_api/api_wasm.d.ts +71 -70
- package/dist/pframe/internal_api/common.d.ts +18 -14
- package/dist/pframe/internal_api/create_table.d.ts +46 -42
- package/dist/pframe/internal_api/delete_column.d.ts +11 -7
- package/dist/pframe/internal_api/find_columns.d.ts +21 -17
- package/dist/pframe/internal_api/http_helpers.cjs +36 -27
- package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
- package/dist/pframe/internal_api/http_helpers.d.ts +153 -170
- package/dist/pframe/internal_api/http_helpers.js +36 -26
- package/dist/pframe/internal_api/http_helpers.js.map +1 -1
- package/dist/pframe/internal_api/index.cjs +18 -10
- package/dist/pframe/internal_api/index.cjs.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +18 -11
- package/dist/pframe/internal_api/index.js +15 -3
- package/dist/pframe/internal_api/index.js.map +1 -1
- package/dist/pframe/internal_api/pframe.d.ts +26 -27
- package/dist/pframe/internal_api/table.d.ts +52 -48
- package/dist/project.d.ts +6 -3
- package/dist/project_list.d.ts +18 -14
- package/dist/project_overview.d.ts +135 -143
- package/dist/update_info.d.ts +10 -5
- package/package.json +5 -5
- package/dist/author_marker.d.ts.map +0 -1
- package/dist/block_meta/block_components.d.ts.map +0 -1
- package/dist/block_meta/block_description.d.ts.map +0 -1
- package/dist/block_meta/block_id.d.ts.map +0 -1
- package/dist/block_meta/block_manifest.d.ts.map +0 -1
- package/dist/block_meta/block_meta.d.ts.map +0 -1
- package/dist/block_meta/common.d.ts.map +0 -1
- package/dist/block_meta/content_conversion.d.ts.map +0 -1
- package/dist/block_meta/content_types.d.ts.map +0 -1
- package/dist/block_meta/index.d.ts.map +0 -1
- package/dist/block_meta/semver.d.ts.map +0 -1
- package/dist/block_registry/block_pack_spec.d.ts.map +0 -1
- package/dist/block_registry/index.d.ts.map +0 -1
- package/dist/block_registry/overview.d.ts.map +0 -1
- package/dist/block_registry/registry_spec.d.ts.map +0 -1
- package/dist/block_settings.d.ts.map +0 -1
- package/dist/block_state.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/json.d.ts.map +0 -1
- package/dist/pframe/index.d.ts.map +0 -1
- package/dist/pframe/internal_api/api_factory.d.ts.map +0 -1
- package/dist/pframe/internal_api/api_read.d.ts.map +0 -1
- package/dist/pframe/internal_api/api_wasm.d.ts.map +0 -1
- package/dist/pframe/internal_api/common.d.ts.map +0 -1
- package/dist/pframe/internal_api/create_table.d.ts.map +0 -1
- package/dist/pframe/internal_api/delete_column.d.ts.map +0 -1
- package/dist/pframe/internal_api/find_columns.d.ts.map +0 -1
- package/dist/pframe/internal_api/http_helpers.d.ts.map +0 -1
- package/dist/pframe/internal_api/index.d.ts.map +0 -1
- package/dist/pframe/internal_api/pframe.d.ts.map +0 -1
- package/dist/pframe/internal_api/table.d.ts.map +0 -1
- package/dist/project.d.ts.map +0 -1
- package/dist/project_list.d.ts.map +0 -1
- package/dist/project_overview.d.ts.map +0 -1
- package/dist/update_info.d.ts.map +0 -1
|
@@ -1,201 +1,92 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.regex(/\w+\/[-+.\w]+/)
|
|
18
|
-
.describe("MIME type to interpret content"),
|
|
19
|
-
content: z.string().base64().describe("Base64 encoded binary value"),
|
|
20
|
-
})
|
|
21
|
-
.strict();
|
|
22
|
-
const ContentRelative = z
|
|
23
|
-
.object({
|
|
24
|
-
type: z.literal("relative"),
|
|
25
|
-
path: z
|
|
26
|
-
.string()
|
|
27
|
-
.describe("Address of the file, in most cases relative to the file which this structure is a part of"),
|
|
28
|
-
})
|
|
29
|
-
.strict();
|
|
3
|
+
//#region src/block_meta/content_types.ts
|
|
4
|
+
const ContentExplicitString = z.object({
|
|
5
|
+
type: z.literal("explicit-string"),
|
|
6
|
+
content: z.string().describe("Actual string value")
|
|
7
|
+
}).strict();
|
|
8
|
+
const ContentExplicitBase64 = z.object({
|
|
9
|
+
type: z.literal("explicit-base64"),
|
|
10
|
+
mimeType: z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
|
|
11
|
+
content: z.string().base64().describe("Base64 encoded binary value")
|
|
12
|
+
}).strict();
|
|
13
|
+
const ContentRelative = z.object({
|
|
14
|
+
type: z.literal("relative"),
|
|
15
|
+
path: z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")
|
|
16
|
+
}).strict();
|
|
30
17
|
const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
|
|
31
|
-
const ContentAbsoluteFile = z
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
const ContentExplicitBytes = z
|
|
50
|
-
.object({
|
|
51
|
-
type: z.literal("explicit-bytes"),
|
|
52
|
-
mimeType: z
|
|
53
|
-
.string()
|
|
54
|
-
.regex(/\w+\/[-+.\w]+/)
|
|
55
|
-
.describe("MIME type to interpret content"),
|
|
56
|
-
content: z.instanceof(Uint8Array).describe("Raw content"),
|
|
57
|
-
})
|
|
58
|
-
.strict();
|
|
59
|
-
const ContentAbsoluteFolder = z
|
|
60
|
-
.object({
|
|
61
|
-
type: z.literal("absolute-folder"),
|
|
62
|
-
folder: z
|
|
63
|
-
.string()
|
|
64
|
-
.regex(absPathRegex, "path to folder must be absolute")
|
|
65
|
-
.describe("Absolute address of the folder in local file system"),
|
|
66
|
-
})
|
|
67
|
-
.strict();
|
|
68
|
-
//
|
|
69
|
-
// Unions
|
|
70
|
-
//
|
|
18
|
+
const ContentAbsoluteFile = z.object({
|
|
19
|
+
type: z.literal("absolute-file"),
|
|
20
|
+
file: z.string().regex(absPathRegex, "path to file must be absolute").describe("Absolute address of the file in local file system")
|
|
21
|
+
}).strict();
|
|
22
|
+
const ContentAbsoluteUrl = z.object({
|
|
23
|
+
type: z.literal("absolute-url"),
|
|
24
|
+
url: z.string().url().describe("Global URL to reach the requested file")
|
|
25
|
+
}).strict();
|
|
26
|
+
const ContentExplicitBytes = z.object({
|
|
27
|
+
type: z.literal("explicit-bytes"),
|
|
28
|
+
mimeType: z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
|
|
29
|
+
content: z.instanceof(Uint8Array).describe("Raw content")
|
|
30
|
+
}).strict();
|
|
31
|
+
const ContentAbsoluteFolder = z.object({
|
|
32
|
+
type: z.literal("absolute-folder"),
|
|
33
|
+
folder: z.string().regex(absPathRegex, "path to folder must be absolute").describe("Absolute address of the folder in local file system")
|
|
34
|
+
}).strict();
|
|
71
35
|
const ContentAny = z.discriminatedUnion("type", [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
36
|
+
ContentExplicitString,
|
|
37
|
+
ContentExplicitBase64,
|
|
38
|
+
ContentRelative,
|
|
39
|
+
ContentAbsoluteFile,
|
|
40
|
+
ContentAbsoluteUrl
|
|
77
41
|
]);
|
|
78
42
|
const ContentExplicitOrRelative = z.discriminatedUnion("type", [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
43
|
+
ContentExplicitString,
|
|
44
|
+
ContentExplicitBase64,
|
|
45
|
+
ContentRelative
|
|
82
46
|
]);
|
|
83
47
|
const ContentAnyLocal = z.discriminatedUnion("type", [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
48
|
+
ContentExplicitString,
|
|
49
|
+
ContentExplicitBase64,
|
|
50
|
+
ContentRelative,
|
|
51
|
+
ContentAbsoluteFile
|
|
88
52
|
]);
|
|
89
53
|
const ContentAnyRemote = z.discriminatedUnion("type", [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
54
|
+
ContentExplicitString,
|
|
55
|
+
ContentExplicitBase64,
|
|
56
|
+
ContentRelative,
|
|
57
|
+
ContentAbsoluteUrl
|
|
94
58
|
]);
|
|
95
|
-
//
|
|
96
|
-
// Narrow types with relative option
|
|
97
|
-
//
|
|
98
|
-
// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [
|
|
99
|
-
// ContentExplicitBase64,
|
|
100
|
-
// ContentRelative,
|
|
101
|
-
// ContentAbsoluteUrl
|
|
102
|
-
// ]);
|
|
103
|
-
// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;
|
|
104
59
|
const ContentAnyBinaryLocal = z.discriminatedUnion("type", [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
60
|
+
ContentExplicitBase64,
|
|
61
|
+
ContentRelative,
|
|
62
|
+
ContentAbsoluteFile
|
|
108
63
|
]);
|
|
109
|
-
// export const ContentAnyTextRemote = z.discriminatedUnion('type', [
|
|
110
|
-
// ContentExplicitString,
|
|
111
|
-
// ContentRelative,
|
|
112
|
-
// ContentAbsoluteUrl
|
|
113
|
-
// ]);
|
|
114
|
-
// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;
|
|
115
64
|
const ContentAnyTextLocal = z.discriminatedUnion("type", [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
]);
|
|
120
|
-
//
|
|
121
|
-
// Narrow absolute types
|
|
122
|
-
//
|
|
123
|
-
const ContentAbsoluteBinaryRemote = z.discriminatedUnion("type", [
|
|
124
|
-
ContentExplicitBase64,
|
|
125
|
-
ContentAbsoluteUrl,
|
|
126
|
-
]);
|
|
127
|
-
const ContentAbsoluteBinaryLocal = z.discriminatedUnion("type", [
|
|
128
|
-
ContentExplicitBase64,
|
|
129
|
-
ContentAbsoluteFile,
|
|
130
|
-
]);
|
|
131
|
-
const ContentAbsoluteTextRemote = z.discriminatedUnion("type", [
|
|
132
|
-
ContentExplicitString,
|
|
133
|
-
ContentAbsoluteUrl,
|
|
134
|
-
]);
|
|
135
|
-
const ContentAbsoluteTextLocal = z.discriminatedUnion("type", [
|
|
136
|
-
ContentExplicitString,
|
|
137
|
-
ContentAbsoluteFile,
|
|
138
|
-
]);
|
|
139
|
-
//
|
|
140
|
-
// Narrow relative types
|
|
141
|
-
//
|
|
142
|
-
const ContentRelativeBinary = z.discriminatedUnion("type", [
|
|
143
|
-
ContentExplicitBase64,
|
|
144
|
-
ContentRelative,
|
|
145
|
-
]);
|
|
146
|
-
const ContentRelativeText = z.discriminatedUnion("type", [
|
|
147
|
-
ContentExplicitString,
|
|
148
|
-
ContentRelative,
|
|
149
|
-
]);
|
|
150
|
-
// export function ConstructContent(
|
|
151
|
-
// contentType: 'text',
|
|
152
|
-
// contextType: 'local'
|
|
153
|
-
// ): typeof ContentAnyTextLocal;
|
|
154
|
-
// export function ConstructContent(
|
|
155
|
-
// contentType: 'text',
|
|
156
|
-
// contextType: 'remote'
|
|
157
|
-
// ): typeof ContentAnyTextRemote;
|
|
158
|
-
// export function ConstructContent(
|
|
159
|
-
// contentType: 'binary',
|
|
160
|
-
// contextType: 'local'
|
|
161
|
-
// ): typeof ContentAnyBinaryLocal;
|
|
162
|
-
// export function ConstructContent(
|
|
163
|
-
// contentType: 'binary',
|
|
164
|
-
// contextType: 'remote'
|
|
165
|
-
// ): typeof ContentAnyBinaryRemote;
|
|
166
|
-
// export function ConstructContent(
|
|
167
|
-
// contentType: ContentType,
|
|
168
|
-
// contextType: ContextType
|
|
169
|
-
// ):
|
|
170
|
-
// | typeof ContentAnyTextLocal
|
|
171
|
-
// | typeof ContentAnyTextRemote
|
|
172
|
-
// | typeof ContentAnyBinaryLocal
|
|
173
|
-
// | typeof ContentAnyBinaryRemote;
|
|
174
|
-
// export function ConstructContent(contentType: ContentType, contextType: ContextType) {
|
|
175
|
-
// return contentType === 'text'
|
|
176
|
-
// ? contextType === 'local'
|
|
177
|
-
// ? ContentAnyTextLocal
|
|
178
|
-
// : ContentAnyTextRemote
|
|
179
|
-
// : contextType === 'local'
|
|
180
|
-
// ? ContentAnyBinaryLocal
|
|
181
|
-
// : ContentAnyBinaryRemote;
|
|
182
|
-
// }
|
|
183
|
-
const DescriptionContentBinary = z.union([
|
|
184
|
-
z
|
|
185
|
-
.string()
|
|
186
|
-
.startsWith("file:")
|
|
187
|
-
.transform((value) => ({ type: "relative", path: value.slice(5) })),
|
|
188
|
-
ContentAnyBinaryLocal,
|
|
189
|
-
]);
|
|
190
|
-
const DescriptionContentText = z.union([
|
|
191
|
-
z.string().transform((value) => {
|
|
192
|
-
if (value.startsWith("file:"))
|
|
193
|
-
return { type: "relative", path: value.slice(5) };
|
|
194
|
-
else
|
|
195
|
-
return { type: "explicit-string", content: value };
|
|
196
|
-
}),
|
|
197
|
-
ContentAnyTextLocal,
|
|
65
|
+
ContentExplicitString,
|
|
66
|
+
ContentRelative,
|
|
67
|
+
ContentAbsoluteFile
|
|
198
68
|
]);
|
|
69
|
+
const ContentAbsoluteBinaryRemote = z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteUrl]);
|
|
70
|
+
const ContentAbsoluteBinaryLocal = z.discriminatedUnion("type", [ContentExplicitBase64, ContentAbsoluteFile]);
|
|
71
|
+
const ContentAbsoluteTextRemote = z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteUrl]);
|
|
72
|
+
const ContentAbsoluteTextLocal = z.discriminatedUnion("type", [ContentExplicitString, ContentAbsoluteFile]);
|
|
73
|
+
const ContentRelativeBinary = z.discriminatedUnion("type", [ContentExplicitBase64, ContentRelative]);
|
|
74
|
+
const ContentRelativeText = z.discriminatedUnion("type", [ContentExplicitString, ContentRelative]);
|
|
75
|
+
const DescriptionContentBinary = z.union([z.string().startsWith("file:").transform((value) => ({
|
|
76
|
+
type: "relative",
|
|
77
|
+
path: value.slice(5)
|
|
78
|
+
})), ContentAnyBinaryLocal]);
|
|
79
|
+
const DescriptionContentText = z.union([z.string().transform((value) => {
|
|
80
|
+
if (value.startsWith("file:")) return {
|
|
81
|
+
type: "relative",
|
|
82
|
+
path: value.slice(5)
|
|
83
|
+
};
|
|
84
|
+
else return {
|
|
85
|
+
type: "explicit-string",
|
|
86
|
+
content: value
|
|
87
|
+
};
|
|
88
|
+
}), ContentAnyTextLocal]);
|
|
199
89
|
|
|
90
|
+
//#endregion
|
|
200
91
|
export { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
|
|
201
|
-
//# sourceMappingURL=content_types.js.map
|
|
92
|
+
//# sourceMappingURL=content_types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_types.js","sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal(\"explicit-string\"),\n content: z.string().describe(\"Actual string value\"),\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal(\"explicit-base64\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.string().base64().describe(\"Base64 encoded binary value\"),\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal(\"relative\"),\n path: z\n .string()\n .describe(\n \"Address of the file, in most cases relative to the file which this structure is a part of\",\n ),\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal(\"absolute-file\"),\n file: z\n .string()\n .regex(absPathRegex, \"path to file must be absolute\")\n .describe(\"Absolute address of the file in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal(\"absolute-url\"),\n url: z.string().url().describe(\"Global URL to reach the requested file\"),\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal(\"explicit-bytes\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.instanceof(Uint8Array).describe(\"Raw content\"),\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal(\"absolute-folder\"),\n folder: z\n .string()\n .regex(absPathRegex, \"path to folder must be absolute\")\n .describe(\"Absolute address of the folder in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl,\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl,\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith(\"file:\")\n .transform<ContentRelativeBinary>((value) => ({ type: \"relative\", path: value.slice(5) })),\n ContentAnyBinaryLocal,\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value) => {\n if (value.startsWith(\"file:\")) return { type: \"relative\", path: value.slice(5) };\n else return { type: \"explicit-string\", content: value };\n }),\n ContentAnyTextLocal,\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"content_types.js","names":[],"sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n// Base content types\n//\n\nexport const ContentExplicitString = z\n .object({\n type: z.literal(\"explicit-string\"),\n content: z.string().describe(\"Actual string value\"),\n })\n .strict();\nexport type ContentExplicitString = z.infer<typeof ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal(\"explicit-base64\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.string().base64().describe(\"Base64 encoded binary value\"),\n })\n .strict();\nexport type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal(\"relative\"),\n path: z\n .string()\n .describe(\n \"Address of the file, in most cases relative to the file which this structure is a part of\",\n ),\n })\n .strict();\nexport type ContentRelative = z.infer<typeof ContentRelative>;\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal(\"absolute-file\"),\n file: z\n .string()\n .regex(absPathRegex, \"path to file must be absolute\")\n .describe(\"Absolute address of the file in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;\n\nexport const ContentAbsoluteUrl = z\n .object({\n type: z.literal(\"absolute-url\"),\n url: z.string().url().describe(\"Global URL to reach the requested file\"),\n })\n .strict();\nexport type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;\n\n//\n// Special content types\n//\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal(\"explicit-bytes\"),\n mimeType: z\n .string()\n .regex(/\\w+\\/[-+.\\w]+/)\n .describe(\"MIME type to interpret content\"),\n content: z.instanceof(Uint8Array).describe(\"Raw content\"),\n })\n .strict();\nexport type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;\n\nexport const ContentAbsoluteFolder = z\n .object({\n type: z.literal(\"absolute-folder\"),\n folder: z\n .string()\n .regex(absPathRegex, \"path to folder must be absolute\")\n .describe(\"Absolute address of the folder in local file system\"),\n })\n .strict();\nexport type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;\n\n//\n// Unions\n//\n\nexport const ContentAny = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n ContentAbsoluteUrl,\n]);\nexport type ContentAny = z.infer<typeof ContentAny>;\n\nexport const ContentExplicitOrRelative = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;\n\nexport const ContentAnyLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;\n\nexport const ContentAnyRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteUrl,\n]);\nexport type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;\n\n//\n// Narrow types with relative option\n//\n\n// export const ContentAnyBinaryRemote = z.discriminatedUnion('type', [\n// ContentExplicitBase64,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;\n\nexport const ContentAnyBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;\n\n// export const ContentAnyTextRemote = z.discriminatedUnion('type', [\n// ContentExplicitString,\n// ContentRelative,\n// ContentAbsoluteUrl\n// ]);\n// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;\n\nexport const ContentAnyTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n ContentAbsoluteFile,\n]);\nexport type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;\n\n//\n// Narrow absolute types\n//\n\nexport const ContentAbsoluteBinaryRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;\n\nexport const ContentAbsoluteBinaryLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;\n\nexport const ContentAbsoluteTextRemote = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteUrl,\n]);\nexport type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;\n\nexport const ContentAbsoluteTextLocal = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentAbsoluteFile,\n]);\nexport type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;\n\n//\n// Narrow relative types\n//\n\nexport const ContentRelativeBinary = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n]);\nexport type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion(\"type\", [\n ContentExplicitString,\n ContentRelative,\n]);\nexport type ContentRelativeText = z.infer<typeof ContentRelativeText>;\n\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'local'\n// ): typeof ContentAnyTextLocal;\n// export function ConstructContent(\n// contentType: 'text',\n// contextType: 'remote'\n// ): typeof ContentAnyTextRemote;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'local'\n// ): typeof ContentAnyBinaryLocal;\n// export function ConstructContent(\n// contentType: 'binary',\n// contextType: 'remote'\n// ): typeof ContentAnyBinaryRemote;\n// export function ConstructContent(\n// contentType: ContentType,\n// contextType: ContextType\n// ):\n// | typeof ContentAnyTextLocal\n// | typeof ContentAnyTextRemote\n// | typeof ContentAnyBinaryLocal\n// | typeof ContentAnyBinaryRemote;\n// export function ConstructContent(contentType: ContentType, contextType: ContextType) {\n// return contentType === 'text'\n// ? contextType === 'local'\n// ? ContentAnyTextLocal\n// : ContentAnyTextRemote\n// : contextType === 'local'\n// ? ContentAnyBinaryLocal\n// : ContentAnyBinaryRemote;\n// }\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith(\"file:\")\n .transform<ContentRelativeBinary>((value) => ({ type: \"relative\", path: value.slice(5) })),\n ContentAnyBinaryLocal,\n]);\nexport type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value) => {\n if (value.startsWith(\"file:\")) return { type: \"relative\", path: value.slice(5) };\n else return { type: \"explicit-string\", content: value };\n }),\n ContentAnyTextLocal,\n]);\nexport type DescriptionContentText = z.infer<typeof DescriptionContentText>;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const require_content_types = require('./content_types.cjs');
|
|
2
|
+
const require_semver = require('./semver.cjs');
|
|
3
|
+
const require_content_conversion = require('./content_conversion.cjs');
|
|
4
|
+
const require_block_id = require('./block_id.cjs');
|
|
5
|
+
const require_block_components = require('./block_components.cjs');
|
|
6
|
+
const require_block_meta = require('./block_meta.cjs');
|
|
7
|
+
const require_block_description = require('./block_description.cjs');
|
|
8
|
+
const require_block_manifest = require('./block_manifest.cjs');
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { ContentType, ContextType } from "./common.js";
|
|
2
|
+
import { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText } from "./content_types.js";
|
|
3
|
+
import { SemVer } from "./semver.js";
|
|
4
|
+
import { addPrefixToRelative, mapRemoteToAbsolute } from "./content_conversion.js";
|
|
5
|
+
import { BlockPackId, BlockPackIdNoVersion, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString } from "./block_id.js";
|
|
6
|
+
import { BlockComponents, BlockComponentsAbsolute, BlockComponentsAbsoluteUrl, BlockComponentsDescriptionRaw, Workflow, WorkflowV1 } from "./block_components.js";
|
|
7
|
+
import { BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPlatform } from "./block_meta.js";
|
|
8
|
+
import { BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionRaw, CreateBlockPackDescriptionSchema, FeatureFlags, overrideDescriptionVersion } from "./block_description.js";
|
|
9
|
+
import { BlockComponentsManifest, BlockPackDescriptionManifest, BlockPackManifest, BlockPackManifestFile, BlockPackMetaManifest, ManifestFileInfo, Sha256Schema, overrideManifestVersion } from "./block_manifest.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText } from "./content_types.js";
|
|
2
|
+
import { SemVer } from "./semver.js";
|
|
3
|
+
import { addPrefixToRelative, mapRemoteToAbsolute } from "./content_conversion.js";
|
|
4
|
+
import { BlockPackId, BlockPackIdNoVersion, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString } from "./block_id.js";
|
|
5
|
+
import { BlockComponents, BlockComponentsAbsoluteUrl, BlockComponentsDescriptionRaw, Workflow, WorkflowV1 } from "./block_components.js";
|
|
6
|
+
import { BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPlatform } from "./block_meta.js";
|
|
7
|
+
import { BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionRaw, CreateBlockPackDescriptionSchema, FeatureFlags, overrideDescriptionVersion } from "./block_description.js";
|
|
8
|
+
import { BlockComponentsManifest, BlockPackDescriptionManifest, BlockPackManifest, BlockPackManifestFile, BlockPackMetaManifest, ManifestFileInfo, Sha256Schema, overrideManifestVersion } from "./block_manifest.js";
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let zod = require("zod");
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
// Regex taken from here:
|
|
6
|
-
// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
|
7
|
-
const SemVer = zod.z
|
|
8
|
-
.string()
|
|
9
|
-
.regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, "Wrong version format, please use valid semver");
|
|
4
|
+
//#region src/block_meta/semver.ts
|
|
5
|
+
const SemVer = zod.z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, "Wrong version format, please use valid semver");
|
|
10
6
|
|
|
7
|
+
//#endregion
|
|
11
8
|
exports.SemVer = SemVer;
|
|
12
|
-
//# sourceMappingURL=semver.cjs.map
|
|
9
|
+
//# sourceMappingURL=semver.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semver.cjs","sources":["../../src/block_meta/semver.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n \"Wrong version format, please use valid semver\",\n );\n"],"
|
|
1
|
+
{"version":3,"file":"semver.cjs","names":["z"],"sources":["../../src/block_meta/semver.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n \"Wrong version format, please use valid semver\",\n );\n"],"mappings":";;;;AAIA,MAAa,SAASA,MACnB,QAAQ,CACR,MACC,uLACA,gDACD"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const SemVer = z
|
|
6
|
-
.string()
|
|
7
|
-
.regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, "Wrong version format, please use valid semver");
|
|
3
|
+
//#region src/block_meta/semver.ts
|
|
4
|
+
const SemVer = z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/, "Wrong version format, please use valid semver");
|
|
8
5
|
|
|
6
|
+
//#endregion
|
|
9
7
|
export { SemVer };
|
|
10
|
-
//# sourceMappingURL=semver.js.map
|
|
8
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semver.js","sources":["../../src/block_meta/semver.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n \"Wrong version format, please use valid semver\",\n );\n"],"
|
|
1
|
+
{"version":3,"file":"semver.js","names":[],"sources":["../../src/block_meta/semver.ts"],"sourcesContent":["import { z } from \"zod\";\n\n// Regex taken from here:\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nexport const SemVer = z\n .string()\n .regex(\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/,\n \"Wrong version format, please use valid semver\",\n );\n"],"mappings":";;;AAIA,MAAa,SAAS,EACnB,QAAQ,CACR,MACC,uLACA,gDACD"}
|
|
@@ -1,56 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require(
|
|
5
|
-
require('../block_meta/semver.cjs');
|
|
6
|
-
var block_id = require('../block_meta/block_id.cjs');
|
|
7
|
-
require('../block_meta/block_components.cjs');
|
|
8
|
-
require('../block_meta/block_meta.cjs');
|
|
9
|
-
require('../block_meta/block_description.cjs');
|
|
10
|
-
require('../block_meta/block_manifest.cjs');
|
|
1
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_block_id = require('../block_meta/block_id.cjs');
|
|
3
|
+
require('../block_meta/index.cjs');
|
|
4
|
+
let zod = require("zod");
|
|
11
5
|
|
|
6
|
+
//#region src/block_registry/block_pack_spec.ts
|
|
12
7
|
/** Block pack from local folder, to be used during block development. Old layout.
|
|
13
|
-
|
|
8
|
+
* @deprecated don't use */
|
|
14
9
|
const BlockPackDevV1 = zod.z.object({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
type: zod.z.literal("dev-v1"),
|
|
11
|
+
folder: zod.z.string(),
|
|
12
|
+
mtime: zod.z.string().optional()
|
|
18
13
|
});
|
|
19
14
|
/** Block pack from local folder, to be used during block development. New layout. */
|
|
20
15
|
const BlockPackDevV2 = zod.z.object({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
type: zod.z.literal("dev-v2"),
|
|
17
|
+
folder: zod.z.string(),
|
|
18
|
+
mtime: zod.z.string().optional()
|
|
24
19
|
});
|
|
25
20
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
* Block pack from registry with version 2 layout, to be loaded directly
|
|
22
|
+
* from the client.
|
|
23
|
+
* @deprecated don't use
|
|
24
|
+
* */
|
|
30
25
|
const BlockPackFromRegistryV1 = zod.z.object({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
type: zod.z.literal("from-registry-v1"),
|
|
27
|
+
registryUrl: zod.z.string(),
|
|
28
|
+
id: require_block_id.BlockPackId
|
|
34
29
|
});
|
|
35
30
|
/** Block pack from registry with version 2 layout, to be loaded directly
|
|
36
|
-
|
|
31
|
+
* from the client. */
|
|
37
32
|
const BlockPackFromRegistryV2 = zod.z.object({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
type: zod.z.literal("from-registry-v2"),
|
|
34
|
+
registryUrl: zod.z.string(),
|
|
35
|
+
id: require_block_id.BlockPackId,
|
|
36
|
+
channel: zod.z.string().optional()
|
|
42
37
|
});
|
|
43
38
|
/** Information about block origin, can be used to instantiate new blocks */
|
|
44
39
|
const BlockPackSpec = zod.z.discriminatedUnion("type", [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
BlockPackDevV1,
|
|
41
|
+
BlockPackDevV2,
|
|
42
|
+
BlockPackFromRegistryV1,
|
|
43
|
+
BlockPackFromRegistryV2
|
|
49
44
|
]);
|
|
50
45
|
|
|
46
|
+
//#endregion
|
|
51
47
|
exports.BlockPackDevV1 = BlockPackDevV1;
|
|
52
48
|
exports.BlockPackDevV2 = BlockPackDevV2;
|
|
53
49
|
exports.BlockPackFromRegistryV1 = BlockPackFromRegistryV1;
|
|
54
50
|
exports.BlockPackFromRegistryV2 = BlockPackFromRegistryV2;
|
|
55
51
|
exports.BlockPackSpec = BlockPackSpec;
|
|
56
|
-
//# sourceMappingURL=block_pack_spec.cjs.map
|
|
52
|
+
//# sourceMappingURL=block_pack_spec.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_pack_spec.cjs","sources":["../../src/block_registry/block_pack_spec.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockPackId } from \"../block_meta\";\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal(\"dev-v1\"),\n folder: z.string(),\n mtime: z.string().optional(),\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal(\"dev-v2\"),\n folder: z.string(),\n mtime: z.string().optional(),\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal(\"from-registry-v1\"),\n registryUrl: z.string(),\n id: BlockPackId,\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal(\"from-registry-v2\"),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional(),\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion(\"type\", [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2,\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n"],"
|
|
1
|
+
{"version":3,"file":"block_pack_spec.cjs","names":["z","BlockPackId"],"sources":["../../src/block_registry/block_pack_spec.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockPackId } from \"../block_meta\";\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal(\"dev-v1\"),\n folder: z.string(),\n mtime: z.string().optional(),\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal(\"dev-v2\"),\n folder: z.string(),\n mtime: z.string().optional(),\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal(\"from-registry-v1\"),\n registryUrl: z.string(),\n id: BlockPackId,\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal(\"from-registry-v2\"),\n registryUrl: z.string(),\n id: BlockPackId,\n channel: z.string().optional(),\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion(\"type\", [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2,\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n"],"mappings":";;;;;;;;AAKA,MAAa,iBAAiBA,MAAE,OAAO;CACrC,MAAMA,MAAE,QAAQ,SAAS;CACzB,QAAQA,MAAE,QAAQ;CAClB,OAAOA,MAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;AAKF,MAAa,iBAAiBA,MAAE,OAAO;CACrC,MAAMA,MAAE,QAAQ,SAAS;CACzB,QAAQA,MAAE,QAAQ;CAClB,OAAOA,MAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;;;;;AAQF,MAAa,0BAA0BA,MAAE,OAAO;CAC9C,MAAMA,MAAE,QAAQ,mBAAmB;CACnC,aAAaA,MAAE,QAAQ;CACvB,IAAIC;CACL,CAAC;;;AAMF,MAAa,0BAA0BD,MAAE,OAAO;CAC9C,MAAMA,MAAE,QAAQ,mBAAmB;CACnC,aAAaA,MAAE,QAAQ;CACvB,IAAIC;CACJ,SAASD,MAAE,QAAQ,CAAC,UAAU;CAC/B,CAAC;;AAIF,MAAa,gBAAgBA,MAAE,mBAAmB,QAAQ;CACxD;CACA;CACA;CACA;CACD,CAAC"}
|