@platforma-sdk/model 1.82.0 → 1.83.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.
Files changed (62) hide show
  1. package/dist/bconfig/index.d.ts +2 -2
  2. package/dist/bconfig/lambdas.d.ts +2 -12
  3. package/dist/bconfig/lambdas.d.ts.map +1 -1
  4. package/dist/bconfig/v3.d.ts +1 -1
  5. package/dist/block_model.cjs +2 -2
  6. package/dist/block_model.js +2 -2
  7. package/dist/config/index.d.ts +2 -6
  8. package/dist/config/type_engine.d.ts +7 -28
  9. package/dist/config/type_engine.d.ts.map +1 -1
  10. package/dist/index.cjs +20 -60
  11. package/dist/index.d.ts +5 -11
  12. package/dist/index.js +4 -8
  13. package/dist/package.cjs +1 -1
  14. package/dist/package.js +1 -1
  15. package/dist/render/api.cjs +0 -22
  16. package/dist/render/api.cjs.map +1 -1
  17. package/dist/render/api.d.ts +1 -9
  18. package/dist/render/api.d.ts.map +1 -1
  19. package/dist/render/api.js +1 -22
  20. package/dist/render/api.js.map +1 -1
  21. package/dist/render/index.cjs +0 -1
  22. package/dist/render/index.d.ts +2 -2
  23. package/dist/render/index.js +2 -2
  24. package/package.json +4 -4
  25. package/src/bconfig/lambdas.ts +1 -25
  26. package/src/config/index.ts +0 -4
  27. package/src/config/type_engine.ts +6 -49
  28. package/src/index.ts +0 -2
  29. package/src/render/api.ts +0 -32
  30. package/src/typing.test.ts +4 -143
  31. package/dist/block_model_legacy.cjs +0 -240
  32. package/dist/block_model_legacy.cjs.map +0 -1
  33. package/dist/block_model_legacy.d.ts +0 -115
  34. package/dist/block_model_legacy.d.ts.map +0 -1
  35. package/dist/block_model_legacy.js +0 -240
  36. package/dist/block_model_legacy.js.map +0 -1
  37. package/dist/config/actions.cjs +0 -232
  38. package/dist/config/actions.cjs.map +0 -1
  39. package/dist/config/actions.d.ts +0 -48
  40. package/dist/config/actions.d.ts.map +0 -1
  41. package/dist/config/actions.js +0 -201
  42. package/dist/config/actions.js.map +0 -1
  43. package/dist/config/actions_kinds.d.ts +0 -116
  44. package/dist/config/actions_kinds.d.ts.map +0 -1
  45. package/dist/config/index.cjs +0 -33
  46. package/dist/config/index.js +0 -2
  47. package/dist/config/model_meta.d.ts +0 -9
  48. package/dist/config/model_meta.d.ts.map +0 -1
  49. package/dist/config/type_util.d.ts +0 -14
  50. package/dist/config/type_util.d.ts.map +0 -1
  51. package/dist/ref_util.cjs +0 -21
  52. package/dist/ref_util.cjs.map +0 -1
  53. package/dist/ref_util.d.ts +0 -19
  54. package/dist/ref_util.d.ts.map +0 -1
  55. package/dist/ref_util.js +0 -20
  56. package/dist/ref_util.js.map +0 -1
  57. package/src/block_model_legacy.ts +0 -465
  58. package/src/config/actions.ts +0 -468
  59. package/src/config/actions_kinds.ts +0 -264
  60. package/src/config/model_meta.ts +0 -5
  61. package/src/config/type_util.ts +0 -25
  62. package/src/ref_util.ts +0 -17
@@ -1,54 +1,11 @@
1
- import type { ActGetImmediate } from "./actions_kinds";
2
1
  import type { Cfg } from "./model";
3
2
 
