tansy 0.0.0-stage → 0.1.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 (1060) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -2
  3. package/app/account/account-client.d.ts +16 -0
  4. package/app/account/account-client.js +138 -0
  5. package/app/account/layout.d.ts +4 -0
  6. package/app/account/layout.js +22 -0
  7. package/app/account/page.d.ts +6 -0
  8. package/app/account/page.js +15 -0
  9. package/app/api/account/api-keys/[id]/route.d.ts +1 -0
  10. package/app/api/account/api-keys/[id]/route.js +8 -0
  11. package/app/api/account/api-keys/route.d.ts +2 -0
  12. package/app/api/account/api-keys/route.js +52 -0
  13. package/app/api/account/fields/route.d.ts +1 -0
  14. package/app/api/account/fields/route.js +13 -0
  15. package/app/api/account/locale/route.d.ts +2 -0
  16. package/app/api/account/locale/route.js +22 -0
  17. package/app/api/audit/route.d.ts +1 -0
  18. package/app/api/audit/route.js +11 -0
  19. package/app/api/auth/[...all]/route.d.ts +2 -0
  20. package/app/api/auth/[...all]/route.js +3 -0
  21. package/app/api/auth-config/route.d.ts +1 -0
  22. package/app/api/auth-config/route.js +4 -0
  23. package/app/api/background/route.d.ts +2 -0
  24. package/app/api/background/route.js +4 -0
  25. package/app/api/batch/route.d.ts +1 -0
  26. package/app/api/batch/route.js +26 -0
  27. package/app/api/block-layouts/[id]/route.d.ts +1 -0
  28. package/app/api/block-layouts/[id]/route.js +8 -0
  29. package/app/api/block-layouts/route.d.ts +2 -0
  30. package/app/api/block-layouts/route.js +14 -0
  31. package/app/api/block-types/[id]/route.d.ts +3 -0
  32. package/app/api/block-types/[id]/route.js +27 -0
  33. package/app/api/block-types/route.d.ts +2 -0
  34. package/app/api/block-types/route.js +23 -0
  35. package/app/api/collections/[id]/content/[contentId]/draft/publish/route.d.ts +1 -0
  36. package/app/api/collections/[id]/content/[contentId]/draft/publish/route.js +9 -0
  37. package/app/api/collections/[id]/content/[contentId]/draft/route.d.ts +3 -0
  38. package/app/api/collections/[id]/content/[contentId]/draft/route.js +27 -0
  39. package/app/api/collections/[id]/content/[contentId]/preview-token/route.d.ts +5 -0
  40. package/app/api/collections/[id]/content/[contentId]/preview-token/route.js +13 -0
  41. package/app/api/collections/[id]/content/[contentId]/review/approve/route.d.ts +2 -0
  42. package/app/api/collections/[id]/content/[contentId]/review/approve/route.js +20 -0
  43. package/app/api/collections/[id]/content/[contentId]/review/changes/route.d.ts +2 -0
  44. package/app/api/collections/[id]/content/[contentId]/review/changes/route.js +11 -0
  45. package/app/api/collections/[id]/content/[contentId]/review/route.d.ts +4 -0
  46. package/app/api/collections/[id]/content/[contentId]/review/route.js +21 -0
  47. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/diff/route.d.ts +1 -0
  48. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/diff/route.js +8 -0
  49. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/restore/route.d.ts +1 -0
  50. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/restore/route.js +10 -0
  51. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/route.d.ts +1 -0
  52. package/app/api/collections/[id]/content/[contentId]/revisions/[revisionId]/route.js +6 -0
  53. package/app/api/collections/[id]/content/[contentId]/revisions/route.d.ts +1 -0
  54. package/app/api/collections/[id]/content/[contentId]/revisions/route.js +12 -0
  55. package/app/api/collections/[id]/content/[contentId]/route.d.ts +7 -0
  56. package/app/api/collections/[id]/content/[contentId]/route.js +47 -0
  57. package/app/api/collections/[id]/content/[contentId]/schedule/route.d.ts +2 -0
  58. package/app/api/collections/[id]/content/[contentId]/schedule/route.js +19 -0
  59. package/app/api/collections/[id]/content/[contentId]/translate/route.d.ts +6 -0
  60. package/app/api/collections/[id]/content/[contentId]/translate/route.js +27 -0
  61. package/app/api/collections/[id]/content/[contentId]/translations/[locale]/route.d.ts +2 -0
  62. package/app/api/collections/[id]/content/[contentId]/translations/[locale]/route.js +17 -0
  63. package/app/api/collections/[id]/content/route.d.ts +2 -0
  64. package/app/api/collections/[id]/content/route.js +45 -0
  65. package/app/api/collections/[id]/fields/route.d.ts +1 -0
  66. package/app/api/collections/[id]/fields/route.js +23 -0
  67. package/app/api/collections/[id]/import/route.d.ts +9 -0
  68. package/app/api/collections/[id]/import/route.js +42 -0
  69. package/app/api/collections/[id]/localization/route.d.ts +4 -0
  70. package/app/api/collections/[id]/localization/route.js +25 -0
  71. package/app/api/collections/[id]/records/[recordId]/route.d.ts +3 -0
  72. package/app/api/collections/[id]/records/[recordId]/route.js +39 -0
  73. package/app/api/collections/[id]/records/route.d.ts +2 -0
  74. package/app/api/collections/[id]/records/route.js +31 -0
  75. package/app/api/collections/[id]/route.d.ts +3 -0
  76. package/app/api/collections/[id]/route.js +17 -0
  77. package/app/api/collections/[id]/rules/route.d.ts +1 -0
  78. package/app/api/collections/[id]/rules/route.js +10 -0
  79. package/app/api/collections/[id]/scope/route.d.ts +6 -0
  80. package/app/api/collections/[id]/scope/route.js +15 -0
  81. package/app/api/collections/[id]/translations/xliff/route.d.ts +4 -0
  82. package/app/api/collections/[id]/translations/xliff/route.js +41 -0
  83. package/app/api/collections/[id]/trash/[trashId]/restore/route.d.ts +5 -0
  84. package/app/api/collections/[id]/trash/[trashId]/restore/route.js +14 -0
  85. package/app/api/collections/[id]/trash/[trashId]/route.d.ts +2 -0
  86. package/app/api/collections/[id]/trash/[trashId]/route.js +9 -0
  87. package/app/api/collections/[id]/view/route.d.ts +1 -0
  88. package/app/api/collections/[id]/view/route.js +8 -0
  89. package/app/api/collections/route.d.ts +3 -0
  90. package/app/api/collections/route.js +31 -0
  91. package/app/api/collections/views/route.d.ts +1 -0
  92. package/app/api/collections/views/route.js +16 -0
  93. package/app/api/ext/[...path]/route.d.ts +5 -0
  94. package/app/api/ext/[...path]/route.js +10 -0
  95. package/app/api/extensions/[name]/settings/route.d.ts +2 -0
  96. package/app/api/extensions/[name]/settings/route.js +25 -0
  97. package/app/api/extensions/hook-deliveries/[id]/retry/route.d.ts +2 -0
  98. package/app/api/extensions/hook-deliveries/[id]/retry/route.js +9 -0
  99. package/app/api/field-presets/[id]/route.d.ts +2 -0
  100. package/app/api/field-presets/[id]/route.js +18 -0
  101. package/app/api/field-presets/route.d.ts +2 -0
  102. package/app/api/field-presets/route.js +14 -0
  103. package/app/api/field-types/route.d.ts +1 -0
  104. package/app/api/field-types/route.js +3 -0
  105. package/app/api/files/[id]/bytes/route.d.ts +9 -0
  106. package/app/api/files/[id]/bytes/route.js +20 -0
  107. package/app/api/files/[id]/focus/route.d.ts +1 -0
  108. package/app/api/files/[id]/focus/route.js +22 -0
  109. package/app/api/files/[id]/info/route.d.ts +2 -0
  110. package/app/api/files/[id]/info/route.js +16 -0
  111. package/app/api/files/[id]/route.d.ts +2 -0
  112. package/app/api/files/[id]/route.js +25 -0
  113. package/app/api/files/[id]/text/route.d.ts +2 -0
  114. package/app/api/files/[id]/text/route.js +49 -0
  115. package/app/api/files/[id]/token/route.d.ts +2 -0
  116. package/app/api/files/[id]/token/route.js +15 -0
  117. package/app/api/files/route.d.ts +1 -0
  118. package/app/api/files/route.js +12 -0
  119. package/app/api/files/upload/route.d.ts +2 -0
  120. package/app/api/files/upload/route.js +14 -0
  121. package/app/api/health/route.d.ts +9 -0
  122. package/app/api/health/route.js +11 -0
  123. package/app/api/locales/route.d.ts +2 -0
  124. package/app/api/locales/route.js +14 -0
  125. package/app/api/mcp/route.d.ts +1 -0
  126. package/app/api/mcp/route.js +6 -0
  127. package/app/api/me/route.d.ts +1 -0
  128. package/app/api/me/route.js +8 -0
  129. package/app/api/metrics/route.d.ts +8 -0
  130. package/app/api/metrics/route.js +13 -0
  131. package/app/api/preview/enter/route.d.ts +2 -0
  132. package/app/api/preview/enter/route.js +20 -0
  133. package/app/api/preview/exit/route.d.ts +1 -0
  134. package/app/api/preview/exit/route.js +7 -0
  135. package/app/api/preview/route.d.ts +2 -0
  136. package/app/api/preview/route.js +13 -0
  137. package/app/api/ready/route.d.ts +7 -0
  138. package/app/api/ready/route.js +15 -0
  139. package/app/api/realtime/route.d.ts +2 -0
  140. package/app/api/realtime/route.js +17 -0
  141. package/app/api/redirects/[id]/route.d.ts +2 -0
  142. package/app/api/redirects/[id]/route.js +19 -0
  143. package/app/api/redirects/route.d.ts +2 -0
  144. package/app/api/redirects/route.js +19 -0
  145. package/app/api/resolve/route.d.ts +2 -0
  146. package/app/api/resolve/route.js +17 -0
  147. package/app/api/reviews/route.d.ts +2 -0
  148. package/app/api/reviews/route.js +7 -0
  149. package/app/api/roles/[name]/route.d.ts +2 -0
  150. package/app/api/roles/[name]/route.js +18 -0
  151. package/app/api/roles/route.d.ts +2 -0
  152. package/app/api/roles/route.js +41 -0
  153. package/app/api/schema/export/route.d.ts +1 -0
  154. package/app/api/schema/export/route.js +3 -0
  155. package/app/api/schema/import/route.d.ts +1 -0
  156. package/app/api/schema/import/route.js +21 -0
  157. package/app/api/schema/openapi/route.d.ts +1 -0
  158. package/app/api/schema/openapi/route.js +4 -0
  159. package/app/api/schema/types/route.d.ts +1 -0
  160. package/app/api/schema/types/route.js +5 -0
  161. package/app/api/settings/auth/route.d.ts +2 -0
  162. package/app/api/settings/auth/route.js +19 -0
  163. package/app/api/settings/auth/test-email/route.d.ts +1 -0
  164. package/app/api/settings/auth/test-email/route.js +15 -0
  165. package/app/api/settings/locales/[code]/route.d.ts +2 -0
  166. package/app/api/settings/locales/[code]/route.js +15 -0
  167. package/app/api/settings/locales/route.d.ts +2 -0
  168. package/app/api/settings/locales/route.js +11 -0
  169. package/app/api/settings/localization/route.d.ts +1 -0
  170. package/app/api/settings/localization/route.js +25 -0
  171. package/app/api/settings/site/route.d.ts +2 -0
  172. package/app/api/settings/site/route.js +28 -0
  173. package/app/api/setup/route.d.ts +1 -0
  174. package/app/api/setup/route.js +10 -0
  175. package/app/api/translators/route.d.ts +2 -0
  176. package/app/api/translators/route.js +4 -0
  177. package/app/api/trash/route.d.ts +6 -0
  178. package/app/api/trash/route.js +14 -0
  179. package/app/api/user-fields/route.d.ts +2 -0
  180. package/app/api/user-fields/route.js +19 -0
  181. package/app/api/users/[id]/ban/route.d.ts +2 -0
  182. package/app/api/users/[id]/ban/route.js +25 -0
  183. package/app/api/users/[id]/fields/route.d.ts +2 -0
  184. package/app/api/users/[id]/fields/route.js +15 -0
  185. package/app/api/users/[id]/impersonate/route.d.ts +1 -0
  186. package/app/api/users/[id]/impersonate/route.js +22 -0
  187. package/app/api/users/[id]/password/route.d.ts +1 -0
  188. package/app/api/users/[id]/password/route.js +14 -0
  189. package/app/api/users/[id]/role/route.d.ts +1 -0
  190. package/app/api/users/[id]/role/route.js +18 -0
  191. package/app/api/users/[id]/route.d.ts +3 -0
  192. package/app/api/users/[id]/route.js +32 -0
  193. package/app/api/users/[id]/sessions/route.d.ts +2 -0
  194. package/app/api/users/[id]/sessions/route.js +16 -0
  195. package/app/api/users/route.d.ts +2 -0
  196. package/app/api/users/route.js +40 -0
  197. package/app/api/webhooks/[id]/deliveries/route.d.ts +1 -0
  198. package/app/api/webhooks/[id]/deliveries/route.js +4 -0
  199. package/app/api/webhooks/[id]/route.d.ts +2 -0
  200. package/app/api/webhooks/[id]/route.js +13 -0
  201. package/app/api/webhooks/route.d.ts +2 -0
  202. package/app/api/webhooks/route.js +10 -0
  203. package/app/auth/forgot-password/page.d.ts +1 -0
  204. package/app/auth/forgot-password/page.js +27 -0
  205. package/app/auth/reset-password/page.d.ts +6 -0
  206. package/app/auth/reset-password/page.js +6 -0
  207. package/app/auth/reset-password/reset-form.d.ts +3 -0
  208. package/app/auth/reset-password/reset-form.js +22 -0
  209. package/app/auth/setup/page.d.ts +5 -0
  210. package/app/auth/setup/page.js +6 -0
  211. package/app/auth/setup/setup-form.d.ts +3 -0
  212. package/app/auth/setup/setup-form.js +27 -0
  213. package/app/auth/signin/page.d.ts +7 -0
  214. package/app/auth/signin/page.js +6 -0
  215. package/app/auth/signin/signin-form.d.ts +7 -0
  216. package/app/auth/signin/signin-form.js +97 -0
  217. package/app/auth/signup/page.d.ts +1 -0
  218. package/app/auth/signup/page.js +35 -0
  219. package/app/auth/two-factor/page.d.ts +5 -0
  220. package/app/auth/two-factor/page.js +6 -0
  221. package/app/auth/two-factor/two-factor-form.d.ts +3 -0
  222. package/app/auth/two-factor/two-factor-form.js +24 -0
  223. package/app/dashboard/audit/page.client.d.ts +3 -0
  224. package/app/dashboard/audit/page.client.js +37 -0
  225. package/app/dashboard/audit/page.d.ts +1 -0
  226. package/app/dashboard/audit/page.js +8 -0
  227. package/app/dashboard/blocks/[id]/page.d.ts +5 -0
  228. package/app/dashboard/blocks/[id]/page.js +18 -0
  229. package/app/dashboard/blocks/new/page.d.ts +1 -0
  230. package/app/dashboard/blocks/new/page.js +12 -0
  231. package/app/dashboard/blocks/page.client.d.ts +10 -0
  232. package/app/dashboard/blocks/page.client.js +53 -0
  233. package/app/dashboard/blocks/page.d.ts +1 -0
  234. package/app/dashboard/blocks/page.js +11 -0
  235. package/app/dashboard/collections/[id]/content/[contentId]/history/page.client.d.ts +9 -0
  236. package/app/dashboard/collections/[id]/content/[contentId]/history/page.client.js +80 -0
  237. package/app/dashboard/collections/[id]/content/[contentId]/history/page.d.ts +6 -0
  238. package/app/dashboard/collections/[id]/content/[contentId]/history/page.js +12 -0
  239. package/app/dashboard/collections/[id]/content/[contentId]/page.d.ts +6 -0
  240. package/app/dashboard/collections/[id]/content/[contentId]/page.js +12 -0
  241. package/app/dashboard/collections/[id]/content/new/page.d.ts +5 -0
  242. package/app/dashboard/collections/[id]/content/new/page.js +12 -0
  243. package/app/dashboard/collections/[id]/import/page.client.d.ts +5 -0
  244. package/app/dashboard/collections/[id]/import/page.client.js +97 -0
  245. package/app/dashboard/collections/[id]/import/page.d.ts +6 -0
  246. package/app/dashboard/collections/[id]/import/page.js +13 -0
  247. package/app/dashboard/collections/[id]/load.d.ts +7 -0
  248. package/app/dashboard/collections/[id]/load.js +20 -0
  249. package/app/dashboard/collections/[id]/page.client.d.ts +22 -0
  250. package/app/dashboard/collections/[id]/page.client.js +207 -0
  251. package/app/dashboard/collections/[id]/page.d.ts +5 -0
  252. package/app/dashboard/collections/[id]/page.js +28 -0
  253. package/app/dashboard/collections/[id]/rules/page.client.d.ts +3 -0
  254. package/app/dashboard/collections/[id]/rules/page.client.js +32 -0
  255. package/app/dashboard/collections/[id]/rules/page.d.ts +5 -0
  256. package/app/dashboard/collections/[id]/rules/page.js +8 -0
  257. package/app/dashboard/collections/[id]/schema/page.client.d.ts +5 -0
  258. package/app/dashboard/collections/[id]/schema/page.client.js +129 -0
  259. package/app/dashboard/collections/[id]/schema/page.d.ts +5 -0
  260. package/app/dashboard/collections/[id]/schema/page.js +13 -0
  261. package/app/dashboard/collections/[id]/view/page.d.ts +5 -0
  262. package/app/dashboard/collections/[id]/view/page.js +13 -0
  263. package/app/dashboard/collections/create/page.client.d.ts +3 -0
  264. package/app/dashboard/collections/create/page.client.js +47 -0
  265. package/app/dashboard/collections/create/page.d.ts +1 -0
  266. package/app/dashboard/collections/create/page.js +8 -0
  267. package/app/dashboard/collections/create-view/page.d.ts +1 -0
  268. package/app/dashboard/collections/create-view/page.js +8 -0
  269. package/app/dashboard/collections/page.client.d.ts +13 -0
  270. package/app/dashboard/collections/page.client.js +84 -0
  271. package/app/dashboard/collections/page.d.ts +1 -0
  272. package/app/dashboard/collections/page.js +10 -0
  273. package/app/dashboard/ext/[...path]/page.client.d.ts +5 -0
  274. package/app/dashboard/ext/[...path]/page.client.js +6 -0
  275. package/app/dashboard/ext/[...path]/page.d.ts +5 -0
  276. package/app/dashboard/ext/[...path]/page.js +23 -0
  277. package/app/dashboard/extensions/[name]/settings/page.client.d.ts +16 -0
  278. package/app/dashboard/extensions/[name]/settings/page.client.js +179 -0
  279. package/app/dashboard/extensions/[name]/settings/page.d.ts +5 -0
  280. package/app/dashboard/extensions/[name]/settings/page.js +30 -0
  281. package/app/dashboard/extensions/directory/page.d.ts +1 -0
  282. package/app/dashboard/extensions/directory/page.js +14 -0
  283. package/app/dashboard/extensions/page.client.d.ts +4 -0
  284. package/app/dashboard/extensions/page.client.js +29 -0
  285. package/app/dashboard/extensions/page.d.ts +1 -0
  286. package/app/dashboard/extensions/page.js +59 -0
  287. package/app/dashboard/field-presets/page.client.d.ts +15 -0
  288. package/app/dashboard/field-presets/page.client.js +54 -0
  289. package/app/dashboard/field-presets/page.d.ts +1 -0
  290. package/app/dashboard/field-presets/page.js +13 -0
  291. package/app/dashboard/files/page.client.d.ts +10 -0
  292. package/app/dashboard/files/page.client.js +74 -0
  293. package/app/dashboard/files/page.d.ts +1 -0
  294. package/app/dashboard/files/page.js +13 -0
  295. package/app/dashboard/languages/page.client.d.ts +4 -0
  296. package/app/dashboard/languages/page.client.js +132 -0
  297. package/app/dashboard/languages/page.d.ts +1 -0
  298. package/app/dashboard/languages/page.js +8 -0
  299. package/app/dashboard/layout.d.ts +4 -0
  300. package/app/dashboard/layout.js +47 -0
  301. package/app/dashboard/page.client.d.ts +5 -0
  302. package/app/dashboard/page.client.js +6 -0
  303. package/app/dashboard/page.d.ts +1 -0
  304. package/app/dashboard/page.js +65 -0
  305. package/app/dashboard/redirects/page.client.d.ts +3 -0
  306. package/app/dashboard/redirects/page.client.js +62 -0
  307. package/app/dashboard/redirects/page.d.ts +1 -0
  308. package/app/dashboard/redirects/page.js +8 -0
  309. package/app/dashboard/reviews/page.client.d.ts +2 -0
  310. package/app/dashboard/reviews/page.client.js +27 -0
  311. package/app/dashboard/reviews/page.d.ts +1 -0
  312. package/app/dashboard/reviews/page.js +8 -0
  313. package/app/dashboard/roles/page.client.d.ts +5 -0
  314. package/app/dashboard/roles/page.client.js +122 -0
  315. package/app/dashboard/roles/page.d.ts +1 -0
  316. package/app/dashboard/roles/page.js +12 -0
  317. package/app/dashboard/schema/page.client.d.ts +3 -0
  318. package/app/dashboard/schema/page.client.js +43 -0
  319. package/app/dashboard/schema/page.d.ts +1 -0
  320. package/app/dashboard/schema/page.js +8 -0
  321. package/app/dashboard/settings/page.client.d.ts +3 -0
  322. package/app/dashboard/settings/page.client.js +110 -0
  323. package/app/dashboard/settings/page.d.ts +1 -0
  324. package/app/dashboard/settings/page.js +8 -0
  325. package/app/dashboard/site/page.client.d.ts +14 -0
  326. package/app/dashboard/site/page.client.js +35 -0
  327. package/app/dashboard/site/page.d.ts +2 -0
  328. package/app/dashboard/site/page.js +24 -0
  329. package/app/dashboard/trash/page.client.d.ts +1 -0
  330. package/app/dashboard/trash/page.client.js +59 -0
  331. package/app/dashboard/trash/page.d.ts +2 -0
  332. package/app/dashboard/trash/page.js +9 -0
  333. package/app/dashboard/users/[id]/page.client.d.ts +5 -0
  334. package/app/dashboard/users/[id]/page.client.js +47 -0
  335. package/app/dashboard/users/[id]/page.d.ts +5 -0
  336. package/app/dashboard/users/[id]/page.js +9 -0
  337. package/app/dashboard/users/fields/page.client.d.ts +12 -0
  338. package/app/dashboard/users/fields/page.client.js +50 -0
  339. package/app/dashboard/users/fields/page.d.ts +1 -0
  340. package/app/dashboard/users/fields/page.js +10 -0
  341. package/app/dashboard/users/page.client.d.ts +58 -0
  342. package/app/dashboard/users/page.client.js +41 -0
  343. package/app/dashboard/users/page.d.ts +1 -0
  344. package/app/dashboard/users/page.js +8 -0
  345. package/app/dashboard/webhooks/page.client.d.ts +12 -0
  346. package/app/dashboard/webhooks/page.client.js +75 -0
  347. package/app/dashboard/webhooks/page.d.ts +1 -0
  348. package/app/dashboard/webhooks/page.js +10 -0
  349. package/app/fonts/GeistMonoVF.woff +0 -0
  350. package/app/fonts/GeistVF.woff +0 -0
  351. package/app/landing.d.ts +1 -0
  352. package/app/landing.js +5 -0
  353. package/app/layout.d.ts +6 -0
  354. package/app/layout.js +30 -0
  355. package/components/LabelsInput.d.ts +13 -0
  356. package/components/LabelsInput.js +19 -0
  357. package/components/PluginBoundary.d.ts +18 -0
  358. package/components/PluginBoundary.js +37 -0
  359. package/components/admin-client.d.ts +65 -0
  360. package/components/admin-client.js +101 -0
  361. package/components/auth/AuthCard.d.ts +13 -0
  362. package/components/auth/AuthCard.js +18 -0
  363. package/components/auth/AuthConfig.d.ts +29 -0
  364. package/components/auth/AuthConfig.js +14 -0
  365. package/components/auth/useAuthWidgets.d.ts +17 -0
  366. package/components/auth/useAuthWidgets.js +21 -0
  367. package/components/blocks/BlockTypeForm.d.ts +11 -0
  368. package/components/blocks/BlockTypeForm.js +50 -0
  369. package/components/blocks/block-icons.d.ts +6 -0
  370. package/components/blocks/block-icons.js +22 -0
  371. package/components/captcha/CaptchaWidget.d.ts +14 -0
  372. package/components/captcha/CaptchaWidget.js +67 -0
  373. package/components/collections/CollectionGrid.d.ts +20 -0
  374. package/components/collections/CollectionGrid.js +24 -0
  375. package/components/collections/FilterBuilder.d.ts +32 -0
  376. package/components/collections/FilterBuilder.js +150 -0
  377. package/components/collections/LanguagePanel.d.ts +33 -0
  378. package/components/collections/LanguagePanel.js +56 -0
  379. package/components/collections/RecordForm.d.ts +17 -0
  380. package/components/collections/RecordForm.js +490 -0
  381. package/components/collections/ReviewCard.d.ts +6 -0
  382. package/components/collections/ReviewCard.js +32 -0
  383. package/components/collections/ReviewPanel.d.ts +21 -0
  384. package/components/collections/ReviewPanel.js +45 -0
  385. package/components/collections/TranslationExchange.d.ts +16 -0
  386. package/components/collections/TranslationExchange.js +43 -0
  387. package/components/collections/ViewForm.d.ts +11 -0
  388. package/components/collections/ViewForm.js +38 -0
  389. package/components/fields/DescribeFile.d.ts +23 -0
  390. package/components/fields/DescribeFile.js +106 -0
  391. package/components/fields/FieldConfigEditor.d.ts +24 -0
  392. package/components/fields/FieldConfigEditor.js +113 -0
  393. package/components/fields/FieldListEditor.d.ts +20 -0
  394. package/components/fields/FieldListEditor.js +33 -0
  395. package/components/fields/FieldValueInput.d.ts +23 -0
  396. package/components/fields/FieldValueInput.js +101 -0
  397. package/components/fields/FileValueInput.d.ts +9 -0
  398. package/components/fields/FileValueInput.js +78 -0
  399. package/components/fields/FocusPicker.d.ts +15 -0
  400. package/components/fields/FocusPicker.js +24 -0
  401. package/components/fields/ReferencePicker.d.ts +12 -0
  402. package/components/fields/ReferencePicker.js +59 -0
  403. package/components/fields/RichTextEditor.d.ts +13 -0
  404. package/components/fields/RichTextEditor.js +116 -0
  405. package/components/fields/icons.d.ts +3 -0
  406. package/components/fields/icons.js +21 -0
  407. package/components/fields/show-if.d.ts +2 -0
  408. package/components/fields/show-if.js +10 -0
  409. package/components/fields/types.d.ts +102 -0
  410. package/components/fields/types.js +15 -0
  411. package/components/i18n.d.ts +98 -0
  412. package/components/i18n.js +109 -0
  413. package/components/shell/AppShell.d.ts +28 -0
  414. package/components/shell/AppShell.js +109 -0
  415. package/components/shell/DashboardLoading.d.ts +8 -0
  416. package/components/shell/DashboardLoading.js +25 -0
  417. package/components/shell/TopBarSwitcher.d.ts +9 -0
  418. package/components/shell/TopBarSwitcher.js +53 -0
  419. package/components/site/AdminBar.d.ts +5 -0
  420. package/components/site/AdminBar.js +14 -0
  421. package/components/site/Pager.d.ts +18 -0
  422. package/components/site/Pager.js +18 -0
  423. package/components/site/ThemedPage.d.ts +16 -0
  424. package/components/site/ThemedPage.js +28 -0
  425. package/components/stream/Inserter.d.ts +14 -0
  426. package/components/stream/Inserter.js +115 -0
  427. package/components/stream/Menu.d.ts +10 -0
  428. package/components/stream/Menu.js +15 -0
  429. package/components/stream/Outline.d.ts +12 -0
  430. package/components/stream/Outline.js +26 -0
  431. package/components/stream/SaveLayout.d.ts +7 -0
  432. package/components/stream/SaveLayout.js +34 -0
  433. package/components/stream/StreamEditor.d.ts +16 -0
  434. package/components/stream/StreamEditor.js +389 -0
  435. package/components/stream/StreamField.d.ts +93 -0
  436. package/components/stream/StreamField.js +119 -0
  437. package/components/stream/editor-context.d.ts +24 -0
  438. package/components/stream/editor-context.js +66 -0
  439. package/components/stream/embed.d.ts +8 -0
  440. package/components/stream/embed.js +45 -0
  441. package/components/stream/site-canvas.d.ts +46 -0
  442. package/components/stream/site-canvas.js +76 -0
  443. package/components/stream/stream-ops.d.ts +47 -0
  444. package/components/stream/stream-ops.js +111 -0
  445. package/components/ui/Switch.d.ts +8 -0
  446. package/components/ui/Switch.js +6 -0
  447. package/components/ui/kit.d.ts +231 -0
  448. package/components/ui/kit.js +168 -0
  449. package/components/ui/row-link.d.ts +7 -0
  450. package/components/ui/row-link.js +24 -0
  451. package/components/users/UserFieldsForm.d.ts +20 -0
  452. package/components/users/UserFieldsForm.js +43 -0
  453. package/core/audit/fold.d.ts +18 -0
  454. package/core/audit/fold.js +33 -0
  455. package/core/audit/index.d.ts +26 -0
  456. package/core/audit/index.js +79 -0
  457. package/core/audit/query.d.ts +28 -0
  458. package/core/audit/query.js +21 -0
  459. package/core/auth/access.d.ts +33 -0
  460. package/core/auth/access.js +35 -0
  461. package/core/auth/branding.d.ts +17 -0
  462. package/core/auth/branding.js +30 -0
  463. package/core/auth/extension-hooks.d.ts +26 -0
  464. package/core/auth/extension-hooks.js +78 -0
  465. package/core/auth/extensions.d.ts +138 -0
  466. package/core/auth/extensions.js +1 -0
  467. package/core/auth/instance.d.ts +4189 -0
  468. package/core/auth/instance.js +387 -0
  469. package/core/auth/lockout.d.ts +10 -0
  470. package/core/auth/lockout.js +34 -0
  471. package/core/auth/maintenance.d.ts +2 -0
  472. package/core/auth/maintenance.js +16 -0
  473. package/core/auth/plugin-adapter.d.ts +59 -0
  474. package/core/auth/plugin-adapter.js +469 -0
  475. package/core/auth/plugin-models.d.ts +57 -0
  476. package/core/auth/plugin-models.js +124 -0
  477. package/core/auth/public-config.d.ts +36 -0
  478. package/core/auth/public-config.js +30 -0
  479. package/core/auth/secrets.d.ts +3 -0
  480. package/core/auth/secrets.js +23 -0
  481. package/core/auth/server-only-paths.d.ts +11 -0
  482. package/core/auth/server-only-paths.js +16 -0
  483. package/core/auth/settings-schema.d.ts +116 -0
  484. package/core/auth/settings-schema.js +135 -0
  485. package/core/auth/settings.d.ts +21 -0
  486. package/core/auth/settings.js +98 -0
  487. package/core/auth/setup.d.ts +30 -0
  488. package/core/auth/setup.js +73 -0
  489. package/core/auth/shared-accounts.d.ts +18 -0
  490. package/core/auth/shared-accounts.js +38 -0
  491. package/core/auth/user-fields.d.ts +96 -0
  492. package/core/auth/user-fields.js +217 -0
  493. package/core/auth/users.d.ts +25 -0
  494. package/core/auth/users.js +46 -0
  495. package/core/authz/guard.d.ts +96 -0
  496. package/core/authz/guard.js +247 -0
  497. package/core/authz/page.d.ts +23 -0
  498. package/core/authz/page.js +87 -0
  499. package/core/authz/permissions.d.ts +81 -0
  500. package/core/authz/permissions.js +145 -0
  501. package/core/authz/principal.d.ts +70 -0
  502. package/core/authz/principal.js +87 -0
  503. package/core/authz/records.d.ts +67 -0
  504. package/core/authz/records.js +186 -0
  505. package/core/authz/role-admin.d.ts +61 -0
  506. package/core/authz/role-admin.js +194 -0
  507. package/core/authz/roles.d.ts +23 -0
  508. package/core/authz/roles.js +93 -0
  509. package/core/authz/rules/evaluate.d.ts +89 -0
  510. package/core/authz/rules/evaluate.js +350 -0
  511. package/core/authz/rules/parser.d.ts +28 -0
  512. package/core/authz/rules/parser.js +144 -0
  513. package/core/authz/rules/postgres.d.ts +18 -0
  514. package/core/authz/rules/postgres.js +143 -0
  515. package/core/authz/rules/sql.d.ts +55 -0
  516. package/core/authz/rules/sql.js +153 -0
  517. package/core/background/after-response.d.ts +11 -0
  518. package/core/background/after-response.js +26 -0
  519. package/core/background/endpoint.d.ts +8 -0
  520. package/core/background/endpoint.js +28 -0
  521. package/core/background/mode.d.ts +15 -0
  522. package/core/background/mode.js +16 -0
  523. package/core/background/runner.d.ts +38 -0
  524. package/core/background/runner.js +126 -0
  525. package/core/backup/archive.d.ts +22 -0
  526. package/core/backup/archive.js +163 -0
  527. package/core/backup/cli.d.ts +30 -0
  528. package/core/backup/cli.js +198 -0
  529. package/core/backup/config.d.ts +28 -0
  530. package/core/backup/config.js +30 -0
  531. package/core/backup/crypto.d.ts +26 -0
  532. package/core/backup/crypto.js +158 -0
  533. package/core/backup/database.d.ts +57 -0
  534. package/core/backup/database.js +253 -0
  535. package/core/backup/job.d.ts +16 -0
  536. package/core/backup/job.js +60 -0
  537. package/core/backup/service.d.ts +137 -0
  538. package/core/backup/service.js +386 -0
  539. package/core/blocks/layouts.d.ts +22 -0
  540. package/core/blocks/layouts.js +27 -0
  541. package/core/blocks/limits.d.ts +8 -0
  542. package/core/blocks/limits.js +2 -0
  543. package/core/blocks/service.d.ts +115 -0
  544. package/core/blocks/service.js +231 -0
  545. package/core/blocks/stream.d.ts +59 -0
  546. package/core/blocks/stream.js +220 -0
  547. package/core/captcha/index.d.ts +30 -0
  548. package/core/captcha/index.js +110 -0
  549. package/core/captcha/types.d.ts +46 -0
  550. package/core/captcha/types.js +1 -0
  551. package/core/config/index.d.ts +20 -0
  552. package/core/config/index.js +30 -0
  553. package/core/content/access.d.ts +99 -0
  554. package/core/content/access.js +24 -0
  555. package/core/content/batch.d.ts +19 -0
  556. package/core/content/batch.js +132 -0
  557. package/core/content/chunks.d.ts +2 -0
  558. package/core/content/chunks.js +8 -0
  559. package/core/content/collections.d.ts +199 -0
  560. package/core/content/collections.js +52 -0
  561. package/core/content/content-service.d.ts +152 -0
  562. package/core/content/content-service.js +1077 -0
  563. package/core/content/csv.d.ts +24 -0
  564. package/core/content/csv.js +132 -0
  565. package/core/content/db.d.ts +10 -0
  566. package/core/content/db.js +74 -0
  567. package/core/content/diff.d.ts +40 -0
  568. package/core/content/diff.js +65 -0
  569. package/core/content/flat.d.ts +20 -0
  570. package/core/content/flat.js +37 -0
  571. package/core/content/ids.d.ts +1 -0
  572. package/core/content/ids.js +7 -0
  573. package/core/content/import.d.ts +108 -0
  574. package/core/content/import.js +263 -0
  575. package/core/content/locks.d.ts +39 -0
  576. package/core/content/locks.js +66 -0
  577. package/core/content/overview.d.ts +54 -0
  578. package/core/content/overview.js +136 -0
  579. package/core/content/public-records.d.ts +51 -0
  580. package/core/content/public-records.js +364 -0
  581. package/core/content/query.d.ts +61 -0
  582. package/core/content/query.js +103 -0
  583. package/core/content/records.d.ts +69 -0
  584. package/core/content/records.js +62 -0
  585. package/core/content/relations.d.ts +56 -0
  586. package/core/content/relations.js +177 -0
  587. package/core/content/reviews.d.ts +70 -0
  588. package/core/content/reviews.js +141 -0
  589. package/core/content/revision-store.d.ts +16 -0
  590. package/core/content/revision-store.js +27 -0
  591. package/core/content/revisions.d.ts +155 -0
  592. package/core/content/revisions.js +194 -0
  593. package/core/content/rule-lookup.d.ts +9 -0
  594. package/core/content/rule-lookup.js +48 -0
  595. package/core/content/scheduler.d.ts +3 -0
  596. package/core/content/scheduler.js +73 -0
  597. package/core/content/trash.d.ts +159 -0
  598. package/core/content/trash.js +144 -0
  599. package/core/content/workflow.d.ts +25 -0
  600. package/core/content/workflow.js +22 -0
  601. package/core/extend/admin-nav.d.ts +51 -0
  602. package/core/extend/admin-nav.js +109 -0
  603. package/core/extend/admin-paths.d.ts +8 -0
  604. package/core/extend/admin-paths.js +35 -0
  605. package/core/extend/admin.d.ts +404 -0
  606. package/core/extend/admin.js +3 -0
  607. package/core/extend/auth-call.d.ts +5 -0
  608. package/core/extend/auth-call.js +73 -0
  609. package/core/extend/cron.d.ts +27 -0
  610. package/core/extend/cron.js +56 -0
  611. package/core/extend/csp.d.ts +19 -0
  612. package/core/extend/csp.js +27 -0
  613. package/core/extend/define.d.ts +936 -0
  614. package/core/extend/define.js +13 -0
  615. package/core/extend/directory.d.ts +18 -0
  616. package/core/extend/directory.js +44 -0
  617. package/core/extend/events.d.ts +7 -0
  618. package/core/extend/events.js +22 -0
  619. package/core/extend/hook-deliveries.d.ts +38 -0
  620. package/core/extend/hook-deliveries.js +117 -0
  621. package/core/extend/hooks.d.ts +32 -0
  622. package/core/extend/hooks.js +89 -0
  623. package/core/extend/jobs.d.ts +30 -0
  624. package/core/extend/jobs.js +131 -0
  625. package/core/extend/lifecycle.d.ts +14 -0
  626. package/core/extend/lifecycle.js +116 -0
  627. package/core/extend/loader.d.ts +11 -0
  628. package/core/extend/loader.js +85 -0
  629. package/core/extend/mail.d.ts +9 -0
  630. package/core/extend/mail.js +94 -0
  631. package/core/extend/manifest.d.ts +14 -0
  632. package/core/extend/manifest.js +177 -0
  633. package/core/extend/mcp.d.ts +25 -0
  634. package/core/extend/mcp.js +51 -0
  635. package/core/extend/records.d.ts +9 -0
  636. package/core/extend/records.js +125 -0
  637. package/core/extend/registry.d.ts +51 -0
  638. package/core/extend/registry.js +132 -0
  639. package/core/extend/requests.d.ts +4 -0
  640. package/core/extend/requests.js +27 -0
  641. package/core/extend/routes.d.ts +3 -0
  642. package/core/extend/routes.js +55 -0
  643. package/core/extend/routing.d.ts +12 -0
  644. package/core/extend/routing.js +33 -0
  645. package/core/extend/safe-http.d.ts +17 -0
  646. package/core/extend/safe-http.js +72 -0
  647. package/core/extend/schema.d.ts +10 -0
  648. package/core/extend/schema.js +40 -0
  649. package/core/extend/semver.d.ts +5 -0
  650. package/core/extend/semver.js +46 -0
  651. package/core/extend/settings-schema.d.ts +10 -0
  652. package/core/extend/settings-schema.js +73 -0
  653. package/core/extend/settings.d.ts +29 -0
  654. package/core/extend/settings.js +149 -0
  655. package/core/extend/start.d.ts +3 -0
  656. package/core/extend/start.js +86 -0
  657. package/core/extend/store.d.ts +10 -0
  658. package/core/extend/store.js +79 -0
  659. package/core/extend/system-collections.d.ts +7 -0
  660. package/core/extend/system-collections.js +18 -0
  661. package/core/extend/tools.d.ts +24 -0
  662. package/core/extend/tools.js +295 -0
  663. package/core/extend/users.d.ts +10 -0
  664. package/core/extend/users.js +44 -0
  665. package/core/extend/webhook-input.d.ts +12 -0
  666. package/core/extend/webhook-input.js +8 -0
  667. package/core/extend/webhooks.d.ts +65 -0
  668. package/core/extend/webhooks.js +134 -0
  669. package/core/fields/builtin.d.ts +9 -0
  670. package/core/fields/builtin.js +335 -0
  671. package/core/fields/define.d.ts +111 -0
  672. package/core/fields/define.js +79 -0
  673. package/core/fields/markdown.d.ts +9 -0
  674. package/core/fields/markdown.js +127 -0
  675. package/core/fields/presets.d.ts +47 -0
  676. package/core/fields/presets.js +34 -0
  677. package/core/fields/registry.d.ts +74 -0
  678. package/core/fields/registry.js +172 -0
  679. package/core/fields/rich-text.d.ts +20 -0
  680. package/core/fields/rich-text.js +83 -0
  681. package/core/fields/safe-pattern.d.ts +8 -0
  682. package/core/fields/safe-pattern.js +80 -0
  683. package/core/fields/test-kit.d.ts +24 -0
  684. package/core/fields/test-kit.js +79 -0
  685. package/core/fields/upgrades.d.ts +5 -0
  686. package/core/fields/upgrades.js +99 -0
  687. package/core/fields/validate.d.ts +14 -0
  688. package/core/fields/validate.js +65 -0
  689. package/core/files/cleanup.d.ts +3 -0
  690. package/core/files/cleanup.js +39 -0
  691. package/core/files/focus.d.ts +42 -0
  692. package/core/files/focus.js +42 -0
  693. package/core/files/http.d.ts +7 -0
  694. package/core/files/http.js +29 -0
  695. package/core/files/refs.d.ts +19 -0
  696. package/core/files/refs.js +129 -0
  697. package/core/files/service.d.ts +197 -0
  698. package/core/files/service.js +446 -0
  699. package/core/files/sniff.d.ts +12 -0
  700. package/core/files/sniff.js +98 -0
  701. package/core/files/text.d.ts +45 -0
  702. package/core/files/text.js +94 -0
  703. package/core/files/tokens.d.ts +7 -0
  704. package/core/files/tokens.js +24 -0
  705. package/core/http/cors.d.ts +17 -0
  706. package/core/http/cors.js +59 -0
  707. package/core/http/errors.d.ts +21 -0
  708. package/core/http/errors.js +29 -0
  709. package/core/http/plain.d.ts +2 -0
  710. package/core/http/plain.js +2 -0
  711. package/core/http/plugin-origins.d.ts +7 -0
  712. package/core/http/plugin-origins.js +62 -0
  713. package/core/http/rate-limit.d.ts +3 -0
  714. package/core/http/rate-limit.js +23 -0
  715. package/core/http/read-limit.d.ts +6 -0
  716. package/core/http/read-limit.js +25 -0
  717. package/core/http/request.d.ts +13 -0
  718. package/core/http/request.js +47 -0
  719. package/core/i18n/admin.d.ts +60 -0
  720. package/core/i18n/admin.js +100 -0
  721. package/core/i18n/catalogs/ar.d.ts +3 -0
  722. package/core/i18n/catalogs/ar.js +1473 -0
  723. package/core/i18n/catalogs/en.d.ts +1631 -0
  724. package/core/i18n/catalogs/en.js +1476 -0
  725. package/core/i18n/catalogs/index.d.ts +7 -0
  726. package/core/i18n/catalogs/index.js +8 -0
  727. package/core/i18n/codes.d.ts +27 -0
  728. package/core/i18n/codes.js +121 -0
  729. package/core/i18n/context.d.ts +77 -0
  730. package/core/i18n/context.js +16 -0
  731. package/core/i18n/editor.d.ts +12 -0
  732. package/core/i18n/editor.js +44 -0
  733. package/core/i18n/exchange.d.ts +35 -0
  734. package/core/i18n/exchange.js +132 -0
  735. package/core/i18n/labels-schema.d.ts +3 -0
  736. package/core/i18n/labels-schema.js +4 -0
  737. package/core/i18n/labels.d.ts +14 -0
  738. package/core/i18n/labels.js +15 -0
  739. package/core/i18n/locales.d.ts +97 -0
  740. package/core/i18n/locales.js +222 -0
  741. package/core/i18n/messages.d.ts +41 -0
  742. package/core/i18n/messages.js +109 -0
  743. package/core/i18n/outdated.d.ts +14 -0
  744. package/core/i18n/outdated.js +33 -0
  745. package/core/i18n/permissions.d.ts +17 -0
  746. package/core/i18n/permissions.js +34 -0
  747. package/core/i18n/request.d.ts +47 -0
  748. package/core/i18n/request.js +67 -0
  749. package/core/i18n/routing.d.ts +27 -0
  750. package/core/i18n/routing.js +37 -0
  751. package/core/i18n/segments.d.ts +44 -0
  752. package/core/i18n/segments.js +88 -0
  753. package/core/i18n/startup.d.ts +9 -0
  754. package/core/i18n/startup.js +36 -0
  755. package/core/i18n/storage.d.ts +92 -0
  756. package/core/i18n/storage.js +186 -0
  757. package/core/i18n/synced.d.ts +19 -0
  758. package/core/i18n/synced.js +39 -0
  759. package/core/i18n/translate.d.ts +22 -0
  760. package/core/i18n/translate.js +51 -0
  761. package/core/i18n/xliff.d.ts +32 -0
  762. package/core/i18n/xliff.js +77 -0
  763. package/core/mail/index.d.ts +95 -0
  764. package/core/mail/index.js +162 -0
  765. package/core/mail/rich.d.ts +6 -0
  766. package/core/mail/rich.js +105 -0
  767. package/core/ops/health.d.ts +28 -0
  768. package/core/ops/health.js +45 -0
  769. package/core/ops/metrics.d.ts +9 -0
  770. package/core/ops/metrics.js +108 -0
  771. package/core/realtime/clients.d.ts +8 -0
  772. package/core/realtime/clients.js +254 -0
  773. package/core/realtime/hub.d.ts +26 -0
  774. package/core/realtime/hub.js +22 -0
  775. package/core/schema/ddl.d.ts +68 -0
  776. package/core/schema/ddl.js +237 -0
  777. package/core/schema/describe.d.ts +52 -0
  778. package/core/schema/describe.js +175 -0
  779. package/core/schema/diff.d.ts +51 -0
  780. package/core/schema/diff.js +108 -0
  781. package/core/schema/names.d.ts +7 -0
  782. package/core/schema/names.js +21 -0
  783. package/core/schema/portable.d.ts +129 -0
  784. package/core/schema/portable.js +428 -0
  785. package/core/schema/service.d.ts +268 -0
  786. package/core/schema/service.js +608 -0
  787. package/core/schema/views-postgres.d.ts +18 -0
  788. package/core/schema/views-postgres.js +134 -0
  789. package/core/schema/views.d.ts +19 -0
  790. package/core/schema/views.js +70 -0
  791. package/core/scope/context.d.ts +75 -0
  792. package/core/scope/context.js +79 -0
  793. package/core/scope/data.d.ts +43 -0
  794. package/core/scope/data.js +469 -0
  795. package/core/scope/label.d.ts +7 -0
  796. package/core/scope/label.js +11 -0
  797. package/core/scope/limits.d.ts +23 -0
  798. package/core/scope/limits.js +72 -0
  799. package/core/scope/plugin.d.ts +28 -0
  800. package/core/scope/plugin.js +156 -0
  801. package/core/scope/provider.d.ts +111 -0
  802. package/core/scope/provider.js +188 -0
  803. package/core/scope/registry.d.ts +12 -0
  804. package/core/scope/registry.js +26 -0
  805. package/core/scope/request.d.ts +19 -0
  806. package/core/scope/request.js +62 -0
  807. package/core/scope/site.d.ts +19 -0
  808. package/core/scope/site.js +32 -0
  809. package/core/search/engine.d.ts +45 -0
  810. package/core/search/engine.js +97 -0
  811. package/core/search/extract.d.ts +20 -0
  812. package/core/search/extract.js +34 -0
  813. package/core/search/index.d.ts +35 -0
  814. package/core/search/index.js +202 -0
  815. package/core/search/sync.d.ts +17 -0
  816. package/core/search/sync.js +145 -0
  817. package/core/search/types.d.ts +49 -0
  818. package/core/search/types.js +1 -0
  819. package/core/settings/scoped.d.ts +13 -0
  820. package/core/settings/scoped.js +35 -0
  821. package/core/site/admin-bar.d.ts +22 -0
  822. package/core/site/admin-bar.js +34 -0
  823. package/core/site/cache.d.ts +20 -0
  824. package/core/site/cache.js +103 -0
  825. package/core/site/filter.d.ts +10 -0
  826. package/core/site/filter.js +93 -0
  827. package/core/site/identity.d.ts +45 -0
  828. package/core/site/identity.js +86 -0
  829. package/core/site/page.d.ts +148 -0
  830. package/core/site/page.js +215 -0
  831. package/core/site/preview.d.ts +32 -0
  832. package/core/site/preview.js +83 -0
  833. package/core/site/reader.d.ts +16 -0
  834. package/core/site/reader.js +142 -0
  835. package/core/site/words.d.ts +60 -0
  836. package/core/site/words.js +86 -0
  837. package/core/storage/index.d.ts +10 -0
  838. package/core/storage/index.js +50 -0
  839. package/core/storage/local.d.ts +9 -0
  840. package/core/storage/local.js +78 -0
  841. package/core/storage/remote.d.ts +23 -0
  842. package/core/storage/remote.js +58 -0
  843. package/core/storage/s3.d.ts +21 -0
  844. package/core/storage/s3.js +108 -0
  845. package/core/storage/types.d.ts +82 -0
  846. package/core/storage/types.js +1 -0
  847. package/core/theme/define.d.ts +209 -0
  848. package/core/theme/define.js +84 -0
  849. package/core/theme/installed.d.ts +18 -0
  850. package/core/theme/installed.js +32 -0
  851. package/core/theme/schema.d.ts +11 -0
  852. package/core/theme/schema.js +25 -0
  853. package/core/theme/tokens.d.ts +23 -0
  854. package/core/theme/tokens.js +68 -0
  855. package/core/ui/preferences.d.ts +3 -0
  856. package/core/ui/preferences.js +7 -0
  857. package/core/urls/base-path.d.ts +28 -0
  858. package/core/urls/base-path.js +54 -0
  859. package/core/urls/path.d.ts +12 -0
  860. package/core/urls/path.js +47 -0
  861. package/core/urls/pattern.d.ts +23 -0
  862. package/core/urls/pattern.js +124 -0
  863. package/core/urls/redirects.d.ts +50 -0
  864. package/core/urls/redirects.js +85 -0
  865. package/core/urls/resolve.d.ts +33 -0
  866. package/core/urls/resolve.js +133 -0
  867. package/core/urls/site-href.d.ts +13 -0
  868. package/core/urls/site-href.js +13 -0
  869. package/core/version.d.ts +2 -0
  870. package/core/version.js +2 -0
  871. package/entry/admin.d.ts +6 -0
  872. package/entry/admin.js +5 -0
  873. package/entry/config.d.ts +3 -0
  874. package/entry/config.js +3 -0
  875. package/entry/fields.d.ts +2 -0
  876. package/entry/fields.js +2 -0
  877. package/entry/headless.d.ts +20 -0
  878. package/entry/headless.js +27 -0
  879. package/entry/next.d.mts +5 -0
  880. package/entry/next.mjs +84 -0
  881. package/entry/plugin.d.ts +26 -0
  882. package/entry/plugin.js +11 -0
  883. package/entry/react.d.ts +9 -0
  884. package/entry/react.js +8 -0
  885. package/entry/search.d.ts +3 -0
  886. package/entry/search.js +1 -0
  887. package/entry/server.d.ts +6 -0
  888. package/entry/server.js +5 -0
  889. package/entry/storage.d.ts +6 -0
  890. package/entry/storage.js +3 -0
  891. package/entry/testing.d.ts +1 -0
  892. package/entry/testing.js +1 -0
  893. package/entry/theme.d.ts +3 -0
  894. package/entry/theme.js +2 -0
  895. package/generated/client-postgres/client.d.ts +1 -0
  896. package/generated/client-postgres/client.js +5 -0
  897. package/generated/client-postgres/default.d.ts +1 -0
  898. package/generated/client-postgres/default.js +5 -0
  899. package/generated/client-postgres/edge.d.ts +1 -0
  900. package/generated/client-postgres/edge.js +644 -0
  901. package/generated/client-postgres/index-browser.js +670 -0
  902. package/generated/client-postgres/index.d.ts +61076 -0
  903. package/generated/client-postgres/index.js +644 -0
  904. package/generated/client-postgres/package.json +139 -0
  905. package/generated/client-postgres/query_compiler_fast_bg.js +2 -0
  906. package/generated/client-postgres/query_compiler_fast_bg.wasm +0 -0
  907. package/generated/client-postgres/query_compiler_fast_bg.wasm-base64.js +2 -0
  908. package/generated/client-postgres/runtime/client.d.ts +3490 -0
  909. package/generated/client-postgres/runtime/client.js +105 -0
  910. package/generated/client-postgres/runtime/index-browser.d.ts +90 -0
  911. package/generated/client-postgres/runtime/index-browser.js +6 -0
  912. package/generated/client-postgres/runtime/wasm-compiler-edge.js +100 -0
  913. package/generated/client-postgres/schema.prisma +661 -0
  914. package/generated/client-postgres/wasm-edge-light-loader.mjs +5 -0
  915. package/generated/client-postgres/wasm-worker-loader.mjs +5 -0
  916. package/generated/client-sqlite/client.d.ts +1 -0
  917. package/generated/client-sqlite/client.js +5 -0
  918. package/generated/client-sqlite/default.d.ts +1 -0
  919. package/generated/client-sqlite/default.js +5 -0
  920. package/generated/client-sqlite/edge.d.ts +1 -0
  921. package/generated/client-sqlite/edge.js +641 -0
  922. package/generated/client-sqlite/index-browser.js +667 -0
  923. package/generated/client-sqlite/index.d.ts +60911 -0
  924. package/generated/client-sqlite/index.js +641 -0
  925. package/generated/client-sqlite/package.json +139 -0
  926. package/generated/client-sqlite/query_compiler_fast_bg.js +2 -0
  927. package/generated/client-sqlite/query_compiler_fast_bg.wasm +0 -0
  928. package/generated/client-sqlite/query_compiler_fast_bg.wasm-base64.js +2 -0
  929. package/generated/client-sqlite/runtime/client.d.ts +3490 -0
  930. package/generated/client-sqlite/runtime/client.js +105 -0
  931. package/generated/client-sqlite/runtime/index-browser.d.ts +90 -0
  932. package/generated/client-sqlite/runtime/index-browser.js +6 -0
  933. package/generated/client-sqlite/runtime/wasm-compiler-edge.js +100 -0
  934. package/generated/client-sqlite/schema.prisma +661 -0
  935. package/generated/client-sqlite/wasm-edge-light-loader.mjs +5 -0
  936. package/generated/client-sqlite/wasm-worker-loader.mjs +5 -0
  937. package/generated/schema-postgres/collection.prisma +316 -0
  938. package/generated/schema-postgres/extend.prisma +101 -0
  939. package/generated/schema-postgres/schema.prisma +8 -0
  940. package/generated/schema-postgres/security.prisma +64 -0
  941. package/generated/schema-postgres/user.prisma +168 -0
  942. package/lib/argon2/index.d.ts +2 -0
  943. package/lib/argon2/index.js +5 -0
  944. package/lib/auth-client.d.ts +1789 -0
  945. package/lib/auth-client.js +26 -0
  946. package/lib/client/api.d.ts +58 -0
  947. package/lib/client/api.js +106 -0
  948. package/lib/client/realtime.d.ts +2 -0
  949. package/lib/client/realtime.js +20 -0
  950. package/lib/paths.d.ts +8 -0
  951. package/lib/paths.js +17 -0
  952. package/lib/preferences.d.ts +2 -0
  953. package/lib/preferences.js +2 -0
  954. package/lib/prisma/index.d.ts +5 -0
  955. package/lib/prisma/index.js +19 -0
  956. package/lib/prisma/kind.d.ts +4 -0
  957. package/lib/prisma/kind.js +3 -0
  958. package/lib/slugify/index.d.ts +2 -0
  959. package/lib/slugify/index.js +3 -0
  960. package/lib/time.d.ts +2 -0
  961. package/lib/time.js +28 -0
  962. package/lib/utils.d.ts +1 -0
  963. package/lib/utils.js +1 -0
  964. package/package.json +153 -4
  965. package/prisma/migrations/20261109000000_baseline/migration.sql +275 -0
  966. package/prisma/migrations/20261109024631_add_block_types/migration.sql +37 -0
  967. package/prisma/migrations/20261109032318_add_files/migration.sql +37 -0
  968. package/prisma/migrations/20261109034155_add_revisions/migration.sql +36 -0
  969. package/prisma/migrations/20261109035535_add_view_collections/migration.sql +3 -0
  970. package/prisma/migrations/20261109041354_add_user_fields/migration.sql +21 -0
  971. package/prisma/migrations/20261109044425_add_extensibility/migration.sql +44 -0
  972. package/prisma/migrations/20261109055558_add_request_logs/migration.sql +18 -0
  973. package/prisma/migrations/20261109143022_add_file_temporary/migration.sql +22 -0
  974. package/prisma/migrations/20261109172829_add_extension_ownership/migration.sql +5 -0
  975. package/prisma/migrations/20261109211834_plugin_state/migration.sql +17 -0
  976. package/prisma/migrations/20261109222046_field_presets_layouts_upgrades/migration.sql +34 -0
  977. package/prisma/migrations/20261109224638_site_content_model/migration.sql +16 -0
  978. package/prisma/migrations/20261113004025_durable_hooks/migration.sql +20 -0
  979. package/prisma/migrations/20261114015159_localization/migration.sql +93 -0
  980. package/prisma/migrations/20261115005518_schema_labels/migration.sql +5 -0
  981. package/prisma/migrations/20261116120000_review_workflow/migration.sql +24 -0
  982. package/prisma/migrations/20261116130000_drop_request_log/migration.sql +5 -0
  983. package/prisma/migrations/20261116170000_row_scopes/migration.sql +5 -0
  984. package/prisma/migrations/20261116191352_redirect_scope/migration.sql +19 -0
  985. package/prisma/migrations/20261116200034_stored_file_scope/migration.sql +24 -0
  986. package/prisma/migrations/20261116211311_audit_webhook_scope/migration.sql +43 -0
  987. package/prisma/migrations/20261117152203_trash_records/migration.sql +42 -0
  988. package/prisma/migrations/20261117154617_file_text/migration.sql +28 -0
  989. package/prisma/migrations/20261117200538_image_focus/migration.sql +3 -0
  990. package/prisma/migrations/migration_lock.toml +3 -0
  991. package/prisma/migrations-postgres/20261109045000_baseline/migration.sql +542 -0
  992. package/prisma/migrations-postgres/20261109055558_add_request_logs/migration.sql +20 -0
  993. package/prisma/migrations-postgres/20261109143022_add_file_temporary/migration.sql +2 -0
  994. package/prisma/migrations-postgres/20261109172829_add_extension_ownership/migration.sql +5 -0
  995. package/prisma/migrations-postgres/20261109211834_plugin_state/migration.sql +19 -0
  996. package/prisma/migrations-postgres/20261109222046_field_presets_layouts_upgrades/migration.sql +40 -0
  997. package/prisma/migrations-postgres/20261109224638_site_content_model/migration.sql +18 -0
  998. package/prisma/migrations-postgres/20261113004025_durable_hooks/migration.sql +22 -0
  999. package/prisma/migrations-postgres/20261114015159_localization/migration.sql +43 -0
  1000. package/prisma/migrations-postgres/20261115005518_schema_labels/migration.sql +5 -0
  1001. package/prisma/migrations-postgres/20261116120000_review_workflow/migration.sql +28 -0
  1002. package/prisma/migrations-postgres/20261116130000_drop_request_log/migration.sql +3 -0
  1003. package/prisma/migrations-postgres/20261116170000_row_scopes/migration.sql +5 -0
  1004. package/prisma/migrations-postgres/20261116191352_redirect_scope/migration.sql +8 -0
  1005. package/prisma/migrations-postgres/20261116200034_stored_file_scope/migration.sql +5 -0
  1006. package/prisma/migrations-postgres/20261116211311_audit_webhook_scope/migration.sql +8 -0
  1007. package/prisma/migrations-postgres/20261117152203_trash_records/migration.sql +52 -0
  1008. package/prisma/migrations-postgres/20261117154617_file_text/migration.sql +5 -0
  1009. package/prisma/migrations-postgres/20261117200538_image_focus/migration.sql +3 -0
  1010. package/prisma/migrations-postgres/migration_lock.toml +3 -0
  1011. package/prisma/schema/collection.prisma +316 -0
  1012. package/prisma/schema/extend.prisma +101 -0
  1013. package/prisma/schema/schema.prisma +8 -0
  1014. package/prisma/schema/security.prisma +64 -0
  1015. package/prisma/schema/user.prisma +168 -0
  1016. package/prisma.config.ts +29 -0
  1017. package/routes/api-table.generated.d.ts +4 -0
  1018. package/routes/api-table.generated.js +100 -0
  1019. package/routes/api.d.ts +12 -0
  1020. package/routes/api.js +45 -0
  1021. package/routes/client-page.d.ts +11 -0
  1022. package/routes/client-page.js +13 -0
  1023. package/routes/client-pages.generated.d.ts +5 -0
  1024. package/routes/client-pages.generated.js +40 -0
  1025. package/routes/match.d.ts +8 -0
  1026. package/routes/match.js +60 -0
  1027. package/routes/pages-table.generated.d.ts +12 -0
  1028. package/routes/pages-table.generated.js +45 -0
  1029. package/routes/pages.d.ts +16 -0
  1030. package/routes/pages.js +44 -0
  1031. package/routes/proxy.d.ts +16 -0
  1032. package/routes/proxy.js +89 -0
  1033. package/routes/public-pages.d.ts +24 -0
  1034. package/routes/public-pages.js +47 -0
  1035. package/routes/root-layout.d.ts +8 -0
  1036. package/routes/root-layout.js +12 -0
  1037. package/routes/site.d.ts +32 -0
  1038. package/routes/site.js +131 -0
  1039. package/routes/start.d.ts +7 -0
  1040. package/routes/start.js +37 -0
  1041. package/scripts/commands.mjs +84 -0
  1042. package/scripts/doctor.mjs +165 -0
  1043. package/scripts/empty.mjs +2 -0
  1044. package/scripts/init.mjs +253 -0
  1045. package/scripts/scaffold.mjs +293 -0
  1046. package/scripts/sync.mjs +262 -0
  1047. package/scripts/tansy.mjs +383 -0
  1048. package/sdk/index.d.ts +276 -0
  1049. package/sdk/index.js +296 -0
  1050. package/styles/admin.css +15 -0
  1051. package/styles/base.css +13 -0
  1052. package/styles/components.css +500 -0
  1053. package/styles/editor.css +234 -0
  1054. package/styles/reset.css +34 -0
  1055. package/styles/rich-text.css +14 -0
  1056. package/styles/tokens-dark.css +65 -0
  1057. package/styles/tokens.css +141 -0
  1058. package/styles/utilities.css +129 -0
  1059. package/types/content.d.ts +54 -0
  1060. package/types/content.js +1 -0
