@servicelabsco/nestjs-utility-services 1.2.32 → 1.2.33

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 (48) hide show
  1. package/dist/auth/auth.module.js +2 -2
  2. package/dist/auth/auth.module.js.map +1 -1
  3. package/dist/auth/dtos/index.d.ts +1 -0
  4. package/dist/auth/dtos/index.js +1 -0
  5. package/dist/auth/dtos/index.js.map +1 -1
  6. package/dist/auth/dtos/session.identifier.attributes.dto.d.ts +3 -0
  7. package/dist/auth/dtos/session.identifier.attributes.dto.js +8 -0
  8. package/dist/auth/dtos/session.identifier.attributes.dto.js.map +1 -0
  9. package/dist/auth/entities/index.d.ts +1 -0
  10. package/dist/auth/entities/index.js +1 -0
  11. package/dist/auth/entities/index.js.map +1 -1
  12. package/dist/auth/entities/session.identifier.entity.d.ts +10 -0
  13. package/dist/auth/entities/session.identifier.entity.js +44 -0
  14. package/dist/auth/entities/session.identifier.entity.js.map +1 -0
  15. package/dist/auth/es6.classes.d.ts +10 -3
  16. package/dist/auth/es6.classes.js +10 -2
  17. package/dist/auth/es6.classes.js.map +1 -1
  18. package/dist/auth/index.d.ts +2 -0
  19. package/dist/auth/index.js +2 -0
  20. package/dist/auth/index.js.map +1 -1
  21. package/dist/auth/jobs/index.d.ts +1 -0
  22. package/dist/auth/jobs/index.js +18 -0
  23. package/dist/auth/jobs/index.js.map +1 -0
  24. package/dist/auth/jobs/session.identifier.job.d.ts +9 -0
  25. package/dist/auth/jobs/session.identifier.job.js +30 -0
  26. package/dist/auth/jobs/session.identifier.job.js.map +1 -0
  27. package/dist/auth/middlewares/jwt.middleware.js +4 -1
  28. package/dist/auth/middlewares/jwt.middleware.js.map +1 -1
  29. package/dist/auth/services/auth.service.d.ts +3 -0
  30. package/dist/auth/services/auth.service.js +24 -0
  31. package/dist/auth/services/auth.service.js.map +1 -1
  32. package/dist/auth/services/es6.jobs.service.d.ts +8 -0
  33. package/dist/auth/services/es6.jobs.service.js +37 -0
  34. package/dist/auth/services/es6.jobs.service.js.map +1 -0
  35. package/dist/auth/subscribers/index.d.ts +1 -0
  36. package/dist/auth/subscribers/index.js +18 -0
  37. package/dist/auth/subscribers/index.js.map +1 -0
  38. package/dist/auth/subscribers/session.identifier.subscriber.d.ts +12 -0
  39. package/dist/auth/subscribers/session.identifier.subscriber.js +40 -0
  40. package/dist/auth/subscribers/session.identifier.subscriber.js.map +1 -0
  41. package/dist/config/entity.constants.d.ts +2 -0
  42. package/dist/config/entity.constants.js +2 -0
  43. package/dist/config/entity.constants.js.map +1 -1
  44. package/dist/migrations/1701416640317-CreateSessionIdentifierTable.d.ts +5 -0
  45. package/dist/migrations/1701416640317-CreateSessionIdentifierTable.js +21 -0
  46. package/dist/migrations/1701416640317-CreateSessionIdentifierTable.js.map +1 -0
  47. package/dist/tsconfig.build.tsbuildinfo +1 -1
  48. package/package.json +1 -1
@@ -19,8 +19,8 @@ exports.AuthModule = AuthModule;
19
19
  exports.AuthModule = AuthModule = __decorate([
20
20
  (0, common_1.Module)({
21
21
  imports: [typeorm_1.TypeOrmModule.forFeature(es6_classes_1.default.entities), jwt_1.JwtModule.register(jwtConfig), (0, common_1.forwardRef)(() => platform_utility_module_1.PlatformUtilityModule)],
22
- providers: [...es6_classes_1.default.services],
23
- exports: [...es6_classes_1.default.services],
22
+ providers: [...es6_classes_1.default.services, ...es6_classes_1.default.jobs],
23
+ exports: [...es6_classes_1.default.services, ...es6_classes_1.default.jobs],
24
24
  })
25
25
  ], AuthModule);
26
26
  //# sourceMappingURL=auth.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,qCAAwC;AACxC,6CAAgD;AAChD,wFAAmF;AACnF,+CAAuC;AACvC,kDAAmD;AAO5C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IALtB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,qBAAU,CAAC,QAAQ,CAAC,EAAE,eAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC,CAAC;QAChI,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,CAAC;QACnC,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,CAAC;KACpC,CAAC;GACW,UAAU,CAAG"}
