@typia/interface 12.0.0-dev.20260307-2 → 12.0.0-dev.20260310
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/lib/http/IHttpLlmController.d.ts +5 -5
- package/lib/schema/IJsonParseResult.d.ts +1 -3
- package/lib/schema/ILlmApplication.d.ts +1 -1
- package/lib/schema/ILlmController.d.ts +2 -5
- package/lib/schema/ILlmFunction.d.ts +35 -9
- package/package.json +1 -1
- package/src/http/IHttpConnection.ts +200 -200
- package/src/http/IHttpLlmApplication.ts +72 -72
- package/src/http/IHttpLlmController.ts +96 -96
- package/src/http/IHttpLlmFunction.ts +34 -34
- package/src/http/IHttpMigrateApplication.ts +48 -48
- package/src/http/IHttpMigrateRoute.ts +165 -165
- package/src/http/IHttpResponse.ts +42 -42
- package/src/http/index.ts +7 -7
- package/src/index.ts +9 -9
- package/src/metadata/IJsDocTagInfo.ts +25 -25
- package/src/metadata/IMetadataComponents.ts +24 -24
- package/src/metadata/IMetadataSchema.ts +293 -293
- package/src/metadata/IMetadataSchemaCollection.ts +20 -20
- package/src/metadata/IMetadataSchemaUnit.ts +20 -20
- package/src/metadata/IMetadataTypeTag.ts +39 -39
- package/src/metadata/index.ts +6 -6
- package/src/openapi/OpenApi.ts +643 -643
- package/src/openapi/OpenApiV3.ts +655 -655
- package/src/openapi/OpenApiV3_1.ts +735 -735
- package/src/openapi/SwaggerV2.ts +559 -559
- package/src/openapi/index.ts +4 -4
- package/src/protobuf/ProtobufWire.ts +51 -51
- package/src/protobuf/index.ts +1 -1
- package/src/schema/IJsonParseResult.ts +134 -136
- package/src/schema/IJsonSchemaApplication.ts +274 -274
- package/src/schema/IJsonSchemaAttribute.ts +158 -158
- package/src/schema/IJsonSchemaCollection.ts +123 -123
- package/src/schema/IJsonSchemaTransformError.ts +86 -86
- package/src/schema/IJsonSchemaUnit.ts +120 -120
- package/src/schema/ILlmApplication.ts +99 -99
- package/src/schema/ILlmController.ts +54 -57
- package/src/schema/ILlmFunction.ts +145 -118
- package/src/schema/ILlmSchema.ts +484 -484
- package/src/schema/IResult.ts +84 -84
- package/src/schema/IValidation.ts +134 -134
- package/src/schema/index.ts +14 -14
- package/src/tags/Constant.ts +49 -49
- package/src/tags/ContentMediaType.ts +40 -40
- package/src/tags/Default.ts +50 -50
- package/src/tags/Example.ts +48 -48
- package/src/tags/Examples.ts +50 -50
- package/src/tags/ExclusiveMaximum.ts +46 -46
- package/src/tags/ExclusiveMinimum.ts +46 -46
- package/src/tags/Format.ts +76 -76
- package/src/tags/JsonSchemaPlugin.ts +45 -45
- package/src/tags/MaxItems.ts +39 -39
- package/src/tags/MaxLength.ts +37 -37
- package/src/tags/Maximum.ts +44 -44
- package/src/tags/MinItems.ts +39 -39
- package/src/tags/MinLength.ts +37 -37
- package/src/tags/Minimum.ts +44 -44
- package/src/tags/MultipleOf.ts +54 -54
- package/src/tags/Pattern.ts +59 -59
- package/src/tags/Sequence.ts +43 -43
- package/src/tags/TagBase.ts +131 -131
- package/src/tags/Type.ts +70 -70
- package/src/tags/UniqueItems.ts +44 -44
- package/src/tags/index.ts +21 -21
- package/src/typings/AssertionGuard.ts +12 -12
- package/src/typings/Atomic.ts +21 -21
- package/src/typings/CamelCase.ts +75 -75
- package/src/typings/ClassProperties.ts +15 -15
- package/src/typings/DeepPartial.ts +39 -39
- package/src/typings/OmitNever.ts +12 -12
- package/src/typings/PascalCase.ts +71 -71
- package/src/typings/Primitive.ts +71 -71
- package/src/typings/ProtobufAtomic.ts +30 -30
- package/src/typings/Resolved.ts +58 -58
- package/src/typings/SnakeCase.ts +126 -126
- package/src/typings/SpecialFields.ts +13 -13
- package/src/typings/ValidationPipe.ts +20 -20
- package/src/typings/index.ts +14 -14
- package/src/typings/internal/Equal.ts +14 -14
- package/src/typings/internal/IsTuple.ts +17 -17
- package/src/typings/internal/NativeClass.ts +31 -31
- package/src/typings/internal/ValueOf.ts +29 -29
- package/src/utils/IRandomGenerator.ts +105 -105
- package/src/utils/IReadableURLSearchParams.ts +25 -25
- package/src/utils/index.ts +2 -2
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
-
import { ILlmSchema } from "../schema/ILlmSchema";
|
|
3
|
-
import { IHttpLlmFunction } from "./IHttpLlmFunction";
|
|
4
|
-
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* LLM function calling application from OpenAPI document.
|
|
8
|
-
*
|
|
9
|
-
* `IHttpLlmApplication` is a collection of {@link IHttpLlmFunction} schemas
|
|
10
|
-
* converted from {@link OpenApi.IDocument} by `HttpLlm.application()`. Each
|
|
11
|
-
* OpenAPI operation becomes an LLM-callable function.
|
|
12
|
-
*
|
|
13
|
-
* Successful conversions go to {@link functions}, failed ones to {@link errors}
|
|
14
|
-
* with detailed error messages. Common failure causes:
|
|
15
|
-
*
|
|
16
|
-
* - Unsupported schema features (tuples, `oneOf` with incompatible types)
|
|
17
|
-
* - Missing required fields in OpenAPI document
|
|
18
|
-
* - Operations marked with `x-samchon-human: true`
|
|
19
|
-
*
|
|
20
|
-
* Configure behavior via {@link IHttpLlmApplication.IConfig}:
|
|
21
|
-
*
|
|
22
|
-
* - {@link IHttpLlmApplication.IConfig.maxLength}: Function name length limit
|
|
23
|
-
* - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
|
|
24
|
-
*
|
|
25
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
26
|
-
*/
|
|
27
|
-
export interface IHttpLlmApplication {
|
|
28
|
-
/** Successfully converted LLM function schemas. */
|
|
29
|
-
functions: IHttpLlmFunction[];
|
|
30
|
-
|
|
31
|
-
/** Operations that failed conversion. */
|
|
32
|
-
errors: IHttpLlmApplication.IError[];
|
|
33
|
-
|
|
34
|
-
/** Configuration used for composition. */
|
|
35
|
-
config: IHttpLlmApplication.IConfig;
|
|
36
|
-
}
|
|
37
|
-
export namespace IHttpLlmApplication {
|
|
38
|
-
/** Configuration for HTTP LLM application composition. */
|
|
39
|
-
export interface IConfig extends ILlmSchema.IConfig {
|
|
40
|
-
/**
|
|
41
|
-
* Maximum function name length. Truncated or UUID if exceeded.
|
|
42
|
-
*
|
|
43
|
-
* @default 64
|
|
44
|
-
*/
|
|
45
|
-
maxLength: number;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Whether to disallow superfluous properties.
|
|
49
|
-
*
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
|
-
equals: boolean;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Composition error for an operation. */
|
|
56
|
-
export interface IError {
|
|
57
|
-
/** HTTP method of the failed operation. */
|
|
58
|
-
method: "get" | "post" | "put" | "patch" | "delete" | "head";
|
|
59
|
-
|
|
60
|
-
/** Path of the failed operation. */
|
|
61
|
-
path: string;
|
|
62
|
-
|
|
63
|
-
/** Error messages describing the failure. */
|
|
64
|
-
messages: string[];
|
|
65
|
-
|
|
66
|
-
/** Returns source {@link OpenApi.IOperation}. */
|
|
67
|
-
operation: () => OpenApi.IOperation;
|
|
68
|
-
|
|
69
|
-
/** Returns source route. Undefined if error occurred at migration level. */
|
|
70
|
-
route: () => IHttpMigrateRoute | undefined;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
1
|
+
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
+
import { ILlmSchema } from "../schema/ILlmSchema";
|
|
3
|
+
import { IHttpLlmFunction } from "./IHttpLlmFunction";
|
|
4
|
+
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* LLM function calling application from OpenAPI document.
|
|
8
|
+
*
|
|
9
|
+
* `IHttpLlmApplication` is a collection of {@link IHttpLlmFunction} schemas
|
|
10
|
+
* converted from {@link OpenApi.IDocument} by `HttpLlm.application()`. Each
|
|
11
|
+
* OpenAPI operation becomes an LLM-callable function.
|
|
12
|
+
*
|
|
13
|
+
* Successful conversions go to {@link functions}, failed ones to {@link errors}
|
|
14
|
+
* with detailed error messages. Common failure causes:
|
|
15
|
+
*
|
|
16
|
+
* - Unsupported schema features (tuples, `oneOf` with incompatible types)
|
|
17
|
+
* - Missing required fields in OpenAPI document
|
|
18
|
+
* - Operations marked with `x-samchon-human: true`
|
|
19
|
+
*
|
|
20
|
+
* Configure behavior via {@link IHttpLlmApplication.IConfig}:
|
|
21
|
+
*
|
|
22
|
+
* - {@link IHttpLlmApplication.IConfig.maxLength}: Function name length limit
|
|
23
|
+
* - {@link ILlmSchema.IConfig.strict}: OpenAI structured output mode
|
|
24
|
+
*
|
|
25
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
26
|
+
*/
|
|
27
|
+
export interface IHttpLlmApplication {
|
|
28
|
+
/** Successfully converted LLM function schemas. */
|
|
29
|
+
functions: IHttpLlmFunction[];
|
|
30
|
+
|
|
31
|
+
/** Operations that failed conversion. */
|
|
32
|
+
errors: IHttpLlmApplication.IError[];
|
|
33
|
+
|
|
34
|
+
/** Configuration used for composition. */
|
|
35
|
+
config: IHttpLlmApplication.IConfig;
|
|
36
|
+
}
|
|
37
|
+
export namespace IHttpLlmApplication {
|
|
38
|
+
/** Configuration for HTTP LLM application composition. */
|
|
39
|
+
export interface IConfig extends ILlmSchema.IConfig {
|
|
40
|
+
/**
|
|
41
|
+
* Maximum function name length. Truncated or UUID if exceeded.
|
|
42
|
+
*
|
|
43
|
+
* @default 64
|
|
44
|
+
*/
|
|
45
|
+
maxLength: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Whether to disallow superfluous properties.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
equals: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Composition error for an operation. */
|
|
56
|
+
export interface IError {
|
|
57
|
+
/** HTTP method of the failed operation. */
|
|
58
|
+
method: "get" | "post" | "put" | "patch" | "delete" | "head";
|
|
59
|
+
|
|
60
|
+
/** Path of the failed operation. */
|
|
61
|
+
path: string;
|
|
62
|
+
|
|
63
|
+
/** Error messages describing the failure. */
|
|
64
|
+
messages: string[];
|
|
65
|
+
|
|
66
|
+
/** Returns source {@link OpenApi.IOperation}. */
|
|
67
|
+
operation: () => OpenApi.IOperation;
|
|
68
|
+
|
|
69
|
+
/** Returns source route. Undefined if error occurred at migration level. */
|
|
70
|
+
route: () => IHttpMigrateRoute | undefined;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { IHttpConnection } from "./IHttpConnection";
|
|
2
|
-
import { IHttpLlmApplication } from "./IHttpLlmApplication";
|
|
3
|
-
import { IHttpLlmFunction } from "./IHttpLlmFunction";
|
|
4
|
-
import { IHttpResponse } from "./IHttpResponse";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Controller of HTTP LLM function calling.
|
|
8
|
-
*
|
|
9
|
-
* `IHttpLlmController` is a controller for registering OpenAPI operations as
|
|
10
|
-
* LLM function calling tools. It contains {@link IHttpLlmApplication} with
|
|
11
|
-
* {@link IHttpLlmFunction function calling schemas}, {@link name identifier},
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* You can create this controller with {@link HttpLlm.controller} function,
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
|
-
* import {
|
|
20
|
-
* import {
|
|
21
|
-
*
|
|
22
|
-
* const server = new McpServer({ name: "my-server", version: "1.0.0" });
|
|
23
|
-
* registerMcpControllers({
|
|
24
|
-
* server,
|
|
25
|
-
* controllers: [
|
|
26
|
-
* HttpLlm.controller({
|
|
27
|
-
* name: "shopping",
|
|
28
|
-
* document: await fetch(
|
|
29
|
-
* "https://shopping-be.wrtn.io/editor/swagger.json",
|
|
30
|
-
* ).then((r) => r.json()),
|
|
31
|
-
* connection: {
|
|
32
|
-
* host: "https://shopping-be.wrtn.io",
|
|
33
|
-
* headers: {
|
|
34
|
-
* Authorization: "Bearer ********",
|
|
35
|
-
* },
|
|
36
|
-
* },
|
|
37
|
-
* }),
|
|
38
|
-
* ],
|
|
39
|
-
* });
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* For TypeScript class-based controller, use {@link ILlmController} instead.
|
|
43
|
-
*
|
|
44
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
45
|
-
*/
|
|
46
|
-
export interface IHttpLlmController {
|
|
47
|
-
/** Protocol discriminator. */
|
|
48
|
-
protocol: "http";
|
|
49
|
-
|
|
50
|
-
/** Identifier name of the controller. */
|
|
51
|
-
name: string;
|
|
52
|
-
|
|
53
|
-
/** Application schema of function calling. */
|
|
54
|
-
application: IHttpLlmApplication;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Connection to the server.
|
|
58
|
-
*
|
|
59
|
-
* Connection to the API server including the URL and headers.
|
|
60
|
-
*/
|
|
61
|
-
connection: IHttpConnection;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Executor of the API function.
|
|
65
|
-
*
|
|
66
|
-
* Default executor is {@link HttpLlm.execute} function, and you can override
|
|
67
|
-
* it with your own function.
|
|
68
|
-
*
|
|
69
|
-
* @param props Properties of the API function call
|
|
70
|
-
* @returns HTTP response of the API function call
|
|
71
|
-
*/
|
|
72
|
-
execute?:
|
|
73
|
-
| undefined
|
|
74
|
-
| ((props: {
|
|
75
|
-
/** Connection to the server. */
|
|
76
|
-
connection: IHttpConnection;
|
|
77
|
-
|
|
78
|
-
/** Application schema. */
|
|
79
|
-
application: IHttpLlmApplication;
|
|
80
|
-
|
|
81
|
-
/** Function schema. */
|
|
82
|
-
function: IHttpLlmFunction;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Arguments of the function calling.
|
|
86
|
-
*
|
|
87
|
-
* It is an object of key-value pairs of the API function's parameters.
|
|
88
|
-
* The property keys are composed by below rules:
|
|
89
|
-
*
|
|
90
|
-
* - Parameter names
|
|
91
|
-
* - Query parameter as an object type if exists
|
|
92
|
-
* - Body parameter if exists
|
|
93
|
-
*/
|
|
94
|
-
arguments: object;
|
|
95
|
-
}) => Promise<IHttpResponse>);
|
|
96
|
-
}
|
|
1
|
+
import { IHttpConnection } from "./IHttpConnection";
|
|
2
|
+
import { IHttpLlmApplication } from "./IHttpLlmApplication";
|
|
3
|
+
import { IHttpLlmFunction } from "./IHttpLlmFunction";
|
|
4
|
+
import { IHttpResponse } from "./IHttpResponse";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Controller of HTTP LLM function calling.
|
|
8
|
+
*
|
|
9
|
+
* `IHttpLlmController` is a controller for registering OpenAPI operations as
|
|
10
|
+
* LLM function calling tools. It contains {@link IHttpLlmApplication} with
|
|
11
|
+
* {@link IHttpLlmFunction function calling schemas}, {@link name identifier}, and
|
|
12
|
+
* {@link connection} to the API server.
|
|
13
|
+
*
|
|
14
|
+
* You can create this controller with {@link HttpLlm.controller} function, and
|
|
15
|
+
* register it to MCP server with {@link registerMcpControllers}:
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
|
+
* import { registerMcpControllers } from "@typia/mcp";
|
|
20
|
+
* import { HttpLlm } from "@typia/utils";
|
|
21
|
+
*
|
|
22
|
+
* const server = new McpServer({ name: "my-server", version: "1.0.0" });
|
|
23
|
+
* registerMcpControllers({
|
|
24
|
+
* server,
|
|
25
|
+
* controllers: [
|
|
26
|
+
* HttpLlm.controller({
|
|
27
|
+
* name: "shopping",
|
|
28
|
+
* document: await fetch(
|
|
29
|
+
* "https://shopping-be.wrtn.io/editor/swagger.json",
|
|
30
|
+
* ).then((r) => r.json()),
|
|
31
|
+
* connection: {
|
|
32
|
+
* host: "https://shopping-be.wrtn.io",
|
|
33
|
+
* headers: {
|
|
34
|
+
* Authorization: "Bearer ********",
|
|
35
|
+
* },
|
|
36
|
+
* },
|
|
37
|
+
* }),
|
|
38
|
+
* ],
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* For TypeScript class-based controller, use {@link ILlmController} instead.
|
|
43
|
+
*
|
|
44
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
45
|
+
*/
|
|
46
|
+
export interface IHttpLlmController {
|
|
47
|
+
/** Protocol discriminator. */
|
|
48
|
+
protocol: "http";
|
|
49
|
+
|
|
50
|
+
/** Identifier name of the controller. */
|
|
51
|
+
name: string;
|
|
52
|
+
|
|
53
|
+
/** Application schema of function calling. */
|
|
54
|
+
application: IHttpLlmApplication;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Connection to the server.
|
|
58
|
+
*
|
|
59
|
+
* Connection to the API server including the URL and headers.
|
|
60
|
+
*/
|
|
61
|
+
connection: IHttpConnection;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Executor of the API function.
|
|
65
|
+
*
|
|
66
|
+
* Default executor is {@link HttpLlm.execute} function, and you can override
|
|
67
|
+
* it with your own function.
|
|
68
|
+
*
|
|
69
|
+
* @param props Properties of the API function call
|
|
70
|
+
* @returns HTTP response of the API function call
|
|
71
|
+
*/
|
|
72
|
+
execute?:
|
|
73
|
+
| undefined
|
|
74
|
+
| ((props: {
|
|
75
|
+
/** Connection to the server. */
|
|
76
|
+
connection: IHttpConnection;
|
|
77
|
+
|
|
78
|
+
/** Application schema. */
|
|
79
|
+
application: IHttpLlmApplication;
|
|
80
|
+
|
|
81
|
+
/** Function schema. */
|
|
82
|
+
function: IHttpLlmFunction;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Arguments of the function calling.
|
|
86
|
+
*
|
|
87
|
+
* It is an object of key-value pairs of the API function's parameters.
|
|
88
|
+
* The property keys are composed by below rules:
|
|
89
|
+
*
|
|
90
|
+
* - Parameter names
|
|
91
|
+
* - Query parameter as an object type if exists
|
|
92
|
+
* - Body parameter if exists
|
|
93
|
+
*/
|
|
94
|
+
arguments: object;
|
|
95
|
+
}) => Promise<IHttpResponse>);
|
|
96
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
-
import { ILlmFunction } from "../schema/ILlmFunction";
|
|
3
|
-
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* LLM function calling schema from OpenAPI operation.
|
|
7
|
-
*
|
|
8
|
-
* Extends {@link ILlmFunction} with HTTP-specific properties. Generated from
|
|
9
|
-
* {@link OpenApi.IOperation} as part of {@link IHttpLlmApplication}.
|
|
10
|
-
*
|
|
11
|
-
* - {@link method}, {@link path}: HTTP endpoint info
|
|
12
|
-
* - {@link operation}: Source OpenAPI operation
|
|
13
|
-
* - {@link route}: Source migration route
|
|
14
|
-
*
|
|
15
|
-
* Inherits {@link parse} and {@link validate} from {@link ILlmFunction}.
|
|
16
|
-
*
|
|
17
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
18
|
-
*/
|
|
19
|
-
export interface IHttpLlmFunction extends ILlmFunction {
|
|
20
|
-
/** HTTP method of the endpoint. */
|
|
21
|
-
method: "get" | "post" | "patch" | "put" | "delete";
|
|
22
|
-
|
|
23
|
-
/** Path of the endpoint. */
|
|
24
|
-
path: string;
|
|
25
|
-
|
|
26
|
-
/** Category tags from {@link OpenApi.IOperation.tags}. */
|
|
27
|
-
tags?: string[];
|
|
28
|
-
|
|
29
|
-
/** Returns the source {@link OpenApi.IOperation}. */
|
|
30
|
-
operation: () => OpenApi.IOperation;
|
|
31
|
-
|
|
32
|
-
/** Returns the source {@link IHttpMigrateRoute}. */
|
|
33
|
-
route: () => IHttpMigrateRoute;
|
|
34
|
-
}
|
|
1
|
+
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
+
import { ILlmFunction } from "../schema/ILlmFunction";
|
|
3
|
+
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* LLM function calling schema from OpenAPI operation.
|
|
7
|
+
*
|
|
8
|
+
* Extends {@link ILlmFunction} with HTTP-specific properties. Generated from
|
|
9
|
+
* {@link OpenApi.IOperation} as part of {@link IHttpLlmApplication}.
|
|
10
|
+
*
|
|
11
|
+
* - {@link method}, {@link path}: HTTP endpoint info
|
|
12
|
+
* - {@link operation}: Source OpenAPI operation
|
|
13
|
+
* - {@link route}: Source migration route
|
|
14
|
+
*
|
|
15
|
+
* Inherits {@link parse} and {@link validate} from {@link ILlmFunction}.
|
|
16
|
+
*
|
|
17
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
18
|
+
*/
|
|
19
|
+
export interface IHttpLlmFunction extends ILlmFunction {
|
|
20
|
+
/** HTTP method of the endpoint. */
|
|
21
|
+
method: "get" | "post" | "patch" | "put" | "delete";
|
|
22
|
+
|
|
23
|
+
/** Path of the endpoint. */
|
|
24
|
+
path: string;
|
|
25
|
+
|
|
26
|
+
/** Category tags from {@link OpenApi.IOperation.tags}. */
|
|
27
|
+
tags?: string[];
|
|
28
|
+
|
|
29
|
+
/** Returns the source {@link OpenApi.IOperation}. */
|
|
30
|
+
operation: () => OpenApi.IOperation;
|
|
31
|
+
|
|
32
|
+
/** Returns the source {@link IHttpMigrateRoute}. */
|
|
33
|
+
route: () => IHttpMigrateRoute;
|
|
34
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
-
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Migrated application from OpenAPI document.
|
|
6
|
-
*
|
|
7
|
-
* `IHttpMigrateApplication` converts OpenAPI operations into callable HTTP
|
|
8
|
-
* routes via `HttpMigration.application()`. Unlike {@link IHttpLlmApplication}
|
|
9
|
-
* which targets LLM function calling, this focuses on SDK/client code
|
|
10
|
-
* generation with full HTTP semantics.
|
|
11
|
-
*
|
|
12
|
-
* Each {@link IHttpMigrateRoute} represents a single API endpoint with:
|
|
13
|
-
*
|
|
14
|
-
* - Resolved path parameters (`:id` format)
|
|
15
|
-
* - Combined query/header schemas as objects
|
|
16
|
-
* - Request/response body with content type
|
|
17
|
-
* - Accessor path for RPC-style function naming
|
|
18
|
-
*
|
|
19
|
-
* Failed operations go to {@link errors} with detailed messages.
|
|
20
|
-
*
|
|
21
|
-
* @author Jeongho Nam - https://github.com/samchon
|
|
22
|
-
*/
|
|
23
|
-
export interface IHttpMigrateApplication {
|
|
24
|
-
/** Successfully migrated routes. */
|
|
25
|
-
routes: IHttpMigrateRoute[];
|
|
26
|
-
|
|
27
|
-
/** Operations that failed migration. */
|
|
28
|
-
errors: IHttpMigrateApplication.IError[];
|
|
29
|
-
|
|
30
|
-
/** Returns source OpenAPI document. */
|
|
31
|
-
document: () => OpenApi.IDocument;
|
|
32
|
-
}
|
|
33
|
-
export namespace IHttpMigrateApplication {
|
|
34
|
-
/** Migration error for an operation. */
|
|
35
|
-
export interface IError {
|
|
36
|
-
/** Returns source operation. */
|
|
37
|
-
operation: () => OpenApi.IOperation;
|
|
38
|
-
|
|
39
|
-
/** HTTP method. */
|
|
40
|
-
method: "head" | "get" | "post" | "put" | "patch" | "delete";
|
|
41
|
-
|
|
42
|
-
/** Operation path. */
|
|
43
|
-
path: string;
|
|
44
|
-
|
|
45
|
-
/** Error messages. */
|
|
46
|
-
messages: string[];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
1
|
+
import { OpenApi } from "../openapi/OpenApi";
|
|
2
|
+
import { IHttpMigrateRoute } from "./IHttpMigrateRoute";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Migrated application from OpenAPI document.
|
|
6
|
+
*
|
|
7
|
+
* `IHttpMigrateApplication` converts OpenAPI operations into callable HTTP
|
|
8
|
+
* routes via `HttpMigration.application()`. Unlike {@link IHttpLlmApplication}
|
|
9
|
+
* which targets LLM function calling, this focuses on SDK/client code
|
|
10
|
+
* generation with full HTTP semantics.
|
|
11
|
+
*
|
|
12
|
+
* Each {@link IHttpMigrateRoute} represents a single API endpoint with:
|
|
13
|
+
*
|
|
14
|
+
* - Resolved path parameters (`:id` format)
|
|
15
|
+
* - Combined query/header schemas as objects
|
|
16
|
+
* - Request/response body with content type
|
|
17
|
+
* - Accessor path for RPC-style function naming
|
|
18
|
+
*
|
|
19
|
+
* Failed operations go to {@link errors} with detailed messages.
|
|
20
|
+
*
|
|
21
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
22
|
+
*/
|
|
23
|
+
export interface IHttpMigrateApplication {
|
|
24
|
+
/** Successfully migrated routes. */
|
|
25
|
+
routes: IHttpMigrateRoute[];
|
|
26
|
+
|
|
27
|
+
/** Operations that failed migration. */
|
|
28
|
+
errors: IHttpMigrateApplication.IError[];
|
|
29
|
+
|
|
30
|
+
/** Returns source OpenAPI document. */
|
|
31
|
+
document: () => OpenApi.IDocument;
|
|
32
|
+
}
|
|
33
|
+
export namespace IHttpMigrateApplication {
|
|
34
|
+
/** Migration error for an operation. */
|
|
35
|
+
export interface IError {
|
|
36
|
+
/** Returns source operation. */
|
|
37
|
+
operation: () => OpenApi.IOperation;
|
|
38
|
+
|
|
39
|
+
/** HTTP method. */
|
|
40
|
+
method: "head" | "get" | "post" | "put" | "patch" | "delete";
|
|
41
|
+
|
|
42
|
+
/** Operation path. */
|
|
43
|
+
path: string;
|
|
44
|
+
|
|
45
|
+
/** Error messages. */
|
|
46
|
+
messages: string[];
|
|
47
|
+
}
|
|
48
|
+
}
|