@stemy/backend 3.0.0 → 3.0.1

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.
@@ -1081,6 +1081,7 @@
1081
1081
  ConsoleColor["FgMagenta"] = "\u001B[35m";
1082
1082
  ConsoleColor["FgCyan"] = "\u001B[36m";
1083
1083
  ConsoleColor["FgWhite"] = "\u001B[37m";
1084
+ ConsoleColor["FgDefault"] = "\u001B[38m";
1084
1085
  ConsoleColor["BgBlack"] = "\u001B[40m";
1085
1086
  ConsoleColor["BgRed"] = "\u001B[41m";
1086
1087
  ConsoleColor["BgGreen"] = "\u001B[42m";
@@ -1089,11 +1090,12 @@
1089
1090
  ConsoleColor["BgMagenta"] = "\u001B[45m";
1090
1091
  ConsoleColor["BgCyan"] = "\u001B[46m";
1091
1092
  ConsoleColor["BgWhite"] = "\u001B[47m";
1093
+ ConsoleColor["BgDefault"] = "\u001B[48m";
1092
1094
  })(exports.ConsoleColor || (exports.ConsoleColor = {}));
1093
1095
  var defaultColors = {
1094
- keyColor: exports.ConsoleColor.Dim,
1096
+ keyColor: exports.ConsoleColor.FgWhite,
1095
1097
  numberColor: exports.ConsoleColor.FgBlue,
1096
- stringColor: exports.ConsoleColor.FgCyan,
1098
+ stringColor: exports.ConsoleColor.FgYellow,
1097
1099
  trueColor: exports.ConsoleColor.FgGreen,
1098
1100
  falseColor: exports.ConsoleColor.FgRed,
1099
1101
  nullColor: exports.ConsoleColor.BgMagenta
@@ -2271,7 +2273,7 @@
2271
2273
  _this.progresses.get(_this.progressId).then(function (p) {
2272
2274
  p === null || p === void 0 ? void 0 : p.cancel();
2273
2275
  });
2274
- _this.startWorkingOnAsset().then(function () {
2276
+ _this.startWorkingOnAsset(false).then(function () {
2275
2277
  console.log("Started working on lazy asset: " + _this.id);
2276
2278
  }).catch(function (reason) {
2277
2279
  console.log("Can't start working on lazy asset: " + _this.id + "\nReason: " + reason);
@@ -2295,7 +2297,7 @@
2295
2297
  case 2:
2296
2298
  _a.sent();
2297
2299
  return [2 /*return*/, this.loadAsset()];
2298
- case 3: return [4 /*yield*/, this.startWorkingOnAsset()];
2300
+ case 3: return [4 /*yield*/, this.startWorkingOnAsset(true)];
2299
2301
  case 4:
2300
2302
  _a.sent();
2301
2303
  return [2 /*return*/, this.loadAsset()];
@@ -2317,7 +2319,7 @@
2317
2319
  });
2318
2320
  });
2319
2321
  };
2320
- LazyAsset.prototype.startWorkingOnAsset = function () {
2322
+ LazyAsset.prototype.startWorkingOnAsset = function (fromLoad) {
2321
2323
  return __awaiter$p(this, void 0, void 0, function () {
2322
2324
  var _a;
2323
2325
  return __generator(this, function (_b) {
@@ -2331,7 +2333,7 @@
2331
2333
  return [4 /*yield*/, this.save()];
2332
2334
  case 2:
2333
2335
  _b.sent();
2334
- return [4 /*yield*/, this.jobMan.enqueueWithName(this.data.jobName, Object.assign(Object.assign({}, this.data.jobParams), { lazyId: this.id }))];
2336
+ return [4 /*yield*/, this.jobMan.enqueueWithName(this.data.jobName, Object.assign(Object.assign({}, this.data.jobParams), { lazyId: this.id, fromLoad: fromLoad }))];
2335
2337
  case 3:
2336
2338
  _b.sent();
2337
2339
  return [2 /*return*/];
@@ -2492,20 +2494,20 @@
2492
2494
  jobParams = JSON.parse(args.toString("utf8"));
2493
2495
  timerId = uniqueId === null || uniqueId === void 0 ? void 0 : uniqueId.toString("utf8");
2494
2496
  jobNameLog = "\u001B[36m\"" + jobName + "\"\u001B[0m";
2495
- jobArgsLog = "\n" + jsonHighlight(jobParams) + "\n";
2497
+ jobArgsLog = "\n" + jsonHighlight(jobParams);
2496
2498
  console.time(timerId);
2497
- console.timeLog(timerId, "Started working on background job: " + jobNameLog + " with args: " + jobArgsLog);
2499
+ console.timeLog(timerId, "Started working on background job: " + jobNameLog + " with args: " + jobArgsLog + "\n\n");
2498
2500
  _a.label = 1;
2499
2501
  case 1:
2500
2502
  _a.trys.push([1, 3, , 4]);
2501
2503
  return [4 /*yield*/, Promise.race([this.jobs[jobName](jobParams), promiseTimeout(15000, true)])];
2502
2504
  case 2:
2503
2505
  _a.sent();
2504
- console.timeLog(timerId, "Finished working on background job: " + jobNameLog + " with args: " + jobArgsLog);
2506
+ console.timeLog(timerId, "Finished working on background job: " + jobNameLog + "\n\n");
2505
2507
  return [3 /*break*/, 4];
2506
2508
  case 3:
2507
2509
  e_1 = _a.sent();
2508
- console.timeLog(timerId, "Background job failed: " + jobNameLog + " with args: " + jobArgsLog + e_1.message + "\n\n");
2510
+ console.timeLog(timerId, "Background job failed: " + jobNameLog + "\n" + e_1.message + "\n\n");
2509
2511
  return [3 /*break*/, 4];
2510
2512
  case 4:
2511
2513
  console.timeEnd(timerId);