@opensaas/stack-core 0.43.0 → 0.44.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (641) hide show
  1. package/CHANGELOG.md +2753 -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 +1035 -611
  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 +629 -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 +294 -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 +153 -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 +462 -678
  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 -16
  204. package/dist/index.d.ts.map +1 -1
  205. package/dist/index.js +105 -51
  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 +237 -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 -74
  464. package/dist/context/nested-operations.d.ts.map +0 -1
  465. package/dist/context/nested-operations.js +0 -847
  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 -1470
  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 -192
  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 -3146
  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 -317
  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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAKhD,YAAY,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,eAAe,EAIf,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAG1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,GACb,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,yBAAyB,GAC1B,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,MAAM,iCAAiC,CAAA;AAOlG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,gCAAgC,CAAA;AAQvC,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,GACzB,MAAM,uCAAuC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAK/D,YAAY,EACV,cAAc,EACd,2BAA2B,EAC3B,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,0BAA0B,EAC1B,uBAAuB,EAIvB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAG1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,OAAO,EACP,aAAa,EACb,YAAY,EAIZ,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,GACP,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACL,mBAAmB,EACnB,8BAA8B,EAC9B,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AACpB,YAAY,E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OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,yBAAyB,EACzB,4BAA4B,EAC5B,KAAK,eAAe,GACrB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAO5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AACnC,YAAY,EACV,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,4BAA4B,CAAA;AAKnC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,iCAAiC,CAAA;AACxC,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AAOlG,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,cAAc,EACd,WAAW,EACX,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA"}
package/dist/index.js CHANGED
@@ -8,11 +8,65 @@
8
8
  // Internal plumbing lives on '@opensaas/stack-core/internal' (unstable).
9
9
  // ───────────────────────────────────────────────────────────────
10
10
  // Config builders
11
- export { config, list } from './config/index.js';
11
+ export { config, list, getPluginData } from './config/index.js';
12
+ // The Unsafe surface (ADR-0056, ADR-0059)
13
+ export { createUnsafeSurface, createUnsafeTransactionSurface, unavailableUnsafeSurface, UnsafeSurfaceUnavailableError, } from './unsafe.js';
14
+ // The access-filter builder — supported API (ADR-0038, ADR-0057). Evaluate a
15
+ // list's operation-level rule, fold its result into the caller's `where`, and
16
+ // gate a create. A package that reads outside `context.db` — a vector search
17
+ // issuing its own SQL, a plugin composing a filter — calls these rather than
18
+ // carrying a copy. They scope ROWS only: field-level `read` access and
19
+ // `resolveOutput` run inside `context.db`, so a caller here is responsible for
20
+ // field visibility itself.
21
+ export { checkAccess, checkCreateAccess, mergeFilters } from './access/index.js';
12
22
  // Context factory
13
23
  export { getContext } from './context/index.js';
