From 6c9ea6fca68426ccd6b75b972fcb3fbc01a7aa3b Mon Sep 17 00:00:00 2001 From: angelzrc Date: Thu, 7 Nov 2024 18:18:07 +0100 Subject: [PATCH] added dat folder to connect unsocial app to mongodb server #173 --- staff/angelzrc/unsocial/api/index.js | 45 - .../angelzrc/unsocial/api/logic/addComment.js | 20 - .../unsocial/api/logic/authenticateUser.js | 3 +- .../angelzrc/unsocial/api/logic/deletePost.js | 8 - .../unsocial/api/logic/getComments.js | 4 - staff/angelzrc/unsocial/api/logic/getPosts.js | 12 - staff/angelzrc/unsocial/api/logic/index.js | 7 +- .../unsocial/api/logic/removeComment.js | 4 - .../unsocial/api/logic/toggleLikePost.js | 16 - staff/angelzrc/unsocial/api/package-lock.json | 793 ------------------ staff/angelzrc/unsocial/api/package.json | 15 +- staff/angelzrc/unsocial/app/package-lock.json | 27 +- staff/angelzrc/unsocial/app/package.json | 6 - .../unsocial/app/src/logic/getPosts.js | 19 - .../unsocial/app/src/logic/getUserName.js | 30 - .../unsocial/app/src/logic/loginUser.js | 12 - .../unsocial/app/src/logic/registerUser.js | 4 - .../unsocial/app/src/view/Register.jsx | 4 - staff/angelzrc/unsocial/com/package.json | 11 - staff/angelzrc/unsocial/dat/index.js | 18 + staff/angelzrc/unsocial/dat/package-lock.json | 163 ++++ staff/angelzrc/unsocial/dat/package.json | 15 + 22 files changed, 202 insertions(+), 1034 deletions(-) delete mode 100644 staff/angelzrc/unsocial/api/package-lock.json create mode 100644 staff/angelzrc/unsocial/dat/index.js create mode 100644 staff/angelzrc/unsocial/dat/package-lock.json create mode 100644 staff/angelzrc/unsocial/dat/package.json diff --git a/staff/angelzrc/unsocial/api/index.js b/staff/angelzrc/unsocial/api/index.js index b830ddfc..7f9267c6 100644 --- a/staff/angelzrc/unsocial/api/index.js +++ b/staff/angelzrc/unsocial/api/index.js @@ -71,12 +71,7 @@ server.post('/posts', jsonBodyParser, (req, res) => { } }) -<<<<<<< HEAD server.get('/posts', (req, res) => { -======= -server.patch('/posts/:postId/likes', (req, res) => { - const { postId } = req.params ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const userId = req.headers.authorization.slice(6) try { @@ -90,46 +85,6 @@ server.patch('/posts/:postId/likes', (req, res) => { } }) -<<<<<<< HEAD -======= - - -server.post('/posts/:postId/comments', jsonBodyParser, (req, res) => { - const { postId } = req.params - const userId = req.headers.authorization.slice(6) // 'Basic asdfasdfas' - const { text } = req.body - - try { - logic.addComment(userId, postId, text) - - res.status(201).send() - } catch (error) { - - res.status(400).json({ error: error.constructor.name, message: error.message }) - - console.error(error) - } - - -}) - -server.delete('posts/:postId/comments/:commentId', (req, res) => { - const { postId, commentId } = req.params - const userId = req.headers.authorization.slice(6) - - try { - logic.removeComment(postId, userId, commentId) - - res.status(204).send() - } catch (error) { - - res.status(400).json({ error: error.constructor.name, message: error.message }) - - console.error(error) - } -}) - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b server.delete('/posts/:postId', (req, res) => { const userId = req.headers.authorization.slice(6) diff --git a/staff/angelzrc/unsocial/api/logic/addComment.js b/staff/angelzrc/unsocial/api/logic/addComment.js index bf21d2b0..3ae95a2b 100644 --- a/staff/angelzrc/unsocial/api/logic/addComment.js +++ b/staff/angelzrc/unsocial/api/logic/addComment.js @@ -12,27 +12,7 @@ export default (userId, postId, text) => { if (!found) throw new Error('user not found') -<<<<<<< HEAD const post = posts.find(({ id }) => id === postId) -======= - if (!found) { - throw new Error('user not found') - } else if (!postFound) { - throw new Error('post not found') - } else { - const post = posts.find(({ id }) => id === postId) - - const comment = { - id: uuid(), - author: userId, - text, - date: new Date - } - post.comments.push(comment) - - storage.posts = posts - } ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b if (!post) throw new Error('post not found') diff --git a/staff/angelzrc/unsocial/api/logic/authenticateUser.js b/staff/angelzrc/unsocial/api/logic/authenticateUser.js index 639b4128..69425a69 100644 --- a/staff/angelzrc/unsocial/api/logic/authenticateUser.js +++ b/staff/angelzrc/unsocial/api/logic/authenticateUser.js @@ -1,5 +1,6 @@ -import { storage } from '../data/index.js' import { validate } from 'com' +import { storage } from '../data/index.js' + export default (username, password) => { validate.username(username) diff --git a/staff/angelzrc/unsocial/api/logic/deletePost.js b/staff/angelzrc/unsocial/api/logic/deletePost.js index b45ab8e5..bf98c829 100644 --- a/staff/angelzrc/unsocial/api/logic/deletePost.js +++ b/staff/angelzrc/unsocial/api/logic/deletePost.js @@ -11,14 +11,6 @@ export default (userId, postId) => { if (!found) throw new Error('user not found') -<<<<<<< HEAD -======= - const { users, posts } = storage - const user = users.find(({ id }) => id === userId) - - if (!user) throw new Error('user not found') - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const index = posts.findIndex(({ id }) => id === postId) if (index < 0) throw new Error('post not found') diff --git a/staff/angelzrc/unsocial/api/logic/getComments.js b/staff/angelzrc/unsocial/api/logic/getComments.js index 1a8e09ba..5c757f21 100644 --- a/staff/angelzrc/unsocial/api/logic/getComments.js +++ b/staff/angelzrc/unsocial/api/logic/getComments.js @@ -11,10 +11,6 @@ export default (userId, postId) => { if (!found) throw new Error('user not found') - const found = users.some(({ id }) => id === userId) - - if (!found) throw new Error('user not found') - const post = posts.find(({ id }) => id === postId) if (!post) throw new Error('post not found') diff --git a/staff/angelzrc/unsocial/api/logic/getPosts.js b/staff/angelzrc/unsocial/api/logic/getPosts.js index 0e11c383..8c04ca19 100644 --- a/staff/angelzrc/unsocial/api/logic/getPosts.js +++ b/staff/angelzrc/unsocial/api/logic/getPosts.js @@ -1,9 +1,5 @@ import { storage } from '../data/index.js' -<<<<<<< HEAD import { validate } from 'com' -======= -import { validate } from './helpers/index.js' ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b export default userId => { validate.id(userId, 'userId') @@ -25,14 +21,6 @@ export default userId => { post.comments = post.comments.length }) -<<<<<<< HEAD -======= - - /* const reversedPosts = posts.slice().reverse(); - return reversedPosts */ - /* console.log(Array.isArray(posts)) - console.log(posts) */ ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b return posts.toReversed() } \ No newline at end of file diff --git a/staff/angelzrc/unsocial/api/logic/index.js b/staff/angelzrc/unsocial/api/logic/index.js index 13128649..3a900fa7 100644 --- a/staff/angelzrc/unsocial/api/logic/index.js +++ b/staff/angelzrc/unsocial/api/logic/index.js @@ -8,7 +8,7 @@ import toggleLikePost from './toggleLikePost.js' import addComment from './addComment.js' import removeComment from './removeComment.js' import getComments from './getComments.js' -import toggleLikePost from './toggleLikePost.js' + const logic = { @@ -23,12 +23,7 @@ const logic = { addComment, removeComment, -<<<<<<< HEAD getComments -======= - deletePost, - toggleLikePost ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b } export default logic \ No newline at end of file diff --git a/staff/angelzrc/unsocial/api/logic/removeComment.js b/staff/angelzrc/unsocial/api/logic/removeComment.js index a0a1d4d2..811fe998 100644 --- a/staff/angelzrc/unsocial/api/logic/removeComment.js +++ b/staff/angelzrc/unsocial/api/logic/removeComment.js @@ -11,10 +11,6 @@ export default (userId, postId, commentId) => { const found = users.some(({ id }) => id === userId) if (!found) throw new Error('user not found') -<<<<<<< HEAD -======= - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const post = posts.find(({ id }) => id === postId) diff --git a/staff/angelzrc/unsocial/api/logic/toggleLikePost.js b/staff/angelzrc/unsocial/api/logic/toggleLikePost.js index 05ad7bee..b75bc9f4 100644 --- a/staff/angelzrc/unsocial/api/logic/toggleLikePost.js +++ b/staff/angelzrc/unsocial/api/logic/toggleLikePost.js @@ -1,31 +1,19 @@ -<<<<<<< HEAD import { validate } from 'com' import { storage } from '../data/index.js' -======= -import { storage } from "../data/index.js" ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b export default (userId, postId) => { validate.id(userId, 'userId') validate.id(postId, 'postId') const { users, posts } = storage -<<<<<<< HEAD const found = users.some(({ id }) => id === userId) -======= - const found = users.som(({ id }) => id === userId) ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b if (!found) throw new Error('user not found') const post = posts.find(({ id }) => id === postId) -<<<<<<< HEAD if (!post) throw new Error('post not found') -======= - if (!post) throw new Error('user not found') ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const { likes } = post @@ -37,8 +25,4 @@ export default (userId, postId) => { likes.splice(index, 1) storage.posts = posts -<<<<<<< HEAD -======= - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b } \ No newline at end of file diff --git a/staff/angelzrc/unsocial/api/package-lock.json b/staff/angelzrc/unsocial/api/package-lock.json deleted file mode 100644 index 35e9f572..00000000 --- a/staff/angelzrc/unsocial/api/package-lock.json +++ /dev/null @@ -1,793 +0,0 @@ -{ - "name": "api", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "api", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "cors": "^2.8.5", - "express": "^4.21.1" - } - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz", - "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.10", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "license": "MIT", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "license": "ISC" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "license": "MIT" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-to-regexp": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", - "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", - "license": "MIT" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "license": "MIT", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "license": "MIT", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" - }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "license": "MIT", - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - } - } -} diff --git a/staff/angelzrc/unsocial/api/package.json b/staff/angelzrc/unsocial/api/package.json index db516456..76b5137f 100644 --- a/staff/angelzrc/unsocial/api/package.json +++ b/staff/angelzrc/unsocial/api/package.json @@ -1,6 +1,7 @@ { "name": "api", "version": "0.0.0", + "description": "", "type": "module", "main": "index.js", "scripts": { @@ -12,20 +13,8 @@ "author": "", "license": "ISC", "dependencies": { -<<<<<<< HEAD "com": "file:../com", "cors": "^2.8.5", "express": "^4.21.1" - }, - "directories": { - "test": "test" - }, - "devDependencies": {}, - "description": "" -} -======= - "cors": "^2.8.5", - "express": "^4.21.1" } -} ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b +} \ No newline at end of file diff --git a/staff/angelzrc/unsocial/app/package-lock.json b/staff/angelzrc/unsocial/app/package-lock.json index f8fce85e..1180994a 100644 --- a/staff/angelzrc/unsocial/app/package-lock.json +++ b/staff/angelzrc/unsocial/app/package-lock.json @@ -8,15 +8,9 @@ "name": "app", "version": "0.0.0", "dependencies": { -<<<<<<< HEAD "com": "file:../com", "react": "^18.2.0", "react-dom": "^18.2.0" -======= - "cors": "^2.8.5", - "react": "^18.3.1", - "react-dom": "^18.3.1" ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b }, "devDependencies": { "@types/react": "^18.2.15", @@ -1339,18 +1333,6 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2998,6 +2980,7 @@ "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" } @@ -3887,14 +3870,6 @@ "punycode": "^2.1.0" } }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/vite": { "version": "4.5.5", "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", diff --git a/staff/angelzrc/unsocial/app/package.json b/staff/angelzrc/unsocial/app/package.json index 43611464..34ff2ddc 100644 --- a/staff/angelzrc/unsocial/app/package.json +++ b/staff/angelzrc/unsocial/app/package.json @@ -11,15 +11,9 @@ "preview": "vite preview" }, "dependencies": { -<<<<<<< HEAD "com": "file:../com", "react": "^18.2.0", "react-dom": "^18.2.0" -======= - "cors": "^2.8.5", - "react": "^18.3.1", - "react-dom": "^18.3.1" ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b }, "devDependencies": { "@types/react": "^18.2.15", diff --git a/staff/angelzrc/unsocial/app/src/logic/getPosts.js b/staff/angelzrc/unsocial/app/src/logic/getPosts.js index e4977b14..8db654c8 100644 --- a/staff/angelzrc/unsocial/app/src/logic/getPosts.js +++ b/staff/angelzrc/unsocial/app/src/logic/getPosts.js @@ -1,4 +1,3 @@ -<<<<<<< HEAD import { validate } from 'com' export default callback => { @@ -17,24 +16,6 @@ export default callback => { return } -======= -export default callback => { - // TODO validate callback - - const xhr = new XMLHttpRequest - - xhr.addEventListener('load', () => { - const { status, response } = xhr - - if (status === 200) { - const posts = JSON.parse(response) - - callback(null, posts) - - return - } - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const { error, message } = JSON.parse(response) callback(new Error(message)) diff --git a/staff/angelzrc/unsocial/app/src/logic/getUserName.js b/staff/angelzrc/unsocial/app/src/logic/getUserName.js index 03363c37..762090b1 100644 --- a/staff/angelzrc/unsocial/app/src/logic/getUserName.js +++ b/staff/angelzrc/unsocial/app/src/logic/getUserName.js @@ -1,36 +1,10 @@ -<<<<<<< HEAD import { validate } from 'com' -======= -export default callback => { - - const xhr = new XMLHttpRequest - - xhr.addEventListener('load', () => { - const { status, response } = xhr - - if (status === 200) { - - const name = JSON.parse(response) - callback(null, name) - return - } - - const { error, message } = JSON.parse(response) - - callback(new Error(message)) - }) - - xhr.open('GET', `http://localhost:8080/users/${sessionStorage.userId}/name`) - - /* const users = JSON.parse(localStorage.users) ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b export default callback => { validate.callback(callback) const xhr = new XMLHttpRequest -<<<<<<< HEAD xhr.addEventListener('load', () => { const { status, response } = xhr @@ -51,7 +25,3 @@ export default callback => { xhr.setRequestHeader('Authorization', `Basic ${sessionStorage.userId}`) xhr.send() } -======= - return user.name */ -} ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b diff --git a/staff/angelzrc/unsocial/app/src/logic/loginUser.js b/staff/angelzrc/unsocial/app/src/logic/loginUser.js index a0ba518c..43d487a0 100644 --- a/staff/angelzrc/unsocial/app/src/logic/loginUser.js +++ b/staff/angelzrc/unsocial/app/src/logic/loginUser.js @@ -6,7 +6,6 @@ export default (username, password, callback) => { validate.callback(callback) const xhr = new XMLHttpRequest -<<<<<<< HEAD xhr.addEventListener('load', () => { const { status, response } = xhr @@ -18,17 +17,6 @@ export default (username, password, callback) => { callback(null) -======= - xhr.addEventListener('load', () => { - const { status, response } = xhr - - if (status === 200) { - const userId = JSON.parse(response) - - sessionStorage.userId = userId - callback(null) - ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b return } diff --git a/staff/angelzrc/unsocial/app/src/logic/registerUser.js b/staff/angelzrc/unsocial/app/src/logic/registerUser.js index 9cdf38cd..d9ec3154 100644 --- a/staff/angelzrc/unsocial/app/src/logic/registerUser.js +++ b/staff/angelzrc/unsocial/app/src/logic/registerUser.js @@ -6,11 +6,7 @@ export default (name, email, username, password, passwordRepeat, callback) => { validate.username(username) validate.password(password) validate.passwordsMatch(password, passwordRepeat) -<<<<<<< HEAD validate.callback(callback) -======= - // TODO validate callback ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b const xhr = new XMLHttpRequest diff --git a/staff/angelzrc/unsocial/app/src/view/Register.jsx b/staff/angelzrc/unsocial/app/src/view/Register.jsx index 7a448985..8795283b 100644 --- a/staff/angelzrc/unsocial/app/src/view/Register.jsx +++ b/staff/angelzrc/unsocial/app/src/view/Register.jsx @@ -4,11 +4,7 @@ import { PasswordInput, Input, Button, Form, Field, Label } from '../components/ import logic from '../logic' -<<<<<<< HEAD export default function Register(props) { -======= -export default props => { ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b console.log('Register -> render') const handleSubmit = event => { diff --git a/staff/angelzrc/unsocial/com/package.json b/staff/angelzrc/unsocial/com/package.json index d5616fa7..2c255252 100644 --- a/staff/angelzrc/unsocial/com/package.json +++ b/staff/angelzrc/unsocial/com/package.json @@ -1,24 +1,13 @@ { "name": "com", -<<<<<<< HEAD "version": "0.0.0", "description": "", "type": "module", "main": "index.js", -======= - "version": "1.0.0", - "main": "index.js", - "type": "module", ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", -<<<<<<< HEAD "license": "ISC" -======= - "license": "ISC", - "description": "" ->>>>>>> 1b468274c84eb6f3853c660b2b2683f639a5aa7b } \ No newline at end of file diff --git a/staff/angelzrc/unsocial/dat/index.js b/staff/angelzrc/unsocial/dat/index.js new file mode 100644 index 00000000..81ac0caa --- /dev/null +++ b/staff/angelzrc/unsocial/dat/index.js @@ -0,0 +1,18 @@ +import { MongoClient, ObjectId } from 'mongodb' + +const client = new MongoClient('mongodb://127.0.0.1:27017') + +client.connect() + .then(connection => { + console.log('connected') + + const db = connection.db('unsocial') + + const users = db.collection('users') + const posts = db.collection('posts') + + users.deleteOne({ _id: new ObjectId('672cdb09fcf48026d6c1c194') }) + + users.find({}).toArray().then(users => console.log(users)) + posts.find({}).toArray().then(posts => console.log(JSON.stringify(posts, null, 2))) + }) \ No newline at end of file diff --git a/staff/angelzrc/unsocial/dat/package-lock.json b/staff/angelzrc/unsocial/dat/package-lock.json new file mode 100644 index 00000000..131c54e4 --- /dev/null +++ b/staff/angelzrc/unsocial/dat/package-lock.json @@ -0,0 +1,163 @@ +{ + "name": "dat", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dat", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "mongodb": "^6.10.0" + } + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.9.tgz", + "integrity": "sha512-tVkljjeEaAhCqTzajSdgbQ6gE6f3oneVwa3iXR6csiEwXXOFsiC6Uh9iAjAhXPtqa/XMDHWjjeNH/77m/Yq2dw==", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", + "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", + "license": "MIT", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/bson": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.9.0.tgz", + "integrity": "sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "license": "MIT" + }, + "node_modules/mongodb": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.10.0.tgz", + "integrity": "sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "license": "MIT", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "license": "MIT", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + } + } +} diff --git a/staff/angelzrc/unsocial/dat/package.json b/staff/angelzrc/unsocial/dat/package.json new file mode 100644 index 00000000..bad28c50 --- /dev/null +++ b/staff/angelzrc/unsocial/dat/package.json @@ -0,0 +1,15 @@ +{ + "name": "dat", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "mongodb", + "dependencies": { + "mongodb": "^6.10.0" + } +} \ No newline at end of file