@servicelabsco/nestjs-utility-services 1.1.11 → 1.1.12

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.
@@ -1,4 +1,5 @@
1
1
  import { EventQueueEntity } from '../entities/event.queue.entity';
2
2
  export declare class EventQueueService {
3
3
  getActiveEvents(): Promise<EventQueueEntity[]>;
4
+ setEvent(identifier: string, param: any, time: Date, options?: any): Promise<EventQueueEntity>;
4
5
  }
@@ -19,7 +19,9 @@ exports.EventQueueService = void 0;
19
19
  const common_1 = require("@nestjs/common");
20
20
  const typeorm_1 = require("typeorm");
21
21
  const date_util_1 = require("../../common/libraries/date.util");
22
+ const event_detail_entity_1 = require("../entities/event.detail.entity");
22
23
  const event_queue_entity_1 = require("../entities/event.queue.entity");
24
+ const class_transformer_1 = require("class-transformer");
23
25
  let EventQueueService = class EventQueueService {
24
26
  getActiveEvents() {
25
27
  return __awaiter(this, void 0, void 0, function* () {
@@ -37,6 +39,18 @@ let EventQueueService = class EventQueueService {
37
39
  });
38
40
  });
39
41
  }
42
+ setEvent(identifier, param, time, options) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const job = yield event_detail_entity_1.EventDetailEntity.findOne({ where: { identifier } });
45
+ const record = new event_queue_entity_1.EventQueueEntity();
46
+ record.event_id = job.id;
47
+ record.name = job.name;
48
+ record.parameter = param;
49
+ record.scheduled_start_time = time;
50
+ const r = (0, class_transformer_1.plainToClassFromExist)(record, options);
51
+ return r.save();
52
+ });
53
+ }
40
54
  };
41
55
  EventQueueService = __decorate([
42
56
  (0, common_1.Injectable)()
@@ -1 +1 @@
1
- {"version":3,"file":"event.queue.service.js","sourceRoot":"","sources":["../../../src/system/services/event.queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAA2C;AAC3C,gEAA4D;AAC5D,uEAAkE;AAQ3D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAMb,eAAe;;YACxB,MAAM,IAAI,GAAG,oBAAQ,CAAC,WAAW,EAAE,CAAC;YAEpC,OAAO,qCAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE;oBACH,oBAAoB,EAAE,IAAA,kBAAQ,EAAC,IAAI,CAAC;oBACpC,UAAU,EAAE,IAAA,gBAAM,GAAE;iBACvB;gBACD,SAAS,EAAE,CAAC,OAAO,CAAC;gBACpB,KAAK,EAAE;oBACH,oBAAoB,EAAE,KAAK;iBAC9B;gBACD,IAAI,EAAE,EAAE;aACX,CAAC,CAAC;QACP,CAAC;KAAA;CACJ,CAAA;AArBY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAqB7B;AArBY,8CAAiB"}
1
+ {"version":3,"file":"event.queue.service.js","sourceRoot":"","sources":["../../../src/system/services/event.queue.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAA2C;AAC3C,gEAA4D;AAC5D,yEAAoE;AACpE,uEAAkE;AAClE,yDAA0D;AAQnD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAMb,eAAe;;YACxB,MAAM,IAAI,GAAG,oBAAQ,CAAC,WAAW,EAAE,CAAC;YAEpC,OAAO,qCAAgB,CAAC,IAAI,CAAC;gBACzB,KAAK,EAAE;oBACH,oBAAoB,EAAE,IAAA,kBAAQ,EAAC,IAAI,CAAC;oBACpC,UAAU,EAAE,IAAA,gBAAM,GAAE;iBACvB;gBACD,SAAS,EAAE,CAAC,OAAO,CAAC;gBACpB,KAAK,EAAE;oBACH,oBAAoB,EAAE,KAAK;iBAC9B;gBACD,IAAI,EAAE,EAAE;aACX,CAAC,CAAC;QACP,CAAC;KAAA;IAWY,QAAQ,CAAC,UAAkB,EAAE,KAAU,EAAE,IAAU,EAAE,OAAa;;YAC3E,MAAM,GAAG,GAAG,MAAM,uCAAiB,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;YAEvE,MAAM,MAAM,GAAG,IAAI,qCAAgB,EAAE,CAAC;YACtC,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;YACvB,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;YAEzB,MAAM,CAAC,oBAAoB,GAAG,IAAI,CAAC;YAEnC,MAAM,CAAC,GAAG,IAAA,yCAAqB,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;KAAA;CACJ,CAAA;AA5CY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CA4C7B;AA5CY,8CAAiB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicelabsco/nestjs-utility-services",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "NestJS generic packages to support development",
5
5
  "author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
6
6
  "license": "MIT",