@platforma-sdk/model 1.48.14 → 1.50.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.
@@ -1 +1 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAe,KAAK,EAAE,0BAA0B,EAAwB,MAAM,iCAAiC,CAAC;AAC7K,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGnE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC5F,OAAO,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1E,OAAO,KAAK,EACV,yBAAyB,EACzB,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,cAAc,EACd,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,WAAW,CAAC;AAKnB,KAAK,oBAAoB,GAAG,SAAS,YAAY,EAAE,CAAC;AAEpD,KAAK,kBAAkB,CAAC,GAAG,SAAS,WAAW,EAAE,IAAI,EAAE,OAAO,IAAI,OAAO,CACvE,GAAG,EACH,YAAY,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,oBAAoB,GAAG,IAAI,GAAG,KAAK,CAC7F,CAAC;AAQF,KAAK,uBAAuB,GAAG,OAAO,CAAC;AAEvC,KAAK,qBAAqB,CAAC,GAAG,SAAS,WAAW,EAAE,IAAI,EAAE,OAAO,IAAI,OAAO,CAC1E,GAAG,EACH,YAAY,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,SAAS,uBAAuB,GAAG,IAAI,GAAG,KAAK,CAChG,CAAC;AAQF,KAAK,IAAI,GAAG,MAA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EACJ,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,EAC5D,OAAO,IACL;KACD,GAAG,IAAI,MAAM,UAAU,GACpB,gBAAgB,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,GACjE;QAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS;YAAE,UAAU,EAAE,IAAI,CAAA;SAAE,GAAG,KAAK,GAAG,IAAI,CAAC,CAAA;KAAE;CAChF,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,EAAE,SAAS,SAAS,GAAG,SAAS,IAAI,EAAE,GAAG;IACrE,cAAc,EAAE,cAAc,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;QACtB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC,CAAC;CACJ,CAAC"}
package/dist/builder.js CHANGED
@@ -6,72 +6,88 @@ import './render/util/label.js';
6
6
  import 'canonicalize';
7
7
  import { PlatformaSDKVersion } from './version.js';
8
8
  import { downgradeCfgOrLambda } from './bconfig/normalization.js';
9
+ import { isConfigLambda } from './bconfig/types.js';
9
10
 
10
11
  /** Main entry point that each block should use in it's "config" module. Don't forget
11
12
  * to call {@link done()} at the end of configuration. Value returned by this builder must be
12
13
  * exported as constant with name "platforma" from the "config" module. */
13
14
  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
- };
15
+ config;
16
+ constructor(config) {
17
+ this.config = config;
18
+ }
19
+ static get INITIAL_BLOCK_FEATURE_FLAGS() {
20
+ return {
21
+ supportsLazyState: true,
22
+ requiresUIAPIVersion: 1,
23
+ requiresModelAPIVersion: 1,
24
+ };
25
+ }
39
26
  static create(renderingMode = 'Heavy') {
40
- return new BlockModel(renderingMode, undefined, {}, {}, getImmediate(true), getImmediate([]), undefined, undefined, { ...BlockModel.INITIAL_BLOCK_FEATURE_FLAGS });
27
+ return new BlockModel({
28
+ renderingMode,
29
+ initialUiState: {},
30
+ outputs: {},
31
+ inputsValid: getImmediate(true),
32
+ sections: getImmediate([]),
33
+ featureFlags: BlockModel.INITIAL_BLOCK_FEATURE_FLAGS,
34
+ });
41
35
  }
42
36
  output(key, cfgOrRf, flags = {}) {
43
37
  if (typeof cfgOrRf === 'function') {
44
38
  const handle = `output#${key}`;
45
39
  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,
40
+ return new BlockModel({
41
+ ...this.config,
42
+ outputs: {
43
+ ...this.config.outputs,
44
+ [key]: {
45
+ __renderLambda: true,
46
+ handle,
47
+ ...flags,
48
+ },
52
49
  },
53
- }, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
50
+ });
51
+ }
52
+ else {
53
+ return new BlockModel({
54
+ ...this.config,
55
+ outputs: {
56
+ ...this.config.outputs,
57
+ [key]: cfgOrRf,
58
+ },
59
+ });
54
60
  }
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
61
  }
