@milaboratories/pframes-rs-node 1.0.51 → 1.0.52
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/export/wrapper.ts +71 -41
- package/export_dist/index.js +21 -20
- package/export_dist/index.js.map +1 -1
- package/export_dist/index.mjs +250 -234
- package/export_dist/index.mjs.map +1 -1
- package/export_dist/wrapper.d.ts.map +1 -1
- package/package.json +3 -3
package/export_dist/index.mjs
CHANGED
|
@@ -1,128 +1,129 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
5
|
-
import { ulid as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
var J = Object.defineProperty;
|
|
2
|
+
var N = (a, t, e) => t in a ? J(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var b = (a, t, e) => N(a, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import $ from "humanize-duration";
|
|
5
|
+
import { ulid as l } from "ulid";
|
|
6
|
+
import { PFrameError as h, ensureError as u, isAbortError as y, AbortError as S } from "@milaboratories/pl-model-common";
|
|
7
|
+
import { createRequire as U } from "node:module";
|
|
8
|
+
import C, { dirname as O, resolve as k } from "node:path";
|
|
9
|
+
import { fileURLToPath as A } from "node:url";
|
|
10
|
+
import R from "@mapbox/node-pre-gyp";
|
|
11
|
+
import { createHash as v } from "node:crypto";
|
|
12
|
+
import q from "node:fs";
|
|
13
|
+
import { Readable as I, Writable as E } from "node:stream";
|
|
14
|
+
const j = import.meta.url, B = O(A(j)), V = U(j), { find: x } = R, c = V(
|
|
15
|
+
x(k(B, "../package.json"))
|
|
15
16
|
);
|
|
16
|
-
async function
|
|
17
|
+
async function M(a) {
|
|
17
18
|
try {
|
|
18
|
-
return await
|
|
19
|
+
return await q.promises.access(a), !0;
|
|
19
20
|
} catch {
|
|
20
21
|
return !1;
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
|
-
async function
|
|
24
|
-
await
|
|
24
|
+
async function G(a) {
|
|
25
|
+
await M(a) || await q.promises.mkdir(a, { recursive: !0 });
|
|
25
26
|
}
|
|
26
|
-
async function
|
|
27
|
+
async function _(a, t) {
|
|
27
28
|
const e = `${a}.tmp`;
|
|
28
|
-
await
|
|
29
|
-
const r = typeof t == "string" ? Buffer.from(t, "utf8") : t, i =
|
|
30
|
-
await
|
|
29
|
+
await M(e) && await q.promises.rm(e, { recursive: !0 });
|
|
30
|
+
const r = typeof t == "string" ? Buffer.from(t, "utf8") : t, i = I.from(r), s = q.createWriteStream(e, { flags: "wx" });
|
|
31
|
+
await I.toWeb(i).pipeTo(E.toWeb(s)), await q.promises.rename(e, a);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
33
|
+
function g(a) {
|
|
34
|
+
return v("sha256").update(a).digest("hex");
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function P(a) {
|
|
36
37
|
return a.type === "column" ? {
|
|
37
38
|
...a,
|
|
38
|
-
id:
|
|
39
|
+
id: g(a.id)
|
|
39
40
|
} : a;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function T(a) {
|
|
42
43
|
return {
|
|
43
44
|
...a,
|
|
44
|
-
column:
|
|
45
|
+
column: P(a.column)
|
|
45
46
|
};
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function W(a) {
|
|
48
49
|
return {
|
|
49
50
|
...a,
|
|
50
|
-
columnId:
|
|
51
|
-
filters: a.filters.map(
|
|
51
|
+
columnId: g(a.columnId),
|
|
52
|
+
filters: a.filters.map(T)
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function L(a) {
|
|
55
56
|
return {
|
|
56
57
|
...a,
|
|
57
|
-
column:
|
|
58
|
+
column: P(a.column)
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function p(a) {
|
|
61
62
|
const t = a.type;
|
|
62
63
|
switch (t) {
|
|
63
64
|
case "column":
|
|
64
65
|
return {
|
|
65
66
|
...a,
|
|
66
|
-
columnId:
|
|
67
|
+
columnId: g(a.columnId)
|
|
67
68
|
};
|
|
68
69
|
case "slicedColumn":
|
|
69
70
|
return {
|
|
70
71
|
...a,
|
|
71
|
-
columnId:
|
|
72
|
-
newId:
|
|
72
|
+
columnId: g(a.columnId),
|
|
73
|
+
newId: g(a.newId)
|
|
73
74
|
};
|
|
74
75
|
case "inlineColumn":
|
|
75
76
|
return {
|
|
76
77
|
...a,
|
|
77
|
-
newId:
|
|
78
|
+
newId: g(a.newId)
|
|
78
79
|
};
|
|
79
80
|
case "inner":
|
|
80
81
|
return {
|
|
81
82
|
...a,
|
|
82
|
-
entries: a.entries.map(
|
|
83
|
+
entries: a.entries.map(p)
|
|
83
84
|
};
|
|
84
85
|
case "full":
|
|
85
86
|
return {
|
|
86
87
|
...a,
|
|
87
|
-
entries: a.entries.map(
|
|
88
|
+
entries: a.entries.map(p)
|
|
88
89
|
};
|
|
89
90
|
case "outer":
|
|
90
91
|
return {
|
|
91
92
|
...a,
|
|
92
|
-
primary:
|
|
93
|
-
secondary: a.secondary.map(
|
|
93
|
+
primary: p(a.primary),
|
|
94
|
+
secondary: a.secondary.map(p)
|
|
94
95
|
};
|
|
95
96
|
default:
|
|
96
97
|
throw new Error(`Unsupported join entry type: ${t}`);
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function z(a) {
|
|
100
101
|
return {
|
|
101
102
|
...a,
|
|
102
|
-
src:
|
|
103
|
-
filters: a.filters.map(
|
|
103
|
+
src: p(a.src),
|
|
104
|
+
filters: a.filters.map(T)
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
|
-
async function
|
|
107
|
+
async function m(a, t, e) {
|
|
107
108
|
if (process.env.MI_DUMP_PFRAMES_RS)
|
|
108
109
|
try {
|
|
109
|
-
const r = a.map((n) => encodeURIComponent(n)), i =
|
|
110
|
+
const r = a.map((n) => encodeURIComponent(n)), i = C.join(
|
|
110
111
|
process.env.MI_DUMP_PFRAMES_RS,
|
|
111
112
|
...r.slice(0, -1)
|
|
112
113
|
);
|
|
113
|
-
await
|
|
114
|
-
const
|
|
115
|
-
await
|
|
114
|
+
await G(i);
|
|
115
|
+
const s = C.join(process.env.MI_DUMP_PFRAMES_RS, ...r), o = ArrayBuffer.isView(t) ? t : JSON.stringify(t, null, 2);
|
|
116
|
+
await _(s, o);
|
|
116
117
|
} catch (r) {
|
|
117
118
|
e == null || e("warn", `error while dumping PFrames data: ${r}`);
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
|
-
let
|
|
121
|
+
let H = class {
|
|
121
122
|
constructor(t, e) {
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
b(this, "id", l());
|
|
124
|
+
b(this, "frame");
|
|
124
125
|
var r;
|
|
125
|
-
this.logger = e,
|
|
126
|
+
this.logger = e, m(
|
|
126
127
|
[`${this.id}`, `${this.id}.json`],
|
|
127
128
|
{
|
|
128
129
|
timeStamp: Date.now(),
|
|
@@ -131,49 +132,56 @@ let _ = class {
|
|
|
131
132
|
this.logger
|
|
132
133
|
);
|
|
133
134
|
try {
|
|
134
|
-
this.frame =
|
|
135
|
+
this.frame = c.pFrameCreate(t, e), (r = this.logger) == null || r.call(this, "info", `PFrame ${this.id} created`);
|
|
135
136
|
} catch (i) {
|
|
136
|
-
throw new
|
|
137
|
+
throw new h(
|
|
137
138
|
`PFrame ${this.id} creation failed, logger: ${e == null ? void 0 : e.toString()}, error:
|
|
138
|
-
${i.
|
|
139
|
+
${u(i).message}`
|
|
139
140
|
);
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
static async pprofDump() {
|
|
143
|
-
|
|
144
|
+
try {
|
|
145
|
+
return await c.pprofDump();
|
|
146
|
+
} catch (t) {
|
|
147
|
+
throw new h(
|
|
148
|
+
`PFrame pprofDump failed, error:
|
|
149
|
+
${u(t).message}`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
153
|
addColumnSpec(t, e) {
|
|
146
|
-
const r =
|
|
147
|
-
|
|
154
|
+
const r = l();
|
|
155
|
+
m(
|
|
148
156
|
[`${this.id}`, `${r}.json`],
|
|
149
157
|
{
|
|
150
158
|
timeStamp: Date.now(),
|
|
151
159
|
requestType: "addColumnSpec",
|
|
152
160
|
requestData: {
|
|
153
|
-
columnId:
|
|
161
|
+
columnId: g(t),
|
|
154
162
|
columnSpec: e
|
|
155
163
|
}
|
|
156
164
|
},
|
|
157
165
|
this.logger
|
|
158
|
-
),
|
|
159
|
-
[`${this.id}`, "data", `${
|
|
166
|
+
), m(
|
|
167
|
+
[`${this.id}`, "data", `${g(t)}.spec`],
|
|
160
168
|
{
|
|
161
169
|
...e
|
|
162
170
|
},
|
|
163
171
|
this.logger
|
|
164
172
|
);
|
|
165
173
|
try {
|
|
166
|
-
return
|
|
174
|
+
return c.pFrameAddColumnSpec(this.frame, t, e);
|
|
167
175
|
} catch (i) {
|
|
168
|
-
throw new
|
|
176
|
+
throw new h(
|
|
169
177
|
`PFrame ${this.id} addColumnSpec request ${r} failed, columnId: ${JSON.stringify(t)}, columnSpec: ${JSON.stringify(e)}, error:
|
|
170
|
-
${i.
|
|
178
|
+
${u(i).message}`
|
|
171
179
|
);
|
|
172
180
|
}
|
|
173
181
|
}
|
|
174
182
|
setDataSource(t) {
|
|
175
|
-
const e =
|
|
176
|
-
|
|
183
|
+
const e = l();
|
|
184
|
+
m(
|
|
177
185
|
[`${this.id}`, `${e}.json`],
|
|
178
186
|
{
|
|
179
187
|
timeStamp: Date.now(),
|
|
@@ -183,10 +191,10 @@ ${i.toString()}`
|
|
|
183
191
|
);
|
|
184
192
|
const r = {
|
|
185
193
|
preloadBlob: async (i) => {
|
|
186
|
-
var n,
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
[`${this.id}`, `${
|
|
194
|
+
var n, d;
|
|
195
|
+
const s = l();
|
|
196
|
+
m(
|
|
197
|
+
[`${this.id}`, `${s}.json`],
|
|
190
198
|
{
|
|
191
199
|
timeStamp: Date.now(),
|
|
192
200
|
requestType: "preloadBlob",
|
|
@@ -200,23 +208,23 @@ ${i.toString()}`
|
|
|
200
208
|
"info",
|
|
201
209
|
`PFrame ${this.id} preloadBlob started, blobIds: ${JSON.stringify(i)}`
|
|
202
210
|
);
|
|
203
|
-
const
|
|
211
|
+
const o = performance.now();
|
|
204
212
|
try {
|
|
205
213
|
return await t.preloadBlob(i);
|
|
206
214
|
} finally {
|
|
207
|
-
const
|
|
208
|
-
(
|
|
215
|
+
const f = performance.now();
|
|
216
|
+
(d = this.logger) == null || d.call(
|
|
209
217
|
this,
|
|
210
218
|
"info",
|
|
211
|
-
`PFrame ${this.id} preloadBlob finished, took ${
|
|
219
|
+
`PFrame ${this.id} preloadBlob finished, took ${$(Math.round(f - o))} (${i.length} blobs)`
|
|
212
220
|
);
|
|
213
221
|
}
|
|
214
222
|
},
|
|
215
223
|
resolveBlobContent: async (i) => {
|
|
216
224
|
var n;
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
[`${this.id}`, `${
|
|
225
|
+
const s = l();
|
|
226
|
+
m(
|
|
227
|
+
[`${this.id}`, `${s}.json`],
|
|
220
228
|
{
|
|
221
229
|
timeStamp: Date.now(),
|
|
222
230
|
requestType: "resolveBlobContent",
|
|
@@ -226,52 +234,52 @@ ${i.toString()}`
|
|
|
226
234
|
},
|
|
227
235
|
this.logger
|
|
228
236
|
);
|
|
229
|
-
const
|
|
230
|
-
return (n = this.logger) == null || n.call(this, "info", `PFrame ${this.id} resolved blob ${i}`),
|
|
237
|
+
const o = await t.resolveBlobContent(i);
|
|
238
|
+
return (n = this.logger) == null || n.call(this, "info", `PFrame ${this.id} resolved blob ${i}`), m([`${this.id}`, "data", `${i}`], o, this.logger), o;
|
|
231
239
|
}
|
|
232
240
|
};
|
|
233
241
|
try {
|
|
234
|
-
return
|
|
242
|
+
return c.pFrameSetDataSource(this.frame, r);
|
|
235
243
|
} catch (i) {
|
|
236
|
-
throw new
|
|
244
|
+
throw new h(
|
|
237
245
|
`PFrame ${this.id} setDataSource request ${e} failed, dataSource: ${t.toString()}, error:
|
|
238
|
-
${i.
|
|
246
|
+
${u(i).message}`
|
|
239
247
|
);
|
|
240
248
|
}
|
|
241
249
|
}
|
|
242
250
|
setColumnData(t, e) {
|
|
243
|
-
const r =
|
|
244
|
-
|
|
251
|
+
const r = l();
|
|
252
|
+
m(
|
|
245
253
|
[`${this.id}`, `${r}.json`],
|
|
246
254
|
{
|
|
247
255
|
timeStamp: Date.now(),
|
|
248
256
|
requestType: "setColumnData",
|
|
249
257
|
requestData: {
|
|
250
|
-
columnId:
|
|
258
|
+
columnId: g(t),
|
|
251
259
|
dataInfo: e
|
|
252
260
|
}
|
|
253
261
|
},
|
|
254
262
|
this.logger
|
|
255
|
-
),
|
|
256
|
-
[`${this.id}`, "data", `${
|
|
263
|
+
), m(
|
|
264
|
+
[`${this.id}`, "data", `${g(t)}.datainfo`],
|
|
257
265
|
{
|
|
258
266
|
...e
|
|
259
267
|
},
|
|
260
268
|
this.logger
|
|
261
269
|
);
|
|
262
270
|
try {
|
|
263
|
-
return
|
|
271
|
+
return c.pFrameSetColumnData(this.frame, t, e);
|
|
264
272
|
} catch (i) {
|
|
265
|
-
throw new
|
|
273
|
+
throw new h(
|
|
266
274
|
`PFrame ${this.id} setColumnData request ${r} failed, columnId: ${JSON.stringify(t)}, dataInfo: ${JSON.stringify(e)}, error:
|
|
267
|
-
${i.
|
|
275
|
+
${u(i).message}`
|
|
268
276
|
);
|
|
269
277
|
}
|
|
270
278
|
}
|
|
271
279
|
dispose() {
|
|
272
280
|
var e;
|
|
273
|
-
const t =
|
|
274
|
-
|
|
281
|
+
const t = l();
|
|
282
|
+
m(
|
|
275
283
|
[`${this.id}`, `${t}.json`],
|
|
276
284
|
{
|
|
277
285
|
timeStamp: Date.now(),
|
|
@@ -280,11 +288,11 @@ ${i.toString()}`
|
|
|
280
288
|
this.logger
|
|
281
289
|
);
|
|
282
290
|
try {
|
|
283
|
-
|
|
291
|
+
c.pFrameDispose(this.frame), (e = this.logger) == null || e.call(this, "info", `PFrame ${this.id} disposed`);
|
|
284
292
|
} catch (r) {
|
|
285
|
-
throw new
|
|
293
|
+
throw new h(
|
|
286
294
|
`PFrame ${this.id} dispose request ${t} failed, error:
|
|
287
|
-
${r.
|
|
295
|
+
${u(r).message}`
|
|
288
296
|
);
|
|
289
297
|
}
|
|
290
298
|
}
|
|
@@ -293,8 +301,8 @@ ${r.toString()}`
|
|
|
293
301
|
}
|
|
294
302
|
async findColumns(t) {
|
|
295
303
|
var i;
|
|
296
|
-
const e =
|
|
297
|
-
|
|
304
|
+
const e = l();
|
|
305
|
+
m(
|
|
298
306
|
[`${this.id}`, `${e}.json`],
|
|
299
307
|
{
|
|
300
308
|
timeStamp: Date.now(),
|
|
@@ -305,25 +313,25 @@ ${r.toString()}`
|
|
|
305
313
|
);
|
|
306
314
|
const r = performance.now();
|
|
307
315
|
try {
|
|
308
|
-
return await
|
|
309
|
-
} catch (
|
|
310
|
-
throw new
|
|
316
|
+
return await c.pFrameFindColumns(this.frame, t);
|
|
317
|
+
} catch (s) {
|
|
318
|
+
throw new h(
|
|
311
319
|
`PFrame ${this.id} findColumns request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
312
|
-
${
|
|
320
|
+
${u(s).message}`
|
|
313
321
|
);
|
|
314
322
|
} finally {
|
|
315
|
-
const
|
|
323
|
+
const s = performance.now();
|
|
316
324
|
(i = this.logger) == null || i.call(
|
|
317
325
|
this,
|
|
318
326
|
"info",
|
|
319
|
-
`PFrame ${this.id} findColumns request ${e} took ${
|
|
327
|
+
`PFrame ${this.id} findColumns request ${e} took ${$(Math.round(s - r))}`
|
|
320
328
|
);
|
|
321
329
|
}
|
|
322
330
|
}
|
|
323
331
|
async deleteColumn(t) {
|
|
324
332
|
var i;
|
|
325
|
-
const e =
|
|
326
|
-
|
|
333
|
+
const e = l();
|
|
334
|
+
m(
|
|
327
335
|
[`${this.id}`, `${e}.json`],
|
|
328
336
|
{
|
|
329
337
|
timeStamp: Date.now(),
|
|
@@ -334,56 +342,56 @@ ${o.toString()}`
|
|
|
334
342
|
);
|
|
335
343
|
const r = performance.now();
|
|
336
344
|
try {
|
|
337
|
-
return await
|
|
338
|
-
} catch (
|
|
339
|
-
throw new
|
|
345
|
+
return await c.pFrameDeleteColumn(this.frame, t);
|
|
346
|
+
} catch (s) {
|
|
347
|
+
throw new h(
|
|
340
348
|
`PFrame ${this.id} deleteColumn request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
341
|
-
${
|
|
349
|
+
${u(s).message}`
|
|
342
350
|
);
|
|
343
351
|
} finally {
|
|
344
|
-
const
|
|
352
|
+
const s = performance.now();
|
|
345
353
|
(i = this.logger) == null || i.call(
|
|
346
354
|
this,
|
|
347
355
|
"info",
|
|
348
|
-
`PFrame ${this.id} deleteColumn request ${e} took ${
|
|
356
|
+
`PFrame ${this.id} deleteColumn request ${e} took ${$(Math.round(s - r))}`
|
|
349
357
|
);
|
|
350
358
|
}
|
|
351
359
|
}
|
|
352
360
|
async getColumnSpec(t) {
|
|
353
361
|
var i;
|
|
354
|
-
const e =
|
|
355
|
-
|
|
362
|
+
const e = l();
|
|
363
|
+
m(
|
|
356
364
|
[`${this.id}`, `${e}.json`],
|
|
357
365
|
{
|
|
358
366
|
timeStamp: Date.now(),
|
|
359
367
|
requestType: "getColumnSpec",
|
|
360
368
|
requestData: {
|
|
361
|
-
columnId:
|
|
369
|
+
columnId: g(t)
|
|
362
370
|
}
|
|
363
371
|
},
|
|
364
372
|
this.logger
|
|
365
373
|
);
|
|
366
374
|
const r = performance.now();
|
|
367
375
|
try {
|
|
368
|
-
return await
|
|
369
|
-
} catch (
|
|
370
|
-
throw new
|
|
376
|
+
return await c.pFrameGetColumnSpec(this.frame, t);
|
|
377
|
+
} catch (s) {
|
|
378
|
+
throw new h(
|
|
371
379
|
`PFrame ${this.id} getColumnSpec request ${e} failed, columnId: ${JSON.stringify(t)}, error:
|
|
372
|
-
${
|
|
380
|
+
${u(s).message}`
|
|
373
381
|
);
|
|
374
382
|
} finally {
|
|
375
|
-
const
|
|
383
|
+
const s = performance.now();
|
|
376
384
|
(i = this.logger) == null || i.call(
|
|
377
385
|
this,
|
|
378
386
|
"info",
|
|
379
|
-
`PFrame ${this.id} getColumnSpec request ${e} took ${
|
|
387
|
+
`PFrame ${this.id} getColumnSpec request ${e} took ${$(Math.round(s - r))}`
|
|
380
388
|
);
|
|
381
389
|
}
|
|
382
390
|
}
|
|
383
391
|
async listColumns() {
|
|
384
392
|
var r;
|
|
385
|
-
const t =
|
|
386
|
-
|
|
393
|
+
const t = l();
|
|
394
|
+
m(
|
|
387
395
|
[`${this.id}`, `${t}.json`],
|
|
388
396
|
{
|
|
389
397
|
timeStamp: Date.now(),
|
|
@@ -393,102 +401,104 @@ ${o.toString()}`
|
|
|
393
401
|
);
|
|
394
402
|
const e = performance.now();
|
|
395
403
|
try {
|
|
396
|
-
return await
|
|
404
|
+
return await c.pFrameListColumns(this.frame);
|
|
397
405
|
} catch (i) {
|
|
398
|
-
throw new
|
|
406
|
+
throw new h(
|
|
399
407
|
`PFrame ${this.id} listColumns request ${t} failed, error:
|
|
400
|
-
${i.
|
|
408
|
+
${u(i).message}`
|
|
401
409
|
);
|
|
402
410
|
} finally {
|
|
403
411
|
const i = performance.now();
|
|
404
412
|
(r = this.logger) == null || r.call(
|
|
405
413
|
this,
|
|
406
414
|
"info",
|
|
407
|
-
`PFrame ${this.id} listColumns request ${t} took ${
|
|
415
|
+
`PFrame ${this.id} listColumns request ${t} took ${$(Math.round(i - e))}`
|
|
408
416
|
);
|
|
409
417
|
}
|
|
410
418
|
}
|
|
411
419
|
createTable(t) {
|
|
412
|
-
var
|
|
413
|
-
const e =
|
|
420
|
+
var s;
|
|
421
|
+
const e = l(), r = {
|
|
414
422
|
timeStamp: Date.now(),
|
|
415
423
|
requestType: "createTable",
|
|
416
|
-
requestData:
|
|
424
|
+
requestData: z(t)
|
|
417
425
|
};
|
|
418
|
-
|
|
426
|
+
m([`${this.id}`, `${e}.json`], r, this.logger), m(
|
|
419
427
|
[`${this.id}`, `${e}`, `${e}.json`],
|
|
420
428
|
r,
|
|
421
429
|
this.logger
|
|
422
430
|
);
|
|
423
431
|
const i = performance.now();
|
|
424
432
|
try {
|
|
425
|
-
const
|
|
433
|
+
const o = c.pFrameCreateTable(
|
|
426
434
|
this.frame,
|
|
427
435
|
e,
|
|
428
436
|
t
|
|
429
437
|
);
|
|
430
|
-
return new
|
|
431
|
-
} catch (
|
|
432
|
-
throw new
|
|
438
|
+
return new D(this, e, o);
|
|
439
|
+
} catch (o) {
|
|
440
|
+
throw new h(
|
|
433
441
|
`PFrame ${this.id} createTable request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
434
|
-
${
|
|
442
|
+
${u(o).message}`
|
|
435
443
|
);
|
|
436
444
|
} finally {
|
|
437
|
-
const
|
|
438
|
-
(
|
|
445
|
+
const o = performance.now();
|
|
446
|
+
(s = this.logger) == null || s.call(
|
|
439
447
|
this,
|
|
440
448
|
"info",
|
|
441
|
-
`PFrame ${this.id} createTable request ${e} took ${
|
|
449
|
+
`PFrame ${this.id} createTable request ${e} took ${$(Math.round(o - i))}`
|
|
442
450
|
);
|
|
443
451
|
}
|
|
444
452
|
}
|
|
445
453
|
async getUniqueValues(t, e) {
|
|
446
|
-
var
|
|
447
|
-
const r =
|
|
448
|
-
|
|
454
|
+
var s, o, n;
|
|
455
|
+
const r = l();
|
|
456
|
+
m(
|
|
449
457
|
[`${this.id}`, `${r}.json`],
|
|
450
458
|
{
|
|
451
459
|
timeStamp: Date.now(),
|
|
452
460
|
requestType: "getUniqueValues",
|
|
453
|
-
requestData:
|
|
461
|
+
requestData: W(t)
|
|
454
462
|
},
|
|
455
463
|
this.logger
|
|
456
|
-
), (
|
|
464
|
+
), (s = this.logger) == null || s.call(
|
|
457
465
|
this,
|
|
458
466
|
"info",
|
|
459
467
|
`PFrame ${this.id} getUniqueValues request ${r} started`
|
|
460
468
|
);
|
|
461
469
|
const i = performance.now();
|
|
462
470
|
try {
|
|
463
|
-
return (
|
|
471
|
+
return (o = e == null ? void 0 : e.signal) == null || o.throwIfAborted(), await c.pFrameGetUniqueValues(
|
|
464
472
|
this.frame,
|
|
465
473
|
r,
|
|
466
474
|
t,
|
|
467
475
|
e == null ? void 0 : e.signal
|
|
468
476
|
);
|
|
469
|
-
} catch (
|
|
470
|
-
throw new
|
|
477
|
+
} catch (d) {
|
|
478
|
+
throw y(d) ? new S(
|
|
479
|
+
`PFrame ${this.id} getUniqueValues request ${r} cancelled`
|
|
480
|
+
) : new h(
|
|
471
481
|
`PFrame ${this.id} getUniqueValues request ${r} failed, request: ${JSON.stringify(t)}, error:
|
|
472
|
-
${u
|
|
482
|
+
${u(d).message}`
|
|
473
483
|
);
|
|
474
484
|
} finally {
|
|
475
|
-
const
|
|
485
|
+
const d = performance.now();
|
|
476
486
|
(n = this.logger) == null || n.call(
|
|
477
487
|
this,
|
|
478
488
|
"info",
|
|
479
|
-
`PFrame ${this.id} getUniqueValues request ${r} finished, took ${
|
|
489
|
+
`PFrame ${this.id} getUniqueValues request ${r} finished, took ${$(Math.round(d - i))}`
|
|
480
490
|
);
|
|
481
491
|
}
|
|
482
492
|
}
|
|
483
493
|
};
|
|
484
|
-
class
|
|
494
|
+
class D {
|
|
485
495
|
constructor(t, e, r) {
|
|
486
|
-
var i,
|
|
487
|
-
this.frame = t, this.id = e, this.table = r, (
|
|
496
|
+
var i, s;
|
|
497
|
+
this.frame = t, this.id = e, this.table = r, (s = (i = this.frame).logger) == null || s.call(i, "info", `PTable ${this.id} created`);
|
|
488
498
|
}
|
|
489
499
|
getSpec() {
|
|
490
|
-
const t =
|
|
491
|
-
|
|
500
|
+
const t = l();
|
|
501
|
+
m(
|
|
492
502
|
[`${this.frame.id}`, `${this.id}`, `${t}.json`],
|
|
493
503
|
{
|
|
494
504
|
timeStamp: Date.now(),
|
|
@@ -497,108 +507,112 @@ class w {
|
|
|
497
507
|
this.frame.logger
|
|
498
508
|
);
|
|
499
509
|
try {
|
|
500
|
-
return
|
|
510
|
+
return c.pTableGetSpec(this.table);
|
|
501
511
|
} catch (e) {
|
|
502
|
-
throw new
|
|
512
|
+
throw new h(
|
|
503
513
|
`PTable ${this.id} getSpec request ${t} failed, error:
|
|
504
|
-
${e.
|
|
514
|
+
${u(e).message}`
|
|
505
515
|
);
|
|
506
516
|
}
|
|
507
517
|
}
|
|
508
518
|
getColumnIndices(t) {
|
|
509
|
-
const e =
|
|
510
|
-
|
|
519
|
+
const e = l();
|
|
520
|
+
m(
|
|
511
521
|
[`${this.frame.id}`, `${this.id}`, `${e}.json`],
|
|
512
522
|
{
|
|
513
523
|
timeStamp: Date.now(),
|
|
514
524
|
requestType: "getColumnIndices",
|
|
515
525
|
requestData: {
|
|
516
|
-
columnIds: t.map(
|
|
526
|
+
columnIds: t.map(P)
|
|
517
527
|
}
|
|
518
528
|
},
|
|
519
529
|
this.frame.logger
|
|
520
530
|
);
|
|
521
531
|
try {
|
|
522
|
-
return
|
|
532
|
+
return c.pTableGetColumnIndices(this.table, t);
|
|
523
533
|
} catch (r) {
|
|
524
|
-
throw new
|
|
534
|
+
throw new h(
|
|
525
535
|
`PTable ${this.id} getColumnIndices request ${e} failed, columnIds: ${JSON.stringify(t)}, error:
|
|
526
|
-
${r.
|
|
536
|
+
${u(r).message}`
|
|
527
537
|
);
|
|
528
538
|
}
|
|
529
539
|
}
|
|
530
540
|
async getFootprint(t) {
|
|
531
|
-
var i,
|
|
532
|
-
const e =
|
|
533
|
-
|
|
541
|
+
var i, s, o, n, d;
|
|
542
|
+
const e = l();
|
|
543
|
+
m(
|
|
534
544
|
[`${this.frame.id}`, `${this.id}`, `${e}.json`],
|
|
535
545
|
{
|
|
536
546
|
timeStamp: Date.now(),
|
|
537
547
|
requestType: "getFootprint"
|
|
538
548
|
},
|
|
539
549
|
this.frame.logger
|
|
540
|
-
), (
|
|
550
|
+
), (s = (i = this.frame).logger) == null || s.call(
|
|
541
551
|
i,
|
|
542
552
|
"info",
|
|
543
553
|
`PTable ${this.id} getFootprint request ${e} started`
|
|
544
554
|
);
|
|
545
555
|
const r = performance.now();
|
|
546
556
|
try {
|
|
547
|
-
return (
|
|
557
|
+
return (o = t == null ? void 0 : t.signal) == null || o.throwIfAborted(), await c.pTableGetFootprint(
|
|
548
558
|
this.table,
|
|
549
559
|
(t == null ? void 0 : t.withPredecessors) ?? !1,
|
|
550
560
|
t == null ? void 0 : t.signal
|
|
551
561
|
);
|
|
552
|
-
} catch (
|
|
553
|
-
throw new
|
|
562
|
+
} catch (f) {
|
|
563
|
+
throw y(f) ? new S(
|
|
564
|
+
`PTable ${this.id} getFootprint request ${e} cancelled`
|
|
565
|
+
) : new h(
|
|
554
566
|
`PTable ${this.id} getFootprint request ${e} failed, error:
|
|
555
|
-
${
|
|
567
|
+
${u(f).message}`
|
|
556
568
|
);
|
|
557
569
|
} finally {
|
|
558
|
-
const
|
|
559
|
-
(
|
|
570
|
+
const f = performance.now();
|
|
571
|
+
(d = (n = this.frame).logger) == null || d.call(
|
|
560
572
|
n,
|
|
561
573
|
"info",
|
|
562
|
-
`PTable ${this.id} getFootprint request ${e} finished, took ${
|
|
574
|
+
`PTable ${this.id} getFootprint request ${e} finished, took ${$(Math.round(f - r))}`
|
|
563
575
|
);
|
|
564
576
|
}
|
|
565
577
|
}
|
|
566
578
|
async getShape(t) {
|
|
567
|
-
var i,
|
|
568
|
-
const e =
|
|
569
|
-
|
|
579
|
+
var i, s, o, n, d;
|
|
580
|
+
const e = l();
|
|
581
|
+
m(
|
|
570
582
|
[`${this.frame.id}`, `${this.id}`, `${e}.json`],
|
|
571
583
|
{
|
|
572
584
|
timeStamp: Date.now(),
|
|
573
585
|
requestType: "getShape"
|
|
574
586
|
},
|
|
575
587
|
this.frame.logger
|
|
576
|
-
), (
|
|
588
|
+
), (s = (i = this.frame).logger) == null || s.call(
|
|
577
589
|
i,
|
|
578
590
|
"info",
|
|
579
591
|
`PTable ${this.id} getShape request ${e} started`
|
|
580
592
|
);
|
|
581
593
|
const r = performance.now();
|
|
582
594
|
try {
|
|
583
|
-
return (
|
|
584
|
-
} catch (
|
|
585
|
-
throw new
|
|
595
|
+
return (o = t == null ? void 0 : t.signal) == null || o.throwIfAborted(), await c.pTableGetShape(this.table, t == null ? void 0 : t.signal);
|
|
596
|
+
} catch (f) {
|
|
597
|
+
throw y(f) ? new S(
|
|
598
|
+
`PTable ${this.id} getShape request ${e} cancelled`
|
|
599
|
+
) : new h(
|
|
586
600
|
`PTable ${this.id} getShape request ${e} failed, error:
|
|
587
|
-
${
|
|
601
|
+
${u(f).message}`
|
|
588
602
|
);
|
|
589
603
|
} finally {
|
|
590
|
-
const
|
|
591
|
-
(
|
|
604
|
+
const f = performance.now();
|
|
605
|
+
(d = (n = this.frame).logger) == null || d.call(
|
|
592
606
|
n,
|
|
593
607
|
"info",
|
|
594
|
-
`PTable ${this.id} getShape request ${e} finished, took ${
|
|
608
|
+
`PTable ${this.id} getShape request ${e} finished, took ${$(Math.round(f - r))}`
|
|
595
609
|
);
|
|
596
610
|
}
|
|
597
611
|
}
|
|
598
612
|
async getData(t, e) {
|
|
599
|
-
var
|
|
600
|
-
const r =
|
|
601
|
-
|
|
613
|
+
var o, n, d, f, F;
|
|
614
|
+
const r = l();
|
|
615
|
+
m(
|
|
602
616
|
[`${this.frame.id}`, `${this.id}`, `${r}.json`],
|
|
603
617
|
{
|
|
604
618
|
timeStamp: Date.now(),
|
|
@@ -609,113 +623,115 @@ ${c.toString()}`
|
|
|
609
623
|
}
|
|
610
624
|
},
|
|
611
625
|
this.frame.logger
|
|
612
|
-
), (n = (
|
|
613
|
-
|
|
626
|
+
), (n = (o = this.frame).logger) == null || n.call(
|
|
627
|
+
o,
|
|
614
628
|
"info",
|
|
615
629
|
`PTable ${this.id} getData request ${r} started`
|
|
616
630
|
);
|
|
617
631
|
let i = 0;
|
|
618
|
-
const
|
|
632
|
+
const s = performance.now();
|
|
619
633
|
try {
|
|
620
|
-
(
|
|
621
|
-
const
|
|
634
|
+
(d = e == null ? void 0 : e.signal) == null || d.throwIfAborted();
|
|
635
|
+
const w = await c.pTableGetData(
|
|
622
636
|
this.table,
|
|
623
637
|
r,
|
|
624
638
|
t,
|
|
625
639
|
e == null ? void 0 : e.range,
|
|
626
640
|
e == null ? void 0 : e.signal
|
|
627
641
|
);
|
|
628
|
-
return i =
|
|
629
|
-
} catch (
|
|
630
|
-
throw new
|
|
642
|
+
return i = w[0].data.length, w;
|
|
643
|
+
} catch (w) {
|
|
644
|
+
throw y(w) ? new S(
|
|
645
|
+
`PTable ${this.id} getData request ${r} cancelled`
|
|
646
|
+
) : new h(
|
|
631
647
|
`PTable ${this.id} getData request ${r} failed, columnIndices: ${JSON.stringify(t)}, range: ${e != null && e.range ? JSON.stringify(e.range) : void 0}, error:
|
|
632
|
-
${
|
|
648
|
+
${u(w).message}`
|
|
633
649
|
);
|
|
634
650
|
} finally {
|
|
635
|
-
const
|
|
636
|
-
(
|
|
637
|
-
|
|
651
|
+
const w = performance.now();
|
|
652
|
+
(F = (f = this.frame).logger) == null || F.call(
|
|
653
|
+
f,
|
|
638
654
|
"info",
|
|
639
|
-
`PTable ${this.id} getData request ${r} finished, took ${
|
|
655
|
+
`PTable ${this.id} getData request ${r} finished, took ${$(Math.round(w - s))} (${i} rows)`
|
|
640
656
|
);
|
|
641
657
|
}
|
|
642
658
|
}
|
|
643
659
|
filter(t) {
|
|
644
|
-
var
|
|
645
|
-
const e =
|
|
660
|
+
var s, o;
|
|
661
|
+
const e = l(), r = {
|
|
646
662
|
timeStamp: Date.now(),
|
|
647
663
|
table: this.id,
|
|
648
664
|
requestType: "filter",
|
|
649
665
|
requestData: {
|
|
650
|
-
filters: t.map(
|
|
666
|
+
filters: t.map(T)
|
|
651
667
|
}
|
|
652
668
|
};
|
|
653
|
-
|
|
669
|
+
m(
|
|
654
670
|
[`${this.frame.id}`, `${e}.json`],
|
|
655
671
|
r,
|
|
656
672
|
this.frame.logger
|
|
657
|
-
),
|
|
673
|
+
), m(
|
|
658
674
|
[`${this.frame.id}`, `${e}`, `${e}.json`],
|
|
659
675
|
r,
|
|
660
676
|
this.frame.logger
|
|
661
677
|
);
|
|
662
678
|
const i = performance.now();
|
|
663
679
|
try {
|
|
664
|
-
const n =
|
|
665
|
-
return new
|
|
680
|
+
const n = c.pTableFilter(this.table, e, t);
|
|
681
|
+
return new D(this.frame, e, n);
|
|
666
682
|
} catch (n) {
|
|
667
|
-
throw new
|
|
683
|
+
throw new h(
|
|
668
684
|
`PTable ${this.id} filter request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
669
|
-
${n.
|
|
685
|
+
${u(n).message}`
|
|
670
686
|
);
|
|
671
687
|
} finally {
|
|
672
688
|
const n = performance.now();
|
|
673
|
-
(
|
|
674
|
-
|
|
689
|
+
(o = (s = this.frame).logger) == null || o.call(
|
|
690
|
+
s,
|
|
675
691
|
"info",
|
|
676
|
-
`PTable ${this.id} filter request ${e} took ${
|
|
692
|
+
`PTable ${this.id} filter request ${e} took ${$(Math.round(n - i))}`
|
|
677
693
|
);
|
|
678
694
|
}
|
|
679
695
|
}
|
|
680
696
|
sort(t) {
|
|
681
|
-
var
|
|
682
|
-
const e =
|
|
697
|
+
var s, o;
|
|
698
|
+
const e = l(), r = {
|
|
683
699
|
timeStamp: Date.now(),
|
|
684
700
|
table: this.id,
|
|
685
701
|
requestType: "sort",
|
|
686
|
-
requestData: t.map(
|
|
702
|
+
requestData: t.map(L)
|
|
687
703
|
};
|
|
688
|
-
|
|
704
|
+
m(
|
|
689
705
|
[`${this.frame.id}`, `${e}.json`],
|
|
690
706
|
r,
|
|
691
707
|
this.frame.logger
|
|
692
|
-
),
|
|
708
|
+
), m(
|
|
693
709
|
[`${this.frame.id}`, `${e}`, `${e}.json`],
|
|
694
710
|
r,
|
|
695
711
|
this.frame.logger
|
|
696
712
|
);
|
|
697
713
|
const i = performance.now();
|
|
698
714
|
try {
|
|
699
|
-
const n =
|
|
700
|
-
return new
|
|
715
|
+
const n = c.pTableSort(this.table, e, t);
|
|
716
|
+
return new D(this.frame, e, n);
|
|
701
717
|
} catch (n) {
|
|
702
|
-
throw new
|
|
718
|
+
throw new h(
|
|
703
719
|
`PTable ${this.id} sort request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
704
|
-
${n.
|
|
720
|
+
${u(n).message}`
|
|
705
721
|
);
|
|
706
722
|
} finally {
|
|
707
723
|
const n = performance.now();
|
|
708
|
-
(
|
|
709
|
-
|
|
724
|
+
(o = (s = this.frame).logger) == null || o.call(
|
|
725
|
+
s,
|
|
710
726
|
"info",
|
|
711
|
-
`PTable ${this.id} sort request ${e} took ${
|
|
727
|
+
`PTable ${this.id} sort request ${e} took ${$(Math.round(n - i))}`
|
|
712
728
|
);
|
|
713
729
|
}
|
|
714
730
|
}
|
|
715
731
|
dispose() {
|
|
716
732
|
var e, r;
|
|
717
|
-
const t =
|
|
718
|
-
|
|
733
|
+
const t = l();
|
|
734
|
+
m(
|
|
719
735
|
[`${this.frame.id}`, `${this.id}`, `${t}.json`],
|
|
720
736
|
{
|
|
721
737
|
timeStamp: Date.now(),
|
|
@@ -724,11 +740,11 @@ ${n.toString()}`
|
|
|
724
740
|
this.frame.logger
|
|
725
741
|
);
|
|
726
742
|
try {
|
|
727
|
-
|
|
743
|
+
c.pTableDispose(this.table), (r = (e = this.frame).logger) == null || r.call(e, "info", `PTable ${this.id} disposed`);
|
|
728
744
|
} catch (i) {
|
|
729
|
-
throw new
|
|
745
|
+
throw new h(
|
|
730
746
|
`PTable ${this.id} dispose request ${t} failed, error:
|
|
731
|
-
${i.
|
|
747
|
+
${u(i).message}`
|
|
732
748
|
);
|
|
733
749
|
}
|
|
734
750
|
}
|
|
@@ -736,8 +752,8 @@ ${i.toString()}`
|
|
|
736
752
|
this.dispose();
|
|
737
753
|
}
|
|
738
754
|
}
|
|
739
|
-
const
|
|
755
|
+
const oe = H;
|
|
740
756
|
export {
|
|
741
|
-
|
|
757
|
+
oe as PFrame
|
|
742
758
|
};
|
|
743
759
|
//# sourceMappingURL=index.mjs.map
|