@povio/openapi-codegen-cli 3.1.0 → 3.2.0-rc.2
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 +21 -14
- package/dist/acl.d.mts +6 -20
- package/dist/acl.mjs +3 -8
- package/dist/{auth.context-Bu5KW2sI.mjs → auth.context-YFWzkwoN.mjs} +3 -5
- package/dist/{config-BU7wVf7U.d.mts → config-DFpV8mjG.d.mts} +1 -2
- package/dist/{error-handling-D-mHJ60d.d.mts → error-handling-CNOHs4Fc.d.mts} +1 -4
- package/dist/{error-handling-DSI86D3u.mjs → error-handling-DDIXMA-R.mjs} +1 -7
- package/dist/generate.runner-BGhsnDm8.mjs +1674 -0
- package/dist/generate.utils-C29zzyBl.cjs +2281 -0
- package/dist/{generateCodeFromOpenAPIDoc-CbQ9gQss.mjs → generateCodeFromOpenAPIDoc-B0Cmn2dx.cjs} +1261 -2336
- package/dist/generateCodeFromOpenAPIDoc-CLQbTTwF.mjs +2004 -0
- package/dist/generator.d.mts +3 -10
- package/dist/generator.mjs +8 -9
- package/dist/getDataFromOpenAPIDoc-fPRPa4_t.mjs +1988 -0
- package/dist/index.d.mts +9 -48
- package/dist/index.mjs +4 -11
- package/dist/metro.cjs +114 -4923
- package/dist/metro.d.mts +3 -4
- package/dist/metro.mjs +4 -9
- 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/{openapi-codegen.runner-BqOhUduF.mjs → openapi-codegen.runner-BtaqQSH2.mjs} +3 -5
- package/dist/{openapi-source.runner-wLs5vqw6.mjs → openapi-source.runner-BZ6ZLgRO.mjs} +19 -10
- package/dist/{openapi-source.runner-BSIrB6ny.d.mts → openapi-source.runner-zPcbJwpP.d.mts} +2 -8
- package/dist/{options-CE4Koxof.d.mts → options-DtAnhCLZ.d.mts} +3 -1
- package/dist/sh.d.mts +1 -1
- package/dist/sh.mjs +25 -71
- package/dist/tiny.d.mts +1 -3
- package/dist/tiny.mjs +2 -3
- package/dist/vite.d.mts +3 -4
- package/dist/vite.mjs +6 -10
- package/dist/zod.d.mts +2 -7
- package/dist/zod.mjs +2 -4
- package/package.json +28 -26
- package/dist/generate.runner-DnUDkoAZ.mjs +0 -90
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
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 "./
|
|
3
|
-
import { t as OpenAPICodegenConfig } from "./config-BU7wVf7U.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-CNOHs4Fc.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-DFpV8mjG.mjs";
|
|
4
3
|
import { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosResponseHeaders, CreateAxiosDefaults } from "axios";
|
|
5
4
|
import { z } from "zod";
|
|
6
|
-
import * as react from "react";
|
|
7
5
|
import { PropsWithChildren, ReactNode } from "react";
|
|
8
6
|
import { InfiniteData, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
9
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
10
|
-
|
|
11
7
|
//#region src/lib/rest/rest-interceptor.d.ts
|
|
12
8
|
declare class RestInterceptor<T extends any[]> {
|
|
13
9
|
private applyInterceptor;
|
|
@@ -43,11 +39,7 @@ interface RestClient {
|
|
|
43
39
|
declare class RestClient$1 implements RestClient {
|
|
44
40
|
private readonly client;
|
|
45
41
|
private readonly errorHandler;
|
|
46
|
-
constructor({
|
|
47
|
-
config,
|
|
48
|
-
interceptors,
|
|
49
|
-
errorHandler
|
|
50
|
-
}?: {
|
|
42
|
+
constructor({ config, interceptors, errorHandler }?: {
|
|
51
43
|
config?: CreateAxiosDefaults;
|
|
52
44
|
interceptors?: RestInterceptor<any[]>[];
|
|
53
45
|
errorHandler?: ErrorHandler<any>;
|
|
@@ -94,15 +86,7 @@ declare namespace OpenApiQueryConfig {
|
|
|
94
86
|
onError?: (error: unknown) => void;
|
|
95
87
|
}
|
|
96
88
|
type ProviderProps<TQueryModule extends QueryModule = QueryModule> = Type<TQueryModule>;
|
|
97
|
-
export function Provider<TQueryModule extends QueryModule = QueryModule>({
|
|
98
|
-
preferUpdate,
|
|
99
|
-
invalidateCurrentModule,
|
|
100
|
-
invalidationMap,
|
|
101
|
-
crossTabInvalidation,
|
|
102
|
-
allowInvalidResponseData,
|
|
103
|
-
onError,
|
|
104
|
-
children
|
|
105
|
-
}: PropsWithChildren<ProviderProps<TQueryModule>>): react_jsx_runtime0.JSX.Element;
|
|
89
|
+
export function Provider<TQueryModule extends QueryModule = QueryModule>({ preferUpdate, invalidateCurrentModule, invalidationMap, crossTabInvalidation, allowInvalidResponseData, onError, children }: PropsWithChildren<ProviderProps<TQueryModule>>): import("react").JSX.Element;
|
|
106
90
|
export const useConfig: <TQueryModule extends QueryModule = QueryModule>() => Type<TQueryModule>;
|
|
107
91
|
export {};
|
|
108
92
|
}
|
|
@@ -119,9 +103,7 @@ interface MutationEffectsOptions<TQueryModule extends QueryModule = QueryModule>
|
|
|
119
103
|
interface UseMutationEffectsProps<TQueryModule extends QueryModule = QueryModule> {
|
|
120
104
|
currentModule: TQueryModule;
|
|
121
105
|
}
|
|
122
|
-
declare function useMutationEffects<TQueryModule extends QueryModule = QueryModule>({
|
|
123
|
-
currentModule
|
|
124
|
-
}: UseMutationEffectsProps<TQueryModule>): {
|
|
106
|
+
declare function useMutationEffects<TQueryModule extends QueryModule = QueryModule>({ currentModule }: UseMutationEffectsProps<TQueryModule>): {
|
|
125
107
|
runMutationEffects: <TData, TVariables>(data: TData, variables: TVariables, options?: MutationEffectsOptions<TQueryModule>, updateKeys?: QueryKey[]) => Promise<void>;
|
|
126
108
|
};
|
|
127
109
|
//#endregion
|
|
@@ -130,10 +112,7 @@ interface RouterProviderProps {
|
|
|
130
112
|
replace: (url: string) => void;
|
|
131
113
|
}
|
|
132
114
|
declare namespace OpenApiRouter {
|
|
133
|
-
const Provider: ({
|
|
134
|
-
children,
|
|
135
|
-
replace
|
|
136
|
-
}: PropsWithChildren<RouterProviderProps>) => react_jsx_runtime0.JSX.Element;
|
|
115
|
+
const Provider: ({ children, replace }: PropsWithChildren<RouterProviderProps>) => import("react").JSX.Element;
|
|
137
116
|
const useRouter: () => RouterProviderProps;
|
|
138
117
|
}
|
|
139
118
|
//#endregion
|
|
@@ -143,10 +122,7 @@ interface WorkspaceProviderProps {
|
|
|
143
122
|
values?: WorkspaceValues;
|
|
144
123
|
}
|
|
145
124
|
declare namespace OpenApiWorkspaceContext {
|
|
146
|
-
const Provider: ({
|
|
147
|
-
values,
|
|
148
|
-
children
|
|
149
|
-
}: PropsWithChildren<WorkspaceProviderProps>) => react_jsx_runtime0.JSX.Element;
|
|
125
|
+
const Provider: ({ values, children }: PropsWithChildren<WorkspaceProviderProps>) => import("react").JSX.Element;
|
|
150
126
|
const useContext: <TValues extends WorkspaceValues = WorkspaceValues>() => TValues;
|
|
151
127
|
const resolveParam: <T>(context: WorkspaceValues, name: string, value: T | null | undefined) => T;
|
|
152
128
|
}
|
|
@@ -170,18 +146,7 @@ declare namespace AuthContext {
|
|
|
170
146
|
loadingState?: ReactNode;
|
|
171
147
|
}
|
|
172
148
|
type ProviderProps<TUser = unknown> = Type<TUser>;
|
|
173
|
-
export const Provider: <TUser>({
|
|
174
|
-
isAuthenticated,
|
|
175
|
-
isInitializing,
|
|
176
|
-
logout,
|
|
177
|
-
updateTokens,
|
|
178
|
-
accessToken,
|
|
179
|
-
user,
|
|
180
|
-
userPromise,
|
|
181
|
-
routes,
|
|
182
|
-
loadingState,
|
|
183
|
-
children
|
|
184
|
-
}: PropsWithChildren<ProviderProps<TUser>>) => react_jsx_runtime0.JSX.Element;
|
|
149
|
+
export const Provider: <TUser>({ isAuthenticated, isInitializing, logout, updateTokens, accessToken, user, userPromise, routes, loadingState, children }: PropsWithChildren<ProviderProps<TUser>>) => import("react").JSX.Element;
|
|
185
150
|
export const useAuth: <TUser>() => Type<TUser>;
|
|
186
151
|
export {};
|
|
187
152
|
}
|
|
@@ -191,10 +156,6 @@ interface AuthGuardProps {
|
|
|
191
156
|
type: "public-only" | "private";
|
|
192
157
|
redirectTo?: string;
|
|
193
158
|
}
|
|
194
|
-
declare const AuthGuard: ({
|
|
195
|
-
type,
|
|
196
|
-
redirectTo,
|
|
197
|
-
children
|
|
198
|
-
}: PropsWithChildren<AuthGuardProps>) => react.ReactNode;
|
|
159
|
+
declare const AuthGuard: ({ type, redirectTo, children }: PropsWithChildren<AuthGuardProps>) => import("react").ReactNode;
|
|
199
160
|
//#endregion
|
|
200
161
|
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,11 +1,10 @@
|
|
|
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 { n as OpenApiRouter, t as AuthContext } from "./auth.context-
|
|
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-DDIXMA-R.mjs";
|
|
2
|
+
import { n as OpenApiRouter, t as AuthContext } from "./auth.context-YFWzkwoN.mjs";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { createContext, use, useCallback, useEffect, useMemo, useState } from "react";
|
|
6
6
|
import { useQueryClient } from "@tanstack/react-query";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
8
|
//#region src/lib/rest/rest-client.ts
|
|
10
9
|
var RestClient = class {
|
|
11
10
|
client;
|
|
@@ -92,10 +91,10 @@ var RestClient = class {
|
|
|
92
91
|
}
|
|
93
92
|
}
|
|
94
93
|
};
|
|
95
|
-
|
|
96
94
|
//#endregion
|
|
97
95
|
//#region src/lib/rest/rest-interceptor.ts
|
|
98
96
|
var RestInterceptor = class {
|
|
97
|
+
applyInterceptor;
|
|
99
98
|
interceptorIdMap = [];
|
|
100
99
|
constructor(applyInterceptor) {
|
|
101
100
|
this.applyInterceptor = applyInterceptor;
|
|
@@ -116,7 +115,6 @@ var RestInterceptor = class {
|
|
|
116
115
|
}
|
|
117
116
|
}
|
|
118
117
|
};
|
|
119
|
-
|
|
120
118
|
//#endregion
|
|
121
119
|
//#region src/lib/config/queryConfig.context.tsx
|
|
122
120
|
let OpenApiQueryConfig;
|
|
@@ -148,7 +146,6 @@ let OpenApiQueryConfig;
|
|
|
148
146
|
return use(Context) ?? {};
|
|
149
147
|
};
|
|
150
148
|
})(OpenApiQueryConfig || (OpenApiQueryConfig = {}));
|
|
151
|
-
|
|
152
149
|
//#endregion
|
|
153
150
|
//#region src/lib/react-query/cross-tab-invalidation.ts
|
|
154
151
|
const CROSS_TAB_INVALIDATE_KEY = "__rq_invalidate__";
|
|
@@ -170,7 +167,6 @@ const setupCrossTabListener = (queryClient) => {
|
|
|
170
167
|
} catch {}
|
|
171
168
|
});
|
|
172
169
|
};
|
|
173
|
-
|
|
174
170
|
//#endregion
|
|
175
171
|
//#region src/lib/react-query/useMutationEffects.ts
|
|
176
172
|
function useMutationEffects({ currentModule }) {
|
|
@@ -214,7 +210,6 @@ function useMutationEffects({ currentModule }) {
|
|
|
214
210
|
config.crossTabInvalidation
|
|
215
211
|
]) };
|
|
216
212
|
}
|
|
217
|
-
|
|
218
213
|
//#endregion
|
|
219
214
|
//#region src/lib/config/workspace.context.tsx
|
|
220
215
|
let OpenApiWorkspaceContext;
|
|
@@ -238,7 +233,6 @@ let OpenApiWorkspaceContext;
|
|
|
238
233
|
};
|
|
239
234
|
})(OpenApiWorkspaceContext || (OpenApiWorkspaceContext = {}));
|
|
240
235
|
const useWorkspaceContext = () => OpenApiWorkspaceContext.useContext();
|
|
241
|
-
|
|
242
236
|
//#endregion
|
|
243
237
|
//#region src/lib/auth/AuthGuard.tsx
|
|
244
238
|
const AuthGuard = ({ type, redirectTo, children }) => {
|
|
@@ -259,6 +253,5 @@ const AuthGuard = ({ type, redirectTo, children }) => {
|
|
|
259
253
|
}
|
|
260
254
|
return children;
|
|
261
255
|
};
|
|
262
|
-
|
|
263
256
|
//#endregion
|
|
264
|
-
export { ApplicationException, AuthContext, AuthGuard, DomainErrorRegistry, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
|
|
257
|
+
export { ApplicationException, AuthContext, AuthGuard, DomainErrorRegistry, ErrorHandler, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, RestClient, RestInterceptor, RestUtils, SharedErrorHandler, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
|