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