@milaboratories/pframes-rs-node 1.0.51 → 1.0.53

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