@povio/openapi-codegen-cli 3.2.0-rc.8 → 3.3.0-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.
- package/README.md +2 -51
- package/dist/acl.d.mts +19 -6
- package/dist/acl.mjs +7 -6
- package/dist/{auth.context-YFWzkwoN.mjs → auth.context-BAz8frX9.mjs} +1 -2
- package/dist/{config-DgrOddSC.d.mts → config-BQqze8rU.d.mts} +2 -1
- package/dist/{error-handling-BMXC5P08.mjs → error-handling-CsnufAil.mjs} +12 -22
- package/dist/{error-handling-CNOHs4Fc.d.mts → error-handling-D6ZYITQ3.d.mts} +4 -1
- package/dist/generate.runner-BeCGJ1ar.mjs +87 -0
- package/dist/{generateCodeFromOpenAPIDoc-CZT3sThI.cjs → generateCodeFromOpenAPIDoc-KQT4kYxY.mjs} +2375 -1403
- package/dist/generator.d.mts +10 -3
- package/dist/generator.mjs +4 -6
- package/dist/index.d.mts +47 -12
- package/dist/index.mjs +3 -6
- package/dist/metro.cjs +4861 -112
- package/dist/metro.d.mts +4 -3
- package/dist/metro.mjs +3 -3
- package/dist/{openapi-codegen.runner-C93V7SGj.mjs → openapi-codegen.runner-nPBssrBL.mjs} +2 -2
- package/dist/{openapi-source.runner-BZ6ZLgRO.mjs → openapi-source.runner-8kCe-g9S.mjs} +6 -18
- package/dist/{openapi-source.runner-ykstqlPC.d.mts → openapi-source.runner-B6KKrXw7.d.mts} +8 -2
- package/dist/{options-KPf-Fti5.d.mts → options-DdQJ9BSc.d.mts} +1 -6
- package/dist/sh.d.mts +1 -1
- package/dist/sh.mjs +53 -36
- package/dist/tiny.d.mts +1 -1
- package/dist/tiny.mjs +1 -1
- package/dist/vite.d.mts +4 -3
- package/dist/vite.mjs +4 -5
- package/dist/zod.d.mts +7 -2
- package/dist/zod.mjs +1 -1
- package/package.json +22 -32
- package/dist/generate.runner-BvSprH6D.mjs +0 -1683
- package/dist/generate.utils-CH2U2Dpr.cjs +0 -2314
- package/dist/generateCodeFromOpenAPIDoc-glAKBEGP.mjs +0 -2036
- package/dist/getDataFromOpenAPIDoc-7RxjULpB.mjs +0 -2011
- package/dist/native-rest-interceptor-CAWR8H5Y.mjs +0 -208
- package/dist/native-rest-interceptor-Cz6saoq5.d.mts +0 -46
- package/dist/native.d.mts +0 -3
- package/dist/native.mjs +0 -3
- package/dist/openapi-codegen-native-darwin-arm64.node +0 -0
- package/dist/openapi-codegen-native-linux-x64.node +0 -0
- package/dist/openapi-codegen-native-win32-x64.node +0 -0
- package/dist/rest-transport.types-DM5-qyOJ.d.mts +0 -66
- package/dist/rest-transport.types-DxitRtsB.mjs +0 -11
- package/dist/rest.d.mts +0 -2
- package/dist/rest.mjs +0 -2
package/dist/generator.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as GenerateFileData, t as GenerateOptions } from "./options-
|
|
1
|
+
import { n as GenerateFileData, t as GenerateOptions } from "./options-DdQJ9BSc.mjs";
|
|
2
2
|
import { OpenAPIV3 } from "openapi-types";
|
|
3
|
+
|
|
3
4
|
//#region src/generators/types/metadata.d.ts
|
|
4
5
|
interface GenerateParams {
|
|
5
6
|
input: string;
|
|
@@ -52,7 +53,13 @@ interface GenerateMetadata {
|
|
|
52
53
|
}
|
|
53
54
|
//#endregion
|
|
54
55
|
//#region src/generator.d.ts
|
|
55
|
-
declare function getGenerateMetadata({
|
|
56
|
-
|
|
56
|
+
declare function getGenerateMetadata({
|
|
57
|
+
input,
|
|
58
|
+
options: genOptions
|
|
59
|
+
}: GenerateParams): Promise<GenerateMetadata>;
|
|
60
|
+
declare function getGenerateFilesData({
|
|
61
|
+
input,
|
|
62
|
+
options: genOptions
|
|
63
|
+
}: GenerateParams): Promise<GenerateFileData[]>;
|
|
57
64
|
//#endregion
|
|
58
65
|
export { getGenerateFilesData, getGenerateMetadata };
|
package/dist/generator.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as generateCodeFromOpenAPIDoc } from "./generateCodeFromOpenAPIDoc-
|
|
2
|
-
import
|
|
3
|
-
import { H as getQueryName, In as formatTag, Kt as getNamespaceName, O as getTagImportPath, S as getTsTypeBase, Tt as invalidVariableNameCharactersToCamel, d as isQuery, dt as DEFAULT_GENERATE_OPTIONS, en as isMediaTypeAllowed, t as getOpenApiDoc, tn as isParamMediaTypeAllowed, u as isMutation, x as getSchemaTsMetaType } from "./generate.runner-BvSprH6D.mjs";
|
|
1
|
+
import { _ as getNamespaceName, a as getDataFromOpenAPIDoc, b as formatTag, 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 isMediaTypeAllowed, y as isParamMediaTypeAllowed } from "./generateCodeFromOpenAPIDoc-KQT4kYxY.mjs";
|
|
2
|
+
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
4
3
|
//#region src/generators/core/getMetadataFromOpenAPIDoc.ts
|
|
5
4
|
async function getMetadataFromOpenAPIDoc(openApiDoc, options) {
|
|
6
5
|
const { resolver, data } = await getDataFromOpenAPIDoc(openApiDoc, options);
|
|
@@ -129,15 +128,14 @@ async function getGenerateMetadata({ input, options: genOptions }) {
|
|
|
129
128
|
...DEFAULT_GENERATE_OPTIONS,
|
|
130
129
|
...genOptions
|
|
131
130
|
};
|
|
132
|
-
return await getMetadataFromOpenAPIDoc(await
|
|
131
|
+
return await getMetadataFromOpenAPIDoc(await SwaggerParser.bundle(input), options);
|
|
133
132
|
}
|
|
134
133
|
async function getGenerateFilesData({ input, options: genOptions }) {
|
|
135
134
|
const options = {
|
|
136
135
|
...DEFAULT_GENERATE_OPTIONS,
|
|
137
136
|
...genOptions
|
|
138
137
|
};
|
|
139
|
-
|
|
140
|
-
return generateCodeFromOpenAPIDoc(openApiDoc, options);
|
|
138
|
+
return generateCodeFromOpenAPIDoc(await SwaggerParser.bundle(input), options);
|
|
141
139
|
}
|
|
142
140
|
//#endregion
|
|
143
141
|
export { getGenerateFilesData, getGenerateMetadata };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as ErrorHandler, c as SharedErrorHandler, d as ns, f as resources, i as ErrorEntry, l as TranslateFunction, n as DomainErrorEntry, o as ErrorHandlerOptions, r as DomainErrorRegistry, s as GeneralErrorCodes, t as ApplicationException, u as configureTranslations } from "./error-handling-
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as TransportResponse, l as TransportRequest, n as HttpError, p as UploadProgress, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
|
|
4
|
-
import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-Cz6saoq5.mjs";
|
|
1
|
+
import { a as ErrorHandler, c as SharedErrorHandler, d as ns, f as resources, i as ErrorEntry, l as TranslateFunction, n as DomainErrorEntry, o as ErrorHandlerOptions, r as DomainErrorRegistry, s as GeneralErrorCodes, t as ApplicationException, u as configureTranslations } from "./error-handling-D6ZYITQ3.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BQqze8rU.mjs";
|
|
5
3
|
import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, CreateAxiosDefaults } from "axios";
|
|
6
4
|
import { z } from "zod";
|
|
5
|
+
import * as _$react from "react";
|
|
7
6
|
import { PropsWithChildren, ReactNode } from "react";
|
|
8
7
|
import { InfiniteData, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
8
|
+
|
|
9
9
|
//#region src/lib/rest/rest-interceptor.d.ts
|
|
10
10
|
declare class RestInterceptor<T extends any[]> {
|
|
11
11
|
private applyInterceptor;
|
|
@@ -41,7 +41,11 @@ interface RestClient {
|
|
|
41
41
|
declare class RestClient$1 implements RestClient {
|
|
42
42
|
private readonly client;
|
|
43
43
|
private readonly errorHandler;
|
|
44
|
-
constructor({
|
|
44
|
+
constructor({
|
|
45
|
+
config,
|
|
46
|
+
interceptors,
|
|
47
|
+
errorHandler
|
|
48
|
+
}?: {
|
|
45
49
|
config?: CreateAxiosDefaults;
|
|
46
50
|
interceptors?: RestInterceptor<any[]>[];
|
|
47
51
|
errorHandler?: ErrorHandler<any>;
|
|
@@ -88,7 +92,15 @@ declare namespace OpenApiQueryConfig {
|
|
|
88
92
|
onError?: (error: unknown) => void;
|
|
89
93
|
}
|
|
90
94
|
type ProviderProps<TQueryModule extends QueryModule = QueryModule> = Type<TQueryModule>;
|
|
91
|
-
export function Provider<TQueryModule extends QueryModule = QueryModule>({
|
|
95
|
+
export function Provider<TQueryModule extends QueryModule = QueryModule>({
|
|
96
|
+
preferUpdate,
|
|
97
|
+
invalidateCurrentModule,
|
|
98
|
+
invalidationMap,
|
|
99
|
+
crossTabInvalidation,
|
|
100
|
+
allowInvalidResponseData,
|
|
101
|
+
onError,
|
|
102
|
+
children
|
|
103
|
+
}: PropsWithChildren<ProviderProps<TQueryModule>>): _$react.JSX.Element;
|
|
92
104
|
export const useConfig: <TQueryModule extends QueryModule = QueryModule>() => Type<TQueryModule>;
|
|
93
105
|
export {};
|
|
94
106
|
}
|
|
@@ -105,7 +117,9 @@ interface MutationEffectsOptions<TQueryModule extends QueryModule = QueryModule>
|
|
|
105
117
|
interface UseMutationEffectsProps<TQueryModule extends QueryModule = QueryModule> {
|
|
106
118
|
currentModule: TQueryModule;
|
|
107
119
|
}
|
|
108
|
-
declare function useMutationEffects<TQueryModule extends QueryModule = QueryModule>({
|
|
120
|
+
declare function useMutationEffects<TQueryModule extends QueryModule = QueryModule>({
|
|
121
|
+
currentModule
|
|
122
|
+
}: UseMutationEffectsProps<TQueryModule>): {
|
|
109
123
|
runMutationEffects: <TData, TVariables>(data: TData, variables: TVariables, options?: MutationEffectsOptions<TQueryModule>, updateKeys?: QueryKey[]) => Promise<void>;
|
|
110
124
|
};
|
|
111
125
|
//#endregion
|
|
@@ -114,7 +128,10 @@ interface RouterProviderProps {
|
|
|
114
128
|
replace: (url: string) => void;
|
|
115
129
|
}
|
|
116
130
|
declare namespace OpenApiRouter {
|
|
117
|
-
const Provider: ({
|
|
131
|
+
const Provider: ({
|
|
132
|
+
children,
|
|
133
|
+
replace
|
|
134
|
+
}: PropsWithChildren<RouterProviderProps>) => _$react.JSX.Element;
|
|
118
135
|
const useRouter: () => RouterProviderProps;
|
|
119
136
|
}
|
|
120
137
|
//#endregion
|
|
@@ -124,7 +141,10 @@ interface WorkspaceProviderProps {
|
|
|
124
141
|
values?: WorkspaceValues;
|
|
125
142
|
}
|
|
126
143
|
declare namespace OpenApiWorkspaceContext {
|
|
127
|
-
const Provider: ({
|
|
144
|
+
const Provider: ({
|
|
145
|
+
values,
|
|
146
|
+
children
|
|
147
|
+
}: PropsWithChildren<WorkspaceProviderProps>) => _$react.JSX.Element;
|
|
128
148
|
const useContext: <TValues extends WorkspaceValues = WorkspaceValues>() => TValues;
|
|
129
149
|
const resolveParam: <T>(context: WorkspaceValues, name: string, value: T | null | undefined) => T;
|
|
130
150
|
}
|
|
@@ -148,7 +168,18 @@ declare namespace AuthContext {
|
|
|
148
168
|
loadingState?: ReactNode;
|
|
149
169
|
}
|
|
150
170
|
type ProviderProps<TUser = unknown> = Type<TUser>;
|
|
151
|
-
export const Provider: <TUser>({
|
|
171
|
+
export const Provider: <TUser>({
|
|
172
|
+
isAuthenticated,
|
|
173
|
+
isInitializing,
|
|
174
|
+
logout,
|
|
175
|
+
updateTokens,
|
|
176
|
+
accessToken,
|
|
177
|
+
user,
|
|
178
|
+
userPromise,
|
|
179
|
+
routes,
|
|
180
|
+
loadingState,
|
|
181
|
+
children
|
|
182
|
+
}: PropsWithChildren<ProviderProps<TUser>>) => _$react.JSX.Element;
|
|
152
183
|
export const useAuth: <TUser>() => Type<TUser>;
|
|
153
184
|
export {};
|
|
154
185
|
}
|
|
@@ -158,6 +189,10 @@ interface AuthGuardProps {
|
|
|
158
189
|
type: "public-only" | "private";
|
|
159
190
|
redirectTo?: string;
|
|
160
191
|
}
|
|
161
|
-
declare const AuthGuard: ({
|
|
192
|
+
declare const AuthGuard: ({
|
|
193
|
+
type,
|
|
194
|
+
redirectTo,
|
|
195
|
+
children
|
|
196
|
+
}: PropsWithChildren<AuthGuardProps>) => _$react.ReactNode;
|
|
162
197
|
//#endregion
|
|
163
|
-
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,
|
|
198
|
+
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, type TranslateFunction, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { a as RestUtils, c as resources, i as SharedErrorHandler, n as DomainErrorRegistry, o as configureTranslations, r as ErrorHandler, s as ns, t as ApplicationException } from "./error-handling-
|
|
2
|
-
import { t as
|
|
3
|
-
import { n as NativeRestClient, t as NativeRestInterceptor } from "./native-rest-interceptor-CAWR8H5Y.mjs";
|
|
4
|
-
import { n as OpenApiRouter, t as AuthContext } from "./auth.context-YFWzkwoN.mjs";
|
|
1
|
+
import { a as RestUtils, c as resources, i as SharedErrorHandler, n as DomainErrorRegistry, o as configureTranslations, r as ErrorHandler, s as ns, t as ApplicationException } from "./error-handling-CsnufAil.mjs";
|
|
2
|
+
import { n as OpenApiRouter, t as AuthContext } from "./auth.context-BAz8frX9.mjs";
|
|
5
3
|
import axios from "axios";
|
|
6
4
|
import { z } from "zod";
|
|
7
5
|
import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
|
|
@@ -96,7 +94,6 @@ var RestClient = class {
|
|
|
96
94
|
//#endregion
|
|
97
95
|
//#region src/lib/rest/rest-interceptor.ts
|
|
98
96
|
var RestInterceptor = class {
|
|
99
|
-
applyInterceptor;
|
|
100
97
|
interceptorIdMap = [];
|
|
101
98
|
constructor(applyInterceptor) {
|
|
102
99
|
this.applyInterceptor = applyInterceptor;
|
|
@@ -256,4 +253,4 @@ const AuthGuard = ({ type, redirectTo, children }) => {
|
|
|
256
253
|
return children;
|
|
257
254
|
};
|
|
258
255
|
//#endregion
|
|
259
|
-
export { ApplicationException, AuthContext, AuthGuard, DomainErrorRegistry, ErrorHandler,
|
|
256
|
+
export { ApplicationException, AuthContext, AuthGuard, DomainErrorRegistry, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
|