@casl/angular 8.0.0 → 8.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/pipes.ts","../../src/AbilityModule.ts","../../src/AbilityService.ts"],"sourcesContent":["import { Pipe, Inject, PipeTransform } from '@angular/core';\nimport { PureAbility, AnyAbility } from '@casl/ability';\nimport { Observable } from 'rxjs';\n\n@Pipe({ name: 'able', pure: false })\nexport class AblePipe<T extends AnyAbility> implements PipeTransform {\n private _ability: T;\n\n constructor(@Inject(PureAbility) ability: T) {\n this._ability = ability;\n }\n\n transform(...args: Parameters<T['can']>): boolean {\n return this._ability.can(...args);\n }\n}\n\n@Pipe({ name: 'ablePure' })\nexport class AblePurePipe<T extends AnyAbility> implements PipeTransform {\n private _ability: T;\n\n constructor(@Inject(PureAbility) ability: T) {\n this._ability = ability;\n }\n\n // TODO: `Observable` can be removed after https://github.com/angular/angular/issues/15041\n transform(...args: Parameters<T['can']>): Observable<boolean> {\n return new Observable((s) => {\n const emit = () => s.next(this._ability.can(...args));\n emit();\n return this._ability.on('updated', emit);\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { AblePipe, AblePurePipe } from './pipes';\n\n@NgModule({\n declarations: [\n AblePipe,\n AblePurePipe,\n ],\n exports: [\n AblePipe,\n AblePurePipe,\n ],\n})\nexport class AbilityModule {\n}\n","import { Inject, Injectable } from '@angular/core';\nimport { PureAbility, AnyAbility } from '@casl/ability';\nimport { Observable } from 'rxjs';\n\n@Injectable()\nexport class AbilityService<T extends AnyAbility> {\n readonly ability$: Observable<T>;\n\n constructor(@Inject(PureAbility) ability: T) {\n this.ability$ = new Observable((observer) => {\n observer.next(ability);\n return ability.on('updated', () => observer.next(ability));\n });\n }\n}\n"],"names":[],"mappings":";;;;;MAKa,QAAQ;IAGnB,YAAiC,OAAU;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;K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AE,CAAC,SAAS,EAAE,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;SAC5D,CAAC,CAAC;KACJ;;4EARU,cAAc,cAGL,WAAW;oEAHpB,cAAc,WAAd,cAAc;uFAAd,cAAc;cAD1B,UAAU;;sBAII,MAAM;uBAAC,WAAW;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -7,12 +7,12 @@ export declare class AblePipe<T extends AnyAbility> implements PipeTransform {
7
7
  constructor(ability: T);
8
8
  transform(...args: Parameters<T['can']>): boolean;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<AblePipe<any>, never>;
10
- static ɵpipe: i0.ɵɵPipeDeclaration<AblePipe<any>, "able">;
10
+ static ɵpipe: i0.ɵɵPipeDeclaration<AblePipe<any>, "able", false>;
11
11
  }
12
12
  export declare class AblePurePipe<T extends AnyAbility> implements PipeTransform {
13
13
  private _ability;
14
14
  constructor(ability: T);
15
15
  transform(...args: Parameters<T['can']>): Observable<boolean>;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<AblePurePipe<any>, never>;
17
- static ɵpipe: i0.ɵɵPipeDeclaration<AblePurePipe<any>, "ablePure">;
17
+ static ɵpipe: i0.ɵɵPipeDeclaration<AblePurePipe<any>, "ablePure", false>;
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casl/angular",
3
- "version": "8.0.0",
3
+ "version": "8.2.0",
4
4
  "description": "Angular module for CASL which makes it easy to add permissions in any Angular app",
5
5
  "main": "dist/umd/index.js",
6
6
  "module": "dist/es5m/index.js",
@@ -8,6 +8,7 @@
8
8
  "typings": "dist/types/index.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
+ "types": "./dist/types/index.d.ts",
11
12
  "import": "./dist/es6m/index.mjs",
12
13
  "require": "./dist/umd/index.js"
13
14
  }
@@ -46,28 +47,27 @@
46
47
  "author": "Sergii Stotskyi <sergiy.stotskiy@gmail.com>",
47
48
  "license": "MIT",
48
49
  "peerDependencies": {
49
- "@angular/core": "^14.0.0",
50
+ "@angular/core": "^14.0.0 || ^15.0.0",
50
51
  "@casl/ability": "^3.0.0 || ^4.0.0 || ^5.1.0 || ^6.0.0",
51
52
  "rxjs": "^7.5.5",
52
53
  "tslib": "^2.0.0"
53
54
  },
54
55
  "devDependencies": {
55
- "@abraham/reflection": "^0.10.0",
56
- "@angular/common": "^14.0.0",
57
- "@angular/compiler": "^14.0.0",
58
- "@angular/compiler-cli": "^14.0.0",
59
- "@angular/core": "^14.0.0",
60
- "@angular/platform-browser": "^14.0.0",
61
- "@angular/platform-browser-dynamic": "^14.0.0",
62
- "@angular-devkit/build-angular": "^14.0.0",
63
- "jest": "^28.0.0",
56
+ "@angular-devkit/build-angular": "^15.0.0",
57
+ "@angular/common": "^15.0.0",
58
+ "@angular/compiler": "^15.0.0",
59
+ "@angular/compiler-cli": "^15.0.0",
60
+ "@angular/core": "^15.0.0",
61
+ "@angular/platform-browser": "^15.0.0",
62
+ "@angular/platform-browser-dynamic": "^15.0.0",
64
63
  "@casl/ability": "^6.0.0",
65
64
  "@casl/dx": "workspace:^1.0.0",
66
65
  "@types/jest": "^28.0.0",
67
- "jest-preset-angular": "^12.0.0",
66
+ "jest": "^28.0.0",
67
+ "jest-preset-angular": "^12.2.3",
68
68
  "rxjs": "^7.5.5",
69
69
  "tslib": "^2.0.0",
70
- "typescript": "~4.7.4",
70
+ "typescript": "~4.8.0",
71
71
  "zone.js": "~0.11.4"
72
72
  },
73
73
  "files": [