@povio/openapi-codegen-cli 3.0.0-rc.2 → 3.0.0-rc.4
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.d.mts +1 -1
- package/dist/acl.mjs +1 -1
- package/dist/{error-handling-CvW_FecB.d.mts → error-handling-B4aYKmyL.d.mts} +18 -3
- package/dist/{error-handling-DkPY7Asf.mjs → error-handling-nneQaE1_.mjs} +39 -5
- package/dist/{generate.runner-BsNMtOTd.mjs → generate.runner-DaqNnVkP.mjs} +1 -1
- package/dist/{generateCodeFromOpenAPIDoc-CbBWYEZG.mjs → generateCodeFromOpenAPIDoc-CjVJQDyw.mjs} +68 -9
- package/dist/generator.mjs +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +2 -2
- package/dist/sh.mjs +3 -3
- package/dist/vite.mjs +2 -2
- package/dist/zod.d.mts +1 -1
- package/dist/zod.mjs +1 -1
- package/package.json +1 -1
package/dist/acl.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as ErrorHandler } from "./error-handling-B4aYKmyL.mjs";
|
|
2
2
|
import * as react from "react";
|
|
3
3
|
import { PropsWithChildren } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
package/dist/acl.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as SharedErrorHandler } from "./error-handling-nneQaE1_.mjs";
|
|
2
2
|
import { n as OpenApiRouter, t as AuthContext } from "./auth.context-Bu5KW2sI.mjs";
|
|
3
3
|
import { createContext, useCallback, useEffect, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -12,13 +12,28 @@ interface ErrorEntry<CodeT> {
|
|
|
12
12
|
condition?: (error: unknown) => boolean;
|
|
13
13
|
getMessage: (t: TFunction<string, undefined>, error: unknown) => string;
|
|
14
14
|
}
|
|
15
|
-
interface
|
|
15
|
+
interface DomainErrorEntry {
|
|
16
|
+
code: string | number;
|
|
17
|
+
condition?: (error: unknown) => boolean;
|
|
18
|
+
getMessage: (t: TFunction<string, undefined>, error: unknown) => string;
|
|
19
|
+
}
|
|
20
|
+
declare class DomainErrorRegistry {
|
|
21
|
+
private static readonly entries;
|
|
22
|
+
static register(entry: DomainErrorEntry): void;
|
|
23
|
+
static register(entries: DomainErrorEntry[]): void;
|
|
24
|
+
static unregister(code: string | number): void;
|
|
25
|
+
static clear(): void;
|
|
26
|
+
static getEntry(code: string | number): DomainErrorEntry | undefined;
|
|
27
|
+
}
|
|
28
|
+
interface ErrorHandlerOptions<CodeT extends string | number> {
|
|
16
29
|
entries: ErrorEntry<CodeT>[];
|
|
17
30
|
t?: TFunction<string, undefined>;
|
|
18
31
|
onRethrowError?: (error: unknown, exception: ApplicationException<CodeT | GeneralErrorCodes>) => void;
|
|
19
32
|
}
|
|
20
|
-
declare class ErrorHandler<CodeT extends string> {
|
|
33
|
+
declare class ErrorHandler<CodeT extends string | number> {
|
|
21
34
|
entries: ErrorEntry<CodeT | GeneralErrorCodes>[];
|
|
35
|
+
private readonly userEntries;
|
|
36
|
+
private readonly generalEntries;
|
|
22
37
|
private t;
|
|
23
38
|
private onRethrowError?;
|
|
24
39
|
constructor({
|
|
@@ -35,4 +50,4 @@ declare class ErrorHandler<CodeT extends string> {
|
|
|
35
50
|
}
|
|
36
51
|
declare const SharedErrorHandler: ErrorHandler<never>;
|
|
37
52
|
//#endregion
|
|
38
|
-
export {
|
|
53
|
+
export { ErrorHandler as a, SharedErrorHandler as c, ErrorEntry as i, DomainErrorEntry as n, ErrorHandlerOptions as o, DomainErrorRegistry as r, GeneralErrorCodes as s, ApplicationException as t };
|
|
@@ -53,6 +53,7 @@ let RestUtils;
|
|
|
53
53
|
if (!e.response) return null;
|
|
54
54
|
const data = e.response.data;
|
|
55
55
|
if (typeof data?.code === "string") return data.code;
|
|
56
|
+
if (typeof data?.code === "number") return data.code;
|
|
56
57
|
return null;
|
|
57
58
|
};
|
|
58
59
|
_RestUtils.doesServerErrorMessageContain = (e, text) => {
|
|
@@ -85,8 +86,26 @@ var ApplicationException = class extends Error {
|
|
|
85
86
|
this.serverMessage = serverMessage;
|
|
86
87
|
}
|
|
87
88
|
};
|
|
89
|
+
var DomainErrorRegistry = class {
|
|
90
|
+
static entries = /* @__PURE__ */ new Map();
|
|
91
|
+
static register(entryOrEntries) {
|
|
92
|
+
const items = Array.isArray(entryOrEntries) ? entryOrEntries : [entryOrEntries];
|
|
93
|
+
for (const item of items) this.entries.set(item.code, item);
|
|
94
|
+
}
|
|
95
|
+
static unregister(code) {
|
|
96
|
+
this.entries.delete(code);
|
|
97
|
+
}
|
|
98
|
+
static clear() {
|
|
99
|
+
this.entries.clear();
|
|
100
|
+
}
|
|
101
|
+
static getEntry(code) {
|
|
102
|
+
return this.entries.get(code);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
88
105
|
var ErrorHandler = class {
|
|
89
106
|
entries = [];
|
|
107
|
+
userEntries;
|
|
108
|
+
generalEntries;
|
|
90
109
|
t;
|
|
91
110
|
onRethrowError;
|
|
92
111
|
constructor({ entries, t = defaultT, onRethrowError }) {
|
|
@@ -138,14 +157,15 @@ var ErrorHandler = class {
|
|
|
138
157
|
return this.t("openapi.sharedErrors.unknownError");
|
|
139
158
|
}
|
|
140
159
|
};
|
|
141
|
-
this.
|
|
142
|
-
|
|
160
|
+
this.userEntries = [...entries];
|
|
161
|
+
this.generalEntries = [
|
|
143
162
|
dataValidationError,
|
|
144
163
|
internalError,
|
|
145
164
|
networkError,
|
|
146
165
|
canceledError,
|
|
147
166
|
unknownError
|
|
148
167
|
];
|
|
168
|
+
this.entries = [...this.userEntries, ...this.generalEntries];
|
|
149
169
|
}
|
|
150
170
|
matchesEntry(error, entry, code) {
|
|
151
171
|
if (entry.condition) return entry.condition(error);
|
|
@@ -156,9 +176,23 @@ var ErrorHandler = class {
|
|
|
156
176
|
}
|
|
157
177
|
rethrowError(error) {
|
|
158
178
|
const code = RestUtils.extractServerResponseCode(error);
|
|
159
|
-
const errorEntry = this.entries.find((entry) => this.matchesEntry(error, entry, code));
|
|
160
179
|
const serverMessage = RestUtils.extractServerErrorMessage(error);
|
|
161
|
-
const
|
|
180
|
+
const userEntry = this.userEntries.find((entry) => this.matchesEntry(error, entry, code));
|
|
181
|
+
if (userEntry) {
|
|
182
|
+
const exception = new ApplicationException(userEntry.getMessage(this.t, error), userEntry.code, serverMessage);
|
|
183
|
+
this.onRethrowError?.(error, exception);
|
|
184
|
+
throw exception;
|
|
185
|
+
}
|
|
186
|
+
if (code !== null) {
|
|
187
|
+
const registryEntry = DomainErrorRegistry.getEntry(code);
|
|
188
|
+
if (registryEntry && (!registryEntry.condition || registryEntry.condition(error))) {
|
|
189
|
+
const exception = new ApplicationException(registryEntry.getMessage(this.t, error), registryEntry.code, serverMessage);
|
|
190
|
+
this.onRethrowError?.(error, exception);
|
|
191
|
+
throw exception;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const generalEntry = this.generalEntries.find((entry) => this.matchesEntry(error, entry, code));
|
|
195
|
+
const exception = new ApplicationException(generalEntry.getMessage(this.t, error), generalEntry.code, serverMessage);
|
|
162
196
|
this.onRethrowError?.(error, exception);
|
|
163
197
|
throw exception;
|
|
164
198
|
}
|
|
@@ -184,4 +218,4 @@ var ErrorHandler = class {
|
|
|
184
218
|
const SharedErrorHandler = new ErrorHandler({ entries: [] });
|
|
185
219
|
|
|
186
220
|
//#endregion
|
|
187
|
-
export {
|
|
221
|
+
export { RestUtils as a, SharedErrorHandler as i, DomainErrorRegistry as n, ns as o, ErrorHandler as r, resources as s, ApplicationException as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as Profiler, h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { S as Profiler, h as deepMerge, i as writeGenerateFileData, p as DEFAULT_GENERATE_OPTIONS, r as removeStaleGeneratedFiles, t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-CjVJQDyw.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
4
4
|
|
package/dist/{generateCodeFromOpenAPIDoc-CbBWYEZG.mjs → generateCodeFromOpenAPIDoc-CjVJQDyw.mjs}
RENAMED
|
@@ -915,6 +915,10 @@ const APP_REST_CLIENT_FILE = {
|
|
|
915
915
|
fileName: "app-rest-client",
|
|
916
916
|
extension: "ts"
|
|
917
917
|
};
|
|
918
|
+
const DOMAIN_ERRORS_FILE = {
|
|
919
|
+
fileName: "domain-errors",
|
|
920
|
+
extension: "ts"
|
|
921
|
+
};
|
|
918
922
|
const QUERY_OPTIONS_TYPES = {
|
|
919
923
|
query: "AppQueryOptions",
|
|
920
924
|
infiniteQuery: "AppInfiniteQueryOptions",
|
|
@@ -2379,11 +2383,21 @@ function getEndpointsFromOpenAPIDoc(resolver) {
|
|
|
2379
2383
|
endpoint.response = responseZodSchema;
|
|
2380
2384
|
endpoint.responseObject = responseObj;
|
|
2381
2385
|
endpoint.responseDescription = responseObj?.description;
|
|
2382
|
-
} else if (statusCode !== "default" && !Number.isNaN(status) && isErrorStatus(status))
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2386
|
+
} else if (statusCode !== "default" && !Number.isNaN(status) && isErrorStatus(status)) {
|
|
2387
|
+
const rawSchema = schemaObject;
|
|
2388
|
+
const domainStr = rawSchema["x-domain-error-domain"];
|
|
2389
|
+
const codeEnumArr = ((rawSchema?.properties)?.code)?.enum;
|
|
2390
|
+
const domainCode = Array.isArray(codeEnumArr) && codeEnumArr.length === 1 && typeof codeEnumArr[0] === "number" ? codeEnumArr[0] : void 0;
|
|
2391
|
+
endpoint.errors.push({
|
|
2392
|
+
zodSchema: responseZodSchema,
|
|
2393
|
+
status,
|
|
2394
|
+
description: responseObj?.description,
|
|
2395
|
+
...typeof domainStr === "string" && domainCode !== void 0 ? { domainError: {
|
|
2396
|
+
domain: domainStr,
|
|
2397
|
+
code: domainCode
|
|
2398
|
+
} } : {}
|
|
2399
|
+
});
|
|
2400
|
+
}
|
|
2387
2401
|
} else {
|
|
2388
2402
|
const status = Number(statusCode);
|
|
2389
2403
|
const responseZodSchema = VOID_SCHEMA;
|
|
@@ -4452,7 +4466,7 @@ function renderInfiniteQueryOptions({ resolver, endpoint, inlineEndpoints }) {
|
|
|
4452
4466
|
lines.push(` queryKey: keys.${getEndpointName(endpoint)}Infinite(${endpointArgsWithoutPage}),`);
|
|
4453
4467
|
lines.push(` queryFn: ({ pageParam }: { pageParam: number }) => ${endpointFunction}(${endpointArgsWithPage}${hasAxiosRequestConfig ? `, ${AXIOS_REQUEST_CONFIG_NAME}` : ""}),`);
|
|
4454
4468
|
lines.push(" initialPageParam: 1,");
|
|
4455
|
-
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }) => {`);
|
|
4469
|
+
lines.push(` getNextPageParam: ({ ${resolver.options.infiniteQueryResponseParamNames.page}, ${resolver.options.infiniteQueryResponseParamNames.totalItems}, ${resolver.options.infiniteQueryResponseParamNames.limit}: limitParam }: Awaited<ReturnType<typeof ${endpointFunction}>>) => {`);
|
|
4456
4470
|
lines.push(` const pageParam = ${resolver.options.infiniteQueryResponseParamNames.page} ?? 1;`);
|
|
4457
4471
|
lines.push(` return pageParam * limitParam < ${resolver.options.infiniteQueryResponseParamNames.totalItems} ? pageParam + 1 : null;`);
|
|
4458
4472
|
lines.push(" },");
|
|
@@ -4476,9 +4490,10 @@ function renderPrefetchInfiniteQuery({ resolver, endpoint }) {
|
|
|
4476
4490
|
modelNamespaceTag: getEndpointTag(endpoint, resolver.options)
|
|
4477
4491
|
});
|
|
4478
4492
|
const endpointArgs = renderEndpointArgs(resolver, endpoint, { excludePageParam: true });
|
|
4493
|
+
const optionsArgs = `${endpointParams ? `{ ${endpointArgs} }` : ""}${hasAxiosRequestConfig ? `${endpointParams ? ", " : ""}${AXIOS_REQUEST_CONFIG_NAME}` : ""}`;
|
|
4479
4494
|
const lines = [];
|
|
4480
4495
|
lines.push(`export const ${getPrefetchInfiniteQueryName(endpoint)} = (queryClient: QueryClient, ${endpointParams ? `{ ${endpointArgs} }: { ${endpointParams} }, ` : ""}${hasAxiosRequestConfig ? `${AXIOS_REQUEST_CONFIG_NAME}: ${AXIOS_REQUEST_CONFIG_TYPE}, ` : ""}options?: Omit<Parameters<QueryClient["prefetchInfiniteQuery"]>[0], "queryKey" | "queryFn" | "initialPageParam" | "getNextPageParam">): void => {`);
|
|
4481
|
-
lines.push(` void queryClient.prefetchInfiniteQuery({ ...${getInfiniteQueryOptionsName(endpoint)}(${
|
|
4496
|
+
lines.push(` void queryClient.prefetchInfiniteQuery({ ...${getInfiniteQueryOptionsName(endpoint)}(${optionsArgs}), ...(options as {}) });`);
|
|
4482
4497
|
lines.push("};");
|
|
4483
4498
|
return lines.join("\n");
|
|
4484
4499
|
}
|
|
@@ -4581,7 +4596,7 @@ function renderMutation({ resolver, endpoint, inlineEndpoints, precomputed }) {
|
|
|
4581
4596
|
paramTypes: workspaceParamTypes,
|
|
4582
4597
|
indent: " "
|
|
4583
4598
|
}));
|
|
4584
|
-
if (hasMutationEffects) lines.push(` const { runMutationEffects } = useMutationEffects
|
|
4599
|
+
if (hasMutationEffects) lines.push(` const { runMutationEffects } = useMutationEffects<${QUERY_MODULE_ENUM}.${tag}>({ currentModule: ${QUERIES_MODULE_NAME} });`);
|
|
4585
4600
|
lines.push("");
|
|
4586
4601
|
lines.push(` return ${QUERY_HOOKS.mutation}({`);
|
|
4587
4602
|
const nonPathDestructuredArgs = isScoped ? renderEndpointArgs(resolver, endpoint, {
|
|
@@ -4748,6 +4763,36 @@ export const ${APP_REST_CLIENT_NAME} = new RestClient({
|
|
|
4748
4763
|
`;
|
|
4749
4764
|
}
|
|
4750
4765
|
|
|
4766
|
+
//#endregion
|
|
4767
|
+
//#region src/generators/generate/generateDomainErrors.ts
|
|
4768
|
+
function domainToPascalCase(domain) {
|
|
4769
|
+
return domain.split(/[-_]/).map(capitalize).join("");
|
|
4770
|
+
}
|
|
4771
|
+
function generateDomainErrors({ data }) {
|
|
4772
|
+
const byDomain = /* @__PURE__ */ new Map();
|
|
4773
|
+
for (const { endpoints } of data.values()) for (const endpoint of endpoints) for (const error of endpoint.errors) {
|
|
4774
|
+
if (!error.domainError) continue;
|
|
4775
|
+
const { domain, code } = error.domainError;
|
|
4776
|
+
if (!byDomain.has(domain)) byDomain.set(domain, /* @__PURE__ */ new Map());
|
|
4777
|
+
const domainMap = byDomain.get(domain);
|
|
4778
|
+
if (!domainMap.has(code)) domainMap.set(code, {
|
|
4779
|
+
code,
|
|
4780
|
+
description: error.description
|
|
4781
|
+
});
|
|
4782
|
+
}
|
|
4783
|
+
if (byDomain.size === 0) return void 0;
|
|
4784
|
+
const blocks = [];
|
|
4785
|
+
for (const [domain, codes] of [...byDomain.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
4786
|
+
const pascalName = domainToPascalCase(domain);
|
|
4787
|
+
const entries = [...codes.values()].sort((a, b) => a.code - b.code).map(({ code, description }) => {
|
|
4788
|
+
return `${description ? ` /** ${description} */\n ` : " "}ERROR_${code}: ${code}`;
|
|
4789
|
+
}).join(",\n");
|
|
4790
|
+
blocks.push(`export const ${pascalName}DomainErrors = {\n${entries},\n} as const;`);
|
|
4791
|
+
blocks.push(`export type ${pascalName}DomainErrorCode = (typeof ${pascalName}DomainErrors)[keyof typeof ${pascalName}DomainErrors];`);
|
|
4792
|
+
}
|
|
4793
|
+
return blocks.join("\n\n") + "\n";
|
|
4794
|
+
}
|
|
4795
|
+
|
|
4751
4796
|
//#endregion
|
|
4752
4797
|
//#region src/generators/generate/generateQueryModules.ts
|
|
4753
4798
|
function generateQueryModules({ resolver, data }) {
|
|
@@ -4802,6 +4847,20 @@ function getMutationEffectsFiles(data, resolver) {
|
|
|
4802
4847
|
function getZodExtendedFiles(_data, _resolver) {
|
|
4803
4848
|
return [];
|
|
4804
4849
|
}
|
|
4850
|
+
function getDomainErrorsFiles(data, resolver) {
|
|
4851
|
+
const content = generateDomainErrors({
|
|
4852
|
+
resolver,
|
|
4853
|
+
data
|
|
4854
|
+
});
|
|
4855
|
+
if (!content) return [];
|
|
4856
|
+
return [{
|
|
4857
|
+
fileName: getOutputFileName({
|
|
4858
|
+
output: resolver.options.output,
|
|
4859
|
+
fileName: getFileNameWithExtension(DOMAIN_ERRORS_FILE)
|
|
4860
|
+
}),
|
|
4861
|
+
content
|
|
4862
|
+
}];
|
|
4863
|
+
}
|
|
4805
4864
|
function getAppRestClientFiles(resolver) {
|
|
4806
4865
|
if (resolver.options.restClientImportPath !== DEFAULT_GENERATE_OPTIONS.restClientImportPath) return [];
|
|
4807
4866
|
return [{
|
|
@@ -4864,7 +4923,7 @@ function generateCodeFromOpenAPIDoc(openApiDoc, options, profiler) {
|
|
|
4864
4923
|
}
|
|
4865
4924
|
});
|
|
4866
4925
|
});
|
|
4867
|
-
if (!modelsOnly) generateFilesData.push(...p.runSync("render.AclShared", () => getAclFiles(data, resolver)), ...p.runSync("render.MutationEffects", () => getMutationEffectsFiles(data, resolver)), ...p.runSync("render.ZodExtended", () => getZodExtendedFiles(data, resolver)), ...p.runSync("render.Standalone", () => getAppRestClientFiles(resolver)));
|
|
4926
|
+
if (!modelsOnly) generateFilesData.push(...p.runSync("render.AclShared", () => getAclFiles(data, resolver)), ...p.runSync("render.MutationEffects", () => getMutationEffectsFiles(data, resolver)), ...p.runSync("render.ZodExtended", () => getZodExtendedFiles(data, resolver)), ...p.runSync("render.Standalone", () => getAppRestClientFiles(resolver)), ...p.runSync("render.DomainErrors", () => getDomainErrorsFiles(data, resolver)));
|
|
4868
4927
|
return generateFilesData;
|
|
4869
4928
|
}
|
|
4870
4929
|
|
package/dist/generator.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as isParamMediaTypeAllowed, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, g as invalidVariableNameCharactersToCamel, l as getTsTypeBase, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as GenerateType, x as formatTag, y as isMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-
|
|
1
|
+
import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as isParamMediaTypeAllowed, c as getSchemaTsMetaType, d as getTagImportPath, f as getQueryName, g as invalidVariableNameCharactersToCamel, l as getTsTypeBase, o as isMutation, p as DEFAULT_GENERATE_OPTIONS, s as isQuery, t as generateCodeFromOpenAPIDoc, v as GenerateType, x as formatTag, y as isMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-CjVJQDyw.mjs";
|
|
2
2
|
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
3
3
|
|
|
4
4
|
//#region src/generators/core/getMetadataFromOpenAPIDoc.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as ErrorHandler, c as SharedErrorHandler, i as ErrorEntry, n as DomainErrorEntry, o as ErrorHandlerOptions, r as DomainErrorRegistry, s as GeneralErrorCodes, t as ApplicationException } from "./error-handling-B4aYKmyL.mjs";
|
|
2
2
|
import "./options-BPAjzilp.mjs";
|
|
3
3
|
import { t as OpenAPICodegenConfig } from "./config-C1ME3Ay4.mjs";
|
|
4
4
|
import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, CreateAxiosDefaults } from "axios";
|
|
@@ -65,7 +65,7 @@ declare class RestClient$1 implements RestClient {
|
|
|
65
65
|
//#endregion
|
|
66
66
|
//#region src/lib/rest/rest.utils.d.ts
|
|
67
67
|
declare namespace RestUtils {
|
|
68
|
-
const extractServerResponseCode: (e: unknown) => string | null;
|
|
68
|
+
const extractServerResponseCode: (e: unknown) => string | number | null;
|
|
69
69
|
const doesServerErrorMessageContain: (e: AxiosError, text: string) => boolean;
|
|
70
70
|
const extractServerErrorMessage: (e: unknown) => string | null;
|
|
71
71
|
const extractContentDispositionFilename: (headers: AxiosResponseHeaders) => string | undefined;
|
|
@@ -110,7 +110,7 @@ interface MutationEffectsOptions<TQueryModule extends QueryModule = QueryModule>
|
|
|
110
110
|
invalidateCurrentModule?: boolean;
|
|
111
111
|
crossTabInvalidation?: boolean;
|
|
112
112
|
invalidationMap?: InvalidationMap<TQueryModule>;
|
|
113
|
-
invalidateModules?:
|
|
113
|
+
invalidateModules?: QueryModule[];
|
|
114
114
|
invalidateKeys?: QueryKey[];
|
|
115
115
|
preferUpdate?: boolean;
|
|
116
116
|
}
|
|
@@ -228,4 +228,4 @@ declare const AuthGuard: ({
|
|
|
228
228
|
children
|
|
229
229
|
}: PropsWithChildren<AuthGuardProps>) => react.ReactNode;
|
|
230
230
|
//#endregion
|
|
231
|
-
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MutationEffectsOptions, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
|
231
|
+
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type DomainErrorEntry, DomainErrorRegistry, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MutationEffectsOptions, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RestUtils, i as SharedErrorHandler, n as DomainErrorRegistry, o as ns, r as ErrorHandler, s as resources, t as ApplicationException } from "./error-handling-nneQaE1_.mjs";
|
|
2
2
|
import { n as OpenApiRouter, t as AuthContext } from "./auth.context-Bu5KW2sI.mjs";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -250,4 +250,4 @@ const AuthGuard = ({ type, redirectTo, children }) => {
|
|
|
250
250
|
};
|
|
251
251
|
|
|
252
252
|
//#endregion
|
|
253
|
-
export { ApplicationException, AuthContext, AuthGuard, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
|
253
|
+
export { ApplicationException, AuthContext, AuthGuard, DomainErrorRegistry, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/sh.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, v as GenerateType } from "./generateCodeFromOpenAPIDoc-
|
|
3
|
-
import { n as resolveConfig, t as runGenerate } from "./generate.runner-
|
|
2
|
+
import { C as VALIDATION_ERROR_TYPE_TITLE, S as Profiler, a as getDataFromOpenAPIDoc, m as groupByType, n as getOutputFileName, u as getTagFileName, v as GenerateType } from "./generateCodeFromOpenAPIDoc-CjVJQDyw.mjs";
|
|
3
|
+
import { n as resolveConfig, t as runGenerate } from "./generate.runner-DaqNnVkP.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import yargs from "yargs";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -39,7 +39,7 @@ function logBanner(message) {
|
|
|
39
39
|
* Fetch the version from package.json
|
|
40
40
|
*/
|
|
41
41
|
function getVersion() {
|
|
42
|
-
return "3.0.0-rc.
|
|
42
|
+
return "3.0.0-rc.4";
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
//#endregion
|
package/dist/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as Profiler } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import { t as runGenerate } from "./generate.runner-
|
|
1
|
+
import { S as Profiler } from "./generateCodeFromOpenAPIDoc-CjVJQDyw.mjs";
|
|
2
|
+
import { t as runGenerate } from "./generate.runner-DaqNnVkP.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
|
|
5
5
|
//#region src/vite/openapi-codegen.plugin.ts
|
package/dist/zod.d.mts
CHANGED
package/dist/zod.mjs
CHANGED