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