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