diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..9693eed --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "parser": "typescript", + "printWidth": 120 +} diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index ca50597..5338f02 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -14,6 +14,9 @@ module.exports = { max_memory_restart: '1G', error_file: '/home/payload/logs/error.log', out_file: '/home/payload/logs/out.log', - time: true + time: true, + max_restarts: 10, + min_uptime: '10s', + restart_delay: 5000 }] } diff --git a/next.config.mjs b/next.config.mjs index 8e22d20..bbf1b76 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -2,6 +2,20 @@ import { withPayload } from '@payloadcms/next/withPayload' /** @type {import('next').NextConfig} */ const nextConfig = { + // Skip type checking during build (done separately in CI) + typescript: { + ignoreBuildErrors: true, + }, + // Skip ESLint during build to save memory + eslint: { + ignoreDuringBuilds: true, + }, + // Reduce memory usage during build + experimental: { + // Use fewer workers for builds on low-memory systems + workerThreads: false, + cpus: 1, + }, // Your Next.js config here webpack: (webpackConfig) => { webpackConfig.resolve.extensionAlias = { diff --git a/package.json b/package.json index aaaccd9..2c256c2 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "type": "module", "scripts": { - "build": "cross-env NODE_OPTIONS=\"--no-deprecation --max-old-space-size=8000\" next build", + "build": "cross-env NODE_OPTIONS=\"--no-deprecation --max-old-space-size=2048\" next build", "dev": "cross-env NODE_OPTIONS=--no-deprecation next dev", "devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev", "generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap", @@ -14,28 +14,36 @@ "payload": "cross-env NODE_OPTIONS=--no-deprecation payload", "start": "cross-env NODE_OPTIONS=--no-deprecation next start", "test": "pnpm run test:int && pnpm run test:e2e", - "test:e2e": "cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" pnpm exec playwright test", + "test:e2e": "test -f .next/BUILD_ID || (echo 'Error: No build found. Run pnpm build first.' && exit 1) && cross-env NODE_OPTIONS=\"--no-deprecation --no-experimental-strip-types\" pnpm exec playwright test", "test:int": "cross-env NODE_OPTIONS=--no-deprecation vitest run --config ./vitest.config.mts" }, "dependencies": { "@payloadcms/db-postgres": "3.65.0", "@payloadcms/next": "3.65.0", + "@payloadcms/plugin-form-builder": "3.65.0", "@payloadcms/plugin-multi-tenant": "^3.65.0", + "@payloadcms/plugin-nested-docs": "3.65.0", + "@payloadcms/plugin-redirects": "3.65.0", + "@payloadcms/plugin-seo": "3.65.0", "@payloadcms/richtext-lexical": "3.65.0", + "@payloadcms/translations": "^3.65.0", "@payloadcms/ui": "3.65.0", "cross-env": "^7.0.3", "dotenv": "16.4.7", "graphql": "^16.8.1", "next": "15.4.7", + "node-cron": "^4.2.1", "payload": "3.65.0", "react": "19.1.0", "react-dom": "19.1.0", "sharp": "0.34.2" }, "devDependencies": { + "@eslint/eslintrc": "^3.3.1", "@playwright/test": "1.56.1", "@testing-library/react": "16.3.0", "@types/node": "^22.5.4", + "@types/node-cron": "^3.0.11", "@types/react": "19.1.8", "@types/react-dom": "19.1.6", "@vitejs/plugin-react": "4.5.2", @@ -44,7 +52,7 @@ "jsdom": "26.1.0", "playwright": "1.56.1", "playwright-core": "1.56.1", - "prettier": "^3.4.2", + "prettier": "^3.2.5", "typescript": "5.7.3", "vite-tsconfig-paths": "5.1.4", "vitest": "3.2.3" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3857bd9..237ea31 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,12 +14,27 @@ importers: '@payloadcms/next': specifier: 3.65.0 version: 3.65.0(@types/react@19.1.8)(graphql@16.12.0)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) + '@payloadcms/plugin-form-builder': + specifier: 3.65.0 + version: 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) '@payloadcms/plugin-multi-tenant': specifier: ^3.65.0 version: 3.65.0(@payloadcms/ui@3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3))(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3)) + '@payloadcms/plugin-nested-docs': + specifier: 3.65.0 + version: 3.65.0(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3)) + '@payloadcms/plugin-redirects': + specifier: 3.65.0 + version: 3.65.0(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3)) + '@payloadcms/plugin-seo': + specifier: 3.65.0 + version: 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) '@payloadcms/richtext-lexical': specifier: 3.65.0 version: 3.65.0(@faceless-ui/modal@3.0.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@payloadcms/next@3.65.0(@types/react@19.1.8)(graphql@16.12.0)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3))(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3)(yjs@13.6.27) + '@payloadcms/translations': + specifier: ^3.65.0 + version: 3.65.0 '@payloadcms/ui': specifier: 3.65.0 version: 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) @@ -35,6 +50,9 @@ importers: next: specifier: 15.4.7 version: 15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4) + node-cron: + specifier: ^4.2.1 + version: 4.2.1 payload: specifier: 3.65.0 version: 3.65.0(graphql@16.12.0)(typescript@5.7.3) @@ -48,6 +66,9 @@ importers: specifier: 0.34.2 version: 0.34.2 devDependencies: + '@eslint/eslintrc': + specifier: ^3.3.1 + version: 3.3.1 '@playwright/test': specifier: 1.56.1 version: 1.56.1 @@ -57,6 +78,9 @@ importers: '@types/node': specifier: ^22.5.4 version: 22.19.1 + '@types/node-cron': + specifier: ^3.0.11 + version: 3.0.11 '@types/react': specifier: 19.1.8 version: 19.1.8 @@ -82,8 +106,8 @@ importers: specifier: 1.56.1 version: 1.56.1 prettier: - specifier: ^3.4.2 - version: 3.6.2 + specifier: ^3.2.5 + version: 3.2.5 typescript: specifier: 5.7.3 version: 5.7.3 @@ -1145,6 +1169,13 @@ packages: next: ^15.2.3 payload: 3.65.0 + '@payloadcms/plugin-form-builder@3.65.0': + resolution: {integrity: sha512-NH23vB2TpMp6CNMOnXdqx2k3Z0PXNJLMUkNwpCNjr7DkHsvzop4oGp8HU8I09s27Htq0vyp/QHokwbue0yic2g==} + peerDependencies: + payload: 3.65.0 + react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + '@payloadcms/plugin-multi-tenant@3.65.0': resolution: {integrity: sha512-r4ZN6FMuwuzzhq7NmORT72E8vIT87tjr2TK4NxzIkb2MjkMD43tNlsq2+7s6AFxopwpHdbhxY/ggPwelbooSMw==} peerDependencies: @@ -1152,6 +1183,23 @@ packages: next: ^15.2.3 payload: 3.65.0 + '@payloadcms/plugin-nested-docs@3.65.0': + resolution: {integrity: sha512-1qYUPuBgSJ9dq14lZRf4OsjAK+kVU9x57/XfE/8kFRx0OQXGaLJ5PfYv+SjMbdRnqM9IxYGwW6oktl13qtg4ug==} + peerDependencies: + payload: 3.65.0 + + '@payloadcms/plugin-redirects@3.65.0': + resolution: {integrity: sha512-i6FRfCyoswPUPlatyOPU/psqMSO53JZDpadUVOIjdp/sG99Dq2ylg8kSWRGxg2/MpAI+Ru2fC3+cRuThdt+aEw==} + peerDependencies: + payload: 3.65.0 + + '@payloadcms/plugin-seo@3.65.0': + resolution: {integrity: sha512-e+a09XKMzyVdI3O6+C7HdAMi/3vtN5A37ZFdkU44TCgXjD8Spn2C1f2W/3D1XLuDHo5dEYujj1ENukDxsVKvag==} + peerDependencies: + payload: 3.65.0 + react: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + react-dom: ^19.0.0 || ^19.0.0-rc-65a56d0e-20241020 + '@payloadcms/richtext-lexical@3.65.0': resolution: {integrity: sha512-mF+olNxhKEJ23DE3KT0xyvuDHvQR4IdbLHHJXYLjNDkCPp3w8rBAc5UiDZrJ+ZkIMNMD00RhcghwpGM/dM5LuA==} engines: {node: ^18.20.2 || >=20.9.0} @@ -1384,6 +1432,9 @@ packages: '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} + '@types/node-cron@3.0.11': + resolution: {integrity: sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==} + '@types/node@22.19.1': resolution: {integrity: sha512-LCCV0HdSZZZb34qifBsyWlUmok6W7ouER+oQIGBScS8EsZsQbrtFTUrDX4hOl+CS6p7cnNC4td+qrSVGSCTUfQ==} @@ -2983,6 +3034,10 @@ packages: sass: optional: true + node-cron@4.2.1: + resolution: {integrity: sha512-lgimEHPE/QDgFlywTd8yTR61ptugX3Qer29efeyWw2rv259HtGBNn1vZVmp8lB9uo9wC0t/AT4iGqXxia+CJFg==} + engines: {node: '>=6.0.0'} + node-releases@2.0.27: resolution: {integrity: sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==} @@ -3236,6 +3291,11 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier@3.2.5: + resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + engines: {node: '>=14'} + hasBin: true + prettier@3.6.2: resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} engines: {node: '>=14'} @@ -5036,12 +5096,49 @@ snapshots: - supports-color - typescript + '@payloadcms/plugin-form-builder@3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3)': + dependencies: + '@payloadcms/ui': 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) + escape-html: 1.0.3 + payload: 3.65.0(graphql@16.12.0)(typescript@5.7.3) + react: 19.1.0 + react-dom: 19.1.0(react@19.1.0) + transitivePeerDependencies: + - '@types/react' + - monaco-editor + - next + - supports-color + - typescript + '@payloadcms/plugin-multi-tenant@3.65.0(@payloadcms/ui@3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3))(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))': dependencies: '@payloadcms/ui': 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) next: 15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4) payload: 3.65.0(graphql@16.12.0)(typescript@5.7.3) + '@payloadcms/plugin-nested-docs@3.65.0(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))': + dependencies: + payload: 3.65.0(graphql@16.12.0)(typescript@5.7.3) + + '@payloadcms/plugin-redirects@3.65.0(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))': + dependencies: + '@payloadcms/translations': 3.65.0 + payload: 3.65.0(graphql@16.12.0)(typescript@5.7.3) + + '@payloadcms/plugin-seo@3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3)': + dependencies: + '@payloadcms/translations': 3.65.0 + '@payloadcms/ui': 3.65.0(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3) + payload: 3.65.0(graphql@16.12.0)(typescript@5.7.3) + react: 19.1.0 + react-dom: 19.1.0(react@19.1.0) + transitivePeerDependencies: + - '@types/react' + - monaco-editor + - next + - supports-color + - typescript + '@payloadcms/richtext-lexical@3.65.0(@faceless-ui/modal@3.0.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@faceless-ui/scroll-info@2.0.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@payloadcms/next@3.65.0(@types/react@19.1.8)(graphql@16.12.0)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3))(@types/react@19.1.8)(monaco-editor@0.55.1)(next@15.4.7(@babel/core@7.28.5)(@playwright/test@1.56.1)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(sass@1.77.4))(payload@3.65.0(graphql@16.12.0)(typescript@5.7.3))(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(typescript@5.7.3)(yjs@13.6.27)': dependencies: '@faceless-ui/modal': 3.0.0(react-dom@19.1.0(react@19.1.0))(react@19.1.0) @@ -5299,6 +5396,8 @@ snapshots: '@types/ms@2.1.0': {} + '@types/node-cron@3.0.11': {} + '@types/node@22.19.1': dependencies: undici-types: 6.21.0 @@ -7148,6 +7247,8 @@ snapshots: - '@babel/core' - babel-plugin-macros + node-cron@4.2.1: {} + node-releases@2.0.27: {} normalize-path@3.0.0: {} @@ -7446,6 +7547,8 @@ snapshots: prelude-ls@1.2.1: {} + prettier@3.2.5: {} + prettier@3.6.2: {} pretty-format@27.5.1: diff --git a/src/app/(payload)/admin/importMap.js b/src/app/(payload)/admin/importMap.js index 7e580fa..4c05c6a 100644 --- a/src/app/(payload)/admin/importMap.js +++ b/src/app/(payload)/admin/importMap.js @@ -1,11 +1,57 @@ import { TenantField as TenantField_1d0591e3cf4f332c83a86da13a0de59a } from '@payloadcms/plugin-multi-tenant/client' import { WatchTenantCollection as WatchTenantCollection_1d0591e3cf4f332c83a86da13a0de59a } from '@payloadcms/plugin-multi-tenant/client' +import { RscEntryLexicalCell as RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { RscEntryLexicalField as RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { LexicalDiffComponent as LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e } from '@payloadcms/richtext-lexical/rsc' +import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UploadFeatureClient as UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { BlockquoteFeatureClient as BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { RelationshipFeatureClient as RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { LinkFeatureClient as LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ChecklistFeatureClient as ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { OrderedListFeatureClient as OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UnorderedListFeatureClient as UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { IndentFeatureClient as IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { AlignFeatureClient as AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { HeadingFeatureClient as HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ParagraphFeatureClient as ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { InlineCodeFeatureClient as InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { SuperscriptFeatureClient as SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { SubscriptFeatureClient as SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { StrikethroughFeatureClient as StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' +import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client' import { TenantSelector as TenantSelector_d6d5f193a167989e2ee7d14202901e62 } from '@payloadcms/plugin-multi-tenant/rsc' import { TenantSelectionProvider as TenantSelectionProvider_d6d5f193a167989e2ee7d14202901e62 } from '@payloadcms/plugin-multi-tenant/rsc' export const importMap = { "@payloadcms/plugin-multi-tenant/client#TenantField": TenantField_1d0591e3cf4f332c83a86da13a0de59a, "@payloadcms/plugin-multi-tenant/client#WatchTenantCollection": WatchTenantCollection_1d0591e3cf4f332c83a86da13a0de59a, + "@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/rsc#LexicalDiffComponent": LexicalDiffComponent_44fe37237e0ebf4470c9990d8cb7b07e, + "@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UploadFeatureClient": UploadFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#BlockquoteFeatureClient": BlockquoteFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#RelationshipFeatureClient": RelationshipFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ChecklistFeatureClient": ChecklistFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#OrderedListFeatureClient": OrderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#IndentFeatureClient": IndentFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#InlineCodeFeatureClient": InlineCodeFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#SuperscriptFeatureClient": SuperscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#SubscriptFeatureClient": SubscriptFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, + "@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864, "@payloadcms/plugin-multi-tenant/rsc#TenantSelector": TenantSelector_d6d5f193a167989e2ee7d14202901e62, "@payloadcms/plugin-multi-tenant/rsc#TenantSelectionProvider": TenantSelectionProvider_d6d5f193a167989e2ee7d14202901e62 } diff --git a/src/payload-generated-schema.ts b/src/payload-generated-schema.ts new file mode 100644 index 0000000..0fd684e --- /dev/null +++ b/src/payload-generated-schema.ts @@ -0,0 +1,3148 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * This file was automatically generated by Payload. + * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, + * and re-run `payload generate:db-schema` to regenerate this file. + */ + +import type {} from "@payloadcms/db-postgres"; +import { + pgTable, + index, + uniqueIndex, + foreignKey, + integer, + varchar, + timestamp, + serial, + numeric, + text, + boolean, + jsonb, + pgEnum, +} from "@payloadcms/db-postgres/drizzle/pg-core"; +import { sql, relations } from "@payloadcms/db-postgres/drizzle"; +export const enum_pages_blocks_hero_block_alignment = pgEnum("enum_pages_blocks_hero_block_alignment", [ + "left", + "center", + "right", +]); +export const enum_pages_blocks_hero_block_cta_style = pgEnum("enum_pages_blocks_hero_block_cta_style", [ + "primary", + "secondary", + "outline", +]); +export const enum_pages_blocks_text_block_width = pgEnum("enum_pages_blocks_text_block_width", [ + "narrow", + "medium", + "full", +]); +export const enum_pages_blocks_image_text_block_image_position = pgEnum( + "enum_pages_blocks_image_text_block_image_position", + ["left", "right"], +); +export const enum_pages_blocks_card_grid_block_columns = pgEnum("enum_pages_blocks_card_grid_block_columns", [ + "2", + "3", + "4", +]); +export const enum_pages_blocks_quote_block_style = pgEnum("enum_pages_blocks_quote_block_style", [ + "simple", + "highlighted", + "with-image", +]); +export const enum_pages_blocks_cta_block_buttons_style = pgEnum("enum_pages_blocks_cta_block_buttons_style", [ + "primary", + "secondary", + "outline", +]); +export const enum_pages_blocks_cta_block_background_color = pgEnum("enum_pages_blocks_cta_block_background_color", [ + "dark", + "light", + "accent", +]); +export const enum_pages_blocks_timeline_block_layout = pgEnum("enum_pages_blocks_timeline_block_layout", [ + "vertical", + "alternating", + "horizontal", +]); +export const enum_pages_blocks_timeline_block_marker_style = pgEnum("enum_pages_blocks_timeline_block_marker_style", [ + "dot", + "number", + "icon", + "date", +]); +export const enum_pages_blocks_timeline_block_background_color = pgEnum( + "enum_pages_blocks_timeline_block_background_color", + ["white", "light", "dark"], +); +export const enum_pages_blocks_divider_block_style = pgEnum("enum_pages_blocks_divider_block_style", [ + "line", + "space", + "dots", +]); +export const enum_pages_blocks_divider_block_spacing = pgEnum("enum_pages_blocks_divider_block_spacing", [ + "small", + "medium", + "large", +]); +export const enum_pages_blocks_video_block_aspect_ratio = pgEnum("enum_pages_blocks_video_block_aspect_ratio", [ + "16:9", + "4:3", + "1:1", +]); +export const enum_pages_blocks_posts_list_block_post_type = pgEnum("enum_pages_blocks_posts_list_block_post_type", [ + "blog", + "news", + "press", + "announcement", + "all", +]); +export const enum_pages_blocks_posts_list_block_layout = pgEnum("enum_pages_blocks_posts_list_block_layout", [ + "grid", + "list", + "featured", + "compact", + "masonry", +]); +export const enum_pages_blocks_posts_list_block_columns = pgEnum("enum_pages_blocks_posts_list_block_columns", [ + "2", + "3", + "4", +]); +export const enum_pages_blocks_posts_list_block_background_color = pgEnum( + "enum_pages_blocks_posts_list_block_background_color", + ["white", "light", "dark"], +); +export const enum_pages_blocks_testimonials_block_layout = pgEnum("enum_pages_blocks_testimonials_block_layout", [ + "slider", + "grid", + "single", + "masonry", + "list", +]); +export const enum_pages_blocks_testimonials_block_columns = pgEnum("enum_pages_blocks_testimonials_block_columns", [ + "2", + "3", + "4", +]); +export const enum_pages_blocks_testimonials_block_display_mode = pgEnum( + "enum_pages_blocks_testimonials_block_display_mode", + ["all", "selected"], +); +export const enum_pages_blocks_testimonials_block_background_color = pgEnum( + "enum_pages_blocks_testimonials_block_background_color", + ["white", "light", "dark", "accent"], +); +export const enum_pages_blocks_newsletter_block_available_interests = pgEnum( + "enum_pages_blocks_newsletter_block_available_interests", + ["general", "blog", "products", "offers", "events"], +); +export const enum_pages_blocks_newsletter_block_layout = pgEnum("enum_pages_blocks_newsletter_block_layout", [ + "inline", + "stacked", + "with-image", + "minimal", + "card", +]); +export const enum_pages_blocks_newsletter_block_image_position = pgEnum( + "enum_pages_blocks_newsletter_block_image_position", + ["left", "right"], +); +export const enum_pages_blocks_newsletter_block_background_color = pgEnum( + "enum_pages_blocks_newsletter_block_background_color", + ["white", "light", "dark", "accent"], +); +export const enum_pages_blocks_process_steps_block_layout = pgEnum("enum_pages_blocks_process_steps_block_layout", [ + "horizontal", + "vertical", + "alternating", + "connected", + "timeline", +]); +export const enum_pages_blocks_process_steps_block_cta_variant = pgEnum( + "enum_pages_blocks_process_steps_block_cta_variant", + ["default", "ghost", "light"], +); +export const enum_pages_blocks_process_steps_block_background_color = pgEnum( + "enum_pages_blocks_process_steps_block_background_color", + ["white", "light", "dark"], +); +export const enum_pages_status = pgEnum("enum_pages_status", ["draft", "published"]); +export const enum_posts_type = pgEnum("enum_posts_type", ["blog", "news", "press", "announcement"]); +export const enum_posts_status = pgEnum("enum_posts_status", ["draft", "published", "archived"]); +export const enum_social_links_platform = pgEnum("enum_social_links_platform", [ + "facebook", + "x", + "instagram", + "youtube", + "linkedin", + "xing", +]); +export const enum_newsletter_subscribers_interests = pgEnum("enum_newsletter_subscribers_interests", [ + "general", + "blog", + "products", + "offers", + "events", +]); +export const enum_newsletter_subscribers_status = pgEnum("enum_newsletter_subscribers_status", [ + "pending", + "confirmed", + "unsubscribed", + "bounced", +]); +export const enum_cookie_configurations_enabled_categories = pgEnum("enum_cookie_configurations_enabled_categories", [ + "necessary", + "functional", + "analytics", + "marketing", +]); +export const enum_cookie_configurations_styling_position = pgEnum("enum_cookie_configurations_styling_position", [ + "bottom", + "top", + "middle", +]); +export const enum_cookie_configurations_styling_theme = pgEnum("enum_cookie_configurations_styling_theme", [ + "dark", + "light", + "auto", +]); +export const enum_cookie_inventory_category = pgEnum("enum_cookie_inventory_category", [ + "necessary", + "functional", + "analytics", + "marketing", +]); +export const enum_privacy_policy_settings_provider = pgEnum("enum_privacy_policy_settings_provider", [ + "alfright", + "internal", +]); +export const enum_privacy_policy_settings_alfright_language = pgEnum("enum_privacy_policy_settings_alfright_language", [ + "de-de", + "de-at", + "de-ch", + "en-gb", + "en-us", +]); +export const enum_forms_confirmation_type = pgEnum("enum_forms_confirmation_type", ["message", "redirect"]); +export const enum_redirects_to_type = pgEnum("enum_redirects_to_type", ["reference", "custom"]); +export const enum_navigation_main_menu_submenu_link_type = pgEnum("enum_navigation_main_menu_submenu_link_type", [ + "page", + "custom", +]); +export const enum_navigation_main_menu_type = pgEnum("enum_navigation_main_menu_type", ["page", "custom", "submenu"]); +export const enum_navigation_footer_menu_link_type = pgEnum("enum_navigation_footer_menu_link_type", [ + "page", + "custom", +]); +export const enum_seo_settings_social_profiles_platform = pgEnum("enum_seo_settings_social_profiles_platform", [ + "facebook", + "instagram", + "twitter", + "linkedin", + "youtube", + "tiktok", + "pinterest", + "xing", + "other", +]); +export const enum_seo_settings_local_business_type = pgEnum("enum_seo_settings_local_business_type", [ + "LocalBusiness", + "Physician", + "Dentist", + "Attorney", + "Restaurant", + "Hotel", + "Store", + "HealthClub", + "HairSalon", + "AutoRepair", + "RealEstateAgent", + "FinancialService", + "ProfessionalService", + "MedicalBusiness", +]); +export const enum_seo_settings_local_business_price_range = pgEnum("enum_seo_settings_local_business_price_range", [ + "€", + "€€", + "€€€", + "€€€€", +]); + +export const users_tenants = pgTable( + "users_tenants", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + tenant: integer("tenant_id") + .notNull() + .references(() => tenants.id, { + onDelete: "set null", + }), + }, + (columns) => [ + index("users_tenants_order_idx").on(columns._order), + index("users_tenants_parent_id_idx").on(columns._parentID), + index("users_tenants_tenant_idx").on(columns.tenant), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [users.id], + name: "users_tenants_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const users_sessions = pgTable( + "users_sessions", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }), + expiresAt: timestamp("expires_at", { mode: "string", withTimezone: true, precision: 3 }).notNull(), + }, + (columns) => [ + index("users_sessions_order_idx").on(columns._order), + index("users_sessions_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [users.id], + name: "users_sessions_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const users = pgTable( + "users", + { + id: serial("id").primaryKey(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + email: varchar("email").notNull(), + resetPasswordToken: varchar("reset_password_token"), + resetPasswordExpiration: timestamp("reset_password_expiration", { + mode: "string", + withTimezone: true, + precision: 3, + }), + salt: varchar("salt"), + hash: varchar("hash"), + loginAttempts: numeric("login_attempts", { mode: "number" }).default(0), + lockUntil: timestamp("lock_until", { mode: "string", withTimezone: true, precision: 3 }), + }, + (columns) => [ + index("users_updated_at_idx").on(columns.updatedAt), + index("users_created_at_idx").on(columns.createdAt), + uniqueIndex("users_email_idx").on(columns.email), + ], +); + +export const media = pgTable( + "media", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + alt: varchar("alt").notNull(), + caption: varchar("caption"), + credit: varchar("credit"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + url: varchar("url"), + thumbnailURL: varchar("thumbnail_u_r_l"), + filename: varchar("filename"), + mimeType: varchar("mime_type"), + filesize: numeric("filesize", { mode: "number" }), + width: numeric("width", { mode: "number" }), + height: numeric("height", { mode: "number" }), + focalX: numeric("focal_x", { mode: "number" }), + focalY: numeric("focal_y", { mode: "number" }), + sizes_thumbnail_url: varchar("sizes_thumbnail_url"), + sizes_thumbnail_width: numeric("sizes_thumbnail_width", { mode: "number" }), + sizes_thumbnail_height: numeric("sizes_thumbnail_height", { mode: "number" }), + sizes_thumbnail_mimeType: varchar("sizes_thumbnail_mime_type"), + sizes_thumbnail_filesize: numeric("sizes_thumbnail_filesize", { mode: "number" }), + sizes_thumbnail_filename: varchar("sizes_thumbnail_filename"), + sizes_small_url: varchar("sizes_small_url"), + sizes_small_width: numeric("sizes_small_width", { mode: "number" }), + sizes_small_height: numeric("sizes_small_height", { mode: "number" }), + sizes_small_mimeType: varchar("sizes_small_mime_type"), + sizes_small_filesize: numeric("sizes_small_filesize", { mode: "number" }), + sizes_small_filename: varchar("sizes_small_filename"), + sizes_medium_url: varchar("sizes_medium_url"), + sizes_medium_width: numeric("sizes_medium_width", { mode: "number" }), + sizes_medium_height: numeric("sizes_medium_height", { mode: "number" }), + sizes_medium_mimeType: varchar("sizes_medium_mime_type"), + sizes_medium_filesize: numeric("sizes_medium_filesize", { mode: "number" }), + sizes_medium_filename: varchar("sizes_medium_filename"), + sizes_large_url: varchar("sizes_large_url"), + sizes_large_width: numeric("sizes_large_width", { mode: "number" }), + sizes_large_height: numeric("sizes_large_height", { mode: "number" }), + sizes_large_mimeType: varchar("sizes_large_mime_type"), + sizes_large_filesize: numeric("sizes_large_filesize", { mode: "number" }), + sizes_large_filename: varchar("sizes_large_filename"), + sizes_xlarge_url: varchar("sizes_xlarge_url"), + sizes_xlarge_width: numeric("sizes_xlarge_width", { mode: "number" }), + sizes_xlarge_height: numeric("sizes_xlarge_height", { mode: "number" }), + sizes_xlarge_mimeType: varchar("sizes_xlarge_mime_type"), + sizes_xlarge_filesize: numeric("sizes_xlarge_filesize", { mode: "number" }), + sizes_xlarge_filename: varchar("sizes_xlarge_filename"), + sizes_2k_url: varchar("sizes_2k_url"), + sizes_2k_width: numeric("sizes_2k_width", { mode: "number" }), + sizes_2k_height: numeric("sizes_2k_height", { mode: "number" }), + sizes_2k_mimeType: varchar("sizes_2k_mime_type"), + sizes_2k_filesize: numeric("sizes_2k_filesize", { mode: "number" }), + sizes_2k_filename: varchar("sizes_2k_filename"), + sizes_og_url: varchar("sizes_og_url"), + sizes_og_width: numeric("sizes_og_width", { mode: "number" }), + sizes_og_height: numeric("sizes_og_height", { mode: "number" }), + sizes_og_mimeType: varchar("sizes_og_mime_type"), + sizes_og_filesize: numeric("sizes_og_filesize", { mode: "number" }), + sizes_og_filename: varchar("sizes_og_filename"), + sizes_medium_avif_url: varchar("sizes_medium_avif_url"), + sizes_medium_avif_width: numeric("sizes_medium_avif_width", { mode: "number" }), + sizes_medium_avif_height: numeric("sizes_medium_avif_height", { mode: "number" }), + sizes_medium_avif_mimeType: varchar("sizes_medium_avif_mime_type"), + sizes_medium_avif_filesize: numeric("sizes_medium_avif_filesize", { mode: "number" }), + sizes_medium_avif_filename: varchar("sizes_medium_avif_filename"), + sizes_large_avif_url: varchar("sizes_large_avif_url"), + sizes_large_avif_width: numeric("sizes_large_avif_width", { mode: "number" }), + sizes_large_avif_height: numeric("sizes_large_avif_height", { mode: "number" }), + sizes_large_avif_mimeType: varchar("sizes_large_avif_mime_type"), + sizes_large_avif_filesize: numeric("sizes_large_avif_filesize", { mode: "number" }), + sizes_large_avif_filename: varchar("sizes_large_avif_filename"), + sizes_xlarge_avif_url: varchar("sizes_xlarge_avif_url"), + sizes_xlarge_avif_width: numeric("sizes_xlarge_avif_width", { mode: "number" }), + sizes_xlarge_avif_height: numeric("sizes_xlarge_avif_height", { mode: "number" }), + sizes_xlarge_avif_mimeType: varchar("sizes_xlarge_avif_mime_type"), + sizes_xlarge_avif_filesize: numeric("sizes_xlarge_avif_filesize", { mode: "number" }), + sizes_xlarge_avif_filename: varchar("sizes_xlarge_avif_filename"), + }, + (columns) => [ + index("media_tenant_idx").on(columns.tenant), + index("media_updated_at_idx").on(columns.updatedAt), + index("media_created_at_idx").on(columns.createdAt), + uniqueIndex("media_filename_idx").on(columns.filename), + index("media_sizes_thumbnail_sizes_thumbnail_filename_idx").on(columns.sizes_thumbnail_filename), + index("media_sizes_small_sizes_small_filename_idx").on(columns.sizes_small_filename), + index("media_sizes_medium_sizes_medium_filename_idx").on(columns.sizes_medium_filename), + index("media_sizes_large_sizes_large_filename_idx").on(columns.sizes_large_filename), + index("media_sizes_xlarge_sizes_xlarge_filename_idx").on(columns.sizes_xlarge_filename), + index("media_sizes_2k_sizes_2k_filename_idx").on(columns.sizes_2k_filename), + index("media_sizes_og_sizes_og_filename_idx").on(columns.sizes_og_filename), + index("media_sizes_medium_avif_sizes_medium_avif_filename_idx").on(columns.sizes_medium_avif_filename), + index("media_sizes_large_avif_sizes_large_avif_filename_idx").on(columns.sizes_large_avif_filename), + index("media_sizes_xlarge_avif_sizes_xlarge_avif_filename_idx").on(columns.sizes_xlarge_avif_filename), + ], +); + +export const media_texts = pgTable( + "media_texts", + { + id: serial("id").primaryKey(), + order: integer("order").notNull(), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + text: varchar("text"), + }, + (columns) => [ + index("media_texts_order_parent").on(columns.order, columns.parent), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [media.id], + name: "media_texts_parent_fk", + }).onDelete("cascade"), + ], +); + +export const tenants_domains = pgTable( + "tenants_domains", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + domain: varchar("domain").notNull(), + }, + (columns) => [ + index("tenants_domains_order_idx").on(columns._order), + index("tenants_domains_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [tenants.id], + name: "tenants_domains_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const tenants = pgTable( + "tenants", + { + id: serial("id").primaryKey(), + name: varchar("name").notNull(), + slug: varchar("slug").notNull(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + uniqueIndex("tenants_slug_idx").on(columns.slug), + index("tenants_updated_at_idx").on(columns.updatedAt), + index("tenants_created_at_idx").on(columns.createdAt), + ], +); + +export const pages_blocks_hero_block = pgTable( + "pages_blocks_hero_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + backgroundImage: integer("background_image_id").references(() => media.id, { + onDelete: "set null", + }), + headline: varchar("headline").notNull(), + subline: varchar("subline"), + alignment: enum_pages_blocks_hero_block_alignment("alignment").default("center"), + overlay: boolean("overlay").default(true), + cta_text: varchar("cta_text"), + cta_link: varchar("cta_link"), + cta_style: enum_pages_blocks_hero_block_cta_style("cta_style").default("primary"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_hero_block_order_idx").on(columns._order), + index("pages_blocks_hero_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_hero_block_path_idx").on(columns._path), + index("pages_blocks_hero_block_background_image_idx").on(columns.backgroundImage), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_hero_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_text_block = pgTable( + "pages_blocks_text_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + content: jsonb("content").notNull(), + width: enum_pages_blocks_text_block_width("width").default("medium"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_text_block_order_idx").on(columns._order), + index("pages_blocks_text_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_text_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_text_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_image_text_block = pgTable( + "pages_blocks_image_text_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + image: integer("image_id") + .notNull() + .references(() => media.id, { + onDelete: "set null", + }), + imagePosition: enum_pages_blocks_image_text_block_image_position("image_position").default("left"), + headline: varchar("headline"), + content: jsonb("content"), + cta_text: varchar("cta_text"), + cta_link: varchar("cta_link"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_image_text_block_order_idx").on(columns._order), + index("pages_blocks_image_text_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_image_text_block_path_idx").on(columns._path), + index("pages_blocks_image_text_block_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_image_text_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_card_grid_block_cards = pgTable( + "pages_blocks_card_grid_block_cards", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + title: varchar("title").notNull(), + description: varchar("description"), + link: varchar("link"), + linkText: varchar("link_text").default("mehr"), + }, + (columns) => [ + index("pages_blocks_card_grid_block_cards_order_idx").on(columns._order), + index("pages_blocks_card_grid_block_cards_parent_id_idx").on(columns._parentID), + index("pages_blocks_card_grid_block_cards_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages_blocks_card_grid_block.id], + name: "pages_blocks_card_grid_block_cards_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_card_grid_block = pgTable( + "pages_blocks_card_grid_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + headline: varchar("headline"), + columns: enum_pages_blocks_card_grid_block_columns("columns").default("3"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_card_grid_block_order_idx").on(columns._order), + index("pages_blocks_card_grid_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_card_grid_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_card_grid_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_quote_block = pgTable( + "pages_blocks_quote_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + quote: varchar("quote").notNull(), + author: varchar("author"), + role: varchar("role"), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + style: enum_pages_blocks_quote_block_style("style").default("simple"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_quote_block_order_idx").on(columns._order), + index("pages_blocks_quote_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_quote_block_path_idx").on(columns._path), + index("pages_blocks_quote_block_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_quote_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_cta_block_buttons = pgTable( + "pages_blocks_cta_block_buttons", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + text: varchar("text").notNull(), + link: varchar("link").notNull(), + style: enum_pages_blocks_cta_block_buttons_style("style").default("primary"), + }, + (columns) => [ + index("pages_blocks_cta_block_buttons_order_idx").on(columns._order), + index("pages_blocks_cta_block_buttons_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages_blocks_cta_block.id], + name: "pages_blocks_cta_block_buttons_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_cta_block = pgTable( + "pages_blocks_cta_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + headline: varchar("headline").notNull(), + description: varchar("description"), + backgroundColor: enum_pages_blocks_cta_block_background_color("background_color").default("dark"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_cta_block_order_idx").on(columns._order), + index("pages_blocks_cta_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_cta_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_cta_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_contact_form_block = pgTable( + "pages_blocks_contact_form_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + headline: varchar("headline").default("Kontakt"), + description: varchar("description"), + recipientEmail: varchar("recipient_email").default("info@porwoll.de"), + showPhone: boolean("show_phone").default(true), + showAddress: boolean("show_address").default(true), + showSocials: boolean("show_socials").default(true), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_contact_form_block_order_idx").on(columns._order), + index("pages_blocks_contact_form_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_contact_form_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_contact_form_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_timeline_block_items = pgTable( + "pages_blocks_timeline_block_items", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + year: varchar("year"), + title: varchar("title").notNull(), + description: varchar("description"), + icon: varchar("icon"), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + link_label: varchar("link_label"), + link_href: varchar("link_href"), + }, + (columns) => [ + index("pages_blocks_timeline_block_items_order_idx").on(columns._order), + index("pages_blocks_timeline_block_items_parent_id_idx").on(columns._parentID), + index("pages_blocks_timeline_block_items_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages_blocks_timeline_block.id], + name: "pages_blocks_timeline_block_items_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_timeline_block = pgTable( + "pages_blocks_timeline_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title"), + subtitle: varchar("subtitle"), + layout: enum_pages_blocks_timeline_block_layout("layout").default("vertical"), + showConnector: boolean("show_connector").default(true), + markerStyle: enum_pages_blocks_timeline_block_marker_style("marker_style").default("dot"), + backgroundColor: enum_pages_blocks_timeline_block_background_color("background_color").default("white"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_timeline_block_order_idx").on(columns._order), + index("pages_blocks_timeline_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_timeline_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_timeline_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_divider_block = pgTable( + "pages_blocks_divider_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + style: enum_pages_blocks_divider_block_style("style").default("space"), + spacing: enum_pages_blocks_divider_block_spacing("spacing").default("medium"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_divider_block_order_idx").on(columns._order), + index("pages_blocks_divider_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_divider_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_divider_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_video_block = pgTable( + "pages_blocks_video_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + videoUrl: varchar("video_url").notNull(), + caption: varchar("caption"), + aspectRatio: enum_pages_blocks_video_block_aspect_ratio("aspect_ratio").default("16:9"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_video_block_order_idx").on(columns._order), + index("pages_blocks_video_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_video_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_video_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_posts_list_block = pgTable( + "pages_blocks_posts_list_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title"), + subtitle: varchar("subtitle"), + postType: enum_pages_blocks_posts_list_block_post_type("post_type").notNull().default("blog"), + layout: enum_pages_blocks_posts_list_block_layout("layout").default("grid"), + columns: enum_pages_blocks_posts_list_block_columns("columns").default("3"), + limit: numeric("limit", { mode: "number" }).default(6), + showFeaturedOnly: boolean("show_featured_only").default(false), + showExcerpt: boolean("show_excerpt").default(true), + showDate: boolean("show_date").default(true), + showAuthor: boolean("show_author").default(false), + showCategory: boolean("show_category").default(true), + showPagination: boolean("show_pagination").default(false), + showReadMore: boolean("show_read_more").default(true), + readMoreLabel: varchar("read_more_label").default("Alle Beiträge anzeigen"), + readMoreLink: varchar("read_more_link").default("/blog"), + backgroundColor: enum_pages_blocks_posts_list_block_background_color("background_color").default("white"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_posts_list_block_order_idx").on(columns._order), + index("pages_blocks_posts_list_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_posts_list_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_posts_list_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_testimonials_block = pgTable( + "pages_blocks_testimonials_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title").default("Das sagen unsere Kunden"), + subtitle: varchar("subtitle"), + layout: enum_pages_blocks_testimonials_block_layout("layout").default("slider"), + columns: enum_pages_blocks_testimonials_block_columns("columns").default("3"), + displayMode: enum_pages_blocks_testimonials_block_display_mode("display_mode").default("all"), + limit: numeric("limit", { mode: "number" }).default(6), + showRating: boolean("show_rating").default(true), + showImage: boolean("show_image").default(true), + showCompany: boolean("show_company").default(true), + showSource: boolean("show_source").default(false), + autoplay: boolean("autoplay").default(true), + autoplaySpeed: numeric("autoplay_speed", { mode: "number" }).default(5000), + backgroundColor: enum_pages_blocks_testimonials_block_background_color("background_color").default("light"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_testimonials_block_order_idx").on(columns._order), + index("pages_blocks_testimonials_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_testimonials_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_testimonials_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_newsletter_block_available_interests = pgTable( + "pages_blocks_newsletter_block_available_interests", + { + order: integer("order").notNull(), + parent: varchar("parent_id").notNull(), + value: enum_pages_blocks_newsletter_block_available_interests("value"), + id: serial("id").primaryKey(), + }, + (columns) => [ + index("pages_blocks_newsletter_block_available_interests_order_idx").on(columns.order), + index("pages_blocks_newsletter_block_available_interests_parent_idx").on(columns.parent), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [pages_blocks_newsletter_block.id], + name: "pages_blocks_newsletter_block_available_interests_parent_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_newsletter_block = pgTable( + "pages_blocks_newsletter_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title").default("Newsletter abonnieren"), + subtitle: varchar("subtitle").default("Erhalten Sie regelmäßig Updates und Neuigkeiten direkt in Ihr Postfach."), + layout: enum_pages_blocks_newsletter_block_layout("layout").default("inline"), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + imagePosition: enum_pages_blocks_newsletter_block_image_position("image_position").default("left"), + collectName: boolean("collect_name").default(false), + showInterests: boolean("show_interests").default(false), + buttonText: varchar("button_text").default("Anmelden"), + placeholderEmail: varchar("placeholder_email").default("Ihre E-Mail-Adresse"), + successMessage: varchar("success_message").default( + "Vielen Dank! Bitte bestätigen Sie Ihre E-Mail-Adresse über den Link in der Bestätigungsmail.", + ), + errorMessage: varchar("error_message").default( + "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut.", + ), + privacyText: varchar("privacy_text").default( + "Mit der Anmeldung akzeptieren Sie unsere Datenschutzerklärung. Sie können sich jederzeit abmelden.", + ), + privacyLink: varchar("privacy_link").default("/datenschutz"), + source: varchar("source").default("website"), + backgroundColor: enum_pages_blocks_newsletter_block_background_color("background_color").default("accent"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_newsletter_block_order_idx").on(columns._order), + index("pages_blocks_newsletter_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_newsletter_block_path_idx").on(columns._path), + index("pages_blocks_newsletter_block_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_newsletter_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_process_steps_block_steps = pgTable( + "pages_blocks_process_steps_block_steps", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title").notNull(), + description: varchar("description"), + icon: varchar("icon"), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + }, + (columns) => [ + index("pages_blocks_process_steps_block_steps_order_idx").on(columns._order), + index("pages_blocks_process_steps_block_steps_parent_id_idx").on(columns._parentID), + index("pages_blocks_process_steps_block_steps_image_idx").on(columns.image), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages_blocks_process_steps_block.id], + name: "pages_blocks_process_steps_block_steps_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages_blocks_process_steps_block = pgTable( + "pages_blocks_process_steps_block", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + title: varchar("title").default("So funktioniert es"), + subtitle: varchar("subtitle"), + layout: enum_pages_blocks_process_steps_block_layout("layout").default("horizontal"), + showNumbers: boolean("show_numbers").default(true), + showIcons: boolean("show_icons").default(true), + cta_show: boolean("cta_show").default(false), + cta_label: varchar("cta_label").default("Jetzt starten"), + cta_href: varchar("cta_href"), + cta_variant: enum_pages_blocks_process_steps_block_cta_variant("cta_variant").default("default"), + backgroundColor: enum_pages_blocks_process_steps_block_background_color("background_color").default("white"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("pages_blocks_process_steps_block_order_idx").on(columns._order), + index("pages_blocks_process_steps_block_parent_id_idx").on(columns._parentID), + index("pages_blocks_process_steps_block_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [pages.id], + name: "pages_blocks_process_steps_block_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const pages = pgTable( + "pages", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + title: varchar("title").notNull(), + slug: varchar("slug").notNull(), + hero_image: integer("hero_image_id").references(() => media.id, { + onDelete: "set null", + }), + hero_headline: varchar("hero_headline"), + hero_subline: varchar("hero_subline"), + seo_metaTitle: varchar("seo_meta_title"), + seo_metaDescription: varchar("seo_meta_description"), + seo_ogImage: integer("seo_og_image_id").references(() => media.id, { + onDelete: "set null", + }), + status: enum_pages_status("status").default("draft"), + publishedAt: timestamp("published_at", { mode: "string", withTimezone: true, precision: 3 }), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("pages_tenant_idx").on(columns.tenant), + uniqueIndex("pages_slug_idx").on(columns.slug), + index("pages_hero_hero_image_idx").on(columns.hero_image), + index("pages_seo_seo_og_image_idx").on(columns.seo_ogImage), + index("pages_updated_at_idx").on(columns.updatedAt), + index("pages_created_at_idx").on(columns.createdAt), + ], +); + +export const pages_rels = pgTable( + "pages_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + categoriesID: integer("categories_id"), + testimonialsID: integer("testimonials_id"), + }, + (columns) => [ + index("pages_rels_order_idx").on(columns.order), + index("pages_rels_parent_idx").on(columns.parent), + index("pages_rels_path_idx").on(columns.path), + index("pages_rels_categories_id_idx").on(columns.categoriesID), + index("pages_rels_testimonials_id_idx").on(columns.testimonialsID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [pages.id], + name: "pages_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["categoriesID"]], + foreignColumns: [categories.id], + name: "pages_rels_categories_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["testimonialsID"]], + foreignColumns: [testimonials.id], + name: "pages_rels_testimonials_fk", + }).onDelete("cascade"), + ], +); + +export const posts = pgTable( + "posts", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + title: varchar("title").notNull(), + slug: varchar("slug").notNull(), + type: enum_posts_type("type").notNull().default("blog"), + isFeatured: boolean("is_featured").default(false), + excerpt: varchar("excerpt"), + featuredImage: integer("featured_image_id").references(() => media.id, { + onDelete: "set null", + }), + content: jsonb("content").notNull(), + author: varchar("author"), + status: enum_posts_status("status").default("draft"), + publishedAt: timestamp("published_at", { mode: "string", withTimezone: true, precision: 3 }), + seo_metaTitle: varchar("seo_meta_title"), + seo_metaDescription: varchar("seo_meta_description"), + seo_ogImage: integer("seo_og_image_id").references(() => media.id, { + onDelete: "set null", + }), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("posts_tenant_idx").on(columns.tenant), + uniqueIndex("posts_slug_idx").on(columns.slug), + index("posts_featured_image_idx").on(columns.featuredImage), + index("posts_seo_seo_og_image_idx").on(columns.seo_ogImage), + index("posts_updated_at_idx").on(columns.updatedAt), + index("posts_created_at_idx").on(columns.createdAt), + ], +); + +export const posts_rels = pgTable( + "posts_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + categoriesID: integer("categories_id"), + }, + (columns) => [ + index("posts_rels_order_idx").on(columns.order), + index("posts_rels_parent_idx").on(columns.parent), + index("posts_rels_path_idx").on(columns.path), + index("posts_rels_categories_id_idx").on(columns.categoriesID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [posts.id], + name: "posts_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["categoriesID"]], + foreignColumns: [categories.id], + name: "posts_rels_categories_fk", + }).onDelete("cascade"), + ], +); + +export const categories = pgTable( + "categories", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + name: varchar("name").notNull(), + slug: varchar("slug").notNull(), + description: varchar("description"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("categories_tenant_idx").on(columns.tenant), + uniqueIndex("categories_slug_idx").on(columns.slug), + index("categories_updated_at_idx").on(columns.updatedAt), + index("categories_created_at_idx").on(columns.createdAt), + ], +); + +export const social_links = pgTable( + "social_links", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + platform: enum_social_links_platform("platform").notNull(), + url: varchar("url").notNull(), + isActive: boolean("is_active").default(true), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("social_links_tenant_idx").on(columns.tenant), + index("social_links_updated_at_idx").on(columns.updatedAt), + index("social_links_created_at_idx").on(columns.createdAt), + ], +); + +export const testimonials = pgTable( + "testimonials", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + quote: varchar("quote").notNull(), + author: varchar("author").notNull(), + role: varchar("role"), + company: varchar("company"), + image: integer("image_id").references(() => media.id, { + onDelete: "set null", + }), + rating: numeric("rating", { mode: "number" }), + source: varchar("source"), + sourceUrl: varchar("source_url"), + date: timestamp("date", { mode: "string", withTimezone: true, precision: 3 }), + isActive: boolean("is_active").default(true), + order: numeric("order", { mode: "number" }).default(0), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("testimonials_tenant_idx").on(columns.tenant), + index("testimonials_image_idx").on(columns.image), + index("testimonials_updated_at_idx").on(columns.updatedAt), + index("testimonials_created_at_idx").on(columns.createdAt), + ], +); + +export const newsletter_subscribers_interests = pgTable( + "newsletter_subscribers_interests", + { + order: integer("order").notNull(), + parent: integer("parent_id").notNull(), + value: enum_newsletter_subscribers_interests("value"), + id: serial("id").primaryKey(), + }, + (columns) => [ + index("newsletter_subscribers_interests_order_idx").on(columns.order), + index("newsletter_subscribers_interests_parent_idx").on(columns.parent), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [newsletter_subscribers.id], + name: "newsletter_subscribers_interests_parent_fk", + }).onDelete("cascade"), + ], +); + +export const newsletter_subscribers = pgTable( + "newsletter_subscribers", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id").references(() => tenants.id, { + onDelete: "set null", + }), + email: varchar("email").notNull(), + firstName: varchar("first_name"), + lastName: varchar("last_name"), + status: enum_newsletter_subscribers_status("status").notNull().default("pending"), + source: varchar("source"), + subscribedAt: timestamp("subscribed_at", { mode: "string", withTimezone: true, precision: 3 }), + confirmedAt: timestamp("confirmed_at", { mode: "string", withTimezone: true, precision: 3 }), + unsubscribedAt: timestamp("unsubscribed_at", { mode: "string", withTimezone: true, precision: 3 }), + confirmationToken: varchar("confirmation_token"), + ipAddress: varchar("ip_address"), + userAgent: varchar("user_agent"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("newsletter_subscribers_tenant_idx").on(columns.tenant), + index("newsletter_subscribers_updated_at_idx").on(columns.updatedAt), + index("newsletter_subscribers_created_at_idx").on(columns.createdAt), + ], +); + +export const cookie_configurations_enabled_categories = pgTable( + "cookie_configurations_enabled_categories", + { + order: integer("order").notNull(), + parent: integer("parent_id").notNull(), + value: enum_cookie_configurations_enabled_categories("value"), + id: serial("id").primaryKey(), + }, + (columns) => [ + index("cookie_configurations_enabled_categories_order_idx").on(columns.order), + index("cookie_configurations_enabled_categories_parent_idx").on(columns.parent), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [cookie_configurations.id], + name: "cookie_configurations_enabled_categories_parent_fk", + }).onDelete("cascade"), + ], +); + +export const cookie_configurations = pgTable( + "cookie_configurations", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id") + .notNull() + .references(() => tenants.id, { + onDelete: "set null", + }), + title: varchar("title").notNull().default("Cookie-Einstellungen"), + revision: numeric("revision", { mode: "number" }).notNull().default(1), + translations_de_bannerTitle: varchar("translations_de_banner_title").default("Wir respektieren Ihre Privatsphäre"), + translations_de_bannerDescription: varchar("translations_de_banner_description").default( + "Diese Website verwendet Cookies, um Ihnen die bestmögliche Erfahrung zu bieten.", + ), + translations_de_acceptAllButton: varchar("translations_de_accept_all_button").default("Alle akzeptieren"), + translations_de_acceptNecessaryButton: varchar("translations_de_accept_necessary_button").default("Nur notwendige"), + translations_de_settingsButton: varchar("translations_de_settings_button").default("Einstellungen"), + translations_de_saveButton: varchar("translations_de_save_button").default("Auswahl speichern"), + translations_de_privacyPolicyUrl: varchar("translations_de_privacy_policy_url").default("/datenschutz"), + translations_de_categoryLabels_necessary_title: varchar("translations_de_category_labels_necessary_title").default( + "Notwendig", + ), + translations_de_categoryLabels_necessary_description: varchar( + "translations_de_category_labels_necessary_description", + ).default("Diese Cookies sind für die Grundfunktionen der Website erforderlich."), + translations_de_categoryLabels_functional_title: varchar( + "translations_de_category_labels_functional_title", + ).default("Funktional"), + translations_de_categoryLabels_functional_description: varchar( + "translations_de_category_labels_functional_description", + ).default("Diese Cookies ermöglichen erweiterte Funktionen."), + translations_de_categoryLabels_analytics_title: varchar("translations_de_category_labels_analytics_title").default( + "Statistik", + ), + translations_de_categoryLabels_analytics_description: varchar( + "translations_de_category_labels_analytics_description", + ).default("Diese Cookies helfen uns zu verstehen, wie Besucher die Website nutzen."), + translations_de_categoryLabels_marketing_title: varchar("translations_de_category_labels_marketing_title").default( + "Marketing", + ), + translations_de_categoryLabels_marketing_description: varchar( + "translations_de_category_labels_marketing_description", + ).default("Diese Cookies werden für Werbezwecke verwendet."), + styling_position: enum_cookie_configurations_styling_position("styling_position").default("bottom"), + styling_theme: enum_cookie_configurations_styling_theme("styling_theme").default("dark"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + uniqueIndex("cookie_configurations_tenant_idx").on(columns.tenant), + index("cookie_configurations_updated_at_idx").on(columns.updatedAt), + index("cookie_configurations_created_at_idx").on(columns.createdAt), + ], +); + +export const cookie_inventory = pgTable( + "cookie_inventory", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id") + .notNull() + .references(() => tenants.id, { + onDelete: "set null", + }), + name: varchar("name").notNull(), + provider: varchar("provider").notNull(), + category: enum_cookie_inventory_category("category").notNull(), + duration: varchar("duration").notNull(), + description: varchar("description").notNull(), + isActive: boolean("is_active").default(true), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("cookie_inventory_tenant_idx").on(columns.tenant), + index("cookie_inventory_updated_at_idx").on(columns.updatedAt), + index("cookie_inventory_created_at_idx").on(columns.createdAt), + ], +); + +export const consent_logs = pgTable( + "consent_logs", + { + id: serial("id").primaryKey(), + consentId: varchar("consent_id").notNull(), + clientRef: varchar("client_ref"), + tenant: integer("tenant_id") + .notNull() + .references(() => tenants.id, { + onDelete: "set null", + }), + categories: jsonb("categories").notNull(), + revision: numeric("revision", { mode: "number" }).notNull(), + userAgent: varchar("user_agent"), + anonymizedIp: varchar("anonymized_ip"), + expiresAt: timestamp("expires_at", { mode: "string", withTimezone: true, precision: 3 }).notNull(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + uniqueIndex("consent_logs_consent_id_idx").on(columns.consentId), + index("consent_logs_tenant_idx").on(columns.tenant), + index("consent_logs_updated_at_idx").on(columns.updatedAt), + index("consent_logs_created_at_idx").on(columns.createdAt), + ], +); + +export const privacy_policy_settings = pgTable( + "privacy_policy_settings", + { + id: serial("id").primaryKey(), + tenant: integer("tenant_id") + .notNull() + .references(() => tenants.id, { + onDelete: "set null", + }), + title: varchar("title").notNull().default("Datenschutzerklärung"), + provider: enum_privacy_policy_settings_provider("provider").notNull().default("alfright"), + alfright_tenantId: varchar("alfright_tenant_id").default("alfright_schutzteam"), + alfright_apiKey: varchar("alfright_api_key"), + alfright_language: enum_privacy_policy_settings_alfright_language("alfright_language").default("de-de"), + alfright_iframeHeight: numeric("alfright_iframe_height", { mode: "number" }).default(4000), + styling_headerColor: varchar("styling_header_color").default("#ca8a04"), + styling_headerFont: varchar("styling_header_font").default("Inter, sans-serif"), + styling_headerSize: varchar("styling_header_size").default("24px"), + styling_subheaderSize: varchar("styling_subheader_size").default("18px"), + styling_fontColor: varchar("styling_font_color").default("#f3f4f6"), + styling_textFont: varchar("styling_text_font").default("Inter, sans-serif"), + styling_textSize: varchar("styling_text_size").default("16px"), + styling_linkColor: varchar("styling_link_color").default("#ca8a04"), + styling_backgroundColor: varchar("styling_background_color").default("#111827"), + showCookieTable: boolean("show_cookie_table").default(true), + cookieTableTitle: varchar("cookie_table_title").default("Übersicht der verwendeten Cookies"), + cookieTableDescription: varchar("cookie_table_description").default( + 'Ergänzend zur Datenschutzerklärung finden Sie hier eine detaillierte Übersicht aller auf dieser Website eingesetzten Cookies. Sie können Ihre Cookie-Einstellungen jederzeit über den Link "Cookie-Einstellungen" im Footer anpassen.', + ), + seo_metaTitle: varchar("seo_meta_title").default("Datenschutzerklärung"), + seo_metaDescription: varchar("seo_meta_description").default( + "Informationen zum Datenschutz und zur Verarbeitung Ihrer personenbezogenen Daten.", + ), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + uniqueIndex("privacy_policy_settings_tenant_idx").on(columns.tenant), + index("privacy_policy_settings_updated_at_idx").on(columns.updatedAt), + index("privacy_policy_settings_created_at_idx").on(columns.createdAt), + ], +); + +export const forms_blocks_checkbox = pgTable( + "forms_blocks_checkbox", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + required: boolean("required"), + defaultValue: boolean("default_value"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_checkbox_order_idx").on(columns._order), + index("forms_blocks_checkbox_parent_id_idx").on(columns._parentID), + index("forms_blocks_checkbox_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_checkbox_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_email = pgTable( + "forms_blocks_email", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + required: boolean("required"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_email_order_idx").on(columns._order), + index("forms_blocks_email_parent_id_idx").on(columns._parentID), + index("forms_blocks_email_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_email_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_message = pgTable( + "forms_blocks_message", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + message: jsonb("message"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_message_order_idx").on(columns._order), + index("forms_blocks_message_parent_id_idx").on(columns._parentID), + index("forms_blocks_message_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_message_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_number = pgTable( + "forms_blocks_number", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + defaultValue: numeric("default_value", { mode: "number" }), + required: boolean("required"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_number_order_idx").on(columns._order), + index("forms_blocks_number_parent_id_idx").on(columns._parentID), + index("forms_blocks_number_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_number_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_select_options = pgTable( + "forms_blocks_select_options", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + label: varchar("label").notNull(), + value: varchar("value").notNull(), + }, + (columns) => [ + index("forms_blocks_select_options_order_idx").on(columns._order), + index("forms_blocks_select_options_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms_blocks_select.id], + name: "forms_blocks_select_options_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_select = pgTable( + "forms_blocks_select", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + defaultValue: varchar("default_value"), + placeholder: varchar("placeholder"), + required: boolean("required"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_select_order_idx").on(columns._order), + index("forms_blocks_select_parent_id_idx").on(columns._parentID), + index("forms_blocks_select_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_select_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_text = pgTable( + "forms_blocks_text", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + defaultValue: varchar("default_value"), + required: boolean("required"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_text_order_idx").on(columns._order), + index("forms_blocks_text_parent_id_idx").on(columns._parentID), + index("forms_blocks_text_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_text_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_blocks_textarea = pgTable( + "forms_blocks_textarea", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + _path: text("_path").notNull(), + id: varchar("id").primaryKey(), + name: varchar("name").notNull(), + label: varchar("label"), + width: numeric("width", { mode: "number" }), + defaultValue: varchar("default_value"), + required: boolean("required"), + blockName: varchar("block_name"), + }, + (columns) => [ + index("forms_blocks_textarea_order_idx").on(columns._order), + index("forms_blocks_textarea_parent_id_idx").on(columns._parentID), + index("forms_blocks_textarea_path_idx").on(columns._path), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_blocks_textarea_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms_emails = pgTable( + "forms_emails", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + emailTo: varchar("email_to"), + cc: varchar("cc"), + bcc: varchar("bcc"), + replyTo: varchar("reply_to"), + emailFrom: varchar("email_from"), + subject: varchar("subject").notNull().default("You've received a new message."), + message: jsonb("message"), + }, + (columns) => [ + index("forms_emails_order_idx").on(columns._order), + index("forms_emails_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [forms.id], + name: "forms_emails_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const forms = pgTable( + "forms", + { + id: serial("id").primaryKey(), + title: varchar("title").notNull(), + submitButtonLabel: varchar("submit_button_label"), + confirmationType: enum_forms_confirmation_type("confirmation_type").default("message"), + confirmationMessage: jsonb("confirmation_message"), + redirect_url: varchar("redirect_url"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("forms_updated_at_idx").on(columns.updatedAt), + index("forms_created_at_idx").on(columns.createdAt), + ], +); + +export const form_submissions_submission_data = pgTable( + "form_submissions_submission_data", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + field: varchar("field").notNull(), + value: varchar("value").notNull(), + }, + (columns) => [ + index("form_submissions_submission_data_order_idx").on(columns._order), + index("form_submissions_submission_data_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [form_submissions.id], + name: "form_submissions_submission_data_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const form_submissions = pgTable( + "form_submissions", + { + id: serial("id").primaryKey(), + form: integer("form_id") + .notNull() + .references(() => forms.id, { + onDelete: "set null", + }), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("form_submissions_form_idx").on(columns.form), + index("form_submissions_updated_at_idx").on(columns.updatedAt), + index("form_submissions_created_at_idx").on(columns.createdAt), + ], +); + +export const redirects = pgTable( + "redirects", + { + id: serial("id").primaryKey(), + from: varchar("from").notNull(), + to_type: enum_redirects_to_type("to_type").default("reference"), + to_url: varchar("to_url"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + uniqueIndex("redirects_from_idx").on(columns.from), + index("redirects_updated_at_idx").on(columns.updatedAt), + index("redirects_created_at_idx").on(columns.createdAt), + ], +); + +export const payload_kv = pgTable( + "payload_kv", + { + id: serial("id").primaryKey(), + key: varchar("key").notNull(), + data: jsonb("data").notNull(), + }, + (columns) => [uniqueIndex("payload_kv_key_idx").on(columns.key)], +); + +export const payload_locked_documents = pgTable( + "payload_locked_documents", + { + id: serial("id").primaryKey(), + globalSlug: varchar("global_slug"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("payload_locked_documents_global_slug_idx").on(columns.globalSlug), + index("payload_locked_documents_updated_at_idx").on(columns.updatedAt), + index("payload_locked_documents_created_at_idx").on(columns.createdAt), + ], +); + +export const payload_locked_documents_rels = pgTable( + "payload_locked_documents_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + usersID: integer("users_id"), + mediaID: integer("media_id"), + tenantsID: integer("tenants_id"), + pagesID: integer("pages_id"), + postsID: integer("posts_id"), + categoriesID: integer("categories_id"), + "social-linksID": integer("social_links_id"), + testimonialsID: integer("testimonials_id"), + "newsletter-subscribersID": integer("newsletter_subscribers_id"), + "cookie-configurationsID": integer("cookie_configurations_id"), + "cookie-inventoryID": integer("cookie_inventory_id"), + "consent-logsID": integer("consent_logs_id"), + "privacy-policy-settingsID": integer("privacy_policy_settings_id"), + formsID: integer("forms_id"), + "form-submissionsID": integer("form_submissions_id"), + redirectsID: integer("redirects_id"), + }, + (columns) => [ + index("payload_locked_documents_rels_order_idx").on(columns.order), + index("payload_locked_documents_rels_parent_idx").on(columns.parent), + index("payload_locked_documents_rels_path_idx").on(columns.path), + index("payload_locked_documents_rels_users_id_idx").on(columns.usersID), + index("payload_locked_documents_rels_media_id_idx").on(columns.mediaID), + index("payload_locked_documents_rels_tenants_id_idx").on(columns.tenantsID), + index("payload_locked_documents_rels_pages_id_idx").on(columns.pagesID), + index("payload_locked_documents_rels_posts_id_idx").on(columns.postsID), + index("payload_locked_documents_rels_categories_id_idx").on(columns.categoriesID), + index("payload_locked_documents_rels_social_links_id_idx").on(columns["social-linksID"]), + index("payload_locked_documents_rels_testimonials_id_idx").on(columns.testimonialsID), + index("payload_locked_documents_rels_newsletter_subscribers_id_idx").on(columns["newsletter-subscribersID"]), + index("payload_locked_documents_rels_cookie_configurations_id_idx").on(columns["cookie-configurationsID"]), + index("payload_locked_documents_rels_cookie_inventory_id_idx").on(columns["cookie-inventoryID"]), + index("payload_locked_documents_rels_consent_logs_id_idx").on(columns["consent-logsID"]), + index("payload_locked_documents_rels_privacy_policy_settings_id_idx").on(columns["privacy-policy-settingsID"]), + index("payload_locked_documents_rels_forms_id_idx").on(columns.formsID), + index("payload_locked_documents_rels_form_submissions_id_idx").on(columns["form-submissionsID"]), + index("payload_locked_documents_rels_redirects_id_idx").on(columns.redirectsID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [payload_locked_documents.id], + name: "payload_locked_documents_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["usersID"]], + foreignColumns: [users.id], + name: "payload_locked_documents_rels_users_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["mediaID"]], + foreignColumns: [media.id], + name: "payload_locked_documents_rels_media_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["tenantsID"]], + foreignColumns: [tenants.id], + name: "payload_locked_documents_rels_tenants_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["pagesID"]], + foreignColumns: [pages.id], + name: "payload_locked_documents_rels_pages_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["postsID"]], + foreignColumns: [posts.id], + name: "payload_locked_documents_rels_posts_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["categoriesID"]], + foreignColumns: [categories.id], + name: "payload_locked_documents_rels_categories_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["social-linksID"]], + foreignColumns: [social_links.id], + name: "payload_locked_documents_rels_social_links_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["testimonialsID"]], + foreignColumns: [testimonials.id], + name: "payload_locked_documents_rels_testimonials_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["newsletter-subscribersID"]], + foreignColumns: [newsletter_subscribers.id], + name: "payload_locked_documents_rels_newsletter_subscribers_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["cookie-configurationsID"]], + foreignColumns: [cookie_configurations.id], + name: "payload_locked_documents_rels_cookie_configurations_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["cookie-inventoryID"]], + foreignColumns: [cookie_inventory.id], + name: "payload_locked_documents_rels_cookie_inventory_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["consent-logsID"]], + foreignColumns: [consent_logs.id], + name: "payload_locked_documents_rels_consent_logs_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["privacy-policy-settingsID"]], + foreignColumns: [privacy_policy_settings.id], + name: "payload_locked_documents_rels_privacy_policy_settings_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["formsID"]], + foreignColumns: [forms.id], + name: "payload_locked_documents_rels_forms_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["form-submissionsID"]], + foreignColumns: [form_submissions.id], + name: "payload_locked_documents_rels_form_submissions_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["redirectsID"]], + foreignColumns: [redirects.id], + name: "payload_locked_documents_rels_redirects_fk", + }).onDelete("cascade"), + ], +); + +export const payload_preferences = pgTable( + "payload_preferences", + { + id: serial("id").primaryKey(), + key: varchar("key"), + value: jsonb("value"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("payload_preferences_key_idx").on(columns.key), + index("payload_preferences_updated_at_idx").on(columns.updatedAt), + index("payload_preferences_created_at_idx").on(columns.createdAt), + ], +); + +export const payload_preferences_rels = pgTable( + "payload_preferences_rels", + { + id: serial("id").primaryKey(), + order: integer("order"), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + usersID: integer("users_id"), + }, + (columns) => [ + index("payload_preferences_rels_order_idx").on(columns.order), + index("payload_preferences_rels_parent_idx").on(columns.parent), + index("payload_preferences_rels_path_idx").on(columns.path), + index("payload_preferences_rels_users_id_idx").on(columns.usersID), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [payload_preferences.id], + name: "payload_preferences_rels_parent_fk", + }).onDelete("cascade"), + foreignKey({ + columns: [columns["usersID"]], + foreignColumns: [users.id], + name: "payload_preferences_rels_users_fk", + }).onDelete("cascade"), + ], +); + +export const payload_migrations = pgTable( + "payload_migrations", + { + id: serial("id").primaryKey(), + name: varchar("name"), + batch: numeric("batch", { mode: "number" }), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }).defaultNow().notNull(), + }, + (columns) => [ + index("payload_migrations_updated_at_idx").on(columns.updatedAt), + index("payload_migrations_created_at_idx").on(columns.createdAt), + ], +); + +export const site_settings = pgTable( + "site_settings", + { + id: serial("id").primaryKey(), + siteName: varchar("site_name").default("porwoll.de"), + siteTagline: varchar("site_tagline"), + logo: integer("logo_id").references(() => media.id, { + onDelete: "set null", + }), + favicon: integer("favicon_id").references(() => media.id, { + onDelete: "set null", + }), + contact_email: varchar("contact_email"), + contact_phone: varchar("contact_phone"), + contact_address: varchar("contact_address"), + footer_copyrightText: varchar("footer_copyright_text"), + footer_showSocialLinks: boolean("footer_show_social_links").default(true), + seo_defaultMetaTitle: varchar("seo_default_meta_title"), + seo_defaultMetaDescription: varchar("seo_default_meta_description"), + seo_defaultOgImage: integer("seo_default_og_image_id").references(() => media.id, { + onDelete: "set null", + }), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }), + }, + (columns) => [ + index("site_settings_logo_idx").on(columns.logo), + index("site_settings_favicon_idx").on(columns.favicon), + index("site_settings_seo_seo_default_og_image_idx").on(columns.seo_defaultOgImage), + ], +); + +export const navigation_main_menu_submenu = pgTable( + "navigation_main_menu_submenu", + { + _order: integer("_order").notNull(), + _parentID: varchar("_parent_id").notNull(), + id: varchar("id").primaryKey(), + label: varchar("label"), + linkType: enum_navigation_main_menu_submenu_link_type("link_type").default("page"), + page: integer("page_id").references(() => pages.id, { + onDelete: "set null", + }), + url: varchar("url"), + }, + (columns) => [ + index("navigation_main_menu_submenu_order_idx").on(columns._order), + index("navigation_main_menu_submenu_parent_id_idx").on(columns._parentID), + index("navigation_main_menu_submenu_page_idx").on(columns.page), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [navigation_main_menu.id], + name: "navigation_main_menu_submenu_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const navigation_main_menu = pgTable( + "navigation_main_menu", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + label: varchar("label").notNull(), + type: enum_navigation_main_menu_type("type").default("page"), + page: integer("page_id").references(() => pages.id, { + onDelete: "set null", + }), + url: varchar("url"), + openInNewTab: boolean("open_in_new_tab").default(false), + }, + (columns) => [ + index("navigation_main_menu_order_idx").on(columns._order), + index("navigation_main_menu_parent_id_idx").on(columns._parentID), + index("navigation_main_menu_page_idx").on(columns.page), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [navigation.id], + name: "navigation_main_menu_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const navigation_footer_menu = pgTable( + "navigation_footer_menu", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + label: varchar("label").notNull(), + linkType: enum_navigation_footer_menu_link_type("link_type").default("page"), + page: integer("page_id").references(() => pages.id, { + onDelete: "set null", + }), + url: varchar("url"), + }, + (columns) => [ + index("navigation_footer_menu_order_idx").on(columns._order), + index("navigation_footer_menu_parent_id_idx").on(columns._parentID), + index("navigation_footer_menu_page_idx").on(columns.page), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [navigation.id], + name: "navigation_footer_menu_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const navigation = pgTable("navigation", { + id: serial("id").primaryKey(), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }), +}); + +export const seo_settings_social_profiles = pgTable( + "seo_settings_social_profiles", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + platform: enum_seo_settings_social_profiles_platform("platform"), + url: varchar("url").notNull(), + }, + (columns) => [ + index("seo_settings_social_profiles_order_idx").on(columns._order), + index("seo_settings_social_profiles_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [seo_settings.id], + name: "seo_settings_social_profiles_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const seo_settings_local_business_opening_hours = pgTable( + "seo_settings_local_business_opening_hours", + { + _order: integer("_order").notNull(), + _parentID: integer("_parent_id").notNull(), + id: varchar("id").primaryKey(), + specification: varchar("specification"), + }, + (columns) => [ + index("seo_settings_local_business_opening_hours_order_idx").on(columns._order), + index("seo_settings_local_business_opening_hours_parent_id_idx").on(columns._parentID), + foreignKey({ + columns: [columns["_parentID"]], + foreignColumns: [seo_settings.id], + name: "seo_settings_local_business_opening_hours_parent_id_fk", + }).onDelete("cascade"), + ], +); + +export const seo_settings = pgTable( + "seo_settings", + { + id: serial("id").primaryKey(), + metaDefaults_titleSuffix: varchar("meta_defaults_title_suffix").default("| Website"), + metaDefaults_defaultDescription: varchar("meta_defaults_default_description"), + metaDefaults_defaultOgImage: integer("meta_defaults_default_og_image_id").references(() => media.id, { + onDelete: "set null", + }), + organization_name: varchar("organization_name").notNull(), + organization_legalName: varchar("organization_legal_name"), + organization_description: varchar("organization_description"), + organization_logo: integer("organization_logo_id").references(() => media.id, { + onDelete: "set null", + }), + organization_foundingDate: timestamp("organization_founding_date", { + mode: "string", + withTimezone: true, + precision: 3, + }), + contact_email: varchar("contact_email"), + contact_phone: varchar("contact_phone"), + contact_fax: varchar("contact_fax"), + address_street: varchar("address_street"), + address_postalCode: varchar("address_postal_code"), + address_city: varchar("address_city"), + address_region: varchar("address_region"), + address_country: varchar("address_country").default("Deutschland"), + address_countryCode: varchar("address_country_code").default("DE"), + geo_latitude: numeric("geo_latitude", { mode: "number" }), + geo_longitude: numeric("geo_longitude", { mode: "number" }), + localBusiness_enabled: boolean("local_business_enabled").default(false), + localBusiness_type: enum_seo_settings_local_business_type("local_business_type"), + localBusiness_priceRange: enum_seo_settings_local_business_price_range("local_business_price_range"), + robots_allowIndexing: boolean("robots_allow_indexing").default(true), + verification_google: varchar("verification_google"), + verification_bing: varchar("verification_bing"), + verification_yandex: varchar("verification_yandex"), + updatedAt: timestamp("updated_at", { mode: "string", withTimezone: true, precision: 3 }), + createdAt: timestamp("created_at", { mode: "string", withTimezone: true, precision: 3 }), + }, + (columns) => [ + index("seo_settings_meta_defaults_meta_defaults_default_og_imag_idx").on(columns.metaDefaults_defaultOgImage), + index("seo_settings_organization_organization_logo_idx").on(columns.organization_logo), + ], +); + +export const seo_settings_texts = pgTable( + "seo_settings_texts", + { + id: serial("id").primaryKey(), + order: integer("order").notNull(), + parent: integer("parent_id").notNull(), + path: varchar("path").notNull(), + text: varchar("text"), + }, + (columns) => [ + index("seo_settings_texts_order_parent").on(columns.order, columns.parent), + foreignKey({ + columns: [columns["parent"]], + foreignColumns: [seo_settings.id], + name: "seo_settings_texts_parent_fk", + }).onDelete("cascade"), + ], +); + +export const relations_users_tenants = relations(users_tenants, ({ one }) => ({ + _parentID: one(users, { + fields: [users_tenants._parentID], + references: [users.id], + relationName: "tenants", + }), + tenant: one(tenants, { + fields: [users_tenants.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_users_sessions = relations(users_sessions, ({ one }) => ({ + _parentID: one(users, { + fields: [users_sessions._parentID], + references: [users.id], + relationName: "sessions", + }), +})); +export const relations_users = relations(users, ({ many }) => ({ + tenants: many(users_tenants, { + relationName: "tenants", + }), + sessions: many(users_sessions, { + relationName: "sessions", + }), +})); +export const relations_media_texts = relations(media_texts, ({ one }) => ({ + parent: one(media, { + fields: [media_texts.parent], + references: [media.id], + relationName: "_texts", + }), +})); +export const relations_media = relations(media, ({ one, many }) => ({ + tenant: one(tenants, { + fields: [media.tenant], + references: [tenants.id], + relationName: "tenant", + }), + _texts: many(media_texts, { + relationName: "_texts", + }), +})); +export const relations_tenants_domains = relations(tenants_domains, ({ one }) => ({ + _parentID: one(tenants, { + fields: [tenants_domains._parentID], + references: [tenants.id], + relationName: "domains", + }), +})); +export const relations_tenants = relations(tenants, ({ many }) => ({ + domains: many(tenants_domains, { + relationName: "domains", + }), +})); +export const relations_pages_blocks_hero_block = relations(pages_blocks_hero_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_hero_block._parentID], + references: [pages.id], + relationName: "_blocks_hero-block", + }), + backgroundImage: one(media, { + fields: [pages_blocks_hero_block.backgroundImage], + references: [media.id], + relationName: "backgroundImage", + }), +})); +export const relations_pages_blocks_text_block = relations(pages_blocks_text_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_text_block._parentID], + references: [pages.id], + relationName: "_blocks_text-block", + }), +})); +export const relations_pages_blocks_image_text_block = relations(pages_blocks_image_text_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_image_text_block._parentID], + references: [pages.id], + relationName: "_blocks_image-text-block", + }), + image: one(media, { + fields: [pages_blocks_image_text_block.image], + references: [media.id], + relationName: "image", + }), +})); +export const relations_pages_blocks_card_grid_block_cards = relations( + pages_blocks_card_grid_block_cards, + ({ one }) => ({ + _parentID: one(pages_blocks_card_grid_block, { + fields: [pages_blocks_card_grid_block_cards._parentID], + references: [pages_blocks_card_grid_block.id], + relationName: "cards", + }), + image: one(media, { + fields: [pages_blocks_card_grid_block_cards.image], + references: [media.id], + relationName: "image", + }), + }), +); +export const relations_pages_blocks_card_grid_block = relations(pages_blocks_card_grid_block, ({ one, many }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_card_grid_block._parentID], + references: [pages.id], + relationName: "_blocks_card-grid-block", + }), + cards: many(pages_blocks_card_grid_block_cards, { + relationName: "cards", + }), +})); +export const relations_pages_blocks_quote_block = relations(pages_blocks_quote_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_quote_block._parentID], + references: [pages.id], + relationName: "_blocks_quote-block", + }), + image: one(media, { + fields: [pages_blocks_quote_block.image], + references: [media.id], + relationName: "image", + }), +})); +export const relations_pages_blocks_cta_block_buttons = relations(pages_blocks_cta_block_buttons, ({ one }) => ({ + _parentID: one(pages_blocks_cta_block, { + fields: [pages_blocks_cta_block_buttons._parentID], + references: [pages_blocks_cta_block.id], + relationName: "buttons", + }), +})); +export const relations_pages_blocks_cta_block = relations(pages_blocks_cta_block, ({ one, many }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_cta_block._parentID], + references: [pages.id], + relationName: "_blocks_cta-block", + }), + buttons: many(pages_blocks_cta_block_buttons, { + relationName: "buttons", + }), +})); +export const relations_pages_blocks_contact_form_block = relations(pages_blocks_contact_form_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_contact_form_block._parentID], + references: [pages.id], + relationName: "_blocks_contact-form-block", + }), +})); +export const relations_pages_blocks_timeline_block_items = relations(pages_blocks_timeline_block_items, ({ one }) => ({ + _parentID: one(pages_blocks_timeline_block, { + fields: [pages_blocks_timeline_block_items._parentID], + references: [pages_blocks_timeline_block.id], + relationName: "items", + }), + image: one(media, { + fields: [pages_blocks_timeline_block_items.image], + references: [media.id], + relationName: "image", + }), +})); +export const relations_pages_blocks_timeline_block = relations(pages_blocks_timeline_block, ({ one, many }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_timeline_block._parentID], + references: [pages.id], + relationName: "_blocks_timeline-block", + }), + items: many(pages_blocks_timeline_block_items, { + relationName: "items", + }), +})); +export const relations_pages_blocks_divider_block = relations(pages_blocks_divider_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_divider_block._parentID], + references: [pages.id], + relationName: "_blocks_divider-block", + }), +})); +export const relations_pages_blocks_video_block = relations(pages_blocks_video_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_video_block._parentID], + references: [pages.id], + relationName: "_blocks_video-block", + }), +})); +export const relations_pages_blocks_posts_list_block = relations(pages_blocks_posts_list_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_posts_list_block._parentID], + references: [pages.id], + relationName: "_blocks_posts-list-block", + }), +})); +export const relations_pages_blocks_testimonials_block = relations(pages_blocks_testimonials_block, ({ one }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_testimonials_block._parentID], + references: [pages.id], + relationName: "_blocks_testimonials-block", + }), +})); +export const relations_pages_blocks_newsletter_block_available_interests = relations( + pages_blocks_newsletter_block_available_interests, + ({ one }) => ({ + parent: one(pages_blocks_newsletter_block, { + fields: [pages_blocks_newsletter_block_available_interests.parent], + references: [pages_blocks_newsletter_block.id], + relationName: "availableInterests", + }), + }), +); +export const relations_pages_blocks_newsletter_block = relations(pages_blocks_newsletter_block, ({ one, many }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_newsletter_block._parentID], + references: [pages.id], + relationName: "_blocks_newsletter-block", + }), + image: one(media, { + fields: [pages_blocks_newsletter_block.image], + references: [media.id], + relationName: "image", + }), + availableInterests: many(pages_blocks_newsletter_block_available_interests, { + relationName: "availableInterests", + }), +})); +export const relations_pages_blocks_process_steps_block_steps = relations( + pages_blocks_process_steps_block_steps, + ({ one }) => ({ + _parentID: one(pages_blocks_process_steps_block, { + fields: [pages_blocks_process_steps_block_steps._parentID], + references: [pages_blocks_process_steps_block.id], + relationName: "steps", + }), + image: one(media, { + fields: [pages_blocks_process_steps_block_steps.image], + references: [media.id], + relationName: "image", + }), + }), +); +export const relations_pages_blocks_process_steps_block = relations( + pages_blocks_process_steps_block, + ({ one, many }) => ({ + _parentID: one(pages, { + fields: [pages_blocks_process_steps_block._parentID], + references: [pages.id], + relationName: "_blocks_process-steps-block", + }), + steps: many(pages_blocks_process_steps_block_steps, { + relationName: "steps", + }), + }), +); +export const relations_pages_rels = relations(pages_rels, ({ one }) => ({ + parent: one(pages, { + fields: [pages_rels.parent], + references: [pages.id], + relationName: "_rels", + }), + categoriesID: one(categories, { + fields: [pages_rels.categoriesID], + references: [categories.id], + relationName: "categories", + }), + testimonialsID: one(testimonials, { + fields: [pages_rels.testimonialsID], + references: [testimonials.id], + relationName: "testimonials", + }), +})); +export const relations_pages = relations(pages, ({ one, many }) => ({ + tenant: one(tenants, { + fields: [pages.tenant], + references: [tenants.id], + relationName: "tenant", + }), + hero_image: one(media, { + fields: [pages.hero_image], + references: [media.id], + relationName: "hero_image", + }), + "_blocks_hero-block": many(pages_blocks_hero_block, { + relationName: "_blocks_hero-block", + }), + "_blocks_text-block": many(pages_blocks_text_block, { + relationName: "_blocks_text-block", + }), + "_blocks_image-text-block": many(pages_blocks_image_text_block, { + relationName: "_blocks_image-text-block", + }), + "_blocks_card-grid-block": many(pages_blocks_card_grid_block, { + relationName: "_blocks_card-grid-block", + }), + "_blocks_quote-block": many(pages_blocks_quote_block, { + relationName: "_blocks_quote-block", + }), + "_blocks_cta-block": many(pages_blocks_cta_block, { + relationName: "_blocks_cta-block", + }), + "_blocks_contact-form-block": many(pages_blocks_contact_form_block, { + relationName: "_blocks_contact-form-block", + }), + "_blocks_timeline-block": many(pages_blocks_timeline_block, { + relationName: "_blocks_timeline-block", + }), + "_blocks_divider-block": many(pages_blocks_divider_block, { + relationName: "_blocks_divider-block", + }), + "_blocks_video-block": many(pages_blocks_video_block, { + relationName: "_blocks_video-block", + }), + "_blocks_posts-list-block": many(pages_blocks_posts_list_block, { + relationName: "_blocks_posts-list-block", + }), + "_blocks_testimonials-block": many(pages_blocks_testimonials_block, { + relationName: "_blocks_testimonials-block", + }), + "_blocks_newsletter-block": many(pages_blocks_newsletter_block, { + relationName: "_blocks_newsletter-block", + }), + "_blocks_process-steps-block": many(pages_blocks_process_steps_block, { + relationName: "_blocks_process-steps-block", + }), + seo_ogImage: one(media, { + fields: [pages.seo_ogImage], + references: [media.id], + relationName: "seo_ogImage", + }), + _rels: many(pages_rels, { + relationName: "_rels", + }), +})); +export const relations_posts_rels = relations(posts_rels, ({ one }) => ({ + parent: one(posts, { + fields: [posts_rels.parent], + references: [posts.id], + relationName: "_rels", + }), + categoriesID: one(categories, { + fields: [posts_rels.categoriesID], + references: [categories.id], + relationName: "categories", + }), +})); +export const relations_posts = relations(posts, ({ one, many }) => ({ + tenant: one(tenants, { + fields: [posts.tenant], + references: [tenants.id], + relationName: "tenant", + }), + featuredImage: one(media, { + fields: [posts.featuredImage], + references: [media.id], + relationName: "featuredImage", + }), + seo_ogImage: one(media, { + fields: [posts.seo_ogImage], + references: [media.id], + relationName: "seo_ogImage", + }), + _rels: many(posts_rels, { + relationName: "_rels", + }), +})); +export const relations_categories = relations(categories, ({ one }) => ({ + tenant: one(tenants, { + fields: [categories.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_social_links = relations(social_links, ({ one }) => ({ + tenant: one(tenants, { + fields: [social_links.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_testimonials = relations(testimonials, ({ one }) => ({ + tenant: one(tenants, { + fields: [testimonials.tenant], + references: [tenants.id], + relationName: "tenant", + }), + image: one(media, { + fields: [testimonials.image], + references: [media.id], + relationName: "image", + }), +})); +export const relations_newsletter_subscribers_interests = relations(newsletter_subscribers_interests, ({ one }) => ({ + parent: one(newsletter_subscribers, { + fields: [newsletter_subscribers_interests.parent], + references: [newsletter_subscribers.id], + relationName: "interests", + }), +})); +export const relations_newsletter_subscribers = relations(newsletter_subscribers, ({ one, many }) => ({ + tenant: one(tenants, { + fields: [newsletter_subscribers.tenant], + references: [tenants.id], + relationName: "tenant", + }), + interests: many(newsletter_subscribers_interests, { + relationName: "interests", + }), +})); +export const relations_cookie_configurations_enabled_categories = relations( + cookie_configurations_enabled_categories, + ({ one }) => ({ + parent: one(cookie_configurations, { + fields: [cookie_configurations_enabled_categories.parent], + references: [cookie_configurations.id], + relationName: "enabledCategories", + }), + }), +); +export const relations_cookie_configurations = relations(cookie_configurations, ({ one, many }) => ({ + tenant: one(tenants, { + fields: [cookie_configurations.tenant], + references: [tenants.id], + relationName: "tenant", + }), + enabledCategories: many(cookie_configurations_enabled_categories, { + relationName: "enabledCategories", + }), +})); +export const relations_cookie_inventory = relations(cookie_inventory, ({ one }) => ({ + tenant: one(tenants, { + fields: [cookie_inventory.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_consent_logs = relations(consent_logs, ({ one }) => ({ + tenant: one(tenants, { + fields: [consent_logs.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_privacy_policy_settings = relations(privacy_policy_settings, ({ one }) => ({ + tenant: one(tenants, { + fields: [privacy_policy_settings.tenant], + references: [tenants.id], + relationName: "tenant", + }), +})); +export const relations_forms_blocks_checkbox = relations(forms_blocks_checkbox, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_checkbox._parentID], + references: [forms.id], + relationName: "_blocks_checkbox", + }), +})); +export const relations_forms_blocks_email = relations(forms_blocks_email, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_email._parentID], + references: [forms.id], + relationName: "_blocks_email", + }), +})); +export const relations_forms_blocks_message = relations(forms_blocks_message, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_message._parentID], + references: [forms.id], + relationName: "_blocks_message", + }), +})); +export const relations_forms_blocks_number = relations(forms_blocks_number, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_number._parentID], + references: [forms.id], + relationName: "_blocks_number", + }), +})); +export const relations_forms_blocks_select_options = relations(forms_blocks_select_options, ({ one }) => ({ + _parentID: one(forms_blocks_select, { + fields: [forms_blocks_select_options._parentID], + references: [forms_blocks_select.id], + relationName: "options", + }), +})); +export const relations_forms_blocks_select = relations(forms_blocks_select, ({ one, many }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_select._parentID], + references: [forms.id], + relationName: "_blocks_select", + }), + options: many(forms_blocks_select_options, { + relationName: "options", + }), +})); +export const relations_forms_blocks_text = relations(forms_blocks_text, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_text._parentID], + references: [forms.id], + relationName: "_blocks_text", + }), +})); +export const relations_forms_blocks_textarea = relations(forms_blocks_textarea, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_blocks_textarea._parentID], + references: [forms.id], + relationName: "_blocks_textarea", + }), +})); +export const relations_forms_emails = relations(forms_emails, ({ one }) => ({ + _parentID: one(forms, { + fields: [forms_emails._parentID], + references: [forms.id], + relationName: "emails", + }), +})); +export const relations_forms = relations(forms, ({ many }) => ({ + _blocks_checkbox: many(forms_blocks_checkbox, { + relationName: "_blocks_checkbox", + }), + _blocks_email: many(forms_blocks_email, { + relationName: "_blocks_email", + }), + _blocks_message: many(forms_blocks_message, { + relationName: "_blocks_message", + }), + _blocks_number: many(forms_blocks_number, { + relationName: "_blocks_number", + }), + _blocks_select: many(forms_blocks_select, { + relationName: "_blocks_select", + }), + _blocks_text: many(forms_blocks_text, { + relationName: "_blocks_text", + }), + _blocks_textarea: many(forms_blocks_textarea, { + relationName: "_blocks_textarea", + }), + emails: many(forms_emails, { + relationName: "emails", + }), +})); +export const relations_form_submissions_submission_data = relations(form_submissions_submission_data, ({ one }) => ({ + _parentID: one(form_submissions, { + fields: [form_submissions_submission_data._parentID], + references: [form_submissions.id], + relationName: "submissionData", + }), +})); +export const relations_form_submissions = relations(form_submissions, ({ one, many }) => ({ + form: one(forms, { + fields: [form_submissions.form], + references: [forms.id], + relationName: "form", + }), + submissionData: many(form_submissions_submission_data, { + relationName: "submissionData", + }), +})); +export const relations_redirects = relations(redirects, () => ({})); +export const relations_payload_kv = relations(payload_kv, () => ({})); +export const relations_payload_locked_documents_rels = relations(payload_locked_documents_rels, ({ one }) => ({ + parent: one(payload_locked_documents, { + fields: [payload_locked_documents_rels.parent], + references: [payload_locked_documents.id], + relationName: "_rels", + }), + usersID: one(users, { + fields: [payload_locked_documents_rels.usersID], + references: [users.id], + relationName: "users", + }), + mediaID: one(media, { + fields: [payload_locked_documents_rels.mediaID], + references: [media.id], + relationName: "media", + }), + tenantsID: one(tenants, { + fields: [payload_locked_documents_rels.tenantsID], + references: [tenants.id], + relationName: "tenants", + }), + pagesID: one(pages, { + fields: [payload_locked_documents_rels.pagesID], + references: [pages.id], + relationName: "pages", + }), + postsID: one(posts, { + fields: [payload_locked_documents_rels.postsID], + references: [posts.id], + relationName: "posts", + }), + categoriesID: one(categories, { + fields: [payload_locked_documents_rels.categoriesID], + references: [categories.id], + relationName: "categories", + }), + "social-linksID": one(social_links, { + fields: [payload_locked_documents_rels["social-linksID"]], + references: [social_links.id], + relationName: "social-links", + }), + testimonialsID: one(testimonials, { + fields: [payload_locked_documents_rels.testimonialsID], + references: [testimonials.id], + relationName: "testimonials", + }), + "newsletter-subscribersID": one(newsletter_subscribers, { + fields: [payload_locked_documents_rels["newsletter-subscribersID"]], + references: [newsletter_subscribers.id], + relationName: "newsletter-subscribers", + }), + "cookie-configurationsID": one(cookie_configurations, { + fields: [payload_locked_documents_rels["cookie-configurationsID"]], + references: [cookie_configurations.id], + relationName: "cookie-configurations", + }), + "cookie-inventoryID": one(cookie_inventory, { + fields: [payload_locked_documents_rels["cookie-inventoryID"]], + references: [cookie_inventory.id], + relationName: "cookie-inventory", + }), + "consent-logsID": one(consent_logs, { + fields: [payload_locked_documents_rels["consent-logsID"]], + references: [consent_logs.id], + relationName: "consent-logs", + }), + "privacy-policy-settingsID": one(privacy_policy_settings, { + fields: [payload_locked_documents_rels["privacy-policy-settingsID"]], + references: [privacy_policy_settings.id], + relationName: "privacy-policy-settings", + }), + formsID: one(forms, { + fields: [payload_locked_documents_rels.formsID], + references: [forms.id], + relationName: "forms", + }), + "form-submissionsID": one(form_submissions, { + fields: [payload_locked_documents_rels["form-submissionsID"]], + references: [form_submissions.id], + relationName: "form-submissions", + }), + redirectsID: one(redirects, { + fields: [payload_locked_documents_rels.redirectsID], + references: [redirects.id], + relationName: "redirects", + }), +})); +export const relations_payload_locked_documents = relations(payload_locked_documents, ({ many }) => ({ + _rels: many(payload_locked_documents_rels, { + relationName: "_rels", + }), +})); +export const relations_payload_preferences_rels = relations(payload_preferences_rels, ({ one }) => ({ + parent: one(payload_preferences, { + fields: [payload_preferences_rels.parent], + references: [payload_preferences.id], + relationName: "_rels", + }), + usersID: one(users, { + fields: [payload_preferences_rels.usersID], + references: [users.id], + relationName: "users", + }), +})); +export const relations_payload_preferences = relations(payload_preferences, ({ many }) => ({ + _rels: many(payload_preferences_rels, { + relationName: "_rels", + }), +})); +export const relations_payload_migrations = relations(payload_migrations, () => ({})); +export const relations_site_settings = relations(site_settings, ({ one }) => ({ + logo: one(media, { + fields: [site_settings.logo], + references: [media.id], + relationName: "logo", + }), + favicon: one(media, { + fields: [site_settings.favicon], + references: [media.id], + relationName: "favicon", + }), + seo_defaultOgImage: one(media, { + fields: [site_settings.seo_defaultOgImage], + references: [media.id], + relationName: "seo_defaultOgImage", + }), +})); +export const relations_navigation_main_menu_submenu = relations(navigation_main_menu_submenu, ({ one }) => ({ + _parentID: one(navigation_main_menu, { + fields: [navigation_main_menu_submenu._parentID], + references: [navigation_main_menu.id], + relationName: "submenu", + }), + page: one(pages, { + fields: [navigation_main_menu_submenu.page], + references: [pages.id], + relationName: "page", + }), +})); +export const relations_navigation_main_menu = relations(navigation_main_menu, ({ one, many }) => ({ + _parentID: one(navigation, { + fields: [navigation_main_menu._parentID], + references: [navigation.id], + relationName: "mainMenu", + }), + page: one(pages, { + fields: [navigation_main_menu.page], + references: [pages.id], + relationName: "page", + }), + submenu: many(navigation_main_menu_submenu, { + relationName: "submenu", + }), +})); +export const relations_navigation_footer_menu = relations(navigation_footer_menu, ({ one }) => ({ + _parentID: one(navigation, { + fields: [navigation_footer_menu._parentID], + references: [navigation.id], + relationName: "footerMenu", + }), + page: one(pages, { + fields: [navigation_footer_menu.page], + references: [pages.id], + relationName: "page", + }), +})); +export const relations_navigation = relations(navigation, ({ many }) => ({ + mainMenu: many(navigation_main_menu, { + relationName: "mainMenu", + }), + footerMenu: many(navigation_footer_menu, { + relationName: "footerMenu", + }), +})); +export const relations_seo_settings_social_profiles = relations(seo_settings_social_profiles, ({ one }) => ({ + _parentID: one(seo_settings, { + fields: [seo_settings_social_profiles._parentID], + references: [seo_settings.id], + relationName: "socialProfiles", + }), +})); +export const relations_seo_settings_local_business_opening_hours = relations( + seo_settings_local_business_opening_hours, + ({ one }) => ({ + _parentID: one(seo_settings, { + fields: [seo_settings_local_business_opening_hours._parentID], + references: [seo_settings.id], + relationName: "localBusiness_openingHours", + }), + }), +); +export const relations_seo_settings_texts = relations(seo_settings_texts, ({ one }) => ({ + parent: one(seo_settings, { + fields: [seo_settings_texts.parent], + references: [seo_settings.id], + relationName: "_texts", + }), +})); +export const relations_seo_settings = relations(seo_settings, ({ one, many }) => ({ + metaDefaults_defaultOgImage: one(media, { + fields: [seo_settings.metaDefaults_defaultOgImage], + references: [media.id], + relationName: "metaDefaults_defaultOgImage", + }), + organization_logo: one(media, { + fields: [seo_settings.organization_logo], + references: [media.id], + relationName: "organization_logo", + }), + socialProfiles: many(seo_settings_social_profiles, { + relationName: "socialProfiles", + }), + localBusiness_openingHours: many(seo_settings_local_business_opening_hours, { + relationName: "localBusiness_openingHours", + }), + _texts: many(seo_settings_texts, { + relationName: "_texts", + }), +})); + +type DatabaseSchema = { + enum_pages_blocks_hero_block_alignment: typeof enum_pages_blocks_hero_block_alignment; + enum_pages_blocks_hero_block_cta_style: typeof enum_pages_blocks_hero_block_cta_style; + enum_pages_blocks_text_block_width: typeof enum_pages_blocks_text_block_width; + enum_pages_blocks_image_text_block_image_position: typeof enum_pages_blocks_image_text_block_image_position; + enum_pages_blocks_card_grid_block_columns: typeof enum_pages_blocks_card_grid_block_columns; + enum_pages_blocks_quote_block_style: typeof enum_pages_blocks_quote_block_style; + enum_pages_blocks_cta_block_buttons_style: typeof enum_pages_blocks_cta_block_buttons_style; + enum_pages_blocks_cta_block_background_color: typeof enum_pages_blocks_cta_block_background_color; + enum_pages_blocks_timeline_block_layout: typeof enum_pages_blocks_timeline_block_layout; + enum_pages_blocks_timeline_block_marker_style: typeof enum_pages_blocks_timeline_block_marker_style; + enum_pages_blocks_timeline_block_background_color: typeof enum_pages_blocks_timeline_block_background_color; + enum_pages_blocks_divider_block_style: typeof enum_pages_blocks_divider_block_style; + enum_pages_blocks_divider_block_spacing: typeof enum_pages_blocks_divider_block_spacing; + enum_pages_blocks_video_block_aspect_ratio: typeof enum_pages_blocks_video_block_aspect_ratio; + enum_pages_blocks_posts_list_block_post_type: typeof enum_pages_blocks_posts_list_block_post_type; + enum_pages_blocks_posts_list_block_layout: typeof enum_pages_blocks_posts_list_block_layout; + enum_pages_blocks_posts_list_block_columns: typeof enum_pages_blocks_posts_list_block_columns; + enum_pages_blocks_posts_list_block_background_color: typeof enum_pages_blocks_posts_list_block_background_color; + enum_pages_blocks_testimonials_block_layout: typeof enum_pages_blocks_testimonials_block_layout; + enum_pages_blocks_testimonials_block_columns: typeof enum_pages_blocks_testimonials_block_columns; + enum_pages_blocks_testimonials_block_display_mode: typeof enum_pages_blocks_testimonials_block_display_mode; + enum_pages_blocks_testimonials_block_background_color: typeof enum_pages_blocks_testimonials_block_background_color; + enum_pages_blocks_newsletter_block_available_interests: typeof enum_pages_blocks_newsletter_block_available_interests; + enum_pages_blocks_newsletter_block_layout: typeof enum_pages_blocks_newsletter_block_layout; + enum_pages_blocks_newsletter_block_image_position: typeof enum_pages_blocks_newsletter_block_image_position; + enum_pages_blocks_newsletter_block_background_color: typeof enum_pages_blocks_newsletter_block_background_color; + enum_pages_blocks_process_steps_block_layout: typeof enum_pages_blocks_process_steps_block_layout; + enum_pages_blocks_process_steps_block_cta_variant: typeof enum_pages_blocks_process_steps_block_cta_variant; + enum_pages_blocks_process_steps_block_background_color: typeof enum_pages_blocks_process_steps_block_background_color; + enum_pages_status: typeof enum_pages_status; + enum_posts_type: typeof enum_posts_type; + enum_posts_status: typeof enum_posts_status; + enum_social_links_platform: typeof enum_social_links_platform; + enum_newsletter_subscribers_interests: typeof enum_newsletter_subscribers_interests; + enum_newsletter_subscribers_status: typeof enum_newsletter_subscribers_status; + enum_cookie_configurations_enabled_categories: typeof enum_cookie_configurations_enabled_categories; + enum_cookie_configurations_styling_position: typeof enum_cookie_configurations_styling_position; + enum_cookie_configurations_styling_theme: typeof enum_cookie_configurations_styling_theme; + enum_cookie_inventory_category: typeof enum_cookie_inventory_category; + enum_privacy_policy_settings_provider: typeof enum_privacy_policy_settings_provider; + enum_privacy_policy_settings_alfright_language: typeof enum_privacy_policy_settings_alfright_language; + enum_forms_confirmation_type: typeof enum_forms_confirmation_type; + enum_redirects_to_type: typeof enum_redirects_to_type; + enum_navigation_main_menu_submenu_link_type: typeof enum_navigation_main_menu_submenu_link_type; + enum_navigation_main_menu_type: typeof enum_navigation_main_menu_type; + enum_navigation_footer_menu_link_type: typeof enum_navigation_footer_menu_link_type; + enum_seo_settings_social_profiles_platform: typeof enum_seo_settings_social_profiles_platform; + enum_seo_settings_local_business_type: typeof enum_seo_settings_local_business_type; + enum_seo_settings_local_business_price_range: typeof enum_seo_settings_local_business_price_range; + users_tenants: typeof users_tenants; + users_sessions: typeof users_sessions; + users: typeof users; + media: typeof media; + media_texts: typeof media_texts; + tenants_domains: typeof tenants_domains; + tenants: typeof tenants; + pages_blocks_hero_block: typeof pages_blocks_hero_block; + pages_blocks_text_block: typeof pages_blocks_text_block; + pages_blocks_image_text_block: typeof pages_blocks_image_text_block; + pages_blocks_card_grid_block_cards: typeof pages_blocks_card_grid_block_cards; + pages_blocks_card_grid_block: typeof pages_blocks_card_grid_block; + pages_blocks_quote_block: typeof pages_blocks_quote_block; + pages_blocks_cta_block_buttons: typeof pages_blocks_cta_block_buttons; + pages_blocks_cta_block: typeof pages_blocks_cta_block; + pages_blocks_contact_form_block: typeof pages_blocks_contact_form_block; + pages_blocks_timeline_block_items: typeof pages_blocks_timeline_block_items; + pages_blocks_timeline_block: typeof pages_blocks_timeline_block; + pages_blocks_divider_block: typeof pages_blocks_divider_block; + pages_blocks_video_block: typeof pages_blocks_video_block; + pages_blocks_posts_list_block: typeof pages_blocks_posts_list_block; + pages_blocks_testimonials_block: typeof pages_blocks_testimonials_block; + pages_blocks_newsletter_block_available_interests: typeof pages_blocks_newsletter_block_available_interests; + pages_blocks_newsletter_block: typeof pages_blocks_newsletter_block; + pages_blocks_process_steps_block_steps: typeof pages_blocks_process_steps_block_steps; + pages_blocks_process_steps_block: typeof pages_blocks_process_steps_block; + pages: typeof pages; + pages_rels: typeof pages_rels; + posts: typeof posts; + posts_rels: typeof posts_rels; + categories: typeof categories; + social_links: typeof social_links; + testimonials: typeof testimonials; + newsletter_subscribers_interests: typeof newsletter_subscribers_interests; + newsletter_subscribers: typeof newsletter_subscribers; + cookie_configurations_enabled_categories: typeof cookie_configurations_enabled_categories; + cookie_configurations: typeof cookie_configurations; + cookie_inventory: typeof cookie_inventory; + consent_logs: typeof consent_logs; + privacy_policy_settings: typeof privacy_policy_settings; + forms_blocks_checkbox: typeof forms_blocks_checkbox; + forms_blocks_email: typeof forms_blocks_email; + forms_blocks_message: typeof forms_blocks_message; + forms_blocks_number: typeof forms_blocks_number; + forms_blocks_select_options: typeof forms_blocks_select_options; + forms_blocks_select: typeof forms_blocks_select; + forms_blocks_text: typeof forms_blocks_text; + forms_blocks_textarea: typeof forms_blocks_textarea; + forms_emails: typeof forms_emails; + forms: typeof forms; + form_submissions_submission_data: typeof form_submissions_submission_data; + form_submissions: typeof form_submissions; + redirects: typeof redirects; + payload_kv: typeof payload_kv; + payload_locked_documents: typeof payload_locked_documents; + payload_locked_documents_rels: typeof payload_locked_documents_rels; + payload_preferences: typeof payload_preferences; + payload_preferences_rels: typeof payload_preferences_rels; + payload_migrations: typeof payload_migrations; + site_settings: typeof site_settings; + navigation_main_menu_submenu: typeof navigation_main_menu_submenu; + navigation_main_menu: typeof navigation_main_menu; + navigation_footer_menu: typeof navigation_footer_menu; + navigation: typeof navigation; + seo_settings_social_profiles: typeof seo_settings_social_profiles; + seo_settings_local_business_opening_hours: typeof seo_settings_local_business_opening_hours; + seo_settings: typeof seo_settings; + seo_settings_texts: typeof seo_settings_texts; + relations_users_tenants: typeof relations_users_tenants; + relations_users_sessions: typeof relations_users_sessions; + relations_users: typeof relations_users; + relations_media_texts: typeof relations_media_texts; + relations_media: typeof relations_media; + relations_tenants_domains: typeof relations_tenants_domains; + relations_tenants: typeof relations_tenants; + relations_pages_blocks_hero_block: typeof relations_pages_blocks_hero_block; + relations_pages_blocks_text_block: typeof relations_pages_blocks_text_block; + relations_pages_blocks_image_text_block: typeof relations_pages_blocks_image_text_block; + relations_pages_blocks_card_grid_block_cards: typeof relations_pages_blocks_card_grid_block_cards; + relations_pages_blocks_card_grid_block: typeof relations_pages_blocks_card_grid_block; + relations_pages_blocks_quote_block: typeof relations_pages_blocks_quote_block; + relations_pages_blocks_cta_block_buttons: typeof relations_pages_blocks_cta_block_buttons; + relations_pages_blocks_cta_block: typeof relations_pages_blocks_cta_block; + relations_pages_blocks_contact_form_block: typeof relations_pages_blocks_contact_form_block; + relations_pages_blocks_timeline_block_items: typeof relations_pages_blocks_timeline_block_items; + relations_pages_blocks_timeline_block: typeof relations_pages_blocks_timeline_block; + relations_pages_blocks_divider_block: typeof relations_pages_blocks_divider_block; + relations_pages_blocks_video_block: typeof relations_pages_blocks_video_block; + relations_pages_blocks_posts_list_block: typeof relations_pages_blocks_posts_list_block; + relations_pages_blocks_testimonials_block: typeof relations_pages_blocks_testimonials_block; + relations_pages_blocks_newsletter_block_available_interests: typeof relations_pages_blocks_newsletter_block_available_interests; + relations_pages_blocks_newsletter_block: typeof relations_pages_blocks_newsletter_block; + relations_pages_blocks_process_steps_block_steps: typeof relations_pages_blocks_process_steps_block_steps; + relations_pages_blocks_process_steps_block: typeof relations_pages_blocks_process_steps_block; + relations_pages_rels: typeof relations_pages_rels; + relations_pages: typeof relations_pages; + relations_posts_rels: typeof relations_posts_rels; + relations_posts: typeof relations_posts; + relations_categories: typeof relations_categories; + relations_social_links: typeof relations_social_links; + relations_testimonials: typeof relations_testimonials; + relations_newsletter_subscribers_interests: typeof relations_newsletter_subscribers_interests; + relations_newsletter_subscribers: typeof relations_newsletter_subscribers; + relations_cookie_configurations_enabled_categories: typeof relations_cookie_configurations_enabled_categories; + relations_cookie_configurations: typeof relations_cookie_configurations; + relations_cookie_inventory: typeof relations_cookie_inventory; + relations_consent_logs: typeof relations_consent_logs; + relations_privacy_policy_settings: typeof relations_privacy_policy_settings; + relations_forms_blocks_checkbox: typeof relations_forms_blocks_checkbox; + relations_forms_blocks_email: typeof relations_forms_blocks_email; + relations_forms_blocks_message: typeof relations_forms_blocks_message; + relations_forms_blocks_number: typeof relations_forms_blocks_number; + relations_forms_blocks_select_options: typeof relations_forms_blocks_select_options; + relations_forms_blocks_select: typeof relations_forms_blocks_select; + relations_forms_blocks_text: typeof relations_forms_blocks_text; + relations_forms_blocks_textarea: typeof relations_forms_blocks_textarea; + relations_forms_emails: typeof relations_forms_emails; + relations_forms: typeof relations_forms; + relations_form_submissions_submission_data: typeof relations_form_submissions_submission_data; + relations_form_submissions: typeof relations_form_submissions; + relations_redirects: typeof relations_redirects; + relations_payload_kv: typeof relations_payload_kv; + relations_payload_locked_documents_rels: typeof relations_payload_locked_documents_rels; + relations_payload_locked_documents: typeof relations_payload_locked_documents; + relations_payload_preferences_rels: typeof relations_payload_preferences_rels; + relations_payload_preferences: typeof relations_payload_preferences; + relations_payload_migrations: typeof relations_payload_migrations; + relations_site_settings: typeof relations_site_settings; + relations_navigation_main_menu_submenu: typeof relations_navigation_main_menu_submenu; + relations_navigation_main_menu: typeof relations_navigation_main_menu; + relations_navigation_footer_menu: typeof relations_navigation_footer_menu; + relations_navigation: typeof relations_navigation; + relations_seo_settings_social_profiles: typeof relations_seo_settings_social_profiles; + relations_seo_settings_local_business_opening_hours: typeof relations_seo_settings_local_business_opening_hours; + relations_seo_settings_texts: typeof relations_seo_settings_texts; + relations_seo_settings: typeof relations_seo_settings; +}; + +declare module "@payloadcms/db-postgres" { + export interface GeneratedDatabaseSchema { + schema: DatabaseSchema; + } +} diff --git a/src/payload-types.ts b/src/payload-types.ts index ec118e0..d98fa8a 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -69,6 +69,20 @@ export interface Config { collections: { users: User; media: Media; + tenants: Tenant; + pages: Page; + posts: Post; + categories: Category; + 'social-links': SocialLink; + testimonials: Testimonial; + 'newsletter-subscribers': NewsletterSubscriber; + 'cookie-configurations': CookieConfiguration; + 'cookie-inventory': CookieInventory; + 'consent-logs': ConsentLog; + 'privacy-policy-settings': PrivacyPolicySetting; + forms: Form; + 'form-submissions': FormSubmission; + redirects: Redirect; 'payload-kv': PayloadKv; 'payload-locked-documents': PayloadLockedDocument; 'payload-preferences': PayloadPreference; @@ -78,17 +92,40 @@ export interface Config { collectionsSelect: { users: UsersSelect | UsersSelect; media: MediaSelect | MediaSelect; + tenants: TenantsSelect | TenantsSelect; + pages: PagesSelect | PagesSelect; + posts: PostsSelect | PostsSelect; + categories: CategoriesSelect | CategoriesSelect; + 'social-links': SocialLinksSelect | SocialLinksSelect; + testimonials: TestimonialsSelect | TestimonialsSelect; + 'newsletter-subscribers': NewsletterSubscribersSelect | NewsletterSubscribersSelect; + 'cookie-configurations': CookieConfigurationsSelect | CookieConfigurationsSelect; + 'cookie-inventory': CookieInventorySelect | CookieInventorySelect; + 'consent-logs': ConsentLogsSelect | ConsentLogsSelect; + 'privacy-policy-settings': PrivacyPolicySettingsSelect | PrivacyPolicySettingsSelect; + forms: FormsSelect | FormsSelect; + 'form-submissions': FormSubmissionsSelect | FormSubmissionsSelect; + redirects: RedirectsSelect | RedirectsSelect; 'payload-kv': PayloadKvSelect | PayloadKvSelect; 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; 'payload-preferences': PayloadPreferencesSelect | PayloadPreferencesSelect; 'payload-migrations': PayloadMigrationsSelect | PayloadMigrationsSelect; }; db: { - defaultIDType: string; + defaultIDType: number; }; - globals: {}; - globalsSelect: {}; - locale: null; + fallbackLocale: ('false' | 'none' | 'null') | false | null | ('de' | 'en') | ('de' | 'en')[]; + globals: { + 'site-settings': SiteSetting; + navigation: Navigation; + 'seo-settings': SeoSetting; + }; + globalsSelect: { + 'site-settings': SiteSettingsSelect | SiteSettingsSelect; + navigation: NavigationSelect | NavigationSelect; + 'seo-settings': SeoSettingsSelect | SeoSettingsSelect; + }; + locale: 'de' | 'en'; user: User & { collection: 'users'; }; @@ -120,7 +157,13 @@ export interface UserAuthOperations { * via the `definition` "users". */ export interface User { - id: string; + id: number; + tenants?: + | { + tenant: number | Tenant; + id?: string | null; + }[] + | null; updatedAt: string; createdAt: string; email: string; @@ -140,12 +183,47 @@ export interface User { password?: string | null; } /** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "tenants". + */ +export interface Tenant { + id: number; + name: string; + slug: string; + domains?: + | { + domain: string; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} +/** + * Bilder und Dokumente mit automatischer Optimierung + * * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "media". */ export interface Media { - id: string; + id: number; + tenant?: (number | null) | Tenant; + /** + * Beschreibung für Screenreader und SEO (Pflichtfeld) + */ alt: string; + /** + * Optionale Bildunterschrift für Darstellung unter dem Bild + */ + caption?: string | null; + /** + * Fotograf, Agentur oder Quelle + */ + credit?: string | null; + /** + * Schlagwörter für die Suche und Filterung + */ + tags?: string[] | null; updatedAt: string; createdAt: string; url?: string | null; @@ -157,13 +235,985 @@ export interface Media { height?: number | null; focalX?: number | null; focalY?: number | null; + sizes?: { + thumbnail?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + small?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + medium?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + large?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + xlarge?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + '2k'?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + og?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + medium_avif?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + large_avif?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + xlarge_avif?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + }; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "pages". + */ +export interface Page { + id: number; + tenant?: (number | null) | Tenant; + title: string; + /** + * URL-Pfad (z.B. "ueber-uns" / "about-us") + */ + slug: string; + hero?: { + image?: (number | null) | Media; + headline?: string | null; + subline?: string | null; + }; + layout?: + | ( + | { + backgroundImage?: (number | null) | Media; + headline: string; + subline?: string | null; + alignment?: ('left' | 'center' | 'right') | null; + overlay?: boolean | null; + cta?: { + text?: string | null; + link?: string | null; + style?: ('primary' | 'secondary' | 'outline') | null; + }; + id?: string | null; + blockName?: string | null; + blockType: 'hero-block'; + } + | { + content: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + }; + width?: ('narrow' | 'medium' | 'full') | null; + id?: string | null; + blockName?: string | null; + blockType: 'text-block'; + } + | { + image: number | Media; + imagePosition?: ('left' | 'right') | null; + headline?: string | null; + content?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + cta?: { + text?: string | null; + link?: string | null; + }; + id?: string | null; + blockName?: string | null; + blockType: 'image-text-block'; + } + | { + headline?: string | null; + cards?: + | { + image?: (number | null) | Media; + title: string; + description?: string | null; + link?: string | null; + linkText?: string | null; + id?: string | null; + }[] + | null; + columns?: ('2' | '3' | '4') | null; + id?: string | null; + blockName?: string | null; + blockType: 'card-grid-block'; + } + | { + quote: string; + author?: string | null; + role?: string | null; + image?: (number | null) | Media; + style?: ('simple' | 'highlighted' | 'with-image') | null; + id?: string | null; + blockName?: string | null; + blockType: 'quote-block'; + } + | { + headline: string; + description?: string | null; + buttons?: + | { + text: string; + link: string; + style?: ('primary' | 'secondary' | 'outline') | null; + id?: string | null; + }[] + | null; + backgroundColor?: ('dark' | 'light' | 'accent') | null; + id?: string | null; + blockName?: string | null; + blockType: 'cta-block'; + } + | { + headline?: string | null; + description?: string | null; + recipientEmail?: string | null; + showPhone?: boolean | null; + showAddress?: boolean | null; + showSocials?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'contact-form-block'; + } + | { + title?: string | null; + subtitle?: string | null; + layout?: ('vertical' | 'alternating' | 'horizontal') | null; + showConnector?: boolean | null; + markerStyle?: ('dot' | 'number' | 'icon' | 'date') | null; + items?: + | { + /** + * z.B. "2024", "Januar 2024", "15.03.2024" + */ + year?: string | null; + title: string; + description?: string | null; + /** + * Emoji oder Icon-Name + */ + icon?: string | null; + image?: (number | null) | Media; + link?: { + label?: string | null; + href?: string | null; + }; + id?: string | null; + }[] + | null; + backgroundColor?: ('white' | 'light' | 'dark') | null; + id?: string | null; + blockName?: string | null; + blockType: 'timeline-block'; + } + | { + style?: ('line' | 'space' | 'dots') | null; + spacing?: ('small' | 'medium' | 'large') | null; + id?: string | null; + blockName?: string | null; + blockType: 'divider-block'; + } + | { + /** + * YouTube oder Vimeo URL + */ + videoUrl: string; + caption?: string | null; + aspectRatio?: ('16:9' | '4:3' | '1:1') | null; + id?: string | null; + blockName?: string | null; + blockType: 'video-block'; + } + | { + title?: string | null; + subtitle?: string | null; + postType: 'blog' | 'news' | 'press' | 'announcement' | 'all'; + layout?: ('grid' | 'list' | 'featured' | 'compact' | 'masonry') | null; + columns?: ('2' | '3' | '4') | null; + limit?: number | null; + showFeaturedOnly?: boolean | null; + /** + * Leer = alle Kategorien + */ + filterByCategory?: (number | Category)[] | null; + showExcerpt?: boolean | null; + showDate?: boolean | null; + showAuthor?: boolean | null; + showCategory?: boolean | null; + showPagination?: boolean | null; + showReadMore?: boolean | null; + readMoreLabel?: string | null; + readMoreLink?: string | null; + backgroundColor?: ('white' | 'light' | 'dark') | null; + id?: string | null; + blockName?: string | null; + blockType: 'posts-list-block'; + } + | { + title?: string | null; + subtitle?: string | null; + layout?: ('slider' | 'grid' | 'single' | 'masonry' | 'list') | null; + columns?: ('2' | '3' | '4') | null; + displayMode?: ('all' | 'selected') | null; + selectedTestimonials?: (number | Testimonial)[] | null; + limit?: number | null; + showRating?: boolean | null; + showImage?: boolean | null; + showCompany?: boolean | null; + showSource?: boolean | null; + autoplay?: boolean | null; + autoplaySpeed?: number | null; + backgroundColor?: ('white' | 'light' | 'dark' | 'accent') | null; + id?: string | null; + blockName?: string | null; + blockType: 'testimonials-block'; + } + | { + title?: string | null; + subtitle?: string | null; + layout?: ('inline' | 'stacked' | 'with-image' | 'minimal' | 'card') | null; + image?: (number | null) | Media; + imagePosition?: ('left' | 'right') | null; + collectName?: boolean | null; + showInterests?: boolean | null; + availableInterests?: ('general' | 'blog' | 'products' | 'offers' | 'events')[] | null; + buttonText?: string | null; + placeholderEmail?: string | null; + successMessage?: string | null; + errorMessage?: string | null; + privacyText?: string | null; + privacyLink?: string | null; + /** + * Wird gespeichert um zu tracken, wo die Anmeldung erfolgte + */ + source?: string | null; + backgroundColor?: ('white' | 'light' | 'dark' | 'accent') | null; + id?: string | null; + blockName?: string | null; + blockType: 'newsletter-block'; + } + | { + title?: string | null; + subtitle?: string | null; + layout?: ('horizontal' | 'vertical' | 'alternating' | 'connected' | 'timeline') | null; + showNumbers?: boolean | null; + showIcons?: boolean | null; + steps?: + | { + title: string; + description?: string | null; + /** + * Emoji oder Icon-Name (z.B. "📞", "✓", "1") + */ + icon?: string | null; + image?: (number | null) | Media; + id?: string | null; + }[] + | null; + cta?: { + show?: boolean | null; + label?: string | null; + href?: string | null; + variant?: ('default' | 'ghost' | 'light') | null; + }; + backgroundColor?: ('white' | 'light' | 'dark') | null; + id?: string | null; + blockName?: string | null; + blockType: 'process-steps-block'; + } + )[] + | null; + seo?: { + metaTitle?: string | null; + metaDescription?: string | null; + ogImage?: (number | null) | Media; + }; + status?: ('draft' | 'published') | null; + publishedAt?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "categories". + */ +export interface Category { + id: number; + tenant?: (number | null) | Tenant; + name: string; + slug: string; + description?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * Kundenstimmen und Bewertungen + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "testimonials". + */ +export interface Testimonial { + id: number; + tenant?: (number | null) | Tenant; + /** + * Die Aussage des Kunden + */ + quote: string; + author: string; + /** + * z.B. "Patient", "Geschäftsführer", "Marketing Manager" + */ + role?: string | null; + company?: string | null; + /** + * Portrait-Foto (empfohlen: quadratisch, min. 200x200px) + */ + image?: (number | null) | Media; + /** + * Optional: Sterne-Bewertung + */ + rating?: number | null; + /** + * z.B. "Google Reviews", "Trustpilot", "Persönlich" + */ + source?: string | null; + /** + * URL zur Original-Bewertung (falls öffentlich) + */ + sourceUrl?: string | null; + date?: string | null; + /** + * Inaktive Testimonials werden nicht angezeigt + */ + isActive?: boolean | null; + /** + * Niedrigere Zahlen werden zuerst angezeigt + */ + order?: number | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "posts". + */ +export interface Post { + id: number; + tenant?: (number | null) | Tenant; + title: string; + /** + * URL-Pfad (z.B. "mein-beitrag" / "my-post") + */ + slug: string; + /** + * Art des Beitrags + */ + type: 'blog' | 'news' | 'press' | 'announcement'; + /** + * Auf Startseite/oben anzeigen + */ + isFeatured?: boolean | null; + /** + * Für Übersichten und SEO (max. 300 Zeichen). Wird automatisch aus Content generiert, falls leer. + */ + excerpt?: string | null; + featuredImage?: (number | null) | Media; + content: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + }; + categories?: (number | Category)[] | null; + author?: string | null; + status?: ('draft' | 'published' | 'archived') | null; + publishedAt?: string | null; + seo?: { + metaTitle?: string | null; + metaDescription?: string | null; + ogImage?: (number | null) | Media; + }; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "social-links". + */ +export interface SocialLink { + id: number; + tenant?: (number | null) | Tenant; + platform: 'facebook' | 'x' | 'instagram' | 'youtube' | 'linkedin' | 'xing'; + url: string; + isActive?: boolean | null; + updatedAt: string; + createdAt: string; +} +/** + * Newsletter-Abonnenten (DSGVO-konform) + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "newsletter-subscribers". + */ +export interface NewsletterSubscriber { + id: number; + tenant?: (number | null) | Tenant; + email: string; + firstName?: string | null; + lastName?: string | null; + status: 'pending' | 'confirmed' | 'unsubscribed' | 'bounced'; + interests?: ('general' | 'blog' | 'products' | 'offers' | 'events')[] | null; + /** + * z.B. "Footer", "Popup", "Blog-Artikel", "Kontakt-Seite" + */ + source?: string | null; + subscribedAt?: string | null; + confirmedAt?: string | null; + unsubscribedAt?: string | null; + confirmationToken?: string | null; + /** + * DSGVO-Nachweis der Anmeldung + */ + ipAddress?: string | null; + userAgent?: string | null; + updatedAt: string; + createdAt: string; +} +/** + * Cookie-Banner Konfiguration pro Tenant + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "cookie-configurations". + */ +export interface CookieConfiguration { + id: number; + /** + * Jeder Tenant kann nur eine Konfiguration haben + */ + tenant: number | Tenant; + /** + * Interner Titel zur Identifikation + */ + title: string; + /** + * Bei inhaltlichen Änderungen erhöhen → erzwingt erneuten Consent bei allen Nutzern + */ + revision: number; + /** + * Welche Kategorien sollen im Banner angezeigt werden? + */ + enabledCategories: ('necessary' | 'functional' | 'analytics' | 'marketing')[]; + translations?: { + de?: { + bannerTitle?: string | null; + bannerDescription?: string | null; + acceptAllButton?: string | null; + acceptNecessaryButton?: string | null; + settingsButton?: string | null; + saveButton?: string | null; + privacyPolicyUrl?: string | null; + categoryLabels?: { + necessary?: { + title?: string | null; + description?: string | null; + }; + functional?: { + title?: string | null; + description?: string | null; + }; + analytics?: { + title?: string | null; + description?: string | null; + }; + marketing?: { + title?: string | null; + description?: string | null; + }; + }; + }; + }; + styling?: { + position?: ('bottom' | 'top' | 'middle') | null; + theme?: ('dark' | 'light' | 'auto') | null; + }; + updatedAt: string; + createdAt: string; +} +/** + * Cookie-Dokumentation für die Datenschutzerklärung + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "cookie-inventory". + */ +export interface CookieInventory { + id: number; + tenant: number | Tenant; + /** + * Technischer Name des Cookies (z.B. "_ga") + */ + name: string; + /** + * Anbieter (z.B. "Google LLC") + */ + provider: string; + category: 'necessary' | 'functional' | 'analytics' | 'marketing'; + /** + * Speicherdauer (z.B. "2 Jahre") + */ + duration: string; + /** + * Verständliche Erklärung für Endnutzer + */ + description: string; + isActive?: boolean | null; + updatedAt: string; + createdAt: string; +} +/** + * WORM Audit-Trail für Cookie-Einwilligungen (unveränderbar) + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "consent-logs". + */ +export interface ConsentLog { + id: number; + /** + * Server-generierte eindeutige ID + */ + consentId: string; + /** + * Client-seitige Referenz (Cookie-UUID) für Traceability + */ + clientRef?: string | null; + tenant: number | Tenant; + /** + * Akzeptierte Kategorien zum Zeitpunkt der Einwilligung + */ + categories: + | { + [k: string]: unknown; + } + | unknown[] + | string + | number + | boolean + | null; + /** + * Version der Konfiguration zum Zeitpunkt der Zustimmung + */ + revision: number; + /** + * Browser/Device (für Forensik und Bot-Erkennung) + */ + userAgent?: string | null; + /** + * HMAC-Hash der IP (täglich rotierender, tenant-spezifischer Salt) + */ + anonymizedIp?: string | null; + /** + * Automatische Löschung nach 3 Jahren + */ + expiresAt: string; + updatedAt: string; + createdAt: string; +} +/** + * Externe Datenschutzerklärung Konfiguration (Alfright) + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "privacy-policy-settings". + */ +export interface PrivacyPolicySetting { + id: number; + /** + * Jeder Tenant kann nur eine Konfiguration haben + */ + tenant: number | Tenant; + /** + * Interner Titel zur Identifikation + */ + title: string; + /** + * Quelle der Datenschutzerklärung + */ + provider: 'alfright' | 'internal'; + /** + * Einstellungen für die Alfright Integration + */ + alfright?: { + /** + * Alfright Tenant-ID (aus dem iframe-Code) + */ + tenantId: string; + /** + * Alfright API-Key / Dokument-ID (aus dem iframe-Code, z.B. "9f315103c43245bcb0806dd56c2be757") + */ + apiKey: string; + /** + * Sprache der Datenschutzerklärung + */ + language: 'de-de' | 'de-at' | 'de-ch' | 'en-gb' | 'en-us'; + /** + * Höhe des iframes in Pixeln (empfohlen: 3000-5000) + */ + iframeHeight: number; + }; + /** + * Farben und Schriften an das Website-Design anpassen + */ + styling?: { + /** + * Farbe der Überschriften (Hex-Code, z.B. #ca8a04 für Gold) + */ + headerColor: string; + /** + * Schriftart der Überschriften + */ + headerFont: string; + /** + * Schriftgröße der Hauptüberschriften + */ + headerSize: string; + /** + * Schriftgröße der Unterüberschriften + */ + subheaderSize: string; + /** + * Textfarbe (Hex-Code, z.B. #f3f4f6 für hellen Text) + */ + fontColor: string; + /** + * Schriftart für Fließtext + */ + textFont: string; + /** + * Schriftgröße für Fließtext + */ + textSize: string; + /** + * Linkfarbe (Hex-Code) + */ + linkColor: string; + /** + * Hintergrundfarbe (Hex-Code, z.B. #111827 für Dark Theme) + */ + backgroundColor: string; + }; + /** + * Cookie-Tabelle aus CookieInventory unterhalb der Datenschutzerklärung anzeigen + */ + showCookieTable?: boolean | null; + /** + * Überschrift für die Cookie-Tabelle + */ + cookieTableTitle?: string | null; + /** + * Einleitungstext für die Cookie-Tabelle + */ + cookieTableDescription?: string | null; + seo?: { + /** + * Meta-Titel für die Seite + */ + metaTitle?: string | null; + /** + * Meta-Beschreibung für Suchmaschinen + */ + metaDescription?: string | null; + }; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "forms". + */ +export interface Form { + id: number; + title: string; + fields?: + | ( + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + defaultValue?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'checkbox'; + } + | { + name: string; + label?: string | null; + width?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'email'; + } + | { + message?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + id?: string | null; + blockName?: string | null; + blockType: 'message'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: number | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'number'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + placeholder?: string | null; + options?: + | { + label: string; + value: string; + id?: string | null; + }[] + | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'select'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'text'; + } + | { + name: string; + label?: string | null; + width?: number | null; + defaultValue?: string | null; + required?: boolean | null; + id?: string | null; + blockName?: string | null; + blockType: 'textarea'; + } + )[] + | null; + submitButtonLabel?: string | null; + /** + * Choose whether to display an on-page message or redirect to a different page after they submit the form. + */ + confirmationType?: ('message' | 'redirect') | null; + confirmationMessage?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + redirect?: { + type?: ('reference' | 'custom') | null; + reference?: { + relationTo: 'pages'; + value: number | Page; + } | null; + url?: string | null; + }; + /** + * Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}. You can use a wildcard {{*}} to output all data and {{*:table}} to format it as an HTML table in the email. + */ + emails?: + | { + emailTo?: string | null; + cc?: string | null; + bcc?: string | null; + replyTo?: string | null; + emailFrom?: string | null; + subject: string; + /** + * Enter the message that should be sent in this email. + */ + message?: { + root: { + type: string; + children: { + type: any; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "form-submissions". + */ +export interface FormSubmission { + id: number; + form: number | Form; + submissionData?: + | { + field: string; + value: string; + id?: string | null; + }[] + | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "redirects". + */ +export interface Redirect { + id: number; + from: string; + to?: { + type?: ('reference' | 'custom') | null; + reference?: { + relationTo: 'pages'; + value: number | Page; + } | null; + url?: string | null; + }; + updatedAt: string; + createdAt: string; } /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-kv". */ export interface PayloadKv { - id: string; + id: number; key: string; data: | { @@ -180,20 +1230,76 @@ export interface PayloadKv { * via the `definition` "payload-locked-documents". */ export interface PayloadLockedDocument { - id: string; + id: number; document?: | ({ relationTo: 'users'; - value: string | User; + value: number | User; } | null) | ({ relationTo: 'media'; - value: string | Media; + value: number | Media; + } | null) + | ({ + relationTo: 'tenants'; + value: number | Tenant; + } | null) + | ({ + relationTo: 'pages'; + value: number | Page; + } | null) + | ({ + relationTo: 'posts'; + value: number | Post; + } | null) + | ({ + relationTo: 'categories'; + value: number | Category; + } | null) + | ({ + relationTo: 'social-links'; + value: number | SocialLink; + } | null) + | ({ + relationTo: 'testimonials'; + value: number | Testimonial; + } | null) + | ({ + relationTo: 'newsletter-subscribers'; + value: number | NewsletterSubscriber; + } | null) + | ({ + relationTo: 'cookie-configurations'; + value: number | CookieConfiguration; + } | null) + | ({ + relationTo: 'cookie-inventory'; + value: number | CookieInventory; + } | null) + | ({ + relationTo: 'consent-logs'; + value: number | ConsentLog; + } | null) + | ({ + relationTo: 'privacy-policy-settings'; + value: number | PrivacyPolicySetting; + } | null) + | ({ + relationTo: 'forms'; + value: number | Form; + } | null) + | ({ + relationTo: 'form-submissions'; + value: number | FormSubmission; + } | null) + | ({ + relationTo: 'redirects'; + value: number | Redirect; } | null); globalSlug?: string | null; user: { relationTo: 'users'; - value: string | User; + value: number | User; }; updatedAt: string; createdAt: string; @@ -203,10 +1309,10 @@ export interface PayloadLockedDocument { * via the `definition` "payload-preferences". */ export interface PayloadPreference { - id: string; + id: number; user: { relationTo: 'users'; - value: string | User; + value: number | User; }; key?: string | null; value?: @@ -226,7 +1332,7 @@ export interface PayloadPreference { * via the `definition` "payload-migrations". */ export interface PayloadMigration { - id: string; + id: number; name?: string | null; batch?: number | null; updatedAt: string; @@ -237,6 +1343,12 @@ export interface PayloadMigration { * via the `definition` "users_select". */ export interface UsersSelect { + tenants?: + | T + | { + tenant?: T; + id?: T; + }; updatedAt?: T; createdAt?: T; email?: T; @@ -259,7 +1371,11 @@ export interface UsersSelect { * via the `definition` "media_select". */ export interface MediaSelect { + tenant?: T; alt?: T; + caption?: T; + credit?: T; + tags?: T; updatedAt?: T; createdAt?: T; url?: T; @@ -271,6 +1387,768 @@ export interface MediaSelect { height?: T; focalX?: T; focalY?: T; + sizes?: + | T + | { + thumbnail?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + small?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + medium?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + large?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + xlarge?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + '2k'?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + og?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + medium_avif?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + large_avif?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + xlarge_avif?: + | T + | { + url?: T; + width?: T; + height?: T; + mimeType?: T; + filesize?: T; + filename?: T; + }; + }; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "tenants_select". + */ +export interface TenantsSelect { + name?: T; + slug?: T; + domains?: + | T + | { + domain?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "pages_select". + */ +export interface PagesSelect { + tenant?: T; + title?: T; + slug?: T; + hero?: + | T + | { + image?: T; + headline?: T; + subline?: T; + }; + layout?: + | T + | { + 'hero-block'?: + | T + | { + backgroundImage?: T; + headline?: T; + subline?: T; + alignment?: T; + overlay?: T; + cta?: + | T + | { + text?: T; + link?: T; + style?: T; + }; + id?: T; + blockName?: T; + }; + 'text-block'?: + | T + | { + content?: T; + width?: T; + id?: T; + blockName?: T; + }; + 'image-text-block'?: + | T + | { + image?: T; + imagePosition?: T; + headline?: T; + content?: T; + cta?: + | T + | { + text?: T; + link?: T; + }; + id?: T; + blockName?: T; + }; + 'card-grid-block'?: + | T + | { + headline?: T; + cards?: + | T + | { + image?: T; + title?: T; + description?: T; + link?: T; + linkText?: T; + id?: T; + }; + columns?: T; + id?: T; + blockName?: T; + }; + 'quote-block'?: + | T + | { + quote?: T; + author?: T; + role?: T; + image?: T; + style?: T; + id?: T; + blockName?: T; + }; + 'cta-block'?: + | T + | { + headline?: T; + description?: T; + buttons?: + | T + | { + text?: T; + link?: T; + style?: T; + id?: T; + }; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + 'contact-form-block'?: + | T + | { + headline?: T; + description?: T; + recipientEmail?: T; + showPhone?: T; + showAddress?: T; + showSocials?: T; + id?: T; + blockName?: T; + }; + 'timeline-block'?: + | T + | { + title?: T; + subtitle?: T; + layout?: T; + showConnector?: T; + markerStyle?: T; + items?: + | T + | { + year?: T; + title?: T; + description?: T; + icon?: T; + image?: T; + link?: + | T + | { + label?: T; + href?: T; + }; + id?: T; + }; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + 'divider-block'?: + | T + | { + style?: T; + spacing?: T; + id?: T; + blockName?: T; + }; + 'video-block'?: + | T + | { + videoUrl?: T; + caption?: T; + aspectRatio?: T; + id?: T; + blockName?: T; + }; + 'posts-list-block'?: + | T + | { + title?: T; + subtitle?: T; + postType?: T; + layout?: T; + columns?: T; + limit?: T; + showFeaturedOnly?: T; + filterByCategory?: T; + showExcerpt?: T; + showDate?: T; + showAuthor?: T; + showCategory?: T; + showPagination?: T; + showReadMore?: T; + readMoreLabel?: T; + readMoreLink?: T; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + 'testimonials-block'?: + | T + | { + title?: T; + subtitle?: T; + layout?: T; + columns?: T; + displayMode?: T; + selectedTestimonials?: T; + limit?: T; + showRating?: T; + showImage?: T; + showCompany?: T; + showSource?: T; + autoplay?: T; + autoplaySpeed?: T; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + 'newsletter-block'?: + | T + | { + title?: T; + subtitle?: T; + layout?: T; + image?: T; + imagePosition?: T; + collectName?: T; + showInterests?: T; + availableInterests?: T; + buttonText?: T; + placeholderEmail?: T; + successMessage?: T; + errorMessage?: T; + privacyText?: T; + privacyLink?: T; + source?: T; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + 'process-steps-block'?: + | T + | { + title?: T; + subtitle?: T; + layout?: T; + showNumbers?: T; + showIcons?: T; + steps?: + | T + | { + title?: T; + description?: T; + icon?: T; + image?: T; + id?: T; + }; + cta?: + | T + | { + show?: T; + label?: T; + href?: T; + variant?: T; + }; + backgroundColor?: T; + id?: T; + blockName?: T; + }; + }; + seo?: + | T + | { + metaTitle?: T; + metaDescription?: T; + ogImage?: T; + }; + status?: T; + publishedAt?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "posts_select". + */ +export interface PostsSelect { + tenant?: T; + title?: T; + slug?: T; + type?: T; + isFeatured?: T; + excerpt?: T; + featuredImage?: T; + content?: T; + categories?: T; + author?: T; + status?: T; + publishedAt?: T; + seo?: + | T + | { + metaTitle?: T; + metaDescription?: T; + ogImage?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "categories_select". + */ +export interface CategoriesSelect { + tenant?: T; + name?: T; + slug?: T; + description?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "social-links_select". + */ +export interface SocialLinksSelect { + tenant?: T; + platform?: T; + url?: T; + isActive?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "testimonials_select". + */ +export interface TestimonialsSelect { + tenant?: T; + quote?: T; + author?: T; + role?: T; + company?: T; + image?: T; + rating?: T; + source?: T; + sourceUrl?: T; + date?: T; + isActive?: T; + order?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "newsletter-subscribers_select". + */ +export interface NewsletterSubscribersSelect { + tenant?: T; + email?: T; + firstName?: T; + lastName?: T; + status?: T; + interests?: T; + source?: T; + subscribedAt?: T; + confirmedAt?: T; + unsubscribedAt?: T; + confirmationToken?: T; + ipAddress?: T; + userAgent?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "cookie-configurations_select". + */ +export interface CookieConfigurationsSelect { + tenant?: T; + title?: T; + revision?: T; + enabledCategories?: T; + translations?: + | T + | { + de?: + | T + | { + bannerTitle?: T; + bannerDescription?: T; + acceptAllButton?: T; + acceptNecessaryButton?: T; + settingsButton?: T; + saveButton?: T; + privacyPolicyUrl?: T; + categoryLabels?: + | T + | { + necessary?: + | T + | { + title?: T; + description?: T; + }; + functional?: + | T + | { + title?: T; + description?: T; + }; + analytics?: + | T + | { + title?: T; + description?: T; + }; + marketing?: + | T + | { + title?: T; + description?: T; + }; + }; + }; + }; + styling?: + | T + | { + position?: T; + theme?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "cookie-inventory_select". + */ +export interface CookieInventorySelect { + tenant?: T; + name?: T; + provider?: T; + category?: T; + duration?: T; + description?: T; + isActive?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "consent-logs_select". + */ +export interface ConsentLogsSelect { + consentId?: T; + clientRef?: T; + tenant?: T; + categories?: T; + revision?: T; + userAgent?: T; + anonymizedIp?: T; + expiresAt?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "privacy-policy-settings_select". + */ +export interface PrivacyPolicySettingsSelect { + tenant?: T; + title?: T; + provider?: T; + alfright?: + | T + | { + tenantId?: T; + apiKey?: T; + language?: T; + iframeHeight?: T; + }; + styling?: + | T + | { + headerColor?: T; + headerFont?: T; + headerSize?: T; + subheaderSize?: T; + fontColor?: T; + textFont?: T; + textSize?: T; + linkColor?: T; + backgroundColor?: T; + }; + showCookieTable?: T; + cookieTableTitle?: T; + cookieTableDescription?: T; + seo?: + | T + | { + metaTitle?: T; + metaDescription?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "forms_select". + */ +export interface FormsSelect { + title?: T; + fields?: + | T + | { + checkbox?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + defaultValue?: T; + id?: T; + blockName?: T; + }; + email?: + | T + | { + name?: T; + label?: T; + width?: T; + required?: T; + id?: T; + blockName?: T; + }; + message?: + | T + | { + message?: T; + id?: T; + blockName?: T; + }; + number?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + select?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + placeholder?: T; + options?: + | T + | { + label?: T; + value?: T; + id?: T; + }; + required?: T; + id?: T; + blockName?: T; + }; + text?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + textarea?: + | T + | { + name?: T; + label?: T; + width?: T; + defaultValue?: T; + required?: T; + id?: T; + blockName?: T; + }; + }; + submitButtonLabel?: T; + confirmationType?: T; + confirmationMessage?: T; + redirect?: + | T + | { + type?: T; + reference?: T; + url?: T; + }; + emails?: + | T + | { + emailTo?: T; + cc?: T; + bcc?: T; + replyTo?: T; + emailFrom?: T; + subject?: T; + message?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "form-submissions_select". + */ +export interface FormSubmissionsSelect { + form?: T; + submissionData?: + | T + | { + field?: T; + value?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "redirects_select". + */ +export interface RedirectsSelect { + from?: T; + to?: + | T + | { + type?: T; + reference?: T; + url?: T; + }; + updatedAt?: T; + createdAt?: T; } /** * This interface was referenced by `Config`'s JSON-Schema @@ -312,6 +2190,360 @@ export interface PayloadMigrationsSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "site-settings". + */ +export interface SiteSetting { + id: number; + siteName?: string | null; + siteTagline?: string | null; + logo?: (number | null) | Media; + favicon?: (number | null) | Media; + contact?: { + email?: string | null; + phone?: string | null; + address?: string | null; + }; + footer?: { + copyrightText?: string | null; + showSocialLinks?: boolean | null; + }; + seo?: { + defaultMetaTitle?: string | null; + defaultMetaDescription?: string | null; + defaultOgImage?: (number | null) | Media; + }; + updatedAt?: string | null; + createdAt?: string | null; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "navigation". + */ +export interface Navigation { + id: number; + mainMenu?: + | { + label: string; + type?: ('page' | 'custom' | 'submenu') | null; + page?: (number | null) | Page; + url?: string | null; + openInNewTab?: boolean | null; + submenu?: + | { + label: string; + linkType?: ('page' | 'custom') | null; + page?: (number | null) | Page; + url?: string | null; + id?: string | null; + }[] + | null; + id?: string | null; + }[] + | null; + footerMenu?: + | { + label: string; + linkType?: ('page' | 'custom') | null; + page?: (number | null) | Page; + url?: string | null; + id?: string | null; + }[] + | null; + updatedAt?: string | null; + createdAt?: string | null; +} +/** + * Globale SEO-Konfiguration und Schema.org Daten + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "seo-settings". + */ +export interface SeoSetting { + id: number; + metaDefaults?: { + /** + * Wird an jeden Seitentitel angehängt (z.B. "Startseite | Firmenname") + */ + titleSuffix?: string | null; + /** + * Wird verwendet, wenn keine spezifische Beschreibung gesetzt ist + */ + defaultDescription?: string | null; + /** + * Fallback-Bild für Social Media Shares (empfohlen: 1200x630px) + */ + defaultOgImage?: (number | null) | Media; + /** + * Globale Keywords (optional, geringe SEO-Relevanz) + */ + keywords?: string[] | null; + }; + /** + * Daten für das Organization Schema + */ + organization: { + name: string; + /** + * Vollständiger rechtlicher Firmenname (falls abweichend) + */ + legalName?: string | null; + description?: string | null; + /** + * Firmenlogo für Schema.org (min. 112x112px, empfohlen: 512x512px) + */ + logo?: (number | null) | Media; + foundingDate?: string | null; + }; + contact?: { + email?: string | null; + /** + * Im Format +49 123 456789 + */ + phone?: string | null; + fax?: string | null; + }; + address?: { + street?: string | null; + postalCode?: string | null; + city?: string | null; + region?: string | null; + country?: string | null; + /** + * ISO 3166-1 Alpha-2 Code + */ + countryCode?: string | null; + }; + /** + * Für Local Business Schema + */ + geo?: { + latitude?: number | null; + longitude?: number | null; + }; + /** + * URLs zu Social Media Profilen (für sameAs Schema) + */ + socialProfiles?: + | { + platform?: + | ('facebook' | 'instagram' | 'twitter' | 'linkedin' | 'youtube' | 'tiktok' | 'pinterest' | 'xing' | 'other') + | null; + url: string; + id?: string | null; + }[] + | null; + /** + * Zusätzliche Daten für lokale Unternehmen + */ + localBusiness?: { + enabled?: boolean | null; + type?: + | ( + | 'LocalBusiness' + | 'Physician' + | 'Dentist' + | 'Attorney' + | 'Restaurant' + | 'Hotel' + | 'Store' + | 'HealthClub' + | 'HairSalon' + | 'AutoRepair' + | 'RealEstateAgent' + | 'FinancialService' + | 'ProfessionalService' + | 'MedicalBusiness' + ) + | null; + priceRange?: ('€' | '€€' | '€€€' | '€€€€') | null; + /** + * Im Format "Mo-Fr 09:00-17:00" + */ + openingHours?: + | { + specification?: string | null; + id?: string | null; + }[] + | null; + }; + robots?: { + /** + * Wenn deaktiviert, wird die gesamte Website von Suchmaschinen ausgeschlossen + */ + allowIndexing?: boolean | null; + /** + * Pfade die nicht gecrawlt werden sollen (z.B. "/intern", "/preview") + */ + additionalDisallow?: string[] | null; + }; + /** + * Codes für Suchmaschinen-Verifizierung + */ + verification?: { + /** + * Meta-Tag Content (nur der Code, nicht das gesamte Tag) + */ + google?: string | null; + bing?: string | null; + yandex?: string | null; + }; + updatedAt?: string | null; + createdAt?: string | null; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "site-settings_select". + */ +export interface SiteSettingsSelect { + siteName?: T; + siteTagline?: T; + logo?: T; + favicon?: T; + contact?: + | T + | { + email?: T; + phone?: T; + address?: T; + }; + footer?: + | T + | { + copyrightText?: T; + showSocialLinks?: T; + }; + seo?: + | T + | { + defaultMetaTitle?: T; + defaultMetaDescription?: T; + defaultOgImage?: T; + }; + updatedAt?: T; + createdAt?: T; + globalType?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "navigation_select". + */ +export interface NavigationSelect { + mainMenu?: + | T + | { + label?: T; + type?: T; + page?: T; + url?: T; + openInNewTab?: T; + submenu?: + | T + | { + label?: T; + linkType?: T; + page?: T; + url?: T; + id?: T; + }; + id?: T; + }; + footerMenu?: + | T + | { + label?: T; + linkType?: T; + page?: T; + url?: T; + id?: T; + }; + updatedAt?: T; + createdAt?: T; + globalType?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "seo-settings_select". + */ +export interface SeoSettingsSelect { + metaDefaults?: + | T + | { + titleSuffix?: T; + defaultDescription?: T; + defaultOgImage?: T; + keywords?: T; + }; + organization?: + | T + | { + name?: T; + legalName?: T; + description?: T; + logo?: T; + foundingDate?: T; + }; + contact?: + | T + | { + email?: T; + phone?: T; + fax?: T; + }; + address?: + | T + | { + street?: T; + postalCode?: T; + city?: T; + region?: T; + country?: T; + countryCode?: T; + }; + geo?: + | T + | { + latitude?: T; + longitude?: T; + }; + socialProfiles?: + | T + | { + platform?: T; + url?: T; + id?: T; + }; + localBusiness?: + | T + | { + enabled?: T; + type?: T; + priceRange?: T; + openingHours?: + | T + | { + specification?: T; + id?: T; + }; + }; + robots?: + | T + | { + allowIndexing?: T; + additionalDisallow?: T; + }; + verification?: + | T + | { + google?: T; + bing?: T; + yandex?: T; + }; + updatedAt?: T; + createdAt?: T; + globalType?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "auth". diff --git a/src/payload.config.ts b/src/payload.config.ts index f7fd544..f744b0e 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -2,38 +2,175 @@ import { buildConfig } from 'payload' import { postgresAdapter } from '@payloadcms/db-postgres' import { lexicalEditor } from '@payloadcms/richtext-lexical' import { multiTenantPlugin } from '@payloadcms/plugin-multi-tenant' +import { seoPlugin } from '@payloadcms/plugin-seo' +import { nestedDocsPlugin } from '@payloadcms/plugin-nested-docs' +import { formBuilderPlugin } from '@payloadcms/plugin-form-builder' +import { redirectsPlugin } from '@payloadcms/plugin-redirects' +import { de } from '@payloadcms/translations/languages/de' +import { en } from '@payloadcms/translations/languages/en' import path from 'path' import { fileURLToPath } from 'url' +import sharp from 'sharp' + +// Security: Validate required environment variables at startup +import { env } from './lib/envValidation' import { Users } from './collections/Users' import { Media } from './collections/Media' import { Tenants } from './collections/Tenants' +import { Pages } from './collections/Pages' +import { Posts } from './collections/Posts' +import { Categories } from './collections/Categories' +import { SocialLinks } from './collections/SocialLinks' +import { Testimonials } from './collections/Testimonials' +import { NewsletterSubscribers } from './collections/NewsletterSubscribers' + +// Consent Management Collections +import { CookieConfigurations } from './collections/CookieConfigurations' +import { CookieInventory } from './collections/CookieInventory' +import { ConsentLogs } from './collections/ConsentLogs' +import { PrivacyPolicySettings } from './collections/PrivacyPolicySettings' + +import { SiteSettings } from './globals/SiteSettings' +import { Navigation } from './globals/Navigation' +import { SEOSettings } from './globals/SEOSettings' const filename = fileURLToPath(import.meta.url) const dirname = path.dirname(filename) export default buildConfig({ + serverURL: process.env.PAYLOAD_PUBLIC_SERVER_URL || 'https://pl.c2sgmbh.de', admin: { user: Users.slug, }, - collections: [Users, Media, Tenants], + // Admin Panel Internationalization (UI translations) + i18n: { + supportedLanguages: { de, en }, + fallbackLanguage: 'de', + }, + // Content Localization (multilingual content) + localization: { + locales: [ + { + label: 'Deutsch', + code: 'de', + }, + { + label: 'English', + code: 'en', + }, + ], + defaultLocale: 'de', + fallback: true, + }, + // CORS Konfiguration für externe Frontends + cors: [ + 'http://localhost:3000', + 'http://localhost:3001', + 'http://10.10.180.153:3000', + 'http://10.10.180.153:3001', + 'https://dev.zh3.de', + 'https://porwoll.de', + 'https://www.porwoll.de', + ], + // CSRF Protection + csrf: [ + 'http://localhost:3000', + 'http://localhost:3001', + 'http://10.10.180.153:3000', + 'http://10.10.180.153:3001', + 'https://dev.zh3.de', + 'https://porwoll.de', + 'https://www.porwoll.de', + ], + collections: [ + Users, + Media, + Tenants, + Pages, + Posts, + Categories, + SocialLinks, + Testimonials, + NewsletterSubscribers, + // Consent Management + CookieConfigurations, + CookieInventory, + ConsentLogs, + PrivacyPolicySettings, + ], + globals: [SiteSettings, Navigation, SEOSettings], editor: lexicalEditor(), - secret: process.env.PAYLOAD_SECRET || '', + secret: env.PAYLOAD_SECRET, typescript: { outputFile: path.resolve(dirname, 'payload-types.ts'), }, db: postgresAdapter({ pool: { - connectionString: process.env.DATABASE_URI || '', + connectionString: env.DATABASE_URI, }, + // Deaktiviere automatisches Schema-Push + // Änderungen sollten nur über Migrationen erfolgen + push: false, }), + // Sharp für Bildoptimierung + sharp, plugins: [ multiTenantPlugin({ tenantsSlug: 'tenants', collections: { media: {}, + pages: {}, + posts: {}, + categories: {}, + 'social-links': {}, + // Type assertion für neue Collections bis payload-types.ts regeneriert wird + ...({ + testimonials: {}, + 'newsletter-subscribers': {}, + // Consent Management Collections - customTenantField: true weil sie bereits ein tenant-Feld haben + 'cookie-configurations': { customTenantField: true }, + 'cookie-inventory': { customTenantField: true }, + 'consent-logs': { customTenantField: true }, + 'privacy-policy-settings': { customTenantField: true }, + } as Record), }, debug: true, }), + seoPlugin({ + collections: [], + uploadsCollection: 'media', + generateTitle: ({ doc }) => `${doc?.title || ''} | Website`, + generateDescription: ({ doc }) => doc?.excerpt || '', + }), + nestedDocsPlugin({ + collections: [], + generateLabel: (_, doc) => doc.title as string, + generateURL: (docs) => docs.reduce((url, doc) => `${url}/${doc.slug}`, ''), + }), + formBuilderPlugin({ + fields: { + text: true, + textarea: true, + select: true, + email: true, + state: false, + country: false, + checkbox: true, + number: true, + message: true, + payment: false, + }, + // Fix für TypeScript Types Generation - das Plugin braucht explizite relationTo Angaben + redirectRelationships: ['pages'], + }), + redirectsPlugin({ + collections: ['pages'], + overrides: { + admin: { + group: 'Einstellungen', + }, + }, + }), ], })