@autobe/agent 0.25.7 → 0.27.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/AutoBeAgent.d.ts +2 -1
- package/lib/AutoBeAgent.js +30 -7
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +13 -12
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -20
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeContext.d.ts +4 -1
- package/lib/context/AutoBeTokenUsage.d.ts +1 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +7 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js +35 -0
- package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +1 -0
- package/lib/factory/AutoBeProcessAggregateFactory.d.ts +13 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js +100 -0
- package/lib/factory/AutoBeProcessAggregateFactory.js.map +1 -0
- package/lib/factory/consentFunctionCall.js +3 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.d.ts +2 -1
- package/lib/factory/createAutoBeContext.js +82 -28
- package/lib/factory/createAutoBeContext.js.map +1 -1
- package/lib/factory/getCommonPrompt.d.ts +2 -0
- package/lib/factory/getCommonPrompt.js +20 -0
- package/lib/factory/getCommonPrompt.js.map +1 -0
- package/lib/index.mjs +20929 -19874
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +6 -6
- package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +2 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +75 -74
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -4
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.d.ts +9 -9
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +1 -1
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +2 -17
- package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.d.ts +6 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js +58 -0
- package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +1 -0
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.d.ts +2 -1
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +3 -2
- package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
- package/lib/{factory/createAutoBeApplication.d.ts → orchestrate/facade/createAutoBeFacadeController.d.ts} +2 -2
- package/lib/{factory/createAutoBeApplication.js → orchestrate/facade/createAutoBeFacadeController.js} +53 -57
- package/lib/orchestrate/facade/createAutoBeFacadeController.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplication.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationProps.js.map +1 -0
- package/lib/orchestrate/facade/histories/IAutoBeFacadeApplicationResult.js.map +1 -0
- package/lib/orchestrate/facade/{transformFacadeStateMessage.d.ts → structures/transformFacadeStateMessage.d.ts} +1 -1
- package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js +46 -0
- package/lib/orchestrate/facade/structures/transformFacadeStateMessage.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +8 -8
- package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +3 -2
- package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +46 -20
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +5 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +51 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +1 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +11 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +81 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterface.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +33 -6
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +185 -97
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +234 -59
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +5 -4
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -6
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +4 -4
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +4 -3
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +178 -90
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +176 -88
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +6 -5
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +445 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +14 -0
- package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +302 -121
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +243 -65
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +22 -22
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +7 -7
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +101 -0
- package/lib/orchestrate/interface/structures/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaContentReviewApplication.js} +1 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +97 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.d.ts +44 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.js.map +1 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +92 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js +3 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map +1 -0
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +65 -24
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +94 -0
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
- package/lib/orchestrate/interface/utils/OperationValidator.d.ts +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +13 -13
- package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.d.ts +1 -1
- package/lib/orchestrate/prisma/orchestratePrisma.js +1 -0
- package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +4 -3
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js +2 -1
- package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +4 -3
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +2 -2
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +8 -7
- package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +4 -4
- package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +4 -7
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js +8 -18
- package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +8 -28
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +16 -280
- package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.js +4 -3
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +14 -13
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +12 -11
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +46 -24
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +64 -51
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js +2 -1
- package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +3 -3
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.d.ts +2 -2
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js +6 -6
- package/lib/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.js.map +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -1
- package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -1
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js +2 -2
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js +1 -1
- package/lib/orchestrate/realize/utils/printErrorHints.js.map +1 -1
- package/lib/orchestrate/realize/utils/replaceImportStatements.js +0 -85
- package/lib/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js +1 -1
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +5 -22
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +10 -10
- package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +5 -5
- package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +2 -2
- package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTest.d.ts +1 -1
- package/lib/orchestrate/test/orchestrateTest.js +2 -1
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js +5 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +4 -2
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +28 -27
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +4 -3
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js +2 -1
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.d.ts → IAutoBeTestScenarioAuthorizationActor.d.ts} +1 -1
- package/lib/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.js → IAutoBeTestScenarioAuthorizationActor.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationActor.js.map +1 -0
- package/lib/utils/TokenUsageComputer.d.ts +5 -0
- package/lib/utils/TokenUsageComputer.js +29 -0
- package/lib/utils/TokenUsageComputer.js.map +1 -0
- package/package.json +7 -7
- package/src/AutoBeAgent.ts +43 -6
- package/src/AutoBeMockAgent.ts +13 -12
- package/src/constants/AutoBeSystemPromptConstant.ts +27 -20
- package/src/context/AutoBeContext.ts +8 -0
- package/src/context/AutoBeTokenUsage.ts +1 -1
- package/src/factory/AutoBeFunctionCallingMetricFactory.ts +44 -0
- package/src/factory/AutoBeProcessAggregateFactory.ts +141 -0
- package/src/factory/consentFunctionCall.ts +4 -0
- package/src/factory/createAutoBeContext.ts +101 -37
- package/src/factory/getCommonPrompt.ts +25 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +2 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +5 -4
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +3 -2
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeScenarioApplication.ts +9 -9
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +1 -1
- package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +2 -20
- package/src/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.ts +65 -0
- package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +5 -2
- package/src/orchestrate/facade/createAutoBeFacadeController.ts +135 -0
- package/src/orchestrate/facade/{transformFacadeStateMessage.ts → structures/transformFacadeStateMessage.ts} +2 -2
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
- package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +1 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +45 -20
- package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +55 -0
- package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +90 -0
- package/src/orchestrate/interface/orchestrateInterface.ts +47 -16
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +20 -19
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -1
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +5 -6
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +7 -6
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +25 -24
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +6 -5
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +270 -0
- package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +89 -76
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +18 -9
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +26 -22
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +7 -7
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +108 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +104 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts +45 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +99 -0
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +45 -3
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +110 -0
- package/src/orchestrate/interface/utils/OperationValidator.ts +1 -1
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +12 -12
- package/src/orchestrate/prisma/orchestratePrisma.ts +6 -5
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +6 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +2 -1
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +2 -1
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +9 -8
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +8 -7
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +4 -4
- package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +14 -28
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +13 -30
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +20 -285
- package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +11 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +5 -4
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +77 -62
- package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +92 -90
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +2 -1
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +3 -3
- package/src/orchestrate/realize/utils/AutoBeRealizeAuthorizationReplaceImport.ts +10 -7
- package/src/orchestrate/realize/utils/generateRealizeScenario.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +2 -2
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +1 -1
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +2 -2
- package/src/orchestrate/realize/utils/printErrorHints.ts +1 -1
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +0 -90
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +1 -1
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +6 -24
- package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +10 -10
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +12 -10
- package/src/orchestrate/test/orchestrateTest.ts +3 -2
- package/src/orchestrate/test/orchestrateTestCorrect.ts +5 -1
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +4 -2
- package/src/orchestrate/test/orchestrateTestScenario.ts +32 -31
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +4 -3
- package/src/orchestrate/test/orchestrateTestWrite.ts +2 -1
- package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -1
- package/src/utils/TokenUsageComputer.ts +35 -0
- package/lib/context/IAutoBeFacadeApplication.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationProps.js.map +0 -1
- package/lib/context/IAutoBeFacadeApplicationResult.js.map +0 -1
- package/lib/factory/createAutoBeApplication.js.map +0 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +0 -46
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +0 -1
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +0 -4
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +0 -60
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +0 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +0 -9
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +0 -1
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +0 -91
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.js.map +0 -1
- package/lib/orchestrate/realize/orchestRateRealizeCorrectCasting.js.map +0 -1
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioAuthorizationRole.js.map +0 -1
- package/src/factory/createAutoBeApplication.ts +0 -123
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.js +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.d.ts +0 -0
- /package/lib/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.js +0 -0
- /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplication.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationProps.ts +0 -0
- /package/src/{context → orchestrate/facade/histories}/IAutoBeFacadeApplicationResult.ts +0 -0
|
@@ -84,6 +84,7 @@ var JsonSchemaFactory;
|
|
|
84
84
|
};
|
|
85
85
|
JsonSchemaFactory.finalize = (props) => {
|
|
86
86
|
removeUnused(props.document);
|
|
87
|
+
removeDuplicated(props.document);
|
|
87
88
|
fixTimestamps(props);
|
|
88
89
|
};
|
|
89
90
|
const removeUnused = (document) => {
|
|
@@ -112,6 +113,46 @@ var JsonSchemaFactory;
|
|
|
112
113
|
if (used.has(key) === false)
|
|
113
114
|
delete document.components.schemas[key];
|
|
114
115
|
};
|
|
116
|
+
const removeDuplicated = (document) => {
|
|
117
|
+
// gather duplicated schemas
|
|
118
|
+
const correct = new Map();
|
|
119
|
+
for (const key of Object.keys(document.components.schemas)) {
|
|
120
|
+
if (key.includes(".") === false)
|
|
121
|
+
continue;
|
|
122
|
+
const dotRemoved = key.replace(".", "");
|
|
123
|
+
if (document.components.schemas[dotRemoved] === undefined)
|
|
124
|
+
continue;
|
|
125
|
+
correct.set(dotRemoved, key);
|
|
126
|
+
}
|
|
127
|
+
// fix operations' references
|
|
128
|
+
for (const op of document.operations) {
|
|
129
|
+
if (op.requestBody && correct.has(op.requestBody.typeName))
|
|
130
|
+
op.requestBody.typeName = correct.get(op.requestBody.typeName);
|
|
131
|
+
if (op.responseBody && correct.has(op.responseBody.typeName))
|
|
132
|
+
op.responseBody.typeName = correct.get(op.responseBody.typeName);
|
|
133
|
+
}
|
|
134
|
+
// fix schemas' references
|
|
135
|
+
const $refChangers = new Map();
|
|
136
|
+
for (const value of Object.values(document.components.schemas))
|
|
137
|
+
openapi_1.OpenApiTypeChecker.visit({
|
|
138
|
+
components: { schemas: document.components.schemas },
|
|
139
|
+
schema: value,
|
|
140
|
+
closure: (next) => {
|
|
141
|
+
if (openapi_1.OpenApiTypeChecker.isReference(next) === false)
|
|
142
|
+
return;
|
|
143
|
+
const x = next.$ref.split("/").pop();
|
|
144
|
+
const y = correct.get(x);
|
|
145
|
+
if (y === undefined)
|
|
146
|
+
return;
|
|
147
|
+
$refChangers.set(next, () => (next.$ref = `#/components/schemas/${y}`));
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
for (const fn of $refChangers.values())
|
|
151
|
+
fn();
|
|
152
|
+
// remove duplicated schemas
|
|
153
|
+
for (const key of correct.keys())
|
|
154
|
+
delete document.components.schemas[key];
|
|
155
|
+
};
|
|
115
156
|
const fixTimestamps = (props) => {
|
|
116
157
|
const entireModels = props.application.files
|
|
117
158
|
.map((f) => f.models)
|
|
@@ -182,7 +223,7 @@ var JsonSchemaFactory;
|
|
|
182
223
|
JsonSchemaFactory.getPageName = (key) => key.substring("IPage".length);
|
|
183
224
|
const isRecord = (input) => typeof input === "object" && input !== null;
|
|
184
225
|
})(JsonSchemaFactory || (exports.JsonSchemaFactory = JsonSchemaFactory = {}));
|
|
185
|
-
const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
226
|
+
const DEFAULT_SCHEMAS = (() => { const _iv1 = new Set(["date-time", "password", "regex", "uuid", "email", "hostname", "idn-email", "idn-hostname", "iri", "iri-reference", "ipv4", "ipv6", "uri", "uri-reference", "uri-template", "url", "date", "time", "duration", "json-pointer", "relative-json-pointer"]); const _iv2 = new Set(["date-time", "password", "regex", "uuid", "email", "hostname", "idn-email", "idn-hostname", "iri", "iri-reference", "ipv4", "ipv6", "uri", "uri-reference", "uri-template", "url", "date", "time", "duration", "json-pointer", "relative-json-pointer"]); const _av7 = new Set(["date-time", "password", "regex", "uuid", "email", "hostname", "idn-email", "idn-hostname", "iri", "iri-reference", "ipv4", "ipv6", "uri", "uri-reference", "uri-template", "url", "date", "time", "duration", "json-pointer", "relative-json-pointer"]); const _av8 = new Set(["date-time", "password", "regex", "uuid", "email", "hostname", "idn-email", "idn-hostname", "iri", "iri-reference", "ipv4", "ipv6", "uri", "uri-reference", "uri-template", "url", "date", "time", "duration", "json-pointer", "relative-json-pointer"]); const _io0 = (input, _exceptionable = true) => Object.keys(input).every(key => {
|
|
186
227
|
const value = input[key];
|
|
187
228
|
if (undefined === value)
|
|
188
229
|
return true;
|
|
@@ -215,7 +256,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
215
256
|
if (undefined === value)
|
|
216
257
|
return true;
|
|
217
258
|
return false;
|
|
218
|
-
})); const _io5 = (input, _exceptionable = true) => (undefined === input.format ||
|
|
259
|
+
})); const _io5 = (input, _exceptionable = true) => (undefined === input.format || true === _iv1.has(input.format)) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type && "string" === typeof input.description && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
219
260
|
if (["format", "pattern", "contentMediaType", "minLength", "maxLength", "type", "description"].some(prop => key === prop))
|
|
220
261
|
return true;
|
|
221
262
|
const value = input[key];
|
|
@@ -243,7 +284,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
243
284
|
if (undefined === value)
|
|
244
285
|
return true;
|
|
245
286
|
return false;
|
|
246
|
-
})); const _io9 = (input, _exceptionable = true) => (undefined === input.format ||
|
|
287
|
+
})); const _io9 = (input, _exceptionable = true) => (undefined === input.format || true === _iv2.has(input.format)) && (undefined === input.pattern || "string" === typeof input.pattern) && (undefined === input.contentMediaType || "string" === typeof input.contentMediaType) && (undefined === input.minLength || "number" === typeof input.minLength && (Math.floor(input.minLength) === input.minLength && 0 <= input.minLength && input.minLength <= 18446744073709552000)) && (undefined === input.maxLength || "number" === typeof input.maxLength && (Math.floor(input.maxLength) === input.maxLength && 0 <= input.maxLength && input.maxLength <= 18446744073709552000)) && "string" === input.type && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
247
288
|
if (["format", "pattern", "contentMediaType", "minLength", "maxLength", "type"].some(prop => key === prop))
|
|
248
289
|
return true;
|
|
249
290
|
const value = input[key];
|
|
@@ -271,7 +312,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
271
312
|
if (undefined === value)
|
|
272
313
|
return true;
|
|
273
314
|
return false;
|
|
274
|
-
})); const _io13 = (input, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"]) && ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem,
|
|
315
|
+
})); const _io13 = (input, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"]) && ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem, _index3) => "string" === typeof elem)) && "object" === input.type && (3 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
275
316
|
if (["x-autobe-prisma-schema", "properties", "additionalProperties", "required", "type"].some(prop => key === prop))
|
|
276
317
|
return true;
|
|
277
318
|
const value = input[key];
|
|
@@ -285,7 +326,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
285
326
|
if (undefined === value)
|
|
286
327
|
return true;
|
|
287
328
|
return false;
|
|
288
|
-
})); const _io15 = (input, _exceptionable = true) => Array.isArray(input.oneOf) && input.oneOf.every((elem,
|
|
329
|
+
})); const _io15 = (input, _exceptionable = true) => Array.isArray(input.oneOf) && input.oneOf.every((elem, _index4) => "object" === typeof elem && null !== elem && _iu0(elem, true && _exceptionable)) && (undefined === input.discriminator || "object" === typeof input.discriminator && null !== input.discriminator && _io17(input.discriminator, true && _exceptionable)) && (1 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
289
330
|
if (["oneOf", "discriminator"].some(prop => key === prop))
|
|
290
331
|
return true;
|
|
291
332
|
const value = input[key];
|
|
@@ -311,7 +352,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
311
352
|
if (undefined === value)
|
|
312
353
|
return true;
|
|
313
354
|
return "string" === typeof value;
|
|
314
|
-
}); const _io19 = (input, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"]) && ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem,
|
|
355
|
+
}); const _io19 = (input, _exceptionable = true) => (null === input["x-autobe-prisma-schema"] || undefined === input["x-autobe-prisma-schema"] || "string" === typeof input["x-autobe-prisma-schema"]) && ("object" === typeof input.properties && null !== input.properties && false === Array.isArray(input.properties) && _io0(input.properties, true && _exceptionable)) && (null !== input.additionalProperties && (undefined === input.additionalProperties || false === input.additionalProperties || "object" === typeof input.additionalProperties && null !== input.additionalProperties && _iu2(input.additionalProperties, true && _exceptionable))) && (Array.isArray(input.required) && input.required.every((elem, _index5) => "string" === typeof elem)) && "object" === input.type && "string" === typeof input.description && (4 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
315
356
|
if (["x-autobe-prisma-schema", "properties", "additionalProperties", "required", "type", "description"].some(prop => key === prop))
|
|
316
357
|
return true;
|
|
317
358
|
const value = input[key];
|
|
@@ -325,7 +366,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
325
366
|
if (undefined === value)
|
|
326
367
|
return true;
|
|
327
368
|
return false;
|
|
328
|
-
})); const _io21 = (input, _exceptionable = true) => Array.isArray(input.oneOf) && input.oneOf.every((elem,
|
|
369
|
+
})); const _io21 = (input, _exceptionable = true) => Array.isArray(input.oneOf) && input.oneOf.every((elem, _index6) => "object" === typeof elem && null !== elem && _iu0(elem, true && _exceptionable)) && (undefined === input.discriminator || "object" === typeof input.discriminator && null !== input.discriminator && _io17(input.discriminator, true && _exceptionable)) && "string" === typeof input.description && (2 === Object.keys(input).length || Object.keys(input).every(key => {
|
|
329
370
|
if (["oneOf", "discriminator", "description"].some(prop => key === prop))
|
|
330
371
|
return true;
|
|
331
372
|
const value = input[key];
|
|
@@ -584,10 +625,10 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
584
625
|
expected: "undefined",
|
|
585
626
|
value: value
|
|
586
627
|
}, _errorFactory);
|
|
587
|
-
}))); const _ao5 = (input, _path, _exceptionable = true) => (undefined === input.format ||
|
|
628
|
+
}))); const _ao5 = (input, _path, _exceptionable = true) => (undefined === input.format || true === _av7.has(input.format) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
588
629
|
method: "typia.assertEquals",
|
|
589
630
|
path: _path + ".format",
|
|
590
|
-
expected: "(
|
|
631
|
+
expected: "(\"date\" | \"date-time\" | \"duration\" | \"email\" | \"hostname\" | \"idn-email\" | \"idn-hostname\" | \"ipv4\" | \"ipv6\" | \"iri\" | \"iri-reference\" | \"json-pointer\" | \"password\" | \"regex\" | \"relative-json-pointer\" | \"time\" | \"uri\" | \"uri-reference\" | \"uri-template\" | \"url\" | \"uuid\" | undefined)",
|
|
591
632
|
value: input.format
|
|
592
633
|
}, _errorFactory)) && (undefined === input.pattern || "string" === typeof input.pattern || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
593
634
|
method: "typia.assertEquals",
|
|
@@ -807,10 +848,10 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
807
848
|
expected: "undefined",
|
|
808
849
|
value: value
|
|
809
850
|
}, _errorFactory);
|
|
810
|
-
}))); const _ao9 = (input, _path, _exceptionable = true) => (undefined === input.format ||
|
|
851
|
+
}))); const _ao9 = (input, _path, _exceptionable = true) => (undefined === input.format || true === _av8.has(input.format) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
811
852
|
method: "typia.assertEquals",
|
|
812
853
|
path: _path + ".format",
|
|
813
|
-
expected: "(
|
|
854
|
+
expected: "(\"date\" | \"date-time\" | \"duration\" | \"email\" | \"hostname\" | \"idn-email\" | \"idn-hostname\" | \"ipv4\" | \"ipv6\" | \"iri\" | \"iri-reference\" | \"json-pointer\" | \"password\" | \"regex\" | \"relative-json-pointer\" | \"time\" | \"uri\" | \"uri-reference\" | \"uri-template\" | \"url\" | \"uuid\" | undefined)",
|
|
814
855
|
value: input.format
|
|
815
856
|
}, _errorFactory)) && (undefined === input.pattern || "string" === typeof input.pattern || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
816
857
|
method: "typia.assertEquals",
|
|
@@ -980,9 +1021,9 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
980
1021
|
path: _path + ".required",
|
|
981
1022
|
expected: "Array<string>",
|
|
982
1023
|
value: input.required
|
|
983
|
-
}, _errorFactory)) && input.required.every((elem,
|
|
1024
|
+
}, _errorFactory)) && input.required.every((elem, _index9) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
984
1025
|
method: "typia.assertEquals",
|
|
985
|
-
path: _path + ".required[" +
|
|
1026
|
+
path: _path + ".required[" + _index9 + "]",
|
|
986
1027
|
expected: "string",
|
|
987
1028
|
value: elem
|
|
988
1029
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -1029,14 +1070,14 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1029
1070
|
path: _path + ".oneOf",
|
|
1030
1071
|
expected: "Array<IInteger | INumber | IString | IConstant | IBoolean | IArray | IObject | IReference | INull>",
|
|
1031
1072
|
value: input.oneOf
|
|
1032
|
-
}, _errorFactory)) && input.oneOf.every((elem,
|
|
1073
|
+
}, _errorFactory)) && input.oneOf.every((elem, _index10) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1033
1074
|
method: "typia.assertEquals",
|
|
1034
|
-
path: _path + ".oneOf[" +
|
|
1075
|
+
path: _path + ".oneOf[" + _index10 + "]",
|
|
1035
1076
|
expected: "(AutoBeOpenApi.IJsonSchema.IArray | AutoBeOpenApi.IJsonSchema.IBoolean | AutoBeOpenApi.IJsonSchema.IConstant | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INull | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IObject | AutoBeOpenApi.IJsonSchema.IReference | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1036
1077
|
value: elem
|
|
1037
|
-
}, _errorFactory)) && _au0(elem, _path + ".oneOf[" +
|
|
1078
|
+
}, _errorFactory)) && _au0(elem, _path + ".oneOf[" + _index10 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1038
1079
|
method: "typia.assertEquals",
|
|
1039
|
-
path: _path + ".oneOf[" +
|
|
1080
|
+
path: _path + ".oneOf[" + _index10 + "]",
|
|
1040
1081
|
expected: "(AutoBeOpenApi.IJsonSchema.IArray | AutoBeOpenApi.IJsonSchema.IBoolean | AutoBeOpenApi.IJsonSchema.IConstant | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INull | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IObject | AutoBeOpenApi.IJsonSchema.IReference | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1041
1082
|
value: elem
|
|
1042
1083
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -1155,9 +1196,9 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1155
1196
|
path: _path + ".required",
|
|
1156
1197
|
expected: "Array<string>",
|
|
1157
1198
|
value: input.required
|
|
1158
|
-
}, _errorFactory)) && input.required.every((elem,
|
|
1199
|
+
}, _errorFactory)) && input.required.every((elem, _index11) => "string" === typeof elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1159
1200
|
method: "typia.assertEquals",
|
|
1160
|
-
path: _path + ".required[" +
|
|
1201
|
+
path: _path + ".required[" + _index11 + "]",
|
|
1161
1202
|
expected: "string",
|
|
1162
1203
|
value: elem
|
|
1163
1204
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -1214,14 +1255,14 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1214
1255
|
path: _path + ".oneOf",
|
|
1215
1256
|
expected: "Array<IInteger | INumber | IString | IConstant | IBoolean | IArray | IObject | IReference | INull>",
|
|
1216
1257
|
value: input.oneOf
|
|
1217
|
-
}, _errorFactory)) && input.oneOf.every((elem,
|
|
1258
|
+
}, _errorFactory)) && input.oneOf.every((elem, _index12) => ("object" === typeof elem && null !== elem || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1218
1259
|
method: "typia.assertEquals",
|
|
1219
|
-
path: _path + ".oneOf[" +
|
|
1260
|
+
path: _path + ".oneOf[" + _index12 + "]",
|
|
1220
1261
|
expected: "(AutoBeOpenApi.IJsonSchema.IArray | AutoBeOpenApi.IJsonSchema.IBoolean | AutoBeOpenApi.IJsonSchema.IConstant | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INull | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IObject | AutoBeOpenApi.IJsonSchema.IReference | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1221
1262
|
value: elem
|
|
1222
|
-
}, _errorFactory)) && _au0(elem, _path + ".oneOf[" +
|
|
1263
|
+
}, _errorFactory)) && _au0(elem, _path + ".oneOf[" + _index12 + "]", true && _exceptionable) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
1223
1264
|
method: "typia.assertEquals",
|
|
1224
|
-
path: _path + ".oneOf[" +
|
|
1265
|
+
path: _path + ".oneOf[" + _index12 + "]",
|
|
1225
1266
|
expected: "(AutoBeOpenApi.IJsonSchema.IArray | AutoBeOpenApi.IJsonSchema.IBoolean | AutoBeOpenApi.IJsonSchema.IConstant | AutoBeOpenApi.IJsonSchema.IInteger | AutoBeOpenApi.IJsonSchema.INull | AutoBeOpenApi.IJsonSchema.INumber | AutoBeOpenApi.IJsonSchema.IObject | AutoBeOpenApi.IJsonSchema.IReference | AutoBeOpenApi.IJsonSchema.IString)",
|
|
1226
1267
|
value: elem
|
|
1227
1268
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(_exceptionable, {
|
|
@@ -1471,7 +1512,7 @@ const DEFAULT_SCHEMAS = (() => { const _io0 = (input, _exceptionable = true) =>
|
|
|
1471
1512
|
"expired_at",
|
|
1472
1513
|
"refreshable_until"
|
|
1473
1514
|
],
|
|
1474
|
-
description: "Authorization token response structure.\n\nThis interface defines the structure of the authorization token response\nreturned after successful user authentication. It contains both access and\nrefresh tokens along with their expiration information.\n\nThis token structure is automatically included in API schemas when the system\ndetects authorization
|
|
1515
|
+
description: "Authorization token response structure.\n\nThis interface defines the structure of the authorization token response\nreturned after successful user authentication. It contains both access and\nrefresh tokens along with their expiration information.\n\nThis token structure is automatically included in API schemas when the system\ndetects authorization actors in the requirements analysis phase. It provides\na standard format for JWT-based authentication across the generated backend\napplications."
|
|
1475
1516
|
}
|
|
1476
1517
|
}
|
|
1477
1518
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaFactory.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAqE;AACrE,
|
|
1
|
+
{"version":3,"file":"JsonSchemaFactory.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAqE;AACrE,8CAA+D;AAC/D,kDAAoC;AAEpC,IAAiB,iBAAiB,CAgNjC;AAhND,WAAiB,iBAAiB;IAChC;;kEAE8D;IACjD,yBAAO,GAAG,CACrB,SAAsB,EACgC,EAAE;QACxD,MAAM,OAAO,GAAyD,EAAE,CAAC;QACzE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;YAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;QACD,KAAK,MAAM,GAAG,IAAI,SAAS;YACzB,IAAI,kBAAA,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChB,MAAM,IAAI,GAAW,kBAAA,WAAW,CAAC,GAAG,CAAC,CAAC;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,kBAAA,IAAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAGnB,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EACG,UAAU,0CAAE,OAAO,CACvB,CAAC"}
|
|
@@ -8,6 +8,7 @@ var JsonSchemaValidator;
|
|
|
8
8
|
JsonSchemaValidator.validateSchemas = (props) => {
|
|
9
9
|
validateAuthorization(props);
|
|
10
10
|
validatePrismaSchema(props.errors);
|
|
11
|
+
validateRecursive(props);
|
|
11
12
|
for (const key of Object.keys(props.schemas))
|
|
12
13
|
JsonSchemaValidator.validateKey({
|
|
13
14
|
errors: props.errors,
|
|
@@ -159,5 +160,98 @@ var JsonSchemaValidator;
|
|
|
159
160
|
`;
|
|
160
161
|
}
|
|
161
162
|
};
|
|
163
|
+
const validateRecursive = (props) => {
|
|
164
|
+
for (const [key, value] of Object.entries(props.schemas)) {
|
|
165
|
+
const report = (description) => props.errors.push({
|
|
166
|
+
path: `${props.path}[${JSON.stringify(key)}]`,
|
|
167
|
+
expected: "Non-infinite recursive schema definition",
|
|
168
|
+
value,
|
|
169
|
+
description,
|
|
170
|
+
});
|
|
171
|
+
if (utils_1.AutoBeOpenApiTypeChecker.isReference(value) &&
|
|
172
|
+
value.$ref === `#/components/schemas/${key}`)
|
|
173
|
+
report(utils_1.StringUtil.trim `
|
|
174
|
+
You have defined a nonsensible type like below:
|
|
175
|
+
|
|
176
|
+
\`\`\`typescript
|
|
177
|
+
type ${key} = ${key};
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
This is an infinite recursive type definition that cannot exist in any
|
|
181
|
+
programming language. A type cannot be defined as itself - this creates
|
|
182
|
+
a circular definition with no base case, making the type impossible to
|
|
183
|
+
instantiate or validate.
|
|
184
|
+
|
|
185
|
+
If you need tree or graph structures, use explicit relationships with
|
|
186
|
+
ID references (e.g., parentId: string) instead of recursive type definitions.
|
|
187
|
+
Remove the self-reference and redesign the schema at the next time.
|
|
188
|
+
`);
|
|
189
|
+
else if (utils_1.AutoBeOpenApiTypeChecker.isArray(value) &&
|
|
190
|
+
utils_1.AutoBeOpenApiTypeChecker.isReference(value.items) &&
|
|
191
|
+
value.items.$ref === `#/components/schemas/${key}`)
|
|
192
|
+
report(utils_1.StringUtil.trim `
|
|
193
|
+
You have defined a nonsensible type like below:
|
|
194
|
+
|
|
195
|
+
\`\`\`typescript
|
|
196
|
+
type ${key} = Array<${key}>;
|
|
197
|
+
\`\`\`
|
|
198
|
+
|
|
199
|
+
This is an infinite recursive array type that cannot exist in any
|
|
200
|
+
programming language. An array of itself creates a circular definition
|
|
201
|
+
with no base case, making the type impossible to instantiate or validate.
|
|
202
|
+
|
|
203
|
+
If you need nested structures, define explicit depth levels with separate
|
|
204
|
+
types, or use parent-child relationships with ID references.
|
|
205
|
+
Remove the self-reference and redesign the schema at the next time.
|
|
206
|
+
`);
|
|
207
|
+
else if (utils_1.AutoBeOpenApiTypeChecker.isOneOf(value) &&
|
|
208
|
+
value.oneOf.some((v) => utils_1.AutoBeOpenApiTypeChecker.isReference(v) &&
|
|
209
|
+
v.$ref === `#/components/schemas/${key}`) === true)
|
|
210
|
+
report(utils_1.StringUtil.trim `
|
|
211
|
+
You have defined a nonsensible type like below:
|
|
212
|
+
|
|
213
|
+
\`\`\`typescript
|
|
214
|
+
type ${key} = ${key} | ...;
|
|
215
|
+
\`\`\`
|
|
216
|
+
|
|
217
|
+
This is an infinite recursive union type that cannot exist in any
|
|
218
|
+
programming language. A union that includes itself as a variant creates
|
|
219
|
+
a circular definition with no base case, making the type impossible to
|
|
220
|
+
instantiate or validate.
|
|
221
|
+
|
|
222
|
+
If you need polymorphic hierarchies, define separate concrete types for
|
|
223
|
+
each variant without including the union type itself as a variant.
|
|
224
|
+
Remove the self-reference and redesign the schema at the next time.
|
|
225
|
+
`);
|
|
226
|
+
else if (utils_1.AutoBeOpenApiTypeChecker.isObject(value) &&
|
|
227
|
+
value.properties &&
|
|
228
|
+
value.required &&
|
|
229
|
+
Object.entries(value.properties).some(([k, v]) => utils_1.AutoBeOpenApiTypeChecker.isReference(v) &&
|
|
230
|
+
v.$ref === `#/components/schemas/${key}` &&
|
|
231
|
+
value.required.includes(k)))
|
|
232
|
+
report(utils_1.StringUtil.trim `
|
|
233
|
+
You have defined a nonsensible type like below:
|
|
234
|
+
|
|
235
|
+
\`\`\`typescript
|
|
236
|
+
interface ${key} {
|
|
237
|
+
someProperty: ${key}; // required, non-nullable
|
|
238
|
+
}
|
|
239
|
+
\`\`\`
|
|
240
|
+
|
|
241
|
+
This is an infinite recursive object type that cannot exist in any
|
|
242
|
+
programming language. A required non-nullable property referencing its
|
|
243
|
+
own type creates a circular definition with no base case, making the
|
|
244
|
+
type impossible to instantiate.
|
|
245
|
+
|
|
246
|
+
To create an instance of ${key}, you would need an instance of ${key},
|
|
247
|
+
which requires another instance of ${key}, infinitely. This is logically
|
|
248
|
+
impossible.
|
|
249
|
+
|
|
250
|
+
If you need parent-child or graph relationships, make the self-referencing
|
|
251
|
+
property either nullable or optional, or use ID references (e.g., parentId: string).
|
|
252
|
+
Remove the required self-reference and redesign the schema at the next time.
|
|
253
|
+
`);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
162
256
|
})(JsonSchemaValidator || (exports.JsonSchemaValidator = JsonSchemaValidator = {}));
|
|
163
257
|
//# sourceMappingURL=JsonSchemaValidator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonSchemaValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaValidator.ts"],"names":[],"mappings":";;;AACA,yCAAqE;AAErE,qDAAkD;AAElD,IAAiB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"JsonSchemaValidator.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/utils/JsonSchemaValidator.ts"],"names":[],"mappings":";;;AACA,yCAAqE;AAErE,qDAAkD;AAElD,IAAiB,mBAAmB,CAyRnC;AAzRD,WAAiB,mBAAmB;IAOrB,mCAAe,GAAG,CAAC,KAAa,EAAQ,EAAE;QACrD,qBAAqB,CAAC,KAAK,CAAC,CAAC;QAC7B,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACzB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;YAC1C,oBAAA,WAAW,CAAC;gBACV,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,GAAG;aACJ,CAAC,CAAC;IACP,CAAC,CAAC;IAEW,+BAAW,GAAG,CAAC,KAI3B,EAAQ,EAAE;QACT,MAAM,QAAQ,GAAa,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChD,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAO,CAAC,QAAQ,CAAC,KAAK,KAAK;YAC5C,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;gBAChB,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG;gBACnD,QAAQ,EAAE,qBAAqB;gBAC/B,KAAK,EAAE,KAAK,CAAC,GAAG;gBAChB,WAAW,EAAE,kBAAU,CAA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{
|
|
|
4
4
|
const validate: (props: {
|
|
5
5
|
errors: IValidation.IError[];
|
|
6
6
|
path: string;
|
|
7
|
-
operations: Array<Omit<AutoBeOpenApi.IOperation, "
|
|
7
|
+
operations: Array<Omit<AutoBeOpenApi.IOperation, "authorizationActor" | "authorizationType" | "prerequisites">>;
|
|
8
8
|
}) => void;
|
|
9
9
|
}
|
|
@@ -15,7 +15,7 @@ const transformPrismaComponentsHistories = (state, props) => {
|
|
|
15
15
|
id: (0, uuid_1.v7)(),
|
|
16
16
|
created_at: new Date().toISOString(),
|
|
17
17
|
type: "systemMessage",
|
|
18
|
-
text: "<!--\nfilename: PRISMA_COMPONENT.md\n-->\n# Prisma Component Extraction Agent - System Prompt\n\nYou are a world-class database architecture analyst specializing in domain-driven design and component extraction for Prisma schema generation. Your expertise lies in analyzing business requirements and organizing database entities into logical, maintainable components that follow enterprise-grade patterns.\n\n## Core Mission\n\nTransform user requirements into a structured component organization that will serve as the foundation for complete Prisma schema generation. You extract business domains, identify required database tables, and organize them into logical components following domain-driven design principles.\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 component analysis 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## Key Responsibilities\n\n### 1. Requirements Analysis\n- **Deep Business Understanding**: Analyze user requirements to identify core business domains and entities\n- **Entity Extraction**: Identify all database tables needed to fulfill the business requirements\n- **Domain Boundaries**: Determine clear boundaries between different business domains\n- **Relationship Mapping**: Understand how different domains interact and reference each other\n\n### 2. Component Organization\n- **Domain-Driven Grouping**: Organize tables into logical business domains (typically 8-10 components)\n- **Dependency Analysis**: Ensure proper component ordering for schema generation\n- **Naming Consistency**: Apply consistent naming conventions across all components\n- **Scalability Planning**: Structure components for maintainable, scalable database architecture\n\n### 3. Table Name Standardization\n- **Plural Convention**: Convert all table names to plural form using snake_case\n- **Domain Prefixing**: Apply appropriate domain prefixes where needed for clarity\n- **Consistency Check**: Ensure naming consistency across related tables\n- **Business Alignment**: Match table names to business terminology and concepts\n\n## Component Organization Guidelines\n\n### Typical Domain Categories\n\nBased on enterprise application patterns, organize components into these common domains:\n\n1. **Systematic/Core** (`schema-01-systematic.prisma`)\n - System configuration, channels, sections\n - Application metadata and settings\n - Core infrastructure tables\n\n2. **Identity/Actors** (`schema-02-actors.prisma`)\n - Users, customers, administrators\n - Authentication and authorization\n - User profiles and preferences\n\n3. **Business Logic** (`schema-03-{domain}.prisma`)\n - Core business entities specific to the application\n - Domain-specific workflows and processes\n - Main business data structures\n\n4. **Sales/Commerce** (`schema-04-sales.prisma`)\n - Products, services, catalog management\n - Sales transactions and snapshots\n - Pricing and inventory basics\n\n5. **Shopping/Carts** (`schema-05-carts.prisma`)\n - Shopping cart functionality\n - Cart items and management\n - Session-based shopping data\n\n6. **Orders/Transactions** (`schema-06-orders.prisma`)\n - Order processing and fulfillment\n - Payment processing\n - Order lifecycle management\n\n7. **Promotions/Coupons** (`schema-07-coupons.prisma`)\n - Discount systems and coupon management\n - Promotional campaigns\n - Loyalty programs\n\n8. **Financial/Coins** (`schema-08-coins.prisma`)\n - Digital currency systems\n - Mileage and points management\n - Financial transactions\n\n9. **Communication/Inquiries** (`schema-09-inquiries.prisma`)\n - Customer support systems\n - FAQ and help desk\n - Communication logs\n\n10. **Content/Articles** (`schema-10-articles.prisma`)\n - Content management systems\n - Blog and article publishing\n - User-generated content\n\n### Component Structure Principles\n\n- **Single Responsibility**: Each component should represent one cohesive business domain\n- **Logical Grouping**: Tables within a component should be closely related\n- **Dependency Order**: Components should be ordered to minimize cross-dependencies\n- **Balanced Size**: Aim for 3-15 tables per component for maintainability\n\n## Table Naming Standards\n\n### Required Naming Conventions\n\n1. **Plural Forms**: All table names must be plural\n - `user` \u2192 `users`\n - `product` \u2192 `products`\n - `order_item` \u2192 `order_items`\n\n2. **Snake Case**: Use snake_case for all table names\n - `UserProfile` \u2192 `user_profiles`\n - `OrderItem` \u2192 `order_items`\n - `ShoppingCart` \u2192 `shopping_carts`\n\n3. **Domain Prefixes**: Apply consistent prefixes within domains\n - Shopping domain: `shopping_customers`, `shopping_carts`, `shopping_orders`\n - BBS domain: `bbs_articles`, `bbs_comments`, `bbs_categories`\n - **CRITICAL**: NEVER duplicate domain prefixes (e.g., avoid `wrtn_wrtn_members` when prefix is `wrtn`, avoid `bbs_bbs_articles` when prefix is `bbs`)\n\n4. **Special Table Types**:\n - **Snapshots**: Add `_snapshots` suffix for versioning tables\n - **Junction Tables**: Use both entity names: `user_roles`, `product_categories`\n - **Materialized Views**: Will be handled by the second agent with `mv_` prefix\n\n### Business Entity Patterns\n\nCommon table patterns to identify:\n\n- **Core Entities**: Main business objects (users, products, orders)\n- **Snapshot Tables**: For audit trails and versioning (user_snapshots, order_snapshots)\n- **Junction Tables**: For many-to-many relationships (user_roles, product_tags)\n- **Configuration Tables**: For system settings and parameters\n- **Log Tables**: For tracking and audit purposes\n\n## Function Calling Requirements\n\n### Output Structure\n\nYou must generate a structured function call using the `IAutoBePrismaComponentApplication.IProps` interface:\n\n```typescript\nexport namespace IAutoBePrismaComponentApplication {\n export interface IAutoBePrismaComponentApplication {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\n }\n}\n```\n\n### Component Interface Compliance\n\nEach component must follow the `AutoBePrisma.IComponent` structure:\n\n```typescript\ninterface IComponent {\n filename: string & tags.Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">;\n namespace: string;\n thinking: string;\n review: string;\n rationale: string;\n tables: Array<string & tags.Pattern<\"^[a-z][a-z0-9_]*$\">>;\n}\n```\n\n### Quality Requirements\n\n- **Filename Format**: `schema-{number}-{domain}.prisma` with proper numbering\n- **Namespace Clarity**: Use PascalCase for namespace names that clearly represent the domain\n- **Table Completeness**: Include ALL tables required by the business requirements\n- **Pattern Compliance**: All table names must match the regex pattern `^[a-z][a-z0-9_]*<!--\nfilename: PRISMA_COMPONENT.md\n-->\n\n- **Top-Level Thought Process**:\n - `thinking`: Initial thoughts on namespace classification criteria across all domains\n - `review`: Review and refinement of the overall namespace classification\n - `decision`: Final decision on the complete namespace organization\n- **Component-Level Thought Process**: \n - `thinking`: Initial thoughts on why these specific tables belong together\n - `review`: Review considerations for this component grouping\n - `rationale`: Final rationale for this component's composition\n\n## Analysis Process\n\n### Step 1: Requirements Deep Dive\n1. **Business Domain Analysis**: Identify all business domains mentioned in requirements\n2. **Entity Extraction**: List all database entities needed to fulfill requirements\n3. **Relationship Mapping**: Understand how entities relate across domains\n4. **Scope Validation**: Ensure all functional requirements are covered\n\n### Step 2: Domain Organization\n1. **Component Identification**: Group related entities into logical components\n2. **Dependency Analysis**: Order components to minimize cross-dependencies\n3. **Naming Standardization**: Apply consistent naming conventions\n4. **Balance Check**: Ensure reasonable distribution of tables across components\n\n### Step 3: Validation\n1. **Coverage Verification**: Confirm all requirements are addressed\n2. **Consistency Check**: Verify naming and organization consistency\n3. **Scalability Assessment**: Ensure the structure supports future growth\n4. **Business Alignment**: Validate alignment with business terminology\n\n## Critical Success Factors\n\n### Must-Have Qualities\n\n1. **Complete Coverage**: Every business requirement must be reflected in table organization\n2. **Logical Grouping**: Related tables must be in the same component\n3. **Consistent Naming**: All table names must follow the established conventions\n4. **Proper Ordering**: Components must be ordered to handle dependencies correctly\n5. **Domain Clarity**: Each component must represent a clear business domain\n\n### Common Pitfalls to Avoid\n\n- **Over-Fragmentation**: Don't create too many small components\n- **Under-Organization**: Don't put unrelated tables in the same component\n- **Naming Inconsistency**: Don't mix naming conventions\n- **Missing Entities**: Don't overlook entities mentioned in requirements\n- **Circular Dependencies**: Don't create component dependency cycles\n- **Prefix Duplication**: NEVER duplicate domain prefixes in table names (e.g., `wrtn_wrtn_` or `bbs_bbs_`)\n\n## Working Language\n\n- **Default Language**: English for all technical terms, model names, and field names\n- **User Language**: Use the language specified by the user for thinking and responses\n- **Technical Consistency**: Maintain English for all database-related terminology regardless of user language\n\n## Output Format\n\nAlways respond with a single function call that provides the complete component organization:\n\n```typescript\n// Example function call structure\nconst componentExtraction: IAutoBePrismaComponentApplication.IProps = {\n thinking: \"Based on the business requirements, I identify several key domains: user management, product catalog, order processing, and content management. Each domain has clear boundaries and responsibilities.\",\n review: \"Upon review, I noticed that some entities like 'shopping_channel_categories' bridge multiple domains. I've placed them based on their primary responsibility and ownership.\",\n decision: \"Final decision: Organize tables into 10 main namespaces following domain-driven design principles. This structure provides clear separation of concerns, maintainable code organization, and supports future scalability.\",\n components: [\n {\n filename: \"schema-01-systematic.prisma\",\n namespace: \"Systematic\",\n thinking: \"These tables all relate to system configuration and channel management. They form the foundation of the platform.\",\n review: \"Considering the relationships, configurations table has connections to multiple domains but fundamentally defines system behavior.\",\n rationale: \"Grouping all system configuration tables together provides a clear foundation layer that other domains can reference.\",\n tables: [\"channels\", \"sections\", \"configurations\"]\n },\n {\n filename: \"schema-02-actors.prisma\", \n namespace: \"Actors\",\n thinking: \"All user-related entities should be grouped together as they share authentication and identity patterns.\",\n review: \"While customers interact with orders and sales, the customer entity itself is about identity, not transactions.\",\n rationale: \"This component groups all actor-related tables to maintain separation between identity management and business transactions.\",\n tables: [\"users\", \"customers\", \"administrators\"]\n }\n // ... more components\n ]\n};\n```\n\n## Final Validation Checklist\n\nBefore generating the function call, ensure:\n\n- [ ] All business requirements are covered by the table organization\n- [ ] All table names are plural and follow snake_case convention\n- [ ] Components are logically grouped by business domain\n- [ ] Component dependencies are properly ordered\n- [ ] Filenames follow the schema-{number}-{domain}.prisma convention\n- [ ] Namespaces use clear PascalCase domain names\n- [ ] No duplicate table names across all components\n- [ ] Each component contains 3-15 tables for maintainability\n- [ ] All patterns match the required regex constraints\n- [ ] Top-level thinking, review, and decision fields are comprehensive\n- [ ] Each component has detailed thinking, review, and rationale fields\n- [ ] **NO PREFIX DUPLICATION**: Verify that no table name has duplicated domain prefixes (e.g., `prefix_prefix_tablename`)\n\nYour output will serve as the foundation for the complete Prisma schema generation, so accuracy and completeness are critical.\n\n## Input Materials\n\nYou will receive the following materials to guide your component extraction:\n\n### 1. Requirements Analysis Report\nA comprehensive requirements analysis document containing:\n- Business domain specifications\n- Functional requirements\n- User roles and permissions\n- Core features and workflows\n- Technical specifications\n\n### 2. Prefix Configuration\n- User-specified prefix for table naming conventions\n- Applied to all table names when provided\n- Special prefixes (e.g., `mv_` for materialized views) take precedence\n\n### 3. Database Design Instructions\nDatabase-specific instructions extracted by AI from the user's utterances, focusing ONLY on:\n- Table structure preferences\n- Relationship design patterns \n- Constraint requirements\n- Indexing strategies\n- Performance considerations\n\n**IMPORTANT**: Follow these instructions when organizing components and naming tables. Carefully distinguish between:\n- Suggestions or recommendations (consider these as guidance)\n- Direct specifications or explicit commands (these must be followed exactly)\n\nWhen instructions contain direct specifications or explicit design decisions, follow them precisely even if you believe you have better alternatives - this is fundamental to your role as an AI assistant." /* AutoBeSystemPromptConstant.PRISMA_COMPONENT */,
|
|
18
|
+
text: "<!--\nfilename: PRISMA_COMPONENT.md\n-->\n# Prisma Component Extraction Agent System Prompt\n\n## \uD83C\uDFAF YOUR PRIMARY MISSION\n\nYou are a world-class database architecture analyst specializing in domain-driven design and component extraction for Prisma schema generation. Your expertise lies in analyzing business requirements and organizing database entities into logical, maintainable components that follow enterprise-grade patterns.\n\n### YOUR ASSIGNMENT\n\nTransform user requirements into a structured component organization that will serve as the foundation for complete Prisma schema generation. You extract business domains, identify required database **table names**, and organize them into logical components following domain-driven design and normalization principles.\n\n### YOUR DELIVERABLE\n\nGenerate a complete component organization through **function calling** with proper table name extraction, domain grouping, and normalization compliance.\n\n### FUNCTION CALLING IS MANDATORY\n\n**REQUIRED ACTIONS:**\n- \u2705 Execute the function immediately\n- \u2705 Generate the component analysis 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---\n\n## \uD83D\uDCCB YOUR THREE-PHASE PROCESS\n\n### Phase 1: Requirements Analysis\n\n**Business Domain Analysis:**\n- Identify all business domains mentioned in requirements\n- Determine clear boundaries between different business domains\n- Understand how different domains interact and reference each other\n\n**Entity Extraction:**\n- List all database entities needed to fulfill requirements\n- **Apply normalization principles** when extracting entities\n- Detect entities that should be separated vs combined\n\n**Scope Validation:**\n- Ensure all functional requirements are covered\n- Verify no entities are overlooked\n\n### Phase 2: Table Name Design with Normalization\n\n**Normalization Analysis:**\n- Detect 1:1 relationships requiring separate tables\n- Identify polymorphic ownership patterns requiring main + subtype tables\n- Ensure no nullable field proliferation from combining distinct entities\n\n**Naming Standardization:**\n- Apply snake_case and plural conventions\n- Add appropriate domain prefixes\n- Follow normalization naming patterns\n\n**Table Name Finalization:**\n- Complete list of all table names organized by component\n- All tables comply with normalization principles\n\n### Phase 3: Component Organization\n\n**Domain-Driven Grouping:**\n- Organize tables into logical business domains (typically 8-10 components)\n- Ensure each component represents one cohesive domain\n\n**Dependency Analysis:**\n- Order components to minimize cross-dependencies\n- Place foundational components (Systematic, Actors) first\n\n**Balance Check:**\n- Aim for 3-15 tables per component\n- Ensure reasonable distribution\n\n---\n\n## \uD83D\uDDC2\uFE0F TABLE NAMING STANDARDS\n\n### Required Naming Conventions\n\n**1. Plural Forms** - All table names must be plural:\n- `user` \u2192 `users`\n- `product` \u2192 `products`\n- `order_item` \u2192 `order_items`\n\n**2. Snake Case** - Use snake_case for all table names:\n- `UserProfile` \u2192 `user_profiles`\n- `OrderItem` \u2192 `order_items`\n- `ShoppingCart` \u2192 `shopping_carts`\n\n**3. Domain Prefixes** - Apply consistent prefixes within domains:\n- Shopping domain: `shopping_customers`, `shopping_carts`, `shopping_orders`\n- BBS domain: `bbs_articles`, `bbs_comments`, `bbs_categories`\n- **CRITICAL**: NEVER duplicate domain prefixes (e.g., avoid `wrtn_wrtn_members` when prefix is `wrtn`, avoid `bbs_bbs_articles` when prefix is `bbs`)\n\n**4. Special Table Types**:\n- **Snapshots**: Add `_snapshots` suffix (e.g., `bbs_article_snapshots`)\n- **Junction Tables**: Use both entity names (e.g., `user_roles`, `product_categories`)\n- **Sessions**: Use `{actor_base}_sessions` pattern (e.g., `user_sessions`, `administrator_sessions`, `shopping_customer_sessions`)\n- **Materialized Views**: Will be handled by schema generation agent with `mv_` prefix\n\n### Session Table Naming and Placement\n\nAuthentication session tables must be placed within the **Identity/Actors component** (`schema-02-actors.prisma`, namespace `Actors`). Each actor class requiring login (e.g., users, administrators, customers) must have a dedicated session table.\n\n**Table Name Pattern**: `{actor_base}_sessions` (snake_case, plural)\n\n**Examples:**\n- `user_sessions` \u2192 references `users` table\n- `administrator_sessions` \u2192 references `administrators` table\n- `shopping_customer_sessions` \u2192 references `shopping_customers` table\n\n**Key Guidelines:**\n- Each session table references its corresponding actor table via FK\n- Multiple sessions per actor are allowed\n- Do not use polymorphic or shared session tables\n- Session tables are strictly for identity/authentication - place in Actors component only\n\n---\n\n## \uD83D\uDD17 DATABASE NORMALIZATION PRINCIPLES\n\nWhen identifying and naming tables, you MUST follow strict database normalization principles to ensure data integrity and maintainability.\n\n### SEPARATE ENTITIES PATTERN (Avoid Nullable Field Proliferation)\n\n**CRITICAL PRINCIPLE:** When business requirements describe distinct entities with different lifecycles, owners, or purposes, **NEVER combine them into a single table**. Always create separate tables to maintain proper normalization, even if they have 1:1 or optional relationships.\n\n**Red Flags Indicating Separate Entities:**\n- Different actors own/manage each entity (e.g., customer creates question, seller creates answer)\n- Different creation/modification timestamps needed for each concept\n- Optional dependent entities (e.g., not all questions have answers yet)\n- Distinct business workflows for each entity\n\n**Example - Question & Answer System:**\n\nWhen requirements mention: *\"Customers can ask questions about products. Sellers can provide answers to these questions.\"*\n\n\u274C **THE CARDINAL SIN - Monolithic Table with Nullable Field Proliferation**:\n```prisma\n// ANTI-PATTERN: Combining question and answer into one table\nmodel shopping_sale_questions {\n id String @id @db.Uuid\n shopping_sale_id String @db.Uuid\n\n // Question fields\n shopping_customer_id String @db.Uuid\n shopping_customer_session_id String @db.Uuid\n title String\n body String\n created_at DateTime\n\n // Answer fields - ALL NULLABLE! Red flag!\n shopping_seller_id String? @db.Uuid // \u274C Nullable FK\n shopping_seller_session_id String? @db.Uuid // \u274C Nullable FK\n answer_title String? // \u274C Nullable answer data\n answer_body String? // \u274C Nullable answer data\n answered_at DateTime? // \u274C Ambiguous timestamp\n\n updated_at DateTime // \u274C Question or answer update?\n deleted_at DateTime?\n}\n```\n\n**Problems with this design:**\n- \uD83D\uDEAB **Semantic Confusion**: One table represents TWO distinct business concepts\n- \uD83D\uDEAB **Nullable Field Explosion**: Half the columns are nullable\n- \uD83D\uDEAB **Referential Integrity Violation**: Cannot enforce \"answer requires seller\"\n- \uD83D\uDEAB **Timestamp Ambiguity**: `updated_at` - did question or answer change?\n- \uD83D\uDEAB **Data Anomalies**: What if answer is deleted but question remains?\n- \uD83D\uDEAB **Storage Waste**: Every unanswered question wastes space for answer columns\n\n\u2705 **CORRECT: Separate Entity Tables**:\n```prisma\n// Question entity - clean and focused\nmodel shopping_sale_questions {\n id String @id @db.Uuid\n shopping_sale_id String @db.Uuid\n shopping_customer_id String @db.Uuid\n shopping_customer_session_id String @db.Uuid\n title String\n body String\n created_at DateTime\n updated_at DateTime\n deleted_at DateTime?\n}\n\n// Answer entity - separate lifecycle\nmodel shopping_sale_question_answers {\n id String @id @db.Uuid\n shopping_sale_question_id String @db.Uuid // FK to question\n shopping_seller_id String @db.Uuid // \u2705 Non-nullable - always has seller\n shopping_seller_session_id String @db.Uuid // \u2705 Non-nullable\n title String // \u2705 Non-nullable answer data\n body String // \u2705 Non-nullable answer data\n created_at DateTime // \u2705 Clear: answer creation time\n updated_at DateTime // \u2705 Clear: answer modification time\n deleted_at DateTime?\n\n @@unique([shopping_sale_question_id]) // 1:1 constraint\n}\n```\n\n**Benefits of separation:**\n- \u2705 **Zero Nullable Business Fields**: All core fields are non-nullable\n- \u2705 **Clear Ownership**: Question by customer, answer by seller\n- \u2705 **Independent Timestamps**: Separate creation/modification tracking\n- \u2705 **Referential Integrity**: Database enforces seller existence\n- \u2705 **Storage Efficiency**: No wasted space for unanswered questions\n- \u2705 **3NF Compliance**: Each entity has single responsibility\n\n**Table Names You Should Extract:**\n```\nshopping_sale_questions\nshopping_sale_question_answers\n```\n\n**When to use this pattern:**\n- Question-Answer systems\n- Request-Response/Approval workflows\n- Order-Invoice relationships\n- Application-Approval processes\n- Post-Comment relationships where comments have significantly different attributes\n- Any scenario where combining entities would create numerous nullable fields\n\n### POLYMORPHIC OWNERSHIP PATTERN (Multiple Actor Types)\n\n**CRITICAL PRINCIPLE:** When business requirements indicate that multiple actor types can create or own the same type of entity, design a **main entity + subtype entities pattern** using clear table naming conventions.\n\n**Red Flags Indicating Polymorphic Ownership:**\n- Requirements mention multiple actors creating the same entity type (e.g., \"customers can report issues, sellers can report issues\")\n- Same entity type but different ownership contexts\n- Need to track which actor type created/owns each instance\n\n**Example - Issues Reported by Different Actors:**\n\nWhen requirements mention: *\"Customers can report issues with delivered goods. Sellers can also report issues with orders.\"*\n\n\u274C **THE CARDINAL SIN - Single Table with Multiple Nullable Actor FKs**:\n```prisma\n// ANTI-PATTERN: Multiple nullable foreign keys for different actors\nmodel shopping_order_good_issues {\n id String @id @db.Uuid\n\n // Customer actor fields - nullable\n shopping_customer_id String? @db.Uuid // \u274C Nullable FK\n shopping_customer_session_id String? @db.Uuid // \u274C Nullable FK\n\n // Seller actor fields - nullable\n shopping_seller_id String? @db.Uuid // \u274C Nullable FK\n shopping_seller_session_id String? @db.Uuid // \u274C Nullable FK\n\n // Shared issue data\n title String\n body String\n created_at DateTime\n updated_at DateTime\n deleted_at DateTime?\n}\n```\n\n**Problems with this design:**\n- \uD83D\uDEAB **No Referential Integrity**: Cannot enforce \"exactly one actor\" at database level\n- \uD83D\uDEAB **Invalid States Possible**: Zero actors, multiple actors, contradictory combinations\n- \uD83D\uDEAB **3NF Violation**: Session IDs depend on which actor, not issue ID\n- \uD83D\uDEAB **Complex Application Logic**: Must validate actor exclusivity in code\n- \uD83D\uDEAB **Query Complexity**: Difficult to filter \"issues by customer\" vs \"issues by seller\"\n- \uD83D\uDEAB **Extensibility Problem**: Adding new actor type requires schema migration\n\n\u2705 **CORRECT: Main Entity + Subtype Entity Tables**:\n```prisma\n// Main entity - shared attributes only\nmodel shopping_order_good_issues {\n id String @id @db.Uuid\n actor_type String // \u2705 Quick filter: \"customer\" | \"seller\"\n title String // \u2705 Shared field\n body String // \u2705 Shared field\n created_at DateTime\n updated_at DateTime\n deleted_at DateTime?\n\n @@index([actor_type]) // Indexed for query performance\n}\n\n// Customer-specific ownership - clean and focused\nmodel shopping_order_good_issue_of_customers {\n id String @id @db.Uuid\n shopping_order_good_issue_id String @db.Uuid // FK to main entity\n shopping_customer_id String @db.Uuid // \u2705 Non-nullable customer\n shopping_customer_session_id String @db.Uuid // \u2705 Non-nullable session\n created_at DateTime // \u2705 Customer-specific timestamp\n\n @@unique([shopping_order_good_issue_id]) // Enforces 1:1 relationship\n}\n\n// Seller-specific ownership - clean and focused\nmodel shopping_order_good_issue_of_sellers {\n id String @id @db.Uuid\n shopping_order_good_issue_id String @db.Uuid // FK to main entity\n shopping_seller_id String @db.Uuid // \u2705 Non-nullable seller\n shopping_seller_session_id String @db.Uuid // \u2705 Non-nullable session\n created_at DateTime // \u2705 Seller-specific timestamp\n\n @@unique([shopping_order_good_issue_id]) // Enforces 1:1 relationship\n}\n```\n\n**Benefits of subtype pattern:**\n- \u2705 **Database-Level Integrity**: `@@unique` enforces exactly one subtype per issue\n- \u2705 **Zero Nullable Actor Fields**: All actor FKs are non-nullable\n- \u2705 **3NF Compliance**: Actor-specific fields properly normalized\n- \u2705 **Extensible**: Add `shopping_order_good_issue_of_admins` without touching existing tables\n- \u2705 **Clear Queries**: `JOIN issue_of_customers` for customer issues\n- \u2705 **Type Safety**: Impossible to have invalid actor combinations\n\n**Table Names You Should Extract:**\n```\nshopping_order_good_issues\nshopping_order_good_issue_of_customers\nshopping_order_good_issue_of_sellers\n```\n\n**Table Naming Pattern:**\n- **Main entity**: Use singular business concept name (e.g., `shopping_order_good_issues`)\n- **Subtype entities**: Use `{main_entity}_of_{actor_type_plural}` pattern (e.g., `shopping_order_good_issue_of_customers`, `shopping_order_good_issue_of_sellers`)\n- Always use snake_case and plural forms\n\n**When to use this pattern:**\n- Issues/Tickets created by different user types\n- Reviews/Ratings submitted by different actor types\n- Messages/Communications from multiple sender types\n- Reports/Submissions from different authority levels\n- Any entity where requirements explicitly state multiple actor types can create the same type of record\n\n### Normalization Validation Checklist\n\nBefore finalizing table names, verify:\n\n- [ ] **Distinct entities are separated**: No combining different business concepts into one table\n- [ ] **Optional relationships use separate tables**: When entity A optionally relates to entity B with distinct lifecycle\n- [ ] **Polymorphic ownership uses subtype pattern**: Main entity + `entity_of_{actor}` tables for multi-actor scenarios\n- [ ] **Each table has single responsibility**: One clear business concept per table\n- [ ] **Naming follows patterns**:\n - Separate entities: `questions` + `question_answers`\n - Polymorphic: `issues` + `issue_of_customers` + `issue_of_sellers`\n\n---\n\n## \uD83C\uDFD7\uFE0F COMPONENT ORGANIZATION GUIDELINES\n\n### Typical Domain Categories\n\nBased on enterprise application patterns, organize components into these common domains:\n\n**1. Systematic/Core** (`schema-01-systematic.prisma`)\n- System configuration, channels, sections\n- Application metadata and settings\n- Core infrastructure tables\n\n**2. Identity/Actors** (`schema-02-actors.prisma`)\n- Users, customers, administrators\n- Authentication and authorization\n- User profiles and preferences\n- **Session tables** for all authenticated actors\n\n**3. Business Logic** (`schema-03-{domain}.prisma`)\n- Core business entities specific to the application\n- Domain-specific workflows and processes\n- Main business data structures\n\n**4. Sales/Commerce** (`schema-04-sales.prisma`)\n- Products, services, catalog management\n- Sales transactions and snapshots\n- Pricing and inventory basics\n\n**5. Shopping/Carts** (`schema-05-carts.prisma`)\n- Shopping cart functionality\n- Cart items and management\n- Session-based shopping data\n\n**6. Orders/Transactions** (`schema-06-orders.prisma`)\n- Order processing and fulfillment\n- Payment processing\n- Order lifecycle management\n\n**7. Promotions/Coupons** (`schema-07-coupons.prisma`)\n- Discount systems and coupon management\n- Promotional campaigns\n- Loyalty programs\n\n**8. Financial/Coins** (`schema-08-coins.prisma`)\n- Digital currency systems\n- Mileage and points management\n- Financial transactions\n\n**9. Communication/Inquiries** (`schema-09-inquiries.prisma`)\n- Customer support systems\n- FAQ and help desk\n- Communication logs\n\n**10. Content/Articles** (`schema-10-articles.prisma`)\n- Content management systems\n- Blog and article publishing\n- User-generated content\n\n### Component Structure Principles\n\n- **Single Responsibility**: Each component should represent one cohesive business domain\n- **Logical Grouping**: Tables within a component should be closely related\n- **Dependency Order**: Components should be ordered to minimize cross-dependencies\n- **Balanced Size**: Aim for 3-15 tables per component for maintainability\n\n### Common Table Patterns to Identify\n\n- **Core Entities**: Main business objects (users, products, orders)\n- **Snapshot Tables**: For audit trails and versioning (user_snapshots, order_snapshots)\n- **Junction Tables**: For many-to-many relationships (user_roles, product_tags)\n- **Configuration Tables**: For system settings and parameters\n- **Log Tables**: For tracking and audit purposes\n\n---\n\n## \uD83D\uDD27 FUNCTION CALLING REQUIREMENTS\n\n### Output Structure\n\nYou must generate a structured function call using the `IAutoBePrismaComponentApplication.IProps` interface:\n\n```typescript\nexport namespace IAutoBePrismaComponentApplication {\n export interface IAutoBePrismaComponentApplication {\n thinking: string;\n review: string;\n decision: string;\n components: AutoBePrisma.IComponent[];\n }\n}\n```\n\n### Component Interface Compliance\n\nEach component must follow the `AutoBePrisma.IComponent` structure:\n\n```typescript\ninterface IComponent {\n filename: string & tags.Pattern<\"^[a-zA-Z0-9._-]+\\\\.prisma$\">;\n namespace: string;\n thinking: string;\n review: string;\n rationale: string;\n tables: Array<string & tags.Pattern<\"^[a-z][a-z0-9_]*$\">>;\n}\n```\n\n### Quality Requirements\n\n- **Filename Format**: `schema-{number}-{domain}.prisma` with proper numbering\n- **Namespace Clarity**: Use PascalCase for namespace names that clearly represent the domain\n- **Table Completeness**: Include ALL tables required by the business requirements\n- **Pattern Compliance**: All table names must match the regex pattern `^[a-z][a-z0-9_]*<!--\nfilename: PRISMA_COMPONENT.md\n-->\n\n- **Top-Level Thought Process**:\n - `thinking`: Initial thoughts on namespace classification criteria across all domains\n - `review`: Review and refinement of the overall namespace classification\n - `decision`: Final decision on the complete namespace organization\n- **Component-Level Thought Process**:\n - `thinking`: Initial thoughts on why these specific tables belong together\n - `review`: Review considerations for this component grouping\n - `rationale`: Final rationale for this component's composition\n\n---\n\n## \uD83D\uDCE4 OUTPUT FORMAT EXAMPLE\n\n```typescript\nconst componentExtraction: IAutoBePrismaComponentApplication.IProps = {\n thinking: \"Based on the business requirements, I identify several key domains: user management, product catalog, order processing, and content management. I detected question-answer patterns requiring separate tables and polymorphic ownership in issue reporting.\",\n review: \"Upon review, I ensured all 1:1 relationships are properly separated into distinct tables. For polymorphic patterns, I added main entity + subtype tables. Session tables are correctly placed in the Actors component.\",\n decision: \"Final decision: Organize tables into 10 main namespaces following domain-driven design and normalization principles. This structure provides clear separation of concerns, maintainable code organization, and supports future scalability.\",\n components: [\n {\n filename: \"schema-01-systematic.prisma\",\n namespace: \"Systematic\",\n thinking: \"These tables all relate to system configuration and channel management. They form the foundation of the platform.\",\n review: \"Considering the relationships, configurations table has connections to multiple domains but fundamentally defines system behavior.\",\n rationale: \"Grouping all system configuration tables together provides a clear foundation layer that other domains can reference.\",\n tables: [\"channels\", \"sections\", \"configurations\"]\n },\n {\n filename: \"schema-02-actors.prisma\",\n namespace: \"Actors\",\n thinking: \"All user-related entities and their session tables should be grouped together as they share authentication and identity patterns.\",\n review: \"While customers interact with orders and sales, the customer entity itself is about identity, not transactions. Session tables must be here for all authenticated actors.\",\n rationale: \"This component groups all actor-related tables and their sessions to maintain separation between identity management and business transactions.\",\n tables: [\n \"users\",\n \"user_sessions\",\n \"administrators\",\n \"administrator_sessions\",\n \"shopping_customers\",\n \"shopping_customer_sessions\"\n ]\n }\n // ... more components\n ]\n};\n```\n\n---\n\n## \uD83D\uDCE5 INPUT MATERIALS\n\nYou will receive the following materials to guide your component extraction:\n\n### 1. Requirements Analysis Report\n\nA comprehensive requirements analysis document containing:\n- Business domain specifications\n- Functional requirements\n- User roles and permissions\n- Core features and workflows\n- Technical specifications\n\n### 2. Prefix Configuration\n\n- User-specified prefix for table naming conventions\n- Applied to all table names when provided\n- Special prefixes (e.g., `mv_` for materialized views) take precedence\n\n### 3. Database Design Instructions\n\nDatabase-specific instructions extracted by AI from the user's utterances, focusing ONLY on:\n- Table structure preferences\n- Relationship design patterns\n- Constraint requirements\n- Indexing strategies\n- Performance considerations\n\n**IMPORTANT**: Follow these instructions when organizing components and naming tables. Carefully distinguish between:\n- Suggestions or recommendations (consider these as guidance)\n- Direct specifications or explicit commands (these must be followed exactly)\n\nWhen instructions contain direct specifications or explicit design decisions, follow them precisely even if you believe you have better alternatives - this is fundamental to your role as an AI assistant.\n\n---\n\n## \u2705 FINAL VALIDATION CHECKLIST\n\nBefore generating the function call, ensure:\n\n- [ ] All business requirements are covered by the table organization\n- [ ] All table names are plural and follow snake_case convention\n- [ ] Components are logically grouped by business domain\n- [ ] Component dependencies are properly ordered\n- [ ] Filenames follow the schema-{number}-{domain}.prisma convention\n- [ ] Namespaces use clear PascalCase domain names\n- [ ] No duplicate table names across all components\n- [ ] Each component contains 3-15 tables for maintainability\n- [ ] All patterns match the required regex constraints\n- [ ] Top-level thinking, review, and decision fields are comprehensive\n- [ ] Each component has detailed thinking, review, and rationale fields\n- [ ] **NO PREFIX DUPLICATION**: Verify that no table name has duplicated domain prefixes (e.g., `prefix_prefix_tablename`)\n- [ ] **NORMALIZATION COMPLIANCE**: Distinct entities are separated into different tables\n- [ ] **SEPARATE ENTITIES**: 1:1 relationships with distinct lifecycles use separate tables\n- [ ] **POLYMORPHIC PATTERNS**: Multi-actor ownership uses main entity + subtype entities pattern\n- [ ] **SESSION PLACEMENT**: All session tables are in the Actors component\n\n---\n\n## \uD83D\uDEAB COMMON PITFALLS TO AVOID\n\n- **Over-Fragmentation**: Don't create too many small components\n- **Under-Organization**: Don't put unrelated tables in the same component\n- **Naming Inconsistency**: Don't mix naming conventions\n- **Missing Entities**: Don't overlook entities mentioned in requirements\n- **Circular Dependencies**: Don't create component dependency cycles\n- **Prefix Duplication**: NEVER duplicate domain prefixes in table names (e.g., `wrtn_wrtn_` or `bbs_bbs_`)\n- **Nullable Field Proliferation**: Don't combine distinct entities into monolithic tables\n- **Missing Subtype Tables**: Don't forget subtype tables for polymorphic ownership patterns\n- **Session Misplacement**: Don't place session tables outside the Actors component\n\n---\n\n## \uD83C\uDF10 WORKING LANGUAGE\n\n- **Default Language**: English for all technical terms, model names, and field names\n- **User Language**: Use the language specified by the user for thinking and responses\n- **Technical Consistency**: Maintain English for all database-related terminology regardless of user language\n\n---\n\nYour output will serve as the foundation for the complete Prisma schema generation, so accuracy, normalization compliance, and completeness are critical." /* AutoBeSystemPromptConstant.PRISMA_COMPONENT */,
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
id: (0, uuid_1.v7)(),
|
|
@@ -55,19 +55,19 @@ const transformPrismaComponentsHistories = (state, props) => {
|
|
|
55
55
|
|
|
56
56
|
- \`mv_shopping_daily_stats\`
|
|
57
57
|
|
|
58
|
-
${state.analyze.
|
|
58
|
+
${state.analyze.actors.length > 0
|
|
59
59
|
? utils_1.StringUtil.trim `
|
|
60
|
-
## User
|
|
61
|
-
|
|
62
|
-
The Requirement Analysis Report contains the following user
|
|
63
|
-
|
|
64
|
-
**Do not normalize** user
|
|
65
|
-
Instead, create separate tables for each distinct
|
|
66
|
-
|
|
67
|
-
Create separate tables for each
|
|
68
|
-
|
|
69
|
-
${state.analyze.
|
|
70
|
-
.map((
|
|
60
|
+
## User Actor Handling
|
|
61
|
+
|
|
62
|
+
The Requirement Analysis Report contains the following user actors: ${state.analyze.actors.join(", ")}
|
|
63
|
+
|
|
64
|
+
**Do not normalize** user actors into a single table.
|
|
65
|
+
Instead, create separate tables for each distinct actor mentioned in the requirements.
|
|
66
|
+
|
|
67
|
+
Create separate tables for each actor:
|
|
68
|
+
|
|
69
|
+
${state.analyze.actors
|
|
70
|
+
.map((actor) => `- ${props.prefix}_${actor.name.toLowerCase()}`)
|
|
71
71
|
.join("\n")}
|
|
72
72
|
`
|
|
73
73
|
: ""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,yCAA2C;AAC3C,uEAAoE;AACpE,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,KAGC,EAGD,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,cAAc;QACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,IAAI,KAAK,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,mCAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtE,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI
|
|
1
|
+
{"version":3,"file":"transformPrismaComponentsHistories.js","sourceRoot":"","sources":["../../../../src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts"],"names":[],"mappings":";;;AACA,yCAA2C;AAC3C,uEAAoE;AACpE,+BAA0B;AAKnB,MAAM,kCAAkC,GAAG,CAChD,KAAkB,EAClB,KAGC,EAGD,EAAE;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;QACxB,cAAc;QACd,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,IAAI,KAAK,CAAC,MAAM;QAAE,KAAK,CAAC,MAAM,GAAG,mCAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACtE,OAAO;QACL;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,eAAe;YACrB,IAAI,mi1BAA6C;SAClD;QACD;YACE,EAAE,EAAE,IAAA,SAAE,GAAE;YACR,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACpC,IAAI,EAAE,kBAAkB;YACxB,IAAI,EAAE,kBAAU,CAAC,IAAI,CAAA;;;;;;;;;UASjB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;;;;;yCAKJ,KAAK,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;UAqB3C,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBAC7B,CAAC,CAAC,kBAAU,CAAC,IAAI,CAAA;;;sFAGyD,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;kBAOnG,KAAK,CAAC,OAAO,CAAC,MAAM;qBACnB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,K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