@platforma-sdk/model 1.48.14 → 1.49.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/builder.js CHANGED
@@ -11,52 +11,52 @@ import { downgradeCfgOrLambda } from './bconfig/normalization.js';
11
11
  * to call {@link done()} at the end of configuration. Value returned by this builder must be
12
12
  * exported as constant with name "platforma" from the "config" module. */
13
13
  class BlockModel {
14
- _renderingMode;
15
- _initialArgs;
16
- _initialUiState;
17
- _outputs;
18
- _inputsValid;
19
- _sections;
20
- _title;
21
- _enrichmentTargets;
22
- _featureFlags;
23
- constructor(_renderingMode, _initialArgs, _initialUiState, _outputs, _inputsValid, _sections, _title, _enrichmentTargets, _featureFlags) {
24
- this._renderingMode = _renderingMode;
25
- this._initialArgs = _initialArgs;
26
- this._initialUiState = _initialUiState;
27
- this._outputs = _outputs;
28
- this._inputsValid = _inputsValid;
29
- this._sections = _sections;
30
- this._title = _title;
31
- this._enrichmentTargets = _enrichmentTargets;
32
- this._featureFlags = _featureFlags;
33
- }
34
- static INITIAL_BLOCK_FEATURE_FLAGS = {
35
- supportsLazyState: true,
36
- requiresUIAPIVersion: 1,
37
- requiresModelAPIVersion: 1,
38
- };
14
+ config;
15
+ constructor(config) {
16
+ this.config = config;
17
+ }
18
+ static get INITIAL_BLOCK_FEATURE_FLAGS() {
19
+ return {
20
+ supportsLazyState: true,
21
+ requiresUIAPIVersion: 1,
22
+ requiresModelAPIVersion: 1,
23
+ };
24
+ }
39
25
  static create(renderingMode = 'Heavy') {
40
- return new BlockModel(renderingMode, undefined, {}, {}, getImmediate(true), getImmediate([]), undefined, undefined, { ...BlockModel.INITIAL_BLOCK_FEATURE_FLAGS });
26
+ return new BlockModel({
27
+ renderingMode,
28
+ initialUiState: {},
29
+ outputs: {},
30
+ inputsValid: getImmediate(true),
31
+ sections: getImmediate([]),
32
+ featureFlags: BlockModel.INITIAL_BLOCK_FEATURE_FLAGS,
33
+ });
41
34
  }
42
35
  output(key, cfgOrRf, flags = {}) {
43
36
  if (typeof cfgOrRf === 'function') {
44
37
  const handle = `output#${key}`;
45
38
  tryRegisterCallback(handle, () => cfgOrRf(new RenderCtx()));
46
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, {
47
- ...this._outputs,
48
- [key]: {
49
- __renderLambda: true,
50
- handle,
51
- ...flags,
39
+ return new BlockModel({
40
+ ...this.config,
41
+ outputs: {
42
+ ...this.config.outputs,
43
+ [key]: {
44
+ __renderLambda: true,
45
+ handle,
46
+ ...flags,
47
+ },
52
48
  },
53
- }, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
49
+ });
50
+ }
51
+ else {
52
+ return new BlockModel({
53
+ ...this.config,
54
+ outputs: {
55
+ ...this.config.outputs,
56
+ [key]: cfgOrRf,
57
+ },
58
+ });
54
59
  }
55
- else
56
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, {
57
- ...this._outputs,
58
- [key]: cfgOrRf,
59
- }, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
60
60
  }
61
61
  /** Shortcut for {@link output} with retentive flag set to true. */
62
62
  retentiveOutput(key, rf) {
@@ -65,13 +65,20 @@ class BlockModel {
65
65
  argsValid(cfgOrRf) {
66
66
  if (typeof cfgOrRf === 'function') {
67
67
  tryRegisterCallback('inputsValid', () => cfgOrRf(new RenderCtx()));
68
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, {
69
- __renderLambda: true,
70
- handle: 'inputsValid',
71
- }, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
68
+ return new BlockModel({
69
+ ...this.config,
70
+ inputsValid: {
71
+ __renderLambda: true,
72
+ handle: 'inputsValid',
73
+ },
74
+ });
75
+ }
76
+ else {
77
+ return new BlockModel({
78
+ ...this.config,
79
+ inputsValid: cfgOrRf,
80
+ });
72
81
  }
73
- else
74
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, cfgOrRf, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
75
82
  }
76
83
  sections(arrOrCfgOrRf) {
77
84
  if (Array.isArray(arrOrCfgOrRf)) {
@@ -79,34 +86,82 @@ class BlockModel {
79
86
  }
80
87
  else if (typeof arrOrCfgOrRf === 'function') {
81
88
  tryRegisterCallback('sections', () => arrOrCfgOrRf(new RenderCtx()));
82
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, { __renderLambda: true, handle: 'sections' }, this._title, this._enrichmentTargets, this._featureFlags);
89
+ return new BlockModel({
90
+ ...this.config,
91
+ sections: {
92
+ __renderLambda: true,
93
+ handle: 'sections',
94
+ },
95
+ });
96
+ }
97
+ else {
98
+ return new BlockModel({
99
+ ...this.config,
100
+ sections: arrOrCfgOrRf,
101
+ });
83
102
  }
84
- else
85
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, arrOrCfgOrRf, this._title, this._enrichmentTargets, this._featureFlags);
86
103
  }
87
104
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
88
105
  title(rf) {
89
106
  tryRegisterCallback('title', () => rf(new RenderCtx()));
90
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, this._sections, { __renderLambda: true, handle: 'title' }, this._enrichmentTargets, this._featureFlags);
107
+ return new BlockModel({
108
+ ...this.config,
109
+ title: {
110
+ __renderLambda: true,
111
+ handle: 'title',
112
+ },
113
+ });
114
+ }
115
+ subtitle(rf) {
116
+ tryRegisterCallback('subtitle', () => rf(new RenderCtx()));
117
+ return new BlockModel({
118
+ ...this.config,
119
+ subtitle: {
120
+ __renderLambda: true,
121
+ handle: 'subtitle',
122
+ },
123
+ });
124
+ }
125
+ tags(rf) {
126
+ tryRegisterCallback('tags', () => rf(new RenderCtx()));
127
+ return new BlockModel({
128
+ ...this.config,
129
+ tags: {
130
+ __renderLambda: true,
131
+ handle: 'tags',
132
+ },
133
+ });
91
134
  }
92
135
  /**
93
136
  * Sets initial args for the block, this value must be specified.
94
137
  * @deprecated use {@link withArgs}
95
138
  * */
96
139
  initialArgs(value) {
97
- return new BlockModel(this._renderingMode, value, this._initialUiState, this._outputs, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
140
+ return this.withArgs(value);
98
141
  }
99
142
  /** Sets initial args for the block, this value must be specified. */
100
- withArgs(initialValue) {
101
- return new BlockModel(this._renderingMode, initialValue, this._initialUiState, this._outputs, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
143
+ withArgs(initialArgs) {
144
+ return new BlockModel({
145
+ ...this.config,
146
+ initialArgs,
147
+ });
102
148
  }
103
149
  /** Defines type and sets initial value for block UiState. */
104
- withUiState(initialValue) {
105
- return new BlockModel(this._renderingMode, this._initialArgs, initialValue, this._outputs, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
150
+ withUiState(initialUiState) {
151
+ return new BlockModel({
152
+ ...this.config,
153
+ initialUiState,
154
+ });
106
155
  }
107
156
  /** Sets or overrides feature flags for the block. */
108
157
  withFeatureFlags(flags) {
109
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, this._sections, this._title, this._enrichmentTargets, { ...this._featureFlags, ...flags });
158
+ return new BlockModel({
159
+ ...this.config,
160
+ featureFlags: {
161
+ ...this.config.featureFlags,
162
+ ...flags,
163
+ },
164
+ });
110
165
  }
111
166
  /**
112
167
  * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
@@ -114,43 +169,50 @@ class BlockModel {
114
169
  */
115
170
  enriches(lambda) {
116
171
  tryRegisterCallback('enrichmentTargets', lambda);
117
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, this._sections, this._title, { __renderLambda: true, handle: 'enrichmentTargets' }, this._featureFlags);
172
+ return new BlockModel({
173
+ ...this.config,
174
+ enrichmentTargets: {
175
+ __renderLambda: true,
176
+ handle: 'enrichmentTargets',
177
+ },
178
+ });
118
179
  }
119
180
  /** Renders all provided block settings into a pre-configured platforma API
120
181
  * instance, that can be used in frontend to interact with block state, and
121
182
  * other features provided by the platforma to the block. */
122
- done(apiVersion) {
123
- const requiresUIAPIVersion = apiVersion ?? 1;
183
+ done(apiVersion = 1) {
124
184
  return this.withFeatureFlags({
125
- ...this._featureFlags,
126
- requiresUIAPIVersion,
127
- })._done(requiresUIAPIVersion);
185
+ ...this.config.featureFlags,
186
+ requiresUIAPIVersion: apiVersion,
187
+ }).#done();
128
188
  }
129
- _done(apiVersion) {
130
- if (this._initialArgs === undefined)
189
+ #done() {
190
+ if (this.config.initialArgs === undefined)
131
191
  throw new Error('Initial arguments not set.');
132
192
  const config = {
133
193
  v3: {
134
194
  sdkVersion: PlatformaSDKVersion,
135
- renderingMode: this._renderingMode,
136
- initialArgs: this._initialArgs,
137
- initialUiState: this._initialUiState,
138
- inputsValid: this._inputsValid,
139
- sections: this._sections,
140
- title: this._title,
141
- outputs: this._outputs,
142
- enrichmentTargets: this._enrichmentTargets,
143
- featureFlags: this._featureFlags,
195
+ renderingMode: this.config.renderingMode,
196
+ initialArgs: this.config.initialArgs,
197
+ initialUiState: this.config.initialUiState,
198
+ inputsValid: this.config.inputsValid,
199
+ sections: this.config.sections,
200
+ title: this.config.title,
201
+ subtitle: this.config.subtitle,
202
+ tags: this.config.tags,
203
+ outputs: this.config.outputs,
204
+ enrichmentTargets: this.config.enrichmentTargets,
205
+ featureFlags: this.config.featureFlags,
144
206
  },
145
207
  // fields below are added to allow previous desktop versions read generated configs
146
208
  sdkVersion: PlatformaSDKVersion,
147
- renderingMode: this._renderingMode,
148
- initialArgs: this._initialArgs,
149
- inputsValid: downgradeCfgOrLambda(this._inputsValid),
150
- sections: downgradeCfgOrLambda(this._sections),
151
- outputs: Object.fromEntries(Object.entries(this._outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)])),
209
+ renderingMode: this.config.renderingMode,
210
+ initialArgs: this.config.initialArgs,
211
+ inputsValid: downgradeCfgOrLambda(this.config.inputsValid),
212
+ sections: downgradeCfgOrLambda(this.config.sections),
213
+ outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)])),
152
214
  };
