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