@forumone/throughline 0.0.0-stage → 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 +351 -2
- 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 +180 -3
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { defaultLogger } from '../logger/index.js';
|
|
3
|
+
import { auditContext } from './audit-context.js';
|
|
4
|
+
import { McpMetaSchema } from './meta.js';
|
|
5
|
+
/**
|
|
6
|
+
* Wraps one Throughline tool so Payload's MCP plugin can serve it.
|
|
7
|
+
*
|
|
8
|
+
* Three things are being translated, and none of them is the tool's logic:
|
|
9
|
+
*
|
|
10
|
+
* - **The schema.** `plugin-mcp` wants the raw shape; `withMeta` produces a
|
|
11
|
+
* `z.object` around it. `.shape` is the whole conversion, which is why tools
|
|
12
|
+
* must build their input with `withMeta` or `z.object` rather than an
|
|
13
|
+
* arbitrary `ZodType`.
|
|
14
|
+
* - **The context.** Payload hands the handler a request. Throughline's tools
|
|
15
|
+
* take a `McpToolContext`, so one is built from it.
|
|
16
|
+
* - **The result.** Payload wants MCP content blocks; Throughline's tools
|
|
17
|
+
* return their own objects, exactly as they do through this package's own
|
|
18
|
+
* handler, which does the same wrapping a layer up.
|
|
19
|
+
*/
|
|
20
|
+
/*
|
|
21
|
+
Whether a tool answered with a refusal, and so whether MCP's `isError` belongs
|
|
22
|
+
on the result.
|
|
23
|
+
|
|
24
|
+
Every server in the suite refuses the same way — `deniedEnvelope`, or a bare
|
|
25
|
+
`{ error }` built in the tool — and returns it as an ordinary value rather than
|
|
26
|
+
throwing, so a denial reads to the model as a denial rather than as a server
|
|
27
|
+
fault. What none of them did was set `isError`, so a refusal arrived as a
|
|
28
|
+
**successful** tool result carrying `{"error": …}`. An agent that checks the
|
|
29
|
+
protocol's flag instead of parsing the body read every refusal as a success —
|
|
30
|
+
including "Must be authenticated to use the publishing tools", which is the one
|
|
31
|
+
every `Bearer` call gets, because `plugin-mcp` assigns no `req.user`.
|
|
32
|
+
|
|
33
|
+
Found exercising `04` F-02 with a real MCP key, and recorded in the consuming
|
|
34
|
+
repository's #614. It is a reporting defect rather than an access one: nothing
|
|
35
|
+
was permitted that should not have been, and everything that was refused stayed
|
|
36
|
+
refused.
|
|
37
|
+
|
|
38
|
+
Here rather than in each tool for the reason the audit wrap below is here. This
|
|
39
|
+
is the one place every tool in the suite passes through, so a tool written
|
|
40
|
+
tomorrow is covered without its author knowing this file exists.
|
|
41
|
+
|
|
42
|
+
**The test is a non-empty string `error`, not a sole `error` key.** A refusal
|
|
43
|
+
that later grows a second field — a code, a retry hint — keeps its flag, which
|
|
44
|
+
is the likelier shape to drift. It costs the inverse risk: a *success* payload
|
|
45
|
+
carrying an `error` string would be flagged wrongly. Nothing in the suite does
|
|
46
|
+
that today — the healthy shapes report through `ok`, `healthy`, `message` and
|
|
47
|
+
`details` — and `payload-mcp.test.ts` pins it so a new one has to argue with a
|
|
48
|
+
test rather than slip past.
|
|
49
|
+
*/
|
|
50
|
+
function isRefusal(result) {
|
|
51
|
+
if (typeof result !== 'object' || result === null)
|
|
52
|
+
return false;
|
|
53
|
+
const error = result['error'];
|
|
54
|
+
return typeof error === 'string' && error.trim() !== '';
|
|
55
|
+
}
|
|
56
|
+
export function toPayloadMcpTool(tool, options = {}) {
|
|
57
|
+
const shape = shapeOf(tool);
|
|
58
|
+
return {
|
|
59
|
+
name: tool.name,
|
|
60
|
+
description: tool.description,
|
|
61
|
+
parameters: shape,
|
|
62
|
+
handler: async (args, req) => {
|
|
63
|
+
const context = contextFrom(req, options);
|
|
64
|
+
try {
|
|
65
|
+
const result = await tool.handler(args, context);
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
68
|
+
...(isRefusal(result) ? { isError: true } : {}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
await recordToolFailure(tool.name, error, args, context, options);
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/*
|
|
79
|
+
The one place a tool's crash becomes a row, and the reason `system.error` had a
|
|
80
|
+
name in the taxonomy and no writer.
|
|
81
|
+
|
|
82
|
+
Audit 12 H3: `'system.error'` was declared in `audit/types.ts`, present in the
|
|
83
|
+
Postgres enum, and written by nothing — while `observability.md` opened with
|
|
84
|
+
"the audit log is the single most useful debugging tool" and listed errors among
|
|
85
|
+
what lands there. A tool that returns `deniedEnvelope` or an `{ error }` result
|
|
86
|
+
audits itself; a tool that *throws* did not, so the failures most worth reading
|
|
87
|
+
were the only ones absent.
|
|
88
|
+
|
|
89
|
+
This is the choke point every tool in the suite passes through — all six
|
|
90
|
+
servers, every tool — so wrapping here is one wrap rather than one per tool,
|
|
91
|
+
and a tool added tomorrow is covered without its author knowing this file
|
|
92
|
+
exists. It also covers the tools that audit nothing else: `list_components`,
|
|
93
|
+
`get_contract`, `get_variants`, `get_tokens` and the five audit reads write no
|
|
94
|
+
row on success, so a crash is the only thing they have ever recorded.
|
|
95
|
+
|
|
96
|
+
Three properties it has to have, in order:
|
|
97
|
+
|
|
98
|
+
**The original error still propagates.** `plugin-mcp` turns a throw into a
|
|
99
|
+
JSON-RPC error and the client needs that. Recording is a side effect, not a
|
|
100
|
+
handler.
|
|
101
|
+
|
|
102
|
+
**Recording cannot itself fail the call.** `createAuditWriter` already swallows
|
|
103
|
+
its own write failures, but `options.audit` is an interface and a caller may
|
|
104
|
+
pass something less careful, so the `await` is wrapped too. An audit miss is a
|
|
105
|
+
gap in a log; a throw from here would replace the tool's real error with this
|
|
106
|
+
file's, which is the one outcome that would make debugging worse rather than
|
|
107
|
+
better.
|
|
108
|
+
|
|
109
|
+
**The message is the error's, and nothing else.** No stack: `errorMessage` is a
|
|
110
|
+
`varchar` on a table admins and editors can read through the admin UI, and a
|
|
111
|
+
stack names file paths and sometimes argument values. The arguments are not
|
|
112
|
+
recorded either — a tool's input can carry a form submission or a draft — but
|
|
113
|
+
`_meta` is, because the agent's own prompt and reasoning are what make a crash
|
|
114
|
+
row legible, and they are already recorded on every successful write.
|
|
115
|
+
*/
|
|
116
|
+
async function recordToolFailure(toolName, error, args, context, options) {
|
|
117
|
+
const { audit, auditServer } = options;
|
|
118
|
+
const logger = context.logger ?? defaultLogger;
|
|
119
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
120
|
+
logger.error(`MCP tool "${toolName}" threw`, { tool: toolName, error: message });
|
|
121
|
+
if (!audit || !auditServer)
|
|
122
|
+
return;
|
|
123
|
+
try {
|
|
124
|
+
const meta = McpMetaSchema.safeParse(args['_meta']);
|
|
125
|
+
await audit({
|
|
126
|
+
...auditContext(context, meta.success ? meta.data : undefined),
|
|
127
|
+
action: 'system.error',
|
|
128
|
+
mcpServer: auditServer,
|
|
129
|
+
mcpTool: toolName,
|
|
130
|
+
summary: `${toolName} threw: ${message}`,
|
|
131
|
+
success: false,
|
|
132
|
+
errorMessage: message,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (recordError) {
|
|
136
|
+
logger.error('Recording an MCP tool failure failed', {
|
|
137
|
+
tool: toolName,
|
|
138
|
+
error: String(recordError),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/** Every tool in a server, in one call. */
|
|
143
|
+
export function toPayloadMcpTools(tools, options = {}) {
|
|
144
|
+
return tools.map(tool => toPayloadMcpTool(tool, options));
|
|
145
|
+
}
|
|
146
|
+
function shapeOf(tool) {
|
|
147
|
+
const schema = tool.inputSchema;
|
|
148
|
+
if (schema instanceof z.ZodObject)
|
|
149
|
+
return schema.shape;
|
|
150
|
+
throw new Error(`Tool "${tool.name}" has an input schema that is not a z.object, so it has no shape to hand ` +
|
|
151
|
+
`Payload's MCP plugin. Build tool inputs with \`withMeta({ … })\` or \`z.object({ … })\`.`);
|
|
152
|
+
}
|
|
153
|
+
function contextFrom(req, options) {
|
|
154
|
+
const user = req.user
|
|
155
|
+
? {
|
|
156
|
+
id: String(req.user.id ?? ''),
|
|
157
|
+
email: String(req.user.email ?? ''),
|
|
158
|
+
name: String(req.user.name ?? req.user.email ?? ''),
|
|
159
|
+
roles: Array.isArray(req.user.roles) ? req.user.roles : [],
|
|
160
|
+
groups: Array.isArray(req.user.groups) ? req.user.groups : [],
|
|
161
|
+
}
|
|
162
|
+
: null;
|
|
163
|
+
return {
|
|
164
|
+
user,
|
|
165
|
+
/*
|
|
166
|
+
The strategy name is the honest fallback. `plugin-mcp` resolves a key to its
|
|
167
|
+
linked user and does not carry the key document forward, so "which key" is
|
|
168
|
+
not a question the request can answer — and an audit row saying
|
|
169
|
+
`mcp-api-key` is better than one asserting a name nothing checked.
|
|
170
|
+
*/
|
|
171
|
+
apiKeyName: options.apiKeyName ?? (req.payloadAPI === 'MCP' ? 'mcp-api-key' : ''),
|
|
172
|
+
logger: options.logger ?? req.payload?.logger ?? defaultLogger,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=payload-mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload-mcp.js","sourceRoot":"","sources":["../../src/mcp/payload-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AA4EzC;;;;;;;;;;;;;;GAcG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BE;AACF,SAAS,SAAS,CAAC,MAAe;IAChC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAC/D,MAAM,KAAK,GAAI,MAAkC,CAAC,OAAO,CAAC,CAAA;IAC1D,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAA;AACzD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,IAAuB,EACvB,UAAmC,EAAE;IAErC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE3B,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7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MAAM,IAAI,GAAG,GAAG,CAAC,IAAI;QACnB,CAAC,CAAC;YACE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;YAC7B,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACnC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YACnD,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,IAAI,CAAC,KAAkB,CAAC,CAAC,CAAC,EAAE;YACxE,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,IAAI,CAAC,MAAmB,CAAC,CAAC,CAAC,EAAE;SAC5E;QACH,CAAC,CAAC,IAAI,CAAA;IAER,OAAO;QACL,IAAI;QACJ;;;;;UAKE;QACF,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,CAAC,GAAG,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,aAAa;KAC/D,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type CollectionAfterChangeHook, type CollectionBeforeChangeHook } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* `beforeChange`: refuse a type not on the list, on create. The list is the
|
|
4
|
+
* same one given to `upload.mimeTypes`, which does not run on a client upload.
|
|
5
|
+
*/
|
|
6
|
+
export declare function refuseMimeTypesOutside(allowed: readonly string[], message?: (mimeType: string) => string): CollectionBeforeChangeHook;
|
|
7
|
+
/**
|
|
8
|
+
* `beforeChange`: refuse a client upload whose stored key and recorded key
|
|
9
|
+
* disagree, so its link would not resolve.
|
|
10
|
+
*
|
|
11
|
+
* A client upload picks two names independently: the browser PUTs under the
|
|
12
|
+
* name it has, and `generateFileData` may record a different one, say
|
|
13
|
+
* `hero-1.mp4` for a name the collection already holds. Compared against
|
|
14
|
+
* `req.file.name` and the prefix the browser reports back through
|
|
15
|
+
* `clientUploadContext`, which are facts rather than reconstructions. Only where
|
|
16
|
+
* the browser did the uploading: a server-side write is stored under the name
|
|
17
|
+
* Payload chose, and renaming around a collision is right there.
|
|
18
|
+
*/
|
|
19
|
+
export declare function refuseStorageKeyMismatch(collectionPrefix?: string): CollectionBeforeChangeHook;
|
|
20
|
+
/**
|
|
21
|
+
* `afterChange`: re-read an SVG that reached storage, run it through
|
|
22
|
+
* `sanitizeSvg`, and write the clean version over it if anything was removed.
|
|
23
|
+
*
|
|
24
|
+
* After the write because that is the first moment the bytes exist where this
|
|
25
|
+
* code can read them. There is a window between the browser's upload and this
|
|
26
|
+
* finishing during which the original is reachable by URL; closing it means
|
|
27
|
+
* giving up client uploads. Failures are logged and swallowed: a logo that could
|
|
28
|
+
* not be re-read is not a reason to fail a save that has already happened.
|
|
29
|
+
*/
|
|
30
|
+
export declare function sanitizeStoredSvg(options?: {
|
|
31
|
+
collectionPrefix?: string;
|
|
32
|
+
token?: string;
|
|
33
|
+
}): CollectionAfterChangeHook;
|
|
34
|
+
/** What the store says it is holding. */
|
|
35
|
+
export interface StoredObject {
|
|
36
|
+
size: number;
|
|
37
|
+
contentType?: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** What a media document claims about its own file. */
|
|
40
|
+
export interface RecordedFacts {
|
|
41
|
+
filesize?: number | null | undefined;
|
|
42
|
+
mimeType?: string | null | undefined;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The fields that contradict the stored object, or `undefined` for none.
|
|
46
|
+
* `mimeType` is corrected only towards a type the collection accepts: a browser
|
|
47
|
+
* that sent `application/octet-stream` would otherwise have that written.
|
|
48
|
+
*/
|
|
49
|
+
export declare function factsToCorrect(recorded: RecordedFacts, stored: StoredObject, mimeTypes: readonly string[]): Partial<{
|
|
50
|
+
filesize: number;
|
|
51
|
+
mimeType: string;
|
|
52
|
+
}> | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* `afterChange`: make `filesize` and `mimeType` describe the object actually in
|
|
55
|
+
* the store.
|
|
56
|
+
*
|
|
57
|
+
* With client uploads, Payload records them from a conversion it ran in memory
|
|
58
|
+
* (it re-fetches the object to apply the default focal point, runs it through
|
|
59
|
+
* sharp, and measures *that* buffer), which was never uploaded: forumone-2026
|
|
60
|
+
* found records wrong by as much as 60%. Nothing before the write can know, so
|
|
61
|
+
* the store is asked, with one `head()` per create. Written through
|
|
62
|
+
* `payload.db.updateOne` so it re-enters no hooks. Failures are logged and
|
|
63
|
+
* swallowed. Skipped for a non-URL `url`, which is local disk, where the file
|
|
64
|
+
* did go through the server and the fields are right.
|
|
65
|
+
*/
|
|
66
|
+
export declare function recordStoredFacts(options: {
|
|
67
|
+
mimeTypes: readonly string[];
|
|
68
|
+
token?: string;
|
|
69
|
+
}): CollectionAfterChangeHook;
|
|
70
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/media/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAChC,MAAM,SAAS,CAAA;AA6BhB;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,OAAO,GAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MACiB,GAC/C,0BAA0B,CAS5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,SAAK,GAAG,0BAA0B,CAuC1F;AAOD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE;IAAE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1D,yBAAyB,CA0C3B;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC;AAED,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CACrC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,SAAS,MAAM,EAAE,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CAQ7D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,yBAAyB,CAmC5B"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { head, put } from '@vercel/blob';
|
|
2
|
+
import { ValidationError, } from 'payload';
|
|
3
|
+
import { isRenderableSvg, sanitizeSvg } from './svg.js';
|
|
4
|
+
import { storageKey } from './uploadKey.js';
|
|
5
|
+
/*
|
|
6
|
+
The hooks that make client uploads to Vercel Blob safe. From forumone-2026's
|
|
7
|
+
`collections/Media.ts` and `media/recordStoredFacts.ts` (#486 F-05, #635, #691
|
|
8
|
+
there).
|
|
9
|
+
|
|
10
|
+
**Why hooks, when Payload has `upload.mimeTypes` and `validateSvg`.** With
|
|
11
|
+
`clientUploads: true` the browser PUTs straight to Blob and the document
|
|
12
|
+
arrives with metadata and no bytes. `generateFileData` returns before
|
|
13
|
+
`checkFileRestrictions` for an upload with no buffer, so neither of Payload's own
|
|
14
|
+
checks runs. These are the checks that do: two on the way in, two after the
|
|
15
|
+
write, when the bytes finally exist somewhere this code can read.
|
|
16
|
+
|
|
17
|
+
Mount them on the upload collection:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
hooks: {
|
|
21
|
+
beforeChange: [refuseMimeTypesOutside(MIME_TYPES), refuseStorageKeyMismatch()],
|
|
22
|
+
afterChange: [sanitizeStoredSvg(), recordStoredFacts({ mimeTypes: MIME_TYPES })],
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
with `uploadPrefixField()` among its fields. The two `afterChange` hooks in that
|
|
27
|
+
order: a sanitised SVG is written back over the object and changes its size.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* `beforeChange`: refuse a type not on the list, on create. The list is the
|
|
31
|
+
* same one given to `upload.mimeTypes`, which does not run on a client upload.
|
|
32
|
+
*/
|
|
33
|
+
export function refuseMimeTypesOutside(allowed, message = (mimeType) => `${mimeType} is not a type this site accepts.`) {
|
|
34
|
+
return ({ data, operation }) => {
|
|
35
|
+
if (operation !== 'create')
|
|
36
|
+
return data;
|
|
37
|
+
const mimeType = typeof data?.['mimeType'] === 'string' ? data['mimeType'] : '';
|
|
38
|
+
if (mimeType && !allowed.includes(mimeType)) {
|
|
39
|
+
throw new ValidationError({ errors: [{ path: 'mimeType', message: message(mimeType) }] });
|
|
40
|
+
}
|
|
41
|
+
return data;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `beforeChange`: refuse a client upload whose stored key and recorded key
|
|
46
|
+
* disagree, so its link would not resolve.
|
|
47
|
+
*
|
|
48
|
+
* A client upload picks two names independently: the browser PUTs under the
|
|
49
|
+
* name it has, and `generateFileData` may record a different one, say
|
|
50
|
+
* `hero-1.mp4` for a name the collection already holds. Compared against
|
|
51
|
+
* `req.file.name` and the prefix the browser reports back through
|
|
52
|
+
* `clientUploadContext`, which are facts rather than reconstructions. Only where
|
|
53
|
+
* the browser did the uploading: a server-side write is stored under the name
|
|
54
|
+
* Payload chose, and renaming around a collision is right there.
|
|
55
|
+
*/
|
|
56
|
+
export function refuseStorageKeyMismatch(collectionPrefix = '') {
|
|
57
|
+
return ({ data, operation, req }) => {
|
|
58
|
+
if (operation !== 'create')
|
|
59
|
+
return data;
|
|
60
|
+
const file = req?.file;
|
|
61
|
+
const context = file?.clientUploadContext;
|
|
62
|
+
if (!file || !context)
|
|
63
|
+
return data;
|
|
64
|
+
const written = storageKey({
|
|
65
|
+
prefix: context.prefix,
|
|
66
|
+
filename: file.name,
|
|
67
|
+
}, collectionPrefix);
|
|
68
|
+
const recorded = storageKey({
|
|
69
|
+
prefix: typeof data?.['prefix'] === 'string' ? data['prefix'] : '',
|
|
70
|
+
filename: typeof data?.['filename'] === 'string' ? data['filename'] : '',
|
|
71
|
+
}, collectionPrefix);
|
|
72
|
+
if (!written || !recorded || written === recorded)
|
|
73
|
+
return data;
|
|
74
|
+
const sameFolder = written.replace(/[^/]+$/, '') === recorded.replace(/[^/]+$/, '');
|
|
75
|
+
throw new ValidationError({
|
|
76
|
+
errors: [
|
|
77
|
+
{
|
|
78
|
+
path: 'filename',
|
|
79
|
+
message: sameFolder
|
|
80
|
+
? `A file called ${file.name} is already in the library. This upload was stored under ` +
|
|
81
|
+
`that same name but would have been recorded as ${String(data?.['filename'])}, so its ` +
|
|
82
|
+
`link would not resolve. Rename your file and upload it again.`
|
|
83
|
+
: `This upload was stored at ${written} but the document would have recorded ${recorded}, ` +
|
|
84
|
+
`so its link would not resolve. Nothing is wrong with the file: this is a fault in the ` +
|
|
85
|
+
`upload path itself, and it will affect every upload until it is fixed. Please report it.`,
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
const tokenOf = (token) => {
|
|
92
|
+
const value = token ?? process.env['BLOB_READ_WRITE_TOKEN'];
|
|
93
|
+
return value ? { token: value } : {};
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* `afterChange`: re-read an SVG that reached storage, run it through
|
|
97
|
+
* `sanitizeSvg`, and write the clean version over it if anything was removed.
|
|
98
|
+
*
|
|
99
|
+
* After the write because that is the first moment the bytes exist where this
|
|
100
|
+
* code can read them. There is a window between the browser's upload and this
|
|
101
|
+
* finishing during which the original is reachable by URL; closing it means
|
|
102
|
+
* giving up client uploads. Failures are logged and swallowed: a logo that could
|
|
103
|
+
* not be re-read is not a reason to fail a save that has already happened.
|
|
104
|
+
*/
|
|
105
|
+
export function sanitizeStoredSvg(options = {}) {
|
|
106
|
+
return async ({ doc, operation, req }) => {
|
|
107
|
+
if (operation !== 'create')
|
|
108
|
+
return doc;
|
|
109
|
+
const record = doc;
|
|
110
|
+
if (record.mimeType !== 'image/svg+xml' || typeof record.url !== 'string')
|
|
111
|
+
return doc;
|
|
112
|
+
try {
|
|
113
|
+
const response = await fetch(record.url);
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
req.payload.logger.warn(`[media] could not re-read ${record.filename} to sanitise it: ${response.status}`);
|
|
116
|
+
return doc;
|
|
117
|
+
}
|
|
118
|
+
const { svg, removed } = sanitizeSvg(await response.text());
|
|
119
|
+
if (removed.length === 0)
|
|
120
|
+
return doc;
|
|
121
|
+
if (!isRenderableSvg(svg)) {
|
|
122
|
+
req.payload.logger.error(`[media] ${record.filename} was not an SVG once cleaned; leaving it and flagging`);
|
|
123
|
+
return doc;
|
|
124
|
+
}
|
|
125
|
+
await put(storageKey(record, options.collectionPrefix), svg, {
|
|
126
|
+
access: 'public',
|
|
127
|
+
addRandomSuffix: false,
|
|
128
|
+
allowOverwrite: true,
|
|
129
|
+
contentType: 'image/svg+xml',
|
|
130
|
+
...tokenOf(options.token),
|
|
131
|
+
});
|
|
132
|
+
req.payload.logger.info(`[media] sanitised ${record.filename}, removed: ${removed.join(', ')}`);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
req.payload.logger.warn({ err: error, msg: `[media] sanitising ${record.filename} failed` });
|
|
136
|
+
}
|
|
137
|
+
return doc;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The fields that contradict the stored object, or `undefined` for none.
|
|
142
|
+
* `mimeType` is corrected only towards a type the collection accepts: a browser
|
|
143
|
+
* that sent `application/octet-stream` would otherwise have that written.
|
|
144
|
+
*/
|
|
145
|
+
export function factsToCorrect(recorded, stored, mimeTypes) {
|
|
146
|
+
const correction = {};
|
|
147
|
+
if (stored.size > 0 && stored.size !== recorded.filesize)
|
|
148
|
+
correction.filesize = stored.size;
|
|
149
|
+
const contentType = stored.contentType?.split(';')[0]?.trim();
|
|
150
|
+
if (contentType && contentType !== recorded.mimeType && mimeTypes.includes(contentType)) {
|
|
151
|
+
correction.mimeType = contentType;
|
|
152
|
+
}
|
|
153
|
+
return Object.keys(correction).length > 0 ? correction : undefined;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* `afterChange`: make `filesize` and `mimeType` describe the object actually in
|
|
157
|
+
* the store.
|
|
158
|
+
*
|
|
159
|
+
* With client uploads, Payload records them from a conversion it ran in memory
|
|
160
|
+
* (it re-fetches the object to apply the default focal point, runs it through
|
|
161
|
+
* sharp, and measures *that* buffer), which was never uploaded: forumone-2026
|
|
162
|
+
* found records wrong by as much as 60%. Nothing before the write can know, so
|
|
163
|
+
* the store is asked, with one `head()` per create. Written through
|
|
164
|
+
* `payload.db.updateOne` so it re-enters no hooks. Failures are logged and
|
|
165
|
+
* swallowed. Skipped for a non-URL `url`, which is local disk, where the file
|
|
166
|
+
* did go through the server and the fields are right.
|
|
167
|
+
*/
|
|
168
|
+
export function recordStoredFacts(options) {
|
|
169
|
+
return async ({ doc, operation, req, collection }) => {
|
|
170
|
+
if (operation !== 'create')
|
|
171
|
+
return doc;
|
|
172
|
+
const record = doc;
|
|
173
|
+
const { url } = record;
|
|
174
|
+
if (typeof url !== 'string' || !/^https?:\/\//i.test(url))
|
|
175
|
+
return doc;
|
|
176
|
+
try {
|
|
177
|
+
const stored = await head(url, tokenOf(options.token));
|
|
178
|
+
const correction = factsToCorrect(record, stored, options.mimeTypes);
|
|
179
|
+
if (!correction || record.id === undefined)
|
|
180
|
+
return doc;
|
|
181
|
+
await req.payload.db.updateOne({
|
|
182
|
+
collection: collection.slug,
|
|
183
|
+
id: record.id,
|
|
184
|
+
data: correction,
|
|
185
|
+
req,
|
|
186
|
+
});
|
|
187
|
+
req.payload.logger.info(`[media] ${record.filename}: recorded ${record.mimeType} ${record.filesize}, stored ` +
|
|
188
|
+
`${stored.contentType} ${stored.size}; corrected ${Object.keys(correction).join(' and ')}`);
|
|
189
|
+
return { ...doc, ...correction };
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
req.payload.logger.warn({
|
|
193
|
+
err: error,
|
|
194
|
+
msg: `[media] could not read ${record.filename} back to check its recorded size`,
|
|
195
|
+
});
|
|
196
|
+
return doc;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/media/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EACL,eAAe,GAGhB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;EAuBE;AAEF;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAA0B,EAC1B,UAAwC,C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H,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { isRenderableSvg, sanitizeSvg } from './svg.js';
|
|
2
|
+
export type { SanitizedSvg } from './svg.js';
|
|
3
|
+
export { storageKey, uniqueUploadPrefix, uploadPrefixField } from './uploadKey.js';
|
|
4
|
+
export type { KeyParts } from './uploadKey.js';
|
|
5
|
+
export { factsToCorrect, recordStoredFacts, refuseMimeTypesOutside, refuseStorageKeyMismatch, sanitizeStoredSvg, } from './hooks.js';
|
|
6
|
+
export type { RecordedFacts, StoredObject } from './hooks.js';
|
|
7
|
+
export * from '../references/index.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClF,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,YAAY,CAAA;AACnB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAI7D,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { isRenderableSvg, sanitizeSvg } from './svg.js';
|
|
2
|
+
export { storageKey, uniqueUploadPrefix, uploadPrefixField } from './uploadKey.js';
|
|
3
|
+
export { factsToCorrect, recordStoredFacts, refuseMimeTypesOutside, refuseStorageKeyMismatch, sanitizeStoredSvg, } from './hooks.js';
|
|
4
|
+
// Reference tracking: what refers to a document, the guards that refuse to
|
|
5
|
+
// delete or trash it while something does, and the "Used on" panel.
|
|
6
|
+
export * from '../references/index.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElF,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,YAAY,CAAA;AAGnB,2EAA2E;AAC3E,oEAAoE;AACpE,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface SanitizedSvg {
|
|
2
|
+
/** The cleaned document. */
|
|
3
|
+
svg: string;
|
|
4
|
+
/** What was taken out, for a message somebody can act on. Empty when nothing was. */
|
|
5
|
+
removed: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Rewrite an SVG to the allowlist above.
|
|
9
|
+
*
|
|
10
|
+
* `removed` is a set of short labels — `<script>`, `onload`, `href` — rather
|
|
11
|
+
* than the offending source, because the caller puts them in front of an editor
|
|
12
|
+
* and a truncated payload is neither reassuring nor useful.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizeSvg(source: string): SanitizedSvg;
|
|
15
|
+
/** Whether a sanitised document still contains an `<svg>` root worth storing. */
|
|
16
|
+
export declare function isRenderableSvg(svg: string): boolean;
|
|
17
|
+
//# sourceMappingURL=svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.d.ts","sourceRoot":"","sources":["../../src/media/svg.ts"],"names":[],"mappings":"AAwGA,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,qFAAqF;IACrF,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAqJxD;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|