@autobe/agent 0.24.2 → 0.25.1
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/AutoBeSystemPromptConstant.d.ts +21 -21
- package/lib/context/IAutoBeApplication.d.ts +101 -6
- package/lib/context/IAutoBeApplicationProps.d.ts +6 -2
- package/lib/factory/createAgenticaHistory.js +1 -1
- package/lib/factory/createAgenticaHistory.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +80 -90
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +6 -5
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/index.mjs +3914 -2594
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +18 -3
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +5 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +19 -7
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +3 -2
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.d.ts +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +1 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- 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/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +2 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +20 -7
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- 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.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -23
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +6 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +22 -6
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +4 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +27 -6
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +21 -5
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.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.d.ts +5 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +20 -4
- 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 +45 -11
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +277 -37
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +69 -70
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.d.ts +6 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +28 -13
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +4 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +11 -8
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +36 -21
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +260 -29
- 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.d.ts +5 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +83 -53
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js +41 -7
- 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/IAutoBeInterfacePrerequisitesApplication.d.ts +52 -0
- package/lib/orchestrate/{common/structures/IAutoBeCommonCorrectDateApplication.js → interface/structures/IAutoBeInterfacePrerequisitesApplication.js} +1 -1
- 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 +105 -5
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +20 -1
- 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/histories/transformPrismaComponentsHistories.d.ts +4 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +19 -8
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +6 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +20 -6
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +3 -3
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +6 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +12 -6
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/{common/histories/transformCommonCorrectDateHistories.d.ts → realize/histories/transformRealizeCorrectCastingHistories.d.ts} +1 -2
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +32 -0
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -0
- 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 +119 -42
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +82 -52
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +128 -88
- 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/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/generateRealizeScenario.js +1 -5
- package/lib/orchestrate/realize/utils/generateRealizeScenario.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 -53
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +11 -7
- 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.d.ts +7 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +35 -96
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +6 -3
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +33 -77
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.d.ts +5 -1
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js +111 -94
- package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +20 -14
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +81 -50
- 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 +18 -7
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +20 -12
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +4 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +46 -25
- 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/AutoBeSystemPromptConstant.ts +21 -21
- package/src/context/IAutoBeApplication.ts +101 -6
- package/src/context/IAutoBeApplicationProps.ts +6 -2
- package/src/factory/createAgenticaHistory.ts +11 -5
- package/src/factory/createAutoBeContext.ts +6 -5
- package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +5 -1
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +16 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +22 -7
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +3 -2
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +2 -2
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +25 -45
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +2 -1
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +23 -9
- package/src/orchestrate/interface/histories/{transformInterfacePrerequisiteHistories.ts → transformInterfaceCommonPrerequisiteHistories.ts} +1 -1
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +33 -24
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +26 -9
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +30 -6
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +24 -7
- package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +118 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +23 -6
- package/src/orchestrate/interface/orchestrateInterface.ts +65 -20
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +22 -12
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +34 -47
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +40 -28
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +9 -3
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +51 -35
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +274 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +52 -33
- 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/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 +19 -1
- package/src/orchestrate/interface/utils/OperationValidator.ts +9 -7
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +20 -6
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +24 -9
- package/src/orchestrate/prisma/orchestratePrisma.ts +7 -3
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +5 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +15 -10
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +44 -0
- 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 +102 -16
- package/src/orchestrate/realize/orchestrateRealize.ts +121 -81
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +50 -7
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +14 -4
- 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/generateRealizeScenario.ts +1 -5
- 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 -97
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +14 -7
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +50 -115
- package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +41 -111
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +35 -12
- package/src/orchestrate/test/orchestrateTest.ts +19 -13
- package/src/orchestrate/test/orchestrateTestCorrect.ts +71 -51
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +13 -1
- package/src/orchestrate/test/orchestrateTestScenario.ts +27 -17
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +32 -19
- package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
- 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/common/histories/transformCommonCorrectDateHistories.js +0 -48
- package/lib/orchestrate/common/histories/transformCommonCorrectDateHistories.js.map +0 -1
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.d.ts +0 -35
- package/lib/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.js.map +0 -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/lib/orchestrate/realize/orchestrateRealizeCorrectDate.d.ts +0 -4
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js +0 -540
- package/lib/orchestrate/realize/orchestrateRealizeCorrectDate.js.map +0 -1
- package/src/orchestrate/common/histories/transformCommonCorrectDateHistories.ts +0 -60
- package/src/orchestrate/common/structures/IAutoBeCommonCorrectDateApplication.ts +0 -40
- package/src/orchestrate/interface/utils/OpenApiEndpointComparator.ts +0 -23
- package/src/orchestrate/realize/orchestrateRealizeCorrectDate.ts +0 -372
|
@@ -54,7 +54,7 @@ const uuid_1 = require("uuid");
|
|
|
54
54
|
const assertSchemaModel_1 = require("../../context/assertSchemaModel");
|
|
55
55
|
const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
|
|
56
56
|
const transformInterfaceAuthorizationsHistories_1 = require("./histories/transformInterfaceAuthorizationsHistories");
|
|
57
|
-
function orchestrateInterfaceAuthorizations(ctx) {
|
|
57
|
+
function orchestrateInterfaceAuthorizations(ctx, instruction) {
|
|
58
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
var _a, _b;
|
|
60
60
|
const roles = (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.roles) !== null && _b !== void 0 ? _b : [];
|
|
@@ -63,7 +63,12 @@ function orchestrateInterfaceAuthorizations(ctx) {
|
|
|
63
63
|
completed: 0,
|
|
64
64
|
};
|
|
65
65
|
const authorizations = yield (0, executeCachedBatch_1.executeCachedBatch)(roles.map((role) => (promptCacheKey) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const event = yield process(ctx,
|
|
66
|
+
const event = yield process(ctx, {
|
|
67
|
+
role,
|
|
68
|
+
progress,
|
|
69
|
+
promptCacheKey,
|
|
70
|
+
instruction,
|
|
71
|
+
});
|
|
67
72
|
ctx.dispatch(event);
|
|
68
73
|
return {
|
|
69
74
|
role: role.name,
|
|
@@ -73,7 +78,7 @@ function orchestrateInterfaceAuthorizations(ctx) {
|
|
|
73
78
|
return authorizations;
|
|
74
79
|
});
|
|
75
80
|
}
|
|
76
|
-
function process(ctx,
|
|
81
|
+
function process(ctx, props) {
|
|
77
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
83
|
var _a, _b;
|
|
79
84
|
const pointer = {
|
|
@@ -81,16 +86,20 @@ function process(ctx, role, progress, promptCacheKey) {
|
|
|
81
86
|
};
|
|
82
87
|
const { tokenUsage } = yield ctx.conversate({
|
|
83
88
|
source: "interfaceAuthorization",
|
|
84
|
-
histories: (0, transformInterfaceAuthorizationsHistories_1.transformInterfaceAuthorizationsHistories)(
|
|
89
|
+
histories: (0, transformInterfaceAuthorizationsHistories_1.transformInterfaceAuthorizationsHistories)({
|
|
90
|
+
state: ctx.state(),
|
|
91
|
+
instruction: props.instruction,
|
|
92
|
+
role: props.role,
|
|
93
|
+
}),
|
|
85
94
|
controller: createController({
|
|
86
95
|
model: ctx.model,
|
|
87
|
-
role,
|
|
96
|
+
role: props.role,
|
|
88
97
|
build: (next) => {
|
|
89
98
|
pointer.value = next;
|
|
90
99
|
},
|
|
91
100
|
}),
|
|
92
101
|
enforceFunctionCall: true,
|
|
93
|
-
promptCacheKey,
|
|
102
|
+
promptCacheKey: props.promptCacheKey,
|
|
94
103
|
message: "Create Authorization Operation for the given roles",
|
|
95
104
|
});
|
|
96
105
|
if (pointer.value === null)
|
|
@@ -99,18 +108,18 @@ function process(ctx, role, progress, promptCacheKey) {
|
|
|
99
108
|
type: "interfaceAuthorization",
|
|
100
109
|
id: (0, uuid_1.v7)(),
|
|
101
110
|
operations: pointer.value.operations,
|
|
102
|
-
completed: ++progress.completed,
|
|
111
|
+
completed: ++props.progress.completed,
|
|
103
112
|
tokenUsage,
|
|
104
113
|
created_at: new Date().toISOString(),
|
|
105
114
|
step: (_b = (_a = ctx.state().analyze) === null || _a === void 0 ? void 0 : _a.step) !== null && _b !== void 0 ? _b : 0,
|
|
106
|
-
total: progress.total,
|
|
115
|
+
total: props.progress.total,
|
|
107
116
|
};
|
|
108
117
|
});
|
|
109
118
|
}
|
|
110
119
|
function createController(props) {
|
|
111
120
|
(0, assertSchemaModel_1.assertSchemaModel)(props.model);
|
|
112
121
|
const validate = (next) => {
|
|
113
|
-
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 => (() => {
|
|
114
123
|
if ("number" === input.type)
|
|
115
124
|
return _io4(input);
|
|
116
125
|
else if ("integer" === input.type)
|
|
@@ -127,12 +136,12 @@ function createController(props) {
|
|
|
127
136
|
path: _path + ".operations",
|
|
128
137
|
expected: "Array<> & MinItems<1>",
|
|
129
138
|
value: input.operations
|
|
130
|
-
})) && input.operations.map((elem,
|
|
131
|
-
path: _path + ".operations[" +
|
|
139
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
140
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
132
141
|
expected: "AutoBeOpenApi.IOperation",
|
|
133
142
|
value: elem
|
|
134
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
135
|
-
path: _path + ".operations[" +
|
|
143
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
144
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
136
145
|
expected: "AutoBeOpenApi.IOperation",
|
|
137
146
|
value: elem
|
|
138
147
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -159,12 +168,12 @@ function createController(props) {
|
|
|
159
168
|
path: _path + ".parameters",
|
|
160
169
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
161
170
|
value: input.parameters
|
|
162
|
-
})) && input.parameters.map((elem,
|
|
163
|
-
path: _path + ".parameters[" +
|
|
171
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
172
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
164
173
|
expected: "AutoBeOpenApi.IParameter",
|
|
165
174
|
value: elem
|
|
166
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
167
|
-
path: _path + ".parameters[" +
|
|
175
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
176
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
168
177
|
expected: "AutoBeOpenApi.IParameter",
|
|
169
178
|
value: elem
|
|
170
179
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -207,6 +216,22 @@ function createController(props) {
|
|
|
207
216
|
path: _path + ".name",
|
|
208
217
|
expected: "(string & CamelPattern)",
|
|
209
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
|
|
210
235
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
211
236
|
path: _path + ".path",
|
|
212
237
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -355,6 +380,30 @@ function createController(props) {
|
|
|
355
380
|
path: _path + ".typeName",
|
|
356
381
|
expected: "string",
|
|
357
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
|
|
358
407
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
359
408
|
if ("number" === input.type)
|
|
360
409
|
return _vo4(input, _path, true && _exceptionable);
|
|
@@ -519,7 +568,7 @@ const collection = {
|
|
|
519
568
|
additionalProperties: false,
|
|
520
569
|
$defs: {
|
|
521
570
|
"AutoBeOpenApi.IOperation": {
|
|
522
|
-
description: "Operation of the Restful API.\n\nThis interface defines a single API endpoint with its HTTP {@link method},\n{@link path}, {@link parameters path parameters},\n{@link requestBody request body}, and {@link responseBody} structure. It\ncorresponds to an individual operation in the paths section of an OpenAPI\ndocument.\n\nEach operation requires a detailed explanation of its purpose through the\nreason and description fields, making it clear why the API was designed and\nhow it should be used.\n\nAll request bodies and responses for this operation must be object types\nand must reference named types defined in the components section. The\ncontent-type is always `application/json`. For file upload/download\noperations, use `string & tags.Format<\"uri\">` in the appropriate schema\ninstead of binary data formats.\n\nIn OpenAPI, this might represent:\n\n```json\n{\n \"/shoppings/customers/orders\": {\n \"post\": {\n \"description\": \"Create a new order application from shopping cart...\",\n \"parameters\": [...],\n \"requestBody\": {...},\n \"responses\": {...}
|
|
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```",
|
|
523
572
|
type: "object",
|
|
524
573
|
properties: {
|
|
525
574
|
specification: {
|
|
@@ -595,6 +644,13 @@ const collection = {
|
|
|
595
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]*$",
|
|
596
645
|
type: "string"
|
|
597
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
|
+
},
|
|
598
654
|
path: {
|
|
599
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\\/_{}.-]*$",
|
|
600
656
|
type: "string"
|
|
@@ -621,6 +677,7 @@ const collection = {
|
|
|
621
677
|
"responseBody",
|
|
622
678
|
"authorizationRole",
|
|
623
679
|
"name",
|
|
680
|
+
"prerequisites",
|
|
624
681
|
"path",
|
|
625
682
|
"method"
|
|
626
683
|
]
|
|
@@ -809,11 +866,53 @@ const collection = {
|
|
|
809
866
|
"description",
|
|
810
867
|
"typeName"
|
|
811
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
|
+
]
|
|
812
911
|
}
|
|
813
912
|
}
|
|
814
913
|
},
|
|
815
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.",
|
|
816
|
-
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 => (() => {
|
|
817
916
|
if ("number" === input.type)
|
|
818
917
|
return _io4(input);
|
|
819
918
|
else if ("integer" === input.type)
|
|
@@ -830,12 +929,12 @@ const collection = {
|
|
|
830
929
|
path: _path + ".operations",
|
|
831
930
|
expected: "Array<> & MinItems<1>",
|
|
832
931
|
value: input.operations
|
|
833
|
-
})) && input.operations.map((elem,
|
|
834
|
-
path: _path + ".operations[" +
|
|
932
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
933
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
835
934
|
expected: "AutoBeOpenApi.IOperation",
|
|
836
935
|
value: elem
|
|
837
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
838
|
-
path: _path + ".operations[" +
|
|
936
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
937
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
839
938
|
expected: "AutoBeOpenApi.IOperation",
|
|
840
939
|
value: elem
|
|
841
940
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -862,12 +961,12 @@ const collection = {
|
|
|
862
961
|
path: _path + ".parameters",
|
|
863
962
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
864
963
|
value: input.parameters
|
|
865
|
-
})) && input.parameters.map((elem,
|
|
866
|
-
path: _path + ".parameters[" +
|
|
964
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
965
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
867
966
|
expected: "AutoBeOpenApi.IParameter",
|
|
868
967
|
value: elem
|
|
869
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
870
|
-
path: _path + ".parameters[" +
|
|
968
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
969
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
871
970
|
expected: "AutoBeOpenApi.IParameter",
|
|
872
971
|
value: elem
|
|
873
972
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -910,6 +1009,22 @@ const collection = {
|
|
|
910
1009
|
path: _path + ".name",
|
|
911
1010
|
expected: "(string & CamelPattern)",
|
|
912
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
|
|
913
1028
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
914
1029
|
path: _path + ".path",
|
|
915
1030
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -1058,6 +1173,30 @@ const collection = {
|
|
|
1058
1173
|
path: _path + ".typeName",
|
|
1059
1174
|
expected: "string",
|
|
1060
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
|
|
1061
1200
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1062
1201
|
if ("number" === input.type)
|
|
1063
1202
|
return _vo4(input, _path, true && _exceptionable);
|
|
@@ -1138,7 +1277,7 @@ const collection = {
|
|
|
1138
1277
|
additionalProperties: false,
|
|
1139
1278
|
$defs: {
|
|
1140
1279
|
"AutoBeOpenApi.IOperation": {
|
|
1141
|
-
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```",
|
|
1142
1281
|
type: "object",
|
|
1143
1282
|
properties: {
|
|
1144
1283
|
specification: {
|
|
@@ -1217,6 +1356,13 @@ const collection = {
|
|
|
1217
1356
|
type: "string",
|
|
1218
1357
|
pattern: "^[a-z][a-zA-Z0-9]*$"
|
|
1219
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
|
+
},
|
|
1220
1366
|
path: {
|
|
1221
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)",
|
|
1222
1368
|
type: "string",
|
|
@@ -1253,6 +1399,7 @@ const collection = {
|
|
|
1253
1399
|
"responseBody",
|
|
1254
1400
|
"authorizationRole",
|
|
1255
1401
|
"name",
|
|
1402
|
+
"prerequisites",
|
|
1256
1403
|
"path",
|
|
1257
1404
|
"method"
|
|
1258
1405
|
]
|
|
@@ -1437,11 +1584,64 @@ const collection = {
|
|
|
1437
1584
|
"description",
|
|
1438
1585
|
"typeName"
|
|
1439
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
|
+
]
|
|
1440
1640
|
}
|
|
1441
1641
|
}
|
|
1442
1642
|
},
|
|
1443
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.",
|
|
1444
|
-
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 => (() => {
|
|
1445
1645
|
if ("number" === input.type)
|
|
1446
1646
|
return _io4(input);
|
|
1447
1647
|
else if ("integer" === input.type)
|
|
@@ -1458,12 +1658,12 @@ const collection = {
|
|
|
1458
1658
|
path: _path + ".operations",
|
|
1459
1659
|
expected: "Array<> & MinItems<1>",
|
|
1460
1660
|
value: input.operations
|
|
1461
|
-
})) && input.operations.map((elem,
|
|
1462
|
-
path: _path + ".operations[" +
|
|
1661
|
+
})) && input.operations.map((elem, _index4) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1662
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1463
1663
|
expected: "AutoBeOpenApi.IOperation",
|
|
1464
1664
|
value: elem
|
|
1465
|
-
})) && _vo1(elem, _path + ".operations[" +
|
|
1466
|
-
path: _path + ".operations[" +
|
|
1665
|
+
})) && _vo1(elem, _path + ".operations[" + _index4 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1666
|
+
path: _path + ".operations[" + _index4 + "]",
|
|
1467
1667
|
expected: "AutoBeOpenApi.IOperation",
|
|
1468
1668
|
value: elem
|
|
1469
1669
|
})).every(flag => flag)) || _report(_exceptionable, {
|
|
@@ -1490,12 +1690,12 @@ const collection = {
|
|
|
1490
1690
|
path: _path + ".parameters",
|
|
1491
1691
|
expected: "Array<AutoBeOpenApi.IParameter>",
|
|
1492
1692
|
value: input.parameters
|
|
1493
|
-
})) && input.parameters.map((elem,
|
|
1494
|
-
path: _path + ".parameters[" +
|
|
1693
|
+
})) && input.parameters.map((elem, _index5) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1694
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1495
1695
|
expected: "AutoBeOpenApi.IParameter",
|
|
1496
1696
|
value: elem
|
|
1497
|
-
})) && _vo2(elem, _path + ".parameters[" +
|
|
1498
|
-
path: _path + ".parameters[" +
|
|
1697
|
+
})) && _vo2(elem, _path + ".parameters[" + _index5 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1698
|
+
path: _path + ".parameters[" + _index5 + "]",
|
|
1499
1699
|
expected: "AutoBeOpenApi.IParameter",
|
|
1500
1700
|
value: elem
|
|
1501
1701
|
})).every(flag => flag) || _report(_exceptionable, {
|
|
@@ -1538,6 +1738,22 @@ const collection = {
|
|
|
1538
1738
|
path: _path + ".name",
|
|
1539
1739
|
expected: "(string & CamelPattern)",
|
|
1540
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
|
|
1541
1757
|
}), "string" === typeof input.path && (RegExp("^\\/[a-zA-Z0-9\\/_{}.-]*$").test(input.path) || _report(_exceptionable, {
|
|
1542
1758
|
path: _path + ".path",
|
|
1543
1759
|
expected: "string & Pattern<\"^\\\\/[a-zA-Z0-9\\\\/_{}.-]*$\">",
|
|
@@ -1686,6 +1902,30 @@ const collection = {
|
|
|
1686
1902
|
path: _path + ".typeName",
|
|
1687
1903
|
expected: "string",
|
|
1688
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
|
|
1689
1929
|
})].every(flag => flag); const _vu0 = (input, _path, _exceptionable = true) => (() => {
|
|
1690
1930
|
if ("number" === input.type)
|
|
1691
1931
|
return _vo4(input, _path, true && _exceptionable);
|