4
- // Higher kind types pattern taken from here: https://code.lol/post/programming/higher-kinded-types/
5
-
6
- type GenericFunction = (x: any) => unknown;
7
-
8
- /** This is a type constructor deriving a returned type of config given the
9
- * context type. Something like ConfAction<Cfg> -> ReturnedType. */
10
- export interface ConfAction {
11
- readonly ctx: unknown;
12
- new: GenericFunction;
13
- isSync: boolean;
14
- }
15
-
16
- /** This type basically sets parameter to a ConfAction kind. */
17
- export type ActionResult<A extends ConfAction, Ctx> = ReturnType<
18
- (A & {
19
- readonly ctx: Ctx;
20
- })["new"]
21
- >;
22
-
23
- // Branding pattern taken from here: https://egghead.io/blog/using-branded-types-in-typescript
24
-
25
- /** Field key to attach ConfAction information to a config type. */
26
- declare const __config_action__: unique symbol;
27
-
28
- /** Creates branded Cfg type */
29
- export type TypedConfig<Action extends ConfAction = ConfAction> = Cfg & {
30
- [__config_action__]: Action;
31
- };
32
-
33
- export type PrimitiveOrConfig = TypedConfig | string | number | boolean | null;
34
-
35
- /** Converts primitive types to immediate config */
36
- export type PrimitiveToCfg<T extends PrimitiveOrConfig> = T extends string | number | boolean | null
37
- ? TypedConfig<ActGetImmediate<T>>
38
- : T;
39
-
40
- /** Extracts action */
41
- export type ExtractAction<Cfg extends TypedConfig> = Cfg[typeof __config_action__];
42
-
43
- export type POCExtractAction<T extends PrimitiveOrConfig> = ExtractAction<PrimitiveToCfg<T>>;
44
-
45
- export type InferVarTypeSafe<Ctx, V> = V extends string
46
- ? Ctx extends { [key in V]: infer T }
47
- ? T
48
- : undefined
49
- : unknown;
50
-
51
- export type ConfigResult<Cfg extends TypedConfig, Ctx> = ActionResult<ExtractAction<Cfg>, Ctx>;
3
+ /** Config tree of an already published block, as stored in its compiled model.
4
+ *
5
+ * Nothing in the SDK builds these any more — the builder DSL that produced them
6
+ * went away with the v1/v2 block model. The type is kept because the middle
7
+ * layer still has to read and render configs of blocks published before that. */
8
+ export type TypedConfig = Cfg;
52
9
 
53
10
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
54
11
  declare const plResourceEntry: unique symbol;
package/src/index.ts CHANGED
@@ -22,7 +22,6 @@ export {
22
22
  getPluginData,
23
23
  } from "./block_storage";
24
24
  export * from "./block_storage_facade";
25
- export * from "./block_model_legacy";
26
25
  export { BlockModelV3 } from "./block_model";
27
26
  export type { PluginRecord, ParamsInput } from "./block_model";
28
27
  export { DataModel, DataModelBuilder } from "./block_migrations";
@@ -47,7 +46,6 @@ export * from "./pframe";
47
46
  export * from "./labels";
48
47
  export * from "./columns";
49
48
  export * from "./platforma";
50
- export * from "./ref_util";
51
49
  export * from "./render";
52
50
  export * from "./version";
53
51
  export * from "./raw_globals";
package/src/render/api.ts CHANGED
@@ -728,34 +728,6 @@ export class BlockRenderCtx<Args = unknown, Data = unknown> extends RenderCtxBas
728
728
  }
729
729
  }
730
730
 
