diff --git a/.gitignore b/.gitignore
index b7cd2a6..d5a7a2c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,4 +23,6 @@ yarn-debug.log*
yarn-error.log*
yarn.lock
-.env
\ No newline at end of file
+.env
+
+src/config
\ No newline at end of file
diff --git a/README.md b/README.md
index 6cff723..5dc44ed 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,19 @@
-# Mascota-Server
+# zMascota-Server
야용...냥냥😺
----------------------------------------------------
+![MASCOTA_로고](https://user-images.githubusercontent.com/76844556/125953954-569cf975-b298-481b-bbfe-4faf4e6d767f.gif)
## :hammer: Avengers
-| 이솔 | 이현종 | 강수미 |
-| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
+| 이솔 | 이현종 | 강수미 |
+| :--------------------------------------: | :--------------------------------------: | :--------------------------------------: |
| ![image](https://user-images.githubusercontent.com/57162257/124487068-3c141680-dde9-11eb-97b3-ff82ab180239.png) | ![image](https://user-images.githubusercontent.com/57162257/124487598-e1c78580-dde9-11eb-8672-254506d3e484.png) | ![image](https://user-images.githubusercontent.com/57162257/124487807-189d9b80-ddea-11eb-88f1-4a1b2a04683d.png) |
----------------------------------------------------
+![mascota_orange](https://user-images.githubusercontent.com/76844556/125953999-1fa041ca-c696-4a07-8b90-9d6297b014dc.png)
## :panda_face: 프로젝트 설명
@@ -37,12 +39,104 @@
>
>
>
-> #### -> 죽음에 대한 거부감을 줄이고 준비의 필요성을 높인다.
+> -> 죽음에 대한 거부감을 줄이고 준비의 필요성을 높인다.
----------------------------------------------------
+## ❣ Feature
+
+🌺 **1부 - 솔**
+
+------
+
+[[POST\]로그인 API](https://www.notion.so/POST-API-d8789d6072cb47f698b019fb3f9b5e69)
+
+[[POST\]회원가입 API](https://www.notion.so/POST-API-458da9c291c645fe813fdece59a26b06)
+
+[[POST\]반려동물 등록 API ](https://www.notion.so/POST-API-570d51c21ec048e8aca462fb34f04fee)
+
+[[POST\]프롤로그 작성 API](https://www.notion.so/POST-API-023cbd99b1834715ad692b22a83dd116)
+
+[[GET\] 1부 홈 화면 API](https://www.notion.so/GET-1-API-f1c1f97c984343ab9cb12e4ca0539388)
+
+[[POST\] 반려동물 일기 작성 API ](https://www.notion.so/POST-API-f39c866cc485481d9a6fab0765a70b8f)
+
+[[GET\]일기 조회 API](https://www.notion.so/GET-API-f069e944c8f646ba87964b94b3484887)
+
+[[PUT\]일기 수정 API](https://www.notion.so/PUT-API-94b5e889542446c7ac7fe15826dbe566)
+
+[[DELETE\] 일기 삭제 API](https://www.notion.so/DELETE-API-2740e249af1446b0af67dba5348f7079)
+
+[[GET\] 목차별 일기 조회 API](https://www.notion.so/GET-API-7d3d2b4c39724c13a3080f45962de778)
+
+[[GET\] 목차 리스트 API](https://www.notion.so/GET-API-5c2b74531aee4d269911d50f9e75d50b)
+
+[[POST\] 목차 추가 API](https://www.notion.so/POST-API-c4bb24ecce23476f9350ca4df3db4a78)
+
+[[PUT\] 목차 수정 API](https://www.notion.so/PUT-API-7d275a4b7ddc46f88d20299ad720cd65)
+
+[[DELETE\] 목차 삭제 API](https://www.notion.so/DELETE-API-75ad7e25f9f24db8ba4a97ba084dcbe3)
+
+[[GET\] 반려동물 정보 API - new](https://www.notion.so/GET-API-new-ffa6b8dc68dd4c8aad3eddc4e3f23e8a)
+
+------
+
+🌷 **1.5 부 - 리드 혀니**
+
+------
+
+[[Get\]1.5부 무지개 홈 화면API](https://www.notion.so/Get-1-5-API-a4e4c3749d6e48c295b6d8f4c885fff2)
+
+[[Put\] 1.5부 무지개 반려동물 적용 API& 1.5부 무지개 반려동물 무지개 다리 멘트API](https://www.notion.so/Put-1-5-API-1-5-API-ee0baa92a7d84bc7b61ec9ea77da553a)
+
+[[Delete\] 1.5부 무지개 이별준비 취소하기](https://www.notion.so/Delete-1-5-f8e5197c5d204da9acdd01b993f5e840)
+
+[[Get\]1.5부 무지개 이별에 준비하는 작가의 기록 시작 API](https://www.notion.so/Get-1-5-API-9a62bc023c10401cab230b83ffc10c96)
+
+[[Get\]1.5부 무지개 최고의 순간 API](https://www.notion.so/Get-1-5-API-bd049d93217f43f894fa7ec261a38bcb)
+
+[[Get\] 1.5부 무지개 작가의 말 작성 시 반려동물 이름 불러오기 API](https://www.notion.so/Get-1-5-API-8a4e08b97e2047618cbc06a6786ec870)
+
+[[Post\]1.5부 무지개 작가의 말 - 에필로그 API](https://www.notion.so/Post-1-5-API-774b9cccd19a4879aa26c0cfcfc620fc)
+
+[[Get\] 1.5부 무지개 서브 홈 API](https://www.notion.so/Get-1-5-API-ad57037e73bb4a39b456b4252188a347)
+
+[[Get\] 캘린더 뷰 API](https://www.notion.so/Get-API-26b42f6d2cec4344b6b1fb2062cdee30)
+
+------
+
+🌹 **2부 - 수 미 (홈/목차 - 혀니, 일기 - 솔)**
+
+[[GET\]2부 홈화면 API](https://www.notion.so/GET-2-API-4cb15d73b18e4aee88c820fd1d4a3c37)
+
+[[GET\]목차별 일기조회API](https://www.notion.so/GET-API-6c6e844b938b40668f18464ac30b57f1)
+
+[[GET\] 2부 목차 리스트 API](https://www.notion.so/GET-2-API-efdd94a18aba47c8a48ddf141eaf9e76)
+
+[[Post\] 2부 목차 추가 API](https://www.notion.so/Post-2-API-112fbee763b64be8b3ce5c84b1abbdbb)
+
+[[PUT\] 2부 목차 수정 API](https://www.notion.so/PUT-2-API-05533cedeeef4e86af4fdc8318f56c96)
+
+[[DELETE\] 목차 삭제 API](https://www.notion.so/DELETE-API-ffea94c0c28841d8a67cc2702d5eea70)
+
+[[POST\] 작가 일기 작성 API](https://www.notion.so/POST-API-db6ddfdaa1004db794127a7eb58e3a36)
+
+[[GET\]작가일기 조회 API](https://www.notion.so/GET-API-147c5a0f71204e7d964d02305acfca42)
+
+[[PUT\]작가일기 수정 API](https://www.notion.so/PUT-API-4a148a1d5f404889a0a7b1e94512468a)
+
+[[DELETE\] 작가일기 삭제 API](https://www.notion.so/DELETE-API-f2869d911b5e4d79a68a3c1e03beae86)
+
+[[GET\]대처법 API - 릴리즈](https://www.notion.so/GET-API-9c3e32bbc98d455a92885545a69fd697)
+
+[[GET\]도움 기관 연결API - 릴리즈](https://www.notion.so/GET-API-3719969de9c742f99752cb57aa3a3eea)
+
+[[GET\]마이페이지API - 릴리즈](https://www.notion.so/GET-API-68db22f818c546e9b2881bf8d0618e42)
+
+
+
## :ice_cream: 서버 아키텍처
![image](https://user-images.githubusercontent.com/57162257/124490748-75e71c00-dded-11eb-86bd-3487d46a244f.png)
@@ -139,11 +233,11 @@ main
- 제목
-| Title | Content |
-| :------: | :-------------: |
+| Title | Content |
+| :------: | :------: |
| feat | 새로운 기능추가 |
-| refactor | 코드 리팩토링 |
-| fix | 버그 수정 |
+| refactor | 코드 리팩토링 |
+| fix | 버그 수정 |
- 본문
@@ -164,10 +258,18 @@ main
-반환데이터에 반려동물 img 추가
```
-
----------------------------------------------------
+
+### 4. **User Flow**
+
+![Mascota Work Flow 2](https://user-images.githubusercontent.com/76844556/125996424-80c7c794-98dd-4b8c-80b6-b04240661d5c.png)
+![Mascota Work Flow 3](https://user-images.githubusercontent.com/76844556/125996432-1bfe58d8-df3e-423d-a02e-4dd079dbbf41.png)
+![Mascota Work Flow 4](https://user-images.githubusercontent.com/76844556/125996438-84db8ff4-8ce1-4d02-845f-0a28d702613f.png)
+![Mascota Work Flow 5](https://user-images.githubusercontent.com/76844556/125996450-75407294-eeb4-4e8c-9f39-15a7d2ac9be3.png)
+![Mascota Work Flow 6](https://user-images.githubusercontent.com/76844556/125996465-b5ebf482-35ce-4da6-aebb-65c7c37dfc20.png)
+
diff --git a/dist/api/controller/calendarController.js b/dist/api/controller/calendarController.js
new file mode 100644
index 0000000..eefbb0a
--- /dev/null
+++ b/dist/api/controller/calendarController.js
@@ -0,0 +1,28 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var util = require('../../modules/util');
+var responseMessage = require('../../modules/responseMessage');
+var statusCode = require('../../modules/statusCode');
+const calendarService = require('../service/calendarService');
+module.exports = {
+ getCalendar: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { year, month, part } = req.params;
+ try {
+ console.log(month + '+' + part);
+ const result = yield calendarService.getDiaryPerDate(year, month, part);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_MONTH_CALENDAR, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+};
+//# sourceMappingURL=calendarController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/calendarController.js.map b/dist/api/controller/calendarController.js.map
new file mode 100644
index 0000000..c8a1478
--- /dev/null
+++ b/dist/api/controller/calendarController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"calendarController.js","sourceRoot":"","sources":["../../../src/api/controller/calendarController.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACxC,IAAI,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC9D,IAAI,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACpD,MAAM,eAAe,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAA;AAE7D,MAAM,CAAC,OAAO,GAAC;IACX,WAAW,EAAC,CAAM,GAAG,EAAC,GAAG,EAAC,EAAE;QACxB,MAAM,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,EAAC,GAAG,GAAG,CAAC,MAAM,CAAA;QACpC,IAAG;YACC,OAAO,CAAC,GAAG,CAAC,KAAK,GAAE,GAAG,GAAC,IAAI,CAAC,CAAA;YAC5B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,IAAI,EAAC,KAAK,EAAC,IAAI,CAAC,CAAA;YACrE,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAC,eAAe,CAAC,0BAA0B,EAAC,MAAM,CAAC,CAAC,CAAA;SACvH;QAAA,OAAM,GAAG,EAAC;YACP,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAClB,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAA;SAC/I;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/controller/chapterController.js b/dist/api/controller/chapterController.js
new file mode 100644
index 0000000..ef334a2
--- /dev/null
+++ b/dist/api/controller/chapterController.js
@@ -0,0 +1,95 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+const chapterService = require('../service/chapterService');
+module.exports = {
+ getChapterDiary: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const chapterId = req.params.id; //id를 뺴면 객체를 보내줌
+ try {
+ const result = yield chapterService.getChapterDiary(chapterId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_CHAPTER_PETDIARY, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ getChapterList: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const userId = req.params.id;
+ try {
+ const result = yield chapterService.getChapterList(userId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_CHAPTERLIST, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ postChapterList: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const userId = req.params.id;
+ const chapterTitle = req.body.chapterTitle;
+ try {
+ const result = yield chapterService.postChapterList(userId, chapterTitle);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_CHAPTERLIST, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ putChapterList: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const chapterId = req.params.id;
+ const chapterTitle = req.body.chapterTitle;
+ try {
+ const result = yield chapterService.putChapterList(chapterId, chapterTitle);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_EDIT_CHAPTERLIST, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ deleteChapterList: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const chapterId = req.params.id;
+ try {
+ const result = yield chapterService.deleteChapterList(chapterId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_CHAPTERLIST, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ })
+};
+//# sourceMappingURL=chapterController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/chapterController.js.map b/dist/api/controller/chapterController.js.map
new file mode 100644
index 0000000..9868e65
--- /dev/null
+++ b/dist/api/controller/chapterController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"chapterController.js","sourceRoot":"","sources":["../../../src/api/controller/chapterController.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD,MAAM,cAAc,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;AAE3D,MAAM,CAAC,OAAO,GAAG;IACb,eAAe,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,SAAS,GAAC,GAAG,CAAC,MAAM,CAAC,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AC,GAAG,CAAC,CAAA;YAClB,IAAI,GAAG,CAAC,UAAU,IAAI,IAAI,EAAE;gBACxB,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC,qBAAqB,CAAC;gBAClD,GAAG,CAAC,eAAe,GAAG,eAAe,CAAC,qBAAqB,CAAC;aAC/D;YACD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,CAAA;SACzF;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/controller/diaryController.js b/dist/api/controller/diaryController.js
new file mode 100644
index 0000000..d5b88c8
--- /dev/null
+++ b/dist/api/controller/diaryController.js
@@ -0,0 +1,112 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var util = require('../../modules/util');
+var responseMessage = require('../../modules/responseMessage');
+var statusCode = require('../../modules/statusCode');
+var diaryService = require('../service/diaryService');
+var firstPartService = require('../service/firstPartService');
+module.exports = {
+ postPrologue: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { userId } = req.params;
+ const bookData = req.body;
+ //const bookImage = req.file.location
+ try {
+ yield diaryService.postPrologue(userId, bookData);
+ //const result=await firstPartService.getMainPage(userId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_PROLOGUE));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ postPetDiary: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const diaryData = req.body;
+ //const diaryImages = req.files.map(file => file.location)
+ try {
+ const result = yield diaryService.postPetDiary(diaryData);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_PETDIARY, ""));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ getPetDiary: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petDiaryId = req.params.id; //id를 뺴면 객체를 보내줌
+ try {
+ const result = yield diaryService.getPetDiary(petDiaryId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PETDIARY, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ putPetDiary: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petDiaryId = req.params.id;
+ const diaryData = req.body;
+ try {
+ const result = yield diaryService.putPetDiary(petDiaryId, diaryData);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_PETDIARY, ""));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ deletePetDiary: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petDiaryId = req.params.id;
+ try {
+ const result = yield diaryService.deletePetDiary(petDiaryId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_PETDIARY, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ postPetDiaryWithImage: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const images = req.files.map(img => img.location);
+ const diaryInfo = req.body;
+ try {
+ yield diaryService.postPetDiaryWithImage(images, diaryInfo);
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ })
+};
+//# sourceMappingURL=diaryController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/diaryController.js.map b/dist/api/controller/diaryController.js.map
new file mode 100644
index 0000000..dc9d944
--- /dev/null
+++ b/dist/api/controller/diaryController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"diaryController.js","sourceRoot":"","sources":["../../../src/api/controller/diaryController.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACxC,IAAI,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC9D,IAAI,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACpD,IAAI,YAAY,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AACrD,IAAI,gBAAgB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AA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No newline at end of file
diff --git a/dist/api/controller/firstPartController.js b/dist/api/controller/firstPartController.js
new file mode 100644
index 0000000..b4a9071
--- /dev/null
+++ b/dist/api/controller/firstPartController.js
@@ -0,0 +1,29 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+const firstPartService = require('../service/firstPartService');
+module.exports = {
+ mainPage: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { userId } = req.params;
+ try {
+ const result = yield firstPartService.getMainPage(userId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_FIRSTPART_MAINPAGE, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ })
+};
+//# sourceMappingURL=firstPartController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/firstPartController.js.map b/dist/api/controller/firstPartController.js.map
new file mode 100644
index 0000000..c252caa
--- /dev/null
+++ b/dist/api/controller/firstPartController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"firstPartController.js","sourceRoot":"","sources":["../../../src/api/controller/firstPartController.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD,MAAM,gBAAgB,GAAC,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAG7D,MAAM,CAAC,OAAO,GAAG;IACb,QAAQ,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;QAC9B,IAAI;YACA,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;YACzD,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,eAAe,CAAC,8BAA8B,EAAE,MAAM,CAAC,CAAC,CAAA;SACtH;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAClB,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAA;SAC/I;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/controller/petController.js b/dist/api/controller/petController.js
new file mode 100644
index 0000000..6e62a94
--- /dev/null
+++ b/dist/api/controller/petController.js
@@ -0,0 +1,63 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var util = require('../../modules/util');
+var responseMessage = require('../../modules/responseMessage');
+var statusCode = require('../../modules/statusCode');
+const petService = require('../service/petService');
+module.exports = {
+ getRegisterPetInfo: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const result = yield petService.getPetInfo();
+ console.log(typeof (statusCode.OK));
+ console.log(typeof (statusCode.INTERNAL_SERVER_ERROR));
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PET_INFO, result));
+ }
+ catch (error) {
+ console.error(error);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ registerPet: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ //let reqData=JSON.parse(JSON.stringify(req.body))
+ // console.log('type : '+typeof(reqData))
+ // console.log('toObject : '+reqData)
+ //const reqData = req.body
+ let reqData = req.body;
+ //let images = req.files.map(file=>file.location)
+ //console.log('reqData : '+ reqData.pets[0])
+ //const test = JSON.parse(reqData.pets)
+ // console.log('11111111111111 : '+typeof(reqData.pets[0]))
+ // console.log('reqData : '+reqData.pets)
+ // console.log('userId : '+reqData.userId)
+ // console.log('pets : '+reqData.pets[0])
+ // console.log('gender : '+reqData.pets[0].gender)
+ // console.log('kind : '+reqData.pets[0].kind)
+ // console.log('title : '+reqData.pets[0].title)
+ // console.log('startDate : '+reqData.pets[0].startDate)
+ //console.log('reqData index : '+reqData.pets[0].name) //undifned
+ //console.log('reqData2 : '+typeof(test))
+ //console.log('images : '+images)
+ try {
+ const result = yield petService.registerPet(reqData);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_REGISTER_PET, result));
+ }
+ catch (err) {
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error(err);
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ })
+};
+//# sourceMappingURL=petController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/petController.js.map b/dist/api/controller/petController.js.map
new file mode 100644
index 0000000..d003523
--- /dev/null
+++ b/dist/api/controller/petController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"petController.js","sourceRoot":"","sources":["../../../src/api/controller/petController.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACxC,IAAI,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC9D,IAAI,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACpD,MAAM,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AAGnD,MAAM,CAAC,OAAO,GAAG;IACb,kBAAkB,EAAC,CAAM,GAAG,EAAC,GAAG,EAAC,EAAE;QAC/B,IAAG;YACC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,UAAU,EAAE,CAAA;YAC5C,OAAO,CAAC,GAAG,CAAC,OAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;YAClC,OAAO,CAAC,GAAG,CAAC,OAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAA;YACrD,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAC,eAAe,CAAC,oBAAoB,EAAC,MAAM,CAAC,CAAC,CAAA;SACjH;QAAA,OAAM,KAAK,EAAC;YACT,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACpB,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IA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js
new file mode 100644
index 0000000..2951a35
--- /dev/null
+++ b/dist/api/controller/rainbowController.js
@@ -0,0 +1,117 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var util = require('../../modules/util');
+var responseMessage = require('../../modules/responseMessage');
+var statusCode = require('../../modules/statusCode');
+const rainbowService = require('../service/rainbowService');
+module.exports = {
+ mainPage: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { userId, petId } = req.params;
+ try {
+ const result = yield rainbowService.getMainPage(userId, petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_MAIN_PAGE, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ selectRainbowPet: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ try {
+ const result = yield rainbowService.selectPet();
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_PET, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ setRainbowPet: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petId = req.params.petId;
+ try {
+ const result = yield rainbowService.setPartingRainbowPet(petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PARTING_PET_COMMENT, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ cancelPartingPet: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petId = req.params.petId;
+ try {
+ yield rainbowService.cancelPartingPet(petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_PARTING_PET));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ getReadyPartingPetComment: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const petId = req.params.petId;
+ try {
+ const result = yield rainbowService.getReadyPartingPetComment(petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_READY_PARTING_PET_COMMENT, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ theBestMoment: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { userId, petId } = req.params;
+ try {
+ const result = yield rainbowService.getTheBestMoment(userId, petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_BEST_MOMENT, result, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ getPartingPetName: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { petId } = req.params;
+ try {
+ const result = yield rainbowService.getPartingPetName(petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PARTING_PETNAME, result, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ postEpilogue: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { userId, petId } = req.params;
+ const data = req.body;
+ try {
+ yield rainbowService.postEpilogue(userId, data);
+ const result = yield rainbowService.getMainPage(userId, petId);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_EPILOGUE, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ theBestMomentSub: (req, res) => __awaiter(this, void 0, void 0, function* () {
+ const { userId, petId } = req.params;
+ try {
+ const theBestMoment = yield rainbowService.getTheBestMoment(userId, petId);
+ const result = yield rainbowService.getTheBestMomentSub(petId, theBestMoment);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_SUB_PAGE, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ })
+};
+//# sourceMappingURL=rainbowController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/rainbowController.js.map b/dist/api/controller/rainbowController.js.map
new file mode 100644
index 0000000..452df0d
--- /dev/null
+++ b/dist/api/controller/rainbowController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"rainbowController.js","sourceRoot":"","sources":["../../../src/api/controller/rainbowController.ts"],"names":[],"mappings":";;;;;;;;;AAAA,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACxC,IAAI,eAAe,GAAG,OAAO,CAAC,+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,CAAC,qBAAqB,CAAC,CAAC,CAAA;SAC/I;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/controller/secondPartController.js b/dist/api/controller/secondPartController.js
new file mode 100644
index 0000000..7bbc6e5
--- /dev/null
+++ b/dist/api/controller/secondPartController.js
@@ -0,0 +1,144 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var util = require('../../modules/util');
+var responseMessage = require('../../modules/responseMessage');
+var statusCode = require('../../modules/statusCode');
+const secondPartService = require('../service/secondPartService');
+module.exports = {
+ getMainPage: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { userId } = req.params;
+ try {
+ const result = yield secondPartService.getMainPage(userId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_MAIN_PAGE, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ getDiaryOfTableContents: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { tableContentsId } = req.params;
+ try {
+ const result = yield secondPartService.getDiaryOfTableContents(tableContentsId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_DIARY_OF_TABLECONTENTS, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ getSecondPartChapterList: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const result = yield secondPartService.getSecondPartChapterList();
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_CHAPTER_LIST, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ addSecondPartChapter: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const chapterData = req.body;
+ try {
+ const result = yield secondPartService.addSecondPartChapter(chapterData);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_SECOND_PART_ADD_CHAPTER, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ modifySecondPartChapterInfo: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { chapterId } = req.params;
+ const modifyChapterData = req.body;
+ try {
+ const result = yield secondPartService.modifySecondPartChapterInfo(chapterId, modifyChapterData);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_SECOND_PART_MODIFY_CHAPTER, result));
+ }
+ catch (err) {
+ console.error(err);
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ deleteSecondPartChapter: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { chapterId } = req.params;
+ try {
+ const result = yield secondPartService.deleteSecondPartChapter(chapterId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_SECOND_PART_DELETE_CHAPTER, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_GET_SECOND_PART_TABLE_CONTENTS));
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ getSecondPartDiary: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { diaryId } = req.params;
+ try {
+ const result = yield secondPartService.getSecondPartDiary(diaryId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_DIARY, result));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_GET_SECOND_PART_DIARY_ID));
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ addSecondPartDiary: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const diaryData = req.body;
+ try {
+ yield secondPartService.addSecondPartDiary(diaryData);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_SECOND_PART_DIARY));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_POST_SECOND_PART_DIARY));
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ modifySecondPartDiary: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { diaryId } = req.params;
+ const diaryData = req.body;
+ try {
+ yield secondPartService.modifySecondPartDiary(diaryId, diaryData);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_SECOND_PART_DIARY));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_PUT_SECOND_PART_DIARY));
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ }),
+ deleteSecondPartDiary: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { diaryId } = req.params;
+ try {
+ yield secondPartService.deleteSecondPartDiary(diaryId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_SECOND_PART_DELETE_DIARY));
+ }
+ catch (err) {
+ console.error(err);
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_DELETE_SECOND_PART_DIARY));
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR));
+ }
+ })
+};
+//# sourceMappingURL=secondPartController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/secondPartController.js.map b/dist/api/controller/secondPartController.js.map
new file mode 100644
index 0000000..29c440c
--- /dev/null
+++ b/dist/api/controller/secondPartController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"secondPartController.js","sourceRoot":"","sources":["../../../src/api/controller/secondPartController.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AACxC,IAAI,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC9D,IAAI,UAAU,GAAG,OAAO,CAA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C,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,eAAe,CAAC,gCAAgC,CAAC,CAAC,CAAA;aACtI;YACD,OAAO,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,EAAE,eAAe,CAAC,qBAAqB,CAAC,CAAC,CAAA;SAC/I;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/controller/userController.js b/dist/api/controller/userController.js
new file mode 100644
index 0000000..8c4c843
--- /dev/null
+++ b/dist/api/controller/userController.js
@@ -0,0 +1,51 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+const userService = require('../service/userService');
+module.exports = {
+ //register user
+ register: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { email, password } = req.body;
+ try {
+ yield userService.register(email, password);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SIGH_UP_SUCCESS));
+ }
+ catch (err) {
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error(err);
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ }),
+ login: (req, res) => __awaiter(void 0, void 0, void 0, function* () {
+ const { email, password } = req.body;
+ try {
+ const result = yield userService.login(email, password);
+ console.log('얘가나오면 안되는데 : ', result);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SIGH_IN_SUCCESS, result));
+ }
+ catch (err) {
+ console.log('bbbbb : ' + err.statusCode);
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error('!!!!!' + err);
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage));
+ }
+ })
+};
+//# sourceMappingURL=userController.js.map
\ No newline at end of file
diff --git a/dist/api/controller/userController.js.map b/dist/api/controller/userController.js.map
new file mode 100644
index 0000000..a2d2de1
--- /dev/null
+++ b/dist/api/controller/userController.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"userController.js","sourceRoot":"","sources":["../../../src/api/controller/userController.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAIrD,MAAM,CAAC,OAAO,GAAG;IACb,eAAe;IACf,QAAQ,EAAE,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;QACzB,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QACrC,IAAI;YACA,MAAM,WAAW,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YAC5C,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,eAAe,CAAC,eAAe,CAAC,CAAC,CAAA;SA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,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,CAAA;SAClF;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/router/calendar/index.js b/dist/api/router/calendar/index.js
new file mode 100644
index 0000000..7099c8b
--- /dev/null
+++ b/dist/api/router/calendar/index.js
@@ -0,0 +1,6 @@
+var express = require('express');
+var router = express.Router();
+const calendarController = require('../../controller/calendarController');
+router.get('/:year/:month/:part', calendarController.getCalendar); //캘린더
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/calendar/index.js.map b/dist/api/router/calendar/index.js.map
new file mode 100644
index 0000000..a594c54
--- /dev/null
+++ b/dist/api/router/calendar/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/calendar/index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAChC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAA;AAEzE,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAC,kBAAkB,CAAC,WAAW,CAAC,CAAA,CAAA,KAAK;AAErE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"}
\ No newline at end of file
diff --git a/dist/api/router/chapter/index.js b/dist/api/router/chapter/index.js
new file mode 100644
index 0000000..3a8a80c
--- /dev/null
+++ b/dist/api/router/chapter/index.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const express = require('express');
+const router = express.Router();
+const chapterController = require('../../controller/chapterController');
+router.get('/pet/:id', chapterController.getChapterDiary); //1부 목차별 일기 조회
+router.get('/:id', chapterController.getChapterList); //목차리스트 조회
+router.post('/:id', chapterController.postChapterList); //목차리스트 추가
+router.put('/:id', chapterController.putChapterList); //목차리스트 수정
+router.delete('/:id', chapterController.deleteChapterList); //목차리스트 삭제
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/chapter/index.js.map b/dist/api/router/chapter/index.js.map
new file mode 100644
index 0000000..e8b54d3
--- /dev/null
+++ b/dist/api/router/chapter/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/chapter/index.ts"],"names":[],"mappings":";;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAA;AAEvE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAC,iBAAiB,CAAC,eAAe,CAAC,CAAA,CAAC,cAAc;AACvE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA,CAAA,UAAU;AAC7D,MAAM,CAAC,IAAI,CAAC,MAAM,EAAC,iBAAiB,CAAC,eAAe,CAAC,CAAA,CAAA,UAAU;AAC/D,MAAM,CAAC,GAAG,CAAC,MAAM,EAAC,iBAAiB,CAAC,cAAc,CAAC,CAAA,CAAA,UAAU;AAC7D,MAAM,CAAC,MAAM,CAAC,MAAM,EAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA,CAAA,UAAU;AACnE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/router/diary/index.js b/dist/api/router/diary/index.js
new file mode 100644
index 0000000..b1a8419
--- /dev/null
+++ b/dist/api/router/diary/index.js
@@ -0,0 +1,12 @@
+var express = require('express');
+var router = express.Router();
+var diaryController = require('../../controller/diaryController');
+var upload = require('../../../modules/multer');
+router.post('/prologue/:userId', diaryController.postPrologue); //1부 프롤로그 작성
+router.post('/pet', diaryController.postPetDiary); //반려동물 일기 작성
+router.get('/pet/:id', diaryController.getPetDiary); //반려동물 일기 상세 조회
+router.put('/pet/:id', diaryController.putPetDiary); //반려동물 일기 수정
+router.delete('/pet/:id', diaryController.deletePetDiary); //반려동물 일기 삭제
+router.post('/pet/withImage', upload.array('images', 5), diaryController.postPetDiaryWithImage);
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/diary/index.js.map b/dist/api/router/diary/index.js.map
new file mode 100644
index 0000000..684d5b4
--- /dev/null
+++ b/dist/api/router/diary/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/diary/index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAChC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC7B,IAAI,eAAe,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAA;AACjE,IAAI,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAE/C,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAC,eAAe,CAAC,YAAY,CAAC,CAAA,CAAC,YAAY;AAC1E,MAAM,CAAC,IAAI,CAAC,MAAM,EAAC,eAAe,CAAC,YAAY,CAAC,CAAA,CAAA,YAAY;AAC5D,MAAM,CAAC,GAAG,CAAC,UAAU,EAAC,eAAe,CAAC,WAAW,CAAC,CAAA,CAAA,eAAe;AACjE,MAAM,CAAC,GAAG,CAAC,UAAU,EAAC,eAAe,CAAC,WAAW,CAAC,CAAA,CAAA,YAAY;AAC9D,MAAM,CAAC,MAAM,CAAC,UAAU,EAAC,eAAe,CAAC,cAAc,CAAC,CAAA,CAAA,YAAY;AACpE,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAC,CAAC,CAAC,EAAC,eAAe,CAAC,qBAAqB,CAAC,CAAA;AAC5F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/router/firstPart/index.js b/dist/api/router/firstPart/index.js
new file mode 100644
index 0000000..d49ccff
--- /dev/null
+++ b/dist/api/router/firstPart/index.js
@@ -0,0 +1,12 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const express_1 = __importDefault(require("express"));
+const router = express_1.default.Router();
+const firstPartController = require('../../controller/firstPartController');
+//1부 메인페이지 불러오기
+router.get('/main/:userId', firstPartController.mainPage);
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/firstPart/index.js.map b/dist/api/router/firstPart/index.js.map
new file mode 100644
index 0000000..6b128ac
--- /dev/null
+++ b/dist/api/router/firstPart/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/firstPart/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAA;AAC/B,MAAM,mBAAmB,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAA;AAE3E,eAAe;AACf,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAA;AAEzD,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/router/index.js b/dist/api/router/index.js
new file mode 100644
index 0000000..0bd8994
--- /dev/null
+++ b/dist/api/router/index.js
@@ -0,0 +1,17 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const express_1 = __importDefault(require("express"));
+var router = express_1.default.Router();
+router.use('/user', require('./user')); //user
+router.use('/pet', require('./pet')); //pet
+router.use('/chapter', require('./chapter')); //1부 목차
+router.use('/diary', require('./diary')); //1부 일기
+router.use('/rainbow', require('./rainbow')); //무지개
+router.use('/calendar', require('./calendar')); //캘린더
+router.use('/firstPart', require('./firstPart')); //1부
+router.use('/secondPart', require('./secondPart')); //2부
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/index.js.map b/dist/api/router/index.js.map
new file mode 100644
index 0000000..eb34018
--- /dev/null
+++ b/dist/api/router/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/router/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA6B;AAC7B,IAAI,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;AAE9B,MAAM,CAAC,GAAG,CAAC,OAAO,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA,CAAA,MAAM;AAC3C,MAAM,CAAC,GAAG,CAAC,MAAM,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA,CAAA,KAAK;AACxC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA,OAAO;AACnD,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA,OAAO;AAC/C,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAA,CAAC,KAAK;AAClD,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA,CAAC,KAAK;AACpD,MAAM,CAAC,GAAG,CAAC,YAAY,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAA,CAAC,IAAI;AACpD,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA,CAAA,IAAI;AAEtD,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/router/pet/index.js b/dist/api/router/pet/index.js
new file mode 100644
index 0000000..84c2cc6
--- /dev/null
+++ b/dist/api/router/pet/index.js
@@ -0,0 +1,10 @@
+var express = require('express');
+var router = express.Router();
+var petController = require('../../controller/petController');
+var upload = require('../../../modules/multer');
+router.get('/register/petInfo', petController.getRegisterPetInfo);
+//router.post('/register',upload.array('images',5),petController.registerPet) //register pet
+router.post('/register', petController.registerPet);
+//router.post('/register/images',upload.array('images',4),petController.registerPetImg)
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/pet/index.js.map b/dist/api/router/pet/index.js.map
new file mode 100644
index 0000000..1d9decc
--- /dev/null
+++ b/dist/api/router/pet/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/pet/index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAChC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC7B,IAAI,aAAa,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAA;AAC7D,IAAI,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;AAE/C,MAAM,CAAC,GAAG,CAAC,mBAAmB,EAAC,aAAa,CAAC,kBAAkB,CAAC,CAAA;AAChE,4FAA4F;AAC5F,MAAM,CAAC,IAAI,CAAC,WAAW,EAAC,aAAa,CAAC,WAAW,CAAC,CAAA;AAClD,uFAAuF;AACvF,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/router/rainbow/index.js b/dist/api/router/rainbow/index.js
new file mode 100644
index 0000000..33e4897
--- /dev/null
+++ b/dist/api/router/rainbow/index.js
@@ -0,0 +1,15 @@
+var express = require('express');
+var router = express.Router();
+let rainbowController = require('../../controller/rainbowController');
+router.get('/main/:userId/:petId', rainbowController.mainPage); //1.5부 무지개 홈 화면 불러오기
+router.get('/pet', rainbowController.selectRainbowPet); //1.5부 무지개 반려동물 선택 화면 불러오기
+router.put('/pet/:petId', rainbowController.setRainbowPet); //1.5부 무지개 반려동물 선택 적용 & 이별하는 무지개 다리 멘트
+router.delete('/pet/:petId', rainbowController.cancelPartingPet); //1.5부 무지개 반려동물 떠나보내기 취소
+router.get('/record/:petId', rainbowController.getReadyPartingPetComment); //1.5부 이별을 준비하는 작가의 기록 시작 멘트 불러오기
+router.get('/moment/:userId/:petId', rainbowController.theBestMoment); //1.5부 무지개 최고의 순간
+router.get('/parting/pet/:petId', rainbowController.getPartingPetName); //1.5부 반려동물 이름 반환
+router.post('/epilogue/:userId/:petId', rainbowController.postEpilogue); //1.5부 작가의 말 작성
+router.get('/moment/sub/:userId/:petId', rainbowController.theBestMomentSub); //1.5부 무지개 서브 홈
+module.exports = router;
+//solve error TS2451 : Cannot redeclare block-scoped variable
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/rainbow/index.js.map b/dist/api/router/rainbow/index.js.map
new file mode 100644
index 0000000..2b65121
--- /dev/null
+++ b/dist/api/router/rainbow/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/rainbow/index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAChC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC7B,IAAI,iBAAiB,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAA;AAErE,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA,CAAC,oBAAoB;AAClF,MAAM,CAAC,GAAG,CAAC,MAAM,EAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA,CAAG,0BAA0B;AAClF,MAAM,CAAC,GAAG,CAAC,aAAa,EAAC,iBAAiB,CAAC,aAAa,CAAC,CAAA,CAAG,sCAAsC;AAClG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA,CAAC,wBAAwB;AACxF,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAC,iBAAiB,CAAC,yBAAyB,CAAC,CAAA,CAAI,iCAAiC;AAC7G,MAAM,CAAC,GAAG,CAAC,wBAAwB,EAAC,iBAAiB,CAAC,aAAa,CAAC,CAAA,CAAI,iBAAiB;AACzF,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA,CAAG,iBAAiB;AACzF,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAC,iBAAiB,CAAC,YAAY,CAAC,CAAA,CAAE,eAAe;AACvF,MAAM,CAAC,GAAG,CAAC,4BAA4B,EAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAA,CAAC,eAAe;AAE3F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;AACxB,6DAA6D"}
\ No newline at end of file
diff --git a/dist/api/router/secondPart/index.js b/dist/api/router/secondPart/index.js
new file mode 100644
index 0000000..b23112a
--- /dev/null
+++ b/dist/api/router/secondPart/index.js
@@ -0,0 +1,15 @@
+var express = require('express');
+var router = express.Router();
+const secondPartController = require('../../controller/secondPartController');
+router.get('/main/:userId', secondPartController.getMainPage);
+router.get('/chapter/user/:tableContentsId', secondPartController.getDiaryOfTableContents);
+router.get('/chapter/list', secondPartController.getSecondPartChapterList);
+router.post('/chapter', secondPartController.addSecondPartChapter);
+router.put('/chapter/:chapterId', secondPartController.modifySecondPartChapterInfo);
+router.delete('/chapter/:chapterId', secondPartController.deleteSecondPartChapter);
+router.get('/diary/user/:diaryId', secondPartController.getSecondPartDiary); //2부 일기 조회
+router.post('/diary/user', secondPartController.addSecondPartDiary); //2부 일기 작성
+router.put('/diary/user/:diaryId', secondPartController.modifySecondPartDiary); //2부 일기 수정
+router.delete('/diary/user/:diaryId', secondPartController.deleteSecondPartDiary); //2부 일기 삭제
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/secondPart/index.js.map b/dist/api/router/secondPart/index.js.map
new file mode 100644
index 0000000..5574bdb
--- /dev/null
+++ b/dist/api/router/secondPart/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/secondPart/index.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAChC,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC7B,MAAM,oBAAoB,GAAG,OAAO,CAAC,uCAAuC,CAAC,CAAA;AAE7E,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAA;AAC7D,MAAM,CAAC,GAAG,CAAC,gCAAgC,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAA;AAC1F,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,CAAA;AAC1E,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;AAClE,MAAM,CAAC,GAAG,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,2BAA2B,CAAC,CAAA;AACnF,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,uBAAuB,CAAC,CAAA;AAClF,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAA,CAAA,UAAU;AACpF,MAAM,CAAC,IAAI,CAAC,aAAa,EAAC,oBAAoB,CAAC,kBAAkB,CAAC,CAAA,CAAA,UAAU;AAC5E,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAA,CAAA,UAAU;AACvF,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAA,CAAA,UAAU;AAC1F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAA"}
\ No newline at end of file
diff --git a/dist/api/router/user/index.js b/dist/api/router/user/index.js
new file mode 100644
index 0000000..ca21112
--- /dev/null
+++ b/dist/api/router/user/index.js
@@ -0,0 +1,9 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const express = require('express');
+const router = express.Router();
+const userController = require('../../controller/userController');
+router.post('/register/', userController.register); //user register
+router.post('/login', userController.login); //user login
+module.exports = router;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/api/router/user/index.js.map b/dist/api/router/user/index.js.map
new file mode 100644
index 0000000..c2afcf4
--- /dev/null
+++ b/dist/api/router/user/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/router/user/index.ts"],"names":[],"mappings":";;AAAA,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;AAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAGjE,MAAM,CAAC,IAAI,CAAC,YAAY,EAAC,cAAc,CAAC,QAAQ,CAAC,CAAA,CAAC,eAAe;AACjE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAC,cAAc,CAAC,KAAK,CAAC,CAAA,CAAC,YAAY;AAEvD,MAAM,CAAC,OAAO,GAAC,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/api/service/calendarService.js b/dist/api/service/calendarService.js
new file mode 100644
index 0000000..0966d36
--- /dev/null
+++ b/dist/api/service/calendarService.js
@@ -0,0 +1,87 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const PetDiary_1 = __importDefault(require("../../models/diary/PetDiary"));
+const UserDiary_1 = __importDefault(require("../../models/diary/UserDiary"));
+const calendarResDto_1 = require("../../dto/calendar/calendarResDto");
+const User_1 = __importDefault(require("../../models/user/User"));
+const dateMethod = require("../../modules/dateMethod");
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/tableContents/SecondPartTableContent');
+require('../../models/diary/PetDiary');
+require('../../models/diary/UserDiary');
+require('../../models/diary/PetEmotions');
+require('../../models/book/Book');
+module.exports = {
+ getDiaryPerDate: (year, month, part) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const user = (yield User_1.default.find().populate({ path: "book" }))[0];
+ const author = user.book.author;
+ const calendarResDto = new calendarResDto_1.CalendarResDto(author, part);
+ if (part == 1) {
+ const calendarDiary = yield PetDiary_1.default.find({
+ date: {
+ $gte: new Date(year, month - 1, 1),
+ $lt: new Date(year, month, 1)
+ }
+ }).populate({
+ path: "petEmotions pets",
+ });
+ console.log('calendarDiary : ' + calendarDiary);
+ const thisMonthLength = yield dateMethod.getLastDateOfMonth(year, month);
+ const calendarInfoResDto = new calendarResDto_1.CalendarInfoResDto(year, month);
+ for (let i = 0; i < thisMonthLength; i++) {
+ const diariesPerMonth = calendarDiary.filter(diary => diary.date.getDate() == i);
+ if (diariesPerMonth.length < 1) {
+ calendarInfoResDto.setDate(null);
+ }
+ else {
+ calendarInfoResDto.setDate(new calendarResDto_1.CalendarDatePetDto(i + 1, diariesPerMonth));
+ }
+ //CalendarDiary에 각 일에 해당하는 일기를 만들어서 넣어주면된다
+ }
+ calendarResDto.setCalendar(calendarInfoResDto);
+ }
+ else if (part == 2) {
+ const calendarDiary = yield UserDiary_1.default.find({
+ date: {
+ $gte: new Date(year, month - 1, 1),
+ $lt: new Date(year, month, 1)
+ }
+ }).populate({
+ path: "petEmotions pets"
+ });
+ console.log('calendarDiary : ' + calendarDiary);
+ const thisMonthLength = yield dateMethod.getLastDateOfMonth(year, month);
+ const calendarInfoResDto = new calendarResDto_1.CalendarInfoResDto(year, month);
+ for (let i = 0; i < thisMonthLength; i++) {
+ const diariesPerMonth = calendarDiary.filter(diary => diary.date.getDate() == i);
+ if (diariesPerMonth.length < 1) {
+ calendarInfoResDto.setDate(null);
+ }
+ else {
+ calendarInfoResDto.setDate(new calendarResDto_1.CalendarDateUserDto(i + 1, diariesPerMonth, user));
+ }
+ //CalendarDiary에 각 일에 해당하는 일기를 만들어서 넣어주면된다
+ }
+ calendarResDto.setCalendar(calendarInfoResDto);
+ }
+ return calendarResDto;
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+};
+//# sourceMappingURL=calendarService.js.map
\ No newline at end of file
diff --git a/dist/api/service/calendarService.js.map b/dist/api/service/calendarService.js.map
new file mode 100644
index 0000000..a516645
--- /dev/null
+++ b/dist/api/service/calendarService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"calendarService.js","sourceRoot":"","sources":["../../../src/api/service/calendarService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,2EAAkD;AAClD,6EAAoD;AACpD,sEAA+H;AAC/H,kEAAyC;AAEzC,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,OAAO,CAAC,6BAA6B,CAAC,CAAA;AACtC,OAAO,CAAC,8BAA8B,CAAC,CAAA;AACvC,OA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AI,CAAC,CAAA;qBACnC;yBAAI;wBACD,kBAAkB,CAAC,OAAO,CAAC,IAAI,oCAAmB,CAAC,CAAC,GAAC,CAAC,EAAC,eAAe,EAAC,IAAI,CAAC,CAAC,CAAA;qBAChF;oBACD,0CAA0C;iBAC7C;gBACD,cAAc,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAA;aACjD;YACD,OAAO,cAAc,CAAA;SACxB;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/chapterService.js b/dist/api/service/chapterService.js
new file mode 100644
index 0000000..669a3b7
--- /dev/null
+++ b/dist/api/service/chapterService.js
@@ -0,0 +1,172 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const TableContents_1 = __importDefault(require("../../models/tableContents/TableContents"));
+const FirstPartTableContents_1 = __importDefault(require("../../models/tableContents/FirstPartTableContents"));
+const PetChapterDiary_1 = require("../../dto/petChapter/PetChapterDiary");
+const User_1 = __importDefault(require("../../models/user/User"));
+const ChapterList_1 = require("../../dto/petChapter/ChapterList");
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/diary/PetDiary');
+require('../../models/diary/PetEmotions');
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+module.exports = {
+ getChapterDiary: (chapterId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ //챕터 id로 1부 목차
+ const findFirstTableContents = yield FirstPartTableContents_1.default.findById(chapterId).populate({ path: "petDiary", populate: ({ path: "petEmotions pets" }) });
+ //.populate({path:"petDiary",populate:({path:"petEmotions"})})
+ console.log('!!!! : ' + findFirstTableContents);
+ let newChapterDiary = new PetChapterDiary_1.PetChapterDiaryResDto(findFirstTableContents);
+ console.log("newchapterDiary", newChapterDiary);
+ //월별로 자르기
+ for (let m = 12; m > 0; m--) {
+ let cnt = 0;
+ //1화부터
+ let monthly = new PetChapterDiary_1.MonthlyDiaryResDto();
+ for (let i = findFirstTableContents.petDiary.length - 1; i >= 0; i--) {
+ console.log(findFirstTableContents.petDiary[i].date.getMonth());
+ if (m == findFirstTableContents.petDiary[i].date.getMonth() + 1) {
+ cnt++;
+ console.log("month", m, findFirstTableContents.petDiary[i]);
+ let newDiary = new PetChapterDiary_1.DiariesResDto(findFirstTableContents.petDiary[i]); //diary
+ monthly.setDiaries(newDiary);
+ console.log("출력 다이어리 : ", newDiary);
+ //console.log(findFirstTableContents.petDiary[i].petEmotions[0].feeling)
+ }
+ }
+ if (cnt == 0)
+ continue;
+ monthly.setMonthCount(cnt);
+ monthly.setMonth(m);
+ newChapterDiary.setMonthly(monthly);
+ }
+ console.log(newChapterDiary);
+ return newChapterDiary;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY };
+ }
+ }),
+ getChapterList: (userId) => __awaiter(void 0, void 0, void 0, function* () {
+ const findUserChapter = yield User_1.default.findById(userId).populate({ path: "book", populate: ({ path: "tableContents", populate: ({ path: "firstPartTableContents" }) }) });
+ let chapterList = new ChapterList_1.ChapterListResDto();
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ let newChapter = new ChapterList_1.ChapterResDto(new FirstPartTableContents_1.default(findUserChapter.book.tableContents.firstPartTableContents[i]));
+ chapterList.setChapterList(newChapter);
+ }
+ console.log(chapterList);
+ return chapterList;
+ }),
+ postChapterList: (userId, chapterTitle) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findUserChapter = yield User_1.default.findById(userId).populate({ path: "book", populate: ({ path: "tableContents", populate: ({ path: "firstPartTableContents" }) }) });
+ const newFirstPartTable = new FirstPartTableContents_1.default(); //chapter,title
+ console.log(findUserChapter);
+ console.log(chapterTitle);
+ let max = 0;
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ if (max < findUserChapter.book.tableContents.firstPartTableContents[i].chapter) {
+ max = Number(findUserChapter.book.tableContents.firstPartTableContents[i].chapter);
+ }
+ }
+ newFirstPartTable.chapter = max + 1;
+ newFirstPartTable.title = chapterTitle;
+ yield newFirstPartTable.save();
+ findUserChapter.book.tableContents.firstPartTableContents.push(newFirstPartTable);
+ let newTableContents = new TableContents_1.default(findUserChapter.book.tableContents);
+ yield newTableContents.save();
+ console.log(newTableContents);
+ let chapterList = new ChapterList_1.ChapterListResDto();
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ let newChapter = new ChapterList_1.ChapterResDto(new FirstPartTableContents_1.default(findUserChapter.book.tableContents.firstPartTableContents[i]));
+ chapterList.setChapterList(newChapter);
+ }
+ console.log(chapterList);
+ return chapterList;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS };
+ }
+ }),
+ putChapterList: (chapterId, chapterTitle) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findChapter = yield FirstPartTableContents_1.default.findById(chapterId);
+ findChapter.title = chapterTitle;
+ const editFirstPartTableContents = new FirstPartTableContents_1.default(findChapter);
+ yield editFirstPartTableContents.save();
+ console.log(editFirstPartTableContents);
+ let chapterList = new ChapterList_1.ChapterListResDto();
+ let tableContents = yield TableContents_1.default.find({}).populate('firstPartTableContents');
+ for (let i = 0; i < tableContents[0].firstPartTableContents.length; i++) {
+ let newChapter = new ChapterList_1.ChapterResDto(new FirstPartTableContents_1.default(tableContents[0].firstPartTableContents[i]));
+ chapterList.setChapterList(newChapter);
+ }
+ // console.log(chapterList)
+ return chapterList;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS };
+ }
+ }),
+ deleteChapterList: (chapterId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ let findChapter = yield FirstPartTableContents_1.default.findById(chapterId);
+ const curChapter = findChapter.chapter;
+ const allFirstTableContents = yield FirstPartTableContents_1.default.find({});
+ let updateFTC = new FirstPartTableContents_1.default();
+ //해당 목차보다 큰 목차 -=1
+ for (let i = 0; i < allFirstTableContents.length; i++) {
+ if (allFirstTableContents[i].chapter > curChapter) {
+ allFirstTableContents[i].chapter = Number(allFirstTableContents[i].chapter) - 1;
+ }
+ //db save
+ updateFTC = allFirstTableContents[i];
+ yield updateFTC.save();
+ }
+ console.log(allFirstTableContents);
+ //해당 목차 삭제
+ yield FirstPartTableContents_1.default.deleteOne({ _id: chapterId });
+ const tableContents = (yield TableContents_1.default.find())[0];
+ for (let j = 0; j < tableContents.firstPartTableContents.length; j++) {
+ if (tableContents.firstPartTableContents[j] == chapterId) {
+ tableContents.firstPartTableContents.splice(j, 1);
+ }
+ }
+ yield tableContents.save();
+ let chapterList = new ChapterList_1.ChapterListResDto();
+ let allTableContents = yield TableContents_1.default.find({}).populate('firstPartTableContents');
+ for (let i = 0; i < allTableContents[0].firstPartTableContents.length; i++) {
+ let newChapter = new ChapterList_1.ChapterResDto(new FirstPartTableContents_1.default(allTableContents[0].firstPartTableContents[i]));
+ chapterList.setChapterList(newChapter);
+ }
+ console.log(chapterList);
+ return chapterList;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS };
+ }
+ })
+};
+//# sourceMappingURL=chapterService.js.map
\ No newline at end of file
diff --git a/dist/api/service/chapterService.js.map b/dist/api/service/chapterService.js.map
new file mode 100644
index 0000000..eebd564
--- /dev/null
+++ b/dist/api/service/chapterService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"chapterService.js","sourceRoot":"","sources":["../../../src/api/service/chapterService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,6FAAoE;AACpE,+GAAsF;AAKtF,0EAA+G;AAC/G,kEAAyC;AACzC,kEAAmF;AACnF,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,OAAO,CAAC,6BAA6B,CAAC,CAAA;AACtC,OAAO,CAAC,gCAAgC,CAAC,CAAA;AACzC,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAM,CAAC,OAAO,GAAG;IACb,eAAe,EAAE,CAAO,SAAS,EAAE,EAAE;QACjC,IAAI;YACA,cAAc;YAEd,MAAM,sBAAsB,GAAG,MAAM,gCAAsB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC;YACzJ,8DAA8D;YAC9D,OAAO,CAAC,GAAG,CAAC,SAAS,GAAC,sBAAsB,CAAC,CAAA;YAC7C,IAAI,eAAe,GAAG,IA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dist/api/service/diaryService.js b/dist/api/service/diaryService.js
new file mode 100644
index 0000000..1d3c2ba
--- /dev/null
+++ b/dist/api/service/diaryService.js
@@ -0,0 +1,267 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const User_1 = __importDefault(require("../../models/user/User"));
+const TableContents_1 = __importDefault(require("../../models/tableContents/TableContents"));
+const FirstPartTableContents_1 = __importDefault(require("../../models/tableContents/FirstPartTableContents"));
+const Pet_1 = __importDefault(require("../../models/pet/Pet"));
+const PetDiary_1 = __importDefault(require("../../models/diary/PetDiary"));
+const PetEmotions_1 = __importDefault(require("../../models/diary/PetEmotions"));
+const PetDiaryPageResDto_1 = require("../../dto/petDiary/PetDiaryPageResDto");
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/diary/PetDiary');
+require('../../models/diary/PetEmotions');
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+module.exports = {
+ postPrologue: (userId, bookData) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ console.log(userId);
+ //Create user object
+ const user = yield User_1.default.findById(userId).populate('book');
+ console.log('user : ' + user);
+ console.log('userBook : ' + user.book);
+ if (user.book.title != null) {
+ throw { statusCode: 404, responseMessage: "이미 책이 존재합니다, 없던일로 하겠습니다. 휴먼" };
+ }
+ const setBook = user.book;
+ setBook.title = bookData.title,
+ setBook.imgs = "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ setBook.author = bookData.userName;
+ //Create tableContents object
+ const tableContents = new TableContents_1.default();
+ setBook.tableContents = tableContents;
+ yield tableContents.save();
+ yield user.save();
+ yield setBook.save();
+ //Create firstPartTableContents object
+ const firstPartPrologue = new FirstPartTableContents_1.default({
+ chapter: 0,
+ title: bookData.title,
+ contents: bookData.contents
+ });
+ yield firstPartPrologue.save();
+ console.log(tableContents);
+ yield tableContents.firstPartTableContents.push(firstPartPrologue);
+ let chapter = 1;
+ const season = ["봄", "여름", "가을", "겨울"];
+ for (let i = 0; i < 4; i++) {
+ const dummyFirstPartTableContents = new FirstPartTableContents_1.default({
+ chapter,
+ title: `${user.book.author}의 ${season[i]}`
+ });
+ yield dummyFirstPartTableContents.save();
+ tableContents.firstPartTableContents.push(dummyFirstPartTableContents);
+ chapter = chapter + 1;
+ }
+ //add dummy Diary
+ let newPetDiary = new PetDiary_1.default({
+ tableContents: tableContents.firstPartTableContents[1],
+ episode: tableContents.firstPartTableContents[1].petDiary.length,
+ //date: Date(),
+ //imgs: diaryImages,
+ title: "행복한 나날들",
+ contents: "반려동물과의 일상을 생생하게 기록해보세요"
+ });
+ newPetDiary.setPet(user.pets[0]);
+ const petEmotion = new PetEmotions_1.default({
+ pet: user.pets[0]._id,
+ feeling: 3
+ });
+ newPetDiary.setPetEmotions(petEmotion);
+ tableContents.firstPartTableContents[1].petDiary.push(newPetDiary);
+ yield petEmotion.save();
+ yield newPetDiary.save();
+ yield tableContents.firstPartTableContents[1].save();
+ yield tableContents.save();
+ return user.book._id;
+ //error handling
+ }
+ catch (err) {
+ console.log(err);
+ throw err;
+ }
+ }),
+ postPetDiary: (diaryData) => __awaiter(void 0, void 0, void 0, function* () {
+ const writeDate = yield new Date(diaryData.date);
+ writeDate.setDate(writeDate.getDate() + 1);
+ // console.log(FirstPartTableContents.findById(diaryData._id))
+ const temp = yield FirstPartTableContents_1.default.findById(diaryData._id).populate('petDiary');
+ //console.log("temp:",temp,"end")
+ let newPetDiary = new PetDiary_1.default({
+ tableContents: diaryData._id,
+ episode: temp.petDiary.length,
+ date: writeDate,
+ imgs: "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ title: diaryData.title,
+ contents: diaryData.contents
+ });
+ try {
+ //save petinfo
+ let petN = diaryData.character.length;
+ for (let i = 0; i < petN; i++) {
+ const petData = yield Pet_1.default.findById(diaryData.character[i]._id).populate('_id');
+ newPetDiary.setPet(petData);
+ //save emotions
+ const petEmotion = new PetEmotions_1.default({
+ pet: diaryData.character[i]._id,
+ feeling: diaryData.character[i].feeling
+ });
+ newPetDiary.setPetEmotions(petEmotion);
+ yield petEmotion.save();
+ }
+ console.log(newPetDiary);
+ yield newPetDiary.save();
+ yield temp.setPetDiary(newPetDiary); //db관련은 await 붙이기(setter,save...)
+ yield temp.save();
+ console.log(temp._id);
+ return responseMessage.SUCCESS_POST_PETDIARY;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY };
+ }
+ }),
+ getPetDiary: (petDiaryId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findPetDiary = yield PetDiary_1.default.findById(petDiaryId).populate('pets').populate('tableContents').populate('petEmotions');
+ let petDiaryPageResDto = yield new PetDiaryPageResDto_1.PetDiaryPageResDto(findPetDiary); //이부분
+ // console.log("feelingList",findPetDiary.pets[0],";",findPetDiary.petEmotions[0].feeling)
+ for (let i = 0; i < findPetDiary.petEmotions.length; i++) {
+ let feelingList = new PetDiaryPageResDto_1.FeelingListDto(findPetDiary.pets[i]);
+ feelingList.setFeeling(findPetDiary.petEmotions[i]);
+ petDiaryPageResDto.setFeelingList(feelingList);
+ }
+ return petDiaryPageResDto;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY };
+ }
+ }),
+ putPetDiary: (petDiaryId, diaryData) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ let findPetDiary = yield PetDiary_1.default.findById(petDiaryId);
+ findPetDiary.tableContents = findPetDiary.tableContents;
+ findPetDiary.episode = findPetDiary.episode;
+ findPetDiary.date = findPetDiary.date;
+ findPetDiary.imgs = diaryData.diaryImages;
+ findPetDiary.title = diaryData.title;
+ findPetDiary.contents = diaryData.contents;
+ //save petinfo
+ let petN = diaryData.character.length;
+ for (let i = 0; i < petN; i++) {
+ const petData = yield Pet_1.default.findById(diaryData.character[i]._id).populate('_id');
+ findPetDiary.setPet(petData);
+ //save emotions
+ let emotion = new PetEmotions_1.default();
+ emotion.pet = diaryData.character[i]._id;
+ emotion.feeling = diaryData.character[i].feeling;
+ emotion.setPetDiary(findPetDiary);
+ yield emotion.save();
+ }
+ yield findPetDiary.save();
+ return responseMessage.SUCCESS_EDIT_PETDIARY;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY };
+ }
+ }),
+ deletePetDiary: (petDiaryId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ let findPetDiary = yield PetDiary_1.default.findById(petDiaryId).populate('tableContents').populate('petEmotions');
+ console.log('!!!!! : ' + findPetDiary);
+ //화 정렬 순서 맞추기
+ //해당 목차인것들 모두 가져오기. findPetDiary의 idx 뒤로 다 -1
+ // let allDiaries=await (PetDiary.find({}).populate('tableContents'))
+ let thisDiariesTableContent = findPetDiary.tableContents;
+ for (let j = 0; j < thisDiariesTableContent.petDiary.length; j++) {
+ if (thisDiariesTableContent.petDiary[j]._id == petDiaryId) {
+ thisDiariesTableContent.petDiary.splice(j, 1);
+ }
+ }
+ let petDiaries = (yield FirstPartTableContents_1.default.findOne({ chapter: { $eq: findPetDiary.tableContents.chapter } })).petDiary;
+ for (let i = 0; i < petDiaries.length; i++) {
+ let temp = yield PetDiary_1.default.findById(petDiaries[i]);
+ if (findPetDiary.episode <= temp.episode) {
+ temp.episode = Number(temp.episode) - 1;
+ yield temp.save();
+ }
+ }
+ findPetDiary.petEmotions.forEach((petEmotion) => __awaiter(void 0, void 0, void 0, function* () {
+ yield PetEmotions_1.default.deleteOne({ _id: petEmotion._id });
+ }));
+ yield PetDiary_1.default.deleteOne({ _id: findPetDiary });
+ yield thisDiariesTableContent.save();
+ console.log(findPetDiary);
+ return responseMessage.SUCCESS_DELETE_PETDIARY;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY };
+ }
+ }),
+ postPetDiaryWithImage: (images, diaryInfo) => __awaiter(void 0, void 0, void 0, function* () {
+ const petInfo = JSON.parse(JSON.stringify(diaryInfo.character)).character;
+ console.log('test2 : ' + JSON.parse(petInfo));
+ console.log('test ! : ' + JSON.parse(JSON.stringify(petInfo)));
+ console.log('images : ' + images);
+ console.log('diaryInfo : ' + petInfo);
+ console.log('diaryInfo : ' + typeof (petInfo));
+ console.log('diaryInfo length : ' + petInfo.length);
+ try {
+ console.log('title : ' + diaryInfo.title);
+ console.log('content : ' + diaryInfo.contents);
+ console.log('date : ' + diaryInfo.date);
+ console.log('tableContents_id : ' + diaryInfo._id);
+ const writeDate = yield new Date(diaryInfo.date);
+ writeDate.setDate(writeDate.getDate() + 1);
+ const firstTableContents = yield FirstPartTableContents_1.default.findById(diaryInfo._id).populate('petDiary');
+ const episode = firstTableContents.petDiary.length;
+ let newDiary = new PetDiary_1.default({
+ title: diaryInfo.title,
+ contents: diaryInfo.contents,
+ imgs: images,
+ episode,
+ date: writeDate
+ }); //set petEmotions, pets, tableContents
+ firstTableContents.setPetDiary(newDiary);
+ //petEmotion 생성 &
+ petInfo.forEach((info) => __awaiter(void 0, void 0, void 0, function* () {
+ //const perPet = await Pet.findById(info._id)
+ let newEmotion = new PetEmotions_1.default({
+ pet: info._id,
+ feeling: info.feeling
+ }); //set petDiary
+ newEmotion.setPetDiary(newDiary);
+ newDiary.setPet(info._id);
+ newDiary.setPetEmotions(newEmotion);
+ yield newEmotion.save();
+ }));
+ newDiary.setTableContents(firstTableContents);
+ yield firstTableContents.save();
+ yield newDiary.save();
+ }
+ catch (err) {
+ throw err;
+ }
+ })
+};
+//# sourceMappingURL=diaryService.js.map
\ No newline at end of file
diff --git a/dist/api/service/diaryService.js.map b/dist/api/service/diaryService.js.map
new file mode 100644
index 0000000..4a78528
--- /dev/null
+++ b/dist/api/service/diaryService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"diaryService.js","sourceRoot":"","sources":["../../../src/api/service/diaryService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kEAAyC;AAEzC,6FAAoE;AACpE,+GAAsF;AACtF,+DAAsC;AACtC,2EAAkD;AAClD,iFAAwD;AACxD,8EAA0F;AAC1F,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,OAAO,CAAC,6BAA6B,CAAC,CAAA;AACtC,OAAO,CAAC,gCAAgC,CAAC,CAAA;AACzC,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAM,CAAC,OAAO,GAAG;IACb,YAAY,EAAE,CAAO,MAAM,EAAE,QAAQ,EAAE,EAAE;QACrC,IAAI;YACA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;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,gCAAsB,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;YACpG,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAA;YAElD,IAAI,QAAQ,GAAG,IAAI,kBAAQ,CAAC;gBACxB,KAAK,EAAG,SAAS,CAAC,KAAK;gBACvB,QAAQ,EAAG,SAAS,CAAC,QAAQ;gBAC7B,IAAI,EAAG,MAAM;gBACb,OAAO;gBACP,IAAI,EAAG,SAAS;aACnB,CAAC,CAAA,CAAA,sCAAsC;YACxC,kBAAkB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;YAExC,kBAAkB;YAClB,OAAO,CAAC,OAAO,CAAC,CAAM,IAAI,EAAC,EAAE;gBACzB,6CAA6C;gBAC7C,IAAI,UAAU,GAAG,IAAI,qBAAW,CAAC;oBAC7B,GAAG,EAAG,IAAI,CAAC,GAAG;oBACd,OAAO,EAAG,IAAI,CAAC,OAAO;iBACzB,CAAC,CAAA,CAAA,cAAc;gBAChB,UAAU,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;gBAChC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACzB,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAA;gBAEnC,MAAM,UAAU,CAAC,IAAI,EAAE,CAAA;YAC3B,CAAC,CAAA,CAAC,CAAA;YACF,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAA;YAE7C,MAAM,kBAAkB,CAAC,IAAI,EAAE,CAAA;YAC/B,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;SAExB;QAAA,OAAM,GAAG,EAAC;YACP,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/firstPartService.js b/dist/api/service/firstPartService.js
new file mode 100644
index 0000000..bc745ec
--- /dev/null
+++ b/dist/api/service/firstPartService.js
@@ -0,0 +1,105 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const User_1 = __importDefault(require("../../models/user/User"));
+const FirstPartMainPageResDto_1 = require("../../dto/firstPart/mainPageDto/FirstPartMainPageResDto");
+const dateMethod = require("../../modules/dateMethod");
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+const Book_1 = __importDefault(require("../../models/book/Book"));
+const TableContents_1 = __importDefault(require("../../models/tableContents/TableContents"));
+const FirstPartTableContents_1 = __importDefault(require("../../models/tableContents/FirstPartTableContents"));
+const PetDiary_1 = __importDefault(require("../../models/diary/PetDiary"));
+require("../../models/user/User");
+require("../../models/pet/Pet");
+require("../../models/book/Book");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/diary/PetDiary');
+require('../../models/diary/PetEmotions');
+require('../../models/diary/UserDiary');
+module.exports = {
+ getMainPage: (userId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ //find userData
+ const findUser = yield User_1.default.findById(userId).populate({
+ path: "pets"
+ }).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "firstPartTableContents",
+ populate: ({
+ path: "petDiary",
+ populate: ({
+ path: "petEmotions",
+ populate: {
+ path: "pet"
+ }
+ })
+ })
+ })
+ })
+ });
+ console.log("user", findUser);
+ let newBook = new Book_1.default();
+ let newTableContents = new TableContents_1.default();
+ let newFirstPartTableContents = new FirstPartTableContents_1.default();
+ newTableContents.setFirstPartTableContents(newFirstPartTableContents);
+ newBook.setTableContents(newTableContents);
+ if (findUser.book == null) {
+ findUser.setBook(newBook);
+ }
+ if (findUser.book.tableContents == null) {
+ findUser.book.tableContents = new TableContents_1.default();
+ }
+ if (findUser.book.tableContents.firstPartTableContents == null) {
+ findUser.book.tableContents.firstPartTableContents.push(new FirstPartTableContents_1.default());
+ }
+ const firstPartMainPageResDto = new FirstPartMainPageResDto_1.FirstPartMainPageResDto(findUser.book);
+ let allPetDiaries = yield PetDiary_1.default.find({}).populate({
+ path: "tableContents"
+ }).populate({
+ path: "petEmotions",
+ populate: {
+ path: "pet"
+ }
+ });
+ let petDiaryNumber = (yield allPetDiaries).length;
+ const test = allPetDiaries[petDiaryNumber - 1];
+ console.log(`!!!!!!!!!!! : ` + test);
+ //가장 마지막 일기
+ const lastDiary = new FirstPartMainPageResDto_1.DiaryResDto(allPetDiaries[petDiaryNumber - 1]);
+ firstPartMainPageResDto.setNextEpisode(lastDiary);
+ //tableContents
+ let lastTableNumber = findUser.book.tableContents.firstPartTableContents.length;
+ for (let i = 0; i < lastTableNumber; i++) {
+ let tableContentsResDto = new FirstPartMainPageResDto_1.TableContentsResDto(findUser.book.tableContents.firstPartTableContents[i]);
+ firstPartMainPageResDto.setTableContents(tableContentsResDto);
+ }
+ firstPartMainPageResDto.setDiary(lastDiary);
+ if (findUser.book.tableContents.secondPartTableContents.length > 1) {
+ firstPartMainPageResDto.setSecondPartBook(findUser);
+ }
+ return firstPartMainPageResDto;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_USER };
+ }
+ })
+};
+//# sourceMappingURL=firstPartService.js.map
\ No newline at end of file
diff --git a/dist/api/service/firstPartService.js.map b/dist/api/service/firstPartService.js.map
new file mode 100644
index 0000000..b6f2697
--- /dev/null
+++ b/dist/api/service/firstPartService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"firstPartService.js","sourceRoot":"","sources":["../../../src/api/service/firstPartService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAAyC;AAEzC,qGAAmI;AACnI,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD,kEAAyC;AACzC,6FAAoE;AACpE,+GAAsF;AACtF,2EAAkD;AAClD,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,OAAO,CAAC,6BAA6B,CAAC,CAAA;AACtC,OAAO,CAAC,gCAAgC,CAAC,CAAA;AACzC,OAAO,CAAC,8BAA8B,CAAC,CAAA;AAEvC,MAAM,CAAC,OAAO,GAAG;IACb,WAAW,EAAE,CAAO,MAAM,EAAE,EAAE;QAC1B,IAAI;YACA,eAAe;YACf,MAAM,QAAQ,GAAG,MAAM,cAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC;gBAClD,IAAI,EAAE,MAAM;aACf,CAAC,CAAC,QAAQ,CAAC;gBACR,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,CAAC;oBACP,IAAI,EAAE,eAAe;oBACrB,QAAQ,EAAE,CAAC;wBACP,IAAI,EAAE,wBAAwB;wBAC9B,QAAQ,EAAE,CAAC;4BACP,IAAI,EAAE,UAAU;4BAChB,QAAQ,EAAE,CAAC;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CAAC,MAAM,aAAa,CAAC,CAAC,MAAM,CAAA;YAC/C,MAAM,IAAI,GAAG,aAAa,CAAC,cAAc,GAAC,CAAC,CAAC,CAAA;YAC5C,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAC,IAAI,CAAC,CAAA;YAClC,WAAW;YACX,MAAM,SAAS,GAAG,IAAI,qCAAW,CAAC,aAAa,CAAC,cAAc,GAAC,CAAC,CAAC,CAAC,CAAA;YAClE,uBAAuB,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;YAEjD,eAAe;YACf,IAAI,eAAe,GAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,MAAM,CAAA;YAE7E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAI,mBAAmB,GAAG,IAAI,6CAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAA;gBACxG,uBAAuB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAA;aAChE;YACD,uBAAuB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;YAE3C,IAAG,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAC;gBAC9D,uBAAuB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;aACtD;YACD,OAAO,uBAAuB,CAAA;SAEjC;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAChB,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,OAAO,EAAE,CAAA;SACzF;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/petService.js b/dist/api/service/petService.js
new file mode 100644
index 0000000..41341a4
--- /dev/null
+++ b/dist/api/service/petService.js
@@ -0,0 +1,87 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const User_1 = __importDefault(require("../../models/user/User"));
+const Pet_1 = __importDefault(require("../../models/pet/Pet"));
+const PetInfoDto_1 = require("../../dto/rainbow/petDto/PetInfoDto");
+const SavePetResDto_1 = require("../../dto/petDiary/SavePetResDto");
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+const util = require('../../modules/util');
+const petService = require('../service/petService');
+var mongoose = require('mongoose');
+require("../../models/user/User");
+require("../../models/pet/Pet");
+module.exports = {
+ getPetInfo: () => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findUser = yield User_1.default.find().populate({
+ path: "pets"
+ });
+ console.log('getPetInfo List');
+ const findPets = findUser[0].pets;
+ return new PetInfoDto_1.PetsInfoDto(findPets.map(pet => new PetInfoDto_1.PetInfoDto(pet)));
+ }
+ catch (error) {
+ throw error;
+ }
+ }),
+ registerPet: (reqData) => __awaiter(void 0, void 0, void 0, function* () {
+ const { pets, userId } = reqData;
+ console.log('petstype : ' + typeof (pets));
+ console.log('pets[0]type : ' + typeof (pets[0]));
+ console.log('pets[0] : ' + JSON.stringify(pets[0]));
+ //console.log('############# : '+reqData[1].name)
+ console.log('petsLength : ' + pets.length);
+ console.log('petsName : ' + pets[0].name);
+ console.log('petsKind : ' + pets[0].startDate);
+ console.log('userId : ' + userId);
+ try {
+ //error handling
+ const findUser = yield User_1.default.findById(userId);
+ console.log('findUser : ' + findUser);
+ //console.log('image : '+images[0])
+ let petsArr = [];
+ const startDate = new Date(pets[0].startDate);
+ startDate.setDate(startDate.getDate() + 1);
+ for (let i = 0; i < pets.length; i++) {
+ let pet = new Pet_1.default({
+ name: pets[i].name,
+ kind: pets[i].kind,
+ gender: pets[i].gender,
+ imgs: "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ user: mongoose.Types.ObjectId(userId),
+ rainbow: false,
+ startDate: new Date(startDate)
+ // findUser, UserId만 해서 되면 가능
+ //book://나중에 책을 등록할때, pet에 book을 등록. 연관관계 확인. 안들어가있는게 있으면 나중에 같이 넣어야됨.
+ //SETTER사용. pet 찾아서 setter로 넣기.
+ });
+ yield pet.save();
+ findUser.pets.push(pet);
+ petsArr[i] = pet;
+ }
+ yield findUser.save();
+ console.log(reqData);
+ //db save
+ const saveInfo = petsArr.map(pet => pet._id);
+ return new SavePetResDto_1.SavePetResDto(saveInfo);
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: statusCode.INTERNAL_SERVER_ERROR, responseMessage: responseMessage.INTERNAL_SERVER_ERROR };
+ }
+ })
+};
+//# sourceMappingURL=petService.js.map
\ No newline at end of file
diff --git a/dist/api/service/petService.js.map b/dist/api/service/petService.js.map
new file mode 100644
index 0000000..a3c110b
--- /dev/null
+++ b/dist/api/service/petService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"petService.js","sourceRoot":"","sources":["../../../src/api/service/petService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kEAAyC;AACzC,+DAAsC;AACtC,oEAA6E;AAC7E,oEAAgE;AAChE,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AACtD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C,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;gBACvB,OAAO,CAAC,CAAC,CAAC,GAAC,GAAG,CAAC;aAClB;YACD,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;YACrB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACrB,SAAS;YACT,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAA,EAAE,CAAA,GAAG,CAAC,GAAG,CAAC,CAAA;YAC1C,OAAO,IAAI,6BAAa,CAAC,QAAQ,CAAC,CAAA;SACrC;QAAA,OAAM,GAAG,EAAC;YACP,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAChB,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,qBAAqB,EAAE,eAAe,EAAE,eAAe,CAAC,qBAAqB,EAAE,CAAC;SAClH;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/rainbowService.js b/dist/api/service/rainbowService.js
new file mode 100644
index 0000000..4b1cc71
--- /dev/null
+++ b/dist/api/service/rainbowService.js
@@ -0,0 +1,399 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const User_1 = __importDefault(require("../../models/user/User"));
+const RainbowMainPageResDto_1 = require("../../dto/rainbow/mainPageDto/RainbowMainPageResDto");
+const Help_1 = __importDefault(require("../../models/etc/Help"));
+const RainbowPetResDto_1 = require("../../dto/rainbow/petDto/RainbowPetResDto");
+const Pet_1 = __importDefault(require("../../models/pet/Pet"));
+const PartingRainbowResDto_1 = require("../../dto/rainbow/partingDto/PartingRainbowResDto");
+const ReadyPartingAndStartRecordResDto_1 = require("../../dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto");
+const FirstPartTableContents_1 = __importDefault(require("../../models/tableContents/FirstPartTableContents"));
+const SecondPartTableContent_1 = __importDefault(require("../../models/tableContents/SecondPartTableContent"));
+const PetEmotions_1 = __importDefault(require("../../models/diary/PetEmotions"));
+const TheBestMomentResDto_1 = require("../../dto/rainbow/theBestMomentDto/TheBestMomentResDto");
+const PetNameResDto_1 = require("../../dto/rainbow/petDto/PetNameResDto");
+const Comments_1 = __importDefault(require("../../models/etc/Comments"));
+const TheBestMomentSubResDto_1 = require("../../dto/rainbow/theBestMomentDto/TheBestMomentSubResDto");
+var dateMethod = require("../../modules/dateMethod");
+var theBestMomentComments = require("../../modules/comment");
+require("../../models/user/User");
+require("../../models/pet/Pet");
+require("../../models/book/Book");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/diary/PetDiary');
+require('../../models/diary/PetEmotions');
+require('../../models/tableContents/SecondPartTableContent');
+require('../../models/diary/UserDiary');
+require("../../models/etc/Help");
+require("../../models/etc/Comments");
+module.exports = {
+ getMainPage: (userId, petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findUser = yield User_1.default.findById(userId).populate({
+ path: "pets"
+ }).populate({
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents",
+ populate: {
+ path: "petDiary",
+ populate: {
+ path: "petEmotions",
+ populate: {
+ path: "pet"
+ }
+ }
+ }
+ }
+ }
+ });
+ const findPet = yield Pet_1.default.findById(petId);
+ const isRainbowPet = yield isRainbow(findUser.pets);
+ const rainbowButtonCheck = yield rainbowCheck(findUser.pets);
+ const rainbowMainPageResDto = new RainbowMainPageResDto_1.RainbowMainPageResDto(findUser.book, isRainbowPet, rainbowButtonCheck);
+ const firstPartTableContents = findUser.book.tableContents.firstPartTableContents;
+ console.log('firstPartTableContents : ' + firstPartTableContents);
+ const validMemories = firstPartTableContents.filter(tableContents => tableContents.petDiary.length > 0).map(tableContents => tableContents.petDiary.filter(petDiary => petDiary.pets.includes(petId)))[0];
+ console.log('validMemories : ' + validMemories);
+ console.log('!!!!!!!!!!!!!!!!!!!!! : ' + validMemories[0]);
+ console.log('@@@@@@@@@@@@@@@@@@ : ' + validMemories[1]);
+ //validMemories : [tableContetns [petDiary]]
+ let memoriesResDto = [null, null];
+ console.log('validMemoriesLength : ' + validMemories.length);
+ if (validMemories.length == 2) {
+ memoriesResDto[0] = new RainbowMainPageResDto_1.MemoriesResDto(validMemories, findPet);
+ memoriesResDto[1] = new RainbowMainPageResDto_1.MemoriesResDto(validMemories, findPet);
+ }
+ else if (validMemories.length > 2) {
+ let firstTableContentsIndex = yield getRandomNumber(validMemories.length);
+ let secondTableContentsIndex = yield getRandomNumber(validMemories.length);
+ if (firstTableContentsIndex == secondTableContentsIndex) {
+ while (firstTableContentsIndex == secondTableContentsIndex) {
+ if (secondTableContentsIndex == firstTableContentsIndex) {
+ secondTableContentsIndex = yield getRandomNumber(validMemories.length);
+ }
+ else {
+ break;
+ }
+ }
+ }
+ console.log('firstTableContentsIndex : ' + firstTableContentsIndex);
+ console.log('secondTableCOntetnsIndex : ' + secondTableContentsIndex);
+ console.log('fisrt : ' + validMemories[firstTableContentsIndex]);
+ console.log('second : ' + validMemories[secondTableContentsIndex]);
+ memoriesResDto[0] = new RainbowMainPageResDto_1.MemoriesResDto2(validMemories[firstTableContentsIndex], findPet);
+ memoriesResDto[1] = new RainbowMainPageResDto_1.MemoriesResDto2(validMemories[secondTableContentsIndex], findPet);
+ }
+ else if (validMemories.length == 1) {
+ memoriesResDto[0] = new RainbowMainPageResDto_1.MemoriesResDto2(validMemories[0], findPet);
+ }
+ rainbowMainPageResDto.setMemories(memoriesResDto);
+ //helpResDto
+ const helps = yield Help_1.default.find();
+ const helpResDto = helps.map(help => new RainbowMainPageResDto_1.HelpResDto(help));
+ rainbowMainPageResDto.setHelp(helpResDto);
+ return rainbowMainPageResDto;
+ }
+ catch (error) {
+ throw error;
+ }
+ function getRandomNumber(max) {
+ max = Math.floor(max);
+ return Math.floor(Math.random() * max);
+ }
+ function isRainbow(pets) {
+ let rainbow = false;
+ pets.forEach(pet => {
+ if (pet.rainbow === true) {
+ rainbow = true;
+ }
+ });
+ return rainbow;
+ }
+ function rainbowCheck(pets) {
+ let check = true;
+ pets.forEach(pet => {
+ if (pet.rainbow === false) {
+ check = false;
+ }
+ });
+ return check;
+ }
+ }),
+ selectPet: () => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findUser = yield User_1.default.find().populate({
+ path: "pets"
+ });
+ const rainbowPetResDto = new RainbowPetResDto_1.RainbowPetResDto(findUser[0].pets.filter(pet => !pet.rainbow).map(pet => new RainbowPetResDto_1.MyPetInfoResDto(pet)));
+ return rainbowPetResDto;
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ setPartingRainbowPet: (petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findPet = yield Pet_1.default.findById(petId).populate({
+ path: "user",
+ populate: {
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents"
+ }
+ }
+ }
+ });
+ findPet.rainbow = true;
+ yield findPet.save();
+ const user = findPet.user;
+ // for()
+ let diaryCount = 0;
+ user.book.tableContents.firstPartTableContents.forEach(tableContent => diaryCount += tableContent.petDiary.length);
+ return new PartingRainbowResDto_1.PartingRainbowResDto(diaryCount, findPet);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ cancelPartingPet: (petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findPet = yield Pet_1.default.findById(petId);
+ findPet.rainbow = false;
+ yield findPet.save();
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ getReadyPartingPetComment: (petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const pet = yield Pet_1.default.findById(petId).populate({
+ path: "user",
+ populate: {
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents"
+ }
+ }
+ }
+ });
+ const user = pet.user;
+ const bookInfo = new ReadyPartingAndStartRecordResDto_1.BookInfoResDto(pet.user.book);
+ let diaryCount = 0;
+ user.book.tableContents.firstPartTableContents.forEach(tableContent => diaryCount += tableContent.petDiary.length);
+ const startDate = pet.startDate;
+ const dayTogether = yield dateMethod.getElapsedDay(startDate);
+ return new ReadyPartingAndStartRecordResDto_1.ReadyPartingAndStartRecordResDto(diaryCount, dayTogether, bookInfo);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ getTheBestMoment: (userId, petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const pet = yield Pet_1.default.findById(petId);
+ const timeTogether = (yield User_1.default.findById(userId).populate('book')).book.date;
+ const TheBestMomentPetInfo = new TheBestMomentResDto_1.TheBestMomentPetInformation(pet);
+ const diaryPerFeeling = [];
+ for (let i = 0; i < 6; i++) {
+ const diaries = (yield PetEmotions_1.default.find({ "feeling": { $eq: i } }).select("petDiary").populate({ path: "petDiary", populate: ({ path: "tableContents" }) })).map(emotion => emotion.petDiary);
+ if (diaries.length < 1) {
+ diaryPerFeeling.push(null);
+ }
+ else {
+ diaryPerFeeling.push(diaries);
+ }
+ }
+ const theBestMomentsResDto = new TheBestMomentResDto_1.TheBestMomentsResDto(timeTogether);
+ for (let j = 0; j < 6; j++) { //긍정3개, 부정3개
+ const commentPerFeeling = yield Comments_1.default.findOne({ feeling: j, classification: 1 });
+ // let commentPerFeeling ={
+ // comments : "",
+ // feeling : j
+ // }
+ // if(j==0){
+ // commentPerFeeling.comments = await theBestMomentComments.loveFeeling(pet.name)
+ // }else if(j==1){
+ // commentPerFeeling = await theBestMomentComments.happyFeeling(pet.name)
+ // }else if(j==2){
+ // commentPerFeeling = await theBestMomentComments.normalFeeling()
+ // }else if(j==3){
+ // commentPerFeeling = await theBestMomentComments.angryFeeling(pet.name)
+ // }else if(j==4){
+ // commentPerFeeling = await theBestMomentComments.gloomyFeeling()
+ // }else if(j==5){
+ // commentPerFeeling = await theBestMomentComments.boringFeeling()
+ // }
+ let theBestMoment = null;
+ if (j < 3) {
+ theBestMoment = new TheBestMomentResDto_1.TheBestMoment(commentPerFeeling, getPositiveRadomDiary(diaryPerFeeling[j]));
+ }
+ else {
+ theBestMoment = new TheBestMomentResDto_1.TheBestMoment(commentPerFeeling, getNegativeRandomDiary(diaryPerFeeling[j]));
+ }
+ theBestMomentsResDto.setTheBestMoment(theBestMoment);
+ theBestMomentsResDto.setTheBestMomentPetInfo(TheBestMomentPetInfo);
+ }
+ return theBestMomentsResDto;
+ }
+ catch (err) {
+ throw err;
+ }
+ //각 기분에 따른 일기들을 배열로 묶어서 보내줘야함
+ function getPositiveRadomDiary(diaries) {
+ if (diaries === null)
+ return null;
+ const diaryLength = diaries.length;
+ const theBestMomentDiaries = [];
+ if (diaryLength < 8) {
+ for (let i = 0; i < diaryLength; i++) { //가지고 있는 일기 갯수만큼만 넣는다
+ theBestMomentDiaries.push(new TheBestMomentResDto_1.TheBestMomentDiary(diaries[i]));
+ }
+ for (let j = 0; j < 8 - diaryLength; j++) { //남은 일기갯수(8-가지고 있는 일기수)만큼 null로 채워준다
+ theBestMomentDiaries.push(null);
+ }
+ }
+ else {
+ //8개 이상의 일기중 8개만 골라서 넣어준다.
+ const indexArray = [];
+ while (indexArray.length < 8) {
+ let index = getRandomNumber(diaryLength);
+ if (!indexArray.includes(index)) {
+ indexArray.push(index);
+ }
+ }
+ for (let k = 0; k < 8; k++) {
+ theBestMomentDiaries.push(new TheBestMomentResDto_1.TheBestMomentDiary(diaries[indexArray[k]]));
+ }
+ }
+ return theBestMomentDiaries;
+ }
+ //부정 일기는 2개씩만
+ function getNegativeRandomDiary(diaries) {
+ if (diaries === null)
+ return null;
+ const diaryLength = diaries.length;
+ const theBestMomentDiaries = [];
+ console.log('부정 일기 길이 : ' + diaryLength);
+ console.log('찾자 diary!!!! : ' + diaries);
+ if (diaryLength < 2) {
+ for (let i = 0; i < diaryLength; i++) {
+ theBestMomentDiaries.push(new TheBestMomentResDto_1.TheBestMomentDiary(diaries[i]));
+ }
+ for (let j = 0; j < 2 - diaryLength; j++) {
+ theBestMomentDiaries.push(null);
+ }
+ }
+ else {
+ const indexArray = [];
+ while (indexArray.length < 2) {
+ let index = getRandomNumber(diaryLength);
+ console.log('index!!!! : ' + index);
+ if (!indexArray.includes(index)) {
+ indexArray.push(index);
+ }
+ }
+ for (let k = 0; k < 2; k++) {
+ theBestMomentDiaries.push(new TheBestMomentResDto_1.TheBestMomentDiary(diaries[indexArray[k]]));
+ }
+ }
+ return theBestMomentDiaries;
+ }
+ function getRandomNumber(max) {
+ max = Math.floor(max);
+ return Math.floor(Math.random() * max);
+ }
+ }),
+ getPartingPetName: (petId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const pet = yield Pet_1.default.findById(petId);
+ return new PetNameResDto_1.PetNameResDto(pet);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ postEpilogue: (userId, data) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ console.log('id : ' + userId);
+ const test = yield User_1.default.findById(userId);
+ console.log('test!!! : ' + test);
+ const user = yield User_1.default.findById(userId).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "firstPartTableContents secondPartTableContents"
+ })
+ })
+ });
+ console.log('user : ' + user);
+ const tableContents = user.book.tableContents;
+ //1부 목차 마지막에 에필로그
+ const firstPartEpilogue = new FirstPartTableContents_1.default({
+ chapter: -1,
+ title: data.title,
+ contents: data.contents
+ });
+ yield firstPartEpilogue.save();
+ yield tableContents.firstPartTableContents.push(firstPartEpilogue);
+ const isAlreadySecondPartTableContents = yield SecondPartTableContent_1.default.find(); //첫 반려동물이 무지개를 건넜는지 확인하기 위한 로직
+ //2부 목차 처음에 에필로그
+ const secondPartEpilogue = new SecondPartTableContent_1.default({
+ chapter: 0,
+ title: data.title,
+ contents: data.contents
+ });
+ const saveSecondPartEpiogue = yield secondPartEpilogue.save();
+ yield tableContents.secondPartTableContents.unshift(saveSecondPartEpiogue);
+ if (isAlreadySecondPartTableContents.length < 1) {
+ const season = ["봄", "여름", "가을", "겨울"];
+ for (let i = 0; i < 4; i++) {
+ let chapter = 1;
+ const dummySecondPartTableContents = new SecondPartTableContent_1.default({
+ chapter,
+ title: `${user.book.author}의 ${season[i]}`
+ });
+ const saveSecondPartEpiogue = yield dummySecondPartTableContents.save();
+ yield tableContents.secondPartTableContents.push(saveSecondPartEpiogue);
+ chapter = chapter + 1;
+ }
+ }
+ yield tableContents.save();
+ return user;
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ getTheBestMomentSub: (petId, theBestMoment) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const pet = yield Pet_1.default.findById(petId);
+ return new TheBestMomentSubResDto_1.TheBestMomentSubResDto(pet, theBestMoment);
+ }
+ catch (err) {
+ throw err;
+ }
+ })
+};
+//# sourceMappingURL=rainbowService.js.map
\ No newline at end of file
diff --git a/dist/api/service/rainbowService.js.map b/dist/api/service/rainbowService.js.map
new file mode 100644
index 0000000..cfcc844
--- /dev/null
+++ b/dist/api/service/rainbowService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"rainbowService.js","sourceRoot":"","sources":["../../../src/api/service/rainbowService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kEAAyC;AACzC,+FAAwI;AACxI,iEAAwC;AACxC,gFAA6F;AAC7F,+DAAsC;AAEtC,4FAAwF;AACxF,uIAAmJ;AACnJ,+GAAsF;AACtF,+GAAsF;AAEtF,iFAAwD;AACxD,gGAA6J;AAC7J,0EAAsE;AAEtE,yEAAgD;AAChD,sGAAkG;AAClG,IAAI,UAAU,GAAG,OAAO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,CAAC,EAAE;gBAC7C,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;gBACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;oBACxB,IAAI,OAAO,GAAG,CAAC,CAAA;oBACf,MAAM,4BAA4B,GAAG,IAAI,gCAAsB,CAAC;wBAC5D,OAAO;wBACP,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE;qBAC7C,CAAC,CAAA;oBACF,MAAM,qBAAqB,GAAG,MAAM,4BAA4B,CAAC,IAAI,EAAE,CAAA;oBACvE,MAAM,aAAa,CAAC,uBAAuB,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;oBACvE,OAAO,GAAG,OAAO,GAAG,CAAC,CAAA;iBACxB;aACJ;YACD,MAAM,aAAa,CAAC,IAAI,EAAE,CAAA;YAE1B,OAAO,IAAI,CAAA;SACd;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;IAED,mBAAmB,EAAC,CAAO,KAAK,EAAC,aAAa,EAAE,EAAE;QAC9C,IAAG;YACC,MAAM,GAAG,GAAG,MAAM,aAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YACrC,OAAO,IAAI,+CAAsB,CAAC,GAAG,EAAC,aAAa,CAAC,CAAA;SACvD;QAAA,OAAM,GAAG,EAAC;YACP,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/secondPartService.js b/dist/api/service/secondPartService.js
new file mode 100644
index 0000000..261c0d8
--- /dev/null
+++ b/dist/api/service/secondPartService.js
@@ -0,0 +1,240 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const SecondPartTableContent_1 = __importDefault(require("../../models/tableContents/SecondPartTableContent"));
+const UserDiary_1 = __importDefault(require("../../models/diary/UserDiary"));
+const User_1 = __importDefault(require("../../models/user/User"));
+const SecondPartMainPageResDto_1 = require("../../dto/secondPart/SecondPartMainPageResDto");
+const SecondPartDiariesOfMonthResDto_1 = require("../../dto/secondPart/SecondPartDiariesOfMonthResDto");
+const SecondPartChapterListResDto_1 = require("../../dto/secondPart/SecondPartChapterListResDto");
+const SecondPartDiaryResDto_1 = require("../../dto/secondPart/SecondPartDiaryResDto");
+const TableContents_1 = __importDefault(require("../../models/tableContents/TableContents"));
+const dateMethod = require("../../modules/dateMethod");
+require('../../models/tableContents/FirstPartTableContents');
+require('../../models/tableContents/SecondPartTableContent');
+require('../../models/diary/PetDiary');
+require('../../models/diary/UserDiary');
+require('../../models/diary/PetEmotions');
+require('../../models/book/Book');
+module.exports = {
+ getMainPage: (userId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const user = yield User_1.default.findById(userId).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "secondPartTableContents",
+ populate: ({
+ path: "userDiary"
+ })
+ })
+ })
+ });
+ //console.log('mmmm : ',user)
+ const epilogue = user.book.tableContents.secondPartTableContents[0];
+ const checkFirst = user.book.tableContents.secondPartTableContents.map(tableContents => tableContents.userDiary);
+ let check = false;
+ checkFirst.forEach(x => {
+ if (x.length > 1)
+ check = true;
+ });
+ let sortSecondPartTableContents = [];
+ if (check) {
+ sortSecondPartTableContents = user.book.tableContents.secondPartTableContents.filter(secondPartTableContents => secondPartTableContents.userDiary.length > 1).sort((a, b) => b.chapter - a.chapter)[0].userDiary.sort((a, b) => b.episode - a.episode);
+ }
+ else {
+ sortSecondPartTableContents.push({
+ nextEpisode: 1,
+ episode: 0,
+ title: epilogue.title,
+ contents: epilogue.contents,
+ date: user.book.tableContents.secondPartStartDate
+ });
+ }
+ //console.log("sort",sortSecondPartTableContents)
+ const curSecondPartTableContents = yield SecondPartTableContent_1.default.findById(sortSecondPartTableContents[0].tableContents);
+ let mainPageDto = new SecondPartMainPageResDto_1.SecondPartMainPageResDto(user, sortSecondPartTableContents[0]);
+ console.log("말도안돼...", curSecondPartTableContents);
+ mainPageDto.setDiary(yield new SecondPartMainPageResDto_1.SecondPartMainPageDiary(curSecondPartTableContents.chapter, sortSecondPartTableContents[0]));
+ return mainPageDto;
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ getDiaryOfTableContents: (tableContentsId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const tableContents = yield SecondPartTableContent_1.default.findById(tableContentsId).populate({
+ path: "userDiary"
+ });
+ const test = tableContents.userDiary.filter(userDiary => userDiary.date.getMonth() == 6);
+ const secondPartDiariesOfMonth = [];
+ for (let i = 12; i > 0; i--) {
+ if ((tableContents.userDiary.map(diary => diary.date.getMonth() == i)).includes(true)) {
+ const filteringDiaries = tableContents.userDiary.filter(userDiary => userDiary.date.getMonth() == i);
+ secondPartDiariesOfMonth.push(new SecondPartDiariesOfMonthResDto_1.SecondPartDiariesOfMonth(i + 1, filteringDiaries));
+ }
+ }
+ return new SecondPartDiariesOfMonthResDto_1.SecondPartDiariesOfMonthResDto(tableContents, secondPartDiariesOfMonth);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ getSecondPartChapterList: () => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const chapterList = yield SecondPartTableContent_1.default.find();
+ return new SecondPartChapterListResDto_1.SecondPartChapterListResDto(chapterList);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ addSecondPartChapter: (chapterData) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ let newChapter = new SecondPartTableContent_1.default({
+ title: chapterData.chapterTitle,
+ chapter: yield getNextChapter()
+ });
+ yield newChapter.save();
+ const tableContents = (yield TableContents_1.default.find())[0];
+ yield tableContents.setSecondPartTableContents(newChapter);
+ yield tableContents.save();
+ const chapterList = yield SecondPartTableContent_1.default.find();
+ return new SecondPartChapterListResDto_1.SecondPartChapterListResDto(chapterList);
+ }
+ catch (err) {
+ throw err;
+ }
+ function getNextChapter() {
+ return __awaiter(this, void 0, void 0, function* () {
+ const secondPartTableContents = (yield SecondPartTableContent_1.default.find());
+ const secondPartLength = secondPartTableContents.length;
+ return secondPartTableContents[secondPartLength - 1].chapter + 1;
+ });
+ }
+ }),
+ modifySecondPartChapterInfo: (chapterId, modifyChapterData) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ yield SecondPartTableContent_1.default.updateOne({ _id: chapterId }, { $set: { title: modifyChapterData.chapterTitle } });
+ const chapterList = yield SecondPartTableContent_1.default.find();
+ return new SecondPartChapterListResDto_1.SecondPartChapterListResDto(chapterList);
+ }
+ catch (err) {
+ throw err;
+ }
+ }),
+ deleteSecondPartChapter: (chapterId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ //삭제하고자하는 2부 목차
+ const findSecondPartChapter = yield SecondPartTableContent_1.default.findById(chapterId).populate({
+ path: "userDiary"
+ });
+ if (findSecondPartChapter === null) {
+ throw { statusCode: 400 };
+ }
+ //전체 2부 목차
+ const tableContents = (yield TableContents_1.default.find().populate({
+ path: "secondPartTableContents"
+ }))[0];
+ //삭제할 2부 목차의 chapter보다 큰 챕터 배열 & chapter -1씩 줄임 & 저장
+ tableContents.secondPartTableContents.filter(secondPartTable => secondPartTable.chapter > findSecondPartChapter.chapter).forEach((secondPartTable) => __awaiter(void 0, void 0, void 0, function* () {
+ secondPartTable.chapter -= 1;
+ yield secondPartTable.save();
+ }));
+ //2부 목차에서 해당 목차 삭제
+ yield SecondPartTableContent_1.default.deleteOne({ _id: `${chapterId}` });
+ //2부 목차에 들어있던 userDiary 삭제
+ const userDiaries = findSecondPartChapter.userDiary;
+ userDiaries.forEach((userDiary) => __awaiter(void 0, void 0, void 0, function* () {
+ yield UserDiary_1.default.deleteOne({ _id: `${userDiary._id}` });
+ }));
+ //총 목차(1부,2부)에서 해당 목차 secondPartTableContents배열에서 삭제
+ const idx = tableContents.secondPartTableContents.findIndex(secondPartTable => secondPartTable._id == chapterId);
+ tableContents.secondPartTableContents.splice(idx, 1);
+ yield tableContents.save();
+ const chapterList = yield SecondPartTableContent_1.default.find();
+ return new SecondPartChapterListResDto_1.SecondPartChapterListResDto(chapterList);
+ }
+ catch (err) {
+ throw err;
+ }
+ }), getSecondPartDiary: (diaryId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ console.log(diaryId);
+ const findSecondPartDiary = yield UserDiary_1.default.findById(diaryId).populate('users').populate('tableContents');
+ console.log(findSecondPartDiary);
+ let secondPartDiaryResDto = yield new SecondPartDiaryResDto_1.SecondPartDiaryResDto(findSecondPartDiary);
+ console.log(secondPartDiaryResDto);
+ return secondPartDiaryResDto;
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: 400 };
+ }
+ }), addSecondPartDiary: (diaryData) => __awaiter(void 0, void 0, void 0, function* () {
+ const secondPartTableContents = yield SecondPartTableContent_1.default.findById(diaryData.chapterId).populate('userDiary');
+ console.log("length: ", secondPartTableContents.userDiary.length);
+ let newUserDiary = new UserDiary_1.default({
+ tableContents: diaryData.chapterId,
+ episode: secondPartTableContents.userDiary.length,
+ imgs: "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ title: diaryData.title,
+ contents: diaryData.contents,
+ feeling: diaryData.feeling
+ });
+ secondPartTableContents.setUserDiary(newUserDiary);
+ yield secondPartTableContents.save();
+ try {
+ console.log(newUserDiary);
+ yield newUserDiary.save();
+ }
+ catch (err) {
+ console.log(err);
+ throw { statusCode: 400 };
+ }
+ }),
+ modifySecondPartDiary: (diaryId, diaryData) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ yield UserDiary_1.default.updateOne({ _id: diaryId }, { $set: { imgs: diaryData.diaryImages, title: diaryData.title, contents: diaryData.contents, feeling: diaryData.feeling } });
+ }
+ catch (err) {
+ throw err;
+ }
+ }), deleteSecondPartDiary: (diaryId) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const findDiary = yield UserDiary_1.default.findById(diaryId).populate('tableContents');
+ const userDiaries = (yield SecondPartTableContent_1.default.findOne({ chapter: { $eq: findDiary.tableContents.chapter } })).userDiary;
+ for (let i = 0; i < userDiaries.length; i++) {
+ let userChapter = yield UserDiary_1.default.findById(userDiaries[i]);
+ if (findDiary.episode <= userChapter.episode) {
+ userChapter.episode = Number(userChapter.episode) - 1;
+ yield userChapter.save();
+ }
+ }
+ yield UserDiary_1.default.deleteOne({ _id: findDiary });
+ for (let j = 0; j < findDiary.tableContents.userDiary.length; j++) {
+ if (findDiary.tableContents.userDiary[j]._id == diaryId) {
+ findDiary.tableContents.userDiary.splice(j, 1);
+ }
+ }
+ yield findDiary.tableContents.save();
+ }
+ catch (err) {
+ throw err;
+ }
+ })
+};
+//# sourceMappingURL=secondPartService.js.map
\ No newline at end of file
diff --git a/dist/api/service/secondPartService.js.map b/dist/api/service/secondPartService.js.map
new file mode 100644
index 0000000..cc9a22f
--- /dev/null
+++ b/dist/api/service/secondPartService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"secondPartService.js","sourceRoot":"","sources":["../../../src/api/service/secondPartService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+GAAsF;AAEtF,6EAAoD;AACpD,kEAAyC;AAEzC,4FAAiJ;AACjJ,wGAA8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AAC,MAAM,gCAAsB,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;YAC3H,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,WAAW,GAAG,MAAM,mBAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC1D,IAAI,SAAS,CAAC,OAAO,IAAI,WAAW,CAAC,OAAO,EAAE;oBAC1C,WAAW,CAAC,OAAO,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;oBACrD,MAAM,WAAW,CAAC,IAAI,EAAE,CAAA;iBAC3B;aACJ;YACD,MAAM,mBAAS,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAA;YAE7C,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,EAAC,CAAC,EAAE,EAAC;gBAC1D,IAAG,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,EAAC;oBACnD,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAC,CAAC,CAAC,CAAA;iBAChD;aACJ;YACD,MAAM,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;SACvC;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/api/service/userService.js b/dist/api/service/userService.js
new file mode 100644
index 0000000..d340eab
--- /dev/null
+++ b/dist/api/service/userService.js
@@ -0,0 +1,81 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const User_1 = __importDefault(require("../../models/user/User"));
+const Book_1 = __importDefault(require("../../models/book/Book"));
+const bcryptjs_1 = __importDefault(require("bcryptjs"));
+const express_validator_1 = require("express-validator");
+const validator = require('validator');
+require("../../models/user/User");
+require("../../models/pet/Pet");
+require("../../models/book/Book");
+const util = require('../../modules/util');
+const responseMessage = require('../../modules/responseMessage');
+const statusCode = require('../../modules/statusCode');
+module.exports = {
+ register: (email, password) => __awaiter(void 0, void 0, void 0, function* () {
+ //See if user exists(check valid email)
+ const errors = express_validator_1.validationResult(email);
+ if (!errors.isEmpty()) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.EMPTY_ID };
+ }
+ if (!validator.isEmail(email) || !validator.isLength(password, { min: 8 })) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.WRONG_FORM };
+ }
+ let user = yield User_1.default.findOne({ email });
+ if (user) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.ALREADY_ID };
+ }
+ const book = new Book_1.default();
+ user = new User_1.default({
+ email,
+ password,
+ book
+ });
+ yield book.save();
+ //Encrpyt password
+ const salt = yield bcryptjs_1.default.genSalt(10);
+ user.password = yield bcryptjs_1.default.hash(password, salt);
+ yield user.save();
+ }),
+ login: (email, password) => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ const errors = express_validator_1.validationResult(email);
+ if (!errors.isEmpty()) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.EMPTY_ID };
+ }
+ let user = yield User_1.default.findOne({ email }).populate({
+ path: "pets"
+ });
+ if (!user) {
+ //등록되지 않은 email
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_USER };
+ }
+ const test = yield bcryptjs_1.default.compare(password, user.password);
+ console.log('asdada' + test);
+ if (!test) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.SIGN_IN_FAIL };
+ }
+ let petId = null;
+ if (user.pets[0] != undefined) {
+ petId = user.pets[0]._id;
+ }
+ return { userId: user._id, petId: petId };
+ }
+ catch (err) {
+ throw err;
+ }
+ })
+};
+//# sourceMappingURL=userService.js.map
\ No newline at end of file
diff --git a/dist/api/service/userService.js.map b/dist/api/service/userService.js.map
new file mode 100644
index 0000000..d0ee1ea
--- /dev/null
+++ b/dist/api/service/userService.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"userService.js","sourceRoot":"","sources":["../../../src/api/service/userService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,kEAAyC;AACzC,kEAAyC;AAIzC,wDAA6B;AAC7B,yDAA4D;AAC5D,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACvC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;AAC1C,MAAM,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAM,CAAC,OAAO,GAAG;IACb,QAAQ,EACJ,CAAO,KAAK,EAAE,QAAQ,EAAE,EAAE;QACtB,uCAAuC;QACvC,MAAM,MAAM,GAAG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E;gBACnB,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC;aAC3F;YACD,IAAI,IAAI,GAAG,MAAM,cAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC;gBAC9C,IAAI,EAAG,MAAM;aAChB,CAAC,CAAC;YACH,IAAI,CAAC,IAAI,EAAE;gBACP,eAAe;gBACf,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,OAAO,EAAE,CAAC;aAC1F;YAED,MAAM,IAAI,GAAG,MAAM,kBAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC1D,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;YAC5B,IAAI,CAAC,IAAI,EAAE;gBACP,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,eAAe,EAAE,eAAe,CAAC,YAAY,EAAE,CAAC;aAC/F;YACD,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,IAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,SAAS,EAAC;gBACzB,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;aAC3B;YACD,OAAO,EAAE,MAAM,EAAG,IAAI,CAAC,GAAG,EAAE,KAAK,EAAG,KAAK,EAAC,CAAA;SAC7C;QAAC,OAAO,GAAG,EAAE;YACV,MAAM,GAAG,CAAA;SACZ;IACL,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/config/index.js b/dist/config/index.js
new file mode 100644
index 0000000..13cf2af
--- /dev/null
+++ b/dist/config/index.js
@@ -0,0 +1,31 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const dotenv_1 = __importDefault(require("dotenv"));
+// Set the NODE_ENV to 'development' by default
+process.env.NODE_ENV = process.env.NODE_ENV || "development";
+const envFound = dotenv_1.default.config();
+if (envFound.error) {
+ // This error should crash whole process
+ throw new Error("⚠️ Couldn't find .env file ⚠️");
+}
+exports.default = {
+ /**
+ * Your favorite port
+ */
+ port: parseInt(process.env.PORT, 10),
+ /**
+ * That long string from mlab
+ */
+ mongoURI: process.env.MONGODB_URI,
+ /**
+ * Your secret sauce
+ */
+ jwtSecret: process.env.JWT_SECRET,
+ jwtAlgorithm: process.env.JWT_ALGO,
+ githubClientId: process.env.GITHUB_CLIENT_ID,
+ githubSecret: process.env.GITHUB_SECRET,
+};
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/config/index.js.map b/dist/config/index.js.map
new file mode 100644
index 0000000..a313c07
--- /dev/null
+++ b/dist/config/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,+CAA+C;AAC/C,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAE7D,MAAM,QAAQ,GAAG,gBAAM,CAAC,MAAM,EAAE,CAAC;AACjC,IAAI,QAAQ,CAAC,KAAK,EAAE;IAClB,wCAAwC;IAExC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;CACpD;AAED,kBAAe;IACb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;IAEpC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;IAEjC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;IACjC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ;IAElC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB;IAC5C,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa;CACxC,CAAC"}
\ No newline at end of file
diff --git a/dist/config/s3.json b/dist/config/s3.json
new file mode 100644
index 0000000..626b115
--- /dev/null
+++ b/dist/config/s3.json
@@ -0,0 +1,5 @@
+{
+ "accessKeyId": "AKIAYBR5NJVMWLVU4RNJ",
+ "secretAccessKey": "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",
+ "region": "ap-northeast-2"
+}
\ No newline at end of file
diff --git a/dist/dto/calendar/calendarResDto.js b/dist/dto/calendar/calendarResDto.js
new file mode 100644
index 0000000..79cd2d0
--- /dev/null
+++ b/dist/dto/calendar/calendarResDto.js
@@ -0,0 +1,67 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.CalendarDateUserDto = exports.CalendarDatePetDto = exports.CalendarInfoResDto = exports.CalendarResDto = void 0;
+const IPet = require("../../interfaces/pet/IPet");
+class CalendarResDto {
+ constructor(name, part) {
+ this.name = null;
+ this.part = null;
+ this.nextEpilogue = null;
+ this.calendar = null;
+ this.name = name;
+ this.part = part;
+ }
+ setCalendar(calendar) {
+ this.calendar = calendar;
+ }
+}
+exports.CalendarResDto = CalendarResDto;
+class CalendarInfoResDto {
+ constructor(year, month) {
+ this.year = null;
+ this.month = null;
+ this.date = [];
+ this.year = year;
+ this.month = month;
+ }
+ setDate(calendarDateDto) {
+ this.date.push(calendarDateDto);
+ }
+}
+exports.CalendarInfoResDto = CalendarInfoResDto;
+class CalendarDatePetDto {
+ constructor(days, petDiaries) {
+ this.days = null;
+ this.kind = null;
+ this.id = [];
+ this.feeling = null;
+ this.days = days;
+ this.kind = petDiaries[0].pets[0].kind;
+ this.id = petDiaries.map(diary => diary._id);
+ this.feeling = petDiaries[0].petEmotions[0].feeling;
+ }
+}
+exports.CalendarDatePetDto = CalendarDatePetDto;
+class CalendarDateUserDto {
+ constructor(days, userDiaries, user) {
+ this.days = null;
+ this.kind = null;
+ this.diaryId = [];
+ this.feeling = null;
+ this.days = days;
+ this.kind = this.getUsersPet(user);
+ this.diaryId = userDiaries.map(diary => diary._id);
+ this.feeling = userDiaries[0].feeling;
+ }
+ getUsersPet(user) {
+ const pets = user.pets;
+ let petsKind = null;
+ for (let i = pets.length - 1; i >= 0; i--) {
+ if (pets[i].rainbow)
+ petsKind = pets[i].kind;
+ }
+ return petsKind;
+ }
+}
+exports.CalendarDateUserDto = CalendarDateUserDto;
+//# sourceMappingURL=calendarResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/calendar/calendarResDto.js.map b/dist/dto/calendar/calendarResDto.js.map
new file mode 100644
index 0000000..6742ad5
--- /dev/null
+++ b/dist/dto/calendar/calendarResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"calendarResDto.js","sourceRoot":"","sources":["../../../src/dto/calendar/calendarResDto.ts"],"names":[],"mappings":";;;AAMA,MAAM,IAAI,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;AAEjD,MAAa,cAAc;IAMvB,YAAY,IAAI,EAAE,IAAI;QALd,SAAI,GAAG,IAAI,CAAA;QACX,SAAI,GAAG,IAAI,CAAA;QACX,iBAAY,GAAG,IAAI,CAAA;QACnB,aAAQ,GAAG,IAAI,CAAA;QAGnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;IAED,WAAW,CAAC,QAA6B;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;CACJ;AAdD,wCAcC;AAED,MAAa,kBAAkB;IAK3B,YAAY,IAAI,EAAE,KAAK;QAJf,SAAI,GAAG,IAAI,CAAA;QACX,UAAK,GAAG,IAAI,CAAA;QACZ,SAAI,GAAG,EAAE,CAAA;QAGb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK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AI,GAAG,IAAI,CAAC,IAAI,CAAA;QACtB,IAAI,QAAQ,GAAG,IAAI,CAAA;QACnB,KAAI,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAC,CAAC,EAAG,CAAC,IAAG,CAAC,EAAG,CAAC,EAAE,EAAC;YACpC,IAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO;gBAAE,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;SAC9C;QACD,OAAO,QAAQ,CAAA;IACnB,CAAC;CACJ;AArBD,kDAqBC"}
\ No newline at end of file
diff --git a/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js b/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js
new file mode 100644
index 0000000..62c98c6
--- /dev/null
+++ b/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js
@@ -0,0 +1,93 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SecondPartBookResDto = exports.TableContentsResDto = exports.DiaryResDto = exports.FirstPartMainPageResDto = void 0;
+const dateMethod = require('../../../modules/dateMethod');
+class FirstPartMainPageResDto {
+ constructor(book) {
+ this.firstPartMainPage = {
+ title: null,
+ bookImg: null,
+ diary: null,
+ tableContents: [],
+ secondPartBook: null,
+ nextEpisode: null
+ };
+ this.firstPartMainPage.title = book.title;
+ this.firstPartMainPage.bookImg = book.imgs;
+ }
+ setNextEpisode(diaryResDto) {
+ this.firstPartMainPage.nextEpisode = diaryResDto.episode + 1;
+ }
+ //가장 최근 일기 작성(기분X)
+ setDiary(diary) {
+ this.firstPartMainPage.diary = diary;
+ }
+ setTableContents(tableContents) {
+ this.firstPartMainPage.tableContents.push(tableContents);
+ }
+ setSecondPartBook(user) {
+ this.firstPartMainPage.secondPartBook = new SecondPartBookResDto(user);
+ }
+}
+exports.FirstPartMainPageResDto = FirstPartMainPageResDto;
+class DiaryResDto {
+ //가장 마지막 화 들어감
+ constructor(petDiary) {
+ this.init(petDiary);
+ }
+ init(petDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ console.log('findPet : ' + petDiary.petEmotions[0]);
+ const firstPartTableContents = petDiary.tableContents;
+ this.chapter = firstPartTableContents.chapter;
+ this.episode = firstPartTableContents.petDiary.length;
+ //if(this.chapter==0){
+ // this._id="60ed3acde5003a744892ce27"
+ //}else{
+ this._id = petDiary._id;
+ //}
+ this.title = petDiary.title;
+ this.contents = petDiary.contents;
+ this.date = yield dateMethod.toStringByFormatting(petDiary.date);
+ this.kind = petDiary.petEmotions[0].pet.kind;
+ });
+ }
+}
+exports.DiaryResDto = DiaryResDto;
+class TableContentsResDto {
+ constructor(firstPartTableContents) {
+ this.chapterId = firstPartTableContents._id; //목차 Id
+ this.chapterTitle = firstPartTableContents.title;
+ this.chapter = firstPartTableContents.chapter;
+ this.episodePerchapterCount = firstPartTableContents.petDiary.length;
+ }
+}
+exports.TableContentsResDto = TableContentsResDto;
+class SecondPartBookResDto {
+ constructor(user) {
+ this.userId = null;
+ this.bookImg = null;
+ this.author = null;
+ this.date = null;
+ this.init(user);
+ }
+ init(user) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.userId = user._id;
+ this.bookImg = user.book.imgs;
+ this.author = user.book.author;
+ this.date = yield dateMethod.toStringByFormatting(user.book.date);
+ });
+ }
+}
+exports.SecondPartBookResDto = SecondPartBookResDto;
+//# sourceMappingURL=FirstPartMainPageResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js.map b/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js.map
new file mode 100644
index 0000000..93bb234
--- /dev/null
+++ b/dist/dto/firstPart/mainPageDto/FirstPartMainPageResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"FirstPartMainPageResDto.js","sourceRoot":"","sources":["../../../../src/dto/firstPart/mainPageDto/FirstPartMainPageResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,MAAM,UAAU,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAEzD,MAAa,uBAAuB;IAUhC,YAAY,IAAW;QAThB,sBAAiB,GAAG;YACvB,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,aAAa,EAAE,EAAE;YACjB,cAAc,EAAE,IAAI;YACpB,WAAW,EAAC,IAAI;SACnB,CAAA;QAGG,IAAI,CAAC,iBAAiB,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACzC,IAAI,CAAC,iBAAiB,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;IAC9C,CAAC;IACD,cAAc,CAAC,WAAuB;QAClC,IAAI,CAAC,iBAAiB,CAAC,WAAW,GAAC,WAAW,CAAC,OAAO,GAAC,CAAC,CAAA;IAC5D,CAAC;IACD,kBAAkB;IAClB,QAAQ,CAAC,KAAkB;QACvB,IAAI,CAAC,iBAAiB,CAAC,KAAK,GAAG,KAAK,CAAA;IACxC,CAAC;IACD,gBAAgB,CAAC,aAAkC;QAC/C,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAC5D,CAAC;IACD,iBAAiB,CAAC,IAAW;QACzB,IAAI,CAAC,iBAAiB,CAAC,cAAc,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAC1E,CAAC;CACJ;AA3BD,0DA2BC;AAED,MAAa,WAAW;IASpB,cAAc;IACd,YAAY,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,IAAI,CAAA;QACZ,WAAM,GAAC,IAAI,CAAA;QACX,SAAI,GAAC,IAAI,CAAA;QAGb,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC;IAEK,IAAI,CAAC,IAAW;;YAClB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAA;YACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;YAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;YAC9B,IAAI,CAAC,IAAI,GAAG,MAAM,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrE,CAAC;KAAA;CACJ;AAhBD,oDAgBC"}
\ No newline at end of file
diff --git a/dist/dto/petChapter/ChapterList.js b/dist/dto/petChapter/ChapterList.js
new file mode 100644
index 0000000..2623664
--- /dev/null
+++ b/dist/dto/petChapter/ChapterList.js
@@ -0,0 +1,32 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.ChapterResDto = exports.ChapterListResDto = void 0;
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+const dateMethod = require('../../modules/dateMethod');
+class ChapterListResDto {
+ constructor() {
+ this.tableContents = [];
+ }
+ setChapterList(chapter) {
+ this.tableContents.push(chapter);
+ }
+}
+exports.ChapterListResDto = ChapterListResDto;
+class ChapterResDto {
+ constructor(firstPartTableContents) {
+ this.chapterId = null;
+ this.chapter = null;
+ this.chapterTitle = null;
+ this.episodePerchapterCount = null;
+ this.chapterId = firstPartTableContents._id;
+ this.chapter = firstPartTableContents.chapter;
+ this.chapterTitle = firstPartTableContents.title;
+ this.episodePerchapterCount;
+ }
+}
+exports.ChapterResDto = ChapterResDto;
+//# sourceMappingURL=ChapterList.js.map
\ No newline at end of file
diff --git a/dist/dto/petChapter/ChapterList.js.map b/dist/dto/petChapter/ChapterList.js.map
new file mode 100644
index 0000000..1d79b9f
--- /dev/null
+++ b/dist/dto/petChapter/ChapterList.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ChapterList.js","sourceRoot":"","sources":["../../../src/dto/petChapter/ChapterList.ts"],"names":[],"mappings":";;;AAKA,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAa,iBAAiB;IAA9B;QACW,kBAAa,GAAG,EAAG,CAAA;IAI9B,CAAC;IAHG,cAAc,CAAC,OAAqB;QAChC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ;AALD,8CAKC;AACD,MAAa,aAAa;IAOtB,YAAY,sBAA8C;QAN/C,cAAS,GAAC,IAAI,CAAA;QACd,YAAO,GAAC,IAAI,CAAA;QACZ,iBAAY,GAAC,IAAI,CAAA;QACjB,2BAAsB,GAAC,IAAI,CAAA;QAIlC,IAAI,CAAC,SAAS,GAAC,sBAAsB,CAAC,GAAG,CAAA;QACzC,IAAI,CAAC,OAAO,GAAC,sBAAsB,CAAC,OAAO,CAAA;QAC3C,IAAI,CAAC,YAAY,GAAC,sBAAsB,CAAC,KAAK,CAAA;QAC9C,IAAI,CAAC,sBAAsB,CAAA;IAC/B,CAAC;CACJ;AAbD,sCAaC"}
\ No newline at end of file
diff --git a/dist/dto/petChapter/PetChapterDiary.js b/dist/dto/petChapter/PetChapterDiary.js
new file mode 100644
index 0000000..4d46a3e
--- /dev/null
+++ b/dist/dto/petChapter/PetChapterDiary.js
@@ -0,0 +1,71 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.DiariesResDto = exports.MonthlyDiaryResDto = exports.PetChapterDiaryResDto = void 0;
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+const dateMethod = require('../../modules/dateMethod');
+class PetChapterDiaryResDto {
+ constructor(firstPartTableContents) {
+ this.petChapterDiary = {
+ chapterId: null,
+ chapter: null,
+ chapterTitle: null,
+ monthly: [],
+ };
+ this.petChapterDiary.chapterId = firstPartTableContents._id;
+ this.petChapterDiary.chapter = firstPartTableContents.chapter;
+ this.petChapterDiary.chapterTitle = firstPartTableContents.title;
+ }
+ setMonthly(monthly) {
+ this.petChapterDiary.monthly.push(monthly);
+ }
+}
+exports.PetChapterDiaryResDto = PetChapterDiaryResDto;
+class MonthlyDiaryResDto {
+ constructor() {
+ this.episodePerMonthCount = null;
+ this.month = null;
+ this.diaries = [];
+ }
+ setMonthCount(monthCount) { this.episodePerMonthCount = monthCount; }
+ setMonth(month) { this.month = month; }
+ setDiaries(diary) {
+ this.diaries.push(diary);
+ }
+}
+exports.MonthlyDiaryResDto = MonthlyDiaryResDto;
+class DiariesResDto {
+ constructor(diary) {
+ this.diaryId = null;
+ this.title = null;
+ this.contents = null;
+ this.episode = null;
+ this.image = null;
+ this.feelingCount = null;
+ this.feeling = null;
+ this.date = null;
+ this.weekday = null;
+ this.kind = null;
+ const week = new Array('일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일');
+ console.log('test : ' + diary._id);
+ this.diaryId = diary._id;
+ this.title = diary.title;
+ this.contents = diary.contents;
+ this.episode = diary.episode;
+ this.image = diary.imgs[0]; //가장 첫번째 사진
+ this.feelingCount = diary.petEmotions.length;
+ this.feeling = diary.petEmotions[0].feeling;
+ this.date = diary.date.getDate() + "일";
+ console.log('요일 : ' + diary.date.getDay());
+ this.weekday = week[diary.date.getDay()];
+ this.kind = diary.pets[0].kind;
+ }
+ setFeeling(petEmotion) {
+ this.feeling = petEmotion;
+ }
+}
+exports.DiariesResDto = DiariesResDto;
+//# sourceMappingURL=PetChapterDiary.js.map
\ No newline at end of file
diff --git a/dist/dto/petChapter/PetChapterDiary.js.map b/dist/dto/petChapter/PetChapterDiary.js.map
new file mode 100644
index 0000000..d6e92e2
--- /dev/null
+++ b/dist/dto/petChapter/PetChapterDiary.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetChapterDiary.js","sourceRoot":"","sources":["../../../src/dto/petChapter/PetChapterDiary.ts"],"names":[],"mappings":";;;AAKA,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAa,qBAAqB;IAQ9B,YAAY,sBAA8C;QAPnD,oBAAe,GAAG;YACrB,SAAS,EAAC,IAAI;YACd,OAAO,EAAC,IAAI;YACZ,YAAY,EAAC,IAAI;YACjB,OAAO,EAAC,EAAE;SACT,CAAA;QAGD,IAAI,CAAC,eAAe,CAAC,SAAS,GAAC,sBAAsB,CAAC,GAAG,CAAA;QACzD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAC,sBAAsB,CAAC,OAAO,CAAA;QAC3D,IAAI,CAAC,eAAe,CAAC,YAAY,GAAC,sBAAsB,CAAC,KAAK,CAAA;IAClE,CAAC;IACD,UAAU,CAAC,OAA0B;QACjC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;CACJ;AAhBD,sDAgBC;AAED,MAAa,kBAAkB;IAK3B;QAJI,yBAAoB,GAAC,IAAI,CAAA;QACzB,UAAK,GAAC,IAAI,CAAA;QACV,YAAO,GAAC,EAAE,CAAA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O,GAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;QACzC,IAAI,CAAC,IAAI,GAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAC,GAAG,CAAA;QAClC,OAAO,CAAC,GAAG,CAAC,OAAO,GAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QACxC,IAAI,CAAC,OAAO,GAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QACvC,IAAI,CAAC,IAAI,GAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAChC,CAAC;IACD,UAAU,CAAC,UAAiB;QACxB,IAAI,CAAC,OAAO,GAAC,UAAU,CAAA;IAC3B,CAAC;CACJ;AA9BD,sCA8BC"}
\ No newline at end of file
diff --git a/dist/dto/petDiary/PetDiaryPageResDto.js b/dist/dto/petDiary/PetDiaryPageResDto.js
new file mode 100644
index 0000000..270ceba
--- /dev/null
+++ b/dist/dto/petDiary/PetDiaryPageResDto.js
@@ -0,0 +1,67 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.FeelingListDto = exports.PetDiaryPageResDto = void 0;
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/FirstPartTableContents');
+const dateMethod = require('../../modules/dateMethod');
+class PetDiaryPageResDto {
+ constructor(petDiary) {
+ this.petDiary = {
+ _id: null,
+ //chapter:null,
+ episode: null,
+ title: null,
+ bookImg: [],
+ date: null,
+ contents: null,
+ timeTogether: null,
+ // kind: null,
+ feelingList: []
+ //feeling,kind,img
+ };
+ this.init(petDiary);
+ }
+ init(petDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.petDiary._id = petDiary._id;
+ //this.petDiaryPage.chapter=temp.chapter
+ this.petDiary.title = petDiary.title;
+ this.petDiary.bookImg = petDiary.imgs;
+ this.petDiary.date = yield dateMethod.toKoreanByFormatting(petDiary.date);
+ this.petDiary.episode = petDiary.episode;
+ this.petDiary.contents = petDiary.contents;
+ // this.petDiary.kind = petDiary.pets[0].kind
+ this.petDiary.timeTogether = yield dateMethod.getElapsedDay(petDiary.pets[0].startDate);
+ });
+ }
+ setFeelingList(feelingList) {
+ this.petDiary.feelingList.push(feelingList);
+ }
+}
+exports.PetDiaryPageResDto = PetDiaryPageResDto;
+class FeelingListDto {
+ constructor(pet) {
+ this.feeling = null;
+ this.kind = null;
+ this.petImgs = null;
+ this.kind = pet.kind;
+ this.petImgs = pet.imgs;
+ }
+ setFeeling(emotion) {
+ this.feeling = emotion.feeling;
+ }
+}
+exports.FeelingListDto = FeelingListDto;
+//# sourceMappingURL=PetDiaryPageResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/petDiary/PetDiaryPageResDto.js.map b/dist/dto/petDiary/PetDiaryPageResDto.js.map
new file mode 100644
index 0000000..4de9aed
--- /dev/null
+++ b/dist/dto/petDiary/PetDiaryPageResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetDiaryPageResDto.js","sourceRoot":"","sources":["../../../src/dto/petDiary/PetDiaryPageResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CA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IAC/C,CAAC;CAEJ;AAlCD,gDAkCC;AAED,MAAa,cAAc;IAIvB,YAAY,GAAQ;QAHR,YAAO,GAAC,IAAI,CAAA;QACZ,SAAI,GAAC,IAAI,CAAA;QACT,YAAO,GAAC,IAAI,CAAA;QAEpB,IAAI,CAAC,IAAI,GAAC,GAAG,CAAC,IAAI,CAAA;QAClB,IAAI,CAAC,OAAO,GAAC,GAAG,CAAC,IAAI,CAAA;IACzB,CAAC;IACD,UAAU,CAAC,OAAoB;QAC3B,IAAI,CAAC,OAAO,GAAC,OAAO,CAAC,OAAO,CAAA;IAChC,CAAC;CAKJ;AAfD,wCAeC"}
\ No newline at end of file
diff --git a/dist/dto/petDiary/SavePetResDto.js b/dist/dto/petDiary/SavePetResDto.js
new file mode 100644
index 0000000..a38ec22
--- /dev/null
+++ b/dist/dto/petDiary/SavePetResDto.js
@@ -0,0 +1,11 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SavePetResDto = void 0;
+class SavePetResDto {
+ constructor(petId) {
+ this.petId = [];
+ this.petId = petId;
+ }
+}
+exports.SavePetResDto = SavePetResDto;
+//# sourceMappingURL=SavePetResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/petDiary/SavePetResDto.js.map b/dist/dto/petDiary/SavePetResDto.js.map
new file mode 100644
index 0000000..238b79b
--- /dev/null
+++ b/dist/dto/petDiary/SavePetResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SavePetResDto.js","sourceRoot":"","sources":["../../../src/dto/petDiary/SavePetResDto.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IAGtB,YAAY,KAAK;QAFT,UAAK,GAAG,EAAE,CAAA;QAGd,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACtB,CAAC;CACJ;AAND,sCAMC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js b/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js
new file mode 100644
index 0000000..d1690d2
--- /dev/null
+++ b/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js
@@ -0,0 +1,70 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.HelpResDto = exports.MemoriesResDto2 = exports.MemoriesResDto = exports.RainbowMainPageResDto = void 0;
+class RainbowMainPageResDto {
+ constructor(book, isRainbowPet, rainbowButtonCheck) {
+ this.rainbowMainPage = {
+ title: null,
+ bookImg: null,
+ rainbowCheck: false,
+ memories: [],
+ help: []
+ };
+ this.rainbowMainPage.title = isRainbowPet ? "우리들의 무지개" : "무지개 준비하기"; //작가와 무지개다리를 건넌 동물의 이름 합친거
+ this.rainbowMainPage.bookImg = book.imgs;
+ this.rainbowMainPage.rainbowCheck = rainbowButtonCheck;
+ }
+ setMemories(memories) {
+ this.rainbowMainPage.memories = memories;
+ }
+ setHelp(helps) {
+ this.rainbowMainPage.help = helps;
+ }
+}
+exports.RainbowMainPageResDto = RainbowMainPageResDto;
+class MemoriesResDto {
+ constructor(petDiaries, petId) {
+ const diaryIndex = this.getRandomMemoryIndex(petDiaries.length);
+ const randomDiary = petDiaries[diaryIndex];
+ console.log('ccc : ' + petDiaries);
+ console.log('aaaa :' + randomDiary);
+ console.log('bbbb :' + diaryIndex);
+ console.log("랜덤된 petEmotion " + randomDiary.petEmotions.filter(petEmotion => petEmotion.pet == petId)[0]);
+ this.diaryId = randomDiary._id;
+ this.title = randomDiary.title;
+ this.contents = randomDiary.contents;
+ this.date = randomDiary.date;
+ this.feeling = randomDiary.petEmotions.filter(petEmotion => petEmotion.pet == petId)[0].feeling;
+ this.kind = randomDiary.petEmotions.filter(PetEmotions => PetEmotions.pet == petId)[0].pet.kind;
+ console.log('kind : ' + randomDiary.petEmotions.filter(PetEmotions => PetEmotions.pet == petId)[0]);
+ }
+ getRandomMemoryIndex(max) {
+ let min = Math.ceil(0);
+ max = Math.floor(max);
+ return Math.floor(Math.random() * (max - min)) + min;
+ }
+}
+exports.MemoriesResDto = MemoriesResDto;
+class MemoriesResDto2 {
+ constructor(petDiary, findPet) {
+ console.log('petId : ' + findPet);
+ this.diaryId = petDiary._id;
+ this.title = petDiary.title;
+ this.contents = petDiary.contents;
+ this.date = petDiary.date;
+ console.log('petDiary : ' + petDiary);
+ console.log('pet : ' + petDiary.petEmotions.filter(petEmotions => petEmotions.pet._id == findPet._id));
+ this.feeling = petDiary.petEmotions[0].feeling;
+ this.kind = findPet.kind;
+ }
+}
+exports.MemoriesResDto2 = MemoriesResDto2;
+class HelpResDto {
+ constructor(help) {
+ this.classification = help.classification;
+ this.title = help.title;
+ this.url = help.url;
+ }
+}
+exports.HelpResDto = HelpResDto;
+//# sourceMappingURL=RainbowMainPageResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js.map b/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js.map
new file mode 100644
index 0000000..9adcf38
--- /dev/null
+++ b/dist/dto/rainbow/mainPageDto/RainbowMainPageResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"RainbowMainPageResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/mainPageDto/RainbowMainPageResDto.ts"],"names":[],"mappings":";;;AAMA,MAAa,qBAAqB;IAS9B,YAAY,IAAW,EAAE,YAAqB,EAAE,kBAA2B;QARpE,oBAAe,GAAG;YACrB,KAAK,EAAE,IAAI;YACX,OAAO,EAAE,IAAI;YACb,YAAY,EAAE,KAAK;YACnB,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX,CAAA;QAGG,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAA,CAAA,0BAA0B;QAC7F,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;QACxC,IAAI,CAAC,eAAe,CAAC,YAAY,GAAG,kBAAkB,CAAA;IAC1D,CAAC;IAED,WAAW,CAAC,QAA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AG,OAAO,CAAC,IAAI,CAAA;IAC5B,CAAC;CACJ;AApBD,0CAoBC;AAED,MAAa,UAAU;IAKnB,YAAY,IAAW;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;IACxB,CAAC;CACJ;AAVD,gCAUC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/partingDto/PartingRainbowResDto.js b/dist/dto/rainbow/partingDto/PartingRainbowResDto.js
new file mode 100644
index 0000000..b686a53
--- /dev/null
+++ b/dist/dto/rainbow/partingDto/PartingRainbowResDto.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PartingRainbowResDto = void 0;
+class PartingRainbowResDto {
+ constructor(diaryCount, pet) {
+ this.partingRainbowBridge = {
+ contents: "",
+ diaryCount: 0,
+ };
+ let petName = pet.kind == 1 ? "고양이" : "강아지";
+ this.partingRainbowBridge.contents = `작가님과 함께했던 ${diaryCount}화의 이야기 속에서 \n${pet.name}는(은) 의젓하고 당당한 ${petName}로서 \n행복한 인생을 보낼 수 있었어요. \n그리고 지금은 작가님보다 한 발 앞서서 \n먼저 무지개 다리로 가 친구들과 함께 \n작가님을 기다리기로 했습니다. \n\n그동안 행복한 일상을 선물해주셔서 감사합니다. \n${pet.name}이가 느꼈던 최고의 순간들을 모아봤어요.`,
+ this.partingRainbowBridge.diaryCount = diaryCount;
+ }
+}
+exports.PartingRainbowResDto = PartingRainbowResDto;
+//# sourceMappingURL=PartingRainbowResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/partingDto/PartingRainbowResDto.js.map b/dist/dto/rainbow/partingDto/PartingRainbowResDto.js.map
new file mode 100644
index 0000000..bc4ea01
--- /dev/null
+++ b/dist/dto/rainbow/partingDto/PartingRainbowResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PartingRainbowResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/partingDto/PartingRainbowResDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAM7B,YAAY,UAAmB,EAAE,GAAU;QALpC,yBAAoB,GAAG;YAC1B,QAAQ,EAAG,EAAE;YACb,UAAU,EAAG,CAAC;SACjB,CAAA;QAGG,IAAI,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;QAC3C,IAAI,CAAC,oBAAoB,CAAC,QAAQ,GAAE,aAAa,UAAU,gBAAgB,GAAG,CAAC,IAAI,iBAAiB,OAAO,6HAA6H,GAAG,CAAC,IAAI,wBAAwB;YACxQ,IAAI,CAAC,oBAAoB,CAAC,UAAU,GAAG,UAAU,CAAA;IACrD,CAAC;CACJ;AAXD,oDAWC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/PetInfoDto.js b/dist/dto/rainbow/petDto/PetInfoDto.js
new file mode 100644
index 0000000..708c1f9
--- /dev/null
+++ b/dist/dto/rainbow/petDto/PetInfoDto.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PetInfoDto = exports.PetsInfoDto = void 0;
+class PetsInfoDto {
+ constructor(petInfo) {
+ this.pets = [];
+ this.pets = petInfo;
+ }
+}
+exports.PetsInfoDto = PetsInfoDto;
+class PetInfoDto {
+ constructor(pet) {
+ this._id = null;
+ this.img = "";
+ this.name = "";
+ this.kind = null;
+ this._id = pet._id;
+ this.img = pet.imgs;
+ this.name = pet.name;
+ this.kind = pet.kind;
+ }
+}
+exports.PetInfoDto = PetInfoDto;
+//# sourceMappingURL=PetInfoDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/PetInfoDto.js.map b/dist/dto/rainbow/petDto/PetInfoDto.js.map
new file mode 100644
index 0000000..82a783c
--- /dev/null
+++ b/dist/dto/rainbow/petDto/PetInfoDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetInfoDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/petDto/PetInfoDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IAGpB,YAAY,OAAsB;QAF1B,SAAI,GAAG,EAAE,CAAA;QAGb,IAAI,CAAC,IAAI,GAAG,OAAO,CAAA;IACvB,CAAC;CACJ;AAND,kCAMC;AAED,MAAa,UAAU;IAMpB,YAAY,GAAU;QALd,QAAG,GAAG,IAAI,CAAA;QACV,QAAG,GAAG,EAAE,CAAA;QACR,SAAI,GAAG,EAAE,CAAA;QACT,SAAI,GAAI,IAAI,CAAA;QAGhB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,IAAc,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAc,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;IACxB,CAAC;CACH;AAZD,gCAYC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/PetNameResDto.js b/dist/dto/rainbow/petDto/PetNameResDto.js
new file mode 100644
index 0000000..af90f01
--- /dev/null
+++ b/dist/dto/rainbow/petDto/PetNameResDto.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.PetNameResDto = void 0;
+class PetNameResDto {
+ constructor(pet) {
+ this.name = pet.name;
+ }
+}
+exports.PetNameResDto = PetNameResDto;
+//# sourceMappingURL=PetNameResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/PetNameResDto.js.map b/dist/dto/rainbow/petDto/PetNameResDto.js.map
new file mode 100644
index 0000000..182475a
--- /dev/null
+++ b/dist/dto/rainbow/petDto/PetNameResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetNameResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/petDto/PetNameResDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAGtB,YAAY,GAAU;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;IACxB,CAAC;CACJ;AAND,sCAMC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/RainbowPetResDto.js b/dist/dto/rainbow/petDto/RainbowPetResDto.js
new file mode 100644
index 0000000..63e44c4
--- /dev/null
+++ b/dist/dto/rainbow/petDto/RainbowPetResDto.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.MyPetInfoResDto = exports.RainbowPetResDto = void 0;
+class RainbowPetResDto {
+ constructor(myPetInfoResDto) {
+ this.pet = [];
+ this.pet = myPetInfoResDto;
+ }
+}
+exports.RainbowPetResDto = RainbowPetResDto;
+class MyPetInfoResDto {
+ constructor(pet) {
+ this._id = pet._id;
+ this.name = pet.name;
+ this.img = pet.imgs;
+ }
+}
+exports.MyPetInfoResDto = MyPetInfoResDto;
+//# sourceMappingURL=RainbowPetResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/petDto/RainbowPetResDto.js.map b/dist/dto/rainbow/petDto/RainbowPetResDto.js.map
new file mode 100644
index 0000000..ce6a766
--- /dev/null
+++ b/dist/dto/rainbow/petDto/RainbowPetResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"RainbowPetResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/petDto/RainbowPetResDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAGzB,YAAY,eAAmC;QAFxC,QAAG,GAAG,EAAE,CAAA;QAGX,IAAI,CAAC,GAAG,GAAG,eAAe,CAAA;IAC9B,CAAC;CACJ;AAND,4CAMC;AAED,MAAa,eAAe;IAKxB,YAAY,GAAU;QAClB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;QAClB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,IAAI,CAAA;IACvB,CAAC;CACJ;AAVD,0CAUC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js b/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js
new file mode 100644
index 0000000..a323730
--- /dev/null
+++ b/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js
@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.BookInfoResDto = exports.ReadyPartingAndStartRecordResDto = void 0;
+class ReadyPartingAndStartRecordResDto {
+ constructor(diaryCount, dayTogether, bookInfo) {
+ this.diaryCount = 0;
+ this.dayTogether = 0;
+ this.bookInfo = {};
+ this.diaryCount = diaryCount;
+ this.dayTogether = dayTogether;
+ this.bookInfo = bookInfo;
+ }
+}
+exports.ReadyPartingAndStartRecordResDto = ReadyPartingAndStartRecordResDto;
+class BookInfoResDto {
+ constructor(book) {
+ this.title = null;
+ this.bookImg = null;
+ this.author = null;
+ console.log('!!!!! : ' + book);
+ this.title = book.title;
+ this.bookImg = book.imgs;
+ this.author = book.author;
+ }
+}
+exports.BookInfoResDto = BookInfoResDto;
+//# sourceMappingURL=ReadyPartingAndStartRecordResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js.map b/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js.map
new file mode 100644
index 0000000..8301faf
--- /dev/null
+++ b/dist/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ReadyPartingAndStartRecordResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,gCAAgC;IAKzC,YAAY,UAAmB,EAAE,WAAoB,EAAE,QAAyB;QAJhF,eAAU,GAAG,CAAC,CAAC;QACf,gBAAW,GAAG,CAAC,CAAC;QAChB,aAAQ,GAAG,EAAE,CAAA;QAGT,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;CACJ;AAVD,4EAUC;AAED,MAAa,cAAc;IAIvB,YAAY,IAAY;QAHxB,UAAK,GAAG,IAAI,CAAC;QACb,YAAO,GAAG,IAAI,CAAC;QACf,WAAM,GAAG,IAAI,CAAC;QAEV,OAAO,CAAC,GAAG,CAAC,UAAU,GAAC,IAAI,CAAC,CAAA;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,CAAC;CACJ;AAVD,wCAUC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js b/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js
new file mode 100644
index 0000000..1b55a62
--- /dev/null
+++ b/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js
@@ -0,0 +1,79 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TheBestMomentDiary = exports.TheBestMoment = exports.TheBestMomentPetInformation = exports.TheBestMomentsResDto = void 0;
+const dateMethod = require("../../../modules/dateMethod");
+class TheBestMomentsResDto {
+ constructor(timeTogether) {
+ this.pet = {};
+ this.theBestMoments = [];
+ this.timeTogether = {};
+ this.init(timeTogether);
+ }
+ init(timeTogether) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.timeTogether = `${(yield dateMethod.toStringByFormatting(timeTogether))} - ${yield dateMethod.toStringByFormatting(new Date())}`;
+ });
+ }
+ setTheBestMoment(theBestMoment) {
+ this.theBestMoments.push(theBestMoment);
+ }
+ setTheBestMomentPetInfo(petInfo) {
+ this.pet = petInfo;
+ }
+}
+exports.TheBestMomentsResDto = TheBestMomentsResDto;
+class TheBestMomentPetInformation {
+ constructor(pet) {
+ this.name = null;
+ this.kind = null;
+ this.name = pet.name;
+ this.kind = pet.kind;
+ }
+}
+exports.TheBestMomentPetInformation = TheBestMomentPetInformation;
+class TheBestMoment {
+ constructor(commentPerFeeling, theBestMomentDiary) {
+ this.comment = null;
+ this.feeling = null;
+ this.diaries = [];
+ this.comment = commentPerFeeling.comments;
+ this.feeling = commentPerFeeling.feeling;
+ this.diaries = theBestMomentDiary;
+ }
+}
+exports.TheBestMoment = TheBestMoment;
+class TheBestMomentDiary {
+ constructor(diaryPerFeeling) {
+ this.diaryId = null;
+ this.chapter = null;
+ this.episode = null;
+ this.title = null;
+ this.contents = null;
+ this.date = null;
+ this.init(diaryPerFeeling);
+ }
+ init(diaryPerFeeling) {
+ return __awaiter(this, void 0, void 0, function* () {
+ //console.log('!!!!!!!!!!!!!!!!!!!!!!!!! : ' + diaryPerFeeling)
+ if (diaryPerFeeling != undefined) {
+ this.diaryId = diaryPerFeeling._id;
+ this.chapter = diaryPerFeeling.tableContents.chapter;
+ this.episode = diaryPerFeeling.episode;
+ this.title = diaryPerFeeling.title;
+ this.contents = diaryPerFeeling.contents;
+ this.date = yield dateMethod.toStringByFormatting(diaryPerFeeling.date);
+ }
+ });
+ }
+}
+exports.TheBestMomentDiary = TheBestMomentDiary;
+//# sourceMappingURL=TheBestMomentResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js.map b/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js.map
new file mode 100644
index 0000000..940ed30
--- /dev/null
+++ b/dist/dto/rainbow/theBestMomentDto/TheBestMomentResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"TheBestMomentResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/theBestMomentDto/TheBestMomentResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAM,UAAU,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAEzD,MAAa,oBAAoB;IAK7B,YAAY,YAAmB;QAJvB,QAAG,GAAG,EAAE,CAAA;QACR,mBAAc,GAAG,EAAE,CAAA;QACnB,iBAAY,GAAG,EAAE,CAAA;QAGrB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAC3B,CAAC;IAEK,IAAI,CAAC,YAAmB;;YAC1B,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,MAAM,UAAU,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,MAAM,MAAM,UAAU,CAAC,oBAAoB,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAA;QACzI,CAAC;KAAA;IAED,gBAAgB,CAAC,aAA4B;QACzC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IAC3C,CAAC;IAED,uBAAuB,CAAC,OAAoC;QACxD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAA;IACtB,CAAC;CACJ;AApBD,oDAoBC;AAED,MAAa,2BAA2B;IAIpC,YAAY,GAAS;QAHb,SAAI,GAAG,IAAI,CAAA;QACX,SAAI,GAAG,IAAI,CAAA;QAGf,I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AA;CACJ;AAvBD,gDAuBC"}
\ No newline at end of file
diff --git a/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js b/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js
new file mode 100644
index 0000000..2e966cb
--- /dev/null
+++ b/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js
@@ -0,0 +1,26 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.TheBestMomentSubResDto = void 0;
+const dateMethod = require("../../../modules/dateMethod");
+class TheBestMomentSubResDto {
+ constructor(pet, theBestMoment) {
+ this.init(pet, theBestMoment);
+ }
+ init(pet, theBestMoment) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.rainbowComment = `작가님과 함께했던 ${yield dateMethod.getElapsedDay(pet.startDate)}일의 시간동안\n${pet.name}는 의젓하고 당당한 ${pet.name}으로써\n행복한 인생을 보낼 수 있었어요.\n이젠 ${pet.name}가 느꼇던 최고의 순간들을\n모아봤어요!`;
+ this.rainbowBestMoment = theBestMoment;
+ });
+ }
+}
+exports.TheBestMomentSubResDto = TheBestMomentSubResDto;
+//# sourceMappingURL=TheBestMomentSubResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js.map b/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js.map
new file mode 100644
index 0000000..f345301
--- /dev/null
+++ b/dist/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"TheBestMomentSubResDto.js","sourceRoot":"","sources":["../../../../src/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAM,UAAU,GAAI,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAE1D,MAAa,sBAAsB;IAI/B,YAAY,GAAS,EAAE,aAAoC;QACvD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;IACjC,CAAC;IAEK,IAAI,CAAC,GAAS,EAAE,aAAoC;;YACtD,IAAI,CAAC,cAAc,GAAG,aAAa,MAAM,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,YAAY,GAAG,CAAC,IAAI,cAAc,GAAG,CAAC,IAAI,+BAA+B,GAAG,CAAC,IAAI,wBAAwB,CAAA;YACzL,IAAI,CAAC,iBAAiB,GAAG,aAAa,CAAA;QAC1C,CAAC;KAAA;CACJ;AAZD,wDAYC"}
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartChapterListResDto.js b/dist/dto/secondPart/SecondPartChapterListResDto.js
new file mode 100644
index 0000000..6807958
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartChapterListResDto.js
@@ -0,0 +1,22 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SecondPartChapterList = exports.SecondPartChapterListResDto = void 0;
+class SecondPartChapterListResDto {
+ constructor(secondPartChapterList) {
+ this.tableContents = [];
+ this.tableContents = secondPartChapterList.map(chapter => new SecondPartChapterList(chapter));
+ }
+}
+exports.SecondPartChapterListResDto = SecondPartChapterListResDto;
+class SecondPartChapterList {
+ constructor(chapter) {
+ this._id = null;
+ this.chapter = null;
+ this.title = null;
+ this._id = chapter._id;
+ this.chapter = chapter.chapter;
+ this.title = chapter.title;
+ }
+}
+exports.SecondPartChapterList = SecondPartChapterList;
+//# sourceMappingURL=SecondPartChapterListResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartChapterListResDto.js.map b/dist/dto/secondPart/SecondPartChapterListResDto.js.map
new file mode 100644
index 0000000..7bfae40
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartChapterListResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SecondPartChapterListResDto.js","sourceRoot":"","sources":["../../../src/dto/secondPart/SecondPartChapterListResDto.ts"],"names":[],"mappings":";;;AAEA,MAAa,2BAA2B;IAGpC,YAAY,qBAAkD;QAFtD,kBAAa,GAA6B,EAAE,CAAA;QAGhD,IAAI,CAAC,aAAa,GAAG,qBAAqB,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CACpD,IAAI,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3C,CAAC;CACJ;AAPD,kEAOC;AAED,MAAa,qBAAqB;IAK9B,YAAY,OAAkC;QAJtC,QAAG,GAAG,IAAI,CAAA;QACV,YAAO,GAAG,IAAI,CAAA;QACd,UAAK,GAAG,IAAI,CAAA;QAGhB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IAC9B,CAAC;CACJ;AAVD,sDAUC"}
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js b/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js
new file mode 100644
index 0000000..746ceae
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js
@@ -0,0 +1,50 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SecondPartDiaries = exports.SecondPartDiariesOfMonth = exports.SecondPartDiariesOfMonthResDto = void 0;
+class SecondPartDiariesOfMonthResDto {
+ constructor(tableContents, secondPartyDiariesOfMonth) {
+ this._id = null;
+ this.chapter = null;
+ this.chapterTitle = null;
+ this.diariesOfMonth = null;
+ this._id = tableContents._id;
+ this.chapter = tableContents.chapter;
+ this.chapterTitle = tableContents.title;
+ this.diariesOfMonth = secondPartyDiariesOfMonth;
+ }
+}
+exports.SecondPartDiariesOfMonthResDto = SecondPartDiariesOfMonthResDto;
+class SecondPartDiariesOfMonth {
+ constructor(month, userDiaries) {
+ this.month = null;
+ this.diaryCountOfTableContents = null;
+ this.diaries = [];
+ this.month = month;
+ this.diaryCountOfTableContents = userDiaries.length;
+ this.diaries = userDiaries.sort((a, b) => b.date.getDate() - a.date.getDate()).map(diary => new SecondPartDiaries(diary));
+ }
+}
+exports.SecondPartDiariesOfMonth = SecondPartDiariesOfMonth;
+class SecondPartDiaries {
+ constructor(userDiary) {
+ this.diaryId = null;
+ this.days = null;
+ this.dayOfWeek = null;
+ this.feeling = null;
+ this.kind = null;
+ this.title = null;
+ this.contents = null;
+ this.img = null;
+ const weeks = ["일", "월", "화", "수", "목", "금", "토"];
+ this.diaryId = userDiary._id;
+ this.days = userDiary.date.getDate();
+ this.dayOfWeek = weeks[userDiary.date.getDay()];
+ this.feeling = userDiary.feeling;
+ this.kind = 0;
+ this.title = userDiary.title;
+ this.contents = userDiary.contents;
+ this.img = userDiary.imgs[0];
+ }
+}
+exports.SecondPartDiaries = SecondPartDiaries;
+//# sourceMappingURL=SecondPartDiariesOfMonthResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js.map b/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js.map
new file mode 100644
index 0000000..4ac306f
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartDiariesOfMonthResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SecondPartDiariesOfMonthResDto.js","sourceRoot":"","sources":["../../../src/dto/secondPart/SecondPartDiariesOfMonthResDto.ts"],"names":[],"mappings":";;;AAGA,MAAa,8BAA8B;IAMvC,YAAY,aAAwC,EAAE,yBAAsD;QALpG,QAAG,GAAG,IAAI,CAAA;Q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GAAG,EAAC,GAAG,EAAC,GAAG,CAAC,CAAA;QAC3C,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;QACpC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;QACb,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAA;QAC5B,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAA;QAClC,IAAI,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAChC,CAAC;CACJ;AArBD,8CAqBC"}
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartDiaryResDto.js b/dist/dto/secondPart/SecondPartDiaryResDto.js
new file mode 100644
index 0000000..08d0a3a
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartDiaryResDto.js
@@ -0,0 +1,49 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SecondPartDiaryResDto = void 0;
+require("../../models/user/User");
+require("../../models/book/Book");
+require("../../models/pet/Pet");
+require('../../models/tableContents/TableContents');
+require('../../models/tableContents/SecondPartTableContent');
+const dateMethod = require('../../modules/dateMethod');
+class SecondPartDiaryResDto {
+ constructor(userDiary) {
+ this.secondPartDiary = {
+ _id: null,
+ episode: null,
+ title: null,
+ diaryImg: [],
+ date: null,
+ contents: null,
+ feelingList: []
+ };
+ this.init(userDiary);
+ }
+ init(userDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.secondPartDiary._id = userDiary._id;
+ this.secondPartDiary.title = userDiary.title;
+ this.secondPartDiary.diaryImg = userDiary.imgs;
+ this.secondPartDiary.date = yield dateMethod.toKoreanByFormatting(userDiary.date);
+ this.secondPartDiary.episode = userDiary.episode;
+ this.secondPartDiary.contents = userDiary.contents;
+ this.secondPartDiary.feelingList[0] = {
+ kind: 0,
+ petImgs: null,
+ feeling: userDiary.feeling
+ };
+ });
+ }
+}
+exports.SecondPartDiaryResDto = SecondPartDiaryResDto;
+//# sourceMappingURL=SecondPartDiaryResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartDiaryResDto.js.map b/dist/dto/secondPart/SecondPartDiaryResDto.js.map
new file mode 100644
index 0000000..f8b03ae
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartDiaryResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SecondPartDiaryResDto.js","sourceRoot":"","sources":["../../../src/dto/secondPart/SecondPartDiaryResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACjC,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAC/B,OAAO,CAAC,0CAA0C,CAAC,CAAA;AACnD,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAa,qBAAqB;IAW9B,YAAY,SAAqB;QAV1B,oBAAe,GAAG;YACrB,GAAG,EAAE,IAAI;YACT,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,IAAI;YACX,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,EAAE;SAClB,CAAA;QAGG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACxB,CAAC;IACK,IAAI,CAAC,SAAqB;;YAC5B,IAAI,CAAC,eAAe,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,CAAA;YACxC,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,CAAA;YAC5C,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAA;YAC9C,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,MAAM,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YACjF,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAA;YAChD,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAA;YAClD,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,GAAC;gBAChC,IAAI,EAAC,CAAC;gBACN,OAAO,EAAC,IAAI;gBACZ,OAAO,EAAC,SAAS,CAAC,OAAO;aAC5B,CAAA;QACL,CAAC;KAAA;CACJ;AA3BD,sDA2BC"}
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartMainPageResDto.js b/dist/dto/secondPart/SecondPartMainPageResDto.js
new file mode 100644
index 0000000..b931f0b
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartMainPageResDto.js
@@ -0,0 +1,96 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.SecondPartMainPageFirstPartBook = exports.SecondPartMainPageTableContents = exports.SecondPartMainPageDiary = exports.SecondPartMainPageResDto = void 0;
+require('../../models/tableContents/SecondPartTableContent');
+const dateMethod = require('../../modules/dateMethod');
+class SecondPartMainPageResDto {
+ constructor(user, sortUserDiary) {
+ this.secondPartMainPage = {
+ //private author = null,
+ title: null,
+ bookImg: null,
+ diary: null,
+ tableContents: [],
+ firstPartBook: null,
+ nextEpisode: null
+ };
+ //this.author = user.book.author
+ this.secondPartMainPage.bookImg = user.book.imgs;
+ this.secondPartMainPage.title = user.book.title;
+ this.secondPartMainPage.tableContents = user.book.tableContents.secondPartTableContents.map(secondPartTableContents => new SecondPartMainPageTableContents(secondPartTableContents));
+ this.secondPartMainPage.firstPartBook = new SecondPartMainPageFirstPartBook(user.book);
+ this.setNextEpisode(sortUserDiary);
+ }
+ setDiary(diary) {
+ console.log('2222222 :', diary);
+ this.secondPartMainPage.diary = diary;
+ }
+ setNextEpisode(sortUserDiary) {
+ this.secondPartMainPage.nextEpisode = sortUserDiary.episode + 1;
+ }
+}
+exports.SecondPartMainPageResDto = SecondPartMainPageResDto;
+class SecondPartMainPageDiary {
+ constructor(chapter, sortUserDiary) {
+ this.episode = null;
+ this.title = null;
+ this.contents = null;
+ this.date = null;
+ this._id = null;
+ this.chapter = null;
+ //console.log("!!!!!",sortUserDiary)
+ this.init(chapter, sortUserDiary);
+ }
+ init(chapter, sortUserDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this._id = sortUserDiary._id;
+ this.episode = sortUserDiary.episode;
+ this.title = sortUserDiary.title;
+ this.contents = sortUserDiary.contents;
+ this.chapter = chapter;
+ this.date = yield dateMethod.toStringByFormatting(sortUserDiary.date);
+ });
+ }
+}
+exports.SecondPartMainPageDiary = SecondPartMainPageDiary;
+class SecondPartMainPageTableContents {
+ constructor(secondPartTableContents) {
+ this.chapter = null;
+ this.chapterTitle = null;
+ this.episodePerChapterCount = null;
+ this.chapterId = null;
+ this.chapter = secondPartTableContents.chapter;
+ this.chapterTitle = secondPartTableContents.title;
+ this.chapterId = secondPartTableContents._id;
+ this.episodePerChapterCount = secondPartTableContents.userDiary.length;
+ }
+}
+exports.SecondPartMainPageTableContents = SecondPartMainPageTableContents;
+class SecondPartMainPageFirstPartBook {
+ constructor(book) {
+ this.userId = null;
+ this.bookImg = null;
+ this.author = null;
+ this.date = null;
+ this.init(book);
+ }
+ init(book) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.userId = book._id;
+ this.bookImg = book.imgs;
+ this.author = book.author;
+ this.date = yield dateMethod.toStringByFormatting(book.date);
+ });
+ }
+}
+exports.SecondPartMainPageFirstPartBook = SecondPartMainPageFirstPartBook;
+//# sourceMappingURL=SecondPartMainPageResDto.js.map
\ No newline at end of file
diff --git a/dist/dto/secondPart/SecondPartMainPageResDto.js.map b/dist/dto/secondPart/SecondPartMainPageResDto.js.map
new file mode 100644
index 0000000..895f049
--- /dev/null
+++ b/dist/dto/secondPart/SecondPartMainPageResDto.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SecondPartMainPageResDto.js","sourceRoot":"","sources":["../../../src/dto/secondPart/SecondPartMainPageResDto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,OAAO,CAAC,mDAAmD,CAAC,CAAA;AAC5D,MAAM,UAAU,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAEtD,MAAa,wBAAwB;IAUjC,YAAY,IAAY,EAAE,aAA0B;QAT7C,uBAAkB,GAAC;YAC1B,wBAAwB;YACxB,KAAK,EAAC,IAAI;YACV,OAAO,EAAG,IAAI;YACd,KAAK,EAAG,IAAI;YACZ,aAAa,EAAE,EAAE;YACjB,aAAa,EAAG,IAAI;YACpB,WAAW,EAAG,IAAI;SACrB,CA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,IAAI,CAAC,IAAI,CAAC,CAAA;QAChE,CAAC;KAAA;CACJ;AAhBD,0EAgBC"}
\ No newline at end of file
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..432fd34
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,35 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const express_1 = __importDefault(require("express"));
+const app = express_1.default();
+const db_1 = __importDefault(require("./logger/db"));
+// Connect Database
+db_1.default();
+app.use(express_1.default.json());
+// Define Routes
+app.use('/api', require('./api/router/index'));
+// error handler
+app.use(function (err, req, res, next) {
+ // set locals, only providing error in development
+ res.locals.message = err.message;
+ res.locals.error = req.app.get("env") === "production" ? err : {};
+ // render the error page
+ res.status(err.status || 500);
+ res.render("error");
+});
+app
+ .listen(5000, () => {
+ console.log(`
+ ################################################
+ 🛡️ Server listening on port: 5000 🛡️
+ ################################################
+ `);
+})
+ .on("error", (err) => {
+ console.error(err);
+ process.exit(1);
+});
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/dist/index.js.map b/dist/index.js.map
new file mode 100644
index 0000000..388ab0f
--- /dev/null
+++ b/dist/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAC9B,MAAM,GAAG,GAAG,iBAAO,EAAE,CAAC;AACtB,qDAAoC;AAEpC,mBAAmB;AACnB,YAAS,EAAE,CAAC;AACZ,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAExB,gBAAgB;AAChB,GAAG,CAAC,GAAG,CAAC,MAAM,EAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAA;AAE7C,gBAAgB;AAChB,GAAG,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI;IACnC,kDAAkD;IAClD,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IACjC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAElE,wBAAwB;IACxB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;IAC9B,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACtB,CAAC,CAAC,CAAC;AAEH,GAAG;KACA,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;IACjB,OAAO,CAAC,GAAG,CAAC;;;;GAIb,CAAC,CAAC;AACH,CAAC,CAAC;KACD,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/interfaces/book/IBook.js b/dist/interfaces/book/IBook.js
new file mode 100644
index 0000000..750d35d
--- /dev/null
+++ b/dist/interfaces/book/IBook.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IBook.js.map
\ No newline at end of file
diff --git a/dist/interfaces/book/IBook.js.map b/dist/interfaces/book/IBook.js.map
new file mode 100644
index 0000000..aa0591d
--- /dev/null
+++ b/dist/interfaces/book/IBook.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IBook.js","sourceRoot":"","sources":["../../../src/interfaces/book/IBook.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/diary/IPetDiary.js b/dist/interfaces/diary/IPetDiary.js
new file mode 100644
index 0000000..efb2d5b
--- /dev/null
+++ b/dist/interfaces/diary/IPetDiary.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IPetDiary.js.map
\ No newline at end of file
diff --git a/dist/interfaces/diary/IPetDiary.js.map b/dist/interfaces/diary/IPetDiary.js.map
new file mode 100644
index 0000000..2bd1b44
--- /dev/null
+++ b/dist/interfaces/diary/IPetDiary.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IPetDiary.js","sourceRoot":"","sources":["../../../src/interfaces/diary/IPetDiary.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/diary/IPetEmotions.js b/dist/interfaces/diary/IPetEmotions.js
new file mode 100644
index 0000000..a7e1451
--- /dev/null
+++ b/dist/interfaces/diary/IPetEmotions.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IPetEmotions.js.map
\ No newline at end of file
diff --git a/dist/interfaces/diary/IPetEmotions.js.map b/dist/interfaces/diary/IPetEmotions.js.map
new file mode 100644
index 0000000..fe5177b
--- /dev/null
+++ b/dist/interfaces/diary/IPetEmotions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IPetEmotions.js","sourceRoot":"","sources":["../../../src/interfaces/diary/IPetEmotions.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/diary/IUserDiary.js b/dist/interfaces/diary/IUserDiary.js
new file mode 100644
index 0000000..e4e5240
--- /dev/null
+++ b/dist/interfaces/diary/IUserDiary.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IUserDiary.js.map
\ No newline at end of file
diff --git a/dist/interfaces/diary/IUserDiary.js.map b/dist/interfaces/diary/IUserDiary.js.map
new file mode 100644
index 0000000..0d7cff3
--- /dev/null
+++ b/dist/interfaces/diary/IUserDiary.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IUserDiary.js","sourceRoot":"","sources":["../../../src/interfaces/diary/IUserDiary.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/etc/IComments.js b/dist/interfaces/etc/IComments.js
new file mode 100644
index 0000000..a6ab680
--- /dev/null
+++ b/dist/interfaces/etc/IComments.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IComments.js.map
\ No newline at end of file
diff --git a/dist/interfaces/etc/IComments.js.map b/dist/interfaces/etc/IComments.js.map
new file mode 100644
index 0000000..cd64731
--- /dev/null
+++ b/dist/interfaces/etc/IComments.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IComments.js","sourceRoot":"","sources":["../../../src/interfaces/etc/IComments.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/etc/IHelp.js b/dist/interfaces/etc/IHelp.js
new file mode 100644
index 0000000..ae2cfc1
--- /dev/null
+++ b/dist/interfaces/etc/IHelp.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IHelp.js.map
\ No newline at end of file
diff --git a/dist/interfaces/etc/IHelp.js.map b/dist/interfaces/etc/IHelp.js.map
new file mode 100644
index 0000000..5cbcc4e
--- /dev/null
+++ b/dist/interfaces/etc/IHelp.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IHelp.js","sourceRoot":"","sources":["../../../src/interfaces/etc/IHelp.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/etc/IInstitution.js b/dist/interfaces/etc/IInstitution.js
new file mode 100644
index 0000000..1aadbc6
--- /dev/null
+++ b/dist/interfaces/etc/IInstitution.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IInstitution.js.map
\ No newline at end of file
diff --git a/dist/interfaces/etc/IInstitution.js.map b/dist/interfaces/etc/IInstitution.js.map
new file mode 100644
index 0000000..e0d79ea
--- /dev/null
+++ b/dist/interfaces/etc/IInstitution.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IInstitution.js","sourceRoot":"","sources":["../../../src/interfaces/etc/IInstitution.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/pet/IPet.js b/dist/interfaces/pet/IPet.js
new file mode 100644
index 0000000..ceb9c8b
--- /dev/null
+++ b/dist/interfaces/pet/IPet.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IPet.js.map
\ No newline at end of file
diff --git a/dist/interfaces/pet/IPet.js.map b/dist/interfaces/pet/IPet.js.map
new file mode 100644
index 0000000..4ad0dc8
--- /dev/null
+++ b/dist/interfaces/pet/IPet.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IPet.js","sourceRoot":"","sources":["../../../src/interfaces/pet/IPet.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/IFirstPartTableContents.js b/dist/interfaces/tableContents/IFirstPartTableContents.js
new file mode 100644
index 0000000..34f9ddb
--- /dev/null
+++ b/dist/interfaces/tableContents/IFirstPartTableContents.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IFirstPartTableContents.js.map
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/IFirstPartTableContents.js.map b/dist/interfaces/tableContents/IFirstPartTableContents.js.map
new file mode 100644
index 0000000..fc8df07
--- /dev/null
+++ b/dist/interfaces/tableContents/IFirstPartTableContents.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IFirstPartTableContents.js","sourceRoot":"","sources":["../../../src/interfaces/tableContents/IFirstPartTableContents.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/ISecondPartTableContents.js b/dist/interfaces/tableContents/ISecondPartTableContents.js
new file mode 100644
index 0000000..1e9e772
--- /dev/null
+++ b/dist/interfaces/tableContents/ISecondPartTableContents.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=ISecondPartTableContents.js.map
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/ISecondPartTableContents.js.map b/dist/interfaces/tableContents/ISecondPartTableContents.js.map
new file mode 100644
index 0000000..8b2dd82
--- /dev/null
+++ b/dist/interfaces/tableContents/ISecondPartTableContents.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ISecondPartTableContents.js","sourceRoot":"","sources":["../../../src/interfaces/tableContents/ISecondPartTableContents.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/ITableContents.js b/dist/interfaces/tableContents/ITableContents.js
new file mode 100644
index 0000000..f7ff167
--- /dev/null
+++ b/dist/interfaces/tableContents/ITableContents.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=ITableContents.js.map
\ No newline at end of file
diff --git a/dist/interfaces/tableContents/ITableContents.js.map b/dist/interfaces/tableContents/ITableContents.js.map
new file mode 100644
index 0000000..3178875
--- /dev/null
+++ b/dist/interfaces/tableContents/ITableContents.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ITableContents.js","sourceRoot":"","sources":["../../../src/interfaces/tableContents/ITableContents.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/interfaces/user/IUser.js b/dist/interfaces/user/IUser.js
new file mode 100644
index 0000000..6d13f68
--- /dev/null
+++ b/dist/interfaces/user/IUser.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=IUser.js.map
\ No newline at end of file
diff --git a/dist/interfaces/user/IUser.js.map b/dist/interfaces/user/IUser.js.map
new file mode 100644
index 0000000..b4ab6fd
--- /dev/null
+++ b/dist/interfaces/user/IUser.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IUser.js","sourceRoot":"","sources":["../../../src/interfaces/user/IUser.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/logger/db.js b/dist/logger/db.js
new file mode 100644
index 0000000..3d6940a
--- /dev/null
+++ b/dist/logger/db.js
@@ -0,0 +1,32 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const config_1 = __importDefault(require("../config"));
+const connectDB = () => __awaiter(void 0, void 0, void 0, function* () {
+ try {
+ yield mongoose_1.default.connect(config_1.default.mongoURI, {
+ useNewUrlParser: true,
+ useCreateIndex: true,
+ useUnifiedTopology: true,
+ });
+ console.log("Mongoose Connected ...");
+ }
+ catch (err) {
+ console.error(err.message);
+ process.exit(1);
+ }
+});
+exports.default = connectDB;
+//# sourceMappingURL=db.js.map
\ No newline at end of file
diff --git a/dist/logger/db.js.map b/dist/logger/db.js.map
new file mode 100644
index 0000000..8074f6e
--- /dev/null
+++ b/dist/logger/db.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"db.js","sourceRoot":"","sources":["../../src/logger/db.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAAgC;AAChC,uDAA+B;AAE/B,MAAM,SAAS,GAAG,GAAS,EAAE;IAC3B,IAAI;QACF,MAAM,kBAAQ,CAAC,OAAO,CAAC,gBAAM,CAAC,QAAQ,EAAE;YACtC,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;YACpB,kBAAkB,EAAE,IAAI;SACzB,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;KACvC;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,SAAS,CAAC"}
\ No newline at end of file
diff --git a/dist/models/book/Book.js b/dist/models/book/Book.js
new file mode 100644
index 0000000..b92d0da
--- /dev/null
+++ b/dist/models/book/Book.js
@@ -0,0 +1,35 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const BookSchema = new mongoose_1.default.Schema({
+ title: { type: String },
+ author: { type: String },
+ imgs: { type: String },
+ tableContents: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "TableContents"
+ },
+ date: {
+ type: Date,
+ default: Date.now()
+ }
+});
+BookSchema.methods.setTableContents = function (tableContents) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.tableContents = tableContents;
+ });
+};
+exports.default = mongoose_1.default.model("Book", BookSchema, "books");
+//# sourceMappingURL=Book.js.map
\ No newline at end of file
diff --git a/dist/models/book/Book.js.map b/dist/models/book/Book.js.map
new file mode 100644
index 0000000..f3048d9
--- /dev/null
+++ b/dist/models/book/Book.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Book.js","sourceRoot":"","sources":["../../../src/models/book/Book.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAI3C,MAAM,UAAU,GAA0B,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACvB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACxB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACtB,aAAa,EAAE;QACX,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACnC,GAAG,EAAE,eAAe;KACvB;IACD,IAAI,EAAG;QACH,IAAI,EAAG,IAAI;QACX,OAAO,EAAG,IAAI,CAAC,GAAG,EAAE;KACvB;CACJ,CAAC,CAAA;AACF,UAAU,CAAC,OAAO,CAAC,gBAAgB,GAAC,UAAe,aAA6B;;QAC5E,IAAI,CAAC,aAAa,GAAC,aAAa,CAAA;IACpC,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAA4B,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/diary/PetDiary.js b/dist/models/diary/PetDiary.js
new file mode 100644
index 0000000..2fd5b48
--- /dev/null
+++ b/dist/models/diary/PetDiary.js
@@ -0,0 +1,71 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const PetDiarySchema = new mongoose_1.default.Schema({
+ pets: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "Pet"
+ }
+ ],
+ tableContents: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "FirstPartTableContents"
+ },
+ title: {
+ type: String
+ },
+ contents: {
+ type: String
+ },
+ imgs: [
+ {
+ type: String,
+ default: []
+ }
+ ],
+ petEmotions: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "PetEmotions",
+ default: []
+ }
+ ],
+ episode: {
+ type: Number,
+ default: 0
+ },
+ date: {
+ type: Date,
+ default: Date.now()
+ }
+});
+PetDiarySchema.methods.setPet = function (pet) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.pets.push(pet);
+ });
+};
+PetDiarySchema.methods.setTableContents = function (tableContents) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.tableContents = tableContents;
+ });
+};
+PetDiarySchema.methods.setPetEmotions = function (petEmotions) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.petEmotions.push(petEmotions);
+ });
+};
+exports.default = mongoose_1.default.model("PetDiary", PetDiarySchema, "petDiaries");
+//# sourceMappingURL=PetDiary.js.map
\ No newline at end of file
diff --git a/dist/models/diary/PetDiary.js.map b/dist/models/diary/PetDiary.js.map
new file mode 100644
index 0000000..0d90339
--- /dev/null
+++ b/dist/models/diary/PetDiary.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetDiary.js","sourceRoot":"","sources":["../../../src/models/diary/PetDiary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAAwC;AAMxC,MAAM,cAAc,GAA8B,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAClE,I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ode 100644
index 0000000..16c257b
--- /dev/null
+++ b/dist/models/diary/PetEmotions.js
@@ -0,0 +1,36 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const PetEmotionsSchema = new mongoose_1.default.Schema({
+ petDiary: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "PetDiary"
+ },
+ pet: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "Pet"
+ },
+ feeling: {
+ type: Number,
+ default: 0
+ }
+});
+PetEmotionsSchema.methods.setPetDiary = function (petDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.petDiary = petDiary;
+ });
+};
+exports.default = mongoose_1.default.model("PetEmotions", PetEmotionsSchema, "petEmotions");
+//# sourceMappingURL=PetEmotions.js.map
\ No newline at end of file
diff --git a/dist/models/diary/PetEmotions.js.map b/dist/models/diary/PetEmotions.js.map
new file mode 100644
index 0000000..4f2642e
--- /dev/null
+++ b/dist/models/diary/PetEmotions.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PetEmotions.js","sourceRoot":"","sources":["../../../src/models/diary/PetEmotions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAI3C,MAAM,iBAAiB,GAAiC,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACxE,QAAQ,EAAE;QACN,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACnC,GAAG,EAAE,UAAU;KAClB;IACD,GAAG,EAAE;QACD,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACnC,GAAG,EAAE,KAAK;KACb;IACD,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,OAAO,EAAG,CAAC;KACd;CACJ,CAAC,CAAA;AAEF,iBAAiB,CAAC,OAAO,CAAC,WAAW,GAAG,UAAgB,QAAmB;;QACvE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC5B,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAA0C,aAAa,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/diary/UserDiary.js b/dist/models/diary/UserDiary.js
new file mode 100644
index 0000000..b80ef25
--- /dev/null
+++ b/dist/models/diary/UserDiary.js
@@ -0,0 +1,45 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const UserDiarySchema = new mongoose_1.default.Schema({
+ title: { type: String },
+ contents: { type: String },
+ imgs: [
+ {
+ type: String,
+ default: []
+ }
+ ],
+ feeling: { type: Number },
+ tableContents: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "SecondPartTableContents"
+ },
+ episode: {
+ type: Number,
+ default: 0
+ },
+ date: {
+ type: Date,
+ default: Date.now()
+ }
+});
+UserDiarySchema.methods.setTableContents = function (tableContents) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.tableContents = tableContents;
+ });
+};
+exports.default = mongoose_1.default.model("UserDiary", UserDiarySchema, "userDiaries");
+//# sourceMappingURL=UserDiary.js.map
\ No newline at end of file
diff --git a/dist/models/diary/UserDiary.js.map b/dist/models/diary/UserDiary.js.map
new file mode 100644
index 0000000..8b29f8e
--- /dev/null
+++ b/dist/models/diary/UserDiary.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"UserDiary.js","sourceRoot":"","sources":["../../../src/models/diary/UserDiary.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAAwC;AAIxC,MAAM,eAAe,GAAgC,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACrE,KAAK,EAAG,EAAE,IAAI,EAAG,MAAM,EAAC;IACxB,QAAQ,EAAG,EAAC,IAAI,EAAG,MAAM,EAAC;IAC1B,IAAI,EAAG;QACH;YACI,IAAI,EAAG,MAAM;YACb,OAAO,EAAG,EAAE;SACf;KACJ;IACD,OAAO,EAAG,EAAC,IAAI,EAAG,MAAM,EAAC;IACzB,aAAa,EAAG;QACZ,IAAI,EAAG,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACpC,GAAG,EAAG,yBAAyB;KAClC;IACD,OAAO,EAAG;QACN,IAAI,EAAG,MAAM;QACb,OAAO,EAAG,CAAC;KACd;IACD,IAAI,EAAG;QACH,IAAI,EAAG,IAAI;QACX,OAAO,EAAG,IAAI,CAAC,GAAG,EAAE;KACvB;CACJ,CAAC,CAAA;AAEF,eAAe,CAAC,OAAO,CAAC,gBAAgB,GAAG,UAAe,aAAwC;;QAC9F,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;IACtC,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAAsC,WAAW,EAAC,eAAe,EAAC,aAAa,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/etc/Comments.js b/dist/models/etc/Comments.js
new file mode 100644
index 0000000..1c1c9c7
--- /dev/null
+++ b/dist/models/etc/Comments.js
@@ -0,0 +1,13 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const CommentsSchema = new mongoose_1.default.Schema({
+ feeling: { type: Number },
+ comments: { type: String },
+ classification: { type: Number }
+});
+exports.default = mongoose_1.default.model("Comments", CommentsSchema, "comments");
+//# sourceMappingURL=Comments.js.map
\ No newline at end of file
diff --git a/dist/models/etc/Comments.js.map b/dist/models/etc/Comments.js.map
new file mode 100644
index 0000000..9c60ce1
--- /dev/null
+++ b/dist/models/etc/Comments.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Comments.js","sourceRoot":"","sources":["../../../src/models/etc/Comments.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAG3C,MAAM,cAAc,GAA8B,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAClE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAC1B,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CACnC,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAAoC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/etc/Help.js b/dist/models/etc/Help.js
new file mode 100644
index 0000000..7c2c85f
--- /dev/null
+++ b/dist/models/etc/Help.js
@@ -0,0 +1,13 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const HelpSchema = new mongoose_1.default.Schema({
+ classification: { type: String },
+ title: { type: String },
+ url: { type: String }
+});
+exports.default = mongoose_1.default.model("Help", HelpSchema, "helps");
+//# sourceMappingURL=Help.js.map
\ No newline at end of file
diff --git a/dist/models/etc/Help.js.map b/dist/models/etc/Help.js.map
new file mode 100644
index 0000000..11e528c
--- /dev/null
+++ b/dist/models/etc/Help.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Help.js","sourceRoot":"","sources":["../../../src/models/etc/Help.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAG3C,MAAM,UAAU,GAA0B,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC1D,cAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAChC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACvB,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CACxB,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAA4B,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/etc/Institution.js b/dist/models/etc/Institution.js
new file mode 100644
index 0000000..7a14085
--- /dev/null
+++ b/dist/models/etc/Institution.js
@@ -0,0 +1,14 @@
+"use strict";
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const InstitutionSchema = new mongoose_1.default.Schema({
+ feeling: { type: Number },
+ type: { type: Number },
+ contents: { type: String },
+ url: { type: String }
+});
+exports.default = mongoose_1.default.model("Institutions", InstitutionSchema, "institutions");
+//# sourceMappingURL=Institution.js.map
\ No newline at end of file
diff --git a/dist/models/etc/Institution.js.map b/dist/models/etc/Institution.js.map
new file mode 100644
index 0000000..90bbed8
--- /dev/null
+++ b/dist/models/etc/Institution.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Institution.js","sourceRoot":"","sources":["../../../src/models/etc/Institution.ts"],"names":[],"mappings":";;;;;AAAA,wDAAwC;AAGxC,MAAM,iBAAiB,GAAiC,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACxE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACzB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACtB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAC1B,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CACxB,CAAC,CAAA;AAEF,kBAAe,kBAAQ,CAAC,KAAK,CAA0C,cAAc,EAAC,iBAAiB,EAAC,cAAc,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/pet/Pet.js b/dist/models/pet/Pet.js
new file mode 100644
index 0000000..abf6056
--- /dev/null
+++ b/dist/models/pet/Pet.js
@@ -0,0 +1,50 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const PetSchema = new mongoose_1.default.Schema({
+ name: { type: String },
+ kind: { type: Number },
+ gender: { type: Number },
+ imgs: {
+ type: String
+ },
+ user: {
+ type: mongoose_1.default.SchemaTypes.ObjectId, ref: "User"
+ },
+ book: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "Book:"
+ },
+ rainbow: {
+ type: Boolean,
+ default: false
+ },
+ startDate: {
+ type: Date,
+ default: Date.now()
+ }
+});
+PetSchema.methods.setUser = function (user) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.user = user;
+ });
+};
+PetSchema.methods.setBook = function (book) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.book = book;
+ });
+};
+exports.default = mongoose_1.default.model("Pet", PetSchema, "pets");
+//# sourceMappingURL=Pet.js.map
\ No newline at end of file
diff --git a/dist/models/pet/Pet.js.map b/dist/models/pet/Pet.js.map
new file mode 100644
index 0000000..59aca84
--- /dev/null
+++ b/dist/models/pet/Pet.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Pet.js","sourceRoot":"","sources":["../../../src/models/pet/Pet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAK3C,MAAM,SAAS,GAAyB,IAAI,kBAAQ,CAAC,MAAM,CAAC;IACxD,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACtB,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACtB,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACxB,IAAI,EAAE;QACF,IAAI,EAAE,MAAM;KACf;IACD,IAAI,EAAE;QACF,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM;KACnD;IACD,IAAI,EAAE;QACF,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACnC,GAAG,EAAE,OAAO;KACf;IACD,OAAO,EAAE;QACL,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,KAAK;KACjB;IACD,SAAS,EAAE;QACP,IAAI,EAAE,IAAI;QACV,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE;KACtB;CACJ,CAAC,CAAA;AAGF,SAAS,CAAC,OAAO,CAAC,OAAO,GAAG,UAAgB,IAAW;;QACnD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;CAAA,CAAA;AAED,SAAS,CAAC,OAAO,CAAC,OAAO,GAAG,UAAgB,IAAW;;QACnD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAA0B,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/tableContents/FirstPartTableContents.js b/dist/models/tableContents/FirstPartTableContents.js
new file mode 100644
index 0000000..2086c12
--- /dev/null
+++ b/dist/models/tableContents/FirstPartTableContents.js
@@ -0,0 +1,42 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const FirstPartTableContentsSchema = new mongoose_1.default.Schema({
+ chapter: {
+ type: Number,
+ default: 0
+ },
+ title: {
+ type: String
+ },
+ contents: {
+ type: String,
+ default: null
+ },
+ petDiary: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "PetDiary",
+ default: []
+ }
+ ]
+});
+FirstPartTableContentsSchema.methods.setPetDiary = function (petDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.petDiary.push(petDiary);
+ });
+};
+exports.default = mongoose_1.default.model("FirstPartTableContents", FirstPartTableContentsSchema, "firstPartTableContents");
+//# sourceMappingURL=FirstPartTableContents.js.map
\ No newline at end of file
diff --git a/dist/models/tableContents/FirstPartTableContents.js.map b/dist/models/tableContents/FirstPartTableContents.js.map
new file mode 100644
index 0000000..f64a92b
--- /dev/null
+++ b/dist/models/tableContents/FirstPartTableContents.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"FirstPartTableContents.js","sourceRoot":"","sources":["../../../src/models/tableContents/FirstPartTableContents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAI3C,MAAM,4BAA4B,GAA4C,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC9F,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,OAAO,EAAG,CAAC;KACd;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;KACf;IACD,QAAQ,EAAE;QACN,IAAI,EAAE,MAAM;QACZ,OAAO,EAAG,IAAI;KACjB;IACD,QAAQ,EAAE;QACN;YACI,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;YACnC,GAAG,EAAE,UAAU;YACf,OAAO,EAAG,EAAE;SACf;KACJ;CACJ,CAAC,CAAA;AAEF,4BAA4B,CAAC,OAAO,CAAC,WAAW,GAAG,UAAgB,QAAmB;;QAClF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAChC,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAAgE,wBAAwB,EAAE,4BAA4B,EAAE,wBAAwB,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/tableContents/SecondPartTableContent.js b/dist/models/tableContents/SecondPartTableContent.js
new file mode 100644
index 0000000..86479ad
--- /dev/null
+++ b/dist/models/tableContents/SecondPartTableContent.js
@@ -0,0 +1,43 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const SecondPartTableContentsSchema = new mongoose_1.default.Schema({
+ chapter: {
+ type: Number,
+ default: 0
+ },
+ title: {
+ type: String,
+ default: null
+ },
+ contents: {
+ type: String,
+ default: null
+ },
+ userDiary: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "UserDiary",
+ default: []
+ }
+ ]
+});
+SecondPartTableContentsSchema.methods.setUserDiary = function (userDiary) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.userDiary.push(userDiary);
+ });
+};
+exports.default = mongoose_1.default.model("SecondPartTableContents", SecondPartTableContentsSchema, "secondPartTableContents");
+//# sourceMappingURL=SecondPartTableContent.js.map
\ No newline at end of file
diff --git a/dist/models/tableContents/SecondPartTableContent.js.map b/dist/models/tableContents/SecondPartTableContent.js.map
new file mode 100644
index 0000000..e40e3b0
--- /dev/null
+++ b/dist/models/tableContents/SecondPartTableContent.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"SecondPartTableContent.js","sourceRoot":"","sources":["../../../src/models/tableContents/SecondPartTableContent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAI3C,MAAM,6BAA6B,GAA6C,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAChG,OAAO,EAAE;QACL,IAAI,EAAE,MAAM;QACZ,OAAO,EAAG,CAAC;KACd;IACD,KAAK,EAAE;QACH,IAAI,EAAE,MAAM;QACZ,OAAO,EAAG,IAAI;KACjB;IACD,QAAQ,EAAG;QACP,IAAI,EAAG,MAAM;QACb,OAAO,EAAG,IAAI;KACjB;IACD,SAAS,EAAE;QACP;YACI,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;YACnC,GAAG,EAAE,WAAW;YAChB,OAAO,EAAE,EAAE;SACd;KACJ;CACJ,CAAC,CAAA;AAEF,6BAA6B,CAAC,OAAO,CAAC,YAAY,GAAG,UAAgB,SAAqB;;QACtF,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAClC,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAAkE,yBAAyB,EAAE,6BAA6B,EAAE,yBAAyB,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/tableContents/TableContents.js b/dist/models/tableContents/TableContents.js
new file mode 100644
index 0000000..266806e
--- /dev/null
+++ b/dist/models/tableContents/TableContents.js
@@ -0,0 +1,47 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const TableContentsSchema = new mongoose_1.default.Schema({
+ firstPartTableContents: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "FirstPartTableContents",
+ default: []
+ }
+ ],
+ secondPartTableContents: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "SecondPartTableContents",
+ default: []
+ }
+ ],
+ secondPartStartDate: {
+ type: Date,
+ default: Date.now()
+ }
+});
+TableContentsSchema.methods.setFirstPartTableContents = function (tableContents) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.firstPartTableContents.push(tableContents);
+ });
+};
+TableContentsSchema.methods.setSecondPartTableContents = function (tableContents) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.secondPartTableContents.push(tableContents);
+ });
+};
+exports.default = mongoose_1.default.model("TableContents", TableContentsSchema, "tableContents");
+//# sourceMappingURL=TableContents.js.map
\ No newline at end of file
diff --git a/dist/models/tableContents/TableContents.js.map b/dist/models/tableContents/TableContents.js.map
new file mode 100644
index 0000000..083ef68
--- /dev/null
+++ b/dist/models/tableContents/TableContents.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"TableContents.js","sourceRoot":"","sources":["../../../src/models/tableContents/TableContents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAK3C,MAAM,mBAAmB,GAAmC,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC5E,sBAAsB,EAAE;QACpB;YACI,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;YACnC,GAAG,EAAE,wBAAwB;YAC7B,OAAO,EAAC,EAAE;SACb;KACJ;IACD,uBAAuB,EAAE;QACrB;YACI,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;YACnC,GAAG,EAAE,yBAAyB;YAC9B,OAAO,EAAC,EAAE;SACb;KACJ;IACD,mBAAmB,EAAG;QAClB,IAAI,EAAG,IAAI;QACX,OAAO,EAAG,IAAI,CAAC,GAAG,EAAE;KACvB;CACJ,CAAC,CAAA;AAEF,mBAAmB,CAAC,OAAO,CAAC,yBAAyB,GAAG,UAAgB,aAAsC;;QAC1G,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACnD,CAAC;CAAA,CAAA;AAED,mBAAmB,CAAC,OAAO,CAAC,0BAA0B,GAAG,UAAgB,aAAuC;;QAC5G,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACpD,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAA8C,eAAe,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/models/user/User.js b/dist/models/user/User.js
new file mode 100644
index 0000000..8d31938
--- /dev/null
+++ b/dist/models/user/User.js
@@ -0,0 +1,42 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __importDefault = (this && this.__importDefault) || function (mod) {
+ return (mod && mod.__esModule) ? mod : { "default": mod };
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+const mongoose_1 = __importDefault(require("mongoose"));
+const UserSchema = new mongoose_1.default.Schema({
+ email: { type: String },
+ password: { type: String },
+ pets: [
+ {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "Pet",
+ }
+ ],
+ book: {
+ type: mongoose_1.default.SchemaTypes.ObjectId,
+ ref: "Book",
+ },
+ feelingCount: { type: Number }
+});
+UserSchema.methods.setPet = function (pet) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.pets.push(pet);
+ });
+};
+UserSchema.methods.setBook = function (book) {
+ return __awaiter(this, void 0, void 0, function* () {
+ this.book = book;
+ });
+};
+exports.default = mongoose_1.default.model("User", UserSchema, "users");
+//# sourceMappingURL=User.js.map
\ No newline at end of file
diff --git a/dist/models/user/User.js.map b/dist/models/user/User.js.map
new file mode 100644
index 0000000..7e60227
--- /dev/null
+++ b/dist/models/user/User.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/models/user/User.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,wDAA2C;AAK3C,MAAM,UAAU,GAA0B,IAAI,kBAAQ,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IACvB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;IAC1B,IAAI,EAAE;QACF;YACI,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;YACnC,GAAG,EAAE,KAAK;SACb;KACJ;IACD,IAAI,EAAE;QACF,IAAI,EAAE,kBAAQ,CAAC,WAAW,CAAC,QAAQ;QACnC,GAAG,EAAE,MAAM;KACd;IACD,YAAY,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;CACjC,CAAC,CAAA;AAEF,UAAU,CAAC,OAAO,CAAC,MAAM,GAAG,UAAgB,GAAS;;QACjD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACvB,CAAC;CAAA,CAAA;AAED,UAAU,CAAC,OAAO,CAAC,OAAO,GAAG,UAAgB,IAAW;;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IACpB,CAAC;CAAA,CAAA;AAED,kBAAe,kBAAQ,CAAC,KAAK,CAA4B,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/comment.js b/dist/modules/comment.js
new file mode 100644
index 0000000..f63ace4
--- /dev/null
+++ b/dist/modules/comment.js
@@ -0,0 +1,31 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+module.exports = {
+ loveFeeling: (name) => __awaiter(this, void 0, void 0, function* () {
+ return `작가님과 함께하면서 ${name}(이)는 많은 사랑을 받았고, 또 주었어요.
+ ${name}(이)가 사랑을 느꼈던 순간들이예요. ${name}(이)에게 사랑을 알려주셔서 감사합니다.`;
+ }),
+ happyFeeling: (name) => __awaiter(this, void 0, void 0, function* () {
+ return `맛있는 간식을 먹거나 재미있는 놀이를 할 때, 작가님은 ${name}(이)를 행복하게 해주려고 매순간 노력했어요. 이런 작가님과 함께한 매일매일이 ${name}(이)에겐 기쁜 순간이었습니다. `;
+ }),
+ normalFeeling: () => __awaiter(this, void 0, void 0, function* () {
+ return `매일 색다른 모험을 하지 않아도 좋아요. 평화롭던 보통의 날들도 아름다운 추억으로 여기 남아 있습니다.`;
+ }),
+ angryFeeling: (name) => __awaiter(this, void 0, void 0, function* () {
+ return `평화롭고 행복한 날들만이 의미있는 것은 아니죠. 때로는 화도 냈고, 투정도 부렸어요. 그 과정에서 ${name}(이)는 다양한 감정을 배우는 어른 고양이로 성장할 수 있었습니다.`;
+ }),
+ gloomyFeeling: () => __awaiter(this, void 0, void 0, function* () {
+ return `때로는 어두운 그늘에 있던 때도 있었지만, 그 덕분에 강한 햇볕을 피해 감정의 휴식을 취할 수 있었어요.`;
+ }),
+ boringFeeling: () => __awaiter(this, void 0, void 0, function* () {
+ return `매일 즐겁지는 않았지만, 그 덕에 고민 걱정 없는 심심한 날들을 보낼 수도 있었어요. 평화로운 나날들을 선물해주셔서 감사합니다.`;
+ })
+};
+//# sourceMappingURL=comment.js.map
\ No newline at end of file
diff --git a/dist/modules/comment.js.map b/dist/modules/comment.js.map
new file mode 100644
index 0000000..2d2ca60
--- /dev/null
+++ b/dist/modules/comment.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/modules/comment.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,CAAC,OAAO,GAAG;IACb,WAAW,EAAE,CAAO,IAAY,EAAE,EAAE;QAChC,OAAO,cAAc,IAAI;UACvB,IAAI,wBAAwB,IAAI,wBAAwB,CAAA;IAC9D,CAAC,CAAA;IACD,YAAY,EAAE,CAAO,IAAY,EAAE,EAAE;QACjC,OAAO,kCAAkC,IAAI,+CAA+C,IAAI,oBAAoB,CAAA;IACxH,CAAC,CAAA;IACD,aAAa,EAAE,GAAS,EAAE;QACtB,OAAO,2DAA2D,CAAA;IACtE,CAAC,CAAA;IACD,YAAY,EAAE,CAAO,IAAY,EAAE,EAAE;QACjC,OAAO,0DAA0D,IAAI,uCAAuC,CAAA;IAChH,CAAC,CAAA;IACD,aAAa,EAAE,GAAS,EAAE;QACtB,OAAO,4DAA4D,CAAA;IACvE,CAAC,CAAA;IACD,aAAa,EAAE,GAAS,EAAE;QACtB,OAAO,yEAAyE,CAAA;IACpF,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/dateMethod.js b/dist/modules/dateMethod.js
new file mode 100644
index 0000000..9fcd579
--- /dev/null
+++ b/dist/modules/dateMethod.js
@@ -0,0 +1,51 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+module.exports = {
+ toStringByFormatting: (source) => __awaiter(this, void 0, void 0, function* () {
+ const year = source.getFullYear();
+ const month = leftPad(source.getMonth() + 1);
+ const day = leftPad(source.getDate());
+ return [year, month, day].join('.');
+ function leftPad(value) {
+ if (value >= 10) {
+ return value;
+ }
+ return `0${value}`;
+ }
+ }),
+ toKoreanByFormatting: (source) => __awaiter(this, void 0, void 0, function* () {
+ const year = source.getFullYear();
+ const month = leftPad(source.getMonth() + 1);
+ const day = leftPad(source.getDate());
+ return year + "년 " + month + "월 " + day + "일";
+ function leftPad(value) {
+ if (value >= 10) {
+ return value;
+ }
+ return `0${value}`;
+ }
+ }),
+ getElapsedDay: (startDate) => __awaiter(this, void 0, void 0, function* () {
+ const now = new Date();
+ const year = now.getFullYear();
+ const month = now.getMonth();
+ const day = now.getDate();
+ startDate = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
+ const endDate = new Date(year, month, day);
+ const elapsedMs = endDate.getTime() - startDate.getTime();
+ const elapsedDay = elapsedMs / (1000 * 60 * 60 * 24);
+ return elapsedDay;
+ }),
+ getLastDateOfMonth: (year, month) => __awaiter(this, void 0, void 0, function* () {
+ const lastDate = new Date(year, month, 0);
+ return lastDate.getDate();
+ })
+};
+//# sourceMappingURL=dateMethod.js.map
\ No newline at end of file
diff --git a/dist/modules/dateMethod.js.map b/dist/modules/dateMethod.js.map
new file mode 100644
index 0000000..1ad0e0f
--- /dev/null
+++ b/dist/modules/dateMethod.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"dateMethod.js","sourceRoot":"","sources":["../../src/modules/dateMethod.ts"],"names":[],"mappings":";;;;;;;;;AAAA,MAAM,CAAC,OAAO,GAAG;IACb,oBAAoB,EAAG,CAAM,MAAM,EAAE,EAAE;QACnC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAA;QACjC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;QAC7C,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;QAErC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAA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G,SAAS,CAAC,OAAO,EAAE,CAAA;QACzD,MAAM,UAAU,GAAG,SAAS,GAAG,CAAC,IAAI,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,CAAC,CAAA;QAE9C,OAAO,UAAU,CAAA;IACrB,CAAC,CAAA;IAED,kBAAkB,EAAG,CAAM,IAAI,EAAE,KAAK,EAAC,EAAE;QACrC,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,IAAI,EAAC,KAAK,EAAC,CAAC,CAAC,CAAA;QACvC,OAAO,QAAQ,CAAC,OAAO,EAAE,CAAA;IAC7B,CAAC,CAAA;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/multer.js b/dist/modules/multer.js
new file mode 100644
index 0000000..f708768
--- /dev/null
+++ b/dist/modules/multer.js
@@ -0,0 +1,17 @@
+const multer = require('multer');
+const multerS3 = require('multer-s3');
+const aws = require('aws-sdk');
+aws.config.loadFromPath(__dirname + '/../config/s3.json');
+const s3 = new aws.S3();
+var upload = multer({
+ storage: multerS3({
+ s3,
+ bucket: 'watcha',
+ acl: 'public-read',
+ key: function (req, file, cb) {
+ cb(null, 'images/origin/' + Date.now() + '.' + file.originalname.split('.').pop());
+ }
+ })
+});
+module.exports = upload;
+//# sourceMappingURL=multer.js.map
\ No newline at end of file
diff --git a/dist/modules/multer.js.map b/dist/modules/multer.js.map
new file mode 100644
index 0000000..5b1baf5
--- /dev/null
+++ b/dist/modules/multer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"multer.js","sourceRoot":"","sources":["../../src/modules/multer.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;AAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;AACrC,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;AAC9B,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,GAAC,oBAAoB,CAAC,CAAA;AAEvD,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;AACxB,IAAI,MAAM,GAAG,MAAM,CAAC;IAChB,OAAO,EAAG,QAAQ,CAAC;QACf,EAAE;QACF,MAAM,EAAG,QAAQ;QACjB,GAAG,EAAG,aAAa;QACnB,GAAG,EAAC,UAAS,GAAG,EAAC,IAAI,EAAC,EAAE;YACpB,EAAE,CAAC,IAAI,EAAE,gBAAgB,GAAC,IAAI,CAAC,GAAG,EAAE,GAAC,GAAG,GAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAA;QAChF,CAAC;KACJ,CAAC;CACL,CAAC,CAAA;AAEF,MAAM,CAAC,OAAO,GAAC,MAAM,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/responseMessage.js b/dist/modules/responseMessage.js
new file mode 100644
index 0000000..a5c2b69
--- /dev/null
+++ b/dist/modules/responseMessage.js
@@ -0,0 +1,65 @@
+module.exports = {
+ NULL_VALUE: "필요한 값이 없습니다.",
+ OUT_OF_VALUE: "파라미터 값이 잘못 되었습니다.",
+ UNAUTHORIZED: "권한없음",
+ /* 회원가입 */
+ SIGN_UP_SUCCESS: "회원가입성공",
+ SIGN_UP_FAIL: "회원 가입 실패",
+ ALREADY_ID: "존재하는 ID 입니다.",
+ EMPTY_ID: "이메일을 입력해주세요",
+ WRONG_FORM: "유효하지 않은 형식입니다.",
+ /* 로그인 */
+ SIGN_IN_SUCCESS: "로그인 성공",
+ SIGN_IN_FAIL: "로그인 실패",
+ NO_USER: "존재하지않는 유저 id 입니다.",
+ MISS_MATCH_PW: "비밀번호가 일치하지 않습니다",
+ MISS_MATCH: "아이디나 비밀번호가 일치하지 않습니다.",
+ /*1부(by.sol) */
+ NO_BOOK: "존재하지 않는 책 id입니다.",
+ NO_DIARY: "존재하지 않는 다이어리 id입니다.",
+ NO_CONTENTS: "존재하지 않는 정보입니다.",
+ SUCCESS_GET_PET_INFO: "반려동물 정보 리스트 불러오기 성공",
+ SUCCESS_POST_PETDIARY: "반려동물 다이어리 작성 성공",
+ SUCCESS_EDIT_PETDIARY: "반려동물 다이어리 수정 성공",
+ SUCCESS_DELETE_PETDIARY: "반려동물 다이어리 삭제 성공",
+ SUCCESS_GET_CHAPTER_PETDIARY: "목차별 다이어리 조회 성공",
+ SUCCESS_GET_CHAPTERLIST: "목차 리스트 조회 성공",
+ SUCCESS_POST_CHAPTERLIST: "목차 리스트 추가 성공",
+ SUCCESS_EDIT_CHAPTERLIST: "목차 리스트 수정 성공",
+ SUCCESS_DELETE_CHAPTERLIST: "목차 리스트 삭제 성공",
+ SUCCESS_REGISTER_PET: "반려동물 등록 성공",
+ SUCCESS_REGISTER_PET_IMG: "반려동물 이미지 등록 성공",
+ SUCCESS_GET_FIRSTPART_MAINPAGE: "1부 메인뷰 불러오기 성공",
+ /** 1.5부 무지개다리 (by 현종) */
+ SUCCESS_GET_RAINBOW_MAIN_PAGE: "무지개 메인뷰 불러오기 성공",
+ SUCCESS_GET_RAINBOW_PET: "무지개 건넌 동물 불러오기 성공",
+ SUCCESS_GET_PARTING_PET_COMMENT: "이별하는 무지개 다리 멘트 불러오기 성공",
+ SUCCESS_DELETE_PARTING_PET: "반려동물 이별 과정 취소 성공",
+ SUCCESS_GET_READY_PARTING_PET_COMMENT: "이별에 준비하는 작가의 기록 시작 멘트 불러오기 성공",
+ SUCCESS_GET_BEST_MOMENT: "최고의 순간 불러오기 성공",
+ SUCCESS_GET_PARTING_PETNAME: "이별할 동물 이름 가져오기 성공",
+ SUCCESS_POST_EPILOGUE: "1부 끝 작가의말 - 에필로그 작성 성공",
+ SUCCESS_GET_RAINBOW_SUB_PAGE: "무지개 서브뷰 불러오기 성공",
+ /**캘린더 */
+ SUCCESS_GET_MONTH_CALENDAR: "해당 월의 캘린더 가져오기 성공",
+ SUCCESS_GET_YEAR_CALENDAR: "해당 년의 캘린더 가져오기 성공",
+ /**2부 */
+ SUCCESS_GET_SECOND_PART_MAIN_PAGE: "2부 메인페이지 불러오기 성공",
+ SUCCESS_GET_SECOND_PART_DIARY_OF_TABLECONTENTS: "2부 목차별 일기 불러오기 성공",
+ SUCCESS_GET_SECOND_PART_CHAPTER_LIST: "2부 목차 리스트 불러오기 성공",
+ SUCCESS_POST_SECOND_PART_ADD_CHAPTER: "2부 목차 추가 성공",
+ SUCCESS_PUT_SECOND_PART_MODIFY_CHAPTER: "2부 목차 수정 성공",
+ SUCCESS_DELETE_SECOND_PART_DELETE_CHAPTER: "2부 목차 삭제 성공",
+ FAIL_TO_GET_SECOND_PART_TABLE_CONTENTS: "잘못된 2부 목차의 ID입니다.",
+ SUCCESS_GET_SECOND_PART_DIARY: "2부 일기 불러오기 성공",
+ FAIL_TO_GET_SECOND_PART_DIARY_ID: "잘못된 2부 일기의 ID입니다.",
+ SUCCESS_POST_SECOND_PART_DIARY: "2부 일기 작성 성공",
+ FAIL_TO_POST_SECOND_PART_DIARY: "2부 일기 작성 실패",
+ SUCCESS_PUT_SECOND_PART_DIARY: "2부 일기 수정 성공",
+ FAIL_TO_PUT_SECOND_PART_DIARY: "2부 일기 수정 실패",
+ SUCCESS_DELETE_SECOND_PART_DELETE_DIARY: "2부 일기 삭제 성공",
+ FAIL_TO_DELETE_SECOND_PART_DIARY: "2부 일기 삭제 실패",
+ /* 서버에러 */
+ INTERNAL_SERVER_ERROR: "서버 내부 오류",
+};
+//# sourceMappingURL=responseMessage.js.map
\ No newline at end of file
diff --git a/dist/modules/responseMessage.js.map b/dist/modules/responseMessage.js.map
new file mode 100644
index 0000000..f5b619e
--- /dev/null
+++ b/dist/modules/responseMessage.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"responseMessage.js","sourceRoot":"","sources":["../../src/modules/responseMessage.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG;IACb,UAAU,EAAE,cAAc;IAC1B,YAAY,EAAE,mBAAmB;IACjC,YAAY,EAAE,MAAM;IAEpB,UAAU;IACV,eAAe,EAAE,QAA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,mBAAmB;IAC5D,6BAA6B,EAAC,eAAe;IAC7C,gCAAgC,EAAC,mBAAmB;IACpD,8BAA8B,EAAC,aAAa;IAC5C,8BAA8B,EAAC,aAAa;IAC5C,6BAA6B,EAAC,aAAa;IAC3C,6BAA6B,EAAC,aAAa;IAC3C,uCAAuC,EAAC,aAAa;IACrD,gCAAgC,EAAC,aAAa;IAG9C,UAAU;IACV,qBAAqB,EAAE,UAAU;CACpC,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/statusCode.js b/dist/modules/statusCode.js
new file mode 100644
index 0000000..d8ed705
--- /dev/null
+++ b/dist/modules/statusCode.js
@@ -0,0 +1,14 @@
+module.exports = {
+ OK: 200,
+ CREATED: 201,
+ NO_CONTENT: 204,
+ RESET_CONTENT: 205,
+ NOT_MODIFIED: 304,
+ BAD_REQUEST: 400,
+ UNAUTHORIZED: 401,
+ FORBIDDEN: 403,
+ NOT_FOUND: 404,
+ INTERNAL_SERVER_ERROR: 500,
+ SERVICE_UNAVAILABLE: 503
+};
+//# sourceMappingURL=statusCode.js.map
\ No newline at end of file
diff --git a/dist/modules/statusCode.js.map b/dist/modules/statusCode.js.map
new file mode 100644
index 0000000..adb5427
--- /dev/null
+++ b/dist/modules/statusCode.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"statusCode.js","sourceRoot":"","sources":["../../src/modules/statusCode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG;IACb,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,GAAG;IACZ,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,GAAG;IAClB,YAAY,EAAE,GAAG;IACjB,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,GAAG;IACjB,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,GAAG;IACd,qBAAqB,EAAE,GAAG;IAC1B,mBAAmB,EAAE,GAAG;CAC3B,CAAA"}
\ No newline at end of file
diff --git a/dist/modules/swagger.js b/dist/modules/swagger.js
new file mode 100644
index 0000000..f38ddbb
--- /dev/null
+++ b/dist/modules/swagger.js
@@ -0,0 +1 @@
+//# sourceMappingURL=swagger.js.map
\ No newline at end of file
diff --git a/dist/modules/swagger.js.map b/dist/modules/swagger.js.map
new file mode 100644
index 0000000..3f7a83a
--- /dev/null
+++ b/dist/modules/swagger.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../src/modules/swagger.ts"],"names":[],"mappings":""}
\ No newline at end of file
diff --git a/dist/modules/util.js b/dist/modules/util.js
new file mode 100644
index 0000000..0edee7f
--- /dev/null
+++ b/dist/modules/util.js
@@ -0,0 +1,14 @@
+module.exports = {
+ success: (status, message, data) => ({
+ status,
+ success: true,
+ message,
+ data
+ }),
+ fail: (status, message) => ({
+ status,
+ success: false,
+ message
+ })
+};
+//# sourceMappingURL=util.js.map
\ No newline at end of file
diff --git a/dist/modules/util.js.map b/dist/modules/util.js.map
new file mode 100644
index 0000000..0d386ec
--- /dev/null
+++ b/dist/modules/util.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/modules/util.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,GAAG;IACb,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACjC,MAAM;QACN,OAAO,EAAE,IAAI;QACb,OAAO;QACP,IAAI;KACP,CAAC;IACF,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;QACxB,MAAM;QACN,OAAO,EAAE,KAAK;QACd,OAAO;KACV,CAAC;CACL,CAAA"}
\ No newline at end of file
diff --git a/node_modules/.yarn-integrity b/node_modules/.yarn-integrity
index aa310f6..b98e877 100644
--- a/node_modules/.yarn-integrity
+++ b/node_modules/.yarn-integrity
@@ -1,5 +1,5 @@
{
- "systemParams": "win32-x64-72",
+ "systemParams": "win32-x64-83",
"modulesFolders": [
"node_modules"
],
@@ -8,14 +8,21 @@
"topLevelPatterns": [
"@types/express@^4.17.12",
"@types/node@^15.12.5",
+ "aws-sdk@^2.943.0",
"bcryptjs@^2.4.3",
"dotenv@^10.0.0",
+ "express-validator@^6.12.0",
"express@^4.17.1",
"mongoose@^5.13.0",
+ "multer-s3@^2.9.0",
+ "multer@^1.4.2",
+ "nodemon@^2.0.12",
"ts-node@^10.0.0",
"typescript@^4.3.4"
],
"lockfileEntries": {
+ "@sindresorhus/is@^0.14.0": "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea",
+ "@szmarczak/http-timer@^1.1.2": "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421",
"@tsconfig/node10@^1.0.7": "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9",
"@tsconfig/node12@^1.0.7": "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c",
"@tsconfig/node14@^1.0.0": "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2",
@@ -32,46 +39,138 @@
"@types/qs@*": "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.6.tgz#df9c3c8b31a247ec315e6996566be3171df4b3b1",
"@types/range-parser@*": "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c",
"@types/serve-static@*": "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.9.tgz#aacf28a85a05ee29a11fb7c3ead935ac56f33e4e",
+ "abbrev@1": "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8",
"accepts@~1.3.7": "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd",
+ "ansi-align@^3.0.0": "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb",
+ "ansi-regex@^4.1.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997",
+ "ansi-regex@^5.0.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75",
+ "ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937",
+ "anymatch@~3.1.2": "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716",
+ "append-field@^1.0.0": "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56",
"arg@^4.1.0": "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089",
"array-flatten@1.1.1": "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2",
+ "aws-sdk@^2.943.0": "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.943.0.tgz#6bda506cc33f5e7ec14e58ca4847e9abbab05c13",
+ "balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
+ "base64-js@^1.0.2": "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a",
"bcryptjs@^2.4.3": "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb",
+ "binary-extensions@^2.0.0": "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d",
"bl@^2.2.1": "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5",
"bluebird@3.5.1": "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9",
"body-parser@1.19.0": "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a",
+ "boxen@^4.2.0": "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64",
+ "brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
+ "braces@~3.0.2": "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107",
"bson@^1.1.4": "https://registry.yarnpkg.com/bson/-/bson-1.1.6.tgz#fb819be9a60cd677e0853aee4ca712a785d6618a",
"buffer-from@^1.0.0": "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
+ "buffer@4.9.2": "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8",
+ "busboy@^0.2.11": "https://registry.yarnpkg.com/busboy/-/busboy-0.2.14.tgz#6c2a622efcf47c57bbbe1e2a9c37ad36c7925453",
"bytes@3.1.0": "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6",
+ "cacheable-request@^6.0.0": "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912",
+ "camelcase@^5.3.1": "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320",
+ "chalk@^3.0.0": "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4",
+ "chokidar@^3.2.2": "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75",
+ "ci-info@^2.0.0": "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46",
+ "cli-boxes@^2.2.0": "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f",
+ "clone-response@^1.0.2": "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b",
+ "color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
+ "color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2",
+ "concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
+ "concat-stream@^1.5.2": "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34",
+ "configstore@^5.0.1": "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96",
"content-disposition@0.5.3": "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd",
"content-type@~1.0.4": "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b",
"cookie-signature@1.0.6": "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c",
"cookie@0.4.0": "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba",
"core-util-is@~1.0.0": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7",
"create-require@^1.1.0": "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333",
+ "crypto-random-string@^2.0.0": "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5",
"debug@2.6.9": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
"debug@3.1.0": "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261",
+ "debug@^2.2.0": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
+ "debug@^3.2.6": "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a",
+ "decompress-response@^3.3.0": "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3",
+ "deep-extend@^0.6.0": "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac",
+ "defer-to-connect@^1.0.1": "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591",
"denque@^1.4.1": "https://registry.yarnpkg.com/denque/-/denque-1.5.0.tgz#773de0686ff2d8ec2ff92914316a47b73b1c73de",
"depd@~1.1.2": "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9",
"destroy@~1.0.4": "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80",
+ "dicer@0.2.5": "https://registry.yarnpkg.com/dicer/-/dicer-0.2.5.tgz#5996c086bb33218c812c090bddc09cd12facb70f",
"diff@^4.0.1": "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d",
+ "dot-prop@^5.2.0": "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88",
"dotenv@^10.0.0": "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81",
+ "duplexer3@^0.1.4": "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2",
"ee-first@1.1.1": "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d",
+ "emoji-regex@^7.0.1": "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156",
+ "emoji-regex@^8.0.0": "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37",
"encodeurl@~1.0.2": "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59",
+ "end-of-stream@^1.1.0": "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0",
+ "escape-goat@^2.0.0": "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675",
"escape-html@~1.0.3": "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988",
"etag@~1.8.1": "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887",
+ "events@1.1.1": "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924",
+ "express-validator@^6.12.0": "https://registry.yarnpkg.com/express-validator/-/express-validator-6.12.0.tgz#a9cd49b3fe4c470abb615ae2e7dd111053c25f66",
"express@^4.17.1": "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134",
+ "file-type@^3.3.0": "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9",
+ "fill-range@^7.0.1": "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40",
"finalhandler@~1.1.2": "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d",
"forwarded@0.2.0": "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811",
"fresh@0.5.2": "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7",
+ "fsevents@~2.3.2": "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a",
+ "get-stream@^4.1.0": "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5",
+ "get-stream@^5.1.0": "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3",
+ "glob-parent@~5.1.2": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4",
+ "global-dirs@^2.0.1": "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d",
+ "got@^9.6.0": "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85",
+ "graceful-fs@^4.1.2": "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee",
+ "has-flag@^3.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd",
+ "has-flag@^4.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b",
+ "has-yarn@^2.1.0": "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77",
+ "html-comment-regex@^1.1.0": "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7",
+ "http-cache-semantics@^4.0.0": "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390",
"http-errors@1.7.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f",
"http-errors@~1.7.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06",
"iconv-lite@0.4.24": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b",
+ "ieee754@1.1.13": "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84",
+ "ieee754@^1.1.4": "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352",
+ "ignore-by-default@^1.0.1": "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09",
+ "import-lazy@^2.1.0": "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43",
+ "imurmurhash@^0.1.4": "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea",
"inherits@2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de",
"inherits@2.0.4": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
+ "inherits@^2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
+ "inherits@~2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
"inherits@~2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
+ "ini@1.3.7": "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84",
+ "ini@~1.3.0": "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c",
"ipaddr.js@1.9.1": "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3",
+ "is-binary-path@~2.1.0": "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09",
+ "is-ci@^2.0.0": "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c",
+ "is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
+ "is-fullwidth-code-point@^2.0.0": "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f",
+ "is-fullwidth-code-point@^3.0.0": "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d",
+ "is-glob@^4.0.1": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
+ "is-glob@~4.0.1": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
+ "is-installed-globally@^0.3.1": "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141",
+ "is-npm@^4.0.0": "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d",
+ "is-number@^7.0.0": "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b",
+ "is-obj@^2.0.0": "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982",
+ "is-path-inside@^3.0.1": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283",
+ "is-svg@^2.1.0": "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9",
+ "is-typedarray@^1.0.0": "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a",
+ "is-yarn-global@^0.3.0": "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232",
+ "isarray@0.0.1": "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+ "isarray@^1.0.0": "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11",
"isarray@~1.0.0": "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11",
+ "jmespath@0.15.0": "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217",
+ "json-buffer@3.0.0": "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898",
"kareem@2.3.2": "https://registry.yarnpkg.com/kareem/-/kareem-2.3.2.tgz#78c4508894985b8d38a0dc15e1a8e11078f2ca93",
+ "keyv@^3.0.0": "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9",
+ "latest-version@^5.0.0": "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face",
+ "lodash@^4.17.21": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
+ "lowercase-keys@^1.0.0": "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f",
+ "lowercase-keys@^1.0.1": "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f",
+ "lowercase-keys@^2.0.0": "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479",
+ "make-dir@^3.0.0": "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f",
"make-error@^1.1.1": "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2",
"media-typer@0.3.0": "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748",
"memory-pager@^1.0.2": "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5",
@@ -80,6 +179,12 @@
"mime-db@1.48.0": "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d",
"mime-types@~2.1.24": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b",
"mime@1.6.0": "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1",
+ "mimic-response@^1.0.0": "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b",
+ "mimic-response@^1.0.1": "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b",
+ "minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083",
+ "minimist@^1.2.0": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
+ "minimist@^1.2.5": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
+ "mkdirp@^0.5.1": "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def",
"mongodb@3.6.8": "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.8.tgz#3e2632af81915b3ff99b7681121ca0895e8ed407",
"mongoose-legacy-pluralize@1.0.2": "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4",
"mongoose@^5.13.0": "https://registry.yarnpkg.com/mongoose/-/mongoose-5.13.0.tgz#3d5241991261681a913696d5b7c88f76b31aedb0",
@@ -88,19 +193,50 @@
"ms@2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8",
"ms@2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a",
"ms@2.1.2": "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009",
+ "ms@^2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2",
+ "multer-s3@^2.9.0": "https://registry.yarnpkg.com/multer-s3/-/multer-s3-2.9.0.tgz#a946fd8c01c9726076f11949b84943259f8ca8c3",
+ "multer@^1.4.2": "https://registry.yarnpkg.com/multer/-/multer-1.4.2.tgz#2f1f4d12dbaeeba74cb37e623f234bf4d3d2057a",
"negotiator@0.6.2": "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb",
+ "nodemon@^2.0.12": "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.12.tgz#5dae4e162b617b91f1873b3bfea215dd71e144d5",
+ "nopt@~1.0.10": "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee",
+ "normalize-path@^3.0.0": "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65",
+ "normalize-path@~3.0.0": "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65",
+ "normalize-url@^4.1.0": "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a",
+ "object-assign@^4.1.1": "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863",
+ "on-finished@^2.3.0": "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947",
"on-finished@~2.3.0": "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947",
+ "once@^1.3.1": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
+ "once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
"optional-require@^1.0.3": "https://registry.yarnpkg.com/optional-require/-/optional-require-1.0.3.tgz#275b8e9df1dc6a17ad155369c2422a440f89cb07",
+ "p-cancelable@^1.0.0": "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc",
+ "package-json@^6.3.0": "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0",
"parseurl@~1.3.3": "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4",
"path-to-regexp@0.1.7": "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c",
+ "picomatch@^2.0.4": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
+ "picomatch@^2.2.1": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
+ "prepend-http@^2.0.0": "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897",
"process-nextick-args@~2.0.0": "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2",
"proxy-addr@~2.0.5": "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025",
+ "pstree.remy@^1.1.7": "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a",
+ "pump@^3.0.0": "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64",
+ "punycode@1.3.2": "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d",
+ "pupa@^2.0.1": "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62",
"qs@6.7.0": "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc",
+ "querystring@0.2.0": "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620",
+ "queue-microtask@^1.2.2": "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243",
"range-parser@~1.2.1": "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031",
"raw-body@2.4.0": "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332",
+ "rc@^1.2.8": "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed",
+ "readable-stream@1.1.x": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9",
+ "readable-stream@^2.2.2": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57",
"readable-stream@^2.3.5": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57",
+ "readdirp@~3.6.0": "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7",
"regexp-clone@1.0.0": "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63",
"regexp-clone@^1.0.0": "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63",
+ "registry-auth-token@^4.0.0": "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250",
+ "registry-url@^5.0.0": "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009",
+ "responselike@^1.0.2": "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7",
+ "run-parallel@^1.1.6": "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee",
"safe-buffer@5.1.2": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
"safe-buffer@5.2.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
"safe-buffer@^5.1.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
@@ -109,27 +245,67 @@
"safe-buffer@~5.1.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
"safer-buffer@>= 2.1.2 < 3": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
"saslprep@^1.0.0": "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226",
+ "sax@1.2.1": "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a",
+ "sax@>=0.6.0": "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9",
+ "semver-diff@^3.1.1": "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b",
+ "semver@^5.7.1": "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7",
+ "semver@^6.0.0": "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
+ "semver@^6.2.0": "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
+ "semver@^6.3.0": "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
"send@0.17.1": "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8",
"serve-static@1.14.1": "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9",
"setprototypeof@1.1.1": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683",
"sift@13.5.2": "https://registry.yarnpkg.com/sift/-/sift-13.5.2.tgz#24a715e13c617b086166cd04917d204a591c9da6",
+ "signal-exit@^3.0.2": "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c",
"sliced@1.0.1": "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41",
"source-map-support@^0.5.17": "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61",
"source-map@^0.6.0": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
"sparse-bitfield@^3.0.3": "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11",
"statuses@>= 1.5.0 < 2": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c",
"statuses@~1.5.0": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c",
+ "streamsearch@0.1.2": "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a",
+ "string-width@^3.0.0": "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961",
+ "string-width@^4.0.0": "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5",
+ "string-width@^4.1.0": "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5",
+ "string_decoder@~0.10.x": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94",
"string_decoder@~1.1.1": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
+ "strip-ansi@^5.1.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
+ "strip-ansi@^6.0.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532",
+ "strip-json-comments@~2.0.1": "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a",
+ "supports-color@^5.5.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f",
+ "supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da",
+ "term-size@^2.1.0": "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54",
+ "to-readable-stream@^1.0.0": "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771",
+ "to-regex-range@^5.0.1": "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4",
"toidentifier@1.0.0": "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553",
+ "touch@^3.1.0": "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b",
"ts-node@^10.0.0": "https://registry.yarnpkg.com/ts-node/-/ts-node-10.0.0.tgz#05f10b9a716b0b624129ad44f0ea05dac84ba3be",
+ "type-fest@^0.8.1": "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d",
+ "type-is@^1.6.4": "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131",
"type-is@~1.6.17": "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131",
"type-is@~1.6.18": "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131",
+ "typedarray-to-buffer@^3.1.5": "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080",
+ "typedarray@^0.0.6": "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777",
"typescript@^4.3.4": "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc",
+ "undefsafe@^2.0.3": "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae",
+ "unique-string@^2.0.0": "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d",
"unpipe@1.0.0": "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec",
"unpipe@~1.0.0": "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec",
+ "update-notifier@^4.1.0": "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3",
+ "url-parse-lax@^3.0.0": "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c",
+ "url@0.10.3": "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64",
"util-deprecate@~1.0.1": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf",
"utils-merge@1.0.1": "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713",
+ "uuid@3.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131",
+ "validator@^13.5.2": "https://registry.yarnpkg.com/validator/-/validator-13.6.0.tgz#1e71899c14cdc7b2068463cb24c1cc16f6ec7059",
"vary@~1.1.2": "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc",
+ "widest-line@^3.1.0": "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca",
+ "wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
+ "write-file-atomic@^3.0.0": "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8",
+ "xdg-basedir@^4.0.0": "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13",
+ "xml2js@0.4.19": "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7",
+ "xmlbuilder@~9.0.1": "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d",
+ "xtend@^4.0.0": "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54",
"yn@3.1.1": "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
},
"files": [],
diff --git a/node_modules/readable-stream/.travis.yml b/node_modules/readable-stream/.travis.yml
deleted file mode 100644
index f62cdac..0000000
--- a/node_modules/readable-stream/.travis.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-sudo: false
-language: node_js
-before_install:
- - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true
-notifications:
- email: false
-matrix:
- fast_finish: true
- include:
- - node_js: '0.8'
- env: NPM_LEGACY=true
- - node_js: '0.10'
- env: NPM_LEGACY=true
- - node_js: '0.11'
- env: NPM_LEGACY=true
- - node_js: '0.12'
- env: NPM_LEGACY=true
- - node_js: 1
- env: NPM_LEGACY=true
- - node_js: 2
- env: NPM_LEGACY=true
- - node_js: 3
- env: NPM_LEGACY=true
- - node_js: 4
- - node_js: 5
- - node_js: 6
- - node_js: 7
- - node_js: 8
- - node_js: 9
-script: "npm run test"
-env:
- global:
- - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
- - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/node_modules/readable-stream/CONTRIBUTING.md b/node_modules/readable-stream/CONTRIBUTING.md
deleted file mode 100644
index f478d58..0000000
--- a/node_modules/readable-stream/CONTRIBUTING.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Developer's Certificate of Origin 1.1
-
-By making a contribution to this project, I certify that:
-
-* (a) The contribution was created in whole or in part by me and I
- have the right to submit it under the open source license
- indicated in the file; or
-
-* (b) The contribution is based upon previous work that, to the best
- of my knowledge, is covered under an appropriate open source
- license and I have the right under that license to submit that
- work with modifications, whether created in whole or in part
- by me, under the same open source license (unless I am
- permitted to submit under a different license), as indicated
- in the file; or
-
-* (c) The contribution was provided directly to me by some other
- person who certified (a), (b) or (c) and I have not modified
- it.
-
-* (d) I understand and agree that this project and the contribution
- are public and that a record of the contribution (including all
- personal information I submit with it, including my sign-off) is
- maintained indefinitely and may be redistributed consistent with
- this project or the open source license(s) involved.
-
-## Moderation Policy
-
-The [Node.js Moderation Policy] applies to this WG.
-
-## Code of Conduct
-
-The [Node.js Code of Conduct][] applies to this WG.
-
-[Node.js Code of Conduct]:
-https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
-[Node.js Moderation Policy]:
-https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/node_modules/readable-stream/GOVERNANCE.md b/node_modules/readable-stream/GOVERNANCE.md
deleted file mode 100644
index 16ffb93..0000000
--- a/node_modules/readable-stream/GOVERNANCE.md
+++ /dev/null
@@ -1,136 +0,0 @@
-### Streams Working Group
-
-The Node.js Streams is jointly governed by a Working Group
-(WG)
-that is responsible for high-level guidance of the project.
-
-The WG has final authority over this project including:
-
-* Technical direction
-* Project governance and process (including this policy)
-* Contribution policy
-* GitHub repository hosting
-* Conduct guidelines
-* Maintaining the list of additional Collaborators
-
-For the current list of WG members, see the project
-[README.md](./README.md#current-project-team-members).
-
-### Collaborators
-
-The readable-stream GitHub repository is
-maintained by the WG and additional Collaborators who are added by the
-WG on an ongoing basis.
-
-Individuals making significant and valuable contributions are made
-Collaborators and given commit-access to the project. These
-individuals are identified by the WG and their addition as
-Collaborators is discussed during the WG meeting.
-
-_Note:_ If you make a significant contribution and are not considered
-for commit-access log an issue or contact a WG member directly and it
-will be brought up in the next WG meeting.
-
-Modifications of the contents of the readable-stream repository are
-made on
-a collaborative basis. Anybody with a GitHub account may propose a
-modification via pull request and it will be considered by the project
-Collaborators. All pull requests must be reviewed and accepted by a
-Collaborator with sufficient expertise who is able to take full
-responsibility for the change. In the case of pull requests proposed
-by an existing Collaborator, an additional Collaborator is required
-for sign-off. Consensus should be sought if additional Collaborators
-participate and there is disagreement around a particular
-modification. See _Consensus Seeking Process_ below for further detail
-on the consensus model used for governance.
-
-Collaborators may opt to elevate significant or controversial
-modifications, or modifications that have not found consensus to the
-WG for discussion by assigning the ***WG-agenda*** tag to a pull
-request or issue. The WG should serve as the final arbiter where
-required.
-
-For the current list of Collaborators, see the project
-[README.md](./README.md#members).
-
-### WG Membership
-
-WG seats are not time-limited. There is no fixed size of the WG.
-However, the expected target is between 6 and 12, to ensure adequate
-coverage of important areas of expertise, balanced with the ability to
-make decisions efficiently.
-
-There is no specific set of requirements or qualifications for WG
-membership beyond these rules.
-
-The WG may add additional members to the WG by unanimous consensus.
-
-A WG member may be removed from the WG by voluntary resignation, or by
-unanimous consensus of all other WG members.
-
-Changes to WG membership should be posted in the agenda, and may be
-suggested as any other agenda item (see "WG Meetings" below).
-
-If an addition or removal is proposed during a meeting, and the full
-WG is not in attendance to participate, then the addition or removal
-is added to the agenda for the subsequent meeting. This is to ensure
-that all members are given the opportunity to participate in all
-membership decisions. If a WG member is unable to attend a meeting
-where a planned membership decision is being made, then their consent
-is assumed.
-
-No more than 1/3 of the WG members may be affiliated with the same
-employer. If removal or resignation of a WG member, or a change of
-employment by a WG member, creates a situation where more than 1/3 of
-the WG membership shares an employer, then the situation must be
-immediately remedied by the resignation or removal of one or more WG
-members affiliated with the over-represented employer(s).
-
-### WG Meetings
-
-The WG meets occasionally on a Google Hangout On Air. A designated moderator
-approved by the WG runs the meeting. Each meeting should be
-published to YouTube.
-
-Items are added to the WG agenda that are considered contentious or
-are modifications of governance, contribution policy, WG membership,
-or release process.
-
-The intention of the agenda is not to approve or review all patches;
-that should happen continuously on GitHub and be handled by the larger
-group of Collaborators.
-
-Any community member or contributor can ask that something be added to
-the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
-WG member or the moderator can add the item to the agenda by adding
-the ***WG-agenda*** tag to the issue.
-
-Prior to each WG meeting the moderator will share the Agenda with
-members of the WG. WG members can add any items they like to the
-agenda at the beginning of each meeting. The moderator and the WG
-cannot veto or remove items.
-
-The WG may invite persons or representatives from certain projects to
-participate in a non-voting capacity.
-
-The moderator is responsible for summarizing the discussion of each
-agenda item and sends it as a pull request after the meeting.
-
-### Consensus Seeking Process
-
-The WG follows a
-[Consensus
-Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
-decision-making model.
-
-When an agenda item has appeared to reach a consensus the moderator
-will ask "Does anyone object?" as a final call for dissent from the
-consensus.
-
-If an agenda item cannot reach a consensus a WG member can call for
-either a closing vote or a vote to table the issue to the next
-meeting. The call for a vote must be seconded by a majority of the WG
-or else the discussion will continue. Simple majority wins.
-
-Note that changes to WG membership require a majority consensus. See
-"WG Membership" above.
diff --git a/node_modules/readable-stream/LICENSE b/node_modules/readable-stream/LICENSE
index 2873b3b..e3d4e69 100644
--- a/node_modules/readable-stream/LICENSE
+++ b/node_modules/readable-stream/LICENSE
@@ -1,31 +1,3 @@
-Node.js is licensed for use as follows:
-
-"""
-Copyright Node.js contributors. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
-This license applies to parts of Node.js originating from the
-https://github.com/joyent/node repository:
-
-"""
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
@@ -44,4 +16,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-"""
diff --git a/node_modules/readable-stream/README.md b/node_modules/readable-stream/README.md
index 23fe3f3..e46b823 100644
--- a/node_modules/readable-stream/README.md
+++ b/node_modules/readable-stream/README.md
@@ -1,58 +1,15 @@
# readable-stream
-***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
-
-
-[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
-[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
-
-
-[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
-
-```bash
-npm install --save readable-stream
-```
-
***Node-core streams for userland***
-This package is a mirror of the Streams2 and Streams3 implementations in
-Node-core.
-
-Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
-
-If you want to guarantee a stable streams base, regardless of what version of
-Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
-
-As of version 2.0.0 **readable-stream** uses semantic versioning.
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)
-# Streams Working Group
+This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
-`readable-stream` is maintained by the Streams Working Group, which
-oversees the development and maintenance of the Streams API within
-Node.js. The responsibilities of the Streams Working Group include:
+If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
-* Addressing stream issues on the Node.js issue tracker.
-* Authoring and editing stream documentation within the Node.js project.
-* Reviewing changes to stream subclasses within the Node.js project.
-* Redirecting changes to streams from the Node.js project to this
- project.
-* Assisting in the implementation of stream providers within Node.js.
-* Recommending versions of `readable-stream` to be included in Node.js.
-* Messaging about the future of streams to give the community advance
- notice of changes.
+**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
-
-## Team Members
+**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
-* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>
- - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
-* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
- - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
-* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>
- - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
-* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>
-* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
-* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>
-* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
- - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
-* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
diff --git a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
deleted file mode 100644
index 83275f1..0000000
--- a/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# streams WG Meeting 2015-01-30
-
-## Links
-
-* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
-* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
-* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
-
-## Agenda
-
-Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
-
-* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
-* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
-* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
-* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
-
-## Minutes
-
-### adopt a charter
-
-* group: +1's all around
-
-### What versioning scheme should be adopted?
-* group: +1’s 3.0.0
-* domenic+group: pulling in patches from other sources where appropriate
-* mikeal: version independently, suggesting versions for io.js
-* mikeal+domenic: work with TC to notify in advance of changes
-simpler stream creation
-
-### streamline creation of streams
-* sam: streamline creation of streams
-* domenic: nice simple solution posted
- but, we lose the opportunity to change the model
- may not be backwards incompatible (double check keys)
-
- **action item:** domenic will check
-
-### remove implicit flowing of streams on(‘data’)
-* add isFlowing / isPaused
-* mikeal: worrying that we’re documenting polyfill methods – confuses users
-* domenic: more reflective API is probably good, with warning labels for users
-* new section for mad scientists (reflective stream access)
-* calvin: name the “third state”
-* mikeal: maybe borrow the name from whatwg?
-* domenic: we’re missing the “third state”
-* consensus: kind of difficult to name the third state
-* mikeal: figure out differences in states / compat
-* mathias: always flow on data – eliminates third state
- * explore what it breaks
-
-**action items:**
-* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
-* ask rod/build for infrastructure
-* **chris**: explore the “flow on data” approach
-* add isPaused/isFlowing
-* add new docs section
-* move isPaused to that section
-
-
diff --git a/node_modules/readable-stream/duplex-browser.js b/node_modules/readable-stream/duplex-browser.js
deleted file mode 100644
index f8b2db8..0000000
--- a/node_modules/readable-stream/duplex-browser.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib/_stream_duplex.js');
diff --git a/node_modules/readable-stream/duplex.js b/node_modules/readable-stream/duplex.js
index 46924cb..ca807af 100644
--- a/node_modules/readable-stream/duplex.js
+++ b/node_modules/readable-stream/duplex.js
@@ -1 +1 @@
-module.exports = require('./readable').Duplex
+module.exports = require("./lib/_stream_duplex.js")
diff --git a/node_modules/readable-stream/lib/_stream_duplex.js b/node_modules/readable-stream/lib/_stream_duplex.js
index 57003c3..b513d61 100644
--- a/node_modules/readable-stream/lib/_stream_duplex.js
+++ b/node_modules/readable-stream/lib/_stream_duplex.js
@@ -24,26 +24,19 @@
// prototypally inherits from Readable, and then parasitically from
// Writable.
-'use strict';
-
-/**/
-
-var pna = require('process-nextick-args');
-/**/
+module.exports = Duplex;
/**/
var objectKeys = Object.keys || function (obj) {
var keys = [];
- for (var key in obj) {
- keys.push(key);
- }return keys;
-};
+ for (var key in obj) keys.push(key);
+ return keys;
+}
/**/
-module.exports = Duplex;
/**/
-var util = Object.create(require('core-util-is'));
+var util = require('core-util-is');
util.inherits = require('inherits');
/**/
@@ -52,80 +45,45 @@ var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
-{
- // avoid scope creep, the keys array can then be collected
- var keys = objectKeys(Writable.prototype);
- for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
- }
-}
+forEach(objectKeys(Writable.prototype), function(method) {
+ if (!Duplex.prototype[method])
+ Duplex.prototype[method] = Writable.prototype[method];
+});
function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
+ if (!(this instanceof Duplex))
+ return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
- if (options && options.readable === false) this.readable = false;
+ if (options && options.readable === false)
+ this.readable = false;
- if (options && options.writable === false) this.writable = false;
+ if (options && options.writable === false)
+ this.writable = false;
this.allowHalfOpen = true;
- if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+ if (options && options.allowHalfOpen === false)
+ this.allowHalfOpen = false;
this.once('end', onend);
}
-Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._writableState.highWaterMark;
- }
-});
-
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
- if (this.allowHalfOpen || this._writableState.ended) return;
+ if (this.allowHalfOpen || this._writableState.ended)
+ return;
// no more data can be written.
// But allow more writes to happen in this tick.
- pna.nextTick(onEndNT, this);
-}
-
-function onEndNT(self) {
- self.end();
+ process.nextTick(this.end.bind(this));
}
-Object.defineProperty(Duplex.prototype, 'destroyed', {
- get: function () {
- if (this._readableState === undefined || this._writableState === undefined) {
- return false;
- }
- return this._readableState.destroyed && this._writableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (this._readableState === undefined || this._writableState === undefined) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- this._writableState.destroyed = value;
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
}
-});
-
-Duplex.prototype._destroy = function (err, cb) {
- this.push(null);
- this.end();
-
- pna.nextTick(cb, err);
-};
\ No newline at end of file
+}
diff --git a/node_modules/readable-stream/lib/_stream_passthrough.js b/node_modules/readable-stream/lib/_stream_passthrough.js
index 612edb4..895ca50 100644
--- a/node_modules/readable-stream/lib/_stream_passthrough.js
+++ b/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -23,25 +23,24 @@
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
-'use strict';
-
module.exports = PassThrough;
var Transform = require('./_stream_transform');
/**/
-var util = Object.create(require('core-util-is'));
+var util = require('core-util-is');
util.inherits = require('inherits');
/**/
util.inherits(PassThrough, Transform);
function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
+ if (!(this instanceof PassThrough))
+ return new PassThrough(options);
Transform.call(this, options);
}
-PassThrough.prototype._transform = function (chunk, encoding, cb) {
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
cb(null, chunk);
-};
\ No newline at end of file
+};
diff --git a/node_modules/readable-stream/lib/_stream_readable.js b/node_modules/readable-stream/lib/_stream_readable.js
index 0f80764..19ab358 100644
--- a/node_modules/readable-stream/lib/_stream_readable.js
+++ b/node_modules/readable-stream/lib/_stream_readable.js
@@ -19,118 +19,64 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-'use strict';
-
-/**/
-
-var pna = require('process-nextick-args');
-/**/
-
module.exports = Readable;
/**/
var isArray = require('isarray');
/**/
+
/**/
-var Duplex;
+var Buffer = require('buffer').Buffer;
/**/
Readable.ReadableState = ReadableState;
-/**/
var EE = require('events').EventEmitter;
-var EElistenerCount = function (emitter, type) {
+/**/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
return emitter.listeners(type).length;
};
/**/
-/**/
-var Stream = require('./internal/streams/stream');
-/**/
+var Stream = require('stream');
/**/
-
-var Buffer = require('safe-buffer').Buffer;
-var OurUint8Array = global.Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-
-/**/
-
-/**/
-var util = Object.create(require('core-util-is'));
+var util = require('core-util-is');
util.inherits = require('inherits');
/**/
+var StringDecoder;
+
+
/**/
-var debugUtil = require('util');
-var debug = void 0;
-if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
+var debug = require('util');
+if (debug && debug.debuglog) {
+ debug = debug.debuglog('stream');
} else {
debug = function () {};
}
/**/
-var BufferList = require('./internal/streams/BufferList');
-var destroyImpl = require('./internal/streams/destroy');
-var StringDecoder;
util.inherits(Readable, Stream);
-var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
-
-function prependListener(emitter, event, fn) {
- // Sadly this is not cacheable as some libraries bundle their own
- // event emitter implementation with them.
- if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
-
- // This is a hack to make sure that our error handler is attached before any
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
-}
-
function ReadableState(options, stream) {
- Duplex = Duplex || require('./_stream_duplex');
+ var Duplex = require('./_stream_duplex');
options = options || {};
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- var isDuplex = stream instanceof Duplex;
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
-
- if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
-
// the point at which it stops calling _read() to fill the buffer
// Note: 0 is a valid value, means "don't call _read preemptively ever"
var hwm = options.highWaterMark;
- var readableHwm = options.readableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
-
- if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+ var defaultHwm = options.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
// cast to ints.
- this.highWaterMark = Math.floor(this.highWaterMark);
+ this.highWaterMark = ~~this.highWaterMark;
- // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
+ this.buffer = [];
this.length = 0;
this.pipes = null;
this.pipesCount = 0;
@@ -139,10 +85,10 @@ function ReadableState(options, stream) {
this.endEmitted = false;
this.reading = false;
- // a flag to be able to tell if the event 'readable'/'data' is emitted
- // immediately, or on a later tick. We set this to true at first, because
- // any actions that shouldn't happen until "later" should generally also
- // not happen before the first read call.
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
this.sync = true;
// whenever we return null, then we set a flag to say
@@ -150,16 +96,24 @@ function ReadableState(options, stream) {
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
- this.resumeScheduled = false;
- // has it been destroyed
- this.destroyed = false;
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.readableObjectMode;
// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
// Everything else in the universe uses 'utf8', though.
this.defaultEncoding = options.defaultEncoding || 'utf8';
+ // when piping, we only care about 'readable' events that happen
+ // after read()ing all the bytes and not getting any pushback.
+ this.ranOut = false;
+
// the number of writers that are awaiting a drain event in .pipe()s
this.awaitDrain = 0;
@@ -169,144 +123,99 @@ function ReadableState(options, stream) {
this.decoder = null;
this.encoding = null;
if (options.encoding) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
this.decoder = new StringDecoder(options.encoding);
this.encoding = options.encoding;
}
}
function Readable(options) {
- Duplex = Duplex || require('./_stream_duplex');
+ var Duplex = require('./_stream_duplex');
- if (!(this instanceof Readable)) return new Readable(options);
+ if (!(this instanceof Readable))
+ return new Readable(options);
this._readableState = new ReadableState(options, this);
// legacy
this.readable = true;
- if (options) {
- if (typeof options.read === 'function') this._read = options.read;
-
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
- }
-
Stream.call(this);
}
-Object.defineProperty(Readable.prototype, 'destroyed', {
- get: function () {
- if (this._readableState === undefined) {
- return false;
- }
- return this._readableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._readableState) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._readableState.destroyed = value;
- }
-});
-
-Readable.prototype.destroy = destroyImpl.destroy;
-Readable.prototype._undestroy = destroyImpl.undestroy;
-Readable.prototype._destroy = function (err, cb) {
- this.push(null);
- cb(err);
-};
-
// Manually shove something into the read() buffer.
// This returns true if the highWaterMark has not been hit yet,
// similar to how Writable.write() returns true if you should
// write() some more.
-Readable.prototype.push = function (chunk, encoding) {
+Readable.prototype.push = function(chunk, encoding) {
var state = this._readableState;
- var skipChunkCheck;
-
- if (!state.objectMode) {
- if (typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = Buffer.from(chunk, encoding);
- encoding = '';
- }
- skipChunkCheck = true;
+
+ if (util.isString(chunk) && !state.objectMode) {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = new Buffer(chunk, encoding);
+ encoding = '';
}
- } else {
- skipChunkCheck = true;
}
- return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+ return readableAddChunk(this, state, chunk, encoding, false);
};
// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function (chunk) {
- return readableAddChunk(this, chunk, null, true, false);
+Readable.prototype.unshift = function(chunk) {
+ var state = this._readableState;
+ return readableAddChunk(this, state, chunk, '', true);
};
-function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
- var state = stream._readableState;
- if (chunk === null) {
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+ var er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (util.isNullOrUndefined(chunk)) {
state.reading = false;
- onEofChunk(stream, state);
- } else {
- var er;
- if (!skipChunkCheck) er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit('error', er);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
+ if (!state.ended)
+ onEofChunk(stream, state);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (state.ended && !addToFront) {
+ var e = new Error('stream.push() after EOF');
+ stream.emit('error', e);
+ } else if (state.endEmitted && addToFront) {
+ var e = new Error('stream.unshift() after end event');
+ stream.emit('error', e);
+ } else {
+ if (state.decoder && !addToFront && !encoding)
+ chunk = state.decoder.write(chunk);
+
+ if (!addToFront)
+ state.reading = false;
- if (addToFront) {
- if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
- } else if (state.ended) {
- stream.emit('error', new Error('stream.push() after EOF'));
+ // if we want the data now, just emit it.
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
} else {
- state.reading = false;
- if (state.decoder && !encoding) {
- chunk = state.decoder.write(chunk);
- if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
- } else {
- addChunk(stream, state, chunk, false);
- }
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront)
+ state.buffer.unshift(chunk);
+ else
+ state.buffer.push(chunk);
+
+ if (state.needReadable)
+ emitReadable(stream);
}
- } else if (!addToFront) {
- state.reading = false;
+
+ maybeReadMore(stream, state);
}
+ } else if (!addToFront) {
+ state.reading = false;
}
return needMoreData(state);
}
-function addChunk(stream, state, chunk, addToFront) {
- if (state.flowing && state.length === 0 && !state.sync) {
- stream.emit('data', chunk);
- stream.read(0);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
-
- if (state.needReadable) emitReadable(stream);
- }
- maybeReadMore(stream, state);
-}
-function chunkInvalid(state, chunk) {
- var er;
- if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- return er;
-}
// if it's past the high water mark, we can push in some more.
// Also, if we have no data yet, we can stand some
@@ -316,75 +225,92 @@ function chunkInvalid(state, chunk) {
// needReadable was set, then we ought to push more, so that another
// 'readable' event will be triggered.
function needMoreData(state) {
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+ return !state.ended &&
+ (state.needReadable ||
+ state.length < state.highWaterMark ||
+ state.length === 0);
}
-Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
-};
-
// backwards compatibility.
-Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+Readable.prototype.setEncoding = function(enc) {
+ if (!StringDecoder)
+ StringDecoder = require('string_decoder/').StringDecoder;
this._readableState.decoder = new StringDecoder(enc);
this._readableState.encoding = enc;
return this;
};
-// Don't raise the hwm > 8MB
+// Don't raise the hwm > 128MB
var MAX_HWM = 0x800000;
-function computeNewHighWaterMark(n) {
+function roundUpToNextPowerOf2(n) {
if (n >= MAX_HWM) {
n = MAX_HWM;
} else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
+ // Get the next highest power of 2
n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
n++;
}
return n;
}
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- }
- // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n;
- // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
+ if (state.length === 0 && state.ended)
return 0;
+
+ if (state.objectMode)
+ return n === 0 ? 0 : 1;
+
+ if (isNaN(n) || util.isNull(n)) {
+ // only flow one buffer at a time
+ if (state.flowing && state.buffer.length)
+ return state.buffer[0].length;
+ else
+ return state.length;
+ }
+
+ if (n <= 0)
+ return 0;
+
+ // If we're asking for more than the target buffer level,
+ // then raise the water mark. Bump up to the next highest
+ // power of 2, to prevent increasing it excessively in tiny
+ // amounts.
+ if (n > state.highWaterMark)
+ state.highWaterMark = roundUpToNextPowerOf2(n);
+
+ // don't have that much. return null, unless we've ended.
+ if (n > state.length) {
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ } else
+ return state.length;
}
- return state.length;
+
+ return n;
}
// you can override either this method, or the async _read(n) below.
-Readable.prototype.read = function (n) {
+Readable.prototype.read = function(n) {
debug('read', n);
- n = parseInt(n, 10);
var state = this._readableState;
var nOrig = n;
- if (n !== 0) state.emittedReadable = false;
+ if (!util.isNumber(n) || n > 0)
+ state.emittedReadable = false;
// if we're doing read(0) to trigger a readable event, but we
// already have a bunch of data in the buffer, then just trigger
// the 'readable' event and move on.
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+ if (n === 0 &&
+ state.needReadable &&
+ (state.length >= state.highWaterMark || state.ended)) {
debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ if (state.length === 0 && state.ended)
+ endReadable(this);
+ else
+ emitReadable(this);
return null;
}
@@ -392,7 +318,8 @@ Readable.prototype.read = function (n) {
// if we've ended, and we're now clear, then finish it up.
if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
+ if (state.length === 0)
+ endReadable(this);
return null;
}
@@ -433,47 +360,67 @@ Readable.prototype.read = function (n) {
if (state.ended || state.reading) {
doRead = false;
debug('reading or ended', doRead);
- } else if (doRead) {
+ }
+
+ if (doRead) {
debug('do read');
state.reading = true;
state.sync = true;
// if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true;
+ if (state.length === 0)
+ state.needReadable = true;
// call internal read method
this._read(state.highWaterMark);
state.sync = false;
- // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
}
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (doRead && !state.reading)
+ n = howMuchToRead(nOrig, state);
+
var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
+ if (n > 0)
+ ret = fromList(n, state);
+ else
+ ret = null;
- if (ret === null) {
+ if (util.isNull(ret)) {
state.needReadable = true;
n = 0;
- } else {
- state.length -= n;
}
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true;
+ state.length -= n;
- // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (state.length === 0 && !state.ended)
+ state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended && state.length === 0)
+ endReadable(this);
- if (ret !== null) this.emit('data', ret);
+ if (!util.isNull(ret))
+ this.emit('data', ret);
return ret;
};
+function chunkInvalid(state, chunk) {
+ var er = null;
+ if (!util.isBuffer(chunk) &&
+ !util.isString(chunk) &&
+ !util.isNullOrUndefined(chunk) &&
+ !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+
function onEofChunk(stream, state) {
- if (state.ended) return;
- if (state.decoder) {
+ if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
@@ -495,7 +442,12 @@ function emitReadable(stream) {
if (!state.emittedReadable) {
debug('emitReadable', state.flowing);
state.emittedReadable = true;
- if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+ if (state.sync)
+ process.nextTick(function() {
+ emitReadable_(stream);
+ });
+ else
+ emitReadable_(stream);
}
}
@@ -505,6 +457,7 @@ function emitReadable_(stream) {
flow(stream);
}
+
// at this point, the user has presumably seen the 'readable' event,
// and called read() to consume some data. that may have triggered
// in turn another _read(n) call, in which case reading = true if
@@ -514,18 +467,23 @@ function emitReadable_(stream) {
function maybeReadMore(stream, state) {
if (!state.readingMore) {
state.readingMore = true;
- pna.nextTick(maybeReadMore_, stream, state);
+ process.nextTick(function() {
+ maybeReadMore_(stream, state);
+ });
}
}
function maybeReadMore_(stream, state) {
var len = state.length;
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+ while (!state.reading && !state.flowing && !state.ended &&
+ state.length < state.highWaterMark) {
debug('maybeReadMore read 0');
stream.read(0);
if (len === state.length)
// didn't get any data, stop spinning.
- break;else len = state.length;
+ break;
+ else
+ len = state.length;
}
state.readingMore = false;
}
@@ -534,11 +492,11 @@ function maybeReadMore_(stream, state) {
// call cb(er, data) where data is <= n in length.
// for virtual (non-string, non-buffer) streams, "length" is somewhat
// arbitrary, and perhaps not very meaningful.
-Readable.prototype._read = function (n) {
- this.emit('error', new Error('_read() is not implemented'));
+Readable.prototype._read = function(n) {
+ this.emit('error', new Error('not implemented'));
};
-Readable.prototype.pipe = function (dest, pipeOpts) {
+Readable.prototype.pipe = function(dest, pipeOpts) {
var src = this;
var state = this._readableState;
@@ -556,19 +514,21 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
state.pipesCount += 1;
debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+ dest !== process.stdout &&
+ dest !== process.stderr;
- var endFn = doEnd ? onend : unpipe;
- if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+ var endFn = doEnd ? onend : cleanup;
+ if (state.endEmitted)
+ process.nextTick(endFn);
+ else
+ src.once('end', endFn);
dest.on('unpipe', onunpipe);
- function onunpipe(readable, unpipeInfo) {
+ function onunpipe(readable) {
debug('onunpipe');
if (readable === src) {
- if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
- unpipeInfo.hasUnpiped = true;
- cleanup();
- }
+ cleanup();
}
}
@@ -584,7 +544,6 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
var ondrain = pipeOnDrain(src);
dest.on('drain', ondrain);
- var cleanedUp = false;
function cleanup() {
debug('cleanup');
// cleanup event handlers once the pipe is broken
@@ -594,39 +553,27 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
dest.removeListener('error', onerror);
dest.removeListener('unpipe', onunpipe);
src.removeListener('end', onend);
- src.removeListener('end', unpipe);
+ src.removeListener('end', cleanup);
src.removeListener('data', ondata);
- cleanedUp = true;
-
// if the reader is waiting for a drain event from this
// specific writer, then it would cause it to never start
// flowing again.
// So, if this is awaiting a drain, then we just call it now.
// If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ if (state.awaitDrain &&
+ (!dest._writableState || dest._writableState.needDrain))
+ ondrain();
}
- // If the user pushes more data while we're writing to dest then we'll end up
- // in ondata again. However, we only want to increase awaitDrain once because
- // dest will only emit one 'drain' event for the multiple writes.
- // => Introduce a guard on increasing awaitDrain.
- var increasedAwaitDrain = false;
src.on('data', ondata);
function ondata(chunk) {
debug('ondata');
- increasedAwaitDrain = false;
var ret = dest.write(chunk);
- if (false === ret && !increasedAwaitDrain) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
- increasedAwaitDrain = true;
- }
+ if (false === ret) {
+ debug('false write response, pause',
+ src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
src.pause();
}
}
@@ -637,11 +584,19 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
debug('onerror', er);
unpipe();
dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+ if (EE.listenerCount(dest, 'error') === 0)
+ dest.emit('error', er);
}
+ // This is a brutally ugly hack to make sure that our error handler
+ // is attached before any userland ones. NEVER DO THIS.
+ if (!dest._events || !dest._events.error)
+ dest.on('error', onerror);
+ else if (isArray(dest._events.error))
+ dest._events.error.unshift(onerror);
+ else
+ dest._events.error = [onerror, dest._events.error];
+
- // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror);
// Both close and finish should trigger unpipe, but only once.
function onclose() {
@@ -674,36 +629,41 @@ Readable.prototype.pipe = function (dest, pipeOpts) {
};
function pipeOnDrain(src) {
- return function () {
+ return function() {
var state = src._readableState;
debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ if (state.awaitDrain)
+ state.awaitDrain--;
+ if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
state.flowing = true;
flow(src);
}
};
}
-Readable.prototype.unpipe = function (dest) {
+
+Readable.prototype.unpipe = function(dest) {
var state = this._readableState;
- var unpipeInfo = { hasUnpiped: false };
// if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this;
+ if (state.pipesCount === 0)
+ return this;
// just one destination. most common case.
if (state.pipesCount === 1) {
// passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
+ if (dest && dest !== state.pipes)
+ return this;
- if (!dest) dest = state.pipes;
+ if (!dest)
+ dest = state.pipes;
// got a match.
state.pipes = null;
state.pipesCount = 0;
state.flowing = false;
- if (dest) dest.emit('unpipe', this, unpipeInfo);
+ if (dest)
+ dest.emit('unpipe', this);
return this;
}
@@ -717,41 +677,51 @@ Readable.prototype.unpipe = function (dest) {
state.pipesCount = 0;
state.flowing = false;
- for (var i = 0; i < len; i++) {
- dests[i].emit('unpipe', this, unpipeInfo);
- }return this;
+ for (var i = 0; i < len; i++)
+ dests[i].emit('unpipe', this);
+ return this;
}
// try to find the right one.
- var index = indexOf(state.pipes, dest);
- if (index === -1) return this;
+ var i = indexOf(state.pipes, dest);
+ if (i === -1)
+ return this;
- state.pipes.splice(index, 1);
+ state.pipes.splice(i, 1);
state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
+ if (state.pipesCount === 1)
+ state.pipes = state.pipes[0];
- dest.emit('unpipe', this, unpipeInfo);
+ dest.emit('unpipe', this);
return this;
};
// set up data events if they are asked for
// Ensure readable listeners eventually get something
-Readable.prototype.on = function (ev, fn) {
+Readable.prototype.on = function(ev, fn) {
var res = Stream.prototype.on.call(this, ev, fn);
- if (ev === 'data') {
- // Start flowing on next tick if stream isn't explicitly paused
- if (this._readableState.flowing !== false) this.resume();
- } else if (ev === 'readable') {
+ // If listening to data, and it has not explicitly been paused,
+ // then call resume to start the flow of data on the next tick.
+ if (ev === 'data' && false !== this._readableState.flowing) {
+ this.resume();
+ }
+
+ if (ev === 'readable' && this.readable) {
var state = this._readableState;
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
+ if (!state.readableListening) {
+ state.readableListening = true;
state.emittedReadable = false;
+ state.needReadable = true;
if (!state.reading) {
- pna.nextTick(nReadingNextTick, this);
+ var self = this;
+ process.nextTick(function() {
+ debug('readable nexttick read 0');
+ self.read(0);
+ });
} else if (state.length) {
- emitReadable(this);
+ emitReadable(this, state);
}
}
}
@@ -760,18 +730,17 @@ Readable.prototype.on = function (ev, fn) {
};
Readable.prototype.addListener = Readable.prototype.on;
-function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
-}
-
// pause() and resume() are remnants of the legacy readable stream API
// If the user uses them, then switch into old mode.
-Readable.prototype.resume = function () {
+Readable.prototype.resume = function() {
var state = this._readableState;
if (!state.flowing) {
debug('resume');
state.flowing = true;
+ if (!state.reading) {
+ debug('resume read 0');
+ this.read(0);
+ }
resume(this, state);
}
return this;
@@ -780,24 +749,21 @@ Readable.prototype.resume = function () {
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
- pna.nextTick(resume_, stream, state);
+ process.nextTick(function() {
+ resume_(stream, state);
+ });
}
}
function resume_(stream, state) {
- if (!state.reading) {
- debug('resume read 0');
- stream.read(0);
- }
-
state.resumeScheduled = false;
- state.awaitDrain = 0;
stream.emit('resume');
flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
+ if (state.flowing && !state.reading)
+ stream.read(0);
}
-Readable.prototype.pause = function () {
+Readable.prototype.pause = function() {
debug('call pause flowing=%j', this._readableState.flowing);
if (false !== this._readableState.flowing) {
debug('pause');
@@ -810,36 +776,40 @@ Readable.prototype.pause = function () {
function flow(stream) {
var state = stream._readableState;
debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null) {}
+ if (state.flowing) {
+ do {
+ var chunk = stream.read();
+ } while (null !== chunk && state.flowing);
+ }
}
// wrap an old-style stream as the async data source.
// This is *not* part of the readable stream interface.
// It is an ugly unfortunate mess of history.
-Readable.prototype.wrap = function (stream) {
- var _this = this;
-
+Readable.prototype.wrap = function(stream) {
var state = this._readableState;
var paused = false;
- stream.on('end', function () {
+ var self = this;
+ stream.on('end', function() {
debug('wrapped end');
if (state.decoder && !state.ended) {
var chunk = state.decoder.end();
- if (chunk && chunk.length) _this.push(chunk);
+ if (chunk && chunk.length)
+ self.push(chunk);
}
- _this.push(null);
+ self.push(null);
});
- stream.on('data', function (chunk) {
+ stream.on('data', function(chunk) {
debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk);
-
- // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+ if (state.decoder)
+ chunk = state.decoder.write(chunk);
+ if (!chunk || !state.objectMode && !chunk.length)
+ return;
- var ret = _this.push(chunk);
+ var ret = self.push(chunk);
if (!ret) {
paused = true;
stream.pause();
@@ -849,23 +819,22 @@ Readable.prototype.wrap = function (stream) {
// proxy all the other methods.
// important when wrapping filters and duplexes.
for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function (method) {
- return function () {
- return stream[method].apply(stream, arguments);
- };
- }(i);
+ if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
+ this[i] = function(method) { return function() {
+ return stream[method].apply(stream, arguments);
+ }}(i);
}
}
// proxy certain important events.
- for (var n = 0; n < kProxyEvents.length; n++) {
- stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
- }
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+ forEach(events, function(ev) {
+ stream.on(ev, self.emit.bind(self, ev));
+ });
// when we try to consume some more bytes, simply unpause the
// underlying stream.
- this._read = function (n) {
+ self._read = function(n) {
debug('wrapped _read', n);
if (paused) {
paused = false;
@@ -873,119 +842,77 @@ Readable.prototype.wrap = function (stream) {
}
};
- return this;
+ return self;
};
-Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._readableState.highWaterMark;
- }
-});
+
// exposed for testing purposes only.
Readable._fromList = fromList;
// Pluck off n bytes from an array of buffers.
// Length is the combined lengths of all the buffers in the list.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
-
+ var list = state.buffer;
+ var length = state.length;
+ var stringMode = !!state.decoder;
+ var objectMode = !!state.objectMode;
var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = fromListPartial(n, state.buffer, state.decoder);
- }
- return ret;
-}
+ // nothing in the list, definitely empty.
+ if (list.length === 0)
+ return null;
-// Extracts only enough buffered data to satisfy the amount requested.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromListPartial(n, list, hasStrings) {
- var ret;
- if (n < list.head.data.length) {
- // slice is the same for buffers and strings
- ret = list.head.data.slice(0, n);
- list.head.data = list.head.data.slice(n);
- } else if (n === list.head.data.length) {
- // first chunk is a perfect match
+ if (length === 0)
+ ret = null;
+ else if (objectMode)
ret = list.shift();
+ else if (!n || n >= length) {
+ // read it all, truncate the array.
+ if (stringMode)
+ ret = list.join('');
+ else
+ ret = Buffer.concat(list, length);
+ list.length = 0;
} else {
- // result spans more than one buffer
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
- }
- return ret;
-}
-
-// Copies a specified amount of characters from the list of buffered data
-// chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBufferString(n, list) {
- var p = list.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = str.slice(nb);
+ // read just some of it.
+ if (n < list[0].length) {
+ // just take a part of the first list item.
+ // slice is the same for buffers and strings.
+ var buf = list[0];
+ ret = buf.slice(0, n);
+ list[0] = buf.slice(n);
+ } else if (n === list[0].length) {
+ // first list is a perfect match
+ ret = list.shift();
+ } else {
+ // complex case.
+ // we have enough to cover it, but it spans past the first buffer.
+ if (stringMode)
+ ret = '';
+ else
+ ret = new Buffer(n);
+
+ var c = 0;
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
+ var buf = list[0];
+ var cpy = Math.min(n - c, buf.length);
+
+ if (stringMode)
+ ret += buf.slice(0, cpy);
+ else
+ buf.copy(ret, c, 0, cpy);
+
+ if (cpy < buf.length)
+ list[0] = buf.slice(cpy);
+ else
+ list.shift();
+
+ c += cpy;
}
- break;
}
- ++c;
}
- list.length -= c;
- return ret;
-}
-// Copies a specified amount of bytes from the list of buffered data chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBuffer(n, list) {
- var ret = Buffer.allocUnsafe(n);
- var p = list.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
return ret;
}
@@ -994,26 +921,31 @@ function endReadable(stream) {
// If we get here before consuming all the bytes, then that is a
// bug in node. Should never happen.
- if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+ if (state.length > 0)
+ throw new Error('endReadable called on non-empty stream');
if (!state.endEmitted) {
state.ended = true;
- pna.nextTick(endReadableNT, state, stream);
+ process.nextTick(function() {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+ });
}
}
-function endReadableNT(state, stream) {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
+function forEach (xs, f) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ f(xs[i], i);
}
}
-function indexOf(xs, x) {
+function indexOf (xs, x) {
for (var i = 0, l = xs.length; i < l; i++) {
if (xs[i] === x) return i;
}
return -1;
-}
\ No newline at end of file
+}
diff --git a/node_modules/readable-stream/lib/_stream_transform.js b/node_modules/readable-stream/lib/_stream_transform.js
index fcfc105..905c5e4 100644
--- a/node_modules/readable-stream/lib/_stream_transform.js
+++ b/node_modules/readable-stream/lib/_stream_transform.js
@@ -19,6 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
// a transform stream is a readable/writable stream where you do
// something with the data. Sometimes it's called a "filter",
// but that's not a great name for it, since that implies a thing where
@@ -61,57 +62,65 @@
// would be consumed, and then the rest would wait (un-transformed) until
// the results of the previous transformed chunk were consumed.
-'use strict';
-
module.exports = Transform;
var Duplex = require('./_stream_duplex');
/**/
-var util = Object.create(require('core-util-is'));
+var util = require('core-util-is');
util.inherits = require('inherits');
/**/
util.inherits(Transform, Duplex);
-function afterTransform(er, data) {
- var ts = this._transformState;
+
+function TransformState(options, stream) {
+ this.afterTransform = function(er, data) {
+ return afterTransform(stream, er, data);
+ };
+
+ this.needTransform = false;
+ this.transforming = false;
+ this.writecb = null;
+ this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+ var ts = stream._transformState;
ts.transforming = false;
var cb = ts.writecb;
- if (!cb) {
- return this.emit('error', new Error('write callback called multiple times'));
- }
+ if (!cb)
+ return stream.emit('error', new Error('no writecb in Transform class'));
ts.writechunk = null;
ts.writecb = null;
- if (data != null) // single equals check for both `null` and `undefined`
- this.push(data);
+ if (!util.isNullOrUndefined(data))
+ stream.push(data);
- cb(er);
+ if (cb)
+ cb(er);
- var rs = this._readableState;
+ var rs = stream._readableState;
rs.reading = false;
if (rs.needReadable || rs.length < rs.highWaterMark) {
- this._read(rs.highWaterMark);
+ stream._read(rs.highWaterMark);
}
}
+
function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
+ if (!(this instanceof Transform))
+ return new Transform(options);
Duplex.call(this, options);
- this._transformState = {
- afterTransform: afterTransform.bind(this),
- needTransform: false,
- transforming: false,
- writecb: null,
- writechunk: null,
- writeencoding: null
- };
+ this._transformState = new TransformState(options, this);
+
+ // when the writable side finishes, then flush out anything remaining.
+ var stream = this;
// start out asking for a readable event once data is transformed.
this._readableState.needReadable = true;
@@ -121,29 +130,17 @@ function Transform(options) {
// sync guard flag.
this._readableState.sync = false;
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
-
- if (typeof options.flush === 'function') this._flush = options.flush;
- }
-
- // When the writable side finishes, then flush out anything remaining.
- this.on('prefinish', prefinish);
-}
-
-function prefinish() {
- var _this = this;
-
- if (typeof this._flush === 'function') {
- this._flush(function (er, data) {
- done(_this, er, data);
- });
- } else {
- done(this, null, null);
- }
+ this.once('prefinish', function() {
+ if (util.isFunction(this._flush))
+ this._flush(function(er) {
+ done(stream, er);
+ });
+ else
+ done(stream);
+ });
}
-Transform.prototype.push = function (chunk, encoding) {
+Transform.prototype.push = function(chunk, encoding) {
this._transformState.needTransform = false;
return Duplex.prototype.push.call(this, chunk, encoding);
};
@@ -158,28 +155,31 @@ Transform.prototype.push = function (chunk, encoding) {
// Call `cb(err)` when you are done with this chunk. If you pass
// an error, then that'll put the hurt on the whole operation. If you
// never call cb(), then you'll never get another chunk.
-Transform.prototype._transform = function (chunk, encoding, cb) {
- throw new Error('_transform() is not implemented');
+Transform.prototype._transform = function(chunk, encoding, cb) {
+ throw new Error('not implemented');
};
-Transform.prototype._write = function (chunk, encoding, cb) {
+Transform.prototype._write = function(chunk, encoding, cb) {
var ts = this._transformState;
ts.writecb = cb;
ts.writechunk = chunk;
ts.writeencoding = encoding;
if (!ts.transforming) {
var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ if (ts.needTransform ||
+ rs.needReadable ||
+ rs.length < rs.highWaterMark)
+ this._read(rs.highWaterMark);
}
};
// Doesn't matter what the args are here.
// _transform does all the work.
// That we got here means that the readable side wants more data.
-Transform.prototype._read = function (n) {
+Transform.prototype._read = function(n) {
var ts = this._transformState;
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {
ts.transforming = true;
this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
} else {
@@ -189,26 +189,21 @@ Transform.prototype._read = function (n) {
}
};
-Transform.prototype._destroy = function (err, cb) {
- var _this2 = this;
- Duplex.prototype._destroy.call(this, err, function (err2) {
- cb(err2);
- _this2.emit('close');
- });
-};
-
-function done(stream, er, data) {
- if (er) return stream.emit('error', er);
-
- if (data != null) // single equals check for both `null` and `undefined`
- stream.push(data);
+function done(stream, er) {
+ if (er)
+ return stream.emit('error', er);
// if there's nothing in the write buffer, then that means
// that nothing more will ever be provided
- if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+ var ws = stream._writableState;
+ var ts = stream._transformState;
+
+ if (ws.length)
+ throw new Error('calling transform done when ws.length != 0');
- if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+ if (ts.transforming)
+ throw new Error('calling transform done when still transforming');
return stream.push(null);
-}
\ No newline at end of file
+}
diff --git a/node_modules/readable-stream/lib/_stream_writable.js b/node_modules/readable-stream/lib/_stream_writable.js
index b0b0220..db8539c 100644
--- a/node_modules/readable-stream/lib/_stream_writable.js
+++ b/node_modules/readable-stream/lib/_stream_writable.js
@@ -20,117 +20,55 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// A bit simpler than readable streams.
-// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// Implement an async ._write(chunk, cb), and it'll handle all
// the drain event emission and buffering.
-'use strict';
-
-/**/
-
-var pna = require('process-nextick-args');
-/**/
-
module.exports = Writable;
-/* */
-function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
-}
-
-// It seems a linked list but it is not
-// there will be only 2 of these for each stream
-function CorkedRequest(state) {
- var _this = this;
-
- this.next = null;
- this.entry = null;
- this.finish = function () {
- onCorkedFinish(_this, state);
- };
-}
-/* */
-
-/**/
-var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
-/**/
-
/**/
-var Duplex;
+var Buffer = require('buffer').Buffer;
/**/
Writable.WritableState = WritableState;
-/**/
-var util = Object.create(require('core-util-is'));
-util.inherits = require('inherits');
-/**/
-
-/**/
-var internalUtil = {
- deprecate: require('util-deprecate')
-};
-/**/
-
-/**/
-var Stream = require('./internal/streams/stream');
-/**/
/**/
-
-var Buffer = require('safe-buffer').Buffer;
-var OurUint8Array = global.Uint8Array || function () {};
-function _uint8ArrayToBuffer(chunk) {
- return Buffer.from(chunk);
-}
-function _isUint8Array(obj) {
- return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
-}
-
+var util = require('core-util-is');
+util.inherits = require('inherits');
/**/
-var destroyImpl = require('./internal/streams/destroy');
+var Stream = require('stream');
util.inherits(Writable, Stream);
-function nop() {}
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+}
function WritableState(options, stream) {
- Duplex = Duplex || require('./_stream_duplex');
+ var Duplex = require('./_stream_duplex');
options = options || {};
- // Duplex streams are both readable and writable, but share
- // the same options object.
- // However, some cases require setting options to different
- // values for the readable and the writable sides of the duplex stream.
- // These options can be provided separately as readableXXX and writableXXX.
- var isDuplex = stream instanceof Duplex;
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
-
- if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
-
// the point at which write() starts returning false
// Note: 0 is a valid value, means that we always return false if
// the entire buffer is not flushed immediately on write()
var hwm = options.highWaterMark;
- var writableHwm = options.writableHighWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+ var defaultHwm = options.objectMode ? 16 : 16 * 1024;
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
- if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
- // cast to ints.
- this.highWaterMark = Math.floor(this.highWaterMark);
+ if (stream instanceof Duplex)
+ this.objectMode = this.objectMode || !!options.writableObjectMode;
- // if _final has been called
- this.finalCalled = false;
+ // cast to ints.
+ this.highWaterMark = ~~this.highWaterMark;
- // drain event flag.
this.needDrain = false;
// at the start of calling end()
this.ending = false;
@@ -139,9 +77,6 @@ function WritableState(options, stream) {
// when 'finish' is emitted
this.finished = false;
- // has it been destroyed
- this.destroyed = false;
-
// should we decode strings into buffers before passing to _write?
// this is here so that some node-core streams can optimize string
// handling at a lower level.
@@ -176,7 +111,7 @@ function WritableState(options, stream) {
this.bufferProcessing = false;
// the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
+ this.onwrite = function(er) {
onwrite(stream, er);
};
@@ -186,8 +121,7 @@ function WritableState(options, stream) {
// the amount that is being written when _write is called.
this.writelen = 0;
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
+ this.buffer = [];
// number of pending user-supplied write callbacks
// this must be 0 before 'finish' can be emitted
@@ -199,223 +133,137 @@ function WritableState(options, stream) {
// True if the error was already emitted and should not be thrown again
this.errorEmitted = false;
-
- // count buffered requests
- this.bufferedRequestCount = 0;
-
- // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
-}
-
-WritableState.prototype.getBuffer = function getBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
-};
-
-(function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function () {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
- });
- } catch (_) {}
-})();
-
-// Test _writableState for inheritance to account for Duplex streams,
-// whose prototype chain only points to Readable.
-var realHasInstance;
-if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
- realHasInstance = Function.prototype[Symbol.hasInstance];
- Object.defineProperty(Writable, Symbol.hasInstance, {
- value: function (object) {
- if (realHasInstance.call(this, object)) return true;
- if (this !== Writable) return false;
-
- return object && object._writableState instanceof WritableState;
- }
- });
-} else {
- realHasInstance = function (object) {
- return object instanceof this;
- };
}
function Writable(options) {
- Duplex = Duplex || require('./_stream_duplex');
-
- // Writable ctor is applied to Duplexes, too.
- // `realHasInstance` is necessary because using plain `instanceof`
- // would return false, as no `_writableState` property is attached.
+ var Duplex = require('./_stream_duplex');
- // Trying to use the custom `instanceof` for Writable here will also break the
- // Node.js LazyTransform implementation, which has a non-trivial getter for
- // `_writableState` that would lead to infinite recursion.
- if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+ // Writable ctor is applied to Duplexes, though they're not
+ // instanceof Writable, they're instanceof Readable.
+ if (!(this instanceof Writable) && !(this instanceof Duplex))
return new Writable(options);
- }
this._writableState = new WritableState(options, this);
// legacy.
this.writable = true;
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
-
- if (typeof options.writev === 'function') this._writev = options.writev;
-
- if (typeof options.destroy === 'function') this._destroy = options.destroy;
-
- if (typeof options.final === 'function') this._final = options.final;
- }
-
Stream.call(this);
}
// Otherwise people can pipe Writable streams, which is just wrong.
-Writable.prototype.pipe = function () {
- this.emit('error', new Error('Cannot pipe, not readable'));
+Writable.prototype.pipe = function() {
+ this.emit('error', new Error('Cannot pipe. Not readable.'));
};
-function writeAfterEnd(stream, cb) {
+
+function writeAfterEnd(stream, state, cb) {
var er = new Error('write after end');
// TODO: defer error events consistently everywhere, not just the cb
stream.emit('error', er);
- pna.nextTick(cb, er);
+ process.nextTick(function() {
+ cb(er);
+ });
}
-// Checks that a user-supplied chunk is valid, especially for the particular
-// mode the stream is in. Currently this means that `null` is never accepted
-// and undefined/non-string values are only allowed in object mode.
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
function validChunk(stream, state, chunk, cb) {
var valid = true;
- var er = false;
-
- if (chunk === null) {
- er = new TypeError('May not write null values to stream');
- } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- if (er) {
+ if (!util.isBuffer(chunk) &&
+ !util.isString(chunk) &&
+ !util.isNullOrUndefined(chunk) &&
+ !state.objectMode) {
+ var er = new TypeError('Invalid non-string/buffer chunk');
stream.emit('error', er);
- pna.nextTick(cb, er);
+ process.nextTick(function() {
+ cb(er);
+ });
valid = false;
}
return valid;
}
-Writable.prototype.write = function (chunk, encoding, cb) {
+Writable.prototype.write = function(chunk, encoding, cb) {
var state = this._writableState;
var ret = false;
- var isBuf = !state.objectMode && _isUint8Array(chunk);
-
- if (isBuf && !Buffer.isBuffer(chunk)) {
- chunk = _uint8ArrayToBuffer(chunk);
- }
- if (typeof encoding === 'function') {
+ if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
- if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+ if (util.isBuffer(chunk))
+ encoding = 'buffer';
+ else if (!encoding)
+ encoding = state.defaultEncoding;
- if (typeof cb !== 'function') cb = nop;
+ if (!util.isFunction(cb))
+ cb = function() {};
- if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ if (state.ended)
+ writeAfterEnd(this, state, cb);
+ else if (validChunk(this, state, chunk, cb)) {
state.pendingcb++;
- ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ ret = writeOrBuffer(this, state, chunk, encoding, cb);
}
return ret;
};
-Writable.prototype.cork = function () {
+Writable.prototype.cork = function() {
var state = this._writableState;
state.corked++;
};
-Writable.prototype.uncork = function () {
+Writable.prototype.uncork = function() {
var state = this._writableState;
if (state.corked) {
state.corked--;
- if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ if (!state.writing &&
+ !state.corked &&
+ !state.finished &&
+ !state.bufferProcessing &&
+ state.buffer.length)
+ clearBuffer(this, state);
}
};
-Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
- this._writableState.defaultEncoding = encoding;
- return this;
-};
-
function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = Buffer.from(chunk, encoding);
+ if (!state.objectMode &&
+ state.decodeStrings !== false &&
+ util.isString(chunk)) {
+ chunk = new Buffer(chunk, encoding);
}
return chunk;
}
-Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
- // making it explicit this property is not enumerable
- // because otherwise some prototype manipulation in
- // userland will fail
- enumerable: false,
- get: function () {
- return this._writableState.highWaterMark;
- }
-});
-
// if we're already writing something, then just put this
// in the queue, and wait our turn. Otherwise, call _write
// If we return false, then we need a drain event, so set that flag.
-function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
- if (!isBuf) {
- var newChunk = decodeChunk(state, chunk, encoding);
- if (chunk !== newChunk) {
- isBuf = true;
- encoding = 'buffer';
- chunk = newChunk;
- }
- }
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+ chunk = decodeChunk(state, chunk, encoding);
+ if (util.isBuffer(chunk))
+ encoding = 'buffer';
var len = state.objectMode ? 1 : chunk.length;
state.length += len;
var ret = state.length < state.highWaterMark;
// we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
-
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = {
- chunk: chunk,
- encoding: encoding,
- isBuf: isBuf,
- callback: cb,
- next: null
- };
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
+ if (!ret)
+ state.needDrain = true;
+
+ if (state.writing || state.corked)
+ state.buffer.push(new WriteReq(chunk, encoding, cb));
+ else
doWrite(stream, state, false, len, chunk, encoding, cb);
- }
return ret;
}
@@ -425,32 +273,26 @@ function doWrite(stream, state, writev, len, chunk, encoding, cb) {
state.writecb = cb;
state.writing = true;
state.sync = true;
- if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ if (writev)
+ stream._writev(chunk, state.onwrite);
+ else
+ stream._write(chunk, encoding, state.onwrite);
state.sync = false;
}
function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
-
- if (sync) {
- // defer the callback if we are being called synchronously
- // to avoid piling up things on the stack
- pna.nextTick(cb, er);
- // this can emit finish, and it will always happen
- // after error
- pna.nextTick(finishMaybe, stream, state);
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
- } else {
- // the caller expect this to happen before if
- // it is async
+ if (sync)
+ process.nextTick(function() {
+ state.pendingcb--;
+ cb(er);
+ });
+ else {
+ state.pendingcb--;
cb(er);
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
- // this can emit finish, but finish must
- // always follow error
- finishMaybe(stream, state);
}
+
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
}
function onwriteStateUpdate(state) {
@@ -467,18 +309,23 @@ function onwrite(stream, er) {
onwriteStateUpdate(state);
- if (er) onwriteError(stream, state, sync, er, cb);else {
+ if (er)
+ onwriteError(stream, state, sync, er, cb);
+ else {
// Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state);
+ var finished = needFinish(stream, state);
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ if (!finished &&
+ !state.corked &&
+ !state.bufferProcessing &&
+ state.buffer.length) {
clearBuffer(stream, state);
}
if (sync) {
- /**/
- asyncWrite(afterWrite, stream, state, finished, cb);
- /**/
+ process.nextTick(function() {
+ afterWrite(stream, state, finished, cb);
+ });
} else {
afterWrite(stream, state, finished, cb);
}
@@ -486,7 +333,8 @@ function onwrite(stream, er) {
}
function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
+ if (!finished)
+ onwriteDrain(stream, state);
state.pendingcb--;
cb();
finishMaybe(stream, state);
@@ -502,87 +350,80 @@ function onwriteDrain(stream, state) {
}
}
+
// if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) {
state.bufferProcessing = true;
- var entry = state.bufferedRequest;
- if (stream._writev && entry && entry.next) {
+ if (stream._writev && state.buffer.length > 1) {
// Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
-
- var count = 0;
- var allBuffers = true;
- while (entry) {
- buffer[count] = entry;
- if (!entry.isBuf) allBuffers = false;
- entry = entry.next;
- count += 1;
- }
- buffer.allBuffers = allBuffers;
-
- doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+ var cbs = [];
+ for (var c = 0; c < state.buffer.length; c++)
+ cbs.push(state.buffer[c].callback);
- // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
+ // count the one we are adding, as well.
+ // TODO(isaacs) clean this up
state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- state.bufferedRequestCount = 0;
+ doWrite(stream, state, true, state.length, state.buffer, '', function(err) {
+ for (var i = 0; i < cbs.length; i++) {
+ state.pendingcb--;
+ cbs[i](err);
+ }
+ });
+
+ // Clear buffer
+ state.buffer = [];
} else {
// Slow case, write chunks one-by-one
- while (entry) {
+ for (var c = 0; c < state.buffer.length; c++) {
+ var entry = state.buffer[c];
var chunk = entry.chunk;
var encoding = entry.encoding;
var cb = entry.callback;
var len = state.objectMode ? 1 : chunk.length;
doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- state.bufferedRequestCount--;
+
// if we didn't call the onwrite immediately, then
// it means that we need to wait until it does.
// also, that means that the chunk and cb are currently
// being processed, so move the buffer counter past them.
if (state.writing) {
+ c++;
break;
}
}
- if (entry === null) state.lastBufferedRequest = null;
+ if (c < state.buffer.length)
+ state.buffer = state.buffer.slice(c);
+ else
+ state.buffer.length = 0;
}
- state.bufferedRequest = entry;
state.bufferProcessing = false;
}
-Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new Error('_write() is not implemented'));
+Writable.prototype._write = function(chunk, encoding, cb) {
+ cb(new Error('not implemented'));
+
};
Writable.prototype._writev = null;
-Writable.prototype.end = function (chunk, encoding, cb) {
+Writable.prototype.end = function(chunk, encoding, cb) {
var state = this._writableState;
- if (typeof chunk === 'function') {
+ if (util.isFunction(chunk)) {
cb = chunk;
chunk = null;
encoding = null;
- } else if (typeof encoding === 'function') {
+ } else if (util.isFunction(encoding)) {
cb = encoding;
encoding = null;
}
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+ if (!util.isNullOrUndefined(chunk))
+ this.write(chunk, encoding);
// .end() fully uncorks
if (state.corked) {
@@ -591,44 +432,34 @@ Writable.prototype.end = function (chunk, encoding, cb) {
}
// ignore unnecessary end() calls.
- if (!state.ending && !state.finished) endWritable(this, state, cb);
+ if (!state.ending && !state.finished)
+ endWritable(this, state, cb);
};
-function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+
+function needFinish(stream, state) {
+ return (state.ending &&
+ state.length === 0 &&
+ !state.finished &&
+ !state.writing);
}
-function callFinal(stream, state) {
- stream._final(function (err) {
- state.pendingcb--;
- if (err) {
- stream.emit('error', err);
- }
+
+function prefinish(stream, state) {
+ if (!state.prefinished) {
state.prefinished = true;
stream.emit('prefinish');
- finishMaybe(stream, state);
- });
-}
-function prefinish(stream, state) {
- if (!state.prefinished && !state.finalCalled) {
- if (typeof stream._final === 'function') {
- state.pendingcb++;
- state.finalCalled = true;
- pna.nextTick(callFinal, stream, state);
- } else {
- state.prefinished = true;
- stream.emit('prefinish');
- }
}
}
function finishMaybe(stream, state) {
- var need = needFinish(state);
+ var need = needFinish(stream, state);
if (need) {
- prefinish(stream, state);
if (state.pendingcb === 0) {
+ prefinish(stream, state);
state.finished = true;
stream.emit('finish');
- }
+ } else
+ prefinish(stream, state);
}
return need;
}
@@ -637,51 +468,10 @@ function endWritable(stream, state, cb) {
state.ending = true;
finishMaybe(stream, state);
if (cb) {
- if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+ if (state.finished)
+ process.nextTick(cb);
+ else
+ stream.once('finish', cb);
}
state.ended = true;
- stream.writable = false;
}
-
-function onCorkedFinish(corkReq, state, err) {
- var entry = corkReq.entry;
- corkReq.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
- if (state.corkedRequestsFree) {
- state.corkedRequestsFree.next = corkReq;
- } else {
- state.corkedRequestsFree = corkReq;
- }
-}
-
-Object.defineProperty(Writable.prototype, 'destroyed', {
- get: function () {
- if (this._writableState === undefined) {
- return false;
- }
- return this._writableState.destroyed;
- },
- set: function (value) {
- // we ignore the value if the stream
- // has not been initialized yet
- if (!this._writableState) {
- return;
- }
-
- // backward compatibility, the user is explicitly
- // managing destroyed
- this._writableState.destroyed = value;
- }
-});
-
-Writable.prototype.destroy = destroyImpl.destroy;
-Writable.prototype._undestroy = destroyImpl.undestroy;
-Writable.prototype._destroy = function (err, cb) {
- this.end();
- cb(err);
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/BufferList.js b/node_modules/readable-stream/lib/internal/streams/BufferList.js
deleted file mode 100644
index aefc68b..0000000
--- a/node_modules/readable-stream/lib/internal/streams/BufferList.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-var Buffer = require('safe-buffer').Buffer;
-var util = require('util');
-
-function copyBuffer(src, target, offset) {
- src.copy(target, offset);
-}
-
-module.exports = function () {
- function BufferList() {
- _classCallCheck(this, BufferList);
-
- this.head = null;
- this.tail = null;
- this.length = 0;
- }
-
- BufferList.prototype.push = function push(v) {
- var entry = { data: v, next: null };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
- };
-
- BufferList.prototype.unshift = function unshift(v) {
- var entry = { data: v, next: this.head };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
- };
-
- BufferList.prototype.shift = function shift() {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
- };
-
- BufferList.prototype.clear = function clear() {
- this.head = this.tail = null;
- this.length = 0;
- };
-
- BufferList.prototype.join = function join(s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }return ret;
- };
-
- BufferList.prototype.concat = function concat(n) {
- if (this.length === 0) return Buffer.alloc(0);
- if (this.length === 1) return this.head.data;
- var ret = Buffer.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- copyBuffer(p.data, ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
- };
-
- return BufferList;
-}();
-
-if (util && util.inspect && util.inspect.custom) {
- module.exports.prototype[util.inspect.custom] = function () {
- var obj = util.inspect({ length: this.length });
- return this.constructor.name + ' ' + obj;
- };
-}
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/destroy.js b/node_modules/readable-stream/lib/internal/streams/destroy.js
deleted file mode 100644
index 5a0a0d8..0000000
--- a/node_modules/readable-stream/lib/internal/streams/destroy.js
+++ /dev/null
@@ -1,74 +0,0 @@
-'use strict';
-
-/**/
-
-var pna = require('process-nextick-args');
-/**/
-
-// undocumented cb() API, needed for core, not for public API
-function destroy(err, cb) {
- var _this = this;
-
- var readableDestroyed = this._readableState && this._readableState.destroyed;
- var writableDestroyed = this._writableState && this._writableState.destroyed;
-
- if (readableDestroyed || writableDestroyed) {
- if (cb) {
- cb(err);
- } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
- pna.nextTick(emitErrorNT, this, err);
- }
- return this;
- }
-
- // we set destroyed to true before firing error callbacks in order
- // to make it re-entrance safe in case destroy() is called within callbacks
-
- if (this._readableState) {
- this._readableState.destroyed = true;
- }
-
- // if this is a duplex stream mark the writable part as destroyed as well
- if (this._writableState) {
- this._writableState.destroyed = true;
- }
-
- this._destroy(err || null, function (err) {
- if (!cb && err) {
- pna.nextTick(emitErrorNT, _this, err);
- if (_this._writableState) {
- _this._writableState.errorEmitted = true;
- }
- } else if (cb) {
- cb(err);
- }
- });
-
- return this;
-}
-
-function undestroy() {
- if (this._readableState) {
- this._readableState.destroyed = false;
- this._readableState.reading = false;
- this._readableState.ended = false;
- this._readableState.endEmitted = false;
- }
-
- if (this._writableState) {
- this._writableState.destroyed = false;
- this._writableState.ended = false;
- this._writableState.ending = false;
- this._writableState.finished = false;
- this._writableState.errorEmitted = false;
- }
-}
-
-function emitErrorNT(self, err) {
- self.emit('error', err);
-}
-
-module.exports = {
- destroy: destroy,
- undestroy: undestroy
-};
\ No newline at end of file
diff --git a/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/node_modules/readable-stream/lib/internal/streams/stream-browser.js
deleted file mode 100644
index 9332a3f..0000000
--- a/node_modules/readable-stream/lib/internal/streams/stream-browser.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('events').EventEmitter;
diff --git a/node_modules/readable-stream/lib/internal/streams/stream.js b/node_modules/readable-stream/lib/internal/streams/stream.js
deleted file mode 100644
index ce2ad5b..0000000
--- a/node_modules/readable-stream/lib/internal/streams/stream.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('stream');
diff --git a/node_modules/readable-stream/package.json b/node_modules/readable-stream/package.json
index 2afa6fb..0bb83ed 100644
--- a/node_modules/readable-stream/package.json
+++ b/node_modules/readable-stream/package.json
@@ -1,35 +1,23 @@
{
"name": "readable-stream",
- "version": "2.3.7",
- "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "version": "1.1.14",
+ "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x",
"main": "readable.js",
"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"
+ "isarray": "0.0.1",
+ "string_decoder": "~0.10.x",
+ "inherits": "~2.0.1"
},
"devDependencies": {
- "assert": "^1.4.0",
- "babel-polyfill": "^6.9.1",
- "buffer": "^4.9.0",
- "lolex": "^2.3.2",
- "nyc": "^6.4.0",
- "tap": "^0.7.0",
- "tape": "^4.8.0"
+ "tap": "~0.2.6"
},
"scripts": {
- "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js",
- "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
- "cover": "nyc npm test",
- "report": "nyc report --reporter=lcov"
+ "test": "tap test/simple/*.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/nodejs/readable-stream"
+ "url": "git://github.com/isaacs/readable-stream"
},
"keywords": [
"readable",
@@ -37,16 +25,8 @@
"pipe"
],
"browser": {
- "util": false,
- "./readable.js": "./readable-browser.js",
- "./writable.js": "./writable-browser.js",
- "./duplex.js": "./duplex-browser.js",
- "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
- },
- "nyc": {
- "include": [
- "lib/**.js"
- ]
+ "util": false
},
+ "author": "Isaac Z. Schlueter (http://blog.izs.me/)",
"license": "MIT"
}
diff --git a/node_modules/readable-stream/passthrough.js b/node_modules/readable-stream/passthrough.js
index ffd791d..27e8d8a 100644
--- a/node_modules/readable-stream/passthrough.js
+++ b/node_modules/readable-stream/passthrough.js
@@ -1 +1 @@
-module.exports = require('./readable').PassThrough
+module.exports = require("./lib/_stream_passthrough.js")
diff --git a/node_modules/readable-stream/readable-browser.js b/node_modules/readable-stream/readable-browser.js
deleted file mode 100644
index e503725..0000000
--- a/node_modules/readable-stream/readable-browser.js
+++ /dev/null
@@ -1,7 +0,0 @@
-exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = exports;
-exports.Readable = exports;
-exports.Writable = require('./lib/_stream_writable.js');
-exports.Duplex = require('./lib/_stream_duplex.js');
-exports.Transform = require('./lib/_stream_transform.js');
-exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/node_modules/readable-stream/readable.js b/node_modules/readable-stream/readable.js
index ec89ec5..2a8b5c6 100644
--- a/node_modules/readable-stream/readable.js
+++ b/node_modules/readable-stream/readable.js
@@ -1,19 +1,10 @@
-var Stream = require('stream');
-if (process.env.READABLE_STREAM === 'disable' && Stream) {
- module.exports = Stream;
- exports = module.exports = Stream.Readable;
- exports.Readable = Stream.Readable;
- exports.Writable = Stream.Writable;
- exports.Duplex = Stream.Duplex;
- exports.Transform = Stream.Transform;
- exports.PassThrough = Stream.PassThrough;
- exports.Stream = Stream;
-} else {
- exports = module.exports = require('./lib/_stream_readable.js');
- exports.Stream = Stream || exports;
- exports.Readable = exports;
- exports.Writable = require('./lib/_stream_writable.js');
- exports.Duplex = require('./lib/_stream_duplex.js');
- exports.Transform = require('./lib/_stream_transform.js');
- exports.PassThrough = require('./lib/_stream_passthrough.js');
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = require('stream');
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
+if (!process.browser && process.env.READABLE_STREAM === 'disable') {
+ module.exports = require('stream');
}
diff --git a/node_modules/readable-stream/transform.js b/node_modules/readable-stream/transform.js
index b1baba2..5d482f0 100644
--- a/node_modules/readable-stream/transform.js
+++ b/node_modules/readable-stream/transform.js
@@ -1 +1 @@
-module.exports = require('./readable').Transform
+module.exports = require("./lib/_stream_transform.js")
diff --git a/node_modules/readable-stream/writable-browser.js b/node_modules/readable-stream/writable-browser.js
deleted file mode 100644
index ebdde6a..0000000
--- a/node_modules/readable-stream/writable-browser.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib/_stream_writable.js');
diff --git a/node_modules/readable-stream/writable.js b/node_modules/readable-stream/writable.js
index 3211a6f..e1e9efd 100644
--- a/node_modules/readable-stream/writable.js
+++ b/node_modules/readable-stream/writable.js
@@ -1,8 +1 @@
-var Stream = require("stream")
-var Writable = require("./lib/_stream_writable.js")
-
-if (process.env.READABLE_STREAM === 'disable') {
- module.exports = Stream && Stream.Writable || Writable
-} else {
- module.exports = Writable
-}
+module.exports = require("./lib/_stream_writable.js")
diff --git a/node_modules/string_decoder/.travis.yml b/node_modules/string_decoder/.travis.yml
deleted file mode 100644
index 3347a72..0000000
--- a/node_modules/string_decoder/.travis.yml
+++ /dev/null
@@ -1,50 +0,0 @@
-sudo: false
-language: node_js
-before_install:
- - npm install -g npm@2
- - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
-notifications:
- email: false
-matrix:
- fast_finish: true
- include:
- - node_js: '0.8'
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: '0.10'
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: '0.11'
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: '0.12'
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: 1
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: 2
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: 3
- env:
- - TASK=test
- - NPM_LEGACY=true
- - node_js: 4
- env: TASK=test
- - node_js: 5
- env: TASK=test
- - node_js: 6
- env: TASK=test
- - node_js: 7
- env: TASK=test
- - node_js: 8
- env: TASK=test
- - node_js: 9
- env: TASK=test
diff --git a/node_modules/string_decoder/LICENSE b/node_modules/string_decoder/LICENSE
index 778edb2..6de584a 100644
--- a/node_modules/string_decoder/LICENSE
+++ b/node_modules/string_decoder/LICENSE
@@ -1,48 +1,20 @@
-Node.js is licensed for use as follows:
-
-"""
-Copyright Node.js contributors. All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
-This license applies to parts of Node.js originating from the
-https://github.com/joyent/node repository:
-
-"""
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-"""
-
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/string_decoder/README.md b/node_modules/string_decoder/README.md
index 5fd5831..4d2aa00 100644
--- a/node_modules/string_decoder/README.md
+++ b/node_modules/string_decoder/README.md
@@ -1,47 +1,7 @@
-# string_decoder
+**string_decoder.js** (`require('string_decoder')`) from Node.js core
-***Node-core v8.9.4 string_decoder for userland***
+Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
+Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
-[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)
-[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
-
-
-```bash
-npm install --save string_decoder
-```
-
-***Node-core string_decoder for userland***
-
-This package is a mirror of the string_decoder implementation in Node-core.
-
-Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
-
-As of version 1.0.0 **string_decoder** uses semantic versioning.
-
-## Previous versions
-
-Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
-
-## Update
-
-The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
-
-## Streams Working Group
-
-`string_decoder` is maintained by the Streams Working Group, which
-oversees the development and maintenance of the Streams API within
-Node.js. The responsibilities of the Streams Working Group include:
-
-* Addressing stream issues on the Node.js issue tracker.
-* Authoring and editing stream documentation within the Node.js project.
-* Reviewing changes to stream subclasses within the Node.js project.
-* Redirecting changes to streams from the Node.js project to this
- project.
-* Assisting in the implementation of stream providers within Node.js.
-* Recommending versions of `readable-stream` to be included in Node.js.
-* Messaging about the future of streams to give the community advance
- notice of changes.
-
-See [readable-stream](https://github.com/nodejs/readable-stream) for
-more details.
+The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.
\ No newline at end of file
diff --git a/node_modules/string_decoder/lib/string_decoder.js b/node_modules/string_decoder/lib/string_decoder.js
deleted file mode 100644
index 2e89e63..0000000
--- a/node_modules/string_decoder/lib/string_decoder.js
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-'use strict';
-
-/**/
-
-var Buffer = require('safe-buffer').Buffer;
-/**/
-
-var isEncoding = Buffer.isEncoding || function (encoding) {
- encoding = '' + encoding;
- switch (encoding && encoding.toLowerCase()) {
- case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
- return true;
- default:
- return false;
- }
-};
-
-function _normalizeEncoding(enc) {
- if (!enc) return 'utf8';
- var retried;
- while (true) {
- switch (enc) {
- case 'utf8':
- case 'utf-8':
- return 'utf8';
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return 'utf16le';
- case 'latin1':
- case 'binary':
- return 'latin1';
- case 'base64':
- case 'ascii':
- case 'hex':
- return enc;
- default:
- if (retried) return; // undefined
- enc = ('' + enc).toLowerCase();
- retried = true;
- }
- }
-};
-
-// Do not cache `Buffer.isEncoding` when checking encoding names as some
-// modules monkey-patch it to support additional encodings
-function normalizeEncoding(enc) {
- var nenc = _normalizeEncoding(enc);
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
- return nenc || enc;
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters.
-exports.StringDecoder = StringDecoder;
-function StringDecoder(encoding) {
- this.encoding = normalizeEncoding(encoding);
- var nb;
- switch (this.encoding) {
- case 'utf16le':
- this.text = utf16Text;
- this.end = utf16End;
- nb = 4;
- break;
- case 'utf8':
- this.fillLast = utf8FillLast;
- nb = 4;
- break;
- case 'base64':
- this.text = base64Text;
- this.end = base64End;
- nb = 3;
- break;
- default:
- this.write = simpleWrite;
- this.end = simpleEnd;
- return;
- }
- this.lastNeed = 0;
- this.lastTotal = 0;
- this.lastChar = Buffer.allocUnsafe(nb);
-}
-
-StringDecoder.prototype.write = function (buf) {
- if (buf.length === 0) return '';
- var r;
- var i;
- if (this.lastNeed) {
- r = this.fillLast(buf);
- if (r === undefined) return '';
- i = this.lastNeed;
- this.lastNeed = 0;
- } else {
- i = 0;
- }
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
- return r || '';
-};
-
-StringDecoder.prototype.end = utf8End;
-
-// Returns only complete characters in a Buffer
-StringDecoder.prototype.text = utf8Text;
-
-// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
-StringDecoder.prototype.fillLast = function (buf) {
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
- this.lastNeed -= buf.length;
-};
-
-// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
-// continuation byte. If an invalid byte is detected, -2 is returned.
-function utf8CheckByte(byte) {
- if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
- return byte >> 6 === 0x02 ? -1 : -2;
-}
-
-// Checks at most 3 bytes at the end of a Buffer in order to detect an
-// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
-// needed to complete the UTF-8 character (if applicable) are returned.
-function utf8CheckIncomplete(self, buf, i) {
- var j = buf.length - 1;
- if (j < i) return 0;
- var nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 1;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 2;
- return nb;
- }
- if (--j < i || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) {
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
- }
- return nb;
- }
- return 0;
-}
-
-// Validates as many continuation bytes for a multi-byte UTF-8 character as
-// needed or are available. If we see a non-continuation byte where we expect
-// one, we "replace" the validated continuation bytes we've seen so far with
-// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
-// behavior. The continuation byte check is included three times in the case
-// where all of the continuation bytes for a character exist in the same buffer.
-// It is also done this way as a slight performance increase instead of using a
-// loop.
-function utf8CheckExtraBytes(self, buf, p) {
- if ((buf[0] & 0xC0) !== 0x80) {
- self.lastNeed = 0;
- return '\ufffd';
- }
- if (self.lastNeed > 1 && buf.length > 1) {
- if ((buf[1] & 0xC0) !== 0x80) {
- self.lastNeed = 1;
- return '\ufffd';
- }
- if (self.lastNeed > 2 && buf.length > 2) {
- if ((buf[2] & 0xC0) !== 0x80) {
- self.lastNeed = 2;
- return '\ufffd';
- }
- }
- }
-}
-
-// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
-function utf8FillLast(buf) {
- var p = this.lastTotal - this.lastNeed;
- var r = utf8CheckExtraBytes(this, buf, p);
- if (r !== undefined) return r;
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, p, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, p, 0, buf.length);
- this.lastNeed -= buf.length;
-}
-
-// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
-// partial character, the character's bytes are buffered until the required
-// number of bytes are available.
-function utf8Text(buf, i) {
- var total = utf8CheckIncomplete(this, buf, i);
- if (!this.lastNeed) return buf.toString('utf8', i);
- this.lastTotal = total;
- var end = buf.length - (total - this.lastNeed);
- buf.copy(this.lastChar, 0, end);
- return buf.toString('utf8', i, end);
-}
-
-// For UTF-8, a replacement character is added when ending on a partial
-// character.
-function utf8End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + '\ufffd';
- return r;
-}
-
-// UTF-16LE typically needs two bytes per character, but even if we have an even
-// number of bytes available, we need to check if we end on a leading/high
-// surrogate. In that case, we need to wait for the next two bytes in order to
-// decode the last character properly.
-function utf16Text(buf, i) {
- if ((buf.length - i) % 2 === 0) {
- var r = buf.toString('utf16le', i);
- if (r) {
- var c = r.charCodeAt(r.length - 1);
- if (c >= 0xD800 && c <= 0xDBFF) {
- this.lastNeed = 2;
- this.lastTotal = 4;
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- return r.slice(0, -1);
- }
- }
- return r;
- }
- this.lastNeed = 1;
- this.lastTotal = 2;
- this.lastChar[0] = buf[buf.length - 1];
- return buf.toString('utf16le', i, buf.length - 1);
-}
-
-// For UTF-16LE we do not explicitly append special replacement characters if we
-// end on a partial character, we simply let v8 handle that.
-function utf16End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) {
- var end = this.lastTotal - this.lastNeed;
- return r + this.lastChar.toString('utf16le', 0, end);
- }
- return r;
-}
-
-function base64Text(buf, i) {
- var n = (buf.length - i) % 3;
- if (n === 0) return buf.toString('base64', i);
- this.lastNeed = 3 - n;
- this.lastTotal = 3;
- if (n === 1) {
- this.lastChar[0] = buf[buf.length - 1];
- } else {
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- }
- return buf.toString('base64', i, buf.length - n);
-}
-
-function base64End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
- return r;
-}
-
-// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
-function simpleWrite(buf) {
- return buf.toString(this.encoding);
-}
-
-function simpleEnd(buf) {
- return buf && buf.length ? this.write(buf) : '';
-}
\ No newline at end of file
diff --git a/node_modules/string_decoder/package.json b/node_modules/string_decoder/package.json
index 518c3eb..f2dd499 100644
--- a/node_modules/string_decoder/package.json
+++ b/node_modules/string_decoder/package.json
@@ -1,26 +1,20 @@
{
"name": "string_decoder",
- "version": "1.1.1",
+ "version": "0.10.31",
"description": "The string_decoder module from Node core",
- "main": "lib/string_decoder.js",
- "dependencies": {
- "safe-buffer": "~5.1.0"
- },
+ "main": "index.js",
+ "dependencies": {},
"devDependencies": {
- "babel-polyfill": "^6.23.0",
- "core-util-is": "^1.0.2",
- "inherits": "^2.0.3",
"tap": "~0.4.8"
},
"scripts": {
- "test": "tap test/parallel/*.js && node test/verify-dependencies",
- "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js"
+ "test": "tap test/simple/*.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/nodejs/string_decoder.git"
+ "url": "git://github.com/rvagg/string_decoder.git"
},
- "homepage": "https://github.com/nodejs/string_decoder",
+ "homepage": "https://github.com/rvagg/string_decoder",
"keywords": [
"string",
"decoder",
diff --git a/package.json b/package.json
index 3b3476f..151a1d9 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
- "dev": "ts-node src",
+ "dev": "nodemon -r ts-node src/index.ts",
"build": "tsc && node dist",
"test": "nodemon"
},
@@ -17,9 +17,14 @@
},
"dependencies": {
"@types/express": "^4.17.12",
+ "aws-sdk": "^2.943.0",
"bcryptjs": "^2.4.3",
"dotenv": "^10.0.0",
"express": "^4.17.1",
- "mongoose": "^5.13.0"
+ "express-validator": "^6.12.0",
+ "mongoose": "^5.13.0",
+ "multer": "^1.4.2",
+ "multer-s3": "^2.9.0",
+ "nodemon": "^2.0.12"
}
}
diff --git a/src/api/controller/calendarController.ts b/src/api/controller/calendarController.ts
new file mode 100644
index 0000000..2ffb34a
--- /dev/null
+++ b/src/api/controller/calendarController.ts
@@ -0,0 +1,18 @@
+var util = require('../../modules/util')
+var responseMessage = require('../../modules/responseMessage')
+var statusCode = require('../../modules/statusCode')
+const calendarService = require('../service/calendarService')
+
+module.exports={
+ getCalendar:async(req,res)=>{
+ const {year,month,part} = req.params
+ try{
+ console.log(month +'+'+part)
+ const result = await calendarService.getDiaryPerDate(year,month,part)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_GET_MONTH_CALENDAR,result))
+ }catch(err){
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+}
\ No newline at end of file
diff --git a/src/api/controller/chapterController.ts b/src/api/controller/chapterController.ts
new file mode 100644
index 0000000..8398888
--- /dev/null
+++ b/src/api/controller/chapterController.ts
@@ -0,0 +1,80 @@
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+const chapterService = require('../service/chapterService')
+
+module.exports = {
+ getChapterDiary: async (req, res) => {
+ const chapterId=req.params.id;//id를 뺴면 객체를 보내줌
+ try {
+ const result = await chapterService.getChapterDiary(chapterId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_GET_CHAPTER_PETDIARY , result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ getChapterList:async(req,res)=>{
+ const userId=req.params.id;
+ try {
+ const result = await chapterService.getChapterList(userId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_GET_CHAPTERLIST , result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ postChapterList:async(req,res)=>{
+ const userId=req.params.id
+ const chapterTitle=req.body.chapterTitle;
+ try {
+ const result = await chapterService.postChapterList(userId,chapterTitle)
+ res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_POST_CHAPTERLIST , result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ putChapterList:async(req,res)=>{
+ const chapterId=req.params.id
+ const chapterTitle=req.body.chapterTitle;
+ try {
+ const result = await chapterService.putChapterList(chapterId,chapterTitle)
+ res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_EDIT_CHAPTERLIST , result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ deleteChapterList:async(req,res)=>{
+ const chapterId=req.params.id
+ try {
+ const result = await chapterService.deleteChapterList(chapterId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_DELETE_CHAPTERLIST , result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ }
+}
+export{}
\ No newline at end of file
diff --git a/src/api/controller/diaryController.ts b/src/api/controller/diaryController.ts
new file mode 100644
index 0000000..6c65ac1
--- /dev/null
+++ b/src/api/controller/diaryController.ts
@@ -0,0 +1,96 @@
+var util = require('../../modules/util')
+var responseMessage = require('../../modules/responseMessage')
+var statusCode = require('../../modules/statusCode')
+var diaryService = require('../service/diaryService')
+var firstPartService = require('../service/firstPartService')
+module.exports = {
+ postPrologue: async (req, res) => {
+ const { userId } = req.params
+ const bookData = req.body;
+ //const bookImage = req.file.location
+ try {
+ await diaryService.postPrologue(userId, bookData)
+ //const result=await firstPartService.getMainPage(userId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_PROLOGUE))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ postPetDiary: async (req, res) => {
+ const diaryData = req.body;
+ //const diaryImages = req.files.map(file => file.location)
+ try {
+ const result = await diaryService.postPetDiary(diaryData)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_PETDIARY, ""))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ getPetDiary: async (req, res) => {
+ const petDiaryId = req.params.id;//id를 뺴면 객체를 보내줌
+ try {
+ const result = await diaryService.getPetDiary(petDiaryId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PETDIARY, result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ putPetDiary: async (req, res) => {
+ const petDiaryId = req.params.id;
+ const diaryData = req.body;
+ try {
+ const result = await diaryService.putPetDiary(petDiaryId, diaryData)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_PETDIARY, ""))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ deletePetDiary: async (req, res) => {
+ const petDiaryId = req.params.id;
+ try {
+ const result = await diaryService.deletePetDiary(petDiaryId,)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_PETDIARY, result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ postPetDiaryWithImage: async(req,res)=>{
+ const images = req.files.map(img=>img.location)
+ const diaryInfo = req.body
+ try{
+ await diaryService.postPetDiaryWithImage(images,diaryInfo)
+ }catch(err){
+ console.error(err)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ return res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/controller/firstPartController.ts b/src/api/controller/firstPartController.ts
new file mode 100644
index 0000000..435ab38
--- /dev/null
+++ b/src/api/controller/firstPartController.ts
@@ -0,0 +1,19 @@
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+const firstPartService=require('../service/firstPartService')
+
+
+module.exports = {
+ mainPage: async (req, res) => {
+ const { userId } = req.params;
+ try {
+ const result = await firstPartService.getMainPage(userId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_FIRSTPART_MAINPAGE, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ }
+}
+export{}
\ No newline at end of file
diff --git a/src/api/controller/petController.ts b/src/api/controller/petController.ts
new file mode 100644
index 0000000..1d31f71
--- /dev/null
+++ b/src/api/controller/petController.ts
@@ -0,0 +1,54 @@
+import { json } from "body-parser"
+
+var util = require('../../modules/util')
+var responseMessage = require('../../modules/responseMessage')
+var statusCode = require('../../modules/statusCode')
+const petService = require('../service/petService')
+
+
+module.exports = {
+ getRegisterPetInfo:async(req,res)=>{
+ try{
+ const result = await petService.getPetInfo()
+ console.log(typeof(statusCode.OK))
+ console.log(typeof(statusCode.INTERNAL_SERVER_ERROR))
+ return res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_GET_PET_INFO,result))
+ }catch(error){
+ console.error(error)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR,responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+ registerPet: async (req, res) => {
+ //let reqData=JSON.parse(JSON.stringify(req.body))
+ // console.log('type : '+typeof(reqData))
+ // console.log('toObject : '+reqData)
+ //const reqData = req.body
+ let reqData = req.body
+ //let images = req.files.map(file=>file.location)
+
+ //console.log('reqData : '+ reqData.pets[0])
+ //const test = JSON.parse(reqData.pets)
+ // console.log('11111111111111 : '+typeof(reqData.pets[0]))
+ // console.log('reqData : '+reqData.pets)
+ // console.log('userId : '+reqData.userId)
+ // console.log('pets : '+reqData.pets[0])
+ // console.log('gender : '+reqData.pets[0].gender)
+ // console.log('kind : '+reqData.pets[0].kind)
+ // console.log('title : '+reqData.pets[0].title)
+ // console.log('startDate : '+reqData.pets[0].startDate)
+ //console.log('reqData index : '+reqData.pets[0].name) //undifned
+ //console.log('reqData2 : '+typeof(test))
+ //console.log('images : '+images)
+ try {
+ const result = await petService.registerPet(reqData);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_REGISTER_PET, result))
+ } catch (err) {
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error(err)
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/controller/rainbowController.ts b/src/api/controller/rainbowController.ts
index 8a8ead0..b141eb6 100644
--- a/src/api/controller/rainbowController.ts
+++ b/src/api/controller/rainbowController.ts
@@ -1,17 +1,107 @@
-const util = require('../../modules/util')
-const responseMessage = require('../../modules/responseMessage')
-const statusCode = require('../../modules/statusCode')
+var util = require('../../modules/util')
+var responseMessage = require('../../modules/responseMessage')
+var statusCode = require('../../modules/statusCode')
const rainbowService = require('../service/rainbowService')
module.exports = {
mainPage: async (req, res) => {
const { userId, petId } = req.params;
try {
- const result = await rainbowService.getMainPage(userId, petId)
- res.status(statusCode.OK).send(util.success(statusCode.OK,responseMessage.SUCCESS_GET_RAINBOW_MAIN_PAGE,result))
+ const result = await rainbowService.getMainPage(userId, petId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_MAIN_PAGE, result))
} catch (err) {
console.error(err)
return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
}
+ },
+
+ selectRainbowPet: async (req, res) => {
+ try {
+ const result = await rainbowService.selectPet();
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_PET, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ setRainbowPet: async (req, res) => {
+ const petId = req.params.petId
+ try {
+ const result = await rainbowService.setPartingRainbowPet(petId);
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PARTING_PET_COMMENT, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ cancelPartingPet: async(req,res)=>{
+ const petId = req.params.petId
+ try{
+ await rainbowService.cancelPartingPet(petId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_PARTING_PET))
+ }catch(err){
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ getReadyPartingPetComment: async (req, res) => {
+ const petId = req.params.petId
+ try {
+ const result = await rainbowService.getReadyPartingPetComment(petId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_READY_PARTING_PET_COMMENT, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ theBestMoment: async (req, res) => { //보류 무지개 로직 제일 마지막에 구현
+ const { userId, petId } = req.params
+ try {
+ const result = await rainbowService.getTheBestMoment(userId, petId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_BEST_MOMENT, result, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ getPartingPetName: async (req, res) => {
+ const { petId } = req.params
+ try {
+ const result = await rainbowService.getPartingPetName(petId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_PARTING_PETNAME, result, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ postEpilogue: async (req, res) => {
+ const { userId, petId } = req.params
+ const data = req.body
+ try {
+ await rainbowService.postEpilogue(userId, data)
+ const result = await rainbowService.getMainPage(userId, petId)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_EPILOGUE, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ theBestMomentSub: async(req,res)=>{
+ const {userId, petId} = req.params
+ try{
+ const theBestMoment = await rainbowService.getTheBestMoment(userId, petId)
+ const result = await rainbowService.getTheBestMomentSub(petId,theBestMoment)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_RAINBOW_SUB_PAGE,result))
+ }catch(err){
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
}
}
\ No newline at end of file
diff --git a/src/api/controller/secondPartController.ts b/src/api/controller/secondPartController.ts
new file mode 100644
index 0000000..fd8f992
--- /dev/null
+++ b/src/api/controller/secondPartController.ts
@@ -0,0 +1,130 @@
+import { Result } from "express-validator"
+
+var util = require('../../modules/util')
+var responseMessage = require('../../modules/responseMessage')
+var statusCode = require('../../modules/statusCode')
+const secondPartService = require('../service/secondPartService')
+
+module.exports = {
+ getMainPage: async (req, res) => {
+ const { userId } = req.params
+ try {
+ const result = await secondPartService.getMainPage(userId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_MAIN_PAGE, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ getDiaryOfTableContents: async (req, res) => {
+ const { tableContentsId } = req.params
+ try {
+ const result = await secondPartService.getDiaryOfTableContents(tableContentsId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_DIARY_OF_TABLECONTENTS, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ getSecondPartChapterList: async (req, res) => {
+ try {
+ const result = await secondPartService.getSecondPartChapterList()
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_CHAPTER_LIST, result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ addSecondPartChapter: async (req, res) => {
+ const chapterData = req.body
+ try {
+ const result =await secondPartService.addSecondPartChapter(chapterData)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_SECOND_PART_ADD_CHAPTER,result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ modifySecondPartChapterInfo: async (req, res) => {
+ const { chapterId } = req.params
+ const modifyChapterData = req.body
+ try {
+ const result = await secondPartService.modifySecondPartChapterInfo(chapterId, modifyChapterData)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_SECOND_PART_MODIFY_CHAPTER,result))
+ } catch (err) {
+ console.error(err)
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+
+ deleteSecondPartChapter: async (req, res) => {
+ const { chapterId } = req.params
+ try {
+ const result=await secondPartService.deleteSecondPartChapter(chapterId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_SECOND_PART_DELETE_CHAPTER,result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_GET_SECOND_PART_TABLE_CONTENTS))
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+ getSecondPartDiary: async (req, res) => {
+ const { diaryId } = req.params
+ try {
+ const result=await secondPartService.getSecondPartDiary(diaryId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_GET_SECOND_PART_DIARY,result))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_GET_SECOND_PART_DIARY_ID))
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+ addSecondPartDiary: async (req, res) => {
+ const diaryData = req.body
+ try {
+ await secondPartService.addSecondPartDiary(diaryData)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_POST_SECOND_PART_DIARY))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_POST_SECOND_PART_DIARY))
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+ modifySecondPartDiary: async (req, res) => {
+ const { diaryId } = req.params
+ const diaryData=req.body
+ try {
+ await secondPartService.modifySecondPartDiary(diaryId,diaryData)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_PUT_SECOND_PART_DIARY))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_PUT_SECOND_PART_DIARY))
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ },
+ deleteSecondPartDiary: async (req, res) => {
+ const { diaryId } = req.params
+ try {
+ await secondPartService.deleteSecondPartDiary(diaryId)
+ return res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SUCCESS_DELETE_SECOND_PART_DELETE_DIARY))
+ } catch (err) {
+ console.error(err)
+ if (err.statusCode === 400) {
+ return res.status(statusCode.BAD_REQUEST).send(util.fail(statusCode.BAD_REQUEST, responseMessage.FAIL_TO_DELETE_SECOND_PART_DIARY))
+ }
+ return res.status(statusCode.INTERNAL_SERVER_ERROR).send(util.fail(statusCode.INTERNAL_SERVER_ERROR, responseMessage.INTERNAL_SERVER_ERROR))
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/controller/userController.ts b/src/api/controller/userController.ts
new file mode 100644
index 0000000..f6f6fd3
--- /dev/null
+++ b/src/api/controller/userController.ts
@@ -0,0 +1,41 @@
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+const userService = require('../service/userService')
+import User from '../../models/user/User'
+import Pet from '../../models/pet/Pet'
+
+module.exports = {
+ //register user
+ register: async (req, res) => {
+ const { email, password } = req.body;
+ try {
+ await userService.register(email, password);
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SIGH_UP_SUCCESS))
+ } catch (err) {
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error(err)
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ },
+ login: async (req, res) => {
+ const { email, password } = req.body;
+ try {
+ const result = await userService.login(email, password);
+ console.log('얘가나오면 안되는데 : ', result)
+ res.status(statusCode.OK).send(util.success(statusCode.OK, responseMessage.SIGH_IN_SUCCESS,result))
+
+ } catch (err) {
+ console.log('bbbbb : ' + err.statusCode)
+ if (err.statusCode == null) {
+ err.statusCode = statusCode.INTERNAL_SERVER_ERROR;
+ err.responseMessage = responseMessage.INTERNAL_SERVER_ERROR;
+ }
+ console.error('!!!!!' + err)
+ res.status(err.statusCode).send(util.fail(err.statusCode, err.responseMessage))
+ }
+ }
+}
diff --git a/src/api/router/calendar/index.ts b/src/api/router/calendar/index.ts
new file mode 100644
index 0000000..8220b7f
--- /dev/null
+++ b/src/api/router/calendar/index.ts
@@ -0,0 +1,7 @@
+var express = require('express')
+var router = express.Router()
+const calendarController = require('../../controller/calendarController')
+
+router.get('/:year/:month/:part',calendarController.getCalendar)//캘린더
+
+module.exports = router
\ No newline at end of file
diff --git a/src/api/router/chapter/index.ts b/src/api/router/chapter/index.ts
new file mode 100644
index 0000000..cf544ab
--- /dev/null
+++ b/src/api/router/chapter/index.ts
@@ -0,0 +1,11 @@
+const express = require('express')
+const router = express.Router()
+const chapterController = require('../../controller/chapterController')
+
+router.get('/pet/:id',chapterController.getChapterDiary) //1부 목차별 일기 조회
+router.get('/:id',chapterController.getChapterList)//목차리스트 조회
+router.post('/:id',chapterController.postChapterList)//목차리스트 추가
+router.put('/:id',chapterController.putChapterList)//목차리스트 수정
+router.delete('/:id',chapterController.deleteChapterList)//목차리스트 삭제
+module.exports = router;
+export{};
\ No newline at end of file
diff --git a/src/api/router/diary/index.ts b/src/api/router/diary/index.ts
new file mode 100644
index 0000000..fb6a7f4
--- /dev/null
+++ b/src/api/router/diary/index.ts
@@ -0,0 +1,12 @@
+var express = require('express')
+var router = express.Router()
+var diaryController = require('../../controller/diaryController')
+var upload = require('../../../modules/multer')
+
+router.post('/prologue/:userId',diaryController.postPrologue) //1부 프롤로그 작성
+router.post('/pet',diaryController.postPetDiary)//반려동물 일기 작성
+router.get('/pet/:id',diaryController.getPetDiary)//반려동물 일기 상세 조회
+router.put('/pet/:id',diaryController.putPetDiary)//반려동물 일기 수정
+router.delete('/pet/:id',diaryController.deletePetDiary)//반려동물 일기 삭제
+router.post('/pet/withImage',upload.array('images',5),diaryController.postPetDiaryWithImage)
+module.exports = router;
\ No newline at end of file
diff --git a/src/api/router/firstPart/index.ts b/src/api/router/firstPart/index.ts
new file mode 100644
index 0000000..5b5e832
--- /dev/null
+++ b/src/api/router/firstPart/index.ts
@@ -0,0 +1,8 @@
+import express from "express"
+const router = express.Router()
+const firstPartController = require('../../controller/firstPartController')
+
+//1부 메인페이지 불러오기
+router.get('/main/:userId', firstPartController.mainPage)
+
+module.exports = router;
\ No newline at end of file
diff --git a/src/api/router/index.ts b/src/api/router/index.ts
index 494404c..772d98b 100644
--- a/src/api/router/index.ts
+++ b/src/api/router/index.ts
@@ -1,6 +1,13 @@
import express from "express"
-const router = express.Router()
+var router = express.Router();
-router.use('/rainbow',require('./rainbow')) //무지개
+router.use('/user',require('./user'))//user
+router.use('/pet',require('./pet'))//pet
+router.use('/chapter',require('./chapter'));//1부 목차
+router.use('/diary',require('./diary'));//1부 일기
+router.use('/rainbow', require('./rainbow')) //무지개
+router.use('/calendar', require('./calendar')) //캘린더
+router.use('/firstPart',require('./firstPart')) //1부
+router.use('/secondPart', require('./secondPart'))//2부
module.exports = router;
\ No newline at end of file
diff --git a/src/api/router/pet/index.ts b/src/api/router/pet/index.ts
new file mode 100644
index 0000000..b59ba75
--- /dev/null
+++ b/src/api/router/pet/index.ts
@@ -0,0 +1,10 @@
+var express = require('express')
+var router = express.Router()
+var petController = require('../../controller/petController')
+var upload = require('../../../modules/multer')
+
+router.get('/register/petInfo',petController.getRegisterPetInfo)
+//router.post('/register',upload.array('images',5),petController.registerPet) //register pet
+router.post('/register',petController.registerPet)
+//router.post('/register/images',upload.array('images',4),petController.registerPetImg)
+module.exports = router;
\ No newline at end of file
diff --git a/src/api/router/rainbow/index.ts b/src/api/router/rainbow/index.ts
index 8383eb6..c319b56 100644
--- a/src/api/router/rainbow/index.ts
+++ b/src/api/router/rainbow/index.ts
@@ -1,7 +1,16 @@
-const express = require('express')
-const router = express.Router()
-const rainbowController = require('../../controller/rainbowController')
+var express = require('express')
+var router = express.Router()
+let rainbowController = require('../../controller/rainbowController')
-router.get('/main/:userId/:petId',rainbowController.mainPage) //1.5부 무지개 홈 화면
+router.get('/main/:userId/:petId',rainbowController.mainPage) //1.5부 무지개 홈 화면 불러오기
+router.get('/pet',rainbowController.selectRainbowPet) //1.5부 무지개 반려동물 선택 화면 불러오기
+router.put('/pet/:petId',rainbowController.setRainbowPet) //1.5부 무지개 반려동물 선택 적용 & 이별하는 무지개 다리 멘트
+router.delete('/pet/:petId',rainbowController.cancelPartingPet) //1.5부 무지개 반려동물 떠나보내기 취소
+router.get('/record/:petId',rainbowController.getReadyPartingPetComment) //1.5부 이별을 준비하는 작가의 기록 시작 멘트 불러오기
+router.get('/moment/:userId/:petId',rainbowController.theBestMoment) //1.5부 무지개 최고의 순간
+router.get('/parting/pet/:petId',rainbowController.getPartingPetName) //1.5부 반려동물 이름 반환
+router.post('/epilogue/:userId/:petId',rainbowController.postEpilogue) //1.5부 작가의 말 작성
+router.get('/moment/sub/:userId/:petId',rainbowController.theBestMomentSub) //1.5부 무지개 서브 홈
-module.exports = router;
\ No newline at end of file
+module.exports = router;
+//solve error TS2451 : Cannot redeclare block-scoped variable
\ No newline at end of file
diff --git a/src/api/router/secondPart/index.ts b/src/api/router/secondPart/index.ts
new file mode 100644
index 0000000..1a63aed
--- /dev/null
+++ b/src/api/router/secondPart/index.ts
@@ -0,0 +1,15 @@
+var express = require('express')
+var router = express.Router()
+const secondPartController = require('../../controller/secondPartController')
+
+router.get('/main/:userId', secondPartController.getMainPage)
+router.get('/chapter/user/:tableContentsId', secondPartController.getDiaryOfTableContents)
+router.get('/chapter/list', secondPartController.getSecondPartChapterList)
+router.post('/chapter', secondPartController.addSecondPartChapter)
+router.put('/chapter/:chapterId', secondPartController.modifySecondPartChapterInfo)
+router.delete('/chapter/:chapterId', secondPartController.deleteSecondPartChapter)
+router.get('/diary/user/:diaryId',secondPartController.getSecondPartDiary)//2부 일기 조회
+router.post('/diary/user',secondPartController.addSecondPartDiary)//2부 일기 작성
+router.put('/diary/user/:diaryId',secondPartController.modifySecondPartDiary)//2부 일기 수정
+router.delete('/diary/user/:diaryId',secondPartController.deleteSecondPartDiary)//2부 일기 삭제
+module.exports = router
\ No newline at end of file
diff --git a/src/api/router/user/index.ts b/src/api/router/user/index.ts
new file mode 100644
index 0000000..a33bf76
--- /dev/null
+++ b/src/api/router/user/index.ts
@@ -0,0 +1,9 @@
+const express = require('express')
+const router = express.Router()
+const userController = require('../../controller/userController')
+import { check, validationResult } from "express-validator";
+
+router.post('/register/',userController.register) //user register
+router.post('/login',userController.login) //user login
+
+module.exports=router;
\ No newline at end of file
diff --git a/src/api/service/calendarService.ts b/src/api/service/calendarService.ts
new file mode 100644
index 0000000..08541df
--- /dev/null
+++ b/src/api/service/calendarService.ts
@@ -0,0 +1,75 @@
+import FirstPartTableContents from "../../models/tableContents/FirstPartTableContents"
+import SecondPartTableContent from "../../models/tableContents/SecondPartTableContent"
+import PetDiary from "../../models/diary/PetDiary"
+import UserDiary from "../../models/diary/UserDiary"
+import { CalendarDateUserDto, CalendarDatePetDto, CalendarInfoResDto, CalendarResDto } from "../../dto/calendar/calendarResDto"
+import User from "../../models/user/User"
+import Book from "../../models/book/Book"
+const dateMethod = require("../../modules/dateMethod")
+
+require('../../models/tableContents/FirstPartTableContents')
+require('../../models/tableContents/SecondPartTableContent')
+require('../../models/diary/PetDiary')
+require('../../models/diary/UserDiary')
+require('../../models/diary/PetEmotions')
+require('../../models/book/Book')
+
+module.exports = {
+ getDiaryPerDate: async (year, month, part) => {
+ try {
+ const user = (await User.find().populate({path : "book"}))[0]
+ const author = user.book.author
+ const calendarResDto = new CalendarResDto(author, part)
+ if(part == 1){
+ const calendarDiary = await PetDiary.find({
+ date:{
+ $gte : new Date(year, month-1, 1),
+ $lt : new Date(year, month, 1)
+ }
+ }).populate({
+ path : "petEmotions pets",
+ })
+ console.log('calendarDiary : '+calendarDiary)
+ const thisMonthLength = await dateMethod.getLastDateOfMonth(year,month)
+
+ const calendarInfoResDto = new CalendarInfoResDto(year,month)
+ for(let i = 0;i diary.date.getDate() == i)
+ if(diariesPerMonth.length < 1){
+ calendarInfoResDto.setDate(null)
+ }else{
+ calendarInfoResDto.setDate(new CalendarDatePetDto(i+1,diariesPerMonth))
+ }
+ //CalendarDiary에 각 일에 해당하는 일기를 만들어서 넣어주면된다
+ }
+ calendarResDto.setCalendar(calendarInfoResDto)
+ }else if(part == 2){
+ const calendarDiary = await UserDiary.find({
+ date:{
+ $gte : new Date(year, month-1, 1),
+ $lt : new Date(year, month, 1)
+ }
+ }).populate({
+ path : "petEmotions pets"
+ })
+ console.log('calendarDiary : '+calendarDiary)
+ const thisMonthLength = await dateMethod.getLastDateOfMonth(year,month)
+
+ const calendarInfoResDto = new CalendarInfoResDto(year,month)
+ for(let i = 0;i diary.date.getDate() == i)
+ if(diariesPerMonth.length < 1){
+ calendarInfoResDto.setDate(null)
+ }else{
+ calendarInfoResDto.setDate(new CalendarDateUserDto(i+1,diariesPerMonth,user))
+ }
+ //CalendarDiary에 각 일에 해당하는 일기를 만들어서 넣어주면된다
+ }
+ calendarResDto.setCalendar(calendarInfoResDto)
+ }
+ return calendarResDto
+ } catch (err) {
+ throw err
+ }
+ },
+}
\ No newline at end of file
diff --git a/src/api/service/chapterService.ts b/src/api/service/chapterService.ts
new file mode 100644
index 0000000..80568ba
--- /dev/null
+++ b/src/api/service/chapterService.ts
@@ -0,0 +1,175 @@
+import Book from "../../models/book/Book"
+import TableContents from "../../models/tableContents/TableContents"
+import FirstPartTableContents from "../../models/tableContents/FirstPartTableContents"
+import Pet from "../../models/pet/Pet"
+import { response } from "express"
+import PetDiary from "../../models/diary/PetDiary"
+import PetEmotions from "../../models/diary/PetEmotions"
+import { DiariesResDto, MonthlyDiaryResDto, PetChapterDiaryResDto } from "../../dto/petChapter/PetChapterDiary"
+import User from "../../models/user/User"
+import { ChapterListResDto, ChapterResDto } from "../../dto/petChapter/ChapterList"
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+require('../../models/diary/PetDiary')
+require('../../models/diary/PetEmotions')
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+
+module.exports = {
+ getChapterDiary: async (chapterId) => {
+ try {
+ //챕터 id로 1부 목차
+
+ const findFirstTableContents = await FirstPartTableContents.findById(chapterId).populate({ path: "petDiary", populate: ({ path: "petEmotions pets" }) });
+ //.populate({path:"petDiary",populate:({path:"petEmotions"})})
+ console.log('!!!! : '+findFirstTableContents)
+ let newChapterDiary = new PetChapterDiaryResDto(findFirstTableContents)
+ console.log("newchapterDiary",newChapterDiary);
+ //월별로 자르기
+ for (let m = 12; m >0; m--) {
+ let cnt = 0;
+ //1화부터
+ let monthly = new MonthlyDiaryResDto()
+
+ for (let i = findFirstTableContents.petDiary.length-1; i >=0 ; i--) {
+ console.log(findFirstTableContents.petDiary[i].date.getMonth())
+ if (m == findFirstTableContents.petDiary[i].date.getMonth()+1) {
+ cnt++;
+ console.log("month",m,findFirstTableContents.petDiary[i])
+ let newDiary = new DiariesResDto(findFirstTableContents.petDiary[i])//diary
+ monthly.setDiaries(newDiary)
+ console.log("출력 다이어리 : ",newDiary)
+ //console.log(findFirstTableContents.petDiary[i].petEmotions[0].feeling)
+ }
+ }
+ if (cnt == 0) continue
+ monthly.setMonthCount(cnt)
+ monthly.setMonth(m)
+ newChapterDiary.setMonthly(monthly)
+ }
+ console.log(newChapterDiary)
+ return newChapterDiary
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY }
+ }
+ },
+ getChapterList: async (userId) => {
+ const findUserChapter = await User.findById(userId).populate({ path: "book", populate: ({ path: "tableContents", populate: ({ path: "firstPartTableContents" }) }) });
+ let chapterList = new ChapterListResDto()
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ let newChapter = new ChapterResDto(new FirstPartTableContents(findUserChapter.book.tableContents.firstPartTableContents[i]))
+ chapterList.setChapterList(newChapter)
+ }
+ console.log(chapterList)
+ return chapterList
+ },
+ postChapterList: async (userId, chapterTitle) => {
+ try {
+ const findUserChapter = await User.findById(userId).populate({ path: "book", populate: ({ path: "tableContents", populate: ({ path: "firstPartTableContents" }) }) });
+ const newFirstPartTable = new FirstPartTableContents();//chapter,title
+ console.log(findUserChapter)
+ console.log(chapterTitle)
+ let max = 0
+
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ if (max < findUserChapter.book.tableContents.firstPartTableContents[i].chapter) {
+ max = Number(findUserChapter.book.tableContents.firstPartTableContents[i].chapter)
+ }
+ }
+ newFirstPartTable.chapter = max + 1
+ newFirstPartTable.title = chapterTitle
+
+ await newFirstPartTable.save()
+ findUserChapter.book.tableContents.firstPartTableContents.push(newFirstPartTable)
+ let newTableContents = new TableContents(findUserChapter.book.tableContents)
+ await newTableContents.save()
+
+ console.log(newTableContents)
+ let chapterList = new ChapterListResDto()
+ for (let i = 0; i < findUserChapter.book.tableContents.firstPartTableContents.length; i++) {
+ let newChapter = new ChapterResDto(new FirstPartTableContents(findUserChapter.book.tableContents.firstPartTableContents[i]))
+ chapterList.setChapterList(newChapter)
+ }
+ console.log(chapterList)
+
+ return chapterList;
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS }
+ }
+ },
+ putChapterList: async (chapterId, chapterTitle) => {
+ try {
+ const findChapter = await FirstPartTableContents.findById(chapterId);
+ findChapter.title = chapterTitle
+ const editFirstPartTableContents = new FirstPartTableContents(findChapter)
+ await editFirstPartTableContents.save()
+ console.log(editFirstPartTableContents)
+
+ let chapterList = new ChapterListResDto()
+ let tableContents=await TableContents.find({}).populate('firstPartTableContents')
+ for (let i = 0; i < tableContents[0].firstPartTableContents.length; i++) {
+ let newChapter = new ChapterResDto(new FirstPartTableContents(tableContents[0].firstPartTableContents[i]))
+ chapterList.setChapterList(newChapter)
+ }
+
+ // console.log(chapterList)
+
+ return chapterList;
+ }
+ catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS }
+ }
+ },
+ deleteChapterList: async (chapterId) => {
+ try {
+ let findChapter = await FirstPartTableContents.findById(chapterId);
+ const curChapter = findChapter.chapter
+ const allFirstTableContents = await FirstPartTableContents.find({});
+ let updateFTC = new FirstPartTableContents()
+ //해당 목차보다 큰 목차 -=1
+ for (let i = 0; i < allFirstTableContents.length; i++) {
+ if (allFirstTableContents[i].chapter > curChapter) {
+ allFirstTableContents[i].chapter = Number(allFirstTableContents[i].chapter) - 1;
+ }
+ //db save
+ updateFTC = allFirstTableContents[i]
+ await updateFTC.save()
+ }
+ console.log(allFirstTableContents)
+
+ //해당 목차 삭제
+ await FirstPartTableContents.deleteOne({ _id: chapterId })
+
+ const tableContents = (await TableContents.find())[0]
+ for (let j = 0; j < tableContents.firstPartTableContents.length; j++) {
+ if (tableContents.firstPartTableContents[j] == chapterId) {
+ tableContents.firstPartTableContents.splice(j, 1)
+ }
+ }
+ await tableContents.save()
+
+
+ let chapterList = new ChapterListResDto()
+ let allTableContents=await TableContents.find({}).populate('firstPartTableContents')
+ for (let i = 0; i < allTableContents[0].firstPartTableContents.length; i++) {
+ let newChapter = new ChapterResDto(new FirstPartTableContents(allTableContents[0].firstPartTableContents[i]))
+ chapterList.setChapterList(newChapter)
+ }
+ console.log(chapterList)
+
+ return chapterList;
+ }
+ catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_CONTENTS }
+ }
+ }
+}
diff --git a/src/api/service/diaryService.ts b/src/api/service/diaryService.ts
new file mode 100644
index 0000000..82ff251
--- /dev/null
+++ b/src/api/service/diaryService.ts
@@ -0,0 +1,273 @@
+import { response } from "express"
+import User from "../../models/user/User"
+import Book from "../../models/book/Book"
+import TableContents from "../../models/tableContents/TableContents"
+import FirstPartTableContents from "../../models/tableContents/FirstPartTableContents"
+import Pet from "../../models/pet/Pet"
+import PetDiary from "../../models/diary/PetDiary"
+import PetEmotions from "../../models/diary/PetEmotions"
+import { FeelingListDto, PetDiaryPageResDto } from "../../dto/petDiary/PetDiaryPageResDto"
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+require('../../models/diary/PetDiary')
+require('../../models/diary/PetEmotions')
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+
+module.exports = {
+ postPrologue: async (userId, bookData) => {
+ try {
+ console.log(userId)
+ //Create user object
+ const user = await User.findById(userId).populate('book')
+ console.log('user : ' + user)
+ console.log('userBook : '+user.book)
+ if(user.book.title != null){
+ throw {statusCode : 404, responseMessage : "이미 책이 존재합니다, 없던일로 하겠습니다. 휴먼"}
+ }
+ const setBook = user.book
+ setBook.title = bookData.title,
+ setBook.imgs = "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ setBook.author = bookData.userName
+
+ //Create tableContents object
+ const tableContents = new TableContents()
+ setBook.tableContents = tableContents
+ await tableContents.save()
+ await user.save()
+ await setBook.save()
+ //Create firstPartTableContents object
+ const firstPartPrologue = new FirstPartTableContents({
+ chapter: 0,
+ title: bookData.title,
+ contents: bookData.contents
+ })
+ await firstPartPrologue.save()
+ console.log(tableContents)
+ await tableContents.firstPartTableContents.push(firstPartPrologue)
+
+ let chapter = 1
+ const season = ["봄", "여름", "가을", "겨울"]
+ for (let i = 0; i < 4; i++) {
+ const dummyFirstPartTableContents = new FirstPartTableContents({
+ chapter,
+ title: `${user.book.author}의 ${season[i]}`
+ })
+ await dummyFirstPartTableContents.save()
+ tableContents.firstPartTableContents.push(dummyFirstPartTableContents)
+ chapter = chapter + 1
+ }
+
+ //add dummy Diary
+ let newPetDiary = new PetDiary({
+ tableContents: tableContents.firstPartTableContents[1],
+ episode: tableContents.firstPartTableContents[1].petDiary.length,
+ //date: Date(),
+ //imgs: diaryImages,
+ title: "행복한 나날들",
+ contents: "반려동물과의 일상을 생생하게 기록해보세요"
+ })
+ newPetDiary.setPet(user.pets[0])
+ const petEmotion = new PetEmotions({
+ pet: user.pets[0]._id,
+ feeling: 3
+ })
+ newPetDiary.setPetEmotions(petEmotion)
+
+ tableContents.firstPartTableContents[1].petDiary.push(newPetDiary)
+ await petEmotion.save()
+ await newPetDiary.save()
+ await tableContents.firstPartTableContents[1].save()
+ await tableContents.save()
+
+ return user.book._id
+ //error handling
+ } catch (err) {
+ console.log(err)
+ throw err
+ }
+ },
+ postPetDiary: async (diaryData) => {
+ const writeDate = await new Date(diaryData.date)
+ writeDate.setDate(writeDate.getDate() + 1);
+ // console.log(FirstPartTableContents.findById(diaryData._id))
+ const temp = await FirstPartTableContents.findById(diaryData._id).populate('petDiary')
+ //console.log("temp:",temp,"end")
+ let newPetDiary = new PetDiary({
+ tableContents: diaryData._id,
+ episode: temp.petDiary.length,
+ date: writeDate,
+ imgs: "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ title: diaryData.title,
+ contents: diaryData.contents
+
+ })
+
+ try {
+ //save petinfo
+ let petN = diaryData.character.length
+ for (let i = 0; i < petN; i++) {
+ const petData = await Pet.findById(diaryData.character[i]._id).populate('_id')
+ newPetDiary.setPet(petData)
+ //save emotions
+ const petEmotion = new PetEmotions({
+ pet: diaryData.character[i]._id,
+ feeling: diaryData.character[i].feeling
+ })
+ newPetDiary.setPetEmotions(petEmotion)
+ await petEmotion.save()
+ }
+
+ console.log(newPetDiary)
+ await newPetDiary.save()
+
+ await temp.setPetDiary(newPetDiary) //db관련은 await 붙이기(setter,save...)
+ await temp.save()
+ console.log(temp._id)
+ return responseMessage.SUCCESS_POST_PETDIARY;
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY }
+ }
+ },
+ getPetDiary: async (petDiaryId) => {
+ try {
+ const findPetDiary = await PetDiary.findById(petDiaryId).populate('pets').populate('tableContents').populate('petEmotions');
+ let petDiaryPageResDto = await new PetDiaryPageResDto(findPetDiary) //이부분
+ // console.log("feelingList",findPetDiary.pets[0],";",findPetDiary.petEmotions[0].feeling)
+
+ for (let i = 0; i < findPetDiary.petEmotions.length; i++) {
+ let feelingList = new FeelingListDto(findPetDiary.pets[i])
+ feelingList.setFeeling(findPetDiary.petEmotions[i])
+ petDiaryPageResDto.setFeelingList(feelingList)
+ }
+ return petDiaryPageResDto
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY }
+ }
+ },
+ putPetDiary: async (petDiaryId, diaryData) => {
+ try {
+ let findPetDiary = await PetDiary.findById(petDiaryId);
+ findPetDiary.tableContents = findPetDiary.tableContents
+ findPetDiary.episode = findPetDiary.episode
+ findPetDiary.date = findPetDiary.date
+ findPetDiary.imgs = diaryData.diaryImages
+ findPetDiary.title = diaryData.title
+ findPetDiary.contents = diaryData.contents
+ //save petinfo
+ let petN = diaryData.character.length
+ for (let i = 0; i < petN; i++) {
+ const petData = await Pet.findById(diaryData.character[i]._id).populate('_id')
+ findPetDiary.setPet(petData)
+ //save emotions
+ let emotion = new PetEmotions()
+ emotion.pet = diaryData.character[i]._id
+ emotion.feeling = diaryData.character[i].feeling
+ emotion.setPetDiary(findPetDiary)
+ await emotion.save()
+ }
+ await findPetDiary.save()
+ return responseMessage.SUCCESS_EDIT_PETDIARY;
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY }
+ }
+ },
+ deletePetDiary: async (petDiaryId) => {
+ try {
+ let findPetDiary = await PetDiary.findById(petDiaryId).populate('tableContents').populate('petEmotions');
+ console.log('!!!!! : ' + findPetDiary)
+ //화 정렬 순서 맞추기
+ //해당 목차인것들 모두 가져오기. findPetDiary의 idx 뒤로 다 -1
+ // let allDiaries=await (PetDiary.find({}).populate('tableContents'))
+ let thisDiariesTableContent = findPetDiary.tableContents
+ for (let j = 0; j < thisDiariesTableContent.petDiary.length; j++) {
+ if (thisDiariesTableContent.petDiary[j]._id == petDiaryId) {
+ thisDiariesTableContent.petDiary.splice(j, 1)
+ }
+ }
+ let petDiaries = (await FirstPartTableContents.findOne({ chapter: { $eq: findPetDiary.tableContents.chapter } })).petDiary
+
+ for (let i = 0; i < petDiaries.length; i++) {
+ let temp = await PetDiary.findById(petDiaries[i])
+ if (findPetDiary.episode <= temp.episode) {
+ temp.episode = Number(temp.episode) - 1
+ await temp.save()
+ }
+ }
+
+ findPetDiary.petEmotions.forEach(async petEmotion => {
+ await PetEmotions.deleteOne({ _id: petEmotion._id })
+ })
+
+ await PetDiary.deleteOne({ _id: findPetDiary })
+ await thisDiariesTableContent.save()
+ console.log(findPetDiary)
+ return responseMessage.SUCCESS_DELETE_PETDIARY;
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_DIARY }
+ }
+ },
+ postPetDiaryWithImage:async(images, diaryInfo)=>{
+ const petInfo = JSON.parse(JSON.stringify(diaryInfo.character)).character
+
+ console.log('test2 : '+JSON.parse(petInfo))
+ console.log('test ! : '+JSON.parse(JSON.stringify(petInfo)))
+ console.log('images : '+images)
+ console.log('diaryInfo : '+petInfo)
+ console.log('diaryInfo : '+typeof(petInfo))
+ console.log('diaryInfo length : '+petInfo.length)
+ try{
+ console.log('title : '+diaryInfo.title)
+ console.log('content : '+diaryInfo.contents)
+ console.log('date : '+diaryInfo.date)
+ console.log('tableContents_id : '+diaryInfo._id)
+
+ const writeDate = await new Date(diaryInfo.date)
+ writeDate.setDate(writeDate.getDate() + 1);
+
+ const firstTableContents = await FirstPartTableContents.findById(diaryInfo._id).populate('petDiary')
+ const episode = firstTableContents.petDiary.length
+
+ let newDiary = new PetDiary({
+ title : diaryInfo.title,
+ contents : diaryInfo.contents,
+ imgs : images,
+ episode ,
+ date : writeDate
+ })//set petEmotions, pets, tableContents
+ firstTableContents.setPetDiary(newDiary)
+
+ //petEmotion 생성 &
+ petInfo.forEach(async info => {
+ //const perPet = await Pet.findById(info._id)
+ let newEmotion = new PetEmotions({
+ pet : info._id,
+ feeling : info.feeling
+ })//set petDiary
+ newEmotion.setPetDiary(newDiary)
+ newDiary.setPet(info._id)
+ newDiary.setPetEmotions(newEmotion)
+
+ await newEmotion.save()
+ })
+ newDiary.setTableContents(firstTableContents)
+
+ await firstTableContents.save()
+ await newDiary.save()
+
+ }catch(err){
+ throw err
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/service/firstPartService.ts b/src/api/service/firstPartService.ts
new file mode 100644
index 0000000..7edf5f7
--- /dev/null
+++ b/src/api/service/firstPartService.ts
@@ -0,0 +1,98 @@
+import User from "../../models/user/User"
+import Pet from "../../models/pet/Pet"
+import { DiaryResDto, FirstPartMainPageResDto, TableContentsResDto } from "../../dto/firstPart/mainPageDto/FirstPartMainPageResDto"
+const dateMethod = require("../../modules/dateMethod")
+const util = require('../../modules/util')
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+import Book from "../../models/book/Book"
+import TableContents from "../../models/tableContents/TableContents"
+import FirstPartTableContents from "../../models/tableContents/FirstPartTableContents"
+import PetDiary from "../../models/diary/PetDiary"
+require("../../models/user/User")
+require("../../models/pet/Pet")
+require("../../models/book/Book")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+require('../../models/diary/PetDiary')
+require('../../models/diary/PetEmotions')
+require('../../models/diary/UserDiary')
+
+module.exports = {
+ getMainPage: async (userId) => {
+ try {
+ //find userData
+ const findUser = await User.findById(userId).populate({
+ path: "pets"
+ }).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "firstPartTableContents",
+ populate: ({
+ path: "petDiary",
+ populate: ({
+ path: "petEmotions",
+ populate:{
+ path : "pet"
+ }
+ })
+ })
+ })
+ })
+ })
+ console.log("user",findUser)
+ let newBook=new Book()
+ let newTableContents=new TableContents()
+ let newFirstPartTableContents=new FirstPartTableContents()
+ newTableContents.setFirstPartTableContents(newFirstPartTableContents)
+ newBook.setTableContents(newTableContents)
+
+ if(findUser.book==null){
+ findUser.setBook(newBook)
+ }
+ if(findUser.book.tableContents==null){
+ findUser.book.tableContents= new TableContents()
+ }
+ if(findUser.book.tableContents.firstPartTableContents==null){
+ findUser.book.tableContents.firstPartTableContents.push(new FirstPartTableContents())
+ }
+
+ const firstPartMainPageResDto = new FirstPartMainPageResDto(findUser.book)
+ let allPetDiaries = await PetDiary.find({}).populate({
+ path : "tableContents"
+ }).populate({
+ path : "petEmotions",
+ populate:{
+ path : "pet"
+ }
+ })
+
+ let petDiaryNumber=(await allPetDiaries).length
+ const test = allPetDiaries[petDiaryNumber-1]
+ console.log(`!!!!!!!!!!! : `+test)
+ //가장 마지막 일기
+ const lastDiary = new DiaryResDto(allPetDiaries[petDiaryNumber-1])
+ firstPartMainPageResDto.setNextEpisode(lastDiary)
+
+ //tableContents
+ let lastTableNumber=findUser.book.tableContents.firstPartTableContents.length
+
+ for (let i = 0; i < lastTableNumber; i++) {
+ let tableContentsResDto = new TableContentsResDto(findUser.book.tableContents.firstPartTableContents[i])
+ firstPartMainPageResDto.setTableContents(tableContentsResDto)
+ }
+ firstPartMainPageResDto.setDiary(lastDiary)
+
+ if(findUser.book.tableContents.secondPartTableContents.length > 1){
+ firstPartMainPageResDto.setSecondPartBook(findUser)
+ }
+ return firstPartMainPageResDto
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_USER }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/service/petService.ts b/src/api/service/petService.ts
new file mode 100644
index 0000000..3b781d3
--- /dev/null
+++ b/src/api/service/petService.ts
@@ -0,0 +1,76 @@
+import { Request, Response, NextFunction } from 'express'
+import User from '../../models/user/User'
+import Pet from '../../models/pet/Pet'
+import { PetInfoDto, PetsInfoDto } from '../../dto/rainbow/petDto/PetInfoDto'
+import { SavePetResDto } from '../../dto/petDiary/SavePetResDto'
+const responseMessage = require('../../modules/responseMessage')
+const statusCode = require('../../modules/statusCode')
+const util = require('../../modules/util')
+const petService = require('../service/petService')
+var mongoose = require('mongoose')
+
+require("../../models/user/User")
+require("../../models/pet/Pet")
+module.exports = {
+ getPetInfo:async()=>{
+ try{
+ const findUser = await User.find().populate({
+ path : "pets"
+ })
+ console.log('getPetInfo List')
+ const findPets = findUser[0].pets
+
+ return new PetsInfoDto(findPets.map( pet => new PetInfoDto(pet)))
+
+ }catch(error){
+ throw error
+ }
+ },
+ registerPet: async (reqData) => {
+ const {pets, userId} = reqData
+
+ console.log('petstype : '+typeof(pets))
+ console.log('pets[0]type : '+typeof(pets[0]))
+ console.log('pets[0] : '+JSON.stringify(pets[0]))
+ //console.log('############# : '+reqData[1].name)
+ console.log('petsLength : '+pets.length)
+ console.log('petsName : '+pets[0].name)
+ console.log('petsKind : '+pets[0].startDate)
+ console.log('userId : '+userId)
+ try{
+ //error handling
+ const findUser = await User.findById(userId)
+ console.log('findUser : '+findUser)
+ //console.log('image : '+images[0])
+ let petsArr=[];
+ const startDate= new Date(pets[0].startDate)
+ startDate.setDate(startDate.getDate() + 1);
+ for (let i = 0; i < pets.length; i++) {
+ let pet = new Pet({
+ name: pets[i].name,
+ kind: pets[i].kind,
+ gender: pets[i].gender,
+ imgs : "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ user: mongoose.Types.ObjectId(userId),
+ rainbow: false,
+ startDate: new Date(startDate)
+
+ // findUser, UserId만 해서 되면 가능
+ //book://나중에 책을 등록할때, pet에 book을 등록. 연관관계 확인. 안들어가있는게 있으면 나중에 같이 넣어야됨.
+ //SETTER사용. pet 찾아서 setter로 넣기.
+ });
+ await pet.save()
+ findUser.pets.push(pet)
+ petsArr[i]=pet;
+ }
+ await findUser.save()
+ console.log(reqData);
+ //db save
+ const saveInfo = petsArr.map(pet=>pet._id)
+ return new SavePetResDto(saveInfo)
+ }catch(err){
+ console.log(err)
+ throw { statusCode: statusCode.INTERNAL_SERVER_ERROR, responseMessage: responseMessage.INTERNAL_SERVER_ERROR };
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/api/service/rainbowService.ts b/src/api/service/rainbowService.ts
index 69b1390..8cc413f 100644
--- a/src/api/service/rainbowService.ts
+++ b/src/api/service/rainbowService.ts
@@ -1,18 +1,411 @@
import User from "../../models/user/User"
-import Pet from "../../models/pet/Pet"
-import { RainbowMainPageResDto, MemoriesResDto, HelpResDto } from "../../dto/rainbow/mainPageDto/rainbowMainPageResDto"
+import { RainbowMainPageResDto, MemoriesResDto, HelpResDto, MemoriesResDto2 } from "../../dto/rainbow/mainPageDto/RainbowMainPageResDto"
import Help from "../../models/etc/Help"
+import { MyPetInfoResDto, RainbowPetResDto } from "../../dto/rainbow/petDto/RainbowPetResDto"
+import Pet from "../../models/pet/Pet"
+import { IPet } from "../../interfaces/pet/IPet"
+import { PartingRainbowResDto } from "../../dto/rainbow/partingDto/PartingRainbowResDto"
+import { ReadyPartingAndStartRecordResDto, BookInfoResDto } from "../../dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto"
+import FirstPartTableContents from "../../models/tableContents/FirstPartTableContents"
+import SecondPartTableContent from "../../models/tableContents/SecondPartTableContent"
+import PetDiary from "../../models/diary/PetDiary"
+import PetEmotions from "../../models/diary/PetEmotions"
+import { TheBestMoment, TheBestMomentDiary, TheBestMomentsResDto, TheBestMomentPetInformation } from "../../dto/rainbow/theBestMomentDto/TheBestMomentResDto"
+import { PetNameResDto } from "../../dto/rainbow/petDto/PetNameResDto"
+import { IPetDiary } from "../../interfaces/diary/IPetDiary"
+import Comments from "../../models/etc/Comments"
+import { TheBestMomentSubResDto } from "../../dto/rainbow/theBestMomentDto/TheBestMomentSubResDto"
+var dateMethod = require("../../modules/dateMethod")
+var theBestMomentComments = require("../../modules/comment")
require("../../models/user/User")
require("../../models/pet/Pet")
require("../../models/book/Book")
require('../../models/tableContents/TableContents')
require('../../models/tableContents/FirstPartTableContents')
+require('../../models/diary/PetDiary')
+require('../../models/diary/PetEmotions')
require('../../models/tableContents/SecondPartTableContent')
+require('../../models/diary/UserDiary')
require("../../models/etc/Help")
+require("../../models/etc/Comments")
module.exports = {
getMainPage: async (userId, petId) => {
-
+ try {
+ const findUser = await User.findById(userId).populate({
+ path: "pets"
+ }).populate({
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents",
+ populate: {
+ path: "petDiary",
+ populate: {
+ path: "petEmotions",
+ populate : {
+ path:"pet"
+ }
+ }
+ }
+ }
+ }
+ })
+ const findPet = await Pet.findById(petId)
+
+ const isRainbowPet = await isRainbow(findUser.pets)
+ const rainbowButtonCheck = await rainbowCheck(findUser.pets)
+ const rainbowMainPageResDto = new RainbowMainPageResDto(findUser.book, isRainbowPet, rainbowButtonCheck)
+ const firstPartTableContents = findUser.book.tableContents.firstPartTableContents
+ console.log('firstPartTableContents : '+firstPartTableContents)
+
+ const validMemories = firstPartTableContents.filter(tableContents =>
+ tableContents.petDiary.length > 0).map(tableContents =>
+ tableContents.petDiary.filter(petDiary =>
+ petDiary.pets.includes(petId))
+ )[0]
+ console.log('validMemories : '+ validMemories)
+ console.log('!!!!!!!!!!!!!!!!!!!!! : '+validMemories[0])
+ console.log('@@@@@@@@@@@@@@@@@@ : '+validMemories[1])
+ //validMemories : [tableContetns [petDiary]]
+
+ let memoriesResDto = [null, null]
+ console.log('validMemoriesLength : '+validMemories.length)
+ if (validMemories.length == 2) {
+ memoriesResDto[0] = new MemoriesResDto(validMemories, findPet)
+ memoriesResDto[1] = new MemoriesResDto(validMemories, findPet)
+ } else if (validMemories.length > 2) {
+ let firstTableContentsIndex = await getRandomNumber(validMemories.length)
+ let secondTableContentsIndex = await getRandomNumber(validMemories.length)
+ if (firstTableContentsIndex == secondTableContentsIndex) {
+ while (firstTableContentsIndex == secondTableContentsIndex) {
+ if (secondTableContentsIndex == firstTableContentsIndex) {
+ secondTableContentsIndex = await getRandomNumber(validMemories.length)
+ } else {
+ break;
+ }
+ }
+ }
+ console.log('firstTableContentsIndex : '+firstTableContentsIndex)
+ console.log('secondTableCOntetnsIndex : '+secondTableContentsIndex)
+ console.log('fisrt : '+validMemories[firstTableContentsIndex])
+ console.log('second : '+validMemories[secondTableContentsIndex])
+ memoriesResDto[0] = new MemoriesResDto2(validMemories[firstTableContentsIndex], findPet)
+ memoriesResDto[1] = new MemoriesResDto2(validMemories[secondTableContentsIndex], findPet)
+ } else if (validMemories.length == 1) {
+ memoriesResDto[0] = new MemoriesResDto2(validMemories[0], findPet)
+ }
+ rainbowMainPageResDto.setMemories(memoriesResDto)
+
+ //helpResDto
+ const helps = await Help.find()
+ const helpResDto = helps.map(help => new HelpResDto(help))
+
+ rainbowMainPageResDto.setHelp(helpResDto)
+
+ return rainbowMainPageResDto
+ } catch (error) {
+ throw error
+ }
+
+ function getRandomNumber(max: number) {
+ max = Math.floor(max);
+ return Math.floor(Math.random() * max);
+ }
+ function isRainbow(pets: IPet[]) {
+ let rainbow = false
+ pets.forEach(pet => {
+ if (pet.rainbow === true) {
+ rainbow = true
+ }
+ })
+ return rainbow
+ }
+ function rainbowCheck(pets: IPet[]) {
+ let check = true
+ pets.forEach(pet => {
+ if (pet.rainbow === false) {
+ check = false
+ }
+ })
+ return check
+ }
+ },
+
+ selectPet: async () => {
+ try {
+ const findUser = await User.find().populate({
+ path: "pets"
+ })
+ const rainbowPetResDto = new RainbowPetResDto(findUser[0].pets.filter(pet=>!pet.rainbow).map(pet =>
+ new MyPetInfoResDto(pet)))
+
+ return rainbowPetResDto
+ } catch (err) {
+ throw err
+ }
+ },
+
+ setPartingRainbowPet: async (petId) => {
+ try {
+ const findPet = await Pet.findById(petId).populate({
+ path: "user",
+ populate: {
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents"
+ }
+ }
+ }
+ })
+ findPet.rainbow = true
+ await findPet.save()
+ const user = findPet.user
+ // for()
+
+ let diaryCount = 0
+ user.book.tableContents.firstPartTableContents.forEach(tableContent =>
+ diaryCount += tableContent.petDiary.length)
+
+ return new PartingRainbowResDto(diaryCount, findPet)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ cancelPartingPet: async (petId) => {
+ try {
+ const findPet = await Pet.findById(petId)
+ findPet.rainbow = false
+ await findPet.save()
+ } catch (err) {
+ throw err
+ }
+ },
+
+ getReadyPartingPetComment: async (petId) => {
+ try {
+ const pet = await Pet.findById(petId).populate({
+ path: "user",
+ populate: {
+ path: "book",
+ populate: {
+ path: "tableContents",
+ populate: {
+ path: "firstPartTableContents"
+ }
+ }
+ }
+ })
+
+ const user = pet.user
+ const bookInfo = new BookInfoResDto(pet.user.book)
+ let diaryCount = 0
+ user.book.tableContents.firstPartTableContents.forEach(tableContent =>
+ diaryCount += tableContent.petDiary.length)
+
+ const startDate = pet.startDate
+ const dayTogether = await dateMethod.getElapsedDay(startDate)
+
+ return new ReadyPartingAndStartRecordResDto(diaryCount, dayTogether, bookInfo)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ getTheBestMoment: async (userId, petId) => {
+ try {
+ const pet = await Pet.findById(petId)
+ const timeTogether = (await User.findById(userId).populate('book')).book.date
+ const TheBestMomentPetInfo = new TheBestMomentPetInformation(pet)
+ const diaryPerFeeling = []
+ for (let i = 0; i < 6; i++) {
+ const diaries = (await PetEmotions.find({ "feeling": { $eq: i } }).select("petDiary").populate({ path: "petDiary", populate: ({ path: "tableContents" }) })).map(emotion => emotion.petDiary)
+ if (diaries.length < 1) {
+ diaryPerFeeling.push(null)
+ } else {
+ diaryPerFeeling.push(diaries)
+ }
+ }
+
+ const theBestMomentsResDto = new TheBestMomentsResDto(timeTogether)
+ for (let j = 0; j < 6; j++) { //긍정3개, 부정3개
+ const commentPerFeeling = await Comments.findOne({ feeling: j , classification : 1})
+
+ // let commentPerFeeling ={
+ // comments : "",
+ // feeling : j
+ // }
+ // if(j==0){
+ // commentPerFeeling.comments = await theBestMomentComments.loveFeeling(pet.name)
+ // }else if(j==1){
+ // commentPerFeeling = await theBestMomentComments.happyFeeling(pet.name)
+ // }else if(j==2){
+ // commentPerFeeling = await theBestMomentComments.normalFeeling()
+ // }else if(j==3){
+ // commentPerFeeling = await theBestMomentComments.angryFeeling(pet.name)
+ // }else if(j==4){
+ // commentPerFeeling = await theBestMomentComments.gloomyFeeling()
+ // }else if(j==5){
+ // commentPerFeeling = await theBestMomentComments.boringFeeling()
+ // }
+
+ let theBestMoment = null
+ if (j < 3) {
+ theBestMoment = new TheBestMoment(commentPerFeeling, getPositiveRadomDiary(diaryPerFeeling[j]))
+ } else {
+ theBestMoment = new TheBestMoment(commentPerFeeling, getNegativeRandomDiary(diaryPerFeeling[j]))
+ }
+ theBestMomentsResDto.setTheBestMoment(theBestMoment)
+ theBestMomentsResDto.setTheBestMomentPetInfo(TheBestMomentPetInfo)
+ }
+
+ return theBestMomentsResDto
+ } catch (err) {
+ throw err
+ }
+
+ //각 기분에 따른 일기들을 배열로 묶어서 보내줘야함
+ function getPositiveRadomDiary(diaries: IPetDiary[]) {
+ if (diaries === null) return null
+ const diaryLength = diaries.length
+ const theBestMomentDiaries = []
+ if (diaryLength < 8) {
+ for (let i = 0; i < diaryLength; i++) { //가지고 있는 일기 갯수만큼만 넣는다
+ theBestMomentDiaries.push(new TheBestMomentDiary(diaries[i]))
+ }
+ for (let j = 0; j < 8 - diaryLength; j++) { //남은 일기갯수(8-가지고 있는 일기수)만큼 null로 채워준다
+ theBestMomentDiaries.push(null)
+ }
+ } else {
+ //8개 이상의 일기중 8개만 골라서 넣어준다.
+ const indexArray = []
+ while (indexArray.length < 8) {
+ let index = getRandomNumber(diaryLength)
+ if (!indexArray.includes(index)) {
+ indexArray.push(index)
+ }
+ }
+ for (let k = 0; k < 8; k++) {
+ theBestMomentDiaries.push(new TheBestMomentDiary(diaries[indexArray[k]]))
+ }
+ }
+ return theBestMomentDiaries
+ }
+
+ //부정 일기는 2개씩만
+ function getNegativeRandomDiary(diaries: IPetDiary[]) {
+ if (diaries === null) return null
+ const diaryLength = diaries.length
+ const theBestMomentDiaries = []
+ console.log('부정 일기 길이 : '+diaryLength)
+ console.log('찾자 diary!!!! : '+diaries)
+ if (diaryLength < 2) {
+ for (let i = 0; i < diaryLength; i++) {
+ theBestMomentDiaries.push(new TheBestMomentDiary(diaries[i]))
+ }
+ for (let j = 0; j < 2 - diaryLength; j++) {
+ theBestMomentDiaries.push(null)
+ }
+ } else {
+ const indexArray = []
+ while (indexArray.length < 2) {
+ let index = getRandomNumber(diaryLength)
+ console.log('index!!!! : '+index)
+ if (!indexArray.includes(index)) {
+ indexArray.push(index)
+ }
+ }
+ for (let k = 0; k < 2; k++) {
+ theBestMomentDiaries.push(new TheBestMomentDiary(diaries[indexArray[k]]))
+ }
+ }
+ return theBestMomentDiaries
+ }
+
+ function getRandomNumber(max: number) {
+ max = Math.floor(max);
+ return Math.floor(Math.random() * max);
+ }
},
+
+ getPartingPetName: async (petId) => {
+ try {
+ const pet = await Pet.findById(petId)
+ return new PetNameResDto(pet)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ postEpilogue: async (userId, data) => {
+ try {
+ console.log('id : '+userId)
+ const test = await User.findById(userId)
+ console.log('test!!! : '+test)
+ const user = await User.findById(userId).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "firstPartTableContents secondPartTableContents"
+ })
+ })
+ })
+ console.log('user : '+user)
+ const tableContents = user.book.tableContents
+
+ //1부 목차 마지막에 에필로그
+ const firstPartEpilogue = new FirstPartTableContents({
+ chapter: -1,
+ title: data.title,
+ contents: data.contents
+ })
+ await firstPartEpilogue.save()
+ await tableContents.firstPartTableContents.push(firstPartEpilogue)
+
+ const isAlreadySecondPartTableContents = await SecondPartTableContent.find()//첫 반려동물이 무지개를 건넜는지 확인하기 위한 로직
+
+ //2부 목차 처음에 에필로그
+ const secondPartEpilogue = new SecondPartTableContent({
+ chapter: 0,
+ title: data.title,
+ contents: data.contents
+ })
+ const saveSecondPartEpiogue = await secondPartEpilogue.save()
+ await tableContents.secondPartTableContents.unshift(saveSecondPartEpiogue)
+
+ if (isAlreadySecondPartTableContents.length < 1) {
+ const season = ["봄", "여름", "가을", "겨울"]
+ for (let i = 0; i < 4; i++) {
+ let chapter = 1
+ const dummySecondPartTableContents = new SecondPartTableContent({
+ chapter,
+ title: `${user.book.author}의 ${season[i]}`
+ })
+ const saveSecondPartEpiogue = await dummySecondPartTableContents.save()
+ await tableContents.secondPartTableContents.push(saveSecondPartEpiogue)
+ chapter = chapter + 1
+ }
+ }
+ await tableContents.save()
+
+ return user
+ } catch (err) {
+ throw err
+ }
+ },
+
+ getTheBestMomentSub:async (petId,theBestMoment) =>{
+ try{
+ const pet = await Pet.findById(petId)
+ return new TheBestMomentSubResDto(pet,theBestMoment)
+ }catch(err){
+ throw err
+ }
+ }
}
\ No newline at end of file
diff --git a/src/api/service/secondPartService.ts b/src/api/service/secondPartService.ts
new file mode 100644
index 0000000..491159c
--- /dev/null
+++ b/src/api/service/secondPartService.ts
@@ -0,0 +1,255 @@
+import SecondPartTableContent from "../../models/tableContents/SecondPartTableContent"
+import PetDiary from "../../models/diary/PetDiary"
+import UserDiary from "../../models/diary/UserDiary"
+import User from "../../models/user/User"
+import Book from "../../models/book/Book"
+import { SecondPartMainPageResDto,SecondPartMainPageDiary ,SecondPartMainPageTableContents } from "../../dto/secondPart/SecondPartMainPageResDto"
+import { SecondPartDiariesOfMonth, SecondPartDiariesOfMonthResDto } from "../../dto/secondPart/SecondPartDiariesOfMonthResDto"
+import { SecondPartChapterListResDto } from "../../dto/secondPart/SecondPartChapterListResDto"
+import { SecondPartDiaryResDto } from "../../dto/secondPart/SecondPartDiaryResDto"
+import TableContents from "../../models/tableContents/TableContents"
+const dateMethod = require("../../modules/dateMethod")
+
+require('../../models/tableContents/FirstPartTableContents')
+require('../../models/tableContents/SecondPartTableContent')
+require('../../models/diary/PetDiary')
+require('../../models/diary/UserDiary')
+require('../../models/diary/PetEmotions')
+require('../../models/book/Book')
+
+module.exports = {
+ getMainPage: async (userId) => {
+ try {
+ const user = await User.findById(userId).populate({
+ path: "book",
+ populate: ({
+ path: "tableContents",
+ populate: ({
+ path: "secondPartTableContents",
+ populate: ({
+ path: "userDiary"
+ })
+ })
+ })
+ })
+ //console.log('mmmm : ',user)
+
+ const epilogue = user.book.tableContents.secondPartTableContents[0]
+ const checkFirst = user.book.tableContents.secondPartTableContents.map(tableContents => tableContents.userDiary)
+ let check = false
+ checkFirst.forEach(x => {
+ if (x.length > 1) check = true
+ })
+
+ let sortSecondPartTableContents = []
+ if (check) {
+ sortSecondPartTableContents = user.book.tableContents.secondPartTableContents.filter(secondPartTableContents =>
+ secondPartTableContents.userDiary.length > 1).sort((a, b) =>
+ b.chapter - a.chapter
+ )[0].userDiary.sort((a, b) =>
+ b.episode - a.episode
+ )
+ } else {
+ sortSecondPartTableContents.push({
+ nextEpisode: 1,
+ episode: 0,
+ title: epilogue.title,
+ contents: epilogue.contents,
+ date: user.book.tableContents.secondPartStartDate
+ })
+ }
+ //console.log("sort",sortSecondPartTableContents)
+ const curSecondPartTableContents=await SecondPartTableContent.findById(sortSecondPartTableContents[0].tableContents)
+ let mainPageDto=new SecondPartMainPageResDto(user, sortSecondPartTableContents[0])
+ console.log("말도안돼...",curSecondPartTableContents)
+ mainPageDto.setDiary(await new SecondPartMainPageDiary(curSecondPartTableContents.chapter,sortSecondPartTableContents[0]))
+ return mainPageDto
+ } catch (err) {
+ throw err
+ }
+ },
+
+ getDiaryOfTableContents: async (tableContentsId) => {
+ try {
+ const tableContents = await SecondPartTableContent.findById(tableContentsId).populate({
+ path: "userDiary"
+ })
+ const test = tableContents.userDiary.filter(userDiary =>
+ userDiary.date.getMonth() == 6
+ )
+
+ const secondPartDiariesOfMonth: SecondPartDiariesOfMonth[] = []
+ for (let i = 12; i > 0; i--) {
+ if ((tableContents.userDiary.map(diary => diary.date.getMonth() == i)).includes(true)) {
+ const filteringDiaries = tableContents.userDiary.filter(userDiary =>
+ userDiary.date.getMonth() == i)
+ secondPartDiariesOfMonth.push(new SecondPartDiariesOfMonth(i + 1, filteringDiaries))
+ }
+ }
+
+ return new SecondPartDiariesOfMonthResDto(tableContents, secondPartDiariesOfMonth)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ getSecondPartChapterList: async () => {
+ try {
+ const chapterList = await SecondPartTableContent.find()
+ return new SecondPartChapterListResDto(chapterList)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ addSecondPartChapter: async (chapterData) => {
+ try {
+ let newChapter = new SecondPartTableContent({
+ title: chapterData.chapterTitle,
+ chapter: await getNextChapter()
+ })
+ await newChapter.save()
+
+ const tableContents = (await TableContents.find())[0]
+ await tableContents.setSecondPartTableContents(newChapter)
+ await tableContents.save()
+
+ const chapterList = await SecondPartTableContent.find()
+ return new SecondPartChapterListResDto(chapterList)
+
+ } catch (err) {
+ throw err
+ }
+
+ async function getNextChapter() {
+ const secondPartTableContents = (await SecondPartTableContent.find())
+ const secondPartLength = secondPartTableContents.length
+
+ return secondPartTableContents[secondPartLength - 1].chapter + 1
+ }
+ },
+
+ modifySecondPartChapterInfo: async (chapterId, modifyChapterData) => {
+ try {
+ await SecondPartTableContent.updateOne(
+ { _id: chapterId },
+ { $set: { title: modifyChapterData.chapterTitle } }
+ )
+ const chapterList = await SecondPartTableContent.find()
+ return new SecondPartChapterListResDto(chapterList)
+ } catch (err) {
+ throw err
+ }
+ },
+
+ deleteSecondPartChapter: async (chapterId) => {
+ try {
+ //삭제하고자하는 2부 목차
+ const findSecondPartChapter = await SecondPartTableContent.findById(chapterId).populate({
+ path: "userDiary"
+ })
+ if (findSecondPartChapter === null) {
+ throw { statusCode: 400 }
+ }
+
+ //전체 2부 목차
+ const tableContents = (await TableContents.find().populate({
+ path: "secondPartTableContents"
+ }))[0]
+
+ //삭제할 2부 목차의 chapter보다 큰 챕터 배열 & chapter -1씩 줄임 & 저장
+ tableContents.secondPartTableContents.filter(secondPartTable =>
+ secondPartTable.chapter > findSecondPartChapter.chapter).forEach(async secondPartTable => {
+ secondPartTable.chapter -= 1
+ await secondPartTable.save()
+ })
+
+ //2부 목차에서 해당 목차 삭제
+ await SecondPartTableContent.deleteOne({ _id: `${chapterId}` })
+
+ //2부 목차에 들어있던 userDiary 삭제
+ const userDiaries = findSecondPartChapter.userDiary;
+
+ userDiaries.forEach(async userDiary => {
+ await UserDiary.deleteOne({ _id: `${userDiary._id}` })
+ })
+
+ //총 목차(1부,2부)에서 해당 목차 secondPartTableContents배열에서 삭제
+ const idx = tableContents.secondPartTableContents.findIndex(secondPartTable => secondPartTable._id == chapterId)
+ tableContents.secondPartTableContents.splice(idx, 1)
+ await tableContents.save()
+
+ const chapterList = await SecondPartTableContent.find()
+ return new SecondPartChapterListResDto(chapterList)
+ } catch (err) {
+ throw err
+ }
+ }, getSecondPartDiary: async (diaryId) => {
+ try {
+ console.log(diaryId)
+ const findSecondPartDiary = await UserDiary.findById(diaryId).populate('users').populate('tableContents');
+ console.log(findSecondPartDiary)
+ let secondPartDiaryResDto = await new SecondPartDiaryResDto(findSecondPartDiary)
+ console.log(secondPartDiaryResDto)
+ return secondPartDiaryResDto
+
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: 400 }
+ }
+
+ }, addSecondPartDiary: async (diaryData) => {
+ const secondPartTableContents = await SecondPartTableContent.findById(diaryData.chapterId).populate('userDiary')
+ console.log("length: ", secondPartTableContents.userDiary.length)
+ let newUserDiary = new UserDiary({
+ tableContents: diaryData.chapterId,
+ episode: secondPartTableContents.userDiary.length,
+ imgs: "https://watcha.s3.ap-northeast-2.amazonaws.com/images/origin/%EC%B1%85+%EC%9D%B4%EB%AF%B8%EC%A7%80.jpg",
+ title: diaryData.title,
+ contents: diaryData.contents,
+ feeling: diaryData.feeling
+ })
+ secondPartTableContents.setUserDiary(newUserDiary)
+ await secondPartTableContents.save()
+ try {
+ console.log(newUserDiary)
+ await newUserDiary.save()
+ } catch (err) {
+ console.log(err)
+ throw { statusCode: 400 }
+ }
+ }
+ ,
+ modifySecondPartDiary: async (diaryId, diaryData) => {
+ try {
+ await UserDiary.updateOne(
+ { _id: diaryId },
+ { $set: { imgs: diaryData.diaryImages, title: diaryData.title, contents: diaryData.contents, feeling: diaryData.feeling } }
+ )
+ } catch (err) {
+ throw err
+ }
+ }, deleteSecondPartDiary: async (diaryId) => {
+ try {
+ const findDiary = await UserDiary.findById(diaryId).populate('tableContents');
+ const userDiaries = (await SecondPartTableContent.findOne({ chapter: { $eq: findDiary.tableContents.chapter } })).userDiary
+ for (let i = 0; i < userDiaries.length; i++) {
+ let userChapter = await UserDiary.findById(userDiaries[i])
+ if (findDiary.episode <= userChapter.episode) {
+ userChapter.episode = Number(userChapter.episode) - 1
+ await userChapter.save()
+ }
+ }
+ await UserDiary.deleteOne({ _id: findDiary })
+
+ for(let j = 0 ;j {
+ //See if user exists(check valid email)
+ const errors = validationResult(email);
+ if (!errors.isEmpty()) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.EMPTY_ID };
+ }
+ if (!validator.isEmail(email) || !validator.isLength(password, { min: 8 })) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.WRONG_FORM };
+ }
+
+ let user = await User.findOne({ email });
+ if (user) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.ALREADY_ID };
+ }
+
+ const book=new Book()
+ user = new User({
+ email,
+ password,
+ book
+ });
+ await book.save()
+
+ //Encrpyt password
+ const salt = await bcrypt.genSalt(10);
+ user.password = await bcrypt.hash(password, salt);
+ await user.save()
+
+ },
+ login: async (email, password) => {
+ try {
+ const errors = validationResult(email);
+ if (!errors.isEmpty()) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.EMPTY_ID };
+ }
+ let user = await User.findOne({ email }).populate({
+ path : "pets"
+ });
+ if (!user) {
+ //등록되지 않은 email
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.NO_USER };
+ }
+
+ const test = await bcrypt.compare(password, user.password)
+ console.log('asdada' + test)
+ if (!test) {
+ throw { statusCode: statusCode.BAD_REQUEST, responseMessage: responseMessage.SIGN_IN_FAIL };
+ }
+ let petId = null
+ if(user.pets[0] != undefined){
+ petId = user.pets[0]._id
+ }
+ return { userId : user._id, petId : petId}
+ } catch (err) {
+ throw err
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/dto/calendar/calendarResDto.ts b/src/dto/calendar/calendarResDto.ts
new file mode 100644
index 0000000..689c59a
--- /dev/null
+++ b/src/dto/calendar/calendarResDto.ts
@@ -0,0 +1,75 @@
+import { IPetDiary } from "../../interfaces/diary/IPetDiary"
+import { IUserDiary } from "../../interfaces/diary/IUserDiary"
+import { IFirstPartTableContents } from "../../interfaces/tableContents/IFirstPartTableContents"
+import { ISecondPartTableContents } from "../../interfaces/tableContents/ISecondPartTableContents"
+import { IUser } from "../../interfaces/user/IUser"
+
+const IPet = require("../../interfaces/pet/IPet")
+
+export class CalendarResDto{
+ private name = null
+ private part = null
+ private nextEpilogue = null
+ private calendar = null
+
+ constructor(name, part){
+ this.name = name
+ this.part = part
+ }
+
+ setCalendar(calendar : CalendarInfoResDto){
+ this.calendar = calendar
+ }
+}
+
+export class CalendarInfoResDto{
+ private year = null
+ private month = null
+ private date = []
+
+ constructor(year ,month){
+ this.year = year
+ this.month = month
+ }
+
+ setDate(calendarDateDto : CalendarDatePetDto | CalendarDateUserDto){
+ this.date.push(calendarDateDto)
+ }
+}
+
+export class CalendarDatePetDto{
+ private days = null
+ private kind = null
+ private id = []
+ private feeling = null
+
+ constructor(days, petDiaries : IPetDiary[] ){
+ this.days = days
+ this.kind = petDiaries[0].pets[0].kind
+ this.id = petDiaries.map(diary=>diary._id)
+ this.feeling = petDiaries[0].petEmotions[0].feeling
+ }
+}
+
+export class CalendarDateUserDto{
+ private days = null
+ private kind = null
+ private diaryId = []
+ private feeling = null
+
+ constructor(days, userDiaries : IUserDiary[], user : IUser){
+ this.days = days
+ this.kind = this.getUsersPet(user)
+ this.diaryId = userDiaries.map(diary => diary._id)
+ this.feeling = userDiaries[0].feeling
+ }
+
+ getUsersPet(user : IUser){
+ const pets = user.pets
+ let petsKind = null
+ for(let i = pets.length-1 ; i >=0 ; i--){
+ if(pets[i].rainbow) petsKind = pets[i].kind
+ }
+ return petsKind
+ }
+}
\ No newline at end of file
diff --git a/src/dto/firstPart/mainPageDto/FirstPartMainPageResDto.ts b/src/dto/firstPart/mainPageDto/FirstPartMainPageResDto.ts
new file mode 100644
index 0000000..803612a
--- /dev/null
+++ b/src/dto/firstPart/mainPageDto/FirstPartMainPageResDto.ts
@@ -0,0 +1,100 @@
+import { IPetDiary } from "../../../interfaces/diary/IPetDiary";
+import { IHelp } from "../../../interfaces/etc/IHelp";
+import { IPet } from "../../../interfaces/pet/IPet";
+import { IBook } from "../../../interfaces/book/IBook";
+import { IFirstPartTableContents } from "../../../interfaces/tableContents/IFirstPartTableContents";
+import { ITableContents } from "../../../interfaces/tableContents/ITableContents";
+import { IUser } from "../../../interfaces/user/IUser";
+const dateMethod = require('../../../modules/dateMethod')
+
+export class FirstPartMainPageResDto {
+ public firstPartMainPage = {
+ title: null,
+ bookImg: null,
+ diary: null,
+ tableContents: [],
+ secondPartBook: null,
+ nextEpisode:null
+ }
+
+ constructor(book: IBook) {
+ this.firstPartMainPage.title = book.title
+ this.firstPartMainPage.bookImg = book.imgs
+ }
+ setNextEpisode(diaryResDto:DiaryResDto){
+ this.firstPartMainPage.nextEpisode=diaryResDto.episode+1
+ }
+ //가장 최근 일기 작성(기분X)
+ setDiary(diary: DiaryResDto) {
+ this.firstPartMainPage.diary = diary
+ }
+ setTableContents(tableContents: TableContentsResDto) {
+ this.firstPartMainPage.tableContents.push(tableContents)
+ }
+ setSecondPartBook(user: IUser) {
+ this.firstPartMainPage.secondPartBook = new SecondPartBookResDto(user)
+ }
+}
+
+export class DiaryResDto {
+ private _id;
+ private chapter;
+ public episode;
+ private title;
+ private contents;
+ private date;
+ private kind;
+
+ //가장 마지막 화 들어감
+ constructor(petDiary: IPetDiary) {
+ this.init(petDiary)
+ }
+
+ async init(petDiary: IPetDiary) {
+ console.log('findPet : '+petDiary.petEmotions[0])
+ const firstPartTableContents = petDiary.tableContents
+ this.chapter = firstPartTableContents.chapter
+ this.episode = firstPartTableContents.petDiary.length;
+ //if(this.chapter==0){
+ // this._id="60ed3acde5003a744892ce27"
+ //}else{
+ this._id=petDiary._id
+ //}
+ this.title = petDiary.title;
+ this.contents = petDiary.contents;
+ this.date = await dateMethod.toStringByFormatting(petDiary.date);
+ this.kind = petDiary.petEmotions[0].pet.kind
+ }
+}
+
+export class TableContentsResDto {
+ private chapterId;
+ private chapter;
+ private chapterTitle;
+ private episodePerchapterCount;
+
+ constructor(firstPartTableContents: IFirstPartTableContents) {
+ this.chapterId = firstPartTableContents._id //목차 Id
+ this.chapterTitle = firstPartTableContents.title;
+ this.chapter = firstPartTableContents.chapter;
+ this.episodePerchapterCount = firstPartTableContents.petDiary.length;
+ }
+}
+
+export class SecondPartBookResDto {
+ private userId=null
+ private bookImg=null
+ private author=null
+ private date=null
+
+ constructor(user: IUser) {
+ this.init(user)
+ }
+
+ async init(user: IUser) {
+ this.userId = user._id
+ this.bookImg = user.book.imgs
+ this.author = user.book.author
+ this.date = await dateMethod.toStringByFormatting(user.book.date)
+ }
+}
\ No newline at end of file
diff --git a/src/dto/petChapter/ChapterList.ts b/src/dto/petChapter/ChapterList.ts
new file mode 100644
index 0000000..e504ebc
--- /dev/null
+++ b/src/dto/petChapter/ChapterList.ts
@@ -0,0 +1,34 @@
+import { IPetDiary, IPetDiaryDocument } from "../../interfaces/diary/IPetDiary";
+import { IPetEmotions } from "../../interfaces/diary/IPetEmotions";
+import { IFirstPartTableContents } from "../../interfaces/tableContents/IFirstPartTableContents";
+import PetDiary from "../../models/diary/PetDiary"
+import PetEmotions from "../../models/diary/PetEmotions"
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+const dateMethod = require('../../modules/dateMethod')
+
+export class ChapterListResDto{
+ public tableContents = [ ]
+ setChapterList(chapter:ChapterResDto){
+ this.tableContents.push(chapter)
+ }
+}
+export class ChapterResDto{
+ public chapterId=null
+ public chapter=null
+ public chapterTitle=null
+ public episodePerchapterCount=null
+
+
+ constructor(firstPartTableContents:IFirstPartTableContents){
+ this.chapterId=firstPartTableContents._id
+ this.chapter=firstPartTableContents.chapter
+ this.chapterTitle=firstPartTableContents.title
+ this.episodePerchapterCount
+ }
+}
+
+export{}
\ No newline at end of file
diff --git a/src/dto/petChapter/PetChapterDiary.ts b/src/dto/petChapter/PetChapterDiary.ts
new file mode 100644
index 0000000..1e169ac
--- /dev/null
+++ b/src/dto/petChapter/PetChapterDiary.ts
@@ -0,0 +1,75 @@
+import { IPetDiary, IPetDiaryDocument } from "../../interfaces/diary/IPetDiary";
+import { IPetEmotions } from "../../interfaces/diary/IPetEmotions";
+import { IFirstPartTableContents } from "../../interfaces/tableContents/IFirstPartTableContents";
+import PetDiary from "../../models/diary/PetDiary"
+import PetEmotions from "../../models/diary/PetEmotions"
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+const dateMethod = require('../../modules/dateMethod')
+
+export class PetChapterDiaryResDto{
+ public petChapterDiary = {
+ chapterId:null,
+ chapter:null,
+ chapterTitle:null,
+ monthly:[],
+ }
+
+ constructor(firstPartTableContents:IFirstPartTableContents){
+ this.petChapterDiary.chapterId=firstPartTableContents._id
+ this.petChapterDiary.chapter=firstPartTableContents.chapter
+ this.petChapterDiary.chapterTitle=firstPartTableContents.title
+ }
+ setMonthly(monthly:MonthlyDiaryResDto){
+ this.petChapterDiary.monthly.push(monthly)
+ }
+}
+
+export class MonthlyDiaryResDto{
+ episodePerMonthCount=null
+ month=null
+ diaries=[]
+
+ constructor(){ }
+ setMonthCount(monthCount:Number){this.episodePerMonthCount=monthCount}
+ setMonth(month:Number){ this.month=month}
+ setDiaries(diary:DiariesResDto){
+ this.diaries.push(diary)
+ }
+
+}
+export class DiariesResDto{
+ diaryId=null
+ title=null
+ contents=null
+ episode=null
+ image=null
+ feelingCount=null
+ feeling=null
+ date=null
+ weekday=null
+ kind=null
+
+ constructor(diary : IPetDiary){
+ const week=new Array('일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일');
+ console.log('test : '+diary._id)
+ this.diaryId=diary._id
+ this.title=diary.title
+ this.contents=diary.contents
+ this.episode=diary.episode
+ this.image=diary.imgs[0]//가장 첫번째 사진
+ this.feelingCount=diary.petEmotions.length
+ this.feeling=diary.petEmotions[0].feeling
+ this.date=diary.date.getDate()+"일"
+ console.log('요일 : '+diary.date.getDay())
+ this.weekday= week[diary.date.getDay()]
+ this.kind=diary.pets[0].kind
+ }
+ setFeeling(petEmotion:Number){
+ this.feeling=petEmotion
+ }
+}
+export{}
\ No newline at end of file
diff --git a/src/dto/petDiary/PetDiaryPageResDto.ts b/src/dto/petDiary/PetDiaryPageResDto.ts
new file mode 100644
index 0000000..fa3fcc8
--- /dev/null
+++ b/src/dto/petDiary/PetDiaryPageResDto.ts
@@ -0,0 +1,63 @@
+import { IPetDiary, IPetDiaryDocument } from "../../interfaces/diary/IPetDiary";
+import { IPetEmotions } from "../../interfaces/diary/IPetEmotions";
+import { IPet } from "../../interfaces/pet/IPet";
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/FirstPartTableContents')
+const dateMethod = require('../../modules/dateMethod')
+
+export class PetDiaryPageResDto {
+ public petDiary = {
+ _id: null,
+ //chapter:null,
+ episode: null,
+ title: null,
+ bookImg: [],
+ date: null,
+ contents: null,
+ timeTogether: null,
+ // kind: null,
+ feelingList: []
+ //feeling,kind,img
+ }
+
+
+ constructor(petDiary: IPetDiary) {
+ this.init(petDiary)
+ }
+ async init(petDiary: IPetDiary) {
+ this.petDiary._id = petDiary._id
+ //this.petDiaryPage.chapter=temp.chapter
+ this.petDiary.title = petDiary.title
+ this.petDiary.bookImg = petDiary.imgs
+ this.petDiary.date = await dateMethod.toKoreanByFormatting(petDiary.date)
+ this.petDiary.episode = petDiary.episode
+ this.petDiary.contents = petDiary.contents
+ // this.petDiary.kind = petDiary.pets[0].kind
+ this.petDiary.timeTogether = await dateMethod.getElapsedDay(petDiary.pets[0].startDate)
+ }
+ setFeelingList(feelingList:FeelingListDto) {
+ this.petDiary.feelingList.push(feelingList)
+ }
+
+}
+
+export class FeelingListDto{
+ private feeling=null
+ private kind=null
+ private petImgs=null
+ constructor(pet:IPet){
+ this.kind=pet.kind
+ this.petImgs=pet.imgs
+ }
+ setFeeling(emotion:IPetEmotions){
+ this.feeling=emotion.feeling
+ }
+
+
+
+
+}
+export { }
\ No newline at end of file
diff --git a/src/dto/petDiary/SavePetResDto.ts b/src/dto/petDiary/SavePetResDto.ts
new file mode 100644
index 0000000..35972a1
--- /dev/null
+++ b/src/dto/petDiary/SavePetResDto.ts
@@ -0,0 +1,7 @@
+export class SavePetResDto{
+ private petId = []
+
+ constructor(petId){
+ this.petId = petId
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/mainPageDto/RainbowMainPageResDto.ts b/src/dto/rainbow/mainPageDto/RainbowMainPageResDto.ts
index 66f4537..5ca9404 100644
--- a/src/dto/rainbow/mainPageDto/RainbowMainPageResDto.ts
+++ b/src/dto/rainbow/mainPageDto/RainbowMainPageResDto.ts
@@ -1,56 +1,98 @@
import { IPetDiary } from "../../../interfaces/diary/IPetDiary";
import { IHelp } from "../../../interfaces/etc/IHelp";
import { IPet } from "../../../interfaces/pet/IPet";
-import { IFirstPartTableContents } from "../../../interfaces/tableContents/IFirstPartTableContents";
-import { IUser } from "../../../interfaces/user/IUser";
-
-interface IRainbowMainPageResDto{
- title : String,
- bookImg : String,
- memories : [MemoriesResDto],
- help : [HelpResDto]
-}
+import { IBook } from "../../../interfaces/book/IBook";
+import PetEmotions from "../../../models/diary/PetEmotions";
-export class RainbowMainPageResDto{
- public rainbowMainPage : IRainbowMainPageResDto;
+export class RainbowMainPageResDto {
+ public rainbowMainPage = {
+ title: null,
+ bookImg: null,
+ rainbowCheck: false,
+ memories: [],
+ help: []
+ }
- constructor(user : IUser){
- this.rainbowMainPage.title //작가와 무지개다리를 건넌 동물의 이름 합친거
- this.rainbowMainPage.bookImg = user.book.imgs //책 이미지에서 맨앞에?
+ constructor(book: IBook, isRainbowPet: boolean, rainbowButtonCheck: boolean) {
+ this.rainbowMainPage.title = isRainbowPet ? "우리들의 무지개" : "무지개 준비하기"//작가와 무지개다리를 건넌 동물의 이름 합친거
+ this.rainbowMainPage.bookImg = book.imgs
+ this.rainbowMainPage.rainbowCheck = rainbowButtonCheck
}
- setMemories(memories : MemoriesResDto){
- this.rainbowMainPage.memories.push(memories)
+ setMemories(memories: MemoriesResDto[] | MemoriesResDto2[]) {
+ this.rainbowMainPage.memories = memories
}
- setHelp(helps : [HelpResDto]){
+ setHelp(helps: HelpResDto[]) {
this.rainbowMainPage.help = helps
}
}
-export class MemoriesResDto{
+export class MemoriesResDto {
+ private diaryId;
private title;
private contents;
private date;
- private feel;
+ private feeling;
+ private kind;
+
+ constructor(petDiaries: IPetDiary[], petId: IPet) {
+ const diaryIndex = this.getRandomMemoryIndex(petDiaries.length)
+ const randomDiary = petDiaries[diaryIndex]
+ console.log('ccc : ' + petDiaries)
+ console.log('aaaa :' + randomDiary)
+ console.log('bbbb :' + diaryIndex)
+ console.log("랜덤된 petEmotion " + randomDiary.petEmotions.filter(petEmotion =>
+ petEmotion.pet == petId)[0])
+
+ this.diaryId = randomDiary._id
+ this.title = randomDiary.title
+ this.contents = randomDiary.contents
+ this.date = randomDiary.date
+ this.feeling = randomDiary.petEmotions.filter(petEmotion =>
+ petEmotion.pet == petId)[0].feeling
+ this.kind = randomDiary.petEmotions.filter(PetEmotions =>
+ PetEmotions.pet == petId)[0].pet.kind
+ console.log('kind : ' + randomDiary.petEmotions.filter(PetEmotions =>
+ PetEmotions.pet == petId)[0])
+ }
- constructor(firstPartTableContents : IFirstPartTableContents[], pet : IPet){
-
+ getRandomMemoryIndex(max: number) {
+ let min = Math.ceil(0);
+ max = Math.floor(max);
+ return Math.floor(Math.random() * (max - min)) + min;
}
+}
+
+export class MemoriesResDto2 {
+ private diaryId;
+ private title;
+ private contents;
+ private date;
+ private feeling;
+ private kind;
- randomMemory(firstPartTableContents : IFirstPartTableContents[]){
- const tableContentsLenght = firstPartTableContents.length
- const min = Math.ceil(0)
+ constructor(petDiary: IPetDiary, findPet:IPet) {
+ console.log('petId : '+findPet)
+ this.diaryId = petDiary._id
+ this.title = petDiary.title
+ this.contents = petDiary.contents
+ this.date = petDiary.date
+ console.log('petDiary : '+petDiary)
+ console.log('pet : '+petDiary.petEmotions.filter(petEmotions =>
+ petEmotions.pet._id == findPet._id))
+ this.feeling = petDiary.petEmotions[0].feeling
+ this.kind = findPet.kind
}
}
-export class HelpResDto{
+export class HelpResDto {
private classification;
private title;
private url;
- constructor(help : IHelp){
+ constructor(help: IHelp) {
this.classification = help.classification;
this.title = help.title;
- this.url = help.url;
+ this.url = help.url;
}
}
\ No newline at end of file
diff --git a/src/dto/rainbow/partingDto/PartingRainbowResDto.ts b/src/dto/rainbow/partingDto/PartingRainbowResDto.ts
new file mode 100644
index 0000000..aa5fbd4
--- /dev/null
+++ b/src/dto/rainbow/partingDto/PartingRainbowResDto.ts
@@ -0,0 +1,14 @@
+import { IPet } from "../../../interfaces/pet/IPet"
+
+export class PartingRainbowResDto{
+ public partingRainbowBridge = {
+ contents : "",
+ diaryCount : 0,
+ }
+
+ constructor(diaryCount : number, pet : IPet){
+ let petName = pet.kind == 1 ? "고양이" : "강아지"
+ this.partingRainbowBridge.contents =`작가님과 함께했던 ${diaryCount}화의 이야기 속에서 \n${pet.name}는(은) 의젓하고 당당한 ${petName}로서 \n행복한 인생을 보낼 수 있었어요. \n그리고 지금은 작가님보다 한 발 앞서서 \n먼저 무지개 다리로 가 친구들과 함께 \n작가님을 기다리기로 했습니다. \n\n그동안 행복한 일상을 선물해주셔서 감사합니다. \n${pet.name}이가 느꼈던 최고의 순간들을 모아봤어요.`,
+ this.partingRainbowBridge.diaryCount = diaryCount
+ }
+}
diff --git a/src/dto/rainbow/petDto/PetInfoDto.ts b/src/dto/rainbow/petDto/PetInfoDto.ts
new file mode 100644
index 0000000..2e73df9
--- /dev/null
+++ b/src/dto/rainbow/petDto/PetInfoDto.ts
@@ -0,0 +1,23 @@
+import { IPet } from "../../../interfaces/pet/IPet"
+
+export class PetsInfoDto{
+ private pets = []
+
+ constructor(petInfo : PetInfoDto[]){
+ this.pets = petInfo
+ }
+}
+
+export class PetInfoDto{
+ private _id = null
+ private img = ""
+ private name = ""
+ private kind = null
+
+ constructor(pet : IPet){
+ this._id = pet._id
+ this.img = pet.imgs as string
+ this.name = pet.name as string
+ this.kind = pet.kind
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/petDto/PetNameResDto.ts b/src/dto/rainbow/petDto/PetNameResDto.ts
new file mode 100644
index 0000000..5dfb973
--- /dev/null
+++ b/src/dto/rainbow/petDto/PetNameResDto.ts
@@ -0,0 +1,9 @@
+import { IPet } from "../../../interfaces/pet/IPet";
+
+export class PetNameResDto{
+ name
+
+ constructor(pet : IPet){
+ this.name = pet.name
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/petDto/RainbowPetResDto.ts b/src/dto/rainbow/petDto/RainbowPetResDto.ts
new file mode 100644
index 0000000..d3b1c75
--- /dev/null
+++ b/src/dto/rainbow/petDto/RainbowPetResDto.ts
@@ -0,0 +1,21 @@
+import {IPet} from "../../../interfaces/pet/IPet"
+
+export class RainbowPetResDto{
+ public pet = []
+
+ constructor(myPetInfoResDto : MyPetInfoResDto[]){
+ this.pet = myPetInfoResDto
+ }
+}
+
+export class MyPetInfoResDto{
+ public _id
+ public name
+ public img
+
+ constructor(pet : IPet){
+ this._id = pet._id
+ this.name = pet.name
+ this.img = pet.imgs
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.ts b/src/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.ts
new file mode 100644
index 0000000..38a394b
--- /dev/null
+++ b/src/dto/rainbow/readyPartingAndStartRecordDto/ReadyPartingAndStartRecordResDto.ts
@@ -0,0 +1,25 @@
+import { IBook } from "../../../interfaces/book/IBook";
+
+export class ReadyPartingAndStartRecordResDto{
+ diaryCount = 0;
+ dayTogether = 0;
+ bookInfo = {}
+
+ constructor(diaryCount : number, dayTogether : number, bookInfo : BookInfoResDto){
+ this.diaryCount = diaryCount
+ this.dayTogether = dayTogether
+ this.bookInfo = bookInfo
+ }
+}
+
+export class BookInfoResDto{
+ title = null;
+ bookImg = null;
+ author = null;
+ constructor(book : IBook){
+ console.log('!!!!! : '+book)
+ this.title = book.title
+ this.bookImg = book.imgs
+ this.author = book.author
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/theBestMomentDto/TheBestMomentResDto.ts b/src/dto/rainbow/theBestMomentDto/TheBestMomentResDto.ts
new file mode 100644
index 0000000..70af85b
--- /dev/null
+++ b/src/dto/rainbow/theBestMomentDto/TheBestMomentResDto.ts
@@ -0,0 +1,73 @@
+import { IPetDiary } from "../../../interfaces/diary/IPetDiary"
+import { IComments } from "../../../interfaces/etc/IComments"
+import { IPet } from "../../../interfaces/pet/IPet"
+const dateMethod = require("../../../modules/dateMethod")
+
+export class TheBestMomentsResDto {
+ private pet = {}
+ private theBestMoments = []
+ private timeTogether = {}
+
+ constructor(timeTogether : Date) {
+ this.init(timeTogether)
+ }
+
+ async init(timeTogether : Date){
+ this.timeTogether = `${(await dateMethod.toStringByFormatting(timeTogether))} - ${await dateMethod.toStringByFormatting(new Date())}`
+ }
+
+ setTheBestMoment(theBestMoment: TheBestMoment) {
+ this.theBestMoments.push(theBestMoment)
+ }
+
+ setTheBestMomentPetInfo(petInfo: TheBestMomentPetInformation) {
+ this.pet = petInfo
+ }
+}
+
+export class TheBestMomentPetInformation {
+ private name = null
+ private kind = null
+
+ constructor(pet: IPet) {
+ this.name = pet.name
+ this.kind = pet.kind
+ }
+}
+
+export class TheBestMoment { //[사랑],[기쁨],[보통]
+ private comment = null
+ private feeling = null
+ private diaries = []
+
+ constructor(commentPerFeeling, theBestMomentDiary: TheBestMomentDiary[]) {
+ this.comment = commentPerFeeling.comments
+ this.feeling = commentPerFeeling.feeling
+ this.diaries = theBestMomentDiary
+ }
+}
+
+export class TheBestMomentDiary {
+ private diaryId=null
+ private chapter = null
+ private episode = null
+ private title = null
+ private contents = null
+ private date = null
+
+ constructor(diaryPerFeeling: IPetDiary) {
+ this.init(diaryPerFeeling)
+ }
+
+ async init(diaryPerFeeling: IPetDiary) {
+ //console.log('!!!!!!!!!!!!!!!!!!!!!!!!! : ' + diaryPerFeeling)
+ if (diaryPerFeeling != undefined) {
+ this.diaryId= diaryPerFeeling._id
+ this.chapter = diaryPerFeeling.tableContents.chapter
+ this.episode = diaryPerFeeling.episode
+ this.title = diaryPerFeeling.title
+ this.contents = diaryPerFeeling.contents
+ this.date = await dateMethod.toStringByFormatting(diaryPerFeeling.date)
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.ts b/src/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.ts
new file mode 100644
index 0000000..313db42
--- /dev/null
+++ b/src/dto/rainbow/theBestMomentDto/TheBestMomentSubResDto.ts
@@ -0,0 +1,18 @@
+import { inherits } from "util"
+import { IPet } from "../../../interfaces/pet/IPet"
+import { TheBestMomentsResDto } from "./TheBestMomentResDto"
+const dateMethod = require("../../../modules/dateMethod")
+
+export class TheBestMomentSubResDto{
+ private rainbowComment
+ private rainbowBestMoment
+
+ constructor(pet: IPet, theBestMoment : TheBestMomentsResDto){
+ this.init(pet, theBestMoment)
+ }
+
+ async init(pet: IPet, theBestMoment : TheBestMomentsResDto){
+ this.rainbowComment = `작가님과 함께했던 ${await dateMethod.getElapsedDay(pet.startDate)}일의 시간동안\n${pet.name}는 의젓하고 당당한 ${pet.name}으로써\n행복한 인생을 보낼 수 있었어요.\n이젠 ${pet.name}가 느꼇던 최고의 순간들을\n모아봤어요!`
+ this.rainbowBestMoment = theBestMoment
+ }
+}
\ No newline at end of file
diff --git a/src/dto/secondPart/SecondPartChapterListResDto.ts b/src/dto/secondPart/SecondPartChapterListResDto.ts
new file mode 100644
index 0000000..baa21a2
--- /dev/null
+++ b/src/dto/secondPart/SecondPartChapterListResDto.ts
@@ -0,0 +1,22 @@
+import { ISecondPartTableContents } from "../../interfaces/tableContents/ISecondPartTableContents"
+
+export class SecondPartChapterListResDto{
+ private tableContents : SecondPartChapterList[] = []
+
+ constructor(secondPartChapterList : ISecondPartTableContents[]){
+ this.tableContents = secondPartChapterList.map(chapter=>
+ new SecondPartChapterList(chapter))
+ }
+}
+
+export class SecondPartChapterList{
+ private _id = null
+ private chapter = null
+ private title = null
+
+ constructor(chapter : ISecondPartTableContents){
+ this._id = chapter._id
+ this.chapter = chapter.chapter
+ this.title = chapter.title
+ }
+}
\ No newline at end of file
diff --git a/src/dto/secondPart/SecondPartDiariesOfMonthResDto.ts b/src/dto/secondPart/SecondPartDiariesOfMonthResDto.ts
new file mode 100644
index 0000000..1510478
--- /dev/null
+++ b/src/dto/secondPart/SecondPartDiariesOfMonthResDto.ts
@@ -0,0 +1,54 @@
+import { IUserDiary } from "../../interfaces/diary/IUserDiary"
+import { ISecondPartTableContents } from "../../interfaces/tableContents/ISecondPartTableContents"
+
+export class SecondPartDiariesOfMonthResDto{
+ private _id = null
+ private chapter = null
+ private chapterTitle = null
+ private diariesOfMonth = null
+
+ constructor(tableContents : ISecondPartTableContents, secondPartyDiariesOfMonth : SecondPartDiariesOfMonth[]){
+ this._id = tableContents._id
+ this.chapter = tableContents.chapter
+ this.chapterTitle = tableContents.title
+ this.diariesOfMonth = secondPartyDiariesOfMonth
+ }
+}
+
+export class SecondPartDiariesOfMonth{
+ private month = null
+ private diaryCountOfTableContents = null
+ private diaries = []
+
+ constructor(month : number, userDiaries : IUserDiary[]){
+ this.month = month
+ this.diaryCountOfTableContents = userDiaries.length
+ this.diaries = userDiaries.sort((a,b)=>
+ b.date.getDate() - a.date.getDate()
+ ).map(diary=> new SecondPartDiaries(diary))
+ }
+
+}
+
+export class SecondPartDiaries{
+ private diaryId = null
+ private days = null
+ private dayOfWeek = null
+ private feeling = null
+ private kind = null
+ private title = null
+ private contents = null
+ private img = null
+
+ constructor(userDiary : IUserDiary){
+ const weeks = ["일","월","화","수","목","금","토"]
+ this.diaryId = userDiary._id
+ this.days = userDiary.date.getDate()
+ this.dayOfWeek = weeks[userDiary.date.getDay()]
+ this.feeling = userDiary.feeling
+ this.kind = 0
+ this.title = userDiary.title
+ this.contents = userDiary.contents
+ this.img = userDiary.imgs[0]
+ }
+}
\ No newline at end of file
diff --git a/src/dto/secondPart/SecondPartDiaryResDto.ts b/src/dto/secondPart/SecondPartDiaryResDto.ts
new file mode 100644
index 0000000..a5da8d7
--- /dev/null
+++ b/src/dto/secondPart/SecondPartDiaryResDto.ts
@@ -0,0 +1,39 @@
+import { IUserDiary, IUserDiaryDocument } from "../../interfaces/diary/IUserDiary";
+import { IPet } from "../../interfaces/pet/IPet";
+import UserDiary from "../../models/diary/UserDiary";
+require("../../models/user/User")
+require("../../models/book/Book")
+require("../../models/pet/Pet")
+require('../../models/tableContents/TableContents')
+require('../../models/tableContents/SecondPartTableContent')
+const dateMethod = require('../../modules/dateMethod')
+
+export class SecondPartDiaryResDto {
+ public secondPartDiary = {
+ _id: null,
+ episode: null,
+ title: null,
+ diaryImg: [],
+ date: null,
+ contents: null,
+ feelingList: []
+ }
+
+ constructor(userDiary: IUserDiary) {
+ this.init(userDiary)
+ }
+ async init(userDiary: IUserDiary) {
+ this.secondPartDiary._id = userDiary._id
+ this.secondPartDiary.title = userDiary.title
+ this.secondPartDiary.diaryImg = userDiary.imgs
+ this.secondPartDiary.date = await dateMethod.toKoreanByFormatting(userDiary.date)
+ this.secondPartDiary.episode = userDiary.episode
+ this.secondPartDiary.contents = userDiary.contents
+ this.secondPartDiary.feelingList[0]={
+ kind:0,
+ petImgs:null,
+ feeling:userDiary.feeling
+ }
+ }
+}
+export { }
\ No newline at end of file
diff --git a/src/dto/secondPart/SecondPartMainPageResDto.ts b/src/dto/secondPart/SecondPartMainPageResDto.ts
new file mode 100644
index 0000000..51ab956
--- /dev/null
+++ b/src/dto/secondPart/SecondPartMainPageResDto.ts
@@ -0,0 +1,91 @@
+import { IBook } from "../../interfaces/book/IBook"
+import { IUserDiary } from "../../interfaces/diary/IUserDiary"
+import { IPet } from "../../interfaces/pet/IPet"
+import { ISecondPartTableContents } from "../../interfaces/tableContents/ISecondPartTableContents"
+import { IUser } from "../../interfaces/user/IUser"
+import SecondPartTableContent from "../../models/tableContents/SecondPartTableContent"
+require('../../models/tableContents/SecondPartTableContent')
+const dateMethod = require('../../modules/dateMethod')
+
+export class SecondPartMainPageResDto{
+ public secondPartMainPage={
+ //private author = null,
+ title:null,
+ bookImg : null,
+ diary : null,
+ tableContents: [],
+ firstPartBook : null,
+ nextEpisode : null
+}
+ constructor(user : IUser, sortUserDiary : IUserDiary){
+ //this.author = user.book.author
+ this.secondPartMainPage.bookImg = user.book.imgs
+ this.secondPartMainPage.title=user.book.title
+ this.secondPartMainPage.tableContents = user.book.tableContents.secondPartTableContents.map(secondPartTableContents=>
+ new SecondPartMainPageTableContents(secondPartTableContents))
+ this.secondPartMainPage.firstPartBook = new SecondPartMainPageFirstPartBook(user.book)
+ this.setNextEpisode(sortUserDiary)
+ }
+ setDiary(diary: SecondPartMainPageDiary){
+ console.log('2222222 :',diary)
+ this.secondPartMainPage.diary=diary
+ }
+ setNextEpisode(sortUserDiary:IUserDiary){
+ this.secondPartMainPage.nextEpisode = sortUserDiary.episode+1
+ }
+}
+
+export class SecondPartMainPageDiary{
+ private episode = null
+ private title = null
+ private contents = null
+ private date = null
+ private _id=null
+ private chapter=null
+
+ constructor(chapter:Number,sortUserDiary : IUserDiary){
+ //console.log("!!!!!",sortUserDiary)
+ this.init(chapter,sortUserDiary)
+ }
+
+ async init(chapter:Number,sortUserDiary){
+ this._id=sortUserDiary._id
+ this.episode = sortUserDiary.episode
+ this.title = sortUserDiary.title
+ this.contents = sortUserDiary.contents
+ this.chapter=chapter
+ this.date = await dateMethod.toStringByFormatting(sortUserDiary.date)
+ }
+}
+
+export class SecondPartMainPageTableContents{
+ private chapter = null
+ private chapterTitle = null
+ private episodePerChapterCount = null
+ private chapterId = null
+
+ constructor(secondPartTableContents : ISecondPartTableContents){
+ this.chapter = secondPartTableContents.chapter
+ this.chapterTitle = secondPartTableContents.title
+ this.chapterId = secondPartTableContents._id
+ this.episodePerChapterCount = secondPartTableContents.userDiary.length
+ }
+}
+
+export class SecondPartMainPageFirstPartBook{
+ private userId = null
+ private bookImg = null
+ private author = null
+ private date = null
+
+ constructor(book : IBook){
+ this.init(book)
+ }
+
+ async init(book:IBook){
+ this.userId = book._id
+ this.bookImg = book.imgs
+ this.author = book.author
+ this.date = await dateMethod.toStringByFormatting(book.date)
+ }
+}
\ No newline at end of file
diff --git a/src/index.ts b/src/index.ts
index f7ef43d..f848ca0 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -9,7 +9,6 @@ app.use(express.json());
// Define Routes
app.use('/api',require('./api/router/index'))
-
// error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
@@ -32,4 +31,4 @@ app
.on("error", (err) => {
console.error(err);
process.exit(1);
- });
+ });
\ No newline at end of file
diff --git a/src/interfaces/book/IBook.ts b/src/interfaces/book/IBook.ts
index bd3fa59..fc9cd4d 100644
--- a/src/interfaces/book/IBook.ts
+++ b/src/interfaces/book/IBook.ts
@@ -7,10 +7,11 @@ export interface IBook extends Document {
author: String;
imgs: String;
tableContents: ITableContents;
+ date : Date
}
export interface IBookDocument extends IBook {
- setTableContents : (tableContents : ITableContents) => Promise
+ setTableContents: (tableContents: ITableContents) => Promise
}
export interface IBookModel extends Model {
diff --git a/src/interfaces/diary/IPetDiary.ts b/src/interfaces/diary/IPetDiary.ts
index 4e0cfdb..b809a9d 100644
--- a/src/interfaces/diary/IPetDiary.ts
+++ b/src/interfaces/diary/IPetDiary.ts
@@ -12,13 +12,13 @@ export interface IPetDiary extends Document{
contents : String;
imgs : Array;
petEmotions : Array;
- episode : Number;
+ episode : number;
date : Date;
}
export interface IPetDiaryDocument extends IPetDiary{
setPet : (pet : IPet) => Promise
- setTableContents : (tableContents : ITableContents) => Promise
+ setTableContents : (tableContents : IFirstPartTableContents) => Promise
setPetEmotions : (petEmotions : IPetEmotions) => Promise
}
diff --git a/src/interfaces/diary/IUserDiary.ts b/src/interfaces/diary/IUserDiary.ts
index 0119515..1beba72 100644
--- a/src/interfaces/diary/IUserDiary.ts
+++ b/src/interfaces/diary/IUserDiary.ts
@@ -8,6 +8,7 @@ export interface IUserDiary extends Document{
imgs : Array;
feeling : Number;
tableContents : ISecondPartTableContents;
+ episode : number
date : Date;
}
diff --git a/src/interfaces/pet/IPet.ts b/src/interfaces/pet/IPet.ts
index 7a429f8..ea11e0b 100644
--- a/src/interfaces/pet/IPet.ts
+++ b/src/interfaces/pet/IPet.ts
@@ -3,7 +3,7 @@ import { IUser } from "../user/IUser"
import { IBook } from "../book/IBook"
export interface IPet extends Document {
- _id: mongoose.Types.ObjectId;
+ _id?: mongoose.Types.ObjectId;
name: String;
kind: Number;
gender: Number;
diff --git a/src/interfaces/tableContents/ISecondPartTableContents.ts b/src/interfaces/tableContents/ISecondPartTableContents.ts
index 2ab3aef..40589c9 100644
--- a/src/interfaces/tableContents/ISecondPartTableContents.ts
+++ b/src/interfaces/tableContents/ISecondPartTableContents.ts
@@ -3,8 +3,9 @@ import {IUserDiary} from "../diary/IUserDiary"
export interface ISecondPartTableContents extends Document{
_id : mongoose.Types.ObjectId;
- chapter : Number;
+ chapter : number;
title : String;
+ contents : String;
userDiary : Array;
}
diff --git a/src/models/book/Book.ts b/src/models/book/Book.ts
index f96288b..1cbd06e 100644
--- a/src/models/book/Book.ts
+++ b/src/models/book/Book.ts
@@ -5,15 +5,18 @@ import { ITableContents } from "../../interfaces/tableContents/ITableContents"
const BookSchema: Schema = new mongoose.Schema({
title: { type: String },
author: { type: String },
- img: { type: String },
+ imgs: { type: String },
tableContents: {
type: mongoose.SchemaTypes.ObjectId,
ref: "TableContents"
+ },
+ date : {
+ type : Date,
+ default : Date.now()
}
})
-
-BookSchema.methods.setTableContents = async function (tableContents: ITableContents) {
- this.tableContents = tableContents
+BookSchema.methods.setTableContents=async function(tableContents: ITableContents){
+ this.tableContents=tableContents
}
export default mongoose.model("Book", BookSchema, "books")
\ No newline at end of file
diff --git a/src/models/diary/PetDiary.ts b/src/models/diary/PetDiary.ts
index 1a063db..99d2b59 100644
--- a/src/models/diary/PetDiary.ts
+++ b/src/models/diary/PetDiary.ts
@@ -15,17 +15,23 @@ const PetDiarySchema : Schema= new mongoose.Schema({
type : mongoose.SchemaTypes.ObjectId,
ref: "FirstPartTableContents"
},
- title : {type : String},
- contents : {type : String},
+ title : {
+ type : String
+ },
+ contents : {
+ type : String
+ },
imgs : [
{
type : String,
+ default : []
}
],
petEmotions : [
{
type : mongoose.SchemaTypes.ObjectId,
- ref : "PetEmotions"
+ ref : "PetEmotions",
+ default : []
}
],
episode : {
@@ -50,4 +56,6 @@ PetDiarySchema.methods.setPetEmotions = async function(petEmotions : IPetEmotion
this.petEmotions.push(petEmotions)
}
+
+
export default mongoose.model("PetDiary", PetDiarySchema, "petDiaries")
\ No newline at end of file
diff --git a/src/models/diary/PetEmotions.ts b/src/models/diary/PetEmotions.ts
index 6942d81..008e5d6 100644
--- a/src/models/diary/PetEmotions.ts
+++ b/src/models/diary/PetEmotions.ts
@@ -11,7 +11,10 @@ const PetEmotionsSchema: Schema = new mongoose.Schema({
type: mongoose.SchemaTypes.ObjectId,
ref: "Pet"
},
- feeling: { type: Number }
+ feeling: {
+ type: Number,
+ default : 0
+ }
})
PetEmotionsSchema.methods.setPetDiary = async function (petDiary: IPetDiary) {
diff --git a/src/models/diary/UserDiary.ts b/src/models/diary/UserDiary.ts
index b1aa164..05a35e1 100644
--- a/src/models/diary/UserDiary.ts
+++ b/src/models/diary/UserDiary.ts
@@ -7,7 +7,8 @@ const UserDiarySchema : Schema = new mongoose.Schema({
contents : {type : String},
imgs : [
{
- type : String
+ type : String,
+ default : []
}
],
feeling : {type : Number},
@@ -15,6 +16,10 @@ const UserDiarySchema : Schema = new mongoose.Schema({
type : mongoose.SchemaTypes.ObjectId,
ref : "SecondPartTableContents"
},
+ episode : {
+ type : Number,
+ default : 0
+ },
date : {
type : Date,
default : Date.now()
diff --git a/src/models/pet/Pet.ts b/src/models/pet/Pet.ts
index 2c9703b..f24a3f0 100644
--- a/src/models/pet/Pet.ts
+++ b/src/models/pet/Pet.ts
@@ -17,7 +17,10 @@ const PetSchema: Schema = new mongoose.Schema({
type: mongoose.SchemaTypes.ObjectId,
ref: "Book:"
},
- rainbow: { type: Boolean },
+ rainbow: {
+ type: Boolean,
+ default: false
+ },
startDate: {
type: Date,
default: Date.now()
diff --git a/src/models/tableContents/FirstPartTableContents.ts b/src/models/tableContents/FirstPartTableContents.ts
index 6d68248..ed7084b 100644
--- a/src/models/tableContents/FirstPartTableContents.ts
+++ b/src/models/tableContents/FirstPartTableContents.ts
@@ -4,7 +4,8 @@ import { IPetDiary } from "../../interfaces/diary/IPetDiary"
const FirstPartTableContentsSchema: Schema = new mongoose.Schema({
chapter: {
- type: Number
+ type: Number,
+ default : 0
},
title: {
type: String
@@ -16,7 +17,8 @@ const FirstPartTableContentsSchema: Schema = ne
petDiary: [
{
type: mongoose.SchemaTypes.ObjectId,
- ref: "PetDiary"
+ ref: "PetDiary",
+ default : []
}
]
})
diff --git a/src/models/tableContents/SecondPartTableContent.ts b/src/models/tableContents/SecondPartTableContent.ts
index 7f533f8..7f8ce54 100644
--- a/src/models/tableContents/SecondPartTableContent.ts
+++ b/src/models/tableContents/SecondPartTableContent.ts
@@ -3,12 +3,23 @@ import { IUserDiary } from "../../interfaces/diary/IUserDiary"
import { ISecondPartTableContentsDocument, ISecondPartTableContentsModel } from "../../interfaces/tableContents/ISecondPartTableContents"
const SecondPartTableContentsSchema: Schema = new mongoose.Schema({
- chapter: { type: Number },
- title: { type: String },
+ chapter: {
+ type: Number,
+ default : 0
+ },
+ title: {
+ type: String,
+ default : null
+ },
+ contents : {
+ type : String,
+ default : null
+ },
userDiary: [
{
type: mongoose.SchemaTypes.ObjectId,
- ref: "UserDiary"
+ ref: "UserDiary",
+ default: []
}
]
})
diff --git a/src/models/tableContents/TableContents.ts b/src/models/tableContents/TableContents.ts
index c837fbc..a5974af 100644
--- a/src/models/tableContents/TableContents.ts
+++ b/src/models/tableContents/TableContents.ts
@@ -7,13 +7,15 @@ const TableContentsSchema: Schema = new mongoose.Schema(
firstPartTableContents: [
{
type: mongoose.SchemaTypes.ObjectId,
- ref: "FirstPartTableContents"
+ ref: "FirstPartTableContents",
+ default:[]
}
],
secondPartTableContents: [
{
type: mongoose.SchemaTypes.ObjectId,
- ref: "SecondPartTableContents"
+ ref: "SecondPartTableContents",
+ default:[]
}
],
secondPartStartDate : {
diff --git a/src/models/user/User.ts b/src/models/user/User.ts
index b4da057..816ada8 100644
--- a/src/models/user/User.ts
+++ b/src/models/user/User.ts
@@ -9,12 +9,12 @@ const UserSchema: Schema = new mongoose.Schema({
pets: [
{
type: mongoose.SchemaTypes.ObjectId,
- ref: "Pet"
+ ref: "Pet",
}
],
book: {
type: mongoose.SchemaTypes.ObjectId,
- ref: "Book"
+ ref: "Book",
},
feelingCount: { type: Number }
})
diff --git a/src/modules/comment.ts b/src/modules/comment.ts
new file mode 100644
index 0000000..bb3c18e
--- /dev/null
+++ b/src/modules/comment.ts
@@ -0,0 +1,21 @@
+module.exports = {
+ loveFeeling: async (name: string) => {
+ return `작가님과 함께하면서 ${name}(이)는 많은 사랑을 받았고, 또 주었어요.
+ ${name}(이)가 사랑을 느꼈던 순간들이예요. ${name}(이)에게 사랑을 알려주셔서 감사합니다.`
+ },
+ happyFeeling: async (name: string) => {
+ return `맛있는 간식을 먹거나 재미있는 놀이를 할 때, 작가님은 ${name}(이)를 행복하게 해주려고 매순간 노력했어요. 이런 작가님과 함께한 매일매일이 ${name}(이)에겐 기쁜 순간이었습니다. `
+ },
+ normalFeeling: async () => {
+ return `매일 색다른 모험을 하지 않아도 좋아요. 평화롭던 보통의 날들도 아름다운 추억으로 여기 남아 있습니다.`
+ },
+ angryFeeling: async (name: string) => {
+ return `평화롭고 행복한 날들만이 의미있는 것은 아니죠. 때로는 화도 냈고, 투정도 부렸어요. 그 과정에서 ${name}(이)는 다양한 감정을 배우는 어른 고양이로 성장할 수 있었습니다.`
+ },
+ gloomyFeeling: async () => {
+ return `때로는 어두운 그늘에 있던 때도 있었지만, 그 덕분에 강한 햇볕을 피해 감정의 휴식을 취할 수 있었어요.`
+ },
+ boringFeeling: async () => {
+ return `매일 즐겁지는 않았지만, 그 덕에 고민 걱정 없는 심심한 날들을 보낼 수도 있었어요. 평화로운 나날들을 선물해주셔서 감사합니다.`
+ }
+}
\ No newline at end of file
diff --git a/src/modules/dateMethod.ts b/src/modules/dateMethod.ts
new file mode 100644
index 0000000..89b5368
--- /dev/null
+++ b/src/modules/dateMethod.ts
@@ -0,0 +1,50 @@
+module.exports = {
+ toStringByFormatting : async(source) => {
+ const year = source.getFullYear()
+ const month = leftPad(source.getMonth() + 1);
+ const day = leftPad(source.getDate())
+
+ return [year, month, day].join('.')
+
+ function leftPad(value){
+ if(value >= 10){
+ return value
+ }
+ return `0${value}`
+ }
+ },
+ toKoreanByFormatting : async(source) => {
+ const year = source.getFullYear()
+ const month = leftPad(source.getMonth() + 1);
+ const day = leftPad(source.getDate())
+
+ return year+"년 "+month+"월 "+day+"일"
+
+ function leftPad(value){
+ if(value >= 10){
+ return value
+ }
+ return `0${value}`
+ }
+ },
+
+ getElapsedDay : async(startDate : Date) => {
+ const now = new Date()
+ const year = now.getFullYear()
+ const month = now.getMonth()
+ const day = now.getDate()
+
+ startDate = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate())
+ const endDate = new Date(year,month,day)
+
+ const elapsedMs = endDate.getTime() - startDate.getTime()
+ const elapsedDay = elapsedMs / (1000*60*60*24)
+
+ return elapsedDay
+ },
+
+ getLastDateOfMonth : async(year, month)=>{
+ const lastDate = new Date(year,month,0)
+ return lastDate.getDate()
+ }
+}
\ No newline at end of file
diff --git a/src/modules/multer.ts b/src/modules/multer.ts
new file mode 100644
index 0000000..f44d2f4
--- /dev/null
+++ b/src/modules/multer.ts
@@ -0,0 +1,18 @@
+const multer = require('multer')
+const multerS3 = require('multer-s3')
+const aws = require('aws-sdk')
+aws.config.loadFromPath(__dirname+'/../config/s3.json')
+
+const s3 = new aws.S3();
+var upload = multer({
+ storage : multerS3({
+ s3,
+ bucket : 'watcha',
+ acl : 'public-read',
+ key:function(req,file,cb){
+ cb(null, 'images/origin/'+Date.now()+'.'+file.originalname.split('.').pop())
+ }
+ })
+})
+
+module.exports=upload
\ No newline at end of file
diff --git a/src/modules/responseMessage.ts b/src/modules/responseMessage.ts
index d310694..1629ad5 100644
--- a/src/modules/responseMessage.ts
+++ b/src/modules/responseMessage.ts
@@ -6,15 +6,66 @@ module.exports = {
/* 회원가입 */
SIGN_UP_SUCCESS: "회원가입성공",
SIGN_UP_FAIL: "회원 가입 실패",
+ ALREADY_ID: "존재하는 ID 입니다.",
+ EMPTY_ID: "이메일을 입력해주세요",
+ WRONG_FORM:"유효하지 않은 형식입니다.",
+
+ /* 로그인 */
SIGN_IN_SUCCESS: "로그인 성공",
SIGN_IN_FAIL: "로그인 실패",
- ALREADY_ID: "존재하는 ID 입니다.",
NO_USER: "존재하지않는 유저 id 입니다.",
MISS_MATCH_PW: "비밀번호가 일치하지 않습니다",
MISS_MATCH: "아이디나 비밀번호가 일치하지 않습니다.",
+ /*1부(by.sol) */
+ NO_BOOK:"존재하지 않는 책 id입니다.",
+ NO_DIARY:"존재하지 않는 다이어리 id입니다.",
+ NO_CONTENTS:"존재하지 않는 정보입니다.",
+ SUCCESS_GET_PET_INFO : "반려동물 정보 리스트 불러오기 성공",
+ SUCCESS_POST_PETDIARY:"반려동물 다이어리 작성 성공",
+ SUCCESS_EDIT_PETDIARY:"반려동물 다이어리 수정 성공",
+ SUCCESS_DELETE_PETDIARY:"반려동물 다이어리 삭제 성공",
+ SUCCESS_GET_CHAPTER_PETDIARY:"목차별 다이어리 조회 성공",
+ SUCCESS_GET_CHAPTERLIST: "목차 리스트 조회 성공",
+ SUCCESS_POST_CHAPTERLIST: "목차 리스트 추가 성공",
+ SUCCESS_EDIT_CHAPTERLIST: "목차 리스트 수정 성공",
+ SUCCESS_DELETE_CHAPTERLIST: "목차 리스트 삭제 성공",
+ SUCCESS_REGISTER_PET: "반려동물 등록 성공",
+ SUCCESS_REGISTER_PET_IMG:"반려동물 이미지 등록 성공",
+ SUCCESS_GET_FIRSTPART_MAINPAGE:"1부 메인뷰 불러오기 성공",
+
/** 1.5부 무지개다리 (by 현종) */
SUCCESS_GET_RAINBOW_MAIN_PAGE : "무지개 메인뷰 불러오기 성공",
+ SUCCESS_GET_RAINBOW_PET : "무지개 건넌 동물 불러오기 성공",
+ SUCCESS_GET_PARTING_PET_COMMENT : "이별하는 무지개 다리 멘트 불러오기 성공",
+ SUCCESS_DELETE_PARTING_PET : "반려동물 이별 과정 취소 성공",
+ SUCCESS_GET_READY_PARTING_PET_COMMENT : "이별에 준비하는 작가의 기록 시작 멘트 불러오기 성공",
+ SUCCESS_GET_BEST_MOMENT : "최고의 순간 불러오기 성공",
+ SUCCESS_GET_PARTING_PETNAME : "이별할 동물 이름 가져오기 성공",
+ SUCCESS_POST_EPILOGUE : "1부 끝 작가의말 - 에필로그 작성 성공",
+ SUCCESS_GET_RAINBOW_SUB_PAGE : "무지개 서브뷰 불러오기 성공",
+
+ /**캘린더 */
+ SUCCESS_GET_MONTH_CALENDAR : "해당 월의 캘린더 가져오기 성공",
+ SUCCESS_GET_YEAR_CALENDAR : "해당 년의 캘린더 가져오기 성공",
+
+ /**2부 */
+ SUCCESS_GET_SECOND_PART_MAIN_PAGE : "2부 메인페이지 불러오기 성공",
+ SUCCESS_GET_SECOND_PART_DIARY_OF_TABLECONTENTS : "2부 목차별 일기 불러오기 성공",
+ SUCCESS_GET_SECOND_PART_CHAPTER_LIST : "2부 목차 리스트 불러오기 성공",
+ SUCCESS_POST_SECOND_PART_ADD_CHAPTER : "2부 목차 추가 성공",
+ SUCCESS_PUT_SECOND_PART_MODIFY_CHAPTER: "2부 목차 수정 성공",
+ SUCCESS_DELETE_SECOND_PART_DELETE_CHAPTER : "2부 목차 삭제 성공",
+ FAIL_TO_GET_SECOND_PART_TABLE_CONTENTS : "잘못된 2부 목차의 ID입니다.",
+ SUCCESS_GET_SECOND_PART_DIARY:"2부 일기 불러오기 성공",
+ FAIL_TO_GET_SECOND_PART_DIARY_ID:"잘못된 2부 일기의 ID입니다.",
+ SUCCESS_POST_SECOND_PART_DIARY:"2부 일기 작성 성공",
+ FAIL_TO_POST_SECOND_PART_DIARY:"2부 일기 작성 실패",
+ SUCCESS_PUT_SECOND_PART_DIARY:"2부 일기 수정 성공",
+ FAIL_TO_PUT_SECOND_PART_DIARY:"2부 일기 수정 실패",
+ SUCCESS_DELETE_SECOND_PART_DELETE_DIARY:"2부 일기 삭제 성공",
+ FAIL_TO_DELETE_SECOND_PART_DIARY:"2부 일기 삭제 실패",
+
/* 서버에러 */
INTERNAL_SERVER_ERROR: "서버 내부 오류",
diff --git a/src/modules/swagger.ts b/src/modules/swagger.ts
new file mode 100644
index 0000000..e69de29
diff --git a/tsconfig.json b/tsconfig.json
index def7395..e6b0bd3 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -14,7 +14,8 @@
"allowJs": true,
"noEmit": false,
"esModuleInterop": true,
- "typeRoots": ["./src/types/express.d.ts", "./node_modules/@types"]
+ "typeRoots": ["./src/types/express.d.ts", "./node_modules/@types"],
+ "lib":["es6"]
},
"include": ["./src/**/*"],
"exclude": ["node_modules", "tests"]
diff --git a/yarn-error.log b/yarn-error.log
index 60986f8..69ef208 100644
--- a/yarn-error.log
+++ b/yarn-error.log
@@ -14,7 +14,7 @@ Platform:
win32 x64
Trace:
- SyntaxError: C:\Users\leehyunjong\Desktop\마스코타\mascota_server\package.json: Unexpected token } in JSON at position 171
+ SyntaxError: C:\Users\leehyunjong\Desktop\마스코타\mascota_server\package.json: Unexpected token < in JSON at position 495
at JSON.parse ()
at C:\Users\leehyunjong\AppData\Roaming\npm\node_modules\yarn\lib\cli.js:1625:59
at Generator.next ()
@@ -28,8 +28,9 @@ npm manifest:
"description": "",
"main": "index.js",
"scripts": {
- "dev": "ts-node src",
+ "dev": "nodemon -r ts-node src/index.ts",
"build": "tsc && node dist",
+ "test": "nodemon"
},
"author": "",
"license": "ISC",
@@ -43,7 +44,13 @@ npm manifest:
"bcryptjs": "^2.4.3",
"dotenv": "^10.0.0",
"express": "^4.17.1",
- "mongoose": "^5.13.0"
+ <<<<<<< HEAD
+ "express-validator": "^6.12.0",
+ =======
+ "global": "^4.4.0",
+ >>>>>>> fba3bfcb9d9c10ba0b5c4e76ec22b9dc603ecc92
+ "mongoose": "^5.13.0",
+ "nodemon": "^2.0.12"
}
}
@@ -55,6 +62,18 @@ Lockfile:
# yarn lockfile v1
+ "@sindresorhus/is@^0.14.0":
+ version "0.14.0"
+ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
+ integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
+
+ "@szmarczak/http-timer@^1.1.2":
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
+ integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==
+ dependencies:
+ defer-to-connect "^1.0.1"
+
"@tsconfig/node10@^1.0.7":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
@@ -152,6 +171,11 @@ Lockfile:
"@types/mime" "^1"
"@types/node" "*"
+ abbrev@1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
+ integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+
accepts@~1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
@@ -160,6 +184,38 @@ Lockfile:
mime-types "~2.1.24"
negotiator "0.6.2"
+ ansi-align@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb"
+ integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==
+ dependencies:
+ string-width "^3.0.0"
+
+ ansi-regex@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+ integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+
+ ansi-regex@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
+ integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
+
+ ansi-styles@^4.1.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
+ integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
+ dependencies:
+ color-convert "^2.0.1"
+
+ anymatch@~3.1.2:
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
+ integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
+ dependencies:
+ normalize-path "^3.0.0"
+ picomatch "^2.0.4"
+
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
@@ -170,11 +226,21 @@ Lockfile:
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
+ balanced-match@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
+
bcryptjs@^2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb"
integrity sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=
+ binary-extensions@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
+ integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
+
bl@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5"
@@ -204,6 +270,35 @@ Lockfile:
raw-body "2.4.0"
type-is "~1.6.17"
+ boxen@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"
+ integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==
+ dependencies:
+ ansi-align "^3.0.0"
+ camelcase "^5.3.1"
+ chalk "^3.0.0"
+ cli-boxes "^2.2.0"
+ string-width "^4.1.0"
+ term-size "^2.1.0"
+ type-fest "^0.8.1"
+ widest-line "^3.1.0"
+
+ brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+ braces@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
+ integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
+ dependencies:
+ fill-range "^7.0.1"
+
bson@^1.1.4:
version "1.1.6"
resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.6.tgz#fb819be9a60cd677e0853aee4ca712a785d6618a"
@@ -219,6 +314,93 @@ Lockfile:
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
+ cacheable-request@^6.0.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912"
+ integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==
+ dependencies:
+ clone-response "^1.0.2"
+ get-stream "^5.1.0"
+ http-cache-semantics "^4.0.0"
+ keyv "^3.0.0"
+ lowercase-keys "^2.0.0"
+ normalize-url "^4.1.0"
+ responselike "^1.0.2"
+
+ camelcase@^5.3.1:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
+
+ chalk@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
+ integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
+ chokidar@^3.2.2:
+ version "3.5.2"
+ resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
+ integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
+ dependencies:
+ anymatch "~3.1.2"
+ braces "~3.0.2"
+ glob-parent "~5.1.2"
+ is-binary-path "~2.1.0"
+ is-glob "~4.0.1"
+ normalize-path "~3.0.0"
+ readdirp "~3.6.0"
+ optionalDependencies:
+ fsevents "~2.3.2"
+
+ ci-info@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
+ integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
+
+ cli-boxes@^2.2.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f"
+ integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==
+
+ clone-response@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
+ integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
+ dependencies:
+ mimic-response "^1.0.0"
+
+ color-convert@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
+ integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
+ dependencies:
+ color-name "~1.1.4"
+
+ color-name@~1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
+ integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+
+ concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
+ configstore@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
+ integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==
+ dependencies:
+ dot-prop "^5.2.0"
+ graceful-fs "^4.1.2"
+ make-dir "^3.0.0"
+ unique-string "^2.0.0"
+ write-file-atomic "^3.0.0"
+ xdg-basedir "^4.0.0"
+
content-disposition@0.5.3:
version "0.5.3"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd"
@@ -251,7 +433,12 @@ Lockfile:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
- debug@2.6.9:
+ crypto-random-string@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
+ integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
+
+ debug@2.6.9, debug@^2.2.0:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
@@ -265,6 +452,30 @@ Lockfile:
dependencies:
ms "2.0.0"
+ debug@^3.2.6:
+ version "3.2.7"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
+ integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
+ dependencies:
+ ms "^2.1.1"
+
+ decompress-response@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
+ integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
+ dependencies:
+ mimic-response "^1.0.0"
+
+ deep-extend@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
+ integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
+
+ defer-to-connect@^1.0.1:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591"
+ integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==
+
denque@^1.4.1:
version "1.5.0"
resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.0.tgz#773de0686ff2d8ec2ff92914316a47b73b1c73de"
@@ -285,21 +496,60 @@ Lockfile:
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
+ dom-walk@^0.1.0:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/dom-walk/-/dom-walk-0.1.2.tgz#0c548bef048f4d1f2a97249002236060daa3fd84"
+ integrity sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==
+
+ dot-prop@^5.2.0:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88"
+ integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==
+ dependencies:
+ is-obj "^2.0.0"
+
dotenv@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
+ duplexer3@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
+ integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
+
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
+ emoji-regex@^7.0.1:
+ version "7.0.3"
+ resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
+ integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
+
+ emoji-regex@^8.0.0:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
+ integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
+
encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
+ end-of-stream@^1.1.0:
+ version "1.4.4"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
+ integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
+ dependencies:
+ once "^1.4.0"
+
+ escape-goat@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675"
+ integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==
+
escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
@@ -310,6 +560,14 @@ Lockfile:
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
+ express-validator@^6.12.0:
+ version "6.12.0"
+ resolved "https://registry.yarnpkg.com/express-validator/-/express-validator-6.12.0.tgz#a9cd49b3fe4c470abb615ae2e7dd111053c25f66"
+ integrity sha512-lcQAdVeAO+pBbHD33nIsDsd+QPakLX08tJ82iEsXj6ezyWCfYjE9RY/g9SVq5z4G0NaIkH8039Oe4r0G92DRyA==
+ dependencies:
+ lodash "^4.17.21"
+ validator "^13.5.2"
+
express@^4.17.1:
version "4.17.1"
resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"
@@ -346,6 +604,13 @@ Lockfile:
utils-merge "1.0.1"
vary "~1.1.2"
+ fill-range@^7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
+ integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
+ dependencies:
+ to-regex-range "^5.0.1"
+
finalhandler@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d"
@@ -369,6 +634,89 @@ Lockfile:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
+ fsevents@~2.3.2:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
+ integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
+
+ get-stream@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
+ dependencies:
+ pump "^3.0.0"
+
+ get-stream@^5.1.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3"
+ integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==
+ dependencies:
+ pump "^3.0.0"
+
+ glob-parent@~5.1.2:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
+ integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
+ dependencies:
+ is-glob "^4.0.1"
+
+ global-dirs@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d"
+ integrity sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==
+ dependencies:
+ ini "1.3.7"
+
+ global@^4.4.0:
+ version "4.4.0"
+ resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406"
+ integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w==
+ dependencies:
+ min-document "^2.19.0"
+ process "^0.11.10"
+
+ got@^9.6.0:
+ version "9.6.0"
+ resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
+ integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==
+ dependencies:
+ "@sindresorhus/is" "^0.14.0"
+ "@szmarczak/http-timer" "^1.1.2"
+ cacheable-request "^6.0.0"
+ decompress-response "^3.3.0"
+ duplexer3 "^0.1.4"
+ get-stream "^4.1.0"
+ lowercase-keys "^1.0.1"
+ mimic-response "^1.0.1"
+ p-cancelable "^1.0.0"
+ to-readable-stream "^1.0.0"
+ url-parse-lax "^3.0.0"
+
+ graceful-fs@^4.1.2:
+ version "4.2.6"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
+ integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
+
+ has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+
+ has-flag@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+ integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
+
+ has-yarn@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77"
+ integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==
+
+ http-cache-semantics@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
+ integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
+
http-errors@1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f"
@@ -398,6 +746,21 @@ Lockfile:
dependencies:
safer-buffer ">= 2.1.2 < 3"
+ ignore-by-default@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
+ integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk=
+
+ import-lazy@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
+ integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
+
+ imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
inherits@2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
@@ -408,21 +771,146 @@ Lockfile:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
+ ini@1.3.7:
+ version "1.3.7"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84"
+ integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==
+
+ ini@~1.3.0:
+ version "1.3.8"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
+ integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
+
ipaddr.js@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
+ is-binary-path@~2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
+ integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
+ dependencies:
+ binary-extensions "^2.0.0"
+
+ is-ci@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
+ integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
+ dependencies:
+ ci-info "^2.0.0"
+
+ is-extglob@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
+ integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
+
+ is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+ integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
+
+ is-fullwidth-code-point@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
+ integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
+
+ is-glob@^4.0.1, is-glob@~4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
+ integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
+ dependencies:
+ is-extglob "^2.1.1"
+
+ is-installed-globally@^0.3.1:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141"
+ integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==
+ dependencies:
+ global-dirs "^2.0.1"
+ is-path-inside "^3.0.1"
+
+ is-npm@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d"
+ integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==
+
+ is-number@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
+ integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
+
+ is-obj@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
+ integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==
+
+ is-path-inside@^3.0.1:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
+ integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
+
+ is-typedarray@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
+ integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
+
+ is-yarn-global@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232"
+ integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==
+
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+ json-buffer@3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
+ integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
+
kareem@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.2.tgz#78c4508894985b8d38a0dc15e1a8e11078f2ca93"
integrity sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==
+ keyv@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
+ integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==
+ dependencies:
+ json-buffer "3.0.0"
+
+ latest-version@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
+ integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==
+ dependencies:
+ package-json "^6.3.0"
+
+ lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
+ integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==
+
+ lowercase-keys@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
+ integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
+
+ make-dir@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
+ integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
+ dependencies:
+ semver "^6.0.0"
+
+ lodash@^4.17.21:
+ version "4.17.21"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
+ integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
+
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
@@ -465,6 +953,30 @@ Lockfile:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
+ mimic-response@^1.0.0, mimic-response@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
+ integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
+
+ min-document@^2.19.0:
+ version "2.19.0"
+ resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
+ integrity sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=
+ dependencies:
+ dom-walk "^0.1.0"
+
+ minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+ minimist@^1.2.0:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
+ integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
+
mongodb@3.6.8:
version "3.6.8"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.8.tgz#3e2632af81915b3ff99b7681121ca0895e8ed407"
@@ -532,11 +1044,49 @@ Lockfile:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+ ms@^2.1.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
+ integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
+
negotiator@0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
+ nodemon@^2.0.12:
+ version "2.0.12"
+ resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.12.tgz#5dae4e162b617b91f1873b3bfea215dd71e144d5"
+ integrity sha512-egCTmNZdObdBxUBw6ZNwvZ/xzk24CKRs5K6d+5zbmrMr7rOpPmfPeF6OxM3DDpaRx331CQRFEktn+wrFFfBSOA==
+ dependencies:
+ chokidar "^3.2.2"
+ debug "^3.2.6"
+ ignore-by-default "^1.0.1"
+ minimatch "^3.0.4"
+ pstree.remy "^1.1.7"
+ semver "^5.7.1"
+ supports-color "^5.5.0"
+ touch "^3.1.0"
+ undefsafe "^2.0.3"
+ update-notifier "^4.1.0"
+
+ nopt@~1.0.10:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
+ integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=
+ dependencies:
+ abbrev "1"
+
+ normalize-path@^3.0.0, normalize-path@~3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
+ integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
+
+ normalize-url@^4.1.0:
+ version "4.5.1"
+ resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
+ integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
+
on-finished@~2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
@@ -544,11 +1094,33 @@ Lockfile:
dependencies:
ee-first "1.1.1"
+ once@^1.3.1, once@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
optional-require@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/optional-require/-/optional-require-1.0.3.tgz#275b8e9df1dc6a17ad155369c2422a440f89cb07"
integrity sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==
+ p-cancelable@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
+ integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==
+
+ package-json@^6.3.0:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0"
+ integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==
+ dependencies:
+ got "^9.6.0"
+ registry-auth-token "^4.0.0"
+ registry-url "^5.0.0"
+ semver "^6.2.0"
+
parseurl@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
@@ -559,11 +1131,26 @@ Lockfile:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
+ picomatch@^2.0.4, picomatch@^2.2.1:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
+ integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
+
+ prepend-http@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
+ integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
+
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
+ process@^0.11.10:
+ version "0.11.10"
+ resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182"
+ integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI=
+
proxy-addr@~2.0.5:
version "2.0.7"
resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025"
@@ -572,6 +1159,26 @@ Lockfile:
forwarded "0.2.0"
ipaddr.js "1.9.1"
+ pstree.remy@^1.1.7:
+ version "1.1.8"
+ resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a"
+ integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==
+
+ pump@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
+ integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.1"
+
+ pupa@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62"
+ integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==
+ dependencies:
+ escape-goat "^2.0.0"
+
qs@6.7.0:
version "6.7.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
@@ -592,6 +1199,16 @@ Lockfile:
iconv-lite "0.4.24"
unpipe "1.0.0"
+ rc@^1.2.8:
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
+ integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
+ dependencies:
+ deep-extend "^0.6.0"
+ ini "~1.3.0"
+ minimist "^1.2.0"
+ strip-json-comments "~2.0.1"
+
readable-stream@^2.3.5:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
@@ -605,11 +1222,39 @@ Lockfile:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
+ readdirp@~3.6.0:
+ version "3.6.0"
+ resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
+ integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
+ dependencies:
+ picomatch "^2.2.1"
+
regexp-clone@1.0.0, regexp-clone@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63"
integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==
+ registry-auth-token@^4.0.0:
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250"
+ integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==
+ dependencies:
+ rc "^1.2.8"
+
+ registry-url@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009"
+ integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==
+ dependencies:
+ rc "^1.2.8"
+
+ responselike@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
+ integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=
+ dependencies:
+ lowercase-keys "^1.0.0"
+
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@@ -632,6 +1277,23 @@ Lockfile:
dependencies:
sparse-bitfield "^3.0.3"
+ semver-diff@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b"
+ integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==
+ dependencies:
+ semver "^6.3.0"
+
+ semver@^5.7.1:
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
+ integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
+
+ semver@^6.0.0, semver@^6.2.0, semver@^6.3.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
+ integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
+
send@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
@@ -671,6 +1333,11 @@ Lockfile:
resolved "https://registry.yarnpkg.com/sift/-/sift-13.5.2.tgz#24a715e13c617b086166cd04917d204a591c9da6"
integrity sha512-+gxdEOMA2J+AI+fVsCqeNn7Tgx3M9ZN9jdi95939l1IJ8cZsqS8sqpJyOkic2SJk+1+98Uwryt/gL6XDaV+UZA==
+ signal-exit@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
+ integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
+
sliced@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41"
@@ -701,6 +1368,24 @@ Lockfile:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
+ string-width@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
+ integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
+ dependencies:
+ emoji-regex "^7.0.1"
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^5.1.0"
+
+ string-width@^4.0.0, string-width@^4.1.0:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
+ integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==
+ dependencies:
+ emoji-regex "^8.0.0"
+ is-fullwidth-code-point "^3.0.0"
+ strip-ansi "^6.0.0"
+
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
@@ -708,11 +1393,68 @@ Lockfile:
dependencies:
safe-buffer "~5.1.0"
+ strip-ansi@^5.1.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+ integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
+ dependencies:
+ ansi-regex "^4.1.0"
+
+ strip-ansi@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
+ integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
+ dependencies:
+ ansi-regex "^5.0.0"
+
+ strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+ integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
+ supports-color@^5.5.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
+ dependencies:
+ has-flag "^3.0.0"
+
+ supports-color@^7.1.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+ integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
+ dependencies:
+ has-flag "^4.0.0"
+
+ term-size@^2.1.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54"
+ integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==
+
+ to-readable-stream@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
+ integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==
+
+ to-regex-range@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
+ integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
+ dependencies:
+ is-number "^7.0.0"
+
toidentifier@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
+ touch@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
+ integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==
+ dependencies:
+ nopt "~1.0.10"
+
ts-node@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.0.0.tgz#05f10b9a716b0b624129ad44f0ea05dac84ba3be"
@@ -729,6 +1471,11 @@ Lockfile:
source-map-support "^0.5.17"
yn "3.1.1"
+ type-fest@^0.8.1:
+ version "0.8.1"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
+ integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
+
type-is@~1.6.17, type-is@~1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
@@ -737,16 +1484,63 @@ Lockfile:
media-typer "0.3.0"
mime-types "~2.1.24"
+ typedarray-to-buffer@^3.1.5:
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
+ integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==
+ dependencies:
+ is-typedarray "^1.0.0"
+
typescript@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc"
integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==
+ undefsafe@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae"
+ integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==
+ dependencies:
+ debug "^2.2.0"
+
+ unique-string@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d"
+ integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==
+ dependencies:
+ crypto-random-string "^2.0.0"
+
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
+ update-notifier@^4.1.0:
+ version "4.1.3"
+ resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3"
+ integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==
+ dependencies:
+ boxen "^4.2.0"
+ chalk "^3.0.0"
+ configstore "^5.0.1"
+ has-yarn "^2.1.0"
+ import-lazy "^2.1.0"
+ is-ci "^2.0.0"
+ is-installed-globally "^0.3.1"
+ is-npm "^4.0.0"
+ is-yarn-global "^0.3.0"
+ latest-version "^5.0.0"
+ pupa "^2.0.1"
+ semver-diff "^3.1.1"
+ xdg-basedir "^4.0.0"
+
+ url-parse-lax@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
+ integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=
+ dependencies:
+ prepend-http "^2.0.0"
+
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
@@ -757,11 +1551,43 @@ Lockfile:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
+ validator@^13.5.2:
+ version "13.6.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-13.6.0.tgz#1e71899c14cdc7b2068463cb24c1cc16f6ec7059"
+ integrity sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==
+
vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
+ widest-line@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca"
+ integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==
+ dependencies:
+ string-width "^4.0.0"
+
+ wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+ write-file-atomic@^3.0.0:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8"
+ integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==
+ dependencies:
+ imurmurhash "^0.1.4"
+ is-typedarray "^1.0.0"
+ signal-exit "^3.0.2"
+ typedarray-to-buffer "^3.1.5"
+
+ xdg-basedir@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
+ integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
+
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
diff --git a/yarn.lock b/yarn.lock
index b48f414..b781658 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,18 @@
# yarn lockfile v1
+"@sindresorhus/is@^0.14.0":
+ version "0.14.0"
+ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.14.0.tgz#9fb3a3cf3132328151f353de4632e01e52102bea"
+ integrity sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==
+
+"@szmarczak/http-timer@^1.1.2":
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421"
+ integrity sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==
+ dependencies:
+ defer-to-connect "^1.0.1"
+
"@tsconfig/node10@^1.0.7":
version "1.0.8"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9"
@@ -99,6 +111,11 @@
"@types/mime" "^1"
"@types/node" "*"
+abbrev@1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
+ integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
+
accepts@~1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd"
@@ -107,6 +124,43 @@ accepts@~1.3.7:
mime-types "~2.1.24"
negotiator "0.6.2"
+ansi-align@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.0.tgz#b536b371cf687caaef236c18d3e21fe3797467cb"
+ integrity sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==
+ dependencies:
+ string-width "^3.0.0"
+
+ansi-regex@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
+ integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+
+ansi-regex@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75"
+ integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==
+
+ansi-styles@^4.1.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
+ integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
+ dependencies:
+ color-convert "^2.0.1"
+
+anymatch@~3.1.2:
+ version "3.1.2"
+ resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
+ integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
+ dependencies:
+ normalize-path "^3.0.0"
+ picomatch "^2.0.4"
+
+append-field@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56"
+ integrity sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=
+
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
@@ -117,11 +171,41 @@ array-flatten@1.1.1:
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2"
integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=
+aws-sdk@^2.943.0:
+ version "2.943.0"
+ resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.943.0.tgz#6bda506cc33f5e7ec14e58ca4847e9abbab05c13"
+ integrity sha512-1/WDupJrIB0SJEzIOf+UpqmG0AP5AXoDXhbW7CEujHerOd+/b5A1ubeHKGQJvBN4tAktgsvGpDiBRfB9MpJU5g==
+ dependencies:
+ buffer "4.9.2"
+ events "1.1.1"
+ ieee754 "1.1.13"
+ jmespath "0.15.0"
+ querystring "0.2.0"
+ sax "1.2.1"
+ url "0.10.3"
+ uuid "3.3.2"
+ xml2js "0.4.19"
+
+balanced-match@^1.0.0:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
+ integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
+
+base64-js@^1.0.2:
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
+ integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
+
bcryptjs@^2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb"
integrity sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms=
+binary-extensions@^2.0.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d"
+ integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
+
bl@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/bl/-/bl-2.2.1.tgz#8c11a7b730655c5d56898cdc871224f40fd901d5"
@@ -151,6 +235,35 @@ body-parser@1.19.0:
raw-body "2.4.0"
type-is "~1.6.17"
+boxen@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64"
+ integrity sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==
+ dependencies:
+ ansi-align "^3.0.0"
+ camelcase "^5.3.1"
+ chalk "^3.0.0"
+ cli-boxes "^2.2.0"
+ string-width "^4.1.0"
+ term-size "^2.1.0"
+ type-fest "^0.8.1"
+ widest-line "^3.1.0"
+
+brace-expansion@^1.1.7:
+ version "1.1.11"
+ resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
+ integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
+ dependencies:
+ balanced-match "^1.0.0"
+ concat-map "0.0.1"
+
+braces@~3.0.2:
+ version "3.0.2"
+ resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
+ integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
+ dependencies:
+ fill-range "^7.0.1"
+
bson@^1.1.4:
version "1.1.6"
resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.6.tgz#fb819be9a60cd677e0853aee4ca712a785d6618a"
@@ -161,11 +274,125 @@ buffer-from@^1.0.0:
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
+buffer@4.9.2:
+ version "4.9.2"
+ resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.2.tgz#230ead344002988644841ab0244af8c44bbe3ef8"
+ integrity sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==
+ dependencies:
+ base64-js "^1.0.2"
+ ieee754 "^1.1.4"
+ isarray "^1.0.0"
+
+busboy@^0.2.11:
+ version "0.2.14"
+ resolved "https://registry.yarnpkg.com/busboy/-/busboy-0.2.14.tgz#6c2a622efcf47c57bbbe1e2a9c37ad36c7925453"
+ integrity sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=
+ dependencies:
+ dicer "0.2.5"
+ readable-stream "1.1.x"
+
bytes@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6"
integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==
+cacheable-request@^6.0.0:
+ version "6.1.0"
+ resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912"
+ integrity sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==
+ dependencies:
+ clone-response "^1.0.2"
+ get-stream "^5.1.0"
+ http-cache-semantics "^4.0.0"
+ keyv "^3.0.0"
+ lowercase-keys "^2.0.0"
+ normalize-url "^4.1.0"
+ responselike "^1.0.2"
+
+camelcase@^5.3.1:
+ version "5.3.1"
+ resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
+ integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
+
+chalk@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4"
+ integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==
+ dependencies:
+ ansi-styles "^4.1.0"
+ supports-color "^7.1.0"
+
+chokidar@^3.2.2:
+ version "3.5.2"
+ resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
+ integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
+ dependencies:
+ anymatch "~3.1.2"
+ braces "~3.0.2"
+ glob-parent "~5.1.2"
+ is-binary-path "~2.1.0"
+ is-glob "~4.0.1"
+ normalize-path "~3.0.0"
+ readdirp "~3.6.0"
+ optionalDependencies:
+ fsevents "~2.3.2"
+
+ci-info@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46"
+ integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==
+
+cli-boxes@^2.2.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f"
+ integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==
+
+clone-response@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
+ integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
+ dependencies:
+ mimic-response "^1.0.0"
+
+color-convert@^2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
+ integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
+ dependencies:
+ color-name "~1.1.4"
+
+color-name@~1.1.4:
+ version "1.1.4"
+ resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
+ integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+
+concat-map@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
+ integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
+
+concat-stream@^1.5.2:
+ version "1.6.2"
+ resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34"
+ integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==
+ dependencies:
+ buffer-from "^1.0.0"
+ inherits "^2.0.3"
+ readable-stream "^2.2.2"
+ typedarray "^0.0.6"
+
+configstore@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.1.tgz#d365021b5df4b98cdd187d6a3b0e3f6a7cc5ed96"
+ integrity sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==
+ dependencies:
+ dot-prop "^5.2.0"
+ graceful-fs "^4.1.2"
+ make-dir "^3.0.0"
+ unique-string "^2.0.0"
+ write-file-atomic "^3.0.0"
+ xdg-basedir "^4.0.0"
+
content-disposition@0.5.3:
version "0.5.3"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd"
@@ -198,7 +425,12 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
-debug@2.6.9:
+crypto-random-string@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5"
+ integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==
+
+debug@2.6.9, debug@^2.2.0:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
@@ -212,6 +444,30 @@ debug@3.1.0:
dependencies:
ms "2.0.0"
+debug@^3.2.6:
+ version "3.2.7"
+ resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a"
+ integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==
+ dependencies:
+ ms "^2.1.1"
+
+decompress-response@^3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
+ integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
+ dependencies:
+ mimic-response "^1.0.0"
+
+deep-extend@^0.6.0:
+ version "0.6.0"
+ resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
+ integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
+
+defer-to-connect@^1.0.1:
+ version "1.1.3"
+ resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591"
+ integrity sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==
+
denque@^1.4.1:
version "1.5.0"
resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.0.tgz#773de0686ff2d8ec2ff92914316a47b73b1c73de"
@@ -227,26 +483,68 @@ destroy@~1.0.4:
resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80"
integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=
+dicer@0.2.5:
+ version "0.2.5"
+ resolved "https://registry.yarnpkg.com/dicer/-/dicer-0.2.5.tgz#5996c086bb33218c812c090bddc09cd12facb70f"
+ integrity sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=
+ dependencies:
+ readable-stream "1.1.x"
+ streamsearch "0.1.2"
+
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
+dot-prop@^5.2.0:
+ version "5.3.0"
+ resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.3.0.tgz#90ccce708cd9cd82cc4dc8c3ddd9abdd55b20e88"
+ integrity sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==
+ dependencies:
+ is-obj "^2.0.0"
+
dotenv@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
+duplexer3@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
+ integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
+
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
+emoji-regex@^7.0.1:
+ version "7.0.3"
+ resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
+ integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
+
+emoji-regex@^8.0.0:
+ version "8.0.0"
+ resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
+ integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
+
encodeurl@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59"
integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=
+end-of-stream@^1.1.0:
+ version "1.4.4"
+ resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
+ integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
+ dependencies:
+ once "^1.4.0"
+
+escape-goat@^2.0.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675"
+ integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==
+
escape-html@~1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988"
@@ -257,6 +555,19 @@ etag@~1.8.1:
resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"
integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=
+events@1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924"
+ integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=
+
+express-validator@^6.12.0:
+ version "6.12.0"
+ resolved "https://registry.yarnpkg.com/express-validator/-/express-validator-6.12.0.tgz#a9cd49b3fe4c470abb615ae2e7dd111053c25f66"
+ integrity sha512-lcQAdVeAO+pBbHD33nIsDsd+QPakLX08tJ82iEsXj6ezyWCfYjE9RY/g9SVq5z4G0NaIkH8039Oe4r0G92DRyA==
+ dependencies:
+ lodash "^4.17.21"
+ validator "^13.5.2"
+
express@^4.17.1:
version "4.17.1"
resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134"
@@ -293,6 +604,18 @@ express@^4.17.1:
utils-merge "1.0.1"
vary "~1.1.2"
+file-type@^3.3.0:
+ version "3.9.0"
+ resolved "https://registry.yarnpkg.com/file-type/-/file-type-3.9.0.tgz#257a078384d1db8087bc449d107d52a52672b9e9"
+ integrity sha1-JXoHg4TR24CHvESdEH1SpSZyuek=
+
+fill-range@^7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
+ integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
+ dependencies:
+ to-regex-range "^5.0.1"
+
finalhandler@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d"
@@ -316,6 +639,86 @@ fresh@0.5.2:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=
+fsevents@~2.3.2:
+ version "2.3.2"
+ resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
+ integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
+
+get-stream@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
+ integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==
+ dependencies:
+ pump "^3.0.0"
+
+get-stream@^5.1.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3"
+ integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==
+ dependencies:
+ pump "^3.0.0"
+
+glob-parent@~5.1.2:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
+ integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
+ dependencies:
+ is-glob "^4.0.1"
+
+global-dirs@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.1.0.tgz#e9046a49c806ff04d6c1825e196c8f0091e8df4d"
+ integrity sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==
+ dependencies:
+ ini "1.3.7"
+
+got@^9.6.0:
+ version "9.6.0"
+ resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
+ integrity sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==
+ dependencies:
+ "@sindresorhus/is" "^0.14.0"
+ "@szmarczak/http-timer" "^1.1.2"
+ cacheable-request "^6.0.0"
+ decompress-response "^3.3.0"
+ duplexer3 "^0.1.4"
+ get-stream "^4.1.0"
+ lowercase-keys "^1.0.1"
+ mimic-response "^1.0.1"
+ p-cancelable "^1.0.0"
+ to-readable-stream "^1.0.0"
+ url-parse-lax "^3.0.0"
+
+graceful-fs@^4.1.2:
+ version "4.2.6"
+ resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee"
+ integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==
+
+has-flag@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
+ integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0=
+
+has-flag@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+ integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
+
+has-yarn@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-2.1.0.tgz#137e11354a7b5bf11aa5cb649cf0c6f3ff2b2e77"
+ integrity sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==
+
+html-comment-regex@^1.1.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7"
+ integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==
+
+http-cache-semantics@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
+ integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
+
http-errors@1.7.2:
version "1.7.2"
resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f"
@@ -345,31 +748,198 @@ iconv-lite@0.4.24:
dependencies:
safer-buffer ">= 2.1.2 < 3"
+ieee754@1.1.13:
+ version "1.1.13"
+ resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
+ integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
+
+ieee754@^1.1.4:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
+ integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
+
+ignore-by-default@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/ignore-by-default/-/ignore-by-default-1.0.1.tgz#48ca6d72f6c6a3af00a9ad4ae6876be3889e2b09"
+ integrity sha1-SMptcvbGo68Aqa1K5odr44ieKwk=
+
+import-lazy@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
+ integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
+
+imurmurhash@^0.1.4:
+ version "0.1.4"
+ resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
+ integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
+
inherits@2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
-inherits@2.0.4, inherits@~2.0.3:
+inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
+ini@1.3.7:
+ version "1.3.7"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.7.tgz#a09363e1911972ea16d7a8851005d84cf09a9a84"
+ integrity sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==
+
+ini@~1.3.0:
+ version "1.3.8"
+ resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
+ integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
+
ipaddr.js@1.9.1:
version "1.9.1"
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==
-isarray@~1.0.0:
+is-binary-path@~2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
+ integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
+ dependencies:
+ binary-extensions "^2.0.0"
+
+is-ci@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c"
+ integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==
+ dependencies:
+ ci-info "^2.0.0"
+
+is-extglob@^2.1.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
+ integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
+
+is-fullwidth-code-point@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
+ integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=
+
+is-fullwidth-code-point@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
+ integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
+
+is-glob@^4.0.1, is-glob@~4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
+ integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
+ dependencies:
+ is-extglob "^2.1.1"
+
+is-installed-globally@^0.3.1:
+ version "0.3.2"
+ resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141"
+ integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==
+ dependencies:
+ global-dirs "^2.0.1"
+ is-path-inside "^3.0.1"
+
+is-npm@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-4.0.0.tgz#c90dd8380696df87a7a6d823c20d0b12bbe3c84d"
+ integrity sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==
+
+is-number@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
+ integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
+
+is-obj@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
+ integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==
+
+is-path-inside@^3.0.1:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
+ integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
+
+is-svg@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9"
+ integrity sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=
+ dependencies:
+ html-comment-regex "^1.1.0"
+
+is-typedarray@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
+ integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=
+
+is-yarn-global@^0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/is-yarn-global/-/is-yarn-global-0.3.0.tgz#d502d3382590ea3004893746754c89139973e232"
+ integrity sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==
+
+isarray@0.0.1:
+ version "0.0.1"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
+ integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=
+
+isarray@^1.0.0, isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
+jmespath@0.15.0:
+ version "0.15.0"
+ resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217"
+ integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=
+
+json-buffer@3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
+ integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
+
kareem@2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.3.2.tgz#78c4508894985b8d38a0dc15e1a8e11078f2ca93"
integrity sha512-STHz9P7X2L4Kwn72fA4rGyqyXdmrMSdxqHx9IXon/FXluXieaFA6KJ2upcHAHxQPQ0LeM/OjLrhFxifHewOALQ==
+keyv@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
+ integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==
+ dependencies:
+ json-buffer "3.0.0"
+
+latest-version@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face"
+ integrity sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==
+ dependencies:
+ package-json "^6.3.0"
+
+lodash@^4.17.21:
+ version "4.17.21"
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
+ integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
+
+lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
+ integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==
+
+lowercase-keys@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
+ integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
+
+make-dir@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
+ integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
+ dependencies:
+ semver "^6.0.0"
+
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
@@ -412,6 +982,30 @@ mime@1.6.0:
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
+mimic-response@^1.0.0, mimic-response@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
+ integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
+
+minimatch@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
+ integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
+ dependencies:
+ brace-expansion "^1.1.7"
+
+minimist@^1.2.0, minimist@^1.2.5:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
+ integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
+
+mkdirp@^0.5.1:
+ version "0.5.5"
+ resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
+ integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
+ dependencies:
+ minimist "^1.2.5"
+
mongodb@3.6.8:
version "3.6.8"
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.6.8.tgz#3e2632af81915b3ff99b7681121ca0895e8ed407"
@@ -479,23 +1073,111 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
+ms@^2.1.1:
+ version "2.1.3"
+ resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
+ integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
+
+multer-s3@^2.9.0:
+ version "2.9.0"
+ resolved "https://registry.yarnpkg.com/multer-s3/-/multer-s3-2.9.0.tgz#a946fd8c01c9726076f11949b84943259f8ca8c3"
+ integrity sha512-qLF8pCD5HhXLLd954q49B63x3bk6Fe0jqD3eM0FVcGtqhiSVuTrchEDAo0mnO5pc34cMuX/CVCCbPkGTjX2xUA==
+ dependencies:
+ file-type "^3.3.0"
+ is-svg "^2.1.0"
+ run-parallel "^1.1.6"
+
+multer@^1.4.2:
+ version "1.4.2"
+ resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.2.tgz#2f1f4d12dbaeeba74cb37e623f234bf4d3d2057a"
+ integrity sha512-xY8pX7V+ybyUpbYMxtjM9KAiD9ixtg5/JkeKUTD6xilfDv0vzzOFcCp4Ljb1UU3tSOM3VTZtKo63OmzOrGi3Cg==
+ dependencies:
+ append-field "^1.0.0"
+ busboy "^0.2.11"
+ concat-stream "^1.5.2"
+ mkdirp "^0.5.1"
+ object-assign "^4.1.1"
+ on-finished "^2.3.0"
+ type-is "^1.6.4"
+ xtend "^4.0.0"
+
negotiator@0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==
-on-finished@~2.3.0:
+nodemon@^2.0.12:
+ version "2.0.12"
+ resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-2.0.12.tgz#5dae4e162b617b91f1873b3bfea215dd71e144d5"
+ integrity sha512-egCTmNZdObdBxUBw6ZNwvZ/xzk24CKRs5K6d+5zbmrMr7rOpPmfPeF6OxM3DDpaRx331CQRFEktn+wrFFfBSOA==
+ dependencies:
+ chokidar "^3.2.2"
+ debug "^3.2.6"
+ ignore-by-default "^1.0.1"
+ minimatch "^3.0.4"
+ pstree.remy "^1.1.7"
+ semver "^5.7.1"
+ supports-color "^5.5.0"
+ touch "^3.1.0"
+ undefsafe "^2.0.3"
+ update-notifier "^4.1.0"
+
+nopt@~1.0.10:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
+ integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=
+ dependencies:
+ abbrev "1"
+
+normalize-path@^3.0.0, normalize-path@~3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
+ integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
+
+normalize-url@^4.1.0:
+ version "4.5.1"
+ resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
+ integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
+
+object-assign@^4.1.1:
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
+ integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
+
+on-finished@^2.3.0, on-finished@~2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=
dependencies:
ee-first "1.1.1"
+once@^1.3.1, once@^1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
+ integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
+ dependencies:
+ wrappy "1"
+
optional-require@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/optional-require/-/optional-require-1.0.3.tgz#275b8e9df1dc6a17ad155369c2422a440f89cb07"
integrity sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==
+p-cancelable@^1.0.0:
+ version "1.1.0"
+ resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc"
+ integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==
+
+package-json@^6.3.0:
+ version "6.5.0"
+ resolved "https://registry.yarnpkg.com/package-json/-/package-json-6.5.0.tgz#6feedaca35e75725876d0b0e64974697fed145b0"
+ integrity sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==
+ dependencies:
+ got "^9.6.0"
+ registry-auth-token "^4.0.0"
+ registry-url "^5.0.0"
+ semver "^6.2.0"
+
parseurl@~1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4"
@@ -506,6 +1188,16 @@ path-to-regexp@0.1.7:
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c"
integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=
+picomatch@^2.0.4, picomatch@^2.2.1:
+ version "2.3.0"
+ resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
+ integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
+
+prepend-http@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
+ integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
+
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
@@ -519,11 +1211,46 @@ proxy-addr@~2.0.5:
forwarded "0.2.0"
ipaddr.js "1.9.1"
+pstree.remy@^1.1.7:
+ version "1.1.8"
+ resolved "https://registry.yarnpkg.com/pstree.remy/-/pstree.remy-1.1.8.tgz#c242224f4a67c21f686839bbdb4ac282b8373d3a"
+ integrity sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==
+
+pump@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
+ integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
+ dependencies:
+ end-of-stream "^1.1.0"
+ once "^1.3.1"
+
+punycode@1.3.2:
+ version "1.3.2"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d"
+ integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=
+
+pupa@^2.0.1:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/pupa/-/pupa-2.1.1.tgz#f5e8fd4afc2c5d97828faa523549ed8744a20d62"
+ integrity sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==
+ dependencies:
+ escape-goat "^2.0.0"
+
qs@6.7.0:
version "6.7.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc"
integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==
+querystring@0.2.0:
+ version "0.2.0"
+ resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620"
+ integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=
+
+queue-microtask@^1.2.2:
+ version "1.2.3"
+ resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
+ integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
+
range-parser@~1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031"
@@ -539,7 +1266,27 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
-readable-stream@^2.3.5:
+rc@^1.2.8:
+ version "1.2.8"
+ resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
+ integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
+ dependencies:
+ deep-extend "^0.6.0"
+ ini "~1.3.0"
+ minimist "^1.2.0"
+ strip-json-comments "~2.0.1"
+
+readable-stream@1.1.x:
+ version "1.1.14"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9"
+ integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk=
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.1"
+ isarray "0.0.1"
+ string_decoder "~0.10.x"
+
+readable-stream@^2.2.2, readable-stream@^2.3.5:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
@@ -552,11 +1299,46 @@ readable-stream@^2.3.5:
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
+readdirp@~3.6.0:
+ version "3.6.0"
+ resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
+ integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
+ dependencies:
+ picomatch "^2.2.1"
+
regexp-clone@1.0.0, regexp-clone@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/regexp-clone/-/regexp-clone-1.0.0.tgz#222db967623277056260b992626354a04ce9bf63"
integrity sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw==
+registry-auth-token@^4.0.0:
+ version "4.2.1"
+ resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-4.2.1.tgz#6d7b4006441918972ccd5fedcd41dc322c79b250"
+ integrity sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==
+ dependencies:
+ rc "^1.2.8"
+
+registry-url@^5.0.0:
+ version "5.1.0"
+ resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-5.1.0.tgz#e98334b50d5434b81136b44ec638d9c2009c5009"
+ integrity sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==
+ dependencies:
+ rc "^1.2.8"
+
+responselike@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
+ integrity sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=
+ dependencies:
+ lowercase-keys "^1.0.0"
+
+run-parallel@^1.1.6:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee"
+ integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
+ dependencies:
+ queue-microtask "^1.2.2"
+
safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
@@ -579,6 +1361,33 @@ saslprep@^1.0.0:
dependencies:
sparse-bitfield "^3.0.3"
+sax@1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.1.tgz#7b8e656190b228e81a66aea748480d828cd2d37a"
+ integrity sha1-e45lYZCyKOgaZq6nSEgNgozS03o=
+
+sax@>=0.6.0:
+ version "1.2.4"
+ resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
+ integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
+
+semver-diff@^3.1.1:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-3.1.1.tgz#05f77ce59f325e00e2706afd67bb506ddb1ca32b"
+ integrity sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==
+ dependencies:
+ semver "^6.3.0"
+
+semver@^5.7.1:
+ version "5.7.1"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
+ integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
+
+semver@^6.0.0, semver@^6.2.0, semver@^6.3.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
+ integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
+
send@0.17.1:
version "0.17.1"
resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8"
@@ -618,6 +1427,11 @@ sift@13.5.2:
resolved "https://registry.yarnpkg.com/sift/-/sift-13.5.2.tgz#24a715e13c617b086166cd04917d204a591c9da6"
integrity sha512-+gxdEOMA2J+AI+fVsCqeNn7Tgx3M9ZN9jdi95939l1IJ8cZsqS8sqpJyOkic2SJk+1+98Uwryt/gL6XDaV+UZA==
+signal-exit@^3.0.2:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
+ integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
+
sliced@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41"
@@ -648,6 +1462,34 @@ sparse-bitfield@^3.0.3:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=
+streamsearch@0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-0.1.2.tgz#808b9d0e56fc273d809ba57338e929919a1a9f1a"
+ integrity sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=
+
+string-width@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
+ integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
+ dependencies:
+ emoji-regex "^7.0.1"
+ is-fullwidth-code-point "^2.0.0"
+ strip-ansi "^5.1.0"
+
+string-width@^4.0.0, string-width@^4.1.0:
+ version "4.2.2"
+ resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.2.tgz#dafd4f9559a7585cfba529c6a0a4f73488ebd4c5"
+ integrity sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==
+ dependencies:
+ emoji-regex "^8.0.0"
+ is-fullwidth-code-point "^3.0.0"
+ strip-ansi "^6.0.0"
+
+string_decoder@~0.10.x:
+ version "0.10.31"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
+ integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=
+
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
@@ -655,11 +1497,68 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
+strip-ansi@^5.1.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
+ integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
+ dependencies:
+ ansi-regex "^4.1.0"
+
+strip-ansi@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532"
+ integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==
+ dependencies:
+ ansi-regex "^5.0.0"
+
+strip-json-comments@~2.0.1:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
+ integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
+
+supports-color@^5.5.0:
+ version "5.5.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
+ integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
+ dependencies:
+ has-flag "^3.0.0"
+
+supports-color@^7.1.0:
+ version "7.2.0"
+ resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+ integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
+ dependencies:
+ has-flag "^4.0.0"
+
+term-size@^2.1.0:
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.1.tgz#2a6a54840432c2fb6320fea0f415531e90189f54"
+ integrity sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==
+
+to-readable-stream@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"
+ integrity sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==
+
+to-regex-range@^5.0.1:
+ version "5.0.1"
+ resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
+ integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
+ dependencies:
+ is-number "^7.0.0"
+
toidentifier@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553"
integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==
+touch@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
+ integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==
+ dependencies:
+ nopt "~1.0.10"
+
ts-node@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.0.0.tgz#05f10b9a716b0b624129ad44f0ea05dac84ba3be"
@@ -676,7 +1575,12 @@ ts-node@^10.0.0:
source-map-support "^0.5.17"
yn "3.1.1"
-type-is@~1.6.17, type-is@~1.6.18:
+type-fest@^0.8.1:
+ version "0.8.1"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
+ integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
+
+type-is@^1.6.4, type-is@~1.6.17, type-is@~1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==
@@ -684,16 +1588,76 @@ type-is@~1.6.17, type-is@~1.6.18:
media-typer "0.3.0"
mime-types "~2.1.24"
+typedarray-to-buffer@^3.1.5:
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080"
+ integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==
+ dependencies:
+ is-typedarray "^1.0.0"
+
+typedarray@^0.0.6:
+ version "0.0.6"
+ resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
+ integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
+
typescript@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.4.tgz#3f85b986945bcf31071decdd96cf8bfa65f9dcbc"
integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==
+undefsafe@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.3.tgz#6b166e7094ad46313b2202da7ecc2cd7cc6e7aae"
+ integrity sha512-nrXZwwXrD/T/JXeygJqdCO6NZZ1L66HrxM/Z7mIq2oPanoN0F1nLx3lwJMu6AwJY69hdixaFQOuoYsMjE5/C2A==
+ dependencies:
+ debug "^2.2.0"
+
+unique-string@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d"
+ integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==
+ dependencies:
+ crypto-random-string "^2.0.0"
+
unpipe@1.0.0, unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=
+update-notifier@^4.1.0:
+ version "4.1.3"
+ resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-4.1.3.tgz#be86ee13e8ce48fb50043ff72057b5bd598e1ea3"
+ integrity sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==
+ dependencies:
+ boxen "^4.2.0"
+ chalk "^3.0.0"
+ configstore "^5.0.1"
+ has-yarn "^2.1.0"
+ import-lazy "^2.1.0"
+ is-ci "^2.0.0"
+ is-installed-globally "^0.3.1"
+ is-npm "^4.0.0"
+ is-yarn-global "^0.3.0"
+ latest-version "^5.0.0"
+ pupa "^2.0.1"
+ semver-diff "^3.1.1"
+ xdg-basedir "^4.0.0"
+
+url-parse-lax@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
+ integrity sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=
+ dependencies:
+ prepend-http "^2.0.0"
+
+url@0.10.3:
+ version "0.10.3"
+ resolved "https://registry.yarnpkg.com/url/-/url-0.10.3.tgz#021e4d9c7705f21bbf37d03ceb58767402774c64"
+ integrity sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=
+ dependencies:
+ punycode "1.3.2"
+ querystring "0.2.0"
+
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
@@ -704,11 +1668,66 @@ utils-merge@1.0.1:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=
+uuid@3.3.2:
+ version "3.3.2"
+ resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
+ integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
+
+validator@^13.5.2:
+ version "13.6.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-13.6.0.tgz#1e71899c14cdc7b2068463cb24c1cc16f6ec7059"
+ integrity sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==
+
vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=
+widest-line@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca"
+ integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==
+ dependencies:
+ string-width "^4.0.0"
+
+wrappy@1:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
+ integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
+
+write-file-atomic@^3.0.0:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8"
+ integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==
+ dependencies:
+ imurmurhash "^0.1.4"
+ is-typedarray "^1.0.0"
+ signal-exit "^3.0.2"
+ typedarray-to-buffer "^3.1.5"
+
+xdg-basedir@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13"
+ integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==
+
+xml2js@0.4.19:
+ version "0.4.19"
+ resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.4.19.tgz#686c20f213209e94abf0d1bcf1efaa291c7827a7"
+ integrity sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==
+ dependencies:
+ sax ">=0.6.0"
+ xmlbuilder "~9.0.1"
+
+xmlbuilder@~9.0.1:
+ version "9.0.7"
+ resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"
+ integrity sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=
+
+xtend@^4.0.0:
+ version "4.0.2"
+ resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
+ integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
+
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"