@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,474 @@
|
|
|
1
|
+
import { sendEventSafely } from './events.js';
|
|
2
|
+
import { resolveCollection } from './options.js';
|
|
3
|
+
import { runPreflightPipeline, runPublishPipeline } from './pipeline/index.js';
|
|
4
|
+
const SERVICE_SYMBOL = Symbol.for('@forumone/throughline/publishing-service');
|
|
5
|
+
/**
|
|
6
|
+
* The single implementation of publish / unpublish / status. Both the MCP
|
|
7
|
+
* tools and the admin endpoints call through here, so the two channels
|
|
8
|
+
* cannot drift: same pipeline, same audit shape, same trust boundary.
|
|
9
|
+
*/
|
|
10
|
+
export function createPublishingService(deps) {
|
|
11
|
+
const { payload, options, auditWriter, logger } = deps;
|
|
12
|
+
/*
|
|
13
|
+
`disableErrors`, and an empty object for a document that is not there.
|
|
14
|
+
|
|
15
|
+
Without it `findByID` throws `NotFound`, which happens before the pipeline
|
|
16
|
+
runs — so the `exist` step's `not-found` branch was unreachable from every
|
|
17
|
+
caller, and publishing a document that does not exist came back as a thrown
|
|
18
|
+
error rather than as the structured block the pipeline exists to return. The
|
|
19
|
+
step's own tests passed it an empty document and so never noticed; a real
|
|
20
|
+
Payload found it in one call.
|
|
21
|
+
|
|
22
|
+
An empty object rather than `null` because that is what `existStep` already
|
|
23
|
+
checks for: `Object.keys(ctx.document).length === 0`. The branch was written
|
|
24
|
+
for this and only ever needed a caller that could reach it.
|
|
25
|
+
*/
|
|
26
|
+
async function loadDocument(slug, id, actor) {
|
|
27
|
+
const document = await payload.findByID({
|
|
28
|
+
collection: slug,
|
|
29
|
+
id,
|
|
30
|
+
draft: true,
|
|
31
|
+
disableErrors: true,
|
|
32
|
+
...(actor.enforceAccessAs
|
|
33
|
+
? { user: actor.enforceAccessAs, overrideAccess: false }
|
|
34
|
+
: {}),
|
|
35
|
+
});
|
|
36
|
+
return (document ?? {});
|
|
37
|
+
}
|
|
38
|
+
/*
|
|
39
|
+
Whether the document is live — which the latest version cannot say.
|
|
40
|
+
|
|
41
|
+
`loadDocument` reads with `draft: true`, so a live page with a draft saved on
|
|
42
|
+
top comes back with `_status: 'draft'`, and unpublish refused it as "not
|
|
43
|
+
currently published" while it sat on the site. Scheduling a revision of a live
|
|
44
|
+
page creates exactly that state, so the gap stopped being rare. A latest
|
|
45
|
+
version of `published` settles it; only a `draft` needs the main row read,
|
|
46
|
+
which is the same reasoning as `resolveLiveStatus` in the trust boundary.
|
|
47
|
+
*/
|
|
48
|
+
async function liveStatus(slug, id, latest, actor) {
|
|
49
|
+
if (latest['_status'] === 'published')
|
|
50
|
+
return 'published';
|
|
51
|
+
const live = await payload.findByID({
|
|
52
|
+
collection: slug,
|
|
53
|
+
id,
|
|
54
|
+
draft: false,
|
|
55
|
+
depth: 0,
|
|
56
|
+
disableErrors: true,
|
|
57
|
+
...(actor.enforceAccessAs ? { user: actor.enforceAccessAs, overrideAccess: false } : {}),
|
|
58
|
+
});
|
|
59
|
+
return live?.['_status'];
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
async publish(request) {
|
|
63
|
+
const collection = resolveCollection(options, request.collection);
|
|
64
|
+
const document = await loadDocument(collection.slug, request.id, request.actor);
|
|
65
|
+
const result = await runPublishPipeline({
|
|
66
|
+
payload,
|
|
67
|
+
inngest: options.inngest,
|
|
68
|
+
options,
|
|
69
|
+
collection,
|
|
70
|
+
document,
|
|
71
|
+
documentId: request.id,
|
|
72
|
+
actor: toPipelineActor(request.actor),
|
|
73
|
+
...(request.meta ? { meta: request.meta } : {}),
|
|
74
|
+
});
|
|
75
|
+
await auditWriter({
|
|
76
|
+
actor: toAuditActor(request.actor),
|
|
77
|
+
action: 'publishing.publish',
|
|
78
|
+
mcpServer: 'publishing',
|
|
79
|
+
mcpTool: toolName('publish', request.actor),
|
|
80
|
+
targetCollection: request.collection,
|
|
81
|
+
targetId: request.id,
|
|
82
|
+
targetTitle: stringField(document, 'title') ?? request.id,
|
|
83
|
+
prompt: request.meta?.userPrompt,
|
|
84
|
+
reasoning: request.meta?.reasoning,
|
|
85
|
+
changesSummary: request.meta?.changesSummary,
|
|
86
|
+
success: result.success,
|
|
87
|
+
errorMessage: result.success ? undefined : result.reason,
|
|
88
|
+
});
|
|
89
|
+
if (result.warnings?.length) {
|
|
90
|
+
logger?.warn('Publish completed with warnings', {
|
|
91
|
+
collection: request.collection,
|
|
92
|
+
id: request.id,
|
|
93
|
+
warnings: result.warnings,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const warnings = result.warnings?.length ? { warnings: result.warnings } : {};
|
|
97
|
+
if (result.success) {
|
|
98
|
+
return {
|
|
99
|
+
published: true,
|
|
100
|
+
...(result.publishedAt ? { publishedAt: result.publishedAt } : {}),
|
|
101
|
+
...warnings,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
published: false,
|
|
106
|
+
...(result.failedAt ? { failedAt: result.failedAt } : {}),
|
|
107
|
+
...(result.reason ? { reason: result.reason } : {}),
|
|
108
|
+
...(result.code ? { code: result.code } : {}),
|
|
109
|
+
...(result.issues ? { issues: result.issues } : {}),
|
|
110
|
+
...(result.suggestion ? { suggestion: result.suggestion } : {}),
|
|
111
|
+
...warnings,
|
|
112
|
+
};
|
|
113
|
+
},
|
|
114
|
+
async unpublish(request) {
|
|
115
|
+
const collection = resolveCollection(options, request.collection);
|
|
116
|
+
const document = await loadDocument(collection.slug, request.id, request.actor);
|
|
117
|
+
// A document that is not there and one that is there and already a draft
|
|
118
|
+
// are different answers, and only one of them means "nothing to do".
|
|
119
|
+
if (Object.keys(document).length === 0) {
|
|
120
|
+
return { unpublished: false, reason: 'Document not found' };
|
|
121
|
+
}
|
|
122
|
+
if ((await liveStatus(collection.slug, request.id, document, request.actor)) !== 'published') {
|
|
123
|
+
return { unpublished: false, reason: 'Document is not currently published' };
|
|
124
|
+
}
|
|
125
|
+
// `overrideLock: false` for the same reason as the publish write: taking a
|
|
126
|
+
// live page down while somebody has it open in the admin should be a
|
|
127
|
+
// refusal, not a surprise. A lock held by the caller themselves passes.
|
|
128
|
+
// The schedule goes with it. Left in place, a past date on a document
|
|
129
|
+
// that is a draft again is exactly what the scheduled-publish backstop
|
|
130
|
+
// looks for, and the page would put itself back up within the day.
|
|
131
|
+
await payload.update({
|
|
132
|
+
collection: collection.slug,
|
|
133
|
+
id: request.id,
|
|
134
|
+
data: {
|
|
135
|
+
_status: 'draft',
|
|
136
|
+
...(document[collection.scheduledPublishField] != null
|
|
137
|
+
? { [collection.scheduledPublishField]: null }
|
|
138
|
+
: {}),
|
|
139
|
+
},
|
|
140
|
+
...(request.actor.enforceAccessAs
|
|
141
|
+
? { user: request.actor.enforceAccessAs, overrideAccess: false }
|
|
142
|
+
: {}),
|
|
143
|
+
overrideLock: false,
|
|
144
|
+
context: { bypassPublishingServer: true },
|
|
145
|
+
});
|
|
146
|
+
// Same rule as publish: the write has landed, so a failed emission is
|
|
147
|
+
// a warning, not a failure.
|
|
148
|
+
const slug = document[collection.slugField];
|
|
149
|
+
const warning = await sendEventSafely(options.inngest, {
|
|
150
|
+
name: 'content/page.unpublished',
|
|
151
|
+
data: {
|
|
152
|
+
collection: collection.slug,
|
|
153
|
+
id: request.id,
|
|
154
|
+
slug: typeof slug === 'string' ? slug : request.id,
|
|
155
|
+
unpublishedBy: request.actor.user?.id ?? 'system',
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
if (warning) {
|
|
159
|
+
logger?.warn('Unpublish completed with warnings', {
|
|
160
|
+
collection: request.collection,
|
|
161
|
+
id: request.id,
|
|
162
|
+
warnings: [warning],
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
await auditWriter({
|
|
166
|
+
actor: toAuditActor(request.actor),
|
|
167
|
+
action: 'publishing.unpublish',
|
|
168
|
+
mcpServer: 'publishing',
|
|
169
|
+
mcpTool: toolName('unpublish', request.actor),
|
|
170
|
+
targetCollection: request.collection,
|
|
171
|
+
targetId: request.id,
|
|
172
|
+
targetTitle: stringField(document, 'title') ?? request.id,
|
|
173
|
+
prompt: request.meta?.userPrompt,
|
|
174
|
+
reasoning: request.meta?.reasoning,
|
|
175
|
+
changesSummary: request.meta?.changesSummary,
|
|
176
|
+
success: true,
|
|
177
|
+
});
|
|
178
|
+
return { unpublished: true, ...(warning ? { warnings: [warning] } : {}) };
|
|
179
|
+
},
|
|
180
|
+
async schedule(request) {
|
|
181
|
+
const collection = resolveCollection(options, request.collection);
|
|
182
|
+
const publishAtMs = Date.parse(request.publishAt);
|
|
183
|
+
if (Number.isNaN(publishAtMs)) {
|
|
184
|
+
return { scheduled: false, reason: 'The scheduled time is not a date' };
|
|
185
|
+
}
|
|
186
|
+
if (publishAtMs <= Date.now()) {
|
|
187
|
+
return { scheduled: false, reason: 'The scheduled time must be in the future' };
|
|
188
|
+
}
|
|
189
|
+
const publishAt = new Date(publishAtMs).toISOString();
|
|
190
|
+
const document = await loadDocument(collection.slug, request.id, request.actor);
|
|
191
|
+
if (Object.keys(document).length === 0) {
|
|
192
|
+
return { scheduled: false, reason: 'Document not found' };
|
|
193
|
+
}
|
|
194
|
+
// Everything a publish would check, now, so an editor hears about a
|
|
195
|
+
// missing alt text while they are looking at the page rather than from a
|
|
196
|
+
// log line on the morning it was meant to go out. The same checks run
|
|
197
|
+
// again at the scheduled time; this is the early warning, not the gate.
|
|
198
|
+
const preflight = await runPreflightPipeline({
|
|
199
|
+
payload,
|
|
200
|
+
inngest: options.inngest,
|
|
201
|
+
options,
|
|
202
|
+
collection,
|
|
203
|
+
document,
|
|
204
|
+
documentId: request.id,
|
|
205
|
+
actor: toPipelineActor(request.actor),
|
|
206
|
+
...(request.meta ? { meta: request.meta } : {}),
|
|
207
|
+
});
|
|
208
|
+
const deferred = preflight.success
|
|
209
|
+
? { ok: true }
|
|
210
|
+
: deferUntilScheduledTime(preflight, document, collection.policyField, publishAtMs);
|
|
211
|
+
const audit = (success, errorMessage) => auditWriter({
|
|
212
|
+
actor: toAuditActor(request.actor),
|
|
213
|
+
action: 'publishing.schedule',
|
|
214
|
+
mcpServer: 'publishing',
|
|
215
|
+
mcpTool: toolName('schedule_publish', request.actor),
|
|
216
|
+
targetCollection: request.collection,
|
|
217
|
+
targetId: request.id,
|
|
218
|
+
targetTitle: stringField(document, 'title') ?? request.id,
|
|
219
|
+
prompt: request.meta?.userPrompt,
|
|
220
|
+
reasoning: request.meta?.reasoning,
|
|
221
|
+
changesSummary: `Scheduled publish for ${publishAt}`,
|
|
222
|
+
success,
|
|
223
|
+
errorMessage,
|
|
224
|
+
});
|
|
225
|
+
if (!deferred.ok) {
|
|
226
|
+
const block = deferred.block;
|
|
227
|
+
await audit(false, block.reason);
|
|
228
|
+
return {
|
|
229
|
+
scheduled: false,
|
|
230
|
+
...(block.failedAt ? { failedAt: block.failedAt } : {}),
|
|
231
|
+
...(block.reason ? { reason: block.reason } : {}),
|
|
232
|
+
...(block.code ? { code: block.code } : {}),
|
|
233
|
+
...(block.issues ? { issues: block.issues } : {}),
|
|
234
|
+
...(block.suggestion ? { suggestion: block.suggestion } : {}),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
/*
|
|
238
|
+
A draft write, so it lands on the latest version and leaves the live
|
|
239
|
+
document alone. That is what makes a revision of a live page schedulable
|
|
240
|
+
at all — a non-draft write of one field would be a publish of the pending
|
|
241
|
+
draft, which the trust boundary rightly refuses — and it is where the
|
|
242
|
+
publish at the scheduled time reads from, since publishing promotes the
|
|
243
|
+
latest version.
|
|
244
|
+
|
|
245
|
+
The plugin's `afterChange` hook sees the field change and sends
|
|
246
|
+
`content/page.scheduled`, so the wake-up is sent however the field was
|
|
247
|
+
set: here, from the admin, over the REST API.
|
|
248
|
+
*/
|
|
249
|
+
await payload.update({
|
|
250
|
+
collection: collection.slug,
|
|
251
|
+
id: request.id,
|
|
252
|
+
draft: true,
|
|
253
|
+
data: { [collection.scheduledPublishField]: publishAt },
|
|
254
|
+
overrideLock: false,
|
|
255
|
+
...(request.actor.enforceAccessAs
|
|
256
|
+
? { user: request.actor.enforceAccessAs, overrideAccess: false }
|
|
257
|
+
: {}),
|
|
258
|
+
});
|
|
259
|
+
await audit(true);
|
|
260
|
+
return {
|
|
261
|
+
scheduled: true,
|
|
262
|
+
scheduledFor: publishAt,
|
|
263
|
+
...(deferred.warning ? { warnings: [deferred.warning] } : {}),
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
async unschedule(request) {
|
|
267
|
+
const collection = resolveCollection(options, request.collection);
|
|
268
|
+
const document = await loadDocument(collection.slug, request.id, request.actor);
|
|
269
|
+
if (Object.keys(document).length === 0) {
|
|
270
|
+
return { unscheduled: false, reason: 'Document not found' };
|
|
271
|
+
}
|
|
272
|
+
const previous = document[collection.scheduledPublishField];
|
|
273
|
+
if (previous == null) {
|
|
274
|
+
return { unscheduled: false, reason: 'Nothing is scheduled' };
|
|
275
|
+
}
|
|
276
|
+
// No event. The run sleeping on this schedule re-reads the document when
|
|
277
|
+
// it wakes, finds the field empty, and ends without publishing.
|
|
278
|
+
await payload.update({
|
|
279
|
+
collection: collection.slug,
|
|
280
|
+
id: request.id,
|
|
281
|
+
draft: true,
|
|
282
|
+
data: { [collection.scheduledPublishField]: null },
|
|
283
|
+
overrideLock: false,
|
|
284
|
+
...(request.actor.enforceAccessAs
|
|
285
|
+
? { user: request.actor.enforceAccessAs, overrideAccess: false }
|
|
286
|
+
: {}),
|
|
287
|
+
});
|
|
288
|
+
// `publishing.schedule` with a summary that says which way, rather than a
|
|
289
|
+
// new action: the action list is a select on the audit collection, and a
|
|
290
|
+
// new value is a migration for every host.
|
|
291
|
+
await auditWriter({
|
|
292
|
+
actor: toAuditActor(request.actor),
|
|
293
|
+
action: 'publishing.schedule',
|
|
294
|
+
mcpServer: 'publishing',
|
|
295
|
+
mcpTool: toolName('unschedule_publish', request.actor),
|
|
296
|
+
targetCollection: request.collection,
|
|
297
|
+
targetId: request.id,
|
|
298
|
+
targetTitle: stringField(document, 'title') ?? request.id,
|
|
299
|
+
changesSummary: `Cancelled the scheduled publish for ${String(previous)}`,
|
|
300
|
+
success: true,
|
|
301
|
+
});
|
|
302
|
+
return { unscheduled: true };
|
|
303
|
+
},
|
|
304
|
+
async getStatus(request) {
|
|
305
|
+
const collection = resolveCollection(options, request.collection);
|
|
306
|
+
const document = await loadDocument(collection.slug, request.id, request.actor);
|
|
307
|
+
const result = await runPreflightPipeline({
|
|
308
|
+
payload,
|
|
309
|
+
inngest: options.inngest,
|
|
310
|
+
options,
|
|
311
|
+
collection,
|
|
312
|
+
document,
|
|
313
|
+
documentId: request.id,
|
|
314
|
+
actor: toPipelineActor(request.actor),
|
|
315
|
+
});
|
|
316
|
+
const updatedAt = stringField(document, 'updatedAt');
|
|
317
|
+
const publishedAt = stringField(document, collection.publishedAtField);
|
|
318
|
+
return {
|
|
319
|
+
status: stringField(document, '_status') ?? 'draft',
|
|
320
|
+
publishable: result.success,
|
|
321
|
+
...(result.failedAt ? { failedAt: result.failedAt } : {}),
|
|
322
|
+
...(result.reason ? { reason: result.reason } : {}),
|
|
323
|
+
...(result.code ? { code: result.code } : {}),
|
|
324
|
+
...(result.issues ? { issues: result.issues } : {}),
|
|
325
|
+
...(result.suggestion ? { suggestion: result.suggestion } : {}),
|
|
326
|
+
publishedAt: publishedAt ?? null,
|
|
327
|
+
hasUnpublishedChanges: Boolean(updatedAt && publishedAt && Date.parse(updatedAt) > Date.parse(publishedAt)),
|
|
328
|
+
};
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Whether a preflight block is one the scheduled time itself may resolve.
|
|
334
|
+
*
|
|
335
|
+
* Two are. An approval not granted *yet* is the ordinary case — schedule the
|
|
336
|
+
* post, get it approved, it goes out on the day — and refusing to schedule it
|
|
337
|
+
* would make an editor wait for the approver before they could pick a date. An
|
|
338
|
+
* embargo that ends before the scheduled time is the other, and one that ends
|
|
339
|
+
* after it is a refusal, because the publish would be refused then too.
|
|
340
|
+
*
|
|
341
|
+
* Both are the last two preflight steps, so every content check before them
|
|
342
|
+
* has already passed. The one thing lost is that an embargo block stops the
|
|
343
|
+
* pipeline before approval, so approval is not evaluated at all in that case;
|
|
344
|
+
* it will be at the scheduled time.
|
|
345
|
+
*/
|
|
346
|
+
function deferUntilScheduledTime(preflight, document, policyField, publishAtMs) {
|
|
347
|
+
if (preflight.code === 'approval-required') {
|
|
348
|
+
return {
|
|
349
|
+
ok: true,
|
|
350
|
+
warning: 'This document needs an approval that has not been granted yet. If it is not granted by the scheduled time, the publish will be refused.',
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (preflight.code === 'embargoed') {
|
|
354
|
+
const policy = document[policyField];
|
|
355
|
+
const until = typeof policy?.['embargoedUntil'] === 'string' ? Date.parse(policy['embargoedUntil']) : NaN;
|
|
356
|
+
if (!Number.isNaN(until) && until <= publishAtMs) {
|
|
357
|
+
return {
|
|
358
|
+
ok: true,
|
|
359
|
+
warning: 'The embargo ends before the scheduled time. Approval, if this document needs it, is checked when the schedule fires.',
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
ok: false,
|
|
364
|
+
block: {
|
|
365
|
+
...preflight,
|
|
366
|
+
reason: `${preflight.reason ?? 'Embargoed'}, which is after the scheduled time`,
|
|
367
|
+
suggestion: 'Schedule it for after the embargo ends, or change the embargo.',
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
return { ok: false, block: preflight };
|
|
372
|
+
}
|
|
373
|
+
function toPipelineActor(actor) {
|
|
374
|
+
return {
|
|
375
|
+
user: actor.user ?? null,
|
|
376
|
+
apiKeyName: actor.apiKeyName ?? '',
|
|
377
|
+
...(actor.enforceAccessAs ? { enforceAccessAs: actor.enforceAccessAs } : {}),
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Attribution: a call carrying a real user is a user action, whoever
|
|
382
|
+
* transported it. An admin publish records the editor, not a service key.
|
|
383
|
+
*/
|
|
384
|
+
function toAuditActor(actor) {
|
|
385
|
+
return {
|
|
386
|
+
type: actor.user ? 'user' : 'system',
|
|
387
|
+
userId: actor.user?.id,
|
|
388
|
+
userName: actor.user?.name,
|
|
389
|
+
apiKeyName: actor.apiKeyName,
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function toolName(tool, actor) {
|
|
393
|
+
return actor.channel === 'admin' ? `admin:${tool}` : tool;
|
|
394
|
+
}
|
|
395
|
+
function stringField(doc, name) {
|
|
396
|
+
const value = doc[name];
|
|
397
|
+
return typeof value === 'string' ? value : undefined;
|
|
398
|
+
}
|
|
399
|
+
/** Attaches the service to the Payload instance so host code can find it. */
|
|
400
|
+
export function attachPublishingService(payload, service) {
|
|
401
|
+
Object.defineProperty(payload, SERVICE_SYMBOL, {
|
|
402
|
+
value: service,
|
|
403
|
+
enumerable: false,
|
|
404
|
+
writable: false,
|
|
405
|
+
configurable: true,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Returns the publishing service attached to this Payload instance.
|
|
410
|
+
*
|
|
411
|
+
* Use this (or the `publishDocument` / `unpublishDocument` /
|
|
412
|
+
* `getPublishStatus` helpers below) from host code — a custom endpoint, a
|
|
413
|
+
* job, a Server Action — to publish through the full policy pipeline as a
|
|
414
|
+
* given user. No API key, and the audit event records that user.
|
|
415
|
+
*/
|
|
416
|
+
export function getPublishingService(payload) {
|
|
417
|
+
const service = payload[SERVICE_SYMBOL];
|
|
418
|
+
if (!service) {
|
|
419
|
+
throw new Error('Publishing service not found on this Payload instance. Add publishingPlugin() to your Payload config — the service is attached during onInit.');
|
|
420
|
+
}
|
|
421
|
+
return service;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Publishes a document through the full pipeline as `user`. Rejects if that
|
|
425
|
+
* user lacks update access on the collection.
|
|
426
|
+
*/
|
|
427
|
+
export function publishDocument(args) {
|
|
428
|
+
return getPublishingService(args.payload).publish(toRequest(args));
|
|
429
|
+
}
|
|
430
|
+
/** Reverts a published document to draft as `user`. */
|
|
431
|
+
export function unpublishDocument(args) {
|
|
432
|
+
return getPublishingService(args.payload).unpublish(toRequest(args));
|
|
433
|
+
}
|
|
434
|
+
/** Schedules a document to publish at `publishAt`, as `user`. */
|
|
435
|
+
export function scheduleDocument(args) {
|
|
436
|
+
return getPublishingService(args.payload).schedule({ ...toRequest(args), publishAt: args.publishAt });
|
|
437
|
+
}
|
|
438
|
+
/** Cancels a document's scheduled publish, as `user`. */
|
|
439
|
+
export function unscheduleDocument(args) {
|
|
440
|
+
return getPublishingService(args.payload).unschedule(toRequest(args));
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Runs every check except the write and reports whether the document would
|
|
444
|
+
* publish. Mutates nothing.
|
|
445
|
+
*/
|
|
446
|
+
export function getPublishStatus(args) {
|
|
447
|
+
return getPublishingService(args.payload).getStatus(toRequest(args));
|
|
448
|
+
}
|
|
449
|
+
function toRequest(args) {
|
|
450
|
+
return {
|
|
451
|
+
collection: args.collection,
|
|
452
|
+
id: args.id,
|
|
453
|
+
actor: {
|
|
454
|
+
user: toAuthenticatedUser(args.user),
|
|
455
|
+
enforceAccessAs: args.user,
|
|
456
|
+
channel: 'admin',
|
|
457
|
+
},
|
|
458
|
+
...(args.meta ? { meta: args.meta } : {}),
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
/** Narrows a Payload user document to the audit-log actor shape. */
|
|
462
|
+
export function toAuthenticatedUser(user) {
|
|
463
|
+
if (!user)
|
|
464
|
+
return null;
|
|
465
|
+
const raw = user;
|
|
466
|
+
return {
|
|
467
|
+
id: String(raw['id']),
|
|
468
|
+
email: String(raw['email'] ?? ''),
|
|
469
|
+
name: String(raw['name'] ?? raw['email'] ?? raw['id']),
|
|
470
|
+
roles: Array.isArray(raw['roles']) ? raw['roles'] : [],
|
|
471
|
+
groups: Array.isArray(raw['groups']) ? raw['groups'] : [],
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/publishing/service.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAgC,iBAAiB,EAAE,MAA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AC;YACpC,eAAe,EAAE,IAAI,CAAC,IAAI;YAC1B,OAAO,EAAE,OAAO;SACjB;QACD,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAA;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,MAAM,GAAG,GAAG,IAA0C,CAAA;IACtD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACjC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,OAAO,CAAc,CAAC,CAAC,CAAC,EAAE;QACpE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,QAAQ,CAAc,CAAC,CAAC,CAAC,EAAE;KACxE,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AuthenticatedUser, McpToolContext } from '../../plugin-contract/mcp.js';
|
|
2
|
+
import type { PublishingActor } from '../service.js';
|
|
3
|
+
/** A tool result that refused before doing anything. */
|
|
4
|
+
export interface ActorRefusal {
|
|
5
|
+
error: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A publishing actor that is known to carry an identity.
|
|
9
|
+
*
|
|
10
|
+
* Both fields are non-optional, which is the invariant the guard establishes
|
|
11
|
+
* and is worth having in the type rather than only in a comment: `user` is
|
|
12
|
+
* what the audit row attributes the action to, and `enforceAccessAs` is what
|
|
13
|
+
* makes the write consult collection access. A `PublishingActor` with either
|
|
14
|
+
* absent is exactly the actor the five tools used to build, so narrowing here
|
|
15
|
+
* means the old shape no longer typechecks at these call sites.
|
|
16
|
+
*/
|
|
17
|
+
export interface EnforcedPublishingActor extends PublishingActor {
|
|
18
|
+
user: AuthenticatedUser;
|
|
19
|
+
enforceAccessAs: NonNullable<PublishingActor['enforceAccessAs']>;
|
|
20
|
+
/** Definite, because `McpToolContext` types it as a required string. */
|
|
21
|
+
apiKeyName: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The actor to run a publishing call as, or a refusal to return unchanged.
|
|
25
|
+
*
|
|
26
|
+
* Callers narrow on `'error' in resolved`. Returning the envelope rather than
|
|
27
|
+
* throwing matches every other gated tool in the suite — `query-audit.ts`'s
|
|
28
|
+
* `deniedEnvelope`, `trigger-sync.ts`, `respond-to-approval.ts` — so a refused
|
|
29
|
+
* MCP call reads as a refusal to the model rather than as a server fault.
|
|
30
|
+
*/
|
|
31
|
+
export declare function resolvePublishingActor(ctx: Pick<McpToolContext, 'user' | 'apiKeyName'>, channel?: 'mcp'): EnforcedPublishingActor | ActorRefusal;
|
|
32
|
+
//# sourceMappingURL=actor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../../src/publishing/tools/actor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AA8CpD,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,IAAI,EAAE,iBAAiB,CAAA;IACvB,eAAe,EAAE,WAAW,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAChE,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,CAAC,EAChD,OAAO,GAAE,KAAa,GACrB,uBAAuB,GAAG,YAAY,CAgCxC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The actor to run a publishing call as, or a refusal to return unchanged.
|
|
3
|
+
*
|
|
4
|
+
* Callers narrow on `'error' in resolved`. Returning the envelope rather than
|
|
5
|
+
* throwing matches every other gated tool in the suite — `query-audit.ts`'s
|
|
6
|
+
* `deniedEnvelope`, `trigger-sync.ts`, `respond-to-approval.ts` — so a refused
|
|
7
|
+
* MCP call reads as a refusal to the model rather than as a server fault.
|
|
8
|
+
*/
|
|
9
|
+
export function resolvePublishingActor(ctx, channel = 'mcp') {
|
|
10
|
+
if (!ctx.user) {
|
|
11
|
+
return {
|
|
12
|
+
error: 'Must be authenticated to use the publishing tools. An API key alone does not carry an ' +
|
|
13
|
+
'identity to enforce collection access against.',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
user: ctx.user,
|
|
18
|
+
apiKeyName: ctx.apiKeyName,
|
|
19
|
+
channel,
|
|
20
|
+
/*
|
|
21
|
+
The whole point. Without this the service runs at `overrideAccess: true`
|
|
22
|
+
and the collection's `update` rule — the thing that distinguishes an editor
|
|
23
|
+
from an approver — is never consulted.
|
|
24
|
+
|
|
25
|
+
One cast, and it is the kind audit 02 F-06 calls the acceptable shape: the
|
|
26
|
+
two types genuinely disagree and the comment says how. `AuthenticatedUser`
|
|
27
|
+
is this package's local shape — `{ id, email, name, roles, groups }` — while
|
|
28
|
+
`TypedUser` is generated from the consuming app's own `users` collection.
|
|
29
|
+
They describe the same row, but only the app that owns that collection can
|
|
30
|
+
say so, and this package may not import from `apps/` (see the boundary rule
|
|
31
|
+
in the repository's CLAUDE.md, enforced by `pnpm check:boundary`).
|
|
32
|
+
|
|
33
|
+
What the value is used for downstream bounds the risk: Payload passes it to
|
|
34
|
+
`update`/`findByID` as `user`, and the access functions read `id` and
|
|
35
|
+
`roles` off it. Both are present and both are the same type on either side.
|
|
36
|
+
*/
|
|
37
|
+
enforceAccessAs: ctx.user,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=actor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../../src/publishing/tools/actor.ts"],"names":[],"mappings":"AAqEA;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,GAAgD,EAChD,UAAiB,KAAK;IAEtB,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACd,OAAO;YACL,KAAK,EACH,wFAAwF;gBACxF,gDAAgD;SACnD,CAAA;IACH,CAAC;IAED,OAAO;QACL,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,UAAU,EAAE,GAAG,CAAC,UAAU;QAC1B,OAAO;QACP;;;;;;;;;;;;;;;;UAgBE;QACF,eAAe,EAAE,GAAG,CAAC,IAAkE;KACxF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { McpToolDescriptor } from '../../mcp/collector.js';
|
|
2
|
+
export declare const PUBLISHING_TOOLS: {
|
|
3
|
+
readonly publish: {
|
|
4
|
+
readonly name: "publish";
|
|
5
|
+
readonly description: "Publishes a draft document. Runs the full publish pipeline: composition, accessibility, required-field, embargo, and approval checks. Returns success with the publish timestamp, or a specific failedAt step with reason / suggestion when something blocks the publish.";
|
|
6
|
+
};
|
|
7
|
+
readonly unpublish: {
|
|
8
|
+
readonly name: "unpublish";
|
|
9
|
+
readonly description: "Unpublishes a published document by reverting it to draft. Use when content needs to be removed from the public site without deleting it. Fires content/page.unpublished so revalidation and integrations can react.";
|
|
10
|
+
};
|
|
11
|
+
readonly schedulePublish: {
|
|
12
|
+
readonly name: "schedule_publish";
|
|
13
|
+
readonly description: "Schedules a future publish. Validates the document would currently pass the preflight pipeline (composition, accessibility, required fields, embargo, approval), then stores `scheduledPublishAt` on the document. The framework's workflow runner picks up the schedule and executes the full publish pipeline at that time.";
|
|
14
|
+
};
|
|
15
|
+
readonly getPublishStatus: {
|
|
16
|
+
readonly name: "get_publish_status";
|
|
17
|
+
readonly description: "Returns the current publishability of a document without actually publishing. Reports current status, whether unpublished changes exist, the last publish timestamp, and a preflight result indicating whether `publish` would currently succeed. Read-only; no audit record is written.";
|
|
18
|
+
};
|
|
19
|
+
readonly rollback: {
|
|
20
|
+
readonly name: "rollback";
|
|
21
|
+
readonly description: "Rolls a document back to a prior version from Payload's version history. The restored content lands as a fresh draft; call `publish` afterwards if you want it live again. Audits the rollback under publishing.rollback.";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/** Every tool this server contributes, for the collector. */
|
|
25
|
+
export declare const PUBLISHING_TOOL_DESCRIPTORS: readonly McpToolDescriptor[];
|
|
26
|
+
//# sourceMappingURL=descriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptors.d.ts","sourceRoot":"","sources":["../../../src/publishing/tools/descriptors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAe/D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CA0ByB,CAAA;AAEtD,6DAA6D;AAC7D,eAAO,MAAM,2BAA2B,EAAE,SAAS,iBAAiB,EACnC,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
This server's tools, by name and description, knowable without a Payload.
|
|
3
|
+
|
|
4
|
+
`@payloadcms/plugin-mcp` reads exactly these two fields while the host's config
|
|
5
|
+
is being built, to generate one per-key checkbox per tool — and gates every call
|
|
6
|
+
on the checkbox matching the tool's name. The handlers cannot exist that early,
|
|
7
|
+
because each closes over `payload`, the publishing service and the audit writer.
|
|
8
|
+
So the plugin declares from here as the config builds, and binds handlers at
|
|
9
|
+
`onInit`.
|
|
10
|
+
|
|
11
|
+
The factories below spread these, so a description edited here is the one the
|
|
12
|
+
checkbox and the MCP client both show, and the two cannot drift.
|
|
13
|
+
*/
|
|
14
|
+
export const PUBLISHING_TOOLS = {
|
|
15
|
+
publish: {
|
|
16
|
+
name: 'publish',
|
|
17
|
+
description: 'Publishes a draft document. Runs the full publish pipeline: composition, accessibility, required-field, embargo, and approval checks. Returns success with the publish timestamp, or a specific failedAt step with reason / suggestion when something blocks the publish.',
|
|
18
|
+
},
|
|
19
|
+
unpublish: {
|
|
20
|
+
name: 'unpublish',
|
|
21
|
+
description: 'Unpublishes a published document by reverting it to draft. Use when content needs to be removed from the public site without deleting it. Fires content/page.unpublished so revalidation and integrations can react.',
|
|
22
|
+
},
|
|
23
|
+
schedulePublish: {
|
|
24
|
+
name: 'schedule_publish',
|
|
25
|
+
description: "Schedules a future publish. Validates the document would currently pass the preflight pipeline (composition, accessibility, required fields, embargo, approval), then stores `scheduledPublishAt` on the document. The framework's workflow runner picks up the schedule and executes the full publish pipeline at that time.",
|
|
26
|
+
},
|
|
27
|
+
getPublishStatus: {
|
|
28
|
+
name: 'get_publish_status',
|
|
29
|
+
description: 'Returns the current publishability of a document without actually publishing. Reports current status, whether unpublished changes exist, the last publish timestamp, and a preflight result indicating whether `publish` would currently succeed. Read-only; no audit record is written.',
|
|
30
|
+
},
|
|
31
|
+
rollback: {
|
|
32
|
+
name: 'rollback',
|
|
33
|
+
description: "Rolls a document back to a prior version from Payload's version history. The restored content lands as a fresh draft; call `publish` afterwards if you want it live again. Audits the rollback under publishing.rollback.",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
/** Every tool this server contributes, for the collector. */
|
|
37
|
+
export const PUBLISHING_TOOL_DESCRIPTORS = Object.values(PUBLISHING_TOOLS);
|
|
38
|
+
//# sourceMappingURL=descriptors.js.map
|