@hey-api/shared 0.0.0-next-20260405234101 → 0.0.0-next-20260406011317
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.mjs +3 -99
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,6 @@ import * as semver from "semver";
|
|
|
7
7
|
import { getResolvedInput, sendRequest } from "@hey-api/json-schema-ref-parser";
|
|
8
8
|
import { fromRef, ref } from "@hey-api/codegen-core";
|
|
9
9
|
import { EOL } from "node:os";
|
|
10
|
-
|
|
11
10
|
//#region src/tsConfig.ts
|
|
12
11
|
function findPackageJson(initialDir) {
|
|
13
12
|
let dir = initialDir;
|
|
@@ -54,7 +53,6 @@ function findTsConfigPath(baseDir, tsConfigPath) {
|
|
|
54
53
|
}
|
|
55
54
|
return null;
|
|
56
55
|
}
|
|
57
|
-
|
|
58
56
|
//#endregion
|
|
59
57
|
//#region src/cli.ts
|
|
60
58
|
const textAscii = `
|
|
@@ -103,13 +101,11 @@ function printCliIntro(initialDir, showLogo = false) {
|
|
|
103
101
|
}
|
|
104
102
|
console.log("");
|
|
105
103
|
}
|
|
106
|
-
|
|
107
104
|
//#endregion
|
|
108
105
|
//#region src/fs.ts
|
|
109
106
|
function ensureDirSync(path) {
|
|
110
107
|
if (!fs.existsSync(path)) fs.mkdirSync(path, { recursive: true });
|
|
111
108
|
}
|
|
112
|
-
|
|
113
109
|
//#endregion
|
|
114
110
|
//#region src/error.ts
|
|
115
111
|
/**
|
|
@@ -285,7 +281,6 @@ async function shouldReportCrash({ error, isInteractive }) {
|
|
|
285
281
|
});
|
|
286
282
|
});
|
|
287
283
|
}
|
|
288
|
-
|
|
289
284
|
//#endregion
|
|
290
285
|
//#region src/config/engine.ts
|
|
291
286
|
function checkNodeVersion() {
|
|
@@ -297,7 +292,6 @@ function checkNodeVersion() {
|
|
|
297
292
|
if (major < 20) throw new ConfigError(`Unsupported Node version ${process.versions.node}. Please use Node 20 or newer.`);
|
|
298
293
|
}
|
|
299
294
|
}
|
|
300
|
-
|
|
301
295
|
//#endregion
|
|
302
296
|
//#region src/utils/input/heyApi.ts
|
|
303
297
|
const registryRegExp$2 = /^([\w-]+)\/([\w-]+)(?:\?([\w=&.-]*))?$/;
|
|
@@ -352,7 +346,6 @@ function inputToHeyApiPath(input) {
|
|
|
352
346
|
registry: "hey-api"
|
|
353
347
|
};
|
|
354
348
|
}
|
|
355
|
-
|
|
356
349
|
//#endregion
|
|
357
350
|
//#region src/utils/input/readme.ts
|
|
358
351
|
const registryRegExp$1 = /^(@([\w-]+)\/([\w\-.]+)#)?([\w-]+)$/;
|
|
@@ -398,7 +391,6 @@ function inputToReadmePath(input) {
|
|
|
398
391
|
registry: "readme"
|
|
399
392
|
};
|
|
400
393
|
}
|
|
401
|
-
|
|
402
394
|
//#endregion
|
|
403
395
|
//#region src/utils/input/scalar.ts
|
|
404
396
|
const registryRegExp = /^(@[\w-]+)\/([\w.-]+)$/;
|
|
@@ -445,7 +437,6 @@ function inputToScalarPath(input) {
|
|
|
445
437
|
registry: "scalar"
|
|
446
438
|
};
|
|
447
439
|
}
|
|
448
|
-
|
|
449
440
|
//#endregion
|
|
450
441
|
//#region src/utils/input/index.ts
|
|
451
442
|
function inputToApiRegistry(input) {
|
|
@@ -459,7 +450,7 @@ function inputToApiRegistry(input) {
|
|
|
459
450
|
}
|
|
460
451
|
if (input.path.startsWith(".")) return;
|
|
461
452
|
if (input.path.startsWith("https://get.heyapi.dev")) {
|
|
462
|
-
input.path = input.path.slice(
|
|
453
|
+
input.path = input.path.slice(23);
|
|
463
454
|
Object.assign(input, inputToHeyApiPath(input));
|
|
464
455
|
return;
|
|
465
456
|
}
|
|
@@ -469,7 +460,6 @@ function inputToApiRegistry(input) {
|
|
|
469
460
|
return;
|
|
470
461
|
}
|
|
471
462
|
}
|
|
472
|
-
|
|
473
463
|
//#endregion
|
|
474
464
|
//#region src/config/input/input.ts
|
|
475
465
|
const defaultWatch = {
|
|
@@ -519,7 +509,6 @@ function getInput(userConfig) {
|
|
|
519
509
|
}
|
|
520
510
|
return inputs;
|
|
521
511
|
}
|
|
522
|
-
|
|
523
512
|
//#endregion
|
|
524
513
|
//#region src/config/input/path.ts
|
|
525
514
|
function compileInputPath(input) {
|
|
@@ -621,7 +610,6 @@ function logInputPaths(inputPaths, jobIndex) {
|
|
|
621
610
|
});
|
|
622
611
|
for (const line of lines) console.log(line);
|
|
623
612
|
}
|
|
624
|
-
|
|
625
613
|
//#endregion
|
|
626
614
|
//#region src/config/logs.ts
|
|
627
615
|
function getLogs(userLogs) {
|
|
@@ -637,7 +625,6 @@ function getLogs(userLogs) {
|
|
|
637
625
|
};
|
|
638
626
|
return logs;
|
|
639
627
|
}
|
|
640
|
-
|
|
641
628
|
//#endregion
|
|
642
629
|
//#region src/config/output/postprocess.ts
|
|
643
630
|
function postprocessOutput(config, postProcessors, jobPrefix) {
|
|
@@ -650,7 +637,6 @@ function postprocessOutput(config, postProcessors, jobPrefix) {
|
|
|
650
637
|
sync(resolved.command, args);
|
|
651
638
|
}
|
|
652
639
|
}
|
|
653
|
-
|
|
654
640
|
//#endregion
|
|
655
641
|
//#region src/config/utils/config.ts
|
|
656
642
|
const isPlainObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value) && typeof value !== "function";
|
|
@@ -694,7 +680,6 @@ const valueToObject = ({ defaultValue, mappers, value }) => {
|
|
|
694
680
|
}
|
|
695
681
|
return result;
|
|
696
682
|
};
|
|
697
|
-
|
|
698
683
|
//#endregion
|
|
699
684
|
//#region src/config/output/source/config.ts
|
|
700
685
|
function resolveSource(config) {
|
|
@@ -712,7 +697,6 @@ function resolveSource(config) {
|
|
|
712
697
|
else if (source.path === false) source.path = null;
|
|
713
698
|
return source;
|
|
714
699
|
}
|
|
715
|
-
|
|
716
700
|
//#endregion
|
|
717
701
|
//#region src/config/parser/config.ts
|
|
718
702
|
const defaultPaginationKeywords = [
|
|
@@ -811,7 +795,6 @@ function getParser(userConfig) {
|
|
|
811
795
|
value: userConfig.parser
|
|
812
796
|
});
|
|
813
797
|
}
|
|
814
|
-
|
|
815
798
|
//#endregion
|
|
816
799
|
//#region src/config/utils/dependencies.ts
|
|
817
800
|
const satisfies = (...args) => semver.satisfies(...args);
|
|
@@ -836,7 +819,6 @@ function dependencyFactory(dependencies) {
|
|
|
836
819
|
}
|
|
837
820
|
};
|
|
838
821
|
}
|
|
839
|
-
|
|
840
822
|
//#endregion
|
|
841
823
|
//#region src/debug/graph.ts
|
|
842
824
|
const analyzeStructure = (graph) => {
|
|
@@ -873,7 +855,6 @@ const graph = {
|
|
|
873
855
|
analyzeStructure,
|
|
874
856
|
exportForVisualization
|
|
875
857
|
};
|
|
876
|
-
|
|
877
858
|
//#endregion
|
|
878
859
|
//#region src/ir/parameter.ts
|
|
879
860
|
const getPaginationSchema = ({ context, parameter }) => {
|
|
@@ -942,7 +923,6 @@ const parameterWithPagination = ({ context, parameters }) => {
|
|
|
942
923
|
};
|
|
943
924
|
}
|
|
944
925
|
};
|
|
945
|
-
|
|
946
926
|
//#endregion
|
|
947
927
|
//#region src/ir/schema.ts
|
|
948
928
|
/**
|
|
@@ -994,7 +974,6 @@ function deduplicateSchema({ detectFormat = true, schema }) {
|
|
|
994
974
|
if (result.type === "unknown") return {};
|
|
995
975
|
return result;
|
|
996
976
|
}
|
|
997
|
-
|
|
998
977
|
//#endregion
|
|
999
978
|
//#region src/ir/utils.ts
|
|
1000
979
|
/**
|
|
@@ -1022,7 +1001,6 @@ function addItemsToSchema({ items, logicalOperator = "or", mutateSchemaOneItem =
|
|
|
1022
1001
|
schema.items = items;
|
|
1023
1002
|
return schema;
|
|
1024
1003
|
}
|
|
1025
|
-
|
|
1026
1004
|
//#endregion
|
|
1027
1005
|
//#region src/ir/operation.ts
|
|
1028
1006
|
const hasOperationDataRequired = (operation) => {
|
|
@@ -1139,7 +1117,6 @@ const operationResponsesMap = (operation) => {
|
|
|
1139
1117
|
}
|
|
1140
1118
|
return result;
|
|
1141
1119
|
};
|
|
1142
|
-
|
|
1143
1120
|
//#endregion
|
|
1144
1121
|
//#region src/utils/naming/naming.ts
|
|
1145
1122
|
const uppercaseRegExp = /[\p{Lu}]/u;
|
|
@@ -1257,7 +1234,6 @@ function applyNaming(value, config) {
|
|
|
1257
1234
|
}
|
|
1258
1235
|
return toCase(result, casing);
|
|
1259
1236
|
}
|
|
1260
|
-
|
|
1261
1237
|
//#endregion
|
|
1262
1238
|
//#region src/openApi/shared/utils/operation.ts
|
|
1263
1239
|
const httpMethods = [
|
|
@@ -1315,7 +1291,6 @@ function operationToId({ context, count = 1, id, method, path, state }) {
|
|
|
1315
1291
|
}));
|
|
1316
1292
|
return result;
|
|
1317
1293
|
}
|
|
1318
|
-
|
|
1319
1294
|
//#endregion
|
|
1320
1295
|
//#region src/debug/ir.ts
|
|
1321
1296
|
const indent = (level) => " ".repeat(level);
|
|
@@ -1368,15 +1343,12 @@ const print = (ir, options = {}) => {
|
|
|
1368
1343
|
}
|
|
1369
1344
|
}
|
|
1370
1345
|
};
|
|
1371
|
-
const ir = { print };
|
|
1372
|
-
|
|
1373
1346
|
//#endregion
|
|
1374
1347
|
//#region src/debug/index.ts
|
|
1375
1348
|
const debugTools = {
|
|
1376
1349
|
graph,
|
|
1377
|
-
ir
|
|
1350
|
+
ir: { print }
|
|
1378
1351
|
};
|
|
1379
|
-
|
|
1380
1352
|
//#endregion
|
|
1381
1353
|
//#region src/getSpec.ts
|
|
1382
1354
|
const headersEntries = (headers) => {
|
|
@@ -1499,7 +1471,6 @@ async function getSpec({ fetchOptions, inputPath, timeout, watch }) {
|
|
|
1499
1471
|
resolvedInput
|
|
1500
1472
|
};
|
|
1501
1473
|
}
|
|
1502
|
-
|
|
1503
1474
|
//#endregion
|
|
1504
1475
|
//#region src/utils/minHeap.ts
|
|
1505
1476
|
var MinHeap = class {
|
|
@@ -1560,7 +1531,6 @@ var MinHeap = class {
|
|
|
1560
1531
|
}
|
|
1561
1532
|
}
|
|
1562
1533
|
};
|
|
1563
|
-
|
|
1564
1534
|
//#endregion
|
|
1565
1535
|
//#region src/graph/walk.ts
|
|
1566
1536
|
/**
|
|
@@ -1685,7 +1655,6 @@ const walk = (graph, callback, options) => {
|
|
|
1685
1655
|
if (options?.order === "topological") return walkTopological(graph, callback, options);
|
|
1686
1656
|
return walkDeclarations(graph, callback, options);
|
|
1687
1657
|
};
|
|
1688
|
-
|
|
1689
1658
|
//#endregion
|
|
1690
1659
|
//#region src/ir/graph.ts
|
|
1691
1660
|
const irTopLevelKinds = [
|
|
@@ -1748,7 +1717,6 @@ const getIrPointerPriority = (pointer) => {
|
|
|
1748
1717
|
if (result.matched) return kindPriority[result.kind] ?? defaultPriority;
|
|
1749
1718
|
return defaultPriority;
|
|
1750
1719
|
};
|
|
1751
|
-
|
|
1752
1720
|
//#endregion
|
|
1753
1721
|
//#region src/utils/ref.ts
|
|
1754
1722
|
const jsonPointerSlash = /~1/g;
|
|
@@ -1851,7 +1819,6 @@ function resolveRef({ $ref, spec }) {
|
|
|
1851
1819
|
}
|
|
1852
1820
|
return current;
|
|
1853
1821
|
}
|
|
1854
|
-
|
|
1855
1822
|
//#endregion
|
|
1856
1823
|
//#region src/plugins/shared/utils/instance.ts
|
|
1857
1824
|
const defaultGetFilePath = (symbol) => {
|
|
@@ -2182,7 +2149,6 @@ var PluginInstance = class {
|
|
|
2182
2149
|
return false;
|
|
2183
2150
|
}
|
|
2184
2151
|
};
|
|
2185
|
-
|
|
2186
2152
|
//#endregion
|
|
2187
2153
|
//#region src/ir/context.ts
|
|
2188
2154
|
var Context = class {
|
|
@@ -2293,7 +2259,6 @@ var Context = class {
|
|
|
2293
2259
|
});
|
|
2294
2260
|
}
|
|
2295
2261
|
};
|
|
2296
|
-
|
|
2297
2262
|
//#endregion
|
|
2298
2263
|
//#region src/ir/intents.ts
|
|
2299
2264
|
var IntentContext = class {
|
|
@@ -2313,7 +2278,6 @@ var IntentContext = class {
|
|
|
2313
2278
|
source["x-codeSamples"].push(example);
|
|
2314
2279
|
}
|
|
2315
2280
|
};
|
|
2316
|
-
|
|
2317
2281
|
//#endregion
|
|
2318
2282
|
//#region src/ir/schema-processor.ts
|
|
2319
2283
|
function createSchemaProcessor() {
|
|
@@ -2350,7 +2314,6 @@ function createSchemaProcessor() {
|
|
|
2350
2314
|
}
|
|
2351
2315
|
};
|
|
2352
2316
|
}
|
|
2353
|
-
|
|
2354
2317
|
//#endregion
|
|
2355
2318
|
//#region src/ir/schema-walker.ts
|
|
2356
2319
|
/**
|
|
@@ -2419,7 +2382,6 @@ function childContext(ctx, ...segments) {
|
|
|
2419
2382
|
path: ref([...fromRef(ctx.path), ...segments])
|
|
2420
2383
|
};
|
|
2421
2384
|
}
|
|
2422
|
-
|
|
2423
2385
|
//#endregion
|
|
2424
2386
|
//#region src/openApi/shared/utils/filter.ts
|
|
2425
2387
|
const namespaceNeedle = "/";
|
|
@@ -2877,7 +2839,6 @@ const createFilteredDependencies = ({ filters, logger, resourceMetadata }) => {
|
|
|
2877
2839
|
schemas
|
|
2878
2840
|
};
|
|
2879
2841
|
};
|
|
2880
|
-
|
|
2881
2842
|
//#endregion
|
|
2882
2843
|
//#region src/openApi/shared/graph/meta.ts
|
|
2883
2844
|
/**
|
|
@@ -2969,11 +2930,9 @@ const buildResourceMetadata = (graph, logger) => {
|
|
|
2969
2930
|
eventBuildResourceMetadata.timeEnd();
|
|
2970
2931
|
return { resourceMetadata };
|
|
2971
2932
|
};
|
|
2972
|
-
|
|
2973
2933
|
//#endregion
|
|
2974
2934
|
//#region src/openApi/shared/utils/schema.ts
|
|
2975
2935
|
const deepClone = (obj) => JSON.parse(JSON.stringify(obj));
|
|
2976
|
-
|
|
2977
2936
|
//#endregion
|
|
2978
2937
|
//#region src/openApi/shared/utils/schemaChildRelationships.ts
|
|
2979
2938
|
const childSchemaRelationships = [
|
|
@@ -2992,7 +2951,6 @@ const childSchemaRelationships = [
|
|
|
2992
2951
|
["then", "single"],
|
|
2993
2952
|
["unevaluatedProperties", "single"]
|
|
2994
2953
|
];
|
|
2995
|
-
|
|
2996
2954
|
//#endregion
|
|
2997
2955
|
//#region src/openApi/shared/utils/transforms.ts
|
|
2998
2956
|
const getSchemasObject = (spec) => {
|
|
@@ -3009,7 +2967,6 @@ const hasComponentsSchemasObject = (spec) => typeof spec === "object" && spec !=
|
|
|
3009
2967
|
* Returns true if present, false otherwise.
|
|
3010
2968
|
*/
|
|
3011
2969
|
const hasDefinitionsObject = (spec) => typeof spec === "object" && spec !== null && "definitions" in spec && typeof spec.definitions === "object" && spec.definitions !== null;
|
|
3012
|
-
|
|
3013
2970
|
//#endregion
|
|
3014
2971
|
//#region src/openApi/shared/transforms/utils.ts
|
|
3015
2972
|
const hasName = (obj, value) => {
|
|
@@ -3034,7 +2991,6 @@ const specToSchemasPointerNamespace = (spec) => {
|
|
|
3034
2991
|
}
|
|
3035
2992
|
return "";
|
|
3036
2993
|
};
|
|
3037
|
-
|
|
3038
2994
|
//#endregion
|
|
3039
2995
|
//#region src/openApi/shared/transforms/enums.ts
|
|
3040
2996
|
/**
|
|
@@ -3198,7 +3154,6 @@ const enumsTransform = ({ config, spec }) => {
|
|
|
3198
3154
|
return;
|
|
3199
3155
|
}
|
|
3200
3156
|
};
|
|
3201
|
-
|
|
3202
3157
|
//#endregion
|
|
3203
3158
|
//#region src/openApi/shared/transforms/propertiesRequiredByDefault.ts
|
|
3204
3159
|
/**
|
|
@@ -3258,7 +3213,6 @@ const propertiesRequiredByDefaultTransform = ({ spec }) => {
|
|
|
3258
3213
|
}
|
|
3259
3214
|
});
|
|
3260
3215
|
};
|
|
3261
|
-
|
|
3262
3216
|
//#endregion
|
|
3263
3217
|
//#region src/openApi/shared/utils/deepEqual.ts
|
|
3264
3218
|
/**
|
|
@@ -3286,7 +3240,6 @@ const deepEqual = (a, b) => {
|
|
|
3286
3240
|
for (const key of keysA) if (!deepEqual(objA[key], objB[key])) return false;
|
|
3287
3241
|
return true;
|
|
3288
3242
|
};
|
|
3289
|
-
|
|
3290
3243
|
//#endregion
|
|
3291
3244
|
//#region src/openApi/shared/utils/graph.ts
|
|
3292
3245
|
/**
|
|
@@ -3580,7 +3533,6 @@ function buildGraph(root, logger) {
|
|
|
3580
3533
|
eventBuildGraph.timeEnd();
|
|
3581
3534
|
return { graph };
|
|
3582
3535
|
}
|
|
3583
|
-
|
|
3584
3536
|
//#endregion
|
|
3585
3537
|
//#region src/openApi/shared/transforms/readWrite.ts
|
|
3586
3538
|
const schemaKeys = new Set([
|
|
@@ -4109,7 +4061,6 @@ const readWriteTransform = ({ config, logger, spec }) => {
|
|
|
4109
4061
|
split
|
|
4110
4062
|
});
|
|
4111
4063
|
};
|
|
4112
|
-
|
|
4113
4064
|
//#endregion
|
|
4114
4065
|
//#region src/openApi/shared/transforms/schemas.ts
|
|
4115
4066
|
/**
|
|
@@ -4150,7 +4101,6 @@ const schemaNameTransform = ({ config, spec }) => {
|
|
|
4150
4101
|
}
|
|
4151
4102
|
if (Object.keys(renameMap).length) rewriteRefs(spec, renameMap);
|
|
4152
4103
|
};
|
|
4153
|
-
|
|
4154
4104
|
//#endregion
|
|
4155
4105
|
//#region src/openApi/shared/transforms/index.ts
|
|
4156
4106
|
const transformOpenApiSpec = ({ context }) => {
|
|
@@ -4172,7 +4122,6 @@ const transformOpenApiSpec = ({ context }) => {
|
|
|
4172
4122
|
});
|
|
4173
4123
|
eventTransformOpenApiSpec.timeEnd();
|
|
4174
4124
|
};
|
|
4175
|
-
|
|
4176
4125
|
//#endregion
|
|
4177
4126
|
//#region src/openApi/shared/utils/parameter.ts
|
|
4178
4127
|
const mergeParametersObjects = ({ source, target }) => {
|
|
@@ -4202,7 +4151,6 @@ const mergeParametersObjects = ({ source, target }) => {
|
|
|
4202
4151
|
if (!Object.keys(result).length) return;
|
|
4203
4152
|
return result;
|
|
4204
4153
|
};
|
|
4205
|
-
|
|
4206
4154
|
//#endregion
|
|
4207
4155
|
//#region src/openApi/shared/utils/validator.ts
|
|
4208
4156
|
const isSimpleKey = (key) => /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key);
|
|
@@ -4229,7 +4177,6 @@ const handleValidatorResult = ({ context, result }) => {
|
|
|
4229
4177
|
})) console.log(formatValidatorIssue(issue));
|
|
4230
4178
|
if (!result.valid) process.exit(1);
|
|
4231
4179
|
};
|
|
4232
|
-
|
|
4233
4180
|
//#endregion
|
|
4234
4181
|
//#region src/openApi/2.0.x/parser/filter.ts
|
|
4235
4182
|
/**
|
|
@@ -4263,7 +4210,6 @@ const filterSpec$2 = ({ logger, operations, preserveOrder, schemas, spec }) => {
|
|
|
4263
4210
|
}
|
|
4264
4211
|
eventFilterSpec.timeEnd();
|
|
4265
4212
|
};
|
|
4266
|
-
|
|
4267
4213
|
//#endregion
|
|
4268
4214
|
//#region src/ir/mediaType.ts
|
|
4269
4215
|
const fileLikeRegExp = /^(application\/(pdf|rtf|msword|vnd\.(ms-|openxmlformats-officedocument\.)|zip|x-(7z|tar|rar|zip|iso)|octet-stream|gzip|x-msdownload|json\+download|xml|x-yaml|x-7z-compressed|x-tar)|text\/(yaml|css|javascript)|audio\/(mpeg|wav)|video\/(mp4|x-matroska)|image\/(vnd\.adobe\.photoshop|svg\+xml))(; ?charset=[^;]+)?$/i;
|
|
@@ -4288,7 +4234,6 @@ const mediaTypeToIrMediaType = ({ mediaType }) => {
|
|
|
4288
4234
|
octetStreamMimeRegExp.lastIndex = 0;
|
|
4289
4235
|
if (octetStreamMimeRegExp.test(mediaType)) return "octet-stream";
|
|
4290
4236
|
};
|
|
4291
|
-
|
|
4292
4237
|
//#endregion
|
|
4293
4238
|
//#region src/openApi/2.0.x/parser/mediaType.ts
|
|
4294
4239
|
const contentToSchema$2 = ({ content }) => {
|
|
@@ -4316,14 +4261,12 @@ const mediaTypeObjects$2 = ({ mimeTypes, response }) => {
|
|
|
4316
4261
|
});
|
|
4317
4262
|
return objects;
|
|
4318
4263
|
};
|
|
4319
|
-
|
|
4320
4264
|
//#endregion
|
|
4321
4265
|
//#region src/ir/pagination.ts
|
|
4322
4266
|
function getPaginationKeywordsRegExp(pagination) {
|
|
4323
4267
|
const pattern = `^(${pagination.keywords.join("|")})$`;
|
|
4324
4268
|
return new RegExp(pattern);
|
|
4325
4269
|
}
|
|
4326
|
-
|
|
4327
4270
|
//#endregion
|
|
4328
4271
|
//#region src/openApi/shared/utils/discriminator.ts
|
|
4329
4272
|
/**
|
|
@@ -4390,7 +4333,6 @@ const discriminatorValues = ($ref, mapping, shouldUseRefAsValue) => {
|
|
|
4390
4333
|
if (!values.length && (!shouldUseRefAsValue || shouldUseRefAsValue())) return [refToName($ref)];
|
|
4391
4334
|
return values;
|
|
4392
4335
|
};
|
|
4393
|
-
|
|
4394
4336
|
//#endregion
|
|
4395
4337
|
//#region src/openApi/2.0.x/parser/schema.ts
|
|
4396
4338
|
const getSchemaType$1 = ({ schema }) => {
|
|
@@ -4787,7 +4729,6 @@ const parseSchema$2 = ({ $ref, context, schema }) => {
|
|
|
4787
4729
|
}
|
|
4788
4730
|
});
|
|
4789
4731
|
};
|
|
4790
|
-
|
|
4791
4732
|
//#endregion
|
|
4792
4733
|
//#region src/openApi/2.0.x/parser/pagination.ts
|
|
4793
4734
|
const isPaginationType$2 = (schemaType) => schemaType === "boolean" || schemaType === "integer" || schemaType === "number" || schemaType === "string";
|
|
@@ -4836,7 +4777,6 @@ const paginationField$2 = ({ context, name, schema }) => {
|
|
|
4836
4777
|
}
|
|
4837
4778
|
return false;
|
|
4838
4779
|
};
|
|
4839
|
-
|
|
4840
4780
|
//#endregion
|
|
4841
4781
|
//#region src/openApi/2.0.x/parser/operation.ts
|
|
4842
4782
|
const parseOperationJsDoc$2 = ({ irOperation, operation }) => {
|
|
@@ -5042,7 +4982,6 @@ const parsePathOperation$2 = ({ context, method, operation, path, securityScheme
|
|
|
5042
4982
|
state
|
|
5043
4983
|
});
|
|
5044
4984
|
};
|
|
5045
|
-
|
|
5046
4985
|
//#endregion
|
|
5047
4986
|
//#region src/openApi/2.0.x/parser/parameter.ts
|
|
5048
4987
|
/**
|
|
@@ -5129,7 +5068,6 @@ const parameterToIrParameter$2 = ({ $ref, context, parameter }) => {
|
|
|
5129
5068
|
});
|
|
5130
5069
|
return irParameter;
|
|
5131
5070
|
};
|
|
5132
|
-
|
|
5133
5071
|
//#endregion
|
|
5134
5072
|
//#region src/utils/url.ts
|
|
5135
5073
|
const parseUrlRegExp = /^(([^:/?#]+):)?((\/\/)?([^:/?#]*)(:?([^/?#]*)))?([^?#]*)(\?([^#]*))?(#(.*))?/;
|
|
@@ -5155,7 +5093,6 @@ function parseUrl(value) {
|
|
|
5155
5093
|
protocol
|
|
5156
5094
|
};
|
|
5157
5095
|
}
|
|
5158
|
-
|
|
5159
5096
|
//#endregion
|
|
5160
5097
|
//#region src/openApi/2.0.x/parser/server.ts
|
|
5161
5098
|
const parseServers$2 = ({ context }) => {
|
|
@@ -5173,7 +5110,6 @@ const parseServers$2 = ({ context }) => {
|
|
|
5173
5110
|
const servers = schemes.map((scheme) => `${scheme ? `${scheme}://` : ""}${host}${path}`).filter(Boolean);
|
|
5174
5111
|
if (servers.length) context.ir.servers = servers.map((url) => ({ url }));
|
|
5175
5112
|
};
|
|
5176
|
-
|
|
5177
5113
|
//#endregion
|
|
5178
5114
|
//#region src/openApi/2.0.x/parser/validate.ts
|
|
5179
5115
|
const validateOpenApiSpec$2 = (spec, logger) => {
|
|
@@ -5215,7 +5151,6 @@ const validateOpenApiSpec$2 = (spec, logger) => {
|
|
|
5215
5151
|
valid: !issues.some((issue) => issue.severity === "error")
|
|
5216
5152
|
};
|
|
5217
5153
|
};
|
|
5218
|
-
|
|
5219
5154
|
//#endregion
|
|
5220
5155
|
//#region src/openApi/2.0.x/parser/index.ts
|
|
5221
5156
|
const parseV2_0_X = (context) => {
|
|
@@ -5417,7 +5352,6 @@ const parseV2_0_X = (context) => {
|
|
|
5417
5352
|
}
|
|
5418
5353
|
}
|
|
5419
5354
|
};
|
|
5420
|
-
|
|
5421
5355
|
//#endregion
|
|
5422
5356
|
//#region src/openApi/3.0.x/parser/filter.ts
|
|
5423
5357
|
/**
|
|
@@ -5486,7 +5420,6 @@ const filterSpec$1 = ({ logger, operations, parameters, preserveOrder, requestBo
|
|
|
5486
5420
|
}
|
|
5487
5421
|
eventFilterSpec.timeEnd();
|
|
5488
5422
|
};
|
|
5489
|
-
|
|
5490
5423
|
//#endregion
|
|
5491
5424
|
//#region src/openApi/3.0.x/parser/mediaType.ts
|
|
5492
5425
|
const contentToSchema$1 = ({ content }) => {
|
|
@@ -5514,7 +5447,6 @@ const mediaTypeObjects$1 = ({ content }) => {
|
|
|
5514
5447
|
});
|
|
5515
5448
|
return objects;
|
|
5516
5449
|
};
|
|
5517
|
-
|
|
5518
5450
|
//#endregion
|
|
5519
5451
|
//#region src/openApi/3.0.x/parser/schema.ts
|
|
5520
5452
|
const getSchemaType = ({ schema }) => {
|
|
@@ -6168,7 +6100,6 @@ const parseSchema$1 = ({ $ref, context, schema }) => {
|
|
|
6168
6100
|
}
|
|
6169
6101
|
});
|
|
6170
6102
|
};
|
|
6171
|
-
|
|
6172
6103
|
//#endregion
|
|
6173
6104
|
//#region src/openApi/3.0.x/parser/pagination.ts
|
|
6174
6105
|
const isPaginationType$1 = (schemaType) => schemaType === "boolean" || schemaType === "integer" || schemaType === "number" || schemaType === "string";
|
|
@@ -6213,7 +6144,6 @@ const paginationField$1 = ({ context, name, schema }) => {
|
|
|
6213
6144
|
}
|
|
6214
6145
|
return false;
|
|
6215
6146
|
};
|
|
6216
|
-
|
|
6217
6147
|
//#endregion
|
|
6218
6148
|
//#region src/openApi/3.0.x/parser/operation.ts
|
|
6219
6149
|
const parseOperationJsDoc$1 = ({ irOperation, operation }) => {
|
|
@@ -6339,7 +6269,6 @@ const parsePathOperation$1 = ({ context, method, operation, path, securityScheme
|
|
|
6339
6269
|
state
|
|
6340
6270
|
});
|
|
6341
6271
|
};
|
|
6342
|
-
|
|
6343
6272
|
//#endregion
|
|
6344
6273
|
//#region src/openApi/3.0.x/parser/parameter.ts
|
|
6345
6274
|
/**
|
|
@@ -6443,7 +6372,6 @@ const parseParameter$1 = ({ $ref, context, parameter }) => {
|
|
|
6443
6372
|
parameter
|
|
6444
6373
|
});
|
|
6445
6374
|
};
|
|
6446
|
-
|
|
6447
6375
|
//#endregion
|
|
6448
6376
|
//#region src/openApi/3.0.x/parser/requestBody.ts
|
|
6449
6377
|
const requestBodyToIrRequestBody$1 = ({ $ref, context, requestBody }) => {
|
|
@@ -6474,7 +6402,6 @@ const parseRequestBody$1 = ({ $ref, context, requestBody }) => {
|
|
|
6474
6402
|
requestBody
|
|
6475
6403
|
});
|
|
6476
6404
|
};
|
|
6477
|
-
|
|
6478
6405
|
//#endregion
|
|
6479
6406
|
//#region src/openApi/3.0.x/parser/server.ts
|
|
6480
6407
|
function parseServers$1({ context }) {
|
|
@@ -6488,7 +6415,6 @@ function parseServers$1({ context }) {
|
|
|
6488
6415
|
}
|
|
6489
6416
|
if (!context.ir.servers) context.ir.servers = [{ url: "/" }];
|
|
6490
6417
|
}
|
|
6491
|
-
|
|
6492
6418
|
//#endregion
|
|
6493
6419
|
//#region src/openApi/3.0.x/parser/validate.ts
|
|
6494
6420
|
const validateOpenApiSpec$1 = (spec, logger) => {
|
|
@@ -6557,7 +6483,6 @@ const validateOpenApiSpec$1 = (spec, logger) => {
|
|
|
6557
6483
|
valid: !issues.some((issue) => issue.severity === "error")
|
|
6558
6484
|
};
|
|
6559
6485
|
};
|
|
6560
|
-
|
|
6561
6486
|
//#endregion
|
|
6562
6487
|
//#region src/openApi/3.0.x/parser/index.ts
|
|
6563
6488
|
const parseV3_0_X = (context) => {
|
|
@@ -6763,7 +6688,6 @@ const parseV3_0_X = (context) => {
|
|
|
6763
6688
|
});
|
|
6764
6689
|
}
|
|
6765
6690
|
};
|
|
6766
|
-
|
|
6767
6691
|
//#endregion
|
|
6768
6692
|
//#region src/openApi/3.1.x/parser/filter.ts
|
|
6769
6693
|
/**
|
|
@@ -6832,7 +6756,6 @@ const filterSpec = ({ logger, operations, parameters, preserveOrder, requestBodi
|
|
|
6832
6756
|
}
|
|
6833
6757
|
eventFilterSpec.timeEnd();
|
|
6834
6758
|
};
|
|
6835
|
-
|
|
6836
6759
|
//#endregion
|
|
6837
6760
|
//#region src/openApi/3.1.x/parser/mediaType.ts
|
|
6838
6761
|
const contentToSchema = ({ content }) => {
|
|
@@ -6859,7 +6782,6 @@ const mediaTypeObjects = ({ content }) => {
|
|
|
6859
6782
|
});
|
|
6860
6783
|
return objects;
|
|
6861
6784
|
};
|
|
6862
|
-
|
|
6863
6785
|
//#endregion
|
|
6864
6786
|
//#region src/openApi/3.1.x/parser/schema.ts
|
|
6865
6787
|
const getSchemaTypes = ({ schema }) => {
|
|
@@ -7602,7 +7524,6 @@ const parseSchema = ({ $ref, context, schema }) => {
|
|
|
7602
7524
|
}
|
|
7603
7525
|
});
|
|
7604
7526
|
};
|
|
7605
|
-
|
|
7606
7527
|
//#endregion
|
|
7607
7528
|
//#region src/openApi/3.1.x/parser/pagination.ts
|
|
7608
7529
|
const isPaginationType = (schemaTypes) => schemaTypes.includes("boolean") || schemaTypes.includes("integer") || schemaTypes.includes("number") || schemaTypes.includes("string");
|
|
@@ -7654,7 +7575,6 @@ const paginationField = ({ context, name, schema }) => {
|
|
|
7654
7575
|
}
|
|
7655
7576
|
return false;
|
|
7656
7577
|
};
|
|
7657
|
-
|
|
7658
7578
|
//#endregion
|
|
7659
7579
|
//#region src/openApi/3.1.x/parser/operation.ts
|
|
7660
7580
|
const parseOperationJsDoc = ({ irOperation, operation }) => {
|
|
@@ -7791,7 +7711,6 @@ const parseWebhookOperation = ({ context, key, method, ...options }) => {
|
|
|
7791
7711
|
});
|
|
7792
7712
|
context.ir.webhooks[key][method] = parsed;
|
|
7793
7713
|
};
|
|
7794
|
-
|
|
7795
7714
|
//#endregion
|
|
7796
7715
|
//#region src/openApi/3.1.x/parser/parameter.ts
|
|
7797
7716
|
/**
|
|
@@ -7891,7 +7810,6 @@ const parseParameter = ({ $ref, context, parameter }) => {
|
|
|
7891
7810
|
parameter
|
|
7892
7811
|
});
|
|
7893
7812
|
};
|
|
7894
|
-
|
|
7895
7813
|
//#endregion
|
|
7896
7814
|
//#region src/openApi/3.1.x/parser/requestBody.ts
|
|
7897
7815
|
const requestBodyToIrRequestBody = ({ $ref, context, requestBody }) => {
|
|
@@ -7922,7 +7840,6 @@ const parseRequestBody = ({ $ref, context, requestBody }) => {
|
|
|
7922
7840
|
requestBody
|
|
7923
7841
|
});
|
|
7924
7842
|
};
|
|
7925
|
-
|
|
7926
7843
|
//#endregion
|
|
7927
7844
|
//#region src/openApi/3.1.x/parser/server.ts
|
|
7928
7845
|
const parseServers = ({ context }) => {
|
|
@@ -7936,7 +7853,6 @@ const parseServers = ({ context }) => {
|
|
|
7936
7853
|
}
|
|
7937
7854
|
if (!context.ir.servers) context.ir.servers = [{ url: "/" }];
|
|
7938
7855
|
};
|
|
7939
|
-
|
|
7940
7856
|
//#endregion
|
|
7941
7857
|
//#region src/openApi/3.1.x/parser/validate.ts
|
|
7942
7858
|
const validateOpenApiSpec = (spec, logger) => {
|
|
@@ -8005,7 +7921,6 @@ const validateOpenApiSpec = (spec, logger) => {
|
|
|
8005
7921
|
valid: !issues.some((issue) => issue.severity === "error")
|
|
8006
7922
|
};
|
|
8007
7923
|
};
|
|
8008
|
-
|
|
8009
7924
|
//#endregion
|
|
8010
7925
|
//#region src/openApi/3.1.x/parser/webhook.ts
|
|
8011
7926
|
const parseWebhooks = ({ context, securitySchemesMap }) => {
|
|
@@ -8154,7 +8069,6 @@ const parseWebhooks = ({ context, securitySchemesMap }) => {
|
|
|
8154
8069
|
});
|
|
8155
8070
|
}
|
|
8156
8071
|
};
|
|
8157
|
-
|
|
8158
8072
|
//#endregion
|
|
8159
8073
|
//#region src/openApi/3.1.x/parser/index.ts
|
|
8160
8074
|
const parseV3_1_X = (context) => {
|
|
@@ -8364,7 +8278,6 @@ const parseV3_1_X = (context) => {
|
|
|
8364
8278
|
securitySchemesMap
|
|
8365
8279
|
});
|
|
8366
8280
|
};
|
|
8367
|
-
|
|
8368
8281
|
//#endregion
|
|
8369
8282
|
//#region src/openApi/index.ts
|
|
8370
8283
|
/**
|
|
@@ -8387,7 +8300,6 @@ function parseOpenApiSpec(context) {
|
|
|
8387
8300
|
}
|
|
8388
8301
|
throw new Error("Unsupported OpenAPI specification");
|
|
8389
8302
|
}
|
|
8390
|
-
|
|
8391
8303
|
//#endregion
|
|
8392
8304
|
//#region src/openApi/shared/locations/operation.ts
|
|
8393
8305
|
/**
|
|
@@ -8435,7 +8347,6 @@ const OperationPath = {
|
|
|
8435
8347
|
},
|
|
8436
8348
|
id: () => (operation) => [operation.id]
|
|
8437
8349
|
};
|
|
8438
|
-
|
|
8439
8350
|
//#endregion
|
|
8440
8351
|
//#region src/openApi/shared/utils/patch.ts
|
|
8441
8352
|
async function patchOpenApiSpec({ patchOptions, spec: _spec }) {
|
|
@@ -8544,7 +8455,6 @@ async function patchOpenApiSpec({ patchOptions, spec: _spec }) {
|
|
|
8544
8455
|
await patchFn(operation);
|
|
8545
8456
|
}
|
|
8546
8457
|
}
|
|
8547
|
-
|
|
8548
8458
|
//#endregion
|
|
8549
8459
|
//#region src/plugins/shared/utils/config.ts
|
|
8550
8460
|
const definePluginConfig = (defaultConfig) => (userConfig) => ({
|
|
@@ -8562,7 +8472,6 @@ const mappers = {
|
|
|
8562
8472
|
function: (name) => ({ name }),
|
|
8563
8473
|
string: (name) => ({ name })
|
|
8564
8474
|
};
|
|
8565
|
-
|
|
8566
8475
|
//#endregion
|
|
8567
8476
|
//#region src/plugins/symbol.ts
|
|
8568
8477
|
/**
|
|
@@ -8589,7 +8498,6 @@ function buildSymbolIn({ plugin, ...ctx }) {
|
|
|
8589
8498
|
name: ctx.naming ? applyNaming(ctx.name, ctx.naming) : ctx.name
|
|
8590
8499
|
};
|
|
8591
8500
|
}
|
|
8592
|
-
|
|
8593
8501
|
//#endregion
|
|
8594
8502
|
//#region src/plugins/validator.ts
|
|
8595
8503
|
/**
|
|
@@ -8617,13 +8525,11 @@ function resolveValidatorLayer(layers, key, defaultValues) {
|
|
|
8617
8525
|
...override
|
|
8618
8526
|
};
|
|
8619
8527
|
}
|
|
8620
|
-
|
|
8621
8528
|
//#endregion
|
|
8622
8529
|
//#region src/utils/escape.ts
|
|
8623
8530
|
function escapeComment(value) {
|
|
8624
8531
|
return value.replace(/\*\//g, "*").replace(/\/\*/g, "*").replace(/\r?\n(.*)/g, (_l, w) => EOL + w.trim());
|
|
8625
8532
|
}
|
|
8626
|
-
|
|
8627
8533
|
//#endregion
|
|
8628
8534
|
//#region src/utils/exports.ts
|
|
8629
8535
|
/**
|
|
@@ -8635,7 +8541,6 @@ const utils = {
|
|
|
8635
8541
|
},
|
|
8636
8542
|
toCase
|
|
8637
8543
|
};
|
|
8638
|
-
|
|
8639
8544
|
//#endregion
|
|
8640
8545
|
//#region src/utils/header.ts
|
|
8641
8546
|
/**
|
|
@@ -8653,7 +8558,6 @@ function outputHeaderToPrefix(ctx) {
|
|
|
8653
8558
|
const content = lines.join("\n");
|
|
8654
8559
|
return content ? `${content}\n\n` : "";
|
|
8655
8560
|
}
|
|
8656
|
-
|
|
8657
8561
|
//#endregion
|
|
8658
8562
|
//#region src/utils/path.ts
|
|
8659
8563
|
/**
|
|
@@ -8757,7 +8661,7 @@ function pathToName(path, options) {
|
|
|
8757
8661
|
}
|
|
8758
8662
|
return decodeURI(names.join("-"));
|
|
8759
8663
|
}
|
|
8760
|
-
|
|
8761
8664
|
//#endregion
|
|
8762
8665
|
export { ConfigError, ConfigValidationError, Context, HeyApiError, InputError, IntentContext, JobError, MinHeap, OperationPath, OperationStrategy, PluginInstance, addItemsToSchema, applyNaming, buildGraph, buildSymbolIn, checkNodeVersion, childContext, compileInputPath, createOperationKey, createSchemaProcessor, createSchemaWalker, debugTools, deduplicateSchema, defaultPaginationKeywords, definePluginConfig, dependencyFactory, encodeJsonPointerSegment, ensureDirSync, escapeComment, findPackageJson, findTsConfigPath, getInput, getInputError, getLogs, getParser, getSpec, hasOperationDataRequired, hasParameterGroupObjectRequired, hasParametersObjectRequired, heyApiRegistryBaseUrl, inputToApiRegistry, isEnvironment, isTopLevelComponent, jsonPointerToPath, loadPackageJson, logCrashReport, logInputPaths, mappers, normalizeJsonPointer, openGitHubIssueWithCrashReport, operationPagination, operationResponsesMap, outputHeaderToPrefix, parameterWithPagination, parseOpenApiSpec, parseUrl, parseV2_0_X, parseV3_0_X, parseV3_1_X, patchOpenApiSpec, pathToJsonPointer, pathToName, postprocessOutput, printCliIntro, printCrashReport, refToName, requestValidatorLayers, resolveNaming, resolveRef, resolveSource, resolveValidatorLayer, satisfies, shouldReportCrash, statusCodeToGroup, toCase, utils, valueToObject };
|
|
8666
|
+
|
|
8763
8667
|
//# sourceMappingURL=index.mjs.map
|