1
+ {"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAoD;AACpD,qCAAwC;AACxC,6CAAgD;AAChD,wFAAmF;AACnF,+CAAuC;AACvC,kDAAmD;AAO5C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,gCAAU;qBAAV,UAAU;IALtB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,qBAAU,CAAC,QAAQ,CAAC,EAAE,eAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAA,mBAAU,EAAC,GAAG,EAAE,CAAC,+CAAqB,CAAC,CAAC;QAChI,SAAS,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;QACvD,OAAO,EAAE,CAAC,GAAG,qBAAU,CAAC,QAAQ,EAAE,GAAG,qBAAU,CAAC,IAAI,CAAC;KACxD,CAAC;GACW,UAAU,CAAG"}
@@ -2,6 +2,7 @@ export * from './create.user.dto';
2
2
  export * from './offline.user.dto';
3
3
  export * from './permission.assignment.dto';
4
4
  export * from './role.assignment.dto';
5
+ export * from './session.identifier.attributes.dto';
5
6
  export * from './update.user.dto';
6
7
  export * from './user.access.dto';
7
8
  export * from './user.login.dto';
@@ -18,6 +18,7 @@ __exportStar(require("./create.user.dto"), exports);
18
18
  __exportStar(require("./offline.user.dto"), exports);
19
19
  __exportStar(require("./permission.assignment.dto"), exports);
20
20
  __exportStar(require("./role.assignment.dto"), exports);
21
+ __exportStar(require("./session.identifier.attributes.dto"), exports);
21
22
  __exportStar(require("./update.user.dto"), exports);
22
23
  __exportStar(require("./user.access.dto"), exports);
23
24
  __exportStar(require("./user.login.dto"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAAA,qDAAmC;AAAA,8DAA4C;AAAA,wDAAsC;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,mDAAiC;AAAA,iEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/dtos/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAAA,qDAAmC;AAAA,8DAA4C;AAAA,wDAAsC;AAAA,sEAAoD;AAAA,oDAAkC;AAAA,oDAAkC;AAAA,mDAAiC;AAAA,iEAA8C"}
@@ -0,0 +1,3 @@
1
+ import { CommonAttributesDto } from '../../platformUtility/dtos/common.attributes.dto';
2
+ export declare class SessionIdentifierAttributesDto extends CommonAttributesDto {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SessionIdentifierAttributesDto = void 0;
4
+ const common_attributes_dto_1 = require("../../platformUtility/dtos/common.attributes.dto");
5
+ class SessionIdentifierAttributesDto extends common_attributes_dto_1.CommonAttributesDto {
6
+ }
7
+ exports.SessionIdentifierAttributesDto = SessionIdentifierAttributesDto;
8
+ //# sourceMappingURL=session.identifier.attributes.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.identifier.attributes.dto.js","sourceRoot":"","sources":["../../../src/auth/dtos/session.identifier.attributes.dto.ts"],"names":[],"mappings":";;;AAAA,4FAAuF;AAEvF,MAAa,8BAA+B,SAAQ,2CAAmB;CAAG;AAA1E,wEAA0E"}
@@ -2,5 +2,6 @@ export * from './country.entity';
2
2
  export * from './creator.entity';
3
3
  export * from './device.token.entity';
4
4
  export * from './refresh.token.entity';
5
+ export * from './session.identifier.entity';
5
6
  export * from './user.entity';
6
7
  export * from './user.referral.entity';
@@ -18,6 +18,7 @@ __exportStar(require("./country.entity"), exports);
18
18
  __exportStar(require("./creator.entity"), exports);
19
19
  __exportStar(require("./device.token.entity"), exports);
20
20
  __exportStar(require("./refresh.token.entity"), exports);
21
+ __exportStar(require("./session.identifier.entity"), exports);
21
22
  __exportStar(require("./user.entity"), exports);
22
23
  __exportStar(require("./user.referral.entity"), exports);
23
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AAAA,mDAAiC;AAAA,wDAAsC;AAAA,yDAAuC;AAAA,gDAA8B;AAAA,yDAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AAAA,mDAAiC;AAAA,wDAAsC;AAAA,yDAAuC;AAAA,8DAA4C;AAAA,gDAA8B;AAAA,yDAAsC"}
@@ -0,0 +1,10 @@
1
+ import { CommonEntity } from '../../common/libraries/common.entity';
2
+ import { SessionIdentifierAttributesDto } from '../dtos/session.identifier.attributes.dto';
3
+ import { UserEntity } from './user.entity';
4
+ export declare class SessionIdentifierEntity extends CommonEntity {
5
+ user_id: number;
6
+ identifier: string;
7
+ revoked_at: Date;
8
+ attributes: SessionIdentifierAttributesDto;
9
+ user: UserEntity;
10
+ }
@@ -0,0 +1,44 @@
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.SessionIdentifierEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const common_entity_1 = require("../../common/libraries/common.entity");
15
+ const session_identifier_attributes_dto_1 = require("../dtos/session.identifier.attributes.dto");
16
+ const user_entity_1 = require("./user.entity");
17
+ let SessionIdentifierEntity = class SessionIdentifierEntity extends common_entity_1.CommonEntity {
18
+ };
19
+ exports.SessionIdentifierEntity = SessionIdentifierEntity;
20
+ __decorate([
21
+ (0, typeorm_1.Column)(),
22
+ __metadata("design:type", Number)
23
+ ], SessionIdentifierEntity.prototype, "user_id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)(),
26
+ __metadata("design:type", String)
27
+ ], SessionIdentifierEntity.prototype, "identifier", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.Column)(),
30
+ __metadata("design:type", Date)
31
+ ], SessionIdentifierEntity.prototype, "revoked_at", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)('json'),
34
+ __metadata("design:type", session_identifier_attributes_dto_1.SessionIdentifierAttributesDto)
35
+ ], SessionIdentifierEntity.prototype, "attributes", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.ManyToOne)(() => user_entity_1.UserEntity),
38
+ (0, typeorm_1.JoinColumn)({ name: 'user_id' }),
39
+ __metadata("design:type", user_entity_1.UserEntity)
40
+ ], SessionIdentifierEntity.prototype, "user", void 0);
41
+ exports.SessionIdentifierEntity = SessionIdentifierEntity = __decorate([
42
+ (0, typeorm_1.Entity)('sys_session_identifiers')
43
+ ], SessionIdentifierEntity);
44
+ //# sourceMappingURL=session.identifier.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.identifier.entity.js","sourceRoot":"","sources":["../../../src/auth/entities/session.identifier.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgE;AAChE,wEAAoE;AACpE,iGAA2F;AAC3F,+CAA2C;AASpC,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,4BAAY;CAexD,CAAA;AAfY,0DAAuB;AAEhC;IADC,IAAA,gBAAM,GAAE;;wDACO;AAGhB;IADC,IAAA,gBAAM,GAAE;;2DACU;AAGnB;IADC,IAAA,gBAAM,GAAE;8BACG,IAAI;2DAAC;AAGjB;IADC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACH,kEAA8B;2DAAC;AAGmB;IAA7D,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wBAAU,CAAC;IAAE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8BAAO,wBAAU;qDAAC;kCAdtE,uBAAuB;IADnC,IAAA,gBAAM,EAAC,yBAAyB,CAAC;GACrB,uBAAuB,CAenC"}
@@ -5,6 +5,7 @@ import { CreateUserDto } from './dtos/create.user.dto';
5
5
  import { OfflineUserDto } from './dtos/offline.user.dto';
