@povio/openapi-codegen-cli 2.0.8-rc.2 → 2.0.8-rc.20
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 +63 -0
- package/dist/acl.d.mts +59 -0
- package/dist/acl.mjs +73 -7
- package/dist/auth.context-Bu5KW2sI.mjs +59 -0
- package/dist/config-BHkVxL6S.d.mts +6 -0
- package/dist/error-handling-CXeVTk1T.d.mts +38 -0
- package/dist/error-handling-DkPY7Asf.mjs +187 -0
- package/dist/generate.runner-DmZ5LVHf.mjs +130 -0
- package/dist/generateCodeFromOpenAPIDoc-DZ5swy4U.mjs +4465 -0
- package/dist/generator.d.mts +65 -0
- package/dist/generator.mjs +144 -0
- package/dist/index.d.mts +230 -0
- package/dist/index.mjs +251 -22
- package/dist/options-BNqkO_OS.d.mts +91 -0
- package/dist/sh.d.mts +1 -0
- package/dist/sh.mjs +439 -0
- package/dist/vite.d.mts +8 -0
- package/dist/vite.mjs +50 -0
- package/dist/zod.d.mts +20 -0
- package/dist/zod.mjs +33 -0
- package/package.json +54 -47
- package/dist/acl.d.ts +0 -4
- package/dist/commands/check.command.d.ts +0 -2
- package/dist/commands/check.d.ts +0 -7
- package/dist/commands/generate.command.d.ts +0 -2
- package/dist/commands/generate.d.ts +0 -8
- package/dist/generator.d.ts +0 -3
- package/dist/generator.js +0 -77
- package/dist/generators/checkOpenAPIDoc.d.ts +0 -3
- package/dist/generators/const/acl.const.d.ts +0 -13
- package/dist/generators/const/buildConfigs.const.d.ts +0 -1
- package/dist/generators/const/deps.const.d.ts +0 -38
- package/dist/generators/const/endpoints.const.d.ts +0 -11
- package/dist/generators/const/js.const.d.ts +0 -1
- package/dist/generators/const/openapi.const.d.ts +0 -7
- package/dist/generators/const/options.const.d.ts +0 -2
- package/dist/generators/const/package.const.d.ts +0 -2
- package/dist/generators/const/queries.const.d.ts +0 -8
- package/dist/generators/const/validation.const.d.ts +0 -53
- package/dist/generators/const/zod.const.d.ts +0 -19
- package/dist/generators/core/SchemaResolver.class.d.ts +0 -71
- package/dist/generators/core/endpoints/getEndpointAcl.d.ts +0 -8
- package/dist/generators/core/endpoints/getEndpointBody.d.ts +0 -13
- package/dist/generators/core/endpoints/getEndpointParameter.d.ts +0 -11
- package/dist/generators/core/endpoints/getEndpointsFromOpenAPIDoc.d.ts +0 -3
- package/dist/generators/core/endpoints/getEndpointsFromOpenAPIDoc.test.d.ts +0 -1
- package/dist/generators/core/getDataFromOpenAPIDoc.d.ts +0 -8
- package/dist/generators/core/getMetadataFromOpenAPIDoc.d.ts +0 -4
- package/dist/generators/core/getMetadataFromOpenAPIDoc.test.d.ts +0 -1
- package/dist/generators/core/openapi/getOpenAPISchemaComplexity.d.ts +0 -2
- package/dist/generators/core/openapi/getOpenAPISchemaComplexity.test.d.ts +0 -1
- package/dist/generators/core/openapi/getOpenAPISchemaDependencyGraph.d.ts +0 -6
- package/dist/generators/core/openapi/getOpenAPISchemaDependencyGraph.test.d.ts +0 -1
- package/dist/generators/core/openapi/getSchemaRefObjs.d.ts +0 -4
- package/dist/generators/core/openapi/iterateSchema.d.ts +0 -22
- package/dist/generators/core/resolveConfig.d.ts +0 -7
- package/dist/generators/core/zod/ZodSchema.class.d.ts +0 -26
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaNames.d.ts +0 -2
- package/dist/generators/core/zod/enumExtraction/resolveExtractedEnumZodSchemaTags.d.ts +0 -2
- package/dist/generators/core/zod/enumExtraction/updateExtractedEnumZodSchemaData.d.ts +0 -17
- package/dist/generators/core/zod/getZodChain.d.ts +0 -8
- package/dist/generators/core/zod/getZodSchema.d.ts +0 -17
- package/dist/generators/core/zod/getZodSchema.test.d.ts +0 -1
- package/dist/generators/core/zod/getZodSchemaRefs.d.ts +0 -6
- package/dist/generators/core/zod/getZodSchemasFromOpenAPIDoc.d.ts +0 -6
- package/dist/generators/core/zod/resolveZodSchemaName.d.ts +0 -10
- package/dist/generators/core/zod/sortZodSchemasByTopology.d.ts +0 -4
- package/dist/generators/generate/generateAcl.d.ts +0 -3
- package/dist/generators/generate/generateAclCheck.d.ts +0 -2
- package/dist/generators/generate/generateAppRestClient.d.ts +0 -2
- package/dist/generators/generate/generateConfigs.d.ts +0 -2
- package/dist/generators/generate/generateEndpoints.d.ts +0 -2
- package/dist/generators/generate/generateModels.d.ts +0 -2
- package/dist/generators/generate/generateQueries.d.ts +0 -2
- package/dist/generators/generate/generateQueryModules.d.ts +0 -2
- package/dist/generators/generate/generateZodExtended.d.ts +0 -2
- package/dist/generators/generateCodeFromOpenAPIDoc.d.ts +0 -4
- package/dist/generators/types/builder-config.d.ts +0 -48
- package/dist/generators/types/common.d.ts +0 -27
- package/dist/generators/types/config.d.ts +0 -2
- package/dist/generators/types/endpoint.d.ts +0 -50
- package/dist/generators/types/generate.d.ts +0 -39
- package/dist/generators/types/metadata.d.ts +0 -51
- package/dist/generators/types/openapi.d.ts +0 -22
- package/dist/generators/types/options.d.ts +0 -66
- package/dist/generators/types/validation.d.ts +0 -5
- package/dist/generators/utils/array.utils.d.ts +0 -1
- package/dist/generators/utils/endpoint.utils.d.ts +0 -12
- package/dist/generators/utils/endpoint.utils.test.d.ts +0 -1
- package/dist/generators/utils/file.utils.d.ts +0 -8
- package/dist/generators/utils/generate/generate.acl.utils.d.ts +0 -23
- package/dist/generators/utils/generate/generate.configs.utils.d.ts +0 -15
- package/dist/generators/utils/generate/generate.endpoints.utils.d.ts +0 -39
- package/dist/generators/utils/generate/generate.imports.utils.d.ts +0 -39
- package/dist/generators/utils/generate/generate.imports.utils.test.d.ts +0 -1
- package/dist/generators/utils/generate/generate.openapi.utils.d.ts +0 -2
- package/dist/generators/utils/generate/generate.query.utils.d.ts +0 -6
- package/dist/generators/utils/generate/generate.utils.d.ts +0 -18
- package/dist/generators/utils/generate/generate.zod.utils.d.ts +0 -13
- package/dist/generators/utils/generate-files.utils.d.ts +0 -6
- package/dist/generators/utils/hbs/hbs-template.utils.d.ts +0 -3
- package/dist/generators/utils/hbs/hbs.acl.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.common.utils.d.ts +0 -1
- package/dist/generators/utils/hbs/hbs.endpoints.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.imports.utils.d.ts +0 -1
- package/dist/generators/utils/hbs/hbs.partials.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.query.utils.d.ts +0 -2
- package/dist/generators/utils/hbs/hbs.zod.utils.d.ts +0 -2
- package/dist/generators/utils/js.utils.d.ts +0 -2
- package/dist/generators/utils/js.utils.test.d.ts +0 -1
- package/dist/generators/utils/math.utils.d.ts +0 -1
- package/dist/generators/utils/namespace.utils.d.ts +0 -7
- package/dist/generators/utils/object.utils.d.ts +0 -13
- package/dist/generators/utils/object.utils.test.d.ts +0 -1
- package/dist/generators/utils/openapi-schema.utils.d.ts +0 -15
- package/dist/generators/utils/openapi.utils.d.ts +0 -23
- package/dist/generators/utils/openapi.utils.test.d.ts +0 -1
- package/dist/generators/utils/operation.utils.d.ts +0 -22
- package/dist/generators/utils/operation.utils.test.d.ts +0 -1
- package/dist/generators/utils/query.utils.d.ts +0 -7
- package/dist/generators/utils/sort.utils.d.ts +0 -7
- package/dist/generators/utils/string.utils.d.ts +0 -14
- package/dist/generators/utils/string.utils.test.d.ts +0 -1
- package/dist/generators/utils/tag.utils.d.ts +0 -7
- package/dist/generators/utils/ts.utils.d.ts +0 -16
- package/dist/generators/utils/validation.utils.d.ts +0 -17
- package/dist/generators/utils/zod-schema.utils.d.ts +0 -15
- package/dist/helpers/cli.helper.d.ts +0 -22
- package/dist/helpers/config.helper.d.ts +0 -3
- package/dist/helpers/version.helper.d.ts +0 -4
- package/dist/helpers/yargs.helper.d.ts +0 -10
- package/dist/index.d.ts +0 -14
- package/dist/lib/acl/AclGuard.d.ts +0 -8
- package/dist/lib/acl/AclGuard.mjs +0 -14
- package/dist/lib/acl/Can.d.ts +0 -9
- package/dist/lib/acl/Can.mjs +0 -11
- package/dist/lib/acl/ability.context.d.ts +0 -15
- package/dist/lib/acl/ability.context.mjs +0 -37
- package/dist/lib/acl/appAbility.types.d.ts +0 -3
- package/dist/lib/assets/locales/en/translation.json.mjs +0 -8
- package/dist/lib/assets/locales/sl/translation.json.mjs +0 -8
- package/dist/lib/auth/AuthGuard.d.ts +0 -6
- package/dist/lib/auth/AuthGuard.mjs +0 -26
- package/dist/lib/auth/auth.context.d.ts +0 -22
- package/dist/lib/auth/auth.context.mjs +0 -41
- package/dist/lib/config/i18n.d.ts +0 -32
- package/dist/lib/config/i18n.mjs +0 -31
- package/dist/lib/config/queryConfig.context.d.ts +0 -17
- package/dist/lib/config/queryConfig.context.mjs +0 -26
- package/dist/lib/config/router.context.d.ts +0 -9
- package/dist/lib/config/router.context.mjs +0 -20
- package/dist/lib/react-query.types.d.ts +0 -10
- package/dist/lib/rest/error-handling.d.ts +0 -30
- package/dist/lib/rest/error-handling.mjs +0 -132
- package/dist/lib/rest/rest-client.d.ts +0 -22
- package/dist/lib/rest/rest-client.mjs +0 -62
- package/dist/lib/rest/rest-client.types.d.ts +0 -23
- package/dist/lib/rest/rest-interceptor.d.ts +0 -8
- package/dist/lib/rest/rest-interceptor.mjs +0 -21
- package/dist/lib/rest/rest.utils.d.ts +0 -7
- package/dist/lib/rest/rest.utils.mjs +0 -51
- package/dist/sh.d.ts +0 -2
- package/dist/sh.js +0 -634
- package/src/assets/useCrossTabQueryInvalidation.ts +0 -40
- package/src/assets/useMutationEffects.ts +0 -89
- package/src/generators/templates/acl-check.hbs +0 -29
- package/src/generators/templates/acl.hbs +0 -19
- package/src/generators/templates/app-acl.hbs +0 -17
- package/src/generators/templates/app-rest-client.hbs +0 -7
- package/src/generators/templates/configs.hbs +0 -80
- package/src/generators/templates/endpoints.hbs +0 -44
- package/src/generators/templates/models.hbs +0 -23
- package/src/generators/templates/partials/acl-check-call.hbs +0 -1
- package/src/generators/templates/partials/casl-ability-function.hbs +0 -12
- package/src/generators/templates/partials/casl-ability-query.hbs +0 -1
- package/src/generators/templates/partials/casl-ability-type.hbs +0 -1
- package/src/generators/templates/partials/columns-config.hbs +0 -11
- package/src/generators/templates/partials/endpoint-config.hbs +0 -31
- package/src/generators/templates/partials/endpoint-param-parse.hbs +0 -1
- package/src/generators/templates/partials/endpoint-params.hbs +0 -1
- package/src/generators/templates/partials/import.hbs +0 -1
- package/src/generators/templates/partials/inputs-config.hbs +0 -10
- package/src/generators/templates/partials/model-js-docs.hbs +0 -6
- package/src/generators/templates/partials/query-js-docs.hbs +0 -31
- package/src/generators/templates/partials/query-keys.hbs +0 -11
- package/src/generators/templates/partials/query-use-infinite-query.hbs +0 -21
- package/src/generators/templates/partials/query-use-mutation.hbs +0 -54
- package/src/generators/templates/partials/query-use-query.hbs +0 -16
- package/src/generators/templates/queries.hbs +0 -54
- package/src/generators/templates/query-modules.hbs +0 -9
- package/src/generators/templates/zod-extended.hbs +0 -49
package/dist/sh.mjs
ADDED
|
@@ -0,0 +1,439 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { S as VALIDATION_ERROR_TYPE_TITLE, g as groupByType, h as GenerateType, i as getDataFromOpenAPIDoc, n as getOutputFileName, u as getTagFileName, x as Profiler } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
|
|
3
|
+
import { n as resolveConfig, t as runGenerate } from "./generate.runner-DmZ5LVHf.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import yargs from "yargs";
|
|
6
|
+
import { hideBin } from "yargs/helpers";
|
|
7
|
+
import { styleText } from "node:util";
|
|
8
|
+
import fs, { existsSync, rmSync, writeFileSync } from "fs";
|
|
9
|
+
import "reflect-metadata";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import SwaggerParser from "@apidevtools/swagger-parser";
|
|
12
|
+
import { exec } from "child_process";
|
|
13
|
+
|
|
14
|
+
//#region \0rolldown/runtime.js
|
|
15
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/helpers/cli.helper.ts
|
|
19
|
+
function log(message) {
|
|
20
|
+
console.log(message);
|
|
21
|
+
}
|
|
22
|
+
function logInfo(message) {
|
|
23
|
+
console.log(`[INFO] ${message}`);
|
|
24
|
+
}
|
|
25
|
+
function logSuccess(message) {
|
|
26
|
+
console.log(styleText("green", `[SUCCESS] ${message}`));
|
|
27
|
+
}
|
|
28
|
+
function logError(error, message) {
|
|
29
|
+
if (error instanceof Error) console.log(styleText("red", `[ERROR] ${message || error.message}`));
|
|
30
|
+
else console.log(styleText("red", `[ERROR] ${error}`));
|
|
31
|
+
}
|
|
32
|
+
function logBanner(message) {
|
|
33
|
+
console.log(styleText("bgYellow", `==== ${message} ====`));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/helpers/version.helper.ts
|
|
38
|
+
/**
|
|
39
|
+
* Fetch the version from package.json
|
|
40
|
+
*/
|
|
41
|
+
function getVersion() {
|
|
42
|
+
return "2.0.8-rc.20";
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region src/helpers/yargs.helper.ts
|
|
47
|
+
const optionsKey = Symbol("options_key");
|
|
48
|
+
function YargOption(properties) {
|
|
49
|
+
return (target, propertyKey) => {
|
|
50
|
+
if (properties !== void 0 && properties !== null) {
|
|
51
|
+
const newMetadata = {
|
|
52
|
+
...Reflect.getMetadata(optionsKey, target),
|
|
53
|
+
[propertyKey]: {
|
|
54
|
+
...properties,
|
|
55
|
+
describe: properties.envAlias ? `${properties.describe || ""} [${properties.envAlias}]` : properties.describe,
|
|
56
|
+
type: properties.type || Reflect.getMetadata("design:type", target, propertyKey)?.name?.toLowerCase()
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
Reflect.defineMetadata(optionsKey, newMetadata, target);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function getYargsOption(target) {
|
|
64
|
+
const options = Reflect.getMetadata(optionsKey, target.prototype);
|
|
65
|
+
if (!options) throw new Error(`Options for ${target.name} were not defined`);
|
|
66
|
+
return options;
|
|
67
|
+
}
|
|
68
|
+
function getBuilder(options) {
|
|
69
|
+
return async (y) => {
|
|
70
|
+
return y.options(getYargsOptions(options)).middleware(async (_argv) => {
|
|
71
|
+
return await loadYargsConfig(options, _argv);
|
|
72
|
+
}, true);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function getYargsOptions(target) {
|
|
76
|
+
return Object.entries(getYargsOption(target)).reduce((a, [property, options]) => {
|
|
77
|
+
a[property] = Object.fromEntries(Object.entries(options).filter(([optionName]) => !["envAlias", "default"].includes(optionName)));
|
|
78
|
+
return a;
|
|
79
|
+
}, {});
|
|
80
|
+
}
|
|
81
|
+
async function loadYargsConfig(cls, _argv) {
|
|
82
|
+
const argv = new cls();
|
|
83
|
+
for (const [name, o] of Object.entries(getYargsOption(cls))) argv[name] = _argv[name] ?? o.default;
|
|
84
|
+
return argv;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/generators/checkOpenAPIDoc.ts
|
|
89
|
+
function checkOpenAPIDoc(openApiDoc, options) {
|
|
90
|
+
const { resolver, data } = getDataFromOpenAPIDoc(openApiDoc, options);
|
|
91
|
+
if (resolver.validationErrors.length > 0) {
|
|
92
|
+
const groupedErrors = groupByType(resolver.validationErrors);
|
|
93
|
+
Object.entries(groupedErrors).forEach(([type, errorMessages]) => {
|
|
94
|
+
log(`${styleText("red", `${VALIDATION_ERROR_TYPE_TITLE[type]}:`)}\n${errorMessages.map((message) => `- ${message}`).join("\n")}\n`);
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
const outputs = [...data.keys()].reduce((acc, tag) => [...acc, ...getOutputFileNames(tag, options)], []);
|
|
98
|
+
log(`${styleText("green", "Outputs:")}\n${outputs.map((output) => `- ${output}`).join("\n")}\n`);
|
|
99
|
+
}
|
|
100
|
+
return resolver.validationErrors;
|
|
101
|
+
}
|
|
102
|
+
function getOutputFileNames(tag, options) {
|
|
103
|
+
return [
|
|
104
|
+
GenerateType.Models,
|
|
105
|
+
GenerateType.Endpoints,
|
|
106
|
+
GenerateType.Queries
|
|
107
|
+
].map((type) => getOutputFileName({
|
|
108
|
+
output: options.output,
|
|
109
|
+
fileName: getTagFileName({
|
|
110
|
+
tag,
|
|
111
|
+
type,
|
|
112
|
+
options
|
|
113
|
+
})
|
|
114
|
+
}));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region src/helpers/config.helper.ts
|
|
119
|
+
const CONFIG_FILE_NAMES = ["openapi-codegen.config.mjs", "openapi-codegen.config.ts"];
|
|
120
|
+
async function loadConfig(configPath) {
|
|
121
|
+
try {
|
|
122
|
+
if (configPath) return await loadConfigFromPath(configPath);
|
|
123
|
+
for (const fileName of CONFIG_FILE_NAMES) {
|
|
124
|
+
const filePath = path.resolve(process.cwd(), fileName);
|
|
125
|
+
if (fs.existsSync(filePath)) return await loadConfigFromPath(filePath);
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
} catch (error) {
|
|
129
|
+
logError(`Failed to load configuration: ${error instanceof Error ? error.message : error}`);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function loadConfigFromPath(filePath) {
|
|
134
|
+
const absolutePath = path.resolve(process.cwd(), filePath);
|
|
135
|
+
if (!fs.existsSync(absolutePath)) throw new Error(`Configuration file not found: ${filePath}`);
|
|
136
|
+
const ext = path.extname(absolutePath).toLowerCase();
|
|
137
|
+
if (ext === ".mjs") return loadMjsConfig(absolutePath);
|
|
138
|
+
if (ext !== ".ts") throw new Error(`Only ESM (.mjs) and TypeScript (.ts) configuration files are supported. Found: ${ext}`);
|
|
139
|
+
return loadTsConfig(absolutePath);
|
|
140
|
+
}
|
|
141
|
+
async function loadMjsConfig(filePath) {
|
|
142
|
+
const imported = await import(`${pathToFileURL(filePath).href}?t=${Date.now()}`);
|
|
143
|
+
if (!imported.default) throw new Error(`ESM config must have a default export: ${filePath}`);
|
|
144
|
+
return imported.default;
|
|
145
|
+
}
|
|
146
|
+
let importFresh;
|
|
147
|
+
const loadJsSync = function loadJsSync(filepath) {
|
|
148
|
+
if (importFresh === void 0) importFresh = __require("import-fresh");
|
|
149
|
+
return importFresh(filepath);
|
|
150
|
+
};
|
|
151
|
+
let typescript;
|
|
152
|
+
async function loadTsConfig(filePath) {
|
|
153
|
+
if (typescript === void 0) typescript = __require("typescript");
|
|
154
|
+
const transpiledFilepath = `${filePath.slice(0, -2)}cjs`;
|
|
155
|
+
try {
|
|
156
|
+
const tsConfig = resolveTsConfig(path.dirname(filePath)) ?? {};
|
|
157
|
+
tsConfig.compilerOptions = Object.assign({}, tsConfig.compilerOptions, {
|
|
158
|
+
module: typescript.ModuleKind.NodeNext,
|
|
159
|
+
moduleResolution: typescript.ModuleResolutionKind.NodeNext,
|
|
160
|
+
target: typescript.ScriptTarget.ES2022,
|
|
161
|
+
noEmit: false
|
|
162
|
+
});
|
|
163
|
+
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
164
|
+
const transpiledFileContent = typescript.transpileModule(fileContent, tsConfig).outputText;
|
|
165
|
+
writeFileSync(transpiledFilepath, transpiledFileContent);
|
|
166
|
+
return loadJsSync(transpiledFilepath).default;
|
|
167
|
+
} catch (error) {
|
|
168
|
+
error.message = `TypeScript Error in ${filePath}:\n${error.message}`;
|
|
169
|
+
throw error;
|
|
170
|
+
} finally {
|
|
171
|
+
if (existsSync(transpiledFilepath)) rmSync(transpiledFilepath);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function resolveTsConfig(directory) {
|
|
175
|
+
const filePath = typescript.findConfigFile(directory, (fileName) => {
|
|
176
|
+
return typescript.sys.fileExists(fileName);
|
|
177
|
+
});
|
|
178
|
+
if (filePath === void 0) return;
|
|
179
|
+
const { config, error } = typescript.readConfigFile(filePath, (path) => typescript.sys.readFile(path));
|
|
180
|
+
if (error) throw new Error(`Error in ${filePath}: ${error.messageText.toString()}`);
|
|
181
|
+
return config;
|
|
182
|
+
}
|
|
183
|
+
function pathToFileURL(filePath) {
|
|
184
|
+
const normalizedPath = path.resolve(filePath).replace(/\\/g, "/");
|
|
185
|
+
return { href: normalizedPath.startsWith("/") ? `file://${normalizedPath}` : `file:///${normalizedPath}` };
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/commands/check.ts
|
|
190
|
+
async function check({ verbose, config: configParam, excludeTags: _excludeTagsParam, ...params }) {
|
|
191
|
+
const start = Date.now();
|
|
192
|
+
if (verbose) logInfo("Resolving config...");
|
|
193
|
+
const config = resolveConfig({
|
|
194
|
+
fileConfig: await loadConfig(configParam),
|
|
195
|
+
params
|
|
196
|
+
});
|
|
197
|
+
if (verbose) logInfo("Parsing OpenAPI spec...");
|
|
198
|
+
const openApiDoc = await SwaggerParser.bundle(config.input);
|
|
199
|
+
if (verbose) logInfo("Running check...");
|
|
200
|
+
const errorMessages = checkOpenAPIDoc(openApiDoc, config);
|
|
201
|
+
if (errorMessages.length === 0) logSuccess(`Time: ${Date.now() - start}ms`);
|
|
202
|
+
else throw new Error(`Found ${errorMessages.length} issues. Time: ${Date.now() - start}ms`);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/decorateMetadata.js
|
|
207
|
+
function __decorateMetadata(k, v) {
|
|
208
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
//#endregion
|
|
212
|
+
//#region \0@oxc-project+runtime@0.114.0/helpers/decorate.js
|
|
213
|
+
function __decorate(decorators, target, key, desc) {
|
|
214
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
215
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
216
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
217
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/commands/check.command.ts
|
|
222
|
+
var CheckOptions = class {
|
|
223
|
+
config;
|
|
224
|
+
input;
|
|
225
|
+
splitByTags;
|
|
226
|
+
defaultTag;
|
|
227
|
+
excludeTags;
|
|
228
|
+
excludePathRegex;
|
|
229
|
+
excludeRedundantZodSchemas;
|
|
230
|
+
verbose;
|
|
231
|
+
};
|
|
232
|
+
__decorate([YargOption({ envAlias: "config" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "config", void 0);
|
|
233
|
+
__decorate([YargOption({ envAlias: "input" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "input", void 0);
|
|
234
|
+
__decorate([YargOption({
|
|
235
|
+
envAlias: "splitByTags",
|
|
236
|
+
type: "boolean"
|
|
237
|
+
}), __decorateMetadata("design:type", Boolean)], CheckOptions.prototype, "splitByTags", void 0);
|
|
238
|
+
__decorate([YargOption({ envAlias: "defaultTag" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "defaultTag", void 0);
|
|
239
|
+
__decorate([YargOption({ envAlias: "excludeTags" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "excludeTags", void 0);
|
|
240
|
+
__decorate([YargOption({ envAlias: "excludePathRegex" }), __decorateMetadata("design:type", String)], CheckOptions.prototype, "excludePathRegex", void 0);
|
|
241
|
+
__decorate([YargOption({
|
|
242
|
+
envAlias: "excludeRedundantZodSchemas",
|
|
243
|
+
type: "boolean"
|
|
244
|
+
}), __decorateMetadata("design:type", Boolean)], CheckOptions.prototype, "excludeRedundantZodSchemas", void 0);
|
|
245
|
+
__decorate([YargOption({
|
|
246
|
+
envAlias: "verbose",
|
|
247
|
+
default: false,
|
|
248
|
+
type: "boolean"
|
|
249
|
+
}), __decorateMetadata("design:type", Boolean)], CheckOptions.prototype, "verbose", void 0);
|
|
250
|
+
const command$1 = {
|
|
251
|
+
command: "check",
|
|
252
|
+
describe: "Check OpenAPI spec",
|
|
253
|
+
builder: getBuilder(CheckOptions),
|
|
254
|
+
handler: async (_argv) => {
|
|
255
|
+
const argv = await _argv;
|
|
256
|
+
if (argv.verbose) logBanner(`OpenAPI CodeGen ${getVersion()}`);
|
|
257
|
+
return check(argv);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
//#endregion
|
|
262
|
+
//#region src/commands/generate.ts
|
|
263
|
+
async function generate({ prettier, verbose, config: configParam, ...params }) {
|
|
264
|
+
const start = Date.now();
|
|
265
|
+
const profiler = new Profiler(process.env.OPENAPI_CODEGEN_PROFILE === "1");
|
|
266
|
+
const fileConfig = await profiler.runAsync("config.load", async () => await loadConfig(configParam));
|
|
267
|
+
if (verbose) logInfo("Generating code...");
|
|
268
|
+
const result = await runGenerate({
|
|
269
|
+
fileConfig,
|
|
270
|
+
params,
|
|
271
|
+
profiler
|
|
272
|
+
});
|
|
273
|
+
const config = result.config;
|
|
274
|
+
if (result.skipped && verbose) logInfo("OpenAPI and config unchanged. Skipping generation.");
|
|
275
|
+
if (verbose) {
|
|
276
|
+
logSuccess(`Time: ${Date.now() - start}ms`);
|
|
277
|
+
if (profiler.enabled) {
|
|
278
|
+
logInfo("Profile breakdown:");
|
|
279
|
+
profiler.formatLines().forEach((line) => logInfo(` ${line}`));
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (prettier) execPrettier({
|
|
283
|
+
output: config.output,
|
|
284
|
+
verbose
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function execPrettier({ output, verbose }) {
|
|
288
|
+
if (verbose) logInfo("Running Prettier...");
|
|
289
|
+
exec(`prettier --write ${output} `, (error) => {
|
|
290
|
+
if (verbose) if (error) logError(error, "Prettier error");
|
|
291
|
+
else logSuccess("Prettier finished.");
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/commands/generate.command.ts
|
|
297
|
+
var GenerateOptions = class {
|
|
298
|
+
config;
|
|
299
|
+
input;
|
|
300
|
+
output;
|
|
301
|
+
incremental;
|
|
302
|
+
tsNamespaces;
|
|
303
|
+
tsPath;
|
|
304
|
+
splitByTags;
|
|
305
|
+
defaultTag;
|
|
306
|
+
excludeTags;
|
|
307
|
+
excludePathRegex;
|
|
308
|
+
excludeRedundantZodSchemas;
|
|
309
|
+
importPath;
|
|
310
|
+
extractEnums;
|
|
311
|
+
modelsInCommon;
|
|
312
|
+
removeOperationPrefixEndingWith;
|
|
313
|
+
acl;
|
|
314
|
+
checkAcl;
|
|
315
|
+
baseUrl;
|
|
316
|
+
replaceOptionalWithNullish;
|
|
317
|
+
infiniteQueries;
|
|
318
|
+
mutationEffects;
|
|
319
|
+
workspaceContext;
|
|
320
|
+
parseRequestParams;
|
|
321
|
+
inlineEndpoints;
|
|
322
|
+
inlineEndpointsExcludeModules;
|
|
323
|
+
modelsOnly;
|
|
324
|
+
axiosRequestConfig;
|
|
325
|
+
builderConfigs;
|
|
326
|
+
format;
|
|
327
|
+
verbose;
|
|
328
|
+
};
|
|
329
|
+
__decorate([YargOption({ envAlias: "config" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "config", void 0);
|
|
330
|
+
__decorate([YargOption({ envAlias: "input" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "input", void 0);
|
|
331
|
+
__decorate([YargOption({ envAlias: "output" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "output", void 0);
|
|
332
|
+
__decorate([YargOption({
|
|
333
|
+
envAlias: "incremental",
|
|
334
|
+
type: "boolean"
|
|
335
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "incremental", void 0);
|
|
336
|
+
__decorate([YargOption({
|
|
337
|
+
envAlias: "tsNamespaces",
|
|
338
|
+
type: "boolean"
|
|
339
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "tsNamespaces", void 0);
|
|
340
|
+
__decorate([YargOption({ envAlias: "tsPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "tsPath", void 0);
|
|
341
|
+
__decorate([YargOption({
|
|
342
|
+
envAlias: "splitByTags",
|
|
343
|
+
type: "boolean"
|
|
344
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "splitByTags", void 0);
|
|
345
|
+
__decorate([YargOption({ envAlias: "defaultTag" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "defaultTag", void 0);
|
|
346
|
+
__decorate([YargOption({ envAlias: "excludeTags" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "excludeTags", void 0);
|
|
347
|
+
__decorate([YargOption({ envAlias: "excludePathRegex" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "excludePathRegex", void 0);
|
|
348
|
+
__decorate([YargOption({
|
|
349
|
+
envAlias: "excludeRedundantZodSchemas",
|
|
350
|
+
type: "boolean"
|
|
351
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "excludeRedundantZodSchemas", void 0);
|
|
352
|
+
__decorate([YargOption({ envAlias: "importPath" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "importPath", void 0);
|
|
353
|
+
__decorate([YargOption({
|
|
354
|
+
envAlias: "extractEnums",
|
|
355
|
+
type: "boolean"
|
|
356
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "extractEnums", void 0);
|
|
357
|
+
__decorate([YargOption({
|
|
358
|
+
envAlias: "modelsInCommon",
|
|
359
|
+
type: "boolean"
|
|
360
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsInCommon", void 0);
|
|
361
|
+
__decorate([YargOption({ envAlias: "removeOperationPrefixEndingWith" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "removeOperationPrefixEndingWith", void 0);
|
|
362
|
+
__decorate([YargOption({
|
|
363
|
+
envAlias: "acl",
|
|
364
|
+
type: "boolean"
|
|
365
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "acl", void 0);
|
|
366
|
+
__decorate([YargOption({
|
|
367
|
+
envAlias: "checkAcl",
|
|
368
|
+
type: "boolean"
|
|
369
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "checkAcl", void 0);
|
|
370
|
+
__decorate([YargOption({ envAlias: "baseUrl" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "baseUrl", void 0);
|
|
371
|
+
__decorate([YargOption({
|
|
372
|
+
envAlias: "replaceOptionalWithNullish",
|
|
373
|
+
type: "boolean"
|
|
374
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "replaceOptionalWithNullish", void 0);
|
|
375
|
+
__decorate([YargOption({
|
|
376
|
+
envAlias: "infiniteQueries",
|
|
377
|
+
type: "boolean"
|
|
378
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "infiniteQueries", void 0);
|
|
379
|
+
__decorate([YargOption({
|
|
380
|
+
envAlias: "mutationEffects",
|
|
381
|
+
type: "boolean"
|
|
382
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "mutationEffects", void 0);
|
|
383
|
+
__decorate([YargOption({
|
|
384
|
+
envAlias: "workspaceContext",
|
|
385
|
+
type: "boolean"
|
|
386
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "workspaceContext", void 0);
|
|
387
|
+
__decorate([YargOption({
|
|
388
|
+
envAlias: "parseRequestParams",
|
|
389
|
+
type: "boolean"
|
|
390
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "parseRequestParams", void 0);
|
|
391
|
+
__decorate([YargOption({
|
|
392
|
+
envAlias: "inlineEndpoints",
|
|
393
|
+
type: "boolean"
|
|
394
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "inlineEndpoints", void 0);
|
|
395
|
+
__decorate([YargOption({ envAlias: "inlineEndpointsExcludeModules" }), __decorateMetadata("design:type", String)], GenerateOptions.prototype, "inlineEndpointsExcludeModules", void 0);
|
|
396
|
+
__decorate([YargOption({
|
|
397
|
+
envAlias: "modelsOnly",
|
|
398
|
+
type: "boolean"
|
|
399
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "modelsOnly", void 0);
|
|
400
|
+
__decorate([YargOption({
|
|
401
|
+
envAlias: "axiosRequestConfig",
|
|
402
|
+
type: "boolean"
|
|
403
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "axiosRequestConfig", void 0);
|
|
404
|
+
__decorate([YargOption({
|
|
405
|
+
envAlias: "builderConfigs",
|
|
406
|
+
type: "boolean"
|
|
407
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "builderConfigs", void 0);
|
|
408
|
+
__decorate([YargOption({
|
|
409
|
+
envAlias: "format",
|
|
410
|
+
default: true,
|
|
411
|
+
type: "boolean"
|
|
412
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "format", void 0);
|
|
413
|
+
__decorate([YargOption({
|
|
414
|
+
envAlias: "verbose",
|
|
415
|
+
default: false,
|
|
416
|
+
type: "boolean"
|
|
417
|
+
}), __decorateMetadata("design:type", Boolean)], GenerateOptions.prototype, "verbose", void 0);
|
|
418
|
+
const command = {
|
|
419
|
+
command: "generate",
|
|
420
|
+
describe: "Generate code from OpenAPI spec",
|
|
421
|
+
builder: getBuilder(GenerateOptions),
|
|
422
|
+
handler: async (_argv) => {
|
|
423
|
+
const argv = await _argv;
|
|
424
|
+
if (argv.verbose) logBanner(`OpenAPI CodeGen ${getVersion()}`);
|
|
425
|
+
return generate(argv);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
//#endregion
|
|
430
|
+
//#region src/sh.ts
|
|
431
|
+
yargs(hideBin(process.argv)).version(getVersion() || "unknown").scriptName("openapi-codegen").command(command).command(command$1).help().demandCommand(1).strictCommands(true).showHelpOnFail(true).fail((msg, err) => {
|
|
432
|
+
if (msg) logError(msg);
|
|
433
|
+
if (err) logError(err);
|
|
434
|
+
logInfo("Use '--help' for more info");
|
|
435
|
+
process.exit(1);
|
|
436
|
+
}).parse();
|
|
437
|
+
|
|
438
|
+
//#endregion
|
|
439
|
+
export { };
|
package/dist/vite.d.mts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./options-BNqkO_OS.mjs";
|
|
2
|
+
import { t as OpenAPICodegenConfig } from "./config-BHkVxL6S.mjs";
|
|
3
|
+
import { Plugin } from "vite";
|
|
4
|
+
|
|
5
|
+
//#region src/vite/openapi-codegen.plugin.d.ts
|
|
6
|
+
declare function openApiCodegen(config: OpenAPICodegenConfig): Plugin;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { type OpenAPICodegenConfig, openApiCodegen };
|
package/dist/vite.mjs
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { x as Profiler } from "./generateCodeFromOpenAPIDoc-DZ5swy4U.mjs";
|
|
2
|
+
import { t as runGenerate } from "./generate.runner-DmZ5LVHf.mjs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
|
|
5
|
+
//#region src/vite/openapi-codegen.plugin.ts
|
|
6
|
+
function openApiCodegen(config) {
|
|
7
|
+
let resolvedViteConfig;
|
|
8
|
+
let queue = Promise.resolve();
|
|
9
|
+
const isLocalInput = typeof config.input === "string" && !/^https?:\/\//i.test(config.input);
|
|
10
|
+
const normalizedConfig = { ...config };
|
|
11
|
+
const enqueueGenerate = () => {
|
|
12
|
+
queue = queue.then(async () => {
|
|
13
|
+
const currentConfig = resolvedViteConfig;
|
|
14
|
+
if (!currentConfig) return;
|
|
15
|
+
await runGenerate({
|
|
16
|
+
fileConfig: normalizePaths(normalizedConfig, currentConfig.root),
|
|
17
|
+
profiler: new Profiler(process.env.OPENAPI_CODEGEN_PROFILE === "1")
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const setupWatcher = (server) => {
|
|
22
|
+
if (!isLocalInput || !config.input) return;
|
|
23
|
+
const openApiPath = path.resolve(server.config.root, config.input);
|
|
24
|
+
server.watcher.add(openApiPath);
|
|
25
|
+
server.watcher.on("change", (changedPath) => {
|
|
26
|
+
if (path.resolve(changedPath) === openApiPath) enqueueGenerate();
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
name: "openapi-codegen",
|
|
31
|
+
configResolved(config) {
|
|
32
|
+
resolvedViteConfig = config;
|
|
33
|
+
},
|
|
34
|
+
buildStart() {
|
|
35
|
+
enqueueGenerate();
|
|
36
|
+
},
|
|
37
|
+
configureServer(server) {
|
|
38
|
+
setupWatcher(server);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function normalizePaths(config, root) {
|
|
43
|
+
const normalized = { ...config };
|
|
44
|
+
if (typeof normalized.output === "string" && !path.isAbsolute(normalized.output)) normalized.output = path.resolve(root, normalized.output);
|
|
45
|
+
if (typeof normalized.input === "string" && !path.isAbsolute(normalized.input) && !/^https?:\/\//i.test(normalized.input)) normalized.input = path.resolve(root, normalized.input);
|
|
46
|
+
return normalized;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { openApiCodegen };
|
package/dist/zod.d.mts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { r as ErrorHandler } from "./error-handling-CXeVTk1T.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/zod.d.ts
|
|
5
|
+
declare namespace ZodExtended {
|
|
6
|
+
interface ParseOptions {
|
|
7
|
+
type: "body" | "query";
|
|
8
|
+
name?: string;
|
|
9
|
+
errorHandler?: ErrorHandler<never>;
|
|
10
|
+
}
|
|
11
|
+
export function parse<ZOutput, ZInput>(schema: z.ZodType<ZOutput, ZInput>, data: unknown, {
|
|
12
|
+
type,
|
|
13
|
+
name,
|
|
14
|
+
errorHandler
|
|
15
|
+
}?: ParseOptions): ZOutput;
|
|
16
|
+
export const sortExp: (enumSchema: z.ZodEnum) => z.ZodString;
|
|
17
|
+
export {};
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { ZodExtended };
|
package/dist/zod.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { r as SharedErrorHandler } from "./error-handling-DkPY7Asf.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/zod.ts
|
|
5
|
+
let ZodExtended;
|
|
6
|
+
(function(_ZodExtended) {
|
|
7
|
+
function parse(schema, data, { type, name, errorHandler } = { type: "body" }) {
|
|
8
|
+
try {
|
|
9
|
+
return schema.parse(data);
|
|
10
|
+
} catch (e) {
|
|
11
|
+
if (e instanceof z.ZodError) e.name = `FE Request ${type === "body" ? "body" : "query param"}${name ? ` ("${name}")` : ""} schema mismatch - ZodError`;
|
|
12
|
+
(errorHandler ?? SharedErrorHandler).rethrowError(e);
|
|
13
|
+
throw e;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
_ZodExtended.parse = parse;
|
|
17
|
+
function isSortExpValid(enumSchema, data) {
|
|
18
|
+
if (data === void 0 || data === "" || enumSchema.options.length === 0) return true;
|
|
19
|
+
const prefixedEnumOptions = `([+-]?(${enumSchema.options.join("|")}))`;
|
|
20
|
+
const commaSeparatedOptions = `(${prefixedEnumOptions})(\\s*,\\s*${prefixedEnumOptions})*`;
|
|
21
|
+
return new RegExp(`^${commaSeparatedOptions}$`).test(data);
|
|
22
|
+
}
|
|
23
|
+
_ZodExtended.sortExp = (enumSchema) => z.string().superRefine((arg, ctx) => {
|
|
24
|
+
if (!isSortExpValid(enumSchema, arg)) ctx.addIssue({
|
|
25
|
+
code: "invalid_value",
|
|
26
|
+
message: "Invalid sorting string.",
|
|
27
|
+
values: []
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
})(ZodExtended || (ZodExtended = {}));
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { ZodExtended };
|