@povio/openapi-codegen-cli 3.2.0-rc.4 → 3.2.0-rc.5

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/dist/acl.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as SharedErrorHandler } from "./error-handling-DDIXMA-R.mjs";
2
2
  import { n as OpenApiRouter, t as AuthContext } from "./auth.context-YFWzkwoN.mjs";
3
- import { createContext, useCallback, useEffect, useState } from "react";
3
+ import { createContext, useCallback, useMemo } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { AbilityBuilder, createMongoAbility } from "@casl/ability";
6
6
  import { unpackRules } from "@casl/ability/extra";
@@ -14,16 +14,15 @@ let AbilityContext;
14
14
  const { Consumer } = Context;
15
15
  _AbilityContext.Consumer = Consumer;
16
16
  _AbilityContext.Provider = ({ children }) => {
17
- const [ability, setAbility] = useState(initialAppAbility);
18
17
  const { user } = AuthContext.useAuth();
19
- useEffect(() => {
20
- if (!user || !("aclRules" in user)) return;
18
+ const ability = useMemo(() => {
19
+ if (!user || !("aclRules" in user)) return initialAppAbility;
21
20
  const { can, build } = createAppAbilityBuilder();
22
21
  const packedRules = user.aclRules;
23
22
  unpackRules(packedRules).forEach(({ action, subject, conditions }) => {
24
23
  can(action, subject, conditions);
25
24
  });
26
- setAbility(build());
25
+ return build();
27
26
  }, [user]);
28
27
  return /* @__PURE__ */ jsx(Context.Provider, {
29
28
  value: ability,
package/dist/sh.mjs CHANGED
@@ -31,7 +31,7 @@ function logBanner(message) {
31
31
  * Fetch the version from package.json
32
32
  */
33
33
  function getVersion() {
34
- return "3.2.0-rc.4";
34
+ return "3.2.0-rc.5";
35
35
  }
36
36
  //#endregion
37
37
  //#region src/helpers/yargs.helper.ts
package/package.json CHANGED
@@ -141,5 +141,5 @@
141
141
  "node": ">= 18"
142
142
  },
143
143
  "packageManager": "bun@1.3.14",
144
- "version": "3.2.0-rc.4"
144
+ "version": "3.2.0-rc.5"
145
145
  }