@platforma-sdk/model 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/bconfig/container.d.ts +46 -0
  2. package/dist/bconfig/container.d.ts.map +1 -0
  3. package/dist/bconfig/index.d.ts +7 -0
  4. package/dist/bconfig/index.d.ts.map +1 -0
  5. package/dist/bconfig/lambdas.d.ts +33 -0
  6. package/dist/bconfig/lambdas.d.ts.map +1 -0
  7. package/dist/bconfig/normalization.d.ts +13 -0
  8. package/dist/bconfig/normalization.d.ts.map +1 -0
  9. package/dist/bconfig/types.d.ts +11 -0
  10. package/dist/bconfig/types.d.ts.map +1 -0
  11. package/dist/bconfig/utils.d.ts +7 -0
  12. package/dist/bconfig/utils.d.ts.map +1 -0
  13. package/dist/bconfig/v3.d.ts +30 -0
  14. package/dist/bconfig/v3.d.ts.map +1 -0
  15. package/dist/builder.d.ts +45 -65
  16. package/dist/builder.d.ts.map +1 -1
  17. package/dist/components/PlDataTable.d.ts +3 -0
  18. package/dist/components/PlDataTable.d.ts.map +1 -1
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +428 -251
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/internal.d.ts +3 -2
  26. package/dist/internal.d.ts.map +1 -1
  27. package/dist/platforma.d.ts +3 -2
  28. package/dist/platforma.d.ts.map +1 -1
  29. package/dist/raw_globals.d.ts.map +1 -1
  30. package/dist/render/accessor.d.ts +23 -0
  31. package/dist/render/accessor.d.ts.map +1 -1
  32. package/dist/render/api.d.ts +2 -0
  33. package/dist/render/api.d.ts.map +1 -1
  34. package/dist/render/internal.d.ts +4 -0
  35. package/dist/render/internal.d.ts.map +1 -1
  36. package/dist/version.d.ts +1 -1
  37. package/package.json +3 -3
  38. package/src/bconfig/container.ts +58 -0
  39. package/src/bconfig/index.ts +6 -0
  40. package/src/bconfig/lambdas.ts +44 -0
  41. package/src/bconfig/normalization.ts +120 -0
  42. package/src/bconfig/types.ts +18 -0
  43. package/src/bconfig/utils.ts +8 -0
  44. package/src/bconfig/v3.ts +46 -0
  45. package/src/builder.ts +165 -141
  46. package/src/components/PlDataTable.ts +3 -0
  47. package/src/global.d.ts +1 -1
  48. package/src/index.ts +1 -0
  49. package/src/internal.ts +1 -2
  50. package/src/platforma.ts +1 -2
  51. package/src/raw_globals.ts +2 -1
  52. package/src/render/accessor.ts +73 -0
  53. package/src/render/api.ts +22 -10
  54. package/src/render/internal.ts +12 -0
  55. package/src/typing.test.ts +5 -4
@@ -11,6 +11,7 @@ import {
11
11
  PSpecPredicate,
12
12
  PTableDef,
13
13
  PTableHandle,
14
+ Ref,
14
15
  ResultCollection,
15
16
  ValueOrError
16
17
  } from '@milaboratories/pl-model-common';
@@ -103,6 +104,7 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
103
104
  // Blocks
104
105
  //
105
106
 
107
+ /** @deprecated at some point will stop working and will return dummy values */
106
108
  getBlockLabel(blockId: string): string;
107
109
 
108
110
  //
@@ -117,6 +119,10 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
117
119
 
118
120
  getSpecsFromResultPool(): ResultCollection<PObjectSpec>;
119
121
 
122
+ getSpecFromResultPoolByRef(blockId: string, exportName: string): PObjectSpec | undefined;
123
+
124
+ getDataFromResultPoolByRef(blockId: string, exportName: string): PObject<AHandle> | undefined;
125
+
120
126
  calculateOptions(predicate: PSpecPredicate): Option[];
121
127
 
122
128
  //
@@ -126,6 +132,12 @@ export interface GlobalCfgRenderCtxMethods<AHandle = AccessorHandle, FHandle = F
126
132
  createPFrame(def: PFrameDef<AHandle>): PFrameHandle;
127
133
 
128
134
  createPTable(def: PTableDef<PColumn<AHandle>>): PTableHandle;
135
+
136
+ //
137
+ // Computable
138
+ //
139
+
140
+ getCurrentUnstableMarker(): string | undefined;
129
141
  }
130
142
 
131
143
  export interface GlobalCfgRenderCtx extends GlobalCfgRenderCtxMethods {
@@ -4,7 +4,7 @@ import {
4
4
  RemoteBlobHandleAndSize,
5
5
  ValueOrErrors
6
6
  } from '@milaboratories/pl-model-common';
7
- import { BlockModel, DeriveHref, StdCtx } from './builder';
7
+ import { BlockModel } from './builder';
8
8
  import {
9
9
  Args,
10
10
  ConfigResult,
@@ -27,6 +27,7 @@ import {
27
27
  mapRecordValues
28
28
  } from './config';
29
29
  import { InferHrefType, InferOutputsType } from './platforma';
30
+ import { DeriveHref, StdCtx } from './bconfig';
30
31
 
31
32
  type AssertEqual<T, Expected> = [T] extends [Expected]
32
33
  ? [Expected] extends [T]
@@ -99,11 +100,11 @@ test('test config content', () => {
99
100
  });
100
101
 
101
102
  test('test config content', () => {
102
- const platforma = BlockModel.create<{ a: string[] }>('Heavy')
103
- .initialArgs({ a: [] })
103
+ const platforma = BlockModel.create('Heavy')
104
+ .withArgs<{ a: string[] }>({ a: [] })
105
+ .argsValid(isEmpty(getJsonField(Args, 'a')))
104
106
  .output('cell1', makeObject({ b: getJsonField(Args, 'a') }))
105
107
  .output('cell2', mapArrayValues(getJsonField(Args, 'a'), getImmediate('v1')))
106
- .inputsValid(isEmpty(getJsonField(Args, 'a')))
107
108
  .sections((r) => {
108
109
  return [
109
110
  { type: 'link', href: '/', label: 'Main' },