@serene-dev/la-nest-library 0.0.18 → 0.0.21

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.
Files changed (76) hide show
  1. package/dist/libs/la-library/src/controllers/base.controller.d.ts +15 -0
  2. package/dist/libs/la-library/src/controllers/base.controller.js +53 -0
  3. package/dist/libs/la-library/src/controllers/base.controller.js.map +1 -0
  4. package/dist/libs/la-library/src/dtos/base.dto.d.ts +1 -0
  5. package/dist/libs/la-library/src/dtos/base.dto.js +6 -0
  6. package/dist/libs/la-library/src/dtos/base.dto.js.map +1 -1
  7. package/dist/libs/la-library/src/dtos/search.dto.d.ts +1 -0
  8. package/dist/libs/la-library/src/dtos/search.dto.js +3 -3
  9. package/dist/libs/la-library/src/dtos/search.dto.js.map +1 -1
  10. package/dist/libs/la-library/src/entities/base.entity.d.ts +2 -2
  11. package/dist/libs/la-library/src/entities/base.entity.js.map +1 -1
  12. package/dist/libs/la-library/src/enums/base.enum.d.ts +2 -0
  13. package/dist/libs/la-library/src/enums/base.enum.js +2 -0
  14. package/dist/libs/la-library/src/enums/base.enum.js.map +1 -1
  15. package/dist/libs/la-library/src/index.d.ts +6 -0
  16. package/dist/libs/la-library/src/index.js +20 -1
  17. package/dist/libs/la-library/src/index.js.map +1 -1
  18. package/dist/libs/la-library/src/interfaces/index.interface.d.ts +3 -0
  19. package/dist/libs/la-library/src/interfaces/index.interface.js +3 -0
  20. package/dist/libs/la-library/src/interfaces/index.interface.js.map +1 -0
  21. package/dist/libs/la-library/src/modules/authentication/authentication.controller.d.ts +10 -0
  22. package/dist/libs/la-library/src/modules/authentication/authentication.controller.js +77 -0
  23. package/dist/libs/la-library/src/modules/authentication/authentication.controller.js.map +1 -0
  24. package/dist/libs/la-library/src/modules/authentication/authentication.dto.d.ts +24 -0
  25. package/dist/libs/la-library/src/modules/authentication/authentication.dto.js +73 -0
  26. package/dist/libs/la-library/src/modules/authentication/authentication.dto.js.map +1 -0
  27. package/dist/libs/la-library/src/modules/authentication/authentication.entity.d.ts +16 -0
  28. package/dist/libs/la-library/src/modules/authentication/authentication.entity.js +65 -0
  29. package/dist/libs/la-library/src/modules/authentication/authentication.entity.js.map +1 -0
  30. package/dist/libs/la-library/src/modules/authentication/authentication.enum.d.ts +9 -0
  31. package/dist/libs/la-library/src/modules/authentication/authentication.enum.js +15 -0
  32. package/dist/libs/la-library/src/modules/authentication/authentication.enum.js.map +1 -0
  33. package/dist/libs/la-library/src/modules/authentication/authentication.guard.d.ts +14 -0
  34. package/dist/libs/la-library/src/modules/authentication/authentication.guard.js +69 -0
  35. package/dist/libs/la-library/src/modules/authentication/authentication.guard.js.map +1 -0
  36. package/dist/libs/la-library/src/modules/authentication/authentication.module.d.ts +4 -0
  37. package/dist/libs/la-library/src/modules/authentication/authentication.module.js +38 -0
  38. package/dist/libs/la-library/src/modules/authentication/authentication.module.js.map +1 -0
  39. package/dist/libs/la-library/src/modules/authentication/authentication.service.d.ts +32 -0
  40. package/dist/libs/la-library/src/modules/authentication/authentication.service.js +142 -0
  41. package/dist/libs/la-library/src/modules/authentication/authentication.service.js.map +1 -0
  42. package/dist/libs/la-library/src/modules/logs/logs.controller.d.ts +16 -2
  43. package/dist/libs/la-library/src/modules/logs/logs.controller.js +47 -8
  44. package/dist/libs/la-library/src/modules/logs/logs.controller.js.map +1 -1
  45. package/dist/libs/la-library/src/modules/logs/logs.dto.d.ts +29 -0
  46. package/dist/libs/la-library/src/modules/logs/logs.dto.js +135 -0
  47. package/dist/libs/la-library/src/modules/logs/logs.dto.js.map +1 -0
  48. package/dist/libs/la-library/src/modules/logs/logs.entity.d.ts +7 -7
  49. package/dist/libs/la-library/src/modules/logs/logs.entity.js +5 -5
  50. package/dist/libs/la-library/src/modules/logs/logs.entity.js.map +1 -1
  51. package/dist/libs/la-library/src/modules/logs/logs.module.js +1 -1
  52. package/dist/libs/la-library/src/modules/logs/logs.module.js.map +1 -1
  53. package/dist/libs/la-library/src/modules/logs/logs.service.d.ts +6 -2
  54. package/dist/libs/la-library/src/modules/logs/logs.service.js +22 -1
  55. package/dist/libs/la-library/src/modules/logs/logs.service.js.map +1 -1
  56. package/dist/libs/la-library/src/samples/base.sample.d.ts +2 -0
  57. package/dist/libs/la-library/src/samples/base.sample.js +2 -0
  58. package/dist/libs/la-library/src/samples/base.sample.js.map +1 -1
  59. package/dist/libs/la-library/src/services/base.service.d.ts +6 -1
  60. package/dist/libs/la-library/src/services/base.service.js +14 -0
  61. package/dist/libs/la-library/src/services/base.service.js.map +1 -1
  62. package/dist/libs/la-library/src/services/environment.service.d.ts +4 -0
  63. package/dist/libs/la-library/src/services/environment.service.js +2 -2
  64. package/dist/libs/la-library/src/services/environment.service.js.map +1 -1
  65. package/dist/libs/la-library/src/services/file.service.d.ts +3 -1
  66. package/dist/libs/la-library/src/services/file.service.js +1 -1
  67. package/dist/libs/la-library/src/services/file.service.js.map +1 -1
  68. package/dist/libs/la-library/src/services/search.service.js +17 -10
  69. package/dist/libs/la-library/src/services/search.service.js.map +1 -1
  70. package/dist/libs/la-library/src/services/token.service.d.ts +6 -2
  71. package/dist/libs/la-library/src/services/token.service.js +3 -2
  72. package/dist/libs/la-library/src/services/token.service.js.map +1 -1
  73. package/dist/libs/la-library/src/services/utility.service.d.ts +4 -1
  74. package/dist/libs/la-library/src/services/utility.service.js +13 -0
  75. package/dist/libs/la-library/src/services/utility.service.js.map +1 -1
  76. package/package.json +3 -1