731
- /** Render context for legacy v1/v2 blocks - provides backward compatibility */
732
- export class RenderCtxLegacy<Args = unknown, UiState = unknown> extends RenderCtxBase<
733
- Args,
734
- UiState
735
- > {
736
- private argsCache?: { v: Args };
737
-
738
- public get args(): Args {
739
- if (this.argsCache === undefined) {
740
- const raw = this.ctx.args;
741
- const value = typeof raw === "function" ? raw() : raw;
742
- this.argsCache = { v: JSON.parse(value) };
743
- }
744
- return this.argsCache.v;
745
- }
746
-
747
- private uiStateCache?: { v: UiState };
748
-
749
- public get uiState(): UiState {
750
- if (this.uiStateCache === undefined) {
751
- const raw = this.ctx.uiState!;
752
- const value = typeof raw === "function" ? raw() : raw;
753
- this.uiStateCache = { v: value ? JSON.parse(value) : ({} as UiState) };
754
- }
755
- return this.uiStateCache.v;
756
- }
757
- }
758
-
759
731
  /**
760
732
  * Render context for plugin output functions.
761
733
  * Reads plugin data from blockStorage and derives params from pre-wrapped input callbacks.
@@ -811,10 +783,6 @@ export type RenderFunction<Args = unknown, State = unknown, Ret = unknown> = (
811
783
  rCtx: BlockRenderCtx<Args, State>,
812
784
  ) => Ret;
813
785
 
814
- export type RenderFunctionLegacy<Args = unknown, State = unknown, Ret = unknown> = (
815
- rCtx: RenderCtxLegacy<Args, State>,
816
- ) => Ret;
817
-
818
786
  export type UnwrapFutureRef<K> =
819
787
  K extends FutureRef<infer T>
820
788
  ? T
@@ -1,34 +1,6 @@
1
- import {
2
- BlockSection,
3
- LocalBlobHandleAndSize,
4
- OutputWithStatus,
5
- RemoteBlobHandleAndSize,
6
- } from "@milaboratories/pl-model-common";
7
- import { expect, test } from "vitest";
8
- import { DeriveHref, StdCtx } from "./bconfig";
9
- import { BlockModel } from "./block_model_legacy";
10
- import {
11
- Args,
12
- ConfigResult,
13
- flatten,
14
- getBlobContent,
15
- getBlobContentAsJson,
16
- getBlobContentAsString,
17
- getDownloadedBlobContent,
18
- getImmediate,
19
- getJsonField,
20
- getOnDemandBlobContent,
21
- getResourceField,
22
- getResourceValueAsJson,
23
- isEmpty,
24
- It,
25
- MainOutputs,
26
- makeArray,
27
- makeObject,
28
- mapArrayValues,
29
- mapRecordValues,
30
- } from "./config";
31
- import { InferHrefType, InferOutputsType } from "./platforma";
1
+ import { BlockSection } from "@milaboratories/pl-model-common";
2
+ import { test } from "vitest";
3
+ import { DeriveHref } from "./bconfig";
32
4
 
33
5
  type AssertEqual<T, Expected> = [T] extends [Expected]
34
6
  ? [Expected] extends [T]
@@ -50,43 +22,11 @@ export const assertTypeExtends = <T, Expected>(
50
22
  // noop
51
23
  };
52
24
 
53
- function _typeTest1() {
54
- const a = getJsonField(Args, "field1");
55
- const dd = getResourceValueAsJson<{ s: boolean; g: number }>()(
56
- getResourceField(MainOutputs, "a"),
57
- );
58
-
59
- const cfg1 = makeObject({
60
- a,
61
- b: "attagaca",
62
- c: mapRecordValues(getJsonField(Args, "field2"), getJsonField(It, "b")),
63
- d: getJsonField(dd, "s"),
64
- });
65
-
66
- type Ret = ConfigResult<
67
- typeof cfg1,
68
- StdCtx<{
69
- field1: number;
70
- field2: Record<string, { b: "yap" }>;
71
- }>
72
- >;
73
-
74
- assertType<
75
- Ret,
76
- {
77
- a: number;
78
- b: "attagaca";
79
- c: Record<string, "yap">;
80
- d: boolean;
81
- }
82
- >();
83
- }
84
-
85
25
  function testCreateSections<const S extends BlockSection[]>(_sections: () => S): DeriveHref<S> {
86
26
  return undefined as any;
87
27
  }
88
28
 
89
- test("test config content", () => {
29
+ test("href derivation from sections", () => {
90
30
  const s1 = testCreateSections(() => [
91
31
  { type: "delimiter" },
92
32
  { type: "link", href: "/a1", label: "l" },
@@ -99,82 +39,3 @@ test("test config content", () => {
99
39
 
100
40
  assertType<typeof s2, never>();
101
41
  });
102
-
103
- test("test config content", () => {
104
- const platforma = BlockModel.create("Heavy")
105
- .withArgs<{ a: string[] }>({ a: [] })
106
- .argsValid(isEmpty(getJsonField(Args, "a")))
107
- .output("cell1", makeObject({ b: getJsonField(Args, "a") }))
108
- .output("cell2", mapArrayValues(getJsonField(Args, "a"), getImmediate("v1")))
109
- .sections(() => {
110
- return [
111
- { type: "link", href: "/", label: "Main" },
112
- { type: "link", href: "/subsection", label: "Subsection" },
113
- ];
114
- })
115
- .done();
116
-
117
- assertType<
118
- InferOutputsType<typeof platforma>,
119
- {
120
- cell1: OutputWithStatus<{ b: string[] }>;
121
- cell2: OutputWithStatus<"v1"[]>;
122
- }
123
- >();
124
-
125
- assertType<InferHrefType<typeof platforma>, "/" | "/subsection">();
126
-
127
- expect(JSON.stringify((platforma as any).config).length).toBeGreaterThan(20);
128
- });
129
-
130
- test("test config 2", () => {
131
- const platforma = BlockModel.create<{ a: string[] }>("Heavy")
132
- .initialArgs({ a: [] })
133
- .output(
134
- "cell1",
135
- makeObject({
136
- b: getBlobContentAsString(getResourceField(MainOutputs, "field1")),
137
- c: makeArray(getBlobContent(getResourceField(MainOutputs, "field2")), "asd"),
138
- d: getBlobContentAsJson<string[]>()(getResourceField(MainOutputs, "field3")),
139
- e: flatten(
140
- makeArray(
141
- getBlobContentAsJson<string[]>()(getResourceField(MainOutputs, "field3")),
142
- getImmediate(["asd", "d"] as string[]),
143
- ),
144
- ),
145
- f: getDownloadedBlobContent(getResourceField(MainOutputs, "field4")),
146
- g: getOnDemandBlobContent(getResourceField(MainOutputs, "field5")),
147
- }),
148
- )
149
- .output("cell2", () => 42)
150
- .output("cell3", () => undefined)
151
- .withArgs(isEmpty(getJsonField(Args, "a")))
152
- .sections(
153
- () =>
154
- [
155
- { type: "link", href: "/", label: "Main" },
156
- { type: "link", href: "/subsection", label: "Subsection" },
157
- ] satisfies BlockSection[],
158
- )
159
- .done();
160
-
161
- assertType<
162
- InferOutputsType<typeof platforma>,
163
- {
164
- cell1: OutputWithStatus<{
165
- b: string;
166
- c: [Uint8Array, "asd"];
167
- d: string[];
168
- e: string[];
169
- f: LocalBlobHandleAndSize;
170
- g: RemoteBlobHandleAndSize;
171
- }>;
172
- cell2: OutputWithStatus<number>;
173
- cell3: OutputWithStatus<undefined>;
174
- }
175
- >();
176
-
177
- assertType<InferHrefType<typeof platforma>, "/" | "/subsection">();
178
-
179
- expect(JSON.stringify((platforma as any).config).length).toBeGreaterThan(20);
180
- });
@@ -1,240 +0,0 @@
1
- const require_internal = require("./internal.cjs");
2
- const require_actions = require("./config/actions.cjs");
3
- require("./config/index.cjs");
4
- const require_api = require("./render/api.cjs");
5
- require("./render/index.cjs");
6
- const require_version = require("./version.cjs");
7
- const require_types = require("./bconfig/types.cjs");
8
- const require_normalization = require("./bconfig/normalization.cjs");
9
- require("./bconfig/index.cjs");
10
- let _milaboratories_pl_model_common = require("@milaboratories/pl-model-common");
11
- //#region src/block_model_legacy.ts
12
- /** Main entry point that each block should use in it's "config" module. Don't forget
13
- * to call {@link done()} at the end of configuration. Value returned by this builder must be
14
- * exported as constant with name "platforma" from the "config" module. */
15
- var BlockModel = class BlockModel {
16
- config;
17
- constructor(config) {
18
- this.config = config;
19
- }
20
- static get INITIAL_BLOCK_FEATURE_FLAGS() {
21
- return {
22
- supportsLazyState: true,
23
- supportsPframeQueryRanking: true,
24
- requiresUIAPIVersion: 1,
25
- requiresModelAPIVersion: 1,
26
- requiresCreatePTable: 2,
27
- requiresPFramesVersion: _milaboratories_pl_model_common.REQUIRES_PFRAMES_VERSION
28
- };
29
- }
30
- static create(renderingMode = "Heavy") {
31
- return new BlockModel({
32
- renderingMode,
33
- initialUiState: {},
34
- outputs: {},
35
- inputsValid: require_actions.getImmediate(true),
36
- sections: require_actions.getImmediate([]),
37
- featureFlags: BlockModel.INITIAL_BLOCK_FEATURE_FLAGS
38
- });
39
- }
40
- output(key, cfgOrRf, flags = {}) {
41
- if (typeof cfgOrRf === "function") {
42
- const handle = `output#${key}`;
43
- require_internal.tryRegisterCallback(handle, () => cfgOrRf(new require_api.RenderCtxLegacy()));
44
- return new BlockModel({
45
- ...this.config,
46
- outputs: {
47
- ...this.config.outputs,
48
- [key]: {
49
- __renderLambda: true,
50
- handle,
51
- ...flags
52
- }
53
- }
54
- });
55
- } else return new BlockModel({
56
- ...this.config,
57
- outputs: {
58
- ...this.config.outputs,
59
- [key]: cfgOrRf
60
- }
61
- });
62
- }
63
- /** Shortcut for {@link output} with retentive flag set to true. */
64
- retentiveOutput(key, rf) {
65
- return this.output(key, rf, { retentive: true });
66
- }
67
- /** Shortcut for {@link output} with withStatus flag set to true. */
68
- outputWithStatus(key, rf) {
69
- return this.output(key, rf, { withStatus: true });
70
- }
71
- /** Shortcut for {@link output} with retentive and withStatus flags set to true. */
72
- retentiveOutputWithStatus(key, rf) {
73
- return this.output(key, rf, {
74
- retentive: true,
75
- withStatus: true
76
- });
77
- }
78
- argsValid(cfgOrRf) {
79
- if (typeof cfgOrRf === "function") {
80
- require_internal.tryRegisterCallback("inputsValid", () => cfgOrRf(new require_api.RenderCtxLegacy()));
81
- return new BlockModel({
82
- ...this.config,
83
- inputsValid: {
84
- __renderLambda: true,
85
- handle: "inputsValid"
86
- }
87
- });
88
- } else return new BlockModel({
89
- ...this.config,
90
- inputsValid: cfgOrRf
91
- });
92
- }
93
- sections(arrOrCfgOrRf) {
94
- if (Array.isArray(arrOrCfgOrRf)) return this.sections(require_actions.getImmediate(arrOrCfgOrRf));
95
- else if (typeof arrOrCfgOrRf === "function") {
96
- require_internal.tryRegisterCallback("sections", () => arrOrCfgOrRf(new require_api.RenderCtxLegacy()));
97
- return new BlockModel({
98
- ...this.config,
99
- sections: {
100
- __renderLambda: true,
101
- handle: "sections"
102
- }
103
- });
104
- } else return new BlockModel({
105
- ...this.config,
106
- sections: arrOrCfgOrRf
107
- });
108
- }
109
- /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
110
- title(rf) {
111
- require_internal.tryRegisterCallback("title", () => rf(new require_api.RenderCtxLegacy()));
112
- return new BlockModel({
113
- ...this.config,
114
- title: {
115
- __renderLambda: true,
116
- handle: "title"
117
- }
118
- });
119
- }
120
- subtitle(rf) {
121
- require_internal.tryRegisterCallback("subtitle", () => rf(new require_api.RenderCtxLegacy()));
122
- return new BlockModel({
123
- ...this.config,
124
- subtitle: {
125
- __renderLambda: true,
126
- handle: "subtitle"
127
- }
128
- });
129
- }
130
- tags(rf) {
131
- require_internal.tryRegisterCallback("tags", () => rf(new require_api.RenderCtxLegacy()));
132
- return new BlockModel({
133
- ...this.config,
134
- tags: {
135
- __renderLambda: true,
136
- handle: "tags"
137
- }
138
- });
139
- }
140
- /**
141
- * Sets initial args for the block, this value must be specified.
142
- * @deprecated use {@link withArgs}
143
- * */
144
- initialArgs(value) {
145
- return this.withArgs(value);
146
- }
147
- /** Sets initial args for the block, this value must be specified. */
148
- withArgs(initialArgs) {
149
- return new BlockModel({
150
- ...this.config,
151
- initialArgs
152
- });
153
- }
154
- /** Defines type and sets initial value for block UiState. */
155
- withUiState(initialUiState) {
156
- return new BlockModel({
157
- ...this.config,
158
- initialUiState
159
- });
160
- }
161
- /** Sets or overrides feature flags for the block. */
162
- withFeatureFlags(flags) {
163
- return new BlockModel({
164
- ...this.config,
165
- featureFlags: {
166
- ...this.config.featureFlags,
167
- ...flags
168
- }
169
- });
170
- }
171
- /**
172
- * Defines how to derive list of upstream references this block is meant to enrich with its exports from block args.
173
- * Influences dependency graph construction.
174
- */
175
- enriches(lambda) {
176
- require_internal.tryRegisterCallback("enrichmentTargets", lambda);
177
- return new BlockModel({
178
- ...this.config,
179
- enrichmentTargets: {
180
- __renderLambda: true,
181
- handle: "enrichmentTargets"
182
- }
183
- });
184
- }
185
- /** Renders all provided block settings into a pre-configured platforma API
186
- * instance, that can be used in frontend to interact with block state, and
187
- * other features provided by the platforma to the block. */
188
- done(apiVersion = 1) {
189
- return this.withFeatureFlags({
190
- ...this.config.featureFlags,
191
- requiresUIAPIVersion: apiVersion
192
- }).#done();
193
- }
194
- #done() {
195
- if (this.config.initialArgs === void 0) throw new Error("Initial arguments not set.");
196
- const config = {
197
- v4: void 0,
198
- v3: {
199
- configVersion: 3,
200
- modelAPIVersion: 1,
201
- sdkVersion: require_version.PlatformaSDKVersion,
202
- renderingMode: this.config.renderingMode,
203
- initialArgs: this.config.initialArgs,
204
- initialUiState: this.config.initialUiState,
205
- inputsValid: this.config.inputsValid,
206
- sections: this.config.sections,
207
- title: this.config.title,
208
- subtitle: this.config.subtitle,
209
- tags: this.config.tags,
210
- outputs: this.config.outputs,
211
- enrichmentTargets: this.config.enrichmentTargets,
212
- featureFlags: this.config.featureFlags
213
- },
214
- sdkVersion: require_version.PlatformaSDKVersion,
215
- renderingMode: this.config.renderingMode,
216
- initialArgs: this.config.initialArgs,
217
- inputsValid: require_normalization.downgradeCfgOrLambda(this.config.inputsValid),
218
- sections: require_normalization.downgradeCfgOrLambda(this.config.sections),
219
- outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, require_normalization.downgradeCfgOrLambda(value)]))
220
- };
221
- globalThis.platformaApiVersion = this.config.featureFlags.requiresUIAPIVersion;
222
- if (!require_internal.isInUI()) return { config };
223
- else return {
224
- ...require_internal.getPlatformaInstance({
225
- sdkVersion: require_version.PlatformaSDKVersion,
226
- apiVersion: platformaApiVersion
227
- }),
228
- blockModelInfo: {
229
- outputs: Object.fromEntries(Object.entries(this.config.outputs).map(([key, value]) => [key, { withStatus: Boolean(require_types.isConfigLambda(value) && value.withStatus) }])),
230
- pluginIds: [],
231
- featureFlags: this.config.featureFlags,
232
- pluginPublicOutputs: {}
233
- }
234
- };
235
- }
236
- };
237
- //#endregion
238
- exports.BlockModel = BlockModel;
239
-
240
- //# sourceMappingURL=block_model_legacy.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block_model_legacy.cjs","names":["REQUIRES_PFRAMES_VERSION","getImmediate","RenderCtxLegacy","#done","PlatformaSDKVersion","downgradeCfgOrLambda","isInUI","getPlatformaInstance","isConfigLambda"],"sources":["../src/block_model_legacy.ts"],"sourcesContent":["import type {\n BlockRenderingMode,\n BlockSection,\n AnyFunction,\n PlRef,\n BlockCodeKnownFeatureFlags,\n BlockConfigContainer,\n} from \"@milaboratories/pl-model-common\";\nimport { REQUIRES_PFRAMES_VERSION } 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, RenderFunctionLegacy } from \"./render\";\nimport { RenderCtxLegacy } from \"./render\";\nimport { PlatformaSDKVersion } from \"./version\";\nimport type {\n TypedConfigOrConfigLambda,\n ConfigRenderLambda,\n StdCtxArgsOnly,\n DeriveHref,\n ConfigRenderLambdaFlags,\n InferOutputsFromConfigs,\n} from \"./bconfig\";\nimport { downgradeCfgOrLambda, isConfigLambda } from \"./bconfig\";\nimport type { PlatformaExtended } from \"./platforma\";\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\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\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 supportsPframeQueryRanking: true,\n requiresUIAPIVersion: 1,\n requiresModelAPIVersion: 1,\n requiresCreatePTable: 2,\n requiresPFramesVersion: REQUIRES_PFRAMES_VERSION,\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 RenderFunctionLegacy<Args, UiState>>(\n key: Key,\n rf: RF,\n flags: ConfigRenderLambdaFlags & { withStatus: true },\n ): BlockModel<\n Args,\n OutputsCfg & {\n [K in Key]: ConfigRenderLambda<InferRenderFunctionReturn<RF>> & { withStatus: true };\n },\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 RenderFunctionLegacy<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 RenderCtxLegacy()));\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<\n const Key extends string,\n const RF extends RenderFunctionLegacy<Args, UiState>,\n >(key: Key, rf: RF) {\n return this.output(key, rf, { retentive: true });\n }\n\n /** Shortcut for {@link output} with withStatus flag set to true. */\n public outputWithStatus<\n const Key extends string,\n const RF extends RenderFunctionLegacy<Args, UiState>,\n >(key: Key, rf: RF) {\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<\n const Key extends string,\n const RF extends RenderFunctionLegacy<Args, UiState>,\n >(key: Key, rf: RF) {\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 RenderFunctionLegacy<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 RenderCtxLegacy()));\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 RenderFunctionLegacy<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 RenderCtxLegacy()));\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: RenderFunctionLegacy<Args, UiState, string>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback(\"title\", () => rf(new RenderCtxLegacy()));\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: RenderFunctionLegacy<Args, UiState, string>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback(\"subtitle\", () => rf(new RenderCtxLegacy()));\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: RenderFunctionLegacy<Args, UiState, string[]>,\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n tryRegisterCallback(\"tags\", () => rf(new RenderCtxLegacy()));\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>(\n initialUiState: UiState,\n ): 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(\n flags: Partial<BlockCodeKnownFeatureFlags>,\n ): 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(lambda: (args: Args) => PlRef[]): 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(\n apiVersion?: 1,\n ): PlatformaExtended<\n PlatformaV1<Args, InferOutputsFromConfigs<Args, OutputsCfg, UiState>, UiState, Href>\n >;\n\n public done(\n apiVersion: 2,\n ): PlatformaExtended<\n PlatformaV2<Args, InferOutputsFromConfigs<Args, OutputsCfg, UiState>, UiState, 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(\n apiVersion: PlatformaApiVersion = 1,\n ): PlatformaExtended<\n Platforma<Args, InferOutputsFromConfigs<Args, OutputsCfg, UiState>, UiState, Href>\n > {\n return this.withFeatureFlags({\n ...this.config.featureFlags,\n requiresUIAPIVersion: apiVersion,\n }).#done();\n }\n\n #done(): PlatformaExtended<\n Platforma<Args, InferOutputsFromConfigs<Args, OutputsCfg, UiState>, UiState, Href>\n > {\n if (this.config.initialArgs === undefined) throw new Error(\"Initial arguments not set.\");\n\n const config: BlockConfigContainer = {\n v4: undefined,\n v3: {\n configVersion: 3,\n modelAPIVersion: 1,\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]) => [\n key,\n downgradeCfgOrLambda(value),\n ]),\n ),\n };\n\n globalThis.platformaApiVersion = this.config.featureFlags\n .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 } else {\n // normal operation inside the UI\n return {\n ...getPlatformaInstance({\n sdkVersion: PlatformaSDKVersion,\n apiVersion: platformaApiVersion,\n }),\n blockModelInfo: {\n outputs: Object.fromEntries(\n Object.entries(this.config.outputs).map(([key, value]) => [\n key,\n {\n withStatus: Boolean(isConfigLambda(value) && value.withStatus),\n },\n ]),\n ),\n pluginIds: [],\n featureFlags: this.config.featureFlags,\n pluginPublicOutputs: {},\n },\n };\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA8CA,IAAa,aAAb,MAAa,WAKX;CAEU;CADV,YACE,QAaA;EAbQ,KAAA,SAAA;CAaP;CAEH,WAAkB,8BAA0D;EAC1E,OAAO;GACL,mBAAmB;GACnB,4BAA4B;GAC5B,sBAAsB;GACtB,yBAAyB;GACzB,sBAAsB;GACtB,wBAAwBA,gCAAAA;EAC1B;CACF;CAgBA,OAAc,OAAO,gBAAoC,SAAqC;EAC5F,OAAO,IAAI,WAA2B;GACpC;GACA,gBAAgB,CAAC;GACjB,SAAS,CAAC;GACV,aAAaC,gBAAAA,aAAa,IAAI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