@nestia/sdk 12.0.0-dev.20260601.1 → 12.0.0-dev.20260612.2
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/LICENSE +21 -21
- package/README.md +93 -93
- package/assets/bundle/api/HttpError.ts +1 -1
- package/assets/bundle/api/IConnection.ts +1 -1
- package/assets/bundle/api/Primitive.ts +1 -1
- package/assets/bundle/api/Resolved.ts +1 -1
- package/assets/bundle/api/index.ts +4 -4
- package/assets/bundle/api/module.ts +6 -6
- package/assets/bundle/distribute/README.md +37 -37
- package/assets/bundle/distribute/package.json +28 -28
- package/assets/bundle/distribute/tsconfig.json +109 -109
- package/assets/bundle/e2e/index.ts +42 -42
- package/assets/config/nestia.config.ts +97 -97
- package/lib/NestiaSdkApplication.js +29 -7
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.js +21 -13
- package/lib/NestiaSwaggerComposer.js.map +1 -1
- package/lib/analyses/AccessorAnalyzer.d.ts +4 -1
- package/lib/analyses/AccessorAnalyzer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.js +1 -1
- package/lib/analyses/PathAnalyzer.d.ts +18 -3
- package/lib/analyses/PathAnalyzer.js +32 -0
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.js +3 -2
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +53 -20
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +14 -0
- package/lib/analyses/ReflectMcpOperationAnalyzer.js +79 -0
- package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -0
- package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +9 -0
- package/lib/analyses/TypedMcpRouteAnalyzer.js +31 -0
- package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -0
- package/lib/executable/internal/NestiaConfigLoader.js +5 -1
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js +30 -14
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/internal/NestiaSdkWatcher.d.ts +10 -0
- package/lib/executable/internal/NestiaSdkWatcher.js +322 -0
- package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -0
- package/lib/executable/sdk.js +12 -12
- package/lib/executable/sdk.js.map +1 -1
- package/lib/generates/CloneGenerator.js +4 -2
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.js +50 -1
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.js +18 -2
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +3 -1
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +1 -0
- package/lib/generates/internal/ImportDictionary.js +9 -4
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +2 -0
- package/lib/generates/internal/SdkAliasCollection.js +11 -2
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +1 -0
- package/lib/generates/internal/SdkDistributionComposer.js +3 -0
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +4 -1
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.js +42 -9
- package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +3 -4
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +2 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +6 -3
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +15 -0
- package/lib/generates/internal/SdkMcpRouteProgrammer.js +148 -0
- package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -0
- package/lib/generates/internal/SdkRouteDirectory.d.ts +2 -1
- package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +6 -0
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +283 -0
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -0
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +11 -9
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +10 -2
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +6 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +9 -0
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +174 -0
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +1 -0
- package/lib/structures/INestiaSdkInput.d.ts +9 -2
- package/lib/structures/IReflectController.d.ts +2 -1
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +4 -2
- package/lib/structures/IReflectMcpOperation.d.ts +35 -0
- package/lib/structures/IReflectMcpOperation.js +3 -0
- package/lib/structures/IReflectMcpOperation.js.map +1 -0
- package/lib/structures/IReflectMcpOperationParameter.d.ts +19 -0
- package/lib/structures/IReflectMcpOperationParameter.js +3 -0
- package/lib/structures/IReflectMcpOperationParameter.js.map +1 -0
- package/lib/structures/ITypedApplication.d.ts +2 -1
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +3 -1
- package/lib/structures/ITypedMcpRoute.d.ts +31 -0
- package/lib/structures/ITypedMcpRoute.js +3 -0
- package/lib/structures/ITypedMcpRoute.js.map +1 -0
- package/lib/utils/HttpResponseContentTypeUtil.d.ts +5 -0
- package/lib/utils/HttpResponseContentTypeUtil.js +22 -0
- package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -0
- package/native/go.mod +52 -52
- package/native/go.sum +84 -54
- package/native/sdk/register.go +322 -165
- package/native/sdk/sdk.go +17 -17
- package/native/sdk/sdk_metadata_json.go +327 -327
- package/native/sdk/sdk_transform.go +1879 -1549
- package/package.json +11 -9
- package/src/INestiaConfig.ts +267 -267
- package/src/NestiaSdkApplication.ts +39 -8
- package/src/NestiaSwaggerComposer.ts +153 -142
- package/src/analyses/AccessorAnalyzer.ts +64 -67
- package/src/analyses/ConfigAnalyzer.ts +330 -330
- package/src/analyses/ImportAnalyzer.ts +92 -92
- package/src/analyses/PathAnalyzer.ts +130 -69
- package/src/analyses/ReflectControllerAnalyzer.ts +112 -105
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +183 -183
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +90 -90
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +350 -350
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +163 -130
- package/src/analyses/ReflectMcpOperationAnalyzer.ts +124 -0
- package/src/analyses/ReflectMetadataAnalyzer.ts +44 -44
- package/src/analyses/SecurityAnalyzer.ts +25 -25
- package/src/analyses/TypedMcpRouteAnalyzer.ts +34 -0
- package/src/decorators/OperationMetadata.ts +29 -29
- package/src/executable/internal/CommandParser.ts +15 -15
- package/src/executable/internal/NestiaConfigLoader.ts +451 -446
- package/src/executable/internal/NestiaSdkCommand.ts +124 -106
- package/src/executable/internal/NestiaSdkWatcher.ts +342 -0
- package/src/executable/sdk.ts +90 -88
- package/src/generates/CloneGenerator.ts +73 -66
- package/src/generates/E2eGenerator.ts +32 -32
- package/src/generates/SdkGenerator.ts +176 -118
- package/src/generates/SwaggerGenerator.ts +342 -310
- package/src/generates/internal/E2eFileProgrammer.ts +240 -233
- package/src/generates/internal/FilePrinter.ts +65 -65
- package/src/generates/internal/ImportDictionary.ts +209 -204
- package/src/generates/internal/SdkAliasCollection.ts +274 -261
- package/src/generates/internal/SdkDistributionComposer.ts +123 -116
- package/src/generates/internal/SdkFileProgrammer.ts +116 -112
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +126 -126
- package/src/generates/internal/SdkHttpCloneReferencer.ts +131 -77
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +301 -301
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +520 -510
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +165 -165
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +109 -109
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +331 -314
- package/src/generates/internal/SdkImportWizard.ts +62 -62
- package/src/generates/internal/SdkMcpRouteProgrammer.ts +452 -0
- package/src/generates/internal/SdkRouteDirectory.ts +21 -18
- package/src/generates/internal/SdkTypeTagProgrammer.ts +114 -114
- package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +319 -0
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +389 -389
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +89 -89
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +331 -323
- package/src/generates/internal/SwaggerDescriptionComposer.ts +64 -64
- package/src/generates/internal/SwaggerOperationComposer.ts +119 -119
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +175 -162
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +115 -110
- package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +262 -0
- package/src/index.ts +4 -4
- package/src/internal/legacy.ts +492 -492
- package/src/module.ts +4 -4
- package/src/structures/INestiaProject.ts +10 -10
- package/src/structures/INestiaSdkInput.ts +27 -20
- package/src/structures/IOperationMetadata.ts +41 -41
- package/src/structures/IReflectController.ts +18 -15
- package/src/structures/IReflectHttpOperation.ts +26 -26
- package/src/structures/IReflectHttpOperationException.ts +18 -18
- package/src/structures/IReflectHttpOperationParameter.ts +79 -79
- package/src/structures/IReflectHttpOperationSuccess.ts +18 -21
- package/src/structures/IReflectImport.ts +6 -6
- package/src/structures/IReflectMcpOperation.ts +38 -0
- package/src/structures/IReflectMcpOperationParameter.ts +27 -0
- package/src/structures/IReflectOperationError.ts +26 -26
- package/src/structures/IReflectType.ts +4 -4
- package/src/structures/IReflectWebSocketOperation.ts +17 -17
- package/src/structures/ITypedApplication.ts +12 -11
- package/src/structures/ITypedHttpRoute.ts +41 -41
- package/src/structures/ITypedHttpRouteException.ts +15 -15
- package/src/structures/ITypedHttpRouteParameter.ts +41 -41
- package/src/structures/ITypedHttpRouteSuccess.ts +18 -22
- package/src/structures/ITypedMcpRoute.ts +33 -0
- package/src/structures/ITypedWebSocketRoute.ts +24 -24
- package/src/structures/ITypedWebSocketRouteParameter.ts +3 -3
- package/src/transform.ts +59 -59
- package/src/typings/get-function-location.d.ts +7 -7
- package/src/utils/ArrayUtil.ts +26 -26
- package/src/utils/EmittedJavaScriptPatcher.ts +88 -88
- package/src/utils/FileRetriever.ts +22 -22
- package/src/utils/HttpResponseContentTypeUtil.ts +30 -0
- package/src/utils/MapUtil.ts +14 -14
- package/src/utils/PathUtil.ts +10 -10
- package/src/utils/SourceFinder.ts +63 -63
- package/src/utils/StringUtil.ts +17 -17
- package/src/utils/TsConfigReader.ts +108 -108
- package/src/utils/TtscExecutor.ts +68 -68
- package/src/utils/VersioningStrategy.ts +28 -28
- package/src/validators/HttpHeadersValidator.ts +11 -11
- package/src/validators/HttpQueryValidator.ts +11 -11
- package/src/validators/TextPlainValidator.ts +17 -17
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwaggerReadonlyArrayEmender = void 0;
|
|
4
|
+
var SwaggerReadonlyArrayEmender;
|
|
5
|
+
(function (SwaggerReadonlyArrayEmender) {
|
|
6
|
+
SwaggerReadonlyArrayEmender.emend = (props) => {
|
|
7
|
+
const visited = {
|
|
8
|
+
aliases: new WeakSet(),
|
|
9
|
+
arrays: new WeakSet(),
|
|
10
|
+
objects: new WeakSet(),
|
|
11
|
+
schemas: new WeakSet(),
|
|
12
|
+
tuples: new WeakSet(),
|
|
13
|
+
};
|
|
14
|
+
visitMetadata({
|
|
15
|
+
components: props.components,
|
|
16
|
+
schema: props.schema,
|
|
17
|
+
metadata: props.metadata,
|
|
18
|
+
visited,
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
})(SwaggerReadonlyArrayEmender || (exports.SwaggerReadonlyArrayEmender = SwaggerReadonlyArrayEmender = {}));
|
|
22
|
+
const visitMetadata = (props) => {
|
|
23
|
+
if (props.schema !== undefined && isReadonlyArrayLike(props.metadata))
|
|
24
|
+
setReadonlyArray(props.schema);
|
|
25
|
+
if (props.visited.schemas.has(props.metadata))
|
|
26
|
+
return;
|
|
27
|
+
props.visited.schemas.add(props.metadata);
|
|
28
|
+
for (const array of props.metadata.arrays) {
|
|
29
|
+
const type = array.type;
|
|
30
|
+
if (type !== undefined)
|
|
31
|
+
visitArrayType({
|
|
32
|
+
components: props.components,
|
|
33
|
+
schema: arraySchema(props.schema),
|
|
34
|
+
type,
|
|
35
|
+
visited: props.visited,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
for (const tuple of props.metadata.tuples) {
|
|
39
|
+
const type = tuple.type;
|
|
40
|
+
if (type !== undefined)
|
|
41
|
+
visitTupleType({
|
|
42
|
+
components: props.components,
|
|
43
|
+
schema: props.schema,
|
|
44
|
+
type,
|
|
45
|
+
visited: props.visited,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
for (const alias of props.metadata.aliases) {
|
|
49
|
+
const type = alias.type;
|
|
50
|
+
if (type !== undefined)
|
|
51
|
+
visitAliasType({
|
|
52
|
+
components: props.components,
|
|
53
|
+
schema: componentSchema(props.components, type.name),
|
|
54
|
+
type,
|
|
55
|
+
visited: props.visited,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
for (const object of props.metadata.objects) {
|
|
59
|
+
const type = object.type;
|
|
60
|
+
if (type !== undefined)
|
|
61
|
+
visitObjectType({
|
|
62
|
+
components: props.components,
|
|
63
|
+
type,
|
|
64
|
+
visited: props.visited,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const visitAliasType = (props) => {
|
|
69
|
+
if (props.visited.aliases.has(props.type))
|
|
70
|
+
return;
|
|
71
|
+
props.visited.aliases.add(props.type);
|
|
72
|
+
if (props.schema !== undefined && isReadonlyArrayLike(props.type.value))
|
|
73
|
+
setReadonlyArray(props.schema);
|
|
74
|
+
visitMetadata({
|
|
75
|
+
components: props.components,
|
|
76
|
+
schema: props.schema,
|
|
77
|
+
metadata: props.type.value,
|
|
78
|
+
visited: props.visited,
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const visitArrayType = (props) => {
|
|
82
|
+
var _a;
|
|
83
|
+
if (props.visited.arrays.has(props.type))
|
|
84
|
+
return;
|
|
85
|
+
props.visited.arrays.add(props.type);
|
|
86
|
+
const component = componentSchema(props.components, props.type.name);
|
|
87
|
+
if (component !== undefined && isReadonlyArrayName(props.type.name))
|
|
88
|
+
setReadonlyArray(component);
|
|
89
|
+
visitMetadata({
|
|
90
|
+
components: props.components,
|
|
91
|
+
schema: arraySchema((_a = props.schema) !== null && _a !== void 0 ? _a : component),
|
|
92
|
+
metadata: props.type.value,
|
|
93
|
+
visited: props.visited,
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
const visitTupleType = (props) => {
|
|
97
|
+
var _a;
|
|
98
|
+
if (props.visited.tuples.has(props.type))
|
|
99
|
+
return;
|
|
100
|
+
props.visited.tuples.add(props.type);
|
|
101
|
+
const component = componentSchema(props.components, props.type.name);
|
|
102
|
+
if (component !== undefined && isReadonlyArrayName(props.type.name))
|
|
103
|
+
setReadonlyArray(component);
|
|
104
|
+
const schema = objectSchema((_a = props.schema) !== null && _a !== void 0 ? _a : component);
|
|
105
|
+
props.type.elements.forEach((metadata, index) => visitMetadata({
|
|
106
|
+
components: props.components,
|
|
107
|
+
schema: Array.isArray(schema === null || schema === void 0 ? void 0 : schema.prefixItems)
|
|
108
|
+
? schema.prefixItems[index]
|
|
109
|
+
: undefined,
|
|
110
|
+
metadata,
|
|
111
|
+
visited: props.visited,
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
const visitObjectType = (props) => {
|
|
115
|
+
if (props.visited.objects.has(props.type))
|
|
116
|
+
return;
|
|
117
|
+
props.visited.objects.add(props.type);
|
|
118
|
+
const schema = objectSchema(componentSchema(props.components, props.type.name));
|
|
119
|
+
const properties = schema === null || schema === void 0 ? void 0 : schema.properties;
|
|
120
|
+
for (const property of props.type.properties) {
|
|
121
|
+
const key = propertyKey(property.key);
|
|
122
|
+
const child = key === undefined ? undefined : properties === null || properties === void 0 ? void 0 : properties[key];
|
|
123
|
+
visitMetadata({
|
|
124
|
+
components: props.components,
|
|
125
|
+
schema: child,
|
|
126
|
+
metadata: property.value,
|
|
127
|
+
visited: props.visited,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const isReadonlyArrayLike = (metadata, visited = new WeakSet()) => {
|
|
132
|
+
if (visited.has(metadata))
|
|
133
|
+
return false;
|
|
134
|
+
visited.add(metadata);
|
|
135
|
+
const name = metadata.name;
|
|
136
|
+
return ((typeof name === "string" && isReadonlyArrayName(name)) ||
|
|
137
|
+
metadata.arrays.some((array) => isReadonlyArrayName(array.name)) ||
|
|
138
|
+
metadata.tuples.some((tuple) => isReadonlyArrayName(tuple.name)) ||
|
|
139
|
+
metadata.aliases.some((alias) => {
|
|
140
|
+
const type = alias.type;
|
|
141
|
+
return type !== undefined && isReadonlyArrayLike(type.value, visited);
|
|
142
|
+
}));
|
|
143
|
+
};
|
|
144
|
+
const isReadonlyArrayName = (name) => {
|
|
145
|
+
const trimmed = name.trim();
|
|
146
|
+
const compact = name.replace(/\s+/g, "");
|
|
147
|
+
return (compact === "ReadonlyArray" ||
|
|
148
|
+
compact.startsWith("ReadonlyArray<") ||
|
|
149
|
+
compact.startsWith("readonly[") ||
|
|
150
|
+
trimmed.startsWith("readonly "));
|
|
151
|
+
};
|
|
152
|
+
const componentSchema = (components, name) => { var _a; return ((_a = components.schemas) !== null && _a !== void 0 ? _a : {})[name]; };
|
|
153
|
+
const arraySchema = (schema) => {
|
|
154
|
+
const obj = objectSchema(schema);
|
|
155
|
+
return obj === null || obj === void 0 ? void 0 : obj.items;
|
|
156
|
+
};
|
|
157
|
+
const objectSchema = (schema) => typeof schema === "object" && schema !== null
|
|
158
|
+
? schema
|
|
159
|
+
: undefined;
|
|
160
|
+
const propertyKey = (metadata) => {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
const value = (_b = (_a = metadata.constants[0]) === null || _a === void 0 ? void 0 : _a.values[0]) === null || _b === void 0 ? void 0 : _b.value;
|
|
163
|
+
return typeof value === "string"
|
|
164
|
+
? value
|
|
165
|
+
: typeof value === "number"
|
|
166
|
+
? String(value)
|
|
167
|
+
: undefined;
|
|
168
|
+
};
|
|
169
|
+
const setReadonlyArray = (schema) => {
|
|
170
|
+
const obj = objectSchema(schema);
|
|
171
|
+
if (obj !== undefined)
|
|
172
|
+
obj["x-readonly-array"] = true;
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=SwaggerReadonlyArrayEmender.js.map
|
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,0CAAE,MAAM,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC;IAC/D,OAAO,OAAO,KAAK,KAAK,QAAQ;QAC9B,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ;YACzB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YACf,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,MAA2B,EAAQ,EAAE;IAC7D,MAAM,GAAG,GAAiC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC/D,IAAI,GAAG,KAAK,SAAS;QAAE,GAAG,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RequestMethod } from "@nestjs/common";
|
|
2
|
+
import { VersionValue } from "@nestjs/common/interfaces";
|
|
2
3
|
export interface INestiaSdkInput {
|
|
3
4
|
controllers: INestiaSdkInput.IController[];
|
|
4
5
|
globalPrefix?: {
|
|
5
6
|
prefix: string;
|
|
6
|
-
exclude?:
|
|
7
|
+
exclude?: INestiaSdkInput.IGlobalPrefixExclude[];
|
|
7
8
|
};
|
|
8
9
|
versioning?: {
|
|
9
10
|
prefix: string;
|
|
@@ -16,4 +17,10 @@ export declare namespace INestiaSdkInput {
|
|
|
16
17
|
location: string;
|
|
17
18
|
prefixes: string[];
|
|
18
19
|
}
|
|
20
|
+
interface IGlobalPrefixExclude {
|
|
21
|
+
path: string;
|
|
22
|
+
method?: RequestMethod;
|
|
23
|
+
requestMethod?: RequestMethod;
|
|
24
|
+
pathRegex?: RegExp;
|
|
25
|
+
}
|
|
19
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { VERSION_NEUTRAL } from "@nestjs/common/interfaces";
|
|
2
2
|
import { IReflectHttpOperation } from "./IReflectHttpOperation";
|
|
3
|
+
import { IReflectMcpOperation } from "./IReflectMcpOperation";
|
|
3
4
|
import { IReflectWebSocketOperation } from "./IReflectWebSocketOperation";
|
|
4
5
|
export interface IReflectController {
|
|
5
6
|
class: Function;
|
|
@@ -7,7 +8,7 @@ export interface IReflectController {
|
|
|
7
8
|
paths: string[];
|
|
8
9
|
file: string;
|
|
9
10
|
versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
10
|
-
operations: Array<IReflectHttpOperation | IReflectWebSocketOperation>;
|
|
11
|
+
operations: Array<IReflectHttpOperation | IReflectWebSocketOperation | IReflectMcpOperation>;
|
|
11
12
|
security: Record<string, string[]>[];
|
|
12
13
|
tags: string[];
|
|
13
14
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { MetadataFactory } from "../internal/legacy";
|
|
2
1
|
import { IMetadataComponents, IMetadataSchema } from "@typia/interface";
|
|
2
|
+
import { MetadataFactory } from "../internal/legacy";
|
|
3
|
+
import { HttpResponseContentTypeUtil } from "../utils/HttpResponseContentTypeUtil";
|
|
3
4
|
import { IReflectType } from "./IReflectType";
|
|
4
5
|
export interface IReflectHttpOperationSuccess {
|
|
5
6
|
type: IReflectType;
|
|
6
7
|
status: number;
|
|
7
|
-
contentType:
|
|
8
|
+
contentType: HttpResponseContentTypeUtil.Response;
|
|
9
|
+
binary: boolean;
|
|
8
10
|
encrypted: boolean;
|
|
9
11
|
components: IMetadataComponents;
|
|
10
12
|
metadata: IMetadataSchema;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { IReflectImport } from "./IReflectImport";
|
|
3
|
+
import { IReflectMcpOperationParameter } from "./IReflectMcpOperationParameter";
|
|
4
|
+
import { IReflectType } from "./IReflectType";
|
|
5
|
+
/**
|
|
6
|
+
* Reflected operation metadata for a method decorated with `@McpRoute`.
|
|
7
|
+
*
|
|
8
|
+
* Produced by {@link ReflectMcpOperationAnalyzer.analyze}; consumed by
|
|
9
|
+
* {@link TypedMcpRouteAnalyzer.analyze} to produce the final
|
|
10
|
+
* {@link ITypedMcpRoute}.
|
|
11
|
+
*/
|
|
12
|
+
export interface IReflectMcpOperation {
|
|
13
|
+
protocol: "mcp";
|
|
14
|
+
name: string;
|
|
15
|
+
toolName: string;
|
|
16
|
+
title: string | null;
|
|
17
|
+
toolDescription: string | null;
|
|
18
|
+
inputSchema: object;
|
|
19
|
+
outputSchema: object | null;
|
|
20
|
+
annotations: IReflectMcpOperation.IAnnotations | null;
|
|
21
|
+
function: Function;
|
|
22
|
+
parameters: IReflectMcpOperationParameter[];
|
|
23
|
+
returnType: IReflectType | null;
|
|
24
|
+
imports: IReflectImport[];
|
|
25
|
+
description: string | null;
|
|
26
|
+
jsDocTags: ts.JSDocTagInfo[];
|
|
27
|
+
}
|
|
28
|
+
export declare namespace IReflectMcpOperation {
|
|
29
|
+
interface IAnnotations {
|
|
30
|
+
readOnlyHint?: boolean;
|
|
31
|
+
destructiveHint?: boolean;
|
|
32
|
+
idempotentHint?: boolean;
|
|
33
|
+
openWorldHint?: boolean;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IReflectMcpOperation.js","sourceRoot":"","sources":["../../src/structures/IReflectMcpOperation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { IReflectImport } from "./IReflectImport";
|
|
3
|
+
import { IReflectType } from "./IReflectType";
|
|
4
|
+
/**
|
|
5
|
+
* Parameter descriptor for an MCP tool method. Reflected from
|
|
6
|
+
* `"nestia/McpRoute/Parameters"` metadata plus compile-time type information
|
|
7
|
+
* collected by the nestia transformer.
|
|
8
|
+
*/
|
|
9
|
+
export interface IReflectMcpOperationParameter {
|
|
10
|
+
category: "params";
|
|
11
|
+
name: string;
|
|
12
|
+
index: number;
|
|
13
|
+
type: IReflectType;
|
|
14
|
+
imports: IReflectImport[];
|
|
15
|
+
description: string | null;
|
|
16
|
+
jsDocTags: IJsDocTagInfo[];
|
|
17
|
+
}
|
|
18
|
+
export declare namespace IReflectMcpOperationParameter {
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IReflectMcpOperationParameter.js","sourceRoot":"","sources":["../../src/structures/IReflectMcpOperationParameter.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { IMetadataDictionary } from "../internal/legacy";
|
|
2
2
|
import { INestiaProject } from "./INestiaProject";
|
|
3
3
|
import { ITypedHttpRoute } from "./ITypedHttpRoute";
|
|
4
|
+
import { ITypedMcpRoute } from "./ITypedMcpRoute";
|
|
4
5
|
import { ITypedWebSocketRoute } from "./ITypedWebSocketRoute";
|
|
5
6
|
export interface ITypedApplication {
|
|
6
7
|
project: INestiaProject;
|
|
7
8
|
collection: IMetadataDictionary;
|
|
8
|
-
routes: Array<ITypedHttpRoute | ITypedWebSocketRoute>;
|
|
9
|
+
routes: Array<ITypedHttpRoute | ITypedWebSocketRoute | ITypedMcpRoute>;
|
|
9
10
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { MetadataSchema } from "../internal/legacy";
|
|
2
|
+
import { HttpResponseContentTypeUtil } from "../utils/HttpResponseContentTypeUtil";
|
|
2
3
|
import { IReflectType } from "./IReflectType";
|
|
3
4
|
export interface ITypedHttpRouteSuccess {
|
|
4
5
|
type: IReflectType;
|
|
5
6
|
status: number | null;
|
|
6
|
-
contentType:
|
|
7
|
+
contentType: HttpResponseContentTypeUtil.Response;
|
|
8
|
+
binary: boolean;
|
|
7
9
|
encrypted: boolean;
|
|
8
10
|
metadata: MetadataSchema;
|
|
9
11
|
example?: any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { IReflectController } from "./IReflectController";
|
|
3
|
+
import { IReflectImport } from "./IReflectImport";
|
|
4
|
+
import { IReflectMcpOperation } from "./IReflectMcpOperation";
|
|
5
|
+
import { IReflectMcpOperationParameter } from "./IReflectMcpOperationParameter";
|
|
6
|
+
import { IReflectType } from "./IReflectType";
|
|
7
|
+
/**
|
|
8
|
+
* Final typed representation of an MCP tool route.
|
|
9
|
+
*
|
|
10
|
+
* Carries everything the SDK generator needs to emit a typed client function:
|
|
11
|
+
* the controller reference, accessor path, typia-derived input schema, and
|
|
12
|
+
* input/output type info.
|
|
13
|
+
*/
|
|
14
|
+
export interface ITypedMcpRoute {
|
|
15
|
+
protocol: "mcp";
|
|
16
|
+
controller: IReflectController;
|
|
17
|
+
name: string;
|
|
18
|
+
toolName: string;
|
|
19
|
+
title: string | null;
|
|
20
|
+
toolDescription: string | null;
|
|
21
|
+
accessor: string[];
|
|
22
|
+
function: Function;
|
|
23
|
+
input: IReflectMcpOperationParameter | null;
|
|
24
|
+
returnType: IReflectType | null;
|
|
25
|
+
inputSchema: object;
|
|
26
|
+
outputSchema: object | null;
|
|
27
|
+
annotations: IReflectMcpOperation.IAnnotations | null;
|
|
28
|
+
imports: IReflectImport[];
|
|
29
|
+
description: string | null;
|
|
30
|
+
jsDocTags: ts.JSDocTagInfo[];
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITypedMcpRoute.js","sourceRoot":"","sources":["../../src/structures/ITypedMcpRoute.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare namespace HttpResponseContentTypeUtil {
|
|
2
|
+
type Response = "application/json" | "text/plain" | "application/x-www-form-urlencoded" | (string & {}) | null;
|
|
3
|
+
const isSupported: (input: string | null) => input is Response;
|
|
4
|
+
const isBinary: (input: string | null | undefined) => input is string;
|
|
5
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpResponseContentTypeUtil = void 0;
|
|
4
|
+
var HttpResponseContentTypeUtil;
|
|
5
|
+
(function (HttpResponseContentTypeUtil) {
|
|
6
|
+
HttpResponseContentTypeUtil.isSupported = (input) => input === null ||
|
|
7
|
+
input === "application/json" ||
|
|
8
|
+
input === "text/plain" ||
|
|
9
|
+
input === "application/x-www-form-urlencoded" ||
|
|
10
|
+
HttpResponseContentTypeUtil.isBinary(input);
|
|
11
|
+
HttpResponseContentTypeUtil.isBinary = (input) => {
|
|
12
|
+
if (typeof input !== "string")
|
|
13
|
+
return false;
|
|
14
|
+
const value = input.split(";")[0].trim().toLowerCase();
|
|
15
|
+
return (value.startsWith("image/") ||
|
|
16
|
+
value.startsWith("video/") ||
|
|
17
|
+
value.startsWith("audio/") ||
|
|
18
|
+
value === "application/octet-stream" ||
|
|
19
|
+
value === "application/pdf");
|
|
20
|
+
};
|
|
21
|
+
})(HttpResponseContentTypeUtil || (exports.HttpResponseContentTypeUtil = HttpResponseContentTypeUtil = {}));
|
|
22
|
+
//# sourceMappingURL=HttpResponseContentTypeUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpResponseContentTypeUtil.js","sourceRoot":"","sources":["../../src/utils/HttpResponseContentTypeUtil.ts"],"names":[],"mappings":";;;AAAA,IAAiB,2BAA2B,CA6B3C;AA7BD,WAAiB,2BAA2B;IAQ7B,uCAAW,GAAG,CAAC,KAAoB,EAAqB,EAAE,CACrE,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,kBAAkB;QAC5B,KAAK,KAAK,YAAY;QACtB,KAAK,KAAK,mCAAmC;QAC7C,oCAAQ,CAAC,KAAK,CAAC,CAAC;IAEL,oCAAQ,GAAG,CACtB,KAAgC,EACf,EAAE;QACnB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAE5C,MAAM,KAAK,GAAW,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAChE,OAAO,CACL,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC1B,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC1B,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC1B,KAAK,KAAK,0BAA0B;YACpC,KAAK,KAAK,iBAAiB,CAC5B,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EA7BgB,2BAA2B,aAA3B,2BAA2B,GAA3B,2BAA2B,QA6B3C"}
|
package/native/go.mod
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
module github.com/samchon/nestia/packages/sdk/native
|
|
2
|
-
|
|
3
|
-
go 1.26
|
|
4
|
-
|
|
5
|
-
require (
|
|
6
|
-
github.com/microsoft/typescript-go/shim/ast v0.0.0
|
|
7
|
-
github.com/microsoft/typescript-go/shim/checker v0.0.0
|
|
8
|
-
github.com/microsoft/typescript-go/shim/
|
|
9
|
-
github.com/
|
|
10
|
-
github.com/samchon/
|
|
11
|
-
github.com/samchon/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
github.com/
|
|
17
|
-
github.com/
|
|
18
|
-
github.com/microsoft/typescript-go
|
|
19
|
-
github.com/microsoft/typescript-go/shim/
|
|
20
|
-
github.com/microsoft/typescript-go/shim/
|
|
21
|
-
github.com/microsoft/typescript-go/shim/
|
|
22
|
-
github.com/microsoft/typescript-go/shim/
|
|
23
|
-
github.com/microsoft/typescript-go/shim/
|
|
24
|
-
github.com/microsoft/typescript-go/shim/tsoptions v0.0.0 // indirect
|
|
25
|
-
github.com/microsoft/typescript-go/shim/tspath v0.0.0 // indirect
|
|
26
|
-
github.com/microsoft/typescript-go/shim/vfs v0.0.0 // indirect
|
|
27
|
-
github.com/microsoft/typescript-go/shim/vfs/cachedvfs v0.0.0 // indirect
|
|
28
|
-
github.com/microsoft/typescript-go/shim/vfs/osvfs v0.0.0 // indirect
|
|
29
|
-
github.com/zeebo/xxh3 v1.1.0 // indirect
|
|
30
|
-
golang.org/x/sync v0.20.0 // indirect
|
|
31
|
-
golang.org/x/sys v0.43.0 // indirect
|
|
32
|
-
golang.org/x/text v0.36.0 // indirect
|
|
33
|
-
)
|
|
34
|
-
|
|
35
|
-
replace (
|
|
36
|
-
github.com/microsoft/typescript-go/shim/ast => github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-
|
|
37
|
-
github.com/microsoft/typescript-go/shim/bundled => github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-
|
|
38
|
-
github.com/microsoft/typescript-go/shim/checker => github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-
|
|
39
|
-
github.com/microsoft/typescript-go/shim/compiler => github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-
|
|
40
|
-
github.com/microsoft/typescript-go/shim/core => github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-
|
|
41
|
-
github.com/microsoft/typescript-go/shim/diagnosticwriter => github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-
|
|
42
|
-
github.com/microsoft/typescript-go/shim/parser => github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-
|
|
43
|
-
github.com/microsoft/typescript-go/shim/printer => github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-
|
|
44
|
-
github.com/microsoft/typescript-go/shim/scanner => github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-
|
|
45
|
-
github.com/microsoft/typescript-go/shim/tsoptions => github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-
|
|
46
|
-
github.com/microsoft/typescript-go/shim/tspath => github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-
|
|
47
|
-
github.com/microsoft/typescript-go/shim/vfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-
|
|
48
|
-
github.com/microsoft/typescript-go/shim/vfs/cachedvfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-
|
|
49
|
-
github.com/microsoft/typescript-go/shim/vfs/osvfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-
|
|
50
|
-
github.com/samchon/nestia/packages/core/native => ../../core/native
|
|
51
|
-
github.com/samchon/ttsc/packages/ttsc v0.0.0 => github.com/samchon/ttsc/packages/ttsc v0.0.0-
|
|
52
|
-
)
|
|
1
|
+
module github.com/samchon/nestia/packages/sdk/native
|
|
2
|
+
|
|
3
|
+
go 1.26
|
|
4
|
+
|
|
5
|
+
require (
|
|
6
|
+
github.com/microsoft/typescript-go/shim/ast v0.0.0
|
|
7
|
+
github.com/microsoft/typescript-go/shim/checker v0.0.0
|
|
8
|
+
github.com/microsoft/typescript-go/shim/printer v0.0.0
|
|
9
|
+
github.com/microsoft/typescript-go/shim/scanner v0.0.0
|
|
10
|
+
github.com/samchon/nestia/packages/core/native v0.0.0
|
|
11
|
+
github.com/samchon/ttsc/packages/ttsc v0.0.0
|
|
12
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20260605060028-1dfa7ca6193e
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
require (
|
|
16
|
+
github.com/go-json-experiment/json v0.0.0-20260214004413-d219187c3433 // indirect
|
|
17
|
+
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
|
18
|
+
github.com/microsoft/typescript-go v0.0.0-20260429010842-56ab4af42157 // indirect
|
|
19
|
+
github.com/microsoft/typescript-go/shim/bundled v0.0.0 // indirect
|
|
20
|
+
github.com/microsoft/typescript-go/shim/compiler v0.0.0 // indirect
|
|
21
|
+
github.com/microsoft/typescript-go/shim/core v0.0.0 // indirect
|
|
22
|
+
github.com/microsoft/typescript-go/shim/diagnosticwriter v0.0.0 // indirect
|
|
23
|
+
github.com/microsoft/typescript-go/shim/parser v0.0.0 // indirect
|
|
24
|
+
github.com/microsoft/typescript-go/shim/tsoptions v0.0.0 // indirect
|
|
25
|
+
github.com/microsoft/typescript-go/shim/tspath v0.0.0 // indirect
|
|
26
|
+
github.com/microsoft/typescript-go/shim/vfs v0.0.0 // indirect
|
|
27
|
+
github.com/microsoft/typescript-go/shim/vfs/cachedvfs v0.0.0 // indirect
|
|
28
|
+
github.com/microsoft/typescript-go/shim/vfs/osvfs v0.0.0 // indirect
|
|
29
|
+
github.com/zeebo/xxh3 v1.1.0 // indirect
|
|
30
|
+
golang.org/x/sync v0.20.0 // indirect
|
|
31
|
+
golang.org/x/sys v0.43.0 // indirect
|
|
32
|
+
golang.org/x/text v0.36.0 // indirect
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
replace (
|
|
36
|
+
github.com/microsoft/typescript-go/shim/ast => github.com/samchon/ttsc/packages/ttsc/shim/ast v0.0.0-20260605102019-02361f943e18
|
|
37
|
+
github.com/microsoft/typescript-go/shim/bundled => github.com/samchon/ttsc/packages/ttsc/shim/bundled v0.0.0-20260605102019-02361f943e18
|
|
38
|
+
github.com/microsoft/typescript-go/shim/checker => github.com/samchon/ttsc/packages/ttsc/shim/checker v0.0.0-20260605102019-02361f943e18
|
|
39
|
+
github.com/microsoft/typescript-go/shim/compiler => github.com/samchon/ttsc/packages/ttsc/shim/compiler v0.0.0-20260605102019-02361f943e18
|
|
40
|
+
github.com/microsoft/typescript-go/shim/core => github.com/samchon/ttsc/packages/ttsc/shim/core v0.0.0-20260605102019-02361f943e18
|
|
41
|
+
github.com/microsoft/typescript-go/shim/diagnosticwriter => github.com/samchon/ttsc/packages/ttsc/shim/diagnosticwriter v0.0.0-20260605102019-02361f943e18
|
|
42
|
+
github.com/microsoft/typescript-go/shim/parser => github.com/samchon/ttsc/packages/ttsc/shim/parser v0.0.0-20260605102019-02361f943e18
|
|
43
|
+
github.com/microsoft/typescript-go/shim/printer => github.com/samchon/ttsc/packages/ttsc/shim/printer v0.0.0-20260605102019-02361f943e18
|
|
44
|
+
github.com/microsoft/typescript-go/shim/scanner => github.com/samchon/ttsc/packages/ttsc/shim/scanner v0.0.0-20260605102019-02361f943e18
|
|
45
|
+
github.com/microsoft/typescript-go/shim/tsoptions => github.com/samchon/ttsc/packages/ttsc/shim/tsoptions v0.0.0-20260605102019-02361f943e18
|
|
46
|
+
github.com/microsoft/typescript-go/shim/tspath => github.com/samchon/ttsc/packages/ttsc/shim/tspath v0.0.0-20260605102019-02361f943e18
|
|
47
|
+
github.com/microsoft/typescript-go/shim/vfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs v0.0.0-20260605102019-02361f943e18
|
|
48
|
+
github.com/microsoft/typescript-go/shim/vfs/cachedvfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20260605102019-02361f943e18
|
|
49
|
+
github.com/microsoft/typescript-go/shim/vfs/osvfs => github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20260605102019-02361f943e18
|
|
50
|
+
github.com/samchon/nestia/packages/core/native => ../../core/native
|
|
51
|
+
github.com/samchon/ttsc/packages/ttsc v0.0.0 => github.com/samchon/ttsc/packages/ttsc v0.0.0-20260605102019-02361f943e18
|
|
52
|
+
)
|