@orval/core 7.5.0 → 7.7.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.d.ts +23 -7
- package/dist/index.js +353 -245
- package/dist/index.js.map +1 -1
- package/package.json +5 -9
package/dist/index.js
CHANGED
|
@@ -1745,7 +1745,7 @@ var require_lodash = __commonJS({
|
|
|
1745
1745
|
function baseAt(object, paths) {
|
|
1746
1746
|
var index3 = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
1747
1747
|
while (++index3 < length) {
|
|
1748
|
-
result2[index3] = skip ? undefined2 :
|
|
1748
|
+
result2[index3] = skip ? undefined2 : get(object, paths[index3]);
|
|
1749
1749
|
}
|
|
1750
1750
|
return result2;
|
|
1751
1751
|
}
|
|
@@ -2190,7 +2190,7 @@ var require_lodash = __commonJS({
|
|
|
2190
2190
|
return matchesStrictComparable(toKey(path2), srcValue);
|
|
2191
2191
|
}
|
|
2192
2192
|
return function(object) {
|
|
2193
|
-
var objValue =
|
|
2193
|
+
var objValue = get(object, path2);
|
|
2194
2194
|
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
2195
2195
|
};
|
|
2196
2196
|
}
|
|
@@ -4945,7 +4945,7 @@ var require_lodash = __commonJS({
|
|
|
4945
4945
|
function functionsIn(object) {
|
|
4946
4946
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
4947
4947
|
}
|
|
4948
|
-
function
|
|
4948
|
+
function get(object, path2, defaultValue) {
|
|
4949
4949
|
var result2 = object == null ? undefined2 : baseGet(object, path2);
|
|
4950
4950
|
return result2 === undefined2 ? defaultValue : result2;
|
|
4951
4951
|
}
|
|
@@ -5000,7 +5000,7 @@ var require_lodash = __commonJS({
|
|
|
5000
5000
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
5001
5001
|
baseMerge(object, source, srcIndex, customizer);
|
|
5002
5002
|
});
|
|
5003
|
-
var
|
|
5003
|
+
var omit = flatRest(function(object, paths) {
|
|
5004
5004
|
var result2 = {};
|
|
5005
5005
|
if (object == null) {
|
|
5006
5006
|
return result2;
|
|
@@ -5691,7 +5691,7 @@ var require_lodash = __commonJS({
|
|
|
5691
5691
|
lodash.mixin = mixin;
|
|
5692
5692
|
lodash.negate = negate;
|
|
5693
5693
|
lodash.nthArg = nthArg;
|
|
5694
|
-
lodash.omit =
|
|
5694
|
+
lodash.omit = omit;
|
|
5695
5695
|
lodash.omitBy = omitBy;
|
|
5696
5696
|
lodash.once = once;
|
|
5697
5697
|
lodash.orderBy = orderBy;
|
|
@@ -5803,7 +5803,7 @@ var require_lodash = __commonJS({
|
|
|
5803
5803
|
lodash.forInRight = forInRight;
|
|
5804
5804
|
lodash.forOwn = forOwn;
|
|
5805
5805
|
lodash.forOwnRight = forOwnRight;
|
|
5806
|
-
lodash.get =
|
|
5806
|
+
lodash.get = get;
|
|
5807
5807
|
lodash.gt = gt;
|
|
5808
5808
|
lodash.gte = gte;
|
|
5809
5809
|
lodash.has = has;
|
|
@@ -8193,7 +8193,7 @@ function je(e3) {
|
|
|
8193
8193
|
return e3.includes(".") ? `["${e3.replace(/"/g, '\\"')}"]` : e3;
|
|
8194
8194
|
}
|
|
8195
8195
|
function Ee(e3, t3) {
|
|
8196
|
-
if ("string" == typeof e3 && "string" == typeof t3) return (0,
|
|
8196
|
+
if ("string" == typeof e3 && "string" == typeof t3) return (0, import_lodash.trimStart)(e3, t3);
|
|
8197
8197
|
if (!(e3 && Array.isArray(e3) && e3.length && t3 && Array.isArray(t3) && t3.length)) return e3;
|
|
8198
8198
|
let r3 = 0;
|
|
8199
8199
|
for (const n3 in e3) if (e3.hasOwnProperty(n3)) {
|
|
@@ -8202,11 +8202,11 @@ function Ee(e3, t3) {
|
|
|
8202
8202
|
}
|
|
8203
8203
|
return e3.slice(r3);
|
|
8204
8204
|
}
|
|
8205
|
-
var
|
|
8205
|
+
var import_lodash, import_safe_stable_stringify, A, $, S, E, x2, _, N, P, I, R, U, K, J, C, D, M, V, Z, q, G, H, Q, X, Y, ee, te, re, oe, ie, ce, le, de, me, ve, be, we, Ae, $e, Se;
|
|
8206
8206
|
var init_index_es2 = __esm({
|
|
8207
8207
|
"../../node_modules/@stoplight/json/index.es.js"() {
|
|
8208
8208
|
"use strict";
|
|
8209
|
-
|
|
8209
|
+
import_lodash = __toESM(require_lodash());
|
|
8210
8210
|
init_index_es();
|
|
8211
8211
|
init_main();
|
|
8212
8212
|
init_src();
|
|
@@ -8277,12 +8277,12 @@ var init_index_es2 = __esm({
|
|
|
8277
8277
|
q = "#/__errors__";
|
|
8278
8278
|
G = ({ document: t3, path: r3, bundleRoot: n3 = "#/__bundled__", errorsRoot: o3 = "#/__errors__", cloneDocument: i3 = true, keyProvider: a3 }, s2) => {
|
|
8279
8279
|
if (r3 === n3 || r3 === o3) throw new Error("Roots do not make any sense");
|
|
8280
|
-
const c2 = i3 ? (0,
|
|
8280
|
+
const c2 = i3 ? (0, import_lodash.cloneDeep)(t3) : t3;
|
|
8281
8281
|
return H(c2, K(n3), K(o3), r3, a3)(r3, { [r3]: true }, s2);
|
|
8282
8282
|
};
|
|
8283
8283
|
H = (e3, a3, s2, c2, u2) => {
|
|
8284
8284
|
const l2 = /* @__PURE__ */ new Set(), f2 = (p2, h2, y, g2 = {}, d2 = {}, m2 = {}) => {
|
|
8285
|
-
const v2 = K(p2), b3 = (0,
|
|
8285
|
+
const v2 = K(p2), b3 = (0, import_lodash.get)(e3, v2);
|
|
8286
8286
|
D(y || b3, { onEnter: ({ value: s3 }) => {
|
|
8287
8287
|
if ($(s3) && S(s3.$ref)) {
|
|
8288
8288
|
const y2 = s3.$ref;
|
|
@@ -8293,7 +8293,7 @@ var init_index_es2 = __esm({
|
|
|
8293
8293
|
let r3;
|
|
8294
8294
|
v3 = K(y2), u2 && (r3 = u2({ document: e3, path: v3 })), r3 || (r3 = (({ document: e4, path: r4 }) => {
|
|
8295
8295
|
if (0 === r4.length) return "root";
|
|
8296
|
-
if (Array.isArray((0,
|
|
8296
|
+
if (Array.isArray((0, import_lodash.get)(e4, r4.slice(0, -1)))) return `${r4[r4.length - 2]}_${r4[r4.length - 1]}`;
|
|
8297
8297
|
return String(r4[r4.length - 1]);
|
|
8298
8298
|
})({ document: e3, path: v3 })), w3 = r3;
|
|
8299
8299
|
let n3 = 1;
|
|
@@ -8303,18 +8303,18 @@ var init_index_es2 = __esm({
|
|
|
8303
8303
|
m2[y2] = e4 instanceof Error ? e4.message : String(e4);
|
|
8304
8304
|
}
|
|
8305
8305
|
if (!v3 || !b4 || !O2) return;
|
|
8306
|
-
if ("object" == typeof e3 && null !== e3 && !(j2 = (0,
|
|
8306
|
+
if ("object" == typeof e3 && null !== e3 && !(j2 = (0, import_lodash.get)(e3, v3))) try {
|
|
8307
8307
|
j2 = B(Object(e3), y2);
|
|
8308
8308
|
} catch (e4) {
|
|
8309
8309
|
}
|
|
8310
|
-
void 0 !== j2 && (g2[y2] = O2, s3.$ref = O2, (0,
|
|
8311
|
-
const a4 = n3.map((e5) => `[${JSON.stringify(e5)}]`).join(""), s4 = JSON.parse(JSON.stringify((0,
|
|
8312
|
-
(0,
|
|
8310
|
+
void 0 !== j2 && (g2[y2] = O2, s3.$ref = O2, (0, import_lodash.has)(d2, b4) || (Array.isArray(j2) ? (0, import_lodash.set)(d2, b4, new Array(j2.length).fill(null)) : "object" == typeof j2 && (0, import_lodash.setWith)(d2, b4, {}, Object), (0, import_lodash.set)(d2, b4, j2), "#" === y2 ? function(e4, t3, n3, o3) {
|
|
8311
|
+
const a4 = n3.map((e5) => `[${JSON.stringify(e5)}]`).join(""), s4 = JSON.parse(JSON.stringify((0, import_lodash.omit)(Object(e4), a4))), c3 = {};
|
|
8312
|
+
(0, import_lodash.set)(t3, o3, s4), (0, import_lodash.set)(s4, n3, c3), F(s4, "#", P(o3)), c3.$ref = "#";
|
|
8313
8313
|
}(e3, d2, K(c2), b4) : h2[y2] || (h2[y2] = true, f2(p2, h2, j2, g2, d2, m2), h2[y2] = false)));
|
|
8314
8314
|
}
|
|
8315
8315
|
} });
|
|
8316
|
-
const w2 = (0,
|
|
8317
|
-
return w2 && Object.keys(w2).length && (0,
|
|
8316
|
+
const w2 = (0, import_lodash.get)(d2, a3);
|
|
8317
|
+
return w2 && Object.keys(w2).length && (0, import_lodash.set)(b3, a3, w2), (Object.keys(m2).length || (0, import_lodash.has)(e3, s2)) && (0, import_lodash.set)(b3, s2, (0, import_lodash.has)(e3, s2) ? (0, import_lodash.get)(e3, s2) : m2), b3;
|
|
8318
8318
|
};
|
|
8319
8319
|
return f2;
|
|
8320
8320
|
};
|
|
@@ -24054,7 +24054,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24054
24054
|
function has(thing, prop) {
|
|
24055
24055
|
return getArchtype(thing) === 2 ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);
|
|
24056
24056
|
}
|
|
24057
|
-
function
|
|
24057
|
+
function get(thing, prop) {
|
|
24058
24058
|
return getArchtype(thing) === 2 ? thing.get(prop) : thing[prop];
|
|
24059
24059
|
}
|
|
24060
24060
|
function set(thing, propOrOldValue, value) {
|
|
@@ -24309,7 +24309,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24309
24309
|
return proxy;
|
|
24310
24310
|
}
|
|
24311
24311
|
var objectTraps = {
|
|
24312
|
-
get: function
|
|
24312
|
+
get: function get2(state, prop) {
|
|
24313
24313
|
if (prop === DRAFT_STATE) return state;
|
|
24314
24314
|
var source = latest(state);
|
|
24315
24315
|
if (!has(source, prop)) {
|
|
@@ -24606,7 +24606,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24606
24606
|
copy = copyHelper(value, archType);
|
|
24607
24607
|
}
|
|
24608
24608
|
each(copy, function(key, childValue) {
|
|
24609
|
-
if (state &&
|
|
24609
|
+
if (state && get(state.base_, key) === childValue) return;
|
|
24610
24610
|
set(copy, key, currentImpl(childValue));
|
|
24611
24611
|
});
|
|
24612
24612
|
return archType === 3 ? new Set(copy) : copy;
|
|
@@ -24683,7 +24683,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24683
24683
|
descriptors[prop] = desc = {
|
|
24684
24684
|
configurable: true,
|
|
24685
24685
|
enumerable,
|
|
24686
|
-
get: function
|
|
24686
|
+
get: function get2() {
|
|
24687
24687
|
var state = this[DRAFT_STATE];
|
|
24688
24688
|
assertUnrevoked(state);
|
|
24689
24689
|
return objectTraps.get(state, prop);
|
|
@@ -24864,8 +24864,8 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24864
24864
|
function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {
|
|
24865
24865
|
var base_ = state.base_, copy_ = state.copy_;
|
|
24866
24866
|
each(state.assigned_, function(key, assignedValue) {
|
|
24867
|
-
var origValue =
|
|
24868
|
-
var value =
|
|
24867
|
+
var origValue = get(base_, key);
|
|
24868
|
+
var value = get(copy_, key);
|
|
24869
24869
|
var op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;
|
|
24870
24870
|
if (origValue === value && op === REPLACE) return;
|
|
24871
24871
|
var path2 = basePath.concat(key);
|
|
@@ -24952,7 +24952,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
24952
24952
|
}
|
|
24953
24953
|
if ((parentType === 0 || parentType === 1) && (p2 === "__proto__" || p2 === "constructor")) die(24);
|
|
24954
24954
|
if (typeof base2 === "function" && p2 === "prototype") die(24);
|
|
24955
|
-
base2 =
|
|
24955
|
+
base2 = get(base2, p2);
|
|
24956
24956
|
if (typeof base2 !== "object") die(15, path2.join("/"));
|
|
24957
24957
|
}
|
|
24958
24958
|
var type = getArchtype(base2);
|
|
@@ -25063,7 +25063,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
25063
25063
|
}
|
|
25064
25064
|
var p2 = DraftMap2.prototype;
|
|
25065
25065
|
Object.defineProperty(p2, "size", {
|
|
25066
|
-
get: function
|
|
25066
|
+
get: function get2() {
|
|
25067
25067
|
return latest(this[DRAFT_STATE]).size;
|
|
25068
25068
|
}
|
|
25069
25069
|
// enumerable: false,
|
|
@@ -25202,7 +25202,7 @@ var require_immer_cjs_development = __commonJS({
|
|
|
25202
25202
|
}
|
|
25203
25203
|
var p2 = DraftSet2.prototype;
|
|
25204
25204
|
Object.defineProperty(p2, "size", {
|
|
25205
|
-
get: function
|
|
25205
|
+
get: function get2() {
|
|
25206
25206
|
return latest(this[DRAFT_STATE]).size;
|
|
25207
25207
|
}
|
|
25208
25208
|
// enumerable: true,
|
|
@@ -25358,6 +25358,15 @@ var require_dist4 = __commonJS({
|
|
|
25358
25358
|
}
|
|
25359
25359
|
});
|
|
25360
25360
|
|
|
25361
|
+
// ../../node_modules/lodash/isArray.js
|
|
25362
|
+
var require_isArray = __commonJS({
|
|
25363
|
+
"../../node_modules/lodash/isArray.js"(exports2, module2) {
|
|
25364
|
+
"use strict";
|
|
25365
|
+
var isArray = Array.isArray;
|
|
25366
|
+
module2.exports = isArray;
|
|
25367
|
+
}
|
|
25368
|
+
});
|
|
25369
|
+
|
|
25361
25370
|
// ../../node_modules/lodash/_freeGlobal.js
|
|
25362
25371
|
var require_freeGlobal = __commonJS({
|
|
25363
25372
|
"../../node_modules/lodash/_freeGlobal.js"(exports2, module2) {
|
|
@@ -25451,6 +25460,53 @@ var require_baseGetTag = __commonJS({
|
|
|
25451
25460
|
}
|
|
25452
25461
|
});
|
|
25453
25462
|
|
|
25463
|
+
// ../../node_modules/lodash/isObjectLike.js
|
|
25464
|
+
var require_isObjectLike = __commonJS({
|
|
25465
|
+
"../../node_modules/lodash/isObjectLike.js"(exports2, module2) {
|
|
25466
|
+
"use strict";
|
|
25467
|
+
function isObjectLike(value) {
|
|
25468
|
+
return value != null && typeof value == "object";
|
|
25469
|
+
}
|
|
25470
|
+
module2.exports = isObjectLike;
|
|
25471
|
+
}
|
|
25472
|
+
});
|
|
25473
|
+
|
|
25474
|
+
// ../../node_modules/lodash/isSymbol.js
|
|
25475
|
+
var require_isSymbol = __commonJS({
|
|
25476
|
+
"../../node_modules/lodash/isSymbol.js"(exports2, module2) {
|
|
25477
|
+
"use strict";
|
|
25478
|
+
var baseGetTag = require_baseGetTag();
|
|
25479
|
+
var isObjectLike = require_isObjectLike();
|
|
25480
|
+
var symbolTag = "[object Symbol]";
|
|
25481
|
+
function isSymbol(value) {
|
|
25482
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
25483
|
+
}
|
|
25484
|
+
module2.exports = isSymbol;
|
|
25485
|
+
}
|
|
25486
|
+
});
|
|
25487
|
+
|
|
25488
|
+
// ../../node_modules/lodash/_isKey.js
|
|
25489
|
+
var require_isKey = __commonJS({
|
|
25490
|
+
"../../node_modules/lodash/_isKey.js"(exports2, module2) {
|
|
25491
|
+
"use strict";
|
|
25492
|
+
var isArray = require_isArray();
|
|
25493
|
+
var isSymbol = require_isSymbol();
|
|
25494
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
25495
|
+
var reIsPlainProp = /^\w*$/;
|
|
25496
|
+
function isKey(value, object) {
|
|
25497
|
+
if (isArray(value)) {
|
|
25498
|
+
return false;
|
|
25499
|
+
}
|
|
25500
|
+
var type = typeof value;
|
|
25501
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
25502
|
+
return true;
|
|
25503
|
+
}
|
|
25504
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
25505
|
+
}
|
|
25506
|
+
module2.exports = isKey;
|
|
25507
|
+
}
|
|
25508
|
+
});
|
|
25509
|
+
|
|
25454
25510
|
// ../../node_modules/lodash/isObject.js
|
|
25455
25511
|
var require_isObject = __commonJS({
|
|
25456
25512
|
"../../node_modules/lodash/isObject.js"(exports2, module2) {
|
|
@@ -25586,129 +25642,6 @@ var require_getNative = __commonJS({
|
|
|
25586
25642
|
}
|
|
25587
25643
|
});
|
|
25588
25644
|
|
|
25589
|
-
// ../../node_modules/lodash/_defineProperty.js
|
|
25590
|
-
var require_defineProperty = __commonJS({
|
|
25591
|
-
"../../node_modules/lodash/_defineProperty.js"(exports2, module2) {
|
|
25592
|
-
"use strict";
|
|
25593
|
-
var getNative = require_getNative();
|
|
25594
|
-
var defineProperty = function() {
|
|
25595
|
-
try {
|
|
25596
|
-
var func = getNative(Object, "defineProperty");
|
|
25597
|
-
func({}, "", {});
|
|
25598
|
-
return func;
|
|
25599
|
-
} catch (e3) {
|
|
25600
|
-
}
|
|
25601
|
-
}();
|
|
25602
|
-
module2.exports = defineProperty;
|
|
25603
|
-
}
|
|
25604
|
-
});
|
|
25605
|
-
|
|
25606
|
-
// ../../node_modules/lodash/_baseAssignValue.js
|
|
25607
|
-
var require_baseAssignValue = __commonJS({
|
|
25608
|
-
"../../node_modules/lodash/_baseAssignValue.js"(exports2, module2) {
|
|
25609
|
-
"use strict";
|
|
25610
|
-
var defineProperty = require_defineProperty();
|
|
25611
|
-
function baseAssignValue(object, key, value) {
|
|
25612
|
-
if (key == "__proto__" && defineProperty) {
|
|
25613
|
-
defineProperty(object, key, {
|
|
25614
|
-
"configurable": true,
|
|
25615
|
-
"enumerable": true,
|
|
25616
|
-
"value": value,
|
|
25617
|
-
"writable": true
|
|
25618
|
-
});
|
|
25619
|
-
} else {
|
|
25620
|
-
object[key] = value;
|
|
25621
|
-
}
|
|
25622
|
-
}
|
|
25623
|
-
module2.exports = baseAssignValue;
|
|
25624
|
-
}
|
|
25625
|
-
});
|
|
25626
|
-
|
|
25627
|
-
// ../../node_modules/lodash/eq.js
|
|
25628
|
-
var require_eq = __commonJS({
|
|
25629
|
-
"../../node_modules/lodash/eq.js"(exports2, module2) {
|
|
25630
|
-
"use strict";
|
|
25631
|
-
function eq(value, other) {
|
|
25632
|
-
return value === other || value !== value && other !== other;
|
|
25633
|
-
}
|
|
25634
|
-
module2.exports = eq;
|
|
25635
|
-
}
|
|
25636
|
-
});
|
|
25637
|
-
|
|
25638
|
-
// ../../node_modules/lodash/_assignValue.js
|
|
25639
|
-
var require_assignValue = __commonJS({
|
|
25640
|
-
"../../node_modules/lodash/_assignValue.js"(exports2, module2) {
|
|
25641
|
-
"use strict";
|
|
25642
|
-
var baseAssignValue = require_baseAssignValue();
|
|
25643
|
-
var eq = require_eq();
|
|
25644
|
-
var objectProto = Object.prototype;
|
|
25645
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
25646
|
-
function assignValue(object, key, value) {
|
|
25647
|
-
var objValue = object[key];
|
|
25648
|
-
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
25649
|
-
baseAssignValue(object, key, value);
|
|
25650
|
-
}
|
|
25651
|
-
}
|
|
25652
|
-
module2.exports = assignValue;
|
|
25653
|
-
}
|
|
25654
|
-
});
|
|
25655
|
-
|
|
25656
|
-
// ../../node_modules/lodash/isArray.js
|
|
25657
|
-
var require_isArray = __commonJS({
|
|
25658
|
-
"../../node_modules/lodash/isArray.js"(exports2, module2) {
|
|
25659
|
-
"use strict";
|
|
25660
|
-
var isArray = Array.isArray;
|
|
25661
|
-
module2.exports = isArray;
|
|
25662
|
-
}
|
|
25663
|
-
});
|
|
25664
|
-
|
|
25665
|
-
// ../../node_modules/lodash/isObjectLike.js
|
|
25666
|
-
var require_isObjectLike = __commonJS({
|
|
25667
|
-
"../../node_modules/lodash/isObjectLike.js"(exports2, module2) {
|
|
25668
|
-
"use strict";
|
|
25669
|
-
function isObjectLike(value) {
|
|
25670
|
-
return value != null && typeof value == "object";
|
|
25671
|
-
}
|
|
25672
|
-
module2.exports = isObjectLike;
|
|
25673
|
-
}
|
|
25674
|
-
});
|
|
25675
|
-
|
|
25676
|
-
// ../../node_modules/lodash/isSymbol.js
|
|
25677
|
-
var require_isSymbol = __commonJS({
|
|
25678
|
-
"../../node_modules/lodash/isSymbol.js"(exports2, module2) {
|
|
25679
|
-
"use strict";
|
|
25680
|
-
var baseGetTag = require_baseGetTag();
|
|
25681
|
-
var isObjectLike = require_isObjectLike();
|
|
25682
|
-
var symbolTag = "[object Symbol]";
|
|
25683
|
-
function isSymbol(value) {
|
|
25684
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
25685
|
-
}
|
|
25686
|
-
module2.exports = isSymbol;
|
|
25687
|
-
}
|
|
25688
|
-
});
|
|
25689
|
-
|
|
25690
|
-
// ../../node_modules/lodash/_isKey.js
|
|
25691
|
-
var require_isKey = __commonJS({
|
|
25692
|
-
"../../node_modules/lodash/_isKey.js"(exports2, module2) {
|
|
25693
|
-
"use strict";
|
|
25694
|
-
var isArray = require_isArray();
|
|
25695
|
-
var isSymbol = require_isSymbol();
|
|
25696
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
25697
|
-
var reIsPlainProp = /^\w*$/;
|
|
25698
|
-
function isKey(value, object) {
|
|
25699
|
-
if (isArray(value)) {
|
|
25700
|
-
return false;
|
|
25701
|
-
}
|
|
25702
|
-
var type = typeof value;
|
|
25703
|
-
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
25704
|
-
return true;
|
|
25705
|
-
}
|
|
25706
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
25707
|
-
}
|
|
25708
|
-
module2.exports = isKey;
|
|
25709
|
-
}
|
|
25710
|
-
});
|
|
25711
|
-
|
|
25712
25645
|
// ../../node_modules/lodash/_nativeCreate.js
|
|
25713
25646
|
var require_nativeCreate = __commonJS({
|
|
25714
25647
|
"../../node_modules/lodash/_nativeCreate.js"(exports2, module2) {
|
|
@@ -25834,6 +25767,17 @@ var require_listCacheClear = __commonJS({
|
|
|
25834
25767
|
}
|
|
25835
25768
|
});
|
|
25836
25769
|
|
|
25770
|
+
// ../../node_modules/lodash/eq.js
|
|
25771
|
+
var require_eq = __commonJS({
|
|
25772
|
+
"../../node_modules/lodash/eq.js"(exports2, module2) {
|
|
25773
|
+
"use strict";
|
|
25774
|
+
function eq(value, other) {
|
|
25775
|
+
return value === other || value !== value && other !== other;
|
|
25776
|
+
}
|
|
25777
|
+
module2.exports = eq;
|
|
25778
|
+
}
|
|
25779
|
+
});
|
|
25780
|
+
|
|
25837
25781
|
// ../../node_modules/lodash/_assocIndexOf.js
|
|
25838
25782
|
var require_assocIndexOf = __commonJS({
|
|
25839
25783
|
"../../node_modules/lodash/_assocIndexOf.js"(exports2, module2) {
|
|
@@ -26222,21 +26166,6 @@ var require_castPath = __commonJS({
|
|
|
26222
26166
|
}
|
|
26223
26167
|
});
|
|
26224
26168
|
|
|
26225
|
-
// ../../node_modules/lodash/_isIndex.js
|
|
26226
|
-
var require_isIndex = __commonJS({
|
|
26227
|
-
"../../node_modules/lodash/_isIndex.js"(exports2, module2) {
|
|
26228
|
-
"use strict";
|
|
26229
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
26230
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
26231
|
-
function isIndex(value, length) {
|
|
26232
|
-
var type = typeof value;
|
|
26233
|
-
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
26234
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
26235
|
-
}
|
|
26236
|
-
module2.exports = isIndex;
|
|
26237
|
-
}
|
|
26238
|
-
});
|
|
26239
|
-
|
|
26240
26169
|
// ../../node_modules/lodash/_toKey.js
|
|
26241
26170
|
var require_toKey = __commonJS({
|
|
26242
26171
|
"../../node_modules/lodash/_toKey.js"(exports2, module2) {
|
|
@@ -26254,6 +26183,108 @@ var require_toKey = __commonJS({
|
|
|
26254
26183
|
}
|
|
26255
26184
|
});
|
|
26256
26185
|
|
|
26186
|
+
// ../../node_modules/lodash/_baseGet.js
|
|
26187
|
+
var require_baseGet = __commonJS({
|
|
26188
|
+
"../../node_modules/lodash/_baseGet.js"(exports2, module2) {
|
|
26189
|
+
"use strict";
|
|
26190
|
+
var castPath = require_castPath();
|
|
26191
|
+
var toKey = require_toKey();
|
|
26192
|
+
function baseGet(object, path2) {
|
|
26193
|
+
path2 = castPath(path2, object);
|
|
26194
|
+
var index3 = 0, length = path2.length;
|
|
26195
|
+
while (object != null && index3 < length) {
|
|
26196
|
+
object = object[toKey(path2[index3++])];
|
|
26197
|
+
}
|
|
26198
|
+
return index3 && index3 == length ? object : void 0;
|
|
26199
|
+
}
|
|
26200
|
+
module2.exports = baseGet;
|
|
26201
|
+
}
|
|
26202
|
+
});
|
|
26203
|
+
|
|
26204
|
+
// ../../node_modules/lodash/get.js
|
|
26205
|
+
var require_get = __commonJS({
|
|
26206
|
+
"../../node_modules/lodash/get.js"(exports2, module2) {
|
|
26207
|
+
"use strict";
|
|
26208
|
+
var baseGet = require_baseGet();
|
|
26209
|
+
function get(object, path2, defaultValue) {
|
|
26210
|
+
var result = object == null ? void 0 : baseGet(object, path2);
|
|
26211
|
+
return result === void 0 ? defaultValue : result;
|
|
26212
|
+
}
|
|
26213
|
+
module2.exports = get;
|
|
26214
|
+
}
|
|
26215
|
+
});
|
|
26216
|
+
|
|
26217
|
+
// ../../node_modules/lodash/_defineProperty.js
|
|
26218
|
+
var require_defineProperty = __commonJS({
|
|
26219
|
+
"../../node_modules/lodash/_defineProperty.js"(exports2, module2) {
|
|
26220
|
+
"use strict";
|
|
26221
|
+
var getNative = require_getNative();
|
|
26222
|
+
var defineProperty = function() {
|
|
26223
|
+
try {
|
|
26224
|
+
var func = getNative(Object, "defineProperty");
|
|
26225
|
+
func({}, "", {});
|
|
26226
|
+
return func;
|
|
26227
|
+
} catch (e3) {
|
|
26228
|
+
}
|
|
26229
|
+
}();
|
|
26230
|
+
module2.exports = defineProperty;
|
|
26231
|
+
}
|
|
26232
|
+
});
|
|
26233
|
+
|
|
26234
|
+
// ../../node_modules/lodash/_baseAssignValue.js
|
|
26235
|
+
var require_baseAssignValue = __commonJS({
|
|
26236
|
+
"../../node_modules/lodash/_baseAssignValue.js"(exports2, module2) {
|
|
26237
|
+
"use strict";
|
|
26238
|
+
var defineProperty = require_defineProperty();
|
|
26239
|
+
function baseAssignValue(object, key, value) {
|
|
26240
|
+
if (key == "__proto__" && defineProperty) {
|
|
26241
|
+
defineProperty(object, key, {
|
|
26242
|
+
"configurable": true,
|
|
26243
|
+
"enumerable": true,
|
|
26244
|
+
"value": value,
|
|
26245
|
+
"writable": true
|
|
26246
|
+
});
|
|
26247
|
+
} else {
|
|
26248
|
+
object[key] = value;
|
|
26249
|
+
}
|
|
26250
|
+
}
|
|
26251
|
+
module2.exports = baseAssignValue;
|
|
26252
|
+
}
|
|
26253
|
+
});
|
|
26254
|
+
|
|
26255
|
+
// ../../node_modules/lodash/_assignValue.js
|
|
26256
|
+
var require_assignValue = __commonJS({
|
|
26257
|
+
"../../node_modules/lodash/_assignValue.js"(exports2, module2) {
|
|
26258
|
+
"use strict";
|
|
26259
|
+
var baseAssignValue = require_baseAssignValue();
|
|
26260
|
+
var eq = require_eq();
|
|
26261
|
+
var objectProto = Object.prototype;
|
|
26262
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
26263
|
+
function assignValue(object, key, value) {
|
|
26264
|
+
var objValue = object[key];
|
|
26265
|
+
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
26266
|
+
baseAssignValue(object, key, value);
|
|
26267
|
+
}
|
|
26268
|
+
}
|
|
26269
|
+
module2.exports = assignValue;
|
|
26270
|
+
}
|
|
26271
|
+
});
|
|
26272
|
+
|
|
26273
|
+
// ../../node_modules/lodash/_isIndex.js
|
|
26274
|
+
var require_isIndex = __commonJS({
|
|
26275
|
+
"../../node_modules/lodash/_isIndex.js"(exports2, module2) {
|
|
26276
|
+
"use strict";
|
|
26277
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
26278
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
26279
|
+
function isIndex(value, length) {
|
|
26280
|
+
var type = typeof value;
|
|
26281
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
26282
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
26283
|
+
}
|
|
26284
|
+
module2.exports = isIndex;
|
|
26285
|
+
}
|
|
26286
|
+
});
|
|
26287
|
+
|
|
26257
26288
|
// ../../node_modules/lodash/_baseSet.js
|
|
26258
26289
|
var require_baseSet = __commonJS({
|
|
26259
26290
|
"../../node_modules/lodash/_baseSet.js"(exports2, module2) {
|
|
@@ -28800,7 +28831,7 @@ var require_crawler = __commonJS({
|
|
|
28800
28831
|
exports2.ResolveCrawler = void 0;
|
|
28801
28832
|
var json_1 = (init_index_es2(), __toCommonJS(index_es_exports2));
|
|
28802
28833
|
var dependency_graph_1 = require_dep_graph();
|
|
28803
|
-
var
|
|
28834
|
+
var get = require_get();
|
|
28804
28835
|
var Utils = require_utils3();
|
|
28805
28836
|
var ResolveCrawler = class {
|
|
28806
28837
|
constructor(runner, jsonPointer, _resolved) {
|
|
@@ -28918,7 +28949,7 @@ var require_crawler = __commonJS({
|
|
|
28918
28949
|
this.pointerGraph.addDependency(parentPointer, targetPointer);
|
|
28919
28950
|
if (this.jsonPointer && (pointerStack.length < 2 || !pointerStack.includes(targetPointer))) {
|
|
28920
28951
|
pointerStack.push(targetPointer);
|
|
28921
|
-
this.computeGraph(
|
|
28952
|
+
this.computeGraph(get(this._runner.source, targetPath), targetPath, targetPointer, pointerStack);
|
|
28922
28953
|
pointerStack.pop();
|
|
28923
28954
|
}
|
|
28924
28955
|
}
|
|
@@ -29053,7 +29084,7 @@ var require_runner = __commonJS({
|
|
|
29053
29084
|
var path_1 = (init_index_es(), __toCommonJS(index_es_exports));
|
|
29054
29085
|
var dependency_graph_1 = require_dep_graph();
|
|
29055
29086
|
var immer_1 = require_dist4();
|
|
29056
|
-
var
|
|
29087
|
+
var get = require_get();
|
|
29057
29088
|
var set = require_set2();
|
|
29058
29089
|
var URI = require_URI();
|
|
29059
29090
|
var uri_1 = require_uri();
|
|
@@ -29282,7 +29313,7 @@ var require_runner = __commonJS({
|
|
|
29282
29313
|
});
|
|
29283
29314
|
return resolved;
|
|
29284
29315
|
}
|
|
29285
|
-
resolved.result =
|
|
29316
|
+
resolved.result = get(resolved.result, targetPath);
|
|
29286
29317
|
}
|
|
29287
29318
|
if (resolved.result === void 0) {
|
|
29288
29319
|
resolved.errors.push({
|
|
@@ -29341,7 +29372,7 @@ var require_runner = __commonJS({
|
|
|
29341
29372
|
if (!dependants.length)
|
|
29342
29373
|
continue;
|
|
29343
29374
|
const pointerPath = (0, json_1.pointerToPath)(pointer);
|
|
29344
|
-
const val = pointerPath.length === 0 ? (0, immer_1.original)(draft) :
|
|
29375
|
+
const val = pointerPath.length === 0 ? (0, immer_1.original)(draft) : get(draft, pointerPath);
|
|
29345
29376
|
for (const dependant of dependants) {
|
|
29346
29377
|
let isCircular;
|
|
29347
29378
|
const dependantPath = (0, json_1.pointerToPath)(dependant);
|
|
@@ -29376,7 +29407,7 @@ var require_runner = __commonJS({
|
|
|
29376
29407
|
});
|
|
29377
29408
|
}
|
|
29378
29409
|
if (targetPath) {
|
|
29379
|
-
resolved.result =
|
|
29410
|
+
resolved.result = get(this._source, targetPath);
|
|
29380
29411
|
} else {
|
|
29381
29412
|
resolved.result = this._source;
|
|
29382
29413
|
}
|
|
@@ -37826,12 +37857,12 @@ var require_baseline = __commonJS({
|
|
|
37826
37857
|
});
|
|
37827
37858
|
|
|
37828
37859
|
// ../../node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/get.js
|
|
37829
|
-
var
|
|
37860
|
+
var require_get2 = __commonJS({
|
|
37830
37861
|
"../../node_modules/nimma/dist/legacy/cjs/runtime/codegen-functions/get.js"(exports2) {
|
|
37831
37862
|
"use strict";
|
|
37832
37863
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
37833
37864
|
var isObject4 = require_is_object();
|
|
37834
|
-
function
|
|
37865
|
+
function get(input, path2) {
|
|
37835
37866
|
if (path2.length === 0 || !isObject4["default"](input)) return input;
|
|
37836
37867
|
let value = input;
|
|
37837
37868
|
for (const segment of path2.slice(0, path2.length - 1)) {
|
|
@@ -37840,7 +37871,7 @@ var require_get = __commonJS({
|
|
|
37840
37871
|
}
|
|
37841
37872
|
return value[path2[path2.length - 1]];
|
|
37842
37873
|
}
|
|
37843
|
-
exports2["default"] =
|
|
37874
|
+
exports2["default"] = get;
|
|
37844
37875
|
}
|
|
37845
37876
|
});
|
|
37846
37877
|
|
|
@@ -38269,11 +38300,11 @@ var require_runtime = __commonJS({
|
|
|
38269
38300
|
"../../node_modules/nimma/dist/legacy/cjs/runtime/index.js"(exports2) {
|
|
38270
38301
|
"use strict";
|
|
38271
38302
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
38272
|
-
var
|
|
38303
|
+
var get = require_get2();
|
|
38273
38304
|
var inBounds = require_in_bounds();
|
|
38274
38305
|
var isObject4 = require_is_object();
|
|
38275
38306
|
var scope = require_scope2();
|
|
38276
|
-
exports2.get =
|
|
38307
|
+
exports2.get = get["default"];
|
|
38277
38308
|
exports2.inBounds = inBounds["default"];
|
|
38278
38309
|
exports2.isObject = isObject4["default"];
|
|
38279
38310
|
exports2.Scope = scope["default"];
|
|
@@ -48088,6 +48119,7 @@ __export(src_exports, {
|
|
|
48088
48119
|
BODY_TYPE_NAME: () => BODY_TYPE_NAME,
|
|
48089
48120
|
GetterPropType: () => GetterPropType,
|
|
48090
48121
|
LogLevels: () => LogLevels,
|
|
48122
|
+
NamingConvention: () => NamingConvention,
|
|
48091
48123
|
OutputClient: () => OutputClient,
|
|
48092
48124
|
OutputHttpClient: () => OutputHttpClient,
|
|
48093
48125
|
OutputMockType: () => OutputMockType,
|
|
@@ -48105,6 +48137,7 @@ __export(src_exports, {
|
|
|
48105
48137
|
camel: () => camel,
|
|
48106
48138
|
combineSchemas: () => combineSchemas,
|
|
48107
48139
|
compareVersions: () => compareVersions,
|
|
48140
|
+
conventionName: () => conventionName,
|
|
48108
48141
|
count: () => count,
|
|
48109
48142
|
createDebugger: () => createDebugger,
|
|
48110
48143
|
createLogger: () => createLogger,
|
|
@@ -48218,6 +48251,12 @@ var PropertySortOrder = {
|
|
|
48218
48251
|
ALPHABETICAL: "Alphabetical",
|
|
48219
48252
|
SPECIFICATION: "Specification"
|
|
48220
48253
|
};
|
|
48254
|
+
var NamingConvention = {
|
|
48255
|
+
CAMEL_CASE: "camelCase",
|
|
48256
|
+
PASCAL_CASE: "PascalCase",
|
|
48257
|
+
SNAKE_CASE: "snake_case",
|
|
48258
|
+
KEBAB_CASE: "kebab-case"
|
|
48259
|
+
};
|
|
48221
48260
|
var OutputClient = {
|
|
48222
48261
|
ANGULAR: "angular",
|
|
48223
48262
|
AXIOS: "axios",
|
|
@@ -48297,7 +48336,7 @@ var URL_REGEX = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'
|
|
|
48297
48336
|
var TEMPLATE_TAG_REGEX = /\${(.+?)}/g;
|
|
48298
48337
|
|
|
48299
48338
|
// src/generators/component-definition.ts
|
|
48300
|
-
var
|
|
48339
|
+
var import_lodash4 = __toESM(require("lodash.isempty"));
|
|
48301
48340
|
|
|
48302
48341
|
// src/getters/enum.ts
|
|
48303
48342
|
var import_esutils2 = require("esutils");
|
|
@@ -48994,6 +49033,17 @@ var upper = (s2, fillWith, isDeapostrophe) => {
|
|
|
48994
49033
|
isDeapostrophe
|
|
48995
49034
|
);
|
|
48996
49035
|
};
|
|
49036
|
+
var conventionName = (name, convention) => {
|
|
49037
|
+
let nameConventionTransform = camel;
|
|
49038
|
+
if (convention === NamingConvention.PASCAL_CASE) {
|
|
49039
|
+
nameConventionTransform = pascal;
|
|
49040
|
+
} else if (convention === NamingConvention.SNAKE_CASE) {
|
|
49041
|
+
nameConventionTransform = snake;
|
|
49042
|
+
} else if (convention === NamingConvention.KEBAB_CASE) {
|
|
49043
|
+
nameConventionTransform = kebab;
|
|
49044
|
+
}
|
|
49045
|
+
return nameConventionTransform(name);
|
|
49046
|
+
};
|
|
48997
49047
|
|
|
48998
49048
|
// src/utils/compare-version.ts
|
|
48999
49049
|
var import_compare_versions = require("compare-versions");
|
|
@@ -49211,7 +49261,6 @@ var sortByPriority = (arr) => arr.sort((a3, b3) => {
|
|
|
49211
49261
|
|
|
49212
49262
|
// src/utils/string.ts
|
|
49213
49263
|
var import_esutils = require("esutils");
|
|
49214
|
-
var import_lodash = __toESM(require("lodash.get"));
|
|
49215
49264
|
var stringify = (data) => {
|
|
49216
49265
|
if (isUndefined(data) || isNull(data)) {
|
|
49217
49266
|
return;
|
|
@@ -49284,7 +49333,12 @@ var toObjectString = (props, path2) => {
|
|
|
49284
49333
|
if (!props.length) {
|
|
49285
49334
|
return "";
|
|
49286
49335
|
}
|
|
49287
|
-
const arrayOfString = path2 ? props.map(
|
|
49336
|
+
const arrayOfString = typeof path2 === "string" ? props.map(
|
|
49337
|
+
(prop) => path2.split(".").reduce(
|
|
49338
|
+
(obj, key) => obj && typeof obj === "object" ? obj[key] : void 0,
|
|
49339
|
+
prop
|
|
49340
|
+
)
|
|
49341
|
+
) : props;
|
|
49288
49342
|
return arrayOfString.join(",\n ") + ",";
|
|
49289
49343
|
};
|
|
49290
49344
|
var NUMBERS = {
|
|
@@ -49334,9 +49388,10 @@ var isSyntheticDefaultImportsAllow = (config) => {
|
|
|
49334
49388
|
// src/utils/validator.ts
|
|
49335
49389
|
var ibmOpenapiRuleset = require("@ibm-cloud/openapi-ruleset");
|
|
49336
49390
|
var { Spectral } = require_dist10();
|
|
49337
|
-
var ibmOpenapiValidator = async (specs) => {
|
|
49391
|
+
var ibmOpenapiValidator = async (specs, validation) => {
|
|
49392
|
+
const ruleset = typeof validation === "boolean" ? ibmOpenapiRuleset : validation;
|
|
49338
49393
|
const spectral = new Spectral();
|
|
49339
|
-
spectral.setRuleset(
|
|
49394
|
+
spectral.setRuleset(ruleset);
|
|
49340
49395
|
const results = await spectral.run(specs);
|
|
49341
49396
|
const errors2 = [];
|
|
49342
49397
|
const warnings = [];
|
|
@@ -49452,11 +49507,7 @@ var toNumberKey = (value) => {
|
|
|
49452
49507
|
return `NUMBER_${value}`;
|
|
49453
49508
|
};
|
|
49454
49509
|
|
|
49455
|
-
// src/resolvers/ref.ts
|
|
49456
|
-
var import_lodash4 = __toESM(require("lodash.get"));
|
|
49457
|
-
|
|
49458
49510
|
// src/getters/ref.ts
|
|
49459
|
-
var import_lodash3 = __toESM(require("lodash.get"));
|
|
49460
49511
|
var RefComponentSuffix = {
|
|
49461
49512
|
schemas: "",
|
|
49462
49513
|
responses: "Response",
|
|
@@ -49475,13 +49526,21 @@ var resolveUrl = (from, to) => {
|
|
|
49475
49526
|
var getRefInfo = ($ref, context) => {
|
|
49476
49527
|
const [pathname, ref] = $ref.split("#");
|
|
49477
49528
|
const refPaths = ref?.slice(1).split("/").map((part) => decodeURIComponent(part.replace(regex2, "/")));
|
|
49478
|
-
const
|
|
49529
|
+
const getOverrideSuffix = (override, paths) => {
|
|
49530
|
+
const firstLevel = override[paths[0]];
|
|
49531
|
+
if (!firstLevel) return "";
|
|
49532
|
+
const secondLevel = firstLevel[paths[1]];
|
|
49533
|
+
return secondLevel?.suffix ?? "";
|
|
49534
|
+
};
|
|
49535
|
+
const suffix = refPaths ? getOverrideSuffix(context.output.override, refPaths) : "";
|
|
49479
49536
|
const originalName = ref ? refPaths[refPaths.length - 1] : path_exports.getSchemaFileName(pathname);
|
|
49480
49537
|
if (!pathname) {
|
|
49481
49538
|
return {
|
|
49482
49539
|
name: sanitize(pascal(originalName) + suffix, {
|
|
49483
49540
|
es5keyword: true,
|
|
49484
|
-
es5IdentifierName: true
|
|
49541
|
+
es5IdentifierName: true,
|
|
49542
|
+
underscore: true,
|
|
49543
|
+
dash: true
|
|
49485
49544
|
}),
|
|
49486
49545
|
originalName,
|
|
49487
49546
|
refPaths
|
|
@@ -49491,7 +49550,9 @@ var getRefInfo = ($ref, context) => {
|
|
|
49491
49550
|
return {
|
|
49492
49551
|
name: sanitize(pascal(originalName) + suffix, {
|
|
49493
49552
|
es5keyword: true,
|
|
49494
|
-
es5IdentifierName: true
|
|
49553
|
+
es5IdentifierName: true,
|
|
49554
|
+
underscore: true,
|
|
49555
|
+
dash: true
|
|
49495
49556
|
}),
|
|
49496
49557
|
originalName,
|
|
49497
49558
|
specKey: path2,
|
|
@@ -49546,7 +49607,10 @@ var resolveRef = (schema, context, imports = []) => {
|
|
|
49546
49607
|
function getSchema(schema, context) {
|
|
49547
49608
|
const refInfo = getRefInfo(schema.$ref, context);
|
|
49548
49609
|
const { specKey, refPaths } = refInfo;
|
|
49549
|
-
let schemaByRefPaths = refPaths && (
|
|
49610
|
+
let schemaByRefPaths = refPaths && Array.isArray(refPaths) ? refPaths.reduce(
|
|
49611
|
+
(obj, key) => obj && key in obj ? obj[key] : void 0,
|
|
49612
|
+
context.specs[specKey || context.specKey]
|
|
49613
|
+
) : void 0;
|
|
49550
49614
|
if (!schemaByRefPaths) {
|
|
49551
49615
|
schemaByRefPaths = context.specs?.[specKey || context.specKey];
|
|
49552
49616
|
}
|
|
@@ -49650,15 +49714,24 @@ var resolveObjectOriginal = ({
|
|
|
49650
49714
|
});
|
|
49651
49715
|
const doc = jsDoc(resolvedValue.originalSchema ?? {});
|
|
49652
49716
|
if (propName && !resolvedValue.isEnum && resolvedValue?.type === "object" && new RegExp(/{|&|\|/).test(resolvedValue.value)) {
|
|
49717
|
+
let model = "";
|
|
49718
|
+
const isConstant = "const" in schema;
|
|
49719
|
+
const constantIsString = "type" in schema && (schema.type === "string" || Array.isArray(schema.type) && schema.type.includes("string"));
|
|
49720
|
+
if (isConstant) {
|
|
49721
|
+
model += `${doc}export const ${propName} = ${constantIsString ? `'${schema.const}'` : schema.const} as const;
|
|
49722
|
+
`;
|
|
49723
|
+
} else {
|
|
49724
|
+
model += `${doc}export type ${propName} = ${resolvedValue.value};
|
|
49725
|
+
`;
|
|
49726
|
+
}
|
|
49653
49727
|
return {
|
|
49654
49728
|
value: propName,
|
|
49655
|
-
imports: [{ name: propName }],
|
|
49729
|
+
imports: [{ name: propName, isConstant }],
|
|
49656
49730
|
schemas: [
|
|
49657
49731
|
...resolvedValue.schemas,
|
|
49658
49732
|
{
|
|
49659
49733
|
name: propName,
|
|
49660
|
-
model
|
|
49661
|
-
`,
|
|
49734
|
+
model,
|
|
49662
49735
|
imports: resolvedValue.imports
|
|
49663
49736
|
}
|
|
49664
49737
|
],
|
|
@@ -49796,7 +49869,7 @@ var getArray = ({
|
|
|
49796
49869
|
|
|
49797
49870
|
// src/getters/res-req-types.ts
|
|
49798
49871
|
var import_esutils3 = require("esutils");
|
|
49799
|
-
var
|
|
49872
|
+
var import_lodash2 = __toESM(require("lodash.uniqby"));
|
|
49800
49873
|
var formDataContentTypes = ["multipart/form-data"];
|
|
49801
49874
|
var formUrlEncodedContentTypes = ["application/x-www-form-urlencoded"];
|
|
49802
49875
|
var getResReqContentTypes = ({
|
|
@@ -49962,7 +50035,7 @@ var getResReqTypes = (responsesOrRequests, name, context, defaultType = "unknown
|
|
|
49962
50035
|
}
|
|
49963
50036
|
];
|
|
49964
50037
|
});
|
|
49965
|
-
return (0,
|
|
50038
|
+
return (0, import_lodash2.default)(
|
|
49966
50039
|
typesArray.flatMap((it) => it),
|
|
49967
50040
|
uniqueKey
|
|
49968
50041
|
);
|
|
@@ -50208,9 +50281,6 @@ var getBody = ({
|
|
|
50208
50281
|
};
|
|
50209
50282
|
};
|
|
50210
50283
|
|
|
50211
|
-
// src/getters/combine.ts
|
|
50212
|
-
var import_lodash6 = __toESM(require("lodash.omit"));
|
|
50213
|
-
|
|
50214
50284
|
// src/getters/keys.ts
|
|
50215
50285
|
var import_esutils4 = require("esutils");
|
|
50216
50286
|
var getKey = (key) => {
|
|
@@ -50540,7 +50610,7 @@ var getScalar = ({
|
|
|
50540
50610
|
};
|
|
50541
50611
|
|
|
50542
50612
|
// src/getters/combine.ts
|
|
50543
|
-
var
|
|
50613
|
+
var import_lodash3 = __toESM(require("lodash.uniq"));
|
|
50544
50614
|
var combineValues = ({
|
|
50545
50615
|
resolvedData,
|
|
50546
50616
|
resolvedValue,
|
|
@@ -50553,8 +50623,13 @@ var combineValues = ({
|
|
|
50553
50623
|
}
|
|
50554
50624
|
if (separator2 === "allOf") {
|
|
50555
50625
|
const joined = `${resolvedData.values.join(` & `)}${resolvedValue ? ` & ${resolvedValue.value}` : ""}`;
|
|
50556
|
-
|
|
50557
|
-
|
|
50626
|
+
const overrideRequiredProperties = resolvedData.requiredProperties.filter(
|
|
50627
|
+
(prop) => !resolvedData.originalSchema.some(
|
|
50628
|
+
(schema) => schema && schema.properties?.[prop] && schema.required?.includes(prop)
|
|
50629
|
+
)
|
|
50630
|
+
);
|
|
50631
|
+
if (overrideRequiredProperties.length) {
|
|
50632
|
+
return `${joined} & Required<Pick<${joined}, '${overrideRequiredProperties.join("' | '")}'>>`;
|
|
50558
50633
|
}
|
|
50559
50634
|
return joined;
|
|
50560
50635
|
}
|
|
@@ -50568,7 +50643,7 @@ var combineValues = ({
|
|
|
50568
50643
|
values.push(resolvedData.values[i3]);
|
|
50569
50644
|
continue;
|
|
50570
50645
|
}
|
|
50571
|
-
const missingProperties = (0,
|
|
50646
|
+
const missingProperties = (0, import_lodash3.default)(
|
|
50572
50647
|
resolvedData.allProperties.filter(
|
|
50573
50648
|
(p2) => !Object.keys(subSchema.properties).includes(p2)
|
|
50574
50649
|
)
|
|
@@ -50673,7 +50748,13 @@ export const ${pascal(
|
|
|
50673
50748
|
}
|
|
50674
50749
|
let resolvedValue;
|
|
50675
50750
|
if (schema.properties) {
|
|
50676
|
-
resolvedValue = getScalar({
|
|
50751
|
+
resolvedValue = getScalar({
|
|
50752
|
+
item: Object.fromEntries(
|
|
50753
|
+
Object.entries(schema).filter(([key]) => key !== separator2)
|
|
50754
|
+
),
|
|
50755
|
+
name,
|
|
50756
|
+
context
|
|
50757
|
+
});
|
|
50677
50758
|
}
|
|
50678
50759
|
const value = combineValues({
|
|
50679
50760
|
resolvedData,
|
|
@@ -51199,7 +51280,7 @@ var getRouteAsArray = (route) => route.replace(TEMPLATE_TAG_IN_PATH_REGEX, "/$1/
|
|
|
51199
51280
|
|
|
51200
51281
|
// src/generators/component-definition.ts
|
|
51201
51282
|
var generateComponentDefinition = (responses = {}, context, suffix) => {
|
|
51202
|
-
if ((0,
|
|
51283
|
+
if ((0, import_lodash4.default)(responses)) {
|
|
51203
51284
|
return [];
|
|
51204
51285
|
}
|
|
51205
51286
|
return Object.entries(responses).reduce(
|
|
@@ -51238,31 +51319,33 @@ var generateComponentDefinition = (responses = {}, context, suffix) => {
|
|
|
51238
51319
|
};
|
|
51239
51320
|
|
|
51240
51321
|
// src/generators/imports.ts
|
|
51241
|
-
var
|
|
51242
|
-
var
|
|
51322
|
+
var import_lodash5 = __toESM(require("lodash.uniq"));
|
|
51323
|
+
var import_lodash6 = __toESM(require("lodash.uniqwith"));
|
|
51243
51324
|
var generateImports = ({
|
|
51244
51325
|
imports = [],
|
|
51245
51326
|
target,
|
|
51246
51327
|
isRootKey: isRootKey2,
|
|
51247
51328
|
specsName,
|
|
51248
|
-
specKey: currentSpecKey
|
|
51329
|
+
specKey: currentSpecKey,
|
|
51330
|
+
namingConvention = NamingConvention.CAMEL_CASE
|
|
51249
51331
|
}) => {
|
|
51250
51332
|
if (!imports.length) {
|
|
51251
51333
|
return "";
|
|
51252
51334
|
}
|
|
51253
|
-
return (0,
|
|
51335
|
+
return (0, import_lodash6.default)(
|
|
51254
51336
|
imports,
|
|
51255
51337
|
(a3, b3) => a3.name === b3.name && a3.default === b3.default && a3.specKey === b3.specKey
|
|
51256
|
-
).sort().map(({ specKey, name, values, alias }) => {
|
|
51338
|
+
).sort().map(({ specKey, name, values, alias, isConstant }) => {
|
|
51257
51339
|
const isSameSpecKey = currentSpecKey === specKey;
|
|
51340
|
+
const fileName = conventionName(name, namingConvention);
|
|
51258
51341
|
if (specKey && !isSameSpecKey) {
|
|
51259
51342
|
const path2 = specKey !== target ? specsName[specKey] : "";
|
|
51260
51343
|
if (!isRootKey2 && specKey) {
|
|
51261
|
-
return `import ${!values ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from '../${path_exports.join(path2,
|
|
51344
|
+
return `import ${!values && !isConstant ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from '../${path_exports.join(path2, fileName)}';`;
|
|
51262
51345
|
}
|
|
51263
|
-
return `import ${!values ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from './${path_exports.join(path2,
|
|
51346
|
+
return `import ${!values && !isConstant ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from './${path_exports.join(path2, fileName)}';`;
|
|
51264
51347
|
}
|
|
51265
|
-
return `import ${!values ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from './${
|
|
51348
|
+
return `import ${!values && !isConstant ? "type " : ""}{ ${name}${alias ? ` as ${alias}` : ""} } from './${fileName}';`;
|
|
51266
51349
|
}).join("\n");
|
|
51267
51350
|
};
|
|
51268
51351
|
var generateMutatorImports = ({
|
|
@@ -51270,7 +51353,7 @@ var generateMutatorImports = ({
|
|
|
51270
51353
|
implementation,
|
|
51271
51354
|
oneMore
|
|
51272
51355
|
}) => {
|
|
51273
|
-
const imports = (0,
|
|
51356
|
+
const imports = (0, import_lodash6.default)(
|
|
51274
51357
|
mutators,
|
|
51275
51358
|
(a3, b3) => a3.name === b3.name && a3.default === b3.default
|
|
51276
51359
|
).reduce((acc, mutator) => {
|
|
@@ -51308,7 +51391,7 @@ var generateDependency = ({
|
|
|
51308
51391
|
(e3) => e3.default && (isAllowSyntheticDefaultImports || !e3.syntheticDefaultImport)
|
|
51309
51392
|
);
|
|
51310
51393
|
const syntheticDefaultImportDep = !isAllowSyntheticDefaultImports ? deps.find((e3) => e3.syntheticDefaultImport) : void 0;
|
|
51311
|
-
const depsString = (0,
|
|
51394
|
+
const depsString = (0, import_lodash5.default)(
|
|
51312
51395
|
deps.filter((e3) => !e3.default && !e3.syntheticDefaultImport).map(({ name, alias }) => alias ? `${name} as ${alias}` : name)
|
|
51313
51396
|
).sort().join(",\n ");
|
|
51314
51397
|
let importString = "";
|
|
@@ -51322,7 +51405,7 @@ var generateDependency = ({
|
|
|
51322
51405
|
}
|
|
51323
51406
|
importString += `import ${onlyTypes ? "type " : ""}${defaultDep ? `${defaultDep.name}${depsString ? "," : ""}` : ""}${depsString ? `{
|
|
51324
51407
|
${depsString}
|
|
51325
|
-
}` : ""} from '${dependency}${key !== "default" && specsName[key] ? `/${specsName[key]}` : ""}'
|
|
51408
|
+
}` : ""} from '${dependency}${key !== "default" && specsName[key] ? `/${specsName[key]}` : ""}';`;
|
|
51326
51409
|
return importString;
|
|
51327
51410
|
};
|
|
51328
51411
|
var addDependency = ({
|
|
@@ -51386,7 +51469,7 @@ var addDependency = ({
|
|
|
51386
51469
|
});
|
|
51387
51470
|
}
|
|
51388
51471
|
return dep;
|
|
51389
|
-
}).join("\n");
|
|
51472
|
+
}).join("\n") + "\n";
|
|
51390
51473
|
};
|
|
51391
51474
|
var getLibName = (code) => {
|
|
51392
51475
|
const splitString = code.split(" from ");
|
|
@@ -51928,7 +52011,7 @@ var generateParameterDefinition = (parameters = {}, context, suffix) => {
|
|
|
51928
52011
|
};
|
|
51929
52012
|
|
|
51930
52013
|
// src/generators/schema-definition.ts
|
|
51931
|
-
var
|
|
52014
|
+
var import_lodash7 = __toESM(require("lodash.isempty"));
|
|
51932
52015
|
|
|
51933
52016
|
// src/generators/interface.ts
|
|
51934
52017
|
var generateInterface = ({
|
|
@@ -51953,9 +52036,16 @@ var generateInterface = ({
|
|
|
51953
52036
|
}
|
|
51954
52037
|
}
|
|
51955
52038
|
if (scalar.type === "object" && !context?.output.override?.useTypeOverInterfaces) {
|
|
51956
|
-
|
|
51957
|
-
|
|
52039
|
+
if (scalar.type === "object" && schema.properties && Object.values(schema.properties).length > 0 && Object.values(schema.properties).every((item) => "const" in item)) {
|
|
52040
|
+
const mappedScalarValue = scalar.value.replaceAll(";", ",");
|
|
52041
|
+
model += `export const ${name}Value = ${mappedScalarValue} as const;
|
|
52042
|
+
export type ${name} = typeof ${name}Value;
|
|
52043
|
+
`;
|
|
52044
|
+
} else {
|
|
52045
|
+
const blankInterfaceValue = scalar.value === "unknown" ? "{}" : scalar.value;
|
|
52046
|
+
model += `export interface ${name} ${blankInterfaceValue}
|
|
51958
52047
|
`;
|
|
52048
|
+
}
|
|
51959
52049
|
} else {
|
|
51960
52050
|
model += `export type ${name} = ${scalar.value};
|
|
51961
52051
|
`;
|
|
@@ -51975,7 +52065,7 @@ var generateInterface = ({
|
|
|
51975
52065
|
|
|
51976
52066
|
// src/generators/schema-definition.ts
|
|
51977
52067
|
var generateSchemasDefinition = (schemas = {}, context, suffix, filters) => {
|
|
51978
|
-
if ((0,
|
|
52068
|
+
if ((0, import_lodash7.default)(schemas)) {
|
|
51979
52069
|
return [];
|
|
51980
52070
|
}
|
|
51981
52071
|
const transformedSchemas = resolveDiscriminators(schemas, context);
|
|
@@ -52094,11 +52184,10 @@ var generateVerbOptions = async ({
|
|
|
52094
52184
|
(acc, [tag, options]) => tags.includes(tag) ? mergeDeep(acc, options) : acc,
|
|
52095
52185
|
{}
|
|
52096
52186
|
);
|
|
52097
|
-
const override =
|
|
52098
|
-
|
|
52099
|
-
|
|
52100
|
-
|
|
52101
|
-
};
|
|
52187
|
+
const override = mergeDeep(
|
|
52188
|
+
mergeDeep(output.override, overrideTag),
|
|
52189
|
+
overrideOperation
|
|
52190
|
+
);
|
|
52102
52191
|
const overrideOperationName = overrideOperation?.operationName || output.override?.operationName;
|
|
52103
52192
|
const overriddenOperationName = overrideOperationName ? overrideOperationName(operation, route, verb) : camel(operationId);
|
|
52104
52193
|
const operationName = sanitize(overriddenOperationName, { es5keyword: true });
|
|
@@ -52255,7 +52344,8 @@ var getSchema2 = ({
|
|
|
52255
52344
|
isRootKey: isRootKey2,
|
|
52256
52345
|
specsName,
|
|
52257
52346
|
header,
|
|
52258
|
-
specKey
|
|
52347
|
+
specKey,
|
|
52348
|
+
namingConvention = NamingConvention.CAMEL_CASE
|
|
52259
52349
|
}) => {
|
|
52260
52350
|
let file = header;
|
|
52261
52351
|
file += generateImports({
|
|
@@ -52265,7 +52355,8 @@ var getSchema2 = ({
|
|
|
52265
52355
|
target,
|
|
52266
52356
|
isRootKey: isRootKey2,
|
|
52267
52357
|
specsName,
|
|
52268
|
-
specKey
|
|
52358
|
+
specKey,
|
|
52359
|
+
namingConvention
|
|
52269
52360
|
});
|
|
52270
52361
|
file += imports.length ? "\n\n" : "\n";
|
|
52271
52362
|
file += model;
|
|
@@ -52279,17 +52370,26 @@ var writeSchema = async ({
|
|
|
52279
52370
|
path: path2,
|
|
52280
52371
|
schema,
|
|
52281
52372
|
target,
|
|
52373
|
+
namingConvention,
|
|
52282
52374
|
fileExtension,
|
|
52283
52375
|
specKey,
|
|
52284
52376
|
isRootKey: isRootKey2,
|
|
52285
52377
|
specsName,
|
|
52286
52378
|
header
|
|
52287
52379
|
}) => {
|
|
52288
|
-
const name =
|
|
52380
|
+
const name = conventionName(schema.name, namingConvention);
|
|
52289
52381
|
try {
|
|
52290
52382
|
await import_fs_extra2.default.outputFile(
|
|
52291
52383
|
getPath(path2, name, fileExtension),
|
|
52292
|
-
getSchema2({
|
|
52384
|
+
getSchema2({
|
|
52385
|
+
schema,
|
|
52386
|
+
target,
|
|
52387
|
+
isRootKey: isRootKey2,
|
|
52388
|
+
specsName,
|
|
52389
|
+
header,
|
|
52390
|
+
specKey,
|
|
52391
|
+
namingConvention
|
|
52392
|
+
})
|
|
52293
52393
|
);
|
|
52294
52394
|
} catch (e3) {
|
|
52295
52395
|
throw `Oups... \u{1F37B}. An Error occurred while writing schema ${name} => ${e3}`;
|
|
@@ -52299,6 +52399,7 @@ var writeSchemas = async ({
|
|
|
52299
52399
|
schemaPath,
|
|
52300
52400
|
schemas,
|
|
52301
52401
|
target,
|
|
52402
|
+
namingConvention,
|
|
52302
52403
|
fileExtension,
|
|
52303
52404
|
specKey,
|
|
52304
52405
|
isRootKey: isRootKey2,
|
|
@@ -52312,6 +52413,7 @@ var writeSchemas = async ({
|
|
|
52312
52413
|
path: schemaPath,
|
|
52313
52414
|
schema,
|
|
52314
52415
|
target,
|
|
52416
|
+
namingConvention,
|
|
52315
52417
|
fileExtension,
|
|
52316
52418
|
specKey,
|
|
52317
52419
|
isRootKey: isRootKey2,
|
|
@@ -52331,7 +52433,7 @@ var writeSchemas = async ({
|
|
|
52331
52433
|
} else {
|
|
52332
52434
|
duplicateNamesMap.set(
|
|
52333
52435
|
schema.name,
|
|
52334
|
-
(duplicateNamesMap.get(schema.name) ||
|
|
52436
|
+
(duplicateNamesMap.get(schema.name) || 1) + 1
|
|
52335
52437
|
);
|
|
52336
52438
|
}
|
|
52337
52439
|
});
|
|
@@ -52345,12 +52447,11 @@ var writeSchemas = async ({
|
|
|
52345
52447
|
const stringData = data.toString();
|
|
52346
52448
|
const ext = fileExtension.endsWith(".ts") ? fileExtension.slice(0, -3) : fileExtension;
|
|
52347
52449
|
const importStatements = schemas.filter((schema) => {
|
|
52348
|
-
|
|
52349
|
-
|
|
52350
|
-
|
|
52351
|
-
|
|
52352
|
-
|
|
52353
|
-
}).map((schema) => `export * from './${camel(schema.name)}${ext}';`);
|
|
52450
|
+
const name = conventionName(schema.name, namingConvention);
|
|
52451
|
+
return !stringData.includes(`export * from './${name}${ext}'`) && !stringData.includes(`export * from "./${name}${ext}"`);
|
|
52452
|
+
}).map(
|
|
52453
|
+
(schema) => `export * from './${conventionName(schema.name, namingConvention)}${ext}';`
|
|
52454
|
+
);
|
|
52354
52455
|
const currentFileExports = stringData.match(/export \* from(.*)('|")/g)?.map((s2) => s2 + ";") ?? [];
|
|
52355
52456
|
const exports2 = [...currentFileExports, ...importStatements].sort().join("\n");
|
|
52356
52457
|
const fileContent = `${header}
|
|
@@ -52395,8 +52496,8 @@ type NonReadonly<T> = [T] extends [UnionToIntersection<T>] ? {
|
|
|
52395
52496
|
var import_fs_extra3 = __toESM(require("fs-extra"));
|
|
52396
52497
|
|
|
52397
52498
|
// src/writers/generate-imports-for-builder.ts
|
|
52398
|
-
var
|
|
52399
|
-
var generateImportsForBuilder = (output, imports, relativeSchemasPath) => output.schemas && !output.indexFiles ? (0,
|
|
52499
|
+
var import_lodash8 = __toESM(require("lodash.uniqby"));
|
|
52500
|
+
var generateImportsForBuilder = (output, imports, relativeSchemasPath) => output.schemas && !output.indexFiles ? (0, import_lodash8.default)(imports, "name").map((i3) => ({
|
|
52400
52501
|
exports: [i3],
|
|
52401
52502
|
dependency: path_exports.joinSafe(relativeSchemasPath, camel(i3.name))
|
|
52402
52503
|
})) : [{ exports: imports, dependency: relativeSchemasPath }];
|
|
@@ -52502,7 +52603,10 @@ var writeSingleMode = async ({
|
|
|
52502
52603
|
}) => {
|
|
52503
52604
|
try {
|
|
52504
52605
|
const { path: path2, dirname: dirname3 } = getFileInfo(output.target, {
|
|
52505
|
-
backupFilename:
|
|
52606
|
+
backupFilename: conventionName(
|
|
52607
|
+
builder.info.title,
|
|
52608
|
+
output.namingConvention
|
|
52609
|
+
),
|
|
52506
52610
|
extension: output.fileExtension
|
|
52507
52611
|
});
|
|
52508
52612
|
const {
|
|
@@ -52579,9 +52683,8 @@ var writeSingleMode = async ({
|
|
|
52579
52683
|
if (!output.schemas && needSchema) {
|
|
52580
52684
|
data += generateModelsInline(builder.schemas);
|
|
52581
52685
|
}
|
|
52582
|
-
data +=
|
|
52583
|
-
|
|
52584
|
-
${implementation}`;
|
|
52686
|
+
data += `${implementation.trim()}
|
|
52687
|
+
`;
|
|
52585
52688
|
if (output.mock) {
|
|
52586
52689
|
data += "\n\n";
|
|
52587
52690
|
data += implementationMock;
|
|
@@ -52604,7 +52707,10 @@ var writeSplitMode = async ({
|
|
|
52604
52707
|
}) => {
|
|
52605
52708
|
try {
|
|
52606
52709
|
const { filename, dirname: dirname3, extension } = getFileInfo(output.target, {
|
|
52607
|
-
backupFilename:
|
|
52710
|
+
backupFilename: conventionName(
|
|
52711
|
+
builder.info.title,
|
|
52712
|
+
output.namingConvention
|
|
52713
|
+
),
|
|
52608
52714
|
extension: output.fileExtension
|
|
52609
52715
|
});
|
|
52610
52716
|
const {
|
|
@@ -52730,7 +52836,7 @@ var addDefaultTagIfEmpty = (operation) => ({
|
|
|
52730
52836
|
...operation,
|
|
52731
52837
|
tags: operation.tags.length ? operation.tags : ["default"]
|
|
52732
52838
|
});
|
|
52733
|
-
var generateTargetTags = (currentAcc, operation
|
|
52839
|
+
var generateTargetTags = (currentAcc, operation) => {
|
|
52734
52840
|
const tag = kebab(operation.tags[0]);
|
|
52735
52841
|
const currentOperation = currentAcc[tag];
|
|
52736
52842
|
if (!currentOperation) {
|
|
@@ -52778,13 +52884,13 @@ var generateTargetForTags = (builder, options) => {
|
|
|
52778
52884
|
const isAngularClient = options.client === OutputClient.ANGULAR;
|
|
52779
52885
|
const allTargetTags = Object.values(builder.operations).map(addDefaultTagIfEmpty).reduce(
|
|
52780
52886
|
(acc, operation, index3, arr) => {
|
|
52781
|
-
const targetTags = generateTargetTags(acc, operation
|
|
52887
|
+
const targetTags = generateTargetTags(acc, operation);
|
|
52782
52888
|
if (index3 === arr.length - 1) {
|
|
52783
52889
|
return Object.entries(targetTags).reduce((acc2, [tag, target]) => {
|
|
52784
52890
|
const isMutator = !!target.mutators?.some(
|
|
52785
52891
|
(mutator) => isAngularClient ? mutator.hasThirdArg : mutator.hasSecondArg
|
|
52786
52892
|
);
|
|
52787
|
-
const operationNames = Object.values(builder.operations).filter(({ tags }) => tags.map(kebab).
|
|
52893
|
+
const operationNames = Object.values(builder.operations).filter(({ tags }) => tags.map(kebab).indexOf(kebab(tag)) === 0).map(({ operationName }) => operationName);
|
|
52788
52894
|
const typescriptVersion = options.packageJson?.dependencies?.["typescript"] ?? options.packageJson?.devDependencies?.["typescript"] ?? "4.4.0";
|
|
52789
52895
|
const hasAwaitedType = compareVersions(typescriptVersion, "4.5.0");
|
|
52790
52896
|
const titles = builder.title({
|
|
@@ -53128,6 +53234,7 @@ var writeTagsMode = async ({
|
|
|
53128
53234
|
BODY_TYPE_NAME,
|
|
53129
53235
|
GetterPropType,
|
|
53130
53236
|
LogLevels,
|
|
53237
|
+
NamingConvention,
|
|
53131
53238
|
OutputClient,
|
|
53132
53239
|
OutputHttpClient,
|
|
53133
53240
|
OutputMockType,
|
|
@@ -53145,6 +53252,7 @@ var writeTagsMode = async ({
|
|
|
53145
53252
|
camel,
|
|
53146
53253
|
combineSchemas,
|
|
53147
53254
|
compareVersions,
|
|
53255
|
+
conventionName,
|
|
53148
53256
|
count,
|
|
53149
53257
|
createDebugger,
|
|
53150
53258
|
createLogger,
|