@opensaas/stack-core 0.42.3 → 0.44.0-alpha.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 (641) hide show
  1. package/CHANGELOG.md +2745 -0
  2. package/README.md +182 -115
  3. package/dist/.build-hash +1 -0
  4. package/dist/access/declared-dependencies.d.ts +102 -88
  5. package/dist/access/declared-dependencies.d.ts.map +1 -1
  6. package/dist/access/declared-dependencies.js +83 -71
  7. package/dist/access/declared-dependencies.js.map +1 -1
  8. package/dist/access/depth-limits.d.ts +4 -0
  9. package/dist/access/depth-limits.d.ts.map +1 -1
  10. package/dist/access/depth-limits.js +4 -0
  11. package/dist/access/depth-limits.js.map +1 -1
  12. package/dist/access/engine.d.ts +68 -20
  13. package/dist/access/engine.d.ts.map +1 -1
  14. package/dist/access/engine.js +151 -37
  15. package/dist/access/engine.js.map +1 -1
  16. package/dist/access/errors.d.ts +33 -48
  17. package/dist/access/errors.d.ts.map +1 -1
  18. package/dist/access/errors.js +73 -63
  19. package/dist/access/errors.js.map +1 -1
  20. package/dist/access/field-access.d.ts +76 -5
  21. package/dist/access/field-access.d.ts.map +1 -1
  22. package/dist/access/field-access.js +235 -61
  23. package/dist/access/field-access.js.map +1 -1
  24. package/dist/access/field-visibility.d.ts +50 -4
  25. package/dist/access/field-visibility.d.ts.map +1 -1
  26. package/dist/access/field-visibility.js +143 -160
  27. package/dist/access/field-visibility.js.map +1 -1
  28. package/dist/access/index.d.ts +5 -12
  29. package/dist/access/index.d.ts.map +1 -1
  30. package/dist/access/index.js +6 -19
  31. package/dist/access/index.js.map +1 -1
  32. package/dist/access/orm-client.d.ts +19 -0
  33. package/dist/access/orm-client.d.ts.map +1 -0
  34. package/dist/access/orm-client.js +37 -0
  35. package/dist/access/orm-client.js.map +1 -0
  36. package/dist/access/query-validation.d.ts +7 -129
  37. package/dist/access/query-validation.d.ts.map +1 -1
  38. package/dist/access/query-validation.js +12 -314
  39. package/dist/access/query-validation.js.map +1 -1
  40. package/dist/access/system-fields.d.ts +2 -0
  41. package/dist/access/system-fields.d.ts.map +1 -0
  42. package/dist/access/system-fields.js +7 -0
  43. package/dist/access/system-fields.js.map +1 -0
  44. package/dist/access/transaction-registry.d.ts +25 -2
  45. package/dist/access/transaction-registry.d.ts.map +1 -1
  46. package/dist/access/transaction-registry.js +34 -17
  47. package/dist/access/transaction-registry.js.map +1 -1
  48. package/dist/access/types.d.ts +217 -131
  49. package/dist/access/types.d.ts.map +1 -1
  50. package/dist/config/field-kind.d.ts +66 -0
  51. package/dist/config/field-kind.d.ts.map +1 -0
  52. package/dist/config/field-kind.js +63 -0
  53. package/dist/config/field-kind.js.map +1 -0
  54. package/dist/config/hook-only-fields.d.ts +3 -0
  55. package/dist/config/hook-only-fields.d.ts.map +1 -0
  56. package/dist/config/hook-only-fields.js +17 -0
  57. package/dist/config/hook-only-fields.js.map +1 -0
  58. package/dist/config/index.d.ts +3 -1
  59. package/dist/config/index.d.ts.map +1 -1
  60. package/dist/config/index.js +6 -3
  61. package/dist/config/index.js.map +1 -1
  62. package/dist/config/mcp-tool-names.d.ts +3 -0
  63. package/dist/config/mcp-tool-names.d.ts.map +1 -0
  64. package/dist/config/mcp-tool-names.js +25 -0
  65. package/dist/config/mcp-tool-names.js.map +1 -0
  66. package/dist/config/nav-count.d.ts.map +1 -1
  67. package/dist/config/nav-count.js +4 -4
  68. package/dist/config/nav-count.js.map +1 -1
  69. package/dist/config/plugin-engine.d.ts +8 -2
  70. package/dist/config/plugin-engine.d.ts.map +1 -1
  71. package/dist/config/plugin-engine.js +102 -38
  72. package/dist/config/plugin-engine.js.map +1 -1
  73. package/dist/config/types.d.ts +966 -614
  74. package/dist/config/types.d.ts.map +1 -1
  75. package/dist/context/apply-defaults.d.ts +18 -1
  76. package/dist/context/apply-defaults.d.ts.map +1 -1
  77. package/dist/context/apply-defaults.js +30 -4
  78. package/dist/context/apply-defaults.js.map +1 -1
  79. package/dist/context/engine-context.d.ts +73 -0
  80. package/dist/context/engine-context.d.ts.map +1 -0
  81. package/dist/context/engine-context.js +67 -0
  82. package/dist/context/engine-context.js.map +1 -0
  83. package/dist/context/hook-pipeline.d.ts +9 -2
  84. package/dist/context/hook-pipeline.d.ts.map +1 -1
  85. package/dist/context/hook-pipeline.js +5 -4
  86. package/dist/context/hook-pipeline.js.map +1 -1
  87. package/dist/context/index.d.ts +98 -89
  88. package/dist/context/index.d.ts.map +1 -1
  89. package/dist/context/index.js +917 -722
  90. package/dist/context/index.js.map +1 -1
  91. package/dist/context/junction.d.ts +59 -0
  92. package/dist/context/junction.d.ts.map +1 -0
  93. package/dist/context/junction.js +126 -0
  94. package/dist/context/junction.js.map +1 -0
  95. package/dist/context/plugin-field-read.d.ts +33 -0
  96. package/dist/context/plugin-field-read.d.ts.map +1 -0
  97. package/dist/context/plugin-field-read.js +41 -0
  98. package/dist/context/plugin-field-read.js.map +1 -0
  99. package/dist/context/plugin-field-write.d.ts +104 -0
  100. package/dist/context/plugin-field-write.d.ts.map +1 -0
  101. package/dist/context/plugin-field-write.js +184 -0
  102. package/dist/context/plugin-field-write.js.map +1 -0
  103. package/dist/context/relationship-input.d.ts +146 -0
  104. package/dist/context/relationship-input.d.ts.map +1 -0
  105. package/dist/context/relationship-input.js +453 -0
  106. package/dist/context/relationship-input.js.map +1 -0
  107. package/dist/context/transaction-boundary.d.ts +54 -28
  108. package/dist/context/transaction-boundary.d.ts.map +1 -1
  109. package/dist/context/transaction-boundary.js +87 -169
  110. package/dist/context/transaction-boundary.js.map +1 -1
  111. package/dist/context/write-pipeline.d.ts +33 -51
  112. package/dist/context/write-pipeline.d.ts.map +1 -1
  113. package/dist/context/write-pipeline.js +372 -185
  114. package/dist/context/write-pipeline.js.map +1 -1
  115. package/dist/contract/dependencies.d.ts +88 -0
  116. package/dist/contract/dependencies.d.ts.map +1 -0
  117. package/dist/contract/dependencies.js +237 -0
  118. package/dist/contract/dependencies.js.map +1 -0
  119. package/dist/contract/derive.d.ts +49 -0
  120. package/dist/contract/derive.d.ts.map +1 -0
  121. package/dist/contract/derive.js +540 -0
  122. package/dist/contract/derive.js.map +1 -0
  123. package/dist/contract/fixtures/contract-configs.d.ts +64 -0
  124. package/dist/contract/fixtures/contract-configs.d.ts.map +1 -0
  125. package/dist/contract/fixtures/contract-configs.js +345 -0
  126. package/dist/contract/fixtures/contract-configs.js.map +1 -0
  127. package/dist/contract/id-boundary.d.ts +53 -0
  128. package/dist/contract/id-boundary.d.ts.map +1 -0
  129. package/dist/contract/id-boundary.js +76 -0
  130. package/dist/contract/id-boundary.js.map +1 -0
  131. package/dist/contract/index.d.ts +8 -0
  132. package/dist/contract/index.d.ts.map +1 -0
  133. package/dist/contract/index.js +11 -0
  134. package/dist/contract/index.js.map +1 -0
  135. package/dist/contract/prisma.d.ts +58 -0
  136. package/dist/contract/prisma.d.ts.map +1 -0
  137. package/dist/contract/prisma.js +282 -0
  138. package/dist/contract/prisma.js.map +1 -0
  139. package/dist/contract/relation-graph.d.ts +70 -0
  140. package/dist/contract/relation-graph.d.ts.map +1 -0
  141. package/dist/contract/relation-graph.js +113 -0
  142. package/dist/contract/relation-graph.js.map +1 -0
  143. package/dist/contract/types.d.ts +135 -0
  144. package/dist/contract/types.d.ts.map +1 -0
  145. package/dist/contract/types.js +2 -0
  146. package/dist/contract/types.js.map +1 -0
  147. package/dist/db/client.d.ts +55 -0
  148. package/dist/db/client.d.ts.map +1 -0
  149. package/dist/db/client.js +73 -0
  150. package/dist/db/client.js.map +1 -0
  151. package/dist/db/dev-database.d.ts +124 -0
  152. package/dist/db/dev-database.d.ts.map +1 -0
  153. package/dist/db/dev-database.js +291 -0
  154. package/dist/db/dev-database.js.map +1 -0
  155. package/dist/db/password-front.d.ts +10 -0
  156. package/dist/db/password-front.d.ts.map +1 -0
  157. package/dist/db/password-front.js +147 -0
  158. package/dist/db/password-front.js.map +1 -0
  159. package/dist/db/process-identity.d.ts +36 -0
  160. package/dist/db/process-identity.d.ts.map +1 -0
  161. package/dist/db/process-identity.js +114 -0
  162. package/dist/db/process-identity.js.map +1 -0
  163. package/dist/db/state-file.d.ts +54 -0
  164. package/dist/db/state-file.d.ts.map +1 -0
  165. package/dist/db/state-file.js +91 -0
  166. package/dist/db/state-file.js.map +1 -0
  167. package/dist/db/url.d.ts +89 -0
  168. package/dist/db/url.d.ts.map +1 -0
  169. package/dist/db/url.js +118 -0
  170. package/dist/db/url.js.map +1 -0
  171. package/dist/extend.d.ts +13 -2
  172. package/dist/extend.d.ts.map +1 -1
  173. package/dist/extend.js +24 -1
  174. package/dist/extend.js.map +1 -1
  175. package/dist/fields/index.d.ts +87 -42
  176. package/dist/fields/index.d.ts.map +1 -1
  177. package/dist/fields/index.js +457 -677
  178. package/dist/fields/index.js.map +1 -1
  179. package/dist/filter/collect.d.ts +3 -4
  180. package/dist/filter/collect.d.ts.map +1 -1
  181. package/dist/filter/collect.js +2 -2
  182. package/dist/filter/collect.js.map +1 -1
  183. package/dist/filter/index.d.ts +1 -2
  184. package/dist/filter/index.d.ts.map +1 -1
  185. package/dist/filter/index.js +0 -1
  186. package/dist/filter/index.js.map +1 -1
  187. package/dist/filter/map.d.ts +12 -5
  188. package/dist/filter/map.d.ts.map +1 -1
  189. package/dist/filter/map.js +47 -19
  190. package/dist/filter/map.js.map +1 -1
  191. package/dist/filter/types.d.ts +10 -24
  192. package/dist/filter/types.d.ts.map +1 -1
  193. package/dist/filter/types.js +2 -11
  194. package/dist/filter/types.js.map +1 -1
  195. package/dist/hooks/index.d.ts +22 -31
  196. package/dist/hooks/index.d.ts.map +1 -1
  197. package/dist/hooks/index.js +33 -37
  198. package/dist/hooks/index.js.map +1 -1
  199. package/dist/hooks/transition-guard.d.ts +61 -0
  200. package/dist/hooks/transition-guard.d.ts.map +1 -0
  201. package/dist/hooks/transition-guard.js +93 -0
  202. package/dist/hooks/transition-guard.js.map +1 -0
  203. package/dist/index.d.ts +52 -15
  204. package/dist/index.d.ts.map +1 -1
  205. package/dist/index.js +105 -44
  206. package/dist/index.js.map +1 -1
  207. package/dist/internal.d.ts +4 -2
  208. package/dist/internal.d.ts.map +1 -1
  209. package/dist/internal.js +16 -0
  210. package/dist/internal.js.map +1 -1
  211. package/dist/lib/case-utils.d.ts +0 -1
  212. package/dist/lib/case-utils.d.ts.map +1 -1
  213. package/dist/lib/case-utils.js +0 -3
  214. package/dist/lib/case-utils.js.map +1 -1
  215. package/dist/lib/client-safe-error.d.ts +9 -0
  216. package/dist/lib/client-safe-error.d.ts.map +1 -0
  217. package/dist/lib/client-safe-error.js +23 -0
  218. package/dist/lib/client-safe-error.js.map +1 -0
  219. package/dist/lib/database-errors.d.ts +78 -0
  220. package/dist/lib/database-errors.d.ts.map +1 -0
  221. package/dist/lib/database-errors.js +148 -0
  222. package/dist/lib/database-errors.js.map +1 -0
  223. package/dist/lib/null-prototype-registry.d.ts +9 -0
  224. package/dist/lib/null-prototype-registry.d.ts.map +1 -0
  225. package/dist/lib/null-prototype-registry.js +11 -0
  226. package/dist/lib/null-prototype-registry.js.map +1 -0
  227. package/dist/lib/prisma-errors.d.ts +30 -32
  228. package/dist/lib/prisma-errors.d.ts.map +1 -1
  229. package/dist/lib/prisma-errors.js +86 -46
  230. package/dist/lib/prisma-errors.js.map +1 -1
  231. package/dist/lib/process-global.d.ts +23 -0
  232. package/dist/lib/process-global.d.ts.map +1 -0
  233. package/dist/lib/process-global.js +33 -0
  234. package/dist/lib/process-global.js.map +1 -0
  235. package/dist/lib/warn-once.d.ts +7 -0
  236. package/dist/lib/warn-once.d.ts.map +1 -0
  237. package/dist/lib/warn-once.js +13 -0
  238. package/dist/lib/warn-once.js.map +1 -0
  239. package/dist/mcp/advertise.d.ts +16 -0
  240. package/dist/mcp/advertise.d.ts.map +1 -0
  241. package/dist/mcp/advertise.js +25 -0
  242. package/dist/mcp/advertise.js.map +1 -0
  243. package/dist/mcp/arguments.d.ts +10 -0
  244. package/dist/mcp/arguments.d.ts.map +1 -0
  245. package/dist/mcp/arguments.js +143 -0
  246. package/dist/mcp/arguments.js.map +1 -0
  247. package/dist/mcp/field-schema.d.ts +50 -5
  248. package/dist/mcp/field-schema.d.ts.map +1 -1
  249. package/dist/mcp/field-schema.js +137 -14
  250. package/dist/mcp/field-schema.js.map +1 -1
  251. package/dist/mcp/handler.d.ts +16 -5
  252. package/dist/mcp/handler.d.ts.map +1 -1
  253. package/dist/mcp/handler.js +404 -126
  254. package/dist/mcp/handler.js.map +1 -1
  255. package/dist/mcp/index.d.ts +1 -0
  256. package/dist/mcp/index.d.ts.map +1 -1
  257. package/dist/mcp/index.js +1 -0
  258. package/dist/mcp/index.js.map +1 -1
  259. package/dist/mcp/projection.d.ts +42 -34
  260. package/dist/mcp/projection.d.ts.map +1 -1
  261. package/dist/mcp/projection.js +246 -200
  262. package/dist/mcp/projection.js.map +1 -1
  263. package/dist/mcp/tool-error.d.ts +8 -0
  264. package/dist/mcp/tool-error.d.ts.map +1 -0
  265. package/dist/mcp/tool-error.js +11 -0
  266. package/dist/mcp/tool-error.js.map +1 -0
  267. package/dist/mcp/types.d.ts +3 -2
  268. package/dist/mcp/types.d.ts.map +1 -1
  269. package/dist/mcp/where-id-boundary.d.ts +28 -0
  270. package/dist/mcp/where-id-boundary.d.ts.map +1 -0
  271. package/dist/mcp/where-id-boundary.js +187 -0
  272. package/dist/mcp/where-id-boundary.js.map +1 -0
  273. package/dist/origin.d.ts +147 -0
  274. package/dist/origin.d.ts.map +1 -0
  275. package/dist/origin.js +191 -0
  276. package/dist/origin.js.map +1 -0
  277. package/dist/query/relationship-options.d.ts +35 -6
  278. package/dist/query/relationship-options.d.ts.map +1 -1
  279. package/dist/query/relationship-options.js +33 -23
  280. package/dist/query/relationship-options.js.map +1 -1
  281. package/dist/secured/aggregate.d.ts +32 -0
  282. package/dist/secured/aggregate.d.ts.map +1 -0
  283. package/dist/secured/aggregate.js +31 -0
  284. package/dist/secured/aggregate.js.map +1 -0
  285. package/dist/secured/include.d.ts +320 -0
  286. package/dist/secured/include.d.ts.map +1 -0
  287. package/dist/secured/include.js +650 -0
  288. package/dist/secured/include.js.map +1 -0
  289. package/dist/secured/lock.d.ts +127 -0
  290. package/dist/secured/lock.d.ts.map +1 -0
  291. package/dist/secured/lock.js +275 -0
  292. package/dist/secured/lock.js.map +1 -0
  293. package/dist/secured/lower.d.ts +82 -0
  294. package/dist/secured/lower.d.ts.map +1 -0
  295. package/dist/secured/lower.js +162 -0
  296. package/dist/secured/lower.js.map +1 -0
  297. package/dist/secured/operators.d.ts +7 -0
  298. package/dist/secured/operators.d.ts.map +1 -0
  299. package/dist/secured/operators.js +18 -0
  300. package/dist/secured/operators.js.map +1 -0
  301. package/dist/secured/read.d.ts +208 -0
  302. package/dist/secured/read.d.ts.map +1 -0
  303. package/dist/secured/read.js +1245 -0
  304. package/dist/secured/read.js.map +1 -0
  305. package/dist/secured/select.d.ts +87 -0
  306. package/dist/secured/select.d.ts.map +1 -0
  307. package/dist/secured/select.js +250 -0
  308. package/dist/secured/select.js.map +1 -0
  309. package/dist/secured/vector.d.ts +58 -0
  310. package/dist/secured/vector.d.ts.map +1 -0
  311. package/dist/secured/vector.js +113 -0
  312. package/dist/secured/vector.js.map +1 -0
  313. package/dist/secured/vocabulary.d.ts +227 -0
  314. package/dist/secured/vocabulary.d.ts.map +1 -0
  315. package/dist/secured/vocabulary.js +578 -0
  316. package/dist/secured/vocabulary.js.map +1 -0
  317. package/dist/secured/write.d.ts +58 -0
  318. package/dist/secured/write.d.ts.map +1 -0
  319. package/dist/secured/write.js +87 -0
  320. package/dist/secured/write.js.map +1 -0
  321. package/dist/testing/context.d.ts +236 -0
  322. package/dist/testing/context.d.ts.map +1 -0
  323. package/dist/testing/context.js +457 -0
  324. package/dist/testing/context.js.map +1 -0
  325. package/dist/testing/escape.d.ts +83 -0
  326. package/dist/testing/escape.d.ts.map +1 -0
  327. package/dist/testing/escape.js +148 -0
  328. package/dist/testing/escape.js.map +1 -0
  329. package/dist/testing/extensions.d.ts +48 -0
  330. package/dist/testing/extensions.d.ts.map +1 -0
  331. package/dist/testing/extensions.js +107 -0
  332. package/dist/testing/extensions.js.map +1 -0
  333. package/dist/testing/index.d.ts +5 -0
  334. package/dist/testing/index.d.ts.map +1 -0
  335. package/dist/testing/index.js +11 -0
  336. package/dist/testing/index.js.map +1 -0
  337. package/dist/testing/plans.d.ts +64 -0
  338. package/dist/testing/plans.d.ts.map +1 -0
  339. package/dist/testing/plans.js +47 -0
  340. package/dist/testing/plans.js.map +1 -0
  341. package/dist/types/context.d.ts +110 -0
  342. package/dist/types/context.d.ts.map +1 -0
  343. package/dist/types/context.js +2 -0
  344. package/dist/types/context.js.map +1 -0
  345. package/dist/types/contract.d.ts +198 -0
  346. package/dist/types/contract.d.ts.map +1 -0
  347. package/dist/types/contract.js +2 -0
  348. package/dist/types/contract.js.map +1 -0
  349. package/dist/types/index.d.ts +6 -0
  350. package/dist/types/index.d.ts.map +1 -0
  351. package/dist/types/index.js +11 -0
  352. package/dist/types/index.js.map +1 -0
  353. package/dist/types/inputs.d.ts +83 -0
  354. package/dist/types/inputs.d.ts.map +1 -0
  355. package/dist/types/inputs.js +2 -0
  356. package/dist/types/inputs.js.map +1 -0
  357. package/dist/types/rows.d.ts +76 -0
  358. package/dist/types/rows.d.ts.map +1 -0
  359. package/dist/types/rows.js +2 -0
  360. package/dist/types/rows.js.map +1 -0
  361. package/dist/types/secured-list.d.ts +396 -0
  362. package/dist/types/secured-list.d.ts.map +1 -0
  363. package/dist/types/secured-list.js +2 -0
  364. package/dist/types/secured-list.js.map +1 -0
  365. package/dist/unsafe.d.ts +162 -0
  366. package/dist/unsafe.d.ts.map +1 -0
  367. package/dist/unsafe.js +177 -0
  368. package/dist/unsafe.js.map +1 -0
  369. package/dist/validation/config-refusal.d.ts +16 -0
  370. package/dist/validation/config-refusal.d.ts.map +1 -0
  371. package/dist/validation/config-refusal.js +2 -0
  372. package/dist/validation/config-refusal.js.map +1 -0
  373. package/dist/validation/database-config.d.ts +19 -0
  374. package/dist/validation/database-config.d.ts.map +1 -0
  375. package/dist/validation/database-config.js +221 -0
  376. package/dist/validation/database-config.js.map +1 -0
  377. package/dist/validation/default-value.d.ts +21 -0
  378. package/dist/validation/default-value.d.ts.map +1 -0
  379. package/dist/validation/default-value.js +72 -0
  380. package/dist/validation/default-value.js.map +1 -0
  381. package/dist/validation/extension-packs.d.ts +11 -0
  382. package/dist/validation/extension-packs.d.ts.map +1 -0
  383. package/dist/validation/extension-packs.js +53 -0
  384. package/dist/validation/extension-packs.js.map +1 -0
  385. package/dist/validation/field-config.d.ts +35 -21
  386. package/dist/validation/field-config.d.ts.map +1 -1
  387. package/dist/validation/field-config.js +51 -41
  388. package/dist/validation/field-config.js.map +1 -1
  389. package/dist/validation/field-names.d.ts +15 -0
  390. package/dist/validation/field-names.d.ts.map +1 -0
  391. package/dist/validation/field-names.js +155 -0
  392. package/dist/validation/field-names.js.map +1 -0
  393. package/dist/validation/identifier-names.d.ts +4 -0
  394. package/dist/validation/identifier-names.d.ts.map +1 -0
  395. package/dist/validation/identifier-names.js +39 -0
  396. package/dist/validation/identifier-names.js.map +1 -0
  397. package/dist/validation/needs-closure.d.ts +20 -30
  398. package/dist/validation/needs-closure.d.ts.map +1 -1
  399. package/dist/validation/needs-closure.js +29 -105
  400. package/dist/validation/needs-closure.js.map +1 -1
  401. package/dist/validation/relations.d.ts +17 -0
  402. package/dist/validation/relations.d.ts.map +1 -0
  403. package/dist/validation/relations.js +268 -0
  404. package/dist/validation/relations.js.map +1 -0
  405. package/dist/validation/schema.d.ts.map +1 -1
  406. package/dist/validation/schema.js +1 -3
  407. package/dist/validation/schema.js.map +1 -1
  408. package/dist/where/like.d.ts +32 -0
  409. package/dist/where/like.d.ts.map +1 -0
  410. package/dist/where/like.js +42 -0
  411. package/dist/where/like.js.map +1 -0
  412. package/package.json +70 -8
  413. package/.turbo/turbo-build.log +0 -4
  414. package/CLAUDE.md +0 -609
  415. package/dist/access/access-filter.d.ts +0 -241
  416. package/dist/access/access-filter.d.ts.map +0 -1
  417. package/dist/access/access-filter.js +0 -692
  418. package/dist/access/access-filter.js.map +0 -1
  419. package/dist/access/access-filter.test.d.ts +0 -2
  420. package/dist/access/access-filter.test.d.ts.map +0 -1
  421. package/dist/access/access-filter.test.js +0 -1256
  422. package/dist/access/access-filter.test.js.map +0 -1
  423. package/dist/access/declared-dependencies.test.d.ts +0 -2
  424. package/dist/access/declared-dependencies.test.d.ts.map +0 -1
  425. package/dist/access/declared-dependencies.test.js +0 -226
  426. package/dist/access/declared-dependencies.test.js.map +0 -1
  427. package/dist/access/denied-relation-visibility.test.d.ts +0 -2
  428. package/dist/access/denied-relation-visibility.test.d.ts.map +0 -1
  429. package/dist/access/denied-relation-visibility.test.js +0 -114
  430. package/dist/access/denied-relation-visibility.test.js.map +0 -1
  431. package/dist/access/engine.test.d.ts +0 -2
  432. package/dist/access/engine.test.d.ts.map +0 -1
  433. package/dist/access/engine.test.js +0 -56
  434. package/dist/access/engine.test.js.map +0 -1
  435. package/dist/access/field-access.test.d.ts +0 -2
  436. package/dist/access/field-access.test.d.ts.map +0 -1
  437. package/dist/access/field-access.test.js +0 -635
  438. package/dist/access/field-access.test.js.map +0 -1
  439. package/dist/access/multi-column-read-write.test.d.ts +0 -2
  440. package/dist/access/multi-column-read-write.test.d.ts.map +0 -1
  441. package/dist/access/multi-column-read-write.test.js +0 -183
  442. package/dist/access/multi-column-read-write.test.js.map +0 -1
  443. package/dist/access/relationship-count.d.ts +0 -98
  444. package/dist/access/relationship-count.d.ts.map +0 -1
  445. package/dist/access/relationship-count.js +0 -262
  446. package/dist/access/relationship-count.js.map +0 -1
  447. package/dist/access/relationship-count.test.d.ts +0 -2
  448. package/dist/access/relationship-count.test.d.ts.map +0 -1
  449. package/dist/access/relationship-count.test.js +0 -247
  450. package/dist/access/relationship-count.test.js.map +0 -1
  451. package/dist/access/relationship-label-filter.d.ts +0 -45
  452. package/dist/access/relationship-label-filter.d.ts.map +0 -1
  453. package/dist/access/relationship-label-filter.js +0 -22
  454. package/dist/access/relationship-label-filter.js.map +0 -1
  455. package/dist/access/relationship-label-filter.test.d.ts +0 -2
  456. package/dist/access/relationship-label-filter.test.d.ts.map +0 -1
  457. package/dist/access/relationship-label-filter.test.js +0 -89
  458. package/dist/access/relationship-label-filter.test.js.map +0 -1
  459. package/dist/access/synthetic-include-read.test.d.ts +0 -2
  460. package/dist/access/synthetic-include-read.test.d.ts.map +0 -1
  461. package/dist/access/synthetic-include-read.test.js +0 -121
  462. package/dist/access/synthetic-include-read.test.js.map +0 -1
  463. package/dist/context/nested-operations.d.ts +0 -47
  464. package/dist/context/nested-operations.d.ts.map +0 -1
  465. package/dist/context/nested-operations.js +0 -731
  466. package/dist/context/nested-operations.js.map +0 -1
  467. package/dist/fields/calendar-day.test.d.ts +0 -2
  468. package/dist/fields/calendar-day.test.d.ts.map +0 -1
  469. package/dist/fields/calendar-day.test.js +0 -246
  470. package/dist/fields/calendar-day.test.js.map +0 -1
  471. package/dist/fields/format-prisma-default.d.ts +0 -35
  472. package/dist/fields/format-prisma-default.d.ts.map +0 -1
  473. package/dist/fields/format-prisma-default.js +0 -49
  474. package/dist/fields/format-prisma-default.js.map +0 -1
  475. package/dist/fields/format-prisma-default.test.d.ts +0 -2
  476. package/dist/fields/format-prisma-default.test.d.ts.map +0 -1
  477. package/dist/fields/format-prisma-default.test.js +0 -54
  478. package/dist/fields/format-prisma-default.test.js.map +0 -1
  479. package/dist/fields/relationship-foreign-key.test.d.ts +0 -2
  480. package/dist/fields/relationship-foreign-key.test.d.ts.map +0 -1
  481. package/dist/fields/relationship-foreign-key.test.js +0 -18
  482. package/dist/fields/relationship-foreign-key.test.js.map +0 -1
  483. package/dist/fields/select.test.d.ts +0 -2
  484. package/dist/fields/select.test.d.ts.map +0 -1
  485. package/dist/fields/select.test.js +0 -279
  486. package/dist/fields/select.test.js.map +0 -1
  487. package/dist/fields/text-keystone-compat.test.d.ts +0 -2
  488. package/dist/fields/text-keystone-compat.test.d.ts.map +0 -1
  489. package/dist/fields/text-keystone-compat.test.js +0 -93
  490. package/dist/fields/text-keystone-compat.test.js.map +0 -1
  491. package/dist/filter/filter.test.d.ts +0 -2
  492. package/dist/filter/filter.test.d.ts.map +0 -1
  493. package/dist/filter/filter.test.js +0 -431
  494. package/dist/filter/filter.test.js.map +0 -1
  495. package/dist/filter/serialize.test.d.ts +0 -2
  496. package/dist/filter/serialize.test.d.ts.map +0 -1
  497. package/dist/filter/serialize.test.js +0 -83
  498. package/dist/filter/serialize.test.js.map +0 -1
  499. package/dist/index.test.d.ts +0 -2
  500. package/dist/index.test.d.ts.map +0 -1
  501. package/dist/index.test.js +0 -33
  502. package/dist/index.test.js.map +0 -1
  503. package/dist/lib/case-utils.test.d.ts +0 -2
  504. package/dist/lib/case-utils.test.d.ts.map +0 -1
  505. package/dist/lib/case-utils.test.js +0 -123
  506. package/dist/lib/case-utils.test.js.map +0 -1
  507. package/dist/query/index.d.ts +0 -127
  508. package/dist/query/index.d.ts.map +0 -1
  509. package/dist/query/index.js +0 -179
  510. package/dist/query/index.js.map +0 -1
  511. package/dist/query/index.test.d.ts +0 -2
  512. package/dist/query/index.test.d.ts.map +0 -1
  513. package/dist/query/index.test.js +0 -632
  514. package/dist/query/index.test.js.map +0 -1
  515. package/dist/query/relationship-options.test.d.ts +0 -2
  516. package/dist/query/relationship-options.test.d.ts.map +0 -1
  517. package/dist/query/relationship-options.test.js +0 -150
  518. package/dist/query/relationship-options.test.js.map +0 -1
  519. package/dist/validation/field-config.test.d.ts +0 -2
  520. package/dist/validation/field-config.test.d.ts.map +0 -1
  521. package/dist/validation/field-config.test.js +0 -159
  522. package/dist/validation/field-config.test.js.map +0 -1
  523. package/dist/validation/schema.test.d.ts +0 -2
  524. package/dist/validation/schema.test.d.ts.map +0 -1
  525. package/dist/validation/schema.test.js +0 -409
  526. package/dist/validation/schema.test.js.map +0 -1
  527. package/docs/type-distribution-fix.md +0 -136
  528. package/src/access/access-filter.test.ts +0 -1919
  529. package/src/access/access-filter.ts +0 -1041
  530. package/src/access/declared-dependencies.test.ts +0 -277
  531. package/src/access/declared-dependencies.ts +0 -220
  532. package/src/access/denied-relation-visibility.test.ts +0 -173
  533. package/src/access/depth-limits.ts +0 -27
  534. package/src/access/engine.test.ts +0 -67
  535. package/src/access/engine.ts +0 -193
  536. package/src/access/errors.ts +0 -242
  537. package/src/access/field-access.test.ts +0 -792
  538. package/src/access/field-access.ts +0 -353
  539. package/src/access/field-transforms.ts +0 -68
  540. package/src/access/field-visibility.ts +0 -569
  541. package/src/access/index.ts +0 -82
  542. package/src/access/multi-column-read-write.test.ts +0 -305
  543. package/src/access/query-validation.ts +0 -486
  544. package/src/access/relationship-count.test.ts +0 -344
  545. package/src/access/relationship-count.ts +0 -346
  546. package/src/access/relationship-label-filter.test.ts +0 -128
  547. package/src/access/relationship-label-filter.ts +0 -63
  548. package/src/access/synthetic-include-read.test.ts +0 -179
  549. package/src/access/transaction-registry.ts +0 -58
  550. package/src/access/types.ts +0 -391
  551. package/src/config/index.ts +0 -177
  552. package/src/config/label.ts +0 -51
  553. package/src/config/nav-count.ts +0 -77
  554. package/src/config/plugin-engine.ts +0 -261
  555. package/src/config/types.ts +0 -3270
  556. package/src/context/apply-defaults.ts +0 -47
  557. package/src/context/hook-pipeline.ts +0 -137
  558. package/src/context/index.ts +0 -1737
  559. package/src/context/nested-operations.ts +0 -1325
  560. package/src/context/transaction-boundary.ts +0 -485
  561. package/src/context/write-pipeline.ts +0 -732
  562. package/src/extend.ts +0 -28
  563. package/src/fields/calendar-day.test.ts +0 -291
  564. package/src/fields/format-prisma-default.test.ts +0 -64
  565. package/src/fields/format-prisma-default.ts +0 -64
  566. package/src/fields/index.ts +0 -1901
  567. package/src/fields/relationship-foreign-key.test.ts +0 -29
  568. package/src/fields/select.test.ts +0 -336
  569. package/src/fields/text-keystone-compat.test.ts +0 -126
  570. package/src/filter/collect.ts +0 -108
  571. package/src/filter/filter.test.ts +0 -538
  572. package/src/filter/index.ts +0 -26
  573. package/src/filter/map.ts +0 -63
  574. package/src/filter/parse.ts +0 -99
  575. package/src/filter/serialize.test.ts +0 -115
  576. package/src/filter/serialize.ts +0 -73
  577. package/src/filter/types.ts +0 -120
  578. package/src/hooks/index.ts +0 -752
  579. package/src/index.test.ts +0 -50
  580. package/src/index.ts +0 -184
  581. package/src/internal.ts +0 -61
  582. package/src/lib/case-utils.test.ts +0 -159
  583. package/src/lib/case-utils.ts +0 -68
  584. package/src/lib/prisma-errors.ts +0 -86
  585. package/src/mcp/constants.ts +0 -24
  586. package/src/mcp/field-schema.ts +0 -84
  587. package/src/mcp/handler.ts +0 -633
  588. package/src/mcp/index.ts +0 -7
  589. package/src/mcp/projection.ts +0 -497
  590. package/src/mcp/types.ts +0 -18
  591. package/src/query/index.test.ts +0 -830
  592. package/src/query/index.ts +0 -352
  593. package/src/query/relationship-options.test.ts +0 -194
  594. package/src/query/relationship-options.ts +0 -78
  595. package/src/utils/password.ts +0 -80
  596. package/src/validation/field-config.test.ts +0 -199
  597. package/src/validation/field-config.ts +0 -139
  598. package/src/validation/needs-closure.ts +0 -188
  599. package/src/validation/schema.test.ts +0 -487
  600. package/src/validation/schema.ts +0 -51
  601. package/tests/access-relationships.test.ts +0 -646
  602. package/tests/access.test.ts +0 -590
  603. package/tests/apply-defaults.test.ts +0 -119
  604. package/tests/bare-read-scalars.test.ts +0 -147
  605. package/tests/computed-field-selective-evaluation.test.ts +0 -418
  606. package/tests/config.test.ts +0 -242
  607. package/tests/context.test.ts +0 -3141
  608. package/tests/default-value-create.test.ts +0 -299
  609. package/tests/field-hooks.test.ts +0 -410
  610. package/tests/field-types.test.ts +0 -1291
  611. package/tests/hook-context-secured.test.ts +0 -424
  612. package/tests/hook-pipeline.test.ts +0 -233
  613. package/tests/hooks.test.ts +0 -481
  614. package/tests/interactive-transaction.test.ts +0 -444
  615. package/tests/label.test.ts +0 -135
  616. package/tests/mcp-fields-projection-access.test.ts +0 -250
  617. package/tests/mcp-handler.test.ts +0 -1411
  618. package/tests/multi-column-validation-ordering.test.ts +0 -305
  619. package/tests/nav-count.test.ts +0 -189
  620. package/tests/needs-declared-dependencies.test.ts +0 -503
  621. package/tests/nested-access-and-hooks.test.ts +0 -2566
  622. package/tests/nested-operation-registry.test.ts +0 -231
  623. package/tests/nested-write-hooks.test.ts +0 -864
  624. package/tests/nested-write-synthetic-relation.test.ts +0 -437
  625. package/tests/password-type-distribution.test.ts +0 -154
  626. package/tests/password-types.test.ts +0 -174
  627. package/tests/password.test.ts +0 -263
  628. package/tests/plugin-engine.test.ts +0 -1155
  629. package/tests/prisma-errors.test.ts +0 -141
  630. package/tests/resolve-chain.test.ts +0 -411
  631. package/tests/singleton.test.ts +0 -421
  632. package/tests/sudo.test.ts +0 -676
  633. package/tests/to-one-include-access-filter.test.ts +0 -172
  634. package/tests/transaction-boundary-hooks.test.ts +0 -710
  635. package/tests/transaction-boundary-outermost.test.ts +0 -530
  636. package/tests/virtual-fields.test.ts +0 -421
  637. package/tests/with-session.test.ts +0 -243
  638. package/tests/write-pipeline.test.ts +0 -617
  639. package/tsconfig.json +0 -12
  640. package/tsconfig.tsbuildinfo +0 -1
  641. package/vitest.config.ts +0 -69
