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 CHANGED
@@ -3349,7 +3349,8 @@ var generateMock2 = (verbOption, options) => {
3349
3349
  return {
3350
3350
  implementation: {
3351
3351
  function: "",
3352
- handler: ""
3352
+ handler: "",
3353
+ handlerName: ""
3353
3354
  },
3354
3355
  imports: []
3355
3356
  };
@@ -3378,7 +3379,6 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options,
3378
3379
  acc[verbOption.operationId] = {
3379
3380
  implementation: verbOption.doc + client.implementation,
3380
3381
  imports: client.imports,
3381
- // @ts-expect-error // FIXME
3382
3382
  implementationMock: generatedMock.implementation,
3383
3383
  importsMock: generatedMock.imports,
3384
3384
  tags: verbOption.tags,
@@ -3468,6 +3468,10 @@ var getApiBuilder = async ({
3468
3468
  (_a2 = verbs.servers) != null ? _a2 : context.specs[context.specKey].servers,
3469
3469
  output.baseUrl
3470
3470
  );
3471
+ if (!output.target) {
3472
+ (0, import_core2.logError)("Output does not have a target");
3473
+ process.exit(1);
3474
+ }
3471
3475
  const pathOperations = await generateOperations(
3472
3476
  output.client,
3473
3477
  verbsOptions,
@@ -3477,7 +3481,6 @@ var getApiBuilder = async ({
3477
3481
  override: output.override,
3478
3482
  context: resolvedContext,
3479
3483
  mock: output.mock,
3480
- // @ts-expect-error // FIXME
3481
3484
  output: output.target
3482
3485
  },
3483
3486
  output
@@ -3526,7 +3529,6 @@ var importOpenApi = async ({
3526
3529
  const specs = await generateInputSpecs({ specs: data, input, workspace });
3527
3530
  const schemas = getApiSchemas({ input, output, target, workspace, specs });
3528
3531
  const api = await getApiBuilder({
3529
- // @ts-expect-error // FIXME
3530
3532
  input,
3531
3533
  output,
3532
3534
  context: {
@@ -3704,7 +3706,7 @@ var resolveSpecs = async (path, { validate, ...options }, isUrl3, isOnlySchema)
3704
3706
  };
3705
3707
  var importSpecs = async (workspace, options) => {
3706
3708
  const { input, output } = options;
3707
- if ((0, import_core4.isObject)(input.target)) {
3709
+ if (!(0, import_core4.isString)(input.target)) {
3708
3710
  return importOpenApi({
3709
3711
  data: { [workspace]: input.target },
3710
3712
  input,
@@ -3715,7 +3717,6 @@ var importSpecs = async (workspace, options) => {
3715
3717
  }
3716
3718
  const isPathUrl = (0, import_core4.isUrl)(input.target);
3717
3719
  const data = await resolveSpecs(
3718
- // @ts-expect-error // FIXME
3719
3720
  input.target,
3720
3721
  input.parserOptions,
3721
3722
  isPathUrl,
@@ -3725,7 +3726,6 @@ var importSpecs = async (workspace, options) => {
3725
3726
  data,
3726
3727
  input,
3727
3728
  output,
3728
- // @ts-expect-error // FIXME
3729
3729
  target: input.target,
3730
3730
  workspace
3731
3731
  });
@@ -3740,12 +3740,14 @@ var import_chalk2 = __toESM(require("chalk"));
3740
3740
  var package_default = {
3741
3741
  name: "orval",
3742
3742
  description: "A swagger client generator for typescript",
3743
- version: "7.4.1",
3743
+ version: "7.5.0",
3744
3744
  license: "MIT",
3745
3745
  files: [
3746
3746
  "dist"
3747
3747
  ],
3748
- bin: "dist/bin/orval.js",
3748
+ bin: {
3749
+ orval: "dist/bin/orval.js"
3750
+ },
3749
3751
  type: "commonjs",
3750
3752
  main: "dist/index.js",
3751
3753
  keywords: [
@@ -3778,7 +3780,7 @@ var package_default = {
3778
3780
  },
3779
3781
  repository: {
3780
3782
  type: "git",
3781
- url: "https://github.com/orval-labs/orval"
3783
+ url: "git+https://github.com/orval-labs/orval.git"
3782
3784
  },
3783
3785
  scripts: {
3784
3786
  build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --sourcemap --dts",
@@ -3794,19 +3796,19 @@ var package_default = {
3794
3796
  },
3795
3797
  dependencies: {
3796
3798
  "@apidevtools/swagger-parser": "^10.1.0",
3797
- "@orval/angular": "7.4.1",
3798
- "@orval/axios": "7.4.1",
3799
- "@orval/core": "7.4.1",
3800
- "@orval/fetch": "7.4.1",
3801
- "@orval/hono": "7.4.1",
3802
- "@orval/mock": "7.4.1",
3803
- "@orval/query": "7.4.1",
3804
- "@orval/swr": "7.4.1",
3805
- "@orval/zod": "7.4.1",
3799
+ "@orval/angular": "7.5.0",
3800
+ "@orval/axios": "7.5.0",
3801
+ "@orval/core": "7.5.0",
3802
+ "@orval/fetch": "7.5.0",
3803
+ "@orval/hono": "7.5.0",
3804
+ "@orval/mock": "7.5.0",
3805
+ "@orval/query": "7.5.0",
3806
+ "@orval/swr": "7.5.0",
3807
+ "@orval/zod": "7.5.0",
3806
3808
  ajv: "^8.17.1",
3807
3809
  cac: "^6.7.14",
3808
3810
  chalk: "^4.1.2",
3809
- chokidar: "^4.0.1",
3811
+ chokidar: "^4.0.3",
3810
3812
  enquirer: "^2.4.1",
3811
3813
  execa: "^5.1.1",
3812
3814
  "find-up": "5.0.0",
@@ -4055,16 +4057,17 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
4055
4057
  outputOptions.packageJson || globalOptions.packageJson,
4056
4058
  workspace
4057
4059
  );
4058
- let mock2 = (_a = outputOptions.mock) != null ? _a : globalOptions.mock;
4059
- if (typeof mock2 === "boolean" && mock2) {
4060
+ const mockOption = (_a = outputOptions.mock) != null ? _a : globalOptions.mock;
4061
+ let mock2;
4062
+ if (typeof mockOption === "boolean" && mockOption) {
4060
4063
  mock2 = import_mock2.DEFAULT_MOCK_OPTIONS;
4061
- } else if ((0, import_core7.isFunction)(mock2)) {
4062
- } else if (!mock2) {
4064
+ } else if ((0, import_core7.isFunction)(mockOption)) {
4065
+ } else if (!mockOption) {
4063
4066
  mock2 = void 0;
4064
4067
  } else {
4065
4068
  mock2 = {
4066
4069
  ...import_mock2.DEFAULT_MOCK_OPTIONS,
4067
- ...mock2
4070
+ ...mockOption
4068
4071
  };
4069
4072
  }
4070
4073
  const defaultFileExtension = ".ts";
@@ -4441,10 +4444,12 @@ var normalizeHooks = (hooks) => {
4441
4444
  }, {});
4442
4445
  };
4443
4446
  var normalizeHonoOptions = (hono2 = {}, workspace) => {
4444
- var _a;
4447
+ var _a, _b;
4445
4448
  return {
4446
4449
  ...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {},
4447
- validator: (_a = hono2.validator) != null ? _a : true
4450
+ compositeRoute: (_a = hono2.compositeRoute) != null ? _a : "",
4451
+ validator: (_b = hono2.validator) != null ? _b : true,
4452
+ validatorOutputPath: hono2.validatorOutputPath ? import_core7.upath.resolve(workspace, hono2.validatorOutputPath) : ""
4448
4453
  };
4449
4454
  };
4450
4455
  var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions = {}) => {