@milaboratories/pl-model-middle-layer 1.5.11 → 1.5.13
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/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.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, ctx) => ({ 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, ctx) => {\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","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","import {\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 relaive path, slesh 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","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\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.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\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}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n","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';\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.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport { BlockPackId, BlockPackMetaEmbeddedBytes, SemVer } from '../block_meta';\nimport { BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n"],"names":["ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverview","RegistryStatus","BlockPackListing"],"mappings":"uGAMaA,EAAwBC,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,QAASA,EAAAA,EAAE,SAAS,SAAS,qBAAqB,CACpD,CAAC,EACA,OAAO,EAGGC,EAAwBD,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,SAAUA,IACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC,EAC5C,QAASA,EAAE,EAAA,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B,CACrE,CAAC,EACA,OAAO,EAGGE,EAAkBF,IAC5B,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,UAAU,EAC1B,KAAMA,EAAAA,EACH,OAAA,EACA,SACC,2FACF,CACJ,CAAC,EACA,OAAO,EAGJG,EAAe,IAAI,OAAO,iBAAiB,EAEpCC,EAAsBJ,IAChC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,eAAe,EAC/B,KAAMA,EAAAA,EACH,SACA,MAAMG,EAAc,+BAA+B,EACnD,SAAS,mDAAmD,CACjE,CAAC,EACA,OAAO,EAGGE,EAAqBL,IAC/B,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,cAAc,EAC9B,IAAKA,EAAE,EAAA,OAAA,EAAS,IAAI,EAAE,SAAS,wCAAwC,CACzE,CAAC,EACA,OAAO,EAOGM,EAAuBN,IACjC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,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,WAAYA,IAAE,OAAO,EACrB,GAAI+B,EACJ,KAAMmB,EACN,KAAMiB,EACN,cAAenE,EAAAA,EAAE,MAAMwB,CAAM,CAC/B,CAAC,EAGYmD,EAAiBH,EAAc,OAAO,CACjD,OAAQxE,EAAA,EAAE,MAAM,CAACA,IAAE,QAAQ,QAAQ,EAAGA,EAAE,EAAA,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGY4E,GAAmB5E,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAM2E,CAAc,EAClC,WAAY3E,EAAAA,EAAE,MAAM0E,CAAiB,CACvC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.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, ctx) => ({ 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, ctx) => {\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","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","import {\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 relaive path, slesh 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","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\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.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\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}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n","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';\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.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport { BlockPackId, BlockPackMetaEmbeddedBytes, SemVer } from '../block_meta';\nimport { BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n"],"names":["ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverview","RegistryStatus","BlockPackListing"],"mappings":"uGAMaA,EAAwBC,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,QAASA,EAAA,EAAE,OAAO,EAAE,SAAS,qBAAqB,CACpD,CAAC,EACA,OAAO,EAGGC,EAAwBD,IAClC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,iBAAiB,EACjC,SAAUA,IACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC,EAC5C,QAASA,EAAE,EAAA,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B,CACrE,CAAC,EACA,OAAO,EAGGE,EAAkBF,IAC5B,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,UAAU,EAC1B,KAAMA,EAAAA,EACH,OAAA,EACA,SACC,2FAAA,CAEN,CAAC,EACA,OAAO,EAGJG,EAAe,IAAI,OAAO,iBAAiB,EAEpCC,EAAsBJ,IAChC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,eAAe,EAC/B,KAAMA,EAAAA,EACH,SACA,MAAMG,EAAc,+BAA+B,EACnD,SAAS,mDAAmD,CACjE,CAAC,EACA,OAAO,EAGGE,EAAqBL,IAC/B,OAAO,CACN,KAAM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gBxE,IAAE,OAAO,CACpC,GAAIA,IAAE,OAAO,EACb,MAAOA,EAAA,EAAE,OAAO,EAAE,SAAS,EAC3B,KAAMuE,CACR,CAAC,EAGYE,GAAezE,EAAAA,EAAE,MAAMwE,CAAa,EC5BpCE,EAAoB1E,IAAE,OAAO,CACxC,WAAYA,IAAE,OAAO,EACrB,GAAI+B,EACJ,KAAMmB,EACN,KAAMiB,EACN,cAAenE,EAAAA,EAAE,MAAMwB,CAAM,CAC/B,CAAC,EAGYmD,EAAiBH,EAAc,OAAO,CACjD,OAAQxE,EAAA,EAAE,MAAM,CAACA,IAAE,QAAQ,QAAQ,EAAGA,EAAE,EAAA,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGY4E,GAAmB5E,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAM2E,CAAc,EAClC,WAAY3E,EAAAA,EAAE,MAAM0E,CAAiB,CACvC,CAAC"}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.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, ctx) => ({ 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, ctx) => {\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","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","import {\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 relaive path, slesh 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","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\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.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\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}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n","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';\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.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport { BlockPackId, BlockPackMetaEmbeddedBytes, SemVer } from '../block_meta';\nimport { BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n"],"names":["ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverview","RegistryStatus","BlockPackListing"],"mappings":";AAMa,MAAAA,IAAwBC,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,SAASA,EAAE,SAAS,SAAS,qBAAqB;AACpD,CAAC,EACA,OAAO,GAGGC,IAAwBD,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,UAAUA,EACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC;AAAA,EAC5C,SAASA,EAAE,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B;AACrE,CAAC,EACA,OAAO,GAGGE,IAAkBF,EAC5B,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,UAAU;AAAA,EAC1B,MAAMA,EACH,OAAA,EACA;AAAA,IACC;AAAA,EACF;AACJ,CAAC,E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C,YAAY3E,EAAE,MAAM0E,CAAiB;AACvC,CAAC;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../src/block_meta/content_types.ts","../src/block_meta/semver.ts","../src/block_meta/content_conversion.ts","../src/block_meta/block_id.ts","../src/block_meta/block_components.ts","../src/block_meta/block_meta.ts","../src/block_meta/block_description.ts","../src/block_meta/block_manifest.ts","../src/block_registry/block_pack_spec.ts","../src/block_registry/registry_spec.ts","../src/block_registry/overview.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, ctx) => ({ 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, ctx) => {\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","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","import {\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 relaive path, slesh 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","import { z } from 'zod';\nimport { SemVer } from './semver';\n\n/** Global identifier of the block */\nexport const BlockPackId = z\n .object({\n organization: z.string(),\n name: z.string(),\n version: SemVer\n })\n .strict();\nexport type BlockPackId = z.infer<typeof BlockPackId>;\n\nexport const BlockPackIdNoVersion = BlockPackId.omit({ version: true });\nexport type BlockPackIdNoVersion = z.infer<typeof BlockPackIdNoVersion>;\n\nexport function blockPackIdEquals(\n bp1: BlockPackId | undefined,\n bp2: BlockPackId | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return (\n bp1.name === bp2.name && bp1.organization === bp2.organization && bp1.version === bp2.version\n );\n}\n\nexport function blockPackIdNoVersionEquals(\n bp1: BlockPackIdNoVersion | undefined,\n bp2: BlockPackIdNoVersion | undefined\n): boolean {\n if (bp1 === undefined && bp2 === undefined) return true;\n if (bp1 === undefined || bp2 === undefined) return false;\n return bp1.name === bp2.name && bp1.organization === bp2.organization;\n}\n","import { z } from 'zod';\nimport { ContentRelativeBinary } from './content_types';\nimport { mapRemoteToAbsolute } from './content_conversion';\n\nexport type BlockPackComponents = {};\n\nexport function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.object({\n type: z.literal('workflow-v1'),\n main: contentType.describe('Main workflow')\n });\n}\n\nexport function Workflow<const Content extends z.ZodTypeAny>(contentType: Content) {\n return z.union([\n // string is converted to v1 workflow\n contentType\n .transform((value: z.infer<typeof contentType>) => ({\n type: 'workflow-v1' as const,\n main: value\n }))\n .pipe(WorkflowV1(contentType)),\n // structured objects are decoded as union with type descriptor\n z.discriminatedUnion('type', [WorkflowV1(contentType)])\n ]);\n}\n\nexport function BlockComponents<\n const WfAndModel extends z.ZodTypeAny,\n const UI extends z.ZodTypeAny\n>(wfAndModel: WfAndModel, ui: UI) {\n return z.object({\n workflow: Workflow(wfAndModel),\n model: wfAndModel,\n ui\n });\n}\n\nexport const BlockComponentsDescriptionRaw = BlockComponents(z.string(), z.string());\nexport type BlockComponentsDescriptionRaw = z.infer<typeof BlockComponentsDescriptionRaw>;\n\nexport function BlockComponentsAbsoluteUrl(prefix: string) {\n return BlockComponents(\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix)),\n ContentRelativeBinary.transform(mapRemoteToAbsolute(prefix))\n );\n}\nexport type BlockComponentsAbsolute = z.infer<ReturnType<typeof BlockComponentsAbsoluteUrl>>;\n\n// export const BlockComponentsExplicit = BlockComponents(, ContentRelative);\n// export type BlockComponentsExplicit = z.infer<typeof BlockComponentsExplicit>;\n","import { z } from 'zod';\nimport {\n ContentExplicitBase64,\n ContentExplicitBytes,\n DescriptionContentBinary,\n DescriptionContentText\n} from './content_types';\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.object({\n name: z.string(),\n url: z.string().url(),\n logo: binary.optional()\n }),\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}\n\n// prettier-ignore\nexport const BlockPackMetaDescriptionRaw = BlockPackMeta(\n DescriptionContentText,\n DescriptionContentBinary\n);\nexport type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBase64 = BlockPackMeta(\n z.string(),\n ContentExplicitBase64\n);\nexport type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;\n\n// prettier-ignore\nexport const BlockPackMetaEmbeddedBytes = BlockPackMeta(\n z.string(),\n ContentExplicitBytes\n);\nexport type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;\n","import { z, ZodTypeAny } from 'zod';\nimport { BlockComponentsDescriptionRaw } from './block_components';\nimport { BlockPackMetaDescriptionRaw } from './block_meta';\nimport { BlockPackId } from './block_id';\n\n/** Description, as appears in root block package.json file,\n * `file:` references are parsed into relative content of corresponding type, depending on the context,\n * strings are converted to explicit content type. */\nexport const BlockPackDescriptionFromPackageJsonRaw = z.object({\n components: BlockComponentsDescriptionRaw,\n meta: BlockPackMetaDescriptionRaw\n});\n\nexport function CreateBlockPackDescriptionSchema<\n Components extends ZodTypeAny,\n Meta extends ZodTypeAny\n>(components: Components, meta: Meta) {\n return z.object({\n id: BlockPackId,\n components,\n meta\n });\n}\n\nexport const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(\n BlockComponentsDescriptionRaw,\n BlockPackMetaDescriptionRaw\n);\nexport type BlockPackDescriptionRaw = z.infer<typeof BlockPackDescriptionRaw>;\n","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';\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.object({\n schema: z.literal('v2'),\n description: BlockPackDescriptionManifest,\n files: z.array(ManifestFileInfo)\n});\nexport type BlockPackManifest = z.infer<typeof BlockPackManifest>;\n\nexport const BlockPackManifestFile = 'manifest.json';\n","import { z } from 'zod';\nimport { BlockPackId } from '../block_meta';\n\n/** Block pack from local folder, to be used during block development. Old layout.\n * @deprecated don't use */\nexport const BlockPackDevV1 = z.object({\n type: z.literal('dev-v1'),\n folder: z.string(),\n mtime: z.string().optional()\n});\n/** @deprecated don't use */\nexport type BlockPackDevV1 = z.infer<typeof BlockPackDevV1>;\n\n/** Block pack from local folder, to be used during block development. New layout. */\nexport const BlockPackDevV2 = z.object({\n type: z.literal('dev-v2'),\n folder: z.string(),\n mtime: z.string().optional()\n});\nexport type BlockPackDevV2 = z.infer<typeof BlockPackDevV2>;\n\n/**\n * Block pack from registry with version 2 layout, to be loaded directly\n * from the client.\n * @deprecated don't use\n * */\nexport const BlockPackFromRegistryV1 = z.object({\n type: z.literal('from-registry-v1'),\n registryUrl: z.string(),\n id: BlockPackId\n});\n/** @deprecated don't use */\nexport type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;\n\n/** Block pack from registry with version 2 layout, to be loaded directly\n * from the client. */\nexport const BlockPackFromRegistryV2 = z.object({\n type: z.literal('from-registry-v2'),\n registryUrl: z.string(),\n id: BlockPackId\n});\nexport type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;\n\n/** Information about block origin, can be used to instantiate new blocks */\nexport const BlockPackSpec = z.discriminatedUnion('type', [\n BlockPackDevV1,\n BlockPackDevV2,\n BlockPackFromRegistryV1,\n BlockPackFromRegistryV2\n]);\nexport type BlockPackSpec = z.infer<typeof BlockPackSpec>;\n","import { z } from 'zod';\n\nexport const LocalDevFolder = z.object({\n type: z.literal('local-dev'),\n path: z.string()\n});\nexport type LocalDevFolder = z.infer<typeof LocalDevFolder>;\n\n/** @deprecated don't use */\nexport const RemoteRegistryV1Spec = z.object({\n type: z.literal('remote-v1'),\n url: z.string().url()\n});\n/** @deprecated don't use */\nexport type RemoteRegistryV1Spec = z.infer<typeof RemoteRegistryV1Spec>;\n\nexport const RemoteRegistryV2Spec = z.object({\n type: z.literal('remote-v2'),\n url: z.string().url()\n});\nexport type RemoteRegistryV2Spec = z.infer<typeof RemoteRegistryV2Spec>;\n\nexport const RegistrySpec = z.discriminatedUnion('type', [\n RemoteRegistryV1Spec,\n RemoteRegistryV2Spec,\n LocalDevFolder\n]);\nexport type RegistrySpec = z.infer<typeof RegistrySpec>;\n\nexport const RegistryEntry = z.object({\n id: z.string(),\n title: z.string().optional(),\n spec: RegistrySpec\n});\nexport type RegistryEntry = z.infer<typeof RegistryEntry>;\n\nexport const RegistryList = z.array(RegistryEntry);\nexport type RegistryList = z.infer<typeof RegistryList>;\n","import { z } from 'zod';\nimport { BlockPackId, BlockPackMetaEmbeddedBytes, SemVer } from '../block_meta';\nimport { BlockPackSpec } from './block_pack_spec';\nimport { RegistryEntry } from './registry_spec';\n\n/**\n * Latest information about specific block pack. Contain information about latest version of the package.\n * */\nexport const BlockPackOverview = z.object({\n registryId: z.string(),\n id: BlockPackId,\n meta: BlockPackMetaEmbeddedBytes,\n spec: BlockPackSpec,\n otherVersions: z.array(SemVer)\n});\nexport type BlockPackOverview = z.infer<typeof BlockPackOverview>;\n\nexport const RegistryStatus = RegistryEntry.extend({\n status: z.union([z.literal('online'), z.literal('offline')])\n});\nexport type RegistryStatus = z.infer<typeof RegistryStatus>;\n\nexport const BlockPackListing = z.object({\n registries: z.array(RegistryStatus),\n blockPacks: z.array(BlockPackOverview)\n});\nexport type BlockPackListing = z.infer<typeof BlockPackListing>;\n"],"names":["ContentExplicitString","z","ContentExplicitBase64","ContentRelative","absPathRegex","ContentAbsoluteFile","ContentAbsoluteUrl","ContentExplicitBytes","ContentAbsoluteFolder","ContentAny","ContentExplicitOrRelative","ContentAnyLocal","ContentAnyRemote","ContentAnyBinaryLocal","ContentAnyTextLocal","ContentAbsoluteBinaryRemote","ContentAbsoluteBinaryLocal","ContentAbsoluteTextRemote","ContentAbsoluteTextLocal","ContentRelativeBinary","ContentRelativeText","DescriptionContentBinary","value","ctx","DescriptionContentText","SemVer","mapRemoteToAbsolute","rootUrl","rootWithSlash","addPrefixToRelative","prefix","prefixWithSlash","BlockPackId","BlockPackIdNoVersion","blockPackIdEquals","bp1","bp2","blockPackIdNoVersionEquals","WorkflowV1","contentType","Workflow","BlockComponents","wfAndModel","ui","BlockComponentsDescriptionRaw","BlockComponentsAbsoluteUrl","BlockPackMeta","longString","binary","BlockPackMetaDescriptionRaw","BlockPackMetaEmbeddedBase64","BlockPackMetaEmbeddedBytes","BlockPackDescriptionFromPackageJsonRaw","CreateBlockPackDescriptionSchema","components","meta","BlockPackDescriptionRaw","BlockComponentsManifest","BlockPackMetaManifest","BlockPackDescriptionManifest","Sha256Schema","ManifestFileInfo","BlockPackManifest","BlockPackManifestFile","BlockPackDevV1","BlockPackDevV2","BlockPackFromRegistryV1","BlockPackFromRegistryV2","BlockPackSpec","LocalDevFolder","RemoteRegistryV1Spec","RemoteRegistryV2Spec","RegistrySpec","RegistryEntry","RegistryList","BlockPackOverview","RegistryStatus","BlockPackListing"],"mappings":";AAMa,MAAAA,IAAwBC,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,SAASA,EAAE,OAAO,EAAE,SAAS,qBAAqB;AACpD,CAAC,EACA,OAAO,GAGGC,IAAwBD,EAClC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,iBAAiB;AAAA,EACjC,UAAUA,EACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC;AAAA,EAC5C,SAASA,EAAE,OAAA,EAAS,OAAO,EAAE,SAAS,6BAA6B;AACrE,CAAC,EACA,OAAO,GAGGE,IAAkBF,EAC5B,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,UAAU;AAAA,EAC1B,MAAMA,EACH,OAAA,EACA;AAAA,IACC;AAAA,EAAA;AAEN,CAAC,EACA,OAAO,GAGJG,IAAe,IAAI,OAAO,iBAAiB,GAEpCC,IAAsBJ,EAChC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,eAAe;AAAA,EAC/B,MAAMA,EACH,SACA,MAAMG,GAAc,+BAA+B,EACnD,SAAS,mDAAmD;AACjE,CAAC,EACA,OAAO,GAGGE,IAAqBL,EAC/B,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,cAAc;AAAA,EAC9B,KAAKA,EAAE,OAAA,EAAS,IAAI,EAAE,SAAS,wCAAwC;AACzE,CAAC,EACA,OAAO,GAOGM,IAAuBN,EACjC,OAAO;AAAA,EACN,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,EAChC,UAAUA,EACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC;AAAA,EAC5C,SAASA,EAAE,WAAW,UAAU,EAAE,SAAS,aAAa;AAC1D,CAAC,EACA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I;AACtB,CAAC,GAGYuE,IAAevE,EAAE,mBAAmB,QAAQ;AAAA,EACvDqE;AAAA,EACAC;AAAA,EACAF;AACF,CAAC,GAGYI,IAAgBxE,EAAE,OAAO;AAAA,EACpC,IAAIA,EAAE,OAAO;AAAA,EACb,OAAOA,EAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,MAAMuE;AACR,CAAC,GAGYE,KAAezE,EAAE,MAAMwE,CAAa,GC5BpCE,IAAoB1E,EAAE,OAAO;AAAA,EACxC,YAAYA,EAAE,OAAO;AAAA,EACrB,IAAI+B;AAAA,EACJ,MAAMmB;AAAA,EACN,MAAMiB;AAAA,EACN,eAAenE,EAAE,MAAMwB,CAAM;AAC/B,CAAC,GAGYmD,IAAiBH,EAAc,OAAO;AAAA,EACjD,QAAQxE,EAAE,MAAM,CAACA,EAAE,QAAQ,QAAQ,GAAGA,EAAE,QAAQ,SAAS,CAAC,CAAC;AAC7D,CAAC,GAGY4E,KAAmB5E,EAAE,OAAO;AAAA,EACvC,YAAYA,EAAE,MAAM2E,CAAc;AAAA,EAClC,YAAY3E,EAAE,MAAM0E,CAAiB;AACvC,CAAC;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.13",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"zod": "^3.23.8",
|
|
21
21
|
"utility-types": "^3.11.0",
|
|
22
|
-
"@milaboratories/pl-model-common": "^1.
|
|
22
|
+
"@milaboratories/pl-model-common": "^1.8.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"typescript": "~5.5.4",
|