@milaboratories/pframes-rs-wasm 0.1.2 → 1.1.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.
|
Binary file
|
package/dist/p-frame.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { PColumnSpec,
|
|
1
|
+
import type { PColumnSpec, SpecQuery } from "@milaboratories/pl-model-common";
|
|
2
2
|
import type { PFrameInternal } from "@milaboratories/pl-model-middle-layer";
|
|
3
3
|
export declare class PFrame implements PFrameInternal.PFrameWasm {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(spec: Record<string, PColumnSpec>);
|
|
6
6
|
deleteColumns(request: PFrameInternal.DeleteColumnFromColumnsRequest): PFrameInternal.DeleteColumnFromColumnsResponse;
|
|
7
7
|
findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse;
|
|
8
|
-
evaluateQuery(request:
|
|
9
|
-
rewriteLegacyQuery(request: PFrameInternal.LegacyQuery):
|
|
8
|
+
evaluateQuery(request: SpecQuery): PFrameInternal.EvaluateQueryResponse;
|
|
9
|
+
rewriteLegacyQuery(request: PFrameInternal.LegacyQuery): SpecQuery;
|
|
10
10
|
[Symbol.dispose](): void;
|
|
11
11
|
}
|
|
12
12
|
//# sourceMappingURL=p-frame.d.ts.map
|
package/dist/p-frame.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p-frame.js","sources":["../src/p-frame.ts"],"sourcesContent":["import type {\n JoinEntry,\n PColumnSpec,\n PColumnValue,\n PObjectId,\n
|
|
1
|
+
{"version":3,"file":"p-frame.js","sources":["../src/p-frame.ts"],"sourcesContent":["import type {\n JoinEntry,\n PColumnSpec,\n PColumnValue,\n PObjectId,\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_wasm.js\";\n\nexport class PFrame implements PFrameInternal.PFrameWasm {\n #frame: bindings.Frame;\n\n constructor(spec: Record<string, PColumnSpec>) {\n this.#frame = bindings.Frame.fromJson(JSON.stringify(spec));\n }\n\n deleteColumns(\n request: PFrameInternal.DeleteColumnFromColumnsRequest,\n ): PFrameInternal.DeleteColumnFromColumnsResponse {\n return JSON.parse(bindings.Frame.deleteColumns(JSON.stringify(request)));\n }\n\n findColumns(request: PFrameInternal.FindColumnsRequest): PFrameInternal.FindColumnsResponse {\n return JSON.parse(this.#frame.findColumns(JSON.stringify(request)));\n }\n\n evaluateQuery(request: SpecQuery): PFrameInternal.EvaluateQueryResponse {\n return JSON.parse(this.#frame.evaluateQuery(JSON.stringify(request)));\n }\n\n rewriteLegacyQuery(request: PFrameInternal.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 // Unfortunately, jco generates incorrect types\n // actual spec.PFrame is indeed Disposable\n (this.#frame as unknown as Disposable)[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"],"names":["spec","bindings"],"mappings":";;MAUa,MAAM,CAAA;AACjB,IAAA,MAAM;AAEN,IAAA,WAAA,CAAYA,MAAiC,EAAA;AAC3C,QAAA,IAAI,CAAC,MAAM,GAAGC,IAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAACD,MAAI,CAAC,CAAC;IAC7D;AAEA,IAAA,aAAa,CACX,OAAsD,EAAA;AAEtD,QAAA,OAAO,IAAI,CAAC,KAAK,CAACC,IAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1E;AAEA,IAAA,WAAW,CAAC,OAA0C,EAAA;AACpD,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE;AAEA,IAAA,aAAa,CAAC,OAAkB,EAAA;AAC9B,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACvE;AAEA,IAAA,kBAAkB,CAAC,OAAmC,EAAA;QACpD,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC;QAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACxF;IAEA,CAAC,MAAM,CAAC,OAAO,CAAC,GAAA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,CACnC;AACF,iBAAA;aACF;AACH,QAAA,KAAK,OAAO;AACZ,QAAA,KAAK,MAAM;YACT,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,gBAAA,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAAC;aAC9D;AACH,QAAA,KAAK,OAAO;YACV,OAAO;AACL,gBAAA,IAAI,EAAE,OAAO;AACb,gBAAA,OAAO,EAAE,mBAAmB,CAAC,KAAK,CAAC,OAAO,CAAC;AAC3C,gBAAA,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAAC;aAClE;AACH,QAAA;AACE,YAAA,MAAM,IAAI,KAAK,CAAC,uCAAuC,IAAoB,CAAA,CAAE,CAAC;;AAEpF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pframes-rs-wasm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@bytecodealliance/jco": "^1.16.1",
|
|
18
18
|
"@bytecodealliance/preview2-shim": "0.17.8",
|
|
19
19
|
"@milaboratories/build-configs": "1.4.0",
|
|
20
|
-
"@milaboratories/pl-model-common": "1.24.
|
|
21
|
-
"@milaboratories/pl-model-middle-layer": "1.11.
|
|
20
|
+
"@milaboratories/pl-model-common": "1.24.7",
|
|
21
|
+
"@milaboratories/pl-model-middle-layer": "1.11.9",
|
|
22
22
|
"@milaboratories/ts-builder": "1.2.9",
|
|
23
23
|
"@milaboratories/ts-configs": "1.2.0",
|
|
24
24
|
"@types/node": "~22.19.5",
|
|
@@ -28,27 +28,28 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@bytecodealliance/preview2-shim": "0.17.8",
|
|
31
|
-
"@milaboratories/pl-model-common": "1.24.
|
|
32
|
-
"@milaboratories/pl-model-middle-layer": "1.11.
|
|
31
|
+
"@milaboratories/pl-model-common": "1.24.7",
|
|
32
|
+
"@milaboratories/pl-model-middle-layer": "1.11.9"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"
|
|
36
|
-
"ts:check": "ts-builder linter --check --target node && ts-builder formatter --check",
|
|
35
|
+
"bump-version": "cargo run -p pframes_rs_meta --bin npm_version -r --locked",
|
|
37
36
|
"component-transpile": "rimraf src/generated && jco transpile -o src/generated --no-namespaced-exports",
|
|
38
37
|
"ts-builder-build": "ts-builder build --target node --build-config build.config.js",
|
|
39
|
-
"rust
|
|
40
|
-
"ts
|
|
41
|
-
"build": "node --run rust
|
|
38
|
+
"build:rust": "cargo build --target wasm32-wasip2",
|
|
39
|
+
"build:ts": "node --run component-transpile -- ../../target/wasm32-wasip2/debug/pframes_rs_wasm.wasm && node --run ts-builder-build",
|
|
40
|
+
"build": "node --run build:rust && node --run build:ts",
|
|
42
41
|
"postbuild": "rimraf package.tgz && pnpm pack --out package.tgz",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"ci-build": "node --run
|
|
42
|
+
"ci-build:rust": "node --run build:rust -- -r --locked",
|
|
43
|
+
"ci-build:ts": "node --run component-transpile -- ../../target/wasm32-wasip2/release/pframes_rs_wasm.wasm -O -- -O4 && node --run ts-builder-build",
|
|
44
|
+
"ci-build": "node --run ci-build:rust && node --run ci-build:ts",
|
|
46
45
|
"postci-build": "node --run postbuild",
|
|
47
46
|
"preci-test": "node --run ci-build",
|
|
48
|
-
"test": "ts-builder type-check --target node",
|
|
49
47
|
"ci-test": "node --run test",
|
|
50
48
|
"pretest": "node --run build",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
49
|
+
"test": "ts-builder type-check --target node",
|
|
50
|
+
"fix:ts": "ts-builder format",
|
|
51
|
+
"fix": "node --run fix:ts",
|
|
52
|
+
"check:ts": "ts-builder linter --check --target node && ts-builder formatter --check",
|
|
53
|
+
"check": "node --run check:ts"
|
|
53
54
|
}
|
|
54
55
|
}
|