@platforma-sdk/model 1.2.26 → 1.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.d.ts +6 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/components/PlDataTable.d.ts +1 -1
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -11
- package/dist/index.mjs.map +1 -1
- package/dist/ref_util.d.ts +11 -11
- package/dist/version.d.ts +1 -1
- package/package.json +3 -2
- package/src/builder.ts +19 -4
- package/src/components/PlDataTable.ts +1 -1
- package/src/version.ts +1 -0
package/dist/builder.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare class BlockModel<Args, OutputsCfg extends Record<string, TypedCon
|
|
|
73
73
|
private readonly _sections;
|
|
74
74
|
private constructor();
|
|
75
75
|
/** Initiates configuration builder */
|
|
76
|
-
static create<Args, UiState = undefined>(renderingMode
|
|
76
|
+
static create<Args, UiState = undefined>(renderingMode?: BlockRenderingMode): BlockModel<Args, {}, UiState>;
|
|
77
77
|
/**
|
|
78
78
|
* Add output cell to the configuration
|
|
79
79
|
*
|
|
@@ -90,7 +90,12 @@ export declare class BlockModel<Args, OutputsCfg extends Record<string, TypedCon
|
|
|
90
90
|
/** @deprecated */
|
|
91
91
|
canRun<Cfg extends TypedConfig>(cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
92
92
|
/** Sets custom configuration predicate on the block args at which block can be executed */
|
|
93
|
+
argsValid<Cfg extends TypedConfig>(cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
94
|
+
/** Sets custom configuration predicate on the block args at which block can be executed */
|
|
95
|
+
argsValid<RF extends RenderFunction<Args, UiState, boolean>>(rf: RF): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
96
|
+
/** @deprecated use argsValid() */
|
|
93
97
|
inputsValid<Cfg extends TypedConfig>(cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
98
|
+
/** @deprecated use argsValid() */
|
|
94
99
|
inputsValid<RF extends RenderFunction<Args, UiState, boolean>>(rf: RF): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
95
100
|
/** Sets the config to generate list of section in the left block overviews panel */
|
|
96
101
|
sections<const S extends SectionsExpectedType>(rf: S): BlockModel<Args, OutputsCfg, UiState, DeriveHref<S>>;
|
package/dist/builder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,YAAY,EAAgB,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE7F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAa,cAAc,EAAE,MAAM,UAAU,CAAC;AAGhF,KAAK,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,IAAI;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,IAAI,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG;IAC9E,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,GAAG,SAAS,WAAW,E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I,EAAE,OAAO,CAAC,GACtC,OAAO,SAAS,cAAc,GAC5B,2BAA2B,CAAC,OAAO,CAAC,GACpC,KAAK,CAAC;AAEZ,KAAK,uBAAuB,CAC1B,IAAI,EACJ,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,EAC9D,OAAO,IACL;KACD,GAAG,IAAI,MAAM,UAAU,GAAG,aAAa,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;CAC1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlDataTable.d.ts","sourceRoot":"","sources":["../../src/components/PlDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEpF,uBAAuB;AACvB,MAAM,MAAM,oBAAoB,GAAG;IACjC,+BAA+B;IAC/B,WAAW,CAAC,EAAE;QACZ,0BAA0B;QAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,kDAAkD;IAClD,IAAI,CAAC,EAAE;QACL,6CAA6C;QAC7C,SAAS,EAAE;YACT,sCAAsC;YACtC,KAAK,EAAE,MAAM,CAAC;YACd,qBAAqB;YACrB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;SACtB,EAAE,CAAC;KACL,CAAC;IAEF,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"PlDataTable.d.ts","sourceRoot":"","sources":["../../src/components/PlDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEpF,uBAAuB;AACvB,MAAM,MAAM,oBAAoB,GAAG;IACjC,+BAA+B;IAC/B,WAAW,CAAC,EAAE;QACZ,0BAA0B;QAC1B,aAAa,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;IACF,kDAAkD;IAClD,IAAI,CAAC,EAAE;QACL,6CAA6C;QAC7C,SAAS,EAAE;YACT,sCAAsC;YACtC,KAAK,EAAE,MAAM,CAAC;YACd,qBAAqB;YACrB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;SACtB,EAAE,CAAC;KACL,CAAC;IAEF,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CAC1C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAE7B,SAAS,EAAE,oBAAoB,CAAC;IAGhC,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var B=Object.defineProperty;var x=(e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var l=(e,t,n)=>x(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@milaboratories/pl-model-common");class F extends Error{constructor(t,n){super(`${t.length}${n?"+":""} errors, first error: `+t[0]),this.errors=t,this.moreErrors=n}}function P(e){if(!e.ok)throw new F(e.errors,e.moreErrors);return e.value}function L(e){return new Proxy(e,{get(t,n){return P(t[n])}})}function o(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null?h(e):e}function p(e){return{type:"GetFromCtx",variable:e}}function j(e){return{type:"Isolate",cfg:e}}const E=p("$args"),k=p("$it"),J=p("$prod"),H=p("$staging"),M=p("$ui");function h(e){return{type:"Immediate",value:e}}function A(e){const t={};for(const[n,r]of Object.entries(e))t[n]=o(r);return{type:"MakeObject",template:t}}function N(...e){const t=[];for(const n of e)t.push(o(n));return{type:"MakeArray",template:t}}function f(e,t){return{type:"GetJsonField",source:o(e),field:o(t)}}function G(e,t,n="$it"){return{type:"MapRecordValues",source:e,mapping:t,itVar:n}}function $(e,t,n="$it"){return{type:"MapArrayValues",source:e,mapping:t,itVar:n}}function T(e){return{type:"Flatten",source:e}}function K(e){return{type:"IsEmpty",arg:e}}function z(e){return{type:"Not",operand:e}}function U(e,t){return{type:"And",operand1:e,operand2:t}}function W(e,t){return{type:"Or",operand1:e,operand2:t}}function q(e,t){return{type:"GetResourceField",source:o(e),field:o(t)}}function Q(){return function(e){return{type:"GetResourceValueAsJson",source:o(e)}}}function X(e,t,n="$it"){return{type:"MapResourceFields",source:e,mapping:t,itVar:n}}function Y(e){return{type:"GetBlobContent",source:o(e)}}function Z(e){return{type:"GetBlobContentAsString",source:o(e)}}function tt(){return function(e){return{type:"GetBlobContentAsJson",source:o(e)}}}function et(e){return{type:"GetDownloadedBlobContent",source:o(e)}}function nt(e){return{type:"GetOnDemandBlobContent",source:o(e)}}function rt(e){return{type:"GetImportProgress",source:o(e)}}function st(e,t){return{type:"GetLastLogs",source:o(e),lines:t}}function ot(e,t){return{type:"GetProgressLog",source:o(e),patternToSearch:t}}function it(e){return{type:"GetLogHandle",source:o(e)}}function at(){return typeof getPlatforma<"u"||typeof platforma<"u"}function ut(e){if(typeof getPlatforma=="function")return getPlatforma(e);if(typeof platforma<"u")return platforma;throw new Error("Can't get platforma instance.")}function lt(){if(typeof cfgRenderCtx<"u")return cfgRenderCtx}function s(){if(typeof cfgRenderCtx<"u")return cfgRenderCtx;throw new Error("Not in config rendering context")}function y(e,t){const n=lt();if(n===void 0)return!1;if(e in n.callbackRegistry)throw new Error(`Callback with key ${e} already registered.`);return n.callbackRegistry[e]=t,!0}const w=new Map;function ct(e,t){e in s().callbackRegistry||(s().callbackRegistry[e]=n=>{for(const r of w.get(e))r(n)},w.set(e,[])),w.get(e).push(t)}class a{constructor(t,n=r=>r){l(this,"isResolved",!1);l(this,"resolvedValue");this.handle=t,this.postProcess=n,ct(t,r=>{this.resolvedValue=n(r),this.isResolved=!0})}map(t){return new a(this.handle,n=>t(this.postProcess(n)))}mapDefined(t){return new a(this.handle,n=>{const r=this.postProcess(n);return r?t(r):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function C(e){return e===void 0?void 0:new d(e)}class d{constructor(t){this.handle=t}resolve(...t){return this.resolveWithCommon({},...t)}resolveWithCommon(t,...n){return C(s().resolveWithCommon(this.handle,t,...n))}get resourceType(){return s().getResourceType(this.handle)}getInputsLocked(){return s().getInputsLocked(this.handle)}getOutputsLocked(){return s().getOutputsLocked(this.handle)}getIsReadyOrError(){return s().getIsReadyOrError(this.handle)}getIsFinal(){return s().getIsFinal(this.handle)}getError(){return C(s().getError(this.handle))}listInputFields(){return s().listInputFields(this.handle)}listOutputFields(){return s().listOutputFields(this.handle)}listDynamicFields(){return s().listDynamicFields(this.handle)}getKeyValueBase64(t){return s().getKeyValueBase64(this.handle,t)}getKeyValueAsString(t){return s().getKeyValueAsString(this.handle,t)}getKeyValueAsJson(t){const n=this.getKeyValueAsString(t);if(n==null)throw new Error("Resource has no content.");return JSON.parse(n)}getDataBase64(){return s().getDataBase64(this.handle)}getDataAsString(){return s().getDataAsString(this.handle)}getDataAsJson(){const t=this.getDataAsString();if(t==null)throw new Error("Resource has no content.");return JSON.parse(t)}getPColumns(t=!1,n=""){const r=this.parsePObjectCollection(t,n);return r===void 0?void 0:Object.entries(r).map(([,g])=>{if(!c.isPColumn(g))throw new Error(`not a PColumn (kind = ${g.spec.kind})`);return g})}parsePObjectCollection(t=!1,n=""){const r=s().parsePObjectCollection(this.handle,t,n);if(r===void 0)return;const i={};for(const[g,v]of Object.entries(r))i[g]=c.mapPObjectData(v,I=>new d(I));return i}getFileContentAsBase64(){return new a(s().getBlobContentAsBase64(this.handle))}getFileContentAsString(){return new a(s().getBlobContentAsString(this.handle))}getFileContentAsJson(){return new a(s().getBlobContentAsString(this.handle)).mapDefined(t=>JSON.parse(t))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new a(s().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new a(s().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}getImportProgress(){return new a(s().getImportProgress(this.handle))}getLastLogs(t){return new a(s().getLastLogs(this.handle,t))}getProgressLog(t){return new a(s().getProgressLog(this.handle,t))}getLogHandle(){return new a(s().getLogHandle(this.handle))}}const _="staging",O="main";function R(e){return typeof e=="object"&&e!==null&&"__awaited_futures__"in e}function b(e,t,n){if(t.has(n))return;if(t.add(n),typeof n==="object")if(R(n))n.__awaited_futures__.forEach(i=>e.add(i));else if(Array.isArray(n))for(const i of n)b(e,t,i);else for(const[,i]of Object.entries(n))i!==n&&b(e,t,i)}function gt(e){const t=new Set;return b(t,new Set,e),t}const dt=Object.freeze(Object.defineProperty({__proto__:null,MainAccessorName:O,StagingAccessorName:_,getAllFutureAwaits:gt,isFutureAwait:R},Symbol.toStringTag,{value:"Module"}));class S{constructor(){l(this,"ctx",s())}calculateOptions(t){return this.ctx.calculateOptions(t)}getDataFromResultPool(){const t=this.ctx.getDataFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:new d(n.obj.data)}}))}}getDataWithErrorsFromResultPool(){const t=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:c.mapValueInVOE(n.obj.data,r=>new d(r))}}))}}getSpecsFromResultPool(){return this.ctx.getSpecsFromResultPool()}}class m{constructor(){l(this,"ctx");l(this,"args");l(this,"uiState");l(this,"resultPool",new S);this.ctx=s(),this.args=JSON.parse(this.ctx.args),this.uiState=this.ctx.uiState!==void 0?JSON.parse(this.ctx.uiState):void 0}getNamedAccessor(t){const n=this.ctx.getAccessorHandleByName(t);return n?new d(n):void 0}get prerun(){return this.getNamedAccessor(_)}get precalc(){return this.prerun}get stagingOutput(){return this.precalc}get outputs(){return this.getNamedAccessor(O)}get mainOutput(){return this.outputs}createPFrame(t){return this.ctx.createPFrame(t.map(n=>c.mapPObjectData(n,r=>r.handle)))}createPTable(t){var n;return"columns"in t?n={src:{type:"inner",entries:t.columns.map(r=>({type:"column",column:r}))},filters:t.filters??[],sorting:t.sorting??[]}:n=t,this.ctx.createPTable(c.mapPTableDef(n,r=>c.mapPObjectData(r,i=>i.handle)))}getBlockLabel(t){return this.ctx.getBlockLabel(t)}}const D="1.2.26";function pt(e){return typeof e=="string"}function ht(e){if(e.inputsValid!==void 0)return e;{if(e.canRun===void 0)throw new Error(`Malformed config, SDK version ${e.sdkVersion}`);const t={...e,inputsValid:e.canRun};return delete t.canRun,t}}class u{constructor(t,n,r,i,g){this._renderingMode=t,this._initialArgs=n,this._outputs=r,this._inputsValid=i,this._sections=g}static create(t){return new u(t,void 0,{},h(!0),h([]))}output(t,n){if(typeof n=="function"){const r=`output#${t}`;return y(r,()=>n(new m)),new u(this._renderingMode,this._initialArgs,{...this._outputs,[t]:r},this._inputsValid,this._sections)}else return new u(this._renderingMode,this._initialArgs,{...this._outputs,[t]:n},this._inputsValid,this._sections)}canRun(t){return this.inputsValid(t)}inputsValid(t){return typeof t=="function"?(y("inputsValid",()=>t(new m)),new u(this._renderingMode,this._initialArgs,this._outputs,"inputsValid",this._sections)):new u(this._renderingMode,this._initialArgs,this._outputs,t,this._sections)}sections(t){return Array.isArray(t)?this.sections(h(t)):typeof t=="function"?(y("sections",()=>t(new m)),new u(this._renderingMode,this._initialArgs,this._outputs,this._inputsValid,"sections")):new u(this._renderingMode,this._initialArgs,this._outputs,this._inputsValid,t)}initialArgs(t){return new u(this._renderingMode,t,this._outputs,this._inputsValid,this._sections)}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const t={sdkVersion:D,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:this._inputsValid,sections:this._sections,outputs:this._outputs};return at()?ut(t):{config:t}}}class ft{constructor(t){this.handle=t}async findColumns(t){return await platforma.pFrameDriver.findColumns(this.handle,t)}async getColumnSpec(t){return await platforma.pFrameDriver.getColumnSpec(this.handle,t)}async listColumns(){return await platforma.pFrameDriver.listColumns(this.handle)}async calculateTableData(t){return await platforma.pFrameDriver.calculateTableData(this.handle,t)}async getUniqueValues(t){return await platforma.pFrameDriver.getUniqueValues(this.handle,t)}}function V(e){return A({__isRef:!0,blockId:f(e,"blockId"),name:f(e,"name")})}function mt(e){return A({ref:V(f(e,"ref")),label:f(e,"label")})}const yt={sdkVersion:D};exports.Args=E;exports.BlockModel=u;exports.CurrentSdkInfo=yt;exports.FutureRef=a;exports.It=k;exports.JsRenderInternal=dt;exports.MainOutputs=J;exports.OutputError=F;exports.PFrameImpl=ft;exports.RenderCtx=m;exports.ResultPool=S;exports.StagingOutputs=H;exports.TreeNodeAccessor=d;exports.UiState=M;exports.and=U;exports.flatten=T;exports.fromPlOption=mt;exports.fromPlRef=V;exports.getBlobContent=Y;exports.getBlobContentAsJson=tt;exports.getBlobContentAsString=Z;exports.getDownloadedBlobContent=et;exports.getFromCfg=p;exports.getImmediate=h;exports.getImportProgress=rt;exports.getJsonField=f;exports.getLastLogs=st;exports.getLogHandle=it;exports.getOnDemandBlobContent=nt;exports.getProgressLog=ot;exports.getResourceField=q;exports.getResourceValueAsJson=Q;exports.isEmpty=K;exports.isFunctionHandle=pt;exports.isolate=j;exports.makeArray=N;exports.makeObject=A;exports.mapArrayValues=$;exports.mapRecordValues=G;exports.mapResourceFields=X;exports.normalizeBlockConfig=ht;exports.not=z;exports.or=W;exports.readOutput=P;exports.wrapOutputs=L;Object.keys(c).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>c[e]})});
|
|
1
|
+
"use strict";var B=Object.defineProperty;var x=(e,t,n)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var l=(e,t,n)=>x(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@milaboratories/pl-model-common");class F extends Error{constructor(t,n){super(`${t.length}${n?"+":""} errors, first error: `+t[0]),this.errors=t,this.moreErrors=n}}function P(e){if(!e.ok)throw new F(e.errors,e.moreErrors);return e.value}function L(e){return new Proxy(e,{get(t,n){return P(t[n])}})}function o(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null?h(e):e}function p(e){return{type:"GetFromCtx",variable:e}}function j(e){return{type:"Isolate",cfg:e}}const E=p("$args"),k=p("$it"),J=p("$prod"),H=p("$staging"),M=p("$ui");function h(e){return{type:"Immediate",value:e}}function A(e){const t={};for(const[n,r]of Object.entries(e))t[n]=o(r);return{type:"MakeObject",template:t}}function N(...e){const t=[];for(const n of e)t.push(o(n));return{type:"MakeArray",template:t}}function f(e,t){return{type:"GetJsonField",source:o(e),field:o(t)}}function G(e,t,n="$it"){return{type:"MapRecordValues",source:e,mapping:t,itVar:n}}function $(e,t,n="$it"){return{type:"MapArrayValues",source:e,mapping:t,itVar:n}}function T(e){return{type:"Flatten",source:e}}function K(e){return{type:"IsEmpty",arg:e}}function z(e){return{type:"Not",operand:e}}function U(e,t){return{type:"And",operand1:e,operand2:t}}function W(e,t){return{type:"Or",operand1:e,operand2:t}}function q(e,t){return{type:"GetResourceField",source:o(e),field:o(t)}}function Q(){return function(e){return{type:"GetResourceValueAsJson",source:o(e)}}}function X(e,t,n="$it"){return{type:"MapResourceFields",source:e,mapping:t,itVar:n}}function Y(e){return{type:"GetBlobContent",source:o(e)}}function Z(e){return{type:"GetBlobContentAsString",source:o(e)}}function tt(){return function(e){return{type:"GetBlobContentAsJson",source:o(e)}}}function et(e){return{type:"GetDownloadedBlobContent",source:o(e)}}function nt(e){return{type:"GetOnDemandBlobContent",source:o(e)}}function rt(e){return{type:"GetImportProgress",source:o(e)}}function st(e,t){return{type:"GetLastLogs",source:o(e),lines:t}}function ot(e,t){return{type:"GetProgressLog",source:o(e),patternToSearch:t}}function it(e){return{type:"GetLogHandle",source:o(e)}}function at(){return typeof getPlatforma<"u"||typeof platforma<"u"}function ut(e){if(typeof getPlatforma=="function")return getPlatforma(e);if(typeof platforma<"u")return platforma;throw new Error("Can't get platforma instance.")}function lt(){if(typeof cfgRenderCtx<"u")return cfgRenderCtx}function s(){if(typeof cfgRenderCtx<"u")return cfgRenderCtx;throw new Error("Not in config rendering context")}function y(e,t){const n=lt();if(n===void 0)return!1;if(e in n.callbackRegistry)throw new Error(`Callback with key ${e} already registered.`);return n.callbackRegistry[e]=t,!0}const w=new Map;function ct(e,t){e in s().callbackRegistry||(s().callbackRegistry[e]=n=>{for(const r of w.get(e))r(n)},w.set(e,[])),w.get(e).push(t)}class a{constructor(t,n=r=>r){l(this,"isResolved",!1);l(this,"resolvedValue");this.handle=t,this.postProcess=n,ct(t,r=>{this.resolvedValue=n(r),this.isResolved=!0})}map(t){return new a(this.handle,n=>t(this.postProcess(n)))}mapDefined(t){return new a(this.handle,n=>{const r=this.postProcess(n);return r?t(r):void 0})}toJSON(){return this.isResolved?this.resolvedValue:{__awaited_futures__:[this.handle]}}}function C(e){return e===void 0?void 0:new d(e)}class d{constructor(t){this.handle=t}resolve(...t){return this.resolveWithCommon({},...t)}resolveWithCommon(t,...n){return C(s().resolveWithCommon(this.handle,t,...n))}get resourceType(){return s().getResourceType(this.handle)}getInputsLocked(){return s().getInputsLocked(this.handle)}getOutputsLocked(){return s().getOutputsLocked(this.handle)}getIsReadyOrError(){return s().getIsReadyOrError(this.handle)}getIsFinal(){return s().getIsFinal(this.handle)}getError(){return C(s().getError(this.handle))}listInputFields(){return s().listInputFields(this.handle)}listOutputFields(){return s().listOutputFields(this.handle)}listDynamicFields(){return s().listDynamicFields(this.handle)}getKeyValueBase64(t){return s().getKeyValueBase64(this.handle,t)}getKeyValueAsString(t){return s().getKeyValueAsString(this.handle,t)}getKeyValueAsJson(t){const n=this.getKeyValueAsString(t);if(n==null)throw new Error("Resource has no content.");return JSON.parse(n)}getDataBase64(){return s().getDataBase64(this.handle)}getDataAsString(){return s().getDataAsString(this.handle)}getDataAsJson(){const t=this.getDataAsString();if(t==null)throw new Error("Resource has no content.");return JSON.parse(t)}getPColumns(t=!1,n=""){const r=this.parsePObjectCollection(t,n);return r===void 0?void 0:Object.entries(r).map(([,g])=>{if(!c.isPColumn(g))throw new Error(`not a PColumn (kind = ${g.spec.kind})`);return g})}parsePObjectCollection(t=!1,n=""){const r=s().parsePObjectCollection(this.handle,t,n);if(r===void 0)return;const i={};for(const[g,v]of Object.entries(r))i[g]=c.mapPObjectData(v,I=>new d(I));return i}getFileContentAsBase64(){return new a(s().getBlobContentAsBase64(this.handle))}getFileContentAsString(){return new a(s().getBlobContentAsString(this.handle))}getFileContentAsJson(){return new a(s().getBlobContentAsString(this.handle)).mapDefined(t=>JSON.parse(t))}getBlobContentAsBase64(){return this.getFileContentAsBase64()}getBlobContentAsString(){return this.getFileContentAsString()}getFileHandle(){return new a(s().getDownloadedBlobContentHandle(this.handle))}getDownloadedBlobHandle(){return this.getFileHandle()}getRemoteFileHandle(){return new a(s().getOnDemandBlobContentHandle(this.handle))}getOnDemandBlobHandle(){return this.getRemoteFileHandle()}getImportProgress(){return new a(s().getImportProgress(this.handle))}getLastLogs(t){return new a(s().getLastLogs(this.handle,t))}getProgressLog(t){return new a(s().getProgressLog(this.handle,t))}getLogHandle(){return new a(s().getLogHandle(this.handle))}}const _="staging",O="main";function R(e){return typeof e=="object"&&e!==null&&"__awaited_futures__"in e}function b(e,t,n){if(t.has(n))return;if(t.add(n),typeof n==="object")if(R(n))n.__awaited_futures__.forEach(i=>e.add(i));else if(Array.isArray(n))for(const i of n)b(e,t,i);else for(const[,i]of Object.entries(n))i!==n&&b(e,t,i)}function gt(e){const t=new Set;return b(t,new Set,e),t}const dt=Object.freeze(Object.defineProperty({__proto__:null,MainAccessorName:O,StagingAccessorName:_,getAllFutureAwaits:gt,isFutureAwait:R},Symbol.toStringTag,{value:"Module"}));class S{constructor(){l(this,"ctx",s())}calculateOptions(t){return this.ctx.calculateOptions(t)}getDataFromResultPool(){const t=this.ctx.getDataFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:new d(n.obj.data)}}))}}getDataWithErrorsFromResultPool(){const t=this.ctx.getDataWithErrorsFromResultPool();return{isComplete:t.isComplete,entries:t.entries.map(n=>({ref:n.ref,obj:{...n.obj,data:c.mapValueInVOE(n.obj.data,r=>new d(r))}}))}}getSpecsFromResultPool(){return this.ctx.getSpecsFromResultPool()}}class m{constructor(){l(this,"ctx");l(this,"args");l(this,"uiState");l(this,"resultPool",new S);this.ctx=s(),this.args=JSON.parse(this.ctx.args),this.uiState=this.ctx.uiState!==void 0?JSON.parse(this.ctx.uiState):void 0}getNamedAccessor(t){const n=this.ctx.getAccessorHandleByName(t);return n?new d(n):void 0}get prerun(){return this.getNamedAccessor(_)}get precalc(){return this.prerun}get stagingOutput(){return this.precalc}get outputs(){return this.getNamedAccessor(O)}get mainOutput(){return this.outputs}createPFrame(t){return this.ctx.createPFrame(t.map(n=>c.mapPObjectData(n,r=>r.handle)))}createPTable(t){var n;return"columns"in t?n={src:{type:"inner",entries:t.columns.map(r=>({type:"column",column:r}))},filters:t.filters??[],sorting:t.sorting??[]}:n=t,this.ctx.createPTable(c.mapPTableDef(n,r=>c.mapPObjectData(r,i=>i.handle)))}getBlockLabel(t){return this.ctx.getBlockLabel(t)}}const V="1.2.28";function pt(e){return typeof e=="string"}function ht(e){if(e.inputsValid!==void 0)return e;{if(e.canRun===void 0)throw new Error(`Malformed config, SDK version ${e.sdkVersion}`);const t={...e,inputsValid:e.canRun};return delete t.canRun,t}}class u{constructor(t,n,r,i,g){this._renderingMode=t,this._initialArgs=n,this._outputs=r,this._inputsValid=i,this._sections=g}static create(t="Heavy"){return new u(t,void 0,{},h(!0),h([]))}output(t,n){if(typeof n=="function"){const r=`output#${t}`;return y(r,()=>n(new m)),new u(this._renderingMode,this._initialArgs,{...this._outputs,[t]:r},this._inputsValid,this._sections)}else return new u(this._renderingMode,this._initialArgs,{...this._outputs,[t]:n},this._inputsValid,this._sections)}canRun(t){return this.inputsValid(t)}argsValid(t){return typeof t=="function"?(y("inputsValid",()=>t(new m)),new u(this._renderingMode,this._initialArgs,this._outputs,"inputsValid",this._sections)):new u(this._renderingMode,this._initialArgs,this._outputs,t,this._sections)}inputsValid(t){return this.argsValid(t)}sections(t){return Array.isArray(t)?this.sections(h(t)):typeof t=="function"?(y("sections",()=>t(new m)),new u(this._renderingMode,this._initialArgs,this._outputs,this._inputsValid,"sections")):new u(this._renderingMode,this._initialArgs,this._outputs,this._inputsValid,t)}initialArgs(t){return new u(this._renderingMode,t,this._outputs,this._inputsValid,this._sections)}done(){if(this._initialArgs===void 0)throw new Error("Initial arguments not set.");const t={sdkVersion:V,renderingMode:this._renderingMode,initialArgs:this._initialArgs,inputsValid:this._inputsValid,sections:this._sections,outputs:this._outputs};return at()?ut(t):{config:t}}}class ft{constructor(t){this.handle=t}async findColumns(t){return await platforma.pFrameDriver.findColumns(this.handle,t)}async getColumnSpec(t){return await platforma.pFrameDriver.getColumnSpec(this.handle,t)}async listColumns(){return await platforma.pFrameDriver.listColumns(this.handle)}async calculateTableData(t){return await platforma.pFrameDriver.calculateTableData(this.handle,t)}async getUniqueValues(t){return await platforma.pFrameDriver.getUniqueValues(this.handle,t)}}function D(e){return A({__isRef:!0,blockId:f(e,"blockId"),name:f(e,"name")})}function mt(e){return A({ref:D(f(e,"ref")),label:f(e,"label")})}const yt={sdkVersion:V};exports.Args=E;exports.BlockModel=u;exports.CurrentSdkInfo=yt;exports.FutureRef=a;exports.It=k;exports.JsRenderInternal=dt;exports.MainOutputs=J;exports.OutputError=F;exports.PFrameImpl=ft;exports.RenderCtx=m;exports.ResultPool=S;exports.StagingOutputs=H;exports.TreeNodeAccessor=d;exports.UiState=M;exports.and=U;exports.flatten=T;exports.fromPlOption=mt;exports.fromPlRef=D;exports.getBlobContent=Y;exports.getBlobContentAsJson=tt;exports.getBlobContentAsString=Z;exports.getDownloadedBlobContent=et;exports.getFromCfg=p;exports.getImmediate=h;exports.getImportProgress=rt;exports.getJsonField=f;exports.getLastLogs=st;exports.getLogHandle=it;exports.getOnDemandBlobContent=nt;exports.getProgressLog=ot;exports.getResourceField=q;exports.getResourceValueAsJson=Q;exports.isEmpty=K;exports.isFunctionHandle=pt;exports.isolate=j;exports.makeArray=N;exports.makeObject=A;exports.mapArrayValues=$;exports.mapRecordValues=G;exports.mapResourceFields=X;exports.normalizeBlockConfig=ht;exports.not=z;exports.or=W;exports.readOutput=P;exports.wrapOutputs=L;Object.keys(c).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>c[e]})});
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","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.26';\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":"uSAEO,MAAMA,UAAoB,KAAM,CACrC,YACkBC,EACAC,EAChB,CACM,MAAA,GAAGD,EAAO,MAAM,GAAGC,EAAa,IAAM,EAAE,yBAA2BD,EAAO,CAAC,CAAC,EAHlE,KAAA,OAAAA,EACA,KAAA,WAAAC,CAGlB,CACF,CAEO,SAASC,EAA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AAK,aAClB,YAAa,KAAK,aAClB,SAAU,KAAK,UACf,QAAS,KAAK,QAAA,EAGhB,OAAKvD,GAAO,EAIAC,GAAqBC,CAAM,EAF9B,CAAE,OAAAA,CAAO,CAGpB,CACF,CC5TO,MAAMoE,EAA6B,CACxC,YAA6B5D,EAAsB,CAAtB,KAAA,OAAAA,CAAuB,CAEpD,MAAa,YAAY6D,EAA2D,CAClF,OAAO,MAAM,UAAU,aAAa,YAAY,KAAK,OAAQA,CAAO,CACtE,CAEA,MAAa,cAAcC,EAA2C,CACpE,OAAO,MAAM,UAAU,aAAa,cAAc,KAAK,OAAQA,CAAQ,CACzE,CAEA,MAAa,aAA2C,CACtD,OAAO,MAAM,UAAU,aAAa,YAAY,KAAK,MAAM,CAC7D,CAEA,MAAa,mBACXD,EACqC,CACrC,OAAO,MAAM,UAAU,aAAa,mBAAmB,KAAK,OAAQA,CAAO,CAC7E,CAEA,MAAa,gBAAgBA,EAA6D,CACxF,OAAO,MAAM,UAAU,aAAa,gBAAgB,KAAK,OAAQA,CAAO,CAC1E,CACF,CCpCO,SAASE,EAAsCtG,EAAgB,CACpE,OAAON,EAAW,CAChB,QAAS,GACT,QAASK,EAAaC,EAAQ,SAAS,EACvC,KAAMD,EAAaC,EAAQ,MAAM,CAAA,CAClC,CACH,CAEO,SAASuG,GAAyCvG,EAAgB,CACvE,OAAON,EAAW,CAChB,IAAK4G,EAAUvG,EAAaC,EAAQ,KAAK,CAAC,EAC1C,MAAOD,EAAaC,EAAQ,OAAO,CAAA,CACpC,CACH,CCTO,MAAMwG,GAA0B,CACrC,WAAYpB,CACd"}
|
|
1
|
+
{"version":3,"file":"index.js","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.28';\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 = 'Heavy'\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 argsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** Sets custom configuration predicate on the block args at which block can be executed */\n public argsValid<RF extends RenderFunction<Args, UiState, boolean>>(\n rf: RF\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public argsValid(\n cfgOrRf: TypedConfig | 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 /** @deprecated use argsValid() */\n public inputsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** @deprecated use argsValid() */\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 return this.argsValid(cfgOrRf as any);\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":"uSAEO,MAAMA,UAAoB,KAAM,CACrC,YACkBC,EACAC,EAChB,CACM,MAAA,GAAGD,EAAO,MAAM,GAAGC,EAAa,IAAM,EAAE,yBAA2BD,EAAO,CAAC,CAAC,EAHlE,KAAA,OAAAA,EACA,KAAA,WAAAC,CAGlB,CACF,CAEO,SAASC,EAAcC,EAAkC,CAC1D,GAAA,CAACA,EAAY,GAAI,MAAM,IAAIJ,EAAYI,EAAY,OAAQA,EAAY,UAAU,EACrF,OAAOA,EAAY,KACrB,CAOO,SAASC,EACdC,EACwB,CACjB,OAAA,IAAI,MAAMA,EAAS,CACxB,IAAIC,EAAQC,EAAa,CAChB,OAAAL,EAAWI,EAAOC,CAAG,CAAC,CAC/B,CAAA,CACD,CACH,CCMA,SAASC,EAAkBC,EAAuC,CAE9D,OAAA,OAAOA,GAAU,UACjB,OAAOA,GAAU,UACjB,OAAOA,GAAU,WACjBA,IAAU,KAEHC,EAAaD,CAAK,EACfA,CACd,CAMO,SAASE,EAAmCC,EAA4C,CACtF,MAAA,CAAE,KAAM,aAAc,SAAAA,EAC/B,CAMO,SAASC,EACdC,EACgD,CACzC,MAAA,CACL,KAAM,UACN,IAAAA,CAAA,CAEJ,CAMa,MAAAC,EAAOJ,EAAW,O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AO,MAAM,UAAU,aAAa,mBAAmB,KAAK,OAAQA,CAAO,CAC7E,CAEA,MAAa,gBAAgBA,EAA6D,CACxF,OAAO,MAAM,UAAU,aAAa,gBAAgB,KAAK,OAAQA,CAAO,CAC1E,CACF,CCpCO,SAASE,EAAsCtG,EAAgB,CACpE,OAAON,EAAW,CAChB,QAAS,GACT,QAASK,EAAaC,EAAQ,SAAS,EACvC,KAAMD,EAAaC,EAAQ,MAAM,CAAA,CAClC,CACH,CAEO,SAASuG,GAAyCvG,EAAgB,CACvE,OAAON,EAAW,CAChB,IAAK4G,EAAUvG,EAAaC,EAAQ,KAAK,CAAC,EAC1C,MAAOD,EAAaC,EAAQ,OAAO,CAAA,CACpC,CACH,CCTO,MAAMwG,GAA0B,CACrC,WAAYpB,CACd"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var l = (e, t, n) =>
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var D = (e, t, n) => t in e ? v(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var l = (e, t, n) => D(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { isPColumn as O, mapPObjectData as w, mapValueInVOE as x, mapPTableDef as I } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
6
|
class B extends Error {
|
|
@@ -209,7 +209,7 @@ function f(e, t) {
|
|
|
209
209
|
return n.callbackRegistry[e] = t, !0;
|
|
210
210
|
}
|
|
211
211
|
const m = /* @__PURE__ */ new Map();
|
|
212
|
-
function
|
|
212
|
+
function H(e, t) {
|
|
213
213
|
e in s().callbackRegistry || (s().callbackRegistry[e] = (n) => {
|
|
214
214
|
for (const r of m.get(e))
|
|
215
215
|
r(n);
|
|
@@ -219,7 +219,7 @@ class a {
|
|
|
219
219
|
constructor(t, n = (r) => r) {
|
|
220
220
|
l(this, "isResolved", !1);
|
|
221
221
|
l(this, "resolvedValue");
|
|
222
|
-
this.handle = t, this.postProcess = n,
|
|
222
|
+
this.handle = t, this.postProcess = n, H(t, (r) => {
|
|
223
223
|
this.resolvedValue = n(r), this.isResolved = !0;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
@@ -320,7 +320,7 @@ class d {
|
|
|
320
320
|
if (r === void 0) return;
|
|
321
321
|
const o = {};
|
|
322
322
|
for (const [c, R] of Object.entries(r))
|
|
323
|
-
o[c] = w(R, (
|
|
323
|
+
o[c] = w(R, (V) => new d(V));
|
|
324
324
|
return o;
|
|
325
325
|
}
|
|
326
326
|
getFileContentAsBase64() {
|
|
@@ -397,7 +397,7 @@ function A(e, t, n) {
|
|
|
397
397
|
for (const [, o] of Object.entries(n))
|
|
398
398
|
o !== n && A(e, t, o);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function J(e) {
|
|
401
401
|
const t = /* @__PURE__ */ new Set();
|
|
402
402
|
return A(t, /* @__PURE__ */ new Set(), e), t;
|
|
403
403
|
}
|
|
@@ -405,7 +405,7 @@ const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
405
405
|
__proto__: null,
|
|
406
406
|
MainAccessorName: F,
|
|
407
407
|
StagingAccessorName: _,
|
|
408
|
-
getAllFutureAwaits:
|
|
408
|
+
getAllFutureAwaits: J,
|
|
409
409
|
isFutureAwait: P
|
|
410
410
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
411
411
|
class G {
|
|
@@ -499,7 +499,7 @@ class y {
|
|
|
499
499
|
return this.ctx.getBlockLabel(t);
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
|
-
const S = "1.2.
|
|
502
|
+
const S = "1.2.28";
|
|
503
503
|
function wt(e) {
|
|
504
504
|
return typeof e == "string";
|
|
505
505
|
}
|
|
@@ -517,7 +517,7 @@ class u {
|
|
|
517
517
|
this._renderingMode = t, this._initialArgs = n, this._outputs = r, this._inputsValid = o, this._sections = c;
|
|
518
518
|
}
|
|
519
519
|
/** Initiates configuration builder */
|
|
520
|
-
static create(t) {
|
|
520
|
+
static create(t = "Heavy") {
|
|
521
521
|
return new u(
|
|
522
522
|
t,
|
|
523
523
|
void 0,
|
|
@@ -555,7 +555,7 @@ class u {
|
|
|
555
555
|
canRun(t) {
|
|
556
556
|
return this.inputsValid(t);
|
|
557
557
|
}
|
|
558
|
-
|
|
558
|
+
argsValid(t) {
|
|
559
559
|
return typeof t == "function" ? (f("inputsValid", () => t(new y())), new u(
|
|
560
560
|
this._renderingMode,
|
|
561
561
|
this._initialArgs,
|
|
@@ -570,6 +570,9 @@ class u {
|
|
|
570
570
|
this._sections
|
|
571
571
|
);
|
|
572
572
|
}
|
|
573
|
+
inputsValid(t) {
|
|
574
|
+
return this.argsValid(t);
|
|
575
|
+
}
|
|
573
576
|
sections(t) {
|
|
574
577
|
return Array.isArray(t) ? this.sections(p(t)) : typeof t == "function" ? (f("sections", () => t(new y())), new u(
|
|
575
578
|
this._renderingMode,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +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.26';\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,CAAC,GAHlE,KAAA,SAAAA,GACA,KAAA,aAAAC;AAAA,EAGlB;AACF;AAEO,SAASC,EAA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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;"}
|
|
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.28';\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 = 'Heavy'\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 argsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** Sets custom configuration predicate on the block args at which block can be executed */\n public argsValid<RF extends RenderFunction<Args, UiState, boolean>>(\n rf: RF\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n public argsValid(\n cfgOrRf: TypedConfig | 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 /** @deprecated use argsValid() */\n public inputsValid<Cfg extends TypedConfig>(\n cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>\n ): BlockModel<Args, OutputsCfg, UiState, Href>;\n /** @deprecated use argsValid() */\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 return this.argsValid(cfgOrRf as any);\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,CAAC,GAHlE,KAAA,SAAAA,GACA,KAAA,aAAAC;AAAA,EAGlB;AACF;AAEO,SAASC,EAAcC,GAAkC;AAC1D,MAAA,CAACA,EAAY,GAAI,OAAM,IAAIJ,EAAYI,EAAY,QAAQA,EAAY,UAAU;AACrF,SAAOA,EAAY;AACrB;AAOO,SAASC,EACdC,GACwB;AACjB,SAAA,IAAI,MAAMA,GAAS;AAAA,IACxB,IAAIC,GAAQC,GAAa;AAChB,aAAAL,EAAWI,EAAOC,CAAG,CAAC;AAAA,IAC/B;AAAA,EAAA,CACD;AACH;ACMA,SAASC,EAAkBC,GAAuC;AAE9D,SAAA,OAAOA,KAAU,YACjB,OAAOA,KAAU,YACjB,OAAOA,KAAU,aACjBA,MAAU,OAEHC,EAAaD,CAAK,IACfA;AACd;AAMO,SAASE,EAAmCC,GAA4C;AACtF,SAAA,EAAE,MAAM,cAAc,UAAAA;AAC/B;AAMO,SAASC,EACdC,GACgD;AACzC,SAAA;AAAA,IACL,MAAM;AAAA,IACN,KAAAA;AAAA,EAAA;AAEJ;AAMa,MAAAC,IAAOJ,EAAW,OAAO,GACzBK,IAAKL,EAAW,KAAK,GACrBM,IAAcN,EAAW,OAAO,GAChCO,IAAiBP,EAAW,UAA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AAM;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;"}
|
package/dist/ref_util.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { TypedConfig } from './config';
|
|
2
|
-
export declare function fromPlRef<Source extends TypedConfig>(source: Source): TypedConfig<
|
|
3
|
-
readonly __isRef:
|
|
4
|
-
readonly blockId:
|
|
5
|
-
readonly name:
|
|
1
|
+
import { TypedConfig, ActMakeObject, ActGetImmediate, ActGetField, POCExtractAction } from './config';
|
|
2
|
+
export declare function fromPlRef<Source extends TypedConfig>(source: Source): TypedConfig< ActMakeObject<{
|
|
3
|
+
readonly __isRef: ActGetImmediate<true>;
|
|
4
|
+
readonly blockId: ActGetField<POCExtractAction<Source>, ActGetImmediate<"blockId">>;
|
|
5
|
+
readonly name: ActGetField<POCExtractAction<Source>, ActGetImmediate<"name">>;
|
|
6
6
|
}>>;
|
|
7
|
-
export declare function fromPlOption<Source extends TypedConfig>(source: Source): TypedConfig<
|
|
8
|
-
readonly ref:
|
|
9
|
-
readonly __isRef:
|
|
10
|
-
readonly blockId:
|
|
11
|
-
readonly name:
|
|
7
|
+
export declare function fromPlOption<Source extends TypedConfig>(source: Source): TypedConfig< ActMakeObject<{
|
|
8
|
+
readonly ref: ActMakeObject<{
|
|
9
|
+
readonly __isRef: ActGetImmediate<true>;
|
|
10
|
+
readonly blockId: ActGetField<ActGetField<POCExtractAction<Source>, ActGetImmediate<"ref">>, ActGetImmediate<"blockId">>;
|
|
11
|
+
readonly name: ActGetField<ActGetField<POCExtractAction<Source>, ActGetImmediate<"ref">>, ActGetImmediate<"name">>;
|
|
12
12
|
}>;
|
|
13
|
-
readonly label:
|
|
13
|
+
readonly label: ActGetField<POCExtractAction<Source>, ActGetImmediate<"label">>;
|
|
14
14
|
}>>;
|
|
15
15
|
//# sourceMappingURL=ref_util.d.ts.map
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PlatformaSDKVersion = "1.2.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.2.28";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.28",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"typescript": "~5.5.4",
|
|
27
|
-
"vite": "^5.4.
|
|
27
|
+
"vite": "^5.4.8",
|
|
28
28
|
"@types/jest": "^29.5.13",
|
|
29
29
|
"jest": "^29.7.0",
|
|
30
|
+
"@jest/globals": "^29.7.0",
|
|
30
31
|
"ts-jest": "^29.2.5",
|
|
31
32
|
"@milaboratories/platforma-build-configs": "1.0.1"
|
|
32
33
|
},
|
package/src/builder.ts
CHANGED
|
@@ -155,7 +155,7 @@ export class BlockModel<
|
|
|
155
155
|
|
|
156
156
|
/** Initiates configuration builder */
|
|
157
157
|
public static create<Args, UiState = undefined>(
|
|
158
|
-
renderingMode: BlockRenderingMode
|
|
158
|
+
renderingMode: BlockRenderingMode = 'Heavy'
|
|
159
159
|
): BlockModel<Args, {}, UiState> {
|
|
160
160
|
return new BlockModel<Args, {}, UiState>(
|
|
161
161
|
renderingMode,
|
|
@@ -224,13 +224,14 @@ export class BlockModel<
|
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
/** Sets custom configuration predicate on the block args at which block can be executed */
|
|
227
|
-
public
|
|
227
|
+
public argsValid<Cfg extends TypedConfig>(
|
|
228
228
|
cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>
|
|
229
229
|
): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
230
|
-
|
|
230
|
+
/** Sets custom configuration predicate on the block args at which block can be executed */
|
|
231
|
+
public argsValid<RF extends RenderFunction<Args, UiState, boolean>>(
|
|
231
232
|
rf: RF
|
|
232
233
|
): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
233
|
-
public
|
|
234
|
+
public argsValid(
|
|
234
235
|
cfgOrRf: TypedConfig | Function
|
|
235
236
|
): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {
|
|
236
237
|
if (typeof cfgOrRf === 'function') {
|
|
@@ -252,6 +253,20 @@ export class BlockModel<
|
|
|
252
253
|
);
|
|
253
254
|
}
|
|
254
255
|
|
|
256
|
+
/** @deprecated use argsValid() */
|
|
257
|
+
public inputsValid<Cfg extends TypedConfig>(
|
|
258
|
+
cfg: Cfg & InputsValidCfgChecked<Cfg, Args, UiState>
|
|
259
|
+
): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
260
|
+
/** @deprecated use argsValid() */
|
|
261
|
+
public inputsValid<RF extends RenderFunction<Args, UiState, boolean>>(
|
|
262
|
+
rf: RF
|
|
263
|
+
): BlockModel<Args, OutputsCfg, UiState, Href>;
|
|
264
|
+
public inputsValid(
|
|
265
|
+
cfgOrRf: TypedConfig | Function
|
|
266
|
+
): BlockModel<Args, OutputsCfg, UiState, `/${string}`> {
|
|
267
|
+
return this.argsValid(cfgOrRf as any);
|
|
268
|
+
}
|
|
269
|
+
|
|
255
270
|
/** Sets the config to generate list of section in the left block overviews panel */
|
|
256
271
|
public sections<const S extends SectionsExpectedType,>(rf: S): BlockModel<Args, OutputsCfg, UiState, DeriveHref<S>>;
|
|
257
272
|
public sections<
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const PlatformaSDKVersion = '1.2.28';
|