ts-openapi-codegen 2.0.0-beta.5 → 2.0.0-beta.7
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/README.md +0 -74
- package/README.rus.md +0 -73
- package/dist/cli/initOpenApiConfig/Types.d.ts +0 -5
- package/dist/cli/initOpenApiConfig/Types.d.ts.map +1 -1
- package/dist/core/Context.d.ts +22 -0
- package/dist/core/Context.d.ts.map +1 -1
- package/dist/core/Context.js +97 -0
- package/dist/core/WriteClient.d.ts +3 -1
- package/dist/core/WriteClient.d.ts.map +1 -1
- package/dist/core/WriteClient.js +8 -0
- package/dist/core/__tests__/WriteClient.test.js +2 -1
- package/dist/core/api/v2/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getModels.js +1 -2
- package/dist/core/api/v2/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v2/parser/getType.js +14 -8
- package/dist/core/api/v3/parser/getModels.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getModels.js +1 -2
- package/dist/core/api/v3/parser/getType.d.ts.map +1 -1
- package/dist/core/api/v3/parser/getType.js +14 -8
- package/dist/core/types/base/ClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/ClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts +1 -1
- package/dist/core/types/base/SimpleClientArtifacts.model.d.ts.map +1 -1
- package/dist/core/types/base/Templates.model.d.ts +29 -0
- package/dist/core/types/base/Templates.model.d.ts.map +1 -0
- package/dist/core/utils/__mocks__/templates.d.ts +1 -1
- package/dist/core/utils/__mocks__/templates.d.ts.map +1 -1
- package/dist/core/utils/__mocks__/templates.js +2 -1
- package/dist/core/utils/getOpenApiSpec.d.ts +0 -6
- package/dist/core/utils/getOpenApiSpec.d.ts.map +1 -1
- package/dist/core/utils/getOpenApiSpec.js +13 -23
- package/dist/core/utils/precompileTemplates.js +1 -0
- package/dist/core/utils/registerHandlebarHelpers.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarHelpers.js +11 -0
- package/dist/core/utils/registerHandlebarTemplates.d.ts +1 -27
- package/dist/core/utils/registerHandlebarTemplates.d.ts.map +1 -1
- package/dist/core/utils/registerHandlebarTemplates.js +4 -2
- package/dist/core/utils/stripNamespace.js +1 -1
- package/dist/core/utils/writeClientCore.d.ts +1 -1
- package/dist/core/utils/writeClientCore.d.ts.map +1 -1
- package/dist/core/utils/writeClientCore.js +3 -2
- package/dist/core/utils/writeClientCoreIndex.d.ts +1 -1
- package/dist/core/utils/writeClientCoreIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientExecutor.d.ts +12 -0
- package/dist/core/utils/writeClientExecutor.d.ts.map +1 -0
- package/dist/core/utils/writeClientExecutor.js +18 -0
- package/dist/core/utils/writeClientFullIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientFullIndex.js +1 -1
- package/dist/core/utils/writeClientModels.d.ts +1 -1
- package/dist/core/utils/writeClientModels.d.ts.map +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts +1 -1
- package/dist/core/utils/writeClientModelsIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemas.d.ts +1 -1
- package/dist/core/utils/writeClientSchemas.d.ts.map +1 -1
- package/dist/core/utils/writeClientSchemasIndex.d.ts +1 -1
- package/dist/core/utils/writeClientSchemasIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientServices.d.ts +1 -1
- package/dist/core/utils/writeClientServices.d.ts.map +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts +1 -1
- package/dist/core/utils/writeClientServicesIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.d.ts.map +1 -1
- package/dist/core/utils/writeClientSimpleIndex.js +1 -1
- package/dist/templatesCompiled/client/core/createExecutorAdapter.d.ts +12 -0
- package/dist/templatesCompiled/client/core/createExecutorAdapter.d.ts.map +1 -0
- package/dist/templatesCompiled/client/core/createExecutorAdapter.js +32 -0
- package/dist/templatesCompiled/client/{core/legacy-request-adapter.d.ts → exportClient.d.ts} +3 -1
- package/dist/templatesCompiled/client/exportClient.d.ts.map +1 -0
- package/dist/templatesCompiled/client/exportClient.js +49 -0
- package/dist/templatesCompiled/client/indexCore.js +2 -2
- package/dist/templatesCompiled/client/indexFull.d.ts +12 -9
- package/dist/templatesCompiled/client/indexFull.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexFull.js +69 -46
- package/dist/templatesCompiled/client/indexSimple.d.ts.map +1 -1
- package/dist/templatesCompiled/client/indexSimple.js +2 -1
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts +2 -1
- package/dist/templatesCompiled/client/partials/serviceOption.d.ts.map +1 -1
- package/dist/templatesCompiled/client/partials/serviceOption.js +36 -30
- package/package.json +1 -7
- package/dist/cli/initOpenApiConfig/Enums.d.ts +0 -5
- package/dist/cli/initOpenApiConfig/Enums.d.ts.map +0 -1
- package/dist/cli/initOpenApiConfig/Enums.js +0 -8
- package/dist/core/types/base/RefWithtype.model.d.ts +0 -11
- package/dist/core/types/base/RefWithtype.model.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.d.ts +0 -8
- package/dist/core/types/enums/TypeRef.enum.d.ts.map +0 -1
- package/dist/core/types/enums/TypeRef.enum.js +0 -11
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getGatheringRefs.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getGatheringRefs.test.js +0 -26
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts +0 -2
- package/dist/core/utils/__tests__/getRefFromSchema.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/getRefFromSchema.test.js +0 -167
- package/dist/core/utils/__tests__/refResolver.test.d.ts +0 -2
- package/dist/core/utils/__tests__/refResolver.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/refResolver.test.js +0 -55
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts +0 -2
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.d.ts.map +0 -1
- package/dist/core/utils/__tests__/resolveRefToImportPath.test.js +0 -385
- package/dist/core/utils/findCommonParent.d.ts +0 -7
- package/dist/core/utils/findCommonParent.d.ts.map +0 -1
- package/dist/core/utils/findCommonParent.js +0 -20
- package/dist/core/utils/getGatheringRefs.d.ts +0 -4
- package/dist/core/utils/getGatheringRefs.d.ts.map +0 -1
- package/dist/core/utils/getGatheringRefs.js +0 -68
- package/dist/core/utils/getRefFromSchema.d.ts +0 -3
- package/dist/core/utils/getRefFromSchema.d.ts.map +0 -1
- package/dist/core/utils/getRefFromSchema.js +0 -9
- package/dist/core/utils/isBoolean.d.ts +0 -2
- package/dist/core/utils/isBoolean.d.ts.map +0 -1
- package/dist/core/utils/isBoolean.js +0 -12
- package/dist/core/utils/isFileName.d.ts +0 -7
- package/dist/core/utils/isFileName.d.ts.map +0 -1
- package/dist/core/utils/isFileName.js +0 -30
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts +0 -10
- package/dist/core/utils/mapPathToTargetDirSafe.d.ts.map +0 -1
- package/dist/core/utils/mapPathToTargetDirSafe.js +0 -48
- package/dist/core/utils/normalizeAllRefs.d.ts +0 -6
- package/dist/core/utils/normalizeAllRefs.d.ts.map +0 -1
- package/dist/core/utils/normalizeAllRefs.js +0 -35
- package/dist/core/utils/resolveRefToImportPath.d.ts +0 -13
- package/dist/core/utils/resolveRefToImportPath.d.ts.map +0 -1
- package/dist/core/utils/resolveRefToImportPath.js +0 -111
- package/dist/templatesCompiled/client/core/legacy-request-adapter.d.ts.map +0 -1
- package/dist/templatesCompiled/client/core/legacy-request-adapter.js +0 -18
- /package/dist/core/types/base/{RefWithtype.model.js → Templates.model.js} +0 -0
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Context } from '../Context';
|
|
2
|
-
/**
|
|
3
|
-
* Deep traversal and normalization of all $ref in an object
|
|
4
|
-
*/
|
|
5
|
-
export declare function normalizeAllRefs<T extends Record<string, any>>(obj: T, context: Context, parentFilePath: string): T;
|
|
6
|
-
//# sourceMappingURL=normalizeAllRefs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeAllRefs.d.ts","sourceRoot":"","sources":["../../../src/core/utils/normalizeAllRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAG1C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1D,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,MAAM,GACvB,CAAC,CA6BH"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeAllRefs = normalizeAllRefs;
|
|
4
|
-
const normalizeRef_1 = require("./normalizeRef");
|
|
5
|
-
/**
|
|
6
|
-
* Deep traversal and normalization of all $ref in an object
|
|
7
|
-
*/
|
|
8
|
-
function normalizeAllRefs(obj, context, parentFilePath) {
|
|
9
|
-
if (!obj || typeof obj !== 'object' || Array.isArray(obj)) {
|
|
10
|
-
return obj;
|
|
11
|
-
}
|
|
12
|
-
// If this object is a $ref holder
|
|
13
|
-
if (obj.$ref && typeof obj.$ref === 'string') {
|
|
14
|
-
const normalizedRef = (0, normalizeRef_1.normalizeRef)(obj.$ref, parentFilePath);
|
|
15
|
-
return {
|
|
16
|
-
...obj,
|
|
17
|
-
$ref: normalizedRef
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const result = Array.isArray(obj) ? [] : { ...obj };
|
|
21
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
22
|
-
if (value && typeof value === 'object') {
|
|
23
|
-
// For nested objects, use the same parent file path
|
|
24
|
-
// The normalization will handle the $ref resolution correctly
|
|
25
|
-
result[key] = normalizeAllRefs(value, context, parentFilePath);
|
|
26
|
-
}
|
|
27
|
-
else if (Array.isArray(value)) {
|
|
28
|
-
result[key] = value.map((item) => (item && typeof item === 'object' ? normalizeAllRefs(item, context, parentFilePath) : item));
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
result[key] = value;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return result;
|
|
35
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface IParams {
|
|
2
|
-
mainSpecPath: string;
|
|
3
|
-
parentFilePath: string;
|
|
4
|
-
refValuePath: string;
|
|
5
|
-
outputModelsPath: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Resolves $ref reference to import path for generated code.
|
|
9
|
-
* Handles HTTP URLs, local fragments, external file fragments, external files, and absolute paths.
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveRefToImportPath({ mainSpecPath, parentFilePath, refValuePath, outputModelsPath }: IParams): string;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=resolveRefToImportPath.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRefToImportPath.d.ts","sourceRoot":"","sources":["../../../src/core/utils/resolveRefToImportPath.ts"],"names":[],"mappings":"AAQA,UAAU,OAAO;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAoED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,EAAE,OAAO,UAyD/G"}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveRefToImportPath = resolveRefToImportPath;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fileSystemHelpers_1 = require("../../common/utils/fileSystemHelpers");
|
|
6
|
-
const pathHelpers_1 = require("../../common/utils/pathHelpers");
|
|
7
|
-
const mapPathToTargetDirSafe_1 = require("./mapPathToTargetDirSafe");
|
|
8
|
-
const parseRef_1 = require("./parseRef");
|
|
9
|
-
const stripNamespace_1 = require("./stripNamespace");
|
|
10
|
-
/**
|
|
11
|
-
* Resolves model path and returns relative path or fallback name.
|
|
12
|
-
* Returns fallback if the path is outside outputModelsPath, otherwise returns relative path.
|
|
13
|
-
*/
|
|
14
|
-
function resolveModelPath(absModelPath, absOutputModelsPath, fallbackName) {
|
|
15
|
-
if (!absModelPath.startsWith(absOutputModelsPath + '/') && absModelPath !== absOutputModelsPath) {
|
|
16
|
-
return `./${fallbackName}`;
|
|
17
|
-
}
|
|
18
|
-
return (0, pathHelpers_1.relativeHelper)(absOutputModelsPath, absModelPath);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resolves fragment reference (LOCAL_FRAGMENT or EXTERNAL_FILE_FRAGMENT).
|
|
22
|
-
* Both types use the same logic: resolve model path based on parent file location.
|
|
23
|
-
*/
|
|
24
|
-
function resolveFragmentRef(modelName, parentFilePath, mainSpecPath, sourceRoot, outputModelsPath, absOutputModelsPath) {
|
|
25
|
-
const cleanParentForLocal = (0, stripNamespace_1.stripNamespace)(parentFilePath || mainSpecPath);
|
|
26
|
-
const parentDirInSource = (0, pathHelpers_1.dirNameHelper)(cleanParentForLocal);
|
|
27
|
-
const parentDirInOutput = (0, mapPathToTargetDirSafe_1.mapPathToTargetDirSafe)(parentDirInSource, sourceRoot, outputModelsPath);
|
|
28
|
-
const modelFilePathInOutput = (0, pathHelpers_1.resolveHelper)(parentDirInOutput, modelName);
|
|
29
|
-
const absModelPath = (0, pathHelpers_1.resolveHelper)(modelFilePathInOutput);
|
|
30
|
-
return resolveModelPath(absModelPath, absOutputModelsPath, modelName);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Resolves external file or absolute path reference.
|
|
34
|
-
* Maps the target file path to output directory and returns relative path or fallback.
|
|
35
|
-
*/
|
|
36
|
-
function resolveExternalFileOrAbsolutePath(targetFileAbs, sourceRoot, outputModelsPath, absOutputModelsPath) {
|
|
37
|
-
const targetPathInOutput = (0, mapPathToTargetDirSafe_1.mapPathToTargetDirSafe)(targetFileAbs, sourceRoot, outputModelsPath);
|
|
38
|
-
const absTargetPath = (0, pathHelpers_1.resolveHelper)(targetPathInOutput);
|
|
39
|
-
const fallbackName = (0, stripNamespace_1.stripNamespace)((0, path_1.basename)(targetFileAbs));
|
|
40
|
-
return resolveModelPath(absTargetPath, absOutputModelsPath, fallbackName);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Prepares parent directory for resolving relative references.
|
|
44
|
-
* Handles both file and directory paths.
|
|
45
|
-
*/
|
|
46
|
-
function prepareParentDirForResolve(parentFilePath, mainSpecPath, sourceRoot) {
|
|
47
|
-
const parentParsed = parentFilePath ? (0, parseRef_1.parseRef)(parentFilePath) : null;
|
|
48
|
-
const parentRaw = parentParsed?.filePath ? parentParsed.filePath : '';
|
|
49
|
-
const parentClean = (0, stripNamespace_1.stripNamespace)(parentRaw);
|
|
50
|
-
let parentDirForResolve = fileSystemHelpers_1.fileSystemHelpers.isPathToFile(sourceRoot) ? (0, pathHelpers_1.dirNameHelper)(sourceRoot) : sourceRoot;
|
|
51
|
-
if (parentClean) {
|
|
52
|
-
parentDirForResolve = fileSystemHelpers_1.fileSystemHelpers.isPathToFile(parentRaw) ? (0, pathHelpers_1.dirNameHelper)(parentClean) : parentClean;
|
|
53
|
-
}
|
|
54
|
-
return parentDirForResolve.endsWith('/') ? parentDirForResolve : parentDirForResolve + '/';
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Removes parent basename prefix from reference value if present.
|
|
58
|
-
* This handles cases where refValuePath starts with parent directory name.
|
|
59
|
-
*/
|
|
60
|
-
function removeParentBasenamePrefix(refValueClean, parentDirForResolveWithSep) {
|
|
61
|
-
const baseNameParent = (0, path_1.basename)(parentDirForResolveWithSep);
|
|
62
|
-
const baseNameParentWithSep = baseNameParent.endsWith('/') ? baseNameParent : baseNameParent + '/';
|
|
63
|
-
return refValueClean.startsWith(baseNameParentWithSep) ? refValueClean.replace(baseNameParentWithSep, '') : refValueClean;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Resolves $ref reference to import path for generated code.
|
|
67
|
-
* Handles HTTP URLs, local fragments, external file fragments, external files, and absolute paths.
|
|
68
|
-
*/
|
|
69
|
-
function resolveRefToImportPath({ mainSpecPath, parentFilePath, refValuePath, outputModelsPath }) {
|
|
70
|
-
const absOutputModelsPath = (0, pathHelpers_1.resolveHelper)(outputModelsPath);
|
|
71
|
-
const sourceRoot = fileSystemHelpers_1.fileSystemHelpers.isDirectory(mainSpecPath) ? mainSpecPath : (0, pathHelpers_1.dirNameHelper)(mainSpecPath);
|
|
72
|
-
const parsed = (0, parseRef_1.parseRef)(refValuePath);
|
|
73
|
-
// HTTP URLs are returned as-is
|
|
74
|
-
if (parsed.type === parseRef_1.RefType.HTTP_URL) {
|
|
75
|
-
return refValuePath;
|
|
76
|
-
}
|
|
77
|
-
// LOCAL_FRAGMENT: reference to component in the same file (e.g., #/components/schemas/User)
|
|
78
|
-
if (parsed.type === parseRef_1.RefType.LOCAL_FRAGMENT) {
|
|
79
|
-
const modelName = (0, stripNamespace_1.stripNamespace)(refValuePath);
|
|
80
|
-
return resolveFragmentRef(modelName, parentFilePath, mainSpecPath, sourceRoot, outputModelsPath, absOutputModelsPath);
|
|
81
|
-
}
|
|
82
|
-
// EXTERNAL_FILE_FRAGMENT: reference to component in external file (e.g., ./file.yaml#/components/schemas/User)
|
|
83
|
-
if (parsed.type === parseRef_1.RefType.EXTERNAL_FILE_FRAGMENT) {
|
|
84
|
-
const refFileRaw = parsed?.fragment ? parsed.fragment : '';
|
|
85
|
-
const modelName = (0, stripNamespace_1.stripNamespace)(refFileRaw || '') || '';
|
|
86
|
-
return resolveFragmentRef(modelName, parentFilePath, mainSpecPath, sourceRoot, outputModelsPath, absOutputModelsPath);
|
|
87
|
-
}
|
|
88
|
-
// Prepare parent directory for resolving relative references
|
|
89
|
-
// This is used for both EXTERNAL_FILE and ABSOLUTE_PATH (default case)
|
|
90
|
-
const parentDirForResolveWithSep = prepareParentDirForResolve(parentFilePath, mainSpecPath, sourceRoot);
|
|
91
|
-
const refValueClean = (0, stripNamespace_1.stripNamespace)(refValuePath || '') || refValuePath;
|
|
92
|
-
const currentRefValue = removeParentBasenamePrefix(refValueClean, parentDirForResolveWithSep);
|
|
93
|
-
// EXTERNAL_FILE: reference to external file (e.g., ./file.yaml)
|
|
94
|
-
if (parsed.type === parseRef_1.RefType.EXTERNAL_FILE) {
|
|
95
|
-
const adjustedRefSegments = currentRefValue.split('/');
|
|
96
|
-
let adjustedParentDir = parentDirForResolveWithSep;
|
|
97
|
-
while (adjustedRefSegments[0] === '..') {
|
|
98
|
-
adjustedParentDir = (0, pathHelpers_1.dirNameHelper)(adjustedParentDir);
|
|
99
|
-
adjustedRefSegments.shift();
|
|
100
|
-
}
|
|
101
|
-
const parentBase = (0, path_1.basename)(adjustedParentDir);
|
|
102
|
-
if (adjustedRefSegments[0] === parentBase) {
|
|
103
|
-
adjustedRefSegments.shift();
|
|
104
|
-
}
|
|
105
|
-
const targetFileAbs = (0, pathHelpers_1.resolveHelper)(adjustedParentDir, ...adjustedRefSegments);
|
|
106
|
-
return resolveExternalFileOrAbsolutePath(targetFileAbs, sourceRoot, outputModelsPath, absOutputModelsPath);
|
|
107
|
-
}
|
|
108
|
-
// ABSOLUTE_PATH (default case): absolute path reference
|
|
109
|
-
const targetFileAbs = fileSystemHelpers_1.fileSystemHelpers.isPathToFile(refValueClean) ? (0, pathHelpers_1.joinHelper)(parentDirForResolveWithSep, refValueClean) : (0, pathHelpers_1.resolveHelper)(parentDirForResolveWithSep, refValueClean);
|
|
110
|
-
return resolveExternalFileOrAbsolutePath(targetFileAbs, sourceRoot, outputModelsPath, absOutputModelsPath);
|
|
111
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy-request-adapter.d.ts","sourceRoot":"","sources":["../../../../src/templatesCompiled/client/core/legacy-request-adapter.ts"],"names":[],"mappings":";;;;;;AAMA,wBAUmC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// This is an automatically generated file for the hbs template.
|
|
4
|
-
// You don't need to change it, run npm run build:hbs to update it.
|
|
5
|
-
/* istanbul ignore file */
|
|
6
|
-
/* tslint: disable */
|
|
7
|
-
/* eslint: disable */
|
|
8
|
-
// @ts-nocheck
|
|
9
|
-
exports.default = { "compiler": [8, ">= 4.3.0"], "main": function (container, depth0, helpers, partials, data) {
|
|
10
|
-
var stack1, lookupProperty = container.lookupProperty || function (parent, propertyName) {
|
|
11
|
-
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
12
|
-
return parent[propertyName];
|
|
13
|
-
}
|
|
14
|
-
return undefined;
|
|
15
|
-
};
|
|
16
|
-
return ((stack1 = container.invokePartial(lookupProperty(partials, "header"), depth0, { "name": "header", "data": data, "helpers": helpers, "partials": partials, "decorators": container.decorators })) != null ? stack1 : "")
|
|
17
|
-
+ "\nimport type { RequestExecutor, RequestConfig } from './request-executor';\nimport type { ApiRequestOptions } from './ApiRequestOptions';\nimport type { TOpenAPIConfig } from './OpenAPI';\nimport { OpenAPI } from './OpenAPI';\nimport { request as __request } from './request';\n\n/**\n * Legacy RequestExecutor-адаптер поверх существующего request(ApiRequestOptions, OpenAPI).\n *\n * TOptions — тип рантайм-опций транспорта (IXHROptions, IFetchOptions и т.п.).\n * mapOptions — опциональная функция, которая мапит TOptions → часть ApiRequestOptions.\n */\nexport function createLegacyExecutor<TOptions = unknown>(\n openApiConfig: TOpenAPIConfig = OpenAPI,\n mapOptions?: (options: TOptions | undefined) => Partial<ApiRequestOptions>,\n): RequestExecutor<TOptions> {\n return {\n request<TResponse>(config: RequestConfig, options?: TOptions): Promise<TResponse> {\n const baseOptions: ApiRequestOptions = {\n method: config.method as ApiRequestOptions['method'],\n path: config.url, // RequestConfig.url → ApiRequestOptions.path\n headers: config.headers,\n query: config.query,\n body: config.body,\n };\n\n const mergedOptions: ApiRequestOptions = {\n ...baseOptions,\n ...(mapOptions ? mapOptions(options) : {}),\n };\n\n return __request<TResponse>(mergedOptions, openApiConfig);\n },\n };\n}";
|
|
18
|
-
}, "usePartial": true, "useData": true };
|
|
File without changes
|