Skip to content

Commit 92b5562

Browse files
committed
bump version to 8.0.10 in package.json
1 parent c658106 commit 92b5562

File tree

134 files changed

+951
-84
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+951
-84
lines changed

dist/classes/acl.class.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { CacheInterface, ControlOptions, Policy, PropValue } from '../types';
2+
import { OK } from '../consts';
3+
import { Permission } from './permission.class';
4+
export interface CanOptions<Sub = string, Act = string, Obj = string> extends ControlOptions {
5+
callable?: (perm: Permission<Sub, Act, Obj>) => boolean | Promise<boolean>;
6+
}
7+
export interface AccessControlOptions<Sub = string, Act = string, Obj = string> extends ControlOptions {
8+
driver?: 'memory' | CacheInterface<Sub, Act, Obj> | (() => CacheInterface<Sub, Act, Obj> | Promise<CacheInterface<Sub, Act, Obj>>);
9+
}
10+
export declare class AccessControl<Sub = string, Act = string, Obj = string> {
11+
protected driver: CacheInterface<Sub, Act, Obj>;
12+
protected readonly options: ControlOptions;
13+
constructor(policies?: Policy<Sub, Act, Obj>[], options?: AccessControlOptions<Sub, Act, Obj>);
14+
protected setDriver(driver?: AccessControlOptions<Sub, Act, Obj>['driver']): Promise<void>;
15+
clear(): Promise<typeof OK>;
16+
exists(policy: Policy<Sub, Act, Obj>): Promise<boolean>;
17+
delete(policy: Policy<Sub, Act, Obj>): Promise<typeof OK>;
18+
update(policy: Policy<Sub, Act, Obj>): Promise<typeof OK>;
19+
can(subjects: (Sub | (PropValue & ControlOptions))[], action: Act | (PropValue & ControlOptions), object: Obj | (PropValue & ControlOptions), options?: CanOptions<Sub, Act, Obj>): Promise<Permission<Sub, Act, Obj>>;
20+
}

dist/classes/acl.class.js

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/classes/acl.class.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/classes/grant.class.d.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { ControlOptions, Policy, TimeOptions, PropType, CacheKey } from '../types';
2+
export declare class Grant<Sub = string, Act = string, Obj = string> {
3+
protected readonly options: ControlOptions;
4+
protected present: Record<string, Policy<Sub, Act, Obj>>;
5+
constructor(policies?: Policy<Sub, Act, Obj>[], options?: ControlOptions);
6+
set policies(policies: Policy<Sub, Act, Obj>[]);
7+
get policies(): Policy<Sub, Act, Obj>[];
8+
update(policy: Policy<Sub, Act, Obj>): void;
9+
exists(policy: Policy<Sub, Act, Obj>): boolean;
10+
delete(policy: Policy<Sub, Act, Obj>): boolean;
11+
has(cKey: CacheKey<Sub, Act, Obj>): boolean;
12+
scopes<S = string>(prop: PropType, cKey?: CacheKey<Sub, Act, Obj>): S[];
13+
subjects(cKey?: CacheKey<Sub, Act, Obj>): Sub[];
14+
time(options?: TimeOptions, cKey?: CacheKey<Sub, Act, Obj>): boolean;
15+
location(ip: string, cKey?: CacheKey<Sub, Act, Obj>): boolean;
16+
field<Data = any>(data: any, cKey?: CacheKey<Sub, Act, Obj> | ((data: any) => CacheKey<Sub, Act, Obj> | Promise<CacheKey<Sub, Act, Obj>>)): Promise<Data>;
17+
filter<Data = any>(data: any, cKey?: CacheKey<Sub, Act, Obj> | ((data: any) => CacheKey<Sub, Act, Obj> | Promise<CacheKey<Sub, Act, Obj>>)): Promise<Data>;
18+
protected notations(policies: Policy<Sub, Act, Obj>[], data: any, type: 'filter' | 'field', cKey?: CacheKey<Sub, Act, Obj> | ((data: any) => CacheKey<Sub, Act, Obj> | Promise<CacheKey<Sub, Act, Obj>>)): Promise<string[][]>;
19+
}

dist/classes/grant.class.js

Lines changed: 176 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)