14
- // Naming utilities (documented public helpers; used for URLs and db keys)
15
- export { getDbKey, getUrlKey, getListKeyFromUrl, resolveListKeyFromUrl } from './lib/case-utils.js';
24
+ export { TransactionOrmHandleError, TransactionRolledBackError, TransactionUnavailableError, } from './context/index.js';
25
+ // Thrown when a session handed to `getContext`/`withSession`/`createTestContext`
26
+ // holds `undefined` for one of its own keys — the shape `{ userId: undefined }`
27
+ // a caller builds from an unguarded optional identifier, which `session ?? null`
28
+ // cannot distinguish from a real signed-in session (#1397).
29
+ export { InvalidSessionError } from './context/index.js';
30
+ export { requireOrmHandle, OrmHandleUnresolvableError } from './context/index.js';
31
+ export { resolveJunctionEdge } from './context/junction.js';
32
+ // The engine's face of an app-facing context, for a component or plugin that
33
+ // holds the generated `Context` and needs `AccessContext` — two faces of one
34
+ // request, and neither type is assignable to the other.
35
+ export { engineContextOf, EngineContextUnavailableError } from './context/engine-context.js';
36
+ // The secured read surface: the composed query value `context.db.<List>` is,
37
+ // and the closed Where vocabulary it takes (ADR-0041, ADR-0055).
38
+ export { SecuredCollectionMissingError } from './secured/read.js';
39
+ // Thrown when an Access Filter that scopes by a relation expands into itself,
40
+ // directly or through another list's filter. Loud rather than truncated: a
41
+ // truncated Access Filter is a widened read (#1147).
42
+ export { AccessFilterRecursionError, ACCESS_FILTER_MAX_DEPTH } from './secured/read.js';
43
+ // Thrown when an include refinement callback returns something other than the
44
+ // refinement it was handed — dropping it would run the include unscoped by
45
+ // everything the caller wrote (#1148).
46
+ export { InvalidRefinementError } from './secured/read.js';
47
+ // Thrown when one read names the same relation twice (#1148).
48
+ export { DuplicateIncludeError } from './secured/read.js';
49
+ // Thrown when `.select()` names a relation — reachable so a caller can tell it
50
+ // apart from any other `ValidationError` (#1149).
51
+ export { RelationSelectError } from './secured/read.js';
52
+ // The vector-search terminal: how many rows it returns by default, and the
53
+ // `{ item, score }` wrapper that is ADR-0041's one exception to exactness.
54
+ export { NEAREST_DEFAULT_LIMIT, VectorDecodeError } from './secured/read.js';
55
+ // The row lock's own refusals and its key bound: a list whose table has no
56
+ // single-column primary key, a lock composed outside a transaction, a lock
57
+ // inside one whose client cannot compose the statement, and the cost limit on
58
+ // how many keys one terminal binds (ADR-0047, ADR-0062).
59
+ export { ROW_LOCK_MAX_KEYS, RowLockIdentityError, RowLockKeyLimitExceededError, RowLockLaneUnavailableError, RowLockUnavailableError, } from './secured/read.js';
60
+ // The secured write surface: the collection the Write Pipeline drives, and the
61
+ // payload shape it refuses (ADR-0050).
62
+ export { WriteCollectionMissingError } from './secured/write.js';
63
+ export { ConflictingRelationInputError, MalformedForeignKeyInputError, MalformedRelationInputError, NestedRelationInputError, NonOwningRelationInputError, RelationTargetMissingError, } from './context/relationship-input.js';
64
+ // Why an `afterTransaction` bracket reports `rolled-back` for a write whose
65
+ // transaction committed: the predicate matched no row. Reachable so a
66
+ // compensator can tell that apart from a real rollback.
67
+ export { WriteMatchedNothingError } from './context/transaction-boundary.js';
68
+ // Naming utilities (documented public helpers; used for URLs)
69
+ export { getUrlKey, getListKeyFromUrl, resolveListKeyFromUrl } from './lib/case-utils.js';
16
70
  // Label seam — resolves the field that represents a row as a single label
17
71
  // (projection) and reads it off a row (render). Used by the admin UI for
18
72
  // relationship cells, dropdown options, and page headings.
@@ -22,12 +76,11 @@ export { getLabelFieldName, getItemLabel } from './config/label.js';
22
76
  export { resolveNavCounts, isListQueryStaticallyDenied } from './config/nav-count.js';
23
77
  // Validation error surfaced by write operations
24
78
  export { ValidationError } from './hooks/index.js';
25
- // Resolves which columns (and, where recoverable, which named constraint) a
26
- // caught P2002 unique-constraint violation hit — normalising Prisma 7 driver
27
- // adapters' undocumented error shape to the documented `meta.target` one, so
28
- // a caller of `context.db.*` never needs to reach into adapter internals
29
- // (see issue #979).
30
- export { uniqueConstraintOf } from './lib/prisma-errors.js';
79
+ export { transitionGuard } from './hooks/transition-guard.js';
80
+ // The stack-owned database errors every engine terminal raises in place of the
81
+ // driver's own, and their predicates (ADR-0042). The Unsafe surface is excluded
82
+ // and yields the driver's error unchanged.
83
+ export { DatabaseError, SerializationFailure, UniqueConstraintViolation, isSerializationFailure, isUniqueConstraintViolation, } from './lib/database-errors.js';
31
84
  // Thrown by a read when a caller-supplied `include` names a relation nested
32
85
  // deeper than the Access Filter can scope (see ADR-0022). Distinct from
33
86
  // `ValidationError` — this is the engine refusing to return unscoped data, not
@@ -51,58 +104,59 @@ export { InvalidFieldAccessResultError } from './access/index.js';
51
104
  // create: there is no existing row and no way to test it against input data,
52
105
  // so it is refused loudly rather than silently treated as a full allow.
53
106
  export { InvalidCreateAccessResultError } from './access/index.js';
54
- // Thrown by a read when a caller-supplied `where` filters on a relation whose
55
- // related list denies operation-level `query` access outright (see #916 and
56
- // ADR-0022). Distinct from `ValidationError` for the same reason as
57
- // `AccessScopeDepthExceededError` — this is the engine declining to return a
58
- // silently-narrowed match on a relation it cannot scope, not a user-input
59
- // validation failure.
107
+ // Thrown by `mergeFilters` when an access rule returns a filter carrying an
108
+ // `undefined` condition — the shape `({ session }) => ({ authorId:
109
+ // session?.userId })` yields for an anonymous caller. Dropping it would widen
110
+ // the read to every row, so it is refused (see #1147, ADR-0022, ADR-0055).
111
+ export { UndefinedAccessFilterError, VacuousAccessFilterError } from './access/index.js';
112
+ /** @deprecated Never thrown; kept so existing imports compile. */
60
113
  export { RelationFilterAccessDeniedError } from './access/index.js';
