@typia/utils 12.0.0-dev.20260309 → 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 (92) hide show
  1. package/lib/http/internal/HttpLlmApplicationComposer.mjs +5 -1
  2. package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
  3. package/lib/index.mjs +9 -9
  4. package/lib/utils/LlmJson.mjs +9 -2
  5. package/lib/utils/LlmJson.mjs.map +1 -1
  6. package/lib/utils/internal/stringifyValidationFailure.js +17 -15
  7. package/lib/utils/internal/stringifyValidationFailure.js.map +1 -1
  8. package/lib/utils/internal/stringifyValidationFailure.mjs +17 -15
  9. package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -1
  10. package/lib/validators/internal/OpenApiOneOfValidator.mjs +5 -1
  11. package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -1
  12. package/package.json +2 -2
  13. package/src/converters/LlmSchemaConverter.ts +647 -647
  14. package/src/converters/OpenApiConverter.ts +285 -285
  15. package/src/converters/index.ts +5 -5
  16. package/src/converters/internal/LlmDescriptionInverter.ts +178 -178
  17. package/src/converters/internal/LlmParametersComposer.ts +52 -52
  18. package/src/converters/internal/OpenApiConstraintShifter.ts +154 -154
  19. package/src/converters/internal/OpenApiExclusiveEmender.ts +46 -46
  20. package/src/converters/internal/OpenApiV3Downgrader.ts +355 -355
  21. package/src/converters/internal/OpenApiV3Upgrader.ts +470 -470
  22. package/src/converters/internal/OpenApiV3_1Upgrader.ts +685 -685
  23. package/src/converters/internal/SwaggerV2Downgrader.ts +424 -424
  24. package/src/converters/internal/SwaggerV2Upgrader.ts +523 -523
  25. package/src/http/HttpError.ts +107 -107
  26. package/src/http/HttpLlm.ts +167 -167
  27. package/src/http/HttpMigration.ts +92 -92
  28. package/src/http/index.ts +3 -3
  29. package/src/http/internal/HttpLlmApplicationComposer.ts +361 -361
  30. package/src/http/internal/HttpLlmFunctionFetcher.ts +37 -37
  31. package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -56
  32. package/src/http/internal/HttpMigrateRouteAccessor.ts +135 -135
  33. package/src/http/internal/HttpMigrateRouteComposer.ts +505 -505
  34. package/src/http/internal/HttpMigrateRouteFetcher.ts +203 -203
  35. package/src/index.ts +4 -4
  36. package/src/utils/ArrayUtil.ts +42 -42
  37. package/src/utils/LlmJson.ts +141 -141
  38. package/src/utils/MapUtil.ts +15 -15
  39. package/src/utils/NamingConvention.ts +205 -205
  40. package/src/utils/Singleton.ts +17 -17
  41. package/src/utils/StringUtil.ts +14 -14
  42. package/src/utils/dedent.ts +57 -57
  43. package/src/utils/index.ts +8 -8
  44. package/src/utils/internal/EndpointUtil.ts +44 -44
  45. package/src/utils/internal/JsonDescriptor.ts +70 -70
  46. package/src/utils/internal/OpenApiTypeCheckerBase.ts +822 -822
  47. package/src/utils/internal/coerceLlmArguments.ts +314 -314
  48. package/src/utils/internal/parseLenientJson.ts +894 -894
  49. package/src/utils/internal/stringifyValidationFailure.ts +415 -411
  50. package/src/validators/LlmTypeChecker.ts +402 -402
  51. package/src/validators/OpenApiTypeChecker.ts +297 -297
  52. package/src/validators/OpenApiV3TypeChecker.ts +70 -70
  53. package/src/validators/OpenApiV3_1TypeChecker.ts +86 -86
  54. package/src/validators/OpenApiValidator.ts +94 -94
  55. package/src/validators/SwaggerV2TypeChecker.ts +71 -71
  56. package/src/validators/functional/_isBigintString.ts +8 -8
  57. package/src/validators/functional/_isFormatByte.ts +7 -7
  58. package/src/validators/functional/_isFormatDate.ts +3 -3
  59. package/src/validators/functional/_isFormatDateTime.ts +4 -4
  60. package/src/validators/functional/_isFormatDuration.ts +4 -4
  61. package/src/validators/functional/_isFormatEmail.ts +4 -4
  62. package/src/validators/functional/_isFormatHostname.ts +4 -4
  63. package/src/validators/functional/_isFormatIdnEmail.ts +4 -4
  64. package/src/validators/functional/_isFormatIdnHostname.ts +4 -4
  65. package/src/validators/functional/_isFormatIpv4.ts +4 -4
  66. package/src/validators/functional/_isFormatIpv6.ts +4 -4
  67. package/src/validators/functional/_isFormatIri.ts +3 -3
  68. package/src/validators/functional/_isFormatIriReference.ts +4 -4
  69. package/src/validators/functional/_isFormatJsonPointer.ts +3 -3
  70. package/src/validators/functional/_isFormatPassword.ts +1 -1
  71. package/src/validators/functional/_isFormatRegex.ts +8 -8
  72. package/src/validators/functional/_isFormatRelativeJsonPointer.ts +4 -4
  73. package/src/validators/functional/_isFormatTime.ts +4 -4
  74. package/src/validators/functional/_isFormatUri.ts +6 -6
  75. package/src/validators/functional/_isFormatUriReference.ts +5 -5
  76. package/src/validators/functional/_isFormatUriTemplate.ts +4 -4
  77. package/src/validators/functional/_isFormatUrl.ts +4 -4
  78. package/src/validators/functional/_isFormatUuid.ts +3 -3
  79. package/src/validators/functional/_isUniqueItems.ts +159 -159
  80. package/src/validators/index.ts +14 -14
  81. package/src/validators/internal/IOpenApiValidatorContext.ts +17 -17
  82. package/src/validators/internal/OpenApiArrayValidator.ts +49 -49
  83. package/src/validators/internal/OpenApiBooleanValidator.ts +11 -11
  84. package/src/validators/internal/OpenApiConstantValidator.ts +11 -11
  85. package/src/validators/internal/OpenApiIntegerValidator.ts +49 -49
  86. package/src/validators/internal/OpenApiNumberValidator.ts +48 -48
  87. package/src/validators/internal/OpenApiObjectValidator.ts +83 -83
  88. package/src/validators/internal/OpenApiOneOfValidator.ts +309 -309
  89. package/src/validators/internal/OpenApiSchemaNamingRule.ts +124 -124
  90. package/src/validators/internal/OpenApiStationValidator.ts +115 -115
  91. package/src/validators/internal/OpenApiStringValidator.ts +88 -88
  92. 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";