6
6
  import { PermissionAssignmentDto } from './dtos/permission.assignment.dto';
7
7
  import { RoleAssignmentDto } from './dtos/role.assignment.dto';
8
+ import { SessionIdentifierAttributesDto } from './dtos/session.identifier.attributes.dto';
8
9
  import { UpdateUserDto } from './dtos/update.user.dto';
9
10
  import { UserLoginDto } from './dtos/user.login.dto';
10
11
  import { UserRolesAccessObjectDto } from './dtos/user.roles.access.object.dto';
@@ -12,7 +13,9 @@ import { CountryEntity } from './entities/country.entity';
12
13
  import { CreatorEntity } from './entities/creator.entity';
13
14
  import { DeviceTokenEntity } from './entities/device.token.entity';
14
15
  import { RefreshTokenEntity } from './entities/refresh.token.entity';
16
+ import { SessionIdentifierEntity } from './entities/session.identifier.entity';
15
17
  import { UserReferralEntity } from './entities/user.referral.entity';
18
+ import { SessionIdentifierJob } from './jobs/session.identifier.job';
16
19
  import { BasicAuthMiddleware } from './middlewares/basic.auth.middleware';
17
20
  import { ClientConnectMiddleware } from './middlewares/client.connect.middleware';
18
21
  import { InternalMiddleware } from './middlewares/internal.middleware';
@@ -21,15 +24,19 @@ import { RestrictedMiddleware } from './middlewares/restricted.middleware';
21
24
  import { AccessManager } from './services/access.manager';
22
25
  import { AuthService } from './services/auth.service';
23
26
  import { DeviceTokenService } from './services/device.token.service';
27
+ import { Es6JobsService } from './services/es6.jobs.service';
24
28
  import { Es6Service } from './services/es6.service';
25
29
  import { RefreshTokenService } from './services/refresh.token.service';
26
30
  import { SocialService } from './services/social.service';
27
31
  import { UserService } from './services/user.service';
32
+ import { SessionIdentifierSubscriber } from './subscribers/session.identifier.subscriber';
28
33
  declare const es6Classes: {
29
34
  controllers: (typeof AdminAuthController | typeof SocialController | typeof UserController)[];
30
- dtos: (typeof UserRolesAccessObjectDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UserLoginDto | typeof CreateUserDto | typeof OfflineUserDto | typeof UpdateUserDto)[];
31
- entities: (typeof CreatorEntity | typeof CountryEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity)[];
35
+ dtos: (typeof UserRolesAccessObjectDto | typeof SessionIdentifierAttributesDto | typeof PermissionAssignmentDto | typeof RoleAssignmentDto | typeof UserLoginDto | typeof CreateUserDto | typeof OfflineUserDto | typeof UpdateUserDto)[];
36
+ entities: (typeof CreatorEntity | typeof CountryEntity | typeof UserReferralEntity | typeof DeviceTokenEntity | typeof RefreshTokenEntity | typeof SessionIdentifierEntity)[];
37
+ jobs: (typeof SessionIdentifierJob)[];
32
38
  middlewares: (typeof BasicAuthMiddleware | typeof ClientConnectMiddleware | typeof InternalMiddleware | typeof JwtMiddleware | typeof RestrictedMiddleware)[];
33
- services: (typeof AccessManager | typeof RefreshTokenService | typeof UserService | typeof AuthService | typeof DeviceTokenService | typeof SocialService | typeof Es6Service)[];
39
+ services: (typeof AccessManager | typeof RefreshTokenService | typeof UserService | typeof AuthService | typeof DeviceTokenService | typeof SocialService | typeof Es6JobsService | typeof Es6Service)[];
40
+ subscribers: (typeof SessionIdentifierSubscriber)[];
34
41
  };
