@milaboratories/pl-model-middle-layer 1.11.3 → 1.11.5
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/author_marker.d.ts +1 -1
- package/dist/block_meta/block_components.cjs +4 -4
- package/dist/block_meta/block_components.cjs.map +1 -1
- package/dist/block_meta/block_components.d.ts +1 -1
- package/dist/block_meta/block_components.js +4 -4
- package/dist/block_meta/block_components.js.map +1 -1
- package/dist/block_meta/block_description.cjs +6 -3
- package/dist/block_meta/block_description.cjs.map +1 -1
- package/dist/block_meta/block_description.d.ts +4 -4
- package/dist/block_meta/block_description.d.ts.map +1 -1
- package/dist/block_meta/block_description.js +6 -3
- package/dist/block_meta/block_description.js.map +1 -1
- package/dist/block_meta/block_id.cjs.map +1 -1
- package/dist/block_meta/block_id.d.ts +1 -1
- package/dist/block_meta/block_id.js.map +1 -1
- package/dist/block_meta/block_manifest.cjs +6 -4
- package/dist/block_meta/block_manifest.cjs.map +1 -1
- package/dist/block_meta/block_manifest.d.ts +2 -2
- package/dist/block_meta/block_manifest.d.ts.map +1 -1
- package/dist/block_meta/block_manifest.js +6 -4
- package/dist/block_meta/block_manifest.js.map +1 -1
- package/dist/block_meta/block_meta.cjs +10 -8
- package/dist/block_meta/block_meta.cjs.map +1 -1
- package/dist/block_meta/block_meta.d.ts +1 -1
- package/dist/block_meta/block_meta.d.ts.map +1 -1
- package/dist/block_meta/block_meta.js +10 -8
- package/dist/block_meta/block_meta.js.map +1 -1
- package/dist/block_meta/common.d.ts +2 -2
- package/dist/block_meta/content_conversion.cjs +6 -6
- package/dist/block_meta/content_conversion.cjs.map +1 -1
- package/dist/block_meta/content_conversion.d.ts +1 -1
- package/dist/block_meta/content_conversion.js +6 -6
- package/dist/block_meta/content_conversion.js.map +1 -1
- package/dist/block_meta/content_types.cjs +35 -35
- package/dist/block_meta/content_types.cjs.map +1 -1
- package/dist/block_meta/content_types.d.ts +1 -1
- package/dist/block_meta/content_types.js +35 -35
- package/dist/block_meta/content_types.js.map +1 -1
- package/dist/block_meta/index.d.ts +9 -9
- package/dist/block_meta/semver.cjs +1 -1
- package/dist/block_meta/semver.cjs.map +1 -1
- package/dist/block_meta/semver.d.ts +1 -1
- package/dist/block_meta/semver.js +1 -1
- package/dist/block_meta/semver.js.map +1 -1
- package/dist/block_registry/block_pack_spec.cjs +5 -5
- package/dist/block_registry/block_pack_spec.cjs.map +1 -1
- package/dist/block_registry/block_pack_spec.d.ts +1 -1
- package/dist/block_registry/block_pack_spec.js +5 -5
- package/dist/block_registry/block_pack_spec.js.map +1 -1
- package/dist/block_registry/index.d.ts +3 -3
- package/dist/block_registry/overview.cjs +18 -10
- package/dist/block_registry/overview.cjs.map +1 -1
- package/dist/block_registry/overview.d.ts +1 -1
- package/dist/block_registry/overview.d.ts.map +1 -1
- package/dist/block_registry/overview.js +18 -10
- package/dist/block_registry/overview.js.map +1 -1
- package/dist/block_registry/registry_spec.cjs +4 -4
- package/dist/block_registry/registry_spec.cjs.map +1 -1
- package/dist/block_registry/registry_spec.d.ts +1 -1
- package/dist/block_registry/registry_spec.js +4 -4
- package/dist/block_registry/registry_spec.js.map +1 -1
- package/dist/block_settings.cjs.map +1 -1
- package/dist/block_settings.d.ts +1 -1
- package/dist/block_settings.js.map +1 -1
- package/dist/block_state.d.ts +4 -4
- package/dist/block_state.d.ts.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/json.cjs +4 -4
- package/dist/json.cjs.map +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/json.d.ts.map +1 -1
- package/dist/json.js +4 -4
- package/dist/json.js.map +1 -1
- package/dist/pframe/index.d.ts +1 -1
- package/dist/pframe/internal_api/api_factory.cjs +2 -2
- package/dist/pframe/internal_api/api_factory.cjs.map +1 -1
- package/dist/pframe/internal_api/api_factory.d.ts +3 -3
- package/dist/pframe/internal_api/api_factory.js +2 -2
- package/dist/pframe/internal_api/api_factory.js.map +1 -1
- package/dist/pframe/internal_api/api_read.d.ts +6 -6
- package/dist/pframe/internal_api/api_read.d.ts.map +1 -1
- package/dist/pframe/internal_api/api_wasm.d.ts +4 -4
- package/dist/pframe/internal_api/api_wasm.d.ts.map +1 -1
- package/dist/pframe/internal_api/common.d.ts +3 -3
- package/dist/pframe/internal_api/common.d.ts.map +1 -1
- package/dist/pframe/internal_api/create_table.d.ts +9 -9
- package/dist/pframe/internal_api/create_table.d.ts.map +1 -1
- package/dist/pframe/internal_api/delete_column.d.ts +1 -1
- package/dist/pframe/internal_api/find_columns.d.ts +2 -2
- package/dist/pframe/internal_api/http_helpers.cjs +4 -4
- package/dist/pframe/internal_api/http_helpers.cjs.map +1 -1
- package/dist/pframe/internal_api/http_helpers.d.ts +43 -43
- package/dist/pframe/internal_api/http_helpers.d.ts.map +1 -1
- package/dist/pframe/internal_api/http_helpers.js +4 -4
- package/dist/pframe/internal_api/http_helpers.js.map +1 -1
- package/dist/pframe/internal_api/index.d.ts +11 -11
- package/dist/pframe/internal_api/pframe.d.ts +4 -4
- package/dist/pframe/internal_api/table.d.ts +2 -2
- package/dist/pframe/internal_api/table.d.ts.map +1 -1
- package/dist/project_list.d.ts +1 -1
- package/dist/project_overview.d.ts +7 -7
- package/dist/project_overview.d.ts.map +1 -1
- package/dist/update_info.d.ts +2 -2
- package/package.json +18 -17
- package/src/author_marker.ts +1 -1
- package/src/block_meta/block_components.ts +7 -7
- package/src/block_meta/block_description.ts +17 -14
- package/src/block_meta/block_id.ts +3 -3
- package/src/block_meta/block_manifest.ts +16 -14
- package/src/block_meta/block_meta.ts +17 -21
- package/src/block_meta/common.ts +2 -2
- package/src/block_meta/content_conversion.ts +7 -7
- package/src/block_meta/content_types.ts +35 -35
- package/src/block_meta/index.ts +9 -9
- package/src/block_meta/semver.ts +2 -2
- package/src/block_registry/block_pack_spec.ts +7 -7
- package/src/block_registry/index.ts +3 -3
- package/src/block_registry/overview.ts +34 -26
- package/src/block_registry/registry_spec.ts +5 -5
- package/src/block_settings.ts +1 -1
- package/src/block_state.ts +10 -4
- package/src/index.ts +11 -11
- package/src/json.ts +17 -11
- package/src/pframe/index.ts +1 -1
- package/src/pframe/internal_api/api_factory.ts +6 -6
- package/src/pframe/internal_api/api_read.ts +20 -14
- package/src/pframe/internal_api/api_wasm.ts +9 -20
- package/src/pframe/internal_api/common.ts +5 -7
- package/src/pframe/internal_api/create_table.ts +14 -9
- package/src/pframe/internal_api/delete_column.ts +1 -1
- package/src/pframe/internal_api/find_columns.ts +2 -2
- package/src/pframe/internal_api/http_helpers.ts +52 -52
- package/src/pframe/internal_api/index.ts +11 -11
- package/src/pframe/internal_api/pframe.ts +5 -5
- package/src/pframe/internal_api/table.ts +4 -8
- package/src/project_list.ts +1 -1
- package/src/project_overview.ts +14 -7
- package/src/update_info.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PFrameFactoryAPIV4 } from
|
|
2
|
-
import type { PFrameReadAPIV11 } from
|
|
3
|
-
import type { Logger } from
|
|
4
|
-
import type { PFrameId } from
|
|
1
|
+
import type { PFrameFactoryAPIV4 } from "./api_factory";
|
|
2
|
+
import type { PFrameReadAPIV11 } from "./api_read";
|
|
3
|
+
import type { Logger } from "./common";
|
|
4
|
+
import type { PFrameId } from "./common";
|
|
5
5
|
export interface PFrameV13 extends PFrameFactoryAPIV4, PFrameReadAPIV11 {
|
|
6
6
|
}
|
|
7
7
|
export type PFrameOptionsV2 = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableShape, PTableSorting, PTableVector, TableRange } from
|
|
2
|
-
import type { PTableId } from
|
|
1
|
+
import type { PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableShape, PTableSorting, PTableVector, TableRange } from "@milaboratories/pl-model-common";
|
|
2
|
+
import type { PTableId } from "./common";
|
|
3
3
|
/**
|
|
4
4
|
* Table view returned as a result of create table operation.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;KAKK;AACL,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,YAAY,CAAC,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../../src/pframe/internal_api/table.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACX,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;KAKK;AACL,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C;;;;;;;;SAQK;IACL,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAE9B,6EAA6E;IAC7E,gBAAgB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAExD;;;OAGG;IACH,YAAY,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE9D;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE/D;;;;;;;;SAQK;IACL,OAAO,CACL,aAAa,EAAE,MAAM,EAAE,EACvB,GAAG,CAAC,EAAE;QACJ,KAAK,CAAC,EAAE,UAAU,CAAC;QACnB,MAAM,CAAC,EAAE,WAAW,CAAC;KACtB,GACA,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAE3B,wDAAwD;IACxD,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,QAAQ,CAAC;IAEnE,uDAAuD;IACvD,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC;IAE5D,2CAA2C;IAC3C,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
package/dist/project_list.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ProjectMeta } from
|
|
2
|
-
import type { BlockPackSpec } from
|
|
3
|
-
import type { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker, StringifiedJson } from
|
|
4
|
-
import type { StorageDebugView } from
|
|
5
|
-
import type { UpdateSuggestions } from
|
|
6
|
-
import type { BlockSettings } from
|
|
1
|
+
import type { ProjectMeta } from "./project";
|
|
2
|
+
import type { BlockPackSpec } from "./block_registry/block_pack_spec";
|
|
3
|
+
import type { BlockCodeFeatureFlags, BlockRenderingMode, BlockSection, NavigationState, AuthorMarker, StringifiedJson } from "@milaboratories/pl-model-common";
|
|
4
|
+
import type { StorageDebugView } from "@platforma-sdk/model";
|
|
5
|
+
import type { UpdateSuggestions } from "./update_info";
|
|
6
|
+
import type { BlockSettings } from "./block_settings";
|
|
7
7
|
/** Generalized block status, to be used in block item "styling". */
|
|
8
|
-
export type BlockCalculationStatus =
|
|
8
|
+
export type BlockCalculationStatus = "NotCalculated" | "Running" | "Done" | "Limbo";
|
|
9
9
|
/** Overview of the whole project state, required to render a left panel. */
|
|
10
10
|
export type ProjectOverview = {
|
|
11
11
|
/** Metadata, like project label associated with the project */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"project_overview.d.ts","sourceRoot":"","sources":["../src/project_overview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,eAAe,GAAG;IAC5B,+DAA+D;IAC/D,IAAI,EAAE,WAAW,CAAC;IAElB,0BAA0B;IAC1B,OAAO,EAAE,IAAI,CAAC;IAEd,mCAAmC;IACnC,YAAY,EAAE,IAAI,CAAC;IAEnB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B,0CAA0C;IAC1C,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B,CAAC;AAEF,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kFAAkF;IAClF,iBAAiB,EAAE,MAAM,CAAC;IAE1B,eAAe;IACf,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;OAKG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1B;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE7B;;;OAGG;IACH,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAE3B,2BAA2B;IAC3B,aAAa,EAAE,kBAAkB,CAAC;IAElC;;;OAGG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;;OAGG;IACH,YAAY,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2CAA2C;IAC3C,iBAAiB,EAAE,sBAAsB,CAAC;IAE1C;;;OAGG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IAErC;;;OAGG;IACH,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;OAGG;IACH,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAEhD;;;;;OAKG;IACH,yBAAyB,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/C,mEAAmE;IACnE,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C;;;OAGG;IACH,gBAAgB,EAAE,aAAa,GAAG,SAAS,CAAC;IAE5C,6BAA6B;IAC7B,QAAQ,EAAE,aAAa,CAAC;IAExB,8BAA8B;IAC9B,iBAAiB,EAAE,iBAAiB,CAAC;IAErC,4CAA4C;IAC5C,eAAe,EAAE,eAAe,CAAC;IAEjC;;;;OAIG;IACH,gBAAgB,EAAE,eAAe,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC;CACjE,CAAC"}
|
package/dist/update_info.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { BlockPackSpec } from
|
|
1
|
+
import type { BlockPackSpec } from "./block_registry";
|
|
2
2
|
/** Communicates possible block update option */
|
|
3
3
|
export type UpdateSuggestion<V = BlockPackSpec> = {
|
|
4
|
-
type:
|
|
4
|
+
type: "major" | "minor" | "patch";
|
|
5
5
|
update: V;
|
|
6
6
|
};
|
|
7
7
|
/** Communicates possible block update options */
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-middle-layer",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.5",
|
|
4
4
|
"description": "Common model between middle layer and non-block UI code",
|
|
5
|
+
"files": [
|
|
6
|
+
"./dist/**/*",
|
|
7
|
+
"./src/**/*"
|
|
8
|
+
],
|
|
5
9
|
"type": "module",
|
|
6
|
-
"types": "./dist/index.d.ts",
|
|
7
10
|
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
8
12
|
"exports": {
|
|
9
13
|
".": {
|
|
10
14
|
"types": "./dist/index.d.ts",
|
|
@@ -12,31 +16,28 @@
|
|
|
12
16
|
"require": "./dist/index.cjs"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
|
-
"files": [
|
|
16
|
-
"./dist/**/*",
|
|
17
|
-
"./src/**/*"
|
|
18
|
-
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"remeda": "^2.28.0",
|
|
21
|
-
"zod": "~3.23.8",
|
|
22
21
|
"utility-types": "^3.11.0",
|
|
23
|
-
"
|
|
24
|
-
"@
|
|
22
|
+
"zod": "~3.23.8",
|
|
23
|
+
"@milaboratories/pl-model-common": "1.24.4",
|
|
24
|
+
"@platforma-sdk/model": "1.53.13"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"eslint": "^9.25.1",
|
|
28
|
-
"typescript": "~5.6.3",
|
|
29
27
|
"@types/node": "~24.5.2",
|
|
30
|
-
"
|
|
31
|
-
"@milaboratories/ts-builder": "1.2.
|
|
32
|
-
"@milaboratories/build-configs": "1.4.
|
|
28
|
+
"typescript": "~5.6.3",
|
|
29
|
+
"@milaboratories/ts-builder": "1.2.5",
|
|
30
|
+
"@milaboratories/build-configs": "1.4.1",
|
|
33
31
|
"@milaboratories/ts-configs": "1.2.0"
|
|
34
32
|
},
|
|
35
33
|
"scripts": {
|
|
36
|
-
"type-check": "ts-builder types --target node",
|
|
37
34
|
"build": "ts-builder build --target node",
|
|
38
35
|
"watch": "ts-builder build --target node --watch",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
36
|
+
"check": "ts-builder check --target node",
|
|
37
|
+
"formatter:check": "ts-builder formatter --check",
|
|
38
|
+
"linter:check": "ts-builder linter --check",
|
|
39
|
+
"types:check": "ts-builder type-check --target node",
|
|
40
|
+
"do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz",
|
|
41
|
+
"fmt": "ts-builder format"
|
|
41
42
|
}
|
|
42
43
|
}
|
package/src/author_marker.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { ContentRelativeBinary } from
|
|
3
|
-
import { mapRemoteToAbsolute } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ContentRelativeBinary } from "./content_types";
|
|
3
|
+
import { mapRemoteToAbsolute } from "./content_conversion";
|
|
4
4
|
|
|
5
5
|
export function WorkflowV1<const Content extends z.ZodTypeAny>(contentType: Content) {
|
|
6
6
|
return z.object({
|
|
7
|
-
type: z.literal(
|
|
8
|
-
main: contentType.describe(
|
|
7
|
+
type: z.literal("workflow-v1"),
|
|
8
|
+
main: contentType.describe("Main workflow"),
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -14,12 +14,12 @@ export function Workflow<const Content extends z.ZodTypeAny>(contentType: Conten
|
|
|
14
14
|
// string is converted to v1 workflow
|
|
15
15
|
contentType
|
|
16
16
|
.transform((value: z.infer<typeof contentType>) => ({
|
|
17
|
-
type:
|
|
17
|
+
type: "workflow-v1" as const,
|
|
18
18
|
main: value,
|
|
19
19
|
}))
|
|
20
20
|
.pipe(WorkflowV1(contentType)),
|
|
21
21
|
// structured objects are decoded as union with type descriptor
|
|
22
|
-
z.discriminatedUnion(
|
|
22
|
+
z.discriminatedUnion("type", [WorkflowV1(contentType)]),
|
|
23
23
|
]);
|
|
24
24
|
}
|
|
25
25
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ZodTypeAny } from
|
|
2
|
-
import { z } from
|
|
3
|
-
import { BlockComponentsDescriptionRaw } from
|
|
4
|
-
import { BlockPackMetaDescriptionRaw } from
|
|
5
|
-
import { BlockPackId } from
|
|
6
|
-
import * as R from
|
|
7
|
-
import type { BlockCodeKnownFeatureFlags } from
|
|
1
|
+
import type { ZodTypeAny } from "zod";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { BlockComponentsDescriptionRaw } from "./block_components";
|
|
4
|
+
import { BlockPackMetaDescriptionRaw } from "./block_meta";
|
|
5
|
+
import { BlockPackId } from "./block_id";
|
|
6
|
+
import * as R from "remeda";
|
|
7
|
+
import type { BlockCodeKnownFeatureFlags } from "@milaboratories/pl-model-common";
|
|
8
8
|
|
|
9
9
|
/** Description, as appears in root block package.json file,
|
|
10
10
|
* `file:` references are parsed into relative content of corresponding type, depending on the context,
|
|
@@ -14,19 +14,22 @@ export const BlockPackDescriptionFromPackageJsonRaw = z.object({
|
|
|
14
14
|
meta: BlockPackMetaDescriptionRaw,
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
export const FeatureFlags = z
|
|
17
|
+
export const FeatureFlags = z
|
|
18
|
+
.record(z.string(), z.union([z.boolean(), z.number()]))
|
|
18
19
|
.transform((flags) => flags as BlockCodeKnownFeatureFlags);
|
|
19
20
|
|
|
20
21
|
export function CreateBlockPackDescriptionSchema<
|
|
21
22
|
Components extends ZodTypeAny,
|
|
22
23
|
Meta extends ZodTypeAny,
|
|
23
24
|
>(components: Components, meta: Meta) {
|
|
24
|
-
return z
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
return z
|
|
26
|
+
.object({
|
|
27
|
+
id: BlockPackId,
|
|
28
|
+
components,
|
|
29
|
+
meta,
|
|
30
|
+
featureFlags: FeatureFlags.optional(),
|
|
31
|
+
})
|
|
32
|
+
.passthrough();
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
export const BlockPackDescriptionRaw = CreateBlockPackDescriptionSchema(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { SemVer } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SemVer } from "./semver";
|
|
3
3
|
|
|
4
4
|
/** Global identifier of the block */
|
|
5
5
|
export const BlockPackId = z
|
|
@@ -23,7 +23,7 @@ export function blockPackIdToString(bp: BlockPackId | undefined): string | undef
|
|
|
23
23
|
|
|
24
24
|
export function blockPackIdNoVersionToString(bp: BlockPackIdNoVersion): string;
|
|
25
25
|
export function blockPackIdNoVersionToString(
|
|
26
|
-
bp: BlockPackIdNoVersion | undefined
|
|
26
|
+
bp: BlockPackIdNoVersion | undefined,
|
|
27
27
|
): string | undefined;
|
|
28
28
|
export function blockPackIdNoVersionToString(
|
|
29
29
|
bp: BlockPackIdNoVersion | undefined,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { BlockComponents } from
|
|
3
|
-
import { ContentRelative, ContentRelativeBinary, ContentRelativeText } from
|
|
4
|
-
import { CreateBlockPackDescriptionSchema } from
|
|
5
|
-
import { BlockPackMeta } from
|
|
6
|
-
import * as R from
|
|
7
|
-
import type { BlockPackId } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BlockComponents } from "./block_components";
|
|
3
|
+
import { ContentRelative, ContentRelativeBinary, ContentRelativeText } from "./content_types";
|
|
4
|
+
import { CreateBlockPackDescriptionSchema } from "./block_description";
|
|
5
|
+
import { BlockPackMeta } from "./block_meta";
|
|
6
|
+
import * as R from "remeda";
|
|
7
|
+
import type { BlockPackId } from "./block_id";
|
|
8
8
|
|
|
9
9
|
export const BlockComponentsManifest = BlockComponents(ContentRelative, ContentRelative);
|
|
10
10
|
export type BlockComponentsManifest = z.infer<typeof BlockComponentsManifest>;
|
|
@@ -32,15 +32,17 @@ export const ManifestFileInfo = z.object({
|
|
|
32
32
|
});
|
|
33
33
|
export type ManifestFileInfo = z.infer<typeof ManifestFileInfo>;
|
|
34
34
|
|
|
35
|
-
export const BlockPackManifest = z
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
export const BlockPackManifest = z
|
|
36
|
+
.object({
|
|
37
|
+
schema: z.literal("v2"),
|
|
38
|
+
description: BlockPackDescriptionManifest,
|
|
39
|
+
timestamp: z.number().optional(),
|
|
40
|
+
files: z.array(ManifestFileInfo),
|
|
41
|
+
})
|
|
42
|
+
.passthrough();
|
|
41
43
|
export type BlockPackManifest = z.infer<typeof BlockPackManifest>;
|
|
42
44
|
|
|
43
|
-
export const BlockPackManifestFile =
|
|
45
|
+
export const BlockPackManifestFile = "manifest.json";
|
|
44
46
|
|
|
45
47
|
export function overrideManifestVersion<T extends { description: { id: BlockPackId } }>(
|
|
46
48
|
manifest: T,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
import {
|
|
3
3
|
ContentExplicitBase64,
|
|
4
4
|
ContentExplicitBytes,
|
|
5
5
|
DescriptionContentBinary,
|
|
6
6
|
DescriptionContentText,
|
|
7
|
-
} from
|
|
7
|
+
} from "./content_types";
|
|
8
8
|
|
|
9
9
|
export const BlockPlatform = z.enum([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
"windows-x64",
|
|
11
|
+
"windows-aarch64",
|
|
12
|
+
"macosx-x64",
|
|
13
|
+
"macosx-aarch64",
|
|
14
|
+
"linux-x64",
|
|
15
|
+
"linux-aarch64",
|
|
16
16
|
]);
|
|
17
17
|
export type BlockPlatform = z.infer<typeof BlockPlatform>;
|
|
18
18
|
|
|
@@ -30,11 +30,13 @@ export function BlockPackMeta<
|
|
|
30
30
|
docs: z.string().url().optional(),
|
|
31
31
|
support: z.union([z.string().url(), z.string().email()]).optional(),
|
|
32
32
|
tags: z.array(z.string()).optional(),
|
|
33
|
-
organization: z
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
organization: z
|
|
34
|
+
.object({
|
|
35
|
+
name: z.string(),
|
|
36
|
+
url: z.string().url(),
|
|
37
|
+
logo: binary.optional(),
|
|
38
|
+
})
|
|
39
|
+
.passthrough(),
|
|
38
40
|
/**
|
|
39
41
|
* The order of blocks on the "marketplace" (higher values push block higher to the top of the list).
|
|
40
42
|
* `undefined` value or absent field is treated exactly the same as number `0`.
|
|
@@ -62,14 +64,8 @@ export const BlockPackMetaDescriptionRaw = BlockPackMeta(
|
|
|
62
64
|
);
|
|
63
65
|
export type BlockPackMetaDescriptionRaw = z.infer<typeof BlockPackMetaDescriptionRaw>;
|
|
64
66
|
|
|
65
|
-
export const BlockPackMetaEmbeddedBase64 = BlockPackMeta(
|
|
66
|
-
z.string(),
|
|
67
|
-
ContentExplicitBase64,
|
|
68
|
-
);
|
|
67
|
+
export const BlockPackMetaEmbeddedBase64 = BlockPackMeta(z.string(), ContentExplicitBase64);
|
|
69
68
|
export type BlockPackMetaEmbeddedBase64 = z.infer<typeof BlockPackMetaEmbeddedBase64>;
|
|
70
69
|
|
|
71
|
-
export const BlockPackMetaEmbeddedBytes = BlockPackMeta(
|
|
72
|
-
z.string(),
|
|
73
|
-
ContentExplicitBytes,
|
|
74
|
-
);
|
|
70
|
+
export const BlockPackMetaEmbeddedBytes = BlockPackMeta(z.string(), ContentExplicitBytes);
|
|
75
71
|
export type BlockPackMetaEmbeddedBytes = z.infer<typeof BlockPackMetaEmbeddedBytes>;
|
package/src/block_meta/common.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type ContextType =
|
|
2
|
-
export type ContentType =
|
|
1
|
+
export type ContextType = "local" | "remote";
|
|
2
|
+
export type ContentType = "text" | "binary";
|
|
@@ -3,15 +3,15 @@ import type {
|
|
|
3
3
|
ContentAnyLocal,
|
|
4
4
|
ContentExplicitOrRelative,
|
|
5
5
|
ContentRelative,
|
|
6
|
-
} from
|
|
6
|
+
} from "./content_types";
|
|
7
7
|
|
|
8
8
|
export function mapRemoteToAbsolute(
|
|
9
9
|
rootUrl: string,
|
|
10
10
|
): <T extends ContentAnyLocal>(value: T) => Exclude<T, ContentRelative> | ContentAbsoluteUrl {
|
|
11
|
-
const rootWithSlash = rootUrl.endsWith(
|
|
11
|
+
const rootWithSlash = rootUrl.endsWith("/") ? rootUrl : `${rootUrl}/`;
|
|
12
12
|
return <T extends ContentAnyLocal>(value: T) =>
|
|
13
|
-
value.type ===
|
|
14
|
-
? { type:
|
|
13
|
+
value.type === "relative"
|
|
14
|
+
? { type: "absolute-url", url: rootWithSlash + value.path }
|
|
15
15
|
: (value as Exclude<T, ContentRelative>);
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -25,9 +25,9 @@ export function mapRemoteToAbsolute(
|
|
|
25
25
|
export function addPrefixToRelative(
|
|
26
26
|
prefix: string,
|
|
27
27
|
): <T extends ContentExplicitOrRelative>(value: T) => T {
|
|
28
|
-
const prefixWithSlash = prefix.endsWith(
|
|
28
|
+
const prefixWithSlash = prefix.endsWith("/") ? prefix : `${prefix}/`;
|
|
29
29
|
return <T extends ContentExplicitOrRelative>(value: T) =>
|
|
30
|
-
(value.type ===
|
|
31
|
-
? { type:
|
|
30
|
+
(value.type === "relative"
|
|
31
|
+
? { type: "relative", path: prefixWithSlash + value.path }
|
|
32
32
|
: value) as T;
|
|
33
33
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//
|
|
4
4
|
// Base content types
|
|
@@ -6,31 +6,31 @@ import { z } from 'zod';
|
|
|
6
6
|
|
|
7
7
|
export const ContentExplicitString = z
|
|
8
8
|
.object({
|
|
9
|
-
type: z.literal(
|
|
10
|
-
content: z.string().describe(
|
|
9
|
+
type: z.literal("explicit-string"),
|
|
10
|
+
content: z.string().describe("Actual string value"),
|
|
11
11
|
})
|
|
12
12
|
.strict();
|
|
13
13
|
export type ContentExplicitString = z.infer<typeof ContentExplicitString>;
|
|
14
14
|
|
|
15
15
|
export const ContentExplicitBase64 = z
|
|
16
16
|
.object({
|
|
17
|
-
type: z.literal(
|
|
17
|
+
type: z.literal("explicit-base64"),
|
|
18
18
|
mimeType: z
|
|
19
19
|
.string()
|
|
20
20
|
.regex(/\w+\/[-+.\w]+/)
|
|
21
|
-
.describe(
|
|
22
|
-
content: z.string().base64().describe(
|
|
21
|
+
.describe("MIME type to interpret content"),
|
|
22
|
+
content: z.string().base64().describe("Base64 encoded binary value"),
|
|
23
23
|
})
|
|
24
24
|
.strict();
|
|
25
25
|
export type ContentExplicitBase64 = z.infer<typeof ContentExplicitBase64>;
|
|
26
26
|
|
|
27
27
|
export const ContentRelative = z
|
|
28
28
|
.object({
|
|
29
|
-
type: z.literal(
|
|
29
|
+
type: z.literal("relative"),
|
|
30
30
|
path: z
|
|
31
31
|
.string()
|
|
32
32
|
.describe(
|
|
33
|
-
|
|
33
|
+
"Address of the file, in most cases relative to the file which this structure is a part of",
|
|
34
34
|
),
|
|
35
35
|
})
|
|
36
36
|
.strict();
|
|
@@ -40,19 +40,19 @@ const absPathRegex = new RegExp(`^(/|[A-Z]:\\\\)`);
|
|
|
40
40
|
|
|
41
41
|
export const ContentAbsoluteFile = z
|
|
42
42
|
.object({
|
|
43
|
-
type: z.literal(
|
|
43
|
+
type: z.literal("absolute-file"),
|
|
44
44
|
file: z
|
|
45
45
|
.string()
|
|
46
|
-
.regex(absPathRegex,
|
|
47
|
-
.describe(
|
|
46
|
+
.regex(absPathRegex, "path to file must be absolute")
|
|
47
|
+
.describe("Absolute address of the file in local file system"),
|
|
48
48
|
})
|
|
49
49
|
.strict();
|
|
50
50
|
export type ContentAbsoluteFile = z.infer<typeof ContentAbsoluteFile>;
|
|
51
51
|
|
|
52
52
|
export const ContentAbsoluteUrl = z
|
|
53
53
|
.object({
|
|
54
|
-
type: z.literal(
|
|
55
|
-
url: z.string().url().describe(
|
|
54
|
+
type: z.literal("absolute-url"),
|
|
55
|
+
url: z.string().url().describe("Global URL to reach the requested file"),
|
|
56
56
|
})
|
|
57
57
|
.strict();
|
|
58
58
|
export type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;
|
|
@@ -63,23 +63,23 @@ export type ContentAbsoluteUrl = z.infer<typeof ContentAbsoluteUrl>;
|
|
|
63
63
|
|
|
64
64
|
export const ContentExplicitBytes = z
|
|
65
65
|
.object({
|
|
66
|
-
type: z.literal(
|
|
66
|
+
type: z.literal("explicit-bytes"),
|
|
67
67
|
mimeType: z
|
|
68
68
|
.string()
|
|
69
69
|
.regex(/\w+\/[-+.\w]+/)
|
|
70
|
-
.describe(
|
|
71
|
-
content: z.instanceof(Uint8Array).describe(
|
|
70
|
+
.describe("MIME type to interpret content"),
|
|
71
|
+
content: z.instanceof(Uint8Array).describe("Raw content"),
|
|
72
72
|
})
|
|
73
73
|
.strict();
|
|
74
74
|
export type ContentExplicitBytes = z.infer<typeof ContentExplicitBytes>;
|
|
75
75
|
|
|
76
76
|
export const ContentAbsoluteFolder = z
|
|
77
77
|
.object({
|
|
78
|
-
type: z.literal(
|
|
78
|
+
type: z.literal("absolute-folder"),
|
|
79
79
|
folder: z
|
|
80
80
|
.string()
|
|
81
|
-
.regex(absPathRegex,
|
|
82
|
-
.describe(
|
|
81
|
+
.regex(absPathRegex, "path to folder must be absolute")
|
|
82
|
+
.describe("Absolute address of the folder in local file system"),
|
|
83
83
|
})
|
|
84
84
|
.strict();
|
|
85
85
|
export type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;
|
|
@@ -88,7 +88,7 @@ export type ContentAbsoluteFolder = z.infer<typeof ContentAbsoluteFolder>;
|
|
|
88
88
|
// Unions
|
|
89
89
|
//
|
|
90
90
|
|
|
91
|
-
export const ContentAny = z.discriminatedUnion(
|
|
91
|
+
export const ContentAny = z.discriminatedUnion("type", [
|
|
92
92
|
ContentExplicitString,
|
|
93
93
|
ContentExplicitBase64,
|
|
94
94
|
ContentRelative,
|
|
@@ -97,14 +97,14 @@ export const ContentAny = z.discriminatedUnion('type', [
|
|
|
97
97
|
]);
|
|
98
98
|
export type ContentAny = z.infer<typeof ContentAny>;
|
|
99
99
|
|
|
100
|
-
export const ContentExplicitOrRelative = z.discriminatedUnion(
|
|
100
|
+
export const ContentExplicitOrRelative = z.discriminatedUnion("type", [
|
|
101
101
|
ContentExplicitString,
|
|
102
102
|
ContentExplicitBase64,
|
|
103
103
|
ContentRelative,
|
|
104
104
|
]);
|
|
105
105
|
export type ContentExplicitOrRelative = z.infer<typeof ContentExplicitOrRelative>;
|
|
106
106
|
|
|
107
|
-
export const ContentAnyLocal = z.discriminatedUnion(
|
|
107
|
+
export const ContentAnyLocal = z.discriminatedUnion("type", [
|
|
108
108
|
ContentExplicitString,
|
|
109
109
|
ContentExplicitBase64,
|
|
110
110
|
ContentRelative,
|
|
@@ -112,7 +112,7 @@ export const ContentAnyLocal = z.discriminatedUnion('type', [
|
|
|
112
112
|
]);
|
|
113
113
|
export type ContentAnyLocal = z.infer<typeof ContentAnyLocal>;
|
|
114
114
|
|
|
115
|
-
export const ContentAnyRemote = z.discriminatedUnion(
|
|
115
|
+
export const ContentAnyRemote = z.discriminatedUnion("type", [
|
|
116
116
|
ContentExplicitString,
|
|
117
117
|
ContentExplicitBase64,
|
|
118
118
|
ContentRelative,
|
|
@@ -131,7 +131,7 @@ export type ContentAnyRemote = z.infer<typeof ContentAnyRemote>;
|
|
|
131
131
|
// ]);
|
|
132
132
|
// export type ContentAnyBinaryRemote = z.infer<typeof ContentAnyBinaryRemote>;
|
|
133
133
|
|
|
134
|
-
export const ContentAnyBinaryLocal = z.discriminatedUnion(
|
|
134
|
+
export const ContentAnyBinaryLocal = z.discriminatedUnion("type", [
|
|
135
135
|
ContentExplicitBase64,
|
|
136
136
|
ContentRelative,
|
|
137
137
|
ContentAbsoluteFile,
|
|
@@ -145,7 +145,7 @@ export type ContentAnyBinaryLocal = z.infer<typeof ContentAnyBinaryLocal>;
|
|
|
145
145
|
// ]);
|
|
146
146
|
// export type ContentAnyTextRemote = z.infer<typeof ContentAnyTextRemote>;
|
|
147
147
|
|
|
148
|
-
export const ContentAnyTextLocal = z.discriminatedUnion(
|
|
148
|
+
export const ContentAnyTextLocal = z.discriminatedUnion("type", [
|
|
149
149
|
ContentExplicitString,
|
|
150
150
|
ContentRelative,
|
|
151
151
|
ContentAbsoluteFile,
|
|
@@ -156,25 +156,25 @@ export type ContentAnyTextLocal = z.infer<typeof ContentAnyTextLocal>;
|
|
|
156
156
|
// Narrow absolute types
|
|
157
157
|
//
|
|
158
158
|
|
|
159
|
-
export const ContentAbsoluteBinaryRemote = z.discriminatedUnion(
|
|
159
|
+
export const ContentAbsoluteBinaryRemote = z.discriminatedUnion("type", [
|
|
160
160
|
ContentExplicitBase64,
|
|
161
161
|
ContentAbsoluteUrl,
|
|
162
162
|
]);
|
|
163
163
|
export type ContentAbsoluteBinaryRemote = z.infer<typeof ContentAbsoluteBinaryRemote>;
|
|
164
164
|
|
|
165
|
-
export const ContentAbsoluteBinaryLocal = z.discriminatedUnion(
|
|
165
|
+
export const ContentAbsoluteBinaryLocal = z.discriminatedUnion("type", [
|
|
166
166
|
ContentExplicitBase64,
|
|
167
167
|
ContentAbsoluteFile,
|
|
168
168
|
]);
|
|
169
169
|
export type ContentAbsoluteBinaryLocal = z.infer<typeof ContentAbsoluteBinaryLocal>;
|
|
170
170
|
|
|
171
|
-
export const ContentAbsoluteTextRemote = z.discriminatedUnion(
|
|
171
|
+
export const ContentAbsoluteTextRemote = z.discriminatedUnion("type", [
|
|
172
172
|
ContentExplicitString,
|
|
173
173
|
ContentAbsoluteUrl,
|
|
174
174
|
]);
|
|
175
175
|
export type ContentAbsoluteTextRemote = z.infer<typeof ContentAbsoluteTextRemote>;
|
|
176
176
|
|
|
177
|
-
export const ContentAbsoluteTextLocal = z.discriminatedUnion(
|
|
177
|
+
export const ContentAbsoluteTextLocal = z.discriminatedUnion("type", [
|
|
178
178
|
ContentExplicitString,
|
|
179
179
|
ContentAbsoluteFile,
|
|
180
180
|
]);
|
|
@@ -184,13 +184,13 @@ export type ContentAbsoluteTextLocal = z.infer<typeof ContentAbsoluteTextLocal>;
|
|
|
184
184
|
// Narrow relative types
|
|
185
185
|
//
|
|
186
186
|
|
|
187
|
-
export const ContentRelativeBinary = z.discriminatedUnion(
|
|
187
|
+
export const ContentRelativeBinary = z.discriminatedUnion("type", [
|
|
188
188
|
ContentExplicitBase64,
|
|
189
189
|
ContentRelative,
|
|
190
190
|
]);
|
|
191
191
|
export type ContentRelativeBinary = z.infer<typeof ContentRelativeBinary>;
|
|
192
192
|
|
|
193
|
-
export const ContentRelativeText = z.discriminatedUnion(
|
|
193
|
+
export const ContentRelativeText = z.discriminatedUnion("type", [
|
|
194
194
|
ContentExplicitString,
|
|
195
195
|
ContentRelative,
|
|
196
196
|
]);
|
|
@@ -233,16 +233,16 @@ export type ContentRelativeText = z.infer<typeof ContentRelativeText>;
|
|
|
233
233
|
export const DescriptionContentBinary = z.union([
|
|
234
234
|
z
|
|
235
235
|
.string()
|
|
236
|
-
.startsWith(
|
|
237
|
-
.transform<ContentRelativeBinary>((value) => ({ type:
|
|
236
|
+
.startsWith("file:")
|
|
237
|
+
.transform<ContentRelativeBinary>((value) => ({ type: "relative", path: value.slice(5) })),
|
|
238
238
|
ContentAnyBinaryLocal,
|
|
239
239
|
]);
|
|
240
240
|
export type DescriptionContentBinary = z.infer<typeof DescriptionContentBinary>;
|
|
241
241
|
|
|
242
242
|
export const DescriptionContentText = z.union([
|
|
243
243
|
z.string().transform<ContentRelativeText>((value) => {
|
|
244
|
-
if (value.startsWith(
|
|
245
|
-
else return { type:
|
|
244
|
+
if (value.startsWith("file:")) return { type: "relative", path: value.slice(5) };
|
|
245
|
+
else return { type: "explicit-string", content: value };
|
|
246
246
|
}),
|
|
247
247
|
ContentAnyTextLocal,
|
|
248
248
|
]);
|
package/src/block_meta/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./common";
|
|
2
|
+
export * from "./content_types";
|
|
3
|
+
export * from "./semver";
|
|
4
4
|
|
|
5
|
-
export * from
|
|
5
|
+
export * from "./content_conversion";
|
|
6
6
|
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
7
|
+
export * from "./block_id";
|
|
8
|
+
export * from "./block_components";
|
|
9
|
+
export * from "./block_meta";
|
|
10
|
+
export * from "./block_description";
|
|
11
|
+
export * from "./block_manifest";
|