@milaboratories/pl-middle-layer 1.37.7 → 1.37.9

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/dist/index.mjs CHANGED
@@ -5025,16 +5025,19 @@ class nr {
5025
5025
  de().logPFrameRequests && t.info(
5026
5026
  `PTable creation (pTableHandle = ${this.calculateParamsKey(i)}): ${JSON.stringify(i, Te)}`
5027
5027
  );
5028
- const a = n.run(async () => await this.pFrames.getByKey(c).pFrame.createTable({
5029
- src: je(i.def.src),
5030
- filters: Ot(i.def.filters)
5031
- }, i.signal)).then(async (l) => {
5032
- if (i.def.sorting.length === 0) return l;
5033
- try {
5034
- return n.run(async () => await l.sort(i.def.sorting, i.signal));
5035
- } finally {
5036
- l.dispose();
5037
- }
5028
+ const a = n.run(async () => {
5029
+ const l = await this.pFrames.getByKey(c).pFrame.createTable({
5030
+ src: je(i.def.src),
5031
+ filters: Ot(i.def.filters)
5032
+ }, i.signal);
5033
+ let u = l;
5034
+ if (i.def.sorting.length > 0)
5035
+ try {
5036
+ u = await l.sort(i.def.sorting, i.signal);
5037
+ } finally {
5038
+ l.dispose();
5039
+ }
5040
+ return u;
5038
5041
  });
5039
5042
  return new ru(a);
5040
5043
  }
@@ -5099,25 +5102,26 @@ class nr {
5099
5102
  async calculateTableData(e, t, r) {
5100
5103
  return de().logPFrameRequests && this.logger.info(
5101
5104
  `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Te)}`
5102
- ), await this.concurrencyLimiter.run(async () => await this.pFrames.getByKey(e).pFrame.createTable({
5103
- src: je(t.src),
5104
- filters: Ot(t.filters)
5105
- }, r)).then(async (o) => {
5106
- if (t.sorting.length === 0) return o;
5107
- try {
5108
- return await this.concurrencyLimiter.run(async () => await o.sort(t.sorting, r));
5109
- } finally {
5110
- o.dispose();
5111
- }
5112
- }).then(async (o) => {
5105
+ ), await this.concurrencyLimiter.run(async () => {
5106
+ const o = await this.pFrames.getByKey(e).pFrame.createTable({
5107
+ src: je(t.src),
5108
+ filters: Ot(t.filters)
5109
+ }, r);
5110
+ let n = o;
5111
+ if (t.sorting.length > 0)
5112
+ try {
5113
+ n = await o.sort(t.sorting, r);
5114
+ } finally {
5115
+ o.dispose();
5116
+ }
5113
5117
  try {
5114
- const n = o.getSpec(), i = await this.concurrencyLimiter.run(async () => await o.getData([...n.keys()], void 0, r));
5115
- return n.map((c, a) => ({
5116
- spec: c,
5117
- data: i[a]
5118
+ const i = n.getSpec(), c = await n.getData([...i.keys()], void 0, r);
5119
+ return i.map((a, l) => ({
5120
+ spec: a,
5121
+ data: c[l]
5118
5122
  }));
5119
5123
  } finally {
5120
- o.dispose();
5124
+ n.dispose();
5121
5125
  }
5122
5126
  });
5123
5127
  }