61
- // Thrown by a non-sudo write whose payload carries a nested `set`,
62
- // `updateMany` or `deleteMany` under a relationship key (see #1384). These
63
- // three kinds were a pass-through straight to Prisma with no target-list
64
- // access check and no hooks; `sudo()` still accepts them unchanged. Author
65
- // the writes against the target list directly instead (`context.db.<list>`,
66
- // wrapped in `context.transaction` when they must land atomically).
67
- export { NestedRelationInputError } from './context/nested-operations.js';
68
114
  // Field self-containment validation — checks each field implements the
69
- // generation contract (getPrismaType / getTypeScriptType / getZodSchema, or
70
- // getPrismaRelation for relationships) so a misimplemented field fails early
115
+ // generation contract (getContractField / getZodSchema, plus outputType where
116
+ // the field has no single column to be typed from) so a misimplemented field fails early
71
117
  // with a clear per-field message instead of deep inside generation.
72
118
  export { validateFieldConfig, validateConfigFields } from './validation/field-config.js';
73
- // Declared-dependency validation (`needs`, ADR-0025) — checks every `needs`
74
- // entry names an immediate relationship field on the same list, and that no
75
- // field's declaration closure (the recursive fold of its dependencies, and
76
- // theirs) exceeds the read-include depth cap from any starting point. A
77
- // config that fails either must not generate.
78
- export { validateNeedsDeclarations, validateNeedsClosureDepth } from './validation/needs-closure.js';
79
- // Fragment-based query API — composable, type-safe reads that mirror
80
- // Keystone's GraphQL fragments without a GraphQL runtime. The migration
81
- // guide, CHANGELOG, and migrate-context-calls skill all advertise importing
82
- // these from the root entry point. The internal runtime helpers (isFragment,
83
- // buildInclude, pickFields) and the Fragment/FieldSelection types stay off the
84
- // root surface — those live on '@opensaas/stack-core/internal'.
85
- export { defineFragment, runQuery, runQueryOne } from './query/index.js';
119
+ // Declared-dependency validation (`needs`, ADR-0025, ADR-0051) — a config that fails it must not generate.
120
+ export { validateNeedsDeclarations } from './validation/needs-closure.js';
121
+ // Config-surface refusals (ADR-0040, ADR-0048, ADR-0049, ADR-0064) — the
122
+ // declarations the Prisma 8 contract cannot carry, each refused naming the
123
+ // list, the entry and the fix rather than silently dropped.
124
+ export { validateRelations } from './validation/relations.js';
125
+ export { validateDatabaseConfig } from './validation/database-config.js';
126
+ export { validateExtensionPacks } from './validation/extension-packs.js';
127
+ export { validateFieldNames } from './validation/field-names.js';
128
+ export { validateDefaultValues } from './validation/default-value.js';
129
+ // The stack's database URL lookup — the single place a connection string is
130
+ // chosen, emitted into `prisma.config.ts` and the generated context. The Dev
131
+ // database it can resolve to lives on `@opensaas/stack-core/dev-database`, so
132
+ // the root stays free of PGlite.
133
+ export { resolveDatabaseUrl, findDatabaseUrl, DatabaseUrlUnresolvedError } from './db/url.js';
134
+ // Contract derivation (ADR-0057) — `deriveContract(config)` is the data the
135
+ // generator renders into the Contract module; `assertRelationGraphAgrees`
136
+ // checks an emitted contract against it. The Prisma builder feed lives on
137
+ // `@opensaas/stack-core/contract` so the root stays free of `@prisma/orm-postgres`.
138
+ export { deriveContract, resolveListTimestamps } from './contract/derive.js';
139
+ export { listIdColumn, parseListId, } from './contract/id-boundary.js';
140
+ export { assertRelationGraphAgrees, RelationGraphDivergenceError, } from './contract/relation-graph.js';
141
+ // The two tables the generator emits into the bundle beside the four
142
+ // generated files (ADR-0051, ADR-0042). `deriveDependencyTable` is the one
143
+ // computation behind both the runtime table and the generated `Remainder`'s
144
+ // `needs` type; the engine reads the emitted result through the generated
145
+ // context rather than walking the config on every read.
146
+ export { deriveConstraintMap, deriveDependencyTable, deriveGeneratedTables, } from './contract/dependencies.js';
86
147
  // Relationship-options read primitive — bounded, projected fetch for
87
148
  // relationship editors. Backs the `relationshipOptions` context.serverAction
88
149
  // op; also callable directly wherever a full context is already in hand.
