@autobe/agent 0.9.2 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.js +11 -4
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +7 -6
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- 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 -653
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +4225 -6681
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +80 -321
- 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 +93 -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 +54 -142
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +189 -201
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +71 -174
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +706 -1099
- 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 +60 -177
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +502 -1073
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +519 -1125
- 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 +78 -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 +326 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.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/structures/IAutoBeRealizeCoderApplication.d.ts +39 -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 +142 -448
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +258 -532
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js +124 -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 +161 -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 +9 -12
- package/src/AutoBeAgent.ts +17 -3
- package/src/constants/AutoBeSystemPromptConstant.ts +7 -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 +129 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +148 -0
- package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +46 -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,86 @@ const claude = {
|
|
|
216
220
|
type: "object",
|
|
217
221
|
properties: {
|
|
218
222
|
components: {
|
|
219
|
-
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
|
|
223
|
+
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```",
|
|
224
|
+
$ref: "#/$defs/AutoBeOpenApi.IComponents"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
required: [
|
|
228
|
+
"components"
|
|
229
|
+
],
|
|
230
|
+
additionalProperties: false,
|
|
231
|
+
$defs: {
|
|
232
|
+
"AutoBeOpenApi.IComponents": {
|
|
233
|
+
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
234
|
type: "object",
|
|
221
235
|
properties: {
|
|
222
236
|
schemas: {
|
|
223
|
-
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
|
|
224
|
-
|
|
225
|
-
properties: {},
|
|
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
|
-
}
|
|
237
|
+
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",
|
|
238
|
+
$ref: "#/$defs/RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
241
239
|
},
|
|
242
240
|
authorization: {
|
|
243
|
-
title: "Whether includes `Authorization` header or not",
|
|
244
241
|
description: "Whether includes `Authorization` header or not.",
|
|
245
|
-
|
|
242
|
+
type: "object",
|
|
243
|
+
properties: {
|
|
244
|
+
roles: {
|
|
245
|
+
type: "array",
|
|
246
|
+
items: {
|
|
247
|
+
type: "object",
|
|
248
|
+
properties: {
|
|
249
|
+
title: {
|
|
250
|
+
type: "string"
|
|
251
|
+
},
|
|
252
|
+
description: {
|
|
253
|
+
type: "string"
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
required: [
|
|
257
|
+
"title",
|
|
258
|
+
"description"
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
required: [
|
|
264
|
+
"roles"
|
|
265
|
+
]
|
|
246
266
|
}
|
|
247
267
|
},
|
|
248
268
|
required: [
|
|
249
269
|
"schemas"
|
|
250
270
|
]
|
|
271
|
+
},
|
|
272
|
+
"RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
273
|
+
description: "Construct a type with a set of properties K of type T",
|
|
274
|
+
type: "object",
|
|
275
|
+
properties: {},
|
|
276
|
+
required: [],
|
|
277
|
+
additionalProperties: {
|
|
278
|
+
$ref: "#/$defs/AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
"AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
282
|
+
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",
|
|
283
|
+
type: "object",
|
|
284
|
+
properties: {
|
|
285
|
+
description: {
|
|
286
|
+
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.",
|
|
287
|
+
type: "string"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
required: [
|
|
291
|
+
"description"
|
|
292
|
+
]
|
|
251
293
|
}
|
|
252
|
-
}
|
|
253
|
-
required: [
|
|
254
|
-
"components"
|
|
255
|
-
],
|
|
256
|
-
additionalProperties: false,
|
|
257
|
-
$defs: {}
|
|
294
|
+
}
|
|
258
295
|
},
|
|
259
296
|
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 || "
|
|
297
|
+
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
298
|
const value = input[key];
|
|
262
299
|
if (undefined === value)
|
|
263
300
|
return true;
|
|
264
301
|
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, {
|
|
302
|
+
}); 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
303
|
path: _path + ".components",
|
|
267
304
|
expected: "AutoBeOpenApi.IComponents",
|
|
268
305
|
value: input.components
|
|
@@ -278,9 +315,13 @@ const claude = {
|
|
|
278
315
|
path: _path + ".schemas",
|
|
279
316
|
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
280
317
|
value: input.schemas
|
|
281
|
-
}), undefined === input.authorization || "
|
|
318
|
+
}), undefined === input.authorization || ("object" === typeof input.authorization && null !== input.authorization || _report(_exceptionable, {
|
|
319
|
+
path: _path + ".authorization",
|
|
320
|
+
expected: "(__type | undefined)",
|
|
321
|
+
value: input.authorization
|
|
322
|
+
})) && _vo4(input.authorization, _path + ".authorization", true && _exceptionable) || _report(_exceptionable, {
|
|
282
323
|
path: _path + ".authorization",
|
|
283
|
-
expected: "(
|
|
324
|
+
expected: "(__type | undefined)",
|
|
284
325
|
value: input.authorization
|
|
285
326
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
286
327
|
const value = input[key];
|
|
@@ -299,6 +340,30 @@ const claude = {
|
|
|
299
340
|
path: _path + ".description",
|
|
300
341
|
expected: "string",
|
|
301
342
|
value: input.description
|
|
343
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [(Array.isArray(input.roles) || _report(_exceptionable, {
|
|
344
|
+
path: _path + ".roles",
|
|
345
|
+
expected: "Array<__type>",
|
|
346
|
+
value: input.roles
|
|
347
|
+
})) && input.roles.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
348
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
349
|
+
expected: "__type.o1",
|
|
350
|
+
value: elem
|
|
351
|
+
})) && _vo5(elem, _path + ".roles[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
352
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
353
|
+
expected: "__type.o1",
|
|
354
|
+
value: elem
|
|
355
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
356
|
+
path: _path + ".roles",
|
|
357
|
+
expected: "Array<__type>",
|
|
358
|
+
value: input.roles
|
|
359
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
|
|
360
|
+
path: _path + ".title",
|
|
361
|
+
expected: "string",
|
|
362
|
+
value: input.title
|
|
363
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
364
|
+
path: _path + ".description",
|
|
365
|
+
expected: "string",
|
|
366
|
+
value: input.description
|
|
302
367
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
303
368
|
if (false === __is(input)) {
|
|
304
369
|
errors = [];
|
|
@@ -342,197 +407,88 @@ const collection = {
|
|
|
342
407
|
{
|
|
343
408
|
name: "makeComponents",
|
|
344
409
|
parameters: {
|
|
345
|
-
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
410
|
+
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
411
|
type: "object",
|
|
347
412
|
properties: {
|
|
348
413
|
components: {
|
|
349
|
-
|
|
414
|
+
$ref: "#/$defs/AutoBeOpenApi.IComponents"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
required: [
|
|
418
|
+
"components"
|
|
419
|
+
],
|
|
420
|
+
additionalProperties: false,
|
|
421
|
+
$defs: {
|
|
422
|
+
"AutoBeOpenApi.IComponents": {
|
|
423
|
+
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
424
|
type: "object",
|
|
351
425
|
properties: {
|
|
352
426
|
schemas: {
|
|
353
|
-
|
|
354
|
-
type: "object",
|
|
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
|
-
}
|
|
427
|
+
$ref: "#/$defs/RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
371
428
|
},
|
|
372
429
|
authorization: {
|
|
373
|
-
title: "Whether includes `Authorization` header or not",
|
|
374
430
|
description: "Whether includes `Authorization` header or not.",
|
|
375
|
-
type: "
|
|
376
|
-
|
|
377
|
-
|
|
431
|
+
type: "object",
|
|
432
|
+
properties: {
|
|
433
|
+
roles: {
|
|
434
|
+
type: "array",
|
|
435
|
+
items: {
|
|
436
|
+
type: "object",
|
|
437
|
+
properties: {
|
|
438
|
+
title: {
|
|
439
|
+
type: "string"
|
|
440
|
+
},
|
|
441
|
+
description: {
|
|
442
|
+
type: "string"
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
required: [
|
|
446
|
+
"title",
|
|
447
|
+
"description"
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
required: [
|
|
453
|
+
"roles"
|
|
378
454
|
]
|
|
379
455
|
}
|
|
380
456
|
},
|
|
381
457
|
required: [
|
|
382
458
|
"schemas"
|
|
383
459
|
]
|
|
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: {
|
|
460
|
+
},
|
|
461
|
+
"RecordstringAutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
462
|
+
description: "Construct a type with a set of properties K of type T",
|
|
463
|
+
type: "object",
|
|
464
|
+
properties: {},
|
|
465
|
+
required: [],
|
|
466
|
+
additionalProperties: {
|
|
467
|
+
$ref: "#/$defs/AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"AutoBeOpenApi.IJsonSchemaDescriptiveAutoBeOpenApi.IJsonSchema": {
|
|
471
|
+
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
472
|
type: "object",
|
|
485
473
|
properties: {
|
|
486
|
-
|
|
487
|
-
type: "
|
|
488
|
-
|
|
489
|
-
required: [],
|
|
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."
|
|
474
|
+
description: {
|
|
475
|
+
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.",
|
|
476
|
+
type: "string"
|
|
514
477
|
}
|
|
515
478
|
},
|
|
516
479
|
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
|
|
480
|
+
"description"
|
|
481
|
+
]
|
|
521
482
|
}
|
|
522
|
-
}
|
|
523
|
-
required: [
|
|
524
|
-
"components"
|
|
525
|
-
],
|
|
526
|
-
description: " Properties containing components to generate.\n\n------------------------------\n\nCurrent Type: {@link IMakeComponentsProps}",
|
|
527
|
-
additionalProperties: false
|
|
483
|
+
}
|
|
528
484
|
},
|
|
529
485
|
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 || "
|
|
486
|
+
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
487
|
const value = input[key];
|
|
532
488
|
if (undefined === value)
|
|
533
489
|
return true;
|
|
534
490
|
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, {
|
|
491
|
+
}); 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
492
|
path: _path + ".components",
|
|
537
493
|
expected: "AutoBeOpenApi.IComponents",
|
|
538
494
|
value: input.components
|
|
@@ -548,9 +504,13 @@ const collection = {
|
|
|
548
504
|
path: _path + ".schemas",
|
|
549
505
|
expected: "Record<string, AutoBeOpenApi.IJsonSchemaDescriptive<AutoBeOpenApi.IJsonSchema>>",
|
|
550
506
|
value: input.schemas
|
|
551
|
-
}), undefined === input.authorization || "
|
|
507
|
+
}), undefined === input.authorization || ("object" === typeof input.authorization && null !== input.authorization || _report(_exceptionable, {
|
|
552
508
|
path: _path + ".authorization",
|
|
553
|
-
expected: "(
|
|
509
|
+
expected: "(__type | undefined)",
|
|
510
|
+
value: input.authorization
|
|
511
|
+
})) && _vo4(input.authorization, _path + ".authorization", true && _exceptionable) || _report(_exceptionable, {
|
|
512
|
+
path: _path + ".authorization",
|
|
513
|
+
expected: "(__type | undefined)",
|
|
554
514
|
value: input.authorization
|
|
555
515
|
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => [false === _exceptionable || Object.keys(input).map(key => {
|
|
556
516
|
const value = input[key];
|
|
@@ -569,6 +529,30 @@ const collection = {
|
|
|
569
529
|
path: _path + ".description",
|
|
570
530
|
expected: "string",
|
|
571
531
|
value: input.description
|
|
532
|
+
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => [(Array.isArray(input.roles) || _report(_exceptionable, {
|
|
533
|
+
path: _path + ".roles",
|
|
534
|
+
expected: "Array<__type>",
|
|
535
|
+
value: input.roles
|
|
536
|
+
})) && input.roles.map((elem, _index2) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
537
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
538
|
+
expected: "__type.o1",
|
|
539
|
+
value: elem
|
|
540
|
+
})) && _vo5(elem, _path + ".roles[" + _index2 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
541
|
+
path: _path + ".roles[" + _index2 + "]",
|
|
542
|
+
expected: "__type.o1",
|
|
543
|
+
value: elem
|
|
544
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
545
|
+
path: _path + ".roles",
|
|
546
|
+
expected: "Array<__type>",
|
|
547
|
+
value: input.roles
|
|
548
|
+
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.title || _report(_exceptionable, {
|
|
549
|
+
path: _path + ".title",
|
|
550
|
+
expected: "string",
|
|
551
|
+
value: input.title
|
|
552
|
+
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
553
|
+
path: _path + ".description",
|
|
554
|
+
expected: "string",
|
|
555
|
+
value: input.description
|
|
572
556
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
573
557
|
if (false === __is(input)) {
|
|
574
558
|
errors = [];
|
|
@@ -600,5 +584,9 @@ const collection = {
|
|
|
600
584
|
}
|
|
601
585
|
]
|
|
602
586
|
},
|
|
587
|
+
claude,
|
|
588
|
+
llama: claude,
|
|
589
|
+
deepseek: claude,
|
|
590
|
+
"3.1": claude,
|
|
603
591
|
};
|
|
604
592
|
//# sourceMappingURL=orchestrateInterfaceComponents.js.map
|