@forumone/throughline 0.0.0 → 1.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (918) hide show
  1. package/CHANGELOG.md +601 -0
  2. package/LICENSE +21 -0
  3. package/README.md +352 -0
  4. package/bin/payload-cli.mjs +443 -0
  5. package/bin/throughline-payload.mjs +6 -0
  6. package/dist/access/coreCollections.d.ts +18 -0
  7. package/dist/access/coreCollections.d.ts.map +1 -0
  8. package/dist/access/coreCollections.js +56 -0
  9. package/dist/access/coreCollections.js.map +1 -0
  10. package/dist/approvals/collection.d.ts +21 -0
  11. package/dist/approvals/collection.d.ts.map +1 -0
  12. package/dist/approvals/collection.js +99 -0
  13. package/dist/approvals/collection.js.map +1 -0
  14. package/dist/approvals/endpoints/action.d.ts +31 -0
  15. package/dist/approvals/endpoints/action.d.ts.map +1 -0
  16. package/dist/approvals/endpoints/action.js +205 -0
  17. package/dist/approvals/endpoints/action.js.map +1 -0
  18. package/dist/approvals/index.d.ts +19 -0
  19. package/dist/approvals/index.d.ts.map +1 -0
  20. package/dist/approvals/index.js +13 -0
  21. package/dist/approvals/index.js.map +1 -0
  22. package/dist/approvals/jobs/expire-stale-approvals.d.ts +14 -0
  23. package/dist/approvals/jobs/expire-stale-approvals.d.ts.map +1 -0
  24. package/dist/approvals/jobs/expire-stale-approvals.js +101 -0
  25. package/dist/approvals/jobs/expire-stale-approvals.js.map +1 -0
  26. package/dist/approvals/options.d.ts +76 -0
  27. package/dist/approvals/options.d.ts.map +1 -0
  28. package/dist/approvals/options.js +47 -0
  29. package/dist/approvals/options.js.map +1 -0
  30. package/dist/approvals/plugin.d.ts +4 -0
  31. package/dist/approvals/plugin.d.ts.map +1 -0
  32. package/dist/approvals/plugin.js +92 -0
  33. package/dist/approvals/plugin.js.map +1 -0
  34. package/dist/approvals/resolver.d.ts +18 -0
  35. package/dist/approvals/resolver.d.ts.map +1 -0
  36. package/dist/approvals/resolver.js +57 -0
  37. package/dist/approvals/resolver.js.map +1 -0
  38. package/dist/approvals/symbol.d.ts +12 -0
  39. package/dist/approvals/symbol.d.ts.map +1 -0
  40. package/dist/approvals/symbol.js +12 -0
  41. package/dist/approvals/symbol.js.map +1 -0
  42. package/dist/approvals/tokens.d.ts +48 -0
  43. package/dist/approvals/tokens.d.ts.map +1 -0
  44. package/dist/approvals/tokens.js +123 -0
  45. package/dist/approvals/tokens.js.map +1 -0
  46. package/dist/approvals/tools/descriptors.d.ts +26 -0
  47. package/dist/approvals/tools/descriptors.d.ts.map +1 -0
  48. package/dist/approvals/tools/descriptors.js +35 -0
  49. package/dist/approvals/tools/descriptors.js.map +1 -0
  50. package/dist/approvals/tools/get-approval-status.d.ts +11 -0
  51. package/dist/approvals/tools/get-approval-status.d.ts.map +1 -0
  52. package/dist/approvals/tools/get-approval-status.js +94 -0
  53. package/dist/approvals/tools/get-approval-status.js.map +1 -0
  54. package/dist/approvals/tools/index.d.ts +7 -0
  55. package/dist/approvals/tools/index.d.ts.map +1 -0
  56. package/dist/approvals/tools/index.js +7 -0
  57. package/dist/approvals/tools/index.js.map +1 -0
  58. package/dist/approvals/tools/list-my-requests.d.ts +11 -0
  59. package/dist/approvals/tools/list-my-requests.d.ts.map +1 -0
  60. package/dist/approvals/tools/list-my-requests.js +55 -0
  61. package/dist/approvals/tools/list-my-requests.js.map +1 -0
  62. package/dist/approvals/tools/list-pending-approvals.d.ts +11 -0
  63. package/dist/approvals/tools/list-pending-approvals.d.ts.map +1 -0
  64. package/dist/approvals/tools/list-pending-approvals.js +53 -0
  65. package/dist/approvals/tools/list-pending-approvals.js.map +1 -0
  66. package/dist/approvals/tools/request-approval.d.ts +13 -0
  67. package/dist/approvals/tools/request-approval.d.ts.map +1 -0
  68. package/dist/approvals/tools/request-approval.js +123 -0
  69. package/dist/approvals/tools/request-approval.js.map +1 -0
  70. package/dist/approvals/tools/respond-to-approval.d.ts +13 -0
  71. package/dist/approvals/tools/respond-to-approval.d.ts.map +1 -0
  72. package/dist/approvals/tools/respond-to-approval.js +98 -0
  73. package/dist/approvals/tools/respond-to-approval.js.map +1 -0
  74. package/dist/audit/collection.d.ts +22 -0
  75. package/dist/audit/collection.d.ts.map +1 -0
  76. package/dist/audit/collection.js +109 -0
  77. package/dist/audit/collection.js.map +1 -0
  78. package/dist/audit/index.d.ts +16 -0
  79. package/dist/audit/index.d.ts.map +1 -0
  80. package/dist/audit/index.js +11 -0
  81. package/dist/audit/index.js.map +1 -0
  82. package/dist/audit/jobs/audit-event-echo.d.ts +14 -0
  83. package/dist/audit/jobs/audit-event-echo.d.ts.map +1 -0
  84. package/dist/audit/jobs/audit-event-echo.js +61 -0
  85. package/dist/audit/jobs/audit-event-echo.js.map +1 -0
  86. package/dist/audit/plugin.d.ts +20 -0
  87. package/dist/audit/plugin.d.ts.map +1 -0
  88. package/dist/audit/plugin.js +55 -0
  89. package/dist/audit/plugin.js.map +1 -0
  90. package/dist/audit/query/formatting/index.d.ts +40 -0
  91. package/dist/audit/query/formatting/index.d.ts.map +1 -0
  92. package/dist/audit/query/formatting/index.js +73 -0
  93. package/dist/audit/query/formatting/index.js.map +1 -0
  94. package/dist/audit/query/options.d.ts +34 -0
  95. package/dist/audit/query/options.d.ts.map +1 -0
  96. package/dist/audit/query/options.js +8 -0
  97. package/dist/audit/query/options.js.map +1 -0
  98. package/dist/audit/query/plugin.d.ts +11 -0
  99. package/dist/audit/query/plugin.d.ts.map +1 -0
  100. package/dist/audit/query/plugin.js +68 -0
  101. package/dist/audit/query/plugin.js.map +1 -0
  102. package/dist/audit/query/tools/access.d.ts +9 -0
  103. package/dist/audit/query/tools/access.d.ts.map +1 -0
  104. package/dist/audit/query/tools/access.js +14 -0
  105. package/dist/audit/query/tools/access.js.map +1 -0
  106. package/dist/audit/query/tools/descriptors.d.ts +26 -0
  107. package/dist/audit/query/tools/descriptors.d.ts.map +1 -0
  108. package/dist/audit/query/tools/descriptors.js +35 -0
  109. package/dist/audit/query/tools/descriptors.js.map +1 -0
  110. package/dist/audit/query/tools/get-change-history.d.ts +23 -0
  111. package/dist/audit/query/tools/get-change-history.d.ts.map +1 -0
  112. package/dist/audit/query/tools/get-change-history.js +44 -0
  113. package/dist/audit/query/tools/get-change-history.js.map +1 -0
  114. package/dist/audit/query/tools/get-recent-failures.d.ts +23 -0
  115. package/dist/audit/query/tools/get-recent-failures.d.ts.map +1 -0
  116. package/dist/audit/query/tools/get-recent-failures.js +56 -0
  117. package/dist/audit/query/tools/get-recent-failures.js.map +1 -0
  118. package/dist/audit/query/tools/index.d.ts +13 -0
  119. package/dist/audit/query/tools/index.d.ts.map +1 -0
  120. package/dist/audit/query/tools/index.js +8 -0
  121. package/dist/audit/query/tools/index.js.map +1 -0
  122. package/dist/audit/query/tools/query-audit.d.ts +53 -0
  123. package/dist/audit/query/tools/query-audit.d.ts.map +1 -0
  124. package/dist/audit/query/tools/query-audit.js +78 -0
  125. package/dist/audit/query/tools/query-audit.js.map +1 -0
  126. package/dist/audit/query/tools/what-changed-in-range.d.ts +23 -0
  127. package/dist/audit/query/tools/what-changed-in-range.d.ts.map +1 -0
  128. package/dist/audit/query/tools/what-changed-in-range.js +86 -0
  129. package/dist/audit/query/tools/what-changed-in-range.js.map +1 -0
  130. package/dist/audit/query/tools/who-changed-what.d.ts +38 -0
  131. package/dist/audit/query/tools/who-changed-what.d.ts.map +1 -0
  132. package/dist/audit/query/tools/who-changed-what.js +66 -0
  133. package/dist/audit/query/tools/who-changed-what.js.map +1 -0
  134. package/dist/audit/types.d.ts +11 -0
  135. package/dist/audit/types.d.ts.map +1 -0
  136. package/dist/audit/types.js +45 -0
  137. package/dist/audit/types.js.map +1 -0
  138. package/dist/audit/writer.d.ts +50 -0
  139. package/dist/audit/writer.d.ts.map +1 -0
  140. package/dist/audit/writer.js +101 -0
  141. package/dist/audit/writer.js.map +1 -0
  142. package/dist/cache-tags.d.ts +31 -0
  143. package/dist/cache-tags.d.ts.map +1 -0
  144. package/dist/cache-tags.js +53 -0
  145. package/dist/cache-tags.js.map +1 -0
  146. package/dist/components/index.d.ts +8 -0
  147. package/dist/components/index.d.ts.map +1 -0
  148. package/dist/components/index.js +7 -0
  149. package/dist/components/index.js.map +1 -0
  150. package/dist/components/manifest-source.d.ts +17 -0
  151. package/dist/components/manifest-source.d.ts.map +1 -0
  152. package/dist/components/manifest-source.js +60 -0
  153. package/dist/components/manifest-source.js.map +1 -0
  154. package/dist/components/matching/index.d.ts +3 -0
  155. package/dist/components/matching/index.d.ts.map +1 -0
  156. package/dist/components/matching/index.js +2 -0
  157. package/dist/components/matching/index.js.map +1 -0
  158. package/dist/components/matching/tfidf.d.ts +13 -0
  159. package/dist/components/matching/tfidf.d.ts.map +1 -0
  160. package/dist/components/matching/tfidf.js +118 -0
  161. package/dist/components/matching/tfidf.js.map +1 -0
  162. package/dist/components/matching/types.d.ts +22 -0
  163. package/dist/components/matching/types.d.ts.map +1 -0
  164. package/dist/components/matching/types.js +2 -0
  165. package/dist/components/matching/types.js.map +1 -0
  166. package/dist/components/options.d.ts +136 -0
  167. package/dist/components/options.d.ts.map +1 -0
  168. package/dist/components/options.js +40 -0
  169. package/dist/components/options.js.map +1 -0
  170. package/dist/components/plugin.d.ts +4 -0
  171. package/dist/components/plugin.d.ts.map +1 -0
  172. package/dist/components/plugin.js +95 -0
  173. package/dist/components/plugin.js.map +1 -0
  174. package/dist/components/tools/descriptors.d.ts +34 -0
  175. package/dist/components/tools/descriptors.d.ts.map +1 -0
  176. package/dist/components/tools/descriptors.js +43 -0
  177. package/dist/components/tools/descriptors.js.map +1 -0
  178. package/dist/components/tools/find-anti-pattern.d.ts +9 -0
  179. package/dist/components/tools/find-anti-pattern.d.ts.map +1 -0
  180. package/dist/components/tools/find-anti-pattern.js +31 -0
  181. package/dist/components/tools/find-anti-pattern.js.map +1 -0
  182. package/dist/components/tools/get-contract.d.ts +4 -0
  183. package/dist/components/tools/get-contract.d.ts.map +1 -0
  184. package/dist/components/tools/get-contract.js +19 -0
  185. package/dist/components/tools/get-contract.js.map +1 -0
  186. package/dist/components/tools/get-tokens.d.ts +4 -0
  187. package/dist/components/tools/get-tokens.d.ts.map +1 -0
  188. package/dist/components/tools/get-tokens.js +19 -0
  189. package/dist/components/tools/get-tokens.js.map +1 -0
  190. package/dist/components/tools/get-variants.d.ts +4 -0
  191. package/dist/components/tools/get-variants.d.ts.map +1 -0
  192. package/dist/components/tools/get-variants.js +19 -0
  193. package/dist/components/tools/get-variants.js.map +1 -0
  194. package/dist/components/tools/index.d.ts +9 -0
  195. package/dist/components/tools/index.d.ts.map +1 -0
  196. package/dist/components/tools/index.js +9 -0
  197. package/dist/components/tools/index.js.map +1 -0
  198. package/dist/components/tools/list-components.d.ts +4 -0
  199. package/dist/components/tools/list-components.d.ts.map +1 -0
  200. package/dist/components/tools/list-components.js +25 -0
  201. package/dist/components/tools/list-components.js.map +1 -0
  202. package/dist/components/tools/suggest-for-intent.d.ts +12 -0
  203. package/dist/components/tools/suggest-for-intent.d.ts.map +1 -0
  204. package/dist/components/tools/suggest-for-intent.js +83 -0
  205. package/dist/components/tools/suggest-for-intent.js.map +1 -0
  206. package/dist/components/tools/validate-composition.d.ts +9 -0
  207. package/dist/components/tools/validate-composition.d.ts.map +1 -0
  208. package/dist/components/tools/validate-composition.js +31 -0
  209. package/dist/components/tools/validate-composition.js.map +1 -0
  210. package/dist/components/validation/composition.d.ts +38 -0
  211. package/dist/components/validation/composition.d.ts.map +1 -0
  212. package/dist/components/validation/composition.js +135 -0
  213. package/dist/components/validation/composition.js.map +1 -0
  214. package/dist/editorial/calendar/ContentCalendarReport.d.ts +9 -0
  215. package/dist/editorial/calendar/ContentCalendarReport.d.ts.map +1 -0
  216. package/dist/editorial/calendar/ContentCalendarReport.js +47 -0
  217. package/dist/editorial/calendar/ContentCalendarReport.js.map +1 -0
  218. package/dist/editorial/calendar/ContentCalendarView.d.ts +3 -0
  219. package/dist/editorial/calendar/ContentCalendarView.d.ts.map +1 -0
  220. package/dist/editorial/calendar/ContentCalendarView.js +36 -0
  221. package/dist/editorial/calendar/ContentCalendarView.js.map +1 -0
  222. package/dist/editorial/calendar/calendar.d.ts +30 -0
  223. package/dist/editorial/calendar/calendar.d.ts.map +1 -0
  224. package/dist/editorial/calendar/calendar.js +23 -0
  225. package/dist/editorial/calendar/calendar.js.map +1 -0
  226. package/dist/editorial/calendar/find.d.ts +41 -0
  227. package/dist/editorial/calendar/find.d.ts.map +1 -0
  228. package/dist/editorial/calendar/find.js +108 -0
  229. package/dist/editorial/calendar/find.js.map +1 -0
  230. package/dist/editorial/calendar/month.d.ts +45 -0
  231. package/dist/editorial/calendar/month.d.ts.map +1 -0
  232. package/dist/editorial/calendar/month.js +120 -0
  233. package/dist/editorial/calendar/month.js.map +1 -0
  234. package/dist/editorial/calendar/tool.d.ts +50 -0
  235. package/dist/editorial/calendar/tool.d.ts.map +1 -0
  236. package/dist/editorial/calendar/tool.js +68 -0
  237. package/dist/editorial/calendar/tool.js.map +1 -0
  238. package/dist/editorial/config.d.ts +25 -0
  239. package/dist/editorial/config.d.ts.map +1 -0
  240. package/dist/editorial/config.js +12 -0
  241. package/dist/editorial/config.js.map +1 -0
  242. package/dist/editorial/health/ContentHealthReport.d.ts +7 -0
  243. package/dist/editorial/health/ContentHealthReport.d.ts.map +1 -0
  244. package/dist/editorial/health/ContentHealthReport.js +29 -0
  245. package/dist/editorial/health/ContentHealthReport.js.map +1 -0
  246. package/dist/editorial/health/ContentHealthView.d.ts +3 -0
  247. package/dist/editorial/health/ContentHealthView.d.ts.map +1 -0
  248. package/dist/editorial/health/ContentHealthView.js +29 -0
  249. package/dist/editorial/health/ContentHealthView.js.map +1 -0
  250. package/dist/editorial/health/HealthSummary.d.ts +6 -0
  251. package/dist/editorial/health/HealthSummary.d.ts.map +1 -0
  252. package/dist/editorial/health/HealthSummary.js +39 -0
  253. package/dist/editorial/health/HealthSummary.js.map +1 -0
  254. package/dist/editorial/health/checks.d.ts +104 -0
  255. package/dist/editorial/health/checks.d.ts.map +1 -0
  256. package/dist/editorial/health/checks.js +188 -0
  257. package/dist/editorial/health/checks.js.map +1 -0
  258. package/dist/editorial/health/find.d.ts +43 -0
  259. package/dist/editorial/health/find.d.ts.map +1 -0
  260. package/dist/editorial/health/find.js +97 -0
  261. package/dist/editorial/health/find.js.map +1 -0
  262. package/dist/editorial/health/tool.d.ts +53 -0
  263. package/dist/editorial/health/tool.d.ts.map +1 -0
  264. package/dist/editorial/health/tool.js +80 -0
  265. package/dist/editorial/health/tool.js.map +1 -0
  266. package/dist/editorial/index.d.ts +25 -0
  267. package/dist/editorial/index.d.ts.map +1 -0
  268. package/dist/editorial/index.js +15 -0
  269. package/dist/editorial/index.js.map +1 -0
  270. package/dist/editorial/palette/CommandPalette.d.ts +15 -0
  271. package/dist/editorial/palette/CommandPalette.d.ts.map +1 -0
  272. package/dist/editorial/palette/CommandPalette.js +319 -0
  273. package/dist/editorial/palette/CommandPalette.js.map +1 -0
  274. package/dist/editorial/palette/ReportsNav.d.ts +5 -0
  275. package/dist/editorial/palette/ReportsNav.d.ts.map +1 -0
  276. package/dist/editorial/palette/ReportsNav.js +31 -0
  277. package/dist/editorial/palette/ReportsNav.js.map +1 -0
  278. package/dist/editorial/palette/search.d.ts +18 -0
  279. package/dist/editorial/palette/search.d.ts.map +1 -0
  280. package/dist/editorial/palette/search.js +41 -0
  281. package/dist/editorial/palette/search.js.map +1 -0
  282. package/dist/editorial/palette/sources.d.ts +64 -0
  283. package/dist/editorial/palette/sources.d.ts.map +1 -0
  284. package/dist/editorial/palette/sources.js +103 -0
  285. package/dist/editorial/palette/sources.js.map +1 -0
  286. package/dist/editorial/palette/styles.d.ts +2 -0
  287. package/dist/editorial/palette/styles.d.ts.map +1 -0
  288. package/dist/editorial/palette/styles.js +76 -0
  289. package/dist/editorial/palette/styles.js.map +1 -0
  290. package/dist/editorial/palette/tool.d.ts +31 -0
  291. package/dist/editorial/palette/tool.d.ts.map +1 -0
  292. package/dist/editorial/palette/tool.js +63 -0
  293. package/dist/editorial/palette/tool.js.map +1 -0
  294. package/dist/editorial/plugin.d.ts +76 -0
  295. package/dist/editorial/plugin.d.ts.map +1 -0
  296. package/dist/editorial/plugin.js +186 -0
  297. package/dist/editorial/plugin.js.map +1 -0
  298. package/dist/editorial/relativeTime.d.ts +3 -0
  299. package/dist/editorial/relativeTime.d.ts.map +1 -0
  300. package/dist/editorial/relativeTime.js +27 -0
  301. package/dist/editorial/relativeTime.js.map +1 -0
  302. package/dist/editorial/styles.d.ts +2 -0
  303. package/dist/editorial/styles.d.ts.map +1 -0
  304. package/dist/editorial/styles.js +191 -0
  305. package/dist/editorial/styles.js.map +1 -0
  306. package/dist/editorial/work/YourWork.d.ts +13 -0
  307. package/dist/editorial/work/YourWork.d.ts.map +1 -0
  308. package/dist/editorial/work/YourWork.js +40 -0
  309. package/dist/editorial/work/YourWork.js.map +1 -0
  310. package/dist/editorial/work/tool.d.ts +45 -0
  311. package/dist/editorial/work/tool.d.ts.map +1 -0
  312. package/dist/editorial/work/tool.js +54 -0
  313. package/dist/editorial/work/tool.js.map +1 -0
  314. package/dist/editorial/work/work.d.ts +31 -0
  315. package/dist/editorial/work/work.d.ts.map +1 -0
  316. package/dist/editorial/work/work.js +68 -0
  317. package/dist/editorial/work/work.js.map +1 -0
  318. package/dist/email/client.d.ts +78 -0
  319. package/dist/email/client.d.ts.map +1 -0
  320. package/dist/email/client.js +63 -0
  321. package/dist/email/client.js.map +1 -0
  322. package/dist/email/functions/_shared.d.ts +17 -0
  323. package/dist/email/functions/_shared.d.ts.map +1 -0
  324. package/dist/email/functions/_shared.js +40 -0
  325. package/dist/email/functions/_shared.js.map +1 -0
  326. package/dist/email/functions/index.d.ts +7 -0
  327. package/dist/email/functions/index.d.ts.map +1 -0
  328. package/dist/email/functions/index.js +4 -0
  329. package/dist/email/functions/index.js.map +1 -0
  330. package/dist/email/functions/notify-approval-decision.d.ts +34 -0
  331. package/dist/email/functions/notify-approval-decision.d.ts.map +1 -0
  332. package/dist/email/functions/notify-approval-decision.js +77 -0
  333. package/dist/email/functions/notify-approval-decision.js.map +1 -0
  334. package/dist/email/functions/notify-approval-expired.d.ts +32 -0
  335. package/dist/email/functions/notify-approval-expired.d.ts.map +1 -0
  336. package/dist/email/functions/notify-approval-expired.js +54 -0
  337. package/dist/email/functions/notify-approval-expired.js.map +1 -0
  338. package/dist/email/functions/notify-approval-request.d.ts +35 -0
  339. package/dist/email/functions/notify-approval-request.d.ts.map +1 -0
  340. package/dist/email/functions/notify-approval-request.js +89 -0
  341. package/dist/email/functions/notify-approval-request.js.map +1 -0
  342. package/dist/email/index.d.ts +17 -0
  343. package/dist/email/index.d.ts.map +1 -0
  344. package/dist/email/index.js +12 -0
  345. package/dist/email/index.js.map +1 -0
  346. package/dist/email/options.d.ts +100 -0
  347. package/dist/email/options.d.ts.map +1 -0
  348. package/dist/email/options.js +55 -0
  349. package/dist/email/options.js.map +1 -0
  350. package/dist/email/plugin.d.ts +28 -0
  351. package/dist/email/plugin.d.ts.map +1 -0
  352. package/dist/email/plugin.js +113 -0
  353. package/dist/email/plugin.js.map +1 -0
  354. package/dist/email/templates/ApprovalDecision.d.ts +15 -0
  355. package/dist/email/templates/ApprovalDecision.d.ts.map +1 -0
  356. package/dist/email/templates/ApprovalDecision.js +56 -0
  357. package/dist/email/templates/ApprovalDecision.js.map +1 -0
  358. package/dist/email/templates/ApprovalExpired.d.ts +10 -0
  359. package/dist/email/templates/ApprovalExpired.d.ts.map +1 -0
  360. package/dist/email/templates/ApprovalExpired.js +8 -0
  361. package/dist/email/templates/ApprovalExpired.js.map +1 -0
  362. package/dist/email/templates/ApprovalRequest.d.ts +24 -0
  363. package/dist/email/templates/ApprovalRequest.d.ts.map +1 -0
  364. package/dist/email/templates/ApprovalRequest.js +58 -0
  365. package/dist/email/templates/ApprovalRequest.js.map +1 -0
  366. package/dist/email/templates/_layout.d.ts +17 -0
  367. package/dist/email/templates/_layout.d.ts.map +1 -0
  368. package/dist/email/templates/_layout.js +39 -0
  369. package/dist/email/templates/_layout.js.map +1 -0
  370. package/dist/email/templates/index.d.ts +9 -0
  371. package/dist/email/templates/index.d.ts.map +1 -0
  372. package/dist/email/templates/index.js +5 -0
  373. package/dist/email/templates/index.js.map +1 -0
  374. package/dist/email/tokens.d.ts +39 -0
  375. package/dist/email/tokens.d.ts.map +1 -0
  376. package/dist/email/tokens.js +17 -0
  377. package/dist/email/tokens.js.map +1 -0
  378. package/dist/env/index.d.ts +54 -0
  379. package/dist/env/index.d.ts.map +1 -0
  380. package/dist/env/index.js +113 -0
  381. package/dist/env/index.js.map +1 -0
  382. package/dist/events/inngest.d.ts +24 -0
  383. package/dist/events/inngest.d.ts.map +1 -0
  384. package/dist/events/inngest.js +24 -0
  385. package/dist/events/inngest.js.map +1 -0
  386. package/dist/events/taxonomy.d.ts +84 -0
  387. package/dist/events/taxonomy.d.ts.map +1 -0
  388. package/dist/events/taxonomy.js +10 -0
  389. package/dist/events/taxonomy.js.map +1 -0
  390. package/dist/events/vercel.d.ts +47 -0
  391. package/dist/events/vercel.d.ts.map +1 -0
  392. package/dist/events/vercel.js +69 -0
  393. package/dist/events/vercel.js.map +1 -0
  394. package/dist/exports/client.d.ts +24 -0
  395. package/dist/exports/client.d.ts.map +1 -0
  396. package/dist/exports/client.js +21 -0
  397. package/dist/exports/client.js.map +1 -0
  398. package/dist/exports/rsc.d.ts +17 -0
  399. package/dist/exports/rsc.d.ts.map +1 -0
  400. package/dist/exports/rsc.js +19 -0
  401. package/dist/exports/rsc.js.map +1 -0
  402. package/dist/fields/CharacterCountField.d.ts +4 -0
  403. package/dist/fields/CharacterCountField.d.ts.map +1 -0
  404. package/dist/fields/CharacterCountField.js +94 -0
  405. package/dist/fields/CharacterCountField.js.map +1 -0
  406. package/dist/fields/characterCount.d.ts +15 -0
  407. package/dist/fields/characterCount.d.ts.map +1 -0
  408. package/dist/fields/characterCount.js +92 -0
  409. package/dist/fields/characterCount.js.map +1 -0
  410. package/dist/fields/checkSlug.d.ts +62 -0
  411. package/dist/fields/checkSlug.d.ts.map +1 -0
  412. package/dist/fields/checkSlug.js +119 -0
  413. package/dist/fields/checkSlug.js.map +1 -0
  414. package/dist/fields/index.d.ts +9 -0
  415. package/dist/fields/index.d.ts.map +1 -0
  416. package/dist/fields/index.js +9 -0
  417. package/dist/fields/index.js.map +1 -0
  418. package/dist/fields/mapFields.d.ts +13 -0
  419. package/dist/fields/mapFields.d.ts.map +1 -0
  420. package/dist/fields/mapFields.js +32 -0
  421. package/dist/fields/mapFields.js.map +1 -0
  422. package/dist/fields/publishing.d.ts +33 -0
  423. package/dist/fields/publishing.d.ts.map +1 -0
  424. package/dist/fields/publishing.js +81 -0
  425. package/dist/fields/publishing.js.map +1 -0
  426. package/dist/fields/revisedAt.d.ts +15 -0
  427. package/dist/fields/revisedAt.d.ts.map +1 -0
  428. package/dist/fields/revisedAt.js +79 -0
  429. package/dist/fields/revisedAt.js.map +1 -0
  430. package/dist/fields/slug.d.ts +21 -0
  431. package/dist/fields/slug.d.ts.map +1 -0
  432. package/dist/fields/slug.js +102 -0
  433. package/dist/fields/slug.js.map +1 -0
  434. package/dist/fields/unlisted.d.ts +13 -0
  435. package/dist/fields/unlisted.d.ts.map +1 -0
  436. package/dist/fields/unlisted.js +35 -0
  437. package/dist/fields/unlisted.js.map +1 -0
  438. package/dist/fields/usedBy.d.ts +12 -0
  439. package/dist/fields/usedBy.d.ts.map +1 -0
  440. package/dist/fields/usedBy.js +36 -0
  441. package/dist/fields/usedBy.js.map +1 -0
  442. package/dist/index.d.ts +21 -0
  443. package/dist/index.d.ts.map +1 -0
  444. package/dist/index.js +18 -0
  445. package/dist/index.js.map +1 -0
  446. package/dist/integrations/admin/SyncButton.d.ts +27 -0
  447. package/dist/integrations/admin/SyncButton.d.ts.map +1 -0
  448. package/dist/integrations/admin/SyncButton.js +134 -0
  449. package/dist/integrations/admin/SyncButton.js.map +1 -0
  450. package/dist/integrations/admin/sync-client.d.ts +83 -0
  451. package/dist/integrations/admin/sync-client.d.ts.map +1 -0
  452. package/dist/integrations/admin/sync-client.js +121 -0
  453. package/dist/integrations/admin/sync-client.js.map +1 -0
  454. package/dist/integrations/collection.d.ts +26 -0
  455. package/dist/integrations/collection.d.ts.map +1 -0
  456. package/dist/integrations/collection.js +193 -0
  457. package/dist/integrations/collection.js.map +1 -0
  458. package/dist/integrations/endpoints/sync.d.ts +27 -0
  459. package/dist/integrations/endpoints/sync.d.ts.map +1 -0
  460. package/dist/integrations/endpoints/sync.js +90 -0
  461. package/dist/integrations/endpoints/sync.js.map +1 -0
  462. package/dist/integrations/index.d.ts +22 -0
  463. package/dist/integrations/index.d.ts.map +1 -0
  464. package/dist/integrations/index.js +15 -0
  465. package/dist/integrations/index.js.map +1 -0
  466. package/dist/integrations/integrations/index.d.ts +3 -0
  467. package/dist/integrations/integrations/index.d.ts.map +1 -0
  468. package/dist/integrations/integrations/index.js +2 -0
  469. package/dist/integrations/integrations/index.js.map +1 -0
  470. package/dist/integrations/integrations/webhook/config-fields.d.ts +33 -0
  471. package/dist/integrations/integrations/webhook/config-fields.d.ts.map +1 -0
  472. package/dist/integrations/integrations/webhook/config-fields.js +54 -0
  473. package/dist/integrations/integrations/webhook/config-fields.js.map +1 -0
  474. package/dist/integrations/integrations/webhook/functions.d.ts +24 -0
  475. package/dist/integrations/integrations/webhook/functions.d.ts.map +1 -0
  476. package/dist/integrations/integrations/webhook/functions.js +139 -0
  477. package/dist/integrations/integrations/webhook/functions.js.map +1 -0
  478. package/dist/integrations/integrations/webhook/healthcheck.d.ts +10 -0
  479. package/dist/integrations/integrations/webhook/healthcheck.d.ts.map +1 -0
  480. package/dist/integrations/integrations/webhook/healthcheck.js +26 -0
  481. package/dist/integrations/integrations/webhook/healthcheck.js.map +1 -0
  482. package/dist/integrations/integrations/webhook/hmac.d.ts +11 -0
  483. package/dist/integrations/integrations/webhook/hmac.d.ts.map +1 -0
  484. package/dist/integrations/integrations/webhook/hmac.js +25 -0
  485. package/dist/integrations/integrations/webhook/hmac.js.map +1 -0
  486. package/dist/integrations/integrations/webhook/index.d.ts +6 -0
  487. package/dist/integrations/integrations/webhook/index.d.ts.map +1 -0
  488. package/dist/integrations/integrations/webhook/index.js +47 -0
  489. package/dist/integrations/integrations/webhook/index.js.map +1 -0
  490. package/dist/integrations/integrations/webhook/payload.d.ts +9 -0
  491. package/dist/integrations/integrations/webhook/payload.d.ts.map +1 -0
  492. package/dist/integrations/integrations/webhook/payload.js +19 -0
  493. package/dist/integrations/integrations/webhook/payload.js.map +1 -0
  494. package/dist/integrations/jobs/healthcheck.d.ts +24 -0
  495. package/dist/integrations/jobs/healthcheck.d.ts.map +1 -0
  496. package/dist/integrations/jobs/healthcheck.js +133 -0
  497. package/dist/integrations/jobs/healthcheck.js.map +1 -0
  498. package/dist/integrations/options.d.ts +54 -0
  499. package/dist/integrations/options.d.ts.map +1 -0
  500. package/dist/integrations/options.js +8 -0
  501. package/dist/integrations/options.js.map +1 -0
  502. package/dist/integrations/plugin.d.ts +51 -0
  503. package/dist/integrations/plugin.d.ts.map +1 -0
  504. package/dist/integrations/plugin.js +215 -0
  505. package/dist/integrations/plugin.js.map +1 -0
  506. package/dist/integrations/registry.d.ts +27 -0
  507. package/dist/integrations/registry.d.ts.map +1 -0
  508. package/dist/integrations/registry.js +39 -0
  509. package/dist/integrations/registry.js.map +1 -0
  510. package/dist/integrations/sync/manual-sync.d.ts +70 -0
  511. package/dist/integrations/sync/manual-sync.d.ts.map +1 -0
  512. package/dist/integrations/sync/manual-sync.js +91 -0
  513. package/dist/integrations/sync/manual-sync.js.map +1 -0
  514. package/dist/integrations/sync/problems.d.ts +31 -0
  515. package/dist/integrations/sync/problems.d.ts.map +1 -0
  516. package/dist/integrations/sync/problems.js +40 -0
  517. package/dist/integrations/sync/problems.js.map +1 -0
  518. package/dist/integrations/sync/status.d.ts +15 -0
  519. package/dist/integrations/sync/status.d.ts.map +1 -0
  520. package/dist/integrations/sync/status.js +31 -0
  521. package/dist/integrations/sync/status.js.map +1 -0
  522. package/dist/integrations/tools/access.d.ts +5 -0
  523. package/dist/integrations/tools/access.d.ts.map +1 -0
  524. package/dist/integrations/tools/access.js +14 -0
  525. package/dist/integrations/tools/access.js.map +1 -0
  526. package/dist/integrations/tools/descriptors.d.ts +26 -0
  527. package/dist/integrations/tools/descriptors.d.ts.map +1 -0
  528. package/dist/integrations/tools/descriptors.js +35 -0
  529. package/dist/integrations/tools/descriptors.js.map +1 -0
  530. package/dist/integrations/tools/get-integration-status.d.ts +17 -0
  531. package/dist/integrations/tools/get-integration-status.d.ts.map +1 -0
  532. package/dist/integrations/tools/get-integration-status.js +41 -0
  533. package/dist/integrations/tools/get-integration-status.js.map +1 -0
  534. package/dist/integrations/tools/index.d.ts +13 -0
  535. package/dist/integrations/tools/index.d.ts.map +1 -0
  536. package/dist/integrations/tools/index.js +8 -0
  537. package/dist/integrations/tools/index.js.map +1 -0
  538. package/dist/integrations/tools/list-integration-types.d.ts +10 -0
  539. package/dist/integrations/tools/list-integration-types.d.ts.map +1 -0
  540. package/dist/integrations/tools/list-integration-types.js +22 -0
  541. package/dist/integrations/tools/list-integration-types.js.map +1 -0
  542. package/dist/integrations/tools/list-integrations.d.ts +20 -0
  543. package/dist/integrations/tools/list-integrations.d.ts.map +1 -0
  544. package/dist/integrations/tools/list-integrations.js +49 -0
  545. package/dist/integrations/tools/list-integrations.js.map +1 -0
  546. package/dist/integrations/tools/test-integration.d.ts +19 -0
  547. package/dist/integrations/tools/test-integration.d.ts.map +1 -0
  548. package/dist/integrations/tools/test-integration.js +51 -0
  549. package/dist/integrations/tools/test-integration.js.map +1 -0
  550. package/dist/integrations/tools/trigger-sync.d.ts +26 -0
  551. package/dist/integrations/tools/trigger-sync.d.ts.map +1 -0
  552. package/dist/integrations/tools/trigger-sync.js +44 -0
  553. package/dist/integrations/tools/trigger-sync.js.map +1 -0
  554. package/dist/integrations/types.d.ts +183 -0
  555. package/dist/integrations/types.d.ts.map +1 -0
  556. package/dist/integrations/types.js +2 -0
  557. package/dist/integrations/types.js.map +1 -0
  558. package/dist/jobs/define.d.ts +17 -0
  559. package/dist/jobs/define.d.ts.map +1 -0
  560. package/dist/jobs/define.js +39 -0
  561. package/dist/jobs/define.js.map +1 -0
  562. package/dist/jobs/failure-handler.d.ts +39 -0
  563. package/dist/jobs/failure-handler.d.ts.map +1 -0
  564. package/dist/jobs/failure-handler.js +62 -0
  565. package/dist/jobs/failure-handler.js.map +1 -0
  566. package/dist/jobs/index.d.ts +28 -0
  567. package/dist/jobs/index.d.ts.map +1 -0
  568. package/dist/jobs/index.js +7 -0
  569. package/dist/jobs/index.js.map +1 -0
  570. package/dist/jobs/inngest/adapter.d.ts +39 -0
  571. package/dist/jobs/inngest/adapter.d.ts.map +1 -0
  572. package/dist/jobs/inngest/adapter.js +81 -0
  573. package/dist/jobs/inngest/adapter.js.map +1 -0
  574. package/dist/jobs/inngest/index.d.ts +15 -0
  575. package/dist/jobs/inngest/index.d.ts.map +1 -0
  576. package/dist/jobs/inngest/index.js +13 -0
  577. package/dist/jobs/inngest/index.js.map +1 -0
  578. package/dist/jobs/options.d.ts +18 -0
  579. package/dist/jobs/options.d.ts.map +1 -0
  580. package/dist/jobs/options.js +12 -0
  581. package/dist/jobs/options.js.map +1 -0
  582. package/dist/jobs/payload/adapter.d.ts +33 -0
  583. package/dist/jobs/payload/adapter.d.ts.map +1 -0
  584. package/dist/jobs/payload/adapter.js +257 -0
  585. package/dist/jobs/payload/adapter.js.map +1 -0
  586. package/dist/jobs/payload/index.d.ts +8 -0
  587. package/dist/jobs/payload/index.d.ts.map +1 -0
  588. package/dist/jobs/payload/index.js +7 -0
  589. package/dist/jobs/payload/index.js.map +1 -0
  590. package/dist/jobs/sender.d.ts +4 -0
  591. package/dist/jobs/sender.d.ts.map +1 -0
  592. package/dist/jobs/sender.js +19 -0
  593. package/dist/jobs/sender.js.map +1 -0
  594. package/dist/jobs/types.d.ts +105 -0
  595. package/dist/jobs/types.d.ts.map +1 -0
  596. package/dist/jobs/types.js +2 -0
  597. package/dist/jobs/types.js.map +1 -0
  598. package/dist/jobs/workflow-types.d.ts +280 -0
  599. package/dist/jobs/workflow-types.d.ts.map +1 -0
  600. package/dist/jobs/workflow-types.js +22 -0
  601. package/dist/jobs/workflow-types.js.map +1 -0
  602. package/dist/logger/index.d.ts +9 -0
  603. package/dist/logger/index.d.ts.map +1 -0
  604. package/dist/logger/index.js +41 -0
  605. package/dist/logger/index.js.map +1 -0
  606. package/dist/mcp/api-key-access.d.ts +50 -0
  607. package/dist/mcp/api-key-access.d.ts.map +1 -0
  608. package/dist/mcp/api-key-access.js +94 -0
  609. package/dist/mcp/api-key-access.js.map +1 -0
  610. package/dist/mcp/audit-context.d.ts +39 -0
  611. package/dist/mcp/audit-context.d.ts.map +1 -0
  612. package/dist/mcp/audit-context.js +36 -0
  613. package/dist/mcp/audit-context.js.map +1 -0
  614. package/dist/mcp/audit-server.d.ts +13 -0
  615. package/dist/mcp/audit-server.d.ts.map +1 -0
  616. package/dist/mcp/audit-server.js +68 -0
  617. package/dist/mcp/audit-server.js.map +1 -0
  618. package/dist/mcp/collector.d.ts +51 -0
  619. package/dist/mcp/collector.d.ts.map +1 -0
  620. package/dist/mcp/collector.js +96 -0
  621. package/dist/mcp/collector.js.map +1 -0
  622. package/dist/mcp/envelope.d.ts +22 -0
  623. package/dist/mcp/envelope.d.ts.map +1 -0
  624. package/dist/mcp/envelope.js +22 -0
  625. package/dist/mcp/envelope.js.map +1 -0
  626. package/dist/mcp/index.d.ts +12 -0
  627. package/dist/mcp/index.d.ts.map +1 -0
  628. package/dist/mcp/index.js +8 -0
  629. package/dist/mcp/index.js.map +1 -0
  630. package/dist/mcp/meta.d.ts +74 -0
  631. package/dist/mcp/meta.d.ts.map +1 -0
  632. package/dist/mcp/meta.js +27 -0
  633. package/dist/mcp/meta.js.map +1 -0
  634. package/dist/mcp/payload-mcp.d.ts +68 -0
  635. package/dist/mcp/payload-mcp.d.ts.map +1 -0
  636. package/dist/mcp/payload-mcp.js +175 -0
  637. package/dist/mcp/payload-mcp.js.map +1 -0
  638. package/dist/media/hooks.d.ts +70 -0
  639. package/dist/media/hooks.d.ts.map +1 -0
  640. package/dist/media/hooks.js +200 -0
  641. package/dist/media/hooks.js.map +1 -0
  642. package/dist/media/index.d.ts +8 -0
  643. package/dist/media/index.d.ts.map +1 -0
  644. package/dist/media/index.js +7 -0
  645. package/dist/media/index.js.map +1 -0
  646. package/dist/media/svg.d.ts +17 -0
  647. package/dist/media/svg.d.ts.map +1 -0
  648. package/dist/media/svg.js +241 -0
  649. package/dist/media/svg.js.map +1 -0
  650. package/dist/media/uploadKey.d.ts +25 -0
  651. package/dist/media/uploadKey.d.ts.map +1 -0
  652. package/dist/media/uploadKey.js +70 -0
  653. package/dist/media/uploadKey.js.map +1 -0
  654. package/dist/observability/collection.d.ts +13 -0
  655. package/dist/observability/collection.d.ts.map +1 -0
  656. package/dist/observability/collection.js +76 -0
  657. package/dist/observability/collection.js.map +1 -0
  658. package/dist/observability/index.d.ts +10 -0
  659. package/dist/observability/index.d.ts.map +1 -0
  660. package/dist/observability/index.js +6 -0
  661. package/dist/observability/index.js.map +1 -0
  662. package/dist/observability/plugin.d.ts +24 -0
  663. package/dist/observability/plugin.d.ts.map +1 -0
  664. package/dist/observability/plugin.js +59 -0
  665. package/dist/observability/plugin.js.map +1 -0
  666. package/dist/observability/report.d.ts +175 -0
  667. package/dist/observability/report.d.ts.map +1 -0
  668. package/dist/observability/report.js +274 -0
  669. package/dist/observability/report.js.map +1 -0
  670. package/dist/observability/tool.d.ts +33 -0
  671. package/dist/observability/tool.d.ts.map +1 -0
  672. package/dist/observability/tool.js +75 -0
  673. package/dist/observability/tool.js.map +1 -0
  674. package/dist/observability/writer.d.ts +24 -0
  675. package/dist/observability/writer.d.ts.map +1 -0
  676. package/dist/observability/writer.js +72 -0
  677. package/dist/observability/writer.js.map +1 -0
  678. package/dist/plugin-contract/admin.d.ts +45 -0
  679. package/dist/plugin-contract/admin.d.ts.map +1 -0
  680. package/dist/plugin-contract/admin.js +12 -0
  681. package/dist/plugin-contract/admin.js.map +1 -0
  682. package/dist/plugin-contract/env.d.ts +29 -0
  683. package/dist/plugin-contract/env.d.ts.map +1 -0
  684. package/dist/plugin-contract/env.js +2 -0
  685. package/dist/plugin-contract/env.js.map +1 -0
  686. package/dist/plugin-contract/index.d.ts +39 -0
  687. package/dist/plugin-contract/index.d.ts.map +1 -0
  688. package/dist/plugin-contract/index.js +5 -0
  689. package/dist/plugin-contract/index.js.map +1 -0
  690. package/dist/plugin-contract/mcp.d.ts +51 -0
  691. package/dist/plugin-contract/mcp.d.ts.map +1 -0
  692. package/dist/plugin-contract/mcp.js +2 -0
  693. package/dist/plugin-contract/mcp.js.map +1 -0
  694. package/dist/plugin-contract/registry.d.ts +23 -0
  695. package/dist/plugin-contract/registry.d.ts.map +1 -0
  696. package/dist/plugin-contract/registry.js +51 -0
  697. package/dist/plugin-contract/registry.js.map +1 -0
  698. package/dist/publishing/admin/PublishButton.d.ts +22 -0
  699. package/dist/publishing/admin/PublishButton.d.ts.map +1 -0
  700. package/dist/publishing/admin/PublishButton.js +164 -0
  701. package/dist/publishing/admin/PublishButton.js.map +1 -0
  702. package/dist/publishing/admin/SchedulePublishField.d.ts +24 -0
  703. package/dist/publishing/admin/SchedulePublishField.d.ts.map +1 -0
  704. package/dist/publishing/admin/SchedulePublishField.js +160 -0
  705. package/dist/publishing/admin/SchedulePublishField.js.map +1 -0
  706. package/dist/publishing/admin/UnpublishButton.d.ts +15 -0
  707. package/dist/publishing/admin/UnpublishButton.d.ts.map +1 -0
  708. package/dist/publishing/admin/UnpublishButton.js +90 -0
  709. package/dist/publishing/admin/UnpublishButton.js.map +1 -0
  710. package/dist/publishing/admin/publishing-client.d.ts +105 -0
  711. package/dist/publishing/admin/publishing-client.d.ts.map +1 -0
  712. package/dist/publishing/admin/publishing-client.js +139 -0
  713. package/dist/publishing/admin/publishing-client.js.map +1 -0
  714. package/dist/publishing/admin/schedule-state.d.ts +30 -0
  715. package/dist/publishing/admin/schedule-state.d.ts.map +1 -0
  716. package/dist/publishing/admin/schedule-state.js +39 -0
  717. package/dist/publishing/admin/schedule-state.js.map +1 -0
  718. package/dist/publishing/checks/alt-text.d.ts +17 -0
  719. package/dist/publishing/checks/alt-text.d.ts.map +1 -0
  720. package/dist/publishing/checks/alt-text.js +63 -0
  721. package/dist/publishing/checks/alt-text.js.map +1 -0
  722. package/dist/publishing/checks/heading-hierarchy.d.ts +11 -0
  723. package/dist/publishing/checks/heading-hierarchy.d.ts.map +1 -0
  724. package/dist/publishing/checks/heading-hierarchy.js +32 -0
  725. package/dist/publishing/checks/heading-hierarchy.js.map +1 -0
  726. package/dist/publishing/checks/index.d.ts +6 -0
  727. package/dist/publishing/checks/index.d.ts.map +1 -0
  728. package/dist/publishing/checks/index.js +13 -0
  729. package/dist/publishing/checks/index.js.map +1 -0
  730. package/dist/publishing/checks/link-labels.d.ts +9 -0
  731. package/dist/publishing/checks/link-labels.d.ts.map +1 -0
  732. package/dist/publishing/checks/link-labels.js +44 -0
  733. package/dist/publishing/checks/link-labels.js.map +1 -0
  734. package/dist/publishing/endpoints/admin.d.ts +19 -0
  735. package/dist/publishing/endpoints/admin.d.ts.map +1 -0
  736. package/dist/publishing/endpoints/admin.js +112 -0
  737. package/dist/publishing/endpoints/admin.js.map +1 -0
  738. package/dist/publishing/events.d.ts +16 -0
  739. package/dist/publishing/events.d.ts.map +1 -0
  740. package/dist/publishing/events.js +30 -0
  741. package/dist/publishing/events.js.map +1 -0
  742. package/dist/publishing/hooks/block-status-writes.d.ts +52 -0
  743. package/dist/publishing/hooks/block-status-writes.d.ts.map +1 -0
  744. package/dist/publishing/hooks/block-status-writes.js +242 -0
  745. package/dist/publishing/hooks/block-status-writes.js.map +1 -0
  746. package/dist/publishing/hooks/draft-writes.d.ts +32 -0
  747. package/dist/publishing/hooks/draft-writes.d.ts.map +1 -0
  748. package/dist/publishing/hooks/draft-writes.js +76 -0
  749. package/dist/publishing/hooks/draft-writes.js.map +1 -0
  750. package/dist/publishing/hooks/schedule-events.d.ts +26 -0
  751. package/dist/publishing/hooks/schedule-events.d.ts.map +1 -0
  752. package/dist/publishing/hooks/schedule-events.js +54 -0
  753. package/dist/publishing/hooks/schedule-events.js.map +1 -0
  754. package/dist/publishing/index.d.ts +35 -0
  755. package/dist/publishing/index.d.ts.map +1 -0
  756. package/dist/publishing/index.js +32 -0
  757. package/dist/publishing/index.js.map +1 -0
  758. package/dist/publishing/jobs/execute-scheduled-publishes.d.ts +24 -0
  759. package/dist/publishing/jobs/execute-scheduled-publishes.d.ts.map +1 -0
  760. package/dist/publishing/jobs/execute-scheduled-publishes.js +114 -0
  761. package/dist/publishing/jobs/execute-scheduled-publishes.js.map +1 -0
  762. package/dist/publishing/jobs/next-revalidate.d.ts +43 -0
  763. package/dist/publishing/jobs/next-revalidate.d.ts.map +1 -0
  764. package/dist/publishing/jobs/next-revalidate.js +42 -0
  765. package/dist/publishing/jobs/next-revalidate.js.map +1 -0
  766. package/dist/publishing/jobs/publish-at-scheduled-time.d.ts +24 -0
  767. package/dist/publishing/jobs/publish-at-scheduled-time.d.ts.map +1 -0
  768. package/dist/publishing/jobs/publish-at-scheduled-time.js +136 -0
  769. package/dist/publishing/jobs/publish-at-scheduled-time.js.map +1 -0
  770. package/dist/publishing/jobs/revalidate-on-publish.d.ts +24 -0
  771. package/dist/publishing/jobs/revalidate-on-publish.d.ts.map +1 -0
  772. package/dist/publishing/jobs/revalidate-on-publish.js +78 -0
  773. package/dist/publishing/jobs/revalidate-on-publish.js.map +1 -0
  774. package/dist/publishing/jobs/revalidate-tag-hooks.d.ts +80 -0
  775. package/dist/publishing/jobs/revalidate-tag-hooks.d.ts.map +1 -0
  776. package/dist/publishing/jobs/revalidate-tag-hooks.js +116 -0
  777. package/dist/publishing/jobs/revalidate-tag-hooks.js.map +1 -0
  778. package/dist/publishing/options.d.ts +100 -0
  779. package/dist/publishing/options.d.ts.map +1 -0
  780. package/dist/publishing/options.js +56 -0
  781. package/dist/publishing/options.js.map +1 -0
  782. package/dist/publishing/pipeline/index.d.ts +20 -0
  783. package/dist/publishing/pipeline/index.d.ts.map +1 -0
  784. package/dist/publishing/pipeline/index.js +88 -0
  785. package/dist/publishing/pipeline/index.js.map +1 -0
  786. package/dist/publishing/pipeline/steps/accessibility.d.ts +13 -0
  787. package/dist/publishing/pipeline/steps/accessibility.d.ts.map +1 -0
  788. package/dist/publishing/pipeline/steps/accessibility.js +37 -0
  789. package/dist/publishing/pipeline/steps/accessibility.js.map +1 -0
  790. package/dist/publishing/pipeline/steps/approval.d.ts +14 -0
  791. package/dist/publishing/pipeline/steps/approval.d.ts.map +1 -0
  792. package/dist/publishing/pipeline/steps/approval.js +54 -0
  793. package/dist/publishing/pipeline/steps/approval.js.map +1 -0
  794. package/dist/publishing/pipeline/steps/composition.d.ts +14 -0
  795. package/dist/publishing/pipeline/steps/composition.d.ts.map +1 -0
  796. package/dist/publishing/pipeline/steps/composition.js +63 -0
  797. package/dist/publishing/pipeline/steps/composition.js.map +1 -0
  798. package/dist/publishing/pipeline/steps/embargo.d.ts +12 -0
  799. package/dist/publishing/pipeline/steps/embargo.d.ts.map +1 -0
  800. package/dist/publishing/pipeline/steps/embargo.js +41 -0
  801. package/dist/publishing/pipeline/steps/embargo.js.map +1 -0
  802. package/dist/publishing/pipeline/steps/execute.d.ts +52 -0
  803. package/dist/publishing/pipeline/steps/execute.d.ts.map +1 -0
  804. package/dist/publishing/pipeline/steps/execute.js +161 -0
  805. package/dist/publishing/pipeline/steps/execute.js.map +1 -0
  806. package/dist/publishing/pipeline/steps/exist.d.ts +9 -0
  807. package/dist/publishing/pipeline/steps/exist.d.ts.map +1 -0
  808. package/dist/publishing/pipeline/steps/exist.js +31 -0
  809. package/dist/publishing/pipeline/steps/exist.js.map +1 -0
  810. package/dist/publishing/pipeline/steps/required-fields.d.ts +9 -0
  811. package/dist/publishing/pipeline/steps/required-fields.d.ts.map +1 -0
  812. package/dist/publishing/pipeline/steps/required-fields.js +63 -0
  813. package/dist/publishing/pipeline/steps/required-fields.js.map +1 -0
  814. package/dist/publishing/pipeline/types.d.ts +72 -0
  815. package/dist/publishing/pipeline/types.d.ts.map +1 -0
  816. package/dist/publishing/pipeline/types.js +2 -0
  817. package/dist/publishing/pipeline/types.js.map +1 -0
  818. package/dist/publishing/plugin.d.ts +4 -0
  819. package/dist/publishing/plugin.d.ts.map +1 -0
  820. package/dist/publishing/plugin.js +196 -0
  821. package/dist/publishing/plugin.js.map +1 -0
  822. package/dist/publishing/service.d.ts +149 -0
  823. package/dist/publishing/service.d.ts.map +1 -0
  824. package/dist/publishing/service.js +474 -0
  825. package/dist/publishing/service.js.map +1 -0
  826. package/dist/publishing/tools/actor.d.ts +32 -0
  827. package/dist/publishing/tools/actor.d.ts.map +1 -0
  828. package/dist/publishing/tools/actor.js +40 -0
  829. package/dist/publishing/tools/actor.js.map +1 -0
  830. package/dist/publishing/tools/descriptors.d.ts +26 -0
  831. package/dist/publishing/tools/descriptors.d.ts.map +1 -0
  832. package/dist/publishing/tools/descriptors.js +38 -0
  833. package/dist/publishing/tools/descriptors.js.map +1 -0
  834. package/dist/publishing/tools/get-publish-status.d.ts +12 -0
  835. package/dist/publishing/tools/get-publish-status.d.ts.map +1 -0
  836. package/dist/publishing/tools/get-publish-status.js +45 -0
  837. package/dist/publishing/tools/get-publish-status.js.map +1 -0
  838. package/dist/publishing/tools/index.d.ts +7 -0
  839. package/dist/publishing/tools/index.d.ts.map +1 -0
  840. package/dist/publishing/tools/index.js +7 -0
  841. package/dist/publishing/tools/index.js.map +1 -0
  842. package/dist/publishing/tools/publish.d.ts +14 -0
  843. package/dist/publishing/tools/publish.d.ts.map +1 -0
  844. package/dist/publishing/tools/publish.js +35 -0
  845. package/dist/publishing/tools/publish.js.map +1 -0
  846. package/dist/publishing/tools/rollback.d.ts +11 -0
  847. package/dist/publishing/tools/rollback.d.ts.map +1 -0
  848. package/dist/publishing/tools/rollback.js +98 -0
  849. package/dist/publishing/tools/rollback.js.map +1 -0
  850. package/dist/publishing/tools/schedule-publish.d.ts +20 -0
  851. package/dist/publishing/tools/schedule-publish.d.ts.map +1 -0
  852. package/dist/publishing/tools/schedule-publish.js +49 -0
  853. package/dist/publishing/tools/schedule-publish.js.map +1 -0
  854. package/dist/publishing/tools/unpublish.d.ts +14 -0
  855. package/dist/publishing/tools/unpublish.d.ts.map +1 -0
  856. package/dist/publishing/tools/unpublish.js +29 -0
  857. package/dist/publishing/tools/unpublish.js.map +1 -0
  858. package/dist/references/UsedOnPanel.d.ts +3 -0
  859. package/dist/references/UsedOnPanel.d.ts.map +1 -0
  860. package/dist/references/UsedOnPanel.js +47 -0
  861. package/dist/references/UsedOnPanel.js.map +1 -0
  862. package/dist/references/find.d.ts +46 -0
  863. package/dist/references/find.d.ts.map +1 -0
  864. package/dist/references/find.js +142 -0
  865. package/dist/references/find.js.map +1 -0
  866. package/dist/references/guards.d.ts +32 -0
  867. package/dist/references/guards.d.ts.map +1 -0
  868. package/dist/references/guards.js +76 -0
  869. package/dist/references/guards.js.map +1 -0
  870. package/dist/references/index.d.ts +11 -0
  871. package/dist/references/index.d.ts.map +1 -0
  872. package/dist/references/index.js +6 -0
  873. package/dist/references/index.js.map +1 -0
  874. package/dist/references/plugin.d.ts +51 -0
  875. package/dist/references/plugin.d.ts.map +1 -0
  876. package/dist/references/plugin.js +111 -0
  877. package/dist/references/plugin.js.map +1 -0
  878. package/dist/references/tools.d.ts +54 -0
  879. package/dist/references/tools.d.ts.map +1 -0
  880. package/dist/references/tools.js +124 -0
  881. package/dist/references/tools.js.map +1 -0
  882. package/dist/references/walk.d.ts +43 -0
  883. package/dist/references/walk.d.ts.map +1 -0
  884. package/dist/references/walk.js +214 -0
  885. package/dist/references/walk.js.map +1 -0
  886. package/dist/testing/anonymousAccess.d.ts +111 -0
  887. package/dist/testing/anonymousAccess.d.ts.map +1 -0
  888. package/dist/testing/anonymousAccess.js +185 -0
  889. package/dist/testing/anonymousAccess.js.map +1 -0
  890. package/dist/testing/describeAnonymousAccess.d.ts +26 -0
  891. package/dist/testing/describeAnonymousAccess.d.ts.map +1 -0
  892. package/dist/testing/describeAnonymousAccess.js +76 -0
  893. package/dist/testing/describeAnonymousAccess.js.map +1 -0
  894. package/dist/testing/index.d.ts +11 -0
  895. package/dist/testing/index.d.ts.map +1 -0
  896. package/dist/testing/index.js +9 -0
  897. package/dist/testing/index.js.map +1 -0
  898. package/dist/utils/content-hash.d.ts +31 -0
  899. package/dist/utils/content-hash.d.ts.map +1 -0
  900. package/dist/utils/content-hash.js +94 -0
  901. package/dist/utils/content-hash.js.map +1 -0
  902. package/dist/utils/index.d.ts +6 -0
  903. package/dist/utils/index.d.ts.map +1 -0
  904. package/dist/utils/index.js +5 -0
  905. package/dist/utils/index.js.map +1 -0
  906. package/dist/utils/relationships.d.ts +17 -0
  907. package/dist/utils/relationships.d.ts.map +1 -0
  908. package/dist/utils/relationships.js +26 -0
  909. package/dist/utils/relationships.js.map +1 -0
  910. package/dist/utils/sha256.d.ts +10 -0
  911. package/dist/utils/sha256.d.ts.map +1 -0
  912. package/dist/utils/sha256.js +16 -0
  913. package/dist/utils/sha256.js.map +1 -0
  914. package/dist/utils/zod-issues.d.ts +19 -0
  915. package/dist/utils/zod-issues.d.ts.map +1 -0
  916. package/dist/utils/zod-issues.js +22 -0
  917. package/dist/utils/zod-issues.js.map +1 -0
  918. package/package.json +183 -1
