Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7dc93ac5ed | ||
|
|
3bab8a0697 | ||
|
|
7ef7927e38 | ||
|
|
a7846d9770 | ||
|
|
015092e773 | ||
|
|
f4d969ad29 | ||
|
|
fad5d778e8 | ||
|
|
0f073b963e | ||
|
|
54c2d64cce | ||
|
|
e29c919e5e | ||
|
|
0f6bbd597b | ||
|
|
65437a144b | ||
|
|
e7ad64230a | ||
|
|
5af5033148 | ||
|
|
7572ec0c04 | ||
|
|
a24777b915 |
Vendored
+1
@@ -7,3 +7,4 @@ export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js';
|
||||
* admin.components.graphics.Logo/Icon.
|
||||
*/
|
||||
export { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js';
|
||||
export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js';
|
||||
|
||||
Vendored
+1
@@ -6,5 +6,6 @@ export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js';
|
||||
* importMap can resolve them by a stable path when ipalKit injects
|
||||
* admin.components.graphics.Logo/Icon.
|
||||
*/ export { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js';
|
||||
export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js';
|
||||
|
||||
//# sourceMappingURL=admin.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/admin.ts"],"sourcesContent":["export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'\n/**\n * Entry point: @intecion/ipal-kit/admin\n *\n * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's\n * importMap can resolve them by a stable path when ipalKit injects\n * admin.components.graphics.Logo/Icon.\n */\nexport { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js'\n"],"names":["RowLabel","AdminIcon","AdminLogo","IntecionCredit"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2CAA0C;AACnE;;;;;;CAMC,GACD,SAASC,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,+BAA8B"}
|
||||
{"version":3,"sources":["../../src/exports/admin.ts"],"sourcesContent":["export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'\n/**\n * Entry point: @intecion/ipal-kit/admin\n *\n * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's\n * importMap can resolve them by a stable path when ipalKit injects\n * admin.components.graphics.Logo/Icon.\n */\nexport { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js'\nexport { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'\n"],"names":["RowLabel","AdminIcon","AdminLogo","IntecionCredit","IntegrationAlerts"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2CAA0C;AACnE;;;;;;CAMC,GACD,SAASC,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,+BAA8B;AACnF,SAASC,iBAAiB,QAAQ,+CAA8C"}
|
||||
Vendored
+1
@@ -28,6 +28,7 @@ export { buildLocalizedPath, getLocaleCodes, getLocalizedSlugs, switchLocalePath
|
||||
export type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js';
|
||||
export { AlternateLinksProvider, AlternateLinksUpdater, LanguageSwitcher, useAlternateLinks, useSetAlternateLinks, } from '../modules/i18n/index.js';
|
||||
export type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js';
|
||||
export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js';
|
||||
export { LocaleView } from '../modules/pages/LocaleView.js';
|
||||
export { Turnstile } from '../modules/turnstile/client.js';
|
||||
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
|
||||
|
||||
Vendored
+1
@@ -21,6 +21,7 @@ export { buildValidator, checked, custom, email, isEmail, maxLength, minLength,
|
||||
// components (e.g. a LanguageSwitcher that computes locale URLs on the client).
|
||||
export { buildLocalizedPath, getLocaleCodes, getLocalizedSlugs, switchLocalePath } from '../modules/i18n/index.js';
|
||||
export { AlternateLinksProvider, AlternateLinksUpdater, LanguageSwitcher, useAlternateLinks, useSetAlternateLinks } from '../modules/i18n/index.js';
|
||||
export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js';
|
||||
export { LocaleView } from '../modules/pages/LocaleView.js';
|
||||
export { Turnstile } from '../modules/turnstile/client.js';
|
||||
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport { AccessibilityProvider, AccessibilityWidget, useAccessibility } from '../modules/accessibility/client.js'\nexport type { A11yClassNames, A11yState, A11yTexts } from '../modules/accessibility/client.js'\nexport { Analytics } from '../modules/analytics/client.js'\nexport type { AnalyticsProps } from '../modules/analytics/client.js'\n\nexport { pushDataLayer } from '../modules/analytics/client.js'\nexport { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from '../modules/analytics/client.js'\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n ConsentProvider,\n ConsentScript,\n CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'\nexport type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type { ContactFormErrors, ContactFormValues, SubmitAction } from '../modules/forms/useContactForm.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n buildLocalizedPath,\n getLocaleCodes,\n getLocalizedSlugs,\n switchLocalePath,\n} from '../modules/i18n/index.js'\nexport type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js'\nexport {\n AlternateLinksProvider,\n AlternateLinksUpdater,\n LanguageSwitcher,\n useAlternateLinks,\n useSetAlternateLinks,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { LocaleView } from '../modules/pages/LocaleView.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n"],"names":["MaskedField","TestEmailButton","AccessibilityProvider","AccessibilityWidget","useAccessibility","Analytics","pushDataLayer","loadClarity","loadLinkedIn","loadMetaPixel","loadTikTok","ConsentProvider","ConsentScript","CookieBanner","CookieButton","useConsent","useConsentContext","formAnalyticsOnSuccess","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","useContactForm","useForm","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required","buildLocalizedPath","getLocaleCodes","getLocalizedSlugs","switchLocalePath","AlternateLinksProvider","AlternateLinksUpdater","LanguageSwitcher","useAlternateLinks","useSetAlternateLinks","LocaleView","Turnstile","TurnstileProvider","useTurnstile"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,qCAAoC;AAEjH,SAASC,SAAS,QAAQ,iCAAgC;AAG1D,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,WAAW,EAAEC,YAAY,EAAEC,aAAa,EAAEC,UAAU,QAAQ,iCAAgC;AACrG;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,SAASC,sBAAsB,QAAQ,oCAAmC;AAE1E,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,cAAc,QAAQ,qCAAoC;AAEnE,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,iCAAgC;AAEvC,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,QACX,2BAA0B;AAEjC,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,2BAA0B;AAEjC,SAASC,UAAU,QAAQ,iCAAgC;AAC3D,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC"}
|
||||
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport { AccessibilityProvider, AccessibilityWidget, useAccessibility } from '../modules/accessibility/client.js'\nexport type { A11yClassNames, A11yState, A11yTexts } from '../modules/accessibility/client.js'\nexport { Analytics } from '../modules/analytics/client.js'\nexport type { AnalyticsProps } from '../modules/analytics/client.js'\n\nexport { pushDataLayer } from '../modules/analytics/client.js'\nexport { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from '../modules/analytics/client.js'\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n ConsentProvider,\n ConsentScript,\n CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'\nexport type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type { ContactFormErrors, ContactFormValues, SubmitAction } from '../modules/forms/useContactForm.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport {\n buildValidator,\n checked,\n custom,\n email,\n isEmail,\n maxLength,\n minLength,\n pattern,\n required,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n buildLocalizedPath,\n getLocaleCodes,\n getLocalizedSlugs,\n switchLocalePath,\n} from '../modules/i18n/index.js'\nexport type { I18nConfig, LocalizedSlugs } from '../modules/i18n/index.js'\nexport {\n AlternateLinksProvider,\n AlternateLinksUpdater,\n LanguageSwitcher,\n useAlternateLinks,\n useSetAlternateLinks,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'\nexport { LocaleView } from '../modules/pages/LocaleView.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n"],"names":["MaskedField","TestEmailButton","AccessibilityProvider","AccessibilityWidget","useAccessibility","Analytics","pushDataLayer","loadClarity","loadLinkedIn","loadMetaPixel","loadTikTok","ConsentProvider","ConsentScript","CookieBanner","CookieButton","useConsent","useConsentContext","formAnalyticsOnSuccess","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","useContactForm","useForm","buildValidator","checked","custom","email","isEmail","maxLength","minLength","pattern","required","buildLocalizedPath","getLocaleCodes","getLocalizedSlugs","switchLocalePath","AlternateLinksProvider","AlternateLinksUpdater","LanguageSwitcher","useAlternateLinks","useSetAlternateLinks","IntegrationStatusBanner","LocaleView","Turnstile","TurnstileProvider","useTurnstile"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SAASC,qBAAqB,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,qCAAoC;AAEjH,SAASC,SAAS,QAAQ,iCAAgC;AAG1D,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,WAAW,EAAEC,YAAY,EAAEC,aAAa,EAAEC,UAAU,QAAQ,iCAAgC;AACrG;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,SAASC,sBAAsB,QAAQ,oCAAmC;AAE1E,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,cAAc,QAAQ,qCAAoC;AAEnE,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SACEC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,KAAK,EACLC,OAAO,EACPC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,iCAAgC;AAEvC,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,kBAAkB,EAClBC,cAAc,EACdC,iBAAiB,EACjBC,gBAAgB,QACX,2BAA0B;AAEjC,SACEC,sBAAsB,EACtBC,qBAAqB,EACrBC,gBAAgB,EAChBC,iBAAiB,EACjBC,oBAAoB,QACf,2BAA0B;AAEjC,SAASC,uBAAuB,QAAQ,qDAAoD;AAC5F,SAASC,UAAU,QAAQ,iCAAgC;AAC3D,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC"}
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Entry point: @intecion/ipal-kit/env
|
||||
*
|
||||
* Environment validation ONLY — zero imports beyond this module, no Payload,
|
||||
* no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next
|
||||
* also compiles for the Edge runtime: importing the package root there drags in
|
||||
* Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile
|
||||
* doesn't exist in target module").
|
||||
*
|
||||
* // src/instrumentation.ts
|
||||
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
|
||||
* export function register() {
|
||||
* if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))
|
||||
* }
|
||||
*/
|
||||
export { assertEnv, ipalEnvRules } from '../modules/env/index.js';
|
||||
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js';
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Entry point: @intecion/ipal-kit/env
|
||||
*
|
||||
* Environment validation ONLY — zero imports beyond this module, no Payload,
|
||||
* no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next
|
||||
* also compiles for the Edge runtime: importing the package root there drags in
|
||||
* Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile
|
||||
* doesn't exist in target module").
|
||||
*
|
||||
* // src/instrumentation.ts
|
||||
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
|
||||
* export function register() {
|
||||
* if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))
|
||||
* }
|
||||
*/ export { assertEnv, ipalEnvRules } from '../modules/env/index.js';
|
||||
|
||||
//# sourceMappingURL=env.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/env.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/env\n *\n * Environment validation ONLY — zero imports beyond this module, no Payload,\n * no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next\n * also compiles for the Edge runtime: importing the package root there drags in\n * Payload / file-type / fs and crashes Turbopack (\"Export fileTypeFromFile\n * doesn't exist in target module\").\n *\n * // src/instrumentation.ts\n * import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'\n * export function register() {\n * if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))\n * }\n */\nexport { assertEnv, ipalEnvRules } from '../modules/env/index.js'\nexport type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js'\n"],"names":["assertEnv","ipalEnvRules"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GACD,SAASA,SAAS,EAAEC,YAAY,QAAQ,0BAAyB"}
|
||||
Vendored
+6
-5
@@ -1,3 +1,7 @@
|
||||
export { sendEmail } from '../modules/email/index.js';
|
||||
export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js';
|
||||
export { submitForm } from '../modules/forms/index.js';
|
||||
export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js';
|
||||
/**
|
||||
* Entry point: ipal-kit/server
|
||||
*
|
||||
@@ -10,8 +14,5 @@
|
||||
* Import these only from Server Actions, route handlers, or server components —
|
||||
* never from the Payload config or client code.
|
||||
*/
|
||||
export { verifyTurnstile } from '../modules/turnstile/index.js';
|
||||
export { sendEmail } from '../modules/email/index.js';
|
||||
export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js';
|
||||
export { submitForm } from '../modules/forms/index.js';
|
||||
export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js';
|
||||
export { checkTurnstile, verifyTurnstile } from '../modules/turnstile/index.js';
|
||||
export type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js';
|
||||
|
||||
Vendored
+3
-3
@@ -1,3 +1,5 @@
|
||||
export { sendEmail } from '../modules/email/index.js';
|
||||
export { submitForm } from '../modules/forms/index.js';
|
||||
/**
|
||||
* Entry point: ipal-kit/server
|
||||
*
|
||||
@@ -9,8 +11,6 @@
|
||||
*
|
||||
* Import these only from Server Actions, route handlers, or server components —
|
||||
* never from the Payload config or client code.
|
||||
*/ export { verifyTurnstile } from '../modules/turnstile/index.js';
|
||||
export { sendEmail } from '../modules/email/index.js';
|
||||
export { submitForm } from '../modules/forms/index.js';
|
||||
*/ export { checkTurnstile, verifyTurnstile } from '../modules/turnstile/index.js';
|
||||
|
||||
//# sourceMappingURL=server.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/server\n *\n * Server-only runtime functions — these import 'server-only' (Turnstile secret,\n * SMTP password, nodemailer). Kept OUT of the main entry so that loading the\n * Payload config or running `payload generate:importmap` (both Node scripts,\n * no bundler) never pulls in 'server-only', which throws outside a bundled\n * server context.\n *\n * Import these only from Server Actions, route handlers, or server components —\n * never from the Payload config or client code.\n */\nexport { verifyTurnstile } from '../modules/turnstile/index.js'\nexport { sendEmail } from '../modules/email/index.js'\nexport type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'\nexport { submitForm } from '../modules/forms/index.js'\nexport type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'\n"],"names":["verifyTurnstile","sendEmail","submitForm"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,SAASA,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,UAAU,QAAQ,4BAA2B"}
|
||||
{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["export { sendEmail } from '../modules/email/index.js'\nexport type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'\nexport { submitForm } from '../modules/forms/index.js'\nexport type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'\n/**\n * Entry point: ipal-kit/server\n *\n * Server-only runtime functions — these import 'server-only' (Turnstile secret,\n * SMTP password, nodemailer). Kept OUT of the main entry so that loading the\n * Payload config or running `payload generate:importmap` (both Node scripts,\n * no bundler) never pulls in 'server-only', which throws outside a bundled\n * server context.\n *\n * Import these only from Server Actions, route handlers, or server components —\n * never from the Payload config or client code.\n */\nexport { checkTurnstile, verifyTurnstile } from '../modules/turnstile/index.js'\nexport type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js'\n"],"names":["sendEmail","submitForm","checkTurnstile","verifyTurnstile"],"mappings":"AAAA,SAASA,SAAS,QAAQ,4BAA2B;AAErD,SAASC,UAAU,QAAQ,4BAA2B;AAEtD;;;;;;;;;;;CAWC,GACD,SAASC,cAAc,EAAEC,eAAe,QAAQ,gCAA+B"}
|
||||
+5
-1
@@ -1,3 +1,4 @@
|
||||
import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js';
|
||||
/**
|
||||
* Cloudflare Turnstile credentials.
|
||||
*
|
||||
@@ -6,6 +7,8 @@
|
||||
* (SiteIntegrations requires an authenticated user) rather than per-field,
|
||||
* so they remain editable in the admin panel.
|
||||
*/ export const turnstileFields = [
|
||||
// Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.
|
||||
buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),
|
||||
{
|
||||
name: 'turnstileSiteKey',
|
||||
type: 'text',
|
||||
@@ -23,7 +26,8 @@
|
||||
Field: '@intecion/ipal-kit/client#MaskedField'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
buildIntegrationStatusField('turnstileStatus')
|
||||
];
|
||||
|
||||
//# sourceMappingURL=turnstile.js.map
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n // Masked in the UI (••••) — stored plaintext, readable for verification.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n]\n"],"names":["turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,yEAAyE;YACzEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"}
|
||||
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n // Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.\n buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n // Masked in the UI (••••) — stored plaintext, readable for verification.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n buildIntegrationStatusField('turnstileStatus'),\n]\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,2BAA2B,QAAQ,0CAAyC;AAEnH;;;;;;;CAOC,GACD,OAAO,MAAMC,kBAA2B;IACtC,8FAA8F;IAC9FF,6BAA6B,mBAAmB;IAChD;QACEG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,yEAAyE;YACzEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACAP,4BAA4B;CAC7B,CAAA"}
|
||||
-4
@@ -14,10 +14,6 @@ type BuildSiteIntegrationsArgs = {
|
||||
* impossible to enter.)
|
||||
*
|
||||
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
||||
*
|
||||
* Note: R2 storage credentials are NOT here — storage is infrastructure and
|
||||
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
|
||||
* consumed by buildR2Storage. See docs/storage.md.
|
||||
*/
|
||||
export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;
|
||||
export {};
|
||||
|
||||
+22
-4
@@ -13,10 +13,6 @@ import { turnstileFields } from './fields/turnstile.js';
|
||||
* impossible to enter.)
|
||||
*
|
||||
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
||||
*
|
||||
* Note: R2 storage credentials are NOT here — storage is infrastructure and
|
||||
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
|
||||
* consumed by buildR2Storage. See docs/storage.md.
|
||||
*/ export function buildSiteIntegrations({ additionalFields } = {}) {
|
||||
return {
|
||||
slug: 'site-integrations',
|
||||
@@ -54,6 +50,28 @@ import { turnstileFields } from './fields/turnstile.js';
|
||||
]
|
||||
}
|
||||
],
|
||||
hooks: {
|
||||
beforeChange: [
|
||||
// Keys edited in the panel → clear the old Turnstile status, so a stale
|
||||
// "not working" banner doesn't linger until the next form submission.
|
||||
({ context, data, originalDoc })=>{
|
||||
if (context?.ipalIntegrationStatus || !data) {
|
||||
return data;
|
||||
}
|
||||
const changed = (k)=>k in data && data[k] !== originalDoc?.[k];
|
||||
if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {
|
||||
data.turnstileStatus = {
|
||||
checkedAt: null,
|
||||
code: null,
|
||||
message: null,
|
||||
since: null,
|
||||
state: null
|
||||
};
|
||||
}
|
||||
return data;
|
||||
}
|
||||
]
|
||||
},
|
||||
label: 'Site Integrations'
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n *\n * Note: R2 storage credentials are NOT here — storage is infrastructure and\n * binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),\n * consumed by buildR2Storage. See docs/storage.md.\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n ...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),\n ],\n },\n ],\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQb;wBAAiBgB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQZ;wBAAYe,OAAO;oBAAO;uBAChCZ,kBAAkBa,SAAS;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,OAAO;IACT;AACF"}
|
||||
{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n ...(additionalFields?.length\n ? [{ fields: additionalFields, label: 'Custom' }]\n : []),\n ],\n },\n ],\n hooks: {\n beforeChange: [\n // Keys edited in the panel → clear the old Turnstile status, so a stale\n // \"not working\" banner doesn't linger until the next form submission.\n ({ context, data, originalDoc }) => {\n if (context?.ipalIntegrationStatus || !data) {return data}\n const changed = (k: string) => k in data && data[k] !== originalDoc?.[k]\n if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {\n data.turnstileStatus = { checkedAt: null, code: null, message: null, since: null, state: null }\n }\n return data\n },\n ],\n },\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length","hooks","beforeChange","context","data","originalDoc","ipalIntegrationStatus","changed","k","turnstileStatus","checkedAt","code","message","since","state"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQb;wBAAiBgB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQZ;wBAAYe,OAAO;oBAAO;uBAChCZ,kBAAkBa,SAClB;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAC/C,EAAE;iBACP;YACH;SACD;QACDE,OAAO;YACLC,cAAc;gBACZ,wEAAwE;gBACxE,sEAAsE;gBACtE,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,WAAW,EAAE;oBAC7B,IAAIF,SAASG,yBAAyB,CAACF,MAAM;wBAAC,OAAOA;oBAAI;oBACzD,MAAMG,UAAU,CAACC,IAAcA,KAAKJ,QAAQA,IAAI,CAACI,EAAE,KAAKH,aAAa,CAACG,EAAE;oBACxE,IAAID,QAAQ,yBAAyBA,QAAQ,qBAAqB;wBAChEH,KAAKK,eAAe,GAAG;4BAAEC,WAAW;4BAAMC,MAAM;4BAAMC,SAAS;4BAAMC,OAAO;4BAAMC,OAAO;wBAAK;oBAChG;oBACA,OAAOV;gBACT;aACD;QACH;QACAL,OAAO;IACT;AACF"}
|
||||
Vendored
+57
-54
@@ -1,73 +1,76 @@
|
||||
export { ipalKit } from './plugin.js';
|
||||
export type { IpalOptions } from './types.js';
|
||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||
export type { AccessOption, Role } from './modules/access/index.js';
|
||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
|
||||
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
||||
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG, } from './modules/payload/index.js';
|
||||
export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js';
|
||||
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js';
|
||||
export type { SiteMetaConfig } from './modules/seo/index.js';
|
||||
export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js';
|
||||
export { createContentHelpers } from './modules/frontend/index.js';
|
||||
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam, } from './modules/content/index.js';
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||
export type { A11yState } from './modules/accessibility/index.js';
|
||||
export { rowLabel } from './modules/admin-ui/index.js';
|
||||
export type { RowLabelProps } from './modules/admin-ui/index.js';
|
||||
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent, } from './modules/consent/index.js';
|
||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
|
||||
export type { ContentCollectionOption, ContentOption, ResolvedRoute } from './modules/content/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent, } from './modules/content/index.js';
|
||||
export type { ArchiveEntries } from './modules/content/index.js';
|
||||
export type { SearchResult } from './modules/content/index.js';
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||
export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js';
|
||||
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, } from './modules/seo/index.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from './modules/env/index.js';
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
|
||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js';
|
||||
export { buildValidator, checked, custom, email, isEmail, maxLength, minLength, pattern, required, } from './modules/forms/validators.js';
|
||||
export type { Rule } from './modules/forms/validators.js';
|
||||
export { createContentHelpers } from './modules/frontend/index.js';
|
||||
export { createHealthRoute } from './modules/health/index.js';
|
||||
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js';
|
||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
|
||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
|
||||
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
|
||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER, } from './modules/i18n/index.js';
|
||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
||||
export { resolveLocalized } from './modules/i18n/index.js';
|
||||
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts, } from './modules/consent/index.js';
|
||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
|
||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
|
||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||
export type { FormsOption, FormsCollectionOverrides, FormsFieldsOverride, } from './modules/forms/types.js';
|
||||
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from './modules/forms/validators.js';
|
||||
export type { Rule } from './modules/forms/validators.js';
|
||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { createHealthRoute } from './modules/health/index.js';
|
||||
export { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus } from './modules/integrations/index.js';
|
||||
export type { IntegrationState, IntegrationStatus } from './modules/integrations/index.js';
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||
export type { BuildLinkFieldOptions, BuildLinksFieldOptions, LinkAppearance, LinkValue, ResolveLinkHrefOptions, } from './modules/links/index.js';
|
||||
export { createMcpRoute } from './modules/mcp/index.js';
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js';
|
||||
export type { AnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
|
||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
|
||||
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||
export type { OptimizeUploadOptions } from './modules/media/index.js';
|
||||
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
|
||||
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js';
|
||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||
export type { GlobalQueryOptions } from './modules/payload/index.js';
|
||||
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG, } from './modules/payload/index.js';
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||
export { buildCsp } from './modules/security/index.js';
|
||||
export type { BuildCspArgs } from './modules/security/index.js';
|
||||
export type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js';
|
||||
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js';
|
||||
export { buildHreflangAlternates, buildMetadata, composeTitle, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js';
|
||||
export type { SiteMetaConfig } from './modules/seo/index.js';
|
||||
export type { AutoFillMapping, RobotsOptions, RobotsRules, SitemapEntry } from './modules/seo/index.js';
|
||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta, } from './modules/seo/index.js';
|
||||
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js';
|
||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
||||
export { buildNoindexField } from './modules/seo/index.js';
|
||||
export { rowLabel } from './modules/admin-ui/index.js';
|
||||
export type { RowLabelProps } from './modules/admin-ui/index.js';
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||
export type { LinkAppearance, LinkValue, BuildLinkFieldOptions, BuildLinksFieldOptions, ResolveLinkHrefOptions, } from './modules/links/index.js';
|
||||
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
||||
export { buildSummaryField } from './modules/seo/index.js';
|
||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
|
||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
|
||||
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||
export { buildSitemapXml } from './modules/seo/index.js';
|
||||
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js';
|
||||
export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js';
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||
export { buildR2Storage } from './modules/storage/index.js';
|
||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
|
||||
export type { OptimizeUploadOptions } from './modules/media/index.js';
|
||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||
export type { A11yState } from './modules/accessibility/index.js';
|
||||
export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js';
|
||||
export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js';
|
||||
export { ipalKit } from './plugin.js';
|
||||
export type { IpalOptions } from './types.js';
|
||||
|
||||
Vendored
+35
-34
@@ -1,59 +1,60 @@
|
||||
export { ipalKit } from './plugin.js';
|
||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
|
||||
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG } from './modules/payload/index.js';
|
||||
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js';
|
||||
export { createContentHelpers } from './modules/frontend/index.js';
|
||||
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam } from './modules/content/index.js';
|
||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './modules/seo/index.js';
|
||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
||||
export { resolveLocalized } from './modules/i18n/index.js';
|
||||
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts } from './modules/consent/index.js';
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||
export { rowLabel } from './modules/admin-ui/index.js';
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent } from './modules/consent/index.js';
|
||||
export { archiveFieldName, blocksToMarkdown, buildArchivePath, buildEntryPath, createMarkdownRenderer, createSearchRoute, getArchiveEntries, MARKDOWN_PREFIX, markdownHref, markdownResponse, parsePageParam, prefersMarkdown, resolveNotFoundPage, resolveRedirect, resolveRoute, searchContent } from './modules/content/index.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js';
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js';
|
||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
// Panel-managed form analytics (config-time field builder).
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
// Validation rules are pure — exported server-side too, for re-validating a
|
||||
// submission inside a server action. (useForm/useContactForm are client-only →
|
||||
// '@intecion/ipal-kit/client'.)
|
||||
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from './modules/forms/validators.js';
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
|
||||
// Panel-managed form analytics (config-time field builder).
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
|
||||
export { buildValidator, checked, custom, email, isEmail, maxLength, minLength, pattern, required } from './modules/forms/validators.js';
|
||||
export { createContentHelpers } from './modules/frontend/index.js';
|
||||
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
||||
export { createHealthRoute } from './modules/health/index.js';
|
||||
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js';
|
||||
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
|
||||
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
|
||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
|
||||
export { resolveLocalized } from './modules/i18n/index.js';
|
||||
export { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus } from './modules/integrations/index.js';
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||
// Read-only MCP server (Claude/agents connect to the site and query it).
|
||||
export { createMcpRoute } from './modules/mcp/index.js';
|
||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js';
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
|
||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
|
||||
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
|
||||
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
|
||||
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
|
||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js';
|
||||
export { buildSecurityHeaders } from './modules/security/index.js';
|
||||
export { buildCsp } from './modules/security/index.js';
|
||||
export { buildHreflangAlternates, buildMetadata, composeTitle, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js';
|
||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
|
||||
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js';
|
||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
|
||||
export { buildNoindexField } from './modules/seo/index.js';
|
||||
export { rowLabel } from './modules/admin-ui/index.js';
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
|
||||
export { buildSpeakableJsonLd } from './modules/seo/index.js';
|
||||
export { buildSummaryField } from './modules/seo/index.js';
|
||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
|
||||
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
|
||||
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
|
||||
export { buildArticleJsonLd } from './modules/seo/index.js';
|
||||
export { buildLlmsTxt } from './modules/seo/index.js';
|
||||
export { buildSitemapXml } from './modules/seo/index.js';
|
||||
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js';
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js';
|
||||
export { buildR2Storage } from './modules/storage/index.js';
|
||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
|
||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
|
||||
export { ipalKit } from './plugin.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+8
@@ -11,6 +11,14 @@ type CreateSearchRouteArgs = {
|
||||
getCachedPayload: () => Promise<BasePayload>;
|
||||
/** Home slug map/string so the home result collapses to root. */
|
||||
homeSlug?: Record<string, string> | string;
|
||||
/**
|
||||
* Per-IP limit (in memory, per instance). Default { max: 120, windowMs: 60_000 }.
|
||||
* `false` = off (a limiter in front, e.g. Cloudflare WAF rate limiting).
|
||||
*/
|
||||
rateLimit?: {
|
||||
max?: number;
|
||||
windowMs?: number;
|
||||
} | false;
|
||||
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
||||
summaryField?: string;
|
||||
};
|
||||
|
||||
+22
@@ -1,3 +1,4 @@
|
||||
import { checkRateLimit, clientIp, tooManyRequests } from '../shared/rateLimit.js';
|
||||
import { searchContent } from './searchContent.js';
|
||||
/**
|
||||
* A JSON content-search endpoint. Powers both the site's own search UI and
|
||||
@@ -18,7 +19,28 @@ import { searchContent } from './searchContent.js';
|
||||
* Uses the global Request/Response — no next/server import.
|
||||
*/ export function createSearchRoute(args) {
|
||||
const { baseUrl, collection = 'pages', config, defaultLimit = 10, getCachedPayload, homeSlug, summaryField } = args;
|
||||
// 120/min: a debounced search-as-you-type box stays well under it; a scraper doesn't.
|
||||
const rl = args.rateLimit === false ? null : {
|
||||
max: 120,
|
||||
windowMs: 60_000,
|
||||
...args.rateLimit
|
||||
};
|
||||
return async (req)=>{
|
||||
if (rl) {
|
||||
const ip = clientIp(req);
|
||||
if (!checkRateLimit({
|
||||
key: ip,
|
||||
scope: 'search',
|
||||
...rl
|
||||
})) {
|
||||
return tooManyRequests(ip, 'search', {
|
||||
count: 0,
|
||||
error: 'Too many requests',
|
||||
query: '',
|
||||
results: []
|
||||
});
|
||||
}
|
||||
}
|
||||
const url = new URL(req.url);
|
||||
const query = url.searchParams.get('q')?.trim() ?? '';
|
||||
const locale = url.searchParams.get('locale') ?? undefined;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -13,7 +13,7 @@
|
||||
}
|
||||
switch(kind){
|
||||
case 'boolean':
|
||||
if (!/^(true|false|1|0|yes|no)$/i.test(value)) {
|
||||
if (!/^(?:true|false|1|0|yes|no)$/i.test(value)) {
|
||||
return `${name} must be a boolean (true/false/1/0/yes/no, got "${value}")`;
|
||||
}
|
||||
break;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+13
-2
@@ -59,8 +59,19 @@
|
||||
kind: 'url'
|
||||
}, {
|
||||
name: 'R2_PUBLIC_URL',
|
||||
description: 'Public base URL media is served from',
|
||||
kind: 'url'
|
||||
description: 'Public base URL media is served from (custom domain of the bucket)',
|
||||
// Production: absolute URL (https://media.example.com). Outside production a
|
||||
// site-relative path ('/media') is accepted — buildR2Storage prefixes it with
|
||||
// NEXT_PUBLIC_SERVER_URL (e.g. a dev rewrite /media → bucket).
|
||||
validate: (v)=>{
|
||||
if (/^https?:\/\/[^/\s]+/i.test(v)) {
|
||||
return true;
|
||||
}
|
||||
if (v.startsWith('/') && process.env.NODE_ENV !== 'production') {
|
||||
return true;
|
||||
}
|
||||
return v.startsWith('/') ? `R2_PUBLIC_URL must be an absolute URL in production (got "${v}") — e.g. https://media.example.com` : `R2_PUBLIC_URL must be an absolute URL (https://…) or, outside production, a path starting with "/" (got "${v}")`;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (emailGraph) {
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-14
@@ -1,14 +1,2 @@
|
||||
export type RateLimitArgs = {
|
||||
/** Identifier to limit on — typically the client IP. */
|
||||
key: string;
|
||||
/** Max submissions allowed per window. Defaults to 5. */
|
||||
max?: number;
|
||||
/** Window length in ms. Defaults to 60_000 (one minute). */
|
||||
windowMs?: number;
|
||||
};
|
||||
/**
|
||||
* Returns true when the request is within the limit, false when it should be
|
||||
* rejected. A missing key (no IP) is allowed through — better to accept a
|
||||
* submission than to block everyone behind a proxy that strips the header.
|
||||
*/
|
||||
export declare function checkRateLimit({ key, max, windowMs }: RateLimitArgs): boolean;
|
||||
export { checkRateLimit, clientIp, retryAfterSeconds, tooManyRequests } from '../shared/rateLimit.js';
|
||||
export type { RateLimitArgs } from '../shared/rateLimit.js';
|
||||
|
||||
Vendored
+2
-49
@@ -1,51 +1,4 @@
|
||||
/**
|
||||
* Per-IP sliding window, in memory.
|
||||
*
|
||||
* Deliberately simple: no Redis, no dependency. The trade-off is that the
|
||||
* counter lives in one process — with several instances behind a load balancer
|
||||
* each keeps its own, so the effective limit is per-instance, not global. For a
|
||||
* contact form that's fine (it raises the cost of flooding without pretending
|
||||
* to be airtight); a high-security form should put a real limiter in front.
|
||||
*
|
||||
* State is module-level, so it survives between requests but resets on redeploy
|
||||
* — acceptable for abuse throttling.
|
||||
*/ const buckets = new Map();
|
||||
/** Sweep expired buckets occasionally so the map doesn't grow unbounded. */ let lastSweep = Date.now();
|
||||
const SWEEP_INTERVAL = 60_000;
|
||||
function sweep(now) {
|
||||
if (now - lastSweep < SWEEP_INTERVAL) {
|
||||
return;
|
||||
}
|
||||
lastSweep = now;
|
||||
for (const [key, bucket] of buckets){
|
||||
if (bucket.resetAt <= now) {
|
||||
buckets.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns true when the request is within the limit, false when it should be
|
||||
* rejected. A missing key (no IP) is allowed through — better to accept a
|
||||
* submission than to block everyone behind a proxy that strips the header.
|
||||
*/ export function checkRateLimit({ key, max = 5, windowMs = 60_000 }) {
|
||||
if (!key) {
|
||||
return true;
|
||||
}
|
||||
const now = Date.now();
|
||||
sweep(now);
|
||||
const bucket = buckets.get(key);
|
||||
if (!bucket || bucket.resetAt <= now) {
|
||||
buckets.set(key, {
|
||||
count: 1,
|
||||
resetAt: now + windowMs
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if (bucket.count >= max) {
|
||||
return false;
|
||||
}
|
||||
bucket.count += 1;
|
||||
return true;
|
||||
}
|
||||
// Moved to modules/shared/rateLimit.ts (shared with search and MCP routes).
|
||||
export { checkRateLimit, clientIp, retryAfterSeconds, tooManyRequests } from '../shared/rateLimit.js';
|
||||
|
||||
//# sourceMappingURL=rateLimit.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/forms/rateLimit.ts"],"sourcesContent":["type Bucket = { count: number; resetAt: number }\n\n/**\n * Per-IP sliding window, in memory.\n *\n * Deliberately simple: no Redis, no dependency. The trade-off is that the\n * counter lives in one process — with several instances behind a load balancer\n * each keeps its own, so the effective limit is per-instance, not global. For a\n * contact form that's fine (it raises the cost of flooding without pretending\n * to be airtight); a high-security form should put a real limiter in front.\n *\n * State is module-level, so it survives between requests but resets on redeploy\n * — acceptable for abuse throttling.\n */\nconst buckets = new Map<string, Bucket>()\n\n/** Sweep expired buckets occasionally so the map doesn't grow unbounded. */\nlet lastSweep = Date.now()\nconst SWEEP_INTERVAL = 60_000\n\nfunction sweep(now: number) {\n if (now - lastSweep < SWEEP_INTERVAL) {return}\n lastSweep = now\n for (const [key, bucket] of buckets) {\n if (bucket.resetAt <= now) {buckets.delete(key)}\n }\n}\n\nexport type RateLimitArgs = {\n /** Identifier to limit on — typically the client IP. */\n key: string\n /** Max submissions allowed per window. Defaults to 5. */\n max?: number\n /** Window length in ms. Defaults to 60_000 (one minute). */\n windowMs?: number\n}\n\n/**\n * Returns true when the request is within the limit, false when it should be\n * rejected. A missing key (no IP) is allowed through — better to accept a\n * submission than to block everyone behind a proxy that strips the header.\n */\nexport function checkRateLimit({ key, max = 5, windowMs = 60_000 }: RateLimitArgs): boolean {\n if (!key) {return true}\n\n const now = Date.now()\n sweep(now)\n\n const bucket = buckets.get(key)\n\n if (!bucket || bucket.resetAt <= now) {\n buckets.set(key, { count: 1, resetAt: now + windowMs })\n return true\n }\n\n if (bucket.count >= max) {\n return false\n }\n\n bucket.count += 1\n return true\n}\n"],"names":["buckets","Map","lastSweep","Date","now","SWEEP_INTERVAL","sweep","key","bucket","resetAt","delete","checkRateLimit","max","windowMs","get","set","count"],"mappings":"AAEA;;;;;;;;;;;CAWC,GACD,MAAMA,UAAU,IAAIC;AAEpB,0EAA0E,GAC1E,IAAIC,YAAYC,KAAKC,GAAG;AACxB,MAAMC,iBAAiB;AAEvB,SAASC,MAAMF,GAAW;IACxB,IAAIA,MAAMF,YAAYG,gBAAgB;QAAC;IAAM;IAC7CH,YAAYE;IACZ,KAAK,MAAM,CAACG,KAAKC,OAAO,IAAIR,QAAS;QACnC,IAAIQ,OAAOC,OAAO,IAAIL,KAAK;YAACJ,QAAQU,MAAM,CAACH;QAAI;IACjD;AACF;AAWA;;;;CAIC,GACD,OAAO,SAASI,eAAe,EAAEJ,GAAG,EAAEK,MAAM,CAAC,EAAEC,WAAW,MAAM,EAAiB;IAC/E,IAAI,CAACN,KAAK;QAAC,OAAO;IAAI;IAEtB,MAAMH,MAAMD,KAAKC,GAAG;IACpBE,MAAMF;IAEN,MAAMI,SAASR,QAAQc,GAAG,CAACP;IAE3B,IAAI,CAACC,UAAUA,OAAOC,OAAO,IAAIL,KAAK;QACpCJ,QAAQe,GAAG,CAACR,KAAK;YAAES,OAAO;YAAGP,SAASL,MAAMS;QAAS;QACrD,OAAO;IACT;IAEA,IAAIL,OAAOQ,KAAK,IAAIJ,KAAK;QACvB,OAAO;IACT;IAEAJ,OAAOQ,KAAK,IAAI;IAChB,OAAO;AACT"}
|
||||
{"version":3,"sources":["../../../src/modules/forms/rateLimit.ts"],"sourcesContent":["// Moved to modules/shared/rateLimit.ts (shared with search and MCP routes).\nexport { checkRateLimit, clientIp, retryAfterSeconds, tooManyRequests } from '../shared/rateLimit.js'\nexport type { RateLimitArgs } from '../shared/rateLimit.js'\n"],"names":["checkRateLimit","clientIp","retryAfterSeconds","tooManyRequests"],"mappings":"AAAA,4EAA4E;AAC5E,SAASA,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,eAAe,QAAQ,yBAAwB"}
|
||||
Vendored
+7
-1
@@ -18,6 +18,12 @@ export type SubmitFormArgs = {
|
||||
*/
|
||||
maxPerMinute?: number;
|
||||
payload: BasePayload;
|
||||
/**
|
||||
* Turnstile can't be verified because of OUR side (missing/wrong secret,
|
||||
* Cloudflare unreachable): 'allow' (default) accepts the submission and shows
|
||||
* the problem in the panel; 'reject' refuses it.
|
||||
*/
|
||||
turnstileOnConfigError?: 'allow' | 'reject';
|
||||
/** Turnstile token; when present it is verified, when absent it is skipped. */
|
||||
turnstileToken?: string;
|
||||
};
|
||||
@@ -80,4 +86,4 @@ export type SubmitFormResult = {
|
||||
*
|
||||
* server-only: touches the Turnstile secret.
|
||||
*/
|
||||
export declare function submitForm({ consentFieldName, data, formId, ip, maxPerMinute, payload, turnstileToken, }: SubmitFormArgs): Promise<SubmitFormResult>;
|
||||
export declare function submitForm({ consentFieldName, data, formId, ip, maxPerMinute, payload, turnstileOnConfigError, turnstileToken, }: SubmitFormArgs): Promise<SubmitFormResult>;
|
||||
|
||||
Vendored
+2
-1
@@ -14,7 +14,7 @@ import { validateSubmission } from './validateSubmission.js';
|
||||
* which goes out over the configured email adapter (mailAdapter). Storing the submission is enough.
|
||||
*
|
||||
* server-only: touches the Turnstile secret.
|
||||
*/ export async function submitForm({ consentFieldName, data, formId, ip, maxPerMinute = 5, payload, turnstileToken }) {
|
||||
*/ export async function submitForm({ consentFieldName, data, formId, ip, maxPerMinute = 5, payload, turnstileOnConfigError = 'allow', turnstileToken }) {
|
||||
// 1. Rate limit — cheapest gate, drops a flood before any real work.
|
||||
if (maxPerMinute > 0 && ip) {
|
||||
if (!checkRateLimit({
|
||||
@@ -31,6 +31,7 @@ import { validateSubmission } from './validateSubmission.js';
|
||||
if (turnstileToken !== undefined) {
|
||||
const ok = await verifyTurnstile({
|
||||
ip,
|
||||
onConfigError: turnstileOnConfigError,
|
||||
payload,
|
||||
token: turnstileToken
|
||||
});
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+8
-2
@@ -1,7 +1,7 @@
|
||||
import type { BasePayload, SanitizedConfig } from 'payload';
|
||||
import type { ArchiveEntries, ContentOption, ResolvedRoute } from '../content/index.js';
|
||||
import type { I18nConfig } from '../i18n/index.js';
|
||||
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry } from '../seo/index.js';
|
||||
import type { PageMetadata, RobotsOptions, RobotsRules, SitemapEntry, SitemapStyleOptions } from '../seo/index.js';
|
||||
type CreateContentHelpersArgs = {
|
||||
/**
|
||||
* Absolute site origin for sitemap/robots URLs. Falls back to
|
||||
@@ -31,6 +31,11 @@ type CreateContentHelpersArgs = {
|
||||
robots?: RobotsOptions;
|
||||
/** SiteSettings global slug. Defaults to 'site-settings'. */
|
||||
settingsSlug?: string;
|
||||
/**
|
||||
* Browser look of `sitemapRoute` (/sitemap.xml). Default: built-in style,
|
||||
* header "XML Sitemap", credit "Technology by Intecion.com". `false` = raw XML.
|
||||
*/
|
||||
sitemapStyle?: false | SitemapStyleOptions;
|
||||
};
|
||||
/**
|
||||
* Bundles the per-request data helpers a frontend needs — the same cached
|
||||
@@ -58,7 +63,7 @@ type CreateContentHelpersArgs = {
|
||||
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
||||
* not the second, and a page component composes them in two obvious lines.
|
||||
*/
|
||||
export declare function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug, robots: robotsOptions, settingsSlug, }: CreateContentHelpersArgs): {
|
||||
export declare function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug, robots: robotsOptions, settingsSlug, sitemapStyle, }: CreateContentHelpersArgs): {
|
||||
generatePageMetadata: (locale: string, segments: string[] | undefined, page?: number) => Promise<PageMetadata>;
|
||||
generateStaticParams: () => Promise<Array<{
|
||||
locale: string;
|
||||
@@ -74,5 +79,6 @@ export declare function createContentHelpers({ baseUrl, config, content, i18n, p
|
||||
resolveRoute: (locale: string, segments: string[] | undefined, page: number) => Promise<null | ResolvedRoute>;
|
||||
robots: () => RobotsRules;
|
||||
sitemap: () => Promise<SitemapEntry[]>;
|
||||
sitemapRoute: (req: Request) => Promise<Response>;
|
||||
};
|
||||
export {};
|
||||
|
||||
+13
-3
@@ -1,7 +1,7 @@
|
||||
import { getPayload } from 'payload';
|
||||
import { cache } from 'react';
|
||||
import { getArchiveEntries, resolveRoute as resolveRouteRaw } from '../content/index.js';
|
||||
import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/index.js';
|
||||
import { buildRobots, buildSitemapEntries, createPageMetadata, createSitemapRouteHandler } from '../seo/index.js';
|
||||
/**
|
||||
* Bundles the per-request data helpers a frontend needs — the same cached
|
||||
* wrappers every project was writing by hand (getPayload, settings, locale
|
||||
@@ -27,7 +27,7 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
||||
* `resolveRoute` and `getEntries` are separate on purpose: routing decides what
|
||||
* a URL is, fetching gets the listing. Metadata generation needs the first and
|
||||
* not the second, and a page component composes them in two obvious lines.
|
||||
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings' }) {
|
||||
*/ export function createContentHelpers({ baseUrl, config, content, i18n, pagesSlug = 'pages', robots: robotsOptions, settingsSlug = 'site-settings', sitemapStyle }) {
|
||||
const origin = baseUrl ?? process.env.NEXT_PUBLIC_SERVER_URL ?? '';
|
||||
const getCachedPayload = cache(async ()=>getPayload({
|
||||
config: await config
|
||||
@@ -311,6 +311,15 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
||||
return [];
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Route handler for app/sitemap.xml/route.ts — XML for crawlers, styled for
|
||||
* people (`?style` serves the CSS from the plugin; nothing in /public):
|
||||
*
|
||||
* export { sitemapRoute as GET } from '@/lib/content'
|
||||
* export const dynamic = 'force-dynamic'
|
||||
*/ const sitemapRoute = createSitemapRouteHandler(sitemap, {
|
||||
style: sitemapStyle ?? {}
|
||||
});
|
||||
return {
|
||||
generatePageMetadata,
|
||||
generateStaticParams,
|
||||
@@ -321,7 +330,8 @@ import { buildRobots, buildSitemapEntries, createPageMetadata } from '../seo/ind
|
||||
getSettings,
|
||||
resolveRoute,
|
||||
robots,
|
||||
sitemap
|
||||
sitemap,
|
||||
sitemapRoute
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1,16 @@
|
||||
import type { Payload } from 'payload';
|
||||
type Props = {
|
||||
/** Admin route, for the link. Default '/admin'. */
|
||||
adminRoute?: string;
|
||||
/** Status groups to check: field name → label. */
|
||||
checks?: Record<string, string>;
|
||||
/** Injected by Payload into admin server components. */
|
||||
payload?: Payload;
|
||||
};
|
||||
/**
|
||||
* Dashboard alert (admin.components.beforeDashboard): lists integrations that
|
||||
* are currently failing, with a link to Site Integrations. Renders nothing when
|
||||
* everything is fine — and never throws (DB not ready → nothing).
|
||||
*/
|
||||
export declare function IntegrationAlerts({ adminRoute, checks, payload }: Props): Promise<import("react/jsx-runtime").JSX.Element | null>;
|
||||
export default IntegrationAlerts;
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
/**
|
||||
* Dashboard alert (admin.components.beforeDashboard): lists integrations that
|
||||
* are currently failing, with a link to Site Integrations. Renders nothing when
|
||||
* everything is fine — and never throws (DB not ready → nothing).
|
||||
*/ export async function IntegrationAlerts({ adminRoute = '/admin', checks = {
|
||||
turnstileStatus: 'Turnstile'
|
||||
}, payload }) {
|
||||
if (!payload) {
|
||||
return null;
|
||||
}
|
||||
let doc;
|
||||
try {
|
||||
doc = await payload.findGlobal({
|
||||
slug: 'site-integrations',
|
||||
depth: 0
|
||||
});
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
const failing = Object.entries(checks).map(([field, label])=>({
|
||||
label,
|
||||
status: doc?.[field]
|
||||
})).filter((x)=>x.status?.state === 'degraded');
|
||||
if (!failing.length) {
|
||||
return null;
|
||||
}
|
||||
return /*#__PURE__*/ _jsxs("div", {
|
||||
role: "alert",
|
||||
style: {
|
||||
background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))',
|
||||
border: '1px solid var(--theme-error-400, #e5484d)',
|
||||
borderRadius: 4,
|
||||
marginBottom: '1.5rem',
|
||||
padding: '1rem 1.25rem'
|
||||
},
|
||||
children: [
|
||||
/*#__PURE__*/ _jsx("strong", {
|
||||
children: "Integration problem — the site still works, but a safeguard is off."
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("ul", {
|
||||
style: {
|
||||
margin: '0.5rem 0 0',
|
||||
paddingLeft: '1.2rem'
|
||||
},
|
||||
children: failing.map(({ label, status })=>/*#__PURE__*/ _jsxs("li", {
|
||||
children: [
|
||||
/*#__PURE__*/ _jsxs("strong", {
|
||||
children: [
|
||||
label,
|
||||
":"
|
||||
]
|
||||
}),
|
||||
" ",
|
||||
status?.message ?? status?.code ?? 'error'
|
||||
]
|
||||
}, label))
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("a", {
|
||||
href: `${adminRoute.replace(/\/$/, '')}/globals/site-integrations`,
|
||||
style: {
|
||||
display: 'inline-block',
|
||||
marginTop: '0.5rem'
|
||||
},
|
||||
children: "Open Site Integrations →"
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
export default IntegrationAlerts;
|
||||
|
||||
//# sourceMappingURL=IntegrationAlerts.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/integrations/IntegrationAlerts.tsx"],"sourcesContent":["import type { Payload } from 'payload'\n\nimport type { IntegrationStatus } from './status.js'\n\ntype Props = {\n /** Admin route, for the link. Default '/admin'. */\n adminRoute?: string\n /** Status groups to check: field name → label. */\n checks?: Record<string, string>\n /** Injected by Payload into admin server components. */\n payload?: Payload\n}\n\n/**\n * Dashboard alert (admin.components.beforeDashboard): lists integrations that\n * are currently failing, with a link to Site Integrations. Renders nothing when\n * everything is fine — and never throws (DB not ready → nothing).\n */\nexport async function IntegrationAlerts({ adminRoute = '/admin', checks = { turnstileStatus: 'Turnstile' }, payload }: Props) {\n if (!payload) {return null}\n let doc: Record<string, unknown>\n try {\n doc = (await payload.findGlobal({ slug: 'site-integrations' as never, depth: 0 })) as Record<string, unknown>\n } catch {\n return null\n }\n const failing = Object.entries(checks)\n .map(([field, label]) => ({ label, status: doc?.[field] as IntegrationStatus | undefined }))\n .filter((x) => x.status?.state === 'degraded')\n if (!failing.length) {return null}\n\n return (\n <div\n role=\"alert\"\n style={{\n background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))',\n border: '1px solid var(--theme-error-400, #e5484d)',\n borderRadius: 4,\n marginBottom: '1.5rem',\n padding: '1rem 1.25rem',\n }}\n >\n <strong>Integration problem — the site still works, but a safeguard is off.</strong>\n <ul style={{ margin: '0.5rem 0 0', paddingLeft: '1.2rem' }}>\n {failing.map(({ label, status }) => (\n <li key={label}>\n <strong>{label}:</strong> {status?.message ?? status?.code ?? 'error'}\n </li>\n ))}\n </ul>\n <a href={`${adminRoute.replace(/\\/$/, '')}/globals/site-integrations`} style={{ display: 'inline-block', marginTop: '0.5rem' }}>\n Open Site Integrations →\n </a>\n </div>\n )\n}\n\nexport default IntegrationAlerts\n"],"names":["IntegrationAlerts","adminRoute","checks","turnstileStatus","payload","doc","findGlobal","slug","depth","failing","Object","entries","map","field","label","status","filter","x","state","length","div","role","style","background","border","borderRadius","marginBottom","padding","strong","ul","margin","paddingLeft","li","message","code","a","href","replace","display","marginTop"],"mappings":";AAaA;;;;CAIC,GACD,OAAO,eAAeA,kBAAkB,EAAEC,aAAa,QAAQ,EAAEC,SAAS;IAAEC,iBAAiB;AAAY,CAAC,EAAEC,OAAO,EAAS;IAC1H,IAAI,CAACA,SAAS;QAAC,OAAO;IAAI;IAC1B,IAAIC;IACJ,IAAI;QACFA,MAAO,MAAMD,QAAQE,UAAU,CAAC;YAAEC,MAAM;YAA8BC,OAAO;QAAE;IACjF,EAAE,OAAM;QACN,OAAO;IACT;IACA,MAAMC,UAAUC,OAAOC,OAAO,CAACT,QAC5BU,GAAG,CAAC,CAAC,CAACC,OAAOC,MAAM,GAAM,CAAA;YAAEA;YAAOC,QAAQV,KAAK,CAACQ,MAAM;QAAkC,CAAA,GACxFG,MAAM,CAAC,CAACC,IAAMA,EAAEF,MAAM,EAAEG,UAAU;IACrC,IAAI,CAACT,QAAQU,MAAM,EAAE;QAAC,OAAO;IAAI;IAEjC,qBACE,MAACC;QACCC,MAAK;QACLC,OAAO;YACLC,YAAY;YACZC,QAAQ;YACRC,cAAc;YACdC,cAAc;YACdC,SAAS;QACX;;0BAEA,KAACC;0BAAO;;0BACR,KAACC;gBAAGP,OAAO;oBAAEQ,QAAQ;oBAAcC,aAAa;gBAAS;0BACtDtB,QAAQG,GAAG,CAAC,CAAC,EAAEE,KAAK,EAAEC,MAAM,EAAE,iBAC7B,MAACiB;;0CACC,MAACJ;;oCAAQd;oCAAM;;;4BAAU;4BAAEC,QAAQkB,WAAWlB,QAAQmB,QAAQ;;uBADvDpB;;0BAKb,KAACqB;gBAAEC,MAAM,GAAGnC,WAAWoC,OAAO,CAAC,OAAO,IAAI,0BAA0B,CAAC;gBAAEf,OAAO;oBAAEgB,SAAS;oBAAgBC,WAAW;gBAAS;0BAAG;;;;AAKtI;AAEA,eAAevC,kBAAiB"}
|
||||
@@ -0,0 +1,13 @@
|
||||
type Props = {
|
||||
/** Integration name shown in the banner, e.g. 'Turnstile'. */
|
||||
label: string;
|
||||
/** Name of the hidden status group (buildIntegrationStatusField). */
|
||||
statusField: string;
|
||||
};
|
||||
/**
|
||||
* Status banner on an integration's tab (Site Integrations). Shows nothing until
|
||||
* the integration has been used once; a red box while it's failing; a short
|
||||
* green line once it works again.
|
||||
*/
|
||||
export declare function IntegrationStatusBanner({ label, statusField }: Props): import("react/jsx-runtime").JSX.Element | null;
|
||||
export default IntegrationStatusBanner;
|
||||
@@ -0,0 +1,87 @@
|
||||
'use client';
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useFormFields } from '@payloadcms/ui';
|
||||
const fmt = (iso)=>{
|
||||
if (typeof iso !== 'string' || !iso) {
|
||||
return '';
|
||||
}
|
||||
const d = new Date(iso);
|
||||
return Number.isNaN(d.getTime()) ? '' : d.toLocaleString();
|
||||
};
|
||||
/**
|
||||
* Status banner on an integration's tab (Site Integrations). Shows nothing until
|
||||
* the integration has been used once; a red box while it's failing; a short
|
||||
* green line once it works again.
|
||||
*/ export function IntegrationStatusBanner({ label, statusField }) {
|
||||
const state = useFormFields(([f])=>f[`${statusField}.state`]?.value);
|
||||
const message = useFormFields(([f])=>f[`${statusField}.message`]?.value);
|
||||
const code = useFormFields(([f])=>f[`${statusField}.code`]?.value);
|
||||
const since = useFormFields(([f])=>f[`${statusField}.since`]?.value);
|
||||
const checkedAt = useFormFields(([f])=>f[`${statusField}.checkedAt`]?.value);
|
||||
if (!state) {
|
||||
return null;
|
||||
}
|
||||
if (state === 'ok') {
|
||||
return /*#__PURE__*/ _jsxs("div", {
|
||||
style: {
|
||||
fontSize: '0.85rem',
|
||||
marginBottom: '1.5rem',
|
||||
opacity: 0.75
|
||||
},
|
||||
children: [
|
||||
"✓ ",
|
||||
label,
|
||||
" working",
|
||||
since ? ` since ${fmt(since)}` : '',
|
||||
"."
|
||||
]
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/ _jsxs("div", {
|
||||
role: "alert",
|
||||
style: {
|
||||
background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))',
|
||||
border: '1px solid var(--theme-error-400, #e5484d)',
|
||||
borderRadius: 4,
|
||||
marginBottom: '1.5rem',
|
||||
padding: '0.9rem 1rem'
|
||||
},
|
||||
children: [
|
||||
/*#__PURE__*/ _jsxs("strong", {
|
||||
children: [
|
||||
label,
|
||||
" is not working — forms are accepted without this check."
|
||||
]
|
||||
}),
|
||||
message ? /*#__PURE__*/ _jsx("div", {
|
||||
style: {
|
||||
marginTop: '0.35rem'
|
||||
},
|
||||
children: message
|
||||
}) : null,
|
||||
/*#__PURE__*/ _jsxs("div", {
|
||||
style: {
|
||||
fontSize: '0.8rem',
|
||||
marginTop: '0.35rem',
|
||||
opacity: 0.75
|
||||
},
|
||||
children: [
|
||||
code ? `Code: ${code}. ` : '',
|
||||
since ? `Since ${fmt(since)}. ` : '',
|
||||
checkedAt ? `Last seen ${fmt(checkedAt)}.` : ''
|
||||
]
|
||||
}),
|
||||
/*#__PURE__*/ _jsx("div", {
|
||||
style: {
|
||||
fontSize: '0.8rem',
|
||||
marginTop: '0.35rem',
|
||||
opacity: 0.75
|
||||
},
|
||||
children: "Fix the keys below and save — the status is checked again on the next form submission."
|
||||
})
|
||||
]
|
||||
});
|
||||
}
|
||||
export default IntegrationStatusBanner;
|
||||
|
||||
//# sourceMappingURL=IntegrationStatusBanner.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/integrations/IntegrationStatusBanner.tsx"],"sourcesContent":["'use client'\nimport { useFormFields } from '@payloadcms/ui'\n\ntype Props = {\n /** Integration name shown in the banner, e.g. 'Turnstile'. */\n label: string\n /** Name of the hidden status group (buildIntegrationStatusField). */\n statusField: string\n}\n\nconst fmt = (iso: unknown) => {\n if (typeof iso !== 'string' || !iso) {return ''}\n const d = new Date(iso)\n return Number.isNaN(d.getTime()) ? '' : d.toLocaleString()\n}\n\n/**\n * Status banner on an integration's tab (Site Integrations). Shows nothing until\n * the integration has been used once; a red box while it's failing; a short\n * green line once it works again.\n */\nexport function IntegrationStatusBanner({ label, statusField }: Props) {\n const state = useFormFields(([f]) => f[`${statusField}.state`]?.value) as string | undefined\n const message = useFormFields(([f]) => f[`${statusField}.message`]?.value) as string | undefined\n const code = useFormFields(([f]) => f[`${statusField}.code`]?.value) as string | undefined\n const since = useFormFields(([f]) => f[`${statusField}.since`]?.value)\n const checkedAt = useFormFields(([f]) => f[`${statusField}.checkedAt`]?.value)\n\n if (!state) {return null}\n\n if (state === 'ok') {\n return (\n <div style={{ fontSize: '0.85rem', marginBottom: '1.5rem', opacity: 0.75 }}>\n ✓ {label} working{since ? ` since ${fmt(since)}` : ''}.\n </div>\n )\n }\n\n return (\n <div\n role=\"alert\"\n style={{\n background: 'var(--theme-error-50, rgba(229, 72, 77, 0.08))',\n border: '1px solid var(--theme-error-400, #e5484d)',\n borderRadius: 4,\n marginBottom: '1.5rem',\n padding: '0.9rem 1rem',\n }}\n >\n <strong>{label} is not working — forms are accepted without this check.</strong>\n {message ? <div style={{ marginTop: '0.35rem' }}>{message}</div> : null}\n <div style={{ fontSize: '0.8rem', marginTop: '0.35rem', opacity: 0.75 }}>\n {code ? `Code: ${code}. ` : ''}\n {since ? `Since ${fmt(since)}. ` : ''}\n {checkedAt ? `Last seen ${fmt(checkedAt)}.` : ''}\n </div>\n <div style={{ fontSize: '0.8rem', marginTop: '0.35rem', opacity: 0.75 }}>\n Fix the keys below and save — the status is checked again on the next form submission.\n </div>\n </div>\n )\n}\n\nexport default IntegrationStatusBanner\n"],"names":["useFormFields","fmt","iso","d","Date","Number","isNaN","getTime","toLocaleString","IntegrationStatusBanner","label","statusField","state","f","value","message","code","since","checkedAt","div","style","fontSize","marginBottom","opacity","role","background","border","borderRadius","padding","strong","marginTop"],"mappings":"AAAA;;AACA,SAASA,aAAa,QAAQ,iBAAgB;AAS9C,MAAMC,MAAM,CAACC;IACX,IAAI,OAAOA,QAAQ,YAAY,CAACA,KAAK;QAAC,OAAO;IAAE;IAC/C,MAAMC,IAAI,IAAIC,KAAKF;IACnB,OAAOG,OAAOC,KAAK,CAACH,EAAEI,OAAO,MAAM,KAAKJ,EAAEK,cAAc;AAC1D;AAEA;;;;CAIC,GACD,OAAO,SAASC,wBAAwB,EAAEC,KAAK,EAAEC,WAAW,EAAS;IACnE,MAAMC,QAAQZ,cAAc,CAAC,CAACa,EAAE,GAAKA,CAAC,CAAC,GAAGF,YAAY,MAAM,CAAC,CAAC,EAAEG;IAChE,MAAMC,UAAUf,cAAc,CAAC,CAACa,EAAE,GAAKA,CAAC,CAAC,GAAGF,YAAY,QAAQ,CAAC,CAAC,EAAEG;IACpE,MAAME,OAAOhB,cAAc,CAAC,CAACa,EAAE,GAAKA,CAAC,CAAC,GAAGF,YAAY,KAAK,CAAC,CAAC,EAAEG;IAC9D,MAAMG,QAAQjB,cAAc,CAAC,CAACa,EAAE,GAAKA,CAAC,CAAC,GAAGF,YAAY,MAAM,CAAC,CAAC,EAAEG;IAChE,MAAMI,YAAYlB,cAAc,CAAC,CAACa,EAAE,GAAKA,CAAC,CAAC,GAAGF,YAAY,UAAU,CAAC,CAAC,EAAEG;IAExE,IAAI,CAACF,OAAO;QAAC,OAAO;IAAI;IAExB,IAAIA,UAAU,MAAM;QAClB,qBACE,MAACO;YAAIC,OAAO;gBAAEC,UAAU;gBAAWC,cAAc;gBAAUC,SAAS;YAAK;;gBAAG;gBACvEb;gBAAM;gBAASO,QAAQ,CAAC,OAAO,EAAEhB,IAAIgB,QAAQ,GAAG;gBAAG;;;IAG5D;IAEA,qBACE,MAACE;QACCK,MAAK;QACLJ,OAAO;YACLK,YAAY;YACZC,QAAQ;YACRC,cAAc;YACdL,cAAc;YACdM,SAAS;QACX;;0BAEA,MAACC;;oBAAQnB;oBAAM;;;YACdK,wBAAU,KAACI;gBAAIC,OAAO;oBAAEU,WAAW;gBAAU;0BAAIf;iBAAiB;0BACnE,MAACI;gBAAIC,OAAO;oBAAEC,UAAU;oBAAUS,WAAW;oBAAWP,SAAS;gBAAK;;oBACnEP,OAAO,CAAC,MAAM,EAAEA,KAAK,EAAE,CAAC,GAAG;oBAC3BC,QAAQ,CAAC,MAAM,EAAEhB,IAAIgB,OAAO,EAAE,CAAC,GAAG;oBAClCC,YAAY,CAAC,UAAU,EAAEjB,IAAIiB,WAAW,CAAC,CAAC,GAAG;;;0BAEhD,KAACC;gBAAIC,OAAO;oBAAEC,UAAU;oBAAUS,WAAW;oBAAWP,SAAS;gBAAK;0BAAG;;;;AAK/E;AAEA,eAAed,wBAAuB"}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
export { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus, } from './status.js';
|
||||
export type { IntegrationState, IntegrationStatus } from './status.js';
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
export { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus } from './status.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/integrations/index.ts"],"sourcesContent":["export {\n buildIntegrationStatusBanner,\n buildIntegrationStatusField,\n recordIntegrationStatus,\n} from './status.js'\nexport type { IntegrationState, IntegrationStatus } from './status.js'\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","recordIntegrationStatus"],"mappings":"AAAA,SACEA,4BAA4B,EAC5BC,2BAA2B,EAC3BC,uBAAuB,QAClB,cAAa"}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
import type { BasePayload, Field } from 'payload';
|
||||
/**
|
||||
* Health of a third-party integration (Turnstile today, SMTP/Graph later),
|
||||
* stored on the SiteIntegrations global so the panel can show it:
|
||||
* - a banner on the integration's tab (IntegrationStatusBanner),
|
||||
* - an alert on the admin dashboard (IntegrationAlerts).
|
||||
*
|
||||
* Written by the server when it USES the integration (e.g. verifying a form
|
||||
* token) — no polling, no cron. Writes are throttled: only on a state change, or
|
||||
* at most every REFRESH_MS while an error persists, so a broken integration on a
|
||||
* busy form doesn't turn every submission into a DB write.
|
||||
*/
|
||||
export type IntegrationState = 'degraded' | 'ok';
|
||||
export type IntegrationStatus = {
|
||||
/** Last time the integration was used (refreshed at most every REFRESH_MS). */
|
||||
checkedAt?: null | string;
|
||||
/** Machine code from the provider or the plugin, e.g. 'invalid-input-secret', 'missing-secret'. */
|
||||
code?: null | string;
|
||||
/** Human explanation shown in the panel (English — panel language). */
|
||||
message?: null | string;
|
||||
/** When the current state started. */
|
||||
since?: null | string;
|
||||
state?: IntegrationState | null;
|
||||
};
|
||||
/** Hidden group field holding the status — add next to the integration's fields. */
|
||||
export declare function buildIntegrationStatusField(name: string): Field;
|
||||
/** Read-only banner (UI field) — shows the status group `statusField` on the tab. */
|
||||
export declare function buildIntegrationStatusBanner(statusField: string, label: string): Field;
|
||||
/**
|
||||
* Persist a status change. Never throws — a status write must not break the
|
||||
* request that triggered it.
|
||||
*/
|
||||
export declare function recordIntegrationStatus(payload: BasePayload, field: string, previous: IntegrationStatus | null | undefined, next: {
|
||||
code?: string;
|
||||
message?: string;
|
||||
state: IntegrationState;
|
||||
}): Promise<void>;
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
const REFRESH_MS = 10 * 60_000;
|
||||
const SITE_INTEGRATIONS = 'site-integrations';
|
||||
/** Hidden group field holding the status — add next to the integration's fields. */ export function buildIntegrationStatusField(name) {
|
||||
return {
|
||||
name,
|
||||
type: 'group',
|
||||
admin: {
|
||||
hidden: true
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'state',
|
||||
type: 'select',
|
||||
options: [
|
||||
'ok',
|
||||
'degraded'
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'code',
|
||||
type: 'text'
|
||||
},
|
||||
{
|
||||
name: 'message',
|
||||
type: 'text'
|
||||
},
|
||||
{
|
||||
name: 'since',
|
||||
type: 'date'
|
||||
},
|
||||
{
|
||||
name: 'checkedAt',
|
||||
type: 'date'
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
/** Read-only banner (UI field) — shows the status group `statusField` on the tab. */ export function buildIntegrationStatusBanner(statusField, label) {
|
||||
return {
|
||||
name: `${statusField}Banner`,
|
||||
type: 'ui',
|
||||
admin: {
|
||||
components: {
|
||||
Field: {
|
||||
clientProps: {
|
||||
label,
|
||||
statusField
|
||||
},
|
||||
path: '@intecion/ipal-kit/client#IntegrationStatusBanner'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Persist a status change. Never throws — a status write must not break the
|
||||
* request that triggered it.
|
||||
*/ export async function recordIntegrationStatus(payload, field, previous, next) {
|
||||
const now = new Date();
|
||||
const changed = previous?.state !== next.state || next.state === 'degraded' && previous?.code !== next.code;
|
||||
const stale = next.state === 'degraded' && (!previous?.checkedAt || now.getTime() - new Date(previous.checkedAt).getTime() > REFRESH_MS);
|
||||
// Healthy and already recorded as healthy (or never recorded) → nothing to do.
|
||||
if (!changed && !stale) {
|
||||
return;
|
||||
}
|
||||
if (next.state === 'ok' && !previous?.state) {
|
||||
return;
|
||||
}
|
||||
const status = {
|
||||
checkedAt: now.toISOString(),
|
||||
code: next.code ?? null,
|
||||
message: next.message ?? null,
|
||||
since: changed ? now.toISOString() : previous?.since ?? now.toISOString(),
|
||||
state: next.state
|
||||
};
|
||||
try {
|
||||
await payload.updateGlobal({
|
||||
slug: SITE_INTEGRATIONS,
|
||||
context: {
|
||||
ipalIntegrationStatus: true
|
||||
},
|
||||
data: {
|
||||
[field]: status
|
||||
},
|
||||
depth: 0
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn(`[ipal] could not record ${field}:`, err instanceof Error ? err.message : err);
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=status.js.map
|
||||
+1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { rowLabel } from 'src/modules/admin-ui/rowLabel.js';
|
||||
const URL_PATTERN = /^(https?:\/\/|mailto:|tel:|#)/;
|
||||
import { rowLabel } from '../admin-ui/rowLabel.js';
|
||||
const URL_PATTERN = /^(?:https?:\/\/|mailto:|tel:|#)/;
|
||||
/**
|
||||
* The ONE link shape for a project: a page, an external URL (also mailto:,
|
||||
* tel:, #anchor) or an uploaded file — plus label, new-tab flag and visual
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+10
@@ -10,6 +10,16 @@ type CreateMcpRouteArgs = {
|
||||
/** Archive-backed collections (same as the plugin option) for get_page. */
|
||||
content?: ContentOption;
|
||||
getCachedPayload: () => Promise<BasePayload>;
|
||||
/** Max messages in one JSON-RPC batch. Default 10. */
|
||||
maxBatch?: number;
|
||||
/**
|
||||
* Per-IP limit on JSON-RPC messages (a batch counts every message) (in memory, per instance). Default { max: 60, windowMs: 60_000 }.
|
||||
* `false` = off (a limiter in front, e.g. Cloudflare WAF rate limiting).
|
||||
*/
|
||||
rateLimit?: {
|
||||
max?: number;
|
||||
windowMs?: number;
|
||||
} | false;
|
||||
/** Server name advertised in `initialize`. Default 'ipal-site'. */
|
||||
serverName?: string;
|
||||
/** Server version advertised in `initialize`. Default '1.0.0'. */
|
||||
|
||||
Vendored
+26
-1
@@ -1,5 +1,6 @@
|
||||
import { createMarkdownRenderer, searchContent } from '../content/index.js';
|
||||
import { getDefaultLocale, isValidLocale } from '../i18n/index.js';
|
||||
import { checkRateLimit, clientIp, tooManyRequests } from '../shared/rateLimit.js';
|
||||
/**
|
||||
* A read-only MCP (Model Context Protocol) server for the client site, as a Next
|
||||
* route handler. Lets Claude / any MCP client CONNECT to the site and query it
|
||||
@@ -59,7 +60,12 @@ function toolText(text, isError = false) {
|
||||
};
|
||||
}
|
||||
export function createMcpRoute(args) {
|
||||
const { baseUrl, collection = 'pages', config, content, getCachedPayload, serverName = 'ipal-site', serverVersion = '1.0.0', settingsSlug = 'site-settings', summaryField } = args;
|
||||
const { baseUrl, collection = 'pages', config, content, getCachedPayload, maxBatch = 10, serverName = 'ipal-site', serverVersion = '1.0.0', settingsSlug = 'site-settings', summaryField } = args;
|
||||
const rl = args.rateLimit === false ? null : {
|
||||
max: 60,
|
||||
windowMs: 60_000,
|
||||
...args.rateLimit
|
||||
};
|
||||
const origin = baseUrl?.replace(/\/$/, '') ?? '';
|
||||
const renderMarkdown = createMarkdownRenderer({
|
||||
collection,
|
||||
@@ -217,6 +223,25 @@ export function createMcpRoute(args) {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
// Limits: a batch counts as many requests as it has messages, and is capped —
|
||||
// otherwise one POST could carry hundreds of tool calls (DB queries).
|
||||
const messages = Array.isArray(body) ? body.length : 1;
|
||||
if (Array.isArray(body) && body.length > maxBatch) {
|
||||
return Response.json(rpcError(null, -32600, `Batch too large (max ${maxBatch})`), {
|
||||
status: 400
|
||||
});
|
||||
}
|
||||
if (rl) {
|
||||
const ip = clientIp(req);
|
||||
if (!checkRateLimit({
|
||||
cost: messages,
|
||||
key: ip,
|
||||
scope: 'mcp',
|
||||
...rl
|
||||
})) {
|
||||
return tooManyRequests(ip, 'mcp', rpcError(null, -32000, 'Too many requests'));
|
||||
}
|
||||
}
|
||||
// Batch or single.
|
||||
if (Array.isArray(body)) {
|
||||
const out = (await Promise.all(body.map((m)=>handleOne(m)))).filter((r)=>r !== null);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-1
@@ -68,7 +68,8 @@
|
||||
"'none'"
|
||||
]
|
||||
};
|
||||
if (r2Url) {
|
||||
// Site-relative R2_PUBLIC_URL ('/media', dev) is same-origin — already covered by 'self'.
|
||||
if (r2Url && /^https?:\/\//i.test(r2Url)) {
|
||||
src['img-src'].push(r2Url);
|
||||
}
|
||||
if (turnstile) {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+33
-30
@@ -1,38 +1,41 @@
|
||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||
export type { AutoFillMapping } from './autoFillMeta.js';
|
||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||
export { createManifestHandler } from './buildManifest.js';
|
||||
export type { SeoOption, SeoMeta } from './types.js';
|
||||
export { composeTitle } from './composeTitle.js';
|
||||
export type { TitleOrder } from './composeTitle.js';
|
||||
export { buildHreflangAlternates } from './hreflang.js';
|
||||
export { buildMetadata } from './buildMetadata.js';
|
||||
export type { PageMetadata } from './buildMetadata.js';
|
||||
export { buildNoindexField } from './buildNoindexField.js';
|
||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js';
|
||||
export type { RobotsOptions, RobotsRules } from './buildRobots.js';
|
||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||
export type { AutoFillMapping } from './autoFillMeta.js';
|
||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||
export { createPageMetadata } from './createPageMetadata.js';
|
||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export type { SiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
||||
export type { SitemapEntry } from './buildSitemapEntries.js';
|
||||
export { buildSitemapXml } from './buildSitemapXml.js';
|
||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||
export type { SitemapEntry } from './buildSitemapEntries.js';
|
||||
export { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js';
|
||||
export type { RobotsRules, RobotsOptions } from './buildRobots.js';
|
||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||
export { validateFaviconField } from './validateFavicon.js';
|
||||
export { buildNoindexField } from './buildNoindexField.js';
|
||||
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
||||
export { buildSummaryField } from './buildSummaryField.js';
|
||||
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
||||
export { composeTitle } from './composeTitle.js';
|
||||
export type { TitleOrder } from './composeTitle.js';
|
||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||
export { createPageMetadata } from './createPageMetadata.js';
|
||||
export { buildHreflangAlternates } from './hreflang.js';
|
||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export type { SiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||
export type { SeoMeta, SeoOption } from './types.js';
|
||||
export { validateFaviconField } from './validateFavicon.js';
|
||||
export type { SitemapRouteOptions } from './routeHandlers.js';
|
||||
export { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js';
|
||||
export type { SitemapStyleOptions } from './sitemapStyle.js';
|
||||
export { createManifestHandler } from './buildManifest.js';
|
||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||
|
||||
Vendored
+25
-24
@@ -1,33 +1,34 @@
|
||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||
export { createManifestHandler } from './buildManifest.js';
|
||||
export { composeTitle } from './composeTitle.js';
|
||||
export { buildHreflangAlternates } from './hreflang.js';
|
||||
export { buildMetadata } from './buildMetadata.js';
|
||||
export { buildNoindexField } from './buildNoindexField.js';
|
||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||
export { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js';
|
||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||
export { buildAutoFillMetaHook } from './autoFillMeta.js';
|
||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||
export { createPageMetadata } from './createPageMetadata.js';
|
||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||
export { buildSitemapEntries } from './buildSitemapEntries.js';
|
||||
export { buildSitemapXml } from './buildSitemapXml.js';
|
||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||
export { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js';
|
||||
export { buildIconsMetadata } from './buildIconsMetadata.js';
|
||||
export { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js';
|
||||
export { validateFaviconField } from './validateFavicon.js';
|
||||
export { buildNoindexField } from './buildNoindexField.js';
|
||||
export { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js';
|
||||
export { buildSummaryField } from './buildSummaryField.js';
|
||||
export { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js';
|
||||
export { composeTitle } from './composeTitle.js';
|
||||
export { createMetadataGenerator } from './createMetadataGenerator.js';
|
||||
export { createPageMetadata } from './createPageMetadata.js';
|
||||
export { buildHreflangAlternates } from './hreflang.js';
|
||||
export { injectAutoFillMeta } from './injectAutoFillMeta.js';
|
||||
export { injectSeoTabs } from './injectSeoTabs.js';
|
||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||
export { readSiteMetaConfig } from './readSiteMetaConfig.js';
|
||||
export { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js';
|
||||
export { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js';
|
||||
export { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js';
|
||||
export { buildFaqJsonLd } from './buildFaqJsonLd.js';
|
||||
export { buildServiceJsonLd } from './buildServiceJsonLd.js';
|
||||
export { buildArticleJsonLd } from './buildArticleJsonLd.js';
|
||||
export { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||
export { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js';
|
||||
export { buildSeoPlugin } from './seoPluginConfig.js';
|
||||
export { slugsAcrossLocales } from './slugsAcrossLocales.js';
|
||||
export { validateFaviconField } from './validateFavicon.js';
|
||||
export { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js';
|
||||
export { createManifestHandler } from './buildManifest.js';
|
||||
export { JsonLdGraph } from './JsonLdGraph.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/seo/index.ts"],"sourcesContent":["export { buildAutoFillMetaHook } from './autoFillMeta.js'\nexport type { AutoFillMapping } from './autoFillMeta.js'\nexport { buildArticleJsonLd } from './buildArticleJsonLd.js'\nexport { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'\nexport { buildFaqJsonLd } from './buildFaqJsonLd.js'\nexport { buildIconsMetadata } from './buildIconsMetadata.js'\nexport { buildLlmsTxt } from './buildLlmsTxt.js'\nexport { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'\nexport { createManifestHandler } from './buildManifest.js'\nexport { buildMetadata } from './buildMetadata.js'\nexport type { PageMetadata } from './buildMetadata.js'\nexport { buildNoindexField } from './buildNoindexField.js'\nexport { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'\nexport { AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, buildRobots } from './buildRobots.js'\nexport type { RobotsOptions, RobotsRules } from './buildRobots.js'\nexport { buildServiceJsonLd } from './buildServiceJsonLd.js'\nexport { buildSitemapEntries } from './buildSitemapEntries.js'\nexport type { SitemapEntry } from './buildSitemapEntries.js'\nexport { buildSitemapXml } from './buildSitemapXml.js'\nexport { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'\nexport { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'\nexport { buildSummaryField } from './buildSummaryField.js'\nexport { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'\nexport { composeTitle } from './composeTitle.js'\nexport type { TitleOrder } from './composeTitle.js'\nexport { createMetadataGenerator } from './createMetadataGenerator.js'\nexport { createPageMetadata } from './createPageMetadata.js'\nexport { buildHreflangAlternates } from './hreflang.js'\nexport { injectAutoFillMeta } from './injectAutoFillMeta.js'\nexport { injectSeoTabs } from './injectSeoTabs.js'\nexport { JsonLdGraph } from './JsonLdGraph.js'\nexport { readSiteMetaConfig } from './readSiteMetaConfig.js'\nexport type { SiteMetaConfig } from './readSiteMetaConfig.js'\nexport { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'\nexport { buildSeoPlugin } from './seoPluginConfig.js'\nexport { slugsAcrossLocales } from './slugsAcrossLocales.js'\nexport type { SeoMeta, SeoOption } from './types.js'\nexport { validateFaviconField } from './validateFavicon.js'\n"],"names":["buildAutoFillMetaHook","buildArticleJsonLd","buildBreadcrumbJsonLd","buildFaqJsonLd","buildIconsMetadata","buildLlmsTxt","buildLocalBusinessJsonLd","createManifestHandler","buildMetadata","buildNoindexField","buildOrganizationJsonLd","AI_ASSISTANT_BOTS","AI_TRAINING_BOTS","buildRobots","buildServiceJsonLd","buildSitemapEntries","buildSitemapXml","buildSiteNavigationJsonLd","buildSpeakableJsonLd","buildSummaryField","buildWebSiteJsonLd","composeTitle","createMetadataGenerator","createPageMetadata","buildHreflangAlternates","injectAutoFillMeta","injectSeoTabs","JsonLdGraph","readSiteMetaConfig","createLlmsTxtRoute","createSitemapRouteHandler","buildSeoPlugin","slugsAcrossLocales","validateFaviconField"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oBAAmB;AAEzD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,iBAAiB,EAAEC,gBAAgB,EAAEC,WAAW,QAAQ,mBAAkB;AAEnF,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,uBAAuB,QAAQ,gBAAe;AACvD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,kBAAkB,EAAEC,yBAAyB,QAAQ,qBAAoB;AAClF,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,oBAAoB,QAAQ,uBAAsB"}
|
||||
{"version":3,"sources":["../../../src/modules/seo/index.ts"],"sourcesContent":["export type { SeoOption, SeoMeta } from './types.js'\nexport { composeTitle } from './composeTitle.js'\nexport type { TitleOrder } from './composeTitle.js'\nexport { buildHreflangAlternates } from './hreflang.js'\nexport { buildMetadata } from './buildMetadata.js'\nexport type { PageMetadata } from './buildMetadata.js'\nexport { buildSeoPlugin } from './seoPluginConfig.js'\nexport { buildAutoFillMetaHook } from './autoFillMeta.js'\nexport { injectAutoFillMeta } from './injectAutoFillMeta.js'\nexport { injectSeoTabs } from './injectSeoTabs.js'\nexport type { AutoFillMapping } from './autoFillMeta.js'\nexport { createMetadataGenerator } from './createMetadataGenerator.js'\nexport { createPageMetadata } from './createPageMetadata.js'\nexport { readSiteMetaConfig } from './readSiteMetaConfig.js'\nexport type { SiteMetaConfig } from './readSiteMetaConfig.js'\nexport { slugsAcrossLocales } from './slugsAcrossLocales.js'\nexport { buildSitemapEntries } from './buildSitemapEntries.js'\nexport { buildSitemapXml } from './buildSitemapXml.js'\nexport type { SitemapEntry } from './buildSitemapEntries.js'\nexport { buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './buildRobots.js'\nexport type { RobotsRules, RobotsOptions } from './buildRobots.js'\nexport { buildIconsMetadata } from './buildIconsMetadata.js'\nexport { buildOrganizationJsonLd } from './buildOrganizationJsonLd.js'\nexport { validateFaviconField } from './validateFavicon.js'\nexport { buildNoindexField } from './buildNoindexField.js'\nexport { buildSpeakableJsonLd } from './buildSpeakableJsonLd.js'\nexport { buildSummaryField } from './buildSummaryField.js'\nexport { buildWebSiteJsonLd } from './buildWebSiteJsonLd.js'\nexport { buildBreadcrumbJsonLd } from './buildBreadcrumbJsonLd.js'\nexport { buildSiteNavigationJsonLd } from './buildSiteNavigationJsonLd.js'\nexport { buildLocalBusinessJsonLd } from './buildLocalBusinessJsonLd.js'\nexport { buildFaqJsonLd } from './buildFaqJsonLd.js'\nexport { buildServiceJsonLd } from './buildServiceJsonLd.js'\nexport { buildArticleJsonLd } from './buildArticleJsonLd.js'\nexport { buildLlmsTxt } from './buildLlmsTxt.js'\nexport { createLlmsTxtRoute, createSitemapRouteHandler } from './routeHandlers.js'\nexport type { SitemapRouteOptions } from './routeHandlers.js'\nexport { buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './sitemapStyle.js'\nexport type { SitemapStyleOptions } from './sitemapStyle.js'\nexport { createManifestHandler } from './buildManifest.js'\nexport { JsonLdGraph } from './JsonLdGraph.js'\n"],"names":["composeTitle","buildHreflangAlternates","buildMetadata","buildSeoPlugin","buildAutoFillMetaHook","injectAutoFillMeta","injectSeoTabs","createMetadataGenerator","createPageMetadata","readSiteMetaConfig","slugsAcrossLocales","buildSitemapEntries","buildSitemapXml","buildRobots","AI_ASSISTANT_BOTS","AI_TRAINING_BOTS","buildIconsMetadata","buildOrganizationJsonLd","validateFaviconField","buildNoindexField","buildSpeakableJsonLd","buildSummaryField","buildWebSiteJsonLd","buildBreadcrumbJsonLd","buildSiteNavigationJsonLd","buildLocalBusinessJsonLd","buildFaqJsonLd","buildServiceJsonLd","buildArticleJsonLd","buildLlmsTxt","createLlmsTxtRoute","createSitemapRouteHandler","buildSitemapCss","SITEMAP_STYLE_PARAM","DEFAULT_SITEMAP_CREDIT","createManifestHandler","JsonLdGraph"],"mappings":"AACA,SAASA,YAAY,QAAQ,oBAAmB;AAEhD,SAASC,uBAAuB,QAAQ,gBAAe;AACvD,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,qBAAqB,QAAQ,oBAAmB;AACzD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,aAAa,QAAQ,qBAAoB;AAElD,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,eAAe,QAAQ,uBAAsB;AAEtD,SAASC,WAAW,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,mBAAkB;AAEnF,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,oBAAoB,QAAQ,uBAAsB;AAC3D,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,oBAAoB,QAAQ,4BAA2B;AAChE,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,qBAAqB,QAAQ,6BAA4B;AAClE,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,wBAAwB,QAAQ,gCAA+B;AACxE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,YAAY,QAAQ,oBAAmB;AAChD,SAASC,kBAAkB,EAAEC,yBAAyB,QAAQ,qBAAoB;AAElF,SAASC,eAAe,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAQ,oBAAmB;AAEhG,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,WAAW,QAAQ,mBAAkB"}
|
||||
Vendored
+25
-16
@@ -1,6 +1,7 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
import type { I18nConfig } from '../i18n/index.js';
|
||||
import type { SitemapEntry } from './buildSitemapEntries.js';
|
||||
import { type SitemapStyleOptions } from './sitemapStyle.js';
|
||||
/**
|
||||
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
||||
* every project was copying. buildLlmsTxt already handles collections without
|
||||
@@ -31,20 +32,28 @@ export declare function createLlmsTxtRoute(opts: {
|
||||
/** Field holding a richer AI summary (buildSummaryField) to prefer as description. */
|
||||
summaryField?: string;
|
||||
}): () => Promise<Response>;
|
||||
/**
|
||||
* Ready-made Next route handler for /sitemap.xml with the CSS stylesheet.
|
||||
* Replaces the hand-written route in every project. Pass the project's `sitemap`
|
||||
* helper (from createContentHelpers) and optionally a cssUrl.
|
||||
*
|
||||
* // app/sitemap.xml/route.ts
|
||||
* import { createSitemapRouteHandler } from '@intecion/ipal-kit'
|
||||
* import { sitemap } from '@/lib/content'
|
||||
* export const dynamic = 'force-dynamic'
|
||||
* export const GET = createSitemapRouteHandler(sitemap, { cssUrl: '/sitemap.css' })
|
||||
*
|
||||
* Remember: if you use this, DON'T also keep app/sitemap.ts (two sitemaps
|
||||
* confuse crawlers).
|
||||
*/
|
||||
export declare function createSitemapRouteHandler(sitemap: () => Promise<SitemapEntry[]>, opts?: {
|
||||
export type SitemapRouteOptions = {
|
||||
/** Legacy: your own stylesheet URL (e.g. '/sitemap.css'). Overrides `style`. */
|
||||
cssUrl?: string;
|
||||
}): () => Promise<Response>;
|
||||
/**
|
||||
* Built-in browser look (default ON): the XML points at `<this route>?style`
|
||||
* and the same handler serves the CSS — nothing to copy into /public.
|
||||
* `false` = raw XML. Object = header/credit/accent (SitemapStyleOptions);
|
||||
* `title` may be async (sitemapRoute passes the Site Settings name).
|
||||
*/
|
||||
style?: ({
|
||||
title?: (() => Promise<string | undefined>) | string;
|
||||
} & Omit<SitemapStyleOptions, 'title'>) | false;
|
||||
};
|
||||
/**
|
||||
* Ready-made Next route handler for /sitemap.xml, styled for humans out of the box.
|
||||
* Usually you don't call this — `createContentHelpers` returns `sitemapRoute`:
|
||||
*
|
||||
* // app/sitemap.xml/route.ts — the whole file
|
||||
* export { sitemapRoute as GET } from '@/lib/content'
|
||||
* export const dynamic = 'force-dynamic'
|
||||
*
|
||||
* `GET /sitemap.xml` → XML (crawlers), `GET /sitemap.xml?style` → its CSS.
|
||||
* Don't keep app/sitemap.ts next to it — two sitemaps confuse crawlers.
|
||||
*/
|
||||
export declare function createSitemapRouteHandler(sitemap: () => Promise<SitemapEntry[]>, opts?: SitemapRouteOptions): (req: Request) => Promise<Response>;
|
||||
|
||||
Vendored
+32
-11
@@ -1,5 +1,6 @@
|
||||
import { buildLlmsTxt } from './buildLlmsTxt.js';
|
||||
import { buildSitemapXml } from './buildSitemapXml.js';
|
||||
import { buildSitemapCss, SITEMAP_STYLE_PARAM } from './sitemapStyle.js';
|
||||
/**
|
||||
* Ready-made Next route handler for /llms.txt. Replaces the ~60-line try/catch
|
||||
* every project was copying. buildLlmsTxt already handles collections without
|
||||
@@ -49,24 +50,44 @@ import { buildSitemapXml } from './buildSitemapXml.js';
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Ready-made Next route handler for /sitemap.xml with the CSS stylesheet.
|
||||
* Replaces the hand-written route in every project. Pass the project's `sitemap`
|
||||
* helper (from createContentHelpers) and optionally a cssUrl.
|
||||
* Ready-made Next route handler for /sitemap.xml, styled for humans out of the box.
|
||||
* Usually you don't call this — `createContentHelpers` returns `sitemapRoute`:
|
||||
*
|
||||
* // app/sitemap.xml/route.ts
|
||||
* import { createSitemapRouteHandler } from '@intecion/ipal-kit'
|
||||
* import { sitemap } from '@/lib/content'
|
||||
* // app/sitemap.xml/route.ts — the whole file
|
||||
* export { sitemapRoute as GET } from '@/lib/content'
|
||||
* export const dynamic = 'force-dynamic'
|
||||
* export const GET = createSitemapRouteHandler(sitemap, { cssUrl: '/sitemap.css' })
|
||||
*
|
||||
* Remember: if you use this, DON'T also keep app/sitemap.ts (two sitemaps
|
||||
* confuse crawlers).
|
||||
* `GET /sitemap.xml` → XML (crawlers), `GET /sitemap.xml?style` → its CSS.
|
||||
* Don't keep app/sitemap.ts next to it — two sitemaps confuse crawlers.
|
||||
*/ export function createSitemapRouteHandler(sitemap, opts = {}) {
|
||||
return async ()=>{
|
||||
const style = opts.cssUrl ? false : opts.style === false ? false : opts.style ?? {};
|
||||
// `req` is required: Next 16 type-checks the first argument of a route handler
|
||||
// (`Request | undefined` fails the build). A zero-argument call is not supported.
|
||||
return async (req)=>{
|
||||
const url = new URL(req.url);
|
||||
if (style && url.searchParams.has(SITEMAP_STYLE_PARAM)) {
|
||||
let title;
|
||||
try {
|
||||
title = typeof style.title === 'function' ? await style.title() : style.title;
|
||||
} catch {
|
||||
title = undefined; // DB down → generic heading, never a broken stylesheet
|
||||
}
|
||||
return new Response(buildSitemapCss({
|
||||
...style,
|
||||
title
|
||||
}), {
|
||||
headers: {
|
||||
'Cache-Control': 'public, max-age=3600',
|
||||
'Content-Type': 'text/css; charset=utf-8',
|
||||
'X-Robots-Tag': 'noindex'
|
||||
}
|
||||
});
|
||||
}
|
||||
const cssUrl = opts.cssUrl ?? (style ? `${url.pathname}?${SITEMAP_STYLE_PARAM}` : undefined);
|
||||
try {
|
||||
const entries = await sitemap();
|
||||
const xml = buildSitemapXml(entries, {
|
||||
cssUrl: opts.cssUrl
|
||||
cssUrl
|
||||
});
|
||||
return new Response(xml, {
|
||||
headers: {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Built-in look of /sitemap.xml in a browser — served by the sitemap route itself
|
||||
* (`/sitemap.xml?style`), so projects ship NO sitemap.css and copy nothing.
|
||||
* Plain CSS on XML (W3C "Associating Style Sheets with XML", type="text/css") —
|
||||
* not XSLT, which browsers are removing. Crawlers ignore it.
|
||||
*/
|
||||
export type SitemapStyleOptions = {
|
||||
/** Accent colour (card hover). Default '#027bd0'. Any plain CSS colour. */
|
||||
accent?: string;
|
||||
/**
|
||||
* Line under the header — the technology provider. Default
|
||||
* "Technology by Intecion.com". `false` hides it.
|
||||
*/
|
||||
credit?: false | string;
|
||||
/** Header line. Default "XML Sitemap". */
|
||||
title?: string;
|
||||
};
|
||||
/** Query parameter on the sitemap URL that returns the stylesheet instead of XML. */
|
||||
export declare const SITEMAP_STYLE_PARAM = "style";
|
||||
export declare const DEFAULT_SITEMAP_CREDIT = "Technology by Intecion.com";
|
||||
export declare function buildSitemapCss({ accent, credit, title }?: SitemapStyleOptions): string;
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* Built-in look of /sitemap.xml in a browser — served by the sitemap route itself
|
||||
* (`/sitemap.xml?style`), so projects ship NO sitemap.css and copy nothing.
|
||||
* Plain CSS on XML (W3C "Associating Style Sheets with XML", type="text/css") —
|
||||
* not XSLT, which browsers are removing. Crawlers ignore it.
|
||||
*/ /** Query parameter on the sitemap URL that returns the stylesheet instead of XML. */ export const SITEMAP_STYLE_PARAM = 'style';
|
||||
export const DEFAULT_SITEMAP_CREDIT = 'Technology by Intecion.com';
|
||||
/** CSS `content: "…"` value — escapes backslashes, quotes and newlines. */ const cssString = (s)=>`"${s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/[\r\n]+/g, ' ')}"`;
|
||||
/** Only plain colour values — the option ends up inside a stylesheet. */ const safeColor = (c, fallback)=>c && /^(?:#[0-9a-f]{3,8}|[a-z]+|(?:rgb|hsl|oklch)a?\([\d\s.,%/-]+\))$/i.test(c.trim()) ? c.trim() : fallback;
|
||||
export function buildSitemapCss({ accent, credit, title } = {}) {
|
||||
const heading = title?.trim() || 'XML Sitemap';
|
||||
const note = credit === false ? '' : (credit ?? DEFAULT_SITEMAP_CREDIT).trim();
|
||||
const acc = safeColor(accent, '#027bd0');
|
||||
const divider = 'padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border);';
|
||||
return `:root {
|
||||
--bg: #fafafa; --card: #ffffff; --border: #e5e7eb; --border-hover: #d1d5db;
|
||||
--text-main: #111827; --text-secondary: #4b5563; --text-muted: #9ca3af; --url-color: #1e293b;
|
||||
--badge-bg: #f3f4f6; --badge-border: #e5e7eb; --badge-text: #4b5563; --accent: ${acc};
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #090a0f; --card: #12131a; --border: #1e202e; --border-hover: #2e3247;
|
||||
--text-main: #f9fafb; --text-secondary: #9ca3af; --text-muted: #6b7280; --url-color: #f3f4f6;
|
||||
--badge-bg: #1a1c26; --badge-border: #282b3d; --badge-text: #9ca3af;
|
||||
}
|
||||
}
|
||||
urlset {
|
||||
display: flex; flex-direction: column; box-sizing: border-box; min-height: 100vh;
|
||||
max-width: 1040px; margin: 0 auto; padding: 3rem 1.5rem; line-height: 1.5;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
|
||||
background-color: var(--bg); color: var(--text-main);
|
||||
}
|
||||
urlset::before {
|
||||
content: ${cssString(heading)};
|
||||
display: block; order: -2; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em;
|
||||
color: var(--text-main); ${note ? 'padding-bottom: 0.4rem;' : divider}
|
||||
}
|
||||
${note ? `urlset::after {
|
||||
content: ${cssString(note)};
|
||||
display: block; order: -1; font-size: 0.8rem; color: var(--text-muted); ${divider}
|
||||
}
|
||||
` : ''}url {
|
||||
display: block; width: 100%; order: 0; box-sizing: border-box;
|
||||
background-color: var(--card); border: 1px solid var(--border); border-radius: 8px;
|
||||
padding: 1rem 1.25rem; margin-bottom: 0.65rem;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
url:hover { border-color: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03); }
|
||||
loc {
|
||||
display: block; margin-bottom: 0.45rem; word-break: break-all; line-height: 1.45;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
||||
font-size: 0.875rem; font-weight: 500; color: var(--url-color);
|
||||
}
|
||||
lastmod, changefreq, priority {
|
||||
display: inline-block; font-size: 0.775rem; color: var(--text-secondary);
|
||||
margin-right: 1.25rem; margin-top: 0.15rem;
|
||||
}
|
||||
lastmod::before { content: "Updated: "; color: var(--text-muted); }
|
||||
changefreq::before { content: "Frequency: "; color: var(--text-muted); }
|
||||
priority::before { content: "Priority: "; color: var(--text-muted); }
|
||||
link {
|
||||
display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
|
||||
background-color: var(--badge-bg); border: 1px solid var(--badge-border); color: var(--badge-text);
|
||||
padding: 0.1rem 0.45rem; border-radius: 4px; margin-right: 0.3rem; margin-top: 0.35rem;
|
||||
}
|
||||
link::before { content: attr(hreflang); }
|
||||
`;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=sitemapStyle.js.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
export type RateLimitArgs = {
|
||||
/** Identifier to limit on — typically the client IP. */
|
||||
key: string;
|
||||
/** Max submissions allowed per window. Defaults to 5. */
|
||||
max?: number;
|
||||
/** Separate counter space per feature, e.g. 'form', 'search', 'mcp'. Default 'form'. */
|
||||
scope?: string;
|
||||
/** Window length in ms. Defaults to 60_000 (one minute). */
|
||||
windowMs?: number;
|
||||
};
|
||||
/**
|
||||
* Returns true when the request is within the limit, false when it should be
|
||||
* rejected. A missing key (no IP) is allowed through — better to accept a
|
||||
* submission than to block everyone behind a proxy that strips the header.
|
||||
*/
|
||||
export declare function checkRateLimit({ cost, key, max, scope, windowMs }: {
|
||||
cost?: number;
|
||||
} & RateLimitArgs): boolean;
|
||||
/** Seconds until the key's window resets — for a Retry-After header. */
|
||||
export declare function retryAfterSeconds(key: string, scope?: string): number;
|
||||
/**
|
||||
* Client IP from a Request. Cloudflare's `cf-connecting-ip` first (set by the
|
||||
* edge, the real visitor), then the first `x-forwarded-for` hop, then
|
||||
* `x-real-ip`. Empty string when none — the limiter then lets the request through.
|
||||
*/
|
||||
export declare function clientIp(req: Request): string;
|
||||
/** Standard 429 for route handlers. */
|
||||
export declare function tooManyRequests(key: string, scope: string, body: unknown): Response;
|
||||
Vendored
+78
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Per-key fixed window, in memory. Shared by submitForm, createSearchRoute and
|
||||
* createMcpRoute — each uses its own `scope`, so a busy search box never eats
|
||||
* into the contact form's budget.
|
||||
*
|
||||
* Deliberately simple: no Redis, no dependency. The trade-off is that the
|
||||
* counter lives in one process — with several instances behind a load balancer
|
||||
* each keeps its own, so the effective limit is per-instance, not global. For a
|
||||
* contact form that's fine (it raises the cost of flooding without pretending
|
||||
* to be airtight); a high-security form should put a real limiter in front.
|
||||
*
|
||||
* State is module-level, so it survives between requests but resets on redeploy
|
||||
* — acceptable for abuse throttling.
|
||||
*/ const buckets = new Map();
|
||||
/** Sweep expired buckets occasionally so the map doesn't grow unbounded. */ let lastSweep = Date.now();
|
||||
const SWEEP_INTERVAL = 60_000;
|
||||
function sweep(now) {
|
||||
if (now - lastSweep < SWEEP_INTERVAL) {
|
||||
return;
|
||||
}
|
||||
lastSweep = now;
|
||||
for (const [key, bucket] of buckets){
|
||||
if (bucket.resetAt <= now) {
|
||||
buckets.delete(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns true when the request is within the limit, false when it should be
|
||||
* rejected. A missing key (no IP) is allowed through — better to accept a
|
||||
* submission than to block everyone behind a proxy that strips the header.
|
||||
*/ export function checkRateLimit({ cost = 1, key, max = 5, scope = 'form', windowMs = 60_000 }) {
|
||||
if (!key) {
|
||||
return true;
|
||||
}
|
||||
const now = Date.now();
|
||||
sweep(now);
|
||||
const id = `${scope}:${key}`;
|
||||
const bucket = buckets.get(id);
|
||||
if (!bucket || bucket.resetAt <= now) {
|
||||
if (cost > max) {
|
||||
return false;
|
||||
}
|
||||
buckets.set(id, {
|
||||
count: cost,
|
||||
resetAt: now + windowMs
|
||||
});
|
||||
return true;
|
||||
}
|
||||
if (bucket.count + cost > max) {
|
||||
return false;
|
||||
}
|
||||
bucket.count += cost;
|
||||
return true;
|
||||
}
|
||||
/** Seconds until the key's window resets — for a Retry-After header. */ export function retryAfterSeconds(key, scope = 'form') {
|
||||
const bucket = buckets.get(`${scope}:${key}`);
|
||||
return bucket ? Math.max(1, Math.ceil((bucket.resetAt - Date.now()) / 1000)) : 1;
|
||||
}
|
||||
/**
|
||||
* Client IP from a Request. Cloudflare's `cf-connecting-ip` first (set by the
|
||||
* edge, the real visitor), then the first `x-forwarded-for` hop, then
|
||||
* `x-real-ip`. Empty string when none — the limiter then lets the request through.
|
||||
*/ export function clientIp(req) {
|
||||
const h = req.headers;
|
||||
return h.get('cf-connecting-ip')?.trim() || h.get('x-forwarded-for')?.split(',')[0]?.trim() || h.get('x-real-ip')?.trim() || '';
|
||||
}
|
||||
/** Standard 429 for route handlers. */ export function tooManyRequests(key, scope, body) {
|
||||
return Response.json(body, {
|
||||
headers: {
|
||||
'cache-control': 'no-store',
|
||||
'retry-after': String(retryAfterSeconds(key, scope))
|
||||
},
|
||||
status: 429
|
||||
});
|
||||
}
|
||||
|
||||
//# sourceMappingURL=rateLimit.js.map
|
||||
Vendored
+1
File diff suppressed because one or more lines are too long
+5
-1
@@ -45,8 +45,12 @@
|
||||
// (media.klient.pl → bucket) set R2_PUBLIC_URL so Payload generates URLs
|
||||
// pointing there. Without it, uploads work but images don't display publicly.
|
||||
// See docs/storage.md.
|
||||
const publicUrl = process.env.R2_PUBLIC_URL?.replace(/\/$/, '') // strip trailing slash
|
||||
// Site-relative value ('/media', dev only — ipalEnvRules rejects it in production)
|
||||
// → prefixed with NEXT_PUBLIC_SERVER_URL so Payload still stores absolute URLs.
|
||||
const rawPublicUrl = process.env.R2_PUBLIC_URL?.trim().replace(/\/$/, '') // strip trailing slash
|
||||
;
|
||||
const serverUrl = process.env.NEXT_PUBLIC_SERVER_URL?.trim().replace(/\/$/, '');
|
||||
const publicUrl = rawPublicUrl?.startsWith('/') && serverUrl ? `${serverUrl}${rawPublicUrl}` : rawPublicUrl;
|
||||
// generateFileURL is a PER-COLLECTION option in @payloadcms/storage-s3 (not a
|
||||
// top-level one) — R2 needs it to point served URLs at the custom domain
|
||||
// instead of the private S3 endpoint. Each collection gets either `true`
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-1
@@ -1,2 +1,3 @@
|
||||
export { TurnstileProvider, useTurnstile } from './TurnstileProvider.js';
|
||||
export { verifyTurnstile } from './verify.js';
|
||||
export { checkTurnstile, verifyTurnstile } from './verify.js';
|
||||
export type { TurnstileCheck, TurnstileOutcome } from './verify.js';
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
export { TurnstileProvider, useTurnstile } from './TurnstileProvider.js';
|
||||
// Server-only exports. verify.ts imports 'server-only', so this must never be
|
||||
// imported from a client component — use ./client for the widget instead.
|
||||
export { verifyTurnstile } from './verify.js';
|
||||
export { checkTurnstile, verifyTurnstile } from './verify.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/turnstile/index.ts"],"sourcesContent":["export { TurnstileProvider, useTurnstile } from './TurnstileProvider.js'\n// Server-only exports. verify.ts imports 'server-only', so this must never be\n// imported from a client component — use ./client for the widget instead.\nexport { verifyTurnstile } from './verify.js'\n"],"names":["TurnstileProvider","useTurnstile","verifyTurnstile"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,yBAAwB;AACxE,8EAA8E;AAC9E,0EAA0E;AAC1E,SAASC,eAAe,QAAQ,cAAa"}
|
||||
{"version":3,"sources":["../../../src/modules/turnstile/index.ts"],"sourcesContent":["export { TurnstileProvider, useTurnstile } from './TurnstileProvider.js'\n// Server-only exports. verify.ts imports 'server-only', so this must never be\n// imported from a client component — use ./client for the widget instead.\nexport { checkTurnstile, verifyTurnstile } from './verify.js'\nexport type { TurnstileCheck, TurnstileOutcome } from './verify.js'\n"],"names":["TurnstileProvider","useTurnstile","checkTurnstile","verifyTurnstile"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,YAAY,QAAQ,yBAAwB;AACxE,8EAA8E;AAC9E,0EAA0E;AAC1E,SAASC,cAAc,EAAEC,eAAe,QAAQ,cAAa"}
|
||||
Vendored
+38
-11
@@ -1,23 +1,50 @@
|
||||
import 'server-only';
|
||||
import type { BasePayload } from 'payload';
|
||||
type VerifyTurnstileArgs = {
|
||||
/** Optional client IP for stricter verification. */
|
||||
/** Client IP. Sent to Cloudflare only with `sendRemoteIp: true`. */
|
||||
ip?: string;
|
||||
/**
|
||||
* What to do when verification can't run because of OUR side (missing/wrong
|
||||
* secret, Cloudflare unreachable). 'allow' (default): accept the submission —
|
||||
* rate limit, honeypot and validation still apply — and show the problem in
|
||||
* the panel. 'reject': refuse (fail closed).
|
||||
*/
|
||||
onConfigError?: 'allow' | 'reject';
|
||||
/** Payload instance — used to read the secret from SiteIntegrations. */
|
||||
payload: BasePayload;
|
||||
/**
|
||||
* Send `remoteip` to Cloudflare. Default false: behind Cloudflare / Traefik /
|
||||
* Docker the IP the app sees can differ from the one that solved the challenge
|
||||
* (IPv6 on mobile vs IPv4 at the proxy), and Cloudflare's check doesn't need it.
|
||||
*/
|
||||
sendRemoteIp?: boolean;
|
||||
/** Token produced by the client-side widget. */
|
||||
token: string;
|
||||
};
|
||||
/**
|
||||
* Verifies a Turnstile token with Cloudflare, server-side only.
|
||||
*
|
||||
* The secret comes from the SiteIntegrations global (editor-managed, per the
|
||||
* plugin's "secrets in the panel" model), read via the Local API which bypasses
|
||||
* access control. `server-only` guarantees this never reaches the browser
|
||||
* bundle, keeping the secret off the client.
|
||||
*
|
||||
* Returns false on any failure (missing secret/token, network error, rejected
|
||||
* challenge) — callers treat false as "do not trust this submission".
|
||||
* - `pass` — token valid.
|
||||
* - `reject` — the VISITOR's token is bad (forged, reused, expired, malformed) → refuse.
|
||||
* - `degraded` — OUR side is broken (no/wrong secret, Cloudflare unreachable or
|
||||
* erroring) → the visitor can't fix it; by default the submission
|
||||
* is accepted and the panel shows the problem.
|
||||
*/
|
||||
export declare function verifyTurnstile({ ip, payload, token, }: VerifyTurnstileArgs): Promise<boolean>;
|
||||
export type TurnstileOutcome = 'degraded' | 'pass' | 'reject';
|
||||
export type TurnstileCheck = {
|
||||
code?: string;
|
||||
outcome: TurnstileOutcome;
|
||||
};
|
||||
/**
|
||||
* Verifies a Turnstile token with Cloudflare and classifies the result (server-only).
|
||||
*
|
||||
* Secret: SiteIntegrations → Turnstile (panel) first, then TURNSTILE_SECRET_KEY.
|
||||
* Every result is logged when not `pass`, and the integration status on
|
||||
* SiteIntegrations is updated (throttled) so the panel shows failures.
|
||||
*/
|
||||
export declare function checkTurnstile({ ip, payload, sendRemoteIp, token, }: Omit<VerifyTurnstileArgs, 'onConfigError'>): Promise<TurnstileCheck>;
|
||||
/**
|
||||
* Boolean wrapper used by submitForm. `onConfigError` decides what a `degraded`
|
||||
* result means: 'allow' (default) keeps the site's forms working while the
|
||||
* panel shows the problem; 'reject' fails closed.
|
||||
*/
|
||||
export declare function verifyTurnstile({ onConfigError, ...args }: VerifyTurnstileArgs): Promise<boolean>;
|
||||
export {};
|
||||
|
||||
Vendored
+79
-18
@@ -1,41 +1,102 @@
|
||||
import 'server-only';
|
||||
import { recordIntegrationStatus } from '../integrations/status.js';
|
||||
import { getSiteIntegrations } from '../payload/index.js';
|
||||
/** Env fallback for the secret — same name ipalEnvRules({ turnstile: true }) requires. */ const ENV_SECRET = 'TURNSTILE_SECRET_KEY';
|
||||
const STATUS_FIELD = 'turnstileStatus';
|
||||
/** Cloudflare error codes caused by our configuration / Cloudflare itself — not by the visitor. */ const CONFIG_ERRORS = {
|
||||
'internal-error': 'Cloudflare reported an internal error while verifying.',
|
||||
'invalid-input-secret': 'Cloudflare rejected the secret key — check Site Integrations → Turnstile (secret and site key must come from the same widget).',
|
||||
'missing-input-secret': 'The secret key is missing in the request.'
|
||||
};
|
||||
const PLUGIN_ERRORS = {
|
||||
'bad-response': 'Cloudflare returned an unexpected response.',
|
||||
'missing-secret': `No secret key — fill in Site Integrations → Turnstile (or the ${ENV_SECRET} environment variable).`,
|
||||
'network-error': 'The server could not reach Cloudflare (challenges.cloudflare.com).'
|
||||
};
|
||||
/**
|
||||
* Verifies a Turnstile token with Cloudflare, server-side only.
|
||||
* Verifies a Turnstile token with Cloudflare and classifies the result (server-only).
|
||||
*
|
||||
* The secret comes from the SiteIntegrations global (editor-managed, per the
|
||||
* plugin's "secrets in the panel" model), read via the Local API which bypasses
|
||||
* access control. `server-only` guarantees this never reaches the browser
|
||||
* bundle, keeping the secret off the client.
|
||||
*
|
||||
* Returns false on any failure (missing secret/token, network error, rejected
|
||||
* challenge) — callers treat false as "do not trust this submission".
|
||||
*/ export async function verifyTurnstile({ ip, payload, token }) {
|
||||
* Secret: SiteIntegrations → Turnstile (panel) first, then TURNSTILE_SECRET_KEY.
|
||||
* Every result is logged when not `pass`, and the integration status on
|
||||
* SiteIntegrations is updated (throttled) so the panel shows failures.
|
||||
*/ export async function checkTurnstile({ ip, payload, sendRemoteIp = false, token }) {
|
||||
if (!token) {
|
||||
return false;
|
||||
return {
|
||||
code: 'missing-input-response',
|
||||
outcome: 'reject'
|
||||
};
|
||||
}
|
||||
const integrations = await getSiteIntegrations(payload);
|
||||
const secret = integrations.turnstileSecretKey;
|
||||
const previous = integrations[STATUS_FIELD];
|
||||
const secret = integrations.turnstileSecretKey?.trim() || process.env[ENV_SECRET]?.trim();
|
||||
const degraded = async (code)=>{
|
||||
const message = PLUGIN_ERRORS[code] ?? CONFIG_ERRORS[code] ?? `Cloudflare error: ${code}`;
|
||||
console.warn(`[ipal] Turnstile degraded (${code}): ${message}`);
|
||||
await recordIntegrationStatus(payload, STATUS_FIELD, previous, {
|
||||
code,
|
||||
message,
|
||||
state: 'degraded'
|
||||
});
|
||||
return {
|
||||
code,
|
||||
outcome: 'degraded'
|
||||
};
|
||||
};
|
||||
if (!secret) {
|
||||
return false;
|
||||
return degraded('missing-secret');
|
||||
}
|
||||
const body = new URLSearchParams({
|
||||
response: token,
|
||||
secret
|
||||
});
|
||||
if (ip) {
|
||||
if (sendRemoteIp && ip) {
|
||||
body.append('remoteip', ip);
|
||||
}
|
||||
let data;
|
||||
try {
|
||||
const res = await fetch('https://challenges.cloudflare.com/turnstile/v0/siteverify', {
|
||||
body,
|
||||
method: 'POST'
|
||||
method: 'POST',
|
||||
signal: AbortSignal.timeout(8000)
|
||||
});
|
||||
const data = await res.json();
|
||||
return data.success;
|
||||
} catch {
|
||||
return false;
|
||||
if (res.status >= 500) {
|
||||
return degraded('internal-error');
|
||||
}
|
||||
data = await res.json();
|
||||
} catch (err) {
|
||||
console.warn('[ipal] Turnstile: siteverify request failed:', err instanceof Error ? err.message : err);
|
||||
return degraded('network-error');
|
||||
}
|
||||
if (typeof data?.success !== 'boolean') {
|
||||
return degraded('bad-response');
|
||||
}
|
||||
if (data.success) {
|
||||
await recordIntegrationStatus(payload, STATUS_FIELD, previous, {
|
||||
state: 'ok'
|
||||
});
|
||||
return {
|
||||
outcome: 'pass'
|
||||
};
|
||||
}
|
||||
const codes = data['error-codes'] ?? [];
|
||||
const configCode = codes.find((c)=>c in CONFIG_ERRORS);
|
||||
if (configCode) {
|
||||
return degraded(configCode);
|
||||
}
|
||||
// Visitor-side: invalid-input-response, timeout-or-duplicate, missing-input-response, bad-request.
|
||||
console.warn(`[ipal] Turnstile rejected: ${codes.join(', ') || 'unknown'}${data.hostname ? ` (hostname ${data.hostname})` : ''}`);
|
||||
return {
|
||||
code: codes[0] ?? 'unknown',
|
||||
outcome: 'reject'
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Boolean wrapper used by submitForm. `onConfigError` decides what a `degraded`
|
||||
* result means: 'allow' (default) keeps the site's forms working while the
|
||||
* panel shows the problem; 'reject' fails closed.
|
||||
*/ export async function verifyTurnstile({ onConfigError = 'allow', ...args }) {
|
||||
const { outcome } = await checkTurnstile(args);
|
||||
return outcome === 'pass' || outcome === 'degraded' && onConfigError === 'allow';
|
||||
}
|
||||
|
||||
//# sourceMappingURL=verify.js.map
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+17
@@ -225,6 +225,23 @@ import { buildSeoPlugin, injectAutoFillMeta, injectSeoTabs } from './modules/seo
|
||||
...config.endpoints ?? [],
|
||||
testEmailEndpoint
|
||||
];
|
||||
// --- integration alerts on the dashboard (Turnstile status, …) ---
|
||||
// Renders nothing while everything works; never throws.
|
||||
config.admin = {
|
||||
...config.admin ?? {},
|
||||
components: {
|
||||
...config.admin?.components ?? {},
|
||||
beforeDashboard: [
|
||||
...config.admin?.components?.beforeDashboard ?? [],
|
||||
{
|
||||
path: '@intecion/ipal-kit/admin#IntegrationAlerts',
|
||||
serverProps: {
|
||||
adminRoute: options.adminRoute ?? '/admin'
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
// --- hooks: onInit ---
|
||||
const incomingOnInit = config.onInit;
|
||||
config.onInit = async (payload)=>{
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* @intecion/ipal-kit/fluid.css — fluid type & spacing scale (variables only, no classes).
|
||||
* Scales smoothly from a 360px to a 1280px viewport; rem-based, so browser zoom and
|
||||
* user font size still work (WCAG 1.4.4). Opt-in:
|
||||
*
|
||||
* @import "tailwindcss";
|
||||
* @import "@intecion/ipal-kit/fluid.css";
|
||||
* @theme inline {
|
||||
* --text-display: var(--ipal-fs-display);
|
||||
* --text-h1: var(--ipal-fs-h1);
|
||||
* --text-h2: var(--ipal-fs-h2);
|
||||
* --text-h3: var(--ipal-fs-h3);
|
||||
* --text-lead: var(--ipal-fs-lg);
|
||||
* --spacing-section: var(--ipal-space-section);
|
||||
* --spacing-gutter: var(--ipal-space-gutter);
|
||||
* --spacing-gap: var(--ipal-space-gap);
|
||||
* }
|
||||
* → text-h1, text-display, py-section, px-gutter, gap-gap
|
||||
*
|
||||
* The design (DESIGN.md) decides the numbers: override any variable in the project's
|
||||
* :root — the plugin only removes the clamp() maths from every project.
|
||||
*/
|
||||
:root {
|
||||
--ipal-fs-sm: clamp(0.875rem, 0.8505rem + 0.1087vw, 0.9375rem); /* 0.875→0.9375rem · small print, captions */
|
||||
--ipal-fs-base: clamp(1rem, 0.9511rem + 0.2174vw, 1.125rem); /* 1→1.125rem · body text */
|
||||
--ipal-fs-lg: clamp(1.125rem, 1.0272rem + 0.4348vw, 1.375rem); /* 1.125→1.375rem · lead / intro */
|
||||
--ipal-fs-h3: clamp(1.25rem, 1.0543rem + 0.8696vw, 1.75rem); /* 1.25→1.75rem · h3 */
|
||||
--ipal-fs-h2: clamp(1.5rem, 1.1087rem + 1.7391vw, 2.5rem); /* 1.5→2.5rem · h2 — section headings */
|
||||
--ipal-fs-h1: clamp(2rem, 1.413rem + 2.6087vw, 3.5rem); /* 2→3.5rem · h1 — page heading */
|
||||
--ipal-fs-display: clamp(2.5rem, 1.7174rem + 3.4783vw, 4.5rem); /* 2.5→4.5rem · hero / display */
|
||||
--ipal-space-gap: clamp(1rem, 0.6087rem + 1.7391vw, 2rem); /* 1→2rem · gap between items in a section */
|
||||
--ipal-space-gutter: clamp(1rem, 0.413rem + 2.6087vw, 2.5rem); /* 1→2.5rem · container side padding */
|
||||
--ipal-space-section: clamp(3rem, 1.2391rem + 7.8261vw, 7.5rem); /* 3→7.5rem · vertical padding of a section */
|
||||
}
|
||||
+10
-5
@@ -165,9 +165,10 @@ src/
|
||||
[[...slug]]/page.tsx # PODWÓJNE nawiasy; RenderBlocks
|
||||
(payload)/ # panel (generowany)
|
||||
manifest.ts # createManifestHandler + force-dynamic
|
||||
sitemap.ts, robots.ts # z lib/content (+ force-dynamic na sitemap)
|
||||
sitemap.xml/route.ts # sitemapRoute z lib/content + force-dynamic (wygląd z pluginu)
|
||||
robots.ts # z lib/content
|
||||
api/health/route.ts # createHealthRoute
|
||||
instrumentation.ts # assertEnv(ipalEnvRules({...}))
|
||||
instrumentation.ts # assertEnv(ipalEnvRules({...})) z '@intecion/ipal-kit/env'
|
||||
fields/ # sectionHeader.ts, sectionSettings.ts (linki: z pluginu)
|
||||
components/
|
||||
ui/ # prymitywy: CMSLink, Button, Media, Section, SectionHeader
|
||||
@@ -218,9 +219,9 @@ Bez skrótów (`HeroSection`, nie `HeroSec`). Nie twórz `lib/pages.ts`,
|
||||
Locale do bloków → `enhanceProps`; w `not-found.tsx` (brak `params`) →
|
||||
wersja na każdy język + `<LocaleView>` (pages.md).
|
||||
7. **`export const dynamic = 'force-dynamic'`** na trasach czytających bazę:
|
||||
`manifest.ts`, `sitemap.ts`/`sitemap.xml`, `llms.txt`, `api/health`. Handlery
|
||||
`manifest.ts`, `sitemap.xml/route.ts`, `llms.txt`, `api/health`. Handlery
|
||||
pluginu mają try/catch, ale `dynamic` musi być w pliku trasy.
|
||||
8. **`instrumentation.ts`** z `assertEnv(ipalEnvRules({...}))` (env.md).
|
||||
8. **`instrumentation.ts`** z `assertEnv(ipalEnvRules({...}))` importowanym z **`@intecion/ipal-kit/env`** (root ciągnie Payload → crash Edge/Turbopack), w `if (process.env.NEXT_RUNTIME === 'nodejs')` (env.md).
|
||||
9. **RSC domyślnie.** `'use client'` tylko dla stanu/interakcji, w osobnym pliku;
|
||||
sekcja zostaje serwerowa i podaje mu dane. Sekrety: `import 'server-only'`.
|
||||
10. **Bloki nie importują `lib/*`** (cykl). Dane server-side → `enhanceProps`.
|
||||
@@ -534,6 +535,10 @@ bloku nie importował Reacta). Kod: [kod-sekcji.md](./skills/ipal-block/resource
|
||||
ze źródła `DESIGN.md`. W komponentach tylko tokeny (`bg-primary`), **nigdy**
|
||||
`bg-[#ff6600]` ani hex.
|
||||
- Tokeny pluginu mapuj na projekt: `--ipal-primary: var(--color-primary)`.
|
||||
- Płynna typografia i odstępy: `@import "@intecion/ipal-kit/fluid.css"` + mapowanie w
|
||||
`@theme` (`text-h1`, `py-section`, `px-gutter` — PROGRAMISTA §2.5). Nie pisz `clamp()`
|
||||
w komponentach; inne wartości z `DESIGN.md` → nadpisz zmienne `--ipal-*` w `:root`.
|
||||
- JSON-LD tylko przez `<JsonLdGraph>` z `/rsc` — nigdy własny `<script dangerouslySetInnerHTML>`.
|
||||
- Fonty przez `next/font`, podpięte zmienną CSS do `@theme`.
|
||||
- Bez CSS Modules i `style={{…}}` — wyjątek: wartość dynamiczna z danych.
|
||||
- Warianty → `Record<Variant, string>`, nie łańcuchy ternary.
|
||||
@@ -580,7 +585,7 @@ Przykładowy `styles.css`: [kod-sekcji.md](./skills/ipal-block/resources/kod-sek
|
||||
| Nagłówki, CSP, 2FA | `buildSecurityHeaders`, `buildCsp`, `twoFactor` (wstrzyknięty `payloadTotp`) | security.md |
|
||||
| Media, R2 | `buildR2Storage(['media'], { s3Storage })` (adapter wstrzyknięty), `normalizeFilenameHook`, `buildOptimizeUploadHook` + `buildOptimizeUploadField`, `MediaPreconnect` | storage.md |
|
||||
| Email | `email: mailAdapter()` | email.md |
|
||||
| Walidacja env | `assertEnv(ipalEnvRules({...}))` | env.md |
|
||||
| Walidacja env | `assertEnv(ipalEnvRules({...}))` z `@intecion/ipal-kit/env` | env.md |
|
||||
|
||||
**Compliance (PL/EU) — mechanizm z pluginu, treść od klienta:** strony polityk
|
||||
jako System Pages, `CookieBanner` + `CookieButton`, checkbox `consent` w
|
||||
|
||||
@@ -55,6 +55,15 @@ if [ -d .agents ] && [ -f tsconfig.json ]; then
|
||||
"$(grep -qE '"exclude"[^]]*\.agents' tsconfig.json || echo tsconfig.json)"
|
||||
fi
|
||||
|
||||
# --- Sitemap: one route, look from the plugin (seo.md) ---
|
||||
SM_TS=$(ls src/app/sitemap.ts 2>/dev/null)
|
||||
SM_ROUTE=$(ls src/app/sitemap.xml/route.ts 2>/dev/null)
|
||||
if [ -n "$SM_TS" ] && [ -n "$SM_ROUTE" ]; then
|
||||
report ERROR "two sitemaps" "seo.md — keep src/app/sitemap.xml/route.ts (sitemapRoute), delete src/app/sitemap.ts" "$(printf '%s\n%s' "$SM_TS" "$SM_ROUTE")"
|
||||
fi
|
||||
report WARNING "project copy of the sitemap stylesheet" "seo.md — sitemapRoute serves the look from the plugin; delete it (and cssUrl)" \
|
||||
"$(ls public/sitemap.css 2>/dev/null)"
|
||||
|
||||
# --- Architecture (AGENT.md §4) ---
|
||||
report ERROR "middleware.ts exists" "§4.1 Next 16 uses proxy.ts only" \
|
||||
"$(ls src/middleware.ts middleware.ts 2>/dev/null)"
|
||||
@@ -158,7 +167,13 @@ report WARNING "files that usually duplicate the plugin" "§3 plugin has resolve
|
||||
report ERROR "project copy of link fields" "links.md — use buildLinkField / buildLinksField / resolveLinkHref from the plugin" \
|
||||
"$(ls src/fields/link.ts src/lib/links.ts 2>/dev/null; g "from '@/fields/link'|from '@/lib/links'" src --include=*.ts --include=*.tsx)"
|
||||
report ERROR "manual Lexical rendering" "§7 use RenderRichText" \
|
||||
"$(g 'node\.type *===|dangerouslySetInnerHTML' src --include=*.tsx)"
|
||||
"$(g 'node\.type *===' src --include=*.tsx | nc 'node')"
|
||||
HTML=$(node "$(dirname "$0")/html-check.mjs" src)
|
||||
while IFS= read -r rule; do
|
||||
[ -z "$rule" ] && continue
|
||||
level=${rule%%|*}; title=${rule#*|}
|
||||
report "$level" "$title" "§7 / seo.md" "$(printf '%s\n' "$HTML" | grep -F "$rule|" | cut -d'|' -f3-)"
|
||||
done <<< "$(printf '%s\n' "$HTML" | cut -d'|' -f1-2 | sort -u)"
|
||||
|
||||
# --- Compile & build ---
|
||||
if [ "$QUICK" -eq 0 ]; then
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env node
|
||||
// Raw HTML in JSX (dangerouslySetInnerHTML), classified — prints "LEVEL|rule|file:line", exit 0.
|
||||
// node html-check.mjs src
|
||||
// - inline JSON-LD (<script type="application/ld+json">) without '<' escaping → ERROR (XSS:
|
||||
// a "</script>" typed in the panel breaks out of the tag) → JsonLdGraph from /rsc
|
||||
// - inline JSON-LD with escaping → WARNING (works; JsonLdGraph is the shared version)
|
||||
// - anything else → WARNING (rich text → RenderRichText; other HTML must be sanitized)
|
||||
import { readFileSync, readdirSync, statSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
|
||||
const files = []
|
||||
const walk = (p) => {
|
||||
let st
|
||||
try { st = statSync(p) } catch { return }
|
||||
if (st.isDirectory()) { if (!/node_modules|\.next/.test(p)) for (const n of readdirSync(p)) walk(join(p, n)) }
|
||||
else if (/\.(tsx|jsx)$/.test(p)) files.push(p)
|
||||
}
|
||||
process.argv.slice(2).forEach(walk)
|
||||
|
||||
for (const file of files) {
|
||||
// blank out comments (keeps offsets/line numbers)
|
||||
const src = readFileSync(file, 'utf8')
|
||||
.replace(/\/\*[\s\S]*?\*\//g, (c) => c.replace(/[^\n]/g, ' '))
|
||||
.replace(/(^|[^:'"`])\/\/.*$/gm, (c, p) => p + ' '.repeat(c.length - p.length))
|
||||
for (const m of src.matchAll(/dangerouslySetInnerHTML/g)) {
|
||||
// the element this prop belongs to: from its opening "<tag" to the end of the prop's {{ … }}
|
||||
const open = src.lastIndexOf('<', m.index)
|
||||
const close = src.indexOf('}}', m.index)
|
||||
const el = src.slice(open, close < 0 ? m.index + 400 : close + 2)
|
||||
const at = `${file}:${src.slice(0, m.index).split('\n').length}`
|
||||
if (/^<script\b/.test(el) && /application\/ld\+json/.test(el)) {
|
||||
if (/u003c|replace\(\/</.test(el)) console.log(`WARNING|inline JSON-LD — use <JsonLdGraph schemas={[…]}/> from @intecion/ipal-kit/rsc (seo.md)|${at}`)
|
||||
else console.log(`ERROR|unescaped JSON-LD in <script> — XSS via "</script>" in panel text; use <JsonLdGraph/> from @intecion/ipal-kit/rsc|${at}`)
|
||||
} else {
|
||||
console.log(`WARNING|raw HTML (dangerouslySetInnerHTML) — rich text → RenderRichText; other HTML must be sanitized|${at}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,8 @@ tej procedury. Pytasz tylko, gdy brakuje czegoś, czego nie możesz uzyskać sam
|
||||
| build pada `ENOTFOUND` / Mongoose | trasa czyta bazę w buildzie bez bazy | sitemap/robots/llms: `export const dynamic = 'force-dynamic'` (tylko one) |
|
||||
| `slug.join is not a function` | `[slug]` zamiast `[[...slug]]` | zmień nazwę folderu |
|
||||
| `Missing <html> and <body>` | layout `[locale]` bez `<html>` po usunięciu root layoutu | `<html lang>` i `<body>` w `[locale]/layout.tsx` |
|
||||
| `Export fileTypeFromFile doesn't exist in target module` (Turbopack, start dev) | `instrumentation.ts` importuje z roota pakietu → Payload w bundlu Edge | import z `@intecion/ipal-kit/env` + `NEXT_RUNTIME === 'nodejs'` (env.md) |
|
||||
| `R2_PUBLIC_URL must be a valid URL (got "/media")` | stara wersja reguły / produkcja ze ścieżką względną | dev: `/media` dozwolone od nowej wersji; produkcja: pełny URL domeny bucketu |
|
||||
| `server-only` w kliencie | import z `@intecion/ipal-kit/server` w `'use client'` | wywołuj przez server action |
|
||||
|
||||
### Panel (`/admin`)
|
||||
@@ -76,7 +78,7 @@ tej procedury. Pytasz tylko, gdy brakuje czegoś, czego nie możesz uzyskać sam
|
||||
| maile nie wychodzą | brak `email: mailAdapter()` / pusty transport / pusta zakładka Emails | email.md; Send test w panelu |
|
||||
| nadawca maila stary | cache klienta poczty | sprawdź surowe nagłówki |
|
||||
| formularz: `unknown_fields` | pole spoza definicji (honeypot nieusunięty) | `ipal-form` → actions.ts |
|
||||
| Turnstile zawsze odrzuca | token użyty drugi raz / zła domena w Cloudflare | reset tokenu po każdej próbie; domena w CF |
|
||||
| Turnstile zawsze odrzuca | log `[ipal] Turnstile …` mówi dlaczego: brak sekretu, `invalid-input-secret`, `timeout-or-duplicate` | turnstile.md → tabela; sekret w panelu albo `TURNSTILE_SECRET_KEY`; **nie** zapisuj sekretu kodem |
|
||||
|
||||
### Środowisko
|
||||
| Objaw | Przyczyna | Naprawa |
|
||||
|
||||
@@ -82,7 +82,7 @@ Zapytanie strony: `depth` ≥ 1 (relacja `form` jako obiekt). Rejestr bloków:
|
||||
(Send test w panelu działa = transport OK; brak maila mimo to → zakładka Emails formularza);
|
||||
- [ ] niezaznaczona zgoda → komunikat z Notifications (nie angielski fallback);
|
||||
- [ ] 6 szybkich wysyłek → `rate_limited`;
|
||||
- [ ] Turnstile z kluczami → widget widoczny, wysyłka bez tokenu odrzucona;
|
||||
- [ ] Turnstile z kluczami → widget widoczny; zły sekret → formularz przechodzi, a w panelu (dashboard + Site Integrations → Turnstile) jest czerwony alert;
|
||||
- [ ] drugi język → etykiety i komunikaty w tym języku;
|
||||
- [ ] GTM Preview → zdarzenie z nazwą z panelu po sukcesie;
|
||||
- [ ] `ipal-audit --quick` → zero hardkodów w FormRenderer/FormBlock;
|
||||
|
||||
@@ -30,9 +30,9 @@ tylko, gdy użytkownik o to poprosi. Pełna budowa strony: skill **ipal-site**.
|
||||
6. **Routing** — `proxy.ts` (`createProxy`), `lib/content.ts`, layout bez
|
||||
`<head>`, catch-all z ISR + `generateStaticParams` + `resolveRedirect`,
|
||||
`not-found.tsx` z `LocaleView` — bez `headers()`, wersja na każdy język (PROGRAMISTA §2.6–2.8, pages.md).
|
||||
7. **SEO i bezpieczeństwo** — sitemap, robots, manifest, llms.txt, health
|
||||
7. **SEO i bezpieczeństwo** — sitemap (`sitemap.xml/route.ts` = `sitemapRoute`, bez CSS w `public/`), robots, manifest, llms.txt, health
|
||||
(wszystkie z `force-dynamic`), `htmlLimitedBots`, `buildSecurityHeaders`,
|
||||
`instrumentation.ts` z `assertEnv` (PROGRAMISTA §2.8–2.9).
|
||||
`instrumentation.ts` z `assertEnv` z `@intecion/ipal-kit/env` (PROGRAMISTA §2.8–2.9, env.md).
|
||||
8. **Nawigacja** — skill **ipal-nav**.
|
||||
9. `pnpm generate:types`, `pnpm payload generate:importmap`, skill **ipal-audit**
|
||||
(pełny), lista kroków w panelu dla użytkownika (PROGRAMISTA §2.11).
|
||||
|
||||
+6
-2
@@ -315,8 +315,12 @@ Query: `?q=` (wymagane), `?locale=`, `?limit=`. Odpowiedź:
|
||||
"results": [{ "title": "O nas", "url": "https://x/pl/o-nas", "description": "…", "slug": "o-nas" }] }
|
||||
```
|
||||
|
||||
Brak `q` → 400. Tylko opublikowane, bez `noindex`. Błąd/baza offline → pusty
|
||||
wynik (200), nie 500. Niska wartość `s-maxage` (60s) — wyniki świeże, ale z
|
||||
Brak `q` → 400. Tylko opublikowane, bez `noindex`, maks. 50 wyników. Błąd/baza
|
||||
offline → pusty wynik (200), nie 500. **Limit zapytań:** 120/min na IP (w pamięci,
|
||||
per instancja) → `429` z `Retry-After`; zmiana: `rateLimit: { max, windowMs }`,
|
||||
wyłączenie (limiter z przodu, np. Cloudflare WAF): `rateLimit: false`.
|
||||
Kolizja z `@payloadcms/plugin-search` (kolekcja `search` → REST pod `/api/search/...`):
|
||||
przenieś route, np. `app/api/site-search/route.ts`. Niska wartość `s-maxage` (60s) — wyniki świeże, ale z
|
||||
cache'em CDN.
|
||||
|
||||
Sam helper (do własnej wyszukiwarki po stronie serwera):
|
||||
|
||||
+28
-5
@@ -158,8 +158,23 @@ export default { plugins: { '@tailwindcss/postcss': {} } }
|
||||
```css
|
||||
/* src/app/(frontend)/styles.css */
|
||||
@import "tailwindcss";
|
||||
@import "@intecion/ipal-kit/fluid.css"; /* opcjonalnie: płynna skala typografii i odstępów */
|
||||
@source "../../../node_modules/@intecion/ipal-kit/dist/**/*.js";
|
||||
|
||||
@theme inline {
|
||||
--text-display: var(--ipal-fs-display);
|
||||
--text-h1: var(--ipal-fs-h1);
|
||||
--text-h2: var(--ipal-fs-h2);
|
||||
--text-h3: var(--ipal-fs-h3);
|
||||
--text-lead: var(--ipal-fs-lg);
|
||||
--spacing-section: var(--ipal-space-section);
|
||||
--spacing-gutter: var(--ipal-space-gutter);
|
||||
--spacing-gap: var(--ipal-space-gap);
|
||||
}
|
||||
```
|
||||
`fluid.css` to same zmienne `clamp()` (360 → 1280 px, w `rem`) — klasy `text-h1`,
|
||||
`py-section`, `px-gutter`. Liczby z `DESIGN.md` nadpisujesz w `:root` projektu
|
||||
(`--ipal-fs-h1: clamp(…)`); formuł nie piszesz od zera.
|
||||
Bez `@source` komponenty pluginu (baner cookies, Turnstile) są bez stylów.
|
||||
Kolory komponentów pluginu: `--ipal-primary`, `--ipal-radius` (consent.md).
|
||||
|
||||
@@ -279,8 +294,8 @@ Archiwum z paginacją (`?page=`) — osobna trasa albo świadomie dynamiczna (pa
|
||||
(przykład w pages.md).
|
||||
|
||||
```ts
|
||||
// src/app/sitemap.ts
|
||||
export { sitemap as default } from '@/lib/content'
|
||||
// src/app/sitemap.xml/route.ts — XML dla Google, wygląd dla ludzi z pluginu (nic w /public)
|
||||
export { sitemapRoute as GET } from '@/lib/content'
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
// src/app/robots.ts
|
||||
@@ -304,8 +319,9 @@ import { createHealthRoute } from '@intecion/ipal-kit'
|
||||
export const dynamic = 'force-dynamic'
|
||||
export const GET = createHealthRoute({ getCachedPayload })
|
||||
```
|
||||
Albo `sitemap.ts`, albo `sitemap.xml/route.ts` (`createSitemapRouteHandler`) —
|
||||
nigdy oba.
|
||||
Jeden sitemap: `sitemap.xml/route.ts` **albo** `sitemap.ts` — nigdy oba. Nagłówek
|
||||
sitemapy = „XML Sitemap”, pod nim „Technology by Intecion.com”; zmiana
|
||||
przez `createContentHelpers({ sitemapStyle })` (seo.md).
|
||||
|
||||
### 2.9 next.config.ts i instrumentation.ts
|
||||
```ts
|
||||
@@ -324,7 +340,7 @@ export default withPayload({
|
||||
})
|
||||
```
|
||||
CSP (`buildCsp`) — najpierw `report-only`, po sprawdzeniu konsoli `enforce`
|
||||
(security.md). `src/instrumentation.ts`: `assertEnv(ipalEnvRules({...}))` (env.md).
|
||||
(security.md). `src/instrumentation.ts`: `assertEnv(ipalEnvRules({...}))` z **`@intecion/ipal-kit/env`**, tylko gdy `NEXT_RUNTIME === 'nodejs'` (env.md).
|
||||
|
||||
### 2.10 Generowanie i start
|
||||
```bash
|
||||
@@ -470,6 +486,13 @@ Rób po jednej pozycji, buduj, sprawdzaj. Kolejność wg wagi:
|
||||
| 15c | `createPageMetadata(...)` w `page.tsx` | `generatePageMetadata(locale, slug)` z `lib/content` — wspólny cache z komponentem strony, mniej zapytań | seo.md |
|
||||
| 15d | brak limitów na za duże obrazy / wideo w Media | `buildOptimizeUploadHook()` + `buildOptimizeUploadField()`, migracja pola | storage.md |
|
||||
| 15e | tablice „Add Row”, wiersze „Item 01”, `cta1`/`cta2`, etykiety PL w panelu | `labels` + `rowLabel()` na tablicach, sloty → tablica (z migracją!), etykiety EN — AGENT.md §6.5a; po aktualizacji pluginu **`pnpm payload generate:importmap`** (buildLinksField używa `RowLabel`) | links.md |
|
||||
| 15f | `public/sitemap.css` + własna trasa / `app/sitemap.ts` | `app/sitemap.xml/route.ts`: `export { sitemapRoute as GET } from '@/lib/content'` + `force-dynamic`; usuń `public/sitemap.css` i `app/sitemap.ts` | seo.md |
|
||||
| 15g | `instrumentation.ts` importuje z roota (crash Edge/Turbopack: `fileTypeFromFile`) | `import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'` + `if (process.env.NEXT_RUNTIME !== 'nodejs') return`; usuń dynamiczny `await import` | env.md |
|
||||
| 15h | `<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(…) }}>` | `<JsonLdGraph schemas={[…]} />` z `@intecion/ipal-kit/rsc` (escapuje `<` — bez tego `</script>` w panelu = XSS) | seo.md |
|
||||
| 15i | własne formuły `clamp()` w `styles.css` | `@import "@intecion/ipal-kit/fluid.css"` + mapowanie w `@theme` (§2.5) | — |
|
||||
| 15j | front formularza wysyła `fetch('/api/form-submissions')` (od tej wersji REST zwraca 403 dla anonimów) | przepisz na server action + `submitForm` (skill `ipal-form`) | forms.md |
|
||||
| 15k | sekret Turnstile zapisywany kodem (`updateGlobal` w `onInit` / akcji) albo własny `verify` bez `remoteip` | usuń obejście: sekret w panelu albo env `TURNSTILE_SECRET_KEY`; plugin nie wysyła `remoteip` i loguje przyczynę odrzucenia | turnstile.md |
|
||||
| 15l | awaria Turnstile blokowała formularze | nic w projekcie: plugin przy błędzie po naszej stronie przyjmuje zgłoszenie i pokazuje alert w panelu; `generate:importmap`, Postgres: `migrate:create` | turnstile.md |
|
||||
| 16 | 404 na sztywno | rola 404 w System Pages + `getNotFoundPage` | pages.md |
|
||||
| 16a | `privacyPolicy: { label: 'Polityka prywatności', … }` w layoucie | usuń cały parametr; tekst wpisz w Cookie Settings → Privacy link label | consent.md |
|
||||
| 17 | Opcjonalnie — AI/GEO | Markdown per strona, llms-full, boty AI w robots, MCP, wyszukiwarka, speakable, aiSummary | content.md, seo.md, mcp.md |
|
||||
|
||||
+2
-2
@@ -184,12 +184,12 @@ Sprawdź: `/` → `/<domyślny język>`; `pnpm build` pokazuje strony jako `●`
|
||||
|
||||
```
|
||||
Zrób wg PROGRAMISTA.md §2.8–2.9 i seo.md:
|
||||
- app/sitemap.ts, robots.ts, manifest.ts (createManifestHandler), llms.txt/route.ts,
|
||||
- app/sitemap.xml/route.ts (sitemapRoute z lib/content), robots.ts, manifest.ts (createManifestHandler), llms.txt/route.ts,
|
||||
api/health/route.ts — każda trasa czytająca bazę z export const dynamic = 'force-dynamic',
|
||||
- next.config.ts: htmlLimitedBots, buildSecurityHeaders,
|
||||
- metadata strony przez generatePageMetadata z lib/content (wspólny cache), favicon przez buildIconsMetadata,
|
||||
- JSON-LD w root layoucie: Organization + WebSite (seo.md) z danych z panelu,
|
||||
- src/instrumentation.ts z assertEnv(ipalEnvRules(...)) (env.md).
|
||||
- src/instrumentation.ts z assertEnv(ipalEnvRules(...)) importowanym z @intecion/ipal-kit/env (env.md).
|
||||
CSP jeszcze nie — będzie w kroku 14.
|
||||
Plan najpierw.
|
||||
```
|
||||
|
||||
+19
-4
@@ -20,14 +20,21 @@ Najlepsze miejsce to `instrumentation.ts` (Next woła `register()` raz przy
|
||||
starcie serwera):
|
||||
|
||||
```ts
|
||||
// instrumentation.ts
|
||||
import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit'
|
||||
// src/instrumentation.ts
|
||||
import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
|
||||
|
||||
export function register() {
|
||||
if (process.env.NEXT_RUNTIME !== 'nodejs') return // Edge: brak process.env serwera
|
||||
assertEnv(ipalEnvRules({ storage: true, emailGraph: true, turnstile: true }))
|
||||
}
|
||||
```
|
||||
|
||||
> **Import z `@intecion/ipal-kit/env`, nie z roota.** Next kompiluje
|
||||
> `instrumentation.ts` także dla Edge. Root pakietu ciągnie Payload, `file-type`,
|
||||
> `fs` — Turbopack pada (`Export fileTypeFromFile doesn't exist in target module`).
|
||||
> `/env` to tylko walidator, zero zależności. Root nadal eksportuje `assertEnv`
|
||||
> (np. dla `payload.config.ts`).
|
||||
|
||||
Alternatywnie na górze `payload.config.ts` (ładuje się i w buildzie, i w
|
||||
runtime). Działa tylko po stronie serwera (czyta `process.env`) — NIE importuj
|
||||
do komponentu klienckiego.
|
||||
@@ -114,6 +121,14 @@ redeployów.
|
||||
## Eksport
|
||||
|
||||
```ts
|
||||
import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit'
|
||||
import type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from '@intecion/ipal-kit'
|
||||
import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
|
||||
import type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from '@intecion/ipal-kit/env'
|
||||
```
|
||||
|
||||
## `R2_PUBLIC_URL` — produkcja vs dev
|
||||
|
||||
`ipalEnvRules({ storage: true })` wymaga w **produkcji** pełnego URL-a
|
||||
(`https://media.klient.pl`). Poza produkcją dopuszcza ścieżkę względną
|
||||
(`/media`) — `buildR2Storage` dokleja do niej `NEXT_PUBLIC_SERVER_URL`, CSP jej nie
|
||||
dodaje (to `'self'`), `MediaPreconnect` ją pomija. Dev bez bucketu: nie ustawiaj
|
||||
`R2_*` wcale i nie włączaj `storage` — media lądują na dysku.
|
||||
|
||||
+9
-2
@@ -58,7 +58,8 @@ wykona `initialize` → `tools/list` → i będzie mógł wołać `search_conten
|
||||
|
||||
`getCachedPayload`, `config` (wymagane); `baseUrl` (URL-e w wynikach), `collection`
|
||||
(`'pages'`), `settingsSlug`, `content` (kolekcje-archiwa dla `get_page`),
|
||||
`serverName` (`'ipal-site'`), `serverVersion` (`'1.0.0'`).
|
||||
`serverName` (`'ipal-site'`), `serverVersion` (`'1.0.0'`), `rateLimit`
|
||||
(`{ max: 60, windowMs: 60_000 }` na IP, `false` = wyłączony), `maxBatch` (`10`).
|
||||
|
||||
## Bezpieczeństwo
|
||||
|
||||
@@ -66,10 +67,16 @@ wykona `initialize` → `tools/list` → i będzie mógł wołać `search_conten
|
||||
- `search_content` używa `like` i odpada bezpiecznie (komunikat), gdy pole nie
|
||||
jest odpytywalne — nie wywala route'a.
|
||||
- Nie wystawiaj tu niczego spoza publicznej treści strony.
|
||||
- **Limit zapytań:** 60 wiadomości JSON-RPC/min na IP (batch liczy się jako tyle
|
||||
wiadomości, ile zawiera) → `429` z `Retry-After`. Batch > 10 → `400`. Limit jest w
|
||||
pamięci, per instancja — za Cloudflare dołóż regułę Rate limiting w WAF.
|
||||
- Za Cloudflare Access route musi mieć Bypass (klienci MCP nie wyślą Service Token)
|
||||
— patrz instrukcja Cloudflare Access.
|
||||
|
||||
## Protokół (dla debugowania)
|
||||
|
||||
Pojedynczy obiekt JSON-RPC albo batch (tablica). Notyfikacje (`notifications/*`,
|
||||
bez `id`) → HTTP 202 bez ciała. Żądania → `{ jsonrpc:'2.0', id, result }` albo
|
||||
`error` (`-32601` nieznana metoda, `-32700` parse error). `initialize` odbija
|
||||
`error` (`-32601` nieznana metoda, `-32700` parse error, `-32600` batch za duży,
|
||||
`-32000` limit zapytań). `initialize` odbija
|
||||
`protocolVersion` klienta (fallback `2025-06-18`).
|
||||
|
||||
+23
-44
@@ -1066,65 +1066,44 @@ Listy botów: `AI_ASSISTANT_BOTS`, `AI_TRAINING_BOTS` (eksportowane; nadpisujesz
|
||||
przez `aiAssistantAgents` / `aiTrainingAgents`). `Next` akceptuje `rules` jako
|
||||
tablicę — przy aktywnych botach AI zwracana jest tablica reguł.
|
||||
|
||||
## Sitemap czytelny w przeglądarce (czysty XML)
|
||||
## Sitemap — czytelny w przeglądarce, zero plików w projekcie
|
||||
|
||||
Domyślny `/sitemap.xml` (Next MetadataRoute) działa dla Google, ale w przeglądarce
|
||||
bywa nieczytelny. Możesz serwować go jako **czysty, sformatowany XML** przez
|
||||
`buildSitemapXml` — przeglądarka pokaże wbudowane drzewo XML (wcięcia, zwijanie,
|
||||
kolorowanie składni), bez żadnej transformacji.
|
||||
|
||||
> **NIE używaj XSLT.** Przeglądarki (Chrome i in.) WYCOFUJĄ XSLT — arkusz
|
||||
> `<?xml-stylesheet?>` pokazuje ostrzeżenie i wkrótce przestanie działać.
|
||||
> Rozwiązanie: serwuj czysty XML z poprawnym Content-Type; przeglądarka
|
||||
> renderuje swój natywny widok drzewa XML sama.
|
||||
`createContentHelpers` zwraca `sitemapRoute`: XML dla crawlerów, a dla ludzi
|
||||
gotowy wygląd (kafelki, pigułki hreflang, tryb jasny/ciemny) **serwowany przez
|
||||
plugin z tej samej trasy** (`/sitemap.xml?style`). Projekt nie ma `sitemap.css`,
|
||||
nic nie kopiuje z `node_modules`, nie podaje `cssUrl`. Cały plik trasy:
|
||||
|
||||
```ts
|
||||
// app/sitemap.xml/route.ts (zamiast app/sitemap.ts)
|
||||
import { buildSitemapXml } from '@intecion/ipal-kit'
|
||||
import { sitemap } from '@/lib/content'
|
||||
|
||||
// src/app/sitemap.xml/route.ts
|
||||
export { sitemapRoute as GET } from '@/lib/content'
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET() {
|
||||
const entries = await sitemap()
|
||||
const xml = buildSitemapXml(entries)
|
||||
return new Response(xml, {
|
||||
headers: { 'Content-Type': 'application/xml; charset=utf-8' },
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
`buildSitemapXml` zwraca wcięty XML. Dwa tryby wyświetlania:
|
||||
|
||||
**Bez `cssUrl`** → przeglądarka pokazuje natywny widok drzewa XML (wcięcia, zwijanie).
|
||||
|
||||
**Z `cssUrl`** → stylujesz XML własnym CSS (kafelki, etykiety). To W3C standard
|
||||
„Associating Style Sheets with XML" — `type="text/css"`, NIE wycofywane (w
|
||||
przeciwieństwie do XSLT/`text/xsl`). Zero ostrzeżenia, ładny wygląd, bezpieczne
|
||||
dla Google (crawlery ignorują dyrektywę).
|
||||
- **Nagłówek** = „XML Sitemap” (bez nazwy firmy/strony).
|
||||
- **Linia pod nagłówkiem** = dostawca technologii: „Technology by Intecion.com”.
|
||||
- To CSS na XML (`<?xml-stylesheet type="text/css"?>`, standard W3C) — **nie XSLT**,
|
||||
które przeglądarki wycofują. Google ignoruje dyrektywę; zero wpływu na SEO.
|
||||
|
||||
Zmiana wyglądu — raz, w `lib/content.ts`, nie w plikach:
|
||||
```ts
|
||||
const xml = buildSitemapXml(entries, { cssUrl: '/sitemap.css' })
|
||||
createContentHelpers({
|
||||
config, content, i18n: i18nConfig,
|
||||
sitemapStyle: { accent: '#0f766e' }, // kolor akcentu
|
||||
// sitemapStyle: { credit: false }, // bez linii dostawcy
|
||||
// sitemapStyle: false, // surowy XML (natywny widok przeglądarki)
|
||||
})
|
||||
```
|
||||
|
||||
### Gotowy CSS z pluginu
|
||||
|
||||
Plugin dostarcza dopracowany `sitemap.css` (auto dark/light, kafelki, pigułki
|
||||
hreflang, monospace URL). Skopiuj do projektu:
|
||||
```bash
|
||||
cp node_modules/@intecion/ipal-kit/dist/modules/seo/assets/sitemap.css public/sitemap.css
|
||||
```
|
||||
Dostosuj `--accent` i inne zmienne CSS do brandingu projektu. Selektory to nazwy
|
||||
tagów XML (`urlset`, `url`, `loc`, `lastmod`, `link`). hreflang pokazuje się jako
|
||||
pigułka przez `link::before { content: attr(hreflang) }`.
|
||||
|
||||
Niższy poziom (bez `createContentHelpers`): `createSitemapRouteHandler(sitemap, { style })`,
|
||||
`buildSitemapXml(entries, { cssUrl })`, `buildSitemapCss(options)`. Opcja `cssUrl`
|
||||
(własny arkusz w `public/`) nadal działa, ale nie jest potrzebna.
|
||||
|
||||
### WAŻNE — jeden sitemap, nie dwa
|
||||
|
||||
Jeśli używasz `app/sitemap.xml/route.ts`, USUŃ `app/sitemap.ts` (MetadataRoute).
|
||||
Dwa sitemapy pod różnymi ścieżkami mylą crawlery. Wybierz jeden:
|
||||
- **route.ts + buildSitemapXml** — czytelny XML w przeglądarce
|
||||
- **sitemap.ts** (reeksport z lib/content) — mniej kodu, mniej czytelny w przeglądarce
|
||||
- **`sitemap.xml/route.ts` + `sitemapRoute`** (zalecane) — czytelny w przeglądarce, wygląd z pluginu
|
||||
- **`sitemap.ts`** (`export { sitemap as default }`) — natywny widok XML przeglądarki
|
||||
|
||||
Oba tak samo dobre dla Google — to kwestia czytelności dla człowieka, nie SEO.
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ S3. Dodaj zmienną i przekaż ją do adaptera:
|
||||
```bash
|
||||
# .env
|
||||
R2_PUBLIC_URL=https://media.klient.pl
|
||||
# dev z rewrite /media → bucket: R2_PUBLIC_URL=/media (tylko poza produkcją; env.md)
|
||||
```
|
||||
|
||||
Adapter `buildR2Storage` czyta ją i ustawia jako bazowy URL mediów (jeśli
|
||||
|
||||
+45
-3
@@ -52,9 +52,51 @@ if (!ok) {
|
||||
}
|
||||
```
|
||||
|
||||
`verifyTurnstile` czyta secret z SiteIntegrations (Local API), woła Cloudflare.
|
||||
Zwraca `false` na każdy problem (brak klucza, sieć, odrzucenie) — traktuj
|
||||
`false` jako „nie ufaj temu zgłoszeniu". `server-only` gwarantuje, że nie
|
||||
`verifyTurnstile` czyta secret z SiteIntegrations (Local API), a gdy pole jest
|
||||
puste — ze zmiennej **`TURNSTILE_SECRET_KEY`** (ta sama, której wymaga
|
||||
`ipalEnvRules({ turnstile: true })`). Zwraca `false` na każdy problem i **loguje
|
||||
przyczynę** w logach serwera:
|
||||
|
||||
| Log | Przyczyna |
|
||||
|---|---|
|
||||
| `[ipal] Turnstile: no secret key …` | brak sekretu w panelu i w env (log raz na proces) |
|
||||
| `Turnstile rejected: invalid-input-secret` | zły sekret albo para site key / secret z różnych widgetów |
|
||||
| `Turnstile rejected: timeout-or-duplicate` | token użyty drugi raz albo starszy niż 300 s — `reset()` po każdej próbie |
|
||||
| `Turnstile rejected: invalid-input-response` | uszkodzony / pusty token z frontu |
|
||||
| `siteverify request failed` | brak wyjścia do `challenges.cloudflare.com` z kontenera |
|
||||
|
||||
### Awaria po naszej stronie ≠ odrzucenie formularza
|
||||
|
||||
`checkTurnstile` (z `/server`) klasyfikuje wynik:
|
||||
|
||||
| Wynik | Kiedy | `submitForm` (domyślnie) |
|
||||
|---|---|---|
|
||||
| `pass` | token poprawny | przyjmuje |
|
||||
| `reject` | zły token **odwiedzającego**: `invalid-input-response`, `timeout-or-duplicate`, brak tokenu | **odrzuca** (`reason: 'turnstile'`) |
|
||||
| `degraded` | błąd **po naszej stronie**: brak sekretu, `invalid-input-secret`, Cloudflare nieosiągalny / `internal-error` | **przyjmuje** — limit, honeypot i walidacja dalej działają |
|
||||
|
||||
Przy `degraded` panel pokazuje problem:
|
||||
- **Dashboard** — czerwony alert „Integration problem…” z linkiem do Site Integrations
|
||||
(`admin.components.beforeDashboard`, wpinany przez plugin automatycznie),
|
||||
- **Site Integrations → Turnstile** — baner z przyczyną, kodem i czasem.
|
||||
|
||||
Status zapisuje serwer przy weryfikacji formularza (bez crona), najwyżej raz na 10 min
|
||||
przy trwającym błędzie i od razu przy zmianie stanu. Zapis nowych kluczy w panelu
|
||||
czyści status; po następnym wysłaniu formularza pojawi się aktualny.
|
||||
Twardo (fail closed): `submitForm({ …, turnstileOnConfigError: 'reject' })`.
|
||||
|
||||
Po aktualizacji pluginu: `pnpm payload generate:importmap` (nowe komponenty panelu);
|
||||
Postgres: `pnpm payload migrate:create` (pole `turnstileStatus` w SiteIntegrations).
|
||||
|
||||
`remoteip` **nie jest** wysyłany domyślnie — za Cloudflare/Traefikiem/Dockerem IP
|
||||
widziane przez aplikację bywa inne niż to, z którego rozwiązano wyzwanie (IPv6 na
|
||||
telefonie vs IPv4 proxy). Włączenie: `verifyTurnstile({ …, sendRemoteIp: true })`.
|
||||
|
||||
**Diagnoza „formularz zawsze odrzuca Turnstile”:** najpierw logi serwera (tabela
|
||||
wyżej), potem czy sekret jest w bazie:
|
||||
`docker exec <mongo> mongosh <db> --eval 'db["site-integrations"].findOne({}, {turnstileSecretKey:1})'`.
|
||||
Nie zapisuj sekretu kodem (`updateGlobal` w `onInit` / akcji) — nadpisuje panel przy
|
||||
każdym starcie; jeśli wolisz env, ustaw `TURNSTILE_SECRET_KEY` i zostaw pole puste. `server-only` gwarantuje, że nie
|
||||
trafi do bundla przeglądarki.
|
||||
|
||||
> W formularzach zwykle nie wołasz `verifyTurnstile` wprost — robi to
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@intecion/ipal-kit",
|
||||
"version": "1.8.4",
|
||||
"version": "1.8.12",
|
||||
"description": "Intecion Payload Advanced Library — a Payload CMS 3 plugin: i18n, SEO, forms, consent, analytics, blog/archives.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -7,3 +7,4 @@ export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'
|
||||
* admin.components.graphics.Logo/Icon.
|
||||
*/
|
||||
export { AdminIcon, AdminLogo, IntecionCredit } from '../modules/branding/index.js'
|
||||
export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'
|
||||
|
||||
@@ -60,6 +60,7 @@ export {
|
||||
useSetAlternateLinks,
|
||||
} from '../modules/i18n/index.js'
|
||||
export type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'
|
||||
export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'
|
||||
export { LocaleView } from '../modules/pages/LocaleView.js'
|
||||
export { Turnstile } from '../modules/turnstile/client.js'
|
||||
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Entry point: @intecion/ipal-kit/env
|
||||
*
|
||||
* Environment validation ONLY — zero imports beyond this module, no Payload,
|
||||
* no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next
|
||||
* also compiles for the Edge runtime: importing the package root there drags in
|
||||
* Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile
|
||||
* doesn't exist in target module").
|
||||
*
|
||||
* // src/instrumentation.ts
|
||||
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
|
||||
* export function register() {
|
||||
* if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))
|
||||
* }
|
||||
*/
|
||||
export { assertEnv, ipalEnvRules } from '../modules/env/index.js'
|
||||
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js'
|
||||
@@ -1,3 +1,7 @@
|
||||
export { sendEmail } from '../modules/email/index.js'
|
||||
export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'
|
||||
export { submitForm } from '../modules/forms/index.js'
|
||||
export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'
|
||||
/**
|
||||
* Entry point: ipal-kit/server
|
||||
*
|
||||
@@ -10,8 +14,5 @@
|
||||
* Import these only from Server Actions, route handlers, or server components —
|
||||
* never from the Payload config or client code.
|
||||
*/
|
||||
export { verifyTurnstile } from '../modules/turnstile/index.js'
|
||||
export { sendEmail } from '../modules/email/index.js'
|
||||
export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'
|
||||
export { submitForm } from '../modules/forms/index.js'
|
||||
export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'
|
||||
export { checkTurnstile, verifyTurnstile } from '../modules/turnstile/index.js'
|
||||
export type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { Field } from 'payload'
|
||||
|
||||
import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'
|
||||
|
||||
/**
|
||||
* Cloudflare Turnstile credentials.
|
||||
*
|
||||
@@ -9,6 +11,8 @@ import type { Field } from 'payload'
|
||||
* so they remain editable in the admin panel.
|
||||
*/
|
||||
export const turnstileFields: Field[] = [
|
||||
// Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.
|
||||
buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),
|
||||
{
|
||||
name: 'turnstileSiteKey',
|
||||
type: 'text',
|
||||
@@ -27,4 +31,5 @@ export const turnstileFields: Field[] = [
|
||||
},
|
||||
},
|
||||
},
|
||||
buildIntegrationStatusField('turnstileStatus'),
|
||||
]
|
||||
|
||||
@@ -21,10 +21,6 @@ type BuildSiteIntegrationsArgs = {
|
||||
* impossible to enter.)
|
||||
*
|
||||
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
|
||||
*
|
||||
* Note: R2 storage credentials are NOT here — storage is infrastructure and
|
||||
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
|
||||
* consumed by buildR2Storage. See docs/storage.md.
|
||||
*/
|
||||
export function buildSiteIntegrations({
|
||||
additionalFields,
|
||||
@@ -47,10 +43,26 @@ export function buildSiteIntegrations({
|
||||
{ fields: analyticsFields, label: 'Analytics' },
|
||||
{ fields: turnstileFields, label: 'Turnstile' },
|
||||
{ fields: smtpFields, label: 'SMTP' },
|
||||
...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),
|
||||
...(additionalFields?.length
|
||||
? [{ fields: additionalFields, label: 'Custom' }]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
],
|
||||
hooks: {
|
||||
beforeChange: [
|
||||
// Keys edited in the panel → clear the old Turnstile status, so a stale
|
||||
// "not working" banner doesn't linger until the next form submission.
|
||||
({ context, data, originalDoc }) => {
|
||||
if (context?.ipalIntegrationStatus || !data) {return data}
|
||||
const changed = (k: string) => k in data && data[k] !== originalDoc?.[k]
|
||||
if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {
|
||||
data.turnstileStatus = { checkedAt: null, code: null, message: null, since: null, state: null }
|
||||
}
|
||||
return data
|
||||
},
|
||||
],
|
||||
},
|
||||
label: 'Site Integrations',
|
||||
}
|
||||
}
|
||||
|
||||
+140
-137
@@ -1,20 +1,3 @@
|
||||
export { ipalKit } from './plugin.js'
|
||||
export type { IpalOptions } from './types.js'
|
||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'
|
||||
export {
|
||||
buildLocalizedPath,
|
||||
getDefaultLocale,
|
||||
getLocaleCodes,
|
||||
getLocaleDefinition,
|
||||
getLocalizedSlugs,
|
||||
isValidLocale,
|
||||
LOCALE_COOKIE_NAME,
|
||||
matchAcceptLanguage,
|
||||
negotiateLocale,
|
||||
switchLocalePath,
|
||||
} from './modules/i18n/index.js'
|
||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js'
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'
|
||||
export type { AccessOption, Role } from './modules/access/index.js'
|
||||
export {
|
||||
adminOnly,
|
||||
@@ -30,58 +13,102 @@ export {
|
||||
requireRoleField,
|
||||
ROLE_HIERARCHY,
|
||||
} from './modules/access/index.js'
|
||||
export type { GlobalQueryOptions } from './modules/payload/index.js'
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'
|
||||
export type { A11yState } from './modules/accessibility/index.js'
|
||||
export { rowLabel } from './modules/admin-ui/index.js'
|
||||
export type { RowLabelProps } from './modules/admin-ui/index.js'
|
||||
export type { AnalyticsConfig } from './modules/analytics/index.js'
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js'
|
||||
export {
|
||||
getGlobal,
|
||||
getSiteSettings,
|
||||
getSiteIntegrations,
|
||||
SITE_SETTINGS_SLUG,
|
||||
SITE_INTEGRATIONS_SLUG,
|
||||
} from './modules/payload/index.js'
|
||||
export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js'
|
||||
ACCEPT_ALL_CONSENT,
|
||||
CONSENT_CATEGORIES,
|
||||
CONSENT_COOKIE,
|
||||
CONSENT_MAX_AGE,
|
||||
CONSENT_VERSION,
|
||||
DEFAULT_CONSENT,
|
||||
getConsentTexts,
|
||||
parseConsent,
|
||||
REJECT_ALL_CONSENT,
|
||||
serializeConsent,
|
||||
setDefaultConsent,
|
||||
updateConsent,
|
||||
} from './modules/consent/index.js'
|
||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'
|
||||
export type { ContentCollectionOption, ContentOption, ResolvedRoute } from './modules/content/index.js'
|
||||
export {
|
||||
composeTitle,
|
||||
buildHreflangAlternates,
|
||||
buildMetadata,
|
||||
readSiteMetaConfig,
|
||||
slugsAcrossLocales,
|
||||
} from './modules/seo/index.js'
|
||||
export type { SiteMetaConfig } from './modules/seo/index.js'
|
||||
export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js'
|
||||
export { createContentHelpers } from './modules/frontend/index.js'
|
||||
export {
|
||||
resolveRoute,
|
||||
resolveRedirect,
|
||||
resolveNotFoundPage,
|
||||
blocksToMarkdown,
|
||||
createMarkdownRenderer,
|
||||
markdownResponse,
|
||||
prefersMarkdown,
|
||||
markdownHref,
|
||||
MARKDOWN_PREFIX,
|
||||
searchContent,
|
||||
createSearchRoute,
|
||||
archiveFieldName,
|
||||
getArchiveEntries,
|
||||
blocksToMarkdown,
|
||||
buildArchivePath,
|
||||
buildEntryPath,
|
||||
createMarkdownRenderer,
|
||||
createSearchRoute,
|
||||
getArchiveEntries,
|
||||
MARKDOWN_PREFIX,
|
||||
markdownHref,
|
||||
markdownResponse,
|
||||
parsePageParam,
|
||||
prefersMarkdown,
|
||||
resolveNotFoundPage,
|
||||
resolveRedirect,
|
||||
resolveRoute,
|
||||
searchContent,
|
||||
} from './modules/content/index.js'
|
||||
export type { ArchiveEntries } from './modules/content/index.js'
|
||||
export type { SearchResult } from './modules/content/index.js'
|
||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js'
|
||||
export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js'
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js'
|
||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js'
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js'
|
||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js'
|
||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'
|
||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'
|
||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js'
|
||||
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from './modules/env/index.js'
|
||||
// Panel-managed form analytics (config-time field builder).
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'
|
||||
export type {
|
||||
FormsCollectionOverrides,
|
||||
FormsFieldsOverride,
|
||||
FormsOption,
|
||||
} from './modules/forms/types.js'
|
||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'
|
||||
// Validation rules are pure — exported server-side too, for re-validating a
|
||||
// submission inside a server action. (useForm/useContactForm are client-only →
|
||||
// '@intecion/ipal-kit/client'.)
|
||||
export {
|
||||
buildAutoFillMetaHook,
|
||||
injectAutoFillMeta,
|
||||
createMetadataGenerator,
|
||||
createPageMetadata,
|
||||
buildSitemapEntries,
|
||||
buildRobots,
|
||||
AI_ASSISTANT_BOTS,
|
||||
AI_TRAINING_BOTS,
|
||||
} from './modules/seo/index.js'
|
||||
buildValidator,
|
||||
checked,
|
||||
custom,
|
||||
email,
|
||||
isEmail,
|
||||
maxLength,
|
||||
minLength,
|
||||
pattern,
|
||||
required,
|
||||
} from './modules/forms/validators.js'
|
||||
export type { Rule } from './modules/forms/validators.js'
|
||||
export { createContentHelpers } from './modules/frontend/index.js'
|
||||
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
||||
export { createHealthRoute } from './modules/health/index.js'
|
||||
export { buildCrossLocaleFieldSync, buildPreventDeleteSystemPage, buildRevalidateHook, buildValidateUniqueRole, setPublishedAtHook, trackSlugHistoryHook } from './modules/hooks/index.js'
|
||||
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'
|
||||
export {
|
||||
buildLocalizedPath,
|
||||
getDefaultLocale,
|
||||
getLocaleCodes,
|
||||
getLocaleDefinition,
|
||||
getLocalizedSlugs,
|
||||
isValidLocale,
|
||||
LOCALE_COOKIE_NAME,
|
||||
matchAcceptLanguage,
|
||||
negotiateLocale,
|
||||
switchLocalePath,
|
||||
} from './modules/i18n/index.js'
|
||||
export type { LocaleMiddlewareResult } from './modules/i18n/index.js'
|
||||
export {
|
||||
createLocaleMiddleware,
|
||||
@@ -89,96 +116,72 @@ export {
|
||||
} from './modules/i18n/index.js'
|
||||
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'
|
||||
export { resolveLocalized } from './modules/i18n/index.js'
|
||||
export {
|
||||
CONSENT_CATEGORIES,
|
||||
DEFAULT_CONSENT,
|
||||
ACCEPT_ALL_CONSENT,
|
||||
REJECT_ALL_CONSENT,
|
||||
CONSENT_COOKIE,
|
||||
CONSENT_VERSION,
|
||||
CONSENT_MAX_AGE,
|
||||
serializeConsent,
|
||||
parseConsent,
|
||||
setDefaultConsent,
|
||||
updateConsent,
|
||||
getConsentTexts,
|
||||
} from './modules/consent/index.js'
|
||||
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'
|
||||
// Imported straight from the file, NOT from ./modules/email/index.js — that
|
||||
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
|
||||
// Payload loads the config (or runs generate:importmap) as a plain Node script.
|
||||
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'
|
||||
export { graphAdapter } from './modules/email/graphAdapter.js'
|
||||
export { mailAdapter } from './modules/email/mailAdapter.js'
|
||||
export type { MailAdapterArgs } from './modules/email/mailAdapter.js'
|
||||
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js'
|
||||
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'
|
||||
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'
|
||||
export { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegrationStatus } from './modules/integrations/index.js'
|
||||
export type { IntegrationState, IntegrationStatus } from './modules/integrations/index.js'
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'
|
||||
export type {
|
||||
FormsOption,
|
||||
FormsCollectionOverrides,
|
||||
FormsFieldsOverride,
|
||||
} from './modules/forms/types.js'
|
||||
// Validation rules are pure — exported server-side too, for re-validating a
|
||||
// submission inside a server action. (useForm/useContactForm are client-only →
|
||||
// '@intecion/ipal-kit/client'.)
|
||||
export {
|
||||
buildValidator,
|
||||
isEmail,
|
||||
required,
|
||||
email,
|
||||
minLength,
|
||||
maxLength,
|
||||
checked,
|
||||
pattern,
|
||||
custom,
|
||||
} from './modules/forms/validators.js'
|
||||
export type { Rule } from './modules/forms/validators.js'
|
||||
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'
|
||||
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'
|
||||
// Panel-managed form analytics (config-time field builder).
|
||||
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'
|
||||
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
|
||||
export { createHealthRoute } from './modules/health/index.js'
|
||||
BuildLinkFieldOptions,
|
||||
BuildLinksFieldOptions,
|
||||
LinkAppearance,
|
||||
LinkValue,
|
||||
ResolveLinkHrefOptions,
|
||||
} from './modules/links/index.js'
|
||||
// Read-only MCP server (Claude/agents connect to the site and query it).
|
||||
export { createMcpRoute } from './modules/mcp/index.js'
|
||||
// Boot-time environment validation (fail fast on misconfigured deploys).
|
||||
export { assertEnv, ipalEnvRules } from './modules/env/index.js'
|
||||
export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js'
|
||||
export type { AnalyticsConfig } from './modules/analytics/index.js'
|
||||
export { getAnalyticsConfig } from './modules/analytics/index.js'
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js'
|
||||
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js'
|
||||
export { buildOptimizeUploadField, buildOptimizeUploadHook, normalizeFilename, normalizeFilenameHook } from './modules/media/index.js'
|
||||
export type { OptimizeUploadOptions } from './modules/media/index.js'
|
||||
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js'
|
||||
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js'
|
||||
export type { PagesOption, SystemPageRole } from './modules/pages/index.js'
|
||||
|
||||
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js'
|
||||
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'
|
||||
export type { GlobalQueryOptions } from './modules/payload/index.js'
|
||||
export {
|
||||
getGlobal,
|
||||
getSiteIntegrations,
|
||||
getSiteSettings,
|
||||
SITE_INTEGRATIONS_SLUG,
|
||||
SITE_SETTINGS_SLUG,
|
||||
} from './modules/payload/index.js'
|
||||
// Lexical → Markdown (pure, no React) — for AI-readable output.
|
||||
export { lexicalToMarkdown } from './modules/richtext/index.js'
|
||||
export { buildSecurityHeaders } from './modules/security/index.js'
|
||||
export { buildCsp } from './modules/security/index.js'
|
||||
export type { BuildCspArgs } from './modules/security/index.js'
|
||||
export type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js'
|
||||
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js'
|
||||
export {
|
||||
buildHreflangAlternates,
|
||||
buildMetadata,
|
||||
composeTitle,
|
||||
readSiteMetaConfig,
|
||||
slugsAcrossLocales,
|
||||
} from './modules/seo/index.js'
|
||||
export type { SiteMetaConfig } from './modules/seo/index.js'
|
||||
export type { AutoFillMapping, RobotsOptions, RobotsRules, SitemapEntry } from './modules/seo/index.js'
|
||||
export {
|
||||
AI_ASSISTANT_BOTS,
|
||||
AI_TRAINING_BOTS,
|
||||
buildAutoFillMetaHook,
|
||||
buildRobots,
|
||||
buildSitemapEntries,
|
||||
createMetadataGenerator,
|
||||
createPageMetadata,
|
||||
injectAutoFillMeta,
|
||||
} from './modules/seo/index.js'
|
||||
export { createLlmsTxtRoute, createManifestHandler, createSitemapRouteHandler } from './modules/seo/index.js'
|
||||
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'
|
||||
export { buildNoindexField } from './modules/seo/index.js'
|
||||
export { rowLabel } from './modules/admin-ui/index.js'
|
||||
export type { RowLabelProps } from './modules/admin-ui/index.js'
|
||||
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'
|
||||
export type {
|
||||
LinkAppearance,
|
||||
LinkValue,
|
||||
BuildLinkFieldOptions,
|
||||
BuildLinksFieldOptions,
|
||||
ResolveLinkHrefOptions,
|
||||
} from './modules/links/index.js'
|
||||
export { buildSpeakableJsonLd } from './modules/seo/index.js'
|
||||
export { buildSummaryField } from './modules/seo/index.js'
|
||||
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js'
|
||||
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js'
|
||||
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
|
||||
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js'
|
||||
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js'
|
||||
export { buildArticleJsonLd } from './modules/seo/index.js'
|
||||
export { buildLlmsTxt } from './modules/seo/index.js'
|
||||
export { buildSitemapXml } from './modules/seo/index.js'
|
||||
export { buildSitemapCss, buildSitemapXml, DEFAULT_SITEMAP_CREDIT, SITEMAP_STYLE_PARAM } from './modules/seo/index.js'
|
||||
export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js'
|
||||
export { buildSlugField, toSlug } from './modules/slug/index.js'
|
||||
export { buildR2Storage } from './modules/storage/index.js'
|
||||
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js'
|
||||
export type { OptimizeUploadOptions } from './modules/media/index.js'
|
||||
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js'
|
||||
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'
|
||||
export type { A11yState } from './modules/accessibility/index.js'
|
||||
export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js'
|
||||
export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js'
|
||||
export { ipalKit } from './plugin.js'
|
||||
export type { IpalOptions } from './types.js'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user