@purpleschool/gptbot 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/api/controllers/ai-model.ts +6 -0
  2. package/api/controllers/auth.ts +9 -0
  3. package/api/controllers/category.ts +6 -0
  4. package/api/controllers/chat-private.ts +8 -0
  5. package/api/controllers/chat-public.ts +8 -0
  6. package/api/controllers/index.ts +9 -0
  7. package/api/controllers/page.ts +6 -0
  8. package/api/controllers/question.ts +5 -0
  9. package/api/controllers/unregistered-user.ts +1 -0
  10. package/api/controllers/user.ts +5 -0
  11. package/api/index.ts +2 -0
  12. package/api/routes.ts +71 -0
  13. package/build/api/controllers/ai-model.js +8 -0
  14. package/build/api/controllers/auth.js +11 -0
  15. package/build/api/controllers/category.js +8 -0
  16. package/build/api/controllers/chat-private.js +10 -0
  17. package/build/api/controllers/chat-public.js +10 -0
  18. package/build/api/controllers/index.js +25 -0
  19. package/build/api/controllers/page.js +8 -0
  20. package/build/api/controllers/question.js +8 -0
  21. package/build/api/controllers/unregistered-user.js +4 -0
  22. package/build/api/controllers/user.js +7 -0
  23. package/build/api/index.js +18 -0
  24. package/build/api/routes.js +87 -0
  25. package/build/commands/ai-model/create-ai-model.command.js +16 -0
  26. package/build/commands/ai-model/delete-ai-model.command.js +14 -0
  27. package/build/commands/ai-model/find-ai-model.command.js +17 -0
  28. package/build/commands/ai-model/index.js +20 -0
  29. package/build/commands/ai-model/update-ai-model.command.js +19 -0
  30. package/build/commands/auth/create-user.command.js +16 -0
  31. package/build/commands/auth/index.js +21 -0
  32. package/build/commands/auth/login.command.js +17 -0
  33. package/build/commands/auth/register-user.command.js +17 -0
  34. package/build/commands/auth/reset-paasword.command.js +19 -0
  35. package/build/commands/auth/restore-password.command.js +16 -0
  36. package/build/commands/category/create-category.command.js +16 -0
  37. package/build/commands/category/delete-category.command.js +14 -0
  38. package/build/commands/category/find-category.command.js +17 -0
  39. package/build/commands/category/index.js +20 -0
  40. package/build/commands/category/update-category.command.js +19 -0
  41. package/build/commands/chat/create-chat.command.js +15 -0
  42. package/build/commands/chat/delete-chat.command.js +14 -0
  43. package/build/commands/chat/find-chat.command.js +25 -0
  44. package/build/commands/chat/get-my-last-active-chat.command.js +11 -0
  45. package/build/commands/chat/index.js +21 -0
  46. package/build/commands/chat/update-chat.command.js +19 -0
  47. package/build/commands/index.js +25 -0
  48. package/build/commands/message/create-message.command.js +17 -0
  49. package/build/commands/message/index.js +17 -0
  50. package/build/commands/page/create-page.command.js +16 -0
  51. package/build/commands/page/delete-page.command.js +14 -0
  52. package/build/commands/page/find-page.command.js +17 -0
  53. package/build/commands/page/index.js +20 -0
  54. package/build/commands/page/update-page.command.js +19 -0
  55. package/build/commands/question/create-question.command.js +16 -0
  56. package/build/commands/question/delete-question.command.js +14 -0
  57. package/build/commands/question/find-question.command.js +17 -0
  58. package/build/commands/question/index.js +20 -0
  59. package/build/commands/question/update-question.command.js +19 -0
  60. package/build/commands/unregistered-user/create-unregistered-user.command.js +12 -0
  61. package/build/commands/unregistered-user/index.js +17 -0
  62. package/build/commands/user/find-user.command.js +14 -0
  63. package/build/commands/user/index.js +17 -0
  64. package/build/constants/errors/errors.js +185 -0
  65. package/build/constants/errors/index.js +18 -0
  66. package/build/constants/errors/verbose.js +9 -0
  67. package/build/constants/index.js +18 -0
  68. package/build/constants/roles/index.js +17 -0
  69. package/build/constants/roles/role.js +7 -0
  70. package/build/index.js +17 -0
  71. package/build/models/ai-model.schema.js +13 -0
  72. package/build/models/category.schema.js +12 -0
  73. package/build/models/chat.schema.js +13 -0
  74. package/build/models/index.js +24 -0
  75. package/build/models/message.schema.js +13 -0
  76. package/build/models/page.schema.js +16 -0
  77. package/build/models/question.schema.js +12 -0
  78. package/build/models/unregistered-user.schema.js +10 -0
  79. package/build/models/user.schema.js +16 -0
  80. package/commands/ai-model/create-ai-model.command.ts +18 -0
  81. package/commands/ai-model/delete-ai-model.command.ts +15 -0
  82. package/commands/ai-model/find-ai-model.command.ts +22 -0
  83. package/commands/ai-model/index.ts +4 -0
  84. package/commands/ai-model/update-ai-model.command.ts +24 -0
  85. package/commands/auth/create-user.command.ts +17 -0
  86. package/commands/auth/index.ts +5 -0
  87. package/commands/auth/login.command.ts +18 -0
  88. package/commands/auth/register-user.command.ts +18 -0
  89. package/commands/auth/reset-paasword.command.ts +20 -0
  90. package/commands/auth/restore-password.command.ts +16 -0
  91. package/commands/category/create-category.command.ts +18 -0
  92. package/commands/category/delete-category.command.ts +15 -0
  93. package/commands/category/find-category.command.ts +22 -0
  94. package/commands/category/index.ts +4 -0
  95. package/commands/category/update-category.command.ts +24 -0
  96. package/commands/chat/create-chat.command.ts +17 -0
  97. package/commands/chat/delete-chat.command.ts +15 -0
  98. package/commands/chat/find-chat.command.ts +31 -0
  99. package/commands/chat/get-my-last-active-chat.command.ts +10 -0
  100. package/commands/chat/index.ts +5 -0
  101. package/commands/chat/update-chat.command.ts +24 -0
  102. package/commands/index.ts +9 -0
  103. package/commands/message/create-message.command.ts +20 -0
  104. package/commands/message/index.ts +1 -0
  105. package/commands/page/create-page.command.ts +18 -0
  106. package/commands/page/delete-page.command.ts +15 -0
  107. package/commands/page/find-page.command.ts +22 -0
  108. package/commands/page/index.ts +4 -0
  109. package/commands/page/update-page.command.ts +24 -0
  110. package/commands/question/create-question.command.ts +18 -0
  111. package/commands/question/delete-question.command.ts +15 -0
  112. package/commands/question/find-question.command.ts +22 -0
  113. package/commands/question/index.ts +4 -0
  114. package/commands/question/update-question.command.ts +24 -0
  115. package/commands/unregistered-user/create-unregistered-user.command.ts +10 -0
  116. package/commands/unregistered-user/index.ts +1 -0
  117. package/commands/user/find-user.command.ts +16 -0
  118. package/commands/user/index.ts +1 -0
  119. package/constants/errors/errors.ts +183 -0
  120. package/constants/errors/index.ts +2 -0
  121. package/constants/errors/verbose.ts +7 -0
  122. package/constants/index.ts +2 -0
  123. package/constants/roles/index.ts +1 -0
  124. package/constants/roles/role.ts +7 -0
  125. package/index.ts +1 -0
  126. package/models/ai-model.schema.ts +12 -0
  127. package/models/category.schema.ts +11 -0
  128. package/models/chat.schema.ts +12 -0
  129. package/models/index.ts +8 -0
  130. package/models/message.schema.ts +12 -0
  131. package/models/page.schema.ts +15 -0
  132. package/models/question.schema.ts +11 -0
  133. package/models/unregistered-user.schema.ts +9 -0
  134. package/models/user.schema.ts +15 -0
  135. package/package.json +16 -0
  136. package/tsconfig.json +103 -0
