tansy 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1060) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +142 -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 +4188 -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 +468 -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 +1788 -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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohamed Salah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,143 @@
1
- # Temporary Holding Version
1
+ <h1>
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="apps/docs/public/brand/logo-light.png">
4
+ <img src="apps/docs/public/brand/logo-dark.png" alt="Tansy" height="64">
5
+ </picture>
6
+ </h1>
2
7
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
8
+ A self-hosted content backend on Next.js with runtime-defined collections, and authentication and authorization managed from its dashboard.
9
+
10
+ > **Beta.** Tansy is pre-1.0 and under active development. Any release can change anything — package
11
+ > names, commands, configuration keys, environment variables, database columns — in a patch release
12
+ > and without a deprecation period. Pin exact versions, read the [changelog](CHANGELOG.md) before
13
+ > every upgrade, and take a [backup](docs/guides/backups.md) first. The compatibility promises in
14
+ > [upgrading](docs/guides/upgrading.md) start at 1.0.
15
+
16
+ Full documentation, including the guides, every plugin and every theme, is at **<https://tansycms.vercel.app>**, built from `docs/` in this repo (`apps/docs`).
17
+
18
+ ## Try the demo
19
+
20
+ A live install with the blog, shop and courses plugins and some sample content:
21
+ **<https://tansy-demo.vercel.app/dashboard>**
22
+
23
+ | Email | Password |
24
+ | --- | --- |
25
+ | `demo@example.com` | `explore-tansy-demo` |
26
+
27
+ The demo account is shared by everyone and can only look: browse the collections, records, block
28
+ editor, files, roles and settings. It can't change anything, including its own password. To try
29
+ editing, run your own copy with `npm create tansy@latest`, which takes a minute.
30
+
31
+ ## Quick start with Docker
32
+
33
+ No configuration is needed. Data, uploads and generated secrets live in the `/data` volume.
34
+
35
+ ```bash
36
+ docker build -t tansy .
37
+ docker run --name tansy -p 8090:8090 -v tansy-data:/data tansy
38
+ ```
39
+
40
+ The server log prints a one-time setup link. Open it to create the superadmin, then sign in at <http://localhost:8090>. If you publish a different port or a real domain, set `BETTER_AUTH_URL` to that address with `-e`.
41
+
42
+ For production with Postgres, set `POSTGRES_PASSWORD` and `BETTER_AUTH_URL`, then run `docker compose up -d`. The setup link is in `docker compose logs tansy`. Before going live, set up [backups](docs/guides/backups.md) and copy `TANSY_BACKUP_KEY` from `/data/secrets.env` somewhere safe. Point your load balancer's health check at `/api/ready`, and see [running it](docs/guides/operations.md) for what to watch.
43
+
44
+ ## Starting a new project
45
+
46
+ ```sh
47
+ npm create tansy@latest
48
+ ```
49
+
50
+ It asks what you're making, which theme, where it will run, SQLite or Postgres (or Postgres in Docker), where uploads go and which features to add, then installs, migrates and can create your admin account. Every question has a flag, and `--yes` takes the defaults: see [Start a new project](apps/docs/content/docs/getting-started/new-project.md).
51
+
52
+ To extend it, see the guides for [plugins](docs/guides/plugins.md), [custom fields](docs/guides/fields.md) and [themes](docs/guides/themes.md). Before you commit to it, the [limits](docs/guides/limits.md) are every boundary in one place, and [upgrading](docs/guides/upgrading.md) is what a version number promises.
53
+
54
+ ## Adding it to a Next.js app
55
+
56
+ `tansy` isn't on npm yet. Build the tarballs with `npm run package`, which writes one per package in `.release/`, and install `.release/tansy-<version>.tgz` in place of the package name below.
57
+
58
+ ```bash
59
+ npx create-next-app@latest my-site
60
+ cd my-site
61
+ npm install tansy
62
+ npx tansy init # writes the entry files and a .env with new secrets
63
+ npx tansy migrate
64
+ npm run dev
65
+ ```
66
+
67
+ `tansy init` never overwrites a file. Your root layout and home page move to `app/(site)/`, because the admin has its own root layout, and anything it can't change safely is printed as a step to do by hand. `npx tansy doctor` checks the result. The admin is at `/dashboard` and the API at `/api`, and your own routes, such as `/api/hello`, keep working beside them. Choose other paths with `tansy init --admin /admin --api /cms-api`.
68
+
69
+ ## Building a site
70
+
71
+ `npx tansy init --site` adds a page that renders a theme, and the theme comes from `tansy.config.ts`:
72
+
73
+ ```ts
74
+ import { blog } from "@tansy/theme-blog";
75
+
76
+ export default defineCms({ theme: blog({ tagline: "Field notes" }) });
77
+ ```
78
+
79
+ `themes/blank` is a starting point, `themes/blog` a working example, and `themes/magazine` a fuller one: image cards, search and a sidebar ([docs](docs/themes/magazine.md)). `themes/halo` is a news front page whose sections editors curate from a Front page record ([docs](docs/themes/halo.md)). `themes/storefront` redesigns the shop plugin's pages, styled with Tailwind compiled inside the theme ([docs](docs/themes/storefront.md)). `themes/dispatch` is a newsletter's site: the sign-up form up front and posts as numbered issues ([docs](docs/themes/dispatch.md)). `themes/academy` is a school's site for the LMS: the course catalogue, course pages, and plans that open courses, worked out from the data ([docs](docs/themes/academy.md)). A headless site renders the same theme package over the API. See "Themes" in [docs/EXTENDING.md](docs/EXTENDING.md).
80
+
81
+ ## Languages
82
+
83
+ Add languages on the dashboard's **Languages** page, each with a fallback, then turn on **Languages** in a collection's schema and mark the fields that differ per language as localized. A record keeps one id. Each language is published on its own, and visitors only ever see published translations. Translators can be limited to their own language with `locale:edit@<code>`, and the editor shows the source text, outdated fields, XLIFF export and import, and machine translation through any plugin that provides it.
84
+
85
+ The site gets an address per language (`/fr/...` or a domain per language), `hreflang` alternates, right-to-left pages, and the theme's words per language, which owners can change under **Languages → Site text**. The API and SDK take `?locale=`. Each person picks the dashboard's language under **Account**. English and Arabic ship with core and the first-party plugins. The whole of it is in the [languages guide](docs/guides/localization.md), and building for it in [docs/EXTENDING.md](docs/EXTENDING.md).
86
+
87
+ ## Running from source
88
+
89
+ Requires Node 24. SQLite is the default database, and any Postgres works through `DATABASE_URL`.
90
+
91
+ ```bash
92
+ npm install
93
+ npm run tansy -- init # writes .env with new secrets
94
+ npm run tansy -- migrate
95
+ npm run dev
96
+ ```
97
+
98
+ On first start the server log prints a one-time setup link. Open it to create the superadmin.
99
+
100
+ `tansy init` is complete on its own: a SQLite file beside the app and uploads on local disk, like
101
+ Django's defaults. Before a real deployment, read [going to production](docs/guides/production.md) —
102
+ above all, choose the database before you have content, because records don't move between SQLite
103
+ and Postgres.
104
+
105
+ ## Backups
106
+
107
+ `tansy backup` writes one encrypted archive of the database and uploads, on a schedule or by hand, to any storage adapter, and `tansy restore` puts it back. Both databases are covered, each copied by its own tools. See [docs/guides/backups.md](docs/guides/backups.md).
108
+
109
+ ## Search
110
+
111
+ `/records?search=` runs in the database by default. Set `search` in `tansy.config.ts` to Meilisearch, Typesense or Algolia to use an outside engine instead, kept in step through a queue that retries until the engine has every change. See [docs/guides/search.md](docs/guides/search.md).
112
+
113
+ ## Analytics
114
+
115
+ `@tansy/analytics` counts page views with no cookies and nothing personal kept, and shows them on the dashboard. Add `@tansy/analytics-plausible`, `-umami`, `-google`, `-fathom` or `-matomo` to send them to that service as well, and to see its numbers on the dashboard. See [docs/plugins/analytics.md](docs/plugins/analytics.md).
116
+
117
+ ## Checks
118
+
119
+ ```bash
120
+ npm run check # type-check, lint, unit and contract tests
121
+ npm run docs:build # the documentation site in apps/docs
122
+ TEST_DATABASE_URL=file:./.data/cms_test.db npm run test:integration # wipes that file
123
+ TEST_DATABASE_URL=file:./.data/cms_test.db npm run test:package # the same suite, against the tarball in a fresh app
124
+ ```
125
+
126
+ ## Contributing
127
+
128
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for the repository's layout, its commands, and the three rules
129
+ a change has to keep: the [security model](docs/contributing/security-model.md), the
130
+ [dashboard design system](docs/contributing/design-system.md) and translatable text.
131
+
132
+ ## Releases
133
+
134
+ Every package in this repository moves on one version. `node scripts/set-version.mjs <version>` sets
135
+ it everywhere, `npm run package` builds a tarball per package, and pushing a `v<version>` tag runs
136
+ the release workflow, which checks, builds, publishes to npm with provenance and opens a GitHub
137
+ release from [CHANGELOG.md](CHANGELOG.md). What a release may change before 1.0, and what it may not
138
+ after, is [the deprecation policy](docs/contributing/deprecation.md), written for users as the
139
+ [upgrading guide](docs/guides/upgrading.md).
140
+
141
+ ## Licence
142
+
143
+ MIT. See [LICENSE](LICENSE). The same licence covers every plugin and theme in this repository.
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from "react";
2
+ import { type UserFieldValue } from "../../components/users/UserFieldsForm";
3
+ interface Props {
4
+ initialName: string;
5
+ email: string;
6
+ twoFactorEnabled: boolean;
7
+ permissions: string[];
8
+ denied: boolean;
9
+ enrollMfa: boolean;
10
+ customFields: UserFieldValue[];
11
+ interfaceLocale: string | null;
12
+ children?: ReactNode;
13
+ }
14
+ /** `children` are plugins' account panels, after the person's own details. */
15
+ export default function AccountClient({ initialName, email, twoFactorEnabled, permissions, denied, enrollMfa, customFields, interfaceLocale, children }: Props): import("react").JSX.Element;
16
+ export {};
@@ -0,0 +1,138 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { QRCodeSVG } from "qrcode.react";
4
+ import { useEffect, useState } from "react";
5
+ import { Alert, Button, Card, Field, Input, Modal, PageHeader } from "../../components/ui/kit";
6
+ import { authClient } from "../../lib/auth-client";
7
+ import UserFieldsForm from "../../components/users/UserFieldsForm";
8
+ import { api, unwrap, useAction, useApi } from "../../lib/client/api";
9
+ import { apiPath } from "../../lib/paths";
10
+ import { useT } from "../../components/i18n";
11
+ import { ADMIN_LOCALE_NAMES, ADMIN_LOCALES } from "../../core/i18n/catalogs";
12
+ /** The dashboard's language for this person, saved on their profile and remembered by the browser. */
13
+ function InterfaceLanguage({ initial }) {
14
+ const { t } = useT();
15
+ const [value, setValue] = useState(initial ?? "");
16
+ const { busy, error, run } = useAction();
17
+ const save = async (next) => {
18
+ setValue(next);
19
+ // The whole dashboard changes language, and right to left with it, so the page reloads.
20
+ if (await run(() => api(apiPath("/account/locale"), { method: "PUT", body: { locale: next || null } })))
21
+ window.location.reload();
22
+ };
23
+ return (_jsxs(Card, { title: t("account.language"), description: t("account.languageHint"), children: [error && _jsx(Alert, { children: error }), _jsx(Field, { label: t("account.language"), children: _jsxs("select", { className: "cms-input", value: value, disabled: busy, onChange: (event) => void save(event.target.value), children: [_jsx("option", { value: "", children: t("account.browserLanguage") }), ADMIN_LOCALES.map((code) => _jsx("option", { value: code, lang: code, children: ADMIN_LOCALE_NAMES[code] ?? code }, code))] }) })] }));
24
+ }
25
+ function Profile({ initialName, email }) {
26
+ const { t } = useT();
27
+ const [name, setName] = useState(initialName);
28
+ const [saved, setSaved] = useState(false);
29
+ const { busy, error, run } = useAction();
30
+ return (_jsxs(Card, { title: t("account.profile"), children: [error && _jsx(Alert, { children: error }), saved && _jsx(Alert, { kind: "success", children: t("account.saved") }), _jsx(Field, { label: t("account.email"), children: _jsx(Input, { value: email, disabled: true }) }), _jsx(Field, { label: t("account.name"), children: _jsx(Input, { value: name, onChange: (e) => setName(e.target.value) }) }), _jsx(Button, { loading: busy, onClick: async () => setSaved(await run(() => unwrap(authClient.updateUser({ name })))), children: t("account.save") })] }));
31
+ }
32
+ function Password() {
33
+ const { t } = useT();
34
+ const [current, setCurrent] = useState("");
35
+ const [next, setNext] = useState("");
36
+ const [saved, setSaved] = useState(false);
37
+ const { busy, error, run } = useAction();
38
+ const submit = async (e) => {
39
+ e.preventDefault();
40
+ const ok = await run(() => unwrap(authClient.changePassword({ currentPassword: current, newPassword: next, revokeOtherSessions: true })));
41
+ setSaved(ok);
42
+ if (ok) {
43
+ setCurrent("");
44
+ setNext("");
45
+ }
46
+ };
47
+ return (_jsxs(Card, { title: t("account.password"), description: t("account.passwordHint"), children: [error && _jsx(Alert, { children: error }), saved && _jsx(Alert, { kind: "success", children: t("account.passwordChanged") }), _jsxs("form", { onSubmit: submit, className: "cms-stack-4", children: [_jsx(Field, { label: t("account.currentPassword"), children: _jsx(Input, { required: true, type: "password", autoComplete: "current-password", value: current, onChange: (e) => setCurrent(e.target.value) }) }), _jsx(Field, { label: t("account.newPassword"), children: _jsx(Input, { required: true, type: "password", autoComplete: "new-password", value: next, onChange: (e) => setNext(e.target.value) }) }), _jsx(Button, { type: "submit", loading: busy, children: t("account.changePassword") })] })] }));
48
+ }
49
+ function TwoFactor({ enabled }) {
50
+ const { t } = useT();
51
+ const [password, setPassword] = useState("");
52
+ const [setup, setSetup] = useState(null);
53
+ const [code, setCode] = useState("");
54
+ const [codes, setCodes] = useState(null);
55
+ const { busy, error, run } = useAction();
56
+ const start = () => run(async () => {
57
+ const data = await unwrap(authClient.twoFactor.enable({ password }));
58
+ if (data?.method !== "totp")
59
+ throw new Error(t("account.setupFailed"));
60
+ setSetup({ uri: data.totpURI, backupCodes: data.backupCodes });
61
+ setPassword("");
62
+ });
63
+ const confirm = () => run(async () => {
64
+ await unwrap(authClient.twoFactor.verifyTotp({ code }));
65
+ setCodes(setup?.backupCodes ?? []);
66
+ setSetup(null);
67
+ });
68
+ const disable = async () => {
69
+ if (await run(() => unwrap(authClient.twoFactor.disable({ password }))))
70
+ window.location.reload();
71
+ };
72
+ const regenerate = () => run(async () => {
73
+ const data = await unwrap(authClient.twoFactor.generateBackupCodes({ password }));
74
+ setCodes(data?.backupCodes ?? []);
75
+ setPassword("");
76
+ });
77
+ return (_jsxs(Card, { title: t("account.twoFactor"), description: t("account.twoFactorHint"), children: [error && _jsx(Alert, { children: error }), codes && (_jsxs("div", { className: "cms-stack-3", children: [_jsx(Alert, { kind: "warning", children: t("account.backupCodes") }), _jsx("pre", { className: "cms-codes", children: codes.map((c) => _jsx("span", { children: c }, c)) }), _jsx(Button, { variant: "secondary", onClick: () => window.location.reload(), children: t("account.savedThem") })] })), setup && (_jsxs("div", { className: "cms-stack-3", children: [_jsx("p", { className: "cms-text-sm cms-soft", children: t("account.scan") }), _jsx("div", { className: "cms-qr", children: _jsx(QRCodeSVG, { value: setup.uri, size: 176 }) }), _jsx(Field, { label: t("account.code"), children: _jsx(Input, { autoComplete: "one-time-code", value: code, onChange: (e) => setCode(e.target.value) }) }), _jsx(Button, { loading: busy, onClick: confirm, children: t("account.turnOn") })] })), !setup && !codes && (_jsxs(_Fragment, { children: [_jsxs("p", { className: "cms-text-sm cms-soft", children: [t("account.statusLabel"), " ", _jsx("strong", { children: enabled ? t("account.on") : t("account.off") })] }), _jsx(Field, { label: t("account.confirmPassword"), children: _jsx(Input, { type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }), _jsx("div", { className: "cms-flex cms-gap-2", children: enabled ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", loading: busy, disabled: !password, onClick: regenerate, children: t("account.newBackupCodes") }), _jsx(Button, { variant: "danger", loading: busy, disabled: !password, onClick: disable, children: t("account.turnOff") })] })) : (_jsx(Button, { loading: busy, disabled: !password, onClick: start, children: t("account.setUp") })) })] }))] }));
78
+ }
79
+ function Passkeys() {
80
+ const { t } = useT();
81
+ const [keys, setKeys] = useState([]);
82
+ const [tick, setTick] = useState(0);
83
+ const [name, setName] = useState("");
84
+ const { busy, error, run } = useAction();
85
+ useEffect(() => {
86
+ let active = true;
87
+ authClient.passkey.listUserPasskeys().then((result) => { if (active)
88
+ setKeys(result.data ?? []); });
89
+ return () => { active = false; };
90
+ }, [tick]);
91
+ const refresh = () => setTick((t) => t + 1);
92
+ return (_jsxs(Card, { title: t("account.passkeys"), description: t("account.passkeysHint"), children: [error && _jsx(Alert, { children: error }), _jsx("ul", { className: "cms-divide", children: keys.map((key) => (_jsxs("li", { className: "cms-row cms-between cms-py-2 cms-text-sm cms-body", children: [_jsx("span", { children: key.name || t("account.unnamedPasskey") }), _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await unwrap(authClient.passkey.deletePasskey({ id: key.id })); refresh(); }), children: t("account.remove") })] }, key.id))) }), _jsxs("div", { className: "cms-flex cms-gap-2", children: [_jsx(Input, { placeholder: t("account.passkeyName"), value: name, onChange: (e) => setName(e.target.value) }), _jsx(Button, { loading: busy, className: "cms-no-shrink", onClick: () => run(async () => { await unwrap(authClient.passkey.addPasskey({ name })); setName(""); refresh(); }), children: t("account.addPasskey") })] })] }));
93
+ }
94
+ function Sessions() {
95
+ const { t, locale } = useT();
96
+ const [sessions, setSessions] = useState([]);
97
+ const [tick, setTick] = useState(0);
98
+ const { busy, error, run } = useAction();
99
+ useEffect(() => {
100
+ let active = true;
101
+ authClient.listSessions().then((result) => { if (active)
102
+ setSessions(result.data ?? []); });
103
+ return () => { active = false; };
104
+ }, [tick]);
105
+ const refresh = () => setTick((t) => t + 1);
106
+ return (_jsxs(Card, { title: t("account.devices"), actions: _jsx(Button, { variant: "secondary", loading: busy, onClick: () => run(async () => { await unwrap(authClient.revokeOtherSessions()); refresh(); }), children: t("account.signOutOthers") }), children: [error && _jsx(Alert, { children: error }), _jsx("ul", { className: "cms-divide", children: sessions.map((session) => (_jsxs("li", { className: "cms-row cms-between cms-gap-3 cms-py-2 cms-text-sm", children: [_jsxs("span", { className: "cms-min-0", children: [_jsx("span", { className: "cms-block cms-truncate cms-strong", children: session.userAgent ?? t("account.unknownDevice") }), _jsxs("span", { className: "cms-hint", children: [session.ipAddress ?? t("account.unknownIp"), " \u00B7 ", new Date(session.createdAt).toLocaleString(locale)] })] }), _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await unwrap(authClient.revokeSession({ token: session.token })); refresh(); }), children: t("account.signOut") })] }, session.id))) })] }));
107
+ }
108
+ function ApiKeys({ permissions }) {
109
+ const { t, locale } = useT();
110
+ const canCreate = permissions.includes("api-key:create");
111
+ const canRevoke = permissions.includes("api-key:revoke");
112
+ const list = useApi(apiPath("/account/api-keys"));
113
+ const [open, setOpen] = useState(false);
114
+ const [name, setName] = useState("");
115
+ const [days, setDays] = useState(90);
116
+ const [selected, setSelected] = useState([]);
117
+ const [created, setCreated] = useState(null);
118
+ const { busy, error, run } = useAction();
119
+ const grantable = permissions.filter((p) => p.startsWith("record:") || p.startsWith("collection:read") || p.startsWith("ext."));
120
+ const create = async () => {
121
+ const ok = await run(async () => {
122
+ const result = await api(apiPath("/account/api-keys"), { method: "POST", body: { name, permissions: selected, expiresInDays: days } });
123
+ setCreated(result.key);
124
+ });
125
+ if (ok) {
126
+ setOpen(false);
127
+ setName("");
128
+ setSelected([]);
129
+ list.reload();
130
+ }
131
+ };
132
+ return (_jsxs(Card, { title: t("account.apiKeys"), description: t("account.apiKeysHint"), actions: canCreate ? _jsx(Button, { onClick: () => setOpen(true), children: t("account.newKey") }) : undefined, children: [list.error && _jsx(Alert, { children: list.error }), error && !open && _jsx(Alert, { children: error }), created && _jsxs(Alert, { kind: "warning", children: [t("account.copyKey"), "\n", _jsx("code", { className: "cms-break-all", children: created })] }), _jsx("ul", { className: "cms-divide", children: list.data?.map((key) => (_jsxs("li", { className: "cms-row cms-between cms-gap-3 cms-py-2 cms-text-sm", children: [_jsxs("span", { children: [_jsxs("span", { className: "cms-block cms-strong", children: [key.name, " ", _jsxs("code", { className: "cms-hint", children: [key.start, "\u2026"] })] }), _jsxs("span", { className: "cms-hint", children: [key.expiresAt ? t("account.expires", { date: new Date(key.expiresAt).toLocaleDateString(locale) }) : t("account.noExpiry"), " \u00B7 ", t("account.permissionCount", { count: key.permissions.length })] })] }), canRevoke && _jsx(Button, { variant: "secondary", onClick: () => run(async () => { await api(apiPath(`/account/api-keys/${key.id}`), { method: "DELETE" }); list.reload(); }), children: t("account.revoke") })] }, key.id))) }), _jsx(Modal, { open: open, onClose: () => setOpen(false), title: t("account.newApiKey"), children: _jsxs("div", { className: "cms-stack-4", children: [error && _jsx(Alert, { children: error }), _jsx(Field, { label: t("account.name"), children: _jsx(Input, { value: name, onChange: (e) => setName(e.target.value) }) }), _jsx(Field, { label: t("account.expiresInDays"), children: _jsx(Input, { type: "number", min: 1, value: days, onChange: (e) => setDays(Number(e.target.value)) }) }), _jsxs("fieldset", { className: "cms-scroll-48 cms-stack-1", children: [_jsx("legend", { className: "cms-label cms-mb-1", children: t("account.permissions") }), grantable.map((permission) => (_jsxs("label", { className: "cms-check-label", children: [_jsx("input", { type: "checkbox", checked: selected.includes(permission), onChange: (e) => setSelected(e.target.checked ? [...selected, permission] : selected.filter((p) => p !== permission)) }), permission] }, permission)))] }), _jsxs("div", { className: "cms-flex cms-end cms-gap-2", children: [_jsx(Button, { variant: "secondary", onClick: () => setOpen(false), children: t("account.cancel") }), _jsx(Button, { loading: busy, disabled: !name || selected.length === 0, onClick: create, children: t("account.create") })] })] }) })] }));
133
+ }
134
+ /** `children` are plugins' account panels, after the person's own details. */
135
+ export default function AccountClient({ initialName, email, twoFactorEnabled, permissions, denied, enrollMfa, customFields, interfaceLocale, children }) {
136
+ const { t } = useT();
137
+ return (_jsxs("div", { className: "cms-gutter cms-stack-6", children: [_jsx(PageHeader, { title: t("account.yourAccount") }), denied && _jsx(Alert, { kind: "warning", children: t("account.denied") }), enrollMfa && _jsx(Alert, { kind: "warning", children: t("account.enrollMfa") }), _jsx(Profile, { initialName: initialName, email: email }), children, _jsx(InterfaceLanguage, { initial: interfaceLocale }), _jsx(UserFieldsForm, { fields: customFields, url: apiPath("/account/fields"), method: "PATCH", own: true }), _jsx(Password, {}), _jsx(TwoFactor, { enabled: twoFactorEnabled }), _jsx(Passkeys, {}), _jsx(Sessions, {}), permissions.includes("api-key:list") && _jsx(ApiKeys, { permissions: permissions })] }));
138
+ }
@@ -0,0 +1,4 @@
1
+ import type { ReactNode } from "react";
2
+ export default function AccountLayout({ children }: {
3
+ children: ReactNode;
4
+ }): Promise<import("react").JSX.Element>;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { loadAdminBranding } from "../../core/auth/branding";
3
+ import { AppShell } from "../../components/shell/AppShell";
4
+ import { requireScopedUser } from "../../core/authz/page";
5
+ import { accountPath, adminPath } from "../../lib/paths";
6
+ import { AdminI18nProvider } from "../../components/i18n";
7
+ import { adminDirection, adminLocale, adminMessages } from "../../core/i18n/admin";
8
+ import { formatters } from "../../core/i18n/messages";
9
+ export default async function AccountLayout({ children }) {
10
+ // In the scope value the dashboard would open in, so someone whose dashboard access comes from a scoped role gets the link too.
11
+ const principal = await requireScopedUser();
12
+ const locale = await adminLocale(principal.user.id);
13
+ const messages = adminMessages(locale);
14
+ const { t } = formatters(locale, messages);
15
+ const nav = [
16
+ ...(principal.permissions.has("dashboard:access") ? [{ name: t("nav.Dashboard"), href: adminPath(), icon: "home" }] : []),
17
+ { name: t("nav.Account"), href: accountPath(), icon: "account" },
18
+ ];
19
+ const { appName, logoUrl } = await loadAdminBranding();
20
+ const direction = adminDirection(locale);
21
+ return (_jsx(AdminI18nProvider, { locale: locale, direction: direction, messages: messages, children: _jsx("div", { lang: locale, dir: direction, className: "cms-contents", children: _jsx(AppShell, { appName: appName, logoUrl: logoUrl, nav: nav, email: principal.user.email, impersonating: Boolean(principal.session.impersonatedBy), children: children }) }) }));
22
+ }
@@ -0,0 +1,6 @@
1
+ export default function AccountPage({ searchParams }: {
2
+ searchParams: Promise<{
3
+ denied?: string;
4
+ enroll?: string;
5
+ }>;
6
+ }): Promise<import("react").JSX.Element>;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { userFieldValues } from "../../core/auth/user-fields";
3
+ import { requireUser } from "../../core/authz/page";
4
+ import { adminConfigIfProvided } from "../../core/config";
5
+ import { PluginBoundary } from "../../components/PluginBoundary";
6
+ import { plain } from "../../core/http/plain";
7
+ import AccountClient from "./account-client";
8
+ import { chosenAdminLocale } from "../../core/i18n/admin";
9
+ export default async function AccountPage({ searchParams }) {
10
+ const principal = await requireUser();
11
+ const { denied, enroll } = await searchParams;
12
+ const user = { id: principal.user.id, email: principal.user.email, permissions: [...principal.permissions] };
13
+ const panels = (adminConfigIfProvided()?.plugins ?? []).flatMap((plugin) => (plugin.accountPanels ?? []).map((panel) => ({ ...panel, plugin: plugin.name })));
14
+ return (_jsx(AccountClient, { initialName: principal.user.name, email: principal.user.email, twoFactorEnabled: principal.user.twoFactorEnabled, permissions: [...principal.permissions], customFields: plain(await userFieldValues(principal.user.id, { includeHidden: false })), denied: denied === "1", enrollMfa: enroll === "mfa", interfaceLocale: await chosenAdminLocale(principal.user.id), children: panels.map(({ plugin, id, component: Panel }) => _jsx(PluginBoundary, { plugin: plugin, children: _jsx(Panel, { user: user }) }, `${plugin}:${id}`)) }));
15
+ }
@@ -0,0 +1 @@
1
+ export declare const DELETE: import("../../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,8 @@
1
+ import { headers } from "next/headers";
2
+ import { route } from "../../../../../core/authz/guard";
3
+ export const DELETE = route({ access: "permission", permission: "api-key:revoke", audit: "api_key.revoke" }, async ({ params, runtime, auditTarget }) => {
4
+ auditTarget("api_key", params.id);
5
+ // better-auth scopes this to the session's own keys.
6
+ await runtime.auth.api.deleteApiKey({ headers: await headers(), body: { keyId: params.id } });
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,52 @@
1
+ import { headers } from "next/headers";
2
+ import { z } from "zod";
3
+ import { route } from "../../../../core/authz/guard";
4
+ import { fromStatements, isKnownPermission, toStatements } from "../../../../core/authz/permissions";
5
+ import { isSubset } from "../../../../core/authz/roles";
6
+ import { HttpError } from "../../../../core/http/errors";
7
+ const assertEnabled = (enabled) => {
8
+ if (!enabled)
9
+ throw new HttpError(403, "API_KEYS_DISABLED", "API keys are disabled.");
10
+ };
11
+ export const GET = route({ access: "permission", permission: "api-key:list" }, async ({ runtime }) => {
12
+ const result = await runtime.auth.api.listApiKeys({ headers: await headers() });
13
+ return result.apiKeys.map((key) => ({
14
+ id: key.id,
15
+ name: key.name,
16
+ start: key.start,
17
+ createdAt: key.createdAt,
18
+ expiresAt: key.expiresAt,
19
+ lastRequest: key.lastRequest,
20
+ permissions: [...fromStatements(key.permissions)],
21
+ scope: boundScope(key.metadata),
22
+ }));
23
+ });
24
+ const body = z.object({
25
+ name: z.string().trim().min(1).max(80),
26
+ permissions: z.array(z.string()).min(1).max(200),
27
+ expiresInDays: z.number().int().min(1).max(3650),
28
+ /** Binds the key to this request's row scope value, such as a tenant: it works there and nowhere else. */
29
+ scope: z.boolean().optional(),
30
+ });
31
+ const boundScope = (metadata) => {
32
+ const scope = metadata?.scope;
33
+ return typeof scope === "string" ? scope : null;
34
+ };
35
+ export const POST = route({ access: "permission", permission: "api-key:create", body, audit: "api_key.create", fresh: true }, async ({ body, principal, runtime, auditTarget }) => {
36
+ assertEnabled(runtime.settings.apiKeys.enabled);
37
+ if (body.expiresInDays > runtime.settings.apiKeys.maxLifetimeDays) {
38
+ throw new HttpError(400, "KEY_LIFETIME", `Keys can last at most ${runtime.settings.apiKeys.maxLifetimeDays} days.`);
39
+ }
40
+ if (!body.permissions.every(isKnownPermission) || !isSubset(body.permissions, principal.permissions)) {
41
+ throw new HttpError(403, "KEY_EXCEEDS_ACTOR", "A key cannot have permissions you do not hold.");
42
+ }
43
+ // Permissions held only within a scope value count only for a key bound to it.
44
+ const scope = body.scope ? principal.scope ?? null : null;
45
+ if (body.scope && scope === null)
46
+ throw new HttpError(400, "SCOPE_REQUIRED", "Choose where the key is for before binding it.");
47
+ const created = await runtime.auth.api.createApiKey({
48
+ body: { userId: principal.user.id, name: body.name, expiresIn: body.expiresInDays * 86_400, permissions: toStatements(body.permissions), ...(scope ? { metadata: { scope } } : {}) },
49
+ });
50
+ auditTarget("api_key", created.id, { name: body.name, permissions: body.permissions, ...(scope ? { scope } : {}) });
51
+ return { id: created.id, key: created.key, name: created.name };
52
+ });
@@ -0,0 +1 @@
1
+ export declare const PATCH: import("../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,13 @@
1
+ import { z } from "zod";
2
+ import { setOwnValues, userFieldValues } from "../../../../core/auth/user-fields";
3
+ import { route } from "../../../../core/authz/guard";
4
+ import { isSharedAccount, SHARED_ACCOUNT_MESSAGE } from "../../../../core/auth/shared-accounts";
5
+ import { HttpError } from "../../../../core/http/errors";
6
+ const body = z.object({ values: z.record(z.string(), z.unknown()) });
7
+ export const PATCH = route({ access: "authenticated", body, audit: "account.update_fields", maxBodyBytes: 64 * 1024 }, async ({ body, principal, auditTarget }) => {
8
+ if (isSharedAccount(principal.user.email))
9
+ throw new HttpError(403, "SHARED_ACCOUNT", SHARED_ACCOUNT_MESSAGE);
10
+ auditTarget("user", principal.user.id, { fields: Object.keys(body.values).slice(0, 100) });
11
+ await setOwnValues(principal.user.id, body.values);
12
+ return userFieldValues(principal.user.id, { includeHidden: false });
13
+ });
@@ -0,0 +1,2 @@
1
+ /** The person's dashboard and email language. Null follows their browser. */
2
+ export declare const PUT: import("../../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../../core/authz/guard";
3
+ import { HttpError } from "../../../../core/http/errors";
4
+ import { isSharedAccount } from "../../../../core/auth/shared-accounts";
5
+ import { ADMIN_LOCALE_COOKIE, saveAdminLocale, supportedAdminLocale } from "../../../../core/i18n/admin";
6
+ const body = z.object({ locale: z.string().max(35).nullable() });
7
+ /** The person's dashboard and email language. Null follows their browser. */
8
+ export const PUT = route({ access: "authenticated", body, audit: "account.update_locale" }, async ({ body, principal, request, auditTarget }) => {
9
+ if (principal.kind !== "user")
10
+ throw new HttpError(403, "FORBIDDEN", "Only a signed-in person has an interface language.");
11
+ const locale = body.locale === null ? null : supportedAdminLocale(body.locale);
12
+ if (body.locale !== null && !locale)
13
+ throw new HttpError(400, "INVALID_LOCALE", "The dashboard isn't available in that language.");
14
+ // A shared account's visitors each keep their own language, in their browser's cookie only.
15
+ if (!isSharedAccount(principal.user.email))
16
+ await saveAdminLocale(principal.user.id, locale);
17
+ auditTarget("user", principal.user.id, { locale });
18
+ // Pages outside the dashboard, such as sign-in, read the cookie rather than the profile.
19
+ const secure = request.nextUrl.protocol === "https:" ? "; Secure" : "";
20
+ const cookie = locale ? `${ADMIN_LOCALE_COOKIE}=${locale}; Path=/; Max-Age=31536000; SameSite=Lax; HttpOnly${secure}` : `${ADMIN_LOCALE_COOKIE}=; Path=/; Max-Age=0; SameSite=Lax; HttpOnly${secure}`;
21
+ return new Response(JSON.stringify({ locale }), { headers: { "content-type": "application/json", "cache-control": "no-store", "set-cookie": cookie } });
22
+ });
@@ -0,0 +1 @@
1
+ export declare const GET: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ import { route } from "../../../core/authz/guard";
3
+ import { listAudit } from "../../../core/audit/query";
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(50),
7
+ action: z.string().trim().max(100).optional(),
8
+ actor: z.string().trim().max(320).optional(),
9
+ outcome: z.enum(["success", "failure", "denied"]).optional(),
10
+ });
11
+ export const GET = route({ access: "permission", permission: "audit:read", query }, async ({ query }) => listAudit(query));
@@ -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,3 @@
1
+ import { authEndpoint } from "../../../../core/authz/guard";
2
+ export const GET = authEndpoint();
3
+ export const POST = authEndpoint();
@@ -0,0 +1 @@
1
+ export declare const GET: import("../../../core/authz/guard").GuardedHandler;
@@ -0,0 +1,4 @@
1
+ import { route } from "../../../core/authz/guard";
2
+ import { publicAuthConfig } from "../../../core/auth/public-config";
3
+ // PocketBase's listAuthMethods: lets sign-in screens show only what is enabled.
4
+ export const GET = route({ access: "public", reason: "Sign-in screens need the enabled methods before authentication" }, async ({ runtime: { settings } }) => publicAuthConfig(settings));
@@ -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
+ });