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