@platforma-sdk/ui-vue 1.37.1 → 1.37.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-sdk/ui-vue@1.37.1 build /home/runner/_work/platforma/platforma/sdk/ui-vue
3
+ > @platforma-sdk/ui-vue@1.37.4 build /home/runner/_work/platforma/platforma/sdk/ui-vue
4
4
  > vite build
5
5
 
6
6
  vite v6.3.5 building for production...
@@ -10,7 +10,7 @@ rendering chunks...
10
10
 
11
11
  [vite:dts] Start generate declaration files...
12
12
  computing gzip size...
13
- [vite:dts] Declaration files built in 5279ms.
13
+ [vite:dts] Declaration files built in 5037ms.
14
14
 
15
15
  dist/_virtual/re.js  0.08 kB │ gzip: 0.10 kB │ map: 0.09 kB
16
16
  dist/_virtual/lodash2.js  0.09 kB │ gzip: 0.10 kB │ map: 0.09 kB
@@ -40,8 +40,8 @@ computing gzip size...
40
40
  dist/components/PlTableFilters/PlTableFilters.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.10 kB
41
41
  dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
42
42
  dist/lib/ui/uikit/dist/helpers/math.js  0.12 kB │ gzip: 0.13 kB │ map: 0.36 kB
43
- dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
44
43
  dist/components/PlAgCellProgress/PlAgCellProgress.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
44
+ dist/components/PlAgColumnHeader/PlAgColumnHeader.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
45
45
  dist/components/PlAgRowNumHeader.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
46
46
  dist/components/PlTableFilters/PlTableAddFilter.vue2.js  0.12 kB │ gzip: 0.12 kB │ map: 0.11 kB
47
47
  dist/lib/ui/uikit/dist/node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js  0.12 kB │ gzip: 0.12 kB │ map: 0.40 kB
@@ -146,8 +146,8 @@ computing gzip size...
146
146
  dist/lib/ui/uikit/dist/components/PlChartHistogram/logspace.js  0.27 kB │ gzip: 0.20 kB │ map: 0.88 kB
147
147
  dist/lib/ui/uikit/dist/components/PlSvg/PlSvg.vue.js  0.27 kB │ gzip: 0.21 kB │ map: 0.10 kB
148
148
  dist/lib/ui/uikit/dist/assets/icons/icon-assets-min/24_windows-expand.svg.js  0.27 kB │ gzip: 0.22 kB │ map: 0.51 kB
149
- dist/components/PlMultiSequenceAlignment/residue-counts.js  0.27 kB │ gzip: 0.20 kB │ map: 4.45 kB
150
149
  dist/node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/valid.js  0.27 kB │ gzip: 0.21 kB │ map: 0.59 kB
150
+ dist/components/PlMultiSequenceAlignment/residue-counts.js  0.27 kB │ gzip: 0.20 kB │ map: 4.45 kB
151
151
  dist/lib/ui/uikit/dist/assets/icons/icon-assets-min/24_arrow-left.svg.js  0.27 kB │ gzip: 0.23 kB │ map: 0.47 kB
152
152
  dist/components/PlMultiSequenceAlignment/Legend.vue.js  0.27 kB │ gzip: 0.21 kB │ map: 0.10 kB
153
153
  dist/lib/ui/uikit/dist/assets/icons/icon-assets-min/24_arrow-right.svg.js  0.27 kB │ gzip: 0.24 kB │ map: 0.47 kB
@@ -689,6 +689,7 @@ computing gzip size...
689
689
  dist/defineApp.js  1.36 kB │ gzip: 0.72 kB │ map: 4.74 kB
690
690
  dist/createModel.js  1.38 kB │ gzip: 0.65 kB │ map: 3.91 kB
691
691
  dist/lib/ui/uikit/dist/composition/useScroll.js  1.40 kB │ gzip: 0.57 kB │ map: 3.78 kB
692
+ dist/components/PlAgDataTable/types.js  1.41 kB │ gzip: 0.58 kB │ map: 8.14 kB
692
693
  dist/lib/ui/uikit/dist/components/PlRadio/PlRadioGroup.vue2.js  1.41 kB │ gzip: 0.72 kB │ map: 2.55 kB
693
694
  dist/lib/ui/uikit/dist/components/PlErrorAlert/PlErrorAlert.vue3.js  1.42 kB │ gzip: 0.73 kB │ map: 0.12 kB
694
695
  dist/lib/ui/uikit/dist/components/PlChartStackedBar/StackedRow.vue3.js  1.43 kB │ gzip: 0.69 kB │ map: 0.12 kB
@@ -791,7 +792,7 @@ computing gzip size...
791
792
  dist/lib/ui/uikit/dist/layout/PlBlockPage/PlBlockPage.vue.js  3.28 kB │ gzip: 1.34 kB │ map: 2.13 kB
792
793
  dist/lib/ui/uikit/dist/components/PlEditableTitle/pl-editable-title.module.scss.js  3.31 kB │ gzip: 1.18 kB │ map: 0.13 kB
793
794
  dist/components/PlAgColumnHeader/PlAgColumnHeader.vue.js  3.32 kB │ gzip: 1.34 kB │ map: 4.05 kB
794
- dist/sdk/model/dist/index.js  3.35 kB │ gzip: 1.39 kB │ map: 39.87 kB
795
+ dist/sdk/model/dist/index.js  3.35 kB │ gzip: 1.38 kB │ map: 39.87 kB
795
796
  dist/components/PlElementList/PlElementListItem.vue3.js  3.36 kB │ gzip: 1.24 kB │ map: 0.12 kB
796
797
  dist/lib/ui/uikit/dist/generated/icons-24.js  3.37 kB │ gzip: 1.08 kB │ map: 5.77 kB
797
798
  dist/lib/ui/uikit/dist/components/PlBtnDanger/PlBtnDanger.vue.js  3.47 kB │ gzip: 1.34 kB │ map: 1.23 kB
@@ -819,7 +820,7 @@ computing gzip size...
819
820
  dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js  4.48 kB │ gzip: 1.09 kB │ map: 3.14 kB
820
821
  dist/lib/ui/uikit/dist/components/PlAlert/PlAlert.vue.js  4.48 kB │ gzip: 1.69 kB │ map: 2.91 kB
821
822
  dist/components/BlockLayout.vue.js  4.89 kB │ gzip: 1.80 kB │ map: 2.83 kB
822
- dist/lib/model/common/dist/index.js  4.90 kB │ gzip: 2.00 kB │ map: 38.01 kB
823
+ dist/lib/model/common/dist/index.js  4.90 kB │ gzip: 2.00 kB │ map: 38.02 kB
823
824
  dist/plugins/Monetization/MonetizationSidebar.vue.js  5.12 kB │ gzip: 1.79 kB │ map: 5.01 kB
824
825
  dist/lib/ui/uikit/dist/components/PlBtnGroup/PlBtnGroup.vue.js  5.18 kB │ gzip: 1.94 kB │ map: 3.19 kB
825
826
  dist/lib/ui/uikit/dist/components/PlTooltip/PlTooltip.vue.js  5.23 kB │ gzip: 1.93 kB │ map: 5.49 kB
@@ -868,11 +869,11 @@ computing gzip size...
868
869
  dist/components/PlAgDataTable/PlAgDataTable.vue2.js  49.26 kB │ gzip: 30.80 kB │ map: 28.50 kB
869
870
  dist/node_modules/.pnpm/sortablejs@1.15.6/node_modules/sortablejs/modular/sortable.esm.js  50.22 kB │ gzip: 14.80 kB │ map: 181.40 kB
870
871
  dist/AgGridVue/useAgGridOptions.js  53.53 kB │ gzip: 30.97 kB │ map: 16.36 kB
871
- dist/lib.js  54.58 kB │ gzip: 31.23 kB │ map: 0.22 kB
872
+ dist/lib.js  54.70 kB │ gzip: 31.26 kB │ map: 0.22 kB
872
873
  dist/lib/ui/uikit/dist/node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.js  83.80 kB │ gzip: 17.23 kB │ map: 240.83 kB
873
874
  dist/node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.js  83.81 kB │ gzip: 17.26 kB │ map: 241.15 kB
874
875
  dist/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js 128.45 kB │ gzip: 31.07 kB │ map: 723.83 kB
875
876
  dist/lib/ui/uikit/dist/index.js 497.32 kB │ gzip: 191.64 kB │ map: 0.18 kB
876
877
  dist/lib/ui/uikit/dist/components/PlSlideModal/PlSlideModal.vue.js 601.36 kB │ gzip: 204.40 kB │ map: 0.23 kB
877
878
  dist/lib/ui/uikit/dist/components/DataTable/TableComponent.vue.js 602.69 kB │ gzip: 204.99 kB │ map: 0.27 kB
878
- ✓ built in 9.54s
879
+ ✓ built in 9.42s
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-sdk/ui-vue@1.37.1 type-check /home/runner/_work/platforma/platforma/sdk/ui-vue
3
+ > @platforma-sdk/ui-vue@1.37.4 type-check /home/runner/_work/platforma/platforma/sdk/ui-vue
4
4
  > vue-tsc --noEmit --project ./tsconfig.json
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @platforma-sdk/ui-vue
2
2
 
3
+ ## 1.37.4
4
+
5
+ ### Patch Changes
6
+
7
+ - ab005b5: PlDataTableSettingsV2 creation helpers
8
+
9
+ ## 1.37.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 37800c5: Public tools packages
14
+ - Updated dependencies [37800c5]
15
+ - @milaboratories/uikit@2.2.92
16
+ - @platforma-sdk/model@1.37.2
17
+
3
18
  ## 1.37.1
4
19
 
5
20
  ### Patch Changes
@@ -1,5 +1,6 @@
1
- import { AxisId, CanonicalizedJson, ListOptionBase, LocalBlobHandleAndSize, PlDataTableModel, PlDataTableSheet, PlDataTableSheetState, PlTableFilter, PlTableFilterType, PTableColumnId, PTableColumnSpec, PTableHandle, PTableKey, PTableRowKey, PTableValue, RemoteBlobHandleAndSize } from '@platforma-sdk/model';
1
+ import { JsonCompatible, AxisId, CanonicalizedJson, ListOptionBase, LocalBlobHandleAndSize, PlDataTableModel, PlDataTableSheet, PlDataTableSheetState, PlTableFilter, PlTableFilterType, PTableColumnId, PTableColumnSpec, PTableHandle, PTableKey, PTableRowKey, PTableValue, RemoteBlobHandleAndSize } from '@platforma-sdk/model';
2
2
  import { PTableHidden } from './sources/common';