35
42
  export default es6Classes;
@@ -7,6 +7,7 @@ const create_user_dto_1 = require("./dtos/create.user.dto");
7
7
  const offline_user_dto_1 = require("./dtos/offline.user.dto");
8
8
  const permission_assignment_dto_1 = require("./dtos/permission.assignment.dto");
9
9
  const role_assignment_dto_1 = require("./dtos/role.assignment.dto");
10
+ const session_identifier_attributes_dto_1 = require("./dtos/session.identifier.attributes.dto");
10
11
  const update_user_dto_1 = require("./dtos/update.user.dto");
11
12
  const user_access_dto_1 = require("./dtos/user.access.dto");
12
13
  const user_login_dto_1 = require("./dtos/user.login.dto");
@@ -15,8 +16,10 @@ const country_entity_1 = require("./entities/country.entity");
15
16
  const creator_entity_1 = require("./entities/creator.entity");
16
17
  const device_token_entity_1 = require("./entities/device.token.entity");
17
18
  const refresh_token_entity_1 = require("./entities/refresh.token.entity");
19
+ const session_identifier_entity_1 = require("./entities/session.identifier.entity");
18
20
  const user_entity_1 = require("./entities/user.entity");
19
21
  const user_referral_entity_1 = require("./entities/user.referral.entity");
22
+ const session_identifier_job_1 = require("./jobs/session.identifier.job");
20
23
  const basic_auth_middleware_1 = require("./middlewares/basic.auth.middleware");
21
24
  const client_connect_middleware_1 = require("./middlewares/client.connect.middleware");
22
25
  const internal_middleware_1 = require("./middlewares/internal.middleware");
@@ -25,10 +28,12 @@ const restricted_middleware_1 = require("./middlewares/restricted.middleware");
25
28
  const access_manager_1 = require("./services/access.manager");
26
29
  const auth_service_1 = require("./services/auth.service");
27
30
  const device_token_service_1 = require("./services/device.token.service");
31
+ const es6_jobs_service_1 = require("./services/es6.jobs.service");
28
32
  const es6_service_1 = require("./services/es6.service");
29
33
  const refresh_token_service_1 = require("./services/refresh.token.service");
30
34
  const social_service_1 = require("./services/social.service");
31
35
  const user_service_1 = require("./services/user.service");
