@autobe/agent 0.25.0 → 0.25.2
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/AutoBeAgent.js +11 -1
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +1 -0
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeConfigConstant.d.ts +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +13 -13
- package/lib/factory/createAutoBeContext.js +32 -3
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +2585 -1009
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +8 -8
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +2 -2
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +36 -23
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +22 -42
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.js → transformInterfaceCommonPrerequisiteHistories.js} +4 -4
- package/lib/orchestrate/interface/histories/transformInterfaceCommonPrerequisiteHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +3 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +102 -0
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +25 -9
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +278 -47
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +96 -70
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +3 -3
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +29 -30
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +278 -47
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.d.ts +5 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +713 -0
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +88 -42
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +82 -14
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -10
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +3 -3
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +0 -33
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +6 -2
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +114 -9
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +46 -3
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +3 -4
- package/lib/orchestrate/interface/utils/OperationValidator.js +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +8 -8
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +20 -20
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +20 -20
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +30 -30
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +9 -10
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +14 -22
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +8 -2
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js +1 -2
- package/lib/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js +103 -40
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +79 -45
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +16 -16
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +12 -12
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +117 -87
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +117 -54
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +21 -13
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +52 -26
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +44 -34
- package/lib/orchestrate/realize/utils/InternalFileSystem.js +1 -1
- package/lib/orchestrate/realize/utils/InternalFileSystem.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +8 -3
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +44 -17
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +4 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js +24 -9
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.d.ts +8 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js +48 -0
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +1 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +93 -55
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +10 -79
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +15 -65
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +32 -17
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +31 -13
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +5 -5
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +37 -21
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +9 -5
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.d.ts +8 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +11 -7
- package/lib/orchestrate/test/utils/getPrerequisites.d.ts +5 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js +36 -0
- package/lib/orchestrate/test/utils/getPrerequisites.js.map +1 -0
- package/lib/orchestrate/test/utils/getReferenceIds.js +1 -1
- package/lib/orchestrate/test/utils/getReferenceIds.js.map +1 -1
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +17 -1
- package/src/AutoBeMockAgent.ts +1 -0
- package/src/constants/AutoBeConfigConstant.ts +1 -1
- package/src/constants/AutoBeSystemPromptConstant.ts +13 -13
- package/src/factory/createAutoBeContext.ts +33 -3
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +2 -2
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
- package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +4 -2
- package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +43 -17
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +12 -33
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +5 -5
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +1 -1
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +1 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -10
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +4 -5
- package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +58 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +0 -34
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +92 -4
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +49 -3
- package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +9 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -24
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +6 -6
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +6 -4
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +1 -5
- package/src/orchestrate/realize/orchestRateRealizeCorrectCasting.ts +84 -17
- package/src/orchestrate/realize/orchestrateRealize.ts +123 -74
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +33 -6
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +21 -13
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +54 -29
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +46 -35
- package/src/orchestrate/realize/utils/InternalFileSystem.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +54 -22
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +28 -16
- package/src/orchestrate/realize/utils/printErrorHints.ts +55 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +99 -102
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +18 -91
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +17 -90
- package/src/orchestrate/test/orchestrateTestCorrect.ts +7 -6
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +12 -6
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +3 -3
- package/src/orchestrate/test/orchestrateTestWrite.ts +7 -6
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +9 -228
- package/src/orchestrate/test/structures/IAutoBeTestCorrectInvalidRequestApplication.ts +8 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +11 -78
- package/src/orchestrate/test/utils/getPrerequisites.ts +51 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +2 -1
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.d.ts +0 -3
- package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js.map +0 -1
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.d.ts +0 -6
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js +0 -22
- package/lib/orchestrate/interface/utils/OpenApiEndpointComparator.js.map +0 -1
- package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
|
@@ -101,7 +101,7 @@ function orchestrateInterfaceOperationsReview(ctx, operations, progress) {
|
|
|
101
101
|
}
|
|
102
102
|
function createReviewController(props) {
|
|
103
103
|
const validate = (next) => {
|
|
104
|
-
const result = (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
104
|
+
const result = (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && (Array.isArray(input.prerequisites) && input.prerequisites.every(elem => "object" === typeof elem && null !== elem && _io9(elem))) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io9 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io10(input.endpoint) && "string" === typeof input.description; const _io10 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _iu0 = input => (() => {
|
|
105
105
|
if ("number" === input.type)
|
|
106
106
|
return _io5(input);
|
|
107
107
|
else if ("integer" === input.type)
|
|
@@ -122,12 +122,12 @@ function createReviewController(props) {
|
|
|
122
122
|
path: _path + ".content",
|
|
123
123
|
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
124
124
|
value: input.content
|
|
125
|
-
})) && input.content.map((elem,
|
|
126
|
-
path: _path + ".content[" +
|
|
125
|
+
})) && input.content.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
126
|
+
path: _path + ".content[" + _index4 + "]",
|
|
127
127
|
expected: "AutoBeOpenApi.IOperation",
|
|
128
128
|
value: elem
|
|
129
|
-
})) && _vo2(elem, _path + ".content[" +
|
|
130
|
-
path: _path + ".content[" +
|
|
129
|
+
})) && _vo2(elem, _path + ".content[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
130
|
+
path: _path + ".content[" + _index4 + "]",
|
|
131
131
|
expected: "AutoBeOpenApi.IOperation",
|
|
132
132
|
value: elem
|
|
133
133
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -162,12 +162,12 @@ function createReviewController(props) {
|
|
|
162
162
|
path: _path + ".parameters",
|
|
163
163
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
164
164
|
value: input.parameters
|
|
165
|
-
})) && input.parameters.map((elem,
|
|
166
|
-
path: _path + ".parameters[" +
|
|
165
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
166
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
167
167
|
expected: "AutoBeOpenApi.IParameter",
|
|
168
168
|
value: elem
|
|
169
|
-
})) && _vo3(elem, _path + ".parameters[" +
|
|
170
|
-
path: _path + ".parameters[" +
|
|
169
|
+
})) && _vo3(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
170
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
171
171
|
expected: "AutoBeOpenApi.IParameter",
|
|
172
172
|
value: elem
|
|
173
173
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -192,7 +192,7 @@ function createReviewController(props) {
|
|
|
192
192
|
value: input.responseBody
|
|
193
193
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
194
194
|
path: _path + ".authorizationRole",
|
|
195
|
-
expected: "string &
|
|
195
|
+
expected: "string & CamelCasePattern",
|
|
196
196
|
value: input.authorizationRole
|
|
197
197
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
198
198
|
path: _path + ".authorizationRole",
|
|
@@ -200,16 +200,32 @@ function createReviewController(props) {
|
|
|
200
200
|
value: input.authorizationRole
|
|
201
201
|
})) || _report(_exceptionable, {
|
|
202
202
|
path: _path + ".authorizationRole",
|
|
203
|
-
expected: "((string &
|
|
203
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
204
204
|
value: input.authorizationRole
|
|
205
205
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
206
206
|
path: _path + ".name",
|
|
207
|
-
expected: "string &
|
|
207
|
+
expected: "string & CamelCasePattern",
|
|
208
208
|
value: input.name
|
|
209
209
|
})) || _report(_exceptionable, {
|
|
210
210
|
path: _path + ".name",
|
|
211
|
-
expected: "(string &
|
|
211
|
+
expected: "(string & CamelCasePattern)",
|
|
212
212
|
value: input.name
|
|
213
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
214
|
+
path: _path + ".prerequisites",
|
|
215
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
216
|
+
value: input.prerequisites
|
|
217
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
218
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
219
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
220
|
+
value: elem
|
|
221
|
+
})) && _vo9(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
222
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
223
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
224
|
+
value: elem
|
|
225
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
226
|
+
path: _path + ".prerequisites",
|
|
227
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
228
|
+
value: input.prerequisites
|
|
213
229
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
214
230
|
path: _path + ".path",
|
|
215
231
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -224,11 +240,11 @@ function createReviewController(props) {
|
|
|
224
240
|
value: input.method
|
|
225
241
|
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
226
242
|
path: _path + ".name",
|
|
227
|
-
expected: "string &
|
|
243
|
+
expected: "string & CamelCasePattern",
|
|
228
244
|
value: input.name
|
|
229
245
|
})) || _report(_exceptionable, {
|
|
230
246
|
path: _path + ".name",
|
|
231
|
-
expected: "(string &
|
|
247
|
+
expected: "(string & CamelCasePattern)",
|
|
232
248
|
value: input.name
|
|
233
249
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
234
250
|
path: _path + ".description",
|
|
@@ -358,6 +374,30 @@ function createReviewController(props) {
|
|
|
358
374
|
path: _path + ".typeName",
|
|
359
375
|
expected: "string",
|
|
360
376
|
value: input.typeName
|
|
377
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
378
|
+
path: _path + ".endpoint",
|
|
379
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
380
|
+
value: input.endpoint
|
|
381
|
+
})) && _vo10(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
382
|
+
path: _path + ".endpoint",
|
|
383
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
384
|
+
value: input.endpoint
|
|
385
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
386
|
+
path: _path + ".description",
|
|
387
|
+
expected: "string",
|
|
388
|
+
value: input.description
|
|
389
|
+
})].every(flag => flag); const _vo10 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
390
|
+
path: _path + ".path",
|
|
391
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
392
|
+
value: input.path
|
|
393
|
+
})) || _report(_exceptionable, {
|
|
394
|
+
path: _path + ".path",
|
|
395
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
396
|
+
value: input.path
|
|
397
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
398
|
+
path: _path + ".method",
|
|
399
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
400
|
+
value: input.method
|
|
361
401
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
362
402
|
if ("number" === input.type)
|
|
363
403
|
return _vo5(input, _path, true && _exceptionable);
|
|
@@ -479,7 +519,7 @@ const collection = {
|
|
|
479
519
|
]
|
|
480
520
|
},
|
|
481
521
|
"AutoBeOpenApi.IOperation": {
|
|
482
|
-
description: "Operation of the Restful API.\n\nThis interface defines a single API endpoint with its HTTP {@link method},\n{@link path}, {@link parameters path parameters},\n{@link requestBody request body}, and {@link responseBody} structure. It\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn OpenAPI, this might represent:\n\n```json\n{\n \"/shoppings/customers/orders\": {\n \"post\": {\n \"description\": \"Create a new order application from shopping cart...\",\n \"parameters\": [...],\n \"requestBody\": {...},\n \"responses\": {...}
|
|
522
|
+
description: "Operation of the Restful API.\n\nThis interface defines a single API endpoint with its HTTP {@link method},\n{@link path}, {@link parameters path parameters},\n{@link requestBody request body}, and {@link responseBody} structure. It\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn OpenAPI, this might represent:\n\n```json\n{\n \"/shoppings/customers/orders\": {\n \"post\": {\n \"description\": \"Create a new order application from shopping cart...\",\n \"parameters\": [...],\n \"requestBody\": {...},\n \"responses\": {...},\n ...\n }\n }\n}\n```",
|
|
483
523
|
type: "object",
|
|
484
524
|
properties: {
|
|
485
525
|
specification: {
|
|
@@ -555,6 +595,13 @@ const collection = {
|
|
|
555
595
|
description: "Functional name of the API endpoint.\n\nThis is a semantic identifier that represents the primary function or\npurpose of the API endpoint. It serves as a canonical name that can be\nused for code generation, SDK method names, and internal references.\n\n## Reserved Word Restrictions\n\nCRITICAL: The name MUST NOT be a TypeScript/JavaScript reserved word, as\nit will be used as a class method name in generated code. Avoid names\nlike:\n\n- `delete`, `for`, `if`, `else`, `while`, `do`, `switch`, `case`, `break`\n- `continue`, `function`, `return`, `with`, `in`, `of`, `instanceof`\n- `typeof`, `void`, `var`, `let`, `const`, `class`, `extends`, `import`\n- `export`, `default`, `try`, `catch`, `finally`, `throw`, `new`\n- `super`, `this`, `null`, `true`, `false`, `async`, `await`\n- `yield`, `static`, `private`, `protected`, `public`, `implements`\n- `interface`, `package`, `enum`, `debugger`\n\nInstead, use alternative names for these operations:\n\n- Use `erase` instead of `delete`\n- Use `iterate` instead of `for`\n- Use `when` instead of `if`\n- Use `cls` instead of `class`\n\n## Standard Endpoint Names\n\nUse these conventional names based on the endpoint's primary function:\n\n- **`index`**: List/search operations that return multiple entities\n\n - Typically used with PATCH method for complex queries\n - Example: `PATCH /users` \u2192 `name: \"index\"`\n- **`at`**: Retrieve a specific entity by identifier\n\n - Typically used with GET method on single resource\n - Example: `GET /users/{userId}` \u2192 `name: \"at\"`\n- **`create`**: Create a new entity\n\n - Typically used with POST method\n - Example: `POST /users` \u2192 `name: \"create\"`\n- **`update`**: Update an existing entity\n\n - Typically used with PUT method\n - Example: `PUT /users/{userId}` \u2192 `name: \"update\"`\n- **`erase`**: Delete/remove an entity (NOT `delete` - reserved word!)\n\n - Typically used with DELETE method\n - Example: `DELETE /users/{userId}` \u2192 `name: \"erase\"`\n\n## Custom Endpoint Names\n\nFor specialized operations beyond basic CRUD, use descriptive verbs:\n\n- **`activate`**: Enable or turn on a feature/entity\n- **`deactivate`**: Disable or turn off a feature/entity\n- **`approve`**: Approve a request or entity\n- **`reject`**: Reject a request or entity\n- **`publish`**: Make content publicly available\n- **`archive`**: Move to archived state\n- **`restore`**: Restore from archived/deleted state\n- **`duplicate`**: Create a copy of an entity\n- **`transfer`**: Move ownership or change assignment\n- **`validate`**: Validate data or state\n- **`process`**: Execute a business process or workflow\n- **`export`**: Generate downloadable data\n- **`import`**: Process uploaded data\n\n## Naming Guidelines\n\n- MUST use camelCase naming convention\n- Use singular verb forms\n- Be concise but descriptive\n- Avoid abbreviations unless widely understood\n- Ensure the name clearly represents the endpoint's primary action\n- For nested resources, focus on the action rather than hierarchy\n- NEVER use JavaScript/TypeScript reserved words\n\nValid Examples:\n\n- `index`, `create`, `update`, `erase` (single word)\n- `updatePassword`, `cancelOrder`, `publishArticle` (camelCase)\n- `validateEmail`, `generateReport`, `exportData` (camelCase)\n\nInvalid Examples:\n\n- `update_password` (snake_case not allowed)\n- `UpdatePassword` (PascalCase not allowed)\n- `update-password` (kebab-case not allowed)\n\nPath to Name Examples:\n\n- `GET /shopping/orders/{orderId}/items` \u2192 `name: \"index\"` (lists items)\n- `POST /shopping/orders/{orderId}/cancel` \u2192 `name: \"cancel\"`\n- `PUT /users/{userId}/password` \u2192 `name: \"updatePassword\"`\n\n## Uniqueness Rule\n\nThe `name` must be unique within the API's accessor namespace. The\naccessor is formed by combining the path segments (excluding parameters)\nwith the operation name.\n\nAccessor formation:\n\n1. Extract non-parameter segments from the path (remove `{...}` parts)\n2. Join segments with dots\n3. Append the operation name\n\nExamples:\n\n- Path: `/shopping/sale/{saleId}/review/{reviewId}`, Name: `at` \u2192 Accessor:\n `shopping.sale.review.at`\n- Path: `/users/{userId}/posts`, Name: `index` \u2192 Accessor:\n `users.posts.index`\n- Path: `/auth/login`, Name: `signIn` \u2192 Accessor: `auth.login.signIn`\n\nEach accessor must be globally unique across the entire API. This ensures\noperations can be uniquely identified in generated SDKs and prevents\nnaming conflicts.\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
|
|
556
596
|
type: "string"
|
|
557
597
|
},
|
|
598
|
+
prerequisites: {
|
|
599
|
+
description: "Prerequisites for this API operation.\n\nThe `prerequisites` field defines API operations that must be\nsuccessfully executed before this operation can be performed. This\ncreates an explicit dependency chain between API endpoints, ensuring\nproper execution order and data availability.\n\n## CRITICAL WARNING: Authentication Prerequisites\n\n**NEVER include authentication-related operations as prerequisites!**\nAuthentication is handled separately through the `authorizationRole`\nfield and should NOT be part of the prerequisite chain. Do NOT add\nprerequisites for:\n\n- Login endpoints\n- Token validation endpoints\n- User authentication checks\n- Permission verification endpoints\n\nPrerequisites are ONLY for business logic dependencies, NOT for\nauthentication/authorization.\n\n## Purpose and Use Cases\n\nPrerequisites are essential for operations that depend on:\n\n1. **Existence Validation**: Ensuring resources exist before manipulation\n2. **State Requirements**: Verifying resources are in the correct state\n3. **Data Dependencies**: Loading necessary data for the current operation\n4. **Business Logic Constraints**: Enforcing domain-specific rules\n\n## Execution Flow\n\nWhen an operation has prerequisites:\n\n1. Each prerequisite API must be called first in the specified order\n2. Prerequisites must return successful responses (2xx status codes)\n3. Only after all prerequisites succeed can the main operation proceed\n4. If any prerequisite fails, the operation should not be attempted\n\n## Common Patterns\n\n### Resource Existence Check\n\n```typescript\n// Before updating an order item, ensure the order exists\nprerequisites: [\n {\n endpoint: { path: \"/orders/{orderId}\", method: \"get\" },\n description: \"Order must exist in the system\",\n },\n];\n```\n\n### State Validation\n\n```typescript\n// Before processing payment, ensure order is in correct state\nprerequisites: [\n {\n endpoint: { path: \"/orders/{orderId}/status\", method: \"get\" },\n description: \"Order must be in 'pending_payment' status\",\n },\n];\n```\n\n### Hierarchical Dependencies\n\n```typescript\n// Before accessing a deeply nested resource\nprerequisites: [\n {\n endpoint: { path: \"/projects/{projectId}\", method: \"get\" },\n description: \"Project must exist\",\n },\n {\n endpoint: {\n path: \"/projects/{projectId}/tasks/{taskId}\",\n method: \"get\",\n },\n description: \"Task must exist within the project\",\n },\n];\n```\n\n## Important Guidelines\n\n1. **Order Matters**: Prerequisites are executed in array order\n2. **Parameter Inheritance**: Path parameters from prerequisites can be used\n in the main operation\n3. **Error Handling**: Failed prerequisites should prevent main operation\n4. **Performance**: Consider caching prerequisite results when appropriate\n5. **Documentation**: Each prerequisite must have a clear description\n explaining why it's required\n6. **No Authentication**: NEVER use prerequisites for authentication checks\n\n## Test Generation Impact\n\nThe Test Agent uses prerequisites to:\n\n- Generate proper test setup sequences\n- Create valid test data in the correct order\n- Ensure test scenarios follow realistic workflows\n- Validate error handling when prerequisites fail",
|
|
600
|
+
type: "array",
|
|
601
|
+
items: {
|
|
602
|
+
$ref: "#/$defs/AutoBeOpenApi.IPrerequisite"
|
|
603
|
+
}
|
|
604
|
+
},
|
|
558
605
|
path: {
|
|
559
606
|
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)\n\n\n@pattern ^\\/[a-zA-Z0-9\\/_{}.-]*$",
|
|
560
607
|
type: "string"
|
|
@@ -581,6 +628,7 @@ const collection = {
|
|
|
581
628
|
"responseBody",
|
|
582
629
|
"authorizationRole",
|
|
583
630
|
"name",
|
|
631
|
+
"prerequisites",
|
|
584
632
|
"path",
|
|
585
633
|
"method"
|
|
586
634
|
]
|
|
@@ -769,11 +817,53 @@ const collection = {
|
|
|
769
817
|
"description",
|
|
770
818
|
"typeName"
|
|
771
819
|
]
|
|
820
|
+
},
|
|
821
|
+
"AutoBeOpenApi.IPrerequisite": {
|
|
822
|
+
description: "Prerequisite API operation dependency.\n\n`IPrerequisite` defines a dependency relationship between API operations,\nspecifying that certain endpoints must be successfully called before the\ncurrent operation can proceed. This ensures proper resource validation,\nstate checking, and data availability in complex API workflows.\n\n## CRITICAL WARNING: Authentication is NOT a Prerequisite\n\n**NEVER use prerequisites for authentication or authorization checks!**\n\nPrerequisites are ONLY for business logic dependencies such as:\n\n- Checking if a resource exists\n- Verifying resource state\n- Loading required data\n\nDo NOT create prerequisites for:\n\n- Login/authentication endpoints\n- Token validation\n- Permission checks\n- User authorization verification\n\nAuthentication is handled separately via the `authorizationRole` field on\nthe operation itself. Mixing authentication with business prerequisites\ncreates confusion and incorrect test scenarios.\n\n## Core Concept\n\nPrerequisites create an execution dependency graph for API operations. They\nexplicitly declare which APIs must succeed before attempting the current\noperation, preventing invalid states and ensuring data consistency.\n\n## Structure\n\nEach prerequisite consists of:\n\n1. **endpoint**: The API endpoint that must be called first\n2. **description**: Clear explanation of why this prerequisite is required\n\n## Common Use Cases\n\n### 1. Resource Existence Validation\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/users/{userId}\", \"method\": \"get\" },\n \"description\": \"User must exist before updating their profile\"\n}\n```\n\n### 2. Parent-Child Relationships\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/posts/{postId}\", \"method\": \"get\" },\n \"description\": \"Post must exist before adding comments\"\n}\n```\n\n### 3. State Prerequisites\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/orders/{orderId}/status\", \"method\": \"get\" },\n \"description\": \"Order must be in 'confirmed' state before shipping\"\n}\n```\n\n### 4. Business Logic Dependencies\n\n```typescript\n{\n \"endpoint\": {\n \"path\": \"/inventory/{productId}/stock\",\n \"method\": \"get\"\n },\n \"description\": \"Product must have sufficient stock before creating order\"\n}\n```\n\n## Implementation Guidelines\n\n1. **Clear Descriptions**: Always explain WHY the prerequisite is needed\n2. **Minimal Dependencies**: Only include truly necessary prerequisites\n3. **Logical Order**: If multiple prerequisites exist, order them logically\n4. **Error Context**: Description should help understand failure scenarios\n5. **No Authentication**: Prerequisites must NEVER be authentication checks\n\n## Test Generation Usage\n\nThe Test Agent utilizes prerequisites to:\n\n- Set up test data in the correct sequence\n- Generate realistic test scenarios\n- Create both positive and negative test cases\n- Ensure proper cleanup in reverse dependency order\n\n## Best Practices\n\n- Keep prerequisite chains as short as possible for performance\n- Consider caching prerequisite results when safe to do so\n- Ensure prerequisite descriptions are specific, not generic\n- Validate that circular dependencies don't exist\n- Document any side effects of prerequisite calls\n- NEVER use for authentication/authorization validation\n\n### Description of {@link endpoint} property:\n\n> The API endpoint that must be called before the main operation.\n> \n> This specifies the exact HTTP method and path of the prerequisite API.\n> The endpoint must be a valid operation defined elsewhere in the API\n> specification. Path parameters in the prerequisite endpoint can reference\n> the same parameters available in the main operation.",
|
|
823
|
+
type: "object",
|
|
824
|
+
properties: {
|
|
825
|
+
endpoint: {
|
|
826
|
+
$ref: "#/$defs/AutoBeOpenApi.IEndpoint"
|
|
827
|
+
},
|
|
828
|
+
description: {
|
|
829
|
+
description: "Clear description of why this prerequisite is required.\n\nThis description should explain:\n\n- What validation or check this prerequisite performs\n- What state or condition must be satisfied\n- What happens if this prerequisite fails\n- Any specific data from the prerequisite used by the main operation\n\nThe description helps developers understand the dependency relationship\nand aids in debugging when prerequisites fail.\n\nGuidelines for good descriptions:\n\n- Be specific about the requirement (e.g., \"must be in 'active' state\")\n- Explain business logic constraints (e.g., \"budget must not be exceeded\")\n- Explain data dependencies (e.g., \"provides pricing information needed\")\n- Keep it concise but complete\n\n> MUST be written in English. Never use other languages.",
|
|
830
|
+
type: "string"
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
required: [
|
|
834
|
+
"endpoint",
|
|
835
|
+
"description"
|
|
836
|
+
]
|
|
837
|
+
},
|
|
838
|
+
"AutoBeOpenApi.IEndpoint": {
|
|
839
|
+
description: "API endpoint information.",
|
|
840
|
+
type: "object",
|
|
841
|
+
properties: {
|
|
842
|
+
path: {
|
|
843
|
+
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)\n\n\n@pattern ^\\/[a-zA-Z0-9\\/_{}.-]*$",
|
|
844
|
+
type: "string"
|
|
845
|
+
},
|
|
846
|
+
method: {
|
|
847
|
+
description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\",\nnot \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
|
|
848
|
+
type: "string",
|
|
849
|
+
"enum": [
|
|
850
|
+
"get",
|
|
851
|
+
"post",
|
|
852
|
+
"put",
|
|
853
|
+
"delete",
|
|
854
|
+
"patch"
|
|
855
|
+
]
|
|
856
|
+
}
|
|
857
|
+
},
|
|
858
|
+
required: [
|
|
859
|
+
"path",
|
|
860
|
+
"method"
|
|
861
|
+
]
|
|
772
862
|
}
|
|
773
863
|
}
|
|
774
864
|
},
|
|
775
865
|
description: "Reviews a batch of API operations for quality and correctness.\n\nAnalyzes operations for security vulnerabilities, schema compliance,\nlogical consistency, and standard adherence. Outputs a structured thinking\nprocess containing review findings and improvement plans, plus the final\nproduction-ready operations with all critical issues resolved.",
|
|
776
|
-
validate: (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
866
|
+
validate: (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && (Array.isArray(input.prerequisites) && input.prerequisites.every(elem => "object" === typeof elem && null !== elem && _io9(elem))) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io9 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io10(input.endpoint) && "string" === typeof input.description; const _io10 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _iu0 = input => (() => {
|
|
777
867
|
if ("number" === input.type)
|
|
778
868
|
return _io5(input);
|
|
779
869
|
else if ("integer" === input.type)
|
|
@@ -794,12 +884,12 @@ const collection = {
|
|
|
794
884
|
path: _path + ".content",
|
|
795
885
|
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
796
886
|
value: input.content
|
|
797
|
-
})) && input.content.map((elem,
|
|
798
|
-
path: _path + ".content[" +
|
|
887
|
+
})) && input.content.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
888
|
+
path: _path + ".content[" + _index4 + "]",
|
|
799
889
|
expected: "AutoBeOpenApi.IOperation",
|
|
800
890
|
value: elem
|
|
801
|
-
})) && _vo2(elem, _path + ".content[" +
|
|
802
|
-
path: _path + ".content[" +
|
|
891
|
+
})) && _vo2(elem, _path + ".content[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
892
|
+
path: _path + ".content[" + _index4 + "]",
|
|
803
893
|
expected: "AutoBeOpenApi.IOperation",
|
|
804
894
|
value: elem
|
|
805
895
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -834,12 +924,12 @@ const collection = {
|
|
|
834
924
|
path: _path + ".parameters",
|
|
835
925
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
836
926
|
value: input.parameters
|
|
837
|
-
})) && input.parameters.map((elem,
|
|
838
|
-
path: _path + ".parameters[" +
|
|
927
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
928
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
839
929
|
expected: "AutoBeOpenApi.IParameter",
|
|
840
930
|
value: elem
|
|
841
|
-
})) && _vo3(elem, _path + ".parameters[" +
|
|
842
|
-
path: _path + ".parameters[" +
|
|
931
|
+
})) && _vo3(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
932
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
843
933
|
expected: "AutoBeOpenApi.IParameter",
|
|
844
934
|
value: elem
|
|
845
935
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -864,7 +954,7 @@ const collection = {
|
|
|
864
954
|
value: input.responseBody
|
|
865
955
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
866
956
|
path: _path + ".authorizationRole",
|
|
867
|
-
expected: "string &
|
|
957
|
+
expected: "string & CamelCasePattern",
|
|
868
958
|
value: input.authorizationRole
|
|
869
959
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
870
960
|
path: _path + ".authorizationRole",
|
|
@@ -872,16 +962,32 @@ const collection = {
|
|
|
872
962
|
value: input.authorizationRole
|
|
873
963
|
})) || _report(_exceptionable, {
|
|
874
964
|
path: _path + ".authorizationRole",
|
|
875
|
-
expected: "((string &
|
|
965
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
876
966
|
value: input.authorizationRole
|
|
877
967
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
878
968
|
path: _path + ".name",
|
|
879
|
-
expected: "string &
|
|
969
|
+
expected: "string & CamelCasePattern",
|
|
880
970
|
value: input.name
|
|
881
971
|
})) || _report(_exceptionable, {
|
|
882
972
|
path: _path + ".name",
|
|
883
|
-
expected: "(string &
|
|
973
|
+
expected: "(string & CamelCasePattern)",
|
|
884
974
|
value: input.name
|
|
975
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
976
|
+
path: _path + ".prerequisites",
|
|
977
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
978
|
+
value: input.prerequisites
|
|
979
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
980
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
981
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
982
|
+
value: elem
|
|
983
|
+
})) && _vo9(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
984
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
985
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
986
|
+
value: elem
|
|
987
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
988
|
+
path: _path + ".prerequisites",
|
|
989
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
990
|
+
value: input.prerequisites
|
|
885
991
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
886
992
|
path: _path + ".path",
|
|
887
993
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -896,11 +1002,11 @@ const collection = {
|
|
|
896
1002
|
value: input.method
|
|
897
1003
|
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
898
1004
|
path: _path + ".name",
|
|
899
|
-
expected: "string &
|
|
1005
|
+
expected: "string & CamelCasePattern",
|
|
900
1006
|
value: input.name
|
|
901
1007
|
})) || _report(_exceptionable, {
|
|
902
1008
|
path: _path + ".name",
|
|
903
|
-
expected: "(string &
|
|
1009
|
+
expected: "(string & CamelCasePattern)",
|
|
904
1010
|
value: input.name
|
|
905
1011
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
906
1012
|
path: _path + ".description",
|
|
@@ -1030,6 +1136,30 @@ const collection = {
|
|
|
1030
1136
|
path: _path + ".typeName",
|
|
1031
1137
|
expected: "string",
|
|
1032
1138
|
value: input.typeName
|
|
1139
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
1140
|
+
path: _path + ".endpoint",
|
|
1141
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1142
|
+
value: input.endpoint
|
|
1143
|
+
})) && _vo10(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
1144
|
+
path: _path + ".endpoint",
|
|
1145
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1146
|
+
value: input.endpoint
|
|
1147
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1148
|
+
path: _path + ".description",
|
|
1149
|
+
expected: "string",
|
|
1150
|
+
value: input.description
|
|
1151
|
+
})].every(flag => flag); const _vo10 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1152
|
+
path: _path + ".path",
|
|
1153
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
1154
|
+
value: input.path
|
|
1155
|
+
})) || _report(_exceptionable, {
|
|
1156
|
+
path: _path + ".path",
|
|
1157
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
1158
|
+
value: input.path
|
|
1159
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1160
|
+
path: _path + ".method",
|
|
1161
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1162
|
+
value: input.method
|
|
1033
1163
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1034
1164
|
if ("number" === input.type)
|
|
1035
1165
|
return _vo5(input, _path, true && _exceptionable);
|
|
@@ -1132,7 +1262,7 @@ const collection = {
|
|
|
1132
1262
|
]
|
|
1133
1263
|
},
|
|
1134
1264
|
"AutoBeOpenApi.IOperation": {
|
|
1135
|
-
description: "Operation of the Restful API.\n\nThis interface defines a single API endpoint with its HTTP {@link method},\n{@link path}, {@link parameters path parameters},\n{@link requestBody request body}, and {@link responseBody} structure. It\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn OpenAPI, this might represent:\n\n```json\n{\n \"/shoppings/customers/orders\": {\n \"post\": {\n \"description\": \"Create a new order application from shopping cart...\",\n \"parameters\": [...],\n \"requestBody\": {...},\n \"responses\": {...}
|
|
1265
|
+
description: "Operation of the Restful API.\n\nThis interface defines a single API endpoint with its HTTP {@link method},\n{@link path}, {@link parameters path parameters},\n{@link requestBody request body}, and {@link responseBody} structure. It\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn OpenAPI, this might represent:\n\n```json\n{\n \"/shoppings/customers/orders\": {\n \"post\": {\n \"description\": \"Create a new order application from shopping cart...\",\n \"parameters\": [...],\n \"requestBody\": {...},\n \"responses\": {...},\n ...\n }\n }\n}\n```",
|
|
1136
1266
|
type: "object",
|
|
1137
1267
|
properties: {
|
|
1138
1268
|
specification: {
|
|
@@ -1211,6 +1341,13 @@ const collection = {
|
|
|
1211
1341
|
type: "string",
|
|
1212
1342
|
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
1213
1343
|
},
|
|
1344
|
+
prerequisites: {
|
|
1345
|
+
description: "Prerequisites for this API operation.\n\nThe `prerequisites` field defines API operations that must be\nsuccessfully executed before this operation can be performed. This\ncreates an explicit dependency chain between API endpoints, ensuring\nproper execution order and data availability.\n\n## CRITICAL WARNING: Authentication Prerequisites\n\n**NEVER include authentication-related operations as prerequisites!**\nAuthentication is handled separately through the `authorizationRole`\nfield and should NOT be part of the prerequisite chain. Do NOT add\nprerequisites for:\n\n- Login endpoints\n- Token validation endpoints\n- User authentication checks\n- Permission verification endpoints\n\nPrerequisites are ONLY for business logic dependencies, NOT for\nauthentication/authorization.\n\n## Purpose and Use Cases\n\nPrerequisites are essential for operations that depend on:\n\n1. **Existence Validation**: Ensuring resources exist before manipulation\n2. **State Requirements**: Verifying resources are in the correct state\n3. **Data Dependencies**: Loading necessary data for the current operation\n4. **Business Logic Constraints**: Enforcing domain-specific rules\n\n## Execution Flow\n\nWhen an operation has prerequisites:\n\n1. Each prerequisite API must be called first in the specified order\n2. Prerequisites must return successful responses (2xx status codes)\n3. Only after all prerequisites succeed can the main operation proceed\n4. If any prerequisite fails, the operation should not be attempted\n\n## Common Patterns\n\n### Resource Existence Check\n\n```typescript\n// Before updating an order item, ensure the order exists\nprerequisites: [\n {\n endpoint: { path: \"/orders/{orderId}\", method: \"get\" },\n description: \"Order must exist in the system\",\n },\n];\n```\n\n### State Validation\n\n```typescript\n// Before processing payment, ensure order is in correct state\nprerequisites: [\n {\n endpoint: { path: \"/orders/{orderId}/status\", method: \"get\" },\n description: \"Order must be in 'pending_payment' status\",\n },\n];\n```\n\n### Hierarchical Dependencies\n\n```typescript\n// Before accessing a deeply nested resource\nprerequisites: [\n {\n endpoint: { path: \"/projects/{projectId}\", method: \"get\" },\n description: \"Project must exist\",\n },\n {\n endpoint: {\n path: \"/projects/{projectId}/tasks/{taskId}\",\n method: \"get\",\n },\n description: \"Task must exist within the project\",\n },\n];\n```\n\n## Important Guidelines\n\n1. **Order Matters**: Prerequisites are executed in array order\n2. **Parameter Inheritance**: Path parameters from prerequisites can be used\n in the main operation\n3. **Error Handling**: Failed prerequisites should prevent main operation\n4. **Performance**: Consider caching prerequisite results when appropriate\n5. **Documentation**: Each prerequisite must have a clear description\n explaining why it's required\n6. **No Authentication**: NEVER use prerequisites for authentication checks\n\n## Test Generation Impact\n\nThe Test Agent uses prerequisites to:\n\n- Generate proper test setup sequences\n- Create valid test data in the correct order\n- Ensure test scenarios follow realistic workflows\n- Validate error handling when prerequisites fail",
|
|
1346
|
+
type: "array",
|
|
1347
|
+
items: {
|
|
1348
|
+
$ref: "#/$defs/AutoBeOpenApi.IPrerequisite"
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1214
1351
|
path: {
|
|
1215
1352
|
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
|
|
1216
1353
|
type: "string",
|
|
@@ -1247,6 +1384,7 @@ const collection = {
|
|
|
1247
1384
|
"responseBody",
|
|
1248
1385
|
"authorizationRole",
|
|
1249
1386
|
"name",
|
|
1387
|
+
"prerequisites",
|
|
1250
1388
|
"path",
|
|
1251
1389
|
"method"
|
|
1252
1390
|
]
|
|
@@ -1431,11 +1569,64 @@ const collection = {
|
|
|
1431
1569
|
"description",
|
|
1432
1570
|
"typeName"
|
|
1433
1571
|
]
|
|
1572
|
+
},
|
|
1573
|
+
"AutoBeOpenApi.IPrerequisite": {
|
|
1574
|
+
description: "Prerequisite API operation dependency.\n\n`IPrerequisite` defines a dependency relationship between API operations,\nspecifying that certain endpoints must be successfully called before the\ncurrent operation can proceed. This ensures proper resource validation,\nstate checking, and data availability in complex API workflows.\n\n## CRITICAL WARNING: Authentication is NOT a Prerequisite\n\n**NEVER use prerequisites for authentication or authorization checks!**\n\nPrerequisites are ONLY for business logic dependencies such as:\n\n- Checking if a resource exists\n- Verifying resource state\n- Loading required data\n\nDo NOT create prerequisites for:\n\n- Login/authentication endpoints\n- Token validation\n- Permission checks\n- User authorization verification\n\nAuthentication is handled separately via the `authorizationRole` field on\nthe operation itself. Mixing authentication with business prerequisites\ncreates confusion and incorrect test scenarios.\n\n## Core Concept\n\nPrerequisites create an execution dependency graph for API operations. They\nexplicitly declare which APIs must succeed before attempting the current\noperation, preventing invalid states and ensuring data consistency.\n\n## Structure\n\nEach prerequisite consists of:\n\n1. **endpoint**: The API endpoint that must be called first\n2. **description**: Clear explanation of why this prerequisite is required\n\n## Common Use Cases\n\n### 1. Resource Existence Validation\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/users/{userId}\", \"method\": \"get\" },\n \"description\": \"User must exist before updating their profile\"\n}\n```\n\n### 2. Parent-Child Relationships\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/posts/{postId}\", \"method\": \"get\" },\n \"description\": \"Post must exist before adding comments\"\n}\n```\n\n### 3. State Prerequisites\n\n```typescript\n{\n \"endpoint\": { \"path\": \"/orders/{orderId}/status\", \"method\": \"get\" },\n \"description\": \"Order must be in 'confirmed' state before shipping\"\n}\n```\n\n### 4. Business Logic Dependencies\n\n```typescript\n{\n \"endpoint\": {\n \"path\": \"/inventory/{productId}/stock\",\n \"method\": \"get\"\n },\n \"description\": \"Product must have sufficient stock before creating order\"\n}\n```\n\n## Implementation Guidelines\n\n1. **Clear Descriptions**: Always explain WHY the prerequisite is needed\n2. **Minimal Dependencies**: Only include truly necessary prerequisites\n3. **Logical Order**: If multiple prerequisites exist, order them logically\n4. **Error Context**: Description should help understand failure scenarios\n5. **No Authentication**: Prerequisites must NEVER be authentication checks\n\n## Test Generation Usage\n\nThe Test Agent utilizes prerequisites to:\n\n- Set up test data in the correct sequence\n- Generate realistic test scenarios\n- Create both positive and negative test cases\n- Ensure proper cleanup in reverse dependency order\n\n## Best Practices\n\n- Keep prerequisite chains as short as possible for performance\n- Consider caching prerequisite results when safe to do so\n- Ensure prerequisite descriptions are specific, not generic\n- Validate that circular dependencies don't exist\n- Document any side effects of prerequisite calls\n- NEVER use for authentication/authorization validation",
|
|
1575
|
+
type: "object",
|
|
1576
|
+
properties: {
|
|
1577
|
+
endpoint: {
|
|
1578
|
+
description: "The API endpoint that must be called before the main operation.\n\nThis specifies the exact HTTP method and path of the prerequisite API.\nThe endpoint must be a valid operation defined elsewhere in the API\nspecification. Path parameters in the prerequisite endpoint can reference\nthe same parameters available in the main operation.",
|
|
1579
|
+
$ref: "#/$defs/AutoBeOpenApi.IEndpoint"
|
|
1580
|
+
},
|
|
1581
|
+
description: {
|
|
1582
|
+
description: "Clear description of why this prerequisite is required.\n\nThis description should explain:\n\n- What validation or check this prerequisite performs\n- What state or condition must be satisfied\n- What happens if this prerequisite fails\n- Any specific data from the prerequisite used by the main operation\n\nThe description helps developers understand the dependency relationship\nand aids in debugging when prerequisites fail.\n\nGuidelines for good descriptions:\n\n- Be specific about the requirement (e.g., \"must be in 'active' state\")\n- Explain business logic constraints (e.g., \"budget must not be exceeded\")\n- Explain data dependencies (e.g., \"provides pricing information needed\")\n- Keep it concise but complete\n\n> MUST be written in English. Never use other languages.",
|
|
1583
|
+
type: "string"
|
|
1584
|
+
}
|
|
1585
|
+
},
|
|
1586
|
+
required: [
|
|
1587
|
+
"endpoint",
|
|
1588
|
+
"description"
|
|
1589
|
+
]
|
|
1590
|
+
},
|
|
1591
|
+
"AutoBeOpenApi.IEndpoint": {
|
|
1592
|
+
description: "API endpoint information.",
|
|
1593
|
+
type: "object",
|
|
1594
|
+
properties: {
|
|
1595
|
+
path: {
|
|
1596
|
+
description: "HTTP path of the API operation.\n\nThe URL path for accessing this API operation, using path parameters\nenclosed in curly braces (e.g., `/shoppings/customers/sales/{saleId}`).\n\nIt must be corresponded to the {@link parameters path parameters}.\n\nThe path structure should clearly indicate which database entity this\noperation is manipulating, helping to ensure all entities have\nappropriate API coverage.\n\nPath validation rules:\n\n- Must start with a forward slash (/)\n- Can contain only: letters (a-z, A-Z), numbers (0-9), forward slashes (/),\n curly braces for parameters ({paramName}), hyphens (-), and underscores\n (_)\n- Parameters must be enclosed in curly braces: {paramName}\n- Resource names should be in camelCase\n- No quotes, spaces, or invalid special characters allowed\n- No domain or role-based prefixes\n\nValid examples:\n\n- \"/users\"\n- \"/users/{userId}\"\n- \"/articles/{articleId}/comments\"\n- \"/attachmentFiles\"\n- \"/orders/{orderId}/items/{itemId}\"\n\nInvalid examples:\n\n- \"'/users'\" (contains quotes)\n- \"/user profile\" (contains space)\n- \"/users/[userId]\" (wrong bracket format)\n- \"/admin/users\" (role prefix)\n- \"/api/v1/users\" (API prefix)",
|
|
1597
|
+
type: "string",
|
|
1598
|
+
pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
|
|
1599
|
+
},
|
|
1600
|
+
method: {
|
|
1601
|
+
description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\",\nnot \"GET\").\n\nNote that, if the API operation has {@link requestBody}, method must not\nbe `get`.\n\nAlso, even though the API operation has been designed to only get\ninformation, but it needs complicated request information, it must be\ndefined as `patch` method with {@link requestBody} data specification.\n\n- `get`: get information\n- `patch`: get information with complicated request data\n ({@link requestBody})\n- `post`: create new record\n- `put`: update existing record\n- `delete`: remove record",
|
|
1602
|
+
oneOf: [
|
|
1603
|
+
{
|
|
1604
|
+
"const": "get"
|
|
1605
|
+
},
|
|
1606
|
+
{
|
|
1607
|
+
"const": "post"
|
|
1608
|
+
},
|
|
1609
|
+
{
|
|
1610
|
+
"const": "put"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
"const": "delete"
|
|
1614
|
+
},
|
|
1615
|
+
{
|
|
1616
|
+
"const": "patch"
|
|
1617
|
+
}
|
|
1618
|
+
]
|
|
1619
|
+
}
|
|
1620
|
+
},
|
|
1621
|
+
required: [
|
|
1622
|
+
"path",
|
|
1623
|
+
"method"
|
|
1624
|
+
]
|
|
1434
1625
|
}
|
|
1435
1626
|
}
|
|
1436
1627
|
},
|
|
1437
1628
|
description: "Reviews a batch of API operations for quality and correctness.\n\nAnalyzes operations for security vulnerabilities, schema compliance,\nlogical consistency, and standard adherence. Outputs a structured thinking\nprocess containing review findings and improvement plans, plus the final\nproduction-ready operations with all critical issues resolved.",
|
|
1438
|
-
validate: (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
1629
|
+
validate: (() => { const _io0 = input => "object" === typeof input.think && null !== input.think && _io1(input.think) && (Array.isArray(input.content) && input.content.every(elem => "object" === typeof elem && null !== elem && _io2(elem))); const _io1 = input => "string" === typeof input.review && "string" === typeof input.plan; const _io2 = input => "string" === typeof input.specification && (null === input.authorizationType || "login" === input.authorizationType || "join" === input.authorizationType || "refresh" === input.authorizationType) && "string" === typeof input.description && "string" === typeof input.summary && (Array.isArray(input.parameters) && input.parameters.every(elem => "object" === typeof elem && null !== elem && _io3(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io7(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io8(input.responseBody)) && (null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) && 1 <= input.authorizationRole.length)) && ("string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name)) && (Array.isArray(input.prerequisites) && input.prerequisites.every(elem => "object" === typeof elem && null !== elem && _io9(elem))) && ("string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path)) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) && "string" === typeof input.description && ("object" === typeof input.schema && null !== input.schema && _iu0(input.schema)); const _io4 = input => (undefined === input.minimum || "number" === typeof input.minimum && (Math.floor(input.minimum) === input.minimum && -9223372036854776000 <= input.minimum && input.minimum <= 9223372036854776000)) && (undefined === input.maximum || "number" === typeof input.maximum && (Math.floor(input.maximum) === input.maximum && -9223372036854776000 <= input.maximum && input.maximum <= 9223372036854776000)) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && (Math.floor(input.multipleOf) === input.multipleOf && 0 <= input.multipleOf && input.multipleOf <= 18446744073709552000 && 0 < input.multipleOf)) && "integer" === input.type; const _io5 = input => (undefined === input.minimum || "number" === typeof input.minimum) && (undefined === input.maximum || "number" === typeof input.maximum) && (undefined === input.exclusiveMinimum || "number" === typeof input.exclusiveMinimum) && (undefined === input.exclusiveMaximum || "number" === typeof input.exclusiveMaximum) && (undefined === input.multipleOf || "number" === typeof input.multipleOf && 0 < input.multipleOf) && "number" === input.type; const _io6 = input => (undefined === input.format || "string" === typeof input.format) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io9 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io10(input.endpoint) && "string" === typeof input.description; const _io10 = input => "string" === typeof input.path && RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) && ("get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method); const _iu0 = input => (() => {
|
|
1439
1630
|
if ("number" === input.type)
|
|
1440
1631
|
return _io5(input);
|
|
1441
1632
|
else if ("integer" === input.type)
|
|
@@ -1456,12 +1647,12 @@ const collection = {
|
|
|
1456
1647
|
path: _path + ".content",
|
|
1457
1648
|
expected: "Array<AutoBeOpenApi.IOperation>",
|
|
1458
1649
|
value: input.content
|
|
1459
|
-
})) && input.content.map((elem,
|
|
1460
|
-
path: _path + ".content[" +
|
|
1650
|
+
})) && input.content.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1651
|
+
path: _path + ".content[" + _index4 + "]",
|
|
1461
1652
|
expected: "AutoBeOpenApi.IOperation",
|
|
1462
1653
|
value: elem
|
|
1463
|
-
})) && _vo2(elem, _path + ".content[" +
|
|
1464
|
-
path: _path + ".content[" +
|
|
1654
|
+
})) && _vo2(elem, _path + ".content[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1655
|
+
path: _path + ".content[" + _index4 + "]",
|
|
1465
1656
|
expected: "AutoBeOpenApi.IOperation",
|
|
1466
1657
|
value: elem
|
|
1467
1658
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1496,12 +1687,12 @@ const collection = {
|
|
|
1496
1687
|
path: _path + ".parameters",
|
|
1497
1688
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1498
1689
|
value: input.parameters
|
|
1499
|
-
})) && input.parameters.map((elem,
|
|
1500
|
-
path: _path + ".parameters[" +
|
|
1690
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1691
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1501
1692
|
expected: "AutoBeOpenApi.IParameter",
|
|
1502
1693
|
value: elem
|
|
1503
|
-
})) && _vo3(elem, _path + ".parameters[" +
|
|
1504
|
-
path: _path + ".parameters[" +
|
|
1694
|
+
})) && _vo3(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1695
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1505
1696
|
expected: "AutoBeOpenApi.IParameter",
|
|
1506
1697
|
value: elem
|
|
1507
1698
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1526,7 +1717,7 @@ const collection = {
|
|
|
1526
1717
|
value: input.responseBody
|
|
1527
1718
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
1528
1719
|
path: _path + ".authorizationRole",
|
|
1529
|
-
expected: "string &
|
|
1720
|
+
expected: "string & CamelCasePattern",
|
|
1530
1721
|
value: input.authorizationRole
|
|
1531
1722
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
1532
1723
|
path: _path + ".authorizationRole",
|
|
@@ -1534,16 +1725,32 @@ const collection = {
|
|
|
1534
1725
|
value: input.authorizationRole
|
|
1535
1726
|
})) || _report(_exceptionable, {
|
|
1536
1727
|
path: _path + ".authorizationRole",
|
|
1537
|
-
expected: "((string &
|
|
1728
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
1538
1729
|
value: input.authorizationRole
|
|
1539
1730
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
1540
1731
|
path: _path + ".name",
|
|
1541
|
-
expected: "string &
|
|
1732
|
+
expected: "string & CamelCasePattern",
|
|
1542
1733
|
value: input.name
|
|
1543
1734
|
})) || _report(_exceptionable, {
|
|
1544
1735
|
path: _path + ".name",
|
|
1545
|
-
expected: "(string &
|
|
1736
|
+
expected: "(string & CamelCasePattern)",
|
|
1546
1737
|
value: input.name
|
|
1738
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
1739
|
+
path: _path + ".prerequisites",
|
|
1740
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1741
|
+
value: input.prerequisites
|
|
1742
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1743
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1744
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1745
|
+
value: elem
|
|
1746
|
+
})) && _vo9(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1747
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1748
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1749
|
+
value: elem
|
|
1750
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1751
|
+
path: _path + ".prerequisites",
|
|
1752
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1753
|
+
value: input.prerequisites
|
|
1547
1754
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1548
1755
|
path: _path + ".path",
|
|
1549
1756
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -1558,11 +1765,11 @@ const collection = {
|
|
|
1558
1765
|
value: input.method
|
|
1559
1766
|
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
1560
1767
|
path: _path + ".name",
|
|
1561
|
-
expected: "string &
|
|
1768
|
+
expected: "string & CamelCasePattern",
|
|
1562
1769
|
value: input.name
|
|
1563
1770
|
})) || _report(_exceptionable, {
|
|
1564
1771
|
path: _path + ".name",
|
|
1565
|
-
expected: "(string &
|
|
1772
|
+
expected: "(string & CamelCasePattern)",
|
|
1566
1773
|
value: input.name
|
|
1567
1774
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1568
1775
|
path: _path + ".description",
|
|
@@ -1692,6 +1899,30 @@ const collection = {
|
|
|
1692
1899
|
path: _path + ".typeName",
|
|
1693
1900
|
expected: "string",
|
|
1694
1901
|
value: input.typeName
|
|
1902
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
1903
|
+
path: _path + ".endpoint",
|
|
1904
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1905
|
+
value: input.endpoint
|
|
1906
|
+
})) && _vo10(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
1907
|
+
path: _path + ".endpoint",
|
|
1908
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1909
|
+
value: input.endpoint
|
|
1910
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1911
|
+
path: _path + ".description",
|
|
1912
|
+
expected: "string",
|
|
1913
|
+
value: input.description
|
|
1914
|
+
})].every(flag => flag); const _vo10 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1915
|
+
path: _path + ".path",
|
|
1916
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
1917
|
+
value: input.path
|
|
1918
|
+
})) || _report(_exceptionable, {
|
|
1919
|
+
path: _path + ".path",
|
|
1920
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
1921
|
+
value: input.path
|
|
1922
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1923
|
+
path: _path + ".method",
|
|
1924
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1925
|
+
value: input.method
|
|
1695
1926
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1696
1927
|
if ("number" === input.type)
|
|
1697
1928
|
return _vo5(input, _path, true && _exceptionable);
|