@autobe/agent 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AutoBeAgent.js +16 -5
- package/lib/AutoBeAgent.js.map +1 -1
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -4
- package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
- package/lib/context/AutoBeTokenUsage.d.ts +15 -1
- package/lib/context/AutoBeTokenUsage.js +56 -1
- package/lib/context/AutoBeTokenUsage.js.map +1 -1
- package/lib/context/IAutoBeApplicationProps.d.ts +0 -61
- package/lib/factory/createAutoBeApplication.js +298 -773
- package/lib/factory/createAutoBeApplication.js.map +1 -1
- package/lib/index.mjs +5116 -7271
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js +82 -319
- package/lib/orchestrate/analyze/AutoBeAnalyzeAgent.js.map +1 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js +0 -1
- package/lib/orchestrate/analyze/AutoBeAnalyzeReviewer.js.map +1 -1
- package/lib/orchestrate/analyze/orchestrateAnalyze.js +97 -294
- package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/orchestrate/facade/transformFacadeStateMessage.js +2 -2
- package/lib/orchestrate/facade/transformFacadeStateMessage.js.map +1 -1
- package/lib/orchestrate/index.d.ts +2 -2
- package/lib/orchestrate/index.js +4 -4
- package/lib/orchestrate/index.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterface.js +9 -3
- package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +56 -142
- package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js +195 -199
- package/lib/orchestrate/interface/orchestrateInterfaceComponents.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +75 -172
- package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js +772 -1097
- package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/orchestrate/interface/transformInterfaceHistories.js +2 -0
- package/lib/orchestrate/interface/transformInterfaceHistories.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js +64 -175
- package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +552 -1073
- package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js +571 -1119
- package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js +9 -0
- package/lib/orchestrate/prisma/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js +8 -0
- package/lib/orchestrate/prisma/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/orchestrate/realize/orchestrateRealize.d.ts +11 -0
- package/lib/orchestrate/realize/orchestrateRealize.js +109 -0
- package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.d.ts +25 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js +337 -0
- package/lib/orchestrate/realize/orchestrateRealizeCoder.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.d.ts +52 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js +57 -0
- package/lib/orchestrate/realize/orchestrateRealizeIntegrator.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.d.ts +80 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js +53 -0
- package/lib/orchestrate/realize/orchestrateRealizePlanner.js.map +1 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.d.ts +46 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js +37 -0
- package/lib/orchestrate/realize/orchestrateRealizeValidator.js.map +1 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.d.ts +33 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js +3 -0
- package/lib/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.js.map +1 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.d.ts +5 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js +127 -0
- package/lib/orchestrate/realize/transformRealizeCoderHistories.js.map +1 -0
- package/lib/orchestrate/test/compile/completeTestCode.d.ts +2 -0
- package/lib/orchestrate/test/compile/completeTestCode.js +21 -0
- package/lib/orchestrate/test/compile/completeTestCode.js.map +1 -0
- package/lib/orchestrate/test/{filterTestFileName.js → compile/filterTestFileName.js} +1 -1
- package/lib/orchestrate/test/compile/filterTestFileName.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.d.ts +3 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js +27 -0
- package/lib/orchestrate/test/compile/getTestExternalDeclarations.js.map +1 -0
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.d.ts +5 -0
- package/lib/orchestrate/test/{compileTestScenario.js → compile/getTestScenarioArtifacts.js} +11 -5
- package/lib/orchestrate/test/compile/getTestScenarioArtifacts.js.map +1 -0
- package/lib/orchestrate/test/orchestrateTest.js +14 -9
- package/lib/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestCorrect.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestCorrect.js +150 -349
- package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestScenario.js +323 -566
- package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/orchestrate/test/orchestrateTestWrite.d.ts +3 -2
- package/lib/orchestrate/test/orchestrateTestWrite.js +139 -76
- package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +121 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.d.ts +8 -0
- package/lib/{utils/types/BackoffOptions.js → orchestrate/test/structures/IAutoBeTestFunction.js} +1 -1
- package/lib/orchestrate/test/structures/IAutoBeTestFunction.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +32 -22
- package/lib/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.d.ts +2 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +112 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.js.map +1 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.d.ts +7 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js +3 -0
- package/lib/orchestrate/test/structures/IAutoBeTestWriteResult.js.map +1 -0
- package/lib/orchestrate/test/transformTestCorrectHistories.d.ts +3 -2
- package/lib/orchestrate/test/transformTestCorrectHistories.js +28 -41
- package/lib/orchestrate/test/transformTestCorrectHistories.js.map +1 -1
- package/lib/orchestrate/test/transformTestWriteHistories.d.ts +5 -4
- package/lib/orchestrate/test/transformTestWriteHistories.js +169 -32
- package/lib/orchestrate/test/transformTestWriteHistories.js.map +1 -1
- package/lib/structures/IAutoBeConfig.d.ts +11 -0
- package/lib/structures/IAutoBeProps.d.ts +12 -1
- package/lib/utils/backoffRetry.d.ts +4 -7
- package/lib/utils/backoffRetry.js +19 -37
- package/lib/utils/backoffRetry.js.map +1 -1
- package/lib/utils/forceRetry.d.ts +1 -0
- package/lib/{orchestrate/orchestrateRealize.js → utils/forceRetry.js} +15 -8
- package/lib/utils/forceRetry.js.map +1 -0
- package/package.json +8 -8
- package/src/AutoBeAgent.ts +26 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -4
- package/src/context/AutoBeTokenUsage.ts +85 -1
- package/src/context/IAutoBeApplicationProps.ts +0 -62
- package/src/factory/createAutoBeApplication.ts +2 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeAgent.ts +8 -3
- package/src/orchestrate/analyze/AutoBeAnalyzeReviewer.ts +0 -1
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +8 -37
- package/src/orchestrate/facade/transformFacadeStateMessage.ts +2 -1
- package/src/orchestrate/index.ts +2 -2
- package/src/orchestrate/interface/orchestrateInterface.ts +7 -0
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +4 -3
- package/src/orchestrate/interface/orchestrateInterfaceComponents.ts +26 -23
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +6 -4
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +14 -11
- package/src/orchestrate/interface/transformInterfaceHistories.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +10 -5
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +11 -5
- package/src/orchestrate/prisma/orchestratePrismaSchema.ts +16 -8
- package/src/orchestrate/prisma/transformPrismaComponentsHistories.ts +9 -0
- package/src/orchestrate/prisma/transformPrismaSchemaHistories.ts +8 -0
- package/src/orchestrate/realize/orchestrateRealize.ts +169 -0
- package/src/orchestrate/realize/orchestrateRealizeCoder.ts +156 -0
- package/src/orchestrate/realize/orchestrateRealizeIntegrator.ts +75 -0
- package/src/orchestrate/realize/orchestrateRealizePlanner.ts +115 -0
- package/src/orchestrate/realize/orchestrateRealizeValidator.ts +64 -0
- package/src/orchestrate/realize/structures/IAutoBeRealizeCoderApplication.ts +36 -0
- package/src/orchestrate/realize/transformRealizeCoderHistories.ts +136 -0
- package/src/orchestrate/test/compile/completeTestCode.ts +35 -0
- package/src/orchestrate/test/{filterTestFileName.ts → compile/filterTestFileName.ts} +1 -1
- package/src/orchestrate/test/compile/getTestExternalDeclarations.ts +24 -0
- package/src/orchestrate/test/{compileTestScenario.ts → compile/getTestScenarioArtifacts.ts} +17 -8
- package/src/orchestrate/test/experimental/orchestrateTestCorrect.ast +240 -0
- package/src/orchestrate/test/experimental/orchestrateTestWrite.ast +316 -0
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +52 -0
- package/src/orchestrate/test/orchestrateTest.ts +38 -16
- package/src/orchestrate/test/orchestrateTestCorrect.ts +111 -338
- package/src/orchestrate/test/orchestrateTestScenario.ts +114 -69
- package/src/orchestrate/test/orchestrateTestWrite.ts +55 -153
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +126 -0
- package/src/orchestrate/test/structures/IAutoBeTestFunction.ts +10 -0
- package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +32 -22
- package/src/orchestrate/test/structures/IAutoBeTestScenarioArtifacts.ts +3 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +117 -0
- package/src/orchestrate/test/structures/IAutoBeTestWriteResult.ts +9 -0
- package/src/orchestrate/test/transformTestCorrectHistories.ts +38 -43
- package/src/orchestrate/test/transformTestWriteHistories.ts +89 -35
- package/src/structures/IAutoBeConfig.ts +9 -0
- package/src/structures/IAutoBeProps.ts +17 -1
- package/src/utils/backoffRetry.ts +25 -36
- package/src/utils/forceRetry.ts +13 -0
- package/lib/factory/invertOpenApiDocument.d.ts +0 -3
- package/lib/factory/invertOpenApiDocument.js +0 -51
- package/lib/factory/invertOpenApiDocument.js.map +0 -1
- package/lib/orchestrate/orchestrateRealize.d.ts +0 -5
- package/lib/orchestrate/orchestrateRealize.js.map +0 -1
- package/lib/orchestrate/test/compileTestScenario.d.ts +0 -5
- package/lib/orchestrate/test/compileTestScenario.js.map +0 -1
- package/lib/orchestrate/test/filterTestFileName.js.map +0 -1
- package/lib/utils/StringUtil.d.ts +0 -4
- package/lib/utils/StringUtil.js +0 -43
- package/lib/utils/StringUtil.js.map +0 -1
- package/lib/utils/types/BackoffOptions.d.ts +0 -12
- package/lib/utils/types/BackoffOptions.js.map +0 -1
- package/src/factory/invertOpenApiDocument.ts +0 -63
- package/src/orchestrate/orchestrateRealize.ts +0 -18
- package/src/utils/StringUtil.ts +0 -45
- package/src/utils/types/BackoffOptions.ts +0 -15
- /package/lib/orchestrate/test/{filterTestFileName.d.ts → compile/filterTestFileName.d.ts} +0 -0
|
@@ -91,9 +91,10 @@ function step(ctx, application, life) {
|
|
|
91
91
|
const agentica = new core_1.MicroAgentica({
|
|
92
92
|
model: ctx.model,
|
|
93
93
|
vendor: ctx.vendor,
|
|
94
|
-
config: Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})),
|
|
94
|
+
config: Object.assign(Object.assign({}, ((_c = ctx.config) !== null && _c !== void 0 ? _c : {})), { executor: {
|
|
95
|
+
describe: null,
|
|
96
|
+
} }),
|
|
95
97
|
histories: (0, transformPrismaCorrectHistories_1.transformPrismaCorrectHistories)(result),
|
|
96
|
-
tokenUsage: ctx.usage(),
|
|
97
98
|
controllers: [
|
|
98
99
|
createApplication({
|
|
99
100
|
model: ctx.model,
|
|
@@ -105,7 +106,12 @@ function step(ctx, application, life) {
|
|
|
105
106
|
});
|
|
106
107
|
(0, enforceToolCall_1.enforceToolCall)(agentica);
|
|
107
108
|
// REQUEST CORRECTION
|
|
108
|
-
yield agentica
|
|
109
|
+
yield agentica
|
|
110
|
+
.conversate("Resolve the compilation errors in the provided Prisma schema files.")
|
|
111
|
+
.finally(() => {
|
|
112
|
+
const tokenUsage = agentica.getTokenUsage();
|
|
113
|
+
ctx.usage().record(tokenUsage, ["prisma"]);
|
|
114
|
+
});
|
|
109
115
|
if (pointer.value === null) {
|
|
110
116
|
console.error("Unreachable error: PrismaCompilerAgent.pointer.value is null");
|
|
111
117
|
return result; // unreachable
|
|
@@ -168,261 +174,7 @@ const claude = {
|
|
|
168
174
|
description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\n\uD83D\uDCE5 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\uD83D\uDD0D 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\uD83D\uDCDD 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\u26A0\uFE0F 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\uD83C\uDFAF 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",
|
|
169
175
|
type: "array",
|
|
170
176
|
items: {
|
|
171
|
-
|
|
172
|
-
type: "object",
|
|
173
|
-
properties: {
|
|
174
|
-
name: {
|
|
175
|
-
title: "Name of the Prisma model (database table name)",
|
|
176
|
-
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\"",
|
|
177
|
-
type: "string",
|
|
178
|
-
pattern: "^[a-z][a-z0-9_]*$"
|
|
179
|
-
},
|
|
180
|
-
description: {
|
|
181
|
-
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...\"",
|
|
182
|
-
type: "string"
|
|
183
|
-
},
|
|
184
|
-
material: {
|
|
185
|
-
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",
|
|
186
|
-
type: "boolean"
|
|
187
|
-
},
|
|
188
|
-
primaryField: {
|
|
189
|
-
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).",
|
|
190
|
-
type: "object",
|
|
191
|
-
properties: {
|
|
192
|
-
name: {
|
|
193
|
-
title: "Name of the primary key field",
|
|
194
|
-
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.",
|
|
195
|
-
type: "string",
|
|
196
|
-
pattern: "^[a-z][a-z0-9_]*$"
|
|
197
|
-
},
|
|
198
|
-
type: {
|
|
199
|
-
title: "Data type of the primary key field",
|
|
200
|
-
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.",
|
|
201
|
-
"const": "uuid"
|
|
202
|
-
},
|
|
203
|
-
description: {
|
|
204
|
-
title: "Description of the primary key field's purpose",
|
|
205
|
-
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.",
|
|
206
|
-
type: "string"
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
required: [
|
|
210
|
-
"name",
|
|
211
|
-
"type",
|
|
212
|
-
"description"
|
|
213
|
-
]
|
|
214
|
-
},
|
|
215
|
-
foreignFields: {
|
|
216
|
-
title: "Array of foreign key fields that reference other models",
|
|
217
|
-
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.",
|
|
218
|
-
type: "array",
|
|
219
|
-
items: {
|
|
220
|
-
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.",
|
|
221
|
-
type: "object",
|
|
222
|
-
properties: {
|
|
223
|
-
name: {
|
|
224
|
-
title: "Name of the foreign key field",
|
|
225
|
-
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)",
|
|
226
|
-
type: "string",
|
|
227
|
-
pattern: "^[a-z][a-z0-9_]*$"
|
|
228
|
-
},
|
|
229
|
-
type: {
|
|
230
|
-
title: "Data type of the foreign key field",
|
|
231
|
-
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.",
|
|
232
|
-
"const": "uuid"
|
|
233
|
-
},
|
|
234
|
-
description: {
|
|
235
|
-
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.",
|
|
236
|
-
type: "string"
|
|
237
|
-
},
|
|
238
|
-
relation: {
|
|
239
|
-
title: "Prisma relation configuration defining the association details",
|
|
240
|
-
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.",
|
|
241
|
-
type: "object",
|
|
242
|
-
properties: {
|
|
243
|
-
name: {
|
|
244
|
-
title: "Name of the relation property in the Prisma model",
|
|
245
|
-
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\"",
|
|
246
|
-
type: "string",
|
|
247
|
-
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
248
|
-
},
|
|
249
|
-
targetModel: {
|
|
250
|
-
title: "Name of the target model being referenced",
|
|
251
|
-
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\"",
|
|
252
|
-
type: "string"
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
required: [
|
|
256
|
-
"name",
|
|
257
|
-
"targetModel"
|
|
258
|
-
]
|
|
259
|
-
},
|
|
260
|
-
unique: {
|
|
261
|
-
title: "Whether this foreign key has a unique constraint",
|
|
262
|
-
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.",
|
|
263
|
-
type: "boolean"
|
|
264
|
-
},
|
|
265
|
-
nullable: {
|
|
266
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
267
|
-
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.",
|
|
268
|
-
type: "boolean"
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
required: [
|
|
272
|
-
"name",
|
|
273
|
-
"type",
|
|
274
|
-
"description",
|
|
275
|
-
"relation",
|
|
276
|
-
"unique",
|
|
277
|
-
"nullable"
|
|
278
|
-
]
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
plainFields: {
|
|
282
|
-
title: "Array of regular data fields that don't reference other models",
|
|
283
|
-
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.",
|
|
284
|
-
type: "array",
|
|
285
|
-
items: {
|
|
286
|
-
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.",
|
|
287
|
-
type: "object",
|
|
288
|
-
properties: {
|
|
289
|
-
name: {
|
|
290
|
-
title: "Name of the field in the database table",
|
|
291
|
-
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",
|
|
292
|
-
type: "string",
|
|
293
|
-
pattern: "^[a-z][a-z0-9_]*$"
|
|
294
|
-
},
|
|
295
|
-
type: {
|
|
296
|
-
title: "Data type of the field for Prisma schema generation",
|
|
297
|
-
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",
|
|
298
|
-
oneOf: [
|
|
299
|
-
{
|
|
300
|
-
"const": "string"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"const": "boolean"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"const": "uuid"
|
|
307
|
-
},
|
|
308
|
-
{
|
|
309
|
-
"const": "uri"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
"const": "int"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
"const": "double"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
"const": "datetime"
|
|
319
|
-
}
|
|
320
|
-
]
|
|
321
|
-
},
|
|
322
|
-
description: {
|
|
323
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
324
|
-
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.\"",
|
|
325
|
-
type: "string"
|
|
326
|
-
},
|
|
327
|
-
nullable: {
|
|
328
|
-
title: "Whether this field can contain null values",
|
|
329
|
-
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.",
|
|
330
|
-
type: "boolean"
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
required: [
|
|
334
|
-
"name",
|
|
335
|
-
"type",
|
|
336
|
-
"description",
|
|
337
|
-
"nullable"
|
|
338
|
-
]
|
|
339
|
-
}
|
|
340
|
-
},
|
|
341
|
-
uniqueIndexes: {
|
|
342
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
343
|
-
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).",
|
|
344
|
-
type: "array",
|
|
345
|
-
items: {
|
|
346
|
-
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.",
|
|
347
|
-
type: "object",
|
|
348
|
-
properties: {
|
|
349
|
-
fieldNames: {
|
|
350
|
-
title: "Array of field names that together form the unique constraint",
|
|
351
|
-
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\"]",
|
|
352
|
-
type: "array",
|
|
353
|
-
items: {
|
|
354
|
-
type: "string"
|
|
355
|
-
},
|
|
356
|
-
minItems: 1,
|
|
357
|
-
uniqueItems: true
|
|
358
|
-
},
|
|
359
|
-
unique: {
|
|
360
|
-
title: "Explicit marker indicating this is a unique index",
|
|
361
|
-
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\".",
|
|
362
|
-
"const": true
|
|
363
|
-
}
|
|
364
|
-
},
|
|
365
|
-
required: [
|
|
366
|
-
"fieldNames",
|
|
367
|
-
"unique"
|
|
368
|
-
]
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
plainIndexes: {
|
|
372
|
-
title: "Array of regular indexes for query performance optimization",
|
|
373
|
-
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.",
|
|
374
|
-
type: "array",
|
|
375
|
-
items: {
|
|
376
|
-
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.",
|
|
377
|
-
type: "object",
|
|
378
|
-
properties: {
|
|
379
|
-
fieldNames: {
|
|
380
|
-
title: "Array of field names to include in the performance index",
|
|
381
|
-
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\"]",
|
|
382
|
-
type: "array",
|
|
383
|
-
items: {
|
|
384
|
-
type: "string"
|
|
385
|
-
},
|
|
386
|
-
minItems: 1,
|
|
387
|
-
uniqueItems: true
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
required: [
|
|
391
|
-
"fieldNames"
|
|
392
|
-
]
|
|
393
|
-
}
|
|
394
|
-
},
|
|
395
|
-
ginIndexes: {
|
|
396
|
-
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
397
|
-
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.",
|
|
398
|
-
type: "array",
|
|
399
|
-
items: {
|
|
400
|
-
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.",
|
|
401
|
-
type: "object",
|
|
402
|
-
properties: {
|
|
403
|
-
fieldName: {
|
|
404
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
405
|
-
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.",
|
|
406
|
-
type: "string"
|
|
407
|
-
}
|
|
408
|
-
},
|
|
409
|
-
required: [
|
|
410
|
-
"fieldName"
|
|
411
|
-
]
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
},
|
|
415
|
-
required: [
|
|
416
|
-
"name",
|
|
417
|
-
"description",
|
|
418
|
-
"material",
|
|
419
|
-
"primaryField",
|
|
420
|
-
"foreignFields",
|
|
421
|
-
"plainFields",
|
|
422
|
-
"uniqueIndexes",
|
|
423
|
-
"plainIndexes",
|
|
424
|
-
"ginIndexes"
|
|
425
|
-
]
|
|
177
|
+
$ref: "#/$defs/AutoBePrisma.IModel"
|
|
426
178
|
}
|
|
427
179
|
}
|
|
428
180
|
},
|
|
@@ -431,7 +183,285 @@ const claude = {
|
|
|
431
183
|
"models"
|
|
432
184
|
],
|
|
433
185
|
additionalProperties: false,
|
|
434
|
-
$defs: {
|
|
186
|
+
$defs: {
|
|
187
|
+
"AutoBePrisma.IModel": {
|
|
188
|
+
description: "Interface representing a single Prisma model (database table).\n\nBased 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_)",
|
|
189
|
+
type: "object",
|
|
190
|
+
properties: {
|
|
191
|
+
name: {
|
|
192
|
+
title: "Name of the Prisma model (database table name)",
|
|
193
|
+
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\"",
|
|
194
|
+
type: "string",
|
|
195
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
196
|
+
},
|
|
197
|
+
description: {
|
|
198
|
+
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...\"",
|
|
199
|
+
type: "string"
|
|
200
|
+
},
|
|
201
|
+
material: {
|
|
202
|
+
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",
|
|
203
|
+
type: "boolean"
|
|
204
|
+
},
|
|
205
|
+
primaryField: {
|
|
206
|
+
title: "The primary key field of the model",
|
|
207
|
+
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.",
|
|
208
|
+
$ref: "#/$defs/AutoBePrisma.IPrimaryField"
|
|
209
|
+
},
|
|
210
|
+
foreignFields: {
|
|
211
|
+
title: "Array of foreign key fields that reference other models",
|
|
212
|
+
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.",
|
|
213
|
+
type: "array",
|
|
214
|
+
items: {
|
|
215
|
+
$ref: "#/$defs/AutoBePrisma.IForeignField"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
plainFields: {
|
|
219
|
+
title: "Array of regular data fields that don't reference other models",
|
|
220
|
+
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.",
|
|
221
|
+
type: "array",
|
|
222
|
+
items: {
|
|
223
|
+
$ref: "#/$defs/AutoBePrisma.IPlainField"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
uniqueIndexes: {
|
|
227
|
+
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
228
|
+
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).",
|
|
229
|
+
type: "array",
|
|
230
|
+
items: {
|
|
231
|
+
$ref: "#/$defs/AutoBePrisma.IUniqueIndex"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
plainIndexes: {
|
|
235
|
+
title: "Array of regular indexes for query performance optimization",
|
|
236
|
+
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.",
|
|
237
|
+
type: "array",
|
|
238
|
+
items: {
|
|
239
|
+
$ref: "#/$defs/AutoBePrisma.IPlainIndex"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
ginIndexes: {
|
|
243
|
+
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
244
|
+
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.",
|
|
245
|
+
type: "array",
|
|
246
|
+
items: {
|
|
247
|
+
$ref: "#/$defs/AutoBePrisma.IGinIndex"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
required: [
|
|
252
|
+
"name",
|
|
253
|
+
"description",
|
|
254
|
+
"material",
|
|
255
|
+
"primaryField",
|
|
256
|
+
"foreignFields",
|
|
257
|
+
"plainFields",
|
|
258
|
+
"uniqueIndexes",
|
|
259
|
+
"plainIndexes",
|
|
260
|
+
"ginIndexes"
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"AutoBePrisma.IPrimaryField": {
|
|
264
|
+
description: "Interface representing the primary key field of a Prisma model.\n\nAll models in the uploaded schemas use UUID as primary key for better\ndistributed system compatibility and security (no sequential ID exposure).",
|
|
265
|
+
type: "object",
|
|
266
|
+
properties: {
|
|
267
|
+
name: {
|
|
268
|
+
title: "Name of the primary key field",
|
|
269
|
+
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.",
|
|
270
|
+
type: "string",
|
|
271
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
272
|
+
},
|
|
273
|
+
type: {
|
|
274
|
+
title: "Data type of the primary key field",
|
|
275
|
+
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.",
|
|
276
|
+
"const": "uuid"
|
|
277
|
+
},
|
|
278
|
+
description: {
|
|
279
|
+
title: "Description of the primary key field's purpose",
|
|
280
|
+
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.",
|
|
281
|
+
type: "string"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
required: [
|
|
285
|
+
"name",
|
|
286
|
+
"type",
|
|
287
|
+
"description"
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
"AutoBePrisma.IForeignField": {
|
|
291
|
+
description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
|
|
292
|
+
type: "object",
|
|
293
|
+
properties: {
|
|
294
|
+
name: {
|
|
295
|
+
title: "Name of the foreign key field",
|
|
296
|
+
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)",
|
|
297
|
+
type: "string",
|
|
298
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
299
|
+
},
|
|
300
|
+
type: {
|
|
301
|
+
title: "Data type of the foreign key field",
|
|
302
|
+
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.",
|
|
303
|
+
"const": "uuid"
|
|
304
|
+
},
|
|
305
|
+
description: {
|
|
306
|
+
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.",
|
|
307
|
+
type: "string"
|
|
308
|
+
},
|
|
309
|
+
relation: {
|
|
310
|
+
title: "Prisma relation configuration defining the association details",
|
|
311
|
+
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.",
|
|
312
|
+
type: "object",
|
|
313
|
+
properties: {
|
|
314
|
+
name: {
|
|
315
|
+
title: "Name of the relation property in the Prisma model",
|
|
316
|
+
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\"",
|
|
317
|
+
type: "string",
|
|
318
|
+
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$"
|
|
319
|
+
},
|
|
320
|
+
targetModel: {
|
|
321
|
+
title: "Name of the target model being referenced",
|
|
322
|
+
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\"",
|
|
323
|
+
type: "string"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
required: [
|
|
327
|
+
"name",
|
|
328
|
+
"targetModel"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
unique: {
|
|
332
|
+
title: "Whether this foreign key has a unique constraint",
|
|
333
|
+
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.",
|
|
334
|
+
type: "boolean"
|
|
335
|
+
},
|
|
336
|
+
nullable: {
|
|
337
|
+
title: "Whether this foreign key can be null (optional relationship)",
|
|
338
|
+
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.",
|
|
339
|
+
type: "boolean"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
required: [
|
|
343
|
+
"name",
|
|
344
|
+
"type",
|
|
345
|
+
"description",
|
|
346
|
+
"relation",
|
|
347
|
+
"unique",
|
|
348
|
+
"nullable"
|
|
349
|
+
]
|
|
350
|
+
},
|
|
351
|
+
"AutoBePrisma.IPlainField": {
|
|
352
|
+
description: "Interface representing a regular data field that stores business\ninformation.\n\nThese fields contain the actual business data like names, amounts,\ntimestamps, flags, descriptions, and other domain-specific information.",
|
|
353
|
+
type: "object",
|
|
354
|
+
properties: {
|
|
355
|
+
name: {
|
|
356
|
+
title: "Name of the field in the database table",
|
|
357
|
+
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",
|
|
358
|
+
type: "string",
|
|
359
|
+
pattern: "^[a-z][a-z0-9_]*$"
|
|
360
|
+
},
|
|
361
|
+
type: {
|
|
362
|
+
title: "Data type of the field for Prisma schema generation",
|
|
363
|
+
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",
|
|
364
|
+
oneOf: [
|
|
365
|
+
{
|
|
366
|
+
"const": "string"
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"const": "boolean"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"const": "uuid"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"const": "uri"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"const": "int"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"const": "double"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"const": "datetime"
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
},
|
|
388
|
+
description: {
|
|
389
|
+
title: "Description explaining the business purpose and usage of this field",
|
|
390
|
+
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.\"",
|
|
391
|
+
type: "string"
|
|
392
|
+
},
|
|
393
|
+
nullable: {
|
|
394
|
+
title: "Whether this field can contain null values",
|
|
395
|
+
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.",
|
|
396
|
+
type: "boolean"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
required: [
|
|
400
|
+
"name",
|
|
401
|
+
"type",
|
|
402
|
+
"description",
|
|
403
|
+
"nullable"
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
"AutoBePrisma.IUniqueIndex": {
|
|
407
|
+
description: "Interface representing a unique index constraint on one or more fields.\n\nUnique indexes enforce data integrity by ensuring no duplicate values exist\nfor the specified field combination. Essential for business rules that\nrequire uniqueness like email addresses, codes, or composite keys.",
|
|
408
|
+
type: "object",
|
|
409
|
+
properties: {
|
|
410
|
+
fieldNames: {
|
|
411
|
+
title: "Array of field names that together form the unique constraint",
|
|
412
|
+
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\"]",
|
|
413
|
+
type: "array",
|
|
414
|
+
items: {
|
|
415
|
+
type: "string"
|
|
416
|
+
},
|
|
417
|
+
minItems: 1,
|
|
418
|
+
uniqueItems: true
|
|
419
|
+
},
|
|
420
|
+
unique: {
|
|
421
|
+
title: "Explicit marker indicating this is a unique index",
|
|
422
|
+
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\".",
|
|
423
|
+
"const": true
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
required: [
|
|
427
|
+
"fieldNames",
|
|
428
|
+
"unique"
|
|
429
|
+
]
|
|
430
|
+
},
|
|
431
|
+
"AutoBePrisma.IPlainIndex": {
|
|
432
|
+
description: "Interface representing a regular (non-unique) index for query performance.\n\nRegular indexes speed up database queries by creating optimized data\nstructures for common search patterns. Essential for foreign keys, date\nranges, and frequently filtered fields.",
|
|
433
|
+
type: "object",
|
|
434
|
+
properties: {
|
|
435
|
+
fieldNames: {
|
|
436
|
+
title: "Array of field names to include in the performance index",
|
|
437
|
+
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\"]",
|
|
438
|
+
type: "array",
|
|
439
|
+
items: {
|
|
440
|
+
type: "string"
|
|
441
|
+
},
|
|
442
|
+
minItems: 1,
|
|
443
|
+
uniqueItems: true
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
required: [
|
|
447
|
+
"fieldNames"
|
|
448
|
+
]
|
|
449
|
+
},
|
|
450
|
+
"AutoBePrisma.IGinIndex": {
|
|
451
|
+
description: "Interface representing a GIN (Generalized Inverted Index) for full-text\nsearch.\n\nGIN indexes enable advanced PostgreSQL text search capabilities including\nfuzzy matching and partial text search using trigram operations. Essential\nfor user-facing search features on text content.",
|
|
452
|
+
type: "object",
|
|
453
|
+
properties: {
|
|
454
|
+
fieldName: {
|
|
455
|
+
title: "Name of the text field to index for full-text search capabilities",
|
|
456
|
+
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.",
|
|
457
|
+
type: "string"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
required: [
|
|
461
|
+
"fieldName"
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
}
|
|
435
465
|
},
|
|
436
466
|
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",
|
|
437
467
|
validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); 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))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; 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; const _io4 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel; 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; 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; const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io8 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
|
|
@@ -740,248 +770,7 @@ const collection = {
|
|
|
740
770
|
description: "ONLY the specific models that contain validation errors and need\ncorrection.\n\n\uD83D\uDCE5 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\uD83D\uDD0D 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\uD83D\uDCDD 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\u26A0\uFE0F 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\uD83C\uDFAF 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",
|
|
741
771
|
type: "array",
|
|
742
772
|
items: {
|
|
743
|
-
|
|
744
|
-
type: "object",
|
|
745
|
-
properties: {
|
|
746
|
-
name: {
|
|
747
|
-
title: "Name of the Prisma model (database table name)",
|
|
748
|
-
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_]*$",
|
|
749
|
-
type: "string"
|
|
750
|
-
},
|
|
751
|
-
description: {
|
|
752
|
-
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...\"",
|
|
753
|
-
type: "string"
|
|
754
|
-
},
|
|
755
|
-
material: {
|
|
756
|
-
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",
|
|
757
|
-
type: "boolean"
|
|
758
|
-
},
|
|
759
|
-
primaryField: {
|
|
760
|
-
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).",
|
|
761
|
-
type: "object",
|
|
762
|
-
properties: {
|
|
763
|
-
name: {
|
|
764
|
-
title: "Name of the primary key field",
|
|
765
|
-
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_]*$",
|
|
766
|
-
type: "string"
|
|
767
|
-
},
|
|
768
|
-
type: {
|
|
769
|
-
title: "Data type of the primary key field",
|
|
770
|
-
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.",
|
|
771
|
-
type: "string",
|
|
772
|
-
"enum": [
|
|
773
|
-
"uuid"
|
|
774
|
-
]
|
|
775
|
-
},
|
|
776
|
-
description: {
|
|
777
|
-
title: "Description of the primary key field's purpose",
|
|
778
|
-
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.",
|
|
779
|
-
type: "string"
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
required: [
|
|
783
|
-
"name",
|
|
784
|
-
"type",
|
|
785
|
-
"description"
|
|
786
|
-
]
|
|
787
|
-
},
|
|
788
|
-
foreignFields: {
|
|
789
|
-
title: "Array of foreign key fields that reference other models",
|
|
790
|
-
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.",
|
|
791
|
-
type: "array",
|
|
792
|
-
items: {
|
|
793
|
-
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.",
|
|
794
|
-
type: "object",
|
|
795
|
-
properties: {
|
|
796
|
-
name: {
|
|
797
|
-
title: "Name of the foreign key field",
|
|
798
|
-
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_]*$",
|
|
799
|
-
type: "string"
|
|
800
|
-
},
|
|
801
|
-
type: {
|
|
802
|
-
title: "Data type of the foreign key field",
|
|
803
|
-
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.",
|
|
804
|
-
type: "string",
|
|
805
|
-
"enum": [
|
|
806
|
-
"uuid"
|
|
807
|
-
]
|
|
808
|
-
},
|
|
809
|
-
description: {
|
|
810
|
-
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.",
|
|
811
|
-
type: "string"
|
|
812
|
-
},
|
|
813
|
-
relation: {
|
|
814
|
-
title: "Prisma relation configuration defining the association details",
|
|
815
|
-
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.",
|
|
816
|
-
type: "object",
|
|
817
|
-
properties: {
|
|
818
|
-
name: {
|
|
819
|
-
title: "Name of the relation property in the Prisma model",
|
|
820
|
-
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_]*$",
|
|
821
|
-
type: "string"
|
|
822
|
-
},
|
|
823
|
-
targetModel: {
|
|
824
|
-
title: "Name of the target model being referenced",
|
|
825
|
-
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\"",
|
|
826
|
-
type: "string"
|
|
827
|
-
}
|
|
828
|
-
},
|
|
829
|
-
required: [
|
|
830
|
-
"name",
|
|
831
|
-
"targetModel"
|
|
832
|
-
]
|
|
833
|
-
},
|
|
834
|
-
unique: {
|
|
835
|
-
title: "Whether this foreign key has a unique constraint",
|
|
836
|
-
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.",
|
|
837
|
-
type: "boolean"
|
|
838
|
-
},
|
|
839
|
-
nullable: {
|
|
840
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
841
|
-
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.",
|
|
842
|
-
type: "boolean"
|
|
843
|
-
}
|
|
844
|
-
},
|
|
845
|
-
required: [
|
|
846
|
-
"name",
|
|
847
|
-
"type",
|
|
848
|
-
"description",
|
|
849
|
-
"relation",
|
|
850
|
-
"unique",
|
|
851
|
-
"nullable"
|
|
852
|
-
]
|
|
853
|
-
}
|
|
854
|
-
},
|
|
855
|
-
plainFields: {
|
|
856
|
-
title: "Array of regular data fields that don't reference other models",
|
|
857
|
-
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.",
|
|
858
|
-
type: "array",
|
|
859
|
-
items: {
|
|
860
|
-
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.",
|
|
861
|
-
type: "object",
|
|
862
|
-
properties: {
|
|
863
|
-
name: {
|
|
864
|
-
title: "Name of the field in the database table",
|
|
865
|
-
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_]*$",
|
|
866
|
-
type: "string"
|
|
867
|
-
},
|
|
868
|
-
type: {
|
|
869
|
-
title: "Data type of the field for Prisma schema generation",
|
|
870
|
-
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",
|
|
871
|
-
type: "string",
|
|
872
|
-
"enum": [
|
|
873
|
-
"string",
|
|
874
|
-
"boolean",
|
|
875
|
-
"uuid",
|
|
876
|
-
"uri",
|
|
877
|
-
"int",
|
|
878
|
-
"double",
|
|
879
|
-
"datetime"
|
|
880
|
-
]
|
|
881
|
-
},
|
|
882
|
-
description: {
|
|
883
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
884
|
-
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.\"",
|
|
885
|
-
type: "string"
|
|
886
|
-
},
|
|
887
|
-
nullable: {
|
|
888
|
-
title: "Whether this field can contain null values",
|
|
889
|
-
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.",
|
|
890
|
-
type: "boolean"
|
|
891
|
-
}
|
|
892
|
-
},
|
|
893
|
-
required: [
|
|
894
|
-
"name",
|
|
895
|
-
"type",
|
|
896
|
-
"description",
|
|
897
|
-
"nullable"
|
|
898
|
-
]
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
uniqueIndexes: {
|
|
902
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
903
|
-
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).",
|
|
904
|
-
type: "array",
|
|
905
|
-
items: {
|
|
906
|
-
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.",
|
|
907
|
-
type: "object",
|
|
908
|
-
properties: {
|
|
909
|
-
fieldNames: {
|
|
910
|
-
title: "Array of field names that together form the unique constraint",
|
|
911
|
-
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",
|
|
912
|
-
type: "array",
|
|
913
|
-
items: {
|
|
914
|
-
type: "string"
|
|
915
|
-
}
|
|
916
|
-
},
|
|
917
|
-
unique: {
|
|
918
|
-
title: "Explicit marker indicating this is a unique index",
|
|
919
|
-
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\".",
|
|
920
|
-
type: "boolean",
|
|
921
|
-
"enum": [
|
|
922
|
-
true
|
|
923
|
-
]
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
|
-
required: [
|
|
927
|
-
"fieldNames",
|
|
928
|
-
"unique"
|
|
929
|
-
]
|
|
930
|
-
}
|
|
931
|
-
},
|
|
932
|
-
plainIndexes: {
|
|
933
|
-
title: "Array of regular indexes for query performance optimization",
|
|
934
|
-
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.",
|
|
935
|
-
type: "array",
|
|
936
|
-
items: {
|
|
937
|
-
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.",
|
|
938
|
-
type: "object",
|
|
939
|
-
properties: {
|
|
940
|
-
fieldNames: {
|
|
941
|
-
title: "Array of field names to include in the performance index",
|
|
942
|
-
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",
|
|
943
|
-
type: "array",
|
|
944
|
-
items: {
|
|
945
|
-
type: "string"
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
required: [
|
|
950
|
-
"fieldNames"
|
|
951
|
-
]
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
ginIndexes: {
|
|
955
|
-
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
956
|
-
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.",
|
|
957
|
-
type: "array",
|
|
958
|
-
items: {
|
|
959
|
-
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.",
|
|
960
|
-
type: "object",
|
|
961
|
-
properties: {
|
|
962
|
-
fieldName: {
|
|
963
|
-
title: "Name of the text field to index for full-text search capabilities",
|
|
964
|
-
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.",
|
|
965
|
-
type: "string"
|
|
966
|
-
}
|
|
967
|
-
},
|
|
968
|
-
required: [
|
|
969
|
-
"fieldName"
|
|
970
|
-
]
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
},
|
|
974
|
-
required: [
|
|
975
|
-
"name",
|
|
976
|
-
"description",
|
|
977
|
-
"material",
|
|
978
|
-
"primaryField",
|
|
979
|
-
"foreignFields",
|
|
980
|
-
"plainFields",
|
|
981
|
-
"uniqueIndexes",
|
|
982
|
-
"plainIndexes",
|
|
983
|
-
"ginIndexes"
|
|
984
|
-
]
|
|
773
|
+
$ref: "#/$defs/AutoBePrisma.IModel"
|
|
985
774
|
}
|
|
986
775
|
}
|
|
987
776
|
},
|
|
@@ -990,585 +779,271 @@ const collection = {
|
|
|
990
779
|
"models"
|
|
991
780
|
],
|
|
992
781
|
additionalProperties: false,
|
|
993
|
-
$defs: {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
value: elem
|
|
1068
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
1069
|
-
path: _path + ".plainFields",
|
|
1070
|
-
expected: "Array<AutoBePrisma.IPlainField>",
|
|
1071
|
-
value: input.plainFields
|
|
1072
|
-
}), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
|
|
1073
|
-
path: _path + ".uniqueIndexes",
|
|
1074
|
-
expected: "Array<AutoBePrisma.IUniqueIndex>",
|
|
1075
|
-
value: input.uniqueIndexes
|
|
1076
|
-
})) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1077
|
-
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
1078
|
-
expected: "AutoBePrisma.IUniqueIndex",
|
|
1079
|
-
value: elem
|
|
1080
|
-
})) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1081
|
-
path: _path + ".uniqueIndexes[" + _index12 + "]",
|
|
1082
|
-
expected: "AutoBePrisma.IUniqueIndex",
|
|
1083
|
-
value: elem
|
|
1084
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
1085
|
-
path: _path + ".uniqueIndexes",
|
|
1086
|
-
expected: "Array<AutoBePrisma.IUniqueIndex>",
|
|
1087
|
-
value: input.uniqueIndexes
|
|
1088
|
-
}), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
|
|
1089
|
-
path: _path + ".plainIndexes",
|
|
1090
|
-
expected: "Array<AutoBePrisma.IPlainIndex>",
|
|
1091
|
-
value: input.plainIndexes
|
|
1092
|
-
})) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1093
|
-
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
1094
|
-
expected: "AutoBePrisma.IPlainIndex",
|
|
1095
|
-
value: elem
|
|
1096
|
-
})) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1097
|
-
path: _path + ".plainIndexes[" + _index13 + "]",
|
|
1098
|
-
expected: "AutoBePrisma.IPlainIndex",
|
|
1099
|
-
value: elem
|
|
1100
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
1101
|
-
path: _path + ".plainIndexes",
|
|
1102
|
-
expected: "Array<AutoBePrisma.IPlainIndex>",
|
|
1103
|
-
value: input.plainIndexes
|
|
1104
|
-
}), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
|
|
1105
|
-
path: _path + ".ginIndexes",
|
|
1106
|
-
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
1107
|
-
value: input.ginIndexes
|
|
1108
|
-
})) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
|
|
1109
|
-
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
1110
|
-
expected: "AutoBePrisma.IGinIndex",
|
|
1111
|
-
value: elem
|
|
1112
|
-
})) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
|
|
1113
|
-
path: _path + ".ginIndexes[" + _index14 + "]",
|
|
1114
|
-
expected: "AutoBePrisma.IGinIndex",
|
|
1115
|
-
value: elem
|
|
1116
|
-
})).every(flag => flag) || _report(_exceptionable, {
|
|
1117
|
-
path: _path + ".ginIndexes",
|
|
1118
|
-
expected: "Array<AutoBePrisma.IGinIndex>",
|
|
1119
|
-
value: input.ginIndexes
|
|
1120
|
-
})].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
1121
|
-
path: _path + ".name",
|
|
1122
|
-
expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
|
|
1123
|
-
value: input.name
|
|
1124
|
-
})) || _report(_exceptionable, {
|
|
1125
|
-
path: _path + ".name",
|
|
1126
|
-
expected: "(string & Pattern<\"^[a-z][a-z0-9_]*$\">)",
|
|
1127
|
-
value: input.name
|
|
1128
|
-
}), "uuid" === input.type || _report(_exceptionable, {
|
|
1129
|
-
path: _path + ".type",
|
|
1130
|
-
expected: "\"uuid\"",
|
|
1131
|
-
value: input.type
|
|
1132
|
-
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1133
|
-
path: _path + ".description",
|
|
1134
|
-
expected: "string",
|
|
1135
|
-
value: input.description
|
|
1136
|
-
})].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
1137
|
-
path: _path + ".name",
|
|
1138
|
-
expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
|
|
1139
|
-
value: input.name
|
|
1140
|
-
})) || _report(_exceptionable, {
|
|
1141
|
-
path: _path + ".name",
|
|
1142
|
-
expected: "(string & Pattern<\"^[a-z][a-z0-9_]*$\">)",
|
|
1143
|
-
value: input.name
|
|
1144
|
-
}), "uuid" === input.type || _report(_exceptionable, {
|
|
1145
|
-
path: _path + ".type",
|
|
1146
|
-
expected: "\"uuid\"",
|
|
1147
|
-
value: input.type
|
|
1148
|
-
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1149
|
-
path: _path + ".description",
|
|
1150
|
-
expected: "string",
|
|
1151
|
-
value: input.description
|
|
1152
|
-
}), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
|
|
1153
|
-
path: _path + ".relation",
|
|
1154
|
-
expected: "__type",
|
|
1155
|
-
value: input.relation
|
|
1156
|
-
})) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
|
|
1157
|
-
path: _path + ".relation",
|
|
1158
|
-
expected: "__type",
|
|
1159
|
-
value: input.relation
|
|
1160
|
-
}), "boolean" === typeof input.unique || _report(_exceptionable, {
|
|
1161
|
-
path: _path + ".unique",
|
|
1162
|
-
expected: "boolean",
|
|
1163
|
-
value: input.unique
|
|
1164
|
-
}), "boolean" === typeof input.nullable || _report(_exceptionable, {
|
|
1165
|
-
path: _path + ".nullable",
|
|
1166
|
-
expected: "boolean",
|
|
1167
|
-
value: input.nullable
|
|
1168
|
-
})].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
1169
|
-
path: _path + ".name",
|
|
1170
|
-
expected: "string & Pattern<\"^[a-zA-Z_][a-zA-Z0-9_]*$\">",
|
|
1171
|
-
value: input.name
|
|
1172
|
-
})) || _report(_exceptionable, {
|
|
1173
|
-
path: _path + ".name",
|
|
1174
|
-
expected: "(string & Pattern<\"^[a-zA-Z_][a-zA-Z0-9_]*$\">)",
|
|
1175
|
-
value: input.name
|
|
1176
|
-
}), "string" === typeof input.targetModel || _report(_exceptionable, {
|
|
1177
|
-
path: _path + ".targetModel",
|
|
1178
|
-
expected: "string",
|
|
1179
|
-
value: input.targetModel
|
|
1180
|
-
})].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
|
|
1181
|
-
path: _path + ".name",
|
|
1182
|
-
expected: "string & Pattern<\"^[a-z][a-z0-9_]*$\">",
|
|
1183
|
-
value: input.name
|
|
1184
|
-
})) || _report(_exceptionable, {
|
|
1185
|
-
path: _path + ".name",
|
|
1186
|
-
expected: "(string & Pattern<\"^[a-z][a-z0-9_]*$\">)",
|
|
1187
|
-
value: input.name
|
|
1188
|
-
}), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
|
|
1189
|
-
path: _path + ".type",
|
|
1190
|
-
expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
|
|
1191
|
-
value: input.type
|
|
1192
|
-
}), "string" === typeof input.description || _report(_exceptionable, {
|
|
1193
|
-
path: _path + ".description",
|
|
1194
|
-
expected: "string",
|
|
1195
|
-
value: input.description
|
|
1196
|
-
}), "boolean" === typeof input.nullable || _report(_exceptionable, {
|
|
1197
|
-
path: _path + ".nullable",
|
|
1198
|
-
expected: "boolean",
|
|
1199
|
-
value: input.nullable
|
|
1200
|
-
})].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
1201
|
-
path: _path + ".fieldNames",
|
|
1202
|
-
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
1203
|
-
value: input.fieldNames
|
|
1204
|
-
})) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
|
|
1205
|
-
path: _path + ".fieldNames",
|
|
1206
|
-
expected: "Array<> & MinItems<1>",
|
|
1207
|
-
value: input.fieldNames
|
|
1208
|
-
})) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
|
|
1209
|
-
path: _path + ".fieldNames",
|
|
1210
|
-
expected: "Array<> & UniqueItems<true>",
|
|
1211
|
-
value: input.fieldNames
|
|
1212
|
-
})) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
|
|
1213
|
-
path: _path + ".fieldNames[" + _index15 + "]",
|
|
1214
|
-
expected: "string",
|
|
1215
|
-
value: elem
|
|
1216
|
-
})).every(flag => flag)) || _report(_exceptionable, {
|
|
1217
|
-
path: _path + ".fieldNames",
|
|
1218
|
-
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
1219
|
-
value: input.fieldNames
|
|
1220
|
-
}), true === input.unique || _report(_exceptionable, {
|
|
1221
|
-
path: _path + ".unique",
|
|
1222
|
-
expected: "true",
|
|
1223
|
-
value: input.unique
|
|
1224
|
-
})].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
|
|
1225
|
-
path: _path + ".fieldNames",
|
|
1226
|
-
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
1227
|
-
value: input.fieldNames
|
|
1228
|
-
})) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
|
|
1229
|
-
path: _path + ".fieldNames",
|
|
1230
|
-
expected: "Array<> & MinItems<1>",
|
|
1231
|
-
value: input.fieldNames
|
|
1232
|
-
})) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
|
|
1233
|
-
path: _path + ".fieldNames",
|
|
1234
|
-
expected: "Array<> & UniqueItems<true>",
|
|
1235
|
-
value: input.fieldNames
|
|
1236
|
-
})) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
|
|
1237
|
-
path: _path + ".fieldNames[" + _index16 + "]",
|
|
1238
|
-
expected: "string",
|
|
1239
|
-
value: elem
|
|
1240
|
-
})).every(flag => flag)) || _report(_exceptionable, {
|
|
1241
|
-
path: _path + ".fieldNames",
|
|
1242
|
-
expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
|
|
1243
|
-
value: input.fieldNames
|
|
1244
|
-
})].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
|
|
1245
|
-
path: _path + ".fieldName",
|
|
1246
|
-
expected: "string",
|
|
1247
|
-
value: input.fieldName
|
|
1248
|
-
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
1249
|
-
if (false === __is(input)) {
|
|
1250
|
-
errors = [];
|
|
1251
|
-
_report = __typia_transform__validateReport._validateReport(errors);
|
|
1252
|
-
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
|
|
1253
|
-
path: _path + "",
|
|
1254
|
-
expected: "IModifyPrismaSchemaFilesProps",
|
|
1255
|
-
value: input
|
|
1256
|
-
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
1257
|
-
path: _path + "",
|
|
1258
|
-
expected: "IModifyPrismaSchemaFilesProps",
|
|
1259
|
-
value: input
|
|
1260
|
-
}))(input, "$input", true);
|
|
1261
|
-
const success = 0 === errors.length;
|
|
1262
|
-
return success ? {
|
|
1263
|
-
success,
|
|
1264
|
-
data: input
|
|
1265
|
-
} : {
|
|
1266
|
-
success,
|
|
1267
|
-
errors,
|
|
1268
|
-
data: input
|
|
1269
|
-
};
|
|
1270
|
-
}
|
|
1271
|
-
return {
|
|
1272
|
-
success: true,
|
|
1273
|
-
data: input
|
|
1274
|
-
};
|
|
1275
|
-
}; })()
|
|
1276
|
-
}
|
|
1277
|
-
]
|
|
1278
|
-
},
|
|
1279
|
-
claude,
|
|
1280
|
-
llama: claude,
|
|
1281
|
-
deepseek: claude,
|
|
1282
|
-
"3.1": claude,
|
|
1283
|
-
"3.0": {
|
|
1284
|
-
model: "3.0",
|
|
1285
|
-
options: {
|
|
1286
|
-
constraint: true,
|
|
1287
|
-
recursive: 3,
|
|
1288
|
-
separate: null
|
|
1289
|
-
},
|
|
1290
|
-
functions: [
|
|
1291
|
-
{
|
|
1292
|
-
name: "correctPrismaSchemaFiles",
|
|
1293
|
-
parameters: {
|
|
1294
|
-
type: "object",
|
|
1295
|
-
properties: {
|
|
1296
|
-
planning: {
|
|
1297
|
-
type: "string",
|
|
1298
|
-
description: "Detailed execution plan for fixing `AutoBePrisma` validation errors in\nspecific models.\n\n\uD83C\uDFAF Purpose: Enable systematic reasoning and step-by-step error resolution\napproach for targeted model validation issues\n\n\uD83D\uDCCB 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\uD83D\uDCA1 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"
|
|
782
|
+
$defs: {
|
|
783
|
+
"AutoBePrisma.IModel": {
|
|
784
|
+
description: "Interface representing a single Prisma model (database table).\n\nBased 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_)\n\n### Description of {@link primaryField} property:\n\n> The primary key field of the model.\n> \n> In all uploaded schemas, primary keys are always UUID type with \"@\\id\"\n> directive. Usually named \"id\" and marked with \"@\\db.Uuid\" for PostgreSQL\n> mapping.",
|
|
785
|
+
type: "object",
|
|
786
|
+
properties: {
|
|
787
|
+
name: {
|
|
788
|
+
title: "Name of the Prisma model (database table name)",
|
|
789
|
+
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_]*$",
|
|
790
|
+
type: "string"
|
|
791
|
+
},
|
|
792
|
+
description: {
|
|
793
|
+
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...\"",
|
|
794
|
+
type: "string"
|
|
795
|
+
},
|
|
796
|
+
material: {
|
|
797
|
+
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",
|
|
798
|
+
type: "boolean"
|
|
799
|
+
},
|
|
800
|
+
primaryField: {
|
|
801
|
+
title: "The primary key field of the model",
|
|
802
|
+
$ref: "#/$defs/AutoBePrisma.IPrimaryField"
|
|
803
|
+
},
|
|
804
|
+
foreignFields: {
|
|
805
|
+
title: "Array of foreign key fields that reference other models",
|
|
806
|
+
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.",
|
|
807
|
+
type: "array",
|
|
808
|
+
items: {
|
|
809
|
+
$ref: "#/$defs/AutoBePrisma.IForeignField"
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
plainFields: {
|
|
813
|
+
title: "Array of regular data fields that don't reference other models",
|
|
814
|
+
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.",
|
|
815
|
+
type: "array",
|
|
816
|
+
items: {
|
|
817
|
+
$ref: "#/$defs/AutoBePrisma.IPlainField"
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
uniqueIndexes: {
|
|
821
|
+
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
822
|
+
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).",
|
|
823
|
+
type: "array",
|
|
824
|
+
items: {
|
|
825
|
+
$ref: "#/$defs/AutoBePrisma.IUniqueIndex"
|
|
826
|
+
}
|
|
827
|
+
},
|
|
828
|
+
plainIndexes: {
|
|
829
|
+
title: "Array of regular indexes for query performance optimization",
|
|
830
|
+
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.",
|
|
831
|
+
type: "array",
|
|
832
|
+
items: {
|
|
833
|
+
$ref: "#/$defs/AutoBePrisma.IPlainIndex"
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
ginIndexes: {
|
|
837
|
+
title: "Array of GIN (Generalized Inverted Index) indexes for full-text search",
|
|
838
|
+
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.",
|
|
839
|
+
type: "array",
|
|
840
|
+
items: {
|
|
841
|
+
$ref: "#/$defs/AutoBePrisma.IGinIndex"
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
},
|
|
845
|
+
required: [
|
|
846
|
+
"name",
|
|
847
|
+
"description",
|
|
848
|
+
"material",
|
|
849
|
+
"primaryField",
|
|
850
|
+
"foreignFields",
|
|
851
|
+
"plainFields",
|
|
852
|
+
"uniqueIndexes",
|
|
853
|
+
"plainIndexes",
|
|
854
|
+
"ginIndexes"
|
|
855
|
+
]
|
|
1299
856
|
},
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
description:
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
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)"
|
|
1360
|
-
},
|
|
1361
|
-
type: {
|
|
1362
|
-
type: "string",
|
|
1363
|
-
"enum": [
|
|
1364
|
-
"uuid"
|
|
1365
|
-
],
|
|
1366
|
-
title: "Data type of the foreign key field",
|
|
1367
|
-
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."
|
|
1368
|
-
},
|
|
1369
|
-
description: {
|
|
1370
|
-
type: "string",
|
|
1371
|
-
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."
|
|
1372
|
-
},
|
|
1373
|
-
relation: {
|
|
1374
|
-
type: "object",
|
|
1375
|
-
properties: {
|
|
1376
|
-
name: {
|
|
1377
|
-
type: "string",
|
|
1378
|
-
pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$",
|
|
1379
|
-
title: "Name of the relation property in the Prisma model",
|
|
1380
|
-
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\""
|
|
1381
|
-
},
|
|
1382
|
-
targetModel: {
|
|
1383
|
-
type: "string",
|
|
1384
|
-
title: "Name of the target model being referenced",
|
|
1385
|
-
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\""
|
|
1386
|
-
}
|
|
1387
|
-
},
|
|
1388
|
-
required: [
|
|
1389
|
-
"name",
|
|
1390
|
-
"targetModel"
|
|
1391
|
-
],
|
|
1392
|
-
title: "Prisma relation configuration defining the association details",
|
|
1393
|
-
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.",
|
|
1394
|
-
additionalProperties: false
|
|
1395
|
-
},
|
|
1396
|
-
unique: {
|
|
1397
|
-
type: "boolean",
|
|
1398
|
-
title: "Whether this foreign key has a unique constraint",
|
|
1399
|
-
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."
|
|
1400
|
-
},
|
|
1401
|
-
nullable: {
|
|
1402
|
-
type: "boolean",
|
|
1403
|
-
title: "Whether this foreign key can be null (optional relationship)",
|
|
1404
|
-
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."
|
|
1405
|
-
}
|
|
1406
|
-
},
|
|
1407
|
-
required: [
|
|
1408
|
-
"name",
|
|
1409
|
-
"type",
|
|
1410
|
-
"description",
|
|
1411
|
-
"relation",
|
|
1412
|
-
"unique",
|
|
1413
|
-
"nullable"
|
|
1414
|
-
],
|
|
1415
|
-
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.",
|
|
1416
|
-
additionalProperties: false
|
|
1417
|
-
},
|
|
1418
|
-
title: "Array of foreign key fields that reference other models",
|
|
1419
|
-
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."
|
|
1420
|
-
},
|
|
1421
|
-
plainFields: {
|
|
1422
|
-
type: "array",
|
|
1423
|
-
items: {
|
|
1424
|
-
type: "object",
|
|
1425
|
-
properties: {
|
|
1426
|
-
name: {
|
|
1427
|
-
type: "string",
|
|
1428
|
-
pattern: "^[a-z][a-z0-9_]*$",
|
|
1429
|
-
title: "Name of the field in the database table",
|
|
1430
|
-
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"
|
|
1431
|
-
},
|
|
1432
|
-
type: {
|
|
1433
|
-
type: "string",
|
|
1434
|
-
"enum": [
|
|
1435
|
-
"string",
|
|
1436
|
-
"boolean",
|
|
1437
|
-
"uuid",
|
|
1438
|
-
"uri",
|
|
1439
|
-
"int",
|
|
1440
|
-
"double",
|
|
1441
|
-
"datetime"
|
|
1442
|
-
],
|
|
1443
|
-
title: "Data type of the field for Prisma schema generation",
|
|
1444
|
-
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"
|
|
1445
|
-
},
|
|
1446
|
-
description: {
|
|
1447
|
-
type: "string",
|
|
1448
|
-
title: "Description explaining the business purpose and usage of this field",
|
|
1449
|
-
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.\""
|
|
1450
|
-
},
|
|
1451
|
-
nullable: {
|
|
1452
|
-
type: "boolean",
|
|
1453
|
-
title: "Whether this field can contain null values",
|
|
1454
|
-
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."
|
|
1455
|
-
}
|
|
1456
|
-
},
|
|
1457
|
-
required: [
|
|
1458
|
-
"name",
|
|
1459
|
-
"type",
|
|
1460
|
-
"description",
|
|
1461
|
-
"nullable"
|
|
1462
|
-
],
|
|
1463
|
-
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.",
|
|
1464
|
-
additionalProperties: false
|
|
1465
|
-
},
|
|
1466
|
-
title: "Array of regular data fields that don't reference other models",
|
|
1467
|
-
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."
|
|
1468
|
-
},
|
|
1469
|
-
uniqueIndexes: {
|
|
1470
|
-
type: "array",
|
|
1471
|
-
items: {
|
|
1472
|
-
type: "object",
|
|
1473
|
-
properties: {
|
|
1474
|
-
fieldNames: {
|
|
1475
|
-
type: "array",
|
|
1476
|
-
items: {
|
|
1477
|
-
type: "string"
|
|
1478
|
-
},
|
|
1479
|
-
minItems: 1,
|
|
1480
|
-
uniqueItems: true,
|
|
1481
|
-
title: "Array of field names that together form the unique constraint",
|
|
1482
|
-
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\"]"
|
|
1483
|
-
},
|
|
1484
|
-
unique: {
|
|
1485
|
-
type: "boolean",
|
|
1486
|
-
"enum": [
|
|
1487
|
-
true
|
|
1488
|
-
],
|
|
1489
|
-
title: "Explicit marker indicating this is a unique index",
|
|
1490
|
-
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\"."
|
|
1491
|
-
}
|
|
1492
|
-
},
|
|
1493
|
-
required: [
|
|
1494
|
-
"fieldNames",
|
|
1495
|
-
"unique"
|
|
1496
|
-
],
|
|
1497
|
-
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.",
|
|
1498
|
-
additionalProperties: false
|
|
1499
|
-
},
|
|
1500
|
-
title: "Array of unique indexes for enforcing data integrity constraints",
|
|
1501
|
-
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)."
|
|
1502
|
-
},
|
|
1503
|
-
plainIndexes: {
|
|
1504
|
-
type: "array",
|
|
1505
|
-
items: {
|
|
1506
|
-
type: "object",
|
|
1507
|
-
properties: {
|
|
1508
|
-
fieldNames: {
|
|
1509
|
-
type: "array",
|
|
1510
|
-
items: {
|
|
1511
|
-
type: "string"
|
|
1512
|
-
},
|
|
1513
|
-
minItems: 1,
|
|
1514
|
-
uniqueItems: true,
|
|
1515
|
-
title: "Array of field names to include in the performance index",
|
|
1516
|
-
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\"]"
|
|
1517
|
-
}
|
|
1518
|
-
},
|
|
1519
|
-
required: [
|
|
1520
|
-
"fieldNames"
|
|
1521
|
-
],
|
|
1522
|
-
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.",
|
|
1523
|
-
additionalProperties: false
|
|
857
|
+
"AutoBePrisma.IPrimaryField": {
|
|
858
|
+
description: "Interface representing the primary key field of a Prisma model.\n\nAll models in the uploaded schemas use UUID as primary key for better\ndistributed system compatibility and security (no sequential ID exposure).",
|
|
859
|
+
type: "object",
|
|
860
|
+
properties: {
|
|
861
|
+
name: {
|
|
862
|
+
title: "Name of the primary key field",
|
|
863
|
+
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_]*$",
|
|
864
|
+
type: "string"
|
|
865
|
+
},
|
|
866
|
+
type: {
|
|
867
|
+
title: "Data type of the primary key field",
|
|
868
|
+
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.",
|
|
869
|
+
type: "string",
|
|
870
|
+
"enum": [
|
|
871
|
+
"uuid"
|
|
872
|
+
]
|
|
873
|
+
},
|
|
874
|
+
description: {
|
|
875
|
+
title: "Description of the primary key field's purpose",
|
|
876
|
+
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.",
|
|
877
|
+
type: "string"
|
|
878
|
+
}
|
|
879
|
+
},
|
|
880
|
+
required: [
|
|
881
|
+
"name",
|
|
882
|
+
"type",
|
|
883
|
+
"description"
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
"AutoBePrisma.IForeignField": {
|
|
887
|
+
description: "Interface representing a foreign key field that establishes relationships\nbetween models.\n\nForeign keys create associations between models, enabling relational data\nmodeling. They can represent 1:1, 1:N, or participate in M:N relationships\nthrough junction tables.",
|
|
888
|
+
type: "object",
|
|
889
|
+
properties: {
|
|
890
|
+
name: {
|
|
891
|
+
title: "Name of the foreign key field",
|
|
892
|
+
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_]*$",
|
|
893
|
+
type: "string"
|
|
894
|
+
},
|
|
895
|
+
type: {
|
|
896
|
+
title: "Data type of the foreign key field",
|
|
897
|
+
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.",
|
|
898
|
+
type: "string",
|
|
899
|
+
"enum": [
|
|
900
|
+
"uuid"
|
|
901
|
+
]
|
|
902
|
+
},
|
|
903
|
+
description: {
|
|
904
|
+
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.",
|
|
905
|
+
type: "string"
|
|
906
|
+
},
|
|
907
|
+
relation: {
|
|
908
|
+
title: "Prisma relation configuration defining the association details",
|
|
909
|
+
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.",
|
|
910
|
+
type: "object",
|
|
911
|
+
properties: {
|
|
912
|
+
name: {
|
|
913
|
+
title: "Name of the relation property in the Prisma model",
|
|
914
|
+
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_]*$",
|
|
915
|
+
type: "string"
|
|
1524
916
|
},
|
|
1525
|
-
|
|
1526
|
-
|
|
917
|
+
targetModel: {
|
|
918
|
+
title: "Name of the target model being referenced",
|
|
919
|
+
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\"",
|
|
920
|
+
type: "string"
|
|
921
|
+
}
|
|
1527
922
|
},
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
923
|
+
required: [
|
|
924
|
+
"name",
|
|
925
|
+
"targetModel"
|
|
926
|
+
]
|
|
927
|
+
},
|
|
928
|
+
unique: {
|
|
929
|
+
title: "Whether this foreign key has a unique constraint",
|
|
930
|
+
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.",
|
|
931
|
+
type: "boolean"
|
|
932
|
+
},
|
|
933
|
+
nullable: {
|
|
934
|
+
title: "Whether this foreign key can be null (optional relationship)",
|
|
935
|
+
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.",
|
|
936
|
+
type: "boolean"
|
|
937
|
+
}
|
|
938
|
+
},
|
|
939
|
+
required: [
|
|
940
|
+
"name",
|
|
941
|
+
"type",
|
|
942
|
+
"description",
|
|
943
|
+
"relation",
|
|
944
|
+
"unique",
|
|
945
|
+
"nullable"
|
|
946
|
+
]
|
|
947
|
+
},
|
|
948
|
+
"AutoBePrisma.IPlainField": {
|
|
949
|
+
description: "Interface representing a regular data field that stores business\ninformation.\n\nThese fields contain the actual business data like names, amounts,\ntimestamps, flags, descriptions, and other domain-specific information.",
|
|
950
|
+
type: "object",
|
|
951
|
+
properties: {
|
|
952
|
+
name: {
|
|
953
|
+
title: "Name of the field in the database table",
|
|
954
|
+
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_]*$",
|
|
955
|
+
type: "string"
|
|
956
|
+
},
|
|
957
|
+
type: {
|
|
958
|
+
title: "Data type of the field for Prisma schema generation",
|
|
959
|
+
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",
|
|
960
|
+
type: "string",
|
|
961
|
+
"enum": [
|
|
962
|
+
"string",
|
|
963
|
+
"boolean",
|
|
964
|
+
"uuid",
|
|
965
|
+
"uri",
|
|
966
|
+
"int",
|
|
967
|
+
"double",
|
|
968
|
+
"datetime"
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
description: {
|
|
972
|
+
title: "Description explaining the business purpose and usage of this field",
|
|
973
|
+
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.\"",
|
|
974
|
+
type: "string"
|
|
975
|
+
},
|
|
976
|
+
nullable: {
|
|
977
|
+
title: "Whether this field can contain null values",
|
|
978
|
+
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.",
|
|
979
|
+
type: "boolean"
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
required: [
|
|
983
|
+
"name",
|
|
984
|
+
"type",
|
|
985
|
+
"description",
|
|
986
|
+
"nullable"
|
|
987
|
+
]
|
|
988
|
+
},
|
|
989
|
+
"AutoBePrisma.IUniqueIndex": {
|
|
990
|
+
description: "Interface representing a unique index constraint on one or more fields.\n\nUnique indexes enforce data integrity by ensuring no duplicate values exist\nfor the specified field combination. Essential for business rules that\nrequire uniqueness like email addresses, codes, or composite keys.",
|
|
991
|
+
type: "object",
|
|
992
|
+
properties: {
|
|
993
|
+
fieldNames: {
|
|
994
|
+
title: "Array of field names that together form the unique constraint",
|
|
995
|
+
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",
|
|
996
|
+
type: "array",
|
|
997
|
+
items: {
|
|
998
|
+
type: "string"
|
|
1547
999
|
}
|
|
1548
1000
|
},
|
|
1549
|
-
|
|
1550
|
-
"
|
|
1551
|
-
|
|
1552
|
-
"
|
|
1553
|
-
"
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1001
|
+
unique: {
|
|
1002
|
+
title: "Explicit marker indicating this is a unique index",
|
|
1003
|
+
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\".",
|
|
1004
|
+
type: "boolean",
|
|
1005
|
+
"enum": [
|
|
1006
|
+
true
|
|
1007
|
+
]
|
|
1008
|
+
}
|
|
1009
|
+
},
|
|
1010
|
+
required: [
|
|
1011
|
+
"fieldNames",
|
|
1012
|
+
"unique"
|
|
1013
|
+
]
|
|
1014
|
+
},
|
|
1015
|
+
"AutoBePrisma.IPlainIndex": {
|
|
1016
|
+
description: "Interface representing a regular (non-unique) index for query performance.\n\nRegular indexes speed up database queries by creating optimized data\nstructures for common search patterns. Essential for foreign keys, date\nranges, and frequently filtered fields.",
|
|
1017
|
+
type: "object",
|
|
1018
|
+
properties: {
|
|
1019
|
+
fieldNames: {
|
|
1020
|
+
title: "Array of field names to include in the performance index",
|
|
1021
|
+
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",
|
|
1022
|
+
type: "array",
|
|
1023
|
+
items: {
|
|
1024
|
+
type: "string"
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1562
1027
|
},
|
|
1563
|
-
|
|
1028
|
+
required: [
|
|
1029
|
+
"fieldNames"
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
"AutoBePrisma.IGinIndex": {
|
|
1033
|
+
description: "Interface representing a GIN (Generalized Inverted Index) for full-text\nsearch.\n\nGIN indexes enable advanced PostgreSQL text search capabilities including\nfuzzy matching and partial text search using trigram operations. Essential\nfor user-facing search features on text content.",
|
|
1034
|
+
type: "object",
|
|
1035
|
+
properties: {
|
|
1036
|
+
fieldName: {
|
|
1037
|
+
title: "Name of the text field to index for full-text search capabilities",
|
|
1038
|
+
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.",
|
|
1039
|
+
type: "string"
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
required: [
|
|
1043
|
+
"fieldName"
|
|
1044
|
+
]
|
|
1564
1045
|
}
|
|
1565
|
-
}
|
|
1566
|
-
required: [
|
|
1567
|
-
"planning",
|
|
1568
|
-
"models"
|
|
1569
|
-
],
|
|
1570
|
-
description: "Current Type: {@link IModifyPrismaSchemaFilesProps}",
|
|
1571
|
-
additionalProperties: false
|
|
1046
|
+
}
|
|
1572
1047
|
},
|
|
1573
1048
|
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",
|
|
1574
1049
|
validate: (() => { const _io0 = input => "string" === typeof input.planning && (Array.isArray(input.models) && input.models.every(elem => "object" === typeof elem && null !== elem && _io1(elem))); 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))); const _io2 = input => "string" === typeof input.name && RegExp("^[a-z][a-z0-9_]*$").test(input.name) && "uuid" === input.type && "string" === typeof input.description; 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; const _io4 = input => "string" === typeof input.name && RegExp("^[a-zA-Z_][a-zA-Z0-9_]*$").test(input.name) && "string" === typeof input.targetModel; 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; 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; const _io7 = input => Array.isArray(input.fieldNames) && (1 <= input.fieldNames.length && __typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) && input.fieldNames.every(elem => "string" === typeof elem)); const _io8 = input => "string" === typeof input.fieldName; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.planning || _report(_exceptionable, {
|
|
@@ -1854,5 +1329,9 @@ const collection = {
|
|
|
1854
1329
|
}
|
|
1855
1330
|
]
|
|
1856
1331
|
},
|
|
1332
|
+
claude,
|
|
1333
|
+
llama: claude,
|
|
1334
|
+
deepseek: claude,
|
|
1335
|
+
"3.1": claude,
|
|
1857
1336
|
};
|
|
1858
1337
|
//# sourceMappingURL=orchestratePrismaCorrect.js.map
|