@milaboratories/pf-spec 1.0.16 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/p-frame.d.ts CHANGED
@@ -36,6 +36,13 @@ export declare class PFrame implements Disposable {
36
36
  * to {@link buildQuery}.
37
37
  */
38
38
  discoverColumns(request: PFrameInternal.DiscoverColumnsRequestV2): PFrameInternal.DiscoverColumnsResponse;
39
+ /**
40
+ * Discovers the roots the given columns hang off: the columns that, used as
41
+ * anchors, would reach them. Each hit's `path` runs from the root to the
42
+ * leaf, so `buildQuery` with the leaf's column id and that `path` builds the
43
+ * same query as for a hit of {@link discoverColumns} anchored on the root.
44
+ */
45
+ discoverRoots(request: PFrameInternal.DiscoverRootsRequest): PFrameInternal.DiscoverRootsResponse;
39
46
  /** Finds the columns in this frame that match the given filter criteria. */
40
47
  findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse;
41
48
  /** Resolves a query against this frame's specs. Returns a table spec and a data query. */
@@ -1 +1 @@
1
- {"version":3,"file":"p-frame.d.ts","names":[],"sources":["../src/p-frame.ts"],"mappings":";;;YAeY;;EAEV,KAAK,UAAU;;EAEf,UAAU;;EAEV,UAAU;;;;;;;;;;;qBAYC,kBAAkB;;EAG7B,YAAY,MAAM,eAAe;;EAKjC,cACE,SAAS,eAAe,iCACvB,eAAe;;EAKlB,UAAU,UAAU,YAAY;;EAKhC,eAAe;;;;;;;;;EAaf,gBACE,SAAS,eAAe,2BACvB,eAAe;;EAKlB,YAAY,SAAS,eAAe,qBAAqB,eAAe;;EAKxE,cAAc,SAAS,YAAY;;EAKnC,mBAAmB,SAAS,cAAc;GAKzC,OAAO"}
1
+ {"version":3,"file":"p-frame.d.ts","names":[],"sources":["../src/p-frame.ts"],"mappings":";;;YAeY;;EAEV,KAAK,UAAU;;EAEf,UAAU;;EAEV,UAAU;;;;;;;;;;;qBAYC,kBAAkB;;EAG7B,YAAY,MAAM,eAAe;;EAKjC,cACE,SAAS,eAAe,iCACvB,eAAe;;EAKlB,UAAU,UAAU,YAAY;;EAKhC,eAAe;;;;;;;;;EAaf,gBACE,SAAS,eAAe,2BACvB,eAAe;;;;;;;EAUlB,cACE,SAAS,eAAe,uBACvB,eAAe;;EAKlB,YAAY,SAAS,eAAe,qBAAqB,eAAe;;EAKxE,cAAc,SAAS,YAAY;;EAKnC,mBAAmB,SAAS,cAAc;GAKzC,OAAO"}
package/dist/p-frame.js CHANGED
@@ -38,6 +38,15 @@ var PFrame = class {
38
38
  discoverColumns(request) {
39
39
  return JSON.parse(this.#frame.discoverColumns(JSON.stringify(request)));
40
40
  }
41
+ /**
42
+ * Discovers the roots the given columns hang off: the columns that, used as
43
+ * anchors, would reach them. Each hit's `path` runs from the root to the
44
+ * leaf, so `buildQuery` with the leaf's column id and that `path` builds the
45
+ * same query as for a hit of {@link discoverColumns} anchored on the root.
46
+ */
47
+ discoverRoots(request) {
48
+ return JSON.parse(this.#frame.discoverRoots(JSON.stringify(request)));
49
+ }
41
50
  /** Finds the columns in this frame that match the given filter criteria. */
42
51
  findColumns(request) {
43
52
  return JSON.parse(this.#frame.findColumns(JSON.stringify(request)));
@@ -1 +1 @@
1
- {"version":3,"file":"p-frame.js","names":["bindings","spec"],"sources":["../src/p-frame.ts"],"sourcesContent":["import type {\n EvaluateQueryResponse,\n JoinEntry,\n PColumnIdAndSpec,\n PColumnSpec,\n PColumnValue,\n PObjectId,\n PTableRecordFilter,\n PTableSorting,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { spec as bindings } from \"./generated/pframes_rs_wasip2.js\";\n\n/** A legacy (V4) query. Code used this type before the unified `SpecQuery`. */\nexport type LegacyQuery = {\n /** The source join entry. It defines the data sources and the join structure. */\n src: JoinEntry<PObjectId>;\n /** Optional record-level filters. The query applies these to its results. */\n filters?: PTableRecordFilter[];\n /** Optional sort specifications. They set the order of the results. */\n sorting?: PTableSorting[];\n};\n\n/**\n * A set of registered column specs, and the spec-plane operations on them.\n *\n * Each method uses the specs that this frame holds. No method reads data. The module\n * surface holds the spec operations that do not need a frame.\n *\n * This class holds a WASM resource. Use a `using` declaration to release it. Garbage\n * collection also releases the resource, but not at a known time.\n */\nexport class PFrame implements Disposable {\n #frame: bindings.Frame;\n\n constructor(spec: Record<string, PColumnSpec>) {\n this.#frame = bindings.Frame.fromJson(JSON.stringify(spec));\n }\n\n /** Deletes columns from a columns specification. */\n deleteColumns(\n request: PFrameInternal.DeleteColumnFromColumnsRequest,\n ): PFrameInternal.DeleteColumnFromColumnsResponse {\n return JSON.parse(bindings.Frame.deleteColumns(JSON.stringify(request)));\n }\n\n /** Returns `null` if this frame has no column with the id `columnId`. */\n getColumn(columnId: PObjectId): PColumnIdAndSpec | null {\n return JSON.parse(this.#frame.getColumn(JSON.stringify(columnId)));\n }\n\n /** Lists each column in this frame with its id and its spec. */\n listColumns(): PColumnIdAndSpec[] {\n const columns = JSON.parse(this.#frame.listColumns()) as Record<string, PColumnIdAndSpec>;\n return Object.values(columns);\n }\n\n /**\n * Discovers the columns that are compatible with a given axes integration.\n *\n * The include filters and the exclude filters apply in order. The exclude filters\n * remove matches from the include set. Each hit has its own traversal `path`. To\n * materialize a hit as a `SpecQueryJoinEntry`, give the hit's column id and `path`\n * to {@link buildQuery}.\n */\n discoverColumns(\n request: PFrameInternal.DiscoverColumnsRequestV2,\n ): PFrameInternal.DiscoverColumnsResponse {\n return JSON.parse(this.#frame.discoverColumns(JSON.stringify(request)));\n }\n\n /** Finds the columns in this frame that match the given filter criteria. */\n findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse {\n return JSON.parse(this.#frame.findColumns(JSON.stringify(request)));\n }\n\n /** Resolves a query against this frame's specs. Returns a table spec and a data query. */\n evaluateQuery(request: SpecQuery): EvaluateQueryResponse {\n return JSON.parse(this.#frame.evaluateQuery(JSON.stringify(request)));\n }\n\n /** Upgrades a {@link LegacyQuery} to the current `SpecQuery` format. */\n rewriteLegacyQuery(request: LegacyQuery): SpecQuery {\n const src = joinEntryToInternal(request.src);\n return JSON.parse(this.#frame.rewriteLegacyQuery(JSON.stringify({ ...request, src })));\n }\n\n [Symbol.dispose](): void {\n this.#frame[Symbol.dispose]();\n }\n}\n\nfunction joinEntryToInternal(entry: JoinEntry<PObjectId>): PFrameInternal.JoinEntryV4 {\n const type = entry.type;\n switch (type) {\n case \"column\":\n return {\n type: \"column\",\n columnId: entry.column,\n };\n case \"slicedColumn\":\n return {\n type: \"slicedColumn\",\n columnId: entry.column,\n newId: entry.newId,\n axisFilters: entry.axisFilters,\n };\n case \"artificialColumn\":\n return {\n type: \"artificialColumn\",\n columnId: entry.column,\n newId: entry.newId,\n axesIndices: entry.axesIndices,\n };\n case \"inlineColumn\":\n return {\n type: \"inlineColumn\",\n newId: entry.column.id,\n spec: entry.column.spec,\n dataInfo: {\n type: \"Json\",\n keyLength: entry.column.spec.axesSpec.length,\n data: entry.column.data.reduce(\n (acc, row) => {\n acc[JSON.stringify(row.key)] = row.val;\n return acc;\n },\n {} as Record<string, PColumnValue>,\n ),\n },\n };\n case \"inner\":\n case \"full\":\n return {\n type: entry.type,\n entries: entry.entries.map((col) => joinEntryToInternal(col)),\n };\n case \"outer\":\n return {\n type: \"outer\",\n primary: joinEntryToInternal(entry.primary),\n secondary: entry.secondary.map((col) => joinEntryToInternal(col)),\n };\n default:\n throw new Error(`unsupported PFrame join entry type: ${type satisfies never}`);\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,IAAa,SAAb,MAA0C;CACxC;CAEA,YAAY,QAAmC;EAC7C,KAAK,SAASA,KAAS,MAAM,SAAS,KAAK,UAAUC,MAAI,CAAC;CAC5D;;CAGA,cACE,SACgD;EAChD,OAAO,KAAK,MAAMD,KAAS,MAAM,cAAc,KAAK,UAAU,OAAO,CAAC,CAAC;CACzE;;CAGA,UAAU,UAA8C;EACtD,OAAO,KAAK,MAAM,KA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AI,GAAG,KAAK,IAAI;KACnC,OAAO;IACT,GACA,CAAC,CACH;GACF;EACF;EACF,KAAK;EACL,KAAK,QACH,OAAO;GACL,MAAM,MAAM;GACZ,SAAS,MAAM,QAAQ,KAAK,QAAQ,oBAAoB,GAAG,CAAC;EAC9D;EACF,KAAK,SACH,OAAO;GACL,MAAM;GACN,SAAS,oBAAoB,MAAM,OAAO;GAC1C,WAAW,MAAM,UAAU,KAAK,QAAQ,oBAAoB,GAAG,CAAC;EAClE;EACF,SACE,MAAM,IAAI,MAAM,uCAAuC,MAAsB;CACjF;AACF"}
1
+ {"version":3,"file":"p-frame.js","names":["bindings","spec"],"sources":["../src/p-frame.ts"],"sourcesContent":["import type {\n EvaluateQueryResponse,\n JoinEntry,\n PColumnIdAndSpec,\n PColumnSpec,\n PColumnValue,\n PObjectId,\n PTableRecordFilter,\n PTableSorting,\n SpecQuery,\n} from \"@milaboratories/pl-model-common\";\nimport type { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { spec as bindings } from \"./generated/pframes_rs_wasip2.js\";\n\n/** A legacy (V4) query. Code used this type before the unified `SpecQuery`. */\nexport type LegacyQuery = {\n /** The source join entry. It defines the data sources and the join structure. */\n src: JoinEntry<PObjectId>;\n /** Optional record-level filters. The query applies these to its results. */\n filters?: PTableRecordFilter[];\n /** Optional sort specifications. They set the order of the results. */\n sorting?: PTableSorting[];\n};\n\n/**\n * A set of registered column specs, and the spec-plane operations on them.\n *\n * Each method uses the specs that this frame holds. No method reads data. The module\n * surface holds the spec operations that do not need a frame.\n *\n * This class holds a WASM resource. Use a `using` declaration to release it. Garbage\n * collection also releases the resource, but not at a known time.\n */\nexport class PFrame implements Disposable {\n #frame: bindings.Frame;\n\n constructor(spec: Record<string, PColumnSpec>) {\n this.#frame = bindings.Frame.fromJson(JSON.stringify(spec));\n }\n\n /** Deletes columns from a columns specification. */\n deleteColumns(\n request: PFrameInternal.DeleteColumnFromColumnsRequest,\n ): PFrameInternal.DeleteColumnFromColumnsResponse {\n return JSON.parse(bindings.Frame.deleteColumns(JSON.stringify(request)));\n }\n\n /** Returns `null` if this frame has no column with the id `columnId`. */\n getColumn(columnId: PObjectId): PColumnIdAndSpec | null {\n return JSON.parse(this.#frame.getColumn(JSON.stringify(columnId)));\n }\n\n /** Lists each column in this frame with its id and its spec. */\n listColumns(): PColumnIdAndSpec[] {\n const columns = JSON.parse(this.#frame.listColumns()) as Record<string, PColumnIdAndSpec>;\n return Object.values(columns);\n }\n\n /**\n * Discovers the columns that are compatible with a given axes integration.\n *\n * The include filters and the exclude filters apply in order. The exclude filters\n * remove matches from the include set. Each hit has its own traversal `path`. To\n * materialize a hit as a `SpecQueryJoinEntry`, give the hit's column id and `path`\n * to {@link buildQuery}.\n */\n discoverColumns(\n request: PFrameInternal.DiscoverColumnsRequestV2,\n ): PFrameInternal.DiscoverColumnsResponse {\n return JSON.parse(this.#frame.discoverColumns(JSON.stringify(request)));\n }\n\n /**\n * Discovers the roots the given columns hang off: the columns that, used as\n * anchors, would reach them. Each hit's `path` runs from the root to the\n * leaf, so `buildQuery` with the leaf's column id and that `path` builds the\n * same query as for a hit of {@link discoverColumns} anchored on the root.\n */\n discoverRoots(\n request: PFrameInternal.DiscoverRootsRequest,\n ): PFrameInternal.DiscoverRootsResponse {\n return JSON.parse(this.#frame.discoverRoots(JSON.stringify(request)));\n }\n\n /** Finds the columns in this frame that match the given filter criteria. */\n findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse {\n return JSON.parse(this.#frame.findColumns(JSON.stringify(request)));\n }\n\n /** Resolves a query against this frame's specs. Returns a table spec and a data query. */\n evaluateQuery(request: SpecQuery): EvaluateQueryResponse {\n return JSON.parse(this.#frame.evaluateQuery(JSON.stringify(request)));\n }\n\n /** Upgrades a {@link LegacyQuery} to the current `SpecQuery` format. */\n rewriteLegacyQuery(request: LegacyQuery): SpecQuery {\n const src = joinEntryToInternal(request.src);\n return JSON.parse(this.#frame.rewriteLegacyQuery(JSON.stringify({ ...request, src })));\n }\n\n [Symbol.dispose](): void {\n this.#frame[Symbol.dispose]();\n }\n}\n\nfunction joinEntryToInternal(entry: JoinEntry<PObjectId>): PFrameInternal.JoinEntryV4 {\n const type = entry.type;\n switch (type) {\n case \"column\":\n return {\n type: \"column\",\n columnId: entry.column,\n };\n case \"slicedColumn\":\n return {\n type: \"slicedColumn\",\n columnId: entry.column,\n newId: entry.newId,\n axisFilters: entry.axisFilters,\n };\n case \"artificialColumn\":\n return {\n type: \"artificialColumn\",\n columnId: entry.column,\n newId: entry.newId,\n axesIndices: entry.axesIndices,\n };\n case \"inlineColumn\":\n return {\n type: \"inlineColumn\",\n newId: entry.column.id,\n spec: entry.column.spec,\n dataInfo: {\n type: \"Json\",\n keyLength: entry.column.spec.axesSpec.length,\n data: entry.column.data.reduce(\n (acc, row) => {\n acc[JSON.stringify(row.key)] = row.val;\n return acc;\n },\n {} as Record<string, PColumnValue>,\n ),\n },\n };\n case \"inner\":\n case \"full\":\n return {\n type: entry.type,\n entries: entry.entries.map((col) => joinEntryToInternal(col)),\n };\n case \"outer\":\n return {\n type: \"outer\",\n primary: joinEntryToInternal(entry.primary),\n secondary: entry.secondary.map((col) => joinEntryToInternal(col)),\n };\n default:\n throw new Error(`unsupported PFrame join entry type: ${type satisfies never}`);\n }\n}\n"],"mappings":";;;;;;;;;;;AAiCA,IAAa,SAAb,MAA0C;CACxC;CAEA,YAAY,QAAmC;EAC7C,KAAK,SAASA,KAAS,MAAM,SAAS,KAAK,UAAUC,MAAI,CAAC;CAC5D;;CAGA,cACE,SACgD;EAChD,OAAO,KAAK,MAAMD,KAAS,MAAM,cAAc,KAAK,UAAU,OAAO,CAAC,CAAC;CACzE;;CAGA,UAAU,UAA8C;EACtD,OAAO,KAAK,MAAM,KAAK,OAAO,UAAU,KAAK,UAAU,QAAQ,CAAC,CAAC;CACnE;;CAGA,cAAkC;EAChC,MAAM,UAAU,KAAK,MAAM,KAAK,OAAO,YAAY,CAAC;EACpD,O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,OAAO;IACT,GACA,CAAC,CACH;GACF;EACF;EACF,KAAK;EACL,KAAK,QACH,OAAO;GACL,MAAM,MAAM;GACZ,SAAS,MAAM,QAAQ,KAAK,QAAQ,oBAAoB,GAAG,CAAC;EAC9D;EACF,KAAK,SACH,OAAO;GACL,MAAM;GACN,SAAS,oBAAoB,MAAM,OAAO;GAC1C,WAAW,MAAM,UAAU,KAAK,QAAQ,oBAAoB,GAAG,CAAC;EAClE;EACF,SACE,MAAM,IAAI,MAAM,uCAAuC,MAAsB;CACjF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pf-spec",
3
- "version": "1.0.16",
3
+ "version": "1.1.0",
4
4
  "description": "Spec-plane PFrame operations: bindings to the pframes WASM component",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -16,15 +16,15 @@
16
16
  }
17
17
  },
18
18
  "dependencies": {
19
- "@milaboratories/pl-model-common": "1.55.2",
20
- "@milaboratories/pl-model-middle-layer": "1.38.0"
19
+ "@milaboratories/pl-model-common": "1.56.0",
20
+ "@milaboratories/pl-model-middle-layer": "1.40.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@bytecodealliance/jco-transpile": "^0.20.0",
24
24
  "@bytecodealliance/preview2-shim": "^0.30.0",
25
25
  "@milaboratories/build-configs": "2.0.3",
26
- "@milaboratories/pframes-rs-wasip2": "1.2.0",
27
- "@milaboratories/ts-builder": "1.7.4",
26
+ "@milaboratories/pframes-rs-wasip2": "1.3.0",
27
+ "@milaboratories/ts-builder": "1.8.0",
28
28
  "@milaboratories/ts-configs": "1.4.1",
29
29
  "@types/node": "~24.19.2",
30
30
  "@vitest/coverage-istanbul": "^4.1.12",
package/src/p-frame.ts CHANGED
@@ -70,6 +70,18 @@ export class PFrame implements Disposable {
70
70
  return JSON.parse(this.#frame.discoverColumns(JSON.stringify(request)));
71
71
  }
72
72
 
73
+ /**
74
+ * Discovers the roots the given columns hang off: the columns that, used as
75
+ * anchors, would reach them. Each hit's `path` runs from the root to the
76
+ * leaf, so `buildQuery` with the leaf's column id and that `path` builds the
77
+ * same query as for a hit of {@link discoverColumns} anchored on the root.
78
+ */
79
+ discoverRoots(
80
+ request: PFrameInternal.DiscoverRootsRequest,
81
+ ): PFrameInternal.DiscoverRootsResponse {
82
+ return JSON.parse(this.#frame.discoverRoots(JSON.stringify(request)));
83
+ }
84
+
73
85
  /** Finds the columns in this frame that match the given filter criteria. */
74
86
  findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse {
75
87
  return JSON.parse(this.#frame.findColumns(JSON.stringify(request)));