orval 7.4.1 → 7.5.0
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/dist/bin/orval.js +32 -27
- package/dist/bin/orval.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -28
- package/dist/index.js.map +1 -1
- package/package.json +15 -13
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
20
20
|
}
|
|
21
21
|
return to;
|
|
22
22
|
};
|
|
23
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
24
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
25
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
26
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -3360,7 +3361,8 @@ var generateMock2 = (verbOption, options) => {
|
|
|
3360
3361
|
return {
|
|
3361
3362
|
implementation: {
|
|
3362
3363
|
function: "",
|
|
3363
|
-
handler: ""
|
|
3364
|
+
handler: "",
|
|
3365
|
+
handlerName: ""
|
|
3364
3366
|
},
|
|
3365
3367
|
imports: []
|
|
3366
3368
|
};
|
|
@@ -3389,7 +3391,6 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options,
|
|
|
3389
3391
|
acc[verbOption.operationId] = {
|
|
3390
3392
|
implementation: verbOption.doc + client.implementation,
|
|
3391
3393
|
imports: client.imports,
|
|
3392
|
-
// @ts-expect-error // FIXME
|
|
3393
3394
|
implementationMock: generatedMock.implementation,
|
|
3394
3395
|
importsMock: generatedMock.imports,
|
|
3395
3396
|
tags: verbOption.tags,
|
|
@@ -3479,6 +3480,10 @@ var getApiBuilder = async ({
|
|
|
3479
3480
|
(_a2 = verbs.servers) != null ? _a2 : context.specs[context.specKey].servers,
|
|
3480
3481
|
output.baseUrl
|
|
3481
3482
|
);
|
|
3483
|
+
if (!output.target) {
|
|
3484
|
+
(0, import_core2.logError)("Output does not have a target");
|
|
3485
|
+
process.exit(1);
|
|
3486
|
+
}
|
|
3482
3487
|
const pathOperations = await generateOperations(
|
|
3483
3488
|
output.client,
|
|
3484
3489
|
verbsOptions,
|
|
@@ -3488,7 +3493,6 @@ var getApiBuilder = async ({
|
|
|
3488
3493
|
override: output.override,
|
|
3489
3494
|
context: resolvedContext,
|
|
3490
3495
|
mock: output.mock,
|
|
3491
|
-
// @ts-expect-error // FIXME
|
|
3492
3496
|
output: output.target
|
|
3493
3497
|
},
|
|
3494
3498
|
output
|
|
@@ -3537,7 +3541,6 @@ var importOpenApi = async ({
|
|
|
3537
3541
|
const specs = await generateInputSpecs({ specs: data, input, workspace });
|
|
3538
3542
|
const schemas = getApiSchemas({ input, output, target, workspace, specs });
|
|
3539
3543
|
const api = await getApiBuilder({
|
|
3540
|
-
// @ts-expect-error // FIXME
|
|
3541
3544
|
input,
|
|
3542
3545
|
output,
|
|
3543
3546
|
context: {
|
|
@@ -3715,7 +3718,7 @@ var resolveSpecs = async (path, { validate, ...options }, isUrl3, isOnlySchema)
|
|
|
3715
3718
|
};
|
|
3716
3719
|
var importSpecs = async (workspace, options) => {
|
|
3717
3720
|
const { input, output } = options;
|
|
3718
|
-
if ((0, import_core4.
|
|
3721
|
+
if (!(0, import_core4.isString)(input.target)) {
|
|
3719
3722
|
return importOpenApi({
|
|
3720
3723
|
data: { [workspace]: input.target },
|
|
3721
3724
|
input,
|
|
@@ -3726,7 +3729,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3726
3729
|
}
|
|
3727
3730
|
const isPathUrl = (0, import_core4.isUrl)(input.target);
|
|
3728
3731
|
const data = await resolveSpecs(
|
|
3729
|
-
// @ts-expect-error // FIXME
|
|
3730
3732
|
input.target,
|
|
3731
3733
|
input.parserOptions,
|
|
3732
3734
|
isPathUrl,
|
|
@@ -3736,7 +3738,6 @@ var importSpecs = async (workspace, options) => {
|
|
|
3736
3738
|
data,
|
|
3737
3739
|
input,
|
|
3738
3740
|
output,
|
|
3739
|
-
// @ts-expect-error // FIXME
|
|
3740
3741
|
target: input.target,
|
|
3741
3742
|
workspace
|
|
3742
3743
|
});
|
|
@@ -3751,12 +3752,14 @@ var import_chalk2 = __toESM(require("chalk"));
|
|
|
3751
3752
|
var package_default = {
|
|
3752
3753
|
name: "orval",
|
|
3753
3754
|
description: "A swagger client generator for typescript",
|
|
3754
|
-
version: "7.
|
|
3755
|
+
version: "7.5.0",
|
|
3755
3756
|
license: "MIT",
|
|
3756
3757
|
files: [
|
|
3757
3758
|
"dist"
|
|
3758
3759
|
],
|
|
3759
|
-
bin:
|
|
3760
|
+
bin: {
|
|
3761
|
+
orval: "dist/bin/orval.js"
|
|
3762
|
+
},
|
|
3760
3763
|
type: "commonjs",
|
|
3761
3764
|
main: "dist/index.js",
|
|
3762
3765
|
keywords: [
|
|
@@ -3789,7 +3792,7 @@ var package_default = {
|
|
|
3789
3792
|
},
|
|
3790
3793
|
repository: {
|
|
3791
3794
|
type: "git",
|
|
3792
|
-
url: "https://github.com/orval-labs/orval"
|
|
3795
|
+
url: "git+https://github.com/orval-labs/orval.git"
|
|
3793
3796
|
},
|
|
3794
3797
|
scripts: {
|
|
3795
3798
|
build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --sourcemap --dts",
|
|
@@ -3805,19 +3808,19 @@ var package_default = {
|
|
|
3805
3808
|
},
|
|
3806
3809
|
dependencies: {
|
|
3807
3810
|
"@apidevtools/swagger-parser": "^10.1.0",
|
|
3808
|
-
"@orval/angular": "7.
|
|
3809
|
-
"@orval/axios": "7.
|
|
3810
|
-
"@orval/core": "7.
|
|
3811
|
-
"@orval/fetch": "7.
|
|
3812
|
-
"@orval/hono": "7.
|
|
3813
|
-
"@orval/mock": "7.
|
|
3814
|
-
"@orval/query": "7.
|
|
3815
|
-
"@orval/swr": "7.
|
|
3816
|
-
"@orval/zod": "7.
|
|
3811
|
+
"@orval/angular": "7.5.0",
|
|
3812
|
+
"@orval/axios": "7.5.0",
|
|
3813
|
+
"@orval/core": "7.5.0",
|
|
3814
|
+
"@orval/fetch": "7.5.0",
|
|
3815
|
+
"@orval/hono": "7.5.0",
|
|
3816
|
+
"@orval/mock": "7.5.0",
|
|
3817
|
+
"@orval/query": "7.5.0",
|
|
3818
|
+
"@orval/swr": "7.5.0",
|
|
3819
|
+
"@orval/zod": "7.5.0",
|
|
3817
3820
|
ajv: "^8.17.1",
|
|
3818
3821
|
cac: "^6.7.14",
|
|
3819
3822
|
chalk: "^4.1.2",
|
|
3820
|
-
chokidar: "^4.0.
|
|
3823
|
+
chokidar: "^4.0.3",
|
|
3821
3824
|
enquirer: "^2.4.1",
|
|
3822
3825
|
execa: "^5.1.1",
|
|
3823
3826
|
"find-up": "5.0.0",
|
|
@@ -4069,16 +4072,17 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
|
|
|
4069
4072
|
outputOptions.packageJson || globalOptions.packageJson,
|
|
4070
4073
|
workspace
|
|
4071
4074
|
);
|
|
4072
|
-
|
|
4073
|
-
|
|
4075
|
+
const mockOption = (_a = outputOptions.mock) != null ? _a : globalOptions.mock;
|
|
4076
|
+
let mock2;
|
|
4077
|
+
if (typeof mockOption === "boolean" && mockOption) {
|
|
4074
4078
|
mock2 = import_mock2.DEFAULT_MOCK_OPTIONS;
|
|
4075
|
-
} else if ((0, import_core7.isFunction)(
|
|
4076
|
-
} else if (!
|
|
4079
|
+
} else if ((0, import_core7.isFunction)(mockOption)) {
|
|
4080
|
+
} else if (!mockOption) {
|
|
4077
4081
|
mock2 = void 0;
|
|
4078
4082
|
} else {
|
|
4079
4083
|
mock2 = {
|
|
4080
4084
|
...import_mock2.DEFAULT_MOCK_OPTIONS,
|
|
4081
|
-
...
|
|
4085
|
+
...mockOption
|
|
4082
4086
|
};
|
|
4083
4087
|
}
|
|
4084
4088
|
const defaultFileExtension = ".ts";
|
|
@@ -4455,10 +4459,12 @@ var normalizeHooks = (hooks) => {
|
|
|
4455
4459
|
}, {});
|
|
4456
4460
|
};
|
|
4457
4461
|
var normalizeHonoOptions = (hono2 = {}, workspace) => {
|
|
4458
|
-
var _a;
|
|
4462
|
+
var _a, _b;
|
|
4459
4463
|
return {
|
|
4460
4464
|
...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {},
|
|
4461
|
-
|
|
4465
|
+
compositeRoute: (_a = hono2.compositeRoute) != null ? _a : "",
|
|
4466
|
+
validator: (_b = hono2.validator) != null ? _b : true,
|
|
4467
|
+
validatorOutputPath: hono2.validatorOutputPath ? import_core7.upath.resolve(workspace, hono2.validatorOutputPath) : ""
|
|
4462
4468
|
};
|
|
4463
4469
|
};
|
|
4464
4470
|
var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions = {}) => {
|
|
@@ -4872,6 +4878,7 @@ var generateConfig = async (configFile, options) => {
|
|
|
4872
4878
|
};
|
|
4873
4879
|
|
|
4874
4880
|
// src/index.ts
|
|
4881
|
+
__reExport(src_exports, require("@orval/core"), module.exports);
|
|
4875
4882
|
var generate = async (optionsExport, workspace = process.cwd(), options) => {
|
|
4876
4883
|
if (!optionsExport || (0, import_core12.isString)(optionsExport)) {
|
|
4877
4884
|
return generateConfig(optionsExport, options);
|
|
@@ -4906,7 +4913,8 @@ var src_default = generate;
|
|
|
4906
4913
|
0 && (module.exports = {
|
|
4907
4914
|
Options,
|
|
4908
4915
|
defineConfig,
|
|
4909
|
-
generate
|
|
4916
|
+
generate,
|
|
4917
|
+
...require("@orval/core")
|
|
4910
4918
|
});
|
|
4911
4919
|
/*! Bundled license information:
|
|
4912
4920
|
|