@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
|
@@ -119,7 +119,7 @@ function process(ctx, props) {
|
|
|
119
119
|
function createController(props) {
|
|
120
120
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
121
121
|
const validate = (next) => {
|
|
122
|
-
const result = (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
122
|
+
const result = (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 && _io8(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io9(input.endpoint) && "string" === typeof input.description; const _io9 = 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 => (() => {
|
|
123
123
|
if ("number" === input.type)
|
|
124
124
|
return _io4(input);
|
|
125
125
|
else if ("integer" === input.type)
|
|
@@ -136,12 +136,12 @@ function createController(props) {
|
|
|
136
136
|
path: _path + ".operations",
|
|
137
137
|
expected: "Array<> & MinItems<1>",
|
|
138
138
|
value: input.operations
|
|
139
|
-
})) && input.operations.map((elem,
|
|
140
|
-
path: _path + ".operations[" +
|
|
139
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
140
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
141
141
|
expected: "AutoBeOpenApi.IOperation",
|
|
142
142
|
value: elem
|
|
143
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
144
|
-
path: _path + ".operations[" +
|
|
143
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
144
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
145
145
|
expected: "AutoBeOpenApi.IOperation",
|
|
146
146
|
value: elem
|
|
147
147
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -168,12 +168,12 @@ function createController(props) {
|
|
|
168
168
|
path: _path + ".parameters",
|
|
169
169
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
170
170
|
value: input.parameters
|
|
171
|
-
})) && input.parameters.map((elem,
|
|
172
|
-
path: _path + ".parameters[" +
|
|
171
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
172
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
173
173
|
expected: "AutoBeOpenApi.IParameter",
|
|
174
174
|
value: elem
|
|
175
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
176
|
-
path: _path + ".parameters[" +
|
|
175
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
176
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
177
177
|
expected: "AutoBeOpenApi.IParameter",
|
|
178
178
|
value: elem
|
|
179
179
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -198,7 +198,7 @@ function createController(props) {
|
|
|
198
198
|
value: input.responseBody
|
|
199
199
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
200
200
|
path: _path + ".authorizationRole",
|
|
201
|
-
expected: "string &
|
|
201
|
+
expected: "string & CamelCasePattern",
|
|
202
202
|
value: input.authorizationRole
|
|
203
203
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
204
204
|
path: _path + ".authorizationRole",
|
|
@@ -206,16 +206,32 @@ function createController(props) {
|
|
|
206
206
|
value: input.authorizationRole
|
|
207
207
|
})) || _report(_exceptionable, {
|
|
208
208
|
path: _path + ".authorizationRole",
|
|
209
|
-
expected: "((string &
|
|
209
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
210
210
|
value: input.authorizationRole
|
|
211
211
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
212
212
|
path: _path + ".name",
|
|
213
|
-
expected: "string &
|
|
213
|
+
expected: "string & CamelCasePattern",
|
|
214
214
|
value: input.name
|
|
215
215
|
})) || _report(_exceptionable, {
|
|
216
216
|
path: _path + ".name",
|
|
217
|
-
expected: "(string &
|
|
217
|
+
expected: "(string & CamelCasePattern)",
|
|
218
218
|
value: input.name
|
|
219
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
220
|
+
path: _path + ".prerequisites",
|
|
221
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
222
|
+
value: input.prerequisites
|
|
223
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
224
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
225
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
226
|
+
value: elem
|
|
227
|
+
})) && _vo8(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
228
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
229
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
230
|
+
value: elem
|
|
231
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
232
|
+
path: _path + ".prerequisites",
|
|
233
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
234
|
+
value: input.prerequisites
|
|
219
235
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
220
236
|
path: _path + ".path",
|
|
221
237
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -230,11 +246,11 @@ function createController(props) {
|
|
|
230
246
|
value: input.method
|
|
231
247
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
232
248
|
path: _path + ".name",
|
|
233
|
-
expected: "string &
|
|
249
|
+
expected: "string & CamelCasePattern",
|
|
234
250
|
value: input.name
|
|
235
251
|
})) || _report(_exceptionable, {
|
|
236
252
|
path: _path + ".name",
|
|
237
|
-
expected: "(string &
|
|
253
|
+
expected: "(string & CamelCasePattern)",
|
|
238
254
|
value: input.name
|
|
239
255
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
240
256
|
path: _path + ".description",
|
|
@@ -364,6 +380,30 @@ function createController(props) {
|
|
|
364
380
|
path: _path + ".typeName",
|
|
365
381
|
expected: "string",
|
|
366
382
|
value: input.typeName
|
|
383
|
+
})].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
384
|
+
path: _path + ".endpoint",
|
|
385
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
386
|
+
value: input.endpoint
|
|
387
|
+
})) && _vo9(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
388
|
+
path: _path + ".endpoint",
|
|
389
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
390
|
+
value: input.endpoint
|
|
391
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
392
|
+
path: _path + ".description",
|
|
393
|
+
expected: "string",
|
|
394
|
+
value: input.description
|
|
395
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
396
|
+
path: _path + ".path",
|
|
397
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
398
|
+
value: input.path
|
|
399
|
+
})) || _report(_exceptionable, {
|
|
400
|
+
path: _path + ".path",
|
|
401
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
402
|
+
value: input.path
|
|
403
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
404
|
+
path: _path + ".method",
|
|
405
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
406
|
+
value: input.method
|
|
367
407
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
368
408
|
if ("number" === input.type)
|
|
369
409
|
return _vo4(input, _path, true && _exceptionable);
|
|
@@ -528,7 +568,7 @@ const collection = {
|
|
|
528
568
|
additionalProperties: false,
|
|
529
569
|
$defs: {
|
|
530
570
|
"AutoBeOpenApi.IOperation": {
|
|
531
|
-
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\": {...}
|
|
571
|
+
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```",
|
|
532
572
|
type: "object",
|
|
533
573
|
properties: {
|
|
534
574
|
specification: {
|
|
@@ -604,6 +644,13 @@ const collection = {
|
|
|
604
644
|
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]*$",
|
|
605
645
|
type: "string"
|
|
606
646
|
},
|
|
647
|
+
prerequisites: {
|
|
648
|
+
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",
|
|
649
|
+
type: "array",
|
|
650
|
+
items: {
|
|
651
|
+
$ref: "#/$defs/AutoBeOpenApi.IPrerequisite"
|
|
652
|
+
}
|
|
653
|
+
},
|
|
607
654
|
path: {
|
|
608
655
|
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\\/_{}.-]*$",
|
|
609
656
|
type: "string"
|
|
@@ -630,6 +677,7 @@ const collection = {
|
|
|
630
677
|
"responseBody",
|
|
631
678
|
"authorizationRole",
|
|
632
679
|
"name",
|
|
680
|
+
"prerequisites",
|
|
633
681
|
"path",
|
|
634
682
|
"method"
|
|
635
683
|
]
|
|
@@ -818,11 +866,53 @@ const collection = {
|
|
|
818
866
|
"description",
|
|
819
867
|
"typeName"
|
|
820
868
|
]
|
|
869
|
+
},
|
|
870
|
+
"AutoBeOpenApi.IPrerequisite": {
|
|
871
|
+
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.",
|
|
872
|
+
type: "object",
|
|
873
|
+
properties: {
|
|
874
|
+
endpoint: {
|
|
875
|
+
$ref: "#/$defs/AutoBeOpenApi.IEndpoint"
|
|
876
|
+
},
|
|
877
|
+
description: {
|
|
878
|
+
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.",
|
|
879
|
+
type: "string"
|
|
880
|
+
}
|
|
881
|
+
},
|
|
882
|
+
required: [
|
|
883
|
+
"endpoint",
|
|
884
|
+
"description"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
"AutoBeOpenApi.IEndpoint": {
|
|
888
|
+
description: "API endpoint information.",
|
|
889
|
+
type: "object",
|
|
890
|
+
properties: {
|
|
891
|
+
path: {
|
|
892
|
+
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\\/_{}.-]*$",
|
|
893
|
+
type: "string"
|
|
894
|
+
},
|
|
895
|
+
method: {
|
|
896
|
+
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",
|
|
897
|
+
type: "string",
|
|
898
|
+
"enum": [
|
|
899
|
+
"get",
|
|
900
|
+
"post",
|
|
901
|
+
"put",
|
|
902
|
+
"delete",
|
|
903
|
+
"patch"
|
|
904
|
+
]
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
required: [
|
|
908
|
+
"path",
|
|
909
|
+
"method"
|
|
910
|
+
]
|
|
821
911
|
}
|
|
822
912
|
}
|
|
823
913
|
},
|
|
824
914
|
description: "Creates an authorization Operations for the given roles\n\nThis method generates an OpenAPI interface that defines the authorization\nrequirements for the given roles. It ensures that the interface reflects\nthe correct permissions and access levels for each role.",
|
|
825
|
-
validate: (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
915
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 && _io8(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io9(input.endpoint) && "string" === typeof input.description; const _io9 = 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 => (() => {
|
|
826
916
|
if ("number" === input.type)
|
|
827
917
|
return _io4(input);
|
|
828
918
|
else if ("integer" === input.type)
|
|
@@ -839,12 +929,12 @@ const collection = {
|
|
|
839
929
|
path: _path + ".operations",
|
|
840
930
|
expected: "Array<> & MinItems<1>",
|
|
841
931
|
value: input.operations
|
|
842
|
-
})) && input.operations.map((elem,
|
|
843
|
-
path: _path + ".operations[" +
|
|
932
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
933
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
844
934
|
expected: "AutoBeOpenApi.IOperation",
|
|
845
935
|
value: elem
|
|
846
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
847
|
-
path: _path + ".operations[" +
|
|
936
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
937
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
848
938
|
expected: "AutoBeOpenApi.IOperation",
|
|
849
939
|
value: elem
|
|
850
940
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -871,12 +961,12 @@ const collection = {
|
|
|
871
961
|
path: _path + ".parameters",
|
|
872
962
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
873
963
|
value: input.parameters
|
|
874
|
-
})) && input.parameters.map((elem,
|
|
875
|
-
path: _path + ".parameters[" +
|
|
964
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
965
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
876
966
|
expected: "AutoBeOpenApi.IParameter",
|
|
877
967
|
value: elem
|
|
878
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
879
|
-
path: _path + ".parameters[" +
|
|
968
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
969
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
880
970
|
expected: "AutoBeOpenApi.IParameter",
|
|
881
971
|
value: elem
|
|
882
972
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -901,7 +991,7 @@ const collection = {
|
|
|
901
991
|
value: input.responseBody
|
|
902
992
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
903
993
|
path: _path + ".authorizationRole",
|
|
904
|
-
expected: "string &
|
|
994
|
+
expected: "string & CamelCasePattern",
|
|
905
995
|
value: input.authorizationRole
|
|
906
996
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
907
997
|
path: _path + ".authorizationRole",
|
|
@@ -909,16 +999,32 @@ const collection = {
|
|
|
909
999
|
value: input.authorizationRole
|
|
910
1000
|
})) || _report(_exceptionable, {
|
|
911
1001
|
path: _path + ".authorizationRole",
|
|
912
|
-
expected: "((string &
|
|
1002
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
913
1003
|
value: input.authorizationRole
|
|
914
1004
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
915
1005
|
path: _path + ".name",
|
|
916
|
-
expected: "string &
|
|
1006
|
+
expected: "string & CamelCasePattern",
|
|
917
1007
|
value: input.name
|
|
918
1008
|
})) || _report(_exceptionable, {
|
|
919
1009
|
path: _path + ".name",
|
|
920
|
-
expected: "(string &
|
|
1010
|
+
expected: "(string & CamelCasePattern)",
|
|
921
1011
|
value: input.name
|
|
1012
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
1013
|
+
path: _path + ".prerequisites",
|
|
1014
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1015
|
+
value: input.prerequisites
|
|
1016
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1017
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1018
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1019
|
+
value: elem
|
|
1020
|
+
})) && _vo8(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1021
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1022
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1023
|
+
value: elem
|
|
1024
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1025
|
+
path: _path + ".prerequisites",
|
|
1026
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1027
|
+
value: input.prerequisites
|
|
922
1028
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
923
1029
|
path: _path + ".path",
|
|
924
1030
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -933,11 +1039,11 @@ const collection = {
|
|
|
933
1039
|
value: input.method
|
|
934
1040
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
935
1041
|
path: _path + ".name",
|
|
936
|
-
expected: "string &
|
|
1042
|
+
expected: "string & CamelCasePattern",
|
|
937
1043
|
value: input.name
|
|
938
1044
|
})) || _report(_exceptionable, {
|
|
939
1045
|
path: _path + ".name",
|
|
940
|
-
expected: "(string &
|
|
1046
|
+
expected: "(string & CamelCasePattern)",
|
|
941
1047
|
value: input.name
|
|
942
1048
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
943
1049
|
path: _path + ".description",
|
|
@@ -1067,6 +1173,30 @@ const collection = {
|
|
|
1067
1173
|
path: _path + ".typeName",
|
|
1068
1174
|
expected: "string",
|
|
1069
1175
|
value: input.typeName
|
|
1176
|
+
})].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
1177
|
+
path: _path + ".endpoint",
|
|
1178
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1179
|
+
value: input.endpoint
|
|
1180
|
+
})) && _vo9(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
1181
|
+
path: _path + ".endpoint",
|
|
1182
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1183
|
+
value: input.endpoint
|
|
1184
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1185
|
+
path: _path + ".description",
|
|
1186
|
+
expected: "string",
|
|
1187
|
+
value: input.description
|
|
1188
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1189
|
+
path: _path + ".path",
|
|
1190
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
1191
|
+
value: input.path
|
|
1192
|
+
})) || _report(_exceptionable, {
|
|
1193
|
+
path: _path + ".path",
|
|
1194
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
1195
|
+
value: input.path
|
|
1196
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1197
|
+
path: _path + ".method",
|
|
1198
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1199
|
+
value: input.method
|
|
1070
1200
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1071
1201
|
if ("number" === input.type)
|
|
1072
1202
|
return _vo4(input, _path, true && _exceptionable);
|
|
@@ -1147,7 +1277,7 @@ const collection = {
|
|
|
1147
1277
|
additionalProperties: false,
|
|
1148
1278
|
$defs: {
|
|
1149
1279
|
"AutoBeOpenApi.IOperation": {
|
|
1150
|
-
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\": {...}
|
|
1280
|
+
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```",
|
|
1151
1281
|
type: "object",
|
|
1152
1282
|
properties: {
|
|
1153
1283
|
specification: {
|
|
@@ -1226,6 +1356,13 @@ const collection = {
|
|
|
1226
1356
|
type: "string",
|
|
1227
1357
|
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
1228
1358
|
},
|
|
1359
|
+
prerequisites: {
|
|
1360
|
+
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",
|
|
1361
|
+
type: "array",
|
|
1362
|
+
items: {
|
|
1363
|
+
$ref: "#/$defs/AutoBeOpenApi.IPrerequisite"
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1229
1366
|
path: {
|
|
1230
1367
|
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)",
|
|
1231
1368
|
type: "string",
|
|
@@ -1262,6 +1399,7 @@ const collection = {
|
|
|
1262
1399
|
"responseBody",
|
|
1263
1400
|
"authorizationRole",
|
|
1264
1401
|
"name",
|
|
1402
|
+
"prerequisites",
|
|
1265
1403
|
"path",
|
|
1266
1404
|
"method"
|
|
1267
1405
|
]
|
|
@@ -1446,11 +1584,64 @@ const collection = {
|
|
|
1446
1584
|
"description",
|
|
1447
1585
|
"typeName"
|
|
1448
1586
|
]
|
|
1587
|
+
},
|
|
1588
|
+
"AutoBeOpenApi.IPrerequisite": {
|
|
1589
|
+
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",
|
|
1590
|
+
type: "object",
|
|
1591
|
+
properties: {
|
|
1592
|
+
endpoint: {
|
|
1593
|
+
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.",
|
|
1594
|
+
$ref: "#/$defs/AutoBeOpenApi.IEndpoint"
|
|
1595
|
+
},
|
|
1596
|
+
description: {
|
|
1597
|
+
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.",
|
|
1598
|
+
type: "string"
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
required: [
|
|
1602
|
+
"endpoint",
|
|
1603
|
+
"description"
|
|
1604
|
+
]
|
|
1605
|
+
},
|
|
1606
|
+
"AutoBeOpenApi.IEndpoint": {
|
|
1607
|
+
description: "API endpoint information.",
|
|
1608
|
+
type: "object",
|
|
1609
|
+
properties: {
|
|
1610
|
+
path: {
|
|
1611
|
+
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)",
|
|
1612
|
+
type: "string",
|
|
1613
|
+
pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
|
|
1614
|
+
},
|
|
1615
|
+
method: {
|
|
1616
|
+
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",
|
|
1617
|
+
oneOf: [
|
|
1618
|
+
{
|
|
1619
|
+
"const": "get"
|
|
1620
|
+
},
|
|
1621
|
+
{
|
|
1622
|
+
"const": "post"
|
|
1623
|
+
},
|
|
1624
|
+
{
|
|
1625
|
+
"const": "put"
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"const": "delete"
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"const": "patch"
|
|
1632
|
+
}
|
|
1633
|
+
]
|
|
1634
|
+
}
|
|
1635
|
+
},
|
|
1636
|
+
required: [
|
|
1637
|
+
"path",
|
|
1638
|
+
"method"
|
|
1639
|
+
]
|
|
1449
1640
|
}
|
|
1450
1641
|
}
|
|
1451
1642
|
},
|
|
1452
1643
|
description: "Creates an authorization Operations for the given roles\n\nThis method generates an OpenAPI interface that defines the authorization\nrequirements for the given roles. It ensures that the interface reflects\nthe correct permissions and access levels for each role.",
|
|
1453
|
-
validate: (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _iu0 = input => (() => {
|
|
1644
|
+
validate: (() => { const _io0 = input => Array.isArray(input.operations) && (1 <= input.operations.length && input.operations.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); const _io1 = 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 && _io2(elem))) && (null === input.requestBody || "object" === typeof input.requestBody && null !== input.requestBody && _io6(input.requestBody)) && (null === input.responseBody || "object" === typeof input.responseBody && null !== input.responseBody && _io7(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 && _io8(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 _io2 = 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 _io3 = 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 _io4 = 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 _io5 = 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 _io6 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io7 = input => "string" === typeof input.description && "string" === typeof input.typeName; const _io8 = input => "object" === typeof input.endpoint && null !== input.endpoint && _io9(input.endpoint) && "string" === typeof input.description; const _io9 = 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 => (() => {
|
|
1454
1645
|
if ("number" === input.type)
|
|
1455
1646
|
return _io4(input);
|
|
1456
1647
|
else if ("integer" === input.type)
|
|
@@ -1467,12 +1658,12 @@ const collection = {
|
|
|
1467
1658
|
path: _path + ".operations",
|
|
1468
1659
|
expected: "Array<> & MinItems<1>",
|
|
1469
1660
|
value: input.operations
|
|
1470
|
-
})) && input.operations.map((elem,
|
|
1471
|
-
path: _path + ".operations[" +
|
|
1661
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1662
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1472
1663
|
expected: "AutoBeOpenApi.IOperation",
|
|
1473
1664
|
value: elem
|
|
1474
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
1475
|
-
path: _path + ".operations[" +
|
|
1665
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1666
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1476
1667
|
expected: "AutoBeOpenApi.IOperation",
|
|
1477
1668
|
value: elem
|
|
1478
1669
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -1499,12 +1690,12 @@ const collection = {
|
|
|
1499
1690
|
path: _path + ".parameters",
|
|
1500
1691
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1501
1692
|
value: input.parameters
|
|
1502
|
-
})) && input.parameters.map((elem,
|
|
1503
|
-
path: _path + ".parameters[" +
|
|
1693
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1694
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1504
1695
|
expected: "AutoBeOpenApi.IParameter",
|
|
1505
1696
|
value: elem
|
|
1506
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
1507
|
-
path: _path + ".parameters[" +
|
|
1697
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1698
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1508
1699
|
expected: "AutoBeOpenApi.IParameter",
|
|
1509
1700
|
value: elem
|
|
1510
1701
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1529,7 +1720,7 @@ const collection = {
|
|
|
1529
1720
|
value: input.responseBody
|
|
1530
1721
|
}), null === input.authorizationRole || "string" === typeof input.authorizationRole && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.authorizationRole) || _report(_exceptionable, {
|
|
1531
1722
|
path: _path + ".authorizationRole",
|
|
1532
|
-
expected: "string &
|
|
1723
|
+
expected: "string & CamelCasePattern",
|
|
1533
1724
|
value: input.authorizationRole
|
|
1534
1725
|
})) && (1 <= input.authorizationRole.length || _report(_exceptionable, {
|
|
1535
1726
|
path: _path + ".authorizationRole",
|
|
@@ -1537,16 +1728,32 @@ const collection = {
|
|
|
1537
1728
|
value: input.authorizationRole
|
|
1538
1729
|
})) || _report(_exceptionable, {
|
|
1539
1730
|
path: _path + ".authorizationRole",
|
|
1540
|
-
expected: "((string &
|
|
1731
|
+
expected: "((string & CamelCasePattern & MinLength<1>) | null)",
|
|
1541
1732
|
value: input.authorizationRole
|
|
1542
1733
|
}), "string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
1543
1734
|
path: _path + ".name",
|
|
1544
|
-
expected: "string &
|
|
1735
|
+
expected: "string & CamelCasePattern",
|
|
1545
1736
|
value: input.name
|
|
1546
1737
|
})) || _report(_exceptionable, {
|
|
1547
1738
|
path: _path + ".name",
|
|
1548
|
-
expected: "(string &
|
|
1739
|
+
expected: "(string & CamelCasePattern)",
|
|
1549
1740
|
value: input.name
|
|
1741
|
+
}), (Array.isArray(input.prerequisites) || _report(_exceptionable, {
|
|
1742
|
+
path: _path + ".prerequisites",
|
|
1743
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1744
|
+
value: input.prerequisites
|
|
1745
|
+
})) && input.prerequisites.map((elem, _index6) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1746
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1747
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1748
|
+
value: elem
|
|
1749
|
+
})) && _vo8(elem, _path + ".prerequisites[" + _index6 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1750
|
+
path: _path + ".prerequisites[" + _index6 + "]",
|
|
1751
|
+
expected: "AutoBeOpenApi.IPrerequisite",
|
|
1752
|
+
value: elem
|
|
1753
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
1754
|
+
path: _path + ".prerequisites",
|
|
1755
|
+
expected: "Array<AutoBeOpenApi.IPrerequisite>",
|
|
1756
|
+
value: input.prerequisites
|
|
1550
1757
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1551
1758
|
path: _path + ".path",
|
|
1552
1759
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -1561,11 +1768,11 @@ const collection = {
|
|
|
1561
1768
|
value: input.method
|
|
1562
1769
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
|
|
1563
1770
|
path: _path + ".name",
|
|
1564
|
-
expected: "string &
|
|
1771
|
+
expected: "string & CamelCasePattern",
|
|
1565
1772
|
value: input.name
|
|
1566
1773
|
})) || _report(_exceptionable, {
|
|
1567
1774
|
path: _path + ".name",
|
|
1568
|
-
expected: "(string &
|
|
1775
|
+
expected: "(string & CamelCasePattern)",
|
|
1569
1776
|
value: input.name
|
|
1570
1777
|
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1571
1778
|
path: _path + ".description",
|
|
@@ -1695,6 +1902,30 @@ const collection = {
|
|
|
1695
1902
|
path: _path + ".typeName",
|
|
1696
1903
|
expected: "string",
|
|
1697
1904
|
value: input.typeName
|
|
1905
|
+
})].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => [("object" === typeof input.endpoint && null !== input.endpoint || _report(_exceptionable, {
|
|
1906
|
+
path: _path + ".endpoint",
|
|
1907
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1908
|
+
value: input.endpoint
|
|
1909
|
+
})) && _vo9(input.endpoint, _path + ".endpoint", true && _exceptionable) || _report(_exceptionable, {
|
|
1910
|
+
path: _path + ".endpoint",
|
|
1911
|
+
expected: "AutoBeOpenApi.IEndpoint",
|
|
1912
|
+
value: input.endpoint
|
|
1913
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1914
|
+
path: _path + ".description",
|
|
1915
|
+
expected: "string",
|
|
1916
|
+
value: input.description
|
|
1917
|
+
})].every(flag => flag); const _vo9 = (input, _path, _exceptionable = true) => ["string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1918
|
+
path: _path + ".path",
|
|
1919
|
+
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
1920
|
+
value: input.path
|
|
1921
|
+
})) || _report(_exceptionable, {
|
|
1922
|
+
path: _path + ".path",
|
|
1923
|
+
expected: "(string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">)",
|
|
1924
|
+
value: input.path
|
|
1925
|
+
}), "get" === input.method || "post" === input.method || "put" === input.method || "delete" === input.method || "patch" === input.method || _report(_exceptionable, {
|
|
1926
|
+
path: _path + ".method",
|
|
1927
|
+
expected: "(\"delete\" | \"get\" | \"patch\" | \"post\" | \"put\")",
|
|
1928
|
+
value: input.method
|
|
1698
1929
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1699
1930
|
if ("number" === input.type)
|
|
1700
1931
|
return _vo4(input, _path, true && _exceptionable);
|