@aptly-as/express-scope 1.0.2 → 1.0.3
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/lib/Scope.d.ts +2 -2
- package/lib/Scope.js +2 -2
- package/package.json +1 -1
package/lib/Scope.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export default class Scope<R extends Request, SCOPE extends string, MODULE exten
|
|
|
14
14
|
/**
|
|
15
15
|
* @deprecated use access instead
|
|
16
16
|
*/
|
|
17
|
-
crud(scope: SCOPE | SCOPE[], access
|
|
18
|
-
access(scope: SCOPE | SCOPE[], access
|
|
17
|
+
crud(scope: SCOPE | SCOPE[], access?: ScopeAccess, validate?: ScopeRequestValidate<R>): (req: R, res: Response<any, Record<string, any>>, next?: NextFunction | undefined) => boolean | void | Response<any, Record<string, any>>;
|
|
18
|
+
access(scope: SCOPE | SCOPE[], access?: ScopeAccess, validate?: ScopeRequestValidate<R>): (req: R, res: Response, next?: NextFunction) => boolean | void | Response<any, Record<string, any>>;
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated use list instead
|
|
21
21
|
*/
|
package/lib/Scope.js
CHANGED
|
@@ -29,10 +29,10 @@ class Scope {
|
|
|
29
29
|
/**
|
|
30
30
|
* @deprecated use access instead
|
|
31
31
|
*/
|
|
32
|
-
crud(scope, access, validate) {
|
|
32
|
+
crud(scope, access = 'R', validate) {
|
|
33
33
|
return this.access(scope, access, validate);
|
|
34
34
|
}
|
|
35
|
-
access(scope, access, validate) {
|
|
35
|
+
access(scope, access = 'R', validate) {
|
|
36
36
|
return (req, res, next) => {
|
|
37
37
|
const hasNext = typeof next === 'function';
|
|
38
38
|
try {
|