@punks/backend-entity-manager 0.0.371 → 0.0.374

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 {
@@ -40669,6 +40663,14 @@ const registerHandlebarsHelpers = () => {
40669
40663
  if (helpersRegistered) {
40670
40664
  return;
40671
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
+ });
40672
40674
  lib.registerHelper("uppercase", function (str) {
40673
40675
  return str.toUpperCase();
40674
40676
  });