@@ -0,0 +1,345 @@
1
+ import { bigInt, calendarDay, checkbox, decimal, integer, json, password, relationship, select, text, timestamp, virtual, } from '../../fields/index.js';
2
+ /**
3
+ * The blog example, as the Prisma 8 config surface spells it: a singleton,
4
+ * a virtual field, a select enum, a mapped calendar day, a bidirectional
5
+ * one-to-many and a list-only ref (synthetic back-relation). Two of its
6
+ * computed fields declare `needs` — one over a relation, one over sibling
7
+ * columns — so the dependency-set table has both kinds to resolve.
8
+ */
9
+ export const blogConfig = {
10
+ db: { provider: 'postgresql', timestamps: true },
11
+ lists: {
12
+ Settings: {
13
+ isSingleton: true,
14
+ fields: {
15
+ siteName: text({ validation: { isRequired: true }, defaultValue: 'My Blog' }),
16
+ maintenanceMode: checkbox({ defaultValue: false }),
17
+ maxUploadSize: integer({ defaultValue: 10 }),
18
+ },
19
+ },
20
+ User: {
21
+ fields: {
22
+ name: text({ validation: { isRequired: true } }),
23
+ email: text({ validation: { isRequired: true }, isIndexed: 'unique' }),
24
+ password: password({ validation: { isRequired: true } }),
25
+ posts: relationship({ ref: 'Post.author', many: true }),
26
+ displayName: virtual({
27
+ type: 'string',
28
+ needs: ['name'],
29
+ hooks: { resolveOutput: ({ item }) => String(item.name) },
30
+ }),
31
+ },
32
+ },
33
+ Post: {
34
+ fields: {
35
+ title: text({ validation: { isRequired: true }, isIndexed: true }),
36
+ slug: text({ validation: { isRequired: true }, isIndexed: 'unique' }),
37
+ content: text(),
38
+ status: select({
39
+ options: [
40
+ { label: 'Draft', value: 'draft' },
41
+ { label: 'Published', value: 'published' },
42
+ ],
43
+ defaultValue: 'draft',
44
+ db: { type: 'enum' },
45
+ }),
46
+ publishDate: calendarDay({ db: { map: 'publish_date' } }),
47
+ publishedAt: timestamp(),
48
+ author: relationship({ ref: 'User.posts', db: { onDelete: 'setNull' } }),
49
+ category: relationship({ ref: 'Category' }),
50
+ byline: virtual({
51
+ type: 'string',
52
+ needs: ['author'],
53
+ hooks: { resolveOutput: ({ item }) => String(item.authorId ?? 'anonymous') },
54
+ }),
55
+ excerpt: virtual({
56
+ type: 'string',
57
+ needs: ['content', 'title'],
58
+ hooks: { resolveOutput: ({ item }) => String(item.title) },
59
+ }),
60
+ },
61
+ db: { indexes: [{ fields: ['author', 'status'], name: 'post_author_status' }] },
62
+ },
63
+ Category: {
64
+ fields: { name: text({ validation: { isRequired: true } }) },
65
+ db: { timestamps: false },
66
+ },
67
+ },
68
+ };
69
+ /**
70
+ * The lists `authPlugin` derives from better-auth's table shapes, mirrored
71
+ * as a plain config: the stack-auth package depends on core, so core's tests
72
+ * cannot import it without a cycle. Field shapes follow
73
+ * `packages/auth/src/config/derive-auth-lists.ts` — mapped, non-nullable,
74
+ * cascading foreign keys; `db.timestamps: true` per list; a named unique
75
+ * `db.indexes` entry on the rate-limit table.
76
+ */
77
+ export const authConfig = {
78
+ db: { provider: 'postgresql' },
79
+ lists: {
80
+ User: {
81
+ fields: {
82
+ name: text({ validation: { isRequired: true }, db: { isNullable: false } }),
83
+ email: text({
84
+ validation: { isRequired: true },
85
+ isIndexed: 'unique',
86
+ db: { isNullable: false },
87
+ }),
88
+ emailVerified: checkbox({ defaultValue: false, db: { isNullable: false } }),
89
+ image: text({ db: { isNullable: true } }),
90
+ sessions: relationship({ ref: 'Session.user', many: true }),
91
+ accounts: relationship({ ref: 'Account.user', many: true }),
92
+ },
93
+ db: { timestamps: true, map: 'user' },
94
+ },
95
+ Session: {
96
+ fields: {
97
+ token: text({
98
+ validation: { isRequired: true },
99
+ isIndexed: 'unique',
100
+ db: { isNullable: false },
101
+ }),
102
+ expiresAt: timestamp({ db: { isNullable: false } }),
103
+ ipAddress: text({ db: { isNullable: true } }),
104
+ userAgent: text({ db: { isNullable: true } }),
105
+ user: relationship({
106
+ ref: 'User.sessions',
107
+ isIndexed: true,
108
+ db: { isNullable: false, foreignKey: { map: 'userId' }, onDelete: 'cascade' },
109
+ }),
110
+ },
111
+ db: { timestamps: true, map: 'session' },
112
+ },
113
+ Account: {
114
+ fields: {
115
+ accountId: text({ validation: { isRequired: true }, db: { isNullable: false } }),
116
+ providerId: text({ validation: { isRequired: true }, db: { isNullable: false } }),
117
+ user: relationship({
118
+ ref: 'User.accounts',
119
+ isIndexed: true,
120
+ db: { isNullable: false, foreignKey: { map: 'userId' }, onDelete: 'cascade' },
121
+ }),
122
+ accessToken: text({ db: { isNullable: true } }),
123
+ refreshToken: text({ db: { isNullable: true } }),
124
+ accessTokenExpiresAt: timestamp({ db: { isNullable: true } }),
125
+ refreshTokenExpiresAt: timestamp({ db: { isNullable: true } }),
126
+ scope: text({ db: { isNullable: true } }),
127
+ idToken: text({ db: { isNullable: true } }),
128
+ password: text({ db: { isNullable: true } }),
129
+ },
130
+ db: { timestamps: true, map: 'account' },
131
+ },
132
+ Verification: {
133
+ fields: {
134
+ identifier: text({
135
+ validation: { isRequired: true },
136
+ isIndexed: true,
137
+ db: { isNullable: false },
138
+ }),
139
+ value: text({ validation: { isRequired: true }, db: { isNullable: false } }),
140
+ expiresAt: timestamp({ db: { isNullable: false } }),
141
+ },
142
+ db: { timestamps: true, map: 'verification' },
143
+ },
144
+ RateLimit: {
145
+ fields: {
146
+ key: text({ db: { isNullable: false } }),
147
+ count: integer({ db: { isNullable: false } }),
148
+ lastRequest: bigInt({ db: { isNullable: false } }),
149
+ },
150
+ db: {
151
+ map: 'rateLimit',
152
+ indexes: [{ fields: ['key'], unique: true, name: 'RateLimit_key_key' }],
153
+ },
154
+ },
155
+ },
156
+ };
157
+ /**
158
+ * A test-local vector field whose descriptor names the pgvector pack. The
159
+ * RAG package's embedding field itself moves in a later spec; this stands in
160
+ * for any third-party field typed by an extension pack.
161
+ */
162
+ export function vector(options) {
163
+ return {
164
+ type: 'vector',
165
+ getContractField: (fieldName) => ({
166
+ kind: 'column',
167
+ name: fieldName,
168
+ type: { pack: 'pgvector', type: 'Vector', args: [options.dimensions] },
169
+ nullable: true,
170
+ }),
171
+ };
172
+ }
173
+ export const ragConfig = {
174
+ db: {
175
+ provider: 'postgresql',
176
+ extensions: [{ name: 'pgvector', from: '@prisma/orm-extension-pgvector' }],
177
+ },
178
+ lists: {
179
+ Document: {
180
+ fields: {
181
+ title: text({ validation: { isRequired: true } }),
182
+ content: text(),
183
+ embedding: vector({ dimensions: 3 }),
184
+ },
185
+ },
186
+ },
187
+ };
188
+ /**
189
+ * Every ownership case ADR-0064 names: explicit `db.foreignKey: true`
190
+ * (`Profile.user`), the alphabetical default (`Passport` sorts before
191
+ * `Person`, so `Passport.holder` owns), and a self-referential pair on one
192
+ * list (`partner` sorts before `spouse`, so `Person.partner` owns).
193
+ */
194
+ export const oneToOneConfig = {
195
+ db: { provider: 'postgresql', idField: 'cuid2' },
196
+ lists: {
197
+ User: {
198
+ fields: {
199
+ email: text({ isIndexed: 'unique' }),
200
+ profile: relationship({ ref: 'Profile.user' }),
201
+ },
202
+ db: { idField: 'int autoincrement' },
203
+ },
204
+ Profile: {
205
+ fields: {
206
+ bio: text(),
207
+ user: relationship({
208
+ ref: 'User.profile',
209
+ db: { foreignKey: true, isNullable: false, onDelete: 'cascade', onUpdate: 'cascade' },
210
+ }),
211
+ },
212
+ },
213
+ Person: {
214
+ fields: {
215
+ name: text(),
216
+ passport: relationship({ ref: 'Passport.holder' }),
217
+ partner: relationship({ ref: 'Person.spouse' }),
218
+ spouse: relationship({ ref: 'Person.partner' }),
219
+ },
220
+ },
221
+ Passport: {
222
+ fields: {
223
+ number: text({ isIndexed: 'unique' }),
224
+ holder: relationship({ ref: 'Person.passport' }),
225
+ },
226
+ },
227
+ },
228
+ };
229
+ /**
230
+ * Two Postgres schemas: `db.schemas` declares them, `Session` lives in
231
+ * `auth` and points back at `User` in the default `public`.
232
+ */
233
+ export const multiSchemaConfig = {
234
+ db: { provider: 'postgresql', schemas: ['public', 'auth'] },
235
+ lists: {
236
+ User: {
237
+ fields: {
238
+ email: text({ isIndexed: 'unique' }),
239
+ sessions: relationship({ ref: 'Session.user', many: true }),
240
+ },
241
+ },
242
+ Session: {
243
+ fields: {
244
+ token: text({ isIndexed: 'unique' }),
245
+ user: relationship({ ref: 'User.sessions', db: { isNullable: false } }),
246
+ },
247
+ db: { schema: 'auth', map: 'session' },
248
+ },
249
+ },
250
+ };
251
+ /**
252
+ * Every `db.nativeType` override the derivation honours, next to the
253
+ * builders' own defaults it overrides.
254
+ */
255
+ export const nativeTypesConfig = {
256
+ db: { provider: 'postgresql' },
257
+ lists: {
258
+ Reading: {
259
+ fields: {
260
+ code: text({ db: { nativeType: 'VarChar(255)' } }),
261
+ tag: text({ db: { nativeType: 'Char(3)' } }),
262
+ amount: decimal({ db: { nativeType: 'Decimal(10, 2)' } }),
263
+ ratio: decimal({ db: { nativeType: 'Real' } }),
264
+ raw: json({ db: { nativeType: 'Json' } }),
265
+ doc: json(),
266
+ takenAt: timestamp({ db: { nativeType: 'Timestamp(3)' } }),
267
+ seenAt: timestamp({ db: { nativeType: 'Timestamptz(6)' } }),
268
+ atTime: timestamp({ db: { nativeType: 'Time(2)' } }),
269
+ day: timestamp({ db: { nativeType: 'Date' } }),
270
+ },
271
+ },
272
+ },
273
+ };
274
+ /**
275
+ * Names long enough that PostgreSQL has to truncate the constraint names it
276
+ * derives: a 60-character table (whose `_pkey` overflows on the label alone), a
277
+ * unique column whose table+column pair overflows, and a composite unique whose
278
+ * two columns overflow between them. PostgreSQL reserves the `_pkey`/`_key`
279
+ * label and shrinks the components, so the emitted map is only right if it
280
+ * does the same.
281
+ */
282
+ export const longIdentifierConfig = {
283
+ db: { provider: 'postgresql' },
284
+ lists: {
285
+ Overflowing: {
286
+ fields: {
287
+ ['c'.repeat(55)]: text({ isIndexed: 'unique' }),
288
+ left: text({ db: { map: 'l'.repeat(40) } }),
289
+ right: text({ db: { map: 'r'.repeat(40) } }),
290
+ },
291
+ db: {
292
+ map: 'A'.repeat(60),
293
+ indexes: [{ fields: ['left', 'right'], unique: true }],
294
+ },
295
+ },
296
+ },
297
+ };
298
+ /**
299
+ * The names and values the renderer has to survive rather than the ones it
300
+ * usually sees: a list called `models` (the record the emitted callback keeps
301
+ * its model tokens in), a list called `StatusEnum` beside an enum called
302
+ * `Status`, a non-identifier field key, a non-identifier index name, and a
303
+ * default carrying a quote, a backslash, every line terminator and non-ASCII
304
+ * text. Nothing here enforces PascalCase or an identifier-shaped field key, so
305
+ * every one of these is reachable from a real config.
306
+ */
307
+ export const hostileNamesConfig = {
308
+ db: { provider: 'postgresql' },
309
+ lists: {
310
+ models: {
311
+ fields: {
312
+ 'weird-key': text({
313
+ defaultValue: "it's \\ a quote, a backslash,\r\n a CRLF,\u2028 a line separator,\u2029 a paragraph separator \u2014 caf\u00e9 \ud83c\udf10",
314
+ }),
315
+ plain: text(),
316
+ },
317
+ db: {
318
+ map: "weird'table\\name",
319
+ indexes: [{ fields: ['weird-key', 'plain'], name: "weird'index name" }],
320
+ },
321
+ },
322
+ // A model whose name is exactly the enum's, and one whose name is what the
323
+ // enum binding used to be spelled as.
324
+ Status: {
325
+ fields: { label: text() },
326
+ },
327
+ StatusEnum: {
328
+ fields: { label: text() },
329
+ },
330
+ Ticket: {
331
+ fields: {
332
+ state: select({
333
+ options: [
334
+ { label: "It's open", value: 'open' },
335
+ { label: 'Closed', value: 'closed' },
336
+ ],
337
+ defaultValue: 'open',
338
+ db: { type: 'enum', enumName: 'Status' },
339
+ }),
340
+ owner: relationship({ ref: 'models' }),
341
+ },
342
+ },
343
+ },
344
+ };
345
+ //# sourceMappingURL=contract-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-configs.js","sourceRoot":"","sources":["../../../src/contract/fixtures/contract-configs.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,WAAW,EACX,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,IAAI,EACJ,SAAS,EACT,OAAO,GACR,MAAM,uBAAuB,CAAA;AAE9B;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAmB;IACxC,EAAE,EAAE,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE;IAChD,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,WAAW,EAAE,IAAI;YACjB,MAAM,EAAE;gBACN,QAAQ,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;gBAC7E,eAAe,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;gBAClD,aAAa,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC;aAC7C;SACF;QACD,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;gBAChD,KAAK,EA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AAsC;QACtC,MAAM,EAAE;YACN,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;SAC1B;QACD,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;SAC1B;QACD,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,MAAM,CAAC;oBACZ,OAAO,EAAE;wBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;wBACrC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;qBACrC;oBACD,YAAY,EAAE,MAAM;oBACpB,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE;iBACzC,CAAC;gBACF,KAAK,EAAE,YAAY,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;aACvC;SACF;KACF;CACF,CAAA"}
@@ -0,0 +1,53 @@
1
+ import type { OpenSaasConfig } from '../config/types.js';
2
+ import type { ContractIdColumn } from './types.js';
3
+ /**
4
+ * A primary key at its own type: `string` for a `uuid7` or `cuid2` list,
5
+ * `number` for an `int autoincrement` list and for a singleton (ADR-0048). No
6
+ * stack-level `string | number` union crosses a package boundary — this is the
7
+ * boundary.
8
+ */
9
+ export type ListIdValue = string | number;
10
+ /**
11
+ * The outcome of parsing one wire id. `ok: false` carries no detail about the
12
+ * list or the value: a caller turns it into a 404 or a validation error, and
13
+ * neither may describe what the id should have looked like.
14
+ */
15
+ export type ListIdParse = {
16
+ ok: true;
17
+ value: ListIdValue;
18
+ } | {
19
+ ok: false;
20
+ };
21
+ /**
22
+ * The JSON Schema for a list's own id at the type its primary key actually
23
+ * carries (ADR-0048) — an `int autoincrement` (or singleton) list advertises
24
+ * `integer` rather than telling every caller every id is a string. Shared by
25
+ * the `where.id` schema on `update`/`delete` and the `connect.id` schema
26
+ * inside a relationship field's `data` schema, so the two never drift.
27
+ */
28
+ export declare function listIdJsonSchema(config: OpenSaasConfig, listKey: string): Record<string, unknown>;
29
+ /**
30
+ * The primary-key column of one list, as the contract declares it, or `null`
31
+ * when the config declares no such list.
32
+ */
33
+ export declare function listIdColumn(config: OpenSaasConfig, listKey: string): ContractIdColumn | null;
34
+ /**
35
+ * Parse one id off the wire into the type its list's primary key actually
36
+ * carries (ADR-0048).
37
+ *
38
+ * Admin URLs, MCP tool arguments and server-action params are all strings, and
39
+ * the id type is per list. This is the one place that reads the list's id
40
+ * strategy from the contract and parses accordingly, so an `int autoincrement`
41
+ * list gets a `number` and a malformed id fails here rather than reaching the
42
+ * ORM as a `NaN`, a type error from Postgres, or a row that silently does not
43
+ * match.
44
+ *
45
+ * A value already at the list's id type passes through, so a caller that
46
+ * received a parsed id (a `number` from a JSON body) need not re-encode it.
47
+ *
48
+ * Known limits: shape is all this can check. A well-formed id naming no row is
49
+ * `ok`, and the read that follows answers `null` — which is also the answer for
50
+ * a row the session may not see, and must stay so.
51
+ */
52
+ export declare function parseListId(config: OpenSaasConfig, listKey: string, raw: unknown): ListIdParse;
53
+ //# sourceMappingURL=id-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-boundary.d.ts","sourceRoot":"","sources":["../../src/contract/id-boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AAEzC;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAA;AAyB1E;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIjG;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAG7F;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,WAAW,CAgB9F"}
@@ -0,0 +1,76 @@
1
+ import { idColumn, resolveIdStrategy } from './derive.js';
2
+ /** UUID at any version — `uuid7` mints v7, a row adopted from elsewhere may not be. */
3
+ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4
+ /** cuid2 as the contract's `char(24)` column holds it. */
5
+ const CUID2 = /^[a-z][a-z0-9]{23}$/i;
6
+ /** cuid v1 (25 characters, `c` prefix) or cuid2, as a `text` id column may hold either. */
7
+ const CUID = /^(?:c[a-z0-9]{24}|[a-z][a-z0-9]{23})$/i;
8
+ const INTEGER = /^-?\d+$/;
9
+ /**
10
+ * `int autoincrement` and `singleton` both sit in a Postgres `int` — int4 —
11
+ * so a value outside this range is not an id the column can hold, and must
12
+ * fail here rather than reach the driver as an out-of-range error.
13
+ */
14
+ const INT4_MIN = -2_147_483_648;
15
+ const INT4_MAX = 2_147_483_647;
16
+ function inInt4(value) {
17
+ return Number.isInteger(value) && value >= INT4_MIN && value <= INT4_MAX;
18
+ }
19
+ /**
20
+ * The JSON Schema for a list's own id at the type its primary key actually
21
+ * carries (ADR-0048) — an `int autoincrement` (or singleton) list advertises
22
+ * `integer` rather than telling every caller every id is a string. Shared by
23
+ * the `where.id` schema on `update`/`delete` and the `connect.id` schema
24
+ * inside a relationship field's `data` schema, so the two never drift.
25
+ */
26
+ export function listIdJsonSchema(config, listKey) {
27
+ const strategy = listIdColumn(config, listKey)?.strategy;
28
+ const integer = strategy === 'int autoincrement' || strategy === 'singleton';
29
+ return { type: integer ? 'integer' : 'string' };
30
+ }
31
+ /**
32
+ * The primary-key column of one list, as the contract declares it, or `null`
33
+ * when the config declares no such list.
34
+ */
35
+ export function listIdColumn(config, listKey) {
36
+ if (!Object.hasOwn(config.lists, listKey))
37
+ return null;
38
+ return idColumn(resolveIdStrategy(config.lists[listKey], config));
39
+ }
40
+ /**
41
+ * Parse one id off the wire into the type its list's primary key actually
42
+ * carries (ADR-0048).
43
+ *
44
+ * Admin URLs, MCP tool arguments and server-action params are all strings, and
45
+ * the id type is per list. This is the one place that reads the list's id
46
+ * strategy from the contract and parses accordingly, so an `int autoincrement`
47
+ * list gets a `number` and a malformed id fails here rather than reaching the
48
+ * ORM as a `NaN`, a type error from Postgres, or a row that silently does not
49
+ * match.
50
+ *
51
+ * A value already at the list's id type passes through, so a caller that
52
+ * received a parsed id (a `number` from a JSON body) need not re-encode it.
53
+ *
54
+ * Known limits: shape is all this can check. A well-formed id naming no row is
55
+ * `ok`, and the read that follows answers `null` — which is also the answer for
56
+ * a row the session may not see, and must stay so.
57
+ */
58
+ export function parseListId(config, listKey, raw) {
59
+ const column = listIdColumn(config, listKey);
60
+ if (!column)
61
+ return { ok: false };
62
+ if (column.strategy === 'int autoincrement' || column.strategy === 'singleton') {
63
+ if (typeof raw === 'number') {
64
+ return inInt4(raw) ? { ok: true, value: raw } : { ok: false };
65
+ }
66
+ if (typeof raw !== 'string' || !INTEGER.test(raw))
67
+ return { ok: false };
68
+ const value = Number(raw);
69
+ return inInt4(value) ? { ok: true, value } : { ok: false };
70
+ }
71
+ if (typeof raw !== 'string')
72
+ return { ok: false };
73
+ const pattern = column.strategy === 'uuid7' ? UUID : column.strategy === 'cuid' ? CUID : CUID2;
74
+ return pattern.test(raw) ? { ok: true, value: raw } : { ok: false };
75
+ }
76
+ //# sourceMappingURL=id-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-boundary.js","sourceRoot":"","sources":["../../src/contract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AAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAA;AACrE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { deriveContract } from './derive.js';
2
+ export { listIdColumn, parseListId, type ListIdParse, type ListIdValue } from './id-boundary.js';
3
+ export { deriveConstraintMap, deriveDependencyTable, deriveGeneratedTables, } from './dependencies.js';
4
+ export { assertRelationGraphAgrees, RelationGraphDivergenceError, type EmittedContract, } from './relation-graph.js';
5
+ export { buildPrismaContract, toEmittedContract, type BuildPrismaContractOptions, type PrismaContract, type PrismaContractPacks, } from './prisma.js';
6
+ export type { ConstraintMap, DependencyTable, FieldDependencySet, GeneratedTables, ListDependencies, UniqueConstraint, } from './dependencies.js';
7
+ export type { ContractColumn, ContractData, ContractEnum, ContractForeignKey, ContractIdColumn, ContractIdStrategy, ContractIndex, ContractModel, ContractRelation, ContractRelationKind, ContractTimestamps, } from './types.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAChG,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAA;AACpB,YAAY,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAA"}
@@ -0,0 +1,11 @@
1
+ // @opensaas/stack-core/contract
2
+ //
3
+ // The contract derivation (ADR-0057) and its Prisma 8 builder feed. The
4
+ // derivation and the relation-graph assertion are also on the root; this
5
+ // subpath adds `buildPrismaContract`, which imports `@prisma/orm-postgres`.
6
+ export { deriveContract } from './derive.js';
7
+ export { listIdColumn, parseListId } from './id-boundary.js';
8
+ export { deriveConstraintMap, deriveDependencyTable, deriveGeneratedTables, } from './dependencies.js';
9
+ export { assertRelationGraphAgrees, RelationGraphDivergenceError, } from './relation-graph.js';
10
+ export { buildPrismaContract, toEmittedContract, } from './prisma.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,4EAA4E;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAsC,MAAM,kBAAkB,CAAA;AAChG,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAE7B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,mBAAmB,EACnB,iBAAiB,GAIlB,MAAM,aAAa,CAAA"}
@@ -0,0 +1,58 @@
1
+ import type { ExtensionPackRef } from '@prisma/orm-postgres/components';
2
+ import type { Contract } from '@prisma/orm-postgres/contract/types';
3
+ import type { SqlStorage } from '@prisma/orm-postgres/family-contract/types';
4
+ import type { EmittedContract } from './relation-graph.js';
5
+ import type { ContractData } from './types.js';
6
+ /** A built Prisma 8 contract — what `postgres({ contract })` and the control client take. */
7
+ export type PrismaContract = Contract<SqlStorage>;
8
+ /**
9
+ * The extension packs a contract declares, keyed by pack name — each value
10
+ * is the default export of the pack's `/pack` subpath
11
+ * (`import pgvector from '@prisma/orm-extension-pgvector/pack'`).
12
+ */
13
+ export type PrismaContractPacks = Record<string, ExtensionPackRef<'sql', string>>;
14
+ export type BuildPrismaContractOptions = {
15
+ /**
16
+ * The loaded pack for every entry in the data's `extensions`. Core cannot
17
+ * import a pack by package name on the caller's behalf; the caller resolves
18
+ * each `from` and passes the value here.
19
+ */
20
+ packs?: PrismaContractPacks;
21
+ };
22
+ /**
23
+ * Feed {@link ContractData} into Prisma's contract builder and return the
24
+ * built contract — the in-process equivalent of rendering the Contract
25
+ * module and running `prisma contract emit` (ADR-0057). The builder
26
+ * validates as it builds, so an invalid derivation throws here.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * import pgvector from '@prisma/orm-extension-pgvector/pack'
31
+ * const contract = buildPrismaContract(deriveContract(config), { packs: { pgvector } })
32
+ * const db = postgres({ contract, url })
33
+ * ```
34
+ *
35
+ * Every date/time column — `dateTime`, `timestamp`, `date` and the two
36
+ * auto-timestamps — is bound to the pack's `-string` codec rather than its
37
+ * `-temporal` twin. The temporal codecs, and the `instantNow` generator
38
+ * behind `temporal.updatedAt()`, require a global `Temporal`, which no
39
+ * supported Node release ships (ADR-0048's re-verification row). The
40
+ * string codecs read and write ISO-8601 text; the column type is the same.
41
+ *
42
+ * A `db.indexes` name is adopted verbatim: `constraints.unique(..., { name })`
43
+ * is exact at rc.8, while `constraints.index(..., { name })` is a wire-name
44
+ * prefix that gains a content hash, so an index's name goes through `map`.
45
+ *
46
+ * Known limits:
47
+ * - The loaded pack value for every declared extension must arrive in
48
+ * `options.packs`; core does not import a pack by package name on the
49
+ * caller's behalf.
50
+ */
51
+ export declare function buildPrismaContract(data: ContractData, options?: BuildPrismaContractOptions): PrismaContract;
52
+ /**
53
+ * The JSON form of a built contract — what `prisma contract emit` writes to
54
+ * `contract.json` (minus `schemaVersion` and `_generated`), and what
55
+ * {@link assertRelationGraphAgrees} reads.
56
+ */
57
+ export declare function toEmittedContract(contract: PrismaContract): EmittedContract;
58
+ //# sourceMappingURL=prisma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/contract/prisma.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,gBAAgB,EACjB,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAA;AAE5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAkB,YAAY,EAAmC,MAAM,YAAY,CAAA;AAE/F,6FAA6F;AAC7F,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAA;AAEjD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AAEjF,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC5B,CAAA;AAyRD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,YAAY,EAClB,OAAO,GAAE,0BAA+B,GACvC,cAAc,CAwChB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,CAE3E"}