61
62
  /** Shortcut for {@link output} with retentive flag set to true. */
62
63
  retentiveOutput(key, rf) {
63
64
  return this.output(key, rf, { retentive: true });
64
65
  }
66
+ /** Shortcut for {@link output} with withStatus flag set to true. */
67
+ outputWithStatus(key, rf) {
68
+ return this.output(key, rf, { withStatus: true });
69
+ }
70
+ /** Shortcut for {@link output} with retentive and withStatus flags set to true. */
71
+ retentiveOutputWithStatus(key, rf) {
72
+ return this.output(key, rf, { retentive: true, withStatus: true });
73
+ }
65
74
  argsValid(cfgOrRf) {
66
75
  if (typeof cfgOrRf === 'function') {
67
76
  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);
77
+ return new BlockModel({
78
+ ...this.config,
79
+ inputsValid: {
80
+ __renderLambda: true,
81
+ handle: 'inputsValid',
82
+ },
83
+ });
84
+ }
85
+ else {
86
+ return new BlockModel({
87
+ ...this.config,
88
+ inputsValid: cfgOrRf,
89
+ });
72
90
  }
73
- else
74
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, cfgOrRf, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
75
91
  }
76
92
  sections(arrOrCfgOrRf) {
77
93
  if (Array.isArray(arrOrCfgOrRf)) {
@@ -79,34 +95,82 @@ class BlockModel {
79
95
  }
80
96
  else if (typeof arrOrCfgOrRf === 'function') {
81
97
  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);
98
+ return new BlockModel({
99
+ ...this.config,
100
+ sections: {
101
+ __renderLambda: true,
102
+ handle: 'sections',
103
+ },
104
+ });
105
+ }
106
+ else {
107
+ return new BlockModel({
108
+ ...this.config,
109
+ sections: arrOrCfgOrRf,
110
+ });
83
111
  }
84
- else
85
- return new BlockModel(this._renderingMode, this._initialArgs, this._initialUiState, this._outputs, this._inputsValid, arrOrCfgOrRf, this._title, this._enrichmentTargets, this._featureFlags);
86
112
  }
87
113
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
88
114
  title(rf) {
89
115
  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);
116
+ return new BlockModel({
117
+ ...this.config,
118
+ title: {
119
+ __renderLambda: true,
120
+ handle: 'title',
121
+ },
122
+ });
123
+ }
124
+ subtitle(rf) {
125
+ tryRegisterCallback('subtitle', () => rf(new RenderCtx()));
126
+ return new BlockModel({
127
+ ...this.config,
128
+ subtitle: {
129
+ __renderLambda: true,
130
+ handle: 'subtitle',
131
+ },
132
+ });
133
+ }
134
+ tags(rf) {
135
+ tryRegisterCallback('tags', () => rf(new RenderCtx()));
136
+ return new BlockModel({
137
+ ...this.config,
138
+ tags: {
139
+ __renderLambda: true,
140
+ handle: 'tags',
141
+ },
142
+ });
91
143
  }
92
144
  /**
93
145
  * Sets initial args for the block, this value must be specified.
94
146
  * @deprecated use {@link withArgs}
95
147
  * */
96
148
  initialArgs(value) {
97
- return new BlockModel(this._renderingMode, value, this._initialUiState, this._outputs, this._inputsValid, this._sections, this._title, this._enrichmentTargets, this._featureFlags);
149
+ return this.withArgs(value);
98
150
  }
99
151
  /** 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);
152
+ withArgs(initialArgs) {
153
+ return new BlockModel({
154
+ ...this.config,
155
+ initialArgs,
156
+ });
102
157
  }
103
158
  /** 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);
159
+ withUiState(initialUiState) {
160
+ return new BlockModel({
161
+ ...this.config,
162
+ initialUiState,
163
+ });
106
164
  }
107
165
  /** Sets or overrides feature flags for the block. */
108
166
  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 });
167
+ return new BlockModel({
168
+ ...this.config,
169
+ featureFlags: {
170
+ ...this.config.featureFlags,
171
+ ...flags,
172
+ },
173
+ });
110
174
  }
111
175
  /**
112
176
  * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
@@ -114,49 +178,64 @@ class BlockModel {
114
178
  */
