@milaboratories/pf-driver 1.0.61 → 1.0.62
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/_virtual/_@oxc-project_runtime@0.114.0/helpers/usingCtx.cjs +59 -0
- package/dist/_virtual/_@oxc-project_runtime@0.114.0/helpers/usingCtx.js +58 -0
- package/dist/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/data_info_helpers.cjs +20 -19
- package/dist/data_info_helpers.cjs.map +1 -1
- package/dist/data_info_helpers.d.ts +6 -2
- package/dist/data_info_helpers.js +19 -17
- package/dist/data_info_helpers.js.map +1 -1
- package/dist/driver_decl.d.ts +38 -34
- package/dist/driver_double.cjs +98 -97
- package/dist/driver_double.cjs.map +1 -1
- package/dist/driver_double.d.ts +17 -10
- package/dist/driver_double.js +95 -95
- package/dist/driver_double.js.map +1 -1
- package/dist/driver_impl.cjs +233 -296
- package/dist/driver_impl.cjs.map +1 -1
- package/dist/driver_impl.d.ts +59 -52
- package/dist/driver_impl.js +232 -294
- package/dist/driver_impl.js.map +1 -1
- package/dist/index.cjs +10 -14
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -4
- package/dist/logging.cjs +4 -3
- package/dist/logging.cjs.map +1 -1
- package/dist/logging.js +4 -2
- package/dist/logging.js.map +1 -1
- package/dist/pframe_pool.cjs +177 -196
- package/dist/pframe_pool.cjs.map +1 -1
- package/dist/pframe_pool.d.ts +12 -31
- package/dist/pframe_pool.js +177 -194
- package/dist/pframe_pool.js.map +1 -1
- package/dist/ptable_cache_per_frame.cjs +52 -63
- package/dist/ptable_cache_per_frame.cjs.map +1 -1
- package/dist/ptable_cache_per_frame.d.ts +16 -23
- package/dist/ptable_cache_per_frame.js +51 -61
- package/dist/ptable_cache_per_frame.js.map +1 -1
- package/dist/ptable_cache_plain.cjs +41 -49
- package/dist/ptable_cache_plain.cjs.map +1 -1
- package/dist/ptable_cache_plain.d.ts +15 -19
- package/dist/ptable_cache_plain.js +40 -47
- package/dist/ptable_cache_plain.js.map +1 -1
- package/dist/ptable_def_pool.cjs +45 -53
- package/dist/ptable_def_pool.cjs.map +1 -1
- package/dist/ptable_def_pool.d.ts +3 -20
- package/dist/ptable_def_pool.js +45 -51
- package/dist/ptable_def_pool.js.map +1 -1
- package/dist/ptable_pool.cjs +145 -185
- package/dist/ptable_pool.cjs.map +1 -1
- package/dist/ptable_pool.d.ts +6 -28
- package/dist/ptable_pool.js +145 -183
- package/dist/ptable_pool.js.map +1 -1
- package/dist/ptable_shared.cjs +6 -5
- package/dist/ptable_shared.cjs.map +1 -1
- package/dist/ptable_shared.d.ts +1 -17
- package/dist/ptable_shared.js +5 -3
- package/dist/ptable_shared.js.map +1 -1
- package/package.json +7 -7
- package/dist/__external/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3/__external/tslib/tslib.es6.cjs +0 -77
- package/dist/__external/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3/__external/tslib/tslib.es6.cjs.map +0 -1
- package/dist/__external/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3/__external/tslib/tslib.es6.js +0 -74
- package/dist/__external/.pnpm/@rollup_plugin-typescript@12.3.0_rollup@4.52.4_tslib@2.8.1_typescript@5.6.3/__external/tslib/tslib.es6.js.map +0 -1
- package/dist/data_info_helpers.d.ts.map +0 -1
- package/dist/driver_decl.d.ts.map +0 -1
- package/dist/driver_double.d.ts.map +0 -1
- package/dist/driver_double.test.d.ts +0 -2
- package/dist/driver_double.test.d.ts.map +0 -1
- package/dist/driver_impl.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/logging.d.ts +0 -2
- package/dist/logging.d.ts.map +0 -1
- package/dist/pframe_pool.d.ts.map +0 -1
- package/dist/ptable_cache_per_frame.d.ts.map +0 -1
- package/dist/ptable_cache_plain.d.ts.map +0 -1
- package/dist/ptable_def_pool.d.ts.map +0 -1
- package/dist/ptable_pool.d.ts.map +0 -1
- package/dist/ptable_shared.d.ts.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/usingCtx.js
|
|
3
|
+
function _usingCtx() {
|
|
4
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
5
|
+
var n = Error();
|
|
6
|
+
return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
|
|
7
|
+
}, e = {}, n = [];
|
|
8
|
+
function using(r, e) {
|
|
9
|
+
if (null != e) {
|
|
10
|
+
if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
11
|
+
if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
12
|
+
if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
|
|
13
|
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
14
|
+
t && (o = function o() {
|
|
15
|
+
try {
|
|
16
|
+
t.call(e);
|
|
17
|
+
} catch (r) {
|
|
18
|
+
return Promise.reject(r);
|
|
19
|
+
}
|
|
20
|
+
}), n.push({
|
|
21
|
+
v: e,
|
|
22
|
+
d: o,
|
|
23
|
+
a: r
|
|
24
|
+
});
|
|
25
|
+
} else r && n.push({
|
|
26
|
+
d: e,
|
|
27
|
+
a: r
|
|
28
|
+
});
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
e,
|
|
33
|
+
u: using.bind(null, !1),
|
|
34
|
+
a: using.bind(null, !0),
|
|
35
|
+
d: function d() {
|
|
36
|
+
var o, t = this.e, s = 0;
|
|
37
|
+
function next() {
|
|
38
|
+
for (; o = n.pop();) try {
|
|
39
|
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
40
|
+
if (o.d) {
|
|
41
|
+
var r = o.d.call(o.v);
|
|
42
|
+
if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
|
|
43
|
+
} else s |= 1;
|
|
44
|
+
} catch (r) {
|
|
45
|
+
return err(r);
|
|
46
|
+
}
|
|
47
|
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
48
|
+
if (t !== e) throw t;
|
|
49
|
+
}
|
|
50
|
+
function err(n) {
|
|
51
|
+
return t = t !== e ? new r(n, t) : n, next();
|
|
52
|
+
}
|
|
53
|
+
return next();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
exports._usingCtx = _usingCtx;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/usingCtx.js
|
|
2
|
+
function _usingCtx() {
|
|
3
|
+
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
4
|
+
var n = Error();
|
|
5
|
+
return n.name = "SuppressedError", n.error = r, n.suppressed = e, n;
|
|
6
|
+
}, e = {}, n = [];
|
|
7
|
+
function using(r, e) {
|
|
8
|
+
if (null != e) {
|
|
9
|
+
if (Object(e) !== e) throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
10
|
+
if (r) var o = e[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
11
|
+
if (void 0 === o && (o = e[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r)) var t = o;
|
|
12
|
+
if ("function" != typeof o) throw new TypeError("Object is not disposable.");
|
|
13
|
+
t && (o = function o() {
|
|
14
|
+
try {
|
|
15
|
+
t.call(e);
|
|
16
|
+
} catch (r) {
|
|
17
|
+
return Promise.reject(r);
|
|
18
|
+
}
|
|
19
|
+
}), n.push({
|
|
20
|
+
v: e,
|
|
21
|
+
d: o,
|
|
22
|
+
a: r
|
|
23
|
+
});
|
|
24
|
+
} else r && n.push({
|
|
25
|
+
d: e,
|
|
26
|
+
a: r
|
|
27
|
+
});
|
|
28
|
+
return e;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
e,
|
|
32
|
+
u: using.bind(null, !1),
|
|
33
|
+
a: using.bind(null, !0),
|
|
34
|
+
d: function d() {
|
|
35
|
+
var o, t = this.e, s = 0;
|
|
36
|
+
function next() {
|
|
37
|
+
for (; o = n.pop();) try {
|
|
38
|
+
if (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);
|
|
39
|
+
if (o.d) {
|
|
40
|
+
var r = o.d.call(o.v);
|
|
41
|
+
if (o.a) return s |= 2, Promise.resolve(r).then(next, err);
|
|
42
|
+
} else s |= 1;
|
|
43
|
+
} catch (r) {
|
|
44
|
+
return err(r);
|
|
45
|
+
}
|
|
46
|
+
if (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
47
|
+
if (t !== e) throw t;
|
|
48
|
+
}
|
|
49
|
+
function err(n) {
|
|
50
|
+
return t = t !== e ? new r(n, t) : n, next();
|
|
51
|
+
}
|
|
52
|
+
return next();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { _usingCtx };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
|
|
29
|
+
exports.__toESM = __toESM;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var model = require('@platforma-sdk/model');
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
let _platforma_sdk_model = require("@platforma-sdk/model");
|
|
4
3
|
|
|
4
|
+
//#region src/data_info_helpers.ts
|
|
5
5
|
function makeJsonDataInfo(spec, data) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
const keyLength = spec.axesSpec.length;
|
|
7
|
+
const jsonData = {};
|
|
8
|
+
for (const { key, val } of data) {
|
|
9
|
+
if (key.length !== keyLength) {
|
|
10
|
+
const error = new _platforma_sdk_model.PFrameDriverError(`Inconsistent inline column key length`);
|
|
11
|
+
error.cause = /* @__PURE__ */ new Error(`Inline column key length ${key.length} differs from axes count ${keyLength}`);
|
|
12
|
+
throw error;
|
|
13
|
+
}
|
|
14
|
+
jsonData[JSON.stringify(key)] = val;
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
type: "Json",
|
|
18
|
+
keyLength,
|
|
19
|
+
data: jsonData
|
|
20
|
+
};
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
//#endregion
|
|
23
24
|
exports.makeJsonDataInfo = makeJsonDataInfo;
|
|
24
|
-
//# sourceMappingURL=data_info_helpers.cjs.map
|
|
25
|
+
//# sourceMappingURL=data_info_helpers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_info_helpers.cjs","sources":["../src/data_info_helpers.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PColumnSpec,\n type PColumnValues,\n type JsonDataInfo,\n type PColumnValue,\n} from \"@platforma-sdk/model\";\n\nexport function makeJsonDataInfo(spec: PColumnSpec, data: PColumnValues): JsonDataInfo {\n const keyLength = spec.axesSpec.length;\n const jsonData: Record<string, PColumnValue> = {};\n for (const { key, val } of data) {\n if (key.length !== keyLength) {\n const error = new PFrameDriverError(`Inconsistent inline column key length`);\n error.cause = new Error(\n `Inline column key length ${key.length} differs from axes count ${keyLength}`,\n );\n throw error;\n }\n jsonData[JSON.stringify(key)] = val;\n }\n\n return {\n type: \"Json\",\n keyLength,\n data: jsonData,\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"data_info_helpers.cjs","names":["PFrameDriverError"],"sources":["../src/data_info_helpers.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PColumnSpec,\n type PColumnValues,\n type JsonDataInfo,\n type PColumnValue,\n} from \"@platforma-sdk/model\";\n\nexport function makeJsonDataInfo(spec: PColumnSpec, data: PColumnValues): JsonDataInfo {\n const keyLength = spec.axesSpec.length;\n const jsonData: Record<string, PColumnValue> = {};\n for (const { key, val } of data) {\n if (key.length !== keyLength) {\n const error = new PFrameDriverError(`Inconsistent inline column key length`);\n error.cause = new Error(\n `Inline column key length ${key.length} differs from axes count ${keyLength}`,\n );\n throw error;\n }\n jsonData[JSON.stringify(key)] = val;\n }\n\n return {\n type: \"Json\",\n keyLength,\n data: jsonData,\n };\n}\n"],"mappings":";;;;AAQA,SAAgB,iBAAiB,MAAmB,MAAmC;CACrF,MAAM,YAAY,KAAK,SAAS;CAChC,MAAM,WAAyC,EAAE;AACjD,MAAK,MAAM,EAAE,KAAK,SAAS,MAAM;AAC/B,MAAI,IAAI,WAAW,WAAW;GAC5B,MAAM,QAAQ,IAAIA,uCAAkB,wCAAwC;AAC5E,SAAM,wBAAQ,IAAI,MAChB,4BAA4B,IAAI,OAAO,2BAA2B,YACnE;AACD,SAAM;;AAER,WAAS,KAAK,UAAU,IAAI,IAAI;;AAGlC,QAAO;EACL,MAAM;EACN;EACA,MAAM;EACP"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { JsonDataInfo, PColumnSpec, PColumnValues } from "@platforma-sdk/model";
|
|
2
|
+
|
|
3
|
+
//#region src/data_info_helpers.d.ts
|
|
4
|
+
declare function makeJsonDataInfo(spec: PColumnSpec, data: PColumnValues): JsonDataInfo;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { makeJsonDataInfo };
|
|
3
7
|
//# sourceMappingURL=data_info_helpers.d.ts.map
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { PFrameDriverError } from
|
|
1
|
+
import { PFrameDriverError } from "@platforma-sdk/model";
|
|
2
2
|
|
|
3
|
+
//#region src/data_info_helpers.ts
|
|
3
4
|
function makeJsonDataInfo(spec, data) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
const keyLength = spec.axesSpec.length;
|
|
6
|
+
const jsonData = {};
|
|
7
|
+
for (const { key, val } of data) {
|
|
8
|
+
if (key.length !== keyLength) {
|
|
9
|
+
const error = new PFrameDriverError(`Inconsistent inline column key length`);
|
|
10
|
+
error.cause = /* @__PURE__ */ new Error(`Inline column key length ${key.length} differs from axes count ${keyLength}`);
|
|
11
|
+
throw error;
|
|
12
|
+
}
|
|
13
|
+
jsonData[JSON.stringify(key)] = val;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
type: "Json",
|
|
17
|
+
keyLength,
|
|
18
|
+
data: jsonData
|
|
19
|
+
};
|
|
19
20
|
}
|
|
20
21
|
|
|
22
|
+
//#endregion
|
|
21
23
|
export { makeJsonDataInfo };
|
|
22
|
-
//# sourceMappingURL=data_info_helpers.js.map
|
|
24
|
+
//# sourceMappingURL=data_info_helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_info_helpers.js","sources":["../src/data_info_helpers.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PColumnSpec,\n type PColumnValues,\n type JsonDataInfo,\n type PColumnValue,\n} from \"@platforma-sdk/model\";\n\nexport function makeJsonDataInfo(spec: PColumnSpec, data: PColumnValues): JsonDataInfo {\n const keyLength = spec.axesSpec.length;\n const jsonData: Record<string, PColumnValue> = {};\n for (const { key, val } of data) {\n if (key.length !== keyLength) {\n const error = new PFrameDriverError(`Inconsistent inline column key length`);\n error.cause = new Error(\n `Inline column key length ${key.length} differs from axes count ${keyLength}`,\n );\n throw error;\n }\n jsonData[JSON.stringify(key)] = val;\n }\n\n return {\n type: \"Json\",\n keyLength,\n data: jsonData,\n };\n}\n"],"
|
|
1
|
+
{"version":3,"file":"data_info_helpers.js","names":[],"sources":["../src/data_info_helpers.ts"],"sourcesContent":["import {\n PFrameDriverError,\n type PColumnSpec,\n type PColumnValues,\n type JsonDataInfo,\n type PColumnValue,\n} from \"@platforma-sdk/model\";\n\nexport function makeJsonDataInfo(spec: PColumnSpec, data: PColumnValues): JsonDataInfo {\n const keyLength = spec.axesSpec.length;\n const jsonData: Record<string, PColumnValue> = {};\n for (const { key, val } of data) {\n if (key.length !== keyLength) {\n const error = new PFrameDriverError(`Inconsistent inline column key length`);\n error.cause = new Error(\n `Inline column key length ${key.length} differs from axes count ${keyLength}`,\n );\n throw error;\n }\n jsonData[JSON.stringify(key)] = val;\n }\n\n return {\n type: \"Json\",\n keyLength,\n data: jsonData,\n };\n}\n"],"mappings":";;;AAQA,SAAgB,iBAAiB,MAAmB,MAAmC;CACrF,MAAM,YAAY,KAAK,SAAS;CAChC,MAAM,WAAyC,EAAE;AACjD,MAAK,MAAM,EAAE,KAAK,SAAS,MAAM;AAC/B,MAAI,IAAI,WAAW,WAAW;GAC5B,MAAM,QAAQ,IAAI,kBAAkB,wCAAwC;AAC5E,SAAM,wBAAQ,IAAI,MAChB,4BAA4B,IAAI,OAAO,2BAA2B,YACnE;AACD,SAAM;;AAER,WAAS,KAAK,UAAU,IAAI,IAAI;;AAGlC,QAAO;EACL,MAAM;EACN;EACA,MAAM;EACP"}
|
package/dist/driver_decl.d.ts
CHANGED
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { CalculateTableDataRequest, CalculateTableDataResponse, PColumn, PFrameDef, PFrameDriver, PFrameHandle, PObjectId, PTableDef, PTableDefV2, PTableHandle, PTableShape, PTableVector, TableRange, UniqueValuesRequest, UniqueValuesResponse } from "@platforma-sdk/model";
|
|
2
|
+
import { PoolEntry } from "@milaboratories/ts-helpers";
|
|
3
|
+
|
|
4
|
+
//#region src/driver_decl.d.ts
|
|
3
5
|
/**
|
|
4
6
|
* Extends public and safe SDK's driver API with methods used internally in the middle
|
|
5
7
|
* layer and in tests.
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
9
|
+
interface AbstractInternalPFrameDriver<PColumnData> extends PFrameDriver, AsyncDisposable {
|
|
10
|
+
/** Dispose the driver and all its resources. */
|
|
11
|
+
dispose(): Promise<void>;
|
|
12
|
+
/**
|
|
13
|
+
* Dump active PFrames allocations in pprof format.
|
|
14
|
+
* The result of this function should be saved as `profile.pb.gz`.
|
|
15
|
+
* Use {@link https://pprof.me/} or {@link https://www.speedscope.app/}
|
|
16
|
+
* to view the allocation flame graph.
|
|
17
|
+
* @warning This method will always reject on Windows!
|
|
18
|
+
*/
|
|
19
|
+
pprofDump(): Promise<Uint8Array>;
|
|
20
|
+
/** Create a new PFrame */
|
|
21
|
+
createPFrame(def: PFrameDef<PColumn<PColumnData>>): PoolEntry<PFrameHandle>;
|
|
22
|
+
/** Create a new PTable */
|
|
23
|
+
createPTable(def: PTableDef<PColumn<PColumnData>>): PoolEntry<PTableHandle>;
|
|
24
|
+
/** Create a new PTable by new Pframe-rs api */
|
|
25
|
+
createPTableV2(def: PTableDefV2<PColumn<PColumnData>>): PoolEntry<PTableHandle>;
|
|
26
|
+
/** Calculates data for the table and returns complete data representation of it */
|
|
27
|
+
calculateTableData(handle: PFrameHandle, request: CalculateTableDataRequest<PObjectId>, range: TableRange | undefined, signal?: AbortSignal): Promise<CalculateTableDataResponse>;
|
|
28
|
+
/** Calculate set of unique values for a specific axis for the filtered set of records */
|
|
29
|
+
getUniqueValues(handle: PFrameHandle, request: UniqueValuesRequest, signal?: AbortSignal): Promise<UniqueValuesResponse>;
|
|
30
|
+
/** Unified table shape */
|
|
31
|
+
getShape(handle: PTableHandle, signal?: AbortSignal): Promise<PTableShape>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieve the data from the table. To retrieve only data required, it can be
|
|
34
|
+
* sliced both horizontally ({@link columnIndices}) and vertically
|
|
35
|
+
* ({@link range}).
|
|
36
|
+
*
|
|
37
|
+
* @param columnIndices unified indices of columns to be retrieved
|
|
38
|
+
* @param range optionally limit the range of records to retrieve
|
|
39
|
+
* */
|
|
40
|
+
getData(handle: PTableHandle, columnIndices: number[], range: TableRange | undefined, signal?: AbortSignal): Promise<PTableVector[]>;
|
|
39
41
|
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { AbstractInternalPFrameDriver };
|
|
40
44
|
//# sourceMappingURL=driver_decl.d.ts.map
|
package/dist/driver_double.cjs
CHANGED
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
2
|
+
const require_driver_impl = require('./driver_impl.cjs');
|
|
3
|
+
const require_data_info_helpers = require('./data_info_helpers.cjs');
|
|
4
|
+
let _platforma_sdk_model = require("@platforma-sdk/model");
|
|
5
|
+
let _milaboratories_ts_helpers = require("@milaboratories/ts-helpers");
|
|
6
|
+
let _milaboratories_pframes_rs_node = require("@milaboratories/pframes-rs-node");
|
|
7
|
+
let node_os = require("node:os");
|
|
8
|
+
let _milaboratories_pl_model_middle_layer = require("@milaboratories/pl-model-middle-layer");
|
|
9
|
+
let node_fs = require("node:fs");
|
|
10
|
+
node_fs = require_runtime.__toESM(node_fs);
|
|
11
|
+
let node_path = require("node:path");
|
|
12
|
+
node_path = require_runtime.__toESM(node_path);
|
|
12
13
|
|
|
14
|
+
//#region src/driver_double.ts
|
|
13
15
|
function makeFolderPath(dataFolder) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
if (!node_fs.default.statSync(dataFolder, { throwIfNoEntry: false })?.isDirectory()) {
|
|
17
|
+
const error = new _platforma_sdk_model.PFrameDriverError(`Invalid data folder`);
|
|
18
|
+
error.cause = /* @__PURE__ */ new Error(`Folder ${dataFolder} does not exist`);
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
return dataFolder;
|
|
20
22
|
}
|
|
21
23
|
function makeBlobId(res) {
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
class LocalBlobProviderImpl extends tsHelpers.RefCountPoolBase {
|
|
25
|
-
dataFolder;
|
|
26
|
-
constructor(dataFolder) {
|
|
27
|
-
super();
|
|
28
|
-
this.dataFolder = dataFolder;
|
|
29
|
-
}
|
|
30
|
-
calculateParamsKey(params) {
|
|
31
|
-
return makeBlobId(params);
|
|
32
|
-
}
|
|
33
|
-
createNewResource(params, _key) {
|
|
34
|
-
const filePath = path.join(this.dataFolder, params);
|
|
35
|
-
if (!fs.statSync(filePath, { throwIfNoEntry: false })?.isFile()) {
|
|
36
|
-
const error = new model.PFrameDriverError(`Invalid file name`);
|
|
37
|
-
error.cause = new Error(`File ${filePath} does not exist`);
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
return filePath;
|
|
41
|
-
}
|
|
42
|
-
getByKey(blobId) {
|
|
43
|
-
const resource = super.tryGetByKey(blobId);
|
|
44
|
-
if (!resource) {
|
|
45
|
-
const error = new model.PFrameDriverError(`Invalid blob id`);
|
|
46
|
-
error.cause = new Error(`Blob with id ${blobId} not found.`);
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
return resource;
|
|
50
|
-
}
|
|
51
|
-
makeDataSource(signal) {
|
|
52
|
-
return {
|
|
53
|
-
preloadBlob: async (_blobIds) => { },
|
|
54
|
-
resolveBlobContent: async (blobId) => {
|
|
55
|
-
const filePath = this.getByKey(blobId);
|
|
56
|
-
return await fs.promises.readFile(filePath, { signal });
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
class RemoteBlobProviderImpl {
|
|
62
|
-
pool;
|
|
63
|
-
server;
|
|
64
|
-
constructor(pool, server) {
|
|
65
|
-
this.pool = pool;
|
|
66
|
-
this.server = server;
|
|
67
|
-
}
|
|
68
|
-
static async init(dataFolder, logger, serverOptions) {
|
|
69
|
-
const pool = new LocalBlobProviderImpl(dataFolder);
|
|
70
|
-
const underlyingStore = await pframesRsNode.HttpHelpers.createFsStore({ rootDir: dataFolder, logger });
|
|
71
|
-
const store = {
|
|
72
|
-
request: (filename, params) => {
|
|
73
|
-
const blobId = filename.slice(0, -plModelMiddleLayer.PFrameInternal.ParquetExtension.length);
|
|
74
|
-
return underlyingStore.request(blobId, params);
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const handler = pframesRsNode.HttpHelpers.createRequestHandler({ store });
|
|
78
|
-
const server = await pframesRsNode.HttpHelpers.createHttpServer({ ...serverOptions, handler });
|
|
79
|
-
return new RemoteBlobProviderImpl(pool, server);
|
|
80
|
-
}
|
|
81
|
-
acquire(params) {
|
|
82
|
-
return this.pool.acquire(params);
|
|
83
|
-
}
|
|
84
|
-
httpServerInfo() {
|
|
85
|
-
return this.server.info;
|
|
86
|
-
}
|
|
87
|
-
async [Symbol.asyncDispose]() {
|
|
88
|
-
await this.server.stop();
|
|
89
|
-
}
|
|
24
|
+
return res;
|
|
90
25
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
26
|
+
var LocalBlobProviderImpl = class extends _milaboratories_ts_helpers.RefCountPoolBase {
|
|
27
|
+
constructor(dataFolder) {
|
|
28
|
+
super();
|
|
29
|
+
this.dataFolder = dataFolder;
|
|
30
|
+
}
|
|
31
|
+
calculateParamsKey(params) {
|
|
32
|
+
return makeBlobId(params);
|
|
33
|
+
}
|
|
34
|
+
createNewResource(params, _key) {
|
|
35
|
+
const filePath = node_path.default.join(this.dataFolder, params);
|
|
36
|
+
if (!node_fs.default.statSync(filePath, { throwIfNoEntry: false })?.isFile()) {
|
|
37
|
+
const error = new _platforma_sdk_model.PFrameDriverError(`Invalid file name`);
|
|
38
|
+
error.cause = /* @__PURE__ */ new Error(`File ${filePath} does not exist`);
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
return filePath;
|
|
42
|
+
}
|
|
43
|
+
getByKey(blobId) {
|
|
44
|
+
const resource = super.tryGetByKey(blobId);
|
|
45
|
+
if (!resource) {
|
|
46
|
+
const error = new _platforma_sdk_model.PFrameDriverError(`Invalid blob id`);
|
|
47
|
+
error.cause = /* @__PURE__ */ new Error(`Blob with id ${blobId} not found.`);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
return resource;
|
|
51
|
+
}
|
|
52
|
+
makeDataSource(signal) {
|
|
53
|
+
return {
|
|
54
|
+
preloadBlob: async (_blobIds) => {},
|
|
55
|
+
resolveBlobContent: async (blobId) => {
|
|
56
|
+
const filePath = this.getByKey(blobId);
|
|
57
|
+
return await node_fs.default.promises.readFile(filePath, { signal });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var RemoteBlobProviderImpl = class RemoteBlobProviderImpl {
|
|
63
|
+
constructor(pool, server) {
|
|
64
|
+
this.pool = pool;
|
|
65
|
+
this.server = server;
|
|
66
|
+
}
|
|
67
|
+
static async init(dataFolder, logger, serverOptions) {
|
|
68
|
+
const pool = new LocalBlobProviderImpl(dataFolder);
|
|
69
|
+
const underlyingStore = await _milaboratories_pframes_rs_node.HttpHelpers.createFsStore({
|
|
70
|
+
rootDir: dataFolder,
|
|
71
|
+
logger
|
|
72
|
+
});
|
|
73
|
+
const handler = _milaboratories_pframes_rs_node.HttpHelpers.createRequestHandler({ store: { request: (filename, params) => {
|
|
74
|
+
const blobId = filename.slice(0, -_milaboratories_pl_model_middle_layer.PFrameInternal.ParquetExtension.length);
|
|
75
|
+
return underlyingStore.request(blobId, params);
|
|
76
|
+
} } });
|
|
77
|
+
return new RemoteBlobProviderImpl(pool, await _milaboratories_pframes_rs_node.HttpHelpers.createHttpServer({
|
|
78
|
+
...serverOptions,
|
|
79
|
+
handler
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
acquire(params) {
|
|
83
|
+
return this.pool.acquire(params);
|
|
84
|
+
}
|
|
85
|
+
httpServerInfo() {
|
|
86
|
+
return this.server.info;
|
|
87
|
+
}
|
|
88
|
+
async [Symbol.asyncDispose]() {
|
|
89
|
+
await this.server.stop();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
async function createPFrameDriverDouble({ dataFolder = (0, node_os.tmpdir)(), logger = console.log }) {
|
|
93
|
+
const localBlobProvider = new LocalBlobProviderImpl(dataFolder);
|
|
94
|
+
const remoteBlobProvider = await RemoteBlobProviderImpl.init(dataFolder, logger, {});
|
|
95
|
+
const resolveDataInfo = (spec, data) => (0, _platforma_sdk_model.isDataInfo)(data) ? data : require_data_info_helpers.makeJsonDataInfo(spec, data);
|
|
96
|
+
return new require_driver_impl.AbstractPFrameDriver({
|
|
97
|
+
logger,
|
|
98
|
+
localBlobProvider,
|
|
99
|
+
remoteBlobProvider,
|
|
100
|
+
resolveDataInfo
|
|
101
|
+
});
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
//#endregion
|
|
104
105
|
exports.createPFrameDriverDouble = createPFrameDriverDouble;
|
|
105
106
|
exports.makeFolderPath = makeFolderPath;
|
|
106
|
-
//# sourceMappingURL=driver_double.cjs.map
|
|
107
|
+
//# sourceMappingURL=driver_double.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver_double.cjs","sources":["../src/driver_double.ts"],"sourcesContent":["import {\n isDataInfo,\n PFrameDriverError,\n type Branded,\n type PColumnSpec,\n type PColumnValues,\n} from \"@platforma-sdk/model\";\nimport { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/ts-helpers\";\nimport { HttpHelpers } from \"@milaboratories/pframes-rs-node\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport type { AbstractInternalPFrameDriver } from \"./driver_decl\";\nimport {\n AbstractPFrameDriver,\n type LocalBlobProvider,\n type RemoteBlobProvider,\n} from \"./driver_impl\";\nimport { makeJsonDataInfo } from \"./data_info_helpers\";\n\nexport type FileName = Branded<string, \"FileName\">;\nexport type FilePath = Branded<string, \"FilePath\">;\nexport type FolderPath = Branded<string, \"FolderPath\">;\n\nexport function makeFolderPath(dataFolder: string): FolderPath {\n if (!fs.statSync(dataFolder, { throwIfNoEntry: false })?.isDirectory()) {\n const error = new PFrameDriverError(`Invalid data folder`);\n error.cause = new Error(`Folder ${dataFolder} does not exist`);\n throw error;\n }\n return dataFolder as FolderPath;\n}\n\nfunction makeBlobId(res: FileName): PFrameInternal.PFrameBlobId {\n return res as string as PFrameInternal.PFrameBlobId;\n}\n\nclass LocalBlobProviderImpl\n extends RefCountPoolBase<FileName, PFrameInternal.PFrameBlobId, FilePath>\n implements LocalBlobProvider<FileName>\n{\n constructor(private readonly dataFolder: FolderPath) {\n super();\n }\n\n protected calculateParamsKey(params: FileName): PFrameInternal.PFrameBlobId {\n return makeBlobId(params);\n }\n\n protected createNewResource(params: FileName, _key: PFrameInternal.PFrameBlobId): FilePath {\n const filePath = path.join(this.dataFolder, params);\n if (!fs.statSync(filePath, { throwIfNoEntry: false })?.isFile()) {\n const error = new PFrameDriverError(`Invalid file name`);\n error.cause = new Error(`File ${filePath} does not exist`);\n throw error;\n }\n return filePath as FilePath;\n }\n\n public getByKey(blobId: PFrameInternal.PFrameBlobId): FilePath {\n const resource = super.tryGetByKey(blobId);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid blob id`);\n error.cause = new Error(`Blob with id ${blobId} not found.`);\n throw error;\n }\n return resource;\n }\n\n public makeDataSource(\n signal: AbortSignal,\n ): Omit<PFrameInternal.PFrameDataSourceV2, \"parquetServer\"> {\n return {\n preloadBlob: async (_blobIds: PFrameInternal.PFrameBlobId[]) => {},\n resolveBlobContent: async (blobId: PFrameInternal.PFrameBlobId) => {\n const filePath = this.getByKey(blobId);\n return await fs.promises.readFile(filePath, { signal });\n },\n };\n }\n}\n\nclass RemoteBlobProviderImpl implements RemoteBlobProvider<FileName> {\n constructor(\n private readonly pool: LocalBlobProviderImpl,\n private readonly server: PFrameInternal.HttpServer,\n ) {}\n\n public static async init(\n dataFolder: FolderPath,\n logger: PFrameInternal.Logger,\n serverOptions: Omit<PFrameInternal.HttpServerOptions, \"handler\">,\n ): Promise<RemoteBlobProviderImpl> {\n const pool = new LocalBlobProviderImpl(dataFolder);\n\n const underlyingStore = await HttpHelpers.createFsStore({ rootDir: dataFolder, logger });\n const store: PFrameInternal.ObjectStore = {\n request: (filename, params) => {\n const blobId = filename.slice(0, -PFrameInternal.ParquetExtension.length);\n return underlyingStore.request(blobId as PFrameInternal.ParquetFileName, params);\n },\n };\n\n const handler = HttpHelpers.createRequestHandler({ store });\n const server = await HttpHelpers.createHttpServer({ ...serverOptions, handler });\n\n return new RemoteBlobProviderImpl(pool, server);\n }\n\n public acquire(params: FileName): PoolEntry<PFrameInternal.PFrameBlobId> {\n return this.pool.acquire(params);\n }\n\n public httpServerInfo(): PFrameInternal.HttpServerInfo {\n return this.server.info;\n }\n\n async [Symbol.asyncDispose](): Promise<void> {\n await this.server.stop();\n }\n}\n\nexport type InternalPFrameDriverDouble = AbstractInternalPFrameDriver<\n PFrameInternal.DataInfo<FileName> | PColumnValues\n>;\n\n// It's mock for testing purposes, not a real test!\nexport async function createPFrameDriverDouble({\n dataFolder = tmpdir() as FolderPath,\n logger = console.log,\n}: {\n dataFolder?: FolderPath;\n logger?: PFrameInternal.Logger;\n}): Promise<InternalPFrameDriverDouble> {\n const localBlobProvider = new LocalBlobProviderImpl(dataFolder);\n const remoteBlobProvider = await RemoteBlobProviderImpl.init(dataFolder, logger, {});\n\n const resolveDataInfo = (\n spec: PColumnSpec,\n data: PFrameInternal.DataInfo<FileName> | PColumnValues,\n ) => (isDataInfo(data) ? data : makeJsonDataInfo(spec, data));\n\n return new AbstractPFrameDriver({\n logger,\n localBlobProvider,\n remoteBlobProvider,\n resolveDataInfo,\n });\n}\n"],"
|
|
1
|
+
{"version":3,"file":"driver_double.cjs","names":["fs","PFrameDriverError","RefCountPoolBase","path","HttpHelpers","PFrameInternal","makeJsonDataInfo","AbstractPFrameDriver"],"sources":["../src/driver_double.ts"],"sourcesContent":["import {\n isDataInfo,\n PFrameDriverError,\n type Branded,\n type PColumnSpec,\n type PColumnValues,\n} from \"@platforma-sdk/model\";\nimport { PFrameInternal } from \"@milaboratories/pl-model-middle-layer\";\nimport { RefCountPoolBase, type PoolEntry } from \"@milaboratories/ts-helpers\";\nimport { HttpHelpers } from \"@milaboratories/pframes-rs-node\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport type { AbstractInternalPFrameDriver } from \"./driver_decl\";\nimport {\n AbstractPFrameDriver,\n type LocalBlobProvider,\n type RemoteBlobProvider,\n} from \"./driver_impl\";\nimport { makeJsonDataInfo } from \"./data_info_helpers\";\n\nexport type FileName = Branded<string, \"FileName\">;\nexport type FilePath = Branded<string, \"FilePath\">;\nexport type FolderPath = Branded<string, \"FolderPath\">;\n\nexport function makeFolderPath(dataFolder: string): FolderPath {\n if (!fs.statSync(dataFolder, { throwIfNoEntry: false })?.isDirectory()) {\n const error = new PFrameDriverError(`Invalid data folder`);\n error.cause = new Error(`Folder ${dataFolder} does not exist`);\n throw error;\n }\n return dataFolder as FolderPath;\n}\n\nfunction makeBlobId(res: FileName): PFrameInternal.PFrameBlobId {\n return res as string as PFrameInternal.PFrameBlobId;\n}\n\nclass LocalBlobProviderImpl\n extends RefCountPoolBase<FileName, PFrameInternal.PFrameBlobId, FilePath>\n implements LocalBlobProvider<FileName>\n{\n constructor(private readonly dataFolder: FolderPath) {\n super();\n }\n\n protected calculateParamsKey(params: FileName): PFrameInternal.PFrameBlobId {\n return makeBlobId(params);\n }\n\n protected createNewResource(params: FileName, _key: PFrameInternal.PFrameBlobId): FilePath {\n const filePath = path.join(this.dataFolder, params);\n if (!fs.statSync(filePath, { throwIfNoEntry: false })?.isFile()) {\n const error = new PFrameDriverError(`Invalid file name`);\n error.cause = new Error(`File ${filePath} does not exist`);\n throw error;\n }\n return filePath as FilePath;\n }\n\n public getByKey(blobId: PFrameInternal.PFrameBlobId): FilePath {\n const resource = super.tryGetByKey(blobId);\n if (!resource) {\n const error = new PFrameDriverError(`Invalid blob id`);\n error.cause = new Error(`Blob with id ${blobId} not found.`);\n throw error;\n }\n return resource;\n }\n\n public makeDataSource(\n signal: AbortSignal,\n ): Omit<PFrameInternal.PFrameDataSourceV2, \"parquetServer\"> {\n return {\n preloadBlob: async (_blobIds: PFrameInternal.PFrameBlobId[]) => {},\n resolveBlobContent: async (blobId: PFrameInternal.PFrameBlobId) => {\n const filePath = this.getByKey(blobId);\n return await fs.promises.readFile(filePath, { signal });\n },\n };\n }\n}\n\nclass RemoteBlobProviderImpl implements RemoteBlobProvider<FileName> {\n constructor(\n private readonly pool: LocalBlobProviderImpl,\n private readonly server: PFrameInternal.HttpServer,\n ) {}\n\n public static async init(\n dataFolder: FolderPath,\n logger: PFrameInternal.Logger,\n serverOptions: Omit<PFrameInternal.HttpServerOptions, \"handler\">,\n ): Promise<RemoteBlobProviderImpl> {\n const pool = new LocalBlobProviderImpl(dataFolder);\n\n const underlyingStore = await HttpHelpers.createFsStore({ rootDir: dataFolder, logger });\n const store: PFrameInternal.ObjectStore = {\n request: (filename, params) => {\n const blobId = filename.slice(0, -PFrameInternal.ParquetExtension.length);\n return underlyingStore.request(blobId as PFrameInternal.ParquetFileName, params);\n },\n };\n\n const handler = HttpHelpers.createRequestHandler({ store });\n const server = await HttpHelpers.createHttpServer({ ...serverOptions, handler });\n\n return new RemoteBlobProviderImpl(pool, server);\n }\n\n public acquire(params: FileName): PoolEntry<PFrameInternal.PFrameBlobId> {\n return this.pool.acquire(params);\n }\n\n public httpServerInfo(): PFrameInternal.HttpServerInfo {\n return this.server.info;\n }\n\n async [Symbol.asyncDispose](): Promise<void> {\n await this.server.stop();\n }\n}\n\nexport type InternalPFrameDriverDouble = AbstractInternalPFrameDriver<\n PFrameInternal.DataInfo<FileName> | PColumnValues\n>;\n\n// It's mock for testing purposes, not a real test!\nexport async function createPFrameDriverDouble({\n dataFolder = tmpdir() as FolderPath,\n logger = console.log,\n}: {\n dataFolder?: FolderPath;\n logger?: PFrameInternal.Logger;\n}): Promise<InternalPFrameDriverDouble> {\n const localBlobProvider = new LocalBlobProviderImpl(dataFolder);\n const remoteBlobProvider = await RemoteBlobProviderImpl.init(dataFolder, logger, {});\n\n const resolveDataInfo = (\n spec: PColumnSpec,\n data: PFrameInternal.DataInfo<FileName> | PColumnValues,\n ) => (isDataInfo(data) ? data : makeJsonDataInfo(spec, data));\n\n return new AbstractPFrameDriver({\n logger,\n localBlobProvider,\n remoteBlobProvider,\n resolveDataInfo,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAgB,eAAe,YAAgC;AAC7D,KAAI,CAACA,gBAAG,SAAS,YAAY,EAAE,gBAAgB,OAAO,CAAC,EAAE,aAAa,EAAE;EACtE,MAAM,QAAQ,IAAIC,uCAAkB,sBAAsB;AAC1D,QAAM,wBAAQ,IAAI,MAAM,UAAU,WAAW,iBAAiB;AAC9D,QAAM;;AAER,QAAO;;AAGT,SAAS,WAAW,KAA4C;AAC9D,QAAO;;AAGT,IAAM,wBAAN,cACUC,4CAEV;CACE,YAAY,AAAiB,YAAwB;AACnD,SAAO;EADoB;;CAI7B,AAAU,mBAAmB,QAA+C;AAC1E,SAAO,WAAW,OAAO;;CAG3B,AAAU,kBAAkB,QAAkB,MAA6C;EACzF,MAAM,WAAWC,kBAAK,KAAK,KAAK,YAAY,OAAO;AACnD,MAAI,CAACH,gBAAG,SAAS,UAAU,EAAE,gBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE;GAC/D,MAAM,QAAQ,IAAIC,uCAAkB,oBAAoB;AACxD,SAAM,wBAAQ,IAAI,MAAM,QAAQ,SAAS,iBAAiB;AAC1D,SAAM;;AAER,SAAO;;CAGT,AAAO,SAAS,QAA+C;EAC7D,MAAM,WAAW,MAAM,YAAY,OAAO;AAC1C,MAAI,CAAC,UAAU;GACb,MAAM,QAAQ,IAAIA,uCAAkB,kBAAkB;AACtD,SAAM,wBAAQ,IAAI,MAAM,gBAAgB,OAAO,aAAa;AAC5D,SAAM;;AAER,SAAO;;CAGT,AAAO,eACL,QAC0D;AAC1D,SAAO;GACL,aAAa,OAAO,aAA4C;GAChE,oBAAoB,OAAO,WAAwC;IACjE,MAAM,WAAW,KAAK,SAAS,OAAO;AACtC,WAAO,MAAMD,gBAAG,SAAS,SAAS,UAAU,EAAE,QAAQ,CAAC;;GAE1D;;;AAIL,IAAM,yBAAN,MAAM,uBAA+D;CACnE,YACE,AAAiB,MACjB,AAAiB,QACjB;EAFiB;EACA;;CAGnB,aAAoB,KAClB,YACA,QACA,eACiC;EACjC,MAAM,OAAO,IAAI,sBAAsB,WAAW;EAElD,MAAM,kBAAkB,MAAMI,4CAAY,cAAc;GAAE,SAAS;GAAY;GAAQ,CAAC;EAQxF,MAAM,UAAUA,4CAAY,qBAAqB,EAAE,OAPT,EACxC,UAAU,UAAU,WAAW;GAC7B,MAAM,SAAS,SAAS,MAAM,GAAG,CAACC,qDAAe,iBAAiB,OAAO;AACzE,UAAO,gBAAgB,QAAQ,QAA0C,OAAO;KAEnF,EAEyD,CAAC;AAG3D,SAAO,IAAI,uBAAuB,MAFnB,MAAMD,4CAAY,iBAAiB;GAAE,GAAG;GAAe;GAAS,CAAC,CAEjC;;CAGjD,AAAO,QAAQ,QAA0D;AACvE,SAAO,KAAK,KAAK,QAAQ,OAAO;;CAGlC,AAAO,iBAAgD;AACrD,SAAO,KAAK,OAAO;;CAGrB,OAAO,OAAO,gBAA+B;AAC3C,QAAM,KAAK,OAAO,MAAM;;;AAS5B,eAAsB,yBAAyB,EAC7C,kCAAqB,EACrB,SAAS,QAAQ,OAIqB;CACtC,MAAM,oBAAoB,IAAI,sBAAsB,WAAW;CAC/D,MAAM,qBAAqB,MAAM,uBAAuB,KAAK,YAAY,QAAQ,EAAE,CAAC;CAEpF,MAAM,mBACJ,MACA,8CACe,KAAK,GAAG,OAAOE,2CAAiB,MAAM,KAAK;AAE5D,QAAO,IAAIC,yCAAqB;EAC9B;EACA;EACA;EACA;EACD,CAAC"}
|
package/dist/driver_double.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractInternalPFrameDriver } from "./driver_decl.js";
|
|
2
|
+
import { Branded, PColumnValues } from "@platforma-sdk/model";
|
|
2
3
|
import { PFrameInternal } from "@milaboratories/pl-model-middle-layer";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
|
|
5
|
+
//#region src/driver_double.d.ts
|
|
6
|
+
type FileName = Branded<string, "FileName">;
|
|
7
|
+
type FilePath = Branded<string, "FilePath">;
|
|
8
|
+
type FolderPath = Branded<string, "FolderPath">;
|
|
9
|
+
declare function makeFolderPath(dataFolder: string): FolderPath;
|
|
10
|
+
type InternalPFrameDriverDouble = AbstractInternalPFrameDriver<PFrameInternal.DataInfo<FileName> | PColumnValues>;
|
|
11
|
+
declare function createPFrameDriverDouble({
|
|
12
|
+
dataFolder,
|
|
13
|
+
logger
|
|
14
|
+
}: {
|
|
15
|
+
dataFolder?: FolderPath;
|
|
16
|
+
logger?: PFrameInternal.Logger;
|
|
12
17
|
}): Promise<InternalPFrameDriverDouble>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FileName, FilePath, FolderPath, InternalPFrameDriverDouble, createPFrameDriverDouble, makeFolderPath };
|
|
13
20
|
//# sourceMappingURL=driver_double.d.ts.map
|