@autobe/agent 0.9.2 → 0.10.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 +11 -4
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -6
- package/lib/context/AutoBeTokenUsage.d.ts +15 -1
- package/lib/context/AutoBeTokenUsage.js +56 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/factory/createAutoBeApplication.js +288 -643
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +5057 -7211
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +82 -319
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +95 -266
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +2 -2
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/index.d.ts +2 -2
- package/lib/orchestrate/index.js +4 -4
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -142
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +195 -199
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +75 -172
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +772 -1097
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +2 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +64 -175
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +552 -1073
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +571 -1119
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +8 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +11 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +109 -0
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +25 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +337 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +52 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +57 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.d.ts +80 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js +53 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +46 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js +37 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +127 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -0
- package/lib/orchestrate/test/compile/completeTestCode.d.ts +2 -0
- package/lib/orchestrate/test/compile/completeTestCode.js +21 -0
- package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/orchestrate/test/{filterTestFileName.js → compile/filterTestFileName.js} +1 -1
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +27 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
- package/lib/orchestrate/test/{compileTestScenario.js → compile/getTestScenarioArtifacts.js} +10 -5
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTest.js +14 -9
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +150 -448
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +272 -530
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js +139 -90
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
- package/lib/{utils/types/BackoffOptions.js → orchestrate/test/structures/IAutoBeTestFunction.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +14 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +112 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +3 -2
- package/lib/orchestrate/test/transformTestCorrectHistories.js +28 -67
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.d.ts +5 -4
- package/lib/orchestrate/test/transformTestWriteHistories.js +168 -43
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +11 -0
- package/lib/utils/backoffRetry.d.ts +4 -7
- package/lib/utils/backoffRetry.js +19 -37
- package/lib/utils/backoffRetry.js.map +1 -1
- package/lib/utils/forceRetry.d.ts +1 -0
- package/lib/{orchestrate/orchestrateRealize.js → utils/forceRetry.js} +15 -8
- package/lib/utils/forceRetry.js.map +1 -0
- package/package.json +8 -7
- package/src/AutoBeAgent.ts +17 -3
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -6
- package/src/context/AutoBeTokenUsage.ts +85 -1
- package/src/factory/createAutoBeApplication.ts +2 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +8 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -1
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +6 -5
- package/src/orchestrate/facade/transformFacadeStateMessage.ts +2 -1
- package/src/orchestrate/index.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +26 -23
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +6 -4
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +14 -11
- package/src/orchestrate/interface/transformInterfaceHistories.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +10 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +11 -5
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -8
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +169 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +156 -0
- package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +75 -0
- package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
- package/src/orchestrate/realize/orchestrateRealizeValidator.ts +64 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +36 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +136 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +35 -0
- package/src/orchestrate/test/{filterTestFileName.ts → compile/filterTestFileName.ts} +1 -1
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +24 -0
- package/src/orchestrate/test/{compileTestScenario.ts → compile/getTestScenarioArtifacts.ts} +16 -8
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +240 -0
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +316 -0
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -0
- package/src/orchestrate/test/orchestrateTest.ts +33 -16
- package/src/orchestrate/test/orchestrateTestCorrect.ts +109 -497
- package/src/orchestrate/test/orchestrateTestScenario.ts +102 -71
- package/src/orchestrate/test/orchestrateTestWrite.ts +55 -181
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +126 -0
- package/src/orchestrate/test/structures/IAutoBeTestFunction.ts +10 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +14 -2
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +117 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteResult.ts +9 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +38 -71
- package/src/orchestrate/test/transformTestWriteHistories.ts +88 -46
- package/src/structures/IAutoBeConfig.ts +9 -0
- package/src/utils/backoffRetry.ts +25 -36
- package/src/utils/forceRetry.ts +13 -0
- package/lib/factory/invertOpenApiDocument.d.ts +0 -3
- package/lib/factory/invertOpenApiDocument.js +0 -51
- package/lib/factory/invertOpenApiDocument.js.map +0 -1
- package/lib/orchestrate/orchestrateRealize.d.ts +0 -5
- package/lib/orchestrate/orchestrateRealize.js.map +0 -1
- package/lib/orchestrate/test/compileTestScenario.d.ts +0 -5
- package/lib/orchestrate/test/compileTestScenario.js.map +0 -1
- package/lib/orchestrate/test/filterTestFileName.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -4
- package/lib/utils/StringUtil.js +0 -43
- package/lib/utils/StringUtil.js.map +0 -1
- package/lib/utils/types/BackoffOptions.d.ts +0 -12
- package/lib/utils/types/BackoffOptions.js.map +0 -1
- package/src/factory/invertOpenApiDocument.ts +0 -63
- package/src/orchestrate/orchestrateRealize.ts +0 -18
- package/src/utils/StringUtil.ts +0 -45
- package/src/utils/types/BackoffOptions.ts +0 -15
- /package/lib/orchestrate/test/{filterTestFileName.d.ts → compile/filterTestFileName.d.ts} +0 -0
|
@@ -129,7 +129,7 @@ function process(ctx, operations, oldbie, remained) {
|
|
|
129
129
|
describe: null,
|
|
130
130
|
} }),
|
|
131
131
|
histories: [
|
|
132
|
-
...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination indformation.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
|
|
132
|
+
...(0, transformInterfaceHistories_1.transformInterfaceHistories)(ctx.state(), "# AutoAPI Schema Agent System Prompt\n\nYou are AutoAPI Schema Agent, an expert in creating comprehensive schema components for OpenAPI specifications in the `AutoBeOpenApi.IDocument` format. Your specialized role focuses on the third phase of a multi-agent orchestration process for large-scale API design.\n\nYour mission is to analyze the provided API operations, paths, methods, Prisma schema files, and ERD diagrams to construct a complete and consistent set of component schemas that accurately represent all entities and their relationships in the system.\n\n## 1. Context and Your Role in the Multi-Agent Process\n\nYou are the third agent in a three-phase process:\n1. **Phase 1** (completed): Analysis of requirements, Prisma schema, and ERD to define API paths and methods\n2. **Phase 2** (completed): Creation of detailed API operations based on the defined paths and methods\n3. **Phase 3** (your role): Construction of comprehensive component schemas for all entities\n\nYou will receive:\n- The complete list of API operations from Phase 2\n- The original Prisma schema with detailed comments\n- ERD diagrams in Mermaid format\n- Requirement analysis documents\n\n## 2. Primary Responsibilities\n\nYour specific tasks are:\n\n1. **Extract All Entity Types**: Analyze all API operations and identify every distinct entity type referenced\n2. **Define Complete Schema Components**: Create detailed schema definitions for every entity and its variants\n3. **Maintain Type Naming Conventions**: Follow the established type naming patterns\n4. **Ensure Schema Completeness**: Verify that ALL entities in the Prisma schema have corresponding component schemas\n5. **Create Type Variants**: Define all necessary type variants for each entity (.ICreate, .IUpdate, .ISummary, etc.)\n6. **Document Thoroughly**: Provide comprehensive descriptions for all schema components\n7. **Validate Consistency**: Ensure schema definitions align with API operations\n8. **Use Named References Only**: NEVER use inline/anonymous object definitions - ALL object types must be defined as named types in the components.schemas section and referenced using $ref\n\n## 3. Schema Design Principles\n\n### 3.1. Type Naming Conventions\n\n- **Main Entity Types**: Use `IEntityName` format\n- **Operation-Specific Types**:\n - `IEntityName.ICreate`: Request body for creation operations (POST)\n - `IEntityName.IUpdate`: Request body for update operations (PUT or PATCH)\n - `IEntityName.ISummary`: Simplified response version with essential properties\n - `IEntityName.IRequest`: Request parameters for list operations (search/filter/pagination)\n - `IEntityName.IAbridge`: Intermediate view with more detail than Summary but less than full entity\n - `IEntityName.IInvert`: Alternative representation of an entity from a different perspective\n- **Container Types**: \n - `IPageIEntityName`: Paginated results container (use the standard IPage structure)\n\n### 3.2. Schema Definition Requirements\n\n- **Completeness**: Include ALL properties from the Prisma schema for each entity\n- **Type Accuracy**: Map Prisma types to appropriate OpenAPI types and formats\n- **Required Fields**: Accurately mark required fields based on Prisma schema constraints\n- **Relationships**: Properly handle entity relationships (references to other entities)\n- **Enumerations**: Define all enum types referenced in entity schemas\n- **Detailed Documentation**: \n - Schema descriptions must reference related Prisma schema table comments\n - Property descriptions must reference related Prisma schema column comments\n - All descriptions must be organized in multiple paragraphs for better readability\n- **Named References Only**: \n - Every object type MUST be defined as a named type in the components.schemas section\n - NEVER use inline/anonymous object definitions anywhere in the schema\n - All property types that are objects must use $ref to reference a named type\n - This applies to EVERY object in the schema, including nested objects and arrays of objects\n\n### 3.3. Standard Type Definitions\n\nFor paginated results, use the standard `IPage<T>` interface:\n\n```typescript\n/**\n * A page.\n *\n * Collection of records with pagination information.\n *\n * @author Samchon\n */\nexport interface IPage<T extends object> {\n /**\n * Page information.\n */\n pagination: IPage.IPagination;\n\n /**\n * List of records.\n */\n data: T[];\n}\nexport namespace IPage {\n /**\n * Page information.\n */\n export interface IPagination {\n /**\n * Current page number.\n */\n current: number & tags.Type<\"uint32\">;\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit: number & tags.Type<\"uint32\">;\n\n /**\n * Total records in the database.\n */\n records: number & tags.Type<\"uint32\">;\n\n /**\n * Total pages.\n *\n * Equal to {@link records} / {@link limit} with ceiling.\n */\n pages: number & tags.Type<\"uint32\">;\n }\n\n /**\n * Page request data\n */\n export interface IRequest {\n /**\n * Page number.\n */\n page?: null | (number & tags.Type<\"uint32\">);\n\n /**\n * Limitation of records per a page.\n *\n * @default 100\n */\n limit?: null | (number & tags.Type<\"uint32\">);\n }\n}\n```\n\n## 4. Implementation Strategy\n\n### 4.1. Comprehensive Entity Identification\n\n1. **Extract All Entity References**:\n - Analyze all API operation paths for entity identifiers\n - Examine request and response bodies in API operations\n - Review the Prisma schema to identify ALL entities\n\n2. **Create Entity Tracking System**:\n - List ALL entities from the Prisma schema\n - Cross-reference with entities mentioned in API operations\n - Identify any entities that might be missing schema definitions\n\n### 4.2. Schema Definition Process\n\n1. **For Each Entity**:\n - Define the main entity schema (`IEntityName`)\n - Create all necessary variant types based on API operations\n - Ensure all properties are documented with descriptions from Prisma schema\n - Mark required fields based on Prisma schema constraints\n\n2. **For Relationship Handling**:\n - Identify all relationships from the ERD and Prisma schema\n - Define appropriate property types for relationships (IDs, nested objects, arrays)\n - Document relationship constraints and cardinality\n\n3. **For Variant Types**:\n - Create `.ICreate` types with appropriate required/optional fields for creation\n - Define `.IUpdate` types with all fields made optional for updates\n - Build `.ISummary` types with essential fields for list views\n - Define `.IRequest` types with search/filter/sort parameters\n\n### 4.3. Schema Completeness Verification\n\n1. **Entity Coverage Check**:\n - Verify every entity in the Prisma schema has at least one schema definition\n - Check that all entities referenced in API operations have schema definitions\n\n2. **Property Coverage Check**:\n - Ensure all properties from the Prisma schema are included in entity schemas\n - Verify property types align with Prisma schema definitions\n\n3. **Variant Type Verification**:\n - Confirm necessary variant types exist based on API operations\n - Ensure variant types have appropriate property subsets and constraints\n\n## 5. Documentation Quality Requirements\n\n### 5.1. **Schema Type Descriptions**\n- Must reference related Prisma schema table description comments\n- Must be extremely detailed and comprehensive\n- Must be organized in multiple paragraphs\n- Should explain the entity's role in the business domain\n- Should describe relationships with other entities\n\n### 5.2. **Property Descriptions**\n- Must reference related Prisma schema column description comments\n- Must explain the purpose, constraints, and format of each property\n- Should note business rules that apply to the property\n- Should provide examples when helpful\n- Should use multiple paragraphs for complex properties\n\n## 6. Output Format\n\nYour output should be the complete `components` section of the OpenAPI document:\n\n```typescript\nconst components: OpenApi.IComponents = {\n schemas: {\n // Main entity types\n IEntityName: { \n type: \"object\", \n properties: {\n propertyName: {\n type: \"string\",\n description: \"Detailed property description referencing Prisma schema column comments.\\n\\nMultiple paragraphs where appropriate.\"\n }\n // ...more properties\n },\n required: [...],\n description: \"Extremely detailed explanation about IEntityName referencing Prisma schema table comments.\\n\\nMultiple paragraphs focusing on different aspects of the entity.\",\n },\n // Variant types\n \"IEntityName.ICreate\": { ... },\n \"IEntityName.IUpdate\": { ... },\n \"IEntityName.ISummary\": { ... },\n \"IEntityName.IRequest\": { ... },\n \n // Repeat for ALL entities\n \n // Standard types\n \"IPage\": { ... },\n \"IPage.IPagination\": { ... },\n \"IPage.IRequest\": { ... },\n \n // Enumerations\n \"EEnumName\": { ... }\n }\n}\n```\n\n## 7. Critical Success Factors\n\n### 7.1. Absolute Completeness Principles\n\n- **Process ALL Entities**: EVERY entity defined in the Prisma schema MUST have corresponding schema components.\n- **Complete Property Coverage**: ALL properties of each entity MUST be included in schema definitions.\n- **Variant Type Comprehensiveness**: ALL necessary variant types MUST be defined based on API operations.\n- **No Simplification**: Complex entities or relationships MUST be faithfully represented without simplification.\n- **Verification of Completeness**: Before final output, verify that ALL entities and properties have been defined.\n\n### 7.2. High-Volume Processing Strategy\n\n- **Batch Processing**: If there are many entities, process them in groups, but ALL groups MUST be completed.\n- **No Prioritization**: ALL entities and their properties have equal importance and must be processed.\n- **Systematic Approach**: Use a methodical approach to ensure no entity or property is overlooked.\n- **Detailed Tracking**: Maintain a tracking system to verify completeness of schema definitions.\n\n### 7.3. Critical Warnings\n\n- **Partial Implementation Prohibited**: \"Defining schemas for only some entities and omitting others\" is a CRITICAL ERROR.\n- **Property Omission Prohibited**: \"Including only some properties of an entity\" is a SERIOUS ERROR.\n- **No Simplification**: \"Simplifying complex entities or relationships\" is NOT ACCEPTABLE.\n- **Ignore Capacity Limitations**: Processing only some entities due to their quantity is a SERIOUS ERROR.\n- **Named Types Required**: Using inline/anonymous object definitions instead of named type references ($ref) is a CRITICAL ERROR. EVERY object type must be defined in the components.schemas section and referenced by name.\n\n## 8. Execution Process\n\n1. **Initialization**:\n - Analyze all input data (API operations, Prisma schema, ERD)\n - Create a complete inventory of entities and their relationships\n\n2. **Schema Development**:\n - Systematically define schema components for each entity and its variants\n - Document all components and properties thoroughly\n\n3. **Verification**:\n - Validate completeness against the Prisma schema\n - Verify consistency with API operations\n - Ensure all relationships are properly handled\n\n4. **Output Generation**:\n - Produce the complete `components` section in the required format\n - Verify the output meets all quality and completeness requirements\n\nRemember that your role is CRITICAL to the success of the entire API design process. The schemas you define will be the foundation for ALL data exchange in the API. Thoroughness, accuracy, and completeness are your highest priorities.\n\n## 9. Integration with Previous Phases\n\n- Ensure your schema components align perfectly with the API operations defined in Phase 2\n- Reference the same entities and property names used in the API paths from Phase 1\n- Maintain consistency in naming, typing, and structure throughout the entire API design\n\n## 10. Final Output Format\n\nYour final output should be the complete `components` section that can be directly integrated with the API operations from Phase 2 to form a complete `AutoBeOpenApi.IDocument` object.\n\nAlways aim to create schema components that are intuitive, well-documented, and accurately represent the business domain. Your schema definitions should meet ALL business requirements while being extensible and maintainable. Remember to define components for EVERY SINGLE independent entity table in the Prisma schema. NO ENTITY OR PROPERTY SHOULD BE OMITTED FOR ANY REASON." /* AutoBeSystemPromptConstant.INTERFACE_SCHEMA */),
|
|
133
133
|
{
|
|
134
134
|
id: (0, uuid_1.v4)(),
|
|
135
135
|
created_at: new Date().toISOString(),
|
|
@@ -143,7 +143,6 @@ function process(ctx, operations, oldbie, remained) {
|
|
|
143
143
|
].join("\n"),
|
|
144
144
|
},
|
|
145
145
|
],
|
|
146
|
-
tokenUsage: ctx.usage(),
|
|
147
146
|
controllers: [
|
|
148
147
|
createApplication({
|
|
149
148
|
model: ctx.model,
|
|
@@ -162,7 +161,8 @@ function process(ctx, operations, oldbie, remained) {
|
|
|
162
161
|
});
|
|
163
162
|
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
164
163
|
const already = Object.keys(oldbie.schemas);
|
|
165
|
-
yield agentica
|
|
164
|
+
yield agentica
|
|
165
|
+
.conversate([
|
|
166
166
|
"Make type components please.",
|
|
167
167
|
"",
|
|
168
168
|
"Here is the list of request/response bodies' type names from",
|
|
@@ -180,7 +180,11 @@ function process(ctx, operations, oldbie, remained) {
|
|
|
180
180
|
...already.map((k) => `> - \`${k}\``),
|
|
181
181
|
]
|
|
182
182
|
: []),
|
|
183
|
-
].join("\n"))
|
|
183
|
+
].join("\n"))
|
|
184
|
+
.finally(() => {
|
|
185
|
+
const tokenUsage = agentica.getTokenUsage();
|
|
186
|
+
ctx.usage().record(tokenUsage, ["interface"]);
|
|
187
|
+
});
|
|
184
188
|
if (pointer.value === null) {
|
|
185
189
|
// never be happened
|
|
186
190
|
throw new Error("Failed to create components.");
|
|
@@ -216,53 +220,90 @@ const claude = {
|
|
|
216
220
|
type: "object",
|
|
217
221
|
properties: {
|
|
218
222
|
components: {
|
|
219
|
-
|
|
223
|
+
title: "Complete set of schema components for the OpenAPI specification",
|
|
224
|
+
description: "Complete set of schema components for the OpenAPI specification.\n\nThis property contains comprehensive type definitions for all entities in\nthe system. It is the central repository of all named schema types that\nwill be used throughout the API specification.\n\nCRITICAL REQUIREMENT: All object types MUST be defined as named types in\nthe components.schemas section. Inline anonymous object definitions are\nstrictly prohibited.\n\nThis components object should include:\n\n- Main entity types (IEntityName)\n- Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n- Container types (IPage<T> for pagination)\n- Enumeration types\n\nAll schema definitions must include detailed descriptions that reference\nthe original Prisma schema comments and thoroughly document each property.\nEvery property that references an object must use a $ref to a named type in\nthe components.schemas section. This applies to all objects in request\nbodies, response bodies, and properties that are objects or arrays of\nobjects.\n\nExample structure:\n\n```typescript\n{\n components: {\n schemas: {\n IUser: {\n type: \"object\",\n properties: {\n id: { type: \"string\", format: \"uuid\" },\n email: { type: \"string\", format: \"email\" },\n profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n },\n required: [\"id\", \"email\"],\n description: \"User entity representing system account holders...\"\n },\n \"IUser.ICreate\": { ... },\n // Additional schemas\n }\n }\n}\n```",
|
|
225
|
+
$ref: "#/$defs/AutoBeOpenApi.IComponents"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
required: [
|
|
229
|
+
"components"
|
|
230
|
+
],
|
|
231
|
+
additionalProperties: false,
|
|
232
|
+
$defs: {
|
|
233
|
+
"AutoBeOpenApi.IComponents": {
|
|
234
|
+
description: "Reusable components in OpenAPI.\n\nA storage of reusable components in OpenAPI document.\n\nIn other words, it is a storage of named DTO schemas and security schemes.",
|
|
220
235
|
type: "object",
|
|
221
236
|
properties: {
|
|
222
237
|
schemas: {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
required: [],
|
|
227
|
-
additionalProperties: {
|
|
228
|
-
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. ALWAYS refer to and incorporate the description comments from the\n> corresponding Prisma DB schema tables and columns. The descriptions\n> should match the style, level of detail, and terminology used in the\n> Prisma schema.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. Descriptions should comprehensively cover:\n> \n> - The purpose and business meaning of the type or property\n> - Relationships to other entities\n> - Validation rules, constraints, and edge cases\n> - Usage context and examples when helpful\n> 4. For each property of an object type, ensure its description reflects the\n> corresponding column description in the Prisma DB schema, maintaining\n> the same level of detail and terminology\n> 5. Descriptions should be so detailed and clear that anyone reading them can\n> fully understand the type or property without needing to reference any\n> other documentation",
|
|
229
|
-
type: "object",
|
|
230
|
-
properties: {
|
|
231
|
-
description: {
|
|
232
|
-
title: "Description about the type",
|
|
233
|
-
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages.",
|
|
234
|
-
type: "string"
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
required: [
|
|
238
|
-
"description"
|
|
239
|
-
]
|
|
240
|
-
}
|
|
238
|
+
title: "An object to hold reusable DTO schemas",
|
|
239
|
+
description: "An object to hold reusable DTO schemas.\n\nIn other words, a collection of named JSON schemas.\n\nIMPORTANT: For each schema in this collection:\n\n1. EVERY schema MUST have a detailed description that references and aligns\n with the description comments from the corresponding Prisma DB schema\n tables\n2. EACH property within the schema MUST have detailed descriptions that\n reference and align with the description comments from the\n corresponding DB schema columns\n3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n line breaks) when appropriate\n4. Descriptions should be comprehensive enough that anyone reading them can\n understand the purpose, functionality, and constraints of each type\n and property without needing to reference other documentation",
|
|
240
|
+
$ref: "#/$defs/RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
241
241
|
},
|
|
242
242
|
authorization: {
|
|
243
243
|
title: "Whether includes `Authorization` header or not",
|
|
244
244
|
description: "Whether includes `Authorization` header or not.",
|
|
245
|
-
|
|
245
|
+
type: "object",
|
|
246
|
+
properties: {
|
|
247
|
+
roles: {
|
|
248
|
+
type: "array",
|
|
249
|
+
items: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
title: {
|
|
253
|
+
type: "string"
|
|
254
|
+
},
|
|
255
|
+
description: {
|
|
256
|
+
type: "string"
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
required: [
|
|
260
|
+
"title",
|
|
261
|
+
"description"
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
required: [
|
|
267
|
+
"roles"
|
|
268
|
+
]
|
|
246
269
|
}
|
|
247
270
|
},
|
|
248
271
|
required: [
|
|
249
272
|
"schemas"
|
|
250
273
|
]
|
|
274
|
+
},
|
|
275
|
+
"RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
276
|
+
description: "Construct a type with a set of properties K of type T",
|
|
277
|
+
type: "object",
|
|
278
|
+
properties: {},
|
|
279
|
+
required: [],
|
|
280
|
+
additionalProperties: {
|
|
281
|
+
$ref: "#/$defs/AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
285
|
+
description: "Descriptive type schema info.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\nGenerative, but it has a `description` property which is required.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\nspecification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\nand duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\nand AI generation.\n\nCRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n\nWhen creating descriptions for components, types, and properties:\n\n1. ALWAYS refer to and incorporate the description comments from the\n corresponding Prisma DB schema tables and columns. The descriptions\n should match the style, level of detail, and terminology used in the\n Prisma schema.\n2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n line breaks. Single-paragraph descriptions should be avoided.\n3. Descriptions should comprehensively cover:\n\n - The purpose and business meaning of the type or property\n - Relationships to other entities\n - Validation rules, constraints, and edge cases\n - Usage context and examples when helpful\n4. For each property of an object type, ensure its description reflects the\n corresponding column description in the Prisma DB schema, maintaining\n the same level of detail and terminology\n5. Descriptions should be so detailed and clear that anyone reading them can\n fully understand the type or property without needing to reference any\n other documentation",
|
|
286
|
+
type: "object",
|
|
287
|
+
properties: {
|
|
288
|
+
description: {
|
|
289
|
+
title: "Description about the type",
|
|
290
|
+
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages.",
|
|
291
|
+
type: "string"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
required: [
|
|
295
|
+
"description"
|
|
296
|
+
]
|
|
251
297
|
}
|
|
252
|
-
}
|
|
253
|
-
required: [
|
|
254
|
-
"components"
|
|
255
|
-
],
|
|
256
|
-
additionalProperties: false,
|
|
257
|
-
$defs: {}
|
|
298
|
+
}
|
|
258
299
|
},
|
|
259
300
|
description: "Generate OpenAPI components containing named schema types.\n\nThis method receives a complete set of schema components and integrates\nthem into the final OpenAPI specification. It processes all entity schemas,\ntheir variants, and related type definitions to ensure a comprehensive and\nconsistent API design.\n\nThe provided components should include schemas for all entities identified\nin the previous phases of API path/method definition and operation\ncreation. This ensures that the final OpenAPI document has complete type\ncoverage for all operations.\n\nCRITICAL: All schema definitions must follow the established naming\nconventions (IEntityName, IEntityName.ICreate, etc.) and must be thoroughly\ndocumented with descriptions that reference the original Prisma schema\ncomments.",
|
|
260
|
-
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "
|
|
301
|
+
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "object" === typeof input.authorization && null !== input.authorization && _io4(input.authorization)); const _io2 = input => Object.keys(input).every(key => {
|
|
261
302
|
const value = input[key];
|
|
262
303
|
if (undefined === value)
|
|
263
304
|
return true;
|
|
264
305
|
return "object" === typeof value && null !== value && _io3(value);
|
|
265
|
-
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
306
|
+
}); const _io3 = input => "string" === typeof input.description; const _io4 = input => Array.isArray(input.roles) && input.roles.every(elem => "object" === typeof elem && null !== elem && _io5(elem)); const _io5 = input => "string" === typeof input.title && "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
266
307
|
path: _path + ".components",
|
|
267
308
|
expected: "AutoBeOpenApi.IComponents",
|
|
268
309
|
value: input.components
|
|
@@ -278,9 +319,13 @@ const claude = {
|
|
|
278
319
|
path: _path + ".schemas",
|
|
279
320
|
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
280
321
|
value: input.schemas
|
|
281
|
-
}), undefined === input.authorization || "
|
|
322
|
+
}), undefined === input.authorization || ("object" === typeof input.authorization && null !== input.authorization || _report(_exceptionable, {
|
|
323
|
+
path: _path + ".authorization",
|
|
324
|
+
expected: "(__type | undefined)",
|
|
325
|
+
value: input.authorization
|
|
326
|
+
})) && _vo4(input.authorization, _path + ".authorization", true && _exceptionable) || _report(_exceptionable, {
|
|
282
327
|
path: _path + ".authorization",
|
|
283
|
-
expected: "(
|
|
328
|
+
expected: "(__type | undefined)",
|
|
284
329
|
value: input.authorization
|
|
285
330
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
286
331
|
const value = input[key];
|
|
@@ -299,6 +344,30 @@ const claude = {
|
|
|
299
344
|
path: _path + ".description",
|
|
300
345
|
expected: "string",
|
|
301
346
|
value: input.description
|
|
347
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [(Array.isArray(input.roles) || _report(_exceptionable, {
|
|
348
|
+
path: _path + ".roles",
|
|
349
|
+
expected: "Array<__type>",
|
|
350
|
+
value: input.roles
|
|
351
|
+
})) && input.roles.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
352
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
353
|
+
expected: "__type.o1",
|
|
354
|
+
value: elem
|
|
355
|
+
})) && _vo5(elem, _path + ".roles[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
356
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
357
|
+
expected: "__type.o1",
|
|
358
|
+
value: elem
|
|
359
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
360
|
+
path: _path + ".roles",
|
|
361
|
+
expected: "Array<__type>",
|
|
362
|
+
value: input.roles
|
|
363
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
|
|
364
|
+
path: _path + ".title",
|
|
365
|
+
expected: "string",
|
|
366
|
+
value: input.title
|
|
367
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
368
|
+
path: _path + ".description",
|
|
369
|
+
expected: "string",
|
|
370
|
+
value: input.description
|
|
302
371
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
303
372
|
if (false === __is(input)) {
|
|
304
373
|
errors = [];
|
|
@@ -342,197 +411,92 @@ const collection = {
|
|
|
342
411
|
{
|
|
343
412
|
name: "makeComponents",
|
|
344
413
|
parameters: {
|
|
345
|
-
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
414
|
+
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}\n\n### Description of {@link components} property:\n\n> Complete set of schema components for the OpenAPI specification.\n> \n> This property contains comprehensive type definitions for all entities in\n> the system. It is the central repository of all named schema types that\n> will be used throughout the API specification.\n> \n> CRITICAL REQUIREMENT: All object types MUST be defined as named types in\n> the components.schemas section. Inline anonymous object definitions are\n> strictly prohibited.\n> \n> This components object should include:\n> \n> - Main entity types (IEntityName)\n> - Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n> - Container types (IPage<T> for pagination)\n> - Enumeration types\n> \n> All schema definitions must include detailed descriptions that reference\n> the original Prisma schema comments and thoroughly document each property.\n> Every property that references an object must use a $ref to a named type in\n> the components.schemas section. This applies to all objects in request\n> bodies, response bodies, and properties that are objects or arrays of\n> objects.\n> \n> Example structure:\n> \n> ```typescript\n> {\n> components: {\n> schemas: {\n> IUser: {\n> type: \"object\",\n> properties: {\n> id: { type: \"string\", format: \"uuid\" },\n> email: { type: \"string\", format: \"email\" },\n> profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n> },\n> required: [\"id\", \"email\"],\n> description: \"User entity representing system account holders...\"\n> },\n> \"IUser.ICreate\": { ... },\n> // Additional schemas\n> }\n> }\n> }\n> ```",
|
|
346
415
|
type: "object",
|
|
347
416
|
properties: {
|
|
348
417
|
components: {
|
|
349
|
-
|
|
418
|
+
title: "Complete set of schema components for the OpenAPI specification",
|
|
419
|
+
$ref: "#/$defs/AutoBeOpenApi.IComponents"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
required: [
|
|
423
|
+
"components"
|
|
424
|
+
],
|
|
425
|
+
additionalProperties: false,
|
|
426
|
+
$defs: {
|
|
427
|
+
"AutoBeOpenApi.IComponents": {
|
|
428
|
+
description: "Reusable components in OpenAPI.\n\nA storage of reusable components in OpenAPI document.\n\nIn other words, it is a storage of named DTO schemas and security schemes.\n\n### Description of {@link schemas} property:\n\n> An object to hold reusable DTO schemas.\n> \n> In other words, a collection of named JSON schemas.\n> \n> IMPORTANT: For each schema in this collection:\n> \n> 1. EVERY schema MUST have a detailed description that references and aligns\n> with the description comments from the corresponding Prisma DB schema\n> tables\n> 2. EACH property within the schema MUST have detailed descriptions that\n> reference and align with the description comments from the\n> corresponding DB schema columns\n> 3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n> line breaks) when appropriate\n> 4. Descriptions should be comprehensive enough that anyone reading them can\n> understand the purpose, functionality, and constraints of each type\n> and property without needing to reference other documentation",
|
|
350
429
|
type: "object",
|
|
351
430
|
properties: {
|
|
352
431
|
schemas: {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
properties: {},
|
|
356
|
-
required: [],
|
|
357
|
-
additionalProperties: {
|
|
358
|
-
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. ALWAYS refer to and incorporate the description comments from the\n> corresponding Prisma DB schema tables and columns. The descriptions\n> should match the style, level of detail, and terminology used in the\n> Prisma schema.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. Descriptions should comprehensively cover:\n> \n> - The purpose and business meaning of the type or property\n> - Relationships to other entities\n> - Validation rules, constraints, and edge cases\n> - Usage context and examples when helpful\n> 4. For each property of an object type, ensure its description reflects the\n> corresponding column description in the Prisma DB schema, maintaining\n> the same level of detail and terminology\n> 5. Descriptions should be so detailed and clear that anyone reading them can\n> fully understand the type or property without needing to reference any\n> other documentation",
|
|
359
|
-
type: "object",
|
|
360
|
-
properties: {
|
|
361
|
-
description: {
|
|
362
|
-
title: "Description about the type",
|
|
363
|
-
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages.",
|
|
364
|
-
type: "string"
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
required: [
|
|
368
|
-
"description"
|
|
369
|
-
]
|
|
370
|
-
}
|
|
432
|
+
title: "An object to hold reusable DTO schemas",
|
|
433
|
+
$ref: "#/$defs/RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
371
434
|
},
|
|
372
435
|
authorization: {
|
|
373
436
|
title: "Whether includes `Authorization` header or not",
|
|
374
437
|
description: "Whether includes `Authorization` header or not.",
|
|
375
|
-
type: "
|
|
376
|
-
|
|
377
|
-
|
|
438
|
+
type: "object",
|
|
439
|
+
properties: {
|
|
440
|
+
roles: {
|
|
441
|
+
type: "array",
|
|
442
|
+
items: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {
|
|
445
|
+
title: {
|
|
446
|
+
type: "string"
|
|
447
|
+
},
|
|
448
|
+
description: {
|
|
449
|
+
type: "string"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
required: [
|
|
453
|
+
"title",
|
|
454
|
+
"description"
|
|
455
|
+
]
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
required: [
|
|
460
|
+
"roles"
|
|
378
461
|
]
|
|
379
462
|
}
|
|
380
463
|
},
|
|
381
464
|
required: [
|
|
382
465
|
"schemas"
|
|
383
466
|
]
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return true;
|
|
397
|
-
return "object" === typeof value && null !== value && _io3(value);
|
|
398
|
-
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
399
|
-
path: _path + ".components",
|
|
400
|
-
expected: "AutoBeOpenApi.IComponents",
|
|
401
|
-
value: input.components
|
|
402
|
-
})) && _vo1(input.components, _path + ".components", true && _exceptionable) || _report(_exceptionable, {
|
|
403
|
-
path: _path + ".components",
|
|
404
|
-
expected: "AutoBeOpenApi.IComponents",
|
|
405
|
-
value: input.components
|
|
406
|
-
})].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => [("object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) || _report(_exceptionable, {
|
|
407
|
-
path: _path + ".schemas",
|
|
408
|
-
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
409
|
-
value: input.schemas
|
|
410
|
-
})) && _vo2(input.schemas, _path + ".schemas", true && _exceptionable) || _report(_exceptionable, {
|
|
411
|
-
path: _path + ".schemas",
|
|
412
|
-
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
413
|
-
value: input.schemas
|
|
414
|
-
}), undefined === input.authorization || "header" === input.authorization || _report(_exceptionable, {
|
|
415
|
-
path: _path + ".authorization",
|
|
416
|
-
expected: "(\"header\" | undefined)",
|
|
417
|
-
value: input.authorization
|
|
418
|
-
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
419
|
-
const value = input[key];
|
|
420
|
-
if (undefined === value)
|
|
421
|
-
return true;
|
|
422
|
-
return ("object" === typeof value && null !== value || _report(_exceptionable, {
|
|
423
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
424
|
-
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
425
|
-
value: value
|
|
426
|
-
})) && _vo3(value, _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key), true && _exceptionable) || _report(_exceptionable, {
|
|
427
|
-
path: _path + __typia_transform__accessExpressionAsString._accessExpressionAsString(key),
|
|
428
|
-
expected: "AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>",
|
|
429
|
-
value: value
|
|
430
|
-
});
|
|
431
|
-
}).every(flag => flag)].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.description || _report(_exceptionable, {
|
|
432
|
-
path: _path + ".description",
|
|
433
|
-
expected: "string",
|
|
434
|
-
value: input.description
|
|
435
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
436
|
-
if (false === __is(input)) {
|
|
437
|
-
errors = [];
|
|
438
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
439
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
440
|
-
path: _path + "",
|
|
441
|
-
expected: "IMakeComponentsProps",
|
|
442
|
-
value: input
|
|
443
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
444
|
-
path: _path + "",
|
|
445
|
-
expected: "IMakeComponentsProps",
|
|
446
|
-
value: input
|
|
447
|
-
}))(input, "$input", true);
|
|
448
|
-
const success = 0 === errors.length;
|
|
449
|
-
return success ? {
|
|
450
|
-
success,
|
|
451
|
-
data: input
|
|
452
|
-
} : {
|
|
453
|
-
success,
|
|
454
|
-
errors,
|
|
455
|
-
data: input
|
|
456
|
-
};
|
|
457
|
-
}
|
|
458
|
-
return {
|
|
459
|
-
success: true,
|
|
460
|
-
data: input
|
|
461
|
-
};
|
|
462
|
-
}; })()
|
|
463
|
-
}
|
|
464
|
-
]
|
|
465
|
-
},
|
|
466
|
-
claude,
|
|
467
|
-
llama: claude,
|
|
468
|
-
deepseek: claude,
|
|
469
|
-
"3.1": claude,
|
|
470
|
-
"3.0": {
|
|
471
|
-
model: "3.0",
|
|
472
|
-
options: {
|
|
473
|
-
constraint: true,
|
|
474
|
-
recursive: 3,
|
|
475
|
-
separate: null
|
|
476
|
-
},
|
|
477
|
-
functions: [
|
|
478
|
-
{
|
|
479
|
-
name: "makeComponents",
|
|
480
|
-
parameters: {
|
|
481
|
-
type: "object",
|
|
482
|
-
properties: {
|
|
483
|
-
components: {
|
|
467
|
+
},
|
|
468
|
+
"RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
469
|
+
description: "Construct a type with a set of properties K of type T",
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {},
|
|
472
|
+
required: [],
|
|
473
|
+
additionalProperties: {
|
|
474
|
+
$ref: "#/$defs/AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
478
|
+
description: "Descriptive type schema info.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\nGenerative, but it has a `description` property which is required.\n\n`AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\nspecification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\nand duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\nand AI generation.\n\nCRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n\nWhen creating descriptions for components, types, and properties:\n\n1. ALWAYS refer to and incorporate the description comments from the\n corresponding Prisma DB schema tables and columns. The descriptions\n should match the style, level of detail, and terminology used in the\n Prisma schema.\n2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n line breaks. Single-paragraph descriptions should be avoided.\n3. Descriptions should comprehensively cover:\n\n - The purpose and business meaning of the type or property\n - Relationships to other entities\n - Validation rules, constraints, and edge cases\n - Usage context and examples when helpful\n4. For each property of an object type, ensure its description reflects the\n corresponding column description in the Prisma DB schema, maintaining\n the same level of detail and terminology\n5. Descriptions should be so detailed and clear that anyone reading them can\n fully understand the type or property without needing to reference any\n other documentation",
|
|
484
479
|
type: "object",
|
|
485
480
|
properties: {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
description: "An object to hold reusable DTO schemas.\n\nIn other words, a collection of named JSON schemas.\n\nIMPORTANT: For each schema in this collection:\n\n1. EVERY schema MUST have a detailed description that references and aligns\n with the description comments from the corresponding Prisma DB schema\n tables\n2. EACH property within the schema MUST have detailed descriptions that\n reference and align with the description comments from the\n corresponding DB schema columns\n3. All descriptions MUST be organized into MULTIPLE PARAGRAPHS (separated by\n line breaks) when appropriate\n4. Descriptions should be comprehensive enough that anyone reading them can\n understand the purpose, functionality, and constraints of each type\n and property without needing to reference other documentation\n\n------------------------------\n\nDescription of the current {@link RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Construct a type with a set of properties K of type T",
|
|
491
|
-
additionalProperties: {
|
|
492
|
-
type: "object",
|
|
493
|
-
properties: {
|
|
494
|
-
description: {
|
|
495
|
-
type: "string",
|
|
496
|
-
title: "Description about the type",
|
|
497
|
-
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages."
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
required: [
|
|
501
|
-
"description"
|
|
502
|
-
],
|
|
503
|
-
description: "Description of the current {@link AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema} type:\n\n> Descriptive type schema info.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` is a type schema info of the OpenAPI\n> Generative, but it has a `description` property which is required.\n> \n> `AutoBeOpenApi.IJsonSchemaDescriptive` basically follows the JSON schema\n> specification of OpenAPI v3.1, but a little bit shrunk to remove ambiguous\n> and duplicated expressions of OpenAPI v3.1 for the convenience, clarity,\n> and AI generation.\n> \n> CRITICAL INSTRUCTIONS FOR OPTIMAL AI GENERATION:\n> \n> When creating descriptions for components, types, and properties:\n> \n> 1. ALWAYS refer to and incorporate the description comments from the\n> corresponding Prisma DB schema tables and columns. The descriptions\n> should match the style, level of detail, and terminology used in the\n> Prisma schema.\n> 2. ALL descriptions MUST be organized into MULTIPLE PARAGRAPHS separated by\n> line breaks. Single-paragraph descriptions should be avoided.\n> 3. Descriptions should comprehensively cover:\n> \n> - The purpose and business meaning of the type or property\n> - Relationships to other entities\n> - Validation rules, constraints, and edge cases\n> - Usage context and examples when helpful\n> 4. For each property of an object type, ensure its description reflects the\n> corresponding column description in the Prisma DB schema, maintaining\n> the same level of detail and terminology\n> 5. Descriptions should be so detailed and clear that anyone reading them can\n> fully understand the type or property without needing to reference any\n> other documentation",
|
|
504
|
-
additionalProperties: false
|
|
505
|
-
}
|
|
506
|
-
},
|
|
507
|
-
authorization: {
|
|
508
|
-
type: "string",
|
|
509
|
-
"enum": [
|
|
510
|
-
"header"
|
|
511
|
-
],
|
|
512
|
-
title: "Whether includes `Authorization` header or not",
|
|
513
|
-
description: "Whether includes `Authorization` header or not."
|
|
481
|
+
description: {
|
|
482
|
+
title: "Description about the type",
|
|
483
|
+
description: "Description about the type.\n\nCRITICAL: This description MUST be extensively detailed and MUST\nreference and align with the description comments from the\ncorresponding Prisma DB schema tables and columns.\n\nThe description MUST be organized into MULTIPLE PARAGRAPHS (separated\nby line breaks) based on different aspects of the type:\n\n- The purpose and business meaning of the type\n- Relationships to other entities in the system\n- Validation rules, constraints, and edge cases\n- Usage context and examples when helpful\n\nThis structured approach improves readability and helps readers better\nunderstand the type's various characteristics and use cases. The\ndescription should be so comprehensive that anyone reading it can fully\nunderstand the type without needing to reference other documentation.\n\n> MUST be written in English. Never use other languages.",
|
|
484
|
+
type: "string"
|
|
514
485
|
}
|
|
515
486
|
},
|
|
516
487
|
required: [
|
|
517
|
-
"
|
|
518
|
-
]
|
|
519
|
-
description: "Complete set of schema components for the OpenAPI specification.\n\nThis property contains comprehensive type definitions for all entities in\nthe system. It is the central repository of all named schema types that\nwill be used throughout the API specification.\n\nCRITICAL REQUIREMENT: All object types MUST be defined as named types in\nthe components.schemas section. Inline anonymous object definitions are\nstrictly prohibited.\n\nThis components object should include:\n\n- Main entity types (IEntityName)\n- Operation-specific variants (.ICreate, .IUpdate, .ISummary, etc.)\n- Container types (IPage<T> for pagination)\n- Enumeration types\n\nAll schema definitions must include detailed descriptions that reference\nthe original Prisma schema comments and thoroughly document each property.\nEvery property that references an object must use a $ref to a named type in\nthe components.schemas section. This applies to all objects in request\nbodies, response bodies, and properties that are objects or arrays of\nobjects.\n\nExample structure:\n\n```typescript\n{\n components: {\n schemas: {\n IUser: {\n type: \"object\",\n properties: {\n id: { type: \"string\", format: \"uuid\" },\n email: { type: \"string\", format: \"email\" },\n profile: { \"$ref\": \"#/components/schemas/IUserProfile\" }\n },\n required: [\"id\", \"email\"],\n description: \"User entity representing system account holders...\"\n },\n \"IUser.ICreate\": { ... },\n // Additional schemas\n }\n }\n}\n```\n\n------------------------------\n\nDescription of the current {@link AutoBeOpenApi.IComponents} type:\n\n> Reusable components in OpenAPI.\n> \n> A storage of reusable components in OpenAPI document.\n> \n> In other words, it is a storage of named DTO schemas and security schemes.",
|
|
520
|
-
additionalProperties: false
|
|
488
|
+
"description"
|
|
489
|
+
]
|
|
521
490
|
}
|
|
522
|
-
}
|
|
523
|
-
required: [
|
|
524
|
-
"components"
|
|
525
|
-
],
|
|
526
|
-
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
527
|
-
additionalProperties: false
|
|
491
|
+
}
|
|
528
492
|
},
|
|
529
493
|
description: "Generate OpenAPI components containing named schema types.\n\nThis method receives a complete set of schema components and integrates\nthem into the final OpenAPI specification. It processes all entity schemas,\ntheir variants, and related type definitions to ensure a comprehensive and\nconsistent API design.\n\nThe provided components should include schemas for all entities identified\nin the previous phases of API path/method definition and operation\ncreation. This ensures that the final OpenAPI document has complete type\ncoverage for all operations.\n\nCRITICAL: All schema definitions must follow the established naming\nconventions (IEntityName, IEntityName.ICreate, etc.) and must be thoroughly\ndocumented with descriptions that reference the original Prisma schema\ncomments.",
|
|
530
|
-
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "
|
|
494
|
+
validate: (() => { const _io0 = input => "object" === typeof input.components && null !== input.components && _io1(input.components); const _io1 = input => "object" === typeof input.schemas && null !== input.schemas && false === Array.isArray(input.schemas) && _io2(input.schemas) && (undefined === input.authorization || "object" === typeof input.authorization && null !== input.authorization && _io4(input.authorization)); const _io2 = input => Object.keys(input).every(key => {
|
|
531
495
|
const value = input[key];
|
|
532
496
|
if (undefined === value)
|
|
533
497
|
return true;
|
|
534
498
|
return "object" === typeof value && null !== value && _io3(value);
|
|
535
|
-
}); const _io3 = input => "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
499
|
+
}); const _io3 = input => "string" === typeof input.description; const _io4 = input => Array.isArray(input.roles) && input.roles.every(elem => "object" === typeof elem && null !== elem && _io5(elem)); const _io5 = input => "string" === typeof input.title && "string" === typeof input.description; const _vo0 = (input, _path, _exceptionable = true) => [("object" === typeof input.components && null !== input.components || _report(_exceptionable, {
|
|
536
500
|
path: _path + ".components",
|
|
537
501
|
expected: "AutoBeOpenApi.IComponents",
|
|
538
502
|
value: input.components
|
|
@@ -548,9 +512,13 @@ const collection = {
|
|
|
548
512
|
path: _path + ".schemas",
|
|
549
513
|
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
550
514
|
value: input.schemas
|
|
551
|
-
}), undefined === input.authorization || "
|
|
515
|
+
}), undefined === input.authorization || ("object" === typeof input.authorization && null !== input.authorization || _report(_exceptionable, {
|
|
552
516
|
path: _path + ".authorization",
|
|
553
|
-
expected: "(
|
|
517
|
+
expected: "(__type | undefined)",
|
|
518
|
+
value: input.authorization
|
|
519
|
+
})) && _vo4(input.authorization, _path + ".authorization", true && _exceptionable) || _report(_exceptionable, {
|
|
520
|
+
path: _path + ".authorization",
|
|
521
|
+
expected: "(__type | undefined)",
|
|
554
522
|
value: input.authorization
|
|
555
523
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
556
524
|
const value = input[key];
|
|
@@ -569,6 +537,30 @@ const collection = {
|
|
|
569
537
|
path: _path + ".description",
|
|
570
538
|
expected: "string",
|
|
571
539
|
value: input.description
|
|
540
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [(Array.isArray(input.roles) || _report(_exceptionable, {
|
|
541
|
+
path: _path + ".roles",
|
|
542
|
+
expected: "Array<__type>",
|
|
543
|
+
value: input.roles
|
|
544
|
+
})) && input.roles.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
545
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
546
|
+
expected: "__type.o1",
|
|
547
|
+
value: elem
|
|
548
|
+
})) && _vo5(elem, _path + ".roles[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
549
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
550
|
+
expected: "__type.o1",
|
|
551
|
+
value: elem
|
|
552
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
553
|
+
path: _path + ".roles",
|
|
554
|
+
expected: "Array<__type>",
|
|
555
|
+
value: input.roles
|
|
556
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
|
|
557
|
+
path: _path + ".title",
|
|
558
|
+
expected: "string",
|
|
559
|
+
value: input.title
|
|
560
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
561
|
+
path: _path + ".description",
|
|
562
|
+
expected: "string",
|
|
563
|
+
value: input.description
|
|
572
564
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
573
565
|
if (false === __is(input)) {
|
|
574
566
|
errors = [];
|
|
@@ -600,5 +592,9 @@ const collection = {
|
|
|
600
592
|
}
|
|
601
593
|
]
|
|
602
594
|
},
|
|
595
|
+
claude,
|
|
596
|
+
llama: claude,
|
|
597
|
+
deepseek: claude,
|
|
598
|
+
"3.1": claude,
|
|
603
599
|
};
|
|
604
600
|
//# sourceMappingURL=orchestrateInterfaceComponents.js.map
|