@povio/openapi-codegen-cli 4.0.0-rc.3 → 4.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/README.md +0 -1
- package/dist/{config-CiLFKLAY.d.mts → config-BSYiW3xV.d.mts} +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/{generate.runner-Sh0Ps6AW.mjs → generate.runner-BMqvEp4L.mjs} +6 -110
- package/dist/{generate.utils-BJxdEik8.cjs → generate.utils-D4eHo3wO.cjs} +3 -269
- package/dist/{generateCodeFromOpenAPIDoc-Bbi8fYi2.cjs → generateCodeFromOpenAPIDoc-DRLE112u.cjs} +100 -528
- package/dist/{generateCodeFromOpenAPIDoc-B8FAsxWE.mjs → generateCodeFromOpenAPIDoc-oe5uj0P4.mjs} +57 -502
- package/dist/generator.d.mts +1 -1
- package/dist/generator.mjs +3 -3
- package/dist/{getDataFromOpenAPIDoc-CXYNMMMt.mjs → getDataFromOpenAPIDoc-BqEeVt1w.mjs} +19 -2
- package/dist/index.d.mts +4 -4
- package/dist/metro.cjs +3 -3
- package/dist/metro.d.mts +3 -3
- package/dist/metro.mjs +1 -1
- 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-bJTFHTdn.mjs → openapi-codegen.runner-R_Dnb1mt.mjs} +1 -1
- package/dist/{openapi-source.runner-DIOvAX_R.d.mts → openapi-source.runner-DEtp4qCv.d.mts} +1 -1
- package/dist/{options-X0zju7gw.d.mts → options-BV720uS2.d.mts} +2 -10
- package/dist/query.d.mts +3 -3
- package/dist/{queryConfig.context-DjhzewdL.d.mts → queryConfig.context-BbLtDfIH.d.mts} +19 -9
- package/dist/sh.mjs +3 -8
- package/dist/tiny.d.mts +1 -1
- package/dist/{useMutationEffects-CJJuL9Ak.d.mts → useMutationEffects-CmGB4BOV.d.mts} +1 -1
- package/dist/vite.d.mts +3 -3
- package/dist/vite.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $ as getParamZodSchemaName, At as pathParamToVariableName, Bt as ALLOWED_PATH_IN, Ct as isErrorStatus, Dt as isPathExcluded, Et as isParamMediaTypeAllowed, Ft as inferRequiredSchema, Gt as ENUM_SCHEMA, Ht as BLOB_SCHEMA, It as isArraySchemaObject, J as getUniqueArray, Jt as STRING_SCHEMA, Kt as INT_SCHEMA, Lt as isReferenceObject, Mt as replaceHyphenatedPath, Nt as unwrapQuotesIfNeeded, Ot as isPrimitiveType, Pt as wrapWithQuotesIfNeeded, Q as getEnumZodSchemaName, Rt as isSchemaObject, St as getSchemaRef, Tt as isMediaTypeAllowed, Ut as DATETIME_SCHEMA, Vt as ANY_SCHEMA, Wt as EMAIL_SCHEMA, X as invalidVariableNameCharactersToCamel, Xt as UUID_SCHEMA, Yt as URL_SCHEMA, Z as getBodyZodSchemaName, Zt as VOID_SCHEMA, _n as Profiler, _t as getNamespaceName, bt as getParameterEnumNames, cn as getEndpointTag, et as getResponseZodSchemaName, fn as capitalize, gn as snakeToCamel, hn as removeWord, in as JSON_APPLICATION_FORMAT, it as isNamedZodSchema, jt as pathToVariableName, kt as isSortingParameterObject, ln as getOperationTag, m as mapEndpointParamsToFunctionParams, mn as getMostCommonAdjacentCombinationSplit, nt as getZodSchemaOperationName, pn as decapitalize, q as iterateSchema, qt as NUMBER_SCHEMA, rn as BODY_PARAMETER_NAME, s as pick, sn as formatTag, tt as getZodSchemaName, un as isTagIncluded, vt as autocorrectRef, wt as isMainResponseStatus, xt as getSchemaNameByRef, yt as escapeControlCharacters, zt as ALLOWED_METHODS } from "./generate.runner-BMqvEp4L.mjs";
|
|
2
|
+
import { OpenAPIV3 } from "openapi-types";
|
|
2
3
|
//#region src/generators/const/validation.const.ts
|
|
3
4
|
const HTTP_STATUS_CODES = {
|
|
4
5
|
"100": "Continue",
|
|
@@ -707,6 +708,22 @@ function groupByType(validationErrors) {
|
|
|
707
708
|
}), {});
|
|
708
709
|
}
|
|
709
710
|
//#endregion
|
|
711
|
+
//#region src/generators/utils/endpoint.utils.ts
|
|
712
|
+
const isGetEndpoint = (endpoint) => endpoint.method === OpenAPIV3.HttpMethods.GET;
|
|
713
|
+
const isPaginatedGetEndpoint = (endpoint, options) => isGetEndpoint(endpoint) && Object.values(options.infiniteQueryParamNames).every((infiniteQueryParam) => endpoint.parameters.some((param) => param.name === infiniteQueryParam && param.type === "Query"));
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region src/generators/utils/query.utils.ts
|
|
716
|
+
const isQuery = (endpoint) => isGetEndpoint(endpoint);
|
|
717
|
+
const isMutation = (endpoint) => !isGetEndpoint(endpoint) || !!endpoint.mediaDownload;
|
|
718
|
+
const isInfiniteQuery = (endpoint, options) => isPaginatedGetEndpoint(endpoint, options);
|
|
719
|
+
const getDestructuredVariables = (resolver, endpoint, updateQueryEndpoints) => {
|
|
720
|
+
const requiredUpdateQueryParams = updateQueryEndpoints.reduce((acc, updateEndpoint) => [...acc, ...mapEndpointParamsToFunctionParams(resolver, updateEndpoint, { includeOnlyRequiredParams: true }).map((param) => param.name)], []);
|
|
721
|
+
return mapEndpointParamsToFunctionParams(resolver, endpoint, {
|
|
722
|
+
includeOnlyRequiredParams: true,
|
|
723
|
+
excludeBodyParam: true
|
|
724
|
+
}).filter((param) => requiredUpdateQueryParams.includes(param.name)).map((param) => param.name);
|
|
725
|
+
};
|
|
726
|
+
//#endregion
|
|
710
727
|
//#region src/generators/core/endpoints/getEndpointAcl.ts
|
|
711
728
|
function getEndpointAcl({ resolver, endpoint, operation }) {
|
|
712
729
|
const acl = operation["x-acl"];
|
|
@@ -2013,4 +2030,4 @@ function getTagElement(tag, data) {
|
|
|
2013
2030
|
return data.get(tag);
|
|
2014
2031
|
}
|
|
2015
2032
|
//#endregion
|
|
2016
|
-
export { VALIDATION_ERROR_TYPE_TITLE as i,
|
|
2033
|
+
export { isQuery as a, VALIDATION_ERROR_TYPE_TITLE as c, isMutation as i, getDestructuredVariables as n, groupByType as o, isInfiniteQuery as r, getZodSchemaRefs as s, getDataFromOpenAPIDoc as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -3,10 +3,10 @@ import { a as ErrorHandler, c as GeneralErrorCodes, i as ErrorEntry, l as Shared
|
|
|
3
3
|
import { n as AuthGuardProps, r as AuthContext, t as AuthGuard } from "./AuthGuard-GbtTDXs0.mjs";
|
|
4
4
|
import { a as RestClient, i as Response, n as RequestConfig, o as RestInterceptor, r as RequestInfo, t as RestClient$1 } from "./rest-client-CbS77dei.mjs";
|
|
5
5
|
import { n as useWorkspaceContext, r as OpenApiRouter, t as OpenApiWorkspaceContext } from "./workspace.context-isVY9ves.mjs";
|
|
6
|
-
import { a as MutationEffectsTypes, i as MutationEffectsOf, n as InvalidationMapFunc, o as OpenApiQueryConfig, r as MergedMutationVariables, s as QueryModule, t as InvalidationMap } from "./queryConfig.context-
|
|
6
|
+
import { a as MutationEffectsTypes, c as RegisteredQueryModule, i as MutationEffectsOf, n as InvalidationMapFunc, o as OpenApiQueryConfig, r as MergedMutationVariables, s as QueryModule, t as InvalidationMap } from "./queryConfig.context-BbLtDfIH.mjs";
|
|
7
7
|
import { t as RestUtils } from "./rest.utils-DpiFIdhF.mjs";
|
|
8
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
8
|
+
import { t as OpenAPICodegenConfig } from "./config-BSYiW3xV.mjs";
|
|
9
9
|
import { d as TransportResponse, l as TransportRequest, n as HttpError, p as UploadProgress, u as TransportRequestConfig } from "./rest-transport.types-DM5-qyOJ.mjs";
|
|
10
10
|
import { n as NativeRestInterceptor, r as NativeRestClient, t as NativeInterceptor } from "./native-rest-interceptor-DZxdDcpz.mjs";
|
|
11
|
-
import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-
|
|
12
|
-
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type DomainErrorEntry, DomainErrorRegistry, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type ErrorRethrower, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MergedMutationVariables, type MutationEffectsOf, type MutationEffectsOptions, type MutationEffectsTypes, HttpError as NativeHttpError, type NativeInterceptor, type TransportRequest as NativeRequest, type TransportRequestConfig as NativeRequestConfig, type TransportResponse as NativeResponse, NativeRestClient, NativeRestInterceptor, type UploadProgress as NativeUploadProgress, 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 };
|
|
11
|
+
import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-CmGB4BOV.mjs";
|
|
12
|
+
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, ApplicationException, AuthContext, AuthGuard, type AuthGuardProps, type DomainErrorEntry, DomainErrorRegistry, type ErrorEntry, ErrorHandler, type ErrorHandlerOptions, type ErrorRethrower, type GeneralErrorCodes, type RestClient as IRestClient, type InvalidationMap, type InvalidationMapFunc, type MergedMutationVariables, type MutationEffectsOf, type MutationEffectsOptions, type MutationEffectsTypes, HttpError as NativeHttpError, type NativeInterceptor, type TransportRequest as NativeRequest, type TransportRequestConfig as NativeRequestConfig, type TransportResponse as NativeResponse, NativeRestClient, NativeRestInterceptor, type UploadProgress as NativeUploadProgress, OpenAPICodegenConfig, OpenApiQueryConfig, OpenApiRouter, OpenApiWorkspaceContext, type QueryModule, type RegisteredQueryModule, type RequestConfig, type RequestInfo, type Response, RestClient$1 as RestClient, RestInterceptor, RestUtils, SharedErrorHandler, type TranslateFunction, configureTranslations, ns, resources, useMutationEffects, useWorkspaceContext };
|
package/dist/metro.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generate_utils = require("./generate.utils-
|
|
2
|
+
const require_generate_utils = require("./generate.utils-D4eHo3wO.cjs");
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
fs = require_generate_utils.__toESM(fs, 1);
|
|
5
5
|
let path = require("path");
|
|
@@ -58,7 +58,7 @@ function generateFilesFromNativeOpenAPI(source, yaml, options) {
|
|
|
58
58
|
return files;
|
|
59
59
|
}
|
|
60
60
|
function supportsCompleteNativeRender(options) {
|
|
61
|
-
return options.splitByTags && !options.inlineEndpoints &&
|
|
61
|
+
return options.splitByTags && !options.inlineEndpoints && (options.workspaceContext?.length ?? 0) === 0;
|
|
62
62
|
}
|
|
63
63
|
function taggedFile(options, tag, type, content) {
|
|
64
64
|
return outputFile(options, require_generate_utils.getTagFileName({
|
|
@@ -102,7 +102,7 @@ async function runGenerate({ fileConfig, params, formatGeneratedFile, profiler =
|
|
|
102
102
|
const nativeFiles = generateFilesFromNativeOpenAPI(nativeInput.source, nativeInput.yaml, config);
|
|
103
103
|
if (nativeFiles) return nativeFiles;
|
|
104
104
|
}
|
|
105
|
-
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-
|
|
105
|
+
const { generateCodeFromOpenAPIDoc } = await Promise.resolve().then(() => require("./generateCodeFromOpenAPIDoc-DRLE112u.cjs"));
|
|
106
106
|
return generateCodeFromOpenAPIDoc(openApiDoc, config, profiler, {
|
|
107
107
|
source: nativeInput.source,
|
|
108
108
|
yaml: nativeInput.yaml
|
package/dist/metro.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as GenerateFileFormatter } from "./options-
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { r as GenerateFileFormatter } from "./options-BV720uS2.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BSYiW3xV.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DEtp4qCv.mjs";
|
|
4
4
|
import { IncomingMessage, ServerResponse } from "http";
|
|
5
5
|
//#region src/metro/openapi-codegen.plugin.d.ts
|
|
6
6
|
type OpenApiCodegenMetroConfig = OpenAPICodegenConfig & {
|
package/dist/metro.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-R_Dnb1mt.mjs";
|
|
2
2
|
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-DPUNTduQ.mjs";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _n as Profiler, n as runGenerate } from "./generate.runner-BMqvEp4L.mjs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
//#region src/plugins/openapi-codegen.runner.ts
|
|
4
4
|
function createOpenApiCodegenRunner(config, options = {}) {
|
|
@@ -4,8 +4,7 @@ declare enum GenerateType {
|
|
|
4
4
|
Models = "models",
|
|
5
5
|
Endpoints = "endpoints",
|
|
6
6
|
Queries = "queries",
|
|
7
|
-
Acl = "acl"
|
|
8
|
-
Configs = "configs"
|
|
7
|
+
Acl = "acl"
|
|
9
8
|
}
|
|
10
9
|
interface GenerateFileData {
|
|
11
10
|
fileName: string;
|
|
@@ -71,13 +70,6 @@ interface ACLGenerateOptions {
|
|
|
71
70
|
abilityContextImportPath?: string;
|
|
72
71
|
aclCheckImportPath: string;
|
|
73
72
|
}
|
|
74
|
-
interface BuilderConfigsGenerateOptions {
|
|
75
|
-
builderConfigs?: boolean;
|
|
76
|
-
filterParamName: string;
|
|
77
|
-
dataResponseParamNames: string[];
|
|
78
|
-
dynamicInputsImportPath: string;
|
|
79
|
-
dynamicColumnsImportPath: string;
|
|
80
|
-
}
|
|
81
73
|
interface GenerateConfig {
|
|
82
74
|
outputFileNameSuffix: string;
|
|
83
75
|
namespaceSuffix: string;
|
|
@@ -102,6 +94,6 @@ interface BaseGenerateOptions {
|
|
|
102
94
|
modelsOnly?: boolean;
|
|
103
95
|
standalone?: boolean;
|
|
104
96
|
}
|
|
105
|
-
interface GenerateOptions extends BaseGenerateOptions, ZodGenerateOptions, EndpointsGenerateOptions, QueriesGenerateOptions, InfiniteQueriesGenerateOptions, ACLGenerateOptions
|
|
97
|
+
interface GenerateOptions extends BaseGenerateOptions, ZodGenerateOptions, EndpointsGenerateOptions, QueriesGenerateOptions, InfiniteQueriesGenerateOptions, ACLGenerateOptions {}
|
|
106
98
|
//#endregion
|
|
107
99
|
export { GenerateFileData as n, GenerateFileFormatter as r, GenerateOptions as t };
|
package/dist/query.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as MutationEffectsTypes, i as MutationEffectsOf, n as InvalidationMapFunc, o as OpenApiQueryConfig, r as MergedMutationVariables, s as QueryModule, t as InvalidationMap } from "./queryConfig.context-
|
|
2
|
-
import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-
|
|
3
|
-
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, type InvalidationMap, type InvalidationMapFunc, type MergedMutationVariables, type MutationEffectsOf, type MutationEffectsOptions, type MutationEffectsTypes, OpenApiQueryConfig, type QueryModule, useMutationEffects };
|
|
1
|
+
import { a as MutationEffectsTypes, c as RegisteredQueryModule, i as MutationEffectsOf, n as InvalidationMapFunc, o as OpenApiQueryConfig, r as MergedMutationVariables, s as QueryModule, t as InvalidationMap } from "./queryConfig.context-BbLtDfIH.mjs";
|
|
2
|
+
import { a as AppQueryOptions, i as AppMutationOptions, n as useMutationEffects, r as AppInfiniteQueryOptions, t as MutationEffectsOptions } from "./useMutationEffects-CmGB4BOV.mjs";
|
|
3
|
+
export { type AppInfiniteQueryOptions, type AppMutationOptions, type AppQueryOptions, type InvalidationMap, type InvalidationMapFunc, type MergedMutationVariables, type MutationEffectsOf, type MutationEffectsOptions, type MutationEffectsTypes, OpenApiQueryConfig, type QueryModule, type RegisteredQueryModule, useMutationEffects };
|
|
@@ -18,17 +18,17 @@ type MutationEffectsOf<THook> = THook extends ((...args: never) => UseMutationRe
|
|
|
18
18
|
type ObjectMembers<T> = T extends object ? T : never;
|
|
19
19
|
type KeysOfUnion<T> = T extends unknown ? keyof T : never;
|
|
20
20
|
type ValueOfUnion<T, K extends PropertyKey> = T extends unknown ? (K extends keyof T ? T[K] : undefined) : never;
|
|
21
|
-
type
|
|
21
|
+
type IsUnion<T, TAll = T> = T extends unknown ? ([TAll] extends [T] ? false : true) : never;
|
|
22
|
+
type MergeableMembers<T> = T extends readonly unknown[] | ((...args: never) => unknown) | Date ? never : ObjectMembers<T>;
|
|
23
|
+
type MergedValue<T> = true extends IsUnion<MergeableMembers<T>> ? MergedObjects<MergeableMembers<T>> | Exclude<T, MergeableMembers<T>> : T;
|
|
24
|
+
type MergedObjects<T> = { [K in Extract<keyof T, PropertyKey>]: MergedValue<ValueOfUnion<T, K>>; } & { [K in Exclude<KeysOfUnion<T>, keyof T>]?: MergedValue<ValueOfUnion<T, K>>; };
|
|
22
25
|
/**
|
|
23
|
-
* The variables of a module's mutations as one object: keys some mutations lack become optional
|
|
24
|
-
*
|
|
26
|
+
* The variables of a module's mutations as one object: keys some mutations lack become optional, at any
|
|
27
|
+
* depth (e.g. fields of request bodies only some mutations send). Mutations without variables (`void`)
|
|
28
|
+
* stay in the union, as their callbacks receive `undefined`.
|
|
25
29
|
*/
|
|
26
30
|
type MergedMutationVariables<T> = [ObjectMembers<T>] extends [never] ? T : MergedObjects<ObjectMembers<T>> | Exclude<T, object>;
|
|
27
31
|
type InvalidationMapFuncFor<T> = InvalidationMapFunc<T extends MutationEffectsTypes ? T["data"] : never, MergedMutationVariables<T extends MutationEffectsTypes ? T["variables"] : never>>;
|
|
28
|
-
/**
|
|
29
|
-
* Query keys to invalidate after a module's mutations. Pass the generated `QueryModuleMutations` as
|
|
30
|
-
* `TMutations` to type each module's callback with its mutations' `data` and `variables`.
|
|
31
|
-
*/
|
|
32
32
|
declare global {
|
|
33
33
|
/**
|
|
34
34
|
* Mutation types per module. The generated `queryModules.ts` extends it with `QueryModuleMutations`, so
|
|
@@ -36,8 +36,18 @@ declare global {
|
|
|
36
36
|
* from bundled declaration chunks can't be augmented through the package's entry points.
|
|
37
37
|
*/
|
|
38
38
|
interface OpenApiCodegenQueryModuleMutations {}
|
|
39
|
+
/** The generated `QueryModule` enum, registered by `queryModules.ts` as `{ queryModule: QueryModule }`. */
|
|
40
|
+
interface OpenApiCodegenQueryModules {}
|
|
39
41
|
}
|
|
40
|
-
|
|
42
|
+
/** The generated `QueryModule` enum once `queryModules.ts` registers it, else any module key. */
|
|
43
|
+
type RegisteredQueryModule = OpenApiCodegenQueryModules extends {
|
|
44
|
+
queryModule: infer TModule extends QueryModule;
|
|
45
|
+
} ? TModule : QueryModule;
|
|
46
|
+
/**
|
|
47
|
+
* Query keys to invalidate after a module's mutations. Without type arguments it is keyed by the generated
|
|
48
|
+
* `QueryModule` and typed by its `QueryModuleMutations`, so a bare `InvalidationMap` is typed from the spec.
|
|
49
|
+
*/
|
|
50
|
+
type InvalidationMap<TQueryModule extends QueryModule = RegisteredQueryModule, TMutations extends { [K in TQueryModule]?: MutationEffectsTypes; } = OpenApiCodegenQueryModuleMutations> = { [K in TQueryModule]?: K extends keyof TMutations ? InvalidationMapFuncFor<TMutations[K]> : InvalidationMapFunc; };
|
|
41
51
|
declare namespace OpenApiQueryConfig {
|
|
42
52
|
export interface Type<TQueryModule extends QueryModule = QueryModule> {
|
|
43
53
|
preferUpdate?: boolean;
|
|
@@ -53,4 +63,4 @@ declare namespace OpenApiQueryConfig {
|
|
|
53
63
|
export {};
|
|
54
64
|
}
|
|
55
65
|
//#endregion
|
|
56
|
-
export { MutationEffectsTypes as a, MutationEffectsOf as i, InvalidationMapFunc as n, OpenApiQueryConfig as o, MergedMutationVariables as r, QueryModule as s, InvalidationMap as t };
|
|
66
|
+
export { MutationEffectsTypes as a, RegisteredQueryModule as c, MutationEffectsOf as i, InvalidationMapFunc as n, OpenApiQueryConfig as o, MergedMutationVariables as r, QueryModule as s, InvalidationMap as t };
|
package/dist/sh.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { c as VALIDATION_ERROR_TYPE_TITLE, o as groupByType, t as getDataFromOpenAPIDoc } from "./getDataFromOpenAPIDoc-BqEeVt1w.mjs";
|
|
3
|
+
import { C as getTagFileName, _n as Profiler, a as resolveConfig, n as runGenerate, o as getOutputFileName, t as getOpenApiDoc } from "./generate.runner-BMqvEp4L.mjs";
|
|
4
4
|
import yargs from "yargs";
|
|
5
5
|
import { hideBin } from "yargs/helpers";
|
|
6
6
|
import { styleText } from "node:util";
|
|
@@ -31,7 +31,7 @@ function logBanner(message) {
|
|
|
31
31
|
* Fetch the version from package.json
|
|
32
32
|
*/
|
|
33
33
|
function getVersion() {
|
|
34
|
-
return "4.0.0-rc.
|
|
34
|
+
return "4.0.0-rc.4";
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region src/helpers/yargs.helper.ts
|
|
@@ -290,7 +290,6 @@ var GenerateOptions = class {
|
|
|
290
290
|
inlineEndpointsExcludeModules;
|
|
291
291
|
modelsOnly;
|
|
292
292
|
axiosRequestConfig;
|
|
293
|
-
builderConfigs;
|
|
294
293
|
format;
|
|
295
294
|
verbose;
|
|
296
295
|
};
|
|
@@ -398,10 +397,6 @@ __decorate([YargOption({
|
|
|
398
397
|
envAlias: "axiosRequestConfig",
|
|
399
398
|
type: "boolean"
|
|
400
399
|
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "axiosRequestConfig", void 0);
|
|
401
|
-
__decorate([YargOption({
|
|
402
|
-
envAlias: "builderConfigs",
|
|
403
|
-
type: "boolean"
|
|
404
|
-
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "builderConfigs", void 0);
|
|
405
400
|
__decorate([YargOption({
|
|
406
401
|
envAlias: "format",
|
|
407
402
|
default: true,
|
package/dist/tiny.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-
|
|
1
|
+
import { $ as getModuleOpenApiTag, A as collectApiModelSchemaExports, At as toOpenAPI30Document, B as collectReachableModelSchemas, C as applyEnumExtensions, Ct as procedureSchemaName, D as applyRobodevModuleExtensions, Dt as schemaExportName, E as applyParameterExtensions, Et as schemaComponentRef, F as collectExtraSchemas, G as findComponentEnumNames, H as compactTagName, I as collectModelSchemaExports, J as generateOpenApiFile, K as findEnumNames, L as collectModuleModelSchemaExports, M as collectContractSchemas, Mt as toOpenAPIAclRule, N as collectDbTableModelSchemaExport, Nt as toPascalCase, O as applyRobodevUserRolesExtension, Ot as sharedSchemaExportName, P as collectDbTableModelSchemaExports, Pt as visitZodSchema, Q as getModuleOpenApiController, R as collectOperationMeta, S as addContractSchema, St as operationKey, T as applyPaginatedItemSchemas, Tt as routeHasPathParameters, U as createModelSchemaNameGetter, V as collectSchemaRegistryRoots, W as defineOpenApiSchemas, X as getContractProcedureData, Y as getComponentSchemas, Z as getDerivedOperationId, _ as OpenApiSchemaRegistry, _t as namedControllerActionSchema, a as isTinyOpenApiFakeMode, at as getProcedureInputSchemaRole, b as TinyOpenApiUserRole, bt as namedOpenApiResponseSchema, c as AnyContractRouter, ct as isContractProcedure, d as GenerateOpenApiFile, dt as isObject, et as getObjectPropertySchema, f as GenerateOpenApiFileOptions, ft as isProcedureMeta, g as JsonObject, gt as namedControllerActionInputDtoSchema, h as GenerateTinyOpenApiFileOptions, ht as modelSchemaNameEntries, i as getLocalInputPath, it as getPaginatedItemSchema, j as collectContractSchemaRoots, jt as toOpenAPI30Schema, k as asStringArray, kt as stripNoContentResponseBodies, l as AnySchema, lt as isNullSchema, m as GenerateOpenApiSpec, mt as modelSchemaExportName, nt as getOperationAction, o as normalizeWatchFolders, ot as getRobodevModuleRoles, p as GenerateOpenApiFileResult, pt as isZodSchema, q as generateORPCOpenAPISpec, r as createTinyOpenApiSourceRunner, rt as getOperationController, s as AclRule, st as getStringEnumValues, t as TinyOpenApiSourceRunnerConfig, tt as getOpenApiSchemaName, u as GenerateORPCOpenAPISpecOptions, ut as isNullableOnlySchema, v as ProcedureMeta, vt as namedOpenApiOutputSchema, w as applyOperationMeta, wt as resolveOpenApiOutputPath, x as ZodSchema, xt as namedOpenApiSchema, y as TinyOpenApiModule, yt as namedOpenApiRequestSchema, z as collectOperationTags } from "./openapi-source.runner-DEtp4qCv.mjs";
|
|
2
2
|
export { AclRule, AnyContractRouter, AnySchema, GenerateORPCOpenAPISpecOptions, GenerateOpenApiFile, GenerateOpenApiFileOptions, GenerateOpenApiFileResult, GenerateOpenApiSpec, GenerateTinyOpenApiFileOptions, JsonObject, OpenApiSchemaRegistry, ProcedureMeta, TinyOpenApiModule, type TinyOpenApiSourceRunnerConfig, TinyOpenApiUserRole, ZodSchema, addContractSchema, applyEnumExtensions, applyOperationMeta, applyPaginatedItemSchemas, applyParameterExtensions, applyRobodevModuleExtensions, applyRobodevUserRolesExtension, asStringArray, collectApiModelSchemaExports, collectContractSchemaRoots, collectContractSchemas, collectDbTableModelSchemaExport, collectDbTableModelSchemaExports, collectExtraSchemas, collectModelSchemaExports, collectModuleModelSchemaExports, collectOperationMeta, collectOperationTags, collectReachableModelSchemas, collectSchemaRegistryRoots, compactTagName, createModelSchemaNameGetter, createTinyOpenApiSourceRunner, defineOpenApiSchemas, findComponentEnumNames, findEnumNames, generateORPCOpenAPISpec, generateOpenApiFile, getComponentSchemas, getContractProcedureData, getDerivedOperationId, getModuleOpenApiController, getModuleOpenApiTag, getObjectPropertySchema, getOpenApiSchemaName, getOperationAction, getOperationController, getPaginatedItemSchema, getProcedureInputSchemaRole, getRobodevModuleRoles, getStringEnumValues, getLocalInputPath as getTinyOpenApiLocalInputPath, isContractProcedure, isNullSchema, isNullableOnlySchema, isObject, isProcedureMeta, isTinyOpenApiFakeMode, isZodSchema, modelSchemaExportName, modelSchemaNameEntries, namedControllerActionInputDtoSchema, namedControllerActionSchema, namedOpenApiOutputSchema, namedOpenApiRequestSchema, namedOpenApiResponseSchema, namedOpenApiSchema, normalizeWatchFolders as normalizeTinyOpenApiWatchFolders, operationKey, procedureSchemaName, resolveOpenApiOutputPath, routeHasPathParameters, schemaComponentRef, schemaExportName, sharedSchemaExportName, stripNoContentResponseBodies, toOpenAPI30Document, toOpenAPI30Schema, toOpenAPIAclRule, toPascalCase, visitZodSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as GeneralErrorCodes, t as ApplicationException } from "./error-handling-BpAQHWrU.mjs";
|
|
2
|
-
import { s as QueryModule, t as InvalidationMap } from "./queryConfig.context-
|
|
2
|
+
import { s as QueryModule, t as InvalidationMap } from "./queryConfig.context-BbLtDfIH.mjs";
|
|
3
3
|
import { InfiniteData, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
|
|
4
4
|
//#region src/lib/react-query.types.d.ts
|
|
5
5
|
type Function = (...args: never) => unknown;
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as GenerateFileFormatter } from "./options-
|
|
2
|
-
import { t as OpenAPICodegenConfig } from "./config-
|
|
3
|
-
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-
|
|
1
|
+
import { r as GenerateFileFormatter } from "./options-BV720uS2.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BSYiW3xV.mjs";
|
|
3
|
+
import { d as GenerateOpenApiFile, m as GenerateOpenApiSpec, n as TinyOpenApiSpecModuleConfig } from "./openapi-source.runner-DEtp4qCv.mjs";
|
|
4
4
|
import { Plugin, PluginOption } from "vite";
|
|
5
5
|
//#region src/plugins/openapi-codegen.runner.d.ts
|
|
6
6
|
type OpenApiCodegenPluginConfig = OpenAPICodegenConfig & {
|
package/dist/vite.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-
|
|
1
|
+
import { t as createOpenApiCodegenRunner } from "./openapi-codegen.runner-R_Dnb1mt.mjs";
|
|
2
2
|
import { i as normalizeWatchFolders, r as isTinyOpenApiFakeMode, t as createTinyOpenApiSourceRunner } from "./openapi-source.runner-DPUNTduQ.mjs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
//#region src/vite/openapi-codegen.plugin.ts
|
package/package.json
CHANGED