@aptly-as/express-scope 1.0.1 → 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 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: 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>>;
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 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptly-as/express-scope",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -26,15 +26,11 @@
26
26
  "@types/express": "^4.17.17",
27
27
  "@types/sinon": "^10.0.15",
28
28
  "@vitest/ui": "^0.31.1",
29
- "coveralls": "^3.0.7",
30
29
  "express": "^4.17.1",
31
30
  "husky": "^8.0.3",
32
31
  "lint-staged": "^13.2.2",
33
- "nyc": "^14.1.1",
34
32
  "prettier": "^2.8.8",
35
- "pretty-quick": "^2.0.1",
36
33
  "sinon": "^15.0.4",
37
- "ts-node": "^8.5.0",
38
34
  "tslint": "^5.20.1",
39
35
  "typescript": "^5.0.4",
40
36
  "vitest": "^0.31.1"