@atls/nestjs-keto 0.0.3 → 0.0.4

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.
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AccessPolicy = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  const constants_1 = require("../constants");
6
- const AccessPolicy = (flavor, resource, action) => common_1.SetMetadata(constants_1.ACCESS_POLICY_METADATA, { flavor, resource, action });
6
+ const AccessPolicy = (flavor, resource, action) => (0, common_1.SetMetadata)(constants_1.ACCESS_POLICY_METADATA, { flavor, resource, action });
7
7
  exports.AccessPolicy = AccessPolicy;
@@ -53,7 +53,7 @@ let KetoAccessControlGuard = class KetoAccessControlGuard {
53
53
  }
54
54
  };
55
55
  KetoAccessControlGuard = __decorate([
56
- common_1.Injectable(),
56
+ (0, common_1.Injectable)(),
57
57
  __metadata("design:paramtypes", [core_1.Reflector,
58
58
  keto_client_1.EnginesApi,
59
59
  services_1.ResourceService])
@@ -35,6 +35,6 @@ let KetoModule = KetoModule_1 = class KetoModule {
35
35
  }
36
36
  };
37
37
  KetoModule = KetoModule_1 = __decorate([
38
- common_1.Module({})
38
+ (0, common_1.Module)({})
39
39
  ], KetoModule);
40
40
  exports.KetoModule = KetoModule;
@@ -14,6 +14,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.ResourceService = void 0;
16
16
  const common_1 = require("@nestjs/common");
17
+ const common_2 = require("@nestjs/common");
17
18
  const constants_1 = require("../constants");
18
19
  const SEPARATOR = ':';
19
20
  let ResourceService = class ResourceService {
@@ -46,8 +47,8 @@ let ResourceService = class ResourceService {
46
47
  }
47
48
  };
48
49
  ResourceService = __decorate([
49
- common_1.Injectable(),
50
- __param(0, common_1.Inject(constants_1.RESOURCES_SCOPE)),
50
+ (0, common_2.Injectable)(),
51
+ __param(0, (0, common_1.Inject)(constants_1.RESOURCES_SCOPE)),
51
52
  __metadata("design:paramtypes", [String])
52
53
  ], ResourceService);
53
54
  exports.ResourceService = ResourceService;
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
1
  {
2
2
  "name": "@atls/nestjs-keto",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "BSD-3-Clause",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
- "build": "yarn app library build",
11
- "postpack": "rm -rf dist",
12
- "prepack": "yarn run build"
10
+ "build": "yarn library build",
11
+ "prepack": "yarn run build",
12
+ "postpack": "rm -rf dist"
13
13
  },
14
14
  "dependencies": {
15
15
  "@oryd/keto-client": "^0.5.6-alpha.1"
16
16
  },
17
- "peerDependencies": {
18
- "@nestjs/common": "^8.0.4",
19
- "@nestjs/core": "^8.0.4",
20
- "reflect-metadata": "^0.1.12",
21
- "rxjs": "^7.2.0"
22
- },
23
17
  "devDependencies": {
24
18
  "@nestjs/common": "^8.0.4",
25
19
  "@nestjs/core": "^8.0.4",
26
20
  "@nestjs/graphql": "^7.0.0",
27
- "@types/node": "13.13.4",
21
+ "@types/node": "17.0.18",
28
22
  "apollo-server-core": "^3.3.0",
29
23
  "graphql": "^15.5.3",
30
24
  "reflect-metadata": "0.1.13",
31
25
  "rimraf": "3.0.2",
32
- "rxjs": "^7.2.0",
26
+ "rxjs": "^7.5.4",
33
27
  "typescript": "^3.8.3"
34
28
  },
29
+ "peerDependencies": {
30
+ "@nestjs/common": "^8.0.4",
31
+ "@nestjs/core": "^8.0.4",
32
+ "reflect-metadata": "^0.1.12",
33
+ "rxjs": "^7.2.0"
34
+ },
35
35
  "publishConfig": {
36
36
  "main": "dist/index.js",
37
37
  "typings": "dist/index.d.ts"
@@ -1,2 +0,0 @@
1
- export declare const ACCESS_POLICY_METADATA = "__ketoAccessPolicy__";
2
- export declare const RESOURCES_SCOPE = "__ketoResourcesStope__";
@@ -1 +0,0 @@
1
- export declare const AccessPolicy: (flavor: string, resource: string, action: string) => import("@nestjs/common").CustomDecorator<string>;
@@ -1 +0,0 @@
1
- export * from './access-policy.decorator';
@@ -1 +0,0 @@
1
- export * from './keto-access-control.guard';
@@ -1,12 +0,0 @@
1
- import { CanActivate, ExecutionContext } from '@nestjs/common';
2
- import { Reflector } from '@nestjs/core';
3
- import { EnginesApi } from '@oryd/keto-client';
4
- import { ResourceService } from '../services';
5
- export declare class KetoAccessControlGuard implements CanActivate {
6
- private reflector;
7
- private keto;
8
- private resourceService;
9
- constructor(reflector: Reflector, keto: EnginesApi, resourceService: ResourceService);
10
- getSubject(context: ExecutionContext): any;
11
- canActivate(context: ExecutionContext): Promise<boolean>;
12
- }
package/dist/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from './keto.module';
2
- export * from './decorators';
3
- export * from './constants';
4
- export * from './services';
5
- export * from './guards';
@@ -1,4 +0,0 @@
1
- import { DynamicModule } from '@nestjs/common';
2
- export declare class KetoModule {
3
- static forRoot(options?: any): DynamicModule;
4
- }
@@ -1 +0,0 @@
1
- export * from './resource.service';
@@ -1,7 +0,0 @@
1
- export declare class ResourceService {
2
- private scope;
3
- constructor(scope: string);
4
- withScope(resource: string): string;
5
- withoutScope(resource: string): string | undefined;
6
- isMatchScope(resource: string): boolean;
7
- }