@milaboratories/pframes-rs-node 1.0.40 → 1.0.41

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