89
- export { getRelationshipOptions } from './query/relationship-options.js';
150
+ export { getRelationshipOptions, isRelationshipLabelReadable, } from './query/relationship-options.js';
90
151
  // Filter engine (ADR-0017) — the admin UI's Filter builder. The pure seam
91
152
  // (`parseFilterQuery`, `buildFilterWhere`) plus config-aware helpers that
92
153
  // collect each field's Filter spec and compose a list's server-side `where`.
93
154
  // The produced fragment is ANDed with the access filter through the secured
94
155
  // context, so the filter can only ever narrow visibility.
95
- export { parseFilterQuery, serializeFilterQuery, buildFilterWhere, collectFilterSpecs, buildListFilterWhere, collectFilterSuggestions, RELATIONSHIP_COUNT_FILTER_KEY, } from './filter/index.js';
96
- // Access-scoped to-many relationship counts for the admin list view (#732):
97
- // build the filtered `_count` select for count cells/sort, and resolve the
98
- // count Filter spec's markers into `{ id: { in } }` — all through the secured
99
- // context, so counts never include related rows the session cannot read.
100
- export { buildRelationshipCountSelect, resolveRelationshipCountFilters, isToManyRelationshipField, } from './access/relationship-count.js';
101
- // To-one relationship label filter helpers for the admin list view (#749).
102
- // `resolveRelationshipLabelFilters` is now a pass-through: the engine itself
103
- // scopes every relation filter in `where` (`buildAccessScopedWhere`, #916),
104
- // including the `{ is: {...} } }` shape a label filter produces, so this no
105
- // longer needs its own access fold. Kept exported, unchanged in shape, for
106
- // API compatibility — see `relationship-label-filter.ts`'s doc comment.
107
- export { resolveRelationshipLabelFilters, isToOneRelationshipField, } from './access/relationship-label-filter.js';
156
+ export { parseFilterQuery, serializeFilterQuery, buildFilterWhere, collectFilterSpecs, buildListFilterWhere, collectFilterSuggestions, } from './filter/index.js';
157
+ // Which fields carry a to-many relationship count. The counts themselves are
158
+ // the secured read's reducers (`.count()` / `.combine()`), which scope by the
159
+ // related list's own `query` access; no consumer builds a `_count` select of
160
+ // its own (#1255).
161
+ export { isToManyRelationshipField } from './fields/index.js';
108
162
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8CAA8C;AAC9C,EAAE;AACF,kEAAkE;AAClE,gEAAgE;AAChE,gEAAgE;AAChE,6DAA6D;AAC7D,yEAAyE;AACzE,kEAAkE;AAElE,kBAAkB;AAClB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAgChD,kBAAkB;AAClB,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,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAGrE,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,iCAAiC;AACjC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAO7F,4EAA4E;AAC5E,0EAA0E;AAC1E,0EAA0E;AAC1E,oFAAoF;AACpF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AAC5E,OAAO,EACL,YAAY,EACZ,WAAW,GAGZ,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAE7B,MAAM,8BAA8B,CAAA;AAgBrC,qEAAqE;AACrE,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,wDAAwD;AACxD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AAUnC,qEAAqE;AACrE,6EAA6E;AAC7E,yEAAyE;AACzE,OAAO,EACL,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,iCAAiC,CAAA;AAGxC,0EAA0E;AAC1E,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,0DAA0D;AAC1D,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAA;AAW1B,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,mBAAmB;AACnB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA"}
@@ -1,10 +1,12 @@
1
1
  export type { ServerActionProps } from './context/index.js';
2
- export type { PrismaClientLike, AccessControlledDB, StorageUtils, AugmentedFindMany, AugmentedFindUnique, FindManyQueryArgs, } from './access/types.js';
3
- export type { Fragment, FieldSelection, ResultOf } from './query/index.js';
2
+ export type { OrmClient, OrmModelDelegate, OrmOperationArgs, OrmRow, AccessControlledDB, AccessControlledDelegate, StorageUtils, } from './access/types.js';
4
3
  export { hashPassword, comparePassword, isHashedPassword, HashedPassword, } from './utils/password.js';
5
4
  export { pascalToCamel, pascalToKebab, kebabToPascal, kebabToCamel } from './lib/case-utils.js';
6
5
  export { validateWithZod, generateZodSchema } from './validation/schema.js';
7
6
  export { checkFieldAccess } from './access/index.js';
8
7
  export { isFieldReadableForPredicate } from './access/index.js';
9
8
  export type { DatabaseConfig, SessionConfig, ThemeConfig, ThemePreset, ThemeColors, ThemeFonts, ThemeShadows, FileMetadata, ImageMetadata, ImageTransformationResult, } from './config/index.js';
