@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.
- package/CHANGELOG.md +601 -0
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/bin/payload-cli.mjs +443 -0
- package/bin/throughline-payload.mjs +6 -0
- package/dist/access/coreCollections.d.ts +18 -0
- package/dist/access/coreCollections.d.ts.map +1 -0
- package/dist/access/coreCollections.js +56 -0
- package/dist/access/coreCollections.js.map +1 -0
- package/dist/approvals/collection.d.ts +21 -0
- package/dist/approvals/collection.d.ts.map +1 -0
- package/dist/approvals/collection.js +99 -0
- package/dist/approvals/collection.js.map +1 -0
- package/dist/approvals/endpoints/action.d.ts +31 -0
- package/dist/approvals/endpoints/action.d.ts.map +1 -0
- package/dist/approvals/endpoints/action.js +205 -0
- package/dist/approvals/endpoints/action.js.map +1 -0
- package/dist/approvals/index.d.ts +19 -0
- package/dist/approvals/index.d.ts.map +1 -0
- package/dist/approvals/index.js +13 -0
- package/dist/approvals/index.js.map +1 -0
- package/dist/approvals/jobs/expire-stale-approvals.d.ts +14 -0
- package/dist/approvals/jobs/expire-stale-approvals.d.ts.map +1 -0
- package/dist/approvals/jobs/expire-stale-approvals.js +101 -0
- package/dist/approvals/jobs/expire-stale-approvals.js.map +1 -0
- package/dist/approvals/options.d.ts +76 -0
- package/dist/approvals/options.d.ts.map +1 -0
- package/dist/approvals/options.js +47 -0
- package/dist/approvals/options.js.map +1 -0
- package/dist/approvals/plugin.d.ts +4 -0
- package/dist/approvals/plugin.d.ts.map +1 -0
- package/dist/approvals/plugin.js +92 -0
- package/dist/approvals/plugin.js.map +1 -0
- package/dist/approvals/resolver.d.ts +18 -0
- package/dist/approvals/resolver.d.ts.map +1 -0
- package/dist/approvals/resolver.js +57 -0
- package/dist/approvals/resolver.js.map +1 -0
- package/dist/approvals/symbol.d.ts +12 -0
- package/dist/approvals/symbol.d.ts.map +1 -0
- package/dist/approvals/symbol.js +12 -0
- package/dist/approvals/symbol.js.map +1 -0
- package/dist/approvals/tokens.d.ts +48 -0
- package/dist/approvals/tokens.d.ts.map +1 -0
- package/dist/approvals/tokens.js +123 -0
- package/dist/approvals/tokens.js.map +1 -0
- package/dist/approvals/tools/descriptors.d.ts +26 -0
- package/dist/approvals/tools/descriptors.d.ts.map +1 -0
- package/dist/approvals/tools/descriptors.js +35 -0
- package/dist/approvals/tools/descriptors.js.map +1 -0
- package/dist/approvals/tools/get-approval-status.d.ts +11 -0
- package/dist/approvals/tools/get-approval-status.d.ts.map +1 -0
- package/dist/approvals/tools/get-approval-status.js +94 -0
- package/dist/approvals/tools/get-approval-status.js.map +1 -0
- package/dist/approvals/tools/index.d.ts +7 -0
- package/dist/approvals/tools/index.d.ts.map +1 -0
- package/dist/approvals/tools/index.js +7 -0
- package/dist/approvals/tools/index.js.map +1 -0
- package/dist/approvals/tools/list-my-requests.d.ts +11 -0
- package/dist/approvals/tools/list-my-requests.d.ts.map +1 -0
- package/dist/approvals/tools/list-my-requests.js +55 -0
- package/dist/approvals/tools/list-my-requests.js.map +1 -0
- package/dist/approvals/tools/list-pending-approvals.d.ts +11 -0
- package/dist/approvals/tools/list-pending-approvals.d.ts.map +1 -0
- package/dist/approvals/tools/list-pending-approvals.js +53 -0
- package/dist/approvals/tools/list-pending-approvals.js.map +1 -0
- package/dist/approvals/tools/request-approval.d.ts +13 -0
- package/dist/approvals/tools/request-approval.d.ts.map +1 -0
- package/dist/approvals/tools/request-approval.js +123 -0
- package/dist/approvals/tools/request-approval.js.map +1 -0
- package/dist/approvals/tools/respond-to-approval.d.ts +13 -0
- package/dist/approvals/tools/respond-to-approval.d.ts.map +1 -0
- package/dist/approvals/tools/respond-to-approval.js +98 -0
- package/dist/approvals/tools/respond-to-approval.js.map +1 -0
- package/dist/audit/collection.d.ts +22 -0
- package/dist/audit/collection.d.ts.map +1 -0
- package/dist/audit/collection.js +109 -0
- package/dist/audit/collection.js.map +1 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +11 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/jobs/audit-event-echo.d.ts +14 -0
- package/dist/audit/jobs/audit-event-echo.d.ts.map +1 -0
- package/dist/audit/jobs/audit-event-echo.js +61 -0
- package/dist/audit/jobs/audit-event-echo.js.map +1 -0
- package/dist/audit/plugin.d.ts +20 -0
- package/dist/audit/plugin.d.ts.map +1 -0
- package/dist/audit/plugin.js +55 -0
- package/dist/audit/plugin.js.map +1 -0
- package/dist/audit/query/formatting/index.d.ts +40 -0
- package/dist/audit/query/formatting/index.d.ts.map +1 -0
- package/dist/audit/query/formatting/index.js +73 -0
- package/dist/audit/query/formatting/index.js.map +1 -0
- package/dist/audit/query/options.d.ts +34 -0
- package/dist/audit/query/options.d.ts.map +1 -0
- package/dist/audit/query/options.js +8 -0
- package/dist/audit/query/options.js.map +1 -0
- package/dist/audit/query/plugin.d.ts +11 -0
- package/dist/audit/query/plugin.d.ts.map +1 -0
- package/dist/audit/query/plugin.js +68 -0
- package/dist/audit/query/plugin.js.map +1 -0
- package/dist/audit/query/tools/access.d.ts +9 -0
- package/dist/audit/query/tools/access.d.ts.map +1 -0
- package/dist/audit/query/tools/access.js +14 -0
- package/dist/audit/query/tools/access.js.map +1 -0
- package/dist/audit/query/tools/descriptors.d.ts +26 -0
- package/dist/audit/query/tools/descriptors.d.ts.map +1 -0
- package/dist/audit/query/tools/descriptors.js +35 -0
- package/dist/audit/query/tools/descriptors.js.map +1 -0
- package/dist/audit/query/tools/get-change-history.d.ts +23 -0
- package/dist/audit/query/tools/get-change-history.d.ts.map +1 -0
- package/dist/audit/query/tools/get-change-history.js +44 -0
- package/dist/audit/query/tools/get-change-history.js.map +1 -0
- package/dist/audit/query/tools/get-recent-failures.d.ts +23 -0
- package/dist/audit/query/tools/get-recent-failures.d.ts.map +1 -0
- package/dist/audit/query/tools/get-recent-failures.js +56 -0
- package/dist/audit/query/tools/get-recent-failures.js.map +1 -0
- package/dist/audit/query/tools/index.d.ts +13 -0
- package/dist/audit/query/tools/index.d.ts.map +1 -0
- package/dist/audit/query/tools/index.js +8 -0
- package/dist/audit/query/tools/index.js.map +1 -0
- package/dist/audit/query/tools/query-audit.d.ts +53 -0
- package/dist/audit/query/tools/query-audit.d.ts.map +1 -0
- package/dist/audit/query/tools/query-audit.js +78 -0
- package/dist/audit/query/tools/query-audit.js.map +1 -0
- package/dist/audit/query/tools/what-changed-in-range.d.ts +23 -0
- package/dist/audit/query/tools/what-changed-in-range.d.ts.map +1 -0
- package/dist/audit/query/tools/what-changed-in-range.js +86 -0
- package/dist/audit/query/tools/what-changed-in-range.js.map +1 -0
- package/dist/audit/query/tools/who-changed-what.d.ts +38 -0
- package/dist/audit/query/tools/who-changed-what.d.ts.map +1 -0
- package/dist/audit/query/tools/who-changed-what.js +66 -0
- package/dist/audit/query/tools/who-changed-what.js.map +1 -0
- package/dist/audit/types.d.ts +11 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +45 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/audit/writer.d.ts +50 -0
- package/dist/audit/writer.d.ts.map +1 -0
- package/dist/audit/writer.js +101 -0
- package/dist/audit/writer.js.map +1 -0
- package/dist/cache-tags.d.ts +31 -0
- package/dist/cache-tags.d.ts.map +1 -0
- package/dist/cache-tags.js +53 -0
- package/dist/cache-tags.js.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +7 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/manifest-source.d.ts +17 -0
- package/dist/components/manifest-source.d.ts.map +1 -0
- package/dist/components/manifest-source.js +60 -0
- package/dist/components/manifest-source.js.map +1 -0
- package/dist/components/matching/index.d.ts +3 -0
- package/dist/components/matching/index.d.ts.map +1 -0
- package/dist/components/matching/index.js +2 -0
- package/dist/components/matching/index.js.map +1 -0
- package/dist/components/matching/tfidf.d.ts +13 -0
- package/dist/components/matching/tfidf.d.ts.map +1 -0
- package/dist/components/matching/tfidf.js +118 -0
- package/dist/components/matching/tfidf.js.map +1 -0
- package/dist/components/matching/types.d.ts +22 -0
- package/dist/components/matching/types.d.ts.map +1 -0
- package/dist/components/matching/types.js +2 -0
- package/dist/components/matching/types.js.map +1 -0
- package/dist/components/options.d.ts +136 -0
- package/dist/components/options.d.ts.map +1 -0
- package/dist/components/options.js +40 -0
- package/dist/components/options.js.map +1 -0
- package/dist/components/plugin.d.ts +4 -0
- package/dist/components/plugin.d.ts.map +1 -0
- package/dist/components/plugin.js +95 -0
- package/dist/components/plugin.js.map +1 -0
- package/dist/components/tools/descriptors.d.ts +34 -0
- package/dist/components/tools/descriptors.d.ts.map +1 -0
- package/dist/components/tools/descriptors.js +43 -0
- package/dist/components/tools/descriptors.js.map +1 -0
- package/dist/components/tools/find-anti-pattern.d.ts +9 -0
- package/dist/components/tools/find-anti-pattern.d.ts.map +1 -0
- package/dist/components/tools/find-anti-pattern.js +31 -0
- package/dist/components/tools/find-anti-pattern.js.map +1 -0
- package/dist/components/tools/get-contract.d.ts +4 -0
- package/dist/components/tools/get-contract.d.ts.map +1 -0
- package/dist/components/tools/get-contract.js +19 -0
- package/dist/components/tools/get-contract.js.map +1 -0
- package/dist/components/tools/get-tokens.d.ts +4 -0
- package/dist/components/tools/get-tokens.d.ts.map +1 -0
- package/dist/components/tools/get-tokens.js +19 -0
- package/dist/components/tools/get-tokens.js.map +1 -0
- package/dist/components/tools/get-variants.d.ts +4 -0
- package/dist/components/tools/get-variants.d.ts.map +1 -0
- package/dist/components/tools/get-variants.js +19 -0
- package/dist/components/tools/get-variants.js.map +1 -0
- package/dist/components/tools/index.d.ts +9 -0
- package/dist/components/tools/index.d.ts.map +1 -0
- package/dist/components/tools/index.js +9 -0
- package/dist/components/tools/index.js.map +1 -0
- package/dist/components/tools/list-components.d.ts +4 -0
- package/dist/components/tools/list-components.d.ts.map +1 -0
- package/dist/components/tools/list-components.js +25 -0
- package/dist/components/tools/list-components.js.map +1 -0
- package/dist/components/tools/suggest-for-intent.d.ts +12 -0
- package/dist/components/tools/suggest-for-intent.d.ts.map +1 -0
- package/dist/components/tools/suggest-for-intent.js +83 -0
- package/dist/components/tools/suggest-for-intent.js.map +1 -0
- package/dist/components/tools/validate-composition.d.ts +9 -0
- package/dist/components/tools/validate-composition.d.ts.map +1 -0
- package/dist/components/tools/validate-composition.js +31 -0
- package/dist/components/tools/validate-composition.js.map +1 -0
- package/dist/components/validation/composition.d.ts +38 -0
- package/dist/components/validation/composition.d.ts.map +1 -0
- package/dist/components/validation/composition.js +135 -0
- package/dist/components/validation/composition.js.map +1 -0
- package/dist/editorial/calendar/ContentCalendarReport.d.ts +9 -0
- package/dist/editorial/calendar/ContentCalendarReport.d.ts.map +1 -0
- package/dist/editorial/calendar/ContentCalendarReport.js +47 -0
- package/dist/editorial/calendar/ContentCalendarReport.js.map +1 -0
- package/dist/editorial/calendar/ContentCalendarView.d.ts +3 -0
- package/dist/editorial/calendar/ContentCalendarView.d.ts.map +1 -0
- package/dist/editorial/calendar/ContentCalendarView.js +36 -0
- package/dist/editorial/calendar/ContentCalendarView.js.map +1 -0
- package/dist/editorial/calendar/calendar.d.ts +30 -0
- package/dist/editorial/calendar/calendar.d.ts.map +1 -0
- package/dist/editorial/calendar/calendar.js +23 -0
- package/dist/editorial/calendar/calendar.js.map +1 -0
- package/dist/editorial/calendar/find.d.ts +41 -0
- package/dist/editorial/calendar/find.d.ts.map +1 -0
- package/dist/editorial/calendar/find.js +108 -0
- package/dist/editorial/calendar/find.js.map +1 -0
- package/dist/editorial/calendar/month.d.ts +45 -0
- package/dist/editorial/calendar/month.d.ts.map +1 -0
- package/dist/editorial/calendar/month.js +120 -0
- package/dist/editorial/calendar/month.js.map +1 -0
- package/dist/editorial/calendar/tool.d.ts +50 -0
- package/dist/editorial/calendar/tool.d.ts.map +1 -0
- package/dist/editorial/calendar/tool.js +68 -0
- package/dist/editorial/calendar/tool.js.map +1 -0
- package/dist/editorial/config.d.ts +25 -0
- package/dist/editorial/config.d.ts.map +1 -0
- package/dist/editorial/config.js +12 -0
- package/dist/editorial/config.js.map +1 -0
- package/dist/editorial/health/ContentHealthReport.d.ts +7 -0
- package/dist/editorial/health/ContentHealthReport.d.ts.map +1 -0
- package/dist/editorial/health/ContentHealthReport.js +29 -0
- package/dist/editorial/health/ContentHealthReport.js.map +1 -0
- package/dist/editorial/health/ContentHealthView.d.ts +3 -0
- package/dist/editorial/health/ContentHealthView.d.ts.map +1 -0
- package/dist/editorial/health/ContentHealthView.js +29 -0
- package/dist/editorial/health/ContentHealthView.js.map +1 -0
- package/dist/editorial/health/HealthSummary.d.ts +6 -0
- package/dist/editorial/health/HealthSummary.d.ts.map +1 -0
- package/dist/editorial/health/HealthSummary.js +39 -0
- package/dist/editorial/health/HealthSummary.js.map +1 -0
- package/dist/editorial/health/checks.d.ts +104 -0
- package/dist/editorial/health/checks.d.ts.map +1 -0
- package/dist/editorial/health/checks.js +188 -0
- package/dist/editorial/health/checks.js.map +1 -0
- package/dist/editorial/health/find.d.ts +43 -0
- package/dist/editorial/health/find.d.ts.map +1 -0
- package/dist/editorial/health/find.js +97 -0
- package/dist/editorial/health/find.js.map +1 -0
- package/dist/editorial/health/tool.d.ts +53 -0
- package/dist/editorial/health/tool.d.ts.map +1 -0
- package/dist/editorial/health/tool.js +80 -0
- package/dist/editorial/health/tool.js.map +1 -0
- package/dist/editorial/index.d.ts +25 -0
- package/dist/editorial/index.d.ts.map +1 -0
- package/dist/editorial/index.js +15 -0
- package/dist/editorial/index.js.map +1 -0
- package/dist/editorial/palette/CommandPalette.d.ts +15 -0
- package/dist/editorial/palette/CommandPalette.d.ts.map +1 -0
- package/dist/editorial/palette/CommandPalette.js +319 -0
- package/dist/editorial/palette/CommandPalette.js.map +1 -0
- package/dist/editorial/palette/ReportsNav.d.ts +5 -0
- package/dist/editorial/palette/ReportsNav.d.ts.map +1 -0
- package/dist/editorial/palette/ReportsNav.js +31 -0
- package/dist/editorial/palette/ReportsNav.js.map +1 -0
- package/dist/editorial/palette/search.d.ts +18 -0
- package/dist/editorial/palette/search.d.ts.map +1 -0
- package/dist/editorial/palette/search.js +41 -0
- package/dist/editorial/palette/search.js.map +1 -0
- package/dist/editorial/palette/sources.d.ts +64 -0
- package/dist/editorial/palette/sources.d.ts.map +1 -0
- package/dist/editorial/palette/sources.js +103 -0
- package/dist/editorial/palette/sources.js.map +1 -0
- package/dist/editorial/palette/styles.d.ts +2 -0
- package/dist/editorial/palette/styles.d.ts.map +1 -0
- package/dist/editorial/palette/styles.js +76 -0
- package/dist/editorial/palette/styles.js.map +1 -0
- package/dist/editorial/palette/tool.d.ts +31 -0
- package/dist/editorial/palette/tool.d.ts.map +1 -0
- package/dist/editorial/palette/tool.js +63 -0
- package/dist/editorial/palette/tool.js.map +1 -0
- package/dist/editorial/plugin.d.ts +76 -0
- package/dist/editorial/plugin.d.ts.map +1 -0
- package/dist/editorial/plugin.js +186 -0
- package/dist/editorial/plugin.js.map +1 -0
- package/dist/editorial/relativeTime.d.ts +3 -0
- package/dist/editorial/relativeTime.d.ts.map +1 -0
- package/dist/editorial/relativeTime.js +27 -0
- package/dist/editorial/relativeTime.js.map +1 -0
- package/dist/editorial/styles.d.ts +2 -0
- package/dist/editorial/styles.d.ts.map +1 -0
- package/dist/editorial/styles.js +191 -0
- package/dist/editorial/styles.js.map +1 -0
- package/dist/editorial/work/YourWork.d.ts +13 -0
- package/dist/editorial/work/YourWork.d.ts.map +1 -0
- package/dist/editorial/work/YourWork.js +40 -0
- package/dist/editorial/work/YourWork.js.map +1 -0
- package/dist/editorial/work/tool.d.ts +45 -0
- package/dist/editorial/work/tool.d.ts.map +1 -0
- package/dist/editorial/work/tool.js +54 -0
- package/dist/editorial/work/tool.js.map +1 -0
- package/dist/editorial/work/work.d.ts +31 -0
- package/dist/editorial/work/work.d.ts.map +1 -0
- package/dist/editorial/work/work.js +68 -0
- package/dist/editorial/work/work.js.map +1 -0
- package/dist/email/client.d.ts +78 -0
- package/dist/email/client.d.ts.map +1 -0
- package/dist/email/client.js +63 -0
- package/dist/email/client.js.map +1 -0
- package/dist/email/functions/_shared.d.ts +17 -0
- package/dist/email/functions/_shared.d.ts.map +1 -0
- package/dist/email/functions/_shared.js +40 -0
- package/dist/email/functions/_shared.js.map +1 -0
- package/dist/email/functions/index.d.ts +7 -0
- package/dist/email/functions/index.d.ts.map +1 -0
- package/dist/email/functions/index.js +4 -0
- package/dist/email/functions/index.js.map +1 -0
- package/dist/email/functions/notify-approval-decision.d.ts +34 -0
- package/dist/email/functions/notify-approval-decision.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-decision.js +77 -0
- package/dist/email/functions/notify-approval-decision.js.map +1 -0
- package/dist/email/functions/notify-approval-expired.d.ts +32 -0
- package/dist/email/functions/notify-approval-expired.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-expired.js +54 -0
- package/dist/email/functions/notify-approval-expired.js.map +1 -0
- package/dist/email/functions/notify-approval-request.d.ts +35 -0
- package/dist/email/functions/notify-approval-request.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-request.js +89 -0
- package/dist/email/functions/notify-approval-request.js.map +1 -0
- package/dist/email/index.d.ts +17 -0
- package/dist/email/index.d.ts.map +1 -0
- package/dist/email/index.js +12 -0
- package/dist/email/index.js.map +1 -0
- package/dist/email/options.d.ts +100 -0
- package/dist/email/options.d.ts.map +1 -0
- package/dist/email/options.js +55 -0
- package/dist/email/options.js.map +1 -0
- package/dist/email/plugin.d.ts +28 -0
- package/dist/email/plugin.d.ts.map +1 -0
- package/dist/email/plugin.js +113 -0
- package/dist/email/plugin.js.map +1 -0
- package/dist/email/templates/ApprovalDecision.d.ts +15 -0
- package/dist/email/templates/ApprovalDecision.d.ts.map +1 -0
- package/dist/email/templates/ApprovalDecision.js +56 -0
- package/dist/email/templates/ApprovalDecision.js.map +1 -0
- package/dist/email/templates/ApprovalExpired.d.ts +10 -0
- package/dist/email/templates/ApprovalExpired.d.ts.map +1 -0
- package/dist/email/templates/ApprovalExpired.js +8 -0
- package/dist/email/templates/ApprovalExpired.js.map +1 -0
- package/dist/email/templates/ApprovalRequest.d.ts +24 -0
- package/dist/email/templates/ApprovalRequest.d.ts.map +1 -0
- package/dist/email/templates/ApprovalRequest.js +58 -0
- package/dist/email/templates/ApprovalRequest.js.map +1 -0
- package/dist/email/templates/_layout.d.ts +17 -0
- package/dist/email/templates/_layout.d.ts.map +1 -0
- package/dist/email/templates/_layout.js +39 -0
- package/dist/email/templates/_layout.js.map +1 -0
- package/dist/email/templates/index.d.ts +9 -0
- package/dist/email/templates/index.d.ts.map +1 -0
- package/dist/email/templates/index.js +5 -0
- package/dist/email/templates/index.js.map +1 -0
- package/dist/email/tokens.d.ts +39 -0
- package/dist/email/tokens.d.ts.map +1 -0
- package/dist/email/tokens.js +17 -0
- package/dist/email/tokens.js.map +1 -0
- package/dist/env/index.d.ts +54 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +113 -0
- package/dist/env/index.js.map +1 -0
- package/dist/events/inngest.d.ts +24 -0
- package/dist/events/inngest.d.ts.map +1 -0
- package/dist/events/inngest.js +24 -0
- package/dist/events/inngest.js.map +1 -0
- package/dist/events/taxonomy.d.ts +84 -0
- package/dist/events/taxonomy.d.ts.map +1 -0
- package/dist/events/taxonomy.js +10 -0
- package/dist/events/taxonomy.js.map +1 -0
- package/dist/events/vercel.d.ts +47 -0
- package/dist/events/vercel.d.ts.map +1 -0
- package/dist/events/vercel.js +69 -0
- package/dist/events/vercel.js.map +1 -0
- package/dist/exports/client.d.ts +24 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +21 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +17 -0
- package/dist/exports/rsc.d.ts.map +1 -0
- package/dist/exports/rsc.js +19 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/fields/CharacterCountField.d.ts +4 -0
- package/dist/fields/CharacterCountField.d.ts.map +1 -0
- package/dist/fields/CharacterCountField.js +94 -0
- package/dist/fields/CharacterCountField.js.map +1 -0
- package/dist/fields/characterCount.d.ts +15 -0
- package/dist/fields/characterCount.d.ts.map +1 -0
- package/dist/fields/characterCount.js +92 -0
- package/dist/fields/characterCount.js.map +1 -0
- package/dist/fields/checkSlug.d.ts +62 -0
- package/dist/fields/checkSlug.d.ts.map +1 -0
- package/dist/fields/checkSlug.js +119 -0
- package/dist/fields/checkSlug.js.map +1 -0
- package/dist/fields/index.d.ts +9 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.js +9 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/fields/mapFields.d.ts +13 -0
- package/dist/fields/mapFields.d.ts.map +1 -0
- package/dist/fields/mapFields.js +32 -0
- package/dist/fields/mapFields.js.map +1 -0
- package/dist/fields/publishing.d.ts +33 -0
- package/dist/fields/publishing.d.ts.map +1 -0
- package/dist/fields/publishing.js +81 -0
- package/dist/fields/publishing.js.map +1 -0
- package/dist/fields/revisedAt.d.ts +15 -0
- package/dist/fields/revisedAt.d.ts.map +1 -0
- package/dist/fields/revisedAt.js +79 -0
- package/dist/fields/revisedAt.js.map +1 -0
- package/dist/fields/slug.d.ts +21 -0
- package/dist/fields/slug.d.ts.map +1 -0
- package/dist/fields/slug.js +102 -0
- package/dist/fields/slug.js.map +1 -0
- package/dist/fields/unlisted.d.ts +13 -0
- package/dist/fields/unlisted.d.ts.map +1 -0
- package/dist/fields/unlisted.js +35 -0
- package/dist/fields/unlisted.js.map +1 -0
- package/dist/fields/usedBy.d.ts +12 -0
- package/dist/fields/usedBy.d.ts.map +1 -0
- package/dist/fields/usedBy.js +36 -0
- package/dist/fields/usedBy.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/admin/SyncButton.d.ts +27 -0
- package/dist/integrations/admin/SyncButton.d.ts.map +1 -0
- package/dist/integrations/admin/SyncButton.js +134 -0
- package/dist/integrations/admin/SyncButton.js.map +1 -0
- package/dist/integrations/admin/sync-client.d.ts +83 -0
- package/dist/integrations/admin/sync-client.d.ts.map +1 -0
- package/dist/integrations/admin/sync-client.js +121 -0
- package/dist/integrations/admin/sync-client.js.map +1 -0
- package/dist/integrations/collection.d.ts +26 -0
- package/dist/integrations/collection.d.ts.map +1 -0
- package/dist/integrations/collection.js +193 -0
- package/dist/integrations/collection.js.map +1 -0
- package/dist/integrations/endpoints/sync.d.ts +27 -0
- package/dist/integrations/endpoints/sync.d.ts.map +1 -0
- package/dist/integrations/endpoints/sync.js +90 -0
- package/dist/integrations/endpoints/sync.js.map +1 -0
- package/dist/integrations/index.d.ts +22 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +15 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/integrations/index.d.ts +3 -0
- package/dist/integrations/integrations/index.d.ts.map +1 -0
- package/dist/integrations/integrations/index.js +2 -0
- package/dist/integrations/integrations/index.js.map +1 -0
- package/dist/integrations/integrations/webhook/config-fields.d.ts +33 -0
- package/dist/integrations/integrations/webhook/config-fields.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/config-fields.js +54 -0
- package/dist/integrations/integrations/webhook/config-fields.js.map +1 -0
- package/dist/integrations/integrations/webhook/functions.d.ts +24 -0
- package/dist/integrations/integrations/webhook/functions.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/functions.js +139 -0
- package/dist/integrations/integrations/webhook/functions.js.map +1 -0
- package/dist/integrations/integrations/webhook/healthcheck.d.ts +10 -0
- package/dist/integrations/integrations/webhook/healthcheck.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/healthcheck.js +26 -0
- package/dist/integrations/integrations/webhook/healthcheck.js.map +1 -0
- package/dist/integrations/integrations/webhook/hmac.d.ts +11 -0
- package/dist/integrations/integrations/webhook/hmac.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/hmac.js +25 -0
- package/dist/integrations/integrations/webhook/hmac.js.map +1 -0
- package/dist/integrations/integrations/webhook/index.d.ts +6 -0
- package/dist/integrations/integrations/webhook/index.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/index.js +47 -0
- package/dist/integrations/integrations/webhook/index.js.map +1 -0
- package/dist/integrations/integrations/webhook/payload.d.ts +9 -0
- package/dist/integrations/integrations/webhook/payload.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/payload.js +19 -0
- package/dist/integrations/integrations/webhook/payload.js.map +1 -0
- package/dist/integrations/jobs/healthcheck.d.ts +24 -0
- package/dist/integrations/jobs/healthcheck.d.ts.map +1 -0
- package/dist/integrations/jobs/healthcheck.js +133 -0
- package/dist/integrations/jobs/healthcheck.js.map +1 -0
- package/dist/integrations/options.d.ts +54 -0
- package/dist/integrations/options.d.ts.map +1 -0
- package/dist/integrations/options.js +8 -0
- package/dist/integrations/options.js.map +1 -0
- package/dist/integrations/plugin.d.ts +51 -0
- package/dist/integrations/plugin.d.ts.map +1 -0
- package/dist/integrations/plugin.js +215 -0
- package/dist/integrations/plugin.js.map +1 -0
- package/dist/integrations/registry.d.ts +27 -0
- package/dist/integrations/registry.d.ts.map +1 -0
- package/dist/integrations/registry.js +39 -0
- package/dist/integrations/registry.js.map +1 -0
- package/dist/integrations/sync/manual-sync.d.ts +70 -0
- package/dist/integrations/sync/manual-sync.d.ts.map +1 -0
- package/dist/integrations/sync/manual-sync.js +91 -0
- package/dist/integrations/sync/manual-sync.js.map +1 -0
- package/dist/integrations/sync/problems.d.ts +31 -0
- package/dist/integrations/sync/problems.d.ts.map +1 -0
- package/dist/integrations/sync/problems.js +40 -0
- package/dist/integrations/sync/problems.js.map +1 -0
- package/dist/integrations/sync/status.d.ts +15 -0
- package/dist/integrations/sync/status.d.ts.map +1 -0
- package/dist/integrations/sync/status.js +31 -0
- package/dist/integrations/sync/status.js.map +1 -0
- package/dist/integrations/tools/access.d.ts +5 -0
- package/dist/integrations/tools/access.d.ts.map +1 -0
- package/dist/integrations/tools/access.js +14 -0
- package/dist/integrations/tools/access.js.map +1 -0
- package/dist/integrations/tools/descriptors.d.ts +26 -0
- package/dist/integrations/tools/descriptors.d.ts.map +1 -0
- package/dist/integrations/tools/descriptors.js +35 -0
- package/dist/integrations/tools/descriptors.js.map +1 -0
- package/dist/integrations/tools/get-integration-status.d.ts +17 -0
- package/dist/integrations/tools/get-integration-status.d.ts.map +1 -0
- package/dist/integrations/tools/get-integration-status.js +41 -0
- package/dist/integrations/tools/get-integration-status.js.map +1 -0
- package/dist/integrations/tools/index.d.ts +13 -0
- package/dist/integrations/tools/index.d.ts.map +1 -0
- package/dist/integrations/tools/index.js +8 -0
- package/dist/integrations/tools/index.js.map +1 -0
- package/dist/integrations/tools/list-integration-types.d.ts +10 -0
- package/dist/integrations/tools/list-integration-types.d.ts.map +1 -0
- package/dist/integrations/tools/list-integration-types.js +22 -0
- package/dist/integrations/tools/list-integration-types.js.map +1 -0
- package/dist/integrations/tools/list-integrations.d.ts +20 -0
- package/dist/integrations/tools/list-integrations.d.ts.map +1 -0
- package/dist/integrations/tools/list-integrations.js +49 -0
- package/dist/integrations/tools/list-integrations.js.map +1 -0
- package/dist/integrations/tools/test-integration.d.ts +19 -0
- package/dist/integrations/tools/test-integration.d.ts.map +1 -0
- package/dist/integrations/tools/test-integration.js +51 -0
- package/dist/integrations/tools/test-integration.js.map +1 -0
- package/dist/integrations/tools/trigger-sync.d.ts +26 -0
- package/dist/integrations/tools/trigger-sync.d.ts.map +1 -0
- package/dist/integrations/tools/trigger-sync.js +44 -0
- package/dist/integrations/tools/trigger-sync.js.map +1 -0
- package/dist/integrations/types.d.ts +183 -0
- package/dist/integrations/types.d.ts.map +1 -0
- package/dist/integrations/types.js +2 -0
- package/dist/integrations/types.js.map +1 -0
- package/dist/jobs/define.d.ts +17 -0
- package/dist/jobs/define.d.ts.map +1 -0
- package/dist/jobs/define.js +39 -0
- package/dist/jobs/define.js.map +1 -0
- package/dist/jobs/failure-handler.d.ts +39 -0
- package/dist/jobs/failure-handler.d.ts.map +1 -0
- package/dist/jobs/failure-handler.js +62 -0
- package/dist/jobs/failure-handler.js.map +1 -0
- package/dist/jobs/index.d.ts +28 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +7 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/inngest/adapter.d.ts +39 -0
- package/dist/jobs/inngest/adapter.d.ts.map +1 -0
- package/dist/jobs/inngest/adapter.js +81 -0
- package/dist/jobs/inngest/adapter.js.map +1 -0
- package/dist/jobs/inngest/index.d.ts +15 -0
- package/dist/jobs/inngest/index.d.ts.map +1 -0
- package/dist/jobs/inngest/index.js +13 -0
- package/dist/jobs/inngest/index.js.map +1 -0
- package/dist/jobs/options.d.ts +18 -0
- package/dist/jobs/options.d.ts.map +1 -0
- package/dist/jobs/options.js +12 -0
- package/dist/jobs/options.js.map +1 -0
- package/dist/jobs/payload/adapter.d.ts +33 -0
- package/dist/jobs/payload/adapter.d.ts.map +1 -0
- package/dist/jobs/payload/adapter.js +257 -0
- package/dist/jobs/payload/adapter.js.map +1 -0
- package/dist/jobs/payload/index.d.ts +8 -0
- package/dist/jobs/payload/index.d.ts.map +1 -0
- package/dist/jobs/payload/index.js +7 -0
- package/dist/jobs/payload/index.js.map +1 -0
- package/dist/jobs/sender.d.ts +4 -0
- package/dist/jobs/sender.d.ts.map +1 -0
- package/dist/jobs/sender.js +19 -0
- package/dist/jobs/sender.js.map +1 -0
- package/dist/jobs/types.d.ts +105 -0
- package/dist/jobs/types.d.ts.map +1 -0
- package/dist/jobs/types.js +2 -0
- package/dist/jobs/types.js.map +1 -0
- package/dist/jobs/workflow-types.d.ts +280 -0
- package/dist/jobs/workflow-types.d.ts.map +1 -0
- package/dist/jobs/workflow-types.js +22 -0
- package/dist/jobs/workflow-types.js.map +1 -0
- package/dist/logger/index.d.ts +9 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +41 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/mcp/api-key-access.d.ts +50 -0
- package/dist/mcp/api-key-access.d.ts.map +1 -0
- package/dist/mcp/api-key-access.js +94 -0
- package/dist/mcp/api-key-access.js.map +1 -0
- package/dist/mcp/audit-context.d.ts +39 -0
- package/dist/mcp/audit-context.d.ts.map +1 -0
- package/dist/mcp/audit-context.js +36 -0
- package/dist/mcp/audit-context.js.map +1 -0
- package/dist/mcp/audit-server.d.ts +13 -0
- package/dist/mcp/audit-server.d.ts.map +1 -0
- package/dist/mcp/audit-server.js +68 -0
- package/dist/mcp/audit-server.js.map +1 -0
- package/dist/mcp/collector.d.ts +51 -0
- package/dist/mcp/collector.d.ts.map +1 -0
- package/dist/mcp/collector.js +96 -0
- package/dist/mcp/collector.js.map +1 -0
- package/dist/mcp/envelope.d.ts +22 -0
- package/dist/mcp/envelope.d.ts.map +1 -0
- package/dist/mcp/envelope.js +22 -0
- package/dist/mcp/envelope.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/meta.d.ts +74 -0
- package/dist/mcp/meta.d.ts.map +1 -0
- package/dist/mcp/meta.js +27 -0
- package/dist/mcp/meta.js.map +1 -0
- package/dist/mcp/payload-mcp.d.ts +68 -0
- package/dist/mcp/payload-mcp.d.ts.map +1 -0
- package/dist/mcp/payload-mcp.js +175 -0
- package/dist/mcp/payload-mcp.js.map +1 -0
- package/dist/media/hooks.d.ts +70 -0
- package/dist/media/hooks.d.ts.map +1 -0
- package/dist/media/hooks.js +200 -0
- package/dist/media/hooks.js.map +1 -0
- package/dist/media/index.d.ts +8 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +7 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/svg.d.ts +17 -0
- package/dist/media/svg.d.ts.map +1 -0
- package/dist/media/svg.js +241 -0
- package/dist/media/svg.js.map +1 -0
- package/dist/media/uploadKey.d.ts +25 -0
- package/dist/media/uploadKey.d.ts.map +1 -0
- package/dist/media/uploadKey.js +70 -0
- package/dist/media/uploadKey.js.map +1 -0
- package/dist/observability/collection.d.ts +13 -0
- package/dist/observability/collection.d.ts.map +1 -0
- package/dist/observability/collection.js +76 -0
- package/dist/observability/collection.js.map +1 -0
- package/dist/observability/index.d.ts +10 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +6 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/plugin.d.ts +24 -0
- package/dist/observability/plugin.d.ts.map +1 -0
- package/dist/observability/plugin.js +59 -0
- package/dist/observability/plugin.js.map +1 -0
- package/dist/observability/report.d.ts +175 -0
- package/dist/observability/report.d.ts.map +1 -0
- package/dist/observability/report.js +274 -0
- package/dist/observability/report.js.map +1 -0
- package/dist/observability/tool.d.ts +33 -0
- package/dist/observability/tool.d.ts.map +1 -0
- package/dist/observability/tool.js +75 -0
- package/dist/observability/tool.js.map +1 -0
- package/dist/observability/writer.d.ts +24 -0
- package/dist/observability/writer.d.ts.map +1 -0
- package/dist/observability/writer.js +72 -0
- package/dist/observability/writer.js.map +1 -0
- package/dist/plugin-contract/admin.d.ts +45 -0
- package/dist/plugin-contract/admin.d.ts.map +1 -0
- package/dist/plugin-contract/admin.js +12 -0
- package/dist/plugin-contract/admin.js.map +1 -0
- package/dist/plugin-contract/env.d.ts +29 -0
- package/dist/plugin-contract/env.d.ts.map +1 -0
- package/dist/plugin-contract/env.js +2 -0
- package/dist/plugin-contract/env.js.map +1 -0
- package/dist/plugin-contract/index.d.ts +39 -0
- package/dist/plugin-contract/index.d.ts.map +1 -0
- package/dist/plugin-contract/index.js +5 -0
- package/dist/plugin-contract/index.js.map +1 -0
- package/dist/plugin-contract/mcp.d.ts +51 -0
- package/dist/plugin-contract/mcp.d.ts.map +1 -0
- package/dist/plugin-contract/mcp.js +2 -0
- package/dist/plugin-contract/mcp.js.map +1 -0
- package/dist/plugin-contract/registry.d.ts +23 -0
- package/dist/plugin-contract/registry.d.ts.map +1 -0
- package/dist/plugin-contract/registry.js +51 -0
- package/dist/plugin-contract/registry.js.map +1 -0
- package/dist/publishing/admin/PublishButton.d.ts +22 -0
- package/dist/publishing/admin/PublishButton.d.ts.map +1 -0
- package/dist/publishing/admin/PublishButton.js +164 -0
- package/dist/publishing/admin/PublishButton.js.map +1 -0
- package/dist/publishing/admin/SchedulePublishField.d.ts +24 -0
- package/dist/publishing/admin/SchedulePublishField.d.ts.map +1 -0
- package/dist/publishing/admin/SchedulePublishField.js +160 -0
- package/dist/publishing/admin/SchedulePublishField.js.map +1 -0
- package/dist/publishing/admin/UnpublishButton.d.ts +15 -0
- package/dist/publishing/admin/UnpublishButton.d.ts.map +1 -0
- package/dist/publishing/admin/UnpublishButton.js +90 -0
- package/dist/publishing/admin/UnpublishButton.js.map +1 -0
- package/dist/publishing/admin/publishing-client.d.ts +105 -0
- package/dist/publishing/admin/publishing-client.d.ts.map +1 -0
- package/dist/publishing/admin/publishing-client.js +139 -0
- package/dist/publishing/admin/publishing-client.js.map +1 -0
- package/dist/publishing/admin/schedule-state.d.ts +30 -0
- package/dist/publishing/admin/schedule-state.d.ts.map +1 -0
- package/dist/publishing/admin/schedule-state.js +39 -0
- package/dist/publishing/admin/schedule-state.js.map +1 -0
- package/dist/publishing/checks/alt-text.d.ts +17 -0
- package/dist/publishing/checks/alt-text.d.ts.map +1 -0
- package/dist/publishing/checks/alt-text.js +63 -0
- package/dist/publishing/checks/alt-text.js.map +1 -0
- package/dist/publishing/checks/heading-hierarchy.d.ts +11 -0
- package/dist/publishing/checks/heading-hierarchy.d.ts.map +1 -0
- package/dist/publishing/checks/heading-hierarchy.js +32 -0
- package/dist/publishing/checks/heading-hierarchy.js.map +1 -0
- package/dist/publishing/checks/index.d.ts +6 -0
- package/dist/publishing/checks/index.d.ts.map +1 -0
- package/dist/publishing/checks/index.js +13 -0
- package/dist/publishing/checks/index.js.map +1 -0
- package/dist/publishing/checks/link-labels.d.ts +9 -0
- package/dist/publishing/checks/link-labels.d.ts.map +1 -0
- package/dist/publishing/checks/link-labels.js +44 -0
- package/dist/publishing/checks/link-labels.js.map +1 -0
- package/dist/publishing/endpoints/admin.d.ts +19 -0
- package/dist/publishing/endpoints/admin.d.ts.map +1 -0
- package/dist/publishing/endpoints/admin.js +112 -0
- package/dist/publishing/endpoints/admin.js.map +1 -0
- package/dist/publishing/events.d.ts +16 -0
- package/dist/publishing/events.d.ts.map +1 -0
- package/dist/publishing/events.js +30 -0
- package/dist/publishing/events.js.map +1 -0
- package/dist/publishing/hooks/block-status-writes.d.ts +52 -0
- package/dist/publishing/hooks/block-status-writes.d.ts.map +1 -0
- package/dist/publishing/hooks/block-status-writes.js +242 -0
- package/dist/publishing/hooks/block-status-writes.js.map +1 -0
- package/dist/publishing/hooks/draft-writes.d.ts +32 -0
- package/dist/publishing/hooks/draft-writes.d.ts.map +1 -0
- package/dist/publishing/hooks/draft-writes.js +76 -0
- package/dist/publishing/hooks/draft-writes.js.map +1 -0
- package/dist/publishing/hooks/schedule-events.d.ts +26 -0
- package/dist/publishing/hooks/schedule-events.d.ts.map +1 -0
- package/dist/publishing/hooks/schedule-events.js +54 -0
- package/dist/publishing/hooks/schedule-events.js.map +1 -0
- package/dist/publishing/index.d.ts +35 -0
- package/dist/publishing/index.d.ts.map +1 -0
- package/dist/publishing/index.js +32 -0
- package/dist/publishing/index.js.map +1 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.d.ts +24 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.d.ts.map +1 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.js +114 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.js.map +1 -0
- package/dist/publishing/jobs/next-revalidate.d.ts +43 -0
- package/dist/publishing/jobs/next-revalidate.d.ts.map +1 -0
- package/dist/publishing/jobs/next-revalidate.js +42 -0
- package/dist/publishing/jobs/next-revalidate.js.map +1 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.d.ts +24 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.d.ts.map +1 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.js +136 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.js.map +1 -0
- package/dist/publishing/jobs/revalidate-on-publish.d.ts +24 -0
- package/dist/publishing/jobs/revalidate-on-publish.d.ts.map +1 -0
- package/dist/publishing/jobs/revalidate-on-publish.js +78 -0
- package/dist/publishing/jobs/revalidate-on-publish.js.map +1 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.d.ts +80 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.d.ts.map +1 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.js +116 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.js.map +1 -0
- package/dist/publishing/options.d.ts +100 -0
- package/dist/publishing/options.d.ts.map +1 -0
- package/dist/publishing/options.js +56 -0
- package/dist/publishing/options.js.map +1 -0
- package/dist/publishing/pipeline/index.d.ts +20 -0
- package/dist/publishing/pipeline/index.d.ts.map +1 -0
- package/dist/publishing/pipeline/index.js +88 -0
- package/dist/publishing/pipeline/index.js.map +1 -0
- package/dist/publishing/pipeline/steps/accessibility.d.ts +13 -0
- package/dist/publishing/pipeline/steps/accessibility.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/accessibility.js +37 -0
- package/dist/publishing/pipeline/steps/accessibility.js.map +1 -0
- package/dist/publishing/pipeline/steps/approval.d.ts +14 -0
- package/dist/publishing/pipeline/steps/approval.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/approval.js +54 -0
- package/dist/publishing/pipeline/steps/approval.js.map +1 -0
- package/dist/publishing/pipeline/steps/composition.d.ts +14 -0
- package/dist/publishing/pipeline/steps/composition.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/composition.js +63 -0
- package/dist/publishing/pipeline/steps/composition.js.map +1 -0
- package/dist/publishing/pipeline/steps/embargo.d.ts +12 -0
- package/dist/publishing/pipeline/steps/embargo.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/embargo.js +41 -0
- package/dist/publishing/pipeline/steps/embargo.js.map +1 -0
- package/dist/publishing/pipeline/steps/execute.d.ts +52 -0
- package/dist/publishing/pipeline/steps/execute.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/execute.js +161 -0
- package/dist/publishing/pipeline/steps/execute.js.map +1 -0
- package/dist/publishing/pipeline/steps/exist.d.ts +9 -0
- package/dist/publishing/pipeline/steps/exist.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/exist.js +31 -0
- package/dist/publishing/pipeline/steps/exist.js.map +1 -0
- package/dist/publishing/pipeline/steps/required-fields.d.ts +9 -0
- package/dist/publishing/pipeline/steps/required-fields.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/required-fields.js +63 -0
- package/dist/publishing/pipeline/steps/required-fields.js.map +1 -0
- package/dist/publishing/pipeline/types.d.ts +72 -0
- package/dist/publishing/pipeline/types.d.ts.map +1 -0
- package/dist/publishing/pipeline/types.js +2 -0
- package/dist/publishing/pipeline/types.js.map +1 -0
- package/dist/publishing/plugin.d.ts +4 -0
- package/dist/publishing/plugin.d.ts.map +1 -0
- package/dist/publishing/plugin.js +196 -0
- package/dist/publishing/plugin.js.map +1 -0
- package/dist/publishing/service.d.ts +149 -0
- package/dist/publishing/service.d.ts.map +1 -0
- package/dist/publishing/service.js +474 -0
- package/dist/publishing/service.js.map +1 -0
- package/dist/publishing/tools/actor.d.ts +32 -0
- package/dist/publishing/tools/actor.d.ts.map +1 -0
- package/dist/publishing/tools/actor.js +40 -0
- package/dist/publishing/tools/actor.js.map +1 -0
- package/dist/publishing/tools/descriptors.d.ts +26 -0
- package/dist/publishing/tools/descriptors.d.ts.map +1 -0
- package/dist/publishing/tools/descriptors.js +38 -0
- package/dist/publishing/tools/descriptors.js.map +1 -0
- package/dist/publishing/tools/get-publish-status.d.ts +12 -0
- package/dist/publishing/tools/get-publish-status.d.ts.map +1 -0
- package/dist/publishing/tools/get-publish-status.js +45 -0
- package/dist/publishing/tools/get-publish-status.js.map +1 -0
- package/dist/publishing/tools/index.d.ts +7 -0
- package/dist/publishing/tools/index.d.ts.map +1 -0
- package/dist/publishing/tools/index.js +7 -0
- package/dist/publishing/tools/index.js.map +1 -0
- package/dist/publishing/tools/publish.d.ts +14 -0
- package/dist/publishing/tools/publish.d.ts.map +1 -0
- package/dist/publishing/tools/publish.js +35 -0
- package/dist/publishing/tools/publish.js.map +1 -0
- package/dist/publishing/tools/rollback.d.ts +11 -0
- package/dist/publishing/tools/rollback.d.ts.map +1 -0
- package/dist/publishing/tools/rollback.js +98 -0
- package/dist/publishing/tools/rollback.js.map +1 -0
- package/dist/publishing/tools/schedule-publish.d.ts +20 -0
- package/dist/publishing/tools/schedule-publish.d.ts.map +1 -0
- package/dist/publishing/tools/schedule-publish.js +49 -0
- package/dist/publishing/tools/schedule-publish.js.map +1 -0
- package/dist/publishing/tools/unpublish.d.ts +14 -0
- package/dist/publishing/tools/unpublish.d.ts.map +1 -0
- package/dist/publishing/tools/unpublish.js +29 -0
- package/dist/publishing/tools/unpublish.js.map +1 -0
- package/dist/references/UsedOnPanel.d.ts +3 -0
- package/dist/references/UsedOnPanel.d.ts.map +1 -0
- package/dist/references/UsedOnPanel.js +47 -0
- package/dist/references/UsedOnPanel.js.map +1 -0
- package/dist/references/find.d.ts +46 -0
- package/dist/references/find.d.ts.map +1 -0
- package/dist/references/find.js +142 -0
- package/dist/references/find.js.map +1 -0
- package/dist/references/guards.d.ts +32 -0
- package/dist/references/guards.d.ts.map +1 -0
- package/dist/references/guards.js +76 -0
- package/dist/references/guards.js.map +1 -0
- package/dist/references/index.d.ts +11 -0
- package/dist/references/index.d.ts.map +1 -0
- package/dist/references/index.js +6 -0
- package/dist/references/index.js.map +1 -0
- package/dist/references/plugin.d.ts +51 -0
- package/dist/references/plugin.d.ts.map +1 -0
- package/dist/references/plugin.js +111 -0
- package/dist/references/plugin.js.map +1 -0
- package/dist/references/tools.d.ts +54 -0
- package/dist/references/tools.d.ts.map +1 -0
- package/dist/references/tools.js +124 -0
- package/dist/references/tools.js.map +1 -0
- package/dist/references/walk.d.ts +43 -0
- package/dist/references/walk.d.ts.map +1 -0
- package/dist/references/walk.js +214 -0
- package/dist/references/walk.js.map +1 -0
- package/dist/testing/anonymousAccess.d.ts +111 -0
- package/dist/testing/anonymousAccess.d.ts.map +1 -0
- package/dist/testing/anonymousAccess.js +185 -0
- package/dist/testing/anonymousAccess.js.map +1 -0
- package/dist/testing/describeAnonymousAccess.d.ts +26 -0
- package/dist/testing/describeAnonymousAccess.d.ts.map +1 -0
- package/dist/testing/describeAnonymousAccess.js +76 -0
- package/dist/testing/describeAnonymousAccess.js.map +1 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +9 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/content-hash.d.ts +31 -0
- package/dist/utils/content-hash.d.ts.map +1 -0
- package/dist/utils/content-hash.js +94 -0
- package/dist/utils/content-hash.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/relationships.d.ts +17 -0
- package/dist/utils/relationships.d.ts.map +1 -0
- package/dist/utils/relationships.js +26 -0
- package/dist/utils/relationships.js.map +1 -0
- package/dist/utils/sha256.d.ts +10 -0
- package/dist/utils/sha256.d.ts.map +1 -0
- package/dist/utils/sha256.js +16 -0
- package/dist/utils/sha256.js.map +1 -0
- package/dist/utils/zod-issues.d.ts +19 -0
- package/dist/utils/zod-issues.d.ts.map +1 -0
- package/dist/utils/zod-issues.js +22 -0
- package/dist/utils/zod-issues.js.map +1 -0
- package/package.json +183 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deniedEnvelope } from '../mcp/envelope.js';
|
|
3
|
+
import { findReferences } from './find.js';
|
|
4
|
+
import { referenceRefusal } from './guards.js';
|
|
5
|
+
/*
|
|
6
|
+
The MCP counterparts of the "Used on" panel and the delete guard.
|
|
7
|
+
|
|
8
|
+
Both read past access control, as the guard does, because the question is about
|
|
9
|
+
the database: a draft the caller cannot see still breaks when its image goes. So
|
|
10
|
+
by default only admins and editors may ask, the same line the audit tools draw,
|
|
11
|
+
since the answer names documents by title. A host can draw it elsewhere with
|
|
12
|
+
`canUse`.
|
|
13
|
+
*/
|
|
14
|
+
export const REFERENCE_TOOLS = {
|
|
15
|
+
findReferences: {
|
|
16
|
+
name: 'find_references',
|
|
17
|
+
description: 'Lists every document and global that references a document: an image, a person, a taxonomy term, or anything else that can be linked or embedded. Covers references inside blocks and rich text, which Payload itself cannot query, and both the published and draft state of each document. Use before replacing or deleting something shared, or to answer "where is this used?".',
|
|
18
|
+
},
|
|
19
|
+
canDelete: {
|
|
20
|
+
name: 'can_delete',
|
|
21
|
+
description: 'Whether a document can be deleted or moved to the trash without breaking another document that uses it. Returns canDelete, and when false, the documents that still reference it and the message an editor would see. Deleting is refused while anything references a guarded document, so ask this first and remove the references before trying.',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export const REFERENCE_TOOL_DESCRIPTORS = Object.values(REFERENCE_TOOLS);
|
|
25
|
+
const inputSchema = z.object({
|
|
26
|
+
collection: z.string().describe('The collection slug of the document, e.g. "media".'),
|
|
27
|
+
id: z.union([z.string(), z.number()]).describe('The document id.'),
|
|
28
|
+
});
|
|
29
|
+
const findInputSchema = inputSchema.extend({
|
|
30
|
+
limit: z
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.positive()
|
|
34
|
+
.max(200)
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Max documents to list. Default: 50.'),
|
|
37
|
+
});
|
|
38
|
+
function defaultCanUse(ctx) {
|
|
39
|
+
const roles = ctx.user?.roles ?? [];
|
|
40
|
+
return roles.includes('admin') || roles.includes('editor');
|
|
41
|
+
}
|
|
42
|
+
function summarize(entry) {
|
|
43
|
+
return {
|
|
44
|
+
collection: entry.collection,
|
|
45
|
+
id: entry.id,
|
|
46
|
+
label: entry.label,
|
|
47
|
+
...(entry.global ? { global: true } : {}),
|
|
48
|
+
insideBlock: entry.viaBlock,
|
|
49
|
+
paths: entry.references.map((reference) => reference.path),
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Refuses an unknown collection by name rather than scanning for nothing. */
|
|
53
|
+
function unknownCollection(payload, collection) {
|
|
54
|
+
const known = payload.config.collections.some((c) => c.slug === collection);
|
|
55
|
+
return known ? undefined : { error: `There is no collection "${collection}".` };
|
|
56
|
+
}
|
|
57
|
+
async function scan(deps, collection, id) {
|
|
58
|
+
return findReferences(deps.payload, { collection: collection, id }, deps.blocks ? { blocks: deps.blocks } : {});
|
|
59
|
+
}
|
|
60
|
+
export function createFindReferencesTool(deps) {
|
|
61
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
62
|
+
return {
|
|
63
|
+
...REFERENCE_TOOLS.findReferences,
|
|
64
|
+
inputSchema: findInputSchema,
|
|
65
|
+
handler: async (input, ctx) => {
|
|
66
|
+
if (!canUse(ctx))
|
|
67
|
+
return deniedEnvelope('Only admins and editors can look up where a document is used.');
|
|
68
|
+
const unknown = unknownCollection(deps.payload, input.collection);
|
|
69
|
+
if (unknown)
|
|
70
|
+
return unknown;
|
|
71
|
+
const found = await scan(deps, input.collection, input.id);
|
|
72
|
+
const limit = input.limit ?? 50;
|
|
73
|
+
return {
|
|
74
|
+
collection: input.collection,
|
|
75
|
+
id: input.id,
|
|
76
|
+
count: found.length,
|
|
77
|
+
insideBlocks: found.filter((entry) => entry.viaBlock).length,
|
|
78
|
+
documents: found.slice(0, limit).map(summarize),
|
|
79
|
+
...(found.length > limit ? { truncated: true } : {}),
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function createCanDeleteTool(deps) {
|
|
85
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
86
|
+
return {
|
|
87
|
+
...REFERENCE_TOOLS.canDelete,
|
|
88
|
+
inputSchema,
|
|
89
|
+
handler: async (input, ctx) => {
|
|
90
|
+
if (!canUse(ctx))
|
|
91
|
+
return deniedEnvelope('Only admins and editors can check whether a document can be deleted.');
|
|
92
|
+
const unknown = unknownCollection(deps.payload, input.collection);
|
|
93
|
+
if (unknown)
|
|
94
|
+
return unknown;
|
|
95
|
+
const found = await scan(deps, input.collection, input.id);
|
|
96
|
+
const guard = deps.guarded.get(input.collection);
|
|
97
|
+
if (found.length === 0) {
|
|
98
|
+
return {
|
|
99
|
+
collection: input.collection,
|
|
100
|
+
id: input.id,
|
|
101
|
+
canDelete: true,
|
|
102
|
+
guarded: guard !== undefined,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
collection: input.collection,
|
|
107
|
+
id: input.id,
|
|
108
|
+
/*
|
|
109
|
+
False even for an unguarded collection: the delete would go through, but
|
|
110
|
+
it would break the documents listed. `guarded` says which it is.
|
|
111
|
+
*/
|
|
112
|
+
canDelete: false,
|
|
113
|
+
guarded: guard !== undefined,
|
|
114
|
+
referencedBy: found.length,
|
|
115
|
+
documents: found.slice(0, 20).map(summarize),
|
|
116
|
+
message: referenceRefusal(found, {
|
|
117
|
+
...(guard?.noun ? { noun: guard.noun } : {}),
|
|
118
|
+
...(guard?.consequence ? { consequence: guard.consequence } : {}),
|
|
119
|
+
}),
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/references/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,cAAc,EAA2B,MAAM,WAAW,CAAA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AAA;YAE3B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;YAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;YAChD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvB,OAAO;oBACL,UAAU,EAAE,KAAK,CAAC,UAAU;oBAC5B,EAAE,EAAE,KAAK,CAAC,EAAE;oBACZ,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,KAAK,KAAK,SAAS;iBAC7B,CAAA;YACH,CAAC;YACD,OAAO;gBACL,UAAU,EAAE,KAAK,CAAC,UAAU;gBAC5B,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ;;;kBAGE;gBACF,SAAS,EAAE,KAAK;gBAChB,OAAO,EAAE,KAAK,KAAK,SAAS;gBAC5B,YAAY,EAAE,KAAK,CAAC,MAAM;gBAC1B,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;gBAC5C,OAAO,EAAE,gBAAgB,CAAC,KAAK,EAAE;oBAC/B,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC5C,GAAG,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAClE,CAAC;aACH,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Block, CollectionSlug, Field } from 'payload';
|
|
2
|
+
/** One reference, and enough to say where it is. */
|
|
3
|
+
export interface Reference {
|
|
4
|
+
/** The referenced document's id, as it appears in the data. */
|
|
5
|
+
id: number | string;
|
|
6
|
+
/** A human-readable path: `layout[3] › ImageHero › image`. */
|
|
7
|
+
path: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the reference is inside a block, and so has no foreign key.
|
|
10
|
+
* A `false` is one the database will null out on delete; a `true` is one it
|
|
11
|
+
* does not know exists.
|
|
12
|
+
*/
|
|
13
|
+
viaBlock: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ReferencesInOptions {
|
|
16
|
+
/** The collection whose documents are being looked for. */
|
|
17
|
+
collection: CollectionSlug;
|
|
18
|
+
/**
|
|
19
|
+
* Blocks to resolve by slug: the config's `blocks` registry, for
|
|
20
|
+
* `blockReferences` and Lexical block nodes, plus any extras. A `blocks`
|
|
21
|
+
* field's own blocks are always used and need not be listed.
|
|
22
|
+
*/
|
|
23
|
+
blocks?: readonly Block[] | ReadonlyMap<string, Block>;
|
|
24
|
+
}
|
|
25
|
+
/** Whether an upload or relationship field can point at `collection`. */
|
|
26
|
+
export declare function pointsAt(field: Field, collection: CollectionSlug): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Every reference to `collection` inside one document. Pure: it takes the field
|
|
29
|
+
* config and the data and touches nothing, so the whole decision is testable
|
|
30
|
+
* without a database.
|
|
31
|
+
*/
|
|
32
|
+
export declare function referencesIn(fields: readonly Field[], data: Record<string, unknown> | undefined, options: ReferencesInOptions): Reference[];
|
|
33
|
+
/** The references to one document, comparing ids as strings. */
|
|
34
|
+
export declare function referencesTo(fields: readonly Field[], data: Record<string, unknown> | undefined, options: ReferencesInOptions & {
|
|
35
|
+
id: number | string;
|
|
36
|
+
}): Reference[];
|
|
37
|
+
/**
|
|
38
|
+
* Whether a field tree could hold a reference to `collection` at all: a field
|
|
39
|
+
* pointing at it, a `blocks` field, or rich text. Decided from the config
|
|
40
|
+
* rather than from a list, so a collection that gains an image is covered.
|
|
41
|
+
*/
|
|
42
|
+
export declare function couldReference(fields: readonly Field[], collection: Collect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E,cAAc,GAAG,OAAO,CAW5F"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
function isNamed(field) {
|
|
2
|
+
return 'name' in field && typeof field.name === 'string';
|
|
3
|
+
}
|
|
4
|
+
function childrenOf(field) {
|
|
5
|
+
return 'fields' in field && Array.isArray(field.fields) ? field.fields : [];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The id out of a relationship value. An id at `depth: 0`, a populated object
|
|
9
|
+
* above it. `String({ id: 3 })` is `[object Object]`, which matches nothing and
|
|
10
|
+
* fails open, so the object case is handled rather than coerced.
|
|
11
|
+
*/
|
|
12
|
+
function idOf(value) {
|
|
13
|
+
if (typeof value === 'number' || typeof value === 'string')
|
|
14
|
+
return value;
|
|
15
|
+
if (value && typeof value === 'object' && 'id' in value) {
|
|
16
|
+
const { id } = value;
|
|
17
|
+
if (typeof id === 'number' || typeof id === 'string')
|
|
18
|
+
return id;
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Whether an upload or relationship field can point at `collection`. */
|
|
23
|
+
export function pointsAt(field, collection) {
|
|
24
|
+
if (field.type !== 'upload' && field.type !== 'relationship')
|
|
25
|
+
return false;
|
|
26
|
+
const { relationTo } = field;
|
|
27
|
+
return Array.isArray(relationTo) ? relationTo.includes(collection) : relationTo === collection;
|
|
28
|
+
}
|
|
29
|
+
/** Every id out of a relationship value that points at `collection`. */
|
|
30
|
+
function idsIn(value, collection) {
|
|
31
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
32
|
+
const ids = [];
|
|
33
|
+
for (const entry of entries) {
|
|
34
|
+
if (entry && typeof entry === 'object' && 'relationTo' in entry && 'value' in entry) {
|
|
35
|
+
// Polymorphic: counts only when it names the collection.
|
|
36
|
+
if (entry.relationTo !== collection)
|
|
37
|
+
continue;
|
|
38
|
+
const id = idOf(entry.value);
|
|
39
|
+
if (id !== undefined)
|
|
40
|
+
ids.push(id);
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const id = idOf(entry);
|
|
44
|
+
if (id !== undefined)
|
|
45
|
+
ids.push(id);
|
|
46
|
+
}
|
|
47
|
+
return ids;
|
|
48
|
+
}
|
|
49
|
+
/** The blocks a `blocks` field can hold, by slug. */
|
|
50
|
+
function blocksOf(field, registry) {
|
|
51
|
+
const own = new Map();
|
|
52
|
+
const { blocks, blockReferences } = field;
|
|
53
|
+
if (Array.isArray(blocks)) {
|
|
54
|
+
for (const block of blocks)
|
|
55
|
+
own.set(block.slug, block);
|
|
56
|
+
}
|
|
57
|
+
if (Array.isArray(blockReferences)) {
|
|
58
|
+
for (const ref of blockReferences) {
|
|
59
|
+
const block = typeof ref === 'string' ? registry.get(ref) : ref;
|
|
60
|
+
if (block)
|
|
61
|
+
own.set(block.slug, block);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return own;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Rich text: `upload` nodes, and `block` / `inlineBlock` nodes walked as the
|
|
68
|
+
* block they name. Shape-matched rather than typed against Lexical's node
|
|
69
|
+
* union, because the column was written by whatever editor version was current.
|
|
70
|
+
*/
|
|
71
|
+
function walkRichText(value, path, viaBlock, ctx) {
|
|
72
|
+
if (!value || typeof value !== 'object')
|
|
73
|
+
return;
|
|
74
|
+
if (Array.isArray(value)) {
|
|
75
|
+
for (const entry of value)
|
|
76
|
+
walkRichText(entry, path, viaBlock, ctx);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const node = value;
|
|
80
|
+
const embedded = node['type'] === 'upload'
|
|
81
|
+
? 'embedded upload'
|
|
82
|
+
: node['type'] === 'relationship'
|
|
83
|
+
? 'embedded link'
|
|
84
|
+
: undefined;
|
|
85
|
+
if (embedded && node['relationTo'] === ctx.collection) {
|
|
86
|
+
const id = idOf(node['value']);
|
|
87
|
+
if (id !== undefined)
|
|
88
|
+
ctx.out.push({ id, path: `${path} › ${embedded}`, viaBlock });
|
|
89
|
+
}
|
|
90
|
+
if (node['type'] === 'block' || node['type'] === 'inlineBlock') {
|
|
91
|
+
const fields = node['fields'];
|
|
92
|
+
const slug = typeof fields?.['blockType'] === 'string' ? fields['blockType'] : undefined;
|
|
93
|
+
const block = slug ? ctx.registry.get(slug) : undefined;
|
|
94
|
+
// An unknown block is skipped rather than guessed at, as in a `blocks` field.
|
|
95
|
+
if (block && fields)
|
|
96
|
+
walkFields(block.fields, fields, `${path} › ${block.slug}`, true, ctx);
|
|
97
|
+
}
|
|
98
|
+
for (const key of ['root', 'children']) {
|
|
99
|
+
if (key in node)
|
|
100
|
+
walkRichText(node[key], path, viaBlock, ctx);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function walkFields(fields, data, path, viaBlock, ctx) {
|
|
104
|
+
if (!data)
|
|
105
|
+
return;
|
|
106
|
+
for (const field of fields) {
|
|
107
|
+
// Unnamed wrappers hold their children under the *parent's* data object.
|
|
108
|
+
if (!isNamed(field)) {
|
|
109
|
+
if (field.type === 'tabs' && 'tabs' in field && Array.isArray(field.tabs)) {
|
|
110
|
+
for (const tab of field.tabs) {
|
|
111
|
+
const named = 'name' in tab && typeof tab.name === 'string' ? tab.name : undefined;
|
|
112
|
+
const nested = named ? data[named] : data;
|
|
113
|
+
const here = named ? `${path}${path ? ' › ' : ''}${named}` : path;
|
|
114
|
+
walkFields(tab.fields, nested, here, viaBlock, ctx);
|
|
115
|
+
}
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
walkFields(childrenOf(field), data, path, viaBlock, ctx);
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const value = data[field.name];
|
|
122
|
+
if (value === undefined || value === null)
|
|
123
|
+
continue;
|
|
124
|
+
const here = path ? `${path} › ${field.name}` : field.name;
|
|
125
|
+
if (pointsAt(field, ctx.collection)) {
|
|
126
|
+
for (const id of idsIn(value, ctx.collection))
|
|
127
|
+
ctx.out.push({ id, path: here, viaBlock });
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
switch (field.type) {
|
|
131
|
+
case 'richText':
|
|
132
|
+
walkRichText(value, here, viaBlock, ctx);
|
|
133
|
+
break;
|
|
134
|
+
case 'group':
|
|
135
|
+
walkFields(childrenOf(field), value, here, viaBlock, ctx);
|
|
136
|
+
break;
|
|
137
|
+
case 'array':
|
|
138
|
+
if (Array.isArray(value)) {
|
|
139
|
+
value.forEach((row, index) => {
|
|
140
|
+
walkFields(childrenOf(field), row, `${here}[${index}]`, viaBlock, ctx);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
break;
|
|
144
|
+
case 'blocks': {
|
|
145
|
+
if (!Array.isArray(value))
|
|
146
|
+
break;
|
|
147
|
+
const own = blocksOf(field, ctx.registry);
|
|
148
|
+
value.forEach((row, index) => {
|
|
149
|
+
const entry = row;
|
|
150
|
+
const slug = typeof entry['blockType'] === 'string' ? entry['blockType'] : undefined;
|
|
151
|
+
const block = slug ? (own.get(slug) ?? ctx.registry.get(slug)) : undefined;
|
|
152
|
+
/*
|
|
153
|
+
A row whose `blockType` names no known block is skipped rather than
|
|
154
|
+
guessed at: the config and the data disagree, and inventing a field
|
|
155
|
+
list for it would be the string-search failure by another route.
|
|
156
|
+
*/
|
|
157
|
+
if (!block)
|
|
158
|
+
return;
|
|
159
|
+
walkFields(block.fields, entry, `${here}[${index}] › ${block.slug}`, true, ctx);
|
|
160
|
+
});
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
default:
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function registryOf(blocks) {
|
|
169
|
+
if (!blocks)
|
|
170
|
+
return new Map();
|
|
171
|
+
if (blocks instanceof Map)
|
|
172
|
+
return blocks;
|
|
173
|
+
return new Map(blocks.map((block) => [block.slug, block]));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Every reference to `collection` inside one document. Pure: it takes the field
|
|
177
|
+
* config and the data and touches nothing, so the whole decision is testable
|
|
178
|
+
* without a database.
|
|
179
|
+
*/
|
|
180
|
+
export function referencesIn(fields, data, options) {
|
|
181
|
+
const out = [];
|
|
182
|
+
walkFields(fields, data, '', false, {
|
|
183
|
+
collection: options.collection,
|
|
184
|
+
registry: registryOf(options.blocks),
|
|
185
|
+
out,
|
|
186
|
+
});
|
|
187
|
+
return out;
|
|
188
|
+
}
|
|
189
|
+
/** The references to one document, comparing ids as strings. */
|
|
190
|
+
export function referencesTo(fields, data, options) {
|
|
191
|
+
return referencesIn(fields, data, options).filter((reference) => String(reference.id) === String(options.id));
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Whether a field tree could hold a reference to `collection` at all: a field
|
|
195
|
+
* pointing at it, a `blocks` field, or rich text. Decided from the config
|
|
196
|
+
* rather than from a list, so a collection that gains an image is covered.
|
|
197
|
+
*/
|
|
198
|
+
export function couldReference(fields, collection) {
|
|
199
|
+
for (const field of fields) {
|
|
200
|
+
if (pointsAt(field, collection))
|
|
201
|
+
return true;
|
|
202
|
+
if (field.type === 'blocks' || field.type === 'richText')
|
|
203
|
+
return true;
|
|
204
|
+
if (field.type === 'tabs' && 'tabs' in field && Array.isArray(field.tabs)) {
|
|
205
|
+
if (field.tabs.some((tab) => couldReference(tab.fields, collection)))
|
|
206
|
+
return true;
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (couldReference(childrenOf(field), collection))
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=walk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walk.js","sourceRoot":"","sources":["../../src/references/walk.ts"],"names":[],"mappings":"AAwEA,SAAS,OAAO,CAAC,KAAY;IAC3B,OAAO,MAAM,IAAI,KAAK,IAAI,OAAQ,KAA4B,CAAC,IAAI,KAAK,QAAQ,CAAA;AAClF,CAAC;AAED,SAAS,UAAU,CAAC,KAAY;IAC9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AAK,CAAC,IAAI,KAAK,UAAU;YAAE,OAAO,IAAI,CAAA;QACrE,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1E,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;gBAAE,OAAO,IAAI,CAAA;YACjF,SAAQ;QACV,CAAC;QACD,IAAI,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;YAAE,OAAO,IAAI,CAAA;IAChE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Access } from 'payload';
|
|
2
|
+
/** Where each collection sits. Site data: the buckets are the site's decision. */
|
|
3
|
+
export interface AnonymousAccessBuckets {
|
|
4
|
+
/**
|
|
5
|
+
* Collections a published page reads with nobody signed in, each with where
|
|
6
|
+
* it is read. Populated relationships count: Payload applies the related
|
|
7
|
+
* collection's own rule when it resolves one at depth, so an upload
|
|
8
|
+
* collection is here whenever a page shows an image.
|
|
9
|
+
*/
|
|
10
|
+
renderPath: Readonly<Record<string, string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Collections the internet must not read. A reason per entry is optional,
|
|
13
|
+
* and worth writing for anything that is not obvious.
|
|
14
|
+
*/
|
|
15
|
+
private: Readonly<Record<string, string>> | readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The same two buckets for globals. Omit it when the site has none; when it
|
|
18
|
+
* is given, every global must be in it.
|
|
19
|
+
*/
|
|
20
|
+
globals?: {
|
|
21
|
+
renderPath?: Readonly<Record<string, string>>;
|
|
22
|
+
private?: Readonly<Record<string, string>> | readonly string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/** The slice of a collection or global config this reads. */
|
|
26
|
+
export interface AccessCheckedEntity {
|
|
27
|
+
slug: string;
|
|
28
|
+
access?: {
|
|
29
|
+
read?: unknown;
|
|
30
|
+
} | undefined;
|
|
31
|
+
versions?: unknown;
|
|
32
|
+
}
|
|
33
|
+
/** The slice of a Payload config this reads — a `SanitizedConfig` satisfies it. */
|
|
34
|
+
export interface AccessCheckedConfig {
|
|
35
|
+
collections?: readonly AccessCheckedEntity[] | undefined;
|
|
36
|
+
globals?: readonly AccessCheckedEntity[] | undefined;
|
|
37
|
+
}
|
|
38
|
+
export type AccessFindingKind =
|
|
39
|
+
/** In the config and in no bucket. */
|
|
40
|
+
'unclassified'
|
|
41
|
+
/** In both buckets, or listed twice. */
|
|
42
|
+
| 'classified-twice'
|
|
43
|
+
/** In a bucket and not in the config: renamed, or removed. */
|
|
44
|
+
| 'not-in-config'
|
|
45
|
+
/** On the render path and refusing an anonymous read. */
|
|
46
|
+
| 'render-path-refused'
|
|
47
|
+
/** On the render path with drafts on, and answering a bare `true`. */
|
|
48
|
+
| 'drafts-unfiltered'
|
|
49
|
+
/** Private, and answering an anonymous read with `true` or a query. */
|
|
50
|
+
| 'private-readable';
|
|
51
|
+
export interface AccessFinding {
|
|
52
|
+
kind: AccessFindingKind;
|
|
53
|
+
/** `collection` or `global`. */
|
|
54
|
+
entity: 'collection' | 'global';
|
|
55
|
+
slug: string;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The anonymous request an access rule is handed.
|
|
60
|
+
*
|
|
61
|
+
* `req.payload` is a stub that throws on use rather than a mock that answers:
|
|
62
|
+
* a read rule that looks something up to decide is one this cannot evaluate
|
|
63
|
+
* without a database, and it should say so here rather than pass on a guess.
|
|
64
|
+
*/
|
|
65
|
+
export declare function anonymousAccessArgs(): Parameters<Access>[0];
|
|
66
|
+
/**
|
|
67
|
+
* What a read rule answers an anonymous request: `true`, `false`, a `where`
|
|
68
|
+
* query, or `undefined` when there is no rule at all.
|
|
69
|
+
*/
|
|
70
|
+
export declare function anonymousRead(entity: AccessCheckedEntity): Promise<unknown>;
|
|
71
|
+
/** Whether an entity keeps drafts, so an anonymous read must be narrowed to published. */
|
|
72
|
+
export declare function hasDrafts(entity: AccessCheckedEntity): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Why a render-path entity fails, or `undefined` when it passes.
|
|
75
|
+
*
|
|
76
|
+
* `undefined` is a failure here and not in `privateProblem`, deliberately. A
|
|
77
|
+
* collection with no `read` rule gets Payload's default, which requires a user
|
|
78
|
+
* — so leaving one off is the same outage as writing an editors-only rule, and
|
|
79
|
+
* reads in review as though no decision were needed.
|
|
80
|
+
*/
|
|
81
|
+
export declare function renderPathProblem(entity: AccessCheckedEntity): Promise<{
|
|
82
|
+
kind: AccessFindingKind;
|
|
83
|
+
message: string;
|
|
84
|
+
} | undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* Why a private entity fails, or `undefined` when it passes.
|
|
87
|
+
*
|
|
88
|
+
* `undefined` passes: Payload's default refuses an anonymous read, so a plugin
|
|
89
|
+
* collection with no rule of its own is already closed. What must not happen is
|
|
90
|
+
* `true`, or a query — a query is a successful read of some subset.
|
|
91
|
+
*/
|
|
92
|
+
export declare function privateProblem(entity: AccessCheckedEntity): Promise<{
|
|
93
|
+
kind: AccessFindingKind;
|
|
94
|
+
message: string;
|
|
95
|
+
} | undefined>;
|
|
96
|
+
/** Slugs of a bucket, whichever shape it was written in. */
|
|
97
|
+
export declare function bucketSlugs(bucket: Readonly<Record<string, string>> | readonly string[] | undefined): string[];
|
|
98
|
+
/**
|
|
99
|
+
* Every entity in exactly one bucket, and every bucket entry in the config.
|
|
100
|
+
*/
|
|
101
|
+
export declare function classificationFindings(entity: 'collection' | 'global', inConfig: readonly AccessCheckedEntity[], renderPath: readonly string[], closed: readonly string[]): AccessFinding[];
|
|
102
|
+
/** A Payload config, or the promise `buildConfig` returns. */
|
|
103
|
+
export type ConfigInput = AccessCheckedConfig | Promise<AccessCheckedConfig>;
|
|
104
|
+
/**
|
|
105
|
+
* Every finding for a config and its buckets, empty when it is sound.
|
|
106
|
+
*
|
|
107
|
+
* The pure form of `describeAnonymousAccess`, for a script or a test that
|
|
108
|
+
* wants the list rather than one test per collection.
|
|
109
|
+
*/
|
|
110
|
+
export declare function checkAnonymousAccess(config: ConfigInput, buckets: AnonymousAccessBuckets): Promise<AccessFinding[]>;
|
|
111
|
+
//# sourceMappingURL=anonymousAccess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anonymousAccess.d.ts","sourceRoot":"","sources":["../../src/testing/anonymousAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AA2BrC,kFAAkF;AAClF,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5C;;;OAGG;IACH,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,MAAM,EAAE,CAAA;IAC7D;;;OAGG;IACH,OAAO,CAAC,EAAE;QACR,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;QAC7C,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,MAAM,EAAE,CAAA;KAC/D,CAAA;CACF;AAED,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,SAAS,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,mFAAmF;AACnF,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,E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