orval 7.4.1 → 7.6.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/index.js CHANGED
@@ -5,9 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
9
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
8
  var __export = (target, all) => {
12
9
  for (var name in all)
13
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -20,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
20
17
  }
21
18
  return to;
22
19
  };
20
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
21
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
22
  // If the importer is in node compatibility mode or this is not an ESM
25
23
  // file that has been converted to a CommonJS file using a Babel-
@@ -30,514 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
28
  ));
31
29
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
30
 
33
- // ../../node_modules/lodash.omit/index.js
34
- var require_lodash = __commonJS({
35
- "../../node_modules/lodash.omit/index.js"(exports2, module2) {
36
- "use strict";
37
- var LARGE_ARRAY_SIZE = 200;
38
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
39
- var INFINITY = 1 / 0;
40
- var MAX_SAFE_INTEGER = 9007199254740991;
41
- var argsTag = "[object Arguments]";
42
- var funcTag = "[object Function]";
43
- var genTag = "[object GeneratorFunction]";
44
- var symbolTag = "[object Symbol]";
45
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
46
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
47
- var reIsUint = /^(?:0|[1-9]\d*)$/;
48
- var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
49
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
50
- var root = freeGlobal || freeSelf || Function("return this")();
51
- function apply(func, thisArg, args) {
52
- switch (args.length) {
53
- case 0:
54
- return func.call(thisArg);
55
- case 1:
56
- return func.call(thisArg, args[0]);
57
- case 2:
58
- return func.call(thisArg, args[0], args[1]);
59
- case 3:
60
- return func.call(thisArg, args[0], args[1], args[2]);
61
- }
62
- return func.apply(thisArg, args);
63
- }
64
- function arrayIncludes(array, value) {
65
- var length = array ? array.length : 0;
66
- return !!length && baseIndexOf(array, value, 0) > -1;
67
- }
68
- function arrayIncludesWith(array, value, comparator) {
69
- var index = -1, length = array ? array.length : 0;
70
- while (++index < length) {
71
- if (comparator(value, array[index])) {
72
- return true;
73
- }
74
- }
75
- return false;
76
- }
77
- function arrayMap(array, iteratee) {
78
- var index = -1, length = array ? array.length : 0, result = Array(length);
79
- while (++index < length) {
80
- result[index] = iteratee(array[index], index, array);
81
- }
82
- return result;
83
- }
84
- function arrayPush(array, values) {
85
- var index = -1, length = values.length, offset = array.length;
86
- while (++index < length) {
87
- array[offset + index] = values[index];
88
- }
89
- return array;
90
- }
91
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
92
- var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
93
- while (fromRight ? index-- : ++index < length) {
94
- if (predicate(array[index], index, array)) {
95
- return index;
96
- }
97
- }
98
- return -1;
99
- }
100
- function baseIndexOf(array, value, fromIndex) {
101
- if (value !== value) {
102
- return baseFindIndex(array, baseIsNaN, fromIndex);
103
- }
104
- var index = fromIndex - 1, length = array.length;
105
- while (++index < length) {
106
- if (array[index] === value) {
107
- return index;
108
- }
109
- }
110
- return -1;
111
- }
112
- function baseIsNaN(value) {
113
- return value !== value;
114
- }
115
- function baseTimes(n, iteratee) {
116
- var index = -1, result = Array(n);
117
- while (++index < n) {
118
- result[index] = iteratee(index);
119
- }
120
- return result;
121
- }
122
- function baseUnary(func) {
123
- return function(value) {
124
- return func(value);
125
- };
126
- }
127
- function cacheHas(cache, key) {
128
- return cache.has(key);
129
- }
130
- function getValue(object, key) {
131
- return object == null ? void 0 : object[key];
132
- }
133
- function isHostObject(value) {
134
- var result = false;
135
- if (value != null && typeof value.toString != "function") {
136
- try {
137
- result = !!(value + "");
138
- } catch (e) {
139
- }
140
- }
141
- return result;
142
- }
143
- function overArg(func, transform) {
144
- return function(arg) {
145
- return func(transform(arg));
146
- };
147
- }
148
- var arrayProto = Array.prototype;
149
- var funcProto = Function.prototype;
150
- var objectProto = Object.prototype;
151
- var coreJsData = root["__core-js_shared__"];
152
- var maskSrcKey = function() {
153
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
154
- return uid ? "Symbol(src)_1." + uid : "";
155
- }();
156
- var funcToString = funcProto.toString;
157
- var hasOwnProperty = objectProto.hasOwnProperty;
158
- var objectToString = objectProto.toString;
159
- var reIsNative = RegExp(
160
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
161
- );
162
- var Symbol2 = root.Symbol;
163
- var getPrototype = overArg(Object.getPrototypeOf, Object);
164
- var propertyIsEnumerable = objectProto.propertyIsEnumerable;
165
- var splice = arrayProto.splice;
166
- var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0;
167
- var nativeGetSymbols = Object.getOwnPropertySymbols;
168
- var nativeMax = Math.max;
169
- var Map = getNative(root, "Map");
170
- var nativeCreate = getNative(Object, "create");
171
- function Hash(entries) {
172
- var index = -1, length = entries ? entries.length : 0;
173
- this.clear();
174
- while (++index < length) {
175
- var entry = entries[index];
176
- this.set(entry[0], entry[1]);
177
- }
178
- }
179
- function hashClear() {
180
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
181
- }
182
- function hashDelete(key) {
183
- return this.has(key) && delete this.__data__[key];
184
- }
185
- function hashGet(key) {
186
- var data = this.__data__;
187
- if (nativeCreate) {
188
- var result = data[key];
189
- return result === HASH_UNDEFINED ? void 0 : result;
190
- }
191
- return hasOwnProperty.call(data, key) ? data[key] : void 0;
192
- }
193
- function hashHas(key) {
194
- var data = this.__data__;
195
- return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
196
- }
197
- function hashSet(key, value) {
198
- var data = this.__data__;
199
- data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
200
- return this;
201
- }
202
- Hash.prototype.clear = hashClear;
203
- Hash.prototype["delete"] = hashDelete;
204
- Hash.prototype.get = hashGet;
205
- Hash.prototype.has = hashHas;
206
- Hash.prototype.set = hashSet;
207
- function ListCache(entries) {
208
- var index = -1, length = entries ? entries.length : 0;
209
- this.clear();
210
- while (++index < length) {
211
- var entry = entries[index];
212
- this.set(entry[0], entry[1]);
213
- }
214
- }
215
- function listCacheClear() {
216
- this.__data__ = [];
217
- }
218
- function listCacheDelete(key) {
219
- var data = this.__data__, index = assocIndexOf(data, key);
220
- if (index < 0) {
221
- return false;
222
- }
223
- var lastIndex = data.length - 1;
224
- if (index == lastIndex) {
225
- data.pop();
226
- } else {
227
- splice.call(data, index, 1);
228
- }
229
- return true;
230
- }
231
- function listCacheGet(key) {
232
- var data = this.__data__, index = assocIndexOf(data, key);
233
- return index < 0 ? void 0 : data[index][1];
234
- }
235
- function listCacheHas(key) {
236
- return assocIndexOf(this.__data__, key) > -1;
237
- }
238
- function listCacheSet(key, value) {
239
- var data = this.__data__, index = assocIndexOf(data, key);
240
- if (index < 0) {
241
- data.push([key, value]);
242
- } else {
243
- data[index][1] = value;
244
- }
245
- return this;
246
- }
247
- ListCache.prototype.clear = listCacheClear;
248
- ListCache.prototype["delete"] = listCacheDelete;
249
- ListCache.prototype.get = listCacheGet;
250
- ListCache.prototype.has = listCacheHas;
251
- ListCache.prototype.set = listCacheSet;
252
- function MapCache(entries) {
253
- var index = -1, length = entries ? entries.length : 0;
254
- this.clear();
255
- while (++index < length) {
256
- var entry = entries[index];
257
- this.set(entry[0], entry[1]);
258
- }
259
- }
260
- function mapCacheClear() {
261
- this.__data__ = {
262
- "hash": new Hash(),
263
- "map": new (Map || ListCache)(),
264
- "string": new Hash()
265
- };
266
- }
267
- function mapCacheDelete(key) {
268
- return getMapData(this, key)["delete"](key);
269
- }
270
- function mapCacheGet(key) {
271
- return getMapData(this, key).get(key);
272
- }
273
- function mapCacheHas(key) {
274
- return getMapData(this, key).has(key);
275
- }
276
- function mapCacheSet(key, value) {
277
- getMapData(this, key).set(key, value);
278
- return this;
279
- }
280
- MapCache.prototype.clear = mapCacheClear;
281
- MapCache.prototype["delete"] = mapCacheDelete;
282
- MapCache.prototype.get = mapCacheGet;
283
- MapCache.prototype.has = mapCacheHas;
284
- MapCache.prototype.set = mapCacheSet;
285
- function SetCache(values) {
286
- var index = -1, length = values ? values.length : 0;
287
- this.__data__ = new MapCache();
288
- while (++index < length) {
289
- this.add(values[index]);
290
- }
291
- }
292
- function setCacheAdd(value) {
293
- this.__data__.set(value, HASH_UNDEFINED);
294
- return this;
295
- }
296
- function setCacheHas(value) {
297
- return this.__data__.has(value);
298
- }
299
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
300
- SetCache.prototype.has = setCacheHas;
301
- function arrayLikeKeys(value, inherited) {
302
- var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
303
- var length = result.length, skipIndexes = !!length;
304
- for (var key in value) {
305
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
306
- result.push(key);
307
- }
308
- }
309
- return result;
310
- }
311
- function assocIndexOf(array, key) {
312
- var length = array.length;
313
- while (length--) {
314
- if (eq(array[length][0], key)) {
315
- return length;
316
- }
317
- }
318
- return -1;
319
- }
320
- function baseDifference(array, values, iteratee, comparator) {
321
- var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
322
- if (!length) {
323
- return result;
324
- }
325
- if (iteratee) {
326
- values = arrayMap(values, baseUnary(iteratee));
327
- }
328
- if (comparator) {
329
- includes = arrayIncludesWith;
330
- isCommon = false;
331
- } else if (values.length >= LARGE_ARRAY_SIZE) {
332
- includes = cacheHas;
333
- isCommon = false;
334
- values = new SetCache(values);
335
- }
336
- outer:
337
- while (++index < length) {
338
- var value = array[index], computed = iteratee ? iteratee(value) : value;
339
- value = comparator || value !== 0 ? value : 0;
340
- if (isCommon && computed === computed) {
341
- var valuesIndex = valuesLength;
342
- while (valuesIndex--) {
343
- if (values[valuesIndex] === computed) {
344
- continue outer;
345
- }
346
- }
347
- result.push(value);
348
- } else if (!includes(values, computed, comparator)) {
349
- result.push(value);
350
- }
351
- }
352
- return result;
353
- }
354
- function baseFlatten(array, depth, predicate, isStrict, result) {
355
- var index = -1, length = array.length;
356
- predicate || (predicate = isFlattenable);
357
- result || (result = []);
358
- while (++index < length) {
359
- var value = array[index];
360
- if (depth > 0 && predicate(value)) {
361
- if (depth > 1) {
362
- baseFlatten(value, depth - 1, predicate, isStrict, result);
363
- } else {
364
- arrayPush(result, value);
365
- }
366
- } else if (!isStrict) {
367
- result[result.length] = value;
368
- }
369
- }
370
- return result;
371
- }
372
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
373
- var result = keysFunc(object);
374
- return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
375
- }
376
- function baseIsNative(value) {
377
- if (!isObject7(value) || isMasked(value)) {
378
- return false;
379
- }
380
- var pattern = isFunction5(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
381
- return pattern.test(toSource(value));
382
- }
383
- function baseKeysIn(object) {
384
- if (!isObject7(object)) {
385
- return nativeKeysIn(object);
386
- }
387
- var isProto = isPrototype(object), result = [];
388
- for (var key in object) {
389
- if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
390
- result.push(key);
391
- }
392
- }
393
- return result;
394
- }
395
- function basePick(object, props) {
396
- object = Object(object);
397
- return basePickBy(object, props, function(value, key) {
398
- return key in object;
399
- });
400
- }
401
- function basePickBy(object, props, predicate) {
402
- var index = -1, length = props.length, result = {};
403
- while (++index < length) {
404
- var key = props[index], value = object[key];
405
- if (predicate(value, key)) {
406
- result[key] = value;
407
- }
408
- }
409
- return result;
410
- }
411
- function baseRest(func, start) {
412
- start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
413
- return function() {
414
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
415
- while (++index < length) {
416
- array[index] = args[start + index];
417
- }
418
- index = -1;
419
- var otherArgs = Array(start + 1);
420
- while (++index < start) {
421
- otherArgs[index] = args[index];
422
- }
423
- otherArgs[start] = array;
424
- return apply(func, this, otherArgs);
425
- };
426
- }
427
- function getAllKeysIn(object) {
428
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
429
- }
430
- function getMapData(map2, key) {
431
- var data = map2.__data__;
432
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
433
- }
434
- function getNative(object, key) {
435
- var value = getValue(object, key);
436
- return baseIsNative(value) ? value : void 0;
437
- }
438
- var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
439
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
440
- var result = [];
441
- while (object) {
442
- arrayPush(result, getSymbols(object));
443
- object = getPrototype(object);
444
- }
445
- return result;
446
- };
447
- function isFlattenable(value) {
448
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
449
- }
450
- function isIndex(value, length) {
451
- length = length == null ? MAX_SAFE_INTEGER : length;
452
- return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
453
- }
454
- function isKeyable(value) {
455
- var type2 = typeof value;
456
- return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
457
- }
458
- function isMasked(func) {
459
- return !!maskSrcKey && maskSrcKey in func;
460
- }
461
- function isPrototype(value) {
462
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
463
- return value === proto;
464
- }
465
- function nativeKeysIn(object) {
466
- var result = [];
467
- if (object != null) {
468
- for (var key in Object(object)) {
469
- result.push(key);
470
- }
471
- }
472
- return result;
473
- }
474
- function toKey(value) {
475
- if (typeof value == "string" || isSymbol(value)) {
476
- return value;
477
- }
478
- var result = value + "";
479
- return result == "0" && 1 / value == -INFINITY ? "-0" : result;
480
- }
481
- function toSource(func) {
482
- if (func != null) {
483
- try {
484
- return funcToString.call(func);
485
- } catch (e) {
486
- }
487
- try {
488
- return func + "";
489
- } catch (e) {
490
- }
491
- }
492
- return "";
493
- }
494
- function eq(value, other) {
495
- return value === other || value !== value && other !== other;
496
- }
497
- function isArguments(value) {
498
- return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
499
- }
500
- var isArray = Array.isArray;
501
- function isArrayLike(value) {
502
- return value != null && isLength(value.length) && !isFunction5(value);
503
- }
504
- function isArrayLikeObject(value) {
505
- return isObjectLike(value) && isArrayLike(value);
506
- }
507
- function isFunction5(value) {
508
- var tag = isObject7(value) ? objectToString.call(value) : "";
509
- return tag == funcTag || tag == genTag;
510
- }
511
- function isLength(value) {
512
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
513
- }
514
- function isObject7(value) {
515
- var type2 = typeof value;
516
- return !!value && (type2 == "object" || type2 == "function");
517
- }
518
- function isObjectLike(value) {
519
- return !!value && typeof value == "object";
520
- }
521
- function isSymbol(value) {
522
- return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
523
- }
524
- function keysIn(object) {
525
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
526
- }
527
- var omit2 = baseRest(function(object, props) {
528
- if (object == null) {
529
- return {};
530
- }
531
- props = arrayMap(baseFlatten(props, 1), toKey);
532
- return basePick(object, baseDifference(getAllKeysIn(object), props));
533
- });
534
- function stubArray() {
535
- return [];
536
- }
537
- module2.exports = omit2;
538
- }
539
- });
540
-
541
31
  // src/index.ts
