@typia/utils 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.
Files changed (103) hide show
  1. package/README.md +2 -2
  2. package/lib/http/internal/HttpLlmApplicationComposer.js +1 -0
  3. package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -1
  4. package/lib/http/internal/HttpLlmApplicationComposer.mjs +1 -0
  5. package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
  6. package/lib/utils/LlmJson.d.ts +3 -3
  7. package/lib/utils/LlmJson.js +2 -2
  8. package/lib/utils/LlmJson.js.map +1 -1
  9. package/lib/utils/LlmJson.mjs +2 -2
  10. package/lib/utils/LlmJson.mjs.map +1 -1
  11. package/lib/utils/internal/coerceLlmArguments.js +17 -1
  12. package/lib/utils/internal/coerceLlmArguments.js.map +1 -1
  13. package/lib/utils/internal/coerceLlmArguments.mjs +17 -1
  14. package/lib/utils/internal/coerceLlmArguments.mjs.map +1 -1
  15. package/lib/utils/internal/parseLenientJson.js +236 -96
  16. package/lib/utils/internal/parseLenientJson.js.map +1 -1
  17. package/lib/utils/internal/parseLenientJson.mjs +236 -96
  18. package/lib/utils/internal/parseLenientJson.mjs.map +1 -1
  19. package/lib/utils/internal/stringifyValidationFailure.js +17 -15
  20. package/lib/utils/internal/stringifyValidationFailure.js.map +1 -1
  21. package/lib/utils/internal/stringifyValidationFailure.mjs +17 -15
  22. package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -1
  23. package/package.json +2 -2
  24. package/src/converters/LlmSchemaConverter.ts +647 -647
  25. package/src/converters/OpenApiConverter.ts +285 -285
  26. package/src/converters/index.ts +5 -5
  27. package/src/converters/internal/LlmDescriptionInverter.ts +178 -178
  28. package/src/converters/internal/LlmParametersComposer.ts +52 -52
  29. package/src/converters/internal/OpenApiConstraintShifter.ts +154 -154
  30. package/src/converters/internal/OpenApiExclusiveEmender.ts +46 -46
  31. package/src/converters/internal/OpenApiV3Downgrader.ts +355 -355
  32. package/src/converters/internal/OpenApiV3Upgrader.ts +470 -470
  33. package/src/converters/internal/OpenApiV3_1Upgrader.ts +685 -685
  34. package/src/converters/internal/SwaggerV2Downgrader.ts +424 -424
  35. package/src/converters/internal/SwaggerV2Upgrader.ts +523 -523
  36. package/src/http/HttpError.ts +107 -107
  37. package/src/http/HttpLlm.ts +167 -167
  38. package/src/http/HttpMigration.ts +92 -92
  39. package/src/http/index.ts +3 -3
  40. package/src/http/internal/HttpLlmApplicationComposer.ts +361 -360
  41. package/src/http/internal/HttpLlmFunctionFetcher.ts +37 -37
  42. package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -56
  43. package/src/http/internal/HttpMigrateRouteAccessor.ts +135 -135
  44. package/src/http/internal/HttpMigrateRouteComposer.ts +505 -505
  45. package/src/http/internal/HttpMigrateRouteFetcher.ts +203 -203
  46. package/src/index.ts +4 -4
  47. package/src/utils/ArrayUtil.ts +42 -42
  48. package/src/utils/LlmJson.ts +141 -141
  49. package/src/utils/MapUtil.ts +15 -15
  50. package/src/utils/NamingConvention.ts +205 -205
  51. package/src/utils/Singleton.ts +17 -17
  52. package/src/utils/StringUtil.ts +14 -14
  53. package/src/utils/dedent.ts +57 -57
  54. package/src/utils/index.ts +8 -8
  55. package/src/utils/internal/EndpointUtil.ts +44 -44
  56. package/src/utils/internal/JsonDescriptor.ts +70 -70
  57. package/src/utils/internal/OpenApiTypeCheckerBase.ts +822 -822
  58. package/src/utils/internal/coerceLlmArguments.ts +314 -297
  59. package/src/utils/internal/parseLenientJson.ts +894 -731
  60. package/src/utils/internal/stringifyValidationFailure.ts +415 -411
  61. package/src/validators/LlmTypeChecker.ts +402 -402
  62. package/src/validators/OpenApiTypeChecker.ts +297 -297
  63. package/src/validators/OpenApiV3TypeChecker.ts +70 -70
  64. package/src/validators/OpenApiV3_1TypeChecker.ts +86 -86
  65. package/src/validators/OpenApiValidator.ts +94 -94
  66. package/src/validators/SwaggerV2TypeChecker.ts +71 -71
  67. package/src/validators/functional/_isBigintString.ts +8 -8
  68. package/src/validators/functional/_isFormatByte.ts +7 -7
  69. package/src/validators/functional/_isFormatDate.ts +3 -3
  70. package/src/validators/functional/_isFormatDateTime.ts +4 -4
  71. package/src/validators/functional/_isFormatDuration.ts +4 -4
  72. package/src/validators/functional/_isFormatEmail.ts +4 -4
  73. package/src/validators/functional/_isFormatHostname.ts +4 -4
  74. package/src/validators/functional/_isFormatIdnEmail.ts +4 -4
  75. package/src/validators/functional/_isFormatIdnHostname.ts +4 -4
  76. package/src/validators/functional/_isFormatIpv4.ts +4 -4
  77. package/src/validators/functional/_isFormatIpv6.ts +4 -4
  78. package/src/validators/functional/_isFormatIri.ts +3 -3
  79. package/src/validators/functional/_isFormatIriReference.ts +4 -4
  80. package/src/validators/functional/_isFormatJsonPointer.ts +3 -3
  81. package/src/validators/functional/_isFormatPassword.ts +1 -1
  82. package/src/validators/functional/_isFormatRegex.ts +8 -8
  83. package/src/validators/functional/_isFormatRelativeJsonPointer.ts +4 -4
  84. package/src/validators/functional/_isFormatTime.ts +4 -4
  85. package/src/validators/functional/_isFormatUri.ts +6 -6
  86. package/src/validators/functional/_isFormatUriReference.ts +5 -5
  87. package/src/validators/functional/_isFormatUriTemplate.ts +4 -4
  88. package/src/validators/functional/_isFormatUrl.ts +4 -4
  89. package/src/validators/functional/_isFormatUuid.ts +3 -3
  90. package/src/validators/functional/_isUniqueItems.ts +159 -159
  91. package/src/validators/index.ts +14 -14
  92. package/src/validators/internal/IOpenApiValidatorContext.ts +17 -17
  93. package/src/validators/internal/OpenApiArrayValidator.ts +49 -49
  94. package/src/validators/internal/OpenApiBooleanValidator.ts +11 -11
  95. package/src/validators/internal/OpenApiConstantValidator.ts +11 -11
  96. package/src/validators/internal/OpenApiIntegerValidator.ts +49 -49
  97. package/src/validators/internal/OpenApiNumberValidator.ts +48 -48
  98. package/src/validators/internal/OpenApiObjectValidator.ts +83 -83
  99. package/src/validators/internal/OpenApiOneOfValidator.ts +309 -309
  100. package/src/validators/internal/OpenApiSchemaNamingRule.ts +124 -124
  101. package/src/validators/internal/OpenApiStationValidator.ts +115 -115
  102. package/src/validators/internal/OpenApiStringValidator.ts +88 -88
  103. package/src/validators/internal/OpenApiTupleValidator.ts +55 -55
