@milaboratories/pl-model-middle-layer 1.20.0 → 1.22.0
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_components.cjs +19 -26
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +46 -428
- package/dist/block_meta/block_components.d.ts.map +1 -1
- package/dist/block_meta/block_components.js +19 -23
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +5 -3
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +277 -789
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_description.js +5 -3
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +10 -1
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +700 -1278
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.js +11 -2
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +92 -174
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/content_types.cjs +25 -77
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +67 -383
- package/dist/block_meta/content_types.d.ts.map +1 -1
- package/dist/block_meta/content_types.js +26 -64
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.d.ts +3 -3
- package/dist/block_registry/block_pack_spec.d.ts +8 -8
- package/dist/block_registry/overview.d.ts +200 -200
- package/dist/block_registry/registry_spec.d.ts +20 -20
- package/dist/index.cjs +1 -18
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +36 -2
- package/dist/pframe/internal_api/api_factory.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +40 -3
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +5 -5
- package/dist/pframe/internal_api/pframe.d.ts +21 -3
- package/dist/pframe/internal_api/pframe.d.ts.map +1 -1
- package/dist/pframe/internal_api/table.d.ts +51 -1
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/block_meta/block_components.ts +67 -42
- package/src/block_meta/block_description.ts +18 -3
- package/src/block_meta/block_manifest.ts +14 -3
- package/src/block_meta/block_meta.ts +40 -6
- package/src/block_meta/content_types.ts +149 -207
- package/src/pframe/internal_api/api_factory.ts +44 -0
- package/src/pframe/internal_api/api_read.ts +48 -1
- package/src/pframe/internal_api/pframe.ts +23 -2
- package/src/pframe/internal_api/table.ts +54 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content_types.js","names":[],"sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n//
|
|
1
|
+
{"version":3,"file":"content_types.js","names":[],"sources":["../../src/block_meta/content_types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n//\n// Canonical content types. TypeScript is the source of truth. The zod\n// schemas below are boundary validators pegged to these types via\n// `satisfies`; they exist only to parse external data (`package.json`,\n// registry manifests, registry overview files).\n//\n\n/** Inlined plain string (e.g. a short text snippet or markdown body). */\nexport type ContentExplicitString = {\n type: \"explicit-string\";\n content: string;\n};\n\n/** Inlined binary blob carried as base64 (e.g. a serialized logo image). */\nexport type ContentExplicitBase64 = {\n type: \"explicit-base64\";\n /** MIME type used to interpret `content`. */\n mimeType: string;\n /** Base64-encoded binary payload. */\n content: string;\n};\n\n/** Inlined binary blob carried as raw bytes. Wire form only; not used in JSON. */\nexport type ContentExplicitBytes = {\n type: \"explicit-bytes\";\n /** MIME type used to interpret `content`. */\n mimeType: string;\n content: Uint8Array;\n};\n\n/** Reference to a file by path relative to the carrying structure. */\nexport type ContentRelative = {\n type: \"relative\";\n path: string;\n};\n\n/** Reference to a file at an absolute local path. */\nexport type ContentAbsoluteFile = {\n type: \"absolute-file\";\n file: string;\n};\n\n/**\n * Reference to a folder at an absolute local path. Used for UI bundles\n * delivered as folders; the desktop \"add block\" dialog reads such folders on\n * demand instead of pulling every UI bundle eagerly.\n */\nexport type ContentAbsoluteFolder = {\n type: \"absolute-folder\";\n folder: string;\n};\n\n/** Reference to a file by remote URL (e.g. served from the registry). */\nexport type ContentAbsoluteUrl = {\n type: \"absolute-url\";\n url: string;\n};\n\n/** Canonical union of every content carrier shape used across the platform. */\nexport type Content =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentExplicitBytes\n | ContentRelative\n | ContentAbsoluteFile\n | ContentAbsoluteFolder\n | ContentAbsoluteUrl;\n\n//\n// Slot-specific content unions. Each names a set of carriers allowed in a\n// particular stage of the pipeline (boundary input, manifest, resolved).\n//\n\n/** Inlined or relative-path content (text/binary inlined, or relative path). */\nexport type ContentExplicitOrRelative =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentRelative;\n\n/** Any locally-resolvable content (inlined, relative path, or absolute file). */\nexport type ContentAnyLocal =\n | ContentExplicitString\n | ContentExplicitBase64\n | ContentRelative\n | ContentAbsoluteFile;\n\n/** Text content available locally (inlined, relative path, or absolute file). */\nexport type ContentAnyTextLocal = ContentExplicitString | ContentRelative | ContentAbsoluteFile;\n\n/** Binary content available locally (inlined base64, relative path, or absolute file). */\nexport type ContentAnyBinaryLocal = ContentExplicitBase64 | ContentRelative | ContentAbsoluteFile;\n\n/** Binary content fully resolved (inlined base64 or absolute file). */\nexport type ContentAbsoluteBinaryLocal = ContentExplicitBase64 | ContentAbsoluteFile;\n\n/** Text content fully resolved (inlined string or absolute file). */\nexport type ContentAbsoluteTextLocal = ContentExplicitString | ContentAbsoluteFile;\n\n/** Binary content in manifest form (inlined base64 or path relative to the manifest). */\nexport type ContentRelativeBinary = ContentExplicitBase64 | ContentRelative;\n\n/** Text content in manifest form (inlined string or path relative to the manifest). */\nexport type ContentRelativeText = ContentExplicitString | ContentRelative;\n\n//\n// Zod schemas — boundary validators only. The TS types above are the source\n// of truth; each schema is pegged via `satisfies z.ZodType<T>`. Only the\n// schemas referenced by sibling boundary files (`block_meta.ts`,\n// `block_manifest.ts`) are exported.\n//\n\nconst absPathRegex = new RegExp(`^(/|[A-Z]:\\\\\\\\)`);\n\nconst contentExplicitStringSchema = z\n .object({\n type: z.literal(\"explicit-string\"),\n content: z.string(),\n })\n .strict() satisfies z.ZodType<ContentExplicitString>;\n\nexport const ContentExplicitBase64 = z\n .object({\n type: z.literal(\"explicit-base64\"),\n mimeType: z.string().regex(/\\w+\\/[-+.\\w]+/),\n content: z.string().base64(),\n })\n .strict() satisfies z.ZodType<ContentExplicitBase64>;\n\nexport const ContentExplicitBytes = z\n .object({\n type: z.literal(\"explicit-bytes\"),\n mimeType: z.string().regex(/\\w+\\/[-+.\\w]+/),\n content: z.instanceof(Uint8Array),\n })\n .strict() satisfies z.ZodType<ContentExplicitBytes>;\n\nexport const ContentRelative = z\n .object({\n type: z.literal(\"relative\"),\n path: z.string(),\n })\n .strict() satisfies z.ZodType<ContentRelative>;\n\nconst contentAbsoluteFileSchema = z\n .object({\n type: z.literal(\"absolute-file\"),\n file: z.string().regex(absPathRegex, \"path to file must be absolute\"),\n })\n .strict() satisfies z.ZodType<ContentAbsoluteFile>;\n\nexport const ContentRelativeBinary = z.discriminatedUnion(\"type\", [\n ContentExplicitBase64,\n ContentRelative,\n]) satisfies z.ZodType<ContentRelativeBinary>;\n\nexport const ContentRelativeText = z.discriminatedUnion(\"type\", [\n contentExplicitStringSchema,\n ContentRelative,\n]) satisfies z.ZodType<ContentRelativeText>;\n\n//\n// Boundary normalizing transforms — parse the loose forms authors write in\n// `package.json`. Bare strings with the `file:` prefix become a\n// `ContentRelative`; bare strings without the prefix become a\n// `ContentExplicitString` (text only).\n//\n\nexport const DescriptionContentBinary = z.union([\n z\n .string()\n .startsWith(\"file:\")\n .transform<ContentRelativeBinary>((value) => ({\n type: \"relative\",\n path: value.slice(5),\n })),\n z.discriminatedUnion(\"type\", [ContentExplicitBase64, ContentRelative, contentAbsoluteFileSchema]),\n]) satisfies z.ZodType<ContentAnyBinaryLocal, z.ZodTypeDef, any>;\n\nexport const DescriptionContentText = z.union([\n z.string().transform<ContentRelativeText>((value) => {\n if (value.startsWith(\"file:\")) return { type: \"relative\", path: value.slice(5) };\n return { type: \"explicit-string\", content: value };\n }),\n z.discriminatedUnion(\"type\", [\n contentExplicitStringSchema,\n ContentRelative,\n contentAbsoluteFileSchema,\n ]),\n]) satisfies z.ZodType<ContentAnyTextLocal, z.ZodTypeDef, any>;\n"],"mappings":";;AAiHA,MAAM,eAAe,IAAI,OAAO,kBAAkB;AAElD,MAAM,8BAA8B,EACjC,OAAO;CACN,MAAM,EAAE,QAAQ,kBAAkB;CAClC,SAAS,EAAE,QAAQ;CACpB,CAAC,CACD,QAAQ;AAEX,MAAa,wBAAwB,EAClC,OAAO;CACN,MAAM,EAAE,QAAQ,kBAAkB;CAClC,UAAU,EAAE,QAAQ,CAAC,MAAM,gBAAgB;CAC3C,SAAS,EAAE,QAAQ,CAAC,QAAQ;CAC7B,CAAC,CACD,QAAQ;AAEX,MAAa,uBAAuB,EACjC,OAAO;CACN,MAAM,EAAE,QAAQ,iBAAiB;CACjC,UAAU,EAAE,QAAQ,CAAC,MAAM,gBAAgB;CAC3C,SAAS,EAAE,WAAW,WAAW;CAClC,CAAC,CACD,QAAQ;AAEX,MAAa,kBAAkB,EAC5B,OAAO;CACN,MAAM,EAAE,QAAQ,WAAW;CAC3B,MAAM,EAAE,QAAQ;CACjB,CAAC,CACD,QAAQ;AAEX,MAAM,4BAA4B,EAC/B,OAAO;CACN,MAAM,EAAE,QAAQ,gBAAgB;CAChC,MAAM,EAAE,QAAQ,CAAC,MAAM,cAAc,gCAAgC;CACtE,CAAC,CACD,QAAQ;AAEX,MAAa,wBAAwB,EAAE,mBAAmB,QAAQ,CAChE,uBACA,gBACD,CAAC;AAEF,MAAa,sBAAsB,EAAE,mBAAmB,QAAQ,CAC9D,6BACA,gBACD,CAAC;AASF,MAAa,2BAA2B,EAAE,MAAM,CAC9C,EACG,QAAQ,CACR,WAAW,QAAQ,CACnB,WAAkC,WAAW;CAC5C,MAAM;CACN,MAAM,MAAM,MAAM,EAAE;CACrB,EAAE,EACL,EAAE,mBAAmB,QAAQ;CAAC;CAAuB;CAAiB;CAA0B,CAAC,CAClG,CAAC;AAEF,MAAa,yBAAyB,EAAE,MAAM,CAC5C,EAAE,QAAQ,CAAC,WAAgC,UAAU;AACnD,KAAI,MAAM,WAAW,QAAQ,CAAE,QAAO;EAAE,MAAM;EAAY,MAAM,MAAM,MAAM,EAAE;EAAE;AAChF,QAAO;EAAE,MAAM;EAAmB,SAAS;EAAO;EAClD,EACF,EAAE,mBAAmB,QAAQ;CAC3B;CACA;CACA;CACD,CAAC,CACH,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContentType, ContextType } from "./common.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Content, ContentAbsoluteBinaryLocal, ContentAbsoluteFile, ContentAbsoluteFolder, ContentAbsoluteTextLocal, ContentAbsoluteUrl, ContentAnyBinaryLocal, ContentAnyLocal, ContentAnyTextLocal, ContentExplicitBase64, ContentExplicitBytes, ContentExplicitOrRelative, ContentExplicitString, ContentRelative, ContentRelativeBinary, ContentRelativeText, DescriptionContentBinary, DescriptionContentText } from "./content_types.js";
|
|
3
3
|
import { SemVer } from "./semver.js";
|
|
4
4
|
import { addPrefixToRelative, mapRemoteToAbsolute } from "./content_conversion.js";
|
|
5
5
|
import { BlockPackId, BlockPackIdNoVersion, blockPackIdEquals, blockPackIdNoVersionEquals, blockPackIdNoVersionToString, blockPackIdToString } from "./block_id.js";
|
|
6
|
-
import { BlockComponents,
|
|
6
|
+
import { BlockComponents, BlockComponentsDescriptionRaw, Workflow, WorkflowSchemaV1, WorkflowV1 } from "./block_components.js";
|
|
7
7
|
import { BlockPackMeta, BlockPackMetaDescriptionRaw, BlockPackMetaEmbeddedBase64, BlockPackMetaEmbeddedBytes, BlockPlatform } from "./block_meta.js";
|
|
8
|
-
import { BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionRaw, CreateBlockPackDescriptionSchema, FeatureFlags, overrideDescriptionVersion } from "./block_description.js";
|
|
8
|
+
import { BlockPackDescription, BlockPackDescriptionFromPackageJsonRaw, BlockPackDescriptionRaw, CreateBlockPackDescriptionSchema, FeatureFlags, overrideDescriptionVersion } from "./block_description.js";
|
|
9
9
|
import { BlockComponentsManifest, BlockPackDescriptionManifest, BlockPackManifest, BlockPackManifestFile, BlockPackMetaManifest, ManifestFileInfo, Sha256Schema, overrideManifestVersion } from "./block_manifest.js";
|
|
@@ -56,20 +56,20 @@ declare const BlockPackFromRegistryV1: z.ZodObject<{
|
|
|
56
56
|
}>;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
58
|
type: "from-registry-v1";
|
|
59
|
-
registryUrl: string;
|
|
60
59
|
id: {
|
|
61
60
|
organization: string;
|
|
62
61
|
name: string;
|
|
63
62
|
version: string;
|
|
64
63
|
};
|
|
64
|
+
registryUrl: string;
|
|
65
65
|
}, {
|
|
66
66
|
type: "from-registry-v1";
|
|
67
|
-
registryUrl: string;
|
|
68
67
|
id: {
|
|
69
68
|
organization: string;
|
|
70
69
|
name: string;
|
|
71
70
|
version: string;
|
|
72
71
|
};
|
|
72
|
+
registryUrl: string;
|
|
73
73
|
}>;
|
|
74
74
|
/** @deprecated don't use */
|
|
75
75
|
type BlockPackFromRegistryV1 = z.infer<typeof BlockPackFromRegistryV1>;
|
|
@@ -94,21 +94,21 @@ declare const BlockPackFromRegistryV2: z.ZodObject<{
|
|
|
94
94
|
channel: z.ZodOptional<z.ZodString>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
type: "from-registry-v2";
|
|
97
|
-
registryUrl: string;
|
|
98
97
|
id: {
|
|
99
98
|
organization: string;
|
|
100
99
|
name: string;
|
|
101
100
|
version: string;
|
|
102
101
|
};
|
|
102
|
+
registryUrl: string;
|
|
103
103
|
channel?: string | undefined;
|
|
104
104
|
}, {
|
|
105
105
|
type: "from-registry-v2";
|
|
106
|
-
registryUrl: string;
|
|
107
106
|
id: {
|
|
108
107
|
organization: string;
|
|
109
108
|
name: string;
|
|
110
109
|
version: string;
|
|
111
110
|
};
|
|
111
|
+
registryUrl: string;
|
|
112
112
|
channel?: string | undefined;
|
|
113
113
|
}>;
|
|
114
114
|
type BlockPackFromRegistryV2 = z.infer<typeof BlockPackFromRegistryV2>;
|
|
@@ -155,20 +155,20 @@ declare const BlockPackSpec: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
155
155
|
}>;
|
|
156
156
|
}, "strip", z.ZodTypeAny, {
|
|
157
157
|
type: "from-registry-v1";
|
|
158
|
-
registryUrl: string;
|
|
159
158
|
id: {
|
|
160
159
|
organization: string;
|
|
161
160
|
name: string;
|
|
162
161
|
version: string;
|
|
163
162
|
};
|
|
163
|
+
registryUrl: string;
|
|
164
164
|
}, {
|
|
165
165
|
type: "from-registry-v1";
|
|
166
|
-
registryUrl: string;
|
|
167
166
|
id: {
|
|
168
167
|
organization: string;
|
|
169
168
|
name: string;
|
|
170
169
|
version: string;
|
|
171
170
|
};
|
|
171
|
+
registryUrl: string;
|
|
172
172
|
}>, z.ZodObject<{
|
|
173
173
|
type: z.ZodLiteral<"from-registry-v2">;
|
|
174
174
|
registryUrl: z.ZodString;
|
|
@@ -188,21 +188,21 @@ declare const BlockPackSpec: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
188
188
|
channel: z.ZodOptional<z.ZodString>;
|
|
189
189
|
}, "strip", z.ZodTypeAny, {
|
|
190
190
|
type: "from-registry-v2";
|
|
191
|
-
registryUrl: string;
|
|
192
191
|
id: {
|
|
193
192
|
organization: string;
|
|
194
193
|
name: string;
|
|
195
194
|
version: string;
|
|
196
195
|
};
|
|
196
|
+
registryUrl: string;
|
|
197
197
|
channel?: string | undefined;
|
|
198
198
|
}, {
|
|
199
199
|
type: "from-registry-v2";
|
|
200
|
-
registryUrl: string;
|
|
201
200
|
id: {
|
|
202
201
|
organization: string;
|
|
203
202
|
name: string;
|
|
204
203
|
version: string;
|
|
205
204
|
};
|
|
205
|
+
registryUrl: string;
|
|
206
206
|
channel?: string | undefined;
|
|
207
207
|
}>]>;
|
|
208
208
|
type BlockPackSpec = z.infer<typeof BlockPackSpec>;
|