542
32
  var src_exports = {};
543
33
  __export(src_exports, {
@@ -3184,7 +2674,6 @@ var import_fs_extra = __toESM(require("fs-extra"));
3184
2674
 
3185
2675
  // src/import-open-api.ts
3186
2676
  var import_core3 = require("@orval/core");
3187
- var import_lodash = __toESM(require_lodash());
3188
2677
 
3189
2678
  // src/api.ts
3190
2679
  var import_core2 = require("@orval/core");
@@ -3360,7 +2849,8 @@ var generateMock2 = (verbOption, options) => {
3360
2849
  return {
3361
2850
  implementation: {
3362
2851
  function: "",
3363
- handler: ""
2852
+ handler: "",
2853
+ handlerName: ""
3364
2854
  },
3365
2855
  imports: []
3366
2856
  };
@@ -3389,7 +2879,6 @@ var generateOperations = (outputClient = DEFAULT_CLIENT, verbsOptions, options,
3389
2879
  acc[verbOption.operationId] = {
3390
2880
  implementation: verbOption.doc + client.implementation,
3391
2881
  imports: client.imports,
3392
- // @ts-expect-error // FIXME
3393
2882
  implementationMock: generatedMock.implementation,
3394
2883
  importsMock: generatedMock.imports,
3395
2884
  tags: verbOption.tags,
@@ -3479,6 +2968,10 @@ var getApiBuilder = async ({
3479
2968
  (_a2 = verbs.servers) != null ? _a2 : context.specs[context.specKey].servers,
3480
2969
  output.baseUrl
3481
2970
  );
2971
+ if (!output.target) {
2972
+ (0, import_core2.logError)("Output does not have a target");
2973
+ process.exit(1);
2974
+ }
3482
2975
  const pathOperations = await generateOperations(
3483
2976
  output.client,
3484
2977
  verbsOptions,
@@ -3488,7 +2981,6 @@ var getApiBuilder = async ({
3488
2981
  override: output.override,
3489
2982
  context: resolvedContext,
3490
2983
  mock: output.mock,
3491
- // @ts-expect-error // FIXME
3492
2984
  output: output.target
3493
2985
  },
3494
2986
  output
@@ -3537,7 +3029,6 @@ var importOpenApi = async ({
3537
3029
  const specs = await generateInputSpecs({ specs: data, input, workspace });
3538
3030
  const schemas = getApiSchemas({ input, output, target, workspace, specs });
3539
3031
  const api = await getApiBuilder({
3540
- // @ts-expect-error // FIXME
3541
3032
  input,
3542
3033
  output,
3543
3034
  context: {
@@ -3575,7 +3066,7 @@ var generateInputSpecs = async ({
3575
3066
  );
3576
3067
  const transfomedSchema = transformerFn ? transformerFn(schema2) : schema2;
3577
3068
  if (input.validation) {
3578
- await (0, import_core3.ibmOpenapiValidator)(transfomedSchema);
3069
+ await (0, import_core3.ibmOpenapiValidator)(transfomedSchema, input.validation);
3579
3070
  }
3580
3071
  acc[specKey] = transfomedSchema;
3581
3072
  return acc;
@@ -3639,7 +3130,7 @@ var getApiSchemas = ({
3639
3130
  };
3640
3131
  var getAllSchemas = (spec, specKey) => {
3641
3132
  var _a;
3642
- const cleanedSpec = (0, import_lodash.default)(spec, [
3133
+ const keysToOmit = [
3643
3134
  "openapi",
3644
3135
  "info",
3645
3136
  "servers",
@@ -3648,20 +3139,28 @@ var getAllSchemas = (spec, specKey) => {
3648
3139
  "security",
3649
3140
  "tags",
3650
3141
  "externalDocs"
3651
- ]);
3142
+ ];
3143
+ const cleanedSpec = Object.fromEntries(
3144
+ Object.entries(spec).filter(([key]) => !keysToOmit.includes(key))
3145
+ );
3652
3146
  if (specKey && (0, import_core3.isSchema)(cleanedSpec)) {
3653
3147
  const name = import_core3.upath.getSchemaFileName(specKey);
3148
+ const additionalKeysToOmit = [
3149
+ "type",
3150
+ "properties",
3151
+ "allOf",
3152
+ "oneOf",
3153
+ "anyOf",
3154
+ "items"
3155
+ ];
3654
3156
  return {
3655
3157
  [name]: cleanedSpec,
3656
3158
  ...getAllSchemas(
3657
- (0, import_lodash.default)(cleanedSpec, [
3658
- "type",
3659
- "properties",
3660
- "allOf",
3661
- "oneOf",
3662
- "anyOf",
3663
- "items"
3664
- ])
3159
+ Object.fromEntries(
3160
+ Object.entries(cleanedSpec).filter(
3161
+ ([key]) => !additionalKeysToOmit.includes(key)
3162
+ )
3163
+ )
3665
3164
  )
3666
3165
  };
3667
3166
  }
@@ -3715,7 +3214,7 @@ var resolveSpecs = async (path, { validate, ...options }, isUrl3, isOnlySchema)
3715
3214
  };
3716
3215
  var importSpecs = async (workspace, options) => {
3717
3216
  const { input, output } = options;
3718
- if ((0, import_core4.isObject)(input.target)) {
3217
+ if (!(0, import_core4.isString)(input.target)) {
3719
3218
  return importOpenApi({
3720
3219
  data: { [workspace]: input.target },
3721
3220
  input,
@@ -3726,7 +3225,6 @@ var importSpecs = async (workspace, options) => {
3726
3225
  }
3727
3226
  const isPathUrl = (0, import_core4.isUrl)(input.target);
3728
3227
  const data = await resolveSpecs(
3729
- // @ts-expect-error // FIXME
3730
3228
  input.target,
3731
3229
  input.parserOptions,
3732
3230
  isPathUrl,
@@ -3736,7 +3234,6 @@ var importSpecs = async (workspace, options) => {
3736
3234
  data,
3737
3235
  input,
3738
3236
  output,
3739
- // @ts-expect-error // FIXME
3740
3237
  target: input.target,
3741
3238
  workspace
3742
3239
  });
@@ -3751,7 +3248,7 @@ var import_chalk2 = __toESM(require("chalk"));
3751
3248
  var package_default = {
3752
3249
  name: "orval",
3753
3250
  description: "A swagger client generator for typescript",
3754
- version: "7.4.1",
3251
+ version: "7.6.0",
3755
3252
  license: "MIT",
3756
3253
  files: [
3757
3254
  "dist"
@@ -3789,7 +3286,7 @@ var package_default = {
3789
3286
  },
3790
3287
  repository: {
3791
3288
  type: "git",
3792
- url: "https://github.com/orval-labs/orval"
3289
+ url: "git+https://github.com/orval-labs/orval.git"
3793
3290
  },
3794
3291
  scripts: {
3795
3292
  build: "tsup ./src/bin/orval.ts ./src/index.ts --target node12 --clean --sourcemap --dts",
@@ -3801,23 +3298,24 @@ var package_default = {
3801
3298
  devDependencies: {
3802
3299
  "@types/inquirer": "^9.0.6",
3803
3300
  "@types/js-yaml": "^4.0.8",
3804
- "@types/lodash.uniq": "^4.5.8"
3301
+ "@types/lodash.uniq": "^4.5.8",
3302
+ "typedoc-plugin-coverage": "^3.4.1"
3805
3303
  },
3806
3304
  dependencies: {
3807
3305
  "@apidevtools/swagger-parser": "^10.1.0",
3808
- "@orval/angular": "7.4.1",
3809
- "@orval/axios": "7.4.1",
3810
- "@orval/core": "7.4.1",
3811
- "@orval/fetch": "7.4.1",
3812
- "@orval/hono": "7.4.1",
3813
- "@orval/mock": "7.4.1",
3814
- "@orval/query": "7.4.1",
3815
- "@orval/swr": "7.4.1",
3816
- "@orval/zod": "7.4.1",
3306
+ "@orval/angular": "7.6.0",
3307
+ "@orval/axios": "7.6.0",
3308
+ "@orval/core": "7.6.0",
3309
+ "@orval/fetch": "7.6.0",
3310
+ "@orval/hono": "7.6.0",
3311
+ "@orval/mock": "7.6.0",
3312
+ "@orval/query": "7.6.0",
3313
+ "@orval/swr": "7.6.0",
3314
+ "@orval/zod": "7.6.0",
3817
3315
  ajv: "^8.17.1",
3818
3316
  cac: "^6.7.14",
3819
3317
  chalk: "^4.1.2",
3820
- chokidar: "^4.0.1",
3318
+ chokidar: "^4.0.3",
3821
3319
  enquirer: "^2.4.1",
3822
3320
  execa: "^5.1.1",
3823
3321
  "find-up": "5.0.0",
@@ -3826,8 +3324,8 @@ var package_default = {
3826
3324
  "openapi3-ts": "4.2.2",
3827
3325
  "string-argv": "^0.3.2",
3828
3326
  tsconfck: "^2.0.1",
3829
- typedoc: "0.26.11",
3830
- "typedoc-plugin-markdown": "4.2.10",
3327
+ typedoc: "^0.27.7",
3328
+ "typedoc-plugin-markdown": "^4.4.2",
3831
3329
  typescript: "^5.6.3"
3832
3330
  }
3833
3331
  };
@@ -4069,16 +3567,17 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
4069
3567
  outputOptions.packageJson || globalOptions.packageJson,
4070
3568
  workspace
4071
3569
  );
4072
- let mock2 = (_a = outputOptions.mock) != null ? _a : globalOptions.mock;
4073
- if (typeof mock2 === "boolean" && mock2) {
3570
+ const mockOption = (_a = outputOptions.mock) != null ? _a : globalOptions.mock;
3571
+ let mock2;
3572
+ if (typeof mockOption === "boolean" && mockOption) {
4074
3573
  mock2 = import_mock2.DEFAULT_MOCK_OPTIONS;
4075
- } else if ((0, import_core7.isFunction)(mock2)) {
4076
- } else if (!mock2) {
3574
+ } else if ((0, import_core7.isFunction)(mockOption)) {
3575
+ } else if (!mockOption) {
4077
3576
  mock2 = void 0;
4078
3577
  } else {
4079
3578
  mock2 = {
4080
3579
  ...import_mock2.DEFAULT_MOCK_OPTIONS,
4081
- ...mock2
3580
+ ...mockOption
4082
3581
  };
4083
3582
  }
4084
3583
  const defaultFileExtension = ".ts";
@@ -4111,6 +3610,7 @@ var normalizeOptions = async (optionsExport, workspace = process.cwd(), globalOp
4111
3610
  output: {
4112
3611
  target: globalOptions.output ? normalizePath(globalOptions.output, process.cwd()) : normalizePath(outputOptions.target, outputWorkspace),
4113
3612
  schemas: normalizePath(outputOptions.schemas, outputWorkspace),
3613
+ namingConvention: outputOptions.namingConvention || import_core7.NamingConvention.CAMEL_CASE,
4114
3614
  fileExtension: outputOptions.fileExtension || defaultFileExtension,
4115
3615
  workspace: outputOptions.workspace ? outputWorkspace : void 0,
4116
3616
  client: (_g = (_f = outputOptions.client) != null ? _f : client) != null ? _g : import_core7.OutputClient.AXIOS_FUNCTIONS,
@@ -4315,7 +3815,7 @@ var normalizePath = (path, workspace) => {
4315
3815
  }
4316
3816
  return import_core7.upath.resolve(workspace, path);
4317
3817
  };
4318
- var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
3818
+ var normalizeOperationsAndTags = (operationsOrTags, workspace, global) => {
4319
3819
  return Object.fromEntries(
4320
3820
  Object.entries(operationsOrTags).map(
4321
3821
  ([
@@ -4337,7 +3837,7 @@ var normalizeOperationsAndTags = (operationsOrTags, workspace, global2) => {
4337
3837
  {
4338
3838
  ...rest,
4339
3839
  ...query2 ? {
4340
- query: normalizeQueryOptions(query2, workspace, global2.query)
3840
+ query: normalizeQueryOptions(query2, workspace, global.query)
4341
3841
  } : {},
4342
3842
  ...zod2 ? {
4343
3843
  zod: {
@@ -4455,10 +3955,12 @@ var normalizeHooks = (hooks) => {
4455
3955
  }, {});
4456
3956
  };
4457
3957
  var normalizeHonoOptions = (hono2 = {}, workspace) => {
4458
- var _a;
3958
+ var _a, _b;
4459
3959
  return {
4460
3960
  ...hono2.handlers ? { handlers: import_core7.upath.resolve(workspace, hono2.handlers) } : {},
4461
- validator: (_a = hono2.validator) != null ? _a : true
3961
+ compositeRoute: (_a = hono2.compositeRoute) != null ? _a : "",
3962
+ validator: (_b = hono2.validator) != null ? _b : true,
3963
+ validatorOutputPath: hono2.validatorOutputPath ? import_core7.upath.resolve(workspace, hono2.validatorOutputPath) : ""
4462
3964
  };
4463
3965
  };
4464
3966
  var normalizeQueryOptions = (queryOptions = {}, outputWorkspace, globalOptions = {}) => {
@@ -4565,8 +4067,7 @@ var import_core10 = require("@orval/core");
4565
4067
  var import_chalk4 = __toESM(require("chalk"));
4566
4068
  var import_execa2 = __toESM(require("execa"));
4567
4069
  var import_fs_extra5 = __toESM(require("fs-extra"));
4568
- var import_lodash2 = __toESM(require("lodash.uniq"));
4569
- var import_typedoc = require("typedoc");
4070
+ var import_lodash = __toESM(require("lodash.uniq"));
4570
4071
 
4571
4072
  // src/utils/executeHook.ts
4572
4073
  var import_core9 = require("@orval/core");
@@ -4613,7 +4114,7 @@ var getHeader = (option, info) => {
4613
4114
  return Array.isArray(header) ? (0, import_core10.jsDoc)({ description: header }) : header;
4614
4115
  };
4615
4116
  var writeSpecs = async (builder, workspace, options, projectName) => {
4616
- var _a;
4117
+ var _a, _b;
4617
4118
  const { info = { title: "", version: 0 }, schemas, target } = builder;
4618
4119
  const { output } = options;
4619
4120
  const projectTitle = projectName || info.title;
@@ -4637,6 +4138,7 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
4637
4138
  schemaPath,
4638
4139
  schemas: schemas2,
4639
4140
  target,
4141
+ namingConvention: output.namingConvention,
4640
4142
  fileExtension,
4641
4143
  specsName,
4642
4144
  specKey,
@@ -4681,12 +4183,13 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
4681
4183
  const importsNotDeclared = imports.filter((imp) => !data.includes(imp));
4682
4184
  await import_fs_extra5.default.appendFile(
4683
4185
  indexFile,
4684
- (0, import_lodash2.default)(importsNotDeclared).map((imp) => `export * from '${imp}';`).join("\n") + "\n"
4186
+ (0, import_lodash.default)(importsNotDeclared).map((imp) => `export * from '${imp}';
4187
+ `).join("")
4685
4188
  );
4686
4189
  } else {
4687
4190
  await import_fs_extra5.default.outputFile(
4688
4191
  indexFile,
4689
- (0, import_lodash2.default)(imports).map((imp) => `export * from '${imp}';`).join("\n") + "\n"
4192
+ (0, import_lodash.default)(imports).map((imp) => `export * from '${imp}';`).join("\n") + "\n"
4690
4193
  );
4691
4194
  }
4692
4195
  implementationPaths = [indexFile, ...implementationPaths];
@@ -4743,11 +4246,17 @@ var writeSpecs = async (builder, workspace, options, projectName) => {
4743
4246
  config.options = configPath;
4744
4247
  }
4745
4248
  }
4746
- const app = await import_typedoc.Application.bootstrapWithPlugins({
4249
+ const getTypedocApplication = async () => {
4250
+ const { Application: Application2 } = await Promise.resolve().then(() => __toESM(require("typedoc")));
4251
+ return Application2;
4252
+ };
4253
+ const Application = await getTypedocApplication();
4254
+ const app = await Application.bootstrapWithPlugins({
4747
4255
  entryPoints: paths,
4256
+ theme: "markdown",
4748
4257
  // Set the custom config location if it has been provided.
4749
4258
  ...config,
4750
- plugin: ["typedoc-plugin-markdown"]
4259
+ plugin: ["typedoc-plugin-markdown", ...(_b = config.plugin) != null ? _b : []]
4751
4260
  });
4752
4261
  if (!app.options.isSet("readme")) {
4753
4262
  app.options.setValue("readme", "none");
@@ -4872,6 +4381,7 @@ var generateConfig = async (configFile, options) => {
4872
4381
  };
4873
4382
 
4874
4383
  // src/index.ts
4384
+ __reExport(src_exports, require("@orval/core"), module.exports);
4875
4385
  var generate = async (optionsExport, workspace = process.cwd(), options) => {
4876
4386
  if (!optionsExport || (0, import_core12.isString)(optionsExport)) {
4877
4387
  return generateConfig(optionsExport, options);
@@ -4906,7 +4416,8 @@ var src_default = generate;
4906
4416
  0 && (module.exports = {
4907
4417
  Options,
4908
4418
  defineConfig,
4909
- generate
4419
+ generate,
4420
+ ...require("@orval/core")
4910
4421
  });
4911
4422
  /*! Bundled license information:
4912
4423