From 4f3f671ce05e3c9225e129c45ace37035501304e Mon Sep 17 00:00:00 2001 From: suyeongs Date: Fri, 8 Sep 2023 22:32:33 +0900 Subject: [PATCH 01/54] FIX : db --- .../20230907102745_initial_settings.sql | 160 ------------------ .../20230908120917_create_users_table.sql | 13 ++ ...30908121059_create_member_grades_table.sql | 10 ++ ...908121115_create_member_profiles_table.sql | 18 ++ ...0908121146_create_trainer_grades_table.sql | 10 ++ ...08121313_create_trainer_profiles_table.sql | 17 ++ ...0230908121415_create_memberships_table.sql | 10 ++ ...8121432_create_users_memberships_table.sql | 13 ++ .../20230908121522_create_payments_table.sql | 13 ++ ...230908121530_create_thread_types_table.sql | 8 + .../20230908121545_create_threads_table.sql | 15 ++ ...30908121559_create_thread_images_table.sql | 10 ++ ...30908121617_create_comment_types_table.sql | 8 + .../20230908121629_create_comments_table.sql | 17 ++ .../20230908121654_create_exercises_table.sql | 16 ++ .../20230908121704_create_diets_table.sql | 14 ++ ...0230908121713_create_diet_images_table.sql | 10 ++ 17 files changed, 202 insertions(+), 160 deletions(-) delete mode 100644 db/migrations/20230907102745_initial_settings.sql create mode 100644 db/migrations/20230908120917_create_users_table.sql create mode 100644 db/migrations/20230908121059_create_member_grades_table.sql create mode 100644 db/migrations/20230908121115_create_member_profiles_table.sql create mode 100644 db/migrations/20230908121146_create_trainer_grades_table.sql create mode 100644 db/migrations/20230908121313_create_trainer_profiles_table.sql create mode 100644 db/migrations/20230908121415_create_memberships_table.sql create mode 100644 db/migrations/20230908121432_create_users_memberships_table.sql create mode 100644 db/migrations/20230908121522_create_payments_table.sql create mode 100644 db/migrations/20230908121530_create_thread_types_table.sql create mode 100644 db/migrations/20230908121545_create_threads_table.sql create mode 100644 db/migrations/20230908121559_create_thread_images_table.sql create mode 100644 db/migrations/20230908121617_create_comment_types_table.sql create mode 100644 db/migrations/20230908121629_create_comments_table.sql create mode 100644 db/migrations/20230908121654_create_exercises_table.sql create mode 100644 db/migrations/20230908121704_create_diets_table.sql create mode 100644 db/migrations/20230908121713_create_diet_images_table.sql diff --git a/db/migrations/20230907102745_initial_settings.sql b/db/migrations/20230907102745_initial_settings.sql deleted file mode 100644 index 5d2076b..0000000 --- a/db/migrations/20230907102745_initial_settings.sql +++ /dev/null @@ -1,160 +0,0 @@ --- migrate:up -CREATE TABLE `users` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `email` varchar(100) UNIQUE NOT NULL, - `nickname` varchar(100) NOT NULL, - `password` varchar(100) NOT NULL, - `profile_image` varchar(200) NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP -); - -CREATE TABLE `user_profiles` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `height` int NOT NULL, - `weight` int NOT NULL, - `age` int NOT NULL, - `gender` varchar(50) NOT NULL, - `point` int NOT NULL, - `grade` varchar(100) NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP -); - -CREATE TABLE `trainer_profiles` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `score` int NOT NULL, - `career` varchar(500) NOT NULL, - `awards` varchar(500), - `license` varchar(500) NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP -); - -CREATE TABLE `payments` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `membership_id` int NOT NULL, - `price` int NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP -); - -CREATE TABLE `users_memberships` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `membership_id` int NOT NULL, - `start_date` date NOT NULL, - `end_date` date NOT NULL -); - -CREATE TABLE `memberships` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL, - `price` int NOT NULL, - `description` varchar(500) NOT NULL -); - -CREATE TABLE `threads` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `thread_types_id` int NOT NULL, - `title` varchar(100) NOT NULL, - `content` varchar(1000) NOT NULL, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP -); - -CREATE TABLE `thread_types` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL -); - -CREATE TABLE `thread_image` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `thread_id` int NOT NULL, - `image_url` varchar(200) NOT NULL -); - -CREATE TABLE `exercises` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `creater_id` int NOT NULL, - `name` varchar(50) NOT NULL, - `description` varchar(500) NOT NULL, - `image_url` varchar(200) NOT NULL, - `weekday` varchar(50) NOT NULL, - `checkbox` boolean NOT NULL DEFAULT false -); - -CREATE TABLE `diets` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `creater_id` int NOT NULL, - `name` varchar(50) NOT NULL, - `description` varchar(500) NOT NULL, - `weekday` varchar(50) NOT NULL -); - -CREATE TABLE `diet_images` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `diet_id` int NOT NULL, - `image_url` varchar(200) NOT NULL -); - -CREATE TABLE `comments` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `user_id` int NOT NULL, - `thread_id` int NOT NULL, - `comment_types_id` int NOT NULL, - `content` varchar(500) NOT NULL, - `selection` boolean NOT NULL DEFAULT false, - `created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - `updated_at` TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP -); - -CREATE TABLE `comment_types` ( - `id` int PRIMARY KEY NOT NULL AUTO_INCREMENT, - `name` varchar(100) NOT NULL -); - -ALTER TABLE `threads` ADD FOREIGN KEY (`thread_types_id`) REFERENCES `thread_types` (`id`); - -ALTER TABLE `diets` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `exercises` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `users_memberships` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `payments` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `user_profiles` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `trainer_profiles` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `threads` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `comments` ADD FOREIGN KEY (`user_id`) REFERENCES `users` (`id`); - -ALTER TABLE `payments` ADD FOREIGN KEY (`membership_id`) REFERENCES `memberships` (`id`); - -ALTER TABLE `diet_images` ADD FOREIGN KEY (`diet_id`) REFERENCES `diets` (`id`); - -ALTER TABLE `thread_image` ADD FOREIGN KEY (`thread_id`) REFERENCES `threads` (`id`); - -ALTER TABLE `comments` ADD FOREIGN KEY (`comment_types_id`) REFERENCES `comment_types` (`id`); - -ALTER TABLE `users_memberships` ADD FOREIGN KEY (`membership_id`) REFERENCES `memberships` (`id`); - -ALTER TABLE `exercises` ADD FOREIGN KEY (`creater_id`) REFERENCES `users` (`id`); - -ALTER TABLE `diets` ADD FOREIGN KEY (`creater_id`) REFERENCES `users` (`id`); - -ALTER TABLE `comments` ADD FOREIGN KEY (`thread_id`) REFERENCES `threads` (`id`); - - --- migrate:down - - - diff --git a/db/migrations/20230908120917_create_users_table.sql b/db/migrations/20230908120917_create_users_table.sql new file mode 100644 index 0000000..c931e06 --- /dev/null +++ b/db/migrations/20230908120917_create_users_table.sql @@ -0,0 +1,13 @@ +-- migrate:up +CREATE TABLE users ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + email VARCHAR(100) UNIQUE NOT NULL, + nickname VARCHAR(100) NOT NULL, + password VARCHAR(100) NOT NULL, + profile_image VARCHAR(200), + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +); + +-- migrate:down +DROP TABLE IF EXISTS users; diff --git a/db/migrations/20230908121059_create_member_grades_table.sql b/db/migrations/20230908121059_create_member_grades_table.sql new file mode 100644 index 0000000..5f32645 --- /dev/null +++ b/db/migrations/20230908121059_create_member_grades_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE member_grades ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + name VARCHAR(200) NOT NULL, + emoji VARCHAR(500) NOT NULL +); +ALTER TABLE member_grades CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- migrate:down +DROP TABLE IF EXISTS member_grades; diff --git a/db/migrations/20230908121115_create_member_profiles_table.sql b/db/migrations/20230908121115_create_member_profiles_table.sql new file mode 100644 index 0000000..14e1c77 --- /dev/null +++ b/db/migrations/20230908121115_create_member_profiles_table.sql @@ -0,0 +1,18 @@ +-- migrate:up +CREATE TABLE member_profiles ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + member_grade_id INT NOT NULL, + height INT NOT NULL, + weight INT NOT NULL, + age INT NOT NULL, + gender VARCHAR(50) NOT NULL, + point INT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT member_profiles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id), + CONSTRAINT member_profiles_member_grade_id_fkey FOREIGN KEY (member_grade_id) REFERENCES member_grades (id) +); + +-- migrate:down +DROP TABLE IF EXISTS member_profiles; diff --git a/db/migrations/20230908121146_create_trainer_grades_table.sql b/db/migrations/20230908121146_create_trainer_grades_table.sql new file mode 100644 index 0000000..2504598 --- /dev/null +++ b/db/migrations/20230908121146_create_trainer_grades_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE trainer_grades ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + name VARCHAR(200) NOT NULL, + emoji VARCHAR(500) NOT NULL +); +ALTER TABLE trainer_grades CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- migrate:down +DROP TABLE IF EXISTS trainer_grades; diff --git a/db/migrations/20230908121313_create_trainer_profiles_table.sql b/db/migrations/20230908121313_create_trainer_profiles_table.sql new file mode 100644 index 0000000..ca554f0 --- /dev/null +++ b/db/migrations/20230908121313_create_trainer_profiles_table.sql @@ -0,0 +1,17 @@ +-- migrate:up +CREATE TABLE trainer_profiles ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + trainer_grade_id INT NOT NULL, + score INT NOT NULL DEFAULT 0, + career VARCHAR(500) NOT NULL, + awards VARCHAR(500), + license VARCHAR(500) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT trainer_profiles_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id), + CONSTRAINT trainer_profiles_trainer_grade_id_fkey FOREIGN KEY (trainer_grade_id) REFERENCES trainer_grades (id) +); + +-- migrate:down +DROP TABLE IF EXISTS trainer_profiles; diff --git a/db/migrations/20230908121415_create_memberships_table.sql b/db/migrations/20230908121415_create_memberships_table.sql new file mode 100644 index 0000000..f9e842f --- /dev/null +++ b/db/migrations/20230908121415_create_memberships_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE memberships ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + name VARCHAR(100) NOT NULL, + price INT NOT NULL, + description VARCHAR(500) NOT NULL +); + +-- migrate:down +DROP TABLE IF EXISTS memberships; diff --git a/db/migrations/20230908121432_create_users_memberships_table.sql b/db/migrations/20230908121432_create_users_memberships_table.sql new file mode 100644 index 0000000..7f9aa89 --- /dev/null +++ b/db/migrations/20230908121432_create_users_memberships_table.sql @@ -0,0 +1,13 @@ +-- migrate:up +CREATE TABLE users_memberships ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + membership_id INT NOT NULL, + start_date DATETIME NOT NULL, + end_date DATETIME NOT NULL, + CONSTRAINT users_memberships_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id), + CONSTRAINT users_memberships_membership_id_fkey FOREIGN KEY (membership_id) REFERENCES memberships (id) +); + +-- migrate:down +DROP TABLE IF EXISTS users_memberships; diff --git a/db/migrations/20230908121522_create_payments_table.sql b/db/migrations/20230908121522_create_payments_table.sql new file mode 100644 index 0000000..723ca2a --- /dev/null +++ b/db/migrations/20230908121522_create_payments_table.sql @@ -0,0 +1,13 @@ +-- migrate:up +CREATE TABLE payments ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + membership_id INT NOT NULL, + price INT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + CONSTRAINT payments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id), + CONSTRAINT payments_membership_id_fkey FOREIGN KEY (membership_id) REFERENCES memberships (id) +); + +-- migrate:down +DROP TABLE IF EXISTS payments; diff --git a/db/migrations/20230908121530_create_thread_types_table.sql b/db/migrations/20230908121530_create_thread_types_table.sql new file mode 100644 index 0000000..f529837 --- /dev/null +++ b/db/migrations/20230908121530_create_thread_types_table.sql @@ -0,0 +1,8 @@ +-- migrate:up +CREATE TABLE thread_types ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + name VARCHAR(100) NOT NULL +); + +-- migrate:down +DROP TABLE IF EXISTS thread_types; \ No newline at end of file diff --git a/db/migrations/20230908121545_create_threads_table.sql b/db/migrations/20230908121545_create_threads_table.sql new file mode 100644 index 0000000..daf9d6a --- /dev/null +++ b/db/migrations/20230908121545_create_threads_table.sql @@ -0,0 +1,15 @@ +-- migrate:up +CREATE TABLE threads ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + thread_types_id INT NOT NULL, + title VARCHAR(100) NOT NULL, + content VARCHAR(1000) NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT threads_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id), + CONSTRAINT threads_thread_types_id_fkey FOREIGN KEY (thread_types_id) REFERENCES thread_types (id) +); + +-- migrate:down +DROP TABLE IF EXISTS threads; diff --git a/db/migrations/20230908121559_create_thread_images_table.sql b/db/migrations/20230908121559_create_thread_images_table.sql new file mode 100644 index 0000000..67017f7 --- /dev/null +++ b/db/migrations/20230908121559_create_thread_images_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE thread_images ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + thread_id INT NOT NULL, + image_url VARCHAR(200) NOT NULL, + CONSTRAINT thread_images_thread_id_fkey FOREIGN KEY (thread_id) REFERENCES threads (id) +); + +-- migrate:down +DROP TABLE IF EXISTS thread_images; diff --git a/db/migrations/20230908121617_create_comment_types_table.sql b/db/migrations/20230908121617_create_comment_types_table.sql new file mode 100644 index 0000000..f18e6e5 --- /dev/null +++ b/db/migrations/20230908121617_create_comment_types_table.sql @@ -0,0 +1,8 @@ +-- migrate:up +CREATE TABLE comment_types ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + name VARCHAR(100) NOT NULL +); + +-- migrate:down +DROP TABLE IF EXISTS comment_types; diff --git a/db/migrations/20230908121629_create_comments_table.sql b/db/migrations/20230908121629_create_comments_table.sql new file mode 100644 index 0000000..d3a713c --- /dev/null +++ b/db/migrations/20230908121629_create_comments_table.sql @@ -0,0 +1,17 @@ +-- migrate:up +CREATE TABLE comments ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + user_id INT NOT NULL, + thread_id INT NOT NULL, + comment_types_id INT NOT NULL, + content VARCHAR(500) NOT NULL, + selection BOOLEAN NOT NULL DEFAULT false, + created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + CONSTRAINT comments_thread_id_fkey FOREIGN KEY (thread_id) REFERENCES threads (id), + CONSTRAINT comments_comment_types_id_fkey FOREIGN KEY (comment_types_id) REFERENCES comment_types (id), + CONSTRAINT comments_user_id_fkey FOREIGN KEY (user_id) REFERENCES users (id) +); + +-- migrate:down +DROP TABLE IF EXISTS comments; diff --git a/db/migrations/20230908121654_create_exercises_table.sql b/db/migrations/20230908121654_create_exercises_table.sql new file mode 100644 index 0000000..54c54fc --- /dev/null +++ b/db/migrations/20230908121654_create_exercises_table.sql @@ -0,0 +1,16 @@ +-- migrate:up +CREATE TABLE exercises ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + member_id INT NOT NULL, + trainer_id INT NOT NULL, + name VARCHAR(50) NOT NULL, + description VARCHAR(500) NOT NULL, + image_url VARCHAR(200) NOT NULL, + weekday VARCHAR(50) NOT NULL, + checkbox BOOLEAN NOT NULL DEFAULT false, + CONSTRAINT exercises_member_id_fkey FOREIGN KEY (member_id) REFERENCES users (id), + CONSTRAINT exercises_trainer_id_fkey FOREIGN KEY (trainer_id) REFERENCES users (id) +); + +-- migrate:down +DROP TABLE IF EXISTS exercises; diff --git a/db/migrations/20230908121704_create_diets_table.sql b/db/migrations/20230908121704_create_diets_table.sql new file mode 100644 index 0000000..a007dbc --- /dev/null +++ b/db/migrations/20230908121704_create_diets_table.sql @@ -0,0 +1,14 @@ +-- migrate:up +CREATE TABLE diets ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + member_id INT NOT NULL, + trainer_id INT NOT NULL, + name VARCHAR(50) NOT NULL, + description VARCHAR(500) NOT NULL, + weekday VARCHAR(50) NOT NULL, + CONSTRAINT diets_trainer_id_fkey FOREIGN KEY (trainer_id) REFERENCES users (id), + CONSTRAINT diets_member_id_fkey FOREIGN KEY (member_id) REFERENCES users (id) +); + +-- migrate:down +DROP TABLE IF EXISTS diets; diff --git a/db/migrations/20230908121713_create_diet_images_table.sql b/db/migrations/20230908121713_create_diet_images_table.sql new file mode 100644 index 0000000..d968835 --- /dev/null +++ b/db/migrations/20230908121713_create_diet_images_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE diet_images ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + diet_id INT NOT NULL, + image_url VARCHAR(200) NOT NULL, + CONSTRAINT diet_images_diet_id_fkey FOREIGN KEY (diet_id) REFERENCES diets (id) +); + +-- migrate:down +DROP TABLE IF EXISTS diet_images; From c703b0b750d29258689371639abb8aa259d7b885 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Mon, 11 Sep 2023 14:09:55 +0900 Subject: [PATCH 02/54] FIX : db --- db/migrations/20230911042714_modify_users_table.sql | 6 ++++++ .../20230911064915_modify_member_profiles_table.sql | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 db/migrations/20230911042714_modify_users_table.sql create mode 100644 db/migrations/20230911064915_modify_member_profiles_table.sql diff --git a/db/migrations/20230911042714_modify_users_table.sql b/db/migrations/20230911042714_modify_users_table.sql new file mode 100644 index 0000000..611a53c --- /dev/null +++ b/db/migrations/20230911042714_modify_users_table.sql @@ -0,0 +1,6 @@ +-- migrate:up +ALTER TABLE users MODIFY password VARCHAR(100) NULL; +ALTER TABLE users ADD UNIQUE (nickname); + +-- migrate:down +ALTER TABLE users MODIFY password VARCHAR(100) NOT NULL; \ No newline at end of file diff --git a/db/migrations/20230911064915_modify_member_profiles_table.sql b/db/migrations/20230911064915_modify_member_profiles_table.sql new file mode 100644 index 0000000..f2e942f --- /dev/null +++ b/db/migrations/20230911064915_modify_member_profiles_table.sql @@ -0,0 +1,5 @@ +-- migrate:up +ALTER TABLE member_profiles MODIFY point decimal(10,2) DEFAULT 1000000.00; + +-- migrate:down + From 8edda89f379957e0f1a7504d831f9316fb39bde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Tue, 12 Sep 2023 21:15:22 +0900 Subject: [PATCH 03/54] modify: member_grade_id in the member_profiles table to have an initial value --- .../20230912120900_modify_member_profiles_table.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrations/20230912120900_modify_member_profiles_table.sql diff --git a/db/migrations/20230912120900_modify_member_profiles_table.sql b/db/migrations/20230912120900_modify_member_profiles_table.sql new file mode 100644 index 0000000..40aac91 --- /dev/null +++ b/db/migrations/20230912120900_modify_member_profiles_table.sql @@ -0,0 +1,6 @@ +-- migrate:up +ALTER TABLE member_profiles MODIFY COLUMN member_grade_id int DEFAULT 1 NOT NULL; + + +-- migrate:down + From 85b4d810da02d8ec1a84ec4fbc2699adaaece631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Tue, 12 Sep 2023 13:25:59 +0900 Subject: [PATCH 04/54] feat: Social sign in and token authentication --- .env.sample | 8 +- api/controllers/userController.js | 25 ++++++ api/models/userDao.js | 57 +++++++++++++ api/routes/index.js | 9 ++- api/routes/userRouter.js | 8 ++ api/services/userService.js | 68 ++++++++++++++++ api/utils/auth.js | 30 +++++++ package-lock.json | 129 ++++++++++++++++++++++++++++++ package.json | 2 + 9 files changed, 332 insertions(+), 4 deletions(-) diff --git a/.env.sample b/.env.sample index 7254a70..364b9cb 100644 --- a/.env.sample +++ b/.env.sample @@ -7,4 +7,10 @@ DB_USERNAME=username DB_PASSWORD=password DB_DATABASE=database -PORT=3000 \ No newline at end of file +PORT=3000 + +JWT_SECRET = JWT_SECRET +JWT_ALGORITHM = "JWT_ALGORITHM" + +CLIENT_ID = CLIENT_ID +REDIRECT_URI = REDIRECT_URI \ No newline at end of file diff --git a/api/controllers/userController.js b/api/controllers/userController.js index e69de29..5faaab8 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -0,0 +1,25 @@ +const userService = require('../services/userService'); + +const kakaoSignIn = async (req, res) => { + try { + const authCode = await req.query.code; + const { nickname, height, weight } = await req.body; + const accessToken = await userService.getToken(authCode); + const userInformation = await userService.getUserInformation(accessToken); + const { email, birthyear, birthday, gender } = await userInformation; + const age = await userService.calculateAge(birthyear, birthday); + const token = await userService.kakaoSignIn( + email, + gender, + age, + nickname, + height, + weight + ); + await res.json({ authorization: token, message: 'SIGN IN COMPLETED' }); + } catch (err) { + res.json({ message: 'SIGN IN FAILED' }); + } +}; + +module.exports = { kakaoSignIn }; diff --git a/api/models/userDao.js b/api/models/userDao.js index e69de29..3ced925 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -0,0 +1,57 @@ +const { dataSource } = require('./dataSource'); +const getUserByEmail = async (email) => { + try { + const user = await dataSource.query( + ` + SELECT + u.email, + u.nickname, + u.profile_image, + mp.user_id, + mp.member_grade_id, + mp.height, + mp.weight, + mp.age, + mp.gender, + mp.point, + um.membership_id, + um.start_date, + um.end_date + FROM USERS u + LEFT JOIN member_profiles mp ON u.id = mp.user_id + LEFT JOIN users_memberships um ON u.id = um.user_id + WHERE u.email = ?; + `, + [email] + ); + return user; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const createUsers = async (email, gender, age, nickname, height, weight) => { + try { + createUserResult = await dataSource.query( + `INSERT INTO users (email, nickname) + VALUES (?, ?)`, + [email, nickname] + ); + const userId = await createUserResult.insertId; + await dataSource.query( + `INSERT INTO member_profiles (user_id, gender, age, height, weight) + VALUES (?, ?, ?, ?, ?)`, + [userId, gender, age, height, weight] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +module.exports = { getUserByEmail, createUsers }; diff --git a/api/routes/index.js b/api/routes/index.js index 64d9a8f..f4bc88c 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,5 +1,8 @@ -const express = require('express') +const express = require('express'); +const { userRouter } = require('./userRouter'); -const router = express.Router() +const router = express.Router(); -module.exports = { router } +router.use('/user', userRouter); + +module.exports = { router }; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index e69de29..0f883e6 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -0,0 +1,8 @@ +const express = require('express'); +const userController = require('../controllers/userController'); + +const userRouter = express.Router(); + +userRouter.post('/kakaoSignIn', userController.kakaoSignIn); + +module.exports = { userRouter }; diff --git a/api/services/userService.js b/api/services/userService.js index e69de29..f9f6e91 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -0,0 +1,68 @@ +const userDao = require('../models/userDao'); +const jwt = require('jsonwebtoken'); +const axios = require('axios'); + +const getToken = async (authCode) => { + const response = await axios.post( + `https://kauth.kakao.com/oauth/token?grant_type=${process.env.GRANT_TYPE}&code=${authCode}&redirect_uri=${process.env.REDIRECT_URI}&client_id=${process.env.CLIENT_ID}` + ); + const accessToken = await response.data.access_token; + return accessToken; +}; + +const getUserInformation = async (accessToken) => { + const response = await axios.get(`https://kapi.kakao.com/v2/user/me`, { + headers: { Authorization: `Bearer ${accessToken}` }, + }); + const userInformation = await response.data.kakao_account; + return userInformation; +}; + +const calculateAge = async (birthyear, birthday) => { + const today = new Date(); + const birthMonth = birthday.slice(0, 2); + const birthDate = birthday.slice(2, 4); + const age = + (birthMonth - today.getMonth >= 0) & (birthDate - today.getDate() >= 0) + ? today.getFullYear() - birthyear + : today.getFullYear() - birthyear - 1; + return age; +}; + +const getUserByEmail = async (email) => { + const [user] = await userDao.getUserByEmail(email); + return user; +}; + +const kakaoSignIn = async (email, gender, age, nickname, height, weight) => { + const user = await getUserByEmail(email); + if (user) { + const token = jwt.sign( + { kakaoEmail: await user.email }, + process.env.JWT_SECRET, + { + algorithm: process.env.JWT_ALGORITHM, + } + ); + return token; + } else { + await userDao.createUsers(email, gender, age, nickname, height, weight); + const [createdUser] = await userDao.getUserByEmail(email); + const token = jwt.sign( + { kakaoEmail: await createdUser.email }, + process.env.JWT_SECRET, + { + algorithm: process.env.JWT_ALGORITHM, + } + ); + return token; + } +}; + +module.exports = { + getToken, + getUserInformation, + calculateAge, + getUserByEmail, + kakaoSignIn, +}; diff --git a/api/utils/auth.js b/api/utils/auth.js index e69de29..017654f 100644 --- a/api/utils/auth.js +++ b/api/utils/auth.js @@ -0,0 +1,30 @@ +const jwt = require('jsonwebtoken'); +const userService = require('../services/userService'); + +const loginRequired = async (req, res, next) => { + try { + const accessToken = req.headers.authorization; + if (!accessToken) { + const error = new Error('NEED_ACCESS_TOKEN'); + error.statusCode = 401; + return res.status(error.statusCode).json({ message: error.message }); + } + + const payload = await jwt.verify(accessToken, process.env.JWT_SECRET); + const user = await userService.getUserByEmail(payload['kakaoEmail']); + + if (!user) { + const error = new Error('USER_DOES_NOT_EXIST'); + error.statusCode = 404; + return res.status(error.statusCode).json({ message: error.message }); + } + + req.user = user; + next(); + } catch { + const error = new Error('INVALID_ACCESS_TOKEN'); + error.statusCode = 401; + return res.status(error.statusCode).json({ message: error.message }); + } +}; +module.exports = { loginRequired }; diff --git a/package-lock.json b/package-lock.json index 2b61366..7f3db3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,13 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "axios": "^1.5.0", "cors": "^2.8.5", "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", "jest": "^29.6.4", + "jsonwebtoken": "^9.0.2", "mysql2": "^3.6.0", "supertest": "^6.3.3", "typeorm": "^0.3.17" @@ -1286,6 +1288,16 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/babel-jest": { "version": "29.6.4", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", @@ -1556,6 +1568,11 @@ "ieee754": "^1.2.1" } }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==" + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -2039,6 +2056,14 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2307,6 +2332,25 @@ "node": ">=8" } }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -3432,6 +3476,51 @@ "node": ">=6" } }, + "node_modules/jsonwebtoken": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "^3.2.2", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/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==" + }, + "node_modules/jwa": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "^1.4.1", + "safe-buffer": "^5.0.1" + } + }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -3464,6 +3553,41 @@ "node": ">=8" } }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==" + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -4028,6 +4152,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/pstree.remy": { "version": "1.1.8", "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.8.tgz", diff --git a/package.json b/package.json index 894b40c..b45ec22 100644 --- a/package.json +++ b/package.json @@ -21,11 +21,13 @@ "semi": true }, "dependencies": { + "axios": "^1.5.0", "cors": "^2.8.5", "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", "jest": "^29.6.4", + "jsonwebtoken": "^9.0.2", "mysql2": "^3.6.0", "supertest": "^6.3.3", "typeorm": "^0.3.17" From 0b9e61441086edd5f76e7aa65bf2ffe84e749339 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Tue, 12 Sep 2023 23:48:39 +0900 Subject: [PATCH 05/54] chore: Update db migrations --- ...2115652_modify_users_memberships_table.sql | 16 +++++++++++++ ...2133154_modify_users_memberships_table.sql | 7 ++++++ ...912134327_create_payments_method_table.sql | 8 +++++++ .../20230912135057_modify_payments_table.sql | 8 +++++++ ...12141417_modify_trainer_profiles_table.sql | 9 ++++++++ ...912142017_create_trainer_careers_table.sql | 10 ++++++++ ...12142027_create_trainer_licenses_table.sql | 10 ++++++++ ...0912142037_create_trainer_awards_table.sql | 10 ++++++++ ...3070328_rename_users_memberships_table.sql | 6 +++++ ...71145_modify_members_memberships_table.sql | 23 +++++++++++++++++++ 10 files changed, 107 insertions(+) create mode 100644 db/migrations/20230912115652_modify_users_memberships_table.sql create mode 100644 db/migrations/20230912133154_modify_users_memberships_table.sql create mode 100644 db/migrations/20230912134327_create_payments_method_table.sql create mode 100644 db/migrations/20230912135057_modify_payments_table.sql create mode 100644 db/migrations/20230912141417_modify_trainer_profiles_table.sql create mode 100644 db/migrations/20230912142017_create_trainer_careers_table.sql create mode 100644 db/migrations/20230912142027_create_trainer_licenses_table.sql create mode 100644 db/migrations/20230912142037_create_trainer_awards_table.sql create mode 100644 db/migrations/20230913070328_rename_users_memberships_table.sql create mode 100644 db/migrations/20230913071145_modify_members_memberships_table.sql diff --git a/db/migrations/20230912115652_modify_users_memberships_table.sql b/db/migrations/20230912115652_modify_users_memberships_table.sql new file mode 100644 index 0000000..9e640e4 --- /dev/null +++ b/db/migrations/20230912115652_modify_users_memberships_table.sql @@ -0,0 +1,16 @@ +-- migrate:up +ALTER TABLE users_memberships ADD trainer_id INT DEFAULT NULL AFTER membership_id; +ALTER TABLE users_memberships ADD CONSTRAINT users_memberships_trainer_id_fkey +FOREIGN KEY (trainer_id) REFERENCES users (id); + +ALTER TABLE users_memberships DROP FOREIGN KEY users_memberships_user_id_fkey; +ALTER TABLE users_memberships CHANGE user_id member_id INT NOT NULL; +ALTER TABLE users_memberships ADD CONSTRAINT users_memberships_member_id_fkey +FOREIGN KEY (member_id) REFERENCES users (id); + +-- migrate:down +ALTER TABLE users_memberships DROP FOREIGN KEY users_memberships_member_id_fkey; +ALTER TABLE users_memberships CHANGE member_id user_id INT; + +ALTER TABLE users_memberships DROP FOREIGN KEY users_memberships_trainer_id_fkey; +ALTER TABLE users_memberships DROP trainer_id; \ No newline at end of file diff --git a/db/migrations/20230912133154_modify_users_memberships_table.sql b/db/migrations/20230912133154_modify_users_memberships_table.sql new file mode 100644 index 0000000..0f50229 --- /dev/null +++ b/db/migrations/20230912133154_modify_users_memberships_table.sql @@ -0,0 +1,7 @@ +-- migrate:up +ALTER TABLE users_memberships MODIFY start_date DATE NULL; +ALTER TABLE users_memberships MODIFY end_date DATE NULL; + +-- migrate:down +ALTER TABLE users_memberships MODIFY end_date DATE NOT NULL; +ALTER TABLE users_memberships MODIFY start_date DATE NOT NULL; diff --git a/db/migrations/20230912134327_create_payments_method_table.sql b/db/migrations/20230912134327_create_payments_method_table.sql new file mode 100644 index 0000000..1849832 --- /dev/null +++ b/db/migrations/20230912134327_create_payments_method_table.sql @@ -0,0 +1,8 @@ +-- migrate:up +CREATE TABLE payments_method ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + method VARCHAR(100) NOT NULL +); + +-- migrate:down +DROP TABLE IF EXISTS payments_method; diff --git a/db/migrations/20230912135057_modify_payments_table.sql b/db/migrations/20230912135057_modify_payments_table.sql new file mode 100644 index 0000000..479222a --- /dev/null +++ b/db/migrations/20230912135057_modify_payments_table.sql @@ -0,0 +1,8 @@ +-- migrate:up +ALTER TABLE payments ADD payments_method_id INT NOT NULL AFTER membership_id; +ALTER TABLE payments ADD CONSTRAINT payments_payments_method_id_fkey +FOREIGN KEY (payments_method_id) REFERENCES payments_method (id); + +-- migrate:down +ALTER TABLE payments DROP FOREIGN KEY payments_payments_method_id_fkey; +ALTER TABLE payments DROP payments_method_id; diff --git a/db/migrations/20230912141417_modify_trainer_profiles_table.sql b/db/migrations/20230912141417_modify_trainer_profiles_table.sql new file mode 100644 index 0000000..9444c90 --- /dev/null +++ b/db/migrations/20230912141417_modify_trainer_profiles_table.sql @@ -0,0 +1,9 @@ +-- migrate:up +ALTER TABLE trainer_profiles DROP career; +ALTER TABLE trainer_profiles DROP license; +ALTER TABLE trainer_profiles DROP awards; + +-- migrate:down +ALTER TABLE trainer_profiles ADD award VARCHAR(500) DEFAULT NULL; +ALTER TABLE trainer_profiles ADD license VARCHAR(500) NOT NULL; +ALTER TABLE trainer_profiles ADD career VARCHAR(500) NOT NULL; diff --git a/db/migrations/20230912142017_create_trainer_careers_table.sql b/db/migrations/20230912142017_create_trainer_careers_table.sql new file mode 100644 index 0000000..35e29d9 --- /dev/null +++ b/db/migrations/20230912142017_create_trainer_careers_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE trainer_careers ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + trainer_profile_id INT NOT NULL, + content VARCHAR(500) NOT NULL, + CONSTRAINT trainer_careers_trainer_profile_id_fkey FOREIGN KEY (trainer_profile_id) REFERENCES trainer_profiles (id) +); + +-- migrate:down +DROP TABLE IF EXISTS trainer_careers; diff --git a/db/migrations/20230912142027_create_trainer_licenses_table.sql b/db/migrations/20230912142027_create_trainer_licenses_table.sql new file mode 100644 index 0000000..c86bab4 --- /dev/null +++ b/db/migrations/20230912142027_create_trainer_licenses_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE trainer_licenses ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + trainer_profile_id INT NOT NULL, + content VARCHAR(500) NOT NULL, + CONSTRAINT trainer_licenses_trainer_profile_id_fkey FOREIGN KEY (trainer_profile_id) REFERENCES trainer_profiles (id) +); + +-- migrate:down +DROP TABLE IF EXISTS trainer_licenses; diff --git a/db/migrations/20230912142037_create_trainer_awards_table.sql b/db/migrations/20230912142037_create_trainer_awards_table.sql new file mode 100644 index 0000000..d0121c8 --- /dev/null +++ b/db/migrations/20230912142037_create_trainer_awards_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE trainer_awards ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + trainer_profile_id INT NOT NULL, + content VARCHAR(500) NOT NULL, + CONSTRAINT trainer_awards_trainer_profile_id_fkey FOREIGN KEY (trainer_profile_id) REFERENCES trainer_profiles (id) +); + +-- migrate:down +DROP TABLE IF EXISTS trainer_awards; diff --git a/db/migrations/20230913070328_rename_users_memberships_table.sql b/db/migrations/20230913070328_rename_users_memberships_table.sql new file mode 100644 index 0000000..768c483 --- /dev/null +++ b/db/migrations/20230913070328_rename_users_memberships_table.sql @@ -0,0 +1,6 @@ +-- migrate:up +RENAME TABLE users_memberships TO members_memberships; + +-- migrate:down +RENAME TABLE members_memberships TO users_memberships; + diff --git a/db/migrations/20230913071145_modify_members_memberships_table.sql b/db/migrations/20230913071145_modify_members_memberships_table.sql new file mode 100644 index 0000000..3fe856b --- /dev/null +++ b/db/migrations/20230913071145_modify_members_memberships_table.sql @@ -0,0 +1,23 @@ +-- migrate:up +ALTER TABLE members_memberships DROP FOREIGN KEY users_memberships_member_id_fkey; +ALTER TABLE members_memberships DROP FOREIGN KEY users_memberships_membership_id_fkey; +ALTER TABLE members_memberships DROP FOREIGN KEY users_memberships_trainer_id_fkey; + +ALTER TABLE members_memberships ADD CONSTRAINT members_memberships_member_id_fkey +FOREIGN KEY (member_id) REFERENCES users (id); +ALTER TABLE members_memberships ADD CONSTRAINT members_memberships_membership_id_fkey +FOREIGN KEY (membership_id) REFERENCES memberships (id); +ALTER TABLE members_memberships ADD CONSTRAINT members_memberships_trainer_id_fkey +FOREIGN KEY (trainer_id) REFERENCES users (id); + +-- migrate:down +ALTER TABLE members_memberships DROP FOREIGN KEY members_memberships_member_id_fkey; +ALTER TABLE members_memberships DROP FOREIGN KEY members_memberships_membership_id_fkey; +ALTER TABLE members_memberships DROP FOREIGN KEY members_memberships_trainer_id_fkey; + +ALTER TABLE members_memberships ADD CONSTRAINT users_memberships_member_id_fkey +FOREIGN KEY (member_id) REFERENCES users (id); +ALTER TABLE members_memberships ADD CONSTRAINT users_memberships_membership_id_fkey +FOREIGN KEY (membership_id) REFERENCES memberships (id); +ALTER TABLE members_memberships ADD CONSTRAINT users_memberships_trainer_id_fkey +FOREIGN KEY (trainer_id) REFERENCES users (id); From 14eafd4701fbf99dd7af330596e79da403e18c9d Mon Sep 17 00:00:00 2001 From: suyeongs Date: Tue, 12 Sep 2023 20:46:10 +0900 Subject: [PATCH 06/54] feat: Add API for getting trainer list without unit test code --- api/controllers/trainerController.js | 14 +++++++ api/models/trainerDao.js | 57 ++++++++++++++++++++++++++++ api/routes/index.js | 2 + api/routes/trainerRouter.js | 9 +++++ api/services/trainerService.js | 7 ++++ 5 files changed, 89 insertions(+) create mode 100644 api/controllers/trainerController.js create mode 100644 api/models/trainerDao.js create mode 100644 api/routes/trainerRouter.js create mode 100644 api/services/trainerService.js diff --git a/api/controllers/trainerController.js b/api/controllers/trainerController.js new file mode 100644 index 0000000..4c8faac --- /dev/null +++ b/api/controllers/trainerController.js @@ -0,0 +1,14 @@ +const trainerService = require('../services/trainerService'); +const { catchAsync } = require('../utils/error'); + +const getTrainerList = catchAsync(async (req, res) => { + const { page = 1, limit = 5 } = req.query; + const pageSize = parseInt(limit); + const offset = (page - 1) * pageSize; + + const trainerList = await trainerService.getTrainerList(offset, pageSize); + + res.status(200).json({ data: trainerList }); +}); + +module.exports = { getTrainerList }; diff --git a/api/models/trainerDao.js b/api/models/trainerDao.js new file mode 100644 index 0000000..e5306bf --- /dev/null +++ b/api/models/trainerDao.js @@ -0,0 +1,57 @@ +const { dataSource } = require('./dataSource'); + +const getTrainerList = async (offset, pageSize) => { + try { + const data = await dataSource.query( + ` + SELECT + u.id, + tg.emoji, + u.nickname nickName, + u.profile_image profileImage, + tp.score, + ( + SELECT + JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT tc.content + FROM trainer_careers tc + WHERE tc.trainer_profile_id = tp.id + ) AS careerSub + ) career, + ( + SELECT + JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT tl.content + FROM trainer_licenses tl + WHERE tl.trainer_profile_id = tp.id + ) AS licenseSub + ) license, + ( + SELECT + JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT ta.content + FROM trainer_awards ta + WHERE ta.trainer_profile_id = tp.id + ) AS awardSub + ) awards + FROM users u + INNER JOIN trainer_profiles tp ON u.id = tp.user_id + INNER JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id + ORDER BY tp.score DESC, u.created_at DESC + LIMIT ?, ?; + `, + [offset, pageSize] + ); + return data; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +module.exports = { getTrainerList }; diff --git a/api/routes/index.js b/api/routes/index.js index f4bc88c..503affe 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,8 +1,10 @@ const express = require('express'); const { userRouter } = require('./userRouter'); +const { trainerRouter } = require('./trainerRouter'); const router = express.Router(); router.use('/user', userRouter); +router.use('/trainers', trainerRouter); module.exports = { router }; diff --git a/api/routes/trainerRouter.js b/api/routes/trainerRouter.js new file mode 100644 index 0000000..6da2ded --- /dev/null +++ b/api/routes/trainerRouter.js @@ -0,0 +1,9 @@ +const express = require('express'); + +const trainerController = require('../controllers/trainerController'); + +const trainerRouter = express.Router(); + +trainerRouter.get('/list', trainerController.getTrainerList); + +module.exports = { trainerRouter }; diff --git a/api/services/trainerService.js b/api/services/trainerService.js new file mode 100644 index 0000000..6b87338 --- /dev/null +++ b/api/services/trainerService.js @@ -0,0 +1,7 @@ +const trainerDao = require('../models/trainerDao'); + +const getTrainerList = async (offset, pageSize) => { + return await trainerDao.getTrainerList(offset, pageSize); +}; + +module.exports = { getTrainerList }; From 25315c1df6ea8f21dbb98e7b3bdefa0d84f0f605 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Thu, 14 Sep 2023 17:47:54 +0900 Subject: [PATCH 07/54] feat: Add API for getting trainer list without unit test code --- api/models/trainerDao.js | 1 + 1 file changed, 1 insertion(+) diff --git a/api/models/trainerDao.js b/api/models/trainerDao.js index e5306bf..f596743 100644 --- a/api/models/trainerDao.js +++ b/api/models/trainerDao.js @@ -7,6 +7,7 @@ const getTrainerList = async (offset, pageSize) => { SELECT u.id, tg.emoji, + tg.name emojiName, u.nickname nickName, u.profile_image profileImage, tp.score, From 3ffcd2b1dfeaf96b36e19af88c0350c25a5ff27a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Thu, 14 Sep 2023 15:19:43 +0900 Subject: [PATCH 08/54] management membershipstart, getManagement --- api/controllers/managementController.js | 22 +++++ api/models/managementDao.js | 117 ++++++++++++++++++++++++ api/routes/index.js | 2 + api/routes/managementRouter.js | 14 +++ api/services/managementService.js | 33 +++++++ 5 files changed, 188 insertions(+) diff --git a/api/controllers/managementController.js b/api/controllers/managementController.js index e69de29..93460fd 100644 --- a/api/controllers/managementController.js +++ b/api/controllers/managementController.js @@ -0,0 +1,22 @@ +const managementService = require('../services/managementService'); +const { catchAsync } = require('../utils/error'); +const { addDays, format } = require('date-fns'); + +const getManagement = catchAsync(async (req, res) => { + const { userId, weekday } = req.query; + const membership = await managementService.getManagement(userId, weekday); + res.json(membership); +}); + +const membershipStart = catchAsync(async (req, res) => { + const { userId, startDate } = req.body; + + const startDateObject = new Date(startDate); + const after30Days = addDays(startDateObject, 30); + const endDate = format(after30Days, 'yyyy-MM-dd'); + + await managementService.membershipStart(userId, startDate, endDate); + res.status(200).json({ message: 'SUCCESS' }); +}); + +module.exports = { getManagement, membershipStart }; diff --git a/api/models/managementDao.js b/api/models/managementDao.js index e69de29..57fb547 100644 --- a/api/models/managementDao.js +++ b/api/models/managementDao.js @@ -0,0 +1,117 @@ +const { dataSource } = require('./dataSource'); + +const getMembershipByUser = async (userId) => { + try { + const membership = await dataSource.query( + ` + SELECT + m.name as membershipName, + u.start_date as startDate, + u.end_date as endDate + FROM members_memberships u + JOIN memberships m + ON m.id = u.membership_id + WHERE member_id = ?; + `, + [userId] + ); + return membership; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const getExerciseList = async (memberId, weekday) => { + try { + const exerciseList = await dataSource.query( + ` + SELECT + id as exerciseId, + name as exerciseName, + description as exerciseDescription, + image_url as exerciseImageUrl, + checkbox as exerciseCheckbox + FROM exercises + WHERE member_id = ? + AND weekday = ?; + `, + [memberId, weekday] + ); + return exerciseList; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const getDietList = async (memberId, weekday) => { + try { + const dietList = await dataSource.query( + ` + SELECT + id as dietId, + name as dietName, + description as dietDescription + FROM diets + WHERE member_id = ? + AND weekday = ?; + `, + [memberId, weekday] + ); + return dietList; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const membershipStart = async (startDate, endDate, membershipId, userId) => { + try { + const result = await dataSource.query( + ` + UPDATE members_memberships + SET start_date = ?, + end_date = ? + WHERE membership_id = ? + AND member_id = ?; + + `, + [startDate, endDate, membershipId, userId] + ); + return result; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const getMembershipIdByUser = async (userId) => { + try { + const membershipId = await dataSource.query( + ` + SELECT membership_id + FROM members_memberships + WHERE member_id = ?; + `, + [userId] + ); + return membershipId; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +module.exports = { + getExerciseList, + getDietList, + getMembershipByUser, + membershipStart, + getMembershipIdByUser, +}; diff --git a/api/routes/index.js b/api/routes/index.js index 503affe..c83ee91 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,10 +1,12 @@ const express = require('express'); const { userRouter } = require('./userRouter'); const { trainerRouter } = require('./trainerRouter'); +const { managementRouter } = require('./managementRouter'); const router = express.Router(); router.use('/user', userRouter); router.use('/trainers', trainerRouter); +router.use('/custom', managementRouter); module.exports = { router }; diff --git a/api/routes/managementRouter.js b/api/routes/managementRouter.js index e69de29..c12b0dc 100644 --- a/api/routes/managementRouter.js +++ b/api/routes/managementRouter.js @@ -0,0 +1,14 @@ +const express = require('express'); +const managementRouter = express.Router(); + +const managementController = require('../controllers/managementController'); +const { loginRequired } = require('../utils/auth'); + +managementRouter.get('', loginRequired, managementController.getManagement); +managementRouter.post( + '/start', + loginRequired, + managementController.membershipStart +); + +module.exports = { managementRouter }; diff --git a/api/services/managementService.js b/api/services/managementService.js index e69de29..c49a7d7 100644 --- a/api/services/managementService.js +++ b/api/services/managementService.js @@ -0,0 +1,33 @@ +const managementDao = require('../models/managementDao'); + +const getManagement = async (userId, weekday) => { + const membership = await managementDao.getMembershipByUser(userId); + const exercise = await managementDao.getExerciseList(userId, weekday); + const diet = managementDao.getDietList(userId, weekday); + + const [membershipResult, exerciseResult, dietResult] = await Promise.all([ + membership, + exercise, + diet, + ]); + + return { + membership: membershipResult, + exercise: exerciseResult, + diet: dietResult, + }; +}; + +const membershipStart = async (userId, startDate, endDate) => { + const membershipIds = await managementDao.getMembershipIdByUser(userId); + const membershipId = membershipIds[0].membership_id; + + return await managementDao.membershipStart( + startDate, + endDate, + membershipId, + userId + ); +}; + +module.exports = { getManagement, membershipStart }; From f2c0593f751ea2d77b6eab3f0f0deca01e7193b1 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Fri, 15 Sep 2023 14:40:48 +0900 Subject: [PATCH 09/54] add: modify threads table --- db/migrations/20230915053736_modify.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 db/migrations/20230915053736_modify.sql diff --git a/db/migrations/20230915053736_modify.sql b/db/migrations/20230915053736_modify.sql new file mode 100644 index 0000000..fcfebf6 --- /dev/null +++ b/db/migrations/20230915053736_modify.sql @@ -0,0 +1,7 @@ +-- migrate:up +ALTER TABLE threads ADD trainer_profile_id INT NULL; +ALTER TABLE threads ADD FOREIGN KEY(trainer_profile_id) REFERENCES trainer_profiles(id); + +-- migrate:down + + From 732b845c3ab51c5a397b4d994eed421636c7b30f Mon Sep 17 00:00:00 2001 From: suyeongs Date: Fri, 15 Sep 2023 16:36:21 +0900 Subject: [PATCH 10/54] chore: Update db migrations --- .../20230915071653_create_membership_benefits_table.sql | 9 +++++++++ .../20230915072103_modify_memberships_table.sql | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 db/migrations/20230915071653_create_membership_benefits_table.sql create mode 100644 db/migrations/20230915072103_modify_memberships_table.sql diff --git a/db/migrations/20230915071653_create_membership_benefits_table.sql b/db/migrations/20230915071653_create_membership_benefits_table.sql new file mode 100644 index 0000000..575de8a --- /dev/null +++ b/db/migrations/20230915071653_create_membership_benefits_table.sql @@ -0,0 +1,9 @@ +-- migrate:up +CREATE TABLE membership_benefits ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + membership_id INT NOT NULL, + content VARCHAR(500) NOT NULL +); + +-- migrate:down +DROP TABLE IF EXISTS membership_benefits; diff --git a/db/migrations/20230915072103_modify_memberships_table.sql b/db/migrations/20230915072103_modify_memberships_table.sql new file mode 100644 index 0000000..b89b569 --- /dev/null +++ b/db/migrations/20230915072103_modify_memberships_table.sql @@ -0,0 +1,8 @@ +-- migrate:up +ALTER TABLE memberships ADD membership_benefit_id INT NOT NULL; +ALTER TABLE memberships ADD CONSTRAINT memberships_membership_benefit_id_fkey +FOREIGN KEY (membership_benefit_id) REFERENCES membership_benefits (id); + +-- migrate:down +ALTER TABLE memberships DROP FOREIGN KEY memberships_membership_benefit_id_fkey; +ALTER TABLE memberships DROP membership_benefit_id; \ No newline at end of file From cdb8f9645c263cc58d6bd7b74afdb855094effaa Mon Sep 17 00:00:00 2001 From: suyeongs <59385359+suyeongs@users.noreply.github.com> Date: Fri, 15 Sep 2023 17:11:18 +0900 Subject: [PATCH 11/54] Revert "chore: Update db migrations" This reverts commit 732b845c3ab51c5a397b4d994eed421636c7b30f. --- .../20230915071653_create_membership_benefits_table.sql | 9 --------- .../20230915072103_modify_memberships_table.sql | 8 -------- 2 files changed, 17 deletions(-) delete mode 100644 db/migrations/20230915071653_create_membership_benefits_table.sql delete mode 100644 db/migrations/20230915072103_modify_memberships_table.sql diff --git a/db/migrations/20230915071653_create_membership_benefits_table.sql b/db/migrations/20230915071653_create_membership_benefits_table.sql deleted file mode 100644 index 575de8a..0000000 --- a/db/migrations/20230915071653_create_membership_benefits_table.sql +++ /dev/null @@ -1,9 +0,0 @@ --- migrate:up -CREATE TABLE membership_benefits ( - id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, - membership_id INT NOT NULL, - content VARCHAR(500) NOT NULL -); - --- migrate:down -DROP TABLE IF EXISTS membership_benefits; diff --git a/db/migrations/20230915072103_modify_memberships_table.sql b/db/migrations/20230915072103_modify_memberships_table.sql deleted file mode 100644 index b89b569..0000000 --- a/db/migrations/20230915072103_modify_memberships_table.sql +++ /dev/null @@ -1,8 +0,0 @@ --- migrate:up -ALTER TABLE memberships ADD membership_benefit_id INT NOT NULL; -ALTER TABLE memberships ADD CONSTRAINT memberships_membership_benefit_id_fkey -FOREIGN KEY (membership_benefit_id) REFERENCES membership_benefits (id); - --- migrate:down -ALTER TABLE memberships DROP FOREIGN KEY memberships_membership_benefit_id_fkey; -ALTER TABLE memberships DROP membership_benefit_id; \ No newline at end of file From adc74ee156f31070e6470cc3927d0e51316e68f7 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Fri, 15 Sep 2023 18:00:56 +0900 Subject: [PATCH 12/54] chore: Update db migrations --- ...ify.sql => 20230915053736_modify_threads_table.sql} | 0 ...20230915071653_create_membership_benefits_table.sql | 10 ++++++++++ 2 files changed, 10 insertions(+) rename db/migrations/{20230915053736_modify.sql => 20230915053736_modify_threads_table.sql} (100%) create mode 100644 db/migrations/20230915071653_create_membership_benefits_table.sql diff --git a/db/migrations/20230915053736_modify.sql b/db/migrations/20230915053736_modify_threads_table.sql similarity index 100% rename from db/migrations/20230915053736_modify.sql rename to db/migrations/20230915053736_modify_threads_table.sql diff --git a/db/migrations/20230915071653_create_membership_benefits_table.sql b/db/migrations/20230915071653_create_membership_benefits_table.sql new file mode 100644 index 0000000..3441731 --- /dev/null +++ b/db/migrations/20230915071653_create_membership_benefits_table.sql @@ -0,0 +1,10 @@ +-- migrate:up +CREATE TABLE membership_benefits ( + id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, + membership_id INT NOT NULL, + content VARCHAR(500) NOT NULL, + CONSTRAINT membership_benefits_membership_id_fkey FOREIGN KEY (membership_id) REFERENCES memberships (id) +); + +-- migrate:down +DROP TABLE IF EXISTS membership_benefits; \ No newline at end of file From af5c997910367406d9e42dd1e26077eeba65eb83 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Fri, 15 Sep 2023 21:09:22 +0900 Subject: [PATCH 13/54] add : modify threads table column name is title NOT NULL to NULL --- db/migrations/20230915114319_modify_threads_table.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 db/migrations/20230915114319_modify_threads_table.sql diff --git a/db/migrations/20230915114319_modify_threads_table.sql b/db/migrations/20230915114319_modify_threads_table.sql new file mode 100644 index 0000000..613b2b9 --- /dev/null +++ b/db/migrations/20230915114319_modify_threads_table.sql @@ -0,0 +1,6 @@ +-- migrate:up +ALTER TABLE threads MODIFY title NULL; + +-- migrate:down +ALTER TABLE threads MODIFY title NOT NULL; + From df4475e0e7c9d8c3721592789f2c5585a2f62f4c Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Wed, 13 Sep 2023 20:20:38 +0900 Subject: [PATCH 14/54] add : post consultant 2 --- api/controllers/consultantController.js | 14 +++++++++++++ api/models/consultantDao.js | 27 +++++++++++++++++++++++++ api/models/userDao.js | 23 +-------------------- api/routes/consultantRouter.js | 10 +++++++++ api/routes/index.js | 10 +++++++-- api/routes/userRouter.js | 2 +- api/services/consultantService.js | 7 +++++++ 7 files changed, 68 insertions(+), 25 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index e69de29..d48e6fa 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -0,0 +1,14 @@ +const consultantService = require("../services/consultantService"); +const { catchAsync } = require("../utils/error"); + +const createConsultant = catchAsync(async (req, res) => { + const { content, trainerId, threadTypesId = 3 } = await req.body; + + const userId = req.user.userId; + + const thread = await consultantService.createConsultThreads(userId, threadTypesId, content, trainerId); + + res.status(201).json({message : "success"}) + }); + +module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index e69de29..e14d894 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -0,0 +1,27 @@ +const {dataSource} = require("./dataSource"); + +const createConsultant = async (userId, threadTypesId, content, trainerProfileId) => { + try{ + await dataSource.query( + ` + INSERT INTO threads ( + user_id, + thread_types_id, + content, + trainer_profile_id + ) VALUES ( + ?, + ?, + ?, + ? + ) + `, + [userId, threadTypesId, content, trainerProfileId] + ) + }catch{ + const error = new Error("error"); + error.statusCode = 400; + throw error; + }}; + + module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/models/userDao.js b/api/models/userDao.js index 3ced925..5e96d89 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -33,25 +33,4 @@ const getUserByEmail = async (email) => { } }; -const createUsers = async (email, gender, age, nickname, height, weight) => { - try { - createUserResult = await dataSource.query( - `INSERT INTO users (email, nickname) - VALUES (?, ?)`, - [email, nickname] - ); - const userId = await createUserResult.insertId; - await dataSource.query( - `INSERT INTO member_profiles (user_id, gender, age, height, weight) - VALUES (?, ?, ?, ?, ?)`, - [userId, gender, age, height, weight] - ); - } catch (err) { - const error = new Error('dataSource Error'); - error.statusCode = 400; - - throw error; - } -}; - -module.exports = { getUserByEmail, createUsers }; +module.exports = { getUserByEmail}; diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index e69de29..de5b2f2 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -0,0 +1,10 @@ +const express = require("express"); + +const consultantController = require("../controllers/consultantController"); +const consultantRouter = express.Router(); + +const { loginRequired } = require("../utils/auth"); + +consultantRouter.post("/posts/upload", consultantController.createConsultant); + +module.exports = { consultantRouter }; \ No newline at end of file diff --git a/api/routes/index.js b/api/routes/index.js index c83ee91..9fe3adb 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,12 +1,18 @@ const express = require('express'); +const router = express.Router(); + const { userRouter } = require('./userRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); +const { consultantRouter } = require("./consultantRouter") -const router = express.Router(); router.use('/user', userRouter); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); +router.use("/consultant", consultantRouter); + + + -module.exports = { router }; +module.exports = { router } diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index 0f883e6..f4bb058 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -5,4 +5,4 @@ const userRouter = express.Router(); userRouter.post('/kakaoSignIn', userController.kakaoSignIn); -module.exports = { userRouter }; +module.exports = { userRouter }; \ No newline at end of file diff --git a/api/services/consultantService.js b/api/services/consultantService.js index e69de29..89bb1a6 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -0,0 +1,7 @@ +const consultantDao = require('../models/consultantDao'); + +const createConsultThreads = async (userId, threadTypesId, content, trainerId) => { + const result = await consultantDao.createConsultant(userId, threadTypesId, content, trainerId); + }; + +module.exports = { createConsultThreads }; \ No newline at end of file From 56aaf45ca5c22c7692d1aadf2ca84c6e3e68ea62 Mon Sep 17 00:00:00 2001 From: suyeongs <59385359+suyeongs@users.noreply.github.com> Date: Fri, 15 Sep 2023 23:08:08 +0900 Subject: [PATCH 15/54] Revert "add : post consultant 2" This reverts commit df4475e0e7c9d8c3721592789f2c5585a2f62f4c. --- api/controllers/consultantController.js | 14 ------------- api/models/consultantDao.js | 27 ------------------------- api/models/userDao.js | 23 ++++++++++++++++++++- api/routes/consultantRouter.js | 10 --------- api/routes/index.js | 10 ++------- api/routes/userRouter.js | 2 +- api/services/consultantService.js | 7 ------- 7 files changed, 25 insertions(+), 68 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index d48e6fa..e69de29 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -1,14 +0,0 @@ -const consultantService = require("../services/consultantService"); -const { catchAsync } = require("../utils/error"); - -const createConsultant = catchAsync(async (req, res) => { - const { content, trainerId, threadTypesId = 3 } = await req.body; - - const userId = req.user.userId; - - const thread = await consultantService.createConsultThreads(userId, threadTypesId, content, trainerId); - - res.status(201).json({message : "success"}) - }); - -module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index e14d894..e69de29 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -1,27 +0,0 @@ -const {dataSource} = require("./dataSource"); - -const createConsultant = async (userId, threadTypesId, content, trainerProfileId) => { - try{ - await dataSource.query( - ` - INSERT INTO threads ( - user_id, - thread_types_id, - content, - trainer_profile_id - ) VALUES ( - ?, - ?, - ?, - ? - ) - `, - [userId, threadTypesId, content, trainerProfileId] - ) - }catch{ - const error = new Error("error"); - error.statusCode = 400; - throw error; - }}; - - module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/models/userDao.js b/api/models/userDao.js index 5e96d89..3ced925 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -33,4 +33,25 @@ const getUserByEmail = async (email) => { } }; -module.exports = { getUserByEmail}; +const createUsers = async (email, gender, age, nickname, height, weight) => { + try { + createUserResult = await dataSource.query( + `INSERT INTO users (email, nickname) + VALUES (?, ?)`, + [email, nickname] + ); + const userId = await createUserResult.insertId; + await dataSource.query( + `INSERT INTO member_profiles (user_id, gender, age, height, weight) + VALUES (?, ?, ?, ?, ?)`, + [userId, gender, age, height, weight] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +module.exports = { getUserByEmail, createUsers }; diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index de5b2f2..e69de29 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -1,10 +0,0 @@ -const express = require("express"); - -const consultantController = require("../controllers/consultantController"); -const consultantRouter = express.Router(); - -const { loginRequired } = require("../utils/auth"); - -consultantRouter.post("/posts/upload", consultantController.createConsultant); - -module.exports = { consultantRouter }; \ No newline at end of file diff --git a/api/routes/index.js b/api/routes/index.js index 9fe3adb..c83ee91 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,18 +1,12 @@ const express = require('express'); -const router = express.Router(); - const { userRouter } = require('./userRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); -const { consultantRouter } = require("./consultantRouter") +const router = express.Router(); router.use('/user', userRouter); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); -router.use("/consultant", consultantRouter); - - - -module.exports = { router } +module.exports = { router }; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index f4bb058..0f883e6 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -5,4 +5,4 @@ const userRouter = express.Router(); userRouter.post('/kakaoSignIn', userController.kakaoSignIn); -module.exports = { userRouter }; \ No newline at end of file +module.exports = { userRouter }; diff --git a/api/services/consultantService.js b/api/services/consultantService.js index 89bb1a6..e69de29 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -1,7 +0,0 @@ -const consultantDao = require('../models/consultantDao'); - -const createConsultThreads = async (userId, threadTypesId, content, trainerId) => { - const result = await consultantDao.createConsultant(userId, threadTypesId, content, trainerId); - }; - -module.exports = { createConsultThreads }; \ No newline at end of file From 05262547cab6a27f023c6194e8980e1e71b4f4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Fri, 15 Sep 2023 22:55:20 +0900 Subject: [PATCH 16/54] modify: users, member_profiles table --- db/migrations/20230915135447_modify_users_table.sql | 6 ++++++ .../20230915135455_modify_member_profiles_table.sql | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 db/migrations/20230915135447_modify_users_table.sql create mode 100644 db/migrations/20230915135455_modify_member_profiles_table.sql diff --git a/db/migrations/20230915135447_modify_users_table.sql b/db/migrations/20230915135447_modify_users_table.sql new file mode 100644 index 0000000..834acfe --- /dev/null +++ b/db/migrations/20230915135447_modify_users_table.sql @@ -0,0 +1,6 @@ +-- migrate:up +ALTER TABLE users MODIFY COLUMN nickname varchar(100) NULL; + + +-- migrate:down + diff --git a/db/migrations/20230915135455_modify_member_profiles_table.sql b/db/migrations/20230915135455_modify_member_profiles_table.sql new file mode 100644 index 0000000..07d8ec0 --- /dev/null +++ b/db/migrations/20230915135455_modify_member_profiles_table.sql @@ -0,0 +1,7 @@ +-- migrate:up +ALTER TABLE member_profiles MODIFY COLUMN height INT NULL; +ALTER TABLE member_profiles MODIFY COLUMN weight INT NULL; + + +-- migrate:down + From 3ea5c1e36d50ba952d5bb2d6ba03f508ceee96fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Fri, 15 Sep 2023 17:10:37 +0900 Subject: [PATCH 17/54] modify: social sign in feature --- .env.sample | 4 +- api/controllers/userController.js | 105 +++++++++++++++++----- api/models/userDao.js | 141 +++++++++++++++++++++++++++--- api/routes/index.js | 2 +- api/routes/userRouter.js | 4 +- api/services/userService.js | 115 ++++++++++++++++-------- api/utils/auth.js | 7 +- api/utils/error.js | 16 ++-- 8 files changed, 311 insertions(+), 83 deletions(-) diff --git a/.env.sample b/.env.sample index 364b9cb..663d8fa 100644 --- a/.env.sample +++ b/.env.sample @@ -12,5 +12,7 @@ PORT=3000 JWT_SECRET = JWT_SECRET JWT_ALGORITHM = "JWT_ALGORITHM" +GRANT_TYPE = GRANT_TYPE CLIENT_ID = CLIENT_ID -REDIRECT_URI = REDIRECT_URI \ No newline at end of file +SIGN_IN_REDIRECT_URI = REDIRECT_URI +SIGN_UP_REDIRECT_URI = REDIRECT_URI \ No newline at end of file diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 5faaab8..7d3428a 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -1,25 +1,88 @@ const userService = require('../services/userService'); +const { catchAsync } = require('../utils/error'); -const kakaoSignIn = async (req, res) => { - try { - const authCode = await req.query.code; - const { nickname, height, weight } = await req.body; - const accessToken = await userService.getToken(authCode); - const userInformation = await userService.getUserInformation(accessToken); - const { email, birthyear, birthday, gender } = await userInformation; - const age = await userService.calculateAge(birthyear, birthday); - const token = await userService.kakaoSignIn( - email, - gender, - age, - nickname, - height, - weight - ); - await res.json({ authorization: token, message: 'SIGN IN COMPLETED' }); - } catch (err) { - res.json({ message: 'SIGN IN FAILED' }); +const kakaoSignIn = catchAsync(async (req, res) => { + const authCode = await req.query.code; + const endPoint = await req.path; + const redirectUri = await userService.getRedirectUri(endPoint); + const kakaoAccessToken = await userService.getKaKaoAccessToken( + authCode, + redirectUri + ); + const { email, gender, birthyear, birthday } = + await userService.getUserInformation(kakaoAccessToken); + const age = await userService.calculateAge(birthyear, birthday); + const user = await userService.getUserByEmail(email); + if (!user) { + await userService.createUser(email, gender, age); + await res.status(401).json({ + message: 'SIGN UP REQUIRED', + }); + } else if ( + user.email && + user.age && + user.gender && + !user.nickname && + !user.height && + !user.weight + ) { + await res.status(401).json({ + message: 'SIGN UP REQUIRED', + }); + } else if ( + user.email && + user.age && + user.gender && + user.nickname && + user.height && + user.weight + ) { + const token = await userService.createToken(email); + await res + .status(200) + .json({ authorization: token, message: 'SIGN IN COMPLETED' }); + } +}); + +const kakaoSignUp = catchAsync(async (req, res) => { + const authCode = await req.query.code; + const endPoint = await req.path; + const redirectUri = await userService.getRedirectUri(endPoint); + const kakaoAccessToken = await userService.getKaKaoAccessToken( + authCode, + redirectUri + ); + const { email } = await userService.getUserInformation(kakaoAccessToken); + const { nickname, height, weight } = await req.body; + + if (!nickname || !height || !weight) { + const error = new Error('KEY_ERROR'); + error.statusCode = 400; + + throw error; } -}; -module.exports = { kakaoSignIn }; + await userService.addAdditionalInfo(email, nickname, height, weight); + const token = await userService.createToken(email); + await res.status(200).json({ + message: 'SIGN UP COMPLETED', + authorization: token, + }); +}); + +const checkDuplicateNickname = catchAsync(async (req, res) => { + const { nickname } = await req.body; + const result = await userService.checkDuplicateNickname(nickname); + + result + ? res.status(409).json({ message: 'DUPLICATED NICKNAME' }) + : res.status(200).json({ + message: 'AVAILABLE NICKNAME', + }); +}); + +module.exports = { + kakaoSignIn, + kakaoSignUp, + checkDuplicateNickname, +}; diff --git a/api/models/userDao.js b/api/models/userDao.js index 3ced925..4ce9652 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -1,4 +1,5 @@ const { dataSource } = require('./dataSource'); + const getUserByEmail = async (email) => { try { const user = await dataSource.query( @@ -7,16 +8,16 @@ const getUserByEmail = async (email) => { u.email, u.nickname, u.profile_image, - mp.user_id, - mp.member_grade_id, + mp.user_id AS userId, + mp.member_grade_id AS memberGradeId, mp.height, mp.weight, mp.age, mp.gender, mp.point, - um.membership_id, - um.start_date, - um.end_date + um.membership_id AS membershipId, + um.start_date AS startDate, + um.end_date AS endDate FROM USERS u LEFT JOIN member_profiles mp ON u.id = mp.user_id LEFT JOIN users_memberships um ON u.id = um.user_id @@ -33,19 +34,34 @@ const getUserByEmail = async (email) => { } }; -const createUsers = async (email, gender, age, nickname, height, weight) => { +const createUser = async (email, gender, age) => { try { createUserResult = await dataSource.query( - `INSERT INTO users (email, nickname) - VALUES (?, ?)`, - [email, nickname] + `INSERT INTO users (email) + VALUES (?)`, + [email] ); const userId = await createUserResult.insertId; await dataSource.query( - `INSERT INTO member_profiles (user_id, gender, age, height, weight) - VALUES (?, ?, ?, ?, ?)`, - [userId, gender, age, height, weight] + `INSERT INTO member_profiles (user_id, gender, age) + VALUES (?, ?, ?)`, + [userId, gender, age] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const checkDuplicateNickname = async (nickname) => { + try { + const [result] = await dataSource.query( + `SELECT nickname FROM users WHERE nickname=?`, + [nickname] ); + return result; } catch (err) { const error = new Error('dataSource Error'); error.statusCode = 400; @@ -54,4 +70,103 @@ const createUsers = async (email, gender, age, nickname, height, weight) => { } }; -module.exports = { getUserByEmail, createUsers }; +const addAdditionalInfo = async (email, nickname, height, weight) => { + try { + await dataSource.query(`UPDATE users SET nickname =? WHERE email=?;`, [ + nickname, + email, + ]); + const [{ id: userId }] = await dataSource.query( + `SELECT id FROM users WHERE email = ?`, + [email] + ); + await dataSource.query( + `UPDATE member_profiles SET height = ?, weight = ? WHERE user_id = ?`, + [height, weight, userId] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const getUserType = async (email) => { + try { + const [userType] = await dataSource.query( + `SELECT + CASE + WHEN EXISTS( + SELECT tf.user_id + FROM trainer_profiles tf + INNER JOIN users u + WHERE u.email = ? + ) THEN 'trainer' + WHEN EXISTS( + SELECT mf.user_id + FROM member_profiles mf + INNER JOIN users u + WHERE u.email = ? + ) THEN 'member' + END AS user_type`, + [email, email] + ); + return userType; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +// const getMemberGrade = async (email) => { +// try { +// const [memberGrade] = dataSource.query( +// `SELECT mg.name AS memberGrade FROM users u INNER JOIN member_profiles mp ON u.id = mp.user_id INNER JOIN member_grades mg ON mp.member_grade_id = mg.id WHERE u.email = ?`, +// [email] +// ); +// return memberGrade; +// } catch (err) { +// const error = new Error('dataSource Error'); +// error.statusCode = 400; +// throw error; +// } +// }; + +// const getTrainerGrade = async (email) => { +// try { +// const [trainerGrade] = dataSource.query( +// `SELECT tg.name AS trainerGrade FROM users u INNER JOIN trainer_profiles tp ON u.id = tp.user_id INNER JOIN trainer_grades tg ON tp.trainer_grade_id = tg.id WHERE u.email = ?`, +// [email] +// ); +// return trainerGrade; +// } catch (err) { +// const error = new Error('dataSource Error'); +// error.statusCode = 400; +// throw error; +// } +// }; + +const getGrade = async (userType, email) => { + try { + const [grade] = await dataSource.query( + `SELECT g.name AS grade FROM users u INNER JOIN ${userType}_profiles p ON u.id = p.user_id INNER JOIN ${userType}_grades g ON p.${userType}_grade_id = g.id WHERE u.email = ?`, + [email] + ); + return grade; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +module.exports = { + getUserByEmail, + createUser, + checkDuplicateNickname, + addAdditionalInfo, + getUserType, + getGrade, +}; diff --git a/api/routes/index.js b/api/routes/index.js index c83ee91..8d1a797 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -5,8 +5,8 @@ const { managementRouter } = require('./managementRouter'); const router = express.Router(); -router.use('/user', userRouter); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); +router.use('/users', userRouter); module.exports = { router }; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index 0f883e6..4c26f15 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -1,8 +1,10 @@ const express = require('express'); const userController = require('../controllers/userController'); +const { loginRequired } = require('../utils/auth'); const userRouter = express.Router(); userRouter.post('/kakaoSignIn', userController.kakaoSignIn); - +userRouter.post('/kakaoSignUp', userController.kakaoSignUp); +userRouter.post('/duplicateNickname', userController.checkDuplicateNickname); module.exports = { userRouter }; diff --git a/api/services/userService.js b/api/services/userService.js index f9f6e91..f8cac84 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -2,20 +2,43 @@ const userDao = require('../models/userDao'); const jwt = require('jsonwebtoken'); const axios = require('axios'); -const getToken = async (authCode) => { - const response = await axios.post( - `https://kauth.kakao.com/oauth/token?grant_type=${process.env.GRANT_TYPE}&code=${authCode}&redirect_uri=${process.env.REDIRECT_URI}&client_id=${process.env.CLIENT_ID}` - ); - const accessToken = await response.data.access_token; - return accessToken; +const getRedirectUri = async (endPoint) => { + switch (endPoint) { + case '/kakaoSignIn': + return process.env.SIGN_IN_REDIRECT_URI; + case '/kakaoSignUp': + return process.env.SIGN_UP_REDIRECT_URI; + } }; -const getUserInformation = async (accessToken) => { - const response = await axios.get(`https://kapi.kakao.com/v2/user/me`, { - headers: { Authorization: `Bearer ${accessToken}` }, - }); - const userInformation = await response.data.kakao_account; - return userInformation; +const getKaKaoAccessToken = async (authCode, redirectUri) => { + try { + const response = await axios.post( + `https://kauth.kakao.com/oauth/token?grant_type=${process.env.GRANT_TYPE}&code=${authCode}&redirect_uri=${redirectUri}&client_id=${process.env.CLIENT_ID}` + ); + const kakaoAccessToken = await response.data.access_token; + return kakaoAccessToken; + } catch (err) { + const message = err.response.data.error; + err.statusCode = err.response.status; + err.message = message; + throw err; + } +}; + +const getUserInformation = async (kakaoAccessToken) => { + try { + const response = await axios.get(`https://kapi.kakao.com/v2/user/me`, { + headers: { Authorization: `Bearer ${kakaoAccessToken}` }, + }); + const userInformation = await response.data.kakao_account; + return userInformation; + } catch (err) { + const message = err.response.data.error; + err.statusCode = err.response.status; + err.message = message; + throw err; + } }; const calculateAge = async (birthyear, birthday) => { @@ -34,35 +57,53 @@ const getUserByEmail = async (email) => { return user; }; -const kakaoSignIn = async (email, gender, age, nickname, height, weight) => { - const user = await getUserByEmail(email); - if (user) { - const token = jwt.sign( - { kakaoEmail: await user.email }, - process.env.JWT_SECRET, - { - algorithm: process.env.JWT_ALGORITHM, - } - ); - return token; - } else { - await userDao.createUsers(email, gender, age, nickname, height, weight); - const [createdUser] = await userDao.getUserByEmail(email); - const token = jwt.sign( - { kakaoEmail: await createdUser.email }, - process.env.JWT_SECRET, - { - algorithm: process.env.JWT_ALGORITHM, - } - ); - return token; - } +const getUserType = async (email) => { + const { user_type: userType } = await userDao.getUserType(email); + return userType; +}; + +const createToken = async (email) => { + const { email: mail } = await getUserByEmail(email); + const userType = await getUserType(email); + const grade = await getGrade(userType, email); + const token = jwt.sign( + { email: mail, userType: userType, grade: grade }, + process.env.JWT_SECRET, + { + algorithm: process.env.JWT_ALGORITHM, + } + ); + return token; +}; + +const createUser = async (email, gender, age) => { + await userDao.createUser(email, gender, age); +}; + +const checkDuplicateNickname = async (nickname) => { + const result = await userDao.checkDuplicateNickname(nickname); + return result; +}; + +const addAdditionalInfo = async (email, nickname, height, weight) => { + await userDao.addAdditionalInfo(email, nickname, height, weight); +}; + +const getGrade = async (userType, email) => { + const { grade: userGrade } = await userDao.getGrade(userType, email); + return userGrade; }; module.exports = { - getToken, + getRedirectUri, + getKaKaoAccessToken, getUserInformation, calculateAge, getUserByEmail, - kakaoSignIn, + getUserType, + createToken, + createUser, + checkDuplicateNickname, + addAdditionalInfo, + getGrade, }; diff --git a/api/utils/auth.js b/api/utils/auth.js index 017654f..9cc123d 100644 --- a/api/utils/auth.js +++ b/api/utils/auth.js @@ -11,7 +11,9 @@ const loginRequired = async (req, res, next) => { } const payload = await jwt.verify(accessToken, process.env.JWT_SECRET); - const user = await userService.getUserByEmail(payload['kakaoEmail']); + const user = await userService.getUserByEmail(payload['email']); + const userType = await payload.userType; + const grade = await payload.grade; if (!user) { const error = new Error('USER_DOES_NOT_EXIST'); @@ -20,6 +22,8 @@ const loginRequired = async (req, res, next) => { } req.user = user; + res.locals.userType = userType; + res.locals.grade = grade; next(); } catch { const error = new Error('INVALID_ACCESS_TOKEN'); @@ -27,4 +31,5 @@ const loginRequired = async (req, res, next) => { return res.status(error.statusCode).json({ message: error.message }); } }; + module.exports = { loginRequired }; diff --git a/api/utils/error.js b/api/utils/error.js index 18f14f4..ebc0950 100644 --- a/api/utils/error.js +++ b/api/utils/error.js @@ -1,15 +1,15 @@ const catchAsync = (func) => { return (req, res, next) => { - func(req, res, next).catch((error) => next(error)) - } -} + func(req, res, next).catch((error) => next(error)); + }; +}; const globalErrorHandler = (err, req, res, next) => { - console.error(err.stack) + console.error(err.stack); - err.statusCode = err.statusCode || 500 + err.statusCode = err.statusCode || 500; - res.status(err.statusCode).json({ message: err.message }) -} + res.status(err.statusCode).json({ message: err.message }); +}; -module.exports = { catchAsync, globalErrorHandler } +module.exports = { catchAsync, globalErrorHandler }; From e343f923b1fd896c1e3ed6c186d2bb6bab528240 Mon Sep 17 00:00:00 2001 From: jieunyang Date: Tue, 12 Sep 2023 14:00:43 +0900 Subject: [PATCH 18/54] [feature] community postlist comment API --- api/controllers/postController.js | 10 ++++++ api/models/postDao.js | 52 +++++++++++++++++++++++++++++++ api/routes/index.js | 2 ++ api/routes/postRouter.js | 7 +++++ api/services/postService.js | 7 +++++ 5 files changed, 78 insertions(+) diff --git a/api/controllers/postController.js b/api/controllers/postController.js index e69de29..ab4828f 100644 --- a/api/controllers/postController.js +++ b/api/controllers/postController.js @@ -0,0 +1,10 @@ +const { catchAsync } = require('../utils/error'); +const postService = require('../services/postService'); + +const getPostListAll = catchAsync(async (req, res) => { + const allPosts = await postService.getPostListAll(); + + res.status(201).json({ data: allPosts }); +}); + +module.exports = { getPostListAll }; diff --git a/api/models/postDao.js b/api/models/postDao.js index e69de29..1cdf61c 100644 --- a/api/models/postDao.js +++ b/api/models/postDao.js @@ -0,0 +1,52 @@ +const { dataSource } = require('./dataSource'); + +const getPostListAll = async () => { + try { + const postListAll = await dataSource.query( + ` + SELECT + t.id AS threadId, + tt.id AS category, + mg.name AS memberGrades, + u.nickname, + t.title, + t.content, + ti.image_url AS imageUrl, + DATE_FORMAT(t.created_at, '%Y.%m.%d') AS time + FROM threads t + LEFT JOIN thread_types tt ON t.thread_types_id = tt.id + LEFT JOIN thread_images ti ON t.id = ti.thread_id + LEFT JOIN users u ON u.id = t.user_id + LEFT JOIN member_profiles mp ON mp.user_id = u.id + LEFT JOIN member_grades mg ON mp.member_grade_id = mg.id + ORDER BY t.created_at DESC; + ` + ); + + const postListWithComments = await Promise.all( + postListAll.map(async (post) => { + const commentsString = await getCommentsCountForThread(post.threadId); + const comments = parseInt(commentsString); + return { ...post, comments }; + }) + ); + + return postListWithComments; + } catch (error) { + console.log(error); + const newError = new Error('dataSource Error'); + newError.status = 400; + throw newError; + } +}; + +const getCommentsCountForThread = async (threadId) => { + const query = ` + SELECT COUNT(*) as commentCount FROM comments WHERE thread_id = ? + `; + const params = [threadId]; + const result = await dataSource.query(query, params); + return result[0].commentCount; +}; + +module.exports = { getPostListAll }; diff --git a/api/routes/index.js b/api/routes/index.js index 8d1a797..e199de2 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,5 +1,6 @@ const express = require('express'); const { userRouter } = require('./userRouter'); +const { postRouter } = require('./postRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); @@ -8,5 +9,6 @@ const router = express.Router(); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); router.use('/users', userRouter); +router.use('/community', postRouter); module.exports = { router }; diff --git a/api/routes/postRouter.js b/api/routes/postRouter.js index e69de29..144b318 100644 --- a/api/routes/postRouter.js +++ b/api/routes/postRouter.js @@ -0,0 +1,7 @@ +const express = require('express'); +const postController = require('../controllers/postController'); +const postRouter = express.Router(); + +postRouter.get('/posts/all', postController.getPostListAll); + +module.exports = { postRouter }; diff --git a/api/services/postService.js b/api/services/postService.js index e69de29..b34d874 100644 --- a/api/services/postService.js +++ b/api/services/postService.js @@ -0,0 +1,7 @@ +const postDao = require('../models/postDao'); + +const getPostListAll = async () => { + return await postDao.getPostListAll(); +}; + +module.exports = { getPostListAll }; From 90655eb23f9ff25751bd8218a7b76216cd2bdd5f Mon Sep 17 00:00:00 2001 From: suyeongs Date: Thu, 14 Sep 2023 19:40:36 +0900 Subject: [PATCH 19/54] feat: Add API for membership payment without unit test code --- api/controllers/paymentController.js | 43 ++++++ api/models/paymentDao.js | 208 +++++++++++++++++++++++++++ api/models/trainerDao.js | 9 +- api/routes/index.js | 2 + api/routes/paymentRouter.js | 24 ++++ api/services/paymentService.js | 51 +++++++ 6 files changed, 331 insertions(+), 6 deletions(-) diff --git a/api/controllers/paymentController.js b/api/controllers/paymentController.js index e69de29..646fe1f 100644 --- a/api/controllers/paymentController.js +++ b/api/controllers/paymentController.js @@ -0,0 +1,43 @@ +const paymentService = require('../services/paymentService'); +const { catchAsync } = require('../utils/error'); + +const getMembershipList = catchAsync(async (req, res) => { + const memberId = req.user.userId; + const membershipList = await paymentService.getMembershipList(memberId); + + res.status(200).json({ membershipData: membershipList }); +}); + +const getMatchingTrainer = catchAsync(async (req, res) => { + const memberId = req.user.userId; + const { trainerId } = req.body; + + const matchingTrainer = await paymentService.getMatchingTrainer( + trainerId, + memberId + ); + + res.status(200).json({ trainerData: matchingTrainer }); +}); + +const payForMembership = catchAsync(async (req, res) => { + const memberId = req.user.userId; + const { trainerId, membershipId, paymentsMethodId } = req.body; + + const paymentInformation = await paymentService.payForMembership( + memberId, + membershipId, + trainerId, + paymentsMethodId + ); + + res + .status(200) + .json({ message: 'Payment completed', data: paymentInformation }); +}); + +module.exports = { + getMembershipList, + getMatchingTrainer, + payForMembership, +}; diff --git a/api/models/paymentDao.js b/api/models/paymentDao.js index e69de29..7576fc9 100644 --- a/api/models/paymentDao.js +++ b/api/models/paymentDao.js @@ -0,0 +1,208 @@ +const { dataSource } = require('./dataSource'); + +const getMembershipList = async (memberId) => { + try { + const data = await dataSource.query( + ` + SELECT + m.id, + m.name AS membershipName, + m.description, + m.price, + JSON_ARRAYAGG(mb.content) AS benefits + FROM memberships m + LEFT JOIN membership_benefits mb ON mb.membership_id = m.id + WHERE EXISTS (SELECT 1 FROM users WHERE id = ?) + GROUP BY m.id, m.name, m.description, m.price; + `, + [memberId] + ); + return data; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const getMatchingTrainer = async (trainerId, memberId) => { + try { + const data = await dataSource.query( + ` + SELECT + u.id, + tg.emoji, + tg.name emojiName, + u.nickname nickName, + u.profile_image profileImage, + tp.score, + ( + SELECT JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT tc.content + FROM trainer_careers tc + WHERE tc.trainer_profile_id = tp.id + ) AS careerSub + ) career, + ( + SELECT JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT tl.content + FROM trainer_licenses tl + WHERE tl.trainer_profile_id = tp.id + ) AS licenseSub + ) license, + ( + SELECT JSON_ARRAYAGG(content) + FROM ( + SELECT DISTINCT ta.content + FROM trainer_awards ta + WHERE ta.trainer_profile_id = tp.id + ) AS awardSub + ) awards + FROM users u + INNER JOIN trainer_profiles tp ON u.id = tp.user_id + INNER JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id + WHERE u.id = ? + AND EXISTS (SELECT 1 FROM users WHERE id = ?); + `, + [trainerId, memberId] + ); + return data; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const isEnoughPointToPayForMembership = async (memberId, membershipId) => { + try { + const data = await dataSource.query( + ` + SELECT id, name, price, description + FROM memberships + WHERE id = ? + AND price > + ( + SELECT mp.point + FROM users u + LEFT JOIN member_profiles mp ON mp.user_id = u.id + WHERE u.id = ? + ); + `, + [membershipId, memberId] + ); + return data; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const isMembershipInUse = async (memberId) => { + try { + const data = await dataSource.query( + ` + SELECT member_id, membership_id, trainer_id, start_date, end_date + FROM members_memberships + WHERE member_id = ?; + `, + [memberId] + ); + return data; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } +}; + +const payForMembership = async ( + memberId, + membershipId, + trainerId, + paymentsMethodId +) => { + const queryRunner = await dataSource.createQueryRunner(); + await queryRunner.connect(); + try { + await queryRunner.startTransaction(); + + await dataSource.query( + ` + INSERT INTO members_memberships (member_id, membership_id, trainer_id) + SELECT ?, ?, ? + WHERE EXISTS (SELECT 1 FROM users WHERE id = ?); + `, + [memberId, membershipId, trainerId, memberId] + ); + + await dataSource.query( + ` + INSERT INTO payments (user_id, membership_id, payments_method_id, price) + VALUES (?, ?, ?, (SELECT price FROM memberships WHERE id = ?)); + `, + [memberId, membershipId, paymentsMethodId, membershipId] + ); + + await queryRunner.query( + ` + UPDATE member_profiles + SET point = point - + ( + SELECT m.price + FROM memberships m + WHERE m.id = ? + ) + WHERE user_id = ?; + `, + [membershipId, memberId] + ); + + const data = await queryRunner.query( + ` + SELECT + u.nickname nickname, + m.name membershipName, + p.price membershipPrice, + p.created_at paymentTime, + pm.method paymentMethod, + mp.point Balance + FROM payments p + LEFT JOIN users u ON u.id = p.user_id + LEFT JOIN memberships m ON m.id = p.membership_id + LEFT JOIN payments_method pm ON pm.id = p.payments_method_id + LEFT JOIN member_profiles mp ON mp.user_id = u.id + WHERE p.user_id = ?; + `, + [memberId] + ); + + await queryRunner.commitTransaction(); + + return data; + } catch (err) { + await queryRunner.rollbackTransaction(); + + const error = new Error('dataSource Error'); + error.statusCode = 400; + + throw error; + } finally { + await queryRunner.release(); + } +}; + +module.exports = { + getMembershipList, + getMatchingTrainer, + isEnoughPointToPayForMembership, + isMembershipInUse, + payForMembership, +}; diff --git a/api/models/trainerDao.js b/api/models/trainerDao.js index f596743..c984735 100644 --- a/api/models/trainerDao.js +++ b/api/models/trainerDao.js @@ -12,8 +12,7 @@ const getTrainerList = async (offset, pageSize) => { u.profile_image profileImage, tp.score, ( - SELECT - JSON_ARRAYAGG(content) + SELECT JSON_ARRAYAGG(content) FROM ( SELECT DISTINCT tc.content FROM trainer_careers tc @@ -21,8 +20,7 @@ const getTrainerList = async (offset, pageSize) => { ) AS careerSub ) career, ( - SELECT - JSON_ARRAYAGG(content) + SELECT JSON_ARRAYAGG(content) FROM ( SELECT DISTINCT tl.content FROM trainer_licenses tl @@ -30,8 +28,7 @@ const getTrainerList = async (offset, pageSize) => { ) AS licenseSub ) license, ( - SELECT - JSON_ARRAYAGG(content) + SELECT JSON_ARRAYAGG(content) FROM ( SELECT DISTINCT ta.content FROM trainer_awards ta diff --git a/api/routes/index.js b/api/routes/index.js index e199de2..05d646c 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -3,6 +3,7 @@ const { userRouter } = require('./userRouter'); const { postRouter } = require('./postRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); +const { paymentRouter } = require('./paymentRouter'); const router = express.Router(); @@ -10,5 +11,6 @@ router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); router.use('/users', userRouter); router.use('/community', postRouter); +router.use('/payments', paymentRouter); module.exports = { router }; diff --git a/api/routes/paymentRouter.js b/api/routes/paymentRouter.js index e69de29..b100eaf 100644 --- a/api/routes/paymentRouter.js +++ b/api/routes/paymentRouter.js @@ -0,0 +1,24 @@ +const express = require('express'); + +const paymentController = require('../controllers/paymentController'); +const { loginRequired } = require('../utils/auth'); + +const paymentRouter = express.Router(); + +paymentRouter.get( + '/membership-list', + loginRequired, + paymentController.getMembershipList +); +paymentRouter.get( + '/trainer-information', + loginRequired, + paymentController.getMatchingTrainer +); +paymentRouter.post( + '/request', + loginRequired, + paymentController.payForMembership +); + +module.exports = { paymentRouter }; diff --git a/api/services/paymentService.js b/api/services/paymentService.js index e69de29..4bda7a6 100644 --- a/api/services/paymentService.js +++ b/api/services/paymentService.js @@ -0,0 +1,51 @@ +const paymentDao = require('../models/paymentDao'); + +const getMembershipList = async (memberId) => { + const memberShipList = await paymentDao.getMembershipList(memberId); + if (memberShipList.length === 0) throw new Error('Permission denied'); + return memberShipList; +}; + +const getMatchingTrainer = async (trainerId, memberId) => { + const matchingTrainer = await paymentDao.getMatchingTrainer( + trainerId, + memberId + ); + if (matchingTrainer.length === 0) throw new Error('Trainer not found'); + return matchingTrainer; +}; + +const payForMembership = async ( + memberId, + membershipId, + trainerId, + paymentsMethodId +) => { + const membersPoint = await paymentDao.isEnoughPointToPayForMembership( + memberId, + membershipId + ); + + if (membersPoint.length === 1) throw new Error('Insufficient balance'); + + const membershipInUse = await paymentDao.isMembershipInUse(memberId); + + if (membershipInUse.length === 0) { + return await paymentDao.payForMembership( + memberId, + membershipId, + trainerId, + paymentsMethodId + ); + } else if (membershipInUse.length === 1) { + throw new Error('Already in use'); + } else { + throw new Error('Payment Error'); + } +}; + +module.exports = { + getMembershipList, + getMatchingTrainer, + payForMembership, +}; From b0393a5beccbbe46dc44e4221093a58c8ca3ae5a Mon Sep 17 00:00:00 2001 From: suyeongs Date: Sun, 17 Sep 2023 02:00:22 +0900 Subject: [PATCH 20/54] fix: 20230915114319_modify_threads_table.sql mysql syntax error correction --- db/migrations/20230915114319_modify_threads_table.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/db/migrations/20230915114319_modify_threads_table.sql b/db/migrations/20230915114319_modify_threads_table.sql index 613b2b9..9922900 100644 --- a/db/migrations/20230915114319_modify_threads_table.sql +++ b/db/migrations/20230915114319_modify_threads_table.sql @@ -1,6 +1,5 @@ -- migrate:up -ALTER TABLE threads MODIFY title NULL; +ALTER TABLE threads MODIFY title VARCHAR(100) NULL; -- migrate:down -ALTER TABLE threads MODIFY title NOT NULL; - +ALTER TABLE threads MODIFY title VARCHAR(100) NOT NULL; From ede5f72892b62240b272d0361f1b103c2e05b349 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Wed, 13 Sep 2023 20:20:38 +0900 Subject: [PATCH 21/54] add : post consultant 2 --- api/controllers/consultantController.js | 14 +++++++++++++ api/models/consultantDao.js | 27 +++++++++++++++++++++++++ api/routes/consultantRouter.js | 10 +++++++++ api/routes/index.js | 10 +++++++-- api/services/consultantService.js | 7 +++++++ 5 files changed, 66 insertions(+), 2 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index e69de29..d48e6fa 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -0,0 +1,14 @@ +const consultantService = require("../services/consultantService"); +const { catchAsync } = require("../utils/error"); + +const createConsultant = catchAsync(async (req, res) => { + const { content, trainerId, threadTypesId = 3 } = await req.body; + + const userId = req.user.userId; + + const thread = await consultantService.createConsultThreads(userId, threadTypesId, content, trainerId); + + res.status(201).json({message : "success"}) + }); + +module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index e69de29..e14d894 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -0,0 +1,27 @@ +const {dataSource} = require("./dataSource"); + +const createConsultant = async (userId, threadTypesId, content, trainerProfileId) => { + try{ + await dataSource.query( + ` + INSERT INTO threads ( + user_id, + thread_types_id, + content, + trainer_profile_id + ) VALUES ( + ?, + ?, + ?, + ? + ) + `, + [userId, threadTypesId, content, trainerProfileId] + ) + }catch{ + const error = new Error("error"); + error.statusCode = 400; + throw error; + }}; + + module.exports = { createConsultant }; \ No newline at end of file diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index e69de29..de5b2f2 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -0,0 +1,10 @@ +const express = require("express"); + +const consultantController = require("../controllers/consultantController"); +const consultantRouter = express.Router(); + +const { loginRequired } = require("../utils/auth"); + +consultantRouter.post("/posts/upload", consultantController.createConsultant); + +module.exports = { consultantRouter }; \ No newline at end of file diff --git a/api/routes/index.js b/api/routes/index.js index 05d646c..1706882 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,16 +1,22 @@ const express = require('express'); +const router = express.Router(); + const { userRouter } = require('./userRouter'); const { postRouter } = require('./postRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); +const { consultantRouter } = require("./consultantRouter") const { paymentRouter } = require('./paymentRouter'); -const router = express.Router(); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); +router.use("/consultant", consultantRouter); router.use('/users', userRouter); router.use('/community', postRouter); router.use('/payments', paymentRouter); -module.exports = { router }; + + + +module.exports = { router } diff --git a/api/services/consultantService.js b/api/services/consultantService.js index e69de29..89bb1a6 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -0,0 +1,7 @@ +const consultantDao = require('../models/consultantDao'); + +const createConsultThreads = async (userId, threadTypesId, content, trainerId) => { + const result = await consultantDao.createConsultant(userId, threadTypesId, content, trainerId); + }; + +module.exports = { createConsultThreads }; \ No newline at end of file From 53c18ef2c2de6d7e86129e30f1d6ee546f4e400d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Sun, 17 Sep 2023 20:13:39 +0900 Subject: [PATCH 22/54] remove: unnecessary comments --- api/models/userDao.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/api/models/userDao.js b/api/models/userDao.js index 4ce9652..5acacf2 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -120,34 +120,6 @@ const getUserType = async (email) => { } }; -// const getMemberGrade = async (email) => { -// try { -// const [memberGrade] = dataSource.query( -// `SELECT mg.name AS memberGrade FROM users u INNER JOIN member_profiles mp ON u.id = mp.user_id INNER JOIN member_grades mg ON mp.member_grade_id = mg.id WHERE u.email = ?`, -// [email] -// ); -// return memberGrade; -// } catch (err) { -// const error = new Error('dataSource Error'); -// error.statusCode = 400; -// throw error; -// } -// }; - -// const getTrainerGrade = async (email) => { -// try { -// const [trainerGrade] = dataSource.query( -// `SELECT tg.name AS trainerGrade FROM users u INNER JOIN trainer_profiles tp ON u.id = tp.user_id INNER JOIN trainer_grades tg ON tp.trainer_grade_id = tg.id WHERE u.email = ?`, -// [email] -// ); -// return trainerGrade; -// } catch (err) { -// const error = new Error('dataSource Error'); -// error.statusCode = 400; -// throw error; -// } -// }; - const getGrade = async (userType, email) => { try { const [grade] = await dataSource.query( From ff17f150e8968822a566e21dd3ffd40f4c4015cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Mon, 18 Sep 2023 14:02:12 +0900 Subject: [PATCH 23/54] refactor: social sign in code --- .env.sample | 3 --- api/controllers/userController.js | 34 ++++++++++--------------------- api/models/userDao.js | 14 ++++++------- api/routes/userRouter.js | 6 +++--- api/services/userService.js | 2 +- 5 files changed, 22 insertions(+), 37 deletions(-) diff --git a/.env.sample b/.env.sample index 663d8fa..ce46ae0 100644 --- a/.env.sample +++ b/.env.sample @@ -6,12 +6,9 @@ DB_PORT=3306 DB_USERNAME=username DB_PASSWORD=password DB_DATABASE=database - PORT=3000 - JWT_SECRET = JWT_SECRET JWT_ALGORITHM = "JWT_ALGORITHM" - GRANT_TYPE = GRANT_TYPE CLIENT_ID = CLIENT_ID SIGN_IN_REDIRECT_URI = REDIRECT_URI diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 7d3428a..947faad 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -2,8 +2,8 @@ const userService = require('../services/userService'); const { catchAsync } = require('../utils/error'); const kakaoSignIn = catchAsync(async (req, res) => { - const authCode = await req.query.code; - const endPoint = await req.path; + const authCode = req.query.code; + const endPoint = req.path; const redirectUri = await userService.getRedirectUri(endPoint); const kakaoAccessToken = await userService.getKaKaoAccessToken( authCode, @@ -16,27 +16,15 @@ const kakaoSignIn = catchAsync(async (req, res) => { if (!user) { await userService.createUser(email, gender, age); await res.status(401).json({ - message: 'SIGN UP REQUIRED', + message: 'NEED ADDITIONAL INFORMATION', }); - } else if ( - user.email && - user.age && - user.gender && - !user.nickname && - !user.height && - !user.weight - ) { + } + const { nickname, height, weight } = user; + if (!nickname || !height || !weight) { await res.status(401).json({ - message: 'SIGN UP REQUIRED', + message: 'NEED ADDITIONAL INFORMATION', }); - } else if ( - user.email && - user.age && - user.gender && - user.nickname && - user.height && - user.weight - ) { + } else if (nickname && height && weight) { const token = await userService.createToken(email); await res .status(200) @@ -45,8 +33,8 @@ const kakaoSignIn = catchAsync(async (req, res) => { }); const kakaoSignUp = catchAsync(async (req, res) => { - const authCode = await req.query.code; - const endPoint = await req.path; + const authCode = req.query.code; + const endPoint = req.path; const redirectUri = await userService.getRedirectUri(endPoint); const kakaoAccessToken = await userService.getKaKaoAccessToken( authCode, @@ -71,7 +59,7 @@ const kakaoSignUp = catchAsync(async (req, res) => { }); const checkDuplicateNickname = catchAsync(async (req, res) => { - const { nickname } = await req.body; + const { nickname } = req.body; const result = await userService.checkDuplicateNickname(nickname); result diff --git a/api/models/userDao.js b/api/models/userDao.js index 5acacf2..eb55d70 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -15,12 +15,12 @@ const getUserByEmail = async (email) => { mp.age, mp.gender, mp.point, - um.membership_id AS membershipId, - um.start_date AS startDate, - um.end_date AS endDate + mm.membership_id AS membershipId, + mm.start_date AS startDate, + mm.end_date AS endDate FROM USERS u LEFT JOIN member_profiles mp ON u.id = mp.user_id - LEFT JOIN users_memberships um ON u.id = um.user_id + LEFT JOIN members_memberships mm ON u.id = mm.user_id WHERE u.email = ?; `, [email] @@ -100,16 +100,16 @@ const getUserType = async (email) => { WHEN EXISTS( SELECT tf.user_id FROM trainer_profiles tf - INNER JOIN users u + INNER JOIN users u ON tf.user_id = u.id WHERE u.email = ? ) THEN 'trainer' WHEN EXISTS( SELECT mf.user_id FROM member_profiles mf - INNER JOIN users u + INNER JOIN users u ON mf.user_id = u.id WHERE u.email = ? ) THEN 'member' - END AS user_type`, + END AS userType`, [email, email] ); return userType; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index 4c26f15..a601734 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -4,7 +4,7 @@ const { loginRequired } = require('../utils/auth'); const userRouter = express.Router(); -userRouter.post('/kakaoSignIn', userController.kakaoSignIn); -userRouter.post('/kakaoSignUp', userController.kakaoSignUp); -userRouter.post('/duplicateNickname', userController.checkDuplicateNickname); +userRouter.post('/kakao-sign-in', userController.kakaoSignIn); +userRouter.post('/kakao-sign-up', userController.kakaoSignUp); +userRouter.post('/duplicate-nickname', userController.checkDuplicateNickname); module.exports = { userRouter }; diff --git a/api/services/userService.js b/api/services/userService.js index f8cac84..3b8a6a3 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -58,7 +58,7 @@ const getUserByEmail = async (email) => { }; const getUserType = async (email) => { - const { user_type: userType } = await userDao.getUserType(email); + const { userType: userType } = await userDao.getUserType(email); return userType; }; From fdb00e928d7f43da9d92174bb9b5c613b81ef627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Sat, 16 Sep 2023 23:39:13 +0900 Subject: [PATCH 24/54] modified management --- api/controllers/managementController.js | 9 ++++++--- api/models/managementDao.js | 5 ++--- api/services/managementService.js | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/api/controllers/managementController.js b/api/controllers/managementController.js index 93460fd..5d2e9f3 100644 --- a/api/controllers/managementController.js +++ b/api/controllers/managementController.js @@ -3,13 +3,16 @@ const { catchAsync } = require('../utils/error'); const { addDays, format } = require('date-fns'); const getManagement = catchAsync(async (req, res) => { - const { userId, weekday } = req.query; + const userId = req.user.userId; + const { weekday } = req.query; const membership = await managementService.getManagement(userId, weekday); - res.json(membership); + + res.status(200).json(membership); }); const membershipStart = catchAsync(async (req, res) => { - const { userId, startDate } = req.body; + const userId = req.user.userId; + const { startDate } = req.body; const startDateObject = new Date(startDate); const after30Days = addDays(startDateObject, 30); diff --git a/api/models/managementDao.js b/api/models/managementDao.js index 57fb547..f4b3038 100644 --- a/api/models/managementDao.js +++ b/api/models/managementDao.js @@ -6,8 +6,8 @@ const getMembershipByUser = async (userId) => { ` SELECT m.name as membershipName, - u.start_date as startDate, - u.end_date as endDate + date_format(u.start_date, '%Y-%m-%d') as startDate, + date_format(u.end_date, '%Y-%m-%d') as endDate FROM members_memberships u JOIN memberships m ON m.id = u.membership_id @@ -78,7 +78,6 @@ const membershipStart = async (startDate, endDate, membershipId, userId) => { end_date = ? WHERE membership_id = ? AND member_id = ?; - `, [startDate, endDate, membershipId, userId] ); diff --git a/api/services/managementService.js b/api/services/managementService.js index c49a7d7..edd194c 100644 --- a/api/services/managementService.js +++ b/api/services/managementService.js @@ -12,9 +12,9 @@ const getManagement = async (userId, weekday) => { ]); return { - membership: membershipResult, - exercise: exerciseResult, - diet: dietResult, + membership: membershipResult[0], + exercise: exerciseResult[0], + diet: dietResult[0], }; }; From b9a78c8c80762a65e41f715e9d0e8e700f2de8bd Mon Sep 17 00:00:00 2001 From: jieunyang Date: Mon, 18 Sep 2023 15:05:10 +0900 Subject: [PATCH 25/54] add: [feature] community postlistdetail API --- api/controllers/postController.js | 8 ++++- api/models/postDao.js | 52 +++++++++++++++++++++++++++++-- api/routes/postRouter.js | 1 + api/services/postService.js | 6 +++- api/utils/types.js | 8 +++++ 5 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 api/utils/types.js diff --git a/api/controllers/postController.js b/api/controllers/postController.js index ab4828f..06c1f38 100644 --- a/api/controllers/postController.js +++ b/api/controllers/postController.js @@ -7,4 +7,10 @@ const getPostListAll = catchAsync(async (req, res) => { res.status(201).json({ data: allPosts }); }); -module.exports = { getPostListAll }; +const getPostListDetail = catchAsync(async (req, res) => { + const postId = req.params.postId; + const post = await postService.getPostListDetail(postId); + res.status(201).json({ data: post }); +}); + +module.exports = { getPostListAll, getPostListDetail }; diff --git a/api/models/postDao.js b/api/models/postDao.js index 1cdf61c..6a5ab0d 100644 --- a/api/models/postDao.js +++ b/api/models/postDao.js @@ -33,13 +33,61 @@ const getPostListAll = async () => { return postListWithComments; } catch (error) { - console.log(error); const newError = new Error('dataSource Error'); newError.status = 400; throw newError; } }; +const getPostListDetail = async (postId) => { + try { + const postListDetail = await dataSource.query( + ` + SELECT + t.id AS threadId, + mg.name AS memberGrades, + u.nickname, + tt.id AS category, + t.title, + t.content, + ti.image_url AS imageUrl, + DATE_FORMAT(t.created_at, '%Y.%m.%d') AS time, + ( + SELECT JSON_ARRAYAGG( + JSON_OBJECT( + 'commentId', c.id, + 'commentTime', DATE_FORMAT(c.created_at, '%Y-%m-%d'), + 'nickname', cu.nickname, + 'content', c.content + ) + ) + FROM ( + SELECT * + FROM comments + WHERE thread_id = t.id + ORDER BY created_at DESC + LIMIT 10000 + ) c + LEFT JOIN users cu ON cu.id = c.user_id + ) AS comments + FROM threads t + LEFT JOIN thread_types tt ON t.thread_types_id = tt.id + LEFT JOIN thread_images ti ON t.id = ti.thread_id + LEFT JOIN users u ON u.id = t.user_id + LEFT JOIN member_profiles mp ON mp.user_id = u.id + LEFT JOIN member_grades mg ON mp.member_grade_id = mg.id + WHERE t.id = ? + GROUP BY t.id, tt.id, mg.name, u.nickname, t.title, t.content, ti.image_url, t.created_at + ORDER BY t.created_at DESC; + `, + [postId] + ); + return postListDetail; + } catch (error) { + throw error; + } +}; + const getCommentsCountForThread = async (threadId) => { const query = ` SELECT COUNT(*) as commentCount FROM comments WHERE thread_id = ? @@ -49,4 +97,4 @@ const getCommentsCountForThread = async (threadId) => { return result[0].commentCount; }; -module.exports = { getPostListAll }; +module.exports = { getPostListAll, getPostListDetail }; diff --git a/api/routes/postRouter.js b/api/routes/postRouter.js index 144b318..80bbaeb 100644 --- a/api/routes/postRouter.js +++ b/api/routes/postRouter.js @@ -3,5 +3,6 @@ const postController = require('../controllers/postController'); const postRouter = express.Router(); postRouter.get('/posts/all', postController.getPostListAll); +postRouter.get('/posts/:postId', postController.getPostListDetail); module.exports = { postRouter }; diff --git a/api/services/postService.js b/api/services/postService.js index b34d874..ced083f 100644 --- a/api/services/postService.js +++ b/api/services/postService.js @@ -4,4 +4,8 @@ const getPostListAll = async () => { return await postDao.getPostListAll(); }; -module.exports = { getPostListAll }; +const getPostListDetail = async (postId) => { + return await postDao.getPostListDetail(postId); +}; + +module.exports = { getPostListAll, getPostListDetail }; diff --git a/api/utils/types.js b/api/utils/types.js new file mode 100644 index 0000000..387cfad --- /dev/null +++ b/api/utils/types.js @@ -0,0 +1,8 @@ +const threadTypes = { + ์ž์œ : 2, + ์ฝ”์นญ: 3, +}; // mapping + +module.exports = { + threadTypes, +}; From c02d3c5e12072c43422d0589e6c13ae3ff80b373 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Mon, 18 Sep 2023 11:09:43 +0900 Subject: [PATCH 26/54] fix: Correct payment error status code, logic, and query; also, implement grade change after membership payment --- api/controllers/paymentController.js | 6 ++++++ api/models/paymentDao.js | 21 +++++++++++++++------ api/models/userDao.js | 1 - api/routes/paymentRouter.js | 2 +- api/services/paymentService.js | 21 +++++++++++++-------- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/api/controllers/paymentController.js b/api/controllers/paymentController.js index 646fe1f..cacf0d1 100644 --- a/api/controllers/paymentController.js +++ b/api/controllers/paymentController.js @@ -1,4 +1,5 @@ const paymentService = require('../services/paymentService'); +const userService = require('../services/userService'); const { catchAsync } = require('../utils/error'); const getMembershipList = catchAsync(async (req, res) => { @@ -31,6 +32,11 @@ const payForMembership = catchAsync(async (req, res) => { paymentsMethodId ); + res.locals.grade = await userService.getGrade( + res.locals.userType, + req.user.email + ); + res .status(200) .json({ message: 'Payment completed', data: paymentInformation }); diff --git a/api/models/paymentDao.js b/api/models/paymentDao.js index 7576fc9..826b099 100644 --- a/api/models/paymentDao.js +++ b/api/models/paymentDao.js @@ -6,10 +6,10 @@ const getMembershipList = async (memberId) => { ` SELECT m.id, - m.name AS membershipName, + m.name, m.description, m.price, - JSON_ARRAYAGG(mb.content) AS benefits + JSON_ARRAYAGG(mb.content) AS benefit FROM memberships m LEFT JOIN membership_benefits mb ON mb.membership_id = m.id WHERE EXISTS (SELECT 1 FROM users WHERE id = ?) @@ -28,7 +28,7 @@ const getMembershipList = async (memberId) => { const getMatchingTrainer = async (trainerId, memberId) => { try { - const data = await dataSource.query( + const [data] = await dataSource.query( ` SELECT u.id, @@ -143,7 +143,7 @@ const payForMembership = async ( [memberId, membershipId, trainerId, memberId] ); - await dataSource.query( + const result = await dataSource.query( ` INSERT INTO payments (user_id, membership_id, payments_method_id, price) VALUES (?, ?, ?, (SELECT price FROM memberships WHERE id = ?)); @@ -151,6 +151,15 @@ const payForMembership = async ( [memberId, membershipId, paymentsMethodId, membershipId] ); + await queryRunner.query( + ` + UPDATE member_profiles + SET member_grade_id = ? + WHERE user_id = ? + `, + [membershipId, memberId] + ); + await queryRunner.query( ` UPDATE member_profiles @@ -179,9 +188,9 @@ const payForMembership = async ( LEFT JOIN memberships m ON m.id = p.membership_id LEFT JOIN payments_method pm ON pm.id = p.payments_method_id LEFT JOIN member_profiles mp ON mp.user_id = u.id - WHERE p.user_id = ?; + WHERE p.user_id = ? AND p.id = ?; `, - [memberId] + [memberId, result.insertId] ); await queryRunner.commitTransaction(); diff --git a/api/models/userDao.js b/api/models/userDao.js index eb55d70..a15896a 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -29,7 +29,6 @@ const getUserByEmail = async (email) => { } catch (err) { const error = new Error('dataSource Error'); error.statusCode = 400; - throw error; } }; diff --git a/api/routes/paymentRouter.js b/api/routes/paymentRouter.js index b100eaf..ff01167 100644 --- a/api/routes/paymentRouter.js +++ b/api/routes/paymentRouter.js @@ -10,7 +10,7 @@ paymentRouter.get( loginRequired, paymentController.getMembershipList ); -paymentRouter.get( +paymentRouter.post( '/trainer-information', loginRequired, paymentController.getMatchingTrainer diff --git a/api/services/paymentService.js b/api/services/paymentService.js index 4bda7a6..b3e0ded 100644 --- a/api/services/paymentService.js +++ b/api/services/paymentService.js @@ -21,24 +21,29 @@ const payForMembership = async ( trainerId, paymentsMethodId ) => { + const membershipInUse = await paymentDao.isMembershipInUse(memberId); + + if (membershipInUse.length === 1) { + const error = new Error('Already in use'); + error.statusCode = 402; + throw error; + } + const membersPoint = await paymentDao.isEnoughPointToPayForMembership( memberId, membershipId ); - - if (membersPoint.length === 1) throw new Error('Insufficient balance'); - - const membershipInUse = await paymentDao.isMembershipInUse(memberId); - - if (membershipInUse.length === 0) { + if (membersPoint.length === 0) { return await paymentDao.payForMembership( memberId, membershipId, trainerId, paymentsMethodId ); - } else if (membershipInUse.length === 1) { - throw new Error('Already in use'); + } else if (membersPoint.length === 1) { + const error = new Error('Insufficient balance'); + error.statusCode = 402; + throw error; } else { throw new Error('Payment Error'); } From f724429715ba629f7d0dfe91f08e54122081a351 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Mon, 18 Sep 2023 19:50:31 +0900 Subject: [PATCH 27/54] refactor: Move offset and limit calculation logic from controller layer to service layer --- api/controllers/trainerController.js | 4 +--- api/services/trainerService.js | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/controllers/trainerController.js b/api/controllers/trainerController.js index 4c8faac..7f79168 100644 --- a/api/controllers/trainerController.js +++ b/api/controllers/trainerController.js @@ -3,10 +3,8 @@ const { catchAsync } = require('../utils/error'); const getTrainerList = catchAsync(async (req, res) => { const { page = 1, limit = 5 } = req.query; - const pageSize = parseInt(limit); - const offset = (page - 1) * pageSize; - const trainerList = await trainerService.getTrainerList(offset, pageSize); + const trainerList = await trainerService.getTrainerList(page, limit); res.status(200).json({ data: trainerList }); }); diff --git a/api/services/trainerService.js b/api/services/trainerService.js index 6b87338..976b893 100644 --- a/api/services/trainerService.js +++ b/api/services/trainerService.js @@ -1,6 +1,9 @@ const trainerDao = require('../models/trainerDao'); -const getTrainerList = async (offset, pageSize) => { +const getTrainerList = async (page, limit) => { + const pageSize = parseInt(limit); + const offset = (page - 1) * pageSize; + return await trainerDao.getTrainerList(offset, pageSize); }; From a2e371fa596ee61161ab731c8526f56ec27df10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Mon, 18 Sep 2023 20:25:12 +0900 Subject: [PATCH 28/54] modify: status code, message --- api/controllers/userController.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 947faad..8bd7a08 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -15,13 +15,13 @@ const kakaoSignIn = catchAsync(async (req, res) => { const user = await userService.getUserByEmail(email); if (!user) { await userService.createUser(email, gender, age); - await res.status(401).json({ - message: 'NEED ADDITIONAL INFORMATION', + await res.status(202).json({ + message: 'BASIC REGISTRAION SUCCESSFUL. NEED ADDITIONAL INFORMATION', }); } const { nickname, height, weight } = user; if (!nickname || !height || !weight) { - await res.status(401).json({ + await res.status(202).json({ message: 'NEED ADDITIONAL INFORMATION', }); } else if (nickname && height && weight) { From e81dadce707524794ac2ec26ca6526c399cbbbf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Tue, 19 Sep 2023 10:48:37 +0900 Subject: [PATCH 29/54] add : mypage --- api/controllers/userController.js | 9 +++++++++ api/models/userDao.js | 25 +++++++++++++++++++++++++ api/routes/userRouter.js | 2 ++ api/services/userService.js | 5 +++++ 4 files changed, 41 insertions(+) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 8bd7a08..9ef6a68 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -69,8 +69,17 @@ const checkDuplicateNickname = catchAsync(async (req, res) => { }); }); +const getMyPage = async (req, res) => { + const userId = req.user.userId; + + const myPage = await userService.getMyPage(userId); + + res.status(200).json({ myPage }); +}; + module.exports = { kakaoSignIn, kakaoSignUp, checkDuplicateNickname, + getMyPage, }; diff --git a/api/models/userDao.js b/api/models/userDao.js index a15896a..6ef7cdf 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -133,6 +133,30 @@ const getGrade = async (userType, email) => { } }; +const getMyPage = async (userId) => { + try { + const membership = await dataSource.query( + ` + SELECT + u.nickname, + g.emoji as emoji, + p.height as height, + p.weight as weight + FROM users u + JOIN member_profiles p ON u.id = p.user_id + JOIN member_grades g ON p.member_grade_id = g.id + WHERE u.id = ?; + `, + [userId] + ); + return membership[0]; + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { getUserByEmail, createUser, @@ -140,4 +164,5 @@ module.exports = { addAdditionalInfo, getUserType, getGrade, + getMyPage, }; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index a601734..466fa06 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -7,4 +7,6 @@ const userRouter = express.Router(); userRouter.post('/kakao-sign-in', userController.kakaoSignIn); userRouter.post('/kakao-sign-up', userController.kakaoSignUp); userRouter.post('/duplicate-nickname', userController.checkDuplicateNickname); +userRouter.get('/mypage', loginRequired, userController.getMyPage); + module.exports = { userRouter }; diff --git a/api/services/userService.js b/api/services/userService.js index 3b8a6a3..d9767c7 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -94,6 +94,10 @@ const getGrade = async (userType, email) => { return userGrade; }; +const getMyPage = async (userId) => { + return await userDao.getMyPage(userId); +}; + module.exports = { getRedirectUri, getKaKaoAccessToken, @@ -106,4 +110,5 @@ module.exports = { checkDuplicateNickname, addAdditionalInfo, getGrade, + getMyPage, }; From 8a4e51b1e3c810e78655d94bc7f0100cc04d5f82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Tue, 19 Sep 2023 12:35:34 +0900 Subject: [PATCH 30/54] fix: data source error --- api/models/userDao.js | 2 +- api/services/userService.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/models/userDao.js b/api/models/userDao.js index 6ef7cdf..7c773e8 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -20,7 +20,7 @@ const getUserByEmail = async (email) => { mm.end_date AS endDate FROM USERS u LEFT JOIN member_profiles mp ON u.id = mp.user_id - LEFT JOIN members_memberships mm ON u.id = mm.user_id + LEFT JOIN members_memberships mm ON u.id = mm.member_id WHERE u.email = ?; `, [email] diff --git a/api/services/userService.js b/api/services/userService.js index d9767c7..035c11d 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -4,9 +4,9 @@ const axios = require('axios'); const getRedirectUri = async (endPoint) => { switch (endPoint) { - case '/kakaoSignIn': + case '/kakao-sign-in': return process.env.SIGN_IN_REDIRECT_URI; - case '/kakaoSignUp': + case '/kakao-sign-up': return process.env.SIGN_UP_REDIRECT_URI; } }; From 5ef1251a5a8949a0620ccee881415f5ff2d92ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Tue, 19 Sep 2023 14:42:28 +0900 Subject: [PATCH 31/54] fix: data source error --- api/controllers/userController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 9ef6a68..f956d4e 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -15,13 +15,13 @@ const kakaoSignIn = catchAsync(async (req, res) => { const user = await userService.getUserByEmail(email); if (!user) { await userService.createUser(email, gender, age); - await res.status(202).json({ + return await res.status(200).json({ message: 'BASIC REGISTRAION SUCCESSFUL. NEED ADDITIONAL INFORMATION', }); } const { nickname, height, weight } = user; if (!nickname || !height || !weight) { - await res.status(202).json({ + await res.status(200).json({ message: 'NEED ADDITIONAL INFORMATION', }); } else if (nickname && height && weight) { From c3cfd9c6e157490e02507e94fbe808441a30d87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Tue, 19 Sep 2023 14:56:20 +0900 Subject: [PATCH 32/54] fix: data source error --- api/controllers/userController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index f956d4e..4640f4c 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -15,13 +15,13 @@ const kakaoSignIn = catchAsync(async (req, res) => { const user = await userService.getUserByEmail(email); if (!user) { await userService.createUser(email, gender, age); - return await res.status(200).json({ + return await res.status(202).json({ message: 'BASIC REGISTRAION SUCCESSFUL. NEED ADDITIONAL INFORMATION', }); } const { nickname, height, weight } = user; if (!nickname || !height || !weight) { - await res.status(200).json({ + await res.status(202).json({ message: 'NEED ADDITIONAL INFORMATION', }); } else if (nickname && height && weight) { From aa0e7716e4c71ba44f1dec31bd0252fbb69b3d4a Mon Sep 17 00:00:00 2001 From: suyeongs Date: Tue, 19 Sep 2023 13:45:15 +0900 Subject: [PATCH 33/54] fix: Reissue tokens after membership grade change following payment --- api/controllers/paymentController.js | 13 ++++++------- api/controllers/userController.js | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/controllers/paymentController.js b/api/controllers/paymentController.js index cacf0d1..2611b95 100644 --- a/api/controllers/paymentController.js +++ b/api/controllers/paymentController.js @@ -32,14 +32,13 @@ const payForMembership = catchAsync(async (req, res) => { paymentsMethodId ); - res.locals.grade = await userService.getGrade( - res.locals.userType, - req.user.email - ); + const token = await userService.createToken(req.user.email); - res - .status(200) - .json({ message: 'Payment completed', data: paymentInformation }); + res.status(200).json({ + message: 'Payment completed', + authorization: token, + data: paymentInformation, + }); }); module.exports = { diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 4640f4c..2780699 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -26,6 +26,7 @@ const kakaoSignIn = catchAsync(async (req, res) => { }); } else if (nickname && height && weight) { const token = await userService.createToken(email); + await res .status(200) .json({ authorization: token, message: 'SIGN IN COMPLETED' }); From 683b3a718f7f7c95e9d2bfda09c8afa267ee8b53 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Tue, 19 Sep 2023 14:16:58 +0900 Subject: [PATCH 34/54] add : delete consultant casecade --- api/controllers/consultantController.js | 12 ++++++++- api/models/consultantDao.js | 34 ++++++++++++++++++++++++- api/routes/consultantRouter.js | 1 + api/services/consultantService.js | 10 +++++++- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index d48e6fa..7a325ad 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -11,4 +11,14 @@ const createConsultant = catchAsync(async (req, res) => { res.status(201).json({message : "success"}) }); -module.exports = { createConsultant }; \ No newline at end of file +const deleteConsultant = catchAsync(async (req, res) => { + + const threadId = req.params.postId + + const thread = await consultantService.deleteConsultantThreads(threadId); + + res.status(201).json({message : "success"}) +}); + +module.exports = { createConsultant, +deleteConsultant }; \ No newline at end of file diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index e14d894..644d1ce 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -1,5 +1,6 @@ const {dataSource} = require("./dataSource"); + const createConsultant = async (userId, threadTypesId, content, trainerProfileId) => { try{ await dataSource.query( @@ -24,4 +25,35 @@ const createConsultant = async (userId, threadTypesId, content, trainerProfileId throw error; }}; - module.exports = { createConsultant }; \ No newline at end of file + const deleteConsultant = async (threadId) => { + const queryRunner = await dataSource.createQueryRunner(); + await queryRunner.connect(); + await queryRunner.startTransaction(); + + try { + await queryRunner.query ( + ` + DELETE FROM comments + WHERE thread_id = ? + `, + [threadId] + ) + await queryRunner.query( + ` + DELETE FROM threads + WHERE id = ? + `, + [threadId]); + + await queryRunner.commitTransaction(); + } catch{ + await queryRunner.rollbackTransaction(); + const error = new Error("error"); + error.statusCode = 400; + throw error; + } finally { + await queryRunner.release(); + } + }; + + module.exports = { createConsultant, deleteConsultant }; \ No newline at end of file diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index de5b2f2..f74ad7b 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -6,5 +6,6 @@ const consultantRouter = express.Router(); const { loginRequired } = require("../utils/auth"); consultantRouter.post("/posts/upload", consultantController.createConsultant); +consultantRouter.delete("/posts/:postId", consultantController.deleteConsultant); module.exports = { consultantRouter }; \ No newline at end of file diff --git a/api/services/consultantService.js b/api/services/consultantService.js index 89bb1a6..a1897b5 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -2,6 +2,14 @@ const consultantDao = require('../models/consultantDao'); const createConsultThreads = async (userId, threadTypesId, content, trainerId) => { const result = await consultantDao.createConsultant(userId, threadTypesId, content, trainerId); + + return result; }; -module.exports = { createConsultThreads }; \ No newline at end of file +const deleteConsultantThreads = async (threadId) => { + const result = await consultantDao.deleteConsultant(threadId) + return result +} + +module.exports = { createConsultThreads, +deleteConsultantThreads }; \ No newline at end of file From a6362964378673fdfaf3bd562d1ee8c957475065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Mon, 18 Sep 2023 19:51:20 +0900 Subject: [PATCH 35/54] feature: social-sign-in-test --- api/controllers/userController.js | 2 +- api/routes/index.js | 16 +- package-lock.json | 1016 +++++++++++++++++++---------- package.json | 6 +- tests/fixtures/user-fixture.js | 37 ++ tests/test-client.js | 4 +- tests/tests/user.test.js | 233 +++++++ 7 files changed, 934 insertions(+), 380 deletions(-) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index 2780699..ce79704 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -16,7 +16,7 @@ const kakaoSignIn = catchAsync(async (req, res) => { if (!user) { await userService.createUser(email, gender, age); return await res.status(202).json({ - message: 'BASIC REGISTRAION SUCCESSFUL. NEED ADDITIONAL INFORMATION', + message: 'BASIC REGISTRATION SUCCESSFUL. NEED ADDITIONAL INFORMATION', }); } const { nickname, height, weight } = user; diff --git a/api/routes/index.js b/api/routes/index.js index 1706882..c83ee91 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -1,22 +1,12 @@ const express = require('express'); -const router = express.Router(); - const { userRouter } = require('./userRouter'); -const { postRouter } = require('./postRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); -const { consultantRouter } = require("./consultantRouter") -const { paymentRouter } = require('./paymentRouter'); +const router = express.Router(); +router.use('/user', userRouter); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); -router.use("/consultant", consultantRouter); -router.use('/users', userRouter); -router.use('/community', postRouter); -router.use('/payments', paymentRouter); - - - -module.exports = { router } +module.exports = { router }; diff --git a/package-lock.json b/package-lock.json index 7f3db3f..94bc36c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,21 +14,22 @@ "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", - "jest": "^29.6.4", "jsonwebtoken": "^9.0.2", "mysql2": "^3.6.0", - "supertest": "^6.3.3", "typeorm": "^0.3.17" }, "devDependencies": { + "jest": "^29.7.0", "morgan": "^1.10.0", - "nodemon": "^3.0.1" + "nodemon": "^3.0.1", + "supertest": "^6.3.3" } }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -41,6 +42,7 @@ "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" @@ -53,6 +55,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -64,6 +67,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -77,6 +81,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -84,39 +89,43 @@ "node_modules/@babel/code-frame/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@babel/compat-data": { - "version": "7.22.9", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz", - "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", + "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.15.tgz", - "integrity": "sha512-PtZqMmgRrvj8ruoEOIwVA3yoF91O+Hgw9o7DAUTNBA6Mo2jpu31clx9a7Nz/9JznqetTR6zwfC4L3LAjKQXUwA==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", + "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", + "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.22.15", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.22.15", + "@babel/helper-module-transforms": "^7.22.20", "@babel/helpers": "^7.22.15", - "@babel/parser": "^7.22.15", + "@babel/parser": "^7.22.16", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.22.15", - "@babel/types": "^7.22.15", + "@babel/traverse": "^7.22.20", + "@babel/types": "^7.22.19", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -134,12 +143,14 @@ "node_modules/@babel/core/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/@babel/core/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -155,12 +166,14 @@ "node_modules/@babel/core/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -169,6 +182,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "dev": true, "dependencies": { "@babel/types": "^7.22.15", "@jridgewell/gen-mapping": "^0.3.2", @@ -183,6 +197,7 @@ "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==", + "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", @@ -198,6 +213,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, "dependencies": { "yallist": "^3.0.2" } @@ -206,6 +222,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -213,12 +230,14 @@ "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -227,6 +246,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "dev": true, "dependencies": { "@babel/template": "^7.22.5", "@babel/types": "^7.22.5" @@ -239,6 +259,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -250,6 +271,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, "dependencies": { "@babel/types": "^7.22.15" }, @@ -258,15 +280,16 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.15.tgz", - "integrity": "sha512-l1UiX4UyHSFsYt17iQ3Se5pQQZZHa22zyIXURmvkmLCD4t/aU+dvNWHatKac/D9Vm9UES7nvIqHs4jZqKviUmQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", + "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", + "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", "@babel/helper-simple-access": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/helper-validator-identifier": "^7.22.15" + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -279,6 +302,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -287,6 +311,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -298,6 +323,7 @@ "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -309,14 +335,16 @@ "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==", + "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", - "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -325,6 +353,7 @@ "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==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -333,6 +362,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", + "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/traverse": "^7.22.15", @@ -343,11 +373,12 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, @@ -359,6 +390,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -370,6 +402,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -383,6 +416,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -390,12 +424,14 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, "engines": { "node": ">=0.8.0" } @@ -404,6 +440,7 @@ "version": "7.22.16", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "dev": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -415,6 +452,7 @@ "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -426,6 +464,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -437,6 +476,7 @@ "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.12.13" }, @@ -448,6 +488,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -459,6 +500,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -470,6 +512,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -484,6 +527,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -495,6 +539,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -506,6 +551,7 @@ "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.10.4" }, @@ -517,6 +563,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -528,6 +575,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -539,6 +587,7 @@ "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.8.0" }, @@ -550,6 +599,7 @@ "version": "7.14.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.14.5" }, @@ -564,6 +614,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -589,6 +640,7 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -599,18 +651,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.15.tgz", - "integrity": "sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", + "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.22.5", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15", + "@babel/parser": "^7.22.16", + "@babel/types": "^7.22.19", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -622,6 +675,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -637,15 +691,17 @@ "node_modules/@babel/traverse/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", + "version": "7.22.19", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", + "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", + "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", + "@babel/helper-validator-identifier": "^7.22.19", "to-fast-properties": "^2.0.0" }, "engines": { @@ -655,7 +711,8 @@ "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true }, "node_modules/@dbmate/darwin-arm64": { "version": "2.6.0", @@ -745,6 +802,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", @@ -760,20 +818,22 @@ "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, "engines": { "node": ">=8" } }, "node_modules/@jest/console": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", - "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -781,14 +841,15 @@ } }, "node_modules/@jest/core": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", - "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", - "dependencies": { - "@jest/console": "^29.6.4", - "@jest/reporters": "^29.6.4", - "@jest/test-result": "^29.6.4", - "@jest/transform": "^29.6.4", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", @@ -796,21 +857,21 @@ "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.6.3", - "jest-config": "^29.6.4", - "jest-haste-map": "^29.6.4", - "jest-message-util": "^29.6.3", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.6.4", - "jest-resolve-dependencies": "^29.6.4", - "jest-runner": "^29.6.4", - "jest-runtime": "^29.6.4", - "jest-snapshot": "^29.6.4", - "jest-util": "^29.6.3", - "jest-validate": "^29.6.3", - "jest-watcher": "^29.6.4", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -827,35 +888,38 @@ } }, "node_modules/@jest/environment": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.6.4.tgz", - "integrity": "sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, "dependencies": { - "@jest/fake-timers": "^29.6.4", + "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, "dependencies": { - "expect": "^29.6.4", - "jest-snapshot": "^29.6.4" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.6.4.tgz", - "integrity": "sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, "dependencies": { "jest-get-type": "^29.6.3" }, @@ -864,44 +928,47 @@ } }, "node_modules/@jest/fake-timers": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.6.4.tgz", - "integrity": "sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.6.3", - "jest-mock": "^29.6.3", - "jest-util": "^29.6.3" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.6.4.tgz", - "integrity": "sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", "@jest/types": "^29.6.3", - "jest-mock": "^29.6.3" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", - "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.6.4", - "@jest/test-result": "^29.6.4", - "@jest/transform": "^29.6.4", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", @@ -915,9 +982,9 @@ "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3", - "jest-worker": "^29.6.4", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -939,6 +1006,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -950,6 +1018,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", @@ -960,11 +1029,12 @@ } }, "node_modules/@jest/test-result": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", - "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, "dependencies": { - "@jest/console": "^29.6.4", + "@jest/console": "^29.7.0", "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" @@ -974,13 +1044,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", - "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, "dependencies": { - "@jest/test-result": "^29.6.4", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -988,9 +1059,10 @@ } }, "node_modules/@jest/transform": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.6.4.tgz", - "integrity": "sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@jest/types": "^29.6.3", @@ -1000,9 +1072,9 @@ "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", + "jest-haste-map": "^29.7.0", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -1016,6 +1088,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", @@ -1032,6 +1105,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -1045,6 +1119,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, "engines": { "node": ">=6.0.0" } @@ -1053,6 +1128,7 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, "engines": { "node": ">=6.0.0" } @@ -1060,12 +1136,14 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -1074,12 +1152,14 @@ "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true }, "node_modules/@sinonjs/commons": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, "dependencies": { "type-detect": "4.0.8" } @@ -1088,6 +1168,7 @@ "version": "10.3.0", "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, "dependencies": { "@sinonjs/commons": "^3.0.0" } @@ -1098,9 +1179,10 @@ "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" }, "node_modules/@types/babel__core": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", - "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", + "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", + "dev": true, "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", @@ -1110,26 +1192,29 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", + "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", + "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", + "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", + "dev": true, "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__traverse": { - "version": "7.20.1", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", - "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", + "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", + "dev": true, "dependencies": { "@babel/types": "^7.20.7" } @@ -1138,6 +1223,7 @@ "version": "4.1.6", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -1145,12 +1231,14 @@ "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==" + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true }, "node_modules/@types/istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, "dependencies": { "@types/istanbul-lib-coverage": "*" } @@ -1159,24 +1247,28 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, "dependencies": { "@types/istanbul-lib-report": "*" } }, "node_modules/@types/node": { - "version": "20.5.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz", - "integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==" + "version": "20.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.2.tgz", + "integrity": "sha512-Y+/1vGBHV/cYk6OI1Na/LHzwnlNCAfU3ZNGrc1LdRe/LAIbdDPTTv/HU3M7yXN448aTVDq3eKRm2cg7iKLb8gw==", + "dev": true }, "node_modules/@types/stack-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==" + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true }, "node_modules/@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, "dependencies": { "@types/yargs-parser": "*" } @@ -1184,7 +1276,8 @@ "node_modules/@types/yargs-parser": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==" + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true }, "node_modules/abbrev": { "version": "1.1.1", @@ -1208,6 +1301,7 @@ "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, "dependencies": { "type-fest": "^0.21.3" }, @@ -1249,6 +1343,7 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -1269,6 +1364,7 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -1281,7 +1377,8 @@ "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", - "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true }, "node_modules/asynckit": { "version": "0.4.0", @@ -1299,11 +1396,12 @@ } }, "node_modules/babel-jest": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", - "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, "dependencies": { - "@jest/transform": "^29.6.4", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", "babel-preset-jest": "^29.6.3", @@ -1322,6 +1420,7 @@ "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@istanbuljs/load-nyc-config": "^1.0.0", @@ -1337,6 +1436,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -1352,6 +1452,7 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, "bin": { "semver": "bin/semver.js" } @@ -1360,6 +1461,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, "dependencies": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", @@ -1374,6 +1476,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, "dependencies": { "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-bigint": "^7.8.3", @@ -1396,6 +1499,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, "dependencies": { "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" @@ -1490,6 +1594,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -1499,6 +1604,7 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -1510,6 +1616,7 @@ "version": "4.21.10", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "dev": true, "funding": [ { "type": "opencollective", @@ -1541,6 +1648,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, "dependencies": { "node-int64": "^0.4.0" } @@ -1576,7 +1684,8 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true }, "node_modules/bytes": { "version": "3.1.2", @@ -1602,6 +1711,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { "node": ">=6" } @@ -1610,14 +1720,16 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, "engines": { "node": ">=6" } }, "node_modules/caniuse-lite": { - "version": "1.0.30001527", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001527.tgz", - "integrity": "sha512-YkJi7RwPgWtXVSgK4lG9AHH57nSzvvOp9MesgXmw4Q7n0C3H04L0foHqfxcmSAm5AcWb8dW9AYj2tR7/5GnddQ==", + "version": "1.0.30001535", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001535.tgz", + "integrity": "sha512-48jLyUkiWFfhm/afF7cQPqPjaUmSraEhK4j+FCTJpgnGGEZHqyLe3hmWH7lIooZdSzXL0ReMvHz0vKDoTBsrwg==", + "dev": true, "funding": [ { "type": "opencollective", @@ -1671,6 +1783,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, "engines": { "node": ">=10" } @@ -1706,6 +1819,7 @@ "version": "3.8.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, "funding": [ { "type": "github", @@ -1719,7 +1833,8 @@ "node_modules/cjs-module-lexer": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", - "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==" + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true }, "node_modules/cli-highlight": { "version": "2.1.11", @@ -1793,6 +1908,7 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, "engines": { "iojs": ">= 1.0.0", "node": ">= 0.12.0" @@ -1801,7 +1917,8 @@ "node_modules/collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", - "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==" + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true }, "node_modules/color-convert": { "version": "2.0.1", @@ -1833,12 +1950,14 @@ "node_modules/component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true }, "node_modules/content-disposition": { "version": "0.5.4", @@ -1881,7 +2000,8 @@ "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true }, "node_modules/cookie": { "version": "0.5.0", @@ -1899,7 +2019,8 @@ "node_modules/cookiejar": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", - "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true }, "node_modules/cors": { "version": "2.8.5", @@ -1913,10 +2034,32 @@ "node": ">= 0.10" } }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/cross-spawn": { "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", @@ -1970,6 +2113,7 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, @@ -1983,6 +2127,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -2024,6 +2169,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, "engines": { "node": ">=8" } @@ -2032,6 +2178,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, "dependencies": { "asap": "^2.0.0", "wrappy": "1" @@ -2041,6 +2188,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -2070,14 +2218,16 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.509", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.509.tgz", - "integrity": "sha512-G5KlSWY0zzhANtX15tkikHl4WB7zil2Y65oT52EZUL194abjUXBZym12Ht7Bhuwm/G3LJFEqMADyv2Cks56dmg==" + "version": "1.4.523", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.523.tgz", + "integrity": "sha512-9AreocSUWnzNtvLcbpng6N+GkXnCcBR80IQkxRC9Dfdyg4gaWNUPBujAHUpKkiUkoSoR9UlhA4zD/IgBklmhzg==", + "dev": true }, "node_modules/emittery": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, "engines": { "node": ">=12" }, @@ -2102,6 +2252,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -2123,6 +2274,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, "engines": { "node": ">=8" } @@ -2131,6 +2283,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -2151,6 +2304,7 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", @@ -2173,20 +2327,22 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, "engines": { "node": ">= 0.8.0" } }, "node_modules/expect": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.6.4.tgz", - "integrity": "sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, "dependencies": { - "@jest/expect-utils": "^29.6.4", + "@jest/expect-utils": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3" + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -2266,17 +2422,20 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", - "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, "dependencies": { "bser": "2.1.1" } @@ -2285,6 +2444,7 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -2324,6 +2484,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -2368,6 +2529,7 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", + "dev": true, "dependencies": { "dezalgo": "^1.0.4", "hexoid": "^1.0.0", @@ -2403,6 +2565,7 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -2429,6 +2592,7 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, "engines": { "node": ">=6.9.0" } @@ -2459,6 +2623,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, "engines": { "node": ">=8.0.0" } @@ -2467,6 +2632,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, "engines": { "node": ">=10" }, @@ -2478,6 +2644,7 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2509,6 +2676,7 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, "engines": { "node": ">=4" } @@ -2516,7 +2684,8 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true }, "node_modules/has": { "version": "1.0.3", @@ -2533,6 +2702,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, "engines": { "node": ">=4" } @@ -2563,6 +2733,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==", + "dev": true, "engines": { "node": ">=8" } @@ -2578,7 +2749,8 @@ "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true }, "node_modules/http-errors": { "version": "2.0.0", @@ -2599,6 +2771,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, "engines": { "node": ">=10.17.0" } @@ -2643,6 +2816,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, "dependencies": { "pkg-dir": "^4.2.0", "resolve-cwd": "^3.0.0" @@ -2661,6 +2835,7 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, "engines": { "node": ">=0.8.19" } @@ -2690,7 +2865,8 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true }, "node_modules/is-binary-path": { "version": "2.1.0", @@ -2708,6 +2884,7 @@ "version": "2.13.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -2736,6 +2913,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, "engines": { "node": ">=6" } @@ -2756,6 +2934,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "engines": { "node": ">=0.12.0" } @@ -2769,6 +2948,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, "engines": { "node": ">=8" }, @@ -2779,12 +2959,14 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true }, "node_modules/istanbul-lib-coverage": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, "engines": { "node": ">=8" } @@ -2793,6 +2975,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, "dependencies": { "@babel/core": "^7.12.3", "@babel/parser": "^7.14.7", @@ -2808,6 +2991,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", "make-dir": "^4.0.0", @@ -2821,28 +3005,16 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } }, - "node_modules/istanbul-lib-report/node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/istanbul-lib-report/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -2854,6 +3026,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, "dependencies": { "debug": "^4.1.1", "istanbul-lib-coverage": "^3.0.0", @@ -2867,6 +3040,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -2882,12 +3056,14 @@ "node_modules/istanbul-lib-source-maps/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/istanbul-reports": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -2897,14 +3073,15 @@ } }, "node_modules/jest": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", - "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, "dependencies": { - "@jest/core": "^29.6.4", + "@jest/core": "^29.7.0", "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.6.4" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" @@ -2922,12 +3099,13 @@ } }, "node_modules/jest-changed-files": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", - "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, "dependencies": { "execa": "^5.0.0", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" }, "engines": { @@ -2935,27 +3113,28 @@ } }, "node_modules/jest-circus": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", - "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/expect": "^29.6.4", - "@jest/test-result": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-runtime": "^29.6.4", - "jest-snapshot": "^29.6.4", - "jest-util": "^29.6.3", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -2965,21 +3144,21 @@ } }, "node_modules/jest-cli": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", - "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, "dependencies": { - "@jest/core": "^29.6.4", - "@jest/test-result": "^29.6.4", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.6.4", - "jest-util": "^29.6.3", - "jest-validate": "^29.6.3", - "prompts": "^2.0.1", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "yargs": "^17.3.1" }, "bin": { @@ -2998,30 +3177,31 @@ } }, "node_modules/jest-config": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", - "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.6.4", + "@jest/test-sequencer": "^29.7.0", "@jest/types": "^29.6.3", - "babel-jest": "^29.6.4", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.6.4", - "jest-environment-node": "^29.6.4", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", "jest-get-type": "^29.6.3", "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.6.4", - "jest-runner": "^29.6.4", - "jest-util": "^29.6.3", - "jest-validate": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -3042,23 +3222,25 @@ } }, "node_modules/jest-diff": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.6.4.tgz", - "integrity": "sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, "dependencies": { "chalk": "^4.0.0", "diff-sequences": "^29.6.3", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-docblock": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", - "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, "dependencies": { "detect-newline": "^3.0.0" }, @@ -3067,31 +3249,33 @@ } }, "node_modules/jest-each": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", - "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", - "jest-util": "^29.6.3", - "pretty-format": "^29.6.3" + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", - "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/fake-timers": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.6.3", - "jest-util": "^29.6.3" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3101,14 +3285,16 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.6.4.tgz", - "integrity": "sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", @@ -3117,8 +3303,8 @@ "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", "jest-regex-util": "^29.6.3", - "jest-util": "^29.6.3", - "jest-worker": "^29.6.4", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -3130,35 +3316,38 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", - "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, "dependencies": { "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.6.4.tgz", - "integrity": "sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.6.3.tgz", - "integrity": "sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@jest/types": "^29.6.3", @@ -3166,7 +3355,7 @@ "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -3175,13 +3364,14 @@ } }, "node_modules/jest-mock": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.6.3.tgz", - "integrity": "sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.6.3" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3191,6 +3381,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, "engines": { "node": ">=6" }, @@ -3207,21 +3398,23 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", - "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.6.3", - "jest-validate": "^29.6.3", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" @@ -3231,41 +3424,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", - "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, "dependencies": { "jest-regex-util": "^29.6.3", - "jest-snapshot": "^29.6.4" + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", - "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", - "dependencies": { - "@jest/console": "^29.6.4", - "@jest/environment": "^29.6.4", - "@jest/test-result": "^29.6.4", - "@jest/transform": "^29.6.4", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.6.3", - "jest-environment-node": "^29.6.4", - "jest-haste-map": "^29.6.4", - "jest-leak-detector": "^29.6.3", - "jest-message-util": "^29.6.3", - "jest-resolve": "^29.6.4", - "jest-runtime": "^29.6.4", - "jest-util": "^29.6.3", - "jest-watcher": "^29.6.4", - "jest-worker": "^29.6.4", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -3274,16 +3469,17 @@ } }, "node_modules/jest-runtime": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", - "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, "dependencies": { - "@jest/environment": "^29.6.4", - "@jest/fake-timers": "^29.6.4", - "@jest/globals": "^29.6.4", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", "@jest/source-map": "^29.6.3", - "@jest/test-result": "^29.6.4", - "@jest/transform": "^29.6.4", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", @@ -3291,13 +3487,13 @@ "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-mock": "^29.6.3", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.6.4", - "jest-snapshot": "^29.6.4", - "jest-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -3306,29 +3502,30 @@ } }, "node_modules/jest-snapshot": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.6.4.tgz", - "integrity": "sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.6.4", - "@jest/transform": "^29.6.4", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.6.4", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.6.4", + "jest-diff": "^29.7.0", "jest-get-type": "^29.6.3", - "jest-matcher-utils": "^29.6.4", - "jest-message-util": "^29.6.3", - "jest-util": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.6.3", + "pretty-format": "^29.7.0", "semver": "^7.5.3" }, "engines": { @@ -3336,9 +3533,10 @@ } }, "node_modules/jest-util": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", - "integrity": "sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "@types/node": "*", @@ -3352,16 +3550,17 @@ } }, "node_modules/jest-validate": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", - "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, "dependencies": { "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.6.3" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3371,6 +3570,7 @@ "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, "engines": { "node": ">=10" }, @@ -3379,17 +3579,18 @@ } }, "node_modules/jest-watcher": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", - "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, "dependencies": { - "@jest/test-result": "^29.6.4", + "@jest/test-result": "^29.7.0", "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "engines": { @@ -3397,12 +3598,13 @@ } }, "node_modules/jest-worker": { - "version": "29.6.4", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.6.4.tgz", - "integrity": "sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.6.3", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -3414,6 +3616,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { "node": ">=8" } @@ -3422,6 +3625,7 @@ "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -3435,12 +3639,14 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -3453,6 +3659,7 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, "bin": { "jsesc": "bin/jsesc" }, @@ -3463,12 +3670,14 @@ "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", - "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==" + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, "bin": { "json5": "lib/cli.js" }, @@ -3525,6 +3734,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, "engines": { "node": ">=6" } @@ -3533,6 +3743,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, "engines": { "node": ">=6" } @@ -3540,12 +3751,14 @@ "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==" + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true }, "node_modules/locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -3604,10 +3817,26 @@ "node": ">=10" } }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, "dependencies": { "tmpl": "1.0.5" } @@ -3628,7 +3857,8 @@ "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==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true }, "node_modules/methods": { "version": "1.1.2", @@ -3642,6 +3872,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -3684,6 +3915,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, "engines": { "node": ">=6" } @@ -3692,6 +3924,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -3789,7 +4022,8 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true }, "node_modules/negotiator": { "version": "0.6.3", @@ -3802,12 +4036,14 @@ "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", - "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==" + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true }, "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==" + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true }, "node_modules/nodemon": { "version": "3.0.1", @@ -3871,6 +4107,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -3879,6 +4116,7 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, "dependencies": { "path-key": "^3.0.0" }, @@ -3935,6 +4173,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, "dependencies": { "mimic-fn": "^2.1.0" }, @@ -3949,6 +4188,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -3963,6 +4203,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -3974,6 +4215,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -3988,6 +4230,7 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, "engines": { "node": ">=6" } @@ -3996,6 +4239,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", @@ -4039,6 +4283,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, "engines": { "node": ">=8" } @@ -4047,6 +4292,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -4055,6 +4301,7 @@ "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" } @@ -4062,7 +4309,8 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true }, "node_modules/path-to-regexp": { "version": "0.1.7", @@ -4072,12 +4320,14 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "engines": { "node": ">=8.6" }, @@ -4089,6 +4339,7 @@ "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, "engines": { "node": ">= 6" } @@ -4097,6 +4348,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, "dependencies": { "find-up": "^4.0.0" }, @@ -4105,9 +4357,10 @@ } }, "node_modules/pretty-format": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", - "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -4121,6 +4374,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, "engines": { "node": ">=10" }, @@ -4132,6 +4386,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -4167,6 +4422,7 @@ "version": "6.0.3", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.3.tgz", "integrity": "sha512-KddyFewCsO0j3+np81IQ+SweXLDnDQTs5s67BOnrYmYe/yNmUhttQyGsYzy8yUnoljGAQ9sl38YB4vH8ur7Y+w==", + "dev": true, "funding": [ { "type": "individual", @@ -4217,7 +4473,8 @@ "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true }, "node_modules/readdirp": { "version": "3.6.0", @@ -4250,9 +4507,10 @@ } }, "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "version": "1.22.6", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", + "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "dev": true, "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -4269,6 +4527,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, "dependencies": { "resolve-from": "^5.0.0" }, @@ -4280,6 +4539,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, "engines": { "node": ">=8" } @@ -4288,6 +4548,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, "engines": { "node": ">=10" } @@ -4395,6 +4656,7 @@ "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" }, @@ -4406,6 +4668,7 @@ "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" } @@ -4426,7 +4689,8 @@ "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true }, "node_modules/simple-update-notifier": { "version": "2.0.0", @@ -4443,12 +4707,14 @@ "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, "engines": { "node": ">=8" } @@ -4457,6 +4723,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -4465,6 +4732,7 @@ "version": "0.5.13", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -4473,7 +4741,8 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true }, "node_modules/sqlstring": { "version": "2.3.3", @@ -4487,6 +4756,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, "dependencies": { "escape-string-regexp": "^2.0.0" }, @@ -4506,6 +4776,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, "dependencies": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" @@ -4542,6 +4813,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, "engines": { "node": ">=8" } @@ -4550,6 +4822,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { "node": ">=6" } @@ -4558,6 +4831,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, "engines": { "node": ">=8" }, @@ -4569,6 +4843,7 @@ "version": "8.1.2", "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "dev": true, "dependencies": { "component-emitter": "^1.3.0", "cookiejar": "^2.1.4", @@ -4589,6 +4864,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -4605,6 +4881,7 @@ "version": "2.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "dev": true, "bin": { "mime": "cli.js" }, @@ -4615,12 +4892,14 @@ "node_modules/superagent/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/supertest": { "version": "6.3.3", "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.3.tgz", "integrity": "sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA==", + "dev": true, "dependencies": { "methods": "^1.1.2", "superagent": "^8.0.5" @@ -4633,6 +4912,7 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -4644,6 +4924,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -4655,6 +4936,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, "dependencies": { "@istanbuljs/schema": "^0.1.2", "glob": "^7.1.4", @@ -4686,12 +4968,14 @@ "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", - "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==" + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true }, "node_modules/to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, "engines": { "node": ">=4" } @@ -4700,6 +4984,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -4736,6 +5021,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, "engines": { "node": ">=4" } @@ -4744,6 +5030,7 @@ "version": "0.21.3", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, "engines": { "node": ">=10" }, @@ -4958,6 +5245,7 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==", + "dev": true, "funding": [ { "type": "opencollective", @@ -5003,6 +5291,7 @@ "version": "9.1.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", @@ -5015,7 +5304,8 @@ "node_modules/v8-to-istanbul/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true }, "node_modules/vary": { "version": "1.1.2", @@ -5029,6 +5319,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, "dependencies": { "makeerror": "1.0.12" } @@ -5037,6 +5328,7 @@ "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" }, @@ -5072,6 +5364,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, "dependencies": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" @@ -5122,6 +5415,7 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index b45ec22..62effe5 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,10 @@ "author": "", "license": "ISC", "devDependencies": { + "jest": "^29.7.0", "morgan": "^1.10.0", - "nodemon": "^3.0.1" + "nodemon": "^3.0.1", + "supertest": "^6.3.3" }, "prettier": { "printWidth": 80, @@ -26,10 +28,8 @@ "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", - "jest": "^29.6.4", "jsonwebtoken": "^9.0.2", "mysql2": "^3.6.0", - "supertest": "^6.3.3", "typeorm": "^0.3.17" } } diff --git a/tests/fixtures/user-fixture.js b/tests/fixtures/user-fixture.js index e69de29..0bce06c 100644 --- a/tests/fixtures/user-fixture.js +++ b/tests/fixtures/user-fixture.js @@ -0,0 +1,37 @@ +const { dataSource } = require('../../api/models/dataSource'); + +const createMeberGrades = async (memberGradeList) => { + let data = []; + for (memberGrade of memberGradeList) { + data.push([memberGrade.id, memberGrade.name, memberGrade.emoji]); + } + return await dataSource.query( + `INSERT INTO member_grades (id, name, emoji) VALUES ?`, + [data] + ); +}; + +const createMembers = async (memberList) => { + let userData = []; + let memberProfileData = []; + for (member of memberList) { + userData.push([member.id, member.email, member.nickname]); + memberProfileData.push([ + member.id, + member.gradeId, + member.height, + member.weight, + member.age, + member.gender, + ]); + } + await dataSource.query(`INSERT INTO users (id, email, nickname) VALUES ?`, [ + userData, + ]); + await dataSource.query( + `INSERT INTO member_profiles (user_id, member_grade_id, height, weight, age, gender) VALUES ?`, + [memberProfileData] + ); +}; + +module.exports = { createMeberGrades, createMembers }; diff --git a/tests/test-client.js b/tests/test-client.js index 353526e..b690783 100644 --- a/tests/test-client.js +++ b/tests/test-client.js @@ -1,9 +1,9 @@ -const dataSource = require('../api/models/dataSource'); +const { dataSource } = require('../api/models/dataSource'); const truncateTables = async (tableList) => { await dataSource.query(`SET FOREIGN_KEY_CHECKS=0`); - for (let table of tables) { + for (let table of tableList) { await dataSource.query(`TRUNCATE table ${table}`); } diff --git a/tests/tests/user.test.js b/tests/tests/user.test.js index e69de29..3af1889 100644 --- a/tests/tests/user.test.js +++ b/tests/tests/user.test.js @@ -0,0 +1,233 @@ +const request = require('supertest'); +const { createApp } = require('../../app'); +const { dataSource } = require('../../api/models/dataSource'); +const { truncateTables } = require('../test-client'); +const userFixture = require('../fixtures/user-fixture'); +const userService = require('../../api/services/userService'); + +describe('Social Sign In', () => { + let app; + + const grade1 = { + id: 1, + name: 'bronze', + emoji: '๐Ÿฅ‰', + }; + + const grade2 = { + id: 2, + name: 'silver', + emoji: '๐Ÿฅˆ', + }; + + const grade3 = { + id: 3, + name: 'gold', + emoji: '๐Ÿฅ‡', + }; + + const member1 = { + id: 1, + email: 'wecode@co.kr', + nickname: '์œ„์ฝ”๋“œ', + gradeId: 3, + height: 150, + weight: 99, + age: 33, + gender: 'male', + }; + + const member2 = { + id: 2, + email: 'neecode@com', + nickname: null, + gradeId: 1, + height: null, + weight: null, + age: 42, + gender: 'female', + }; + + beforeAll(async () => { + app = createApp(); + await dataSource.initialize(); + await userFixture.createMeberGrades([grade1, grade2, grade3]); + await userFixture.createMembers([member1, member2]); + }); + + afterAll(async () => { + const tableList = ['users', 'member_profiles', 'member_grades']; + await truncateTables(tableList); + + await dataSource.destroy(); + }); + + test('SUCCESS: FIRST KAKAO SIGN IN', async () => { + userService.getKaKaoAccessToken = jest + .fn() + .mockImplementation((authCode, redirectUri) => 'kakaoMockingAccessToken'); + userService.getUserInformation = jest + .fn() + .mockImplementation((kakaoAccessToken) => { + return { + email: 'mocked@Ema.il', + birthyear: '1993', + birthday: '0101', + gender: 'male', + }; + }); + await request(app) + .post('/user/kakao-sign-in?code=mockingAuthCode') + .expect(202) + .expect({ + message: 'BASIC REGISTRATION SUCCESSFUL. NEED ADDITIONAL INFORMATION', + }); + expect(userService.getKaKaoAccessToken).toBeCalledWith( + 'mockingAuthCode', + `${process.env.SIGN_IN_REDIRECT_URI}` + ); + expect(userService.getUserInformation).toBeCalledWith( + 'kakaoMockingAccessToken' + ); + }); + + test('SUCCESS: BASIC INFORMATION MEMBER SIGN IN', async () => { + userService.getKaKaoAccessToken = jest + .fn() + .mockImplementation((authCode, redirectUri) => 'kakaoMockingAccessToken'); + userService.getUserInformation = jest + .fn() + .mockImplementation((kakaoAccessToken) => { + return { + email: 'neecode@com', + birthyear: '1981', + birthday: '0101', + gender: 'male', + }; + }); + + await request(app) + .post('/user/kakao-sign-in?code=mockingAuthCode') + .expect(202) + .expect({ + message: 'NEED ADDITIONAL INFORMATION', + }); + expect(userService.getKaKaoAccessToken).toBeCalledWith( + 'mockingAuthCode', + `${process.env.SIGN_IN_REDIRECT_URI}` + ); + expect(userService.getUserInformation).toBeCalledWith( + 'kakaoMockingAccessToken' + ); + }); + + test('SUCCESS: ADDITIONAL INFORMATION MEMBER SIGN IN', async () => { + userService.getKaKaoAccessToken = jest + .fn() + .mockImplementation((authCode, redirectUri) => 'kakaoMockingAccessToken'); + userService.getUserInformation = jest + .fn() + .mockImplementation((kakaoAccessToken) => { + return { + email: 'wecode@co.kr', + birthyear: '1990', + birthday: '0101', + gender: 'male', + }; + }); + + await request(app) + .post('/user/kakao-sign-in?code=mockingAuthCode') + .expect(200) + .expect((res) => { + const { message, authorization } = res.body; + expect(message).toEqual('SIGN IN COMPLETED'); + expect(authorization).toMatch(/\w+/); + }); + expect(userService.getKaKaoAccessToken).toBeCalledWith( + 'mockingAuthCode', + `${process.env.SIGN_IN_REDIRECT_URI}` + ); + expect(userService.getUserInformation).toBeCalledWith( + 'kakaoMockingAccessToken' + ); + }); + + test('SUCCESS: ADD ADDITIONAL INFORMATION', async () => { + userService.getKaKaoAccessToken = jest + .fn() + .mockImplementation((authCode, redirectUri) => 'kakaoMockingAccessToken'); + userService.getUserInformation = jest + .fn() + .mockImplementation((kakaoAccessToken) => { + return { + email: 'neecode@com', + birthyear: '1981', + birthday: '0101', + gender: 'male', + }; + }); + + await request(app) + .post('/user/kakao-sign-up?code=mockingAuthCode') + .send({ nickname: '๋‹ˆ์ฝ”๋“œ', height: 150, weight: 77 }) + .expect(200) + .expect((res) => { + const { message, authorization } = res.body; + expect(message).toEqual('SIGN UP COMPLETED'); + expect(authorization).toMatch(/\w+/); + }); + expect(userService.getKaKaoAccessToken).toBeCalledWith( + 'mockingAuthCode', + `${process.env.SIGN_UP_REDIRECT_URI}` + ); + expect(userService.getUserInformation).toBeCalledWith( + 'kakaoMockingAccessToken' + ); + }); + + test('FAIL: ADD ADDITIONAL INFORMATION', async () => { + userService.getKaKaoAccessToken = jest + .fn() + .mockImplementation((authCode, redirectUri) => 'kakaoMockingAccessToken'); + userService.getUserInformation = jest + .fn() + .mockImplementation((kakaoAccessToken) => { + return { + email: 'neecode@com', + birthyear: '1981', + birthday: '0101', + gender: 'male', + }; + }); + + await request(app) + .post('/user/kakao-sign-up?code=mockingAuthCode') + .send({ nickname: null, height: 150, weight: 77 }) + .expect(400) + .expect({ message: 'KEY_ERROR' }); + expect(userService.getKaKaoAccessToken).toBeCalledWith( + 'mockingAuthCode', + `${process.env.SIGN_UP_REDIRECT_URI}` + ); + expect(userService.getUserInformation).toBeCalledWith( + 'kakaoMockingAccessToken' + ); + }); + + test('SUCCESS: CHECK DUPLICATE NICKNAME', async () => { + await request(app) + .post('/user/duplicate-nickname') + .send({ nickname: '๋‚ด์ฝ”๋“œ' }) + .expect(200) + .expect({ message: 'AVAILABLE NICKNAME' }); + }); + + test('FAIL: CHECK DUPLICATE NICKNAME', async () => { + await request(app) + .post('/user/duplicate-nickname') + .send({ nickname: '์œ„์ฝ”๋“œ' }) + .expect(409) + .expect({ message: 'DUPLICATED NICKNAME' }); + }); +}); From 31f3afe0ea4911903ef306c233b4f840aac76c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Tue, 19 Sep 2023 15:10:06 +0900 Subject: [PATCH 36/54] add : custom/checkExercise, custom/checkDiet --- api/controllers/managementController.js | 27 ++++++++++- api/models/managementDao.js | 62 +++++++++++++++++++++---- api/routes/managementRouter.js | 11 ++++- api/services/managementService.js | 21 +++++++-- 4 files changed, 106 insertions(+), 15 deletions(-) diff --git a/api/controllers/managementController.js b/api/controllers/managementController.js index 5d2e9f3..ff46084 100644 --- a/api/controllers/managementController.js +++ b/api/controllers/managementController.js @@ -22,4 +22,29 @@ const membershipStart = catchAsync(async (req, res) => { res.status(200).json({ message: 'SUCCESS' }); }); -module.exports = { getManagement, membershipStart }; +const checkExercise = catchAsync(async (req, res) => { + const memberId = req.user.userId; + const { id, checked, selectedDate } = req.body; + const checkbox = checked; + const weekday = selectedDate; + const exerciseId = id; + await managementService.checkExercise( + checkbox, + memberId, + weekday, + exerciseId + ); + res.status(200).json({ message: 'SUCCESS' }); +}); + +const checkDiet = catchAsync(async (req, res) => { + const memberId = req.user.userId; + const { id, checked, selectedDate } = req.body; + const checkbox = checked; + const weekday = selectedDate; + const dietId = id; + await managementService.checkDiet(checkbox, memberId, weekday, dietId); + res.status(200).json({ message: 'SUCCESS' }); +}); + +module.exports = { getManagement, membershipStart, checkExercise, checkDiet }; diff --git a/api/models/managementDao.js b/api/models/managementDao.js index f4b3038..39cc2b8 100644 --- a/api/models/managementDao.js +++ b/api/models/managementDao.js @@ -28,11 +28,11 @@ const getExerciseList = async (memberId, weekday) => { const exerciseList = await dataSource.query( ` SELECT - id as exerciseId, - name as exerciseName, - description as exerciseDescription, - image_url as exerciseImageUrl, - checkbox as exerciseCheckbox + id, + name, + description, + image_url as imageUrl, + checkbox FROM exercises WHERE member_id = ? AND weekday = ?; @@ -52,10 +52,14 @@ const getDietList = async (memberId, weekday) => { const dietList = await dataSource.query( ` SELECT - id as dietId, - name as dietName, - description as dietDescription - FROM diets + d.id as id, + d.name as name, + d.description as description, + i.image_url as imageUrl, + d.checkbox as checkbox + FROM diets d + LEFT JOIN diet_images i + ON d.id = i.diet_id WHERE member_id = ? AND weekday = ?; `, @@ -107,10 +111,50 @@ const getMembershipIdByUser = async (userId) => { } }; +const checkExercise = async (checkbox, memberId, weekday, exerciseId) => { + try { + return await dataSource.query( + ` + UPDATE exercises + SET checkbox = ? + WHERE member_id = ? + AND weekday = ? + ANd id = ?; + `, + [checkbox, memberId, weekday, exerciseId] + ); + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const checkDiet = async (checkbox, memberId, weekday, dietId) => { + try { + return await dataSource.query( + ` + UPDATE diets + SET checkbox = ? + WHERE member_id = ? + AND weekday = ? + ANd id = ?; + `, + [checkbox, memberId, weekday, dietId] + ); + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { getExerciseList, getDietList, getMembershipByUser, membershipStart, getMembershipIdByUser, + checkExercise, + checkDiet, }; diff --git a/api/routes/managementRouter.js b/api/routes/managementRouter.js index c12b0dc..fb3711a 100644 --- a/api/routes/managementRouter.js +++ b/api/routes/managementRouter.js @@ -10,5 +10,14 @@ managementRouter.post( loginRequired, managementController.membershipStart ); - +managementRouter.post( + '/checkExercise', + loginRequired, + managementController.checkExercise +); +managementRouter.post( + '/checkDiet', + loginRequired, + managementController.checkDiet +); module.exports = { managementRouter }; diff --git a/api/services/managementService.js b/api/services/managementService.js index edd194c..3e5abb3 100644 --- a/api/services/managementService.js +++ b/api/services/managementService.js @@ -12,9 +12,9 @@ const getManagement = async (userId, weekday) => { ]); return { - membership: membershipResult[0], - exercise: exerciseResult[0], - diet: dietResult[0], + membership: membershipResult, + exercise: exerciseResult, + diet: dietResult, }; }; @@ -30,4 +30,17 @@ const membershipStart = async (userId, startDate, endDate) => { ); }; -module.exports = { getManagement, membershipStart }; +const checkExercise = async (checkbox, memberId, weekday, exerciseId) => { + return await managementDao.checkExercise( + checkbox, + memberId, + weekday, + exerciseId + ); +}; + +const checkDiet = async (checkbox, memberId, weekday, dietId) => { + return await managementDao.checkDiet(checkbox, memberId, weekday, dietId); +}; + +module.exports = { getManagement, membershipStart, checkExercise, checkDiet }; From ee3cc9cc53b073e46cb8374b11ef8c5e91d5f42d Mon Sep 17 00:00:00 2001 From: jieunyang Date: Wed, 20 Sep 2023 01:05:19 +0900 Subject: [PATCH 37/54] add: create post --- api/controllers/postController.js | 14 ++++++++++++-- api/models/postDao.js | 30 ++++++++++++++++++++++++++++-- api/routes/postRouter.js | 1 + api/services/postService.js | 6 +++++- api/utils/types.js | 8 -------- 5 files changed, 46 insertions(+), 13 deletions(-) delete mode 100644 api/utils/types.js diff --git a/api/controllers/postController.js b/api/controllers/postController.js index 06c1f38..6c656b9 100644 --- a/api/controllers/postController.js +++ b/api/controllers/postController.js @@ -3,7 +3,6 @@ const postService = require('../services/postService'); const getPostListAll = catchAsync(async (req, res) => { const allPosts = await postService.getPostListAll(); - res.status(201).json({ data: allPosts }); }); @@ -13,4 +12,15 @@ const getPostListDetail = catchAsync(async (req, res) => { res.status(201).json({ data: post }); }); -module.exports = { getPostListAll, getPostListDetail }; +const postCommunity = catchAsync(async (req, res) => { + const { userId, category, title, content } = req.body; + const thread = await postService.postCommunity( + userId, + category, + title, + content + ); + res.status(201).json({ message: 'Post created successfully', thread }); +}); + +module.exports = { getPostListAll, getPostListDetail, postCommunity }; diff --git a/api/models/postDao.js b/api/models/postDao.js index 6a5ab0d..6e2671a 100644 --- a/api/models/postDao.js +++ b/api/models/postDao.js @@ -56,7 +56,7 @@ const getPostListDetail = async (postId) => { SELECT JSON_ARRAYAGG( JSON_OBJECT( 'commentId', c.id, - 'commentTime', DATE_FORMAT(c.created_at, '%Y-%m-%d'), + 'commentTime', DATE_FORMAT(c.created_at, '%Y.%m.%d'), 'nickname', cu.nickname, 'content', c.content ) @@ -97,4 +97,30 @@ const getCommentsCountForThread = async (threadId) => { return result[0].commentCount; }; -module.exports = { getPostListAll, getPostListDetail }; +const postCommunity = async (userId, category, title, content) => { + try { + const result = await dataSource.query( + ` + INSERT INTO threads ( + user_id, + thread_types_id, + title, + content + ) VALUES ( + ?, + ?, + ?, + ? + ) + `, + [userId, category, title, content] + ); + const insertThreadId = result.insertId; + return insertThreadId; + } catch (error) { + console.error('Error in postCommunity:', error); + throw new error('Internal Server Error'); + } +}; + +module.exports = { getPostListAll, getPostListDetail, postCommunity }; diff --git a/api/routes/postRouter.js b/api/routes/postRouter.js index 80bbaeb..3acb9f5 100644 --- a/api/routes/postRouter.js +++ b/api/routes/postRouter.js @@ -4,5 +4,6 @@ const postRouter = express.Router(); postRouter.get('/posts/all', postController.getPostListAll); postRouter.get('/posts/:postId', postController.getPostListDetail); +postRouter.post('/posts/upload', postController.postCommunity); module.exports = { postRouter }; diff --git a/api/services/postService.js b/api/services/postService.js index ced083f..db1ded6 100644 --- a/api/services/postService.js +++ b/api/services/postService.js @@ -8,4 +8,8 @@ const getPostListDetail = async (postId) => { return await postDao.getPostListDetail(postId); }; -module.exports = { getPostListAll, getPostListDetail }; +const postCommunity = async (userId, category, title, content) => { + return await postDao.postCommunity(userId, category, title, content); +}; + +module.exports = { getPostListAll, getPostListDetail, postCommunity }; diff --git a/api/utils/types.js b/api/utils/types.js deleted file mode 100644 index 387cfad..0000000 --- a/api/utils/types.js +++ /dev/null @@ -1,8 +0,0 @@ -const threadTypes = { - ์ž์œ : 2, - ์ฝ”์นญ: 3, -}; // mapping - -module.exports = { - threadTypes, -}; From 9c5eff7488fd30487dda6836889058923133a3de Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Wed, 20 Sep 2023 11:24:04 +0900 Subject: [PATCH 38/54] add : consultant list 1 --- api/controllers/consultantController.js | 20 +++++++++-- api/models/consultantDao.js | 48 ++++++++++++++++++++++++- api/routes/consultantRouter.js | 1 + api/routes/index.js | 5 ++- api/services/consultantService.js | 15 +++++--- 5 files changed, 80 insertions(+), 9 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index 7a325ad..0faac4c 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -8,7 +8,7 @@ const createConsultant = catchAsync(async (req, res) => { const thread = await consultantService.createConsultThreads(userId, threadTypesId, content, trainerId); - res.status(201).json({message : "success"}) + res.status(201).json({message :"success"}) }); const deleteConsultant = catchAsync(async (req, res) => { @@ -20,5 +20,19 @@ const deleteConsultant = catchAsync(async (req, res) => { res.status(201).json({message : "success"}) }); -module.exports = { createConsultant, -deleteConsultant }; \ No newline at end of file +const getConsultant = catchAsync(async (req, res) => { + const userId = req.params.userId; + + const threadTypesId = req.params.thread_types_id; + + const list = await consultantService.getConsultantList(userId, threadTypesId); + + res.status(201).json({message : list}) + + +}) + +module.exports = { + createConsultant, + deleteConsultant, + getConsultant }; \ No newline at end of file diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index 644d1ce..e9a3615 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -56,4 +56,50 @@ const createConsultant = async (userId, threadTypesId, content, trainerProfileId } }; - module.exports = { createConsultant, deleteConsultant }; \ No newline at end of file + const getConsultant = async(userId, threadTypesId) => { + console.log("model" ,userId, threadTypesId); + + try { + const data = await dataSource.query( + ` + select + t.id as thread_id, + t.thread_types_id, + t.content, + t.trainer_profile_id, + t.created_at, + tt.name as threadTypeName, + u.nickname as trainerNickname, + u.profile_image as trainerProfileImage, + tg.name as emojiName + from threads t + + join thread_types tt + + on tt.id = t.thread_types_id + + join trainer_profiles tp + + on tp.id = t.trainer_profile_id + + Join users u + + On t.user_id = u.id + + Join trainer_grades tg + + On tg.id = tp.trainer_grade_id + + WHERE t.user_id = ? AND tt.id = ? + `, + [userId, 3] + ); + return data; + + } catch{ + const error = new Error("error"); + error.statusCode = 400; + throw error; + } + }; + module.exports = { createConsultant, deleteConsultant, getConsultant }; diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index f74ad7b..aa43334 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -7,5 +7,6 @@ const { loginRequired } = require("../utils/auth"); consultantRouter.post("/posts/upload", consultantController.createConsultant); consultantRouter.delete("/posts/:postId", consultantController.deleteConsultant); +consultantRouter.get("/posts/list/:thread_types_id", consultantController.getConsultant) module.exports = { consultantRouter }; \ No newline at end of file diff --git a/api/routes/index.js b/api/routes/index.js index c83ee91..7e65631 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -5,8 +5,11 @@ const { managementRouter } = require('./managementRouter'); const router = express.Router(); -router.use('/user', userRouter); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); +router.use("/consultant", consultantRouter); +router.use('/users', userRouter); +router.use('/community', postRouter); +router.use('/payments', paymentRouter); module.exports = { router }; diff --git a/api/services/consultantService.js b/api/services/consultantService.js index a1897b5..287a0d6 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -8,8 +8,15 @@ const createConsultThreads = async (userId, threadTypesId, content, trainerId) = const deleteConsultantThreads = async (threadId) => { const result = await consultantDao.deleteConsultant(threadId) - return result -} + return result; +}; + +const getConsultantList = async (userId, threadTypesId) => { + const result = await consultantDao.getConsultant(userId, threadTypesId); + return result; +}; -module.exports = { createConsultThreads, -deleteConsultantThreads }; \ No newline at end of file +module.exports = { + createConsultThreads, + deleteConsultantThreads, + getConsultantList }; \ No newline at end of file From aa699edc165c20d619e1d75b73c2c651373dd9e4 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Wed, 20 Sep 2023 11:24:04 +0900 Subject: [PATCH 39/54] add : consultant list modify index & finish --- api/controllers/consultantController.js | 52 ++++++------ api/models/consultantDao.js | 105 ++++++++++++------------ api/routes/index.js | 7 +- 3 files changed, 86 insertions(+), 78 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index 0faac4c..bddbdcb 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -1,38 +1,40 @@ -const consultantService = require("../services/consultantService"); -const { catchAsync } = require("../utils/error"); +const consultantService = require('../services/consultantService'); +const { catchAsync } = require('../utils/error'); const createConsultant = catchAsync(async (req, res) => { - const { content, trainerId, threadTypesId = 3 } = await req.body; - - const userId = req.user.userId; - - const thread = await consultantService.createConsultThreads(userId, threadTypesId, content, trainerId); + const { content, trainerId, threadTypesId = 3 } = await req.body; - res.status(201).json({message :"success"}) - }); + const userId = req.user.userId; + + const thread = await consultantService.createConsultThreads( + userId, + threadTypesId, + content, + trainerId + ); + + res.status(201).json({ message: 'success' }); +}); const deleteConsultant = catchAsync(async (req, res) => { + const threadId = req.params.postId; - const threadId = req.params.postId + const thread = await consultantService.deleteConsultantThreads(threadId); - const thread = await consultantService.deleteConsultantThreads(threadId); - - res.status(201).json({message : "success"}) + res.status(201).json({ message: 'success' }); }); const getConsultant = catchAsync(async (req, res) => { - const userId = req.params.userId; + const userId = req.params.userId; + const threadTypesId = req.params.thread_types_id; - const threadTypesId = req.params.thread_types_id; + const list = await consultantService.getConsultantList(userId, threadTypesId); - const list = await consultantService.getConsultantList(userId, threadTypesId); - - res.status(201).json({message : list}) - - -}) + res.status(201).json({ message: list }); +}); -module.exports = { - createConsultant, - deleteConsultant, - getConsultant }; \ No newline at end of file +module.exports = { + createConsultant, + deleteConsultant, + getConsultant, +}; diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index e9a3615..d1284af 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -1,10 +1,14 @@ -const {dataSource} = require("./dataSource"); +const { dataSource } = require('./dataSource'); - -const createConsultant = async (userId, threadTypesId, content, trainerProfileId) => { - try{ - await dataSource.query( - ` +const createConsultant = async ( + userId, + threadTypesId, + content, + trainerProfileId +) => { + try { + await dataSource.query( + ` INSERT INTO threads ( user_id, thread_types_id, @@ -17,51 +21,51 @@ const createConsultant = async (userId, threadTypesId, content, trainerProfileId ? ) `, - [userId, threadTypesId, content, trainerProfileId] - ) - }catch{ - const error = new Error("error"); - error.statusCode = 400; - throw error; - }}; + [userId, threadTypesId, content, trainerProfileId] + ); + } catch { + const error = new Error('error'); + error.statusCode = 400; + throw error; + } +}; - const deleteConsultant = async (threadId) => { - const queryRunner = await dataSource.createQueryRunner(); - await queryRunner.connect(); - await queryRunner.startTransaction(); +const deleteConsultant = async (threadId) => { + const queryRunner = await dataSource.createQueryRunner(); + await queryRunner.connect(); + await queryRunner.startTransaction(); - try { - await queryRunner.query ( - ` + try { + await queryRunner.query( + ` DELETE FROM comments WHERE thread_id = ? `, - [threadId] - ) - await queryRunner.query( - ` + [threadId] + ); + await queryRunner.query( + ` DELETE FROM threads WHERE id = ? `, - [threadId]); + [threadId] + ); - await queryRunner.commitTransaction(); - } catch{ - await queryRunner.rollbackTransaction(); - const error = new Error("error"); - error.statusCode = 400; - throw error; - } finally { - await queryRunner.release(); - } - }; + await queryRunner.commitTransaction(); + } catch { + await queryRunner.rollbackTransaction(); + const error = new Error('error'); + error.statusCode = 400; + throw error; + } finally { + await queryRunner.release(); + } +}; - const getConsultant = async(userId, threadTypesId) => { - console.log("model" ,userId, threadTypesId); - - try { - const data = await dataSource.query( - ` +const getConsultant = async (userId, threadTypesId) => { + try { + const data = await dataSource.query( + ` select t.id as thread_id, t.thread_types_id, @@ -92,14 +96,13 @@ const createConsultant = async (userId, threadTypesId, content, trainerProfileId WHERE t.user_id = ? AND tt.id = ? `, - [userId, 3] - ); - return data; - - } catch{ - const error = new Error("error"); + [userId, threadTypesId] + ); + return data; + } catch { + const error = new Error('error'); error.statusCode = 400; - throw error; - } - }; - module.exports = { createConsultant, deleteConsultant, getConsultant }; + throw error; + } +}; +module.exports = { createConsultant, deleteConsultant, getConsultant }; diff --git a/api/routes/index.js b/api/routes/index.js index 7e65631..954dbd5 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -2,13 +2,16 @@ const express = require('express'); const { userRouter } = require('./userRouter'); const { trainerRouter } = require('./trainerRouter'); const { managementRouter } = require('./managementRouter'); +const { consultantRouter } = require('./consultantRouter'); +const { postRouter } = require('./postRouter'); +const { paymentRouter } = require('./paymentRouter'); const router = express.Router(); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); -router.use("/consultant", consultantRouter); -router.use('/users', userRouter); +router.use('/consultant', consultantRouter); +router.use('/user', userRouter); router.use('/community', postRouter); router.use('/payments', paymentRouter); From f7f2c0362088c348f97058fdc645c9126163a38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Thu, 21 Sep 2023 11:42:31 +0900 Subject: [PATCH 40/54] fix: user to users --- api/routes/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/routes/index.js b/api/routes/index.js index 954dbd5..4b97e45 100644 --- a/api/routes/index.js +++ b/api/routes/index.js @@ -11,7 +11,7 @@ const router = express.Router(); router.use('/trainers', trainerRouter); router.use('/custom', managementRouter); router.use('/consultant', consultantRouter); -router.use('/user', userRouter); +router.use('/users', userRouter); router.use('/community', postRouter); router.use('/payments', paymentRouter); From 137bbbdcfe22405cf952a1d50857de354c0d6d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Thu, 21 Sep 2023 12:08:28 +0900 Subject: [PATCH 41/54] add : checkTreadId --- api/controllers/managementController.js | 16 +++++++++++++++- api/models/managementDao.js | 25 +++++++++++++++++++++++++ api/routes/managementRouter.js | 6 ++++++ api/services/managementService.js | 17 ++++++++++++++++- 4 files changed, 62 insertions(+), 2 deletions(-) diff --git a/api/controllers/managementController.js b/api/controllers/managementController.js index ff46084..1bc9801 100644 --- a/api/controllers/managementController.js +++ b/api/controllers/managementController.js @@ -47,4 +47,18 @@ const checkDiet = catchAsync(async (req, res) => { res.status(200).json({ message: 'SUCCESS' }); }); -module.exports = { getManagement, membershipStart, checkExercise, checkDiet }; +const checkThreadId = catchAsync(async (req, res) => { + const userId = req.user.userId; + const { trainerId } = req.query; + + const result = await managementService.getThreadId(userId, trainerId); + res.status(200).json({ message: result }); +}); + +module.exports = { + getManagement, + membershipStart, + checkExercise, + checkDiet, + checkThreadId, +}; diff --git a/api/models/managementDao.js b/api/models/managementDao.js index 39cc2b8..717b0be 100644 --- a/api/models/managementDao.js +++ b/api/models/managementDao.js @@ -149,6 +149,30 @@ const checkDiet = async (checkbox, memberId, weekday, dietId) => { } }; +const getThreadId = async (userId, trainerId) => { + try { + let trainerProfileId = await dataSource.query( + ` + SELECT id + FROM threads + WHERE user_id = ? + AND trainer_profile_id = ?; + `, + [userId, trainerId] + ); + if (trainerProfileId.length === 0) { + trainerProfileId = null; + return trainerProfileId; + } else { + return trainerProfileId[0].id; + } + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { getExerciseList, getDietList, @@ -157,4 +181,5 @@ module.exports = { getMembershipIdByUser, checkExercise, checkDiet, + getThreadId, }; diff --git a/api/routes/managementRouter.js b/api/routes/managementRouter.js index fb3711a..b921df9 100644 --- a/api/routes/managementRouter.js +++ b/api/routes/managementRouter.js @@ -20,4 +20,10 @@ managementRouter.post( loginRequired, managementController.checkDiet ); + +managementRouter.get( + '/checkId', + loginRequired, + managementController.checkThreadId +); module.exports = { managementRouter }; diff --git a/api/services/managementService.js b/api/services/managementService.js index 3e5abb3..cdc2ddb 100644 --- a/api/services/managementService.js +++ b/api/services/managementService.js @@ -43,4 +43,19 @@ const checkDiet = async (checkbox, memberId, weekday, dietId) => { return await managementDao.checkDiet(checkbox, memberId, weekday, dietId); }; -module.exports = { getManagement, membershipStart, checkExercise, checkDiet }; +const getThreadId = async (userId, trainerId) => { + let trainerProfileId = await managementDao.getThreadId(userId, trainerId); + let result = 'TRUE'; + if (trainerProfileId == null) { + result = 'FALSE'; + } + return result; +}; + +module.exports = { + getManagement, + membershipStart, + checkExercise, + checkDiet, + getThreadId, +}; From c1fc07665ee64181ccaa8fa6338450de886e2382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=8B=9C=EC=97=B0?= Date: Tue, 19 Sep 2023 14:30:00 +0900 Subject: [PATCH 42/54] add: updateMypage --- api/controllers/userController.js | 13 +++++++++++-- api/models/userDao.js | 24 ++++++++++++++++++++++++ api/routes/userRouter.js | 1 + api/services/userService.js | 5 +++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/api/controllers/userController.js b/api/controllers/userController.js index ce79704..319774e 100644 --- a/api/controllers/userController.js +++ b/api/controllers/userController.js @@ -73,9 +73,17 @@ const checkDuplicateNickname = catchAsync(async (req, res) => { const getMyPage = async (req, res) => { const userId = req.user.userId; - const myPage = await userService.getMyPage(userId); + const myPageData = await userService.getMyPage(userId); - res.status(200).json({ myPage }); + res.status(200).json({ myPageData }); +}; + +const updateMypage = async (req, res) => { + const userId = req.user.userId; + const { nickname, height, weight } = req.body; + await userService.updateMypage(nickname, height, weight, userId); + + res.status(200).json({ MESSAGE: 'SUCCESS' }); }; module.exports = { @@ -83,4 +91,5 @@ module.exports = { kakaoSignUp, checkDuplicateNickname, getMyPage, + updateMypage, }; diff --git a/api/models/userDao.js b/api/models/userDao.js index 7c773e8..247c2c4 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -140,6 +140,7 @@ const getMyPage = async (userId) => { SELECT u.nickname, g.emoji as emoji, + g.name as grade, p.height as height, p.weight as weight FROM users u @@ -157,6 +158,28 @@ const getMyPage = async (userId) => { } }; +const updateMypage = async (nickname, height, weight, userId) => { + try { + return await dataSource.query( + ` + UPDATE users u + INNER JOIN member_profiles p + ON u.id = p.user_id + SET + u.nickname = IFNULL(?, u.nickname), + p.height = IFNULL(?, p.height), + p.weight = IFNULL(?, p.weight) + WHERE u.id = ?; + `, + [nickname, height, weight, userId] + ); + } catch { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { getUserByEmail, createUser, @@ -165,4 +188,5 @@ module.exports = { getUserType, getGrade, getMyPage, + updateMypage, }; diff --git a/api/routes/userRouter.js b/api/routes/userRouter.js index 466fa06..087d7e1 100644 --- a/api/routes/userRouter.js +++ b/api/routes/userRouter.js @@ -8,5 +8,6 @@ userRouter.post('/kakao-sign-in', userController.kakaoSignIn); userRouter.post('/kakao-sign-up', userController.kakaoSignUp); userRouter.post('/duplicate-nickname', userController.checkDuplicateNickname); userRouter.get('/mypage', loginRequired, userController.getMyPage); +userRouter.post('/mypage/update', loginRequired, userController.updateMypage); module.exports = { userRouter }; diff --git a/api/services/userService.js b/api/services/userService.js index 035c11d..3c4d09e 100644 --- a/api/services/userService.js +++ b/api/services/userService.js @@ -98,6 +98,10 @@ const getMyPage = async (userId) => { return await userDao.getMyPage(userId); }; +const updateMypage = async (nickname, height, weight, userId) => { + return await userDao.updateMypage(nickname, height, weight, userId); +}; + module.exports = { getRedirectUri, getKaKaoAccessToken, @@ -111,4 +115,5 @@ module.exports = { addAdditionalInfo, getGrade, getMyPage, + updateMypage, }; From 2978d4a6deadc36386a4efdc65a7c273aa4b3232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Thu, 21 Sep 2023 17:31:00 +0900 Subject: [PATCH 43/54] fix: table name USERS to users --- api/models/userDao.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/models/userDao.js b/api/models/userDao.js index 247c2c4..275936c 100644 --- a/api/models/userDao.js +++ b/api/models/userDao.js @@ -18,7 +18,7 @@ const getUserByEmail = async (email) => { mm.membership_id AS membershipId, mm.start_date AS startDate, mm.end_date AS endDate - FROM USERS u + FROM users u LEFT JOIN member_profiles mp ON u.id = mp.user_id LEFT JOIN members_memberships mm ON u.id = mm.member_id WHERE u.email = ?; From 7c194c049d32e93335ea3a69b30151032b5e584c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Wed, 20 Sep 2023 20:14:22 +0900 Subject: [PATCH 44/54] feature: adding-image --- .env.sample | 5 +- api/controllers/managementController.js | 8 + api/controllers/postController.js | 9 +- api/models/managementDao.js | 14 + api/models/postDao.js | 30 +- api/routes/managementRouter.js | 9 + api/routes/postRouter.js | 9 +- api/services/managementService.js | 5 + api/services/postService.js | 16 +- api/utils/aws.js | 37 + package-lock.json | 1849 +++++++++++++++++++++-- package.json | 3 + 12 files changed, 1876 insertions(+), 118 deletions(-) create mode 100644 api/utils/aws.js diff --git a/.env.sample b/.env.sample index ce46ae0..7f09d4b 100644 --- a/.env.sample +++ b/.env.sample @@ -12,4 +12,7 @@ JWT_ALGORITHM = "JWT_ALGORITHM" GRANT_TYPE = GRANT_TYPE CLIENT_ID = CLIENT_ID SIGN_IN_REDIRECT_URI = REDIRECT_URI -SIGN_UP_REDIRECT_URI = REDIRECT_URI \ No newline at end of file +SIGN_UP_REDIRECT_URI = REDIRECT_URI +AWS_REGION = region +AWS_ACCESS_KEY_ID = access_key_id +AWS_SECRET_ACCESS_KEY = secret_access_key \ No newline at end of file diff --git a/api/controllers/managementController.js b/api/controllers/managementController.js index 1bc9801..eb15c1a 100644 --- a/api/controllers/managementController.js +++ b/api/controllers/managementController.js @@ -55,10 +55,18 @@ const checkThreadId = catchAsync(async (req, res) => { res.status(200).json({ message: result }); }); +const addDietImage = catchAsync(async (req, res) => { + const { dietId } = req.query; + const imageUrl = req.file.location; + await managementService.addDietImage(dietId, imageUrl); + res.status(200).json({ message: 'SUCCESS' }); +}); + module.exports = { getManagement, membershipStart, checkExercise, checkDiet, checkThreadId, + addDietImage, }; diff --git a/api/controllers/postController.js b/api/controllers/postController.js index 6c656b9..fa1dce6 100644 --- a/api/controllers/postController.js +++ b/api/controllers/postController.js @@ -13,14 +13,17 @@ const getPostListDetail = catchAsync(async (req, res) => { }); const postCommunity = catchAsync(async (req, res) => { - const { userId, category, title, content } = req.body; + const userId = req.user.userId; + const { category, title, content } = req.body; + const imageUrls = req.files.map((file) => file.location); const thread = await postService.postCommunity( userId, category, title, - content + content, + imageUrls ); - res.status(201).json({ message: 'Post created successfully', thread }); + res.status(201).json({ message: 'Post created successfully', id: thread }); }); module.exports = { getPostListAll, getPostListDetail, postCommunity }; diff --git a/api/models/managementDao.js b/api/models/managementDao.js index 717b0be..4715662 100644 --- a/api/models/managementDao.js +++ b/api/models/managementDao.js @@ -173,6 +173,19 @@ const getThreadId = async (userId, trainerId) => { } }; +const addDietImage = async (dietId, imageUrl) => { + try { + await dataSource.query( + `INSERT INTO diet_images (diet_id, image_url) VALUES (?,?)`, + [dietId, imageUrl] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { getExerciseList, getDietList, @@ -182,4 +195,5 @@ module.exports = { checkExercise, checkDiet, getThreadId, + addDietImage, }; diff --git a/api/models/postDao.js b/api/models/postDao.js index 6e2671a..40f7d31 100644 --- a/api/models/postDao.js +++ b/api/models/postDao.js @@ -97,7 +97,7 @@ const getCommentsCountForThread = async (threadId) => { return result[0].commentCount; }; -const postCommunity = async (userId, category, title, content) => { +const postCommunity = async (userId, category, title, content, imageUrls) => { try { const result = await dataSource.query( ` @@ -116,11 +116,35 @@ const postCommunity = async (userId, category, title, content) => { [userId, category, title, content] ); const insertThreadId = result.insertId; - return insertThreadId; + if (!imageUrls) { + return insertThreadId; + } else { + for (imageUrl of imageUrls) { + addPostImage(insertThreadId, imageUrl); + return insertThreadId; + } + } } catch (error) { console.error('Error in postCommunity:', error); throw new error('Internal Server Error'); } }; -module.exports = { getPostListAll, getPostListDetail, postCommunity }; +const addPostImage = async (threadId, imageUrl) => { + try { + dataSource.query( + `INSERT INTO thread_images (thread_id, image_url) VALUES (?,?)`, + [threadId, imageUrl] + ); + } catch (err) { + const newError = new Error('dataSource Error'); + newError.status = 400; + throw newError; + } +}; + +module.exports = { + getPostListAll, + getPostListDetail, + postCommunity, +}; diff --git a/api/routes/managementRouter.js b/api/routes/managementRouter.js index b921df9..3842ff1 100644 --- a/api/routes/managementRouter.js +++ b/api/routes/managementRouter.js @@ -1,5 +1,6 @@ const express = require('express'); const managementRouter = express.Router(); +const { upload } = require('../utils/aws'); const managementController = require('../controllers/managementController'); const { loginRequired } = require('../utils/auth'); @@ -26,4 +27,12 @@ managementRouter.get( loginRequired, managementController.checkThreadId ); + +managementRouter.post( + '/diet-image', + loginRequired, + upload.single('selectedFile'), + managementController.addDietImage +); + module.exports = { managementRouter }; diff --git a/api/routes/postRouter.js b/api/routes/postRouter.js index 3acb9f5..6adc266 100644 --- a/api/routes/postRouter.js +++ b/api/routes/postRouter.js @@ -1,9 +1,16 @@ const express = require('express'); const postController = require('../controllers/postController'); const postRouter = express.Router(); +const { upload } = require('../utils/aws'); +const { loginRequired } = require('../utils/auth'); postRouter.get('/posts/all', postController.getPostListAll); postRouter.get('/posts/:postId', postController.getPostListDetail); -postRouter.post('/posts/upload', postController.postCommunity); +postRouter.post( + '/posts/upload', + loginRequired, + upload.array('selectedFile'), + postController.postCommunity +); module.exports = { postRouter }; diff --git a/api/services/managementService.js b/api/services/managementService.js index cdc2ddb..96e7839 100644 --- a/api/services/managementService.js +++ b/api/services/managementService.js @@ -52,10 +52,15 @@ const getThreadId = async (userId, trainerId) => { return result; }; +const addDietImage = async (dietId, imageUrl) => { + await managementDao.addDietImage(dietId, imageUrl); +}; + module.exports = { getManagement, membershipStart, checkExercise, checkDiet, getThreadId, + addDietImage, }; diff --git a/api/services/postService.js b/api/services/postService.js index db1ded6..66079df 100644 --- a/api/services/postService.js +++ b/api/services/postService.js @@ -8,8 +8,18 @@ const getPostListDetail = async (postId) => { return await postDao.getPostListDetail(postId); }; -const postCommunity = async (userId, category, title, content) => { - return await postDao.postCommunity(userId, category, title, content); +const postCommunity = async (userId, category, title, content, imageUrls) => { + return await postDao.postCommunity( + userId, + category, + title, + content, + imageUrls + ); }; -module.exports = { getPostListAll, getPostListDetail, postCommunity }; +module.exports = { + getPostListAll, + getPostListDetail, + postCommunity, +}; diff --git a/api/utils/aws.js b/api/utils/aws.js new file mode 100644 index 0000000..92cf13e --- /dev/null +++ b/api/utils/aws.js @@ -0,0 +1,37 @@ +const { S3Client } = require('@aws-sdk/client-s3'); +const multer = require('multer'); +const multerS3 = require('multer-s3'); + +const getExtensionOfFile = (file) => { + const fileName = file.originalname; + const dotBeforeExtension = fileName.lastIndexOf('.'); + const lengthOfFileName = fileName.length; + const extension = fileName.substring(dotBeforeExtension, lengthOfFileName); + return extension; +}; + +const s3 = new S3Client({ + credentials: { + accessKeyId: process.env.AWS_ACCESS_KEY_ID, + secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY, + }, + region: process.env.AWS_REGION, +}); + +const upload = multer({ + storage: multerS3({ + s3: s3, + bucket: 'gyppt-bucket', + acl: 'public-read', + metadata: function (req, file, cb) { + cb(null, { fieldName: file.fieldname }); + }, + key: function (req, file, cb) { + const extension = getExtensionOfFile(file); + const fileName = `${Date.now().toString()}${extension}`; + cb(null, fileName); + }, + }), +}); + +module.exports = { upload }; diff --git a/package-lock.json b/package-lock.json index 94bc36c..3e28fe8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,15 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@aws-sdk/client-s3": "^3.414.0", "axios": "^1.5.0", "cors": "^2.8.5", "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", "jsonwebtoken": "^9.0.2", + "multer": "^1.4.5-lts.1", + "multer-s3": "^3.0.1", "mysql2": "^3.6.0", "typeorm": "^0.3.17" }, @@ -38,6 +41,769 @@ "node": ">=6.0.0" } }, + "node_modules/@aws-crypto/crc32": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32/-/crc32-3.0.0.tgz", + "integrity": "sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/crc32/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/crc32c": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/crc32c/-/crc32c-3.0.0.tgz", + "integrity": "sha512-ENNPPManmnVJ4BTXlOjAgD7URidbAznURqD0KvfREyc4o20DPYdEldU1f5cQ7Jbj0CJJSPaMIk/9ZshdB3210w==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/crc32c/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/ie11-detection": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/ie11-detection/-/ie11-detection-3.0.0.tgz", + "integrity": "sha512-341lBBkiY1DfDNKai/wXM3aujNBkXR7tq1URPQDL9wi3AUbI80NR74uF1TXHMm7po1AcnFk8iu2S2IeU/+/A+Q==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/ie11-detection/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha1-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha1-browser/-/sha1-browser-3.0.0.tgz", + "integrity": "sha512-NJth5c997GLHs6nOYTzFKTbYdMNA6/1XlKVgnZoaZcQ7z7UJlOgj2JdbHE8tiYLS3fzXNCguct77SPGat2raSw==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha1-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-browser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-browser/-/sha256-browser-3.0.0.tgz", + "integrity": "sha512-8VLmW2B+gjFbU5uMeqtQM6Nj0/F1bro80xQXCW6CQBWgosFWXTx77aeOF5CAIAmbOK64SdMBJdNr6J41yP5mvQ==", + "dependencies": { + "@aws-crypto/ie11-detection": "^3.0.0", + "@aws-crypto/sha256-js": "^3.0.0", + "@aws-crypto/supports-web-crypto": "^3.0.0", + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-locate-window": "^3.0.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-browser/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/sha256-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/sha256-js/-/sha256-js-3.0.0.tgz", + "integrity": "sha512-PnNN7os0+yd1XvXAy23CFOmTbMaDxgxXtTKHybrJ39Y8kGzBATgBFibWJKH6BhytLI/Zyszs87xCOBNyBig6vQ==", + "dependencies": { + "@aws-crypto/util": "^3.0.0", + "@aws-sdk/types": "^3.222.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/sha256-js/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/supports-web-crypto": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/supports-web-crypto/-/supports-web-crypto-3.0.0.tgz", + "integrity": "sha512-06hBdMwUAb2WFTuGG73LSC0wfPu93xWwo5vL2et9eymgmu3Id5vFAHBbajVWiGhPO37qcsdCap/FqXvJGJWPIg==", + "dependencies": { + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-crypto/util": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@aws-crypto/util/-/util-3.0.0.tgz", + "integrity": "sha512-2OJlpeJpCR48CC8r+uKVChzs9Iungj9wkZrl8Z041DWEWvyIHILYKCPNzJghKsivj+S3mLo6BVc7mBNzdxA46w==", + "dependencies": { + "@aws-sdk/types": "^3.222.0", + "@aws-sdk/util-utf8-browser": "^3.0.0", + "tslib": "^1.11.1" + } + }, + "node_modules/@aws-crypto/util/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@aws-sdk/client-s3": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.414.0.tgz", + "integrity": "sha512-uEag2GPuuxWmnzOxUhAy0EYo3LW3u/UyCw1IxU3zkaTRQnD6TZ07kjv3Q6Zytqt82yKzJPZInzNNRdtGJdyxbw==", + "dependencies": { + "@aws-crypto/sha1-browser": "3.0.0", + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/client-sts": "3.414.0", + "@aws-sdk/credential-provider-node": "3.414.0", + "@aws-sdk/middleware-bucket-endpoint": "3.413.0", + "@aws-sdk/middleware-expect-continue": "3.413.0", + "@aws-sdk/middleware-flexible-checksums": "3.413.0", + "@aws-sdk/middleware-host-header": "3.413.0", + "@aws-sdk/middleware-location-constraint": "3.413.0", + "@aws-sdk/middleware-logger": "3.413.0", + "@aws-sdk/middleware-recursion-detection": "3.413.0", + "@aws-sdk/middleware-sdk-s3": "3.414.0", + "@aws-sdk/middleware-signing": "3.413.0", + "@aws-sdk/middleware-ssec": "3.413.0", + "@aws-sdk/middleware-user-agent": "3.413.0", + "@aws-sdk/region-config-resolver": "3.413.0", + "@aws-sdk/signature-v4-multi-region": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-endpoints": "3.413.0", + "@aws-sdk/util-user-agent-browser": "3.413.0", + "@aws-sdk/util-user-agent-node": "3.413.0", + "@aws-sdk/xml-builder": "3.310.0", + "@smithy/config-resolver": "^2.0.8", + "@smithy/eventstream-serde-browser": "^2.0.7", + "@smithy/eventstream-serde-config-resolver": "^2.0.7", + "@smithy/eventstream-serde-node": "^2.0.7", + "@smithy/fetch-http-handler": "^2.1.3", + "@smithy/hash-blob-browser": "^2.0.7", + "@smithy/hash-node": "^2.0.7", + "@smithy/hash-stream-node": "^2.0.7", + "@smithy/invalid-dependency": "^2.0.7", + "@smithy/md5-js": "^2.0.7", + "@smithy/middleware-content-length": "^2.0.9", + "@smithy/middleware-endpoint": "^2.0.7", + "@smithy/middleware-retry": "^2.0.10", + "@smithy/middleware-serde": "^2.0.7", + "@smithy/middleware-stack": "^2.0.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/node-http-handler": "^2.1.3", + "@smithy/protocol-http": "^3.0.3", + "@smithy/smithy-client": "^2.1.4", + "@smithy/types": "^2.3.1", + "@smithy/url-parser": "^2.0.7", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.8", + "@smithy/util-defaults-mode-node": "^2.0.10", + "@smithy/util-retry": "^2.0.0", + "@smithy/util-stream": "^2.0.10", + "@smithy/util-utf8": "^2.0.0", + "@smithy/util-waiter": "^2.0.7", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sso": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sso/-/client-sso-3.414.0.tgz", + "integrity": "sha512-GvRwQ7wA3edzsQEKS70ZPhkOUZ62PAiXasjp6GxrsADEb8sV1z4FxXNl9Un/7fQxKkh9QYaK1Wu1PmhLi9MLMg==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/middleware-host-header": "3.413.0", + "@aws-sdk/middleware-logger": "3.413.0", + "@aws-sdk/middleware-recursion-detection": "3.413.0", + "@aws-sdk/middleware-user-agent": "3.413.0", + "@aws-sdk/region-config-resolver": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-endpoints": "3.413.0", + "@aws-sdk/util-user-agent-browser": "3.413.0", + "@aws-sdk/util-user-agent-node": "3.413.0", + "@smithy/config-resolver": "^2.0.8", + "@smithy/fetch-http-handler": "^2.1.3", + "@smithy/hash-node": "^2.0.7", + "@smithy/invalid-dependency": "^2.0.7", + "@smithy/middleware-content-length": "^2.0.9", + "@smithy/middleware-endpoint": "^2.0.7", + "@smithy/middleware-retry": "^2.0.10", + "@smithy/middleware-serde": "^2.0.7", + "@smithy/middleware-stack": "^2.0.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/node-http-handler": "^2.1.3", + "@smithy/protocol-http": "^3.0.3", + "@smithy/smithy-client": "^2.1.4", + "@smithy/types": "^2.3.1", + "@smithy/url-parser": "^2.0.7", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.8", + "@smithy/util-defaults-mode-node": "^2.0.10", + "@smithy/util-retry": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/client-sts": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/client-sts/-/client-sts-3.414.0.tgz", + "integrity": "sha512-xeYH3si6Imp1EWolWn1zuxJJu2AXKwXl1HDftQULwC5AWkm1mNFbXYSJN4hQul1IM+kn+JTRB0XRHByQkKhe+Q==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/credential-provider-node": "3.414.0", + "@aws-sdk/middleware-host-header": "3.413.0", + "@aws-sdk/middleware-logger": "3.413.0", + "@aws-sdk/middleware-recursion-detection": "3.413.0", + "@aws-sdk/middleware-sdk-sts": "3.413.0", + "@aws-sdk/middleware-signing": "3.413.0", + "@aws-sdk/middleware-user-agent": "3.413.0", + "@aws-sdk/region-config-resolver": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-endpoints": "3.413.0", + "@aws-sdk/util-user-agent-browser": "3.413.0", + "@aws-sdk/util-user-agent-node": "3.413.0", + "@smithy/config-resolver": "^2.0.8", + "@smithy/fetch-http-handler": "^2.1.3", + "@smithy/hash-node": "^2.0.7", + "@smithy/invalid-dependency": "^2.0.7", + "@smithy/middleware-content-length": "^2.0.9", + "@smithy/middleware-endpoint": "^2.0.7", + "@smithy/middleware-retry": "^2.0.10", + "@smithy/middleware-serde": "^2.0.7", + "@smithy/middleware-stack": "^2.0.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/node-http-handler": "^2.1.3", + "@smithy/protocol-http": "^3.0.3", + "@smithy/smithy-client": "^2.1.4", + "@smithy/types": "^2.3.1", + "@smithy/url-parser": "^2.0.7", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.8", + "@smithy/util-defaults-mode-node": "^2.0.10", + "@smithy/util-retry": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "fast-xml-parser": "4.2.5", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-env": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-env/-/credential-provider-env-3.413.0.tgz", + "integrity": "sha512-yeMOkfG20/RlzfPMtQuDB647AcPEvFEVYOWZzAWVJfldYQ5ybKr0d7sBkgG9sdAzGkK3Aw9dE4rigYI8EIqc1Q==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-ini": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-ini/-/credential-provider-ini-3.414.0.tgz", + "integrity": "sha512-rlpLLx70roJL/t40opWC96LbIASejdMbRlgSCRpK8b/hKngYDe5A7SRVacaw08vYrAywxRiybxpQOwOt9b++rA==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.413.0", + "@aws-sdk/credential-provider-process": "3.413.0", + "@aws-sdk/credential-provider-sso": "3.414.0", + "@aws-sdk/credential-provider-web-identity": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@smithy/credential-provider-imds": "^2.0.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-node": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-node/-/credential-provider-node-3.414.0.tgz", + "integrity": "sha512-xlkcOUKeGHInxWKKrZKIPSBCUL/ozyCldJBjmMKEj7ZmBAEiDcjpMe3pZ//LibMkCSy0b/7jtyQBE/eaIT2o0A==", + "dependencies": { + "@aws-sdk/credential-provider-env": "3.413.0", + "@aws-sdk/credential-provider-ini": "3.414.0", + "@aws-sdk/credential-provider-process": "3.413.0", + "@aws-sdk/credential-provider-sso": "3.414.0", + "@aws-sdk/credential-provider-web-identity": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@smithy/credential-provider-imds": "^2.0.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-process": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-process/-/credential-provider-process-3.413.0.tgz", + "integrity": "sha512-GFJdgS14GzJ1wc2DEnS44Z/34iBZ05CAkvDsLN2CMwcDgH4eZuif9/x0lwzIJBK3xVFHzYUeVvEzsqRPbCHRsw==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-sso": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-sso/-/credential-provider-sso-3.414.0.tgz", + "integrity": "sha512-w9g2hlkZn7WekWICRqk+L33py7KrjYMFryVpkKXOx2pjDchCfZDr6pL1ml782GZ0L3qsob4SbNpbtp13JprnWQ==", + "dependencies": { + "@aws-sdk/client-sso": "3.414.0", + "@aws-sdk/token-providers": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/credential-provider-web-identity": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/credential-provider-web-identity/-/credential-provider-web-identity-3.413.0.tgz", + "integrity": "sha512-5cdA1Iq9JeEHtg59ERV9fdMQ7cS0JF6gH/BWA7HYEUGdSVPXCuwyEggPtG64QgpNU7SmxH+QdDG+Ldxz09ycIA==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/lib-storage": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.414.0.tgz", + "integrity": "sha512-R2ZdLVWa+EhMYrta61c0fNgnRpsIWr4zj1rCnC0ZlTwP5J3jiAaRHPMVgd9Jgo1u91y8nHVYaLdIJ6EQDN0scg==", + "dependencies": { + "@smithy/abort-controller": "^2.0.1", + "@smithy/middleware-endpoint": "^2.0.7", + "@smithy/smithy-client": "^2.1.4", + "buffer": "5.6.0", + "events": "3.3.0", + "stream-browserify": "3.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-s3": "^3.0.0" + } + }, + "node_modules/@aws-sdk/lib-storage/node_modules/buffer": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "node_modules/@aws-sdk/middleware-bucket-endpoint": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-bucket-endpoint/-/middleware-bucket-endpoint-3.413.0.tgz", + "integrity": "sha512-hHfaKg4rbpdgB6iMNLW/ubAJFsPFMNOV/hHpZ7BJVdA05fW6Zj6es+TSr7DM3j4Dv49ckhWY0P+JrSkM3FXXpg==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-arn-parser": "3.310.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "@smithy/util-config-provider": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-expect-continue": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-expect-continue/-/middleware-expect-continue-3.413.0.tgz", + "integrity": "sha512-14L4Fit+3EEVZNHCZKxua4vCrh+dGaaDfC5Ng3A8nILAqCsG2dhbDbUOwbnAaM8MCEVOgZS/NwUUlLA9AZfKgQ==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-flexible-checksums": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-flexible-checksums/-/middleware-flexible-checksums-3.413.0.tgz", + "integrity": "sha512-xb7WIxmyCQoBCnzaN+Widuan0PbNxYegKLOW4XheYz/v7lBEttIcGMu+OIAIQs3KlTb3dx8jqjSj2rMNnru8MQ==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@aws-crypto/crc32c": "3.0.0", + "@aws-sdk/types": "3.413.0", + "@smithy/is-array-buffer": "^2.0.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-host-header": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-host-header/-/middleware-host-header-3.413.0.tgz", + "integrity": "sha512-r9PQx468EzPHo9wRzZLfgROpKtVdbkteMrdhsuM12bifVHjU1OHr7yfhc1OdWv39X8Xiv6F8n5r+RBQEM0S6+g==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-location-constraint": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-location-constraint/-/middleware-location-constraint-3.413.0.tgz", + "integrity": "sha512-JecF1O1Lm8ZZtCgXHwJm0ZysVf8K0Z8DbrNMJfYkyfsP3CYuQNJbmjrehyRl7aCuxMJ16EUGdXgoP1M8TImLpA==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-logger": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-logger/-/middleware-logger-3.413.0.tgz", + "integrity": "sha512-jqcXDubcKvoqBy+kkEa0WoNjG6SveDeyNy+gdGnTV+DEtYjkcHrHJei4q0W5zFl0mzc+dP+z8tJF44rv95ZY3Q==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-recursion-detection": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-recursion-detection/-/middleware-recursion-detection-3.413.0.tgz", + "integrity": "sha512-C6k0IKJk/A4/VBGwUjxEPG+WOjjnmWAZVRBUzaeM7PqRh+g5rLcuIV356ntV3pREVxyiSTePTYVYIHU9YXkLKQ==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-s3": { + "version": "3.414.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-s3/-/middleware-sdk-s3-3.414.0.tgz", + "integrity": "sha512-IKTiYMWN/2HZtgBinrDOGq+gKYkM9h477AqVr7EXSfll+gM9phwJKEitgxje7IaCi8ViQcFKtTRly3eCLX6GIA==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-arn-parser": "3.310.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/smithy-client": "^2.1.4", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-sdk-sts": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-sdk-sts/-/middleware-sdk-sts-3.413.0.tgz", + "integrity": "sha512-t0u//JUyaEZRVnH5q+Ur3tWnuyIsTdwA0XOdDCZXcSlLYzGp2MI/tScLjn9IydRrceIFpFfmbjk4Nf/Q6TeBTQ==", + "dependencies": { + "@aws-sdk/middleware-signing": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-signing": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-signing/-/middleware-signing-3.413.0.tgz", + "integrity": "sha512-QFEnVvIKYPCermM+ESxEztgUgXzGSKpnPnohMYNvSZySqmOLu/4VvxiZbRO/BX9J3ZHcUgaw4vKm5VBZRrycxw==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/property-provider": "^2.0.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/signature-v4": "^2.0.0", + "@smithy/types": "^2.3.1", + "@smithy/util-middleware": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-ssec": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-ssec/-/middleware-ssec-3.413.0.tgz", + "integrity": "sha512-MQNksEnhjObNLgE2zRd0OltdijQuqHaArP3FygtdeE2bCXc/D5mCpUX8fgDC5grQIBNdRdaar2YL62UxFsHWrw==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/middleware-user-agent": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/middleware-user-agent/-/middleware-user-agent-3.413.0.tgz", + "integrity": "sha512-eVMJyeWxNBqerhfD+sE9sTjDtwQiECrfU6wpUQP5fGPhJD2cVVZPxuTuJGDZCu/4k/V61dF85IYlsPUNLdVQ6w==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-endpoints": "3.413.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/region-config-resolver": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/region-config-resolver/-/region-config-resolver-3.413.0.tgz", + "integrity": "sha512-h90e6yyOhvoc+1F5vFk3C5mxwB8RSDEMKTO/fxexyur94seczZ1yxyYkTMZv30oc9RUiToABlHNrh/wxL7TZPQ==", + "dependencies": { + "@smithy/node-config-provider": "^2.0.10", + "@smithy/types": "^2.3.1", + "@smithy/util-config-provider": "^2.0.0", + "@smithy/util-middleware": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/signature-v4-multi-region": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/signature-v4-multi-region/-/signature-v4-multi-region-3.413.0.tgz", + "integrity": "sha512-4USefVS5HPeJ8Yx0j6l84837adWGTifGpnltD+4mIgvpGp/hW3EkwvJko6i4cnLbeY8D2+8XvgT9YN1LUhvFmg==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/signature-v4": "^2.0.0", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/token-providers": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/token-providers/-/token-providers-3.413.0.tgz", + "integrity": "sha512-NfP1Ib9LAWVLMTOa/1aJwt4TRrlRrNyukCpVZGfNaMnNNEoP5Rakdbcs8KFVHe/MJzU+GdKVzxQ4TgRkLOGTrA==", + "dependencies": { + "@aws-crypto/sha256-browser": "3.0.0", + "@aws-crypto/sha256-js": "3.0.0", + "@aws-sdk/middleware-host-header": "3.413.0", + "@aws-sdk/middleware-logger": "3.413.0", + "@aws-sdk/middleware-recursion-detection": "3.413.0", + "@aws-sdk/middleware-user-agent": "3.413.0", + "@aws-sdk/types": "3.413.0", + "@aws-sdk/util-endpoints": "3.413.0", + "@aws-sdk/util-user-agent-browser": "3.413.0", + "@aws-sdk/util-user-agent-node": "3.413.0", + "@smithy/config-resolver": "^2.0.8", + "@smithy/fetch-http-handler": "^2.1.3", + "@smithy/hash-node": "^2.0.7", + "@smithy/invalid-dependency": "^2.0.7", + "@smithy/middleware-content-length": "^2.0.9", + "@smithy/middleware-endpoint": "^2.0.7", + "@smithy/middleware-retry": "^2.0.10", + "@smithy/middleware-serde": "^2.0.7", + "@smithy/middleware-stack": "^2.0.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/node-http-handler": "^2.1.3", + "@smithy/property-provider": "^2.0.0", + "@smithy/protocol-http": "^3.0.3", + "@smithy/shared-ini-file-loader": "^2.0.6", + "@smithy/smithy-client": "^2.1.4", + "@smithy/types": "^2.3.1", + "@smithy/url-parser": "^2.0.7", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-body-length-browser": "^2.0.0", + "@smithy/util-body-length-node": "^2.1.0", + "@smithy/util-defaults-mode-browser": "^2.0.8", + "@smithy/util-defaults-mode-node": "^2.0.10", + "@smithy/util-retry": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/types": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/types/-/types-3.413.0.tgz", + "integrity": "sha512-j1xib0f/TazIFc5ySIKOlT1ujntRbaoG4LJFeEezz4ji03/wSJMI8Vi4KjzpBp8J1tTu0oRDnsxRIGixsUBeYQ==", + "dependencies": { + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-arn-parser": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-arn-parser/-/util-arn-parser-3.310.0.tgz", + "integrity": "sha512-jL8509owp/xB9+Or0pvn3Fe+b94qfklc2yPowZZIFAkFcCSIdkIglz18cPDWnYAcy9JGewpMS1COXKIUhZkJsA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-endpoints": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-endpoints/-/util-endpoints-3.413.0.tgz", + "integrity": "sha512-VAwr7cITNb1L6/2XUPIbCOuhKGm0VtKCRblurrfUF2bxqG/wtuw/2Fm4ahYJPyxklOSXAMSq+RHdFWcir0YB/g==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-locate-window": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-locate-window/-/util-locate-window-3.310.0.tgz", + "integrity": "sha512-qo2t/vBTnoXpjKxlsC2e1gBrRm80M3bId27r0BRB2VniSSe7bL1mmzM+/HFtujm0iAxtPM+aLEflLJlJeDPg0w==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-browser": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-browser/-/util-user-agent-browser-3.413.0.tgz", + "integrity": "sha512-7j/qWcRO2OBZBre2fC6V6M0PAS9n7k6i+VtofPkkhxC2DZszLJElqnooF9hGmVGYK3zR47Np4WjURXKIEZclWg==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/types": "^2.3.1", + "bowser": "^2.11.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@aws-sdk/util-user-agent-node": { + "version": "3.413.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-user-agent-node/-/util-user-agent-node-3.413.0.tgz", + "integrity": "sha512-vHm9TVZIzfWMeDvdmoOky6VarqOt8Pr68CESHN0jyuO6XbhCDnr9rpaXiBhbSR+N1Qm7R/AfJgAhQyTMu2G1OA==", + "dependencies": { + "@aws-sdk/types": "3.413.0", + "@smithy/node-config-provider": "^2.0.10", + "@smithy/types": "^2.3.1", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "aws-crt": ">=1.0.0" + }, + "peerDependenciesMeta": { + "aws-crt": { + "optional": true + } + } + }, + "node_modules/@aws-sdk/util-utf8-browser": { + "version": "3.259.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/util-utf8-browser/-/util-utf8-browser-3.259.0.tgz", + "integrity": "sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@aws-sdk/xml-builder": { + "version": "3.310.0", + "resolved": "https://registry.npmjs.org/@aws-sdk/xml-builder/-/xml-builder-3.310.0.tgz", + "integrity": "sha512-TqELu4mOuSIKQCqj63fGVs86Yh+vBx5nHRpWKNUNhB2nPTpfbziTs5c1X358be3peVWA4wPxW7Nt53KIg1tnNw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", @@ -1025,152 +1791,761 @@ "graceful-fs": "^4.2.9" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@smithy/abort-controller": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/abort-controller/-/abort-controller-2.0.9.tgz", + "integrity": "sha512-8liHOEbx99xcy4VndeQNQhyA0LS+e7UqsuRnDTSIA26IKBv/7vA9w09KOd4fgNULrvX0r3WpA6cwsQTRJpSWkg==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/chunked-blob-reader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader/-/chunked-blob-reader-2.0.0.tgz", + "integrity": "sha512-k+J4GHJsMSAIQPChGBrjEmGS+WbPonCXesoqP9fynIqjn7rdOThdH8FAeCmokP9mxTYKQAKoHCLPzNlm6gh7Wg==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/chunked-blob-reader-native": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/chunked-blob-reader-native/-/chunked-blob-reader-native-2.0.0.tgz", + "integrity": "sha512-HM8V2Rp1y8+1343tkZUKZllFhEQPNmpNdgFAncbTsxkZ18/gqjk23XXv3qGyXWp412f3o43ZZ1UZHVcHrpRnCQ==", + "dependencies": { + "@smithy/util-base64": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/config-resolver": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@smithy/config-resolver/-/config-resolver-2.0.10.tgz", + "integrity": "sha512-MwToDsCltHjumkCuRn883qoNeJUawc2b8sX9caSn5vLz6J5crU1IklklNxWCaMO2z2nDL91Po4b/aI1eHv5PfA==", + "dependencies": { + "@smithy/node-config-provider": "^2.0.12", + "@smithy/types": "^2.3.3", + "@smithy/util-config-provider": "^2.0.0", + "@smithy/util-middleware": "^2.0.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/credential-provider-imds": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/credential-provider-imds/-/credential-provider-imds-2.0.12.tgz", + "integrity": "sha512-S3lUNe+2fEFwKcmiQniXGPXt69vaHvQCw8kYQOBL4OvJsgwfpkIYDZdroHbTshYi0M6WaKL26Mw+hvgma6dZqA==", + "dependencies": { + "@smithy/node-config-provider": "^2.0.12", + "@smithy/property-provider": "^2.0.10", + "@smithy/types": "^2.3.3", + "@smithy/url-parser": "^2.0.9", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-codec": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-codec/-/eventstream-codec-2.0.9.tgz", + "integrity": "sha512-sy0pcbKnawt1iu+qCoSFbs/h9PAaUgvlJEO3lqkE1HFFj4p5RgL98vH+9CyDoj6YY82cG5XsorFmcLqQJHTOYw==", + "dependencies": { + "@aws-crypto/crc32": "3.0.0", + "@smithy/types": "^2.3.3", + "@smithy/util-hex-encoding": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/eventstream-serde-browser": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-browser/-/eventstream-serde-browser-2.0.9.tgz", + "integrity": "sha512-g70enHZau2hGj1Uxedrn8AAjH9E7RnpHdwkuPKapagah53ztbwI7xaNeA5SLD4MjSjdrjathyQBCQKIzwXrR1g==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-config-resolver": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-config-resolver/-/eventstream-serde-config-resolver-2.0.9.tgz", + "integrity": "sha512-+15GzIMtdSuRPyuCeGZ7gzgD94Ejv6eM1vKcqvipdzS+i36KTZ2A9aZsJk+gDw//OCD1EMx9SqpV6bUvMS4PWg==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-node": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-node/-/eventstream-serde-node-2.0.9.tgz", + "integrity": "sha512-UEJcvN2WXXEjkewtFkj1S2HSZLbyCgzUnfoFPrTuKy4+xRfakO5dNx6ws2h1pvb8Vc7mTuBL+Webl1R5mnVsXA==", + "dependencies": { + "@smithy/eventstream-serde-universal": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/eventstream-serde-universal": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/eventstream-serde-universal/-/eventstream-serde-universal-2.0.9.tgz", + "integrity": "sha512-dAHQEYlK/1tjjieBE7jjXwpLQFgKdkvC4HSQf+/Jj4t34XbUmXWHbw92/EuLp9+vjNB/JQPvkwpMtN31jxIDeg==", + "dependencies": { + "@smithy/eventstream-codec": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/fetch-http-handler": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-2.1.5.tgz", + "integrity": "sha512-BIeCHGfr5JCGN+EMTwZK74ELvjPXOIrI7OLM5OhZJJ6AmZyRv2S9ANJk18AtLwht0TsSm+8WoXIEp8LuxNgUyA==", + "dependencies": { + "@smithy/protocol-http": "^3.0.5", + "@smithy/querystring-builder": "^2.0.9", + "@smithy/types": "^2.3.3", + "@smithy/util-base64": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/hash-blob-browser": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/hash-blob-browser/-/hash-blob-browser-2.0.9.tgz", + "integrity": "sha512-JNWOV1ci9vIg4U82klNr07bZXsA6OCumqHugpvZdvvn6cNGwTa4rvpS5FpPcqKeh3Rdg1rr4h8g+X6zyOamnZw==", + "dependencies": { + "@smithy/chunked-blob-reader": "^2.0.0", + "@smithy/chunked-blob-reader-native": "^2.0.0", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/hash-node": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/hash-node/-/hash-node-2.0.9.tgz", + "integrity": "sha512-XP3yWd5wyCtiVmsY5Nuq/FUwyCEQ6YG7DsvRh7ThldNukGpCzyFdP8eivZJVjn4Fx7oYrrOnVoYZ0WEgpW1AvQ==", + "dependencies": { + "@smithy/types": "^2.3.3", + "@smithy/util-buffer-from": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/hash-stream-node": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/hash-stream-node/-/hash-stream-node-2.0.9.tgz", + "integrity": "sha512-3nrkMpiOrhsJvJS6K4OkP0qvA3U5r8PpseXULeGd1ZD1EbfcZ30Lvl72FGaaHskwWZyTPR4czr1d/RwLRCVHNA==", + "dependencies": { + "@smithy/types": "^2.3.3", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/invalid-dependency": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/invalid-dependency/-/invalid-dependency-2.0.9.tgz", + "integrity": "sha512-RuJqhYf8nViK96IIO9JbTtjDUuFItVfuuJhWw2yk7fv67yltQ7fZD6IQ2OsHHluoVmstnQJuCg5raXJR696Ubw==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/is-array-buffer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/is-array-buffer/-/is-array-buffer-2.0.0.tgz", + "integrity": "sha512-z3PjFjMyZNI98JFRJi/U0nGoLWMSJlDjAW4QUX2WNZLas5C0CmVV6LJ01JI0k90l7FvpmixjWxPFmENSClQ7ug==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/md5-js": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/md5-js/-/md5-js-2.0.9.tgz", + "integrity": "sha512-ALHGoTZDgBXBbjCpQzVy6hpa6Rdr6e2jyEw51d6CQOUpHkUnFH7G96UWhVwUnkP0xozPCvmWy+3+j2QUX+oK9w==", + "dependencies": { + "@smithy/types": "^2.3.3", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/middleware-content-length": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@smithy/middleware-content-length/-/middleware-content-length-2.0.11.tgz", + "integrity": "sha512-Malj4voNTL4+a5ZL3a6+Ij7JTUMTa2R7c3ZIBzMxN5OUUgAspU7uFi1Q97f4B0afVh2joQBAWH5IQJUG25nl8g==", + "dependencies": { + "@smithy/protocol-http": "^3.0.5", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-endpoint": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/middleware-endpoint/-/middleware-endpoint-2.0.9.tgz", + "integrity": "sha512-72/o8R6AAO4+nyTI6h4z6PYGTSA4dr1M7tZz29U8DEUHuh1YkhC77js0P6RyF9G0wDLuYqxb+Yh0crI5WG2pJg==", + "dependencies": { + "@smithy/middleware-serde": "^2.0.9", + "@smithy/types": "^2.3.3", + "@smithy/url-parser": "^2.0.9", + "@smithy/util-middleware": "^2.0.2", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-retry": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/middleware-retry/-/middleware-retry-2.0.12.tgz", + "integrity": "sha512-YQ/ufXX4/d9/+Jf1QQ4J+CVeupC7BW52qldBTvRV33PDX9vxndlAwkFwzBcmnUFC3Hjf1//HW6I77EItcjNSCA==", + "dependencies": { + "@smithy/node-config-provider": "^2.0.12", + "@smithy/protocol-http": "^3.0.5", + "@smithy/service-error-classification": "^2.0.2", + "@smithy/types": "^2.3.3", + "@smithy/util-middleware": "^2.0.2", + "@smithy/util-retry": "^2.0.2", + "tslib": "^2.5.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-retry/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@smithy/middleware-serde": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/middleware-serde/-/middleware-serde-2.0.9.tgz", + "integrity": "sha512-GVbauxrr6WmtCaesakktg3t5LR/yDbajpC7KkWc8rtCpddMI4ShAVO5Q6DqwX8MDFi4CLaY8H7eTGcxhl3jbLg==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/middleware-stack": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@smithy/middleware-stack/-/middleware-stack-2.0.2.tgz", + "integrity": "sha512-6BNfPVp/8gcmkKdJhNJK3HEkUNNTrY3hM9vuWXIUSoLk9FZo1L2QuGLGB6S124D9ySInn8PzEdOtguCF5Ao4KA==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-config-provider": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/node-config-provider/-/node-config-provider-2.0.12.tgz", + "integrity": "sha512-df9y9ywv+JmS40Y60ZqJ4jfZiTCmyHQffwzIqjBjLJLJl0imf9F6DWBd+jiEWHvlohR+sFhyY+KL/qzKgnAq1A==", + "dependencies": { + "@smithy/property-provider": "^2.0.10", + "@smithy/shared-ini-file-loader": "^2.0.11", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/node-http-handler": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-2.1.5.tgz", + "integrity": "sha512-52uF+BrZaFiBh+NT/bADiVDCQO91T+OwDRsuaAeWZC1mlCXFjAPPQdxeQohtuYOe9m7mPP/xIMNiqbe8jvndHA==", + "dependencies": { + "@smithy/abort-controller": "^2.0.9", + "@smithy/protocol-http": "^3.0.5", + "@smithy/querystring-builder": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/property-provider": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@smithy/property-provider/-/property-provider-2.0.10.tgz", + "integrity": "sha512-YMBVfh0ZMmJtbsUn+WfSwR32iRljZPdRN0Tn2GAcdJ+ejX8WrBXD7Z0jIkQDrQZr8fEuuv5x8WxMIj+qVbsPQw==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/protocol-http": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@smithy/protocol-http/-/protocol-http-3.0.5.tgz", + "integrity": "sha512-3t3fxj+ip4EPHRC2fQ0JimMxR/qCQ1LSQJjZZVZFgROnFLYWPDgUZqpoi7chr+EzatxJVXF/Rtoi5yLHOWCoZQ==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-builder": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/querystring-builder/-/querystring-builder-2.0.9.tgz", + "integrity": "sha512-Yt6CPF4j3j1cuwod/DRflbuXxBFjJm7gAjy6W1RE21Rz5/kfGFqiZBXWmmXwGtnnhiLThYwoHK4S6/TQtnx0Fg==", + "dependencies": { + "@smithy/types": "^2.3.3", + "@smithy/util-uri-escape": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/querystring-parser": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/querystring-parser/-/querystring-parser-2.0.9.tgz", + "integrity": "sha512-U6z4N743s4vrcxPW8p8+reLV0PjMCYEyb1/wtMVvv3VnbJ74gshdI8SR1sBnEh95cF8TxonmX5IxY25tS9qGfg==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/service-error-classification": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@smithy/service-error-classification/-/service-error-classification-2.0.2.tgz", + "integrity": "sha512-GTUd2j63gKy7A+ggvSdn2hc4sejG7LWfE+ZMF17vzWoNyqERWbRP7HTPS0d0Lwg1p6OQCAzvNigSrEIWVFt6iA==", + "dependencies": { + "@smithy/types": "^2.3.3" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/shared-ini-file-loader": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@smithy/shared-ini-file-loader/-/shared-ini-file-loader-2.0.11.tgz", + "integrity": "sha512-Sf0u5C5px6eykXi6jImDTp+edvG3REtPjXnFWU/J+b7S2wkXwUqFXqBL5DdM4zC1F+M8u57ZT7NRqDwMOw7/Tw==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/signature-v4": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/signature-v4/-/signature-v4-2.0.9.tgz", + "integrity": "sha512-RkHP0joSI1j2EI+mU55sOi33/aMMkKdL9ZY+SWrPxsiCe1oyzzuy79Tpn8X7uT+t0ilNmQlwPpkP/jUy940pEA==", + "dependencies": { + "@smithy/eventstream-codec": "^2.0.9", + "@smithy/is-array-buffer": "^2.0.0", + "@smithy/types": "^2.3.3", + "@smithy/util-hex-encoding": "^2.0.0", + "@smithy/util-middleware": "^2.0.2", + "@smithy/util-uri-escape": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/smithy-client": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@smithy/smithy-client/-/smithy-client-2.1.6.tgz", + "integrity": "sha512-+F26b8U7C6ydJgj5Y+OZ94NL54HQUPF1LrFiZjMAIX3OlgZjDhiT3m6VOZo6+hge3sEFOrupwdjB5V24JOCpQw==", + "dependencies": { + "@smithy/middleware-stack": "^2.0.2", + "@smithy/types": "^2.3.3", + "@smithy/util-stream": "^2.0.12", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/types": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@smithy/types/-/types-2.3.3.tgz", + "integrity": "sha512-zTdIPR9PvFVNRdIKMQu4M5oyTaycIbUqLheQqaOi9rTWPkgjGO2wDBxMA1rBHQB81aqAEv+DbSS4jfKyQMnXRA==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/url-parser": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/url-parser/-/url-parser-2.0.9.tgz", + "integrity": "sha512-NBnJ0NiY8z6E82Xd5VYUFQfKwK/wA/+QkKmpYUYP+cpH3aCzE6g2gvixd9vQKYjsIdRfNPCf+SFAozt8ljozOw==", + "dependencies": { + "@smithy/querystring-parser": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-base64": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-base64/-/util-base64-2.0.0.tgz", + "integrity": "sha512-Zb1E4xx+m5Lud8bbeYi5FkcMJMnn+1WUnJF3qD7rAdXpaL7UjkFQLdmW5fHadoKbdHpwH9vSR8EyTJFHJs++tA==", + "dependencies": { + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@smithy/util-body-length-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-browser/-/util-body-length-browser-2.0.0.tgz", + "integrity": "sha512-JdDuS4ircJt+FDnaQj88TzZY3+njZ6O+D3uakS32f2VNnDo3vyEuNdBOh/oFd8Df1zSZOuH1HEChk2AOYDezZg==", + "dependencies": { + "tslib": "^2.5.0" + } + }, + "node_modules/@smithy/util-body-length-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@smithy/util-body-length-node/-/util-body-length-node-2.1.0.tgz", + "integrity": "sha512-/li0/kj/y3fQ3vyzn36NTLGmUwAICb7Jbe/CsWCktW363gh1MOcpEcSO3mJ344Gv2dqz8YJCLQpb6hju/0qOWw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@jest/test-result": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", - "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", - "dev": true, + "node_modules/@smithy/util-buffer-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-buffer-from/-/util-buffer-from-2.0.0.tgz", + "integrity": "sha512-/YNnLoHsR+4W4Vf2wL5lGv0ksg8Bmk3GEGxn2vEQt52AQaPSCuaO5PM5VM7lP1K9qHRKHwrPGktqVoAHKWHxzw==", "dependencies": { - "@jest/console": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "@smithy/is-array-buffer": "^2.0.0", + "tslib": "^2.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=14.0.0" } }, - "node_modules/@jest/test-sequencer": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", - "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", - "dev": true, + "node_modules/@smithy/util-config-provider": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-config-provider/-/util-config-provider-2.0.0.tgz", + "integrity": "sha512-xCQ6UapcIWKxXHEU4Mcs2s7LcFQRiU3XEluM2WcCjjBtQkUN71Tb+ydGmJFPxMUrW/GWMgQEEGipLym4XG0jZg==", "dependencies": { - "@jest/test-result": "^29.7.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "slash": "^3.0.0" + "tslib": "^2.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=14.0.0" } }, - "node_modules/@jest/transform": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", - "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", - "dev": true, + "node_modules/@smithy/util-defaults-mode-browser": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-browser/-/util-defaults-mode-browser-2.0.10.tgz", + "integrity": "sha512-M5eaPn961jU2glZkqvmrVd6H4Tz4j1CJ2Kt8kjqMfcWZ4IQFgwPYbRkgND0W93dZXDmFU2GtuJGatwSmWIqxrA==", "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.6.3", - "@jridgewell/trace-mapping": "^0.3.18", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-util": "^29.7.0", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "@smithy/property-provider": "^2.0.10", + "@smithy/smithy-client": "^2.1.6", + "@smithy/types": "^2.3.3", + "bowser": "^2.11.0", + "tslib": "^2.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 10.0.0" } }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, + "node_modules/@smithy/util-defaults-mode-node": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/util-defaults-mode-node/-/util-defaults-mode-node-2.0.12.tgz", + "integrity": "sha512-fwAVus2YBTU5u4KFmmEZDdgx3HpUUg8f6SEUetJFsNL+6AzoGBIhCZX0yMrVCLJEZe6tUfMbL5TZHXMw2q6MaA==", "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "@smithy/config-resolver": "^2.0.10", + "@smithy/credential-provider-imds": "^2.0.12", + "@smithy/node-config-provider": "^2.0.12", + "@smithy/property-provider": "^2.0.10", + "@smithy/smithy-client": "^2.1.6", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">= 10.0.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, + "node_modules/@smithy/util-hex-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-hex-encoding/-/util-hex-encoding-2.0.0.tgz", + "integrity": "sha512-c5xY+NUnFqG6d7HFh1IFfrm3mGl29lC+vF+geHv4ToiuJCBmIfzx6IeHLg+OgRdPFKDXIw6pvi+p3CsscaMcMA==", "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "tslib": "^2.5.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=14.0.0" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, + "node_modules/@smithy/util-middleware": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-middleware/-/util-middleware-2.0.2.tgz", + "integrity": "sha512-UGPZM+Ja/vke5pc/S8G0LNiHpVirtjppsXO+GK9m9wbzRGzPJTfnZA/gERUUN/AfxEy/8SL7U1kd7u4t2X8K1w==", + "dependencies": { + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, "engines": { - "node": ">=6.0.0" + "node": ">=14.0.0" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, + "node_modules/@smithy/util-retry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@smithy/util-retry/-/util-retry-2.0.2.tgz", + "integrity": "sha512-ovWiayUB38moZcLhSFFfUgB2IMb7R1JfojU20qSahjxAgfOZvDWme3eOYUMtAVnouZ9kYJiFgHLy27qRH4NeeA==", + "dependencies": { + "@smithy/service-error-classification": "^2.0.2", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, "engines": { - "node": ">=6.0.0" + "node": ">= 14.0.0" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, + "node_modules/@smithy/util-stream": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@smithy/util-stream/-/util-stream-2.0.12.tgz", + "integrity": "sha512-FOCpRLaj6gvSyUC5mJAACT+sPMPmp9sD1o+hVbUH/QxwZfulypA3ZIFdAg/59/IY0d/1Q4CTztsiHEB5LgjN4g==", "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "@smithy/fetch-http-handler": "^2.1.5", + "@smithy/node-http-handler": "^2.1.5", + "@smithy/types": "^2.3.3", + "@smithy/util-base64": "^2.0.0", + "@smithy/util-buffer-from": "^2.0.0", + "@smithy/util-hex-encoding": "^2.0.0", + "@smithy/util-utf8": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@sinclair/typebox": { - "version": "0.27.8", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true + "node_modules/@smithy/util-uri-escape": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-uri-escape/-/util-uri-escape-2.0.0.tgz", + "integrity": "sha512-ebkxsqinSdEooQduuk9CbKcI+wheijxEb3utGXkCoYQkJnwTnLbH1JXGimJtUkQwNQbsbuYwG2+aFVyZf5TLaw==", + "dependencies": { + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" + } }, - "node_modules/@sinonjs/commons": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", - "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", - "dev": true, + "node_modules/@smithy/util-utf8": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithy/util-utf8/-/util-utf8-2.0.0.tgz", + "integrity": "sha512-rctU1VkziY84n5OXe3bPNpKR001ZCME2JCaBBFgtiM2hfKbHFudc/BkMuPab8hRbLd0j3vbnBTTZ1igBf0wgiQ==", "dependencies": { - "type-detect": "4.0.8" + "@smithy/util-buffer-from": "^2.0.0", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", - "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", - "dev": true, + "node_modules/@smithy/util-waiter": { + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/@smithy/util-waiter/-/util-waiter-2.0.9.tgz", + "integrity": "sha512-Hy9Cs0FtIacC1aVFk98bm/7CYqim9fnHAPRnV/SB2mj02ExYs/9Dn5SrNQmtTBTLCn65KqYnNVBNS8GuGpZOOw==", "dependencies": { - "@sinonjs/commons": "^3.0.0" + "@smithy/abort-controller": "^2.0.9", + "@smithy/types": "^2.3.3", + "tslib": "^2.5.0" + }, + "engines": { + "node": ">=14.0.0" } }, "node_modules/@sqltools/formatter": { @@ -1360,6 +2735,11 @@ "node": ">= 6.0.0" } }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1590,6 +2970,11 @@ "node": ">= 0.8" } }, + "node_modules/bowser": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz", + "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==" + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -1684,8 +3069,18 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } }, "node_modules/bytes": { "version": "3.1.2", @@ -1959,6 +3354,20 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "node_modules/content-disposition": { "version": "0.5.4", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", @@ -2022,6 +3431,11 @@ "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", "dev": true }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + }, "node_modules/cors": { "version": "2.8.5", "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", @@ -2300,6 +3714,14 @@ "node": ">= 0.6" } }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/execa": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", @@ -2431,6 +3853,27 @@ "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", "dev": true }, + "node_modules/fast-xml-parser": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.2.5.tgz", + "integrity": "sha512-B9/wizE4WngqQftFPmdaMYlXoJlJOYxGQOanC77fq9k8+Z0v5dDSVh+3glErdIROP//s/jgb7ZuxKfB8nVyo0g==", + "funding": [ + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + }, + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -2440,6 +3883,14 @@ "bser": "2.1.1" } }, + "node_modules/file-type": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", + "integrity": "sha512-RLoqTXE8/vPmMuTI88DAzhMYC99I8BWv7zYP4A1puo5HIjEJ5EX48ighy4ZyKMG9EDXxBgW6e++cn7d1xuFghA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -2746,6 +4197,11 @@ "node": "*" } }, + "node_modules/html-comment-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", + "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -2956,6 +4412,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3932,6 +5393,25 @@ "node": "*" } }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, "node_modules/morgan": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", @@ -3953,6 +5433,40 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/multer-s3": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/multer-s3/-/multer-s3-3.0.1.tgz", + "integrity": "sha512-BFwSO80a5EW4GJRBdUuSHblz2jhVSAze33ZbnGpcfEicoT0iRolx4kWR+AJV07THFRCQ78g+kelKFdjkCCaXeQ==", + "dependencies": { + "@aws-sdk/lib-storage": "^3.46.0", + "file-type": "^3.3.0", + "html-comment-regex": "^1.1.2", + "run-parallel": "^1.1.6" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "@aws-sdk/client-s3": "^3.0.0" + } + }, "node_modules/mysql2": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.6.0.tgz", @@ -4382,6 +5896,11 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -4448,6 +5967,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -4476,6 +6014,20 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -4553,6 +6105,28 @@ "node": ">=10" } }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -4772,6 +6346,44 @@ "node": ">= 0.8" } }, + "node_modules/stream-browserify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz", + "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==", + "dependencies": { + "inherits": "~2.0.4", + "readable-stream": "^3.5.0" + } + }, + "node_modules/stream-browserify/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -4839,6 +6451,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "node_modules/superagent": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", @@ -5050,6 +6667,11 @@ "node": ">= 0.6" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "node_modules/typeorm": { "version": "0.3.17", "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", @@ -5271,6 +6893,11 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -5373,6 +7000,14 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "engines": { + "node": ">=0.4" + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 62effe5..a59546c 100644 --- a/package.json +++ b/package.json @@ -23,12 +23,15 @@ "semi": true }, "dependencies": { + "@aws-sdk/client-s3": "^3.414.0", "axios": "^1.5.0", "cors": "^2.8.5", "dbmate": "^2.6.0", "dotenv": "^16.3.1", "express": "^4.18.2", "jsonwebtoken": "^9.0.2", + "multer": "^1.4.5-lts.1", + "multer-s3": "^3.0.1", "mysql2": "^3.6.0", "typeorm": "^0.3.17" } From f35fb982605ae5e8c47c8be5bc4c71df05efc0c6 Mon Sep 17 00:00:00 2001 From: dodoyoo Date: Wed, 20 Sep 2023 23:13:00 +0900 Subject: [PATCH 45/54] add : Get Consultant List Detail --- api/controllers/consultantController.js | 17 +++++++- api/models/consultantDao.js | 55 ++++++++++++++++++++++++- api/routes/consultantRouter.js | 31 ++++++++++---- api/services/consultantService.js | 38 +++++++++++++---- 4 files changed, 123 insertions(+), 18 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index bddbdcb..b8679df 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -6,7 +6,7 @@ const createConsultant = catchAsync(async (req, res) => { const userId = req.user.userId; - const thread = await consultantService.createConsultThreads( + await consultantService.createConsultThreads( userId, threadTypesId, content, @@ -19,7 +19,7 @@ const createConsultant = catchAsync(async (req, res) => { const deleteConsultant = catchAsync(async (req, res) => { const threadId = req.params.postId; - const thread = await consultantService.deleteConsultantThreads(threadId); + await consultantService.deleteConsultantThreads(threadId); res.status(201).json({ message: 'success' }); }); @@ -33,8 +33,21 @@ const getConsultant = catchAsync(async (req, res) => { res.status(201).json({ message: list }); }); +const getConsultantDetail = catchAsync(async (req, res) => { + const trainerProfileId = req.params.trainer_profiles_id; + const threadId = req.params.thread_id; + + const detailList = await consultantService.getConsultantDetailList( + trainerProfileId, + threadId + ); + + res.status(201).json({ data: detailList }); +}); + module.exports = { createConsultant, deleteConsultant, getConsultant, + getConsultantDetail, }; diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index d1284af..d24dc2e 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -105,4 +105,57 @@ const getConsultant = async (userId, threadTypesId) => { throw error; } }; -module.exports = { createConsultant, deleteConsultant, getConsultant }; + +const getConsultantDetail = async (trainerProfileId, threadId) => { + try { + const data = await dataSource.query( + ` +SELECT +t.id AS threadId, +u.profile_image AS trainerProfileImage, +(select u.nickname +from users u +left join trainer_profiles t +on u.id = t.user_id +where t.id = tp.id)AS trainerNickname, +tg.name AS trainerEmojiName, +mg.name AS userEmojiName, +u.nickname AS userNickname, +t.content, +t.created_at AS createdAt, +JSON_ARRAYAGG( +JSON_OBJECT( +'commentId', c.id, +'nickname', cu.nickname, +'content', c.content, +'emojiName', mg.emoji, +'commentAt', c.created_at +) +) AS comments +FROM threads t +LEFT JOIN users u ON u.id = t.user_id +LEFT JOIN member_profiles mp ON mp.user_id = u.id +LEFT JOIN member_grades mg ON mp.member_grade_id = mg.id +LEFT JOIN comments c ON c.thread_id = t.id +LEFT JOIN users cu ON cu.id = c.user_id +LEFT JOIN trainer_profiles tp ON tp.id = t.trainer_profile_id +LEFT JOIN users tu ON tu.id = tp.user_id +LEFT JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id +WHERE t.id = ? +GROUP BY t.id, mg.name, u.nickname, u.profile_image, t.content, t.created_at, tu.nickname, tg.name; +`, + [trainerProfileId, threadId] + ); + return data; + } catch { + const error = new Error('error'); + error.statusCode = 400; + throw error; + } +}; +module.exports = { + createConsultant, + deleteConsultant, + getConsultant, + getConsultantDetail, +}; diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index aa43334..3d31483 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -1,12 +1,29 @@ -const express = require("express"); +const express = require('express'); -const consultantController = require("../controllers/consultantController"); +const consultantController = require('../controllers/consultantController'); const consultantRouter = express.Router(); -const { loginRequired } = require("../utils/auth"); +const { loginRequired } = require('../utils/auth'); -consultantRouter.post("/posts/upload", consultantController.createConsultant); -consultantRouter.delete("/posts/:postId", consultantController.deleteConsultant); -consultantRouter.get("/posts/list/:thread_types_id", consultantController.getConsultant) +consultantRouter.post( + '/posts/upload', + loginRequired, + consultantController.createConsultant +); +consultantRouter.delete( + '/posts/:postId', + loginRequired, + consultantController.deleteConsultant +); +consultantRouter.get( + '/posts/list/:thread_types_id', + loginRequired, + consultantController.getConsultant +); +consultantRouter.get( + '/posts/:trainer_profiles_id', + loginRequired, + consultantController.getConsultantDetail +); -module.exports = { consultantRouter }; \ No newline at end of file +module.exports = { consultantRouter }; diff --git a/api/services/consultantService.js b/api/services/consultantService.js index 287a0d6..2b0f6ef 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -1,22 +1,44 @@ const consultantDao = require('../models/consultantDao'); -const createConsultThreads = async (userId, threadTypesId, content, trainerId) => { - const result = await consultantDao.createConsultant(userId, threadTypesId, content, trainerId); +const createConsultThreads = async ( + userId, + threadTypesId, + content, + trainerId +) => { + const result = await consultantDao.createConsultant( + userId, + threadTypesId, + content, + trainerId + ); - return result; - }; + return result; +}; const deleteConsultantThreads = async (threadId) => { - const result = await consultantDao.deleteConsultant(threadId) - return result; + const result = await consultantDao.deleteConsultant(threadId); + return result; }; const getConsultantList = async (userId, threadTypesId) => { const result = await consultantDao.getConsultant(userId, threadTypesId); + return result; }; -module.exports = { +const getConsultantDetailList = async (trainerProfileId, threadId) => { + const result = await consultantDao.getConsultantDetail( + trainerProfileId, + threadId + ); + + return result; +}; + +module.exports = { createConsultThreads, deleteConsultantThreads, - getConsultantList }; \ No newline at end of file + getConsultantList, + getConsultantDetailList, +}; From a1632efbeedb1eaac32135c89810faa69b8ddb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Thu, 21 Sep 2023 18:09:09 +0900 Subject: [PATCH 46/54] fix: adding multiple image --- api/models/postDao.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/models/postDao.js b/api/models/postDao.js index 40f7d31..cfd05d1 100644 --- a/api/models/postDao.js +++ b/api/models/postDao.js @@ -121,8 +121,8 @@ const postCommunity = async (userId, category, title, content, imageUrls) => { } else { for (imageUrl of imageUrls) { addPostImage(insertThreadId, imageUrl); - return insertThreadId; } + return insertThreadId; } } catch (error) { console.error('Error in postCommunity:', error); From f1ce8b72267ebe0e3566db1b2d388a9d0a8cfff0 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Thu, 21 Sep 2023 20:44:33 +0900 Subject: [PATCH 47/54] chore: Update db migrations --- db/migrations/20230921114103_modify_exercises_table.sql | 5 +++++ db/migrations/20230921114121_modify_diet_images_table.sql | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 db/migrations/20230921114103_modify_exercises_table.sql create mode 100644 db/migrations/20230921114121_modify_diet_images_table.sql diff --git a/db/migrations/20230921114103_modify_exercises_table.sql b/db/migrations/20230921114103_modify_exercises_table.sql new file mode 100644 index 0000000..bcc8474 --- /dev/null +++ b/db/migrations/20230921114103_modify_exercises_table.sql @@ -0,0 +1,5 @@ +-- migrate:up +ALTER TABLE exercises MODIFY image_url varchar(500) NOT NULL; + +-- migrate:down + diff --git a/db/migrations/20230921114121_modify_diet_images_table.sql b/db/migrations/20230921114121_modify_diet_images_table.sql new file mode 100644 index 0000000..2e8a66b --- /dev/null +++ b/db/migrations/20230921114121_modify_diet_images_table.sql @@ -0,0 +1,5 @@ +-- migrate:up +ALTER TABLE diet_images MODIFY image_url varchar(500) NOT NULL; + +-- migrate:down + From 93f001319b85210c2205744eb4d99a92fcbae3b0 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Thu, 21 Sep 2023 21:37:04 +0900 Subject: [PATCH 48/54] chore: Update db migrations --- db/migrations/20230921123220_modify_diets_table.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 db/migrations/20230921123220_modify_diets_table.sql diff --git a/db/migrations/20230921123220_modify_diets_table.sql b/db/migrations/20230921123220_modify_diets_table.sql new file mode 100644 index 0000000..c930c15 --- /dev/null +++ b/db/migrations/20230921123220_modify_diets_table.sql @@ -0,0 +1,4 @@ +-- migrate:up +ALTER TABLE diets ADD checkbox tinyint(1) NOT NULL DEFAULT 0; + +-- migrate:down From d9eaa9cc6859d8a367fbdf445b5a35502c3c8c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Thu, 21 Sep 2023 21:37:19 +0900 Subject: [PATCH 49/54] feature: consultant-commnet --- api/controllers/consultantController.js | 24 +++++++++++++++++ api/models/consultantDao.js | 35 +++++++++++++++++++++++++ api/routes/consultantRouter.js | 6 +++++ api/services/consultantService.js | 20 ++++++++++++++ 4 files changed, 85 insertions(+) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index b8679df..47aa2ad 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -45,9 +45,33 @@ const getConsultantDetail = catchAsync(async (req, res) => { res.status(201).json({ data: detailList }); }); +const addConsultantComment = catchAsync(async (req, res) => { + const { userId } = req.user; + const userType = res.locals.userType; + const { postId: threadId } = req.query; + const { content } = req.body; + const commentsTypeId = await consultantService.getCommentsTypeId(userType); + + if (!content) { + const error = new Error('KEY_ERROR'); + error.statusCode = 400; + + throw error; + } else { + await consultantService.addConsultantComment( + userId, + threadId, + commentsTypeId, + content + ); + res.status(201).json({ message: 'CREATE COMMENT SUCCESS' }); + } +}); + module.exports = { createConsultant, deleteConsultant, getConsultant, getConsultantDetail, + addConsultantComment, }; diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index d24dc2e..62c17e5 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -153,9 +153,44 @@ GROUP BY t.id, mg.name, u.nickname, u.profile_image, t.content, t.created_at, tu throw error; } }; + +const addConsultantComment = async ( + userId, + threadId, + commentsTypeId, + content +) => { + try { + await dataSource.query( + `INSERT INTO comments (user_id, thread_id, comment_types_id, content) VALUES (?,?,?,?)`, + [userId, threadId, commentsTypeId, content] + ); + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + +const getCommentsTypeId = async (userType) => { + try { + const [{ id: commentsTypeId }] = await dataSource.query( + `SELECT id FROM comment_types ct WHERE ct.name=?`, + [userType] + ); + return commentsTypeId; + } catch (err) { + const error = new Error('dataSource Error'); + error.statusCode = 400; + throw error; + } +}; + module.exports = { createConsultant, deleteConsultant, getConsultant, getConsultantDetail, + addConsultantComment, + getCommentsTypeId, }; diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index 3d31483..648c001 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -26,4 +26,10 @@ consultantRouter.get( consultantController.getConsultantDetail ); +consultantRouter.post( + '/posts', + loginRequired, + consultantController.addConsultantComment +); + module.exports = { consultantRouter }; diff --git a/api/services/consultantService.js b/api/services/consultantService.js index 2b0f6ef..de5c3d8 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -36,9 +36,29 @@ const getConsultantDetailList = async (trainerProfileId, threadId) => { return result; }; +const addConsultantComment = async ( + userId, + threadId, + commentsTypeId, + content +) => { + await consultantDao.addConsultantComment( + userId, + threadId, + commentsTypeId, + content + ); +}; + +const getCommentsTypeId = async (userType) => { + return await consultantDao.getCommentsTypeId(userType); +}; + module.exports = { createConsultThreads, deleteConsultantThreads, getConsultantList, getConsultantDetailList, + addConsultantComment, + getCommentsTypeId, }; From 468a3d5e95eaab8bd66bea8479e5fc2cac3a7c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EB=8F=99=EB=AF=BC?= Date: Thu, 21 Sep 2023 21:37:19 +0900 Subject: [PATCH 50/54] fix: all bug --- api/controllers/consultantController.js | 13 ++++++------- api/models/consultantDao.js | 12 ++++++------ api/models/paymentDao.js | 2 +- api/models/trainerDao.js | 3 +-- api/routes/consultantRouter.js | 2 +- api/services/consultantService.js | 8 ++++---- api/services/paymentService.js | 4 +++- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index 47aa2ad..50b8546 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -2,15 +2,14 @@ const consultantService = require('../services/consultantService'); const { catchAsync } = require('../utils/error'); const createConsultant = catchAsync(async (req, res) => { - const { content, trainerId, threadTypesId = 3 } = await req.body; - + const { content, trainerProfileId, threadTypesId = 3 } = await req.body; const userId = req.user.userId; await consultantService.createConsultThreads( userId, threadTypesId, content, - trainerId + trainerProfileId ); res.status(201).json({ message: 'success' }); @@ -25,7 +24,7 @@ const deleteConsultant = catchAsync(async (req, res) => { }); const getConsultant = catchAsync(async (req, res) => { - const userId = req.params.userId; + const userId = req.user.userId; const threadTypesId = req.params.thread_types_id; const list = await consultantService.getConsultantList(userId, threadTypesId); @@ -34,12 +33,12 @@ const getConsultant = catchAsync(async (req, res) => { }); const getConsultantDetail = catchAsync(async (req, res) => { - const trainerProfileId = req.params.trainer_profiles_id; - const threadId = req.params.thread_id; + const trainerProfileId = req.query.trainerProfileId; + const userId = req.user.userId; const detailList = await consultantService.getConsultantDetailList( trainerProfileId, - threadId + userId ); res.status(201).json({ data: detailList }); diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index 62c17e5..a9cb7a8 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -70,7 +70,7 @@ const getConsultant = async (userId, threadTypesId) => { t.id as thread_id, t.thread_types_id, t.content, - t.trainer_profile_id, + t.trainer_profile_id AS trainerId, t.created_at, tt.name as threadTypeName, u.nickname as trainerNickname, @@ -106,13 +106,12 @@ const getConsultant = async (userId, threadTypesId) => { } }; -const getConsultantDetail = async (trainerProfileId, threadId) => { +const getConsultantDetail = async (trainerProfileId, userId) => { try { const data = await dataSource.query( ` SELECT t.id AS threadId, -u.profile_image AS trainerProfileImage, (select u.nickname from users u left join trainer_profiles t @@ -128,7 +127,7 @@ JSON_OBJECT( 'commentId', c.id, 'nickname', cu.nickname, 'content', c.content, -'emojiName', mg.emoji, +'emojiName', mg.name, 'commentAt', c.created_at ) ) AS comments @@ -141,10 +140,10 @@ LEFT JOIN users cu ON cu.id = c.user_id LEFT JOIN trainer_profiles tp ON tp.id = t.trainer_profile_id LEFT JOIN users tu ON tu.id = tp.user_id LEFT JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id -WHERE t.id = ? +WHERE tp.id = ? AND u.id =? GROUP BY t.id, mg.name, u.nickname, u.profile_image, t.content, t.created_at, tu.nickname, tg.name; `, - [trainerProfileId, threadId] + [trainerProfileId, userId] ); return data; } catch { @@ -166,6 +165,7 @@ const addConsultantComment = async ( [userId, threadId, commentsTypeId, content] ); } catch (err) { + console.log(err); const error = new Error('dataSource Error'); error.statusCode = 400; throw error; diff --git a/api/models/paymentDao.js b/api/models/paymentDao.js index 826b099..fa171a1 100644 --- a/api/models/paymentDao.js +++ b/api/models/paymentDao.js @@ -64,7 +64,7 @@ const getMatchingTrainer = async (trainerId, memberId) => { FROM users u INNER JOIN trainer_profiles tp ON u.id = tp.user_id INNER JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id - WHERE u.id = ? + WHERE tp.id = ? AND EXISTS (SELECT 1 FROM users WHERE id = ?); `, [trainerId, memberId] diff --git a/api/models/trainerDao.js b/api/models/trainerDao.js index c984735..4047373 100644 --- a/api/models/trainerDao.js +++ b/api/models/trainerDao.js @@ -1,11 +1,10 @@ const { dataSource } = require('./dataSource'); - const getTrainerList = async (offset, pageSize) => { try { const data = await dataSource.query( ` SELECT - u.id, + tp.id, tg.emoji, tg.name emojiName, u.nickname nickName, diff --git a/api/routes/consultantRouter.js b/api/routes/consultantRouter.js index 648c001..e2f39f1 100644 --- a/api/routes/consultantRouter.js +++ b/api/routes/consultantRouter.js @@ -21,7 +21,7 @@ consultantRouter.get( consultantController.getConsultant ); consultantRouter.get( - '/posts/:trainer_profiles_id', + '/posts', loginRequired, consultantController.getConsultantDetail ); diff --git a/api/services/consultantService.js b/api/services/consultantService.js index de5c3d8..5dcc951 100644 --- a/api/services/consultantService.js +++ b/api/services/consultantService.js @@ -4,13 +4,13 @@ const createConsultThreads = async ( userId, threadTypesId, content, - trainerId + trainerProfileId ) => { const result = await consultantDao.createConsultant( userId, threadTypesId, content, - trainerId + trainerProfileId ); return result; @@ -27,10 +27,10 @@ const getConsultantList = async (userId, threadTypesId) => { return result; }; -const getConsultantDetailList = async (trainerProfileId, threadId) => { +const getConsultantDetailList = async (trainerProfileId, userId) => { const result = await consultantDao.getConsultantDetail( trainerProfileId, - threadId + userId ); return result; diff --git a/api/services/paymentService.js b/api/services/paymentService.js index b3e0ded..90d3be9 100644 --- a/api/services/paymentService.js +++ b/api/services/paymentService.js @@ -11,7 +11,9 @@ const getMatchingTrainer = async (trainerId, memberId) => { trainerId, memberId ); - if (matchingTrainer.length === 0) throw new Error('Trainer not found'); + if (!matchingTrainer) { + throw new Error('Trainer not found'); + } return matchingTrainer; }; From c374821735bec834f50d2329f8e444e30bf2f791 Mon Sep 17 00:00:00 2001 From: suyeongs Date: Fri, 22 Sep 2023 10:13:49 +0900 Subject: [PATCH 51/54] final --- api/controllers/consultantController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/controllers/consultantController.js b/api/controllers/consultantController.js index 50b8546..ce8f930 100644 --- a/api/controllers/consultantController.js +++ b/api/controllers/consultantController.js @@ -2,14 +2,14 @@ const consultantService = require('../services/consultantService'); const { catchAsync } = require('../utils/error'); const createConsultant = catchAsync(async (req, res) => { - const { content, trainerProfileId, threadTypesId = 3 } = await req.body; + const { content, trainerId, threadTypesId = 3 } = await req.body; const userId = req.user.userId; await consultantService.createConsultThreads( userId, threadTypesId, content, - trainerProfileId + trainerId ); res.status(201).json({ message: 'success' }); From f0d047d515777c44efe3c0d37c626bbdb241576b Mon Sep 17 00:00:00 2001 From: yjieuny <124503930+yjieuny@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:44:56 +0900 Subject: [PATCH 52/54] Update readme.md --- readme.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 21bca5b..b977c47 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,54 @@ -# Foundation API wrap-up +# GYPPT -Express, TypeORM, Layered Pattern, Error Handling ์ ์šฉ +## ๐Ÿ’ป ๊ฐœ๋ฐœ ๊ธฐ๊ฐ„ + +23.09.04 ~ 23.09.22 + +## ๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ ๋ฉค๋ฒ„ ๊ตฌ์„ฑ + +- ๊น€๋„์œค : ํ”Œ๋กœ์šฐ ์ฐจํŠธ, ERD ๋ชจ๋ธ๋ง, ์ƒ๋‹ด ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑใƒป์กฐํšŒใƒป์‚ญ์ œ ๋ฐ ์ƒ์„ธ ๋Œ“๊ธ€ ์กฐํšŒ +- ๊น€์‹œ์—ฐ : ๊ธฐ๋Šฅ์ •์˜์„œ, ERD ๋ชจ๋ธ๋ง, API ๋ชฉ๋ก ์ •๋ฆฌ, ์šด๋™ ์‹œ์ž‘ํ•˜๊ธฐ, ์šด๋™ ๋ฐ ์‹๋‹จ ๋ชฉ๋กใƒป์ƒ๋‹ด ์—ฌ๋ถ€ ์ฒดํฌ, ๋งˆ์ดํŽ˜์ด์ง€ ์ˆ˜์ •, ๋‚ด ์ •๋ณด +- ๋ฐฉ์ˆ˜์˜ : ๊ธฐ๋Šฅ์ •์˜์„œ, ํ”Œ๋กœ์šฐ ์ฐจํŠธ, dbmate, ํŠธ๋ ˆ์ด๋„ˆ ๋ชฉ๋ก ์กฐํšŒ, ๊ฒฐ์ œํŽ˜์ด์ง€(๋ฉค๋ฒ„์‹ญ ์•ˆ๋‚ด ๋ฆฌ์ŠคํŠธ+ํŠธ๋ ˆ์ด๋„ˆ ํ”„๋กœํ•„ ์กฐํšŒ), ๊ฒฐ์ œ(์™ธ๋ถ€ APIใƒปํฌ์ธํŠธ) +- ์–‘์ง€์€ : ๊ธฐ๋Šฅ์ •์˜์„œ, ํ”Œ๋กœ์šฐ ์ฐจํŠธ, ์ปค๋ฎค๋‹ˆํ‹ฐ ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑใƒป์กฐํšŒใƒป์ƒ์„ธ ๋Œ“๊ธ€ ์กฐํšŒ +- ์ •๋™๋ฏผ : API ๋ชฉ๋ก ์ •๋ฆฌ, dbmate, ์ดˆ๊ธฐ์„ธํŒ…, ํšŒ์›๊ฐ€์ž…, ์œ ์ € ํƒ€์ž… ๊ตฌ๋ถ„, ๋ฐ์ดํ„ฐ ์ˆ˜์ง‘, ์‚ฌ์ง„ ์ฒจ๋ถ€ + +## ****๐Ÿ‹๏ธโ€โ™€๏ธ****ย ์„œ๋น„์Šค ์†Œ๊ฐœ + +### ๊ธฐํš ์˜๋„ + +๋ฐ”์œ ํ˜„๋Œ€์ธ๋“ค์„ ์œ„ํ•œ ํ”ผํŠธ๋‹ˆ์Šค์™€ ์šด๋™ ์„œ๋น„์Šค๋ฅผ ๊ธฐํšํ•˜์—ฌ ์‹œ๊ฐ„๊ณผ ๊ณต๊ฐ„์˜ ์ œ์•ฝ ์—†์ด ๊ฑด๊ฐ•ํ•œ ๋ผ์ดํ”„์Šคํƒ€์ผ์„ ์ถ”๊ตฌํ•˜๋Š” ๋ชจ๋“  ์ด๋“ค์—๊ฒŒ ํŽธ์˜์„ฑ๊ณผ ํšจ๊ณผ์„ฑ์„ ์ œ๊ณต + +### ํ•ต์‹ฌ ๊ธฐ๋Šฅ + +ํšŒ์›๊ฐ€์ž… + +- ๋น„๋ฐ€๋ฒˆํ˜ธ ์•”ํ˜ธํ™” +- ์ •๊ทœํ‘œํ˜„์‹ +- ์œ ์ € ํƒ€์ž… ๊ตฌ๋ถ„ + +๋กœ๊ทธ์ธ + +- ์ด๋ฉ”์ผ ์ค‘๋ณต์—ฌ๋ถ€ ํ™•์ธ +- ํ† ํฐ ๋ฐœ๊ธ‰ + +๋‚ด ์ •๋ณด ๋ฐ ๋งˆ์ดํŽ˜์ด์ง€ ์ˆ˜์ • + +์ปค๋ฎค๋‹ˆํ‹ฐใƒป์ƒ๋‹ด ๊ฒŒ์‹œ๊ธ€ + +- ๋ฐ์ดํ„ฐ ์ •๋ ฌ +- ๋‚ ์งœ ํฌ๋งทํŒ… +- ์‚ฌ์ง„ ์ฒจ๋ถ€ ๊ธฐ๋Šฅ + +๊ฒฐ์ œ + +- ์™ธ๋ถ€ API +- ํฌ์ธํŠธ ๊ฒฐ์ œ + +## ๐Ÿ› ๏ธย ๊ธฐ์ˆ  ์Šคํƒ + +### Backend + +- Express +- TypeORM +- Layered Pattern +- Error Handling From 0349a67297e7b767732f0151d7b12d0f63183827 Mon Sep 17 00:00:00 2001 From: yjieuny <124503930+yjieuny@users.noreply.github.com> Date: Sat, 30 Sep 2023 21:47:27 +0900 Subject: [PATCH 53/54] Update readme.md --- readme.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/readme.md b/readme.md index b977c47..5ef94c6 100644 --- a/readme.md +++ b/readme.md @@ -20,16 +20,11 @@ ### ํ•ต์‹ฌ ๊ธฐ๋Šฅ -ํšŒ์›๊ฐ€์ž… - -- ๋น„๋ฐ€๋ฒˆํ˜ธ ์•”ํ˜ธํ™” -- ์ •๊ทœํ‘œํ˜„์‹ -- ์œ ์ € ํƒ€์ž… ๊ตฌ๋ถ„ - ๋กœ๊ทธ์ธ - ์ด๋ฉ”์ผ ์ค‘๋ณต์—ฌ๋ถ€ ํ™•์ธ - ํ† ํฐ ๋ฐœ๊ธ‰ +- ์œ ์ € ํƒ€์ž… ๊ตฌ๋ถ„ ๋‚ด ์ •๋ณด ๋ฐ ๋งˆ์ดํŽ˜์ด์ง€ ์ˆ˜์ • From f459ec09d7c46798aafbbb9615696eb2950dc45b Mon Sep 17 00:00:00 2001 From: suyeongs Date: Tue, 30 Jan 2024 23:06:44 +0900 Subject: [PATCH 54/54] fix: Modify the error in the consultation query statement --- api/models/consultantDao.js | 157 +++++++++++++++++------------------- 1 file changed, 75 insertions(+), 82 deletions(-) diff --git a/api/models/consultantDao.js b/api/models/consultantDao.js index a9cb7a8..2293068 100644 --- a/api/models/consultantDao.js +++ b/api/models/consultantDao.js @@ -9,18 +9,18 @@ const createConsultant = async ( try { await dataSource.query( ` - INSERT INTO threads ( - user_id, - thread_types_id, - content, - trainer_profile_id - ) VALUES ( - ?, - ?, - ?, - ? - ) - `, + INSERT INTO threads ( + user_id, + thread_types_id, + content, + trainer_profile_id + ) VALUES ( + ?, + ?, + ?, + ? + ) + `, [userId, threadTypesId, content, trainerProfileId] ); } catch { @@ -38,16 +38,16 @@ const deleteConsultant = async (threadId) => { try { await queryRunner.query( ` - DELETE FROM comments - WHERE thread_id = ? - `, + DELETE FROM comments + WHERE thread_id = ? + `, [threadId] ); await queryRunner.query( ` - DELETE FROM threads - WHERE id = ? - `, + DELETE FROM threads + WHERE id = ? + `, [threadId] ); @@ -66,36 +66,23 @@ const getConsultant = async (userId, threadTypesId) => { try { const data = await dataSource.query( ` - select - t.id as thread_id, - t.thread_types_id, - t.content, - t.trainer_profile_id AS trainerId, - t.created_at, - tt.name as threadTypeName, - u.nickname as trainerNickname, - u.profile_image as trainerProfileImage, - tg.name as emojiName - from threads t - - join thread_types tt - - on tt.id = t.thread_types_id - - join trainer_profiles tp - - on tp.id = t.trainer_profile_id - - Join users u - - On t.user_id = u.id - - Join trainer_grades tg - - On tg.id = tp.trainer_grade_id - - WHERE t.user_id = ? AND tt.id = ? - `, + SELECT + t.id AS thread_id, + t.thread_types_id, + t.content, + t.trainer_profile_id AS trainerId, + t.created_at, + tt.name AS threadTypeName, + u.nickname AS trainerNickname, + u.profile_image AS trainerProfileImage, + tg.name AS emojiName + FROM threads t + JOIN thread_types tt ON tt.id = t.thread_types_id + JOIN trainer_profiles tp ON tp.id = t.trainer_profile_id + JOIN users u ON t.trainer_profile_id = u.id + JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id + WHERE t.user_id = ? AND tt.id = ?; + `, [userId, threadTypesId] ); return data; @@ -110,39 +97,45 @@ const getConsultantDetail = async (trainerProfileId, userId) => { try { const data = await dataSource.query( ` -SELECT -t.id AS threadId, -(select u.nickname -from users u -left join trainer_profiles t -on u.id = t.user_id -where t.id = tp.id)AS trainerNickname, -tg.name AS trainerEmojiName, -mg.name AS userEmojiName, -u.nickname AS userNickname, -t.content, -t.created_at AS createdAt, -JSON_ARRAYAGG( -JSON_OBJECT( -'commentId', c.id, -'nickname', cu.nickname, -'content', c.content, -'emojiName', mg.name, -'commentAt', c.created_at -) -) AS comments -FROM threads t -LEFT JOIN users u ON u.id = t.user_id -LEFT JOIN member_profiles mp ON mp.user_id = u.id -LEFT JOIN member_grades mg ON mp.member_grade_id = mg.id -LEFT JOIN comments c ON c.thread_id = t.id -LEFT JOIN users cu ON cu.id = c.user_id -LEFT JOIN trainer_profiles tp ON tp.id = t.trainer_profile_id -LEFT JOIN users tu ON tu.id = tp.user_id -LEFT JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id -WHERE tp.id = ? AND u.id =? -GROUP BY t.id, mg.name, u.nickname, u.profile_image, t.content, t.created_at, tu.nickname, tg.name; -`, + SELECT + t.id AS threadId, + ( + SELECT u.nickname + FROM users u + LEFT JOIN trainer_profiles t ON u.id = t.user_id + WHERE t.id = tp.id + ) AS trainerNickname, + tg.name AS trainerEmojiName, + mg.name AS userEmojiName, + u.nickname AS userNickname, + t.content, + t.created_at AS createdAt, + JSON_ARRAYAGG( + JSON_OBJECT( + 'id', c.user_id, + 'nickname', cu.nickname, + 'content', c.content, + 'emojiName', + CASE + WHEN c.user_id IN (SELECT user_id FROM trainer_profiles) THEN tg.name + WHEN c.user_id IN (SELECT user_id FROM member_profiles) THEN mg.name + ELSE NULL + END, + 'commentAt', c.created_at + ) + ) AS comments + FROM threads t + LEFT JOIN users u ON u.id = t.user_id + LEFT JOIN member_profiles mp ON mp.user_id = u.id + LEFT JOIN member_grades mg ON mp.member_grade_id = mg.id + LEFT JOIN comments c ON c.thread_id = t.id + LEFT JOIN users cu ON cu.id = c.user_id + LEFT JOIN trainer_profiles tp ON tp.id = t.trainer_profile_id + LEFT JOIN users tu ON tu.id = tp.user_id + LEFT JOIN trainer_grades tg ON tg.id = tp.trainer_grade_id + WHERE tp.id = 13 AND u.id = 74 + GROUP BY t.id, mg.name, u.nickname, u.profile_image, t.content, t.created_at, tu.nickname, tg.name; + `, [trainerProfileId, userId] ); return data; @@ -175,7 +168,7 @@ const addConsultantComment = async ( const getCommentsTypeId = async (userType) => { try { const [{ id: commentsTypeId }] = await dataSource.query( - `SELECT id FROM comment_types ct WHERE ct.name=?`, + `SELECT id FROM comment_types ct WHERE ct.name = ?`, [userType] ); return commentsTypeId;