@milaboratories/pl-model-middle-layer 1.16.2 → 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 +10 -10
- 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 +39 -39
- 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 +9 -91
- 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.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 +154 -154
- 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 +12 -12
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_manifest.d.ts","names":[],"sources":["../../src/block_meta/block_manifest.ts"],"mappings":";;;;;cAQa,uBAAA,EAAuB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KACxB,uBAAA,GAA0B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAQlB,iBAAA,GAAoB,CAAA,CAAE,KAAA,QAAa,iBAAA;AAAA,cAElC,qBAAA;AAAA,iBAEG,uBAAA;EAAoC,WAAA;IAAe,EAAA,EAAI,WAAA;EAAA;AAAA,EAAA,CACrE,QAAA,EAAU,CAAA,EACV,UAAA,WACC,CAAA"}
|
|
@@ -4,7 +4,6 @@ import { BlockPackMeta } from "./block_meta.js";
|
|
|
4
4
|
import { CreateBlockPackDescriptionSchema } from "./block_description.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { toMerged } from "es-toolkit";
|
|
7
|
-
|
|
8
7
|
//#region src/block_meta/block_manifest.ts
|
|
9
8
|
const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);
|
|
10
9
|
const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);
|
|
@@ -26,7 +25,7 @@ const BlockPackManifestFile = "manifest.json";
|
|
|
26
25
|
function overrideManifestVersion(manifest, newVersion) {
|
|
27
26
|
return toMerged(manifest, { description: { id: { version: newVersion } } });
|
|
28
27
|
}
|
|
29
|
-
|
|
30
28
|
//#endregion
|
|
31
29
|
export { BlockComponentsManifest, BlockPackDescriptionManifest, BlockPackManifest, BlockPackManifestFile, BlockPackMetaManifest, ManifestFileInfo, Sha256Schema, overrideManifestVersion };
|
|
30
|
+
|
|
32
31
|
//# sourceMappingURL=block_manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_manifest.js","names":[],"sources":["../../src/block_meta/block_manifest.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockComponents } from \"./block_components\";\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from \"./content_types\";\nimport { CreateBlockPackDescriptionSchema } from \"./block_description\";\nimport { BlockPackMeta } from \"./block_meta\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockPackId } from \"./block_id\";\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest,\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema,\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z\n .object({\n schema: z.literal(\"v2\"),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo),\n })\n .passthrough();\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = \"manifest.json\";\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"block_manifest.js","names":[],"sources":["../../src/block_meta/block_manifest.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { BlockComponents } from \"./block_components\";\nimport { ContentRelative, ContentRelativeBinary, ContentRelativeText } from \"./content_types\";\nimport { CreateBlockPackDescriptionSchema } from \"./block_description\";\nimport { BlockPackMeta } from \"./block_meta\";\nimport { toMerged } from \"es-toolkit\";\nimport type { BlockPackId } from \"./block_id\";\n\nexport const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);\nexport type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;\n\nexport const BlockPackMetaManifest = BlockPackMeta(ContentRelativeText, ContentRelativeBinary);\nexport type BlockPackMetaManifest = z.infer<typeof BlockPackMetaManifest>;\n\n/** Block description to be used in block manifest */\nexport const BlockPackDescriptionManifest = CreateBlockPackDescriptionSchema(\n BlockComponentsManifest,\n BlockPackMetaManifest,\n);\nexport type BlockPackDescriptionManifest = z.infer<typeof BlockPackDescriptionManifest>;\n\nexport const Sha256Schema = z\n .string()\n .regex(/[0-9a-fA-F]/)\n .toUpperCase()\n .length(64); // 256 / 4 (bits per hex register);\n\nexport const ManifestFileInfo = z.object({\n name: z.string(),\n size: z.number().int(),\n sha256: Sha256Schema,\n});\nexport type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;\n\nexport const BlockPackManifest = z\n .object({\n schema: z.literal(\"v2\"),\n description: BlockPackDescriptionManifest,\n timestamp: z.number().optional(),\n files: z.array(ManifestFileInfo),\n })\n .passthrough();\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = \"manifest.json\";\n\nexport function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(\n manifest: T,\n newVersion: string,\n): T {\n return toMerged(manifest, { description: { id: { version: newVersion } } }) as T;\n}\n"],"mappings":";;;;;;;AAQA,MAAa,0BAA0B,gBAAgB,iBAAiB,gBAAgB;AAGxF,MAAa,wBAAwB,cAAc,qBAAqB,sBAAsB;;AAI9F,MAAa,+BAA+B,iCAC1C,yBACA,sBACD;AAGD,MAAa,eAAe,EACzB,QAAQ,CACR,MAAM,cAAc,CACpB,aAAa,CACb,OAAO,GAAG;AAEb,MAAa,mBAAmB,EAAE,OAAO;CACvC,MAAM,EAAE,QAAQ;CAChB,MAAM,EAAE,QAAQ,CAAC,KAAK;CACtB,QAAQ;CACT,CAAC;AAGF,MAAa,oBAAoB,EAC9B,OAAO;CACN,QAAQ,EAAE,QAAQ,KAAK;CACvB,aAAa;CACb,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,OAAO,EAAE,MAAM,iBAAiB;CACjC,CAAC,CACD,aAAa;AAGhB,MAAa,wBAAwB;AAErC,SAAgB,wBACd,UACA,YACG;AACH,QAAO,SAAS,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,YAAY,EAAE,EAAE,CAAC"}
|
|
@@ -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;
|
|
@@ -484,6 +402,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
484
402
|
};
|
|
485
403
|
title: string;
|
|
486
404
|
description: string;
|
|
405
|
+
url?: string | undefined;
|
|
487
406
|
longDescription?: {
|
|
488
407
|
type: "explicit-string";
|
|
489
408
|
content: string;
|
|
@@ -515,7 +434,6 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
515
434
|
type: "absolute-file";
|
|
516
435
|
file: string;
|
|
517
436
|
} | undefined;
|
|
518
|
-
url?: string | undefined;
|
|
519
437
|
docs?: string | undefined;
|
|
520
438
|
support?: string | undefined;
|
|
521
439
|
tags?: string[] | undefined;
|
|
@@ -543,6 +461,7 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
543
461
|
};
|
|
544
462
|
title: string;
|
|
545
463
|
description: string;
|
|
464
|
+
url?: string | undefined;
|
|
546
465
|
longDescription?: string | {
|
|
547
466
|
type: "explicit-string";
|
|
548
467
|
content: string;
|
|
@@ -574,7 +493,6 @@ declare const BlockPackMetaDescriptionRaw: z.ZodObject<{
|
|
|
574
493
|
type: "absolute-file";
|
|
575
494
|
file: string;
|
|
576
495
|
} | undefined;
|
|
577
|
-
url?: string | undefined;
|
|
578
496
|
docs?: string | undefined;
|
|
579
497
|
support?: string | undefined;
|
|
580
498
|
tags?: string[] | undefined;
|
|
@@ -687,6 +605,7 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
687
605
|
};
|
|
688
606
|
title: string;
|
|
689
607
|
description: string;
|
|
608
|
+
url?: string | undefined;
|
|
690
609
|
longDescription?: string | undefined;
|
|
691
610
|
changelog?: string | undefined;
|
|
692
611
|
logo?: {
|
|
@@ -694,7 +613,6 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
694
613
|
mimeType: string;
|
|
695
614
|
content: string;
|
|
696
615
|
} | undefined;
|
|
697
|
-
url?: string | undefined;
|
|
698
616
|
docs?: string | undefined;
|
|
699
617
|
support?: string | undefined;
|
|
700
618
|
tags?: string[] | undefined;
|
|
@@ -716,6 +634,7 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
716
634
|
};
|
|
717
635
|
title: string;
|
|
718
636
|
description: string;
|
|
637
|
+
url?: string | undefined;
|
|
719
638
|
longDescription?: string | undefined;
|
|
720
639
|
changelog?: string | undefined;
|
|
721
640
|
logo?: {
|
|
@@ -723,7 +642,6 @@ declare const BlockPackMetaEmbeddedBase64: z.ZodObject<{
|
|
|
723
642
|
mimeType: string;
|
|
724
643
|
content: string;
|
|
725
644
|
} | undefined;
|
|
726
|
-
url?: string | undefined;
|
|
727
645
|
docs?: string | undefined;
|
|
728
646
|
support?: string | undefined;
|
|
729
647
|
tags?: string[] | undefined;
|
|
@@ -836,6 +754,7 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
836
754
|
};
|
|
837
755
|
title: string;
|
|
838
756
|
description: string;
|
|
757
|
+
url?: string | undefined;
|
|
839
758
|
longDescription?: string | undefined;
|
|
840
759
|
changelog?: string | undefined;
|
|
841
760
|
logo?: {
|
|
@@ -843,7 +762,6 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
843
762
|
mimeType: string;
|
|
844
763
|
content: Uint8Array<ArrayBuffer>;
|
|
845
764
|
} | undefined;
|
|
846
|
-
url?: string | undefined;
|
|
847
765
|
docs?: string | undefined;
|
|
848
766
|
support?: string | undefined;
|
|
849
767
|
tags?: string[] | undefined;
|
|
@@ -865,6 +783,7 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
865
783
|
};
|
|
866
784
|
title: string;
|
|
867
785
|
description: string;
|
|
786
|
+
url?: string | undefined;
|
|
868
787
|
longDescription?: string | undefined;
|
|
869
788
|
changelog?: string | undefined;
|
|
870
789
|
logo?: {
|
|
@@ -872,7 +791,6 @@ declare const BlockPackMetaEmbeddedBytes: z.ZodObject<{
|
|
|
872
791
|
mimeType: string;
|
|
873
792
|
content: Uint8Array<ArrayBuffer>;
|
|
874
793
|
} | undefined;
|
|
875
|
-
url?: string | undefined;
|
|
876
794
|
docs?: string | undefined;
|
|
877
795
|
support?: string | undefined;
|
|
878
796
|
tags?: string[] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_meta.d.ts","names":[],"sources":["../../src/block_meta/block_meta.ts"],"mappings":";;;cAQa,aAAA,EAAa,CAAA,CAAA,OAAA;AAAA,KAQd,aAAA,GAAgB,CAAA,CAAE,KAAA,QAAa,aAAA;AAAA,iBAE3B,aAAA,8BACe,CAAA,CAAE,UAAA,2BACN,CAAA,CAAE,UAAA,CAAA,CAC3B,UAAA,EAAY,cAAA,EAAgB,MAAA,EAAQ,UAAA,GAAU,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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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 DescriptionContent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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,IAAAA,EAAE,QAAQ,kBAAkB;CAClC,UAAUA,IAAAA,EACP,QAAQ,CACR,MAAM,gBAAgB,CACtB,SAAS,iCAAiC;CAC7C,SAASA,IAAAA,EAAE,QAAQ,CAAC,QAAQ,CAAC,SAAS,8BAA8B;CACrE,CAAC,CACD,QAAQ;AAGX,MAAa,kBAAkBA,IAAAA,EAC5B,OAAO;CACN,MAAMA,IAAAA,EAAE,QAAQ,WAAW;CAC3B,MAAMA,IAAAA,EACH,QAAQ,CACR,SACC,4FACD;CACJ,CAAC,CACD,QAAQ;AAGX,MAAM,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AA,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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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"}
|