@servicelabsco/nestjs-utility-services 1.1.55 → 1.1.56

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,15 +1,10 @@
1
- /// <reference types="passport" />
1
+ import { Request } from 'express';
2
2
  import { AuthService } from '../services/auth.service';
3
3
  import { SocialService } from '../services/social.service';
4
- import { Request } from 'express';
5
4
  export declare class SocialController {
6
5
  private readonly authService;
7
6
  private readonly socialService;
8
7
  constructor(authService: AuthService, socialService: SocialService);
9
- socialGoogleLogin(): import("..").UserAccessDto;
10
- socialGoogleCallback(req: Request): Express.User;
11
- socialFbLogin(): import("..").UserAccessDto;
12
- socialFbCallback(req: Request): Express.User;
13
8
  fbLogin(req: Request, accessToken: string): Promise<any>;
14
9
  googleLogin(req: Request, accessToken: string): Promise<any>;
15
10
  }
@@ -14,8 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.SocialController = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
- const passport_1 = require("@nestjs/passport");
18
- const auth_1 = require("../../common/libraries/auth");
19
17
  const auth_service_1 = require("../services/auth.service");
20
18
  const social_service_1 = require("../services/social.service");
21
19
  let SocialController = class SocialController {
@@ -23,18 +21,6 @@ let SocialController = class SocialController {
23
21
  this.authService = authService;
24
22
  this.socialService = socialService;
25
23
  }
26
- socialGoogleLogin() {
27
- return auth_1.Auth.user();
28
- }
29
- socialGoogleCallback(req) {
30
- return req.user;
31
- }
32
- socialFbLogin() {
33
- return auth_1.Auth.user();
34
- }
35
- socialFbCallback(req) {
36
- return req.user;
37
- }
38
24
  async fbLogin(req, accessToken) {
39
25
  const user = await this.socialService.fbLogin(accessToken);
40
26
  if (!user)
@@ -45,36 +31,6 @@ let SocialController = class SocialController {
45
31
  return this.socialService.googleLogin(accessToken);
46
32
  }
47
33
  };
48
- __decorate([
49
- (0, common_1.UseGuards)((0, passport_1.AuthGuard)('google')),
50
- (0, common_1.Get)('google'),
51
- __metadata("design:type", Function),
52
- __metadata("design:paramtypes", []),
53
- __metadata("design:returntype", void 0)
54
- ], SocialController.prototype, "socialGoogleLogin", null);
55
- __decorate([
56
- (0, common_1.UseGuards)((0, passport_1.AuthGuard)('google')),
57
- (0, common_1.Get)('google/callback'),
58
- __param(0, (0, common_1.Req)()),
59
- __metadata("design:type", Function),
60
- __metadata("design:paramtypes", [Object]),
61
- __metadata("design:returntype", void 0)
62
- ], SocialController.prototype, "socialGoogleCallback", null);
63
- __decorate([
64
- (0, common_1.UseGuards)((0, passport_1.AuthGuard)('facebook')),
65
- (0, common_1.Get)('fb'),
66
- __metadata("design:type", Function),
67
- __metadata("design:paramtypes", []),
68
- __metadata("design:returntype", void 0)
69
- ], SocialController.prototype, "socialFbLogin", null);
70
- __decorate([
71
- (0, common_1.UseGuards)((0, passport_1.AuthGuard)('facebook')),
72
- (0, common_1.Get)('fb/callback'),
73
- __param(0, (0, common_1.Req)()),
74
- __metadata("design:type", Function),
75
- __metadata("design:paramtypes", [Object]),
76
- __metadata("design:returntype", void 0)
77
- ], SocialController.prototype, "socialFbCallback", null);
78
34
  __decorate([
79
35
  (0, common_1.Post)('fb'),
80
36
  __param(0, (0, common_1.Req)()),
@@ -1 +1 @@
1
- {"version":3,"file":"social.controller.js","sourceRoot":"","sources":["../../../src/auth/controllers/social.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAoG;AACpG,+CAA6C;AAC7C,sDAAmD;AACnD,2DAAuD;AACvD,+DAA2D;AAIpD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAOzB,YAA6B,WAAwB,EAAmB,aAA4B;QAAvE,gBAAW,GAAX,WAAW,CAAa;QAAmB,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAIxG,iBAAiB;QACb,OAAO,WAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAID,oBAAoB,CAAQ,GAAY;QACpC,OAA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IAAA,aAAI,EAAC,QAAQ,CAAC;IACI,WAAA,IAAA,YAAG,GAAE,CAAA;IAAgB,WAAA,IAAA,aAAI,EAAC,cAAc,CAAC,CAAA;;;;mDAE3D;AApBQ,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,QAAQ,CAAC;qCAQyB,0BAAW,EAAkC,8BAAa;GAP3F,gBAAgB,CAqB5B;AArBY,4CAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"test.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/test.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oEAAgE;AAChE,+DAA2D;AAIpD,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,sBAAS;IAGlC,YAA+B,YAA0B;QACrD,KAAK,EAAE,CAAC;QADmB,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAS;IAEtB,CAAC;CACJ,CAAA;AAVY,OAAO;IADnB,IAAA,mBAAU,GAAE;qCAIoC,4BAAY;GAHhD,OAAO,CAUnB;AAVY,0BAAO"}
1
+ {"version":3,"file":"test.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/test.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oEAAgE;AAChE,+DAA2D;AAGpD,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,sBAAS;IAGlC,YAA+B,YAA0B;QACrD,KAAK,EAAE,CAAC;QADmB,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAS;IAEtB,CAAC;CACJ,CAAA;AAVY,OAAO;IADnB,IAAA,mBAAU,GAAE;qCAIoC,4BAAY;GAHhD,OAAO,CAUnB;AAVY,0BAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicelabsco/nestjs-utility-services",
3
- "version": "1.1.55",
3
+ "version": "1.1.56",
4
4
  "description": "NestJS generic packages to support development",
5
5
  "author": "Hemant Kumar Sah <hemantanshu@gmail.com>",
6
6
  "license": "MIT",
@@ -1,7 +0,0 @@
1
- import { CommonJob, DatabaseEventDto, QueueService } from '@servicelabsco/nestjs-utility-services';
2
- import { FailedBullJobEntity } from '../entities/failed.bull.job.entity';
3
- export declare class FailedBullJobJob extends CommonJob {
4
- protected readonly queueService: QueueService;
5
- constructor(queueService: QueueService);
6
- handle(evt: DatabaseEventDto<FailedBullJobEntity>): Promise<void>;
7
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.FailedBullJobJob = void 0;
14
- const common_1 = require("@nestjs/common");
15
- const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
16
- let FailedBullJobJob = class FailedBullJobJob extends nestjs_utility_services_1.CommonJob {
17
- constructor(queueService) {
18
- super();
19
- this.queueService = queueService;
20
- }
21
- async handle(evt) {
22
- }
23
- };
24
- FailedBullJobJob = __decorate([
25
- (0, common_1.Injectable)(),
26
- __metadata("design:paramtypes", [typeof (_a = typeof nestjs_utility_services_1.QueueService !== "undefined" && nestjs_utility_services_1.QueueService) === "function" ? _a : Object])
27
- ], FailedBullJobJob);
28
- exports.FailedBullJobJob = FailedBullJobJob;
29
- //# sourceMappingURL=failed.bull.job.job.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failed.bull.job.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/failed.bull.job.job.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAmG;AAG5F,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,mCAAS;IAC3C,YACuB,YAA0B;QAE7C,KAAK,EAAE,CAAC;QAFW,iBAAY,GAAZ,YAAY,CAAc;IAGjD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAA0C;IACvD,CAAC;CACJ,CAAA;AARY,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;yDAG4B,sCAAY,oBAAZ,sCAAY;GAFxC,gBAAgB,CAQ5B;AARY,4CAAgB"}
@@ -1,7 +0,0 @@
1
- import { CommonJob, DatabaseEventDto, QueueService } from '@servicelabsco/nestjs-utility-services';
2
- import { PendingBullJobEntity } from '../entities/pending.bull.job.entity';
3
- export declare class PendingBullJobJob extends CommonJob {
4
- protected readonly queueService: QueueService;
5
- constructor(queueService: QueueService);
6
- handle(evt: DatabaseEventDto<PendingBullJobEntity>): Promise<void>;
7
- }
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.PendingBullJobJob = void 0;
14
- const common_1 = require("@nestjs/common");
15
- const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
16
- let PendingBullJobJob = class PendingBullJobJob extends nestjs_utility_services_1.CommonJob {
17
- constructor(queueService) {
18
- super();
19
- this.queueService = queueService;
20
- }
21
- async handle(evt) {
22
- }
23
- };
24
- PendingBullJobJob = __decorate([
25
- (0, common_1.Injectable)(),
26
- __metadata("design:paramtypes", [typeof (_a = typeof nestjs_utility_services_1.QueueService !== "undefined" && nestjs_utility_services_1.QueueService) === "function" ? _a : Object])
27
- ], PendingBullJobJob);
28
- exports.PendingBullJobJob = PendingBullJobJob;
29
- //# sourceMappingURL=pending.bull.job.job.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending.bull.job.job.js","sourceRoot":"","sources":["../../../src/platformUtility/jobs/pending.bull.job.job.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,oFAAmG;AAG5F,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mCAAS;IAC5C,YACuB,YAA0B;QAE7C,KAAK,EAAE,CAAC;QAFW,iBAAY,GAAZ,YAAY,CAAc;IAGjD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAA2C;IACxD,CAAC;CACJ,CAAA;AARY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;yDAG4B,sCAAY,oBAAZ,sCAAY;GAFxC,iBAAiB,CAQ7B;AARY,8CAAiB"}
@@ -1,12 +0,0 @@
1
- import { CommonSubscriber } from '@servicelabsco/nestjs-utility-services';
2
- import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
3
- import { FailedBullJobEntity } from '../entities/failed.bull.job.entity';
4
- import { FailedBullJobJob } from '../jobs/failed.bull.job.job';
5
- export declare class FailedBullJobSubscriber extends CommonSubscriber<FailedBullJobEntity> {
6
- private readonly dataSource;
7
- private readonly failedBullJobJob;
8
- constructor(dataSource: DataSource, failedBullJobJob: FailedBullJobJob);
9
- listenTo(): typeof FailedBullJobEntity;
10
- afterInsert(event: InsertEvent<FailedBullJobEntity>): Promise<void>;
11
- afterUpdate(event: UpdateEvent<FailedBullJobEntity>): Promise<void>;
12
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.FailedBullJobSubscriber = void 0;
14
- const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
15
- const typeorm_1 = require("typeorm");
16
- const failed_bull_job_entity_1 = require("../entities/failed.bull.job.entity");
17
- const failed_bull_job_job_1 = require("../jobs/failed.bull.job.job");
18
- let FailedBullJobSubscriber = class FailedBullJobSubscriber extends nestjs_utility_services_1.CommonSubscriber {
19
- constructor(dataSource, failedBullJobJob) {
20
- super();
21
- this.dataSource = dataSource;
22
- this.failedBullJobJob = failedBullJobJob;
23
- dataSource.subscribers.push(this);
24
- }
25
- listenTo() {
26
- return failed_bull_job_entity_1.FailedBullJobEntity;
27
- }
28
- async afterInsert(event) {
29
- await this.failedBullJobJob.delayedDispatch(this.getEventData(event));
30
- }
31
- async afterUpdate(event) {
32
- await this.failedBullJobJob.delayedDispatch(this.getEventData(event));
33
- }
34
- };
35
- FailedBullJobSubscriber = __decorate([
36
- (0, typeorm_1.EventSubscriber)(),
37
- __metadata("design:paramtypes", [typeorm_1.DataSource, typeof (_a = typeof failed_bull_job_job_1.FailedBullJobJob !== "undefined" && failed_bull_job_job_1.FailedBullJobJob) === "function" ? _a : Object])
38
- ], FailedBullJobSubscriber);
39
- exports.FailedBullJobSubscriber = FailedBullJobSubscriber;
40
- //# sourceMappingURL=failed.bull.job.subscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"failed.bull.job.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/failed.bull.job.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oFAA0E;AAC1E,qCAAgF;AAChF,+EAAyE;AACzE,qEAA+D;AAExD,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,0CAAqC;IAC9E,YAA6B,UAAsB,EAAmB,gBAAkC;QACpG,KAAK,EAAE,CAAC;QADiB,eAAU,GAAV,UAAU,CAAY;QAAmB,qBAAgB,GAAhB,gBAAgB,CAAkB;QAEpG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ;QACJ,OAAO,4CAAmB,CAAC;IAC/B,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,KAAuC;QACrD,MAAM,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAuC;QACrD,MAAM,IAAI,CAAC,gBAAgB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1E,CAAC;CACJ,CAAA;AAfY,uBAAuB;IADnC,IAAA,yBAAe,GAAE;qCAE2B,oBAAU,sBAAqC,sCAAgB,oBAAhB,sCAAgB;GAD/F,uBAAuB,CAenC;AAfY,0DAAuB"}
@@ -1,12 +0,0 @@
1
- import { CommonSubscriber } from '@servicelabsco/nestjs-utility-services';
2
- import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
3
- import { PendingBullJobEntity } from '../entities/pending.bull.job.entity';
4
- import { PendingBullJobJob } from '../jobs/pending.bull.job.job';
5
- export declare class PendingBullJobSubscriber extends CommonSubscriber<PendingBullJobEntity> {
6
- private readonly dataSource;
7
- private readonly pendingBullJobJob;
8
- constructor(dataSource: DataSource, pendingBullJobJob: PendingBullJobJob);
9
- listenTo(): typeof PendingBullJobEntity;
10
- afterInsert(event: InsertEvent<PendingBullJobEntity>): Promise<void>;
11
- afterUpdate(event: UpdateEvent<PendingBullJobEntity>): Promise<void>;
12
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var _a;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.PendingBullJobSubscriber = void 0;
14
- const nestjs_utility_services_1 = require("@servicelabsco/nestjs-utility-services");
15
- const typeorm_1 = require("typeorm");
16
- const pending_bull_job_entity_1 = require("../entities/pending.bull.job.entity");
17
- const pending_bull_job_job_1 = require("../jobs/pending.bull.job.job");
18
- let PendingBullJobSubscriber = class PendingBullJobSubscriber extends nestjs_utility_services_1.CommonSubscriber {
19
- constructor(dataSource, pendingBullJobJob) {
20
- super();
21
- this.dataSource = dataSource;
22
- this.pendingBullJobJob = pendingBullJobJob;
23
- dataSource.subscribers.push(this);
24
- }
25
- listenTo() {
26
- return pending_bull_job_entity_1.PendingBullJobEntity;
27
- }
28
- async afterInsert(event) {
29
- await this.pendingBullJobJob.delayedDispatch(this.getEventData(event));
30
- }
31
- async afterUpdate(event) {
32
- await this.pendingBullJobJob.delayedDispatch(this.getEventData(event));
33
- }
34
- };
35
- PendingBullJobSubscriber = __decorate([
36
- (0, typeorm_1.EventSubscriber)(),
37
- __metadata("design:paramtypes", [typeorm_1.DataSource, typeof (_a = typeof pending_bull_job_job_1.PendingBullJobJob !== "undefined" && pending_bull_job_job_1.PendingBullJobJob) === "function" ? _a : Object])
38
- ], PendingBullJobSubscriber);
39
- exports.PendingBullJobSubscriber = PendingBullJobSubscriber;
40
- //# sourceMappingURL=pending.bull.job.subscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pending.bull.job.subscriber.js","sourceRoot":"","sources":["../../../src/platformUtility/subscribers/pending.bull.job.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oFAA0E;AAC1E,qCAAgF;AAChF,iFAA2E;AAC3E,uEAAiE;AAE1D,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,0CAAsC;IAChF,YAA6B,UAAsB,EAAmB,iBAAoC;QACtG,KAAK,EAAE,CAAC;QADiB,eAAU,GAAV,UAAU,CAAY;QAAmB,sBAAiB,GAAjB,iBAAiB,CAAmB;QAEtG,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ;QACJ,OAAO,8CAAoB,CAAC;IAChC,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,KAAwC;QACtD,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAwC;QACtD,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AAfY,wBAAwB;IADpC,IAAA,yBAAe,GAAE;qCAE2B,oBAAU,sBAAsC,wCAAiB,oBAAjB,wCAAiB;GADjG,wBAAwB,CAepC;AAfY,4DAAwB"}
@@ -1,16 +0,0 @@
1
- import { JobRecordParamDto } from '../dtos/job.record.param.dto';
2
- import { QueueService } from './../../platformUtility/services/queue.service';
3
- export declare class JobController {
4
- private readonly queueService;
5
- constructor(queueService: QueueService);
6
- getWorkers(): Promise<any[]>;
7
- getQueueStats(): Promise<any[]>;
8
- getWaitingJobs(param: JobRecordParamDto): Promise<any[]>;
9
- getDelayedJobs(param: JobRecordParamDto): Promise<any[]>;
10
- getActiveJobs(param: JobRecordParamDto): Promise<any[]>;
11
- getCompletedJobs(param: JobRecordParamDto): Promise<any[]>;
12
- getFailedJobs(param: JobRecordParamDto): Promise<any[]>;
13
- getJobInfo(id: number): Promise<import("bull").Job<any>>;
14
- retryJob(id: number): Promise<import("bull").Job<any>>;
15
- removeJob(id: number): Promise<void>;
16
- }
@@ -1,137 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.JobController = void 0;
16
- const common_1 = require("@nestjs/common");
17
- const job_record_param_dto_1 = require("../dtos/job.record.param.dto");
18
- const queue_service_1 = require("./../../platformUtility/services/queue.service");
19
- let JobController = class JobController {
20
- constructor(queueService) {
21
- this.queueService = queueService;
22
- }
23
- getWorkers() {
24
- return this.queueService.getWorkers();
25
- }
26
- getQueueStats() {
27
- return this.queueService.getWorkers();
28
- }
29
- getWaitingJobs(param) {
30
- const startRecord = (param.page - 1) * param.limit;
31
- const endRecord = param.page * param.limit;
32
- return this.queueService.getWaitingJobs(startRecord, endRecord);
33
- }
34
- getDelayedJobs(param) {
35
- const startRecord = (param.page - 1) * param.limit;
36
- const endRecord = param.page * param.limit;
37
- return this.queueService.getDelayedJobs(startRecord, endRecord);
38
- }
39
- getActiveJobs(param) {
40
- const startRecord = (param.page - 1) * param.limit;
41
- const endRecord = param.page * param.limit;
42
- return this.queueService.getActiveJobs(startRecord, endRecord);
43
- }
44
- getCompletedJobs(param) {
45
- const startRecord = (param.page - 1) * param.limit;
46
- const endRecord = param.page * param.limit;
47
- return this.queueService.getCompletedJobs(startRecord, endRecord);
48
- }
49
- getFailedJobs(param) {
50
- const startRecord = (param.page - 1) * param.limit;
51
- const endRecord = param.page * param.limit;
52
- return this.queueService.getFailedJobs(startRecord, endRecord);
53
- }
54
- getJobInfo(id) {
55
- return this.queueService.getJobDetails(id);
56
- }
57
- retryJob(id) {
58
- return this.queueService.retryJob(id);
59
- }
60
- removeJob(id) {
61
- return this.queueService.removeJob(id);
62
- }
63
- };
64
- __decorate([
65
- (0, common_1.Get)('get-workers'),
66
- __metadata("design:type", Function),
67
- __metadata("design:paramtypes", []),
68
- __metadata("design:returntype", void 0)
69
- ], JobController.prototype, "getWorkers", null);
70
- __decorate([
71
- (0, common_1.Get)('get-stats'),
72
- __metadata("design:type", Function),
73
- __metadata("design:paramtypes", []),
74
- __metadata("design:returntype", void 0)
75
- ], JobController.prototype, "getQueueStats", null);
76
- __decorate([
77
- (0, common_1.Get)('get-waiting'),
78
- __param(0, (0, common_1.Param)()),
79
- __metadata("design:type", Function),
80
- __metadata("design:paramtypes", [job_record_param_dto_1.JobRecordParamDto]),
81
- __metadata("design:returntype", void 0)
82
- ], JobController.prototype, "getWaitingJobs", null);
83
- __decorate([
84
- (0, common_1.Get)('get-delayed'),
85
- __param(0, (0, common_1.Param)()),
86
- __metadata("design:type", Function),
87
- __metadata("design:paramtypes", [job_record_param_dto_1.JobRecordParamDto]),
88
- __metadata("design:returntype", void 0)
89
- ], JobController.prototype, "getDelayedJobs", null);
90
- __decorate([
91
- (0, common_1.Get)('get-active'),
92
- __param(0, (0, common_1.Param)()),
93
- __metadata("design:type", Function),
94
- __metadata("design:paramtypes", [job_record_param_dto_1.JobRecordParamDto]),
95
- __metadata("design:returntype", void 0)
96
- ], JobController.prototype, "getActiveJobs", null);
97
- __decorate([
98
- (0, common_1.Get)('get-completed'),
99
- __param(0, (0, common_1.Param)()),
100
- __metadata("design:type", Function),
101
- __metadata("design:paramtypes", [job_record_param_dto_1.JobRecordParamDto]),
102
- __metadata("design:returntype", void 0)
103
- ], JobController.prototype, "getCompletedJobs", null);
104
- __decorate([
105
- (0, common_1.Get)('get-failed'),
106
- __param(0, (0, common_1.Param)()),
107
- __metadata("design:type", Function),
108
- __metadata("design:paramtypes", [job_record_param_dto_1.JobRecordParamDto]),
109
- __metadata("design:returntype", void 0)
110
- ], JobController.prototype, "getFailedJobs", null);
111
- __decorate([
112
- (0, common_1.Get)(':id'),
113
- __param(0, (0, common_1.Param)('id')),
114
- __metadata("design:type", Function),
115
- __metadata("design:paramtypes", [Number]),
116
- __metadata("design:returntype", void 0)
117
- ], JobController.prototype, "getJobInfo", null);
118
- __decorate([
119
- (0, common_1.Post)('retry/:id'),
120
- __param(0, (0, common_1.Param)('id')),
121
- __metadata("design:type", Function),
122
- __metadata("design:paramtypes", [Number]),
123
- __metadata("design:returntype", void 0)
124
- ], JobController.prototype, "retryJob", null);
125
- __decorate([
126
- (0, common_1.Delete)(':id'),
127
- __param(0, (0, common_1.Param)('id')),
128
- __metadata("design:type", Function),
129
- __metadata("design:paramtypes", [Number]),
130
- __metadata("design:returntype", void 0)
131
- ], JobController.prototype, "removeJob", null);
132
- JobController = __decorate([
133
- (0, common_1.Controller)('api/admin/job'),
134
- __metadata("design:paramtypes", [queue_service_1.QueueService])
135
- ], JobController);
136
- exports.JobController = JobController;
137
- //# sourceMappingURL=job.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"job.controller.js","sourceRoot":"","sources":["../../../src/system/controllers/job.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAsE;AACtE,uEAAiE;AACjE,kFAA8E;AAQvE,IAAM,aAAa,GAAnB,MAAM,aAAa;IAMtB,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IAQ3D,UAAU;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IAC1C,CAAC;IAQD,aAAa;QACT,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IAC1C,CAAC;IASD,cAAc,CAAU,KAAwB;QAC5C,MAAM,WAAW,GAAW,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QAC3D,MAAM,SAAS,GAAW,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;QAEnD,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACpE,CAAC;IASD,cAAc,CAAU,KAAwB;QAC5C,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACnD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;QAE3C,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,WAAW,EAAE,SAAS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