@lana-commerce/core 14.0.0-alpha.6 → 14.0.0-alpha.8

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/CHANGELOG.md CHANGED
@@ -21,6 +21,7 @@ This project adheres to [Semantic Versioning][semantic versioning].
21
21
  - Add "webauthn" logic to "customer" module.
22
22
  - Add webauthn related fields to customer/shop fragments.
23
23
  - "Customer" module: now all signin forms share the custom error type. When custom error happens, it is set on all forms.
24
+ - Add "jobs" option to Mutator. Limits the number of simultaneously running jobs.
24
25
 
25
26
  ### Patch Changes
26
27
 
@@ -30,6 +31,7 @@ This project adheres to [Semantic Versioning][semantic versioning].
30
31
  - Do not discard unhandled messages in "websocket" lib.
31
32
  - Fix awaiters being dispatched before promise registeration in "websocket" lib.
32
33
  - Use `"verbatimModuleSyntax": true` when compiling ESM version of the package.
34
+ - Increase verbosity on pretty printed error text in "json" client (sendUnwrap() method).
33
35
 
34
36
  ## [Released]
35
37
 
@@ -276,7 +276,7 @@ class RequestBuilder {
276
276
  return resp.data;
277
277
  }
278
278
  else {
279
- throw new Error(prettyPrintResponseError(resp));
279
+ throw new Error(prettyPrintResponseError(resp, true));
280
280
  }
281
281
  });
282
282
  }
@@ -208,10 +208,11 @@ function batchProcessor(name, perBatch, groupBy, resolveItems) {
208
208
  }
209
209
  class StatsExecuteContext {
210
210
  constructor(name, opts, progressCallback) {
211
+ var _a;
211
212
  this.progressCallback = progressCallback;
212
213
  this.opts = opts;
213
214
  this.stats = { name, stats: new Map(), secondsElapsed: +new Date() };
214
- this.limit = new promiseLimit_js_1.PromiseLimiter(opts.sequential ? 1 : 20);
215
+ this.limit = new promiseLimit_js_1.PromiseLimiter(opts.sequential ? 1 : (_a = opts.jobs) !== null && _a !== void 0 ? _a : 20);
215
216
  }
216
217
  done() {
217
218
  this.stats.secondsElapsed = (+new Date() - this.stats.secondsElapsed) / 1000;
@@ -267,7 +267,7 @@ class RequestBuilder {
267
267
  return resp.data;
268
268
  }
269
269
  else {
270
- throw new Error(prettyPrintResponseError(resp));
270
+ throw new Error(prettyPrintResponseError(resp, true));
271
271
  }
272
272
  }
273
273
  }
@@ -209,7 +209,7 @@ class StatsExecuteContext {
209
209
  this.progressCallback = progressCallback;
210
210
  this.opts = opts;
211
211
  this.stats = { name, stats: new Map(), secondsElapsed: +new Date() };
212
- this.limit = new PromiseLimiter(opts.sequential ? 1 : 20);
212
+ this.limit = new PromiseLimiter(opts.sequential ? 1 : opts.jobs ?? 20);
213
213
  }
214
214
  done() {
215
215
  this.stats.secondsElapsed = (+new Date() - this.stats.secondsElapsed) / 1000;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lana-commerce/core",
3
- "version": "14.0.0-alpha.6",
3
+ "version": "14.0.0-alpha.8",
4
4
  "description": "Lana JS Core",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -87,6 +87,8 @@ export interface ExecutionResult {
87
87
  export interface MutatorOptions {
88
88
  /** Run everything as sequentially as possible. */
89
89
  sequential?: boolean;
90
+ /** When running things in parallel, override the limit of simultaneously running jobs. */
91
+ jobs?: number;
90
92
  }
91
93
  export declare class Mutator {
92
94
  private batches;