@milaboratories/pframes-rs-node 1.0.38 → 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 +5 -0
- package/export_dist/index.js +19 -19
- package/export_dist/index.js.map +1 -1
- package/export_dist/index.mjs +235 -232
- package/export_dist/index.mjs.map +1 -1
- package/export_dist/wrapper.d.ts.map +1 -1
- package/package.json +1 -1
package/export_dist/index.mjs
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
var y = Object.defineProperty;
|
|
2
|
-
var S = (
|
|
3
|
-
var
|
|
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
4
|
import { ulid as m } from "ulid";
|
|
5
5
|
import { createRequire as q } from "node:module";
|
|
6
|
-
import
|
|
7
|
-
import { fileURLToPath as
|
|
6
|
+
import l, { dirname as D, resolve as b } from "node:path";
|
|
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
|
|
12
|
-
E(
|
|
11
|
+
const w = import.meta.url, C = D(T(w)), j = q(w), { find: E } = P, h = j(
|
|
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(
|
|
69
|
+
addColumnSpec(t, e) {
|
|
70
70
|
const r = m();
|
|
71
|
-
|
|
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,93 +106,93 @@ ${s.toString()}`
|
|
|
106
106
|
this.logger
|
|
107
107
|
);
|
|
108
108
|
let r = {
|
|
109
|
-
preloadBlob: async (
|
|
109
|
+
preloadBlob: async (o) => {
|
|
110
110
|
var n;
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
[`${this.id}`, `${
|
|
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
|
|
127
|
+
const c = performance.now();
|
|
128
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 (
|
|
135
|
+
resolveBlobContent: async (o) => {
|
|
136
136
|
var n;
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
[`${this.id}`, `${
|
|
137
|
+
const s = m();
|
|
138
|
+
i(
|
|
139
|
+
[`${this.id}`, `${s}.json`],
|
|
140
140
|
{
|
|
141
141
|
timeStamp: Date.now(),
|
|
142
142
|
requestType: "resolveBlobContent",
|
|
143
143
|
requestData: {
|
|
144
|
-
blobId:
|
|
144
|
+
blobId: o
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
147
|
this.logger
|
|
148
148
|
);
|
|
149
|
-
const a = await
|
|
150
|
-
return (n = this.logger) == null || n.call(this, "info", `PFrame ${this.id} resolved blob ${
|
|
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;
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
try {
|
|
154
154
|
return h.pFrameSetDataSource(this.frame, r);
|
|
155
|
-
} catch (
|
|
155
|
+
} catch (o) {
|
|
156
156
|
throw new Error(
|
|
157
|
-
`PFrame ${this.id} setDataSource request ${
|
|
158
|
-
${
|
|
157
|
+
`PFrame ${this.id} setDataSource request ${e} failed, dataSource: ${t.toString()}, error:
|
|
158
|
+
${o.toString()}`
|
|
159
159
|
);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
setColumnData(
|
|
162
|
+
setColumnData(t, e) {
|
|
163
163
|
const r = m();
|
|
164
|
-
|
|
164
|
+
i(
|
|
165
165
|
[`${this.id}`, `${r}.json`],
|
|
166
166
|
{
|
|
167
167
|
timeStamp: Date.now(),
|
|
168
168
|
requestType: "setColumnData",
|
|
169
169
|
requestData: {
|
|
170
|
-
columnId:
|
|
171
|
-
dataInfo:
|
|
170
|
+
columnId: t,
|
|
171
|
+
dataInfo: e
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
this.logger
|
|
175
|
-
),
|
|
176
|
-
[`${this.id}`, "data", `${
|
|
175
|
+
), i(
|
|
176
|
+
[`${this.id}`, "data", `${t}.datainfo`],
|
|
177
177
|
{
|
|
178
|
-
...
|
|
178
|
+
...e
|
|
179
179
|
},
|
|
180
180
|
this.logger
|
|
181
181
|
);
|
|
182
182
|
try {
|
|
183
|
-
return h.pFrameSetColumnData(this.frame,
|
|
184
|
-
} catch (
|
|
183
|
+
return h.pFrameSetColumnData(this.frame, t, e);
|
|
184
|
+
} catch (o) {
|
|
185
185
|
throw new Error(
|
|
186
|
-
`PFrame ${this.id} setColumnData request ${r} failed, columnId: ${JSON.stringify(
|
|
187
|
-
${
|
|
186
|
+
`PFrame ${this.id} setColumnData request ${r} failed, columnId: ${JSON.stringify(t)}, dataInfo: ${JSON.stringify(e)}, error:
|
|
187
|
+
${o.toString()}`
|
|
188
188
|
);
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
dispose() {
|
|
192
|
-
var
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
[`${this.id}`, `${
|
|
192
|
+
var e;
|
|
193
|
+
const t = m();
|
|
194
|
+
i(
|
|
195
|
+
[`${this.id}`, `${t}.json`],
|
|
196
196
|
{
|
|
197
197
|
timeStamp: Date.now(),
|
|
198
198
|
requestType: "dispose"
|
|
@@ -200,10 +200,10 @@ ${s.toString()}`
|
|
|
200
200
|
this.logger
|
|
201
201
|
);
|
|
202
202
|
try {
|
|
203
|
-
h.pFrameDispose(this.frame), (
|
|
203
|
+
h.pFrameDispose(this.frame), (e = this.logger) == null || e.call(this, "info", `PFrame ${this.id} disposed`);
|
|
204
204
|
} catch (r) {
|
|
205
205
|
throw new Error(
|
|
206
|
-
`PFrame ${this.id} dispose request ${
|
|
206
|
+
`PFrame ${this.id} dispose request ${t} failed, error:
|
|
207
207
|
${r.toString()}`
|
|
208
208
|
);
|
|
209
209
|
}
|
|
@@ -211,147 +211,148 @@ ${r.toString()}`
|
|
|
211
211
|
[Symbol.dispose]() {
|
|
212
212
|
this.dispose();
|
|
213
213
|
}
|
|
214
|
-
async findColumns(
|
|
215
|
-
var
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
[`${this.id}`, `${
|
|
214
|
+
async findColumns(t) {
|
|
215
|
+
var o;
|
|
216
|
+
const e = m();
|
|
217
|
+
i(
|
|
218
|
+
[`${this.id}`, `${e}.json`],
|
|
219
219
|
{
|
|
220
220
|
timeStamp: Date.now(),
|
|
221
221
|
requestType: "findColumns",
|
|
222
|
-
requestData:
|
|
222
|
+
requestData: t
|
|
223
223
|
},
|
|
224
224
|
this.logger
|
|
225
225
|
);
|
|
226
226
|
const r = performance.now();
|
|
227
227
|
try {
|
|
228
|
-
return await h.pFrameFindColumns(this.frame,
|
|
229
|
-
} catch (
|
|
228
|
+
return await h.pFrameFindColumns(this.frame, t);
|
|
229
|
+
} catch (s) {
|
|
230
230
|
throw new Error(
|
|
231
|
-
`PFrame ${this.id} findColumns request ${
|
|
232
|
-
${
|
|
231
|
+
`PFrame ${this.id} findColumns request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
232
|
+
${s.toString()}`
|
|
233
233
|
);
|
|
234
234
|
} finally {
|
|
235
|
-
const
|
|
236
|
-
(
|
|
235
|
+
const s = performance.now();
|
|
236
|
+
(o = this.logger) == null || o.call(
|
|
237
237
|
this,
|
|
238
238
|
"info",
|
|
239
|
-
`PFrame ${this.id} findColumns request ${
|
|
239
|
+
`PFrame ${this.id} findColumns request ${e} took ${Math.round(s - r)}ms`
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
async deleteColumn(
|
|
244
|
-
var
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
[`${this.id}`, `${
|
|
243
|
+
async deleteColumn(t) {
|
|
244
|
+
var o;
|
|
245
|
+
const e = m();
|
|
246
|
+
i(
|
|
247
|
+
[`${this.id}`, `${e}.json`],
|
|
248
248
|
{
|
|
249
249
|
timeStamp: Date.now(),
|
|
250
250
|
requestType: "deleteColumn",
|
|
251
|
-
requestData:
|
|
251
|
+
requestData: t
|
|
252
252
|
},
|
|
253
253
|
this.logger
|
|
254
254
|
);
|
|
255
255
|
const r = performance.now();
|
|
256
256
|
try {
|
|
257
|
-
return await h.pFrameDeleteColumn(this.frame,
|
|
258
|
-
} catch (
|
|
257
|
+
return await h.pFrameDeleteColumn(this.frame, t);
|
|
258
|
+
} catch (s) {
|
|
259
259
|
throw new Error(
|
|
260
|
-
`PFrame ${this.id} deleteColumn request ${
|
|
261
|
-
${
|
|
260
|
+
`PFrame ${this.id} deleteColumn request ${e} failed, request: ${JSON.stringify(t)}, error:
|
|
261
|
+
${s.toString()}`
|
|
262
262
|
);
|
|
263
263
|
} finally {
|
|
264
|
-
const
|
|
265
|
-
(
|
|
264
|
+
const s = performance.now();
|
|
265
|
+
(o = this.logger) == null || o.call(
|
|
266
266
|
this,
|
|
267
267
|
"info",
|
|
268
|
-
`PFrame ${this.id} deleteColumn request ${
|
|
268
|
+
`PFrame ${this.id} deleteColumn request ${e} took ${Math.round(s - r)}ms`
|
|
269
269
|
);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
async getColumnSpec(
|
|
273
|
-
var
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
[`${this.id}`, `${
|
|
272
|
+
async getColumnSpec(t) {
|
|
273
|
+
var o;
|
|
274
|
+
const e = m();
|
|
275
|
+
i(
|
|
276
|
+
[`${this.id}`, `${e}.json`],
|
|
277
277
|
{
|
|
278
278
|
timeStamp: Date.now(),
|
|
279
279
|
requestType: "getColumnSpec",
|
|
280
280
|
requestData: {
|
|
281
|
-
columnId:
|
|
281
|
+
columnId: t
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
284
|
this.logger
|
|
285
285
|
);
|
|
286
286
|
const r = performance.now();
|
|
287
287
|
try {
|
|
288
|
-
return await h.pFrameGetColumnSpec(this.frame,
|
|
289
|
-
} catch (
|
|
288
|
+
return await h.pFrameGetColumnSpec(this.frame, t);
|
|
289
|
+
} catch (s) {
|
|
290
290
|
throw new Error(
|
|
291
|
-
`PFrame ${this.id} getColumnSpec request ${
|
|
292
|
-
${
|
|
291
|
+
`PFrame ${this.id} getColumnSpec request ${e} failed, columnId: ${JSON.stringify(t)}, error:
|
|
292
|
+
${s.toString()}`
|
|
293
293
|
);
|
|
294
294
|
} finally {
|
|
295
|
-
const
|
|
296
|
-
(
|
|
295
|
+
const s = performance.now();
|
|
296
|
+
(o = this.logger) == null || o.call(
|
|
297
297
|
this,
|
|
298
298
|
"info",
|
|
299
|
-
`PFrame ${this.id} getColumnSpec request ${
|
|
299
|
+
`PFrame ${this.id} getColumnSpec request ${e} took ${Math.round(s - r)}ms`
|
|
300
300
|
);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
async listColumns() {
|
|
304
304
|
var r;
|
|
305
|
-
const
|
|
306
|
-
|
|
307
|
-
[`${this.id}`, `${
|
|
305
|
+
const t = m();
|
|
306
|
+
i(
|
|
307
|
+
[`${this.id}`, `${t}.json`],
|
|
308
308
|
{
|
|
309
309
|
timeStamp: Date.now(),
|
|
310
310
|
requestType: "listColumns"
|
|
311
311
|
},
|
|
312
312
|
this.logger
|
|
313
313
|
);
|
|
314
|
-
const
|
|
314
|
+
const e = performance.now();
|
|
315
315
|
try {
|
|
316
316
|
return await h.pFrameListColumns(this.frame);
|
|
317
|
-
} catch (
|
|
317
|
+
} catch (o) {
|
|
318
318
|
throw new Error(
|
|
319
|
-
`PFrame ${this.id} listColumns request ${
|
|
320
|
-
${
|
|
319
|
+
`PFrame ${this.id} listColumns request ${t} failed, error:
|
|
320
|
+
${o.toString()}`
|
|
321
321
|
);
|
|
322
322
|
} finally {
|
|
323
|
-
const
|
|
323
|
+
const o = performance.now();
|
|
324
324
|
(r = this.logger) == null || r.call(
|
|
325
325
|
this,
|
|
326
326
|
"info",
|
|
327
|
-
`PFrame ${this.id} listColumns request ${
|
|
327
|
+
`PFrame ${this.id} listColumns request ${t} took ${Math.round(o - e)}ms`
|
|
328
328
|
);
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
async createTable(
|
|
331
|
+
async createTable(t, e) {
|
|
332
332
|
var a;
|
|
333
|
-
const r = m(),
|
|
333
|
+
const r = m(), o = {
|
|
334
334
|
timeStamp: Date.now(),
|
|
335
335
|
requestType: "createTable",
|
|
336
|
-
requestData:
|
|
336
|
+
requestData: t
|
|
337
337
|
};
|
|
338
|
-
|
|
338
|
+
i([`${this.id}`, `${r}.json`], o, this.logger), i(
|
|
339
339
|
[`${this.id}`, `${r}`, `${r}.json`],
|
|
340
|
-
|
|
340
|
+
o,
|
|
341
341
|
this.logger
|
|
342
342
|
);
|
|
343
|
-
const
|
|
343
|
+
const s = performance.now();
|
|
344
344
|
try {
|
|
345
|
+
e == null || e.throwIfAborted();
|
|
345
346
|
const n = await h.pFrameCreateTable(
|
|
346
347
|
this.frame,
|
|
347
348
|
r,
|
|
348
|
-
|
|
349
|
-
|
|
349
|
+
t,
|
|
350
|
+
e
|
|
350
351
|
);
|
|
351
|
-
return new
|
|
352
|
+
return new $(this, r, n);
|
|
352
353
|
} catch (n) {
|
|
353
354
|
throw new Error(
|
|
354
|
-
`PFrame ${this.id} createTable request ${r} failed, request: ${JSON.stringify(
|
|
355
|
+
`PFrame ${this.id} createTable request ${r} failed, request: ${JSON.stringify(t)}, error:
|
|
355
356
|
${n.toString()}`
|
|
356
357
|
);
|
|
357
358
|
} finally {
|
|
@@ -359,54 +360,54 @@ ${n.toString()}`
|
|
|
359
360
|
(a = this.logger) == null || a.call(
|
|
360
361
|
this,
|
|
361
362
|
"info",
|
|
362
|
-
`PFrame ${this.id} createTable request ${r} took ${Math.round(n -
|
|
363
|
+
`PFrame ${this.id} createTable request ${r} took ${Math.round(n - s)}ms`
|
|
363
364
|
);
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
|
-
async getUniqueValues(
|
|
367
|
-
var
|
|
367
|
+
async getUniqueValues(t, e) {
|
|
368
|
+
var s;
|
|
368
369
|
const r = m();
|
|
369
|
-
|
|
370
|
+
i(
|
|
370
371
|
[`${this.id}`, `${r}.json`],
|
|
371
372
|
{
|
|
372
373
|
timeStamp: Date.now(),
|
|
373
374
|
requestType: "getUniqueValues",
|
|
374
|
-
requestData:
|
|
375
|
+
requestData: t
|
|
375
376
|
},
|
|
376
377
|
this.logger
|
|
377
378
|
);
|
|
378
|
-
const
|
|
379
|
+
const o = performance.now();
|
|
379
380
|
try {
|
|
380
|
-
return await h.pFrameGetUniqueValues(
|
|
381
|
+
return e == null || e.throwIfAborted(), await h.pFrameGetUniqueValues(
|
|
381
382
|
this.frame,
|
|
382
383
|
r,
|
|
383
|
-
|
|
384
|
-
|
|
384
|
+
t,
|
|
385
|
+
e
|
|
385
386
|
);
|
|
386
387
|
} catch (a) {
|
|
387
388
|
throw new Error(
|
|
388
|
-
`PFrame ${this.id} getUniqueValues request ${r} failed, request: ${JSON.stringify(
|
|
389
|
+
`PFrame ${this.id} getUniqueValues request ${r} failed, request: ${JSON.stringify(t)}, error:
|
|
389
390
|
${a.toString()}`
|
|
390
391
|
);
|
|
391
392
|
} finally {
|
|
392
393
|
const a = performance.now();
|
|
393
|
-
(
|
|
394
|
+
(s = this.logger) == null || s.call(
|
|
394
395
|
this,
|
|
395
396
|
"info",
|
|
396
|
-
`PFrame ${this.id} getUniqueValues request ${r} took ${Math.round(a -
|
|
397
|
+
`PFrame ${this.id} getUniqueValues request ${r} took ${Math.round(a - o)}ms`
|
|
397
398
|
);
|
|
398
399
|
}
|
|
399
400
|
}
|
|
400
401
|
};
|
|
401
|
-
class
|
|
402
|
-
constructor(
|
|
403
|
-
var
|
|
404
|
-
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`);
|
|
405
406
|
}
|
|
406
407
|
getShape() {
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
[`${this.frame.id}`, `${this.id}`, `${
|
|
408
|
+
const t = m();
|
|
409
|
+
i(
|
|
410
|
+
[`${this.frame.id}`, `${this.id}`, `${t}.json`],
|
|
410
411
|
{
|
|
411
412
|
timeStamp: Date.now(),
|
|
412
413
|
requestType: "getShape"
|
|
@@ -415,17 +416,17 @@ class u {
|
|
|
415
416
|
);
|
|
416
417
|
try {
|
|
417
418
|
return h.pTableGetShape(this.table);
|
|
418
|
-
} catch (
|
|
419
|
+
} catch (e) {
|
|
419
420
|
throw new Error(
|
|
420
|
-
`PTable ${this.id} getShape request ${
|
|
421
|
-
${
|
|
421
|
+
`PTable ${this.id} getShape request ${t} failed, error:
|
|
422
|
+
${e.toString()}`
|
|
422
423
|
);
|
|
423
424
|
}
|
|
424
425
|
}
|
|
425
426
|
getSpec() {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
[`${this.frame.id}`, `${this.id}`, `${
|
|
427
|
+
const t = m();
|
|
428
|
+
i(
|
|
429
|
+
[`${this.frame.id}`, `${this.id}`, `${t}.json`],
|
|
429
430
|
{
|
|
430
431
|
timeStamp: Date.now(),
|
|
431
432
|
requestType: "getSpec"
|
|
@@ -434,158 +435,160 @@ ${t.toString()}`
|
|
|
434
435
|
);
|
|
435
436
|
try {
|
|
436
437
|
return h.pTableGetSpec(this.table);
|
|
437
|
-
} catch (
|
|
438
|
+
} catch (e) {
|
|
438
439
|
throw new Error(
|
|
439
|
-
`PTable ${this.id} getSpec request ${
|
|
440
|
-
${
|
|
440
|
+
`PTable ${this.id} getSpec request ${t} failed, error:
|
|
441
|
+
${e.toString()}`
|
|
441
442
|
);
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
|
-
getColumnIndices(
|
|
445
|
-
const
|
|
446
|
-
|
|
447
|
-
[`${this.frame.id}`, `${this.id}`, `${
|
|
445
|
+
getColumnIndices(t) {
|
|
446
|
+
const e = m();
|
|
447
|
+
i(
|
|
448
|
+
[`${this.frame.id}`, `${this.id}`, `${e}.json`],
|
|
448
449
|
{
|
|
449
450
|
timeStamp: Date.now(),
|
|
450
451
|
requestType: "getColumnIndices",
|
|
451
452
|
requestData: {
|
|
452
|
-
columnIds:
|
|
453
|
+
columnIds: t
|
|
453
454
|
}
|
|
454
455
|
},
|
|
455
456
|
this.frame.logger
|
|
456
457
|
);
|
|
457
458
|
try {
|
|
458
|
-
return h.pTableGetColumnIndices(this.table,
|
|
459
|
+
return h.pTableGetColumnIndices(this.table, t);
|
|
459
460
|
} catch (r) {
|
|
460
461
|
throw new Error(
|
|
461
|
-
`PTable ${this.id} getColumnIndices request ${
|
|
462
|
+
`PTable ${this.id} getColumnIndices request ${e} failed, columnIds: ${JSON.stringify(t)}, error:
|
|
462
463
|
${r.toString()}`
|
|
463
464
|
);
|
|
464
465
|
}
|
|
465
466
|
}
|
|
466
|
-
async getData(
|
|
467
|
+
async getData(t, e, r) {
|
|
467
468
|
var a, n;
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
[`${this.frame.id}`, `${this.id}`, `${
|
|
469
|
+
const o = m();
|
|
470
|
+
i(
|
|
471
|
+
[`${this.frame.id}`, `${this.id}`, `${o}.json`],
|
|
471
472
|
{
|
|
472
473
|
timeStamp: Date.now(),
|
|
473
474
|
requestType: "getData",
|
|
474
475
|
requestData: {
|
|
475
|
-
columnIndices:
|
|
476
|
-
range:
|
|
476
|
+
columnIndices: t,
|
|
477
|
+
range: e ?? null
|
|
477
478
|
}
|
|
478
479
|
},
|
|
479
480
|
this.frame.logger
|
|
480
481
|
);
|
|
481
|
-
const
|
|
482
|
+
const s = performance.now();
|
|
482
483
|
try {
|
|
483
|
-
return await h.pTableGetData(
|
|
484
|
+
return r == null || r.throwIfAborted(), await h.pTableGetData(
|
|
484
485
|
this.table,
|
|
485
|
-
|
|
486
|
-
e,
|
|
486
|
+
o,
|
|
487
487
|
t,
|
|
488
|
+
e,
|
|
488
489
|
r
|
|
489
490
|
);
|
|
490
|
-
} catch (
|
|
491
|
+
} catch (c) {
|
|
491
492
|
throw new Error(
|
|
492
|
-
`PTable ${this.id} getData request ${
|
|
493
|
-
${
|
|
493
|
+
`PTable ${this.id} getData request ${o} failed, columnIndices: ${JSON.stringify(t)}, range: ${e ? JSON.stringify(e) : void 0}, error:
|
|
494
|
+
${c.toString()}`
|
|
494
495
|
);
|
|
495
496
|
} finally {
|
|
496
|
-
const
|
|
497
|
+
const c = performance.now();
|
|
497
498
|
(n = (a = this.frame).logger) == null || n.call(
|
|
498
499
|
a,
|
|
499
500
|
"info",
|
|
500
|
-
`PTable ${this.id} getData request ${
|
|
501
|
+
`PTable ${this.id} getData request ${o} took ${Math.round(c - s)}ms`
|
|
501
502
|
);
|
|
502
503
|
}
|
|
503
504
|
}
|
|
504
|
-
async filter(
|
|
505
|
+
async filter(t, e) {
|
|
505
506
|
var a, n;
|
|
506
|
-
const r = m(),
|
|
507
|
+
const r = m(), o = {
|
|
507
508
|
timeStamp: Date.now(),
|
|
508
509
|
table: this.id,
|
|
509
510
|
requestType: "filter",
|
|
510
|
-
requestData:
|
|
511
|
+
requestData: t
|
|
511
512
|
};
|
|
512
|
-
|
|
513
|
+
i(
|
|
513
514
|
[`${this.frame.id}`, `${r}.json`],
|
|
514
|
-
|
|
515
|
+
o,
|
|
515
516
|
this.frame.logger
|
|
516
|
-
),
|
|
517
|
+
), i(
|
|
517
518
|
[`${this.frame.id}`, `${r}`, `${r}.json`],
|
|
518
|
-
|
|
519
|
+
o,
|
|
519
520
|
this.frame.logger
|
|
520
521
|
);
|
|
521
|
-
const
|
|
522
|
+
const s = performance.now();
|
|
522
523
|
try {
|
|
523
|
-
|
|
524
|
+
e == null || e.throwIfAborted();
|
|
525
|
+
const c = await h.pTableFilter(
|
|
524
526
|
this.table,
|
|
525
527
|
r,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
+
t,
|
|
529
|
+
e
|
|
528
530
|
);
|
|
529
|
-
return new
|
|
530
|
-
} catch (
|
|
531
|
+
return new $(this.frame, r, c);
|
|
532
|
+
} catch (c) {
|
|
531
533
|
throw new Error(
|
|
532
|
-
`PTable ${this.id} filter request ${r} failed, request: ${JSON.stringify(
|
|
533
|
-
${
|
|
534
|
+
`PTable ${this.id} filter request ${r} failed, request: ${JSON.stringify(t)}, error:
|
|
535
|
+
${c.toString()}`
|
|
534
536
|
);
|
|
535
537
|
} finally {
|
|
536
|
-
const
|
|
538
|
+
const c = performance.now();
|
|
537
539
|
(n = (a = this.frame).logger) == null || n.call(
|
|
538
540
|
a,
|
|
539
541
|
"info",
|
|
540
|
-
`PTable ${this.id} filter request ${r} took ${Math.round(
|
|
542
|
+
`PTable ${this.id} filter request ${r} took ${Math.round(c - s)}ms`
|
|
541
543
|
);
|
|
542
544
|
}
|
|
543
545
|
}
|
|
544
|
-
async sort(
|
|
546
|
+
async sort(t, e) {
|
|
545
547
|
var a, n;
|
|
546
|
-
const r = m(),
|
|
548
|
+
const r = m(), o = {
|
|
547
549
|
timeStamp: Date.now(),
|
|
548
550
|
table: this.id,
|
|
549
551
|
requestType: "sort",
|
|
550
|
-
requestData:
|
|
552
|
+
requestData: t
|
|
551
553
|
};
|
|
552
|
-
|
|
554
|
+
i(
|
|
553
555
|
[`${this.frame.id}`, `${r}.json`],
|
|
554
|
-
|
|
556
|
+
o,
|
|
555
557
|
this.frame.logger
|
|
556
|
-
),
|
|
558
|
+
), i(
|
|
557
559
|
[`${this.frame.id}`, `${r}`, `${r}.json`],
|
|
558
|
-
|
|
560
|
+
o,
|
|
559
561
|
this.frame.logger
|
|
560
562
|
);
|
|
561
|
-
const
|
|
563
|
+
const s = performance.now();
|
|
562
564
|
try {
|
|
563
|
-
|
|
565
|
+
e == null || e.throwIfAborted();
|
|
566
|
+
const c = await h.pTableSort(
|
|
564
567
|
this.table,
|
|
565
568
|
r,
|
|
566
|
-
|
|
567
|
-
|
|
569
|
+
t,
|
|
570
|
+
e
|
|
568
571
|
);
|
|
569
|
-
return new
|
|
570
|
-
} catch (
|
|
572
|
+
return new $(this.frame, r, c);
|
|
573
|
+
} catch (c) {
|
|
571
574
|
throw new Error(
|
|
572
|
-
`PTable ${this.id} sort request ${r} failed, request: ${JSON.stringify(
|
|
573
|
-
${
|
|
575
|
+
`PTable ${this.id} sort request ${r} failed, request: ${JSON.stringify(t)}, error:
|
|
576
|
+
${c.toString()}`
|
|
574
577
|
);
|
|
575
578
|
} finally {
|
|
576
|
-
const
|
|
579
|
+
const c = performance.now();
|
|
577
580
|
(n = (a = this.frame).logger) == null || n.call(
|
|
578
581
|
a,
|
|
579
582
|
"info",
|
|
580
|
-
`PTable ${this.id} sort request ${r} took ${Math.round(
|
|
583
|
+
`PTable ${this.id} sort request ${r} took ${Math.round(c - s)}ms`
|
|
581
584
|
);
|
|
582
585
|
}
|
|
583
586
|
}
|
|
584
587
|
dispose() {
|
|
585
|
-
var
|
|
586
|
-
const
|
|
587
|
-
|
|
588
|
-
[`${this.frame.id}`, `${this.id}`, `${
|
|
588
|
+
var e, r;
|
|
589
|
+
const t = m();
|
|
590
|
+
i(
|
|
591
|
+
[`${this.frame.id}`, `${this.id}`, `${t}.json`],
|
|
589
592
|
{
|
|
590
593
|
timeStamp: Date.now(),
|
|
591
594
|
requestType: "dispose"
|
|
@@ -593,11 +596,11 @@ ${l.toString()}`
|
|
|
593
596
|
this.frame.logger
|
|
594
597
|
);
|
|
595
598
|
try {
|
|
596
|
-
h.pTableDispose(this.table), (r = (
|
|
597
|
-
} catch (
|
|
599
|
+
h.pTableDispose(this.table), (r = (e = this.frame).logger) == null || r.call(e, "info", `PTable ${this.id} disposed`);
|
|
600
|
+
} catch (o) {
|
|
598
601
|
throw new Error(
|
|
599
|
-
`PTable ${this.id} dispose request ${
|
|
600
|
-
${
|
|
602
|
+
`PTable ${this.id} dispose request ${t} failed, error:
|
|
603
|
+
${o.toString()}`
|
|
601
604
|
);
|
|
602
605
|
}
|
|
603
606
|
}
|
|
@@ -605,7 +608,7 @@ ${s.toString()}`
|
|
|
605
608
|
this.dispose();
|
|
606
609
|
}
|
|
607
610
|
}
|
|
608
|
-
const _ =
|
|
611
|
+
const _ = J;
|
|
609
612
|
export {
|
|
610
613
|
_ as PFrame
|
|
611
614
|
};
|