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