diff --git a/.vscode/settings.json b/.vscode/settings.json index e0ffbfc..9315f09 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,7 @@ "editor.rulers": [100], "typescript.preferences.importModuleSpecifier": "non-relative", "editor.codeActionsOnSave": { - "source.fixAll": true, - "source.organizeImports": true + "source.fixAll": "explicit", + "source.organizeImports": "explicit" } } diff --git a/bun.lockb b/bun.lockb index 12d04d9..af9390d 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docker-compose.yml b/docker-compose.yml index bdd27ce..54b2e12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: "3" services: payload: - image: node:18-alpine + image: docker.io/library/node:18-alpine ports: - "${PAYLOAD_PORT}:${PAYLOAD_PORT}" volumes: @@ -20,7 +20,7 @@ services: NODE_ENV: development mongo: - image: mongo:latest + image: docker.io/library/mongo:latest ports: - "${MONGODB_PORT}:27017" command: diff --git a/package-lock.json b/package-lock.json index 673154c..2c539df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,23 +10,24 @@ "license": "MIT", "dependencies": { "@fontsource/vollkorn": "^5.0.17", - "@payloadcms/bundler-webpack": "^1.0.4", - "@payloadcms/db-mongodb": "^1.0.4", - "@payloadcms/richtext-lexical": "^0.1.15", + "@payloadcms/bundler-webpack": "^1.0.5", + "@payloadcms/db-mongodb": "^1.0.8", + "@payloadcms/richtext-lexical": "^0.1.17", "cross-env": "^7.0.3", "language-tags": "^1.0.9", "luxon": "^3.4.3", - "payload": "^2.0.13", - "styled-components": "^6.1.0" + "payload": "^2.1.1", + "sharp": "^0.33.2", + "styled-components": "^6.1.1" }, "devDependencies": { "@types/dotenv": "^8.2.0", - "@types/express": "^4.17.20", - "@types/language-tags": "^1.0.3", - "@types/luxon": "^3.3.3", - "@types/qs": "^6.9.9", + "@types/express": "^4.17.21", + "@types/language-tags": "^1.0.4", + "@types/luxon": "^3.3.4", + "@types/qs": "^6.9.10", "@types/react-router-dom": "^5.3.3", - "@types/styled-components": "^5.1.29", + "@types/styled-components": "^5.1.30", "copyfiles": "^2.4.1", "nodemon": "^3.0.1", "npm-check-updates": "^16.14.6", @@ -1721,6 +1722,15 @@ "react": ">=16.8.0" } }, + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@emotion/babel-plugin": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", @@ -1943,6 +1953,437 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.2.tgz", + "integrity": "sha512-itHBs1rPmsmGF9p4qRe++CzCgd+kFYktnsoR1sbIAfsRMrJZau0Tt1AH9KVnufc2/tU02Gf6Ibujx+15qRE03w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.2.tgz", + "integrity": "sha512-/rK/69Rrp9x5kaWBjVN07KixZanRr+W1OiyKdXcbjQD6KbW+obaTeBBtLUAtbBsnlTTmWthw99xqoOS7SsySDg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-kQyrSNd6lmBV7O0BUiyu/OEw9yeNGFbQhbxswS1i6rMDwBBSX+e+rPzu3S+MwAiGU3HdLze3PanQ4Xkfemgzcw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=11", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.1.tgz", + "integrity": "sha512-eVU/JYLPVjhhrd8Tk6gosl5pVlvsqiFlt50wotCvdkFGf+mDNBJxMh+bvav+Wt3EBnNZWq8Sp2I7XfSjm8siog==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "macos": ">=10.13", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.1.tgz", + "integrity": "sha512-FtdMvR4R99FTsD53IA3LxYGghQ82t3yt0ZQ93WMZ2xV3dqrb0E8zq4VHaTOuLEAuA83oDawHV3fd+BsAPadHIQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.1.tgz", + "integrity": "sha512-bnGG+MJjdX70mAQcSLxgeJco11G+MxTz+ebxlz8Y3dxyeb3Nkl7LgLI0mXupoO+u1wRNx/iRj5yHtzA4sde1yA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.1.tgz", + "integrity": "sha512-3+rzfAR1YpMOeA2zZNp+aYEzGNWK4zF3+sdMxuCS3ey9HhDbJ66w6hDSHDMoap32DueFwhhs3vwooAB2MaK4XQ==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.1.tgz", + "integrity": "sha512-3NR1mxFsaSgMMzz1bAnnKbSAI+lHXVTqAHgc1bgzjHuXjo4hlscpUxc0vFSAPKI3yuzdzcZOkq7nDPrP2F8Jgw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.1.tgz", + "integrity": "sha512-5aBRcjHDG/T6jwC3Edl3lP8nl9U2Yo8+oTl5drd1dh9Z1EBfzUKAJFUDTDisDjUwc7N4AjnPGfCA3jl3hY8uDg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.1.tgz", + "integrity": "sha512-dcT7inI9DBFK6ovfeWRe3hG30h51cBAP5JXlZfx6pzc/Mnf9HFCQDLtYf4MCBjxaaTfjCCjkBxcy3XzOAo5txw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.2.tgz", + "integrity": "sha512-Fndk/4Zq3vAc4G/qyfXASbS3HBZbKrlnKZLEJzPLrXoJuipFNNwTes71+Ki1hwYW5lch26niRYoZFAtZVf3EGA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.2.tgz", + "integrity": "sha512-pz0NNo882vVfqJ0yNInuG9YH71smP4gRSdeL09ukC2YLE6ZyZePAlWKEHgAzJGTiOh8Qkaov6mMIMlEhmLdKew==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.2.tgz", + "integrity": "sha512-MBoInDXDppMfhSzbMmOQtGfloVAflS2rP1qPcUIiITMi36Mm5YR7r0ASND99razjQUpHTzjrU1flO76hKvP5RA==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.28", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.1" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.2.tgz", + "integrity": "sha512-xUT82H5IbXewKkeF5aiooajoO1tQV4PnKfS/OZtb5DDdxS/FCI/uXTVZ35GQ97RZXsycojz/AJ0asoz6p2/H/A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "glibc": ">=2.26", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.2.tgz", + "integrity": "sha512-F+0z8JCu/UnMzg8IYW1TMeiViIWBVg7IWP6nE0p5S5EPQxlLd76c8jYemG21X99UzFwgkRo5yz2DS+zbrnxZeA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.2.tgz", + "integrity": "sha512-+ZLE3SQmSL+Fn1gmSaM8uFusW5Y3J9VOf+wMGNnTtJUMUxFhv+P4UPaYEYT8tqnyYVaOVGgMN/zsOxn9pSsO2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "musl": ">=1.2.2", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.1" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.2.tgz", + "integrity": "sha512-fLbTaESVKuQcpm8ffgBD7jLb/CQLcATju/jxtTXR1XCLwbOQt+OL5zPHSDMmp2JZIeq82e18yE0Vv7zh6+6BfQ==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/runtime": "^0.45.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.2.tgz", + "integrity": "sha512-okBpql96hIGuZ4lN3+nsAjGeggxKm7hIRu9zyec0lnfB8E7Z6p95BuRZzDDXZOl2e8UmR4RhYt631i7mfmKU8g==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.2.tgz", + "integrity": "sha512-E4magOks77DK47FwHUIGH0RYWSgRBfGdK56kIHSVeB9uIS4pPFr4N2kIVsXdQQo4LzOsENKV5KAhRlRL7eMAdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0", + "yarn": ">=3.2.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -2157,14 +2598,6 @@ "lexical": "0.12.2" } }, - "node_modules/@lexical/file": { - "version": "0.12.2", - "resolved": "https://registry.npmjs.org/@lexical/file/-/file-0.12.2.tgz", - "integrity": "sha512-jkhaGhj+lj/Edc1YGxdw1RzOIt04yy7KRsgSDHSPo38nqyhOh2oKqUQhnBcFIHCrB0TPCmIT0IbviYY/8TBvJw==", - "peerDependencies": { - "lexical": "0.12.2" - } - }, "node_modules/@lexical/hashtag": { "version": "0.12.2", "resolved": "https://registry.npmjs.org/@lexical/hashtag/-/hashtag-0.12.2.tgz", @@ -2597,9 +3030,9 @@ } }, "node_modules/@payloadcms/bundler-webpack": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@payloadcms/bundler-webpack/-/bundler-webpack-1.0.4.tgz", - "integrity": "sha512-ou3FUDi10GZCxjnzQ+fR4R3SFUVeCv3sWqtpzV1vza0g6CM4T+rDQeCIf5huveWJ2Vwfw276il+F6Cp7XdUd4Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@payloadcms/bundler-webpack/-/bundler-webpack-1.0.5.tgz", + "integrity": "sha512-TjzRTGRDQPrxGoMZ+fV76Pzx3nXC37oSZe/+dA/5HM18fRA9vlu/z54r8HHvThZc7ywx0iRiSwgPZYzQu5xUVQ==", "dependencies": { "compression": "1.7.4", "connect-history-api-fallback": "1.6.0", @@ -2632,9 +3065,9 @@ } }, "node_modules/@payloadcms/db-mongodb": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@payloadcms/db-mongodb/-/db-mongodb-1.0.4.tgz", - "integrity": "sha512-AkCVp407Y210TPt0imtUrtBxKrvlSgsbwZ9GrJXL8RACo3P86e4N+4wPlHKSF74w/rvagNDy151P5pvmmiRLYQ==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@payloadcms/db-mongodb/-/db-mongodb-1.0.8.tgz", + "integrity": "sha512-7U1BXY7JdoQrUkxdre4E0PhHsZw4LmNcJGwhkENnKtJB2xU4zZc3Ed6Uk0W4WbLYw0xCZCtYzW7qQ0GUYjOmSw==", "dependencies": { "bson-objectid": "2.0.4", "deepmerge": "4.3.1", @@ -2658,36 +3091,26 @@ } }, "node_modules/@payloadcms/richtext-lexical": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/@payloadcms/richtext-lexical/-/richtext-lexical-0.1.15.tgz", - "integrity": "sha512-NgsoZ5Gm0fDAZvtapNgiP3E4u1dFxqn+bAHMWU7i2IYDZz+oFP7SLOqKfhNXkEJlmhXIPCNxLdZiFJxPXVw3Vw==", + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/@payloadcms/richtext-lexical/-/richtext-lexical-0.1.17.tgz", + "integrity": "sha512-HJVSmt9oFv5gSFsC1DQH6UTJW8fyrduwFD9wGg2HQpkuTZo6n0pKEnFlkJyuy9z9ZgMBqShCOVYPdhaHc8Mw+Q==", "dependencies": { "@faceless-ui/modal": "2.0.1", - "@lexical/clipboard": "0.12.2", - "@lexical/code": "0.12.2", - "@lexical/file": "0.12.2", - "@lexical/hashtag": "0.12.2", "@lexical/headless": "0.12.2", - "@lexical/html": "0.12.2", "@lexical/link": "0.12.2", "@lexical/list": "0.12.2", "@lexical/mark": "0.12.2", "@lexical/markdown": "0.12.2", - "@lexical/overflow": "0.12.2", - "@lexical/plain-text": "0.12.2", "@lexical/react": "0.12.2", "@lexical/rich-text": "0.12.2", "@lexical/selection": "0.12.2", - "@lexical/table": "0.12.2", "@lexical/utils": "0.12.2", "bson-objectid": "2.0.4", "classnames": "^2.3.2", "deep-equal": "2.2.2", "i18next": "22.5.1", - "katex": "0.16.8", "lexical": "0.12.2", "lodash": "4.17.21", - "openai": "4.7.1", "react": "18.2.0", "react-dom": "18.2.0", "react-error-boundary": "^4.0.11", @@ -2695,7 +3118,7 @@ "ts-essentials": "7.0.3" }, "peerDependencies": { - "payload": "^2.0.6" + "payload": "^2.0.14" } }, "node_modules/@pkgjs/parseargs": { @@ -3859,9 +4282,9 @@ "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" }, "node_modules/@types/express": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.20.tgz", - "integrity": "sha512-rOaqlkgEvOW495xErXMsmyX3WKBInbhG5eqojXYi3cGUaLoRDlXa5d52fkfWZT963AZ3v2eZ4MbKE6WpDAGVsw==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "dependencies": { "@types/body-parser": "*", @@ -3957,9 +4380,9 @@ "dev": true }, "node_modules/@types/language-tags": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/language-tags/-/language-tags-1.0.3.tgz", - "integrity": "sha512-YwOfmHfZmsPZjLu4tnGFDukszUPk2LMkAOYjyIEfqeyoPs7ZHmXRZN/U+d4vePDDbDPhOcOe6htR8UEgsCCwDw==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/language-tags/-/language-tags-1.0.4.tgz", + "integrity": "sha512-20PQbifv3v/djCT+KlXybv0KqO5ofoR1qD1wkinN59kfggTPVTWGmPFgL/1yWuDyRcsQP/POvkqK+fnl5nOwTg==", "dev": true }, "node_modules/@types/lodash": { @@ -3968,9 +4391,9 @@ "integrity": "sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==" }, "node_modules/@types/luxon": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.3.tgz", - "integrity": "sha512-/BJF3NT0pRMuxrenr42emRUF67sXwcZCd+S1ksG/Fcf9O7C3kKCY4uJSbKBE4KDUIYr3WMsvfmWD8hRjXExBJQ==", + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.4.tgz", + "integrity": "sha512-H9OXxv4EzJwE75aTPKpiGXJq+y4LFxjpsdgKwSmr503P5DkWc3AG7VAFYrFNVvqemT5DfgZJV9itYhqBHSGujA==", "dev": true }, "node_modules/@types/mime": { @@ -3989,15 +4412,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.1.tgz", "integrity": "sha512-JIzsAvJeA/5iY6Y/OxZbv1lUcc8dNSE77lb2gnBH+/PJ3lFR1Ccvgwl5JWnHAkNHcRsT0TbpVOsiMKZ1F/yyJg==" }, - "node_modules/@types/node-fetch": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.6.tgz", - "integrity": "sha512-95X8guJYhfqiuVVhRFxVQcf4hW/2bCuoPwDasMf/531STFoNoWTT7YDnWdXHEZKqAGUigmpG31r2FE70LwnzJw==", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "node_modules/@types/parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", @@ -4014,9 +4428,9 @@ "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, "node_modules/@types/qs": { - "version": "6.9.9", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.9.tgz", - "integrity": "sha512-wYLxw35euwqGvTDx6zfY1vokBFnsK0HNrzc6xNHchxfO2hpuRg74GbkEW7e3sSmPvj0TjCDT1VCa6OtHXnubsg==", + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", "dev": true }, "node_modules/@types/range-parser": { @@ -4091,9 +4505,9 @@ } }, "node_modules/@types/styled-components": { - "version": "5.1.29", - "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.29.tgz", - "integrity": "sha512-5h/ah9PAblggQ6Laa4peplT4iY5ddA8qM1LMD4HzwToUWs3hftfy0fayeRgbtH1JZUdw5CCaowmz7Lnb8SjIxQ==", + "version": "5.1.30", + "resolved": "https://registry.npmjs.org/@types/styled-components/-/styled-components-5.1.30.tgz", + "integrity": "sha512-xxJqw0s1myRTgrzHgG5tKHS9hK+KNhjbKMXDWlHRo9eDNVVUqf147QUGYUqwyCDkFyGr2pi1qJKFMEy0ACZb0A==", "dev": true, "dependencies": { "@types/hoist-non-react-statics": "*", @@ -4402,6 +4816,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "dev": true, "dependencies": { "humanize-ms": "^1.2.1" }, @@ -4619,11 +5034,6 @@ "node": ">=8" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, "node_modules/atomic-sleep": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", @@ -4711,11 +5121,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/base-64": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/base-64/-/base-64-0.1.0.tgz", - "integrity": "sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==" - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -5562,17 +5967,6 @@ "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -6419,14 +6813,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -6474,15 +6860,6 @@ "node": ">=0.3.1" } }, - "node_modules/digest-fetch": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/digest-fetch/-/digest-fetch-1.3.0.tgz", - "integrity": "sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA==", - "dependencies": { - "base-64": "^0.1.0", - "md5": "^2.3.0" - } - }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -7301,36 +7678,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/form-data-encoder": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.7.2.tgz", - "integrity": "sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==" - }, - "node_modules/formdata-node": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", - "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", - "dependencies": { - "node-domexception": "1.0.0", - "web-streams-polyfill": "4.0.0-beta.3" - }, - "engines": { - "node": ">= 12.20" - } - }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -8215,6 +8562,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dev": true, "dependencies": { "ms": "^2.0.0" } @@ -9143,21 +9491,6 @@ "node": ">=12.0.0" } }, - "node_modules/katex": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.8.tgz", - "integrity": "sha512-ftuDnJbcbOckGY11OO+zg3OofESlbR5DRl2cmN8HeWeeFIV7wTXvAOx8kEjZjobhA+9wh2fbKeO6cdcA9Mnovg==", - "funding": [ - "https://opencollective.com/katex", - "https://github.com/sponsors/katex" - ], - "dependencies": { - "commander": "^8.3.0" - }, - "bin": { - "katex": "cli.js" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -10038,9 +10371,9 @@ } }, "node_modules/node-abi": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", - "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", + "version": "3.54.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.54.0.tgz", + "integrity": "sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==", "dependencies": { "semver": "^7.3.5" }, @@ -10053,24 +10386,6 @@ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==" }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, "node_modules/node-fetch": { "version": "2.6.12", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", @@ -10756,29 +11071,6 @@ "node": ">=6" } }, - "node_modules/openai": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.7.1.tgz", - "integrity": "sha512-4Um9A4aLGzZxyENyway0zVgi69BOxaqXmjOCKp3PUteOvSn9TeVf6IjkaNY8k/LXYG5l2e7PpacOl2sxsrTc/w==", - "dependencies": { - "@types/node": "^18.11.18", - "@types/node-fetch": "^2.6.4", - "abort-controller": "^3.0.0", - "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", - "form-data-encoder": "1.7.2", - "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" - }, - "bin": { - "openai": "bin/cli" - } - }, - "node_modules/openai/node_modules/@types/node": { - "version": "18.18.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.4.tgz", - "integrity": "sha512-t3rNFBgJRugIhackit2mVcLfF6IRc0JE4oeizPQL8Zrm8n2WY/0wOdpOPhdtG0V9Q2TlW/axbF1MJ6z+Yj/kKQ==" - }, "node_modules/opener": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", @@ -11111,9 +11403,9 @@ "integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg==" }, "node_modules/payload": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/payload/-/payload-2.0.13.tgz", - "integrity": "sha512-rD9ncVH8ClP7SphDymnrtVv0GAwHeyBXt9b1wSQBF15Dx/svU5rD1OEDtDPgEUTQApnySBVsB4NDGM1xO32YjA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/payload/-/payload-2.1.1.tgz", + "integrity": "sha512-hhfog5lE7jRsbuYiWZmyn6xsvt1iAO2N+dfae22QcaUAbMP0HKgM2j8YKZTORcqhFpglcQXQ8MPp+2lbvVagBw==", "dependencies": { "@date-io/date-fns": "2.16.0", "@dnd-kit/core": "6.0.8", @@ -11203,7 +11495,7 @@ "terser-webpack-plugin": "5.3.9", "ts-essentials": "7.0.3", "use-context-selector": "1.4.1", - "uuid": "8.3.2" + "uuid": "9.0.1" }, "bin": { "payload": "bin.js" @@ -11288,6 +11580,40 @@ "node": ">=10" } }, + "node_modules/payload/node_modules/sharp": { + "version": "0.32.6", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", + "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "hasInstallScript": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.2", + "node-addon-api": "^6.1.0", + "prebuild-install": "^7.1.1", + "semver": "^7.5.4", + "simple-get": "^4.0.1", + "tar-fs": "^3.0.4", + "tunnel-agent": "^0.6.0" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/payload/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/peek-readable": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/peek-readable/-/peek-readable-4.1.0.tgz", @@ -14146,25 +14472,42 @@ "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" }, "node_modules/sharp": { - "version": "0.32.6", - "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz", - "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==", + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.2.tgz", + "integrity": "sha512-WlYOPyyPDiiM07j/UO+E720ju6gtNtHjEGg5vovUk1Lgxyjm2LFO+37Nt/UI3MMh2l6hxTWQWi7qk3cXJTutcQ==", "hasInstallScript": true, "dependencies": { "color": "^4.2.3", "detect-libc": "^2.0.2", - "node-addon-api": "^6.1.0", - "prebuild-install": "^7.1.1", - "semver": "^7.5.4", - "simple-get": "^4.0.1", - "tar-fs": "^3.0.4", - "tunnel-agent": "^0.6.0" + "semver": "^7.5.4" }, "engines": { - "node": ">=14.15.0" + "libvips": ">=8.15.1", + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" }, "funding": { "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.2", + "@img/sharp-darwin-x64": "0.33.2", + "@img/sharp-libvips-darwin-arm64": "1.0.1", + "@img/sharp-libvips-darwin-x64": "1.0.1", + "@img/sharp-libvips-linux-arm": "1.0.1", + "@img/sharp-libvips-linux-arm64": "1.0.1", + "@img/sharp-libvips-linux-s390x": "1.0.1", + "@img/sharp-libvips-linux-x64": "1.0.1", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.1", + "@img/sharp-libvips-linuxmusl-x64": "1.0.1", + "@img/sharp-linux-arm": "0.33.2", + "@img/sharp-linux-arm64": "0.33.2", + "@img/sharp-linux-s390x": "0.33.2", + "@img/sharp-linux-x64": "0.33.2", + "@img/sharp-linuxmusl-arm64": "0.33.2", + "@img/sharp-linuxmusl-x64": "0.33.2", + "@img/sharp-wasm32": "0.33.2", + "@img/sharp-win32-ia32": "0.33.2", + "@img/sharp-win32-x64": "0.33.2" } }, "node_modules/shebang-command": { @@ -14549,9 +14892,9 @@ } }, "node_modules/streamx": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz", - "integrity": "sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==", + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", "dependencies": { "fast-fifo": "^1.1.0", "queue-tick": "^1.0.1" @@ -14679,9 +15022,9 @@ } }, "node_modules/styled-components": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.0.tgz", - "integrity": "sha512-VWNfYYBuXzuLS/QYEeoPgMErP26WL+dX9//rEh80B2mmlS1yRxRxuL5eax4m6ybYEUoHWlTy2XOU32767mlMkg==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.1.tgz", + "integrity": "sha512-cpZZP5RrKRIClBW5Eby4JM1wElLVP4NQrJbJ0h10TidTyJf4SIIwa3zLXOoPb4gJi8MsJ8mjq5mu2IrEhZIAcQ==", "dependencies": { "@emotion/is-prop-valid": "^1.2.1", "@emotion/unitless": "^0.8.0", @@ -14911,9 +15254,9 @@ } }, "node_modules/tar-stream": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", - "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", "dependencies": { "b4a": "^1.6.4", "fast-fifo": "^1.2.0", @@ -15651,6 +15994,7 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "optional": true, "bin": { "uuid": "dist/bin/uuid" } @@ -15724,14 +16068,6 @@ "node": ">=10.13.0" } }, - "node_modules/web-streams-polyfill": { - "version": "4.0.0-beta.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", - "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", - "engines": { - "node": ">= 14" - } - }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", diff --git a/package.json b/package.json index 4b211e4..6c4dc0c 100644 --- a/package.json +++ b/package.json @@ -24,23 +24,24 @@ }, "dependencies": { "@fontsource/vollkorn": "^5.0.17", - "@payloadcms/bundler-webpack": "^1.0.4", - "@payloadcms/db-mongodb": "^1.0.4", - "@payloadcms/richtext-lexical": "^0.1.15", + "@payloadcms/bundler-webpack": "^1.0.5", + "@payloadcms/db-mongodb": "^1.0.8", + "@payloadcms/richtext-lexical": "^0.1.17", "cross-env": "^7.0.3", "language-tags": "^1.0.9", "luxon": "^3.4.3", - "payload": "^2.0.13", - "styled-components": "^6.1.0" + "payload": "^2.1.1", + "sharp": "^0.33.2", + "styled-components": "^6.1.1" }, "devDependencies": { "@types/dotenv": "^8.2.0", - "@types/express": "^4.17.20", - "@types/language-tags": "^1.0.3", - "@types/luxon": "^3.3.3", - "@types/qs": "^6.9.9", + "@types/express": "^4.17.21", + "@types/language-tags": "^1.0.4", + "@types/luxon": "^3.3.4", + "@types/qs": "^6.9.10", "@types/react-router-dom": "^5.3.3", - "@types/styled-components": "^5.1.29", + "@types/styled-components": "^5.1.30", "copyfiles": "^2.4.1", "nodemon": "^3.0.1", "npm-check-updates": "^16.14.6", diff --git a/src/collections/ChronologyItems/ChronologyItems.ts b/src/collections/ChronologyItems/ChronologyItems.ts index 2375e89..49adf5d 100644 --- a/src/collections/ChronologyItems/ChronologyItems.ts +++ b/src/collections/ChronologyItems/ChronologyItems.ts @@ -18,7 +18,6 @@ import { validateEventsTranslationsTitle } from "./validations/validateEventsTra const fields = { name: "name", events: "events", - eventsSource: "source", eventsTranslations: "translations", eventsTranslationsTitle: "title", eventsTranslationsDescription: "description", @@ -98,13 +97,6 @@ export const ChronologyItems: CollectionConfig = buildVersionedCollectionConfig( required: true, minRows: 1, fields: [ - { - name: fields.eventsSource, - type: "relationship", - relationTo: [Collections.Contents, Collections.LibraryItems], - // required: true, - admin: { allowCreate: false }, - }, translatedFields({ name: fields.eventsTranslations, required: true, diff --git a/src/collections/Folders/Folders.ts b/src/collections/Folders/Folders.ts new file mode 100644 index 0000000..834bc66 --- /dev/null +++ b/src/collections/Folders/Folders.ts @@ -0,0 +1,64 @@ +import { CollectionGroups, Collections } from "../../constants"; +import { rowField } from "../../fields/rowField/rowField"; +import { slugField } from "../../fields/slugField/slugField"; +import { translatedFields } from "../../fields/translatedFields/translatedFields"; +import { buildCollectionConfig } from "../../utils/collectionConfig"; + +const fields = { + slug: "slug", + translations: "translations", + translationsName: "name", + sections: "sections", + sectionsSubfolders: "subfolders", + sectionsName: "name", + files: "files", +} as const satisfies Record; + +export const Folders = buildCollectionConfig({ + slug: Collections.Folders, + labels: { singular: "Folder", plural: "Folders" }, + admin: { + useAsTitle: fields.slug, + group: CollectionGroups.Collections, + }, + fields: [ + slugField({ name: fields.slug }), + translatedFields({ + name: fields.translations, + fields: [ + { + name: fields.translationsName, + type: "text", + required: true, + }, + ], + }), + { + name: "sections", + type: "array", + fields: [ + rowField([ + { + name: fields.sectionsName, + type: "text", + admin: { + condition: (data) => data[fields.sections]?.length > 1, + }, + }, + { + name: fields.sectionsSubfolders, + type: "relationship", + relationTo: Collections.Folders, + hasMany: true, + }, + ]), + ], + }, + { + type: "relationship", + name: fields.files, + relationTo: [Collections.LibraryItems, Collections.Contents], + hasMany: true, + }, + ], +}); diff --git a/src/collections/LibraryFolders/LibraryFolders.ts b/src/collections/LibraryFolders/LibraryFolders.ts deleted file mode 100644 index e04e910..0000000 --- a/src/collections/LibraryFolders/LibraryFolders.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { CollectionGroups, Collections } from "../../constants"; -import { backPropagationField } from "../../fields/backPropagationField/backPropagationField"; -import { rowField } from "../../fields/rowField/rowField"; -import { slugField } from "../../fields/slugField/slugField"; -import { translatedFields } from "../../fields/translatedFields/translatedFields"; -import { buildCollectionConfig } from "../../utils/collectionConfig"; -import { createEditor } from "../../utils/editor"; - -const fields = { - slug: "slug", - translations: "translations", - name: "name", - description: "description", - subfolders: "subfolders", - items: "items", - parentFolders: "parentFolders", -} as const satisfies Record; - -export const LibraryFolders = buildCollectionConfig({ - slug: Collections.LibraryFolders, - labels: { - singular: "Library Folder", - plural: "Library Folders", - }, - defaultSort: fields.slug, - admin: { - useAsTitle: fields.slug, - defaultColumns: [fields.slug, fields.translations], - disableDuplicate: true, - group: CollectionGroups.Collections, - }, - timestamps: false, - versions: false, - fields: [ - slugField({ name: fields.slug }), - translatedFields({ - name: fields.translations, - admin: { - useAsTitle: fields.name, - }, - fields: [ - { name: fields.name, type: "text", required: true }, - { - name: fields.description, - type: "richText", - editor: createEditor({ inlines: true, lists: true, links: true }), - }, - ], - }), - rowField([ - backPropagationField({ - name: fields.parentFolders, - relationTo: Collections.LibraryFolders, - hasMany: true, - where: ({ id }) => ({ [fields.subfolders]: { equals: id } }), - }), - { - type: "relationship", - name: fields.subfolders, - relationTo: Collections.LibraryFolders, - hasMany: true, - }, - { - type: "relationship", - name: fields.items, - relationTo: Collections.LibraryItems, - hasMany: true, - }, - ]), - ], -}); diff --git a/src/collections/LibraryItems/LibraryItems.ts b/src/collections/LibraryItems/LibraryItems.ts index f97e58e..e327cb2 100644 --- a/src/collections/LibraryItems/LibraryItems.ts +++ b/src/collections/LibraryItems/LibraryItems.ts @@ -704,15 +704,16 @@ export const LibraryItems = buildVersionedCollectionConfig({ label: "Contents", fields: [ rowField([ - backPropagationField({ - name: fields.parentFolders, - relationTo: Collections.LibraryFolders, - hasMany: true, - where: ({ id }) => ({ items: { equals: id } }), - admin: { - description: `You can set the folders from the "Library Folders" collection`, - }, - }), + // TODO: Uncomment when the Folders are ready + // backPropagationField({ + // name: fields.parentFolders, + // relationTo: Collections.Folders, + // hasMany: true, + // where: ({ id }) => ({ files: { equals: id } }), + // admin: { + // description: `You can set the folders from the "Folders" collection`, + // }, + // }), backPropagationField({ name: fields.parentItems, relationTo: Collections.LibraryItems, diff --git a/src/collections/Posts/Posts.ts b/src/collections/Posts/Posts.ts index ac880b7..b3c9533 100644 --- a/src/collections/Posts/Posts.ts +++ b/src/collections/Posts/Posts.ts @@ -12,6 +12,7 @@ import { beforeDuplicateUnpublish } from "../../hooks/beforeDuplicateUnpublish"; import { isDefined, isUndefined } from "../../utils/asserts"; import { createEditor } from "../../utils/editor"; import { buildVersionedCollectionConfig } from "../../utils/versionedCollectionConfig"; +import { importFromStrapi } from "./endpoints/importFromStrapi"; const fields = { slug: "slug", @@ -60,6 +61,7 @@ export const Posts = buildVersionedCollectionConfig({ }, preview: (doc) => `https://accords-library.com/news/${doc.slug}`, }, + endpoints: [importFromStrapi], fields: [ rowField([ slugField({ name: fields.slug }), @@ -72,7 +74,7 @@ export const Posts = buildVersionedCollectionConfig({ { name: fields.authors, type: "relationship", - relationTo: [Collections.Recorders], + relationTo: Collections.Recorders, required: true, minRows: 1, hasMany: true, diff --git a/src/collections/Posts/endpoints/importFromStrapi.ts b/src/collections/Posts/endpoints/importFromStrapi.ts new file mode 100644 index 0000000..abc12b8 --- /dev/null +++ b/src/collections/Posts/endpoints/importFromStrapi.ts @@ -0,0 +1,115 @@ +import { DateTime } from "luxon"; +import type { MarkOptional } from "ts-essentials"; +import { Collections } from "../../../constants"; +import { createStrapiImportEndpoint } from "../../../endpoints/createStrapiImportEndpoint"; +import type { Post } from "../../../types/collections"; +import { StrapiImage, StrapiLanguage, StrapiRecorders } from "../../../types/strapi"; +import { isDefined, isUndefined } from "../../../utils/asserts"; +import { findCategory, findRecorder, uploadStrapiImage } from "../../../utils/localApi"; +import { plainTextToLexical } from "../../../utils/string"; + +type StrapiPost = { + slug: string; + categories: { data: { attributes: { slug: string } }[] }; + authors: StrapiRecorders; + hidden: boolean; + thumbnail: StrapiImage; + translations: { + title: string; + excerpt?: string; + body: string; + translators: StrapiRecorders; + proofreaders: StrapiRecorders; + language: StrapiLanguage; + source_language: StrapiLanguage; + }[]; + date: { + day: number; + month: number; + year: number; + }; +}; + +export const importFromStrapi = createStrapiImportEndpoint({ + strapi: { + collection: "posts", + params: { + populate: [ + "date", + "authors", + "thumbnail", + "categories", + "translations", + "translations.language", + "translations.translators", + "translations.proofreaders", + "translations.source_language", + ], + }, + }, + payload: { + collection: Collections.Posts, + convert: async ({ + slug, + date: { day, month, year }, + hidden, + authors, + thumbnail, + categories, + translations, + }) => { + const thumbnailId = await uploadStrapiImage({ + collection: Collections.PostsThumbnails, + image: thumbnail, + }); + + const handleTranslation = async ({ + language, + title, + body, + excerpt, + proofreaders, + source_language, + translators, + }: StrapiPost["translations"][number]): Promise => { + if (isUndefined(language.data)) + throw new Error("A language is required for a post translation"); + if (isUndefined(source_language.data)) + throw new Error("A source_language is required for a post translation"); + return { + language: language.data.attributes.code, + sourceLanguage: source_language.data.attributes.code, + title, + content: plainTextToLexical(body), + summary: isDefined(excerpt) ? plainTextToLexical(excerpt) : undefined, + translators: + translators.data && + (await Promise.all( + translators.data?.map(async (recorder) => findRecorder(recorder.attributes.username)) + )), + proofreaders: + proofreaders.data && + (await Promise.all( + proofreaders.data?.map(async (recorder) => findRecorder(recorder.attributes.username)) + )), + }; + }; + + const data: MarkOptional = { + slug, + publishedDate: + DateTime.fromObject({ day, month, year }).toISO() ?? new Date().toISOString(), + categories: await Promise.all( + categories.data.map((category) => findCategory(category.attributes.slug)) + ), + translations: await Promise.all(translations.map(handleTranslation)), + authors: await Promise.all( + authors.data?.map((author) => findRecorder(author.attributes.username)) ?? [] + ), + thumbnail: thumbnailId, + hidden, + }; + return data; + }, + }, +}); diff --git a/src/collections/Recorders/Recorders.ts b/src/collections/Recorders/Recorders.ts index a17ed70..308aae1 100644 --- a/src/collections/Recorders/Recorders.ts +++ b/src/collections/Recorders/Recorders.ts @@ -65,7 +65,7 @@ export const Recorders = buildCollectionConfig({ ], }, }, - auth: true, + auth: { tokenExpiration: 24 * 60 * 60 }, access: { unlock: mustBeAdminForCollections, update: mustBeAdminOrSelf, diff --git a/src/constants.ts b/src/constants.ts index 6ebe990..320c816 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -8,7 +8,6 @@ export enum Collections { Files = "files", Keys = "keys", Languages = "languages", - LibraryFolders = "library-folders", LibraryItems = "library-items", LibraryItemsThumbnails = "library-items-thumbnails", LibraryItemsScans = "library-items-scans", @@ -23,6 +22,7 @@ export enum Collections { Weapons = "weapons", WeaponsGroups = "weapons-groups", WeaponsThumbnails = "weapons-thumbnails", + Folders = "folders" } export enum CollectionGroups { diff --git a/src/payload.config.ts b/src/payload.config.ts index 67cc2a2..bbb7c7e 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -9,9 +9,9 @@ import { ContentsFolders } from "./collections/ContentsFolders/ContentsFolders"; import { ContentsThumbnails } from "./collections/ContentsThumbnails/ContentsThumbnails"; import { Currencies } from "./collections/Currencies/Currencies"; import { Files } from "./collections/Files/Files"; +import { Folders } from "./collections/Folders/Folders"; import { Keys } from "./collections/Keys/Keys"; import { Languages } from "./collections/Languages/Languages"; -import { LibraryFolders } from "./collections/LibraryFolders/LibraryFolders"; import { LibraryItems } from "./collections/LibraryItems/LibraryItems"; import { LibraryItemsGallery } from "./collections/LibraryItemsGallery/LibraryItemsGallery"; import { LibraryItemsScans } from "./collections/LibraryItemsScans/LibraryItemsScans"; @@ -46,7 +46,7 @@ export default buildConfig({ }, editor: createEditor({}), collections: [ - LibraryFolders, + Folders, LibraryItems, Contents, ContentsFolders, diff --git a/src/types/collections.ts b/src/types/collections.ts index 86ab027..6531364 100644 --- a/src/types/collections.ts +++ b/src/types/collections.ts @@ -6,65 +6,73 @@ * and re-run `payload generate:types` to regenerate this file. */ -export type CategoryTranslations = { - language: string | Language; - name: string; - short?: string; - id?: string; -}[]; -export type RecorderBiographies = { - language: string | Language; - biography: { - [k: string]: unknown; - }[]; - id?: string; -}[]; +export type RecorderBiographies = + | { + language: string | Language; + biography: { + [k: string]: unknown; + }[]; + id?: string | null; + }[] + | null; +export type CategoryTranslations = + | { + language: string | Language; + name: string; + short?: string | null; + id?: string | null; + }[] + | null; export interface Config { collections: { - "library-folders": LibraryFolder; - "library-items": LibraryItem; + 'library-folders': LibraryFolder; + 'library-items': LibraryItem; contents: Content; - "contents-folders": ContentsFolder; + 'contents-folders': ContentsFolder; posts: Post; - "chronology-items": ChronologyItem; - "chronology-eras": ChronologyEra; + 'chronology-items': ChronologyItem; + 'chronology-eras': ChronologyEra; weapons: Weapon; - "weapons-groups": WeaponsGroup; - "weapons-thumbnails": WeaponsThumbnail; - "contents-thumbnails": ContentsThumbnail; - "library-items-thumbnails": LibraryItemThumbnail; - "library-items-scans": LibraryItemScans; - "library-items-gallery": LibraryItemGallery; - "recorders-thumbnails": RecordersThumbnail; - "posts-thumbnails": PostThumbnail; + 'weapons-groups': WeaponsGroup; + 'weapons-thumbnails': WeaponsThumbnail; + 'contents-thumbnails': ContentsThumbnail; + 'library-items-thumbnails': LibraryItemThumbnail; + 'library-items-scans': LibraryItemScans; + 'library-items-gallery': LibraryItemGallery; + 'recorders-thumbnails': RecordersThumbnail; + 'posts-thumbnails': PostThumbnail; files: File; Notes: Note; videos: Video; - "videos-channels": VideosChannel; + 'videos-channels': VideosChannel; languages: Language; currencies: Currency; recorders: Recorder; keys: Key; - "payload-preferences": PayloadPreference; - "payload-migrations": PayloadMigration; + 'payload-preferences': PayloadPreference; + 'payload-migrations': PayloadMigration; }; globals: {}; } export interface LibraryFolder { id: string; slug: string; - translations?: { - language: string | Language; - name: string; - description?: { - [k: string]: unknown; - }[]; - id?: string; - }[]; - parentFolders?: string[] | LibraryFolder[]; - subfolders?: string[] | LibraryFolder[]; - items?: string[] | LibraryItem[]; + translations?: + | { + language: string | Language; + name: string; + description?: + | { + [k: string]: unknown; + }[] + | null; + id?: string | null; + }[] + | null; + parentFolders?: (string | LibraryFolder)[] | null; + subfolders?: (string | LibraryFolder)[] | null; + items?: (string | LibraryItem)[] | null; } export interface Language { id: string; @@ -72,155 +80,183 @@ export interface Language { } export interface LibraryItem { id: string; - itemType?: "Textual" | "Audio" | "Video" | "Game" | "Other"; + itemType?: ('Textual' | 'Audio' | 'Video' | 'Game' | 'Other') | null; + language: string | Language; slug: string; - thumbnail?: string | LibraryItemThumbnail; - pretitle?: string; + thumbnail?: string | LibraryItemThumbnail | null; + pretitle?: string | null; title: string; - subtitle?: string; + subtitle?: string | null; digital: boolean; - gallery?: { - image?: string | LibraryItemGallery; - id?: string; - }[]; - scansEnabled?: boolean; + gallery?: + | { + image?: string | LibraryItemGallery | null; + id?: string | null; + }[] + | null; + scansEnabled?: boolean | null; scans?: { - coverEnabled?: boolean; + scanners: (string | Recorder)[]; + cleaners: (string | Recorder)[]; + typesetters?: (string | Recorder)[] | null; + coverEnabled?: boolean | null; cover?: { - front?: string | LibraryItemScans; - spine?: string | LibraryItemScans; - back?: string | LibraryItemScans; - insideFront?: string | LibraryItemScans; - flapFront?: string | LibraryItemScans; - flapBack?: string | LibraryItemScans; - insideFlapFront?: string | LibraryItemScans; - insideFlapBack?: string | LibraryItemScans; + front?: string | LibraryItemScans | null; + spine?: string | LibraryItemScans | null; + back?: string | LibraryItemScans | null; + insideFront?: string | LibraryItemScans | null; + flapFront?: string | LibraryItemScans | null; + flapBack?: string | LibraryItemScans | null; + insideFlapFront?: string | LibraryItemScans | null; + insideFlapBack?: string | LibraryItemScans | null; }; - dustjacketEnabled?: boolean; + dustjacketEnabled?: boolean | null; dustjacket?: { - front?: string | LibraryItemScans; - spine?: string | LibraryItemScans; - back?: string | LibraryItemScans; - insideFront?: string | LibraryItemScans; - insideSpine?: string | LibraryItemScans; - insideBack?: string | LibraryItemScans; - flapFront?: string | LibraryItemScans; - flapBack?: string | LibraryItemScans; - insideFlapFront?: string | LibraryItemScans; - insideFlapBack?: string | LibraryItemScans; + front?: string | LibraryItemScans | null; + spine?: string | LibraryItemScans | null; + back?: string | LibraryItemScans | null; + insideFront?: string | LibraryItemScans | null; + insideSpine?: string | LibraryItemScans | null; + insideBack?: string | LibraryItemScans | null; + flapFront?: string | LibraryItemScans | null; + flapBack?: string | LibraryItemScans | null; + insideFlapFront?: string | LibraryItemScans | null; + insideFlapBack?: string | LibraryItemScans | null; }; - obiEnabled?: boolean; + obiEnabled?: boolean | null; obi?: { - front?: string | LibraryItemScans; - spine?: string | LibraryItemScans; - back?: string | LibraryItemScans; - insideFront?: string | LibraryItemScans; - insideSpine?: string | LibraryItemScans; - insideBack?: string | LibraryItemScans; - flapFront?: string | LibraryItemScans; - flapBack?: string | LibraryItemScans; - insideFlapFront?: string | LibraryItemScans; - insideFlapBack?: string | LibraryItemScans; + front?: string | LibraryItemScans | null; + spine?: string | LibraryItemScans | null; + back?: string | LibraryItemScans | null; + insideFront?: string | LibraryItemScans | null; + insideSpine?: string | LibraryItemScans | null; + insideBack?: string | LibraryItemScans | null; + flapFront?: string | LibraryItemScans | null; + flapBack?: string | LibraryItemScans | null; + insideFlapFront?: string | LibraryItemScans | null; + insideFlapBack?: string | LibraryItemScans | null; }; - pages?: { - page: number; - image: string | LibraryItemScans; - id?: string; - }[]; + pages?: + | { + page: number; + image: string | LibraryItemScans; + id?: string | null; + }[] + | null; + archiveFile?: (string | null) | File; }; textual?: { - subtype?: string[] | Key[]; - languages?: string[] | Language[]; - pageCount?: number; - bindingType?: "Paperback" | "Hardcover"; - pageOrder?: "LeftToRight" | "RightToLeft"; + subtype?: (string | null) | Key; + pageCount?: number | null; + bindingType?: ('Paperback' | 'Hardcover') | null; + pageOrder?: ('LeftToRight' | 'RightToLeft') | null; }; audio?: { - audioSubtype?: string[] | Key[]; - tracks?: { - title: string; - file: string | File; - id?: string; - }[]; + audioSubtype?: (string | null) | Key; + tracks?: + | { + title: string; + file: string | File; + id?: string | null; + }[] + | null; }; - releaseDate?: string; - categories?: string[] | Key[]; - sizeEnabled?: boolean; + video?: { + subtype?: (string | null) | Key; + }; + game?: { + demo?: boolean | null; + platform?: (string | null) | Key; + audioLanguages?: (string | Language)[] | null; + subtitleLanguages?: (string | Language)[] | null; + interfacesLanguages?: (string | Language)[] | null; + }; + releaseDate?: string | null; + categories?: (string | Key)[] | null; + sizeEnabled?: boolean | null; size?: { width: number; height: number; - thickness?: number; + thickness?: number | null; }; - priceEnabled?: boolean; + priceEnabled?: boolean | null; price?: { amount: number; currency: string | Currency; }; - translations?: { - language: string | Language; - description: { - [k: string]: unknown; - }[]; - id?: string; - }[]; - urls?: { - url: string; - id?: string; - }[]; - parentFolders?: string[] | LibraryFolder[]; - parentItems?: string[] | LibraryItem[]; - subitems?: string[] | LibraryItem[]; - contents?: { - content: string | Content; - pageStart?: number; - pageEnd?: number; - timeStart?: number; - timeEnd?: number; - note?: { - [k: string]: unknown; - }[]; - id?: string; - }[]; + translations?: + | { + language: string | Language; + description: { + [k: string]: unknown; + }[]; + id?: string | null; + }[] + | null; + urls?: + | { + url: string; + id?: string | null; + }[] + | null; + parentFolders?: (string | LibraryFolder)[] | null; + parentItems?: (string | LibraryItem)[] | null; + subitems?: (string | LibraryItem)[] | null; + contents?: + | { + content: string | Content; + pageStart?: number | null; + pageEnd?: number | null; + timeStart?: number | null; + timeEnd?: number | null; + note?: + | { + [k: string]: unknown; + }[] + | null; + id?: string | null; + }[] + | null; updatedBy: string | Recorder; updatedAt: string; createdAt: string; - _status?: "draft" | "published"; + _status?: ('draft' | 'published') | null; } export interface LibraryItemThumbnail { id: string; - libraryItem?: string[] | LibraryItem[]; + libraryItem?: (string | LibraryItem)[] | null; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; og?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; square?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } @@ -228,28 +264,75 @@ export interface LibraryItemGallery { id: string; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; small?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + }; +} +export interface Recorder { + id: string; + username: string; + avatar?: string | RecordersThumbnail | null; + languages?: (string | Language)[] | null; + biographies?: RecorderBiographies; + role?: ('Admin' | 'Recorder' | 'Api')[] | null; + anonymize: boolean; + email: string; + resetPasswordToken?: string | null; + resetPasswordExpiration?: string | null; + salt?: string | null; + hash?: string | null; + loginAttempts?: number | null; + lockUntil?: string | null; + password?: string | null; +} +export interface RecordersThumbnail { + id: string; + recorder?: (string | null) | Recorder; + updatedAt: string; + createdAt: string; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; + sizes?: { + thumb?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; + }; + square?: { + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } @@ -257,441 +340,403 @@ export interface LibraryItemScans { id: string; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; og?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; medium?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; large?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } +export interface File { + id: string; + filename: string; + type: 'LibraryScans' | 'LibrarySoundtracks' | 'ContentVideo' | 'ContentAudio'; + updatedAt: string; + createdAt: string; +} export interface Key { id: string; name: string; type: - | "Contents" - | "LibraryAudio" - | "LibraryVideo" - | "LibraryTextual" - | "LibraryGroup" - | "Library" - | "Weapons" - | "GamePlatforms" - | "Categories" - | "Wordings"; + | 'Contents' + | 'LibraryAudio' + | 'LibraryVideo' + | 'LibraryTextual' + | 'LibraryGroup' + | 'Library' + | 'Weapons' + | 'GamePlatforms' + | 'Categories' + | 'Wordings'; translations?: CategoryTranslations; } -export interface File { - id: string; - filename: string; - type: "LibraryScans" | "LibrarySoundtracks" | "ContentVideo" | "ContentAudio"; - updatedAt: string; - createdAt: string; -} export interface Currency { id: string; } export interface Content { id: string; slug: string; - thumbnail?: string | ContentsThumbnail; - categories?: string[] | Key[]; - type?: string | Key; - libraryItems?: string[] | LibraryItem[]; + thumbnail?: string | ContentsThumbnail | null; + categories?: (string | Key)[] | null; + type?: (string | null) | Key; + libraryItems?: (string | LibraryItem)[] | null; translations: { language: string | Language; sourceLanguage: string | Language; - pretitle?: string; + pretitle?: string | null; title: string; - subtitle?: string; - summary?: { - [k: string]: unknown; - }[]; - textContent?: { - [k: string]: unknown; - }[]; - textTranscribers?: string[] | Recorder[]; - textTranslators?: string[] | Recorder[]; - textProofreaders?: string[] | Recorder[]; - textNotes?: { - [k: string]: unknown; - }[]; - video?: string | File; - videoNotes?: { - [k: string]: unknown; - }[]; - audio?: string | File; - id?: string; + subtitle?: string | null; + summary?: + | { + [k: string]: unknown; + }[] + | null; + textContent?: + | { + [k: string]: unknown; + }[] + | null; + textTranscribers?: (string | Recorder)[] | null; + textTranslators?: (string | Recorder)[] | null; + textProofreaders?: (string | Recorder)[] | null; + textNotes?: + | { + [k: string]: unknown; + }[] + | null; + video?: (string | null) | File; + videoNotes?: + | { + [k: string]: unknown; + }[] + | null; + audio?: (string | null) | File; + id?: string | null; }[]; - folders?: string[] | ContentsFolder[]; - previousContents?: string[] | Content[]; - nextContents?: string[] | Content[]; + folders?: (string | ContentsFolder)[] | null; + previousContents?: (string | Content)[] | null; + nextContents?: (string | Content)[] | null; updatedBy: string | Recorder; updatedAt: string; createdAt: string; - _status?: "draft" | "published"; + _status?: ('draft' | 'published') | null; } export interface ContentsThumbnail { id: string; - contents?: string[] | Content[]; + contents?: (string | Content)[] | null; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; og?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; medium?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; - }; - }; -} -export interface Recorder { - id: string; - username: string; - avatar?: string | RecordersThumbnail; - languages?: string[] | Language[]; - biographies?: RecorderBiographies; - role?: ("Admin" | "Recorder" | "Api")[]; - anonymize: boolean; - email: string; - resetPasswordToken?: string; - resetPasswordExpiration?: string; - salt?: string; - hash?: string; - loginAttempts?: number; - lockUntil?: string; - password?: string; -} -export interface RecordersThumbnail { - id: string; - recorder?: string | Recorder; - updatedAt: string; - createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; - sizes?: { - thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; - }; - square?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } export interface ContentsFolder { id: string; slug: string; - translations?: { - language: string | Language; - name: string; - id?: string; - }[]; - subfolders?: string[] | ContentsFolder[]; - contents?: string[] | Content[]; + translations?: + | { + language: string | Language; + name: string; + id?: string | null; + }[] + | null; + subfolders?: (string | ContentsFolder)[] | null; + contents?: (string | Content)[] | null; } export interface Post { id: string; slug: string; - thumbnail?: string | PostThumbnail; - authors: - | { - relationTo: "recorders"; - value: string; - }[] - | { - relationTo: "recorders"; - value: Recorder; - }[]; - categories?: - | { - relationTo: "keys"; - value: string; - }[] - | { - relationTo: "keys"; - value: Key; - }[]; + thumbnail?: string | PostThumbnail | null; + authors: (string | Recorder)[]; + categories?: (string | Key)[] | null; translations: { language: string | Language; sourceLanguage: string | Language; title: string; - summary?: { - [k: string]: unknown; - }[]; - content?: { - [k: string]: unknown; - }[]; - translators?: string[] | Recorder[]; - proofreaders?: string[] | Recorder[]; - id?: string; + summary?: + | { + [k: string]: unknown; + }[] + | null; + content?: + | { + [k: string]: unknown; + }[] + | null; + translators?: (string | Recorder)[] | null; + proofreaders?: (string | Recorder)[] | null; + id?: string | null; }[]; publishedDate: string; - hidden?: boolean; + hidden?: boolean | null; updatedBy: string | Recorder; updatedAt: string; createdAt: string; - _status?: "draft" | "published"; + _status?: ('draft' | 'published') | null; } export interface PostThumbnail { id: string; - posts?: string[] | Post[]; + posts?: (string | Post)[] | null; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; og?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; medium?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } export interface ChronologyItem { id: string; - name?: string; + name?: string | null; date: { year: number; - month?: number; - day?: number; + month?: number | null; + day?: number | null; }; events: { - source?: - | { - relationTo: "contents"; - value: string | Content; - } - | { - relationTo: "library-items"; - value: string | LibraryItem; - }; translations: { language: string | Language; sourceLanguage: string | Language; - title?: string; - description?: { - [k: string]: unknown; - }[]; - notes?: { - [k: string]: unknown; - }[]; - transcribers?: string[] | Recorder[]; - translators?: string[] | Recorder[]; - proofreaders?: string[] | Recorder[]; - id?: string; + title?: string | null; + description?: + | { + [k: string]: unknown; + }[] + | null; + notes?: + | { + [k: string]: unknown; + }[] + | null; + transcribers?: (string | Recorder)[] | null; + translators?: (string | Recorder)[] | null; + proofreaders?: (string | Recorder)[] | null; + id?: string | null; }[]; - id?: string; + id?: string | null; }[]; updatedBy: string | Recorder; updatedAt: string; createdAt: string; - _status?: "draft" | "published"; + _status?: ('draft' | 'published') | null; } export interface ChronologyEra { id: string; slug: string; startingYear: number; endingYear: number; - translations?: { - language: string | Language; - title: string; - description?: { - [k: string]: unknown; - }[]; - id?: string; - }[]; - events?: string[] | ChronologyItem[]; + translations?: + | { + language: string | Language; + title: string; + description?: + | { + [k: string]: unknown; + }[] + | null; + id?: string | null; + }[] + | null; + events?: (string | ChronologyItem)[] | null; updatedAt: string; createdAt: string; } export interface Weapon { id: string; slug: string; - thumbnail?: string | WeaponsThumbnail; + thumbnail?: string | WeaponsThumbnail | null; type: string | Key; - group?: string | WeaponsGroup; + group?: (string | null) | WeaponsGroup; appearances: { - categories: string[] | Key[]; + categories: (string | Key)[]; translations: { language: string | Language; sourceLanguage: string | Language; name: string; - description?: { - [k: string]: unknown; - }[]; - level1?: { - [k: string]: unknown; - }[]; - level2?: { - [k: string]: unknown; - }[]; - level3?: { - [k: string]: unknown; - }[]; - level4?: { - [k: string]: unknown; - }[]; - transcribers?: string[] | Recorder[]; - translators?: string[] | Recorder[]; - proofreaders?: string[] | Recorder[]; - id?: string; + description?: + | { + [k: string]: unknown; + }[] + | null; + level1?: + | { + [k: string]: unknown; + }[] + | null; + level2?: + | { + [k: string]: unknown; + }[] + | null; + level3?: + | { + [k: string]: unknown; + }[] + | null; + level4?: + | { + [k: string]: unknown; + }[] + | null; + transcribers?: (string | Recorder)[] | null; + translators?: (string | Recorder)[] | null; + proofreaders?: (string | Recorder)[] | null; + id?: string | null; }[]; - id?: string; + id?: string | null; }[]; updatedBy: string | Recorder; updatedAt: string; createdAt: string; - _status?: "draft" | "published"; + _status?: ('draft' | 'published') | null; } export interface WeaponsThumbnail { id: string; - weapon?: string | Weapon; + weapon?: (string | null) | Weapon; updatedAt: string; createdAt: string; - url?: string; - filename?: string; - mimeType?: string; - filesize?: number; - width?: number; - height?: number; + url?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; sizes?: { thumb?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; og?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; small?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; medium?: { - url?: string; - width?: number; - height?: number; - mimeType?: string; - filesize?: number; - filename?: string; + url?: string | null; + width?: number | null; + height?: number | null; + mimeType?: string | null; + filesize?: number | null; + filename?: string | null; }; }; } export interface WeaponsGroup { id: string; slug: string; - translations?: { - language: string | Language; - name: string; - id?: string; - }[]; - weapons?: string[] | Weapon[]; + translations?: + | { + language: string | Language; + name: string; + id?: string | null; + }[] + | null; + weapons?: (string | Weapon)[] | null; } export interface Note { id: string; @@ -705,27 +750,27 @@ export interface Video { id: string; uid: string; gone: boolean; - source: "YouTube" | "NicoNico" | "Tumblr"; + source: 'YouTube' | 'NicoNico' | 'Tumblr'; title: string; - description?: string; - likes?: number; - views?: number; + description?: string | null; + likes?: number | null; + views?: number | null; publishedDate: string; - channel?: string | VideosChannel; + channel?: (string | null) | VideosChannel; } export interface VideosChannel { id: string; uid: string; title: string; - subscribers?: number; + subscribers?: number | null; } export interface PayloadPreference { id: string; user: { - relationTo: "recorders"; + relationTo: 'recorders'; value: string | Recorder; }; - key?: string; + key?: string | null; value?: | { [k: string]: unknown; @@ -740,12 +785,13 @@ export interface PayloadPreference { } export interface PayloadMigration { id: string; - name?: string; - batch?: number; + name?: string | null; + batch?: number | null; updatedAt: string; createdAt: string; } -declare module "payload" { + +declare module 'payload' { export interface GeneratedTypes extends Config {} -} +} \ No newline at end of file diff --git a/src/utils/versionedCollectionConfig.ts b/src/utils/versionedCollectionConfig.ts index 568e325..407155c 100644 --- a/src/utils/versionedCollectionConfig.ts +++ b/src/utils/versionedCollectionConfig.ts @@ -26,7 +26,7 @@ export const buildVersionedCollectionConfig = ({ }: BuildVersionedCollectionConfig): CollectionConfig => ({ ...otherParams, timestamps: true, - versions: { drafts: { autosave: { interval: 2000 } } }, + versions: { drafts: { autosave: false } }, hooks: { ...otherHooks, beforeChange: [...(beforeChange ?? []), beforeChangeUpdatedBy],