@typia/utils 13.0.0-dev.20260427-2 → 13.0.0-dev.20260430
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/lib/converters/LlmSchemaConverter.js +6 -15
- package/lib/converters/LlmSchemaConverter.js.map +1 -1
- package/lib/converters/LlmSchemaConverter.mjs +2 -7
- package/lib/converters/LlmSchemaConverter.mjs.map +1 -1
- package/lib/converters/LlmSchemaConverter2.mjs +440 -451
- package/lib/converters/LlmSchemaConverter2.mjs.map +1 -1
- package/lib/converters/OpenApiConverter.mjs +2 -7
- package/lib/converters/OpenApiConverter.mjs.map +1 -1
- package/lib/converters/OpenApiConverter2.mjs +163 -164
- package/lib/converters/OpenApiConverter2.mjs.map +1 -1
- package/lib/converters/index.mjs +1 -7
- package/lib/converters/index.mjs.map +1 -1
- package/lib/converters/index2.mjs +31 -32
- package/lib/converters/index2.mjs.map +1 -1
- package/lib/converters/internal/LlmDescriptionInverter.mjs +2 -7
- package/lib/converters/internal/LlmDescriptionInverter.mjs.map +1 -1
- package/lib/converters/internal/LlmDescriptionInverter2.mjs +143 -150
- package/lib/converters/internal/LlmDescriptionInverter2.mjs.map +1 -1
- package/lib/converters/internal/LlmParametersComposer.mjs +2 -7
- package/lib/converters/internal/LlmParametersComposer.mjs.map +1 -1
- package/lib/converters/internal/LlmParametersComposer2.mjs +37 -44
- package/lib/converters/internal/LlmParametersComposer2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiConstraintShifter.mjs +2 -7
- package/lib/converters/internal/OpenApiConstraintShifter.mjs.map +1 -1
- package/lib/converters/internal/OpenApiConstraintShifter2.mjs +105 -112
- package/lib/converters/internal/OpenApiConstraintShifter2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs +2 -7
- package/lib/converters/internal/OpenApiExclusiveEmender.mjs.map +1 -1
- package/lib/converters/internal/OpenApiExclusiveEmender2.mjs +32 -40
- package/lib/converters/internal/OpenApiExclusiveEmender2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Downgrader.mjs +2 -7
- package/lib/converters/internal/OpenApiV3Downgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Downgrader2.mjs +237 -244
- package/lib/converters/internal/OpenApiV3Downgrader2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Upgrader.mjs +2 -7
- package/lib/converters/internal/OpenApiV3Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3Upgrader2.mjs +300 -305
- package/lib/converters/internal/OpenApiV3Upgrader2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Downgrader.mjs +2 -7
- package/lib/converters/internal/OpenApiV3_1Downgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs +193 -200
- package/lib/converters/internal/OpenApiV3_1Downgrader2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs +2 -7
- package/lib/converters/internal/OpenApiV3_1Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs +424 -429
- package/lib/converters/internal/OpenApiV3_1Upgrader2.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_2Upgrader.mjs +2 -7
- package/lib/converters/internal/OpenApiV3_2Upgrader.mjs.map +1 -1
- package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs +202 -208
- package/lib/converters/internal/OpenApiV3_2Upgrader2.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Downgrader.mjs +2 -7
- package/lib/converters/internal/SwaggerV2Downgrader.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Downgrader2.mjs +287 -294
- package/lib/converters/internal/SwaggerV2Downgrader2.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Upgrader.mjs +2 -7
- package/lib/converters/internal/SwaggerV2Upgrader.mjs.map +1 -1
- package/lib/converters/internal/SwaggerV2Upgrader2.mjs +370 -375
- package/lib/converters/internal/SwaggerV2Upgrader2.mjs.map +1 -1
- package/lib/http/HttpError.mjs +2 -7
- package/lib/http/HttpError.mjs.map +1 -1
- package/lib/http/HttpError2.mjs +69 -77
- package/lib/http/HttpError2.mjs.map +1 -1
- package/lib/http/HttpLlm.mjs +2 -7
- package/lib/http/HttpLlm.mjs.map +1 -1
- package/lib/http/HttpLlm2.mjs +107 -112
- package/lib/http/HttpLlm2.mjs.map +1 -1
- package/lib/http/HttpMigration.mjs +2 -7
- package/lib/http/HttpMigration.mjs.map +1 -1
- package/lib/http/HttpMigration2.mjs +58 -63
- package/lib/http/HttpMigration2.mjs.map +1 -1
- package/lib/http/index.mjs +1 -7
- package/lib/http/index.mjs.map +1 -1
- package/lib/http/index2.mjs +30 -31
- package/lib/http/index2.mjs.map +1 -1
- package/lib/http/internal/HttpLlmApplicationComposer.mjs +2 -7
- package/lib/http/internal/HttpLlmApplicationComposer.mjs.map +1 -1
- package/lib/http/internal/HttpLlmApplicationComposer2.mjs +301 -306
- package/lib/http/internal/HttpLlmApplicationComposer2.mjs.map +1 -1
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs +2 -7
- package/lib/http/internal/HttpLlmFunctionFetcher.mjs.map +1 -1
- package/lib/http/internal/HttpLlmFunctionFetcher2.mjs +26 -33
- package/lib/http/internal/HttpLlmFunctionFetcher2.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs +2 -7
- package/lib/http/internal/HttpMigrateApplicationComposer.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateApplicationComposer2.mjs +51 -56
- package/lib/http/internal/HttpMigrateApplicationComposer2.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs +2 -7
- package/lib/http/internal/HttpMigrateRouteAccessor.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteAccessor2.mjs +113 -118
- package/lib/http/internal/HttpMigrateRouteAccessor2.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteComposer.mjs +2 -7
- package/lib/http/internal/HttpMigrateRouteComposer.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteComposer2.mjs +376 -381
- package/lib/http/internal/HttpMigrateRouteComposer2.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs +2 -7
- package/lib/http/internal/HttpMigrateRouteFetcher.mjs.map +1 -1
- package/lib/http/internal/HttpMigrateRouteFetcher2.mjs +182 -189
- package/lib/http/internal/HttpMigrateRouteFetcher2.mjs.map +1 -1
- package/lib/index.mjs +1 -7
- package/lib/index.mjs.map +1 -1
- package/lib/index2.mjs +33 -33
- package/lib/index2.mjs.map +1 -1
- package/lib/utils/ArrayUtil.mjs +2 -7
- package/lib/utils/ArrayUtil.mjs.map +1 -1
- package/lib/utils/ArrayUtil2.mjs +29 -37
- package/lib/utils/ArrayUtil2.mjs.map +1 -1
- package/lib/utils/LlmJson.mjs +2 -7
- package/lib/utils/LlmJson.mjs.map +1 -1
- package/lib/utils/LlmJson2.mjs +166 -169
- package/lib/utils/LlmJson2.mjs.map +1 -1
- package/lib/utils/MapUtil.mjs +2 -7
- package/lib/utils/MapUtil.mjs.map +1 -1
- package/lib/utils/MapUtil2.mjs +16 -24
- package/lib/utils/MapUtil2.mjs.map +1 -1
- package/lib/utils/NamingConvention.mjs +2 -7
- package/lib/utils/NamingConvention.mjs.map +1 -1
- package/lib/utils/NamingConvention2.mjs +199 -207
- package/lib/utils/NamingConvention2.mjs.map +1 -1
- package/lib/utils/Singleton.d.ts +1 -6
- package/lib/utils/Singleton.js +1 -0
- package/lib/utils/Singleton.js.map +1 -1
- package/lib/utils/Singleton.mjs +2 -7
- package/lib/utils/Singleton.mjs.map +1 -1
- package/lib/utils/Singleton2.mjs +17 -24
- package/lib/utils/Singleton2.mjs.map +1 -1
- package/lib/utils/StringUtil.mjs +2 -7
- package/lib/utils/StringUtil.mjs.map +1 -1
- package/lib/utils/StringUtil2.mjs +14 -22
- package/lib/utils/StringUtil2.mjs.map +1 -1
- package/lib/utils/dedent.mjs +2 -7
- package/lib/utils/dedent.mjs.map +1 -1
- package/lib/utils/dedent2.mjs +50 -58
- package/lib/utils/dedent2.mjs.map +1 -1
- package/lib/utils/index.mjs +1 -7
- package/lib/utils/index.mjs.map +1 -1
- package/lib/utils/index2.mjs +42 -39
- package/lib/utils/index2.mjs.map +1 -1
- package/lib/utils/internal/EndpointUtil.mjs +2 -7
- package/lib/utils/internal/EndpointUtil.mjs.map +1 -1
- package/lib/utils/internal/EndpointUtil2.mjs +39 -46
- package/lib/utils/internal/EndpointUtil2.mjs.map +1 -1
- package/lib/utils/internal/JsonDescriptor.mjs +2 -7
- package/lib/utils/internal/JsonDescriptor.mjs.map +1 -1
- package/lib/utils/internal/JsonDescriptor2.mjs +55 -61
- package/lib/utils/internal/JsonDescriptor2.mjs.map +1 -1
- package/lib/utils/internal/OpenApiTypeCheckerBase.js +23 -14
- package/lib/utils/internal/OpenApiTypeCheckerBase.js.map +1 -1
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs +2 -7
- package/lib/utils/internal/OpenApiTypeCheckerBase.mjs.map +1 -1
- package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs +539 -536
- package/lib/utils/internal/OpenApiTypeCheckerBase2.mjs.map +1 -1
- package/lib/utils/internal/coerceLlmArguments.js +27 -1
- package/lib/utils/internal/coerceLlmArguments.js.map +1 -1
- package/lib/utils/internal/coerceLlmArguments.mjs +2 -7
- package/lib/utils/internal/coerceLlmArguments.mjs.map +1 -1
- package/lib/utils/internal/coerceLlmArguments2.mjs +278 -258
- package/lib/utils/internal/coerceLlmArguments2.mjs.map +1 -1
- package/lib/utils/internal/parseLenientJson.mjs +2 -7
- package/lib/utils/internal/parseLenientJson.mjs.map +1 -1
- package/lib/utils/internal/parseLenientJson2.mjs +803 -811
- package/lib/utils/internal/parseLenientJson2.mjs.map +1 -1
- package/lib/utils/internal/stringifyValidationFailure.mjs +2 -7
- package/lib/utils/internal/stringifyValidationFailure.mjs.map +1 -1
- package/lib/utils/internal/stringifyValidationFailure2.mjs +310 -316
- package/lib/utils/internal/stringifyValidationFailure2.mjs.map +1 -1
- package/lib/validators/LlmTypeChecker.mjs +2 -7
- package/lib/validators/LlmTypeChecker.mjs.map +1 -1
- package/lib/validators/LlmTypeChecker2.mjs +314 -320
- package/lib/validators/LlmTypeChecker2.mjs.map +1 -1
- package/lib/validators/OpenApiTypeChecker.mjs +2 -7
- package/lib/validators/OpenApiTypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiTypeChecker2.mjs +209 -216
- package/lib/validators/OpenApiTypeChecker2.mjs.map +1 -1
- package/lib/validators/OpenApiV3TypeChecker.mjs +2 -7
- package/lib/validators/OpenApiV3TypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiV3TypeChecker2.mjs +30 -38
- package/lib/validators/OpenApiV3TypeChecker2.mjs.map +1 -1
- package/lib/validators/OpenApiV3_1TypeChecker.mjs +2 -7
- package/lib/validators/OpenApiV3_1TypeChecker.mjs.map +1 -1
- package/lib/validators/OpenApiV3_1TypeChecker2.mjs +34 -42
- package/lib/validators/OpenApiV3_1TypeChecker2.mjs.map +1 -1
- package/lib/validators/OpenApiValidator.mjs +2 -7
- package/lib/validators/OpenApiValidator.mjs.map +1 -1
- package/lib/validators/OpenApiValidator2.mjs +73 -80
- package/lib/validators/OpenApiValidator2.mjs.map +1 -1
- package/lib/validators/SwaggerV2TypeChecker.mjs +2 -7
- package/lib/validators/SwaggerV2TypeChecker.mjs.map +1 -1
- package/lib/validators/SwaggerV2TypeChecker2.mjs +31 -39
- package/lib/validators/SwaggerV2TypeChecker2.mjs.map +1 -1
- package/lib/validators/functional/_isBigintString.mjs +2 -7
- package/lib/validators/functional/_isBigintString.mjs.map +1 -1
- package/lib/validators/functional/_isBigintString2.mjs +14 -22
- package/lib/validators/functional/_isBigintString2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatByte.mjs +2 -7
- package/lib/validators/functional/_isFormatByte.mjs.map +1 -1
- package/lib/validators/functional/_isFormatByte2.mjs +10 -18
- package/lib/validators/functional/_isFormatByte2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDate.mjs +2 -7
- package/lib/validators/functional/_isFormatDate.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDate2.mjs +7 -15
- package/lib/validators/functional/_isFormatDate2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDateTime.mjs +2 -7
- package/lib/validators/functional/_isFormatDateTime.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDateTime2.mjs +7 -15
- package/lib/validators/functional/_isFormatDateTime2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDuration.mjs +2 -7
- package/lib/validators/functional/_isFormatDuration.mjs.map +1 -1
- package/lib/validators/functional/_isFormatDuration2.mjs +7 -15
- package/lib/validators/functional/_isFormatDuration2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatEmail.mjs +2 -7
- package/lib/validators/functional/_isFormatEmail.mjs.map +1 -1
- package/lib/validators/functional/_isFormatEmail2.mjs +7 -15
- package/lib/validators/functional/_isFormatEmail2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatHostname.mjs +2 -7
- package/lib/validators/functional/_isFormatHostname.mjs.map +1 -1
- package/lib/validators/functional/_isFormatHostname2.mjs +7 -15
- package/lib/validators/functional/_isFormatHostname2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnEmail.mjs +2 -7
- package/lib/validators/functional/_isFormatIdnEmail.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnEmail2.mjs +7 -15
- package/lib/validators/functional/_isFormatIdnEmail2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnHostname.mjs +2 -7
- package/lib/validators/functional/_isFormatIdnHostname.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIdnHostname2.mjs +7 -15
- package/lib/validators/functional/_isFormatIdnHostname2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv4.mjs +2 -7
- package/lib/validators/functional/_isFormatIpv4.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv42.mjs +7 -15
- package/lib/validators/functional/_isFormatIpv42.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv6.mjs +2 -7
- package/lib/validators/functional/_isFormatIpv6.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIpv62.mjs +7 -15
- package/lib/validators/functional/_isFormatIpv62.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIri.mjs +2 -7
- package/lib/validators/functional/_isFormatIri.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIri2.mjs +7 -15
- package/lib/validators/functional/_isFormatIri2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIriReference.mjs +2 -7
- package/lib/validators/functional/_isFormatIriReference.mjs.map +1 -1
- package/lib/validators/functional/_isFormatIriReference2.mjs +7 -15
- package/lib/validators/functional/_isFormatIriReference2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatJsonPointer.mjs +2 -7
- package/lib/validators/functional/_isFormatJsonPointer.mjs.map +1 -1
- package/lib/validators/functional/_isFormatJsonPointer2.mjs +7 -15
- package/lib/validators/functional/_isFormatJsonPointer2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatPassword.mjs +2 -7
- package/lib/validators/functional/_isFormatPassword.mjs.map +1 -1
- package/lib/validators/functional/_isFormatPassword2.mjs +6 -14
- package/lib/validators/functional/_isFormatPassword2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRegex.mjs +2 -7
- package/lib/validators/functional/_isFormatRegex.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRegex2.mjs +14 -22
- package/lib/validators/functional/_isFormatRegex2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs +2 -7
- package/lib/validators/functional/_isFormatRelativeJsonPointer.mjs.map +1 -1
- package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs +7 -15
- package/lib/validators/functional/_isFormatRelativeJsonPointer2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatTime.mjs +2 -7
- package/lib/validators/functional/_isFormatTime.mjs.map +1 -1
- package/lib/validators/functional/_isFormatTime2.mjs +7 -15
- package/lib/validators/functional/_isFormatTime2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUri.mjs +2 -7
- package/lib/validators/functional/_isFormatUri.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUri2.mjs +8 -16
- package/lib/validators/functional/_isFormatUri2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriReference.mjs +2 -7
- package/lib/validators/functional/_isFormatUriReference.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriReference2.mjs +7 -15
- package/lib/validators/functional/_isFormatUriReference2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriTemplate.mjs +2 -7
- package/lib/validators/functional/_isFormatUriTemplate.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUriTemplate2.mjs +7 -15
- package/lib/validators/functional/_isFormatUriTemplate2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUrl.mjs +2 -7
- package/lib/validators/functional/_isFormatUrl.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUrl2.mjs +7 -15
- package/lib/validators/functional/_isFormatUrl2.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUuid.mjs +2 -7
- package/lib/validators/functional/_isFormatUuid.mjs.map +1 -1
- package/lib/validators/functional/_isFormatUuid2.mjs +7 -15
- package/lib/validators/functional/_isFormatUuid2.mjs.map +1 -1
- package/lib/validators/functional/_isUniqueItems.mjs +2 -7
- package/lib/validators/functional/_isUniqueItems.mjs.map +1 -1
- package/lib/validators/functional/_isUniqueItems2.mjs +140 -148
- package/lib/validators/functional/_isUniqueItems2.mjs.map +1 -1
- package/lib/validators/index.mjs +1 -7
- package/lib/validators/index.mjs.map +1 -1
- package/lib/validators/index2.mjs +42 -40
- package/lib/validators/index2.mjs.map +1 -1
- package/lib/validators/internal/IOpenApiValidatorContext.mjs +2 -7
- package/lib/validators/internal/IOpenApiValidatorContext.mjs.map +1 -1
- package/lib/validators/internal/IOpenApiValidatorContext2.mjs +2 -10
- package/lib/validators/internal/IOpenApiValidatorContext2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiArrayValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiArrayValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiArrayValidator2.mjs +36 -42
- package/lib/validators/internal/OpenApiArrayValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiBooleanValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiBooleanValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiBooleanValidator2.mjs +10 -18
- package/lib/validators/internal/OpenApiBooleanValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiConstantValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiConstantValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiConstantValidator2.mjs +10 -18
- package/lib/validators/internal/OpenApiConstantValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiIntegerValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiIntegerValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiIntegerValidator2.mjs +33 -41
- package/lib/validators/internal/OpenApiIntegerValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiNumberValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiNumberValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiNumberValidator2.mjs +33 -41
- package/lib/validators/internal/OpenApiNumberValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiObjectValidator.js +2 -3
- package/lib/validators/internal/OpenApiObjectValidator.js.map +1 -1
- package/lib/validators/internal/OpenApiObjectValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiObjectValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiObjectValidator2.mjs +55 -62
- package/lib/validators/internal/OpenApiObjectValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiOneOfValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiOneOfValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiOneOfValidator2.mjs +188 -193
- package/lib/validators/internal/OpenApiOneOfValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs +2 -7
- package/lib/validators/internal/OpenApiSchemaNamingRule.mjs.map +1 -1
- package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs +124 -131
- package/lib/validators/internal/OpenApiSchemaNamingRule2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStationValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiStationValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStationValidator2.mjs +86 -83
- package/lib/validators/internal/OpenApiStationValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStringValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiStringValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiStringValidator2.mjs +115 -102
- package/lib/validators/internal/OpenApiStringValidator2.mjs.map +1 -1
- package/lib/validators/internal/OpenApiTupleValidator.mjs +2 -7
- package/lib/validators/internal/OpenApiTupleValidator.mjs.map +1 -1
- package/lib/validators/internal/OpenApiTupleValidator2.mjs +33 -40
- package/lib/validators/internal/OpenApiTupleValidator2.mjs.map +1 -1
- package/package.json +4 -4
- package/src/converters/LlmSchemaConverter.ts +1 -8
- package/src/utils/Singleton.ts +1 -0
- package/src/utils/internal/OpenApiTypeCheckerBase.ts +12 -3
- package/src/utils/internal/coerceLlmArguments.ts +27 -1
- package/src/validators/internal/OpenApiObjectValidator.ts +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpLlmApplicationComposer2.mjs","sources":["HttpLlmApplicationComposer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpLlmApplicationComposer = void 0;\nconst LlmSchemaConverter_1 = require(\"../../converters/LlmSchemaConverter\");\nconst utils_1 = require(\"../../utils\");\nconst OpenApiValidator_1 = require(\"../../validators/OpenApiValidator\");\n/**\n * Composes {@link IHttpLlmApplication} from an {@link IHttpMigrateApplication}.\n *\n * Converts OpenAPI-migrated HTTP routes into LLM function calling schemas,\n * filtering out unsupported methods (HEAD) and content types\n * (multipart/form-data), and shortening function names to fit the configured\n * maximum length.\n */\nvar HttpLlmApplicationComposer;\n(function (HttpLlmApplicationComposer) {\n /**\n * Builds an {@link IHttpLlmApplication} from migrated HTTP routes.\n *\n * Iterates all routes, converts each to an {@link IHttpLlmFunction}, and\n * collects conversion errors. Applies function name shortening at the end.\n */\n HttpLlmApplicationComposer.application = (props) => {\n var _a, _b, _c, _d;\n var _e, _f, _g, _h;\n // fill in config defaults\n const config = {\n maxLength: (_e = (_a = props.config) === null || _a === void 0 ? void 0 : _a.maxLength) !== null && _e !== void 0 ? _e : 64,\n equals: (_f = (_b = props.config) === null || _b === void 0 ? void 0 : _b.equals) !== null && _f !== void 0 ? _f : false,\n strict: (_g = (_c = props.config) === null || _c === void 0 ? void 0 : _c.strict) !== null && _g !== void 0 ? _g : false,\n };\n // seed with pre-existing migration errors, excluding human-only endpoints\n const errors = props.migrate.errors\n .filter((e) => e.operation()[\"x-samchon-human\"] !== true)\n .map((e) => ({\n method: e.method,\n path: e.path,\n messages: e.messages,\n operation: () => e.operation(),\n route: () => undefined,\n }));\n // convert each route to an LLM function, rejecting unsupported ones\n const functions = props.migrate.routes\n .filter((e) => e.operation()[\"x-samchon-human\"] !== true)\n .map((route, i) => {\n var _a, _b;\n // reject HEAD — LLMs cannot interpret header-only responses\n if (route.method === \"head\") {\n errors.push({\n method: route.method,\n path: route.path,\n messages: [\"HEAD method is not supported in the LLM application.\"],\n operation: () => route.operation(),\n route: () => route,\n });\n return null;\n // reject multipart/form-data — binary uploads not expressible in JSON Schema\n }\n else if (((_a = route.body) === null || _a === void 0 ? void 0 : _a.type) === \"multipart/form-data\" ||\n ((_b = route.success) === null || _b === void 0 ? void 0 : _b.type) === \"multipart/form-data\") {\n errors.push({\n method: route.method,\n path: route.path,\n messages: [\n `The \"multipart/form-data\" content type is not supported in the LLM application.`,\n ],\n operation: () => route.operation(),\n route: () => route,\n });\n return null;\n }\n const localErrors = [];\n const func = composeFunction({\n components: props.migrate.document().components,\n config,\n route,\n errors: localErrors,\n index: i,\n });\n if (func === null)\n errors.push({\n method: route.method,\n path: route.path,\n messages: localErrors,\n operation: () => route.operation(),\n route: () => route,\n });\n return func;\n })\n .filter((v) => v !== null);\n const app = {\n config,\n functions,\n errors,\n };\n HttpLlmApplicationComposer.shorten(app, (_h = (_d = props.config) === null || _d === void 0 ? void 0 : _d.maxLength) !== null && _h !== void 0 ? _h : 64);\n return app;\n };\n /**\n * Converts a single {@link IHttpMigrateRoute} into an {@link IHttpLlmFunction}\n * by composing parameter/output schemas and validating function name\n * constraints.\n */\n const composeFunction = (props) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n // accessor prefix for error messages (mirrors OpenAPI document structure)\n const endpoint = `$input.paths[${JSON.stringify(props.route.path)}][${JSON.stringify(props.route.method)}]`;\n const operation = props.route.operation();\n const description = concatDescription({\n summary: operation.summary,\n description: operation.description,\n });\n if (((_a = description === null || description === void 0 ? void 0 : description.length) !== null && _a !== void 0 ? _a : 0) > 1024) {\n props.errors.push(`The description of the function is too long (must be equal or less than 1,024 characters, but ${description.length.toLocaleString()} length).`);\n }\n // build function name from route accessor, replacing forbidden chars\n const name = emend(props.route.accessor.join(\"_\"));\n const isNameVariable = /^[a-zA-Z0-9_-]+$/.test(name);\n const isNameStartsWithNumber = /^[0-9]/.test((_b = name[0]) !== null && _b !== void 0 ? _b : \"\");\n if (isNameVariable === false)\n props.errors.push(`Elements of path (separated by '/') must be composed with alphabets, numbers, underscores, and hyphens`);\n if (isNameStartsWithNumber === true)\n props.errors.push(`Function name cannot start with a number.`);\n //----\n // CONSTRUCT SCHEMAS\n //----\n // merge path parameters, query, and body into a single object schema\n const parameters = {\n type: \"object\",\n properties: Object.fromEntries([\n // path parameters (e.g., /users/:id)\n ...props.route.parameters.map((s) => { var _a; return [\n s.key,\n Object.assign(Object.assign({}, s.schema), { description: (_a = s.parameter().description) !== null && _a !== void 0 ? _a : s.schema.description }),\n ]; }),\n // query parameters\n ...(props.route.query\n ? [\n [\n props.route.query.key,\n Object.assign(Object.assign({}, props.route.query.schema), { title: (_c = props.route.query.title()) !== null && _c !== void 0 ? _c : props.route.query.schema.title, description: (_d = props.route.query.description()) !== null && _d !== void 0 ? _d : props.route.query.schema.description }),\n ],\n ]\n : []),\n // request body\n ...(props.route.body\n ? [\n [\n props.route.body.key,\n Object.assign(Object.assign({}, props.route.body.schema), { description: (_e = props.route.body.description()) !== null && _e !== void 0 ? _e : props.route.body.schema.description }),\n ],\n ]\n : []),\n ]),\n };\n parameters.required = Object.keys((_f = parameters.properties) !== null && _f !== void 0 ? _f : {});\n // convert merged object schema to LLM parameters\n const llmParameters = LlmSchemaConverter_1.LlmSchemaConverter.parameters({\n config: props.config,\n components: props.components,\n schema: parameters,\n accessor: `${endpoint}.parameters`,\n });\n // convert response schema to LLM output parameters\n const output = props.route.success\n ? LlmSchemaConverter_1.LlmSchemaConverter.parameters({\n config: props.config,\n components: props.components,\n schema: props.route.success.schema,\n accessor: `${endpoint}.responses[${JSON.stringify(props.route.success.status)}][${JSON.stringify(props.route.success.type)}].schema`,\n })\n : undefined;\n //----\n // CONVERSION\n //----\n // bail out if any validation or conversion failed\n if ((output === null || output === void 0 ? void 0 : output.success) === false ||\n llmParameters.success === false ||\n isNameVariable === false ||\n isNameStartsWithNumber === true ||\n ((_g = description === null || description === void 0 ? void 0 : description.length) !== null && _g !== void 0 ? _g : 0) > 1024) {\n if ((output === null || output === void 0 ? void 0 : output.success) === false)\n props.errors.push(...output.error.reasons.map((r) => `${r.accessor}: ${r.message}`));\n if (llmParameters.success === false)\n props.errors.push(\n // rewrite internal accessor to match OpenAPI requestBody path\n ...llmParameters.error.reasons.map((r) => {\n var _a;\n var _b;\n const accessor = r.accessor.replace(`parameters.properties[\"body\"]`, `requestBody.content[${JSON.stringify((_b = (_a = props.route.body) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : \"application/json\")}].schema`);\n return `${accessor}: ${r.message}`;\n }));\n return null;\n }\n // assemble the LLM function\n return {\n method: props.route.method,\n path: props.route.path,\n name,\n parameters: llmParameters.value,\n output: output === null || output === void 0 ? void 0 : output.value,\n description,\n deprecated: operation.deprecated,\n tags: operation.tags,\n parse: (input) => utils_1.LlmJson.parse(input, llmParameters.value),\n coerce: (input) => utils_1.LlmJson.coerce(input, llmParameters.value),\n validate: OpenApiValidator_1.OpenApiValidator.create({\n components: props.components,\n schema: parameters,\n required: true,\n equals: (_h = props.config.equals) !== null && _h !== void 0 ? _h : false,\n }),\n route: () => props.route,\n operation: () => props.route.operation(),\n };\n };\n /**\n * Shortens function names exceeding the character limit.\n *\n * Tries progressively shorter accessor suffixes first, then falls back to\n * index-prefixed names, and finally UUID as a last resort.\n */\n HttpLlmApplicationComposer.shorten = (app, limit = 64) => {\n // collect all names for uniqueness checks\n const dictionary = new Set();\n const longFunctions = [];\n for (const func of app.functions) {\n dictionary.add(func.name);\n if (func.name.length > limit) {\n longFunctions.push(func);\n }\n }\n if (longFunctions.length === 0)\n return;\n let index = 0;\n for (const func of longFunctions) {\n let success = false;\n const rename = (str) => {\n dictionary.delete(func.name);\n dictionary.add(str);\n func.name = str;\n success = true;\n };\n // try dropping leading accessor segments to shorten the name\n // (e.g., \"api_users_getById\" → \"users_getById\" → \"getById\")\n for (let i = 1; i < func.route().accessor.length; ++i) {\n const shortName = func.route().accessor.slice(i).join(\"_\");\n if (shortName.length > limit - 8)\n continue; // reserve room for \"_N_\" prefix\n else if (dictionary.has(shortName) === false)\n rename(shortName);\n else {\n // name collision — prefix with a counter to disambiguate\n const newName = `_${index}_${shortName}`;\n if (dictionary.has(newName) === true)\n continue;\n rename(newName);\n ++index;\n }\n break;\n }\n // last resort — all suffix attempts failed or collided\n if (success === false)\n rename(randomFormatUuid());\n }\n };\n})(HttpLlmApplicationComposer || (exports.HttpLlmApplicationComposer = HttpLlmApplicationComposer = {}));\nconst randomFormatUuid = () => \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n});\n/** Replaces forbidden characters (`$`, `%`, `.`) with underscores. */\nconst emend = (str) => {\n for (const ch of FORBIDDEN)\n str = str.split(ch).join(\"_\");\n return str;\n};\nconst FORBIDDEN = [\"$\", \"%\", \".\"];\n/**\n * Concatenates summary and description into a single string.\n *\n * If both are present, joins them with a period and double newline, avoiding\n * duplication when the description already starts with the summary.\n */\nconst concatDescription = (p) => {\n var _a, _b;\n if (!((_a = p.summary) === null || _a === void 0 ? void 0 : _a.length) || !((_b = p.description) === null || _b === void 0 ? void 0 : _b.length))\n return p.summary || p.description;\n const summary = p.summary.endsWith(\".\")\n ? p.summary.slice(0, -1)\n : p.summary;\n return p.description.startsWith(summary)\n ? p.description\n : summary + \".\\n\\n\" + p.description;\n};\n//# sourceMappingURL=HttpLlmApplicationComposer.js.map"],"names":["HttpLlmApplicationComposer_1","require$$0","require$$1","require$$2","HttpLlmApplicationComposer"],"mappings":";;;;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAACA,0BAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAAA,0BAAA,CAAA,0BAAkC,GAAG,MAAM;CAC3C,MAAM,oBAAoB,GAAGC,yBAAA,EAA8C;CAC3E,MAAM,OAAO,GAAGC,YAAA,EAAsB;CACtC,MAAM,kBAAkB,GAAGC,uBAAA,EAA4C;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAA,IAAIC,4BAA0B;CAC9B,CAAC,UAAU,0BAA0B,EAAE;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,KAAI,0BAA0B,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK;AACxD,SAAQ,IAAI,EAAE,EAAE,EAAE,EAAE,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CAAC,GAAG,KAAK;AACvB,KAAI,KAAK,MAAM,EAAE,IAAI,SAAS;AAC9B,SAAQ,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACrC,KAAI,OAAO,GAAG;CACd,CAAC;CACD,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,CAAA,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK;KAC7B,IAAI,EAAE,EAAE,EAAE;KACV,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,WAAW,MAAM,IAAI,IAAI,EAAE,KAAK,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC;AACpJ,SAAQ,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,WAAW;KACrC,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;WAChC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE;WACrB,CAAC,CAAC,OAAO;AACnB,KAAI,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO;AAC3C,WAAU,CAAC,CAAC;AACZ,WAAU,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC,WAAW;CAC3C,CAAC;AACD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"HttpLlmApplicationComposer2.mjs","sources":["HttpLlmApplicationComposer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpLlmApplicationComposer = void 0;\nconst LlmSchemaConverter_1 = require(\"../../converters/LlmSchemaConverter\");\nconst utils_1 = require(\"../../utils\");\nconst OpenApiValidator_1 = require(\"../../validators/OpenApiValidator\");\n/**\n * Composes {@link IHttpLlmApplication} from an {@link IHttpMigrateApplication}.\n *\n * Converts OpenAPI-migrated HTTP routes into LLM function calling schemas,\n * filtering out unsupported methods (HEAD) and content types\n * (multipart/form-data), and shortening function names to fit the configured\n * maximum length.\n */\nvar HttpLlmApplicationComposer;\n(function (HttpLlmApplicationComposer) {\n /**\n * Builds an {@link IHttpLlmApplication} from migrated HTTP routes.\n *\n * Iterates all routes, converts each to an {@link IHttpLlmFunction}, and\n * collects conversion errors. Applies function name shortening at the end.\n */\n HttpLlmApplicationComposer.application = (props) => {\n var _a, _b, _c, _d;\n var _e, _f, _g, _h;\n // fill in config defaults\n const config = {\n maxLength: (_e = (_a = props.config) === null || _a === void 0 ? void 0 : _a.maxLength) !== null && _e !== void 0 ? _e : 64,\n equals: (_f = (_b = props.config) === null || _b === void 0 ? void 0 : _b.equals) !== null && _f !== void 0 ? _f : false,\n strict: (_g = (_c = props.config) === null || _c === void 0 ? void 0 : _c.strict) !== null && _g !== void 0 ? _g : false,\n };\n // seed with pre-existing migration errors, excluding human-only endpoints\n const errors = props.migrate.errors\n .filter((e) => e.operation()[\"x-samchon-human\"] !== true)\n .map((e) => ({\n method: e.method,\n path: e.path,\n messages: e.messages,\n operation: () => e.operation(),\n route: () => undefined,\n }));\n // convert each route to an LLM function, rejecting unsupported ones\n const functions = props.migrate.routes\n .filter((e) => e.operation()[\"x-samchon-human\"] !== true)\n .map((route, i) => {\n var _a, _b;\n // reject HEAD — LLMs cannot interpret header-only responses\n if (route.method === \"head\") {\n errors.push({\n method: route.method,\n path: route.path,\n messages: [\"HEAD method is not supported in the LLM application.\"],\n operation: () => route.operation(),\n route: () => route,\n });\n return null;\n // reject multipart/form-data — binary uploads not expressible in JSON Schema\n }\n else if (((_a = route.body) === null || _a === void 0 ? void 0 : _a.type) === \"multipart/form-data\" ||\n ((_b = route.success) === null || _b === void 0 ? void 0 : _b.type) === \"multipart/form-data\") {\n errors.push({\n method: route.method,\n path: route.path,\n messages: [\n `The \"multipart/form-data\" content type is not supported in the LLM application.`,\n ],\n operation: () => route.operation(),\n route: () => route,\n });\n return null;\n }\n const localErrors = [];\n const func = composeFunction({\n components: props.migrate.document().components,\n config,\n route,\n errors: localErrors,\n index: i,\n });\n if (func === null)\n errors.push({\n method: route.method,\n path: route.path,\n messages: localErrors,\n operation: () => route.operation(),\n route: () => route,\n });\n return func;\n })\n .filter((v) => v !== null);\n const app = {\n config,\n functions,\n errors,\n };\n HttpLlmApplicationComposer.shorten(app, (_h = (_d = props.config) === null || _d === void 0 ? void 0 : _d.maxLength) !== null && _h !== void 0 ? _h : 64);\n return app;\n };\n /**\n * Converts a single {@link IHttpMigrateRoute} into an {@link IHttpLlmFunction}\n * by composing parameter/output schemas and validating function name\n * constraints.\n */\n const composeFunction = (props) => {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n // accessor prefix for error messages (mirrors OpenAPI document structure)\n const endpoint = `$input.paths[${JSON.stringify(props.route.path)}][${JSON.stringify(props.route.method)}]`;\n const operation = props.route.operation();\n const description = concatDescription({\n summary: operation.summary,\n description: operation.description,\n });\n if (((_a = description === null || description === void 0 ? void 0 : description.length) !== null && _a !== void 0 ? _a : 0) > 1024) {\n props.errors.push(`The description of the function is too long (must be equal or less than 1,024 characters, but ${description.length.toLocaleString()} length).`);\n }\n // build function name from route accessor, replacing forbidden chars\n const name = emend(props.route.accessor.join(\"_\"));\n const isNameVariable = /^[a-zA-Z0-9_-]+$/.test(name);\n const isNameStartsWithNumber = /^[0-9]/.test((_b = name[0]) !== null && _b !== void 0 ? _b : \"\");\n if (isNameVariable === false)\n props.errors.push(`Elements of path (separated by '/') must be composed with alphabets, numbers, underscores, and hyphens`);\n if (isNameStartsWithNumber === true)\n props.errors.push(`Function name cannot start with a number.`);\n //----\n // CONSTRUCT SCHEMAS\n //----\n // merge path parameters, query, and body into a single object schema\n const parameters = {\n type: \"object\",\n properties: Object.fromEntries([\n // path parameters (e.g., /users/:id)\n ...props.route.parameters.map((s) => { var _a; return [\n s.key,\n Object.assign(Object.assign({}, s.schema), { description: (_a = s.parameter().description) !== null && _a !== void 0 ? _a : s.schema.description }),\n ]; }),\n // query parameters\n ...(props.route.query\n ? [\n [\n props.route.query.key,\n Object.assign(Object.assign({}, props.route.query.schema), { title: (_c = props.route.query.title()) !== null && _c !== void 0 ? _c : props.route.query.schema.title, description: (_d = props.route.query.description()) !== null && _d !== void 0 ? _d : props.route.query.schema.description }),\n ],\n ]\n : []),\n // request body\n ...(props.route.body\n ? [\n [\n props.route.body.key,\n Object.assign(Object.assign({}, props.route.body.schema), { description: (_e = props.route.body.description()) !== null && _e !== void 0 ? _e : props.route.body.schema.description }),\n ],\n ]\n : []),\n ]),\n };\n parameters.required = Object.keys((_f = parameters.properties) !== null && _f !== void 0 ? _f : {});\n // convert merged object schema to LLM parameters\n const llmParameters = LlmSchemaConverter_1.LlmSchemaConverter.parameters({\n config: props.config,\n components: props.components,\n schema: parameters,\n accessor: `${endpoint}.parameters`,\n });\n // convert response schema to LLM output parameters\n const output = props.route.success\n ? LlmSchemaConverter_1.LlmSchemaConverter.parameters({\n config: props.config,\n components: props.components,\n schema: props.route.success.schema,\n accessor: `${endpoint}.responses[${JSON.stringify(props.route.success.status)}][${JSON.stringify(props.route.success.type)}].schema`,\n })\n : undefined;\n //----\n // CONVERSION\n //----\n // bail out if any validation or conversion failed\n if ((output === null || output === void 0 ? void 0 : output.success) === false ||\n llmParameters.success === false ||\n isNameVariable === false ||\n isNameStartsWithNumber === true ||\n ((_g = description === null || description === void 0 ? void 0 : description.length) !== null && _g !== void 0 ? _g : 0) > 1024) {\n if ((output === null || output === void 0 ? void 0 : output.success) === false)\n props.errors.push(...output.error.reasons.map((r) => `${r.accessor}: ${r.message}`));\n if (llmParameters.success === false)\n props.errors.push(\n // rewrite internal accessor to match OpenAPI requestBody path\n ...llmParameters.error.reasons.map((r) => {\n var _a;\n var _b;\n const accessor = r.accessor.replace(`parameters.properties[\"body\"]`, `requestBody.content[${JSON.stringify((_b = (_a = props.route.body) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : \"application/json\")}].schema`);\n return `${accessor}: ${r.message}`;\n }));\n return null;\n }\n // assemble the LLM function\n return {\n method: props.route.method,\n path: props.route.path,\n name,\n parameters: llmParameters.value,\n output: output === null || output === void 0 ? void 0 : output.value,\n description,\n deprecated: operation.deprecated,\n tags: operation.tags,\n parse: (input) => utils_1.LlmJson.parse(input, llmParameters.value),\n coerce: (input) => utils_1.LlmJson.coerce(input, llmParameters.value),\n validate: OpenApiValidator_1.OpenApiValidator.create({\n components: props.components,\n schema: parameters,\n required: true,\n equals: (_h = props.config.equals) !== null && _h !== void 0 ? _h : false,\n }),\n route: () => props.route,\n operation: () => props.route.operation(),\n };\n };\n /**\n * Shortens function names exceeding the character limit.\n *\n * Tries progressively shorter accessor suffixes first, then falls back to\n * index-prefixed names, and finally UUID as a last resort.\n */\n HttpLlmApplicationComposer.shorten = (app, limit = 64) => {\n // collect all names for uniqueness checks\n const dictionary = new Set();\n const longFunctions = [];\n for (const func of app.functions) {\n dictionary.add(func.name);\n if (func.name.length > limit) {\n longFunctions.push(func);\n }\n }\n if (longFunctions.length === 0)\n return;\n let index = 0;\n for (const func of longFunctions) {\n let success = false;\n const rename = (str) => {\n dictionary.delete(func.name);\n dictionary.add(str);\n func.name = str;\n success = true;\n };\n // try dropping leading accessor segments to shorten the name\n // (e.g., \"api_users_getById\" → \"users_getById\" → \"getById\")\n for (let i = 1; i < func.route().accessor.length; ++i) {\n const shortName = func.route().accessor.slice(i).join(\"_\");\n if (shortName.length > limit - 8)\n continue; // reserve room for \"_N_\" prefix\n else if (dictionary.has(shortName) === false)\n rename(shortName);\n else {\n // name collision — prefix with a counter to disambiguate\n const newName = `_${index}_${shortName}`;\n if (dictionary.has(newName) === true)\n continue;\n rename(newName);\n ++index;\n }\n break;\n }\n // last resort — all suffix attempts failed or collided\n if (success === false)\n rename(randomFormatUuid());\n }\n };\n})(HttpLlmApplicationComposer || (exports.HttpLlmApplicationComposer = HttpLlmApplicationComposer = {}));\nconst randomFormatUuid = () => \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n});\n/** Replaces forbidden characters (`$`, `%`, `.`) with underscores. */\nconst emend = (str) => {\n for (const ch of FORBIDDEN)\n str = str.split(ch).join(\"_\");\n return str;\n};\nconst FORBIDDEN = [\"$\", \"%\", \".\"];\n/**\n * Concatenates summary and description into a single string.\n *\n * If both are present, joins them with a period and double newline, avoiding\n * duplication when the description already starts with the summary.\n */\nconst concatDescription = (p) => {\n var _a, _b;\n if (!((_a = p.summary) === null || _a === void 0 ? void 0 : _a.length) || !((_b = p.description) === null || _b === void 0 ? void 0 : _b.length))\n return p.summary || p.description;\n const summary = p.summary.endsWith(\".\")\n ? p.summary.slice(0, -1)\n : p.summary;\n return p.description.startsWith(summary)\n ? p.description\n : summary + \".\\n\\n\" + p.description;\n};\n//# sourceMappingURL=HttpLlmApplicationComposer.js.map"],"names":["HttpLlmApplicationComposer_1","require$$0","require$$1","require$$2"],"mappings":";;;;;;;;AACA,MAAM,CAAC,cAAc,CAACA,4BAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,IAAA,4BAAA,GAAAA,4BAAA,CAAA,0BAAkC,GAAG;AACrC,MAAM,oBAAoB,GAAGC,kBAA8C;AAC3E,MAAM,OAAO,GAAGC,KAAsB;AACtC,MAAM,kBAAkB,GAAGC,gBAA4C;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,0BAA0B;AAC9B,CAAC,UAAU,0BAA0B,EAAE;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,0BAA0B,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK;AACxD,QAAQ,IAA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AC,WAAW;AACzC,IAAI,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;AAC1C,UAAU,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE;AAC/B,UAAU,CAAC,CAAC,OAAO;AACnB,IAAI,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO;AAC3C,UAAU,CAAC,CAAC;AACZ,UAAU,OAAO,GAAG,OAAO,GAAG,CAAC,CAAC,WAAW;AAC3C,CAAC;;;;"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var HttpLlmFunctionFetcherExports = requireHttpLlmFunctionFetcher();
|
|
5
|
-
var HttpLlmFunctionFetcher = /*@__PURE__*/getDefaultExportFromCjs(HttpLlmFunctionFetcherExports);
|
|
6
|
-
|
|
7
|
-
export { HttpLlmFunctionFetcher as default };
|
|
1
|
+
export { HttpLlmFunctionFetcher } from './HttpLlmFunctionFetcher2.mjs';
|
|
2
|
+
export { __exports as default } from '../../_virtual/HttpLlmFunctionFetcher.mjs';
|
|
8
3
|
//# sourceMappingURL=HttpLlmFunctionFetcher.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpLlmFunctionFetcher.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"HttpLlmFunctionFetcher.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
-
import { __exports as HttpLlmFunctionFetcher } from '../../_virtual/HttpLlmFunctionFetcher.mjs';
|
|
2
|
-
import
|
|
1
|
+
import { __exports as HttpLlmFunctionFetcher$1 } from '../../_virtual/HttpLlmFunctionFetcher.mjs';
|
|
2
|
+
import './HttpMigrateRouteFetcher2.mjs';
|
|
3
|
+
import { __exports as HttpMigrateRouteFetcher } from '../../_virtual/HttpMigrateRouteFetcher.mjs';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
Object.defineProperty(HttpLlmFunctionFetcher$1, "__esModule", { value: true });
|
|
6
|
+
var HttpLlmFunctionFetcher_2 = HttpLlmFunctionFetcher$1.HttpLlmFunctionFetcher = void 0;
|
|
7
|
+
const HttpMigrateRouteFetcher_1 = HttpMigrateRouteFetcher;
|
|
8
|
+
var HttpLlmFunctionFetcher;
|
|
9
|
+
(function (HttpLlmFunctionFetcher) {
|
|
10
|
+
HttpLlmFunctionFetcher.execute = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.execute(getFetchArguments("execute", props));
|
|
11
|
+
HttpLlmFunctionFetcher.propagate = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.propagate(getFetchArguments("propagate", props));
|
|
12
|
+
const getFetchArguments = (from, props) => {
|
|
13
|
+
const route = props.function.route();
|
|
14
|
+
const input = props.input;
|
|
15
|
+
const valid = typeof input === "object" && input !== null;
|
|
16
|
+
if (valid === false)
|
|
17
|
+
throw new Error(`Error on HttpLlmFunctionFetcher.${from}(): keyworded arguments must be an object`);
|
|
18
|
+
return {
|
|
19
|
+
connection: props.connection,
|
|
20
|
+
route,
|
|
21
|
+
parameters: Object.fromEntries(route.parameters.map((p) => [p.key, input[p.key]])),
|
|
22
|
+
query: input.query,
|
|
23
|
+
body: input.body,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
})(HttpLlmFunctionFetcher || (HttpLlmFunctionFetcher_2 = HttpLlmFunctionFetcher$1.HttpLlmFunctionFetcher = HttpLlmFunctionFetcher = {}));
|
|
5
27
|
|
|
6
|
-
|
|
7
|
-
if (hasRequiredHttpLlmFunctionFetcher) return HttpLlmFunctionFetcher;
|
|
8
|
-
hasRequiredHttpLlmFunctionFetcher = 1;
|
|
9
|
-
Object.defineProperty(HttpLlmFunctionFetcher, "__esModule", { value: true });
|
|
10
|
-
HttpLlmFunctionFetcher.HttpLlmFunctionFetcher = void 0;
|
|
11
|
-
const HttpMigrateRouteFetcher_1 = requireHttpMigrateRouteFetcher();
|
|
12
|
-
var HttpLlmFunctionFetcher$1;
|
|
13
|
-
(function (HttpLlmFunctionFetcher) {
|
|
14
|
-
HttpLlmFunctionFetcher.execute = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.execute(getFetchArguments("execute", props));
|
|
15
|
-
HttpLlmFunctionFetcher.propagate = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.propagate(getFetchArguments("propagate", props));
|
|
16
|
-
const getFetchArguments = (from, props) => {
|
|
17
|
-
const route = props.function.route();
|
|
18
|
-
const input = props.input;
|
|
19
|
-
const valid = typeof input === "object" && input !== null;
|
|
20
|
-
if (valid === false)
|
|
21
|
-
throw new Error(`Error on HttpLlmFunctionFetcher.${from}(): keyworded arguments must be an object`);
|
|
22
|
-
return {
|
|
23
|
-
connection: props.connection,
|
|
24
|
-
route,
|
|
25
|
-
parameters: Object.fromEntries(route.parameters.map((p) => [p.key, input[p.key]])),
|
|
26
|
-
query: input.query,
|
|
27
|
-
body: input.body,
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
})(HttpLlmFunctionFetcher$1 || (HttpLlmFunctionFetcher.HttpLlmFunctionFetcher = HttpLlmFunctionFetcher$1 = {}));
|
|
31
|
-
|
|
32
|
-
return HttpLlmFunctionFetcher;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { requireHttpLlmFunctionFetcher as __require };
|
|
28
|
+
export { HttpLlmFunctionFetcher_2 as HttpLlmFunctionFetcher, HttpLlmFunctionFetcher$1 as default };
|
|
36
29
|
//# sourceMappingURL=HttpLlmFunctionFetcher2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpLlmFunctionFetcher2.mjs","sources":["HttpLlmFunctionFetcher.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpLlmFunctionFetcher = void 0;\nconst HttpMigrateRouteFetcher_1 = require(\"./HttpMigrateRouteFetcher\");\nvar HttpLlmFunctionFetcher;\n(function (HttpLlmFunctionFetcher) {\n HttpLlmFunctionFetcher.execute = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.execute(getFetchArguments(\"execute\", props));\n HttpLlmFunctionFetcher.propagate = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.propagate(getFetchArguments(\"propagate\", props));\n const getFetchArguments = (from, props) => {\n const route = props.function.route();\n const input = props.input;\n const valid = typeof input === \"object\" && input !== null;\n if (valid === false)\n throw new Error(`Error on HttpLlmFunctionFetcher.${from}(): keyworded arguments must be an object`);\n return {\n connection: props.connection,\n route,\n parameters: Object.fromEntries(route.parameters.map((p) => [p.key, input[p.key]])),\n query: input.query,\n body: input.body,\n };\n };\n})(HttpLlmFunctionFetcher || (exports.HttpLlmFunctionFetcher = HttpLlmFunctionFetcher = {}));\n//# sourceMappingURL=HttpLlmFunctionFetcher.js.map"],"names":["HttpLlmFunctionFetcher_1","require$$0"
|
|
1
|
+
{"version":3,"file":"HttpLlmFunctionFetcher2.mjs","sources":["HttpLlmFunctionFetcher.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpLlmFunctionFetcher = void 0;\nconst HttpMigrateRouteFetcher_1 = require(\"./HttpMigrateRouteFetcher\");\nvar HttpLlmFunctionFetcher;\n(function (HttpLlmFunctionFetcher) {\n HttpLlmFunctionFetcher.execute = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.execute(getFetchArguments(\"execute\", props));\n HttpLlmFunctionFetcher.propagate = (props) => HttpMigrateRouteFetcher_1.HttpMigrateRouteFetcher.propagate(getFetchArguments(\"propagate\", props));\n const getFetchArguments = (from, props) => {\n const route = props.function.route();\n const input = props.input;\n const valid = typeof input === \"object\" && input !== null;\n if (valid === false)\n throw new Error(`Error on HttpLlmFunctionFetcher.${from}(): keyworded arguments must be an object`);\n return {\n connection: props.connection,\n route,\n parameters: Object.fromEntries(route.parameters.map((p) => [p.key, input[p.key]])),\n query: input.query,\n body: input.body,\n };\n };\n})(HttpLlmFunctionFetcher || (exports.HttpLlmFunctionFetcher = HttpLlmFunctionFetcher = {}));\n//# sourceMappingURL=HttpLlmFunctionFetcher.js.map"],"names":["HttpLlmFunctionFetcher_1","require$$0"],"mappings":";;;;AACA,MAAM,CAAC,cAAc,CAACA,wBAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,IAAA,wBAAA,GAAAA,wBAAA,CAAA,sBAA8B,GAAG;AACjC,MAAM,yBAAyB,GAAGC,uBAAoC;AACtE,IAAI,sBAAsB;AAC1B,CAAC,UAAU,sBAAsB,EAAE;AACnC,IAAI,sBAAsB,CAAC,OAAO,GAAG,CAAC,KAAK,KAAK,yBAAyB,CAAC,uBAAuB,CAAC,OAAO,CAAC,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC9I,IAAI,sBAAsB,CAAC,SAAS,GAAG,CAAC,KAAK,KAAK,yBAAyB,CAAC,uBAAuB,CAAC,SAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AACpJ,IAAI,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AAC/C,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE;AAC5C,QAAQ,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK;AACjC,QAAQ,MAAM,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;AACjE,QAAQ,IAAI,KAAK,KAAK,KAAK;AAC3B,YAAY,MAAM,IAAI,KAAK,CAAC,CAAC,gCAAgC,EAAE,IAAI,CAAC,yCAAyC,CAAC,CAAC;AAC/G,QAAQ,OAAO;AACf,YAAY,UAAU,EAAE,KAAK,CAAC,UAAU;AACxC,YAAY,KAAK;AACjB,YAAY,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9F,YAAY,KAAK,EAAE,KAAK,CAAC,KAAK;AAC9B,YAAY,IAAI,EAAE,KAAK,CAAC,IAAI;AAC5B,SAAS;AACT,IAAA,CAAK;AACL,CAAC,EAAE,sBAAsB,KAAK,wBAAA,GAAAD,wBAAA,CAAA,sBAA8B,GAAG,sBAAsB,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var HttpMigrateApplicationComposerExports = requireHttpMigrateApplicationComposer();
|
|
5
|
-
var HttpMigrateApplicationComposer = /*@__PURE__*/getDefaultExportFromCjs(HttpMigrateApplicationComposerExports);
|
|
6
|
-
|
|
7
|
-
export { HttpMigrateApplicationComposer as default };
|
|
1
|
+
export { HttpMigrateApplicationComposer } from './HttpMigrateApplicationComposer2.mjs';
|
|
2
|
+
export { __exports as default } from '../../_virtual/HttpMigrateApplicationComposer.mjs';
|
|
8
3
|
//# sourceMappingURL=HttpMigrateApplicationComposer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMigrateApplicationComposer.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"HttpMigrateApplicationComposer.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,59 +1,54 @@
|
|
|
1
|
-
import { __exports as HttpMigrateApplicationComposer } from '../../_virtual/HttpMigrateApplicationComposer.mjs';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { __exports as HttpMigrateApplicationComposer$1 } from '../../_virtual/HttpMigrateApplicationComposer.mjs';
|
|
2
|
+
import '../../utils/internal/EndpointUtil2.mjs';
|
|
3
|
+
import './HttpMigrateRouteAccessor2.mjs';
|
|
4
|
+
import './HttpMigrateRouteComposer2.mjs';
|
|
5
|
+
import { __exports as HttpMigrateRouteComposer } from '../../_virtual/HttpMigrateRouteComposer.mjs';
|
|
6
|
+
import { __exports as EndpointUtil } from '../../_virtual/EndpointUtil.mjs';
|
|
7
|
+
import { __exports as HttpMigrateRouteAccessor } from '../../_virtual/HttpMigrateRouteAccessor.mjs';
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
Object.defineProperty(HttpMigrateApplicationComposer$1, "__esModule", { value: true });
|
|
10
|
+
var HttpMigrateApplicationComposer_2 = HttpMigrateApplicationComposer$1.HttpMigrateApplicationComposer = void 0;
|
|
11
|
+
const EndpointUtil_1 = EndpointUtil;
|
|
12
|
+
const HttpMigrateRouteAccessor_1 = HttpMigrateRouteAccessor;
|
|
13
|
+
const HttpMigrateRouteComposer_1 = HttpMigrateRouteComposer;
|
|
14
|
+
var HttpMigrateApplicationComposer;
|
|
15
|
+
(function (HttpMigrateApplicationComposer) {
|
|
16
|
+
HttpMigrateApplicationComposer.compose = (document) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const errors = [];
|
|
19
|
+
const entire = Object.entries(Object.assign(Object.assign({}, ((_a = document.paths) !== null && _a !== void 0 ? _a : {})), ((_b = document.webhooks) !== null && _b !== void 0 ? _b : {})))
|
|
20
|
+
.map(([path, collection]) => ["head", "get", "post", "put", "patch", "delete", "query"]
|
|
21
|
+
.filter((method) => collection[method] !== undefined)
|
|
22
|
+
.map((method) => {
|
|
23
|
+
const operation = collection[method];
|
|
24
|
+
const migrated = HttpMigrateRouteComposer_1.HttpMigrateRouteComposer.compose({
|
|
25
|
+
document,
|
|
26
|
+
method,
|
|
27
|
+
path,
|
|
28
|
+
emendedPath: EndpointUtil_1.EndpointUtil.reJoinWithDecimalParameters(path),
|
|
29
|
+
operation,
|
|
30
|
+
});
|
|
31
|
+
if (Array.isArray(migrated)) {
|
|
32
|
+
errors.push({
|
|
33
|
+
method,
|
|
34
|
+
path,
|
|
35
|
+
operation: () => operation,
|
|
36
|
+
messages: migrated,
|
|
37
|
+
});
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return migrated;
|
|
41
|
+
}))
|
|
42
|
+
.flat();
|
|
43
|
+
const operations = entire.filter((o) => !!o);
|
|
44
|
+
HttpMigrateRouteAccessor_1.HttpMigrateRouteAccessor.overwrite(operations);
|
|
45
|
+
return {
|
|
46
|
+
document: () => document,
|
|
47
|
+
routes: operations,
|
|
48
|
+
errors,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
})(HttpMigrateApplicationComposer || (HttpMigrateApplicationComposer_2 = HttpMigrateApplicationComposer$1.HttpMigrateApplicationComposer = HttpMigrateApplicationComposer = {}));
|
|
7
52
|
|
|
8
|
-
|
|
9
|
-
if (hasRequiredHttpMigrateApplicationComposer) return HttpMigrateApplicationComposer;
|
|
10
|
-
hasRequiredHttpMigrateApplicationComposer = 1;
|
|
11
|
-
Object.defineProperty(HttpMigrateApplicationComposer, "__esModule", { value: true });
|
|
12
|
-
HttpMigrateApplicationComposer.HttpMigrateApplicationComposer = void 0;
|
|
13
|
-
const EndpointUtil_1 = requireEndpointUtil();
|
|
14
|
-
const HttpMigrateRouteAccessor_1 = requireHttpMigrateRouteAccessor();
|
|
15
|
-
const HttpMigrateRouteComposer_1 = requireHttpMigrateRouteComposer();
|
|
16
|
-
var HttpMigrateApplicationComposer$1;
|
|
17
|
-
(function (HttpMigrateApplicationComposer) {
|
|
18
|
-
HttpMigrateApplicationComposer.compose = (document) => {
|
|
19
|
-
var _a, _b;
|
|
20
|
-
const errors = [];
|
|
21
|
-
const entire = Object.entries(Object.assign(Object.assign({}, ((_a = document.paths) !== null && _a !== void 0 ? _a : {})), ((_b = document.webhooks) !== null && _b !== void 0 ? _b : {})))
|
|
22
|
-
.map(([path, collection]) => ["head", "get", "post", "put", "patch", "delete", "query"]
|
|
23
|
-
.filter((method) => collection[method] !== undefined)
|
|
24
|
-
.map((method) => {
|
|
25
|
-
const operation = collection[method];
|
|
26
|
-
const migrated = HttpMigrateRouteComposer_1.HttpMigrateRouteComposer.compose({
|
|
27
|
-
document,
|
|
28
|
-
method,
|
|
29
|
-
path,
|
|
30
|
-
emendedPath: EndpointUtil_1.EndpointUtil.reJoinWithDecimalParameters(path),
|
|
31
|
-
operation,
|
|
32
|
-
});
|
|
33
|
-
if (Array.isArray(migrated)) {
|
|
34
|
-
errors.push({
|
|
35
|
-
method,
|
|
36
|
-
path,
|
|
37
|
-
operation: () => operation,
|
|
38
|
-
messages: migrated,
|
|
39
|
-
});
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
return migrated;
|
|
43
|
-
}))
|
|
44
|
-
.flat();
|
|
45
|
-
const operations = entire.filter((o) => !!o);
|
|
46
|
-
HttpMigrateRouteAccessor_1.HttpMigrateRouteAccessor.overwrite(operations);
|
|
47
|
-
return {
|
|
48
|
-
document: () => document,
|
|
49
|
-
routes: operations,
|
|
50
|
-
errors,
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
})(HttpMigrateApplicationComposer$1 || (HttpMigrateApplicationComposer.HttpMigrateApplicationComposer = HttpMigrateApplicationComposer$1 = {}));
|
|
54
|
-
|
|
55
|
-
return HttpMigrateApplicationComposer;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { requireHttpMigrateApplicationComposer as __require };
|
|
53
|
+
export { HttpMigrateApplicationComposer_2 as HttpMigrateApplicationComposer, HttpMigrateApplicationComposer$1 as default };
|
|
59
54
|
//# sourceMappingURL=HttpMigrateApplicationComposer2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMigrateApplicationComposer2.mjs","sources":["HttpMigrateApplicationComposer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpMigrateApplicationComposer = void 0;\nconst EndpointUtil_1 = require(\"../../utils/internal/EndpointUtil\");\nconst HttpMigrateRouteAccessor_1 = require(\"./HttpMigrateRouteAccessor\");\nconst HttpMigrateRouteComposer_1 = require(\"./HttpMigrateRouteComposer\");\nvar HttpMigrateApplicationComposer;\n(function (HttpMigrateApplicationComposer) {\n HttpMigrateApplicationComposer.compose = (document) => {\n var _a, _b;\n const errors = [];\n const entire = Object.entries(Object.assign(Object.assign({}, ((_a = document.paths) !== null && _a !== void 0 ? _a : {})), ((_b = document.webhooks) !== null && _b !== void 0 ? _b : {})))\n .map(([path, collection]) => [\"head\", \"get\", \"post\", \"put\", \"patch\", \"delete\", \"query\"]\n .filter((method) => collection[method] !== undefined)\n .map((method) => {\n const operation = collection[method];\n const migrated = HttpMigrateRouteComposer_1.HttpMigrateRouteComposer.compose({\n document,\n method,\n path,\n emendedPath: EndpointUtil_1.EndpointUtil.reJoinWithDecimalParameters(path),\n operation,\n });\n if (Array.isArray(migrated)) {\n errors.push({\n method,\n path,\n operation: () => operation,\n messages: migrated,\n });\n return null;\n }\n return migrated;\n }))\n .flat();\n const operations = entire.filter((o) => !!o);\n HttpMigrateRouteAccessor_1.HttpMigrateRouteAccessor.overwrite(operations);\n return {\n document: () => document,\n routes: operations,\n errors,\n };\n };\n})(HttpMigrateApplicationComposer || (exports.HttpMigrateApplicationComposer = HttpMigrateApplicationComposer = {}));\n//# sourceMappingURL=HttpMigrateApplicationComposer.js.map"],"names":["HttpMigrateApplicationComposer_1","require$$0","require$$1","require$$2"
|
|
1
|
+
{"version":3,"file":"HttpMigrateApplicationComposer2.mjs","sources":["HttpMigrateApplicationComposer.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpMigrateApplicationComposer = void 0;\nconst EndpointUtil_1 = require(\"../../utils/internal/EndpointUtil\");\nconst HttpMigrateRouteAccessor_1 = require(\"./HttpMigrateRouteAccessor\");\nconst HttpMigrateRouteComposer_1 = require(\"./HttpMigrateRouteComposer\");\nvar HttpMigrateApplicationComposer;\n(function (HttpMigrateApplicationComposer) {\n HttpMigrateApplicationComposer.compose = (document) => {\n var _a, _b;\n const errors = [];\n const entire = Object.entries(Object.assign(Object.assign({}, ((_a = document.paths) !== null && _a !== void 0 ? _a : {})), ((_b = document.webhooks) !== null && _b !== void 0 ? _b : {})))\n .map(([path, collection]) => [\"head\", \"get\", \"post\", \"put\", \"patch\", \"delete\", \"query\"]\n .filter((method) => collection[method] !== undefined)\n .map((method) => {\n const operation = collection[method];\n const migrated = HttpMigrateRouteComposer_1.HttpMigrateRouteComposer.compose({\n document,\n method,\n path,\n emendedPath: EndpointUtil_1.EndpointUtil.reJoinWithDecimalParameters(path),\n operation,\n });\n if (Array.isArray(migrated)) {\n errors.push({\n method,\n path,\n operation: () => operation,\n messages: migrated,\n });\n return null;\n }\n return migrated;\n }))\n .flat();\n const operations = entire.filter((o) => !!o);\n HttpMigrateRouteAccessor_1.HttpMigrateRouteAccessor.overwrite(operations);\n return {\n document: () => document,\n routes: operations,\n errors,\n };\n };\n})(HttpMigrateApplicationComposer || (exports.HttpMigrateApplicationComposer = HttpMigrateApplicationComposer = {}));\n//# sourceMappingURL=HttpMigrateApplicationComposer.js.map"],"names":["HttpMigrateApplicationComposer_1","require$$0","require$$1","require$$2"],"mappings":";;;;;;;;AACA,MAAM,CAAC,cAAc,CAACA,gCAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,IAAA,gCAAA,GAAAA,gCAAA,CAAA,8BAAsC,GAAG;AACzC,MAAM,cAAc,GAAGC,YAA4C;AACnE,MAAM,0BAA0B,GAAGC,wBAAqC;AACxE,MAAM,0BAA0B,GAAGC,wBAAqC;AACxE,IAAI,8BAA8B;AAClC,CAAC,UAAU,8BAA8B,EAAE;AAC3C,IAAI,8BAA8B,CAAC,OAAO,GAAG,CAAC,QAAQ,KAAK;AAC3D,QAAQ,IAAI,EAAE,EAAE,EAAE;AAClB,QAAQ,MAAM,MAAM,GAAG,EAAE;AACzB,QAAQ,MAAM,MAAM,GAAG,MAAM,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,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,QAAQ,0BAA0B,CAAC,wBAAwB,CAAC,SAAS,CAAC,UAAU,CAAC;AACjF,QAAQ,OAAO;AACf,YAAY,QAAQ,EAAE,MAAM,QAAQ;AACpC,YAAY,MAAM,EAAE,UAAU;AAC9B,YAAY,MAAM;AAClB,SAAS;AACT,IAAA,CAAK;AACL,CAAC,EAAE,8BAA8B,KAAK,gCAAA,GAAAH,gCAAA,CAAA,8BAAsC,GAAG,8BAA8B,GAAG,EAAE,CAAC,CAAC;;;;"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var HttpMigrateRouteAccessorExports = requireHttpMigrateRouteAccessor();
|
|
5
|
-
var HttpMigrateRouteAccessor = /*@__PURE__*/getDefaultExportFromCjs(HttpMigrateRouteAccessorExports);
|
|
6
|
-
|
|
7
|
-
export { HttpMigrateRouteAccessor as default };
|
|
1
|
+
export { HttpMigrateRouteAccessor } from './HttpMigrateRouteAccessor2.mjs';
|
|
2
|
+
export { __exports as default } from '../../_virtual/HttpMigrateRouteAccessor.mjs';
|
|
8
3
|
//# sourceMappingURL=HttpMigrateRouteAccessor.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpMigrateRouteAccessor.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"HttpMigrateRouteAccessor.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|