@forumone/throughline 0.0.0 → 1.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +584 -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,242 @@
|
|
|
1
|
+
import { APIError } from 'payload';
|
|
2
|
+
import { isDraftWrite } from './draft-writes.js';
|
|
3
|
+
/**
|
|
4
|
+
* The trust boundary. This `beforeChange` hook rejects every update that
|
|
5
|
+
* changes whether a document is live, unless the request explicitly carries
|
|
6
|
+
* the `bypassPublishingServer` context flag (set by the pipeline's
|
|
7
|
+
* `executeStep`).
|
|
8
|
+
*
|
|
9
|
+
* Without this hook, the Payload MCP could let Claude flip a document to
|
|
10
|
+
* `published` directly, sidestepping every check the publishing server
|
|
11
|
+
* exists to enforce. With it, the only sanctioned path is the pipeline.
|
|
12
|
+
*
|
|
13
|
+
* Three details of Payload's update pipeline shape this:
|
|
14
|
+
*
|
|
15
|
+
* 1. `data` is the existing document merged with the incoming changes, so
|
|
16
|
+
* `_status` is present on essentially every update — an ordinary field
|
|
17
|
+
* edit on a published document arrives carrying `_status: 'published'`.
|
|
18
|
+
* The presence of `_status` therefore means nothing on its own.
|
|
19
|
+
*
|
|
20
|
+
* 2. Payload injects `data._status = 'draft'` into every `draft: true`
|
|
21
|
+
* update before this hook runs, so a draft save of a published document
|
|
22
|
+
* arrives looking like an unpublish. `createRecordDraftWritesHook`
|
|
23
|
+
* captures the operation's real `draft` flag to tell them apart; both
|
|
24
|
+
* hooks must be installed together.
|
|
25
|
+
*
|
|
26
|
+
* 3. `originalDoc` is the *latest version*, not the live document. Once any
|
|
27
|
+
* draft version exists on a published document, `originalDoc._status` is
|
|
28
|
+
* `'draft'` while the document is still live — so comparing against it
|
|
29
|
+
* reads a genuine unpublish as a harmless no-op.
|
|
30
|
+
*
|
|
31
|
+
* So the question asked here is narrow and concrete: **would this write
|
|
32
|
+
* change what the public sees?** A draft write never does. A non-draft
|
|
33
|
+
* write does when it takes a live document down, or when it puts content
|
|
34
|
+
* live — including promoting a pending draft, which leaves `_status` on
|
|
35
|
+
* `published` throughout and so cannot be caught by comparing statuses
|
|
36
|
+
* alone.
|
|
37
|
+
*
|
|
38
|
+
* One non-draft `published` write over a pending draft is harmless: one
|
|
39
|
+
* whose content is exactly what is already live. That is Payload's own
|
|
40
|
+
* "Revert to published", which reads the live document and writes it back
|
|
41
|
+
* unchanged to discard the draft — the public sees nothing new, so there is
|
|
42
|
+
* nothing for the pipeline to check.
|
|
43
|
+
*
|
|
44
|
+
* Moving a document to the trash is the same question asked a different way.
|
|
45
|
+
* On a collection with `trash: true` it is an update that sets `deletedAt`,
|
|
46
|
+
* and every read then leaves the document out — so trashing a live document
|
|
47
|
+
* takes it off the site. `_status` stays `published` throughout, so without
|
|
48
|
+
* its own check it passed as an ordinary edit, and the page came down with no
|
|
49
|
+
* policy check, no `unpublished` event and nothing to drop the cached copy.
|
|
50
|
+
* It is refused while the document is live: unpublish, then trash.
|
|
51
|
+
*/
|
|
52
|
+
export function createBlockStatusWritesHook() {
|
|
53
|
+
return async ({ collection, data, originalDoc, operation, context, req }) => {
|
|
54
|
+
if (operation !== 'update')
|
|
55
|
+
return data;
|
|
56
|
+
if (!carriesStatus(data))
|
|
57
|
+
return data;
|
|
58
|
+
if (isBypassed(context) || isBypassed(req?.context))
|
|
59
|
+
return data;
|
|
60
|
+
const nextStatus = data['_status'];
|
|
61
|
+
const previousStatus = originalDoc?.['_status'];
|
|
62
|
+
const id = originalDoc?.id;
|
|
63
|
+
if (movesToTrash(data, originalDoc)) {
|
|
64
|
+
const liveStatus = await resolveLiveStatus(req, collection?.slug, id, previousStatus);
|
|
65
|
+
if (liveStatus !== undefined && liveStatus !== 'published')
|
|
66
|
+
return data;
|
|
67
|
+
throw new APIError('This document is published. Unpublish it first, then move it to the trash.', 400);
|
|
68
|
+
}
|
|
69
|
+
// A draft save writes a version and leaves the live document alone.
|
|
70
|
+
//
|
|
71
|
+
// Mirror Payload's own `isSavingDraft`, which excludes `published`: a
|
|
72
|
+
// request asking for `draft: true` while setting `_status: 'published'`
|
|
73
|
+
// is a real publish, so `draft` cannot become a way around the pipeline.
|
|
74
|
+
if (nextStatus !== 'published' && isDraftWrite(req, collection?.slug, id)) {
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
77
|
+
if (nextStatus === 'published') {
|
|
78
|
+
// This puts content live. Allowed only when the document is already
|
|
79
|
+
// live *and* nothing is pending: a latest version of `published`
|
|
80
|
+
// means there is no newer draft for this write to promote. When a
|
|
81
|
+
// draft is pending, this is the publish and it belongs in the
|
|
82
|
+
// pipeline — even though the live status does not change.
|
|
83
|
+
if (previousStatus === 'published')
|
|
84
|
+
return data;
|
|
85
|
+
if (await restatesLiveContent(req, collection?.slug, id, data))
|
|
86
|
+
return data;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// This takes the live document down. Harmless only if nothing is
|
|
90
|
+
// live: a document that was never published, or is already down.
|
|
91
|
+
const liveStatus = await resolveLiveStatus(req, collection?.slug, id, previousStatus);
|
|
92
|
+
if (liveStatus !== undefined && liveStatus !== 'published')
|
|
93
|
+
return data;
|
|
94
|
+
}
|
|
95
|
+
// Payload's restore dialog offers "restore as published". Refusing it is
|
|
96
|
+
// right — it is a publish — but the generic message below is written for
|
|
97
|
+
// a developer, and this is the one refusal an editor reaches from the
|
|
98
|
+
// admin's own controls. Same decision, words they can act on.
|
|
99
|
+
if (nextStatus === 'published' && restoresFromTrash(data, originalDoc)) {
|
|
100
|
+
throw new APIError('Restore it as a draft, then publish it. Publishing is what runs the checks a live page needs.', 400);
|
|
101
|
+
}
|
|
102
|
+
throw new APIError('Direct writes to `_status` are not allowed. Use the publishing server (publish / unpublish / rollback) so the policy pipeline runs.', 400);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The live document's current `_status`, or `undefined` when it cannot be
|
|
107
|
+
* established — in which case the caller blocks the write.
|
|
108
|
+
*
|
|
109
|
+
* `originalDoc` is the latest version. A latest version of `published`
|
|
110
|
+
* means the live document is published, so that answer is taken directly.
|
|
111
|
+
* A latest version of `draft` is ambiguous — the document may still be live
|
|
112
|
+
* with a newer draft sitting on top of it — and only then is the published
|
|
113
|
+
* row read. Draft writes return before reaching this, so the admin's
|
|
114
|
+
* publish flow never pays for the query.
|
|
115
|
+
*/
|
|
116
|
+
async function resolveLiveStatus(req, collectionSlug, id, previousStatus) {
|
|
117
|
+
if (previousStatus === 'published')
|
|
118
|
+
return 'published';
|
|
119
|
+
if (!req?.payload || !collectionSlug || id === undefined || id === null)
|
|
120
|
+
return undefined;
|
|
121
|
+
try {
|
|
122
|
+
const live = await req.payload.findByID({
|
|
123
|
+
collection: collectionSlug,
|
|
124
|
+
id: id,
|
|
125
|
+
depth: 0,
|
|
126
|
+
overrideAccess: true,
|
|
127
|
+
// A trashed document is still the live row, and restoring one is a
|
|
128
|
+
// write about it. Without this every read leaves it out, the lookup
|
|
129
|
+
// throws, and "Restore as draft" was refused. Ignored where the
|
|
130
|
+
// collection has no trash.
|
|
131
|
+
trash: true,
|
|
132
|
+
// Share the request so this reads inside the open transaction.
|
|
133
|
+
req,
|
|
134
|
+
});
|
|
135
|
+
const status = live?.['_status'];
|
|
136
|
+
return typeof status === 'string' ? status : undefined;
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Fields that differ between two writes of the same content: the row's
|
|
144
|
+
* identity, its timestamps, and the status this hook is already judging.
|
|
145
|
+
*/
|
|
146
|
+
const NOT_CONTENT = new Set(['id', 'createdAt', 'updatedAt', '_status']);
|
|
147
|
+
/**
|
|
148
|
+
* Whether `data` is the live document's content, unchanged — so writing it
|
|
149
|
+
* would leave the public site exactly as it is.
|
|
150
|
+
*
|
|
151
|
+
* Compared as JSON so a `Date` and its ISO string agree, ignoring key order,
|
|
152
|
+
* and with a missing key equal to `null`, which is how Payload stores an
|
|
153
|
+
* empty field. Anything
|
|
154
|
+
* it cannot read counts as a change, and the caller blocks.
|
|
155
|
+
*/
|
|
156
|
+
async function restatesLiveContent(req, collectionSlug, id, data) {
|
|
157
|
+
if (!req?.payload || !collectionSlug || id === undefined || id === null)
|
|
158
|
+
return false;
|
|
159
|
+
let live;
|
|
160
|
+
try {
|
|
161
|
+
live = await req.payload.findByID({
|
|
162
|
+
collection: collectionSlug,
|
|
163
|
+
id: id,
|
|
164
|
+
depth: 0,
|
|
165
|
+
draft: false,
|
|
166
|
+
overrideAccess: true,
|
|
167
|
+
req,
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (!live || typeof live !== 'object')
|
|
174
|
+
return false;
|
|
175
|
+
if (live['_status'] !== 'published')
|
|
176
|
+
return false;
|
|
177
|
+
const next = asJSON(data);
|
|
178
|
+
const current = asJSON(live);
|
|
179
|
+
const keys = new Set([...Object.keys(next), ...Object.keys(current)]);
|
|
180
|
+
for (const key of keys) {
|
|
181
|
+
if (NOT_CONTENT.has(key))
|
|
182
|
+
continue;
|
|
183
|
+
if (!sameContent(next[key], current[key]))
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
function asJSON(value) {
|
|
189
|
+
return JSON.parse(JSON.stringify(value));
|
|
190
|
+
}
|
|
191
|
+
/** Deep equality over JSON values, ignoring object key order. */
|
|
192
|
+
function sameContent(a, b) {
|
|
193
|
+
a = a ?? null;
|
|
194
|
+
b = b ?? null;
|
|
195
|
+
if (a === b)
|
|
196
|
+
return true;
|
|
197
|
+
if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null)
|
|
198
|
+
return false;
|
|
199
|
+
if (Array.isArray(a) !== Array.isArray(b))
|
|
200
|
+
return false;
|
|
201
|
+
if (Array.isArray(a)) {
|
|
202
|
+
const other = b;
|
|
203
|
+
return a.length === other.length && a.every((item, i) => sameContent(item, other[i]));
|
|
204
|
+
}
|
|
205
|
+
const left = a;
|
|
206
|
+
const right = b;
|
|
207
|
+
const keys = new Set([...Object.keys(left), ...Object.keys(right)]);
|
|
208
|
+
for (const key of keys)
|
|
209
|
+
if (!sameContent(left[key], right[key]))
|
|
210
|
+
return false;
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Whether `_status` is present at all. Payload merges the stored document
|
|
215
|
+
* into `data`, so this is true for nearly every update — it only filters
|
|
216
|
+
* out collections without drafts.
|
|
217
|
+
*/
|
|
218
|
+
function carriesStatus(data) {
|
|
219
|
+
return typeof data === 'object' && data !== null && '_status' in data;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Whether this write puts the document in the trash: `deletedAt` set now and
|
|
223
|
+
* not before. Restoring clears it, and is judged by the status rules above
|
|
224
|
+
* like any other write.
|
|
225
|
+
*/
|
|
226
|
+
function movesToTrash(data, originalDoc) {
|
|
227
|
+
const next = data?.['deletedAt'];
|
|
228
|
+
const previous = originalDoc?.['deletedAt'];
|
|
229
|
+
return next != null && previous == null;
|
|
230
|
+
}
|
|
231
|
+
/** Whether this write takes the document out of the trash: `deletedAt` cleared. */
|
|
232
|
+
function restoresFromTrash(data, originalDoc) {
|
|
233
|
+
const next = data?.['deletedAt'];
|
|
234
|
+
const previous = originalDoc?.['deletedAt'];
|
|
235
|
+
return next == null && previous != null;
|
|
236
|
+
}
|
|
237
|
+
function isBypassed(context) {
|
|
238
|
+
if (!context || typeof context !== 'object')
|
|
239
|
+
return false;
|
|
240
|
+
return context['bypassPublishingServer'] === true;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=block-status-writes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-status-writes.js","sourceRoot":"","sources":["../../../src/publishing/hooks/block-status-writes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAC1E,IAAI,SAAS,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|
+
/**
|
|
3
|
+
* Records whether the update in flight is a draft write, so the
|
|
4
|
+
* status-write hook can tell a draft save apart from an unpublish.
|
|
5
|
+
*
|
|
6
|
+
* It has to be recorded here because `beforeChange` cannot work it out:
|
|
7
|
+
* Payload sets `data._status = 'draft'` for any `draft: true` update
|
|
8
|
+
* *before* calling the hook, whether or not the caller supplied it —
|
|
9
|
+
*
|
|
10
|
+
* const isSavingDraft = Boolean(draftArg && hasDraftsEnabled(config))
|
|
11
|
+
* && data._status !== 'published' && !publishAllLocales
|
|
12
|
+
* if (isSavingDraft) { data._status = 'draft' }
|
|
13
|
+
*
|
|
14
|
+
* so by the time `beforeChange` runs, saving a draft of a published
|
|
15
|
+
* document and unpublishing it look identical: `data._status` is `'draft'`
|
|
16
|
+
* and `originalDoc._status` is `'published'` in both cases.
|
|
17
|
+
*
|
|
18
|
+
* `beforeOperation` is the one place that sees the operation's own `draft`
|
|
19
|
+
* argument, and it sees it identically on the Local API, REST and GraphQL —
|
|
20
|
+
* unlike `req.query.draft`, which is only populated on the REST path.
|
|
21
|
+
* `beforeOperation` shares `req.context` with `beforeChange`, which is how
|
|
22
|
+
* the flag gets across.
|
|
23
|
+
*/
|
|
24
|
+
export declare function createRecordDraftWritesHook(): CollectionBeforeOperationHook;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the update in flight on this document is a draft write.
|
|
27
|
+
*
|
|
28
|
+
* Defaults to `false` when nothing was recorded, so a caller that installs
|
|
29
|
+
* the status-write hook without this one keeps the stricter behaviour.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isDraftWrite(req: Pick<PayloadRequest, 'context'> | undefined, collectionSlug: string | undefined, id: unknown): boolean;
|
|
32
|
+
//# sourceMappingURL=draft-writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-writes.d.ts","sourceRoot":"","sources":["../../../src/publishing/hooks/draft-writes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAM5E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,2BAA2B,IAAI,6BAA6B,CAW3E;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,GAAG,SAAS,EAChD,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,EAAE,EAAE,OAAO,GACV,OAAO,CAcT"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const DRAFT_WRITES_KEY = '__throughlinePublishingDraftWrites';
|
|
2
|
+
/**
|
|
3
|
+
* Records whether the update in flight is a draft write, so the
|
|
4
|
+
* status-write hook can tell a draft save apart from an unpublish.
|
|
5
|
+
*
|
|
6
|
+
* It has to be recorded here because `beforeChange` cannot work it out:
|
|
7
|
+
* Payload sets `data._status = 'draft'` for any `draft: true` update
|
|
8
|
+
* *before* calling the hook, whether or not the caller supplied it —
|
|
9
|
+
*
|
|
10
|
+
* const isSavingDraft = Boolean(draftArg && hasDraftsEnabled(config))
|
|
11
|
+
* && data._status !== 'published' && !publishAllLocales
|
|
12
|
+
* if (isSavingDraft) { data._status = 'draft' }
|
|
13
|
+
*
|
|
14
|
+
* so by the time `beforeChange` runs, saving a draft of a published
|
|
15
|
+
* document and unpublishing it look identical: `data._status` is `'draft'`
|
|
16
|
+
* and `originalDoc._status` is `'published'` in both cases.
|
|
17
|
+
*
|
|
18
|
+
* `beforeOperation` is the one place that sees the operation's own `draft`
|
|
19
|
+
* argument, and it sees it identically on the Local API, REST and GraphQL —
|
|
20
|
+
* unlike `req.query.draft`, which is only populated on the REST path.
|
|
21
|
+
* `beforeOperation` shares `req.context` with `beforeChange`, which is how
|
|
22
|
+
* the flag gets across.
|
|
23
|
+
*/
|
|
24
|
+
export function createRecordDraftWritesHook() {
|
|
25
|
+
return ({ args, operation, req }) => {
|
|
26
|
+
// `update` and `updateByID` both arrive as the `update` hook operation.
|
|
27
|
+
if (operation !== 'update')
|
|
28
|
+
return;
|
|
29
|
+
const updateArgs = args;
|
|
30
|
+
const slug = collectionSlug(args);
|
|
31
|
+
if (!slug)
|
|
32
|
+
return;
|
|
33
|
+
registry(req)[draftWriteKey(slug, updateArgs.id)] = updateArgs.draft === true;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Whether the update in flight on this document is a draft write.
|
|
38
|
+
*
|
|
39
|
+
* Defaults to `false` when nothing was recorded, so a caller that installs
|
|
40
|
+
* the status-write hook without this one keeps the stricter behaviour.
|
|
41
|
+
*/
|
|
42
|
+
export function isDraftWrite(req, collectionSlug, id) {
|
|
43
|
+
if (!req || !collectionSlug)
|
|
44
|
+
return false;
|
|
45
|
+
const entries = req.context?.[DRAFT_WRITES_KEY];
|
|
46
|
+
if (!entries)
|
|
47
|
+
return false;
|
|
48
|
+
// Keyed per document so a nested write to a different document during the
|
|
49
|
+
// same request cannot be mistaken for this one.
|
|
50
|
+
const scoped = entries[draftWriteKey(collectionSlug, id)];
|
|
51
|
+
if (scoped !== undefined)
|
|
52
|
+
return scoped;
|
|
53
|
+
// Bulk updates match by `where` and carry no id.
|
|
54
|
+
return entries[draftWriteKey(collectionSlug, undefined)] === true;
|
|
55
|
+
}
|
|
56
|
+
function draftWriteKey(collectionSlug, id) {
|
|
57
|
+
return `${collectionSlug}:${id === undefined || id === null ? '*' : String(id)}`;
|
|
58
|
+
}
|
|
59
|
+
function collectionSlug(args) {
|
|
60
|
+
const slug = args?.collection?.config
|
|
61
|
+
?.slug;
|
|
62
|
+
return typeof slug === 'string' ? slug : undefined;
|
|
63
|
+
}
|
|
64
|
+
function registry(req) {
|
|
65
|
+
// Payload always assigns `req.context`, but attach it if absent rather
|
|
66
|
+
// than writing the flag to an object nothing else can see.
|
|
67
|
+
if (!req.context) {
|
|
68
|
+
req.context = {};
|
|
69
|
+
}
|
|
70
|
+
const context = req.context;
|
|
71
|
+
if (!context[DRAFT_WRITES_KEY]) {
|
|
72
|
+
context[DRAFT_WRITES_KEY] = {};
|
|
73
|
+
}
|
|
74
|
+
return context[DRAFT_WRITES_KEY];
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=draft-writes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-writes.js","sourceRoot":"","sources":["../../../src/publishing/hooks/draft-writes.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG,oCAAoC,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE;QAClC,wEAAwE;QACxE,IAAI,SAAS,KAAK,QAAQ;YAAE,OAAM;QAElC,MAAM,UAAU,GAAG,IAAiD,CAAA;QACpE,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QACjC,IAAI,CAAC,IAAI;YAAE,OAAM;QAEjB,QAAQ,CAAC,GAAG,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,KAAK,IAAI,CAAA;IAC/E,CAAC,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC1B,GAAgD,EAChD,cAAkC,EAClC,EAAW;IAEX,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc;QAAE,OAAO,KAAK,CAAA;IACzC,MAAM,OAAO,GAAI,GAAG,CAAC,OAA+C,EAAE,CACpE,gBAAgB,CACiB,CAAA;IACnC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAE1B,0EAA0E;IAC1E,gDAAgD;IAChD,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,CAAA;IACzD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAA;IAEvC,iDAAiD;IACjD,OAAO,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,KAAK,IAAI,CAAA;AACnE,CAAC;AAED,SAAS,aAAa,CAAC,cAAsB,EAAE,EAAW;IACxD,OAAO,GAAG,cAAc,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;AAClF,CAAC;AAED,SAAS,cAAc,CAAC,IAAa;IACnC,MAAM,IAAI,GAAI,IAAyD,EAAE,UAAU,EAAE,MAAM;QACzF,EAAE,IAAI,CAAA;IACR,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AACpD,CAAC;AAED,SAAS,QAAQ,CAAC,GAAmB;IACnC,uEAAuE;IACvE,2DAA2D;IAC3D,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACjB,GAAG,CAAC,OAAO,GAAG,EAA+B,CAAA;IAC/C,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,CAAC,OAA6C,CAAA;IACjE,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,gBAAgB,CAAC,GAAG,EAA+B,CAAA;IAC7D,CAAC;IACD,OAAO,OAAO,CAAC,gBAAgB,CAAuB,CAAA;AACxD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CollectionAfterChangeHook } from 'payload';
|
|
2
|
+
import type { Inngest } from 'inngest';
|
|
3
|
+
/**
|
|
4
|
+
* Sends `content/page.scheduled` when a document's scheduled publish time is
|
|
5
|
+
* set to a new value, by whatever route — the admin's Schedule control, the
|
|
6
|
+
* `schedule_publish` MCP tool, a REST write.
|
|
7
|
+
*
|
|
8
|
+
* On the collection rather than in the service because the field is the
|
|
9
|
+
* source of truth and the service is only one way to write it. A schedule that
|
|
10
|
+
* could be stored without the event would be a date nothing wakes up for,
|
|
11
|
+
* which is the defect this replaces.
|
|
12
|
+
*
|
|
13
|
+
* Nothing is sent for a cleared or unchanged time. The run sleeping on a
|
|
14
|
+
* schedule re-reads the document when it wakes and publishes only if the
|
|
15
|
+
* stored time is still the one it was started for, so a cancellation needs no
|
|
16
|
+
* event of its own — and an event sent from a transaction that then rolls back
|
|
17
|
+
* wakes a run that finds nothing to do.
|
|
18
|
+
*
|
|
19
|
+
* `previousDoc` is the latest version, not the live document, which is the
|
|
20
|
+
* right comparison here: a schedule lives on the latest version.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createSendScheduledEventHook(args: {
|
|
23
|
+
inngest: Inngest;
|
|
24
|
+
scheduledPublishField: string;
|
|
25
|
+
}): CollectionAfterChangeHook;
|
|
26
|
+
//# sourceMappingURL=schedule-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-events.d.ts","sourceRoot":"","sources":["../../../src/publishing/hooks/schedule-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAGtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE;IACjD,OAAO,EAAE,OAAO,CAAA;IAChB,qBAAqB,EAAE,MAAM,CAAA;CAC9B,GAAG,yBAAyB,CA0B5B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { sendEventSafely } from '../events.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sends `content/page.scheduled` when a document's scheduled publish time is
|
|
4
|
+
* set to a new value, by whatever route — the admin's Schedule control, the
|
|
5
|
+
* `schedule_publish` MCP tool, a REST write.
|
|
6
|
+
*
|
|
7
|
+
* On the collection rather than in the service because the field is the
|
|
8
|
+
* source of truth and the service is only one way to write it. A schedule that
|
|
9
|
+
* could be stored without the event would be a date nothing wakes up for,
|
|
10
|
+
* which is the defect this replaces.
|
|
11
|
+
*
|
|
12
|
+
* Nothing is sent for a cleared or unchanged time. The run sleeping on a
|
|
13
|
+
* schedule re-reads the document when it wakes and publishes only if the
|
|
14
|
+
* stored time is still the one it was started for, so a cancellation needs no
|
|
15
|
+
* event of its own — and an event sent from a transaction that then rolls back
|
|
16
|
+
* wakes a run that finds nothing to do.
|
|
17
|
+
*
|
|
18
|
+
* `previousDoc` is the latest version, not the live document, which is the
|
|
19
|
+
* right comparison here: a schedule lives on the latest version.
|
|
20
|
+
*/
|
|
21
|
+
export function createSendScheduledEventHook(args) {
|
|
22
|
+
const field = args.scheduledPublishField;
|
|
23
|
+
return async ({ collection, doc, previousDoc, req }) => {
|
|
24
|
+
const next = instant(doc?.[field]);
|
|
25
|
+
if (next === null)
|
|
26
|
+
return doc;
|
|
27
|
+
if (next === instant(previousDoc?.[field]))
|
|
28
|
+
return doc;
|
|
29
|
+
const id = doc.id;
|
|
30
|
+
if (id === undefined || id === null)
|
|
31
|
+
return doc;
|
|
32
|
+
const warning = await sendEventSafely(args.inngest, {
|
|
33
|
+
name: 'content/page.scheduled',
|
|
34
|
+
data: {
|
|
35
|
+
collection: collection.slug,
|
|
36
|
+
id: String(id),
|
|
37
|
+
scheduledFor: new Date(next).toISOString(),
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
if (warning) {
|
|
41
|
+
// The schedule is saved; only the on-time wake-up is lost. The daily
|
|
42
|
+
// backstop still finds the document once it is overdue.
|
|
43
|
+
req.payload.logger.warn({ collection: collection.slug, id }, `[publishing] ${warning}`);
|
|
44
|
+
}
|
|
45
|
+
return doc;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function instant(value) {
|
|
49
|
+
if (typeof value !== 'string')
|
|
50
|
+
return null;
|
|
51
|
+
const ms = Date.parse(value);
|
|
52
|
+
return Number.isNaN(ms) ? null : ms;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=schedule-events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-events.js","sourceRoot":"","sources":["../../../src/publishing/hooks/schedule-events.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAG5C;IACC,MAAM,KAAK,GAAG,IAAI,CAAC,qBAAqB,CAAA;IAExC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,EAAE;QACrD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAA;QAClC,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,GAAG,CAAA;QAC7B,IAAI,IAAI,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;YAAE,OAAO,GAAG,CAAA;QAEtD,MAAM,EAAE,GAAI,GAAwB,CAAC,EAAE,CAAA;QACvC,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI;YAAE,OAAO,GAAG,CAAA;QAE/C,MAAM,OAAO,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE;YAClD,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE;gBACJ,UAAU,EAAE,UAAU,CAAC,IAAI;gBAC3B,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;gBACd,YAAY,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE;aAC3C;SACF,CAAC,CAAA;QACF,IAAI,OAAO,EAAE,CAAC;YACZ,qEAAqE;YACrE,wDAAwD;YACxD,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,gBAAgB,OAAO,EAAE,CAAC,CAAA;QACzF,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;AACH,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC1C,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC5B,OAAO,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAA;AACrC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export { publishingPlugin } from './plugin.js';
|
|
2
|
+
export type { AccessibilityCheck, AccessibilityIssue, ActiveApproval, ApprovalResolver, PublishableCollection, PublishingPluginOptions, ResolvedCollection, } from './options.js';
|
|
3
|
+
export type { PipelineContext, PipelineResult, PipelineStep, PipelineStepResult, } from './pipeline/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Server-side publishing API. Use these from host code — a custom endpoint,
|
|
6
|
+
* a scheduled job, a Server Action — to run the full policy pipeline as a
|
|
7
|
+
* given user, with no API key and correct audit attribution.
|
|
8
|
+
*/
|
|
9
|
+
export { getPublishStatus, getPublishingService, publishDocument, scheduleDocument, unpublishDocument, unscheduleDocument, } from './service.js';
|
|
10
|
+
export type { DocumentActionArgs, PublishOutcome, PublishRequest, PublishStatusOutcome, PublishingActor, PublishingService, ScheduleOutcome, ScheduleRequest, UnpublishOutcome, UnscheduleOutcome, } from './service.js';
|
|
11
|
+
/**
|
|
12
|
+
* Whether the update in flight on this document is a draft write — a "Save
|
|
13
|
+
* draft", or a tick of autosave — rather than one that changes what the
|
|
14
|
+
* public sees.
|
|
15
|
+
*
|
|
16
|
+
* `afterChange` cannot work this out for itself. Payload sets
|
|
17
|
+
* `data._status = 'draft'` on any `draft: true` update before the hooks
|
|
18
|
+
* run, and `previousDoc` is the latest *version* rather than the live
|
|
19
|
+
* document, so a draft save of a published page and an unpublish of it look
|
|
20
|
+
* the same from inside the hook. The publishing plugin already records the
|
|
21
|
+
* operation's real `draft` argument in `beforeOperation` for its own trust
|
|
22
|
+
* boundary; this exposes the same answer to host hooks.
|
|
23
|
+
*
|
|
24
|
+
* With autosave on, a host `afterChange` that drops a cache or sends a
|
|
25
|
+
* notification fires every few seconds of typing unless it asks this first.
|
|
26
|
+
*/
|
|
27
|
+
export { isDraftWrite } from './hooks/draft-writes.js';
|
|
28
|
+
export { BUILT_IN_ACCESSIBILITY_CHECKS, altTextCheck, headingHierarchyCheck, linkLabelsCheck, } from './checks/index.js';
|
|
29
|
+
export { revalidateOnPublishJob } from './jobs/revalidate-on-publish.js';
|
|
30
|
+
export { executeScheduledPublishesJob } from './jobs/execute-scheduled-publishes.js';
|
|
31
|
+
export { publishAtScheduledTimeJob } from './jobs/publish-at-scheduled-time.js';
|
|
32
|
+
export { createTagRevalidationHooks } from './jobs/revalidate-tag-hooks.js';
|
|
33
|
+
export type { CollectionTagHookOptions, GlobalTagHookOptions, RevalidateTagFn, TagRevalidationHooks, TagRevalidationOptions, TagSelector, } from './jobs/revalidate-tag-hooks.js';
|
|
34
|
+
export type { ExecuteScheduledPublishesOptions, PublishAtScheduledTimeOptions, RevalidateFn, RevalidateOnPublishOptions, RevalidatePathsInput, ScheduledCollectionConfig, ScheduledPublishRequest, ScheduledPublishResult, } from '../jobs/workflow-types.js';
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/publishing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAE5B;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAErB;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAGtD,OAAO,EACL,6BAA6B,EAC7B,YAAY,EACZ,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAC3E,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,GACZ,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,YAAY,EACZ,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export { publishingPlugin } from './plugin.js';
|
|
2
|
+
/**
|
|
3
|
+
* Server-side publishing API. Use these from host code — a custom endpoint,
|
|
4
|
+
* a scheduled job, a Server Action — to run the full policy pipeline as a
|
|
5
|
+
* given user, with no API key and correct audit attribution.
|
|
6
|
+
*/
|
|
7
|
+
export { getPublishStatus, getPublishingService, publishDocument, scheduleDocument, unpublishDocument, unscheduleDocument, } from './service.js';
|
|
8
|
+
/**
|
|
9
|
+
* Whether the update in flight on this document is a draft write — a "Save
|
|
10
|
+
* draft", or a tick of autosave — rather than one that changes what the
|
|
11
|
+
* public sees.
|
|
12
|
+
*
|
|
13
|
+
* `afterChange` cannot work this out for itself. Payload sets
|
|
14
|
+
* `data._status = 'draft'` on any `draft: true` update before the hooks
|
|
15
|
+
* run, and `previousDoc` is the latest *version* rather than the live
|
|
16
|
+
* document, so a draft save of a published page and an unpublish of it look
|
|
17
|
+
* the same from inside the hook. The publishing plugin already records the
|
|
18
|
+
* operation's real `draft` argument in `beforeOperation` for its own trust
|
|
19
|
+
* boundary; this exposes the same answer to host hooks.
|
|
20
|
+
*
|
|
21
|
+
* With autosave on, a host `afterChange` that drops a cache or sends a
|
|
22
|
+
* notification fires every few seconds of typing unless it asks this first.
|
|
23
|
+
*/
|
|
24
|
+
export { isDraftWrite } from './hooks/draft-writes.js';
|
|
25
|
+
// Built-in accessibility checks, which were `@forumone/throughline-publishing/checks`.
|
|
26
|
+
export { BUILT_IN_ACCESSIBILITY_CHECKS, altTextCheck, headingHierarchyCheck, linkLabelsCheck, } from './checks/index.js';
|
|
27
|
+
// Revalidation and scheduled publishing, as jobs for either adapter in `/jobs`.
|
|
28
|
+
export { revalidateOnPublishJob } from './jobs/revalidate-on-publish.js';
|
|
29
|
+
export { executeScheduledPublishesJob } from './jobs/execute-scheduled-publishes.js';
|
|
30
|
+
export { publishAtScheduledTimeJob } from './jobs/publish-at-scheduled-time.js';
|
|
31
|
+
export { createTagRevalidationHooks } from './jobs/revalidate-tag-hooks.js';
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/publishing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAmB9C;;;;GAIG;AACH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,cAAc,CAAA;AAerB;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAEtD,uFAAuF;AACvF,OAAO,EACL,6BAA6B,EAC7B,YAAY,EACZ,qBAAqB,EACrB,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAE1B,gFAAgF;AAChF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Job } from '../../jobs/types.js';
|
|
2
|
+
import { type JobOptions } from '../../jobs/options.js';
|
|
3
|
+
import type { ExecuteScheduledPublishesOptions } from '../../jobs/workflow-types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cron-driven scheduled publish executor. Every tick (default: every 5
|
|
6
|
+
* minutes) the function looks for documents in any of the configured
|
|
7
|
+
* collections whose latest version is still a draft and whose
|
|
8
|
+
* `scheduledPublishAt` has passed, and calls `options.publish` for each.
|
|
9
|
+
*
|
|
10
|
+
* `publishAtScheduledTimeJob` does the same job on time and without
|
|
11
|
+
* polling. Run alongside it, this is the backstop — set `overdueByMs` and a
|
|
12
|
+
* slow schedule, and it only ever finds a document whose event went missing.
|
|
13
|
+
*
|
|
14
|
+
* `publish` must go through the publishing pipeline — see the option's own
|
|
15
|
+
* documentation for the wiring. That is what makes a scheduled publish get the
|
|
16
|
+
* same composition / accessibility / approval checks as an interactive one.
|
|
17
|
+
*
|
|
18
|
+
* A refusal is logged and does not throw; the document stays at
|
|
19
|
+
* `_status: draft` until an admin intervenes or a later tick succeeds.
|
|
20
|
+
* Throwing would retry indefinitely on a permanent error (a composition
|
|
21
|
+
* failure, say), which is wrong for cron-style work.
|
|
22
|
+
*/
|
|
23
|
+
export declare function executeScheduledPublishesJob(options: JobOptions<ExecuteScheduledPublishesOptions>): Job;
|
|
24
|
+
//# sourceMappingURL=execute-scheduled-publishes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-scheduled-publishes.d.ts","sourceRoot":"","sources":["../../../src/publishing/jobs/execute-scheduled-publishes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAA;AAWpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,UAAU,CAAC,gCAAgC,CAAC,GACpD,GAAG,CAyGL"}
|