115
179
  enriches(lambda) {
116
180
  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);
181
+ return new BlockModel({
182
+ ...this.config,
183
+ enrichmentTargets: {
184
+ __renderLambda: true,
185
+ handle: 'enrichmentTargets',
186
+ },
187
+ });
118
188
  }
119
189
  /** Renders all provided block settings into a pre-configured platforma API
120
190
  * instance, that can be used in frontend to interact with block state, and
121
191
  * other features provided by the platforma to the block. */
122
- done(apiVersion) {
123
- const requiresUIAPIVersion = apiVersion ?? 1;
192
+ done(apiVersion = 1) {
124
193
  return this.withFeatureFlags({
125
- ...this._featureFlags,
126
- requiresUIAPIVersion,
127
- })._done(requiresUIAPIVersion);
194
+ ...this.config.featureFlags,
195
+ requiresUIAPIVersion: apiVersion,
196
+ }).#done();
128
197
  }
129
- _done(apiVersion) {
130
- if (this._initialArgs === undefined)
198
+ #done() {
199
+ if (this.config.initialArgs === undefined)
131
200
  throw new Error('Initial arguments not set.');
132
201
  const config = {
133
202
  v3: {
134
203
  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,
204
+ renderingMode: this.config.renderingMode,
205
+ initialArgs: this.config.initialArgs,
206
+ initialUiState: this.config.initialUiState,
207
+ inputsValid: this.config.inputsValid,
208
+ sections: this.config.sections,
209
+ title: this.config.title,
210
+ subtitle: this.config.subtitle,
211
+ tags: this.config.tags,
212
+ outputs: this.config.outputs,
213
+ enrichmentTargets: this.config.enrichmentTargets,
214
+ featureFlags: this.config.featureFlags,
144
215
  },
145
216
  // fields below are added to allow previous desktop versions read generated configs
146
217
  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)])),
218
+ renderingMode: this.config.renderingMode,
219
+ initialArgs: this.config.initialArgs,
220
+ inputsValid: downgradeCfgOrLambda(this.config.inputsValid),
221
+ sections: downgradeCfgOrLambda(this.config.sections),
222
+ outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, downgradeCfgOrLambda(value)])),
152
223
  };
153
- globalThis.platformaApiVersion = apiVersion;
224
+ globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion;
154
225
  if (!isInUI())
155
226
  // we are in the configuration rendering routine, not in actual UI
156
227
  return { config };
157
228
  // normal operation inside the UI
158
229
  else
159
- return getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion });
230
+ return {
231
+ ...getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion }),
232
+ blockModelInfo: {
233
+ outputs: Object.fromEntries(Object.entries(this.config.outputs)
234
+ .map(([key, value]) => [key, {
235
+ withStatus: Boolean(isConfigLambda(value) && value.withStatus),
236
+ }])),
237
+ },
238
+ };
160
239
  }
161
240
  }
162
241
 
