@punks/backend-entity-manager 0.0.370 → 0.0.373

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/cjs/index.js CHANGED
@@ -34807,12 +34807,6 @@ const getCronCurrentSchedule = (cronExpression, ref) => {
34807
34807
  return interval.prev().toDate();
34808
34808
  };
34809
34809
 
34810
- function floorDateToSecond(date) {
34811
- const flooredDate = new Date(date);
34812
- flooredDate.setMilliseconds(0);
34813
- return flooredDate;
34814
- }
34815
-
34816
34810
  var TaskShell_1;
34817
34811
  let TaskShell = TaskShell_1 = class TaskShell {
34818
34812
  constructor(registry, operations) {
@@ -34846,7 +34840,7 @@ let TaskShell = TaskShell_1 = class TaskShell {
34846
34840
  }
34847
34841
  }
34848
34842
  getTaskLockKey(settings, cronSchedule) {
34849
- return `task:${settings.name}:${cronSchedule ? floorDateToSecond(cronSchedule).toISOString() : backendCore.newUuid()}`;
34843
+ return `task:${settings.name}:${cronSchedule ? backendCore.floorDateToSecond(cronSchedule).toISOString() : backendCore.newUuid()}`;
34850
34844
  }
34851
34845
  async invokeTask(instance, settings, runType) {
34852
34846
  try {
@@ -34928,6 +34922,9 @@ let TasksRegistry = class TasksRegistry {
34928
34922
  }
34929
34923
  return task;
34930
34924
  }
34925
+ getTasks() {
34926
+ return Array.from(this.tasks.values());
34927
+ }
34931
34928
  };
34932
34929
  TasksRegistry = __decorate([
34933
34930
  common.Injectable()
@@ -34999,6 +34996,9 @@ exports.TasksService = TasksService_1 = class TasksService {
34999
34996
  await this.jobShell.executeTask(task.instance, task.props, exports.TaskRunType.OnDemand);
35000
34997
  this.logger.log(`Manual task ${name} -> completed`);
35001
34998
  }
34999
+ async getTasks() {
35000
+ return this.registry.getTasks();
35001
+ }
35002
35002
  };
35003
35003
  exports.TasksService = TasksService_1 = __decorate([
35004
35004
  common.Injectable(),
@@ -40663,6 +40663,14 @@ const registerHandlebarsHelpers = () => {
40663
40663
  if (helpersRegistered) {
40664
40664
  return;
40665
40665
  }
40666
+ lib.registerHelper("truncate", function (text, maxChars) {
40667
+ if (text.length > maxChars) {
40668
+ return text.substring(0, maxChars) + "...";
40669
+ }
40670
+ else {
40671
+ return text;
40672
+ }
40673
+ });
40666
40674
  lib.registerHelper("uppercase", function (str) {
40667
40675
  return str.toUpperCase();
40668
40676
  });