@forumone/throughline 0.0.0 → 1.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +584 -0
- package/LICENSE +21 -0
- package/README.md +352 -0
- package/bin/payload-cli.mjs +443 -0
- package/bin/throughline-payload.mjs +6 -0
- package/dist/access/coreCollections.d.ts +18 -0
- package/dist/access/coreCollections.d.ts.map +1 -0
- package/dist/access/coreCollections.js +56 -0
- package/dist/access/coreCollections.js.map +1 -0
- package/dist/approvals/collection.d.ts +21 -0
- package/dist/approvals/collection.d.ts.map +1 -0
- package/dist/approvals/collection.js +99 -0
- package/dist/approvals/collection.js.map +1 -0
- package/dist/approvals/endpoints/action.d.ts +31 -0
- package/dist/approvals/endpoints/action.d.ts.map +1 -0
- package/dist/approvals/endpoints/action.js +205 -0
- package/dist/approvals/endpoints/action.js.map +1 -0
- package/dist/approvals/index.d.ts +19 -0
- package/dist/approvals/index.d.ts.map +1 -0
- package/dist/approvals/index.js +13 -0
- package/dist/approvals/index.js.map +1 -0
- package/dist/approvals/jobs/expire-stale-approvals.d.ts +14 -0
- package/dist/approvals/jobs/expire-stale-approvals.d.ts.map +1 -0
- package/dist/approvals/jobs/expire-stale-approvals.js +101 -0
- package/dist/approvals/jobs/expire-stale-approvals.js.map +1 -0
- package/dist/approvals/options.d.ts +76 -0
- package/dist/approvals/options.d.ts.map +1 -0
- package/dist/approvals/options.js +47 -0
- package/dist/approvals/options.js.map +1 -0
- package/dist/approvals/plugin.d.ts +4 -0
- package/dist/approvals/plugin.d.ts.map +1 -0
- package/dist/approvals/plugin.js +92 -0
- package/dist/approvals/plugin.js.map +1 -0
- package/dist/approvals/resolver.d.ts +18 -0
- package/dist/approvals/resolver.d.ts.map +1 -0
- package/dist/approvals/resolver.js +57 -0
- package/dist/approvals/resolver.js.map +1 -0
- package/dist/approvals/symbol.d.ts +12 -0
- package/dist/approvals/symbol.d.ts.map +1 -0
- package/dist/approvals/symbol.js +12 -0
- package/dist/approvals/symbol.js.map +1 -0
- package/dist/approvals/tokens.d.ts +48 -0
- package/dist/approvals/tokens.d.ts.map +1 -0
- package/dist/approvals/tokens.js +123 -0
- package/dist/approvals/tokens.js.map +1 -0
- package/dist/approvals/tools/descriptors.d.ts +26 -0
- package/dist/approvals/tools/descriptors.d.ts.map +1 -0
- package/dist/approvals/tools/descriptors.js +35 -0
- package/dist/approvals/tools/descriptors.js.map +1 -0
- package/dist/approvals/tools/get-approval-status.d.ts +11 -0
- package/dist/approvals/tools/get-approval-status.d.ts.map +1 -0
- package/dist/approvals/tools/get-approval-status.js +94 -0
- package/dist/approvals/tools/get-approval-status.js.map +1 -0
- package/dist/approvals/tools/index.d.ts +7 -0
- package/dist/approvals/tools/index.d.ts.map +1 -0
- package/dist/approvals/tools/index.js +7 -0
- package/dist/approvals/tools/index.js.map +1 -0
- package/dist/approvals/tools/list-my-requests.d.ts +11 -0
- package/dist/approvals/tools/list-my-requests.d.ts.map +1 -0
- package/dist/approvals/tools/list-my-requests.js +55 -0
- package/dist/approvals/tools/list-my-requests.js.map +1 -0
- package/dist/approvals/tools/list-pending-approvals.d.ts +11 -0
- package/dist/approvals/tools/list-pending-approvals.d.ts.map +1 -0
- package/dist/approvals/tools/list-pending-approvals.js +53 -0
- package/dist/approvals/tools/list-pending-approvals.js.map +1 -0
- package/dist/approvals/tools/request-approval.d.ts +13 -0
- package/dist/approvals/tools/request-approval.d.ts.map +1 -0
- package/dist/approvals/tools/request-approval.js +123 -0
- package/dist/approvals/tools/request-approval.js.map +1 -0
- package/dist/approvals/tools/respond-to-approval.d.ts +13 -0
- package/dist/approvals/tools/respond-to-approval.d.ts.map +1 -0
- package/dist/approvals/tools/respond-to-approval.js +98 -0
- package/dist/approvals/tools/respond-to-approval.js.map +1 -0
- package/dist/audit/collection.d.ts +22 -0
- package/dist/audit/collection.d.ts.map +1 -0
- package/dist/audit/collection.js +109 -0
- package/dist/audit/collection.js.map +1 -0
- package/dist/audit/index.d.ts +16 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +11 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/jobs/audit-event-echo.d.ts +14 -0
- package/dist/audit/jobs/audit-event-echo.d.ts.map +1 -0
- package/dist/audit/jobs/audit-event-echo.js +61 -0
- package/dist/audit/jobs/audit-event-echo.js.map +1 -0
- package/dist/audit/plugin.d.ts +20 -0
- package/dist/audit/plugin.d.ts.map +1 -0
- package/dist/audit/plugin.js +55 -0
- package/dist/audit/plugin.js.map +1 -0
- package/dist/audit/query/formatting/index.d.ts +40 -0
- package/dist/audit/query/formatting/index.d.ts.map +1 -0
- package/dist/audit/query/formatting/index.js +73 -0
- package/dist/audit/query/formatting/index.js.map +1 -0
- package/dist/audit/query/options.d.ts +34 -0
- package/dist/audit/query/options.d.ts.map +1 -0
- package/dist/audit/query/options.js +8 -0
- package/dist/audit/query/options.js.map +1 -0
- package/dist/audit/query/plugin.d.ts +11 -0
- package/dist/audit/query/plugin.d.ts.map +1 -0
- package/dist/audit/query/plugin.js +68 -0
- package/dist/audit/query/plugin.js.map +1 -0
- package/dist/audit/query/tools/access.d.ts +9 -0
- package/dist/audit/query/tools/access.d.ts.map +1 -0
- package/dist/audit/query/tools/access.js +14 -0
- package/dist/audit/query/tools/access.js.map +1 -0
- package/dist/audit/query/tools/descriptors.d.ts +26 -0
- package/dist/audit/query/tools/descriptors.d.ts.map +1 -0
- package/dist/audit/query/tools/descriptors.js +35 -0
- package/dist/audit/query/tools/descriptors.js.map +1 -0
- package/dist/audit/query/tools/get-change-history.d.ts +23 -0
- package/dist/audit/query/tools/get-change-history.d.ts.map +1 -0
- package/dist/audit/query/tools/get-change-history.js +44 -0
- package/dist/audit/query/tools/get-change-history.js.map +1 -0
- package/dist/audit/query/tools/get-recent-failures.d.ts +23 -0
- package/dist/audit/query/tools/get-recent-failures.d.ts.map +1 -0
- package/dist/audit/query/tools/get-recent-failures.js +56 -0
- package/dist/audit/query/tools/get-recent-failures.js.map +1 -0
- package/dist/audit/query/tools/index.d.ts +13 -0
- package/dist/audit/query/tools/index.d.ts.map +1 -0
- package/dist/audit/query/tools/index.js +8 -0
- package/dist/audit/query/tools/index.js.map +1 -0
- package/dist/audit/query/tools/query-audit.d.ts +53 -0
- package/dist/audit/query/tools/query-audit.d.ts.map +1 -0
- package/dist/audit/query/tools/query-audit.js +78 -0
- package/dist/audit/query/tools/query-audit.js.map +1 -0
- package/dist/audit/query/tools/what-changed-in-range.d.ts +23 -0
- package/dist/audit/query/tools/what-changed-in-range.d.ts.map +1 -0
- package/dist/audit/query/tools/what-changed-in-range.js +86 -0
- package/dist/audit/query/tools/what-changed-in-range.js.map +1 -0
- package/dist/audit/query/tools/who-changed-what.d.ts +38 -0
- package/dist/audit/query/tools/who-changed-what.d.ts.map +1 -0
- package/dist/audit/query/tools/who-changed-what.js +66 -0
- package/dist/audit/query/tools/who-changed-what.js.map +1 -0
- package/dist/audit/types.d.ts +11 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +45 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/audit/writer.d.ts +50 -0
- package/dist/audit/writer.d.ts.map +1 -0
- package/dist/audit/writer.js +101 -0
- package/dist/audit/writer.js.map +1 -0
- package/dist/cache-tags.d.ts +31 -0
- package/dist/cache-tags.d.ts.map +1 -0
- package/dist/cache-tags.js +53 -0
- package/dist/cache-tags.js.map +1 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +7 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/manifest-source.d.ts +17 -0
- package/dist/components/manifest-source.d.ts.map +1 -0
- package/dist/components/manifest-source.js +60 -0
- package/dist/components/manifest-source.js.map +1 -0
- package/dist/components/matching/index.d.ts +3 -0
- package/dist/components/matching/index.d.ts.map +1 -0
- package/dist/components/matching/index.js +2 -0
- package/dist/components/matching/index.js.map +1 -0
- package/dist/components/matching/tfidf.d.ts +13 -0
- package/dist/components/matching/tfidf.d.ts.map +1 -0
- package/dist/components/matching/tfidf.js +118 -0
- package/dist/components/matching/tfidf.js.map +1 -0
- package/dist/components/matching/types.d.ts +22 -0
- package/dist/components/matching/types.d.ts.map +1 -0
- package/dist/components/matching/types.js +2 -0
- package/dist/components/matching/types.js.map +1 -0
- package/dist/components/options.d.ts +136 -0
- package/dist/components/options.d.ts.map +1 -0
- package/dist/components/options.js +40 -0
- package/dist/components/options.js.map +1 -0
- package/dist/components/plugin.d.ts +4 -0
- package/dist/components/plugin.d.ts.map +1 -0
- package/dist/components/plugin.js +95 -0
- package/dist/components/plugin.js.map +1 -0
- package/dist/components/tools/descriptors.d.ts +34 -0
- package/dist/components/tools/descriptors.d.ts.map +1 -0
- package/dist/components/tools/descriptors.js +43 -0
- package/dist/components/tools/descriptors.js.map +1 -0
- package/dist/components/tools/find-anti-pattern.d.ts +9 -0
- package/dist/components/tools/find-anti-pattern.d.ts.map +1 -0
- package/dist/components/tools/find-anti-pattern.js +31 -0
- package/dist/components/tools/find-anti-pattern.js.map +1 -0
- package/dist/components/tools/get-contract.d.ts +4 -0
- package/dist/components/tools/get-contract.d.ts.map +1 -0
- package/dist/components/tools/get-contract.js +19 -0
- package/dist/components/tools/get-contract.js.map +1 -0
- package/dist/components/tools/get-tokens.d.ts +4 -0
- package/dist/components/tools/get-tokens.d.ts.map +1 -0
- package/dist/components/tools/get-tokens.js +19 -0
- package/dist/components/tools/get-tokens.js.map +1 -0
- package/dist/components/tools/get-variants.d.ts +4 -0
- package/dist/components/tools/get-variants.d.ts.map +1 -0
- package/dist/components/tools/get-variants.js +19 -0
- package/dist/components/tools/get-variants.js.map +1 -0
- package/dist/components/tools/index.d.ts +9 -0
- package/dist/components/tools/index.d.ts.map +1 -0
- package/dist/components/tools/index.js +9 -0
- package/dist/components/tools/index.js.map +1 -0
- package/dist/components/tools/list-components.d.ts +4 -0
- package/dist/components/tools/list-components.d.ts.map +1 -0
- package/dist/components/tools/list-components.js +25 -0
- package/dist/components/tools/list-components.js.map +1 -0
- package/dist/components/tools/suggest-for-intent.d.ts +12 -0
- package/dist/components/tools/suggest-for-intent.d.ts.map +1 -0
- package/dist/components/tools/suggest-for-intent.js +83 -0
- package/dist/components/tools/suggest-for-intent.js.map +1 -0
- package/dist/components/tools/validate-composition.d.ts +9 -0
- package/dist/components/tools/validate-composition.d.ts.map +1 -0
- package/dist/components/tools/validate-composition.js +31 -0
- package/dist/components/tools/validate-composition.js.map +1 -0
- package/dist/components/validation/composition.d.ts +38 -0
- package/dist/components/validation/composition.d.ts.map +1 -0
- package/dist/components/validation/composition.js +135 -0
- package/dist/components/validation/composition.js.map +1 -0
- package/dist/editorial/calendar/ContentCalendarReport.d.ts +9 -0
- package/dist/editorial/calendar/ContentCalendarReport.d.ts.map +1 -0
- package/dist/editorial/calendar/ContentCalendarReport.js +47 -0
- package/dist/editorial/calendar/ContentCalendarReport.js.map +1 -0
- package/dist/editorial/calendar/ContentCalendarView.d.ts +3 -0
- package/dist/editorial/calendar/ContentCalendarView.d.ts.map +1 -0
- package/dist/editorial/calendar/ContentCalendarView.js +36 -0
- package/dist/editorial/calendar/ContentCalendarView.js.map +1 -0
- package/dist/editorial/calendar/calendar.d.ts +30 -0
- package/dist/editorial/calendar/calendar.d.ts.map +1 -0
- package/dist/editorial/calendar/calendar.js +23 -0
- package/dist/editorial/calendar/calendar.js.map +1 -0
- package/dist/editorial/calendar/find.d.ts +41 -0
- package/dist/editorial/calendar/find.d.ts.map +1 -0
- package/dist/editorial/calendar/find.js +108 -0
- package/dist/editorial/calendar/find.js.map +1 -0
- package/dist/editorial/calendar/month.d.ts +45 -0
- package/dist/editorial/calendar/month.d.ts.map +1 -0
- package/dist/editorial/calendar/month.js +120 -0
- package/dist/editorial/calendar/month.js.map +1 -0
- package/dist/editorial/calendar/tool.d.ts +50 -0
- package/dist/editorial/calendar/tool.d.ts.map +1 -0
- package/dist/editorial/calendar/tool.js +68 -0
- package/dist/editorial/calendar/tool.js.map +1 -0
- package/dist/editorial/config.d.ts +25 -0
- package/dist/editorial/config.d.ts.map +1 -0
- package/dist/editorial/config.js +12 -0
- package/dist/editorial/config.js.map +1 -0
- package/dist/editorial/health/ContentHealthReport.d.ts +7 -0
- package/dist/editorial/health/ContentHealthReport.d.ts.map +1 -0
- package/dist/editorial/health/ContentHealthReport.js +29 -0
- package/dist/editorial/health/ContentHealthReport.js.map +1 -0
- package/dist/editorial/health/ContentHealthView.d.ts +3 -0
- package/dist/editorial/health/ContentHealthView.d.ts.map +1 -0
- package/dist/editorial/health/ContentHealthView.js +29 -0
- package/dist/editorial/health/ContentHealthView.js.map +1 -0
- package/dist/editorial/health/HealthSummary.d.ts +6 -0
- package/dist/editorial/health/HealthSummary.d.ts.map +1 -0
- package/dist/editorial/health/HealthSummary.js +39 -0
- package/dist/editorial/health/HealthSummary.js.map +1 -0
- package/dist/editorial/health/checks.d.ts +104 -0
- package/dist/editorial/health/checks.d.ts.map +1 -0
- package/dist/editorial/health/checks.js +188 -0
- package/dist/editorial/health/checks.js.map +1 -0
- package/dist/editorial/health/find.d.ts +43 -0
- package/dist/editorial/health/find.d.ts.map +1 -0
- package/dist/editorial/health/find.js +97 -0
- package/dist/editorial/health/find.js.map +1 -0
- package/dist/editorial/health/tool.d.ts +53 -0
- package/dist/editorial/health/tool.d.ts.map +1 -0
- package/dist/editorial/health/tool.js +80 -0
- package/dist/editorial/health/tool.js.map +1 -0
- package/dist/editorial/index.d.ts +25 -0
- package/dist/editorial/index.d.ts.map +1 -0
- package/dist/editorial/index.js +15 -0
- package/dist/editorial/index.js.map +1 -0
- package/dist/editorial/palette/CommandPalette.d.ts +15 -0
- package/dist/editorial/palette/CommandPalette.d.ts.map +1 -0
- package/dist/editorial/palette/CommandPalette.js +319 -0
- package/dist/editorial/palette/CommandPalette.js.map +1 -0
- package/dist/editorial/palette/ReportsNav.d.ts +5 -0
- package/dist/editorial/palette/ReportsNav.d.ts.map +1 -0
- package/dist/editorial/palette/ReportsNav.js +31 -0
- package/dist/editorial/palette/ReportsNav.js.map +1 -0
- package/dist/editorial/palette/search.d.ts +18 -0
- package/dist/editorial/palette/search.d.ts.map +1 -0
- package/dist/editorial/palette/search.js +41 -0
- package/dist/editorial/palette/search.js.map +1 -0
- package/dist/editorial/palette/sources.d.ts +64 -0
- package/dist/editorial/palette/sources.d.ts.map +1 -0
- package/dist/editorial/palette/sources.js +103 -0
- package/dist/editorial/palette/sources.js.map +1 -0
- package/dist/editorial/palette/styles.d.ts +2 -0
- package/dist/editorial/palette/styles.d.ts.map +1 -0
- package/dist/editorial/palette/styles.js +76 -0
- package/dist/editorial/palette/styles.js.map +1 -0
- package/dist/editorial/palette/tool.d.ts +31 -0
- package/dist/editorial/palette/tool.d.ts.map +1 -0
- package/dist/editorial/palette/tool.js +63 -0
- package/dist/editorial/palette/tool.js.map +1 -0
- package/dist/editorial/plugin.d.ts +76 -0
- package/dist/editorial/plugin.d.ts.map +1 -0
- package/dist/editorial/plugin.js +186 -0
- package/dist/editorial/plugin.js.map +1 -0
- package/dist/editorial/relativeTime.d.ts +3 -0
- package/dist/editorial/relativeTime.d.ts.map +1 -0
- package/dist/editorial/relativeTime.js +27 -0
- package/dist/editorial/relativeTime.js.map +1 -0
- package/dist/editorial/styles.d.ts +2 -0
- package/dist/editorial/styles.d.ts.map +1 -0
- package/dist/editorial/styles.js +191 -0
- package/dist/editorial/styles.js.map +1 -0
- package/dist/editorial/work/YourWork.d.ts +13 -0
- package/dist/editorial/work/YourWork.d.ts.map +1 -0
- package/dist/editorial/work/YourWork.js +40 -0
- package/dist/editorial/work/YourWork.js.map +1 -0
- package/dist/editorial/work/tool.d.ts +45 -0
- package/dist/editorial/work/tool.d.ts.map +1 -0
- package/dist/editorial/work/tool.js +54 -0
- package/dist/editorial/work/tool.js.map +1 -0
- package/dist/editorial/work/work.d.ts +31 -0
- package/dist/editorial/work/work.d.ts.map +1 -0
- package/dist/editorial/work/work.js +68 -0
- package/dist/editorial/work/work.js.map +1 -0
- package/dist/email/client.d.ts +78 -0
- package/dist/email/client.d.ts.map +1 -0
- package/dist/email/client.js +63 -0
- package/dist/email/client.js.map +1 -0
- package/dist/email/functions/_shared.d.ts +17 -0
- package/dist/email/functions/_shared.d.ts.map +1 -0
- package/dist/email/functions/_shared.js +40 -0
- package/dist/email/functions/_shared.js.map +1 -0
- package/dist/email/functions/index.d.ts +7 -0
- package/dist/email/functions/index.d.ts.map +1 -0
- package/dist/email/functions/index.js +4 -0
- package/dist/email/functions/index.js.map +1 -0
- package/dist/email/functions/notify-approval-decision.d.ts +34 -0
- package/dist/email/functions/notify-approval-decision.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-decision.js +77 -0
- package/dist/email/functions/notify-approval-decision.js.map +1 -0
- package/dist/email/functions/notify-approval-expired.d.ts +32 -0
- package/dist/email/functions/notify-approval-expired.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-expired.js +54 -0
- package/dist/email/functions/notify-approval-expired.js.map +1 -0
- package/dist/email/functions/notify-approval-request.d.ts +35 -0
- package/dist/email/functions/notify-approval-request.d.ts.map +1 -0
- package/dist/email/functions/notify-approval-request.js +89 -0
- package/dist/email/functions/notify-approval-request.js.map +1 -0
- package/dist/email/index.d.ts +17 -0
- package/dist/email/index.d.ts.map +1 -0
- package/dist/email/index.js +12 -0
- package/dist/email/index.js.map +1 -0
- package/dist/email/options.d.ts +100 -0
- package/dist/email/options.d.ts.map +1 -0
- package/dist/email/options.js +55 -0
- package/dist/email/options.js.map +1 -0
- package/dist/email/plugin.d.ts +28 -0
- package/dist/email/plugin.d.ts.map +1 -0
- package/dist/email/plugin.js +113 -0
- package/dist/email/plugin.js.map +1 -0
- package/dist/email/templates/ApprovalDecision.d.ts +15 -0
- package/dist/email/templates/ApprovalDecision.d.ts.map +1 -0
- package/dist/email/templates/ApprovalDecision.js +56 -0
- package/dist/email/templates/ApprovalDecision.js.map +1 -0
- package/dist/email/templates/ApprovalExpired.d.ts +10 -0
- package/dist/email/templates/ApprovalExpired.d.ts.map +1 -0
- package/dist/email/templates/ApprovalExpired.js +8 -0
- package/dist/email/templates/ApprovalExpired.js.map +1 -0
- package/dist/email/templates/ApprovalRequest.d.ts +24 -0
- package/dist/email/templates/ApprovalRequest.d.ts.map +1 -0
- package/dist/email/templates/ApprovalRequest.js +58 -0
- package/dist/email/templates/ApprovalRequest.js.map +1 -0
- package/dist/email/templates/_layout.d.ts +17 -0
- package/dist/email/templates/_layout.d.ts.map +1 -0
- package/dist/email/templates/_layout.js +39 -0
- package/dist/email/templates/_layout.js.map +1 -0
- package/dist/email/templates/index.d.ts +9 -0
- package/dist/email/templates/index.d.ts.map +1 -0
- package/dist/email/templates/index.js +5 -0
- package/dist/email/templates/index.js.map +1 -0
- package/dist/email/tokens.d.ts +39 -0
- package/dist/email/tokens.d.ts.map +1 -0
- package/dist/email/tokens.js +17 -0
- package/dist/email/tokens.js.map +1 -0
- package/dist/env/index.d.ts +54 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +113 -0
- package/dist/env/index.js.map +1 -0
- package/dist/events/inngest.d.ts +24 -0
- package/dist/events/inngest.d.ts.map +1 -0
- package/dist/events/inngest.js +24 -0
- package/dist/events/inngest.js.map +1 -0
- package/dist/events/taxonomy.d.ts +84 -0
- package/dist/events/taxonomy.d.ts.map +1 -0
- package/dist/events/taxonomy.js +10 -0
- package/dist/events/taxonomy.js.map +1 -0
- package/dist/events/vercel.d.ts +47 -0
- package/dist/events/vercel.d.ts.map +1 -0
- package/dist/events/vercel.js +69 -0
- package/dist/events/vercel.js.map +1 -0
- package/dist/exports/client.d.ts +24 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +21 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/rsc.d.ts +17 -0
- package/dist/exports/rsc.d.ts.map +1 -0
- package/dist/exports/rsc.js +19 -0
- package/dist/exports/rsc.js.map +1 -0
- package/dist/fields/CharacterCountField.d.ts +4 -0
- package/dist/fields/CharacterCountField.d.ts.map +1 -0
- package/dist/fields/CharacterCountField.js +94 -0
- package/dist/fields/CharacterCountField.js.map +1 -0
- package/dist/fields/characterCount.d.ts +15 -0
- package/dist/fields/characterCount.d.ts.map +1 -0
- package/dist/fields/characterCount.js +92 -0
- package/dist/fields/characterCount.js.map +1 -0
- package/dist/fields/checkSlug.d.ts +62 -0
- package/dist/fields/checkSlug.d.ts.map +1 -0
- package/dist/fields/checkSlug.js +119 -0
- package/dist/fields/checkSlug.js.map +1 -0
- package/dist/fields/index.d.ts +9 -0
- package/dist/fields/index.d.ts.map +1 -0
- package/dist/fields/index.js +9 -0
- package/dist/fields/index.js.map +1 -0
- package/dist/fields/mapFields.d.ts +13 -0
- package/dist/fields/mapFields.d.ts.map +1 -0
- package/dist/fields/mapFields.js +32 -0
- package/dist/fields/mapFields.js.map +1 -0
- package/dist/fields/publishing.d.ts +33 -0
- package/dist/fields/publishing.d.ts.map +1 -0
- package/dist/fields/publishing.js +81 -0
- package/dist/fields/publishing.js.map +1 -0
- package/dist/fields/revisedAt.d.ts +15 -0
- package/dist/fields/revisedAt.d.ts.map +1 -0
- package/dist/fields/revisedAt.js +79 -0
- package/dist/fields/revisedAt.js.map +1 -0
- package/dist/fields/slug.d.ts +21 -0
- package/dist/fields/slug.d.ts.map +1 -0
- package/dist/fields/slug.js +102 -0
- package/dist/fields/slug.js.map +1 -0
- package/dist/fields/unlisted.d.ts +13 -0
- package/dist/fields/unlisted.d.ts.map +1 -0
- package/dist/fields/unlisted.js +35 -0
- package/dist/fields/unlisted.js.map +1 -0
- package/dist/fields/usedBy.d.ts +12 -0
- package/dist/fields/usedBy.d.ts.map +1 -0
- package/dist/fields/usedBy.js +36 -0
- package/dist/fields/usedBy.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/admin/SyncButton.d.ts +27 -0
- package/dist/integrations/admin/SyncButton.d.ts.map +1 -0
- package/dist/integrations/admin/SyncButton.js +134 -0
- package/dist/integrations/admin/SyncButton.js.map +1 -0
- package/dist/integrations/admin/sync-client.d.ts +83 -0
- package/dist/integrations/admin/sync-client.d.ts.map +1 -0
- package/dist/integrations/admin/sync-client.js +121 -0
- package/dist/integrations/admin/sync-client.js.map +1 -0
- package/dist/integrations/collection.d.ts +26 -0
- package/dist/integrations/collection.d.ts.map +1 -0
- package/dist/integrations/collection.js +193 -0
- package/dist/integrations/collection.js.map +1 -0
- package/dist/integrations/endpoints/sync.d.ts +27 -0
- package/dist/integrations/endpoints/sync.d.ts.map +1 -0
- package/dist/integrations/endpoints/sync.js +90 -0
- package/dist/integrations/endpoints/sync.js.map +1 -0
- package/dist/integrations/index.d.ts +22 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +15 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/integrations/index.d.ts +3 -0
- package/dist/integrations/integrations/index.d.ts.map +1 -0
- package/dist/integrations/integrations/index.js +2 -0
- package/dist/integrations/integrations/index.js.map +1 -0
- package/dist/integrations/integrations/webhook/config-fields.d.ts +33 -0
- package/dist/integrations/integrations/webhook/config-fields.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/config-fields.js +54 -0
- package/dist/integrations/integrations/webhook/config-fields.js.map +1 -0
- package/dist/integrations/integrations/webhook/functions.d.ts +24 -0
- package/dist/integrations/integrations/webhook/functions.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/functions.js +139 -0
- package/dist/integrations/integrations/webhook/functions.js.map +1 -0
- package/dist/integrations/integrations/webhook/healthcheck.d.ts +10 -0
- package/dist/integrations/integrations/webhook/healthcheck.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/healthcheck.js +26 -0
- package/dist/integrations/integrations/webhook/healthcheck.js.map +1 -0
- package/dist/integrations/integrations/webhook/hmac.d.ts +11 -0
- package/dist/integrations/integrations/webhook/hmac.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/hmac.js +25 -0
- package/dist/integrations/integrations/webhook/hmac.js.map +1 -0
- package/dist/integrations/integrations/webhook/index.d.ts +6 -0
- package/dist/integrations/integrations/webhook/index.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/index.js +47 -0
- package/dist/integrations/integrations/webhook/index.js.map +1 -0
- package/dist/integrations/integrations/webhook/payload.d.ts +9 -0
- package/dist/integrations/integrations/webhook/payload.d.ts.map +1 -0
- package/dist/integrations/integrations/webhook/payload.js +19 -0
- package/dist/integrations/integrations/webhook/payload.js.map +1 -0
- package/dist/integrations/jobs/healthcheck.d.ts +24 -0
- package/dist/integrations/jobs/healthcheck.d.ts.map +1 -0
- package/dist/integrations/jobs/healthcheck.js +133 -0
- package/dist/integrations/jobs/healthcheck.js.map +1 -0
- package/dist/integrations/options.d.ts +54 -0
- package/dist/integrations/options.d.ts.map +1 -0
- package/dist/integrations/options.js +8 -0
- package/dist/integrations/options.js.map +1 -0
- package/dist/integrations/plugin.d.ts +51 -0
- package/dist/integrations/plugin.d.ts.map +1 -0
- package/dist/integrations/plugin.js +215 -0
- package/dist/integrations/plugin.js.map +1 -0
- package/dist/integrations/registry.d.ts +27 -0
- package/dist/integrations/registry.d.ts.map +1 -0
- package/dist/integrations/registry.js +39 -0
- package/dist/integrations/registry.js.map +1 -0
- package/dist/integrations/sync/manual-sync.d.ts +70 -0
- package/dist/integrations/sync/manual-sync.d.ts.map +1 -0
- package/dist/integrations/sync/manual-sync.js +91 -0
- package/dist/integrations/sync/manual-sync.js.map +1 -0
- package/dist/integrations/sync/problems.d.ts +31 -0
- package/dist/integrations/sync/problems.d.ts.map +1 -0
- package/dist/integrations/sync/problems.js +40 -0
- package/dist/integrations/sync/problems.js.map +1 -0
- package/dist/integrations/sync/status.d.ts +15 -0
- package/dist/integrations/sync/status.d.ts.map +1 -0
- package/dist/integrations/sync/status.js +31 -0
- package/dist/integrations/sync/status.js.map +1 -0
- package/dist/integrations/tools/access.d.ts +5 -0
- package/dist/integrations/tools/access.d.ts.map +1 -0
- package/dist/integrations/tools/access.js +14 -0
- package/dist/integrations/tools/access.js.map +1 -0
- package/dist/integrations/tools/descriptors.d.ts +26 -0
- package/dist/integrations/tools/descriptors.d.ts.map +1 -0
- package/dist/integrations/tools/descriptors.js +35 -0
- package/dist/integrations/tools/descriptors.js.map +1 -0
- package/dist/integrations/tools/get-integration-status.d.ts +17 -0
- package/dist/integrations/tools/get-integration-status.d.ts.map +1 -0
- package/dist/integrations/tools/get-integration-status.js +41 -0
- package/dist/integrations/tools/get-integration-status.js.map +1 -0
- package/dist/integrations/tools/index.d.ts +13 -0
- package/dist/integrations/tools/index.d.ts.map +1 -0
- package/dist/integrations/tools/index.js +8 -0
- package/dist/integrations/tools/index.js.map +1 -0
- package/dist/integrations/tools/list-integration-types.d.ts +10 -0
- package/dist/integrations/tools/list-integration-types.d.ts.map +1 -0
- package/dist/integrations/tools/list-integration-types.js +22 -0
- package/dist/integrations/tools/list-integration-types.js.map +1 -0
- package/dist/integrations/tools/list-integrations.d.ts +20 -0
- package/dist/integrations/tools/list-integrations.d.ts.map +1 -0
- package/dist/integrations/tools/list-integrations.js +49 -0
- package/dist/integrations/tools/list-integrations.js.map +1 -0
- package/dist/integrations/tools/test-integration.d.ts +19 -0
- package/dist/integrations/tools/test-integration.d.ts.map +1 -0
- package/dist/integrations/tools/test-integration.js +51 -0
- package/dist/integrations/tools/test-integration.js.map +1 -0
- package/dist/integrations/tools/trigger-sync.d.ts +26 -0
- package/dist/integrations/tools/trigger-sync.d.ts.map +1 -0
- package/dist/integrations/tools/trigger-sync.js +44 -0
- package/dist/integrations/tools/trigger-sync.js.map +1 -0
- package/dist/integrations/types.d.ts +183 -0
- package/dist/integrations/types.d.ts.map +1 -0
- package/dist/integrations/types.js +2 -0
- package/dist/integrations/types.js.map +1 -0
- package/dist/jobs/define.d.ts +17 -0
- package/dist/jobs/define.d.ts.map +1 -0
- package/dist/jobs/define.js +39 -0
- package/dist/jobs/define.js.map +1 -0
- package/dist/jobs/failure-handler.d.ts +39 -0
- package/dist/jobs/failure-handler.d.ts.map +1 -0
- package/dist/jobs/failure-handler.js +62 -0
- package/dist/jobs/failure-handler.js.map +1 -0
- package/dist/jobs/index.d.ts +28 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +7 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/inngest/adapter.d.ts +39 -0
- package/dist/jobs/inngest/adapter.d.ts.map +1 -0
- package/dist/jobs/inngest/adapter.js +81 -0
- package/dist/jobs/inngest/adapter.js.map +1 -0
- package/dist/jobs/inngest/index.d.ts +15 -0
- package/dist/jobs/inngest/index.d.ts.map +1 -0
- package/dist/jobs/inngest/index.js +13 -0
- package/dist/jobs/inngest/index.js.map +1 -0
- package/dist/jobs/options.d.ts +18 -0
- package/dist/jobs/options.d.ts.map +1 -0
- package/dist/jobs/options.js +12 -0
- package/dist/jobs/options.js.map +1 -0
- package/dist/jobs/payload/adapter.d.ts +33 -0
- package/dist/jobs/payload/adapter.d.ts.map +1 -0
- package/dist/jobs/payload/adapter.js +257 -0
- package/dist/jobs/payload/adapter.js.map +1 -0
- package/dist/jobs/payload/index.d.ts +8 -0
- package/dist/jobs/payload/index.d.ts.map +1 -0
- package/dist/jobs/payload/index.js +7 -0
- package/dist/jobs/payload/index.js.map +1 -0
- package/dist/jobs/sender.d.ts +4 -0
- package/dist/jobs/sender.d.ts.map +1 -0
- package/dist/jobs/sender.js +19 -0
- package/dist/jobs/sender.js.map +1 -0
- package/dist/jobs/types.d.ts +105 -0
- package/dist/jobs/types.d.ts.map +1 -0
- package/dist/jobs/types.js +2 -0
- package/dist/jobs/types.js.map +1 -0
- package/dist/jobs/workflow-types.d.ts +280 -0
- package/dist/jobs/workflow-types.d.ts.map +1 -0
- package/dist/jobs/workflow-types.js +22 -0
- package/dist/jobs/workflow-types.js.map +1 -0
- package/dist/logger/index.d.ts +9 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +41 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/mcp/api-key-access.d.ts +50 -0
- package/dist/mcp/api-key-access.d.ts.map +1 -0
- package/dist/mcp/api-key-access.js +94 -0
- package/dist/mcp/api-key-access.js.map +1 -0
- package/dist/mcp/audit-context.d.ts +39 -0
- package/dist/mcp/audit-context.d.ts.map +1 -0
- package/dist/mcp/audit-context.js +36 -0
- package/dist/mcp/audit-context.js.map +1 -0
- package/dist/mcp/audit-server.d.ts +13 -0
- package/dist/mcp/audit-server.d.ts.map +1 -0
- package/dist/mcp/audit-server.js +68 -0
- package/dist/mcp/audit-server.js.map +1 -0
- package/dist/mcp/collector.d.ts +51 -0
- package/dist/mcp/collector.d.ts.map +1 -0
- package/dist/mcp/collector.js +96 -0
- package/dist/mcp/collector.js.map +1 -0
- package/dist/mcp/envelope.d.ts +22 -0
- package/dist/mcp/envelope.d.ts.map +1 -0
- package/dist/mcp/envelope.js +22 -0
- package/dist/mcp/envelope.js.map +1 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/meta.d.ts +74 -0
- package/dist/mcp/meta.d.ts.map +1 -0
- package/dist/mcp/meta.js +27 -0
- package/dist/mcp/meta.js.map +1 -0
- package/dist/mcp/payload-mcp.d.ts +68 -0
- package/dist/mcp/payload-mcp.d.ts.map +1 -0
- package/dist/mcp/payload-mcp.js +175 -0
- package/dist/mcp/payload-mcp.js.map +1 -0
- package/dist/media/hooks.d.ts +70 -0
- package/dist/media/hooks.d.ts.map +1 -0
- package/dist/media/hooks.js +200 -0
- package/dist/media/hooks.js.map +1 -0
- package/dist/media/index.d.ts +8 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +7 -0
- package/dist/media/index.js.map +1 -0
- package/dist/media/svg.d.ts +17 -0
- package/dist/media/svg.d.ts.map +1 -0
- package/dist/media/svg.js +241 -0
- package/dist/media/svg.js.map +1 -0
- package/dist/media/uploadKey.d.ts +25 -0
- package/dist/media/uploadKey.d.ts.map +1 -0
- package/dist/media/uploadKey.js +70 -0
- package/dist/media/uploadKey.js.map +1 -0
- package/dist/observability/collection.d.ts +13 -0
- package/dist/observability/collection.d.ts.map +1 -0
- package/dist/observability/collection.js +76 -0
- package/dist/observability/collection.js.map +1 -0
- package/dist/observability/index.d.ts +10 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +6 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/plugin.d.ts +24 -0
- package/dist/observability/plugin.d.ts.map +1 -0
- package/dist/observability/plugin.js +59 -0
- package/dist/observability/plugin.js.map +1 -0
- package/dist/observability/report.d.ts +175 -0
- package/dist/observability/report.d.ts.map +1 -0
- package/dist/observability/report.js +274 -0
- package/dist/observability/report.js.map +1 -0
- package/dist/observability/tool.d.ts +33 -0
- package/dist/observability/tool.d.ts.map +1 -0
- package/dist/observability/tool.js +75 -0
- package/dist/observability/tool.js.map +1 -0
- package/dist/observability/writer.d.ts +24 -0
- package/dist/observability/writer.d.ts.map +1 -0
- package/dist/observability/writer.js +72 -0
- package/dist/observability/writer.js.map +1 -0
- package/dist/plugin-contract/admin.d.ts +45 -0
- package/dist/plugin-contract/admin.d.ts.map +1 -0
- package/dist/plugin-contract/admin.js +12 -0
- package/dist/plugin-contract/admin.js.map +1 -0
- package/dist/plugin-contract/env.d.ts +29 -0
- package/dist/plugin-contract/env.d.ts.map +1 -0
- package/dist/plugin-contract/env.js +2 -0
- package/dist/plugin-contract/env.js.map +1 -0
- package/dist/plugin-contract/index.d.ts +39 -0
- package/dist/plugin-contract/index.d.ts.map +1 -0
- package/dist/plugin-contract/index.js +5 -0
- package/dist/plugin-contract/index.js.map +1 -0
- package/dist/plugin-contract/mcp.d.ts +51 -0
- package/dist/plugin-contract/mcp.d.ts.map +1 -0
- package/dist/plugin-contract/mcp.js +2 -0
- package/dist/plugin-contract/mcp.js.map +1 -0
- package/dist/plugin-contract/registry.d.ts +23 -0
- package/dist/plugin-contract/registry.d.ts.map +1 -0
- package/dist/plugin-contract/registry.js +51 -0
- package/dist/plugin-contract/registry.js.map +1 -0
- package/dist/publishing/admin/PublishButton.d.ts +22 -0
- package/dist/publishing/admin/PublishButton.d.ts.map +1 -0
- package/dist/publishing/admin/PublishButton.js +164 -0
- package/dist/publishing/admin/PublishButton.js.map +1 -0
- package/dist/publishing/admin/SchedulePublishField.d.ts +24 -0
- package/dist/publishing/admin/SchedulePublishField.d.ts.map +1 -0
- package/dist/publishing/admin/SchedulePublishField.js +160 -0
- package/dist/publishing/admin/SchedulePublishField.js.map +1 -0
- package/dist/publishing/admin/UnpublishButton.d.ts +15 -0
- package/dist/publishing/admin/UnpublishButton.d.ts.map +1 -0
- package/dist/publishing/admin/UnpublishButton.js +90 -0
- package/dist/publishing/admin/UnpublishButton.js.map +1 -0
- package/dist/publishing/admin/publishing-client.d.ts +105 -0
- package/dist/publishing/admin/publishing-client.d.ts.map +1 -0
- package/dist/publishing/admin/publishing-client.js +139 -0
- package/dist/publishing/admin/publishing-client.js.map +1 -0
- package/dist/publishing/admin/schedule-state.d.ts +30 -0
- package/dist/publishing/admin/schedule-state.d.ts.map +1 -0
- package/dist/publishing/admin/schedule-state.js +39 -0
- package/dist/publishing/admin/schedule-state.js.map +1 -0
- package/dist/publishing/checks/alt-text.d.ts +17 -0
- package/dist/publishing/checks/alt-text.d.ts.map +1 -0
- package/dist/publishing/checks/alt-text.js +63 -0
- package/dist/publishing/checks/alt-text.js.map +1 -0
- package/dist/publishing/checks/heading-hierarchy.d.ts +11 -0
- package/dist/publishing/checks/heading-hierarchy.d.ts.map +1 -0
- package/dist/publishing/checks/heading-hierarchy.js +32 -0
- package/dist/publishing/checks/heading-hierarchy.js.map +1 -0
- package/dist/publishing/checks/index.d.ts +6 -0
- package/dist/publishing/checks/index.d.ts.map +1 -0
- package/dist/publishing/checks/index.js +13 -0
- package/dist/publishing/checks/index.js.map +1 -0
- package/dist/publishing/checks/link-labels.d.ts +9 -0
- package/dist/publishing/checks/link-labels.d.ts.map +1 -0
- package/dist/publishing/checks/link-labels.js +44 -0
- package/dist/publishing/checks/link-labels.js.map +1 -0
- package/dist/publishing/endpoints/admin.d.ts +19 -0
- package/dist/publishing/endpoints/admin.d.ts.map +1 -0
- package/dist/publishing/endpoints/admin.js +112 -0
- package/dist/publishing/endpoints/admin.js.map +1 -0
- package/dist/publishing/events.d.ts +16 -0
- package/dist/publishing/events.d.ts.map +1 -0
- package/dist/publishing/events.js +30 -0
- package/dist/publishing/events.js.map +1 -0
- package/dist/publishing/hooks/block-status-writes.d.ts +52 -0
- package/dist/publishing/hooks/block-status-writes.d.ts.map +1 -0
- package/dist/publishing/hooks/block-status-writes.js +242 -0
- package/dist/publishing/hooks/block-status-writes.js.map +1 -0
- package/dist/publishing/hooks/draft-writes.d.ts +32 -0
- package/dist/publishing/hooks/draft-writes.d.ts.map +1 -0
- package/dist/publishing/hooks/draft-writes.js +76 -0
- package/dist/publishing/hooks/draft-writes.js.map +1 -0
- package/dist/publishing/hooks/schedule-events.d.ts +26 -0
- package/dist/publishing/hooks/schedule-events.d.ts.map +1 -0
- package/dist/publishing/hooks/schedule-events.js +54 -0
- package/dist/publishing/hooks/schedule-events.js.map +1 -0
- package/dist/publishing/index.d.ts +35 -0
- package/dist/publishing/index.d.ts.map +1 -0
- package/dist/publishing/index.js +32 -0
- package/dist/publishing/index.js.map +1 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.d.ts +24 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.d.ts.map +1 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.js +114 -0
- package/dist/publishing/jobs/execute-scheduled-publishes.js.map +1 -0
- package/dist/publishing/jobs/next-revalidate.d.ts +43 -0
- package/dist/publishing/jobs/next-revalidate.d.ts.map +1 -0
- package/dist/publishing/jobs/next-revalidate.js +42 -0
- package/dist/publishing/jobs/next-revalidate.js.map +1 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.d.ts +24 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.d.ts.map +1 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.js +136 -0
- package/dist/publishing/jobs/publish-at-scheduled-time.js.map +1 -0
- package/dist/publishing/jobs/revalidate-on-publish.d.ts +24 -0
- package/dist/publishing/jobs/revalidate-on-publish.d.ts.map +1 -0
- package/dist/publishing/jobs/revalidate-on-publish.js +78 -0
- package/dist/publishing/jobs/revalidate-on-publish.js.map +1 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.d.ts +80 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.d.ts.map +1 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.js +116 -0
- package/dist/publishing/jobs/revalidate-tag-hooks.js.map +1 -0
- package/dist/publishing/options.d.ts +100 -0
- package/dist/publishing/options.d.ts.map +1 -0
- package/dist/publishing/options.js +56 -0
- package/dist/publishing/options.js.map +1 -0
- package/dist/publishing/pipeline/index.d.ts +20 -0
- package/dist/publishing/pipeline/index.d.ts.map +1 -0
- package/dist/publishing/pipeline/index.js +88 -0
- package/dist/publishing/pipeline/index.js.map +1 -0
- package/dist/publishing/pipeline/steps/accessibility.d.ts +13 -0
- package/dist/publishing/pipeline/steps/accessibility.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/accessibility.js +37 -0
- package/dist/publishing/pipeline/steps/accessibility.js.map +1 -0
- package/dist/publishing/pipeline/steps/approval.d.ts +14 -0
- package/dist/publishing/pipeline/steps/approval.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/approval.js +54 -0
- package/dist/publishing/pipeline/steps/approval.js.map +1 -0
- package/dist/publishing/pipeline/steps/composition.d.ts +14 -0
- package/dist/publishing/pipeline/steps/composition.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/composition.js +63 -0
- package/dist/publishing/pipeline/steps/composition.js.map +1 -0
- package/dist/publishing/pipeline/steps/embargo.d.ts +12 -0
- package/dist/publishing/pipeline/steps/embargo.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/embargo.js +41 -0
- package/dist/publishing/pipeline/steps/embargo.js.map +1 -0
- package/dist/publishing/pipeline/steps/execute.d.ts +52 -0
- package/dist/publishing/pipeline/steps/execute.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/execute.js +161 -0
- package/dist/publishing/pipeline/steps/execute.js.map +1 -0
- package/dist/publishing/pipeline/steps/exist.d.ts +9 -0
- package/dist/publishing/pipeline/steps/exist.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/exist.js +31 -0
- package/dist/publishing/pipeline/steps/exist.js.map +1 -0
- package/dist/publishing/pipeline/steps/required-fields.d.ts +9 -0
- package/dist/publishing/pipeline/steps/required-fields.d.ts.map +1 -0
- package/dist/publishing/pipeline/steps/required-fields.js +63 -0
- package/dist/publishing/pipeline/steps/required-fields.js.map +1 -0
- package/dist/publishing/pipeline/types.d.ts +72 -0
- package/dist/publishing/pipeline/types.d.ts.map +1 -0
- package/dist/publishing/pipeline/types.js +2 -0
- package/dist/publishing/pipeline/types.js.map +1 -0
- package/dist/publishing/plugin.d.ts +4 -0
- package/dist/publishing/plugin.d.ts.map +1 -0
- package/dist/publishing/plugin.js +196 -0
- package/dist/publishing/plugin.js.map +1 -0
- package/dist/publishing/service.d.ts +149 -0
- package/dist/publishing/service.d.ts.map +1 -0
- package/dist/publishing/service.js +474 -0
- package/dist/publishing/service.js.map +1 -0
- package/dist/publishing/tools/actor.d.ts +32 -0
- package/dist/publishing/tools/actor.d.ts.map +1 -0
- package/dist/publishing/tools/actor.js +40 -0
- package/dist/publishing/tools/actor.js.map +1 -0
- package/dist/publishing/tools/descriptors.d.ts +26 -0
- package/dist/publishing/tools/descriptors.d.ts.map +1 -0
- package/dist/publishing/tools/descriptors.js +38 -0
- package/dist/publishing/tools/descriptors.js.map +1 -0
- package/dist/publishing/tools/get-publish-status.d.ts +12 -0
- package/dist/publishing/tools/get-publish-status.d.ts.map +1 -0
- package/dist/publishing/tools/get-publish-status.js +45 -0
- package/dist/publishing/tools/get-publish-status.js.map +1 -0
- package/dist/publishing/tools/index.d.ts +7 -0
- package/dist/publishing/tools/index.d.ts.map +1 -0
- package/dist/publishing/tools/index.js +7 -0
- package/dist/publishing/tools/index.js.map +1 -0
- package/dist/publishing/tools/publish.d.ts +14 -0
- package/dist/publishing/tools/publish.d.ts.map +1 -0
- package/dist/publishing/tools/publish.js +35 -0
- package/dist/publishing/tools/publish.js.map +1 -0
- package/dist/publishing/tools/rollback.d.ts +11 -0
- package/dist/publishing/tools/rollback.d.ts.map +1 -0
- package/dist/publishing/tools/rollback.js +98 -0
- package/dist/publishing/tools/rollback.js.map +1 -0
- package/dist/publishing/tools/schedule-publish.d.ts +20 -0
- package/dist/publishing/tools/schedule-publish.d.ts.map +1 -0
- package/dist/publishing/tools/schedule-publish.js +49 -0
- package/dist/publishing/tools/schedule-publish.js.map +1 -0
- package/dist/publishing/tools/unpublish.d.ts +14 -0
- package/dist/publishing/tools/unpublish.d.ts.map +1 -0
- package/dist/publishing/tools/unpublish.js +29 -0
- package/dist/publishing/tools/unpublish.js.map +1 -0
- package/dist/references/UsedOnPanel.d.ts +3 -0
- package/dist/references/UsedOnPanel.d.ts.map +1 -0
- package/dist/references/UsedOnPanel.js +47 -0
- package/dist/references/UsedOnPanel.js.map +1 -0
- package/dist/references/find.d.ts +46 -0
- package/dist/references/find.d.ts.map +1 -0
- package/dist/references/find.js +142 -0
- package/dist/references/find.js.map +1 -0
- package/dist/references/guards.d.ts +32 -0
- package/dist/references/guards.d.ts.map +1 -0
- package/dist/references/guards.js +76 -0
- package/dist/references/guards.js.map +1 -0
- package/dist/references/index.d.ts +11 -0
- package/dist/references/index.d.ts.map +1 -0
- package/dist/references/index.js +6 -0
- package/dist/references/index.js.map +1 -0
- package/dist/references/plugin.d.ts +51 -0
- package/dist/references/plugin.d.ts.map +1 -0
- package/dist/references/plugin.js +111 -0
- package/dist/references/plugin.js.map +1 -0
- package/dist/references/tools.d.ts +54 -0
- package/dist/references/tools.d.ts.map +1 -0
- package/dist/references/tools.js +124 -0
- package/dist/references/tools.js.map +1 -0
- package/dist/references/walk.d.ts +43 -0
- package/dist/references/walk.d.ts.map +1 -0
- package/dist/references/walk.js +214 -0
- package/dist/references/walk.js.map +1 -0
- package/dist/testing/anonymousAccess.d.ts +111 -0
- package/dist/testing/anonymousAccess.d.ts.map +1 -0
- package/dist/testing/anonymousAccess.js +185 -0
- package/dist/testing/anonymousAccess.js.map +1 -0
- package/dist/testing/describeAnonymousAccess.d.ts +26 -0
- package/dist/testing/describeAnonymousAccess.d.ts.map +1 -0
- package/dist/testing/describeAnonymousAccess.js +76 -0
- package/dist/testing/describeAnonymousAccess.js.map +1 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +9 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/content-hash.d.ts +31 -0
- package/dist/utils/content-hash.d.ts.map +1 -0
- package/dist/utils/content-hash.js +94 -0
- package/dist/utils/content-hash.js.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/relationships.d.ts +17 -0
- package/dist/utils/relationships.d.ts.map +1 -0
- package/dist/utils/relationships.js +26 -0
- package/dist/utils/relationships.js.map +1 -0
- package/dist/utils/sha256.d.ts +10 -0
- package/dist/utils/sha256.d.ts.map +1 -0
- package/dist/utils/sha256.js +16 -0
- package/dist/utils/sha256.js.map +1 -0
- package/dist/utils/zod-issues.d.ts +19 -0
- package/dist/utils/zod-issues.d.ts.map +1 -0
- package/dist/utils/zod-issues.js +22 -0
- package/dist/utils/zod-issues.js.map +1 -0
- package/package.json +183 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Endpoint, Payload } from 'payload';
|
|
2
|
+
import type { AuditWriter } from '../../audit/writer.js';
|
|
3
|
+
import type { ApprovalsPluginOptions } from '../options.js';
|
|
4
|
+
import { type VerifyResult } from '../tokens.js';
|
|
5
|
+
export interface CreateActionEndpointDeps {
|
|
6
|
+
options: ApprovalsPluginOptions & {
|
|
7
|
+
tokenSecret: string;
|
|
8
|
+
};
|
|
9
|
+
auditWriter: AuditWriter;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Builds the GET endpoint that handles inline action links from emails.
|
|
13
|
+
* The flow is:
|
|
14
|
+
* - First request: render a confirmation page so a single misclicked
|
|
15
|
+
* link can't act on the approval.
|
|
16
|
+
* - Second request (with `confirm=true`): verify the token wasn't
|
|
17
|
+
* already consumed and apply the decision.
|
|
18
|
+
*
|
|
19
|
+
* Uses HTML responses (intentionally minimal styling — clients can drop
|
|
20
|
+
* a custom-branded endpoint in front if they want).
|
|
21
|
+
*/
|
|
22
|
+
export declare function createActionEndpoint(deps: CreateActionEndpointDeps): Endpoint;
|
|
23
|
+
/** Lower-level helper exported for test consumers and custom action endpoints. */
|
|
24
|
+
export type ActionVerification = VerifyResult;
|
|
25
|
+
export declare function previewVerification(token: string, payload: Payload, options: ApprovalsPluginOptions & {
|
|
26
|
+
tokenSecret: string;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
verification: VerifyResult;
|
|
29
|
+
approval: Record<string, unknown> | null;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/approvals/endpoints/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,sBAAsB,GAAG;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;IACzD,WAAW,EAAE,WAAW,CAAA;CACzB;AAqBD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,wBAAwB,GAAG,QAAQ,CA+H7E;AAED,kFAAkF;AAClF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAA;AAE7C,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,sBAAsB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACxD,OAAO,CAAC;IAAE,YAAY,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,CAAC,CAQnF"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { DEFAULT_APPROVALS_SLUG } from '../collection.js';
|
|
2
|
+
import { verifyActionToken, } from '../tokens.js';
|
|
3
|
+
const DECISION_STATUS_MAP = {
|
|
4
|
+
approve: 'granted',
|
|
5
|
+
decline: 'declined',
|
|
6
|
+
changes: 'changes-requested',
|
|
7
|
+
};
|
|
8
|
+
const DECISION_AUDIT_MAP = {
|
|
9
|
+
approve: 'approval.granted',
|
|
10
|
+
decline: 'approval.declined',
|
|
11
|
+
changes: 'approval.changes_requested',
|
|
12
|
+
};
|
|
13
|
+
const ACTION_LABEL = {
|
|
14
|
+
approve: 'Approve',
|
|
15
|
+
decline: 'Decline',
|
|
16
|
+
changes: 'Request changes',
|
|
17
|
+
discuss: 'Start discussion',
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Builds the GET endpoint that handles inline action links from emails.
|
|
21
|
+
* The flow is:
|
|
22
|
+
* - First request: render a confirmation page so a single misclicked
|
|
23
|
+
* link can't act on the approval.
|
|
24
|
+
* - Second request (with `confirm=true`): verify the token wasn't
|
|
25
|
+
* already consumed and apply the decision.
|
|
26
|
+
*
|
|
27
|
+
* Uses HTML responses (intentionally minimal styling — clients can drop
|
|
28
|
+
* a custom-branded endpoint in front if they want).
|
|
29
|
+
*/
|
|
30
|
+
export function createActionEndpoint(deps) {
|
|
31
|
+
return {
|
|
32
|
+
path: '/approvals/action',
|
|
33
|
+
method: 'get',
|
|
34
|
+
handler: async (req) => {
|
|
35
|
+
const url = new URL(req.url ?? 'http://localhost');
|
|
36
|
+
const token = url.searchParams.get('token');
|
|
37
|
+
if (!token)
|
|
38
|
+
return htmlResponse(renderError('Missing action token'), 400);
|
|
39
|
+
const verification = await verifyActionToken(token, deps.options.tokenSecret);
|
|
40
|
+
if (!verification.ok) {
|
|
41
|
+
return htmlResponse(renderError(verification.error), 401);
|
|
42
|
+
}
|
|
43
|
+
const collectionSlug = deps.options.collectionSlug ?? DEFAULT_APPROVALS_SLUG;
|
|
44
|
+
const approval = (await req.payload.findByID({
|
|
45
|
+
collection: collectionSlug,
|
|
46
|
+
id: verification.token.approvalId,
|
|
47
|
+
}));
|
|
48
|
+
if (!approval)
|
|
49
|
+
return htmlResponse(renderError('Approval not found'), 404);
|
|
50
|
+
const status = String(approval['status']);
|
|
51
|
+
if (status !== 'pending') {
|
|
52
|
+
return htmlResponse(renderInfo(`This request was already ${status}.`));
|
|
53
|
+
}
|
|
54
|
+
const consumed = approval['consumedTokens'] ?? [];
|
|
55
|
+
if (consumed.includes(token)) {
|
|
56
|
+
return htmlResponse(renderError('This action link has already been used'), 400);
|
|
57
|
+
}
|
|
58
|
+
const expiresAtRaw = approval['expiresAt'];
|
|
59
|
+
if (typeof expiresAtRaw === 'string' &&
|
|
60
|
+
Date.parse(expiresAtRaw) < Date.now()) {
|
|
61
|
+
return htmlResponse(renderInfo('This approval request has expired.'));
|
|
62
|
+
}
|
|
63
|
+
const action = verification.token.action;
|
|
64
|
+
const confirm = url.searchParams.get('confirm') === 'true';
|
|
65
|
+
if (!confirm) {
|
|
66
|
+
return htmlResponse(renderConfirmation({
|
|
67
|
+
token,
|
|
68
|
+
action,
|
|
69
|
+
targetTitle: stringOrFallback(approval['targetTitle'], 'this document'),
|
|
70
|
+
changesSummary: stringOrFallback(approval['changesSummary'], ''),
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
if (action === 'discuss') {
|
|
74
|
+
// Discuss isn't a decision — surface a message and don't mutate state.
|
|
75
|
+
// C11 listens for the 'approval/discussed' event to thread it into
|
|
76
|
+
// the email reply UX once that lands.
|
|
77
|
+
await deps.options.inngest.send({
|
|
78
|
+
name: 'approval/discussed',
|
|
79
|
+
data: {
|
|
80
|
+
approvalId: verification.token.approvalId,
|
|
81
|
+
approverId: verification.token.approverId,
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
await deps.auditWriter({
|
|
85
|
+
actor: { type: 'user', userId: verification.token.approverId, apiKeyName: 'action-token' },
|
|
86
|
+
action: 'approval.discussed',
|
|
87
|
+
mcpServer: 'approvals',
|
|
88
|
+
mcpTool: 'action-endpoint',
|
|
89
|
+
targetCollection: String(approval['targetCollection']),
|
|
90
|
+
targetId: String(approval['targetId']),
|
|
91
|
+
approvalRequestId: verification.token.approvalId,
|
|
92
|
+
success: true,
|
|
93
|
+
});
|
|
94
|
+
return htmlResponse(renderInfo('Thanks — a discussion thread will follow up by email.'));
|
|
95
|
+
}
|
|
96
|
+
const newStatus = DECISION_STATUS_MAP[action];
|
|
97
|
+
const decidedAt = new Date().toISOString();
|
|
98
|
+
await req.payload.update({
|
|
99
|
+
collection: collectionSlug,
|
|
100
|
+
id: verification.token.approvalId,
|
|
101
|
+
data: {
|
|
102
|
+
status: newStatus,
|
|
103
|
+
decidedBy: verification.token.approverId,
|
|
104
|
+
decidedAt,
|
|
105
|
+
consumedTokens: [...consumed, token],
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
await deps.options.inngest.send({
|
|
109
|
+
name: 'approval/decided',
|
|
110
|
+
data: {
|
|
111
|
+
approvalId: verification.token.approvalId,
|
|
112
|
+
decision: newStatus,
|
|
113
|
+
decidedBy: verification.token.approverId,
|
|
114
|
+
decidedAt,
|
|
115
|
+
targetCollection: String(approval['targetCollection']),
|
|
116
|
+
targetId: String(approval['targetId']),
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
await deps.auditWriter({
|
|
120
|
+
actor: {
|
|
121
|
+
type: 'user',
|
|
122
|
+
userId: verification.token.approverId,
|
|
123
|
+
apiKeyName: 'action-token',
|
|
124
|
+
},
|
|
125
|
+
action: DECISION_AUDIT_MAP[action],
|
|
126
|
+
mcpServer: 'approvals',
|
|
127
|
+
mcpTool: 'action-endpoint',
|
|
128
|
+
targetCollection: String(approval['targetCollection']),
|
|
129
|
+
targetId: String(approval['targetId']),
|
|
130
|
+
targetTitle: stringOrFallback(approval['targetTitle'], String(approval['targetId'])),
|
|
131
|
+
approvalRequestId: verification.token.approvalId,
|
|
132
|
+
success: true,
|
|
133
|
+
});
|
|
134
|
+
return htmlResponse(renderSuccess(ACTION_LABEL[action], stringOrFallback(approval['targetTitle'], 'this document')));
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export async function previewVerification(token, payload, options) {
|
|
139
|
+
const verification = await verifyActionToken(token, options.tokenSecret);
|
|
140
|
+
if (!verification.ok)
|
|
141
|
+
return { verification, approval: null };
|
|
142
|
+
const approval = (await payload.findByID({
|
|
143
|
+
collection: options.collectionSlug ?? DEFAULT_APPROVALS_SLUG,
|
|
144
|
+
id: verification.token.approvalId,
|
|
145
|
+
}));
|
|
146
|
+
return { verification, approval };
|
|
147
|
+
}
|
|
148
|
+
function htmlResponse(html, status = 200) {
|
|
149
|
+
return new Response(html, {
|
|
150
|
+
status,
|
|
151
|
+
headers: { 'content-type': 'text/html; charset=utf-8' },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function renderConfirmation(args) {
|
|
155
|
+
const label = ACTION_LABEL[args.action];
|
|
156
|
+
const summary = args.changesSummary
|
|
157
|
+
? `<p><strong>What's changing:</strong> ${escape(args.changesSummary)}</p>`
|
|
158
|
+
: '';
|
|
159
|
+
return htmlPage(`
|
|
160
|
+
<h1>${escape(label)}</h1>
|
|
161
|
+
<p>You're about to <strong>${escape(label.toLowerCase())}</strong> the request for <em>${escape(args.targetTitle)}</em>.</p>
|
|
162
|
+
${summary}
|
|
163
|
+
<form method="GET">
|
|
164
|
+
<input type="hidden" name="token" value="${escape(args.token)}" />
|
|
165
|
+
<input type="hidden" name="confirm" value="true" />
|
|
166
|
+
<button type="submit">Confirm: ${escape(label)}</button>
|
|
167
|
+
</form>
|
|
168
|
+
`);
|
|
169
|
+
}
|
|
170
|
+
function renderSuccess(label, title) {
|
|
171
|
+
return htmlPage(`<h1>${escape(label)}</h1><p>Your decision on <em>${escape(title)}</em> has been recorded.</p>`);
|
|
172
|
+
}
|
|
173
|
+
function renderError(message) {
|
|
174
|
+
return htmlPage(`<h1>Action could not be completed</h1><p>${escape(message)}</p>`);
|
|
175
|
+
}
|
|
176
|
+
function renderInfo(message) {
|
|
177
|
+
return htmlPage(`<h1>Notice</h1><p>${escape(message)}</p>`);
|
|
178
|
+
}
|
|
179
|
+
function htmlPage(body) {
|
|
180
|
+
return `<!DOCTYPE html>
|
|
181
|
+
<html lang="en">
|
|
182
|
+
<head>
|
|
183
|
+
<meta charset="utf-8" />
|
|
184
|
+
<title>Approval action</title>
|
|
185
|
+
<style>
|
|
186
|
+
body { font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; max-width: 600px; margin: 3rem auto; padding: 0 1rem; color: #18181b; line-height: 1.6; }
|
|
187
|
+
h1 { font-size: 1.5rem; }
|
|
188
|
+
button { background: #18181b; color: white; padding: 0.75rem 1.5rem; border: none; border-radius: 0.25rem; font-size: 1rem; cursor: pointer; }
|
|
189
|
+
em { font-style: italic; }
|
|
190
|
+
</style>
|
|
191
|
+
</head>
|
|
192
|
+
<body>${body}</body>
|
|
193
|
+
</html>`;
|
|
194
|
+
}
|
|
195
|
+
function escape(text) {
|
|
196
|
+
return String(text ?? '')
|
|
197
|
+
.replace(/&/g, '&')
|
|
198
|
+
.replace(/</g, '<')
|
|
199
|
+
.replace(/>/g, '>')
|
|
200
|
+
.replace(/"/g, '"');
|
|
201
|
+
}
|
|
202
|
+
function stringOrFallback(value, fallback) {
|
|
203
|
+
return typeof value === 'string' ? value : fallback;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../../src/approvals/endpoints/action.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAGL,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAOrB,MAAM,mBAAmB,GAA0D;IACjF,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,mBAAmB;CAC7B,CAAA;AAED,MAAM,kBAAkB,GAAG;IACzB,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,4BAA4B;CAC7B,CAAA;AAEV,MAAM,YAAY,GAAsC;IACtD,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,kBAAkB;CAC5B,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA8B;IACjE,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;YACrB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,kBAAkB,CAAC,CAAA;YAClD,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;YAC3C,IAAI,CAAC,KAAK;gBAAE,OAAO,YAAY,CAAC,WAA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AAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAC5B,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc,EAAE,QAAgB;IACxD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAA;AACrD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@forumone/throughline/approvals`: approval requests, the resolver
|
|
3
|
+
* publishing consults, signed action links, and the job that expires stale
|
|
4
|
+
* requests. Was `@forumone/throughline-approvals` in 0.x.
|
|
5
|
+
*/
|
|
6
|
+
export { approvalsPlugin } from './plugin.js';
|
|
7
|
+
export { approvalsEnv } from './options.js';
|
|
8
|
+
export type { ApprovalsPluginOptions, ApproverGroup, GroupResolver, ResolvedApprover, } from './options.js';
|
|
9
|
+
export { DEFAULT_APPROVALS_SLUG, createApprovalsCollection } from './collection.js';
|
|
10
|
+
export type { CreateApprovalsCollectionOptions } from './collection.js';
|
|
11
|
+
export { attachApprovalResolver, createApprovalResolver } from './resolver.js';
|
|
12
|
+
export type { CreateApprovalResolverOptions } from './resolver.js';
|
|
13
|
+
export { createActionEndpoint } from './endpoints/action.js';
|
|
14
|
+
export type { CreateActionEndpointDeps } from './endpoints/action.js';
|
|
15
|
+
export { generateActionToken, verifyActionToken, buildActionUrl } from './tokens.js';
|
|
16
|
+
export type { ActionToken, ActionTokenAction, VerifyOptions, VerifyResult } from './tokens.js';
|
|
17
|
+
export { expireStaleApprovalsJob } from './jobs/expire-stale-approvals.js';
|
|
18
|
+
export type { ExpireStaleApprovalsOptions } from '../jobs/workflow-types.js';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,YAAY,EACV,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AACnF,YAAY,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAA;AAEvE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAC9E,YAAY,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAA;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACpF,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,YAAY,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@forumone/throughline/approvals`: approval requests, the resolver
|
|
3
|
+
* publishing consults, signed action links, and the job that expires stale
|
|
4
|
+
* requests. Was `@forumone/throughline-approvals` in 0.x.
|
|
5
|
+
*/
|
|
6
|
+
export { approvalsPlugin } from './plugin.js';
|
|
7
|
+
export { approvalsEnv } from './options.js';
|
|
8
|
+
export { DEFAULT_APPROVALS_SLUG, createApprovalsCollection } from './collection.js';
|
|
9
|
+
export { attachApprovalResolver, createApprovalResolver } from './resolver.js';
|
|
10
|
+
export { createActionEndpoint } from './endpoints/action.js';
|
|
11
|
+
export { generateActionToken, verifyActionToken, buildActionUrl } from './tokens.js';
|
|
12
|
+
export { expireStaleApprovalsJob } from './jobs/expire-stale-approvals.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/approvals/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAS3C,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAGnF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAG9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAG5D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGpF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExpireStaleApprovalsOptions } from '../../jobs/workflow-types.js';
|
|
2
|
+
import type { Job } from '../../jobs/types.js';
|
|
3
|
+
import { type JobOptions } from '../../jobs/options.js';
|
|
4
|
+
/**
|
|
5
|
+
* Cron that finds pending approvals whose `expiresAt` has passed and flips
|
|
6
|
+
* them to `status: 'expired'`. For each expired record it writes an
|
|
7
|
+
* `approval.expired` audit event and fires an `approval/expired` event so
|
|
8
|
+
* notification workflows (e.g. C11 email) can let the requester know without
|
|
9
|
+
* polling.
|
|
10
|
+
*
|
|
11
|
+
* As a runner-neutral job, for `inngestJobs` or `payloadJobs`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function expireStaleApprovalsJob(options: JobOptions<ExpireStaleApprovalsOptions>): Job;
|
|
14
|
+
//# sourceMappingURL=expire-stale-approvals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expire-stale-approvals.d.ts","sourceRoot":"","sources":["../../../src/approvals/jobs/expire-stale-approvals.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAA;AAE/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAanE;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,CAAC,2BAA2B,CAAC,GAC/C,GAAG,CAuFL"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { failureOptions } from '../../jobs/workflow-types.js';
|
|
2
|
+
import { getAuditWriter } from '../../audit/plugin.js';
|
|
3
|
+
import { defineJob } from '../../jobs/define.js';
|
|
4
|
+
import { jobPayload } from '../../jobs/options.js';
|
|
5
|
+
const DEFAULT_SCHEDULE = '0 2 * * *'; // daily at 2am UTC
|
|
6
|
+
const DEFAULT_SLUG = 'approvals';
|
|
7
|
+
/**
|
|
8
|
+
* Cron that finds pending approvals whose `expiresAt` has passed and flips
|
|
9
|
+
* them to `status: 'expired'`. For each expired record it writes an
|
|
10
|
+
* `approval.expired` audit event and fires an `approval/expired` event so
|
|
11
|
+
* notification workflows (e.g. C11 email) can let the requester know without
|
|
12
|
+
* polling.
|
|
13
|
+
*
|
|
14
|
+
* As a runner-neutral job, for `inngestJobs` or `payloadJobs`.
|
|
15
|
+
*/
|
|
16
|
+
export function expireStaleApprovalsJob(options) {
|
|
17
|
+
const schedule = options.schedule ?? DEFAULT_SCHEDULE;
|
|
18
|
+
const collectionSlug = options.collectionSlug ?? DEFAULT_SLUG;
|
|
19
|
+
return defineJob({
|
|
20
|
+
id: options.id ?? 'expire-stale-approvals',
|
|
21
|
+
/*
|
|
22
|
+
One at a time by default, for the same read-then-act reason as
|
|
23
|
+
`execute-scheduled-publishes`: `find-expired` collects pending approvals
|
|
24
|
+
past their expiry and the loop expires them. Two runs both find the same
|
|
25
|
+
approval, both write `status: 'expired'`, and both send the expiry email —
|
|
26
|
+
so the requester is told twice that their request lapsed.
|
|
27
|
+
|
|
28
|
+
This is also the function 12 H1 is about. It threw every night for
|
|
29
|
+
eighteen days over a wrong collection slug; a cap does nothing for that,
|
|
30
|
+
and the `onFailure` above is what would have said so.
|
|
31
|
+
*/
|
|
32
|
+
...failureOptions(options, 1),
|
|
33
|
+
on: { cron: schedule },
|
|
34
|
+
}, async ({ step, logger, emit, payload: contextPayload }) => {
|
|
35
|
+
const payload = jobPayload(options.payload, contextPayload, options.id ?? 'expire-stale-approvals');
|
|
36
|
+
const now = new Date().toISOString();
|
|
37
|
+
const expired = await step.run('find-expired', async () => {
|
|
38
|
+
const result = await payload.find({
|
|
39
|
+
collection: collectionSlug,
|
|
40
|
+
where: {
|
|
41
|
+
and: [
|
|
42
|
+
{ status: { equals: 'pending' } },
|
|
43
|
+
{ expiresAt: { less_than: now } },
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
limit: 500,
|
|
47
|
+
});
|
|
48
|
+
return result.docs.map((doc) => ({
|
|
49
|
+
id: String(doc['id']),
|
|
50
|
+
targetCollection: String(doc['targetCollection'] ?? ''),
|
|
51
|
+
targetId: String(doc['targetId'] ?? ''),
|
|
52
|
+
targetTitle: String(doc['targetTitle'] ?? doc['targetId'] ?? '(unknown)'),
|
|
53
|
+
requesterId: extractRequesterId(doc['requestedBy']),
|
|
54
|
+
}));
|
|
55
|
+
});
|
|
56
|
+
if (expired.length === 0) {
|
|
57
|
+
logger.info('No stale approvals to expire');
|
|
58
|
+
return { expiredCount: 0 };
|
|
59
|
+
}
|
|
60
|
+
const auditWriter = getAuditWriter(payload);
|
|
61
|
+
for (const approval of expired) {
|
|
62
|
+
await step.run(`expire-${approval.id}`, async () => {
|
|
63
|
+
await payload.update({
|
|
64
|
+
collection: collectionSlug,
|
|
65
|
+
id: approval.id,
|
|
66
|
+
data: { status: 'expired' },
|
|
67
|
+
});
|
|
68
|
+
await auditWriter({
|
|
69
|
+
actor: { type: 'system', apiKeyName: 'workflow:expire-stale-approvals' },
|
|
70
|
+
action: 'approval.expired',
|
|
71
|
+
mcpServer: 'approvals',
|
|
72
|
+
mcpTool: 'expire-stale-approvals',
|
|
73
|
+
targetCollection: approval.targetCollection,
|
|
74
|
+
targetId: approval.targetId,
|
|
75
|
+
targetTitle: approval.targetTitle,
|
|
76
|
+
approvalRequestId: approval.id,
|
|
77
|
+
});
|
|
78
|
+
await emit({
|
|
79
|
+
name: 'approval/expired',
|
|
80
|
+
data: {
|
|
81
|
+
approvalId: approval.id,
|
|
82
|
+
requesterId: approval.requesterId,
|
|
83
|
+
targetCollection: approval.targetCollection,
|
|
84
|
+
targetId: approval.targetId,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
logger.info('Expired stale approvals', { count: expired.length });
|
|
90
|
+
return { expiredCount: expired.length };
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
function extractRequesterId(value) {
|
|
94
|
+
if (typeof value === 'string')
|
|
95
|
+
return value;
|
|
96
|
+
if (value && typeof value === 'object' && 'id' in value) {
|
|
97
|
+
return String(value.id);
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=expire-stale-approvals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expire-stale-approvals.js","sourceRoot":"","sources":["../../../src/approvals/jobs/expire-stale-approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEhD,OAAO,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAA;AAEnE,MAAM,gBAAgB,GAAG,WAAW,CAAA,CAAC,mBAAmB;AACxD,MAAM,YAAY,GAAG,WAAW,CAAA;AAUhC;;;;;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,IAAI,CAAC;oBACT,IAAI,EAAE,kBAAkB;oBACxB,IAAI,EAAE;wBACJ,UAAU,EAAE,QAAQ,CAAC,EAAE;wBACvB,WAAW,EAAE,QAAQ,CAAC,WAAW;wBACjC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;wBAC3C,QAAQ,EAAE,QAAQ,CAAC,QAAQ;qBAC5B;iBACF,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;QACjE,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,CAAA;IACzC,CAAC,CACF,CAAA;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC3C,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QACxD,OAAO,MAAM,CAAE,KAAyB,CAAC,EAAE,CAAC,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type McpToolCollector } from '../mcp/collector.js';
|
|
2
|
+
import type { Inngest } from 'inngest';
|
|
3
|
+
import type { BaseCorePluginOptions } from '../plugin-contract/index.js';
|
|
4
|
+
import type { CollectionPluginOptions } from '../plugin-contract/admin.js';
|
|
5
|
+
import type { EnvRequirement } from '../plugin-contract/env.js';
|
|
6
|
+
export interface ApproverGroup {
|
|
7
|
+
/** Group slug, referenced by the policy.approverGroups field on requests. */
|
|
8
|
+
slug: string;
|
|
9
|
+
/** Human-readable group name shown in admin UI. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Optional description shown in admin. */
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ResolvedApprover {
|
|
15
|
+
id: string;
|
|
16
|
+
email: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GroupResolver {
|
|
20
|
+
/**
|
|
21
|
+
* Given a list of group slugs, returns the users in those groups. Used
|
|
22
|
+
* when an approval is requested to materialize the actual approver list
|
|
23
|
+
* and again if the action endpoint needs to confirm a token-bearing user
|
|
24
|
+
* belongs to one of the request's groups.
|
|
25
|
+
*/
|
|
26
|
+
resolveUsers: (groupSlugs: string[]) => Promise<ResolvedApprover[]>;
|
|
27
|
+
}
|
|
28
|
+
export interface ApprovalsPluginOptions extends BaseCorePluginOptions, CollectionPluginOptions {
|
|
29
|
+
/** Approver groups available in this deployment. */
|
|
30
|
+
groups: ApproverGroup[];
|
|
31
|
+
/** Resolver mapping group slugs to users. Required. */
|
|
32
|
+
groupResolver: GroupResolver;
|
|
33
|
+
/** Inngest client for firing approval/* events. Required. */
|
|
34
|
+
inngest: Inngest;
|
|
35
|
+
/** HMAC signing secret for action tokens. Falls back to APPROVAL_TOKEN_SECRET env var. */
|
|
36
|
+
tokenSecret?: string;
|
|
37
|
+
/** Days before a pending approval expires. Default: 7. */
|
|
38
|
+
expirationDays?: number;
|
|
39
|
+
/** Override the approvals collection slug. Default: 'approvals'. */
|
|
40
|
+
collectionSlug?: string;
|
|
41
|
+
/** Override the users collection slug used for approver/requester relationships. Default: 'users'. */
|
|
42
|
+
usersSlug?: string;
|
|
43
|
+
/** Public base URL used to build inline action links. Defaults to NEXT_PUBLIC_SERVER_URL. */
|
|
44
|
+
publicUrl?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Where to put this server's MCP tools so Payload's own MCP plugin can serve
|
|
47
|
+
* them.
|
|
48
|
+
*
|
|
49
|
+
* `createMcpToolCollector()` from `@forumone/throughline`. The host hands
|
|
50
|
+
* its array to `@payloadcms/plugin-mcp` at config time and this plugin fills
|
|
51
|
+
* it at `onInit` — which is the first moment the tools can exist, since they
|
|
52
|
+
* close over `payload`, and still before any request reads the array.
|
|
53
|
+
*
|
|
54
|
+
* Omit it and nothing changes: this server keeps its own `/mcp` endpoint,
|
|
55
|
+
* which is what lets a host move one server at a time.
|
|
56
|
+
*/
|
|
57
|
+
mcpTools?: McpToolCollector;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* What `approvalsPlugin` reads from the environment when the matching option is
|
|
61
|
+
* omitted, and refuses to start without. Hand it to `assertEnvironment` from
|
|
62
|
+
* `@forumone/throughline` so a site reports it with everything else.
|
|
63
|
+
*
|
|
64
|
+
* Leave it out if you pass `tokenSecret` yourself. `NEXT_PUBLIC_SERVER_URL`
|
|
65
|
+
* (the `publicUrl` fallback) is not here: the plugin does not refuse to start
|
|
66
|
+
* without it, so it is the site's to require.
|
|
67
|
+
*/
|
|
68
|
+
export declare const approvalsEnv: readonly EnvRequirement[];
|
|
69
|
+
/**
|
|
70
|
+
* Validates options at load time and resolves the token secret. Throws with
|
|
71
|
+
* a targeted error on each obvious misconfiguration.
|
|
72
|
+
*/
|
|
73
|
+
export declare function validateOptions(options: ApprovalsPluginOptions): ApprovalsPluginOptions & {
|
|
74
|
+
tokenSecret: string;
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/approvals/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAm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minLength: 32,
|
|
5
|
+
why: 'Signs the approve/decline links in approval emails; approvalsPlugin will not start ' +
|
|
6
|
+
'without it. Generate with `openssl rand -base64 48`. Changing it invalidates links ' +
|
|
7
|
+
'already sent.',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* What `approvalsPlugin` reads from the environment when the matching option is
|
|
11
|
+
* omitted, and refuses to start without. Hand it to `assertEnvironment` from
|
|
12
|
+
* `@forumone/throughline` so a site reports it with everything else.
|
|
13
|
+
*
|
|
14
|
+
* Leave it out if you pass `tokenSecret` yourself. `NEXT_PUBLIC_SERVER_URL`
|
|
15
|
+
* (the `publicUrl` fallback) is not here: the plugin does not refuse to start
|
|
16
|
+
* without it, so it is the site's to require.
|
|
17
|
+
*/
|
|
18
|
+
export const approvalsEnv = [TOKEN_SECRET_ENV];
|
|
19
|
+
/**
|
|
20
|
+
* Validates options at load time and resolves the token secret. Throws with
|
|
21
|
+
* a targeted error on each obvious misconfiguration.
|
|
22
|
+
*/
|
|
23
|
+
export function validateOptions(options) {
|
|
24
|
+
if (!options.groups || options.groups.length === 0) {
|
|
25
|
+
throw new Error('approvalsPlugin requires at least one group in options.groups');
|
|
26
|
+
}
|
|
27
|
+
if (!options.groupResolver) {
|
|
28
|
+
throw new Error('approvalsPlugin requires a groupResolver in options');
|
|
29
|
+
}
|
|
30
|
+
if (!options.inngest) {
|
|
31
|
+
throw new Error('approvalsPlugin requires an Inngest client in options.inngest');
|
|
32
|
+
}
|
|
33
|
+
// The backstop for a site that does not call `assertEnvironment`, driven by
|
|
34
|
+
// the same declaration it would have passed.
|
|
35
|
+
const secret = options.tokenSecret ?? process.env[TOKEN_SECRET_ENV.name];
|
|
36
|
+
if (secret === undefined || checkEnvValue(TOKEN_SECRET_ENV, secret)) {
|
|
37
|
+
throw new Error(`approvalsPlugin requires a tokenSecret in options or an ${TOKEN_SECRET_ENV.name} env var (${TOKEN_SECRET_ENV.minLength}+ characters)`);
|
|
38
|
+
}
|
|
39
|
+
// Group slugs must be unique.
|
|
40
|
+
const slugs = options.groups.map((g) => g.slug);
|
|
41
|
+
const dupes = slugs.filter((s, i) => slugs.indexOf(s) !== i);
|
|
42
|
+
if (dupes.length > 0) {
|
|
43
|
+
throw new Error(`approvalsPlugin: duplicate group slug${dupes.length === 1 ? '' : 's'}: ${dupes.join(', ')}`);
|
|
44
|
+
}
|
|
45
|
+
return { ...options, tokenSecret: secret };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/approvals/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAiE/C,MAAM,gBAAgB,GAAG;IACvB,IAAI,EAAE,uBAAuB;IAC7B,SAAS,EAAE,EAAE;IACb,GAAG,EACD,qFAAqF;QACrF,qFAAqF;QACrF,eAAe;CACgB,CAAA;AAEnC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAA8B,CAAC,gBAAgB,CAAC,CAAA;AAEzE;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,OAA+B;IAE/B,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;IAClF,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAA;IACxE,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAA;IAClF,CAAC;IACD,4EAA4E;IAC5E,6CAA6C;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,I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