@typia/interface 12.0.0-dev.20260311 → 12.0.0-dev.20260312

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.
@@ -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: "head" | "get" | "post" | "put" | "patch" | "delete" | "query";
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,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: "head" | "get" | "post" | "put" | "patch" | "delete" | "query";
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" | "query";
41
+
42
+ /** Operation path. */
43
+ path: string;
44
+
45
+ /** Error messages. */
46
+ messages: string[];
47
+ }
48
+ }
@@ -1,165 +1,165 @@
1
- import { OpenApi } from "../openapi/OpenApi";
2
-
3
- /**
4
- * HTTP route converted from OpenAPI operation.
5
- *
6
- * `IHttpMigrateRoute` represents a single API endpoint with all
7
- * request/response schemas resolved and ready for code generation. Contains
8
- * {@link parameters} for URL path variables, {@link query} for query strings,
9
- * {@link headers}, {@link body} for request payload, and
10
- * {@link success}/{@link exceptions} for responses.
11
- *
12
- * @author Jeongho Nam - https://github.com/samchon
13
- */
14
- export interface IHttpMigrateRoute {
15
- /** HTTP method. Operations with other methods are ignored. */
16
- method: "head" | "get" | "post" | "put" | "patch" | "delete";
17
-
18
- /** Original path from OpenAPI document. */
19
- path: string;
20
-
21
- /** Emended path with `:param` format, always starts with `/`. */
22
- emendedPath: string;
23
-
24
- /**
25
- * Accessor path for generated RPC function.
26
- *
27
- * Namespaces from static path segments, function name from method +
28
- * parameters. `delete` becomes `erase` to avoid reserved keyword.
29
- */
30
- accessor: string[];
31
-
32
- /** Path parameters only. */
33
- parameters: IHttpMigrateRoute.IParameter[];
34
-
35
- /** Combined headers as single object. Null if none. */
36
- headers: IHttpMigrateRoute.IHeaders | null;
37
-
38
- /** Combined query parameters as single object. Null if none. */
39
- query: IHttpMigrateRoute.IQuery | null;
40
-
41
- /** Request body metadata. Null if none. */
42
- body: IHttpMigrateRoute.IBody | null;
43
-
44
- /** Success response (200/201). Null if void return. */
45
- success: IHttpMigrateRoute.ISuccess | null;
46
-
47
- /** Exception responses keyed by status code. */
48
- exceptions: Record<string, IHttpMigrateRoute.IException>;
49
-
50
- /** Returns description comment for the RPC function. */
51
- comment: () => string;
52
-
53
- /** Returns source {@link OpenApi.IOperation}. */
54
- operation: () => OpenApi.IOperation;
55
- }
56
- export namespace IHttpMigrateRoute {
57
- /** Path parameter metadata. */
58
- export interface IParameter {
59
- /** Parameter name in path template. */
60
- name: string;
61
-
62
- /** Parameter variable key. */
63
- key: string;
64
-
65
- /** Parameter type schema. */
66
- schema: OpenApi.IJsonSchema;
67
-
68
- /** Returns source parameter definition. */
69
- parameter: () => OpenApi.IOperation.IParameter;
70
- }
71
-
72
- /** Headers metadata. */
73
- export interface IHeaders {
74
- /** Combined headers parameter name. */
75
- name: string;
76
-
77
- /** Headers variable key. */
78
- key: string;
79
-
80
- /** Combined headers schema. */
81
- schema: OpenApi.IJsonSchema;
82
-
83
- /** Returns title. */
84
- title: () => string | undefined;
85
-
86
- /** Returns description. */
87
- description: () => string | undefined;
88
-
89
- /** Returns example value. */
90
- example: () => any | undefined;
91
-
92
- /** Returns named examples. */
93
- examples: () => Record<string, any> | undefined;
94
- }
95
-
96
- /** Query parameters metadata. */
97
- export interface IQuery {
98
- /** Combined query parameter name. */
99
- name: string;
100
-
101
- /** Query variable key. */
102
- key: string;
103
-
104
- /** Combined query schema. */
105
- schema: OpenApi.IJsonSchema;
106
-
107
- /** Returns title. */
108
- title: () => string | undefined;
109
-
110
- /** Returns description. */
111
- description: () => string | undefined;
112
-
113
- /** Returns example value. */
114
- example: () => any | undefined;
115
-
116
- /** Returns named examples. */
117
- examples: () => Record<string, any> | undefined;
118
- }
119
-
120
- /** Request body metadata. */
121
- export interface IBody {
122
- /** Body parameter name. */
123
- name: string;
124
-
125
- /** Body variable key. */
126
- key: string;
127
-
128
- /** Content media type. */
129
- type:
130
- | "text/plain"
131
- | "application/json"
132
- | "application/x-www-form-urlencoded"
133
- | "multipart/form-data";
134
-
135
- /** Body type schema. */
136
- schema: OpenApi.IJsonSchema;
137
-
138
- /** Returns description. */
139
- description: () => string | undefined;
140
-
141
- /** Returns source media type definition. */
142
- media: () => OpenApi.IOperation.IMediaType;
143
-
144
- /** Nestia encryption flag. */
145
- "x-nestia-encrypted"?: boolean;
146
- }
147
-
148
- /** Success response metadata. */
149
- export interface ISuccess extends IBody {
150
- /** HTTP status code. */
151
- status: string;
152
- }
153
-
154
- /** Exception response metadata. */
155
- export interface IException {
156
- /** Exception type schema. */
157
- schema: OpenApi.IJsonSchema;
158
-
159
- /** Returns source response definition. */
160
- response: () => OpenApi.IOperation.IResponse;
161
-
162
- /** Returns source media type definition. */
163
- media: () => OpenApi.IOperation.IMediaType;
164
- }
165
- }
1
+ import { OpenApi } from "../openapi/OpenApi";
2
+
3
+ /**
4
+ * HTTP route converted from OpenAPI operation.
5
+ *
6
+ * `IHttpMigrateRoute` represents a single API endpoint with all
7
+ * request/response schemas resolved and ready for code generation. Contains
8
+ * {@link parameters} for URL path variables, {@link query} for query strings,
9
+ * {@link headers}, {@link body} for request payload, and
10
+ * {@link success}/{@link exceptions} for responses.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ */
14
+ export interface IHttpMigrateRoute {
15
+ /** HTTP method. */
16
+ method: "head" | "get" | "post" | "put" | "patch" | "delete" | "query";
17
+
18
+ /** Original path from OpenAPI document. */
19
+ path: string;
20
+
21
+ /** Emended path with `:param` format, always starts with `/`. */
22
+ emendedPath: string;
23
+
24
+ /**
25
+ * Accessor path for generated RPC function.
26
+ *
27
+ * Namespaces from static path segments, function name from method +
28
+ * parameters. `delete` becomes `erase` to avoid reserved keyword.
29
+ */
30
+ accessor: string[];
31
+
32
+ /** Path parameters only. */
33
+ parameters: IHttpMigrateRoute.IParameter[];
34
+
35
+ /** Combined headers as single object. Null if none. */
36
+ headers: IHttpMigrateRoute.IHeaders | null;
37
+
38
+ /** Combined query parameters as single object. Null if none. */
39
+ query: IHttpMigrateRoute.IQuery | null;
40
+
41
+ /** Request body metadata. Null if none. */
42
+ body: IHttpMigrateRoute.IBody | null;
43
+
44
+ /** Success response (200/201). Null if void return. */
45
+ success: IHttpMigrateRoute.ISuccess | null;
46
+
47
+ /** Exception responses keyed by status code. */
48
+ exceptions: Record<string, IHttpMigrateRoute.IException>;
49
+
50
+ /** Returns description comment for the RPC function. */
51
+ comment: () => string;
52
+
53
+ /** Returns source {@link OpenApi.IOperation}. */
54
+ operation: () => OpenApi.IOperation;
55
+ }
56
+ export namespace IHttpMigrateRoute {
57
+ /** Path parameter metadata. */
58
+ export interface IParameter {
59
+ /** Parameter name in path template. */
60
+ name: string;
61
+
62
+ /** Parameter variable key. */
63
+ key: string;
64
+
65
+ /** Parameter type schema. */
66
+ schema: OpenApi.IJsonSchema;
67
+
68
+ /** Returns source parameter definition. */
69
+ parameter: () => OpenApi.IOperation.IParameter;
70
+ }
71
+
72
+ /** Headers metadata. */
73
+ export interface IHeaders {
74
+ /** Combined headers parameter name. */
75
+ name: string;
76
+
77
+ /** Headers variable key. */
78
+ key: string;
79
+
80
+ /** Combined headers schema. */
81
+ schema: OpenApi.IJsonSchema;
82
+
83
+ /** Returns title. */
84
+ title: () => string | undefined;
85
+
86
+ /** Returns description. */
87
+ description: () => string | undefined;
88
+
89
+ /** Returns example value. */
90
+ example: () => any | undefined;
91
+
92
+ /** Returns named examples. */
93
+ examples: () => Record<string, any> | undefined;
94
+ }
95
+
96
+ /** Query parameters metadata. */
97
+ export interface IQuery {
98
+ /** Combined query parameter name. */
99
+ name: string;
100
+
101
+ /** Query variable key. */
102
+ key: string;
103
+
104
+ /** Combined query schema. */
105
+ schema: OpenApi.IJsonSchema;
106
+
107
+ /** Returns title. */
108
+ title: () => string | undefined;
109
+
110
+ /** Returns description. */
111
+ description: () => string | undefined;
112
+
113
+ /** Returns example value. */
114
+ example: () => any | undefined;
115
+
116
+ /** Returns named examples. */
117
+ examples: () => Record<string, any> | undefined;
118
+ }
119
+
120
+ /** Request body metadata. */
121
+ export interface IBody {
122
+ /** Body parameter name. */
123
+ name: string;
124
+
125
+ /** Body variable key. */
126
+ key: string;
127
+
128
+ /** Content media type. */
129
+ type:
130
+ | "text/plain"
131
+ | "application/json"
132
+ | "application/x-www-form-urlencoded"
133
+ | "multipart/form-data";
134
+
135
+ /** Body type schema. */
136
+ schema: OpenApi.IJsonSchema;
137
+
138
+ /** Returns description. */
139
+ description: () => string | undefined;
140
+
141
+ /** Returns source media type definition. */
142
+ media: () => OpenApi.IOperation.IMediaType;
143
+
144
+ /** Nestia encryption flag. */
145
+ "x-nestia-encrypted"?: boolean;
146
+ }
147
+
148
+ /** Success response metadata. */
149
+ export interface ISuccess extends IBody {
150
+ /** HTTP status code. */
151
+ status: string;
152
+ }
153
+
154
+ /** Exception response metadata. */
155
+ export interface IException {
156
+ /** Exception type schema. */
157
+ schema: OpenApi.IJsonSchema;
158
+
159
+ /** Returns source response definition. */
160
+ response: () => OpenApi.IOperation.IResponse;
161
+
162
+ /** Returns source media type definition. */
163
+ media: () => OpenApi.IOperation.IMediaType;
164
+ }
165
+ }