@milaboratories/pf-spec-driver 1.2.5 → 1.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pf-spec-driver",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "PSpecDriver implementation: spec-only PFrame operations via WASM",
5
5
  "keywords": [],
6
6
  "license": "UNLICENSED",
@@ -22,17 +22,17 @@
22
22
  "dependencies": {
23
23
  "@milaboratories/pframes-rs-wasm": "1.1.18",
24
24
  "@noble/hashes": "^2.0.1",
25
- "@milaboratories/pl-model-middle-layer": "1.16.4",
26
- "@milaboratories/pl-model-common": "1.31.2",
25
+ "@milaboratories/pl-model-middle-layer": "1.18.0",
26
+ "@milaboratories/pl-model-common": "1.32.1",
27
27
  "@milaboratories/helpers": "1.14.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@vitest/coverage-istanbul": "^4.1.3",
31
31
  "typescript": "~5.9.3",
32
32
  "vitest": "^4.1.3",
33
- "@milaboratories/ts-configs": "1.2.3",
34
33
  "@milaboratories/build-configs": "2.0.0",
35
- "@milaboratories/ts-builder": "1.3.1"
34
+ "@milaboratories/ts-configs": "1.2.3",
35
+ "@milaboratories/ts-builder": "1.3.2"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "ts-builder build --target node",
@@ -118,4 +118,85 @@ describe("SpecDriver", () => {
118
118
  expect(cellAxis!.annotations?.["pl7.app/parents"]).toBe('["sample"]');
119
119
  expect(cellAxis!.parentAxes).toEqual([0]);
120
120
  });
121
+
122
+ test("discoverColumns discovers columns through linker", async () => {
123
+ await using driver = new SpecDriver();
124
+
125
+ const nameAxis: AxisSpec = {
126
+ name: "name",
127
+ type: "String",
128
+ annotations: { "pl7.app/label": "Name" },
129
+ } as AxisSpec;
130
+ const groupAxis: AxisSpec = {
131
+ name: "group",
132
+ type: "String",
133
+ annotations: { "pl7.app/label": "Group" },
134
+ } as AxisSpec;
135
+
136
+ const { key: handle } = driver.createSpecFrame({
137
+ note: {
138
+ kind: "PColumn",
139
+ name: "note",
140
+ valueType: "String",
141
+ axesSpec: [nameAxis],
142
+ annotations: { "pl7.app/label": "Note" },
143
+ } as PColumnSpec,
144
+ value: {
145
+ kind: "PColumn",
146
+ name: "value",
147
+ valueType: "Int",
148
+ axesSpec: [nameAxis],
149
+ annotations: { "pl7.app/label": "Value" },
150
+ } as PColumnSpec,
151
+ description: {
152
+ kind: "PColumn",
153
+ name: "description",
154
+ valueType: "String",
155
+ axesSpec: [groupAxis],
156
+ annotations: { "pl7.app/label": "Description" },
157
+ } as PColumnSpec,
158
+ priority: {
159
+ kind: "PColumn",
160
+ name: "priority",
161
+ valueType: "Int",
162
+ axesSpec: [groupAxis],
163
+ annotations: { "pl7.app/label": "Priority" },
164
+ } as PColumnSpec,
165
+ linker_name_group: {
166
+ kind: "PColumn",
167
+ name: "linker_name_group",
168
+ valueType: "Int",
169
+ axesSpec: [groupAxis, nameAxis],
170
+ annotations: {
171
+ "pl7.app/isLinkerColumn": "true",
172
+ "pl7.app/linkLabel": "Name-Group Linker",
173
+ },
174
+ } as PColumnSpec,
175
+ });
176
+
177
+ const response = driver.discoverColumns(handle, {
178
+ axes: [{ axesSpec: [{ type: "String", name: "name" } as AxisSpec], qualifications: [] }],
179
+ maxHops: 1,
180
+ constraints: {
181
+ allowFloatingSourceAxes: true,
182
+ allowFloatingHitAxes: true,
183
+ allowSourceQualifications: true,
184
+ allowHitQualifications: true,
185
+ },
186
+ });
187
+
188
+ const names = response.hits.map((h) => h.hit.spec.name);
189
+ expect(names).toContain("note");
190
+ expect(names).toContain("value");
191
+ expect(names).toContain("description");
192
+ expect(names).toContain("priority");
193
+ expect(response.hits).toHaveLength(4);
194
+
195
+ // Linked columns should have non-empty path
196
+ const linkedHits = response.hits.filter((h) => h.path.length > 0);
197
+ expect(linkedHits).toHaveLength(2);
198
+ const linkedNames = linkedHits.map((h) => h.hit.spec.name);
199
+ expect(linkedNames).toContain("description");
200
+ expect(linkedNames).toContain("priority");
201
+ });
121
202
  });