@@ -0,0 +1,2 @@
1
+ /** Called by Vercel Cron, any cron service, or `tansy tick`, where the host doesn't keep timers running. */
2
+ export declare const GET: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,4 @@
1
+ import { route } from "../../../core/authz/guard";
2
+ import { runFromEndpoint } from "../../../core/background/endpoint";
3
+ /** Called by Vercel Cron, any cron service, or `tansy tick`, where the host doesn't keep timers running. */
4
+ export const GET = route({ access: "public", reason: "Runs background work for a cron service; authorized by Authorization: Bearer CRON_SECRET, checked in constant time" }, async ({ request }) => runFromEndpoint(request.headers.get("authorization")));
@@ -0,0 +1 @@
1
+ export declare const POST: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../core/authz/guard";
3
+ import { authorizeRecord, loadRuleLookups } from "../../../core/authz/records";
4
+ import { allCollections, ruleRequest } from "../../../core/content/access";
5
+ import { runBatch } from "../../../core/content/batch";
6
+ import { viewRecord } from "../../../core/content/public-records";
7
+ import { HttpError } from "../../../core/http/errors";
8
+ const body = z.object({
9
+ requests: z.array(z.object({
10
+ method: z.enum(["POST", "PATCH", "DELETE"]),
11
+ url: z.string().max(300),
12
+ body: z.record(z.string(), z.unknown()).optional(),
13
+ })).min(1).max(1000),
14
+ });
15
+ export const POST = route({ access: "rules", apiKey: true, body, audit: "record.batch", maxBodyBytes: 8 * 1024 * 1024 }, async ({ body, principal, request, runtime, auditTarget }) => {
16
+ const { enabled, maxRequests } = runtime.settings.batch;
17
+ if (!enabled)
18
+ throw new HttpError(403, "BATCH_DISABLED", "Batch requests are not allowed.");
19
+ if (body.requests.length > maxRequests)
20
+ throw new HttpError(400, "BATCH_TOO_LARGE", `A batch can hold at most ${maxRequests} requests.`);
21
+ const lookups = await loadRuleLookups(await allCollections());
22
+ const results = await runBatch(body.requests, principal, (collection, action, record, values, locale) => authorizeRecord(principal, collection, action, record, { ...ruleRequest(request, {}, values, lookups), locale }));
23
+ auditTarget("batch", String(results.length), { operations: results.slice(0, 200).map(({ collection, action, row }) => ({ collection: collection.slug, action, id: row.id })) });
24
+ const req = ruleRequest(request, {}, {}, lookups);
25
+ return Promise.all(results.map(async ({ collection, action, row }) => (action === "delete" ? { status: 204 } : { status: 200, body: await viewRecord(collection, row, {}, principal, req) })));
26
+ });
@@ -0,0 +1 @@
1
+ export declare const DELETE: import("../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,8 @@
1
+ import { route } from "../../../../core/authz/guard";
2
+ import { deleteBlockLayout } from "../../../../core/blocks/layouts";
3
+ import { parseId } from "../../../../core/content/ids";
4
+ export const DELETE = route({ access: "permission", permission: "collection:delete", audit: "block_layout.delete", fresh: true }, async ({ params, auditTarget }) => {
5
+ const name = await deleteBlockLayout(parseId(params.id));
6
+ auditTarget("block_layout", params.id, { name });
7
+ return null;
8
+ });
@@ -0,0 +1,2 @@
1
+ export declare const GET: import("../../../core/authz/guard").GuardedHandler;
2
+ export declare const POST: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,14 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../core/authz/guard";
3
+ import { createBlockLayout, listBlockLayouts } from "../../../core/blocks/layouts";
4
+ import { storedBlock } from "../../../core/fields/builtin";
5
+ const body = z.object({
6
+ name: z.string().trim().min(1).max(100),
7
+ blocks: z.array(storedBlock).min(1).max(200),
8
+ });
9
+ export const GET = route({ access: "permission", permission: "collection:read" }, async () => listBlockLayouts());
10
+ export const POST = route({ access: "permission", permission: "collection:create", body, audit: "block_layout.create", fresh: true }, async ({ body, principal, auditTarget }) => {
11
+ const layout = await createBlockLayout(body, principal.user.id);
12
+ auditTarget("block_layout", String(layout.id), { name: layout.name });
13
+ return layout;
14
+ });
@@ -0,0 +1,3 @@
1
+ export declare const GET: import("../../../../core/authz/guard").GuardedHandler;
2
+ export declare const PUT: import("../../../../core/authz/guard").GuardedHandler;
3
+ export declare const DELETE: import("../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { labelsSchema } from "../../../../core/i18n/labels-schema";
3
+ import { route } from "../../../../core/authz/guard";
4
+ import { deleteBlockType, requireBlockType, updateBlockType } from "../../../../core/blocks/service";
5
+ import { parseId } from "../../../../core/content/ids";
6
+ const body = z.object({
7
+ label: z.string().trim().min(1).max(200),
8
+ /** The label in other interface languages, such as { "ar": "صورة" }. Left as it is when absent. */
9
+ labels: labelsSchema(200).nullable().optional(),
10
+ icon: z.string().trim().min(1).max(50).optional(),
11
+ fields: z.array(z.object({
12
+ name: z.string().trim().min(1).max(120),
13
+ type: z.string().min(1).max(40),
14
+ config: z.record(z.string(), z.unknown()).optional(),
15
+ })).max(100),
16
+ });
17
+ export const GET = route({ access: "permission", permission: "collection:read" }, async ({ params }) => requireBlockType(parseId(params.id)));
18
+ export const PUT = route({ access: "permission", permission: "collection:update", body, audit: "block_type.update", fresh: true }, async ({ params, body, auditTarget }) => {
19
+ const blockType = await updateBlockType(parseId(params.id), body);
20
+ auditTarget("block_type", params.id, { name: blockType.name, version: blockType.version });
21
+ return blockType;
22
+ });
23
+ export const DELETE = route({ access: "permission", permission: "collection:delete", audit: "block_type.delete", fresh: true }, async ({ params, auditTarget }) => {
24
+ const name = await deleteBlockType(parseId(params.id));
25
+ auditTarget("block_type", params.id, { name });
26
+ return null;
27
+ });
@@ -0,0 +1,2 @@
1
+ export declare const GET: import("../../../core/authz/guard").GuardedHandler;
2
+ export declare const POST: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import { labelsSchema } from "../../../core/i18n/labels-schema";
3
+ import { route } from "../../../core/authz/guard";
4
+ import { createBlockType, listBlockTypes } from "../../../core/blocks/service";
5
+ import { blockNameSchema } from "../../../core/fields/builtin";
6
+ const body = z.object({
7
+ name: blockNameSchema,
8
+ label: z.string().trim().min(1).max(200),
9
+ /** The label in other interface languages, such as { "ar": "صورة" }. Left as it is when absent. */
10
+ labels: labelsSchema(200).nullable().optional(),
11
+ icon: z.string().trim().min(1).max(50).optional(),
12
+ fields: z.array(z.object({
13
+ name: z.string().trim().min(1).max(120),
14
+ type: z.string().min(1).max(40),
15
+ config: z.record(z.string(), z.unknown()).optional(),
16
+ })).max(100),
17
+ });
18
+ export const GET = route({ access: "permission", permission: "collection:read" }, async () => listBlockTypes());
19
+ export const POST = route({ access: "permission", permission: "collection:create", body, audit: "block_type.create", fresh: true }, async ({ body, principal, auditTarget }) => {
20
+ const blockType = await createBlockType(body, principal.user.id);
21
+ auditTarget("block_type", String(blockType.id), { name: blockType.name });
22
+ return blockType;
23
+ });
@@ -0,0 +1 @@
1
+ export declare const POST: import("../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,9 @@
1
+ import { route } from "../../../../../../../../core/authz/guard";
2
+ import { fileActor } from "../../../../../../../../core/files/refs";
3
+ import { presentRecord } from "../../../../../../../../core/content/records";
4
+ import { publishDraft, requireRecord } from "../../../../../../../../core/content/revisions";
5
+ export const POST = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, audit: "record.draft_publish" }, async ({ params, principal, request, auditTarget }) => {
6
+ const { collection, item } = await requireRecord(params, principal, request, "update");
7
+ auditTarget("record", String(item.id), { collection: collection.slug });
8
+ return presentRecord(collection, await publishDraft(collection, item, fileActor(principal)), principal);
9
+ });
@@ -0,0 +1,3 @@
1
+ export declare const GET: import("../../../../../../../core/authz/guard").GuardedHandler;
2
+ export declare const PUT: import("../../../../../../../core/authz/guard").GuardedHandler;
3
+ export declare const DELETE: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../core/authz/guard";
3
+ import { discardDraft, getDraft, requireRecord, saveDraft } from "../../../../../../../core/content/revisions";
4
+ import { versionStamp } from "../../../../../../../core/content/records";
5
+ import { fileActor } from "../../../../../../../core/files/refs";
6
+ const body = z.object({
7
+ values: z.array(z.object({ fieldId: z.number().int().positive(), value: z.unknown() })).max(500),
8
+ expectedUpdatedAt: versionStamp.optional(),
9
+ /** The draft this save replaces, or null when the editor loaded none. */
10
+ expectedDraftAt: versionStamp.nullable().optional(),
11
+ });
12
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true }, async ({ params, principal, request }) => {
13
+ const { collection, item } = await requireRecord(params, principal, request, "view");
14
+ return getDraft(collection, item.id);
15
+ });
16
+ export const PUT = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, body, audit: "record.draft_save" }, async ({ params, body, principal, request, auditTarget }) => {
17
+ const { collection, item } = await requireRecord(params, principal, request, "update");
18
+ auditTarget("record", String(item.id), { collection: collection.slug });
19
+ await saveDraft(collection, item, body, fileActor(principal), { updatedAt: body.expectedUpdatedAt, draftAt: body.expectedDraftAt });
20
+ return getDraft(collection, item.id);
21
+ });
22
+ export const DELETE = route({ access: "permission", permission: "record:update", scope: "record", apiKey: true, audit: "record.draft_discard" }, async ({ params, principal, request, auditTarget }) => {
23
+ const { collection, item } = await requireRecord(params, principal, request, "update");
24
+ auditTarget("record", String(item.id), { collection: collection.slug });
25
+ await discardDraft(collection, item.id);
26
+ return null;
27
+ });
@@ -0,0 +1,5 @@
1
+ /**
2
+ * A link that shows one record's unpublished state. It needs `record:read` like the rest
3
+ * of a record's history, and the token keeps working only while its maker holds that.
4
+ */
5
+ export declare const POST: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,13 @@
1
+ import { route } from "../../../../../../../core/authz/guard";
2
+ import { requireRecord } from "../../../../../../../core/content/revisions";
3
+ import { createPreviewToken, previewEntryUrl } from "../../../../../../../core/site/preview";
4
+ /**
5
+ * A link that shows one record's unpublished state. It needs `record:read` like the rest
6
+ * of a record's history, and the token keeps working only while its maker holds that.
7
+ */
8
+ export const POST = route({ access: "permission", permission: "record:read", scope: "record", audit: "record.preview" }, async ({ params, principal, request, auditTarget }) => {
9
+ const { collection, item } = await requireRecord(params, principal, request, "view");
10
+ auditTarget("record", `${collection.slug}/${item.id}`);
11
+ const { token, expiresAt } = createPreviewToken(collection.id, item.id, principal.user.id);
12
+ return { token, expiresAt, url: previewEntryUrl(token) };
13
+ });
@@ -0,0 +1,2 @@
1
+ /** Publishes the changes under review. The record service checks `record:publish` again as it writes. */
2
+ export declare const POST: import("../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../../core/authz/guard";
3
+ import { presentRecord, versionStamp } from "../../../../../../../../core/content/records";
4
+ import { requireRecord } from "../../../../../../../../core/content/revisions";
5
+ import { approveReview } from "../../../../../../../../core/content/reviews";
6
+ import { fileActor } from "../../../../../../../../core/files/refs";
7
+ const body = z.object({
8
+ note: z.string().trim().max(2000).optional(),
9
+ /** The live record the reviewer read. */
10
+ expectedUpdatedAt: versionStamp.optional(),
11
+ /** The pending changes the reviewer read, or null when there were none. */
12
+ expectedDraftAt: versionStamp.nullable().optional(),
13
+ });
14
+ /** Publishes the changes under review. The record service checks `record:publish` again as it writes. */
15
+ export const POST = route({ access: "permission", permission: ["record:read", "record:update", "record:publish"], scope: "record", apiKey: true, body, audit: "record.review_approve" }, async ({ params, body, principal, request, auditTarget }) => {
16
+ const { collection, item } = await requireRecord(params, principal, request, "update");
17
+ auditTarget("record", String(item.id), { collection: collection.slug });
18
+ const updated = await approveReview(collection, item, fileActor(principal), body.note, { updatedAt: body.expectedUpdatedAt, draftAt: body.expectedDraftAt });
19
+ return presentRecord(collection, updated, principal);
20
+ });
@@ -0,0 +1,2 @@
1
+ /** Sends the changes back to their author with a note. Nothing is published or discarded. */
2
+ export declare const POST: import("../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../../core/authz/guard";
3
+ import { requireRecord } from "../../../../../../../../core/content/revisions";
4
+ import { requestChanges } from "../../../../../../../../core/content/reviews";
5
+ const body = z.object({ note: z.string().trim().min(1).max(2000) });
6
+ /** Sends the changes back to their author with a note. Nothing is published or discarded. */
7
+ export const POST = route({ access: "permission", permission: ["record:read", "record:publish"], scope: "record", apiKey: true, body, audit: "record.review_changes" }, async ({ params, body, principal, request, auditTarget }) => {
8
+ const { collection, item } = await requireRecord(params, principal, request, "view");
9
+ auditTarget("record", String(item.id), { collection: collection.slug });
10
+ return requestChanges(collection, item.id, principal.user.id, body.note);
11
+ });
@@ -0,0 +1,4 @@
1
+ export declare const GET: import("../../../../../../../core/authz/guard").GuardedHandler;
2
+ /** Asks a reviewer to publish this record's unpublished changes. */
3
+ export declare const POST: import("../../../../../../../core/authz/guard").GuardedHandler;
4
+ export declare const DELETE: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../core/authz/guard";
3
+ import { requireRecord } from "../../../../../../../core/content/revisions";
4
+ import { getReview, submitReview, withdrawReview } from "../../../../../../../core/content/reviews";
5
+ const body = z.object({ note: z.string().trim().max(2000).optional() });
6
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true }, async ({ params, principal, request }) => {
7
+ const { collection, item } = await requireRecord(params, principal, request, "view");
8
+ return getReview(collection, item.id);
9
+ });
10
+ /** Asks a reviewer to publish this record's unpublished changes. */
11
+ export const POST = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, body, audit: "record.review_submit" }, async ({ params, body, principal, request, auditTarget }) => {
12
+ const { collection, item } = await requireRecord(params, principal, request, "update");
13
+ auditTarget("record", String(item.id), { collection: collection.slug });
14
+ return submitReview(collection, item, principal.user.id, body.note);
15
+ });
16
+ export const DELETE = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, audit: "record.review_withdraw" }, async ({ params, principal, request, auditTarget }) => {
17
+ const { collection, item } = await requireRecord(params, principal, request, "update");
18
+ auditTarget("record", String(item.id), { collection: collection.slug });
19
+ await withdrawReview(collection, item.id);
20
+ return null;
21
+ });
@@ -0,0 +1 @@
1
+ export declare const GET: import("../../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../../../core/authz/guard";
3
+ import { diffRevision, requireRecord, requireRevision } from "../../../../../../../../../core/content/revisions";
4
+ const query = z.object({ against: z.string().regex(/^(previous|current|\d{1,10})$/).default("previous") });
5
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true, query }, async ({ params, query, principal, request }) => {
6
+ const { collection, item } = await requireRecord(params, principal, request, "view");
7
+ return diffRevision(collection, item, await requireRevision(collection, item.id, params.revisionId), query.against);
8
+ });
@@ -0,0 +1 @@
1
+ export declare const POST: import("../../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,10 @@
1
+ import { route } from "../../../../../../../../../core/authz/guard";
2
+ import { fileActor } from "../../../../../../../../../core/files/refs";
3
+ import { requireRecord, requireRevision, restoreRevision } from "../../../../../../../../../core/content/revisions";
4
+ import { presentRecord } from "../../../../../../../../../core/content/records";
5
+ export const POST = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, audit: "record.restore" }, async ({ params, principal, request, auditTarget }) => {
6
+ const { collection, item } = await requireRecord(params, principal, request, "update");
7
+ const revision = await requireRevision(collection, item.id, params.revisionId);
8
+ auditTarget("record", String(item.id), { collection: collection.slug, revision: revision.number });
9
+ return presentRecord(collection, await restoreRevision(collection, item, revision, fileActor(principal)), principal);
10
+ });
@@ -0,0 +1 @@
1
+ export declare const GET: import("../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,6 @@
1
+ import { route } from "../../../../../../../../core/authz/guard";
2
+ import { presentRevision, requireRecord, requireRevision } from "../../../../../../../../core/content/revisions";
3
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true }, async ({ params, principal, request }) => {
4
+ const { collection, item } = await requireRecord(params, principal, request, "view");
5
+ return presentRevision(collection, await requireRevision(collection, item.id, params.revisionId));
6
+ });
@@ -0,0 +1 @@
1
+ export declare const GET: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../core/authz/guard";
3
+ import { listRevisions, requireRecord } from "../../../../../../../core/content/revisions";
4
+ const query = z.object({
5
+ page: z.coerce.number().int().min(1).default(1),
6
+ perPage: z.coerce.number().int().min(1).max(100).default(30),
7
+ });
8
+ // Snapshots include hidden fields, so these are for staff with record:read, never for API rules.
9
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true, query }, async ({ params, query, principal, request }) => {
10
+ const { collection, item } = await requireRecord(params, principal, request, "view");
11
+ return listRevisions(collection, item.id, query.page, query.perPage);
12
+ });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The editor reads one language exactly, with `?locale=fr&fallback=none`. A record with no
3
+ * translation there yet still opens, with empty localized fields, when `?translate=1` is set.
4
+ */
5
+ export declare const GET: import("../../../../../../core/authz/guard").GuardedHandler;
6
+ export declare const PATCH: import("../../../../../../core/authz/guard").GuardedHandler;
7
+ export declare const DELETE: import("../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,47 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../core/authz/guard";
3
+ import { authorizeRecord, loadRuleLookups } from "../../../../../../core/authz/records";
4
+ import { validateRecordValues } from "../../../../../../core/blocks/service";
5
+ import { requireCollection, ruleRequest } from "../../../../../../core/content/access";
6
+ import { deleteContent, requireContent, updateContent } from "../../../../../../core/content/content-service";
7
+ import { parseId } from "../../../../../../core/content/ids";
8
+ import { flattenRecord, presentRecord, resolveValues, versionStamp } from "../../../../../../core/content/records";
9
+ import { fileActor } from "../../../../../../core/files/refs";
10
+ import { localeParams, readingLocale, writingLocale } from "../../../../../../core/i18n/request";
11
+ import { editorLocalization } from "../../../../../../core/i18n/editor";
12
+ /**
13
+ * The editor reads one language exactly, with `?locale=fr&fallback=none`. A record with no
14
+ * translation there yet still opens, with empty localized fields, when `?translate=1` is set.
15
+ */
16
+ export const GET = route({ access: "rules", apiKey: true }, async ({ params, principal, request }) => {
17
+ const translate = request.nextUrl.searchParams.get("translate") === "1";
18
+ const raw = await requireCollection(parseId(params.id));
19
+ const { collection, locale } = translate ? await writingLocale(raw, principal, localeParams(request)) : await readingLocale(raw, principal, localeParams(request));
20
+ const item = await requireContent(collection, parseId(params.contentId));
21
+ const req = { ...ruleRequest(request, {}, {}, await loadRuleLookups([collection])), locale };
22
+ authorizeRecord(principal, collection, "view", flattenRecord(item), req);
23
+ const localization = locale ? await editorLocalization(collection, item.id, locale, principal, req) : null;
24
+ return { ...presentRecord(collection, item, principal), ...(localization ? { localization, translations: localization.translations } : {}) };
25
+ });
26
+ const body = z.object({
27
+ status: z.enum(["draft", "published"]).optional(),
28
+ values: z.array(z.object({ fieldId: z.number().int().positive(), value: z.unknown() })).max(500),
29
+ expectedUpdatedAt: versionStamp.optional(),
30
+ });
31
+ export const PATCH = route({ access: "rules", apiKey: true, body, audit: "record.update" }, async ({ params, body, principal, request, auditTarget }) => {
32
+ const { collection, locale } = await writingLocale(await requireCollection(parseId(params.id)), principal, localeParams(request));
33
+ const item = await requireContent(collection, parseId(params.contentId));
34
+ const submitted = resolveValues(collection, body);
35
+ authorizeRecord(principal, collection, "update", flattenRecord(item), { ...ruleRequest(request, {}, submitted, await loadRuleLookups([collection])), locale });
36
+ const values = await validateRecordValues(collection.fields, submitted, item);
37
+ auditTarget("record", String(item.id), { collection: collection.slug, ...(locale ? { locale } : {}) });
38
+ return presentRecord(collection, await updateContent(collection, item, body.status, values, fileActor(principal), undefined, body.expectedUpdatedAt), principal);
39
+ });
40
+ export const DELETE = route({ access: "rules", apiKey: true, audit: "record.delete" }, async ({ params, principal, request, auditTarget }) => {
41
+ const { collection } = await readingLocale(await requireCollection(parseId(params.id)), principal, localeParams(request));
42
+ const item = await requireContent(collection, parseId(params.contentId));
43
+ authorizeRecord(principal, collection, "delete", flattenRecord(item), ruleRequest(request, {}, {}, await loadRuleLookups([collection])));
44
+ auditTarget("record", String(item.id), { collection: collection.slug });
45
+ await deleteContent(collection, item.id, fileActor(principal));
46
+ return null;
47
+ });
@@ -0,0 +1,2 @@
1
+ export declare const GET: import("../../../../../../../core/authz/guard").GuardedHandler;
2
+ export declare const PUT: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../core/authz/guard";
3
+ import { getSchedule, requireRecord, setSchedule } from "../../../../../../../core/content/revisions";
4
+ import { canPublish, reviewRequired } from "../../../../../../../core/content/workflow";
5
+ const moment = z.iso.datetime({ offset: true }).nullable();
6
+ const body = z.object({ publishAt: moment, unpublishAt: moment });
7
+ export const GET = route({ access: "permission", permission: "record:read", scope: "record", apiKey: true }, async ({ params, principal, request }) => {
8
+ const { collection, item } = await requireRecord(params, principal, request, "view");
9
+ return getSchedule(collection, item.id);
10
+ });
11
+ export const PUT = route({ access: "permission", permission: ["record:read", "record:update"], scope: "record", apiKey: true, body, audit: "record.schedule" }, async ({ params, body, principal, request, auditTarget }) => {
12
+ const { collection, item } = await requireRecord(params, principal, request, "update");
13
+ // It would fail when it runs anyway, since a schedule acts with its author's permissions.
14
+ if ((body.publishAt || body.unpublishAt) && !canPublish(collection, principal.permissions))
15
+ throw reviewRequired();
16
+ auditTarget("record", String(item.id), { collection: collection.slug, publishAt: body.publishAt, unpublishAt: body.unpublishAt });
17
+ await setSchedule(collection, item.id, body, principal.user.id);
18
+ return getSchedule(collection, item.id);
19
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A machine translation of one record's localized text, for the editor to put in the form
3
+ * unsaved. Only text the caller may read in `from` is sent, never hidden fields, and the
4
+ * audit entry names the languages and fields, never the text.
5
+ */
6
+ export declare const POST: import("../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../../../core/authz/guard";
3
+ import { requireCollection, ruleRequest } from "../../../../../../../core/content/access";
4
+ import { parseId } from "../../../../../../../core/content/ids";
5
+ import { requestedLocale } from "../../../../../../../core/i18n/request";
6
+ import { localeCatalog } from "../../../../../../../core/i18n/locales";
7
+ import { suggestTranslation } from "../../../../../../../core/i18n/translate";
8
+ const body = z.object({
9
+ from: z.string().max(35),
10
+ to: z.string().max(35),
11
+ /** The plugin whose translator to use. The first installed one when left out. */
12
+ provider: z.string().max(60).optional(),
13
+ });
14
+ /**
15
+ * A machine translation of one record's localized text, for the editor to put in the form
16
+ * unsaved. Only text the caller may read in `from` is sent, never hidden fields, and the
17
+ * audit entry names the languages and fields, never the text.
18
+ */
19
+ export const POST = route({ access: "permission", permission: "record:read", scope: "record", body, audit: "record.translate" }, async ({ params, body, principal, request, auditTarget }) => {
20
+ const collection = await requireCollection(parseId(params.id));
21
+ const catalog = await localeCatalog();
22
+ const from = requestedLocale(catalog, body.from, principal, collection.id);
23
+ const to = requestedLocale(catalog, body.to, principal, collection.id);
24
+ const suggestion = await suggestTranslation(collection, parseId(params.contentId), from, to, principal, ruleRequest(request, {}, {}, undefined), body.provider);
25
+ auditTarget("record", params.contentId, { collection: collection.slug, from, to, provider: suggestion.provider, fields: suggestion.fields });
26
+ return suggestion;
27
+ });
@@ -0,0 +1,2 @@
1
+ /** Removing a translation is an update to the record, by someone who may edit that language. */
2
+ export declare const DELETE: import("../../../../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,17 @@
1
+ import { route } from "../../../../../../../../core/authz/guard";
2
+ import { authorizeRecord, loadRuleLookups } from "../../../../../../../../core/authz/records";
3
+ import { requireCollection, ruleRequest } from "../../../../../../../../core/content/access";
4
+ import { deleteTranslation, requireContent } from "../../../../../../../../core/content/content-service";
5
+ import { parseId } from "../../../../../../../../core/content/ids";
6
+ import { flattenRecord } from "../../../../../../../../core/content/records";
7
+ import { fileActor } from "../../../../../../../../core/files/refs";
8
+ import { readingLocale } from "../../../../../../../../core/i18n/request";
9
+ /** Removing a translation is an update to the record, by someone who may edit that language. */
10
+ export const DELETE = route({ access: "rules", apiKey: true, audit: "record.translation.delete" }, async ({ params, principal, request, auditTarget }) => {
11
+ const { collection, locale } = await readingLocale(await requireCollection(parseId(params.id)), principal, { locale: params.locale, fallback: "none" });
12
+ const item = await requireContent(collection, parseId(params.contentId));
13
+ authorizeRecord(principal, collection, "update", flattenRecord(item), { ...ruleRequest(request, {}, {}, await loadRuleLookups([collection])), locale });
14
+ await deleteTranslation(collection, item, locale ?? params.locale, fileActor(principal));
15
+ auditTarget("record", String(item.id), { collection: collection.slug, locale });
16
+ return null;
17
+ });
@@ -0,0 +1,2 @@
1
+ export declare const GET: import("../../../../../core/authz/guard").GuardedHandler;
2
+ export declare const POST: import("../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,45 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../core/authz/guard";
3
+ import { authorizeRecord, decideRecord, listRuleWhere, loadRuleLookups } from "../../../../../core/authz/records";
4
+ import { validateRecordValues } from "../../../../../core/blocks/service";
5
+ import { requireCollection, ruleRequest } from "../../../../../core/content/access";
6
+ import { createContent, listContentPage, recordColumns } from "../../../../../core/content/content-service";
7
+ import { parseId } from "../../../../../core/content/ids";
8
+ import { presentRecord, resolveValues } from "../../../../../core/content/records";
9
+ import { withDefaults } from "../../../../../core/fields/validate";
10
+ import { fileActor } from "../../../../../core/files/refs";
11
+ import { HttpError } from "../../../../../core/http/errors";
12
+ import { localeParams, readingLocale, writingLocale } from "../../../../../core/i18n/request";
13
+ import { translationStatuses } from "../../../../../core/i18n/storage";
14
+ const query = z.object({
15
+ page: z.coerce.number().int().min(1).default(1),
16
+ perPage: z.coerce.number().int().min(1).max(200).default(30),
17
+ });
18
+ export const GET = route({ access: "rules", apiKey: true, query }, async ({ params, query, principal, request }) => {
19
+ const { collection, locale } = await readingLocale(await requireCollection(parseId(params.id)), principal, localeParams(request));
20
+ const req = { ...ruleRequest(request, query, {}, await loadRuleLookups([collection])), locale };
21
+ // A locked rule answers 403 for the whole list; a failed expression just filters.
22
+ if (decideRecord(principal, collection, "list", {}, req) === "locked") {
23
+ throw new HttpError(403, "RULE_LOCKED", "Only administrators can perform this action.");
24
+ }
25
+ const { totalItems, items } = await listContentPage(collection, listRuleWhere(principal, collection, req, recordColumns(collection)), query);
26
+ // Each record's translations, for the grid's language badges.
27
+ const statuses = await translationStatuses(collection, items.map((row) => row.id));
28
+ return { page: query.page, perPage: query.perPage, totalItems, items: items.map((row) => ({ ...presentRecord(collection, row, principal), ...(statuses.size ? { translations: statuses.get(row.id) ?? [] } : {}) })) };
29
+ });
30
+ const contentBody = z.object({
31
+ status: z.enum(["draft", "published"]).optional(),
32
+ values: z.array(z.object({ fieldId: z.number().int().positive(), value: z.unknown() })).max(500),
33
+ });
34
+ export const POST = route({ access: "rules", apiKey: true, body: contentBody, audit: "record.create" }, async ({ params, body, principal, request, auditTarget }) => {
35
+ const { collection, locale } = await writingLocale(await requireCollection(parseId(params.id)), principal, localeParams(request));
36
+ const submitted = resolveValues(collection, body);
37
+ const createdById = principal.kind === "anonymous" ? null : principal.user.id;
38
+ const candidate = withDefaults(collection.fields, submitted);
39
+ authorizeRecord(principal, collection, "create", { status: "draft", createdById: createdById ?? "", ...(locale ? { locale } : {}), ...candidate }, { ...ruleRequest(request, {}, submitted, await loadRuleLookups([collection])), locale });
40
+ // After the rule check, so callers who may not create learn nothing about the schema.
41
+ const values = await validateRecordValues(collection.fields, candidate);
42
+ const row = await createContent(collection, body.status, values, createdById, fileActor(principal));
43
+ auditTarget("record", String(row.id), { collection: collection.slug, ...(locale ? { locale } : {}) });
44
+ return presentRecord(collection, row, principal);
45
+ });
@@ -0,0 +1 @@
1
+ export declare const PUT: import("../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../../core/authz/guard";
3
+ import { getCollection, updateFields } from "../../../../../core/content/collections";
4
+ import { reindexCollection } from "../../../../../core/content/content-service";
5
+ import { searchSignature } from "../../../../../core/search/extract";
6
+ import { parseId } from "../../../../../core/content/ids";
7
+ const body = z.object({
8
+ fields: z.array(z.object({
9
+ id: z.number().int().positive().optional(),
10
+ name: z.string().trim().min(1).max(120),
11
+ type: z.string().min(1).max(40),
12
+ config: z.record(z.string(), z.unknown()).optional(),
13
+ })).max(200),
14
+ confirm: z.boolean().default(false),
15
+ });
16
+ export const PUT = route({ access: "permission", permission: "collection:update", body, audit: "collection.update_fields", fresh: true }, async ({ params, body, principal, auditTarget }) => {
17
+ const before = searchSignature((await getCollection(parseId(params.id))).fields);
18
+ const { collection, summary } = await updateFields(parseId(params.id), body.fields, body.confirm, principal.user.id);
19
+ auditTarget("collection", params.id, summary);
20
+ if (searchSignature(collection.fields) !== before)
21
+ void reindexCollection(collection).catch((error) => console.error("[search] reindex failed", error));
22
+ return collection;
23
+ });
@@ -0,0 +1,9 @@
1
+ /** The fields rows can fill, for the dashboard's column mapping. */
2
+ export declare const GET: import("../../../../../core/authz/guard").GuardedHandler;
3
+ /**
4
+ * Brings records in from a CSV file or a list of rows. Needs `record:create` for the collection,
5
+ * and `record:update` as well to match and update existing records through `keyField`. Each row
6
+ * is written as a save would be, so validation, hooks, history, search and the review gate all
7
+ * apply; `dryRun` checks every row and writes nothing. `?locale=` imports one language.
8
+ */
9
+ export declare const POST: import("../../../../../core/authz/guard").GuardedHandler;