@@ -0,0 +1,15 @@
1
+ import { BaseEntity } from '../entities/base.entity';
2
+ import { SearchQueryDto } from '../dtos/search.dto';
3
+ import { BaseService } from '../services/base.service';
4
+ import { IItemID } from '../interfaces/index.interface';
5
+ export declare class BaseController<TEntity extends BaseEntity, TSearchDto extends SearchQueryDto = SearchQueryDto> {
6
+ protected readonly service: BaseService<TEntity, TSearchDto>;
7
+ subject: string;
8
+ idParam: string;
9
+ constructor(service: BaseService<TEntity, TSearchDto>);
10
+ getByID(params: IItemID): Promise<{
11
+ data: TEntity;
12
+ message: string;
13
+ }>;
14
+ search(query: TSearchDto): Promise<import("..").ISearchResponse<TEntity>>;
15
+ }
@@ -0,0 +1,53 @@
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.BaseController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const swagger_1 = require("@nestjs/swagger");
18
+ const utility_service_1 = require("../services/utility.service");
19
+ class BaseController {
20
+ constructor(service) {
21
+ this.service = service;
22
+ this.subject = `Item`;
23
+ this.idParam = `id`;
24
+ }
25
+ async getByID(params) {
26
+ return utility_service_1.UtilityClass.handleSuccess({
27
+ data: await this.service.getById(params.id),
28
+ });
29
+ }
30
+ async search(query) {
31
+ return this.service.search(query);
32
+ }
33
+ }
34
+ exports.BaseController = BaseController;
35
+ __decorate([
36
+ (0, common_1.Get)('getByID/:id'),
37
+ (0, swagger_1.ApiParam)({
38
+ name: 'id',
39
+ required: true,
40
+ }),
41
+ __param(0, (0, common_1.Param)()),
42
+ __metadata("design:type", Function),
43
+ __metadata("design:paramtypes", [Object]),
44
+ __metadata("design:returntype", Promise)
45
+ ], BaseController.prototype, "getByID", null);
46
+ __decorate([
47
+ (0, common_1.Get)('search'),
48
+ __param(0, (0, common_1.Query)()),
49
+ __metadata("design:type", Function),
50
+ __metadata("design:paramtypes", [Object]),
51
+ __metadata("design:returntype", Promise)
52
+ ], BaseController.prototype, "search", null);
53
+ //# sourceMappingURL=base.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.controller.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/controllers/base.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmD;AACnD,6CAA2C;AAI3C,iEAA2D;AAG3D,MAAa,cAAc;IAMzB,YAA+B,OAAyC;QAAzC,YAAO,GAAP,OAAO,CAAkC;QAFxE,YAAO,GAAG,MAAM,CAAC;QACjB,YAAO,GAAG,IAAI,CAAC;IAC4D,CAAC;IAOtE,AAAN,KAAK,CAAC,OAAO,CAAU,MAAe;QACpC,OAAO,8BAAY,CAAC,aAAa,CAAC;YAChC,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;SAC5C,CAAC,CAAC;IACL,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAU,KAAiB;QAErC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;CACF;AAxBD,wCAwBC;AAXO;IALL,IAAA,YAAG,EAAC,aAAa,CAAC;IAClB,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACf,CAAC;IACa,WAAA,IAAA,cAAK,GAAE,CAAA;;;;6CAIrB;AAGK;IADL,IAAA,YAAG,EAAC,QAAQ,CAAC;IACA,WAAA,IAAA,cAAK,GAAE,CAAA;;;;4CAGpB"}
@@ -1,6 +1,7 @@
1
1
  import { BaseEntity } from '../entities/base.entity';
2
2
  export declare class BaseDto implements Partial<BaseEntity> {
3
3
  createdBy?: string;
4
+ ownerID?: string;
4
5
  orgID?: string;
5
6
  }
