diff --git a/bin/ipal-skills.mjs b/bin/ipal-skills.mjs old mode 100644 new mode 100755 diff --git a/dist/globals/SiteIntegrations/fields/storage.d.ts b/dist/globals/SiteIntegrations/fields/storage.d.ts deleted file mode 100644 index 1b47103..0000000 --- a/dist/globals/SiteIntegrations/fields/storage.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Field } from 'payload'; -/** - * Cloudflare R2 storage credentials. - * Reserved for future use — media offloading to R2. - * - * Protected at the global level (SiteIntegrations requires an authenticated - * user), so the access keys stay editable in the admin panel while remaining - * inaccessible to anonymous API requests. - */ -export declare const storageFields: Field[]; diff --git a/dist/globals/SiteIntegrations/fields/storage.js b/dist/globals/SiteIntegrations/fields/storage.js deleted file mode 100644 index 99194cb..0000000 --- a/dist/globals/SiteIntegrations/fields/storage.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Cloudflare R2 storage credentials. - * Reserved for future use — media offloading to R2. - * - * Protected at the global level (SiteIntegrations requires an authenticated - * user), so the access keys stay editable in the admin panel while remaining - * inaccessible to anonymous API requests. - */ export const storageFields = [ - { - name: 'r2Bucket', - type: 'text', - admin: { - description: 'R2 bucket name.' - } - }, - { - name: 'r2Endpoint', - type: 'text', - admin: { - description: 'R2 S3-compatible endpoint URL.' - } - }, - { - name: 'r2AccessKeyId', - type: 'text', - admin: { - description: 'R2 access key ID.' - } - }, - { - name: 'r2SecretAccessKey', - type: 'text', - admin: { - description: 'R2 secret access key.', - // Masked in the UI (••••) — stored plaintext, readable for R2 auth. - components: { - Field: '@intecion/ipal-kit/client#MaskedField' - } - } - } -]; - -//# sourceMappingURL=storage.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/storage.js.map b/dist/globals/SiteIntegrations/fields/storage.js.map deleted file mode 100644 index 8f041d8..0000000 --- a/dist/globals/SiteIntegrations/fields/storage.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/storage.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare R2 storage credentials.\n * Reserved for future use — media offloading to R2.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so the access keys stay editable in the admin panel while remaining\n * inaccessible to anonymous API requests.\n */\nexport const storageFields: Field[] = [\n {\n name: 'r2Bucket',\n type: 'text',\n admin: {\n description: 'R2 bucket name.',\n },\n },\n {\n name: 'r2Endpoint',\n type: 'text',\n admin: {\n description: 'R2 S3-compatible endpoint URL.',\n },\n },\n {\n name: 'r2AccessKeyId',\n type: 'text',\n admin: {\n description: 'R2 access key ID.',\n },\n },\n {\n name: 'r2SecretAccessKey',\n type: 'text',\n admin: {\n description: 'R2 secret access key.',\n // Masked in the UI (••••) — stored plaintext, readable for R2 auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n]\n"],"names":["storageFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,oEAAoE;YACpEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"} \ No newline at end of file diff --git a/dist/modules/seo/asseets/sitemap.css b/dist/modules/seo/asseets/sitemap.css deleted file mode 100644 index d28b43a..0000000 --- a/dist/modules/seo/asseets/sitemap.css +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Starter stylesheet for a sitemap served via buildSitemapXml({ cssUrl }). - * Uses type="text/css" on XML (W3C "Associating Style Sheets with XML") — NOT - * XSLT, so no browser deprecation warning. Selectors are the XML tag names. - * - * Copy to your project's /public/sitemap.css and adjust colors/spacing to taste. - * Crawlers ignore this; it only affects the human-readable browser view. - */ - -urlset { - display: block; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; - background: #090d16; - color: #f1f5f9; - padding: 2rem 1.5rem; - max-width: 1200px; - margin: 0 auto; - line-height: 1.5; -} - -/* Each URL entry as a card. */ -url { - display: block; - background: #111827; - border: 1px solid #1e293b; - border-radius: 8px; - padding: 1rem 1.25rem; - margin-bottom: 0.75rem; -} - -/* The URL itself. */ -loc { - display: block; - font-size: 0.95rem; - font-weight: 600; - color: #f97316; - margin-bottom: 0.5rem; - word-break: break-all; -} - -/* Metadata line: lastmod / changefreq / priority, each with a label. */ -lastmod, -changefreq, -priority { - display: inline-block; - font-size: 0.8rem; - color: #94a3b8; - margin-right: 1.5rem; -} - -lastmod::before { - content: 'Ostatnia modyfikacja: '; - color: #64748b; -} - -changefreq::before { - content: 'Częstotliwość: '; - color: #64748b; -} - -priority::before { - content: 'Priorytet: '; - color: #64748b; -} - -/* hreflang alternates as small pills. */ -link { - display: inline-block; - font-size: 0.75rem; - background: #1e293b; - color: #38bdf8; - border: 1px solid #334155; - padding: 0.15rem 0.45rem; - border-radius: 4px; - margin: 0.4rem 0.35rem 0 0; -} \ No newline at end of file diff --git a/dist/plugin.js b/dist/plugin.js index 58086a5..a507149 100644 --- a/dist/plugin.js +++ b/dist/plugin.js @@ -69,16 +69,17 @@ import { testEmailEndpoint } from './modules/email/test/testEmailEndpoint.js'; // '@clocklimited/payload-2fa'" crashing even public frontend pages). let totp = tf.plugin; if (!totp) { - // Fallback: dynamic import. Variable specifier dodges the plugin's own - // TS2307, but Next may NOT trace it into the server bundle — projects - // using this path MUST add '@clocklimited/payload-2fa' to - // serverExternalPackages in next.config (see docs/security.md). + // Fallback: dynamic import, resolvable because the package is an optional + // peer. Variable specifier dodges the plugin's own TS2307. Works only + // outside Next (payload CLI): webpack turns it into an empty context, and + // serverExternalPackages fails on the package's own .css imports — in + // Next the project MUST inject `plugin` (see docs/security.md). try { const pkg = '@clocklimited/payload-2fa'; const mod = await import(pkg); totp = mod.payloadTotp ?? mod.totpPlugin; } catch (err) { - throw new Error('[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' + 'Best fix — inject it: `import { payloadTotp } from "@clocklimited/payload-2fa"` ' + 'then `twoFactor: { issuer, plugin: payloadTotp }`. Or install it AND add ' + "'@clocklimited/payload-2fa' to serverExternalPackages in next.config. Or set " + `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`); + throw new Error('[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' + 'Inject it (required in Next): `import { payloadTotp } from "@clocklimited/payload-2fa"` ' + 'then `twoFactor: { issuer, plugin: payloadTotp }`. Adding it to ' + 'serverExternalPackages does NOT help (the package imports .css). Or set ' + `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`); } } if (typeof totp !== 'function') { diff --git a/dist/plugin.js.map b/dist/plugin.js.map index f749b15..006b1a4 100644 --- a/dist/plugin.js.map +++ b/dist/plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Config, Plugin } from 'payload'\n\nimport type { IpalOptions, TotpPluginFactory } from './types.js'\nimport { buildLocalizationConfig, validateI18nConfig } from './modules/i18n/index.js'\nimport { injectRoles } from './modules/access/index.js'\nimport { buildSeoPlugin, injectAutoFillMeta, injectSeoTabs } from './modules/seo/index.js'\nimport { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'\nimport { buildSystemPagesFields } from './modules/pages/index.js'\nimport { buildArchiveFields } from './modules/content/index.js'\nimport { buildSiteSettings } from './globals/SiteSettings/index.js'\nimport { buildSiteIntegrations } from './globals/SiteIntegrations/index.js'\nimport { buildCookieSettings } from './globals/CookieSettings/index.js'\nimport { buildNotifications } from './globals/Notifications/index.js'\nimport { testEmailEndpoint } from './modules/email/test/testEmailEndpoint.js'\n\n/**\n * IPAL (Intecion Payload Advanced Library) plugin for Payload CMS 3.\n *\n * @example\n * ```ts\n * import { ipalKit } from 'ipal-kit'\n *\n * export default buildConfig({\n * plugins: [\n * ipalKit({\n * i18n: {\n * locales: [\n * { code: 'pl', label: 'Polski' },\n * { code: 'en', label: 'English' },\n * ],\n * defaultLocale: 'pl',\n * },\n * access: { authCollection: 'users' },\n * }),\n * ],\n * })\n * ```\n */\nexport const ipalKit = (options: IpalOptions): Plugin => {\n // Validate eagerly — fail fast before Payload boots\n validateI18nConfig(options.i18n)\n\n return async (incomingConfig: Config): Promise => {\n // Early return when disabled — schema stays, behavior off\n if (options.enabled === false) {\n return incomingConfig\n }\n\n let config = { ...incomingConfig }\n\n // --- custom admin route (e.g. '/its' instead of '/admin') ---\n // Sets config.routes.admin; the project must move its app/(payload)//\n // folder to match (plugin can't create files in the project's app/).\n if (options.adminRoute) {\n config.routes = { ...(config.routes ?? {}), admin: options.adminRoute }\n }\n\n // --- enforced 2FA (TOTP) via @clocklimited/payload-2fa ---\n // Enforced by default (forceSetup) unless twoFactor is explicitly false. The\n // plugin is a PEER dependency imported dynamically — ipal-kit doesn't bundle\n // it, so projects that opt out (twoFactor: false) needn't install it, and the\n // import never runs under generate:importmap when 2FA is off. Wrapping access\n // control (not just admin UI) means TOTP gates data access — no API bypass.\n if (options.twoFactor !== false) {\n const tf = options.twoFactor\n if (!tf?.issuer) {\n throw new Error(\n '[ipal] twoFactor.issuer is required (name shown in the authenticator ' +\n 'app). Pass twoFactor: { issuer: \"Your Site\" }, or twoFactor: false to ' +\n 'opt out (discouraged).',\n )\n }\n // Prefer the INJECTED plugin factory (recommended): the project imports\n // payloadTotp from @clocklimited/payload-2fa and passes it in. Then the\n // plugin never imports the optional peer itself — no dynamic import, so\n // Next can't fail to bundle it (the cause of \"Cannot find module\n // '@clocklimited/payload-2fa'\" crashing even public frontend pages).\n let totp: TotpPluginFactory | undefined = tf.plugin\n\n if (!totp) {\n // Fallback: dynamic import. Variable specifier dodges the plugin's own\n // TS2307, but Next may NOT trace it into the server bundle — projects\n // using this path MUST add '@clocklimited/payload-2fa' to\n // serverExternalPackages in next.config (see docs/security.md).\n try {\n const pkg = '@clocklimited/payload-2fa'\n const mod = (await import(pkg)) as {\n payloadTotp?: TotpPluginFactory\n totpPlugin?: TotpPluginFactory\n }\n totp = mod.payloadTotp ?? mod.totpPlugin\n } catch (err) {\n throw new Error(\n '[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' +\n 'Best fix — inject it: `import { payloadTotp } from \"@clocklimited/payload-2fa\"` ' +\n 'then `twoFactor: { issuer, plugin: payloadTotp }`. Or install it AND add ' +\n \"'@clocklimited/payload-2fa' to serverExternalPackages in next.config. Or set \" +\n `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`,\n )\n }\n }\n\n if (typeof totp !== 'function') {\n throw new Error(\n '[ipal] 2FA: expected payloadTotp (or totpPlugin) to be a function — check the ' +\n 'injected `plugin` or the installed @clocklimited/payload-2fa version.',\n )\n }\n\n config = await totp({\n collection: tf.collectionSlug ?? 'users',\n forceSetup: true, // ENFORCED — every user must set up TOTP; no opt-out\n totp: { issuer: tf.issuer },\n })(config)\n }\n\n // --- white-label admin branding ---\n // Inject admin.components.graphics.Logo/Icon pointing at the plugin's\n // /admin export. The components read SiteSettings at render, so each client\n // sees their own brand from the panel (no brand in code). Project must run\n // `pnpm generate:importmap` so Payload resolves the component paths.\n if (options.whiteLabel) {\n const wl = options.whiteLabel === true ? {} : options.whiteLabel\n const serverProps: Record = {}\n if (wl.settingsSlug) serverProps.settingsSlug = wl.settingsSlug\n if (wl.nameField) serverProps.nameField = wl.nameField\n const logoProps = { ...serverProps, ...(wl.logoField ? { imageField: wl.logoField } : {}) }\n const iconProps = { ...serverProps, ...(wl.iconField ? { imageField: wl.iconField } : {}) }\n\n // Vendor credit (\"Technology by Intecion.com\") under the nav — on by\n // default, hidden with credit:false, text/url overridable.\n const creditOn = wl.credit !== false\n const creditProps =\n wl.credit && typeof wl.credit === 'object'\n ? {\n ...(wl.credit.text ? { text: wl.credit.text } : {}),\n ...(wl.credit.url ? { url: wl.credit.url } : {}),\n }\n : {}\n\n config.admin = {\n ...(config.admin ?? {}),\n components: {\n ...(config.admin?.components ?? {}),\n graphics: {\n ...(config.admin?.components?.graphics ?? {}),\n Logo: { path: '@intecion/ipal-kit/admin#AdminLogo', serverProps: logoProps },\n Icon: { path: '@intecion/ipal-kit/admin#AdminIcon', serverProps: iconProps },\n },\n ...(creditOn\n ? {\n afterNavLinks: [\n ...(config.admin?.components?.afterNavLinks ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntecionCredit',\n serverProps: { ...creditProps, variant: 'nav' },\n },\n ],\n afterLogin: [\n ...(config.admin?.components?.afterLogin ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntecionCredit',\n serverProps: { ...creditProps, variant: 'login' },\n },\n ],\n }\n : {}),\n },\n ...(wl.titleSuffix\n ? { meta: { ...(config.admin?.meta ?? {}), titleSuffix: wl.titleSuffix } }\n : {}),\n }\n }\n\n // --- i18n ---\n config.localization = buildLocalizationConfig(options.i18n)\n\n // --- access: inject roles into the client's auth collection ---\n if (options.access) {\n config = injectRoles(config, options.access)\n }\n\n // --- seo: apply @payloadcms/plugin-seo directly ---\n // NOTE: apply the plugin function to the config immediately rather than\n // pushing it onto config.plugins. Payload has already iterated the plugins\n // array by the time IPAL runs, so nested plugins added to that list are\n // never executed. Calling the plugin as (config) => config applies its\n // transform now.\n if (options.seo) {\n config = await buildSeoPlugin({ seo: options.seo })(config)\n // Auto-fill empty meta from document content on save\n config = injectAutoFillMeta(config, options.seo)\n // Wrap fields into Content + SEO tabs (replaces plugin-seo's tabbedUI,\n // which breaks when other fields already exist in the collection)\n config = injectSeoTabs(config, options.seo)\n }\n\n // --- forms: apply @payloadcms/plugin-form-builder directly ---\n if (options.forms) {\n config = await buildFormsPlugin(options.forms)(config)\n }\n\n // --- globals ---\n // The System Pages tab collects every \"which page plays this role\"\n // assignment. Composing it here keeps SiteSettings unaware of which modules\n // are enabled — it just renders the fields it's given.\n const systemPageFields = [\n ...(options.pages ? buildSystemPagesFields(options.pages) : []),\n ...(options.content && options.pages\n ? buildArchiveFields(options.content, options.pages.slug)\n : []),\n ]\n\n config.globals = [\n ...(config.globals ?? []),\n buildSiteSettings({\n systemPageFields,\n additionalFields: options.siteSettingsFields,\n }),\n buildSiteIntegrations({ additionalFields: options.integrationsFields }),\n buildCookieSettings(),\n buildNotifications(),\n ]\n\n config.endpoints = [...(config.endpoints ?? []), testEmailEndpoint]\n\n // --- integration alerts on the dashboard (Turnstile status, …) ---\n // Renders nothing while everything works; never throws.\n config.admin = {\n ...(config.admin ?? {}),\n components: {\n ...(config.admin?.components ?? {}),\n beforeDashboard: [\n ...(config.admin?.components?.beforeDashboard ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntegrationAlerts',\n serverProps: { adminRoute: options.adminRoute ?? '/admin' },\n },\n ],\n },\n }\n\n // --- hooks: onInit ---\n const incomingOnInit = config.onInit\n config.onInit = async (payload) => {\n if (incomingOnInit) await incomingOnInit(payload)\n payload.logger.info('[ipal] Plugin initialized.')\n }\n\n return config\n }\n}\n"],"names":["buildLocalizationConfig","validateI18nConfig","injectRoles","buildSeoPlugin","injectAutoFillMeta","injectSeoTabs","buildFormsPlugin","buildSystemPagesFields","buildArchiveFields","buildSiteSettings","buildSiteIntegrations","buildCookieSettings","buildNotifications","testEmailEndpoint","ipalKit","options","i18n","incomingConfig","enabled","config","adminRoute","routes","admin","twoFactor","tf","issuer","Error","totp","plugin","pkg","mod","payloadTotp","totpPlugin","err","String","collection","collectionSlug","forceSetup","whiteLabel","wl","serverProps","settingsSlug","nameField","logoProps","logoField","imageField","iconProps","iconField","creditOn","credit","creditProps","text","url","components","graphics","Logo","path","Icon","afterNavLinks","variant","afterLogin","titleSuffix","meta","localization","access","seo","forms","systemPageFields","pages","content","slug","globals","additionalFields","siteSettingsFields","integrationsFields","endpoints","beforeDashboard","incomingOnInit","onInit","payload","logger","info"],"mappings":"AAGA,SAASA,uBAAuB,EAAEC,kBAAkB,QAAQ,0BAAyB;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AAE+B,cAAc,CAAC,CAAC;gBAClCuB,iBAAiB;uBACXzD,OAAOG,KAAK,EAAE+B,YAAYuB,mBAAmB,EAAE;oBACnD;wBACEpB,MAAM;wBACNhB,aAAa;4BAAEpB,YAAYL,QAAQK,UAAU,IAAI;wBAAS;oBAC5D;iBACD;YACH;QACF;QAEA,wBAAwB;QACxB,MAAMyD,iBAAiB1D,OAAO2D,MAAM;QACpC3D,OAAO2D,MAAM,GAAG,OAAOC;YACrB,IAAIF,gBAAgB,MAAMA,eAAeE;YACzCA,QAAQC,MAAM,CAACC,IAAI,CAAC;QACtB;QAEA,OAAO9D;IACT;AACF,EAAC"} \ No newline at end of file +{"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["import type { Config, Plugin } from 'payload'\n\nimport type { IpalOptions, TotpPluginFactory } from './types.js'\nimport { buildLocalizationConfig, validateI18nConfig } from './modules/i18n/index.js'\nimport { injectRoles } from './modules/access/index.js'\nimport { buildSeoPlugin, injectAutoFillMeta, injectSeoTabs } from './modules/seo/index.js'\nimport { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'\nimport { buildSystemPagesFields } from './modules/pages/index.js'\nimport { buildArchiveFields } from './modules/content/index.js'\nimport { buildSiteSettings } from './globals/SiteSettings/index.js'\nimport { buildSiteIntegrations } from './globals/SiteIntegrations/index.js'\nimport { buildCookieSettings } from './globals/CookieSettings/index.js'\nimport { buildNotifications } from './globals/Notifications/index.js'\nimport { testEmailEndpoint } from './modules/email/test/testEmailEndpoint.js'\n\n/**\n * IPAL (Intecion Payload Advanced Library) plugin for Payload CMS 3.\n *\n * @example\n * ```ts\n * import { ipalKit } from 'ipal-kit'\n *\n * export default buildConfig({\n * plugins: [\n * ipalKit({\n * i18n: {\n * locales: [\n * { code: 'pl', label: 'Polski' },\n * { code: 'en', label: 'English' },\n * ],\n * defaultLocale: 'pl',\n * },\n * access: { authCollection: 'users' },\n * }),\n * ],\n * })\n * ```\n */\nexport const ipalKit = (options: IpalOptions): Plugin => {\n // Validate eagerly — fail fast before Payload boots\n validateI18nConfig(options.i18n)\n\n return async (incomingConfig: Config): Promise => {\n // Early return when disabled — schema stays, behavior off\n if (options.enabled === false) {\n return incomingConfig\n }\n\n let config = { ...incomingConfig }\n\n // --- custom admin route (e.g. '/its' instead of '/admin') ---\n // Sets config.routes.admin; the project must move its app/(payload)//\n // folder to match (plugin can't create files in the project's app/).\n if (options.adminRoute) {\n config.routes = { ...(config.routes ?? {}), admin: options.adminRoute }\n }\n\n // --- enforced 2FA (TOTP) via @clocklimited/payload-2fa ---\n // Enforced by default (forceSetup) unless twoFactor is explicitly false. The\n // plugin is a PEER dependency imported dynamically — ipal-kit doesn't bundle\n // it, so projects that opt out (twoFactor: false) needn't install it, and the\n // import never runs under generate:importmap when 2FA is off. Wrapping access\n // control (not just admin UI) means TOTP gates data access — no API bypass.\n if (options.twoFactor !== false) {\n const tf = options.twoFactor\n if (!tf?.issuer) {\n throw new Error(\n '[ipal] twoFactor.issuer is required (name shown in the authenticator ' +\n 'app). Pass twoFactor: { issuer: \"Your Site\" }, or twoFactor: false to ' +\n 'opt out (discouraged).',\n )\n }\n // Prefer the INJECTED plugin factory (recommended): the project imports\n // payloadTotp from @clocklimited/payload-2fa and passes it in. Then the\n // plugin never imports the optional peer itself — no dynamic import, so\n // Next can't fail to bundle it (the cause of \"Cannot find module\n // '@clocklimited/payload-2fa'\" crashing even public frontend pages).\n let totp: TotpPluginFactory | undefined = tf.plugin\n\n if (!totp) {\n // Fallback: dynamic import, resolvable because the package is an optional\n // peer. Variable specifier dodges the plugin's own TS2307. Works only\n // outside Next (payload CLI): webpack turns it into an empty context, and\n // serverExternalPackages fails on the package's own .css imports — in\n // Next the project MUST inject `plugin` (see docs/security.md).\n try {\n const pkg = '@clocklimited/payload-2fa'\n const mod = (await import(pkg)) as {\n payloadTotp?: TotpPluginFactory\n totpPlugin?: TotpPluginFactory\n }\n totp = mod.payloadTotp ?? mod.totpPlugin\n } catch (err) {\n throw new Error(\n '[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' +\n 'Inject it (required in Next): `import { payloadTotp } from \"@clocklimited/payload-2fa\"` ' +\n 'then `twoFactor: { issuer, plugin: payloadTotp }`. Adding it to ' +\n 'serverExternalPackages does NOT help (the package imports .css). Or set ' +\n `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`,\n )\n }\n }\n\n if (typeof totp !== 'function') {\n throw new Error(\n '[ipal] 2FA: expected payloadTotp (or totpPlugin) to be a function — check the ' +\n 'injected `plugin` or the installed @clocklimited/payload-2fa version.',\n )\n }\n\n config = await totp({\n collection: tf.collectionSlug ?? 'users',\n forceSetup: true, // ENFORCED — every user must set up TOTP; no opt-out\n totp: { issuer: tf.issuer },\n })(config)\n }\n\n // --- white-label admin branding ---\n // Inject admin.components.graphics.Logo/Icon pointing at the plugin's\n // /admin export. The components read SiteSettings at render, so each client\n // sees their own brand from the panel (no brand in code). Project must run\n // `pnpm generate:importmap` so Payload resolves the component paths.\n if (options.whiteLabel) {\n const wl = options.whiteLabel === true ? {} : options.whiteLabel\n const serverProps: Record = {}\n if (wl.settingsSlug) serverProps.settingsSlug = wl.settingsSlug\n if (wl.nameField) serverProps.nameField = wl.nameField\n const logoProps = { ...serverProps, ...(wl.logoField ? { imageField: wl.logoField } : {}) }\n const iconProps = { ...serverProps, ...(wl.iconField ? { imageField: wl.iconField } : {}) }\n\n // Vendor credit (\"Technology by Intecion.com\") under the nav — on by\n // default, hidden with credit:false, text/url overridable.\n const creditOn = wl.credit !== false\n const creditProps =\n wl.credit && typeof wl.credit === 'object'\n ? {\n ...(wl.credit.text ? { text: wl.credit.text } : {}),\n ...(wl.credit.url ? { url: wl.credit.url } : {}),\n }\n : {}\n\n config.admin = {\n ...(config.admin ?? {}),\n components: {\n ...(config.admin?.components ?? {}),\n graphics: {\n ...(config.admin?.components?.graphics ?? {}),\n Logo: { path: '@intecion/ipal-kit/admin#AdminLogo', serverProps: logoProps },\n Icon: { path: '@intecion/ipal-kit/admin#AdminIcon', serverProps: iconProps },\n },\n ...(creditOn\n ? {\n afterNavLinks: [\n ...(config.admin?.components?.afterNavLinks ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntecionCredit',\n serverProps: { ...creditProps, variant: 'nav' },\n },\n ],\n afterLogin: [\n ...(config.admin?.components?.afterLogin ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntecionCredit',\n serverProps: { ...creditProps, variant: 'login' },\n },\n ],\n }\n : {}),\n },\n ...(wl.titleSuffix\n ? { meta: { ...(config.admin?.meta ?? {}), titleSuffix: wl.titleSuffix } }\n : {}),\n }\n }\n\n // --- i18n ---\n config.localization = buildLocalizationConfig(options.i18n)\n\n // --- access: inject roles into the client's auth collection ---\n if (options.access) {\n config = injectRoles(config, options.access)\n }\n\n // --- seo: apply @payloadcms/plugin-seo directly ---\n // NOTE: apply the plugin function to the config immediately rather than\n // pushing it onto config.plugins. Payload has already iterated the plugins\n // array by the time IPAL runs, so nested plugins added to that list are\n // never executed. Calling the plugin as (config) => config applies its\n // transform now.\n if (options.seo) {\n config = await buildSeoPlugin({ seo: options.seo })(config)\n // Auto-fill empty meta from document content on save\n config = injectAutoFillMeta(config, options.seo)\n // Wrap fields into Content + SEO tabs (replaces plugin-seo's tabbedUI,\n // which breaks when other fields already exist in the collection)\n config = injectSeoTabs(config, options.seo)\n }\n\n // --- forms: apply @payloadcms/plugin-form-builder directly ---\n if (options.forms) {\n config = await buildFormsPlugin(options.forms)(config)\n }\n\n // --- globals ---\n // The System Pages tab collects every \"which page plays this role\"\n // assignment. Composing it here keeps SiteSettings unaware of which modules\n // are enabled — it just renders the fields it's given.\n const systemPageFields = [\n ...(options.pages ? buildSystemPagesFields(options.pages) : []),\n ...(options.content && options.pages\n ? buildArchiveFields(options.content, options.pages.slug)\n : []),\n ]\n\n config.globals = [\n ...(config.globals ?? []),\n buildSiteSettings({\n systemPageFields,\n additionalFields: options.siteSettingsFields,\n }),\n buildSiteIntegrations({ additionalFields: options.integrationsFields }),\n buildCookieSettings(),\n buildNotifications(),\n ]\n\n config.endpoints = [...(config.endpoints ?? []), testEmailEndpoint]\n\n // --- integration alerts on the dashboard (Turnstile status, …) ---\n // Renders nothing while everything works; never throws.\n config.admin = {\n ...(config.admin ?? {}),\n components: {\n ...(config.admin?.components ?? {}),\n beforeDashboard: [\n ...(config.admin?.components?.beforeDashboard ?? []),\n {\n path: '@intecion/ipal-kit/admin#IntegrationAlerts',\n serverProps: { adminRoute: options.adminRoute ?? '/admin' },\n },\n ],\n },\n }\n\n // --- hooks: onInit ---\n const incomingOnInit = config.onInit\n config.onInit = async (payload) => {\n if (incomingOnInit) await incomingOnInit(payload)\n payload.logger.info('[ipal] Plugin initialized.')\n }\n\n return config\n }\n}\n"],"names":["buildLocalizationConfig","validateI18nConfig","injectRoles","buildSeoPlugin","injectAutoFillMeta","injectSeoTabs","buildFormsPlugin","buildSystemPagesFields","buildArchiveFields","buildSiteSettings","buildSiteIntegrations","buildCookieSettings","buildNotifications","testEmailEndpoint","ipalKit","options","i18n","incomingConfig","enabled","config","adminRoute","routes","admin","twoFactor","tf","issuer","Error","totp","plugin","pkg","mod","payloadTotp","totpPlugin","err","String","collection","collectionSlug","forceSetup","whiteLabel","wl","serverProps","settingsSlug","nameField","logoProps","logoField","imageField","iconProps","iconField","creditOn","credit","creditProps","text","url","components","graphics","Logo","path","Icon","afterNavLinks","variant","afterLogin","titleSuffix","meta","localization","access","seo","forms","systemPageFields","pages","content","slug","globals","additionalFields","siteSettingsFields","integrationsFields","endpoints","beforeDashboard","incomingOnInit","onInit","payload","logger","info"],"mappings":"AAGA,SAASA,uBAAuB,EAAEC,kBAAkB,QAAQ,0BAAyB;AACrF,SAASC,WAAW,QAAQ,4BAA2B;AACvD,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,aAAa,QAAQ,yBAAwB;AAC1F,SAASC,gBAAgB,QAAQ,uCAAsC;AACvE,SAASC,sBAAsB,QAAQ,2BAA0B;AACjE,SAASC,kBAAkB,QAAQ,6BAA4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ACD;YACH;QACF;QAEA,wBAAwB;QACxB,MAAMyD,iBAAiB1D,OAAO2D,MAAM;QACpC3D,OAAO2D,MAAM,GAAG,OAAOC;YACrB,IAAIF,gBAAgB,MAAMA,eAAeE;YACzCA,QAAQC,MAAM,CAACC,IAAI,CAAC;QACtB;QAEA,OAAO9D;IACT;AACF,EAAC"} \ No newline at end of file diff --git a/dist/types.d.ts b/dist/types.d.ts index 53aa9d2..f476bff 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -1,10 +1,13 @@ -import type { Field, Plugin } from 'payload'; +import type { CollectionSlug, Field, Plugin } from 'payload'; /** * Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected - * so the plugin never imports the optional peer itself. + * so the plugin never imports the optional peer itself. `collection` is + * `CollectionSlug` (not `string`): payloadTotp requires it, and in a project + * with generated payload-types it's a narrowed union — `string` would make + * `plugin: payloadTotp` fail to type-check. */ export type TotpPluginFactory = (options: { - collection: string; + collection: CollectionSlug; forceSetup: boolean; totp: { issuer: string; @@ -79,19 +82,19 @@ export type IpalOptions = { */ twoFactor?: { /** Auth collection slug. Defaults to 'users'. */ - collectionSlug?: string; + collectionSlug?: CollectionSlug; /** Name shown in the authenticator app (e.g. company/site name). */ issuer: string; /** * The 2FA plugin factory, INJECTED from the project: - * `import { payloadTotp } from '@clocklimited/payload-2fa'`. Strongly - * recommended — injecting it (the same pattern as NextResponse / - * revalidatePath) means the plugin never dynamically imports the - * optional peer, which Next can fail to bundle into the server chunks - * ("Cannot find module '@clocklimited/payload-2fa'" at runtime, even on - * public frontend pages). If omitted, the plugin falls back to a dynamic - * import and you MUST add '@clocklimited/payload-2fa' to - * serverExternalPackages in next.config. See docs/security.md. + * `import { payloadTotp } from '@clocklimited/payload-2fa'`. REQUIRED in + * Next — injecting it (the same pattern as NextResponse / revalidatePath) + * means the plugin never dynamically imports the optional peer, which + * Next can't bundle ("Cannot find module '@clocklimited/payload-2fa'", + * even on public frontend pages). serverExternalPackages is no fix: the + * package imports its own .css, which Node can't load. If omitted, the + * plugin falls back to a dynamic import — works only outside Next + * (payload CLI). See docs/security.md. */ plugin?: TotpPluginFactory; } | false; diff --git a/dist/types.js.map b/dist/types.js.map index 26a303d..054cf6c 100644 --- a/dist/types.js.map +++ b/dist/types.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Field, Plugin } from 'payload'\n\n/**\n * Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected\n * so the plugin never imports the optional peer itself.\n */\nexport type TotpPluginFactory = (options: {\n collection: string\n forceSetup: boolean\n totp: { issuer: string }\n}) => Plugin\nimport type { AccessOption } from './modules/access/types.js'\nimport type { ContentOption } from './modules/content/types.js'\nimport type { FormsOption } from './modules/forms/types.js'\nimport type { I18nConfig } from './modules/i18n/types.js'\nimport type { PagesOption } from './modules/pages/types.js'\nimport type { SeoOption } from './modules/seo/types.js'\n\n/**\n * Configuration options for the IPAL plugin.\n * Passed by the client project in payload.config.ts.\n */\nexport type IpalOptions = {\n /**\n * Role-based access control. Injects a fixed `roles` field\n * (admin > editor > user) into the client's auth collection.\n */\n access?: AccessOption\n\n /**\n * Custom admin panel route, e.g. '/its' instead of the default '/admin'.\n * The plugin sets config.routes.admin. IMPORTANT: this alone isn't enough —\n * the project must ALSO move its panel folder to match:\n * app/(payload)/its/[[...segments]]/page.tsx (and the not-found). The plugin\n * can't create files in the project's app/. See docs/security.md.\n *\n * This is obscurity, not security: it hides the panel from dumb bots scanning\n * /admin, but real protection is strong auth + 2FA + rate limiting.\n */\n adminRoute?: string\n\n /**\n * Collections whose entries live under an archive page — blog posts, case\n * studies, anything with a listing. Adds an \"archive page\" assignment per\n * collection in SiteSettings; the assigned page's localized slug becomes the\n * URL segment (/pl/artykuly/moj-post, /en/articles/my-post). Requires `pages`.\n */\n content?: ContentOption\n\n /** Disable the plugin without uninstalling (keeps DB schema intact) */\n enabled?: boolean\n\n /**\n * Forms — form-builder collections (forms, form-submissions) plus the\n * callable submitForm (Turnstile + persistence + SMTP-from-panel email).\n */\n forms?: FormsOption\n\n /** Internationalization — locales, default locale, fallback behavior */\n i18n: I18nConfig\n\n /** Additional fields injected into SiteIntegrations global */\n integrationsFields?: Field[]\n\n /**\n * System-page assignments (homepage, privacy, cookies) in SiteSettings.\n * Provide the slug of the client's Pages collection to enable.\n */\n pages?: PagesOption\n\n /**\n * SEO — adds meta fields to chosen collections (via @payloadcms/plugin-seo)\n * and enables locale-aware metadata helpers.\n */\n seo?: SeoOption\n\n /** Additional fields injected into SiteSettings global */\n siteSettingsFields?: Field[]\n\n /**\n * Two-factor authentication (TOTP), ENFORCED for every user. Wires\n * @clocklimited/payload-2fa with forceSetup — no per-project opt-out. Every\n * user must configure an authenticator app after login; TOTP is checked before\n * data access (not just the admin UI). Requires the peer dep installed and an\n * issuer name (shown in the authenticator app).\n *\n * Pass `false` ONLY for a project that genuinely can't use 2FA (rare, discouraged)\n * — default is enforced. See docs/security.md.\n */\n twoFactor?:\n | {\n /** Auth collection slug. Defaults to 'users'. */\n collectionSlug?: string\n /** Name shown in the authenticator app (e.g. company/site name). */\n issuer: string\n /**\n * The 2FA plugin factory, INJECTED from the project:\n * `import { payloadTotp } from '@clocklimited/payload-2fa'`. Strongly\n * recommended — injecting it (the same pattern as NextResponse /\n * revalidatePath) means the plugin never dynamically imports the\n * optional peer, which Next can fail to bundle into the server chunks\n * (\"Cannot find module '@clocklimited/payload-2fa'\" at runtime, even on\n * public frontend pages). If omitted, the plugin falls back to a dynamic\n * import and you MUST add '@clocklimited/payload-2fa' to\n * serverExternalPackages in next.config. See docs/security.md.\n */\n plugin?: TotpPluginFactory\n }\n | false\n\n /**\n * White-label the admin panel: show the CLIENT's brand (logo + name) in the\n * admin — login screen and nav — pulled from SiteSettings, set by the editor\n * in the panel (no brand hardcoded in code). `true` wires it with defaults\n * (SiteSettings `logo`/`favicon`/`siteName`); the object form overrides the\n * global slug, field names, or the browser-tab title suffix.\n *\n * Injects admin.components.graphics.Logo/Icon pointing at\n * `@intecion/ipal-kit/admin`. After enabling, run `pnpm generate:importmap`\n * so Payload can resolve the components. See docs/white-label.md.\n */\n whiteLabel?:\n | {\n /**\n * Vendor credit (\"Technology by Intecion.com\") at the bottom of the\n * admin nav. Default on; `false` hides it, or override text/url.\n */\n credit?:\n | {\n text?: string\n url?: string\n }\n | boolean\n /** Upload field for the small nav icon. Default 'favicon'. */\n iconField?: string\n /** Upload field for the login/nav logo. Default 'logo'. */\n logoField?: string\n /** Field with the site name. Default 'siteName'. */\n nameField?: string\n /** SiteSettings global slug. Default 'site-settings'. */\n settingsSlug?: string\n /** Static browser-tab title suffix (e.g. ' · Acme Admin'). */\n titleSuffix?: string\n }\n | boolean\n}\n"],"names":[],"mappings":"AAkBA;;;CAGC,GACD,WA2HC"} \ No newline at end of file +{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { CollectionSlug, Field, Plugin } from 'payload'\n\n/**\n * Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected\n * so the plugin never imports the optional peer itself. `collection` is\n * `CollectionSlug` (not `string`): payloadTotp requires it, and in a project\n * with generated payload-types it's a narrowed union — `string` would make\n * `plugin: payloadTotp` fail to type-check.\n */\nexport type TotpPluginFactory = (options: {\n collection: CollectionSlug\n forceSetup: boolean\n totp: { issuer: string }\n}) => Plugin\nimport type { AccessOption } from './modules/access/types.js'\nimport type { ContentOption } from './modules/content/types.js'\nimport type { FormsOption } from './modules/forms/types.js'\nimport type { I18nConfig } from './modules/i18n/types.js'\nimport type { PagesOption } from './modules/pages/types.js'\nimport type { SeoOption } from './modules/seo/types.js'\n\n/**\n * Configuration options for the IPAL plugin.\n * Passed by the client project in payload.config.ts.\n */\nexport type IpalOptions = {\n /**\n * Role-based access control. Injects a fixed `roles` field\n * (admin > editor > user) into the client's auth collection.\n */\n access?: AccessOption\n\n /**\n * Custom admin panel route, e.g. '/its' instead of the default '/admin'.\n * The plugin sets config.routes.admin. IMPORTANT: this alone isn't enough —\n * the project must ALSO move its panel folder to match:\n * app/(payload)/its/[[...segments]]/page.tsx (and the not-found). The plugin\n * can't create files in the project's app/. See docs/security.md.\n *\n * This is obscurity, not security: it hides the panel from dumb bots scanning\n * /admin, but real protection is strong auth + 2FA + rate limiting.\n */\n adminRoute?: string\n\n /**\n * Collections whose entries live under an archive page — blog posts, case\n * studies, anything with a listing. Adds an \"archive page\" assignment per\n * collection in SiteSettings; the assigned page's localized slug becomes the\n * URL segment (/pl/artykuly/moj-post, /en/articles/my-post). Requires `pages`.\n */\n content?: ContentOption\n\n /** Disable the plugin without uninstalling (keeps DB schema intact) */\n enabled?: boolean\n\n /**\n * Forms — form-builder collections (forms, form-submissions) plus the\n * callable submitForm (Turnstile + persistence + SMTP-from-panel email).\n */\n forms?: FormsOption\n\n /** Internationalization — locales, default locale, fallback behavior */\n i18n: I18nConfig\n\n /** Additional fields injected into SiteIntegrations global */\n integrationsFields?: Field[]\n\n /**\n * System-page assignments (homepage, privacy, cookies) in SiteSettings.\n * Provide the slug of the client's Pages collection to enable.\n */\n pages?: PagesOption\n\n /**\n * SEO — adds meta fields to chosen collections (via @payloadcms/plugin-seo)\n * and enables locale-aware metadata helpers.\n */\n seo?: SeoOption\n\n /** Additional fields injected into SiteSettings global */\n siteSettingsFields?: Field[]\n\n /**\n * Two-factor authentication (TOTP), ENFORCED for every user. Wires\n * @clocklimited/payload-2fa with forceSetup — no per-project opt-out. Every\n * user must configure an authenticator app after login; TOTP is checked before\n * data access (not just the admin UI). Requires the peer dep installed and an\n * issuer name (shown in the authenticator app).\n *\n * Pass `false` ONLY for a project that genuinely can't use 2FA (rare, discouraged)\n * — default is enforced. See docs/security.md.\n */\n twoFactor?:\n | {\n /** Auth collection slug. Defaults to 'users'. */\n collectionSlug?: CollectionSlug\n /** Name shown in the authenticator app (e.g. company/site name). */\n issuer: string\n /**\n * The 2FA plugin factory, INJECTED from the project:\n * `import { payloadTotp } from '@clocklimited/payload-2fa'`. REQUIRED in\n * Next — injecting it (the same pattern as NextResponse / revalidatePath)\n * means the plugin never dynamically imports the optional peer, which\n * Next can't bundle (\"Cannot find module '@clocklimited/payload-2fa'\",\n * even on public frontend pages). serverExternalPackages is no fix: the\n * package imports its own .css, which Node can't load. If omitted, the\n * plugin falls back to a dynamic import — works only outside Next\n * (payload CLI). See docs/security.md.\n */\n plugin?: TotpPluginFactory\n }\n | false\n\n /**\n * White-label the admin panel: show the CLIENT's brand (logo + name) in the\n * admin — login screen and nav — pulled from SiteSettings, set by the editor\n * in the panel (no brand hardcoded in code). `true` wires it with defaults\n * (SiteSettings `logo`/`favicon`/`siteName`); the object form overrides the\n * global slug, field names, or the browser-tab title suffix.\n *\n * Injects admin.components.graphics.Logo/Icon pointing at\n * `@intecion/ipal-kit/admin`. After enabling, run `pnpm generate:importmap`\n * so Payload can resolve the components. See docs/white-label.md.\n */\n whiteLabel?:\n | {\n /**\n * Vendor credit (\"Technology by Intecion.com\") at the bottom of the\n * admin nav. Default on; `false` hides it, or override text/url.\n */\n credit?:\n | {\n text?: string\n url?: string\n }\n | boolean\n /** Upload field for the small nav icon. Default 'favicon'. */\n iconField?: string\n /** Upload field for the login/nav logo. Default 'logo'. */\n logoField?: string\n /** Field with the site name. Default 'siteName'. */\n nameField?: string\n /** SiteSettings global slug. Default 'site-settings'. */\n settingsSlug?: string\n /** Static browser-tab title suffix (e.g. ' · Acme Admin'). */\n titleSuffix?: string\n }\n | boolean\n}\n"],"names":[],"mappings":"AAqBA;;;CAGC,GACD,WA2HC"} \ No newline at end of file diff --git a/docs/agent/skills/ipal-debug/SKILL.md b/docs/agent/skills/ipal-debug/SKILL.md index ffd3a71..8a692d9 100644 --- a/docs/agent/skills/ipal-debug/SKILL.md +++ b/docs/agent/skills/ipal-debug/SKILL.md @@ -37,7 +37,8 @@ tej procedury. Pytasz tylko, gdy brakuje czegoś, czego nie możesz uzyskać sam | `TS2307 next/navigation` w `dist` pluginu | import bez `.js` w kliencie pluginu (NodeNext) | **bug ipal-kit** → plugin-gap; plugin importuje `'next/navigation.js'` | | `TS2307 @payloadcms/storage-s3` | brak pakietu przy `buildR2Storage` | `pnpm add @payloadcms/storage-s3` + `buildR2Storage(['media'], { s3Storage })` | | `does not provide an export named X` / `X is not a function` | symbol nie wyeksportowany z entry pointu albo zły subpath (`/client` vs root vs `/server` vs `/rsc`) | `docs/README.md` → właściwy import; brak w każdym entry → **bug ipal-kit** (eksport) | -| `Cannot find module '@clocklimited/payload-2fa'` | brak wstrzyknięcia | `twoFactor: { plugin: payloadTotp }` | +| `Cannot find module '@clocklimited/payload-2fa'` | brak wstrzyknięcia | `twoFactor: { plugin: payloadTotp }` (`serverExternalPackages` nie pomaga — pada na `.css`) | +| `TS2322` przy `plugin: payloadTotp` (`string` vs `CollectionSlug`) | ipal-kit ≤ 1.8.13 typował `collection` jako `string` | zaktualizuj ipal-kit; usuń adapter/rzutowanie | | `Page changed from static to dynamic at runtime` | `headers()`, `cookies()`, `searchParams` w drzewie strony (często `not-found.tsx`) | locale z `params`; `not-found` → `LocaleView` (pages.md); `headers()` tylko w server actions / route handlers | | trasy `ƒ` mimo `generateStaticParams` | build nie widzi bazy | `DATABASE_URI` w buildzie (PROGRAMISTA §4.3) | | build pada `ENOTFOUND` / Mongoose | trasa czyta bazę w buildzie bez bazy | sitemap/robots/llms: `export const dynamic = 'force-dynamic'` (tylko one) | @@ -85,6 +86,7 @@ tej procedury. Pytasz tylko, gdy brakuje czegoś, czego nie możesz uzyskać sam |---|---|---| | zmiana w pluginie niewidoczna | stara wersja w `node_modules` / `.next` | `pnpm add @intecion/ipal-kit@`, `grep -c node_modules/@intecion/ipal-kit/dist/...`, `rm -rf .next`, restart | | skille nieaktualne po aktualizacji | nie odświeżone | `pnpm exec ipal-skills` | +| `ipal-skills: command not found` | ipal-kit ≤ 1.8.13 nie publikował `bin` | zaktualizuj ipal-kit | | „Kod dobry, zachowanie złe” | — | po kolei: restart dev → Save w panelu → dublet zależności → importmap → cache | ## Kiedy to bug ipal-kit (raport, nie łatka w node_modules) diff --git a/docs/dev/PROGRAMISTA.md b/docs/dev/PROGRAMISTA.md index 88b543a..6c6170d 100644 --- a/docs/dev/PROGRAMISTA.md +++ b/docs/dev/PROGRAMISTA.md @@ -480,6 +480,7 @@ Rób po jednej pozycji, buduj, sprawdzaj. Kolejność wg wagi: | 12 | Skrypty firm trzecich bez zgody | `ConsentScript` / `Analytics` | consent.md, analytics.md | | 13 | Brak health checku | `createHealthRoute` (§2.8) | — | | 14 | 2FA crash „Cannot find module” | wstrzyknij `plugin: payloadTotp` | security.md | +| 14a | obejścia z ≤ 1.8.13: adapter `payloadTotp` z rzutowaniem na `CollectionSlug`, `'@clocklimited/payload-2fa'` w `serverExternalPackages` | usuń — `plugin: payloadTotp` wprost, bez wpisu w `next.config` | security.md | | 15 | Pola `ctaLabel`/`pdfUrl`, sekcje-monolity | refaktor wg AGENT.md §6.7 (z migracją danych!) | AGENT.md | | 15a | `buildR2Storage(['media'])` bez adaptera (od 1.8.1 błąd przy env R2) | `pnpm add @payloadcms/storage-s3`, `buildR2Storage(['media'], { s3Storage })` | storage.md | | 15b | `src/fields/link.ts`, `src/lib/links.ts` w projekcie | importy z pluginu, usuń kopie (bez migracji bazy) | links.md | @@ -511,7 +512,8 @@ Po aktualizacji pakietu: `pnpm ipal:skills` (nowe wersje skilli), `pnpm payload | Pusty tab SEO, brak kolekcji Forms | rozjazd wersji `@payloadcms/*` — `pnpm.overrides` | | `PayloadComponent not found in importMap` | `pnpm payload generate:importmap` | | `Cannot destructure property 'config'` | dublet `@payloadcms/ui` w pluginie — `ls node_modules/@intecion/ipal-kit/node_modules/@payloadcms/ui` | -| `Cannot find module '@clocklimited/payload-2fa'` | wstrzyknij `plugin: payloadTotp` w `twoFactor` | +| `Cannot find module '@clocklimited/payload-2fa'` | wstrzyknij `plugin: payloadTotp` w `twoFactor` (`serverExternalPackages` nie pomaga) | +| `TS2322` przy `plugin: payloadTotp` / `ipal-skills: command not found` | ipal-kit ≤ 1.8.13 — zaktualizuj | | `[ipal] R2 storage: … adapter was not injected` | `pnpm add @payloadcms/storage-s3` + `buildR2Storage(['media'], { s3Storage })` | | Baner bez stylów | brak Tailwinda albo `@source` na plugin | | `/admin`, `/_next` → 500 | matcher proxy nie jest literałem inline | diff --git a/docs/security.md b/docs/security.md index 184f529..20b6b1d 100644 --- a/docs/security.md +++ b/docs/security.md @@ -263,7 +263,7 @@ Uwaga: pakiet nie ma jeszcze stabilnego 3.0.0 — użyj konkretnej wersji beta (albo `^3.0.0-0`, żeby dopuścić prereleasy). Sam `^3.0.0` da błąd ERR_PNPM_NO_MATCHING_VERSION. -### Konfiguracja (payload.config.ts) — WSTRZYKNIJ plugin (zalecane) +### Konfiguracja (payload.config.ts) — WSTRZYKNIJ plugin (wymagane w Next) ```ts import { payloadTotp } from '@clocklimited/payload-2fa' @@ -280,20 +280,18 @@ ipalKit({ **Dlaczego `plugin: payloadTotp` (wstrzyknięcie):** to ten sam wzorzec co `NextResponse`/`revalidatePath` — projekt podaje peer-dep, plugin go NIE -importuje. Bez tego plugin robi dynamiczny import, którego **Next potrafi nie -wbundlować** do server chunks → błąd runtime **„Cannot find module -'@clocklimited/payload-2fa'"** lecący nawet na publicznych stronach frontu. -Wstrzyknięcie eliminuje ten problem u źródła. +importuje. Bez tego plugin robi dynamiczny import, którego **Next nie +wbundluje** (webpack zamienia import ze zmiennej w pusty kontekst) → błąd +**„Cannot find module '@clocklimited/payload-2fa'"** w `next build` i na każdej +stronie (także publicznej). Build potrafi przy tym przejść „na zielono", bo +`generateStaticParams` łapie błąd — strona jest zepsuta dopiero w runtime. -**Jeśli NIE wstrzykujesz** (zostawiasz dynamiczny import) — MUSISZ dodać pakiet do -`serverExternalPackages` w `next.config`, żeby Next nie próbował go bundlować: - -```ts -// next.config.ts -const nextConfig = { - serverExternalPackages: ['@clocklimited/payload-2fa'], -} -``` +**`serverExternalPackages` NIE jest obejściem.** Pakiet importuje własne +`*.module.css`; po externalizacji ładuje go Node, który nie zna `.css` → +`ERR_UNKNOWN_FILE_EXTENSION` przy zbieraniu danych `/admin`. Jedyna działająca +konfiguracja w Next to wstrzyknięcie. Dynamiczny import zostaje tylko dla +kontekstów bez Next (CLI `payload …`), gdzie pakiet rozwiązuje się jako opcjonalny +peer ipal-kit. Plugin ustawia `forceSetup: true` — każdy użytkownik MUSI skonfigurować TOTP po zalogowaniu. Nie ma opcji „włącz/wyłącz" dla użytkownika. diff --git a/package.json b/package.json index 9b7c8cf..f19c759 100644 --- a/package.json +++ b/package.json @@ -42,9 +42,13 @@ }, "main": "./dist/index.js", "types": "./dist/index.d.ts", + "bin": { + "ipal-skills": "./bin/ipal-skills.mjs" + }, "files": [ "dist", - "docs" + "docs", + "bin" ], "scripts": { "build": "pnpm copyfiles && pnpm build:types && pnpm build:swc", @@ -71,6 +75,7 @@ "slugify": "^1.6.6" }, "peerDependencies": { + "@clocklimited/payload-2fa": "^3.0.0-0", "@payloadcms/plugin-form-builder": "^3.90.2", "@payloadcms/plugin-seo": "^3.90.2", "@payloadcms/richtext-lexical": "^3.90.2", @@ -132,6 +137,9 @@ ] }, "peerDependenciesMeta": { + "@clocklimited/payload-2fa": { + "optional": true + }, "@payloadcms/storage-s3": { "optional": true } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59aa6ad..cec699d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,12 @@ importers: .: dependencies: + '@clocklimited/payload-2fa': + specifier: ^3.0.0-0 + version: 3.0.0-beta.1(@payloadcms/next@3.90.2(@types/react@19.2.14)(graphql@16.14.2)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3))(@payloadcms/translations@3.90.2)(@payloadcms/ui@3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3)) + '@payloadcms/storage-s3': + specifier: ^3.90.2 + version: 3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3) lucide-react: specifier: ^0.400.0 version: 0.400.0(react@19.3.0) @@ -133,6 +139,88 @@ packages: resolution: {integrity: sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==} engines: {node: '>= 16'} + '@aws-sdk/checksums@3.1001.3': + resolution: {integrity: sha512-CcAkVyEUKGngbEqJdVdSc53Iy52+XzVL5NIcTen2BlK8UByNC1DThVtf5VKSrNzyA+SqyTvs+3S+knVBbOUizQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/client-s3@3.1152.0': + resolution: {integrity: sha512-oI1+ZaM6pSOwZazu4nAb7rL8ug7LSjg31tDoJqRB9MooRqqWCf/qvkIZqne1mRA3xK3slg6K0RNWXaJYHbWLvg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/core@3.978.3': + resolution: {integrity: sha512-nslpzUCTI9b2IQMWSd6mSAXldBexPc8rr0d3dXUutXYFLFaTdsHa2GD7sJdsn3PhyjK0O5K8ypd6zi+RXXPVlg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-env@3.972.74': + resolution: {integrity: sha512-rsRJcW2iFUhCgclyD6OSbMEaPl8Eu0qSeRZb2uuCK1ViZ66hl5wOe/p6Vr6MO3b+ydyKgFeqza2p6tZThvILlw==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-http@3.972.76': + resolution: {integrity: sha512-pnKdh0Br7OJPj+7qKjzgTfDTFW0RhEMKXNDR2jv9CAM4oHuG/4z3hRh8KtutLfpmItuRtDbKBmwWkDqHwwAWXw==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-ini@3.973.19': + resolution: {integrity: sha512-kcjvAxqQEV8yuwkX58RelNn3ne65o7JgRWf3Z/gVvbi7Xuw1qSDLJlatrLD76+40cmRxmNkLxBoyp/vAQChQ5g==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-login@3.972.81': + resolution: {integrity: sha512-CeQHSbE2CnVdaHIJ/NayRaCecIER+Pm9faUPkmRATO54rCoMTEPSbVieGHzEwvm1dZM2HIs6qQZCznhayNTWJQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-node@3.972.86': + resolution: {integrity: sha512-WNttSyr6e8innPtBSty//CdnqJcgZN6eAbtw3v/CR2IObz6MYZEo8eusdtuCHJ2ujwFqC2bSPHVyhXGHx8HruQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-process@3.972.74': + resolution: {integrity: sha512-Yj6kZFJQdbR+PygTkqdVLPHHpdDpOS9GCYVcDCuweCRRig9LF24ELQBMfyUw1vspvrZJUfnOGVyMjhaL094ahw==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-sso@3.973.18': + resolution: {integrity: sha512-FnpPhdY4qUGtX/8X6eKxh+uD+9Y19i9FYibgk4SBe0M935s9vocHkHzaxaMNk+YkHmvzgdu8cHA5SCoeU+kkew==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/credential-provider-web-identity@3.972.80': + resolution: {integrity: sha512-TJF25Ndwy2HxcVj6oxMgp8qVlJAawlExHYBXqhuC6Zt2m+A7WpdkjBD6QglNbiArlteYljZHEY3R7KKmno6ISA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/lib-storage@3.1152.0': + resolution: {integrity: sha512-UU1fDLKBd8az+4AmNx30ggnA4D4HolUd1MxT/J6ka76qKcckI0IxjAy6FpX/vwiUf2KDNxxN2YX0cfwjMqzWoQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@aws-sdk/client-s3': ^3.1152.0 + + '@aws-sdk/middleware-sdk-s3@3.972.79': + resolution: {integrity: sha512-UfgAQosf4IEXldMsyntVuHsJnaQzlH6pmkOr6dQy7CaOYSlGz3mWiW4Di7XfQ/kPJP6xE7oMshz1V0E8RqGdRg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/nested-clients@3.997.48': + resolution: {integrity: sha512-B01jdXJtAW/XOiUzGdI2mz67WyEHbGEc9X6Euzw3bjLAa+txTqdZDER4X2FsIEcXzV2ABqudVZ5thali8tCCzQ==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/s3-request-presigner@3.1152.0': + resolution: {integrity: sha512-hddG6iscvmJaToltXuAjyszhIfOe6Fw+Xcy/0V5DslTmX91AH5DKG5VMZdKso+9LK4+8dJbyPxEl2/tT06ySkg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/signature-v4-multi-region@3.996.48': + resolution: {integrity: sha512-cFDXfEbXaGwbnpvR/DyqfxfjxpjXVRVthQLgkwvcfDS5u3+8G9WSj1X1Ag/pTRg/QOeOno1Tq3ycEdrKsCUcOA==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/token-providers@3.1150.0': + resolution: {integrity: sha512-wDU36ofhabZYu+d2KSriyDbwzxNoaOp+4dG0p3qkabk7HeALR5nIWyQbjoyJZLn3iqWkv/xNdyUfbfevDVDzzg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/types@3.974.6': + resolution: {integrity: sha512-v/clNZzZnDxGyvpHMOGpJKVXFAExJzUNAAjaWGdcx8QAcXLGwTaOkw33p5SHAi0YAioK32xB3hWwOekRVfmfKg==} + engines: {node: '>=20.0.0'} + + '@aws-sdk/xml-builder@3.972.41': + resolution: {integrity: sha512-ctjVSyCMegrWfXlx6VqzSBFI6UqmQ5ZlnfMhdLIiWmhoH8UAQxSCP5N3OpG7X3k4LnS7ou74C4mt20+bfTW2aQ==} + engines: {node: '>=20.0.0'} + + '@aws/lambda-invoke-store@0.3.0': + resolution: {integrity: sha512-sl4Bm6yiMNYrZKkqqDFWN0UfnWhlS8ivKxrYl+6t0gCLrqr8y3B2IqZZbFRkfaVVp7C/baApyh71P+LeE1A2sQ==} + engines: {node: '>=18.0.0'} + '@babel/code-frame@7.29.7': resolution: {integrity: sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==} engines: {node: '>=6.9.0'} @@ -207,6 +295,15 @@ packages: '@borewit/text-codec@0.2.2': resolution: {integrity: sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==} + '@clocklimited/payload-2fa@3.0.0-beta.1': + resolution: {integrity: sha512-tNHQ4aNJG5ovgOw+kfBWGeii1tAy+ThNqOpD912pSpDOrAQYVF9pTOJF7SLOslGlTCFKn7PD/Qt2QOXVqgQHIQ==} + engines: {node: ^18.20.2 || >=20.9.0, pnpm: ^10} + peerDependencies: + '@payloadcms/next': ^3.29.0 + '@payloadcms/translations': ^3.29.0 + '@payloadcms/ui': ^3.29.0 + payload: ^3.29.0 + '@date-fns/tz@1.2.0': resolution: {integrity: sha512-LBrd7MiJZ9McsOgxqWX7AaxrDjcFVjWH/tIKJd7pnR7McaslGYOP1QmmiBXdJH/H/yLCT+rcQ7FaPBUxRGUtrg==} @@ -1693,6 +1790,10 @@ packages: cpu: [x64] os: [win32] + '@noble/hashes@2.4.0': + resolution: {integrity: sha512-X5XaVWZIBCT7HHZGm5I7ZQXDwLG+bGXuSrMQAW+7Zvl87h1kmc1ZB1VSRJcpUfoUrGQp4Fkoxm5kZ+Ms+aW+eA==} + engines: {node: '>= 20.19.0'} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1804,6 +1905,13 @@ packages: next: '>=15.2.9 <15.3.0 || >=15.3.9 <15.4.0 || >=15.4.11 <15.5.0 || >=16.3.3 <17.0.0' payload: 3.90.2 + '@payloadcms/plugin-cloud-storage@3.90.2': + resolution: {integrity: sha512-1J3bpaG9jHClTgIvHcJXltcjdsC/bgP/wvtAHW8ZZQPtytS0hR8WrHdzpjyRt+aTgaiTiy5Otz7M07aodwguzw==} + peerDependencies: + payload: 3.90.2 + react: ^19.0.1 || ^19.1.2 || ^19.2.1 + react-dom: ^19.0.1 || ^19.1.2 || ^19.2.1 + '@payloadcms/plugin-form-builder@3.90.2': resolution: {integrity: sha512-NgXup0FvxCVX9gaoV9XRAlBp91cgYcDXgc2upcP0mtXMb7/KRW+rGfsYJ8hs7lbtleBrEJhfzdBYM36x+/4N/w==} peerDependencies: @@ -1829,6 +1937,12 @@ packages: react: ^19.0.1 || ^19.1.2 || ^19.2.1 react-dom: ^19.0.1 || ^19.1.2 || ^19.2.1 + '@payloadcms/storage-s3@3.90.2': + resolution: {integrity: sha512-8fq8N+zfM4gKCENYoCVpP8R6fV00VcogDSu1uTa7EH/NHOpGmyER/WaKxERyZmHHwpE7RUR0ijtu0IeKfUJPiA==} + engines: {node: ^18.20.2 || >=20.9.0} + peerDependencies: + payload: 3.90.2 + '@payloadcms/translations@3.90.2': resolution: {integrity: sha512-BGpXyw22ndzL6URrK28qlk2qIsksH8mbWpU/n8vaTt8W6O87KoniX4lJ82m5o0FR/wjWqzcuVRsE0TNX3/7gHg==} @@ -1997,6 +2111,30 @@ packages: resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} engines: {node: '>=14.16'} + '@smithy/core@3.36.0': + resolution: {integrity: sha512-3hJiwG1F5t1SoXqp/yOCmYXziyx7ZVqF63S5W6YU201e/qwVaHPex+E/3vvyY9a3ORq/b+BydeNZpP2saQ9X2g==} + engines: {node: '>=18.0.0'} + + '@smithy/credential-provider-imds@4.5.2': + resolution: {integrity: sha512-A9uSdn72ozbRUSit0eib0TW7nXuNPlaeM0zcGkJ+nE6tFcSDbnmtwoxbTCFBukVQcszDAyvsd7+rTduPTXpygg==} + engines: {node: '>=18.0.0'} + + '@smithy/fetch-http-handler@5.8.0': + resolution: {integrity: sha512-ycSJu3tFAQ4v04CBB0agqFMVsSQ1iG3yw+SpgxRqKfaURpQD4CZ8Wn0zPMmSnOuTpTh65Vz+EA0rMrw089wvkA==} + engines: {node: '>=18.0.0'} + + '@smithy/node-http-handler@4.12.1': + resolution: {integrity: sha512-ThMkboGeONWXAelq9FvGsuJC4rOi+qyC4/zhUF58xYpxUg5sQKx2VXZYJmtNjr4dSuBJ1HeJXETQILCz3wOHvw==} + engines: {node: '>=18.0.0'} + + '@smithy/signature-v4@5.7.4': + resolution: {integrity: sha512-tHy0K0VtqNd5Y7Y41h0a0Lhh0L1GzC08dTWg0F7vRJWFtTENg7IZikf3wQkanYIRdb7ngoIPMTmqgUi401fEeQ==} + engines: {node: '>=18.0.0'} + + '@smithy/types@4.19.0': + resolution: {integrity: sha512-r7jh49VJxGerfAcTQA6gXcKc+98zOp/tqRwzYjgOE+iSQsP6cEU1hq2QzbuipmP68QtYdY9wKEhiCQZIzHgZ4Q==} + engines: {node: '>=18.0.0'} + '@swc-node/core@1.14.1': resolution: {integrity: sha512-jrt5GUaZUU6cmMS+WTJEvGvaB6j1YNKPHPzC2PUi2BjaFbtxURHj6641Az6xN7b665hNniAIdvjxWcRml5yCnw==} engines: {node: '>= 10'} @@ -2703,6 +2841,9 @@ packages: body-scroll-lock@4.0.0-beta.0: resolution: {integrity: sha512-a7tP5+0Mw3YlUJcGAKUqIBkYYGlYxk2fnCasq/FUph1hadxlTRjF+gAcZksxANnaMnALjxEddmSi/H3OR8ugcQ==} + bowser@2.14.1: + resolution: {integrity: sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==} + brace-expansion@1.1.15: resolution: {integrity: sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==} @@ -2729,6 +2870,9 @@ packages: resolution: {integrity: sha512-WIsKqkSC0ABoBJuT1LEX+2HEvNmNKKgnTAyd0fL8qzK4SH2i9NXg+t08YtdZp/V9IZ33cxe3iV4yM0qg8lMQng==} engines: {node: '>=16.20.1'} + buffer-equal-constant-time@1.0.1: + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -2736,6 +2880,9 @@ packages: resolution: {integrity: sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==} engines: {node: '>=4.0'} + buffer@5.6.0: + resolution: {integrity: sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==} + buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} @@ -2771,6 +2918,10 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} @@ -2815,6 +2966,9 @@ packages: client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + cliui@6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + cliui@7.0.4: resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} @@ -2953,6 +3107,10 @@ packages: supports-color: optional: true + decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + decode-named-character-reference@1.3.0: resolution: {integrity: sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==} @@ -2999,6 +3157,10 @@ packages: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} + detect-file@1.0.0: + resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} + engines: {node: '>=0.10.0'} + detect-indent@7.0.2: resolution: {integrity: sha512-y+8xyqdGLL+6sh0tVeHcfP/QDd8gUgbasolJJpY7NgeQGSZ739bDtSiaiDgtoicy+mtYB81dKLxO9xRhCyIB3A==} engines: {node: '>=12.20'} @@ -3018,6 +3180,9 @@ packages: devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dijkstrajs@1.0.3: + resolution: {integrity: sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==} + doctrine@2.1.0: resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} engines: {node: '>=0.10.0'} @@ -3132,6 +3297,9 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + ecdsa-sig-formatter@1.0.11: + resolution: {integrity: sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==} + electron-to-chromium@1.5.389: resolution: {integrity: sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==} @@ -3496,10 +3664,18 @@ packages: events-universal@1.0.1: resolution: {integrity: sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==} + events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + expand-tilde@2.0.2: + resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} + engines: {node: '>=0.10.0'} + expect-type@1.4.0: resolution: {integrity: sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==} engines: {node: '>=12.0.0'} @@ -3588,6 +3764,9 @@ packages: resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} engines: {node: '>=8'} + find-node-modules@2.1.3: + resolution: {integrity: sha512-UC2I2+nx1ZuOBclWVNdcnbDR5dlrOdVb7xNjmT/lHE+LsgztWks3dG7boJ37yTS/venXw84B/mAW9uHVoC5QRg==} + find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} @@ -3603,6 +3782,10 @@ packages: resolution: {integrity: sha512-+iwzCJ7C5v5KgcBuueqVoNiHVoQpwiUK5XFLjf0affFTep+Wcw93tPvmb8tqujDNmzhBDPddnWV/qgWSXgq+Hg==} engines: {node: '>=12'} + findup-sync@4.0.0: + resolution: {integrity: sha512-6jvvn/12IC4quLBL1KNokxC7wWTvYncaVUYSoxWw7YykPLuRrnv4qdHcSOywOI5RpkOVGeQRtWM8/q+G6W6qfQ==} + engines: {node: '>= 8'} + flat-cache@4.0.1: resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} engines: {node: '>=16'} @@ -3705,6 +3888,14 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + global-modules@1.0.0: + resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} + engines: {node: '>=0.10.0'} + + global-prefix@1.0.2: + resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} + engines: {node: '>=0.10.0'} + globals@14.0.0: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} @@ -3800,6 +3991,10 @@ packages: hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} + homedir-polyfill@1.0.3: + resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} + engines: {node: '>=0.10.0'} + http-cache-semantics@4.2.0: resolution: {integrity: sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==} @@ -3853,6 +4048,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + inspect-with-kind@1.0.5: resolution: {integrity: sha512-MAQUJuIo7Xqk8EVNP+6d3CKq9c80hi4tjIbIAT6lmGW9W6WzlHiu9PS8uSuUYU+Do+j1baiFp3H25XEVxDIG2g==} @@ -4019,6 +4217,10 @@ packages: resolution: {integrity: sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==} engines: {node: '>= 0.4'} + is-windows@1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + is-wsl@3.1.1: resolution: {integrity: sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==} engines: {node: '>=16'} @@ -4097,6 +4299,10 @@ packages: engines: {node: '>=6'} hasBin: true + jsonwebtoken@9.0.3: + resolution: {integrity: sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==} + engines: {node: '>=12', npm: '>=6'} + jsox@1.2.121: resolution: {integrity: sha512-9Ag50tKhpTwS6r5wh3MJSAvpSof0UBr39Pto8OnzFT32Z/pAbxAsKHzyvsyMEHVslELvHyO/4/jaQELHk8wDcw==} hasBin: true @@ -4105,6 +4311,12 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} + jwa@2.0.1: + resolution: {integrity: sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==} + + jws@4.0.1: + resolution: {integrity: sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -4156,9 +4368,30 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lodash.includes@4.3.0: + resolution: {integrity: sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==} + + lodash.isboolean@3.0.3: + resolution: {integrity: sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==} + + lodash.isinteger@4.0.4: + resolution: {integrity: sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==} + + lodash.isnumber@3.0.3: + resolution: {integrity: sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==} + + lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + + lodash.isstring@4.0.1: + resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} + lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + lodash.once@4.1.1: + resolution: {integrity: sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==} + lodash@4.18.1: resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==} @@ -4228,6 +4461,9 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + merge@2.1.1: + resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} + micromark-core-commonmark@2.0.3: resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} @@ -4383,11 +4619,6 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - nanoid@3.3.15: - resolution: {integrity: sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==} - engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} - hasBin: true - nanoid@3.3.20: resolution: {integrity: sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -4523,6 +4754,9 @@ packages: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} + otpauth@9.5.2: + resolution: {integrity: sha512-GQ5emWR/x1tcExT62IBT0UfO95wZzJZyxYOJOGVeQF47SYEN9vmh0vISvDZaNMuFJRG+IaWCKtfm+t9Bfoal6w==} + own-keys@1.0.1: resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==} engines: {node: '>= 0.4'} @@ -4565,6 +4799,10 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + parse-passwd@1.0.0: + resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} + engines: {node: '>=0.10.0'} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -4685,14 +4923,14 @@ packages: resolution: {integrity: sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==} engines: {node: '>=4'} + pngjs@5.0.0: + resolution: {integrity: sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==} + engines: {node: '>=10.13.0'} + possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} - postcss@8.5.16: - resolution: {integrity: sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.5.23: resolution: {integrity: sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==} engines: {node: ^10 || ^12 || >=14} @@ -4745,6 +4983,11 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + qrcode@1.5.4: + resolution: {integrity: sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==} + engines: {node: '>=10.13.0'} + hasBin: true + qs-esm@8.0.1: resolution: {integrity: sha512-eZ7l+0ZVy3He9c85pEM9KEBR9DFA4jrmWvIjm9wpcHvScwc/vgZDl2TNOF0pm0JsWKw24XBUZOY0Wxn7/nvJnw==} engines: {node: '>=18'} @@ -4809,6 +5052,10 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} + readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -4841,6 +5088,9 @@ packages: resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} engines: {node: '>=0.10.0'} + require-main-filename@2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + requireindex@1.2.0: resolution: {integrity: sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==} engines: {node: '>=0.10.5'} @@ -4848,6 +5098,10 @@ packages: resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} + resolve-dir@1.0.1: + resolution: {integrity: sha512-R7uiTjECzvOsWSfdM0QKFNBVFcK27aHOUwdvK53BcW8zqnGdYp0Fbj82cy54+2A4P2tFM22J5kRfe1R+lM/1yg==} + engines: {node: '>=0.10.0'} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -4961,6 +5215,9 @@ packages: server-only@0.0.1: resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} + set-blocking@2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -5093,6 +5350,9 @@ packages: resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==} engines: {node: '>= 0.4'} + stream-browserify@3.0.0: + resolution: {integrity: sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==} + streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -5525,10 +5785,17 @@ packages: resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} engines: {node: '>= 0.4'} + which-module@2.0.1: + resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} + which-typed-array@1.1.22: resolution: {integrity: sha512-fvO4ExWMFsqyhG3AiPAObMuY1lxaqgYcxbc49CNdWDDECOJNgQyvsOWVwbZc+qf3rzRtxojBK+CMEv0Ld5CYpw==} engines: {node: '>= 0.4'} + which@1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -5543,6 +5810,10 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wrap-ansi@6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -5575,6 +5846,9 @@ packages: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} + y18n@4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} @@ -5586,10 +5860,18 @@ packages: resolution: {integrity: sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==} engines: {node: '>= 6'} + yargs-parser@18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} + yargs@15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + yargs@16.2.2: resolution: {integrity: sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==} engines: {node: '>=10'} @@ -5626,6 +5908,190 @@ snapshots: '@types/json-schema': 7.0.15 js-yaml: 4.3.0 + '@aws-sdk/checksums@3.1001.3': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/client-s3@3.1152.0': + dependencies: + '@aws-sdk/checksums': 3.1001.3 + '@aws-sdk/core': 3.978.3 + '@aws-sdk/credential-provider-node': 3.972.86 + '@aws-sdk/middleware-sdk-s3': 3.972.79 + '@aws-sdk/signature-v4-multi-region': 3.996.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/core@3.978.3': + dependencies: + '@aws-sdk/types': 3.974.6 + '@aws-sdk/xml-builder': 3.972.41 + '@aws/lambda-invoke-store': 0.3.0 + '@smithy/core': 3.36.0 + '@smithy/signature-v4': 5.7.4 + '@smithy/types': 4.19.0 + bowser: 2.14.1 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-env@3.972.74': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-http@3.972.76': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-ini@3.973.19': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/credential-provider-env': 3.972.74 + '@aws-sdk/credential-provider-http': 3.972.76 + '@aws-sdk/credential-provider-login': 3.972.81 + '@aws-sdk/credential-provider-process': 3.972.74 + '@aws-sdk/credential-provider-sso': 3.973.18 + '@aws-sdk/credential-provider-web-identity': 3.972.80 + '@aws-sdk/nested-clients': 3.997.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/credential-provider-imds': 4.5.2 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-login@3.972.81': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/nested-clients': 3.997.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-node@3.972.86': + dependencies: + '@aws-sdk/credential-provider-env': 3.972.74 + '@aws-sdk/credential-provider-http': 3.972.76 + '@aws-sdk/credential-provider-ini': 3.973.19 + '@aws-sdk/credential-provider-process': 3.972.74 + '@aws-sdk/credential-provider-sso': 3.973.18 + '@aws-sdk/credential-provider-web-identity': 3.972.80 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/credential-provider-imds': 4.5.2 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-process@3.972.74': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-sso@3.973.18': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/nested-clients': 3.997.48 + '@aws-sdk/token-providers': 3.1150.0 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/credential-provider-web-identity@3.972.80': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/nested-clients': 3.997.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/lib-storage@3.1152.0(@aws-sdk/client-s3@3.1152.0)': + dependencies: + '@aws-sdk/client-s3': 3.1152.0 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + buffer: 5.6.0 + events: 3.3.0 + stream-browserify: 3.0.0 + tslib: 2.8.1 + + '@aws-sdk/middleware-sdk-s3@3.972.79': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/signature-v4-multi-region': 3.996.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/nested-clients@3.997.48': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/signature-v4-multi-region': 3.996.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/fetch-http-handler': 5.8.0 + '@smithy/node-http-handler': 4.12.1 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/s3-request-presigner@3.1152.0': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/signature-v4-multi-region': 3.996.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/signature-v4-multi-region@3.996.48': + dependencies: + '@aws-sdk/types': 3.974.6 + '@smithy/signature-v4': 5.7.4 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/token-providers@3.1150.0': + dependencies: + '@aws-sdk/core': 3.978.3 + '@aws-sdk/nested-clients': 3.997.48 + '@aws-sdk/types': 3.974.6 + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/types@3.974.6': + dependencies: + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws-sdk/xml-builder@3.972.41': + dependencies: + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@aws/lambda-invoke-store@0.3.0': {} + '@babel/code-frame@7.29.7': dependencies: '@babel/helper-validator-identifier': 7.29.7 @@ -5730,6 +6196,16 @@ snapshots: '@borewit/text-codec@0.2.2': {} + '@clocklimited/payload-2fa@3.0.0-beta.1(@payloadcms/next@3.90.2(@types/react@19.2.14)(graphql@16.14.2)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3))(@payloadcms/translations@3.90.2)(@payloadcms/ui@3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))': + dependencies: + '@payloadcms/next': 3.90.2(@types/react@19.2.14)(graphql@16.14.2)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3) + '@payloadcms/translations': 3.90.2 + '@payloadcms/ui': 3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3) + jsonwebtoken: 9.0.3 + otpauth: 9.5.2 + payload: 3.90.2(graphql@16.14.2)(typescript@5.9.3) + qrcode: 1.5.4 + '@date-fns/tz@1.2.0': {} '@dnd-kit/accessibility@3.1.1(react@19.3.0)': @@ -6987,6 +7463,8 @@ snapshots: '@next/swc-win32-x64-msvc@16.4.0': optional: true + '@noble/hashes@2.4.0': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -7264,6 +7742,21 @@ snapshots: - supports-color - typescript + '@payloadcms/plugin-cloud-storage@3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3)': + dependencies: + '@payloadcms/ui': 3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3) + find-node-modules: 2.1.3 + payload: 3.90.2(graphql@16.14.2)(typescript@5.9.3) + range-parser: 1.2.1 + react: 19.3.0 + react-dom: 19.3.0(react@19.3.0) + transitivePeerDependencies: + - '@types/react' + - monaco-editor + - next + - supports-color + - typescript + '@payloadcms/plugin-form-builder@3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3)': dependencies: '@payloadcms/translations': 3.90.2 @@ -7338,6 +7831,22 @@ snapshots: - utf-8-validate - yjs + '@payloadcms/storage-s3@3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3)': + dependencies: + '@aws-sdk/client-s3': 3.1152.0 + '@aws-sdk/lib-storage': 3.1152.0(@aws-sdk/client-s3@3.1152.0) + '@aws-sdk/s3-request-presigner': 3.1152.0 + '@payloadcms/plugin-cloud-storage': 3.90.2(@types/react@19.2.14)(monaco-editor@0.55.1)(next@16.4.0(@babel/core@7.29.7)(@playwright/test@1.64.0)(@types/node@22.20.5)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(sass@1.77.4))(payload@3.90.2(graphql@16.14.2)(typescript@5.9.3))(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(typescript@5.9.3) + payload: 3.90.2(graphql@16.14.2)(typescript@5.9.3) + transitivePeerDependencies: + - '@types/react' + - monaco-editor + - next + - react + - react-dom + - supports-color + - typescript + '@payloadcms/translations@3.90.2': dependencies: date-fns: 4.1.0 @@ -7465,6 +7974,39 @@ snapshots: '@sindresorhus/is@5.6.0': {} + '@smithy/core@3.36.0': + dependencies: + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@smithy/credential-provider-imds@4.5.2': + dependencies: + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@smithy/fetch-http-handler@5.8.0': + dependencies: + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@smithy/node-http-handler@4.12.1': + dependencies: + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@smithy/signature-v4@5.7.4': + dependencies: + '@smithy/core': 3.36.0 + '@smithy/types': 4.19.0 + tslib: 2.8.1 + + '@smithy/types@4.19.0': + dependencies: + tslib: 2.8.1 + '@swc-node/core@1.14.1(@swc/core@1.15.43(@swc/helpers@0.5.23))(@swc/types@0.1.27)': dependencies: '@swc/core': 1.15.43(@swc/helpers@0.5.23) @@ -8286,6 +8828,8 @@ snapshots: body-scroll-lock@4.0.0-beta.0: {} + bowser@2.14.1: {} + brace-expansion@1.1.15: dependencies: balanced-match: 1.0.2 @@ -8315,12 +8859,19 @@ snapshots: bson@6.10.4: {} + buffer-equal-constant-time@1.0.1: {} + buffer-from@1.1.2: {} buffer-image-size@0.6.4: dependencies: '@types/node': 22.20.5 + buffer@5.6.0: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + buffer@5.7.1: dependencies: base64-js: 1.5.1 @@ -8365,6 +8916,8 @@ snapshots: callsites@3.1.0: {} + camelcase@5.3.1: {} + camelcase@6.3.0: {} caniuse-lite@1.0.30001803: {} @@ -8404,6 +8957,12 @@ snapshots: client-only@0.0.1: {} + cliui@6.0.0: + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + cliui@7.0.4: dependencies: string-width: 4.2.3 @@ -8524,6 +9083,8 @@ snapshots: dependencies: ms: 2.1.3 + decamelize@1.2.0: {} + decode-named-character-reference@1.3.0: dependencies: character-entities: 2.0.2 @@ -8563,6 +9124,8 @@ snapshots: dequal@2.0.3: {} + detect-file@1.0.0: {} + detect-indent@7.0.2: {} detect-libc@2.0.2: {} @@ -8575,6 +9138,8 @@ snapshots: dependencies: dequal: 2.0.3 + dijkstrajs@1.0.3: {} + doctrine@2.1.0: dependencies: esutils: 2.0.3 @@ -8613,6 +9178,10 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + ecdsa-sig-formatter@1.0.11: + dependencies: + safe-buffer: 5.2.1 + electron-to-chromium@1.5.389: {} emoji-regex@8.0.0: {} @@ -8849,7 +9418,7 @@ snapshots: eslint: 9.39.4 eslint-import-resolver-node: 0.3.10 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.6.1(eslint@9.39.4)(typescript@5.9.3))(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import-x@4.6.1(eslint@9.39.4)(typescript@5.9.3))(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.39.4) eslint-plugin-react: 7.37.5(eslint@9.39.4) eslint-plugin-react-hooks: 7.1.1(eslint@9.39.4) @@ -8886,7 +9455,7 @@ snapshots: tinyglobby: 0.2.17 unrs-resolver: 1.12.2 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import-x@4.6.1(eslint@9.39.4)(typescript@5.9.3))(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4) eslint-plugin-import-x: 4.6.1(eslint@9.39.4)(typescript@5.9.3) transitivePeerDependencies: - supports-color @@ -8943,7 +9512,7 @@ snapshots: - typescript optional: true - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1)(eslint@9.39.4): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint-import-resolver-typescript@3.10.1(eslint-plugin-import-x@4.6.1(eslint@9.39.4)(typescript@5.9.3))(eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.63.0(eslint@9.39.4)(typescript@5.9.3))(eslint@9.39.4))(eslint@9.39.4))(eslint@9.39.4): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -9331,6 +9900,8 @@ snapshots: transitivePeerDependencies: - bare-abort-controller + events@3.3.0: {} + execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -9343,6 +9914,10 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + expand-tilde@2.0.2: + dependencies: + homedir-polyfill: 1.0.3 + expect-type@1.4.0: {} ext-list@2.2.2: @@ -9392,6 +9967,10 @@ snapshots: optionalDependencies: picomatch: 4.0.5 + fdir@6.5.0(picomatch@4.0.7): + optionalDependencies: + picomatch: 4.0.7 + fetch-blob@3.2.0: dependencies: node-domexception: 1.0.0 @@ -9437,6 +10016,11 @@ snapshots: make-dir: 3.1.0 pkg-dir: 4.2.0 + find-node-modules@2.1.3: + dependencies: + findup-sync: 4.0.0 + merge: 2.1.1 + find-root@1.1.0: {} find-up@4.1.0: @@ -9453,6 +10037,13 @@ snapshots: dependencies: semver-regex: 4.0.5 + findup-sync@4.0.0: + dependencies: + detect-file: 1.0.0 + is-glob: 4.0.3 + micromatch: 4.0.8 + resolve-dir: 1.0.1 + flat-cache@4.0.1: dependencies: flatted: 3.4.2 @@ -9560,6 +10151,20 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 + global-modules@1.0.0: + dependencies: + global-prefix: 1.0.2 + is-windows: 1.0.2 + resolve-dir: 1.0.1 + + global-prefix@1.0.2: + dependencies: + expand-tilde: 2.0.2 + homedir-polyfill: 1.0.3 + ini: 1.3.8 + is-windows: 1.0.2 + which: 1.3.1 + globals@14.0.0: {} globals@16.0.0: {} @@ -9655,6 +10260,10 @@ snapshots: dependencies: react-is: 16.13.1 + homedir-polyfill@1.0.3: + dependencies: + parse-passwd: 1.0.0 + http-cache-semantics@4.2.0: {} http-status@2.1.0: {} @@ -9697,6 +10306,8 @@ snapshots: inherits@2.0.4: {} + ini@1.3.8: {} + inspect-with-kind@1.0.5: dependencies: kind-of: 6.0.3 @@ -9858,6 +10469,8 @@ snapshots: call-bound: 1.0.4 get-intrinsic: 1.3.0 + is-windows@1.0.2: {} + is-wsl@3.1.1: dependencies: is-inside-container: 1.0.0 @@ -9925,6 +10538,19 @@ snapshots: json5@2.2.3: {} + jsonwebtoken@9.0.3: + dependencies: + jws: 4.0.1 + lodash.includes: 4.3.0 + lodash.isboolean: 3.0.3 + lodash.isinteger: 4.0.4 + lodash.isnumber: 3.0.3 + lodash.isplainobject: 4.0.6 + lodash.isstring: 4.0.1 + lodash.once: 4.1.1 + ms: 2.1.3 + semver: 7.8.5 + jsox@1.2.121: {} jsx-ast-utils@3.3.5: @@ -9934,6 +10560,17 @@ snapshots: object.assign: 4.1.7 object.values: 1.2.1 + jwa@2.0.1: + dependencies: + buffer-equal-constant-time: 1.0.1 + ecdsa-sig-formatter: 1.0.11 + safe-buffer: 5.2.1 + + jws@4.0.1: + dependencies: + jwa: 2.0.1 + safe-buffer: 5.2.1 + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -9986,8 +10623,22 @@ snapshots: dependencies: p-locate: 5.0.0 + lodash.includes@4.3.0: {} + + lodash.isboolean@3.0.3: {} + + lodash.isinteger@4.0.4: {} + + lodash.isnumber@3.0.3: {} + + lodash.isplainobject@4.0.6: {} + + lodash.isstring@4.0.1: {} + lodash.merge@4.6.2: {} + lodash.once@4.1.1: {} + lodash@4.18.1: {} longest-streak@3.1.0: {} @@ -10087,6 +10738,8 @@ snapshots: merge2@1.4.1: {} + merge@2.1.1: {} + micromark-core-commonmark@2.0.3: dependencies: decode-named-character-reference: 1.3.0 @@ -10347,8 +11000,6 @@ snapshots: ms@2.1.3: {} - nanoid@3.3.15: {} - nanoid@3.3.20: {} napi-postinstall@0.3.4: {} @@ -10494,6 +11145,10 @@ snapshots: type-check: 0.4.0 word-wrap: 1.2.5 + otpauth@9.5.2: + dependencies: + '@noble/hashes': 2.4.0 + own-keys@1.0.1: dependencies: get-intrinsic: 1.3.0 @@ -10555,6 +11210,8 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + parse-passwd@1.0.0: {} + path-exists@4.0.0: {} path-is-absolute@1.0.1: {} @@ -10707,13 +11364,9 @@ snapshots: pluralize@8.0.0: {} - possible-typed-array-names@1.1.0: {} + pngjs@5.0.0: {} - postcss@8.5.16: - dependencies: - nanoid: 3.3.15 - picocolors: 1.1.1 - source-map-js: 1.2.1 + possible-typed-array-names@1.1.0: {} postcss@8.5.23: dependencies: @@ -10759,6 +11412,12 @@ snapshots: punycode@2.3.1: {} + qrcode@1.5.4: + dependencies: + dijkstrajs: 1.0.3 + pngjs: 5.0.0 + yargs: 15.4.1 + qs-esm@8.0.1: {} queue-microtask@1.2.3: {} @@ -10838,6 +11497,12 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 + readable-stream@3.6.2: + dependencies: + inherits: 2.0.4 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + readdirp@3.6.0: dependencies: picomatch: 2.3.2 @@ -10877,10 +11542,17 @@ snapshots: require-from-string@2.0.2: {} + require-main-filename@2.0.0: {} + requireindex@1.2.0: {} resolve-alpn@1.2.1: {} + resolve-dir@1.0.1: + dependencies: + expand-tilde: 2.0.2 + global-modules: 1.0.0 + resolve-from@4.0.0: {} resolve-pkg-maps@1.0.0: {} @@ -11013,6 +11685,8 @@ snapshots: server-only@0.0.1: {} + set-blocking@2.0.0: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -11206,6 +11880,11 @@ snapshots: es-errors: 1.3.0 internal-slot: 1.1.0 + stream-browserify@3.0.0: + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + streamsearch@1.1.0: {} streamx@2.28.0: @@ -11609,9 +12288,9 @@ snapshots: vite@7.3.6(@types/node@22.20.5)(sass@1.77.4)(tsx@4.22.4): dependencies: esbuild: 0.28.1 - fdir: 6.5.0(picomatch@4.0.5) - picomatch: 4.0.5 - postcss: 8.5.16 + fdir: 6.5.0(picomatch@4.0.7) + picomatch: 4.0.7 + postcss: 8.5.23 rollup: 4.62.2 tinyglobby: 0.2.17 optionalDependencies: @@ -11684,6 +12363,8 @@ snapshots: is-weakmap: 2.0.2 is-weakset: 2.0.4 + which-module@2.0.1: {} + which-typed-array@1.1.22: dependencies: available-typed-arrays: 1.0.7 @@ -11694,6 +12375,10 @@ snapshots: gopd: 1.2.0 has-tostringtag: 1.0.2 + which@1.3.1: + dependencies: + isexe: 2.0.0 + which@2.0.2: dependencies: isexe: 2.0.0 @@ -11702,6 +12387,12 @@ snapshots: word-wrap@1.2.5: {} + wrap-ansi@6.2.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 @@ -11723,14 +12414,35 @@ snapshots: xtend@4.0.2: {} + y18n@4.0.3: {} + y18n@5.0.8: {} yallist@3.1.1: {} yaml@1.10.3: {} + yargs-parser@18.1.3: + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + yargs-parser@20.2.9: {} + yargs@15.4.1: + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.1 + y18n: 4.0.3 + yargs-parser: 18.1.3 + yargs@16.2.2: dependencies: cliui: 7.0.4 diff --git a/src/plugin.ts b/src/plugin.ts index d50e1a1..26d91f8 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -78,10 +78,11 @@ export const ipalKit = (options: IpalOptions): Plugin => { let totp: TotpPluginFactory | undefined = tf.plugin if (!totp) { - // Fallback: dynamic import. Variable specifier dodges the plugin's own - // TS2307, but Next may NOT trace it into the server bundle — projects - // using this path MUST add '@clocklimited/payload-2fa' to - // serverExternalPackages in next.config (see docs/security.md). + // Fallback: dynamic import, resolvable because the package is an optional + // peer. Variable specifier dodges the plugin's own TS2307. Works only + // outside Next (payload CLI): webpack turns it into an empty context, and + // serverExternalPackages fails on the package's own .css imports — in + // Next the project MUST inject `plugin` (see docs/security.md). try { const pkg = '@clocklimited/payload-2fa' const mod = (await import(pkg)) as { @@ -92,9 +93,9 @@ export const ipalKit = (options: IpalOptions): Plugin => { } catch (err) { throw new Error( '[ipal] 2FA is enforced but @clocklimited/payload-2fa could not be loaded. ' + - 'Best fix — inject it: `import { payloadTotp } from "@clocklimited/payload-2fa"` ' + - 'then `twoFactor: { issuer, plugin: payloadTotp }`. Or install it AND add ' + - "'@clocklimited/payload-2fa' to serverExternalPackages in next.config. Or set " + + 'Inject it (required in Next): `import { payloadTotp } from "@clocklimited/payload-2fa"` ' + + 'then `twoFactor: { issuer, plugin: payloadTotp }`. Adding it to ' + + 'serverExternalPackages does NOT help (the package imports .css). Or set ' + `twoFactor: false to opt out (discouraged). Original error: ${String(err)}`, ) } diff --git a/src/types.ts b/src/types.ts index e53807f..1b18bdf 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,11 +1,14 @@ -import type { Field, Plugin } from 'payload' +import type { CollectionSlug, Field, Plugin } from 'payload' /** * Factory shape of @clocklimited/payload-2fa's `payloadTotp` export — injected - * so the plugin never imports the optional peer itself. + * so the plugin never imports the optional peer itself. `collection` is + * `CollectionSlug` (not `string`): payloadTotp requires it, and in a project + * with generated payload-types it's a narrowed union — `string` would make + * `plugin: payloadTotp` fail to type-check. */ export type TotpPluginFactory = (options: { - collection: string + collection: CollectionSlug forceSetup: boolean totp: { issuer: string } }) => Plugin @@ -90,19 +93,19 @@ export type IpalOptions = { twoFactor?: | { /** Auth collection slug. Defaults to 'users'. */ - collectionSlug?: string + collectionSlug?: CollectionSlug /** Name shown in the authenticator app (e.g. company/site name). */ issuer: string /** * The 2FA plugin factory, INJECTED from the project: - * `import { payloadTotp } from '@clocklimited/payload-2fa'`. Strongly - * recommended — injecting it (the same pattern as NextResponse / - * revalidatePath) means the plugin never dynamically imports the - * optional peer, which Next can fail to bundle into the server chunks - * ("Cannot find module '@clocklimited/payload-2fa'" at runtime, even on - * public frontend pages). If omitted, the plugin falls back to a dynamic - * import and you MUST add '@clocklimited/payload-2fa' to - * serverExternalPackages in next.config. See docs/security.md. + * `import { payloadTotp } from '@clocklimited/payload-2fa'`. REQUIRED in + * Next — injecting it (the same pattern as NextResponse / revalidatePath) + * means the plugin never dynamically imports the optional peer, which + * Next can't bundle ("Cannot find module '@clocklimited/payload-2fa'", + * even on public frontend pages). serverExternalPackages is no fix: the + * package imports its own .css, which Node can't load. If omitted, the + * plugin falls back to a dynamic import — works only outside Next + * (payload CLI). See docs/security.md. */ plugin?: TotpPluginFactory }