@milaboratories/pl-model-common 1.21.0 → 1.21.1
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/bmodel/block_config.cjs +1 -1
- package/dist/bmodel/block_config.cjs.map +1 -1
- package/dist/bmodel/block_config.d.ts +1 -1
- package/dist/bmodel/block_config.d.ts.map +1 -1
- package/dist/bmodel/block_config.js +1 -1
- package/dist/bmodel/block_config.js.map +1 -1
- package/dist/bmodel/code.cjs +11 -0
- package/dist/bmodel/code.cjs.map +1 -0
- package/dist/bmodel/code.d.ts +11 -3
- package/dist/bmodel/code.d.ts.map +1 -1
- package/dist/bmodel/code.js +9 -0
- package/dist/bmodel/code.js.map +1 -0
- package/dist/bmodel/container.d.ts +1 -1
- package/dist/bmodel/container.d.ts.map +1 -1
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/bmodel/block_config.ts +2 -2
- package/src/bmodel/code.ts +7 -4
- package/src/bmodel/container.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_config.cjs","sources":["../../src/bmodel/block_config.ts"],"sourcesContent":["// TODO BroadActiveHandleDescriptor must be removed\n\nimport type { BlockCodeFeatureFlags } from '../flags';\nimport type { BlockCodeWithInfo, Code } from './code';\nimport type { BlockRenderingMode } from './types';\n\n/**\n * BroadActiveHandleDescriptor = TypedConfigOrConfigLambda,\n * NarrowActiveHandleDescriptor = ConfigRenderLambda\n */\nexport type BlockConfigV3Generic<\n Args = unknown,\n UiState = unknown,\n BroadActiveHandleDescriptor = unknown,\n NarrowActiveHandleDescriptor extends BroadActiveHandleDescriptor = BroadActiveHandleDescriptor,\n Outputs extends Record<string, BroadActiveHandleDescriptor> = Record<string, BroadActiveHandleDescriptor>,\n> = {\n /** SDK version used by the block */\n readonly sdkVersion: string;\n\n /** Main rendering mode for the block */\n readonly renderingMode: BlockRenderingMode;\n\n /** Initial value for the args when block is added to the project */\n readonly initialArgs: Args;\n\n /** Initial value for the args when block is added to the project */\n readonly initialUiState: UiState;\n\n /**\n * Config to determine whether the block can be executed with current\n * arguments.\n *\n * Optional to support earlier SDK version configs.\n * */\n readonly inputsValid: BroadActiveHandleDescriptor;\n\n /** Configuration to derive list of section for the left overview panel */\n readonly sections: BroadActiveHandleDescriptor;\n\n /** Lambda to derive block title */\n readonly title?: NarrowActiveHandleDescriptor;\n\n /**\n * Lambda returning list of upstream blocks this block enriches with its exports,\n * influences dependency graph construction\n * */\n readonly enrichmentTargets?: NarrowActiveHandleDescriptor;\n\n /** Configuration for the output cells */\n readonly outputs: Outputs;\n\n /** Config code bundle */\n readonly code?: Code;\n\n /** Feature flags for the block Model and UI code. */\n readonly featureFlags?: BlockCodeFeatureFlags;\n};\n\nexport type BlockConfigGeneric = BlockConfigV3Generic;\n\nexport function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo
|
|
1
|
+
{"version":3,"file":"block_config.cjs","sources":["../../src/bmodel/block_config.ts"],"sourcesContent":["// TODO BroadActiveHandleDescriptor must be removed\n\nimport type { BlockCodeFeatureFlags } from '../flags';\nimport type { BlockCodeWithInfo, Code } from './code';\nimport type { BlockRenderingMode } from './types';\n\n/**\n * BroadActiveHandleDescriptor = TypedConfigOrConfigLambda,\n * NarrowActiveHandleDescriptor = ConfigRenderLambda\n */\nexport type BlockConfigV3Generic<\n Args = unknown,\n UiState = unknown,\n BroadActiveHandleDescriptor = unknown,\n NarrowActiveHandleDescriptor extends BroadActiveHandleDescriptor = BroadActiveHandleDescriptor,\n Outputs extends Record<string, BroadActiveHandleDescriptor> = Record<string, BroadActiveHandleDescriptor>,\n> = {\n /** SDK version used by the block */\n readonly sdkVersion: string;\n\n /** Main rendering mode for the block */\n readonly renderingMode: BlockRenderingMode;\n\n /** Initial value for the args when block is added to the project */\n readonly initialArgs: Args;\n\n /** Initial value for the args when block is added to the project */\n readonly initialUiState: UiState;\n\n /**\n * Config to determine whether the block can be executed with current\n * arguments.\n *\n * Optional to support earlier SDK version configs.\n * */\n readonly inputsValid: BroadActiveHandleDescriptor;\n\n /** Configuration to derive list of section for the left overview panel */\n readonly sections: BroadActiveHandleDescriptor;\n\n /** Lambda to derive block title */\n readonly title?: NarrowActiveHandleDescriptor;\n\n /**\n * Lambda returning list of upstream blocks this block enriches with its exports,\n * influences dependency graph construction\n * */\n readonly enrichmentTargets?: NarrowActiveHandleDescriptor;\n\n /** Configuration for the output cells */\n readonly outputs: Outputs;\n\n /** Config code bundle */\n readonly code?: Code;\n\n /** Feature flags for the block Model and UI code. */\n readonly featureFlags?: BlockCodeFeatureFlags;\n};\n\nexport type BlockConfigGeneric = BlockConfigV3Generic;\n\nexport function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo {\n if (cfg.code === undefined) throw new Error('No code bundle');\n return {\n code: cfg.code,\n sdkVersion: cfg.sdkVersion,\n featureFlags: cfg.featureFlags,\n };\n}\n"],"names":[],"mappings":";;AAAA;AA6DM,SAAU,mBAAmB,CAAC,GAAyB,EAAA;AAC3D,IAAA,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;IAC7D,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,YAAY,EAAE,GAAG,CAAC,YAAY;KAC/B;AACH;;;;"}
|
|
@@ -38,5 +38,5 @@ export type BlockConfigV3Generic<Args = unknown, UiState = unknown, BroadActiveH
|
|
|
38
38
|
readonly featureFlags?: BlockCodeFeatureFlags;
|
|
39
39
|
};
|
|
40
40
|
export type BlockConfigGeneric = BlockConfigV3Generic;
|
|
41
|
-
export declare function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo
|
|
41
|
+
export declare function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithIn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AAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAErB,qDAAqD;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,qBAAqB,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,oBAAoB,GAAG,iBAAiB,CAOhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_config.js","sources":["../../src/bmodel/block_config.ts"],"sourcesContent":["// TODO BroadActiveHandleDescriptor must be removed\n\nimport type { BlockCodeFeatureFlags } from '../flags';\nimport type { BlockCodeWithInfo, Code } from './code';\nimport type { BlockRenderingMode } from './types';\n\n/**\n * BroadActiveHandleDescriptor = TypedConfigOrConfigLambda,\n * NarrowActiveHandleDescriptor = ConfigRenderLambda\n */\nexport type BlockConfigV3Generic<\n Args = unknown,\n UiState = unknown,\n BroadActiveHandleDescriptor = unknown,\n NarrowActiveHandleDescriptor extends BroadActiveHandleDescriptor = BroadActiveHandleDescriptor,\n Outputs extends Record<string, BroadActiveHandleDescriptor> = Record<string, BroadActiveHandleDescriptor>,\n> = {\n /** SDK version used by the block */\n readonly sdkVersion: string;\n\n /** Main rendering mode for the block */\n readonly renderingMode: BlockRenderingMode;\n\n /** Initial value for the args when block is added to the project */\n readonly initialArgs: Args;\n\n /** Initial value for the args when block is added to the project */\n readonly initialUiState: UiState;\n\n /**\n * Config to determine whether the block can be executed with current\n * arguments.\n *\n * Optional to support earlier SDK version configs.\n * */\n readonly inputsValid: BroadActiveHandleDescriptor;\n\n /** Configuration to derive list of section for the left overview panel */\n readonly sections: BroadActiveHandleDescriptor;\n\n /** Lambda to derive block title */\n readonly title?: NarrowActiveHandleDescriptor;\n\n /**\n * Lambda returning list of upstream blocks this block enriches with its exports,\n * influences dependency graph construction\n * */\n readonly enrichmentTargets?: NarrowActiveHandleDescriptor;\n\n /** Configuration for the output cells */\n readonly outputs: Outputs;\n\n /** Config code bundle */\n readonly code?: Code;\n\n /** Feature flags for the block Model and UI code. */\n readonly featureFlags?: BlockCodeFeatureFlags;\n};\n\nexport type BlockConfigGeneric = BlockConfigV3Generic;\n\nexport function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo
|
|
1
|
+
{"version":3,"file":"block_config.js","sources":["../../src/bmodel/block_config.ts"],"sourcesContent":["// TODO BroadActiveHandleDescriptor must be removed\n\nimport type { BlockCodeFeatureFlags } from '../flags';\nimport type { BlockCodeWithInfo, Code } from './code';\nimport type { BlockRenderingMode } from './types';\n\n/**\n * BroadActiveHandleDescriptor = TypedConfigOrConfigLambda,\n * NarrowActiveHandleDescriptor = ConfigRenderLambda\n */\nexport type BlockConfigV3Generic<\n Args = unknown,\n UiState = unknown,\n BroadActiveHandleDescriptor = unknown,\n NarrowActiveHandleDescriptor extends BroadActiveHandleDescriptor = BroadActiveHandleDescriptor,\n Outputs extends Record<string, BroadActiveHandleDescriptor> = Record<string, BroadActiveHandleDescriptor>,\n> = {\n /** SDK version used by the block */\n readonly sdkVersion: string;\n\n /** Main rendering mode for the block */\n readonly renderingMode: BlockRenderingMode;\n\n /** Initial value for the args when block is added to the project */\n readonly initialArgs: Args;\n\n /** Initial value for the args when block is added to the project */\n readonly initialUiState: UiState;\n\n /**\n * Config to determine whether the block can be executed with current\n * arguments.\n *\n * Optional to support earlier SDK version configs.\n * */\n readonly inputsValid: BroadActiveHandleDescriptor;\n\n /** Configuration to derive list of section for the left overview panel */\n readonly sections: BroadActiveHandleDescriptor;\n\n /** Lambda to derive block title */\n readonly title?: NarrowActiveHandleDescriptor;\n\n /**\n * Lambda returning list of upstream blocks this block enriches with its exports,\n * influences dependency graph construction\n * */\n readonly enrichmentTargets?: NarrowActiveHandleDescriptor;\n\n /** Configuration for the output cells */\n readonly outputs: Outputs;\n\n /** Config code bundle */\n readonly code?: Code;\n\n /** Feature flags for the block Model and UI code. */\n readonly featureFlags?: BlockCodeFeatureFlags;\n};\n\nexport type BlockConfigGeneric = BlockConfigV3Generic;\n\nexport function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo {\n if (cfg.code === undefined) throw new Error('No code bundle');\n return {\n code: cfg.code,\n sdkVersion: cfg.sdkVersion,\n featureFlags: cfg.featureFlags,\n };\n}\n"],"names":[],"mappings":"AAAA;AA6DM,SAAU,mBAAmB,CAAC,GAAyB,EAAA;AAC3D,IAAA,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC;IAC7D,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,YAAY,EAAE,GAAG,CAAC,YAAY;KAC/B;AACH;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.cjs","sources":["../../src/bmodel/code.ts"],"sourcesContent":["import type { BlockCodeFeatureFlags } from '../flags';\nimport { z } from 'zod';\n\nexport const Code = z.object({\n type: z.literal('plain'),\n content: z.string(),\n});\n\nexport type Code = z.infer<typeof Code>;\n\nexport type BlockCodeWithInfo = {\n readonly code: Code;\n readonly sdkVersion: string;\n readonly featureFlags: BlockCodeFeatureFlags | undefined;\n};\n"],"names":["z"],"mappings":";;;;AAGO,MAAM,IAAI,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC3B,IAAA,IAAI,EAAEA,KAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AACxB,IAAA,OAAO,EAAEA,KAAC,CAAC,MAAM,EAAE;AACpB,CAAA;;;;"}
|
package/dist/bmodel/code.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { BlockCodeFeatureFlags } from '../flags';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const Code: z.ZodObject<{
|
|
4
|
+
type: z.ZodLiteral<"plain">;
|
|
5
|
+
content: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
type: "plain";
|
|
4
8
|
content: string;
|
|
5
|
-
}
|
|
9
|
+
}, {
|
|
10
|
+
type: "plain";
|
|
11
|
+
content: string;
|
|
12
|
+
}>;
|
|
13
|
+
export type Code = z.infer<typeof Code>;
|
|
6
14
|
export type BlockCodeWithInfo = {
|
|
7
15
|
readonly code: Code;
|
|
8
16
|
readonly sdkVersion: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/bmodel/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../src/bmodel/code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,IAAI;;;;;;;;;EAGf,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAExC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.js","sources":["../../src/bmodel/code.ts"],"sourcesContent":["import type { BlockCodeFeatureFlags } from '../flags';\nimport { z } from 'zod';\n\nexport const Code = z.object({\n type: z.literal('plain'),\n content: z.string(),\n});\n\nexport type Code = z.infer<typeof Code>;\n\nexport type BlockCodeWithInfo = {\n readonly code: Code;\n readonly sdkVersion: string;\n readonly featureFlags: BlockCodeFeatureFlags | undefined;\n};\n"],"names":[],"mappings":";;AAGO,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC;AAC3B,IAAA,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;AACxB,IAAA,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;AACpB,CAAA;;;;"}
|
|
@@ -5,7 +5,7 @@ import type { BlockRenderingMode } from './types';
|
|
|
5
5
|
export type BlockConfigContainer = {
|
|
6
6
|
/** Actual config */
|
|
7
7
|
readonly v3: Omit<BlockConfigV3Generic, 'code'>;
|
|
8
|
-
/** Config code bundle */
|
|
8
|
+
/** Config code bundle. Actually is required, but we keep it optional for backward compatibility */
|
|
9
9
|
readonly code?: Code;
|
|
10
10
|
/**
|
|
11
11
|
* For backward compatibility
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/bmodel/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG;IACjC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAEhD,
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../src/bmodel/container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,8EAA8E;AAC9E,MAAM,MAAM,oBAAoB,GAAG;IACjC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAEhD,mGAAmG;IACnG,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;IAMrB;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAE5C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C,CAAC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var block_config = require('./bmodel/block_config.cjs');
|
|
4
|
+
var code = require('./bmodel/code.cjs');
|
|
4
5
|
var normalization = require('./bmodel/normalization.cjs');
|
|
5
6
|
var urls = require('./drivers/urls.cjs');
|
|
6
7
|
var blob = require('./drivers/blob.cjs');
|
|
@@ -34,6 +35,7 @@ var httpAuth = require('./httpAuth.cjs');
|
|
|
34
35
|
|
|
35
36
|
|
|
36
37
|
exports.extractCodeWithInfo = block_config.extractCodeWithInfo;
|
|
38
|
+
exports.Code = code.Code;
|
|
37
39
|
exports.extractConfigGeneric = normalization.extractConfigGeneric;
|
|
38
40
|
exports.isBlockUIURL = urls.isBlockUIURL;
|
|
39
41
|
exports.isFolderURL = urls.isFolderURL;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { extractCodeWithInfo } from './bmodel/block_config.js';
|
|
2
|
+
export { Code } from './bmodel/code.js';
|
|
2
3
|
export { extractConfigGeneric } from './bmodel/normalization.js';
|
|
3
4
|
export { isBlockUIURL, isFolderURL } from './drivers/urls.js';
|
|
4
5
|
export { RangeBytes, newRangeBytesOpt, validateRangeBytes } from './drivers/blob.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-common",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Platforma SDK Model",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"eslint": "^9.25.1",
|
|
26
26
|
"typescript": "~5.6.3",
|
|
27
27
|
"vitest": "^2.1.9",
|
|
28
|
-
"@platforma-sdk/eslint-config": "1.1.0",
|
|
29
28
|
"@milaboratories/ts-builder": "1.0.5",
|
|
30
29
|
"@milaboratories/ts-configs": "1.0.6",
|
|
31
|
-
"@milaboratories/build-configs": "1.0.8"
|
|
30
|
+
"@milaboratories/build-configs": "1.0.8",
|
|
31
|
+
"@platforma-sdk/eslint-config": "1.1.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"type-check": "ts-builder types --target node",
|
|
@@ -59,8 +59,8 @@ export type BlockConfigV3Generic<
|
|
|
59
59
|
|
|
60
60
|
export type BlockConfigGeneric = BlockConfigV3Generic;
|
|
61
61
|
|
|
62
|
-
export function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo
|
|
63
|
-
if (cfg.code === undefined)
|
|
62
|
+
export function extractCodeWithInfo(cfg: BlockConfigV3Generic): BlockCodeWithInfo {
|
|
63
|
+
if (cfg.code === undefined) throw new Error('No code bundle');
|
|
64
64
|
return {
|
|
65
65
|
code: cfg.code,
|
|
66
66
|
sdkVersion: cfg.sdkVersion,
|
package/src/bmodel/code.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { BlockCodeFeatureFlags } from '../flags';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
type: 'plain'
|
|
5
|
-
content: string
|
|
6
|
-
};
|
|
4
|
+
export const Code = z.object({
|
|
5
|
+
type: z.literal('plain'),
|
|
6
|
+
content: z.string(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Code = z.infer<typeof Code>;
|
|
7
10
|
|
|
8
11
|
export type BlockCodeWithInfo = {
|
|
9
12
|
readonly code: Code;
|
package/src/bmodel/container.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type BlockConfigContainer = {
|
|
|
7
7
|
/** Actual config */
|
|
8
8
|
readonly v3: Omit<BlockConfigV3Generic, 'code'>;
|
|
9
9
|
|
|
10
|
-
/** Config code bundle */
|
|
10
|
+
/** Config code bundle. Actually is required, but we keep it optional for backward compatibility */
|
|
11
11
|
readonly code?: Code;
|
|
12
12
|
|
|
13
13
|
//
|