@povio/openapi-codegen-cli 3.1.0 → 3.2.0-rc.3

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.
Files changed (36) hide show
  1. package/README.md +21 -14
  2. package/dist/acl.d.mts +6 -20
  3. package/dist/acl.mjs +3 -8
  4. package/dist/{auth.context-Bu5KW2sI.mjs → auth.context-YFWzkwoN.mjs} +3 -5
  5. package/dist/{config-BU7wVf7U.d.mts → config-mWuUhYNE.d.mts} +1 -2
  6. package/dist/{error-handling-D-mHJ60d.d.mts → error-handling-CNOHs4Fc.d.mts} +1 -4
  7. package/dist/{error-handling-DSI86D3u.mjs → error-handling-DDIXMA-R.mjs} +1 -7
  8. package/dist/generate.runner-wLYGEefS.mjs +1676 -0
  9. package/dist/generate.utils-1rU0zIjA.cjs +2283 -0
  10. package/dist/generateCodeFromOpenAPIDoc-C_DFpWCZ.mjs +2004 -0
  11. package/dist/{generateCodeFromOpenAPIDoc-CbQ9gQss.mjs → generateCodeFromOpenAPIDoc-wCGWkmv1.cjs} +1311 -2363
  12. package/dist/generator.d.mts +3 -10
  13. package/dist/generator.mjs +8 -9
  14. package/dist/getDataFromOpenAPIDoc-Dm8V5UY9.mjs +2011 -0
  15. package/dist/index.d.mts +9 -48
  16. package/dist/index.mjs +4 -11
  17. package/dist/metro.cjs +114 -4923
  18. package/dist/metro.d.mts +3 -4
  19. package/dist/metro.mjs +4 -9
  20. package/dist/openapi-codegen-native-darwin-arm64.node +0 -0
  21. package/dist/openapi-codegen-native-linux-x64.node +0 -0
  22. package/dist/openapi-codegen-native-win32-x64.node +0 -0
  23. package/dist/{openapi-codegen.runner-BqOhUduF.mjs → openapi-codegen.runner-Bd03hQJd.mjs} +3 -5
  24. package/dist/{openapi-source.runner-wLs5vqw6.mjs → openapi-source.runner-BZ6ZLgRO.mjs} +19 -10
  25. package/dist/{openapi-source.runner-BSIrB6ny.d.mts → openapi-source.runner-DmJoXvFj.d.mts} +2 -8
  26. package/dist/{options-CE4Koxof.d.mts → options-B47gUU4P.d.mts} +5 -1
  27. package/dist/sh.d.mts +1 -1
  28. package/dist/sh.mjs +35 -71
  29. package/dist/tiny.d.mts +1 -3
  30. package/dist/tiny.mjs +2 -3
  31. package/dist/vite.d.mts +3 -4
  32. package/dist/vite.mjs +6 -10
  33. package/dist/zod.d.mts +2 -7
  34. package/dist/zod.mjs +2 -4
  35. package/package.json +28 -26
  36. 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-D-mHJ60d.mjs";
2
- import "./options-CE4Koxof.mjs";
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-mWuUhYNE.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-DSI86D3u.mjs";
2
- import { n as OpenApiRouter, t as AuthContext } from "./auth.context-Bu5KW2sI.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-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 };