@@ -0,0 +1,6 @@
1
+ export const AI_MODEL_CONTROLLER = 'ai-module' as const;
2
+
3
+ export const AI_MODEL_ROUTES = {
4
+ FIND_BY_UUID: 'by/uuid',
5
+ GET_ALL: 'all',
6
+ } as const;
@@ -0,0 +1,9 @@
1
+ export const AUTH_CONTROLLER = 'auth' as const;
2
+
3
+ export const AUTH_ROUTES = {
4
+ REGISTER: 'register',
5
+ LOGIN: 'login',
6
+ CREATE_USER: 'create-user',
7
+ RESTORE_PASSWORD: 'restore-password',
8
+ RESET_PASSWORD: 'reset-password',
9
+ } as const;
@@ -0,0 +1,6 @@
1
+ export const CATEGORY_CONTROLLER = 'category' as const;
2
+
3
+ export const CATEGORY_ROUTES = {
4
+ FIND_BY_UUID: 'by/uuid',
5
+ GET_ALL: 'all',
6
+ } as const;
@@ -0,0 +1,8 @@
1
+ export const CHAT_PRIVATE_CONTROLLER = 'chat/private' as const;
2
+
3
+ export const CHAT_PRIVATE_ROUTES = {
4
+ GET_BY_UUID: 'by/uuid',
5
+ GET_MY: 'get/my',
6
+ GET_LAST_ACTIVE_CHAT: 'last-active-chat',
7
+ CREATE_MESSAGE: (uuid: string) => `my/${uuid}/send`,
8
+ } as const;
@@ -0,0 +1,8 @@
1
+ export const CHAT_PUBLIC_CONTROLLER = 'chat/public' as const;
2
+
3
+ export const CHAT_PUBLIC_ROUTES = {
4
+ FIND_BY_UUID: 'by/uuid',
5
+ GET_MY: 'get/my',
6
+ GET_LAST_ACTIVE_CHAT: 'last-active-chat',
7
+ CREATE_MESSAGE: (uuid: string) => `my/${uuid}/send`,
8
+ } as const;
@@ -0,0 +1,9 @@
1
+ export * from './auth';
2
+ export * from './user';
3
+ export * from './page';
4
+ export * from './category';
5
+ export * from './question';
6
+ export * from './unregistered-user';
7
+ export * from './ai-model';
8
+ export * from './chat-private';
9
+ export * from './chat-public';
@@ -0,0 +1,6 @@
1
+ export const PAGE_CONTROLLER = 'page' as const;
2
+
3
+ export const PAGE_ROUTES = {
4
+ FIND_BY_UUID: 'by/uuid',
5
+ GET_ALL: 'all',
6
+ } as const;
@@ -0,0 +1,5 @@
1
+ export const QUESTION_CONTROLLER = 'question' as const;
2
+ export const QUESTION_ROUTES = {
3
+ FIND_BY_UUID: 'by/uuid',
4
+ GET_ALL: 'all',
5
+ } as const;
@@ -0,0 +1 @@
1
+ export const UNREGISTERED_USER_CONTROLLER = 'unregistered-user' as const;
@@ -0,0 +1,5 @@
1
+ export const USER_CONTROLLER = 'users' as const;
2
+
3
+ export const USER_ROUTES = {
4
+ GET: 'me',
5
+ } as const;
package/api/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './routes';
2
+ export * from './controllers';
package/api/routes.ts ADDED
@@ -0,0 +1,71 @@
1
+ import * as CONTROLLERS from './controllers';
2
+
3
+ export const ROOT = '/api' as const;
4
+
5
+ export const REST_API = {
6
+ AUTH: {
7
+ REGISTER: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.REGISTER}`,
8
+ LOGIN: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
9
+ CREATE_USER: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.CREATE_USER}`,
10
+ RESTORE_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESTORE_PASSWORD}`,
11
+ RESET_PASSWORD: `${ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESET_PASSWORD}`,
12
+ },
13
+ USERS: {
14
+ GET: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
15
+ },
16
+ PAGE: {
17
+ GET: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
18
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
19
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
20
+ CREATE: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}`,
21
+ GET_BY_UUID: (uuid: string): string =>
22
+ `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_UUID}/${uuid}`,
23
+ },
24
+ CATEGORY: {
25
+ GET: `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.GET_ALL}`,
26
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
27
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
28
+ CREATE: `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}`,
29
+ GET_BY_UUID: (uuid: string): string =>
30
+ `${ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.FIND_BY_UUID}/${uuid}`,
31
+ },
32
+ QUESTION: {
33
+ GET: `${ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.GET_ALL}`,
34
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${uuid}`,
35
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${uuid}`,
36
+ CREATE: `${ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}`,
37
+ GET_BY_UUID: (uuid: string): string =>
38
+ `${ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.FIND_BY_UUID}/${uuid}`,
39
+ },
40
+ UNREGISTERED_USER: {
41
+ PUT: `${ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.GET_ALL}`,
42
+ },
43
+ AI_MODULE: {
44
+ GET: `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${CONTROLLERS.AI_MODEL_ROUTES.GET_ALL}`,
45
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${uuid}`,
46
+ DELETE: (uuid: string) => `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${uuid}`,
47
+ CREATE: `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}`,
48
+ GET_BY_UUID: (uuid: string): string =>
49
+ `${ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${CONTROLLERS.AI_MODEL_ROUTES.FIND_BY_UUID}/${uuid}`,
50
+ },
51
+ CHAT_PRIVATE: {
52
+ GET: `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_MY}`,
53
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${uuid}`,
54
+ CREATE: `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}`,
55
+ GET_BY_UUID: (uuid: string): string =>
56
+ `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_BY_UUID}/${uuid}`,
57
+ GET_BY_LAST_ACTIVE_CHAT: `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_LAST_ACTIVE_CHAT}`,
58
+ CREATE_MESSAGE: (uuid: string): string =>
59
+ `${ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_MESSAGE(uuid)}`,
60
+ },
61
+ CHAT_PUBLIC: {
62
+ GET: `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.GET_MY}`,
63
+ PATCH: (uuid: string) => `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_ROUTES}/${uuid}`,
64
+ CREATE: `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}`,
65
+ GET_BY_UUID: (uuid: string): string =>
66
+ `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.FIND_BY_UUID}/${uuid}`,
67
+ GET_BY_LAST_ACTIVE_CHAT: `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.GET_LAST_ACTIVE_CHAT}`,
68
+ CREATE_MESSAGE: (uuid: string): string =>
69
+ `${ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.CREATE_MESSAGE(uuid)}`,
70
+ },
71
+ } as const;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AI_MODEL_ROUTES = exports.AI_MODEL_CONTROLLER = void 0;
4
+ exports.AI_MODEL_CONTROLLER = 'ai-module';
5
+ exports.AI_MODEL_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AUTH_ROUTES = exports.AUTH_CONTROLLER = void 0;
4
+ exports.AUTH_CONTROLLER = 'auth';
5
+ exports.AUTH_ROUTES = {
6
+ REGISTER: 'register',
7
+ LOGIN: 'login',
8
+ CREATE_USER: 'create-user',
9
+ RESTORE_PASSWORD: 'restore-password',
10
+ RESET_PASSWORD: 'reset-password',
11
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CATEGORY_ROUTES = exports.CATEGORY_CONTROLLER = void 0;
4
+ exports.CATEGORY_CONTROLLER = 'category';
5
+ exports.CATEGORY_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_PRIVATE_ROUTES = exports.CHAT_PRIVATE_CONTROLLER = void 0;
4
+ exports.CHAT_PRIVATE_CONTROLLER = 'chat/private';
5
+ exports.CHAT_PRIVATE_ROUTES = {
6
+ GET_BY_UUID: 'by/uuid',
7
+ GET_MY: 'get/my',
8
+ GET_LAST_ACTIVE_CHAT: 'last-active-chat',
9
+ CREATE_MESSAGE: (uuid) => `my/${uuid}/send`,
10
+ };
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_PUBLIC_ROUTES = exports.CHAT_PUBLIC_CONTROLLER = void 0;
4
+ exports.CHAT_PUBLIC_CONTROLLER = 'chat/public';
5
+ exports.CHAT_PUBLIC_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_MY: 'get/my',
8
+ GET_LAST_ACTIVE_CHAT: 'last-active-chat',
9
+ CREATE_MESSAGE: (uuid) => `my/${uuid}/send`,
10
+ };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./auth"), exports);
18
+ __exportStar(require("./user"), exports);
19
+ __exportStar(require("./page"), exports);
20
+ __exportStar(require("./category"), exports);
21
+ __exportStar(require("./question"), exports);
22
+ __exportStar(require("./unregistered-user"), exports);
23
+ __exportStar(require("./ai-model"), exports);
24
+ __exportStar(require("./chat-private"), exports);
25
+ __exportStar(require("./chat-public"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAGE_ROUTES = exports.PAGE_CONTROLLER = void 0;
4
+ exports.PAGE_CONTROLLER = 'page';
5
+ exports.PAGE_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QUESTION_ROUTES = exports.QUESTION_CONTROLLER = void 0;
4
+ exports.QUESTION_CONTROLLER = 'question';
5
+ exports.QUESTION_ROUTES = {
6
+ FIND_BY_UUID: 'by/uuid',
7
+ GET_ALL: 'all',
8
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UNREGISTERED_USER_CONTROLLER = void 0;
4
+ exports.UNREGISTERED_USER_CONTROLLER = 'unregistered-user';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_ROUTES = exports.USER_CONTROLLER = void 0;
4
+ exports.USER_CONTROLLER = 'users';
5
+ exports.USER_ROUTES = {
6
+ GET: 'me',
7
+ };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./routes"), exports);
18
+ __exportStar(require("./controllers"), exports);
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.REST_API = exports.ROOT = void 0;
27
+ const CONTROLLERS = __importStar(require("./controllers"));
28
+ exports.ROOT = '/api';
29
+ exports.REST_API = {
30
+ AUTH: {
31
+ REGISTER: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.REGISTER}`,
32
+ LOGIN: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.LOGIN}`,
33
+ CREATE_USER: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.CREATE_USER}`,
34
+ RESTORE_PASSWORD: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESTORE_PASSWORD}`,
35
+ RESET_PASSWORD: `${exports.ROOT}/${CONTROLLERS.AUTH_CONTROLLER}/${CONTROLLERS.AUTH_ROUTES.RESET_PASSWORD}`,
36
+ },
37
+ USERS: {
38
+ GET: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET}`,
39
+ },
40
+ PAGE: {
41
+ GET: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
42
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
43
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${uuid}`,
44
+ CREATE: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}`,
45
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.FIND_BY_UUID}/${uuid}`,
46
+ },
47
+ CATEGORY: {
48
+ GET: `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.GET_ALL}`,
49
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
50
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${uuid}`,
51
+ CREATE: `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}`,
52
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CATEGORY_CONTROLLER}/${CONTROLLERS.CATEGORY_ROUTES.FIND_BY_UUID}/${uuid}`,
53
+ },
54
+ QUESTION: {
55
+ GET: `${exports.ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.GET_ALL}`,
56
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${uuid}`,
57
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${uuid}`,
58
+ CREATE: `${exports.ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}`,
59
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.QUESTION_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.FIND_BY_UUID}/${uuid}`,
60
+ },
61
+ UNREGISTERED_USER: {
62
+ PUT: `${exports.ROOT}/${CONTROLLERS.UNREGISTERED_USER_CONTROLLER}/${CONTROLLERS.QUESTION_ROUTES.GET_ALL}`,
63
+ },
64
+ AI_MODULE: {
65
+ GET: `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${CONTROLLERS.AI_MODEL_ROUTES.GET_ALL}`,
66
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${uuid}`,
67
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${uuid}`,
68
+ CREATE: `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}`,
69
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.AI_MODEL_CONTROLLER}/${CONTROLLERS.AI_MODEL_ROUTES.FIND_BY_UUID}/${uuid}`,
70
+ },
71
+ CHAT_PRIVATE: {
72
+ GET: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_MY}`,
73
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${uuid}`,
74
+ CREATE: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}`,
75
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_BY_UUID}/${uuid}`,
76
+ GET_BY_LAST_ACTIVE_CHAT: `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.GET_LAST_ACTIVE_CHAT}`,
77
+ CREATE_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PRIVATE_CONTROLLER}/${CONTROLLERS.CHAT_PRIVATE_ROUTES.CREATE_MESSAGE(uuid)}`,
78
+ },
79
+ CHAT_PUBLIC: {
80
+ GET: `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.GET_MY}`,
81
+ PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_ROUTES}/${uuid}`,
82
+ CREATE: `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}`,
83
+ GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.FIND_BY_UUID}/${uuid}`,
84
+ GET_BY_LAST_ACTIVE_CHAT: `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.GET_LAST_ACTIVE_CHAT}`,
85
+ CREATE_MESSAGE: (uuid) => `${exports.ROOT}/${CONTROLLERS.CHAT_PUBLIC_CONTROLLER}/${CONTROLLERS.CHAT_PUBLIC_ROUTES.CREATE_MESSAGE(uuid)}`,
86
+ },
87
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateAIModelCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var CreateAIModelCommand;
7
+ (function (CreateAIModelCommand) {
8
+ CreateAIModelCommand.RequestSchema = models_1.AiModelSchema.omit({
9
+ uuid: true,
10
+ createdAt: true,
11
+ updatedAt: true,
12
+ });
13
+ CreateAIModelCommand.ResponseSchema = zod_1.z.object({
14
+ data: models_1.AiModelSchema,
15
+ });
16
+ })(CreateAIModelCommand || (exports.CreateAIModelCommand = CreateAIModelCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAIModelCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var DeleteAIModelCommand;
7
+ (function (DeleteAIModelCommand) {
8
+ DeleteAIModelCommand.RequestSchema = models_1.AiModelSchema.pick({
9
+ uuid: true,
10
+ });
11
+ DeleteAIModelCommand.ResponseSchema = zod_1.z.object({
12
+ isDeleted: zod_1.z.boolean(),
13
+ });
14
+ })(DeleteAIModelCommand || (exports.DeleteAIModelCommand = DeleteAIModelCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindAIModelCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var FindAIModelCommand;
7
+ (function (FindAIModelCommand) {
8
+ FindAIModelCommand.RequestSchema = models_1.AiModelSchema.pick({
9
+ uuid: true,
10
+ });
11
+ FindAIModelCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.array(models_1.AiModelSchema),
13
+ });
14
+ FindAIModelCommand.ResponseByUUIDSchema = zod_1.z.object({
15
+ data: models_1.AiModelSchema,
16
+ });
17
+ })(FindAIModelCommand || (exports.FindAIModelCommand = FindAIModelCommand = {}));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./update-ai-model.command"), exports);
18
+ __exportStar(require("./delete-ai-model.command"), exports);
19
+ __exportStar(require("./create-ai-model.command"), exports);
20
+ __exportStar(require("./find-ai-model.command"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateAIModelCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var UpdateAIModelCommand;
7
+ (function (UpdateAIModelCommand) {
8
+ UpdateAIModelCommand.RequestSchema = models_1.AiModelSchema.omit({
9
+ createdAt: true,
10
+ updatedAt: true,
11
+ uuid: true,
12
+ }).partial();
13
+ UpdateAIModelCommand.RequestParamSchema = zod_1.z.object({
14
+ uuid: zod_1.z.string().uuid(),
15
+ });
16
+ UpdateAIModelCommand.ResponseSchema = zod_1.z.object({
17
+ data: models_1.AiModelSchema,
18
+ });
19
+ })(UpdateAIModelCommand || (exports.UpdateAIModelCommand = UpdateAIModelCommand = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateUserCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var CreateUserCommand;
7
+ (function (CreateUserCommand) {
8
+ CreateUserCommand.RequestSchema = models_1.UserSchema.pick({
9
+ email: true,
10
+ });
11
+ CreateUserCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.UserSchema.pick({
13
+ uuid: true,
14
+ }),
15
+ });
16
+ })(CreateUserCommand || (exports.CreateUserCommand = CreateUserCommand = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./reset-paasword.command"), exports);
18
+ __exportStar(require("./restore-password.command"), exports);
19
+ __exportStar(require("./login.command"), exports);
20
+ __exportStar(require("./register-user.command"), exports);
21
+ __exportStar(require("./create-user.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoginCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var LoginCommand;
7
+ (function (LoginCommand) {
8
+ LoginCommand.RequestSchema = models_1.UserSchema.pick({
9
+ email: true,
10
+ password: true,
11
+ });
12
+ LoginCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.object({
14
+ accessToken: zod_1.z.string(),
15
+ }),
16
+ });
17
+ })(LoginCommand || (exports.LoginCommand = LoginCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterUserCommand = void 0;
4
+ const models_1 = require("../../models");
5
+ const zod_1 = require("zod");
6
+ var RegisterUserCommand;
7
+ (function (RegisterUserCommand) {
8
+ RegisterUserCommand.RequestSchema = models_1.UserSchema.pick({
9
+ email: true,
10
+ password: true,
11
+ });
12
+ RegisterUserCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.object({
14
+ accessToken: zod_1.z.string(),
15
+ }),
16
+ });
17
+ })(RegisterUserCommand || (exports.RegisterUserCommand = RegisterUserCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResetPasswordCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var ResetPasswordCommand;
7
+ (function (ResetPasswordCommand) {
8
+ ResetPasswordCommand.RequestSchema = models_1.UserSchema.pick({
9
+ restoreTokenHash: true,
10
+ }).extend({
11
+ newPassword: zod_1.z.string(),
12
+ userId: zod_1.z.string(),
13
+ });
14
+ ResetPasswordCommand.ResponseSchema = zod_1.z.object({
15
+ data: zod_1.z.object({
16
+ isSuccess: zod_1.z.boolean(),
17
+ }),
18
+ });
19
+ })(ResetPasswordCommand || (exports.ResetPasswordCommand = ResetPasswordCommand = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RestorePasswordCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var RestorePasswordCommand;
7
+ (function (RestorePasswordCommand) {
8
+ RestorePasswordCommand.RequestSchema = models_1.UserSchema.pick({
9
+ email: true,
10
+ });
11
+ RestorePasswordCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.object({
13
+ message: zod_1.z.string(),
14
+ }),
15
+ });
16
+ })(RestorePasswordCommand || (exports.RestorePasswordCommand = RestorePasswordCommand = {}));
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_schema_1 = require("../../models/category.schema");
6
+ var CreateCategoryCommand;
7
+ (function (CreateCategoryCommand) {
8
+ CreateCategoryCommand.RequestSchema = category_schema_1.CategorySchema.omit({
9
+ uuid: true,
10
+ createdAt: true,
11
+ updatedAt: true,
12
+ });
13
+ CreateCategoryCommand.ResponseSchema = zod_1.z.object({
14
+ data: category_schema_1.CategorySchema,
15
+ });
16
+ })(CreateCategoryCommand || (exports.CreateCategoryCommand = CreateCategoryCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_schema_1 = require("../../models/category.schema");
6
+ var DeleteCategoryCommand;
7
+ (function (DeleteCategoryCommand) {
8
+ DeleteCategoryCommand.RequestSchema = category_schema_1.CategorySchema.pick({
9
+ uuid: true,
10
+ });
11
+ DeleteCategoryCommand.ResponseSchema = zod_1.z.object({
12
+ isDeleted: zod_1.z.boolean(),
13
+ });
14
+ })(DeleteCategoryCommand || (exports.DeleteCategoryCommand = DeleteCategoryCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindCategoryCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const category_schema_1 = require("../../models/category.schema");
6
+ var FindCategoryCommand;
7
+ (function (FindCategoryCommand) {
8
+ FindCategoryCommand.RequestSchema = category_schema_1.CategorySchema.pick({
9
+ uuid: true,
10
+ });
11
+ FindCategoryCommand.ResponseSchema = zod_1.z.object({
12
+ data: zod_1.z.array(category_schema_1.CategorySchema),
13
+ });
14
+ FindCategoryCommand.ResponseByUUIDSchema = zod_1.z.object({
15
+ data: category_schema_1.CategorySchema,
16
+ });
17
+ })(FindCategoryCommand || (exports.FindCategoryCommand = FindCategoryCommand = {}));