@autobe/agent 0.28.1 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (543) hide show
  1. package/lib/AutoBeAgent.js +5 -4
  2. package/lib/AutoBeAgent.js.map +1 -1
  3. package/lib/AutoBeMockAgent.js +1 -0
  4. package/lib/AutoBeMockAgent.js.map +1 -1
  5. package/lib/constants/AutoBeConfigConstant.d.ts +3 -1
  6. package/lib/constants/AutoBeSystemPromptConstant.d.ts +39 -26
  7. package/lib/constants/AutoBeSystemPromptConstant.js.map +1 -1
  8. package/lib/context/AutoBeContext.d.ts +1 -1
  9. package/lib/factory/createAutoBeContext.js +13 -13
  10. package/lib/factory/createAutoBeContext.js.map +1 -1
  11. package/lib/index.mjs +43499 -23744
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +7 -2
  14. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js +11 -21
  15. package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -1
  16. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.d.ts +2 -2
  17. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -5
  18. package/lib/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
  19. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.d.ts +2 -2
  20. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +53 -50
  21. package/lib/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
  22. package/lib/orchestrate/analyze/orchestrateAnalyze.js +2 -2
  23. package/lib/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
  24. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js +855 -258
  25. package/lib/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
  26. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js +2 -14
  27. package/lib/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
  28. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js +2 -9
  29. package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
  30. package/lib/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.d.ts +110 -36
  31. package/lib/orchestrate/common/AutoBePreliminaryController.d.ts +40 -0
  32. package/lib/orchestrate/common/AutoBePreliminaryController.js +97 -0
  33. package/lib/orchestrate/common/AutoBePreliminaryController.js.map +1 -0
  34. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.d.ts +8 -0
  35. package/lib/orchestrate/{realize/histories/transformRealizeCorrectCastingHistories.js → common/histories/transformCommonCorrectCastingHistory.js} +16 -13
  36. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistory.js.map +1 -0
  37. package/lib/orchestrate/common/histories/transformPreliminaryHistory.d.ts +4 -0
  38. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js +285 -0
  39. package/lib/orchestrate/common/histories/transformPreliminaryHistory.js.map +1 -0
  40. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.d.ts → transformPreviousAndLatestCorrectHistory.d.ts} +1 -1
  41. package/lib/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.js → transformPreviousAndLatestCorrectHistory.js} +4 -4
  42. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistory.js.map +1 -0
  43. package/lib/orchestrate/common/internal/complementPreliminaryCollection.d.ts +7 -0
  44. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js +99 -0
  45. package/lib/orchestrate/common/internal/complementPreliminaryCollection.js.map +1 -0
  46. package/lib/orchestrate/common/internal/createPreliminaryCollection.d.ts +3 -0
  47. package/lib/orchestrate/common/internal/createPreliminaryCollection.js +20 -0
  48. package/lib/orchestrate/common/internal/createPreliminaryCollection.js.map +1 -0
  49. package/lib/orchestrate/common/internal/validatePreliminary.d.ts +5 -0
  50. package/lib/orchestrate/common/internal/validatePreliminary.js +217 -0
  51. package/lib/orchestrate/common/internal/validatePreliminary.js.map +1 -0
  52. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js +10 -22
  53. package/lib/orchestrate/common/orchestrateCommonCorrectCasting.js.map +1 -1
  54. package/lib/orchestrate/common/orchestratePreliminary.d.ts +12 -0
  55. package/lib/orchestrate/common/orchestratePreliminary.js +231 -0
  56. package/lib/orchestrate/common/orchestratePreliminary.js.map +1 -0
  57. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.d.ts +16 -0
  58. package/lib/orchestrate/{realize/structures/IAutoBeRealizeAuthorizationApplication.js → common/structures/AutoBePreliminaryRequest.js} +1 -1
  59. package/lib/orchestrate/common/structures/AutoBePreliminaryRequest.js.map +1 -0
  60. package/lib/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.d.ts +1 -4
  61. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.d.ts +9 -0
  62. package/lib/orchestrate/{interface/structures/IAutoBeInterfacePrerequisitesApplication.js → common/structures/IAutoBeOrchestrateResult.js} +1 -1
  63. package/lib/orchestrate/common/structures/IAutoBeOrchestrateResult.js.map +1 -0
  64. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.d.ts +8 -0
  65. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js → common/structures/IAutoBePreliminaryCollection.js} +1 -1
  66. package/lib/orchestrate/common/structures/IAutoBePreliminaryCollection.js.map +1 -0
  67. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.d.ts +27 -0
  68. package/lib/orchestrate/{interface/structures/IAutoBeInterfaceOperationsReviewApplication.js → common/structures/IAutoBePreliminaryGetAnalysisFiles.js} +1 -1
  69. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.js.map +1 -0
  70. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.d.ts +28 -0
  71. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js +3 -0
  72. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.js.map +1 -0
  73. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.d.ts +27 -0
  74. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js +3 -0
  75. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.js.map +1 -0
  76. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.d.ts +27 -0
  77. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js +3 -0
  78. package/lib/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.js.map +1 -0
  79. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.d.ts +10 -0
  80. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js +70 -0
  81. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.js.map +1 -0
  82. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.d.ts +3 -0
  83. package/lib/orchestrate/interface/histories/{transformInterfaceCommonHistories.js → transformInterfaceCommonHistory.js} +4 -4
  84. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistory.js.map +1 -0
  85. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.d.ts +9 -0
  86. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js +60 -0
  87. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistory.js.map +1 -0
  88. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.d.ts +12 -0
  89. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js +63 -0
  90. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistory.js.map +1 -0
  91. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.d.ts +7 -0
  92. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js +36 -0
  93. package/lib/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.js.map +1 -0
  94. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.d.ts +6 -0
  95. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js +68 -0
  96. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistory.js.map +1 -0
  97. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.d.ts +9 -0
  98. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js +72 -0
  99. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistory.js.map +1 -0
  100. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.d.ts +7 -0
  101. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js +38 -0
  102. package/lib/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.js.map +1 -0
  103. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.d.ts +8 -0
  104. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js +73 -0
  105. package/lib/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.js.map +1 -0
  106. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.d.ts +11 -0
  107. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js +95 -0
  108. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistory.js.map +1 -0
  109. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.d.ts +5 -0
  110. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js +54 -0
  111. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.js.map +1 -0
  112. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.d.ts +12 -0
  113. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js +75 -0
  114. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.js.map +1 -0
  115. package/lib/orchestrate/interface/orchestrateInterface.js +90 -46
  116. package/lib/orchestrate/interface/orchestrateInterface.js.map +1 -1
  117. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.d.ts +6 -0
  118. package/lib/orchestrate/interface/{orchestrateInterfaceAuthorizations.js → orchestrateInterfaceAuthorization.js} +1370 -226
  119. package/lib/orchestrate/interface/orchestrateInterfaceAuthorization.js.map +1 -0
  120. package/lib/orchestrate/interface/orchestrateInterfaceComplement.d.ts +4 -3
  121. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js +2807 -532
  122. package/lib/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
  123. package/lib/orchestrate/interface/{orchestrateInterfaceEndpoints.d.ts → orchestrateInterfaceEndpoint.d.ts} +1 -1
  124. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js +1356 -0
  125. package/lib/orchestrate/interface/orchestrateInterfaceEndpoint.js.map +1 -0
  126. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.d.ts +4 -0
  127. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js +1337 -0
  128. package/lib/orchestrate/interface/orchestrateInterfaceEndpointReview.js.map +1 -0
  129. package/lib/orchestrate/interface/{orchestrateInterfaceGroups.d.ts → orchestrateInterfaceGroup.d.ts} +1 -2
  130. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js +621 -0
  131. package/lib/orchestrate/interface/orchestrateInterfaceGroup.js.map +1 -0
  132. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.d.ts → orchestrateInterfaceOperation.d.ts} +1 -2
  133. package/lib/orchestrate/interface/{orchestrateInterfaceOperations.js → orchestrateInterfaceOperation.js} +1275 -216
  134. package/lib/orchestrate/interface/orchestrateInterfaceOperation.js.map +1 -0
  135. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.d.ts +4 -0
  136. package/lib/orchestrate/interface/{orchestrateInterfaceOperationsReview.js → orchestrateInterfaceOperationReview.js} +1421 -247
  137. package/lib/orchestrate/interface/orchestrateInterfaceOperationReview.js.map +1 -0
  138. package/lib/orchestrate/interface/{orchestrateInterfacePrerequisites.d.ts → orchestrateInterfacePrerequisite.d.ts} +1 -1
  139. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js +2159 -0
  140. package/lib/orchestrate/interface/orchestrateInterfacePrerequisite.js.map +1 -0
  141. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.d.ts → orchestrateInterfaceSchema.d.ts} +1 -2
  142. package/lib/orchestrate/interface/{orchestrateInterfaceSchemas.js → orchestrateInterfaceSchema.js} +2550 -546
  143. package/lib/orchestrate/interface/orchestrateInterfaceSchema.js.map +1 -0
  144. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js +7 -17
  145. package/lib/orchestrate/interface/orchestrateInterfaceSchemaRename.js.map +1 -1
  146. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.d.ts +1 -0
  147. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js +2823 -548
  148. package/lib/orchestrate/interface/orchestrateInterfaceSchemaReview.js.map +1 -1
  149. package/lib/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.d.ts +56 -5
  150. package/lib/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.d.ts +57 -10
  151. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.d.ts +55 -10
  152. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.d.ts +96 -0
  153. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js +3 -0
  154. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.js.map +1 -0
  155. package/lib/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.d.ts +6 -82
  156. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +58 -13
  157. package/lib/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.d.ts → IAutoBeInterfaceOperationReviewApplication.d.ts} +58 -28
  158. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js +3 -0
  159. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationReviewApplication.js.map +1 -0
  160. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.d.ts +98 -0
  161. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js +3 -0
  162. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.js.map +1 -0
  163. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.d.ts +56 -15
  164. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.d.ts +62 -22
  165. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.d.ts +60 -21
  166. package/lib/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.d.ts +61 -19
  167. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js +29 -23
  168. package/lib/orchestrate/interface/utils/JsonSchemaFactory.js.map +1 -1
  169. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js +67 -61
  170. package/lib/orchestrate/interface/utils/JsonSchemaNamingConvention.js.map +1 -1
  171. package/lib/orchestrate/interface/utils/JsonSchemaValidator.d.ts +2 -1
  172. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js +52 -25
  173. package/lib/orchestrate/interface/utils/JsonSchemaValidator.js.map +1 -1
  174. package/lib/orchestrate/interface/utils/OperationValidator.js +59 -1
  175. package/lib/orchestrate/interface/utils/OperationValidator.js.map +1 -1
  176. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.d.ts +6 -0
  177. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js +98 -0
  178. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistory.js.map +1 -0
  179. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.d.ts +7 -0
  180. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js +31 -0
  181. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistory.js.map +1 -0
  182. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.d.ts +7 -0
  183. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js +38 -0
  184. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistory.js.map +1 -0
  185. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.d.ts +8 -0
  186. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js +79 -0
  187. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistory.js.map +1 -0
  188. package/lib/orchestrate/prisma/orchestratePrisma.js +9 -6
  189. package/lib/orchestrate/prisma/orchestratePrisma.js.map +1 -1
  190. package/lib/orchestrate/prisma/orchestratePrismaComponent.d.ts +1 -1
  191. package/lib/orchestrate/prisma/orchestratePrismaComponent.js +8 -14
  192. package/lib/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
  193. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js +2863 -1543
  194. package/lib/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
  195. package/lib/orchestrate/prisma/orchestratePrismaReview.d.ts +1 -1
  196. package/lib/orchestrate/prisma/orchestratePrismaReview.js +2886 -1566
  197. package/lib/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
  198. package/lib/orchestrate/prisma/{orchestratePrismaSchemas.d.ts → orchestratePrismaSchema.d.ts} +1 -1
  199. package/lib/orchestrate/prisma/orchestratePrismaSchema.js +3068 -0
  200. package/lib/orchestrate/prisma/orchestratePrismaSchema.js.map +1 -0
  201. package/lib/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.d.ts +74 -76
  202. package/lib/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.d.ts +90 -72
  203. package/lib/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.d.ts +89 -66
  204. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.d.ts +9 -0
  205. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js +79 -0
  206. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.js.map +1 -0
  207. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.d.ts +7 -0
  208. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js +41 -0
  209. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.js.map +1 -0
  210. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.d.ts +12 -0
  211. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js +67 -0
  212. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.js.map +1 -0
  213. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.d.ts +18 -0
  214. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js +54 -0
  215. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistory.js.map +1 -0
  216. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.d.ts +4 -2
  217. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js +140 -106
  218. package/lib/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
  219. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.d.ts +3 -0
  220. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js +23 -0
  221. package/lib/orchestrate/realize/histories/transformRealizeWriteMembershipHistory.js.map +1 -0
  222. package/lib/orchestrate/realize/orchestrateRealize.js +4 -4
  223. package/lib/orchestrate/realize/orchestrateRealize.js.map +1 -1
  224. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.d.ts +5 -1
  225. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +1288 -572
  226. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
  227. package/lib/orchestrate/realize/{orchestrateRealizeAuthorization.d.ts → orchestrateRealizeAuthorizationWrite.d.ts} +1 -1
  228. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js +1410 -0
  229. package/lib/orchestrate/realize/orchestrateRealizeAuthorizationWrite.js.map +1 -0
  230. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js +664 -140
  231. package/lib/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
  232. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js +20 -65
  233. package/lib/orchestrate/realize/orchestrateRealizeCorrectCasting.js.map +1 -1
  234. package/lib/orchestrate/realize/orchestrateRealizeWrite.js +660 -135
  235. package/lib/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
  236. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.d.ts +79 -19
  237. package/lib/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.d.ts → IAutoBeRealizeAuthorizationWriteApplication.d.ts} +60 -27
  238. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js +3 -0
  239. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationWriteApplication.js.map +1 -0
  240. package/lib/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.d.ts +54 -5
  241. package/lib/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.d.ts +6 -14
  242. package/lib/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.d.ts +54 -6
  243. package/lib/orchestrate/realize/utils/generateRealizeScenario.d.ts +1 -3
  244. package/lib/orchestrate/realize/utils/generateRealizeScenario.js +1 -7
  245. package/lib/orchestrate/realize/utils/generateRealizeScenario.js.map +1 -1
  246. package/lib/orchestrate/test/histories/transformTestCorrectHistories.d.ts +3 -3
  247. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js +23 -20
  248. package/lib/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
  249. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.d.ts +4 -0
  250. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js +36 -0
  251. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.js.map +1 -0
  252. package/lib/orchestrate/test/histories/transformTestScenarioHistory.d.ts +11 -0
  253. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js +95 -0
  254. package/lib/orchestrate/test/histories/transformTestScenarioHistory.js.map +1 -0
  255. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.d.ts +10 -0
  256. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js +67 -0
  257. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistory.js.map +1 -0
  258. package/lib/orchestrate/test/histories/{transformTestWriteHistories.d.ts → transformTestWriteHistory.d.ts} +4 -4
  259. package/lib/orchestrate/test/histories/{transformTestWriteHistories.js → transformTestWriteHistory.js} +79 -76
  260. package/lib/orchestrate/test/histories/transformTestWriteHistory.js.map +1 -0
  261. package/lib/orchestrate/test/orchestrateTestCorrect.js +13 -26
  262. package/lib/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
  263. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js +3 -15
  264. package/lib/orchestrate/test/orchestrateTestCorrectInvalidRequest.js.map +1 -1
  265. package/lib/orchestrate/test/orchestrateTestScenario.d.ts +1 -1
  266. package/lib/orchestrate/test/orchestrateTestScenario.js +1370 -316
  267. package/lib/orchestrate/test/orchestrateTestScenario.js.map +1 -1
  268. package/lib/orchestrate/test/orchestrateTestScenarioReview.d.ts +5 -3
  269. package/lib/orchestrate/test/orchestrateTestScenarioReview.js +1067 -288
  270. package/lib/orchestrate/test/orchestrateTestScenarioReview.js.map +1 -1
  271. package/lib/orchestrate/test/orchestrateTestWrite.js +8 -15
  272. package/lib/orchestrate/test/orchestrateTestWrite.js.map +1 -1
  273. package/lib/orchestrate/test/structures/IAutoBeTestScenarioApplication.d.ts +66 -4
  274. package/lib/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.d.ts +82 -14
  275. package/lib/structures/IAutoBeOrchestrateHistory.d.ts +5 -0
  276. package/lib/structures/IAutoBeOrchestrateHistory.js +3 -0
  277. package/lib/structures/IAutoBeOrchestrateHistory.js.map +1 -0
  278. package/lib/utils/executeCachedBatch.d.ts +5 -1
  279. package/lib/utils/executeCachedBatch.js +23 -5
  280. package/lib/utils/executeCachedBatch.js.map +1 -1
  281. package/lib/utils/validateEmptyCode.js +2 -2
  282. package/lib/utils/validateEmptyCode.js.map +1 -1
  283. package/package.json +8 -6
  284. package/src/AutoBeAgent.ts +2 -1
  285. package/src/AutoBeMockAgent.ts +1 -0
  286. package/src/constants/AutoBeConfigConstant.ts +2 -0
  287. package/src/constants/AutoBeSystemPromptConstant.ts +39 -26
  288. package/src/context/AutoBeContext.ts +1 -1
  289. package/src/factory/createAutoBeContext.ts +10 -5
  290. package/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.ts +17 -28
  291. package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +12 -6
  292. package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +62 -61
  293. package/src/orchestrate/analyze/orchestrateAnalyze.ts +2 -0
  294. package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +97 -48
  295. package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +3 -16
  296. package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +1 -2
  297. package/src/orchestrate/analyze/structures/IAutoBeAnalyzeReviewApplication.ts +114 -36
  298. package/src/orchestrate/common/AutoBePreliminaryController.ts +161 -0
  299. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistory.ts +32 -0
  300. package/src/orchestrate/common/histories/transformPreliminaryHistory.ts +383 -0
  301. package/src/orchestrate/common/histories/{transformPreviousAndLatestCorrectHistories.ts → transformPreviousAndLatestCorrectHistory.ts} +1 -1
  302. package/src/orchestrate/common/internal/complementPreliminaryCollection.ts +123 -0
  303. package/src/orchestrate/common/internal/createPreliminaryCollection.ts +32 -0
  304. package/src/orchestrate/common/internal/validatePreliminary.ts +315 -0
  305. package/src/orchestrate/common/orchestrateCommonCorrectCasting.ts +8 -15
  306. package/src/orchestrate/common/orchestratePreliminary.ts +361 -0
  307. package/src/orchestrate/common/structures/AutoBePreliminaryRequest.ts +18 -0
  308. package/src/orchestrate/common/structures/IAutoBeCommonCorrectCastingApplication.ts +1 -4
  309. package/src/orchestrate/common/structures/IAutoBeOrchestrateResult.ts +13 -0
  310. package/src/orchestrate/common/structures/IAutoBePreliminaryCollection.ts +9 -0
  311. package/src/orchestrate/common/structures/IAutoBePreliminaryGetAnalysisFiles.ts +29 -0
  312. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceOperations.ts +30 -0
  313. package/src/orchestrate/common/structures/IAutoBePreliminaryGetInterfaceSchemas.ts +29 -0
  314. package/src/orchestrate/common/structures/IAutoBePreliminaryGetPrismaSchemas.ts +29 -0
  315. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationHistory.ts +77 -0
  316. package/src/orchestrate/interface/histories/{transformInterfaceCommonHistories.ts → transformInterfaceCommonHistory.ts} +1 -1
  317. package/src/orchestrate/interface/histories/{transformInterfaceGroupHistories.ts → transformInterfaceComplementHistory.ts} +35 -21
  318. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistory.ts +74 -0
  319. package/src/orchestrate/interface/histories/transformInterfaceEndpointReviewHistory.ts +40 -0
  320. package/src/orchestrate/interface/histories/transformInterfaceGroupHistory.ts +72 -0
  321. package/src/orchestrate/interface/histories/transformInterfaceOperationHistory.ts +79 -0
  322. package/src/orchestrate/interface/histories/transformInterfaceOperationReviewHistory.ts +43 -0
  323. package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistory.ts +89 -0
  324. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistory.ts +105 -0
  325. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistory.ts +56 -0
  326. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistory.ts +88 -0
  327. package/src/orchestrate/interface/orchestrateInterface.ts +115 -51
  328. package/src/orchestrate/interface/{orchestrateInterfaceAuthorizations.ts → orchestrateInterfaceAuthorization.ts} +91 -67
  329. package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +174 -78
  330. package/src/orchestrate/interface/orchestrateInterfaceEndpoint.ts +207 -0
  331. package/src/orchestrate/interface/orchestrateInterfaceEndpointReview.ts +139 -0
  332. package/src/orchestrate/interface/orchestrateInterfaceGroup.ts +153 -0
  333. package/src/orchestrate/interface/{orchestrateInterfaceOperations.ts → orchestrateInterfaceOperation.ts} +109 -86
  334. package/src/orchestrate/interface/orchestrateInterfaceOperationReview.ts +186 -0
  335. package/src/orchestrate/interface/{orchestrateInterfacePrerequisites.ts → orchestrateInterfacePrerequisite.ts} +123 -58
  336. package/src/orchestrate/interface/{orchestrateInterfaceSchemas.ts → orchestrateInterfaceSchema.ts} +96 -90
  337. package/src/orchestrate/interface/orchestrateInterfaceSchemaRename.ts +10 -11
  338. package/src/orchestrate/interface/orchestrateInterfaceSchemaReview.ts +127 -60
  339. package/src/orchestrate/interface/structures/IAutoBeInterfaceAuthorizationsApplication.ts +63 -5
  340. package/src/orchestrate/interface/structures/IAutoBeInterfaceComplementApplication.ts +67 -12
  341. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointApplication.ts +63 -10
  342. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointReviewApplication.ts +106 -0
  343. package/src/orchestrate/interface/structures/IAutoBeInterfaceGroupApplication.ts +6 -84
  344. package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +65 -13
  345. package/src/orchestrate/interface/structures/{IAutoBeInterfaceOperationsReviewApplication.ts → IAutoBeInterfaceOperationReviewApplication.ts} +65 -30
  346. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisiteApplication.ts +111 -0
  347. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaApplication.ts +65 -15
  348. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaContentReviewApplication.ts +71 -24
  349. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaRelationReviewApplication.ts +68 -23
  350. package/src/orchestrate/interface/structures/IAutoBeInterfaceSchemaSecurityReviewApplication.ts +69 -21
  351. package/src/orchestrate/interface/utils/JsonSchemaFactory.ts +31 -23
  352. package/src/orchestrate/interface/utils/JsonSchemaNamingConvention.ts +73 -61
  353. package/src/orchestrate/interface/utils/JsonSchemaValidator.ts +53 -26
  354. package/src/orchestrate/interface/utils/OperationValidator.ts +69 -1
  355. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistory.ts +109 -0
  356. package/src/orchestrate/prisma/histories/{transformPrismaCorrectHistories.ts → transformPrismaCorrectHistory.ts} +13 -22
  357. package/src/orchestrate/prisma/histories/transformPrismaReviewHistory.ts +42 -0
  358. package/src/orchestrate/prisma/histories/{transformPrismaSchemaHistories.ts → transformPrismaSchemaHistory.ts} +7 -8
  359. package/src/orchestrate/prisma/orchestratePrisma.ts +12 -17
  360. package/src/orchestrate/prisma/orchestratePrismaComponent.ts +7 -15
  361. package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +129 -64
  362. package/src/orchestrate/prisma/orchestratePrismaReview.ts +115 -59
  363. package/src/orchestrate/prisma/{orchestratePrismaSchemas.ts → orchestratePrismaSchema.ts} +92 -60
  364. package/src/orchestrate/prisma/structures/IAutoBePrismaCorrectApplication.ts +81 -76
  365. package/src/orchestrate/prisma/structures/IAutoBePrismaReviewApplication.ts +97 -72
  366. package/src/orchestrate/prisma/structures/IAutoBePrismaSchemaApplication.ts +93 -66
  367. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistory.ts +89 -0
  368. package/src/orchestrate/realize/histories/transformRealizeAuthorizationWriteHistory.ts +45 -0
  369. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistory.ts +85 -0
  370. package/src/orchestrate/realize/histories/transformRealizeCorrectHistory.ts +77 -0
  371. package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +152 -121
  372. package/src/orchestrate/realize/histories/{transformRealizeWriteAuthorizationsHistories.ts → transformRealizeWriteMembershipHistory.ts} +2 -2
  373. package/src/orchestrate/realize/orchestrateRealize.ts +4 -3
  374. package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +155 -97
  375. package/src/orchestrate/realize/orchestrateRealizeAuthorizationWrite.ts +241 -0
  376. package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +88 -86
  377. package/src/orchestrate/realize/orchestrateRealizeCorrectCasting.ts +17 -56
  378. package/src/orchestrate/realize/orchestrateRealizeWrite.ts +82 -78
  379. package/src/orchestrate/realize/structures/IAutoBeRealizeAuthorizationCorrectApplication.ts +85 -22
  380. package/src/orchestrate/realize/structures/{IAutoBeRealizeAuthorizationApplication.ts → IAutoBeRealizeAuthorizationWriteApplication.ts} +64 -29
  381. package/src/orchestrate/realize/structures/IAutoBeRealizeCorrectApplication.ts +58 -5
  382. package/src/orchestrate/realize/structures/IAutoBeRealizeScenarioResult.ts +6 -19
  383. package/src/orchestrate/realize/structures/IAutoBeRealizeWriteApplication.ts +58 -6
  384. package/src/orchestrate/realize/utils/generateRealizeScenario.ts +2 -20
  385. package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +30 -30
  386. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistory.ts +40 -0
  387. package/src/orchestrate/test/histories/transformTestScenarioHistory.ts +116 -0
  388. package/src/orchestrate/test/histories/transformTestScenarioReviewHistory.ts +85 -0
  389. package/src/orchestrate/test/histories/transformTestWriteHistory.ts +169 -0
  390. package/src/orchestrate/test/orchestrateTestCorrect.ts +13 -19
  391. package/src/orchestrate/test/orchestrateTestCorrectInvalidRequest.ts +5 -12
  392. package/src/orchestrate/test/orchestrateTestScenario.ts +143 -83
  393. package/src/orchestrate/test/orchestrateTestScenarioReview.ts +93 -76
  394. package/src/orchestrate/test/orchestrateTestWrite.ts +7 -7
  395. package/src/orchestrate/test/structures/IAutoBeTestScenarioApplication.ts +74 -4
  396. package/src/orchestrate/test/structures/IAutoBeTestScenarioReviewApplication.ts +89 -14
  397. package/src/structures/IAutoBeOrchestrateHistory.ts +6 -0
  398. package/src/utils/executeCachedBatch.ts +33 -7
  399. package/src/utils/validateEmptyCode.ts +2 -2
  400. package/lib/factory/AutoBeFunctionCallingMetricFactory.d.ts +0 -7
  401. package/lib/factory/AutoBeFunctionCallingMetricFactory.js +0 -35
  402. package/lib/factory/AutoBeFunctionCallingMetricFactory.js.map +0 -1
  403. package/lib/factory/AutoBeProcessAggregateFactory.d.ts +0 -13
  404. package/lib/factory/AutoBeProcessAggregateFactory.js +0 -100
  405. package/lib/factory/AutoBeProcessAggregateFactory.js.map +0 -1
  406. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.d.ts +0 -8
  407. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js +0 -16
  408. package/lib/orchestrate/common/histories/transformCommonCorrectCastingHistories.js.map +0 -1
  409. package/lib/orchestrate/common/histories/transformPreviousAndLatestCorrectHistories.js.map +0 -1
  410. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.d.ts +0 -3
  411. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js +0 -62
  412. package/lib/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +0 -1
  413. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.d.ts +0 -8
  414. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +0 -68
  415. package/lib/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +0 -1
  416. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.d.ts +0 -3
  417. package/lib/orchestrate/interface/histories/transformInterfaceCommonHistories.js.map +0 -1
  418. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.d.ts +0 -9
  419. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js +0 -74
  420. package/lib/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +0 -1
  421. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.d.ts +0 -10
  422. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +0 -61
  423. package/lib/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +0 -1
  424. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.d.ts +0 -4
  425. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js +0 -34
  426. package/lib/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.js.map +0 -1
  427. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.d.ts +0 -6
  428. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js +0 -52
  429. package/lib/orchestrate/interface/histories/transformInterfaceGroupHistories.js.map +0 -1
  430. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.d.ts +0 -8
  431. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js +0 -71
  432. package/lib/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +0 -1
  433. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.d.ts +0 -5
  434. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +0 -36
  435. package/lib/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +0 -1
  436. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.d.ts +0 -3
  437. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js +0 -102
  438. package/lib/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.js.map +0 -1
  439. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.d.ts +0 -9
  440. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +0 -74
  441. package/lib/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +0 -1
  442. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.d.ts +0 -5
  443. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js +0 -51
  444. package/lib/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.js.map +0 -1
  445. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.d.ts +0 -11
  446. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js +0 -81
  447. package/lib/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.js.map +0 -1
  448. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.d.ts +0 -4
  449. package/lib/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +0 -1
  450. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js +0 -508
  451. package/lib/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +0 -1
  452. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.d.ts +0 -4
  453. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js +0 -488
  454. package/lib/orchestrate/interface/orchestrateInterfaceEndpointsReview.js.map +0 -1
  455. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js +0 -458
  456. package/lib/orchestrate/interface/orchestrateInterfaceGroups.js.map +0 -1
  457. package/lib/orchestrate/interface/orchestrateInterfaceOperations.js.map +0 -1
  458. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.d.ts +0 -4
  459. package/lib/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +0 -1
  460. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js +0 -917
  461. package/lib/orchestrate/interface/orchestrateInterfacePrerequisites.js.map +0 -1
  462. package/lib/orchestrate/interface/orchestrateInterfaceSchemas.js.map +0 -1
  463. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.d.ts +0 -60
  464. package/lib/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.js.map +0 -1
  465. package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.js.map +0 -1
  466. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.d.ts +0 -52
  467. package/lib/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.js.map +0 -1
  468. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.d.ts +0 -6
  469. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +0 -95
  470. package/lib/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +0 -1
  471. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.d.ts +0 -3
  472. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +0 -41
  473. package/lib/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +0 -1
  474. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.d.ts +0 -8
  475. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js +0 -62
  476. package/lib/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +0 -1
  477. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.d.ts +0 -8
  478. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +0 -78
  479. package/lib/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +0 -1
  480. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js +0 -1678
  481. package/lib/orchestrate/prisma/orchestratePrismaSchemas.js.map +0 -1
  482. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.d.ts +0 -5
  483. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js +0 -44
  484. package/lib/orchestrate/realize/histories/transformRealizeAuthorization.js.map +0 -1
  485. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.d.ts +0 -5
  486. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +0 -82
  487. package/lib/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +0 -1
  488. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.d.ts +0 -5
  489. package/lib/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.js.map +0 -1
  490. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.d.ts +0 -13
  491. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js +0 -29
  492. package/lib/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +0 -1
  493. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.d.ts +0 -3
  494. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +0 -23
  495. package/lib/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +0 -1
  496. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js +0 -710
  497. package/lib/orchestrate/realize/orchestrateRealizeAuthorization.js.map +0 -1
  498. package/lib/orchestrate/realize/structures/IAutoBeRealizeAuthorizationApplication.js.map +0 -1
  499. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.d.ts +0 -4
  500. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js +0 -33
  501. package/lib/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.js.map +0 -1
  502. package/lib/orchestrate/test/histories/transformTestScenarioHistories.d.ts +0 -10
  503. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js +0 -101
  504. package/lib/orchestrate/test/histories/transformTestScenarioHistories.js.map +0 -1
  505. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.d.ts +0 -8
  506. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js +0 -72
  507. package/lib/orchestrate/test/histories/transformTestScenarioReviewHistories.js.map +0 -1
  508. package/lib/orchestrate/test/histories/transformTestWriteHistories.js.map +0 -1
  509. package/lib/utils/TokenUsageComputer.d.ts +0 -5
  510. package/lib/utils/TokenUsageComputer.js +0 -29
  511. package/lib/utils/TokenUsageComputer.js.map +0 -1
  512. package/src/factory/AutoBeFunctionCallingMetricFactory.ts +0 -44
  513. package/src/factory/AutoBeProcessAggregateFactory.ts +0 -141
  514. package/src/orchestrate/common/histories/transformCommonCorrectCastingHistories.ts +0 -25
  515. package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +0 -72
  516. package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +0 -75
  517. package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +0 -82
  518. package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +0 -72
  519. package/src/orchestrate/interface/histories/transformInterfaceEndpointsReviewHistories.ts +0 -40
  520. package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +0 -78
  521. package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +0 -44
  522. package/src/orchestrate/interface/histories/transformInterfacePrerequisitesHistories.ts +0 -118
  523. package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +0 -80
  524. package/src/orchestrate/interface/histories/transformInterfaceSchemaRenameHistories.ts +0 -55
  525. package/src/orchestrate/interface/histories/transformInterfaceSchemaReviewHistories.ts +0 -90
  526. package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +0 -152
  527. package/src/orchestrate/interface/orchestrateInterfaceEndpointsReview.ts +0 -98
  528. package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +0 -91
  529. package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +0 -157
  530. package/src/orchestrate/interface/structures/IAutoBeInterfaceEndpointsReviewApplication.ts +0 -65
  531. package/src/orchestrate/interface/structures/IAutoBeInterfacePrerequisitesApplication.ts +0 -58
  532. package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +0 -104
  533. package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +0 -69
  534. package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +0 -52
  535. package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +0 -95
  536. package/src/orchestrate/realize/histories/transformRealizeCorrectCastingHistories.ts +0 -30
  537. package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +0 -46
  538. package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +0 -185
  539. package/src/orchestrate/test/histories/transformTestCorrectInvalidRequestHistories.ts +0 -39
  540. package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +0 -125
  541. package/src/orchestrate/test/histories/transformTestScenarioReviewHistories.ts +0 -89
  542. package/src/orchestrate/test/histories/transformTestWriteHistories.ts +0 -172
  543. package/src/utils/TokenUsageComputer.ts +0 -35
