@autobe/agent 0.5.0 ā 0.5.2
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 +22 -3
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +2 -2
- package/lib/index.mjs +686 -827
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +764 -915
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/package.json +4 -4
- package/src/AutoBeAgent.ts +29 -2
- package/src/constants/AutoBeSystemPromptConstant.ts +2 -2
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +112 -79
package/lib/index.mjs
CHANGED
|
@@ -5177,7 +5177,7 @@ const collection$3 = {
|
|
|
5177
5177
|
|
|
5178
5178
|
const transformPrismaCorrectHistories = result => [ {
|
|
5179
5179
|
type: "systemMessage",
|
|
5180
|
-
text: '# AutoBePrismaSyntax Validation Error Fixing Agent\n\nYou are a world-class Prisma schema validation and error resolution specialist working with structured AutoBePrismaSyntax definitions. Your primary mission is to analyze validation errors in IAutoBePrismaValidation.IFailure responses and provide precise fixes while maintaining complete schema integrity and business logic.\n\n## Core Operating Principles\n\n### š« ABSOLUTE PROHIBITIONS\n- **NEVER ask for clarification** - analyze and fix validation errors directly\n- **NEVER remove or modify existing business logic** unless it causes validation errors\n- **NEVER delete model descriptions or field descriptions** unless removing duplicate elements\n- **NEVER create new duplicate fields, relations, or models**\n- **NEVER ignore validation errors** - every error must be addressed\n- **NEVER break existing relationships** unless they\'re causing validation errors\n- **NEVER change data types** unless specifically required by validation errors\n\n### ā
MANDATORY REQUIREMENTS\n- **Fix ALL validation errors** listed in the IAutoBePrismaValidation.IFailure.errors array\n- **Preserve business intent** and architectural patterns from original schema\n- **Return complete AutoBePrismaSyntax.IApplication** structure with all fixes applied\n- **Maintain referential integrity** across all models and relationships\n- **Preserve ALL model and field descriptions** (except for removed duplicates)\n- **Keep original naming conventions** unless they cause validation errors\n\n## Error Analysis & Resolution Strategy\n\n### 1. Validation Error Processing\n\n#### Error Structure Analysis\n```typescript\ninterface IError {\n path: string; // File path where error occurs\n table: string; // Model name with the error\n column: string | null; // Field name (null for model-level errors)\n message: string; // Detailed error description\n}\n```\n\n#### Error Categorization\n- **Model-level errors** (column: null): Duplicate models, invalid model names, missing primary keys\n- **Field-level errors** (column: string): Duplicate fields, invalid types, missing foreign keys\n- **Relationship errors**: Invalid references, missing target models, circular dependencies\n- **Index errors**: Invalid field references, duplicate indexes\n- **Cross-file errors**: References to non-existent models across files\n\n### 2. Common Validation Errors & Solutions\n\n#### Duplication Errors\n- **Duplicate model names across files**\n - Rename one model with domain-specific prefix/suffix\n - Update all references to renamed model in foreign keys and relations\n- **Duplicate field names within model**\n - Remove or rename duplicate field (preserve most appropriate one)\n - Update any references or indexes that use the renamed field\n- **Duplicate relation names within model**\n - Rename conflicting relation with descriptive suffix\n - Ensure relation names don\'t conflict with field names\n\n#### Reference Errors\n- **Invalid target model in foreign field**\n - Update targetModel to correct existing model name\n - Verify model exists in the specified file\n- **Invalid target field in foreign field**\n - Usually should be "id" - update targetfield property\n- **Missing foreign key for relation**\n - Add required foreign key field to foreignFields array\n - Ensure field name matches relation configuration\n\n#### Type Validation Errors\n- **Invalid field type**\n - Update to valid AutoBePrismaSyntax type (boolean, int, double, string, uri, uuid, date, datetime)\n- **Foreign key type mismatch**\n - Ensure all foreign keys use "uuid" type\n- **Primary key issues**\n - Ensure primaryField has type "uuid" and name "id"\n\n#### Index Validation Errors\n- **Invalid field names in indexes**\n - Update fieldNames array to reference existing fields only\n - Remove references to non-existent fields\n- **Single foreign key in indexes**\n - Remove single foreign key fields from plainIndexes and uniqueIndexes\n - Keep composite indexes that include foreign keys with other fields\n\n#### Naming Convention Errors\n- **Non-plural model names**\n - Update model name to plural form\n - Update all references in other models\' foreign keys and relations\n- **Invalid field naming**\n - Update to snake_case convention\n - Update any references in indexes\n\n### 3. Fix Implementation Strategy\n\n#### Error Processing Order\n1. **Model-level duplications** - Fix duplicate model names first\n2. **Field-level duplications** - Fix duplicate fields within models\n3. **Reference errors** - Fix invalid model/field references\n4. **Type validation** - Fix invalid data types\n5. **Index validation** - Fix invalid index configurations\n6. **Cross-validation** - Ensure all fixes maintain integrity\n\n#### Reference Update Process\nWhen renaming models or fields:\n1. **Update foreign key field names** in other models\n2. **Update targetModel references** in foreign field relations\n3. **Update index field references** that use renamed fields\n4. **Verify bidirectional relationships** remain consistent\n\n#### Business Logic Preservation\n- **Keep original field purposes** when fixing naming/type issues\n- **Maintain relationship semantics** when fixing reference errors\n- **Preserve data integrity constraints** when fixing index issues\n- **Keep audit trail patterns** (snapshots, timestamps) intact\n\n### 4. Validation Rules Compliance\n\n#### Model Validation\n- All model names must be plural and unique across all files\n- Each model must have exactly one primaryField with type "uuid" and name "id"\n- Materialized views must have material: true and name starting with "mv_"\n\n#### Field Validation\n- No duplicate field names within the same model\n- All foreign key fields must have type "uuid" and follow "{target_model}_id" pattern\n- All foreign fields must have corresponding relation configuration\n\n#### Relationship Validation\n- All targetModel references must point to existing models\n- All targetfield references should be "id" (primary key)\n- Relation names must be unique within each model\n- Relation names must not conflict with field names\n\n#### Index Validation\n- No single foreign key fields in plainIndexes or uniqueIndexes arrays\n- All fieldNames in indexes must reference existing fields in the model\n- Composite indexes can include foreign keys with other fields\n\n## Error Resolution Workflow\n\n### 1. Error Analysis Phase\n1. **Parse IAutoBePrismaValidation.IFailure** structure\n2. **Categorize errors by type** (duplication, reference, type, index, naming)\n3. **Group related errors** that might be fixed together\n4. **Plan fix sequence** to avoid creating new errors\n\n### 2. Fix Planning Phase\n1. **Identify models/fields to rename** for duplication resolution\n2. **Plan reference updates** for all affected elements\n3. **Determine minimal changes** needed for each error\n4. **Check for fix conflicts** that might create new errors\n\n### 3. Fix Implementation Phase\n1. **Apply duplication fixes** (renames, removals)\n2. **Update all references** to renamed elements\n3. **Fix type and validation errors**\n4. **Update indexes** to reference correct fields\n5. **Verify relationship integrity**\n\n### 4. Validation Phase\n1. **Check all errors are addressed**\n2. **Verify no new validation issues**\n3. **Confirm business logic preservation**\n4. **Validate cross-file reference integrity**\n\n## Input/Output Format\n\n### Input Structure\n```typescript\n{\n success: false,\n application: AutoBePrismaSyntax.IApplication,\n errors: IError[]\n}\n```\n\n### Output Requirement\nReturn corrected AutoBePrismaSyntax.IApplication structure:\n```typescript\nconst fixedApplication: AutoBePrismaSyntax.IApplication = {\n files: [\n // All files with errors fixed\n // Complete model definitions preserved\n // All descriptions and business logic maintained\n ]\n};\n```\n\n## Critical Success Criteria\n\n### ā
Must Achieve\n- [ ] All validation errors from IError[] array resolved\n- [ ] Original business logic and purpose preserved\n- [ ] All model and field descriptions maintained (except removed duplicates)\n- [ ] No new duplicate models, fields, or relations created\n- [ ] All cross-file references remain valid\n- [ ] Referential integrity maintained across all relationships\n- [ ] Naming conventions properly applied (plural models, snake_case fields)\n- [ ] Index configurations comply with rules (no single foreign keys)\n- [ ] Return complete AutoBePrismaSyntax.IApplication structure\n\n### š« Must Avoid\n- [ ] Ignoring any validation errors\n- [ ] Creating new duplications during fixes\n- [ ] Breaking existing business relationships\n- [ ] Removing necessary business logic\n- [ ] Making unnecessary changes beyond error fixes\n- [ ] Creating circular dependencies\n- [ ] Introducing type mismatches\n- [ ] Breaking cross-file reference integrity\n\n## Quality Assurance Process\n\n### Pre-Output Validation\n1. **Error Resolution Check**: Verify every error in the original IError[] array is addressed\n2. **Duplication Prevention**: Ensure no new duplicates are introduced\n3. **Reference Integrity**: Validate all foreign key references point to existing models/fields\n4. **Business Logic Preservation**: Confirm original intent and descriptions are maintained\n5. **Type Consistency**: Verify all types comply with AutoBePrismaSyntax requirements\n6. **Index Compliance**: Ensure index configurations follow the established rules\n\n### Response Validation Questions\n- Are all validation errors from the input resolved?\n- Do all model names follow plural naming convention?\n- Are all foreign key types "uuid" and properly referenced?\n- Do all indexes avoid single foreign key fields?\n- Are all cross-file model references valid?\n- Is the business logic from original descriptions preserved?\n\nRemember: Your goal is to be a precise validation error resolver, not a schema redesigner. Fix only what validation errors require, preserve all business intent, and maintain the integrity of the AutoBePrismaSyntax structure.'
|
|
5180
|
+
text: '# `AutoBePrisma` Targeted Validation Error Fixing Agent\n\nYou are a world-class Prisma schema validation and error resolution specialist working with structured `AutoBePrisma` definitions. Your primary mission is to analyze validation errors in `IAutoBePrismaValidation.IFailure` responses and provide precise fixes for **ONLY the affected tables/models** while maintaining complete schema integrity and business logic.\n\n## Core Operating Principles\n\n### š« ABSOLUTE PROHIBITIONS\n- **NEVER ask for clarification** - analyze and fix validation errors directly\n- **NEVER remove or modify existing business logic** unless it causes validation errors\n- **NEVER delete model descriptions or field descriptions** unless removing duplicate elements\n- **NEVER create new duplicate fields, relations, or models**\n- **NEVER ignore validation errors** - every error must be addressed\n- **NEVER break existing relationships** unless they\'re causing validation errors\n- **NEVER change data types** unless specifically required by validation errors\n- **š“ CRITICAL: NEVER delete fields or relationships to avoid compilation errors**\n- **š“ CRITICAL: Only delete elements when they are EXACT DUPLICATES of existing elements**\n- **š“ CRITICAL: Always FIX errors by correction, not by removal (unless duplicate)**\n- **š“ CRITICAL: NEVER modify tables/models that are not mentioned in validation errors**\n\n### ā
MANDATORY REQUIREMENTS\n- **Fix ONLY validation errors** listed in the IAutoBePrismaValidation.IFailure.errors array\n- **Return ONLY the corrected models/tables** that had validation errors\n- **Preserve business intent** and architectural patterns from original schema\n- **Maintain referential integrity** with unchanged models\n- **Preserve ALL model and field descriptions** (except for removed duplicates)\n- **Keep original naming conventions** unless they cause validation errors\n- **š¢ PRIORITY: Correct errors through proper fixes, not deletions**\n- **š¢ PRIORITY: Maintain ALL business functionality and data structure**\n- **š¢ PRIORITY: Minimize output scope to only affected models**\n\n## Targeted Fix Strategy\n\n### 1. Error Scope Analysis\n\n#### Error Filtering Process\n```typescript\ninterface IError {\n path: string; // File path where error occurs\n table: string; // Model name with the error - TARGET FOR FIX\n column: string | null; // Field name (null for model-level errors)\n message: string; // Detailed error description\n}\n```\n\n#### Affected Model Identification\n1. **Extract unique table names** from all errors in IError[] array\n2. **Group errors by table** for efficient processing\n3. **Identify cross-table dependencies** that need consideration\n4. **Focus ONLY on models mentioned in errors** - ignore all others\n5. **Track relationship impacts** on non-error models (for reference validation only)\n\n### 2. Targeted Error Resolution\n\n#### Model-Level Fixes (Scope: Single Model)\n- **Duplicate model names**: Rename affected model only\n- **Invalid model names**: Update naming convention for specific model\n- **Missing primary keys**: Add/fix primary key in affected model only\n- **Materialized view issues**: Fix material flag and naming for specific model\n\n#### Field-Level Fixes (Scope: Specific Fields in Error Models)\n- **Duplicate field names**: Fix only within the affected model\n- **Invalid field types**: Update types for specific fields only\n- **Missing foreign keys**: Add required foreign keys to affected model only\n- **Foreign key reference errors**: Fix references in affected model only\n\n#### Relationship Fixes (Scope: Affected Model Relations)\n- **Invalid target model references**: Update references in error model only\n- **Missing relation configurations**: Add/fix relations in affected model only\n- **Relation naming conflicts**: Resolve conflicts within affected model only\n\n#### Index Fixes (Scope: Affected Model Indexes)\n- **Invalid field references**: Fix index fieldNames in affected model only\n- **Single foreign key indexes**: Restructure indexes in affected model only\n- **Duplicate indexes**: Remove duplicates within affected model only\n\n### 3. Cross-Model Impact Analysis\n\n#### Reference Validation (Read-Only for Non-Error Models)\n- **Verify target model existence** for foreign key references\n- **Check target field validity** (usually "id" primary key)\n- **Validate bidirectional relationship consistency**\n- **Ensure renamed model references are updated** in other models\n\n#### Dependency Tracking\n- **Identify models that reference** the corrected models\n- **Note potential cascade effects** of model/field renaming\n- **Flag models that may need reference updates** (for external handling)\n- **Maintain awareness of schema-wide implications**\n\n### 4. Minimal Output Strategy\n\n#### Output Scope Determination\n**Include in output ONLY:**\n1. **Models explicitly mentioned in validation errors**\n2. **Models with fields that reference renamed models** (if any)\n3. **Models that require relationship updates** due to fixes\n\n**Exclude from output:**\n1. **Models with no validation errors**\n2. **Models not affected by fixes**\n3. **Models that maintain valid references to corrected models**\n\n#### Fix Documentation\nFor each corrected model, provide:\n- **Original error description**\n- **Applied fix explanation**\n- **Impact on other models** (reference updates needed)\n- **Business logic preservation confirmation**\n\n## Error Resolution Workflow\n\n### 1. Error Parsing & Scope Definition\n1. **Parse IAutoBePrismaValidation.IFailure** structure\n2. **Extract unique table names** from error array\n3. **Group errors by affected model** for batch processing\n4. **Identify minimal fix scope** - only what\'s necessary\n5. **Plan cross-model reference updates** (if needed)\n\n### 2. Targeted Fix Planning\n1. **Analyze each error model individually**\n2. **Plan fixes for each affected model**\n3. **Check for inter-model dependency impacts**\n4. **Determine minimal output scope**\n5. **Validate fix feasibility without breaking references**\n\n### 3. Precision Fix Implementation\n1. **Apply fixes ONLY to error models**\n2. **Update cross-references ONLY if needed**\n3. **Preserve all unchanged model integrity**\n4. **Maintain business logic in fixed models**\n5. **Verify minimal scope compliance**\n\n### 4. Output Validation\n1. **Confirm all errors are addressed** in affected models\n2. **Verify no new validation issues** in fixed models\n3. **Check reference integrity** with unchanged models\n4. **Validate business logic preservation** in corrected models\n5. **Ensure minimal output scope** - no unnecessary models included\n\n## Input/Output Format\n\n### Input Structure\n```typescript\n{\n success: false,\n application: AutoBePrisma.IApplication, // Full schema for reference\n errors: IError[] // Target models for fixing\n}\n```\n\n### Output Requirement\nReturn ONLY corrected models that had validation errors:\n```typescript\nconst correctedModels: AutoBePrisma.IModel[] = [\n // ONLY models mentioned in IError[] array\n // ONLY models affected by cross-reference updates\n // All other models are preserved unchanged\n];\n\n// Include metadata about the fix scope\nconst fixSummary = {\n correctedModels: string[], // Names of models that were fixed\n crossReferenceUpdates: string[], // Models that needed reference updates\n preservedModels: string[], // Models that remain unchanged\n errorsCorrected: number // Count of resolved errors\n};\n```\n\n## Targeted Correction Examples\n\n### Example 1: Single Model Duplicate Field Error\n**Input Error:**\n```typescript\n{\n path: "users.prisma",\n table: "users",\n column: "email",\n message: "Duplicate field \'email\' in model \'users\'"\n}\n```\n\n**Output:** Only the `users` model with the duplicate field resolved\n- **Scope:** 1 model\n- **Change:** Rename one `email` field to `email_secondary` or merge if identical\n- **Excluded:** All other models remain unchanged\n\n### Example 2: Cross-Model Reference Error\n**Input Error:**\n```typescript\n{\n path: "orders.prisma",\n table: "orders",\n column: "user_id",\n message: "Invalid target model \'user\' for foreign key \'user_id\'"\n}\n```\n\n**Output:** Only the `orders` model with corrected reference\n- **Scope:** 1 model (orders)\n- **Change:** Update `targetModel` from "user" to "users"\n- **Excluded:** The `users` model remains unchanged (just referenced correctly)\n\n### Example 3: Model Name Duplication Across Files\n**Input Errors:**\n```typescript\n[\n {\n path: "auth/users.prisma",\n table: "users",\n column: null,\n message: "Duplicate model name \'users\'"\n },\n {\n path: "admin/users.prisma",\n table: "users",\n column: null,\n message: "Duplicate model name \'users\'"\n }\n]\n```\n\n**Output:** Both affected `users` models with one renamed\n- **Scope:** 2 models\n- **Change:** Rename one to `admin_users`, update all its references\n- **Excluded:** All other models that don\'t reference the renamed model\n\n## Critical Success Criteria\n\n### ā
Must Achieve (Targeted Scope)\n- [ ] All validation errors resolved **for mentioned models only**\n- [ ] Original business logic preserved **in corrected models**\n- [ ] Cross-model references remain valid **through minimal updates**\n- [ ] Output contains **ONLY affected models** - no unnecessary inclusions\n- [ ] Referential integrity maintained **with unchanged models**\n- [ ] **š“ MINIMAL SCOPE: Only error models + necessary reference updates**\n- [ ] **š“ UNCHANGED MODELS: Preserved completely in original schema**\n\n### š« Must Avoid (Scope Violations)\n- [ ] Including models without validation errors in output\n- [ ] Modifying models not mentioned in error array\n- [ ] Returning entire schema when only partial fixes needed\n- [ ] Making unnecessary changes beyond error resolution\n- [ ] Breaking references to unchanged models\n- [ ] **š“ SCOPE CREEP: Fixing models that don\'t have errors**\n- [ ] **š“ OUTPUT BLOAT: Including unchanged models in response**\n\n## Quality Assurance Process\n\n### Pre-Output Scope Validation\n1. **Error Coverage Check**: Every error in IError[] array addressed **in minimal scope**\n2. **Output Scope Audit**: Only affected models included in response\n3. **Reference Integrity**: Unchanged models maintain valid references\n4. **Business Logic Preservation**: Corrected models maintain original intent\n5. **Cross-Model Impact**: Necessary reference updates identified and applied\n6. ****š“ Minimal Output Verification**: No unnecessary models in response**\n7. **š“ Unchanged Model Preservation**: Non-error models completely preserved**\n\n### Targeted Response Validation Questions\n- Are all validation errors resolved **with minimal model changes**?\n- Does the output include **ONLY models that had errors** or needed reference updates?\n- Are **unchanged models completely preserved** in the original schema?\n- Do **cross-model references remain valid** after targeted fixes?\n- Is the **business logic maintained** in all corrected models?\n- **š“ Is the output scope minimized** to only necessary corrections?\n- **š“ Are non-error models excluded** from the response?\n\n## šÆ CORE PRINCIPLE REMINDER\n\n**Your role is TARGETED ERROR CORRECTOR, not SCHEMA RECONSTRUCTOR**\n\n- Fix **ONLY the models with validation errors**\n- Preserve **ALL unchanged models** in their original state\n- Return **MINIMAL output scope** - only what was corrected\n- Maintain **referential integrity** with unchanged models\n- **Focus on precision fixes, not comprehensive rebuilds**\n\nRemember: Your goal is to be a surgical validation error resolver, fixing only what\'s broken while preserving the integrity of the unchanged schema components. **Minimize context usage by returning only the corrected models, not the entire schema.**'
|
|
5181
5181
|
}, {
|
|
5182
5182
|
type: "assistantMessage",
|
|
5183
5183
|
text: [ "Here is the Prisma application data what you made:", "", "```json", JSON.stringify(result.data), "```" ].join("\n")
|
|
@@ -5190,6 +5190,13 @@ const transformPrismaCorrectHistories = result => [ {
|
|
|
5190
5190
|
} ];
|
|
5191
5191
|
|
|
5192
5192
|
function orchestratePrismaCorrect(ctx, application, retry = 8) {
|
|
5193
|
+
const unique = new Set;
|
|
5194
|
+
for (const file of application.files) file.models = file.models.filter((model => {
|
|
5195
|
+
if (unique.has(model.name)) return false;
|
|
5196
|
+
unique.add(model.name);
|
|
5197
|
+
return true;
|
|
5198
|
+
}));
|
|
5199
|
+
application.files = application.files.filter((f => f.models.length !== 0));
|
|
5193
5200
|
return step(ctx, application);
|
|
5194
5201
|
}
|
|
5195
5202
|
|
|
@@ -5235,18 +5242,26 @@ async function step(ctx, application, life) {
|
|
|
5235
5242
|
console.error("Unreachable error: PrismaCompilerAgent.pointer.value is null");
|
|
5236
5243
|
return result;
|
|
5237
5244
|
}
|
|
5245
|
+
const correction = {
|
|
5246
|
+
files: application.files.map((file => ({
|
|
5247
|
+
filename: file.filename,
|
|
5248
|
+
namespace: file.namespace,
|
|
5249
|
+
models: file.models.map((model => {
|
|
5250
|
+
const newbie = pointer.value.models.find((m => m.name === model.name));
|
|
5251
|
+
return newbie ?? model;
|
|
5252
|
+
}))
|
|
5253
|
+
})))
|
|
5254
|
+
};
|
|
5238
5255
|
ctx.dispatch({
|
|
5239
5256
|
type: "prismaCorrect",
|
|
5240
5257
|
failure: result,
|
|
5241
|
-
correction
|
|
5242
|
-
files: pointer.value.files
|
|
5243
|
-
},
|
|
5258
|
+
correction,
|
|
5244
5259
|
planning: pointer.value.planning,
|
|
5245
5260
|
step: ctx.state().analyze?.step ?? 0,
|
|
5246
5261
|
created_at: (new Date).toISOString()
|
|
5247
5262
|
});
|
|
5248
5263
|
return step(ctx, {
|
|
5249
|
-
files:
|
|
5264
|
+
files: correction.files
|
|
5250
5265
|
});
|
|
5251
5266
|
}
|
|
5252
5267
|
|
|
@@ -5278,310 +5293,256 @@ const claude$2 = {
|
|
|
5278
5293
|
type: "object",
|
|
5279
5294
|
properties: {
|
|
5280
5295
|
planning: {
|
|
5281
|
-
|
|
5282
|
-
description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\nš Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\nš” Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints",
|
|
5296
|
+
description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\nš Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types, indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\nš” Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these",
|
|
5283
5297
|
type: "string"
|
|
5284
5298
|
},
|
|
5285
|
-
|
|
5286
|
-
description: "
|
|
5299
|
+
models: {
|
|
5300
|
+
description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\nš„ Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\nš Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\nš Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\nā ļø Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\nšÆ Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models",
|
|
5287
5301
|
type: "array",
|
|
5288
5302
|
items: {
|
|
5289
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
5303
|
+
description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based on the uploaded schemas, models follow specific patterns:\n> \n> - Main business entities (e.g., shopping_sales, shopping_customers)\n> - Snapshot/versioning entities for audit trails (e.g.,\n> shopping_sale_snapshots)\n> - Junction tables for M:N relationships (e.g.,\n> shopping_cart_commodity_stocks)\n> - Materialized views for performance (prefixed with mv_)",
|
|
5290
5304
|
type: "object",
|
|
5291
5305
|
properties: {
|
|
5292
|
-
|
|
5293
|
-
title: "Name of the
|
|
5294
|
-
description: 'Name of the
|
|
5306
|
+
name: {
|
|
5307
|
+
title: "Name of the Prisma model (database table name)",
|
|
5308
|
+
description: 'Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n"shopping_customers", "shopping_sale_snapshots", "bbs_articles"\nMaterialized views use "mv_" prefix: "mv_shopping_sale_last_snapshots"',
|
|
5295
5309
|
type: "string",
|
|
5296
|
-
pattern: "^[a-
|
|
5310
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
5297
5311
|
},
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
description: 'Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as "@\\namespace directive".\nExamples from uploaded schemas: "Systematic", "Actors", "Sales", "Carts",\n"Orders", "Coupons", "Coins", "Inquiries", "Favorites", "Articles"',
|
|
5312
|
+
description: {
|
|
5313
|
+
description: 'Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using "{@\\link ModelName}" syntax Example:\n "Customer information, but not a person but a **connection** basis..."',
|
|
5301
5314
|
type: "string"
|
|
5302
5315
|
},
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5316
|
+
material: {
|
|
5317
|
+
description: 'Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They\'re marked as "@\\hidden" in documentation and prefixed with\n"mv_" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices',
|
|
5318
|
+
type: "boolean"
|
|
5319
|
+
},
|
|
5320
|
+
primaryField: {
|
|
5321
|
+
description: 'The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with "@\\id"\ndirective. Usually named "id" and marked with "@\\db.Uuid" for PostgreSQL\nmapping.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).',
|
|
5322
|
+
type: "object",
|
|
5323
|
+
properties: {
|
|
5324
|
+
name: {
|
|
5325
|
+
title: "Name of the primary key field",
|
|
5326
|
+
description: 'Name of the primary key field.\n\nConsistently named "id" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.',
|
|
5327
|
+
type: "string",
|
|
5328
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
5329
|
+
},
|
|
5330
|
+
type: {
|
|
5331
|
+
title: "Data type of the primary key field",
|
|
5332
|
+
description: 'Data type of the primary key field.\n\nAlways "uuid" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.',
|
|
5333
|
+
const: "uuid"
|
|
5334
|
+
},
|
|
5335
|
+
description: {
|
|
5336
|
+
title: "Description of the primary key field's purpose",
|
|
5337
|
+
description: 'Description of the primary key field\'s purpose.\n\nStandard description is "Primary Key." across all models. Serves as the\nunique identifier for the model instance.',
|
|
5338
|
+
type: "string"
|
|
5339
|
+
}
|
|
5340
|
+
},
|
|
5341
|
+
required: [ "name", "type", "description" ]
|
|
5342
|
+
},
|
|
5343
|
+
foreignFields: {
|
|
5344
|
+
title: "Array of foreign key fields that reference other models",
|
|
5345
|
+
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
|
|
5306
5346
|
type: "array",
|
|
5307
5347
|
items: {
|
|
5308
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
5348
|
+
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
5309
5349
|
type: "object",
|
|
5310
5350
|
properties: {
|
|
5311
5351
|
name: {
|
|
5312
|
-
title: "Name of the
|
|
5313
|
-
description: 'Name of the
|
|
5352
|
+
title: "Name of the foreign key field",
|
|
5353
|
+
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)',
|
|
5314
5354
|
type: "string",
|
|
5315
5355
|
pattern: "^[a-z][a-z0-9_]*$"
|
|
5316
5356
|
},
|
|
5357
|
+
type: {
|
|
5358
|
+
title: "Data type of the foreign key field",
|
|
5359
|
+
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.',
|
|
5360
|
+
const: "uuid"
|
|
5361
|
+
},
|
|
5317
5362
|
description: {
|
|
5318
|
-
description: '
|
|
5363
|
+
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.',
|
|
5319
5364
|
type: "string"
|
|
5320
5365
|
},
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
},
|
|
5325
|
-
primaryField: {
|
|
5326
|
-
description: 'The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with "@\\id"\ndirective. Usually named "id" and marked with "@\\db.Uuid" for PostgreSQL\nmapping.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).',
|
|
5366
|
+
relation: {
|
|
5367
|
+
title: "Prisma relation configuration defining the association details",
|
|
5368
|
+
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
5327
5369
|
type: "object",
|
|
5328
5370
|
properties: {
|
|
5329
5371
|
name: {
|
|
5330
|
-
title: "Name of the
|
|
5331
|
-
description: 'Name of the
|
|
5372
|
+
title: "Name of the relation property in the Prisma model",
|
|
5373
|
+
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"',
|
|
5332
5374
|
type: "string",
|
|
5333
|
-
pattern: "^[a-
|
|
5375
|
+
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
5334
5376
|
},
|
|
5335
|
-
|
|
5336
|
-
title: "
|
|
5337
|
-
description: '
|
|
5338
|
-
const: "uuid"
|
|
5339
|
-
},
|
|
5340
|
-
description: {
|
|
5341
|
-
title: "Description of the primary key field's purpose",
|
|
5342
|
-
description: 'Description of the primary key field\'s purpose.\n\nStandard description is "Primary Key." across all models. Serves as the\nunique identifier for the model instance.',
|
|
5377
|
+
targetModel: {
|
|
5378
|
+
title: "Name of the target model being referenced",
|
|
5379
|
+
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"',
|
|
5343
5380
|
type: "string"
|
|
5344
5381
|
}
|
|
5345
5382
|
},
|
|
5346
|
-
required: [ "name", "
|
|
5383
|
+
required: [ "name", "targetModel" ]
|
|
5347
5384
|
},
|
|
5348
|
-
|
|
5349
|
-
title: "
|
|
5350
|
-
description: "
|
|
5351
|
-
type: "
|
|
5352
|
-
items: {
|
|
5353
|
-
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
5354
|
-
type: "object",
|
|
5355
|
-
properties: {
|
|
5356
|
-
name: {
|
|
5357
|
-
title: "Name of the foreign key field",
|
|
5358
|
-
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)',
|
|
5359
|
-
type: "string",
|
|
5360
|
-
pattern: "^[a-z][a-z0-9_]*$"
|
|
5361
|
-
},
|
|
5362
|
-
type: {
|
|
5363
|
-
title: "Data type of the foreign key field",
|
|
5364
|
-
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.',
|
|
5365
|
-
const: "uuid"
|
|
5366
|
-
},
|
|
5367
|
-
description: {
|
|
5368
|
-
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.',
|
|
5369
|
-
type: "string"
|
|
5370
|
-
},
|
|
5371
|
-
relation: {
|
|
5372
|
-
title: "Prisma relation configuration defining the association details",
|
|
5373
|
-
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
5374
|
-
type: "object",
|
|
5375
|
-
properties: {
|
|
5376
|
-
name: {
|
|
5377
|
-
title: "Name of the relation property in the Prisma model",
|
|
5378
|
-
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"',
|
|
5379
|
-
type: "string",
|
|
5380
|
-
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
5381
|
-
},
|
|
5382
|
-
targetModel: {
|
|
5383
|
-
title: "Name of the target model being referenced",
|
|
5384
|
-
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"',
|
|
5385
|
-
type: "string"
|
|
5386
|
-
}
|
|
5387
|
-
},
|
|
5388
|
-
required: [ "name", "targetModel" ]
|
|
5389
|
-
},
|
|
5390
|
-
unique: {
|
|
5391
|
-
title: "Whether this foreign key has a unique constraint",
|
|
5392
|
-
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
5393
|
-
type: "boolean"
|
|
5394
|
-
},
|
|
5395
|
-
nullable: {
|
|
5396
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
5397
|
-
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
5398
|
-
type: "boolean"
|
|
5399
|
-
}
|
|
5400
|
-
},
|
|
5401
|
-
required: [ "name", "type", "description", "relation", "unique", "nullable" ]
|
|
5402
|
-
}
|
|
5385
|
+
unique: {
|
|
5386
|
+
title: "Whether this foreign key has a unique constraint",
|
|
5387
|
+
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
5388
|
+
type: "boolean"
|
|
5403
5389
|
},
|
|
5404
|
-
|
|
5405
|
-
title: "
|
|
5406
|
-
description: "
|
|
5407
|
-
type: "
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
const: "uuid"
|
|
5427
|
-
}, {
|
|
5428
|
-
const: "uri"
|
|
5429
|
-
}, {
|
|
5430
|
-
const: "int"
|
|
5431
|
-
}, {
|
|
5432
|
-
const: "double"
|
|
5433
|
-
}, {
|
|
5434
|
-
const: "datetime"
|
|
5435
|
-
} ]
|
|
5436
|
-
},
|
|
5437
|
-
description: {
|
|
5438
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
5439
|
-
description: 'Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: "Amount of cash payment." or\n "Whether the unit is required or not."',
|
|
5440
|
-
type: "string"
|
|
5441
|
-
},
|
|
5442
|
-
nullable: {
|
|
5443
|
-
title: "Whether this field can contain null values",
|
|
5444
|
-
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
5445
|
-
type: "boolean"
|
|
5446
|
-
}
|
|
5447
|
-
},
|
|
5448
|
-
required: [ "name", "type", "description", "nullable" ]
|
|
5449
|
-
}
|
|
5390
|
+
nullable: {
|
|
5391
|
+
title: "Whether this foreign key can be null (optional relationship)",
|
|
5392
|
+
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
5393
|
+
type: "boolean"
|
|
5394
|
+
}
|
|
5395
|
+
},
|
|
5396
|
+
required: [ "name", "type", "description", "relation", "unique", "nullable" ]
|
|
5397
|
+
}
|
|
5398
|
+
},
|
|
5399
|
+
plainFields: {
|
|
5400
|
+
title: "Array of regular data fields that don't reference other models",
|
|
5401
|
+
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
|
|
5402
|
+
type: "array",
|
|
5403
|
+
items: {
|
|
5404
|
+
description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
|
|
5405
|
+
type: "object",
|
|
5406
|
+
properties: {
|
|
5407
|
+
name: {
|
|
5408
|
+
title: "Name of the field in the database table",
|
|
5409
|
+
description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative",
|
|
5410
|
+
type: "string",
|
|
5411
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
5450
5412
|
},
|
|
5451
|
-
|
|
5452
|
-
title: "
|
|
5453
|
-
description: "
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
unique: {
|
|
5470
|
-
title: "Explicit marker indicating this is a unique index",
|
|
5471
|
-
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".',
|
|
5472
|
-
const: true
|
|
5473
|
-
}
|
|
5474
|
-
},
|
|
5475
|
-
required: [ "fieldNames", "unique" ]
|
|
5476
|
-
}
|
|
5413
|
+
type: {
|
|
5414
|
+
title: "Data type of the field for Prisma schema generation",
|
|
5415
|
+
description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
|
|
5416
|
+
oneOf: [ {
|
|
5417
|
+
const: "string"
|
|
5418
|
+
}, {
|
|
5419
|
+
const: "boolean"
|
|
5420
|
+
}, {
|
|
5421
|
+
const: "uuid"
|
|
5422
|
+
}, {
|
|
5423
|
+
const: "uri"
|
|
5424
|
+
}, {
|
|
5425
|
+
const: "int"
|
|
5426
|
+
}, {
|
|
5427
|
+
const: "double"
|
|
5428
|
+
}, {
|
|
5429
|
+
const: "datetime"
|
|
5430
|
+
} ]
|
|
5477
5431
|
},
|
|
5478
|
-
|
|
5479
|
-
title: "
|
|
5480
|
-
description:
|
|
5432
|
+
description: {
|
|
5433
|
+
title: "Description explaining the business purpose and usage of this field",
|
|
5434
|
+
description: 'Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: "Amount of cash payment." or\n "Whether the unit is required or not."',
|
|
5435
|
+
type: "string"
|
|
5436
|
+
},
|
|
5437
|
+
nullable: {
|
|
5438
|
+
title: "Whether this field can contain null values",
|
|
5439
|
+
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
5440
|
+
type: "boolean"
|
|
5441
|
+
}
|
|
5442
|
+
},
|
|
5443
|
+
required: [ "name", "type", "description", "nullable" ]
|
|
5444
|
+
}
|
|
5445
|
+
},
|
|
5446
|
+
uniqueIndexes: {
|
|
5447
|
+
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
5448
|
+
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
|
|
5449
|
+
type: "array",
|
|
5450
|
+
items: {
|
|
5451
|
+
description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
|
|
5452
|
+
type: "object",
|
|
5453
|
+
properties: {
|
|
5454
|
+
fieldNames: {
|
|
5455
|
+
title: "Array of field names that together form the unique constraint",
|
|
5456
|
+
description: 'Array of field names that together form the unique constraint.\n\nCan be single field (e.g., ["email"]) or composite (e.g., ["channel_id",\n"code"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: ["code"], ["shopping_channel_id",\n"nickname"], ["email"]',
|
|
5481
5457
|
type: "array",
|
|
5482
5458
|
items: {
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
title: "Array of field names to include in the performance index",
|
|
5488
|
-
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]',
|
|
5489
|
-
type: "array",
|
|
5490
|
-
items: {
|
|
5491
|
-
type: "string"
|
|
5492
|
-
},
|
|
5493
|
-
minItems: 1,
|
|
5494
|
-
uniqueItems: true
|
|
5495
|
-
}
|
|
5496
|
-
},
|
|
5497
|
-
required: [ "fieldNames" ]
|
|
5498
|
-
}
|
|
5459
|
+
type: "string"
|
|
5460
|
+
},
|
|
5461
|
+
minItems: 1,
|
|
5462
|
+
uniqueItems: true
|
|
5499
5463
|
},
|
|
5500
|
-
|
|
5501
|
-
title: "
|
|
5502
|
-
description:
|
|
5464
|
+
unique: {
|
|
5465
|
+
title: "Explicit marker indicating this is a unique index",
|
|
5466
|
+
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".',
|
|
5467
|
+
const: true
|
|
5468
|
+
}
|
|
5469
|
+
},
|
|
5470
|
+
required: [ "fieldNames", "unique" ]
|
|
5471
|
+
}
|
|
5472
|
+
},
|
|
5473
|
+
plainIndexes: {
|
|
5474
|
+
title: "Array of regular indexes for query performance optimization",
|
|
5475
|
+
description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
|
|
5476
|
+
type: "array",
|
|
5477
|
+
items: {
|
|
5478
|
+
description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
|
|
5479
|
+
type: "object",
|
|
5480
|
+
properties: {
|
|
5481
|
+
fieldNames: {
|
|
5482
|
+
title: "Array of field names to include in the performance index",
|
|
5483
|
+
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]',
|
|
5503
5484
|
type: "array",
|
|
5504
5485
|
items: {
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
5510
|
-
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.',
|
|
5511
|
-
type: "string"
|
|
5512
|
-
}
|
|
5513
|
-
},
|
|
5514
|
-
required: [ "fieldName" ]
|
|
5515
|
-
}
|
|
5486
|
+
type: "string"
|
|
5487
|
+
},
|
|
5488
|
+
minItems: 1,
|
|
5489
|
+
uniqueItems: true
|
|
5516
5490
|
}
|
|
5517
5491
|
},
|
|
5518
|
-
required: [ "
|
|
5492
|
+
required: [ "fieldNames" ]
|
|
5493
|
+
}
|
|
5494
|
+
},
|
|
5495
|
+
ginIndexes: {
|
|
5496
|
+
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
5497
|
+
description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
|
|
5498
|
+
type: "array",
|
|
5499
|
+
items: {
|
|
5500
|
+
description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
|
|
5501
|
+
type: "object",
|
|
5502
|
+
properties: {
|
|
5503
|
+
fieldName: {
|
|
5504
|
+
title: "Name of the text field to index for full-text search capabilities",
|
|
5505
|
+
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.',
|
|
5506
|
+
type: "string"
|
|
5507
|
+
}
|
|
5508
|
+
},
|
|
5509
|
+
required: [ "fieldName" ]
|
|
5519
5510
|
}
|
|
5520
5511
|
}
|
|
5521
5512
|
},
|
|
5522
|
-
required: [ "
|
|
5513
|
+
required: [ "name", "description", "material", "primaryField", "foreignFields", "plainFields", "uniqueIndexes", "plainIndexes", "ginIndexes" ]
|
|
5523
5514
|
}
|
|
5524
5515
|
}
|
|
5525
5516
|
},
|
|
5526
|
-
required: [ "planning", "
|
|
5517
|
+
required: [ "planning", "models" ],
|
|
5527
5518
|
additionalProperties: false,
|
|
5528
5519
|
$defs: {}
|
|
5529
5520
|
},
|
|
5530
|
-
description: "Fixes validation errors in AutoBePrisma
|
|
5521
|
+
description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
|
|
5531
5522
|
validate: (() => {
|
|
5532
|
-
const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.
|
|
5533
|
-
const _io1 = input => "string" === typeof input.
|
|
5534
|
-
const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "
|
|
5535
|
-
const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description;
|
|
5536
|
-
const _io4 = input => "string" === typeof input.name && RegExp("^[a-
|
|
5537
|
-
const _io5 = input => "string" === typeof input.name && RegExp("^[a-
|
|
5538
|
-
const _io6 = input =>
|
|
5539
|
-
const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem)))
|
|
5540
|
-
const _io8 = input =>
|
|
5541
|
-
const _io9 = input => "string" === typeof input.fieldName;
|
|
5523
|
+
const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every((elem => "object" === typeof elem && null !== elem && _io1(elem))));
|
|
5524
|
+
const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every((elem => "object" === typeof elem && null !== elem && _io3(elem)))) && (Array.isArray(input.plainFields) && input.plainFields.every((elem => "object" === typeof elem && null !== elem && _io5(elem)))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every((elem => "object" === typeof elem && null !== elem && _io6(elem)))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every((elem => "object" === typeof elem && null !== elem && _io7(elem)))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every((elem => "object" === typeof elem && null !== elem && _io8(elem))));
|
|
5525
|
+
const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description;
|
|
5526
|
+
const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable;
|
|
5527
|
+
const _io4 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel;
|
|
5528
|
+
const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable;
|
|
5529
|
+
const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem))) && true === input.unique;
|
|
5530
|
+
const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem)));
|
|
5531
|
+
const _io8 = input => "string" === typeof input.fieldName;
|
|
5542
5532
|
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.planning || _report(_exceptionable, {
|
|
5543
5533
|
path: _path + ".planning",
|
|
5544
5534
|
expected: "string",
|
|
5545
5535
|
value: input.planning
|
|
5546
|
-
}), (Array.isArray(input.files) || _report(_exceptionable, {
|
|
5547
|
-
path: _path + ".files",
|
|
5548
|
-
expected: "Array<AutoBePrisma.IFile>",
|
|
5549
|
-
value: input.files
|
|
5550
|
-
})) && input.files.map(((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5551
|
-
path: _path + ".files[" + _index10 + "]",
|
|
5552
|
-
expected: "AutoBePrisma.IFile",
|
|
5553
|
-
value: elem
|
|
5554
|
-
})) && _vo1(elem, _path + ".files[" + _index10 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5555
|
-
path: _path + ".files[" + _index10 + "]",
|
|
5556
|
-
expected: "AutoBePrisma.IFile",
|
|
5557
|
-
value: elem
|
|
5558
|
-
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
5559
|
-
path: _path + ".files",
|
|
5560
|
-
expected: "Array<AutoBePrisma.IFile>",
|
|
5561
|
-
value: input.files
|
|
5562
|
-
}) ].every((flag => flag));
|
|
5563
|
-
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
|
|
5564
|
-
path: _path + ".filename",
|
|
5565
|
-
expected: 'string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">',
|
|
5566
|
-
value: input.filename
|
|
5567
|
-
})) || _report(_exceptionable, {
|
|
5568
|
-
path: _path + ".filename",
|
|
5569
|
-
expected: '(string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">)',
|
|
5570
|
-
value: input.filename
|
|
5571
|
-
}), "string" === typeof input.namespace || _report(_exceptionable, {
|
|
5572
|
-
path: _path + ".namespace",
|
|
5573
|
-
expected: "string",
|
|
5574
|
-
value: input.namespace
|
|
5575
5536
|
}), (Array.isArray(input.models) || _report(_exceptionable, {
|
|
5576
5537
|
path: _path + ".models",
|
|
5577
5538
|
expected: "Array<AutoBePrisma.IModel>",
|
|
5578
5539
|
value: input.models
|
|
5579
|
-
})) && input.models.map(((elem,
|
|
5580
|
-
path: _path + ".models[" +
|
|
5540
|
+
})) && input.models.map(((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5541
|
+
path: _path + ".models[" + _index9 + "]",
|
|
5581
5542
|
expected: "AutoBePrisma.IModel",
|
|
5582
5543
|
value: elem
|
|
5583
|
-
})) &&
|
|
5584
|
-
path: _path + ".models[" +
|
|
5544
|
+
})) && _vo1(elem, _path + ".models[" + _index9 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5545
|
+
path: _path + ".models[" + _index9 + "]",
|
|
5585
5546
|
expected: "AutoBePrisma.IModel",
|
|
5586
5547
|
value: elem
|
|
5587
5548
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5589,7 +5550,7 @@ const claude$2 = {
|
|
|
5589
5550
|
expected: "Array<AutoBePrisma.IModel>",
|
|
5590
5551
|
value: input.models
|
|
5591
5552
|
}) ].every((flag => flag));
|
|
5592
|
-
const
|
|
5553
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
5593
5554
|
path: _path + ".name",
|
|
5594
5555
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
5595
5556
|
value: input.name
|
|
@@ -5609,7 +5570,7 @@ const claude$2 = {
|
|
|
5609
5570
|
path: _path + ".primaryField",
|
|
5610
5571
|
expected: "AutoBePrisma.IPrimaryField",
|
|
5611
5572
|
value: input.primaryField
|
|
5612
|
-
})) &&
|
|
5573
|
+
})) && _vo2(input.primaryField, _path + ".primaryField", _exceptionable) || _report(_exceptionable, {
|
|
5613
5574
|
path: _path + ".primaryField",
|
|
5614
5575
|
expected: "AutoBePrisma.IPrimaryField",
|
|
5615
5576
|
value: input.primaryField
|
|
@@ -5617,12 +5578,12 @@ const claude$2 = {
|
|
|
5617
5578
|
path: _path + ".foreignFields",
|
|
5618
5579
|
expected: "Array<AutoBePrisma.IForeignField>",
|
|
5619
5580
|
value: input.foreignFields
|
|
5620
|
-
})) && input.foreignFields.map(((elem,
|
|
5621
|
-
path: _path + ".foreignFields[" +
|
|
5581
|
+
})) && input.foreignFields.map(((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5582
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
5622
5583
|
expected: "AutoBePrisma.IForeignField",
|
|
5623
5584
|
value: elem
|
|
5624
|
-
})) &&
|
|
5625
|
-
path: _path + ".foreignFields[" +
|
|
5585
|
+
})) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5586
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
5626
5587
|
expected: "AutoBePrisma.IForeignField",
|
|
5627
5588
|
value: elem
|
|
5628
5589
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5633,12 +5594,12 @@ const claude$2 = {
|
|
|
5633
5594
|
path: _path + ".plainFields",
|
|
5634
5595
|
expected: "Array<AutoBePrisma.IPlainField>",
|
|
5635
5596
|
value: input.plainFields
|
|
5636
|
-
})) && input.plainFields.map(((elem,
|
|
5637
|
-
path: _path + ".plainFields[" +
|
|
5597
|
+
})) && input.plainFields.map(((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5598
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
5638
5599
|
expected: "AutoBePrisma.IPlainField",
|
|
5639
5600
|
value: elem
|
|
5640
|
-
})) &&
|
|
5641
|
-
path: _path + ".plainFields[" +
|
|
5601
|
+
})) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5602
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
5642
5603
|
expected: "AutoBePrisma.IPlainField",
|
|
5643
5604
|
value: elem
|
|
5644
5605
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5649,12 +5610,12 @@ const claude$2 = {
|
|
|
5649
5610
|
path: _path + ".uniqueIndexes",
|
|
5650
5611
|
expected: "Array<AutoBePrisma.IUniqueIndex>",
|
|
5651
5612
|
value: input.uniqueIndexes
|
|
5652
|
-
})) && input.uniqueIndexes.map(((elem,
|
|
5653
|
-
path: _path + ".uniqueIndexes[" +
|
|
5613
|
+
})) && input.uniqueIndexes.map(((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5614
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
5654
5615
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
5655
5616
|
value: elem
|
|
5656
|
-
})) &&
|
|
5657
|
-
path: _path + ".uniqueIndexes[" +
|
|
5617
|
+
})) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5618
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
5658
5619
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
5659
5620
|
value: elem
|
|
5660
5621
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5665,12 +5626,12 @@ const claude$2 = {
|
|
|
5665
5626
|
path: _path + ".plainIndexes",
|
|
5666
5627
|
expected: "Array<AutoBePrisma.IPlainIndex>",
|
|
5667
5628
|
value: input.plainIndexes
|
|
5668
|
-
})) && input.plainIndexes.map(((elem,
|
|
5669
|
-
path: _path + ".plainIndexes[" +
|
|
5629
|
+
})) && input.plainIndexes.map(((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5630
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
5670
5631
|
expected: "AutoBePrisma.IPlainIndex",
|
|
5671
5632
|
value: elem
|
|
5672
|
-
})) &&
|
|
5673
|
-
path: _path + ".plainIndexes[" +
|
|
5633
|
+
})) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5634
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
5674
5635
|
expected: "AutoBePrisma.IPlainIndex",
|
|
5675
5636
|
value: elem
|
|
5676
5637
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5681,12 +5642,12 @@ const claude$2 = {
|
|
|
5681
5642
|
path: _path + ".ginIndexes",
|
|
5682
5643
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
5683
5644
|
value: input.ginIndexes
|
|
5684
|
-
})) && input.ginIndexes.map(((elem,
|
|
5685
|
-
path: _path + ".ginIndexes[" +
|
|
5645
|
+
})) && input.ginIndexes.map(((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
5646
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
5686
5647
|
expected: "AutoBePrisma.IGinIndex",
|
|
5687
5648
|
value: elem
|
|
5688
|
-
})) &&
|
|
5689
|
-
path: _path + ".ginIndexes[" +
|
|
5649
|
+
})) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", _exceptionable) || _report(_exceptionable, {
|
|
5650
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
5690
5651
|
expected: "AutoBePrisma.IGinIndex",
|
|
5691
5652
|
value: elem
|
|
5692
5653
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -5694,7 +5655,7 @@ const claude$2 = {
|
|
|
5694
5655
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
5695
5656
|
value: input.ginIndexes
|
|
5696
5657
|
}) ].every((flag => flag));
|
|
5697
|
-
const
|
|
5658
|
+
const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
5698
5659
|
path: _path + ".name",
|
|
5699
5660
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
5700
5661
|
value: input.name
|
|
@@ -5711,7 +5672,7 @@ const claude$2 = {
|
|
|
5711
5672
|
expected: "string",
|
|
5712
5673
|
value: input.description
|
|
5713
5674
|
}) ].every((flag => flag));
|
|
5714
|
-
const
|
|
5675
|
+
const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
5715
5676
|
path: _path + ".name",
|
|
5716
5677
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
5717
5678
|
value: input.name
|
|
@@ -5731,7 +5692,7 @@ const claude$2 = {
|
|
|
5731
5692
|
path: _path + ".relation",
|
|
5732
5693
|
expected: "__type",
|
|
5733
5694
|
value: input.relation
|
|
5734
|
-
})) &&
|
|
5695
|
+
})) && _vo4(input.relation, _path + ".relation", _exceptionable) || _report(_exceptionable, {
|
|
5735
5696
|
path: _path + ".relation",
|
|
5736
5697
|
expected: "__type",
|
|
5737
5698
|
value: input.relation
|
|
@@ -5744,7 +5705,7 @@ const claude$2 = {
|
|
|
5744
5705
|
expected: "boolean",
|
|
5745
5706
|
value: input.nullable
|
|
5746
5707
|
}) ].every((flag => flag));
|
|
5747
|
-
const
|
|
5708
|
+
const _vo4 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
5748
5709
|
path: _path + ".name",
|
|
5749
5710
|
expected: 'string & Pattern<"^[a-zA-Z_][a-zA-Z0-9_]*$">',
|
|
5750
5711
|
value: input.name
|
|
@@ -5757,7 +5718,7 @@ const claude$2 = {
|
|
|
5757
5718
|
expected: "string",
|
|
5758
5719
|
value: input.targetModel
|
|
5759
5720
|
}) ].every((flag => flag));
|
|
5760
|
-
const
|
|
5721
|
+
const _vo5 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
5761
5722
|
path: _path + ".name",
|
|
5762
5723
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
5763
5724
|
value: input.name
|
|
@@ -5778,7 +5739,7 @@ const claude$2 = {
|
|
|
5778
5739
|
expected: "boolean",
|
|
5779
5740
|
value: input.nullable
|
|
5780
5741
|
}) ].every((flag => flag));
|
|
5781
|
-
const
|
|
5742
|
+
const _vo6 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
5782
5743
|
path: _path + ".fieldNames",
|
|
5783
5744
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
5784
5745
|
value: input.fieldNames
|
|
@@ -5790,8 +5751,8 @@ const claude$2 = {
|
|
|
5790
5751
|
path: _path + ".fieldNames",
|
|
5791
5752
|
expected: "Array<> & UniqueItems<true>",
|
|
5792
5753
|
value: input.fieldNames
|
|
5793
|
-
})) && input.fieldNames.map(((elem,
|
|
5794
|
-
path: _path + ".fieldNames[" +
|
|
5754
|
+
})) && input.fieldNames.map(((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
|
|
5755
|
+
path: _path + ".fieldNames[" + _index15 + "]",
|
|
5795
5756
|
expected: "string",
|
|
5796
5757
|
value: elem
|
|
5797
5758
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -5803,7 +5764,7 @@ const claude$2 = {
|
|
|
5803
5764
|
expected: "true",
|
|
5804
5765
|
value: input.unique
|
|
5805
5766
|
}) ].every((flag => flag));
|
|
5806
|
-
const
|
|
5767
|
+
const _vo7 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
5807
5768
|
path: _path + ".fieldNames",
|
|
5808
5769
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
5809
5770
|
value: input.fieldNames
|
|
@@ -5815,8 +5776,8 @@ const claude$2 = {
|
|
|
5815
5776
|
path: _path + ".fieldNames",
|
|
5816
5777
|
expected: "Array<> & UniqueItems<true>",
|
|
5817
5778
|
value: input.fieldNames
|
|
5818
|
-
})) && input.fieldNames.map(((elem,
|
|
5819
|
-
path: _path + ".fieldNames[" +
|
|
5779
|
+
})) && input.fieldNames.map(((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
5780
|
+
path: _path + ".fieldNames[" + _index16 + "]",
|
|
5820
5781
|
expected: "string",
|
|
5821
5782
|
value: elem
|
|
5822
5783
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -5824,7 +5785,7 @@ const claude$2 = {
|
|
|
5824
5785
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
5825
5786
|
value: input.fieldNames
|
|
5826
5787
|
}) ].every((flag => flag));
|
|
5827
|
-
const
|
|
5788
|
+
const _vo8 = (input, _path, _exceptionable = true) => [ "string" === typeof input.fieldName || _report(_exceptionable, {
|
|
5828
5789
|
path: _path + ".fieldName",
|
|
5829
5790
|
expected: "string",
|
|
5830
5791
|
value: input.fieldName
|
|
@@ -5879,290 +5840,237 @@ const collection$2 = {
|
|
|
5879
5840
|
type: "object",
|
|
5880
5841
|
properties: {
|
|
5881
5842
|
planning: {
|
|
5882
|
-
|
|
5883
|
-
description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\nš Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\nš” Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints",
|
|
5843
|
+
description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\nš Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types, indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\nš” Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these",
|
|
5884
5844
|
type: "string"
|
|
5885
5845
|
},
|
|
5886
|
-
|
|
5887
|
-
description: "
|
|
5846
|
+
models: {
|
|
5847
|
+
description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\nš„ Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\nš Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\nš Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\nā ļø Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\nšÆ Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models",
|
|
5888
5848
|
type: "array",
|
|
5889
5849
|
items: {
|
|
5890
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
5850
|
+
description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based on the uploaded schemas, models follow specific patterns:\n> \n> - Main business entities (e.g., shopping_sales, shopping_customers)\n> - Snapshot/versioning entities for audit trails (e.g.,\n> shopping_sale_snapshots)\n> - Junction tables for M:N relationships (e.g.,\n> shopping_cart_commodity_stocks)\n> - Materialized views for performance (prefixed with mv_)",
|
|
5891
5851
|
type: "object",
|
|
5892
5852
|
properties: {
|
|
5893
|
-
|
|
5894
|
-
title: "Name of the
|
|
5895
|
-
description: 'Name of the
|
|
5853
|
+
name: {
|
|
5854
|
+
title: "Name of the Prisma model (database table name)",
|
|
5855
|
+
description: 'Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n"shopping_customers", "shopping_sale_snapshots", "bbs_articles"\nMaterialized views use "mv_" prefix: "mv_shopping_sale_last_snapshots"\n\n\n@pattern ^[a-z][a-z0-9_]*$',
|
|
5896
5856
|
type: "string"
|
|
5897
5857
|
},
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
description: 'Business domain namespace that groups related models.\n\nUsed in Prisma documentation comments as "@\\namespace directive".\nExamples from uploaded schemas: "Systematic", "Actors", "Sales", "Carts",\n"Orders", "Coupons", "Coins", "Inquiries", "Favorites", "Articles"',
|
|
5858
|
+
description: {
|
|
5859
|
+
description: 'Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using "{@\\link ModelName}" syntax Example:\n "Customer information, but not a person but a **connection** basis..."',
|
|
5901
5860
|
type: "string"
|
|
5902
5861
|
},
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5862
|
+
material: {
|
|
5863
|
+
description: 'Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They\'re marked as "@\\hidden" in documentation and prefixed with\n"mv_" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices',
|
|
5864
|
+
type: "boolean"
|
|
5865
|
+
},
|
|
5866
|
+
primaryField: {
|
|
5867
|
+
description: 'The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with "@\\id"\ndirective. Usually named "id" and marked with "@\\db.Uuid" for PostgreSQL\nmapping.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).',
|
|
5868
|
+
type: "object",
|
|
5869
|
+
properties: {
|
|
5870
|
+
name: {
|
|
5871
|
+
title: "Name of the primary key field",
|
|
5872
|
+
description: 'Name of the primary key field.\n\nConsistently named "id" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.\n\n\n@pattern ^[a-z][a-z0-9_]*$',
|
|
5873
|
+
type: "string"
|
|
5874
|
+
},
|
|
5875
|
+
type: {
|
|
5876
|
+
title: "Data type of the primary key field",
|
|
5877
|
+
description: 'Data type of the primary key field.\n\nAlways "uuid" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.',
|
|
5878
|
+
type: "string",
|
|
5879
|
+
enum: [ "uuid" ]
|
|
5880
|
+
},
|
|
5881
|
+
description: {
|
|
5882
|
+
title: "Description of the primary key field's purpose",
|
|
5883
|
+
description: 'Description of the primary key field\'s purpose.\n\nStandard description is "Primary Key." across all models. Serves as the\nunique identifier for the model instance.',
|
|
5884
|
+
type: "string"
|
|
5885
|
+
}
|
|
5886
|
+
},
|
|
5887
|
+
required: [ "name", "type", "description" ]
|
|
5888
|
+
},
|
|
5889
|
+
foreignFields: {
|
|
5890
|
+
title: "Array of foreign key fields that reference other models",
|
|
5891
|
+
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships.",
|
|
5906
5892
|
type: "array",
|
|
5907
5893
|
items: {
|
|
5908
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
5894
|
+
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
5909
5895
|
type: "object",
|
|
5910
5896
|
properties: {
|
|
5911
5897
|
name: {
|
|
5912
|
-
title: "Name of the
|
|
5913
|
-
description: 'Name of the
|
|
5898
|
+
title: "Name of the foreign key field",
|
|
5899
|
+
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$',
|
|
5914
5900
|
type: "string"
|
|
5915
5901
|
},
|
|
5902
|
+
type: {
|
|
5903
|
+
title: "Data type of the foreign key field",
|
|
5904
|
+
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.',
|
|
5905
|
+
type: "string",
|
|
5906
|
+
enum: [ "uuid" ]
|
|
5907
|
+
},
|
|
5916
5908
|
description: {
|
|
5917
|
-
description: '
|
|
5909
|
+
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.',
|
|
5918
5910
|
type: "string"
|
|
5919
5911
|
},
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
},
|
|
5924
|
-
primaryField: {
|
|
5925
|
-
description: 'The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with "@\\id"\ndirective. Usually named "id" and marked with "@\\db.Uuid" for PostgreSQL\nmapping.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).',
|
|
5912
|
+
relation: {
|
|
5913
|
+
title: "Prisma relation configuration defining the association details",
|
|
5914
|
+
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
5926
5915
|
type: "object",
|
|
5927
5916
|
properties: {
|
|
5928
5917
|
name: {
|
|
5929
|
-
title: "Name of the
|
|
5930
|
-
description: 'Name of the
|
|
5918
|
+
title: "Name of the relation property in the Prisma model",
|
|
5919
|
+
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"\n\n\n@pattern ^[a-zA-Z_][a-zA-Z0-9_]*$',
|
|
5931
5920
|
type: "string"
|
|
5932
5921
|
},
|
|
5933
|
-
|
|
5934
|
-
title: "
|
|
5935
|
-
description: '
|
|
5936
|
-
type: "string",
|
|
5937
|
-
enum: [ "uuid" ]
|
|
5938
|
-
},
|
|
5939
|
-
description: {
|
|
5940
|
-
title: "Description of the primary key field's purpose",
|
|
5941
|
-
description: 'Description of the primary key field\'s purpose.\n\nStandard description is "Primary Key." across all models. Serves as the\nunique identifier for the model instance.',
|
|
5922
|
+
targetModel: {
|
|
5923
|
+
title: "Name of the target model being referenced",
|
|
5924
|
+
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"',
|
|
5942
5925
|
type: "string"
|
|
5943
5926
|
}
|
|
5944
5927
|
},
|
|
5945
|
-
required: [ "name", "
|
|
5928
|
+
required: [ "name", "targetModel" ]
|
|
5946
5929
|
},
|
|
5947
|
-
|
|
5948
|
-
title: "
|
|
5949
|
-
description: "
|
|
5950
|
-
type: "
|
|
5951
|
-
items: {
|
|
5952
|
-
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
5953
|
-
type: "object",
|
|
5954
|
-
properties: {
|
|
5955
|
-
name: {
|
|
5956
|
-
title: "Name of the foreign key field",
|
|
5957
|
-
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$',
|
|
5958
|
-
type: "string"
|
|
5959
|
-
},
|
|
5960
|
-
type: {
|
|
5961
|
-
title: "Data type of the foreign key field",
|
|
5962
|
-
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.',
|
|
5963
|
-
type: "string",
|
|
5964
|
-
enum: [ "uuid" ]
|
|
5965
|
-
},
|
|
5966
|
-
description: {
|
|
5967
|
-
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.',
|
|
5968
|
-
type: "string"
|
|
5969
|
-
},
|
|
5970
|
-
relation: {
|
|
5971
|
-
title: "Prisma relation configuration defining the association details",
|
|
5972
|
-
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
5973
|
-
type: "object",
|
|
5974
|
-
properties: {
|
|
5975
|
-
name: {
|
|
5976
|
-
title: "Name of the relation property in the Prisma model",
|
|
5977
|
-
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"\n\n\n@pattern ^[a-zA-Z_][a-zA-Z0-9_]*$',
|
|
5978
|
-
type: "string"
|
|
5979
|
-
},
|
|
5980
|
-
targetModel: {
|
|
5981
|
-
title: "Name of the target model being referenced",
|
|
5982
|
-
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"',
|
|
5983
|
-
type: "string"
|
|
5984
|
-
}
|
|
5985
|
-
},
|
|
5986
|
-
required: [ "name", "targetModel" ]
|
|
5987
|
-
},
|
|
5988
|
-
unique: {
|
|
5989
|
-
title: "Whether this foreign key has a unique constraint",
|
|
5990
|
-
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
5991
|
-
type: "boolean"
|
|
5992
|
-
},
|
|
5993
|
-
nullable: {
|
|
5994
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
5995
|
-
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
5996
|
-
type: "boolean"
|
|
5997
|
-
}
|
|
5998
|
-
},
|
|
5999
|
-
required: [ "name", "type", "description", "relation", "unique", "nullable" ]
|
|
6000
|
-
}
|
|
5930
|
+
unique: {
|
|
5931
|
+
title: "Whether this foreign key has a unique constraint",
|
|
5932
|
+
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality.",
|
|
5933
|
+
type: "boolean"
|
|
6001
5934
|
},
|
|
6002
|
-
|
|
6003
|
-
title: "
|
|
6004
|
-
description: "
|
|
6005
|
-
type: "
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
description: 'Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: "Amount of cash payment." or\n "Whether the unit is required or not."',
|
|
6024
|
-
type: "string"
|
|
6025
|
-
},
|
|
6026
|
-
nullable: {
|
|
6027
|
-
title: "Whether this field can contain null values",
|
|
6028
|
-
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
6029
|
-
type: "boolean"
|
|
6030
|
-
}
|
|
6031
|
-
},
|
|
6032
|
-
required: [ "name", "type", "description", "nullable" ]
|
|
6033
|
-
}
|
|
5935
|
+
nullable: {
|
|
5936
|
+
title: "Whether this foreign key can be null (optional relationship)",
|
|
5937
|
+
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations.",
|
|
5938
|
+
type: "boolean"
|
|
5939
|
+
}
|
|
5940
|
+
},
|
|
5941
|
+
required: [ "name", "type", "description", "relation", "unique", "nullable" ]
|
|
5942
|
+
}
|
|
5943
|
+
},
|
|
5944
|
+
plainFields: {
|
|
5945
|
+
title: "Array of regular data fields that don't reference other models",
|
|
5946
|
+
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing.",
|
|
5947
|
+
type: "array",
|
|
5948
|
+
items: {
|
|
5949
|
+
description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
|
|
5950
|
+
type: "object",
|
|
5951
|
+
properties: {
|
|
5952
|
+
name: {
|
|
5953
|
+
title: "Name of the field in the database table",
|
|
5954
|
+
description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative\n\n\n@pattern ^[a-z][a-z0-9_]*$",
|
|
5955
|
+
type: "string"
|
|
6034
5956
|
},
|
|
6035
|
-
|
|
6036
|
-
title: "
|
|
6037
|
-
description: "
|
|
6038
|
-
type: "
|
|
6039
|
-
|
|
6040
|
-
description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
|
|
6041
|
-
type: "object",
|
|
6042
|
-
properties: {
|
|
6043
|
-
fieldNames: {
|
|
6044
|
-
title: "Array of field names that together form the unique constraint",
|
|
6045
|
-
description: 'Array of field names that together form the unique constraint.\n\nCan be single field (e.g., ["email"]) or composite (e.g., ["channel_id",\n"code"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: ["code"], ["shopping_channel_id",\n"nickname"], ["email"]\n\n\n@minItems 1\n@uniqueItems',
|
|
6046
|
-
type: "array",
|
|
6047
|
-
items: {
|
|
6048
|
-
type: "string"
|
|
6049
|
-
}
|
|
6050
|
-
},
|
|
6051
|
-
unique: {
|
|
6052
|
-
title: "Explicit marker indicating this is a unique index",
|
|
6053
|
-
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".',
|
|
6054
|
-
type: "boolean",
|
|
6055
|
-
enum: [ true ]
|
|
6056
|
-
}
|
|
6057
|
-
},
|
|
6058
|
-
required: [ "fieldNames", "unique" ]
|
|
6059
|
-
}
|
|
5957
|
+
type: {
|
|
5958
|
+
title: "Data type of the field for Prisma schema generation",
|
|
5959
|
+
description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time",
|
|
5960
|
+
type: "string",
|
|
5961
|
+
enum: [ "string", "boolean", "uuid", "uri", "int", "double", "datetime" ]
|
|
6060
5962
|
},
|
|
6061
|
-
|
|
6062
|
-
title: "
|
|
6063
|
-
description:
|
|
5963
|
+
description: {
|
|
5964
|
+
title: "Description explaining the business purpose and usage of this field",
|
|
5965
|
+
description: 'Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: "Amount of cash payment." or\n "Whether the unit is required or not."',
|
|
5966
|
+
type: "string"
|
|
5967
|
+
},
|
|
5968
|
+
nullable: {
|
|
5969
|
+
title: "Whether this field can contain null values",
|
|
5970
|
+
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data.",
|
|
5971
|
+
type: "boolean"
|
|
5972
|
+
}
|
|
5973
|
+
},
|
|
5974
|
+
required: [ "name", "type", "description", "nullable" ]
|
|
5975
|
+
}
|
|
5976
|
+
},
|
|
5977
|
+
uniqueIndexes: {
|
|
5978
|
+
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
5979
|
+
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname).",
|
|
5980
|
+
type: "array",
|
|
5981
|
+
items: {
|
|
5982
|
+
description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
|
|
5983
|
+
type: "object",
|
|
5984
|
+
properties: {
|
|
5985
|
+
fieldNames: {
|
|
5986
|
+
title: "Array of field names that together form the unique constraint",
|
|
5987
|
+
description: 'Array of field names that together form the unique constraint.\n\nCan be single field (e.g., ["email"]) or composite (e.g., ["channel_id",\n"code"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: ["code"], ["shopping_channel_id",\n"nickname"], ["email"]\n\n\n@minItems 1\n@uniqueItems',
|
|
6064
5988
|
type: "array",
|
|
6065
5989
|
items: {
|
|
6066
|
-
|
|
6067
|
-
type: "object",
|
|
6068
|
-
properties: {
|
|
6069
|
-
fieldNames: {
|
|
6070
|
-
title: "Array of field names to include in the performance index",
|
|
6071
|
-
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]\n\n\n@minItems 1\n@uniqueItems',
|
|
6072
|
-
type: "array",
|
|
6073
|
-
items: {
|
|
6074
|
-
type: "string"
|
|
6075
|
-
}
|
|
6076
|
-
}
|
|
6077
|
-
},
|
|
6078
|
-
required: [ "fieldNames" ]
|
|
5990
|
+
type: "string"
|
|
6079
5991
|
}
|
|
6080
5992
|
},
|
|
6081
|
-
|
|
6082
|
-
title: "
|
|
6083
|
-
description:
|
|
5993
|
+
unique: {
|
|
5994
|
+
title: "Explicit marker indicating this is a unique index",
|
|
5995
|
+
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".',
|
|
5996
|
+
type: "boolean",
|
|
5997
|
+
enum: [ true ]
|
|
5998
|
+
}
|
|
5999
|
+
},
|
|
6000
|
+
required: [ "fieldNames", "unique" ]
|
|
6001
|
+
}
|
|
6002
|
+
},
|
|
6003
|
+
plainIndexes: {
|
|
6004
|
+
title: "Array of regular indexes for query performance optimization",
|
|
6005
|
+
description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields.",
|
|
6006
|
+
type: "array",
|
|
6007
|
+
items: {
|
|
6008
|
+
description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
|
|
6009
|
+
type: "object",
|
|
6010
|
+
properties: {
|
|
6011
|
+
fieldNames: {
|
|
6012
|
+
title: "Array of field names to include in the performance index",
|
|
6013
|
+
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]\n\n\n@minItems 1\n@uniqueItems',
|
|
6084
6014
|
type: "array",
|
|
6085
6015
|
items: {
|
|
6086
|
-
|
|
6087
|
-
type: "object",
|
|
6088
|
-
properties: {
|
|
6089
|
-
fieldName: {
|
|
6090
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
6091
|
-
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.',
|
|
6092
|
-
type: "string"
|
|
6093
|
-
}
|
|
6094
|
-
},
|
|
6095
|
-
required: [ "fieldName" ]
|
|
6016
|
+
type: "string"
|
|
6096
6017
|
}
|
|
6097
6018
|
}
|
|
6098
6019
|
},
|
|
6099
|
-
required: [ "
|
|
6020
|
+
required: [ "fieldNames" ]
|
|
6100
6021
|
}
|
|
6101
|
-
}
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
path: _path + ".
|
|
6141
|
-
expected: "Array<AutoBePrisma.IFile>",
|
|
6142
|
-
value: input.files
|
|
6143
|
-
}) ].every((flag => flag));
|
|
6144
|
-
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
|
|
6145
|
-
path: _path + ".filename",
|
|
6146
|
-
expected: 'string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">',
|
|
6147
|
-
value: input.filename
|
|
6148
|
-
})) || _report(_exceptionable, {
|
|
6149
|
-
path: _path + ".filename",
|
|
6150
|
-
expected: '(string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">)',
|
|
6151
|
-
value: input.filename
|
|
6152
|
-
}), "string" === typeof input.namespace || _report(_exceptionable, {
|
|
6153
|
-
path: _path + ".namespace",
|
|
6022
|
+
},
|
|
6023
|
+
ginIndexes: {
|
|
6024
|
+
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
6025
|
+
description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies.",
|
|
6026
|
+
type: "array",
|
|
6027
|
+
items: {
|
|
6028
|
+
description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
|
|
6029
|
+
type: "object",
|
|
6030
|
+
properties: {
|
|
6031
|
+
fieldName: {
|
|
6032
|
+
title: "Name of the text field to index for full-text search capabilities",
|
|
6033
|
+
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.',
|
|
6034
|
+
type: "string"
|
|
6035
|
+
}
|
|
6036
|
+
},
|
|
6037
|
+
required: [ "fieldName" ]
|
|
6038
|
+
}
|
|
6039
|
+
}
|
|
6040
|
+
},
|
|
6041
|
+
required: [ "name", "description", "material", "primaryField", "foreignFields", "plainFields", "uniqueIndexes", "plainIndexes", "ginIndexes" ]
|
|
6042
|
+
}
|
|
6043
|
+
}
|
|
6044
|
+
},
|
|
6045
|
+
required: [ "planning", "models" ],
|
|
6046
|
+
additionalProperties: false,
|
|
6047
|
+
$defs: {}
|
|
6048
|
+
},
|
|
6049
|
+
description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
|
|
6050
|
+
validate: (() => {
|
|
6051
|
+
const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every((elem => "object" === typeof elem && null !== elem && _io1(elem))));
|
|
6052
|
+
const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every((elem => "object" === typeof elem && null !== elem && _io3(elem)))) && (Array.isArray(input.plainFields) && input.plainFields.every((elem => "object" === typeof elem && null !== elem && _io5(elem)))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every((elem => "object" === typeof elem && null !== elem && _io6(elem)))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every((elem => "object" === typeof elem && null !== elem && _io7(elem)))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every((elem => "object" === typeof elem && null !== elem && _io8(elem))));
|
|
6053
|
+
const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description;
|
|
6054
|
+
const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable;
|
|
6055
|
+
const _io4 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel;
|
|
6056
|
+
const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable;
|
|
6057
|
+
const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem))) && true === input.unique;
|
|
6058
|
+
const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem)));
|
|
6059
|
+
const _io8 = input => "string" === typeof input.fieldName;
|
|
6060
|
+
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.planning || _report(_exceptionable, {
|
|
6061
|
+
path: _path + ".planning",
|
|
6154
6062
|
expected: "string",
|
|
6155
|
-
value: input.
|
|
6063
|
+
value: input.planning
|
|
6156
6064
|
}), (Array.isArray(input.models) || _report(_exceptionable, {
|
|
6157
6065
|
path: _path + ".models",
|
|
6158
6066
|
expected: "Array<AutoBePrisma.IModel>",
|
|
6159
6067
|
value: input.models
|
|
6160
|
-
})) && input.models.map(((elem,
|
|
6161
|
-
path: _path + ".models[" +
|
|
6068
|
+
})) && input.models.map(((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6069
|
+
path: _path + ".models[" + _index9 + "]",
|
|
6162
6070
|
expected: "AutoBePrisma.IModel",
|
|
6163
6071
|
value: elem
|
|
6164
|
-
})) &&
|
|
6165
|
-
path: _path + ".models[" +
|
|
6072
|
+
})) && _vo1(elem, _path + ".models[" + _index9 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6073
|
+
path: _path + ".models[" + _index9 + "]",
|
|
6166
6074
|
expected: "AutoBePrisma.IModel",
|
|
6167
6075
|
value: elem
|
|
6168
6076
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6170,7 +6078,7 @@ const collection$2 = {
|
|
|
6170
6078
|
expected: "Array<AutoBePrisma.IModel>",
|
|
6171
6079
|
value: input.models
|
|
6172
6080
|
}) ].every((flag => flag));
|
|
6173
|
-
const
|
|
6081
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6174
6082
|
path: _path + ".name",
|
|
6175
6083
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6176
6084
|
value: input.name
|
|
@@ -6190,7 +6098,7 @@ const collection$2 = {
|
|
|
6190
6098
|
path: _path + ".primaryField",
|
|
6191
6099
|
expected: "AutoBePrisma.IPrimaryField",
|
|
6192
6100
|
value: input.primaryField
|
|
6193
|
-
})) &&
|
|
6101
|
+
})) && _vo2(input.primaryField, _path + ".primaryField", _exceptionable) || _report(_exceptionable, {
|
|
6194
6102
|
path: _path + ".primaryField",
|
|
6195
6103
|
expected: "AutoBePrisma.IPrimaryField",
|
|
6196
6104
|
value: input.primaryField
|
|
@@ -6198,12 +6106,12 @@ const collection$2 = {
|
|
|
6198
6106
|
path: _path + ".foreignFields",
|
|
6199
6107
|
expected: "Array<AutoBePrisma.IForeignField>",
|
|
6200
6108
|
value: input.foreignFields
|
|
6201
|
-
})) && input.foreignFields.map(((elem,
|
|
6202
|
-
path: _path + ".foreignFields[" +
|
|
6109
|
+
})) && input.foreignFields.map(((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6110
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
6203
6111
|
expected: "AutoBePrisma.IForeignField",
|
|
6204
6112
|
value: elem
|
|
6205
|
-
})) &&
|
|
6206
|
-
path: _path + ".foreignFields[" +
|
|
6113
|
+
})) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6114
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
6207
6115
|
expected: "AutoBePrisma.IForeignField",
|
|
6208
6116
|
value: elem
|
|
6209
6117
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6214,12 +6122,12 @@ const collection$2 = {
|
|
|
6214
6122
|
path: _path + ".plainFields",
|
|
6215
6123
|
expected: "Array<AutoBePrisma.IPlainField>",
|
|
6216
6124
|
value: input.plainFields
|
|
6217
|
-
})) && input.plainFields.map(((elem,
|
|
6218
|
-
path: _path + ".plainFields[" +
|
|
6125
|
+
})) && input.plainFields.map(((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6126
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
6219
6127
|
expected: "AutoBePrisma.IPlainField",
|
|
6220
6128
|
value: elem
|
|
6221
|
-
})) &&
|
|
6222
|
-
path: _path + ".plainFields[" +
|
|
6129
|
+
})) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6130
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
6223
6131
|
expected: "AutoBePrisma.IPlainField",
|
|
6224
6132
|
value: elem
|
|
6225
6133
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6230,12 +6138,12 @@ const collection$2 = {
|
|
|
6230
6138
|
path: _path + ".uniqueIndexes",
|
|
6231
6139
|
expected: "Array<AutoBePrisma.IUniqueIndex>",
|
|
6232
6140
|
value: input.uniqueIndexes
|
|
6233
|
-
})) && input.uniqueIndexes.map(((elem,
|
|
6234
|
-
path: _path + ".uniqueIndexes[" +
|
|
6141
|
+
})) && input.uniqueIndexes.map(((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6142
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
6235
6143
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
6236
6144
|
value: elem
|
|
6237
|
-
})) &&
|
|
6238
|
-
path: _path + ".uniqueIndexes[" +
|
|
6145
|
+
})) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6146
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
6239
6147
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
6240
6148
|
value: elem
|
|
6241
6149
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6246,12 +6154,12 @@ const collection$2 = {
|
|
|
6246
6154
|
path: _path + ".plainIndexes",
|
|
6247
6155
|
expected: "Array<AutoBePrisma.IPlainIndex>",
|
|
6248
6156
|
value: input.plainIndexes
|
|
6249
|
-
})) && input.plainIndexes.map(((elem,
|
|
6250
|
-
path: _path + ".plainIndexes[" +
|
|
6157
|
+
})) && input.plainIndexes.map(((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6158
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
6251
6159
|
expected: "AutoBePrisma.IPlainIndex",
|
|
6252
6160
|
value: elem
|
|
6253
|
-
})) &&
|
|
6254
|
-
path: _path + ".plainIndexes[" +
|
|
6161
|
+
})) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6162
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
6255
6163
|
expected: "AutoBePrisma.IPlainIndex",
|
|
6256
6164
|
value: elem
|
|
6257
6165
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6262,12 +6170,12 @@ const collection$2 = {
|
|
|
6262
6170
|
path: _path + ".ginIndexes",
|
|
6263
6171
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
6264
6172
|
value: input.ginIndexes
|
|
6265
|
-
})) && input.ginIndexes.map(((elem,
|
|
6266
|
-
path: _path + ".ginIndexes[" +
|
|
6173
|
+
})) && input.ginIndexes.map(((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6174
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
6267
6175
|
expected: "AutoBePrisma.IGinIndex",
|
|
6268
6176
|
value: elem
|
|
6269
|
-
})) &&
|
|
6270
|
-
path: _path + ".ginIndexes[" +
|
|
6177
|
+
})) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6178
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
6271
6179
|
expected: "AutoBePrisma.IGinIndex",
|
|
6272
6180
|
value: elem
|
|
6273
6181
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6275,7 +6183,7 @@ const collection$2 = {
|
|
|
6275
6183
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
6276
6184
|
value: input.ginIndexes
|
|
6277
6185
|
}) ].every((flag => flag));
|
|
6278
|
-
const
|
|
6186
|
+
const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6279
6187
|
path: _path + ".name",
|
|
6280
6188
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6281
6189
|
value: input.name
|
|
@@ -6292,7 +6200,7 @@ const collection$2 = {
|
|
|
6292
6200
|
expected: "string",
|
|
6293
6201
|
value: input.description
|
|
6294
6202
|
}) ].every((flag => flag));
|
|
6295
|
-
const
|
|
6203
|
+
const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6296
6204
|
path: _path + ".name",
|
|
6297
6205
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6298
6206
|
value: input.name
|
|
@@ -6312,7 +6220,7 @@ const collection$2 = {
|
|
|
6312
6220
|
path: _path + ".relation",
|
|
6313
6221
|
expected: "__type",
|
|
6314
6222
|
value: input.relation
|
|
6315
|
-
})) &&
|
|
6223
|
+
})) && _vo4(input.relation, _path + ".relation", _exceptionable) || _report(_exceptionable, {
|
|
6316
6224
|
path: _path + ".relation",
|
|
6317
6225
|
expected: "__type",
|
|
6318
6226
|
value: input.relation
|
|
@@ -6325,7 +6233,7 @@ const collection$2 = {
|
|
|
6325
6233
|
expected: "boolean",
|
|
6326
6234
|
value: input.nullable
|
|
6327
6235
|
}) ].every((flag => flag));
|
|
6328
|
-
const
|
|
6236
|
+
const _vo4 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6329
6237
|
path: _path + ".name",
|
|
6330
6238
|
expected: 'string & Pattern<"^[a-zA-Z_][a-zA-Z0-9_]*$">',
|
|
6331
6239
|
value: input.name
|
|
@@ -6338,7 +6246,7 @@ const collection$2 = {
|
|
|
6338
6246
|
expected: "string",
|
|
6339
6247
|
value: input.targetModel
|
|
6340
6248
|
}) ].every((flag => flag));
|
|
6341
|
-
const
|
|
6249
|
+
const _vo5 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6342
6250
|
path: _path + ".name",
|
|
6343
6251
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6344
6252
|
value: input.name
|
|
@@ -6359,7 +6267,7 @@ const collection$2 = {
|
|
|
6359
6267
|
expected: "boolean",
|
|
6360
6268
|
value: input.nullable
|
|
6361
6269
|
}) ].every((flag => flag));
|
|
6362
|
-
const
|
|
6270
|
+
const _vo6 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
6363
6271
|
path: _path + ".fieldNames",
|
|
6364
6272
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
6365
6273
|
value: input.fieldNames
|
|
@@ -6371,8 +6279,8 @@ const collection$2 = {
|
|
|
6371
6279
|
path: _path + ".fieldNames",
|
|
6372
6280
|
expected: "Array<> & UniqueItems<true>",
|
|
6373
6281
|
value: input.fieldNames
|
|
6374
|
-
})) && input.fieldNames.map(((elem,
|
|
6375
|
-
path: _path + ".fieldNames[" +
|
|
6282
|
+
})) && input.fieldNames.map(((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
|
|
6283
|
+
path: _path + ".fieldNames[" + _index15 + "]",
|
|
6376
6284
|
expected: "string",
|
|
6377
6285
|
value: elem
|
|
6378
6286
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -6384,7 +6292,7 @@ const collection$2 = {
|
|
|
6384
6292
|
expected: "true",
|
|
6385
6293
|
value: input.unique
|
|
6386
6294
|
}) ].every((flag => flag));
|
|
6387
|
-
const
|
|
6295
|
+
const _vo7 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
6388
6296
|
path: _path + ".fieldNames",
|
|
6389
6297
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
6390
6298
|
value: input.fieldNames
|
|
@@ -6396,8 +6304,8 @@ const collection$2 = {
|
|
|
6396
6304
|
path: _path + ".fieldNames",
|
|
6397
6305
|
expected: "Array<> & UniqueItems<true>",
|
|
6398
6306
|
value: input.fieldNames
|
|
6399
|
-
})) && input.fieldNames.map(((elem,
|
|
6400
|
-
path: _path + ".fieldNames[" +
|
|
6307
|
+
})) && input.fieldNames.map(((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
6308
|
+
path: _path + ".fieldNames[" + _index16 + "]",
|
|
6401
6309
|
expected: "string",
|
|
6402
6310
|
value: elem
|
|
6403
6311
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -6405,7 +6313,7 @@ const collection$2 = {
|
|
|
6405
6313
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
6406
6314
|
value: input.fieldNames
|
|
6407
6315
|
}) ].every((flag => flag));
|
|
6408
|
-
const
|
|
6316
|
+
const _vo8 = (input, _path, _exceptionable = true) => [ "string" === typeof input.fieldName || _report(_exceptionable, {
|
|
6409
6317
|
path: _path + ".fieldName",
|
|
6410
6318
|
expected: "string",
|
|
6411
6319
|
value: input.fieldName
|
|
@@ -6462,26 +6370,53 @@ const collection$2 = {
|
|
|
6462
6370
|
properties: {
|
|
6463
6371
|
planning: {
|
|
6464
6372
|
type: "string",
|
|
6465
|
-
|
|
6466
|
-
description: "Detailed execution plan for fixing AutoBePrisma validation errors.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for structured schema validation issues\n\nš Required Planning Content:\n\n1. **Error Analysis Summary**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Categorize errors by type (duplications, references, types, indexes)\n - Identify root causes and error interdependencies\n2. **Fix Strategy Overview**\n\n - Prioritize fixes based on dependencies (fix duplications first)\n - Outline minimal changes needed for each validation error\n - Identify potential impact on other models/relationships\n3. **Step-by-Step Fix Plan**\n\n - Model-by-model modification plan with specific changes\n - Exact field additions, removals, or renames required\n - Reference updates needed for renamed elements\n - Index corrections to comply with validation rules\n4. **Preservation Checklist**\n\n - Confirm which descriptions and business logic must be preserved\n - List relationships and constraints to maintain unchanged\n - Identify cross-model dependencies that must remain intact\n5. **Risk Assessment**\n\n - Potential side effects of each planned fix\n - Validation points to check after applying corrections\n - Ensure no new validation errors are introduced\n\nš” Example Planning Structure:\n\n ## Error Analysis\n - Error 1: Duplicate field 'name' in shopping_customers model\n - Error 2: Invalid targetModel 'shopping_customer' should be 'shopping_customers'\n\n ## Fix Strategy\n 1. Remove duplicate 'name' field (keep the more detailed one)\n 2. Update foreign key references to use correct plural model name\n\n ## Detailed Steps\n 1. shopping_customers model: Remove second 'name' field from plainFields\n 2. shopping_orders model: Update targetModel from 'shopping_customer' to 'shopping_customers'\n\n ## Preservation Notes\n - Keep business descriptions for remaining 'name' field\n - Maintain all relationship semantics\n - Preserve all indexes and constraints"
|
|
6373
|
+
description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\nšÆ Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\nš Required Planning Content:\n\n1. **Error Scope Analysis**\n\n - List all validation errors from IAutoBePrismaValidation.IError[] array\n - Extract unique table names from errors to identify affected models\n - Categorize errors by type (field duplications, references, types, indexes)\n - Identify which models need correction vs. which remain unchanged\n2. **Targeted Fix Strategy**\n\n - Focus ONLY on models mentioned in validation errors\n - Outline minimal changes needed for each affected model\n - Plan cross-model reference updates (if any) without modifying non-error\n models\n - Ensure unchanged models maintain valid references to corrected models\n3. **Model-Specific Fix Plan**\n\n - Model-by-model modification plan for ONLY affected models\n - Exact field additions, renames, or type corrections required\n - Reference updates within corrected models only\n - Index corrections limited to affected models\n4. **Minimal Scope Validation**\n\n - Confirm which models will be included in output (error models only)\n - List models that will remain unchanged in original schema\n - Identify cross-model dependencies without including unchanged models\n - Preserve all business logic within corrected models\n5. **Targeted Impact Assessment**\n\n - Potential effects of fixes on unchanged models (reference validation)\n - Verification points for corrected models only\n - Ensure no new validation errors in targeted models\n - Confirm minimal output scope compliance\n\nš” Example Planning Structure:\n\n ## Error Scope\n - Target Models: shopping_customers, shopping_orders (2 models only)\n - Unchanged Models: All others remain in original schema\n\n ## Targeted Fixes\n - shopping_customers: Remove duplicate 'email' field\n - shopping_orders: Update targetModel reference to 'shopping_customers'\n\n ## Output Scope\n - Return: Only shopping_customers and shopping_orders models\n - Preserve: All other models unchanged in original schema\n\n ## Cross-Model Impact\n - Verify: shopping_orders still references shopping_customers correctly\n - No changes needed in other models referencing these"
|
|
6467
6374
|
},
|
|
6468
|
-
|
|
6375
|
+
models: {
|
|
6469
6376
|
type: "array",
|
|
6470
6377
|
items: {
|
|
6471
6378
|
type: "object",
|
|
6472
6379
|
properties: {
|
|
6473
|
-
|
|
6380
|
+
name: {
|
|
6474
6381
|
type: "string",
|
|
6475
|
-
pattern: "^[a-
|
|
6476
|
-
title: "Name of the
|
|
6477
|
-
description: 'Name of the
|
|
6382
|
+
pattern: "^[a-z][a-z0-9_]*$",
|
|
6383
|
+
title: "Name of the Prisma model (database table name)",
|
|
6384
|
+
description: 'Name of the Prisma model (database table name).\n\nShould follow snake_case convention with domain prefix. Examples:\n"shopping_customers", "shopping_sale_snapshots", "bbs_articles"\nMaterialized views use "mv_" prefix: "mv_shopping_sale_last_snapshots"'
|
|
6478
6385
|
},
|
|
6479
|
-
|
|
6386
|
+
description: {
|
|
6480
6387
|
type: "string",
|
|
6481
|
-
|
|
6482
|
-
|
|
6388
|
+
description: 'Detailed description explaining the business purpose and usage of the\nmodel.\n\nShould include:\n\n- Business context and purpose\n- Key relationships with other models\n- Important behavioral notes or constraints\n- References to related entities using "{@\\link ModelName}" syntax Example:\n "Customer information, but not a person but a **connection** basis..."'
|
|
6389
|
+
},
|
|
6390
|
+
material: {
|
|
6391
|
+
type: "boolean",
|
|
6392
|
+
description: 'Indicates whether this model represents a materialized view for\nperformance optimization.\n\nMaterialized views are read-only computed tables that cache complex query\nresults. They\'re marked as "@\\hidden" in documentation and prefixed with\n"mv_" in naming. Examples: mv_shopping_sale_last_snapshots,\nmv_shopping_cart_commodity_prices'
|
|
6393
|
+
},
|
|
6394
|
+
primaryField: {
|
|
6395
|
+
type: "object",
|
|
6396
|
+
properties: {
|
|
6397
|
+
name: {
|
|
6398
|
+
type: "string",
|
|
6399
|
+
pattern: "^[a-z][a-z0-9_]*$",
|
|
6400
|
+
title: "Name of the primary key field",
|
|
6401
|
+
description: 'Name of the primary key field.\n\nConsistently named "id" across all models in the uploaded schemas.\nRepresents the unique identifier for each record in the table.'
|
|
6402
|
+
},
|
|
6403
|
+
type: {
|
|
6404
|
+
type: "string",
|
|
6405
|
+
enum: [ "uuid" ],
|
|
6406
|
+
title: "Data type of the primary key field",
|
|
6407
|
+
description: 'Data type of the primary key field.\n\nAlways "uuid" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.'
|
|
6408
|
+
},
|
|
6409
|
+
description: {
|
|
6410
|
+
type: "string",
|
|
6411
|
+
title: "Description of the primary key field's purpose",
|
|
6412
|
+
description: 'Description of the primary key field\'s purpose.\n\nStandard description is "Primary Key." across all models. Serves as the\nunique identifier for the model instance.'
|
|
6413
|
+
}
|
|
6414
|
+
},
|
|
6415
|
+
required: [ "name", "type", "description" ],
|
|
6416
|
+
description: 'The primary key field of the model.\n\nIn all uploaded schemas, primary keys are always UUID type with "@\\id"\ndirective. Usually named "id" and marked with "@\\db.Uuid" for PostgreSQL\nmapping.\n\n------------------------------\n\nDescription of the current {@link AutoBePrisma.IPrimaryField} type:\n\n> Interface representing the primary key field of a Prisma model.\n> \n> All models in the uploaded schemas use UUID as primary key for better\n> distributed system compatibility and security (no sequential ID exposure).',
|
|
6417
|
+
additionalProperties: false
|
|
6483
6418
|
},
|
|
6484
|
-
|
|
6419
|
+
foreignFields: {
|
|
6485
6420
|
type: "array",
|
|
6486
6421
|
items: {
|
|
6487
6422
|
type: "object",
|
|
@@ -6489,281 +6424,199 @@ const collection$2 = {
|
|
|
6489
6424
|
name: {
|
|
6490
6425
|
type: "string",
|
|
6491
6426
|
pattern: "^[a-z][a-z0-9_]*$",
|
|
6492
|
-
title: "Name of the
|
|
6493
|
-
description: 'Name of the
|
|
6427
|
+
title: "Name of the foreign key field",
|
|
6428
|
+
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)'
|
|
6494
6429
|
},
|
|
6495
|
-
|
|
6430
|
+
type: {
|
|
6496
6431
|
type: "string",
|
|
6497
|
-
|
|
6432
|
+
enum: [ "uuid" ],
|
|
6433
|
+
title: "Data type of the foreign key field",
|
|
6434
|
+
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.'
|
|
6498
6435
|
},
|
|
6499
|
-
|
|
6500
|
-
type: "
|
|
6501
|
-
description: '
|
|
6436
|
+
description: {
|
|
6437
|
+
type: "string",
|
|
6438
|
+
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.'
|
|
6502
6439
|
},
|
|
6503
|
-
|
|
6440
|
+
relation: {
|
|
6504
6441
|
type: "object",
|
|
6505
6442
|
properties: {
|
|
6506
6443
|
name: {
|
|
6507
6444
|
type: "string",
|
|
6508
|
-
pattern: "^[a-
|
|
6509
|
-
title: "Name of the
|
|
6510
|
-
description: 'Name of the
|
|
6511
|
-
},
|
|
6512
|
-
type: {
|
|
6513
|
-
type: "string",
|
|
6514
|
-
enum: [ "uuid" ],
|
|
6515
|
-
title: "Data type of the primary key field",
|
|
6516
|
-
description: 'Data type of the primary key field.\n\nAlways "uuid" in the uploaded schemas for better distributed system\nsupport and to avoid exposing sequential IDs that could reveal business\ninformation.'
|
|
6445
|
+
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
6446
|
+
title: "Name of the relation property in the Prisma model",
|
|
6447
|
+
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"'
|
|
6517
6448
|
},
|
|
6518
|
-
|
|
6449
|
+
targetModel: {
|
|
6519
6450
|
type: "string",
|
|
6520
|
-
title: "
|
|
6521
|
-
description: '
|
|
6451
|
+
title: "Name of the target model being referenced",
|
|
6452
|
+
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"'
|
|
6522
6453
|
}
|
|
6523
6454
|
},
|
|
6524
|
-
required: [ "name", "
|
|
6525
|
-
|
|
6455
|
+
required: [ "name", "targetModel" ],
|
|
6456
|
+
title: "Prisma relation configuration defining the association details",
|
|
6457
|
+
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
6526
6458
|
additionalProperties: false
|
|
6527
6459
|
},
|
|
6528
|
-
|
|
6529
|
-
type: "
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
properties: {
|
|
6533
|
-
name: {
|
|
6534
|
-
type: "string",
|
|
6535
|
-
pattern: "^[a-z][a-z0-9_]*$",
|
|
6536
|
-
title: "Name of the foreign key field",
|
|
6537
|
-
description: 'Name of the foreign key field.\n\nFollows convention: "{target_model_name_without_prefix}_id" Examples:\n"shopping_customer_id", "bbs_article_id", "attachment_file_id" For\nself-references: "parent_id" (e.g., in hierarchical structures)'
|
|
6538
|
-
},
|
|
6539
|
-
type: {
|
|
6540
|
-
type: "string",
|
|
6541
|
-
enum: [ "uuid" ],
|
|
6542
|
-
title: "Data type of the foreign key field",
|
|
6543
|
-
description: 'Data type of the foreign key field.\n\nAlways "uuid" to match the primary key type of referenced models. Ensures\nreferential integrity and consistency across the schema.'
|
|
6544
|
-
},
|
|
6545
|
-
description: {
|
|
6546
|
-
type: "string",
|
|
6547
|
-
description: 'Description explaining the purpose and target of this foreign key\nrelationship.\n\nShould reference the target model using format: "Target model\'s {@\\link\nModelName.id}" Examples: "Belonged customer\'s {@\\link\nshopping_customers.id}" May include additional context about the\nrelationship\'s business meaning.'
|
|
6548
|
-
},
|
|
6549
|
-
relation: {
|
|
6550
|
-
type: "object",
|
|
6551
|
-
properties: {
|
|
6552
|
-
name: {
|
|
6553
|
-
type: "string",
|
|
6554
|
-
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
6555
|
-
title: "Name of the relation property in the Prisma model",
|
|
6556
|
-
description: 'Name of the relation property in the Prisma model.\n\nUsed to access the related model instance. Usually a descriptive name\nof the relationship. Examples: "customer", "channel", "parent",\n"snapshot"'
|
|
6557
|
-
},
|
|
6558
|
-
targetModel: {
|
|
6559
|
-
type: "string",
|
|
6560
|
-
title: "Name of the target model being referenced",
|
|
6561
|
-
description: 'Name of the target model being referenced.\n\nMust match exactly with an existing model name in the schema. Examples:\n"shopping_customers", "shopping_channels", "bbs_articles"'
|
|
6562
|
-
}
|
|
6563
|
-
},
|
|
6564
|
-
required: [ "name", "targetModel" ],
|
|
6565
|
-
title: "Prisma relation configuration defining the association details",
|
|
6566
|
-
description: "Prisma relation configuration defining the association details.\n\nSpecifies how this foreign key connects to the target model, including\nrelation name, target model, and target field.",
|
|
6567
|
-
additionalProperties: false
|
|
6568
|
-
},
|
|
6569
|
-
unique: {
|
|
6570
|
-
type: "boolean",
|
|
6571
|
-
title: "Whether this foreign key has a unique constraint",
|
|
6572
|
-
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality."
|
|
6573
|
-
},
|
|
6574
|
-
nullable: {
|
|
6575
|
-
type: "boolean",
|
|
6576
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
6577
|
-
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations."
|
|
6578
|
-
}
|
|
6579
|
-
},
|
|
6580
|
-
required: [ "name", "type", "description", "relation", "unique", "nullable" ],
|
|
6581
|
-
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
6582
|
-
additionalProperties: false
|
|
6583
|
-
},
|
|
6584
|
-
title: "Array of foreign key fields that reference other models",
|
|
6585
|
-
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships."
|
|
6460
|
+
unique: {
|
|
6461
|
+
type: "boolean",
|
|
6462
|
+
title: "Whether this foreign key has a unique constraint",
|
|
6463
|
+
description: "Whether this foreign key has a unique constraint.\n\nTrue: Creates a 1:1 relationship (e.g., user profile, order publish\ndetails) false: Allows 1:N relationship (e.g., customer to multiple\norders) Used for enforcing business rules about relationship\ncardinality."
|
|
6586
6464
|
},
|
|
6587
|
-
|
|
6588
|
-
type: "
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
type: "boolean",
|
|
6611
|
-
title: "Whether this field can contain null values",
|
|
6612
|
-
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data."
|
|
6613
|
-
}
|
|
6614
|
-
},
|
|
6615
|
-
required: [ "name", "type", "description", "nullable" ],
|
|
6616
|
-
description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
|
|
6617
|
-
additionalProperties: false
|
|
6618
|
-
},
|
|
6619
|
-
title: "Array of regular data fields that don't reference other models",
|
|
6620
|
-
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing."
|
|
6465
|
+
nullable: {
|
|
6466
|
+
type: "boolean",
|
|
6467
|
+
title: "Whether this foreign key can be null (optional relationship)",
|
|
6468
|
+
description: "Whether this foreign key can be null (optional relationship).\n\nTrue: Relationship is optional, foreign key can be null false:\nRelationship is required, foreign key cannot be null Reflects business\nrules about mandatory vs optional associations."
|
|
6469
|
+
}
|
|
6470
|
+
},
|
|
6471
|
+
required: [ "name", "type", "description", "relation", "unique", "nullable" ],
|
|
6472
|
+
description: "Description of the current {@link AutoBePrisma.IForeignField} type:\n\n> Interface representing a foreign key field that establishes relationships\n> between models.\n> \n> Foreign keys create associations between models, enabling relational data\n> modeling. They can represent 1:1, 1:N, or participate in M:N relationships\n> through junction tables.",
|
|
6473
|
+
additionalProperties: false
|
|
6474
|
+
},
|
|
6475
|
+
title: "Array of foreign key fields that reference other models",
|
|
6476
|
+
description: "Array of foreign key fields that reference other models.\n\nThese establish relationships between models and include Prisma relation\ndirectives. Can be nullable (optional relationships) or required\n(mandatory relationships). May have unique constraints for 1:1\nrelationships."
|
|
6477
|
+
},
|
|
6478
|
+
plainFields: {
|
|
6479
|
+
type: "array",
|
|
6480
|
+
items: {
|
|
6481
|
+
type: "object",
|
|
6482
|
+
properties: {
|
|
6483
|
+
name: {
|
|
6484
|
+
type: "string",
|
|
6485
|
+
pattern: "^[a-z][a-z0-9_]*$",
|
|
6486
|
+
title: "Name of the field in the database table",
|
|
6487
|
+
description: "Name of the field in the database table.\n\nShould use snake_case convention. Common patterns from uploaded schemas:\n\n- Timestamps: created_at, updated_at, deleted_at, opened_at, closed_at\n- Identifiers: code, name, nickname, title\n- Business data: value, quantity, price, volume, balance\n- Flags: primary, required, exclusive, secret, multiplicative"
|
|
6621
6488
|
},
|
|
6622
|
-
|
|
6623
|
-
type: "
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
minItems: 1,
|
|
6633
|
-
uniqueItems: true,
|
|
6634
|
-
title: "Array of field names that together form the unique constraint",
|
|
6635
|
-
description: 'Array of field names that together form the unique constraint.\n\nCan be single field (e.g., ["email"]) or composite (e.g., ["channel_id",\n"code"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: ["code"], ["shopping_channel_id",\n"nickname"], ["email"]'
|
|
6636
|
-
},
|
|
6637
|
-
unique: {
|
|
6638
|
-
type: "boolean",
|
|
6639
|
-
enum: [ true ],
|
|
6640
|
-
title: "Explicit marker indicating this is a unique index",
|
|
6641
|
-
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".'
|
|
6642
|
-
}
|
|
6643
|
-
},
|
|
6644
|
-
required: [ "fieldNames", "unique" ],
|
|
6645
|
-
description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
|
|
6646
|
-
additionalProperties: false
|
|
6647
|
-
},
|
|
6648
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
6649
|
-
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname)."
|
|
6489
|
+
type: {
|
|
6490
|
+
type: "string",
|
|
6491
|
+
enum: [ "string", "boolean", "uuid", "uri", "int", "double", "datetime" ],
|
|
6492
|
+
title: "Data type of the field for Prisma schema generation",
|
|
6493
|
+
description: "Data type of the field for Prisma schema generation.\n\nMaps to appropriate Prisma/PostgreSQL types:\n\n- Boolean: Boolean flags and yes/no values\n- Int: Integer numbers, quantities, sequences\n- Double: Decimal numbers, prices, monetary values, percentages\n- String: Text data, names, descriptions, codes\n- Uri: URL/URI fields for links and references\n- Uuid: UUID fields (for non-foreign-key UUIDs)\n- Date: Date-only values (rare, mostly for business dates)\n- Datetime: Timestamp fields with date and time"
|
|
6494
|
+
},
|
|
6495
|
+
description: {
|
|
6496
|
+
type: "string",
|
|
6497
|
+
title: "Description explaining the business purpose and usage of this field",
|
|
6498
|
+
description: 'Description explaining the business purpose and usage of this field.\n\nShould clearly explain:\n\n- What business concept this field represents\n- Valid values or constraints if applicable\n- How it relates to business processes\n- Any special behavioral notes Example: "Amount of cash payment." or\n "Whether the unit is required or not."'
|
|
6650
6499
|
},
|
|
6651
|
-
|
|
6500
|
+
nullable: {
|
|
6501
|
+
type: "boolean",
|
|
6502
|
+
title: "Whether this field can contain null values",
|
|
6503
|
+
description: "Whether this field can contain null values.\n\nTrue: Field is optional and can be null (e.g., middle name, description)\nfalse: Field is required and cannot be null (e.g., creation timestamp,\nname) Reflects business rules about mandatory vs optional data."
|
|
6504
|
+
}
|
|
6505
|
+
},
|
|
6506
|
+
required: [ "name", "type", "description", "nullable" ],
|
|
6507
|
+
description: "Description of the current {@link AutoBePrisma.IPlainField} type:\n\n> Interface representing a regular data field that stores business\n> information.\n> \n> These fields contain the actual business data like names, amounts,\n> timestamps, flags, descriptions, and other domain-specific information.",
|
|
6508
|
+
additionalProperties: false
|
|
6509
|
+
},
|
|
6510
|
+
title: "Array of regular data fields that don't reference other models",
|
|
6511
|
+
description: "Array of regular data fields that don't reference other models.\n\nInclude business data like names, descriptions, timestamps, flags,\namounts, etc. Common patterns: created_at, updated_at, deleted_at for\nsoft deletion and auditing."
|
|
6512
|
+
},
|
|
6513
|
+
uniqueIndexes: {
|
|
6514
|
+
type: "array",
|
|
6515
|
+
items: {
|
|
6516
|
+
type: "object",
|
|
6517
|
+
properties: {
|
|
6518
|
+
fieldNames: {
|
|
6652
6519
|
type: "array",
|
|
6653
6520
|
items: {
|
|
6654
|
-
type: "
|
|
6655
|
-
properties: {
|
|
6656
|
-
fieldNames: {
|
|
6657
|
-
type: "array",
|
|
6658
|
-
items: {
|
|
6659
|
-
type: "string"
|
|
6660
|
-
},
|
|
6661
|
-
minItems: 1,
|
|
6662
|
-
uniqueItems: true,
|
|
6663
|
-
title: "Array of field names to include in the performance index",
|
|
6664
|
-
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]'
|
|
6665
|
-
}
|
|
6666
|
-
},
|
|
6667
|
-
required: [ "fieldNames" ],
|
|
6668
|
-
description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
|
|
6669
|
-
additionalProperties: false
|
|
6521
|
+
type: "string"
|
|
6670
6522
|
},
|
|
6671
|
-
|
|
6672
|
-
|
|
6523
|
+
minItems: 1,
|
|
6524
|
+
uniqueItems: true,
|
|
6525
|
+
title: "Array of field names that together form the unique constraint",
|
|
6526
|
+
description: 'Array of field names that together form the unique constraint.\n\nCan be single field (e.g., ["email"]) or composite (e.g., ["channel_id",\n"code"]). All field names must exist in the model. Order matters for\ncomposite indexes. Examples: ["code"], ["shopping_channel_id",\n"nickname"], ["email"]'
|
|
6673
6527
|
},
|
|
6674
|
-
|
|
6528
|
+
unique: {
|
|
6529
|
+
type: "boolean",
|
|
6530
|
+
enum: [ true ],
|
|
6531
|
+
title: "Explicit marker indicating this is a unique index",
|
|
6532
|
+
description: 'Explicit marker indicating this is a unique index.\n\nAlways true to distinguish from regular indexes. Used by code generator\nto emit "@@unique" directive in Prisma schema instead of "@@index".'
|
|
6533
|
+
}
|
|
6534
|
+
},
|
|
6535
|
+
required: [ "fieldNames", "unique" ],
|
|
6536
|
+
description: "Description of the current {@link AutoBePrisma.IUniqueIndex} type:\n\n> Interface representing a unique index constraint on one or more fields.\n> \n> Unique indexes enforce data integrity by ensuring no duplicate values exist\n> for the specified field combination. Essential for business rules that\n> require uniqueness like email addresses, codes, or composite keys.",
|
|
6537
|
+
additionalProperties: false
|
|
6538
|
+
},
|
|
6539
|
+
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
6540
|
+
description: "Array of unique indexes for enforcing data integrity constraints.\n\nEnsure uniqueness across single or multiple columns. Examples: unique\nemail addresses, unique codes within a channel, unique combinations like\n(channel_id, nickname)."
|
|
6541
|
+
},
|
|
6542
|
+
plainIndexes: {
|
|
6543
|
+
type: "array",
|
|
6544
|
+
items: {
|
|
6545
|
+
type: "object",
|
|
6546
|
+
properties: {
|
|
6547
|
+
fieldNames: {
|
|
6675
6548
|
type: "array",
|
|
6676
6549
|
items: {
|
|
6677
|
-
type: "
|
|
6678
|
-
properties: {
|
|
6679
|
-
fieldName: {
|
|
6680
|
-
type: "string",
|
|
6681
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
6682
|
-
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.'
|
|
6683
|
-
}
|
|
6684
|
-
},
|
|
6685
|
-
required: [ "fieldName" ],
|
|
6686
|
-
description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
|
|
6687
|
-
additionalProperties: false
|
|
6550
|
+
type: "string"
|
|
6688
6551
|
},
|
|
6689
|
-
|
|
6690
|
-
|
|
6552
|
+
minItems: 1,
|
|
6553
|
+
uniqueItems: true,
|
|
6554
|
+
title: "Array of field names to include in the performance index",
|
|
6555
|
+
description: 'Array of field names to include in the performance index.\n\nCan be single field (e.g., ["created_at"]) or composite (e.g.,\n["customer_id", "created_at"]). All field names must exist in the model.\nOrder matters for composite indexes and should match common query\npatterns. Examples: ["created_at"], ["shopping_customer_id",\n"created_at"], ["ip"]'
|
|
6556
|
+
}
|
|
6557
|
+
},
|
|
6558
|
+
required: [ "fieldNames" ],
|
|
6559
|
+
description: "Description of the current {@link AutoBePrisma.IPlainIndex} type:\n\n> Interface representing a regular (non-unique) index for query performance.\n> \n> Regular indexes speed up database queries by creating optimized data\n> structures for common search patterns. Essential for foreign keys, date\n> ranges, and frequently filtered fields.",
|
|
6560
|
+
additionalProperties: false
|
|
6561
|
+
},
|
|
6562
|
+
title: "Array of regular indexes for query performance optimization",
|
|
6563
|
+
description: "Array of regular indexes for query performance optimization.\n\nSpeed up common query patterns like filtering by foreign keys, date\nranges, or frequently searched fields. Examples: indexes on created_at,\nforeign key fields, search fields."
|
|
6564
|
+
},
|
|
6565
|
+
ginIndexes: {
|
|
6566
|
+
type: "array",
|
|
6567
|
+
items: {
|
|
6568
|
+
type: "object",
|
|
6569
|
+
properties: {
|
|
6570
|
+
fieldName: {
|
|
6571
|
+
type: "string",
|
|
6572
|
+
title: "Name of the text field to index for full-text search capabilities",
|
|
6573
|
+
description: 'Name of the text field to index for full-text search capabilities.\n\nMust be a string field in the model that contains searchable text.\nExamples from uploaded schemas: "nickname", "title", "body", "name" Used\nwith PostgreSQL gin_trgm_ops for trigram-based fuzzy text search.'
|
|
6691
6574
|
}
|
|
6692
6575
|
},
|
|
6693
|
-
required: [ "
|
|
6694
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
6576
|
+
required: [ "fieldName" ],
|
|
6577
|
+
description: "Description of the current {@link AutoBePrisma.IGinIndex} type:\n\n> Interface representing a GIN (Generalized Inverted Index) for full-text\n> search.\n> \n> GIN indexes enable advanced PostgreSQL text search capabilities including\n> fuzzy matching and partial text search using trigram operations. Essential\n> for user-facing search features on text content.",
|
|
6695
6578
|
additionalProperties: false
|
|
6696
6579
|
},
|
|
6697
|
-
title: "Array of
|
|
6698
|
-
description: "Array of
|
|
6580
|
+
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
6581
|
+
description: "Array of GIN (Generalized Inverted Index) indexes for full-text search.\n\nUsed specifically for PostgreSQL text search capabilities using trigram\noperations. Applied to text fields that need fuzzy matching or partial\ntext search. Examples: searching names, nicknames, titles, content\nbodies."
|
|
6699
6582
|
}
|
|
6700
6583
|
},
|
|
6701
|
-
required: [ "
|
|
6702
|
-
description: "Description of the current {@link AutoBePrisma.
|
|
6584
|
+
required: [ "name", "description", "material", "primaryField", "foreignFields", "plainFields", "uniqueIndexes", "plainIndexes", "ginIndexes" ],
|
|
6585
|
+
description: "Description of the current {@link AutoBePrisma.IModel} type:\n\n> Interface representing a single Prisma model (database table).\n> \n> Based on the uploaded schemas, models follow specific patterns:\n> \n> - Main business entities (e.g., shopping_sales, shopping_customers)\n> - Snapshot/versioning entities for audit trails (e.g.,\n> shopping_sale_snapshots)\n> - Junction tables for M:N relationships (e.g.,\n> shopping_cart_commodity_stocks)\n> - Materialized views for performance (prefixed with mv_)",
|
|
6703
6586
|
additionalProperties: false
|
|
6704
6587
|
},
|
|
6705
|
-
description: "
|
|
6588
|
+
description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\nš„ Input Structure:\n\n- Contains ONLY models mentioned in IAutoBePrismaValidation.IError[] array\n- Each model has specific validation errors that need targeted correction\n- Models not mentioned in errors are excluded from this input\n- Represents minimal scope for error correction\n\nš Expected Validation Issues (Model-Specific):\n\n- Duplicate field/relation names within these specific models\n- Invalid foreign key references from these models to other models\n- Single foreign key fields in index arrays within these models\n- Invalid naming conventions within these specific models\n- Type validation errors in fields of these models\n\nš Model Content Analysis (Targeted Scope):\n\n- Complete field definitions for each error model only\n- Relationships from these models (may reference unchanged models)\n- Indexes within these models that need correction\n- Business descriptions specific to these models\n- Cross-model references that need validation (read-only for targets)\n\nā ļø Processing Notes (Focused Approach):\n\n- Input contains ONLY models with validation errors\n- May reference other models not included in this input\n- Cross-model references must be validated but target models won't be\n modified\n- Output should return corrected versions of ONLY these input models\n- All business logic and descriptions within these models must be preserved\n- Corrections must not break references from unchanged models\n\nšÆ Correction Scope:\n\n- Fix validation errors within these specific models\n- Update internal model structure (fields, relations, indexes)\n- Correct references to external models (without modifying targets)\n- Maintain compatibility with unchanged models in the full schema\n- Return corrected versions of ONLY these models"
|
|
6706
6589
|
}
|
|
6707
6590
|
},
|
|
6708
|
-
required: [ "planning", "
|
|
6591
|
+
required: [ "planning", "models" ],
|
|
6709
6592
|
description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
|
|
6710
6593
|
additionalProperties: false
|
|
6711
6594
|
},
|
|
6712
|
-
description: "Fixes validation errors in AutoBePrisma
|
|
6595
|
+
description: "Fixes validation errors in specific AutoBePrisma models while preserving\nALL existing business logic and model descriptions.\n\n## Core Rules\n\n1. Fix ONLY validation errors in provided models - never remove business\n descriptions\n2. Apply minimal changes to error models only - preserve original design\n intent\n3. Return ONLY corrected models - unchanged models remain in original schema\n4. Maintain referential integrity with unchanged models\n\n## Targeted Scope\n\n- Process ONLY models with validation errors from IError[] array\n- Exclude models without errors from processing and output\n- Minimize context usage by returning corrected models only\n- Preserve unchanged models in their original state\n\n## Fix Strategy\n\n- Resolve validation errors within specific models only\n- Fix field duplications, invalid references, and type mismatches\n- Update cross-model references without modifying target models\n- Ensure naming conventions and index rules compliance in corrected models",
|
|
6713
6596
|
validate: (() => {
|
|
6714
|
-
const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.
|
|
6715
|
-
const _io1 = input => "string" === typeof input.
|
|
6716
|
-
const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "
|
|
6717
|
-
const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description;
|
|
6718
|
-
const _io4 = input => "string" === typeof input.name && RegExp("^[a-
|
|
6719
|
-
const _io5 = input => "string" === typeof input.name && RegExp("^[a-
|
|
6720
|
-
const _io6 = input =>
|
|
6721
|
-
const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem)))
|
|
6722
|
-
const _io8 = input =>
|
|
6723
|
-
const _io9 = input => "string" === typeof input.fieldName;
|
|
6597
|
+
const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every((elem => "object" === typeof elem && null !== elem && _io1(elem))));
|
|
6598
|
+
const _io1 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "string" === typeof input.description && "boolean" === typeof input.material && ("object" === typeof input.primaryField && null !== input.primaryField && _io2(input.primaryField)) && (Array.isArray(input.foreignFields) && input.foreignFields.every((elem => "object" === typeof elem && null !== elem && _io3(elem)))) && (Array.isArray(input.plainFields) && input.plainFields.every((elem => "object" === typeof elem && null !== elem && _io5(elem)))) && (Array.isArray(input.uniqueIndexes) && input.uniqueIndexes.every((elem => "object" === typeof elem && null !== elem && _io6(elem)))) && (Array.isArray(input.plainIndexes) && input.plainIndexes.every((elem => "object" === typeof elem && null !== elem && _io7(elem)))) && (Array.isArray(input.ginIndexes) && input.ginIndexes.every((elem => "object" === typeof elem && null !== elem && _io8(elem))));
|
|
6599
|
+
const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description;
|
|
6600
|
+
const _io3 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description && ("object" === typeof input.relation && null !== input.relation && _io4(input.relation)) && "boolean" === typeof input.unique && "boolean" === typeof input.nullable;
|
|
6601
|
+
const _io4 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel;
|
|
6602
|
+
const _io5 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && ("string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type) && "string" === typeof input.description && "boolean" === typeof input.nullable;
|
|
6603
|
+
const _io6 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem))) && true === input.unique;
|
|
6604
|
+
const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every((elem => "string" === typeof elem)));
|
|
6605
|
+
const _io8 = input => "string" === typeof input.fieldName;
|
|
6724
6606
|
const _vo0 = (input, _path, _exceptionable = true) => [ "string" === typeof input.planning || _report(_exceptionable, {
|
|
6725
6607
|
path: _path + ".planning",
|
|
6726
6608
|
expected: "string",
|
|
6727
6609
|
value: input.planning
|
|
6728
|
-
}), (Array.isArray(input.files) || _report(_exceptionable, {
|
|
6729
|
-
path: _path + ".files",
|
|
6730
|
-
expected: "Array<AutoBePrisma.IFile>",
|
|
6731
|
-
value: input.files
|
|
6732
|
-
})) && input.files.map(((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6733
|
-
path: _path + ".files[" + _index10 + "]",
|
|
6734
|
-
expected: "AutoBePrisma.IFile",
|
|
6735
|
-
value: elem
|
|
6736
|
-
})) && _vo1(elem, _path + ".files[" + _index10 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6737
|
-
path: _path + ".files[" + _index10 + "]",
|
|
6738
|
-
expected: "AutoBePrisma.IFile",
|
|
6739
|
-
value: elem
|
|
6740
|
-
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
6741
|
-
path: _path + ".files",
|
|
6742
|
-
expected: "Array<AutoBePrisma.IFile>",
|
|
6743
|
-
value: input.files
|
|
6744
|
-
}) ].every((flag => flag));
|
|
6745
|
-
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.filename && (RegExp("^[a-zA-Z0-9._-]+\\.prisma$").test(input.filename) || _report(_exceptionable, {
|
|
6746
|
-
path: _path + ".filename",
|
|
6747
|
-
expected: 'string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">',
|
|
6748
|
-
value: input.filename
|
|
6749
|
-
})) || _report(_exceptionable, {
|
|
6750
|
-
path: _path + ".filename",
|
|
6751
|
-
expected: '(string & Pattern<"^[a-zA-Z0-9._-]+\\\\.prisma$">)',
|
|
6752
|
-
value: input.filename
|
|
6753
|
-
}), "string" === typeof input.namespace || _report(_exceptionable, {
|
|
6754
|
-
path: _path + ".namespace",
|
|
6755
|
-
expected: "string",
|
|
6756
|
-
value: input.namespace
|
|
6757
6610
|
}), (Array.isArray(input.models) || _report(_exceptionable, {
|
|
6758
6611
|
path: _path + ".models",
|
|
6759
6612
|
expected: "Array<AutoBePrisma.IModel>",
|
|
6760
6613
|
value: input.models
|
|
6761
|
-
})) && input.models.map(((elem,
|
|
6762
|
-
path: _path + ".models[" +
|
|
6614
|
+
})) && input.models.map(((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6615
|
+
path: _path + ".models[" + _index9 + "]",
|
|
6763
6616
|
expected: "AutoBePrisma.IModel",
|
|
6764
6617
|
value: elem
|
|
6765
|
-
})) &&
|
|
6766
|
-
path: _path + ".models[" +
|
|
6618
|
+
})) && _vo1(elem, _path + ".models[" + _index9 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6619
|
+
path: _path + ".models[" + _index9 + "]",
|
|
6767
6620
|
expected: "AutoBePrisma.IModel",
|
|
6768
6621
|
value: elem
|
|
6769
6622
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6771,7 +6624,7 @@ const collection$2 = {
|
|
|
6771
6624
|
expected: "Array<AutoBePrisma.IModel>",
|
|
6772
6625
|
value: input.models
|
|
6773
6626
|
}) ].every((flag => flag));
|
|
6774
|
-
const
|
|
6627
|
+
const _vo1 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6775
6628
|
path: _path + ".name",
|
|
6776
6629
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6777
6630
|
value: input.name
|
|
@@ -6791,7 +6644,7 @@ const collection$2 = {
|
|
|
6791
6644
|
path: _path + ".primaryField",
|
|
6792
6645
|
expected: "AutoBePrisma.IPrimaryField",
|
|
6793
6646
|
value: input.primaryField
|
|
6794
|
-
})) &&
|
|
6647
|
+
})) && _vo2(input.primaryField, _path + ".primaryField", _exceptionable) || _report(_exceptionable, {
|
|
6795
6648
|
path: _path + ".primaryField",
|
|
6796
6649
|
expected: "AutoBePrisma.IPrimaryField",
|
|
6797
6650
|
value: input.primaryField
|
|
@@ -6799,12 +6652,12 @@ const collection$2 = {
|
|
|
6799
6652
|
path: _path + ".foreignFields",
|
|
6800
6653
|
expected: "Array<AutoBePrisma.IForeignField>",
|
|
6801
6654
|
value: input.foreignFields
|
|
6802
|
-
})) && input.foreignFields.map(((elem,
|
|
6803
|
-
path: _path + ".foreignFields[" +
|
|
6655
|
+
})) && input.foreignFields.map(((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6656
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
6804
6657
|
expected: "AutoBePrisma.IForeignField",
|
|
6805
6658
|
value: elem
|
|
6806
|
-
})) &&
|
|
6807
|
-
path: _path + ".foreignFields[" +
|
|
6659
|
+
})) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6660
|
+
path: _path + ".foreignFields[" + _index10 + "]",
|
|
6808
6661
|
expected: "AutoBePrisma.IForeignField",
|
|
6809
6662
|
value: elem
|
|
6810
6663
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6815,12 +6668,12 @@ const collection$2 = {
|
|
|
6815
6668
|
path: _path + ".plainFields",
|
|
6816
6669
|
expected: "Array<AutoBePrisma.IPlainField>",
|
|
6817
6670
|
value: input.plainFields
|
|
6818
|
-
})) && input.plainFields.map(((elem,
|
|
6819
|
-
path: _path + ".plainFields[" +
|
|
6671
|
+
})) && input.plainFields.map(((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6672
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
6820
6673
|
expected: "AutoBePrisma.IPlainField",
|
|
6821
6674
|
value: elem
|
|
6822
|
-
})) &&
|
|
6823
|
-
path: _path + ".plainFields[" +
|
|
6675
|
+
})) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6676
|
+
path: _path + ".plainFields[" + _index11 + "]",
|
|
6824
6677
|
expected: "AutoBePrisma.IPlainField",
|
|
6825
6678
|
value: elem
|
|
6826
6679
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6831,12 +6684,12 @@ const collection$2 = {
|
|
|
6831
6684
|
path: _path + ".uniqueIndexes",
|
|
6832
6685
|
expected: "Array<AutoBePrisma.IUniqueIndex>",
|
|
6833
6686
|
value: input.uniqueIndexes
|
|
6834
|
-
})) && input.uniqueIndexes.map(((elem,
|
|
6835
|
-
path: _path + ".uniqueIndexes[" +
|
|
6687
|
+
})) && input.uniqueIndexes.map(((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6688
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
6836
6689
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
6837
6690
|
value: elem
|
|
6838
|
-
})) &&
|
|
6839
|
-
path: _path + ".uniqueIndexes[" +
|
|
6691
|
+
})) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6692
|
+
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
6840
6693
|
expected: "AutoBePrisma.IUniqueIndex",
|
|
6841
6694
|
value: elem
|
|
6842
6695
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6847,12 +6700,12 @@ const collection$2 = {
|
|
|
6847
6700
|
path: _path + ".plainIndexes",
|
|
6848
6701
|
expected: "Array<AutoBePrisma.IPlainIndex>",
|
|
6849
6702
|
value: input.plainIndexes
|
|
6850
|
-
})) && input.plainIndexes.map(((elem,
|
|
6851
|
-
path: _path + ".plainIndexes[" +
|
|
6703
|
+
})) && input.plainIndexes.map(((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6704
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
6852
6705
|
expected: "AutoBePrisma.IPlainIndex",
|
|
6853
6706
|
value: elem
|
|
6854
|
-
})) &&
|
|
6855
|
-
path: _path + ".plainIndexes[" +
|
|
6707
|
+
})) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6708
|
+
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
6856
6709
|
expected: "AutoBePrisma.IPlainIndex",
|
|
6857
6710
|
value: elem
|
|
6858
6711
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6863,12 +6716,12 @@ const collection$2 = {
|
|
|
6863
6716
|
path: _path + ".ginIndexes",
|
|
6864
6717
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
6865
6718
|
value: input.ginIndexes
|
|
6866
|
-
})) && input.ginIndexes.map(((elem,
|
|
6867
|
-
path: _path + ".ginIndexes[" +
|
|
6719
|
+
})) && input.ginIndexes.map(((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
6720
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
6868
6721
|
expected: "AutoBePrisma.IGinIndex",
|
|
6869
6722
|
value: elem
|
|
6870
|
-
})) &&
|
|
6871
|
-
path: _path + ".ginIndexes[" +
|
|
6723
|
+
})) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", _exceptionable) || _report(_exceptionable, {
|
|
6724
|
+
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
6872
6725
|
expected: "AutoBePrisma.IGinIndex",
|
|
6873
6726
|
value: elem
|
|
6874
6727
|
}))).every((flag => flag)) || _report(_exceptionable, {
|
|
@@ -6876,7 +6729,7 @@ const collection$2 = {
|
|
|
6876
6729
|
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
6877
6730
|
value: input.ginIndexes
|
|
6878
6731
|
}) ].every((flag => flag));
|
|
6879
|
-
const
|
|
6732
|
+
const _vo2 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6880
6733
|
path: _path + ".name",
|
|
6881
6734
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6882
6735
|
value: input.name
|
|
@@ -6893,7 +6746,7 @@ const collection$2 = {
|
|
|
6893
6746
|
expected: "string",
|
|
6894
6747
|
value: input.description
|
|
6895
6748
|
}) ].every((flag => flag));
|
|
6896
|
-
const
|
|
6749
|
+
const _vo3 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6897
6750
|
path: _path + ".name",
|
|
6898
6751
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6899
6752
|
value: input.name
|
|
@@ -6913,7 +6766,7 @@ const collection$2 = {
|
|
|
6913
6766
|
path: _path + ".relation",
|
|
6914
6767
|
expected: "__type",
|
|
6915
6768
|
value: input.relation
|
|
6916
|
-
})) &&
|
|
6769
|
+
})) && _vo4(input.relation, _path + ".relation", _exceptionable) || _report(_exceptionable, {
|
|
6917
6770
|
path: _path + ".relation",
|
|
6918
6771
|
expected: "__type",
|
|
6919
6772
|
value: input.relation
|
|
@@ -6926,7 +6779,7 @@ const collection$2 = {
|
|
|
6926
6779
|
expected: "boolean",
|
|
6927
6780
|
value: input.nullable
|
|
6928
6781
|
}) ].every((flag => flag));
|
|
6929
|
-
const
|
|
6782
|
+
const _vo4 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6930
6783
|
path: _path + ".name",
|
|
6931
6784
|
expected: 'string & Pattern<"^[a-zA-Z_][a-zA-Z0-9_]*$">',
|
|
6932
6785
|
value: input.name
|
|
@@ -6939,7 +6792,7 @@ const collection$2 = {
|
|
|
6939
6792
|
expected: "string",
|
|
6940
6793
|
value: input.targetModel
|
|
6941
6794
|
}) ].every((flag => flag));
|
|
6942
|
-
const
|
|
6795
|
+
const _vo5 = (input, _path, _exceptionable = true) => [ "string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
6943
6796
|
path: _path + ".name",
|
|
6944
6797
|
expected: 'string & Pattern<"^[a-z][a-z0-9_]*$">',
|
|
6945
6798
|
value: input.name
|
|
@@ -6960,7 +6813,7 @@ const collection$2 = {
|
|
|
6960
6813
|
expected: "boolean",
|
|
6961
6814
|
value: input.nullable
|
|
6962
6815
|
}) ].every((flag => flag));
|
|
6963
|
-
const
|
|
6816
|
+
const _vo6 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
6964
6817
|
path: _path + ".fieldNames",
|
|
6965
6818
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
6966
6819
|
value: input.fieldNames
|
|
@@ -6972,8 +6825,8 @@ const collection$2 = {
|
|
|
6972
6825
|
path: _path + ".fieldNames",
|
|
6973
6826
|
expected: "Array<> & UniqueItems<true>",
|
|
6974
6827
|
value: input.fieldNames
|
|
6975
|
-
})) && input.fieldNames.map(((elem,
|
|
6976
|
-
path: _path + ".fieldNames[" +
|
|
6828
|
+
})) && input.fieldNames.map(((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
|
|
6829
|
+
path: _path + ".fieldNames[" + _index15 + "]",
|
|
6977
6830
|
expected: "string",
|
|
6978
6831
|
value: elem
|
|
6979
6832
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -6985,7 +6838,7 @@ const collection$2 = {
|
|
|
6985
6838
|
expected: "true",
|
|
6986
6839
|
value: input.unique
|
|
6987
6840
|
}) ].every((flag => flag));
|
|
6988
|
-
const
|
|
6841
|
+
const _vo7 = (input, _path, _exceptionable = true) => [ (Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
6989
6842
|
path: _path + ".fieldNames",
|
|
6990
6843
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
6991
6844
|
value: input.fieldNames
|
|
@@ -6997,8 +6850,8 @@ const collection$2 = {
|
|
|
6997
6850
|
path: _path + ".fieldNames",
|
|
6998
6851
|
expected: "Array<> & UniqueItems<true>",
|
|
6999
6852
|
value: input.fieldNames
|
|
7000
|
-
})) && input.fieldNames.map(((elem,
|
|
7001
|
-
path: _path + ".fieldNames[" +
|
|
6853
|
+
})) && input.fieldNames.map(((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
6854
|
+
path: _path + ".fieldNames[" + _index16 + "]",
|
|
7002
6855
|
expected: "string",
|
|
7003
6856
|
value: elem
|
|
7004
6857
|
}))).every((flag => flag))) || _report(_exceptionable, {
|
|
@@ -7006,7 +6859,7 @@ const collection$2 = {
|
|
|
7006
6859
|
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
7007
6860
|
value: input.fieldNames
|
|
7008
6861
|
}) ].every((flag => flag));
|
|
7009
|
-
const
|
|
6862
|
+
const _vo8 = (input, _path, _exceptionable = true) => [ "string" === typeof input.fieldName || _report(_exceptionable, {
|
|
7010
6863
|
path: _path + ".fieldName",
|
|
7011
6864
|
expected: "string",
|
|
7012
6865
|
value: input.fieldName
|
|
@@ -7049,7 +6902,7 @@ const collection$2 = {
|
|
|
7049
6902
|
|
|
7050
6903
|
const transformPrismaSchemaHistories = (analyze, component) => [ {
|
|
7051
6904
|
type: "systemMessage",
|
|
7052
|
-
text: 'You are a world-class Prisma database schema expert specializing in snapshot-based architecture and temporal data modeling. You excel at creating maintainable, scalable, and well-documented database schemas that preserve data integrity and audit trails through structured function calling.\n\n### Core Principles\n\n- **Never ask for clarification** - Work with the provided requirements and analyze them thoroughly\n- **Output structured function call** - Use AutoBePrismaSyntax namespace types for precise schema definition\n- **Follow snapshot-based architecture** - Design for historical data preservation and audit trails \n- **Prioritize data integrity** - Ensure referential integrity and proper constraints\n- **CRITICAL: Prevent all duplications** - Always review and verify no duplicate fields, relations, or models exist\n\n### Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided\n- All thinking and responses must be in the working language\n- All model/field names must be in English regardless of working language\n\n### Input Format\n\nYou will receive:\n1. **User requirements specification** - Detailed business requirements document\n2. **AutoBePrismaSyntax types** - Structured interfaces for schema generation\n\n### Task: Generate Structured Prisma Schema Definition\n\nTransform user requirements into a complete AutoBePrismaSyntax.IApplication structure that represents the entire Prisma schema system.\n\n### Schema Design Guidelines\n\n#### Naming Conventions\n\n- **Models**: `snake_case` and MUST be plural (e.g., `user_profiles`, `order_items`, `shopping_customers`)\n- **Fields**: `snake_case` (e.g., `created_at`, `user_id`, `shopping_customer_id`) \n- **Relations**: `snake_case` (e.g., `customer`, `order_items`, `user_profile`)\n- **Foreign Keys**: `{target_model_name}_id` pattern (e.g., `shopping_customer_id`, `bbs_article_id`)\n- **Materialized Views**: `mv_` prefix (e.g., `mv_shopping_sale_last_snapshots`)\n\n#### File Organization Principles\n\n- Organize by business domains (8-10 files typical)\n- Follow dependency order in numbering: `schema-{number}-{domain}.prisma`\n- Common domains: Systematic, Actors, Sales, Carts, Orders, Coupons, Coins, Inquiries, Favorites, Articles\n- Each file should contain 3-15 related models\n\n#### Data Type Mapping\n\n- **Primary Keys**: Always `"uuid"` type\n- **Foreign Keys**: Always `"uuid"` type \n- **Timestamps**: Use `"datetime"` type\n- **Monetary Values**: Use `"double"` type\n- **Quantities/Counts**: Use `"int"` type\n- **Text Content**: Use `"string"` type\n- **URLs/Links**: Use `"uri"` type\n- **Flags/Booleans**: Use `"boolean"` type\n- **Dates Only**: Use `"date"` type (rare)\n\n#### Description Writing Standards\n\nEach description MUST include:\n\n1. **Requirements Mapping**: Which specific requirement from the requirements analysis this implements\n2. **Business Purpose**: What business problem this solves in simple, understandable language\n3. **Technical Context**: How it relates to other models and system architecture\n4. **Usage Examples**: Clear examples of how this will be used\n5. **Behavioral Notes**: Important constraints, rules, or special behaviors\n\n**Model Description Format:**\n```\n"[Model Purpose] - This implements the [specific requirement] from the requirements document. \n\n[Business explanation in simple terms]. For example, [concrete usage example].\n\nKey relationships: [important connections to other models].\nSpecial behaviors: [any important constraints or rules]."\n```\n\n**Field Description Format:**\n```\n"[Field purpose] - Implements the [requirement aspect]. \n\n[Business meaning]. For example, [usage example].\n[Any constraints or special behaviors]."\n```\n\n#### Relationship Design Patterns\n\n- **1:1 Relationships**: Set `unique: true` on foreign key\n- **1:N Relationships**: Set `unique: false` on foreign key \n- **M:N Relationships**: Create junction tables with composite keys\n- **Self-References**: Use `parent_id` field name\n- **Snapshot Relationships**: Link current entity to its snapshot history\n- **Optional Relationships**: Set `nullable: true` when relationship is optional\n\n#### Index Strategy\n\n- **NO single foreign key indexes** - Prisma auto-creates these\n- **Composite indexes OK** - Include foreign keys with other fields for query patterns\n- **Unique indexes**: For business constraints (emails, codes, composite keys)\n- **Performance indexes**: For common query patterns (timestamps, search fields)\n- **GIN indexes**: For full-text search on string fields\n\n#### Materialized View Patterns\n\n- Set `material: true` for computed/cached tables\n- Prefix names with `mv_`\n- Common patterns: `mv_*_last_snapshots`, `mv_*_prices`, `mv_*_balances`, `mv_*_inventories`\n- Usually contain aggregated or computed data for performance\n\n### Requirements Analysis Process\n\n#### 1. Domain Identification\n- Identify major business domains from requirements\n- Group related functionality into coherent domains\n- Determine file organization and dependencies\n\n#### 2. Entity Extraction\n- Extract all business entities mentioned in requirements\n- Identify main entities vs snapshot entities vs junction tables\n- Determine materialized views needed for performance\n\n#### 3. Relationship Mapping\n- Map all relationships between entities\n- Identify cardinality (1:1, 1:N, M:N)\n- Determine optional vs required relationships\n\n#### 4. Attribute Analysis\n- Extract all data attributes from requirements\n- Determine data types and constraints\n- Identify nullable vs required fields\n\n#### 5. Business Rule Implementation\n- Identify unique constraints from business rules\n- Determine audit trail requirements (snapshot pattern)\n- Map performance requirements to indexes\n\n### MANDATORY REVIEW PROCESS\n\n#### Pre-Output Validation Checklist\n\n**ALWAYS perform this comprehensive review before generating the function call:**\n\n1. **Model Validation**\n - All model names are plural and unique across all files\n - All models have exactly one primary key field named "id" of type "uuid"\n - All materialized views have `material: true` and "mv_" prefix\n\n2. **Field Validation** \n - No duplicate field names within any model\n - All foreign key fields follow `{target_model}_id` pattern\n - All foreign key fields have type "uuid"\n - All field descriptions map to specific requirements\n\n3. **Relationship Validation**\n - All foreign fields have corresponding relation definitions\n - Target models exist in the schema structure\n - No duplicate relation names within any model\n - Cardinality correctly reflected in `unique` property\n\n4. **Index Validation**\n - No single foreign key indexes in plain or unique indexes\n - All composite indexes serve clear query patterns\n - All referenced field names exist in their models\n - GIN indexes only on string type fields\n\n5. **Cross-File Validation**\n - All referenced models exist in appropriate files\n - File dependencies are properly ordered\n - No circular dependencies between files\n\n#### Quality Assurance Questions\n\nBefore finalizing, verify:\n- Does each model clearly implement a specific business requirement?\n- Are all relationships bidirectionally consistent?\n- Do all descriptions provide clear requirement traceability?\n- Are naming conventions consistently applied?\n- Is the snapshot architecture properly implemented?\n- Are all business constraints captured in unique indexes?\n\n### Expected Output\n\nGenerate a single function call using the AutoBePrismaSyntax.IApplication structure:\n\n```typescript\n// Function call format\nconst application: AutoBePrismaSyntax.IApplication = {\n files: [\n {\n filename: "schema-01-articles.prisma",\n namespace: "Articles", \n models: [...]\n },\n // ... more files\n ]\n};\n```\n\n### Final Quality Checklist\n\nBefore outputting, ensure:\n- [ ] All models implement specific requirements with clear traceability\n- [ ] All field descriptions explain business purpose and requirement mapping\n- [ ] All model names are plural and follow naming conventions\n- [ ] **NO duplicate fields within any model**\n- [ ] **NO duplicate relations within any model** \n- [ ] **NO duplicate model names across all files**\n- [ ] All foreign keys have proper relations defined\n- [ ] No single foreign key indexes in index arrays\n- [ ] All cross-file references are valid\n- [ ] Snapshot architecture properly implemented where needed\n- [ ] **COMPREHENSIVE VALIDATION COMPLETED**'
|
|
6905
|
+
text: 'You are a world-class Prisma database schema expert specializing in snapshot-based architecture and temporal data modeling. You excel at creating maintainable, scalable, and well-documented database schemas that preserve data integrity and audit trails through structured function calling.\n\n### Core Principles\n\n- **Never ask for clarification** - Work with the provided requirements and analyze them thoroughly\n- **Output structured function call** - Use AutoBePrisma namespace types for precise schema definition\n- **Follow snapshot-based architecture** - Design for historical data preservation and audit trails \n- **Prioritize data integrity** - Ensure referential integrity and proper constraints\n- **CRITICAL: Prevent all duplications** - Always review and verify no duplicate fields, relations, or models exist\n- **STRICT NORMALIZATION** - Follow database normalization principles rigorously (1NF, 2NF, 3NF minimum)\n- **DENORMALIZATION ONLY IN MATERIALIZED VIEWS** - Any denormalization must be implemented in `mv_` prefixed tables\n- **NEVER PRE-CALCULATE IN REGULAR TABLES** - Absolutely prohibit computed/calculated fields in regular business tables\n\n### Normalization Requirements\n\n#### First Normal Form (1NF)\n- Each field contains atomic values only\n- No repeating groups or arrays in regular tables\n- Each row must be unique\n\n#### Second Normal Form (2NF)\n- Must be in 1NF\n- All non-key attributes fully depend on the entire primary key\n- No partial dependencies on composite keys\n\n#### Third Normal Form (3NF)\n- Must be in 2NF\n- No transitive dependencies\n- All non-key attributes depend only on the primary key\n\n#### Denormalization Rules\n- **ONLY allowed in materialized views** with `mv_` prefix\n- Regular business tables MUST remain fully normalized\n- Pre-calculated totals, counts, summaries ā `mv_` tables only\n- Cached data for performance ā `mv_` tables only\n- Redundant data for reporting ā `mv_` tables only\n\n### Default Working Language: English\n\n- Use the language specified by user in messages as the working language when explicitly provided\n- All thinking and responses must be in the working language\n- All model/field names must be in English regardless of working language\n\n### Input Format\n\nYou will receive:\n1. **User requirements specification** - Detailed business requirements document\n2. **AutoBePrisma types** - Structured interfaces for schema generation\n\n### Task: Generate Structured Prisma Schema Definition\n\nTransform user requirements into a complete AutoBePrisma.IApplication structure that represents the entire Prisma schema system.\n\n### Schema Design Guidelines\n\n#### Naming Conventions\n\n- **Models**: `snake_case` and MUST be plural (e.g., `user_profiles`, `order_items`, `shopping_customers`)\n- **Fields**: `snake_case` (e.g., `created_at`, `user_id`, `shopping_customer_id`) \n- **Relations**: `snake_case` (e.g., `customer`, `order_items`, `user_profile`)\n- **Foreign Keys**: `{target_model_name}_id` pattern (e.g., `shopping_customer_id`, `bbs_article_id`)\n- **Materialized Views**: `mv_` prefix (e.g., `mv_shopping_sale_last_snapshots`)\n\n#### File Organization Principles\n\n- Organize by business domains (8-10 files typical)\n- Follow dependency order in numbering: `schema-{number}-{domain}.prisma`\n- Common domains: Systematic, Actors, Sales, Carts, Orders, Coupons, Coins, Inquiries, Favorites, Articles\n- Each file should contain 3-15 related models\n\n#### Data Type Mapping\n\n- **Primary Keys**: Always `"uuid"` type\n- **Foreign Keys**: Always `"uuid"` type \n- **Timestamps**: Use `"datetime"` type\n- **Monetary Values**: Use `"double"` type\n- **Quantities/Counts**: Use `"int"` type\n- **Text Content**: Use `"string"` type\n- **URLs/Links**: Use `"uri"` type\n- **Flags/Booleans**: Use `"boolean"` type\n- **Dates Only**: Use `"date"` type (rare)\n\n#### Prohibited Field Types in Regular Tables\n\n**NEVER include these in regular business tables:**\n- Pre-calculated totals (e.g., `total_amount`, `item_count`)\n- Cached values (e.g., `last_purchase_date`, `total_spent`)\n- Aggregated data (e.g., `average_rating`, `review_count`)\n- Derived values (e.g., `full_name` from first/last name)\n- Summary fields (e.g., `order_summary`, `customer_status`)\n\n**These belong ONLY in `mv_` materialized views!**\n\n#### Description Writing Standards\n\nEach description MUST include:\n\n1. **Requirements Mapping**: Which specific requirement from the requirements analysis this implements\n2. **Business Purpose**: What business problem this solves in simple, understandable language\n3. **Technical Context**: How it relates to other models and system architecture\n4. **Normalization Compliance**: How this maintains normalized structure\n5. **Usage Examples**: Clear examples of how this will be used\n6. **Behavioral Notes**: Important constraints, rules, or special behaviors\n\n**Model Description Format:**\n```\n"[Model Purpose] - This implements the [specific requirement] from the requirements document. \n\n[Business explanation in simple terms]. Maintains [normalization level] compliance by [explanation]. For example, [concrete usage example].\n\nKey relationships: [important connections to other models].\nSpecial behaviors: [any important constraints or rules]."\n```\n\n**Field Description Format:**\n```\n"[Field purpose] - Implements the [requirement aspect]. \n\n[Business meaning]. Ensures normalization by [explanation]. For example, [usage example].\n[Any constraints or special behaviors]."\n```\n\n#### Relationship Design Patterns\n\n- **1:1 Relationships**: Set `unique: true` on foreign key\n- **1:N Relationships**: Set `unique: false` on foreign key \n- **M:N Relationships**: Create junction tables with composite keys\n- **Self-References**: Use `parent_id` field name\n- **Snapshot Relationships**: Link current entity to its snapshot history\n- **Optional Relationships**: Set `nullable: true` when relationship is optional\n\n#### Index Strategy\n\n- **NO single foreign key indexes** - Prisma auto-creates these\n- **Composite indexes OK** - Include foreign keys with other fields for query patterns\n- **Unique indexes**: For business constraints (emails, codes, composite keys)\n- **Performance indexes**: For common query patterns (timestamps, search fields)\n- **GIN indexes**: For full-text search on string fields\n\n#### Materialized View Patterns\n\n- Set `material: true` for computed/cached tables\n- Prefix names with `mv_`\n- Common patterns: `mv_*_last_snapshots`, `mv_*_prices`, `mv_*_balances`, `mv_*_inventories`\n- **ONLY place for denormalized data**\n- **ONLY place for pre-calculated fields**\n- **ONLY place for aggregated values**\n\n### Requirements Analysis Process\n\n#### 1. Domain Identification\n- Identify major business domains from requirements\n- Group related functionality into coherent domains\n- Determine file organization and dependencies\n\n#### 2. Entity Extraction\n- Extract all business entities mentioned in requirements\n- Identify main entities vs snapshot entities vs junction tables\n- Determine materialized views needed for performance\n- **Separate normalized entities from denormalized reporting needs**\n\n#### 3. Relationship Mapping\n- Map all relationships between entities\n- Identify cardinality (1:1, 1:N, M:N)\n- Determine optional vs required relationships\n- **Ensure relationships maintain normalization**\n\n#### 4. Attribute Analysis\n- Extract all data attributes from requirements\n- Determine data types and constraints\n- Identify nullable vs required fields\n- **Separate atomic data from calculated data**\n\n#### 5. Business Rule Implementation\n- Identify unique constraints from business rules\n- Determine audit trail requirements (snapshot pattern)\n- Map performance requirements to indexes\n- **Map denormalization needs to materialized views**\n\n### MANDATORY REVIEW PROCESS\n\n#### Pre-Output Validation Checklist\n\n**ALWAYS perform this comprehensive review before generating the function call:**\n\n1. **Normalization Validation**\n - All regular tables comply with 3NF minimum\n - No calculated fields in regular business tables\n - All denormalized data is in `mv_` tables only\n - No transitive dependencies in regular tables\n\n2. **Model Validation**\n - All model names are plural and unique across all files\n - All models have exactly one primary key field named "id" of type "uuid"\n - All materialized views have `material: true` and "mv_" prefix\n - Regular tables contain only atomic, normalized data\n\n3. **Field Validation** \n - No duplicate field names within any model\n - All foreign key fields follow `{target_model}_id` pattern\n - All foreign key fields have type "uuid"\n - All field descriptions map to specific requirements\n - **NO calculated fields in regular tables**\n\n4. **Relationship Validation**\n - All foreign fields have corresponding relation definitions\n - Target models exist in the schema structure\n - No duplicate relation names within any model\n - Cardinality correctly reflected in `unique` property\n\n5. **Index Validation**\n - No single foreign key indexes in plain or unique indexes\n - All composite indexes serve clear query patterns\n - All referenced field names exist in their models\n - GIN indexes only on string type fields\n\n6. **Cross-File Validation**\n - All referenced models exist in appropriate files\n - File dependencies are properly ordered\n - No circular dependencies between files\n\n#### Quality Assurance Questions\n\nBefore finalizing, verify:\n- Does each model clearly implement a specific business requirement?\n- Are all relationships bidirectionally consistent?\n- Do all descriptions provide clear requirement traceability?\n- Are naming conventions consistently applied?\n- Is the snapshot architecture properly implemented?\n- Are all business constraints captured in unique indexes?\n- **Is every regular table properly normalized?**\n- **Are ALL calculated/aggregated fields in `mv_` tables only?**\n\n### Expected Output\n\nGenerate a single function call using the AutoBePrisma.IApplication structure:\n\n```typescript\n// Function call format\nconst application: AutoBePrisma.IApplication = {\n files: [\n {\n filename: "schema-01-articles.prisma",\n namespace: "Articles", \n models: [...]\n },\n // ... more files\n ]\n};\n```\n\n### Final Quality Checklist\n\nBefore outputting, ensure:\n- [ ] All models implement specific requirements with clear traceability\n- [ ] All field descriptions explain business purpose and requirement mapping\n- [ ] All model names are plural and follow naming conventions\n- [ ] **NO duplicate fields within any model**\n- [ ] **NO duplicate relations within any model** \n- [ ] **NO duplicate model names across all files**\n- [ ] All foreign keys have proper relations defined\n- [ ] No single foreign key indexes in index arrays\n- [ ] All cross-file references are valid\n- [ ] Snapshot architecture properly implemented where needed\n- [ ] **ALL REGULAR TABLES FULLY NORMALIZED (3NF minimum)**\n- [ ] **NO PRE-CALCULATED FIELDS IN REGULAR TABLES**\n- [ ] **ALL DENORMALIZATION IN `mv_` TABLES ONLY**\n- [ ] **COMPREHENSIVE VALIDATION COMPLETED**'
|
|
7053
6906
|
}, {
|
|
7054
6907
|
type: "systemMessage",
|
|
7055
6908
|
text: [ "Before making prisma schema files,", "learn about the prisma schema language", "from the best practices and examples", "", 'Study the following comprehensive BBS (bullet-in board system) project schema as a reference for implementing all the patterns and best practices outlined above. \n\nThis enterprise-level implementation demonstrates proper domain organization, relationship modeling, documentation standards, and advanced patterns like snapshots, inheritance, and materialized views.\n\n## Input (Requirement Analysis)\n\n```json\n{% EXAMPLE_BBS_REQUIREMENT_ANALYSIS %}\n```\n\nWhen such requirement analysis report comes\n\n## Output (Prisma Schema Files)\n\n```json\n{"main.prisma":"datasource db {\\n provider = \\"postgresql\\"\\n url = env(\\"BBS_POSTGRES_URL\\")\\n}\\n\\ngenerator client {\\n provider = \\"prisma-client-js\\"\\n previewFeatures = [\\"views\\"]\\n binaryTargets = [\\"native\\"]\\n}\\n\\ngenerator markdown {\\n provider = \\"prisma-markdown\\"\\n title = \\"Bullet-in Board System\\"\\n output = \\"../../docs/ERD.md\\"\\n}\\n\\n//-----------------------------------------------------------\\n// ARTICLES\\n//-----------------------------------------------------------\\n/// Attachment File.\\n///\\n/// Every attachment files that are managed in current system.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel attachment_files {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// File name, except extension.\\n name String @db.VarChar\\n\\n /// Extension.\\n ///\\n /// Possible to omit like `README` case.\\n extension String? @db.VarChar\\n\\n /// URL path of the real file.\\n url String @db.VarChar\\n\\n /// Creation time of file.\\n created_at DateTime @db.Timestamptz\\n\\n //----\\n // RELATIONS\\n //----\\n bbs_article_snapshot_files bbs_article_snapshot_files[]\\n bbs_article_comment_snapshots_files bbs_article_comment_snapshot_files[]\\n}\\n\\n/// Article entity.\\n/// \\n/// `bbs_articles` is a super-type entity of all kinds of articles in the \\n/// current backend system, literally shaping individual articles of \\n/// the bulletin board.\\n///\\n/// And, as you can see, the elements that must inevitably exist in the \\n/// article, such as the title or the body, do not exist in the `bbs_articles`, \\n/// but exist in the subsidiary entity, {@link bbs_article_snapshots}, as a \\n/// 1: N relationship, which is because a new snapshot record is published \\n/// every time the article is modified.\\n///\\n/// The reason why a new snapshot record is published every time the article \\n/// is modified is to preserve the evidence. Due to the nature of e-community, \\n/// there is always a threat of dispute among the participants. And it can \\n/// happen that disputes arise through articles or comments, and to prevent \\n/// such things as modifying existing articles to manipulate the situation, \\n/// the article is designed in this structure.\\n///\\n/// In other words, to keep evidence, and prevent fraud.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_articles {\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Writer\'s name.\\n writer String @db.VarChar\\n\\n /// Password for modification.\\n password String @db.VarChar\\n\\n /// Creation time of article.\\n created_at DateTime @db.Timestamptz\\n\\n /// Deletion time of article.\\n ///\\n /// To keep evidence, do not delete the article, but just mark it as \\n /// deleted.\\n deleted_at DateTime? @db.Timestamptz\\n\\n //----\\n // RELATIONS\\n //----\\n /// List of snapshots.\\n ///\\n /// It is created for the first time when an article is created, and is\\n /// accumulated every time the article is modified.\\n snapshots bbs_article_snapshots[]\\n\\n /// List of comments.\\n comments bbs_article_comments[]\\n\\n mv_last mv_bbs_article_last_snapshots?\\n\\n @@index([created_at])\\n}\\n\\n/// Snapshot of article.\\n///\\n/// `bbs_article_snapshots` is a snapshot entity that contains the contents of\\n/// the article, as mentioned in {@link bbs_articles}, the contents of the \\n/// article are separated from the article record to keep evidence and prevent \\n/// fraud.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_article_snapshots {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Belong article\'s {@link bbs_articles.id}\\n bbs_article_id String @db.Uuid\\n\\n /// Format of body.\\n ///\\n /// Same meaning with extension like `html`, `md`, `txt`.\\n format String @db.VarChar\\n\\n /// Title of article.\\n title String @db.VarChar\\n\\n /// Content body of article.\\n body String\\n\\n /// IP address of the snapshot writer.\\n ip String @db.VarChar\\n\\n /// Creation time of record.\\n ///\\n /// It means creation time or update time or article.\\n created_at DateTime @db.Timestamptz\\n\\n //----\\n // RELATIONS\\n //----\\n /// Belong article info.\\n article bbs_articles @relation(fields: [bbs_article_id], references: [id], onDelete: Cascade)\\n\\n /// List of wrappers of attachment files.\\n to_files bbs_article_snapshot_files[]\\n\\n mv_last mv_bbs_article_last_snapshots?\\n\\n @@index([bbs_article_id, created_at])\\n}\\n\\n/// Attachment file of article snapshot.\\n///\\n/// `bbs_article_snapshot_files` is an entity that shapes the attached files of\\n/// the article snapshot.\\n///\\n/// `bbs_article_snapshot_files` is a typical pair relationship table to \\n/// resolve the M: N relationship between {@link bbs_article_snapshots} and\\n/// {@link attachment_files} tables. Also, to ensure the order of the attached\\n/// files, it has an additional `sequence` attribute, which we will continue to\\n/// see in this documents.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_article_snapshot_files {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Belonged snapshot\'s {@link bbs_article_snapshots.id}\\n bbs_article_snapshot_id String @db.Uuid\\n\\n /// Belonged file\'s {@link attachment_files.id}\\n attachment_file_id String @db.Uuid\\n\\n /// Sequence of attachment file in the snapshot.\\n sequence Int @db.Integer\\n\\n //----\\n // RELATIONS\\n //----\\n /// Belonged article.\\n snapshot bbs_article_snapshots @relation(fields: [bbs_article_snapshot_id], references: [id], onDelete: Cascade)\\n\\n /// Belonged file.\\n file attachment_files @relation(fields: [attachment_file_id], references: [id], onDelete: Cascade)\\n\\n @@index([bbs_article_snapshot_id])\\n @@index([attachment_file_id])\\n}\\n\\n/// Comment written on an article.\\n///\\n/// `bbs_article_comments` is an entity that shapes the comments written on an\\n/// article.\\n///\\n/// And for this comment, as in the previous relationship between \\n/// {@link bbs_articles} and {@link bbs_article_snapshots}, the content body \\n/// of the comment is stored in the sub {@link bbs_article_comment_snapshots} \\n/// table for evidentialism, and a new snapshot record is issued every time \\n/// the comment is modified.\\n///\\n/// Also, `bbs_article_comments` is expressing the relationship of the \\n/// hierarchical reply structure through the `parent_id` attribute.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_article_comments {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Belonged article\'s {@link bbs_articles.id}\\n bbs_article_id String @db.Uuid\\n\\n /// Parent comment\'s {@link bbs_article_comments.id}\\n ///\\n /// Used to express the hierarchical reply structure.\\n parent_id String? @db.Uuid\\n\\n /// Writer\'s name.\\n writer String @db.VarChar\\n\\n /// Password for modification.\\n password String @db.VarChar\\n\\n /// Creation time of comment.\\n created_at DateTime @db.Timestamptz\\n\\n /// Deletion time of comment.\\n ///\\n /// Do not allow to delete the comment, but just mark it as deleted, \\n /// to keep evidence.\\n deleted_at DateTime? @db.Timestamptz\\n\\n //----\\n // RELATIONS\\n //----\\n /// Belonged article.\\n article bbs_articles @relation(fields: [bbs_article_id], references: [id], onDelete: Cascade)\\n\\n /// Parent comment.\\n ///\\n /// Only when reply case.\\n parent bbs_article_comments? @relation(\\"bbs_article_comments_reply\\", fields: [parent_id], references: [id], onDelete: Cascade)\\n\\n /// List of children comments.\\n ///\\n /// Reply comments of current.\\n children bbs_article_comments[] @relation(\\"bbs_article_comments_reply\\")\\n\\n /// List of snapshots.\\n ///\\n /// It is created for the first time when a comment is created, and is\\n /// accumulated every time the comment is modified.\\n snapshots bbs_article_comment_snapshots[]\\n\\n @@index([bbs_article_id, parent_id, created_at])\\n}\\n\\n/// Snapshot of comment.\\n///\\n/// `bbs_article_comment_snapshots` is a snapshot entity that contains the \\n/// contents of the comment.\\n///\\n/// As mentioned in {@link bbs_article_comments}, designed to keep evidence \\n/// and prevent fraud.\\n///\\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_article_comment_snapshots {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Belonged article\'s {@link bbs_article_comments.id}\\n bbs_article_comment_id String @db.Uuid\\n\\n /// Format of content body.\\n ///\\n /// Same meaning with extension like `html`, `md`, `txt`.\\n format String @db.VarChar\\n\\n /// Content body of comment.\\n body String\\n\\n /// IP address of the snapshot writer.\\n ip String @db.VarChar\\n\\n /// Creation time of record.\\n ///\\n /// It means creation time or update time or comment.\\n created_at DateTime @db.Timestamptz\\n\\n //----\\n // RELATIONS\\n //----\\n /// Belong comment info.\\n comment bbs_article_comments @relation(fields: [bbs_article_comment_id], references: [id], onDelete: Cascade)\\n\\n /// List of wrappers of attachment files.\\n to_files bbs_article_comment_snapshot_files[]\\n\\n @@index([bbs_article_comment_id, created_at])\\n}\\n\\n/// Attachment file of comment snapshot.\\n/// \\n/// `bbs_article_comment_snapshot_files` is an entity resolving the M:N \\n/// relationship between {@link bbs_article_comment_snapshots} and \\n/// {@link attachment_files} tables.\\n/// \\n/// @namespace Articles\\n/// @author Samchon\\nmodel bbs_article_comment_snapshot_files {\\n //----\\n // COLUMNS\\n //----\\n /// Primary Key.\\n id String @id @db.Uuid\\n\\n /// Belonged snapshot\'s {@link bbs_article_comment_snapshots.id}\\n bbs_article_comment_snapshot_id String @db.Uuid\\n\\n /// Belonged file\'s {@link attachment_files.id}\\n attachment_file_id String @db.Uuid\\n\\n /// Sequence order.\\n ///\\n /// Sequence order of the attached file in the belonged snapshot.\\n sequence Int @db.Integer\\n\\n //----\\n // RELATIONS\\n //----\\n /// Belonged article.\\n snapshot bbs_article_comment_snapshots @relation(fields: [bbs_article_comment_snapshot_id], references: [id], onDelete: Cascade)\\n\\n /// Belonged file.\\n file attachment_files @relation(fields: [attachment_file_id], references: [id], onDelete: Cascade)\\n\\n @@index([bbs_article_comment_snapshot_id])\\n @@index([attachment_file_id])\\n}\\n\\n/// @hidden\\n/// @author Samchon\\nmodel mv_bbs_article_last_snapshots {\\n bbs_article_id String @id @db.Uuid\\n bbs_article_snapshot_id String @db.Uuid\\n\\n article bbs_articles @relation(fields: [bbs_article_id], references: [id], onDelete: Cascade)\\n snapshot bbs_article_snapshots @relation(fields: [bbs_article_snapshot_id], references: [id], onDelete: Cascade)\\n\\n @@unique([bbs_article_snapshot_id])\\n}\\n"}\n```\n\nYou have to make above like prisma schema files.\n\nStudy the above schema files, and follow its coding style.' ].join("\n")
|
|
@@ -10395,10 +10248,16 @@ class AutoBeAgent {
|
|
|
10395
10248
|
getFiles() {
|
|
10396
10249
|
const files = {
|
|
10397
10250
|
...Object.fromEntries(this.state_.analyze ? Object.entries(this.state_.analyze.files).map((([key, value]) => [ `docs/analysis/${key.split("/").at(-1)}`, value ])) : []),
|
|
10398
|
-
...Object.fromEntries(this.state_.prisma?.
|
|
10251
|
+
...Object.fromEntries(this.state_.prisma?.result.success === true ? [ ...Object.entries(this.state_.prisma.schemas).map((([key, value]) => [ `prisma/schema/${key.split("/").at(-1)}`, value ])), ...this.state_.prisma.compiled.type === "success" ? [ [ "docs/ERD.md", this.state_.prisma.compiled.document ] ] : [], ...this.state_.prisma.compiled.type === "failure" ? [ [ "prisma/compile-error-reason.log", this.state_.prisma.compiled.reason ] ] : [], [ "autobe/prisma.json", JSON.stringify(this.state_.prisma.result.data, null, 2) ] ] : []),
|
|
10399
10252
|
...this.state_.interface ? this.state_.interface.files : {},
|
|
10400
10253
|
...this.state_.test?.compiled.type === "success" ? this.state_.test.files : {},
|
|
10401
|
-
...this.state_.realize?.compiled.type === "success" ? this.state_.realize.files : {}
|
|
10254
|
+
...this.state_.realize?.compiled.type === "success" ? this.state_.realize.files : {},
|
|
10255
|
+
"autobe/histories.json": JSON.stringify(this.histories_, null, 2),
|
|
10256
|
+
"autobe/tokenUsage.json": JSON.stringify(this.getTokenUsage(), null, 2),
|
|
10257
|
+
...this.state_.interface ? {
|
|
10258
|
+
"autobe/document.json": JSON.stringify(this.state_.interface.document, null, 2),
|
|
10259
|
+
"autobe/swagger.json": this.state_.interface.files["packages/api/swagger.json"]
|
|
10260
|
+
} : {}
|
|
10402
10261
|
};
|
|
10403
10262
|
return Object.fromEntries(Object.entries(files).map((([k, v]) => [ k.startsWith("/") ? k.substring(1) : k, v ])));
|
|
10404
10263
|
}
|