@ubs-platform/users-mona-microservice-helper 3.0.9-beta → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,9 +5,9 @@ const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
6
  const microservices_1 = require("@nestjs/microservices");
7
7
  const backend_jwt_utils_exports_module_1 = require("./backend-jwt-utils-exports.module");
8
- const communication_handler_1 = require("./guards/communication-handler");
9
8
  const jwt_strategy_1 = require("./strategies/jwt.strategy");
10
9
  const user_service_1 = require("./service/user.service");
10
+ const nest_microservice_setup_util_1 = require("@ubs-platform/nest-microservice-setup-util");
11
11
  const entity_ownership_service_1 = require("./service/entity-ownership.service");
12
12
  // import { JwtStrategy } from './strategies/jwt.strategy';
13
13
  exports.INTERNAL_COMMUNICATION = {
@@ -20,20 +20,12 @@ exports.BackendJwtUtilsModule = BackendJwtUtilsModule;
20
20
  exports.BackendJwtUtilsModule = BackendJwtUtilsModule = tslib_1.__decorate([
21
21
  (0, common_1.Module)({
22
22
  controllers: [],
23
- providers: [
24
- communication_handler_1.CommunicationHelper,
25
- jwt_strategy_1.JwtStrategy,
26
- user_service_1.UserService,
27
- entity_ownership_service_1.EntityOwnershipService,
28
- ],
23
+ providers: [jwt_strategy_1.JwtStrategy, user_service_1.UserService, entity_ownership_service_1.EntityOwnershipService],
29
24
  exports: [user_service_1.UserService, entity_ownership_service_1.EntityOwnershipService],
30
25
  imports: [
31
26
  ...backend_jwt_utils_exports_module_1.BackendJwtUtilsExportModule,
32
27
  microservices_1.ClientsModule.register([
33
- // {
34
- // name: 'KAFKA_CLIENT',
35
- // ...getMicroserviceConnection(''),
36
- // } as any,
28
+ Object.assign({ name: 'KAFKA_CLIENT' }, (0, nest_microservice_setup_util_1.getMicroserviceConnection)('')),
37
29
  {
38
30
  name: 'USER_MICROSERVICE',
39
31
  transport: microservices_1.Transport.TCP,
@@ -1 +1 @@
1
- {"version":3,"file":"backend-jwt-utils.module.js","sourceRoot":"","sources":["../../src/lib/backend-jwt-utils.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,yDAAiE;AACjE,yFAAiF;AACjF,0EAAqE;AACrE,4DAAwD;AACxD,yDAAqD;AAErD,iFAA4E;AAC5E,2DAA2D;AAC9C,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,IAAI,GAAG,CAAC;IACpE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;CACpD,CAAC;AA6BK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IA3BjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE;YACT,2CAAmB;YACnB,0BAAW;YACX,0BAAW;YACX,iDAAsB;SACvB;QACD,OAAO,EAAE,CAAC,0BAAW,EAAE,iDAAsB,CAAC;QAC9C,OAAO,EAAE;YACP,GAAG,8DAA2B;YAC9B,6BAAa,CAAC,QAAQ,CAAC;gBACrB,IAAI;gBACJ,0BAA0B;gBAC1B,sCAAsC;gBACtC,YAAY;gBACZ;oBACE,IAAI,EAAE,mBAAmB;oBACzB,SAAS,EAAE,yBAAS,CAAC,GAAG;oBACxB,OAAO,EAAE;wBACP,IAAI,EAAE,8BAAsB,CAAC,IAAI;wBACjC,IAAI,EAAE,8BAAsB,CAAC,IAAI;qBAClC;iBACF;aACF,CAAC;SACH;KACF,CAAC;GACW,qBAAqB,CAAG"}
1
+ {"version":3,"file":"backend-jwt-utils.module.js","sourceRoot":"","sources":["../../src/lib/backend-jwt-utils.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwC;AACxC,yDAAiE;AACjE,yFAAiF;AACjF,4DAAwD;AACxD,yDAAqD;AACrD,6FAAuF;AACvF,iFAA4E;AAC5E,2DAA2D;AAC9C,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,IAAI,GAAG,CAAC;IACpE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC;CACpD,CAAC;AAyBK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAvBjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,0BAAW,EAAE,0BAAW,EAAE,iDAAsB,CAAC;QAC7D,OAAO,EAAE,CAAC,0BAAW,EAAE,iDAAsB,CAAC;QAC9C,OAAO,EAAE;YACP,GAAG,8DAA2B;YAE9B,6BAAa,CAAC,QAAQ,CAAC;gBACrB,gBACE,IAAI,EAAE,cAAc,IACjB,IAAA,wDAAyB,EAAC,EAAE,CAAC,CAC1B;gBACR;oBACE,IAAI,EAAE,mBAAmB;oBACzB,SAAS,EAAE,yBAAS,CAAC,GAAG;oBACxB,OAAO,EAAE;wBACP,IAAI,EAAE,8BAAsB,CAAC,IAAI;wBACjC,IAAI,EAAE,8BAAsB,CAAC,IAAI;qBAClC;iBACF;aACF,CAAC;SACH;KACF,CAAC;GACW,qBAAqB,CAAG"}
@@ -4,7 +4,8 @@ import { EntityOwnershipDTO, EntityOwnershipInsertCapabiltyDTO, EntityOwnershipU
4
4
  import { Observable } from 'rxjs';
5
5
  export declare class EntityOwnershipService implements OnModuleInit {
6
6
  private userClient;
7
- constructor(userClient: ClientProxy | ClientKafka | ClientRMQ);
7
+ private kafkaClient;
8
+ constructor(userClient: ClientProxy | ClientKafka | ClientRMQ, kafkaClient: ClientProxy | ClientKafka | ClientRMQ);
8
9
  onModuleInit(): void;
9
10
  insertOwnership(oe: EntityOwnershipDTO): Promise<void>;
10
11
  insertUserCapability(oe: EntityOwnershipInsertCapabiltyDTO): Promise<void>;
@@ -4,20 +4,21 @@ exports.EntityOwnershipService = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@nestjs/common");
6
6
  let EntityOwnershipService = class EntityOwnershipService {
7
- constructor(userClient) {
7
+ constructor(userClient, kafkaClient) {
8
8
  this.userClient = userClient;
9
+ this.kafkaClient = kafkaClient;
9
10
  }
10
11
  onModuleInit() {
11
12
  // (this.userClient as ClientKafka).subscribeToResponseOf?.('user-by-id');
12
13
  }
13
14
  insertOwnership(oe) {
14
15
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- this.userClient.emit('insert-ownership', oe);
16
+ this.kafkaClient.emit('insert-ownership', oe);
16
17
  });
17
18
  }
18
19
  insertUserCapability(oe) {
19
20
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- this.userClient.emit('insert-user-capability', oe);
21
+ this.kafkaClient.emit('insert-user-capability', oe);
21
22
  });
22
23
  }
23
24
  hasOwnership(eo) {
@@ -28,6 +29,7 @@ exports.EntityOwnershipService = EntityOwnershipService;
28
29
  exports.EntityOwnershipService = EntityOwnershipService = tslib_1.__decorate([
29
30
  (0, common_1.Injectable)(),
30
31
  tslib_1.__param(0, (0, common_1.Inject)('USER_MICROSERVICE')),
31
- tslib_1.__metadata("design:paramtypes", [Object])
32
+ tslib_1.__param(1, (0, common_1.Inject)('KAFKA_CLIENT')),
33
+ tslib_1.__metadata("design:paramtypes", [Object, Object])
32
34
  ], EntityOwnershipService);
33
35
  //# sourceMappingURL=entity-ownership.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-ownership.service.js","sourceRoot":"","sources":["../../../src/lib/service/entity-ownership.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAW3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAEU,UAAiD;QAAjD,eAAU,GAAV,UAAU,CAAuC;IACxD,CAAC;IAEJ,YAAY;QACV,0EAA0E;IAC5E,CAAC;IAEK,eAAe,CAAC,EAAsB;;YAC1C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAC/C,CAAC;KAAA;IAEK,o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ClC"}
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@ubs-platform/users-mona-microservice-helper", "version": "3.0.9-beta", "private": false, "main": "dist/index.js", "license": "MIT", "author": "Unlimited Bundle Systems", "homepage": "https://github.com/ubs-platform/users-mona-microservice-helper", "repository": { "type": "git", "url": "https://github.com/ubs-platform/users-mona-microservice-helper" }, "scripts": { "build": "tsc", "build-publish": "npm run build && npm publish --tag beta" }, "peerDependencies": { "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/jwt": "^10.2.0", "@nestjs/microservices": "^10.3.3", "@nestjs/mongoose": "^10.0.4", "@nestjs/passport": "^10.0.3", "@nestjs/platform-express": "^10.0.2", "@ubs-platform/nest-microservice-setup-util": "3.0.9-beta", "@ubs-platform/users-common": "3.0.9-beta", "@ubs-platform/users-mona-roles": "3.0.9-beta", "passport-jwt": "^4.0.1", "rxjs": "^7.8.0" }, "dependencies": { "tslib": "^2.3.0", "crypto-promise": "^2.1.0" }, "devDependencies": { "typescript": "~5.3.2", "@types/node": "~18.16.9" }, "publishConfig": { "access": "public" } }
1
+ { "name": "@ubs-platform/users-mona-microservice-helper", "version": "3.0.11", "private": false, "main": "dist/index.js", "license": "MIT", "author": "Unlimited Bundle Systems", "homepage": "https://github.com/ubs-platform/users-mona-microservice-helper", "repository": { "type": "git", "url": "https://github.com/ubs-platform/users-mona-microservice-helper" }, "scripts": { "build": "tsc", "build-publish": "npm run build && npm publish" }, "peerDependencies": { "@nestjs/common": "^10.0.2", "@nestjs/core": "^10.0.2", "@nestjs/jwt": "^10.2.0", "@nestjs/microservices": "^10.3.3", "@nestjs/mongoose": "^10.0.4", "@nestjs/passport": "^10.0.3", "@nestjs/platform-express": "^10.0.2", "@ubs-platform/nest-microservice-setup-util": "3.0.11", "@ubs-platform/users-common": "3.0.11", "@ubs-platform/users-mona-roles": "3.0.11", "passport-jwt": "^4.0.1", "rxjs": "^7.8.0" }, "dependencies": { "tslib": "^2.3.0", "crypto-promise": "^2.1.0" }, "devDependencies": { "typescript": "~5.3.2", "@types/node": "~18.16.9" }, "publishConfig": { "access": "public" } }