@typia/utils 12.0.0-dev.20260316 → 12.0.1

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,94 +1,94 @@
1
- import {
2
- IHttpConnection,
3
- IHttpMigrateApplication,
4
- IHttpMigrateRoute,
5
- IHttpResponse,
6
- OpenApi,
7
- OpenApiV3,
8
- OpenApiV3_1,
9
- OpenApiV3_2,
10
- SwaggerV2,
11
- } from "@typia/interface";
12
-
13
- import { OpenApiConverter } from "../converters/OpenApiConverter";
14
- import { HttpMigrateApplicationComposer } from "./internal/HttpMigrateApplicationComposer";
15
- import { HttpMigrateRouteFetcher } from "./internal/HttpMigrateRouteFetcher";
16
-
17
- /**
18
- * OpenAPI to HTTP migration utilities.
19
- *
20
- * `HttpMigration` converts OpenAPI documents into executable HTTP routes
21
- * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
22
- * function calling, this focuses on SDK/client code generation.
23
- *
24
- * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
25
- * automatic conversion to normalized {@link OpenApi} format.
26
- *
27
- * Main functions:
28
- *
29
- * - {@link application}: Convert OpenAPI document to
30
- * {@link IHttpMigrateApplication}
31
- * - {@link execute}: Call a route and return response body
32
- * - {@link propagate}: Call a route and return full HTTP response (including
33
- * non-2xx)
34
- *
35
- * @author Jeongho Nam - https://github.com/samchon
36
- */
37
- export namespace HttpMigration {
38
- /**
39
- * Convert OpenAPI document to migration application.
40
- *
41
- * @param document OpenAPI document (any version)
42
- * @returns Migration application with callable routes
43
- */
44
- export const application = (
45
- document:
46
- | OpenApi.IDocument
47
- | SwaggerV2.IDocument
48
- | OpenApiV3.IDocument
49
- | OpenApiV3_1.IDocument
50
- | OpenApiV3_2.IDocument,
51
- ): IHttpMigrateApplication =>
52
- HttpMigrateApplicationComposer.compose(
53
- OpenApiConverter.upgradeDocument(document),
54
- );
55
-
56
- /**
57
- * Execute HTTP route.
58
- *
59
- * @param props Fetch properties
60
- * @returns Response body
61
- * @throws HttpError on non-2xx status
62
- */
63
- export const execute = (props: IFetchProps): Promise<unknown> =>
64
- HttpMigrateRouteFetcher.execute(props);
65
-
66
- /**
67
- * Execute HTTP route and return full response.
68
- *
69
- * @param props Fetch properties
70
- * @returns Full HTTP response including non-2xx
71
- */
72
- export const propagate = (props: IFetchProps): Promise<IHttpResponse> =>
73
- HttpMigrateRouteFetcher.propagate(props);
74
-
75
- /** Properties for HTTP route execution. */
76
- export interface IFetchProps {
77
- /** HTTP connection info. */
78
- connection: IHttpConnection;
79
-
80
- /** Route to execute. */
81
- route: IHttpMigrateRoute;
82
-
83
- /** Path parameters. */
84
- parameters:
85
- | Array<string | number | boolean | bigint | null>
86
- | Record<string, string | number | boolean | bigint | null>;
87
-
88
- /** Query parameters. */
89
- query?: object | undefined;
90
-
91
- /** Request body. */
92
- body?: object | undefined;
93
- }
94
- }
1
+ import {
2
+ IHttpConnection,
3
+ IHttpMigrateApplication,
4
+ IHttpMigrateRoute,
5
+ IHttpResponse,
6
+ OpenApi,
7
+ OpenApiV3,
8
+ OpenApiV3_1,
9
+ OpenApiV3_2,
10
+ SwaggerV2,
11
+ } from "@typia/interface";
12
+
13
+ import { OpenApiConverter } from "../converters/OpenApiConverter";
14
+ import { HttpMigrateApplicationComposer } from "./internal/HttpMigrateApplicationComposer";
15
+ import { HttpMigrateRouteFetcher } from "./internal/HttpMigrateRouteFetcher";
16
+
17
+ /**
18
+ * OpenAPI to HTTP migration utilities.
19
+ *
20
+ * `HttpMigration` converts OpenAPI documents into executable HTTP routes
21
+ * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
22
+ * function calling, this focuses on SDK/client code generation.
23
+ *
24
+ * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
25
+ * automatic conversion to normalized {@link OpenApi} format.
26
+ *
27
+ * Main functions:
28
+ *
29
+ * - {@link application}: Convert OpenAPI document to
30
+ * {@link IHttpMigrateApplication}
31
+ * - {@link execute}: Call a route and return response body
32
+ * - {@link propagate}: Call a route and return full HTTP response (including
33
+ * non-2xx)
34
+ *
35
+ * @author Jeongho Nam - https://github.com/samchon
36
+ */
37
+ export namespace HttpMigration {
38
+ /**
39
+ * Convert OpenAPI document to migration application.
40
+ *
41
+ * @param document OpenAPI document (any version)
42
+ * @returns Migration application with callable routes
43
+ */
44
+ export const application = (
45
+ document:
46
+ | OpenApi.IDocument
47
+ | SwaggerV2.IDocument
48
+ | OpenApiV3.IDocument
49
+ | OpenApiV3_1.IDocument
50
+ | OpenApiV3_2.IDocument,
51
+ ): IHttpMigrateApplication =>
52
+ HttpMigrateApplicationComposer.compose(
53
+ OpenApiConverter.upgradeDocument(document),
54
+ );
55
+
56
+ /**
57
+ * Execute HTTP route.
58
+ *
59
+ * @param props Fetch properties
60
+ * @returns Response body
61
+ * @throws HttpError on non-2xx status
62
+ */
63
+ export const execute = (props: IFetchProps): Promise<unknown> =>
64
+ HttpMigrateRouteFetcher.execute(props);
65
+
66
+ /**
67
+ * Execute HTTP route and return full response.
68
+ *
69
+ * @param props Fetch properties
70
+ * @returns Full HTTP response including non-2xx
71
+ */
72
+ export const propagate = (props: IFetchProps): Promise<IHttpResponse> =>
73
+ HttpMigrateRouteFetcher.propagate(props);
74
+
75
+ /** Properties for HTTP route execution. */
76
+ export interface IFetchProps {
77
+ /** HTTP connection info. */
78
+ connection: IHttpConnection;
79
+
80
+ /** Route to execute. */
81
+ route: IHttpMigrateRoute;
82
+
83
+ /** Path parameters. */
84
+ parameters:
85
+ | Array<string | number | boolean | bigint | null>
86
+ | Record<string, string | number | boolean | bigint | null>;
87
+
88
+ /** Query parameters. */
89
+ query?: object | undefined;
90
+
91
+ /** Request body. */
92
+ body?: object | undefined;
93
+ }
94
+ }