@povio/openapi-codegen-cli 2.0.6 → 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.
- package/dist/generator.js +12 -12
- package/dist/generators/utils/object.utils.d.ts +1 -1
- package/dist/lib/acl/AclGuard.mjs +1 -1
- package/dist/lib/acl/Can.mjs +1 -1
- package/dist/lib/acl/ability.context.mjs +1 -1
- package/dist/lib/config/queryConfig.context.d.ts +3 -1
- package/dist/lib/config/queryConfig.context.mjs +2 -2
- package/dist/lib/rest/rest.utils.mjs +1 -1
- package/dist/sh.js +58 -58
- package/package.json +3 -3
- package/src/assets/useMutationEffects.ts +3 -1
|
@@ -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();
|
package/dist/lib/acl/Can.mjs
CHANGED
|
@@ -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 }:
|
|
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
|
|
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 = () => {
|