@@ -1,1678 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.orchestratePrismaSchemas = orchestratePrismaSchemas;
49
- const __typia_transform__isUniqueItems = __importStar(require("typia/lib/internal/_isUniqueItems.js"));
50
- const __typia_transform__validateReport = __importStar(require("typia/lib/internal/_validateReport.js"));
51
- const __typia_transform__llmApplicationFinalize = __importStar(require("typia/lib/internal/_llmApplicationFinalize.js"));
52
- const utils_1 = require("@autobe/utils");
53
- const typia_1 = __importDefault(require("typia"));
54
- const uuid_1 = require("uuid");
55
- const assertSchemaModel_1 = require("../../context/assertSchemaModel");
56
- const executeCachedBatch_1 = require("../../utils/executeCachedBatch");
57
- const transformPrismaSchemaHistories_1 = require("./histories/transformPrismaSchemaHistories");
58
- function orchestratePrismaSchemas(ctx, instruction, componentList) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- const start = new Date();
61
- const total = componentList
62
- .map((c) => c.tables.length)
63
- .reduce((x, y) => x + y, 0);
64
- const completed = { value: 0 };
65
- return yield (0, executeCachedBatch_1.executeCachedBatch)(componentList.map((component) => (promptCacheKey) => __awaiter(this, void 0, void 0, function* () {
66
- const otherTables = componentList
67
- .filter((y) => component !== y)
68
- .map((c) => c.tables)
69
- .flat();
70
- const event = yield process(ctx, {
71
- instruction,
72
- component,
73
- otherTables,
74
- start,
75
- total,
76
- completed,
77
- promptCacheKey,
78
- });
79
- ctx.dispatch(event);
80
- return event;
81
- })));
82
- });
83
- }
84
- function process(ctx, props) {
85
- return __awaiter(this, void 0, void 0, function* () {
86
- var _a, _b, _c, _d;
87
- const pointer = {
88
- value: null,
89
- };
90
- const { metric, tokenUsage } = yield ctx.conversate({
91
- source: "prismaSchema",
92
- histories: (0, transformPrismaSchemaHistories_1.transformPrismaSchemaHistories)({
93
- analysis: (_b = (_a = ctx
94
- .state()
95
- .analyze) === null || _a === void 0 ? void 0 : _a.files.map((file) => ({ [file.filename]: file.content })).reduce((acc, cur) => {
96
- return Object.assign(acc, cur);
97
- }, {})) !== null && _b !== void 0 ? _b : {},
98
- targetComponent: props.component,
99
- otherTables: props.otherTables,
100
- instruction: props.instruction,
101
- }),
102
- controller: createController(ctx, {
103
- targetComponent: props.component,
104
- otherTables: props.otherTables,
105
- build: (next) => {
106
- pointer.value = next;
107
- },
108
- }),
109
- enforceFunctionCall: true,
110
- promptCacheKey: props.promptCacheKey,
111
- message: "Make prisma schema file please",
112
- });
113
- if (pointer.value === null)
114
- throw new Error("Unreachable code: Prisma Schema not generated");
115
- return {
116
- type: "prismaSchema",
117
- id: (0, uuid_1.v7)(),
118
- created_at: props.start.toISOString(),
119
- plan: pointer.value.plan,
120
- models: pointer.value.models,
121
- file: {
122
- filename: props.component.filename,
123
- namespace: props.component.namespace,
124
- models: pointer.value.models,
125
- },
126
- metric,
127
- tokenUsage,
128
- completed: (props.completed.value += props.component.tables.length),
129
- total: props.total,
130
- step: (_d = (_c = ctx.state().analyze) === null || _c === void 0 ? void 0 : _c.step) !== null && _d !== void 0 ? _d : 0,
131
- };
132
- });
133
- }
134
- function createController(ctx, props) {
135
- (0, assertSchemaModel_1.assertSchemaModel)(ctx.model);
136
- const validate = (input) => {
137
- const result = (() => { const _io0 = input => "string" === typeof input.plan && (Array.isArray(input.models) && (1 <= input.models.length && 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 && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("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-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.plan || _report(_exceptionable, {
138
- path: _path + ".plan",
139
- expected: "string",
140
- value: input.plan
141
- }), (Array.isArray(input.models) || _report(_exceptionable, {
142
- path: _path + ".models",
143
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
144
- value: input.models
145
- })) && ((1 <= input.models.length || _report(_exceptionable, {
146
- path: _path + ".models",
147
- expected: "Array<> & MinItems<1>",
148
- value: input.models
149
- })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
150
- path: _path + ".models[" + _index9 + "]",
151
- expected: "AutoBePrisma.IModel",
152
- value: elem
153
- })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
154
- path: _path + ".models[" + _index9 + "]",
155
- expected: "AutoBePrisma.IModel",
156
- value: elem
157
- })).every(flag => flag)) || _report(_exceptionable, {
158
- path: _path + ".models",
159
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
160
- value: input.models
161
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
162
- path: _path + ".name",
163
- expected: "string & SnakeCasePattern",
164
- value: input.name
165
- })) || _report(_exceptionable, {
166
- path: _path + ".name",
167
- expected: "(string & SnakeCasePattern)",
168
- value: input.name
169
- }), "string" === typeof input.description || _report(_exceptionable, {
170
- path: _path + ".description",
171
- expected: "string",
172
- value: input.description
173
- }), "boolean" === typeof input.material || _report(_exceptionable, {
174
- path: _path + ".material",
175
- expected: "boolean",
176
- value: input.material
177
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
178
- path: _path + ".stance",
179
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
180
- value: input.stance
181
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
182
- path: _path + ".primaryField",
183
- expected: "AutoBePrisma.IPrimaryField",
184
- value: input.primaryField
185
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
186
- path: _path + ".primaryField",
187
- expected: "AutoBePrisma.IPrimaryField",
188
- value: input.primaryField
189
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
190
- path: _path + ".foreignFields",
191
- expected: "Array<AutoBePrisma.IForeignField>",
192
- value: input.foreignFields
193
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
194
- path: _path + ".foreignFields[" + _index10 + "]",
195
- expected: "AutoBePrisma.IForeignField",
196
- value: elem
197
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
198
- path: _path + ".foreignFields[" + _index10 + "]",
199
- expected: "AutoBePrisma.IForeignField",
200
- value: elem
201
- })).every(flag => flag) || _report(_exceptionable, {
202
- path: _path + ".foreignFields",
203
- expected: "Array<AutoBePrisma.IForeignField>",
204
- value: input.foreignFields
205
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
206
- path: _path + ".plainFields",
207
- expected: "Array<AutoBePrisma.IPlainField>",
208
- value: input.plainFields
209
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
210
- path: _path + ".plainFields[" + _index11 + "]",
211
- expected: "AutoBePrisma.IPlainField",
212
- value: elem
213
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
214
- path: _path + ".plainFields[" + _index11 + "]",
215
- expected: "AutoBePrisma.IPlainField",
216
- value: elem
217
- })).every(flag => flag) || _report(_exceptionable, {
218
- path: _path + ".plainFields",
219
- expected: "Array<AutoBePrisma.IPlainField>",
220
- value: input.plainFields
221
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
222
- path: _path + ".uniqueIndexes",
223
- expected: "Array<AutoBePrisma.IUniqueIndex>",
224
- value: input.uniqueIndexes
225
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
226
- path: _path + ".uniqueIndexes[" + _index12 + "]",
227
- expected: "AutoBePrisma.IUniqueIndex",
228
- value: elem
229
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
230
- path: _path + ".uniqueIndexes[" + _index12 + "]",
231
- expected: "AutoBePrisma.IUniqueIndex",
232
- value: elem
233
- })).every(flag => flag) || _report(_exceptionable, {
234
- path: _path + ".uniqueIndexes",
235
- expected: "Array<AutoBePrisma.IUniqueIndex>",
236
- value: input.uniqueIndexes
237
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
238
- path: _path + ".plainIndexes",
239
- expected: "Array<AutoBePrisma.IPlainIndex>",
240
- value: input.plainIndexes
241
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
242
- path: _path + ".plainIndexes[" + _index13 + "]",
243
- expected: "AutoBePrisma.IPlainIndex",
244
- value: elem
245
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
246
- path: _path + ".plainIndexes[" + _index13 + "]",
247
- expected: "AutoBePrisma.IPlainIndex",
248
- value: elem
249
- })).every(flag => flag) || _report(_exceptionable, {
250
- path: _path + ".plainIndexes",
251
- expected: "Array<AutoBePrisma.IPlainIndex>",
252
- value: input.plainIndexes
253
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
254
- path: _path + ".ginIndexes",
255
- expected: "Array<AutoBePrisma.IGinIndex>",
256
- value: input.ginIndexes
257
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
258
- path: _path + ".ginIndexes[" + _index14 + "]",
259
- expected: "AutoBePrisma.IGinIndex",
260
- value: elem
261
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
262
- path: _path + ".ginIndexes[" + _index14 + "]",
263
- expected: "AutoBePrisma.IGinIndex",
264
- value: elem
265
- })).every(flag => flag) || _report(_exceptionable, {
266
- path: _path + ".ginIndexes",
267
- expected: "Array<AutoBePrisma.IGinIndex>",
268
- value: input.ginIndexes
269
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
270
- path: _path + ".name",
271
- expected: "string & SnakeCasePattern",
272
- value: input.name
273
- })) || _report(_exceptionable, {
274
- path: _path + ".name",
275
- expected: "(string & SnakeCasePattern)",
276
- value: input.name
277
- }), "uuid" === input.type || _report(_exceptionable, {
278
- path: _path + ".type",
279
- expected: "\"uuid\"",
280
- value: input.type
281
- }), "string" === typeof input.description || _report(_exceptionable, {
282
- path: _path + ".description",
283
- expected: "string",
284
- value: input.description
285
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
286
- path: _path + ".name",
287
- expected: "string & SnakeCasePattern",
288
- value: input.name
289
- })) || _report(_exceptionable, {
290
- path: _path + ".name",
291
- expected: "(string & SnakeCasePattern)",
292
- value: input.name
293
- }), "uuid" === input.type || _report(_exceptionable, {
294
- path: _path + ".type",
295
- expected: "\"uuid\"",
296
- value: input.type
297
- }), "string" === typeof input.description || _report(_exceptionable, {
298
- path: _path + ".description",
299
- expected: "string",
300
- value: input.description
301
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
302
- path: _path + ".relation",
303
- expected: "AutoBePrisma.IRelation",
304
- value: input.relation
305
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
306
- path: _path + ".relation",
307
- expected: "AutoBePrisma.IRelation",
308
- value: input.relation
309
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
310
- path: _path + ".unique",
311
- expected: "boolean",
312
- value: input.unique
313
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
314
- path: _path + ".nullable",
315
- expected: "boolean",
316
- value: input.nullable
317
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
318
- path: _path + ".name",
319
- expected: "string & CamelCasePattern",
320
- value: input.name
321
- })) || _report(_exceptionable, {
322
- path: _path + ".name",
323
- expected: "(string & CamelCasePattern)",
324
- value: input.name
325
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
326
- path: _path + ".targetModel",
327
- expected: "string",
328
- value: input.targetModel
329
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
330
- path: _path + ".name",
331
- expected: "string & SnakeCasePattern",
332
- value: input.name
333
- })) || _report(_exceptionable, {
334
- path: _path + ".name",
335
- expected: "(string & SnakeCasePattern)",
336
- value: input.name
337
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
338
- path: _path + ".type",
339
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
340
- value: input.type
341
- }), "string" === typeof input.description || _report(_exceptionable, {
342
- path: _path + ".description",
343
- expected: "string",
344
- value: input.description
345
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
346
- path: _path + ".nullable",
347
- expected: "boolean",
348
- value: input.nullable
349
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
350
- path: _path + ".fieldNames",
351
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
352
- value: input.fieldNames
353
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
354
- path: _path + ".fieldNames",
355
- expected: "Array<> & MinItems<1>",
356
- value: input.fieldNames
357
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
358
- path: _path + ".fieldNames",
359
- expected: "Array<> & UniqueItems<true>",
360
- value: input.fieldNames
361
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
362
- path: _path + ".fieldNames[" + _index15 + "]",
363
- expected: "string",
364
- value: elem
365
- })).every(flag => flag)) || _report(_exceptionable, {
366
- path: _path + ".fieldNames",
367
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
368
- value: input.fieldNames
369
- }), true === input.unique || _report(_exceptionable, {
370
- path: _path + ".unique",
371
- expected: "true",
372
- value: input.unique
373
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
374
- path: _path + ".fieldNames",
375
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
376
- value: input.fieldNames
377
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
378
- path: _path + ".fieldNames",
379
- expected: "Array<> & MinItems<1>",
380
- value: input.fieldNames
381
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
382
- path: _path + ".fieldNames",
383
- expected: "Array<> & UniqueItems<true>",
384
- value: input.fieldNames
385
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
386
- path: _path + ".fieldNames[" + _index16 + "]",
387
- expected: "string",
388
- value: elem
389
- })).every(flag => flag)) || _report(_exceptionable, {
390
- path: _path + ".fieldNames",
391
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
392
- value: input.fieldNames
393
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
394
- path: _path + ".fieldName",
395
- expected: "string",
396
- value: input.fieldName
397
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
398
- if (false === __is(input)) {
399
- errors = [];
400
- _report = __typia_transform__validateReport._validateReport(errors);
401
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
402
- path: _path + "",
403
- expected: "IAutoBePrismaSchemaApplication.IProps",
404
- value: input
405
- })) && _vo0(input, _path + "", true) || _report(true, {
406
- path: _path + "",
407
- expected: "IAutoBePrismaSchemaApplication.IProps",
408
- value: input
409
- }))(input, "$input", true);
410
- const success = 0 === errors.length;
411
- return success ? {
412
- success,
413
- data: input
414
- } : {
415
- success,
416
- errors,
417
- data: input
418
- };
419
- }
420
- return {
421
- success: true,
422
- data: input
423
- };
424
- }; })()(input);
425
- if (result.success === false)
426
- return result;
427
- const actual = result.data.models;
428
- const expected = props.targetComponent.tables;
429
- const missed = expected.filter((x) => actual.some((a) => a.name === x) === false);
430
- if (missed.length === 0)
431
- return result;
432
- ctx.dispatch({
433
- type: "prismaInsufficient",
434
- id: (0, uuid_1.v7)(),
435
- created_at: new Date().toISOString(),
436
- component: props.targetComponent,
437
- actual,
438
- missed,
439
- });
440
- return {
441
- success: false,
442
- data: result.data,
443
- errors: [
444
- {
445
- path: "$input.models",
446
- value: result.data.models,
447
- expected: `Array<AutoBePrisma.IModel>`,
448
- description: utils_1.StringUtil.trim `
449
- You missed some tables from the current domain's component.
450
-
451
- Look at the following details to fix the schemas. Never forget to
452
- compose the \`missed\` tables at the next function calling.
453
-
454
- - filename: current domain's filename
455
- - namespace: current domain's namespace
456
- - expected: expected tables in the current domain
457
- - actual: actual tables you made
458
- - missed: tables you have missed, and you have to compose again
459
-
460
- ${JSON.stringify({
461
- filename: props.targetComponent.filename,
462
- namespace: props.targetComponent.namespace,
463
- expected,
464
- actual,
465
- missed,
466
- })}
467
- `,
468
- },
469
- ],
470
- };
471
- };
472
- const application = collection[ctx.model === "chatgpt" ? "chatgpt" : "claude"](validate);
473
- return {
474
- protocol: "class",
475
- name: "Prisma Generator",
476
- application,
477
- execute: {
478
- makePrismaSchemaFile: (next) => {
479
- props.build(next);
480
- },
481
- },
482
- };
483
- }
484
- const collection = {
485
- chatgpt: (validate) => (() => {
486
- const application = {
487
- model: "chatgpt",
488
- options: {
489
- reference: true,
490
- strict: false,
491
- separate: null
492
- },
493
- functions: [
494
- {
495
- name: "makePrismaSchemaFile",
496
- parameters: {
497
- description: " Properties containing the file\n\n------------------------------\n\nCurrent Type: {@link IAutoBePrismaSchemaApplication.IProps}",
498
- type: "object",
499
- properties: {
500
- plan: {
501
- description: "Strategic database design analysis and planning.\n\nAI analyzes the target component and business requirements to formulate a\ncomprehensive database design strategy. This planning phase is crucial\nfor creating well-structured, normalized schemas that align with business\nobjectives. The AI must define table structures, relationships, indexing\nstrategies, and data integrity constraints before proceeding to schema\nimplementation.\n\n**Key Considerations:**\n\n- **Assignment Validation**: Extract targetComponent.tables as the complete\n specification\n- **Table Count**: Must create exactly targetComponent.tables.length models\n- **Other Components**: Identify already-created tables for foreign key\n references only\n- **Normalization**: Strict adherence to 1NF, 2NF, 3NF principles\n- **Snapshot Architecture**: Design for historical data preservation and\n audit trails\n- **Junction Tables**: Plan M:N relationships with proper naming\n ({table1}_{table2})\n- **Materialized Views**: Identify needs for mv_ prefixed denormalized\n tables\n\nWorkflow: Component analysis \u2192 Strategic planning \u2192 Design rationale",
502
- type: "string"
503
- },
504
- models: {
505
- description: "Production-ready Prisma schema models generated based on the strategic\nplan.\n\nContains a structured Abstract Syntax Tree (AST) representation of all\ndatabase tables for the target component. Each model implements the\nplanned table structure, relationships, indexes, and constraints using\nthe AutoBePrisma.IModel interface. These models are designed to be\nproduction-ready from the initial generation, following all best\npractices and normalization principles.\n\n**Implementation Requirements:**\n\n- **Model Count**: Exactly matches targetComponent.tables.length (plus any\n junction tables)\n- **Table Names**: EXACT names from targetComponent.tables - no\n modifications allowed\n- **Primary Keys**: Always UUID type with field name \"id\"\n- **Foreign Keys**: Proper IRelation configurations for all relationships\n- **Business Fields**: Only raw data fields - no calculated or derived\n values\n- **Data Types**: Limited to: uuid, string, int, double, datetime, boolean,\n uri\n- **Relationships**: Correct patterns for 1:1, 1:N, and M:N relationships\n- **Indexes**:\n\n - UniqueIndexes: Business constraints and composite unique keys\n - PlainIndexes: Multi-column query optimization (never single FK indexes)\n - GinIndexes: Full-text search on appropriate string fields\n- **Materialized Views**: Tables prefixed with \"mv_\" have material flag set\n to true\n- **Documentation**: Comprehensive English descriptions with business\n context\n\n**Quality Standards:**\n\n- **Normalization**: Strict adherence to 3NF (Third Normal Form)\n- **No Denormalization**: Except in materialized views (mv_ tables)\n- **Referential Integrity**: All foreign keys reference valid existing\n tables\n- **Temporal Fields**: Consistent created_at, updated_at, deleted_at\n patterns\n- **Snapshot Support**: Proper historical data preservation where needed\n- **Performance Ready**: Optimized index strategy for expected query\n patterns\n\nThe generated models will undergo review by a separate specialized agent\nto ensure compliance with all requirements and best practices.\n\n\n@minItems 1",
506
- type: "array",
507
- items: {
508
- $ref: "#/$defs/AutoBePrisma.IModel"
509
- }
510
- }
511
- },
512
- required: [
513
- "plan",
514
- "models"
515
- ],
516
- additionalProperties: false,
517
- $defs: {
518
- "AutoBePrisma.IModel": {
519
- 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_)",
520
- type: "object",
521
- properties: {
522
- name: {
523
- description: "Name of the Prisma model (database table name).\n\nMUST use snake_case naming convention. Examples: \"shopping_customers\",\n\"shopping_sale_snapshots\", \"bbs_articles\" Materialized views use \"mv_\"\nprefix: \"mv_shopping_sale_last_snapshots\"\n\n\n@pattern ^[a-z][a-z0-9_]*$",
524
- type: "string"
525
- },
526
- description: {
527
- 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\n\n**IMPORTANT**: Description must be written in English. Example: \"Customer\ninformation, but not a person but a **connection** basis...\"",
528
- type: "string"
529
- },
530
- material: {
531
- 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",
532
- type: "boolean"
533
- },
534
- stance: {
535
- description: "Specifies the architectural stance of this model within the database\nsystem.\n\nThis property defines how the table positions itself in relation to other\ntables and what role it plays in the overall data architecture,\nparticularly for API endpoint generation and business logic\norganization.\n\n## Values:\n\n### `\"primary\"` - Main Business Entity\n\nTables that represent core business concepts and serve as the primary\nsubjects of user operations. These tables typically warrant independent\nCRUD API endpoints since users directly interact with these entities.\n\n**Key principle**: If users need to independently create, search, filter,\nor manage entities regardless of their parent context, the table should\nbe primary stance.\n\n**API Requirements:**\n\n- Independent creation endpoints (POST /articles, POST /comments)\n- Search and filtering capabilities across all instances\n- Direct update and delete operations\n- List/pagination endpoints for browsing\n\n**Why `bbs_article_comments` is primary, not subsidiary:**\n\nAlthough comments belong to articles, they require independent\nmanagement:\n\n- **Search across articles**: \"Find all comments by user X across all\n articles\"\n- **Moderation workflows**: \"List all pending comments for review\"\n- **User activity**: \"Show all comments made by this user\"\n- **Independent operations**: Users edit/delete their comments directly\n- **Notification systems**: \"Alert when any comment is posted\"\n\nIf comments were subsidiary, these operations would be impossible or\nrequire inefficient nested queries through parent articles.\n\n**Characteristics:**\n\n- Represents tangible business concepts that users manage\n- Serves as reference points for other tables\n- Requires comprehensive API operations (CREATE, READ, UPDATE, DELETE)\n- Forms the backbone of the application's business logic\n\n**Examples:**\n\n- `bbs_articles` - Forum posts that users create, edit, and manage\n- `bbs_article_comments` - User comments that require independent\n management\n\n### `\"subsidiary\"` - Supporting/Dependent Entity\n\nTables that exist to support primary entities but are not independently\nmanaged by users. These tables are typically managed through their parent\nentities and may not need standalone API endpoints.\n\n**Characteristics:**\n\n- Depends on primary or snapshot entities for context\n- Often managed indirectly through parent entity operations\n- May have limited or no independent API operations\n- Provides supporting data or relationships\n\n**Examples:**\n\n- `bbs_article_snapshot_files` - Files attached to article snapshots\n- `bbs_article_snapshot_tags` - Tags associated with article snapshots\n- `bbs_article_comment_snapshot_files` - Files attached to comment\n snapshots\n\n### `\"snapshot\"` - Historical/Versioning Entity\n\nTables that capture point-in-time states of primary entities for audit\ntrails, version control, or historical tracking. These tables record\nchanges but are rarely modified directly by users.\n\n**Characteristics:**\n\n- Captures historical states of primary entities\n- Typically append-only (rarely updated or deleted)\n- Referenced for audit trails and change tracking\n- Usually read-only from user perspective\n\n**Examples:**\n\n- `bbs_article_snapshots` - Historical states of articles\n- `bbs_article_comment_snapshots` - Comment modification history\n\n## API Generation Guidelines:\n\nThe stance property guides automatic API endpoint generation:\n\n- **`\"primary\"`** \u2192 Generate full CRUD endpoints based on business\n requirements\n- **`\"subsidiary\"`** \u2192 Evaluate carefully; often managed through parent\n entities\n- **`\"snapshot\"`** \u2192 Typically read-only endpoints for historical data\n access",
536
- type: "string",
537
- "enum": [
538
- "primary",
539
- "subsidiary",
540
- "snapshot"
541
- ]
542
- },
543
- primaryField: {
544
- 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.",
545
- $ref: "#/$defs/AutoBePrisma.IPrimaryField"
546
- },
547
- foreignFields: {
548
- 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.",
549
- type: "array",
550
- items: {
551
- $ref: "#/$defs/AutoBePrisma.IForeignField"
552
- }
553
- },
554
- plainFields: {
555
- 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.",
556
- type: "array",
557
- items: {
558
- $ref: "#/$defs/AutoBePrisma.IPlainField"
559
- }
560
- },
561
- uniqueIndexes: {
562
- 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).",
563
- type: "array",
564
- items: {
565
- $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
566
- }
567
- },
568
- plainIndexes: {
569
- 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.",
570
- type: "array",
571
- items: {
572
- $ref: "#/$defs/AutoBePrisma.IPlainIndex"
573
- }
574
- },
575
- ginIndexes: {
576
- 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.",
577
- type: "array",
578
- items: {
579
- $ref: "#/$defs/AutoBePrisma.IGinIndex"
580
- }
581
- }
582
- },
583
- required: [
584
- "name",
585
- "description",
586
- "material",
587
- "stance",
588
- "primaryField",
589
- "foreignFields",
590
- "plainFields",
591
- "uniqueIndexes",
592
- "plainIndexes",
593
- "ginIndexes"
594
- ]
595
- },
596
- "AutoBePrisma.IPrimaryField": {
597
- 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).",
598
- type: "object",
599
- properties: {
600
- name: {
601
- description: "Name of the primary key field.\n\nMUST use snake_case naming convention. Consistently named \"id\" across all\nmodels in the uploaded schemas. Represents the unique identifier for each\nrecord in the table.\n\n\n@pattern ^[a-z][a-z0-9_]*$",
602
- type: "string"
603
- },
604
- type: {
605
- 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.",
606
- type: "string",
607
- "enum": [
608
- "uuid"
609
- ]
610
- },
611
- description: {
612
- 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.\n\n**IMPORTANT**: Description must be written in English.",
613
- type: "string"
614
- }
615
- },
616
- required: [
617
- "name",
618
- "type",
619
- "description"
620
- ]
621
- },
622
- "AutoBePrisma.IForeignField": {
623
- 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.",
624
- type: "object",
625
- properties: {
626
- name: {
627
- description: "Name of the foreign key field.\n\nMUST use snake_case naming convention. Follows convention:\n\"{target_model_name_without_prefix}_id\" Examples: \"shopping_customer_id\",\n\"bbs_article_id\", \"attachment_file_id\" For self-references: \"parent_id\"\n(e.g., in hierarchical structures)\n\n\n@pattern ^[a-z][a-z0-9_]*$",
628
- type: "string"
629
- },
630
- type: {
631
- 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.",
632
- type: "string",
633
- "enum": [
634
- "uuid"
635
- ]
636
- },
637
- description: {
638
- 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.\n\n**IMPORTANT**: Description must be written in English.",
639
- type: "string"
640
- },
641
- relation: {
642
- 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. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
643
- $ref: "#/$defs/AutoBePrisma.IRelation"
644
- },
645
- unique: {
646
- 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.",
647
- type: "boolean"
648
- },
649
- nullable: {
650
- 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.",
651
- type: "boolean"
652
- }
653
- },
654
- required: [
655
- "name",
656
- "type",
657
- "description",
658
- "relation",
659
- "unique",
660
- "nullable"
661
- ]
662
- },
663
- "AutoBePrisma.IRelation": {
664
- description: "Interface representing a Prisma relation configuration between models.\n\nThis interface defines how foreign key fields establish relationships with\ntheir target models. It provides the necessary information for Prisma to\ngenerate appropriate relation directives (@relation) in the schema,\nenabling proper relational data modeling and ORM functionality.\n\nThe relation configuration is essential for:\n\n- Generating correct Prisma relation syntax\n- Establishing bidirectional relationships between models\n- Enabling proper type-safe querying through Prisma client\n- Supporting complex relationship patterns (1:1, 1:N, M:N)",
665
- type: "object",
666
- properties: {
667
- name: {
668
- description: "Name of the relation property in the Prisma model.\n\nThis becomes the property name used to access the related model instance\nthrough the Prisma client. Should be descriptive and reflect the business\nrelationship being modeled.\n\nExamples:\n\n- \"customer\" for shopping_customer_id field\n- \"channel\" for shopping_channel_id field\n- \"parent\" for parent_id field in hierarchical structures\n- \"snapshot\" for versioning relationships\n- \"article\" for bbs_article_id field\n\nNaming convention: camelCase, descriptive of the relationship's business\nmeaning\n\n\n@pattern ^[a-z][a-zA-Z0-9]*$",
669
- type: "string"
670
- },
671
- targetModel: {
672
- description: "Name of the target model being referenced by this relation.\n\nMust exactly match an existing model name in the schema. This is used by\nPrisma to establish the foreign key constraint and generate the\nappropriate relation mapping.\n\nExamples:\n\n- \"shopping_customers\" for customer relationships\n- \"shopping_channels\" for channel relationships\n- \"bbs_articles\" for article relationships\n- \"attachment_files\" for file attachments\n\nThe target model should exist in the same schema or be accessible through\nthe Prisma schema configuration.",
673
- type: "string"
674
- }
675
- },
676
- required: [
677
- "name",
678
- "targetModel"
679
- ]
680
- },
681
- "AutoBePrisma.IPlainField": {
682
- 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.",
683
- type: "object",
684
- properties: {
685
- name: {
686
- description: "Name of the field in the database table.\n\nMUST use snake_case naming convention. Common patterns from uploaded\nschemas:\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_]*$",
687
- type: "string"
688
- },
689
- type: {
690
- 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- Datetime: Timestamp fields with date and time",
691
- type: "string",
692
- "enum": [
693
- "string",
694
- "boolean",
695
- "uuid",
696
- "uri",
697
- "int",
698
- "double",
699
- "datetime"
700
- ]
701
- },
702
- description: {
703
- 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\n\n**IMPORTANT**: Description must be written in English. Example: \"Amount\nof cash payment.\" or \"Whether the unit is required or not.\"",
704
- type: "string"
705
- },
706
- nullable: {
707
- 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.",
708
- type: "boolean"
709
- }
710
- },
711
- required: [
712
- "name",
713
- "type",
714
- "description",
715
- "nullable"
716
- ]
717
- },
718
- "AutoBePrisma.IUniqueIndex": {
719
- 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.",
720
- type: "object",
721
- properties: {
722
- fieldNames: {
723
- 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",
724
- type: "array",
725
- items: {
726
- type: "string"
727
- }
728
- },
729
- unique: {
730
- 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\".",
731
- type: "boolean",
732
- "enum": [
733
- true
734
- ]
735
- }
736
- },
737
- required: [
738
- "fieldNames",
739
- "unique"
740
- ]
741
- },
742
- "AutoBePrisma.IPlainIndex": {
743
- 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.",
744
- type: "object",
745
- properties: {
746
- fieldNames: {
747
- 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",
748
- type: "array",
749
- items: {
750
- type: "string"
751
- }
752
- }
753
- },
754
- required: [
755
- "fieldNames"
756
- ]
757
- },
758
- "AutoBePrisma.IGinIndex": {
759
- 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.",
760
- type: "object",
761
- properties: {
762
- fieldName: {
763
- 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.",
764
- type: "string"
765
- }
766
- },
767
- required: [
768
- "fieldName"
769
- ]
770
- }
771
- }
772
- },
773
- description: "Generates comprehensive Prisma schema files based on detailed requirements\nanalysis.\n\nCreates multiple organized schema files following enterprise patterns\nincluding proper domain separation, relationship modeling, snapshot\npatterns, inheritance, materialized views, and comprehensive documentation.\nThe generated schemas implement best practices for scalability,\nmaintainability, and data integrity.",
774
- validate: (() => { const _io0 = input => "string" === typeof input.plan && (Array.isArray(input.models) && (1 <= input.models.length && 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 && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("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-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.plan || _report(_exceptionable, {
775
- path: _path + ".plan",
776
- expected: "string",
777
- value: input.plan
778
- }), (Array.isArray(input.models) || _report(_exceptionable, {
779
- path: _path + ".models",
780
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
781
- value: input.models
782
- })) && ((1 <= input.models.length || _report(_exceptionable, {
783
- path: _path + ".models",
784
- expected: "Array<> & MinItems<1>",
785
- value: input.models
786
- })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
787
- path: _path + ".models[" + _index9 + "]",
788
- expected: "AutoBePrisma.IModel",
789
- value: elem
790
- })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
791
- path: _path + ".models[" + _index9 + "]",
792
- expected: "AutoBePrisma.IModel",
793
- value: elem
794
- })).every(flag => flag)) || _report(_exceptionable, {
795
- path: _path + ".models",
796
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
797
- value: input.models
798
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
799
- path: _path + ".name",
800
- expected: "string & SnakeCasePattern",
801
- value: input.name
802
- })) || _report(_exceptionable, {
803
- path: _path + ".name",
804
- expected: "(string & SnakeCasePattern)",
805
- value: input.name
806
- }), "string" === typeof input.description || _report(_exceptionable, {
807
- path: _path + ".description",
808
- expected: "string",
809
- value: input.description
810
- }), "boolean" === typeof input.material || _report(_exceptionable, {
811
- path: _path + ".material",
812
- expected: "boolean",
813
- value: input.material
814
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
815
- path: _path + ".stance",
816
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
817
- value: input.stance
818
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
819
- path: _path + ".primaryField",
820
- expected: "AutoBePrisma.IPrimaryField",
821
- value: input.primaryField
822
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
823
- path: _path + ".primaryField",
824
- expected: "AutoBePrisma.IPrimaryField",
825
- value: input.primaryField
826
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
827
- path: _path + ".foreignFields",
828
- expected: "Array<AutoBePrisma.IForeignField>",
829
- value: input.foreignFields
830
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
831
- path: _path + ".foreignFields[" + _index10 + "]",
832
- expected: "AutoBePrisma.IForeignField",
833
- value: elem
834
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
835
- path: _path + ".foreignFields[" + _index10 + "]",
836
- expected: "AutoBePrisma.IForeignField",
837
- value: elem
838
- })).every(flag => flag) || _report(_exceptionable, {
839
- path: _path + ".foreignFields",
840
- expected: "Array<AutoBePrisma.IForeignField>",
841
- value: input.foreignFields
842
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
843
- path: _path + ".plainFields",
844
- expected: "Array<AutoBePrisma.IPlainField>",
845
- value: input.plainFields
846
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
847
- path: _path + ".plainFields[" + _index11 + "]",
848
- expected: "AutoBePrisma.IPlainField",
849
- value: elem
850
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
851
- path: _path + ".plainFields[" + _index11 + "]",
852
- expected: "AutoBePrisma.IPlainField",
853
- value: elem
854
- })).every(flag => flag) || _report(_exceptionable, {
855
- path: _path + ".plainFields",
856
- expected: "Array<AutoBePrisma.IPlainField>",
857
- value: input.plainFields
858
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
859
- path: _path + ".uniqueIndexes",
860
- expected: "Array<AutoBePrisma.IUniqueIndex>",
861
- value: input.uniqueIndexes
862
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
863
- path: _path + ".uniqueIndexes[" + _index12 + "]",
864
- expected: "AutoBePrisma.IUniqueIndex",
865
- value: elem
866
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
867
- path: _path + ".uniqueIndexes[" + _index12 + "]",
868
- expected: "AutoBePrisma.IUniqueIndex",
869
- value: elem
870
- })).every(flag => flag) || _report(_exceptionable, {
871
- path: _path + ".uniqueIndexes",
872
- expected: "Array<AutoBePrisma.IUniqueIndex>",
873
- value: input.uniqueIndexes
874
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
875
- path: _path + ".plainIndexes",
876
- expected: "Array<AutoBePrisma.IPlainIndex>",
877
- value: input.plainIndexes
878
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
879
- path: _path + ".plainIndexes[" + _index13 + "]",
880
- expected: "AutoBePrisma.IPlainIndex",
881
- value: elem
882
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
883
- path: _path + ".plainIndexes[" + _index13 + "]",
884
- expected: "AutoBePrisma.IPlainIndex",
885
- value: elem
886
- })).every(flag => flag) || _report(_exceptionable, {
887
- path: _path + ".plainIndexes",
888
- expected: "Array<AutoBePrisma.IPlainIndex>",
889
- value: input.plainIndexes
890
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
891
- path: _path + ".ginIndexes",
892
- expected: "Array<AutoBePrisma.IGinIndex>",
893
- value: input.ginIndexes
894
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
895
- path: _path + ".ginIndexes[" + _index14 + "]",
896
- expected: "AutoBePrisma.IGinIndex",
897
- value: elem
898
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
899
- path: _path + ".ginIndexes[" + _index14 + "]",
900
- expected: "AutoBePrisma.IGinIndex",
901
- value: elem
902
- })).every(flag => flag) || _report(_exceptionable, {
903
- path: _path + ".ginIndexes",
904
- expected: "Array<AutoBePrisma.IGinIndex>",
905
- value: input.ginIndexes
906
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
907
- path: _path + ".name",
908
- expected: "string & SnakeCasePattern",
909
- value: input.name
910
- })) || _report(_exceptionable, {
911
- path: _path + ".name",
912
- expected: "(string & SnakeCasePattern)",
913
- value: input.name
914
- }), "uuid" === input.type || _report(_exceptionable, {
915
- path: _path + ".type",
916
- expected: "\"uuid\"",
917
- value: input.type
918
- }), "string" === typeof input.description || _report(_exceptionable, {
919
- path: _path + ".description",
920
- expected: "string",
921
- value: input.description
922
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
923
- path: _path + ".name",
924
- expected: "string & SnakeCasePattern",
925
- value: input.name
926
- })) || _report(_exceptionable, {
927
- path: _path + ".name",
928
- expected: "(string & SnakeCasePattern)",
929
- value: input.name
930
- }), "uuid" === input.type || _report(_exceptionable, {
931
- path: _path + ".type",
932
- expected: "\"uuid\"",
933
- value: input.type
934
- }), "string" === typeof input.description || _report(_exceptionable, {
935
- path: _path + ".description",
936
- expected: "string",
937
- value: input.description
938
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
939
- path: _path + ".relation",
940
- expected: "AutoBePrisma.IRelation",
941
- value: input.relation
942
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
943
- path: _path + ".relation",
944
- expected: "AutoBePrisma.IRelation",
945
- value: input.relation
946
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
947
- path: _path + ".unique",
948
- expected: "boolean",
949
- value: input.unique
950
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
951
- path: _path + ".nullable",
952
- expected: "boolean",
953
- value: input.nullable
954
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
955
- path: _path + ".name",
956
- expected: "string & CamelCasePattern",
957
- value: input.name
958
- })) || _report(_exceptionable, {
959
- path: _path + ".name",
960
- expected: "(string & CamelCasePattern)",
961
- value: input.name
962
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
963
- path: _path + ".targetModel",
964
- expected: "string",
965
- value: input.targetModel
966
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
967
- path: _path + ".name",
968
- expected: "string & SnakeCasePattern",
969
- value: input.name
970
- })) || _report(_exceptionable, {
971
- path: _path + ".name",
972
- expected: "(string & SnakeCasePattern)",
973
- value: input.name
974
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
975
- path: _path + ".type",
976
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
977
- value: input.type
978
- }), "string" === typeof input.description || _report(_exceptionable, {
979
- path: _path + ".description",
980
- expected: "string",
981
- value: input.description
982
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
983
- path: _path + ".nullable",
984
- expected: "boolean",
985
- value: input.nullable
986
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
987
- path: _path + ".fieldNames",
988
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
989
- value: input.fieldNames
990
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
991
- path: _path + ".fieldNames",
992
- expected: "Array<> & MinItems<1>",
993
- value: input.fieldNames
994
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
995
- path: _path + ".fieldNames",
996
- expected: "Array<> & UniqueItems<true>",
997
- value: input.fieldNames
998
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
999
- path: _path + ".fieldNames[" + _index15 + "]",
1000
- expected: "string",
1001
- value: elem
1002
- })).every(flag => flag)) || _report(_exceptionable, {
1003
- path: _path + ".fieldNames",
1004
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1005
- value: input.fieldNames
1006
- }), true === input.unique || _report(_exceptionable, {
1007
- path: _path + ".unique",
1008
- expected: "true",
1009
- value: input.unique
1010
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1011
- path: _path + ".fieldNames",
1012
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1013
- value: input.fieldNames
1014
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1015
- path: _path + ".fieldNames",
1016
- expected: "Array<> & MinItems<1>",
1017
- value: input.fieldNames
1018
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1019
- path: _path + ".fieldNames",
1020
- expected: "Array<> & UniqueItems<true>",
1021
- value: input.fieldNames
1022
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1023
- path: _path + ".fieldNames[" + _index16 + "]",
1024
- expected: "string",
1025
- value: elem
1026
- })).every(flag => flag)) || _report(_exceptionable, {
1027
- path: _path + ".fieldNames",
1028
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1029
- value: input.fieldNames
1030
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1031
- path: _path + ".fieldName",
1032
- expected: "string",
1033
- value: input.fieldName
1034
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
1035
- if (false === __is(input)) {
1036
- errors = [];
1037
- _report = __typia_transform__validateReport._validateReport(errors);
1038
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1039
- path: _path + "",
1040
- expected: "IAutoBePrismaSchemaApplication.IProps",
1041
- value: input
1042
- })) && _vo0(input, _path + "", true) || _report(true, {
1043
- path: _path + "",
1044
- expected: "IAutoBePrismaSchemaApplication.IProps",
1045
- value: input
1046
- }))(input, "$input", true);
1047
- const success = 0 === errors.length;
1048
- return success ? {
1049
- success,
1050
- data: input
1051
- } : {
1052
- success,
1053
- errors,
1054
- data: input
1055
- };
1056
- }
1057
- return {
1058
- success: true,
1059
- data: input
1060
- };
1061
- }; })()
1062
- }
1063
- ]
1064
- };
1065
- __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
1066
- validate: {
1067
- makePrismaSchemaFile: validate,
1068
- },
1069
- }), { equals: false }));
1070
- return application;
1071
- })(),
1072
- claude: (validate) => (() => {
1073
- const application = {
1074
- model: "claude",
1075
- options: {
1076
- reference: true,
1077
- separate: null
1078
- },
1079
- functions: [
1080
- {
1081
- name: "makePrismaSchemaFile",
1082
- parameters: {
1083
- description: " Properties containing the file\n\n------------------------------\n\nCurrent Type: {@link IAutoBePrismaSchemaApplication.IProps}",
1084
- type: "object",
1085
- properties: {
1086
- plan: {
1087
- description: "Strategic database design analysis and planning.\n\nAI analyzes the target component and business requirements to formulate a\ncomprehensive database design strategy. This planning phase is crucial\nfor creating well-structured, normalized schemas that align with business\nobjectives. The AI must define table structures, relationships, indexing\nstrategies, and data integrity constraints before proceeding to schema\nimplementation.\n\n**Key Considerations:**\n\n- **Assignment Validation**: Extract targetComponent.tables as the complete\n specification\n- **Table Count**: Must create exactly targetComponent.tables.length models\n- **Other Components**: Identify already-created tables for foreign key\n references only\n- **Normalization**: Strict adherence to 1NF, 2NF, 3NF principles\n- **Snapshot Architecture**: Design for historical data preservation and\n audit trails\n- **Junction Tables**: Plan M:N relationships with proper naming\n ({table1}_{table2})\n- **Materialized Views**: Identify needs for mv_ prefixed denormalized\n tables\n\nWorkflow: Component analysis \u2192 Strategic planning \u2192 Design rationale",
1088
- type: "string"
1089
- },
1090
- models: {
1091
- description: "Production-ready Prisma schema models generated based on the strategic\nplan.\n\nContains a structured Abstract Syntax Tree (AST) representation of all\ndatabase tables for the target component. Each model implements the\nplanned table structure, relationships, indexes, and constraints using\nthe AutoBePrisma.IModel interface. These models are designed to be\nproduction-ready from the initial generation, following all best\npractices and normalization principles.\n\n**Implementation Requirements:**\n\n- **Model Count**: Exactly matches targetComponent.tables.length (plus any\n junction tables)\n- **Table Names**: EXACT names from targetComponent.tables - no\n modifications allowed\n- **Primary Keys**: Always UUID type with field name \"id\"\n- **Foreign Keys**: Proper IRelation configurations for all relationships\n- **Business Fields**: Only raw data fields - no calculated or derived\n values\n- **Data Types**: Limited to: uuid, string, int, double, datetime, boolean,\n uri\n- **Relationships**: Correct patterns for 1:1, 1:N, and M:N relationships\n- **Indexes**:\n\n - UniqueIndexes: Business constraints and composite unique keys\n - PlainIndexes: Multi-column query optimization (never single FK indexes)\n - GinIndexes: Full-text search on appropriate string fields\n- **Materialized Views**: Tables prefixed with \"mv_\" have material flag set\n to true\n- **Documentation**: Comprehensive English descriptions with business\n context\n\n**Quality Standards:**\n\n- **Normalization**: Strict adherence to 3NF (Third Normal Form)\n- **No Denormalization**: Except in materialized views (mv_ tables)\n- **Referential Integrity**: All foreign keys reference valid existing\n tables\n- **Temporal Fields**: Consistent created_at, updated_at, deleted_at\n patterns\n- **Snapshot Support**: Proper historical data preservation where needed\n- **Performance Ready**: Optimized index strategy for expected query\n patterns\n\nThe generated models will undergo review by a separate specialized agent\nto ensure compliance with all requirements and best practices.",
1092
- type: "array",
1093
- items: {
1094
- $ref: "#/$defs/AutoBePrisma.IModel"
1095
- },
1096
- minItems: 1
1097
- }
1098
- },
1099
- required: [
1100
- "plan",
1101
- "models"
1102
- ],
1103
- additionalProperties: false,
1104
- $defs: {
1105
- "AutoBePrisma.IModel": {
1106
- 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_)",
1107
- type: "object",
1108
- properties: {
1109
- name: {
1110
- description: "Name of the Prisma model (database table name).\n\nMUST use snake_case naming convention. Examples: \"shopping_customers\",\n\"shopping_sale_snapshots\", \"bbs_articles\" Materialized views use \"mv_\"\nprefix: \"mv_shopping_sale_last_snapshots\"",
1111
- type: "string",
1112
- pattern: "^[a-z][a-z0-9_]*$"
1113
- },
1114
- description: {
1115
- 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\n\n**IMPORTANT**: Description must be written in English. Example: \"Customer\ninformation, but not a person but a **connection** basis...\"",
1116
- type: "string"
1117
- },
1118
- material: {
1119
- 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",
1120
- type: "boolean"
1121
- },
1122
- stance: {
1123
- description: "Specifies the architectural stance of this model within the database\nsystem.\n\nThis property defines how the table positions itself in relation to other\ntables and what role it plays in the overall data architecture,\nparticularly for API endpoint generation and business logic\norganization.\n\n## Values:\n\n### `\"primary\"` - Main Business Entity\n\nTables that represent core business concepts and serve as the primary\nsubjects of user operations. These tables typically warrant independent\nCRUD API endpoints since users directly interact with these entities.\n\n**Key principle**: If users need to independently create, search, filter,\nor manage entities regardless of their parent context, the table should\nbe primary stance.\n\n**API Requirements:**\n\n- Independent creation endpoints (POST /articles, POST /comments)\n- Search and filtering capabilities across all instances\n- Direct update and delete operations\n- List/pagination endpoints for browsing\n\n**Why `bbs_article_comments` is primary, not subsidiary:**\n\nAlthough comments belong to articles, they require independent\nmanagement:\n\n- **Search across articles**: \"Find all comments by user X across all\n articles\"\n- **Moderation workflows**: \"List all pending comments for review\"\n- **User activity**: \"Show all comments made by this user\"\n- **Independent operations**: Users edit/delete their comments directly\n- **Notification systems**: \"Alert when any comment is posted\"\n\nIf comments were subsidiary, these operations would be impossible or\nrequire inefficient nested queries through parent articles.\n\n**Characteristics:**\n\n- Represents tangible business concepts that users manage\n- Serves as reference points for other tables\n- Requires comprehensive API operations (CREATE, READ, UPDATE, DELETE)\n- Forms the backbone of the application's business logic\n\n**Examples:**\n\n- `bbs_articles` - Forum posts that users create, edit, and manage\n- `bbs_article_comments` - User comments that require independent\n management\n\n### `\"subsidiary\"` - Supporting/Dependent Entity\n\nTables that exist to support primary entities but are not independently\nmanaged by users. These tables are typically managed through their parent\nentities and may not need standalone API endpoints.\n\n**Characteristics:**\n\n- Depends on primary or snapshot entities for context\n- Often managed indirectly through parent entity operations\n- May have limited or no independent API operations\n- Provides supporting data or relationships\n\n**Examples:**\n\n- `bbs_article_snapshot_files` - Files attached to article snapshots\n- `bbs_article_snapshot_tags` - Tags associated with article snapshots\n- `bbs_article_comment_snapshot_files` - Files attached to comment\n snapshots\n\n### `\"snapshot\"` - Historical/Versioning Entity\n\nTables that capture point-in-time states of primary entities for audit\ntrails, version control, or historical tracking. These tables record\nchanges but are rarely modified directly by users.\n\n**Characteristics:**\n\n- Captures historical states of primary entities\n- Typically append-only (rarely updated or deleted)\n- Referenced for audit trails and change tracking\n- Usually read-only from user perspective\n\n**Examples:**\n\n- `bbs_article_snapshots` - Historical states of articles\n- `bbs_article_comment_snapshots` - Comment modification history\n\n## API Generation Guidelines:\n\nThe stance property guides automatic API endpoint generation:\n\n- **`\"primary\"`** \u2192 Generate full CRUD endpoints based on business\n requirements\n- **`\"subsidiary\"`** \u2192 Evaluate carefully; often managed through parent\n entities\n- **`\"snapshot\"`** \u2192 Typically read-only endpoints for historical data\n access",
1124
- oneOf: [
1125
- {
1126
- "const": "primary"
1127
- },
1128
- {
1129
- "const": "subsidiary"
1130
- },
1131
- {
1132
- "const": "snapshot"
1133
- }
1134
- ]
1135
- },
1136
- primaryField: {
1137
- 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.",
1138
- $ref: "#/$defs/AutoBePrisma.IPrimaryField"
1139
- },
1140
- foreignFields: {
1141
- 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.",
1142
- type: "array",
1143
- items: {
1144
- $ref: "#/$defs/AutoBePrisma.IForeignField"
1145
- }
1146
- },
1147
- plainFields: {
1148
- 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.",
1149
- type: "array",
1150
- items: {
1151
- $ref: "#/$defs/AutoBePrisma.IPlainField"
1152
- }
1153
- },
1154
- uniqueIndexes: {
1155
- 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).",
1156
- type: "array",
1157
- items: {
1158
- $ref: "#/$defs/AutoBePrisma.IUniqueIndex"
1159
- }
1160
- },
1161
- plainIndexes: {
1162
- 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.",
1163
- type: "array",
1164
- items: {
1165
- $ref: "#/$defs/AutoBePrisma.IPlainIndex"
1166
- }
1167
- },
1168
- ginIndexes: {
1169
- 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.",
1170
- type: "array",
1171
- items: {
1172
- $ref: "#/$defs/AutoBePrisma.IGinIndex"
1173
- }
1174
- }
1175
- },
1176
- required: [
1177
- "name",
1178
- "description",
1179
- "material",
1180
- "stance",
1181
- "primaryField",
1182
- "foreignFields",
1183
- "plainFields",
1184
- "uniqueIndexes",
1185
- "plainIndexes",
1186
- "ginIndexes"
1187
- ]
1188
- },
1189
- "AutoBePrisma.IPrimaryField": {
1190
- 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).",
1191
- type: "object",
1192
- properties: {
1193
- name: {
1194
- description: "Name of the primary key field.\n\nMUST use snake_case naming convention. Consistently named \"id\" across all\nmodels in the uploaded schemas. Represents the unique identifier for each\nrecord in the table.",
1195
- type: "string",
1196
- pattern: "^[a-z][a-z0-9_]*$"
1197
- },
1198
- type: {
1199
- 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.",
1200
- "const": "uuid"
1201
- },
1202
- description: {
1203
- 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.\n\n**IMPORTANT**: Description must be written in English.",
1204
- type: "string"
1205
- }
1206
- },
1207
- required: [
1208
- "name",
1209
- "type",
1210
- "description"
1211
- ]
1212
- },
1213
- "AutoBePrisma.IForeignField": {
1214
- 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.",
1215
- type: "object",
1216
- properties: {
1217
- name: {
1218
- description: "Name of the foreign key field.\n\nMUST use snake_case naming convention. Follows convention:\n\"{target_model_name_without_prefix}_id\" Examples: \"shopping_customer_id\",\n\"bbs_article_id\", \"attachment_file_id\" For self-references: \"parent_id\"\n(e.g., in hierarchical structures)",
1219
- type: "string",
1220
- pattern: "^[a-z][a-z0-9_]*$"
1221
- },
1222
- type: {
1223
- 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.",
1224
- "const": "uuid"
1225
- },
1226
- description: {
1227
- 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.\n\n**IMPORTANT**: Description must be written in English.",
1228
- type: "string"
1229
- },
1230
- relation: {
1231
- 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. This configuration is used\nto generate the appropriate Prisma relation directive in the schema.",
1232
- $ref: "#/$defs/AutoBePrisma.IRelation"
1233
- },
1234
- unique: {
1235
- 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.",
1236
- type: "boolean"
1237
- },
1238
- nullable: {
1239
- 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.",
1240
- type: "boolean"
1241
- }
1242
- },
1243
- required: [
1244
- "name",
1245
- "type",
1246
- "description",
1247
- "relation",
1248
- "unique",
1249
- "nullable"
1250
- ]
1251
- },
1252
- "AutoBePrisma.IRelation": {
1253
- description: "Interface representing a Prisma relation configuration between models.\n\nThis interface defines how foreign key fields establish relationships with\ntheir target models. It provides the necessary information for Prisma to\ngenerate appropriate relation directives (@relation) in the schema,\nenabling proper relational data modeling and ORM functionality.\n\nThe relation configuration is essential for:\n\n- Generating correct Prisma relation syntax\n- Establishing bidirectional relationships between models\n- Enabling proper type-safe querying through Prisma client\n- Supporting complex relationship patterns (1:1, 1:N, M:N)",
1254
- type: "object",
1255
- properties: {
1256
- name: {
1257
- description: "Name of the relation property in the Prisma model.\n\nThis becomes the property name used to access the related model instance\nthrough the Prisma client. Should be descriptive and reflect the business\nrelationship being modeled.\n\nExamples:\n\n- \"customer\" for shopping_customer_id field\n- \"channel\" for shopping_channel_id field\n- \"parent\" for parent_id field in hierarchical structures\n- \"snapshot\" for versioning relationships\n- \"article\" for bbs_article_id field\n\nNaming convention: camelCase, descriptive of the relationship's business\nmeaning",
1258
- type: "string",
1259
- pattern: "^[a-z][a-zA-Z0-9]*$"
1260
- },
1261
- targetModel: {
1262
- description: "Name of the target model being referenced by this relation.\n\nMust exactly match an existing model name in the schema. This is used by\nPrisma to establish the foreign key constraint and generate the\nappropriate relation mapping.\n\nExamples:\n\n- \"shopping_customers\" for customer relationships\n- \"shopping_channels\" for channel relationships\n- \"bbs_articles\" for article relationships\n- \"attachment_files\" for file attachments\n\nThe target model should exist in the same schema or be accessible through\nthe Prisma schema configuration.",
1263
- type: "string"
1264
- }
1265
- },
1266
- required: [
1267
- "name",
1268
- "targetModel"
1269
- ]
1270
- },
1271
- "AutoBePrisma.IPlainField": {
1272
- 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.",
1273
- type: "object",
1274
- properties: {
1275
- name: {
1276
- description: "Name of the field in the database table.\n\nMUST use snake_case naming convention. Common patterns from uploaded\nschemas:\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",
1277
- type: "string",
1278
- pattern: "^[a-z][a-z0-9_]*$"
1279
- },
1280
- type: {
1281
- 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- Datetime: Timestamp fields with date and time",
1282
- oneOf: [
1283
- {
1284
- "const": "string"
1285
- },
1286
- {
1287
- "const": "boolean"
1288
- },
1289
- {
1290
- "const": "uuid"
1291
- },
1292
- {
1293
- "const": "uri"
1294
- },
1295
- {
1296
- "const": "int"
1297
- },
1298
- {
1299
- "const": "double"
1300
- },
1301
- {
1302
- "const": "datetime"
1303
- }
1304
- ]
1305
- },
1306
- description: {
1307
- 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\n\n**IMPORTANT**: Description must be written in English. Example: \"Amount\nof cash payment.\" or \"Whether the unit is required or not.\"",
1308
- type: "string"
1309
- },
1310
- nullable: {
1311
- 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.",
1312
- type: "boolean"
1313
- }
1314
- },
1315
- required: [
1316
- "name",
1317
- "type",
1318
- "description",
1319
- "nullable"
1320
- ]
1321
- },
1322
- "AutoBePrisma.IUniqueIndex": {
1323
- 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.",
1324
- type: "object",
1325
- properties: {
1326
- fieldNames: {
1327
- 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\"]",
1328
- type: "array",
1329
- items: {
1330
- type: "string"
1331
- },
1332
- minItems: 1,
1333
- uniqueItems: true
1334
- },
1335
- unique: {
1336
- 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\".",
1337
- "const": true
1338
- }
1339
- },
1340
- required: [
1341
- "fieldNames",
1342
- "unique"
1343
- ]
1344
- },
1345
- "AutoBePrisma.IPlainIndex": {
1346
- 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.",
1347
- type: "object",
1348
- properties: {
1349
- fieldNames: {
1350
- 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\"]",
1351
- type: "array",
1352
- items: {
1353
- type: "string"
1354
- },
1355
- minItems: 1,
1356
- uniqueItems: true
1357
- }
1358
- },
1359
- required: [
1360
- "fieldNames"
1361
- ]
1362
- },
1363
- "AutoBePrisma.IGinIndex": {
1364
- 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.",
1365
- type: "object",
1366
- properties: {
1367
- fieldName: {
1368
- 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.",
1369
- type: "string"
1370
- }
1371
- },
1372
- required: [
1373
- "fieldName"
1374
- ]
1375
- }
1376
- }
1377
- },
1378
- description: "Generates comprehensive Prisma schema files based on detailed requirements\nanalysis.\n\nCreates multiple organized schema files following enterprise patterns\nincluding proper domain separation, relationship modeling, snapshot\npatterns, inheritance, materialized views, and comprehensive documentation.\nThe generated schemas implement best practices for scalability,\nmaintainability, and data integrity.",
1379
- validate: (() => { const _io0 = input => "string" === typeof input.plan && (Array.isArray(input.models) && (1 <= input.models.length && 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 && ("primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance) && ("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-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.plan || _report(_exceptionable, {
1380
- path: _path + ".plan",
1381
- expected: "string",
1382
- value: input.plan
1383
- }), (Array.isArray(input.models) || _report(_exceptionable, {
1384
- path: _path + ".models",
1385
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
1386
- value: input.models
1387
- })) && ((1 <= input.models.length || _report(_exceptionable, {
1388
- path: _path + ".models",
1389
- expected: "Array<> & MinItems<1>",
1390
- value: input.models
1391
- })) && input.models.map((elem, _index9) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1392
- path: _path + ".models[" + _index9 + "]",
1393
- expected: "AutoBePrisma.IModel",
1394
- value: elem
1395
- })) && _vo1(elem, _path + ".models[" + _index9 + "]", true && _exceptionable) || _report(_exceptionable, {
1396
- path: _path + ".models[" + _index9 + "]",
1397
- expected: "AutoBePrisma.IModel",
1398
- value: elem
1399
- })).every(flag => flag)) || _report(_exceptionable, {
1400
- path: _path + ".models",
1401
- expected: "(Array<AutoBePrisma.IModel> & MinItems<1>)",
1402
- value: input.models
1403
- })].every(flag => flag); const _vo1 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1404
- path: _path + ".name",
1405
- expected: "string & SnakeCasePattern",
1406
- value: input.name
1407
- })) || _report(_exceptionable, {
1408
- path: _path + ".name",
1409
- expected: "(string & SnakeCasePattern)",
1410
- value: input.name
1411
- }), "string" === typeof input.description || _report(_exceptionable, {
1412
- path: _path + ".description",
1413
- expected: "string",
1414
- value: input.description
1415
- }), "boolean" === typeof input.material || _report(_exceptionable, {
1416
- path: _path + ".material",
1417
- expected: "boolean",
1418
- value: input.material
1419
- }), "primary" === input.stance || "subsidiary" === input.stance || "snapshot" === input.stance || _report(_exceptionable, {
1420
- path: _path + ".stance",
1421
- expected: "(\"primary\" | \"snapshot\" | \"subsidiary\")",
1422
- value: input.stance
1423
- }), ("object" === typeof input.primaryField && null !== input.primaryField || _report(_exceptionable, {
1424
- path: _path + ".primaryField",
1425
- expected: "AutoBePrisma.IPrimaryField",
1426
- value: input.primaryField
1427
- })) && _vo2(input.primaryField, _path + ".primaryField", true && _exceptionable) || _report(_exceptionable, {
1428
- path: _path + ".primaryField",
1429
- expected: "AutoBePrisma.IPrimaryField",
1430
- value: input.primaryField
1431
- }), (Array.isArray(input.foreignFields) || _report(_exceptionable, {
1432
- path: _path + ".foreignFields",
1433
- expected: "Array<AutoBePrisma.IForeignField>",
1434
- value: input.foreignFields
1435
- })) && input.foreignFields.map((elem, _index10) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1436
- path: _path + ".foreignFields[" + _index10 + "]",
1437
- expected: "AutoBePrisma.IForeignField",
1438
- value: elem
1439
- })) && _vo3(elem, _path + ".foreignFields[" + _index10 + "]", true && _exceptionable) || _report(_exceptionable, {
1440
- path: _path + ".foreignFields[" + _index10 + "]",
1441
- expected: "AutoBePrisma.IForeignField",
1442
- value: elem
1443
- })).every(flag => flag) || _report(_exceptionable, {
1444
- path: _path + ".foreignFields",
1445
- expected: "Array<AutoBePrisma.IForeignField>",
1446
- value: input.foreignFields
1447
- }), (Array.isArray(input.plainFields) || _report(_exceptionable, {
1448
- path: _path + ".plainFields",
1449
- expected: "Array<AutoBePrisma.IPlainField>",
1450
- value: input.plainFields
1451
- })) && input.plainFields.map((elem, _index11) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1452
- path: _path + ".plainFields[" + _index11 + "]",
1453
- expected: "AutoBePrisma.IPlainField",
1454
- value: elem
1455
- })) && _vo5(elem, _path + ".plainFields[" + _index11 + "]", true && _exceptionable) || _report(_exceptionable, {
1456
- path: _path + ".plainFields[" + _index11 + "]",
1457
- expected: "AutoBePrisma.IPlainField",
1458
- value: elem
1459
- })).every(flag => flag) || _report(_exceptionable, {
1460
- path: _path + ".plainFields",
1461
- expected: "Array<AutoBePrisma.IPlainField>",
1462
- value: input.plainFields
1463
- }), (Array.isArray(input.uniqueIndexes) || _report(_exceptionable, {
1464
- path: _path + ".uniqueIndexes",
1465
- expected: "Array<AutoBePrisma.IUniqueIndex>",
1466
- value: input.uniqueIndexes
1467
- })) && input.uniqueIndexes.map((elem, _index12) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1468
- path: _path + ".uniqueIndexes[" + _index12 + "]",
1469
- expected: "AutoBePrisma.IUniqueIndex",
1470
- value: elem
1471
- })) && _vo6(elem, _path + ".uniqueIndexes[" + _index12 + "]", true && _exceptionable) || _report(_exceptionable, {
1472
- path: _path + ".uniqueIndexes[" + _index12 + "]",
1473
- expected: "AutoBePrisma.IUniqueIndex",
1474
- value: elem
1475
- })).every(flag => flag) || _report(_exceptionable, {
1476
- path: _path + ".uniqueIndexes",
1477
- expected: "Array<AutoBePrisma.IUniqueIndex>",
1478
- value: input.uniqueIndexes
1479
- }), (Array.isArray(input.plainIndexes) || _report(_exceptionable, {
1480
- path: _path + ".plainIndexes",
1481
- expected: "Array<AutoBePrisma.IPlainIndex>",
1482
- value: input.plainIndexes
1483
- })) && input.plainIndexes.map((elem, _index13) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1484
- path: _path + ".plainIndexes[" + _index13 + "]",
1485
- expected: "AutoBePrisma.IPlainIndex",
1486
- value: elem
1487
- })) && _vo7(elem, _path + ".plainIndexes[" + _index13 + "]", true && _exceptionable) || _report(_exceptionable, {
1488
- path: _path + ".plainIndexes[" + _index13 + "]",
1489
- expected: "AutoBePrisma.IPlainIndex",
1490
- value: elem
1491
- })).every(flag => flag) || _report(_exceptionable, {
1492
- path: _path + ".plainIndexes",
1493
- expected: "Array<AutoBePrisma.IPlainIndex>",
1494
- value: input.plainIndexes
1495
- }), (Array.isArray(input.ginIndexes) || _report(_exceptionable, {
1496
- path: _path + ".ginIndexes",
1497
- expected: "Array<AutoBePrisma.IGinIndex>",
1498
- value: input.ginIndexes
1499
- })) && input.ginIndexes.map((elem, _index14) => ("object" === typeof elem && null !== elem || _report(_exceptionable, {
1500
- path: _path + ".ginIndexes[" + _index14 + "]",
1501
- expected: "AutoBePrisma.IGinIndex",
1502
- value: elem
1503
- })) && _vo8(elem, _path + ".ginIndexes[" + _index14 + "]", true && _exceptionable) || _report(_exceptionable, {
1504
- path: _path + ".ginIndexes[" + _index14 + "]",
1505
- expected: "AutoBePrisma.IGinIndex",
1506
- value: elem
1507
- })).every(flag => flag) || _report(_exceptionable, {
1508
- path: _path + ".ginIndexes",
1509
- expected: "Array<AutoBePrisma.IGinIndex>",
1510
- value: input.ginIndexes
1511
- })].every(flag => flag); const _vo2 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1512
- path: _path + ".name",
1513
- expected: "string & SnakeCasePattern",
1514
- value: input.name
1515
- })) || _report(_exceptionable, {
1516
- path: _path + ".name",
1517
- expected: "(string & SnakeCasePattern)",
1518
- value: input.name
1519
- }), "uuid" === input.type || _report(_exceptionable, {
1520
- path: _path + ".type",
1521
- expected: "\"uuid\"",
1522
- value: input.type
1523
- }), "string" === typeof input.description || _report(_exceptionable, {
1524
- path: _path + ".description",
1525
- expected: "string",
1526
- value: input.description
1527
- })].every(flag => flag); const _vo3 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1528
- path: _path + ".name",
1529
- expected: "string & SnakeCasePattern",
1530
- value: input.name
1531
- })) || _report(_exceptionable, {
1532
- path: _path + ".name",
1533
- expected: "(string & SnakeCasePattern)",
1534
- value: input.name
1535
- }), "uuid" === input.type || _report(_exceptionable, {
1536
- path: _path + ".type",
1537
- expected: "\"uuid\"",
1538
- value: input.type
1539
- }), "string" === typeof input.description || _report(_exceptionable, {
1540
- path: _path + ".description",
1541
- expected: "string",
1542
- value: input.description
1543
- }), ("object" === typeof input.relation && null !== input.relation || _report(_exceptionable, {
1544
- path: _path + ".relation",
1545
- expected: "AutoBePrisma.IRelation",
1546
- value: input.relation
1547
- })) && _vo4(input.relation, _path + ".relation", true && _exceptionable) || _report(_exceptionable, {
1548
- path: _path + ".relation",
1549
- expected: "AutoBePrisma.IRelation",
1550
- value: input.relation
1551
- }), "boolean" === typeof input.unique || _report(_exceptionable, {
1552
- path: _path + ".unique",
1553
- expected: "boolean",
1554
- value: input.unique
1555
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1556
- path: _path + ".nullable",
1557
- expected: "boolean",
1558
- value: input.nullable
1559
- })].every(flag => flag); const _vo4 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-zA-Z0-9]*$").test(input.name) || _report(_exceptionable, {
1560
- path: _path + ".name",
1561
- expected: "string & CamelCasePattern",
1562
- value: input.name
1563
- })) || _report(_exceptionable, {
1564
- path: _path + ".name",
1565
- expected: "(string & CamelCasePattern)",
1566
- value: input.name
1567
- }), "string" === typeof input.targetModel || _report(_exceptionable, {
1568
- path: _path + ".targetModel",
1569
- expected: "string",
1570
- value: input.targetModel
1571
- })].every(flag => flag); const _vo5 = (input, _path, _exceptionable = true) => ["string" === typeof input.name && (RegExp("^[a-z][a-z0-9_]*$").test(input.name) || _report(_exceptionable, {
1572
- path: _path + ".name",
1573
- expected: "string & SnakeCasePattern",
1574
- value: input.name
1575
- })) || _report(_exceptionable, {
1576
- path: _path + ".name",
1577
- expected: "(string & SnakeCasePattern)",
1578
- value: input.name
1579
- }), "string" === input.type || "boolean" === input.type || "uuid" === input.type || "uri" === input.type || "int" === input.type || "double" === input.type || "datetime" === input.type || _report(_exceptionable, {
1580
- path: _path + ".type",
1581
- expected: "(\"boolean\" | \"datetime\" | \"double\" | \"int\" | \"string\" | \"uri\" | \"uuid\")",
1582
- value: input.type
1583
- }), "string" === typeof input.description || _report(_exceptionable, {
1584
- path: _path + ".description",
1585
- expected: "string",
1586
- value: input.description
1587
- }), "boolean" === typeof input.nullable || _report(_exceptionable, {
1588
- path: _path + ".nullable",
1589
- expected: "boolean",
1590
- value: input.nullable
1591
- })].every(flag => flag); const _vo6 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1592
- path: _path + ".fieldNames",
1593
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1594
- value: input.fieldNames
1595
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1596
- path: _path + ".fieldNames",
1597
- expected: "Array<> & MinItems<1>",
1598
- value: input.fieldNames
1599
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1600
- path: _path + ".fieldNames",
1601
- expected: "Array<> & UniqueItems<true>",
1602
- value: input.fieldNames
1603
- })) && input.fieldNames.map((elem, _index15) => "string" === typeof elem || _report(_exceptionable, {
1604
- path: _path + ".fieldNames[" + _index15 + "]",
1605
- expected: "string",
1606
- value: elem
1607
- })).every(flag => flag)) || _report(_exceptionable, {
1608
- path: _path + ".fieldNames",
1609
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1610
- value: input.fieldNames
1611
- }), true === input.unique || _report(_exceptionable, {
1612
- path: _path + ".unique",
1613
- expected: "true",
1614
- value: input.unique
1615
- })].every(flag => flag); const _vo7 = (input, _path, _exceptionable = true) => [(Array.isArray(input.fieldNames) || _report(_exceptionable, {
1616
- path: _path + ".fieldNames",
1617
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1618
- value: input.fieldNames
1619
- })) && ((1 <= input.fieldNames.length || _report(_exceptionable, {
1620
- path: _path + ".fieldNames",
1621
- expected: "Array<> & MinItems<1>",
1622
- value: input.fieldNames
1623
- })) && (__typia_transform__isUniqueItems._isUniqueItems(input.fieldNames) || _report(_exceptionable, {
1624
- path: _path + ".fieldNames",
1625
- expected: "Array<> & UniqueItems<true>",
1626
- value: input.fieldNames
1627
- })) && input.fieldNames.map((elem, _index16) => "string" === typeof elem || _report(_exceptionable, {
1628
- path: _path + ".fieldNames[" + _index16 + "]",
1629
- expected: "string",
1630
- value: elem
1631
- })).every(flag => flag)) || _report(_exceptionable, {
1632
- path: _path + ".fieldNames",
1633
- expected: "(Array<string> & MinItems<1> & UniqueItems<true>)",
1634
- value: input.fieldNames
1635
- })].every(flag => flag); const _vo8 = (input, _path, _exceptionable = true) => ["string" === typeof input.fieldName || _report(_exceptionable, {
1636
- path: _path + ".fieldName",
1637
- expected: "string",
1638
- value: input.fieldName
1639
- })].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
1640
- if (false === __is(input)) {
1641
- errors = [];
1642
- _report = __typia_transform__validateReport._validateReport(errors);
1643
- ((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input || _report(true, {
1644
- path: _path + "",
1645
- expected: "IAutoBePrismaSchemaApplication.IProps",
1646
- value: input
1647
- })) && _vo0(input, _path + "", true) || _report(true, {
1648
- path: _path + "",
1649
- expected: "IAutoBePrismaSchemaApplication.IProps",
1650
- value: input
1651
- }))(input, "$input", true);
1652
- const success = 0 === errors.length;
1653
- return success ? {
1654
- success,
1655
- data: input
1656
- } : {
1657
- success,
1658
- errors,
1659
- data: input
1660
- };
1661
- }
1662
- return {
1663
- success: true,
1664
- data: input
1665
- };
1666
- }; })()
1667
- }
1668
- ]
1669
- };
1670
- __typia_transform__llmApplicationFinalize._llmApplicationFinalize(application, Object.assign(Object.assign({}, {
1671
- validate: {
1672
- makePrismaSchemaFile: validate,
1673
- },
1674
- }), { equals: false }));
1675
- return application;
1676
- })(),
1677
- };
1678
- //# sourceMappingURL=orchestratePrismaSchemas.js.map