@@ -0,0 +1,185 @@
1
+ /**
2
+ * The anonymous request an access rule is handed.
3
+ *
4
+ * `req.payload` is a stub that throws on use rather than a mock that answers:
5
+ * a read rule that looks something up to decide is one this cannot evaluate
6
+ * without a database, and it should say so here rather than pass on a guess.
7
+ */
8
+ export function anonymousAccessArgs() {
9
+ const payload = new Proxy({}, {
10
+ get(_target, property) {
11
+ // Not thenable: an `await req.payload` must not hang on a stub.
12
+ if (property === 'then' || typeof property === 'symbol')
13
+ return undefined;
14
+ return () => {
15
+ throw new Error(`An access rule called payload.${property} for an anonymous request. ` +
16
+ 'A rule that needs the database cannot be checked as a value; test it against one.');
17
+ };
18
+ },
19
+ });
20
+ return {
21
+ req: { user: null, headers: new Headers(), payload },
22
+ };
23
+ }
24
+ /**
25
+ * What a read rule answers an anonymous request: `true`, `false`, a `where`
26
+ * query, or `undefined` when there is no rule at all.
27
+ */
28
+ export async function anonymousRead(entity) {
29
+ const read = entity.access?.read;
30
+ if (typeof read !== 'function')
31
+ return undefined;
32
+ return read(anonymousAccessArgs());
33
+ }
34
+ /** Whether an entity keeps drafts, so an anonymous read must be narrowed to published. */
35
+ export function hasDrafts(entity) {
36
+ const versions = entity.versions;
37
+ return typeof versions === 'object' && versions !== null && Boolean(versions.drafts);
38
+ }
39
+ /**
40
+ * Why a render-path entity fails, or `undefined` when it passes.
41
+ *
42
+ * `undefined` is a failure here and not in `privateProblem`, deliberately. A
43
+ * collection with no `read` rule gets Payload's default, which requires a user
44
+ * — so leaving one off is the same outage as writing an editors-only rule, and
45
+ * reads in review as though no decision were needed.
46
+ */
47
+ export async function renderPathProblem(entity) {
48
+ const answer = await anonymousRead(entity);
49
+ if (answer === undefined) {
50
+ return {
51
+ kind: 'render-path-refused',
52
+ message: `${entity.slug} has no read rule, so Payload's default applies and an anonymous read is refused.`,
53
+ };
54
+ }
55
+ if (answer === false) {
56
+ return {
57
+ kind: 'render-path-refused',
58
+ message: `${entity.slug} refuses an anonymous read, so the render path sees nothing.`,
59
+ };
60
+ }
61
+ /*
62
+ A bare `true` on a collection with drafts serves an unpublished document to
63
+ anybody who guesses its slug. A query is what narrows it — usually
64
+ `{ _status: { equals: 'published' } }` — and which query is the site's call.
65
+ */
66
+ if (answer === true && hasDrafts(entity)) {
67
+ return {
68
+ kind: 'drafts-unfiltered',
69
+ message: `${entity.slug} keeps drafts and answers an anonymous read with \`true\`, so drafts reach the internet. Answer with a query that narrows to published documents.`,
70
+ };
71
+ }
72
+ return undefined;
73
+ }
74
+ /**
75
+ * Why a private entity fails, or `undefined` when it passes.
76
+ *
77
+ * `undefined` passes: Payload's default refuses an anonymous read, so a plugin
78
+ * collection with no rule of its own is already closed. What must not happen is
79
+ * `true`, or a query — a query is a successful read of some subset.
80
+ */
81
+ export async function privateProblem(entity) {
82
+ const answer = await anonymousRead(entity);
83
+ if (answer === true) {
84
+ return { kind: 'private-readable', message: `${entity.slug} is readable by anyone.` };
85
+ }
86
+ if (answer !== null && typeof answer === 'object') {
87
+ return {
88
+ kind: 'private-readable',
89
+ message: `${entity.slug} answers an anonymous read with a query, so it succeeds for whatever matches.`,
90
+ };
91
+ }
92
+ return undefined;
93
+ }
94
+ /** Slugs of a bucket, whichever shape it was written in. */
95
+ export function bucketSlugs(bucket) {
96
+ if (!bucket)
97
+ return [];
98
+ return Array.isArray(bucket) ? [...bucket] : Object.keys(bucket);
99
+ }
100
+ /**
101
+ * Every entity in exactly one bucket, and every bucket entry in the config.
102
+ */
103
+ export function classificationFindings(entity, inConfig, renderPath, closed) {
104
+ const findings = [];
105
+ const slugs = new Set(inConfig.map((item) => item.slug));
106
+ const classified = [...renderPath, ...closed];
107
+ const seen = new Set();
108
+ for (const slug of classified) {
109
+ if (seen.has(slug)) {
110
+ findings.push({
111
+ entity,
112
+ slug,
113
+ kind: 'classified-twice',
114
+ message: `${slug} is listed more than once. Each ${entity} belongs in exactly one bucket.`,
115
+ });
116
+ }
117
+ seen.add(slug);
118
+ }
119
+ for (const slug of slugs) {
120
+ if (!seen.has(slug)) {
121
+ findings.push({
122
+ entity,
123
+ slug,
124
+ kind: 'unclassified',
125
+ message: `${slug} is in the config and in no bucket. Decide whether a published page reads it ` +
126
+ `with nobody signed in (renderPath, with where) or the internet must not (private).`,
127
+ });
128
+ }
129
+ }
130
+ for (const slug of seen) {
131
+ if (!slugs.has(slug)) {
132
+ findings.push({
133
+ entity,
134
+ slug,
135
+ kind: 'not-in-config',
136
+ message: `${slug} is in a bucket and not in the config. Remove it, or fix the slug.`,
137
+ });
138
+ }
139
+ }
140
+ return findings;
141
+ }
142
+ /**
143
+ * Every finding for a config and its buckets, empty when it is sound.
144
+ *
145
+ * The pure form of `describeAnonymousAccess`, for a script or a test that
146
+ * wants the list rather than one test per collection.
147
+ */
148
+ export async function checkAnonymousAccess(config, buckets) {
149
+ const resolved = await config;
150
+ const findings = [];
151
+ const sides = [
152
+ {
153
+ entity: 'collection',
154
+ items: resolved.collections ?? [],
155
+ renderPath: bucketSlugs(buckets.renderPath),
156
+ closed: bucketSlugs(buckets.private),
157
+ },
158
+ ];
159
+ if (buckets.globals) {
160
+ sides.push({
161
+ entity: 'global',
162
+ items: resolved.globals ?? [],
163
+ renderPath: bucketSlugs(buckets.globals.renderPath),
164
+ closed: bucketSlugs(buckets.globals.private),
165
+ });
166
+ }
167
+ for (const side of sides) {
168
+ findings.push(...classificationFindings(side.entity, side.items, side.renderPath, side.closed));
169
+ const bySlug = new Map(side.items.map((item) => [item.slug, item]));
170
+ for (const slug of side.renderPath) {
171
+ const item = bySlug.get(slug);
172
+ const problem = item && (await renderPathProblem(item));
173
+ if (problem)
174
+ findings.push({ entity: side.entity, slug, ...problem });
175
+ }
176
+ for (const slug of side.closed) {
177
+ const item = bySlug.get(slug);
178
+ const problem = item && (await privateProblem(item));
179
+ if (problem)
180
+ findings.push({ entity: side.entity, slug, ...problem });
181
+ }
182
+ }
183
+ return findings;
184
+ }
185
+ //# sourceMappingURL=anonymousAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anonymousAccess.js","sourceRoot":"","sources":["../../src/testing/anonymousAccess.ts"],"names":[],"mappings":"AAsFA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,OAAO,GAAG,IAAI,KAAK,CACvB,EAAE,EACF;QACE,GAAG,CAAC,OAAO,EAAE,QAAQ;YACnB,gEAAgE;YAChE,IAAI,QAAQ,KAAK,MAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ;gBAAE,OAAO,SAAS,CAAA;YACzE,OAAO,GAAG,EAAE;gBACV,MAAM,IAAI,KAAK,CACb,iCAAiC,QAAQ,6BAA6B;oBACpE,mFAAm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YAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC7B,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;YACpD,IAAI,OAAO;gBAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;QACvE,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type AnonymousAccessBuckets, type ConfigInput } from './anonymousAccess.js';
2
+ export interface DescribeAnonymousAccessOptions {
3
+ /** The suite's name. Defaults to "anonymous access". */
4
+ title?: string;
5
+ }
6
+ /**
7
+ * Registers a vitest suite asserting what an anonymous request may read.
8
+ *
9
+ * Call it at the top level of a test file with the site's `payload.config.ts`
10
+ * and its bucket map:
11
+ *
12
+ * ```ts
13
+ * import config from '../payload.config'
14
+ * describeAnonymousAccess(config, {
15
+ * renderPath: { pages: 'the [...slug] route', media: 'every populated upload' },
16
+ * private: ['users', 'audit-events', 'payload-preferences'],
17
+ * })
18
+ * ```
19
+ *
20
+ * One test classifies every collection (and every global, when `globals` is
21
+ * given) into exactly one bucket; then one test per entry checks the rule
22
+ * itself, so a failure names the collection. No database: the config is
23
+ * imported, never connected.
24
+ */
25
+ export declare function describeAnonymousAccess(config: ConfigInput, buckets: AnonymousAccessBuckets, options?: DescribeAnonymousAccessOptions): void;
26
+ //# sourceMappingURL=describeAnonymousAccess.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describeAnonymousAccess.d.ts","sourceRoot":"","sources":["../../src/testing/describeAnonymousAccess.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EACjB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,8BAA8B;IAC7C,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,sBAAsB,EAC/B,OAAO,GAAE,8BAAmC,GAC3C,IAAI,CAqEN"}
@@ -0,0 +1,76 @@
1
+ import { beforeAll, describe, expect, it } from 'vitest';
2
+ import { bucketSlugs, classificationFindings, privateProblem, renderPathProblem, } from './anonymousAccess.js';
3
+ /**
4
+ * Registers a vitest suite asserting what an anonymous request may read.
5
+ *
6
+ * Call it at the top level of a test file with the site's `payload.config.ts`
7
+ * and its bucket map:
8
+ *
9
+ * ```ts
10
+ * import config from '../payload.config'
11
+ * describeAnonymousAccess(config, {
12
+ * renderPath: { pages: 'the [...slug] route', media: 'every populated upload' },
13
+ * private: ['users', 'audit-events', 'payload-preferences'],
14
+ * })
15
+ * ```
16
+ *
17
+ * One test classifies every collection (and every global, when `globals` is
18
+ * given) into exactly one bucket; then one test per entry checks the rule
19
+ * itself, so a failure names the collection. No database: the config is
20
+ * imported, never connected.
21
+ */
22
+ export function describeAnonymousAccess(config, buckets, options = {}) {
23
+ describe(options.title ?? 'anonymous access', () => {
24
+ let resolved;
25
+ beforeAll(async () => {
26
+ // `buildConfig` is async, and awaiting it is the only way to see the
27
+ // collections the plugins add on top of the site's own.
28
+ resolved = await config;
29
+ });
30
+ const find = (entity, slug) => {
31
+ const items = (entity === 'collection' ? resolved.collections : resolved.globals) ?? [];
32
+ const item = items.find((candidate) => candidate.slug === slug);
33
+ // Reported by the classification test as `not-in-config`; failing here
34
+ // too keeps this entry's own result honest.
35
+ expect(item, `${slug} is not in the config`).toBeDefined();
36
+ return item;
37
+ };
38
+ const sides = [{ entity: 'collection', renderPath: buckets.renderPath, closed: buckets.private }];
39
+ if (buckets.globals) {
40
+ sides.push({
41
+ entity: 'global',
42
+ renderPath: buckets.globals.renderPath ?? {},
43
+ closed: buckets.globals.private,
44
+ });
45
+ }
46
+ for (const side of sides) {
47
+ const plural = `${side.entity}s`;
48
+ it(`puts every ${side.entity} in exactly one bucket`, () => {
49
+ const items = (side.entity === 'collection' ? resolved.collections : resolved.globals) ?? [];
50
+ // A config with nothing in it makes every assertion below vacuous.
51
+ expect(items.length, `the config has no ${plural}`).toBeGreaterThan(0);
52
+ const findings = classificationFindings(side.entity, items, Object.keys(side.renderPath), bucketSlugs(side.closed));
53
+ expect(findings.map((finding) => finding.message)).toEqual([]);
54
+ });
55
+ const renderEntries = Object.entries(side.renderPath);
56
+ if (renderEntries.length > 0) {
57
+ describe(`${plural} the render path reads`, () => {
58
+ it.each(renderEntries)('%s — read by %s', async (slug) => {
59
+ const problem = await renderPathProblem(find(side.entity, slug));
60
+ expect(problem?.message).toBeUndefined();
61
+ });
62
+ });
63
+ }
64
+ const closedSlugs = bucketSlugs(side.closed);
65
+ if (closedSlugs.length > 0) {
66
+ describe(`${plural} the internet must not read`, () => {
67
+ it.each(closedSlugs)('%s refuses an anonymous read', async (slug) => {
68
+ const problem = await privateProblem(find(side.entity, slug));
69
+ expect(problem?.message).toBeUndefined();
70
+ });
71
+ });
72
+ }
73
+ }
74
+ });
75
+ }
76
+ //# sourceMappingURL=describeAnonymousAccess.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describeAnonymousAccess.js","sourceRoot":"","sources":["../../src/testing/describeAnonymousAccess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,cAAc,EACd,iBAAiB,GAKlB,MAAM,sBAAsB,CAAA;AAO7B;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAmB,EACnB,OAA+B,EAC/B,UAA0C,EAAE;IAE5C,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,kBAAkB,EAAE,GAAG,EAAE;QACjD,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AC3B,QAAQ,CAAC,GAAG,MAAM,6BAA6B,EAAE,GAAG,EAAE;oBACpD,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,8BAA8B,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;wBAClE,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;wBAC7D,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,aAAa,EAAE,CAAA;oBAC1C,CAAC,CAAC,CAAA;gBACJ,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Test helpers for a Throughline site, as `@forumone/throughline/testing`.
3
+ *
4
+ * Kept off the package root — which re-exports every other subpath — because
5
+ * these import `vitest`, an optional peer that a running site never loads.
6
+ */
7
+ export { anonymousAccessArgs, anonymousRead, checkAnonymousAccess, hasDrafts, } from './anonymousAccess.js';
8
+ export type { AccessCheckedConfig, AccessCheckedEntity, AccessFinding, AccessFindingKind, AnonymousAccessBuckets, ConfigInput, } from './anonymousAccess.js';
9
+ export { describeAnonymousAccess } from './describeAnonymousAccess.js';
10
+ export type { DescribeAnonymousAccessOptions } from './describeAnonymousAccess.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AACtE,YAAY,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Test helpers for a Throughline site, as `@forumone/throughline/testing`.
3
+ *
4
+ * Kept off the package root — which re-exports every other subpath — because
5
+ * these import `vitest`, an optional peer that a running site never loads.
6
+ */
7
+ export { anonymousAccessArgs, anonymousRead, checkAnonymousAccess, hasDrafts, } from './anonymousAccess.js';
8
+ export { describeAnonymousAccess } from './describeAnonymousAccess.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,SAAS,GACV,MAAM,sBAAsB,CAAA;AAS7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA"}
@@ -0,0 +1,31 @@
1
+ export interface DocumentContentHashOptions {
2
+ /**
3
+ * Extra field names to treat as volatile, stripped at every level.
4
+ * For app-specific bookkeeping written on save — a sync timestamp, a
5
+ * cached count — that no approver is looking at.
6
+ */
7
+ exclude?: string[];
8
+ }
9
+ /**
10
+ * Hashes the *content* of a document, ignoring the metadata that moves on
11
+ * every save.
12
+ *
13
+ * This is the binding an approval is tied to. Two documents hash the same
14
+ * when an approver would read the same thing, which means:
15
+ *
16
+ * - a save that changed nothing leaves a granted approval standing, and
17
+ * - a save that changed something invalidates it.
18
+ *
19
+ * That is the rule stated deliberately, rather than inherited from
20
+ * whichever timestamp field happened to be nearby.
21
+ *
22
+ * **Both sides must hash a document fetched the same way.** The approvals
23
+ * request tool and publishing's approval step both use
24
+ * `payload.findByID({ collection, id, draft: true })` at the config's
25
+ * default depth, so they see the same shape. A caller that hashes a
26
+ * document fetched at some other depth gets a hash that matches nothing:
27
+ * a populated relationship and a bare relationship id are not the same
28
+ * value, and no amount of normalising makes them one.
29
+ */
30
+ export declare function documentContentHash(document: Record<string, unknown>, options?: DocumentContentHashOptions): Promise<string>;
31
+ //# sourceMappingURL=content-hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-hash.d.ts","sourceRoot":"","sources":["../../src/utils/content-hash.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,MAAM,CAAC,CAIjB"}
@@ -0,0 +1,94 @@
1
+ import { sha256Hex } from './sha256.js';
2
+ /**
3
+ * Fields that move without the content moving. Stripped at every level of
4
+ * the document before hashing.
5
+ *
6
+ * `updatedAt` is the reason this module exists: an approval bound to it is
7
+ * invalidated by any save at all, including one that changed nothing, and
8
+ * including every tick of autosave. `createdAt`, `_status`, `__v`,
9
+ * `globalType` and `_id` are storage and publishing machinery rather than
10
+ * anything an approver read.
11
+ *
12
+ * The document's own `id` is stripped separately, at the top level only —
13
+ * see `normalize`.
14
+ */
15
+ const VOLATILE_FIELDS = new Set(['createdAt', 'updatedAt', '_status', '__v', '_id', 'globalType']);
16
+ /**
17
+ * Hashes the *content* of a document, ignoring the metadata that moves on
18
+ * every save.
19
+ *
20
+ * This is the binding an approval is tied to. Two documents hash the same
21
+ * when an approver would read the same thing, which means:
22
+ *
23
+ * - a save that changed nothing leaves a granted approval standing, and
24
+ * - a save that changed something invalidates it.
25
+ *
26
+ * That is the rule stated deliberately, rather than inherited from
27
+ * whichever timestamp field happened to be nearby.
28
+ *
29
+ * **Both sides must hash a document fetched the same way.** The approvals
30
+ * request tool and publishing's approval step both use
31
+ * `payload.findByID({ collection, id, draft: true })` at the config's
32
+ * default depth, so they see the same shape. A caller that hashes a
33
+ * document fetched at some other depth gets a hash that matches nothing:
34
+ * a populated relationship and a bare relationship id are not the same
35
+ * value, and no amount of normalising makes them one.
36
+ */
37
+ export async function documentContentHash(document, options = {}) {
38
+ const volatile = new Set(VOLATILE_FIELDS);
39
+ for (const field of options.exclude ?? [])
40
+ volatile.add(field);
41
+ return sha256Hex(stableStringify(normalize(document, volatile, true)));
42
+ }
43
+ /**
44
+ * Strips volatile fields and normalises values whose representation can
45
+ * vary without their meaning varying.
46
+ *
47
+ * `id` is dropped only at the top level, where it is the document's own id
48
+ * and constant for the life of the document. Nested `id`s are kept, because
49
+ * that is where a populated relationship carries which document it points
50
+ * at — dropping those would make a page that swapped one image for another
51
+ * with the same alt text hash identically to the one an approver read.
52
+ */
53
+ function normalize(value, volatile, topLevel = false) {
54
+ if (value instanceof Date)
55
+ return value.toISOString();
56
+ if (Array.isArray(value))
57
+ return value.map((entry) => normalize(entry, volatile));
58
+ if (value === null || typeof value !== 'object')
59
+ return value;
60
+ const result = {};
61
+ for (const [key, entry] of Object.entries(value)) {
62
+ if (volatile.has(key))
63
+ continue;
64
+ if (topLevel && key === 'id')
65
+ continue;
66
+ // A field the caller never set and one set to `undefined` are the same
67
+ // document. JSON.stringify already drops these; doing it here keeps the
68
+ // sorted key list honest.
69
+ if (entry === undefined)
70
+ continue;
71
+ result[key] = normalize(entry, volatile);
72
+ }
73
+ return result;
74
+ }
75
+ /**
76
+ * `JSON.stringify` with object keys in sorted order, so that two documents
77
+ * differing only in key order hash the same. Payload reads blocks back out
78
+ * of JSONB, and neither Postgres nor the JSON parser promises to hand them
79
+ * back in the order they went in.
80
+ *
81
+ * Array order is meaningful — it is the order of the blocks on the page —
82
+ * and is preserved.
83
+ */
84
+ function stableStringify(value) {
85
+ if (Array.isArray(value)) {
86
+ return `[${value.map(stableStringify).join(',')}]`;
87
+ }
88
+ if (value !== null && typeof value === 'object') {
89
+ const entries = Object.entries(value).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0);
90
+ return `{${entries.map(([k, v]) => `${JSON.stringify(k)}:${stableStringify(v)}`).join(',')}}`;
91
+ }
92
+ return JSON.stringify(value) ?? 'null';
93
+ }
94
+ //# sourceMappingURL=content-hash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-hash.js","sourceRoot":"","sources":["../../src/utils/content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAA;AAWlG;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAiC,EACjC,UAAsC,EAAE;IAExC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAA;IACzC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,IAAI,EAAE;QAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC9D,OAAO,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AACxE,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,SAAS,CAAC,KAAc,EAAE,QAAqB,EAAE,QAAQ,GAAG,KAAK;IACxE,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAA;IACrD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAA;IACjF,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAE7D,MAAM,MAAM,GAA4B,EAAE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AAC,GAAG,CAAA;IAC/F,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAA;AACxC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { documentContentHash } from './content-hash.js';
2
+ export type { DocumentContentHashOptions } from './content-hash.js';
3
+ export { sha256Hex } from './sha256.js';
4
+ export { unwrapRelationshipId } from './relationships.js';
5
+ export { formatZodIssues } from './zod-issues.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,YAAY,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { documentContentHash } from './content-hash.js';
2
+ export { sha256Hex } from './sha256.js';
3
+ export { unwrapRelationshipId } from './relationships.js';
4
+ export { formatZodIssues } from './zod-issues.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The id out of a Payload relationship field, whatever depth it came back at.
3
+ *
4
+ * A relationship is an id at depth 0 and a populated document above it, so every
5
+ * reader has to handle both. Four copies of this existed — three private to
6
+ * `approvals`, one exported from `email` — differing only in a null guard that
7
+ * `typeof value === 'string'` already covers.
8
+ *
9
+ * **One deliberate difference from all four.** None of them handled a *numeric*
10
+ * id, so on Postgres at `depth: 0` they returned `null` for a relationship that
11
+ * was populated perfectly well. No current caller reads at depth 0 — they take
12
+ * the config default and get objects — so this fixes nothing today and stops a
13
+ * shared helper being wrong for the first caller that does. The change can only
14
+ * turn a `null` into a correct id, and no caller branches on that distinction.
15
+ */
16
+ export declare function unwrapRelationshipId(value: unknown): string | null;
17
+ //# sourceMappingURL=relationships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.d.ts","sourceRoot":"","sources":["../../src/utils/relationships.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAOlE"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The id out of a Payload relationship field, whatever depth it came back at.
3
+ *
4
+ * A relationship is an id at depth 0 and a populated document above it, so every
5
+ * reader has to handle both. Four copies of this existed — three private to
6
+ * `approvals`, one exported from `email` — differing only in a null guard that
7
+ * `typeof value === 'string'` already covers.
8
+ *
9
+ * **One deliberate difference from all four.** None of them handled a *numeric*
10
+ * id, so on Postgres at `depth: 0` they returned `null` for a relationship that
11
+ * was populated perfectly well. No current caller reads at depth 0 — they take
12
+ * the config default and get objects — so this fixes nothing today and stops a
13
+ * shared helper being wrong for the first caller that does. The change can only
14
+ * turn a `null` into a correct id, and no caller branches on that distinction.
15
+ */
16
+ export function unwrapRelationshipId(value) {
17
+ if (typeof value === 'string')
18
+ return value;
19
+ if (typeof value === 'number')
20
+ return String(value);
21
+ if (value && typeof value === 'object' && 'id' in value) {
22
+ return String(value.id);
23
+ }
24
+ return null;
25
+ }
26
+ //# sourceMappingURL=relationships.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relationships.js","sourceRoot":"","sources":["../../src/utils/relationships.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACnD,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QACxD,OAAO,MAAM,CAAE,KAAyB,CAAC,EAAE,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Hashes a string with SHA-256 using the Web Crypto API; returns lowercase hex.
3
+ *
4
+ * Lived in `auth/api-keys.ts` while this package minted and stored its own MCP
5
+ * keys. Those are gone — `@payloadcms/plugin-mcp` owns key storage now — and
6
+ * `documentContentHash` is the remaining caller, so the function moved to sit
7
+ * beside it rather than being deleted with the collection it was written for.
8
+ */
9
+ export declare function sha256Hex(input: string): Promise<string>;
10
+ //# sourceMappingURL=sha256.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../src/utils/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9D"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Hashes a string with SHA-256 using the Web Crypto API; returns lowercase hex.
3
+ *
4
+ * Lived in `auth/api-keys.ts` while this package minted and stored its own MCP
5
+ * keys. Those are gone — `@payloadcms/plugin-mcp` owns key storage now — and
6
+ * `documentContentHash` is the remaining caller, so the function moved to sit
7
+ * beside it rather than being deleted with the collection it was written for.
8
+ */
9
+ export async function sha256Hex(input) {
10
+ const data = new TextEncoder().encode(input);
11
+ const buffer = await crypto.subtle.digest('SHA-256', data);
12
+ return Array.from(new Uint8Array(buffer))
13
+ .map((b) => b.toString(16).padStart(2, '0'))
14
+ .join('');
15
+ }
16
+ //# sourceMappingURL=sha256.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/utils/sha256.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,KAAa;IAC3C,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IAC1D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SAC3C,IAAI,CAAC,EAAE,CAAC,CAAA;AACb,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { z } from 'zod';
2
+ /**
3
+ * Zod's issues as an indented list, one per line.
4
+ *
5
+ * `componentsPlugin`'s options and a publishable collection's config formatted
6
+ * them identically, because the shape is what makes a config error readable:
7
+ * the path to the field, then what is wrong with it. Both plugins already
8
+ * depend on this package, so sharing costs nothing.
9
+ *
10
+ * `(root)` for an issue with no path — what a schema-level refinement produces,
11
+ * and what an empty `join('.')` would otherwise render as nothing at all.
12
+ *
13
+ * A third copy lives in `design-contract`'s loader and stays there. That
14
+ * package depends on `zod` and nothing else, which is what lets the scaffolder
15
+ * and a standalone design system consume it; trading that for four lines would
16
+ * pull the whole plugin surface behind it.
17
+ */
18
+ export declare function formatZodIssues(error: z.ZodError): string;
19
+ //# sourceMappingURL=zod-issues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-issues.d.ts","sourceRoot":"","sources":["../../src/utils/zod-issues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,GAAG,MAAM,CAIzD"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Zod's issues as an indented list, one per line.
3
+ *
4
+ * `componentsPlugin`'s options and a publishable collection's config formatted
5
+ * them identically, because the shape is what makes a config error readable:
6
+ * the path to the field, then what is wrong with it. Both plugins already
7
+ * depend on this package, so sharing costs nothing.
8
+ *
9
+ * `(root)` for an issue with no path — what a schema-level refinement produces,
10
+ * and what an empty `join('.')` would otherwise render as nothing at all.
11
+ *
12
+ * A third copy lives in `design-contract`'s loader and stays there. That
13
+ * package depends on `zod` and nothing else, which is what lets the scaffolder
14
+ * and a standalone design system consume it; trading that for four lines would
15
+ * pull the whole plugin surface behind it.
16
+ */
17
+ export function formatZodIssues(error) {
18
+ return error.issues
19
+ .map((issue) => ` - ${issue.path.join('.') || '(root)'}: ${issue.message}`)
20
+ .join('\n');
21
+ }
22
+ //# sourceMappingURL=zod-issues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-issues.js","sourceRoot":"","sources":["../../src/utils/zod-issues.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,OAAO,KAAK,CAAC,MAAM;SAChB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;SAC3E,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}