@platforma-sdk/model 1.2.22 → 1.2.23

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 (67) hide show
  1. package/README.md +3 -0
  2. package/dist/block_api.d.ts +62 -0
  3. package/dist/block_api.d.ts.map +1 -0
  4. package/dist/block_state_patch.d.ts +5 -0
  5. package/dist/block_state_patch.d.ts.map +1 -0
  6. package/dist/block_state_util.d.ts +16 -0
  7. package/dist/block_state_util.d.ts.map +1 -0
  8. package/dist/branding.d.ts +7 -0
  9. package/dist/branding.d.ts.map +1 -0
  10. package/dist/builder.d.ts +111 -0
  11. package/dist/builder.d.ts.map +1 -0
  12. package/dist/components/PlDataTable.d.ts +36 -0
  13. package/dist/components/PlDataTable.d.ts.map +1 -0
  14. package/dist/components/index.d.ts +2 -0
  15. package/dist/components/index.d.ts.map +1 -0
  16. package/dist/config/actions.d.ts +45 -0
  17. package/dist/config/actions.d.ts.map +1 -0
  18. package/dist/config/actions_kinds.d.ts +114 -0
  19. package/dist/config/actions_kinds.d.ts.map +1 -0
  20. package/dist/config/index.d.ts +7 -0
  21. package/dist/config/index.d.ts.map +1 -0
  22. package/dist/config/model.d.ts +116 -0
  23. package/dist/config/model.d.ts.map +1 -0
  24. package/dist/config/model_meta.d.ts +6 -0
  25. package/dist/config/model_meta.d.ts.map +1 -0
  26. package/dist/config/type_engine.d.ts +36 -0
  27. package/dist/config/type_engine.d.ts.map +1 -0
  28. package/dist/config/type_util.d.ts +12 -0
  29. package/dist/config/type_util.d.ts.map +1 -0
  30. package/dist/index.d.ts +13 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +1 -727
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +697 -0
  35. package/dist/index.mjs.map +1 -0
  36. package/dist/internal.d.ts +19 -0
  37. package/dist/internal.d.ts.map +1 -0
  38. package/dist/pframe.d.ts +11 -0
  39. package/dist/pframe.d.ts.map +1 -0
  40. package/dist/platforma.d.ts +18 -0
  41. package/dist/platforma.d.ts.map +1 -0
  42. package/dist/ref_util.d.ts +15 -0
  43. package/dist/ref_util.d.ts.map +1 -0
  44. package/dist/render/accessor.d.ts +71 -0
  45. package/dist/render/accessor.d.ts.map +1 -0
  46. package/dist/render/api.d.ts +48 -0
  47. package/dist/render/api.d.ts.map +1 -0
  48. package/dist/render/future.d.ts +13 -0
  49. package/dist/render/future.d.ts.map +1 -0
  50. package/dist/render/index.d.ts +6 -0
  51. package/dist/render/index.d.ts.map +1 -0
  52. package/dist/render/internal.d.ts +53 -0
  53. package/dist/render/internal.d.ts.map +1 -0
  54. package/dist/render/traversal_ops.d.ts +46 -0
  55. package/dist/render/traversal_ops.d.ts.map +1 -0
  56. package/dist/sdk_info.d.ts +5 -0
  57. package/dist/sdk_info.d.ts.map +1 -0
  58. package/dist/unionize.d.ts +12 -0
  59. package/dist/unionize.d.ts.map +1 -0
  60. package/dist/version.d.ts +2 -0
  61. package/dist/version.d.ts.map +1 -0
  62. package/package.json +11 -11
  63. package/src/config/index.ts +1 -1
  64. package/src/render/index.ts +1 -1
  65. package/src/version.ts +1 -1
  66. package/dist/index.cjs +0 -779
  67. package/dist/index.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/block_state_util.ts","../src/config/actions.ts","../src/internal.ts","../src/render/future.ts","../src/render/accessor.ts","../src/render/internal.ts","../src/render/api.ts","../src/version.ts","../src/builder.ts","../src/pframe.ts","../src/ref_util.ts","../src/sdk_info.ts"],"sourcesContent":["import { BlockOutputsBase, ValueOrErrors } from '@milaboratories/pl-model-common';\n\nexport class OutputError extends Error {\n constructor(\n public readonly errors: string[],\n public readonly moreErrors: boolean\n ) {\n super(`${errors.length}${moreErrors ? '+' : ''} errors, first error: ` + errors[0]);\n }\n}\n\nexport function readOutput<T>(outputValue: ValueOrErrors<T>): T {\n if (!outputValue.ok) throw new OutputError(outputValue.errors, outputValue.moreErrors);\n return outputValue.value;\n}\n\ntype ExtractValueType<V extends ValueOrErrors<unknown>> = Extract<V, { ok: true }>['value'];\ntype SimpleOutputs<Outputs extends BlockOutputsBase> = {\n [Key in keyof Outputs]: ExtractValueType<Outputs[Key]>;\n};\n\nexport function wrapOutputs<Outputs extends BlockOutputsBase>(\n outputs: Outputs\n): SimpleOutputs<Outputs> {\n return new Proxy(outputs, {\n get(target, key: string) {\n return readOutput(target[key]);\n }\n }) as SimpleOutputs<Outputs>;\n}\n","import {\n ActGetField,\n ActGetFromCtx,\n ActGetImmediate,\n ActGetResourceField,\n ActGetResourceValueAsJson,\n ActMakeObject,\n ActMapRecordValues,\n ActMapResourceFields,\n ActMapArrayValues,\n ActIsEmpty,\n ActNot,\n ActIsolate,\n ActGetBlobContentAsJson,\n ActGetBlobContentAsString,\n ActGetBlobContent,\n ActAnd,\n ActOr,\n ActMakeArray,\n ActFlatten,\n ActGetDownloadedBlobContent,\n ActGetOnDemandBlobContent,\n ActImportProgress,\n ActGetLastLogs,\n ActGetProgressLog,\n ActGetLogHandle\n} from './actions_kinds';\nimport { ExtractAction, POCExtractAction, PrimitiveOrConfig, TypedConfig } from './type_engine';\nimport { Cfg } from './model';\nimport { CheckedSyncConf } from './type_util';\n\n//\n// Helpers\n//\n\nfunction primitiveToConfig(value: PrimitiveOrConfig): TypedConfig {\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n value === null\n )\n return getImmediate(value);\n else return value as TypedConfig;\n}\n\n//\n// Context\n//\n\nexport function getFromCfg<const V extends string>(variable: V): TypedConfig<ActGetFromCtx<V>> {\n return { type: 'GetFromCtx', variable } as Cfg as any;\n}\n\n//\n// Isolate\n//\n\nexport function isolate<const Config extends TypedConfig>(\n cfg: Config\n): TypedConfig<ActIsolate<ExtractAction<Config>>> {\n return {\n type: 'Isolate',\n cfg\n } as Cfg as any;\n}\n\n//\n// Well-known Context Vars\n//\n\nexport const Args = getFromCfg('$args');\nexport const It = getFromCfg('$it');\nexport const MainOutputs = getFromCfg('$prod');\nexport const StagingOutputs = getFromCfg('$staging');\nexport const UiState = getFromCfg('$ui');\n\n//\n// Json\n//\n\nexport function getImmediate<const T>(value: T): TypedConfig<ActGetImmediate<T>> {\n return { type: 'Immediate', value } as Cfg as any;\n}\n\nexport function makeObject<const T extends Record<string, PrimitiveOrConfig>>(\n template: T\n): TypedConfig<ActMakeObject<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: Record<string, TypedConfig> = {};\n for (const [k, cfg] of Object.entries(template)) normalizedTemplate[k] = primitiveToConfig(cfg);\n return {\n type: 'MakeObject',\n template: normalizedTemplate\n } as Cfg as any;\n}\n\nexport function makeArray<const T extends PrimitiveOrConfig[]>(\n ...template: T\n): TypedConfig<ActMakeArray<{ [Key in keyof T]: POCExtractAction<T[Key]> }>> {\n const normalizedTemplate: TypedConfig[] = [];\n for (const cfg of template) normalizedTemplate.push(primitiveToConfig(cfg));\n return {\n type: 'MakeArray',\n template: normalizedTemplate\n } as Cfg as any;\n}\n\nexport function getJsonField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig\n>(\n source: Source,\n field: Field\n): TypedConfig<ActGetField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: 'GetJsonField',\n source: primitiveToConfig(source),\n field: primitiveToConfig(field)\n } as Cfg as any;\n}\n\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, '$it'>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, '$it'>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapRecordValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = '$it' as ItVar\n): TypedConfig<ActMapRecordValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: 'MapRecordValues',\n source,\n mapping,\n itVar\n } as Cfg as any;\n}\n\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, '$it'>>;\nexport function mapArrayValues<const Source extends TypedConfig, const Mapping extends TypedConfig>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, '$it'>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source & CheckedSyncConf<Source>,\n mapping: Mapping,\n itVar: ItVar\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping & CheckedSyncConf<Mapping>,\n itVar: ItVar\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapArrayValues<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = '$it' as ItVar\n): TypedConfig<ActMapArrayValues<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: 'MapArrayValues',\n source,\n mapping,\n itVar\n } as Cfg as any;\n}\n\nexport function flatten<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActFlatten<ExtractAction<Source>>> {\n return {\n type: 'Flatten',\n source\n } as Cfg as any;\n}\n\n//\n// Boolean\n//\n\nexport function isEmpty<const Arg extends TypedConfig>(\n arg: Arg\n): TypedConfig<ActIsEmpty<ExtractAction<Arg>>> {\n return {\n type: 'IsEmpty',\n arg\n } as Cfg as any;\n}\n\nexport function not<const Operand extends TypedConfig>(\n operand: Operand\n): TypedConfig<ActNot<ExtractAction<Operand>>> {\n return {\n type: 'Not',\n operand\n } as Cfg as any;\n}\n\nexport function and<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2\n): TypedConfig<ActAnd<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: 'And',\n operand1,\n operand2\n } as Cfg as any;\n}\n\nexport function or<const Operand1 extends TypedConfig, const Operand2 extends TypedConfig>(\n operand1: Operand1,\n operand2: Operand2\n): TypedConfig<ActOr<ExtractAction<Operand1>, ExtractAction<Operand2>>> {\n return {\n type: 'Or',\n operand1,\n operand2\n } as Cfg as any;\n}\n\n//\n// Resources\n//\n\nexport function getResourceField<\n const Source extends PrimitiveOrConfig,\n const Field extends PrimitiveOrConfig\n>(\n source: Source,\n field: Field\n): TypedConfig<ActGetResourceField<POCExtractAction<Source>, POCExtractAction<Field>>> {\n return {\n type: 'GetResourceField',\n source: primitiveToConfig(source),\n field: primitiveToConfig(field)\n } as Cfg as any;\n}\n\nexport function getResourceValueAsJson<T>() {\n return function <const Source extends PrimitiveOrConfig>(\n source: Source\n ): TypedConfig<ActGetResourceValueAsJson<POCExtractAction<Source>, T>> {\n return {\n type: 'GetResourceValueAsJson',\n source: primitiveToConfig(source)\n } as Cfg as any;\n };\n}\n\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig\n>(\n source: Source,\n mapping: Mapping\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, '$it'>>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>>;\nexport function mapResourceFields<\n const Source extends TypedConfig,\n const Mapping extends TypedConfig,\n const ItVar extends string\n>(\n source: Source,\n mapping: Mapping,\n itVar: ItVar = '$it' as ItVar\n): TypedConfig<ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>> {\n return {\n type: 'MapResourceFields',\n source,\n mapping,\n itVar\n } as Cfg as TypedConfig<\n ActMapResourceFields<ExtractAction<Source>, ExtractAction<Mapping>, ItVar>\n >;\n}\n\n//\n// Download Blobs\n//\n\nexport function getBlobContent<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActGetBlobContent<ExtractAction<Source>>> {\n return {\n type: 'GetBlobContent',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n\nexport function getBlobContentAsString<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActGetBlobContentAsString<ExtractAction<Source>>> {\n return {\n type: 'GetBlobContentAsString',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n\nexport function getBlobContentAsJson<T>() {\n return function <const Source extends TypedConfig>(\n source: Source\n ): TypedConfig<ActGetBlobContentAsJson<ExtractAction<Source>, T>> {\n return {\n type: 'GetBlobContentAsJson',\n source: primitiveToConfig(source)\n } as Cfg as any;\n };\n}\n\nexport function getDownloadedBlobContent<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActGetDownloadedBlobContent<ExtractAction<Source>>> {\n return {\n type: 'GetDownloadedBlobContent',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n\nexport function getOnDemandBlobContent<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActGetOnDemandBlobContent<ExtractAction<Source>>> {\n return {\n type: 'GetOnDemandBlobContent',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n\n//\n// Upload Blobs\n//\n\nexport function getImportProgress<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActImportProgress<ExtractAction<Source>>> {\n return {\n type: 'GetImportProgress',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n\n//\n// Logs\n//\n\nexport function getLastLogs<const Source extends TypedConfig>(\n source: Source,\n lines: number\n): TypedConfig<ActGetLastLogs<ExtractAction<Source>>> {\n return {\n type: 'GetLastLogs',\n source: primitiveToConfig(source),\n lines\n } as Cfg as any;\n}\n\nexport function getProgressLog<const Source extends TypedConfig>(\n source: Source,\n patternToSearch: string\n): TypedConfig<ActGetProgressLog<ExtractAction<Source>>> {\n return {\n type: 'GetProgressLog',\n source: primitiveToConfig(source),\n patternToSearch\n } as Cfg as any;\n}\n\nexport function getLogHandle<const Source extends TypedConfig>(\n source: Source\n): TypedConfig<ActGetLogHandle<ExtractAction<Source>>> {\n return {\n type: 'GetLogHandle',\n source: primitiveToConfig(source)\n } as Cfg as any;\n}\n","import { Platforma, PlatformaFactory } from './platforma';\nimport { BlockConfig } from './builder';\nimport { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\ndeclare global {\n /** Global factory method returning platforma instance */\n const getPlatforma: PlatformaFactory;\n const platforma: Platforma;\n\n /** Global rendering context, present only in rendering environment */\n const cfgRenderCtx: GlobalCfgRenderCtx;\n}\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return typeof getPlatforma !== 'undefined' || typeof platforma !== 'undefined';\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance(config: BlockConfig): Platforma {\n if (typeof getPlatforma === 'function') return getPlatforma(config);\n else if (typeof platforma !== 'undefined') return platforma;\n else throw new Error(\"Can't get platforma instance.\");\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof cfgRenderCtx !== 'undefined') return cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof cfgRenderCtx !== 'undefined') return 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","import { FutureAwait, FutureHandle } from './internal';\nimport { registerFutureAwait } from '../internal';\n\nexport class FutureRef<T = unknown> {\n private isResolved = false;\n private resolvedValue?: T;\n\n constructor(\n private readonly handle: FutureHandle,\n private readonly postProcess: (value: unknown) => T = (v) => v as T\n ) {\n registerFutureAwait(handle, (value) => {\n this.resolvedValue = postProcess(value);\n this.isResolved = true;\n });\n }\n\n public map<R>(mapping: (v: T) => R): FutureRef<R> {\n return new FutureRef<R>(this.handle, (v) => mapping(this.postProcess(v)));\n }\n\n public mapDefined<R>(mapping: (v: NonNullable<T>) => R): FutureRef<R | undefined> {\n return new FutureRef<R | undefined>(this.handle, (v) => {\n const vv = this.postProcess(v);\n return vv ? mapping(vv) : undefined;\n });\n }\n\n toJSON(): any {\n return this.isResolved\n ? this.resolvedValue\n : ({ __awaited_futures__: [this.handle] } as FutureAwait);\n }\n}\n\nexport type ExtractFutureRefType<Ref extends FutureRef> =\n Ref extends FutureRef<infer T> ? T : never;\n","import {\n AnyLogHandle,\n ImportProgress,\n LocalBlobHandleAndSize,\n PColumn,\n PObject,\n RemoteBlobHandleAndSize,\n isPColumn,\n mapPObjectData\n} from '@milaboratories/pl-model-common';\nimport { getCfgRenderCtx } from '../internal';\nimport { FutureRef } from './future';\nimport { AccessorHandle } from './internal';\nimport { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';\n\nfunction ifDef<T, R>(value: T | undefined, cb: (value: T) => R): R | undefined {\n return value === undefined ? undefined : cb(value);\n}\n\nfunction wrapBuffer(buf: ArrayBuffer | undefined): Uint8Array | undefined {\n return buf === undefined ? undefined : new Uint8Array(buf);\n}\n\nfunction wrapAccessor(handle: AccessorHandle | undefined): TreeNodeAccessor | undefined {\n return handle === undefined ? undefined : new TreeNodeAccessor(handle);\n}\n\n/** Represent resource tree node accessor */\nexport class TreeNodeAccessor {\n constructor(public readonly handle: AccessorHandle) {}\n\n public resolve(\n ...steps: [\n Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {\n errorIfFieldNotAssigned: true;\n }\n ]\n ): TreeNodeAccessor;\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;\n public resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined {\n return this.resolveWithCommon({}, ...steps);\n }\n\n public resolveWithCommon(\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): TreeNodeAccessor | undefined {\n return wrapAccessor(getCfgRenderCtx().resolveWithCommon(this.handle, commonOptions, ...steps));\n }\n\n public get resourceType(): ResourceType {\n return getCfgRenderCtx().getResourceType(this.handle);\n }\n\n public getInputsLocked(): boolean {\n return getCfgRenderCtx().getInputsLocked(this.handle);\n }\n\n public getOutputsLocked(): boolean {\n return getCfgRenderCtx().getOutputsLocked(this.handle);\n }\n\n public getIsReadyOrError(): boolean {\n return getCfgRenderCtx().getIsReadyOrError(this.handle);\n }\n\n public getIsFinal(): boolean {\n return getCfgRenderCtx().getIsFinal(this.handle);\n }\n\n public getError(): TreeNodeAccessor | undefined {\n return wrapAccessor(getCfgRenderCtx().getError(this.handle));\n }\n\n public listInputFields(): string[] {\n return getCfgRenderCtx().listInputFields(this.handle);\n }\n\n public listOutputFields(): string[] {\n return getCfgRenderCtx().listOutputFields(this.handle);\n }\n\n public listDynamicFields(): string[] {\n return getCfgRenderCtx().listDynamicFields(this.handle);\n }\n\n public getKeyValueBase64(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueBase64(this.handle, key);\n }\n\n public getKeyValueAsString(key: string): string | undefined {\n return getCfgRenderCtx().getKeyValueAsString(this.handle, key);\n }\n\n public getKeyValueAsJson<T>(key: string): T {\n const content = this.getKeyValueAsString(key);\n if (content == undefined) throw new Error('Resource has no content.');\n return JSON.parse(content);\n }\n\n public getDataBase64(): string | undefined {\n return getCfgRenderCtx().getDataBase64(this.handle);\n }\n\n public getDataAsString(): string | undefined {\n return getCfgRenderCtx().getDataAsString(this.handle);\n }\n\n public getDataAsJson<T>(): T {\n const content = this.getDataAsString();\n if (content == undefined) throw new Error('Resource has no content.');\n return JSON.parse(content);\n }\n\n /**\n *\n */\n public getPColumns(\n errorOnUnknownField: boolean = false,\n prefix: string = ''\n ): PColumn<TreeNodeAccessor>[] | undefined {\n const result = this.parsePObjectCollection(errorOnUnknownField, prefix);\n if (result === undefined) return undefined;\n\n const pf = Object.entries(result).map(([, obj]) => {\n if (!isPColumn(obj)) throw new Error(`not a PColumn (kind = ${obj.spec.kind})`);\n return obj;\n });\n\n return pf;\n }\n\n /**\n *\n */\n public parsePObjectCollection(\n errorOnUnknownField: boolean = false,\n prefix: string = ''\n ): Record<string, PObject<TreeNodeAccessor>> | undefined {\n const pObjects = getCfgRenderCtx().parsePObjectCollection(\n this.handle,\n errorOnUnknownField,\n prefix\n );\n if (pObjects === undefined) return undefined;\n const result: Record<string, PObject<TreeNodeAccessor>> = {};\n for (const [key, value] of Object.entries(pObjects))\n result[key] = mapPObjectData(value, (c) => new TreeNodeAccessor(c));\n return result;\n }\n\n public getFileContentAsBase64(): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsBase64(this.handle));\n }\n\n public getFileContentAsString(): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getBlobContentAsString(this.handle));\n }\n\n public getFileContentAsJson<T>(): FutureRef<T | undefined> {\n return new FutureRef<string | undefined>(\n getCfgRenderCtx().getBlobContentAsString(this.handle)\n ).mapDefined((v) => JSON.parse(v) as T);\n }\n\n /**\n * @deprecated use getFileContentAsBase64\n */\n public getBlobContentAsBase64(): FutureRef<string | undefined> {\n return this.getFileContentAsBase64();\n }\n\n /**\n * @deprecated use getFileContentAsString\n */\n public getBlobContentAsString(): FutureRef<string | undefined> {\n return this.getFileContentAsString();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getFileHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getDownloadedBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getFileHandle\n */\n public getDownloadedBlobHandle(): FutureRef<LocalBlobHandleAndSize | undefined> {\n return this.getFileHandle();\n }\n\n /**\n * @returns downloaded file handle\n */\n public getRemoteFileHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return new FutureRef(getCfgRenderCtx().getOnDemandBlobContentHandle(this.handle));\n }\n\n /**\n * @deprecated use getRemoteFileHandle\n */\n public getOnDemandBlobHandle(): FutureRef<RemoteBlobHandleAndSize | undefined> {\n return this.getRemoteFileHandle();\n }\n\n public getImportProgress(): FutureRef<ImportProgress> {\n return new FutureRef(getCfgRenderCtx().getImportProgress(this.handle));\n }\n\n public getLastLogs(nLines: number): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getLastLogs(this.handle, nLines));\n }\n\n public getProgressLog(patternToSearch: string): FutureRef<string | undefined> {\n return new FutureRef(getCfgRenderCtx().getProgressLog(this.handle, patternToSearch));\n }\n\n public getLogHandle(): FutureRef<AnyLogHandle | undefined> {\n return new FutureRef(getCfgRenderCtx().getLogHandle(this.handle));\n }\n}\n","import { Optional } from 'utility-types';\nimport { Branded } from '../branding';\nimport { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';\nimport {\n Option,\n PColumn,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableHandle,\n ResultCollection,\n ValueOrError\n} from '@milaboratories/pl-model-common';\n\nexport const StagingAccessorName = 'staging';\nexport const MainAccessorName = 'main';\n\nexport type AccessorHandle = Branded<string, 'AccessorHandle'>;\nexport type FutureHandle = Branded<string, 'FutureHandle'>;\n\nexport interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {\n //\n // Root accessor creation\n //\n\n getAccessorHandleByName(name: string): AHandle | undefined;\n\n //\n // Basic resource accessor actions\n //\n\n resolveWithCommon(\n handle: AHandle,\n commonOptions: CommonFieldTraverseOps,\n ...steps: (FieldTraversalStep | string)[]\n ): AHandle | undefined;\n\n getResourceType(handle: AHandle): ResourceType;\n\n getInputsLocked(handle: AHandle): boolean;\n\n getOutputsLocked(handle: AHandle): boolean;\n\n getIsReadyOrError(handle: AHandle): boolean;\n\n getIsFinal(handle: AHandle): boolean;\n\n getError(handle: AHandle): AHandle | undefined;\n\n listInputFields(handle: AHandle): string[];\n\n listOutputFields(handle: AHandle): string[];\n\n listDynamicFields(handle: AHandle): string[];\n\n getKeyValueBase64(handle: AHandle, key: string): string | undefined;\n\n getKeyValueAsString(handle: AHandle, key: string): string | undefined;\n\n getDataBase64(handle: AHandle): string | undefined;\n\n getDataAsString(handle: AHandle): string | undefined;\n\n /** If not final returns undefined */\n parsePObjectCollection(\n handle: AHandle,\n errorOnUnknownField: boolean,\n prefix: string\n ): Record<string, PObject<AHandle>> | undefined;\n\n //\n // Blob\n //\n\n getBlobContentAsBase64(handle: AHandle): FHandle; // string | undefined\n\n getBlobContentAsString(handle: AHandle): FHandle; // string | undefined\n\n getDownloadedBlobContentHandle(handle: AHandle): FHandle; // LocalBlobHandleAndSize | undefined;\n\n getOnDemandBlobContentHandle(handle: AHandle): FHandle; // RemoteBlobHandleAndSize | undefined;\n\n //\n // Import progress\n //\n\n getImportProgress(handle: AHandle): FHandle; // ImportProgress;\n\n //\n // Logs\n //\n\n getLastLogs(handle: AHandle, nLines: number): FHandle; // string | undefined;\n\n getProgressLog(handle: AHandle, patternToSearch: string): FHandle; // string | undefined;\n\n getLogHandle(handle: AHandle): FHandle; // AnyLogHandle | undefined;\n\n //\n // Blocks\n //\n\n getBlockLabel(blockId: string): string;\n\n //\n // Result Pool\n //\n\n getDataFromResultPool(): ResultCollection<PObject<AHandle>>;\n\n getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<AHandle, string>>, 'id'>\n >;\n\n getSpecsFromResultPool(): ResultCollection<PObjectSpec>;\n\n calculateOptions(predicate: PSpecPredicate): Option[];\n\n //\n // PFrame / PTable\n //\n\n createPFrame(def: PFrameDef<AHandle>): PFrameHandle;\n\n createPTable(def: PTableDef<PColumn<AHandle>>): PTableHandle;\n}\n\nexport interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {\n readonly args: string;\n readonly uiState?: string;\n readonly callbackRegistry: Record<string, Function>;\n}\n\nexport type FutureAwait = {\n __awaited_futures__: FutureHandle[];\n};\n\nexport function isFutureAwait(obj: unknown): obj is FutureAwait {\n return typeof obj === 'object' && obj !== null && '__awaited_futures__' in obj;\n}\n\nfunction addAllFutureAwaits(set: Set<string>, visited: Set<unknown>, node: unknown) {\n if (visited.has(node)) return;\n visited.add(node);\n\n const type = typeof node;\n if (type === 'object') {\n if (isFutureAwait(node)) node.__awaited_futures__.forEach((a) => set.add(a));\n else if (Array.isArray(node))\n for (const nested of node) addAllFutureAwaits(set, visited, nested);\n else\n for (const [, nested] of Object.entries(node as object))\n if (nested !== node) addAllFutureAwaits(set, visited, nested);\n }\n}\n\nexport function getAllFutureAwaits(obj: unknown): Set<string> {\n const set = new Set<string>();\n addAllFutureAwaits(set, new Set(), obj);\n return set;\n}\n","import {\n Option,\n PColumn,\n PFrameDef,\n PFrameHandle,\n PObject,\n PObjectSpec,\n PSpecPredicate,\n PTableDef,\n PTableHandle,\n PTableRecordFilter,\n PTableSorting,\n ResultCollection,\n ValueOrError,\n mapPObjectData,\n mapPTableDef,\n mapValueInVOE\n} from '@milaboratories/pl-model-common';\nimport { Optional } from 'utility-types';\nimport { getCfgRenderCtx } from '../internal';\nimport { TreeNodeAccessor } from './accessor';\nimport { FutureRef } from './future';\nimport { GlobalCfgRenderCtx, MainAccessorName, StagingAccessorName } from './internal';\n\nexport class ResultPool {\n private readonly ctx: GlobalCfgRenderCtx = getCfgRenderCtx();\n\n public calculateOptions(predicate: PSpecPredicate): Option[] {\n return this.ctx.calculateOptions(predicate);\n }\n\n public getDataFromResultPool(): ResultCollection<PObject<TreeNodeAccessor>> {\n const result = this.ctx.getDataFromResultPool();\n return {\n isComplete: result.isComplete,\n entries: result.entries.map((e) => ({\n ref: e.ref,\n obj: {\n ...e.obj,\n data: new TreeNodeAccessor(e.obj.data)\n }\n }))\n };\n }\n\n public getDataWithErrorsFromResultPool(): ResultCollection<\n Optional<PObject<ValueOrError<TreeNodeAccessor, string>>, 'id'>\n > {\n const result = this.ctx.getDataWithErrorsFromResultPool();\n return {\n isComplete: result.isComplete,\n entries: result.entries.map((e) => ({\n ref: e.ref,\n obj: {\n ...e.obj,\n data: mapValueInVOE(e.obj.data, (handle) => new TreeNodeAccessor(handle))\n }\n }))\n };\n }\n\n public getSpecsFromResultPool(): ResultCollection<PObjectSpec> {\n return this.ctx.getSpecsFromResultPool();\n }\n}\n\nexport class RenderCtx<Args, UiState> {\n private readonly ctx: GlobalCfgRenderCtx;\n\n public readonly args: Args;\n public readonly uiState: UiState | undefined;\n\n constructor() {\n this.ctx = getCfgRenderCtx();\n this.args = JSON.parse(this.ctx.args);\n this.uiState = this.ctx.uiState !== undefined ? JSON.parse(this.ctx.uiState) : undefined;\n }\n\n private getNamedAccessor(name: string): TreeNodeAccessor | undefined {\n const accessorId = this.ctx.getAccessorHandleByName(name);\n return accessorId ? new TreeNodeAccessor(accessorId) : undefined;\n }\n\n public get prerun(): TreeNodeAccessor | undefined {\n return this.getNamedAccessor(StagingAccessorName);\n }\n\n /**\n * @deprecated use prerun\n */\n public get precalc(): TreeNodeAccessor | undefined {\n return this.prerun;\n }\n\n /**\n * @deprecated use prerun\n */\n public get stagingOutput(): TreeNodeAccessor | undefined {\n return this.precalc;\n }\n\n public get outputs(): TreeNodeAccessor | undefined {\n return this.getNamedAccessor(MainAccessorName);\n }\n\n /**\n * @deprecated use outputs\n */\n public get mainOutput(): TreeNodeAccessor | undefined {\n return this.outputs;\n }\n\n public readonly resultPool = new ResultPool();\n\n public createPFrame(def: PFrameDef<TreeNodeAccessor>): PFrameHandle {\n return this.ctx.createPFrame(def.map((c) => mapPObjectData(c, (d) => d.handle)));\n }\n\n public createPTable(def: PTableDef<PColumn<TreeNodeAccessor>>): PTableHandle;\n public createPTable(def: {\n columns: PColumn<TreeNodeAccessor>[];\n filters?: PTableRecordFilter[];\n /** Table sorting */\n sorting?: PTableSorting[];\n }): PTableHandle;\n public createPTable(\n def:\n | PTableDef<PColumn<TreeNodeAccessor>>\n | {\n columns: PColumn<TreeNodeAccessor>[];\n filters?: PTableRecordFilter[];\n /** Table sorting */\n sorting?: PTableSorting[];\n }\n ): PTableHandle {\n var rawDef: PTableDef<PColumn<TreeNodeAccessor>>;\n if ('columns' in def) {\n rawDef = {\n src: {\n type: 'inner',\n entries: def.columns.map((c) => ({ type: 'column', column: c }))\n },\n filters: def.filters ?? [],\n sorting: def.sorting ?? []\n };\n } else {\n rawDef = def;\n }\n return this.ctx.createPTable(mapPTableDef(rawDef, (po) => mapPObjectData(po, (d) => d.handle)));\n }\n\n public getBlockLabel(blockId: string): string {\n return this.ctx.getBlockLabel(blockId);\n }\n}\n\nexport type RenderFunction<Args = unknown, UiState = unknown, Ret = unknown> = (\n rCtx: RenderCtx<Args, UiState>\n) => Ret;\n\nexport type UnwrapFutureRef<K> =\n K extends FutureRef<infer T>\n ? T\n : K extends bigint | boolean | null | number | string | symbol | undefined\n ? K\n : { [key in keyof K]: UnwrapFutureRef<K[key]> };\n\nexport type InferRenderFunctionReturn<RF extends Function> = RF extends (...args: any) => infer R\n ? UnwrapFutureRef<R>\n : never;\n","export const PlatformaSDKVersion = '1.2.23';\n","import { BlockRenderingMode, BlockSection, ValueOrErrors } from '@milaboratories/pl-model-common';\nimport { Checked, ConfigResult, getImmediate, PlResourceEntry, TypedConfig } from './config';\nimport { getPlatformaInstance, isInUI, tryRegisterCallback } from './internal';\nimport { Platforma } from './platforma';\nimport { InferRenderFunctionReturn, RenderCtx, RenderFunction } from './render';\nimport { PlatformaSDKVersion } from './version';\n\ntype StdCtxArgsOnly<Args, UiState = undefined> = {\n readonly $blockId: string;\n readonly $args: Args;\n readonly $ui: UiState;\n};\n\nexport type StdCtx<Args, UiState = undefined> = StdCtxArgsOnly<Args, UiState> & {\n readonly $prod: PlResourceEntry;\n readonly $staging: PlResourceEntry;\n};\n\nexport type ResolveCfgType<Cfg extends TypedConfig, Args, UiState = undefined> = ConfigResult<\n Cfg,\n StdCtx<Args, UiState>\n>;\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 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\ntype InputsValidRFChecked<RF extends Function> = Checked<\n RF,\n InferRenderFunctionReturn<RF> extends InputsValidExpectedType ? true : false\n>;\n\nexport type Code = {\n type: 'plain';\n content: string;\n};\n\n/** Field key to attach ConfAction information to a config type. */\ndeclare const __function_handle__: unique symbol;\n\n/** Creates branded Cfg type */\nexport type FunctionHandle<Return = unknown> = string & { [__function_handle__]: Return };\n\nexport type ExtractFunctionHandleReturn<Func extends FunctionHandle> =\n Func[typeof __function_handle__];\n\nexport type TypedConfigOrFunctionHandle = TypedConfig | FunctionHandle;\n\nexport function isFunctionHandle(cfgOrFh: TypedConfigOrFunctionHandle): cfgOrFh is FunctionHandle {\n return typeof cfgOrFh === 'string';\n}\n\ntype OnlyString<S> = S extends string ? S : '';\n\n// prettier-ignore\nexport type DeriveHref<S> = S extends readonly BlockSection[]\n ? OnlyString<Extract<S[number], { type: 'link' }>['href']>\n : never;\n\n/** This structure is rendered from the configuration, type can accommodate any\n * version of config structure. */\nexport type BlockConfigUniversal<\n Args = unknown,\n Outputs extends Record<string, TypedConfigOrFunctionHandle> = Record<\n string,\n TypedConfigOrFunctionHandle\n >\n> = {\n /** SDK version used by the block */\n readonly sdkVersion: string;\n\n /** Main rendering mode for the block */\n readonly renderingMode: BlockRenderingMode;\n\n /** Initial value for the args when block is added to the project */\n readonly initialArgs: Args;\n\n /** @deprecated */\n readonly canRun?: TypedConfigOrFunctionHandle;\n\n /**\n * Config to determine whether the block can be executed with current\n * arguments.\n *\n * Optional to support earlier SDK version configs.\n * */\n readonly inputsValid?: TypedConfigOrFunctionHandle;\n\n /** Configuration to derive list of section for the left overview panel */\n readonly sections: TypedConfigOrFunctionHandle;\n\n /** Configuration for the output cells */\n readonly outputs: Outputs;\n\n /** Config code bundle */\n readonly code?: Code;\n};\n\n/** This structure is rendered from the configuration */\nexport type BlockConfig<\n Args = unknown,\n Outputs extends Record<string, TypedConfigOrFunctionHandle> = Record<\n string,\n TypedConfigOrFunctionHandle\n >\n> = Required<Omit<BlockConfigUniversal<Args, Outputs>, 'canRun' | 'code'>> &\n Pick<BlockConfigUniversal<Args, Outputs>, 'code'>;\n\n/** Takes universal config, and converts it into latest structure */\nexport function normalizeBlockConfig<\n Args,\n Outputs extends Record<string, TypedConfigOrFunctionHandle>\n>(cfg: BlockConfigUniversal<Args, Outputs>): BlockConfig<Args, Outputs> {\n if (cfg.inputsValid !== undefined) return cfg as BlockConfig<Args, Outputs>;\n else {\n if (cfg.canRun === undefined)\n throw new Error(`Malformed config, SDK version ${cfg.sdkVersion}`);\n const latest = { ...cfg, inputsValid: cfg.canRun };\n delete latest['canRun'];\n return latest;\n }\n}\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, TypedConfigOrFunctionHandle>,\n UiState,\n Href extends `/${string}` = '/'\n> {\n private constructor(\n private readonly _renderingMode: BlockRenderingMode,\n private readonly _initialArgs: Args | undefined,\n private readonly _outputs: OutputsCfg,\n private readonly _inputsValid: TypedConfigOrFunctionHandle,\n private readonly _sections: TypedConfigOrFunctionHandle\n ) { }\n\n /** Initiates configuration builder */\n public static create<Args, UiState = undefined>(\n renderingMode: BlockRenderingMode\n ): BlockModel<Args, {}, UiState> {\n return new BlockModel<Args, {}, UiState>(\n renderingMode,\n undefined,\n {},\n getImmediate(true),\n getImmediate([])\n );\n }\n\n /**\n * Add output cell to the configuration\n *\n * @param key cell name, that can be used to retrieve the rendered value\n * @param cfg configuration describing how to render cell value from the blocks\n * workflow outputs\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 public output<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]: FunctionHandle<InferRenderFunctionReturn<RF>> },\n UiState,\n Href\n >;\n public output(\n key: string,\n cfgOrRf: TypedConfig | Function\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n if (typeof cfgOrRf === 'function') {\n const functionHandle = `output#${key}` as FunctionHandle;\n tryRegisterCallback(functionHandle, () => cfgOrRf(new RenderCtx()));\n return new BlockModel(\n this._renderingMode,\n this._initialArgs,\n {\n ...this._outputs,\n [key]: functionHandle\n },\n this._inputsValid,\n this._sections\n );\n } else\n return new BlockModel(\n this._renderingMode,\n this._initialArgs,\n {\n ...this._outputs,\n [key]: cfgOrRf\n },\n this._inputsValid,\n this._sections\n );\n }\n\n /** @deprecated */\n public canRun<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href> {\n return this.inputsValid(cfg as any);\n }\n\n /** Sets custom configuration predicate on the block args at which block can be executed */\n public inputsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public inputsValid<RF extends RenderFunction<Args, UiState, boolean>>(\n rf: RF\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public inputsValid(\n cfgOrRf: TypedConfig | Function\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._outputs,\n 'inputsValid' as FunctionHandle,\n this._sections\n );\n } else\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._outputs,\n cfgOrRf,\n this._sections\n );\n }\n\n /** Sets the config to generate list of section in the left block overviews panel */\n public sections<const S extends SectionsExpectedType,>(rf: S): BlockModel<Args, OutputsCfg, UiState, DeriveHref<S>>;\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 | Function\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._outputs,\n this._inputsValid,\n 'sections' as FunctionHandle\n );\n } else\n return new BlockModel<Args, OutputsCfg, UiState>(\n this._renderingMode,\n this._initialArgs,\n this._outputs,\n this._inputsValid,\n arrOrCfgOrRf as TypedConfig\n );\n }\n\n\n /** Sets initial args for the block, this value must be specified. */\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._outputs,\n this._inputsValid,\n this._sections\n );\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(): 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: BlockConfig<Args, OutputsCfg> = {\n sdkVersion: PlatformaSDKVersion,\n renderingMode: this._renderingMode,\n initialArgs: this._initialArgs,\n inputsValid: this._inputsValid,\n sections: this._sections,\n outputs: this._outputs\n };\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(config) as any;\n }\n}\n\nexport type InferOutputType<CfgOrFH, Args, UiState> = CfgOrFH extends TypedConfig\n ? ResolveCfgType<CfgOrFH, Args, UiState>\n : CfgOrFH extends FunctionHandle\n ? ExtractFunctionHandleReturn<CfgOrFH>\n : never;\n\ntype InferOutputsFromConfigs<\n Args,\n OutputsCfg extends Record<string, TypedConfigOrFunctionHandle>,\n UiState\n> = {\n [Key in keyof OutputsCfg]: ValueOrErrors<InferOutputType<OutputsCfg[Key], Args, UiState>>;\n};\n","import {\n CalculateTableDataRequest,\n CalculateTableDataResponse,\n FindColumnsRequest,\n FindColumnsResponse,\n PColumnIdAndSpec,\n PColumnSpec,\n PFrame,\n PFrameHandle,\n PObjectId,\n UniqueValuesRequest,\n UniqueValuesResponse\n} from '@milaboratories/pl-model-common';\n\nexport class PFrameImpl implements PFrame {\n constructor(private readonly handle: PFrameHandle) {}\n\n public async findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse> {\n return await platforma.pFrameDriver.findColumns(this.handle, request);\n }\n\n public async getColumnSpec(columnId: PObjectId): Promise<PColumnSpec> {\n return await platforma.pFrameDriver.getColumnSpec(this.handle, columnId);\n }\n\n public async listColumns(): Promise<PColumnIdAndSpec[]> {\n return await platforma.pFrameDriver.listColumns(this.handle);\n }\n\n public async calculateTableData(\n request: CalculateTableDataRequest<PObjectId>\n ): Promise<CalculateTableDataResponse> {\n return await platforma.pFrameDriver.calculateTableData(this.handle, request);\n }\n\n public async getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse> {\n return await platforma.pFrameDriver.getUniqueValues(this.handle, request);\n }\n}\n","import { getJsonField, makeObject, TypedConfig } from './config';\n\nexport function fromPlRef<Source extends TypedConfig>(source: Source) {\n return makeObject({\n __isRef: true,\n blockId: getJsonField(source, 'blockId'),\n name: getJsonField(source, 'name')\n });\n}\n\nexport function fromPlOption<Source extends TypedConfig>(source: Source) {\n return makeObject({\n ref: fromPlRef(getJsonField(source, 'ref')),\n label: getJsonField(source, 'label')\n });\n}\n","import { PlatformaSDKVersion } from './version';\n\nexport type SdkInfo = {\n readonly sdkVersion: string;\n};\n\nexport const CurrentSdkInfo: SdkInfo = {\n sdkVersion: PlatformaSDKVersion\n};\n"],"names":["OutputError","errors","moreErrors","readOutput","outputValue","wrapOutputs","outputs","target","key","primitiveToConfig","value","getImmediate","getFromCfg","variable","isolate","cfg","Args","It","MainOutputs","StagingOutputs","UiState","makeObject","template","normalizedTemplate","k","makeArray","getJsonField","source","field","mapRecordValues","mapping","itVar","mapArrayValues","flatten","isEmpty","arg","not","operand","and","operand1","operand2","or","getResourceField","getResourceValueAsJson","mapResourceFields","getBlobContent","getBlobContentAsString","getBlobContentAsJson","getDownloadedBlobContent","getOnDemandBlobContent","getImportProgress","getLastLogs","lines","getProgressLog","patternToSearch","getLogHandle","isInUI","getPlatformaInstance","config","tryGetCfgRenderCtx","getCfgRenderCtx","tryRegisterCallback","callback","ctx","futureResolves","registerFutureAwait","handle","onResolve","res","FutureRef","postProcess","v","__publicField","vv","wrapAccessor","TreeNodeAccessor","steps","commonOptions","content","errorOnUnknownField","prefix","result","obj","isPColumn","pObjects","mapPObjectData","c","nLines","StagingAccessorName","MainAccessorName","isFutureAwait","addAllFutureAwaits","set","visited","node","a","nested","getAllFutureAwaits","ResultPool","predicate","e","mapValueInVOE","RenderCtx","name","accessorId","def","d","rawDef","mapPTableDef","po","blockId","PlatformaSDKVersion","isFunctionHandle","cfgOrFh","normalizeBlockConfig","latest","BlockModel","_renderingMode","_initialArgs","_outputs","_inputsValid","_sections","renderingMode","cfgOrRf","functionHandle","arrOrCfgOrRf","PFrameImpl","request","columnId","fromPlRef","fromPlOption","CurrentSdkInfo"],"mappings":";;;;;AAEO,MAAMA,UAAoB,MAAM;AAAA,EACrC,YACkBC,GACAC,GAChB;AACM,UAAA,GAAGD,EAAO,MAAM,GAAGC,IAAa,MAAM,EAAE,2BAA2BD,EAAO,CAAC,C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AA6B5D,GAAsB;AAAtB,SAAA,SAAAA;AAAA,EAAuB;AAAA,EAEpD,MAAa,YAAY6D,GAA2D;AAClF,WAAO,MAAM,UAAU,aAAa,YAAY,KAAK,QAAQA,CAAO;AAAA,EACtE;AAAA,EAEA,MAAa,cAAcC,GAA2C;AACpE,WAAO,MAAM,UAAU,aAAa,cAAc,KAAK,QAAQA,CAAQ;AAAA,EACzE;AAAA,EAEA,MAAa,cAA2C;AACtD,WAAO,MAAM,UAAU,aAAa,YAAY,KAAK,MAAM;AAAA,EAC7D;AAAA,EAEA,MAAa,mBACXD,GACqC;AACrC,WAAO,MAAM,UAAU,aAAa,mBAAmB,KAAK,QAAQA,CAAO;AAAA,EAC7E;AAAA,EAEA,MAAa,gBAAgBA,GAA6D;AACxF,WAAO,MAAM,UAAU,aAAa,gBAAgB,KAAK,QAAQA,CAAO;AAAA,EAC1E;AACF;ACpCO,SAASE,EAAsCtG,GAAgB;AACpE,SAAON,EAAW;AAAA,IAChB,SAAS;AAAA,IACT,SAASK,EAAaC,GAAQ,SAAS;AAAA,IACvC,MAAMD,EAAaC,GAAQ,MAAM;AAAA,EAAA,CAClC;AACH;AAEO,SAASuG,GAAyCvG,GAAgB;AACvE,SAAON,EAAW;AAAA,IAChB,KAAK4G,EAAUvG,EAAaC,GAAQ,KAAK,CAAC;AAAA,IAC1C,OAAOD,EAAaC,GAAQ,OAAO;AAAA,EAAA,CACpC;AACH;ACTO,MAAMwG,KAA0B;AAAA,EACrC,YAAYpB;AACd;"}
