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