36
+ const session_identifier_subscriber_1 = require("./subscribers/session.identifier.subscriber");
32
37
  const es6Classes = {
33
38
  controllers: [admin_auth_controller_1.AdminAuthController, social_controller_1.SocialController, user_controller_1.UserController],
34
39
  dtos: [
@@ -36,14 +41,17 @@ const es6Classes = {
36
41
  offline_user_dto_1.OfflineUserDto,
37
42
  permission_assignment_dto_1.PermissionAssignmentDto,
38
43
  role_assignment_dto_1.RoleAssignmentDto,
44
+ session_identifier_attributes_dto_1.SessionIdentifierAttributesDto,
39
45
  update_user_dto_1.UpdateUserDto,
40
46
  user_access_dto_1.UserAccessDto,
41
47
  user_login_dto_1.UserLoginDto,
42
48
  user_roles_access_object_dto_1.UserRolesAccessObjectDto,
43
49
  ],
44
- entities: [country_entity_1.CountryEntity, creator_entity_1.CreatorEntity, device_token_entity_1.DeviceTokenEntity, refresh_token_entity_1.RefreshTokenEntity, user_entity_1.UserEntity, user_referral_entity_1.UserReferralEntity],
50
+ entities: [country_entity_1.CountryEntity, creator_entity_1.CreatorEntity, device_token_entity_1.DeviceTokenEntity, refresh_token_entity_1.RefreshTokenEntity, session_identifier_entity_1.SessionIdentifierEntity, user_entity_1.UserEntity, user_referral_entity_1.UserReferralEntity],
51
+ jobs: [session_identifier_job_1.SessionIdentifierJob],
45
52
  middlewares: [basic_auth_middleware_1.BasicAuthMiddleware, client_connect_middleware_1.ClientConnectMiddleware, internal_middleware_1.InternalMiddleware, jwt_middleware_1.JwtMiddleware, restricted_middleware_1.RestrictedMiddleware],
46
- services: [access_manager_1.AccessManager, auth_service_1.AuthService, device_token_service_1.DeviceTokenService, es6_service_1.Es6Service, refresh_token_service_1.RefreshTokenService, social_service_1.SocialService, user_service_1.UserService],
53
+ services: [access_manager_1.AccessManager, auth_service_1.AuthService, device_token_service_1.DeviceTokenService, es6_jobs_service_1.Es6JobsService, es6_service_1.Es6Service, refresh_token_service_1.RefreshTokenService, social_service_1.SocialService, user_service_1.UserService],
54
+ subscribers: [session_identifier_subscriber_1.SessionIdentifierSubscriber],
47
55
  };
48
56
  exports.default = es6Classes;
49
57
  //# sourceMappingURL=es6.classes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"es6.classes.js","sourceRoot":"","sources":["../../src/auth/es6.classes.ts"],"names":[],"mappings":";;AAAA,+EAA0E;AAC1E,uEAAmE;AACnE,mEAA+D;AAC/D,4DAAuD;AACvD,8DAAyD;AACzD,gFAA2E;AAC3E,oEAA+D;AAC/D,4DAAuD;AACvD,4DAAuD;AACvD,0DAAqD;AACrD,sFAA+E;AAC/E,8DAA0D;AAC1D,8DAA0D;AAC1D,wEAAmE;AACnE,0EAAqE;AACrE,wDAAoD;AACpD,0EAAqE;AACrE,+EAA0E;AAC1E,uFAAkF;AAClF,2EAAuE;AACvE,iEAA6D;AAC7D,+EAA2E;AAC3E,8DAA0D;AAC1D,0DAAsD;AACtD,0EAAqE;AACrE,wDAAoD;AACpD,4EAAuE;AACvE,8DAA0D;AAC1D,0DAAsD;AAEtD,MAAM,UAAU,GAAG;IACf,WAAW,EAAE,CAAC,2CAAmB,EAAE,oCAAgB,EAAE,gCAAc,CAAC;IACpE,IAAI,EAAE;QACF,+BAAa;QACb,iCAAc;QACd,mDAAuB;QACvB,uCAAiB;QACjB,+BAAa;QACb,+BAAa;QACb,6BAAY;QACZ,uDAAwB;KAC3B;IACD,QAAQ,EAAE,CAAC,8BAAa,EAAE,8BAAa,EAAE,uCAAiB,EAAE,yCAAkB,EAAE,wBAAU,EAAE,yCAAkB,CAAC;IAC/G,WAAW,EAAE,CAAC,2CAAmB,EAAE,mDAAuB,EAAE,wCAAkB,EAAE,8BAAa,EAAE,4CAAoB,CAAC;IACpH,QAAQ,EAAE,CAAC,8BAAa,EAAE,0BAAW,EAAE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,EAAE,yCAAkB,EAAE,iCAAc,EAAE,wBAAU,EAAE,2CAAmB,EAAE,8BAAa,EAAE,0BAAW,CAAC;IACvI,WAAW,EAAE,CAAC,2DAA2B,CAAC;CAC7C,CAAC;AAEF,kBAAe,UAAU,CAAC"}
@@ -1,6 +1,8 @@
1
1
  export * from './controllers';
2
2
  export * from './dtos';
3
3
  export * from './entities';
4
+ export * from './jobs';
4
5
  export * from './middlewares';
5
6
  export * from './services';
7
+ export * from './subscribers';
6
8
  export * from './auth.module';
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./controllers"), exports);
18
18
  __exportStar(require("./dtos"), exports);
19
19
  __exportStar(require("./entities"), exports);
20
+ __exportStar(require("./jobs"), exports);
20
21
  __exportStar(require("./middlewares"), exports);
21
22
  __exportStar(require("./services"), exports);
23
+ __exportStar(require("./subscribers"), exports);
22
24
  __exportStar(require("./auth.module"), exports);
23
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAAA,yCAAuB;AAAA,6CAA2B;AAAA,gDAA8B;AAAA,6CAA2B;AAAA,gDAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAAA,yCAAuB;AAAA,6CAA2B;AAAA,yCAAuB;AAAA,gDAA8B;AAAA,6CAA2B;AAAA,gDAA8B;AAAA,gDAA6B"}
@@ -0,0 +1 @@
1
+ export * from './session.identifier.job';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./session.identifier.job"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/jobs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAwC"}
@@ -0,0 +1,9 @@
1
+ import { DatabaseEventDto } from '../../common/dtos/database.event.dto';
2
+ import { CommonJob } from '../../common/libraries/common.job';
3
+ import { QueueService } from '../../platformUtility/services/queue.service';
4
+ import { SessionIdentifierEntity } from '../entities/session.identifier.entity';
5
+ export declare class SessionIdentifierJob extends CommonJob {
6
+ protected readonly queueService: QueueService;
7
+ constructor(queueService: QueueService);
8
+ handle(evt: DatabaseEventDto<SessionIdentifierEntity>): Promise<SessionIdentifierEntity>;
9
+ }
@@ -0,0 +1,30 @@
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.SessionIdentifierJob = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const common_job_1 = require("../../common/libraries/common.job");
15
+ const queue_service_1 = require("../../platformUtility/services/queue.service");
16
+ let SessionIdentifierJob = class SessionIdentifierJob extends common_job_1.CommonJob {
17
+ constructor(queueService) {
18
+ super('29692aaae7ba9e4217568e6c4ba3b36c');
19
+ this.queueService = queueService;
20
+ }
21
+ async handle(evt) {
22
+ return evt.entity;
23
+ }
24
+ };
25
+ exports.SessionIdentifierJob = SessionIdentifierJob;
26
+ exports.SessionIdentifierJob = SessionIdentifierJob = __decorate([
27
+ (0, common_1.Injectable)(),
28
+ __metadata("design:paramtypes", [queue_service_1.QueueService])
29
+ ], SessionIdentifierJob);
30
+ //# sourceMappingURL=session.identifier.job.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.identifier.job.js","sourceRoot":"","sources":["../../../src/auth/jobs/session.identifier.job.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,kEAA8D;AAC9D,gFAA4E;AAGrE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,sBAAS;IAC/C,YAA+B,YAA0B;QACrD,KAAK,CAAC,kCAAkC,CAAC,CAAC;QADf,iBAAY,GAAZ,YAAY,CAAc;IAEzD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,GAA8C;QACvD,OAAO,GAAG,CAAC,MAAM,CAAC;IACtB,CAAC;CACJ,CAAA;AAPY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;qCAEoC,4BAAY;GADhD,oBAAoB,CAOhC"}
@@ -14,8 +14,8 @@ const common_1 = require("@nestjs/common");
14
14
  const parse_bearer_token_1 = require("parse-bearer-token");
