@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.
@@ -6,6 +6,7 @@ export declare enum TaskConcurrency {
6
6
  export type TaskSettings = {
7
7
  cronExpression?: string;
8
8
  concurrency: TaskConcurrency;
9
+ description?: string;
9
10
  };
10
11
  export type TaskProps = TaskSettings & {
11
12
  name: string;
@@ -7,4 +7,8 @@ export declare class TasksRegistry {
7
7
  props: TaskProps;
8
8
  instance: ITask;
9
9
  };
10
+ getTasks(): {
11
+ props: TaskProps;
12
+ instance: ITask;
13
+ }[];
10
14
  }
@@ -7,4 +7,8 @@ export declare class TasksService {
7
7
  constructor(jobShell: TaskShell, registry: TasksRegistry);
8
8
  triggerTask(name: string): Promise<void>;
9
9
  invokeTask(name: string): Promise<void>;
10
+ getTasks(): Promise<{
11
+ props: import("../../../../decorators/tasks").TaskProps;
12
+ instance: import("../../../../../../abstractions").ITask;
13
+ }[]>;
10
14
  }
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Log, csvParse, excelParse, ExcelKeyTransform, excelBuild, csvBuild, mapAsync, isNullOrUndefined, addTime, newUuid as newUuid$1, buildObject, toDict, sleep, sort, byField, toArrayDict, toItemsDict, ensureTailingSlash, ensureStartSlash, removeUndefinedProps } from '@punks/backend-core';
1
+ import { Log, csvParse, excelParse, ExcelKeyTransform, excelBuild, csvBuild, mapAsync, isNullOrUndefined, addTime, newUuid as newUuid$1, buildObject, toDict, sleep, sort, byField, toArrayDict, toItemsDict, floorDateToSecond, ensureTailingSlash, ensureStartSlash, removeUndefinedProps } from '@punks/backend-core';
2
2
  import { QueryCommand, ScanCommand, GetItemCommand, PutItemCommand, DeleteItemCommand, DynamoDBClient } from '@aws-sdk/client-dynamodb';
3
3
  import { unmarshall, marshall } from '@aws-sdk/util-dynamodb';
4
4
  import { Module, applyDecorators, Injectable, SetMetadata, createParamDecorator, Global, Scope, Inject, Logger, StreamableFile, HttpException, HttpStatus } from '@nestjs/common';
@@ -34792,12 +34792,6 @@ const getCronCurrentSchedule = (cronExpression, ref) => {
34792
34792
  return interval.prev().toDate();
34793
34793
  };
34794
34794
 
34795
- function floorDateToSecond(date) {
34796
- const flooredDate = new Date(date);
34797
- flooredDate.setMilliseconds(0);
34798
- return flooredDate;
34799
- }
34800
-
34801
34795
  var TaskShell_1;
34802
34796
  let TaskShell = TaskShell_1 = class TaskShell {
34803
34797
  constructor(registry, operations) {
@@ -34913,6 +34907,9 @@ let TasksRegistry = class TasksRegistry {
34913
34907
  }
34914
34908
  return task;
34915
34909
  }
34910
+ getTasks() {
34911
+ return Array.from(this.tasks.values());
34912
+ }
34916
34913
  };
34917
34914
  TasksRegistry = __decorate([
34918
34915
  Injectable()
@@ -34984,6 +34981,9 @@ let TasksService = TasksService_1 = class TasksService {
34984
34981
  await this.jobShell.executeTask(task.instance, task.props, TaskRunType.OnDemand);
34985
34982
  this.logger.log(`Manual task ${name} -> completed`);
34986
34983
  }
34984
+ async getTasks() {
34985
+ return this.registry.getTasks();
34986
+ }
34987
34987
  };
34988
34988
  TasksService = TasksService_1 = __decorate([
34989
34989
  Injectable(),
@@ -40648,6 +40648,14 @@ const registerHandlebarsHelpers = () => {
40648
40648
  if (helpersRegistered) {
40649
40649
  return;
40650
40650
  }
40651
+ lib.registerHelper("truncate", function (text, maxChars) {
40652
+ if (text.length > maxChars) {
40653
+ return text.substring(0, maxChars) + "...";
40654
+ }
40655
+ else {
40656
+ return text;
40657
+ }
40658
+ });
40651
40659
  lib.registerHelper("uppercase", function (str) {
40652
40660
  return str.toUpperCase();
40653
40661
  });