@povio/openapi-codegen-cli 2.0.6 → 2.0.8-rc.1

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.
@@ -27,6 +27,7 @@ export declare const MUTATION_EFFECTS: {
27
27
  runFunctionName: string;
28
28
  };
29
29
  export declare const MUTATION_EFFECTS_FILE: GenerateFile;
30
+ export declare const CROSS_TAB_QUERY_INVALIDATION_FILE: GenerateFile;
30
31
  export declare const ZOD_EXTENDED: {
31
32
  namespace: string;
32
33
  exports: {
@@ -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,14 @@
1
+ import { QueryKey } from '@tanstack/react-query';
2
+ import { PropsWithChildren } from 'react';
1
3
  export declare namespace OpenApiQueryConfig {
2
4
  interface Type {
3
5
  preferUpdate?: boolean;
6
+ invalidateCurrentModule?: boolean;
7
+ invalidationMap?: Record<string, (context: Record<string, string>) => QueryKey[]>;
8
+ crossTabInvalidation?: boolean;
4
9
  }
5
10
  type ProviderProps = Type;
6
- export const Provider: ({ preferUpdate, children }: React.PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
11
+ export const Provider: ({ preferUpdate, invalidateCurrentModule, invalidationMap, crossTabInvalidation, children }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
7
12
  export const useConfig: () => Type;
8
13
  export {};
9
14
  }
@@ -3,8 +3,14 @@ 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 = ({
7
+ preferUpdate,
8
+ invalidateCurrentModule,
9
+ invalidationMap,
10
+ crossTabInvalidation,
11
+ children
12
+ }) => {
13
+ const value = useMemo(() => ({ preferUpdate, invalidateCurrentModule, invalidationMap, crossTabInvalidation }), [preferUpdate, invalidateCurrentModule, invalidationMap, crossTabInvalidation]);
8
14
  return /* @__PURE__ */ jsx(Context.Provider, { value, children });
9
15
  };
10
16
  OpenApiQueryConfig2.useConfig = () => {
@@ -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) => {