@milaboratories/pl-model-middle-layer 1.4.1 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block_meta/block_description.d.ts +148 -0
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_id.d.ts +2 -0
- package/dist/block_meta/block_id.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +141 -0
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_meta.d.ts +65 -0
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_registry/overview.d.ts +12 -0
- package/dist/block_registry/overview.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -96
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/block_meta/block_id.ts +20 -0
- package/src/block_meta/block_meta.ts +1 -0
|
@@ -21,6 +21,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
21
21
|
title: z.ZodString;
|
|
22
22
|
description: z.ZodString;
|
|
23
23
|
longDescription: z.ZodOptional<z.ZodString>;
|
|
24
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
24
25
|
logo: z.ZodOptional<z.ZodObject<{
|
|
25
26
|
type: z.ZodLiteral<"explicit-bytes">;
|
|
26
27
|
mimeType: z.ZodString;
|
|
@@ -85,6 +86,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
85
86
|
description: string;
|
|
86
87
|
url?: string | undefined;
|
|
87
88
|
longDescription?: string | undefined;
|
|
89
|
+
changelog?: string | undefined;
|
|
88
90
|
logo?: {
|
|
89
91
|
type: "explicit-bytes";
|
|
90
92
|
content: Uint8Array;
|
|
@@ -107,6 +109,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
107
109
|
description: string;
|
|
108
110
|
url?: string | undefined;
|
|
109
111
|
longDescription?: string | undefined;
|
|
112
|
+
changelog?: string | undefined;
|
|
110
113
|
logo?: {
|
|
111
114
|
type: "explicit-bytes";
|
|
112
115
|
content: Uint8Array;
|
|
@@ -221,6 +224,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
221
224
|
description: string;
|
|
222
225
|
url?: string | undefined;
|
|
223
226
|
longDescription?: string | undefined;
|
|
227
|
+
changelog?: string | undefined;
|
|
224
228
|
logo?: {
|
|
225
229
|
type: "explicit-bytes";
|
|
226
230
|
content: Uint8Array;
|
|
@@ -277,6 +281,7 @@ export declare const BlockPackOverview: z.ZodObject<{
|
|
|
277
281
|
description: string;
|
|
278
282
|
url?: string | undefined;
|
|
279
283
|
longDescription?: string | undefined;
|
|
284
|
+
changelog?: string | undefined;
|
|
280
285
|
logo?: {
|
|
281
286
|
type: "explicit-bytes";
|
|
282
287
|
content: Uint8Array;
|
|
@@ -465,6 +470,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
465
470
|
title: z.ZodString;
|
|
466
471
|
description: z.ZodString;
|
|
467
472
|
longDescription: z.ZodOptional<z.ZodString>;
|
|
473
|
+
changelog: z.ZodOptional<z.ZodString>;
|
|
468
474
|
logo: z.ZodOptional<z.ZodObject<{
|
|
469
475
|
type: z.ZodLiteral<"explicit-bytes">;
|
|
470
476
|
mimeType: z.ZodString;
|
|
@@ -529,6 +535,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
529
535
|
description: string;
|
|
530
536
|
url?: string | undefined;
|
|
531
537
|
longDescription?: string | undefined;
|
|
538
|
+
changelog?: string | undefined;
|
|
532
539
|
logo?: {
|
|
533
540
|
type: "explicit-bytes";
|
|
534
541
|
content: Uint8Array;
|
|
@@ -551,6 +558,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
551
558
|
description: string;
|
|
552
559
|
url?: string | undefined;
|
|
553
560
|
longDescription?: string | undefined;
|
|
561
|
+
changelog?: string | undefined;
|
|
554
562
|
logo?: {
|
|
555
563
|
type: "explicit-bytes";
|
|
556
564
|
content: Uint8Array;
|
|
@@ -665,6 +673,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
665
673
|
description: string;
|
|
666
674
|
url?: string | undefined;
|
|
667
675
|
longDescription?: string | undefined;
|
|
676
|
+
changelog?: string | undefined;
|
|
668
677
|
logo?: {
|
|
669
678
|
type: "explicit-bytes";
|
|
670
679
|
content: Uint8Array;
|
|
@@ -721,6 +730,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
721
730
|
description: string;
|
|
722
731
|
url?: string | undefined;
|
|
723
732
|
longDescription?: string | undefined;
|
|
733
|
+
changelog?: string | undefined;
|
|
724
734
|
logo?: {
|
|
725
735
|
type: "explicit-bytes";
|
|
726
736
|
content: Uint8Array;
|
|
@@ -794,6 +804,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
794
804
|
description: string;
|
|
795
805
|
url?: string | undefined;
|
|
796
806
|
longDescription?: string | undefined;
|
|
807
|
+
changelog?: string | undefined;
|
|
797
808
|
logo?: {
|
|
798
809
|
type: "explicit-bytes";
|
|
799
810
|
content: Uint8Array;
|
|
@@ -867,6 +878,7 @@ export declare const BlockPackListing: z.ZodObject<{
|
|
|
867
878
|
description: string;
|
|
868
879
|
url?: string | undefined;
|
|
869
880
|
longDescription?: string | undefined;
|
|
881
|
+
changelog?: string | undefined;
|
|
870
882
|
logo?: {
|
|
871
883
|
type: "explicit-bytes";
|
|
872
884
|
content: Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../src/block_registry/overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;KAEK;AACL,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../src/block_registry/overview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;KAEK;AACL,eA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),r=t.z.object({type:t.z.literal("explicit-string"),content:t.z.string().describe("Actual string value")}).strict(),i=t.z.object({type:t.z.literal("explicit-base64"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.string().base64().describe("Base64 encoded binary value")}).strict(),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("zod"),r=t.z.object({type:t.z.literal("explicit-string"),content:t.z.string().describe("Actual string value")}).strict(),i=t.z.object({type:t.z.literal("explicit-base64"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.string().base64().describe("Base64 encoded binary value")}).strict(),n=t.z.object({type:t.z.literal("relative"),path:t.z.string().describe("Address of the file, in most cases relative to the file which this structure is a part of")}).strict(),c=t.z.object({type:t.z.literal("absolute-file"),file:t.z.string().startsWith("/").describe("Absolute address of the file in local file system")}).strict(),l=t.z.object({type:t.z.literal("absolute-url"),url:t.z.string().url().describe("Global URL to reach the requested file")}).strict(),b=t.z.object({type:t.z.literal("explicit-bytes"),mimeType:t.z.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),content:t.z.instanceof(Uint8Array).describe("Raw content")}).strict(),N=t.z.object({type:t.z.literal("absolute-folder"),folder:t.z.string().startsWith("/").describe("Absolute address of the folder in local file system")}).strict(),_=t.z.discriminatedUnion("type",[r,i,n,c,l]),$=t.z.discriminatedUnion("type",[r,i,n]),J=t.z.discriminatedUnion("type",[r,i,n,c]),G=t.z.discriminatedUnion("type",[r,i,n,l]),C=t.z.discriminatedUnion("type",[i,n,c]),v=t.z.discriminatedUnion("type",[r,n,c]),H=t.z.discriminatedUnion("type",[i,l]),K=t.z.discriminatedUnion("type",[i,c]),Q=t.z.discriminatedUnion("type",[r,l]),X=t.z.discriminatedUnion("type",[r,c]),d=t.z.discriminatedUnion("type",[i,n]),P=t.z.discriminatedUnion("type",[r,n]),R=t.z.union([t.z.string().startsWith("file:").transform((e,o)=>({type:"relative",path:e.slice(5)})),C]),A=t.z.union([t.z.string().transform((e,o)=>e.startsWith("file:")?{type:"relative",path:e.slice(5)}:{type:"explicit-string",content:e}),v]),m=t.z.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,"Wrong version format, please use valid semver");function p(e){const o=e.endsWith("/")?e:`${e}/`;return s=>s.type==="relative"?{type:"absolute-url",url:o+s.path}:s}function Y(e){const o=e.endsWith("/")?e:`${e}/`;return s=>s.type==="relative"?{type:"relative",path:o+s.path}:s}const a=t.z.object({organization:t.z.string(),name:t.z.string(),version:m}).strict(),tt=a.omit({version:!0});function et(e,o){return e===void 0&&o===void 0?!0:e===void 0||o===void 0?!1:e.name===o.name&&e.organization===o.organization&&e.version===o.version}function ot(e,o){return e===void 0&&o===void 0?!0:e===void 0||o===void 0?!1:e.name===o.name&&e.organization===o.organization}function y(e){return t.z.object({type:t.z.literal("workflow-v1"),main:e.describe("Main workflow")})}function h(e){return t.z.union([e.transform(o=>({type:"workflow-v1",main:o})).pipe(y(e)),t.z.discriminatedUnion("type",[y(e)])])}function k(e,o){return t.z.object({workflow:h(e),model:e,ui:o})}const g=k(t.z.string(),t.z.string());function nt(e){return k(d.transform(p(e)),d.transform(p(e)))}function z(e,o){return t.z.object({title:t.z.string(),description:t.z.string(),longDescription:e.optional(),changelog:e.optional(),logo:o.optional(),url:t.z.string().url().optional(),docs:t.z.string().url().optional(),support:t.z.union([t.z.string().url(),t.z.string().email()]).optional(),tags:t.z.array(t.z.string()).optional(),organization:t.z.object({name:t.z.string(),url:t.z.string().url(),logo:o.optional()})})}const u=z(A,R),it=z(t.z.string(),i),j=z(t.z.string(),b),rt=t.z.object({components:g,meta:u});function f(e,o){return t.z.object({id:a,components:e,meta:o})}const st=f(g,u),x=k(n,n),M=z(P,d),w=f(x,M),S=t.z.string().regex(/[0-9a-fA-F]/).toUpperCase().length(64),D=t.z.object({name:t.z.string(),size:t.z.number().int(),sha256:S}),ct=t.z.object({schema:t.z.literal("v2"),description:w,files:t.z.array(D)}),at="manifest.json",U=t.z.object({type:t.z.literal("dev-v1"),folder:t.z.string(),mtime:t.z.string().optional()}),V=t.z.object({type:t.z.literal("dev-v2"),folder:t.z.string(),mtime:t.z.string().optional()}),E=t.z.object({type:t.z.literal("from-registry-v1"),registryUrl:t.z.string(),id:a}),F=t.z.object({type:t.z.literal("from-registry-v2"),registryUrl:t.z.string(),id:a}),L=t.z.discriminatedUnion("type",[U,V,E,F]),T=t.z.object({type:t.z.literal("local-dev"),path:t.z.string()}),I=t.z.object({type:t.z.literal("remote-v1"),url:t.z.string().url()}),W=t.z.object({type:t.z.literal("remote-v2"),url:t.z.string().url()}),O=t.z.discriminatedUnion("type",[I,W,T]),B=t.z.object({id:t.z.string(),title:t.z.string().optional(),spec:O}),lt=t.z.array(B),q=t.z.object({registryId:t.z.string(),id:a,meta:j,spec:L,otherVersions:t.z.array(m)}),Z=B.extend({status:t.z.union([t.z.literal("online"),t.z.literal("offline")])}),zt=t.z.object({registries:t.z.array(Z),blockPacks:t.z.array(q)}),dt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.BlockComponents=k;exports.BlockComponentsAbsoluteUrl=nt;exports.BlockComponentsDescriptionRaw=g;exports.BlockComponentsManifest=x;exports.BlockPackDescriptionFromPackageJsonRaw=rt;exports.BlockPackDescriptionManifest=w;exports.BlockPackDescriptionRaw=st;exports.BlockPackDevV1=U;exports.BlockPackDevV2=V;exports.BlockPackFromRegistryV1=E;exports.BlockPackFromRegistryV2=F;exports.BlockPackId=a;exports.BlockPackIdNoVersion=tt;exports.BlockPackListing=zt;exports.BlockPackManifest=ct;exports.BlockPackManifestFile=at;exports.BlockPackMeta=z;exports.BlockPackMetaDescriptionRaw=u;exports.BlockPackMetaEmbeddedBase64=it;exports.BlockPackMetaEmbeddedBytes=j;exports.BlockPackMetaManifest=M;exports.BlockPackOverview=q;exports.BlockPackSpec=L;exports.ContentAbsoluteBinaryLocal=K;exports.ContentAbsoluteBinaryRemote=H;exports.ContentAbsoluteFile=c;exports.ContentAbsoluteFolder=N;exports.ContentAbsoluteTextLocal=X;exports.ContentAbsoluteTextRemote=Q;exports.ContentAbsoluteUrl=l;exports.ContentAny=_;exports.ContentAnyBinaryLocal=C;exports.ContentAnyLocal=J;exports.ContentAnyRemote=G;exports.ContentAnyTextLocal=v;exports.ContentExplicitBase64=i;exports.ContentExplicitBytes=b;exports.ContentExplicitOrRelative=$;exports.ContentExplicitString=r;exports.ContentRelative=n;exports.ContentRelativeBinary=d;exports.ContentRelativeText=P;exports.CreateBlockPackDescriptionSchema=f;exports.DescriptionContentBinary=R;exports.DescriptionContentText=A;exports.LocalDevFolder=T;exports.ManifestFileInfo=D;exports.PFrameInternal=dt;exports.RegistryEntry=B;exports.RegistryList=lt;exports.RegistrySpec=O;exports.RegistryStatus=Z;exports.RemoteRegistryV1Spec=I;exports.RemoteRegistryV2Spec=W;exports.SemVer=m;exports.Sha256Schema=S;exports.Workflow=h;exports.WorkflowV1=y;exports.addPrefixToRelative=Y;exports.blockPackIdEquals=et;exports.blockPackIdNoVersionEquals=ot;exports.mapRemoteToAbsolute=p;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
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\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z.string().startsWith('/').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 .startsWith('/')\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","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 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}\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","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","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,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,EAAAA,EAAE,MAAMuB,CAAM,CAC/B,CAAC,EAGY+C,EAAiBH,EAAc,OAAO,CACjD,OAAQnE,EAAA,EAAE,MAAM,CAACA,IAAE,QAAQ,QAAQ,EAAGA,EAAE,EAAA,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGYuE,GAAmBvE,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAMsE,CAAc,EAClC,WAAYtE,EAAAA,EAAE,MAAMqE,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\nexport const ContentAbsoluteFile = z\n .object({\n type: z.literal('absolute-file'),\n file: z.string().startsWith('/').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 .startsWith('/')\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}\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","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,EAGGG,EAAsBH,IAChC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,eAAe,EAC/B,KAAMA,IAAE,OAAO,EAAE,WAAW,GAAG,EAAE,SAAS,mDAAmD,CAC/F,CAAC,EACA,OAAO,EAGGI,EAAqBJ,IAC/B,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,cAAc,EAC9B,IAAKA,EAAE,EAAA,OAAA,EAAS,IAAI,EAAE,SAAS,wCAAwC,CACzE,CAAC,EACA,OAAO,EAOGK,EAAuBL,IACjC,OAAO,CACN,KAAMA,EAAAA,EAAE,QAAQ,gBAAgB,EAChC,SAAUA,IACP,OAAO,EACP,MAAM,eAAe,EACrB,SAAS,gCAAgC,EAC5C,QAASA,EAAE,EAAA,WAAW,UAAU,EAAE,SAAS,aAAa,CAC1D,CAAC,EACA,OAAO,EAGG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,QAAQ,SAAS,CAAC,CAAC,CAC7D,CAAC,EAGY2E,GAAmB3E,IAAE,OAAO,CACvC,WAAYA,EAAAA,EAAE,MAAM0E,CAAc,EAClC,WAAY1E,EAAAA,EAAE,MAAMyE,CAAiB,CACvC,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -21,20 +21,20 @@ const r = t.object({
|
|
|
21
21
|
type: t.literal("explicit-bytes"),
|
|
22
22
|
mimeType: t.string().regex(/\w+\/[-+.\w]+/).describe("MIME type to interpret content"),
|
|
23
23
|
content: t.instanceof(Uint8Array).describe("Raw content")
|
|
24
|
-
}).strict(),
|
|
24
|
+
}).strict(), $ = t.object({
|
|
25
25
|
type: t.literal("absolute-folder"),
|
|
26
26
|
folder: t.string().startsWith("/").describe("Absolute address of the folder in local file system")
|
|
27
|
-
}).strict(),
|
|
27
|
+
}).strict(), N = t.discriminatedUnion("type", [
|
|
28
28
|
r,
|
|
29
29
|
o,
|
|
30
30
|
i,
|
|
31
31
|
c,
|
|
32
32
|
l
|
|
33
|
-
]),
|
|
33
|
+
]), G = t.discriminatedUnion("type", [
|
|
34
34
|
r,
|
|
35
35
|
o,
|
|
36
36
|
i
|
|
37
|
-
]),
|
|
37
|
+
]), J = t.discriminatedUnion("type", [
|
|
38
38
|
r,
|
|
39
39
|
o,
|
|
40
40
|
i,
|
|
@@ -44,7 +44,7 @@ const r = t.object({
|
|
|
44
44
|
o,
|
|
45
45
|
i,
|
|
46
46
|
l
|
|
47
|
-
]),
|
|
47
|
+
]), B = t.discriminatedUnion("type", [
|
|
48
48
|
o,
|
|
49
49
|
i,
|
|
50
50
|
c
|
|
@@ -64,23 +64,23 @@ const r = t.object({
|
|
|
64
64
|
]), Y = t.discriminatedUnion("type", [
|
|
65
65
|
r,
|
|
66
66
|
c
|
|
67
|
-
]),
|
|
67
|
+
]), p = t.discriminatedUnion("type", [
|
|
68
68
|
o,
|
|
69
69
|
i
|
|
70
70
|
]), C = t.discriminatedUnion("type", [
|
|
71
71
|
r,
|
|
72
72
|
i
|
|
73
|
-
]), A = t.union([
|
|
74
|
-
t.string().startsWith("file:").transform((e, n) => ({ type: "relative", path: e.slice(5) })),
|
|
75
|
-
v
|
|
76
73
|
]), P = t.union([
|
|
74
|
+
t.string().startsWith("file:").transform((e, n) => ({ type: "relative", path: e.slice(5) })),
|
|
75
|
+
B
|
|
76
|
+
]), A = t.union([
|
|
77
77
|
t.string().transform((e, n) => e.startsWith("file:") ? { type: "relative", path: e.slice(5) } : { type: "explicit-string", content: e }),
|
|
78
78
|
j
|
|
79
|
-
]),
|
|
79
|
+
]), u = t.string().regex(
|
|
80
80
|
/^(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-]+)*))?$/,
|
|
81
81
|
"Wrong version format, please use valid semver"
|
|
82
82
|
);
|
|
83
|
-
function
|
|
83
|
+
function m(e) {
|
|
84
84
|
const n = e.endsWith("/") ? e : `${e}/`;
|
|
85
85
|
return (s) => s.type === "relative" ? { type: "absolute-url", url: n + s.path } : s;
|
|
86
86
|
}
|
|
@@ -91,9 +91,15 @@ function tt(e) {
|
|
|
91
91
|
const a = t.object({
|
|
92
92
|
organization: t.string(),
|
|
93
93
|
name: t.string(),
|
|
94
|
-
version:
|
|
94
|
+
version: u
|
|
95
95
|
}).strict(), et = a.omit({ version: !0 });
|
|
96
|
-
function
|
|
96
|
+
function nt(e, n) {
|
|
97
|
+
return e === void 0 && n === void 0 ? !0 : e === void 0 || n === void 0 ? !1 : e.name === n.name && e.organization === n.organization && e.version === n.version;
|
|
98
|
+
}
|
|
99
|
+
function it(e, n) {
|
|
100
|
+
return e === void 0 && n === void 0 ? !0 : e === void 0 || n === void 0 ? !1 : e.name === n.name && e.organization === n.organization;
|
|
101
|
+
}
|
|
102
|
+
function y(e) {
|
|
97
103
|
return t.object({
|
|
98
104
|
type: t.literal("workflow-v1"),
|
|
99
105
|
main: e.describe("Main workflow")
|
|
@@ -105,30 +111,31 @@ function R(e) {
|
|
|
105
111
|
e.transform((n) => ({
|
|
106
112
|
type: "workflow-v1",
|
|
107
113
|
main: n
|
|
108
|
-
})).pipe(
|
|
114
|
+
})).pipe(y(e)),
|
|
109
115
|
// structured objects are decoded as union with type descriptor
|
|
110
|
-
t.discriminatedUnion("type", [
|
|
116
|
+
t.discriminatedUnion("type", [y(e)])
|
|
111
117
|
]);
|
|
112
118
|
}
|
|
113
|
-
function
|
|
119
|
+
function g(e, n) {
|
|
114
120
|
return t.object({
|
|
115
121
|
workflow: R(e),
|
|
116
122
|
model: e,
|
|
117
123
|
ui: n
|
|
118
124
|
});
|
|
119
125
|
}
|
|
120
|
-
const
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
const f = g(t.string(), t.string());
|
|
127
|
+
function ot(e) {
|
|
128
|
+
return g(
|
|
129
|
+
p.transform(m(e)),
|
|
130
|
+
p.transform(m(e))
|
|
125
131
|
);
|
|
126
132
|
}
|
|
127
|
-
function
|
|
133
|
+
function d(e, n) {
|
|
128
134
|
return t.object({
|
|
129
135
|
title: t.string(),
|
|
130
136
|
description: t.string(),
|
|
131
137
|
longDescription: e.optional(),
|
|
138
|
+
changelog: e.optional(),
|
|
132
139
|
logo: n.optional(),
|
|
133
140
|
url: t.string().url().optional(),
|
|
134
141
|
docs: t.string().url().optional(),
|
|
@@ -141,152 +148,154 @@ function p(e, n) {
|
|
|
141
148
|
})
|
|
142
149
|
});
|
|
143
150
|
}
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
),
|
|
151
|
+
const k = d(
|
|
152
|
+
A,
|
|
153
|
+
P
|
|
154
|
+
), rt = d(
|
|
148
155
|
t.string(),
|
|
149
156
|
o
|
|
150
|
-
), x =
|
|
157
|
+
), x = d(
|
|
151
158
|
t.string(),
|
|
152
159
|
h
|
|
153
|
-
),
|
|
154
|
-
components:
|
|
155
|
-
meta:
|
|
160
|
+
), st = t.object({
|
|
161
|
+
components: f,
|
|
162
|
+
meta: k
|
|
156
163
|
});
|
|
157
|
-
function
|
|
164
|
+
function b(e, n) {
|
|
158
165
|
return t.object({
|
|
159
166
|
id: a,
|
|
160
167
|
components: e,
|
|
161
168
|
meta: n
|
|
162
169
|
});
|
|
163
170
|
}
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
), w =
|
|
171
|
+
const ct = b(
|
|
172
|
+
f,
|
|
173
|
+
k
|
|
174
|
+
), w = g(i, i), U = d(C, p), M = b(
|
|
168
175
|
w,
|
|
169
176
|
U
|
|
170
|
-
),
|
|
177
|
+
), z = t.string().regex(/[0-9a-fA-F]/).toUpperCase().length(64), S = t.object({
|
|
171
178
|
name: t.string(),
|
|
172
179
|
size: t.number().int(),
|
|
173
|
-
sha256:
|
|
174
|
-
}),
|
|
180
|
+
sha256: z
|
|
181
|
+
}), at = t.object({
|
|
175
182
|
schema: t.literal("v2"),
|
|
176
183
|
description: M,
|
|
177
|
-
files: t.array(
|
|
178
|
-
}),
|
|
184
|
+
files: t.array(S)
|
|
185
|
+
}), lt = "manifest.json", D = t.object({
|
|
179
186
|
type: t.literal("dev-v1"),
|
|
180
187
|
folder: t.string(),
|
|
181
188
|
mtime: t.string().optional()
|
|
182
|
-
}),
|
|
189
|
+
}), E = t.object({
|
|
183
190
|
type: t.literal("dev-v2"),
|
|
184
191
|
folder: t.string(),
|
|
185
192
|
mtime: t.string().optional()
|
|
186
|
-
}),
|
|
193
|
+
}), V = t.object({
|
|
187
194
|
type: t.literal("from-registry-v1"),
|
|
188
195
|
registryUrl: t.string(),
|
|
189
196
|
id: a
|
|
190
|
-
}),
|
|
197
|
+
}), W = t.object({
|
|
191
198
|
type: t.literal("from-registry-v2"),
|
|
192
199
|
registryUrl: t.string(),
|
|
193
200
|
id: a
|
|
194
|
-
}),
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
]),
|
|
201
|
+
}), F = t.discriminatedUnion("type", [
|
|
202
|
+
D,
|
|
203
|
+
E,
|
|
204
|
+
V,
|
|
205
|
+
W
|
|
206
|
+
]), I = t.object({
|
|
200
207
|
type: t.literal("local-dev"),
|
|
201
208
|
path: t.string()
|
|
202
|
-
}),
|
|
209
|
+
}), L = t.object({
|
|
203
210
|
type: t.literal("remote-v1"),
|
|
204
211
|
url: t.string().url()
|
|
205
|
-
}),
|
|
212
|
+
}), T = t.object({
|
|
206
213
|
type: t.literal("remote-v2"),
|
|
207
214
|
url: t.string().url()
|
|
208
215
|
}), Z = t.discriminatedUnion("type", [
|
|
216
|
+
L,
|
|
209
217
|
T,
|
|
210
|
-
I
|
|
211
|
-
|
|
212
|
-
]), B = t.object({
|
|
218
|
+
I
|
|
219
|
+
]), v = t.object({
|
|
213
220
|
id: t.string(),
|
|
214
221
|
title: t.string().optional(),
|
|
215
222
|
spec: Z
|
|
216
|
-
}),
|
|
223
|
+
}), dt = t.array(v), O = t.object({
|
|
217
224
|
registryId: t.string(),
|
|
218
225
|
id: a,
|
|
219
226
|
meta: x,
|
|
220
|
-
spec:
|
|
221
|
-
otherVersions: t.array(
|
|
222
|
-
}), _ =
|
|
227
|
+
spec: F,
|
|
228
|
+
otherVersions: t.array(u)
|
|
229
|
+
}), _ = v.extend({
|
|
223
230
|
status: t.union([t.literal("online"), t.literal("offline")])
|
|
224
|
-
}),
|
|
231
|
+
}), pt = t.object({
|
|
225
232
|
registries: t.array(_),
|
|
226
233
|
blockPacks: t.array(O)
|
|
227
|
-
}),
|
|
234
|
+
}), gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
228
235
|
__proto__: null
|
|
229
236
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
230
237
|
export {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
238
|
+
g as BlockComponents,
|
|
239
|
+
ot as BlockComponentsAbsoluteUrl,
|
|
240
|
+
f as BlockComponentsDescriptionRaw,
|
|
234
241
|
w as BlockComponentsManifest,
|
|
235
|
-
|
|
242
|
+
st as BlockPackDescriptionFromPackageJsonRaw,
|
|
236
243
|
M as BlockPackDescriptionManifest,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
244
|
+
ct as BlockPackDescriptionRaw,
|
|
245
|
+
D as BlockPackDevV1,
|
|
246
|
+
E as BlockPackDevV2,
|
|
247
|
+
V as BlockPackFromRegistryV1,
|
|
248
|
+
W as BlockPackFromRegistryV2,
|
|
242
249
|
a as BlockPackId,
|
|
243
250
|
et as BlockPackIdNoVersion,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
251
|
+
pt as BlockPackListing,
|
|
252
|
+
at as BlockPackManifest,
|
|
253
|
+
lt as BlockPackManifestFile,
|
|
254
|
+
d as BlockPackMeta,
|
|
255
|
+
k as BlockPackMetaDescriptionRaw,
|
|
256
|
+
rt as BlockPackMetaEmbeddedBase64,
|
|
250
257
|
x as BlockPackMetaEmbeddedBytes,
|
|
251
258
|
U as BlockPackMetaManifest,
|
|
252
259
|
O as BlockPackOverview,
|
|
253
|
-
|
|
260
|
+
F as BlockPackSpec,
|
|
254
261
|
Q as ContentAbsoluteBinaryLocal,
|
|
255
262
|
K as ContentAbsoluteBinaryRemote,
|
|
256
263
|
c as ContentAbsoluteFile,
|
|
257
|
-
|
|
264
|
+
$ as ContentAbsoluteFolder,
|
|
258
265
|
Y as ContentAbsoluteTextLocal,
|
|
259
266
|
X as ContentAbsoluteTextRemote,
|
|
260
267
|
l as ContentAbsoluteUrl,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
268
|
+
N as ContentAny,
|
|
269
|
+
B as ContentAnyBinaryLocal,
|
|
270
|
+
J as ContentAnyLocal,
|
|
264
271
|
H as ContentAnyRemote,
|
|
265
272
|
j as ContentAnyTextLocal,
|
|
266
273
|
o as ContentExplicitBase64,
|
|
267
274
|
h as ContentExplicitBytes,
|
|
268
|
-
|
|
275
|
+
G as ContentExplicitOrRelative,
|
|
269
276
|
r as ContentExplicitString,
|
|
270
277
|
i as ContentRelative,
|
|
271
|
-
|
|
278
|
+
p as ContentRelativeBinary,
|
|
272
279
|
C as ContentRelativeText,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
b as CreateBlockPackDescriptionSchema,
|
|
281
|
+
P as DescriptionContentBinary,
|
|
282
|
+
A as DescriptionContentText,
|
|
283
|
+
I as LocalDevFolder,
|
|
284
|
+
S as ManifestFileInfo,
|
|
285
|
+
gt as PFrameInternal,
|
|
286
|
+
v as RegistryEntry,
|
|
287
|
+
dt as RegistryList,
|
|
281
288
|
Z as RegistrySpec,
|
|
282
289
|
_ as RegistryStatus,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
290
|
+
L as RemoteRegistryV1Spec,
|
|
291
|
+
T as RemoteRegistryV2Spec,
|
|
292
|
+
u as SemVer,
|
|
293
|
+
z as Sha256Schema,
|
|
287
294
|
R as Workflow,
|
|
288
|
-
|
|
295
|
+
y as WorkflowV1,
|
|
289
296
|
tt as addPrefixToRelative,
|
|
290
|
-
|
|
297
|
+
nt as blockPackIdEquals,
|
|
298
|
+
it as blockPackIdNoVersionEquals,
|
|
299
|
+
m as mapRemoteToAbsolute
|
|
291
300
|
};
|
|
292
301
|
//# sourceMappingURL=index.mjs.map
|