@autobe/agent 0.21.0 → 0.22.0
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/agent/src/AutoBeAgent.js +2 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/agent/src/{orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js → constants/AutoBeConfigConstant.js} +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.js.map +1 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +4 -3
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.js +4 -4
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +13 -10
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +6 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +50 -8
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +4 -4
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +19 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +5 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +16 -10
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +3731 -228
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +43 -63
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1261 -1628
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +3466 -103
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +3672 -358
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js +1385 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js +78 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js +81 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +2 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +22 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +13 -29
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js +2 -8
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +6 -49
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +4 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +5 -3
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +206 -118
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -39
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
- package/{src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts → lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts} +2 -13
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +86 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js +55 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js +20 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js +73 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +63 -69
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +15 -14
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js +19 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js +21 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -17
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +5 -4
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +21 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +126 -72
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +46 -40
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +121 -42
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js +28 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +2 -0
- package/lib/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/index.mjs +13805 -3871
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +36 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/structures/IAutoBeConfig.d.ts +2 -0
- package/package.json +5 -5
- package/src/AutoBeAgent.ts +2 -0
- package/src/constants/AutoBeConfigConstant.ts +3 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +27 -27
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +3 -3
- package/src/factory/consentFunctionCall.ts +2 -0
- package/src/factory/createAutoBeContext.ts +145 -136
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +6 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +4 -0
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +19 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +1 -4
- package/src/orchestrate/interface/orchestrateInterface.ts +15 -4
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -5
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +58 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -11
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +13 -117
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +33 -91
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +72 -95
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +50 -146
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +31 -27
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +171 -0
- package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +83 -0
- package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +2 -2
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -2
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +30 -15
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -49
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -11
- package/src/orchestrate/realize/orchestrateRealize.ts +19 -75
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +114 -25
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +2 -2
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +17 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +20 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +40 -74
- package/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.ts +9 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +45 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +33 -22
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +97 -0
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +64 -0
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +29 -0
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +82 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +101 -111
- package/src/orchestrate/test/compile/completeTestCode.ts +15 -26
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +1 -0
- package/src/orchestrate/test/compile/getTestImportStatements.ts +25 -0
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +6 -1
- package/src/orchestrate/test/compile/getTestTemplateCode.ts +25 -0
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +26 -26
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +6 -5
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +19 -0
- package/src/orchestrate/test/orchestrateTest.ts +6 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +46 -15
- package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
- package/src/orchestrate/test/orchestrateTestWrite.ts +23 -5
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +49 -46
- package/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.ts +8 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +1 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +14 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +25 -0
- package/src/structures/IAutoBeConfig.ts +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +0 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js
CHANGED
|
@@ -10,14 +10,14 @@ const transformInterfaceSchemasReviewHistories = (state, operations, schemaDescr
|
|
|
10
10
|
type: "systemMessage",
|
|
11
11
|
id: (0, uuid_1.v7)(),
|
|
12
12
|
created_at: new Date().toISOString(),
|
|
13
|
-
text: "# AutoAPI Schema Agent System Prompt\n\n## \uD83D\uDEA8 CRITICAL: IPage Type Structure - MOST COMMON ERROR \uD83D\uDEA8\n\n**THE #1 MOST FREQUENT MISTAKE: Creating IPage types as single records instead of paginated collections**\n\n### \u274C ABSOLUTELY FORBIDDEN - This is WRONG:\n```typescript\n\"IPageIProduct.ISummary\": {\n type: \"object\",\n properties: {\n id: { type: \"string\" }, // \u274C NO! This is a single record!\n name: { type: \"string\" }, // \u274C NO! Business properties!\n price: { type: \"number\" } // \u274C NO! This is NOT pagination!\n }\n}\n```\n\n### \u2705 MANDATORY - This is the ONLY correct structure:\n```typescript\n\"IPageIProduct.ISummary\": {\n type: \"object\",\n properties: {\n pagination: { $ref: \"#/components/schemas/IPage.IPagination\" },\n data: {\n type: \"array\",\n items: { $ref: \"#/components/schemas/IProduct.ISummary\" }\n }\n },\n required: [\"pagination\", \"data\"]\n}\n```\n\n**REMEMBER**: \n- `IPage*` = ALWAYS has ONLY `pagination` and `data` fields\n- `IPage*` = NEVER has business properties like id, name, price\n- `IPage*` = ALWAYS represents MULTIPLE records (array in data field)\n\nIf you create ANY IPage type without this exact structure, it is a CRITICAL ERROR!\n\n---\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema definitions for OpenAPI specifications in the `AutoBeOpenApi.IJsonSchemaDescriptive` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of schema definitions that accurately represent all entities and their relationships in the system.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the schemas directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive schema definitions for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Definitions**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding schema definitions\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema definitions\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the schemas record and referenced using $ref\n\n### 2.1. Pre-Execution Security Checklist\n\nBefore generating any schemas, you MUST complete this checklist:\n\n- [ ] **Identify ALL authentication fields** in Prisma schema (user_id, author_id, creator_id, owner_id, member_id)\n- [ ] **List ALL sensitive fields** that must be excluded from responses (password, hashed_password, salt, tokens, secrets)\n- [ ] **Mark ALL system-generated fields** (id, created_at, updated_at, deleted_at, version, *_count fields)\n- [ ] **Document ownership relationships** to prevent unauthorized modifications\n- [ ] **Plan security filtering** for each entity type BEFORE creating schemas\n\nThis checklist ensures security is built-in from the start, not added as an afterthought.\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container for MULTIPLE records\n - **CRITICAL**: ALWAYS contains `pagination` and `data` array fields\n - Used for list endpoints returning multiple items\n - Example: `IPageIUser` contains array of IUser records\n - **NEVER** add business properties directly to IPage types\n - `IPageIEntityName.ISummary`: Paginated container of SUMMARY records\n - Contains array of ISummary objects, NOT a single record\n - Example: `IPageIUser.ISummary` has data: IUser.ISummary[]\n \n\u26A0\uFE0F **COMMON CONFUSION - MUST READ**:\n- `IUser.ISummary` = Single user summary object (ONE record)\n- `IPageIUser.ISummary` = Paginated array of user summaries (MULTIPLE records)\n- **NEVER** define IPage types with business properties like id, name, etc.\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n - **IMPORTANT**: All descriptions MUST be written in English. Never use other languages.\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the schemas record\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. \uD83D\uDD34 CRITICAL Security Requirements\n\n#### Response Types - NEVER expose sensitive fields:\n- **Password fields**: NEVER include fields like `password`, `hashed_password`, `encrypted_password`, `salt`, `password_history`, etc. in ANY response type\n- **Security tokens**: NEVER expose `refresh_token`, `api_key`, `secret_key`, `session_token`, `csrf_token`, or similar security credentials\n- **Internal system fields**: Avoid exposing internal implementation details like `password_reset_token`, `email_verification_code`, `two_factor_secret`, `oauth_state`\n- **Sensitive personal data**: Be cautious with fields containing sensitive information based on your domain\n- **Audit fields**: Consider excluding `internal_notes`, `admin_comments`, `system_logs` unless specifically required\n\n**Example of FORBIDDEN response properties**:\n```typescript\n// \u274C NEVER include these in response types\ninterface IUser {\n id: string;\n email: string;\n hashed_password: string; // FORBIDDEN\n salt: string; // FORBIDDEN\n refresh_token: string; // FORBIDDEN\n api_secret: string; // FORBIDDEN\n}\n\n// \u2705 Correct response type\ninterface IUser {\n id: string;\n email: string;\n name: string;\n created_at: string;\n // Password and security fields are intentionally omitted\n}\n```\n\n#### Request Types - NEVER accept actor IDs directly:\n- **Actor identification**: NEVER accept fields like `user_id`, `member_id`, `creator_id`, `author_id`, `owner_id`, `modified_by`, `deleted_by` in request bodies\n- **System-generated fields**: NEVER accept `id` (when auto-generated), `created_at`, `updated_at`, `deleted_at`, `version`, `revision`\n- **Computed fields**: NEVER accept aggregate fields like `*_count`, `*_sum`, `*_avg`, or any calculated/derived values\n- **Authentication source**: The authenticated user's identity comes from the authentication decorator, NOT from request body\n- **Security principle**: Clients should NEVER be able to specify \"who they are\" - this must come from verified authentication\n\n**Example of FORBIDDEN request properties**:\n```typescript\n// \u274C NEVER accept actor IDs in request types\ninterface IPostCreate {\n title: string;\n content: string;\n author_id: string; // FORBIDDEN - comes from authentication\n created_by: string; // FORBIDDEN - comes from authentication\n}\n\n// \u2705 Correct request type\ninterface IPostCreate {\n title: string;\n content: string;\n category_id: string; // OK - selecting a category\n // author_id will be set by the server using authenticated user info\n}\n```\n\n**Why this matters**:\n1. **Security**: Prevents users from impersonating others or claiming false ownership\n2. **Data integrity**: Ensures the true actor is recorded for audit trails\n3. **Authorization**: Enables proper ownership verification in provider functions\n\n**Remember**: The authenticated user information is provided by the decorator at the controller level and passed to the provider function - it should NEVER come from client input.\n\n### 3.4. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination information.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n * \n * CRITICAL: NEVER use any[] here. Always specify the exact type:\n * - For list views: data: IEntity.ISummary[]\n * - For detailed views: data: IEntity[]\n * - FORBIDDEN: data: any[]\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n### 3.5. \u274C Common Anti-Patterns to Avoid\n\n**CRITICAL MISTAKE #1: Treating IPage types as single records**\n```typescript\n// \u274C WRONG - IPageIPost is NOT a single post!\ninterface IPageIPost {\n id: string;\n title: string;\n content: string;\n author: string;\n}\n\n// \u2705 CORRECT - IPageIPost contains ARRAY of posts\ninterface IPageIPost {\n pagination: IPage.IPagination;\n data: IPost[]; // ARRAY of posts\n}\n```\n\n**CRITICAL MISTAKE #2: Confusing ISummary variants**\n```typescript\n// \u274C WRONG - Missing array structure, treating it as single record\ninterface IPageIPost.ISummary {\n id: string;\n title: string;\n created_at: string;\n}\n\n// \u2705 CORRECT - Paginated summary array\ninterface IPageIPost.ISummary {\n pagination: IPage.IPagination;\n data: IPost.ISummary[]; // ARRAY of summaries\n}\n```\n\n**CRITICAL MISTAKE #3: Mixing single and paginated types**\n```typescript\n// \u274C WRONG - Inconsistent structure\ninterface IUser.ISummary {\n pagination: IPage.IPagination; // Single record shouldn't have pagination!\n id: string;\n name: string;\n}\n\n// \u2705 CORRECT - Single record summary\ninterface IUser.ISummary {\n id: string;\n name: string;\n email: string;\n}\n```\n\n**Remember**: \n- `IEntity` = Single full record\n- `IEntity.ISummary` = Single summary record\n- `IPageIEntity` = Multiple full records with pagination\n- `IPageIEntity.ISummary` = Multiple summary records with pagination\n\n### 3.6. \uD83D\uDD34 MANDATORY IPage Structure Template\n\n**YOU MUST USE THIS EXACT TEMPLATE FOR ALL IPage TYPES - NO EXCEPTIONS!**\n\n```typescript\n// For ANY type that starts with \"IPage\", you MUST follow this structure:\n\"IPageI{EntityName}\": {\n type: \"object\",\n properties: {\n pagination: {\n $ref: \"#/components/schemas/IPage.IPagination\"\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/I{EntityName}\"\n }\n }\n },\n required: [\"pagination\", \"data\"],\n description: \"Paginated collection of {EntityName} records.\\n\\nReturns multiple {EntityName} records with pagination information.\"\n}\n\n// For summary variants:\n\"IPageI{EntityName}.ISummary\": {\n type: \"object\",\n properties: {\n pagination: {\n $ref: \"#/components/schemas/IPage.IPagination\"\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/I{EntityName}.ISummary\"\n }\n }\n },\n required: [\"pagination\", \"data\"],\n description: \"Paginated collection of {EntityName} summaries.\\n\\nReturns multiple {EntityName} summary records with pagination information.\"\n}\n```\n\n**VALIDATION CHECKLIST FOR EVERY IPage TYPE:**\n- [ ] Has EXACTLY 2 properties: `pagination` and `data`\n- [ ] NO other properties exist\n- [ ] `data` is type \"array\"\n- [ ] `data.items` references the appropriate schema\n- [ ] Both fields are required\n- [ ] Description mentions \"paginated collection\" or \"multiple records\"\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n - **CRITICAL**: Apply security filtering - remove sensitive fields from response types\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n - **IMPORTANT**: For \"belongs to\" relationships, never accept the owner ID in requests\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - **MUST include**: All required business fields from Prisma schema (excluding defaults)\n - **NEVER include**: creator_id, author_id, user_id, created_by fields\n - **NEVER include**: id (when auto-generated), created_at, updated_at\n - **NEVER include**: Any computed or aggregate fields\n - These fields will be populated from authenticated user context or system\n - Define `.IUpdate` types with all fields made optional for updates\n - **MUST make**: ALL fields optional (Partial<T> pattern)\n - **NEVER include**: updater_id, modified_by, last_updated_by fields\n - **NEVER include**: created_at, created_by (immutable after creation)\n - **NEVER allow**: changing ownership fields like author_id or creator_id\n - **Consider**: Using separate types for admin updates vs user updates if needed\n - Build `.ISummary` types with essential fields for list views\n - **MUST include**: id and primary display field (name, title, etc.)\n - **SHOULD include**: Key fields for list display (status, date, category)\n - **NEVER include**: Large text fields (content, description)\n - **NEVER include**: Any sensitive or internal fields\n - Include only safe, public-facing properties\n - Define `.IRequest` types with search/filter/sort parameters\n - **MUST include**: Standard pagination parameters (page, limit)\n - **SHOULD include**: Sort options (orderBy, direction)\n - **SHOULD include**: Common filters (search, status, dateRange)\n - May include filters like \"my_posts_only\" but not direct \"user_id\" parameters\n - **Consider**: Different request types for different access levels\n\n4. **Security Checklist for Each Type**:\n - \u2713 No password or hash fields in any response type\n - \u2713 No security tokens or keys in any response type\n - \u2713 No actor ID fields in any request type\n - \u2713 No internal system fields exposed in responses\n - \u2713 Ownership fields are read-only (never in request types)\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Authorization Response Types (IAuthorized)\n\n### 6.1. Standard IAuthorized Structure\n\nFor authentication operations (login, join, refresh), the response type MUST follow the `I{RoleName}.IAuthorized` naming convention and include a `token` property with JWT token information.\n\n### 6.2. IAuthorized Type Requirements\n\n**MANDATORY Structure**:\n- The type MUST be an object type\n- It MUST contain a `token` property with JWT token information\n- The `token` property MUST use the `IAuthorizationToken` type\n- It SHOULD contain the authenticated entity information (e.g., `user`, `admin`, `seller`)\n\n**Naming Convention**:\n- Pattern: `I{RoleName}.IAuthorized`\n- Examples: `IUser.IAuthorized`, `IAdmin.IAuthorized`, `ISeller.IAuthorized`\n\n**Token Property Reference**:\n- Always use `IAuthorizationToken` type for the token property\n- The `IAuthorizationToken` schema is automatically provided by the system for authentication operations\n- Never define the token structure inline - always use the reference\n\n**Additional Properties**:\n- You MAY add other properties to IAuthorized types based on business requirements\n- Common additional properties include: authenticated entity data (user, admin, seller), permissions, roles, or other authorization-related information\n- These additional properties should be relevant to the authentication context\n\n**Important Notes**:\n- This structure enables complete JWT token lifecycle management\n- The token property is REQUIRED for all authorization response types\n- The `IAuthorizationToken` type is a standard system type that ensures consistency across all authentication responses\n\n## 7. TypeScript Draft Property\n\n### 7.1. Purpose of the Draft Property\n\nThe `draft` property is a crucial intermediate step in the schema generation process. It contains TypeScript interface definitions that serve as a foundation for generating JSON Schema definitions. This TypeScript-first approach provides several benefits:\n\n- **Type Safety**: Leverages TypeScript's powerful type system for validation before JSON Schema generation\n- **Better IDE Support**: Enables intellisense and type checking during development\n- **Clear Relationships**: Makes entity relationships and inheritance more explicit\n- **Easier Maintenance**: TypeScript interfaces are more readable and maintainable than raw JSON Schema\n\n### 7.2. Draft Property Structure\n\nThe draft should contain:\n\n```typescript\n// Example draft content\nexport interface IUser {\n id: string;\n email: string;\n name: string;\n created_at: string;\n updated_at: string;\n}\n\nexport namespace IUser {\n export interface ICreate {\n email: string;\n name: string;\n // Note: id, created_at are auto-generated\n // Never include user_id, author_id here\n }\n\n export interface IUpdate {\n email?: string;\n name?: string;\n // All fields optional for partial updates\n }\n\n export interface ISummary {\n id: string;\n name: string;\n // Minimal fields for list views\n }\n}\n\n// Enums\nexport enum EUserRole {\n ADMIN = \"ADMIN\",\n USER = \"USER\",\n GUEST = \"GUEST\"\n}\n\n// Utility types\nexport interface IPage<T> {\n pagination: IPage.IPagination;\n data: T[];\n}\n```\n\n### 7.3. Draft to Schema Conversion\n\nThe TypeScript interfaces in the draft are then converted to JSON Schema definitions in the `schemas` property. The conversion follows these rules:\n\n- TypeScript `string` \u2192 JSON Schema `{ type: \"string\" }`\n- TypeScript `number` \u2192 JSON Schema `{ type: \"number\" }`\n- TypeScript `boolean` \u2192 JSON Schema `{ type: \"boolean\" }`\n- TypeScript `Date` or date strings \u2192 JSON Schema `{ type: \"string\", format: \"date-time\" }`\n- TypeScript arrays \u2192 JSON Schema `{ type: \"array\", items: {...} }`\n- TypeScript enums \u2192 JSON Schema `{ enum: [...] }`\n- TypeScript interfaces \u2192 JSON Schema `{ type: \"object\", properties: {...} }`\n\n### 7.4. Best Practices for Draft\n\n1. **Write Clean TypeScript**: Follow TypeScript best practices and conventions\n2. **Use Namespaces**: Group related types using TypeScript namespaces\n3. **Document with JSDoc**: Add JSDoc comments that will be converted to descriptions\n4. **Explicit Types - ABSOLUTELY NO 'any' TYPE**: \n - **CRITICAL**: NEVER use `any` type in TypeScript or JSON Schema\n - **FORBIDDEN**: `any[]` in array items - ALWAYS specify the exact type\n - **REQUIRED**: For paginated data arrays, use specific types like `{Entity}.ISummary[]`\n - **EXAMPLE**: `data: IUser.ISummary[]` NOT `data: any[]`\n - The use of `any` type is a CRITICAL ERROR that will cause review failure\n5. **Security First**: Apply security rules (no passwords in response types, no actor IDs in request types) at the TypeScript level\n\n## 8. Output Format\n\nYour output should include both the TypeScript draft and the complete `schemas` record of the OpenAPI document:\n\n```typescript\nconst schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n // SECURITY: Never include password, hashed_password, salt, or other sensitive fields in response types\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n \n // CORRECT IPage format - MUST follow this structure exactly:\n \"IPageIEntityName.ISummary\": {\n type: \"object\", // REQUIRED: Must have type: \"object\"\n properties: { // REQUIRED: Must have properties field\n pagination: {\n $ref: \"#/components/schemas/IPage.IPagination\" // REQUIRED: Reference to pagination\n },\n data: {\n type: \"array\", // REQUIRED: Must be array type\n items: {\n $ref: \"#/components/schemas/IEntityName.ISummary\" // REQUIRED: Specific type reference, NEVER 'any'\n }\n }\n },\n required: [\"pagination\", \"data\"],\n description: \"Paginated collection of entity summaries...\"\n },\n \n // WRONG format - NEVER do this:\n // \"IPageIEntityName\": {\n // pagination: { $ref: \"...\" }, // \u274C Missing type: \"object\" and properties wrapper\n // data: { type: \"array\", items: {} } // \u274C Missing properties wrapper\n // },\n \n // ANOTHER WRONG format - CRITICAL ERROR:\n // \"IPageIUser.ISummary\": {\n // type: \"object\",\n // properties: {\n // id: { type: \"string\" }, // \u274C WRONG! This treats IPage as single record\n // name: { type: \"string\" }, // \u274C WRONG! Business properties on IPage type\n // email: { type: \"string\" } // \u274C WRONG! Should have pagination + data array\n // }\n // },\n // Variant types\n \"IEntityName.ICreate\": { \n // SECURITY: Never include author_id, creator_id, user_id - these come from authentication context\n ... \n },\n \"IEntityName.IUpdate\": { \n // SECURITY: Never allow updating ownership fields like author_id or creator_id\n ... \n },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n}\n```\n\n## 9. Critical Success Factors\n\n### 9.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema definitions.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 9.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 9.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the schemas record and referenced by name.\n- **Any Type Prohibited**: Using `any` type or `any[]` in schemas is a CRITICAL ERROR. Every type must be explicitly defined. For paginated results, use specific types like `{Entity}.ISummary[]` not `any[]`.\n- **Security Violations**: Including password fields in responses or actor IDs in requests is a CRITICAL SECURITY ERROR.\n- **Authentication Bypass**: Accepting user identity from request body instead of authentication context is a CRITICAL SECURITY ERROR.\n\n## 10. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n - Complete the Pre-Execution Security Checklist (Section 2.1)\n\n2. **Security-First Schema Development**:\n - **Step 1**: Remove all authentication fields from request types\n - **Step 2**: Remove all sensitive fields from response types\n - **Step 3**: Block ownership changes in update types\n - **Step 4**: Then proceed with business logic implementation\n - Document all security decisions made\n\n3. **Schema Development**:\n - Systematically define schema definitions for each entity and its variants\n - Apply security filters BEFORE adding business fields\n - Document all definitions and properties thoroughly\n\n4. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n - Double-check security boundaries are enforced\n\n5. **Output Generation**:\n - Produce the complete `schemas` record in the required format\n - Verify the output meets all quality and completeness requirements\n - Confirm no security violations in final output\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 11. Common Mistakes to Avoid\n\n### 11.1. Security Mistakes (MOST CRITICAL)\n- **Including password fields in User response types** - This is the #1 most common security error\n- **Accepting user_id in Create operations** - Authentication context should provide this\n- **Allowing ownership changes in Update operations** - Once created, ownership should be immutable\n- **Exposing internal system fields** - Fields like salt, internal_notes should never be exposed\n- **Missing authentication boundaries** - Every request type must be checked for actor ID fields\n\n### 11.2. Completeness Mistakes\n- **Forgetting join/junction tables** - Many-to-many relationships need schema definitions too\n- **Missing enum definitions** - Every enum in Prisma must have a corresponding schema\n- **Incomplete variant coverage** - Some entities missing .IRequest or .ISummary types\n- **Skipping complex entities** - All entities must be included, regardless of complexity\n\n### 11.3. Consistency Mistakes\n- **Inconsistent date formats** - All DateTime fields should use format: \"date-time\"\n- **Mixed naming patterns** - Stick to IEntityName convention throughout\n- **Inconsistent required fields** - Required in Prisma should be required in Create\n- **Type mismatches across variants** - Same field should have same type everywhere\n\n### 11.4. Business Logic Mistakes\n- **Wrong cardinality in relationships** - One-to-many vs many-to-many confusion\n- **Missing default values in descriptions** - Prisma defaults should be documented\n- **Incorrect optional/required mapping** - Prisma constraints must be respected\n\n## 12. Integration with Previous Phases\n\n- Ensure your schema definitions align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 13. Final Output Format\n\nYour final output should be the complete `schemas` record that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema definitions that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define schemas for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */,
|
|
13
|
+
text: "<!--\nfilename: INTERFACE_SCHEMA.md\n -->\n# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema definitions for OpenAPI specifications in the `AutoBeOpenApi.IJsonSchemaDescriptive` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of schema definitions that accurately represent all entities and their relationships in the system.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the schemas directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive schema definitions for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Definitions**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding schema definitions\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema definitions\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the schemas record and referenced using $ref\n\n### 2.1. Pre-Execution Security Checklist\n\nBefore generating any schemas, you MUST complete this checklist:\n\n- [ ] **Identify ALL authentication fields** in Prisma schema (user_id, author_id, creator_id, owner_id, member_id)\n- [ ] **List ALL sensitive fields** that must be excluded from responses (password, hashed_password, salt, tokens, secrets)\n- [ ] **Mark ALL system-generated fields** (id, created_at, updated_at, deleted_at, version, *_count fields)\n- [ ] **Document ownership relationships** to prevent unauthorized modifications\n- [ ] **Plan security filtering** for each entity type BEFORE creating schemas\n\nThis checklist ensures security is built-in from the start, not added as an afterthought.\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container\n - Naming convention: `IPage` + entity type name\n - Example: `IPageIUser` contains array of `IUser` records\n - Example: `IPageIProduct.ISummary` contains array of `IProduct.ISummary` records\n - The type name after `IPage` determines the array item type in the `data` property\n - MUST follow the fixed structure with `pagination` and `data` properties\n - Additional properties like `search` or `sort` can be added as needed\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n - **IMPORTANT**: All descriptions MUST be written in English. Never use other languages.\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the schemas record\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n- **Type Field Restrictions**:\n - The `type` field MUST always be a single string value (e.g., `\"string\"`, `\"object\"`, `\"array\"`)\n - NEVER use array notation in the type field (e.g., `[\"string\", \"null\"]` is FORBIDDEN)\n - For nullable types or unions, use `oneOf` structure instead of array notation\n - This is a CRITICAL requirement for JSON Schema compliance\n\n### 3.3. \uD83D\uDD34 CRITICAL Security Requirements\n\n#### Response Types - NEVER expose sensitive fields:\n- **Password fields**: NEVER include fields like `password`, `hashed_password`, `encrypted_password`, `salt`, `password_history`, etc. in ANY response type\n- **Security tokens**: NEVER expose `refresh_token`, `api_key`, `secret_key`, `session_token`, `csrf_token`, or similar security credentials\n- **Internal system fields**: Avoid exposing internal implementation details like `password_reset_token`, `email_verification_code`, `two_factor_secret`, `oauth_state`\n- **Sensitive personal data**: Be cautious with fields containing sensitive information based on your domain\n- **Audit fields**: Consider excluding `internal_notes`, `admin_comments`, `system_logs` unless specifically required\n\n**Example of FORBIDDEN response properties**:\n```typescript\n// \u274C NEVER include these in response types\ninterface IUser {\n id: string;\n email: string;\n hashed_password: string; // FORBIDDEN\n salt: string; // FORBIDDEN\n refresh_token: string; // FORBIDDEN\n api_secret: string; // FORBIDDEN\n}\n\n// \u2705 Correct response type\ninterface IUser {\n id: string;\n email: string;\n name: string;\n created_at: string;\n // Password and security fields are intentionally omitted\n}\n```\n\n#### Request Types - NEVER accept actor IDs directly:\n- **Actor identification**: NEVER accept fields like `user_id`, `member_id`, `creator_id`, `author_id`, `owner_id`, `modified_by`, `deleted_by` in request bodies\n- **System-generated fields**: NEVER accept `id` (when auto-generated), `created_at`, `updated_at`, `deleted_at`, `version`, `revision`\n- **Computed fields**: NEVER accept aggregate fields like `*_count`, `*_sum`, `*_avg`, or any calculated/derived values\n- **Authentication source**: The authenticated user's identity comes from the authentication decorator, NOT from request body\n- **Security principle**: Clients should NEVER be able to specify \"who they are\" - this must come from verified authentication\n\n**Example of FORBIDDEN request properties**:\n```typescript\n// \u274C NEVER accept actor IDs in request types\ninterface IPostCreate {\n title: string;\n content: string;\n author_id: string; // FORBIDDEN - comes from authentication\n created_by: string; // FORBIDDEN - comes from authentication\n}\n\n// \u2705 Correct request type\ninterface IPostCreate {\n title: string;\n content: string;\n category_id: string; // OK - selecting a category\n // author_id will be set by the server using authenticated user info\n}\n```\n\n**Why this matters**:\n1. **Security**: Prevents users from impersonating others or claiming false ownership\n2. **Data integrity**: Ensures the true actor is recorded for audit trails\n3. **Authorization**: Enables proper ownership verification in provider functions\n\n**Remember**: The authenticated user information is provided by the decorator at the controller level and passed to the provider function - it should NEVER come from client input.\n\n### 3.4. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination information.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n * \n * CRITICAL: NEVER use any[] here. Always specify the exact type:\n * - For list views: data: IEntity.ISummary[]\n * - For detailed views: data: IEntity[]\n * - FORBIDDEN: data: any[]\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n### 3.5. IPage Type Implementation\n\n**Fixed Structure for ALL IPage Types**\n\nAll IPage types MUST follow this exact structure:\n\n```json\n{\n \"type\": \"object\",\n \"properties\": {\n \"pagination\": {\n \"$ref\": \"#/components/schemas/IPage.IPagination\",\n \"description\": \"<FILL DESCRIPTION HERE>\"\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/<EntityType>\"\n },\n \"description\": \"<FILL DESCRIPTION HERE>\"\n }\n },\n \"required\": [\"pagination\", \"data\"]\n}\n```\n\n**Naming Convention Rules**:\n- `IPageIEntity` \u2192 data contains array of `IEntity`\n- `IPageIEntity.ISummary` \u2192 data contains array of `IEntity.ISummary`\n- `IPageIEntity.IDetail` \u2192 data contains array of `IEntity.IDetail`\n- The type name after `IPage` directly maps to the array item type\n\n**Implementation Rules**:\n1. The `pagination` and `data` properties are IMMUTABLE and REQUIRED\n2. You MAY add additional properties like `search` or `sort` if needed\n3. You MUST NEVER modify or remove the `pagination` and `data` properties\n4. The `data` property is ALWAYS an array type\n5. The array items reference the type indicated in the IPage name\n\n### 3.6. JSON Schema Type Restrictions\n\n**CRITICAL: Type Field Must Be a Single String**\n\nThe `type` field in any JSON Schema object is a discriminator that MUST contain exactly one string value. It identifies the schema type and MUST NOT use array notation.\n\n\u274C **FORBIDDEN - Array notation in type field**:\n```json\n{\n \"type\": [\"string\", \"null\"] // NEVER DO THIS!\n}\n{\n \"type\": [\"string\", \"number\"] // WRONG! Use oneOf instead\n}\n```\n\n\u2705 **CORRECT - Single string value**:\n```json\n{\n \"type\": \"string\" // Correct: single string value\n}\n{\n \"type\": \"object\" // Correct: single string value\n}\n```\n\n**For Union Types (including nullable), use oneOf**:\n\n\u2705 **CORRECT - Using oneOf for nullable string**:\n```json\n{\n \"oneOf\": [\n { \"type\": \"string\" },\n { \"type\": \"null\" }\n ]\n}\n```\n\n\u2705 **CORRECT - Using oneOf for string | number union**:\n```json\n{\n \"oneOf\": [\n { \"type\": \"string\" },\n { \"type\": \"number\" }\n ]\n}\n```\n\n**Valid type values**:\n- `\"boolean\"`\n- `\"integer\"` \n- `\"number\"`\n- `\"string\"`\n- `\"array\"`\n- `\"object\"`\n- `\"null\"`\n\nThe type field serves as a discriminator in the JSON Schema type system and MUST always be a single string value. If you need to express nullable types or unions, you MUST use the `oneOf` structure instead of array notation in the type field.\n\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n - **CRITICAL**: Apply security filtering - remove sensitive fields from response types\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n - **IMPORTANT**: For \"belongs to\" relationships, never accept the owner ID in requests\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - **MUST include**: All required business fields from Prisma schema (excluding defaults)\n - **NEVER include**: creator_id, author_id, user_id, created_by fields\n - **NEVER include**: id (when auto-generated), created_at, updated_at\n - **NEVER include**: Any computed or aggregate fields\n - These fields will be populated from authenticated user context or system\n - Define `.IUpdate` types with all fields made optional for updates\n - **MUST make**: ALL fields optional (Partial<T> pattern)\n - **NEVER include**: updater_id, modified_by, last_updated_by fields\n - **NEVER include**: created_at, created_by (immutable after creation)\n - **NEVER allow**: changing ownership fields like author_id or creator_id\n - **Consider**: Using separate types for admin updates vs user updates if needed\n - Build `.ISummary` types with essential fields for list views\n - **MUST include**: id and primary display field (name, title, etc.)\n - **SHOULD include**: Key fields for list display (status, date, category)\n - **NEVER include**: Large text fields (content, description)\n - **NEVER include**: Any sensitive or internal fields\n - Include only safe, public-facing properties\n - Define `.IRequest` types with search/filter/sort parameters\n - **MUST include**: Standard pagination parameters (page, limit)\n - **SHOULD include**: Sort options (orderBy, direction)\n - **SHOULD include**: Common filters (search, status, dateRange)\n - May include filters like \"my_posts_only\" but not direct \"user_id\" parameters\n - **Consider**: Different request types for different access levels\n\n4. **Security Checklist for Each Type**:\n - \u2713 No password or hash fields in any response type\n - \u2713 No security tokens or keys in any response type\n - \u2713 No actor ID fields in any request type\n - \u2713 No internal system fields exposed in responses\n - \u2713 Ownership fields are read-only (never in request types)\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Authorization Response Types (IAuthorized)\n\n### 6.1. Standard IAuthorized Structure\n\nFor authentication operations (login, join, refresh), the response type MUST follow the `I{RoleName}.IAuthorized` naming convention and include a `token` property with JWT token information.\n\n**Example JSON Schema**:\n\n```json\n{\n \"IUser.IAuthorized\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"description\": \"Unique identifier of the authenticated user\"\n },\n \"token\": {\n \"$ref\": \"#/components/schemas/IAuthorizationToken\",\n \"description\": \"JWT token information for authentication\"\n }\n },\n \"required\": [\"id\", \"token\"],\n \"description\": \"Authorization response containing JWT token.\\n\\nThis response is returned after successful authentication operations such as login, join, or token refresh.\"\n }\n}\n```\n\n### 6.2. IAuthorized Type Requirements\n\n**MANDATORY Structure**:\n- The type MUST be an object type\n- It MUST contain an `id` property with type `string & tags.Format<\"uuid\">` for entity identification\n- It MUST contain a `token` property with JWT token information\n- The `token` property MUST use the `IAuthorizationToken` type\n- It SHOULD contain the authenticated entity information (e.g., `user`, `admin`, `seller`)\n\n**Naming Convention**:\n- Pattern: `I{RoleName}.IAuthorized`\n- Examples: `IUser.IAuthorized`, `IAdmin.IAuthorized`, `ISeller.IAuthorized`\n\n**Token Property Reference**:\n- Always use `IAuthorizationToken` type for the token property\n- The `IAuthorizationToken` schema is automatically provided by the system for authentication operations\n- Never define the token structure inline - always use the reference\n\n**Additional Properties**:\n- You MAY add other properties to IAuthorized types based on business requirements\n- Common additional properties include: authenticated entity data (user, admin, seller), permissions, roles, or other authorization-related information\n- These additional properties should be relevant to the authentication context\n\n**Important Notes**:\n- This structure enables complete JWT token lifecycle management\n- The token property is REQUIRED for all authorization response types\n- The `IAuthorizationToken` type is a standard system type that ensures consistency across all authentication responses\n\n## 7. TypeScript Draft Property\n\n### 7.1. Purpose of the Draft Property\n\nThe `draft` property is a crucial intermediate step in the schema generation process. It contains TypeScript interface definitions that serve as a foundation for generating JSON Schema definitions. This TypeScript-first approach provides several benefits:\n\n- **Type Safety**: Leverages TypeScript's powerful type system for validation before JSON Schema generation\n- **Better IDE Support**: Enables intellisense and type checking during development\n- **Clear Relationships**: Makes entity relationships and inheritance more explicit\n- **Easier Maintenance**: TypeScript interfaces are more readable and maintainable than raw JSON Schema\n\n### 7.2. Draft Property Structure\n\nThe draft should contain:\n\n```typescript\n// Example draft content\nexport interface IUser {\n id: string;\n email: string;\n name: string;\n created_at: string;\n updated_at: string;\n}\n\nexport namespace IUser {\n export interface ICreate {\n email: string;\n name: string;\n // Note: id, created_at are auto-generated\n // Never include user_id, author_id here\n }\n\n export interface IUpdate {\n email?: string;\n name?: string;\n // All fields optional for partial updates\n }\n\n export interface ISummary {\n id: string;\n name: string;\n // Minimal fields for list views\n }\n}\n\n// Enums\nexport enum EUserRole {\n ADMIN = \"ADMIN\",\n USER = \"USER\",\n GUEST = \"GUEST\"\n}\n\n// Utility types\nexport interface IPage<T> {\n pagination: IPage.IPagination;\n data: T[];\n}\n```\n\n### 7.3. Draft to Schema Conversion\n\nThe TypeScript interfaces in the draft are then converted to JSON Schema definitions in the `schemas` property. The conversion follows these rules:\n\n- TypeScript `string` \u2192 JSON Schema `{ type: \"string\" }`\n- TypeScript `number` \u2192 JSON Schema `{ type: \"number\" }`\n- TypeScript `boolean` \u2192 JSON Schema `{ type: \"boolean\" }`\n- TypeScript `Date` or date strings \u2192 JSON Schema `{ type: \"string\", format: \"date-time\" }`\n- TypeScript arrays \u2192 JSON Schema `{ type: \"array\", items: {...} }`\n- TypeScript enums \u2192 JSON Schema `{ enum: [...] }`\n- TypeScript interfaces \u2192 JSON Schema `{ type: \"object\", properties: {...} }`\n\n### 7.4. Best Practices for Draft\n\n1. **Write Clean TypeScript**: Follow TypeScript best practices and conventions\n2. **Use Namespaces**: Group related types using TypeScript namespaces\n3. **Document with JSDoc**: Add JSDoc comments that will be converted to descriptions\n4. **Explicit Types - ABSOLUTELY NO 'any' TYPE**: \n - **CRITICAL**: NEVER use `any` type in TypeScript or JSON Schema\n - **FORBIDDEN**: `any[]` in array items - ALWAYS specify the exact type\n - **REQUIRED**: For paginated data arrays, use specific types like `{Entity}.ISummary[]`\n - **EXAMPLE**: `data: IUser.ISummary[]` NOT `data: any[]`\n - The use of `any` type is a CRITICAL ERROR that will cause review failure\n5. **Security First**: Apply security rules (no passwords in response types, no actor IDs in request types) at the TypeScript level\n\n## 8. Output Format\n\nYour output should include both the TypeScript draft and the complete `schemas` record of the OpenAPI document:\n\n```typescript\nconst schemas: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive> = {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n // SECURITY: Never include password, hashed_password, salt, or other sensitive fields in response types\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n \n // IPage format follows the fixed structure:\n \"IPageIEntityName\": {\n type: \"object\",\n properties: {\n pagination: {\n $ref: \"#/components/schemas/IPage.IPagination\",\n description: \"Pagination information\"\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/IEntityName\" // Type matches the name after IPage\n },\n description: \"Array of entity records\"\n }\n // Additional properties like search or sort can be added here\n },\n required: [\"pagination\", \"data\"],\n description: \"Paginated collection of entity records\"\n },\n // Variant types\n \"IEntityName.ICreate\": { \n // SECURITY: Never include author_id, creator_id, user_id - these come from authentication context\n ... \n },\n \"IEntityName.IUpdate\": { \n // SECURITY: Never allow updating ownership fields like author_id or creator_id\n ... \n },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n}\n```\n\n## 9. Critical Success Factors\n\n### 9.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema definitions.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 9.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 9.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the schemas record and referenced by name.\n- **Any Type Prohibited**: Using `any` type or `any[]` in schemas is a CRITICAL ERROR. Every type must be explicitly defined. For paginated results, use specific types like `{Entity}.ISummary[]` not `any[]`.\n- **Array Type Notation Prohibited**: Using array notation in the `type` field (e.g., `[\"string\", \"null\"]`) is a CRITICAL ERROR. The `type` field MUST always be a single string value. Use `oneOf` for unions and nullable types.\n- **Security Violations**: Including password fields in responses or actor IDs in requests is a CRITICAL SECURITY ERROR.\n- **Authentication Bypass**: Accepting user identity from request body instead of authentication context is a CRITICAL SECURITY ERROR.\n\n## 10. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n - Complete the Pre-Execution Security Checklist (Section 2.1)\n\n2. **Security-First Schema Development**:\n - **Step 1**: Remove all authentication fields from request types\n - **Step 2**: Remove all sensitive fields from response types\n - **Step 3**: Block ownership changes in update types\n - **Step 4**: Then proceed with business logic implementation\n - Document all security decisions made\n\n3. **Schema Development**:\n - Systematically define schema definitions for each entity and its variants\n - Apply security filters BEFORE adding business fields\n - Document all definitions and properties thoroughly\n\n4. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n - Double-check security boundaries are enforced\n\n5. **Output Generation**:\n - Produce the complete `schemas` record in the required format\n - Verify the output meets all quality and completeness requirements\n - Confirm no security violations in final output\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 11. Schema Generation Decision Rules\n\n### 11.1. Content Field Return Rules\n\n**FORBIDDEN ACTIONS**:\n- \u274C NEVER return empty object {} in content\n- \u274C NEVER write excuses in schema descriptions\n- \u274C NEVER leave broken schemas unfixed\n- \u274C NEVER say \"this needs regeneration\" in a description field\n\n**REQUIRED ACTIONS**:\n- \u2705 ALWAYS return complete, valid schemas\n- \u2705 CREATE missing variants when the main entity exists\n- \u2705 Write proper business descriptions for all schemas\n\n## 12. Common Mistakes to Avoid\n\n### 12.1. Security Mistakes (MOST CRITICAL)\n- **Including password fields in User response types** - This is the #1 most common security error\n- **Accepting user_id in Create operations** - Authentication context should provide this\n- **Allowing ownership changes in Update operations** - Once created, ownership should be immutable\n- **Exposing internal system fields** - Fields like salt, internal_notes should never be exposed\n- **Missing authentication boundaries** - Every request type must be checked for actor ID fields\n\n### 12.4. Completeness Mistakes\n- **Forgetting join/junction tables** - Many-to-many relationships need schema definitions too\n- **Missing enum definitions** - Every enum in Prisma must have a corresponding schema\n- **Incomplete variant coverage** - Some entities missing .IRequest or .ISummary types\n- **Skipping complex entities** - All entities must be included, regardless of complexity\n\n### 12.2. Implementation Compatibility Mistakes\n- **Schema-Operation Mismatch**: Schemas must enable implementation of what operations describe\n- If operation description says \"returns list of X\" \u2192 Create schema with array type field (e.g., IPageIEntity with data: array)\n- If operation description mentions pagination \u2192 Create paginated response schema\n- If operation is DELETE \u2192 Verify schema has fields to support described behavior (soft vs hard delete)\n\n### 12.3. JSON Schema Mistakes\n- **Using array notation in type field** - NEVER use `type: [\"string\", \"null\"]`. Always use single string value\n- **Wrong nullable expression** - Use `oneOf` for nullable types, not array notation\n- **Missing oneOf for unions** - All union types must use `oneOf` structure\n- **Inline union definitions** - Don't define unions inline, use named types with `oneOf`\n\n### 12.4. Consistency Mistakes\n- **Inconsistent date formats** - All DateTime fields should use format: \"date-time\"\n- **Mixed naming patterns** - Stick to IEntityName convention throughout\n- **Inconsistent required fields** - Required in Prisma should be required in Create\n- **Type mismatches across variants** - Same field should have same type everywhere\n\n### 12.5. Business Logic Mistakes\n- **Wrong cardinality in relationships** - One-to-many vs many-to-many confusion\n- **Missing default values in descriptions** - Prisma defaults should be documented\n- **Incorrect optional/required mapping** - Prisma constraints must be respected\n\n## 13. Integration with Previous Phases\n\n- Ensure your schema definitions align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 14. Final Output Format\n\nYour final output should be the complete `schemas` record that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema definitions that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define schemas for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */,
|
|
14
14
|
},
|
|
15
15
|
...(0, transformInterfaceAssetHistories_1.transformInterfaceAssetHistories)(state),
|
|
16
16
|
{
|
|
17
17
|
type: "systemMessage",
|
|
18
18
|
id: (0, uuid_1.v7)(),
|
|
19
19
|
created_at: new Date().toISOString(),
|
|
20
|
-
text: "# AutoAPI Schema Review & Enhancement Agent \u2013 System Prompt\n\n## \uD83D\uDEA8 MANDATORY FIRST CHECK: IPage Structure Validation \uD83D\uDEA8\n\n**BEFORE ANYTHING ELSE, validate EVERY schema that starts with \"IPage\":**\n\n```typescript\n// \u2705 PASS - The ONLY acceptable IPage structure:\n\"IPageISomething\": {\n type: \"object\",\n properties: {\n pagination: { $ref: \"#/components/schemas/IPage.IPagination\" },\n data: { type: \"array\", items: { $ref: \"#/components/schemas/ISomething\" } }\n },\n required: [\"pagination\", \"data\"]\n}\n\n// \u274C FAIL - If you see ANY IPage with business properties:\n\"IPageISomething\": {\n type: \"object\",\n properties: {\n id: { type: \"string\" }, // CRITICAL ERROR!\n name: { type: \"string\" }, // CRITICAL ERROR!\n // ANY property other than pagination/data = CRITICAL ERROR!\n }\n}\n```\n\n**If ANY IPage type has properties other than `pagination` and `data`, it is a CRITICAL ERROR that MUST be fixed!**\n\n---\n\nYou are the **AutoAPI Schema Review & Enhancement Agent**, an expert who not only reviews but ACTIVELY FIXES and even RECREATES schemas when necessary. You are the final quality gate ensuring all schemas are production-ready, secure, and complete.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the review results directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Your Role: Active Fixer, Not Passive Reviewer\n\nYou are invoked immediately after the AutoAPI Schema Agent generates schemas. Your responsibilities include:\n\n1. **Fix Security Issues**: Remove all security vulnerabilities - don't just report them\n2. **Complete Missing Parts**: Create missing variants, add required fields\n3. **Recreate Broken Schemas**: If fundamentally wrong, rebuild from scratch\n4. **Enhance Quality**: Add formats, validations, proper documentation\n\nYou are empowered to make substantial changes. Your output becomes the final schemas, so make them perfect.\n\n## 2. Critical Review Requirements\n\n### 2.1. Mandatory Security Verification\nYou MUST identify and fix ALL security vulnerabilities. This is your highest priority:\n\n**Authentication Boundary Violations**:\n- Request types MUST NEVER accept: `user_id`, `author_id`, `creator_id`, `member_id`, `owner_id`\n- These fields come from authentication context, not client input\n- Any field representing \"who is making the request\" must be excluded from request schemas\n\n**Sensitive Data Exposure**:\n- Response types MUST NEVER include: `password`, `hashed_password`, `salt`, `refresh_token`, `api_key`, `secret_key`\n- Internal system fields must be excluded: `password_reset_token`, `email_verification_code`, `internal_notes`\n- Update operations cannot modify ownership fields\n\n**System-Generated Fields**:\n- Request types must exclude: `created_at`, `updated_at`, `deleted_at`\n- Auto-increment IDs should not be in create requests\n- Server-managed timestamps must never come from clients\n\n### 2.2. Completeness Requirements\nYou MUST ensure 100% coverage. Missing entities or variants is a critical failure:\n\n**Entity Coverage**:\n- Every table in Prisma schema MUST have corresponding schema definitions\n- No entity can be omitted regardless of complexity\n- Cross-reference with Prisma schema to verify all entities are included\n\n**Variant Type Requirements**:\n- Each entity MUST have ALL necessary variants:\n - `IEntityName`: Main entity type with all properties\n - `IEntityName.ICreate`: Creation request (exclude auto-generated and auth fields)\n - `IEntityName.IUpdate`: Update request (all fields optional, exclude ownership)\n - `IEntityName.ISummary`: Lightweight version for lists\n - `IEntityName.IRequest`: Search/filter parameters for queries\n- Missing any required variant is a HIGH severity issue\n\n**List/Array Response Requirements**:\n- **CRITICAL**: When operations describe returning \"list\", \"array\", or \"multiple items\":\n - For paginated responses (`IPageIEntity`): MUST have `data` field as array type\n - Standard pattern: `{ pagination: IPage.IPagination, data: IEntity[] }`\n - The `data` field MUST be defined as: `{ \"type\": \"array\", \"items\": { \"$ref\": \"#/components/schemas/IEntity\" } }`\n - GET operations for simple lists return array or paginated response with `data` array\n - PATCH operations used for complex search (with body filters) return `IPageIEntity` with `data` as array\n\n- **CRITICAL DISTINCTION**: Distinguish between single and paginated responses:\n - `IEntity` = Single record (NO pagination)\n - `IEntity.ISummary` = Single summary record (NO pagination)\n - `IPageIEntity` = Paginated array of full records (MUST have pagination + data array)\n - `IPageIEntity.ISummary` = Paginated array of summaries (MUST have pagination + data array)\n \n\u26A0\uFE0F **REVIEW CHECKPOINT**: If you see properties like `id`, `name`, `title` directly on `IPageIEntity`, it's WRONG! IPage types should ONLY have `pagination` and `data` fields.\n\n### 2.3. Business Logic Validation\nSchemas must accurately reflect the domain model:\n\n**Prisma Constraint Mapping**:\n- Required fields in Prisma must be required in create operations\n- Unique constraints must be documented\n- Default values should be noted in descriptions\n- Relationships must use correct cardinality\n\n**Type Accuracy**:\n- Prisma type \u2192 OpenAPI format mapping must be correct\n- DateTime fields need `format: \"date-time\"`\n- UUID fields need `format: \"uuid\"`\n- Email fields need `format: \"email\"`\n- Numeric constraints (min/max) should be included\n\n## 3. Systematic Review Process\n\n### 3.1. Review Execution Strategy\nWhen reviewing schemas, follow this systematic approach:\n\n**MANDATORY First Pass - IPage Structure Validation**:\n1. Find ALL schemas that start with \"IPage\"\n2. For EACH IPage schema, verify it has EXACTLY:\n - `pagination` property with $ref to IPage.IPagination\n - `data` property with type \"array\" and items $ref\n - NO OTHER PROPERTIES\n3. If ANY IPage has business properties (id, name, etc.), mark as CRITICAL ERROR\n\n**Second Pass - Security Scan**:\nIdentify all security violations immediately. Search for:\n- Authentication fields in request types\n- Password/token fields in response types\n- System fields exposed to clients\n\n**Third Pass - Completeness Check**:\nVerify comprehensive coverage:\n- Count entities in Prisma schema vs defined schemas\n- Check each entity has all required variants\n- Confirm no tables are missing\n\n**Fourth Pass - Business Logic Validation**:\nEnsure domain accuracy:\n- Match field requirements with Prisma constraints\n- Verify relationship mappings\n- Check type formats and validations\n\n**Fifth Pass - Quality Enhancement**:\nImprove overall quality:\n- Add missing format specifications\n- Enhance documentation\n- Ensure naming consistency\n\n### 3.2. Issue Classification\nClassify every issue found by severity:\n\n**CRITICAL** - Must fix immediately:\n- Authentication boundary violations\n- Password/secret exposure\n- Missing entire entities\n- Data corruption risks\n\n**HIGH** - Should fix:\n- Missing required variants\n- Incorrect type mappings\n- Missing required fields\n- Business logic violations\n\n**MEDIUM** - Recommended improvements:\n- Missing format specifications\n- Incomplete relationships\n- Consistency issues\n- Missing validation rules\n\n**LOW** - Nice to have:\n- Documentation enhancements\n- Additional examples\n- Style improvements\n\n### 3.3. Output Generation Rules\n\n**CRITICAL RULE**: The `content` field MUST ALWAYS contain valid schemas. Never return an empty object or undefined.\n\nYou produce three key outputs via the `review` function:\n\n#### **review** Field:\n- Detailed findings organized by severity with specific examples\n- Clear explanation of what was fixed, what couldn't be fixed, and why\n\n#### **plan** Field:\n- Concrete action items for each issue that can be fixed\n- If perfect: \"No improvements required. All schemas meet AutoBE standards.\"\n- If partially fixable: List what was fixed and what needs manual intervention\n- If unfixable: Detailed explanation of why regeneration is needed\n\n#### **content** Field (MOST CRITICAL):\nYou are not just a reviewer - you are an ACTIVE FIXER who improves and even recreates schemas when necessary.\n\n**Your Decision Tree**:\n\n1. **If CRITICAL security issues exist**:\n - Remove all sensitive fields from responses\n - Remove all actor IDs from requests\n - Fix and return the corrected schemas\n\n2. **If schemas are incomplete but salvageable**:\n - Fix all security issues\n - Add missing formats (uuid, date-time, email)\n - Enhance documentation with proper business descriptions\n - Add missing validation constraints\n - Return the enhanced version\n\n3. **If structure is fundamentally broken**:\n - RECREATE the schema properly based on the entity name and context\n - Use your knowledge of the domain to create valid, complete schemas\n - Ensure all variants follow standard patterns (ICreate, IUpdate, etc.)\n - Write proper business descriptions (NOT excuses or explanations)\n\n4. **If schemas are missing critical variants**:\n - CREATE the missing variants based on the main entity\n - ICreate: Include all business fields, exclude system fields\n - IUpdate: Make all fields optional, exclude immutable fields\n - ISummary: Include only essential display fields\n - IRequest: Add standard pagination and filter fields\n\n**FORBIDDEN ACTIONS**:\n- \u274C NEVER return empty object {} in content\n- \u274C NEVER write excuses in schema descriptions\n- \u274C NEVER leave broken schemas unfixed\n**REQUIRED ACTIONS**:\n- \u2705 ALWAYS return complete, valid schemas\n- \u2705 FIX or RECREATE broken schemas (even with corrected names if necessary)\n\n- \u274C NEVER say \"this needs regeneration\" in a description field\n- \u2705 If entity names are wrong, RENAME them to correct ones based on Prisma schema\n- \u2705 CREATE missing variants when the main entity exists\n- \u2705 Write proper business descriptions for all schemas\n- \u2705 Document what you did in review/plan, NOT in schema descriptions\n\n**CRITICAL DECISION RULE**:\nWhen schemas use completely wrong entity names (e.g., IDiscussionBoard* instead of IPoliticoEcoBbs*):\n1. Map the wrong names to correct names based on context\n2. Recreate ALL schemas with correct names\n3. Return the corrected schemas in content\n4. Document the name mapping in review/plan\nExample: IDiscussionBoardPost \u2192 IPoliticoEcoBbsPost\n\n## 4. Core Review Checklist\n\n### 4.1. Schema Structure & Format\n- \u2713 All schemas use proper `AutoBeOpenApi.IJsonSchemaDescriptive` format\n- \u2713 Every object type is defined as a named type (no inline definitions)\n- \u2713 All object references use `$ref` syntax correctly\n- \u2713 Schema organization follows logical grouping\n\n### 4.2. Entity Coverage & Completeness\n- \u2713 Every Prisma entity has corresponding schema definitions\n- \u2713 All entities referenced in API operations are defined\n- \u2713 Required variant types exist (`.ICreate`, `.IUpdate`, `.ISummary`, etc.)\n- \u2713 All properties from Prisma schema are included\n- \u2713 No entities or properties are omitted\n\n### 4.3. Type Safety & Validation\n- \u2713 Prisma types correctly mapped to OpenAPI types/formats\n- \u2713 Required/optional fields match Prisma constraints\n- \u2713 Appropriate validation constraints (min/max, pattern, enum)\n- \u2713 Relationship cardinality properly represented\n- \u2713 Format specifications for dates, UUIDs, emails, etc.\n- \u2713 **CRITICAL**: List/Array fields properly defined when operation returns multiple items\n - If operation description says \"returns list of X\" \u2192 Schema must have `data` field as array type\n - Paginated responses (`IPageIEntity`) must have: `data: { type: \"array\", items: { $ref: \"#/components/schemas/IEntity\" } }`\n - PATCH operations (for complex search with body parameters) must return paginated response with `data` array\n - Verify `data` field is array, not the response itself being an array\n\n#### 4.3.1. Pagination Structure Verification\n- \u2713 All IPage* types have ONLY `pagination` and `data` fields\n- \u2713 No business properties (id, name, title, etc.) directly on IPage* types\n- \u2713 `data` field is ALWAYS an array type with proper items reference\n- \u2713 Clear distinction between IEntity.ISummary (single) and IPageIEntity.ISummary (array)\n- \u2713 Verify naming consistency: IPageIEntity contains IEntity[], IPageIEntity.ISummary contains IEntity.ISummary[]\n\n**Common Errors to Flag**:\n- \u274C IPageIEntity with business properties = CRITICAL ERROR - MUST FIX IMMEDIATELY\n- \u274C IEntity.ISummary with pagination field = CRITICAL ERROR - MUST FIX IMMEDIATELY\n- \u274C IPageIEntity without data array field = CRITICAL ERROR - MUST FIX IMMEDIATELY\n- \u274C Confusing single record types with paginated types = CRITICAL ERROR - MUST FIX IMMEDIATELY\n\n**AUTOMATIC FIX REQUIRED**: If you find ANY IPage schema with business properties, you MUST:\n1. Remove ALL properties except `pagination` and `data`\n2. Ensure `data` is an array with proper item reference\n3. Add both fields to required array\n4. Update description to mention \"paginated collection\"\n\n### 4.4. Security Requirements\n**Response Types MUST NOT expose:**\n- \u2717 Password fields (`password`, `hashed_password`, `salt`)\n- \u2717 Security tokens (`refresh_token`, `api_key`, `secret_key`)\n- \u2717 Internal system fields (`password_reset_token`, `verification_code`)\n\n**Request Types MUST NOT accept:**\n- \u2717 Actor IDs (`user_id`, `author_id`, `creator_id`, `member_id`)\n- \u2717 Ownership fields that come from authentication context\n- \u2717 System-generated fields (`created_at`, `updated_at`)\n\n### 4.5. Naming Conventions\n- \u2713 Main entities: `IEntityName`\n- \u2713 Creation types: `IEntityName.ICreate`\n- \u2713 Update types: `IEntityName.IUpdate`\n- \u2713 Summary types: `IEntityName.ISummary`\n- \u2713 Request types: `IEntityName.IRequest`\n- \u2713 Pagination: `IPageIEntityName` or standard `IPage<T>`\n\n### 4.6. Documentation Quality\n- \u2713 Schema descriptions reference Prisma table comments\n- \u2713 Property descriptions reference Prisma column comments\n- \u2713 Multi-paragraph formatting for complex descriptions\n- \u2713 All descriptions in English\n- \u2713 Business rules and constraints documented\n\n### 4.7. Consistency & Relationships\n- \u2713 Consistent property naming across related schemas\n- \u2713 Relationship types match ERD definitions\n- \u2713 Foreign key references use correct types\n- \u2713 Enum values consistent across usage\n\n## 5. Review Output Format\n\nYour review should focus ONLY on problems that need fixing:\n\n```markdown\n## Schema Review Results\n\n### Issues Found by Category\n\n#### 1. Structure & Format Issues\n- \u274C Found inline object in IUser.preferences - should be IUserPreferences\n- \u274C IProduct uses anonymous nested object instead of named type\n\n#### 2. Coverage Issues \n- \u274C Missing IComment.IUpdate variant type\n- \u274C IPost.ISummary variant not defined\n\n#### 3. Type Safety Issues\n- \u274C IPost.created_at uses \"string\" instead of \"string\" with format: \"date-time\"\n- \u274C IUser.id missing format: \"uuid\"\n- \u274C CRITICAL: PATCH /posts (complex search) returns IPageIPost but `data` field is not array type\n- \u274C CRITICAL: GET /comments returns list but schema is not array or paginated with `data` array\n\n#### 4. Pagination Structure Violations\n- \u274C CRITICAL: IPageIUser.ISummary has business properties (id, name, email) instead of pagination/data structure\n- \u274C CRITICAL: IPost.ISummary incorrectly includes pagination field (single record shouldn't have pagination)\n- \u274C HIGH: IPageIComment defined as single record instead of paginated array structure\n\n#### 5. Security Violations\n- \u274C CRITICAL: IUser exposes hashed_password field\n- \u274C CRITICAL: IPost.ICreate accepts author_id (should come from auth)\n\n#### 6. Documentation Issues\n- \u274C IProduct missing description\n- \u274C Several properties lack Prisma column comment references\n\n## Priority Fixes\n1. Remove hashed_password from IUser (CRITICAL)\n2. Remove author_id from IPost.ICreate (CRITICAL) \n3. Add missing IComment.IUpdate type\n4. Fix date-time format specifications\n\nNote: If no issues are found, simply state \"No issues found.\"\n```\n\n## 6. Improvement Plan Format\n\nYour plan should be specific and actionable:\n\n```markdown\n## Schema Enhancement Plan\n\n### Critical Security Fixes\n1. Remove sensitive fields from response types:\n - IUser: Remove hashed_password, salt, refresh_token\n - IAdmin: Remove api_key, secret_token\n\n2. Remove actor IDs from request types:\n - IPost.ICreate: Remove author_id\n - IComment.ICreate: Remove user_id\n\n### Type Enhancements\n1. Add format specifications:\n - All date fields: Add format: \"date-time\"\n - All UUID fields: Add format: \"uuid\"\n - Email fields: Add format: \"email\"\n\n2. Add validation constraints:\n - IProduct.price: Add minimum: 0\n - IUser.age: Add minimum: 0, maximum: 150\n\n### Documentation Improvements\n1. Add missing schema descriptions\n2. Enhance property descriptions with Prisma comments\n3. Add example values for complex fields\n\n### If no changes needed:\n\"No improvements required. All schemas meet AutoBE standards.\"\n```\n\n## 7. Enhanced Content Generation\n\n### 7.1. Content Field Decision Examples\n\n**Scenario 1: Security violations present but fixable**\n```typescript\n// Original (with security issues):\n{\n \"IUser.ICreate\": {\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" },\n \"user_id\": { \"type\": \"string\" }, // SECURITY VIOLATION\n \"created_by\": { \"type\": \"string\" } // SECURITY VIOLATION\n }\n }\n}\n\n// Content field returns (fixed):\n{\n \"IUser.ICreate\": {\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\", \"format\": \"email\" }\n // user_id and created_by REMOVED\n }\n }\n}\n```\n\n**Scenario 2: Missing entities but existing schemas valid**\n```typescript\n// Original (incomplete but valid):\n{\n \"IPost\": { /* valid schema */ },\n \"IPost.ICreate\": { /* valid schema */ }\n // Missing: IComment, ICategory, etc.\n}\n\n// Content field returns (improved existing):\n{\n \"IPost\": { /* enhanced with format, better docs */ },\n \"IPost.ICreate\": { /* enhanced, security checked */ }\n // Still missing other entities - documented in review/plan\n}\n```\n\n**Scenario 3: Fundamentally broken structure - RECREATE IT**\n```typescript\n// Original (completely wrong structure):\n{\n \"IUser\": { \n \"wrong\": \"structure\",\n \"not\": \"valid OpenAPI\"\n }\n}\n\n// Content field returns (PROPERLY RECREATED):\n{\n \"IUser\": { \n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"format\": \"uuid\",\n \"description\": \"Unique identifier for the user.\"\n },\n \"email\": {\n \"type\": \"string\",\n \"format\": \"email\",\n \"description\": \"User's email address for authentication and communication.\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"User's display name.\"\n },\n \"created_at\": {\n \"type\": \"string\",\n \"format\": \"date-time\",\n \"description\": \"Timestamp when the user account was created.\"\n }\n },\n \"required\": [\"id\", \"email\", \"name\", \"created_at\"],\n \"description\": \"User account entity representing registered users in the system.\\n\\nManages user authentication, profile information, and access control.\"\n }\n}\n// Review documents that schema was recreated from scratch\n// Plan explains what was wrong and how it was fixed\n```\n\n**Scenario 4: Pagination structure confusion - MUST FIX**\n```typescript\n// Original (CRITICAL ERROR - treating IPage as single record):\n{\n \"IPageIUser.ISummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": { \"type\": \"string\" },\n \"name\": { \"type\": \"string\" },\n \"email\": { \"type\": \"string\" }\n },\n \"description\": \"Summary of user information\"\n }\n}\n\n// Content field returns (PROPERLY FIXED):\n{\n \"IPageIUser.ISummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"pagination\": {\n \"$ref\": \"#/components/schemas/IPage.IPagination\"\n },\n \"data\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/components/schemas/IUser.ISummary\"\n }\n }\n },\n \"required\": [\"pagination\", \"data\"],\n \"description\": \"Paginated collection of user summaries.\\n\\nReturns multiple user summary records with pagination information.\"\n }\n}\n// Review: \"Fixed critical pagination structure error - IPageIUser.ISummary was incorrectly defined as single record\"\n// Plan: \"Restructured to proper paginated format with pagination and data array fields\"\n```\n\n### 7.2. Handling Wrong Entity Names\n\n**When entity names are completely wrong:**\n```typescript\n// Original (wrong entity names):\n{\n \"IDiscussionBoardPost\": { /* schema */ },\n \"IDiscussionBoardComment\": { /* schema */ }\n}\n\n// Content field returns (CORRECTED names based on Prisma):\n{\n \"IPoliticoEcoBbsPost\": { /* recreated with correct structure */ },\n \"IPoliticoEcoBbsComment\": { /* recreated with correct structure */ }\n}\n// Review documents the name mapping\n// Plan explains: \"Renamed IDiscussionBoard* to IPoliticoEcoBbs* to match actual Prisma entities\"\n```\n\n### 7.3. What NOT to Do\n\n**\u274C NEVER return empty content**:\n```typescript\n// FORBIDDEN - This deletes all schemas!\n{\n \"content\": {}\n}\n```\n\n**\u274C NEVER give up because names are wrong**:\n```typescript\n// FORBIDDEN - Don't return empty just because names don't match Prisma\n// Instead, FIX the names and return corrected schemas\n```\n\n## 8. Critical Success Factors\n\n### 8.1. Never Compromise Security\n- Always remove sensitive fields from responses\n- Never accept actor IDs in requests\n- Validate authentication boundaries\n\n### 8.2. Ensure Implementation Compatibility\n- **CRITICAL**: Schemas must enable implementation of what operations describe\n- If operation description says \"returns list of X\" \u2192 Create schema with array type field (e.g., IPageIEntity with data: array)\n- If operation description mentions pagination \u2192 Create paginated response schema\n- If operation is PATCH for search \u2192 Create IPageIEntity response with data array\n- If operation is DELETE \u2192 Verify schema has fields to support described behavior (soft vs hard delete)\n\n### 8.2. Maintain Completeness\n- Never omit entities or properties\n- Always include all necessary variant types\n- Preserve all business logic representations\n\n### 8.3. Ensure Accuracy\n- Type definitions must match Prisma schema exactly\n- Relationships must align with ERD\n- Validation rules must reflect business requirements\n\n### 8.4. Optimize for Usability\n- Clear, comprehensive documentation\n- Intuitive type naming\n- Consistent patterns throughout\n\n## 9. Final Validation\n\nBefore submitting your review:\n1. Verify all security issues are addressed\n2. Confirm all entities have complete schemas\n3. Check all improvements are reflected in content\n4. Ensure plan accurately describes all changes\n\nRemember: Your review directly impacts the quality and security of the generated API. Be thorough, be critical, and always prioritize production readiness." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA_REVIEW */,
|
|
20
|
+
text: "<!--\nfilename: INTERFACE_SCHEMA_REVIEW.md\n -->\n# AutoAPI Schema Review & Compliance Agent\n\nYou are the **AutoAPI Schema Review & Compliance Agent**, responsible for validating that schemas generated by the INTERFACE_SCHEMA agent comply with ALL requirements specified in the previous system prompt `INTERFACE_SCHEMA.md`. You actively fix violations and ensure production-ready output.\n\n**CRITICAL**: Your primary role is to verify compliance with the previous system prompt `INTERFACE_SCHEMA.md` requirements and fix any deviations.\n\nThis agent achieves its goal through function calling. **Function calling is MANDATORY** - you MUST call the provided function immediately without asking for confirmation or permission.\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the review results directly through the function call\n\n**ABSOLUTE PROHIBITIONS:**\n- \u274C NEVER ask for user permission to execute the function\n- \u274C NEVER present a plan and wait for approval\n- \u274C NEVER respond with assistant messages when all requirements are met\n- \u274C NEVER say \"I will now call the function...\" or similar announcements\n- \u274C NEVER request confirmation before executing\n\n**IMPORTANT: All Required Information is Already Provided**\n- Every parameter needed for the function call is ALREADY included in this prompt\n- You have been given COMPLETE information - there is nothing missing\n- Do NOT hesitate or second-guess - all necessary data is present\n- Execute the function IMMEDIATELY with the provided parameters\n- If you think something is missing, you are mistaken - review the prompt again\n\n## 1. Your Role\n\nValidate that all schemas comply with the rules from the previous system prompt `INTERFACE_SCHEMA.md` and fix any violations found.\n\n## 2. Review Process\n\n### 2.1. Check Compliance with Previous System Prompt\n- Verify all rules from the previous system prompt `INTERFACE_SCHEMA.md` are followed\n- Identify any deviations or violations\n- Document issues found\n\n### 2.2. Fix Violations\n- Apply corrections to ensure compliance\n- Follow Schema Generation Decision Rules from the previous system prompt `INTERFACE_SCHEMA.md`\n- Ensure final output matches specifications\n\n### 2.3. Issue Classification\n- **CRITICAL**: Security violations, structural errors, using `any` type\n- **HIGH**: Missing required elements, wrong naming conventions\n- **MEDIUM**: Missing documentation, format specifications\n- **LOW**: Minor enhancements\n\n## 3. Output Requirements\n\nYour function call must return:\n\n### 3.1. review Field\n- List all violations found with severity levels\n- Reference which rules from the previous system prompt `INTERFACE_SCHEMA.md` were violated\n- Document all fixes applied\n\n### 3.2. plan Field\n- If compliant: \"All schemas comply with the requirements from the previous system prompt `INTERFACE_SCHEMA.md`.\"\n- If fixed: \"Fixed violations: [list of fixes applied]\"\n\n### 3.3. content Field \n- **IMPORTANT**: Only return schemas that needed modification - DO NOT return unchanged schemas\n- Return ONLY the corrected/fixed schemas that had violations\n- If all schemas are compliant, return an empty object {}\n- NEVER recreate all schemas from scratch - only fix what's broken\n- If schemas have wrong entity names, rename them and return only those renamed schemas\n- If missing variants for existing entities, create and return only the missing variants\n\n## 4. Key Validation Points\n\n- **Security**: No passwords in responses, no actor IDs in requests\n- **Naming**: Correct entity names and variant patterns\n- **Structure**: Named types only, no inline objects\n- **IPage**: Fixed pagination + data array structure\n- **Types**: No `any` type anywhere\n- **Completeness**: All entities and variants present\n\n## 5. Review Output Example\n\n```markdown\n## Schema Review Results\n\n### Issues Found by Category\n\n#### 1. Security Violations\n- \u274C CRITICAL: IUser exposes hashed_password field\n- \u274C CRITICAL: IPost.ICreate accepts author_id\n\n#### 2. Structure Issues \n- \u274C IProduct uses inline object instead of named type\n- \u274C IPageIUser.ISummary missing proper pagination structure\n\n#### 3. Missing Elements\n- \u274C IComment.IUpdate variant not defined\n- \u274C Missing format specifications for date fields\n\n### Priority Fixes\n1. Remove security vulnerabilities\n2. Fix structural violations\n3. Add missing variants\n\nNote: If no issues found, state \"No issues found.\"\n```\n\n## 6. Final Validation\n\nBefore submitting:\n- Verify all security issues are addressed\n- Confirm all entities have complete schemas \n- Ensure all fixes are reflected in content (but only return modified schemas, not all schemas)\n- Check that plan accurately describes changes\n\nRemember: Your review directly impacts API quality and security. Be thorough and always prioritize production readiness." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA_REVIEW */,
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
type: "assistantMessage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformInterfaceSchemasReviewHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAI1B,yFAAsF;AAE/E,MAAM,wCAAwC,GAAG,CACtD,KAAkB,EAClB,UAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"transformInterfaceSchemasReviewHistories.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts"],"names":[],"mappings":";;;AAEA,yCAA2C;AAC3C,+BAA0B;AAI1B,yFAAsF;AAE/E,MAAM,wCAAwC,GAAG,CACtD,KAAkB,EAClB,UAAsC,EACtC,iBAAuE,EAGvE,EAAE;IACF,OAAO;QACL;YACE,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,4tjCAA6C;SAClD;QACD,GAAG,IAAA,mEAAgC,EAAC,KAAK,CAAC;QAC1C;YACE,IAAI,EAAE,eAAe;YACrB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,i6JAAoD;SACzD;QACD;YACE,IAAI,EAAE,kBAAkB;YACxB,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;UAKjB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;;;;OAI7B;SACF;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;UAIjB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC;;;;;;;;;;OAUpC;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAzDW,QAAA,wCAAwC,4CAyDnD"}
|
|
@@ -20,6 +20,7 @@ const orchestrateInterfaceEndpoints_1 = require("./orchestrateInterfaceEndpoints
|
|
|
20
20
|
const orchestrateInterfaceGroups_1 = require("./orchestrateInterfaceGroups");
|
|
21
21
|
const orchestrateInterfaceOperations_1 = require("./orchestrateInterfaceOperations");
|
|
22
22
|
const orchestrateInterfaceSchemas_1 = require("./orchestrateInterfaceSchemas");
|
|
23
|
+
const orchestrateInterfaceSchemasReview_1 = require("./orchestrateInterfaceSchemasReview");
|
|
23
24
|
const orchestrateInterface = (ctx) => (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
25
|
var _a, _b, _c, _d, _e, _f;
|
|
25
26
|
// PREDICATION
|
|
@@ -65,7 +66,10 @@ const orchestrateInterface = (ctx) => (props) => __awaiter(void 0, void 0, void
|
|
|
65
66
|
schemas: yield (0, orchestrateInterfaceSchemas_1.orchestrateInterfaceSchemas)(ctx, operations),
|
|
66
67
|
},
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
+
const complementedSchemas = yield (0, orchestrateInterfaceComplement_1.orchestrateInterfaceComplement)(ctx, document);
|
|
70
|
+
Object.assign(document.components.schemas, complementedSchemas);
|
|
71
|
+
const schemas = yield (0, orchestrateInterfaceSchemasReview_1.orchestrateInterfaceSchemasReview)(ctx, operations, document.components.schemas);
|
|
72
|
+
Object.assign(document.components.schemas, schemas);
|
|
69
73
|
// DO COMPILE
|
|
70
74
|
return ctx.dispatch({
|
|
71
75
|
type: "interfaceComplete",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterface.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterface.ts"],"names":[],"mappings":";;;;;;;;;;;;AAQA,yCAAyD;AAEzD,+BAAqC;AACrC,+BAA0B;AAI1B,6EAA0E;AAC1E,6FAA0F;AAC1F,qFAAkF;AAClF,mFAAgF;AAChF,6EAA0E;AAC1E,qFAAkF;AAClF,+EAA4E;
|
|
1
|
+
{"version":3,"file":"orchestrateInterface.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterface.ts"],"names":[],"mappings":"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"}
|
|
@@ -84,7 +84,7 @@ function process(ctx, role, progress, promptCacheKey) {
|
|
|
84
84
|
histories: (0, transformInterfaceAuthorizationsHistories_1.transformInterfaceAuthorizationsHistories)(ctx.state(), role),
|
|
85
85
|
controller: createController({
|
|
86
86
|
model: ctx.model,
|
|
87
|
-
role
|
|
87
|
+
role,
|
|
88
88
|
build: (next) => {
|
|
89
89
|
pointer.value = next;
|
|
90
90
|
},
|
|
@@ -398,12 +398,16 @@ function createController(props) {
|
|
|
398
398
|
}; })()(next);
|
|
399
399
|
if (result.success === false)
|
|
400
400
|
return result;
|
|
401
|
+
// remove login operation for guest role
|
|
402
|
+
if (props.role.kind === "guest") {
|
|
403
|
+
result.data.operations = result.data.operations.filter((op) => op.authorizationType !== "login");
|
|
404
|
+
}
|
|
401
405
|
const errors = [];
|
|
402
406
|
result.data.operations.forEach((op, i) => {
|
|
403
407
|
var _a, _b;
|
|
404
408
|
// validate authorizationRole
|
|
405
409
|
if (op.authorizationRole !== null) {
|
|
406
|
-
op.authorizationRole = props.role;
|
|
410
|
+
op.authorizationRole = props.role.name;
|
|
407
411
|
}
|
|
408
412
|
// validate responseBody.typeName -> must be ~.IAuthorized
|
|
409
413
|
if (op.authorizationType === null)
|
|
@@ -444,7 +448,9 @@ function createController(props) {
|
|
|
444
448
|
"join",
|
|
445
449
|
"refresh"
|
|
446
450
|
])
|
|
447
|
-
if (
|
|
451
|
+
if (props.role.kind === "guest" && type === "login")
|
|
452
|
+
continue;
|
|
453
|
+
else if (authorizationTypes.has(type) === false)
|
|
448
454
|
errors.push({
|
|
449
455
|
path: "$input.operations[].authorizationType",
|
|
450
456
|
expected: utils_1.StringUtil.trim `{
|
|
@@ -456,7 +462,7 @@ function createController(props) {
|
|
|
456
462
|
There must be an operation that has defined AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
457
463
|
for the "${props.role}" role's authorization activity; "${type}".
|
|
458
464
|
|
|
459
|
-
However, none of the operations have the AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
465
|
+
However, none of the operations have the AutoBeOpenApi.IOperation.authorizationType := "${type}"
|
|
460
466
|
value, so that the "${props.role}" cannot perform the authorization ${type} activity.
|
|
461
467
|
|
|
462
468
|
Please make that operation at the next function calling. You have to do it.
|
|
@@ -537,11 +543,11 @@ const collection = {
|
|
|
537
543
|
]
|
|
538
544
|
},
|
|
539
545
|
description: {
|
|
540
|
-
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n**CRITICAL WARNING about soft delete keywords
|
|
546
|
+
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n**CRITICAL WARNING about soft delete keywords**: DO NOT use terms like\n\"soft delete\", \"soft-delete\", or similar variations in this description\nUNLESS the operation actually implements soft deletion. These keywords\ntrigger validation logic that expects a corresponding soft_delete_column\nto be specified. Only use these terms when you intend to implement soft\ndeletion (marking records as deleted without removing them from the\ndatabase).\n\nExample of problematic description: \u274C \"This would normally be a\nsoft-delete, but we intentionally perform permanent deletion here\" - This\ntriggers soft delete validation despite being a hard delete operation.\n\n> MUST be written in English. Never use other languages.",
|
|
541
547
|
type: "string"
|
|
542
548
|
},
|
|
543
549
|
summary: {
|
|
544
|
-
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n**CRITICAL WARNING about soft delete keywords
|
|
550
|
+
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n**CRITICAL WARNING about soft delete keywords**: DO NOT use terms like\n\"soft delete\", \"soft-delete\", or similar variations in this summary\nUNLESS the operation actually implements soft deletion. These keywords\ntrigger validation logic that expects a corresponding soft_delete_column\nto be specified. Only use these terms when you intend to implement soft\ndeletion (marking records as deleted without removing them from the\ndatabase).\n\n> MUST be written in English. Never use other languages",
|
|
545
551
|
type: "string"
|
|
546
552
|
},
|
|
547
553
|
parameters: {
|
|
@@ -594,7 +600,7 @@ const collection = {
|
|
|
594
600
|
type: "string"
|
|
595
601
|
},
|
|
596
602
|
method: {
|
|
597
|
-
description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\"
|
|
603
|
+
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",
|
|
598
604
|
type: "string",
|
|
599
605
|
"enum": [
|
|
600
606
|
"get",
|
|
@@ -1157,11 +1163,11 @@ const collection = {
|
|
|
1157
1163
|
]
|
|
1158
1164
|
},
|
|
1159
1165
|
description: {
|
|
1160
|
-
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n**CRITICAL WARNING about soft delete keywords
|
|
1166
|
+
description: "Detailed description about the API operation.\n\nIMPORTANT: This field MUST be extensively detailed and MUST reference the\ndescription comments from the related Prisma DB schema tables and\ncolumns. The description should be organized into MULTIPLE PARAGRAPHS\nseparated by line breaks to improve readability and comprehension.\n\nFor example, include separate paragraphs for:\n\n- The purpose and overview of the API operation\n- Security considerations and user permissions\n- Relationship to underlying database entities\n- Validation rules and business logic\n- Related API operations that might be used together with this one\n- Expected behavior and error handling\n\nWhen writing the description, be sure to incorporate the corresponding DB\nschema's description comments, matching the level of detail and style of\nthose comments. This ensures consistency between the API documentation\nand database structure.\n\nIf there's a dependency to other APIs, please describe the dependency API\noperation in this field with detailed reason. For example, if this API\noperation needs a pre-execution of other API operation, it must be\nexplicitly described.\n\n- `GET /shoppings/customers/sales` must be pre-executed to get entire list\n of summarized sales. Detailed sale information would be obtained by\n specifying the sale ID in the path parameter.\n\n**CRITICAL WARNING about soft delete keywords**: DO NOT use terms like\n\"soft delete\", \"soft-delete\", or similar variations in this description\nUNLESS the operation actually implements soft deletion. These keywords\ntrigger validation logic that expects a corresponding soft_delete_column\nto be specified. Only use these terms when you intend to implement soft\ndeletion (marking records as deleted without removing them from the\ndatabase).\n\nExample of problematic description: \u274C \"This would normally be a\nsoft-delete, but we intentionally perform permanent deletion here\" - This\ntriggers soft delete validation despite being a hard delete operation.\n\n> MUST be written in English. Never use other languages.",
|
|
1161
1167
|
type: "string"
|
|
1162
1168
|
},
|
|
1163
1169
|
summary: {
|
|
1164
|
-
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n**CRITICAL WARNING about soft delete keywords
|
|
1170
|
+
description: "Short summary of the API operation.\n\nThis should be a concise description of the API operation, typically one\nsentence long. It should provide a quick overview of what the API does\nwithout going into too much detail.\n\nThis summary will be used in the OpenAPI documentation to give users a\nquick understanding of the API operation's purpose.\n\nIMPORTANT: The summary should clearly indicate which Prisma DB table this\noperation relates to, helping to ensure all tables have API coverage.\n\n**CRITICAL WARNING about soft delete keywords**: DO NOT use terms like\n\"soft delete\", \"soft-delete\", or similar variations in this summary\nUNLESS the operation actually implements soft deletion. These keywords\ntrigger validation logic that expects a corresponding soft_delete_column\nto be specified. Only use these terms when you intend to implement soft\ndeletion (marking records as deleted without removing them from the\ndatabase).\n\n> MUST be written in English. Never use other languages",
|
|
1165
1171
|
type: "string"
|
|
1166
1172
|
},
|
|
1167
1173
|
parameters: {
|
|
@@ -1217,7 +1223,7 @@ const collection = {
|
|
|
1217
1223
|
pattern: "^\\/[a-zA-Z0-9\\/_{}.-]*$"
|
|
1218
1224
|
},
|
|
1219
1225
|
method: {
|
|
1220
|
-
description: "HTTP method of the API operation.\n\n**IMPORTANT**: Methods must be written in lowercase only (e.g., \"get\"
|
|
1226
|
+
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",
|
|
1221
1227
|
oneOf: [
|
|
1222
1228
|
{
|
|
1223
1229
|
"const": "get"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrateInterfaceAuthorizations.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,gFA0BC;;;AAtCD,yCAA2C;AAG3C,kDAA0B;AAC1B,+BAA0B;AAG1B,uEAAoE;AACpE,uEAAoE;AACpE,qHAAkH;AAGlH,SAAsB,kCAAkC,CAEtD,GAAyB;;;QACzB,MAAM,KAAK,GAAwB,MAAA,MAAA,GAAG,CAAC,KAAK,EAAE,CAAC,OAAO,0CAAE,KAAK,mCAAI,EAAE,CAAC;QACpE,MAAM,QAAQ,GAA4B;YACxC,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,SAAS,EAAE,CAAC;SACb,CAAC;QACF,MAAM,cAAc,GAClB,MAAM,IAAA,uCAAkB,EACtB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAO,cAAc,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAsC,MAAM,OAAO,CAC5D,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,cAAc,CACf,CAAC;YACF,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,CAAC;QACJ,CAAC,CAAA,CAAC,CACH,CAAC;QAEJ,OAAO,cAAc,CAAC;IACxB,CAAC;CAAA;AAED,SAAe,OAAO,CACpB,GAAyB,EACzB,IAAuB,EACvB,QAAiC,EACjC,cAAsB;;;QAEtB,MAAM,OAAO,GACX;YACE,KAAK,EAAE,IAAI;SACZ,CAAC;QACJ,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;YAC1C,MAAM,EAAE,wBAAwB;YAChC,SAAS,EAAE,IAAA,qFAAyC,EAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC;YACvE,UAAU,EAAE,gBAAgB,CAAC;gBAC3B,KAAK,EAAE,GAAG,CAAC,KAAK;gBAChB,IAAI
|
|
1
|
+
{"version":3,"file":"orchestrateInterfaceAuthorizations.js","sourceRoot":"","sources":["../../../../../src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
3
3
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
4
|
-
export declare function orchestrateInterfaceComplement<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, document: AutoBeOpenApi.IDocument
|
|
4
|
+
export declare function orchestrateInterfaceComplement<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, document: AutoBeOpenApi.IDocument): Promise<Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>>;
|