@milaboratories/pl-middle-layer 1.26.4 → 1.26.6
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/debug/index.d.ts +1 -0
- package/dist/debug/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +712 -696
- package/dist/index.mjs.map +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +12 -11
- package/src/debug/index.ts +5 -3
- package/src/pool/driver.ts +28 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACzF,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,mBAAmB,EAEnB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,IAAI,eAAe,EAC/B,OAAO,EACP,SAAS,EAET,SAAS,EAIT,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAS9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/pool/driver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,KAAK,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAA2B,MAAM,4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EAAE,CAAC;IAM9D,kBAAkB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,OAAO,CAAC,0BAA0B,CAAC;IAiCzB,eAAe,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC;IAkBnB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAKpD,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAK1D,OAAO,CAClB,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,MAAM,EAAE,EACvB,KAAK,CAAC,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,EAAE,CAAC;CAM3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-middle-layer",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.6",
|
|
4
4
|
"description": "Pl Middle Layer",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"keywords": [],
|
|
20
20
|
"license": "UNLICENSED",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@milaboratories/pframes-node": "2.1.
|
|
22
|
+
"@milaboratories/pframes-node": "2.1.8",
|
|
23
|
+
"@milaboratories/pframes-rs-node": "1.0.8",
|
|
23
24
|
"canonicalize": "^2.0.0",
|
|
24
25
|
"denque": "^2.1.0",
|
|
25
26
|
"lru-cache": "^11.0.2",
|
|
@@ -28,21 +29,21 @@
|
|
|
28
29
|
"utility-types": "^3.11.0",
|
|
29
30
|
"yaml": "^2.6.1",
|
|
30
31
|
"zod": "~3.23.8",
|
|
32
|
+
"@milaboratories/pl-http": "^1.0.3",
|
|
31
33
|
"@milaboratories/resolve-helper": "^1.0.2",
|
|
34
|
+
"@platforma-sdk/block-tools": "^2.5.7",
|
|
32
35
|
"@milaboratories/computable": "^2.3.4",
|
|
33
36
|
"@milaboratories/pl-client": "^2.7.3",
|
|
34
|
-
"@
|
|
35
|
-
"@milaboratories/pl-http": "^1.0.3",
|
|
36
|
-
"@milaboratories/pl-model-middle-layer": "^1.7.1",
|
|
37
|
-
"@milaboratories/pl-drivers": "^1.5.11",
|
|
37
|
+
"@milaboratories/pl-drivers": "^1.5.12",
|
|
38
38
|
"@milaboratories/pl-model-common": "^1.10.4",
|
|
39
39
|
"@milaboratories/pl-tree": "^1.4.22",
|
|
40
40
|
"@platforma-sdk/model": "^1.22.2",
|
|
41
|
-
"@milaboratories/
|
|
42
|
-
"@milaboratories/pl-model-backend": "^1.0.1",
|
|
41
|
+
"@milaboratories/pl-model-middle-layer": "^1.7.1",
|
|
43
42
|
"@platforma-sdk/workflow-tengo": "2.9.9",
|
|
44
43
|
"@milaboratories/pl-config": "^1.3.3",
|
|
45
|
-
"@milaboratories/
|
|
44
|
+
"@milaboratories/ts-helpers": "^1.1.3",
|
|
45
|
+
"@milaboratories/pl-local": "^1.10.0",
|
|
46
|
+
"@milaboratories/pl-model-backend": "^1.0.1"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
49
|
"semver": "^7.6.3",
|
|
@@ -54,8 +55,8 @@
|
|
|
54
55
|
"jest": "^29.7.0",
|
|
55
56
|
"@jest/globals": "^29.7.0",
|
|
56
57
|
"ts-jest": "^29.2.5",
|
|
57
|
-
"@milaboratories/
|
|
58
|
-
"@milaboratories/
|
|
58
|
+
"@milaboratories/platforma-build-configs": "1.0.2",
|
|
59
|
+
"@milaboratories/eslint-config": "^1.0.1"
|
|
59
60
|
},
|
|
60
61
|
"scripts": {
|
|
61
62
|
"type-check": "tsc --noEmit --composite false",
|
package/src/debug/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type MlDebugFlags = {
|
|
2
2
|
logPFrameRequests: boolean;
|
|
3
|
+
usePFrameRs: boolean;
|
|
3
4
|
logTreeStats?: 'cumulative' | 'per-request';
|
|
4
5
|
};
|
|
5
6
|
|
|
@@ -7,10 +8,11 @@ let flags: MlDebugFlags | undefined = undefined;
|
|
|
7
8
|
export function getDebugFlags() {
|
|
8
9
|
if (flags) return flags;
|
|
9
10
|
flags = {
|
|
10
|
-
logPFrameRequests: process.env.MI_LOG_PFRAMES !== undefined
|
|
11
|
+
logPFrameRequests: process.env.MI_LOG_PFRAMES !== undefined,
|
|
12
|
+
usePFrameRs: process.env.MI_USE_PFRAMES_RS !== undefined,
|
|
11
13
|
};
|
|
12
14
|
if (process.env.MI_LOG_TREE_STAT)
|
|
13
|
-
flags.logTreeStats
|
|
14
|
-
process.env.MI_LOG_TREE_STAT === 'cumulative' ? 'cumulative' : 'per-request';
|
|
15
|
+
flags.logTreeStats
|
|
16
|
+
= process.env.MI_LOG_TREE_STAT === 'cumulative' ? 'cumulative' : 'per-request';
|
|
15
17
|
return flags;
|
|
16
18
|
}
|
package/src/pool/driver.ts
CHANGED
|
@@ -41,6 +41,7 @@ import type { MiLogger } from '@milaboratories/ts-helpers';
|
|
|
41
41
|
import { assertNever } from '@milaboratories/ts-helpers';
|
|
42
42
|
import canonicalize from 'canonicalize';
|
|
43
43
|
import { PFrame } from '@milaboratories/pframes-node';
|
|
44
|
+
import { PFrame as PFrameRs } from '@milaboratories/pframes-rs-node';
|
|
44
45
|
import * as fsp from 'node:fs/promises';
|
|
45
46
|
import { LRUCache } from 'lru-cache';
|
|
46
47
|
import { ConcurrencyLimitingExecutor } from '@milaboratories/ts-helpers';
|
|
@@ -123,29 +124,38 @@ class PFrameHolder implements PFrameInternal.PFrameDataSource, Disposable {
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
const createSpecPFrame = (): PFrameInternal.PFrameV2 => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
if (getDebugFlags().usePFrameRs) {
|
|
128
|
+
const pFrame = new PFrameRs(getDebugFlags().logPFrameRequests ? logFunc : undefined);
|
|
129
|
+
for (const column of columns) {
|
|
129
130
|
pFrame.addColumnSpec(column.id, column.spec);
|
|
130
|
-
} catch (err: unknown) {
|
|
131
|
-
throw new Error(
|
|
132
|
-
`Adding column ${column.id} to PFrame failed: ${err as Error}; Spec: ${JSON.stringify(column.spec)}.`,
|
|
133
|
-
);
|
|
134
131
|
}
|
|
132
|
+
return pFrame;
|
|
133
|
+
} else {
|
|
134
|
+
const pFrame = getDebugFlags().logPFrameRequests ? new PFrame(logFunc) : new PFrame();
|
|
135
|
+
for (const column of columns) {
|
|
136
|
+
try {
|
|
137
|
+
pFrame.addColumnSpec(column.id, column.spec);
|
|
138
|
+
} catch (err: unknown) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`Adding column ${column.id} to PFrame failed: ${err as Error}; Spec: ${JSON.stringify(column.spec)}.`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return pFrame;
|
|
135
145
|
}
|
|
136
|
-
return pFrame;
|
|
137
146
|
};
|
|
138
147
|
|
|
139
148
|
const createDataPFrame = (): PFrameInternal.PFrameV2 => {
|
|
140
|
-
const pFrame =
|
|
149
|
+
const pFrame = getDebugFlags().logPFrameRequests ? new PFrame(logFunc) : new PFrame();
|
|
141
150
|
pFrame.setDataSource(this);
|
|
142
151
|
for (const column of columns) {
|
|
143
152
|
const dataInfo = mapBlobs(column.data, blobKey);
|
|
144
153
|
try {
|
|
154
|
+
pFrame.addColumnSpec(column.id, column.spec);
|
|
145
155
|
pFrame.setColumnData(column.id, dataInfo);
|
|
146
156
|
} catch (err: unknown) {
|
|
147
157
|
throw new Error(
|
|
148
|
-
`
|
|
158
|
+
`Adding column ${column.id} to PFrame failed: ${err as Error}; Spec: ${JSON.stringify(column.spec)}, DataInfo: ${JSON.stringify(dataInfo)}.`,
|
|
149
159
|
);
|
|
150
160
|
}
|
|
151
161
|
}
|
|
@@ -327,7 +337,14 @@ export class PFrameDriver implements SdkPFrameDriver {
|
|
|
327
337
|
...request,
|
|
328
338
|
compatibleWith:
|
|
329
339
|
request.compatibleWith.length !== 0
|
|
330
|
-
? [{
|
|
340
|
+
? [{
|
|
341
|
+
axesSpec: [
|
|
342
|
+
...new Map(request.compatibleWith.map(
|
|
343
|
+
(item) => [canonicalize(item)!, item] as const,
|
|
344
|
+
)).values(),
|
|
345
|
+
],
|
|
346
|
+
qualifications: [],
|
|
347
|
+
}]
|
|
331
348
|
: [],
|
|
332
349
|
};
|
|
333
350
|
const responce = await this.concurrencyLimiter.run(
|