@@ -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":[],"mappings":";;;;;;;;;AAiDA;;AAE0E;MAC7D,UAAU,CAAA;AAOF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;AACF,gBAAA,UAAU,EAAE,mBAAmB;gBAC/B,aAAa,EAAE,IAAI,CAAC,cAAc;gBAClC,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,cAAc,EAAE,IAAI,CAAC,eAAe;gBACpC,WAAW,EAAE,IAAI,CAAC,YAAY;gBAC9B,QAAQ,EAAE,IAAI,CAAC,SAAS;gBACxB,KAAK,EAAE,IAAI,CAAC,MAAM;gBAClB,OAAO,EAAE,IAAI,CAAC,QAAQ;gBACtB,iBAAiB,EAAE,IAAI,CAAC,kBAAkB;gBAC1C,YAAY,EAAE,IAAI,CAAC,aAAa;AACjC,aAAA;;AAGD,YAAA,UAAU,EAAE,mBAAmB;YAC/B,aAAa,EAAE,IAAI,CAAC,cAAc;YAClC,WAAW,EAAE,IAAI,CAAC,YAAY;AAC9B,YAAA,WAAW,EAAE,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC;AACpD,YAAA,QAAQ,EAAE,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC;AAC9C,YAAA,OAAO,EAAE,MAAM,CAAC,WAAW,CACzB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CACxF;SACF;AAED,QAAA,UAAU,CAAC,mBAAmB,GAAG,UAAU;QAE3C,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;;;;;"}
1
+ {"version":3,"file":"builder.js","sources":["../src/builder.ts"],"sourcesContent":["import type { BlockRenderingMode, BlockSection, AnyFunction, PlRef, BlockCodeKnownFeatureFlags, BlockConfigContainer, OutputWithStatus } 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 isConfigLambda,\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 wrapped with additional status information 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 & { withStatus: true }\n ): BlockModel<\n Args,\n OutputsCfg & { [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> & { withStatus: true } },\n UiState,\n Href\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 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 ) {\n return this.output(key, rf, { retentive: true });\n }\n\n /** Shortcut for {@link output} with withStatus flag set to true. */\n public outputWithStatus<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n ) {\n return this.output(key, rf, { withStatus: true });\n }\n\n /** Shortcut for {@link output} with retentive and withStatus flags set to true. */\n public retentiveOutputWithStatus<const Key extends string, const RF extends RenderFunction<Args, UiState>>(\n key: Key,\n rf: RF,\n ) {\n return this.output(key, rf, { retentive: true, withStatus: 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): PlatformaExtended<PlatformaV1<\n Args,\n InferOutputsFromConfigs<Args, OutputsCfg, UiState>,\n UiState,\n Href\n >>;\n\n public done(apiVersion: 2): PlatformaExtended<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): PlatformaExtended<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(): PlatformaExtended<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 {\n ...getPlatformaInstance({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion }),\n blockModelInfo: {\n outputs: Object.fromEntries(\n Object.entries(this.config.outputs)\n .map(([key, value]) => [key, {\n withStatus: Boolean(isConfigLambda(value) && value.withStatus),\n }]),\n ),\n },\n };\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]:\n & OutputWithStatus<InferOutputType<OutputsCfg[Key], Args, UiState>>\n & { __unwrap: (OutputsCfg[Key] extends { withStatus: true } ? false : true) };\n};\n\nexport type PlatformaExtended<Pl extends Platforma = Platforma> = Pl & {\n blockModelInfo: BlockModelInfo;\n};\n\nexport type BlockModelInfo = {\n outputs: Record<string, {\n withStatus: boolean;\n }>;\n};\n"],"names":[],"mappings":";;;;;;;;;;AAkDA;;AAE0E;MAC7D,UAAU,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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;;;YAErB,OAAO;gBACV,GAAG,oBAAoB,CAAC,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;AAC7F,gBAAA,cAAc,EAAE;AACd,oBAAA,OAAO,EAAE,MAAM,CAAC,WAAW,CACzB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO;AAC/B,yBAAA,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;4BAC3B,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC;AAC/D,yBAAA,CAAC,CAAC,CACN;AACF,iBAAA;aACF;IACH;AACD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.cjs","sources":["../src/internal.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport { } from './global';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string; apiVersion: PlatformaApiVersion }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n"],"names":[],"mappings":";;AAKA;SACgB,MAAM,GAAA;AACpB,IAAA,QACE,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;AAEjG;AAEA;AACM,SAAU,oBAAoB,CAKlC,MAAgE,EAAA;AAChE,IAAA,IAAI,MAAM,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,UAAU;AACzD,QAAA,OAAO,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;AACnC,SAAA,IAAI,OAAO,UAAU,CAAC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,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7C;;;;;;;;;"}
1
+ {"version":3,"file":"internal.cjs","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from '@milaboratories/pl-model-common';\nimport { } from './global';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string; apiVersion: PlatformaApiVersion }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n"],"names":[],"mappings":";;AAKA;SACgB,MAAM,GAAA;AACpB,IAAA,QACE,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;AAEjG;AAEA;AACM,SAAU,oBAAoB,CAKlC,MAAgE,EAAA;AAChE,IAAA,IAAI,MAAM,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,UAAU;AACzD,QAAA,OAAO,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;AACnC,SAAA,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,SAAoD;;AACvH,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACxD;SAEgB,kBAAkB,GAAA;AAChC,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,OAAO,SAAS;AACvB;SAEgB,eAAe,GAAA;AAC7B,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC;AACzD;AAEM,SAAU,mBAAmB,CAAC,GAAW,EAAE,QAAiC,EAAA;AAChF,IAAA,MAAM,GAAG,GAAG,kBAAkB,EAAE;IAChC,IAAI,GAAG,KAAK,SAAS;AAAE,QAAA,OAAO,KAAK;AACnC,IAAA,IAAI,GAAG,IAAI,GAAG,CAAC,gBAAgB;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAA,oBAAA,CAAsB,CAAC;AAChG,IAAA,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,QAAQ;AACpC,IAAA,OAAO,IAAI;AACb;AAEA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAwC;AAEhE,SAAU,mBAAmB,CAAC,MAAoB,EAAE,SAAmC,EAAA;IAC3F,IAAI,EAAE,MAAM,IAAI,eAAe,EAAE,CAAC,gBAAgB,CAAC,EAAE;QACnD,eAAe,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,KAAc,KAAI;YAC9D,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,EAAE;gBAC7C,GAAG,CAAC,KAAK,CAAC;YACZ;AACF,QAAA,CAAC;AACD,QAAA,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC;IACA,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7C;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
- import type { ValueOrErrors } from '@milaboratories/pl-model-common';
1
+ import type { OutputWithStatus } from '@milaboratories/pl-model-common';
2
2
  import type { Platforma, PlatformaApiVersion } from './platforma';