@@ -1,92 +1,92 @@
1
- import {
2
- IHttpConnection,
3
- IHttpMigrateApplication,
4
- IHttpMigrateRoute,
5
- IHttpResponse,
6
- OpenApi,
7
- OpenApiV3,
8
- OpenApiV3_1,
9
- SwaggerV2,
10
- } from "@typia/interface";
11
-
12
- import { OpenApiConverter } from "../converters/OpenApiConverter";
13
- import { HttpMigrateApplicationComposer } from "./internal/HttpMigrateApplicationComposer";
14
- import { HttpMigrateRouteFetcher } from "./internal/HttpMigrateRouteFetcher";
15
-
16
- /**
17
- * OpenAPI to HTTP migration utilities.
18
- *
19
- * `HttpMigration` converts OpenAPI documents into executable HTTP routes
20
- * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
21
- * function calling, this focuses on SDK/client code generation.
22
- *
23
- * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
24
- * automatic conversion to normalized {@link OpenApi} format.
25
- *
26
- * Main functions:
27
- *
28
- * - {@link application}: Convert OpenAPI document to
29
- * {@link IHttpMigrateApplication}
30
- * - {@link execute}: Call a route and return response body
31
- * - {@link propagate}: Call a route and return full HTTP response (including
32
- * non-2xx)
33
- *
34
- * @author Jeongho Nam - https://github.com/samchon
35
- */
36
- export namespace HttpMigration {
37
- /**
38
- * Convert OpenAPI document to migration application.
39
- *
40
- * @param document OpenAPI document (any version)
41
- * @returns Migration application with callable routes
42
- */
43
- export const application = (
44
- document:
45
- | OpenApi.IDocument
46
- | SwaggerV2.IDocument
47
- | OpenApiV3.IDocument
48
- | OpenApiV3_1.IDocument,
49
- ): IHttpMigrateApplication =>
50
- HttpMigrateApplicationComposer.compose(
51
- OpenApiConverter.upgradeDocument(document),
52
- );
53
-
54
- /**
55
- * Execute HTTP route.
56
- *
57
- * @param props Fetch properties
58
- * @returns Response body
59
- * @throws HttpError on non-2xx status
60
- */
61
- export const execute = (props: IFetchProps): Promise<unknown> =>
62
- HttpMigrateRouteFetcher.execute(props);
63
-
64
- /**
65
- * Execute HTTP route and return full response.
66
- *
67
- * @param props Fetch properties
68
- * @returns Full HTTP response including non-2xx
69
- */
70
- export const propagate = (props: IFetchProps): Promise<IHttpResponse> =>
71
- HttpMigrateRouteFetcher.propagate(props);
72
-
73
- /** Properties for HTTP route execution. */
74
- export interface IFetchProps {
75
- /** HTTP connection info. */
76
- connection: IHttpConnection;
77
-
78
- /** Route to execute. */
79
- route: IHttpMigrateRoute;
80
-
81
- /** Path parameters. */
82
- parameters:
83
- | Array<string | number | boolean | bigint | null>
84
- | Record<string, string | number | boolean | bigint | null>;
85
-
86
- /** Query parameters. */
87
- query?: object | undefined;
88
-
89
- /** Request body. */
90
- body?: object | undefined;
91
- }
92
- }
1
+ import {
2
+ IHttpConnection,
3
+ IHttpMigrateApplication,
4
+ IHttpMigrateRoute,
5
+ IHttpResponse,
6
+ OpenApi,
7
+ OpenApiV3,
8
+ OpenApiV3_1,
9
+ SwaggerV2,
10
+ } from "@typia/interface";
11
+
12
+ import { OpenApiConverter } from "../converters/OpenApiConverter";
13
+ import { HttpMigrateApplicationComposer } from "./internal/HttpMigrateApplicationComposer";
14
+ import { HttpMigrateRouteFetcher } from "./internal/HttpMigrateRouteFetcher";
15
+
16
+ /**
17
+ * OpenAPI to HTTP migration utilities.
18
+ *
19
+ * `HttpMigration` converts OpenAPI documents into executable HTTP routes
20
+ * ({@link IHttpMigrateApplication}). Unlike {@link HttpLlm} which targets LLM
21
+ * function calling, this focuses on SDK/client code generation.
22
+ *
23
+ * Supports all OpenAPI versions (Swagger 2.0, OpenAPI 3.0, 3.1) through
24
+ * automatic conversion to normalized {@link OpenApi} format.
25
+ *
26
+ * Main functions:
27
+ *
28
+ * - {@link application}: Convert OpenAPI document to
29
+ * {@link IHttpMigrateApplication}
30
+ * - {@link execute}: Call a route and return response body
31
+ * - {@link propagate}: Call a route and return full HTTP response (including
32
+ * non-2xx)
33
+ *
34
+ * @author Jeongho Nam - https://github.com/samchon
35
+ */
36
+ export namespace HttpMigration {
37
+ /**
38
+ * Convert OpenAPI document to migration application.
39
+ *
40
+ * @param document OpenAPI document (any version)
41
+ * @returns Migration application with callable routes
42
+ */
43
+ export const application = (
44
+ document:
45
+ | OpenApi.IDocument
46
+ | SwaggerV2.IDocument
47
+ | OpenApiV3.IDocument
48
+ | OpenApiV3_1.IDocument,
49
+ ): IHttpMigrateApplication =>
50
+ HttpMigrateApplicationComposer.compose(
51
+ OpenApiConverter.upgradeDocument(document),
52
+ );
53
+
54
+ /**
55
+ * Execute HTTP route.
56
+ *
57
+ * @param props Fetch properties
58
+ * @returns Response body
59
+ * @throws HttpError on non-2xx status
60
+ */
61
+ export const execute = (props: IFetchProps): Promise<unknown> =>
62
+ HttpMigrateRouteFetcher.execute(props);
63
+
64
+ /**
65
+ * Execute HTTP route and return full response.
66
+ *
67
+ * @param props Fetch properties
68
+ * @returns Full HTTP response including non-2xx
69
+ */
70
+ export const propagate = (props: IFetchProps): Promise<IHttpResponse> =>
71
+ HttpMigrateRouteFetcher.propagate(props);
72
+
73
+ /** Properties for HTTP route execution. */
74
+ export interface IFetchProps {
75
+ /** HTTP connection info. */
76
+ connection: IHttpConnection;
77
+
78
+ /** Route to execute. */
79
+ route: IHttpMigrateRoute;
80
+
81
+ /** Path parameters. */
82
+ parameters:
83
+ | Array<string | number | boolean | bigint | null>
84
+ | Record<string, string | number | boolean | bigint | null>;
85
+
86
+ /** Query parameters. */
87
+ query?: object | undefined;
88
+
89
+ /** Request body. */
90
+ body?: object | undefined;
91
+ }
92
+ }
package/src/http/index.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from "./HttpError";
2
- export * from "./HttpLlm";
3
- export * from "./HttpMigration";
1
+ export * from "./HttpError";
2
+ export * from "./HttpLlm";
3
+ export * from "./HttpMigration";