@milaboratories/pframes-rs-node 1.1.3 → 1.1.5
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/README.md +3 -3
- package/export/addon-def.ts +27 -34
- package/export/addon.ts +6 -8
- package/export/dump.ts +37 -48
- package/export/export.ts +4 -6
- package/export/index.ts +2 -2
- package/export/node-pre-gyp.d.ts +1 -1
- package/export/tests/pframes.test.ts +247 -315
- package/export/tests/setup.ts +6 -15
- package/export/wrapper.ts +147 -212
- package/package.json +44 -42
- package/export_dist/addon-def.d.ts +0 -40
- package/export_dist/addon-def.d.ts.map +0 -1
- package/export_dist/addon.cjs +0 -24
- package/export_dist/addon.cjs.map +0 -1
- package/export_dist/addon.d.ts +0 -4
- package/export_dist/addon.d.ts.map +0 -1
- package/export_dist/addon.js +0 -21
- package/export_dist/addon.js.map +0 -1
- package/export_dist/dump.cjs +0 -115
- package/export_dist/dump.cjs.map +0 -1
- package/export_dist/dump.d.ts +0 -12
- package/export_dist/dump.d.ts.map +0 -1
- package/export_dist/dump.js +0 -107
- package/export_dist/dump.js.map +0 -1
- package/export_dist/export.cjs +0 -15
- package/export_dist/export.cjs.map +0 -1
- package/export_dist/export.d.ts +0 -3
- package/export_dist/export.d.ts.map +0 -1
- package/export_dist/export.js +0 -13
- package/export_dist/export.js.map +0 -1
- package/export_dist/index.cjs +0 -13
- package/export_dist/index.cjs.map +0 -1
- package/export_dist/index.d.ts +0 -3
- package/export_dist/index.d.ts.map +0 -1
- package/export_dist/index.js +0 -3
- package/export_dist/index.js.map +0 -1
- package/export_dist/tests/pframes.test.d.ts +0 -2
- package/export_dist/tests/pframes.test.d.ts.map +0 -1
- package/export_dist/tests/setup.d.ts +0 -2
- package/export_dist/tests/setup.d.ts.map +0 -1
- package/export_dist/wrapper.cjs +0 -542
- package/export_dist/wrapper.cjs.map +0 -1
- package/export_dist/wrapper.d.ts +0 -51
- package/export_dist/wrapper.d.ts.map +0 -1
- package/export_dist/wrapper.js +0 -539
- package/export_dist/wrapper.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pframes-rs-node",
|
|
3
|
+
"version": "1.1.5",
|
|
3
4
|
"description": "PFrames - Node.js Native Addon",
|
|
4
|
-
"
|
|
5
|
+
"homepage": "https://github.com/milaboratory/pframes-rs#readme",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git://github.com/milaboratory/pframes-rs.git"
|
|
10
|
+
},
|
|
11
|
+
"binary": {
|
|
12
|
+
"module_name": "pframes_rs_node",
|
|
13
|
+
"module_path": "./dist/napi-v{napi_build_version}/",
|
|
14
|
+
"remote_path": "./software/pframes-rs/{module_name}/v{version}/",
|
|
15
|
+
"package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}.tar.gz",
|
|
16
|
+
"host": " https://cdn.platforma.bio/",
|
|
17
|
+
"napi_versions": [
|
|
18
|
+
8
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"export/**/*",
|
|
23
|
+
"export_dist/**/*"
|
|
24
|
+
],
|
|
5
25
|
"type": "module",
|
|
6
|
-
"types": "./export_dist/index.d.ts",
|
|
7
26
|
"main": "./export_dist/index.js",
|
|
27
|
+
"types": "./export_dist/index.d.ts",
|
|
8
28
|
"exports": {
|
|
9
29
|
".": {
|
|
10
30
|
"types": "./export_dist/index.d.ts",
|
|
@@ -12,70 +32,52 @@
|
|
|
12
32
|
"require": "./export_dist/index.cjs"
|
|
13
33
|
}
|
|
14
34
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
],
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"registry": "https://registry.npmjs.org"
|
|
37
|
+
},
|
|
19
38
|
"dependencies": {
|
|
20
39
|
"@mapbox/node-pre-gyp": "^2.0.3",
|
|
21
|
-
"@milaboratories/pl-model-common": "1.24.6",
|
|
22
40
|
"@milaboratories/helpers": "1.13.1",
|
|
41
|
+
"@milaboratories/pl-model-common": "1.24.7",
|
|
23
42
|
"ulid": "^3.0.2",
|
|
24
|
-
"@milaboratories/pframes-rs-serv": "1.1.
|
|
43
|
+
"@milaboratories/pframes-rs-serv": "1.1.5"
|
|
25
44
|
},
|
|
26
45
|
"devDependencies": {
|
|
27
46
|
"@milaboratories/build-configs": "1.4.0",
|
|
28
|
-
"@milaboratories/pl-model-middle-layer": "1.11.
|
|
29
|
-
"@milaboratories/ts-builder": "1.2.
|
|
47
|
+
"@milaboratories/pl-model-middle-layer": "1.11.9",
|
|
48
|
+
"@milaboratories/ts-builder": "1.2.9",
|
|
30
49
|
"@milaboratories/ts-configs": "1.2.0",
|
|
31
50
|
"@types/node": "~22.19.5",
|
|
32
51
|
"@vitest/coverage-istanbul": "^4.0.18",
|
|
33
52
|
"@vitest/expect": "^4.0.17",
|
|
34
53
|
"cargo-cp-artifact": "^0.1.9",
|
|
54
|
+
"rimraf": "^6.1.2",
|
|
35
55
|
"tslib": "^2.8.1",
|
|
36
56
|
"typescript": "^5.9.3",
|
|
37
|
-
"
|
|
38
|
-
"vitest": "^4.0.17",
|
|
39
|
-
"rimraf": "^6.1.2"
|
|
40
|
-
},
|
|
41
|
-
"binary": {
|
|
42
|
-
"module_name": "pframes_rs_node",
|
|
43
|
-
"module_path": "./dist/napi-v{napi_build_version}/",
|
|
44
|
-
"host": " https://cdn.platforma.bio/",
|
|
45
|
-
"remote_path": "./software/pframes-rs/{module_name}/v{version}/",
|
|
46
|
-
"package_name": "{module_name}-v{version}-napi-v{napi_build_version}-{platform}-{arch}.tar.gz",
|
|
47
|
-
"napi_versions": [
|
|
48
|
-
8
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
"license": "UNLICENSED",
|
|
52
|
-
"publishConfig": {
|
|
53
|
-
"registry": "https://registry.npmjs.org"
|
|
54
|
-
},
|
|
55
|
-
"homepage": "https://github.com/milaboratory/pframes-rs#readme",
|
|
56
|
-
"repository": {
|
|
57
|
-
"type": "git",
|
|
58
|
-
"url": "git://github.com/milaboratory/pframes-rs.git"
|
|
57
|
+
"vitest": "^4.0.17"
|
|
59
58
|
},
|
|
60
59
|
"scripts": {
|
|
61
60
|
"bump-version": "cargo run -p pframes_rs_meta --bin npm_version -r --locked",
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
61
|
+
"rust:build": "pnpm exec cargo-cp-artifact -nc ./dist/napi-v8/pframes_rs_node.node -- cargo build --message-format=json",
|
|
62
|
+
"ts:fix": "ts-builder format",
|
|
63
|
+
"ts:check": "ts-builder linter --check --target node && ts-builder formatter --check",
|
|
64
|
+
"ts:build": "ts-builder build --target node --build-config build.node.config.js",
|
|
65
|
+
"ts:postbuild": "pnpm exec rimraf package.tgz && pnpm pack --out package.tgz",
|
|
66
|
+
"ci-build": "pnpm run rust:build -r --locked && pnpm run ts:build",
|
|
67
67
|
"install": "node-pre-gyp install --update-binary --fallback-to-build=false || node -p \"process.exit(+!(require('./package.json').version === '0.0.0'))\"",
|
|
68
68
|
"pack": "pnpm exec node-pre-gyp package && pnpm exec node-pre-gyp reveal staged_tarball --silent",
|
|
69
69
|
"preci-test": "pnpm run ci-build",
|
|
70
|
-
"ci-test
|
|
70
|
+
"ci-ts:test": "ts-builder type-check --target node && pnpm exec vitest run --coverage",
|
|
71
71
|
"ci-test:rust": "pnpm run test:nextest -r --locked && pnpm run test:rustdoc -r --locked",
|
|
72
|
-
"ci-test": "pnpm run ci-test
|
|
73
|
-
"build": "pnpm run build
|
|
72
|
+
"ci-test": "pnpm run ci-ts:test && pnpm run ci-test:rust",
|
|
73
|
+
"build": "pnpm run rust:build && pnpm run ts:build",
|
|
74
74
|
"pretest": "pnpm run build",
|
|
75
75
|
"test:nextest": "cargo nextest run --no-tests pass",
|
|
76
76
|
"test:rustdoc": "cargo doc --no-deps --document-private-items",
|
|
77
|
-
"test
|
|
77
|
+
"ts:test": "pnpm run ci-ts:test",
|
|
78
78
|
"test:rust": "pnpm run test:nextest && pnpm run test:rustdoc",
|
|
79
|
-
"test": "pnpm run test
|
|
79
|
+
"test": "pnpm run ts:test && pnpm run test:rust",
|
|
80
|
+
"check": "pnpm run ts:check",
|
|
81
|
+
"fix": "pnpm run ts:fix"
|
|
80
82
|
}
|
|
81
83
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { PColumnInfo, PColumnSpec, PObjectId, PTableColumnId, PTableColumnSpec, PTableRecordFilter, PTableShape, PTableSorting, PTableVector, TableRange, UniqueValuesRequest, UniqueValuesResponse, QueryData } from '@milaboratories/pl-model-common';
|
|
2
|
-
import type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
|
|
3
|
-
export interface NodeFrameSymbol extends Symbol {
|
|
4
|
-
}
|
|
5
|
-
export interface NodeTableSymbol extends Symbol {
|
|
6
|
-
}
|
|
7
|
-
interface HeapProfiler {
|
|
8
|
-
pprofDump: () => Promise<Uint8Array>;
|
|
9
|
-
}
|
|
10
|
-
interface NodeFrame {
|
|
11
|
-
pFrameCreate: (spillPath: string, logger: PFrameInternal.Logger | undefined) => NodeFrameSymbol;
|
|
12
|
-
pFrameAddColumnSpec: (pFrame: NodeFrameSymbol, columnId: PObjectId, columnSpec: PColumnSpec) => void;
|
|
13
|
-
pFrameSetDataSource: (pFrame: NodeFrameSymbol, dataSource: PFrameInternal.PFrameDataSourceV2) => void;
|
|
14
|
-
pFrameSetColumnData: (pFrame: NodeFrameSymbol, columnId: PObjectId, dataInfo: PFrameInternal.DataInfo<PFrameInternal.PFrameBlobId>, signal: AbortSignal | undefined) => Promise<void>;
|
|
15
|
-
pFrameDispose: (pFrame: NodeFrameSymbol) => void;
|
|
16
|
-
pFrameFindColumns: (pFrame: NodeFrameSymbol, request: PFrameInternal.FindColumnsRequest) => Promise<PFrameInternal.FindColumnsResponse>;
|
|
17
|
-
pFrameDeleteColumn: (pFrame: NodeFrameSymbol, request: PFrameInternal.DeleteColumnFromColumnsRequest) => Promise<PFrameInternal.DeleteColumnFromColumnsResponse>;
|
|
18
|
-
pFrameGetColumnSpec: (pFrame: NodeFrameSymbol, columnId: PObjectId) => Promise<PColumnSpec | null>;
|
|
19
|
-
pFrameListColumns: (pFrame: NodeFrameSymbol) => Promise<PColumnInfo[]>;
|
|
20
|
-
pFrameCreateTable: (pFrame: NodeFrameSymbol, id: PFrameInternal.PTableId, request: PFrameInternal.CreateTableRequestV4) => NodeTableSymbol;
|
|
21
|
-
pFrameCreateTableV2: (pFrame: NodeFrameSymbol, id: PFrameInternal.PTableId, request: {
|
|
22
|
-
tableSpec: PTableColumnSpec[];
|
|
23
|
-
dataQuery: QueryData;
|
|
24
|
-
}) => NodeTableSymbol;
|
|
25
|
-
pFrameGetUniqueValues: (pFrame: NodeFrameSymbol, id: PFrameInternal.PTableId, request: UniqueValuesRequest, signal: AbortSignal | undefined) => Promise<UniqueValuesResponse>;
|
|
26
|
-
}
|
|
27
|
-
interface NodeTable {
|
|
28
|
-
pTableGetSpec: (boxed: NodeTableSymbol) => PTableColumnSpec[];
|
|
29
|
-
pTableGetColumnIndices: (boxed: NodeTableSymbol, columnIds: PTableColumnId[]) => number[];
|
|
30
|
-
pTableGetFootprint: (boxed: NodeTableSymbol, signal: AbortSignal | undefined) => Promise<number>;
|
|
31
|
-
pTableGetShape: (boxed: NodeTableSymbol, signal: AbortSignal | undefined) => Promise<PTableShape>;
|
|
32
|
-
pTableGetData: (boxed: NodeTableSymbol, id: PFrameInternal.PTableId, columnIndices: number[], range: TableRange | undefined, signal: AbortSignal | undefined) => Promise<PTableVector[]>;
|
|
33
|
-
pTableFilter: (boxed: NodeTableSymbol, id: PFrameInternal.PTableId, request: PTableRecordFilter[]) => NodeTableSymbol;
|
|
34
|
-
pTableSort: (boxed: NodeTableSymbol, id: PFrameInternal.PTableId, request: PTableSorting[]) => NodeTableSymbol;
|
|
35
|
-
pTableDispose: (boxed: NodeTableSymbol) => void;
|
|
36
|
-
}
|
|
37
|
-
export interface AddonSymbol extends Symbol, HeapProfiler, NodeFrame, NodeTable {
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
40
|
-
//# sourceMappingURL=addon-def.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addon-def.d.ts","sourceRoot":"","sources":["../export/addon-def.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACV,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,MAAM,WAAW,eAAgB,SAAQ,MAAM;CAAG;AAElD,MAAM,WAAW,eAAgB,SAAQ,MAAM;CAAG;AAElD,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC;AAED,UAAU,SAAS;IACjB,YAAY,EAAE,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,KACtC,eAAe,CAAC;IACrB,mBAAmB,EAAE,CACnB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,WAAW,KACpB,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,cAAc,CAAC,kBAAkB,KAC1C,IAAI,CAAC;IACV,mBAAmB,EAAE,CACnB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,cAAc,CAAC,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,EAC9D,MAAM,EAAE,WAAW,GAAG,SAAS,K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AAS,EAAE,cAAc,EAAE,KACxB,MAAM,EAAE,CAAC;IACd,kBAAkB,EAAE,CAClB,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,WAAW,GAAG,SAAS,KAC5B,OAAO,CAAC,MAAM,CAAC,CAAC;IACrB,cAAc,EAAE,CACd,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,WAAW,GAAG,SAAS,KAC5B,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1B,aAAa,EAAE,CACb,KAAK,EAAE,eAAe,EACtB,EAAE,EAAE,cAAc,CAAC,QAAQ,EAC3B,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,EAAE,UAAU,GAAG,SAAS,EAC7B,MAAM,EAAE,WAAW,GAAG,SAAS,KAC5B,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7B,YAAY,EAAE,CACZ,KAAK,EAAE,eAAe,EACtB,EAAE,EAAE,cAAc,CAAC,QAAQ,EAC3B,OAAO,EAAE,kBAAkB,EAAE,KAC1B,eAAe,CAAC;IACrB,UAAU,EAAE,CACV,KAAK,EAAE,eAAe,EACtB,EAAE,EAAE,cAAc,CAAC,QAAQ,EAC3B,OAAO,EAAE,aAAa,EAAE,KACrB,eAAe,CAAC;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,WACf,SAAQ,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;CAAG"}
|
package/export_dist/addon.cjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var node_module = require('node:module');
|
|
4
|
-
var node_path = require('node:path');
|
|
5
|
-
var node_url = require('node:url');
|
|
6
|
-
var gyp = require('@mapbox/node-pre-gyp');
|
|
7
|
-
|
|
8
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
|
-
const nodeFileUrl = (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('addon.cjs', document.baseURI).href));
|
|
10
|
-
const nodeDirname = node_path.dirname(node_url.fileURLToPath(nodeFileUrl));
|
|
11
|
-
const nodeRequire = node_module.createRequire(nodeFileUrl);
|
|
12
|
-
const { find: findAddon } = gyp;
|
|
13
|
-
// Pre-gyp reads binary section from package.json and constructs a path to addon
|
|
14
|
-
// https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/package.js#L35
|
|
15
|
-
// Require calls dlopen under the hood
|
|
16
|
-
// https://nodejs.org/api/process.html#processdlopenmodule-filename-flags
|
|
17
|
-
// DLOpen then searches for napi_register_module_v1 in addon export table
|
|
18
|
-
// https://github.com/search?q=repo%3Anodejs%2Fnode%20NAPI_MODULE_INITIALIZER&type=code
|
|
19
|
-
// And neon exports napi_register_module_v1 from #[neon::main]
|
|
20
|
-
// https://github.com/neon-bindings/neon/blob/b1728fa21e968ccde9611ac9955cf6d638be16e6/crates/neon/src/context/internal.rs#L76
|
|
21
|
-
const AddonSymbol = nodeRequire(findAddon(node_path.resolve(nodeDirname, '../package.json')));
|
|
22
|
-
|
|
23
|
-
exports.AddonSymbol = AddonSymbol;
|
|
24
|
-
//# sourceMappingURL=addon.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addon.cjs","sources":["../export/addon.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport gyp from '@mapbox/node-pre-gyp';\nimport type { AddonSymbol } from './addon-def';\n\nconst nodeFileUrl = import.meta.url;\nconst nodeDirname = dirname(fileURLToPath(nodeFileUrl));\nconst nodeRequire = createRequire(nodeFileUrl);\n\nconst { find: findAddon } = gyp;\n\n// Pre-gyp reads binary section from package.json and constructs a path to addon\n// https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/package.js#L35\n// Require calls dlopen under the hood\n// https://nodejs.org/api/process.html#processdlopenmodule-filename-flags\n// DLOpen then searches for napi_register_module_v1 in addon export table\n// https://github.com/search?q=repo%3Anodejs%2Fnode%20NAPI_MODULE_INITIALIZER&type=code\n// And neon exports napi_register_module_v1 from #[neon::main]\n// https://github.com/neon-bindings/neon/blob/b1728fa21e968ccde9611ac9955cf6d638be16e6/crates/neon/src/context/internal.rs#L76\nconst AddonSymbol = nodeRequire(\n findAddon(resolve(nodeDirname, '../package.json'))\n) as AddonSymbol;\n\nexport { AddonSymbol };\n"],"names":["dirname","fileURLToPath","createRequire","resolve"],"mappings":";;;;;;;;AAMA,MAAM,WAAW,GAAG,2PAAe;AACnC,MAAM,WAAW,GAAGA,iBAAO,CAACC,sBAAa,CAAC,WAAW,CAAC,CAAC;AACvD,MAAM,WAAW,GAAGC,yBAAa,CAAC,WAAW,CAAC;AAE9C,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,WAAW,CAC7B,SAAS,CAACC,iBAAO,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;;;;"}
|
package/export_dist/addon.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addon.d.ts","sourceRoot":"","sources":["../export/addon.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB/C,QAAA,MAAM,WAAW,EAEZ,WAAW,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
package/export_dist/addon.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
|
-
import { dirname, resolve } from 'node:path';
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import gyp from '@mapbox/node-pre-gyp';
|
|
5
|
-
|
|
6
|
-
const nodeFileUrl = import.meta.url;
|
|
7
|
-
const nodeDirname = dirname(fileURLToPath(nodeFileUrl));
|
|
8
|
-
const nodeRequire = createRequire(nodeFileUrl);
|
|
9
|
-
const { find: findAddon } = gyp;
|
|
10
|
-
// Pre-gyp reads binary section from package.json and constructs a path to addon
|
|
11
|
-
// https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/package.js#L35
|
|
12
|
-
// Require calls dlopen under the hood
|
|
13
|
-
// https://nodejs.org/api/process.html#processdlopenmodule-filename-flags
|
|
14
|
-
// DLOpen then searches for napi_register_module_v1 in addon export table
|
|
15
|
-
// https://github.com/search?q=repo%3Anodejs%2Fnode%20NAPI_MODULE_INITIALIZER&type=code
|
|
16
|
-
// And neon exports napi_register_module_v1 from #[neon::main]
|
|
17
|
-
// https://github.com/neon-bindings/neon/blob/b1728fa21e968ccde9611ac9955cf6d638be16e6/crates/neon/src/context/internal.rs#L76
|
|
18
|
-
const AddonSymbol = nodeRequire(findAddon(resolve(nodeDirname, '../package.json')));
|
|
19
|
-
|
|
20
|
-
export { AddonSymbol };
|
|
21
|
-
//# sourceMappingURL=addon.js.map
|
package/export_dist/addon.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"addon.js","sources":["../export/addon.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport gyp from '@mapbox/node-pre-gyp';\nimport type { AddonSymbol } from './addon-def';\n\nconst nodeFileUrl = import.meta.url;\nconst nodeDirname = dirname(fileURLToPath(nodeFileUrl));\nconst nodeRequire = createRequire(nodeFileUrl);\n\nconst { find: findAddon } = gyp;\n\n// Pre-gyp reads binary section from package.json and constructs a path to addon\n// https://github.com/mapbox/node-pre-gyp/blob/a541932680034f5de9e7365ef8d9a0d7a11cc1a9/lib/package.js#L35\n// Require calls dlopen under the hood\n// https://nodejs.org/api/process.html#processdlopenmodule-filename-flags\n// DLOpen then searches for napi_register_module_v1 in addon export table\n// https://github.com/search?q=repo%3Anodejs%2Fnode%20NAPI_MODULE_INITIALIZER&type=code\n// And neon exports napi_register_module_v1 from #[neon::main]\n// https://github.com/neon-bindings/neon/blob/b1728fa21e968ccde9611ac9955cf6d638be16e6/crates/neon/src/context/internal.rs#L76\nconst AddonSymbol = nodeRequire(\n findAddon(resolve(nodeDirname, '../package.json'))\n) as AddonSymbol;\n\nexport { AddonSymbol };\n"],"names":[],"mappings":";;;;;AAMA,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG;AACnC,MAAM,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC;AACvD,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;AAE9C,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,WAAW,CAC7B,SAAS,CAAC,OAAO,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;;;;"}
|
package/export_dist/dump.cjs
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var node_crypto = require('node:crypto');
|
|
4
|
-
var node_fs = require('node:fs');
|
|
5
|
-
var node_path = require('node:path');
|
|
6
|
-
|
|
7
|
-
function hashColumnId(columnId) {
|
|
8
|
-
return node_crypto.createHash('sha256').update(columnId).digest('hex');
|
|
9
|
-
}
|
|
10
|
-
function hashTableColumnId(tableId) {
|
|
11
|
-
if (tableId.type === 'column') {
|
|
12
|
-
return {
|
|
13
|
-
...tableId,
|
|
14
|
-
id: hashColumnId(tableId.id)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return tableId;
|
|
18
|
-
}
|
|
19
|
-
function hashFilterColumnId(filter) {
|
|
20
|
-
return {
|
|
21
|
-
...filter,
|
|
22
|
-
column: hashTableColumnId(filter.column)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function hashUniqueValuesRequestColumnId(request) {
|
|
26
|
-
return {
|
|
27
|
-
...request,
|
|
28
|
-
columnId: hashColumnId(request.columnId),
|
|
29
|
-
filters: request.filters.map(hashFilterColumnId)
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function hashSortingColumnId(sorting) {
|
|
33
|
-
return {
|
|
34
|
-
...sorting,
|
|
35
|
-
column: hashTableColumnId(sorting.column)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function hashJoinEntryColumnId(entry) {
|
|
39
|
-
const type = entry.type;
|
|
40
|
-
switch (type) {
|
|
41
|
-
case 'column':
|
|
42
|
-
return {
|
|
43
|
-
...entry,
|
|
44
|
-
columnId: hashColumnId(entry.columnId)
|
|
45
|
-
};
|
|
46
|
-
case 'slicedColumn':
|
|
47
|
-
return {
|
|
48
|
-
...entry,
|
|
49
|
-
columnId: hashColumnId(entry.columnId),
|
|
50
|
-
newId: hashColumnId(entry.newId)
|
|
51
|
-
};
|
|
52
|
-
case 'artificialColumn':
|
|
53
|
-
return {
|
|
54
|
-
...entry,
|
|
55
|
-
columnId: hashColumnId(entry.columnId),
|
|
56
|
-
newId: hashColumnId(entry.newId)
|
|
57
|
-
};
|
|
58
|
-
case 'inlineColumn':
|
|
59
|
-
return {
|
|
60
|
-
...entry,
|
|
61
|
-
newId: hashColumnId(entry.newId)
|
|
62
|
-
};
|
|
63
|
-
case 'inner':
|
|
64
|
-
return {
|
|
65
|
-
...entry,
|
|
66
|
-
entries: entry.entries.map(hashJoinEntryColumnId)
|
|
67
|
-
};
|
|
68
|
-
case 'full':
|
|
69
|
-
return {
|
|
70
|
-
...entry,
|
|
71
|
-
entries: entry.entries.map(hashJoinEntryColumnId)
|
|
72
|
-
};
|
|
73
|
-
case 'outer':
|
|
74
|
-
return {
|
|
75
|
-
...entry,
|
|
76
|
-
primary: hashJoinEntryColumnId(entry.primary),
|
|
77
|
-
secondary: entry.secondary.map(hashJoinEntryColumnId)
|
|
78
|
-
};
|
|
79
|
-
default:
|
|
80
|
-
throw new Error(`Unsupported join entry type: ${type}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function hashCreateTableRequestColumnId(request) {
|
|
84
|
-
return {
|
|
85
|
-
...request,
|
|
86
|
-
src: hashJoinEntryColumnId(request.src),
|
|
87
|
-
filters: request.filters.map(hashFilterColumnId)
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
async function dump(relativePath, data, logger) {
|
|
91
|
-
if (!process.env.MI_DUMP_PFRAMES_RS)
|
|
92
|
-
return;
|
|
93
|
-
try {
|
|
94
|
-
const relativeUri = relativePath.map((part) => encodeURIComponent(part));
|
|
95
|
-
const fileDir = node_path.join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri.slice(0, -1));
|
|
96
|
-
await node_fs.promises.mkdir(fileDir, { recursive: true });
|
|
97
|
-
const filePath = node_path.join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri);
|
|
98
|
-
const fileData = ArrayBuffer.isView(data)
|
|
99
|
-
? data
|
|
100
|
-
: JSON.stringify(data, null, 2);
|
|
101
|
-
await node_fs.promises.writeFile(filePath, fileData, { flag: 'wx' });
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
logger?.('warn', `error while dumping PFrames data: ${error}`);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
exports.dump = dump;
|
|
109
|
-
exports.hashColumnId = hashColumnId;
|
|
110
|
-
exports.hashCreateTableRequestColumnId = hashCreateTableRequestColumnId;
|
|
111
|
-
exports.hashFilterColumnId = hashFilterColumnId;
|
|
112
|
-
exports.hashSortingColumnId = hashSortingColumnId;
|
|
113
|
-
exports.hashTableColumnId = hashTableColumnId;
|
|
114
|
-
exports.hashUniqueValuesRequestColumnId = hashUniqueValuesRequestColumnId;
|
|
115
|
-
//# sourceMappingURL=dump.cjs.map
|
package/export_dist/dump.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dump.cjs","sources":["../export/dump.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport { promises as fs } from 'node:fs';\nimport { join } from 'node:path';\nimport type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport type {\n PObjectId,\n PTableColumnId,\n PTableRecordFilter,\n PTableSorting,\n UniqueValuesRequest\n} from '@milaboratories/pl-model-common';\n\nexport function hashColumnId(columnId: PObjectId): PObjectId {\n return createHash('sha256').update(columnId).digest('hex') as PObjectId;\n}\n\nexport function hashTableColumnId(tableId: PTableColumnId): PTableColumnId {\n if (tableId.type === 'column') {\n return {\n ...tableId,\n id: hashColumnId(tableId.id)\n };\n }\n return tableId;\n}\n\nexport function hashFilterColumnId(\n filter: PTableRecordFilter\n): PTableRecordFilter {\n return {\n ...filter,\n column: hashTableColumnId(filter.column)\n };\n}\n\nexport function hashUniqueValuesRequestColumnId(\n request: UniqueValuesRequest\n): UniqueValuesRequest {\n return {\n ...request,\n columnId: hashColumnId(request.columnId),\n filters: request.filters.map(hashFilterColumnId)\n };\n}\n\nexport function hashSortingColumnId(sorting: PTableSorting): PTableSorting {\n return {\n ...sorting,\n column: hashTableColumnId(sorting.column)\n };\n}\n\nfunction hashJoinEntryColumnId(\n entry: PFrameInternal.JoinEntryV4\n): PFrameInternal.JoinEntryV4 {\n const type = entry.type;\n switch (type) {\n case 'column':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId)\n };\n case 'slicedColumn':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId),\n newId: hashColumnId(entry.newId)\n };\n case 'artificialColumn':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId),\n newId: hashColumnId(entry.newId)\n };\n case 'inlineColumn':\n return {\n ...entry,\n newId: hashColumnId(entry.newId)\n };\n case 'inner':\n return {\n ...entry,\n entries: entry.entries.map(hashJoinEntryColumnId)\n };\n case 'full':\n return {\n ...entry,\n entries: entry.entries.map(hashJoinEntryColumnId)\n };\n case 'outer':\n return {\n ...entry,\n primary: hashJoinEntryColumnId(entry.primary),\n secondary: entry.secondary.map(hashJoinEntryColumnId)\n };\n default:\n throw new Error(`Unsupported join entry type: ${type}`);\n }\n}\n\nexport function hashCreateTableRequestColumnId(\n request: PFrameInternal.CreateTableRequestV4\n): PFrameInternal.CreateTableRequestV4 {\n return {\n ...request,\n src: hashJoinEntryColumnId(request.src),\n filters: request.filters.map(hashFilterColumnId)\n };\n}\n\nexport async function dump(\n relativePath: string[],\n data: { [key: string]: Object } | Uint8Array,\n logger?: PFrameInternal.Logger\n): Promise<void> {\n if (!process.env.MI_DUMP_PFRAMES_RS) return;\n try {\n const relativeUri = relativePath.map((part) => encodeURIComponent(part));\n const fileDir = join(\n process.env.MI_DUMP_PFRAMES_RS,\n ...relativeUri.slice(0, -1)\n );\n await fs.mkdir(fileDir, { recursive: true });\n\n const filePath = join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri);\n const fileData = ArrayBuffer.isView(data)\n ? data\n : JSON.stringify(data, null, 2);\n await fs.writeFile(filePath, fileData, { flag: 'wx' });\n } catch (error: unknown) {\n logger?.('warn', `error while dumping PFrames data: ${error}`);\n }\n}\n"],"names":["createHash","join","fs"],"mappings":";;;;;;AAYM,SAAU,YAAY,CAAC,QAAmB,EAAA;AAC9C,IAAA,OAAOA,sBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAc;AACzE;AAEM,SAAU,iBAAiB,CAAC,OAAuB,EAAA;AACvD,IAAA,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC7B,OAAO;AACL,YAAA,GAAG,OAAO;AACV,YAAA,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE;SAC5B;IACH;AACA,IAAA,OAAO,OAAO;AAChB;AAEM,SAAU,kBAAkB,CAChC,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O,CAAC,GAAG,CAAC,kBAAkB,EAAE,GAAG,WAAW,CAAC;AACrE,QAAA,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,IAAI;AACtC,cAAE;cACA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACjC,QAAA,MAAMC,gBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxD;IAAE,OAAO,KAAc,EAAE;QACvB,MAAM,GAAG,MAAM,EAAE,qCAAqC,KAAK,CAAA,CAAE,CAAC;IAChE;AACF;;;;;;;;;;"}
|
package/export_dist/dump.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';
|
|
2
|
-
import type { PObjectId, PTableColumnId, PTableRecordFilter, PTableSorting, UniqueValuesRequest } from '@milaboratories/pl-model-common';
|
|
3
|
-
export declare function hashColumnId(columnId: PObjectId): PObjectId;
|
|
4
|
-
export declare function hashTableColumnId(tableId: PTableColumnId): PTableColumnId;
|
|
5
|
-
export declare function hashFilterColumnId(filter: PTableRecordFilter): PTableRecordFilter;
|
|
6
|
-
export declare function hashUniqueValuesRequestColumnId(request: UniqueValuesRequest): UniqueValuesRequest;
|
|
7
|
-
export declare function hashSortingColumnId(sorting: PTableSorting): PTableSorting;
|
|
8
|
-
export declare function hashCreateTableRequestColumnId(request: PFrameInternal.CreateTableRequestV4): PFrameInternal.CreateTableRequestV4;
|
|
9
|
-
export declare function dump(relativePath: string[], data: {
|
|
10
|
-
[key: string]: Object;
|
|
11
|
-
} | Uint8Array, logger?: PFrameInternal.Logger): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=dump.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dump.d.ts","sourceRoot":"","sources":["../export/dump.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AAEzC,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,CAE3D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAQzE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,kBAAkB,GACzB,kBAAkB,CAKpB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,mBAAmB,GAC3B,mBAAmB,CAMrB;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,aAAa,CAKzE;AAkDD,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,cAAc,CAAC,oBAAoB,GAC3C,cAAc,CAAC,oBAAoB,CAMrC;AAED,wBAAsB,IAAI,CACxB,YAAY,EAAE,MAAM,EAAE,EACtB,IAAI,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,UAAU,EAC5C,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,GAC7B,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
package/export_dist/dump.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { promises } from 'node:fs';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
|
|
5
|
-
function hashColumnId(columnId) {
|
|
6
|
-
return createHash('sha256').update(columnId).digest('hex');
|
|
7
|
-
}
|
|
8
|
-
function hashTableColumnId(tableId) {
|
|
9
|
-
if (tableId.type === 'column') {
|
|
10
|
-
return {
|
|
11
|
-
...tableId,
|
|
12
|
-
id: hashColumnId(tableId.id)
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
return tableId;
|
|
16
|
-
}
|
|
17
|
-
function hashFilterColumnId(filter) {
|
|
18
|
-
return {
|
|
19
|
-
...filter,
|
|
20
|
-
column: hashTableColumnId(filter.column)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function hashUniqueValuesRequestColumnId(request) {
|
|
24
|
-
return {
|
|
25
|
-
...request,
|
|
26
|
-
columnId: hashColumnId(request.columnId),
|
|
27
|
-
filters: request.filters.map(hashFilterColumnId)
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function hashSortingColumnId(sorting) {
|
|
31
|
-
return {
|
|
32
|
-
...sorting,
|
|
33
|
-
column: hashTableColumnId(sorting.column)
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function hashJoinEntryColumnId(entry) {
|
|
37
|
-
const type = entry.type;
|
|
38
|
-
switch (type) {
|
|
39
|
-
case 'column':
|
|
40
|
-
return {
|
|
41
|
-
...entry,
|
|
42
|
-
columnId: hashColumnId(entry.columnId)
|
|
43
|
-
};
|
|
44
|
-
case 'slicedColumn':
|
|
45
|
-
return {
|
|
46
|
-
...entry,
|
|
47
|
-
columnId: hashColumnId(entry.columnId),
|
|
48
|
-
newId: hashColumnId(entry.newId)
|
|
49
|
-
};
|
|
50
|
-
case 'artificialColumn':
|
|
51
|
-
return {
|
|
52
|
-
...entry,
|
|
53
|
-
columnId: hashColumnId(entry.columnId),
|
|
54
|
-
newId: hashColumnId(entry.newId)
|
|
55
|
-
};
|
|
56
|
-
case 'inlineColumn':
|
|
57
|
-
return {
|
|
58
|
-
...entry,
|
|
59
|
-
newId: hashColumnId(entry.newId)
|
|
60
|
-
};
|
|
61
|
-
case 'inner':
|
|
62
|
-
return {
|
|
63
|
-
...entry,
|
|
64
|
-
entries: entry.entries.map(hashJoinEntryColumnId)
|
|
65
|
-
};
|
|
66
|
-
case 'full':
|
|
67
|
-
return {
|
|
68
|
-
...entry,
|
|
69
|
-
entries: entry.entries.map(hashJoinEntryColumnId)
|
|
70
|
-
};
|
|
71
|
-
case 'outer':
|
|
72
|
-
return {
|
|
73
|
-
...entry,
|
|
74
|
-
primary: hashJoinEntryColumnId(entry.primary),
|
|
75
|
-
secondary: entry.secondary.map(hashJoinEntryColumnId)
|
|
76
|
-
};
|
|
77
|
-
default:
|
|
78
|
-
throw new Error(`Unsupported join entry type: ${type}`);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
function hashCreateTableRequestColumnId(request) {
|
|
82
|
-
return {
|
|
83
|
-
...request,
|
|
84
|
-
src: hashJoinEntryColumnId(request.src),
|
|
85
|
-
filters: request.filters.map(hashFilterColumnId)
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
async function dump(relativePath, data, logger) {
|
|
89
|
-
if (!process.env.MI_DUMP_PFRAMES_RS)
|
|
90
|
-
return;
|
|
91
|
-
try {
|
|
92
|
-
const relativeUri = relativePath.map((part) => encodeURIComponent(part));
|
|
93
|
-
const fileDir = join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri.slice(0, -1));
|
|
94
|
-
await promises.mkdir(fileDir, { recursive: true });
|
|
95
|
-
const filePath = join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri);
|
|
96
|
-
const fileData = ArrayBuffer.isView(data)
|
|
97
|
-
? data
|
|
98
|
-
: JSON.stringify(data, null, 2);
|
|
99
|
-
await promises.writeFile(filePath, fileData, { flag: 'wx' });
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
logger?.('warn', `error while dumping PFrames data: ${error}`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export { dump, hashColumnId, hashCreateTableRequestColumnId, hashFilterColumnId, hashSortingColumnId, hashTableColumnId, hashUniqueValuesRequestColumnId };
|
|
107
|
-
//# sourceMappingURL=dump.js.map
|
package/export_dist/dump.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dump.js","sources":["../export/dump.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport { promises as fs } from 'node:fs';\nimport { join } from 'node:path';\nimport type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport type {\n PObjectId,\n PTableColumnId,\n PTableRecordFilter,\n PTableSorting,\n UniqueValuesRequest\n} from '@milaboratories/pl-model-common';\n\nexport function hashColumnId(columnId: PObjectId): PObjectId {\n return createHash('sha256').update(columnId).digest('hex') as PObjectId;\n}\n\nexport function hashTableColumnId(tableId: PTableColumnId): PTableColumnId {\n if (tableId.type === 'column') {\n return {\n ...tableId,\n id: hashColumnId(tableId.id)\n };\n }\n return tableId;\n}\n\nexport function hashFilterColumnId(\n filter: PTableRecordFilter\n): PTableRecordFilter {\n return {\n ...filter,\n column: hashTableColumnId(filter.column)\n };\n}\n\nexport function hashUniqueValuesRequestColumnId(\n request: UniqueValuesRequest\n): UniqueValuesRequest {\n return {\n ...request,\n columnId: hashColumnId(request.columnId),\n filters: request.filters.map(hashFilterColumnId)\n };\n}\n\nexport function hashSortingColumnId(sorting: PTableSorting): PTableSorting {\n return {\n ...sorting,\n column: hashTableColumnId(sorting.column)\n };\n}\n\nfunction hashJoinEntryColumnId(\n entry: PFrameInternal.JoinEntryV4\n): PFrameInternal.JoinEntryV4 {\n const type = entry.type;\n switch (type) {\n case 'column':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId)\n };\n case 'slicedColumn':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId),\n newId: hashColumnId(entry.newId)\n };\n case 'artificialColumn':\n return {\n ...entry,\n columnId: hashColumnId(entry.columnId),\n newId: hashColumnId(entry.newId)\n };\n case 'inlineColumn':\n return {\n ...entry,\n newId: hashColumnId(entry.newId)\n };\n case 'inner':\n return {\n ...entry,\n entries: entry.entries.map(hashJoinEntryColumnId)\n };\n case 'full':\n return {\n ...entry,\n entries: entry.entries.map(hashJoinEntryColumnId)\n };\n case 'outer':\n return {\n ...entry,\n primary: hashJoinEntryColumnId(entry.primary),\n secondary: entry.secondary.map(hashJoinEntryColumnId)\n };\n default:\n throw new Error(`Unsupported join entry type: ${type}`);\n }\n}\n\nexport function hashCreateTableRequestColumnId(\n request: PFrameInternal.CreateTableRequestV4\n): PFrameInternal.CreateTableRequestV4 {\n return {\n ...request,\n src: hashJoinEntryColumnId(request.src),\n filters: request.filters.map(hashFilterColumnId)\n };\n}\n\nexport async function dump(\n relativePath: string[],\n data: { [key: string]: Object } | Uint8Array,\n logger?: PFrameInternal.Logger\n): Promise<void> {\n if (!process.env.MI_DUMP_PFRAMES_RS) return;\n try {\n const relativeUri = relativePath.map((part) => encodeURIComponent(part));\n const fileDir = join(\n process.env.MI_DUMP_PFRAMES_RS,\n ...relativeUri.slice(0, -1)\n );\n await fs.mkdir(fileDir, { recursive: true });\n\n const filePath = join(process.env.MI_DUMP_PFRAMES_RS, ...relativeUri);\n const fileData = ArrayBuffer.isView(data)\n ? data\n : JSON.stringify(data, null, 2);\n await fs.writeFile(filePath, fileData, { flag: 'wx' });\n } catch (error: unknown) {\n logger?.('warn', `error while dumping PFrames data: ${error}`);\n }\n}\n"],"names":["fs"],"mappings":";;;;AAYM,SAAU,YAAY,CAAC,QAAmB,EAAA;AAC9C,IAAA,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAc;AACzE;AAEM,SAAU,iBAAiB,CAAC,OAAuB,EAAA;AACvD,IAAA,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC7B,OAAO;AACL,YAAA,GAAG,OAAO;AACV,YAAA,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE;SAC5B;IACH;AACA,IAAA,OAAO,OAAO;AAChB;AAEM,SAAU,kBAAkB,CAChC,MAA0B,EAAA;IAE1B,OAAO;AACL,QAAA,GAAG,MAAM;AACT,QAAA,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM;KACxC;AACH;AAEM,SAAU,+BAA+B,CAC7C,OAA4B,EAAA;IAE5B,OAAO;AACL,QAAA,GAAG,OAAO;AACV,Q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,MAAMA,QAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACxD;IAAE,OAAO,KAAc,EAAE;QACvB,MAAM,GAAG,MAAM,EAAE,qCAAqC,KAAK,CAAA,CAAE,CAAC;IAChE;AACF;;;;"}
|
package/export_dist/export.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var wrapper = require('./wrapper.cjs');
|
|
4
|
-
|
|
5
|
-
const PFrameFactory = {
|
|
6
|
-
createPFrame: (options) => {
|
|
7
|
-
return new wrapper.PFrame(options);
|
|
8
|
-
},
|
|
9
|
-
pprofDump: async () => {
|
|
10
|
-
return await wrapper.pprofDump();
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.PFrameFactory = PFrameFactory;
|
|
15
|
-
//# sourceMappingURL=export.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.cjs","sources":["../export/export.ts"],"sourcesContent":["import type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { PFrame, pprofDump } from './wrapper';\n\nexport const PFrameFactory: PFrameInternal.PFrameFactoryV4 = {\n createPFrame: (\n options: PFrameInternal.PFrameOptionsV2\n ): PFrameInternal.PFrameV13 => {\n return new PFrame(options);\n },\n pprofDump: async (): Promise<Uint8Array> => {\n return await pprofDump();\n }\n};\n"],"names":["PFrame","pprofDump"],"mappings":";;;;AAGO,MAAM,aAAa,GAAmC;AAC3D,IAAA,YAAY,EAAE,CACZ,OAAuC,KACX;AAC5B,QAAA,OAAO,IAAIA,cAAM,CAAC,OAAO,CAAC;IAC5B,CAAC;IACD,SAAS,EAAE,YAAgC;QACzC,OAAO,MAAMC,iBAAS,EAAE;IAC1B;;;;;"}
|
package/export_dist/export.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../export/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5E,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,eAS1C,CAAC"}
|
package/export_dist/export.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { pprofDump, PFrame } from './wrapper.js';
|
|
2
|
-
|
|
3
|
-
const PFrameFactory = {
|
|
4
|
-
createPFrame: (options) => {
|
|
5
|
-
return new PFrame(options);
|
|
6
|
-
},
|
|
7
|
-
pprofDump: async () => {
|
|
8
|
-
return await pprofDump();
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export { PFrameFactory };
|
|
13
|
-
//# sourceMappingURL=export.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sources":["../export/export.ts"],"sourcesContent":["import type { PFrameInternal } from '@milaboratories/pl-model-middle-layer';\nimport { PFrame, pprofDump } from './wrapper';\n\nexport const PFrameFactory: PFrameInternal.PFrameFactoryV4 = {\n createPFrame: (\n options: PFrameInternal.PFrameOptionsV2\n ): PFrameInternal.PFrameV13 => {\n return new PFrame(options);\n },\n pprofDump: async (): Promise<Uint8Array> => {\n return await pprofDump();\n }\n};\n"],"names":[],"mappings":";;AAGO,MAAM,aAAa,GAAmC;AAC3D,IAAA,YAAY,EAAE,CACZ,OAAuC,KACX;AAC5B,QAAA,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;IAC5B,CAAC;IACD,SAAS,EAAE,YAAgC;QACzC,OAAO,MAAM,SAAS,EAAE;IAC1B;;;;;"}
|
package/export_dist/index.cjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _export = require('./export.cjs');
|
|
4
|
-
var pframesRsServ = require('@milaboratories/pframes-rs-serv');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.PFrameFactory = _export.PFrameFactory;
|
|
9
|
-
Object.defineProperty(exports, "HttpHelpers", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return pframesRsServ.HttpHelpers; }
|
|
12
|
-
});
|
|
13
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/export_dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../export/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC"}
|
package/export_dist/index.js
DELETED
package/export_dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pframes.test.d.ts","sourceRoot":"","sources":["../../export/tests/pframes.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../export/tests/setup.ts"],"names":[],"mappings":""}
|