153
- globalThis.platformaApiVersion = apiVersion;
215
+ globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion;
154
216
  if (!isInUI())
155
217
  // we are in the configuration rendering routine, not in actual UI
156
218
  return { config };
@@ -1 +1 @@
1
- {"version":3,"file":"builder.js","sources":["../src/builder.ts"],"sourcesContent":["import type { BlockRenderingMode, BlockSection, ValueOrErrors, AnyFunction, PlRef, BlockCodeKnownFeatureFlags, BlockConfigContainer } from '@milaboratories/pl-model-common';\nimport type { Checked, ConfigResult, TypedConfig } from './config';\nimport { getImmediate } from './config';\nimport { getPlatformaInstance, isInUI, tryRegisterCallback } from './internal';\nimport type { Platforma, PlatformaApiVersion, PlatformaV1, PlatformaV2 } from './platforma';\nimport type { InferRenderFunctionReturn, RenderFunction } from './render';\nimport { RenderCtx } from './render';\nimport { PlatformaSDKVersion } from './version';\nimport type {\n TypedConfigOrConfigLambda,\n ConfigRenderLambda,\n StdCtxArgsOnly,\n DeriveHref,\n ResolveCfgType,\n ExtractFunctionHandleReturn,\n ConfigRenderLambdaFlags,\n} from './bconfig';\nimport {\n downgradeCfgOrLambda,\n} from './bconfig';\n\ntype SectionsExpectedType = readonly BlockSection[];\n\ntype SectionsCfgChecked<Cfg extends TypedConfig, Args, UiState> = Checked<\n Cfg,\n ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>> extends SectionsExpectedType ? true : false\n>;\n\n// TODO (Unused type in code)\n// type SectionsRFChecked<RF extends Function> = Checked<\n// RF,\n// InferRenderFunctionReturn<RF> extends SectionsExpectedType ? true : false\n// >;\n\ntype InputsValidExpectedType = boolean;\n\ntype InputsValidCfgChecked<Cfg extends TypedConfig, Args, UiState> = Checked<\n Cfg,\n ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>> extends InputsValidExpectedType ? true : false\n>;\n\n// TODO (Unused type in code)\n// type InputsValidRFChecked<RF extends Function> = Checked<\n// RF,\n// InferRenderFunctionReturn<RF> extends InputsValidExpectedType ? true : false\n// >;\n\ntype NoOb = Record<string, never>;\n\n/** Main entry point that each block should use in it's \"config\" module. Don't forget\n * to call {@link done()} at the end of configuration. Value returned by this builder must be\n * exported as constant with name \"platforma\" from the \"config\" module. */\nexport class BlockModel<\n Args,\n OutputsCfg extends Record<string, TypedConfigOrConfigLambda>,\n UiState,\n Href extends `/${string}` = '/',\n> {\n private constructor(\n private readonly _renderingMode: BlockRenderingMode,\n private readonly _initialArgs: Args | undefined,\n private readonly _initialUiState: UiState,\n private readonly _outputs: OutputsCfg,\n private readonly _inputsValid: TypedConfigOrConfigLambda,\n private readonly _sections: TypedConfigOrConfigLambda,\n private readonly _title: ConfigRenderLambda | undefined,\n private readonly _enrichmentTargets: ConfigRenderLambda | undefined,\n private readonly _featureFlags: BlockCodeKnownFeatureFlags,\n ) {}\n\n public static readonly INITIAL_BLOCK_FEATURE_FLAGS: BlockCodeKnownFeatureFlags = {\n supportsLazyState: true,\n requiresUIAPIVersion: 1,\n requiresModelAPIVersion: 1,\n };\n\n /** Initiates configuration builder */\n public static create(renderingMode: BlockRenderingMode): BlockModel<NoOb, {}, NoOb>;\n /** Initiates configuration builder */\n public static create(): BlockModel<NoOb, {}, NoOb>;\n /**\n * Initiates configuration builder\n * @deprecated use create method without generic parameter\n */\n public static create<Args>(renderingMode: BlockRenderingMode): BlockModel<Args, {}, NoOb>;\n /**\n * Initiates configuration builder\n * @deprecated use create method without generic parameter\n */\n public static create<Args>(): BlockModel<Args, {}, NoOb>;\n public static create(renderingMode: BlockRenderingMode = 'Heavy'): BlockModel<NoOb, {}, NoOb> {\n return new BlockModel<NoOb, {}, NoOb>(\n renderingMode,\n undefined,\n {},\n {},\n getImmediate(true),\n getImmediate([]),\n undefined,\n undefined,\n { ...BlockModel.INITIAL_BLOCK_FEATURE_FLAGS },\n );\n }\n\n /**\n * Add output cell to the configuration\n *\n * @param key output cell name, that can be later used to retrieve the rendered value\n * @param cfg configuration describing how to render cell value from the blocks\n * workflow outputs\n * @deprecated use lambda-based API\n * */\n public output<const Key extends string, const Cfg extends TypedConfig>(\n key: Key,\n cfg: Cfg\n ): BlockModel<Args, OutputsCfg & { [K in Key]: Cfg }, UiState, Href>;\n /**\n * Add output cell to the configuration\n *\n * @param key output cell name, that can be later used to retrieve the rendered value\n * @param rf callback calculating output value using context, that allows to access\n * workflows outputs and interact with platforma drivers\n * @param flags additional flags that may alter lambda rendering procedure\n * */\n public output<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n flags?: ConfigRenderLambdaFlags\n ): BlockModel<\n Args,\n OutputsCfg & { [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> },\n UiState,\n Href\n >;\n public output(\n key: string,\n cfgOrRf: TypedConfig | AnyFunction,\n flags: ConfigRenderLambdaFlags = {},\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n if (typeof cfgOrRf === 'function') {\n const handle = `output#${key}`;\n tryRegisterCallback(handle, () => cfgOrRf(new RenderCtx()));\n return new BlockModel(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n {\n ...this._outputs,\n [key]: {\n __renderLambda: true,\n handle,\n ...flags,\n } satisfies ConfigRenderLambda,\n },\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n } else\n return new BlockModel(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n {\n ...this._outputs,\n [key]: cfgOrRf,\n },\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Shortcut for {@link output} with retentive flag set to true. */\n public retentiveOutput<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n ): BlockModel<\n Args,\n OutputsCfg & { [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> },\n UiState,\n Href\n > {\n return this.output(key, rf, { retentive: true });\n }\n\n /** Sets custom configuration predicate on the block args at which block can be executed\n * @deprecated use lambda-based API */\n public argsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** Sets custom configuration predicate on the block args at which block can be executed */\n public argsValid<RF extends RenderFunction<Args, UiState, boolean>>(\n rf: RF\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public argsValid(\n cfgOrRf: TypedConfig | AnyFunction,\n ): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {\n if (typeof cfgOrRf === 'function') {\n tryRegisterCallback('inputsValid', () => cfgOrRf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n {\n __renderLambda: true,\n handle: 'inputsValid',\n } satisfies ConfigRenderLambda,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n } else\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n cfgOrRf,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Sets the config to generate list of section in the left block overviews panel\n * @deprecated use lambda-based API */\n public sections<const S extends SectionsExpectedType>(\n rf: S\n ): BlockModel<Args, OutputsCfg, UiState, DeriveHref<S>>;\n /** Sets the config to generate list of section in the left block overviews panel */\n public sections<\n const Ret extends SectionsExpectedType,\n const RF extends RenderFunction<Args, UiState, Ret>,\n >(rf: RF): BlockModel<Args, OutputsCfg, UiState, DeriveHref<ReturnType<RF>>>;\n public sections<const Cfg extends TypedConfig>(\n cfg: Cfg & SectionsCfgChecked<Cfg, Args, UiState>\n ): BlockModel<\n Args,\n OutputsCfg,\n UiState,\n DeriveHref<ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>>>\n >;\n public sections(\n arrOrCfgOrRf: SectionsExpectedType | TypedConfig | AnyFunction,\n ): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {\n if (Array.isArray(arrOrCfgOrRf)) {\n return this.sections(getImmediate(arrOrCfgOrRf));\n } else if (typeof arrOrCfgOrRf === 'function') {\n tryRegisterCallback('sections', () => arrOrCfgOrRf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n { __renderLambda: true, handle: 'sections' } as ConfigRenderLambda,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n } else\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n arrOrCfgOrRf as TypedConfig,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */\n public title(\n rf: RenderFunction<Args, UiState, string>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('title', () => rf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n this._sections,\n { __renderLambda: true, handle: 'title' } as ConfigRenderLambda,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /**\n * Sets initial args for the block, this value must be specified.\n * @deprecated use {@link withArgs}\n * */\n public initialArgs(value: Args): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n value,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Sets initial args for the block, this value must be specified. */\n public withArgs<Args>(initialValue: Args): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n initialValue,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Defines type and sets initial value for block UiState. */\n public withUiState<UiState>(initialValue: UiState): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n this._initialArgs,\n initialValue,\n this._outputs,\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n this._featureFlags,\n );\n }\n\n /** Sets or overrides feature flags for the block. */\n public withFeatureFlags(flags: Partial<BlockCodeKnownFeatureFlags>): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n this._sections,\n this._title,\n this._enrichmentTargets,\n { ...this._featureFlags, ...flags },\n );\n }\n\n /**\n * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.\n * Influences dependency graph construction.\n */\n public enriches(\n lambda: (args: Args) => PlRef[],\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('enrichmentTargets', lambda);\n return new BlockModel<Args, OutputsCfg, UiState, Href>(\n this._renderingMode,\n this._initialArgs,\n this._initialUiState,\n this._outputs,\n this._inputsValid,\n this._sections,\n this._title,\n { __renderLambda: true, handle: 'enrichmentTargets' } as ConfigRenderLambda,\n this._featureFlags,\n );\n }\n\n public done(apiVersion?: 1): PlatformaV1<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n >;\n\n public done(apiVersion: 2): PlatformaV2<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n >;\n\n /** Renders all provided block settings into a pre-configured platforma API\n * instance, that can be used in frontend to interact with block state, and\n * other features provided by the platforma to the block. */\n public done(apiVersion?: PlatformaApiVersion): Platforma<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n > {\n const requiresUIAPIVersion = apiVersion ?? 1;\n return this.withFeatureFlags({\n ...this._featureFlags,\n requiresUIAPIVersion,\n })._done(requiresUIAPIVersion);\n }\n\n public _done(apiVersion: PlatformaApiVersion): Platforma<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n > {\n if (this._initialArgs === undefined) throw new Error('Initial arguments not set.');\n\n const config: BlockConfigContainer = {\n v3: {\n sdkVersion: PlatformaSDKVersion,\n renderingMode: this._renderingMode,\n initialArgs: this._initialArgs,\n initialUiState: this._initialUiState,\n inputsValid: this._inputsValid,\n sections: this._sections,\n title: this._title,\n outputs: this._outputs,\n enrichmentTargets: this._enrichmentTargets,\n featureFlags: this._featureFlags,\n },\n\n // fields below are added to allow previous desktop versions read generated configs\n sdkVersion: PlatformaSDKVersion,\n renderingMode: this._renderingMode,\n initialArgs: this._initialArgs,\n inputsValid: downgradeCfgOrLambda(this._inputsValid),\n sections: downgradeCfgOrLambda(this._sections),\n outputs: Object.fromEntries(\n Object.entries(this._outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)]),\n ),\n };\n\n globalThis.platformaApiVersion = apiVersion;\n\n if (!isInUI())\n // we are in the configuration rendering routine, not in actual UI\n return { config } as any;\n // normal operation inside the UI\n else return getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion }) as any;\n }\n}\n\nexport type InferOutputType<CfgOrFH, Args, UiState> = CfgOrFH extends TypedConfig\n ? ResolveCfgType<CfgOrFH, Args, UiState>\n : CfgOrFH extends ConfigRenderLambda\n ? ExtractFunctionHandleReturn<CfgOrFH>\n : never;\n\ntype InferOutputsFromConfigs<\n Args,\n OutputsCfg extends Record<string, TypedConfigOrConfigLambda>,\n UiState,\n> = {\n [Key in keyof OutputsCfg]: ValueOrErrors<InferOutputType<OutputsCfg[Key], Args, UiState>>;\n};\n"],"names":[],"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lockCodeKnownFeatureFlags, BlockConfigContainer } from '@milaboratories/pl-model-common';\nimport type { Checked, ConfigResult, TypedConfig } from './config';\nimport { getImmediate } from './config';\nimport { getPlatformaInstance, isInUI, tryRegisterCallback } from './internal';\nimport type { Platforma, PlatformaApiVersion, PlatformaV1, PlatformaV2 } from './platforma';\nimport type { InferRenderFunctionReturn, RenderFunction } from './render';\nimport { RenderCtx } from './render';\nimport { PlatformaSDKVersion } from './version';\nimport type {\n TypedConfigOrConfigLambda,\n ConfigRenderLambda,\n StdCtxArgsOnly,\n DeriveHref,\n ResolveCfgType,\n ExtractFunctionHandleReturn,\n ConfigRenderLambdaFlags,\n} from './bconfig';\nimport {\n downgradeCfgOrLambda,\n} from './bconfig';\n\ntype SectionsExpectedType = readonly BlockSection[];\n\ntype SectionsCfgChecked<Cfg extends TypedConfig, Args, UiState> = Checked<\n Cfg,\n ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>> extends SectionsExpectedType ? true : false\n>;\n\n// TODO (Unused type in code)\n// type SectionsRFChecked<RF extends Function> = Checked<\n// RF,\n// InferRenderFunctionReturn<RF> extends SectionsExpectedType ? true : false\n// >;\n\ntype InputsValidExpectedType = boolean;\n\ntype InputsValidCfgChecked<Cfg extends TypedConfig, Args, UiState> = Checked<\n Cfg,\n ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>> extends InputsValidExpectedType ? true : false\n>;\n\n// TODO (Unused type in code)\n// type InputsValidRFChecked<RF extends Function> = Checked<\n// RF,\n// InferRenderFunctionReturn<RF> extends InputsValidExpectedType ? true : false\n// >;\n\ntype NoOb = Record<string, never>;\n\n/** Main entry point that each block should use in it's \"config\" module. Don't forget\n * to call {@link done()} at the end of configuration. Value returned by this builder must be\n * exported as constant with name \"platforma\" from the \"config\" module. */\nexport class BlockModel<\n Args,\n OutputsCfg extends Record<string, TypedConfigOrConfigLambda>,\n UiState,\n Href extends `/${string}` = '/',\n> {\n private constructor(\n private config: {\n readonly renderingMode: BlockRenderingMode;\n readonly initialArgs?: Args;\n readonly initialUiState: UiState;\n readonly outputs: OutputsCfg;\n readonly inputsValid: TypedConfigOrConfigLambda;\n readonly sections: TypedConfigOrConfigLambda;\n readonly title?: ConfigRenderLambda;\n readonly subtitle?: ConfigRenderLambda;\n readonly tags?: ConfigRenderLambda;\n readonly enrichmentTargets?: ConfigRenderLambda;\n readonly featureFlags: BlockCodeKnownFeatureFlags;\n },\n ) {}\n\n public static get INITIAL_BLOCK_FEATURE_FLAGS(): BlockCodeKnownFeatureFlags {\n return {\n supportsLazyState: true,\n requiresUIAPIVersion: 1,\n requiresModelAPIVersion: 1,\n };\n }\n\n /** Initiates configuration builder */\n public static create(renderingMode: BlockRenderingMode): BlockModel<NoOb, {}, NoOb>;\n /** Initiates configuration builder */\n public static create(): BlockModel<NoOb, {}, NoOb>;\n /**\n * Initiates configuration builder\n * @deprecated use create method without generic parameter\n */\n public static create<Args>(renderingMode: BlockRenderingMode): BlockModel<Args, {}, NoOb>;\n /**\n * Initiates configuration builder\n * @deprecated use create method without generic parameter\n */\n public static create<Args>(): BlockModel<Args, {}, NoOb>;\n public static create(renderingMode: BlockRenderingMode = 'Heavy'): BlockModel<NoOb, {}, NoOb> {\n return new BlockModel<NoOb, {}, NoOb>({\n renderingMode,\n initialUiState: {},\n outputs: {},\n inputsValid: getImmediate(true),\n sections: getImmediate([]),\n featureFlags: BlockModel.INITIAL_BLOCK_FEATURE_FLAGS,\n });\n }\n\n /**\n * Add output cell to the configuration\n *\n * @param key output cell name, that can be later used to retrieve the rendered value\n * @param cfg configuration describing how to render cell value from the blocks\n * workflow outputs\n * @deprecated use lambda-based API\n * */\n public output<const Key extends string, const Cfg extends TypedConfig>(\n key: Key,\n cfg: Cfg\n ): BlockModel<Args, OutputsCfg & { [K in Key]: Cfg }, UiState, Href>;\n /**\n * Add output cell to the configuration\n *\n * @param key output cell name, that can be later used to retrieve the rendered value\n * @param rf callback calculating output value using context, that allows to access\n * workflows outputs and interact with platforma drivers\n * @param flags additional flags that may alter lambda rendering procedure\n * */\n public output<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n flags?: ConfigRenderLambdaFlags\n ): BlockModel<\n Args,\n OutputsCfg & { [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> },\n UiState,\n Href\n >;\n public output(\n key: string,\n cfgOrRf: TypedConfig | AnyFunction,\n flags: ConfigRenderLambdaFlags = {},\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n if (typeof cfgOrRf === 'function') {\n const handle = `output#${key}`;\n tryRegisterCallback(handle, () => cfgOrRf(new RenderCtx()));\n return new BlockModel({\n ...this.config,\n outputs: {\n ...this.config.outputs,\n [key]: {\n __renderLambda: true,\n handle,\n ...flags,\n },\n },\n });\n } else {\n return new BlockModel({\n ...this.config,\n outputs: {\n ...this.config.outputs,\n [key]: cfgOrRf,\n },\n });\n }\n }\n\n /** Shortcut for {@link output} with retentive flag set to true. */\n public retentiveOutput<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n ): BlockModel<\n Args,\n OutputsCfg & { [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> },\n UiState,\n Href\n > {\n return this.output(key, rf, { retentive: true });\n }\n\n /** Sets custom configuration predicate on the block args at which block can be executed\n * @deprecated use lambda-based API */\n public argsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** Sets custom configuration predicate on the block args at which block can be executed */\n public argsValid<RF extends RenderFunction<Args, UiState, boolean>>(\n rf: RF\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public argsValid(\n cfgOrRf: TypedConfig | AnyFunction,\n ): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {\n if (typeof cfgOrRf === 'function') {\n tryRegisterCallback('inputsValid', () => cfgOrRf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState>({\n ...this.config,\n inputsValid: {\n __renderLambda: true,\n handle: 'inputsValid',\n },\n });\n } else {\n return new BlockModel<Args, OutputsCfg, UiState>({\n ...this.config,\n inputsValid: cfgOrRf,\n });\n }\n }\n\n /** Sets the config to generate list of section in the left block overviews panel\n * @deprecated use lambda-based API */\n public sections<const S extends SectionsExpectedType>(\n rf: S\n ): BlockModel<Args, OutputsCfg, UiState, DeriveHref<S>>;\n /** Sets the config to generate list of section in the left block overviews panel */\n public sections<\n const Ret extends SectionsExpectedType,\n const RF extends RenderFunction<Args, UiState, Ret>,\n >(rf: RF): BlockModel<Args, OutputsCfg, UiState, DeriveHref<ReturnType<RF>>>;\n public sections<const Cfg extends TypedConfig>(\n cfg: Cfg & SectionsCfgChecked<Cfg, Args, UiState>\n ): BlockModel<\n Args,\n OutputsCfg,\n UiState,\n DeriveHref<ConfigResult<Cfg, StdCtxArgsOnly<Args, UiState>>>\n >;\n public sections(\n arrOrCfgOrRf: SectionsExpectedType | TypedConfig | AnyFunction,\n ): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {\n if (Array.isArray(arrOrCfgOrRf)) {\n return this.sections(getImmediate(arrOrCfgOrRf));\n } else if (typeof arrOrCfgOrRf === 'function') {\n tryRegisterCallback('sections', () => arrOrCfgOrRf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState>({\n ...this.config,\n sections: {\n __renderLambda: true,\n handle: 'sections',\n },\n });\n } else {\n return new BlockModel<Args, OutputsCfg, UiState>({\n ...this.config,\n sections: arrOrCfgOrRf as TypedConfig,\n });\n }\n }\n\n /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */\n public title(\n rf: RenderFunction<Args, UiState, string>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('title', () => rf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n title: {\n __renderLambda: true,\n handle: 'title',\n },\n });\n }\n\n public subtitle(\n rf: RenderFunction<Args, UiState, string>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('subtitle', () => rf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n subtitle: {\n __renderLambda: true,\n handle: 'subtitle',\n },\n });\n }\n\n public tags(\n rf: RenderFunction<Args, UiState, string[]>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('tags', () => rf(new RenderCtx()));\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n tags: {\n __renderLambda: true,\n handle: 'tags',\n },\n });\n }\n\n /**\n * Sets initial args for the block, this value must be specified.\n * @deprecated use {@link withArgs}\n * */\n public initialArgs(value: Args): BlockModel<Args, OutputsCfg, UiState, Href> {\n return this.withArgs(value);\n }\n\n /** Sets initial args for the block, this value must be specified. */\n public withArgs<Args>(initialArgs: Args): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n initialArgs,\n });\n }\n\n /** Defines type and sets initial value for block UiState. */\n public withUiState<UiState>(initialUiState: UiState): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n initialUiState,\n });\n }\n\n /** Sets or overrides feature flags for the block. */\n public withFeatureFlags(flags: Partial<BlockCodeKnownFeatureFlags>): BlockModel<Args, OutputsCfg, UiState, Href> {\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n featureFlags: {\n ...this.config.featureFlags,\n ...flags,\n },\n });\n }\n\n /**\n * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.\n * Influences dependency graph construction.\n */\n public enriches(\n lambda: (args: Args) => PlRef[],\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback('enrichmentTargets', lambda);\n return new BlockModel<Args, OutputsCfg, UiState, Href>({\n ...this.config,\n enrichmentTargets: {\n __renderLambda: true,\n handle: 'enrichmentTargets',\n },\n });\n }\n\n public done(apiVersion?: 1): PlatformaV1<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n >;\n\n public done(apiVersion: 2): PlatformaV2<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n >;\n\n /** Renders all provided block settings into a pre-configured platforma API\n * instance, that can be used in frontend to interact with block state, and\n * other features provided by the platforma to the block. */\n public done(apiVersion: PlatformaApiVersion = 1): Platforma<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n > {\n return this.withFeatureFlags({\n ...this.config.featureFlags,\n requiresUIAPIVersion: apiVersion,\n }).#done();\n }\n\n #done(): Platforma<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n > {\n if (this.config.initialArgs === undefined) throw new Error('Initial arguments not set.');\n\n const config: BlockConfigContainer = {\n v3: {\n sdkVersion: PlatformaSDKVersion,\n renderingMode: this.config.renderingMode,\n initialArgs: this.config.initialArgs,\n initialUiState: this.config.initialUiState,\n inputsValid: this.config.inputsValid,\n sections: this.config.sections,\n title: this.config.title,\n subtitle: this.config.subtitle,\n tags: this.config.tags,\n outputs: this.config.outputs,\n enrichmentTargets: this.config.enrichmentTargets,\n featureFlags: this.config.featureFlags,\n },\n\n // fields below are added to allow previous desktop versions read generated configs\n sdkVersion: PlatformaSDKVersion,\n renderingMode: this.config.renderingMode,\n initialArgs: this.config.initialArgs,\n inputsValid: downgradeCfgOrLambda(this.config.inputsValid),\n sections: downgradeCfgOrLambda(this.config.sections),\n outputs: Object.fromEntries(\n Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)]),\n ),\n };\n\n globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion as PlatformaApiVersion;\n\n if (!isInUI())\n // we are in the configuration rendering routine, not in actual UI\n return { config } as any;\n // normal operation inside the UI\n else return getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion }) as any;\n }\n}\n\nexport type InferOutputType<CfgOrFH, Args, UiState> = CfgOrFH extends TypedConfig\n ? ResolveCfgType<CfgOrFH, Args, UiState>\n : CfgOrFH extends ConfigRenderLambda\n ? ExtractFunctionHandleReturn<CfgOrFH>\n : never;\n\ntype InferOutputsFromConfigs<\n Args,\n OutputsCfg extends Record<string, TypedConfigOrConfigLambda>,\n UiState,\n> = {\n [Key in keyof OutputsCfg]: ValueOrErrors<InferOutputType<OutputsCfg[Key], Args, UiState>>;\n};\n"],"names":[],"mappings":";;;;;;;;;AAiDA;;AAE0E;MAC7D,UAAU,CAAA;AAOX,IAAA,MAAA;AADV,IAAA,WAAA,CACU,MAYP,EAAA;QAZO,IAAA,CAAA,MAAM,GAAN,MAAM;IAab;AAEI,IAAA,WAAW,2BAA2B,GAAA;QAC3C,OAAO;AACL,YAAA,iBAAiB,EAAE,IAAI;AACvB,YAAA,oBAAoB,EAAE,CAAC;AACvB,YAAA,uBAAuB,EAAE,CAAC;SAC3B;IACH;AAgBO,IAAA,OAAO,MAAM,CAAC,aAAA,GAAoC,OAAO,EAAA;QAC9D,OAAO,IAAI,UAAU,CAAiB;YACpC,aAAa;AACb,YAAA,cAAc,EAAE,EAAE;AAClB,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC;AAC/B,YAAA,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC;YAC1B,YAAY,EAAE,UAAU,CAAC,2BAA2B;AACrD,SAAA,CAAC;IACJ;AAgCO,IAAA,MAAM,CACX,GAAW,EACX,OAAkC,EAClC,QAAiC,EAAE,EAAA;AAEnC,QAAA,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;AACjC,YAAA,MAAM,MAAM,GAAG,CAAA,OAAA,EAAU,GAAG,EAAE;AAC9B,YAAA,mBAAmB,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;YAC3D,OAAO,I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E,MAAM,CAAC,WAAW,CACzB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9F;SACF;QAED,UAAU,CAAC,mBAAmB,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,oBAA2C;QAErG,IAAI,CAAC,MAAM,EAAE;;YAEX,OAAO,EAAE,MAAM,EAAS;;;AAErB,YAAA,OAAO,oBAAoB,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAQ;IAC/G;AACD;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.48.14";
3
+ var version = "1.49.0";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.cjs.map
@@ -1,4 +1,4 @@
1
- var version = "1.48.14";
1
+ var version = "1.49.0";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/model",
3
- "version": "1.48.14",
3
+ "version": "1.49.0",
4
4
  "description": "Platforma.bio SDK / Block Model",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -23,20 +23,20 @@
23
23
  "canonicalize": "~2.1.0",
24
24
  "es-toolkit": "^1.39.10",
25
25
  "zod": "~3.23.8",
26
+ "@milaboratories/ptabler-expression-js": "1.1.8",
26
27
  "@milaboratories/pl-error-like": "1.12.5",
27
- "@milaboratories/pl-model-common": "1.21.10",
28
- "@milaboratories/ptabler-expression-js": "1.1.7"
28
+ "@milaboratories/pl-model-common": "1.22.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "~5.6.3",
32
32
  "vitest": "^4.0.16",
33
33
  "@vitest/coverage-istanbul": "^4.0.16",
34
34
  "fast-json-patch": "^3.1.1",
35
+ "@milaboratories/eslint-config": "1.0.5",
35
36
  "@milaboratories/build-configs": "1.2.1",
36
37
  "@milaboratories/helpers": "1.12.1",
37
38
  "@milaboratories/ts-builder": "1.2.1",
38
- "@milaboratories/ts-configs": "1.2.0",
39
- "@milaboratories/eslint-config": "1.0.5"
39
+ "@milaboratories/ts-configs": "1.2.0"
40
40
  },
41
41
  "scripts": {
42
42
  "type-check": "ts-builder types --target node",