@typia/utils 12.0.0-dev.20260225
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/LICENSE +21 -0
- package/README.md +79 -0
- package/lib/converters/LlmSchemaConverter.d.ts +102 -0
- package/lib/converters/LlmSchemaConverter.js +652 -0
- package/lib/converters/LlmSchemaConverter.js.map +1 -0
- package/lib/converters/LlmSchemaConverter.mjs +771 -0
- package/lib/converters/LlmSchemaConverter.mjs.map +1 -0
- package/lib/converters/OpenApiConverter.d.ts +135 -0
- package/lib/converters/OpenApiConverter.js +130 -0
- package/lib/converters/OpenApiConverter.js.map +1 -0
- package/lib/converters/OpenApiConverter.mjs +128 -0
- package/lib/converters/OpenApiConverter.mjs.map +1 -0
- package/lib/converters/index.d.ts +2 -0
- package/lib/converters/index.js +21 -0
- package/lib/converters/index.js.map +1 -0
- package/lib/converters/index.mjs +4 -0
- package/lib/converters/index.mjs.map +1 -0
- package/lib/converters/internal/LlmDescriptionInverter.d.ts +6 -0
- package/lib/converters/internal/LlmDescriptionInverter.js +141 -0
- package/lib/converters/internal/LlmDescriptionInverter.js.map +1 -0
- package/lib/converters/internal/LlmDescriptionInverter.mjs +141 -0
- package/lib/converters/internal/LlmDescriptionInverter.mjs.map +1 -0
- package/lib/converters/internal/LlmParametersComposer.d.ts +1 -0
- package/lib/converters/internal/LlmParametersComposer.js +39 -0
- package/lib/converters/internal/LlmParametersComposer.js.map +1 -0
- package/lib/converters/internal/LlmParametersComposer.mjs +42 -0
- package/lib/converters/internal/LlmParametersComposer.mjs.map +1 -0
- package/lib/converters/internal/OpenApiConstraintShifter.d.ts +6 -0
- package/lib/converters/internal/OpenApiConstraintShifter.js +103 -0
- package/lib/converters/internal/OpenApiConstraintShifter.js.map +1 -0
- package/lib/converters/internal/OpenApiConstraintShifter.mjs +102 -0
- package/lib/converters/internal/OpenApiConstraintShifter.mjs.map +1 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.d.ts +4 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.js +32 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.js.map +1 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs +35 -0
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3Downgrader.d.ts +10 -0
- package/lib/converters/internal/OpenApiV3Downgrader.js +214 -0
- package/lib/converters/internal/OpenApiV3Downgrader.js.map +1 -0
- package/lib/converters/internal/OpenApiV3Downgrader.mjs +279 -0
- package/lib/converters/internal/OpenApiV3Downgrader.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3Upgrader.d.ts +6 -0
- package/lib/converters/internal/OpenApiV3Upgrader.js +285 -0
- package/lib/converters/internal/OpenApiV3Upgrader.js.map +1 -0
- package/lib/converters/internal/OpenApiV3Upgrader.mjs +349 -0
- package/lib/converters/internal/OpenApiV3Upgrader.mjs.map +1 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.d.ts +6 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.js +405 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.js.map +1 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs +545 -0
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs.map +1 -0
- package/lib/converters/internal/SwaggerV2Downgrader.d.ts +10 -0
- package/lib/converters/internal/SwaggerV2Downgrader.js +294 -0
- package/lib/converters/internal/SwaggerV2Downgrader.js.map +1 -0
- package/lib/converters/internal/SwaggerV2Downgrader.mjs +332 -0
- package/lib/converters/internal/SwaggerV2Downgrader.mjs.map +1 -0
- package/lib/converters/internal/SwaggerV2Upgrader.d.ts +6 -0
- package/lib/converters/internal/SwaggerV2Upgrader.js +357 -0
- package/lib/converters/internal/SwaggerV2Upgrader.js.map +1 -0
- package/lib/converters/internal/SwaggerV2Upgrader.mjs +403 -0
- package/lib/converters/internal/SwaggerV2Upgrader.mjs.map +1 -0
- package/lib/http/HttpError.d.ts +61 -0
- package/lib/http/HttpError.js +70 -0
- package/lib/http/HttpError.js.map +1 -0
- package/lib/http/HttpError.mjs +76 -0
- package/lib/http/HttpError.mjs.map +1 -0
- package/lib/http/HttpLlm.d.ts +130 -0
- package/lib/http/HttpLlm.js +124 -0
- package/lib/http/HttpLlm.js.map +1 -0
- package/lib/http/HttpLlm.mjs +123 -0
- package/lib/http/HttpLlm.mjs.map +1 -0
- package/lib/http/HttpMigration.d.ts +58 -0
- package/lib/http/HttpMigration.js +52 -0
- package/lib/http/HttpMigration.js.map +1 -0
- package/lib/http/HttpMigration.mjs +52 -0
- package/lib/http/HttpMigration.mjs.map +1 -0
- package/lib/http/index.d.ts +3 -0
- package/lib/http/index.js +20 -0
- package/lib/http/index.js.map +1 -0
- package/lib/http/index.mjs +4 -0
- package/lib/http/index.mjs.map +1 -0
- package/lib/http/internal/HttpLlmApplicationComposer.d.ts +8 -0
- package/lib/http/internal/HttpLlmApplicationComposer.js +254 -0
- package/lib/http/internal/HttpLlmApplicationComposer.js.map +1 -0
- package/lib/http/internal/HttpLlmApplicationComposer.mjs +256 -0
- package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.d.ts +6 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.js +24 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.js.map +1 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs +24 -0
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.d.ts +4 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.js +45 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.js.map +1 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs +47 -0
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.d.ts +4 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.js +107 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.js.map +1 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs +106 -0
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteComposer.d.ts +11 -0
- package/lib/http/internal/HttpMigrateRouteComposer.js +398 -0
- package/lib/http/internal/HttpMigrateRouteComposer.js.map +1 -0
- package/lib/http/internal/HttpMigrateRouteComposer.mjs +392 -0
- package/lib/http/internal/HttpMigrateRouteComposer.mjs.map +1 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.d.ts +6 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.js +179 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.js.map +1 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs +174 -0
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs.map +1 -0
- package/lib/http/internal/LlmDataMerger.d.ts +48 -0
- package/lib/http/internal/LlmDataMerger.js +60 -0
- package/lib/http/internal/LlmDataMerger.js.map +1 -0
- package/lib/http/internal/LlmDataMerger.mjs +59 -0
- package/lib/http/internal/LlmDataMerger.mjs.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +20 -0
- package/lib/index.mjs.map +1 -0
- package/lib/utils/ArrayUtil.d.ts +1 -0
- package/lib/utils/ArrayUtil.js +29 -0
- package/lib/utils/ArrayUtil.js.map +1 -0
- package/lib/utils/ArrayUtil.mjs +28 -0
- package/lib/utils/ArrayUtil.mjs.map +1 -0
- package/lib/utils/MapUtil.d.ts +1 -0
- package/lib/utils/MapUtil.js +16 -0
- package/lib/utils/MapUtil.js.map +1 -0
- package/lib/utils/MapUtil.mjs +15 -0
- package/lib/utils/MapUtil.mjs.map +1 -0
- package/lib/utils/NamingConvention.d.ts +68 -0
- package/lib/utils/NamingConvention.js +199 -0
- package/lib/utils/NamingConvention.js.map +1 -0
- package/lib/utils/NamingConvention.mjs +198 -0
- package/lib/utils/NamingConvention.mjs.map +1 -0
- package/lib/utils/Singleton.d.ts +1 -0
- package/lib/utils/Singleton.js +18 -0
- package/lib/utils/Singleton.js.map +1 -0
- package/lib/utils/Singleton.mjs +18 -0
- package/lib/utils/Singleton.mjs.map +1 -0
- package/lib/utils/StringUtil.d.ts +1 -0
- package/lib/utils/StringUtil.js +17 -0
- package/lib/utils/StringUtil.js.map +1 -0
- package/lib/utils/StringUtil.mjs +13 -0
- package/lib/utils/StringUtil.mjs.map +1 -0
- package/lib/utils/dedent.d.ts +12 -0
- package/lib/utils/dedent.js +51 -0
- package/lib/utils/dedent.js.map +1 -0
- package/lib/utils/dedent.mjs +50 -0
- package/lib/utils/dedent.mjs.map +1 -0
- package/lib/utils/index.d.ts +7 -0
- package/lib/utils/index.js +24 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/utils/index.mjs +8 -0
- package/lib/utils/index.mjs.map +1 -0
- package/lib/utils/internal/EndpointUtil.d.ts +8 -0
- package/lib/utils/internal/EndpointUtil.js +37 -0
- package/lib/utils/internal/EndpointUtil.js.map +1 -0
- package/lib/utils/internal/EndpointUtil.mjs +37 -0
- package/lib/utils/internal/EndpointUtil.mjs.map +1 -0
- package/lib/utils/internal/JsonDescriptor.d.ts +10 -0
- package/lib/utils/internal/JsonDescriptor.js +58 -0
- package/lib/utils/internal/JsonDescriptor.js.map +1 -0
- package/lib/utils/internal/JsonDescriptor.mjs +48 -0
- package/lib/utils/internal/JsonDescriptor.mjs.map +1 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.d.ts +1 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.js +520 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.js.map +1 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs +584 -0
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs.map +1 -0
- package/lib/utils/stringifyValidationFailure.d.ts +25 -0
- package/lib/utils/stringifyValidationFailure.js +326 -0
- package/lib/utils/stringifyValidationFailure.js.map +1 -0
- package/lib/utils/stringifyValidationFailure.mjs +325 -0
- package/lib/utils/stringifyValidationFailure.mjs.map +1 -0
- package/lib/validators/LlmTypeChecker.d.ts +117 -0
- package/lib/validators/LlmTypeChecker.js +309 -0
- package/lib/validators/LlmTypeChecker.js.map +1 -0
- package/lib/validators/LlmTypeChecker.mjs +300 -0
- package/lib/validators/LlmTypeChecker.mjs.map +1 -0
- package/lib/validators/OpenApiTypeChecker.d.ts +211 -0
- package/lib/validators/OpenApiTypeChecker.js +207 -0
- package/lib/validators/OpenApiTypeChecker.js.map +1 -0
- package/lib/validators/OpenApiTypeChecker.mjs +218 -0
- package/lib/validators/OpenApiTypeChecker.mjs.map +1 -0
- package/lib/validators/OpenApiV3TypeChecker.d.ts +26 -0
- package/lib/validators/OpenApiV3TypeChecker.js +30 -0
- package/lib/validators/OpenApiV3TypeChecker.js.map +1 -0
- package/lib/validators/OpenApiV3TypeChecker.mjs +29 -0
- package/lib/validators/OpenApiV3TypeChecker.mjs.map +1 -0
- package/lib/validators/OpenApiV3_1TypeChecker.d.ts +29 -0
- package/lib/validators/OpenApiV3_1TypeChecker.js +34 -0
- package/lib/validators/OpenApiV3_1TypeChecker.js.map +1 -0
- package/lib/validators/OpenApiV3_1TypeChecker.mjs +33 -0
- package/lib/validators/OpenApiV3_1TypeChecker.mjs.map +1 -0
- package/lib/validators/OpenApiValidator.d.ts +36 -0
- package/lib/validators/OpenApiValidator.js +71 -0
- package/lib/validators/OpenApiValidator.js.map +1 -0
- package/lib/validators/OpenApiValidator.mjs +75 -0
- package/lib/validators/OpenApiValidator.mjs.map +1 -0
- package/lib/validators/SwaggerV2TypeChecker.d.ts +27 -0
- package/lib/validators/SwaggerV2TypeChecker.js +31 -0
- package/lib/validators/SwaggerV2TypeChecker.js.map +1 -0
- package/lib/validators/SwaggerV2TypeChecker.mjs +30 -0
- package/lib/validators/SwaggerV2TypeChecker.mjs.map +1 -0
- package/lib/validators/functional/_isBigintString.d.ts +1 -0
- package/lib/validators/functional/_isBigintString.js +14 -0
- package/lib/validators/functional/_isBigintString.js.map +1 -0
- package/lib/validators/functional/_isBigintString.mjs +12 -0
- package/lib/validators/functional/_isBigintString.mjs.map +1 -0
- package/lib/validators/functional/_isFormatByte.d.ts +1 -0
- package/lib/validators/functional/_isFormatByte.js +10 -0
- package/lib/validators/functional/_isFormatByte.js.map +1 -0
- package/lib/validators/functional/_isFormatByte.mjs +8 -0
- package/lib/validators/functional/_isFormatByte.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDate.d.ts +1 -0
- package/lib/validators/functional/_isFormatDate.js +7 -0
- package/lib/validators/functional/_isFormatDate.js.map +1 -0
- package/lib/validators/functional/_isFormatDate.mjs +5 -0
- package/lib/validators/functional/_isFormatDate.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDateTime.d.ts +1 -0
- package/lib/validators/functional/_isFormatDateTime.js +7 -0
- package/lib/validators/functional/_isFormatDateTime.js.map +1 -0
- package/lib/validators/functional/_isFormatDateTime.mjs +5 -0
- package/lib/validators/functional/_isFormatDateTime.mjs.map +1 -0
- package/lib/validators/functional/_isFormatDuration.d.ts +1 -0
- package/lib/validators/functional/_isFormatDuration.js +7 -0
- package/lib/validators/functional/_isFormatDuration.js.map +1 -0
- package/lib/validators/functional/_isFormatDuration.mjs +5 -0
- package/lib/validators/functional/_isFormatDuration.mjs.map +1 -0
- package/lib/validators/functional/_isFormatEmail.d.ts +1 -0
- package/lib/validators/functional/_isFormatEmail.js +7 -0
- package/lib/validators/functional/_isFormatEmail.js.map +1 -0
- package/lib/validators/functional/_isFormatEmail.mjs +5 -0
- package/lib/validators/functional/_isFormatEmail.mjs.map +1 -0
- package/lib/validators/functional/_isFormatHostname.d.ts +1 -0
- package/lib/validators/functional/_isFormatHostname.js +7 -0
- package/lib/validators/functional/_isFormatHostname.js.map +1 -0
- package/lib/validators/functional/_isFormatHostname.mjs +5 -0
- package/lib/validators/functional/_isFormatHostname.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIdnEmail.d.ts +1 -0
- package/lib/validators/functional/_isFormatIdnEmail.js +7 -0
- package/lib/validators/functional/_isFormatIdnEmail.js.map +1 -0
- package/lib/validators/functional/_isFormatIdnEmail.mjs +5 -0
- package/lib/validators/functional/_isFormatIdnEmail.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIdnHostname.d.ts +1 -0
- package/lib/validators/functional/_isFormatIdnHostname.js +7 -0
- package/lib/validators/functional/_isFormatIdnHostname.js.map +1 -0
- package/lib/validators/functional/_isFormatIdnHostname.mjs +5 -0
- package/lib/validators/functional/_isFormatIdnHostname.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIpv4.d.ts +1 -0
- package/lib/validators/functional/_isFormatIpv4.js +7 -0
- package/lib/validators/functional/_isFormatIpv4.js.map +1 -0
- package/lib/validators/functional/_isFormatIpv4.mjs +5 -0
- package/lib/validators/functional/_isFormatIpv4.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIpv6.d.ts +1 -0
- package/lib/validators/functional/_isFormatIpv6.js +7 -0
- package/lib/validators/functional/_isFormatIpv6.js.map +1 -0
- package/lib/validators/functional/_isFormatIpv6.mjs +5 -0
- package/lib/validators/functional/_isFormatIpv6.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIri.d.ts +1 -0
- package/lib/validators/functional/_isFormatIri.js +7 -0
- package/lib/validators/functional/_isFormatIri.js.map +1 -0
- package/lib/validators/functional/_isFormatIri.mjs +5 -0
- package/lib/validators/functional/_isFormatIri.mjs.map +1 -0
- package/lib/validators/functional/_isFormatIriReference.d.ts +1 -0
- package/lib/validators/functional/_isFormatIriReference.js +7 -0
- package/lib/validators/functional/_isFormatIriReference.js.map +1 -0
- package/lib/validators/functional/_isFormatIriReference.mjs +5 -0
- package/lib/validators/functional/_isFormatIriReference.mjs.map +1 -0
- package/lib/validators/functional/_isFormatJsonPointer.d.ts +1 -0
- package/lib/validators/functional/_isFormatJsonPointer.js +7 -0
- package/lib/validators/functional/_isFormatJsonPointer.js.map +1 -0
- package/lib/validators/functional/_isFormatJsonPointer.mjs +5 -0
- package/lib/validators/functional/_isFormatJsonPointer.mjs.map +1 -0
- package/lib/validators/functional/_isFormatPassword.d.ts +1 -0
- package/lib/validators/functional/_isFormatPassword.js +6 -0
- package/lib/validators/functional/_isFormatPassword.js.map +1 -0
- package/lib/validators/functional/_isFormatPassword.mjs +4 -0
- package/lib/validators/functional/_isFormatPassword.mjs.map +1 -0
- package/lib/validators/functional/_isFormatRegex.d.ts +1 -0
- package/lib/validators/functional/_isFormatRegex.js +14 -0
- package/lib/validators/functional/_isFormatRegex.js.map +1 -0
- package/lib/validators/functional/_isFormatRegex.mjs +12 -0
- package/lib/validators/functional/_isFormatRegex.mjs.map +1 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.d.ts +1 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.js +7 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.js.map +1 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs +5 -0
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs.map +1 -0
- package/lib/validators/functional/_isFormatTime.d.ts +1 -0
- package/lib/validators/functional/_isFormatTime.js +7 -0
- package/lib/validators/functional/_isFormatTime.js.map +1 -0
- package/lib/validators/functional/_isFormatTime.mjs +5 -0
- package/lib/validators/functional/_isFormatTime.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUri.d.ts +1 -0
- package/lib/validators/functional/_isFormatUri.js +8 -0
- package/lib/validators/functional/_isFormatUri.js.map +1 -0
- package/lib/validators/functional/_isFormatUri.mjs +6 -0
- package/lib/validators/functional/_isFormatUri.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUriReference.d.ts +1 -0
- package/lib/validators/functional/_isFormatUriReference.js +7 -0
- package/lib/validators/functional/_isFormatUriReference.js.map +1 -0
- package/lib/validators/functional/_isFormatUriReference.mjs +5 -0
- package/lib/validators/functional/_isFormatUriReference.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUriTemplate.d.ts +1 -0
- package/lib/validators/functional/_isFormatUriTemplate.js +7 -0
- package/lib/validators/functional/_isFormatUriTemplate.js.map +1 -0
- package/lib/validators/functional/_isFormatUriTemplate.mjs +5 -0
- package/lib/validators/functional/_isFormatUriTemplate.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUrl.d.ts +1 -0
- package/lib/validators/functional/_isFormatUrl.js +7 -0
- package/lib/validators/functional/_isFormatUrl.js.map +1 -0
- package/lib/validators/functional/_isFormatUrl.mjs +5 -0
- package/lib/validators/functional/_isFormatUrl.mjs.map +1 -0
- package/lib/validators/functional/_isFormatUuid.d.ts +1 -0
- package/lib/validators/functional/_isFormatUuid.js +7 -0
- package/lib/validators/functional/_isFormatUuid.js.map +1 -0
- package/lib/validators/functional/_isFormatUuid.mjs +5 -0
- package/lib/validators/functional/_isFormatUuid.mjs.map +1 -0
- package/lib/validators/functional/_isUniqueItems.d.ts +1 -0
- package/lib/validators/functional/_isUniqueItems.js +140 -0
- package/lib/validators/functional/_isUniqueItems.js.map +1 -0
- package/lib/validators/functional/_isUniqueItems.mjs +138 -0
- package/lib/validators/functional/_isUniqueItems.mjs.map +1 -0
- package/lib/validators/index.d.ts +2 -0
- package/lib/validators/index.js +27 -0
- package/lib/validators/index.js.map +1 -0
- package/lib/validators/index.mjs +7 -0
- package/lib/validators/index.mjs.map +1 -0
- package/lib/validators/internal/IOpenApiValidatorContext.d.ts +14 -0
- package/lib/validators/internal/IOpenApiValidatorContext.js +3 -0
- package/lib/validators/internal/IOpenApiValidatorContext.js.map +1 -0
- package/lib/validators/internal/IOpenApiValidatorContext.mjs +2 -0
- package/lib/validators/internal/IOpenApiValidatorContext.mjs.map +1 -0
- package/lib/validators/internal/OpenApiArrayValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiArrayValidator.js +32 -0
- package/lib/validators/internal/OpenApiArrayValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiArrayValidator.mjs +47 -0
- package/lib/validators/internal/OpenApiArrayValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiBooleanValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiBooleanValidator.js +10 -0
- package/lib/validators/internal/OpenApiBooleanValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiBooleanValidator.mjs +9 -0
- package/lib/validators/internal/OpenApiBooleanValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiConstantValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiConstantValidator.js +10 -0
- package/lib/validators/internal/OpenApiConstantValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiConstantValidator.mjs +9 -0
- package/lib/validators/internal/OpenApiConstantValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiIntegerValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiIntegerValidator.js +33 -0
- package/lib/validators/internal/OpenApiIntegerValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiIntegerValidator.mjs +47 -0
- package/lib/validators/internal/OpenApiIntegerValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiNumberValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiNumberValidator.js +33 -0
- package/lib/validators/internal/OpenApiNumberValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiNumberValidator.mjs +47 -0
- package/lib/validators/internal/OpenApiNumberValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiObjectValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiObjectValidator.js +58 -0
- package/lib/validators/internal/OpenApiObjectValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiObjectValidator.mjs +68 -0
- package/lib/validators/internal/OpenApiObjectValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiOneOfValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiOneOfValidator.js +182 -0
- package/lib/validators/internal/OpenApiOneOfValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiOneOfValidator.mjs +206 -0
- package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.d.ts +4 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.js +122 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.js.map +1 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs +121 -0
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs.map +1 -0
- package/lib/validators/internal/OpenApiStationValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiStationValidator.js +63 -0
- package/lib/validators/internal/OpenApiStationValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiStationValidator.mjs +107 -0
- package/lib/validators/internal/OpenApiStationValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiStringValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiStringValidator.js +73 -0
- package/lib/validators/internal/OpenApiStringValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiStringValidator.mjs +85 -0
- package/lib/validators/internal/OpenApiStringValidator.mjs.map +1 -0
- package/lib/validators/internal/OpenApiTupleValidator.d.ts +5 -0
- package/lib/validators/internal/OpenApiTupleValidator.js +31 -0
- package/lib/validators/internal/OpenApiTupleValidator.js.map +1 -0
- package/lib/validators/internal/OpenApiTupleValidator.mjs +46 -0
- package/lib/validators/internal/OpenApiTupleValidator.mjs.map +1 -0
- package/package.json +91 -0
- package/src/converters/LlmSchemaConverter.ts +924 -0
- package/src/converters/OpenApiConverter.ts +285 -0
- package/src/converters/index.ts +5 -0
- package/src/converters/internal/LlmDescriptionInverter.ts +178 -0
- package/src/converters/internal/LlmParametersComposer.ts +52 -0
- package/src/converters/internal/OpenApiConstraintShifter.ts +154 -0
- package/src/converters/internal/OpenApiExclusiveEmender.ts +46 -0
- package/src/converters/internal/OpenApiV3Downgrader.ts +355 -0
- package/src/converters/internal/OpenApiV3Upgrader.ts +470 -0
- package/src/converters/internal/OpenApiV3_1Upgrader.ts +685 -0
- package/src/converters/internal/SwaggerV2Downgrader.ts +424 -0
- package/src/converters/internal/SwaggerV2Upgrader.ts +523 -0
- package/src/http/HttpError.ts +107 -0
- package/src/http/HttpLlm.ts +210 -0
- package/src/http/HttpMigration.ts +92 -0
- package/src/http/index.ts +3 -0
- package/src/http/internal/HttpLlmApplicationComposer.ts +308 -0
- package/src/http/internal/HttpLlmFunctionFetcher.ts +37 -0
- package/src/http/internal/HttpMigrateApplicationComposer.ts +56 -0
- package/src/http/internal/HttpMigrateRouteAccessor.ts +135 -0
- package/src/http/internal/HttpMigrateRouteComposer.ts +513 -0
- package/src/http/internal/HttpMigrateRouteFetcher.ts +203 -0
- package/src/http/internal/LlmDataMerger.ts +73 -0
- package/src/index.ts +4 -0
- package/src/utils/ArrayUtil.ts +42 -0
- package/src/utils/MapUtil.ts +15 -0
- package/src/utils/NamingConvention.ts +205 -0
- package/src/utils/Singleton.ts +17 -0
- package/src/utils/StringUtil.ts +14 -0
- package/src/utils/dedent.ts +57 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/internal/EndpointUtil.ts +44 -0
- package/src/utils/internal/JsonDescriptor.ts +70 -0
- package/src/utils/internal/OpenApiTypeCheckerBase.ts +822 -0
- package/src/utils/stringifyValidationFailure.ts +415 -0
- package/src/validators/LlmTypeChecker.ts +402 -0
- package/src/validators/OpenApiTypeChecker.ts +297 -0
- package/src/validators/OpenApiV3TypeChecker.ts +70 -0
- package/src/validators/OpenApiV3_1TypeChecker.ts +86 -0
- package/src/validators/OpenApiValidator.ts +94 -0
- package/src/validators/SwaggerV2TypeChecker.ts +71 -0
- package/src/validators/functional/_isBigintString.ts +8 -0
- package/src/validators/functional/_isFormatByte.ts +7 -0
- package/src/validators/functional/_isFormatDate.ts +3 -0
- package/src/validators/functional/_isFormatDateTime.ts +4 -0
- package/src/validators/functional/_isFormatDuration.ts +4 -0
- package/src/validators/functional/_isFormatEmail.ts +4 -0
- package/src/validators/functional/_isFormatHostname.ts +4 -0
- package/src/validators/functional/_isFormatIdnEmail.ts +4 -0
- package/src/validators/functional/_isFormatIdnHostname.ts +4 -0
- package/src/validators/functional/_isFormatIpv4.ts +4 -0
- package/src/validators/functional/_isFormatIpv6.ts +4 -0
- package/src/validators/functional/_isFormatIri.ts +3 -0
- package/src/validators/functional/_isFormatIriReference.ts +4 -0
- package/src/validators/functional/_isFormatJsonPointer.ts +3 -0
- package/src/validators/functional/_isFormatPassword.ts +1 -0
- package/src/validators/functional/_isFormatRegex.ts +8 -0
- package/src/validators/functional/_isFormatRelativeJsonPointer.ts +4 -0
- package/src/validators/functional/_isFormatTime.ts +4 -0
- package/src/validators/functional/_isFormatUri.ts +6 -0
- package/src/validators/functional/_isFormatUriReference.ts +5 -0
- package/src/validators/functional/_isFormatUriTemplate.ts +4 -0
- package/src/validators/functional/_isFormatUrl.ts +4 -0
- package/src/validators/functional/_isFormatUuid.ts +3 -0
- package/src/validators/functional/_isUniqueItems.ts +159 -0
- package/src/validators/index.ts +14 -0
- package/src/validators/internal/IOpenApiValidatorContext.ts +17 -0
- package/src/validators/internal/OpenApiArrayValidator.ts +49 -0
- package/src/validators/internal/OpenApiBooleanValidator.ts +11 -0
- package/src/validators/internal/OpenApiConstantValidator.ts +11 -0
- package/src/validators/internal/OpenApiIntegerValidator.ts +49 -0
- package/src/validators/internal/OpenApiNumberValidator.ts +48 -0
- package/src/validators/internal/OpenApiObjectValidator.ts +83 -0
- package/src/validators/internal/OpenApiOneOfValidator.ts +309 -0
- package/src/validators/internal/OpenApiSchemaNamingRule.ts +124 -0
- package/src/validators/internal/OpenApiStationValidator.ts +115 -0
- package/src/validators/internal/OpenApiStringValidator.ts +88 -0
- package/src/validators/internal/OpenApiTupleValidator.ts +55 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { OpenApiV3 } from "@typia/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type checker for raw OpenAPI v3.0 JSON schemas.
|
|
5
|
+
*
|
|
6
|
+
* `OpenApiV3TypeChecker` provides type guard functions for
|
|
7
|
+
* {@link OpenApiV3.IJsonSchema} (raw, unemended format). For typia's normalized
|
|
8
|
+
* format, use {@link OpenApiTypeChecker} instead.
|
|
9
|
+
*
|
|
10
|
+
* Key differences from v3.1: v3.0 uses `nullable: true` property instead of
|
|
11
|
+
* union types, and has no `const` or tuple support.
|
|
12
|
+
*
|
|
13
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
14
|
+
*/
|
|
15
|
+
export namespace OpenApiV3TypeChecker {
|
|
16
|
+
export const isBoolean = (
|
|
17
|
+
schema: OpenApiV3.IJsonSchema,
|
|
18
|
+
): schema is OpenApiV3.IJsonSchema.IBoolean =>
|
|
19
|
+
(schema as OpenApiV3.IJsonSchema.IBoolean).type === "boolean";
|
|
20
|
+
|
|
21
|
+
export const isInteger = (
|
|
22
|
+
schema: OpenApiV3.IJsonSchema,
|
|
23
|
+
): schema is OpenApiV3.IJsonSchema.IInteger =>
|
|
24
|
+
(schema as OpenApiV3.IJsonSchema.IInteger).type === "integer";
|
|
25
|
+
|
|
26
|
+
export const isNumber = (
|
|
27
|
+
schema: OpenApiV3.IJsonSchema,
|
|
28
|
+
): schema is OpenApiV3.IJsonSchema.INumber =>
|
|
29
|
+
(schema as OpenApiV3.IJsonSchema.INumber).type === "number";
|
|
30
|
+
|
|
31
|
+
export const isString = (
|
|
32
|
+
schema: OpenApiV3.IJsonSchema,
|
|
33
|
+
): schema is OpenApiV3.IJsonSchema.IString =>
|
|
34
|
+
(schema as OpenApiV3.IJsonSchema.IString).type === "string";
|
|
35
|
+
|
|
36
|
+
export const isArray = (
|
|
37
|
+
schema: OpenApiV3.IJsonSchema,
|
|
38
|
+
): schema is OpenApiV3.IJsonSchema.IArray =>
|
|
39
|
+
(schema as OpenApiV3.IJsonSchema.IArray).type === "array";
|
|
40
|
+
|
|
41
|
+
export const isObject = (
|
|
42
|
+
schema: OpenApiV3.IJsonSchema,
|
|
43
|
+
): schema is OpenApiV3.IJsonSchema.IObject =>
|
|
44
|
+
(schema as OpenApiV3.IJsonSchema.IObject).type === "object";
|
|
45
|
+
|
|
46
|
+
export const isReference = (
|
|
47
|
+
schema: OpenApiV3.IJsonSchema,
|
|
48
|
+
): schema is OpenApiV3.IJsonSchema.IReference =>
|
|
49
|
+
(schema as OpenApiV3.IJsonSchema.IReference).$ref !== undefined;
|
|
50
|
+
|
|
51
|
+
export const isAllOf = (
|
|
52
|
+
schema: OpenApiV3.IJsonSchema,
|
|
53
|
+
): schema is OpenApiV3.IJsonSchema.IAllOf =>
|
|
54
|
+
(schema as OpenApiV3.IJsonSchema.IAllOf).allOf !== undefined;
|
|
55
|
+
|
|
56
|
+
export const isAnyOf = (
|
|
57
|
+
schema: OpenApiV3.IJsonSchema,
|
|
58
|
+
): schema is OpenApiV3.IJsonSchema.IAnyOf =>
|
|
59
|
+
(schema as OpenApiV3.IJsonSchema.IAnyOf).anyOf !== undefined;
|
|
60
|
+
|
|
61
|
+
export const isOneOf = (
|
|
62
|
+
schema: OpenApiV3.IJsonSchema,
|
|
63
|
+
): schema is OpenApiV3.IJsonSchema.IOneOf =>
|
|
64
|
+
(schema as OpenApiV3.IJsonSchema.IOneOf).oneOf !== undefined;
|
|
65
|
+
|
|
66
|
+
export const isNullOnly = (
|
|
67
|
+
schema: OpenApiV3.IJsonSchema,
|
|
68
|
+
): schema is OpenApiV3.IJsonSchema.INullOnly =>
|
|
69
|
+
(schema as OpenApiV3.IJsonSchema.INullOnly).type === "null";
|
|
70
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { OpenApiV3_1 } from "@typia/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type checker for raw OpenAPI v3.1 JSON schemas.
|
|
5
|
+
*
|
|
6
|
+
* `OpenApiV3_1TypeChecker` provides type guard functions for
|
|
7
|
+
* {@link OpenApiV3_1.IJsonSchema} (raw, unemended format). For typia's
|
|
8
|
+
* normalized format, use {@link OpenApiTypeChecker} instead.
|
|
9
|
+
*
|
|
10
|
+
* Key v3.1 features: `const` keyword, `type` arrays (`["string", "null"]`),
|
|
11
|
+
* `prefixItems` for tuples, JSON Schema draft 2020-12 compatibility.
|
|
12
|
+
*
|
|
13
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
14
|
+
*/
|
|
15
|
+
export namespace OpenApiV3_1TypeChecker {
|
|
16
|
+
export const isConstant = (
|
|
17
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
18
|
+
): schema is OpenApiV3_1.IJsonSchema.IConstant =>
|
|
19
|
+
(schema as OpenApiV3_1.IJsonSchema.IConstant).const !== undefined;
|
|
20
|
+
|
|
21
|
+
export const isBoolean = (
|
|
22
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
23
|
+
): schema is OpenApiV3_1.IJsonSchema.IBoolean =>
|
|
24
|
+
(schema as OpenApiV3_1.IJsonSchema.IBoolean).type === "boolean";
|
|
25
|
+
|
|
26
|
+
export const isInteger = (
|
|
27
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
28
|
+
): schema is OpenApiV3_1.IJsonSchema.IInteger =>
|
|
29
|
+
(schema as OpenApiV3_1.IJsonSchema.IInteger).type === "integer";
|
|
30
|
+
|
|
31
|
+
export const isNumber = (
|
|
32
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
33
|
+
): schema is OpenApiV3_1.IJsonSchema.INumber =>
|
|
34
|
+
(schema as OpenApiV3_1.IJsonSchema.INumber).type === "number";
|
|
35
|
+
|
|
36
|
+
export const isString = (
|
|
37
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
38
|
+
): schema is OpenApiV3_1.IJsonSchema.IString =>
|
|
39
|
+
(schema as OpenApiV3_1.IJsonSchema.IString).type === "string";
|
|
40
|
+
|
|
41
|
+
export const isArray = (
|
|
42
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
43
|
+
): schema is OpenApiV3_1.IJsonSchema.IArray =>
|
|
44
|
+
(schema as OpenApiV3_1.IJsonSchema.IArray).type === "array";
|
|
45
|
+
|
|
46
|
+
export const isObject = (
|
|
47
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
48
|
+
): schema is OpenApiV3_1.IJsonSchema.IObject =>
|
|
49
|
+
(schema as OpenApiV3_1.IJsonSchema.IObject).type === "object";
|
|
50
|
+
|
|
51
|
+
export const isReference = (
|
|
52
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
53
|
+
): schema is OpenApiV3_1.IJsonSchema.IReference =>
|
|
54
|
+
(schema as OpenApiV3_1.IJsonSchema.IReference).$ref !== undefined;
|
|
55
|
+
|
|
56
|
+
export const isRecursiveReference = (
|
|
57
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
58
|
+
): schema is OpenApiV3_1.IJsonSchema.IRecursiveReference =>
|
|
59
|
+
(schema as OpenApiV3_1.IJsonSchema.IRecursiveReference).$recursiveRef !==
|
|
60
|
+
undefined;
|
|
61
|
+
|
|
62
|
+
export const isAllOf = (
|
|
63
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
64
|
+
): schema is OpenApiV3_1.IJsonSchema.IAllOf =>
|
|
65
|
+
(schema as OpenApiV3_1.IJsonSchema.IAllOf).allOf !== undefined;
|
|
66
|
+
|
|
67
|
+
export const isAnyOf = (
|
|
68
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
69
|
+
): schema is OpenApiV3_1.IJsonSchema.IAnyOf =>
|
|
70
|
+
(schema as OpenApiV3_1.IJsonSchema.IAnyOf).anyOf !== undefined;
|
|
71
|
+
|
|
72
|
+
export const isOneOf = (
|
|
73
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
74
|
+
): schema is OpenApiV3_1.IJsonSchema.IOneOf =>
|
|
75
|
+
(schema as OpenApiV3_1.IJsonSchema.IOneOf).oneOf !== undefined;
|
|
76
|
+
|
|
77
|
+
export const isNullOnly = (
|
|
78
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
79
|
+
): schema is OpenApiV3_1.IJsonSchema.INull =>
|
|
80
|
+
(schema as OpenApiV3_1.IJsonSchema.INull).type === "null";
|
|
81
|
+
|
|
82
|
+
export const isMixed = (
|
|
83
|
+
schema: OpenApiV3_1.IJsonSchema,
|
|
84
|
+
): schema is OpenApiV3_1.IJsonSchema.IMixed =>
|
|
85
|
+
Array.isArray((schema as OpenApiV3_1.IJsonSchema.IMixed).type);
|
|
86
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { IValidation, OpenApi } from "@typia/interface";
|
|
2
|
+
|
|
3
|
+
import { OpenApiStationValidator } from "./internal/OpenApiStationValidator";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* OpenAPI JSON Schema validator.
|
|
7
|
+
*
|
|
8
|
+
* `OpenApiValidator` validates runtime data against {@link OpenApi.IJsonSchema}
|
|
9
|
+
* definitions. Returns {@link IValidation} with detailed error paths and
|
|
10
|
+
* expected types.
|
|
11
|
+
*
|
|
12
|
+
* Primary use case: Validating LLM-generated function call arguments. LLMs
|
|
13
|
+
* frequently make type errors (e.g., `"123"` instead of `123`). Use the
|
|
14
|
+
* validation errors to provide feedback and retry.
|
|
15
|
+
*
|
|
16
|
+
* Functions:
|
|
17
|
+
*
|
|
18
|
+
* - {@link create}: Create reusable validator function from schema
|
|
19
|
+
* - {@link validate}: One-shot validation with inline schema
|
|
20
|
+
*
|
|
21
|
+
* Set `equals: true` to reject objects with extra properties (strict mode).
|
|
22
|
+
*
|
|
23
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
24
|
+
*/
|
|
25
|
+
export namespace OpenApiValidator {
|
|
26
|
+
export const create =
|
|
27
|
+
(props: {
|
|
28
|
+
components: OpenApi.IComponents;
|
|
29
|
+
schema: OpenApi.IJsonSchema;
|
|
30
|
+
required: boolean;
|
|
31
|
+
equals?: boolean;
|
|
32
|
+
}) =>
|
|
33
|
+
(value: unknown): IValidation<unknown> =>
|
|
34
|
+
validate({ ...props, value });
|
|
35
|
+
|
|
36
|
+
export const validate = (props: {
|
|
37
|
+
components: OpenApi.IComponents;
|
|
38
|
+
schema: OpenApi.IJsonSchema;
|
|
39
|
+
value: unknown;
|
|
40
|
+
required: boolean;
|
|
41
|
+
equals?: boolean;
|
|
42
|
+
}): IValidation<unknown> => {
|
|
43
|
+
const errors: IValidation.IError[] = [];
|
|
44
|
+
OpenApiStationValidator.validate({
|
|
45
|
+
...props,
|
|
46
|
+
path: "$input",
|
|
47
|
+
exceptionable: true,
|
|
48
|
+
report: createReporter(errors),
|
|
49
|
+
equals: props.equals ?? false,
|
|
50
|
+
});
|
|
51
|
+
return errors.length === 0
|
|
52
|
+
? {
|
|
53
|
+
success: true,
|
|
54
|
+
data: props.value,
|
|
55
|
+
}
|
|
56
|
+
: {
|
|
57
|
+
success: false,
|
|
58
|
+
data: props.value,
|
|
59
|
+
errors,
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const createReporter = (array: IValidation.IError[]) => {
|
|
64
|
+
const reportable = (path: string): boolean => {
|
|
65
|
+
if (array.length === 0) return true;
|
|
66
|
+
const last: string = array[array.length - 1]!.path;
|
|
67
|
+
return (
|
|
68
|
+
path.length > last.length || last.substring(0, path.length) !== path
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
return (
|
|
72
|
+
error: IValidation.IError & {
|
|
73
|
+
exceptionable: boolean;
|
|
74
|
+
},
|
|
75
|
+
): false => {
|
|
76
|
+
if (error.exceptionable && reportable(error.path)) {
|
|
77
|
+
const info: IValidation.IError = {
|
|
78
|
+
path: error.path,
|
|
79
|
+
expected: error.expected,
|
|
80
|
+
value: error.value,
|
|
81
|
+
description: error.description,
|
|
82
|
+
};
|
|
83
|
+
if (error.value === undefined)
|
|
84
|
+
info.description ??= [
|
|
85
|
+
"The value at this path is `undefined`.",
|
|
86
|
+
"",
|
|
87
|
+
`Please fill the \`${error.expected}\` typed value next time.`,
|
|
88
|
+
].join("\n");
|
|
89
|
+
array.push(info);
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SwaggerV2 } from "@typia/interface";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Type checker for Swagger v2.0 (OpenAPI v2) JSON schemas.
|
|
5
|
+
*
|
|
6
|
+
* `SwaggerV2TypeChecker` provides type guard functions for
|
|
7
|
+
* {@link SwaggerV2.IJsonSchema}. For typia's normalized format, use
|
|
8
|
+
* {@link OpenApiTypeChecker} instead.
|
|
9
|
+
*
|
|
10
|
+
* Key limitations vs OpenAPI v3.x: No `oneOf`/`anyOf`, no `nullable`, uses
|
|
11
|
+
* `definitions` instead of `components.schemas`, body parameters use `in:
|
|
12
|
+
* "body"` with `schema` property.
|
|
13
|
+
*
|
|
14
|
+
* @author Jeongho Nam - https://github.com/samchon
|
|
15
|
+
*/
|
|
16
|
+
export namespace SwaggerV2TypeChecker {
|
|
17
|
+
export const isBoolean = (
|
|
18
|
+
schema: SwaggerV2.IJsonSchema,
|
|
19
|
+
): schema is SwaggerV2.IJsonSchema.IBoolean =>
|
|
20
|
+
(schema as SwaggerV2.IJsonSchema.IBoolean).type === "boolean";
|
|
21
|
+
|
|
22
|
+
export const isInteger = (
|
|
23
|
+
schema: SwaggerV2.IJsonSchema,
|
|
24
|
+
): schema is SwaggerV2.IJsonSchema.IInteger =>
|
|
25
|
+
(schema as SwaggerV2.IJsonSchema.IInteger).type === "integer";
|
|
26
|
+
|
|
27
|
+
export const isNumber = (
|
|
28
|
+
schema: SwaggerV2.IJsonSchema,
|
|
29
|
+
): schema is SwaggerV2.IJsonSchema.INumber =>
|
|
30
|
+
(schema as SwaggerV2.IJsonSchema.INumber).type === "number";
|
|
31
|
+
|
|
32
|
+
export const isString = (
|
|
33
|
+
schema: SwaggerV2.IJsonSchema,
|
|
34
|
+
): schema is SwaggerV2.IJsonSchema.IString =>
|
|
35
|
+
(schema as SwaggerV2.IJsonSchema.IString).type === "string";
|
|
36
|
+
|
|
37
|
+
export const isArray = (
|
|
38
|
+
schema: SwaggerV2.IJsonSchema,
|
|
39
|
+
): schema is SwaggerV2.IJsonSchema.IArray =>
|
|
40
|
+
(schema as SwaggerV2.IJsonSchema.IArray).type === "array";
|
|
41
|
+
|
|
42
|
+
export const isObject = (
|
|
43
|
+
schema: SwaggerV2.IJsonSchema,
|
|
44
|
+
): schema is SwaggerV2.IJsonSchema.IObject =>
|
|
45
|
+
(schema as SwaggerV2.IJsonSchema.IObject).type === "object";
|
|
46
|
+
|
|
47
|
+
export const isReference = (
|
|
48
|
+
schema: SwaggerV2.IJsonSchema,
|
|
49
|
+
): schema is SwaggerV2.IJsonSchema.IReference =>
|
|
50
|
+
(schema as SwaggerV2.IJsonSchema.IReference).$ref !== undefined;
|
|
51
|
+
|
|
52
|
+
export const isAllOf = (
|
|
53
|
+
schema: SwaggerV2.IJsonSchema,
|
|
54
|
+
): schema is SwaggerV2.IJsonSchema.IAllOf =>
|
|
55
|
+
(schema as SwaggerV2.IJsonSchema.IAllOf).allOf !== undefined;
|
|
56
|
+
|
|
57
|
+
export const isOneOf = (
|
|
58
|
+
schema: SwaggerV2.IJsonSchema,
|
|
59
|
+
): schema is SwaggerV2.IJsonSchema.IOneOf =>
|
|
60
|
+
(schema as SwaggerV2.IJsonSchema.IOneOf)["x-oneOf"] !== undefined;
|
|
61
|
+
|
|
62
|
+
export const isAnyOf = (
|
|
63
|
+
schema: SwaggerV2.IJsonSchema,
|
|
64
|
+
): schema is SwaggerV2.IJsonSchema.IAnyOf =>
|
|
65
|
+
(schema as SwaggerV2.IJsonSchema.IAnyOf)["x-anyOf"] !== undefined;
|
|
66
|
+
|
|
67
|
+
export const isNullOnly = (
|
|
68
|
+
schema: SwaggerV2.IJsonSchema,
|
|
69
|
+
): schema is SwaggerV2.IJsonSchema.INullOnly =>
|
|
70
|
+
(schema as SwaggerV2.IJsonSchema.INullOnly).type === "null";
|
|
71
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const _isFormatIpv6 = (str: string): boolean => PATTERN.test(str);
|
|
2
|
+
|
|
3
|
+
const PATTERN =
|
|
4
|
+
/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const _isFormatPassword = (): boolean => true;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const _isFormatUri = (str: string): boolean =>
|
|
2
|
+
NOT_URI_FRAGMENT.test(str) && URI.test(str);
|
|
3
|
+
|
|
4
|
+
const NOT_URI_FRAGMENT = /\/|:/;
|
|
5
|
+
const URI =
|
|
6
|
+
/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const _isFormatUriReference = (str: string): boolean =>
|
|
2
|
+
PATTERN.test(str);
|
|
3
|
+
|
|
4
|
+
const PATTERN =
|
|
5
|
+
/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const _isFormatUriTemplate = (str: string): boolean => PATTERN.test(str);
|
|
2
|
+
|
|
3
|
+
const PATTERN =
|
|
4
|
+
/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const _isFormatUrl = (str: string): boolean => PATTERN.test(str);
|
|
2
|
+
|
|
3
|
+
const PATTERN =
|
|
4
|
+
/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
export const _isUniqueItems = (elements: any[]): boolean => {
|
|
2
|
+
// EMPTY OR ONLY ONE
|
|
3
|
+
if (elements.length < 2) return true;
|
|
4
|
+
|
|
5
|
+
// SHALLOW COMPARISON
|
|
6
|
+
if (["boolean", "bigint", "number", "string"].includes(typeof elements[0]))
|
|
7
|
+
return new Set(elements).size === elements.length;
|
|
8
|
+
|
|
9
|
+
// DEEP COMPARISON
|
|
10
|
+
for (let i = 0; i < elements.length; i++)
|
|
11
|
+
for (let j = i + 1; j < elements.length; j++)
|
|
12
|
+
if (equals(new WeakMap())(elements[i], elements[j])) return false;
|
|
13
|
+
return true;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const equals = (visited: WeakMap<object, WeakMap<object, boolean>>) => {
|
|
17
|
+
const next = (a: any, b: any): boolean => {
|
|
18
|
+
// SHALLOW EQUAL
|
|
19
|
+
if (a === b) return true;
|
|
20
|
+
else if (typeof a !== typeof b || typeof a !== "object") return false;
|
|
21
|
+
// COMPARE CONTAINERS
|
|
22
|
+
else if (Array.isArray(a))
|
|
23
|
+
return Array.isArray(b) && a.map((x, i) => next(x, b[i])).every((x) => x);
|
|
24
|
+
else if (a instanceof Set)
|
|
25
|
+
return (
|
|
26
|
+
b instanceof Set && a.size === b.size && [...a].every((x) => b.has(x))
|
|
27
|
+
);
|
|
28
|
+
else if (a instanceof Map)
|
|
29
|
+
return (
|
|
30
|
+
b instanceof Map &&
|
|
31
|
+
a.size === b.size &&
|
|
32
|
+
[...a].every(([k, v]) => b.has(k) && next(v, b.get(k)))
|
|
33
|
+
);
|
|
34
|
+
// ATOMIC CLASSES
|
|
35
|
+
else if (a instanceof Boolean)
|
|
36
|
+
return b instanceof Boolean
|
|
37
|
+
? a.valueOf() === b.valueOf()
|
|
38
|
+
: a.valueOf() === b;
|
|
39
|
+
else if (a instanceof BigInt)
|
|
40
|
+
return b instanceof BigInt ? a === b : a === BigInt(b);
|
|
41
|
+
else if (a instanceof Number)
|
|
42
|
+
return b instanceof Number
|
|
43
|
+
? a.valueOf() === b.valueOf()
|
|
44
|
+
: a.valueOf() === b;
|
|
45
|
+
else if (a instanceof String)
|
|
46
|
+
return b instanceof String
|
|
47
|
+
? a.valueOf() === b.valueOf()
|
|
48
|
+
: a.valueOf() === b;
|
|
49
|
+
else if (a instanceof Date)
|
|
50
|
+
return b instanceof Date && a.getTime() === b.getTime();
|
|
51
|
+
// BINARY DATA
|
|
52
|
+
else if (a instanceof Uint8Array)
|
|
53
|
+
return (
|
|
54
|
+
b instanceof Uint8Array &&
|
|
55
|
+
a.length === b.length &&
|
|
56
|
+
a.every((x, i) => x === b[i])
|
|
57
|
+
);
|
|
58
|
+
else if (a instanceof Uint8ClampedArray)
|
|
59
|
+
return (
|
|
60
|
+
b instanceof Uint8ClampedArray &&
|
|
61
|
+
a.length === b.length &&
|
|
62
|
+
a.every((x, i) => x === b[i])
|
|
63
|
+
);
|
|
64
|
+
else if (a instanceof Uint16Array)
|
|
65
|
+
return (
|
|
66
|
+
b instanceof Uint16Array &&
|
|
67
|
+
a.length === b.length &&
|
|
68
|
+
a.every((x, i) => x === b[i])
|
|
69
|
+
);
|
|
70
|
+
else if (a instanceof Uint32Array)
|
|
71
|
+
return (
|
|
72
|
+
b instanceof Uint32Array &&
|
|
73
|
+
a.length === b.length &&
|
|
74
|
+
a.every((x, i) => x === b[i])
|
|
75
|
+
);
|
|
76
|
+
else if (a instanceof BigUint64Array)
|
|
77
|
+
return (
|
|
78
|
+
b instanceof BigUint64Array &&
|
|
79
|
+
a.length === b.length &&
|
|
80
|
+
a.every((x, i) => x === b[i])
|
|
81
|
+
);
|
|
82
|
+
else if (a instanceof Int8Array)
|
|
83
|
+
return (
|
|
84
|
+
b instanceof Int8Array &&
|
|
85
|
+
a.length === b.length &&
|
|
86
|
+
a.every((x, i) => x === b[i])
|
|
87
|
+
);
|
|
88
|
+
else if (a instanceof Int16Array)
|
|
89
|
+
return (
|
|
90
|
+
b instanceof Int16Array &&
|
|
91
|
+
a.length === b.length &&
|
|
92
|
+
a.every((x, i) => x === b[i])
|
|
93
|
+
);
|
|
94
|
+
else if (a instanceof Int32Array)
|
|
95
|
+
return (
|
|
96
|
+
b instanceof Int32Array &&
|
|
97
|
+
a.length === b.length &&
|
|
98
|
+
a.every((x, i) => x === b[i])
|
|
99
|
+
);
|
|
100
|
+
else if (a instanceof BigInt64Array)
|
|
101
|
+
return (
|
|
102
|
+
b instanceof BigInt64Array &&
|
|
103
|
+
a.length === b.length &&
|
|
104
|
+
a.every((x, i) => x === b[i])
|
|
105
|
+
);
|
|
106
|
+
else if (a instanceof Float32Array)
|
|
107
|
+
return (
|
|
108
|
+
b instanceof Float32Array &&
|
|
109
|
+
a.length === b.length &&
|
|
110
|
+
a.every((x, i) => x === b[i])
|
|
111
|
+
);
|
|
112
|
+
else if (a instanceof Float64Array)
|
|
113
|
+
return (
|
|
114
|
+
b instanceof Float64Array &&
|
|
115
|
+
a.length === b.length &&
|
|
116
|
+
a.every((x, i) => x === b[i])
|
|
117
|
+
);
|
|
118
|
+
else if (a instanceof ArrayBuffer) {
|
|
119
|
+
if (!(b instanceof ArrayBuffer) || a.byteLength !== b.byteLength)
|
|
120
|
+
return false;
|
|
121
|
+
const x: Uint8Array = new Uint8Array(a);
|
|
122
|
+
const y: Uint8Array = new Uint8Array(b);
|
|
123
|
+
return x.every((v, i) => v === y[i]);
|
|
124
|
+
} else if (a instanceof SharedArrayBuffer) {
|
|
125
|
+
if (!(b instanceof SharedArrayBuffer) || a.byteLength !== b.byteLength)
|
|
126
|
+
return false;
|
|
127
|
+
const x: Uint8Array = new Uint8Array(a);
|
|
128
|
+
const y: Uint8Array = new Uint8Array(b);
|
|
129
|
+
return x.every((v, i) => v === y[i]);
|
|
130
|
+
} else if (a instanceof DataView) {
|
|
131
|
+
if (!(b instanceof DataView) || a.byteLength !== b.byteLength)
|
|
132
|
+
return false;
|
|
133
|
+
const x: Uint8Array = new Uint8Array(a.buffer);
|
|
134
|
+
const y: Uint8Array = new Uint8Array(b.buffer);
|
|
135
|
+
return x.every((v, i) => v === y[i]);
|
|
136
|
+
} else if (a instanceof File)
|
|
137
|
+
return (
|
|
138
|
+
b instanceof File &&
|
|
139
|
+
a.name === b.name &&
|
|
140
|
+
a.size === b.size &&
|
|
141
|
+
a.type === b.type &&
|
|
142
|
+
next(a.slice(), b.slice())
|
|
143
|
+
);
|
|
144
|
+
// JUST PLAIN OBJECTS
|
|
145
|
+
else if (a !== null && b !== null) {
|
|
146
|
+
if (visited.has(a) && visited.get(a)!.has(b))
|
|
147
|
+
return visited.get(a)!.get(b)!;
|
|
148
|
+
if (!visited.has(a)) visited.set(a, new WeakMap());
|
|
149
|
+
visited.get(a)!.set(b, true);
|
|
150
|
+
const res: boolean =
|
|
151
|
+
Object.keys(a).length === Object.keys(b).length &&
|
|
152
|
+
Object.keys(a).every((x) => next(a[x], b[x]));
|
|
153
|
+
visited.get(a)!.set(b, res);
|
|
154
|
+
return res;
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
};
|
|
158
|
+
return next;
|
|
159
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./LlmTypeChecker";
|
|
2
|
+
export * from "./OpenApiTypeChecker";
|
|
3
|
+
|
|
4
|
+
/** @internal */
|
|
5
|
+
export * from "./OpenApiV3TypeChecker";
|
|
6
|
+
|
|
7
|
+
/** @internal */
|
|
8
|
+
export * from "./OpenApiV3_1TypeChecker";
|
|
9
|
+
|
|
10
|
+
/** @internal */
|
|
11
|
+
export * from "./SwaggerV2TypeChecker";
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export * from "./OpenApiValidator";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IValidation, OpenApi } from "@typia/interface";
|
|
2
|
+
|
|
3
|
+
export interface IOpenApiValidatorContext<Schema extends OpenApi.IJsonSchema> {
|
|
4
|
+
components: OpenApi.IComponents;
|
|
5
|
+
schema: Schema;
|
|
6
|
+
value: unknown;
|
|
7
|
+
path: string;
|
|
8
|
+
report: (
|
|
9
|
+
error: IValidation.IError & {
|
|
10
|
+
exceptionable: boolean;
|
|
11
|
+
},
|
|
12
|
+
) => false;
|
|
13
|
+
exceptionable: boolean;
|
|
14
|
+
expected: string;
|
|
15
|
+
equals: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
}
|