9
+ export { LIKE_ESCAPE_CHARACTER, escapeLikeLiteral, likeEqualsPattern, likeContainsPattern, likeStartsWithPattern, likeEndsWithPattern, } from './where/like.js';
10
+ export { findDatabaseConnection, connectionStringFault } from './db/url.js';
11
+ export { processGlobal, processGlobalKey } from './lib/process-global.js';
10
12
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAWA,YAAY,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAG1B,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAG1E,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBA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EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAS3E,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA"}
package/dist/internal.js CHANGED
@@ -21,4 +21,20 @@ export { checkFieldAccess } from './access/index.js';
21
21
  // keep the admin list view's sort validation in lockstep with the engine: a
22
22
  // field the session cannot read cannot seed an `orderBy` either.
23
23
  export { isFieldReadableForPredicate } from './access/index.js';
24
+ // The engine's LIKE-pattern escaping, shared with the packages that lower a
25
+ // substring predicate to `like`/`ilike` (ADR-0055, ADR-0060). One escaper.
26
+ export { LIKE_ESCAPE_CHARACTER, escapeLikeLiteral, likeEqualsPattern, likeContainsPattern, likeStartsWithPattern, likeEndsWithPattern, } from './where/like.js';
27
+ // The lookup's provenance, which `opensaas dev` reads to tell the Database
28
+ // escape (a URL in the environment) from a Dev database it should start for
29
+ // the project itself (ADR-0063). The public accessor, `findDatabaseUrl`,
30
+ // reports the URL alone.
31
+ export { findDatabaseConnection, connectionStringFault } from './db/url.js';
32
+ // The process-wide singleton registry a bundler-duplicated module has to
33
+ // share a value through — used by the origin store, the engine face, and the
34
+ // generated context's client singleton (ADR-0070). `processGlobalKey` is
35
+ // exported alongside it for a caller that needs to address the published
36
+ // slot directly rather than through `processGlobal` itself — a test harness
37
+ // resetting the client singleton between sequentially-generated projects in
38
+ // one process, say.
39
+ export { processGlobal, processGlobalKey } from './lib/process-global.js';
24
40
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,gCAAgC;AAChC,EAAE;AACF,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,yDAAyD;AACzD,kEAAkE;AAgBlE,4FAA4F;AAC5F,OAAO,EACL,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,cAAc,GACf,MAAM,qBAAqB,CAAA;A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C3E,4EAA4E;AAC5E,yEAAyE;AACzE,yBAAyB;AACzB,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE3E,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,yEAAyE;AACzE,4EAA4E;AAC5E,4EAA4E;AAC5E,oBAAoB;AACpB,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA"}
@@ -11,7 +11,6 @@ export declare function pascalToCamel(str: string): string;
11
11
  export declare function pascalToKebab(str: string): string;
12
12
  export declare function kebabToPascal(str: string): string;
13
13
  export declare function kebabToCamel(str: string): string;
14
- export declare function getDbKey(listKey: string): string;
15
14
  export declare function getUrlKey(listKey: string): string;
16
15
  export declare function getListKeyFromUrl(urlSegment: string): string;
