@milaboratories/pl-model-middle-layer 1.16.3 → 1.16.4
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 +12 -22
- package/dist/_virtual/_rolldown/runtime.js +6 -11
- package/dist/block_meta/block_components.cjs +4 -5
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +30 -158
- package/dist/block_meta/block_components.d.ts.map +1 -0
- package/dist/block_meta/block_components.js +1 -2
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +5 -6
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +20 -20
- package/dist/block_meta/block_description.d.ts.map +1 -0
- package/dist/block_meta/block_description.js +1 -2
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_id.cjs +3 -4
- package/dist/block_meta/block_id.cjs.map +1 -1
- package/dist/block_meta/block_id.d.ts.map +1 -0
- package/dist/block_meta/block_id.js +1 -2
- package/dist/block_meta/block_id.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +6 -7
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +65 -65
- package/dist/block_meta/block_manifest.d.ts.map +1 -0
- package/dist/block_meta/block_manifest.js +1 -2
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs +3 -4
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +15 -97
- package/dist/block_meta/block_meta.d.ts.map +1 -0
- package/dist/block_meta/block_meta.js +1 -2
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/common.d.ts.map +1 -0
- package/dist/block_meta/content_conversion.cjs +1 -2
- package/dist/block_meta/content_conversion.cjs.map +1 -1
- package/dist/block_meta/content_conversion.d.ts.map +1 -0
- package/dist/block_meta/content_conversion.js +1 -1
- package/dist/block_meta/content_types.cjs +2 -3
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts.map +1 -0
- package/dist/block_meta/content_types.js +1 -2
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.cjs +8 -8
- package/dist/block_meta/index.js +8 -8
- package/dist/block_meta/semver.cjs +3 -5
- package/dist/block_meta/semver.cjs.map +1 -1
- package/dist/block_meta/semver.d.ts.map +1 -0
- package/dist/block_meta/semver.js +1 -2
- package/dist/block_meta/semver.js.map +1 -1
- package/dist/block_registry/block_pack_spec.cjs +4 -5
- package/dist/block_registry/block_pack_spec.cjs.map +1 -1
- package/dist/block_registry/block_pack_spec.d.ts +8 -8
- package/dist/block_registry/block_pack_spec.d.ts.map +1 -0
- package/dist/block_registry/block_pack_spec.js +1 -2
- package/dist/block_registry/block_pack_spec.js.map +1 -1
- package/dist/block_registry/index.cjs +3 -3
- package/dist/block_registry/index.js +3 -3
- package/dist/block_registry/overview.cjs +10 -11
- package/dist/block_registry/overview.cjs.map +1 -1
- package/dist/block_registry/overview.d.ts +400 -400
- package/dist/block_registry/overview.d.ts.map +1 -0
- package/dist/block_registry/overview.js +2 -3
- package/dist/block_registry/overview.js.map +1 -1
- package/dist/block_registry/registry_spec.cjs +2 -3
- package/dist/block_registry/registry_spec.cjs.map +1 -1
- package/dist/block_registry/registry_spec.d.ts.map +1 -0
- package/dist/block_registry/registry_spec.js +1 -2
- package/dist/block_registry/registry_spec.js.map +1 -1
- package/dist/block_settings.cjs +1 -2
- package/dist/block_settings.cjs.map +1 -1
- package/dist/block_settings.d.ts.map +1 -0
- package/dist/block_settings.js +1 -1
- package/dist/block_state.d.ts.map +1 -0
- package/dist/index.cjs +23 -24
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -2
- package/dist/json.cjs +2 -3
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts.map +1 -0
- package/dist/json.js +1 -2
- package/dist/json.js.map +1 -1
- package/dist/pframe/internal_api/api_factory.cjs +1 -2
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -0
- package/dist/pframe/internal_api/api_factory.js +1 -1
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -0
- package/dist/pframe/internal_api/api_wasm.d.ts.map +1 -0
- package/dist/pframe/internal_api/common.d.ts.map +1 -0
- package/dist/pframe/internal_api/create_table.d.ts.map +1 -0
- package/dist/pframe/internal_api/delete_column.d.ts.map +1 -0
- package/dist/pframe/internal_api/discover_columns.d.ts.map +1 -0
- package/dist/pframe/internal_api/find_columns.d.ts.map +1 -0
- package/dist/pframe/internal_api/http_helpers.cjs +1 -2
- package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
- package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -0
- package/dist/pframe/internal_api/http_helpers.js +1 -1
- package/dist/pframe/internal_api/http_helpers.js.map +1 -1
- package/dist/pframe/internal_api/index.cjs +9 -10
- package/dist/pframe/internal_api/index.d.ts.map +1 -0
- package/dist/pframe/internal_api/index.js +1 -2
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -0
- package/dist/pframe/internal_api/table.d.ts.map +1 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project_list.d.ts.map +1 -0
- package/dist/project_overview.d.ts.map +1 -0
- package/dist/storage_debug_view.d.ts.map +1 -0
- package/dist/update_info.d.ts +0 -2
- package/dist/update_info.d.ts.map +1 -0
- package/package.json +7 -7
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_content_types = require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_content_types = require("./content_types.cjs");
|
|
3
3
|
let zod = require("zod");
|
|
4
|
-
|
|
5
4
|
//#region src/block_meta/block_meta.ts
|
|
6
5
|
const BlockPlatform = zod.z.enum([
|
|
7
6
|
"windows-x64",
|
|
@@ -36,11 +35,11 @@ function BlockPackMeta(longString, binary) {
|
|
|
36
35
|
const BlockPackMetaDescriptionRaw = BlockPackMeta(require_content_types.DescriptionContentText, require_content_types.DescriptionContentBinary);
|
|
37
36
|
const BlockPackMetaEmbeddedBase64 = BlockPackMeta(zod.z.string(), require_content_types.ContentExplicitBase64);
|
|
38
37
|
const BlockPackMetaEmbeddedBytes = BlockPackMeta(zod.z.string(), require_content_types.ContentExplicitBytes);
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
exports.BlockPackMeta = BlockPackMeta;
|
|
42
40
|
exports.BlockPackMetaDescriptionRaw = BlockPackMetaDescriptionRaw;
|
|
43
41
|
exports.BlockPackMetaEmbeddedBase64 = BlockPackMetaEmbeddedBase64;
|
|
44
42
|
exports.BlockPackMetaEmbeddedBytes = BlockPackMetaEmbeddedBytes;
|
|
45
43
|
exports.BlockPlatform = BlockPlatform;
|
|
44
|
+
|
|
46
45
|
//# sourceMappingURL=block_meta.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_meta.cjs","names":["z","DescriptionContentText","DescriptionContentBinary","ContentExplicitBase64","ContentExplicitBytes"],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n });\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"block_meta.cjs","names":["z","DescriptionContentText","DescriptionContentBinary","ContentExplicitBase64","ContentExplicitBytes"],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n });\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":";;;;AAQA,MAAa,gBAAgBA,IAAAA,EAAE,KAAK;CAClC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAGF,SAAgB,cAGd,YAA4B,QAAoB;AAChD,QAAOA,IAAAA,EAAE,OAAO;EACd,OAAOA,IAAAA,EAAE,QAAQ;EACjB,aAAaA,IAAAA,EAAE,QAAQ;EACvB,iBAAiB,WAAW,UAAU;EACtC,WAAW,WAAW,UAAU;EAChC,MAAM,OAAO,UAAU;EACvB,KAAKA,IAAAA,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAChC,MAAMA,IAAAA,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjC,SAASA,IAAAA,EAAE,MAAM,CAACA,IAAAA,EAAE,QAAQ,CAAC,KAAK,EAAEA,IAAAA,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;EACnE,MAAMA,IAAAA,EAAE,MAAMA,IAAAA,EAAE,QAAQ,CAAC,CAAC,UAAU;EACpC,cAAcA,IAAAA,EACX,OAAO;GACN,MAAMA,IAAAA,EAAE,QAAQ;GAChB,KAAKA,IAAAA,EAAE,QAAQ,CAAC,KAAK;GACrB,MAAM,OAAO,UAAU;GACxB,CAAC,CACD,aAAa;EAKhB,oBAAoBA,IAAAA,EAAE,QAAQ,CAAC,UAAU;EAIzC,YAAYA,IAAAA,EAAE,SAAS,CAAC,UAAU;EAIlC,mBAAmBA,IAAAA,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAK9C,oBAAoBA,IAAAA,EAAE,MAAM,cAAc,CAAC,UAAU;EACtD,CAAC;;AAGJ,MAAa,8BAA8B,cACzCC,sBAAAA,wBACAC,sBAAAA,yBACD;AAGD,MAAa,8BAA8B,cAAcF,IAAAA,EAAE,QAAQ,EAAEG,sBAAAA,sBAAsB;AAG3F,MAAa,6BAA6B,cAAcH,IAAAA,EAAE,QAAQ,EAAEI,sBAAAA,qBAAqB"}
|
|
@@ -44,7 +44,7 @@ declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny, const
|
|
|
44
44
|
* If not provided, the block is supported on all operating systems.
|
|
45
45
|
*/
|
|
46
46
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
47
|
-
}, "strip", z.ZodTypeAny,
|
|
47
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
48
48
|
title: z.ZodString;
|
|
49
49
|
description: z.ZodString;
|
|
50
50
|
longDescription: z.ZodOptional<LongStringType>;
|
|
@@ -85,7 +85,7 @@ declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny, const
|
|
|
85
85
|
* If not provided, the block is supported on all operating systems.
|
|
86
86
|
*/
|
|
87
87
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
88
|
-
}>, any>]: z.
|
|
88
|
+
}>, any> extends infer T ? { [k in keyof T]: T[k] } : never, z.baseObjectInputType<{
|
|
89
89
|
title: z.ZodString;
|
|
90
90
|
description: z.ZodString;
|
|
91
91
|
longDescription: z.ZodOptional<LongStringType>;
|
|
@@ -126,89 +126,7 @@ declare function BlockPackMeta<const LongStringType extends z.ZodTypeAny, const
|
|
|
126
126
|
* If not provided, the block is supported on all operating systems.
|
|
127
127
|
*/
|
|
128
128
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
129
|
-
}
|
|
130
|
-
title: z.ZodString;
|
|
131
|
-
description: z.ZodString;
|
|
132
|
-
longDescription: z.ZodOptional<LongStringType>;
|
|
133
|
-
changelog: z.ZodOptional<LongStringType>;
|
|
134
|
-
logo: z.ZodOptional<BinaryType>;
|
|
135
|
-
url: z.ZodOptional<z.ZodString>;
|
|
136
|
-
docs: z.ZodOptional<z.ZodString>;
|
|
137
|
-
support: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
138
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
139
|
-
organization: z.ZodObject<{
|
|
140
|
-
name: z.ZodString;
|
|
141
|
-
url: z.ZodString;
|
|
142
|
-
logo: z.ZodOptional<BinaryType>;
|
|
143
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
144
|
-
name: z.ZodString;
|
|
145
|
-
url: z.ZodString;
|
|
146
|
-
logo: z.ZodOptional<BinaryType>;
|
|
147
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
148
|
-
name: z.ZodString;
|
|
149
|
-
url: z.ZodString;
|
|
150
|
-
logo: z.ZodOptional<BinaryType>;
|
|
151
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
152
|
-
/**
|
|
153
|
-
* The order of blocks on the "marketplace" (higher values push block higher to the top of the list).
|
|
154
|
-
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
155
|
-
*/
|
|
156
|
-
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
157
|
-
/**
|
|
158
|
-
* If true, the block is deprecated and should not be used.
|
|
159
|
-
*/
|
|
160
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
161
|
-
/**
|
|
162
|
-
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
163
|
-
*/
|
|
164
|
-
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
165
|
-
/**
|
|
166
|
-
* Supported operating systems.
|
|
167
|
-
* If not provided, the block is supported on all operating systems.
|
|
168
|
-
*/
|
|
169
|
-
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
170
|
-
}>]: z.baseObjectInputType<{
|
|
171
|
-
title: z.ZodString;
|
|
172
|
-
description: z.ZodString;
|
|
173
|
-
longDescription: z.ZodOptional<LongStringType>;
|
|
174
|
-
changelog: z.ZodOptional<LongStringType>;
|
|
175
|
-
logo: z.ZodOptional<BinaryType>;
|
|
176
|
-
url: z.ZodOptional<z.ZodString>;
|
|
177
|
-
docs: z.ZodOptional<z.ZodString>;
|
|
178
|
-
support: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
179
|
-
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
180
|
-
organization: z.ZodObject<{
|
|
181
|
-
name: z.ZodString;
|
|
182
|
-
url: z.ZodString;
|
|
183
|
-
logo: z.ZodOptional<BinaryType>;
|
|
184
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
185
|
-
name: z.ZodString;
|
|
186
|
-
url: z.ZodString;
|
|
187
|
-
logo: z.ZodOptional<BinaryType>;
|
|
188
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
189
|
-
name: z.ZodString;
|
|
190
|
-
url: z.ZodString;
|
|
191
|
-
logo: z.ZodOptional<BinaryType>;
|
|
192
|
-
}, z.ZodTypeAny, "passthrough">>;
|
|
193
|
-
/**
|
|
194
|
-
* The order of blocks on the "marketplace" (higher values push block higher to the top of the list).
|
|
195
|
-
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
196
|
-
*/
|
|
197
|
-
marketplaceRanking: z.ZodOptional<z.ZodNumber>;
|
|
198
|
-
/**
|
|
199
|
-
* If true, the block is deprecated and should not be used.
|
|
200
|
-
*/
|
|
201
|
-
deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
-
/**
|
|
203
|
-
* The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.
|
|
204
|
-
*/
|
|
205
|
-
termsOfServiceUrl: z.ZodOptional<z.ZodString>;
|
|
206
|
-
/**
|
|
207
|
-
* Supported operating systems.
|
|
208
|
-
* If not provided, the block is supported on all operating systems.
|
|
209
|
-
*/
|
|
210
|
-
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
211
|
-
}>[k_1] }>;
|
|
129
|
+
}> extends infer T_1 ? { [k_1 in keyof T_1]: T_1[k_1] } : never>;
|
|
212
130
|
declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
213
131
|
title: z.ZodString;
|
|
214
132
|
description: z.ZodString;
|
|
@@ -465,10 +383,9 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
465
383
|
*/
|
|
466
384
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
467
385
|
}, "strip", z.ZodTypeAny, {
|
|
468
|
-
title: string;
|
|
469
386
|
organization: {
|
|
470
|
-
url: string;
|
|
471
387
|
name: string;
|
|
388
|
+
url: string;
|
|
472
389
|
logo?: {
|
|
473
390
|
type: "explicit-base64";
|
|
474
391
|
mimeType: string;
|
|
@@ -483,6 +400,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
483
400
|
} & {
|
|
484
401
|
[k: string]: unknown;
|
|
485
402
|
};
|
|
403
|
+
title: string;
|
|
486
404
|
description: string;
|
|
487
405
|
url?: string | undefined;
|
|
488
406
|
longDescription?: {
|
|
@@ -524,10 +442,9 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
524
442
|
termsOfServiceUrl?: string | undefined;
|
|
525
443
|
supportedPlatforms?: ("windows-x64" | "windows-aarch64" | "macosx-x64" | "macosx-aarch64" | "linux-x64" | "linux-aarch64")[] | undefined;
|
|
526
444
|
}, {
|
|
527
|
-
title: string;
|
|
528
445
|
organization: {
|
|
529
|
-
url: string;
|
|
530
446
|
name: string;
|
|
447
|
+
url: string;
|
|
531
448
|
logo?: string | {
|
|
532
449
|
type: "explicit-base64";
|
|
533
450
|
mimeType: string;
|
|
@@ -542,6 +459,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
542
459
|
} & {
|
|
543
460
|
[k: string]: unknown;
|
|
544
461
|
};
|
|
462
|
+
title: string;
|
|
545
463
|
description: string;
|
|
546
464
|
url?: string | undefined;
|
|
547
465
|
longDescription?: string | {
|
|
@@ -674,10 +592,9 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
674
592
|
*/
|
|
675
593
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
676
594
|
}, "strip", z.ZodTypeAny, {
|
|
677
|
-
title: string;
|
|
678
595
|
organization: {
|
|
679
|
-
url: string;
|
|
680
596
|
name: string;
|
|
597
|
+
url: string;
|
|
681
598
|
logo?: {
|
|
682
599
|
type: "explicit-base64";
|
|
683
600
|
mimeType: string;
|
|
@@ -686,6 +603,7 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
686
603
|
} & {
|
|
687
604
|
[k: string]: unknown;
|
|
688
605
|
};
|
|
606
|
+
title: string;
|
|
689
607
|
description: string;
|
|
690
608
|
url?: string | undefined;
|
|
691
609
|
longDescription?: string | undefined;
|
|
@@ -703,10 +621,9 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
703
621
|
termsOfServiceUrl?: string | undefined;
|
|
704
622
|
supportedPlatforms?: ("windows-x64" | "windows-aarch64" | "macosx-x64" | "macosx-aarch64" | "linux-x64" | "linux-aarch64")[] | undefined;
|
|
705
623
|
}, {
|
|
706
|
-
title: string;
|
|
707
624
|
organization: {
|
|
708
|
-
url: string;
|
|
709
625
|
name: string;
|
|
626
|
+
url: string;
|
|
710
627
|
logo?: {
|
|
711
628
|
type: "explicit-base64";
|
|
712
629
|
mimeType: string;
|
|
@@ -715,6 +632,7 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
715
632
|
} & {
|
|
716
633
|
[k: string]: unknown;
|
|
717
634
|
};
|
|
635
|
+
title: string;
|
|
718
636
|
description: string;
|
|
719
637
|
url?: string | undefined;
|
|
720
638
|
longDescription?: string | undefined;
|
|
@@ -823,10 +741,9 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
823
741
|
*/
|
|
824
742
|
supportedPlatforms: z.ZodOptional<z.ZodArray<z.ZodEnum<["windows-x64", "windows-aarch64", "macosx-x64", "macosx-aarch64", "linux-x64", "linux-aarch64"]>, "many">>;
|
|
825
743
|
}, "strip", z.ZodTypeAny, {
|
|
826
|
-
title: string;
|
|
827
744
|
organization: {
|
|
828
|
-
url: string;
|
|
829
745
|
name: string;
|
|
746
|
+
url: string;
|
|
830
747
|
logo?: {
|
|
831
748
|
type: "explicit-bytes";
|
|
832
749
|
mimeType: string;
|
|
@@ -835,6 +752,7 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
835
752
|
} & {
|
|
836
753
|
[k: string]: unknown;
|
|
837
754
|
};
|
|
755
|
+
title: string;
|
|
838
756
|
description: string;
|
|
839
757
|
url?: string | undefined;
|
|
840
758
|
longDescription?: string | undefined;
|
|
@@ -852,10 +770,9 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
852
770
|
termsOfServiceUrl?: string | undefined;
|
|
853
771
|
supportedPlatforms?: ("windows-x64" | "windows-aarch64" | "macosx-x64" | "macosx-aarch64" | "linux-x64" | "linux-aarch64")[] | undefined;
|
|
854
772
|
}, {
|
|
855
|
-
title: string;
|
|
856
773
|
organization: {
|
|
857
|
-
url: string;
|
|
858
774
|
name: string;
|
|
775
|
+
url: string;
|
|
859
776
|
logo?: {
|
|
860
777
|
type: "explicit-bytes";
|
|
861
778
|
mimeType: string;
|
|
@@ -864,6 +781,7 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
864
781
|
} & {
|
|
865
782
|
[k: string]: unknown;
|
|
866
783
|
};
|
|
784
|
+
title: string;
|
|
867
785
|
description: string;
|
|
868
786
|
url?: string | undefined;
|
|
869
787
|
longDescription?: string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1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B,2BAAA,GAA8B,CAAA,CAAE,KAAA,QAAa,2BAAA;AAAA,cAE5C,0BAAA,EAA0B,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAC3B,0BAAA,GAA6B,CAAA,CAAE,KAAA,QAAa,0BAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ContentExplicitBase64, ContentExplicitBytes, DescriptionContentBinary, DescriptionContentText } from "./content_types.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
3
|
//#region src/block_meta/block_meta.ts
|
|
5
4
|
const BlockPlatform = z.enum([
|
|
6
5
|
"windows-x64",
|
|
@@ -35,7 +34,7 @@ function BlockPackMeta(longString, binary) {
|
|
|
35
34
|
const BlockPackMetaDescriptionRaw = BlockPackMeta(DescriptionContentText, DescriptionContentBinary);
|
|
36
35
|
const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);
|
|
37
36
|
const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
38
|
export { BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPlatform };
|
|
39
|
+
|
|
41
40
|
//# sourceMappingURL=block_meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_meta.js","names":[],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n });\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"block_meta.js","names":[],"sources":["../../src/block_meta/block_meta.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText,\n} from \"./content_types\";\n\nexport const BlockPlatform = z.enum([\n \"windows-x64\",\n \"windows-aarch64\",\n \"macosx-x64\",\n \"macosx-aarch64\",\n \"linux-x64\",\n \"linux-aarch64\",\n]);\nexport type BlockPlatform = z.infer<typeof BlockPlatform>;\n\nexport function BlockPackMeta<\n const LongStringType extends z.ZodTypeAny,\n const BinaryType extends z.ZodTypeAny,\n>(longString: LongStringType, binary: BinaryType) {\n return z.object({\n title: z.string(),\n description: z.string(),\n longDescription: longString.optional(),\n changelog: longString.optional(),\n logo: binary.optional(),\n url: z.string().url().optional(),\n docs: z.string().url().optional(),\n support: z.union([z.string().url(), z.string().email()]).optional(),\n tags: z.array(z.string()).optional(),\n organization: z\n .object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional(),\n })\n .passthrough(),\n /**\n * The order of blocks on the \"marketplace\" (higher values push block higher to the top of the list).\n * `undefined` value or absent field is treated exactly the same as number `0`.\n */\n marketplaceRanking: z.number().optional(),\n /**\n * If true, the block is deprecated and should not be used.\n */\n deprecated: z.boolean().optional(),\n /**\n * The URL to the Terms of Service for the block. If provided checkbox with link to this URL should be shown in order to add block.\n */\n termsOfServiceUrl: z.string().url().optional(),\n /**\n * Supported operating systems.\n * If not provided, the block is supported on all operating systems.\n */\n supportedPlatforms: z.array(BlockPlatform).optional(),\n });\n}\n\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary,\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n"],"mappings":";;;AAQA,MAAa,gBAAgB,EAAE,KAAK;CAClC;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAGF,SAAgB,cAGd,YAA4B,QAAoB;AAChD,QAAO,EAAE,OAAO;EACd,OAAO,EAAE,QAAQ;EACjB,aAAa,EAAE,QAAQ;EACvB,iBAAiB,WAAW,UAAU;EACtC,WAAW,WAAW,UAAU;EAChC,MAAM,OAAO,UAAU;EACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAChC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EACjC,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU;EACnE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,UAAU;EACpC,cAAc,EACX,OAAO;GACN,MAAM,EAAE,QAAQ;GAChB,KAAK,EAAE,QAAQ,CAAC,KAAK;GACrB,MAAM,OAAO,UAAU;GACxB,CAAC,CACD,aAAa;EAKhB,oBAAoB,EAAE,QAAQ,CAAC,UAAU;EAIzC,YAAY,EAAE,SAAS,CAAC,UAAU;EAIlC,mBAAmB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;EAK9C,oBAAoB,EAAE,MAAM,cAAc,CAAC,UAAU;EACtD,CAAC;;AAGJ,MAAa,8BAA8B,cACzC,wBACA,yBACD;AAGD,MAAa,8BAA8B,cAAc,EAAE,QAAQ,EAAE,sBAAsB;AAG3F,MAAa,6BAA6B,cAAc,EAAE,QAAQ,EAAE,qBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","names":[],"sources":["../../src/block_meta/common.ts"],"mappings":";KAAY,WAAA;AAAA,KACA,WAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/block_meta/content_conversion.ts
|
|
3
2
|
function mapRemoteToAbsolute(rootUrl) {
|
|
4
3
|
const rootWithSlash = rootUrl.endsWith("/") ? rootUrl : `${rootUrl}/`;
|
|
@@ -21,8 +20,8 @@ function addPrefixToRelative(prefix) {
|
|
|
21
20
|
path: prefixWithSlash + value.path
|
|
22
21
|
} : value;
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
//#endregion
|
|
26
24
|
exports.addPrefixToRelative = addPrefixToRelative;
|
|
27
25
|
exports.mapRemoteToAbsolute = mapRemoteToAbsolute;
|
|
26
|
+
|
|
28
27
|
//# sourceMappingURL=content_conversion.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_conversion.cjs","names":[],"sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from \"./content_types\";\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith(\"/\") ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === \"relative\"\n ? { type: \"absolute-url\", url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string,\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith(\"/\") ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === \"relative\"\n ? { type: \"relative\", path: prefixWithSlash + value.path }\n : value) as T;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"content_conversion.cjs","names":[],"sources":["../../src/block_meta/content_conversion.ts"],"sourcesContent":["import type {\n ContentAbsoluteUrl,\n ContentAnyLocal,\n ContentExplicitOrRelative,\n ContentRelative,\n} from \"./content_types\";\n\nexport function mapRemoteToAbsolute(\n rootUrl: string,\n): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {\n const rootWithSlash = rootUrl.endsWith(\"/\") ? rootUrl : `${rootUrl}/`;\n return <T extends ContentAnyLocal>(value: T) =>\n value.type === \"relative\"\n ? { type: \"absolute-url\", url: rootWithSlash + value.path }\n : (value as Exclude<T, ContentRelative>);\n}\n\n/**\n * Creates transformer of relative content paths, that adds a specific prefix to the relative path.\n *\n * If prefix = \"nested-path/\", paths like \"somefile.txt\" will be transformed to \"nested-path/somefile.txt\".\n *\n * @param prefix prefix to add to the relative path, slash at the end will be added automatically if missed\n */\nexport function addPrefixToRelative(\n prefix: string,\n): <T extends ContentExplicitOrRelative>(value: T) => T {\n const prefixWithSlash = prefix.endsWith(\"/\") ? prefix : `${prefix}/`;\n return <T extends ContentExplicitOrRelative>(value: T) =>\n (value.type === \"relative\"\n ? { type: \"relative\", path: prefixWithSlash + value.path }\n : value) as T;\n}\n"],"mappings":";AAOA,SAAgB,oBACd,SAC2F;CAC3F,MAAM,gBAAgB,QAAQ,SAAS,IAAI,GAAG,UAAU,GAAG,QAAQ;AACnE,SAAmC,UACjC,MAAM,SAAS,aACX;EAAE,MAAM;EAAgB,KAAK,gBAAgB,MAAM;EAAM,GACxD;;;;;;;;;AAUT,SAAgB,oBACd,QACsD;CACtD,MAAM,kBAAkB,OAAO,SAAS,IAAI,GAAG,SAAS,GAAG,OAAO;AAClE,SAA6C,UAC1C,MAAM,SAAS,aACZ;EAAE,MAAM;EAAY,MAAM,kBAAkB,MAAM;EAAM,GACxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content_conversion.d.ts","names":[],"sources":["../../src/block_meta/content_conversion.ts"],"mappings":";;;iBAOgB,mBAAA,CACd,OAAA,sBACY,eAAA,EAAiB,KAAA,EAAO,CAAA,KAAM,OAAA,CAAQ,CAAA,EAAG,eAAA,IAAmB,kBAAA;;AAF1E;;;;;;iBAiBgB,mBAAA,CACd,MAAA,sBACY,yBAAA,EAA2B,KAAA,EAAO,CAAA,KAAM,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
2
|
let zod = require("zod");
|
|
3
|
-
|
|
4
3
|
//#region src/block_meta/content_types.ts
|
|
5
4
|
const ContentExplicitString = zod.z.object({
|
|
6
5
|
type: zod.z.literal("explicit-string"),
|
|
@@ -87,7 +86,6 @@ const DescriptionContentText = zod.z.union([zod.z.string().transform((value) =>
|
|
|
87
86
|
content: value
|
|
88
87
|
};
|
|
89
88
|
}), ContentAnyTextLocal]);
|
|
90
|
-
|
|
91
89
|
//#endregion
|
|
92
90
|
exports.ContentAbsoluteBinaryLocal = ContentAbsoluteBinaryLocal;
|
|
93
91
|
exports.ContentAbsoluteBinaryRemote = ContentAbsoluteBinaryRemote;
|
|
@@ -110,4 +108,5 @@ exports.ContentRelativeBinary = ContentRelativeBinary;
|
|
|
110
108
|
exports.ContentRelativeText = ContentRelativeText;
|
|
111
109
|
exports.DescriptionContentBinary = DescriptionContentBinary;
|
|
112
110
|
exports.DescriptionContentText = DescriptionContentText;
|
|
111
|
+
|
|
113
112
|
//# sourceMappingURL=content_types.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_types.cjs","names":["z"],"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":";;;;AAMA,MAAa,wBAAwBA,MAClC,OAAO;CACN,MAAMA,MAAE,QAAQ,kBAAkB;CAClC,SAASA,MAAE,QAAQ,CAAC,SAAS,sBAAsB;CACpD,CAAC,CACD,QAAQ;AAGX,MAAa,wBAAwBA,MAClC,OAAO;CACN,MAAMA,MAAE,QAAQ,kBAAkB;CAClC,UAAUA,MACP,QAAQ,CACR,MAAM,gBAAgB,CACtB,SAAS,iCAAiC;CAC7C,SAASA,MAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,8BAA8B;CACrE,CAAC,CACD,QAAQ;AAGX,MAAa,kBAAkBA,MAC5B,OAAO;CACN,MAAMA,MAAE,QAAQ,WAAW;CAC3B,MAAMA,MACH,QAAQ,CACR,SACC,4FACD;CACJ,CAAC,CACD,QAAQ;AAGX,MAAM,eAAe,IAAI,OAAO,kBAAkB;AAElD,MAAa,sBAAsBA,MAChC,OAAO;CACN,MAAMA,MAAE,QAAQ,gBAAgB;CAChC,MAAMA,MACH,QAAQ,CACR,MAAM,cAAc,gCAAgC,CACpD,SAAS,oDAAoD;CACjE,CAAC,CACD,QAAQ;AAGX,MAAa,qBAAqBA,MAC/B,OAAO;CACN,MAAMA,MAAE,QAAQ,eAAe;CAC/B,KAAKA,MAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,yCAAyC;CACzE,CAAC,CACD,QAAQ;AAOX,MAAa,uBAAu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AC9CA,MACG,QAAQ,CACR,WAAW,QAAQ,CACnB,WAAkC,WAAW;CAAE,MAAM;CAAY,MAAM,MAAM,MAAM,EAAE;CAAE,EAAE,EAC5F,sBACD,CAAC;AAGF,MAAa,yBAAyBA,MAAE,MAAM,CAC5CA,MAAE,QAAQ,CAAC,WAAgC,UAAU;AACnD,KAAI,MAAM,WAAW,QAAQ,CAAE,QAAO;EAAE,MAAM;EAAY,MAAM,MAAM,MAAM,EAAE;EAAE;KAC3E,QAAO;EAAE,MAAM;EAAmB,SAAS;EAAO;EACvD,EACF,oBACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"content_types.cjs","names":["z"],"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":";;;AAMA,MAAa,wBAAwBA,IAAAA,EAClC,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,SAASA,IAAAA,EAAE,QAAQ,CAAC,SAAS,sBAAsB;CACpD,CAAC,CACD,QAAQ;AAGX,MAAa,wBAAwBA,IAAAA,EAClC,OAAO;CACN,MAAMA,I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,CAAE,KAAA,QAAa,wBAAA;AAAA,cAMzC,qBAAA,EAAqB,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;KAItB,qBAAA,GAAwB,CAAA,CAAE,KAAA,QAAa,qBAAA;AAAA,cAEtC,mBAAA,EAAmB,CAAA,CAAA,qBAAA,UAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;KAIpB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,mBAAA;AAAA,cAoCpC,wBAAA,EAAwB,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOzB,wBAAA,GAA2B,CAAA,CAAE,KAAA,QAAa,wBAAA;AAAA,cAEzC,sBAAA,EAAsB,CAAA,CAAA,QAAA,EAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAOvB,sBAAA,GAAyB,CAAA,CAAE,KAAA,QAAa,sBAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/block_meta/content_types.ts
|
|
4
3
|
const ContentExplicitString = z.object({
|
|
5
4
|
type: z.literal("explicit-string"),
|
|
@@ -86,7 +85,7 @@ const DescriptionContentText = z.union([z.string().transform((value) => {
|
|
|
86
85
|
content: value
|
|
87
86
|
};
|
|
88
87
|
}), ContentAnyTextLocal]);
|
|
89
|
-
|
|
90
88
|
//#endregion
|
|
91
89
|
export { ContentAbsoluteBinaryLocal, ContentAbsoluteBinaryRemote, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteTextRemote, ContentAbsoluteUrl, ContentAny, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyRemote, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText };
|
|
90
|
+
|
|
92
91
|
//# sourceMappingURL=content_types.js.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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":";;AAMA,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,QAAQ,kBAAkB;CAClC,SAAS,EAAE,QAAQ,CAAC,SAAS,sBAAsB;CACpD,CAAC,CACD,QAAQ;AAGX,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,QAAQ,kBAAkB;CAClC,UAAU,EACP,QAAQ,CACR,MAAM,gBAAgB,CACtB,SAAS,iCAAiC;CAC7C,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,8BAA8B;CACrE,CAAC,CACD,QAAQ;AAGX,MAAa,kBAAkB,EAC5B,OAAO;CACN,MAAM,EAAE,QAAQ,WAAW;CAC3B,MAAM,EACH,QAAQ,CACR,SACC,4FACD;CACJ,CAAC,CACD,QAAQ;AAGX,MAAM,eAAe,IAAI,OAAO,kBAAkB;AAElD,MAAa,sBAAsB,EAChC,OAAO;CACN,MAAM,EAAE,QAAQ,gBAAgB;CAChC,MAAM,EACH,QAAQ,CACR,MAAM,cAAc,gCAAgC,CACpD,SAAS,oDAAoD;CACjE,CAAC,CACD,QAAQ;AAGX,MAAa,qBAAqB,EAC/B,OAAO;CACN,MAAM,EAAE,QAAQ,eAAe;CAC/B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,yCAAyC;CACzE,CAAC,CACD,QAAQ;AAOX,MAAa,uBAAuB,EACjC,OAAO;CACN,MAAM,EAAE,QAAQ,iBAAiB;CACjC,UAAU,EACP,QAAQ,CACR,MAAM,gBAAgB,CACtB,SAAS,iCAAiC;CAC7C,SAAS,EAAE,WAAW,WAAW,CAAC,SAAS,cAAc;CAC1D,CAAC,CAC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AU;AACnD,KAAI,MAAM,WAAW,QAAQ,CAAE,QAAO;EAAE,MAAM;EAAY,MAAM,MAAM,MAAM,EAAE;EAAE;KAC3E,QAAO;EAAE,MAAM;EAAmB,SAAS;EAAO;EACvD,EACF,oBACD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
require("./content_types.cjs");
|
|
2
|
+
require("./semver.cjs");
|
|
3
|
+
require("./content_conversion.cjs");
|
|
4
|
+
require("./block_id.cjs");
|
|
5
|
+
require("./block_components.cjs");
|
|
6
|
+
require("./block_meta.cjs");
|
|
7
|
+
require("./block_description.cjs");
|
|
8
|
+
require("./block_manifest.cjs");
|
package/dist/block_meta/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import "./content_types.js";
|
|
2
|
+
import "./semver.js";
|
|
3
|
+
import "./content_conversion.js";
|
|
4
|
+
import "./block_id.js";
|
|
5
|
+
import "./block_components.js";
|
|
6
|
+
import "./block_meta.js";
|
|
7
|
+
import "./block_description.js";
|
|
8
|
+
import "./block_manifest.js";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
let zod = require("zod");
|
|
3
|
-
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
4
2
|
//#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");
|
|
6
|
-
|
|
3
|
+
const SemVer = require("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");
|
|
7
4
|
//#endregion
|
|
8
5
|
exports.SemVer = SemVer;
|
|
6
|
+
|
|
9
7
|
//# sourceMappingURL=semver.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,wBAASA,EACnB,QAAQ,CACR,MACC,uLACA,gDACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.d.ts","names":[],"sources":["../../src/block_meta/semver.ts"],"mappings":";;;cAIa,MAAA,EAAM,CAAA,CAAA,SAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
2
|
//#region src/block_meta/semver.ts
|
|
4
3
|
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");
|
|
5
|
-
|
|
6
4
|
//#endregion
|
|
7
5
|
export { SemVer };
|
|
6
|
+
|
|
8
7
|
//# sourceMappingURL=semver.js.map
|
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const require_block_id = require(
|
|
3
|
-
require(
|
|
1
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_block_id = require("../block_meta/block_id.cjs");
|
|
3
|
+
require("../block_meta/index.cjs");
|
|
4
4
|
let zod = require("zod");
|
|
5
|
-
|
|
6
5
|
//#region src/block_registry/block_pack_spec.ts
|
|
7
6
|
/** Block pack from local folder, to be used during block development. Old layout.
|
|
8
7
|
* @deprecated don't use */
|
|
@@ -42,11 +41,11 @@ const BlockPackSpec = zod.z.discriminatedUnion("type", [
|
|
|
42
41
|
BlockPackFromRegistryV1,
|
|
43
42
|
BlockPackFromRegistryV2
|
|
44
43
|
]);
|
|
45
|
-
|
|
46
44
|
//#endregion
|
|
47
45
|
exports.BlockPackDevV1 = BlockPackDevV1;
|
|
48
46
|
exports.BlockPackDevV2 = BlockPackDevV2;
|
|
49
47
|
exports.BlockPackFromRegistryV1 = BlockPackFromRegistryV1;
|
|
50
48
|
exports.BlockPackFromRegistryV2 = BlockPackFromRegistryV2;
|
|
51
49
|
exports.BlockPackSpec = BlockPackSpec;
|
|
50
|
+
|
|
52
51
|
//# sourceMappingURL=block_pack_spec.cjs.map
|