@autobe/agent 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/agent/src/AutoBeAgent.js +2 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/agent/src/{orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js → constants/AutoBeConfigConstant.js} +1 -1
- package/lib/agent/src/constants/AutoBeConfigConstant.js.map +1 -0
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js +4 -3
- package/lib/agent/src/context/AutoBeTokenUsageComponent.js.map +1 -1
- package/lib/agent/src/factory/consentFunctionCall.js +4 -4
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +13 -10
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +2 -2
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +6 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +50 -8
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +4 -4
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js +1 -1
- package/lib/agent/src/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +19 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +3 -3
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +5 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +16 -10
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +3731 -228
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +43 -63
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +1261 -1628
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +3468 -105
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +3674 -360
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/agent/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js +1385 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js +78 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.d.ts +10 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.js +59 -0
- package/lib/agent/src/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js +81 -0
- package/lib/agent/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.js.map +1 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +2 -2
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +2 -2
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +2 -2
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +22 -7
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +13 -29
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js +2 -8
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +6 -49
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +4 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +5 -3
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +206 -118
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +24 -39
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.js.map +1 -0
- package/{src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.ts → lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts} +2 -13
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js +3 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js +86 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js +55 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteDto.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js +20 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js +73 -0
- package/lib/agent/src/orchestrate/realize/utils/getRealizeWriteInputType.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js +63 -69
- package/lib/agent/src/orchestrate/realize/utils/replaceImportStatements.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.d.ts +3 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +25 -18
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js +5 -1
- package/lib/agent/src/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js +19 -0
- package/lib/agent/src/orchestrate/test/compile/getTestImportStatements.js.map +1 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js +21 -0
- package/lib/agent/src/orchestrate/test/compile/getTestTemplateCode.js.map +1 -0
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -17
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +5 -4
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +21 -2
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -0
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +123 -75
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +46 -40
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +117 -45
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js +3 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.js.map +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js +28 -0
- package/lib/agent/src/orchestrate/test/utils/getReferenceIds.js.map +1 -0
- package/lib/agent/src/structures/IAutoBeConfig.d.ts +2 -0
- package/lib/constants/AutoBeConfigConstant.d.ts +3 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +27 -27
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/index.mjs +13871 -3912
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +6 -0
- package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.d.ts +4 -0
- package/lib/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +6 -1
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +0 -38
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +48 -141
- package/lib/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.d.ts +29 -23
- package/lib/orchestrate/interface/utils/JsonSchemaFactory.d.ts +9 -0
- package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.d.ts +5 -0
- package/lib/orchestrate/interface/utils/JsonSchemaValidator.d.ts +10 -0
- package/lib/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.d.ts +2 -0
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +6 -6
- package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +5 -8
- package/lib/orchestrate/realize/internal/compileRealizeFiles.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +13 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +2 -2
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +2 -2
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.d.ts +17 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +20 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +33 -73
- package/lib/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.d.ts +5 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +36 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +33 -22
- package/lib/orchestrate/realize/utils/getRealizeWriteCodeTemplate.d.ts +31 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteDto.d.ts +4 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteImportStatements.d.ts +2 -0
- package/lib/orchestrate/realize/utils/getRealizeWriteInputType.d.ts +30 -0
- package/lib/orchestrate/realize/utils/replaceImportStatements.d.ts +6 -2
- package/lib/orchestrate/test/compile/completeTestCode.d.ts +3 -1
- package/lib/orchestrate/test/compile/getTestImportStatements.d.ts +2 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +1 -1
- package/lib/orchestrate/test/compile/getTestTemplateCode.d.ts +2 -0
- package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +2 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +48 -45
- package/lib/orchestrate/test/structures/IAutoBeTestFunctionFailure.d.ts +6 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +13 -0
- package/lib/orchestrate/test/utils/getReferenceIds.d.ts +5 -0
- package/lib/structures/IAutoBeConfig.d.ts +2 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +2 -0
- package/src/constants/AutoBeConfigConstant.ts +3 -0
- package/src/constants/AutoBeSystemPromptConstant.ts +27 -27
- package/src/context/AutoBeContext.ts +1 -0
- package/src/context/AutoBeTokenUsageComponent.ts +3 -3
- package/src/factory/consentFunctionCall.ts +2 -0
- package/src/factory/createAutoBeContext.ts +145 -136
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +6 -0
- package/src/orchestrate/analyze/structures/IAutoBeAnalyzeWriteApplication.ts +4 -0
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +19 -1
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +1 -4
- package/src/orchestrate/interface/orchestrateInterface.ts +15 -4
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +13 -5
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +58 -19
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +11 -11
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +13 -117
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +35 -93
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +74 -97
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +0 -39
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +50 -146
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +31 -27
- package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +171 -0
- package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +83 -0
- package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +66 -0
- package/src/orchestrate/interface/utils/fulfillJsonSchemaErrorMessages.ts +90 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +1 -2
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +30 -15
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +27 -49
- package/src/orchestrate/realize/internal/compileRealizeFiles.ts +4 -11
- package/src/orchestrate/realize/orchestrateRealize.ts +19 -75
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +1 -1
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +114 -25
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +2 -2
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +11 -15
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.ts +17 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +20 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +40 -74
- package/src/orchestrate/realize/structures/IAutoBeRealizeFunctionFailure.ts +9 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +45 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +33 -22
- package/src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts +97 -0
- package/src/orchestrate/realize/utils/getRealizeWriteDto.ts +64 -0
- package/src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts +29 -0
- package/src/orchestrate/realize/utils/getRealizeWriteInputType.ts +82 -0
- package/src/orchestrate/realize/utils/replaceImportStatements.ts +101 -111
- package/src/orchestrate/test/compile/completeTestCode.ts +18 -31
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +12 -0
- package/src/orchestrate/test/compile/getTestImportStatements.ts +25 -0
- package/src/orchestrate/test/compile/getTestScenarioArtifacts.ts +6 -1
- package/src/orchestrate/test/compile/getTestTemplateCode.ts +25 -0
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +26 -26
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +6 -5
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +19 -0
- package/src/orchestrate/test/orchestrateTest.ts +6 -0
- package/src/orchestrate/test/orchestrateTestCorrect.ts +44 -20
- package/src/orchestrate/test/orchestrateTestScenario.ts +52 -48
- package/src/orchestrate/test/orchestrateTestWrite.ts +20 -10
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +49 -46
- package/src/orchestrate/test/structures/IAutoBeTestFunctionFailure.ts +8 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +1 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +14 -0
- package/src/orchestrate/test/utils/getReferenceIds.ts +25 -0
- package/src/structures/IAutoBeConfig.ts +3 -0
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +0 -7
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js +0 -35
- package/lib/agent/src/orchestrate/interface/utils/validateAuthorizationSchema.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
- package/lib/agent/src/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.js.map +0 -1
- package/lib/orchestrate/interface/utils/validateAuthorizationSchema.d.ts +0 -7
- package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioApplication.d.ts +0 -38
- package/src/orchestrate/interface/utils/validateAuthorizationSchema.ts +0 -41
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AutoBeOpenApi, AutoBeRealizeAuthorization } from "@autobe/interface";
|
|
2
|
+
import { IAutoBeRealizeScenarioResult } from "../structures/IAutoBeRealizeScenarioResult";
|
|
3
|
+
/**
|
|
4
|
+
* Generate a TypeScript function template for the Realize Agent to complete
|
|
5
|
+
*
|
|
6
|
+
* This utility creates a function skeleton with proper imports, parameters, and
|
|
7
|
+
* return type that the AI needs to implement. The template includes:
|
|
8
|
+
*
|
|
9
|
+
* - Import statements for required dependencies
|
|
10
|
+
* - Function signature with all parameters
|
|
11
|
+
* - Return type specification
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Returns a template like:
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { MyGlobal } from "../MyGlobal";
|
|
17
|
+
* // ... other imports
|
|
18
|
+
*
|
|
19
|
+
* async function post__users_create(
|
|
20
|
+
* body: IUserCreateRequest
|
|
21
|
+
* ): Promise<IUserResponse> {
|
|
22
|
+
* ...
|
|
23
|
+
* }
|
|
24
|
+
* ```;
|
|
25
|
+
*
|
|
26
|
+
* @param scenario - The realize scenario containing function metadata
|
|
27
|
+
* @param operation - OpenAPI operation definition
|
|
28
|
+
* @param authorization - Authorization context if endpoint is authenticated
|
|
29
|
+
* @returns Complete TypeScript code template as a formatted string
|
|
30
|
+
*/
|
|
31
|
+
export declare function getRealizeWriteCodeTemplate(scenario: IAutoBeRealizeScenarioResult, operation: AutoBeOpenApi.IOperation, authorization: AutoBeRealizeAuthorization | null): string;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRealizeWriteCodeTemplate = getRealizeWriteCodeTemplate;
|
|
4
|
+
const utils_1 = require("@autobe/utils");
|
|
5
|
+
const getRealizeWriteImportStatements_1 = require("./getRealizeWriteImportStatements");
|
|
6
|
+
/**
|
|
7
|
+
* Generate a TypeScript function template for the Realize Agent to complete
|
|
8
|
+
*
|
|
9
|
+
* This utility creates a function skeleton with proper imports, parameters, and
|
|
10
|
+
* return type that the AI needs to implement. The template includes:
|
|
11
|
+
*
|
|
12
|
+
* - Import statements for required dependencies
|
|
13
|
+
* - Function signature with all parameters
|
|
14
|
+
* - Return type specification
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Returns a template like:
|
|
18
|
+
* ```typescript
|
|
19
|
+
* import { MyGlobal } from "../MyGlobal";
|
|
20
|
+
* // ... other imports
|
|
21
|
+
*
|
|
22
|
+
* async function post__users_create(
|
|
23
|
+
* body: IUserCreateRequest
|
|
24
|
+
* ): Promise<IUserResponse> {
|
|
25
|
+
* ...
|
|
26
|
+
* }
|
|
27
|
+
* ```;
|
|
28
|
+
*
|
|
29
|
+
* @param scenario - The realize scenario containing function metadata
|
|
30
|
+
* @param operation - OpenAPI operation definition
|
|
31
|
+
* @param authorization - Authorization context if endpoint is authenticated
|
|
32
|
+
* @returns Complete TypeScript code template as a formatted string
|
|
33
|
+
*/
|
|
34
|
+
function getRealizeWriteCodeTemplate(scenario, operation, authorization) {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
// Collect all function parameters in order
|
|
37
|
+
const functionParameters = [];
|
|
38
|
+
// Add authentication parameter if needed (e.g., user: IUser, admin: IAdmin)
|
|
39
|
+
if (authorization && authorization.role.name) {
|
|
40
|
+
// Debug: Log the values to check what's being used
|
|
41
|
+
const authParameter = `${authorization.role.name}: ${authorization.payload.name}`;
|
|
42
|
+
functionParameters.push(authParameter);
|
|
43
|
+
}
|
|
44
|
+
// Add path parameters (e.g., id, postId, etc.)
|
|
45
|
+
const pathParameters = operation.parameters.map((param) => {
|
|
46
|
+
const paramType = param.schema.type;
|
|
47
|
+
const paramFormat = "format" in param.schema
|
|
48
|
+
? ` & tags.Format<'${param.schema.format}'>`
|
|
49
|
+
: "";
|
|
50
|
+
return `${param.name}: ${paramType}${paramFormat}`;
|
|
51
|
+
});
|
|
52
|
+
functionParameters.push(...pathParameters);
|
|
53
|
+
// Add request body parameter if present
|
|
54
|
+
if ((_a = operation.requestBody) === null || _a === void 0 ? void 0 : _a.typeName) {
|
|
55
|
+
const bodyParameter = `body: ${operation.requestBody.typeName}`;
|
|
56
|
+
functionParameters.push(bodyParameter);
|
|
57
|
+
}
|
|
58
|
+
// Format parameters for props object
|
|
59
|
+
const hasParameters = functionParameters.length > 0;
|
|
60
|
+
let formattedSignature;
|
|
61
|
+
if (hasParameters) {
|
|
62
|
+
const propsFields = functionParameters
|
|
63
|
+
.map((param) => ` ${param}`)
|
|
64
|
+
.join(";\n");
|
|
65
|
+
formattedSignature = `props: {\n${propsFields};\n}`;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
formattedSignature = "";
|
|
69
|
+
}
|
|
70
|
+
// Determine return type
|
|
71
|
+
const returnType = (_c = (_b = operation.responseBody) === null || _b === void 0 ? void 0 : _b.typeName) !== null && _c !== void 0 ? _c : "void";
|
|
72
|
+
// Generate the complete template
|
|
73
|
+
return utils_1.StringUtil.trim `
|
|
74
|
+
Complete the code below, disregard the import part and return only the function part.
|
|
75
|
+
|
|
76
|
+
\`\`\`typescript
|
|
77
|
+
${(0, getRealizeWriteImportStatements_1.getRealizeWriteImportStatements)(operation).join("\n")}
|
|
78
|
+
|
|
79
|
+
// ONLY YOU HAVE TO WRITE THIS, AND USE IMPORTED.
|
|
80
|
+
export async function ${scenario.functionName}(${formattedSignature}): Promise<${returnType}> {
|
|
81
|
+
...
|
|
82
|
+
}
|
|
83
|
+
\`\`\`
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=getRealizeWriteCodeTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRealizeWriteCodeTemplate.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/getRealizeWriteCodeTemplate.ts"],"names":[],"mappings":";;AAkCA,kEA8DC;AA/FD,yCAA2C;AAG3C,uFAAoF;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,2BAA2B,CACzC,QAAsC,EACtC,SAAmC,EACnC,aAAgD;;IAEhD,2CAA2C;IAC3C,MAAM,kBAAkB,GAAa,EAAE,CAAC;IAExC,4EAA4E;IAC5E,IAAI,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC7C,mDAAmD;QACnD,MAAM,aAAa,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClF,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC;IAED,+CAA+C;IAC/C,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACxD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QACpC,MAAM,WAAW,GACf,QAAQ,IAAI,KAAK,CAAC,MAAM;YACtB,CAAC,CAAC,mBAAmB,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI;YAC5C,CAAC,CAAC,EAAE,CAAC;QACT,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,GAAG,WAAW,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IACH,kBAAkB,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC;IAE3C,wCAAwC;IACxC,IAAI,MAAA,SAAS,CAAC,WAAW,0CAAE,QAAQ,EAAE,CAAC;QACpC,MAAM,aAAa,GAAG,SAAS,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;QAChE,kBAAkB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACzC,CAAC;IAED,qCAAqC;IACrC,MAAM,aAAa,GAAG,kBAAkB,CAAC,MAAM,GAAG,CAAC,CAAC;IAEpD,IAAI,kBAA0B,CAAC;IAC/B,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,kBAAkB;aACnC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;aAC5B,IAAI,CAAC,KAAK,CAAC,CAAC;QAEf,kBAAkB,GAAG,aAAa,WAAW,MAAM,CAAC;IACtD,CAAC;SAAM,CAAC;QACN,kBAAkB,GAAG,EAAE,CAAC;IAC1B,CAAC;IAED,wBAAwB;IACxB,MAAM,UAAU,GAAG,MAAA,MAAA,SAAS,CAAC,YAAY,0CAAE,QAAQ,mCAAI,MAAM,CAAC;IAE9D,iCAAiC;IACjC,OAAO,kBAAU,CAAC,IAAI,CAAA;;;;MAIlB,IAAA,iEAA+B,EAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;4BAG/B,QAAQ,CAAC,YAAY,IAAI,kBAAkB,cAAc,UAAU;;;;GAI5F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
3
|
+
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
4
|
+
export declare function getRealizeWriteDto<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, operation: AutoBeOpenApi.IOperation): Promise<Record<string, string>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getRealizeWriteDto = getRealizeWriteDto;
|
|
13
|
+
const openapi_1 = require("@samchon/openapi");
|
|
14
|
+
function getRealizeWriteDto(ctx, operation) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
const document = filterDocument(operation, ctx.state().interface.document);
|
|
17
|
+
const compiler = yield ctx.compiler();
|
|
18
|
+
const entries = Object.entries(yield compiler.interface.write(document));
|
|
19
|
+
const filter = (prefix, exclude) => {
|
|
20
|
+
const result = entries.filter(([key]) => key.startsWith(prefix) === true);
|
|
21
|
+
return Object.fromEntries(exclude
|
|
22
|
+
? result.filter(([key]) => key.startsWith(exclude) === false)
|
|
23
|
+
: result);
|
|
24
|
+
};
|
|
25
|
+
const dto = filter("src/api/structures");
|
|
26
|
+
return dto;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function filterDocument(operation, document) {
|
|
30
|
+
const components = {
|
|
31
|
+
authorization: document.components.authorization,
|
|
32
|
+
schemas: {},
|
|
33
|
+
};
|
|
34
|
+
const visit = (typeName) => {
|
|
35
|
+
openapi_1.OpenApiTypeChecker.visit({
|
|
36
|
+
components: document.components,
|
|
37
|
+
schema: { $ref: `#/components/schemas/${typeName}` },
|
|
38
|
+
closure: (s) => {
|
|
39
|
+
if (openapi_1.OpenApiTypeChecker.isReference(s)) {
|
|
40
|
+
const key = s.$ref.split("/").pop();
|
|
41
|
+
components.schemas[key] = document.components.schemas[key];
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
if (operation.requestBody)
|
|
47
|
+
visit(operation.requestBody.typeName);
|
|
48
|
+
if (operation.responseBody)
|
|
49
|
+
visit(operation.responseBody.typeName);
|
|
50
|
+
return {
|
|
51
|
+
operations: [operation],
|
|
52
|
+
components,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=getRealizeWriteDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRealizeWriteDto.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/getRealizeWriteDto.ts"],"names":[],"mappings":";;;;;;;;;;;AAKA,gDA2BC;AA/BD,8CAAkE;AAIlE,SAAsB,kBAAkB,CACtC,GAAyB,EACzB,SAAmC;;QAEnC,MAAM,QAAQ,GAA4B,cAAc,CACtD,SAAS,EACT,GAAG,CAAC,KAAK,EAAE,CAAC,SAAU,CAAC,QAAQ,CAChC,CAAC;QAEF,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,MAAM,OAAO,GAAuB,MAAM,CAAC,OAAO,CAChD,MAAM,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzC,CAAC;QAEF,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,OAAgB,EAAE,EAAE;YAClD,MAAM,MAAM,GAAuB,OAAO,CAAC,MAAM,CAC/C,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI,CAC3C,CAAC;YACF,OAAO,MAAM,CAAC,WAAW,CACvB,OAAO;gBACL,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,KAAK,CAAC;gBAC7D,CAAC,CAAC,MAAM,CACX,CAAC;QACJ,CAAC,CAAC;QAEF,MAAM,GAAG,GAA2B,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACjE,OAAO,GAAG,CAAC;IACb,CAAC;CAAA;AAED,SAAS,cAAc,CACrB,SAAmC,EACnC,QAAiC;IAEjC,MAAM,UAAU,GAA8B;QAC5C,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,aAAa;QAChD,OAAO,EAAE,EAAE;KACZ,CAAC;IAEF,MAAM,KAAK,GAAG,CAAC,QAAgB,EAAE,EAAE;QACjC,4BAAkB,CAAC,KAAK,CAAC;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,MAAM,EAAE,EAAE,IAAI,EAAE,wBAAwB,QAAQ,EAAE,EAAE;YACpD,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,IAAI,4BAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;oBACtC,MAAM,GAAG,GAAW,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;oBAC7C,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;SACF,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,SAAS,CAAC,WAAW;QAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACjE,IAAI,SAAS,CAAC,YAAY;QAAE,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEnE,OAAO;QACL,UAAU,EAAE,CAAC,SAAS,CAAC;QACvB,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRealizeWriteImportStatements = getRealizeWriteImportStatements;
|
|
4
|
+
function getRealizeWriteImportStatements(operation) {
|
|
5
|
+
const typeReferences = Array.from(new Set([operation.requestBody, operation.responseBody]
|
|
6
|
+
.filter((el) => el !== null)
|
|
7
|
+
.map((el) => el.typeName.split(".")[0])));
|
|
8
|
+
// Build the standard imports
|
|
9
|
+
const imports = [
|
|
10
|
+
'import jwt from "jsonwebtoken";',
|
|
11
|
+
'import { MyGlobal } from "../MyGlobal";',
|
|
12
|
+
'import typia, { tags } from "typia";',
|
|
13
|
+
'import { Prisma } from "@prisma/client";',
|
|
14
|
+
'import { v4 } from "uuid";',
|
|
15
|
+
'import { toISOStringSafe } from "../util/toISOStringSafe"',
|
|
16
|
+
...typeReferences.map((ref) => `import { ${ref} } from "@ORGANIZATION/PROJECT-api/lib/structures/${ref}";`),
|
|
17
|
+
];
|
|
18
|
+
return imports;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=getRealizeWriteImportStatements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRealizeWriteImportStatements.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/getRealizeWriteImportStatements.ts"],"names":[],"mappings":";;AAEA,0EA0BC;AA1BD,SAAgB,+BAA+B,CAC7C,SAAmC;IAEnC,MAAM,cAAc,GAAa,KAAK,CAAC,IAAI,CACzC,IAAI,GAAG,CACL,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,YAAY,CAAC;SAC5C,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;SAC3B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAC3C,CACF,CAAC;IAEF,6BAA6B;IAC7B,MAAM,OAAO,GAAG;QACd,iCAAiC;QACjC,yCAAyC;QACzC,sCAAsC;QACtC,0CAA0C;QAC1C,4BAA4B;QAC5B,2DAA2D;QAC3D,GAAG,cAAc,CAAC,GAAG,CACnB,CAAC,GAAG,EAAE,EAAE,CACN,YAAY,GAAG,qDAAqD,GAAG,IAAI,CAC9E;KACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AutoBeOpenApi, AutoBeRealizeAuthorization } from "@autobe/interface";
|
|
2
|
+
/**
|
|
3
|
+
* Generate TypeScript type definition string for provider function props
|
|
4
|
+
*
|
|
5
|
+
* This utility creates the exact props interface that the Realize Agent's
|
|
6
|
+
* generated provider functions must accept. It combines:
|
|
7
|
+
*
|
|
8
|
+
* - Authentication context (user/admin/member from authorization)
|
|
9
|
+
* - URL path parameters (e.g., id, boardId, postId)
|
|
10
|
+
* - Request body type (if applicable)
|
|
11
|
+
*
|
|
12
|
+
* The output is injected into REALIZE_WRITE_ARTIFACT.md template to tell the AI
|
|
13
|
+
* exactly what parameter type the function should accept.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // For DELETE /posts/:id (authenticated)
|
|
17
|
+
* // Returns: "props: { user: IUser; id: string & tags.Format<'uuid'>; }"
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // For GET /public/info (no auth, no params)
|
|
21
|
+
* // Returns: "// No props parameter needed - function should have no parameters"
|
|
22
|
+
*
|
|
23
|
+
* @param operation - OpenAPI operation definition containing parameters and
|
|
24
|
+
* auth requirements
|
|
25
|
+
* @param authorization - Authorization context with user/role information (if
|
|
26
|
+
* authenticated endpoint)
|
|
27
|
+
* @returns TypeScript interface string like "props: { user: IUser; id: string;
|
|
28
|
+
* body: IRequest; }"
|
|
29
|
+
*/
|
|
30
|
+
export declare function getRealizeWriteInputType(operation: AutoBeOpenApi.IOperation, authorization: AutoBeRealizeAuthorization | null): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRealizeWriteInputType = getRealizeWriteInputType;
|
|
4
|
+
const utils_1 = require("@autobe/utils");
|
|
5
|
+
/**
|
|
6
|
+
* Generate TypeScript type definition string for provider function props
|
|
7
|
+
*
|
|
8
|
+
* This utility creates the exact props interface that the Realize Agent's
|
|
9
|
+
* generated provider functions must accept. It combines:
|
|
10
|
+
*
|
|
11
|
+
* - Authentication context (user/admin/member from authorization)
|
|
12
|
+
* - URL path parameters (e.g., id, boardId, postId)
|
|
13
|
+
* - Request body type (if applicable)
|
|
14
|
+
*
|
|
15
|
+
* The output is injected into REALIZE_WRITE_ARTIFACT.md template to tell the AI
|
|
16
|
+
* exactly what parameter type the function should accept.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // For DELETE /posts/:id (authenticated)
|
|
20
|
+
* // Returns: "props: { user: IUser; id: string & tags.Format<'uuid'>; }"
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // For GET /public/info (no auth, no params)
|
|
24
|
+
* // Returns: "// No props parameter needed - function should have no parameters"
|
|
25
|
+
*
|
|
26
|
+
* @param operation - OpenAPI operation definition containing parameters and
|
|
27
|
+
* auth requirements
|
|
28
|
+
* @param authorization - Authorization context with user/role information (if
|
|
29
|
+
* authenticated endpoint)
|
|
30
|
+
* @returns TypeScript interface string like "props: { user: IUser; id: string;
|
|
31
|
+
* body: IRequest; }"
|
|
32
|
+
*/
|
|
33
|
+
function getRealizeWriteInputType(operation, authorization) {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
const functionParameterFields = [];
|
|
36
|
+
// Add authentication field (user/admin/member) if endpoint requires auth
|
|
37
|
+
const hasAuthentication = authorization && operation.authorizationRole;
|
|
38
|
+
if (hasAuthentication) {
|
|
39
|
+
const authFieldName = operation.authorizationRole;
|
|
40
|
+
const authFieldType = authorization.payload.name;
|
|
41
|
+
functionParameterFields.push(`${authFieldName}: ${authFieldType};`);
|
|
42
|
+
}
|
|
43
|
+
// Add URL path parameters (e.g., /posts/:id → id parameter)
|
|
44
|
+
const pathParameters = operation.parameters;
|
|
45
|
+
pathParameters.forEach((pathParam) => {
|
|
46
|
+
const paramName = pathParam.name;
|
|
47
|
+
const paramType = pathParam.schema.type;
|
|
48
|
+
const paramFormat = "format" in pathParam.schema
|
|
49
|
+
? ` & tags.Format<'${pathParam.schema.format}'>`
|
|
50
|
+
: "";
|
|
51
|
+
const parameterField = `${paramName}: ${paramType}${paramFormat};`;
|
|
52
|
+
functionParameterFields.push(parameterField);
|
|
53
|
+
});
|
|
54
|
+
// Add request body if present (POST/PUT/PATCH operations)
|
|
55
|
+
const hasRequestBody = (_a = operation.requestBody) === null || _a === void 0 ? void 0 : _a.typeName;
|
|
56
|
+
if (hasRequestBody) {
|
|
57
|
+
const bodyTypeName = (_b = operation.requestBody) === null || _b === void 0 ? void 0 : _b.typeName;
|
|
58
|
+
functionParameterFields.push(`body: ${bodyTypeName};`);
|
|
59
|
+
}
|
|
60
|
+
// Format as TypeScript props interface or indicate no parameters needed
|
|
61
|
+
const hasParameters = functionParameterFields.length > 0;
|
|
62
|
+
if (!hasParameters) {
|
|
63
|
+
return `// No props parameter needed - function should have no parameters`;
|
|
64
|
+
}
|
|
65
|
+
const formattedFields = functionParameterFields
|
|
66
|
+
.map((field) => ` ${field}`)
|
|
67
|
+
.join("\n");
|
|
68
|
+
return utils_1.StringUtil.trim `
|
|
69
|
+
props: {
|
|
70
|
+
${formattedFields}
|
|
71
|
+
}`;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=getRealizeWriteInputType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getRealizeWriteInputType.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/getRealizeWriteInputType.ts"],"names":[],"mappings":";;AA+BA,4DAkDC;AAhFD,yCAA2C;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,wBAAwB,CACtC,SAAmC,EACnC,aAAgD;;IAEhD,MAAM,uBAAuB,GAAa,EAAE,CAAC;IAE7C,yEAAyE;IACzE,MAAM,iBAAiB,GAAG,aAAa,IAAI,SAAS,CAAC,iBAAiB,CAAC;IACvE,IAAI,iBAAiB,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,SAAS,CAAC,iBAAiB,CAAC;QAClD,MAAM,aAAa,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC;QACjD,uBAAuB,CAAC,IAAI,CAAC,GAAG,aAAa,KAAK,aAAa,GAAG,CAAC,CAAC;IACtE,CAAC;IAED,4DAA4D;IAC5D,MAAM,cAAc,GAAG,SAAS,CAAC,UAAU,CAAC;IAC5C,cAAc,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC;QACjC,MAAM,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,MAAM,WAAW,GACf,QAAQ,IAAI,SAAS,CAAC,MAAM;YAC1B,CAAC,CAAC,mBAAmB,SAAS,CAAC,MAAM,CAAC,MAAM,IAAI;YAChD,CAAC,CAAC,EAAE,CAAC;QAET,MAAM,cAAc,GAAG,GAAG,SAAS,KAAK,SAAS,GAAG,WAAW,GAAG,CAAC;QACnE,uBAAuB,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,0DAA0D;IAC1D,MAAM,cAAc,GAAG,MAAA,SAAS,CAAC,WAAW,0CAAE,QAAQ,CAAC;IACvD,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,YAAY,GAAG,MAAA,SAAS,CAAC,WAAW,0CAAE,QAAQ,CAAC;QACrD,uBAAuB,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,CAAC,CAAC;IACzD,CAAC;IAED,wEAAwE;IACxE,MAAM,aAAa,GAAG,uBAAuB,CAAC,MAAM,GAAG,CAAC,CAAC;IAEzD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,mEAAmE,CAAC;IAC7E,CAAC;IAED,MAAM,eAAe,GAAG,uBAAuB;SAC5C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC;SAC5B,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,OAAO,kBAAU,CAAC,IAAI,CAAA;;MAElB,eAAe;MACf,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
1
2
|
import { ILlmSchema } from "@samchon/openapi";
|
|
2
3
|
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
export declare function replaceImportStatements<Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, props: {
|
|
5
|
+
operation: AutoBeOpenApi.IOperation;
|
|
6
|
+
code: string;
|
|
7
|
+
decoratorType?: string;
|
|
8
|
+
}): Promise<string>;
|
|
@@ -10,74 +10,68 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.replaceImportStatements = replaceImportStatements;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
// Remove
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
// Apply final beautification
|
|
77
|
-
code = yield compiler.typescript.beautify(code);
|
|
78
|
-
code = code.replaceAll("typia.tags.assert", "typia.assert");
|
|
79
|
-
return code;
|
|
80
|
-
});
|
|
81
|
-
};
|
|
13
|
+
const getRealizeWriteImportStatements_1 = require("./getRealizeWriteImportStatements");
|
|
14
|
+
function replaceImportStatements(ctx, props) {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
let { operation, code, decoratorType } = props;
|
|
17
|
+
const typeReferences = Array.from(new Set([operation.requestBody, operation.responseBody]
|
|
18
|
+
.filter((el) => el !== null)
|
|
19
|
+
.map((el) => el.typeName.split(".")[0])));
|
|
20
|
+
const compiler = yield ctx.compiler();
|
|
21
|
+
code = yield compiler.typescript.beautify(code);
|
|
22
|
+
// Remove existing import statements using flexible regex patterns
|
|
23
|
+
code = code
|
|
24
|
+
.replace(/import\s*{\s*MyGlobal\s*}\s*from\s*["']\.\.\/MyGlobal["']\s*;?\s*/gm, "")
|
|
25
|
+
.replace(/import\s+typia\s*,\s*{\s*tags\s*}\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
26
|
+
.replace(/import\s*{\s*tags\s*}\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
27
|
+
.replace(/import\s*{\s*tags\s*,\s*typia\s*}\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
28
|
+
.replace(/import\s+typia\s*from\s*["']typia["']\s*;?\s*/gm, "")
|
|
29
|
+
.replace(/import\s*{\s*Prisma\s*}\s*from\s*["']@prisma\/client["']\s*;?\s*/gm, "")
|
|
30
|
+
.replace(/import\s*{\s*v4\s*}\s*from\s*["']uuid["']\s*;?\s*/gm, "")
|
|
31
|
+
.replace(/import\s*{\s*toISOStringSafe\s*}\s*from\s*["']\.\.\/util\/toISOStringSafe["']\s*;?\s*/gm, "")
|
|
32
|
+
// Remove JWT import if it exists (to prevent duplication)
|
|
33
|
+
.replace(/import\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm, "")
|
|
34
|
+
.replace(/import\s*\*\s*as\s+jwt\s+from\s*["']jsonwebtoken["']\s*;?\s*/gm, "");
|
|
35
|
+
// Remove any existing API structure imports
|
|
36
|
+
// Pattern 1: ../api/structures path
|
|
37
|
+
code = code.replace(/import\s*(?:type\s*)?{\s*[^}]+\s*}\s*from\s*["']\.\.\/api\/structures\/[^"']+["']\s*;?\s*/gm, "");
|
|
38
|
+
// Pattern 2: @ORGANIZATION/PROJECT-api/lib/structures path
|
|
39
|
+
code = code.replace(/import\s*(?:type\s*)?{\s*[^}]+\s*}\s*from\s*["']@ORGANIZATION\/PROJECT-api\/lib\/structures\/[^"']+["']\s*;?\s*/gm, "");
|
|
40
|
+
// Remove specific type imports that match our typeReferences
|
|
41
|
+
for (const ref of typeReferences) {
|
|
42
|
+
// Remove any import of this specific type from any path
|
|
43
|
+
const typeImportRegex = new RegExp(`import\\s*(?:type\\s*)?{\\s*${ref}\\s*}\\s*from\\s*["'][^"']+["']\\s*;?\\s*`, "gm");
|
|
44
|
+
code = code.replace(typeImportRegex, "");
|
|
45
|
+
}
|
|
46
|
+
// Remove any existing decoratorType imports if LLM mistakenly added them
|
|
47
|
+
if (decoratorType) {
|
|
48
|
+
const decoratorTypeRegex = new RegExp(`import\\s*(?:type\\s*)?{\\s*${decoratorType}\\s*}\\s*from\\s*["']\\.\\.\/decorators\/payload\/${decoratorType}["']\\s*;?\\s*`, "gm");
|
|
49
|
+
code = code.replace(decoratorTypeRegex, "");
|
|
50
|
+
}
|
|
51
|
+
// Build the standard imports
|
|
52
|
+
const imports = (0, getRealizeWriteImportStatements_1.getRealizeWriteImportStatements)(operation);
|
|
53
|
+
// Only add decoratorType import if it exists
|
|
54
|
+
if (decoratorType) {
|
|
55
|
+
imports.push(`import { ${decoratorType} } from "../decorators/payload/${decoratorType}"`);
|
|
56
|
+
}
|
|
57
|
+
code = [...imports, "", code].join("\n");
|
|
58
|
+
// Clean up formatting issues
|
|
59
|
+
code =
|
|
60
|
+
code
|
|
61
|
+
// Remove lines with only whitespace
|
|
62
|
+
.replace(/^\s+$/gm, "")
|
|
63
|
+
// Replace 3+ consecutive newlines with exactly 2 newlines
|
|
64
|
+
.replace(/\n{3,}/g, "\n\n")
|
|
65
|
+
// Ensure proper spacing after import section
|
|
66
|
+
.replace(/(import.*?;)(\s*)(\n(?!import|\s*$))/g, "$1\n\n$3")
|
|
67
|
+
// Trim and ensure single trailing newline
|
|
68
|
+
.trim() + "\n";
|
|
69
|
+
// fix escaped codes
|
|
70
|
+
code = code.replace(/\\n/g, "\n").replace(/\\"/g, '"').replace(/\\'/g, "'");
|
|
71
|
+
// Apply final beautification
|
|
72
|
+
code = yield compiler.typescript.beautify(code);
|
|
73
|
+
code = code.replaceAll("typia.tags.assert", "typia.assert");
|
|
74
|
+
return code;
|
|
75
|
+
});
|
|
82
76
|
}
|
|
83
77
|
//# sourceMappingURL=replaceImportStatements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceImportStatements.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/replaceImportStatements.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,
|
|
1
|
+
{"version":3,"file":"replaceImportStatements.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/realize/utils/replaceImportStatements.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,0DAoHC;AAtHD,uFAAoF;AAEpF,SAAsB,uBAAuB,CAC3C,GAAyB,EACzB,KAIC;;QAED,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;QAE/C,MAAM,cAAc,GAAa,KAAK,CAAC,IAAI,CACzC,IAAI,GAAG,CACL,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,YAAY,CAAC;aAC5C,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;aAC3B,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAC3C,CACF,CAAC;QAEF,MAAM,QAAQ,GAAoB,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACvD,IAAI,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChD,kEAAkE;QAClE,IAAI,GAAG,IAAI;aACR,OAAO,CACN,qEAAqE,EACrE,EAAE,CACH;aACA,OAAO,CACN,oEAAoE,EACpE,EAAE,CACH;aACA,OAAO,CAAC,wDAAwD,EAAE,EAAE,CAAC;aACrE,OAAO,CACN,oEAAoE,EACpE,EAAE,CACH;aACA,OAAO,CAAC,iDAAiD,EAAE,EAAE,CAAC;aAC9D,OAAO,CACN,oEAAoE,EACpE,EAAE,CACH;aACA,OAAO,CAAC,qDAAqD,EAAE,EAAE,CAAC;aAClE,OAAO,CACN,yFAAyF,EACzF,EAAE,CACH;YACD,0DAA0D;aACzD,OAAO,CAAC,sDAAsD,EAAE,EAAE,CAAC;aACnE,OAAO,CACN,gEAAgE,EAChE,EAAE,CACH,CAAC;QAEJ,4CAA4C;QAC5C,oCAAoC;QACpC,IAAI,GAAG,IAAI,CAAC,OAAO,CACjB,6FAA6F,EAC7F,EAAE,CACH,CAAC;QACF,2DAA2D;QAC3D,IAAI,GAAG,IAAI,CAAC,OAAO,CACjB,mHAAmH,EACnH,EAAE,CACH,CAAC;QAEF,6DAA6D;QAC7D,KAAK,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;YACjC,wDAAwD;YACxD,MAAM,eAAe,GAAG,IAAI,MAAM,CAChC,+BAA+B,GAAG,2CAA2C,EAC7E,IAAI,CACL,CAAC;YACF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,yEAAyE;QACzE,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,kBAAkB,GAAG,IAAI,MAAM,CACnC,+BAA+B,aAAa,qDAAqD,aAAa,gBAAgB,EAC9H,IAAI,CACL,CAAC;YACF,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAC9C,CAAC;QAED,6BAA6B;QAC7B,MAAM,OAAO,GAAG,IAAA,iEAA+B,EAAC,SAAS,CAAC,CAAC;QAE3D,6CAA6C;QAC7C,IAAI,aAAa,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CACV,YAAY,aAAa,kCAAkC,aAAa,GAAG,CAC5E,CAAC;QACJ,CAAC;QAED,IAAI,GAAG,CAAC,GAAG,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzC,6BAA6B;QAC7B,IAAI;YACF,IAAI;gBACF,oCAAoC;iBACnC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;gBACvB,0DAA0D;iBACzD,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;gBAC3B,6CAA6C;iBAC5C,OAAO,CAAC,uCAAuC,EAAE,UAAU,CAAC;gBAC7D,0CAA0C;iBACzC,IAAI,EAAE,GAAG,IAAI,CAAC;QAEnB,oBAAoB;QACpB,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAE5E,6BAA6B;QAC7B,IAAI,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEhD,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC;IACd,CAAC;CAAA"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
import { ILlmSchema } from "@samchon/openapi";
|
|
2
|
+
import { AutoBeContext } from "../../../context/AutoBeContext";
|
|
1
3
|
import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
|
|
2
|
-
export declare
|
|
4
|
+
export declare const completeTestCode: <Model extends ILlmSchema.Model>(ctx: AutoBeContext<Model>, artifacts: IAutoBeTestScenarioArtifacts, code: string) => Promise<string>;
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.completeTestCode =
|
|
12
|
+
exports.completeTestCode = void 0;
|
|
4
13
|
const utils_1 = require("@autobe/utils");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
code =
|
|
9
|
-
code = code
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
${
|
|
17
|
-
.map((ref) => `import type { ${ref} } from "@ORGANIZATION/PROJECT-api/lib/structures/${ref}";`)
|
|
18
|
-
.join("\n")}
|
|
14
|
+
const getTestImportStatements_1 = require("./getTestImportStatements");
|
|
15
|
+
const completeTestCode = (ctx, artifacts, code) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const compiler = yield ctx.compiler();
|
|
17
|
+
code = yield compiler.typescript.beautify(code);
|
|
18
|
+
code = code
|
|
19
|
+
.split("\r\n")
|
|
20
|
+
.join("\n")
|
|
21
|
+
.split("\n")
|
|
22
|
+
.filter((str) => str.trim().startsWith("import") === false)
|
|
23
|
+
.join("\n");
|
|
24
|
+
return yield compiler.typescript.beautify(utils_1.StringUtil.trim `
|
|
25
|
+
${(0, getTestImportStatements_1.getTestImportStatements)(artifacts.document)}
|
|
19
26
|
|
|
20
27
|
${code}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
`);
|
|
29
|
+
});
|
|
30
|
+
exports.completeTestCode = completeTestCode;
|
|
24
31
|
//# sourceMappingURL=completeTestCode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completeTestCode.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/compile/completeTestCode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"completeTestCode.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/compile/completeTestCode.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAA2C;AAK3C,uEAAoE;AAE7D,MAAM,gBAAgB,GAAG,CAC9B,GAAyB,EACzB,SAAuC,EACvC,IAAY,EACK,EAAE;IACnB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;IACtC,IAAI,GAAG,MAAM,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,GAAG,IAAI;SACR,KAAK,CAAC,MAAM,CAAC;SACb,IAAI,CAAC,IAAI,CAAC;SACV,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC;SAC1D,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,OAAO,MAAM,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,kBAAU,CAAC,IAAI,CAAA;MACrD,IAAA,iDAAuB,EAAC,SAAS,CAAC,QAAQ,CAAC;;MAE3C,IAAI;GACP,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B"}
|
|
@@ -25,6 +25,10 @@ const singleton = new tstl_1.Singleton((compiler) => __awaiter(void 0, void 0, v
|
|
|
25
25
|
throw new Error(`File not found: ${location}`);
|
|
26
26
|
return { [location]: content };
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
const filter = (closure) => {
|
|
29
|
+
const entries = Object.entries(records).filter(([key]) => closure(key));
|
|
30
|
+
return Object.fromEntries(entries);
|
|
31
|
+
};
|
|
32
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, external("node_modules/@nestia/e2e/lib/ArrayUtil.d.ts")), external("node_modules/@nestia/e2e/lib/RandomGenerator.d.ts")), external("node_modules/@nestia/e2e/lib/TestValidator.d.ts")), external("node_modules/@nestia/fetcher/lib/IConnection.d.ts")), external("node_modules/@samchon/openapi/lib/http/HttpError.d.ts")), external("node_modules/typia/lib/module.d.ts")), filter((key) => key.startsWith("node_modules/typia/lib/tags") && key.endsWith(".d.ts")));
|
|
29
33
|
}));
|
|
30
34
|
//# sourceMappingURL=getTestExternalDeclarations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTestExternalDeclarations.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/compile/getTestExternalDeclarations.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,kEAKC;AATD,+BAAiC;AAIjC,SAAsB,2BAA2B,CAE/C,GAAyB;;QACzB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CAAA;AAED,MAAM,SAAS,GAAG,IAAI,gBAAS,CAAC,CAAO,QAA6B,EAAE,EAAE;IACtE,MAAM,OAAO,GAA2B,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrE,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAA0B,EAAE;QAC5D,MAAM,OAAO,GAAuB,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,OAAO,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACjC,CAAC,CAAC;IACF,OAAO,
|
|
1
|
+
{"version":3,"file":"getTestExternalDeclarations.js","sourceRoot":"","sources":["../../../../../../src/orchestrate/test/compile/getTestExternalDeclarations.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,kEAKC;AATD,+BAAiC;AAIjC,SAAsB,2BAA2B,CAE/C,GAAyB;;QACzB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,EAAE,CAAC;QACtC,OAAO,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;CAAA;AAED,MAAM,SAAS,GAAG,IAAI,gBAAS,CAAC,CAAO,QAA6B,EAAE,EAAE;IACtE,MAAM,OAAO,GAA2B,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrE,MAAM,QAAQ,GAAG,CAAC,QAAgB,EAA0B,EAAE;QAC5D,MAAM,OAAO,GAAuB,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtD,IAAI,OAAO,KAAK,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC;QAC1E,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACjC,CAAC,CAAC;IACF,MAAM,MAAM,GAAG,CACb,OAAiC,EACT,EAAE;QAC1B,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC,CAAC;IACF,OAAO,sGACF,QAAQ,CAAC,6CAA6C,CAAC,GACvD,QAAQ,CAAC,mDAAmD,CAAC,GAC7D,QAAQ,CAAC,iDAAiD,CAAC,GAC3D,QAAQ,CAAC,mDAAmD,CAAC,GAC7D,QAAQ,CAAC,uDAAuD,CAAC,GACjE,QAAQ,CAAC,oCAAoC,CAAC,GAC9C,MAAM,CACP,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAC,UAAU,CAAC,6BAA6B,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CACzE,CAC+B,CAAC;AACrC,CAAC,CAAA,CAAC,CAAC"}
|