3
3
  import type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';
4
4
  /** Utility code helping to identify whether the code is running in actual UI environment */
5
5
  export declare function isInUI(): boolean;
6
6
  /** Utility code helping to retrieve a platforma instance form the environment */
7
- export declare function getPlatformaInstance<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`>(config?: {
7
+ export declare function getPlatformaInstance<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`>(config?: {
8
8
  sdkVersion: string;
9
9
  apiVersion: PlatformaApiVersion;
10
10
  }): Platforma<Args, Outputs, UiState, Href>;
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,4FAA4F;AAC5F,wBAAgB,MAAM,YAIrB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,EAC/F,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,EACxC,MAAM,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,GAAG,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAK3G;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,GAAG,SAAS,CAGnE;AAED,wBAAgB,eAAe,IAAI,kBAAkB,CAGpD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,OAAO,CAM3F;AAID,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,QAU5F"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE1E,4FAA4F;AAC5F,wBAAgB,MAAM,YAIrB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAClC,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,EACrG,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,EACxC,MAAM,CAAC,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,GAAG,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAK3G;AAED,wBAAgB,kBAAkB,IAAI,kBAAkB,GAAG,SAAS,CAGnE;AAED,wBAAgB,eAAe,IAAI,kBAAkB,CAGpD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,OAAO,CAM3F;AAID,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,QAU5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sources":["../src/internal.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport { } from './global';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string; apiVersion: PlatformaApiVersion }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n"],"names":[],"mappings":"AAKA;SACgB,MAAM,GAAA;AACpB,IAAA,QACE,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;AAEjG;AAEA;AACM,SAAU,oBAAoB,CAKlC,MAAgE,EAAA;AAChE,IAAA,I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EAAE;gBAC7C,GAAG,CAAC,KAAK,CAAC;YACZ;AACF,QAAA,CAAC;AACD,QAAA,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC;IACA,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7C;;;;"}
1
+ {"version":3,"file":"internal.js","sources":["../src/internal.ts"],"sourcesContent":["import type { OutputWithStatus } from '@milaboratories/pl-model-common';\nimport { } from './global';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string; apiVersion: PlatformaApiVersion }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma as Platforma<Args, Outputs, UiState, Href>;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n"],"names":[],"mappings":"AAKA;SACgB,MAAM,GAAA;AACpB,IAAA,QACE,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;AAEjG;AAEA;AACM,SAAU,oBAAoB,CAKlC,MAAgE,EAAA;AAChE,IAAA,IAAI,MAAM,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,UAAU;AACzD,QAAA,OAAO,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;AACnC,SAAA,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,SAAoD;;AACvH,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC;AACxD;SAEgB,kBAAkB,GAAA;AAChC,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,OAAO,SAAS;AACvB;SAEgB,eAAe,GAAA;AAC7B,IAAA,IAAI,OAAO,UAAU,CAAC,YAAY,KAAK,WAAW;QAAE,OAAO,UAAU,CAAC,YAAY;;AAC7E,QAAA,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC;AACzD;AAEM,SAAU,mBAAmB,CAAC,GAAW,EAAE,QAAiC,EAAA;AAChF,IAAA,MAAM,GAAG,GAAG,kBAAkB,EAAE;IAChC,IAAI,GAAG,KAAK,SAAS;AAAE,QAAA,OAAO,KAAK;AACnC,IAAA,IAAI,GAAG,IAAI,GAAG,CAAC,gBAAgB;AAAE,QAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,CAAA,oBAAA,CAAsB,CAAC;AAChG,IAAA,GAAG,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,QAAQ;AACpC,IAAA,OAAO,IAAI;AACb;AAEA,MAAM,cAAc,GAAG,IAAI,GAAG,EAAwC;AAEhE,SAAU,mBAAmB,CAAC,MAAoB,EAAE,SAAmC,EAAA;IAC3F,IAAI,EAAE,MAAM,IAAI,eAAe,EAAE,CAAC,gBAAgB,CAAC,EAAE;QACnD,eAAe,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,KAAc,KAAI;YAC9D,KAAK,MAAM,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,EAAE;gBAC7C,GAAG,CAAC,KAAK,CAAC;YACZ;AACF,QAAA,CAAC;AACD,QAAA,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;IAChC;IACA,cAAc,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7C;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "1.48.14";
3
+ var version = "1.50.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.50.0";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.js.map
@@ -1,25 +1,25 @@
1
1
  import type { BlockApiV1 } from './block_api_v1';
2
2
  import type { BlockApiV2 } from './block_api_v2';
3
- import type { BlockOutputsBase, BlockState, DriverKit, ValueOrErrors } from '@milaboratories/pl-model-common';
3
+ import type { BlockOutputsBase, BlockState, DriverKit, OutputWithStatus } from '@milaboratories/pl-model-common';
4
4
  import type { SdkInfo } from './sdk_info';
5
5
  import type { BlockStatePatch } from './block_state_patch';
6
6
  /** Defines all methods to interact with the platform environment from within a block UI. @deprecated */
7
- export interface PlatformaV1<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV1<Args, Outputs, UiState, Href>, DriverKit {
7
+ export interface PlatformaV1<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV1<Args, Outputs, UiState, Href>, DriverKit {
8
8
  /** Information about SDK version current platforma environment was compiled with. */
9
9
  readonly sdkInfo: SdkInfo;
10
10
  readonly apiVersion?: 1;
11
11
  }
12
12
  /** V2 version based on effective json patches pulling API */
13
- export interface PlatformaV2<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV2<Args, Outputs, UiState, Href>, DriverKit {
13
+ export interface PlatformaV2<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApiV2<Args, Outputs, UiState, Href>, DriverKit {
14
14
  /** Information about SDK version current platforma environment was compiled with. */
15
15
  readonly sdkInfo: SdkInfo;
16
16
  readonly apiVersion: 2;
17
17
  }
18
- export type Platforma<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> = PlatformaV1<Args, Outputs, UiState, Href> | PlatformaV2<Args, Outputs, UiState, Href>;
18
+ export type Platforma<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> = PlatformaV1<Args, Outputs, UiState, Href> | PlatformaV2<Args, Outputs, UiState, Href>;
19
19
  export type PlatformaApiVersion = Platforma['apiVersion'];
20
20
  export type InferArgsType<Pl extends Platforma> = Pl extends Platforma<infer Args> ? Args : never;
21
21
  export type InferOutputsType<Pl extends Platforma> = Pl extends Platforma<unknown, infer Outputs> ? Outputs : never;
22
- export type InferUiState<Pl extends Platforma> = Pl extends Platforma<unknown, Record<string, ValueOrErrors<unknown>>, infer UiState> ? UiState : never;
22
+ export type InferUiState<Pl extends Platforma> = Pl extends Platforma<unknown, Record<string, OutputWithStatus<unknown>>, infer UiState> ? UiState : never;
23
23
  export type InferHrefType<Pl extends Platforma> = Pl extends Platforma<unknown, BlockOutputsBase, unknown, infer Href> ? Href : never;
24
24
  export type PlatformaFactory = (config: {
25
25
  sdkVersion: string;
@@ -1 +1 @@
1
- {"version":3,"file":"platforma.d.ts","sourceRoot":"","sources":["../src/platforma.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC9G,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,wGAAwG;AACxG,MAAM,WAAW,WAAW,CAC1B,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,EAC/F,OAAO,GAAG,OAAO,EACjB,IAAI,SAAS,IAAI,MAAM,EAAE,GAAG,IAAI,MAAM,EAAE,CACxC,SAAQ,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,EAChD,SAAS;IACT,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,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oBAAoB,CAAC,EAAE,SAAS,SAAS,IAAI,eAAe,CACtE,aAAa,CAAC,EAAE,CAAC,EACjB,gBAAgB,CAAC,EAAE,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,EAChB,aAAa,CAAC,EAAE,CAAC,CAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"raw_globals.cjs","sources":["../src/raw_globals.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getPlatformaApiVersion(): PlatformaApiVersion {\n return platformaApiVersion ?? 1; // undefined means 1 for backward compatibility\n}\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\n// export function getPlatformaOrDefault<\n// Args = unknown,\n// Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n// UiState = unknown,\n// Href extends `/${string}` = `/${string}`,\n// >(): PlatformaV1<Args, Outputs, UiState, Href> | PlatformaV2<Args, Outputs, UiState, Href> {\n// try {\n// return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n// } catch {\n// return platforma;\n// }\n// }\n"],"names":["getPlatformaInstance","PlatformaSDKVersion"],"mappings":";;;;;SAMgB,sBAAsB,GAAA;AACpC,IAAA,OAAO,mBAAmB,IAAI,CAAC,CAAC;AAClC;SAEgB,uBAAuB,GAAA;AAMrC,IAAA,OAAOA,6BAAoB,CAA+B,EAAE,UAAU,EAAEC,2BAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;AACjI;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;"}
1
+ {"version":3,"file":"raw_globals.cjs","sources":["../src/raw_globals.ts"],"sourcesContent":["import type { OutputWithStatus } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma, PlatformaApiVersion } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getPlatformaApiVersion(): PlatformaApiVersion {\n return platformaApiVersion ?? 1; // undefined means 1 for backward compatibility\n}\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion, apiVersion: platformaApiVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\n// export function getPlatformaOrDefault<\n// Args = unknown,\n// Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n// UiState = unknown,\n// Href extends `/${string}` = `/${string}`,\n// >(): PlatformaV1<Args, Outputs, UiState, Href> | PlatformaV2<Args, Outputs, UiState, Href> {\n// try {\n// return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n// } catch {\n// return platforma;\n// }\n// }\n"],"names":["getPlatformaInstance","PlatformaSDKVersion"],"mappings":";;;;;SAMgB,sBAAsB,GAAA;AACpC,IAAA,OAAO,mBAAmB,IAAI,CAAC,CAAC;AAClC;SAEgB,uBAAuB,GAAA;AAMrC,IAAA,OAAOA,6BAAoB,CAA+B,EAAE,UAAU,EAAEC,2BAAmB,EAAE,UAAU,EAAE,mBAAmB,EAAE,CAAC;AACjI;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;"}
@@ -1,6 +1,6 @@
1
- import type { ValueOrErrors } from '@milaboratories/pl-model-common';
1
+ import type { OutputWithStatus } from '@milaboratories/pl-model-common';
2
2
  import type { Platforma, PlatformaApiVersion } from './platforma';
3
3
  export declare function getPlatformaApiVersion(): PlatformaApiVersion;
4
- export declare function getRawPlatformaInstance<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`>(): Platforma<Args, Outputs, UiState, Href>;
4
+ export declare function getRawPlatformaInstance<Args = unknown, Outputs extends Record<string, OutputWithStatus<unknown>> = Record<string, OutputWithStatus<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`>(): Platforma<Args, Outputs, UiState, Href>;
5
5
  /** Returns a global platforma instance or a provided fallback if it's not available. */
6
6
  //# sourceMappingURL=raw_globals.d.ts.map