@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,94 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { TextareaInput, TextInput, useField } from '@payloadcms/ui';
|
|
4
|
+
import { mergeFieldStyles } from '@payloadcms/ui/shared';
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
+
/*
|
|
7
|
+
A capped text field that says how much room is left, and does not let an editor
|
|
8
|
+
past the cap. From forumone-2026's `fields/characterCount/CharacterCount.tsx`.
|
|
9
|
+
`characterCountPlugin` puts it on every capped field.
|
|
10
|
+
|
|
11
|
+
**The counter appears late on purpose.** Below `SHOW_FROM` of the cap there is
|
|
12
|
+
none: a number under every field turns a page of fields into a page of numbers.
|
|
13
|
+
|
|
14
|
+
**The cap is enforced here, not by the browser.** `TextInput` and
|
|
15
|
+
`TextareaInput` take a fixed prop list without `maxLength`, so the value is cut
|
|
16
|
+
in `onChange`, which also catches a paste, the only way most people exceed a
|
|
17
|
+
limit they can see. A paste that is cut short says so.
|
|
18
|
+
|
|
19
|
+
**Content already over the cap is left alone.** It shows in full and can be
|
|
20
|
+
edited down; the cap only refuses additions. Payload still refuses to save it.
|
|
21
|
+
|
|
22
|
+
**The field's own styles are passed through** (`mergeFieldStyles`), or a capped
|
|
23
|
+
field inside a row would draw at its content's width whatever `admin.width` said.
|
|
24
|
+
*/
|
|
25
|
+
/** Fraction of the cap at which the counter appears. */
|
|
26
|
+
const SHOW_FROM = 0.8;
|
|
27
|
+
/** How long "trimmed" stays up after a paste was cut. */
|
|
28
|
+
const TRIMMED_MS = 4000;
|
|
29
|
+
/*
|
|
30
|
+
In Payload's tokens, so it follows the admin's themes. Rendered as a React 19
|
|
31
|
+
`<style href precedence>`, hoisted and de-duplicated however many fields show it.
|
|
32
|
+
*/
|
|
33
|
+
const CSS = `
|
|
34
|
+
.tl-count {
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: var(--base, 20px);
|
|
37
|
+
align-items: baseline;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
margin-top: calc(var(--base, 20px) * 0.25);
|
|
40
|
+
font-size: 0.8rem;
|
|
41
|
+
line-height: 1.3;
|
|
42
|
+
color: var(--theme-elevation-500);
|
|
43
|
+
}
|
|
44
|
+
.tl-count--full,
|
|
45
|
+
.tl-count__trimmed {
|
|
46
|
+
color: var(--theme-warning-600, var(--theme-elevation-800));
|
|
47
|
+
}
|
|
48
|
+
.tl-count--full {
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
function useCappedValue(path, maxLength) {
|
|
53
|
+
const { customComponents, setValue, value } = useField({ path });
|
|
54
|
+
const [trimmed, setTrimmed] = useState(false);
|
|
55
|
+
const timer = useRef(undefined);
|
|
56
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
57
|
+
const onChange = useCallback((event) => {
|
|
58
|
+
const next = event.target.value;
|
|
59
|
+
if (next.length > maxLength) {
|
|
60
|
+
setValue(next.slice(0, maxLength));
|
|
61
|
+
setTrimmed(true);
|
|
62
|
+
clearTimeout(timer.current);
|
|
63
|
+
timer.current = setTimeout(() => setTrimmed(false), TRIMMED_MS);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
setValue(next);
|
|
67
|
+
}, [maxLength, setValue]);
|
|
68
|
+
return {
|
|
69
|
+
// A configured `afterInput`, which replacing Payload's own control would otherwise drop.
|
|
70
|
+
afterInput: customComponents?.AfterInput,
|
|
71
|
+
onChange,
|
|
72
|
+
trimmed,
|
|
73
|
+
value: typeof value === 'string' ? value : '',
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function Counter({ length, maxLength, trimmed, }) {
|
|
77
|
+
if (length < Math.floor(maxLength * SHOW_FROM))
|
|
78
|
+
return null;
|
|
79
|
+
const remaining = maxLength - length;
|
|
80
|
+
return (_jsxs("div", { className: `tl-count${remaining <= 0 ? ' tl-count--full' : ''}`, children: [_jsx("style", { href: "throughline-character-count", precedence: "default", children: CSS }), _jsx("span", { "aria-live": "polite", children: remaining > 0
|
|
81
|
+
? `${remaining} character${remaining === 1 ? '' : 's'} left`
|
|
82
|
+
: `At the ${maxLength}-character limit` }), trimmed && (_jsx("span", { className: "tl-count__trimmed", role: "status", children: "Trimmed to fit" }))] }));
|
|
83
|
+
}
|
|
84
|
+
export const CharacterCountText = ({ field, path }) => {
|
|
85
|
+
const maxLength = field.maxLength ?? 0;
|
|
86
|
+
const { afterInput, onChange, trimmed, value } = useCappedValue(path, maxLength);
|
|
87
|
+
return (_jsx(TextInput, { AfterInput: _jsxs(_Fragment, { children: [afterInput, _jsx(Counter, { length: value.length, maxLength: maxLength, trimmed: trimmed })] }), ...(field.admin?.description ? { description: field.admin.description } : {}), ...(field.label ? { label: field.label } : {}), onChange: onChange, path: path, required: field.required ?? false, style: mergeFieldStyles(field), value: value }));
|
|
88
|
+
};
|
|
89
|
+
export const CharacterCountTextarea = ({ field, path }) => {
|
|
90
|
+
const maxLength = field.maxLength ?? 0;
|
|
91
|
+
const { afterInput, onChange, trimmed, value } = useCappedValue(path, maxLength);
|
|
92
|
+
return (_jsx(TextareaInput, { AfterInput: _jsxs(_Fragment, { children: [afterInput, _jsx(Counter, { length: value.length, maxLength: maxLength, trimmed: trimmed })] }), ...(field.admin?.description ? { description: field.admin.description } : {}), ...(field.label ? { label: field.label } : {}), onChange: onChange, path: path, required: field.required ?? false, style: mergeFieldStyles(field), value: value }));
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=CharacterCountField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CharacterCountField.js","sourceRoot":"","sources":["../../src/fields/CharacterCountField.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhE;;;;;;;;;;;;;;;;;;EAkBE;AAEF,wDAAwD;AAC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AI,EACV,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,EACjC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAC9B,KAAK,EAAE,KAAK,GACZ,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Field, Plugin } from 'payload';
|
|
2
|
+
/** Where Payload finds the replacement controls. */
|
|
3
|
+
export declare const CHARACTER_COUNT_TEXT_PATH = "@forumone/throughline/client#CharacterCountText";
|
|
4
|
+
export declare const CHARACTER_COUNT_TEXTAREA_PATH = "@forumone/throughline/client#CharacterCountTextarea";
|
|
5
|
+
/** The component for this field, or `undefined` when it should be left alone. */
|
|
6
|
+
export declare function counterFor(field: Field): string | undefined;
|
|
7
|
+
/** Every capped text field in a tree, given the counter. */
|
|
8
|
+
export declare const addCounters: (fields: Field[]) => Field[];
|
|
9
|
+
/**
|
|
10
|
+
* The pass. Covers collections, globals and `config.blocks`, the last being
|
|
11
|
+
* where blocks referenced by slug (a rich-text editor's blocks, say) are
|
|
12
|
+
* registered, which a walk over collections alone would not reach.
|
|
13
|
+
*/
|
|
14
|
+
export declare const characterCountPlugin: () => Plugin;
|
|
15
|
+
//# sourceMappingURL=characterCount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characterCount.d.ts","sourceRoot":"","sources":["../../src/fields/characterCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAgCpD,oDAAoD;AACpD,eAAO,MAAM,yBAAyB,oDAAoD,CAAA;AAC1F,eAAO,MAAM,6BAA6B,wDAAwD,CAAA;AAElG,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,CAa3D;AAkBD,4DAA4D;AAC5D,eAAO,MAAM,WAAW,GAAI,QAAQ,KAAK,EAAE,KAAG,KAAK,EAAoC,CAAA;AAEvF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAC3B,MAyBH,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { mapFields } from './mapFields.js';
|
|
2
|
+
/*
|
|
3
|
+
Every capped text field gets a counter, and a cap it cannot be typed past. From
|
|
4
|
+
forumone-2026's `fields/characterCount`.
|
|
5
|
+
|
|
6
|
+
`maxLength` is enforced by Payload at save, so the limit was invisible right up
|
|
7
|
+
to the moment it cost somebody what they had just written: fill a 160-character
|
|
8
|
+
heading with four hundred words, press Publish, and read "The following field is
|
|
9
|
+
invalid". This moves the limit to where the typing happens.
|
|
10
|
+
|
|
11
|
+
## A pass over the built config, and last
|
|
12
|
+
|
|
13
|
+
There can be hundreds of capped fields once a design system's blocks are
|
|
14
|
+
generated from their contracts, so hand-editing them would be out of date the
|
|
15
|
+
next time a contract changes. One rule instead, applied to whatever is there:
|
|
16
|
+
a `text` or `textarea` field with a `maxLength` gets the control.
|
|
17
|
+
|
|
18
|
+
Register it **after** every plugin that adds capped fields. `@payloadcms/plugin-seo`
|
|
19
|
+
contributes `meta.title` and `meta.description`; running before it would miss
|
|
20
|
+
both. (Those two are then skipped anyway, because the SEO plugin ships its own
|
|
21
|
+
counted controls.)
|
|
22
|
+
|
|
23
|
+
## What it leaves alone
|
|
24
|
+
|
|
25
|
+
- A field that already has a custom `Field` component: replacing it would trade a
|
|
26
|
+
purpose-built control for a generic one.
|
|
27
|
+
- `hasMany` text, which Payload renders as a multi-value select.
|
|
28
|
+
- Anything with no `maxLength`: a counter with no denominator is noise.
|
|
29
|
+
*/
|
|
30
|
+
/** Where Payload finds the replacement controls. */
|
|
31
|
+
export const CHARACTER_COUNT_TEXT_PATH = '@forumone/throughline/client#CharacterCountText';
|
|
32
|
+
export const CHARACTER_COUNT_TEXTAREA_PATH = '@forumone/throughline/client#CharacterCountTextarea';
|
|
33
|
+
/** The component for this field, or `undefined` when it should be left alone. */
|
|
34
|
+
export function counterFor(field) {
|
|
35
|
+
if (field.type !== 'text' && field.type !== 'textarea')
|
|
36
|
+
return undefined;
|
|
37
|
+
if (typeof field.maxLength !== 'number' || field.maxLength <= 0)
|
|
38
|
+
return undefined;
|
|
39
|
+
// Already has a control chosen deliberately. Do not overrule it.
|
|
40
|
+
if (field.admin?.components?.Field)
|
|
41
|
+
return undefined;
|
|
42
|
+
if (field.type === 'text') {
|
|
43
|
+
if (field.hasMany)
|
|
44
|
+
return undefined;
|
|
45
|
+
return CHARACTER_COUNT_TEXT_PATH;
|
|
46
|
+
}
|
|
47
|
+
return CHARACTER_COUNT_TEXTAREA_PATH;
|
|
48
|
+
}
|
|
49
|
+
function withCounter(field) {
|
|
50
|
+
const component = counterFor(field);
|
|
51
|
+
if (!component)
|
|
52
|
+
return field;
|
|
53
|
+
return {
|
|
54
|
+
...field,
|
|
55
|
+
admin: {
|
|
56
|
+
...('admin' in field ? field.admin : {}),
|
|
57
|
+
components: {
|
|
58
|
+
...('admin' in field ? field.admin?.components : {}),
|
|
59
|
+
Field: component,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Every capped text field in a tree, given the counter. */
|
|
65
|
+
export const addCounters = (fields) => mapFields(fields, withCounter);
|
|
66
|
+
/**
|
|
67
|
+
* The pass. Covers collections, globals and `config.blocks`, the last being
|
|
68
|
+
* where blocks referenced by slug (a rich-text editor's blocks, say) are
|
|
69
|
+
* registered, which a walk over collections alone would not reach.
|
|
70
|
+
*/
|
|
71
|
+
export const characterCountPlugin = () => (config) => {
|
|
72
|
+
// Each key is reattached only when it was there to begin with:
|
|
73
|
+
// `exactOptionalPropertyTypes` tells an `undefined` key from a missing one.
|
|
74
|
+
const next = { ...config };
|
|
75
|
+
if (config.blocks) {
|
|
76
|
+
next.blocks = config.blocks.map((block) => ({ ...block, fields: addCounters(block.fields) }));
|
|
77
|
+
}
|
|
78
|
+
if (config.collections) {
|
|
79
|
+
next.collections = config.collections.map((collection) => ({
|
|
80
|
+
...collection,
|
|
81
|
+
fields: addCounters(collection.fields),
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
if (config.globals) {
|
|
85
|
+
next.globals = config.globals.map((global) => ({
|
|
86
|
+
...global,
|
|
87
|
+
fields: addCounters(global.fields),
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
return next;
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=characterCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"characterCount.js","sourceRoot":"","sources":["../../src/fields/characterCount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BE;AAEF,oDAAoD;AACpD,MAAM,CAAC,MAAM,yBAAyB,GAAG,iDAAiD,CAAA;AAC1F,MAAM,CAAC,MAAM,6BAA6B,GAAG,qDAAqD,CAAA;AAElG,iFAAiF;AACjF,MAAM,UAAU,UAAU,CAAC,KAAY;IACrC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,SAAS,CAAA;IACxE,IAAI,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,IAAI,KAAK,CAAC,SAAS,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IAEjF,iEAAiE;IACjE,IAAI,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK;QAAE,OAAO,SAAS,CAAA;IAEpD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,IAAI,KAAK,CAAC,OAAO;YAAE,OAAO,SAAS,CAAA;QACnC,OAAO,yBAAyB,CAAA;IAClC,CAAC;IAED,OAAO,6BAA6B,CAAA;AACtC,CAAC;AAED,SAAS,WAAW,CAAC,KAAY;IAC/B,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IACnC,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nB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;YAC7C,GAAG,MAAM;YACT,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC;SACnC,CAAC,CAAC,CAAA;IACL,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CollectionSlug, Field, Payload, Plugin } from 'payload';
|
|
3
|
+
import type { McpToolContext, McpToolDefinition } from '../plugin-contract/index.js';
|
|
4
|
+
import type { McpToolCollector, McpToolDescriptor } from '../mcp/collector.js';
|
|
5
|
+
export declare const FIELD_TOOLS: {
|
|
6
|
+
readonly checkSlug: {
|
|
7
|
+
readonly name: "check_slug";
|
|
8
|
+
readonly description: "Whether a URL slug is free in a collection, before creating or renaming a document. Normalises it the way the slug field will (lowercase, hyphens, no accents), and if it is taken says by which document, including one in the trash, and suggests the first free alternative.";
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const FIELD_TOOL_DESCRIPTORS: readonly McpToolDescriptor[];
|
|
12
|
+
declare const inputSchema: z.ZodObject<{
|
|
13
|
+
collection: z.ZodString;
|
|
14
|
+
slug: z.ZodString;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
collection: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
}, {
|
|
19
|
+
collection: string;
|
|
20
|
+
slug: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** Whether a field tree has a top-level `slug` field, looking through unnamed wrappers. */
|
|
23
|
+
export declare function hasSlugField(fields: readonly Field[]): boolean;
|
|
24
|
+
/** The answer, for the tool and for a host that wants it directly. */
|
|
25
|
+
export declare function checkSlug(payload: Payload, collection: CollectionSlug, input: string): Promise<{
|
|
26
|
+
collection: string;
|
|
27
|
+
slug: string;
|
|
28
|
+
available: boolean;
|
|
29
|
+
reason: string;
|
|
30
|
+
} | {
|
|
31
|
+
collection: string;
|
|
32
|
+
slug: string;
|
|
33
|
+
available: boolean;
|
|
34
|
+
reason?: never;
|
|
35
|
+
} | {
|
|
36
|
+
suggestion?: string;
|
|
37
|
+
collection: string;
|
|
38
|
+
slug: string;
|
|
39
|
+
available: boolean;
|
|
40
|
+
takenBy: {
|
|
41
|
+
id: number | string;
|
|
42
|
+
title: string;
|
|
43
|
+
trashed: boolean;
|
|
44
|
+
};
|
|
45
|
+
reason?: never;
|
|
46
|
+
}>;
|
|
47
|
+
export declare function createCheckSlugTool(deps: {
|
|
48
|
+
payload: Payload;
|
|
49
|
+
canUse?: (ctx: McpToolContext) => boolean;
|
|
50
|
+
}): McpToolDefinition<typeof inputSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* The field kit's MCP tool. The fields themselves are plain functions a
|
|
53
|
+
* collection calls, and the character counter is `characterCountPlugin`, which
|
|
54
|
+
* has to run last; this only binds `check_slug`, and like every tool-bearing
|
|
55
|
+
* plugin must come before `mcpPlugin`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function fieldsPlugin(options: {
|
|
58
|
+
mcpTools?: McpToolCollector;
|
|
59
|
+
canUse?: (ctx: McpToolContext) => boolean;
|
|
60
|
+
}): Plugin;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=checkSlug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkSlug.d.ts","sourceRoot":"","sources":["../../src/fields/checkSlug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AACpF,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAY9E,eAAO,MAAM,WAAW;;;;;CAM8B,CAAA;AAEtD,eAAO,MAAM,sBAAsB,EAAE,SAAS,iBAAiB,EAA+B,CAAA;AAE9F,QAAA,MAAM,WAAW;;;;;;;;;EAGf,CAAA;AAEF,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,OAAO,CAe9D;AAwBD,sEAAsE;AACtE,wBAAsB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;YAoBjE,MAAM,GAAG,MAAM;;;;;GAMxC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAA;CAC1C,GAAG,iBAAiB,CAAC,OAAO,WAAW,CAAC,CAaxC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE;IACpC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAA;CAC1C,GAAG,MAAM,CAgBT"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { deniedEnvelope } from '../mcp/envelope.js';
|
|
3
|
+
import { slugify, titleOf } from './slug.js';
|
|
4
|
+
/*
|
|
5
|
+
`check_slug`: the question an agent should ask before creating a document, and
|
|
6
|
+
the one `refuseSlugHeldInTrash` answers too late, at save. A slug is unique
|
|
7
|
+
across the whole collection, the trash included, so this reads past access
|
|
8
|
+
control: a draft the caller cannot see still holds its address. Only admins and
|
|
9
|
+
editors may ask by default, since the answer names the holder.
|
|
10
|
+
*/
|
|
11
|
+
export const FIELD_TOOLS = {
|
|
12
|
+
checkSlug: {
|
|
13
|
+
name: 'check_slug',
|
|
14
|
+
description: 'Whether a URL slug is free in a collection, before creating or renaming a document. Normalises it the way the slug field will (lowercase, hyphens, no accents), and if it is taken says by which document, including one in the trash, and suggests the first free alternative.',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const FIELD_TOOL_DESCRIPTORS = Object.values(FIELD_TOOLS);
|
|
18
|
+
const inputSchema = z.object({
|
|
19
|
+
collection: z.string().describe('The collection slug, e.g. "pages".'),
|
|
20
|
+
slug: z.string().min(1).describe('The slug, or a title to make one from.'),
|
|
21
|
+
});
|
|
22
|
+
/** Whether a field tree has a top-level `slug` field, looking through unnamed wrappers. */
|
|
23
|
+
export function hasSlugField(fields) {
|
|
24
|
+
for (const field of fields) {
|
|
25
|
+
if ('name' in field && field.name === 'slug')
|
|
26
|
+
return true;
|
|
27
|
+
if (!('name' in field) || typeof field.name !== 'string') {
|
|
28
|
+
if (field.type === 'tabs' &&
|
|
29
|
+
field.tabs.some((tab) => !('name' in tab) && hasSlugField(tab.fields))) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
if ('fields' in field && Array.isArray(field.fields) && hasSlugField(field.fields))
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
function defaultCanUse(ctx) {
|
|
39
|
+
const roles = ctx.user?.roles ?? [];
|
|
40
|
+
return roles.includes('admin') || roles.includes('editor');
|
|
41
|
+
}
|
|
42
|
+
async function holderOf(payload, collection, slug, trash) {
|
|
43
|
+
const { docs } = await payload.find({
|
|
44
|
+
collection,
|
|
45
|
+
where: { slug: { equals: slug } },
|
|
46
|
+
depth: 0,
|
|
47
|
+
limit: 1,
|
|
48
|
+
overrideAccess: true,
|
|
49
|
+
...(trash ? { trash: true } : {}),
|
|
50
|
+
});
|
|
51
|
+
return docs[0];
|
|
52
|
+
}
|
|
53
|
+
/** The answer, for the tool and for a host that wants it directly. */
|
|
54
|
+
export async function checkSlug(payload, collection, input) {
|
|
55
|
+
const config = payload.collections[collection]?.config;
|
|
56
|
+
const trash = Boolean(config && 'trash' in config && config.trash);
|
|
57
|
+
const slug = slugify(input);
|
|
58
|
+
if (slug === '')
|
|
59
|
+
return { collection, slug, available: false, reason: 'Nothing is left once it is a slug.' };
|
|
60
|
+
const holder = await holderOf(payload, collection, slug, trash);
|
|
61
|
+
if (!holder)
|
|
62
|
+
return { collection, slug, available: true };
|
|
63
|
+
let suggestion;
|
|
64
|
+
for (let n = 2; n <= 20 && !suggestion; n += 1) {
|
|
65
|
+
const candidate = `${slug}-${n}`;
|
|
66
|
+
if (!(await holderOf(payload, collection, candidate, trash)))
|
|
67
|
+
suggestion = candidate;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
collection,
|
|
71
|
+
slug,
|
|
72
|
+
available: false,
|
|
73
|
+
takenBy: {
|
|
74
|
+
id: holder['id'],
|
|
75
|
+
title: titleOf(holder),
|
|
76
|
+
trashed: Boolean(holder['deletedAt']),
|
|
77
|
+
},
|
|
78
|
+
...(suggestion ? { suggestion } : {}),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function createCheckSlugTool(deps) {
|
|
82
|
+
const canUse = deps.canUse ?? defaultCanUse;
|
|
83
|
+
return {
|
|
84
|
+
...FIELD_TOOLS.checkSlug,
|
|
85
|
+
inputSchema,
|
|
86
|
+
handler: async (input, ctx) => {
|
|
87
|
+
if (!canUse(ctx))
|
|
88
|
+
return deniedEnvelope('Only admins and editors can check slugs.');
|
|
89
|
+
const config = deps.payload.collections[input.collection]?.config;
|
|
90
|
+
if (!config)
|
|
91
|
+
return { error: `There is no collection "${input.collection}".` };
|
|
92
|
+
if (!hasSlugField(config.fields))
|
|
93
|
+
return { error: `"${input.collection}" has no slug field.` };
|
|
94
|
+
return checkSlug(deps.payload, input.collection, input.slug);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The field kit's MCP tool. The fields themselves are plain functions a
|
|
100
|
+
* collection calls, and the character counter is `characterCountPlugin`, which
|
|
101
|
+
* has to run last; this only binds `check_slug`, and like every tool-bearing
|
|
102
|
+
* plugin must come before `mcpPlugin`.
|
|
103
|
+
*/
|
|
104
|
+
export function fieldsPlugin(options) {
|
|
105
|
+
return (incoming) => {
|
|
106
|
+
options.mcpTools?.declare(FIELD_TOOL_DESCRIPTORS, { serverName: 'fields' });
|
|
107
|
+
return {
|
|
108
|
+
...incoming,
|
|
109
|
+
onInit: async (payload) => {
|
|
110
|
+
if (incoming.onInit)
|
|
111
|
+
await incoming.onInit(payload);
|
|
112
|
+
options.mcpTools?.add([
|
|
113
|
+
createCheckSlugTool({ payload, ...(options.canUse ? { canUse: options.canUse } : {}) }),
|
|
114
|
+
], { serverName: 'fields' });
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=checkSlug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkSlug.js","sourceRoot":"","sources":["../../src/fields/checkSlug.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAE5C;;;;;;EAME;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,SAAS,EAAE;QACT,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,iRAAiR;KACpR;CACmD,CAAA;AAEtD,MAAM,CAAC,MAAM,sBAAsB,GAAiC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;AAE9F,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACrE,IAAI,EAAE,CAA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,CAAC,QAAQ,EAAE,EAAE;QAClB,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,sBAAsB,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAA;QAC3E,OAAO;YACL,GAAG,QAAQ;YACX,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBACxB,IAAI,QAAQ,CAAC,MAAM;oBAAE,MAAM,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;gBACnD,OAAO,CAAC,QAAQ,EAAE,GAAG,CACnB;oBACE,mBAAmB,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;iBACtD,EACnC,EAAE,UAAU,EAAE,QAAQ,EAAE,CACzB,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { mapFields } from './mapFields.js';
|
|
2
|
+
export { heldInTrash, refuseSlugHeldInTrash, slugField, slugify, titleOf } from './slug.js';
|
|
3
|
+
export { LISTED, unlistedField } from './unlisted.js';
|
|
4
|
+
export { usedBy } from './usedBy.js';
|
|
5
|
+
export { contentRevisedAt, revisedAtField } from './revisedAt.js';
|
|
6
|
+
export { keepOrStampPublishedAt, publishedAtField, publishingFields, scheduledPublishField, } from './publishing.js';
|
|
7
|
+
export { CHARACTER_COUNT_TEXTAREA_PATH, CHARACTER_COUNT_TEXT_PATH, addCounters, characterCountPlugin, counterFor, } from './characterCount.js';
|
|
8
|
+
export { FIELD_TOOLS, FIELD_TOOL_DESCRIPTORS, checkSlug, createCheckSlugTool, fieldsPlugin, hasSlugField, } from './checkSlug.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,WAAW,EACX,oBAAoB,EACpB,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { mapFields } from './mapFields.js';
|
|
2
|
+
export { heldInTrash, refuseSlugHeldInTrash, slugField, slugify, titleOf } from './slug.js';
|
|
3
|
+
export { LISTED, unlistedField } from './unlisted.js';
|
|
4
|
+
export { usedBy } from './usedBy.js';
|
|
5
|
+
export { contentRevisedAt, revisedAtField } from './revisedAt.js';
|
|
6
|
+
export { keepOrStampPublishedAt, publishedAtField, publishingFields, scheduledPublishField, } from './publishing.js';
|
|
7
|
+
export { CHARACTER_COUNT_TEXTAREA_PATH, CHARACTER_COUNT_TEXT_PATH, addCounters, characterCountPlugin, counterFor, } from './characterCount.js';
|
|
8
|
+
export { FIELD_TOOLS, FIELD_TOOL_DESCRIPTORS, checkSlug, createCheckSlugTool, fieldsPlugin, hasSlugField, } from './checkSlug.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC3F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,WAAW,EACX,oBAAoB,EACpB,UAAU,GACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,YAAY,GACb,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Field } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Apply `fn` to every field in the tree, including those nested in arrays,
|
|
4
|
+
* groups, rows, collapsibles, tabs and inline blocks. From forumone-2026's
|
|
5
|
+
* `fields/mapFields.ts`.
|
|
6
|
+
*
|
|
7
|
+
* Shared because several passes need it (the character counter, an icon
|
|
8
|
+
* picker), and a second implementation would be a second chance to miss a
|
|
9
|
+
* nesting case. A block given by slug (`blockReferences`) is left as it is: it
|
|
10
|
+
* lives in the config's `blocks`, which a pass maps separately.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mapFields(fields: Field[], fn: (field: Field) => Field): Field[];
|
|
13
|
+
//# sourceMappingURL=mapFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapFields.d.ts","sourceRoot":"","sources":["../../src/fields/mapFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,GAAG,KAAK,EAAE,CA0B/E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply `fn` to every field in the tree, including those nested in arrays,
|
|
3
|
+
* groups, rows, collapsibles, tabs and inline blocks. From forumone-2026's
|
|
4
|
+
* `fields/mapFields.ts`.
|
|
5
|
+
*
|
|
6
|
+
* Shared because several passes need it (the character counter, an icon
|
|
7
|
+
* picker), and a second implementation would be a second chance to miss a
|
|
8
|
+
* nesting case. A block given by slug (`blockReferences`) is left as it is: it
|
|
9
|
+
* lives in the config's `blocks`, which a pass maps separately.
|
|
10
|
+
*/
|
|
11
|
+
export function mapFields(fields, fn) {
|
|
12
|
+
return fields.map((field) => {
|
|
13
|
+
const mapped = fn(field);
|
|
14
|
+
if ('fields' in mapped && Array.isArray(mapped.fields)) {
|
|
15
|
+
return { ...mapped, fields: mapFields(mapped.fields, fn) };
|
|
16
|
+
}
|
|
17
|
+
if (mapped.type === 'tabs') {
|
|
18
|
+
return {
|
|
19
|
+
...mapped,
|
|
20
|
+
tabs: mapped.tabs.map((tab) => ({ ...tab, fields: mapFields(tab.fields, fn) })),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
if (mapped.type === 'blocks' && Array.isArray(mapped.blocks)) {
|
|
24
|
+
return {
|
|
25
|
+
...mapped,
|
|
26
|
+
blocks: mapped.blocks.map((block) => typeof block === 'string' ? block : { ...block, fields: mapFields(block.fields, fn) }),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return mapped;
|
|
30
|
+
});
|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AAE,CACtF;aACF,CAAA;QACH,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Field, FieldHook } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* The `beforeChange` behind `publishedAtField`.
|
|
4
|
+
*
|
|
5
|
+
* Stamps the moment of the first publish when the field is empty, and leaves a
|
|
6
|
+
* date somebody entered alone (a migrated post's original date is the reason
|
|
7
|
+
* the field is editable at all). A write with no user counts: a scheduled
|
|
8
|
+
* publish went live at that moment as much as one a person published.
|
|
9
|
+
*
|
|
10
|
+
* **An empty value is not proof of a first publish.** The edit form keeps the
|
|
11
|
+
* value it loaded with, so a page first published from an open editor sends
|
|
12
|
+
* `null` again on its next save, and a hook reading only the incoming value
|
|
13
|
+
* would move the page's date on every publish. So with nothing incoming, the
|
|
14
|
+
* date the *published* document already carries wins.
|
|
15
|
+
*/
|
|
16
|
+
export declare const keepOrStampPublishedAt: FieldHook;
|
|
17
|
+
/** `publishedAt`, which fills itself on the first publish. */
|
|
18
|
+
export declare function publishedAtField(description: string, options?: {
|
|
19
|
+
index?: boolean;
|
|
20
|
+
}): Field;
|
|
21
|
+
/**
|
|
22
|
+
* A scheduled publish. `publishingPlugin` renders it as its Schedule control:
|
|
23
|
+
* picking a time runs the publish checks at once, stores the time with a draft
|
|
24
|
+
* save, and wakes the job that publishes at it. A publish or an unpublish
|
|
25
|
+
* clears it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function scheduledPublishField(): Field;
|
|
28
|
+
/** `publishedAt` and `scheduledPublishAt`, for every content type. */
|
|
29
|
+
export declare function publishingFields(options?: {
|
|
30
|
+
publishedAtDescription?: string;
|
|
31
|
+
index?: boolean;
|
|
32
|
+
}): Field[];
|
|
33
|
+
//# sourceMappingURL=publishing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishing.d.ts","sourceRoot":"","sources":["../../src/fields/publishing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAO/C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,EAAE,SA+BpC,CAAA;AAED,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,KAAK,CAS9F;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAW7C;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE;IAAE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GACjE,KAAK,EAAE,CAST"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The sidebar dates a published document carries. From forumone-2026's
|
|
3
|
+
`fields/publishing.ts`.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The `beforeChange` behind `publishedAtField`.
|
|
7
|
+
*
|
|
8
|
+
* Stamps the moment of the first publish when the field is empty, and leaves a
|
|
9
|
+
* date somebody entered alone (a migrated post's original date is the reason
|
|
10
|
+
* the field is editable at all). A write with no user counts: a scheduled
|
|
11
|
+
* publish went live at that moment as much as one a person published.
|
|
12
|
+
*
|
|
13
|
+
* **An empty value is not proof of a first publish.** The edit form keeps the
|
|
14
|
+
* value it loaded with, so a page first published from an open editor sends
|
|
15
|
+
* `null` again on its next save, and a hook reading only the incoming value
|
|
16
|
+
* would move the page's date on every publish. So with nothing incoming, the
|
|
17
|
+
* date the *published* document already carries wins.
|
|
18
|
+
*/
|
|
19
|
+
export const keepOrStampPublishedAt = async ({ value, data, originalDoc, collection, req, }) => {
|
|
20
|
+
const incoming = value;
|
|
21
|
+
if (incoming)
|
|
22
|
+
return incoming;
|
|
23
|
+
const publishing = data?._status === 'published';
|
|
24
|
+
if (!publishing)
|
|
25
|
+
return incoming;
|
|
26
|
+
const id = originalDoc?.id;
|
|
27
|
+
if (id !== undefined && collection) {
|
|
28
|
+
const published = await req.payload
|
|
29
|
+
.findByID({
|
|
30
|
+
collection: collection.slug,
|
|
31
|
+
id,
|
|
32
|
+
depth: 0,
|
|
33
|
+
draft: false,
|
|
34
|
+
overrideAccess: true,
|
|
35
|
+
req,
|
|
36
|
+
disableErrors: true,
|
|
37
|
+
})
|
|
38
|
+
.catch(() => null);
|
|
39
|
+
const existing = published?.publishedAt;
|
|
40
|
+
if (typeof existing === 'string' && existing !== '')
|
|
41
|
+
return existing;
|
|
42
|
+
}
|
|
43
|
+
return new Date().toISOString();
|
|
44
|
+
};
|
|
45
|
+
/** `publishedAt`, which fills itself on the first publish. */
|
|
46
|
+
export function publishedAtField(description, options = {}) {
|
|
47
|
+
return {
|
|
48
|
+
name: 'publishedAt',
|
|
49
|
+
type: 'date',
|
|
50
|
+
// Indexed where listings sort on it.
|
|
51
|
+
...(options.index === false ? {} : { index: true }),
|
|
52
|
+
admin: { position: 'sidebar', description },
|
|
53
|
+
hooks: { beforeChange: [keepOrStampPublishedAt] },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A scheduled publish. `publishingPlugin` renders it as its Schedule control:
|
|
58
|
+
* picking a time runs the publish checks at once, stores the time with a draft
|
|
59
|
+
* save, and wakes the job that publishes at it. A publish or an unpublish
|
|
60
|
+
* clears it.
|
|
61
|
+
*/
|
|
62
|
+
export function scheduledPublishField() {
|
|
63
|
+
return {
|
|
64
|
+
name: 'scheduledPublishAt',
|
|
65
|
+
type: 'date',
|
|
66
|
+
admin: {
|
|
67
|
+
position: 'sidebar',
|
|
68
|
+
date: { pickerAppearance: 'dayAndTime' },
|
|
69
|
+
description: 'Publishes automatically at this time, after the same checks as publishing by hand. Set with the Schedule control; cleared when the document is published or unpublished.',
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/** `publishedAt` and `scheduledPublishAt`, for every content type. */
|
|
74
|
+
export function publishingFields(options = {}) {
|
|
75
|
+
return [
|
|
76
|
+
publishedAtField(options.publishedAtDescription ??
|
|
77
|
+
'The date shown on the page and used to sort listings. Leave it empty and it is set when this is first published; for a migrated post, enter the original date.', options.index === false ? { index: false } : {}),
|
|
78
|
+
scheduledPublishField(),
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=publishing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishing.js","sourceRoot":"","sources":["../../src/fields/publishing.ts"],"names":[],"mappings":"AAEA;;;EAGE;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAc,KAAK,EAAE,EACtD,KAAK,EACL,IAAI,EACJ,WAAW,EACX,UAAU,EACV,GAAG,GACJ,EAAE,EAAE;IACH,MAAM,QAAQ,GAAY,KAAK,CAAA;IAC/B,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAA;IAE7B,MAAM,UAAU,GAAI,IAA0C,EAAE,OAAO,KAAK,WAAW,CAAA;IACvF,IAAI,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAA;IAEhC,MAAM,EAAE,GAAI,WAAoD,EAAE,EAAE,CAAA;IACpE,IAAI,EAAE,KAAK,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,OAAO;aAChC,QAAQ,CAAC;YACR,UAAU,EAAE,UAAU,CAAC,IAAI;YAC3B,EAAE;YACF,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,KAAK;YACZ,cAAc,EAAE,IAAI;YACpB,GAAG;YACH,aAAa,EAAE,IAAI;SACpB,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;QACpB,MAAM,QAAQ,GAAI,SAA8C,EAAE,WAAW,CAAA;QAC7E,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