@@ -0,0 +1,19 @@
1
+ import { Platforma, PlatformaFactory } from './platforma';
2
+ import { BlockConfig } from './builder';
3
+ import { FutureHandle, GlobalCfgRenderCtx } from './render/internal';
4
+ declare global {
5
+ /** Global factory method returning platforma instance */
6
+ const getPlatforma: PlatformaFactory;
7
+ const platforma: Platforma;
8
+ /** Global rendering context, present only in rendering environment */
9
+ const cfgRenderCtx: GlobalCfgRenderCtx;
10
+ }
11
+ /** Utility code helping to identify whether the code is running in actual UI environment */
12
+ export declare function isInUI(): boolean;
13
+ /** Utility code helping to retrieve a platforma instance form the environment */
14
+ export declare function getPlatformaInstance(config: BlockConfig): Platforma;
15
+ export declare function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined;
16
+ export declare function getCfgRenderCtx(): GlobalCfgRenderCtx;
17
+ export declare function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean;
18
+ export declare function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void): void;
19
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAErE,OAAO,CAAC,MAAM,CAAC;IACb,yDAAyD;IACzD,MAAM,YAAY,EAAE,gBAAgB,CAAC;IACrC,MAAM,SAAS,EAAE,SAAS,CAAC;IAE3B,sEAAsE;IACtE,MAAM,YAAY,EAAE,kBAAkB,CAAC;CACxC;AAED,4FAA4F;AAC5F,wBAAgB,MAAM,YAErB;AAED,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAInE;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"}
@@ -0,0 +1,11 @@
1
+ import { CalculateTableDataRequest, CalculateTableDataResponse, FindColumnsRequest, FindColumnsResponse, PColumnIdAndSpec, PColumnSpec, PFrame, PFrameHandle, PObjectId, UniqueValuesRequest, UniqueValuesResponse } from '@milaboratories/pl-model-common';
2
+ export declare class PFrameImpl implements PFrame {
3
+ private readonly handle;
4
+ constructor(handle: PFrameHandle);
5
+ findColumns(request: FindColumnsRequest): Promise<FindColumnsResponse>;
6
+ getColumnSpec(columnId: PObjectId): Promise<PColumnSpec>;
7
+ listColumns(): Promise<PColumnIdAndSpec[]>;
8
+ calculateTableData(request: CalculateTableDataRequest<PObjectId>): Promise<CalculateTableDataResponse>;
9
+ getUniqueValues(request: UniqueValuesRequest): Promise<UniqueValuesResponse>;
10
+ }
11
+ //# sourceMappingURL=pframe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pframe.d.ts","sourceRoot":"","sources":["../src/pframe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,YAAY,EACZ,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,UAAW,YAAW,MAAM;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,YAAY;IAEpC,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAItE,aAAa,CAAC,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxD,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI1C,kBAAkB,CAC7B,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC;IAIzB,eAAe,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG1F"}
@@ -0,0 +1,18 @@
1
+ import { BlockApi } from './block_api';
2
+ import { BlockOutputsBase, BlockState, DriverKit, ValueOrErrors } from '@milaboratories/pl-model-common';
3
+ import { BlockConfig } from './builder';
4
+ import { SdkInfo } from './sdk_info';
5
+ import { BlockStatePatch } from './block_state_patch';
6
+ /** Defines all methods to interact with the platform environment from within a block UI. */
7
+ export interface Platforma<Args = unknown, Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>, UiState = unknown, Href extends `/${string}` = `/${string}`> extends BlockApi<Args, Outputs, UiState, Href>, DriverKit {
8
+ /** Information about SDK version current platforma environment was compiled with. */
9
+ readonly sdkInfo: SdkInfo;
10
+ }
11
+ export type InferArgsType<Pl extends Platforma> = Pl extends Platforma<infer Args> ? Args : never;
12
+ export type InferOutputsType<Pl extends Platforma> = Pl extends Platforma<unknown, infer Outputs> ? Outputs : never;
13
+ export type InferUiState<Pl extends Platforma> = Pl extends Platforma<unknown, Record<string, ValueOrErrors<unknown>>, infer UiState> ? UiState : never;
14
+ export type InferHrefType<Pl extends Platforma> = Pl extends Platforma<unknown, BlockOutputsBase, unknown, infer Href> ? Href : never;
15
+ export type PlatformaFactory = (config: BlockConfig) => Platforma;
16
+ export type InferBlockState<Pl extends Platforma> = BlockState<InferArgsType<Pl>, InferOutputsType<Pl>, InferUiState<Pl>, InferHrefType<Pl>>;
17
+ export type InferBlockStatePatch<Pl extends Platforma> = BlockStatePatch<InferArgsType<Pl>, InferOutputsType<Pl>, InferUiState<Pl>, InferHrefType<Pl>>;
18
+ //# sourceMappingURL=platforma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforma.d.ts","sourceRoot":"","sources":["../src/platforma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACz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AAgB,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,SAAS,CAAC;AAElE,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,SAAS,IAAI,UAAU,CAC5D,aAAa,CAAC,EAAE,CAAC,EACjB,gBAAgB,CAAC,EAAE,CAAC,EACpB,YAAY,CAAC,EAAE,CAAC,EAChB,aAAa,CAAC,EAAE,CAAC,CAClB,CAAC;AAEF,MAAM,MAAM,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"}
@@ -0,0 +1,15 @@
1
+ import { TypedConfig } from './config';
2
+ export declare function fromPlRef<Source extends TypedConfig>(source: Source): TypedConfig<import('./config').ActMakeObject<{
3
+ readonly __isRef: import('./config').ActGetImmediate<true>;
4
+ readonly blockId: import('./config').ActGetField<import('./config').POCExtractAction<Source>, import('./config').ActGetImmediate<"blockId">>;
5
+ readonly name: import('./config').ActGetField<import('./config').POCExtractAction<Source>, import('./config').ActGetImmediate<"name">>;
6
+ }>>;
7
+ export declare function fromPlOption<Source extends TypedConfig>(source: Source): TypedConfig<import('./config').ActMakeObject<{
8
+ readonly ref: import('./config').ActMakeObject<{
9
+ readonly __isRef: import('./config').ActGetImmediate<true>;
10
+ readonly blockId: import('./config').ActGetField<import('./config').ActGetField<import('./config').POCExtractAction<Source>, import('./config').ActGetImmediate<"ref">>, import('./config').ActGetImmediate<"blockId">>;
11
+ readonly name: import('./config').ActGetField<import('./config').ActGetField<import('./config').POCExtractAction<Source>, import('./config').ActGetImmediate<"ref">>, import('./config').ActGetImmediate<"name">>;
12
+ }>;
13
+ readonly label: import('./config').ActGetField<import('./config').POCExtractAction<Source>, import('./config').ActGetImmediate<"label">>;
14
+ }>>;
15
+ //# sourceMappingURL=ref_util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ref_util.d.ts","sourceRoot":"","sources":["../src/ref_util.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,WAAW,EAAE,MAAM,UAAU,CAAC;AAEjE,wBAAgB,SAAS,CAAC,MAAM,SAAS,WAAW,EAAE,MAAM,EAAE,MAAM;;;;IAMnE;AAED,wBAAgB,YAAY,CAAC,MAAM,SAAS,WAAW,EAAE,MAAM,EAAE,MAAM;;;;;;;IAKtE"}
@@ -0,0 +1,71 @@
1
+ import { AnyLogHandle, ImportProgress, LocalBlobHandleAndSize, PColumn, PObject, RemoteBlobHandleAndSize } from '@milaboratories/pl-model-common';
2
+ import { FutureRef } from './future';
3
+ import { AccessorHandle } from './internal';
4
+ import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
5
+ /** Represent resource tree node accessor */
6
+ export declare class TreeNodeAccessor {
7
+ readonly handle: AccessorHandle;
8
+ constructor(handle: AccessorHandle);
9
+ resolve(...steps: [
10
+ Omit<FieldTraversalStep, 'errorIfFieldNotSet'> & {
11
+ errorIfFieldNotAssigned: true;
12
+ }
13
+ ]): TreeNodeAccessor;
14
+ resolve(...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;
15
+ resolveWithCommon(commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): TreeNodeAccessor | undefined;
16
+ get resourceType(): ResourceType;
17
+ getInputsLocked(): boolean;
18
+ getOutputsLocked(): boolean;
19
+ getIsReadyOrError(): boolean;
20
+ getIsFinal(): boolean;
21
+ getError(): TreeNodeAccessor | undefined;
22
+ listInputFields(): string[];
23
+ listOutputFields(): string[];
24
+ listDynamicFields(): string[];
25
+ getKeyValueBase64(key: string): string | undefined;
26
+ getKeyValueAsString(key: string): string | undefined;
27
+ getKeyValueAsJson<T>(key: string): T;
28
+ getDataBase64(): string | undefined;
29
+ getDataAsString(): string | undefined;
30
+ getDataAsJson<T>(): T;
31
+ /**
32
+ *
33
+ */
34
+ getPColumns(errorOnUnknownField?: boolean, prefix?: string): PColumn<TreeNodeAccessor>[] | undefined;
35
+ /**
36
+ *
37
+ */
38
+ parsePObjectCollection(errorOnUnknownField?: boolean, prefix?: string): Record<string, PObject<TreeNodeAccessor>> | undefined;
39
+ getFileContentAsBase64(): FutureRef<string | undefined>;
40
+ getFileContentAsString(): FutureRef<string | undefined>;
41
+ getFileContentAsJson<T>(): FutureRef<T | undefined>;
42
+ /**
43
+ * @deprecated use getFileContentAsBase64
44
+ */
45
+ getBlobContentAsBase64(): FutureRef<string | undefined>;
46
+ /**
47
+ * @deprecated use getFileContentAsString
48
+ */
49
+ getBlobContentAsString(): FutureRef<string | undefined>;
50
+ /**
51
+ * @returns downloaded file handle
52
+ */
53
+ getFileHandle(): FutureRef<LocalBlobHandleAndSize | undefined>;
54
+ /**
55
+ * @deprecated use getFileHandle
56
+ */
57
+ getDownloadedBlobHandle(): FutureRef<LocalBlobHandleAndSize | undefined>;
58
+ /**
59
+ * @returns downloaded file handle
60
+ */
61
+ getRemoteFileHandle(): FutureRef<RemoteBlobHandleAndSize | undefined>;
62
+ /**
63
+ * @deprecated use getRemoteFileHandle
64
+ */
65
+ getOnDemandBlobHandle(): FutureRef<RemoteBlobHandleAndSize | undefined>;
66
+ getImportProgress(): FutureRef<ImportProgress>;
67
+ getLastLogs(nLines: number): FutureRef<string | undefined>;
68
+ getProgressLog(patternToSearch: string): FutureRef<string | undefined>;
69
+ getLogHandle(): FutureRef<AnyLogHandle | undefined>;
70
+ }
71
+ //# sourceMappingURL=accessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessor.d.ts","sourceRoot":"","sources":["../../src/render/accessor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,uBAAuB,EAGxB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAA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AW,GAClB,OAAO,CAAC,gBAAgB,CAAC,EAAE,GAAG,SAAS;IAY1C;;OAEG;IACI,sBAAsB,CAC3B,mBAAmB,GAAE,OAAe,EACpC,MAAM,GAAE,MAAW,GAClB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,SAAS;IAajD,sBAAsB,IAAI,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAIvD,sBAAsB,IAAI,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAIvD,oBAAoB,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;IAM1D;;OAEG;IACI,sBAAsB,IAAI,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9D;;OAEG;IACI,sBAAsB,IAAI,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAI9D;;OAEG;IACI,aAAa,IAAI,SAAS,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAIrE;;OAEG;IACI,uBAAuB,IAAI,SAAS,CAAC,sBAAsB,GAAG,SAAS,CAAC;IAI/E;;OAEG;IACI,mBAAmB,IAAI,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC;IAI5E;;OAEG;IACI,qBAAqB,IAAI,SAAS,CAAC,uBAAuB,GAAG,SAAS,CAAC;IAIvE,iBAAiB,IAAI,SAAS,CAAC,cAAc,CAAC;IAI9C,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAI1D,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC;IAItE,YAAY,IAAI,SAAS,CAAC,YAAY,GAAG,SAAS,CAAC;CAG3D"}
@@ -0,0 +1,48 @@
1
+ import { Option, PColumn, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableHandle, PTableRecordFilter, PTableSorting, ResultCollection, ValueOrError } from '@milaboratories/pl-model-common';
2
+ import { Optional } from 'utility-types';
3
+ import { TreeNodeAccessor } from './accessor';
4
+ import { FutureRef } from './future';
5
+ export declare class ResultPool {
6
+ private readonly ctx;
7
+ calculateOptions(predicate: PSpecPredicate): Option[];
8
+ getDataFromResultPool(): ResultCollection<PObject<TreeNodeAccessor>>;
9
+ getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<TreeNodeAccessor, string>>, 'id'>>;
10
+ getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
11
+ }
12
+ export declare class RenderCtx<Args, UiState> {
13
+ private readonly ctx;
14
+ readonly args: Args;
15
+ readonly uiState: UiState | undefined;
16
+ constructor();
17
+ private getNamedAccessor;
18
+ get prerun(): TreeNodeAccessor | undefined;
19
+ /**
20
+ * @deprecated use prerun
21
+ */
22
+ get precalc(): TreeNodeAccessor | undefined;
23
+ /**
24
+ * @deprecated use prerun
25
+ */
26
+ get stagingOutput(): TreeNodeAccessor | undefined;
27
+ get outputs(): TreeNodeAccessor | undefined;
28
+ /**
29
+ * @deprecated use outputs
30
+ */
31
+ get mainOutput(): TreeNodeAccessor | undefined;
32
+ readonly resultPool: ResultPool;
33
+ createPFrame(def: PFrameDef<TreeNodeAccessor>): PFrameHandle;
34
+ createPTable(def: PTableDef<PColumn<TreeNodeAccessor>>): PTableHandle;
35
+ createPTable(def: {
36
+ columns: PColumn<TreeNodeAccessor>[];
37
+ filters?: PTableRecordFilter[];
38
+ /** Table sorting */
39
+ sorting?: PTableSorting[];
40
+ }): PTableHandle;
41
+ getBlockLabel(blockId: string): string;
42
+ }
43
+ export type RenderFunction<Args = unknown, UiState = unknown, Ret = unknown> = (rCtx: RenderCtx<Args, UiState>) => Ret;
44
+ export type UnwrapFutureRef<K> = K extends FutureRef<infer T> ? T : K extends bigint | boolean | null | number | string | symbol | undefined ? K : {
45
+ [key in keyof K]: UnwrapFutureRef<K[key]>;
46
+ };
47
+ export type InferRenderFunctionReturn<RF extends Function> = RF extends (...args: any) => infer R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 import { FutureHandle } from './internal';
2
+ export declare class FutureRef<T = unknown> {
3
+ private readonly handle;
4
+ private readonly postProcess;
5
+ private isResolved;
6
+ private resolvedValue?;
7
+ constructor(handle: FutureHandle, postProcess?: (value: unknown) => T);
8
+ map<R>(mapping: (v: T) => R): FutureRef<R>;
9
+ mapDefined<R>(mapping: (v: NonNullable<T>) => R): FutureRef<R | undefined>;
10
+ toJSON(): any;
11
+ }
12
+ export type ExtractFutureRefType<Ref extends FutureRef> = Ref extends FutureRef<infer T> ? T : never;
13
+ //# sourceMappingURL=future.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"future.d.ts","sourceRoot":"","sources":["../../src/render/future.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,YAAY,CAAC;AAGvD,qBAAa,SAAS,CAAC,CAAC,GAAG,OAAO;IAK9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAL9B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAC,CAAI;gBAGP,MAAM,EAAE,YAAY,EACpB,WAAW,GAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAiB;IAQ9D,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;IAI1C,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,CAAC;IAOjF,MAAM,IAAI,GAAG;CAKd;AAED,MAAM,MAAM,oBAAoB,CAAC,GAAG,SAAS,SAAS,IACpD,GAAG,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './api';
2
+ export * from './traversal_ops';
3
+ export * from './accessor';
4
+ export { type ExtractFutureRefType } from './future';
5
+ export { FutureRef } from './future';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/render/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { Optional } from 'utility-types';
2
+ import { Branded } from '../branding';
3
+ import { CommonFieldTraverseOps, FieldTraversalStep, ResourceType } from './traversal_ops';
4
+ import { Option, PColumn, PFrameDef, PFrameHandle, PObject, PObjectSpec, PSpecPredicate, PTableDef, PTableHandle, ResultCollection, ValueOrError } from '@milaboratories/pl-model-common';
5
+ export declare const StagingAccessorName = "staging";
6
+ export declare const MainAccessorName = "main";
7
+ export type AccessorHandle = Branded<string, 'AccessorHandle'>;
8
+ export type FutureHandle = Branded<string, 'FutureHandle'>;
9
+ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = FutureHandle> {
10
+ getAccessorHandleByName(name: string): AHandle | undefined;
11
+ resolveWithCommon(handle: AHandle, commonOptions: CommonFieldTraverseOps, ...steps: (FieldTraversalStep | string)[]): AHandle | undefined;
12
+ getResourceType(handle: AHandle): ResourceType;
13
+ getInputsLocked(handle: AHandle): boolean;
14
+ getOutputsLocked(handle: AHandle): boolean;
15
+ getIsReadyOrError(handle: AHandle): boolean;
16
+ getIsFinal(handle: AHandle): boolean;
17
+ getError(handle: AHandle): AHandle | undefined;
18
+ listInputFields(handle: AHandle): string[];
19
+ listOutputFields(handle: AHandle): string[];
20
+ listDynamicFields(handle: AHandle): string[];
21
+ getKeyValueBase64(handle: AHandle, key: string): string | undefined;
22
+ getKeyValueAsString(handle: AHandle, key: string): string | undefined;
23
+ getDataBase64(handle: AHandle): string | undefined;
24
+ getDataAsString(handle: AHandle): string | undefined;
25
+ /** If not final returns undefined */
26
+ parsePObjectCollection(handle: AHandle, errorOnUnknownField: boolean, prefix: string): Record<string, PObject<AHandle>> | undefined;
27
+ getBlobContentAsBase64(handle: AHandle): FHandle;
28
+ getBlobContentAsString(handle: AHandle): FHandle;
29
+ getDownloadedBlobContentHandle(handle: AHandle): FHandle;
30
+ getOnDemandBlobContentHandle(handle: AHandle): FHandle;
31
+ getImportProgress(handle: AHandle): FHandle;
32
+ getLastLogs(handle: AHandle, nLines: number): FHandle;
33
+ getProgressLog(handle: AHandle, patternToSearch: string): FHandle;
34
+ getLogHandle(handle: AHandle): FHandle;
35
+ getBlockLabel(blockId: string): string;
36
+ getDataFromResultPool(): ResultCollection<PObject<AHandle>>;
37
+ getDataWithErrorsFromResultPool(): ResultCollection<Optional<PObject<ValueOrError<AHandle, string>>, 'id'>>;
38
+ getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
39
+ calculateOptions(predicate: PSpecPredicate): Option[];
40
+ createPFrame(def: PFrameDef<AHandle>): PFrameHandle;
41
+ createPTable(def: PTableDef<PColumn<AHandle>>): PTableHandle;
42
+ }
43
+ export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
44
+ readonly args: string;
45
+ readonly uiState?: string;
46
+ readonly callbackRegistry: Record<string, Function>;
47
+ }
48
+ export type FutureAwait = {
49
+ __awaited_futures__: FutureHandle[];
50
+ };
51
+ export declare function isFutureAwait(obj: unknown): obj is FutureAwait;
52
+ export declare function getAllFutureAwaits(obj: unknown): Set<string>;
53
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/render/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,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jD,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CACvD,CAAC;IAEF,sBAAsB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAExD,gBAAgB,CAAC,SAAS,EAAE,cAAc,GAAG,MAAM,EAAE,CAAC;IAMtD,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;IAEpD,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,YAAY,CAAC;CAC9D;AAED,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACrD;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,mBAAmB,EAAE,YAAY,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAE9D;AAiBD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAI5D"}
@@ -0,0 +1,46 @@
1
+ export type CommonTraversalOps = {
2
+ /**
3
+ * Don't terminate chain if current resource or field has an error associated
4
+ * with, by default resource or field error will be thrown. If field has error
5
+ * and no value, error will be thrown anyway, because this is the reason
6
+ * traversal is terminated.
7
+ * */
8
+ ignoreError?: true;
9
+ };
10
+ export type CommonFieldTraverseOps = {
11
+ /**
12
+ * Valid only if {@link assertFieldType} is defined and equal to 'Input',
13
+ * 'Service' or 'Output'. By default, if field is not found, and corresponding
14
+ * field list is locked, call will fail with exception.
15
+ * */
16
+ allowPermanentAbsence?: true;
17
+ /** Will not mark current context as unstable, if field is not found. */
18
+ stableIfNotFound?: true;
19
+ };
20
+ export type FieldType = 'Input' | 'Output' | 'Service' | 'OTW' | 'Dynamic' | 'MTW';
21
+ export interface ResourceType {
22
+ readonly name: string;
23
+ readonly version: string;
24
+ }
25
+ export type ResourceTraversalOps = CommonTraversalOps & {
26
+ /**
27
+ * Assert resource type of the resource the fields points to. Call will fail
28
+ * with exception if this assertion is not fulfilled.
29
+ * */
30
+ assertResourceType?: ResourceType | ResourceType[];
31
+ };
32
+ export type GetFieldStep = CommonFieldTraverseOps & {
33
+ /** Field name */
34
+ field: string;
35
+ /** Field must exist, if this option is set, instead error will be thrown */
36
+ errorIfFieldNotFound?: true;
37
+ /** Field must be assigned a value, if this option is set, instead error will be thrown */
38
+ errorIfFieldNotSet?: true;
39
+ /**
40
+ * Assert field type. Call will fail with exception if this assertion is not
41
+ * fulfilled
42
+ * */
43
+ assertFieldType?: FieldType;
44
+ };
45
+ export type FieldTraversalStep = GetFieldStep & ResourceTraversalOps;
46
+ //# sourceMappingURL=traversal_ops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"traversal_ops.d.ts","sourceRoot":"","sources":["../../src/render/traversal_ops.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;;;SAKK;IACL,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;;SAIK;IACL,qBAAqB,CAAC,EAAE,IAAI,CAAC;IAE7B,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,KAAK,CAAC;AAEnF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IACtD;;;SAGK;IACL,kBAAkB,CAAC,EAAE,YAAY,GAAG,YAAY,EAAE,CAAC;CACpD,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG;IAClD,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,IAAI,CAAC;IAE5B,0FAA0F;IAC1F,kBAAkB,CAAC,EAAE,IAAI,CAAC;IAE1B;;;SAGK;IACL,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type SdkInfo = {
2
+ readonly sdkVersion: string;
3
+ };
4
+ export declare const CurrentSdkInfo: SdkInfo;
5
+ //# sourceMappingURL=sdk_info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk_info.d.ts","sourceRoot":"","sources":["../src/sdk_info.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,OAE5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /** Patch for the structural object */
2
+ export type Patch<K, V> = {
3
+ /** Field name to patch */
4
+ readonly key: K;
5
+ /** New value for the field */
6
+ readonly value: V;
7
+ };
8
+ /** Creates union type of all possible shallow patches for the given structure */
9
+ export type Unionize<T extends Record<string, unknown>> = {
10
+ [K in keyof T]: Patch<K, T[K]>;
11
+ }[keyof T];
12
+ //# sourceMappingURL=unionize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unionize.d.ts","sourceRoot":"","sources":["../src/unionize.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI;IACxB,0BAA0B;IAC1B,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAChB,8BAA8B;IAC9B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;KACvD,CAAC,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/B,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const PlatformaSDKVersion = "1.2.23";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
2
  "name": "@platforma-sdk/model",