15
15
  const operation_exception_1 = require("../../common/exceptions/operation.exception");
16
16
  const auth_1 = require("../../common/libraries/auth");
17
- const auth_service_1 = require("../services/auth.service");
18
17
  const platform_utility_1 = require("../../common/libraries/platform.utility");
18
+ const auth_service_1 = require("../services/auth.service");
19
19
  let JwtMiddleware = class JwtMiddleware {
20
20
  constructor(authService) {
21
21
  this.authService = authService;
@@ -33,6 +33,9 @@ let JwtMiddleware = class JwtMiddleware {
33
33
  const accessObject = await this.authService.getUserObject(auth.id);
34
34
  if (this.authService.isUserBlocked(accessObject))
35
35
  throw new operation_exception_1.OperationException('This user is blocked from the platform');
36
+ const isAllowed = await this.authService.validateSession(auth);
37
+ if (!isAllowed)
38
+ throw new operation_exception_1.OperationException('This session is not valid');
36
39
  auth_1.Auth.login({ ...accessObject, ...auth, req: { ip } });
37
40
  next();
38
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jwt.middleware.js","sourceRoot":"","sources":["../../../src/auth/middlewares/jwt.middleware.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4D;AAE5D,2DAAkD;AAClD,qFAAiF;AACjF,sDAAmD;AACnD,2DAAuD;AACvD,8EAA0E;AASnE,IAAM,aAAa,GAAnB,MAAM,aAAa;IAMtB,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAazD,KAAK,CAAC,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAc;QACjD,MAAM,EAAE,GAAG,kCAAe,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAGjD,IAAI,WAAI,CAAC,KAAK,EAAE;YAAE,OAAO,IAAI,EAAE,CAAC;QAEhC,MAAM,KAAK,GAAG,IAAA,4BAAgB,EAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,EAAE,CAAC;QAE1B,MAAM,IAAI,GAAQ,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAEvD,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,EAAE,CAAC;QAEzB,MAAM,YAAY,GAAQ,MAAM,IAAI,CAAC,WAA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O,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AAhEY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAOiC,0BAAW;GAN5C,aAAa,CAgEzB"}
@@ -1,5 +1,6 @@
1
1
  import { JwtService } from '@nestjs/jwt';
2
2
  import { UserAccessDto } from '../dtos/user.access.dto';
3
+ import { SessionIdentifierEntity } from '../entities/session.identifier.entity';
3
4
  import { UserEntity } from '../entities/user.entity';
4
5
  import { RefreshTokenService } from './refresh.token.service';
5
6
  import { UserService } from './user.service';
@@ -15,4 +16,6 @@ export declare class AuthService {
15
16
  verifyJwtToken(token: any): Promise<any>;
16
17
  getUserObject(id: number): Promise<UserAccessDto>;
17
18
  isUserBlocked(user: UserEntity): boolean;
19
+ validateSession(auth: any): Promise<boolean>;
20
+ revokeSession(): Promise<SessionIdentifierEntity>;
18
21
  }
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AuthService = void 0;
13
13
  const common_1 = require("@nestjs/common");
14
14
  const jwt_1 = require("@nestjs/jwt");
15
+ const auth_1 = require("../../common/libraries/auth");
16
+ const session_identifier_entity_1 = require("../entities/session.identifier.entity");
15
17
  const user_entity_1 = require("../entities/user.entity");
16
18
  const refresh_token_service_1 = require("./refresh.token.service");
17
19
  const user_service_1 = require("./user.service");
@@ -67,6 +69,28 @@ let AuthService = class AuthService {
67
69
  isUserBlocked(user) {
68
70
  return user?.attributes?.blocked;
69
71
  }
72
+ async validateSession(auth) {
73
+ const identifier = auth?.auth_attributes?.session_identifier;
74
+ if (!identifier)
75
+ return true;
76
+ const r = await session_identifier_entity_1.SessionIdentifierEntity.findOne({ where: { id: auth.id, identifier } });
77
+ if (r && r.revoked_at)
78
+ return false;
79
+ return true;
80
+ }
81
+ async revokeSession() {
82
+ const auth = auth_1.Auth.user();
83
+ const identifier = auth?.auth_attributes?.session_identifier;
84
+ if (!identifier)
85
+ return;
86
+ const r = await session_identifier_entity_1.SessionIdentifierEntity.findOne({ where: { user_id: auth.id, identifier } });
87
+ if (!r)
88
+ return;
89
+ if (r.revoked_at)
90
+ return;
91
+ r.revoked_at = new Date();
92
+ return r.save();
93
+ }
70
94
  };
71
95
  exports.AuthService = AuthService;
72
96
  exports.AuthService = AuthService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../src/auth/services/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qCAAyC;AAEzC,yDAAqD;AACrD,mEAA8D;AAC9D,iDAA6C;AAOtC,IAAM,WAAW,GAAjB,MAAM,WAAW;IAMpB,YACqB,UAAsB,EACtB,mBAAwC,EACxC,WAAwB;QAFxB,eAAU,GAAV,UAAU,CAAY;QACtB,wBAAmB,GAAnB,mBAAmB,CAAqB;QACxC,gBAAW,GAAX,WAAW,CAAa;IAC1C,CAAC;IAQJ,KAAK,CAAC,gBAAgB,CAAC,IAAS,EAAE,GAAQ;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAE1C,IAAI,gBAAgB,GAAW,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAGlE,IAAI,CAAC,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,MAAM,KAAK,EAAE,CAAC,EAAE,CAAC;YACxD,gBAAgB,GAAG,IAAI,CAAC;QAC5B,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAErF,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC;QAEjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAQD,KAAK,CAAC,WAAW,CAAC,IAAS;QACvB,MAAM,IAAI,GAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,YAAY,GAA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BAAW;GATpC,WAAW,CA0JvB"}
@@ -0,0 +1,8 @@
1
+ import { SessionIdentifierJob } from '../jobs/session.identifier.job';
2
+ export declare class Es6JobsService {
3
+ private readonly sessionIdentifierJob;
4
+ private jobs;
5
+ constructor(sessionIdentifierJob: SessionIdentifierJob);
6
+ alignJobs(): void;
7
+ setJobs(): void;
8
+ }
@@ -0,0 +1,37 @@
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.Es6JobsService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const session_identifier_job_1 = require("../jobs/session.identifier.job");
15
+ const platform_utility_1 = require("../../common/libraries/platform.utility");
16
+ let Es6JobsService = class Es6JobsService {
17
+ constructor(sessionIdentifierJob) {
18
+ this.sessionIdentifierJob = sessionIdentifierJob;
19
+ this.jobs = {};
20
+ this.alignJobs();
21
+ this.setJobs();
22
+ }
23
+ alignJobs() {
24
+ this.jobs = {
25
+ '29692aaae7ba9e4217568e6c4ba3b36c': this.sessionIdentifierJob,
26
+ };
27
+ }
28
+ setJobs() {
29
+ platform_utility_1.PlatformUtility.setJobs(this.jobs);
30
+ }
31
+ };
32
+ exports.Es6JobsService = Es6JobsService;
33
+ exports.Es6JobsService = Es6JobsService = __decorate([
34
+ (0, common_1.Injectable)(),
35
+ __metadata("design:paramtypes", [session_identifier_job_1.SessionIdentifierJob])
36
+ ], Es6JobsService);
37
+ //# sourceMappingURL=es6.jobs.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"es6.jobs.service.js","sourceRoot":"","sources":["../../../src/auth/services/es6.jobs.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2EAAsE;AACtE,8EAA0E;AAQnE,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,YAA6B,oBAA0C;QAA1C,yBAAoB,GAApB,oBAAoB,CAAsB;QAF/D,SAAI,GAAG,EAAE,CAAC;QAGd,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,IAAI,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;IAMD,SAAS;QACL,IAAI,CAAC,IAAI,GAAG;YACR,kCAAkC,EAAE,IAAI,CAAC,oBAAoB;SAChE,CAAC;IACN,CAAC;IAMD,OAAO;QACH,kCAAe,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;CACJ,CAAA;AAzBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAI0C,6CAAoB;GAH9D,cAAc,CAyB1B"}
@@ -0,0 +1 @@
1
+ export * from './session.identifier.subscriber';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./session.identifier.subscriber"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/subscribers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAA+C"}
@@ -0,0 +1,12 @@
1
+ import { DataSource, InsertEvent, UpdateEvent } from 'typeorm';
2
+ import { CommonSubscriber } from '../../common/libraries/common.subscriber';
3
+ import { SessionIdentifierEntity } from '../entities/session.identifier.entity';
4
+ import { SessionIdentifierJob } from '../jobs/session.identifier.job';
5
+ export declare class SessionIdentifierSubscriber extends CommonSubscriber<SessionIdentifierEntity> {
6
+ private readonly dataSource;
7
+ private readonly sessionIdentifierJob;
8
+ constructor(dataSource: DataSource, sessionIdentifierJob: SessionIdentifierJob);
9
+ listenTo(): typeof SessionIdentifierEntity;
10
+ afterInsert(evt: InsertEvent<SessionIdentifierEntity>): Promise<void>;
11
+ afterUpdate(evt: UpdateEvent<SessionIdentifierEntity>): Promise<void>;
12
+ }
@@ -0,0 +1,40 @@
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.SessionIdentifierSubscriber = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const common_subscriber_1 = require("../../common/libraries/common.subscriber");
15
+ const session_identifier_entity_1 = require("../entities/session.identifier.entity");
16
+ const session_identifier_job_1 = require("../jobs/session.identifier.job");
17
+ let SessionIdentifierSubscriber = class SessionIdentifierSubscriber extends common_subscriber_1.CommonSubscriber {
18
+ constructor(dataSource, sessionIdentifierJob) {
19
+ super();
20
+ this.dataSource = dataSource;
21
+ this.sessionIdentifierJob = sessionIdentifierJob;
22
+ dataSource.subscribers.push(this);
23
+ }
24
+ listenTo() {
25
+ return session_identifier_entity_1.SessionIdentifierEntity;
26
+ }
27
+ async afterInsert(evt) {
28
+ await this.sessionIdentifierJob.delayedDispatch(this.getEventData(evt));
29
+ }
30
+ async afterUpdate(evt) {
31
+ await this.sessionIdentifierJob.delayedDispatch(this.getEventData(evt));
32
+ }
33
+ };
34
+ exports.SessionIdentifierSubscriber = SessionIdentifierSubscriber;
35
+ exports.SessionIdentifierSubscriber = SessionIdentifierSubscriber = __decorate([
36
+ (0, typeorm_1.EventSubscriber)(),
37
+ __metadata("design:paramtypes", [typeorm_1.DataSource,
38
+ session_identifier_job_1.SessionIdentifierJob])
39
+ ], SessionIdentifierSubscriber);
40
+ //# sourceMappingURL=session.identifier.subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.identifier.subscriber.js","sourceRoot":"","sources":["../../../src/auth/subscribers/session.identifier.subscriber.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAgF;AAChF,gFAA4E;AAC5E,qFAAgF;AAChF,2EAAsE;AAG/D,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,oCAAyC;IACtF,YACqB,UAAsB,EACtB,oBAA0C;QAE3D,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,yBAAoB,GAApB,oBAAoB,CAAsB;QAG3D,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,QAAQ;QACJ,OAAO,mDAAuB,CAAC;IACnC,CAAC;IACD,KAAK,CAAC,WAAW,CAAC,GAAyC;QACvD,MAAM,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,GAAyC;QACvD,MAAM,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5E,CAAC;CACJ,CAAA;AAlBY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,yBAAe,GAAE;qCAGmB,oBAAU;QACA,6CAAoB;GAHtD,2BAA2B,CAkBvC"}
@@ -2,6 +2,7 @@ import { CountryEntity } from '../auth/entities/country.entity';
2
2
  import { CreatorEntity } from '../auth/entities/creator.entity';
3
3
  import { DeviceTokenEntity } from '../auth/entities/device.token.entity';
4
4
  import { RefreshTokenEntity } from '../auth/entities/refresh.token.entity';
5
+ import { SessionIdentifierEntity } from '../auth/entities/session.identifier.entity';
5
6
  import { UserEntity } from '../auth/entities/user.entity';
6
7
  import { UserReferralEntity } from '../auth/entities/user.referral.entity';
7
8
  import { FailedBullJobEntity } from '../platformUtility/entities/failed.bull.job.entity';
@@ -77,6 +78,7 @@ declare const entityConstants: {
77
78
  '4a3c55afec159ad19c6e4f8fe5f4fae7': typeof CreatorEntity;
78
79
  '559f2b9277cc72f0985a73ef387ea4c8': typeof DeviceTokenEntity;
79
80
  '2737fb0e36a5f58a7a4d5772b2dc1a01': typeof RefreshTokenEntity;
81
+ '0fd84e6925157d56ff9a0df37e77244e': typeof SessionIdentifierEntity;
80
82
  ee4cdbfefe411a0f75b7c5daddf210ba: typeof UserEntity;
81
83
  bbf64c9ab49677db1a8303711d5be8d7: typeof UserReferralEntity;
82
84
  '2d501bb4f3a993415483bef5c4651cb6': typeof FailedBullJobEntity;