@ubs-platform/users-mona-microservice-helper 3.0.4-beta → 3.0.7-beta

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './lib/backend-jwt-utils-exports.module';
3
3
  export * from './lib/guards/jwt.guard';
4
4
  export * from './lib/current-user-decorator';
5
5
  export * from './lib/service/user.service';
6
+ export * from './lib/service/entity-ownership.service';
package/dist/index.js CHANGED
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./lib/backend-jwt-utils-exports.module"), exports)
6
6
  tslib_1.__exportStar(require("./lib/guards/jwt.guard"), exports);
7
7
  tslib_1.__exportStar(require("./lib/current-user-decorator"), exports);
8
8
  tslib_1.__exportStar(require("./lib/service/user.service"), exports);
9
+ tslib_1.__exportStar(require("./lib/service/entity-ownership.service"), exports);
9
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,iFAAuD;AACvD,iEAAuC;AACvC,uEAA6C;AAC7C,qEAA2C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,iFAAuD;AACvD,iEAAuC;AACvC,uEAA6C;AAC7C,qEAA2C;AAC3C,iFAAuD"}
@@ -8,6 +8,7 @@ const backend_jwt_utils_exports_module_1 = require("./backend-jwt-utils-exports.
8
8
  const communication_handler_1 = require("./guards/communication-handler");
9
9
  const jwt_strategy_1 = require("./strategies/jwt.strategy");
10
10
  const user_service_1 = require("./service/user.service");
11
+ const entity_ownership_service_1 = require("./service/entity-ownership.service");
11
12
  // import { JwtStrategy } from './strategies/jwt.strategy';
12
13
  exports.INTERNAL_COMMUNICATION = {
13
14
  port: parseInt(process.env['U_USERS_MONA_INTERNAL_COM_PORT'] || '0'),
@@ -20,7 +21,7 @@ exports.BackendJwtUtilsModule = BackendJwtUtilsModule = tslib_1.__decorate([
20
21
  (0, common_1.Module)({
21
22
  controllers: [],
22
23
  providers: [communication_handler_1.CommunicationHelper, jwt_strategy_1.JwtStrategy, user_service_1.UserService],
23
- exports: [user_service_1.UserService],
24
+ exports: [user_service_1.UserService, entity_ownership_service_1.EntityOwnershipService],
24
25
  imports: [
25
26
  ...backend_jwt_utils_exports_module_1.BackendJwtUtilsExportModule,
26
27
  microservices_1.ClientsModule.register([
@@ -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,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;AAwBK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAtBjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,2CAAmB,EAAE,0BAAW,EAAE,0BAAW,CAAC;QAC1D,OAAO,EAAE,CAAC,0BAAW,CAAC;QACtB,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,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;AAwBK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;CAAG,CAAA;AAAxB,sDAAqB;gCAArB,qBAAqB;IAtBjC,IAAA,eAAM,EAAC;QACN,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,CAAC,2CAAmB,EAAE,0BAAW,EAAE,0BAAW,CAAC;QAC1D,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"}
@@ -0,0 +1,11 @@
1
+ import { OnModuleInit } from '@nestjs/common';
2
+ import { ClientProxy, ClientKafka, ClientRMQ } from '@nestjs/microservices';
3
+ import { EntityOwnershipDTO, EntityOwnershipInsertCapabiltyDTO, EntityOwnershipUserCheck } from '@ubs-platform/users-common';
4
+ export declare class EntityOwnershipService implements OnModuleInit {
5
+ private userClient;
6
+ constructor(userClient: ClientProxy | ClientKafka | ClientRMQ);
7
+ onModuleInit(): void;
8
+ insertOwnership(oe: EntityOwnershipDTO): Promise<void>;
9
+ insertUserCapability(oe: EntityOwnershipInsertCapabiltyDTO): Promise<void>;
10
+ hasOwnership(eo: EntityOwnershipUserCheck): Promise<import("rxjs").Observable<any>>;
11
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EntityOwnershipService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ let EntityOwnershipService = class EntityOwnershipService {
7
+ constructor(userClient) {
8
+ this.userClient = userClient;
9
+ }
10
+ onModuleInit() {
11
+ // (this.userClient as ClientKafka).subscribeToResponseOf?.('user-by-id');
12
+ }
13
+ insertOwnership(oe) {
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ this.userClient.emit('insert-ownership', oe);
16
+ });
17
+ }
18
+ insertUserCapability(oe) {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ this.userClient.emit('insert-user-capability', oe);
21
+ });
22
+ }
23
+ hasOwnership(eo) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ return yield this.userClient.emit('check-ownership', eo);
26
+ });
27
+ }
28
+ };
29
+ exports.EntityOwnershipService = EntityOwnershipService;
30
+ exports.EntityOwnershipService = EntityOwnershipService = tslib_1.__decorate([
31
+ (0, common_1.Injectable)(),
32
+ tslib_1.__param(0, (0, common_1.Inject)('USER_MICROSERVICE')),
33
+ tslib_1.__metadata("design:paramtypes", [Object])
34
+ ], EntityOwnershipService);
35
+ //# sourceMappingURL=entity-ownership.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-ownership.service.js","sourceRoot":"","sources":["../../../src/lib/service/entity-ownership.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAS3D,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,oBAAoB,CAAC,EAAqC;;YAC9D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACrD,CAAC;KAAA;IAEK,YAAY,CAAC,EAA4B;;YAC7C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;QAC3D,CAAC;KAAA;CAUF,CAAA;AA9BY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;;GAFnB,sBAAsB,CA8BlC"}
package/package.json CHANGED
@@ -1 +1 @@
1
- { "name": "@ubs-platform/users-mona-microservice-helper", "version": "3.0.4-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.4-beta", "@ubs-platform/users-common": "3.0.4-beta", "@ubs-platform/users-mona-roles": "3.0.4-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.7-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.7-beta", "@ubs-platform/users-common": "3.0.7-beta", "@ubs-platform/users-mona-roles": "3.0.7-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" } }