@povio/openapi-codegen-cli 2.0.5 → 2.0.7

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.
@@ -1,5 +1,5 @@
1
- import { HasNestedPath, ObjectLiteral } from '../types/common';
2
1
  import { Get } from 'type-fest';
2
+ import { HasNestedPath, ObjectLiteral } from '../types/common';
3
3
  /** Get a nested property value from a dot-delimited path. */
4
4
  export declare function getNested<Path extends string, From extends ObjectLiteral, Return = HasNestedPath<Path> extends 1 ? From[Path] : Get<From, Path>>(obj: From, path: Path): Return;
5
5
  /** Pick given properties in object */
@@ -1,5 +1,5 @@
1
- import { AbilityContext } from "./ability.context.mjs";
2
1
  import { OpenApiRouter } from "../config/router.context.mjs";
2
+ import { AbilityContext } from "./ability.context.mjs";
3
3
  const createAclGuard = () => ({ canUse, redirectTo = "/", children }) => {
4
4
  const ability = AbilityContext.useAbility();
5
5
  const { replace } = OpenApiRouter.useRouter();
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { AbilityContext } from "./ability.context.mjs";
3
2
  import { createContextualCan } from "@casl/react";
3
+ import { AbilityContext } from "./ability.context.mjs";
4
4
  const ContextualCan = createContextualCan(AbilityContext.Consumer);
5
5
  const Can = ({ use, ...props }) => {
6
6
  const [action, subject] = use;
@@ -1,9 +1,9 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { createContext, useState, useEffect } from "react";
3
- import { AuthContext } from "../auth/auth.context.mjs";
4
3
  import { AbilityBuilder, createMongoAbility } from "@casl/ability";
5
4
  import { unpackRules } from "@casl/ability/extra";
6
5
  import { useAbility } from "@casl/react";
6
+ import { AuthContext } from "../auth/auth.context.mjs";
7
7
  var AbilityContext;
8
8
  ((AbilityContext2) => {
9
9
  const createAppAbilityBuilder = () => new AbilityBuilder(createMongoAbility);
@@ -1,9 +1,11 @@
1
+ import { PropsWithChildren } from 'react';
1
2
  export declare namespace OpenApiQueryConfig {
2
3
  interface Type {
3
4
  preferUpdate?: boolean;
5
+ invalidateCurrentModule?: boolean;
4
6
  }
5
7
  type ProviderProps = Type;
6
- export const Provider: ({ preferUpdate, children }: React.PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
8
+ export const Provider: ({ preferUpdate, invalidateCurrentModule, children }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
7
9
  export const useConfig: () => Type;
8
10
  export {};
9
11
  }
@@ -3,8 +3,8 @@ import { createContext, useMemo, use } from "react";
3
3
  var OpenApiQueryConfig;
4
4
  ((OpenApiQueryConfig2) => {
5
5
  const Context = createContext({});
6
- OpenApiQueryConfig2.Provider = ({ preferUpdate = true, children }) => {
7
- const value = useMemo(() => ({ preferUpdate }), [preferUpdate]);
6
+ OpenApiQueryConfig2.Provider = ({ preferUpdate, invalidateCurrentModule, children }) => {
7
+ const value = useMemo(() => ({ preferUpdate, invalidateCurrentModule }), [preferUpdate, invalidateCurrentModule]);
8
8
  return /* @__PURE__ */ jsx(Context.Provider, { value, children });
9
9
  };
10
10
  OpenApiQueryConfig2.useConfig = () => {
@@ -113,6 +113,9 @@ class ErrorHandler {
113
113
  return error.message;
114
114
  }
115
115
  if (error instanceof ApplicationException) {
116
+ if (error.serverMessage != null) {
117
+ return error.serverMessage;
118
+ }
116
119
  return error.message;
117
120
  }
118
121
  if (fallbackToUnknown) {
@@ -1,5 +1,5 @@
1
- import { z } from "zod";
2
1
  import { isAxiosError } from "axios";
2
+ import { z } from "zod";
3
3
  var RestUtils;
4
4
  ((RestUtils2) => {
5
5
  RestUtils2.extractServerResponseCode = (e) => {