6
7
  export declare class BatchDeleteDto {
@@ -23,6 +23,12 @@ __decorate([
23
23
  (0, swagger_1.ApiProperty)({ default: base_sample_1.Sample.createdBy, required: false }),
24
24
  __metadata("design:type", String)
25
25
  ], BaseDto.prototype, "createdBy", void 0);
26
+ __decorate([
27
+ (0, class_validator_1.IsUUID)(),
28
+ (0, class_validator_1.IsOptional)(),
29
+ (0, swagger_1.ApiProperty)({ default: base_sample_1.Sample.createdBy, required: false }),
30
+ __metadata("design:type", String)
31
+ ], BaseDto.prototype, "ownerID", void 0);
26
32
  __decorate([
27
33
  (0, class_validator_1.IsString)(),
28
34
  (0, class_validator_1.IsOptional)(),
@@ -1 +1 @@
1
- {"version":3,"file":"base.dto.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/dtos/base.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAgE;AAEhE,wDAAgD;AAChD,iEAA2D;AAE3D,MAAa,OAAO;CAcnB;AAdD,0BAcC;AAVC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,oBAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACzC;AASnB;IAPC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,oBAAM,CAAC,KAAK;QACrB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,gEAAgE;KAC9E,CAAC;;sCACa;AAGjB,MAAa,cAAc;CAM1B;AAND,wCAMC;AADC;IAJC,IAAA,yBAAO,EAAC,EAAE,CAAC;IACX,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,8BAAY,CAAC,YAAY,EAAE,CAAC;KACrE,CAAC;;2CACa"}
1
+ {"version":3,"file":"base.dto.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/dtos/base.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,qDAAwE;AAExE,wDAAgD;AAChD,iEAA2D;AAE3D,MAAa,OAAO;CAmBnB;AAnBD,0BAmBC;AAfC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,oBAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACzC;AAKnB;IAHC,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,OAAO,EAAE,oBAAM,CAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;wCAC3C;AASjB;IAPC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,oBAAM,CAAC,KAAK;QACrB,QAAQ,EAAE,KAAK;QACf,WAAW,EAAE,gEAAgE;KAC9E,CAAC;;sCACa;AAGjB,MAAa,cAAc;CAM1B;AAND,wCAMC;AADC;IAJC,IAAA,yBAAO,EAAC,EAAE,CAAC;IACX,IAAA,qBAAW,EAAC;QACX,OAAO,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,8BAAY,CAAC,YAAY,EAAE,CAAC;KACrE,CAAC;;2CACa"}
@@ -10,4 +10,5 @@ export declare class SearchQueryDto extends BaseDto {
10
10
  pageSize?: number;
11
11
  sortField?: string;
12
12
  sortDirection?: ESortOrder;
13
+ query?: string;
13
14
  }
@@ -20,7 +20,7 @@ exports.SearchQueryDto = SearchQueryDto;
20
20
  __decorate([
21
21
  (0, class_validator_1.IsDateString)(),
22
22
  (0, class_validator_1.IsOptional)(),
23
- (0, swagger_1.ApiProperty)({ required: false }),
23
+ (0, swagger_1.ApiProperty)({ required: false, type: Date }),
24
24
  __metadata("design:type", String)
25
25
  ], SearchQueryDto.prototype, "createdAt", void 0);
26
26
  __decorate([
@@ -31,13 +31,13 @@ __decorate([
31
31
  __decorate([
32
32
  (0, class_validator_1.IsDateString)(),
33
33
  (0, class_validator_1.IsOptional)(),
34
- (0, swagger_1.ApiProperty)({ required: false }),
34
+ (0, swagger_1.ApiProperty)({ required: false, type: Date }),
35
35
  __metadata("design:type", String)
36
36
  ], SearchQueryDto.prototype, "createdFrom", void 0);
37
37
  __decorate([
38
38
  (0, class_validator_1.IsDateString)(),
39
39
  (0, class_validator_1.IsOptional)(),
40
- (0, swagger_1.ApiProperty)({ required: false }),
40
+ (0, swagger_1.ApiProperty)({ required: false, type: Date }),
41
41
  __metadata("design:type", String)
42
42
  ], SearchQueryDto.prototype, "createdTo", void 0);
43
43
  __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"search.dto.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/dtos/search.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,yCAAqC;AACrC,qDAAmE;AACnE,sDAAkD;AAElD,MAAa,cAAe,SAAQ,kBAAO;CAwC1C;AAxCD,wCAwCC;AApCC;IAHC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iDACd;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iDACd;AAKnB;IAHC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;mDACZ;AAKrB;IAHC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;IACZ,IAAA,qBA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K,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;mDACxB;AAKrB;IAHC,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iDAC1B;AAInB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;6CAClB;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;;kDAC3C;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;gDACf;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;iDACd;AAKnB;IAHC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,wBAAU,CAAC;IAClB,IAAA,qBAAW,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAU,EAAE,CAAC;;qDACxB"}
@@ -4,7 +4,7 @@ export declare class BaseEntity implements IBaseInterface {
4
4
  meta?: object;
5
5
  createdAt: string;
6
6
  updatedAt: string;
7
- createdBy: string;
8
- ownerID: string;
7
+ createdBy?: string;
8
+ ownerID?: string;
9
9
  orgID?: string;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"base.entity.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/entities/base.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAKiB;AAEjB,MAAa,UAAU;CAuBtB;AAvBD,gCAuBC;AArBC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;sCACpB;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE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Q,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2CACxB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCAC1B"}
@@ -5,6 +5,8 @@ export declare enum ETableName {
5
5
  likes = "likes",
6
6
  file = "file",
7
7
  logs = "logs",
8
+ authentication = "authentication",
9
+ authenticationSession = "authentication_session",
8
10
  fileBin = "file_bin",
9
11
  user = "user"
10
12
  }
@@ -10,6 +10,8 @@ var ETableName;
10
10
  ETableName["likes"] = "likes";
11
11
  ETableName["file"] = "file";
12
12
  ETableName["logs"] = "logs";
13
+ ETableName["authentication"] = "authentication";
14
+ ETableName["authenticationSession"] = "authentication_session";
13
15
  ETableName["fileBin"] = "file_bin";
14
16
  ETableName["user"] = "user";
15
17
  })(ETableName || (exports.ETableName = ETableName = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"base.enum.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/enums/base.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+BAAc,CAAA;AAChB,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,kCAAoB,CAAA;IACpB,2BAAa,CAAA;AACf,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AAED,IAAY,OAEX;AAFD,WAAY,OAAO;IACjB,wBAAa,CAAA;AACf,CAAC,EAFW,OAAO,uBAAP,OAAO,QAElB"}
1
+ {"version":3,"file":"base.enum.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/enums/base.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+BAAc,CAAA;AAChB,CAAC,EAFW,aAAa,6BAAb,aAAa,QAExB;AAED,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,2BAAa,CAAA;IACb,+CAAiC,CAAA;IACjC,8DAAgD,CAAA;IAChD,kCAAoB,CAAA;IACpB,2BAAa,CAAA;AACf,CAAC,EARW,UAAU,0BAAV,UAAU,QAQrB;AAED,IAAY,OAEX;AAFD,WAAY,OAAO;IACjB,wBAAa,CAAA;AACf,CAAC,EAFW,OAAO,uBAAP,OAAO,QAElB"}
@@ -24,5 +24,11 @@ export { SDKConfig } from './configs/index.config';
24
24
  export { FileController as SDKFileController } from './controllers/file.controller';
25
25
  export { LogsModule as SDKLogsModule } from './modules/logs/logs.module';
26
26
  export { LogsService as SDKLogsService } from './modules/logs/logs.service';
27
+ export { LogSerarchDTO as SDKLogSerarchDTO, LogCreateMultipleDTO as SDKLogCreateMultipleDTO, LogCreateSingleDTO as SDKLogCreateSingleDTO, } from './modules/logs/logs.dto';
27
28
  export { LogsController as SDKLogsController } from './modules/logs/logs.controller';
28
29
  export { LogEntity as SDKLogEntity } from './modules/logs/logs.entity';
30
+ export { AuthenticationModule as AuthenticationModule } from './modules/authentication/authentication.module';
31
+ export { AuthenticationService as AuthenticationService, AuthenticationSessionService as AuthenticationSessionService, } from './modules/authentication/authentication.service';
32
+ export { AuthenticationController as AuthenticationController } from './modules/authentication/authentication.controller';
33
+ export { AuthEntity as AuthEntity, AuthSessionEntity as AuthSessionEntity, } from './modules/authentication/authentication.entity';
34
+ export { LoginDTO as LoginDTO, LogoutDTO as LogoutDTO, RegisterDTO as RegisterDTO, SystemLogoutDTO as SystemLogoutDTO, } from './modules/authentication/authentication.dto';
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.SDKLogEntity = exports.SDKLogsController = exports.SDKLogsService = exports.SDKLogsModule = exports.SDKFileController = exports.SDKConfig = exports.SDKSample = exports.ESortOrder = exports.ESearchCondition = exports.SDKETableName = exports.SDKERefCat = exports.SDKEFileSizeUnit = exports.SearchQueryDto = exports.SDKFileUploadDto = exports.SDKFileUpdateDto = exports.SDKFileSearchDto = exports.SDKFileActionDto = exports.SDKBaseDto = exports.FileEntity = exports.FileBinEntity = exports.LikesEntity = exports.BaseEntity = exports.SDKUtilityClass = exports.SDKTokenService = exports.SDKSearchService = exports.stream = exports.logger = exports.SDKLikesService = exports.SDKFileService = exports.SDKBaseService = exports.SDKEnvironmentService = void 0;
17
+ exports.SystemLogoutDTO = exports.RegisterDTO = exports.LogoutDTO = exports.LoginDTO = exports.AuthSessionEntity = exports.AuthEntity = exports.AuthenticationController = exports.AuthenticationSessionService = exports.AuthenticationService = exports.AuthenticationModule = exports.SDKLogEntity = exports.SDKLogsController = exports.SDKLogCreateSingleDTO = exports.SDKLogCreateMultipleDTO = exports.SDKLogSerarchDTO = exports.SDKLogsService = exports.SDKLogsModule = exports.SDKFileController = exports.SDKConfig = exports.SDKSample = exports.ESortOrder = exports.ESearchCondition = exports.SDKETableName = exports.SDKERefCat = exports.SDKEFileSizeUnit = exports.SearchQueryDto = exports.SDKFileUploadDto = exports.SDKFileUpdateDto = exports.SDKFileSearchDto = exports.SDKFileActionDto = exports.SDKBaseDto = exports.FileEntity = exports.FileBinEntity = exports.LikesEntity = exports.BaseEntity = exports.SDKUtilityClass = exports.SDKTokenService = exports.SDKSearchService = exports.stream = exports.logger = exports.SDKLikesService = exports.SDKFileService = exports.SDKBaseService = exports.SDKEnvironmentService = void 0;
18
18
  __exportStar(require("./la-library.module"), exports);
19
19
  var environment_service_1 = require("./services/environment.service");
20
20
  Object.defineProperty(exports, "SDKEnvironmentService", { enumerable: true, get: function () { return environment_service_1.SDKEnvironmentService; } });
@@ -69,8 +69,27 @@ var logs_module_1 = require("./modules/logs/logs.module");
69
69
  Object.defineProperty(exports, "SDKLogsModule", { enumerable: true, get: function () { return logs_module_1.LogsModule; } });
70
70
  var logs_service_1 = require("./modules/logs/logs.service");
71
71
  Object.defineProperty(exports, "SDKLogsService", { enumerable: true, get: function () { return logs_service_1.LogsService; } });
72
+ var logs_dto_1 = require("./modules/logs/logs.dto");
73
+ Object.defineProperty(exports, "SDKLogSerarchDTO", { enumerable: true, get: function () { return logs_dto_1.LogSerarchDTO; } });
74
+ Object.defineProperty(exports, "SDKLogCreateMultipleDTO", { enumerable: true, get: function () { return logs_dto_1.LogCreateMultipleDTO; } });
75
+ Object.defineProperty(exports, "SDKLogCreateSingleDTO", { enumerable: true, get: function () { return logs_dto_1.LogCreateSingleDTO; } });
72
76
  var logs_controller_1 = require("./modules/logs/logs.controller");
73
77
  Object.defineProperty(exports, "SDKLogsController", { enumerable: true, get: function () { return logs_controller_1.LogsController; } });
74
78
  var logs_entity_1 = require("./modules/logs/logs.entity");
75
79
  Object.defineProperty(exports, "SDKLogEntity", { enumerable: true, get: function () { return logs_entity_1.LogEntity; } });
80
+ var authentication_module_1 = require("./modules/authentication/authentication.module");
81
+ Object.defineProperty(exports, "AuthenticationModule", { enumerable: true, get: function () { return authentication_module_1.AuthenticationModule; } });
82
+ var authentication_service_1 = require("./modules/authentication/authentication.service");
83
+ Object.defineProperty(exports, "AuthenticationService", { enumerable: true, get: function () { return authentication_service_1.AuthenticationService; } });
84
+ Object.defineProperty(exports, "AuthenticationSessionService", { enumerable: true, get: function () { return authentication_service_1.AuthenticationSessionService; } });
85
+ var authentication_controller_1 = require("./modules/authentication/authentication.controller");
86
+ Object.defineProperty(exports, "AuthenticationController", { enumerable: true, get: function () { return authentication_controller_1.AuthenticationController; } });
87
+ var authentication_entity_1 = require("./modules/authentication/authentication.entity");
88
+ Object.defineProperty(exports, "AuthEntity", { enumerable: true, get: function () { return authentication_entity_1.AuthEntity; } });
89
+ Object.defineProperty(exports, "AuthSessionEntity", { enumerable: true, get: function () { return authentication_entity_1.AuthSessionEntity; } });
90
+ var authentication_dto_1 = require("./modules/authentication/authentication.dto");
91
+ Object.defineProperty(exports, "LoginDTO", { enumerable: true, get: function () { return authentication_dto_1.LoginDTO; } });
92
+ Object.defineProperty(exports, "LogoutDTO", { enumerable: true, get: function () { return authentication_dto_1.LogoutDTO; } });
93
+ Object.defineProperty(exports, "RegisterDTO", { enumerable: true, get: function () { return authentication_dto_1.RegisterDTO; } });
94
+ Object.defineProperty(exports, "SystemLogoutDTO", { enumerable: true, get: function () { return authentication_dto_1.SystemLogoutDTO; } });
76
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/la-library/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sEAGwC;AAFtC,4HAAA,qBAAqB,OAAA;AAIvB,wDAAyD;AAAhD,8GAAA,cAAc,OAAA;AACvB,wDAAwE;AAA/D,8GAAA,WAAW,OAAkB;AACtC,0DAA2E;AAAlE,gHAAA,YAAY,OAAmB;AACxC,4DAA2D;AAAlD,wGAAA,MAAM,OAAA;AAAE,wGAAA,MAAM,OAAA;AACvB,4DAA8E;AAArE,kHAAA,aAAa,OAAoB;AAC1C,0DAA2E;AAAlE,gHAAA,YAAY,OAAmB;AACxC,8DAA6E;AAApE,kHAAA,YAAY,OAAmB;AAExC,sDAAoD;AAA3C,yGAAA,UAAU,OAAA;AACnB,wDAAsD;AAA7C,2GAAA,WAAW,OAAA;AACpB,8DAA2D;AAAlD,gHAAA,aAAa,OAAA;AACtB,sDAAoD;AAA3C,yGAAA,UAAU,OAAA;AAEnB,4CAAwD;AAA/C,sGAAA,OAAO,OAAc;AAC9B,4CAKyB;AAJvB,4GAAA,aAAa,OAAoB;AACjC,4GAAA,aAAa,OAAoB;AACjC,4GAAA,aAAa,OAAoB;AACjC,4GAAA,aAAa,OAAoB;AAEnC,gDAAmD;AAA1C,4GAAA,cAAc,OAAA;AAEvB,+CAI2B;AAHzB,6GAAA,aAAa,OAAoB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AA,aAAa,OAAoB;AAEnC,gDAAmD;AAA1C,4GAAA,cAAc,OAAA;AAEvB,+CAI2B;AAHzB,6GAAA,aAAa,OAAoB;AACjC,uGAAA,OAAO,OAAc;AACrB,0GAAA,UAAU,OAAiB;AAE7B,mDAAmE;AAA1D,+GAAA,gBAAgB,OAAA;AAAE,yGAAA,UAAU,OAAA;AAErC,8DAA4C;AAE5C,gEAA8C;AAE9C,qDAA4D;AAAnD,wGAAA,MAAM,OAAa;AAC5B,uDAAmD;AAA1C,yGAAA,SAAS,OAAA;AAElB,iEAAoF;AAA3E,oHAAA,cAAc,OAAqB;AAE5C,0DAAyE;AAAhE,4GAAA,UAAU,OAAiB;AACpC,4DAA4E;AAAnE,8GAAA,WAAW,OAAkB;AACtC,oDAIiC;AAH/B,4GAAA,aAAa,OAAoB;AACjC,mHAAA,oBAAoB,OAA2B;AAC/C,iHAAA,kBAAkB,OAAyB;AAE7C,kEAAqF;AAA5E,oHAAA,cAAc,OAAqB;AAC5C,0DAAuE;AAA9D,2GAAA,SAAS,OAAgB;AAElC,wFAA8G;AAArG,6HAAA,oBAAoB,OAAwB;AACrD,0FAGyD;AAFvD,+HAAA,qBAAqB,OAAyB;AAC9C,sIAAA,4BAA4B,OAAgC;AAE9D,gGAA0H;AAAjH,qIAAA,wBAAwB,OAA4B;AAC7D,wFAGwD;AAFtD,mHAAA,UAAU,OAAc;AACxB,0HAAA,iBAAiB,OAAqB;AAExC,kFAKqD;AAJnD,8GAAA,QAAQ,OAAY;AACpB,+GAAA,SAAS,OAAa;AACtB,iHAAA,WAAW,OAAe;AAC1B,qHAAA,eAAe,OAAmB"}
@@ -0,0 +1,3 @@
1
+ export interface IItemID {
2
+ id: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.interface.js","sourceRoot":"","sources":["../../../../../libs/la-library/src/interfaces/index.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { AuthenticationService } from './authentication.service';
2
+ import { LoginDTO, LogoutDTO, RegisterDTO, SystemLogoutDTO } from './authentication.dto';
3
+ export declare class AuthenticationController {
4
+ protected readonly service: AuthenticationService;
5
+ constructor(service: AuthenticationService);
6
+ logout(body: LogoutDTO): Promise<boolean>;
7
+ systemLogout(body: SystemLogoutDTO): Promise<boolean>;
8
+ login(body: LoginDTO): Promise<import("./authentication.entity").AuthEntity>;
9
+ register(body: RegisterDTO): Promise<import("./authentication.entity").AuthEntity>;
10
+ }
@@ -0,0 +1,77 @@
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.AuthenticationController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const authentication_service_1 = require("./authentication.service");
18
+ const authentication_dto_1 = require("./authentication.dto");
19
+ const swagger_1 = require("@nestjs/swagger");
20
+ const authentication_guard_1 = require("./authentication.guard");
21
+ let AuthenticationController = class AuthenticationController {
22
+ constructor(service) {
23
+ this.service = service;
24
+ }
25
+ logout(body) {
26
+ return this.service.logout(body);
27
+ }
28
+ systemLogout(body) {
29
+ return this.service.forceLogout(body);
30
+ }
31
+ login(body) {
32
+ return this.service.login(body);
33
+ }
34
+ register(body) {
35
+ return this.service.register(body);
36
+ }
37
+ };
38
+ exports.AuthenticationController = AuthenticationController;
39
+ __decorate([
40
+ (0, common_1.Post)('logout'),
41
+ (0, swagger_1.ApiBearerAuth)(),
42
+ __param(0, (0, common_1.Body)()),
43
+ __metadata("design:type", Function),
44
+ __metadata("design:paramtypes", [authentication_dto_1.LogoutDTO]),
45
+ __metadata("design:returntype", void 0)
46
+ ], AuthenticationController.prototype, "logout", null);
47
+ __decorate([
48
+ (0, common_1.Post)('logout/force'),
49
+ (0, swagger_1.ApiBearerAuth)(),
50
+ (0, common_1.UseGuards)(authentication_guard_1.AuthenticationGuard),
51
+ __param(0, (0, common_1.Body)()),
52
+ __metadata("design:type", Function),
53
+ __metadata("design:paramtypes", [authentication_dto_1.SystemLogoutDTO]),
54
+ __metadata("design:returntype", void 0)
55
+ ], AuthenticationController.prototype, "systemLogout", null);
56
+ __decorate([
57
+ (0, common_1.Post)('login'),
58
+ (0, authentication_guard_1.PublicAuth)(),
59
+ __param(0, (0, common_1.Body)()),
60
+ __metadata("design:type", Function),
61
+ __metadata("design:paramtypes", [authentication_dto_1.LoginDTO]),
62
+ __metadata("design:returntype", void 0)
63
+ ], AuthenticationController.prototype, "login", null);
64
+ __decorate([
65
+ (0, common_1.Post)('register'),
66
+ (0, authentication_guard_1.PublicAuth)(),
67
+ __param(0, (0, common_1.Body)()),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", [authentication_dto_1.RegisterDTO]),
70
+ __metadata("design:returntype", void 0)
71
+ ], AuthenticationController.prototype, "register", null);
72
+ exports.AuthenticationController = AuthenticationController = __decorate([
73
+ (0, swagger_1.ApiTags)(authentication_service_1.AuthenticationService.tag),
74
+ (0, common_1.Controller)(authentication_service_1.AuthenticationService.path),
75
+ __metadata("design:paramtypes", [authentication_service_1.AuthenticationService])
76
+ ], AuthenticationController);
77
+ //# sourceMappingURL=authentication.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.controller.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/authentication/authentication.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmE;AACnE,qEAAiE;AACjE,6DAK8B;AAC9B,6CAAyD;AACzD,iEAAyE;AAIlE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YAA+B,OAA8B;QAA9B,YAAO,GAAP,OAAO,CAAuB;IAAG,CAAC;IAKjE,MAAM,CAAS,IAAe;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAKD,YAAY,CAAS,IAAqB;QACxC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAID,KAAK,CAAS,IAAc;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAID,QAAQ,CAAS,IAAiB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;CACF,CAAA;AA5BY,4DAAwB;AAMnC;IAHC,IAAA,aAAI,EAAC,QAAQ,CAAC;IACd,IAAA,uBAAa,GAAE;IAER,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,8BAAS;;sDAE7B;AAKD;IAHC,IAAA,aAAI,EAAC,cAAc,CAAC;IACpB,IAAA,uBAAa,GAAE;IACf,IAAA,kBAAS,EAAC,0CAAmB,CAAC;IACjB,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,oCAAe;;4DAEzC;AAID;IAFC,IAAA,aAAI,EAAC,OAAO,CAAC;IACb,IAAA,iCAAU,GAAE;IACN,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,6BAAQ;;qDAE3B;AAID;IAFC,IAAA,aAAI,EAAC,UAAU,CAAC;IAChB,IAAA,iCAAU,GAAE;IACH,WAAA,IAAA,aAAI,GAAE,CAAA;;qCAAO,gCAAW;;wDAEjC;mCA3BU,wBAAwB;IAFpC,IAAA,iBAAO,EAAC,8CAAqB,CAAC,GAAG,CAAC;IAClC,IAAA,mBAAU,EAAC,8CAAqB,CAAC,IAAI,CAAC;qCAEG,8CAAqB;GADlD,wBAAwB,CA4BpC"}
@@ -0,0 +1,24 @@
1
+ import { AuthEntity, AuthSessionEntity } from './authentication.entity';
2
+ import { EAuthType, ELogOutType } from './authentication.enum';
3
+ declare class AuthBaseDTO implements Partial<AuthEntity> {
4
+ type?: EAuthType;
5
+ orgID?: string;
6
+ email?: string;
7
+ }
8
+ export declare class RegisterDTO extends AuthBaseDTO implements Partial<AuthEntity> {
9
+ password?: string;
10
+ login: boolean;
11
+ }
12
+ export declare class LoginDTO extends AuthBaseDTO implements Partial<AuthEntity> {
13
+ password?: string;
14
+ }
15
+ export declare class LogoutDTO implements Partial<AuthSessionEntity> {
16
+ token: string;
17
+ logoutReason?: ELogOutType;
18
+ forced?: boolean;
19
+ }
20
+ export declare class SystemLogoutDTO implements Partial<AuthSessionEntity> {
21
+ ownerID: string;
22
+ logoutReason: ELogOutType;
23
+ }
24
+ export {};
@@ -0,0 +1,73 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SystemLogoutDTO = exports.LogoutDTO = exports.LoginDTO = exports.RegisterDTO = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const authentication_enum_1 = require("./authentication.enum");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ const base_sample_1 = require("../../samples/base.sample");
17
+ class AuthBaseDTO {
18
+ }
19
+ __decorate([
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.IsOptional)(),
22
+ (0, swagger_1.ApiProperty)({ type: 'string', default: base_sample_1.Sample.orgID, required: false }),
23
+ __metadata("design:type", String)
24
+ ], AuthBaseDTO.prototype, "orgID", void 0);
25
+ __decorate([
26
+ (0, class_validator_1.IsEmail)(),
27
+ (0, swagger_1.ApiProperty)({ type: 'string', default: base_sample_1.Sample.email, required: true }),
28
+ __metadata("design:type", String)
29
+ ], AuthBaseDTO.prototype, "email", void 0);
30
+ class RegisterDTO extends AuthBaseDTO {
31
+ }
32
+ exports.RegisterDTO = RegisterDTO;
33
+ __decorate([
34
+ (0, class_validator_1.IsString)(),
35
+ (0, swagger_1.ApiProperty)({ type: 'string', default: base_sample_1.Sample.password, required: true }),
36
+ __metadata("design:type", String)
37
+ ], RegisterDTO.prototype, "password", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsBoolean)(),
40
+ (0, class_validator_1.IsOptional)(),
41
+ (0, swagger_1.ApiProperty)({ type: 'boolean', default: true }),
42
+ __metadata("design:type", Boolean)
43
+ ], RegisterDTO.prototype, "login", void 0);
44
+ class LoginDTO extends AuthBaseDTO {
45
+ }
46
+ exports.LoginDTO = LoginDTO;
47
+ __decorate([
48
+ (0, class_validator_1.IsString)(),
49
+ (0, swagger_1.ApiProperty)({ type: 'string', default: base_sample_1.Sample.password, required: true }),
50
+ __metadata("design:type", String)
51
+ ], LoginDTO.prototype, "password", void 0);
52
+ class LogoutDTO {
53
+ }
54
+ exports.LogoutDTO = LogoutDTO;
55
+ __decorate([
56
+ (0, class_validator_1.IsString)(),
57
+ (0, swagger_1.ApiProperty)({ type: 'string', required: true }),
58
+ __metadata("design:type", String)
59
+ ], LogoutDTO.prototype, "token", void 0);
60
+ class SystemLogoutDTO {
61
+ }
62
+ exports.SystemLogoutDTO = SystemLogoutDTO;
63
+ __decorate([
64
+ (0, class_validator_1.IsUUID)(),
65
+ (0, swagger_1.ApiProperty)({ type: 'string', required: true }),
66
+ __metadata("design:type", String)
67
+ ], SystemLogoutDTO.prototype, "ownerID", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsEnum)(authentication_enum_1.ELogOutType),
70
+ (0, swagger_1.ApiProperty)({ type: 'string', required: true }),
71
+ __metadata("design:type", String)
72
+ ], SystemLogoutDTO.prototype, "logoutReason", void 0);
73
+ //# sourceMappingURL=authentication.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.dto.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/authentication/authentication.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAOyB;AAEzB,+DAA+D;AAC/D,6CAA8C;AAC9C,2DAAmD;AAEnD,MAAM,WAAW;CAShB;AAJC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACzD;AAGf;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACxD;AAGjB,MAAa,WAAY,SAAQ,WAAW;CAQ3C;AARD,kCAQC;AALC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACxD;AAIlB;IAHC,IAAA,2BAAS,GAAE;IACX,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;0CACjC;AAGjB,MAAa,QAAS,SAAQ,WAAW;CAIxC;AAJD,4BAIC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,oBAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACxD;AAGpB,MAAa,SAAS;CAMrB;AAND,8BAMC;AAHC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAClC;AAKhB,MAAa,eAAe;CAO3B;AAPD,0CAOC;AAJC;IAFC,IAAA,wBAAM,GAAE;IACR,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDAChC;AAGhB;IAFC,IAAA,wBAAM,EAAC,iCAAW,CAAC;IACnB,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACtB"}
@@ -0,0 +1,16 @@
1
+ import { BaseEntity } from '../../entities/base.entity';
2
+ import { EAuthType, ELogOutType } from './authentication.enum';
3
+ export declare class AuthEntity extends BaseEntity {
4
+ type?: EAuthType;
5
+ email?: string;
6
+ password?: string;
7
+ token?: string;
8
+ }
9
+ export declare class AuthSessionEntity extends BaseEntity {
10
+ loginDate: number;
11
+ token: string;
12
+ forced: boolean;
13
+ logoutReason: ELogOutType;
14
+ active: boolean;
15
+ logoutDate: number;
16
+ }
@@ -0,0 +1,65 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AuthSessionEntity = exports.AuthEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const base_enum_1 = require("../../enums/base.enum");
15
+ const base_entity_1 = require("../../entities/base.entity");
16
+ const authentication_enum_1 = require("./authentication.enum");
17
+ let AuthEntity = class AuthEntity extends base_entity_1.BaseEntity {
18
+ };
19
+ exports.AuthEntity = AuthEntity;
20
+ __decorate([
21
+ (0, typeorm_1.Column)({ type: 'enum', enum: authentication_enum_1.EAuthType, default: authentication_enum_1.EAuthType.user }),
22
+ __metadata("design:type", String)
23
+ ], AuthEntity.prototype, "type", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({ type: 'text' }),
26
+ __metadata("design:type", String)
27
+ ], AuthEntity.prototype, "email", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)({ type: 'text' }),
30
+ __metadata("design:type", String)
31
+ ], AuthEntity.prototype, "password", void 0);
32
+ exports.AuthEntity = AuthEntity = __decorate([
33
+ (0, typeorm_1.Entity)(base_enum_1.ETableName.authentication)
34
+ ], AuthEntity);
35
+ let AuthSessionEntity = class AuthSessionEntity extends base_entity_1.BaseEntity {
36
+ };
37
+ exports.AuthSessionEntity = AuthSessionEntity;
38
+ __decorate([
39
+ (0, typeorm_1.Column)({ type: 'double' }),
40
+ __metadata("design:type", Number)
41
+ ], AuthSessionEntity.prototype, "loginDate", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({ type: 'text' }),
44
+ __metadata("design:type", String)
45
+ ], AuthSessionEntity.prototype, "token", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({ type: 'boolean', default: false }),
48
+ __metadata("design:type", Boolean)
49
+ ], AuthSessionEntity.prototype, "forced", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.Column)({ type: 'enum', enum: authentication_enum_1.ELogOutType, nullable: true }),
52
+ __metadata("design:type", String)
53
+ ], AuthSessionEntity.prototype, "logoutReason", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.Column)({ type: 'boolean', default: true }),
56
+ __metadata("design:type", Boolean)
57
+ ], AuthSessionEntity.prototype, "active", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: 'double', nullable: true }),
60
+ __metadata("design:type", Number)
61
+ ], AuthSessionEntity.prototype, "logoutDate", void 0);
62
+ exports.AuthSessionEntity = AuthSessionEntity = __decorate([
63
+ (0, typeorm_1.Entity)(base_enum_1.ETableName.authenticationSession)
64
+ ], AuthSessionEntity);
65
+ //# sourceMappingURL=authentication.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.entity.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/authentication/authentication.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAyC;AACzC,qDAAmD;AACnD,4DAAwD;AACxD,+DAA+D;AAGxD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,wBAAU;CASzC,CAAA;AATY,gCAAU;AAErB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAAS,EAAE,OAAO,EAAE,+BAAS,CAAC,IAAI,EAAE,CAAC;;wCAClD;AAEjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;yCACV;AAEf;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4CACP;qBANP,UAAU;IADtB,IAAA,gBAAM,EAAC,sBAAU,CAAC,cAAc,CAAC;GACrB,UAAU,CAStB;AAGM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,wBAAU;CAkBhD,CAAA;AAlBY,8CAAiB;AAE5B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;;oDACT;AAGlB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDACX;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;iDAC5B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iCAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uDAClC;AAG1B;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;iDAC3B;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACxB;4BAjBR,iBAAiB;IAD7B,IAAA,gBAAM,EAAC,sBAAU,CAAC,qBAAqB,CAAC;GAC5B,iBAAiB,CAkB7B"}
@@ -0,0 +1,9 @@
1
+ export declare enum EAuthType {
2
+ admin = "admin",
3
+ user = "user"
4
+ }
5
+ export declare enum ELogOutType {
6
+ expiration = "expiration",
7
+ user = "user",
8
+ reset = "reset"
9
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ELogOutType = exports.EAuthType = void 0;
4
+ var EAuthType;
5
+ (function (EAuthType) {
6
+ EAuthType["admin"] = "admin";
7
+ EAuthType["user"] = "user";
8
+ })(EAuthType || (exports.EAuthType = EAuthType = {}));
9
+ var ELogOutType;
10
+ (function (ELogOutType) {
11
+ ELogOutType["expiration"] = "expiration";
12
+ ELogOutType["user"] = "user";
13
+ ELogOutType["reset"] = "reset";
14
+ })(ELogOutType || (exports.ELogOutType = ELogOutType = {}));
15
+ //# sourceMappingURL=authentication.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.enum.js","sourceRoot":"","sources":["../../../../../../libs/la-library/src/modules/authentication/authentication.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,4BAAa,CAAA;IACb,8BAAe,CAAA;AACjB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
@@ -0,0 +1,14 @@
1
+ import { CanActivate, ExecutionContext } from '@nestjs/common';
2
+ import { TokenService } from '../../services/token.service';
3
+ import { AuthenticationService } from './authentication.service';
4
+ import { Reflector } from '@nestjs/core';
5
+ export declare class AuthenticationGuard implements CanActivate {
6
+ protected tokenService: TokenService;
7
+ protected authS: AuthenticationService;
8
+ private reflector;
9
+ constructor(tokenService: TokenService, authS: AuthenticationService, reflector: Reflector);
10
+ canActivate(context: ExecutionContext): Promise<boolean>;
11
+ private extractTokenFromHeader;
12
+ }
13
+ export declare const IS_PUBLIC_KEY = "isPublic";
14
+ export declare const PublicAuth: () => import("@nestjs/common").CustomDecorator<string>;