@povio/openapi-codegen-cli 0.13.10 → 0.13.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/openapi-codegen-cli",
3
- "version": "0.13.10",
3
+ "version": "0.13.11",
4
4
  "main": "./dist/index.js",
5
5
  "bin": {
6
6
  "openapi-codegen": "./dist/sh.js"
@@ -5,18 +5,16 @@ import { useCallback } from "react";
5
5
  {{{genImport errorHandlingImport}}}
6
6
  {{! App abilities import }}
7
7
  {{{genImport appAbilitiesImport}}}
8
- {{! Casl ability tuple import }}
9
- {{{genImport caslAbilityTupleImport}}}
10
8
 
11
9
  interface UseAclCheckProps {
12
10
  errorHandler?: {{errorHandler}}<never>;
13
11
  }
14
12
 
15
13
  export function {{aclCheckHook}}({ errorHandler }: UseAclCheckProps = {}) {
16
- const ability = {{abilityContext}}.useAbility();
14
+ const ability = {{abilityContext}}.useAbility{{#if hasGenericAppAbilities}}<{{appAbilities}}>{{/if}}();
17
15
 
18
16
  const checkAcl = useCallback((appAbility: {{appAbilities}}) => {
19
- if (!ability.can(...(appAbility as AbilityTuple))) {
17
+ if (!ability.can(...appAbility)) {
20
18
  (errorHandler ?? {{sharedErrorHandler}}).rethrowError(new Error("ACL check failed"));
21
19
  }
22
20
  }, [ability, errorHandler]);