@autobe/agent 0.25.7 → 0.26.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.js +3 -0
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/AutoBeMockAgent.js +15 -12
- package/lib/AutoBeMockAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +26 -19
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/factory/consentFunctionCall.js +3 -0
- package/lib/factory/consentFunctionCall.js.map +1 -1
- package/lib/factory/createAutoBeContext.js +4 -1
- 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 +2636 -2258
- 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 +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +73 -73
- package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -2
- 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/facade/transformFacadeStateMessage.js +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- 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 +1 -1
- 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.js +24 -4
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js +52 -52
- package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.d.ts +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +2 -2
- package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +57 -57
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js +43 -43
- package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +4 -4
- package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.d.ts +7 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +444 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +12 -0
- package/lib/orchestrate/interface/{orchestrateInterfaceSchemasReview.js → orchestrateInterfaceSchemaReview.js} +66 -57
- package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -0
- package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js +9 -6
- 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/IAutoBeInterfaceSchemaContentReviewApplication.js +3 -0
- 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/{IAutobeInterfaceSchemasReviewApplication.js → IAutoBeInterfaceSchemaRenameApplication.js} +1 -1
- 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 +42 -1
- 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/orchestratePrismaComponent.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.d.ts +2 -2
- package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +2 -2
- 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.js +2 -2
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +12 -12
- package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +9 -9
- package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +43 -22
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.js → orchestrateRealizeCorrectCasting.js} +58 -46
- package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -0
- 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/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/orchestrateTestCorrect.js +2 -0
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +1 -0
- package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +26 -26
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenarioReview.js +2 -2
- package/lib/orchestrate/test/orchestrateTestScenarioReview.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/package.json +5 -5
- package/src/AutoBeAgent.ts +3 -0
- package/src/AutoBeMockAgent.ts +15 -12
- package/src/constants/AutoBeSystemPromptConstant.ts +26 -19
- package/src/factory/consentFunctionCall.ts +4 -0
- package/src/factory/createAutoBeContext.ts +5 -1
- package/src/factory/getCommonPrompt.ts +25 -0
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +5 -5
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +1 -1
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -3
- 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/interface/histories/transformInterfaceAuthorizationsHistories.ts +9 -9
- 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 +34 -14
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +18 -18
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +4 -4
- package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +5 -5
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +23 -23
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +4 -4
- package/src/orchestrate/interface/orchestrateInterfacePrerequisites.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +269 -0
- package/src/orchestrate/interface/{orchestrateInterfaceSchemasReview.ts → orchestrateInterfaceSchemaReview.ts} +88 -70
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +16 -8
- 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 +4 -4
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +4 -4
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +7 -7
- 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 +1 -1
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +9 -9
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -3
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +74 -60
- package/src/orchestrate/realize/{orchestRateRealizeCorrectCasting.ts → orchestrateRealizeCorrectCasting.ts} +86 -85
- 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/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/orchestrateTestCorrect.ts +2 -0
- package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +1 -0
- package/src/orchestrate/test/orchestrateTestScenario.ts +30 -30
- package/src/orchestrate/test/orchestrateTestScenarioReview.ts +2 -2
- package/src/orchestrate/test/structures/{IAutoBeTestScenarioAuthorizationRole.ts → IAutoBeTestScenarioAuthorizationActor.ts} +1 -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/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +0 -67
- package/src/orchestrate/interface/structures/IAutobeInterfaceSchemasReviewApplication.ts +0 -96
- /package/lib/orchestrate/realize/{orchestRateRealizeCorrectCasting.d.ts → orchestrateRealizeCorrectCasting.d.ts} +0 -0
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
export interface IAutoBeInterfaceSchemaContentReviewApplication {
|
|
3
|
+
/**
|
|
4
|
+
* Reviews and validates DTO content completeness and consistency in OpenAPI
|
|
5
|
+
* schemas.
|
|
6
|
+
*
|
|
7
|
+
* This specialized content review function focuses exclusively on ensuring
|
|
8
|
+
* DTOs accurately and completely represent their business entities. It
|
|
9
|
+
* validates field completeness, type accuracy, required field settings, and
|
|
10
|
+
* documentation quality.
|
|
11
|
+
*
|
|
12
|
+
* The review process validates and corrects:
|
|
13
|
+
*
|
|
14
|
+
* - Field completeness against Prisma schema
|
|
15
|
+
* - Data type accuracy (Prisma to OpenAPI type mappings)
|
|
16
|
+
* - Required field arrays matching Prisma nullability
|
|
17
|
+
* - Description quality and comprehensiveness
|
|
18
|
+
* - Consistency across DTO variants (IEntity, ICreate, IUpdate, ISummary)
|
|
19
|
+
* - Missing variant detection and creation
|
|
20
|
+
*
|
|
21
|
+
* @param props Content review results including completeness issues found,
|
|
22
|
+
* fixes applied, and modified schemas
|
|
23
|
+
*/
|
|
24
|
+
review: (props: IAutoBeInterfaceSchemaContentReviewApplication.IProps) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace IAutoBeInterfaceSchemaContentReviewApplication {
|
|
27
|
+
/**
|
|
28
|
+
* Output structure for the content review function.
|
|
29
|
+
*
|
|
30
|
+
* Contains the content analysis, completeness fixes, and schemas modified for
|
|
31
|
+
* content quality during the validation process.
|
|
32
|
+
*/
|
|
33
|
+
interface IProps {
|
|
34
|
+
/** Content analysis and completeness planning information. */
|
|
35
|
+
think: IThink;
|
|
36
|
+
/**
|
|
37
|
+
* Modified schemas resulting from content and completeness fixes.
|
|
38
|
+
*
|
|
39
|
+
* Contains ONLY the schemas that were modified for content reasons during
|
|
40
|
+
* review. This includes both modified existing schemas and newly created
|
|
41
|
+
* variant schemas.
|
|
42
|
+
*
|
|
43
|
+
* Content modifications include:
|
|
44
|
+
*
|
|
45
|
+
* - Adding missing fields from Prisma schema
|
|
46
|
+
* - Correcting data type mappings
|
|
47
|
+
* - Fixing required field arrays
|
|
48
|
+
* - Enhancing or adding descriptions
|
|
49
|
+
* - Creating missing variant types (ISummary, IUpdate, etc.)
|
|
50
|
+
* - Ensuring cross-variant consistency
|
|
51
|
+
*
|
|
52
|
+
* Return empty object {} when all content is already complete and accurate,
|
|
53
|
+
* requiring no modifications.
|
|
54
|
+
*/
|
|
55
|
+
content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
56
|
+
}
|
|
57
|
+
interface IThink {
|
|
58
|
+
/**
|
|
59
|
+
* Content completeness and quality findings from the review process.
|
|
60
|
+
*
|
|
61
|
+
* Documents all content issues discovered during validation, categorized by
|
|
62
|
+
* type: field completeness, type accuracy, required fields, descriptions,
|
|
63
|
+
* variant consistency, and missing variants. Each issue includes the
|
|
64
|
+
* affected schema and specific problem identified.
|
|
65
|
+
*
|
|
66
|
+
* Common issues documented:
|
|
67
|
+
*
|
|
68
|
+
* - Field Completeness: Missing fields that exist in Prisma schema
|
|
69
|
+
* - Type Accuracy: Incorrect type mappings (e.g., Decimal as string)
|
|
70
|
+
* - Required Fields: Misaligned with Prisma nullable settings
|
|
71
|
+
* - Description Quality: Missing or inadequate descriptions
|
|
72
|
+
* - Variant Consistency: Same field with different types across variants
|
|
73
|
+
* - Missing Variants: Required DTO variants not present
|
|
74
|
+
*
|
|
75
|
+
* Should state "No content or completeness issues found." when all schemas
|
|
76
|
+
* have complete and accurate content.
|
|
77
|
+
*/
|
|
78
|
+
review: string;
|
|
79
|
+
/**
|
|
80
|
+
* Content corrections and completeness fixes applied during review.
|
|
81
|
+
*
|
|
82
|
+
* Lists all content modifications implemented, organized by fix type:
|
|
83
|
+
* fields added, types corrected, required arrays fixed, descriptions
|
|
84
|
+
* enhanced, consistency fixes, and variants created. Documents both field-
|
|
85
|
+
* level changes and schema-level additions.
|
|
86
|
+
*
|
|
87
|
+
* Typical fixes documented:
|
|
88
|
+
*
|
|
89
|
+
* - Fields added to match Prisma schema
|
|
90
|
+
* - Type mappings corrected (Int→integer, Decimal→number)
|
|
91
|
+
* - Required arrays aligned with nullability
|
|
92
|
+
* - Descriptions added or enhanced for clarity
|
|
93
|
+
* - Variant consistency issues resolved
|
|
94
|
+
* - Missing variants created with appropriate fields
|
|
95
|
+
*
|
|
96
|
+
* Should state "No content issues require fixes. All DTOs are complete and
|
|
97
|
+
* consistent." when no content modifications were necessary.
|
|
98
|
+
*/
|
|
99
|
+
plan: string;
|
|
100
|
+
}
|
|
101
|
+
}
|
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfaceSchemaContentReviewApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts"],"names":[],"mappings":""}
|
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
export interface IAutoBeInterfaceSchemaRelationReviewApplication {
|
|
3
|
+
/**
|
|
4
|
+
* Reviews and validates DTO relations and structural patterns in OpenAPI
|
|
5
|
+
* schemas.
|
|
6
|
+
*
|
|
7
|
+
* This specialized relation review function focuses exclusively on data
|
|
8
|
+
* relations, foreign key transformations, and structural integrity. It
|
|
9
|
+
* ensures proper modeling of business domains while preventing circular
|
|
10
|
+
* references and enabling efficient code generation.
|
|
11
|
+
*
|
|
12
|
+
* The review process validates and corrects:
|
|
13
|
+
*
|
|
14
|
+
* - Relation classifications (Composition vs Association vs Aggregation)
|
|
15
|
+
* - Foreign key to object transformations in response DTOs
|
|
16
|
+
* - Actor reversal violations (e.g., User containing articles array)
|
|
17
|
+
* - Inline object extractions to named types with $ref
|
|
18
|
+
* - IInvert pattern applications for alternative perspectives
|
|
19
|
+
*
|
|
20
|
+
* @param props Relation review results including violations found, fixes
|
|
21
|
+
* applied, and modified schemas
|
|
22
|
+
*/
|
|
23
|
+
review: (props: IAutoBeInterfaceSchemaRelationReviewApplication.IProps) => void;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace IAutoBeInterfaceSchemaRelationReviewApplication {
|
|
26
|
+
/**
|
|
27
|
+
* Output structure for the relation review function.
|
|
28
|
+
*
|
|
29
|
+
* Contains the relation analysis, structural fixes, and schemas modified for
|
|
30
|
+
* proper relations during the validation process.
|
|
31
|
+
*/
|
|
32
|
+
interface IProps {
|
|
33
|
+
/** Relation analysis and structural planning information. */
|
|
34
|
+
think: IThink;
|
|
35
|
+
/**
|
|
36
|
+
* Modified schemas resulting from relation and structural fixes.
|
|
37
|
+
*
|
|
38
|
+
* Contains ONLY the schemas that were modified for relation or structural
|
|
39
|
+
* reasons during review. This includes both modified existing schemas and
|
|
40
|
+
* newly created schemas (extracted types, IInvert types).
|
|
41
|
+
*
|
|
42
|
+
* Relation modifications include:
|
|
43
|
+
*
|
|
44
|
+
* - Extracting inline objects to named types with $ref
|
|
45
|
+
* - Transforming foreign keys to object references
|
|
46
|
+
* - Removing incorrect reverse relations
|
|
47
|
+
* - Creating new IInvert types for alternative views
|
|
48
|
+
* - Correcting relation types (composition/association/aggregation)
|
|
49
|
+
*
|
|
50
|
+
* Return empty object {} when all relations are already correct and no
|
|
51
|
+
* structural fixes were needed.
|
|
52
|
+
*/
|
|
53
|
+
content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
54
|
+
}
|
|
55
|
+
interface IThink {
|
|
56
|
+
/**
|
|
57
|
+
* Relation and structural violation findings from the review process.
|
|
58
|
+
*
|
|
59
|
+
* Documents all relation issues discovered during validation, categorized
|
|
60
|
+
* by severity and type. Each violation includes the affected schema,
|
|
61
|
+
* specific relation problem, and theoretical justification.
|
|
62
|
+
*
|
|
63
|
+
* Common violations documented:
|
|
64
|
+
*
|
|
65
|
+
* - CRITICAL: Inline object types instead of named types with $ref
|
|
66
|
+
* - CRITICAL: Actor reversal violations (User.articles[], Seller.sales[])
|
|
67
|
+
* - HIGH: Raw foreign keys instead of object references
|
|
68
|
+
* - HIGH: Wrong relation types (event-driven data as composition)
|
|
69
|
+
* - MEDIUM: Missing IInvert types for independent child views
|
|
70
|
+
* - LOW: Naming convention violations (plural instead of singular)
|
|
71
|
+
*
|
|
72
|
+
* Should state "No relation or structure issues found." when all schemas
|
|
73
|
+
* have correct relations.
|
|
74
|
+
*/
|
|
75
|
+
review: string;
|
|
76
|
+
/**
|
|
77
|
+
* Relation corrections and structural fixes applied during review.
|
|
78
|
+
*
|
|
79
|
+
* Lists all relation modifications implemented, organized by fix type and
|
|
80
|
+
* impact. Documents both schemas modified and new schemas created during
|
|
81
|
+
* the fix process.
|
|
82
|
+
*
|
|
83
|
+
* Typical fixes documented:
|
|
84
|
+
*
|
|
85
|
+
* - Inline objects extracted to named types
|
|
86
|
+
* - Foreign keys transformed to object references
|
|
87
|
+
* - Actor reversal arrays removed with API endpoint suggestions
|
|
88
|
+
* - IInvert types created with parent context
|
|
89
|
+
* - Relation types corrected based on lifecycle analysis
|
|
90
|
+
* - Naming conventions standardized
|
|
91
|
+
*
|
|
92
|
+
* Should state "No relation issues require fixes. All relations are
|
|
93
|
+
* properly structured." when no modifications were necessary.
|
|
94
|
+
*/
|
|
95
|
+
plan: string;
|
|
96
|
+
}
|
|
97
|
+
}
|
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfaceSchemaRelationReviewApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AutoBeInterfaceSchemaRefactor } from "@autobe/interface";
|
|
2
|
+
export interface IAutoBeInterfaceSchemaRenameApplication {
|
|
3
|
+
/**
|
|
4
|
+
* Analyze DTO type names and identify naming violations.
|
|
5
|
+
*
|
|
6
|
+
* This method examines existing DTO type names to detect violations of the
|
|
7
|
+
* CRITICAL naming rule: ALL words from the Prisma table name MUST be
|
|
8
|
+
* preserved in the DTO type name. Omitting intermediate words breaks
|
|
9
|
+
* type-to-table traceability and causes system failures.
|
|
10
|
+
*
|
|
11
|
+
* The method receives a list of Prisma table names and current DTO type
|
|
12
|
+
* names, then identifies which type names incorrectly omit service prefixes
|
|
13
|
+
* or intermediate components from their corresponding table names.
|
|
14
|
+
*
|
|
15
|
+
* @param props Properties containing refactoring operations to fix naming
|
|
16
|
+
* violations.
|
|
17
|
+
*/
|
|
18
|
+
rename(props: IAutoBeInterfaceSchemaRenameApplication.IProps): void;
|
|
19
|
+
}
|
|
20
|
+
export declare namespace IAutoBeInterfaceSchemaRenameApplication {
|
|
21
|
+
interface IProps {
|
|
22
|
+
/**
|
|
23
|
+
* List of refactoring operations to rename incorrectly named DTO types.
|
|
24
|
+
*
|
|
25
|
+
* Each refactor specifies:
|
|
26
|
+
*
|
|
27
|
+
* - `from`: The current INCORRECT type name (e.g., "ISale", "IBbsComment")
|
|
28
|
+
* - `to`: The CORRECT type name with all components preserved (e.g.,
|
|
29
|
+
* "IShoppingSale", "IBbsArticleComment")
|
|
30
|
+
*
|
|
31
|
+
* IMPORTANT: Only include type names that violate the naming rules. If a
|
|
32
|
+
* type name correctly preserves all components from the table name, do NOT
|
|
33
|
+
* include it in the refactors list.
|
|
34
|
+
*
|
|
35
|
+
* The orchestrator will automatically handle:
|
|
36
|
+
*
|
|
37
|
+
* - Renaming the base type (e.g., ISale → IShoppingSale)
|
|
38
|
+
* - Renaming all variants (e.g., ISale.ICreate → IShoppingSale.ICreate)
|
|
39
|
+
* - Renaming page types (e.g., IPageISale → IPageIShoppingSale)
|
|
40
|
+
* - Updating all $ref references throughout the OpenAPI document
|
|
41
|
+
*/
|
|
42
|
+
refactors: AutoBeInterfaceSchemaRefactor[];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfaceSchemaRenameApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRenameApplication.ts"],"names":[],"mappings":""}
|
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { AutoBeOpenApi } from "@autobe/interface";
|
|
2
|
+
export interface IAutoBeInterfaceSchemaSecurityReviewApplication {
|
|
3
|
+
/**
|
|
4
|
+
* Reviews and validates OpenAPI schema definitions for security compliance.
|
|
5
|
+
*
|
|
6
|
+
* This specialized security review function focuses exclusively on
|
|
7
|
+
* authentication boundaries, data protection, and system integrity. It
|
|
8
|
+
* enforces strict security policies to prevent authentication bypass, data
|
|
9
|
+
* exposure, and unauthorized access.
|
|
10
|
+
*
|
|
11
|
+
* The review process identifies and removes:
|
|
12
|
+
*
|
|
13
|
+
* - Authentication context fields in request DTOs (e.g., bbs_member_id)
|
|
14
|
+
* - Password and token fields in response DTOs
|
|
15
|
+
* - System-managed fields in request DTOs
|
|
16
|
+
* - Phantom fields that don't exist in Prisma schema
|
|
17
|
+
*
|
|
18
|
+
* @param props Security review results including violations found, fixes
|
|
19
|
+
* applied, and modified schemas
|
|
20
|
+
*/
|
|
21
|
+
review: (props: IAutoBeInterfaceSchemaSecurityReviewApplication.IProps) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace IAutoBeInterfaceSchemaSecurityReviewApplication {
|
|
24
|
+
/**
|
|
25
|
+
* Output structure for the security review function.
|
|
26
|
+
*
|
|
27
|
+
* Contains the security analysis, remediation actions, and schemas modified
|
|
28
|
+
* for security compliance during the validation process.
|
|
29
|
+
*/
|
|
30
|
+
interface IProps {
|
|
31
|
+
/** Security analysis and remediation planning information. */
|
|
32
|
+
think: IThink;
|
|
33
|
+
/**
|
|
34
|
+
* Modified schemas resulting from security fixes.
|
|
35
|
+
*
|
|
36
|
+
* Contains ONLY the schemas that were modified for security reasons during
|
|
37
|
+
* review. This focused output enables precise tracking of security-related
|
|
38
|
+
* changes.
|
|
39
|
+
*
|
|
40
|
+
* Security modifications include:
|
|
41
|
+
*
|
|
42
|
+
* - Removing authentication context fields (user_id, session_id, etc.)
|
|
43
|
+
* - Removing password/token fields from responses
|
|
44
|
+
* - Removing system-managed fields from requests
|
|
45
|
+
* - Removing phantom fields not in Prisma schema
|
|
46
|
+
*
|
|
47
|
+
* Return empty object {} when all schemas are already secure and no
|
|
48
|
+
* security fixes were needed.
|
|
49
|
+
*/
|
|
50
|
+
content: Record<string, AutoBeOpenApi.IJsonSchemaDescriptive>;
|
|
51
|
+
}
|
|
52
|
+
interface IThink {
|
|
53
|
+
/**
|
|
54
|
+
* Security violation findings from the review process.
|
|
55
|
+
*
|
|
56
|
+
* Documents all security issues discovered during validation, categorized
|
|
57
|
+
* by severity level (CRITICAL, HIGH, MEDIUM, LOW). Each violation includes
|
|
58
|
+
* the affected schema name, field name, and specific security rule
|
|
59
|
+
* violated.
|
|
60
|
+
*
|
|
61
|
+
* Common violations documented:
|
|
62
|
+
*
|
|
63
|
+
* - CRITICAL: Authentication context in requests (bbs_member_id, session_id)
|
|
64
|
+
* - CRITICAL: Password/token exposure in responses
|
|
65
|
+
* - CRITICAL: Phantom fields not existing in Prisma schema
|
|
66
|
+
* - HIGH: System-managed fields in requests
|
|
67
|
+
* - HIGH: Immutable ownership fields in updates
|
|
68
|
+
*
|
|
69
|
+
* Should state "No security violations found." when all schemas pass
|
|
70
|
+
* security validation.
|
|
71
|
+
*/
|
|
72
|
+
review: string;
|
|
73
|
+
/**
|
|
74
|
+
* Security remediation actions applied to fix identified violations.
|
|
75
|
+
*
|
|
76
|
+
* Lists all security fixes implemented during the review process, organized
|
|
77
|
+
* by fix type and priority. Each fix documents which field was removed or
|
|
78
|
+
* modified and from which schema.
|
|
79
|
+
*
|
|
80
|
+
* Typical fixes documented:
|
|
81
|
+
*
|
|
82
|
+
* - Authentication context fields removed from request DTOs
|
|
83
|
+
* - Sensitive data removed from response DTOs
|
|
84
|
+
* - Phantom fields deleted to match Prisma schema
|
|
85
|
+
* - System fields removed from client-controllable DTOs
|
|
86
|
+
*
|
|
87
|
+
* Should state "No security issues require fixes. All schemas are secure."
|
|
88
|
+
* when no security modifications were necessary.
|
|
89
|
+
*/
|
|
90
|
+
plan: string;
|
|
91
|
+
}
|
|
92
|
+
}
|
package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAutoBeInterfaceSchemaSecurityReviewApplication.js","sourceRoot":"","sources":["../../../../src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts"],"names":[],"mappings":""}
|
|
@@ -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)
|
|
@@ -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;Q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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,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G;4BACG,GAAG;;;;;;;;;qCASM,GAAG,mCAAmC,GAAG;+CAC/B,GAAG;;;;;;SAMzC,CAAC,CAAC;QACP,CAAC;IACH,CAAC,CAAC;AACJ,CAAC,EAzRgB,mBAAmB,mCAAnB,mBAAmB,QAyRnC"}
|
|
@@ -4,6 +4,6 @@ export declare namespace OperationValidator {
|
|
|
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
|
}
|