From 76e4dfc93c8266db5b9e900e615d44261a18adf9 Mon Sep 17 00:00:00 2001 From: Md Shayon Date: Sat, 2 Mar 2024 21:26:48 +0600 Subject: [PATCH 1/4] Adding article is not working successfully --- client/components/article/ArticleAdd.vue | 78 ++- client/components/category/CategoryAdd.vue | 35 +- client/components/home/Home.vue | 4 +- client/package-lock.json | 729 ++++++++++++--------- client/package.json | 3 +- client/pages/admin/article.vue | 2 +- client/pages/admin/category.vue | 1 + server/core/settings.py | 33 +- 8 files changed, 533 insertions(+), 352 deletions(-) diff --git a/client/components/article/ArticleAdd.vue b/client/components/article/ArticleAdd.vue index 84f3724..d5efa9b 100644 --- a/client/components/article/ArticleAdd.vue +++ b/client/components/article/ArticleAdd.vue @@ -54,7 +54,7 @@ import { QuillEditor, Delta, Quill } from "@vueup/vue-quill"; import "@vueup/vue-quill/dist/vue-quill.snow.css"; import { ADD_ARTICLE_RAW } from '../../graphql/articles'; -const isReadOnly = true; +const isReadOnly = false; const articleState = reactive({ title: '', @@ -90,45 +90,43 @@ const props = defineProps(["categories", "authors"]); const handleArticleAdd = async (e: Event) => { e.preventDefault(); - // const formData = { - // title: articleState.title, - // content: state.content, - // category: articleState.category, - // author: articleState.author, - // link: articleState.link, - // }; - const formData = new FormData(); - - - const myHeaders = new Headers(); - myHeaders.append("Cookie", "csrftoken=ccS5qh2RZofjzKhe6KeN51RMYOGQAb5t"); - - const newImgFile = uploadedImg.value as File; - - const operations = { - query: ADD_ARTICLE_RAW, - variables: { - title: articleState.title, - content: state.content, - thumbnail: null, // You may need to handle thumbnail separately based on your requirements - authorId: articleState.author, - categoryId: articleState.category, - }, - }; - - formData.set("operations", JSON.stringify(operations)); - formData.set("map", "{\n \"0\": [\"variables.thumbnail\"]\n}"); - formData.set("0", newImgFile); - - const response = await fetch("http://localhost:8000/graphql/", { - method: 'POST', - headers: myHeaders, - body: formData, - redirect: 'follow' - }); - - console.log(response); - + try { + const formData = new FormData(); + + + const myHeaders = new Headers(); + myHeaders.append("Cookie", "csrftoken=ccS5qh2RZofjzKhe6KeN51RMYOGQAb5t"); + + const newImgFile = uploadedImg.value as File; + + const operations = { + query: ADD_ARTICLE_RAW, + variables: { + title: articleState.title, + content: state.content, + thumbnail: null, // You may need to handle thumbnail separately based on your requirements + authorId: articleState.author, + categoryId: articleState.category, + }, + }; + + formData.set("operations", JSON.stringify(operations)); + formData.set("map", "{\n \"0\": [\"variables.thumbnail\"]\n}"); + formData.set("0", newImgFile); + + const response = await fetch("http://localhost:8000/graphql/", { + method: 'POST', + headers: myHeaders, + body: formData, + redirect: 'follow' + }); + + console.log(response); + } catch (error) { + console.log("Error adding article", error); + + } + }; const handleFileChange = (e: Event) => { diff --git a/client/components/category/CategoryAdd.vue b/client/components/category/CategoryAdd.vue index 5d02856..a6805d0 100644 --- a/client/components/category/CategoryAdd.vue +++ b/client/components/category/CategoryAdd.vue @@ -1,3 +1,36 @@ \ No newline at end of file +
+ + +
+ + + \ No newline at end of file diff --git a/client/components/home/Home.vue b/client/components/home/Home.vue index 95550b6..0a2d6bf 100644 --- a/client/components/home/Home.vue +++ b/client/components/home/Home.vue @@ -9,7 +9,7 @@ - + @@ -48,6 +48,6 @@ const variables = { limit: 20 }; const { data } = await useAsyncQuery(query, variables); - // console.log({ allArticles: data.value.allArticles }); + console.log({ allArticles: data.value.allArticles }); \ No newline at end of file diff --git a/client/package-lock.json b/client/package-lock.json index 9c1c0ce..fa48808 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8,12 +8,13 @@ "hasInstallScript": true, "dependencies": { "@nuxtjs/cloudinary": "^2.5.1", + "@vue/apollo-composable": "^4.0.1", "@vueup/vue-quill": "^1.2.0", "dompurify": "^3.0.6" }, "devDependencies": { "@nuxt/devtools": "latest", - "@nuxtjs/apollo": "^5.0.0-alpha.8", + "@nuxtjs/apollo": "^5.0.0-alpha.13", "@nuxtjs/tailwindcss": "^6.9.4", "@types/dompurify": "^3.0.5", "autoprefixer": "^10.4.16", @@ -61,19 +62,19 @@ } }, "node_modules/@apollo/client": { - "version": "3.8.7", - "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.8.7.tgz", - "integrity": "sha512-DnQtFkQrCyxHTSa9gR84YRLmU/al6HeXcLZazVe+VxKBmx/Hj4rV8xWtzfWYX5ijartsqDR7SJgV037MATEecA==", - "dev": true, + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.9.5.tgz", + "integrity": "sha512-7y+c8MTPU+hhTwvcGVtMMGIgWduzrvG1mz5yJMRyqYbheBkkky3Lki6ADWVSBXG1lZoOtPYvB2zDgVfKb2HSsw==", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", - "@wry/context": "^0.7.3", + "@wry/caches": "^1.0.0", "@wry/equality": "^0.5.6", - "@wry/trie": "^0.4.3", + "@wry/trie": "^0.5.0", "graphql-tag": "^2.12.6", "hoist-non-react-statics": "^3.3.2", - "optimism": "^0.17.5", + "optimism": "^0.18.0", "prop-types": "^15.7.2", + "rehackt": "0.0.5", "response-iterator": "^0.2.6", "symbol-observable": "^4.0.0", "ts-invariant": "^0.10.3", @@ -81,7 +82,7 @@ "zen-observable-ts": "^1.2.5" }, "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0", + "graphql": "^15.0.0 || ^16.0.0", "graphql-ws": "^5.5.5", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -103,11 +104,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -171,28 +172,28 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", - "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", - "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.0.tgz", + "integrity": "sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==", "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.23.0", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.0", - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.24.0", + "@babel/parser": "^7.24.0", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -216,11 +217,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dependencies": { - "@babel/types": "^7.23.0", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -242,13 +243,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", - "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dependencies": { - "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.15", - "browserslist": "^4.21.9", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -351,9 +352,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", - "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -441,9 +442,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } @@ -457,30 +458,30 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", - "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", - "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.0.tgz", + "integrity": "sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==", "dependencies": { - "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -547,9 +548,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.0.tgz", + "integrity": "sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==", "bin": { "parser": "bin/babel-parser.js" }, @@ -667,40 +668,40 @@ } }, "node_modules/@babel/standalone": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.23.2.tgz", - "integrity": "sha512-VJNw7OS26JvB6rE9XpbT6uQeQIEBWU5eeHGS4VR/+/4ZoKdLBXLcy66ZVJ/9IBkK1RMp8B0cohvhzdKWtJAGmg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/standalone/-/standalone-7.24.0.tgz", + "integrity": "sha512-yIZ/X3EAASgX/MW1Bn8iZKxCwixgYJAUaIScoZ9C6Gapw5l3eKIbtVSgO/IGldQed9QXm22yurKVWyWj5/j+SQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.0.tgz", + "integrity": "sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -708,11 +709,11 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -1210,7 +1211,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } @@ -1993,70 +1993,118 @@ } }, "node_modules/@nuxtjs/apollo": { - "version": "5.0.0-alpha.8", - "resolved": "https://registry.npmjs.org/@nuxtjs/apollo/-/apollo-5.0.0-alpha.8.tgz", - "integrity": "sha512-EtiPqKuwJoM/gA/N9cEQYlJQgHQiYwUQppF4nUa+tFv9pY1DyG+HLV4IAm8frqeu/8NEFfbaPraEbAuJDCewlQ==", + "version": "5.0.0-alpha.13", + "resolved": "https://registry.npmjs.org/@nuxtjs/apollo/-/apollo-5.0.0-alpha.13.tgz", + "integrity": "sha512-QoEzzR7uK2Kh6hEB0ynnA1kkOvM7CHiost06gjJT+3IAs88zhEElDc0RGm79dwjRlBdGSnjuiYw7dKhdb/xP3g==", "dev": true, "dependencies": { - "@apollo/client": "^3.8.6", - "@nuxt/kit": "^3.8.0", + "@apollo/client": "^3.9.5", + "@nuxt/kit": "^3.10.3", "@rollup/plugin-graphql": "^2.0.4", - "@vue/apollo-composable": "4.0.0-beta.11", - "defu": "^6.1.3", - "destr": "^2.0.2", + "@vue/apollo-composable": "^4.0.1", + "@vue/apollo-option": "^4.0.0", + "defu": "^6.1.4", + "destr": "^2.0.3", "graphql": "^16.8.1", "graphql-tag": "^2.12.6", - "graphql-ws": "^5.14.2", + "graphql-ws": "^5.15.0", "jiti": "^1.21.0", "ohash": "^1.1.3" } }, - "node_modules/@nuxtjs/apollo/node_modules/@vue/apollo-composable": { - "version": "4.0.0-beta.11", - "resolved": "https://registry.npmjs.org/@vue/apollo-composable/-/apollo-composable-4.0.0-beta.11.tgz", - "integrity": "sha512-ZtztRDrQe2sTn31h+teBfYw81AePfxlBssTaZVk2jOagdZgTfZigR7aJjO98FxwvGnB80ElWHKubvqYwNf8heg==", + "node_modules/@nuxtjs/apollo/node_modules/@nuxt/kit": { + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/@nuxt/kit/-/kit-3.10.3.tgz", + "integrity": "sha512-PUjYB9Mvx0qD9H1QZBwwtY4fLlCLET+Mm9BVqUOtXCaGoXd6u6BE4e/dGFPk2UEKkIcDGrUMSbqkHYvsEuK9NQ==", "dev": true, "dependencies": { - "throttle-debounce": "^5.0.0", - "ts-essentials": "^9.4.0", - "vue-demi": "^0.14.6" + "@nuxt/schema": "3.10.3", + "c12": "^1.9.0", + "consola": "^3.2.3", + "defu": "^6.1.4", + "globby": "^14.0.1", + "hash-sum": "^2.0.0", + "ignore": "^5.3.1", + "jiti": "^1.21.0", + "knitwork": "^1.0.0", + "mlly": "^1.6.0", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "scule": "^1.3.0", + "semver": "^7.6.0", + "ufo": "^1.4.0", + "unctx": "^2.3.1", + "unimport": "^3.7.1", + "untyped": "^1.4.2" }, - "peerDependencies": { - "@apollo/client": "^3.4.13", - "@vue/composition-api": "^1.0.0", - "graphql": ">=15", - "vue": "^2.6.0 || ^3.1.0" + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/@nuxtjs/apollo/node_modules/@nuxt/schema": { + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/@nuxt/schema/-/schema-3.10.3.tgz", + "integrity": "sha512-a4cYbeskEVBPazgAhvUGkL/j7ho/iPWMK3vCEm6dRMjSqHVEITRosrj0aMfLbRrDpTrMjlRs0ZitxiaUfE/p5Q==", + "dev": true, + "dependencies": { + "@nuxt/ui-templates": "^1.3.1", + "consola": "^3.2.3", + "defu": "^6.1.4", + "hookable": "^5.5.3", + "pathe": "^1.1.2", + "pkg-types": "^1.0.3", + "scule": "^1.3.0", + "std-env": "^3.7.0", + "ufo": "^1.4.0", + "unimport": "^3.7.1", + "untyped": "^1.4.2" }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } + "engines": { + "node": "^14.18.0 || >=16.10.0" } }, - "node_modules/@nuxtjs/apollo/node_modules/vue-demi": { - "version": "0.14.6", - "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.6.tgz", - "integrity": "sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==", + "node_modules/@nuxtjs/apollo/node_modules/globby": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", + "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", "dev": true, - "hasInstallScript": true, - "bin": { - "vue-demi-fix": "bin/vue-demi-fix.js", - "vue-demi-switch": "bin/vue-demi-switch.js" + "dependencies": { + "@sindresorhus/merge-streams": "^2.1.0", + "fast-glob": "^3.3.2", + "ignore": "^5.2.4", + "path-type": "^5.0.0", + "slash": "^5.1.0", + "unicorn-magic": "^0.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/antfu" + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nuxtjs/apollo/node_modules/path-type": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", + "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "dev": true, + "engines": { + "node": ">=12" }, - "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", - "vue": "^3.0.0-0 || ^2.6.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nuxtjs/apollo/node_modules/slash": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", + "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, + "engines": { + "node": ">=14.16" }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@nuxtjs/cloudinary": { @@ -2635,9 +2683,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.5.tgz", - "integrity": "sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -2703,6 +2751,18 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@sindresorhus/merge-streams": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", + "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -3089,6 +3149,65 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/@vue/apollo-composable": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@vue/apollo-composable/-/apollo-composable-4.0.1.tgz", + "integrity": "sha512-mUiC2ucO4CeRhedC5wcEzzoweuDLB/rgKPAcZEtDYBpErRTeK3CQ1ffygp1E9GbibuTfKms11k5P/DgDYdzhZA==", + "dependencies": { + "throttle-debounce": "^5.0.0", + "ts-essentials": "^9.4.0", + "vue-demi": "^0.14.6" + }, + "peerDependencies": { + "@apollo/client": "^3.4.13", + "@vue/composition-api": "^1.0.0", + "graphql": ">=15", + "vue": "^2.6.0 || ^3.1.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vue/apollo-composable/node_modules/vue-demi": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/vue-demi/-/vue-demi-0.14.7.tgz", + "integrity": "sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==", + "hasInstallScript": true, + "bin": { + "vue-demi-fix": "bin/vue-demi-fix.js", + "vue-demi-switch": "bin/vue-demi-switch.js" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^3.0.0-0 || ^2.6.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } + } + }, + "node_modules/@vue/apollo-option": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@vue/apollo-option/-/apollo-option-4.0.0.tgz", + "integrity": "sha512-rZf4bLNldV9egADp3UhC2O4qmmn6L3vF/RwRJse8lgtpGFrov9qtZxl/rRg0+9UtZeOTFwTovnQo7J7C7FP3Ow==", + "dev": true, + "dependencies": { + "throttle-debounce": "^5.0.0" + }, + "peerDependencies": { + "@apollo/client": "^3.2.1", + "vue": "^3.1.0" + } + }, "node_modules/@vue/babel-helper-vue-transform-on": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-transform-on/-/babel-helper-vue-transform-on-1.1.5.tgz", @@ -3450,11 +3569,21 @@ "@xtuc/long": "4.2.2" } }, + "node_modules/@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/@wry/context": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", - "dev": true, "dependencies": { "tslib": "^2.3.0" }, @@ -3466,7 +3595,6 @@ "version": "0.5.7", "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", - "dev": true, "dependencies": { "tslib": "^2.3.0" }, @@ -3475,10 +3603,9 @@ } }, "node_modules/@wry/trie": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", - "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", - "dev": true, + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", "dependencies": { "tslib": "^2.3.0" }, @@ -3520,9 +3647,9 @@ } }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "bin": { "acorn": "bin/acorn" }, @@ -3544,6 +3671,7 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dev": true, "dependencies": { "debug": "^4.3.4" }, @@ -3947,9 +4075,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "funding": [ { "type": "opencollective", @@ -3965,9 +4093,9 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, "bin": { @@ -4029,18 +4157,19 @@ } }, "node_modules/c12": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/c12/-/c12-1.5.1.tgz", - "integrity": "sha512-BWZRJgDEveT8uI+cliCwvYSSSSvb4xKoiiu5S0jaDbKBopQLQF7E+bq9xKk1pTcG+mUa3yXuFO7bD9d8Lr9Xxg==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/c12/-/c12-1.9.0.tgz", + "integrity": "sha512-7KTCZXdIbOA2hLRQ+1KzJ15Qp9Wn58one74dkihMVp2H6EzKTa3OYBy0BSfS1CCcmxYyqeX8L02m40zjQ+dstg==", "dependencies": { "chokidar": "^3.5.3", - "defu": "^6.1.2", - "dotenv": "^16.3.1", - "giget": "^1.1.3", - "jiti": "^1.20.0", - "mlly": "^1.4.2", + "confbox": "^0.1.3", + "defu": "^6.1.4", + "dotenv": "^16.3.2", + "giget": "^1.2.1", + "jiti": "^1.21.0", + "mlly": "^1.5.0", "ohash": "^1.1.3", - "pathe": "^1.1.1", + "pathe": "^1.1.2", "perfect-debounce": "^1.0.0", "pkg-types": "^1.0.3", "rc9": "^2.1.1" @@ -4180,9 +4309,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001559", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001559.tgz", - "integrity": "sha512-cPiMKZgqgkg5LY3/ntGeLFUpi6tzddBNS58A4tnTgQw1zON7u2sZMU7SzOeVH4tj20++9ggL+V6FDOFMTaFFYA==", + "version": "1.0.30001591", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", + "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", "funding": [ { "type": "opencollective", @@ -4270,10 +4399,9 @@ } }, "node_modules/citty": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.4.tgz", - "integrity": "sha512-Q3bK1huLxzQrvj7hImJ7Z1vKYJRPQCDnd0EjXfHMidcjecGOMuLrmuQmtWmFkuKLcMThlGh1yCKG8IEc6VeNXQ==", - "dev": true, + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", "dependencies": { "consola": "^3.2.3" } @@ -4495,7 +4623,8 @@ "node_modules/colorette": { "version": "2.0.20", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", - "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==" + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true }, "node_modules/commander": { "version": "7.2.0", @@ -4539,6 +4668,11 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/confbox": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.3.tgz", + "integrity": "sha512-eH3ZxAihl1PhKfpr4VfEN6/vUd87fmgb6JkldHgg/YR6aEBhW63qUDgzP2Y6WM0UumdsYp5H3kibalXAdHfbgg==" + }, "node_modules/consola": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/consola/-/consola-3.2.3.tgz", @@ -4663,7 +4797,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -4677,7 +4810,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -4980,9 +5112,9 @@ } }, "node_modules/defu": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.3.tgz", - "integrity": "sha512-Vy2wmG3NTkmHNg/kzpuvHhkqeIx3ODWqasgCRbKtbXEN0G+HpEEv9BtJLp7ZG1CZloFaC41Ah3ZFbq7aqCqMeQ==" + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==" }, "node_modules/delegates": { "version": "1.0.0", @@ -5009,9 +5141,9 @@ } }, "node_modules/destr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.2.tgz", - "integrity": "sha512-65AlobnZMiCET00KaFFjUefxDX0khFA/E4myqZ7a6Sq1yZtR8+FVIvilVX66vF2uobSumxooYZChiRPCKNqhmg==" + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz", + "integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==" }, "node_modules/destroy": { "version": "1.2.0", @@ -5146,14 +5278,14 @@ } }, "node_modules/dotenv": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/duplexer": { @@ -5175,9 +5307,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.575", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.575.tgz", - "integrity": "sha512-kY2BGyvgAHiX899oF6xLXSIf99bAvvdPhDoJwG77nxCSyWYuRH6e9a9a3gpXBvCs6lj4dQZJkfnW2hdKWHEISg==" + "version": "1.4.690", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.690.tgz", + "integrity": "sha512-+2OAGjUx68xElQhydpcbqH50hE8Vs2K6TkAeLhICYfndb67CVH0UsZaijmRUE3rHlIxU1u0jxwhgVe6fK3YANA==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -5491,9 +5623,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -5710,15 +5842,16 @@ } }, "node_modules/giget": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/giget/-/giget-1.1.3.tgz", - "integrity": "sha512-zHuCeqtfgqgDwvXlR84UNgnJDuUHQcNI5OqWqFxxuk2BshuKbYhJWdxBsEo4PvKqoGh23lUAIvBNpChMLv7/9Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/giget/-/giget-1.2.1.tgz", + "integrity": "sha512-4VG22mopWtIeHwogGSy1FViXVo0YT+m6BrqZfz0JJFwbSsePsCdOzdLIIli5BtMp7Xe8f/o2OmBpQX2NBOC24g==", "dependencies": { - "colorette": "^2.0.20", - "defu": "^6.1.2", - "https-proxy-agent": "^7.0.2", - "mri": "^1.2.0", - "node-fetch-native": "^1.4.0", + "citty": "^0.1.5", + "consola": "^3.2.3", + "defu": "^6.1.3", + "node-fetch-native": "^1.6.1", + "nypm": "^0.3.3", + "ohash": "^1.1.3", "pathe": "^1.1.1", "tar": "^6.2.0" }, @@ -5841,7 +5974,6 @@ "version": "16.8.1", "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -5850,7 +5982,6 @@ "version": "2.12.6", "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", - "dev": true, "dependencies": { "tslib": "^2.1.0" }, @@ -5862,10 +5993,10 @@ } }, "node_modules/graphql-ws": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.2.tgz", - "integrity": "sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==", - "dev": true, + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.15.0.tgz", + "integrity": "sha512-xWGAtm3fig9TIhSaNsg0FaDZ8Pyn/3re3RFlP4rhQcmjRDIPpk1EhRuNB+YSJtLzttyuToaDiNhwT1OMoGnJnw==", + "devOptional": true, "engines": { "node": ">=10" }, @@ -5975,7 +6106,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, "dependencies": { "react-is": "^16.7.0" } @@ -6114,6 +6244,7 @@ "version": "7.0.2", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dev": true, "dependencies": { "agent-base": "^7.0.2", "debug": "4" @@ -6163,9 +6294,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } @@ -6547,7 +6678,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -6575,8 +6705,7 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" }, "node_modules/jackspeak": { "version": "2.3.6", @@ -7047,7 +7176,6 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", - "dev": true, "dependencies": { "mlly": "^1.4.2", "pkg-types": "^1.0.3" @@ -7115,7 +7243,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "dev": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -7268,8 +7395,7 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" }, "node_modules/merge2": { "version": "1.4.1", @@ -7337,7 +7463,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", - "dev": true, "engines": { "node": ">=12" }, @@ -7580,14 +7705,14 @@ } }, "node_modules/mlly": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", - "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.6.1.tgz", + "integrity": "sha512-vLgaHvaeunuOXHSmEbZ9izxPx3USsk8KCQ8iC+aTlp5sKRSoZvwhHh5L9VbKSaVC6sJDqbyohIS76E2VmHIPAA==", "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", + "acorn": "^8.11.3", + "pathe": "^1.1.2", "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "ufo": "^1.3.2" } }, "node_modules/mri": { @@ -7776,9 +7901,9 @@ } }, "node_modules/node-fetch-native": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.4.1.tgz", - "integrity": "sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w==" + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.2.tgz", + "integrity": "sha512-69mtXOFZ6hSkYiXAVB5SqaRvrbITC/NPyqv7yuu/qw0nmgPyYbIMYYNIDhNtwPrzk0ptrimrLz/hhjvm4w5Z+w==" }, "node_modules/node-forge": { "version": "1.3.1", @@ -7910,9 +8035,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/nopt": { "version": "5.0.0", @@ -8058,7 +8183,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", - "dev": true, "dependencies": { "path-key": "^4.0.0" }, @@ -8073,7 +8197,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", - "dev": true, "engines": { "node": ">=12" }, @@ -8230,7 +8353,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/nypm/-/nypm-0.3.3.tgz", "integrity": "sha512-FHoxtTscAE723e80d2M9cJRb4YVjL82Ra+ZV+YqC6rfNZUWahi+ZhPF+krnR+bdMvibsfHCtgKXnZf5R6kmEPA==", - "dev": true, "dependencies": { "citty": "^0.1.4", "execa": "^8.0.1", @@ -8248,7 +8370,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -8271,7 +8392,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, "engines": { "node": ">=16" }, @@ -8283,7 +8403,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, "engines": { "node": ">=16.17.0" } @@ -8292,7 +8411,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "dev": true, "engines": { "node": ">=14" }, @@ -8304,7 +8422,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8359,7 +8476,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", - "dev": true, "dependencies": { "mimic-fn": "^4.0.0" }, @@ -8411,16 +8527,27 @@ } }, "node_modules/optimism": { - "version": "0.17.5", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.17.5.tgz", - "integrity": "sha512-TEcp8ZwK1RczmvMnvktxHSF2tKgMWjJ71xEFGX5ApLh67VsMSTy1ZUlipJw8W+KaqgOmQ+4pqwkeivY89j+4Vw==", - "dev": true, + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", "dependencies": { + "@wry/caches": "^1.0.0", "@wry/context": "^0.7.0", "@wry/trie": "^0.4.3", "tslib": "^2.3.0" } }, + "node_modules/optimism/node_modules/@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/p-map": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", @@ -8574,7 +8701,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -8625,9 +8751,9 @@ } }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" }, "node_modules/perfect-debounce": { "version": "1.0.0", @@ -9556,7 +9682,6 @@ "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dev": true, "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", @@ -9671,8 +9796,7 @@ "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/read-cache": { "version": "1.0.0", @@ -9803,6 +9927,23 @@ "node": ">=4" } }, + "node_modules/rehackt": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.0.5.tgz", + "integrity": "sha512-BI1rV+miEkaHj8zd2n+gaMgzu/fKz7BGlb4zZ6HAiY9adDmJMkaDcmuXlJFv0eyKUob+oszs3/2gdnXUrzx2Tg==", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/replace-in-file": { "version": "6.3.5", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-6.3.5.tgz", @@ -9996,7 +10137,6 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", - "dev": true, "engines": { "node": ">=0.8" } @@ -10307,14 +10447,14 @@ } }, "node_modules/scule": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/scule/-/scule-1.0.0.tgz", - "integrity": "sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz", + "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==" }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -10447,7 +10587,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -10459,7 +10598,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -10680,9 +10818,9 @@ } }, "node_modules/std-env": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", - "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==" + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==" }, "node_modules/streamx": { "version": "2.15.2", @@ -10761,7 +10899,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", - "dev": true, "engines": { "node": ">=12" }, @@ -10927,7 +11064,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", - "dev": true, "engines": { "node": ">=0.10" } @@ -11202,7 +11338,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.0.tgz", "integrity": "sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==", - "dev": true, "engines": { "node": ">=12.22" } @@ -11272,7 +11407,6 @@ "version": "9.4.1", "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-9.4.1.tgz", "integrity": "sha512-oke0rI2EN9pzHsesdmrOrnqv1eQODmJpd/noJjwj2ZPC3Z4N2wbjrOEqnsEgmvlO2+4fBb0a794DCna2elEVIQ==", - "dev": true, "peerDependencies": { "typescript": ">=4.1.0" }, @@ -11292,7 +11426,6 @@ "version": "0.10.3", "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", - "dev": true, "dependencies": { "tslib": "^2.1.0" }, @@ -11303,8 +11436,7 @@ "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsscmp": { "version": "1.0.6", @@ -11368,9 +11500,9 @@ } }, "node_modules/ufo": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.1.tgz", - "integrity": "sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.4.0.tgz", + "integrity": "sha512-Hhy+BhRBleFjpJ2vchUNN40qgkh0366FWJGqVLYBHev0vpHTrXSA0ryT+74UiW6KWsldNurQMKGqCm1M2zBciQ==" }, "node_modules/ultrahtml": { "version": "1.5.2", @@ -11449,33 +11581,44 @@ "url": "https://github.com/sponsors/harlan-zw" } }, + "node_modules/unicorn-magic": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", + "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/unimport": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.4.0.tgz", - "integrity": "sha512-M/lfFEgufIT156QAr/jWHLUn55kEmxBBiQsMxvRSIbquwmeJEyQYgshHDEvQDWlSJrVOOTAgnJ3FvlsrpGkanA==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.7.1.tgz", + "integrity": "sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==", "dependencies": { - "@rollup/pluginutils": "^5.0.4", + "@rollup/pluginutils": "^5.1.0", + "acorn": "^8.11.2", "escape-string-regexp": "^5.0.0", - "fast-glob": "^3.3.1", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.3", + "estree-walker": "^3.0.3", + "fast-glob": "^3.3.2", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", "mlly": "^1.4.2", "pathe": "^1.1.1", "pkg-types": "^1.0.3", - "scule": "^1.0.0", + "scule": "^1.1.1", "strip-literal": "^1.3.0", - "unplugin": "^1.5.0" + "unplugin": "^1.5.1" } }, - "node_modules/unimport/node_modules/local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antfu" + "node_modules/unimport/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dependencies": { + "@types/estree": "^1.0.0" } }, "node_modules/unique-filename": { @@ -11517,14 +11660,14 @@ "integrity": "sha512-XXvQGL+fvzwEX3aPXggTCrzySFPqvpC8r1LKy5ft9573AoX8CrszmA0uOzi6xgylCvvqFg46IDOudJKzM2lQ5A==" }, "node_modules/unplugin": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.5.0.tgz", - "integrity": "sha512-9ZdRwbh/4gcm1JTOkp9lAkIDrtOyOxgHmY7cjuwI8L/2RTikMcVG25GsZwNAgRuap3iDw2jeq7eoqtAsz5rW3A==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.7.1.tgz", + "integrity": "sha512-JqzORDAPxxs8ErLV4x+LL7bk5pk3YlcWqpSNsIkAZj972KzFZLClc/ekppahKkOczGkwIG6ElFgdOgOlK4tXZw==", "dependencies": { - "acorn": "^8.10.0", + "acorn": "^8.11.3", "chokidar": "^3.5.3", "webpack-sources": "^3.2.3", - "webpack-virtual-modules": "^0.5.0" + "webpack-virtual-modules": "^0.6.1" } }, "node_modules/unplugin-vue-router": { @@ -11668,17 +11811,17 @@ } }, "node_modules/untyped": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/untyped/-/untyped-1.4.0.tgz", - "integrity": "sha512-Egkr/s4zcMTEuulcIb7dgURS6QpN7DyqQYdf+jBtiaJvQ+eRsrtWUoX84SbvQWuLkXsOjM+8sJC9u6KoMK/U7Q==", + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/untyped/-/untyped-1.4.2.tgz", + "integrity": "sha512-nC5q0DnPEPVURPhfPQLahhSTnemVtPzdx7ofiRxXpOB2SYnb3MfdU3DVGyJdS8Lx+tBWeAePO8BfU/3EgksM7Q==", "dependencies": { - "@babel/core": "^7.22.9", - "@babel/standalone": "^7.22.9", - "@babel/types": "^7.22.5", - "defu": "^6.1.2", - "jiti": "^1.19.1", + "@babel/core": "^7.23.7", + "@babel/standalone": "^7.23.8", + "@babel/types": "^7.23.6", + "defu": "^6.1.4", + "jiti": "^1.21.0", "mri": "^1.2.0", - "scule": "^1.0.0" + "scule": "^1.2.0" }, "bin": { "untyped": "dist/cli.mjs" @@ -12679,9 +12822,9 @@ } }, "node_modules/webpack-virtual-modules": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.5.0.tgz", - "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==" + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.1.tgz", + "integrity": "sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg==" }, "node_modules/webpack/node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -12857,14 +13000,12 @@ "node_modules/zen-observable": { "version": "0.8.15", "resolved": "https://registry.npmjs.org/zen-observable/-/zen-observable-0.8.15.tgz", - "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==", - "dev": true + "integrity": "sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==" }, "node_modules/zen-observable-ts": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", - "dev": true, "dependencies": { "zen-observable": "0.8.15" } diff --git a/client/package.json b/client/package.json index 2edefe9..4c9aa14 100644 --- a/client/package.json +++ b/client/package.json @@ -11,7 +11,7 @@ }, "devDependencies": { "@nuxt/devtools": "latest", - "@nuxtjs/apollo": "^5.0.0-alpha.8", + "@nuxtjs/apollo": "^5.0.0-alpha.13", "@nuxtjs/tailwindcss": "^6.9.4", "@types/dompurify": "^3.0.5", "autoprefixer": "^10.4.16", @@ -26,6 +26,7 @@ }, "dependencies": { "@nuxtjs/cloudinary": "^2.5.1", + "@vue/apollo-composable": "^4.0.1", "@vueup/vue-quill": "^1.2.0", "dompurify": "^3.0.6" } diff --git a/client/pages/admin/article.vue b/client/pages/admin/article.vue index 5bb09a5..65f22cf 100644 --- a/client/pages/admin/article.vue +++ b/client/pages/admin/article.vue @@ -22,5 +22,5 @@ type Article = { const variables = { start: 0, limit: 20 }; const { data } = await useAsyncQuery
(GET_ARTICLES, variables); -console.log(data.value); +console.log({data:data.value}); diff --git a/client/pages/admin/category.vue b/client/pages/admin/category.vue index e73cd59..129e79f 100644 --- a/client/pages/admin/category.vue +++ b/client/pages/admin/category.vue @@ -1,5 +1,6 @@ diff --git a/server/core/settings.py b/server/core/settings.py index b21b811..24fbe5c 100644 --- a/server/core/settings.py +++ b/server/core/settings.py @@ -108,24 +108,31 @@ # Database # https://docs.djangoproject.com/en/4.2/ref/settings/#databases -if DEBUG: - DATABASES = { +# if DEBUG: +# DATABASES = { +# 'default': { +# 'ENGINE': 'django.db.backends.sqlite3', +# 'NAME': BASE_DIR / 'db.sqlite3', +# } +# } +# else: +# DATABASES = { +# 'default': { +# 'ENGINE': os.environ["POSTGRES_ENGINE"], +# 'NAME': os.environ["SUPABASE_DB"], +# 'USER': os.environ["SUPABASE_DB_USER"], +# 'PASSWORD': os.environ["SUPABASE_DB_PASSWORD"], +# 'HOST': os.environ["SUPABASE_DB_HOST"], # Set to the appropriate host +# 'PORT': os.environ["SUPABASE_DB_PORT"], # Set to the appropriate port +# } +# } + +DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } } -else: - DATABASES = { - 'default': { - 'ENGINE': os.environ["POSTGRES_ENGINE"], - 'NAME': os.environ["SUPABASE_DB"], - 'USER': os.environ["SUPABASE_DB_USER"], - 'PASSWORD': os.environ["SUPABASE_DB_PASSWORD"], - 'HOST': os.environ["SUPABASE_DB_HOST"], # Set to the appropriate host - 'PORT': os.environ["SUPABASE_DB_PORT"], # Set to the appropriate port - } - } # Password validation From 79411f086aefc684cf47e19665fb40987f49fb5c Mon Sep 17 00:00:00 2001 From: Md Shayon Date: Tue, 5 Mar 2024 05:18:06 +0600 Subject: [PATCH 2/4] Need to add author in order to add a new article. Nevertheless, made structure for the whole project with GraphQL --- server/account/resolvers/mutations.py | 0 server/account/resolvers/queries.py | 0 server/account/resolvers/queryTypes.py | 0 server/{blog => core}/schema.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 server/account/resolvers/mutations.py create mode 100644 server/account/resolvers/queries.py create mode 100644 server/account/resolvers/queryTypes.py rename server/{blog => core}/schema.py (100%) diff --git a/server/account/resolvers/mutations.py b/server/account/resolvers/mutations.py new file mode 100644 index 0000000..e69de29 diff --git a/server/account/resolvers/queries.py b/server/account/resolvers/queries.py new file mode 100644 index 0000000..e69de29 diff --git a/server/account/resolvers/queryTypes.py b/server/account/resolvers/queryTypes.py new file mode 100644 index 0000000..e69de29 diff --git a/server/blog/schema.py b/server/core/schema.py similarity index 100% rename from server/blog/schema.py rename to server/core/schema.py From d9d8c2b988ee315f2f1eb0f170e8cfa8448d1d39 Mon Sep 17 00:00:00 2001 From: Md Shayon Date: Wed, 6 Mar 2024 17:57:26 +0600 Subject: [PATCH 3/4] Getting error creating user --- client/components/article/ArticleAdd.vue | 3 +- server/READNE.md | 26 ++++ .../{blog/migrations => account}/__init__.py | 0 server/account/admin.py | 5 + server/account/apps.py | 6 + server/account/models.py | 73 ++++++++++ server/account/resolvers/mutations.py | 43 ++++++ server/account/resolvers/queryTypes.py | 7 + server/account/tests.py | 3 + server/account/views.py | 3 + server/blog/migrations/0001_initial.py | 76 ---------- ...ename_author_id_article_author_and_more.py | 58 -------- server/blog/migrations/0003_article_link.py | 19 --- ..._alter_article_link_alter_article_title.py | 23 --- .../blog/migrations/0005_article_thumbnail.py | 19 --- ...cle_created_at_alter_comment_created_at.py | 23 --- server/blog/resolvers/mutations.py | 135 +++++++++++++----- server/career/__init__.py | 0 server/career/admin.py | 3 + server/career/apps.py | 6 + server/career/models.py | 3 + server/career/tests.py | 3 + server/career/views.py | 3 + server/core/schema.py | 11 +- server/core/settings.py | 18 ++- server/core/urls.py | 5 +- server/course/__init__.py | 0 server/course/admin.py | 3 + server/course/apps.py | 6 + server/course/models.py | 3 + server/course/tests.py | 3 + server/course/views.py | 3 + server/forum/__init__.py | 0 server/forum/admin.py | 3 + server/forum/apps.py | 6 + server/forum/models.py | 3 + server/forum/tests.py | 3 + server/forum/views.py | 3 + server/requirements.txt | 5 +- server/service/__init__.py | 0 server/service/admin.py | 3 + server/service/apps.py | 6 + server/service/models.py | 3 + server/service/tests.py | 3 + server/service/views.py | 3 + 45 files changed, 376 insertions(+), 257 deletions(-) create mode 100644 server/READNE.md rename server/{blog/migrations => account}/__init__.py (100%) create mode 100644 server/account/admin.py create mode 100644 server/account/apps.py create mode 100644 server/account/models.py create mode 100644 server/account/tests.py create mode 100644 server/account/views.py delete mode 100644 server/blog/migrations/0001_initial.py delete mode 100644 server/blog/migrations/0002_rename_author_id_article_author_and_more.py delete mode 100644 server/blog/migrations/0003_article_link.py delete mode 100644 server/blog/migrations/0004_alter_article_link_alter_article_title.py delete mode 100644 server/blog/migrations/0005_article_thumbnail.py delete mode 100644 server/blog/migrations/0006_alter_article_created_at_alter_comment_created_at.py create mode 100644 server/career/__init__.py create mode 100644 server/career/admin.py create mode 100644 server/career/apps.py create mode 100644 server/career/models.py create mode 100644 server/career/tests.py create mode 100644 server/career/views.py create mode 100644 server/course/__init__.py create mode 100644 server/course/admin.py create mode 100644 server/course/apps.py create mode 100644 server/course/models.py create mode 100644 server/course/tests.py create mode 100644 server/course/views.py create mode 100644 server/forum/__init__.py create mode 100644 server/forum/admin.py create mode 100644 server/forum/apps.py create mode 100644 server/forum/models.py create mode 100644 server/forum/tests.py create mode 100644 server/forum/views.py create mode 100644 server/service/__init__.py create mode 100644 server/service/admin.py create mode 100644 server/service/apps.py create mode 100644 server/service/models.py create mode 100644 server/service/tests.py create mode 100644 server/service/views.py diff --git a/client/components/article/ArticleAdd.vue b/client/components/article/ArticleAdd.vue index d5efa9b..d5e4360 100644 --- a/client/components/article/ArticleAdd.vue +++ b/client/components/article/ArticleAdd.vue @@ -105,7 +105,8 @@ const handleArticleAdd = async (e: Event) => { title: articleState.title, content: state.content, thumbnail: null, // You may need to handle thumbnail separately based on your requirements - authorId: articleState.author, + // authorId: articleState.author, + authorId: 1, categoryId: articleState.category, }, }; diff --git a/server/READNE.md b/server/READNE.md new file mode 100644 index 0000000..f231276 --- /dev/null +++ b/server/READNE.md @@ -0,0 +1,26 @@ +# Backend + - Register user mutation +``` +mutation RegisterUser($email: String!, $password: String!, + $firstName: String!, $lastName: String!, $birth: String){ + registerUser(email: $email, password: $password, + firstName: $firstName, lastName: $lastName, birth: $birth){ + user{ + id + password + lastLogin + birth + } + } +} +``` + +``` +{ + "email": "u1@example.com", + "password": "Test1234", + "firstName": "fn1", + "lastName": "ln1", + "birth": "2024-03-06T11:26:12.306Z" +} +``` \ No newline at end of file diff --git a/server/blog/migrations/__init__.py b/server/account/__init__.py similarity index 100% rename from server/blog/migrations/__init__.py rename to server/account/__init__.py diff --git a/server/account/admin.py b/server/account/admin.py new file mode 100644 index 0000000..86d200e --- /dev/null +++ b/server/account/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin +from account.models import User + +# Register your models here. +admin.site.register(User) \ No newline at end of file diff --git a/server/account/apps.py b/server/account/apps.py new file mode 100644 index 0000000..2b08f1a --- /dev/null +++ b/server/account/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AccountConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'account' diff --git a/server/account/models.py b/server/account/models.py new file mode 100644 index 0000000..bdcded0 --- /dev/null +++ b/server/account/models.py @@ -0,0 +1,73 @@ +from django.db import models +from django.contrib.auth.models import BaseUserManager, AbstractBaseUser, AbstractUser + + +class UserManager(BaseUserManager): + def create_user(self, email, birth=None, password=None): + if not email: + raise ValueError("Users must have an email address") + + user = self.model( + email=self.normalize_email(email), + birth=birth, + ) + + user.set_password(password) + user.save(using=self._db) + return user + + def create_superuser(self, email, birth=None, password=None): + user = self.create_user( + email, + password=password, + birth=birth, + ) + user.is_admin = True + user.save(using=self._db) + return user + + +class User(AbstractUser): + email = models.EmailField( + verbose_name="email address", + max_length=255, + unique=True, + ) + birth = models.DateField() + is_active = models.BooleanField(default=False) + is_admin = models.BooleanField(default=False) + + groups = models.ManyToManyField( + 'auth.Group', + verbose_name='groups', + blank=True, + help_text='The groups this user belongs to.', + related_name='user_groups', + ) + + # Provide a unique related_name for the user_permissions field + user_permissions = models.ManyToManyField( + 'auth.Permission', + verbose_name='user permissions', + blank=True, + help_text='Specific permissions for this user.', + related_name='user_permissions_account', # Unique related_name to resolve the clash + ) + + objects = UserManager() + + USERNAME_FIELD = "email" + REQUIRED_FIELDS = [] + + def __str__(self): + return self.email + + def has_perm(self, perm, obj=None): + return True + + def has_module_perms(self, app_label): + return True + + @property + def is_staff(self): + return self.is_admin \ No newline at end of file diff --git a/server/account/resolvers/mutations.py b/server/account/resolvers/mutations.py index e69de29..c76dff9 100644 --- a/server/account/resolvers/mutations.py +++ b/server/account/resolvers/mutations.py @@ -0,0 +1,43 @@ +import graphene +from django.contrib.auth import get_user_model +from .queryTypes import UserType +from account.models import User +from datetime import datetime + +class UserRegistrationMutation(graphene.Mutation): + user = graphene.Field(UserType) + + class Arguments: + email = graphene.String(required=True) + password = graphene.String(required=True) + first_name = graphene.String(required=True) + last_name = graphene.String(required=True) + birth = graphene.String() # Accept birthdate as a string in ISO 8601 format + + def mutate(self, info, email, password, first_name, last_name, birth=None): + birthdate = None + if birth: + # Parse the birthdate string into a datetime object + birthdate = datetime.fromisoformat(birth.replace('Z', '+00:00')) + + # Create the user object + user = User( + email=email, + birth=birthdate, # Replace 'birthdate' with the actual field in your model + is_active=False, + username=email, # Set username directly + first_name=first_name, + last_name=last_name, + ) + + # Set the password + user.set_password(password) + + # Save the user + user.save() + + # Return the mutation result + return UserRegistrationMutation(user=user) + +class Mutation(graphene.ObjectType): + register_user = UserRegistrationMutation.Field() \ No newline at end of file diff --git a/server/account/resolvers/queryTypes.py b/server/account/resolvers/queryTypes.py index e69de29..1f84384 100644 --- a/server/account/resolvers/queryTypes.py +++ b/server/account/resolvers/queryTypes.py @@ -0,0 +1,7 @@ +from account.models import User +from graphene_django.types import DjangoObjectType +import graphene + +class UserType(DjangoObjectType): + class Meta: + model = User \ No newline at end of file diff --git a/server/account/tests.py b/server/account/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/server/account/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/server/account/views.py b/server/account/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/server/account/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/server/blog/migrations/0001_initial.py b/server/blog/migrations/0001_initial.py deleted file mode 100644 index f358a55..0000000 --- a/server/blog/migrations/0001_initial.py +++ /dev/null @@ -1,76 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-03 09:12 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Article', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=200)), - ('content', models.TextField()), - ('publication_date', models.DateField()), - ], - ), - migrations.CreateModel( - name='Author', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ('email', models.EmailField(max_length=254)), - ('bio', models.TextField()), - ], - ), - migrations.CreateModel( - name='Category', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=100)), - ], - ), - migrations.CreateModel( - name='Tag', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('name', models.CharField(max_length=255)), - ], - ), - migrations.CreateModel( - name='Comment', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('author_name', models.CharField(max_length=100)), - ('email', models.EmailField(max_length=254)), - ('comment_text', models.TextField()), - ('comment_date', models.DateField()), - ('article_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.article')), - ], - ), - migrations.CreateModel( - name='ArticleTags', - fields=[ - ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('article_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.article')), - ('tag_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.tag')), - ], - ), - migrations.AddField( - model_name='article', - name='author_id', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.author'), - ), - migrations.AddField( - model_name='article', - name='category_id', - field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.category'), - ), - ] diff --git a/server/blog/migrations/0002_rename_author_id_article_author_and_more.py b/server/blog/migrations/0002_rename_author_id_article_author_and_more.py deleted file mode 100644 index f76298e..0000000 --- a/server/blog/migrations/0002_rename_author_id_article_author_and_more.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-03 09:27 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0001_initial'), - ] - - operations = [ - migrations.RenameField( - model_name='article', - old_name='author_id', - new_name='author', - ), - migrations.RenameField( - model_name='article', - old_name='category_id', - new_name='category', - ), - migrations.RenameField( - model_name='article', - old_name='publication_date', - new_name='created_at', - ), - migrations.RenameField( - model_name='articletags', - old_name='article_id', - new_name='article', - ), - migrations.RenameField( - model_name='articletags', - old_name='tag_id', - new_name='tag', - ), - migrations.RenameField( - model_name='comment', - old_name='article_id', - new_name='article', - ), - migrations.RenameField( - model_name='comment', - old_name='author_name', - new_name='author', - ), - migrations.RenameField( - model_name='comment', - old_name='comment_date', - new_name='created_at', - ), - migrations.RenameField( - model_name='comment', - old_name='comment_text', - new_name='text', - ), - ] diff --git a/server/blog/migrations/0003_article_link.py b/server/blog/migrations/0003_article_link.py deleted file mode 100644 index 54aec4b..0000000 --- a/server/blog/migrations/0003_article_link.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-10 12:27 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0002_rename_author_id_article_author_and_more'), - ] - - operations = [ - migrations.AddField( - model_name='article', - name='link', - field=models.CharField(default='post-1-slug', max_length=255), - preserve_default=False, - ), - ] diff --git a/server/blog/migrations/0004_alter_article_link_alter_article_title.py b/server/blog/migrations/0004_alter_article_link_alter_article_title.py deleted file mode 100644 index 19efb37..0000000 --- a/server/blog/migrations/0004_alter_article_link_alter_article_title.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-10 12:28 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0003_article_link'), - ] - - operations = [ - migrations.AlterField( - model_name='article', - name='link', - field=models.CharField(max_length=255, unique=True), - ), - migrations.AlterField( - model_name='article', - name='title', - field=models.CharField(max_length=200, unique=True), - ), - ] diff --git a/server/blog/migrations/0005_article_thumbnail.py b/server/blog/migrations/0005_article_thumbnail.py deleted file mode 100644 index 9136988..0000000 --- a/server/blog/migrations/0005_article_thumbnail.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 4.2.7 on 2023-12-23 03:33 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0004_alter_article_link_alter_article_title'), - ] - - operations = [ - migrations.AddField( - model_name='article', - name='thumbnail', - field=models.CharField(default='webdevlab/yxogymfppkjpdzuy8gpe', max_length=255), - preserve_default=False, - ), - ] diff --git a/server/blog/migrations/0006_alter_article_created_at_alter_comment_created_at.py b/server/blog/migrations/0006_alter_article_created_at_alter_comment_created_at.py deleted file mode 100644 index d048657..0000000 --- a/server/blog/migrations/0006_alter_article_created_at_alter_comment_created_at.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 4.2.7 on 2023-12-23 03:41 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('blog', '0005_article_thumbnail'), - ] - - operations = [ - migrations.AlterField( - model_name='article', - name='created_at', - field=models.DateTimeField(auto_now_add=True), - ), - migrations.AlterField( - model_name='comment', - name='created_at', - field=models.DateTimeField(auto_now_add=True), - ), - ] diff --git a/server/blog/resolvers/mutations.py b/server/blog/resolvers/mutations.py index e3e5b59..166f32e 100644 --- a/server/blog/resolvers/mutations.py +++ b/server/blog/resolvers/mutations.py @@ -1,13 +1,48 @@ import graphene from graphene_django import DjangoObjectType -from ..models import Category, Article, Comment -from .queryTypes import CategoryType, ArticleType, CommentType +from ..models import Category, Article, Comment, Author +from .queryTypes import CategoryType, ArticleType, CommentType, AuthorType from core.settings import cloudinary from graphene_file_upload.scalars import Upload from datetime import datetime +from django.conf import settings import os +# class RegisterUserMutation(graphene.Mutation): +# """ +# Step-1: Arguments are firstName, lastName, email, password, confirmPassword +# Step-2: Create an unverified user and generate a JWT token +# Step-3: Send that token to email via a link +# Step-4: When user click on that link he will be verified afterward he can login +# """ +# +# +# class EmailVerifyMutation(graphene.Mutation): +# """""" +# +# class LoginUserMutation(graphene.Mutation): +# """ +# Step-1: Arguments are username/email and password +# Step-2: Check a user with that email does exist or not +# Step-3: Check the user has verified his email address or not +# Step-4: Check the password match or not +# Step-5: If password does match send the user 2 tokens first one is access token another one is refresh token +# Step-6: Protect route with some kinds of middleware or something +# """ +# +# +# class PasswordChangeMutation(graphene.Mutation): +# """ +# Step-1: Arguments are oldPassword, newPassword +# Step-2: Check old password did match +# Step-3: If old password match let them change their password +# """ + +# class LoginWithGoogleMutation +# class LoginWithGithubMutation + + class CategoryMutation(graphene.Mutation): class Arguments: name = graphene.String(required=True) @@ -31,48 +66,57 @@ class Arguments: title = graphene.String(required=True) content = graphene.String(required=True) thumbnail = Upload(required=True) - author_id = graphene.ID() + author_id = graphene.ID(required=True) category_id = graphene.ID() created_at = graphene.DateTime(required=False) id = graphene.ID() - success = graphene.Boolean() + # success = graphene.Boolean() article = graphene.Field(ArticleType) @classmethod def mutate(cls, root, info, title, content, thumbnail, author_id, category_id, created_at=None, id=None): - # Upload the image to Cloudinary - options = { - 'folder': os.environ["CLOUDINARY_FOLDER_NAME"], - "width": 300, "height": 300, "crop": "thumb" - } - cloudinary_response = cloudinary.uploader.upload(thumbnail, **options) + try: + # Upload the image to Cloudinary + options = { + 'folder': os.environ["CLOUDINARY_FOLDER_NAME"], + "width": 300, "height": 300, "crop": "thumb" + } + cloudinary_response = cloudinary.uploader.upload(thumbnail, **options) + + # Get the URL of the uploaded image from the Cloudinary response + thumbnail_url = cloudinary_response['public_id'] + # print({"thumbnail_url": thumbnail_url, "cloudinary_response": cloudinary_response}) + # result = {'thumbnail_url': 'http://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'cloudinary_response': {'asset_id': 'bc854fde83711cb4b1983764e884d7e0', 'public_id': 'kd1pcwdt1vyuzqoqmmst', 'version': 1703304728, 'version_id': '0cef85e7ba27804a7c6609db55035c20', 'signature': 'e12e6a78d6f4366f5cfba4da278df3c92b6f7b62', 'width': 3081, 'height': 4622, 'format': 'jpg', 'resource_type': 'image', 'created_at': '2023-12-23T04:12:08Z', 'tags': [], 'bytes': 506228, 'type': 'upload', 'etag': '400efc41ef8dc16183220bfa335a4b7e', 'placeholder': False, 'url': 'http://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'secure_url': 'https://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'folder': '', 'original_filename': 'pexels-blue-record-19397385', 'api_key': '455739236686664'}} + + # Get the current date and time + current_date_time = datetime.now() + + print(f"ID: {id}, Title: {title}, Content: {content}, Thumbnail URL: {thumbnail_url}, Author ID: {author_id}") + author = Author.objects.get(pk=author_id) + + if id: + article = Article.objects.get(pk=id) + article.title = title + article.content = content + article.thumbnail = thumbnail_url + article.created_at = current_date_time + if author_id: + article.author = author + if category_id: + article.category_id = category_id + article.save() + else: + article = Article.objects.create(title=title, content=content, thumbnail=thumbnail_url, + created_at=current_date_time, author=author, + category_id=category_id) + print({"Create article ": article}) + return ArticleMutation(article=article) + except Exception as e: + print(e) - # Get the URL of the uploaded image from the Cloudinary response - thumbnail_url = cloudinary_response['public_id'] - # print({"thumbnail_url": thumbnail_url, "cloudinary_response": cloudinary_response}) - # result = {'thumbnail_url': 'http://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'cloudinary_response': {'asset_id': 'bc854fde83711cb4b1983764e884d7e0', 'public_id': 'kd1pcwdt1vyuzqoqmmst', 'version': 1703304728, 'version_id': '0cef85e7ba27804a7c6609db55035c20', 'signature': 'e12e6a78d6f4366f5cfba4da278df3c92b6f7b62', 'width': 3081, 'height': 4622, 'format': 'jpg', 'resource_type': 'image', 'created_at': '2023-12-23T04:12:08Z', 'tags': [], 'bytes': 506228, 'type': 'upload', 'etag': '400efc41ef8dc16183220bfa335a4b7e', 'placeholder': False, 'url': 'http://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'secure_url': 'https://res.cloudinary.com/shayon-cloud/image/upload/v1703304728/kd1pcwdt1vyuzqoqmmst.jpg', 'folder': '', 'original_filename': 'pexels-blue-record-19397385', 'api_key': '455739236686664'}} - # Get the current date and time - current_date_time = datetime.now() - - if id: - article = Article.objects.get(pk=id) - article.title = title - article.content = content - article.thumbnail = thumbnail_url - article.created_at = current_date_time - if author_id: - article.author_id = author_id - if category_id: - article.category_id = category_id - article.save() - else: - article = Article.objects.create(title=title, content=content, thumbnail=thumbnail_url, - created_at=current_date_time, author_id=author_id, - category_id=category_id) - return ArticleMutation(article=article) class CommentMutation(graphene.Mutation): @@ -103,8 +147,33 @@ def mutate(cls, root, info, author, email, text, article_id, created_at=None, id created_at=current_date_time) return CommentMutation(comment=comment) +# Temporary +class AuthorMutation(graphene.Mutation): + class Arguments: + id = graphene.ID() + name = graphene.String(required = True) + email = graphene.String(required=True) + bio = graphene.String(required=True) + + author = graphene.Field(AuthorType) + + @classmethod + def mutate(cls, root, info, name, email, bio, id=None): + if id: + author = Author.objects.get(pk=id) + author.name = name + author.email = email + author.bio = bio + author.save() + else: + author = Author.objects.create(name=name, email=email, bio=bio) + + return AuthorMutation(author) + + class Mutation(graphene.ObjectType): create_or_update_category = CategoryMutation.Field() create_or_update_article = ArticleMutation.Field() create_or_update_comment = CommentMutation.Field() + create_or_update_author = AuthorMutation.Field() diff --git a/server/career/__init__.py b/server/career/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/career/admin.py b/server/career/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/server/career/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/server/career/apps.py b/server/career/apps.py new file mode 100644 index 0000000..3e5af75 --- /dev/null +++ b/server/career/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CareerConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'career' diff --git a/server/career/models.py b/server/career/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/server/career/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/server/career/tests.py b/server/career/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/server/career/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/server/career/views.py b/server/career/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/server/career/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/server/core/schema.py b/server/core/schema.py index ee88577..e0aab12 100644 --- a/server/core/schema.py +++ b/server/core/schema.py @@ -1,5 +1,12 @@ import graphene -from .resolvers.queries import Query -from .resolvers.mutations import Mutation +from blog.resolvers.queries import Query as BlogQuery +from blog.resolvers.mutations import Mutation as BlogMutation +from account.resolvers.mutations import Mutation as AccountMutation + +class Mutation(BlogMutation, AccountMutation): + pass + +class Query(BlogQuery): + pass schema = graphene.Schema(query=Query, mutation=Mutation) \ No newline at end of file diff --git a/server/core/settings.py b/server/core/settings.py index 24fbe5c..0ddc256 100644 --- a/server/core/settings.py +++ b/server/core/settings.py @@ -60,11 +60,19 @@ # Internal 'blog', + 'account', + 'forum', + 'career', + 'service', + 'course' ] # GraphQL Schema Path GRAPHENE = { - "SCHEMA": "blog.schema.schema" + "SCHEMA": "core.schema.schema", + "MIDDLEWARE": [ + "graphql_jwt.middleware.JSONWebTokenMiddleware", + ], } MIDDLEWARE = [ @@ -77,6 +85,12 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'corsheaders.middleware.CorsMiddleware', + "django.contrib.auth.middleware.AuthenticationMiddleware", +] + +AUTHENTICATION_BACKENDS = [ + "graphql_jwt.backends.JSONWebTokenBackend", + "django.contrib.auth.backends.ModelBackend", ] ROOT_URLCONF = 'core.urls' @@ -102,6 +116,8 @@ os.environ["FRONTEND_URL"] ] +AUTH_USER_MODEL = 'account.User' + WSGI_APPLICATION = 'core.wsgi.application' diff --git a/server/core/urls.py b/server/core/urls.py index 0c83de6..d74efe9 100644 --- a/server/core/urls.py +++ b/server/core/urls.py @@ -16,8 +16,11 @@ """ from django.contrib import admin from django.urls import path, include +from django.views.decorators.csrf import csrf_exempt +from graphene_file_upload.django import FileUploadGraphQLView urlpatterns = [ path('admin/', admin.site.urls), - path('', include('blog.urls')) + # path('', include('blog.urls')), + path("graphql/", csrf_exempt(FileUploadGraphQLView.as_view(graphiql=True))), ] diff --git a/server/course/__init__.py b/server/course/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/course/admin.py b/server/course/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/server/course/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/server/course/apps.py b/server/course/apps.py new file mode 100644 index 0000000..25f0187 --- /dev/null +++ b/server/course/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CourseConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'course' diff --git a/server/course/models.py b/server/course/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/server/course/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/server/course/tests.py b/server/course/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/server/course/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/server/course/views.py b/server/course/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/server/course/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/server/forum/__init__.py b/server/forum/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/forum/admin.py b/server/forum/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/server/forum/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/server/forum/apps.py b/server/forum/apps.py new file mode 100644 index 0000000..f0cb8de --- /dev/null +++ b/server/forum/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ForumConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'forum' diff --git a/server/forum/models.py b/server/forum/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/server/forum/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/server/forum/tests.py b/server/forum/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/server/forum/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/server/forum/views.py b/server/forum/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/server/forum/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/server/requirements.txt b/server/requirements.txt index 4849ee7..c11b15f 100644 --- a/server/requirements.txt +++ b/server/requirements.txt @@ -6,17 +6,20 @@ cloudinary==1.37.0 Django==4.2.7 django-cors-headers==4.3.1 django-dotenv==1.4.2 +django-graphql-jwt==0.4.0 graphene==3.3 graphene-django==3.1.5 graphene-file-upload==1.3.0 graphql-core==3.2.3 graphql-relay==3.2.0 +gunicorn==21.2.0 +packaging==23.2 promise==2.3 psycopg2-binary==2.9.9 +PyJWT==2.8.0 python-dotenv==1.0.0 six==1.16.0 sqlparse==0.4.4 text-unidecode==1.3 typing_extensions==4.9.0 urllib3==2.1.0 -gunicorn==21.2.0 diff --git a/server/service/__init__.py b/server/service/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/service/admin.py b/server/service/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/server/service/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/server/service/apps.py b/server/service/apps.py new file mode 100644 index 0000000..8d0ae67 --- /dev/null +++ b/server/service/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ServiceConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'service' diff --git a/server/service/models.py b/server/service/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/server/service/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/server/service/tests.py b/server/service/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/server/service/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/server/service/views.py b/server/service/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/server/service/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. From 7fff6cc1c4c600b59e94d3ce960ce1f77b754448 Mon Sep 17 00:00:00 2001 From: Md Shayon Date: Sun, 10 Mar 2024 12:42:49 +0600 Subject: [PATCH 4/4] Creating user successfully, now need to protect the routes --- server/READNE.md | 14 +++++++++----- server/account/admin.py | 3 ++- server/account/models.py | 2 +- server/account/resolvers/mutations.py | 2 +- server/account/resolvers/queries.py | 14 ++++++++++++++ server/account/resolvers/queryTypes.py | 6 +++++- server/core/schema.py | 3 ++- 7 files changed, 34 insertions(+), 10 deletions(-) diff --git a/server/READNE.md b/server/READNE.md index f231276..f0a484a 100644 --- a/server/READNE.md +++ b/server/READNE.md @@ -9,6 +9,8 @@ mutation RegisterUser($email: String!, $password: String!, id password lastLogin + firstName + lastName birth } } @@ -17,10 +19,12 @@ mutation RegisterUser($email: String!, $password: String!, ``` { - "email": "u1@example.com", + "email": "u2@example.com", "password": "Test1234", - "firstName": "fn1", - "lastName": "ln1", - "birth": "2024-03-06T11:26:12.306Z" + "firstName": "fn2", + "lastName": "ln2", + "birth": "2024-03-08T08:14:45.562Z" } -``` \ No newline at end of file +``` + - The `--run-syncdb` option helps to synchronize the database tables with the current state of your models without relying on the migration history. + - `./manage.py migrate --run-syncdb` \ No newline at end of file diff --git a/server/account/admin.py b/server/account/admin.py index 86d200e..5ec6f7e 100644 --- a/server/account/admin.py +++ b/server/account/admin.py @@ -1,5 +1,6 @@ from django.contrib import admin from account.models import User +from django.contrib.auth.admin import UserAdmin # Register your models here. -admin.site.register(User) \ No newline at end of file +# admin.site.register(User, UserAdmin) diff --git a/server/account/models.py b/server/account/models.py index bdcded0..b6ea506 100644 --- a/server/account/models.py +++ b/server/account/models.py @@ -33,7 +33,7 @@ class User(AbstractUser): max_length=255, unique=True, ) - birth = models.DateField() + birth = models.DateField(null=True, blank=True, default=None) is_active = models.BooleanField(default=False) is_admin = models.BooleanField(default=False) diff --git a/server/account/resolvers/mutations.py b/server/account/resolvers/mutations.py index c76dff9..e481d92 100644 --- a/server/account/resolvers/mutations.py +++ b/server/account/resolvers/mutations.py @@ -12,7 +12,7 @@ class Arguments: password = graphene.String(required=True) first_name = graphene.String(required=True) last_name = graphene.String(required=True) - birth = graphene.String() # Accept birthdate as a string in ISO 8601 format + birth = graphene.String(required=False) # Accept birthdate as a string in ISO 8601 format def mutate(self, info, email, password, first_name, last_name, birth=None): birthdate = None diff --git a/server/account/resolvers/queries.py b/server/account/resolvers/queries.py index e69de29..9eff631 100644 --- a/server/account/resolvers/queries.py +++ b/server/account/resolvers/queries.py @@ -0,0 +1,14 @@ +import graphene +from graphene_django import DjangoObjectType +from .queryTypes import GetUserType +from ..models import User + +class Query(graphene.ObjectType): + users = graphene.List(GetUserType) + question_by_id = graphene.Field(GetUserType, id=graphene.String()) + + def resolve_users(root, info, **kwargs): + return User.objects.all() + + def resolve_user_by_id(root, info, id): + return User.objects.get(pk=id) \ No newline at end of file diff --git a/server/account/resolvers/queryTypes.py b/server/account/resolvers/queryTypes.py index 1f84384..b3c089a 100644 --- a/server/account/resolvers/queryTypes.py +++ b/server/account/resolvers/queryTypes.py @@ -4,4 +4,8 @@ class UserType(DjangoObjectType): class Meta: - model = User \ No newline at end of file + model = User +class GetUserType(DjangoObjectType): + class Meta: + model = User + exclude = ("password",) \ No newline at end of file diff --git a/server/core/schema.py b/server/core/schema.py index e0aab12..fd008cf 100644 --- a/server/core/schema.py +++ b/server/core/schema.py @@ -2,11 +2,12 @@ from blog.resolvers.queries import Query as BlogQuery from blog.resolvers.mutations import Mutation as BlogMutation from account.resolvers.mutations import Mutation as AccountMutation +from account.resolvers.queries import Query as AccountQuery class Mutation(BlogMutation, AccountMutation): pass -class Query(BlogQuery): +class Query(BlogQuery, AccountQuery): pass schema = graphene.Schema(query=Query, mutation=Mutation) \ No newline at end of file