3
- "version": "1.2.22",
3
+ "version": "1.2.23",
4
4
  "description": "Platforma.bio SDK / Block Model",
5
- "type": "module",
6
5
  "exports": {
7
6
  ".": {
8
- "types": "./src/index.ts",
9
- "import": "./dist/index.js",
10
- "require": "./dist/index.cjs"
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.mjs",
9
+ "require": "./dist/index.js"
11
10
  }
12
11
  },
13
12
  "files": [
14
13
  "./dist/**/*",
15
- "./src/**/*"
14
+ "./src/**/*",
15
+ "README.md"
16
16
  ],
17
17
  "dependencies": {
18
18
  "utility-types": "^3.11.0",
19
19
  "zod": "^3.23.8",
20
- "@milaboratories/pl-model-common": "^1.3.9"
20
+ "@milaboratories/pl-model-common": "^1.3.10"
21
21
  },
22
22
  "devDependencies": {
23
+ "typescript": "~5.6.2",
24
+ "vite": "^5.4.7",
23
25
  "@types/jest": "^29.5.13",
24
26
  "jest": "^29.7.0",
25
27
  "ts-jest": "^29.2.5",
26
- "tsup": "~8.2.4",
27
- "typescript": "^5.6.2",
28
- "@milaboratories/platforma-build-configs": "1.0.0"
28
+ "@milaboratories/platforma-build-configs": "1.0.1"
29
29
  },
30
30
  "scripts": {
31
- "build": "node ./scripts/save-package-version.cjs && tsup",
32
31
  "type-check": "node ./scripts/save-package-version.cjs && tsc --noEmit --composite false",
32
+ "build": "node ./scripts/save-package-version.cjs && vite build",
33
33
  "test": "node ./scripts/save-package-version.cjs && jest"
34
34
  }
35
35
  }