17
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"case-utils.d.ts","sourceRoot":"","sources":["../../src/lib/case-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAUhG"}
1
+ {"version":3,"file":"case-utils.d.ts","sourceRoot":"","sources":["../../src/lib/case-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAUhG"}
@@ -24,9 +24,6 @@ export function kebabToPascal(str) {
24
24
  export function kebabToCamel(str) {
25
25
  return str.replace(/-([a-z])/g, (match, p1) => p1.toUpperCase());
26
26
  }
27
- export function getDbKey(listKey) {
28
- return pascalToCamel(listKey);
29
- }
30
27
  export function getUrlKey(listKey) {
31
28
  return pascalToKebab(listKey);
32
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"case-utils.js","sourceRoot":"","sources":["../../src/lib/case-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACnD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;QACnD,OAAO,MAAM,GAAG,CAAC,C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B,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO,aAAa,CAAC,UAAU,CAAC,CAAA;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkB,EAAE,QAAkB;IAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,UAAU,CAAC,CAAA;IAE/E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,uBAAuB,UAAU,gBAAgB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,wEAAwE,CACrK,CAAA;IACH,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Whether `error` may reach a client verbatim: a validation failure, a
3
+ * stack-owned database error, or one of the engine's own refusals. Anything
4
+ * else — a throwing access rule, a hook bug, a third-party SDK error — carries
5
+ * internal detail and must be logged server-side and replaced with a generic
6
+ * message. A hook that wants a message shown throws `ValidationError`.
7
+ */
8
+ export declare function isClientSafeError(error: unknown): error is Error;
9
+ //# sourceMappingURL=client-safe-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-safe-error.d.ts","sourceRoot":"","sources":["../../src/lib/client-safe-error.ts"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAYhE"}
@@ -0,0 +1,23 @@
1
+ import { AccessScopeDepthExceededError, ResolveOutputCycleError } from '../access/errors.js';
2
+ import { ConflictingRelationInputError, MalformedForeignKeyInputError, MalformedRelationInputError, NestedRelationInputError, NonOwningRelationInputError, } from '../context/relationship-input.js';
3
+ import { ValidationError } from '../hooks/index.js';
4
+ import { DatabaseError } from './database-errors.js';
5
+ /**
6
+ * Whether `error` may reach a client verbatim: a validation failure, a
7
+ * stack-owned database error, or one of the engine's own refusals. Anything
8
+ * else — a throwing access rule, a hook bug, a third-party SDK error — carries
9
+ * internal detail and must be logged server-side and replaced with a generic
10
+ * message. A hook that wants a message shown throws `ValidationError`.
11
+ */
12
+ export function isClientSafeError(error) {
13
+ return (error instanceof ValidationError ||
14
+ error instanceof DatabaseError ||
15
+ error instanceof NonOwningRelationInputError ||
16
+ error instanceof MalformedRelationInputError ||
17
+ error instanceof NestedRelationInputError ||
18
+ error instanceof ConflictingRelationInputError ||
19
+ error instanceof MalformedForeignKeyInputError ||
20
+ error instanceof AccessScopeDepthExceededError ||
21
+ error instanceof ResolveOutputCycleError);
22
+ }
23
+ //# sourceMappingURL=client-safe-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-safe-error.js","sourceRoot":"","sources":["../../src/lib/client-safe-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC5F,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,CACL,KAAK,YAAY,eAAe;QAChC,KAAK,YAAY,aAAa;QAC9B,KAAK,YAAY,2BAA2B;QAC5C,KAAK,YAAY,2BAA2B;QAC5C,KAAK,YAAY,wBAAwB;QACzC,KAAK,YAAY,6BAA6B;QAC9C,KAAK,YAAY,6BAA6B;QAC9C,KAAK,YAAY,6BAA6B;QAC9C,KAAK,YAAY,uBAAuB,CACzC,CAAA;AACH,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * A database failure the stack owns, raised in place of the driver's own error
3
+ * by every engine terminal (ADR-0042). Carries a message safe to show a user
4
+ * and, where the failure names columns, one message per field. The driver's own
5
+ * text is never the message — it is on {@link Error.cause}, for a server-side
6
+ * log.
7
+ *
8
+ * The Unsafe surface is deliberately excluded: a query issued through it
9
+ * rejects with the driver's own error, consistent with its bypassing
10
+ * everything else.
11
+ */
12
+ export declare class DatabaseError extends Error {
13
+ /** One user-facing message per field the failure names. Empty when it names none. */
14
+ fieldErrors: Record<string, string>;
15
+ constructor(message: string, fieldErrors?: Record<string, string>, options?: ErrorOptions);
16
+ }
17
+ /**
18
+ * A transaction that could not be serialised against a concurrent one
19
+ * (SQLSTATE `40001`).
20
+ *
21
+ * Retrying is the caller's decision and the caller's loop: the stack ships no
22
+ * retry helper, and a loop that catches broadly rather than on
23
+ * {@link isSerializationFailure} will re-apply a transaction that already
24
+ * committed (ADR-0028).
25
+ */
26
+ export declare class SerializationFailure extends DatabaseError {
27
+ constructor(message: string, options?: ErrorOptions);
28
+ }
29
+ /**
30
+ * A write that collided with a unique constraint (SQLSTATE `23505`).
31
+ *
32
+ * {@link fields} and {@link fieldErrors} are populated when the violated
33
+ * constraint is one the generator emitted, resolved through the generated
34
+ * constraint map. A constraint managed by hand in the database is not in that
35
+ * map, so it carries the generic message and no fields — the map's limit,
36
+ * stated rather than hidden.
37
+ */
38
+ export declare class UniqueConstraintViolation extends DatabaseError {
39
+ /** The physical constraint name the driver reported, when it reported one. */
40
+ readonly constraintName: string | undefined;
41
+ /** The list the constraint is on, when the constraint map resolved it. */
42
+ readonly list: string | undefined;
43
+ /** The OpenSaas field keys the constraint covers, empty when unresolved. */
44
+ readonly fields: readonly string[];
45
+ constructor(message: string, detail?: {
46
+ readonly constraintName?: string | undefined;
47
+ readonly list?: string | undefined;
48
+ readonly fields?: readonly string[];
49
+ readonly fieldErrors?: Record<string, string>;
50
+ }, options?: ErrorOptions);
51
+ }
52
+ /** Whether `error` is a serialization failure raised through the secured surface. */
53
+ export declare function isSerializationFailure(error: unknown): error is SerializationFailure;
54
+ /** Whether `error` is a unique-constraint violation raised through the secured surface. */
55
+ export declare function isUniqueConstraintViolation(error: unknown): error is UniqueConstraintViolation;
56
+ /** The generic message a unique violation carries when no field could be resolved. */
57
+ export declare const GENERIC_UNIQUE_VIOLATION_MESSAGE = "A record with this value already exists";
58
+ /** The message a serialization failure carries. */
59
+ export declare const SERIALIZATION_FAILURE_MESSAGE = "This operation conflicted with another and was rolled back";
60
+ /**
61
+ * The message an unclassified driver failure carries. The driver's own text
62
+ * names columns, tables and constraint names, and a {@link DatabaseError}'s
63
+ * message is what a server action hands a client, so the driver's text stays on
64
+ * {@link Error.cause} for a server-side log rather than travelling to a browser.
65
+ */
66
+ export declare const GENERIC_DATABASE_ERROR_MESSAGE = "The database refused this operation";
67
+ /**
68
+ * The stack-owned error for a driver query error, or `undefined` when `error`
69
+ * neither is one nor wraps one — a hook's own throw, a validation failure, or
70
+ * an error this module has already classified.
71
+ *
72
+ * Field resolution is NOT done here: the violated constraint's fields come
73
+ * from the generated constraint map, which is reached through the config the
74
+ * terminal does not hold. `normalizeDatabaseError` performs that second step
75
+ * where the config is in scope.
76
+ */
77
+ export declare function classifyDriverError(error: unknown): DatabaseError | undefined;
78
+ //# sourceMappingURL=database-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database-errors.d.ts","sourceRoot":"","sources":["../../src/lib/database-errors.ts"],"names":[],"mappings":"AAqCA;;;;;;;;;;GAUG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,qFAAqF;IAC9E,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE1C,YAAY,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAI5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errors and the driver classification that produces
2
+ // them (ADR-0042). A leaf module on purpose: the Engine stamp imports it, so a
3
+ // runtime import from here would put these classes behind a cycle with the
4
+ // surfaces that raise them.
5
+ /** SQLSTATE a driver reports for a unique-constraint or primary-key violation. */
6
+ const UNIQUE_VIOLATION_SQLSTATE = '23505';
7
+ /** SQLSTATE a driver reports for a serialization failure. */
8
+ const SERIALIZATION_FAILURE_SQLSTATE = '40001';
9
+ function isDriverQueryError(error) {
10
+ if (!(error instanceof Error) || !('kind' in error))
11
+ return false;
12
+ const candidate = error;
13
+ return candidate.kind === 'sql_query';
14
+ }
15
+ function asString(value) {
16
+ return typeof value === 'string' ? value : undefined;
17
+ }
18
+ /**
19
+ * A database failure the stack owns, raised in place of the driver's own error
20
+ * by every engine terminal (ADR-0042). Carries a message safe to show a user
21
+ * and, where the failure names columns, one message per field. The driver's own
22
+ * text is never the message — it is on {@link Error.cause}, for a server-side
23
+ * log.
24
+ *
25
+ * The Unsafe surface is deliberately excluded: a query issued through it
26
+ * rejects with the driver's own error, consistent with its bypassing
27
+ * everything else.
28
+ */
29
+ export class DatabaseError extends Error {
30
+ /** One user-facing message per field the failure names. Empty when it names none. */
31
+ fieldErrors;
32
+ constructor(message, fieldErrors = {}, options) {
33
+ super(message, options);
34
+ this.name = 'DatabaseError';
35
+ this.fieldErrors = fieldErrors;
36
+ }
37
+ }
38
+ /**
39
+ * A transaction that could not be serialised against a concurrent one
40
+ * (SQLSTATE `40001`).
41
+ *
42
+ * Retrying is the caller's decision and the caller's loop: the stack ships no
43
+ * retry helper, and a loop that catches broadly rather than on
44
+ * {@link isSerializationFailure} will re-apply a transaction that already
45
+ * committed (ADR-0028).
46
+ */
47
+ export class SerializationFailure extends DatabaseError {
48
+ constructor(message, options) {
49
+ super(message, {}, options);
50
+ this.name = 'SerializationFailure';
51
+ }
52
+ }
53
+ /**
54
+ * A write that collided with a unique constraint (SQLSTATE `23505`).
55
+ *
56
+ * {@link fields} and {@link fieldErrors} are populated when the violated
57
+ * constraint is one the generator emitted, resolved through the generated
58
+ * constraint map. A constraint managed by hand in the database is not in that
59
+ * map, so it carries the generic message and no fields — the map's limit,
60
+ * stated rather than hidden.
61
+ */
62
+ export class UniqueConstraintViolation extends DatabaseError {
63
+ /** The physical constraint name the driver reported, when it reported one. */
64
+ constraintName;
65
+ /** The list the constraint is on, when the constraint map resolved it. */
66
+ list;
67
+ /** The OpenSaas field keys the constraint covers, empty when unresolved. */
68
+ fields;
69
+ constructor(message, detail = {}, options) {
70
+ super(message, detail.fieldErrors ?? {}, options);
71
+ this.name = 'UniqueConstraintViolation';
72
+ this.constraintName = detail.constraintName;
73
+ this.list = detail.list;
74
+ this.fields = detail.fields ?? [];
75
+ }
76
+ }
77
+ /** Whether `error` is a serialization failure raised through the secured surface. */
78
+ export function isSerializationFailure(error) {
79
+ return error instanceof SerializationFailure;
80
+ }
81
+ /** Whether `error` is a unique-constraint violation raised through the secured surface. */
82
+ export function isUniqueConstraintViolation(error) {
83
+ return error instanceof UniqueConstraintViolation;
84
+ }
85
+ /** The generic message a unique violation carries when no field could be resolved. */
86
+ export const GENERIC_UNIQUE_VIOLATION_MESSAGE = 'A record with this value already exists';
87
+ /** The message a serialization failure carries. */
88
+ export const SERIALIZATION_FAILURE_MESSAGE = 'This operation conflicted with another and was rolled back';
89
+ /**
90
+ * The message an unclassified driver failure carries. The driver's own text
91
+ * names columns, tables and constraint names, and a {@link DatabaseError}'s
92
+ * message is what a server action hands a client, so the driver's text stays on
93
+ * {@link Error.cause} for a server-side log rather than travelling to a browser.
94
+ */
95
+ export const GENERIC_DATABASE_ERROR_MESSAGE = 'The database refused this operation';
96
+ /**
97
+ * How far down a `cause` chain the driver's own error is looked for.
98
+ *
99
+ * Prisma 8 reports a failure raised at `COMMIT` as
100
+ * `RuntimeError: Transaction commit failed` whose `cause` is the
101
+ * `SqlQueryError` — the failure a `DEFERRABLE INITIALLY DEFERRED` constraint
102
+ * produces by design. Verified at `8.0.0-rc.8`, where the wrapping is one
103
+ * level deep; the small budget is headroom, not a claim about deeper nesting.
104
+ */
105
+ const CAUSE_DEPTH = 4;
106
+ // The walk stops at a DatabaseError rather than descending past it: an
107
+ // application that catches a stack error and rethrows its own with
108
+ // `{ cause }` — the standard Node idiom — has decided what its caller sees,
109
+ // and reaching through that decision to re-raise the driver failure would
110
+ // replace the application's error with the stack's. Prisma's own commit
111
+ // wrapper carries no DatabaseError, so the COMMIT case is unaffected.
112
+ function driverErrorWithin(error) {
113
+ let candidate = error;
114
+ for (let depth = 0; depth <= CAUSE_DEPTH; depth++) {
115
+ if (candidate instanceof DatabaseError)
116
+ return undefined;
117
+ if (isDriverQueryError(candidate))
118
+ return candidate;
119
+ if (!(candidate instanceof Error))
120
+ return undefined;
121
+ candidate = candidate.cause;
122
+ }
123
+ return undefined;
124
+ }
125
+ /**
126
+ * The stack-owned error for a driver query error, or `undefined` when `error`
127
+ * neither is one nor wraps one — a hook's own throw, a validation failure, or
128
+ * an error this module has already classified.
129
+ *
130
+ * Field resolution is NOT done here: the violated constraint's fields come
131
+ * from the generated constraint map, which is reached through the config the
132
+ * terminal does not hold. `normalizeDatabaseError` performs that second step
133
+ * where the config is in scope.
134
+ */
135
+ export function classifyDriverError(error) {
136
+ const driver = driverErrorWithin(error);
137
+ if (driver === undefined)
138
+ return undefined;
139
+ const sqlState = asString(driver.sqlState);
140
+ if (sqlState === SERIALIZATION_FAILURE_SQLSTATE) {
141
+ return new SerializationFailure(SERIALIZATION_FAILURE_MESSAGE, { cause: error });
142
+ }
143
+ if (sqlState === UNIQUE_VIOLATION_SQLSTATE) {
144
+ return new UniqueConstraintViolation(GENERIC_UNIQUE_VIOLATION_MESSAGE, { constraintName: asString(driver.constraint) }, { cause: error });
145
+ }
146
+ return new DatabaseError(GENERIC_DATABASE_ERROR_MESSAGE, {}, { cause: error });
147
+ }
148
+ //# sourceMappingURL=database-errors.js.map