3
+ import { ComputedRef, MaybeRefOrGetter } from 'vue';
3
4
  export type PlDataTableSettingsPTable = {
4
5
  /** The type of the source to feed the data into the table */
5
6
  sourceType: 'ptable';
@@ -26,6 +27,25 @@ export type PlDataTableSettingsV2 = {
26
27
  /** Result of `createPlDataTableV2` */
27
28
  model: PlDataTableModel | undefined;
28
29
  };
30
+ export declare function usePlDataTableSettingsV2<T = string>({
31
+ /**
32
+ * Block property (such as inputAnchor) used to produce the data source.
33
+ * Mandatory for cases when the table can change without block run.
34
+ * Skip when the table is changed only after block run.
35
+ * Ask developers for help if you don't know what to set here.
36
+ */
37
+ sourceId,
38
+ /** Block output created by `createPlDataTableV2` */
39
+ model,
40
+ /**
41
+ * Sheets for partitioned data sources.
42
+ * Do not set if data source is never partitioned.
43
+ */
44
+ sheets, }: {
45
+ sourceId?: MaybeRefOrGetter<JsonCompatible<T> | undefined>;
46
+ model: MaybeRefOrGetter<PlDataTableModel | undefined>;
47
+ sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;
48
+ }): ComputedRef<PlDataTableSettingsV2>;
29
49
  /** PlTableFilters restriction entry */
30
50
  export type PlTableFiltersRestriction = {
31
51
  /** Spec of the column for which filter types should be restricted */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgDataTable/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,uBAAuB,EACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,MAAM,yBAAyB,GAAG;IACtC,6DAA6D;IAC7D,UAAU,EAAE,QAAQ,CAAC;IACrB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,+CAA+C;IAC/C,MAAM,CAAC,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AC;IAC3B,2CAA2C;IAC3C,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAC3C,+BAA+B;IAC/B,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,EAAE,CAAC;CACb,GAAG;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B,CAAC"}
@@ -0,0 +1,55 @@
1
+ import "../../sdk/model/dist/index.js";
2
+ import { computed as c, toValue as t } from "vue";
3
+ import { canonicalizeJson as u } from "../../lib/model/common/dist/index.js";
4
+ function m({
5
+ /**
6
+ * Block property (such as inputAnchor) used to produce the data source.
7
+ * Mandatory for cases when the table can change without block run.
8
+ * Skip when the table is changed only after block run.
9
+ * Ask developers for help if you don't know what to set here.
10
+ */
11
+ sourceId: l,
12
+ /** Block output created by `createPlDataTableV2` */
13
+ model: n,
14
+ /**
15
+ * Sheets for partitioned data sources.
16
+ * Do not set if data source is never partitioned.
17
+ */
18
+ sheets: s
19
+ }) {
20
+ return c(() => {
21
+ const o = t(n);
22
+ if (l) {
23
+ const e = t(l);
24
+ if (s) {
25
+ const r = t(s);
26
+ return e && r ? {
27
+ sourceId: u(e),
28
+ sheets: r,
29
+ model: o
30
+ } : { sourceId: null };
31
+ } else
32
+ return e ? {
33
+ sourceId: u(e),
34
+ sheets: [],
35
+ model: o
36
+ } : { sourceId: null };
37
+ } else if (s) {
38
+ const e = t(s);
39
+ return e ? {
40
+ sourceId: u("static"),
41
+ sheets: e,
42
+ model: o
43
+ } : { sourceId: null };
44
+ } else
45
+ return o ? {
46
+ sourceId: u("static"),
47
+ sheets: [],
48
+ model: o
49
+ } : { sourceId: null };
50
+ });
51
+ }
52
+ export {
53
+ m as usePlDataTableSettingsV2
54
+ };
55
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/PlAgDataTable/types.ts"],"sourcesContent":["import {\n canonicalizeJson,\n type JsonCompatible,\n type AxisId,\n type CanonicalizedJson,\n type ListOptionBase,\n type LocalBlobHandleAndSize,\n type PlDataTableModel,\n type PlDataTableSheet,\n type PlDataTableSheetState,\n type PlTableFilter,\n type PlTableFilterType,\n type PTableColumnId,\n type PTableColumnSpec,\n type PTableHandle,\n type PTableKey,\n type PTableRowKey,\n type PTableValue,\n type RemoteBlobHandleAndSize,\n} from '@platforma-sdk/model';\nimport type { PTableHidden } from './sources/common';\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\n\nexport type PlDataTableSettingsPTable = {\n /** The type of the source to feed the data into the table */\n sourceType: 'ptable';\n /** PTable handle output */\n pTable?: PTableHandle;\n /** Sheets that we want to show in our table */\n sheets?: PlDataTableSheet[];\n};\n\nexport type PlDataTableSettingsXsv = {\n /** The type of the source to feed the data into the table */\n sourceType: 'xsv';\n xsvFile?: LocalBlobHandleAndSize | RemoteBlobHandleAndSize;\n};\n\n/** Data table settings */\nexport type PlDataTableSettings =\n | undefined\n | PlDataTableSettingsPTable\n | PlDataTableSettingsXsv;\n\n/** Data table V2 settings */\nexport type PlDataTableSettingsV2 =\n | { sourceId: null }\n | {\n /** Unique source id for state caching */\n sourceId: string;\n /** Sheets that we want to show in our table */\n sheets: PlDataTableSheet[];\n /** Result of `createPlDataTableV2` */\n model: PlDataTableModel | undefined;\n };\n\nexport function usePlDataTableSettingsV2<T = string>({\n /**\n * Block property (such as inputAnchor) used to produce the data source.\n * Mandatory for cases when the table can change without block run.\n * Skip when the table is changed only after block run.\n * Ask developers for help if you don't know what to set here.\n */\n sourceId,\n /** Block output created by `createPlDataTableV2` */\n model,\n /**\n * Sheets for partitioned data sources.\n * Do not set if data source is never partitioned.\n */\n sheets,\n}: {\n sourceId?: MaybeRefOrGetter<JsonCompatible<T> | undefined>;\n model: MaybeRefOrGetter<PlDataTableModel | undefined>;\n sheets?: MaybeRefOrGetter<PlDataTableSheet[] | undefined>;\n}): ComputedRef<PlDataTableSettingsV2> {\n return computed(() => {\n const modelValue = toValue(model);\n if (sourceId) {\n const sourceIdValue = toValue(sourceId);\n if (sheets) {\n const sheetsValue = toValue(sheets);\n return sourceIdValue && sheetsValue\n ? {\n sourceId: canonicalizeJson(sourceIdValue),\n sheets: sheetsValue,\n model: modelValue,\n }\n : { sourceId: null };\n } else {\n return sourceIdValue\n ? {\n sourceId: canonicalizeJson(sourceIdValue),\n sheets: [],\n model: modelValue,\n }\n : { sourceId: null };\n }\n } else {\n if (sheets) {\n const sheetsValue = toValue(sheets);\n return sheetsValue\n ? {\n sourceId: canonicalizeJson<string>('static'),\n sheets: sheetsValue,\n model: modelValue,\n }\n : { sourceId: null };\n } else {\n return modelValue\n ? {\n sourceId: canonicalizeJson<string>('static'),\n sheets: [],\n model: modelValue,\n }\n : { sourceId: null };\n }\n }\n });\n};\n\n/** PlTableFilters restriction entry */\nexport type PlTableFiltersRestriction = {\n /** Spec of the column for which filter types should be restricted */\n column: PTableColumnId;\n /** List of filter types applicable to the column */\n allowedFilterTypes: PlTableFilterType[];\n};\n\n/** PlTableFilters default settings entry */\nexport type PlTableFiltersDefault = {\n /** Spec of the column the default should be applied */\n column: PTableColumnId;\n /** Filter entry */\n default: PlTableFilter;\n};\n\n/** PlAgDataTable controller contains all exported methods */\nexport type PlAgDataTableController = {\n /**\n * Scroll table to make row with provided key visible\n * Warning: works reliably only in client side mode.\n */\n focusRow: (rowKey: PTableRowKey) => Promise<void>;\n};\n\n/** PlAgDataTable controller contains all exported methods */\nexport type PlAgDataTableV2Controller = {\n /**\n * Scroll table to make row with provided key visible\n * Warning: works reliably only in client side mode.\n */\n focusRow: (rowKey: PTableKey) => Promise<void>;\n};\n\n/**\n * Canonicalized PTableValue array JSON string\n * @deprecated Migrate to PlAgDataTableV2\n */\nexport type PTableRowKeyJson = CanonicalizedJson<PTableRowKey>;\n\n/** PlAgDataTable row */\nexport type PlAgDataTableRow = {\n /** Axis key is not present for heterogeneous axes */\n key?: PTableRowKey;\n /** Unique row identifier, created as canonicalize(key)! when key is present */\n id: PTableRowKeyJson | `${number}`;\n /** Row values by column; sheet axes and labeled axes are excluded */\n [field: `${number}` | `hC${number}`]: PTableValue;\n};\n\nexport type PTableKeyJson = CanonicalizedJson<PTableKey>;\n\n/** PlAgDataTableV2 row */\nexport type PlAgDataTableV2Row = {\n /** Axis key is not present for heterogeneous axes */\n key?: PTableKey;\n /** Unique row identifier, created as canonicalize(key)! when key is present */\n id: PTableKeyJson;\n /** Row values by column; sheet axes and labeled axes are excluded */\n [field: `${number}`]: PTableValue | PTableHidden;\n};\n\nexport type PlAgOverlayLoadingParams = {\n /**\n * Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.\n */\n notReady?: boolean;\n /**\n * Prop to override default \"Loading\" text\n */\n loadingText?: string;\n /**\n * Prop to override default \"No datasource\" text (So why props name is notReady? Good question)\n */\n notReadyText?: string;\n /**\n * Use \"transparent\" to make table headers visible below the loading layer\n */\n overlayType?: 'transparent';\n};\n\nexport type PlAgOverlayNoRowsParams = {\n /**\n * Prop to override default \"Empty\" text\n */\n text?: string;\n};\n\nexport type PlDataTableSheetsSettings = {\n /** User-provided sheets for the sourceId */\n sheets: PlDataTableSheet[];\n /** Persisted selection for the sourceId */\n cachedState: PlDataTableSheetState[];\n};\n\nexport type PlDataTableSheetNormalized = {\n /** id of the axis */\n axisId: AxisId;\n /** sheet prefix */\n prefix: string;\n /** options to show in the filter dropdown */\n options: ListOptionBase<string | number>[];\n /** default (selected) value */\n defaultValue: string | number;\n};\n\nexport type PlDataTableColumnsInfo = {\n sourceId: null;\n columns: [];\n} | {\n sourceId: string;\n columns: PTableColumnSpec[];\n};\n"],"names":["usePlDataTableSettingsV2","sourceId","model","sheets","computed","modelValue","toValue","sourceIdValue","sheetsValue","canonicalizeJson"],"mappings":";;;AAyDO,SAASA,EAAqC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnD,UAAAC;AAAA;AAAA,EAEA,OAAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAAC;AACF,GAIuC;AACrC,SAAOC,EAAS,MAAM;AACd,UAAAC,IAAaC,EAAQJ,CAAK;AAChC,QAAID,GAAU;AACN,YAAAM,IAAgBD,EAAQL,CAAQ;AACtC,UAAIE,GAAQ;AACJ,cAAAK,IAAcF,EAAQH,CAAM;AAClC,eAAOI,KAAiBC,IACpB;AAAA,UACE,UAAUC,EAAiBF,CAAa;AAAA,UACxC,QAAQC;AAAA,UACR,OAAOH;AAAA,QAAA,IAET,EAAE,UAAU,KAAK;AAAA,MAAA;AAErB,eAAOE,IACH;AAAA,UACE,UAAUE,EAAiBF,CAAa;AAAA,UACxC,QAAQ,CAAC;AAAA,UACT,OAAOF;AAAA,QAAA,IAET,EAAE,UAAU,KAAK;AAAA,IACvB,WAEIF,GAAQ;AACJ,YAAAK,IAAcF,EAAQH,CAAM;AAClC,aAAOK,IACH;AAAA,QACE,UAAUC,EAAyB,QAAQ;AAAA,QAC3C,QAAQD;AAAA,QACR,OAAOH;AAAA,MAAA,IAET,EAAE,UAAU,KAAK;AAAA,IAAA;AAErB,aAAOA,IACH;AAAA,QACE,UAAUI,EAAyB,QAAQ;AAAA,QAC3C,QAAQ,CAAC;AAAA,QACT,OAAOJ;AAAA,MAAA,IAET,EAAE,UAAU,KAAK;AAAA,EAEzB,CACD;AACH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../lib/model/common/src/drivers/blob.ts","../../../../../../../lib/model/common/src/drivers/pframe/data_types.ts","../../../../../../../lib/model/common/src/drivers/pframe/spec/spec.ts","../../../../../../../lib/model/common/src/ref.ts","../../../../../../../lib/model/common/src/base32-encode.ts","../../../../../../../lib/model/common/src/plid.ts","../../../../../../../lib/model/common/src/json.ts","../../../../../../../lib/model/common/src/errors.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less or equal than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number(),\n /** Excluded right border. */\n to: z.number(),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n return { from, to };\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.to < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /** Given the blob handle returns its content. Depending on the handle type,\n * content will be served from locally downloaded file, or directly from\n * remote platforma storage. */\n getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;\n}\n","import type { ValueType } from './spec/spec';\n\nexport const PValueIntNA = -2147483648;\nexport const PValueLongNA = -9007199254740991n;\nexport const PValueFloatNA = NaN; // do not change, isNaN is used in other cases\nexport const PValueDoubleNA = NaN; // do not change, isNaN is used in other cases\nexport const PValueStringNA = null;\nexport const PValueBytesNA = null;\n\nexport type PValueInt = number;\nexport type PValueLong = number | bigint; // use bigint only if extra integer precision is needed\nexport type PValueFloat = number;\nexport type PValueDouble = number;\nexport type PValueString = string | null;\nexport type PValueBytes = Uint8Array | null;\n\nexport type NotNAPValueInt = number;\nexport type NotNAPValueLong = number | bigint; // use bigint only if extra integer precision is needed\nexport type NotNAPValueFloat = number;\nexport type NotNAPValueDouble = number;\nexport type NotNAPValueString = string;\n\nexport type NotNAPValue = number | bigint | string;\n\nexport type PValue =\n | PValueInt\n | PValueLong\n // Doesn't differ from PValueInt, TODO: branded types for these PValue* types?\n // | PValueFloat\n // | PValueDouble\n | PValueString\n | PValueBytes;\n\nexport function isValueNA(value: unknown, valueType: ValueType): boolean {\n switch (valueType) {\n case 'Int':\n return value === PValueIntNA;\n case 'Long':\n return value === Number(PValueLongNA) || value === PValueLongNA;\n case 'Float':\n return Number.isNaN(value);\n case 'Double':\n return Number.isNaN(value);\n case 'String':\n return value === PValueStringNA;\n case 'Bytes':\n return value === PValueBytesNA;\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport function ensureNotNAPValue(value: string): string;\nexport function ensureNotNAPValue(value: number): number;\nexport function ensureNotNAPValue(value: bigint): bigint;\nexport function ensureNotNAPValue(value: unknown): NotNAPValue;\nexport function ensureNotNAPValue(value: unknown): NotNAPValue {\n if (!isNotNAPValue(value)) throw new Error(`Expected not-NA PValue, got ${value}`);\n return value;\n}\n\nexport function isNotNAPValue(value: unknown, valueType: 'Int'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'Long'): value is number | bigint;\nexport function isNotNAPValue(value: unknown, valueType: 'Float'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'Double'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'String'): value is string;\nexport function isNotNAPValue(value: unknown, valueType: ValueType): value is NotNAPValue;\nexport function isNotNAPValue(value: unknown): value is NotNAPValue;\nexport function isNotNAPValue(value: unknown, valueType?: ValueType): boolean {\n if (!valueType)\n return (\n typeof value === 'string'\n || (typeof value === 'number' && isFinite(value))\n || typeof value === 'bigint'\n );\n if (isValueNA(value, valueType)) return false;\n switch (valueType) {\n case 'Int':\n return typeof value === 'number';\n case 'Long':\n return typeof value === 'number' || typeof value === 'bigint';\n case 'Float':\n return typeof value === 'number';\n case 'Double':\n return typeof value === 'number';\n case 'String':\n return typeof value === 'string';\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport function isPValue(value: unknown, valueType: 'Int'): value is PValueInt;\nexport function isPValue(value: unknown, valueType: 'Long'): value is PValueLong;\nexport function isPValue(value: unknown, valueType: 'Float'): value is PValueFloat;\nexport function isPValue(value: unknown, valueType: 'Double'): value is PValueDouble;\nexport function isPValue(value: unknown, valueType: 'String'): value is PValueString;\nexport function isPValue(value: unknown, valueType: ValueType): value is PValue;\nexport function isPValue(value: unknown): value is PValue;\nexport function isPValue(value: unknown, valueType?: ValueType): boolean {\n if (!valueType)\n return (\n value === null\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'bigint'\n );\n if (isValueNA(value, valueType)) return true;\n switch (valueType) {\n case 'Int':\n return typeof value === 'number';\n case 'Long':\n return typeof value === 'number' || typeof value === 'bigint';\n case 'Float':\n return typeof value === 'number';\n case 'Double':\n return typeof value === 'number';\n case 'String':\n return typeof value === 'string';\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport type PValueLongJsonSafe = { bigint: string };\nexport type PValueJsonSafe = number | string | null | PValueLongJsonSafe;\n\n/**\n * Converts PValue to value that can be safely serialized by standard JSON.stringify\n * method. Use {@link safeConvertToPValue} to \"deserialize\" the value back to runtime\n * PValue representation.\n */\nexport function toJsonSafePValue(value: PValue): PValueJsonSafe {\n if (value === null || typeof value === 'string' || typeof value === 'number') return value;\n if (typeof value === 'bigint') return { bigint: value.toString() };\n throw new Error(`Type ${typeof value} (value ${value}) not yet supported.`);\n}\n\n/**\n * Can be used to \"deserialize\" result of {@link toJsonSafePValue} or to\n * safely cast any unknown value to actual runtime PValue representation.\n */\nexport function safeConvertToPValue(value: unknown, checkType?: ValueType): PValue {\n if (\n value === null\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'bigint'\n ) {\n if (checkType && !isValueNA(value, checkType) && !isPValue(value, checkType))\n throw new Error(`Unexpected value type, got ${typeof value}, expected ${checkType}`);\n return value;\n }\n\n if (\n typeof value === 'object'\n && value !== null\n && 'bigint' in value\n && typeof value.bigint === 'string'\n ) {\n if (checkType && checkType !== 'Long')\n throw new Error(`Unexpected value type, got serialized bigint, expected ${checkType}`);\n\n return BigInt(value.bigint);\n }\n\n throw new Error(`Unsupported type ${typeof value} (value ${value}).`);\n}\n\nexport function pValueToStringOrNumber(value: string): string;\nexport function pValueToStringOrNumber(value: number | bigint): number;\nexport function pValueToStringOrNumber(value: PValue | PValueJsonSafe): string | number;\nexport function pValueToStringOrNumber(value: PValue | PValueJsonSafe): string | number {\n value = pValueToStringOrNumberOrNull(value);\n if (value === null) throw new Error('Value is null');\n return value;\n}\n\nexport function pValueToStringOrNumberOrNull(value: string | null): string;\nexport function pValueToStringOrNumberOrNull(value: number | bigint | null): number;\nexport function pValueToStringOrNumberOrNull(\n value: PValue | PValueJsonSafe\n): string | number | null;\nexport function pValueToStringOrNumberOrNull(\n value: PValue | PValueJsonSafe,\n): string | number | null {\n value = safeConvertToPValue(value);\n if (value === null) return null;\n if (typeof value === 'string') return value;\n if (typeof value === 'number') {\n if (!isFinite(value)) throw new Error(`Value is not finite (${value})`);\n return value;\n }\n if (typeof value === 'bigint') {\n // @TODO add range check\n return Number(value);\n }\n throw new Error(`Unexpected value type: ${typeof value}`);\n}\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = PValueString[];\nexport type PVectorDataBytes = PValueBytes[];\n\nexport type PVectorData =\n | PVectorDataInt\n | PVectorDataLong\n | PVectorDataFloat\n | PVectorDataDouble\n | PVectorDataString\n | PVectorDataBytes;\n\n/** Table column data in comparison to the data stored in a separate PColumn\n * may have some of the values \"absent\", i.e. as a result of missing record in\n * outer join operation. This information is encoded in {@link absent} field. */\nexport interface PTableVector {\n /** Stored data type */\n readonly type: ValueType;\n\n /** Values for present positions, absent positions have NA values */\n readonly data: PVectorData;\n\n /**\n * Encoded bit array marking some elements of this vector as absent,\n * call {@link isValueAbsent} to read the data.\n * */\n readonly absent: Uint8Array;\n}\n\n/** Used to read bit array with value absence information */\nexport function isValueAbsent(absent: Uint8Array, index: number): boolean {\n const chunkIndex = Math.floor(index / 8);\n const mask = 1 << (7 - (index % 8));\n return (absent[chunkIndex] & mask) > 0;\n}\n\nexport const PTableAbsent = { type: 'absent' } as const;\nexport type PTableAbsent = typeof PTableAbsent;\nexport const PTableNA = null;\nexport type PTableNA = typeof PTableNA;\n\n/** Decoded PTable value */\nexport type PTableValue = PTableAbsent | PTableNA | number | string;\n\n/** Type guard for absent PValue */\nexport function isPTableAbsent(value: PTableValue): value is PTableAbsent {\n return typeof value === 'object' && value !== null && value.type === 'absent';\n}\n\nexport type AbsentAndNAFill = {\n na?: PTableValue;\n absent?: PTableValue;\n};\n\n/** Read PTableValue from PTable column at specified row */\nexport function pTableValue(\n column: PTableVector,\n row: number,\n fill: AbsentAndNAFill = {},\n): PTableValue {\n if (isValueAbsent(column.absent, row))\n return fill.absent === undefined ? PTableAbsent : fill.absent;\n\n const value = column.data[row];\n const valueType = column.type;\n if (isValueNA(value, valueType)) return fill.na === undefined ? PTableNA : fill.na;\n\n switch (valueType) {\n case 'Int':\n return value as PVectorDataInt[number];\n case 'Long':\n return Number(value as PVectorDataLong[number]);\n case 'Float':\n return value as PVectorDataFloat[number];\n case 'Double':\n return value as PVectorDataDouble[number];\n case 'String':\n return value as PVectorDataString[number];\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\n/** Used in requests to partially retrieve table's data */\nexport type TableRange = {\n /** Index of the first record to retrieve */\n readonly offset: number;\n\n /** Block length */\n readonly length: number;\n};\n\n/** Unified information about table shape */\nexport type PTableShape = {\n /** Number of unified table columns, including all axes and PColumn values */\n columns: number;\n\n /** Number of rows */\n rows: number;\n};\n","import type { PObject, PObjectId, PObjectSpec } from '../../../pool';\nimport canonicalize from 'canonicalize';\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = 'Int' | 'Long' | 'Float' | 'Double' | 'String' | 'Bytes';\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n * */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n * */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/**\n * Canonicalizes axis id\n * @deprecated Use {@link canonicalizeJson} instead to preserve type\n */\nexport function canonicalizeAxisId(id: AxisId): string {\n return canonicalize(getAxisId(id))!;\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n","import { z } from 'zod';\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe('Crucial marker for the block dependency tree reconstruction'),\n blockId: z.string()\n .describe('Upstream block id'),\n name: z.string()\n .describe('Name of the output provided to the upstream block\\'s output context'),\n requireEnrichments: z.literal(true).optional()\n .describe('True if current block that stores this reference in its args, may need enrichments '\n + 'for the references value originating from the blocks in between current and referenced block'),\n })\n .describe(\n 'Universal reference type, allowing to set block connections. It is crucial that '\n + '{@link __isRef} is present and equal to true, internal logic relies on this marker '\n + 'to build block dependency trees.',\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === 'object'\n && value !== null\n && '__isRef' in value\n && (value as { __isRef: unknown }).__isRef === true\n && 'blockId' in value\n && 'name' in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);\n}\n","type Data = Int8Array | Uint8Array | Uint8ClampedArray | ArrayBuffer;\n\nfunction toDataView(data: Data) {\n if (data instanceof Int8Array || data instanceof Uint8Array || data instanceof Uint8ClampedArray)\n return new DataView(data.buffer, data.byteOffset, data.byteLength);\n\n if (data instanceof ArrayBuffer) return new DataView(data);\n\n throw new TypeError(\n 'Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray',\n );\n}\n\ninterface Options {\n /** If set, forcefully enable or disable padding. The default behavior is to follow the default of the selected variant. */\n padding?: boolean;\n}\n\nconst RFC4648 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\nconst RFC4648_HEX = '0123456789ABCDEFGHIJKLMNOPQRSTUV';\nconst CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';\n\nexport function base32Encode(\n data: Data,\n variant: 'RFC3548' | 'RFC4648' | 'RFC4648-HEX' | 'Crockford',\n options?: Options,\n) {\n options = options || {};\n let alphabet, defaultPadding;\n\n switch (variant) {\n case 'RFC3548':\n case 'RFC4648':\n alphabet = RFC4648;\n defaultPadding = true;\n break;\n case 'RFC4648-HEX':\n alphabet = RFC4648_HEX;\n defaultPadding = true;\n break;\n case 'Crockford':\n alphabet = CROCKFORD;\n defaultPadding = false;\n break;\n default:\n throw new Error('Unknown base32 variant: ' + String(variant));\n }\n\n const padding = options.padding !== undefined ? options.padding : defaultPadding;\n const view = toDataView(data);\n\n let bits = 0;\n let value = 0;\n let output = '';\n\n for (let i = 0; i < view.byteLength; i++) {\n value = (value << 8) | view.getUint8(i);\n bits += 8;\n\n while (bits >= 5) {\n output += alphabet[(value >>> (bits - 5)) & 31];\n bits -= 5;\n }\n }\n\n if (bits > 0) output += alphabet[(value << (5 - bits)) & 31];\n\n if (padding)\n while (output.length % 8 !== 0) {\n output += '=';\n }\n\n return output;\n}\n","import { z } from 'zod';\nimport { base32Encode } from './base32-encode';\n\n/** Number of raw bytes in the PlId. */\nexport const PlIdBytes = 15;\n/** Characters in string representation */\nexport const PlIdLength = 24; // = 15 bytes * 8 bits / 5 bits per char in base32\n\nexport const PlId = z\n .string()\n .length(PlIdLength)\n .regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/) // RFC4648\n .brand('PlId');\nexport type PlId = z.infer<typeof PlId>;\n\nexport function uniquePlId(): PlId {\n const data = new Uint8Array(PlIdBytes);\n crypto.getRandomValues(data);\n return PlId.parse(base32Encode(data, 'RFC4648'));\n}\n\nexport function plId(bytes: Uint8Array): PlId {\n if (bytes.length !== PlIdBytes) throw new Error(`Wrong number of bytes: ${bytes.length}`);\n return PlId.parse(base32Encode(bytes, 'RFC4648'));\n}\n\nexport async function digestPlId(data: string): Promise<PlId> {\n const encoder = new TextEncoder();\n const bytes = await crypto.subtle.digest('SHA-256', encoder.encode(data));\n return plId(new Uint8Array(bytes.slice(0, 15)));\n}\n","import canonicalize from 'canonicalize';\n\ntype JsonPrimitive = string | number | boolean | null | undefined;\n\ntype JsonValue = JsonPrimitive | JsonValue[] | {\n [key: string]: JsonValue;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\ntype NotAssignableToJson = bigint | symbol | Function;\n\ntype JsonCompatible<T> = unknown extends T ? never : {\n [P in keyof T]:\n T[P] extends JsonValue ? T[P] :\n T[P] extends NotAssignableToJson ? never :\n JsonCompatible<T[P]>;\n};\n\nexport type StringifiedJson<T> = JsonCompatible<T> extends never ? never : string & {\n __json_stringified: T;\n};\n\nexport function stringifyJson<T>(value: JsonCompatible<T>): StringifiedJson<T> {\n return JSON.stringify(value)! as StringifiedJson<T>;\n}\n\nexport type CanonicalizedJson<T> = JsonCompatible<T> extends never ? never : string & {\n __json_canonicalized: T;\n};\n\nexport function canonicalizeJson<T>(value: JsonCompatible<T>): CanonicalizedJson<T> {\n return canonicalize(value)! as CanonicalizedJson<T>;\n}\n\nexport function parseJson<T>(value: StringifiedJson<T> | CanonicalizedJson<T>): T {\n return JSON.parse(value) as T;\n}\n","/**\n * Just for convenience, usually it is an Error with name 'AbortError'\n */\nexport class AbortError extends Error {\n name = 'AbortError';\n}\n\n/**\n * Throw this to show a message without stack trace in UI\n */\nexport class UiError extends Error {\n name = 'UiError';\n}\n\nexport function isAbortError(error: unknown): error is Error & { name: 'AbortError' } {\n return error instanceof Error && error.name === 'AbortError';\n}\n\nexport function hasAbortError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n\n return error.name === 'AbortError' || hasAbortError(error.cause);\n}\n\nexport function isAggregateError(error: unknown): error is AggregateError {\n return error instanceof Error && error.name === 'AggregateError';\n}\n\nfunction stringifyValue(value: unknown): string {\n if (typeof value === 'string') {\n return `String value was thrown: ${value}`;\n }\n\n if (value && typeof value === 'object') {\n try {\n return `Plain object was thrown: ${JSON.stringify(value)}`;\n } catch (jsonError) {\n const errorMessage = jsonError instanceof Error ? jsonError.message : String(jsonError);\n return `Non-serializable object was thrown (JSON.stringify failed: ${errorMessage}): ${String(value)}`;\n }\n }\n\n return String(`Non-Error value (${typeof value}) was thrown: ${value}`);\n}\n\nexport function ensureError(value: unknown): Error {\n if (value instanceof Error) {\n return value;\n }\n\n return new Error(stringifyValue(value));\n}\n\n// Error serialization for IPC/network transmission (Error objects can't be JSON serialized)\n\nexport type SerializedError = {\n name: string;\n message: string;\n stack: string | undefined;\n cause?: SerializedError;\n};\n\nexport function deserializeError(obj: SerializedError): Error {\n const cause = obj.cause ? deserializeError(obj.cause) : undefined;\n\n const error = new Error(obj.message, cause !== undefined ? { cause } : undefined);\n error.name = obj.name || 'Error';\n error.stack = obj.stack;\n\n return error;\n}\n\nexport function serializeError(e: unknown): SerializedError {\n const error = ensureError(e);\n const cause = error.cause ? serializeError(error.cause) : undefined;\n\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...(error.cause !== undefined && { cause }),\n };\n}\n\nexport type ResultOrError<S, F = Error> = {\n value: S;\n error?: undefined;\n} | {\n error: F;\n};\n\nexport function unwrapResult<T>(result: ResultOrError<T>): T {\n if (result.error) {\n throw result.error;\n }\n return result.value;\n}\n\nexport function serializeResult<T>(result: ResultOrError<T>): ResultOrError<T, SerializedError> {\n if (result.error) {\n return { error: serializeError(result.error) };\n }\n return { value: result.value };\n}\n\nexport function deserializeResult<T>(result: ResultOrError<T, SerializedError>): ResultOrError<T> {\n if (result.error) {\n return { error: deserializeError(result.error) };\n }\n return { value: result.value };\n}\n\nexport function wrapCallback<T>(callback: () => T): ResultOrError<T> {\n try {\n const value = callback();\n return { value };\n } catch (error) {\n return { error: ensureError(error) };\n }\n}\n\nexport async function wrapAsyncCallback<T>(callback: () => Promise<T>): Promise<ResultOrError<T>> {\n try {\n const value = await callback();\n return { value };\n } catch (error) {\n return { error: ensureError(error) };\n }\n}\n\nexport function wrapAndSerialize<T>(callback: () => T): ResultOrError<T, SerializedError> {\n const result = wrapCallback(callback);\n return serializeResult(result);\n}\n\nexport async function wrapAndSerializeAsync<T>(callback: () => Promise<T>): Promise<ResultOrError<T, SerializedError>> {\n const result = await wrapAsyncCallback(callback);\n return serializeResult(result);\n}\n"],"names":["z","PValueIntNA","PValueLongNA","PValueStringNA","PValueBytesNA","isValueNA","value","valueType","isValueAbsent","absent","index","chunkIndex","mask","PTableAbsent","PTableNA","isPTableAbsent","pTableValue","column","row","fill","getAxisId","spec","type","name","domain","result","matchDomain","query","target","k","matchAxisId","toDataView","data","RFC4648","RFC4648_HEX","CROCKFORD","base32Encode","variant","options","alphabet","defaultPadding","padding","view","bits","output","i","PlIdBytes","PlIdLength","PlId","uniquePlId","canonicalizeJson","canonicalize","parseJson","stringifyValue","jsonError","ensureError"],"mappings":";;AAyB0BA,EAAE,OAAO;AAAA;AAAA,EAEjC,MAAMA,EAAE,OAAO;AAAA;AAAA,EAEf,IAAIA,EAAE,OAAO;AACf,CAAC;AC5BYC,MAAAA,IAAc,aACdC,IAAe,CAAC,mBAGhBC,IAAiB,MACjBC,IAAgB;AA0Bb,SAAAC,EAAUC,GAAgBC,GAA+B;AACvE,UAAQA,GAAW;AAAA,IACjB,KAAK;AACH,aAAOD,MAAUL;AAAAA,IACnB,KAAK;AACH,aAAOK,MAAU,OAAOJ,CAAY,KAAKI,MAAUJ;AAAAA,IACrD,KAAK;AACI,aAAA,OAAO,MAAMI,CAAK;AAAA,IAC3B,KAAK;AACI,aAAA,OAAO,MAAMA,CAAK;AAAA,IAC3B,KAAK;AACH,aAAOA,MAAUH;AAAAA,IACnB,KAAK;AACH,aAAOG,MAAUF;AAAAA,IACnB;AACQ,YAAA,MAAM,0BAA0BG,CAAyB,EAAE;AAAA,EAAA;AAEvE;AA2LgB,SAAAC,EAAcC,GAAoBC,GAAwB;AAClEC,QAAAA,IAAa,KAAK,MAAMD,IAAQ,CAAC,GACj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../../../../../../lib/model/common/src/drivers/blob.ts","../../../../../../../lib/model/common/src/drivers/pframe/data_types.ts","../../../../../../../lib/model/common/src/drivers/pframe/spec/spec.ts","../../../../../../../lib/model/common/src/ref.ts","../../../../../../../lib/model/common/src/base32-encode.ts","../../../../../../../lib/model/common/src/plid.ts","../../../../../../../lib/model/common/src/json.ts","../../../../../../../lib/model/common/src/errors.ts"],"sourcesContent":["import type { Branded } from '../branding';\nimport { z } from 'zod';\n\n/** Handle of locally downloaded blob. This handle is issued only after the\n * blob's content is downloaded locally, and ready for quick access. */\nexport type LocalBlobHandle = Branded<string, 'LocalBlobHandle'>;\n\n/** Handle of remote blob. This handle is issued as soon as the data becomes\n * available on the remote server. */\nexport type RemoteBlobHandle = Branded<string, 'RemoteBlobHandle'>;\n\n/** Being configured inside the output structure provides information about\n * blob's content and means to retrieve it when needed. */\nexport interface BlobHandleAndSize<\n H extends LocalBlobHandle | RemoteBlobHandle = | LocalBlobHandle\n | RemoteBlobHandle,\n> {\n /** Handle to retrieve block content using {@link BlobDriver.getContent()} */\n readonly handle: H;\n\n /** Blob size in bytes. */\n readonly size: number;\n}\n\n/** Range in bytes, from should be less or equal than to. */\nexport const RangeBytes = z.object({\n /** Included left border. */\n from: z.number(),\n /** Excluded right border. */\n to: z.number(),\n});\n\nexport type RangeBytes = z.infer<typeof RangeBytes>;\n\nexport function newRangeBytesOpt(from?: number, to?: number): RangeBytes | undefined {\n if (from == undefined || to == undefined) {\n return undefined;\n }\n\n return { from, to };\n}\n\nexport function validateRangeBytes(range: RangeBytes, errMsg: string) {\n if (range.from < 0 || range.to < 0 || range.from >= range.to) {\n throw new Error(`${errMsg}: invalid bytes range: ${range}`);\n }\n}\n\n/** Being configured inside the output structure provides information about\n * locally downloaded blob and means to retrieve it's content when needed. This\n * structure is created only after the blob's content is downloaded locally, and\n * ready for quick access. */\nexport type LocalBlobHandleAndSize = BlobHandleAndSize<LocalBlobHandle>;\n\n/** Being configured inside the output structure provides information about\n * remote blob and means to retrieve it's content when needed. This structure\n * is created as soon as remote blob becomes available. */\nexport type RemoteBlobHandleAndSize = BlobHandleAndSize<RemoteBlobHandle>;\n\n/** Defines API of blob driver as it is seen from the block UI code. */\nexport interface BlobDriver {\n /** Given the blob handle returns its content. Depending on the handle type,\n * content will be served from locally downloaded file, or directly from\n * remote platforma storage. */\n getContent(handle: LocalBlobHandle | RemoteBlobHandle, range?: RangeBytes): Promise<Uint8Array>;\n}\n","import type { ValueType } from './spec/spec';\n\nexport const PValueIntNA = -2147483648;\nexport const PValueLongNA = -9007199254740991n;\nexport const PValueFloatNA = NaN; // do not change, isNaN is used in other cases\nexport const PValueDoubleNA = NaN; // do not change, isNaN is used in other cases\nexport const PValueStringNA = null;\nexport const PValueBytesNA = null;\n\nexport type PValueInt = number;\nexport type PValueLong = number | bigint; // use bigint only if extra integer precision is needed\nexport type PValueFloat = number;\nexport type PValueDouble = number;\nexport type PValueString = string | null;\nexport type PValueBytes = Uint8Array | null;\n\nexport type NotNAPValueInt = number;\nexport type NotNAPValueLong = number | bigint; // use bigint only if extra integer precision is needed\nexport type NotNAPValueFloat = number;\nexport type NotNAPValueDouble = number;\nexport type NotNAPValueString = string;\n\nexport type NotNAPValue = number | bigint | string;\n\nexport type PValue =\n | PValueInt\n | PValueLong\n // Doesn't differ from PValueInt, TODO: branded types for these PValue* types?\n // | PValueFloat\n // | PValueDouble\n | PValueString\n | PValueBytes;\n\nexport function isValueNA(value: unknown, valueType: ValueType): boolean {\n switch (valueType) {\n case 'Int':\n return value === PValueIntNA;\n case 'Long':\n return value === Number(PValueLongNA) || value === PValueLongNA;\n case 'Float':\n return Number.isNaN(value);\n case 'Double':\n return Number.isNaN(value);\n case 'String':\n return value === PValueStringNA;\n case 'Bytes':\n return value === PValueBytesNA;\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport function ensureNotNAPValue(value: string): string;\nexport function ensureNotNAPValue(value: number): number;\nexport function ensureNotNAPValue(value: bigint): bigint;\nexport function ensureNotNAPValue(value: unknown): NotNAPValue;\nexport function ensureNotNAPValue(value: unknown): NotNAPValue {\n if (!isNotNAPValue(value)) throw new Error(`Expected not-NA PValue, got ${value}`);\n return value;\n}\n\nexport function isNotNAPValue(value: unknown, valueType: 'Int'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'Long'): value is number | bigint;\nexport function isNotNAPValue(value: unknown, valueType: 'Float'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'Double'): value is number;\nexport function isNotNAPValue(value: unknown, valueType: 'String'): value is string;\nexport function isNotNAPValue(value: unknown, valueType: ValueType): value is NotNAPValue;\nexport function isNotNAPValue(value: unknown): value is NotNAPValue;\nexport function isNotNAPValue(value: unknown, valueType?: ValueType): boolean {\n if (!valueType)\n return (\n typeof value === 'string'\n || (typeof value === 'number' && isFinite(value))\n || typeof value === 'bigint'\n );\n if (isValueNA(value, valueType)) return false;\n switch (valueType) {\n case 'Int':\n return typeof value === 'number';\n case 'Long':\n return typeof value === 'number' || typeof value === 'bigint';\n case 'Float':\n return typeof value === 'number';\n case 'Double':\n return typeof value === 'number';\n case 'String':\n return typeof value === 'string';\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport function isPValue(value: unknown, valueType: 'Int'): value is PValueInt;\nexport function isPValue(value: unknown, valueType: 'Long'): value is PValueLong;\nexport function isPValue(value: unknown, valueType: 'Float'): value is PValueFloat;\nexport function isPValue(value: unknown, valueType: 'Double'): value is PValueDouble;\nexport function isPValue(value: unknown, valueType: 'String'): value is PValueString;\nexport function isPValue(value: unknown, valueType: ValueType): value is PValue;\nexport function isPValue(value: unknown): value is PValue;\nexport function isPValue(value: unknown, valueType?: ValueType): boolean {\n if (!valueType)\n return (\n value === null\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'bigint'\n );\n if (isValueNA(value, valueType)) return true;\n switch (valueType) {\n case 'Int':\n return typeof value === 'number';\n case 'Long':\n return typeof value === 'number' || typeof value === 'bigint';\n case 'Float':\n return typeof value === 'number';\n case 'Double':\n return typeof value === 'number';\n case 'String':\n return typeof value === 'string';\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\nexport type PValueLongJsonSafe = { bigint: string };\nexport type PValueJsonSafe = number | string | null | PValueLongJsonSafe;\n\n/**\n * Converts PValue to value that can be safely serialized by standard JSON.stringify\n * method. Use {@link safeConvertToPValue} to \"deserialize\" the value back to runtime\n * PValue representation.\n */\nexport function toJsonSafePValue(value: PValue): PValueJsonSafe {\n if (value === null || typeof value === 'string' || typeof value === 'number') return value;\n if (typeof value === 'bigint') return { bigint: value.toString() };\n throw new Error(`Type ${typeof value} (value ${value}) not yet supported.`);\n}\n\n/**\n * Can be used to \"deserialize\" result of {@link toJsonSafePValue} or to\n * safely cast any unknown value to actual runtime PValue representation.\n */\nexport function safeConvertToPValue(value: unknown, checkType?: ValueType): PValue {\n if (\n value === null\n || typeof value === 'string'\n || typeof value === 'number'\n || typeof value === 'bigint'\n ) {\n if (checkType && !isValueNA(value, checkType) && !isPValue(value, checkType))\n throw new Error(`Unexpected value type, got ${typeof value}, expected ${checkType}`);\n return value;\n }\n\n if (\n typeof value === 'object'\n && value !== null\n && 'bigint' in value\n && typeof value.bigint === 'string'\n ) {\n if (checkType && checkType !== 'Long')\n throw new Error(`Unexpected value type, got serialized bigint, expected ${checkType}`);\n\n return BigInt(value.bigint);\n }\n\n throw new Error(`Unsupported type ${typeof value} (value ${value}).`);\n}\n\nexport function pValueToStringOrNumber(value: string): string;\nexport function pValueToStringOrNumber(value: number | bigint): number;\nexport function pValueToStringOrNumber(value: PValue | PValueJsonSafe): string | number;\nexport function pValueToStringOrNumber(value: PValue | PValueJsonSafe): string | number {\n value = pValueToStringOrNumberOrNull(value);\n if (value === null) throw new Error('Value is null');\n return value;\n}\n\nexport function pValueToStringOrNumberOrNull(value: string | null): string;\nexport function pValueToStringOrNumberOrNull(value: number | bigint | null): number;\nexport function pValueToStringOrNumberOrNull(\n value: PValue | PValueJsonSafe\n): string | number | null;\nexport function pValueToStringOrNumberOrNull(\n value: PValue | PValueJsonSafe,\n): string | number | null {\n value = safeConvertToPValue(value);\n if (value === null) return null;\n if (typeof value === 'string') return value;\n if (typeof value === 'number') {\n if (!isFinite(value)) throw new Error(`Value is not finite (${value})`);\n return value;\n }\n if (typeof value === 'bigint') {\n // @TODO add range check\n return Number(value);\n }\n throw new Error(`Unexpected value type: ${typeof value}`);\n}\n\nexport type PVectorDataInt = Int32Array;\nexport type PVectorDataLong = BigInt64Array;\nexport type PVectorDataFloat = Float32Array;\nexport type PVectorDataDouble = Float64Array;\nexport type PVectorDataString = PValueString[];\nexport type PVectorDataBytes = PValueBytes[];\n\nexport type PVectorData =\n | PVectorDataInt\n | PVectorDataLong\n | PVectorDataFloat\n | PVectorDataDouble\n | PVectorDataString\n | PVectorDataBytes;\n\n/** Table column data in comparison to the data stored in a separate PColumn\n * may have some of the values \"absent\", i.e. as a result of missing record in\n * outer join operation. This information is encoded in {@link absent} field. */\nexport interface PTableVector {\n /** Stored data type */\n readonly type: ValueType;\n\n /** Values for present positions, absent positions have NA values */\n readonly data: PVectorData;\n\n /**\n * Encoded bit array marking some elements of this vector as absent,\n * call {@link isValueAbsent} to read the data.\n * */\n readonly absent: Uint8Array;\n}\n\n/** Used to read bit array with value absence information */\nexport function isValueAbsent(absent: Uint8Array, index: number): boolean {\n const chunkIndex = Math.floor(index / 8);\n const mask = 1 << (7 - (index % 8));\n return (absent[chunkIndex] & mask) > 0;\n}\n\nexport const PTableAbsent = { type: 'absent' } as const;\nexport type PTableAbsent = typeof PTableAbsent;\nexport const PTableNA = null;\nexport type PTableNA = typeof PTableNA;\n\n/** Decoded PTable value */\nexport type PTableValue = PTableAbsent | PTableNA | number | string;\n\n/** Type guard for absent PValue */\nexport function isPTableAbsent(value: PTableValue): value is PTableAbsent {\n return typeof value === 'object' && value !== null && value.type === 'absent';\n}\n\nexport type AbsentAndNAFill = {\n na?: PTableValue;\n absent?: PTableValue;\n};\n\n/** Read PTableValue from PTable column at specified row */\nexport function pTableValue(\n column: PTableVector,\n row: number,\n fill: AbsentAndNAFill = {},\n): PTableValue {\n if (isValueAbsent(column.absent, row))\n return fill.absent === undefined ? PTableAbsent : fill.absent;\n\n const value = column.data[row];\n const valueType = column.type;\n if (isValueNA(value, valueType)) return fill.na === undefined ? PTableNA : fill.na;\n\n switch (valueType) {\n case 'Int':\n return value as PVectorDataInt[number];\n case 'Long':\n return Number(value as PVectorDataLong[number]);\n case 'Float':\n return value as PVectorDataFloat[number];\n case 'Double':\n return value as PVectorDataDouble[number];\n case 'String':\n return value as PVectorDataString[number];\n case 'Bytes':\n throw Error(`Bytes not yet supported`);\n default:\n throw Error(`unsupported data type: ${valueType satisfies never}`);\n }\n}\n\n/** Used in requests to partially retrieve table's data */\nexport type TableRange = {\n /** Index of the first record to retrieve */\n readonly offset: number;\n\n /** Block length */\n readonly length: number;\n};\n\n/** Unified information about table shape */\nexport type PTableShape = {\n /** Number of unified table columns, including all axes and PColumn values */\n columns: number;\n\n /** Number of rows */\n rows: number;\n};\n","import type { PObject, PObjectId, PObjectSpec } from '../../../pool';\nimport canonicalize from 'canonicalize';\n\n/** PFrame columns and axes within them may store one of these types. */\nexport type ValueType = 'Int' | 'Long' | 'Float' | 'Double' | 'String' | 'Bytes';\n\n/**\n * Specification of an individual axis.\n *\n * Each axis is a part of a composite key that addresses data inside the PColumn.\n *\n * Each record inside a PColumn is addressed by a unique tuple of values set for\n * all the axes specified in the column spec.\n * */\nexport interface AxisSpec {\n /** Type of the axis value. Should not use non-key types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the axis that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /**\n * Parent axes provide contextual grouping for the axis in question, establishing\n * a hierarchy where the current axis is dependent on one or more axes for its\n * full definition and meaning. For instance, in a data structure where each\n * \"container\" axis may contain multiple \"item\" axes, the `item` axis would\n * list the index of the `container` axis in this field to denote its dependency.\n *\n * This means that the identity or significance of the `item` axis is only\n * interpretable when combined with its parent `container` axis. An `item` axis\n * index by itself may be non-unique and only gains uniqueness within the context\n * of its parent `container`. Therefore, the `parentAxes` field is essential for\n * mapping these relationships and ensuring data coherence across nested or\n * multi-level data models.\n *\n * A list of zero-based indices of parent axes in the overall axes specification\n * from the column spec. Each index corresponds to the position of a parent axis\n * in the list that defines the structure of the data model.\n */\n readonly parentAxes?: number[];\n}\n\n/** Common type representing spec for all the axes in a column */\nexport type AxesSpec = AxisSpec[];\n\n/**\n * Full column specification including all axes specs and specs of the column\n * itself.\n *\n * A PColumn in its essence represents a mapping from a fixed size, explicitly\n * typed tuple to an explicitly typed value.\n *\n * (axis1Value1, axis2Value1, ...) -> columnValue\n *\n * Each element in tuple correspond to the axis having the same index in axesSpec.\n * */\nexport interface PUniversalColumnSpec extends PObjectSpec {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: string;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** Any additional information attached to the column that does not affect its\n * identifier */\n readonly annotations?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes specifications */\n readonly axesSpec: AxesSpec;\n}\n\n/**\n * Specification of a data column.\n *\n * Data column is a specialized type of PColumn that stores only simple values (strings and numbers)\n * addressed by multiple keys. This is in contrast to other PColumn variants that can store more complex\n * values like files or other abstract data types. Data columns are optimized for storing and processing\n * basic tabular data.\n */\nexport interface PDataColumnSpec extends PUniversalColumnSpec {\n /** Type of column values */\n readonly valueType: ValueType;\n}\n\n// @todo: change this to PUniversalColumnSpec\nexport type PColumnSpec = PDataColumnSpec;\n\n/** Unique PColumnSpec identifier */\nexport type PColumnSpecId = {\n /** Defines specific type of BObject, the most generic type of unit of\n * information in Platforma Project. */\n readonly kind: 'PColumn';\n\n /** Type of column values */\n readonly valueType: ValueType;\n\n /** Column name */\n readonly name: string;\n\n /** Adds auxiliary information to the axis name, type and parents to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n\n /** A list of zero-based indices of parent axes from the {@link axesSpec} array. */\n readonly parentAxes?: number[];\n\n /** Axes id */\n readonly axesId: AxesId;\n};\n\nexport function getPColumnSpecId(spec: PColumnSpec): PColumnSpecId {\n return {\n kind: spec.kind,\n valueType: spec.valueType,\n name: spec.name,\n domain: spec.domain,\n parentAxes: spec.parentAxes,\n axesId: getAxesId(spec.axesSpec),\n };\n}\n\nexport interface PColumn<Data> extends PObject<Data> {\n /** PColumn spec, allowing it to be found among other PObjects */\n readonly spec: PColumnSpec;\n}\n\n/** Columns in a PFrame also have internal identifier, this object represents\n * combination of specs and such id */\nexport interface PColumnIdAndSpec {\n /** Internal column id within the PFrame */\n readonly columnId: PObjectId;\n\n /** Column spec */\n readonly spec: PColumnSpec;\n}\n\n/** Get column id and spec from a column */\nexport function getColumnIdAndSpec<Data>(column: PColumn<Data>): PColumnIdAndSpec {\n return {\n columnId: column.id,\n spec: column.spec,\n };\n}\n\n/** Information returned by {@link PFrame.listColumns} method */\nexport interface PColumnInfo extends PColumnIdAndSpec {\n /** True if data was associated with this PColumn */\n readonly hasData: boolean;\n}\n\nexport interface AxisId {\n /** Type of the axis or column value. For an axis should not use non-key\n * types like float or double. */\n readonly type: ValueType;\n\n /** Name of the axis or column */\n readonly name: string;\n\n /** Adds auxiliary information to the axis or column name and type to form a\n * unique identifier */\n readonly domain?: Record<string, string>;\n}\n\n/** Array of axis ids */\nexport type AxesId = AxisId[];\n\n/** Extracts axis ids from axis spec */\nexport function getAxisId(spec: AxisSpec): AxisId {\n const { type, name, domain } = spec;\n const result = { type, name };\n if (domain && Object.entries(domain).length > 0) {\n Object.assign(result, { domain });\n }\n return result;\n}\n\n/** Extracts axes ids from axes spec array from column spec */\nexport function getAxesId(spec: AxesSpec): AxesId {\n return spec.map(getAxisId);\n}\n\n/**\n * Canonicalizes axis id\n * @deprecated Use {@link canonicalizeJson} instead to preserve type\n */\nexport function canonicalizeAxisId(id: AxisId): string {\n return canonicalize(getAxisId(id))!;\n}\n\n/** Returns true if all domains from query are found in target */\nfunction matchDomain(query?: Record<string, string>, target?: Record<string, string>) {\n if (query === undefined) return target === undefined;\n if (target === undefined) return true;\n for (const k in target) {\n if (query[k] !== target[k]) return false;\n }\n return true;\n}\n\n/** Returns whether \"match\" axis id is compatible with the \"query\" */\nexport function matchAxisId(query: AxisId, target: AxisId): boolean {\n return query.name === target.name && matchDomain(query.domain, target.domain);\n}\n","import { z } from 'zod';\n\nexport const PlRef = z\n .object({\n __isRef: z\n .literal(true)\n .describe('Crucial marker for the block dependency tree reconstruction'),\n blockId: z.string()\n .describe('Upstream block id'),\n name: z.string()\n .describe('Name of the output provided to the upstream block\\'s output context'),\n requireEnrichments: z.literal(true).optional()\n .describe('True if current block that stores this reference in its args, may need enrichments '\n + 'for the references value originating from the blocks in between current and referenced block'),\n })\n .describe(\n 'Universal reference type, allowing to set block connections. It is crucial that '\n + '{@link __isRef} is present and equal to true, internal logic relies on this marker '\n + 'to build block dependency trees.',\n )\n .readonly();\nexport type PlRef = z.infer<typeof PlRef>;\n/** @deprecated use {@link PlRef} */\nexport type Ref = PlRef;\n\n/**\n * Type guard to check if a value is a PlRef.\n *\n * @param value - The value to check.\n * @returns True if the value is a PlRef, false otherwise.\n */\nexport function isPlRef(value: unknown): value is PlRef {\n return (\n typeof value === 'object'\n && value !== null\n && '__isRef' in value\n && (value as { __isRef: unknown }).__isRef === true\n && 'blockId' in value\n && 'name' in value\n );\n}\n\n/** Standard way how to communicate possible connections given specific\n * requirements for incoming data. */\nexport type Option = {\n /** Fully rendered reference to be assigned for the intended field in block's\n * args */\n readonly ref: PlRef;\n\n /** Label to be present for the user in i.e. drop-down list */\n readonly label: string;\n};\n\n/**\n * Creates a PlRef with the given blockId and name.\n *\n * @param blockId - The blockId of the reference.\n * @param name - The name of the reference.\n * @param requireEnrichments - Whether the reference requires enrichments.\n */\nexport function createPlRef(blockId: string, name: string, requireEnrichments: boolean = false) {\n if (requireEnrichments)\n return {\n __isRef: true,\n blockId,\n name,\n requireEnrichments: true,\n };\n else\n return {\n __isRef: true,\n blockId,\n name,\n };\n}\n\n/**\n * Creates a new PlRef based on an existing one, explicitly setting (default) or removing the\n * requireEnrichments property.\n *\n * @param ref - The original PlRef object.\n * @param requireEnrichments - If true, the `requireEnrichments: true` property is added\n * to the returned PlRef. If false, the `requireEnrichments` property is removed. Defaults to true.\n * @returns A new PlRef object with the `requireEnrichments` property set or removed accordingly.\n */\nexport function withEnrichments(ref: PlRef, requireEnrichments: boolean = true): PlRef {\n if (requireEnrichments)\n return {\n ...ref,\n requireEnrichments: true,\n };\n else {\n const { requireEnrichments: _, ...rest } = ref;\n return rest;\n }\n}\n\n/** Compare two PlRefs and returns true if they are qual */\nexport function plRefsEqual(ref1: PlRef, ref2: PlRef, ignoreEnrichments: boolean = false) {\n return ref1.blockId === ref2.blockId && ref1.name === ref2.name && (ignoreEnrichments || ref1.requireEnrichments === ref2.requireEnrichments);\n}\n","type Data = Int8Array | Uint8Array | Uint8ClampedArray | ArrayBuffer;\n\nfunction toDataView(data: Data) {\n if (data instanceof Int8Array || data instanceof Uint8Array || data instanceof Uint8ClampedArray)\n return new DataView(data.buffer, data.byteOffset, data.byteLength);\n\n if (data instanceof ArrayBuffer) return new DataView(data);\n\n throw new TypeError(\n 'Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray',\n );\n}\n\ninterface Options {\n /** If set, forcefully enable or disable padding. The default behavior is to follow the default of the selected variant. */\n padding?: boolean;\n}\n\nconst RFC4648 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\nconst RFC4648_HEX = '0123456789ABCDEFGHIJKLMNOPQRSTUV';\nconst CROCKFORD = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';\n\nexport function base32Encode(\n data: Data,\n variant: 'RFC3548' | 'RFC4648' | 'RFC4648-HEX' | 'Crockford',\n options?: Options,\n) {\n options = options || {};\n let alphabet, defaultPadding;\n\n switch (variant) {\n case 'RFC3548':\n case 'RFC4648':\n alphabet = RFC4648;\n defaultPadding = true;\n break;\n case 'RFC4648-HEX':\n alphabet = RFC4648_HEX;\n defaultPadding = true;\n break;\n case 'Crockford':\n alphabet = CROCKFORD;\n defaultPadding = false;\n break;\n default:\n throw new Error('Unknown base32 variant: ' + String(variant));\n }\n\n const padding = options.padding !== undefined ? options.padding : defaultPadding;\n const view = toDataView(data);\n\n let bits = 0;\n let value = 0;\n let output = '';\n\n for (let i = 0; i < view.byteLength; i++) {\n value = (value << 8) | view.getUint8(i);\n bits += 8;\n\n while (bits >= 5) {\n output += alphabet[(value >>> (bits - 5)) & 31];\n bits -= 5;\n }\n }\n\n if (bits > 0) output += alphabet[(value << (5 - bits)) & 31];\n\n if (padding)\n while (output.length % 8 !== 0) {\n output += '=';\n }\n\n return output;\n}\n","import { z } from 'zod';\nimport { base32Encode } from './base32-encode';\n\n/** Number of raw bytes in the PlId. */\nexport const PlIdBytes = 15;\n/** Characters in string representation */\nexport const PlIdLength = 24; // = 15 bytes * 8 bits / 5 bits per char in base32\n\nexport const PlId = z\n .string()\n .length(PlIdLength)\n .regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/) // RFC4648\n .brand('PlId');\nexport type PlId = z.infer<typeof PlId>;\n\nexport function uniquePlId(): PlId {\n const data = new Uint8Array(PlIdBytes);\n crypto.getRandomValues(data);\n return PlId.parse(base32Encode(data, 'RFC4648'));\n}\n\nexport function plId(bytes: Uint8Array): PlId {\n if (bytes.length !== PlIdBytes) throw new Error(`Wrong number of bytes: ${bytes.length}`);\n return PlId.parse(base32Encode(bytes, 'RFC4648'));\n}\n\nexport async function digestPlId(data: string): Promise<PlId> {\n const encoder = new TextEncoder();\n const bytes = await crypto.subtle.digest('SHA-256', encoder.encode(data));\n return plId(new Uint8Array(bytes.slice(0, 15)));\n}\n","import canonicalize from 'canonicalize';\n\ntype JsonPrimitive = string | number | boolean | null | undefined;\n\ntype JsonValue = JsonPrimitive | JsonValue[] | {\n [key: string]: JsonValue;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\ntype NotAssignableToJson = bigint | symbol | Function;\n\nexport type JsonCompatible<T> = unknown extends T ? never : {\n [P in keyof T]:\n T[P] extends JsonValue ? T[P] :\n T[P] extends NotAssignableToJson ? never :\n JsonCompatible<T[P]>;\n};\n\nexport type StringifiedJson<T> = JsonCompatible<T> extends never ? never : string & {\n __json_stringified: T;\n};\n\nexport function stringifyJson<T>(value: JsonCompatible<T>): StringifiedJson<T> {\n return JSON.stringify(value)! as StringifiedJson<T>;\n}\n\nexport type CanonicalizedJson<T> = JsonCompatible<T> extends never ? never : string & {\n __json_canonicalized: T;\n};\n\nexport function canonicalizeJson<T>(value: JsonCompatible<T>): CanonicalizedJson<T> {\n return canonicalize(value)! as CanonicalizedJson<T>;\n}\n\nexport function parseJson<T>(value: StringifiedJson<T> | CanonicalizedJson<T>): T {\n return JSON.parse(value) as T;\n}\n","/**\n * Just for convenience, usually it is an Error with name 'AbortError'\n */\nexport class AbortError extends Error {\n name = 'AbortError';\n}\n\n/**\n * Throw this to show a message without stack trace in UI\n */\nexport class UiError extends Error {\n name = 'UiError';\n}\n\nexport function isAbortError(error: unknown): error is Error & { name: 'AbortError' } {\n return error instanceof Error && error.name === 'AbortError';\n}\n\nexport function hasAbortError(error: unknown): boolean {\n if (!(error instanceof Error)) {\n return false;\n }\n\n return error.name === 'AbortError' || hasAbortError(error.cause);\n}\n\nexport function isAggregateError(error: unknown): error is AggregateError {\n return error instanceof Error && error.name === 'AggregateError';\n}\n\nfunction stringifyValue(value: unknown): string {\n if (typeof value === 'string') {\n return `String value was thrown: ${value}`;\n }\n\n if (value && typeof value === 'object') {\n try {\n return `Plain object was thrown: ${JSON.stringify(value)}`;\n } catch (jsonError) {\n const errorMessage = jsonError instanceof Error ? jsonError.message : String(jsonError);\n return `Non-serializable object was thrown (JSON.stringify failed: ${errorMessage}): ${String(value)}`;\n }\n }\n\n return String(`Non-Error value (${typeof value}) was thrown: ${value}`);\n}\n\nexport function ensureError(value: unknown): Error {\n if (value instanceof Error) {\n return value;\n }\n\n return new Error(stringifyValue(value));\n}\n\n// Error serialization for IPC/network transmission (Error objects can't be JSON serialized)\n\nexport type SerializedError = {\n name: string;\n message: string;\n stack: string | undefined;\n cause?: SerializedError;\n};\n\nexport function deserializeError(obj: SerializedError): Error {\n const cause = obj.cause ? deserializeError(obj.cause) : undefined;\n\n const error = new Error(obj.message, cause !== undefined ? { cause } : undefined);\n error.name = obj.name || 'Error';\n error.stack = obj.stack;\n\n return error;\n}\n\nexport function serializeError(e: unknown): SerializedError {\n const error = ensureError(e);\n const cause = error.cause ? serializeError(error.cause) : undefined;\n\n return {\n name: error.name,\n message: error.message,\n stack: error.stack,\n ...(error.cause !== undefined && { cause }),\n };\n}\n\nexport type ResultOrError<S, F = Error> = {\n value: S;\n error?: undefined;\n} | {\n error: F;\n};\n\nexport function unwrapResult<T>(result: ResultOrError<T>): T {\n if (result.error) {\n throw result.error;\n }\n return result.value;\n}\n\nexport function serializeResult<T>(result: ResultOrError<T>): ResultOrError<T, SerializedError> {\n if (result.error) {\n return { error: serializeError(result.error) };\n }\n return { value: result.value };\n}\n\nexport function deserializeResult<T>(result: ResultOrError<T, SerializedError>): ResultOrError<T> {\n if (result.error) {\n return { error: deserializeError(result.error) };\n }\n return { value: result.value };\n}\n\nexport function wrapCallback<T>(callback: () => T): ResultOrError<T> {\n try {\n const value = callback();\n return { value };\n } catch (error) {\n return { error: ensureError(error) };\n }\n}\n\nexport async function wrapAsyncCallback<T>(callback: () => Promise<T>): Promise<ResultOrError<T>> {\n try {\n const value = await callback();\n return { value };\n } catch (error) {\n return { error: ensureError(error) };\n }\n}\n\nexport function wrapAndSerialize<T>(callback: () => T): ResultOrError<T, SerializedError> {\n const result = wrapCallback(callback);\n return serializeResult(result);\n}\n\nexport async function wrapAndSerializeAsync<T>(callback: () => Promise<T>): Promise<ResultOrError<T, SerializedError>> {\n const result = await wrapAsyncCallback(callback);\n return serializeResult(result);\n}\n"],"names":["z","PValueIntNA","PValueLongNA","PValueStringNA","PValueBytesNA","isValueNA","value","valueType","isValueAbsent","absent","index","chunkIndex","mask","PTableAbsent","PTableNA","isPTableAbsent","pTableValue","column","row","fill","getAxisId","spec","type","name","domain","result","matchDomain","query","target","k","matchAxisId","toDataView","data","RFC4648","RFC4648_HEX","CROCKFORD","base32Encode","variant","options","alphabet","defaultPadding","padding","view","bits","output","i","PlIdBytes","PlIdLength","PlId","uniquePlId","canonicalizeJson","canonicalize","parseJson","stringifyValue","jsonError","ensureError"],"mappings":";;AAyB0BA,EAAE,OAAO;AAAA;AAAA,EAEjC,MAAMA,EAAE,OAAO;AAAA;AAAA,EAEf,IAAIA,EAAE,OAAO;AACf,CAAC;AC5BYC,MAAAA,IAAc,aACdC,IAAe,CAAC,mBAGhBC,IAAiB,MACjBC,IAAgB;AA0Bb,SAAAC,EAAUC,GAAgBC,GAA+B;AACvE,UAAQA,GAAW;AAAA,IACjB,KAAK;AACH,aAAOD,MAAUL;AAAAA,IACnB,KAAK;AACH,aAAOK,MAAU,OAAOJ,CAAY,KAAKI,MAAUJ;AAAAA,IACrD,KAAK;AACI,aAAA,OAAO,MAAMI,CAAK;AAAA,IAC3B,KAAK;AACI,aAAA,OAAO,MAAMA,CAAK;AAAA,IAC3B,KAAK;AACH,aAAOA,MAAUH;AAAAA,IACnB,KAAK;AACH,aAAOG,MAAUF;AAAAA,IACnB;AACQ,YAAA,MAAM,0BAA0BG,CAAyB,EAAE;AAAA,EAAA;AAEvE;AA2LgB,SAAAC,EA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AAI,MAAM+C,EAAe/C,CAAK,CAAC;AACxC;"}
@@ -14,7 +14,7 @@ const e = r.object({
14
14
  label: r.string()
15
15
  });
16
16
  r.array(e);
17
- const a = "1.37.0";
17
+ const a = "1.37.2";
18
18
  function l() {
19
19
  return o({ sdkVersion: a });
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../../model/src/internal.ts","../../../../../../../../../model/src/render/util/label.ts","../../../../../../../../../model/src/version.ts","../../../../../../../../../model/src/raw_globals.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport type { Platforma } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n","import type { PObjectSpec } from '@milaboratories/pl-model-common';\nimport { z } from 'zod';\n\nexport const PAnnotationLabel = 'pl7.app/label';\nexport const PAnnotationTrace = 'pl7.app/trace';\n\nexport type RecordsWithLabel<T> = {\n value: T;\n label: string;\n};\n\nexport type LabelDerivationOps = {\n /** Force inclusion of native column label */\n includeNativeLabel?: boolean;\n /** Separator to use between label parts (\" / \" by default) */\n separator?: string;\n /** If true, label will be added as suffix (at the end of the generated label). By default label added as a prefix. */\n addLabelAsSuffix?: boolean;\n /** Trace elements list that will be forced to be included in the label. */\n forceTraceElements?: string[];\n};\n\nexport const TraceEntry = z.object({\n type: z.string(),\n importance: z.number().optional(),\n id: z.string().optional(),\n label: z.string(),\n});\nexport type TraceEntry = z.infer<typeof TraceEntry>;\ntype FullTraceEntry = TraceEntry & { fullType: string; occurrenceIndex: number };\n\nexport const Trace = z.array(TraceEntry);\nexport type Trace = z.infer<typeof Trace>;\ntype FullTrace = FullTraceEntry[];\n\n// Define the possible return types for the specExtractor function\ntype SpecExtractorResult = PObjectSpec | {\n spec: PObjectSpec;\n prefixTrace?: TraceEntry[];\n suffixTrace?: TraceEntry[];\n};\n\nconst DistancePenalty = 0.001;\n\nconst LabelType = '__LABEL__';\nconst LabelTypeFull = '__LABEL__@1';\n\nexport function deriveLabels<T>(\n values: T[],\n specExtractor: (obj: T) => SpecExtractorResult,\n ops: LabelDerivationOps = {},\n): RecordsWithLabel<T>[] {\n const importances = new Map<string, number>();\n\n const forceTraceElements = (ops.forceTraceElements !== undefined && ops.forceTraceElements.length > 0)\n ? new Set(ops.forceTraceElements)\n : undefined;\n\n // number of times certain type occurred among all of the\n const numberOfRecordsWithType = new Map<string, number>();\n\n const enrichedRecords = values.map((value) => {\n const extractorResult = specExtractor(value);\n let spec: PObjectSpec;\n let prefixTrace: TraceEntry[] | undefined;\n let suffixTrace: TraceEntry[] | undefined;\n\n // Check if the result is the new structure or just PObjectSpec\n if ('spec' in extractorResult && typeof extractorResult.spec === 'object') {\n // It's the new structure { spec, prefixTrace?, suffixTrace? }\n spec = extractorResult.spec;\n prefixTrace = extractorResult.prefixTrace;\n suffixTrace = extractorResult.suffixTrace;\n } else {\n // It's just PObjectSpec\n spec = extractorResult as PObjectSpec;\n }\n\n const label = spec.annotations?.[PAnnotationLabel];\n const traceStr = spec.annotations?.[PAnnotationTrace];\n const baseTrace = (traceStr ? Trace.safeParse(JSON.parse(traceStr)).data : undefined) ?? [];\n\n const trace = [\n ...(prefixTrace ?? []),\n ...baseTrace,\n ...(suffixTrace ?? []),\n ];\n\n if (label !== undefined) {\n const labelEntry = { label, type: LabelType, importance: -2 };\n if (ops.addLabelAsSuffix) trace.push(labelEntry);\n else trace.splice(0, 0, labelEntry);\n }\n\n const fullTrace: FullTrace = [];\n\n const occurrences = new Map<string, number>();\n for (let i = trace.length - 1; i >= 0; --i) {\n const { type: typeName } = trace[i];\n const importance = trace[i].importance ?? 0;\n const occurrenceIndex = (occurrences.get(typeName) ?? 0) + 1;\n occurrences.set(typeName, occurrenceIndex);\n const fullType = `${typeName}@${occurrenceIndex}`;\n numberOfRecordsWithType.set(fullType, (numberOfRecordsWithType.get(fullType) ?? 0) + 1);\n importances.set(\n fullType,\n Math.max(\n importances.get(fullType) ?? Number.NEGATIVE_INFINITY,\n importance - (trace.length - i) * DistancePenalty,\n ),\n );\n fullTrace.push({ ...trace[i], fullType, occurrenceIndex: occurrenceIndex });\n }\n fullTrace.reverse();\n return {\n value,\n spec,\n label,\n fullTrace,\n };\n });\n\n // excluding repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const mainTypes: string[] = [];\n // repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const secondaryTypes: string[] = [];\n\n const allTypeRecords = [...importances];\n // sorting: most important types go first\n allTypeRecords.sort(([, i1], [, i2]) => i2 - i1);\n\n for (const [typeName] of allTypeRecords) {\n if (typeName.endsWith('@1') || numberOfRecordsWithType.get(typeName) === values.length)\n mainTypes.push(typeName);\n else secondaryTypes.push(typeName);\n }\n\n const calculate = (includedTypes: Set<string>, force: boolean = false) => {\n const result: RecordsWithLabel<T>[] = [];\n for (let i = 0; i < enrichedRecords.length; i++) {\n const r = enrichedRecords[i];\n const includedTrace = r.fullTrace\n .filter((fm) => includedTypes.has(fm.fullType)\n || (forceTraceElements && forceTraceElements.has(fm.type)));\n if (includedTrace.length === 0) {\n if (force)\n result.push({\n label: 'Unlabeled',\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n else return undefined;\n }\n const labelSet = includedTrace\n .map((fm) => fm.label);\n const sep = ops.separator ?? ' / ';\n result.push({\n label: labelSet.join(sep),\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n }\n return result;\n };\n\n if (mainTypes.length === 0) {\n if (secondaryTypes.length !== 0) throw new Error('Non-empty secondary types list while main types list is empty.');\n return calculate(new Set(LabelTypeFull), true)!;\n }\n\n //\n // includedTypes = 2\n // * *\n // T0 T1 T2 T3 T4 T5\n // *\n // additionalType = 3\n //\n // Resulting set: T0, T1, T3\n //\n let includedTypes = 0;\n let additionalType = -1;\n while (includedTypes < mainTypes.length) {\n const currentSet = new Set<string>();\n if (ops.includeNativeLabel) currentSet.add(LabelTypeFull);\n for (let i = 0; i < includedTypes; ++i) currentSet.add(mainTypes[i]);\n if (additionalType >= 0)\n currentSet.add(mainTypes[additionalType]);\n\n const candidateResult = calculate(currentSet);\n\n // checking if labels uniquely separate our records\n if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length) return candidateResult;\n\n additionalType++;\n if (additionalType >= mainTypes.length) {\n includedTypes++;\n additionalType = includedTypes;\n }\n }\n\n return calculate(new Set([...mainTypes, ...secondaryTypes]), true)!;\n}\n","export const PlatformaSDKVersion = '1.37.0';\n","import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\nexport function getPlatformaOrDefault<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(platforma: Platforma<Args, Outputs, UiState, Href>): Platforma<Args, Outputs, UiState, Href> {\n try {\n return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n } catch {\n return platforma;\n }\n}\n"],"names":["getPlatformaInstance","config","TraceEntry","z","PlatformaSDKVersion","getRawPlatformaInstance"],"mappings":";;;AAaO,SAASA,EAKdC,GAA0E;AACtEA,MAAAA,KAAU,OAAO,WAAW,gBAAiB;AACxC,WAAA,WAAW,aAAaA,CAAM;AAAA,MAC9B,OAAO,WAAW,YAAc,YAAoB,WAAW;AAC7D,QAAA,IAAI,MAAM,+BAAgC;AACvD;ACDaC,MAAAA,IAAaC,EAAE,OAAO;AAAA,EACjC,MAAMA,EAAE,OAAO;AAAA,EACf,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,IAAIA,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,OAAOA,EAAE,OAAO;AAClB,CAAC;AAIoBA,EAAE,MAAMD,CAAU;AC/BhC,MAAME,IAAsB;ACM5B,SAASC,IAK6B;AACpCL,SAAAA,EAAmD,EAAE,YAAYI,GAAqB;AAC/F;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../model/src/internal.ts","../../../../../../../../../model/src/render/util/label.ts","../../../../../../../../../model/src/version.ts","../../../../../../../../../model/src/raw_globals.ts"],"sourcesContent":["import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport type { Platforma } from './platforma';\nimport type { FutureHandle, GlobalCfgRenderCtx } from './render/internal';\n\n/** Utility code helping to identify whether the code is running in actual UI environment */\nexport function isInUI() {\n return (\n typeof globalThis.getPlatforma !== 'undefined' || typeof globalThis.platforma !== 'undefined'\n );\n}\n\n/** Utility code helping to retrieve a platforma instance form the environment */\nexport function getPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(config?: { sdkVersion: string }): Platforma<Args, Outputs, UiState, Href> {\n if (config && typeof globalThis.getPlatforma === 'function')\n return globalThis.getPlatforma(config);\n else if (typeof globalThis.platforma !== 'undefined') return globalThis.platforma;\n else throw new Error('Can\\'t get platforma instance.');\n}\n\nexport function tryGetCfgRenderCtx(): GlobalCfgRenderCtx | undefined {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else return undefined;\n}\n\nexport function getCfgRenderCtx(): GlobalCfgRenderCtx {\n if (typeof globalThis.cfgRenderCtx !== 'undefined') return globalThis.cfgRenderCtx;\n else throw new Error('Not in config rendering context');\n}\n\nexport function tryRegisterCallback(key: string, callback: (...args: any[]) => any): boolean {\n const ctx = tryGetCfgRenderCtx();\n if (ctx === undefined) return false;\n if (key in ctx.callbackRegistry) throw new Error(`Callback with key ${key} already registered.`);\n ctx.callbackRegistry[key] = callback;\n return true;\n}\n\nconst futureResolves = new Map<string, ((value: unknown) => void)[]>();\n\nexport function registerFutureAwait(handle: FutureHandle, onResolve: (value: unknown) => void) {\n if (!(handle in getCfgRenderCtx().callbackRegistry)) {\n getCfgRenderCtx().callbackRegistry[handle] = (value: unknown) => {\n for (const res of futureResolves.get(handle)!) {\n res(value);\n }\n };\n futureResolves.set(handle, []);\n }\n futureResolves.get(handle)!.push(onResolve);\n}\n","import type { PObjectSpec } from '@milaboratories/pl-model-common';\nimport { z } from 'zod';\n\nexport const PAnnotationLabel = 'pl7.app/label';\nexport const PAnnotationTrace = 'pl7.app/trace';\n\nexport type RecordsWithLabel<T> = {\n value: T;\n label: string;\n};\n\nexport type LabelDerivationOps = {\n /** Force inclusion of native column label */\n includeNativeLabel?: boolean;\n /** Separator to use between label parts (\" / \" by default) */\n separator?: string;\n /** If true, label will be added as suffix (at the end of the generated label). By default label added as a prefix. */\n addLabelAsSuffix?: boolean;\n /** Trace elements list that will be forced to be included in the label. */\n forceTraceElements?: string[];\n};\n\nexport const TraceEntry = z.object({\n type: z.string(),\n importance: z.number().optional(),\n id: z.string().optional(),\n label: z.string(),\n});\nexport type TraceEntry = z.infer<typeof TraceEntry>;\ntype FullTraceEntry = TraceEntry & { fullType: string; occurrenceIndex: number };\n\nexport const Trace = z.array(TraceEntry);\nexport type Trace = z.infer<typeof Trace>;\ntype FullTrace = FullTraceEntry[];\n\n// Define the possible return types for the specExtractor function\ntype SpecExtractorResult = PObjectSpec | {\n spec: PObjectSpec;\n prefixTrace?: TraceEntry[];\n suffixTrace?: TraceEntry[];\n};\n\nconst DistancePenalty = 0.001;\n\nconst LabelType = '__LABEL__';\nconst LabelTypeFull = '__LABEL__@1';\n\nexport function deriveLabels<T>(\n values: T[],\n specExtractor: (obj: T) => SpecExtractorResult,\n ops: LabelDerivationOps = {},\n): RecordsWithLabel<T>[] {\n const importances = new Map<string, number>();\n\n const forceTraceElements = (ops.forceTraceElements !== undefined && ops.forceTraceElements.length > 0)\n ? new Set(ops.forceTraceElements)\n : undefined;\n\n // number of times certain type occurred among all of the\n const numberOfRecordsWithType = new Map<string, number>();\n\n const enrichedRecords = values.map((value) => {\n const extractorResult = specExtractor(value);\n let spec: PObjectSpec;\n let prefixTrace: TraceEntry[] | undefined;\n let suffixTrace: TraceEntry[] | undefined;\n\n // Check if the result is the new structure or just PObjectSpec\n if ('spec' in extractorResult && typeof extractorResult.spec === 'object') {\n // It's the new structure { spec, prefixTrace?, suffixTrace? }\n spec = extractorResult.spec;\n prefixTrace = extractorResult.prefixTrace;\n suffixTrace = extractorResult.suffixTrace;\n } else {\n // It's just PObjectSpec\n spec = extractorResult as PObjectSpec;\n }\n\n const label = spec.annotations?.[PAnnotationLabel];\n const traceStr = spec.annotations?.[PAnnotationTrace];\n const baseTrace = (traceStr ? Trace.safeParse(JSON.parse(traceStr)).data : undefined) ?? [];\n\n const trace = [\n ...(prefixTrace ?? []),\n ...baseTrace,\n ...(suffixTrace ?? []),\n ];\n\n if (label !== undefined) {\n const labelEntry = { label, type: LabelType, importance: -2 };\n if (ops.addLabelAsSuffix) trace.push(labelEntry);\n else trace.splice(0, 0, labelEntry);\n }\n\n const fullTrace: FullTrace = [];\n\n const occurrences = new Map<string, number>();\n for (let i = trace.length - 1; i >= 0; --i) {\n const { type: typeName } = trace[i];\n const importance = trace[i].importance ?? 0;\n const occurrenceIndex = (occurrences.get(typeName) ?? 0) + 1;\n occurrences.set(typeName, occurrenceIndex);\n const fullType = `${typeName}@${occurrenceIndex}`;\n numberOfRecordsWithType.set(fullType, (numberOfRecordsWithType.get(fullType) ?? 0) + 1);\n importances.set(\n fullType,\n Math.max(\n importances.get(fullType) ?? Number.NEGATIVE_INFINITY,\n importance - (trace.length - i) * DistancePenalty,\n ),\n );\n fullTrace.push({ ...trace[i], fullType, occurrenceIndex: occurrenceIndex });\n }\n fullTrace.reverse();\n return {\n value,\n spec,\n label,\n fullTrace,\n };\n });\n\n // excluding repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const mainTypes: string[] = [];\n // repeated types (i.e. ..@2, ..@3, etc.) not found in some records\n const secondaryTypes: string[] = [];\n\n const allTypeRecords = [...importances];\n // sorting: most important types go first\n allTypeRecords.sort(([, i1], [, i2]) => i2 - i1);\n\n for (const [typeName] of allTypeRecords) {\n if (typeName.endsWith('@1') || numberOfRecordsWithType.get(typeName) === values.length)\n mainTypes.push(typeName);\n else secondaryTypes.push(typeName);\n }\n\n const calculate = (includedTypes: Set<string>, force: boolean = false) => {\n const result: RecordsWithLabel<T>[] = [];\n for (let i = 0; i < enrichedRecords.length; i++) {\n const r = enrichedRecords[i];\n const includedTrace = r.fullTrace\n .filter((fm) => includedTypes.has(fm.fullType)\n || (forceTraceElements && forceTraceElements.has(fm.type)));\n if (includedTrace.length === 0) {\n if (force)\n result.push({\n label: 'Unlabeled',\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n else return undefined;\n }\n const labelSet = includedTrace\n .map((fm) => fm.label);\n const sep = ops.separator ?? ' / ';\n result.push({\n label: labelSet.join(sep),\n value: r.value,\n } satisfies RecordsWithLabel<T>);\n }\n return result;\n };\n\n if (mainTypes.length === 0) {\n if (secondaryTypes.length !== 0) throw new Error('Non-empty secondary types list while main types list is empty.');\n return calculate(new Set(LabelTypeFull), true)!;\n }\n\n //\n // includedTypes = 2\n // * *\n // T0 T1 T2 T3 T4 T5\n // *\n // additionalType = 3\n //\n // Resulting set: T0, T1, T3\n //\n let includedTypes = 0;\n let additionalType = -1;\n while (includedTypes < mainTypes.length) {\n const currentSet = new Set<string>();\n if (ops.includeNativeLabel) currentSet.add(LabelTypeFull);\n for (let i = 0; i < includedTypes; ++i) currentSet.add(mainTypes[i]);\n if (additionalType >= 0)\n currentSet.add(mainTypes[additionalType]);\n\n const candidateResult = calculate(currentSet);\n\n // checking if labels uniquely separate our records\n if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length) return candidateResult;\n\n additionalType++;\n if (additionalType >= mainTypes.length) {\n includedTypes++;\n additionalType = includedTypes;\n }\n }\n\n return calculate(new Set([...mainTypes, ...secondaryTypes]), true)!;\n}\n","export const PlatformaSDKVersion = '1.37.2';\n","import type { ValueOrErrors } from '@milaboratories/pl-model-common';\nimport {} from './global';\nimport { getPlatformaInstance } from './internal';\nimport type { Platforma } from './platforma';\nimport { PlatformaSDKVersion } from './version';\n\nexport function getRawPlatformaInstance<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(): Platforma<Args, Outputs, UiState, Href> {\n return getPlatformaInstance<Args, Outputs, UiState, Href>({ sdkVersion: PlatformaSDKVersion });\n}\n\n/** Returns a global platforma instance or a provided fallback if it's not available. */\nexport function getPlatformaOrDefault<\n Args = unknown,\n Outputs extends Record<string, ValueOrErrors<unknown>> = Record<string, ValueOrErrors<unknown>>,\n UiState = unknown,\n Href extends `/${string}` = `/${string}`,\n>(platforma: Platforma<Args, Outputs, UiState, Href>): Platforma<Args, Outputs, UiState, Href> {\n try {\n return getRawPlatformaInstance<Args, Outputs, UiState, Href>();\n } catch {\n return platforma;\n }\n}\n"],"names":["getPlatformaInstance","config","TraceEntry","z","PlatformaSDKVersion","getRawPlatformaInstance"],"mappings":";;;AAaO,SAASA,EAKdC,GAA0E;AACtEA,MAAAA,KAAU,OAAO,WAAW,gBAAiB;AACxC,WAAA,WAAW,aAAaA,CAAM;AAAA,MAC9B,OAAO,WAAW,YAAc,YAAoB,WAAW;AAC7D,QAAA,IAAI,MAAM,+BAAgC;AACvD;ACDaC,MAAAA,IAAaC,EAAE,OAAO;AAAA,EACjC,MAAMA,EAAE,OAAO;AAAA,EACf,YAAYA,EAAE,OAAO,EAAE,SAAS;AAAA,EAChC,IAAIA,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,OAAOA,EAAE,OAAO;AAClB,CAAC;AAIoBA,EAAE,MAAMD,CAAU;AC/BhC,MAAME,IAAsB;ACM5B,SAASC,IAK6B;AACpCL,SAAAA,EAAmD,EAAE,YAAYI,GAAqB;AAC/F;"}