@orval/core 7.14.0 → 7.15.0
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/index.d.ts +6 -3
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -483,6 +483,7 @@ type NormalizedQueryOptions = {
|
|
|
483
483
|
useSuspenseInfiniteQuery?: boolean;
|
|
484
484
|
useInfiniteQueryParam?: string;
|
|
485
485
|
usePrefetch?: boolean;
|
|
486
|
+
useInvalidate?: boolean;
|
|
486
487
|
options?: any;
|
|
487
488
|
queryKey?: NormalizedMutator;
|
|
488
489
|
queryOptions?: NormalizedMutator;
|
|
@@ -503,6 +504,7 @@ type QueryOptions = {
|
|
|
503
504
|
useSuspenseInfiniteQuery?: boolean;
|
|
504
505
|
useInfiniteQueryParam?: string;
|
|
505
506
|
usePrefetch?: boolean;
|
|
507
|
+
useInvalidate?: boolean;
|
|
506
508
|
options?: any;
|
|
507
509
|
queryKey?: Mutator;
|
|
508
510
|
queryOptions?: Mutator;
|
|
@@ -568,7 +570,7 @@ interface HookOption {
|
|
|
568
570
|
}
|
|
569
571
|
type HookCommand = string | HookFunction | HookOption | (string | HookFunction | HookOption)[];
|
|
570
572
|
type NormalizedHookCommand = HookCommand[];
|
|
571
|
-
type HooksOptions<T = HookCommand | NormalizedHookCommand> = Partial<Record<Hook, T>>;
|
|
573
|
+
type HooksOptions<T$1 = HookCommand | NormalizedHookCommand> = Partial<Record<Hook, T$1>>;
|
|
572
574
|
type NormalizedHookOptions = HooksOptions<NormalizedHookCommand>;
|
|
573
575
|
type Verbs = 'post' | 'put' | 'get' | 'patch' | 'delete' | 'head';
|
|
574
576
|
declare const Verbs: {
|
|
@@ -639,6 +641,7 @@ type GeneratorImport = {
|
|
|
639
641
|
default?: boolean;
|
|
640
642
|
values?: boolean;
|
|
641
643
|
syntheticDefaultImport?: boolean;
|
|
644
|
+
namespaceImport?: boolean;
|
|
642
645
|
};
|
|
643
646
|
type GeneratorDependency = {
|
|
644
647
|
exports: GeneratorImport[];
|
|
@@ -1503,7 +1506,7 @@ interface DebuggerOptions {
|
|
|
1503
1506
|
declare function createDebugger(ns: string, options?: DebuggerOptions): debug.Debugger['log'];
|
|
1504
1507
|
//#endregion
|
|
1505
1508
|
//#region src/utils/deep-non-nullable.d.ts
|
|
1506
|
-
type DeepNonNullable<T> = T extends Function ? T : T extends readonly (infer U)[] ? DeepNonNullable<NonNullable<U>>[] : T extends object ? { [K in keyof T]: DeepNonNullable<NonNullable<T[K]>> } : NonNullable<T>;
|
|
1509
|
+
type DeepNonNullable<T$1> = T$1 extends Function ? T$1 : T$1 extends readonly (infer U)[] ? DeepNonNullable<NonNullable<U>>[] : T$1 extends object ? { [K in keyof T$1]: DeepNonNullable<NonNullable<T$1[K]>> } : NonNullable<T$1>;
|
|
1507
1510
|
//#endregion
|
|
1508
1511
|
//#region src/utils/doc.d.ts
|
|
1509
1512
|
declare function jsDoc(schema: {
|
|
@@ -1610,7 +1613,7 @@ interface LoggerOptions {
|
|
|
1610
1613
|
declare function createLogger(level?: LogLevel, options?: LoggerOptions): Logger;
|
|
1611
1614
|
//#endregion
|
|
1612
1615
|
//#region src/utils/merge-deep.d.ts
|
|
1613
|
-
declare function mergeDeep<T extends Record<string, any>, U extends Record<string, any>>(source: T, target: U): T & U;
|
|
1616
|
+
declare function mergeDeep<T$1 extends Record<string, any>, U$1 extends Record<string, any>>(source: T$1, target: U$1): T$1 & U$1;
|
|
1614
1617
|
//#endregion
|
|
1615
1618
|
//#region src/utils/occurrence.d.ts
|
|
1616
1619
|
declare const count: (str: string | undefined, key: string) => number;
|
package/dist/index.js
CHANGED
|
@@ -2561,13 +2561,13 @@ const generateMutatorImports = ({ mutators, implementation, oneMore }) => {
|
|
|
2561
2561
|
};
|
|
2562
2562
|
const generateDependency = ({ deps, isAllowSyntheticDefaultImports, dependency, specsName, key, onlyTypes }) => {
|
|
2563
2563
|
const defaultDep = deps.find((e) => e.default && (isAllowSyntheticDefaultImports || !e.syntheticDefaultImport));
|
|
2564
|
-
const
|
|
2565
|
-
const depsString = (0, lodash_uniq.default)(deps.filter((e) => !e.default && !e.syntheticDefaultImport).map(({ name, alias }) => alias ? `${name} as ${alias}` : name)).
|
|
2564
|
+
const namespaceImportDep = defaultDep ? void 0 : deps.find((e) => !!e.namespaceImport || !isAllowSyntheticDefaultImports && e.syntheticDefaultImport);
|
|
2565
|
+
const depsString = (0, lodash_uniq.default)(deps.filter((e) => !e.default && !e.syntheticDefaultImport && !e.namespaceImport).map(({ name, alias }) => alias ? `${name} as ${alias}` : name)).toSorted().join(",\n ");
|
|
2566
2566
|
let importString = "";
|
|
2567
|
-
const
|
|
2568
|
-
if (
|
|
2569
|
-
if (deps.length === 1) return
|
|
2570
|
-
importString += `${
|
|
2567
|
+
const namespaceImportString = namespaceImportDep ? `import * as ${namespaceImportDep.name} from '${dependency}';` : "";
|
|
2568
|
+
if (namespaceImportString) {
|
|
2569
|
+
if (deps.length === 1) return namespaceImportString;
|
|
2570
|
+
importString += `${namespaceImportString}\n`;
|
|
2571
2571
|
}
|
|
2572
2572
|
importString += `import ${onlyTypes ? "type " : ""}${defaultDep ? `${defaultDep.name}${depsString ? "," : ""}` : ""}${depsString ? `{\n ${depsString}\n}` : ""} from '${dependency}${key !== "default" && specsName[key] ? `/${specsName[key]}` : ""}';`;
|
|
2573
2573
|
return importString;
|
|
@@ -2818,7 +2818,7 @@ const generateAxiosOptions = ({ response, isExactOptionalPropertyTypes, queryPar
|
|
|
2818
2818
|
}
|
|
2819
2819
|
if (!isObject(requestOptions) || !requestOptions.hasOwnProperty("responseType")) {
|
|
2820
2820
|
if (response.isBlob) value += `\n responseType: 'blob',`;
|
|
2821
|
-
else if (response.
|
|
2821
|
+
else if (response.contentTypes.at(0) === "text/plain") value += `\n responseType: 'text',`;
|
|
2822
2822
|
}
|
|
2823
2823
|
if (isObject(requestOptions)) value += `\n ${stringify(requestOptions)?.slice(1, -1)}`;
|
|
2824
2824
|
if (isRequestOptions) {
|