@ubs-platform/users-mona-microservice-helper 3.0.11 → 3.2.0

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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './lib/backend-jwt-utils.module';
2
2
  export * from './lib/backend-jwt-utils-exports.module';
3
3
  export * from './lib/guards/jwt.guard';
4
+ export * from './lib/guards/user-intercept';
4
5
  export * from './lib/current-user-decorator';
5
6
  export * from './lib/service/user.service';
6
7
  export * from './lib/service/entity-ownership.service';
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./lib/backend-jwt-utils.module"), exports);
5
5
  tslib_1.__exportStar(require("./lib/backend-jwt-utils-exports.module"), exports);
6
6
  tslib_1.__exportStar(require("./lib/guards/jwt.guard"), exports);
7
+ tslib_1.__exportStar(require("./lib/guards/user-intercept"), exports);
7
8
  tslib_1.__exportStar(require("./lib/current-user-decorator"), exports);
8
9
  tslib_1.__exportStar(require("./lib/service/user.service"), exports);
9
10
  tslib_1.__exportStar(require("./lib/service/entity-ownership.service"), exports);
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;AAC3C,iFAAuD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yEAA+C;AAC/C,iFAAuD;AACvD,iEAAuC;AACvC,sEAA4C;AAC5C,uEAA6C;AAC7C,qEAA2C;AAC3C,iFAAuD"}
@@ -0,0 +1,5 @@
1
+ declare const UserIntercept_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
2
+ export declare class UserIntercept extends UserIntercept_base {
3
+ handleRequest(err: any, user: any): any;
4
+ }
5
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UserIntercept = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const common_1 = require("@nestjs/common");
6
+ const passport_1 = require("@nestjs/passport");
7
+ let UserIntercept = class UserIntercept extends (0, passport_1.AuthGuard)('jwt') {
8
+ handleRequest(err, user) {
9
+ if (user)
10
+ return user;
11
+ return null;
12
+ }
13
+ };
14
+ exports.UserIntercept = UserIntercept;
15
+ exports.UserIntercept = UserIntercept = tslib_1.__decorate([
16
+ (0, common_1.Injectable)()
17
+ ], UserIntercept);
18
+ //# sourceMappingURL=user-intercept.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-intercept.js","sourceRoot":"","sources":["../../../src/lib/guards/user-intercept.ts"],"names":[],"mappings":";;;;AAAA,2CAA4C;AAC5C,+CAA6C;AAGtC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,IAAA,oBAAS,EAAC,KAAK,CAAC;IACxC,aAAa,CAAC,GAAQ,EAAE,IAAS;QACxC,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AALY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;GACA,aAAa,CAKzB"}
@@ -1,6 +1,6 @@
1
1
  import { OnModuleInit } from '@nestjs/common';
2
2
  import { ClientProxy, ClientKafka, ClientRMQ } from '@nestjs/microservices';
3
- import { EntityOwnershipDTO, EntityOwnershipInsertCapabiltyDTO, EntityOwnershipUserCheck, UserCapabilityDTO } from '@ubs-platform/users-common';
3
+ import { EntityOwnershipDTO, EntityOwnershipInsertCapabiltyDTO, EntityOwnershipSearch, EntityOwnershipUserCheck, UserCapabilityDTO } from '@ubs-platform/users-common';
4
4
  import { Observable } from 'rxjs';
5
5
  export declare class EntityOwnershipService implements OnModuleInit {
6
6
  private userClient;
@@ -10,4 +10,6 @@ export declare class EntityOwnershipService implements OnModuleInit {
10
10
  insertOwnership(oe: EntityOwnershipDTO): Promise<void>;
11
11
  insertUserCapability(oe: EntityOwnershipInsertCapabiltyDTO): Promise<void>;
12
12
  hasOwnership(eo: EntityOwnershipUserCheck): Observable<UserCapabilityDTO>;
13
+ searchOwnership(eo: EntityOwnershipSearch): Observable<EntityOwnershipDTO[]>;
14
+ deleteOwnership(oe: EntityOwnershipSearch): Promise<void>;
13
15
  }
@@ -24,6 +24,14 @@ let EntityOwnershipService = class EntityOwnershipService {
24
24
  hasOwnership(eo) {
25
25
  return this.userClient.send('check-ownership', eo);
26
26
  }
27
+ searchOwnership(eo) {
28
+ return this.userClient.send('search-ownership', eo);
29
+ }
30
+ deleteOwnership(oe) {
31
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
+ this.kafkaClient.emit('delete-ownership', oe);
33
+ });
34
+ }
27
35
  };
28
36
  exports.EntityOwnershipService = EntityOwnershipService;
29
37
  exports.EntityOwnershipService = EntityOwnershipService = tslib_1.__decorate([
@@ -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,EAEjD,WAAkD;QAFlD,eAAU,GAAV,UAAU,CAAuC;QAEjD,gBAAW,GAAX,WAAW,CAAuC;IACzD,CAAC;IAEJ,YAAY;QACV,0EAA0E;IAC5E,CAAC;IAEK,eAAe,CAAC,EAAsB;;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC;KAAA;IAEK,oBAAoB,CAAC,EAAqC;;YAC9D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IAED,YAAY,CAAC,EAA4B;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;CAUF,CAAA;AAhCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;IAE3B,mBAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;;GAJd,sBAAsB,CAgClC"}
1
+ {"version":3,"file":"entity-ownership.service.js","sourceRoot":"","sources":["../../../src/lib/service/entity-ownership.service.ts"],"names":[],"mappings":";;;;AAAA,2CAAkE;AAY3D,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,YAEU,UAAiD,EAEjD,WAAkD;QAFlD,eAAU,GAAV,UAAU,CAAuC;QAEjD,gBAAW,GAAX,WAAW,CAAuC;IACzD,CAAC;IAEJ,YAAY;QACV,0EAA0E;IAC5E,CAAC;IAEK,eAAe,CAAC,EAAsB;;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC;KAAA;IAEK,oBAAoB,CAAC,EAAqC;;YAC9D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IAED,YAAY,CAAC,EAA4B;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,eAAe,CAAC,EAAyB;QACvC,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAEK,eAAe,CAAC,EAAyB;;YAC7C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAChD,CAAC;KAAA;CAUF,CAAA;AAxCY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;IAGR,mBAAA,IAAA,eAAM,EAAC,mBAAmB,CAAC,CAAA;IAE3B,mBAAA,IAAA,eAAM,EAAC,cAAc,CAAC,CAAA;;GAJd,sBAAsB,CAwClC"}
package/package.json CHANGED
@@ -1 +1 @@
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" } }
1
+ { "name": "@ubs-platform/users-mona-microservice-helper", "version": "3.2.0", "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.2.0", "@ubs-platform/users-common": "3.2.0", "@ubs-platform/users-mona-roles": "3.2.0", "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" } }