@purpleschool/gptbot 0.5.95 → 0.5.97

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 (43) hide show
  1. package/api/controllers/http/files.ts +1 -0
  2. package/api/controllers/http/index.ts +1 -0
  3. package/api/controllers/http/review.ts +7 -0
  4. package/api/controllers/http/stt.ts +1 -0
  5. package/api/controllers/http/tts.ts +1 -0
  6. package/api/routes.ts +7 -0
  7. package/build/api/controllers/http/files.js +2 -1
  8. package/build/api/controllers/http/index.js +1 -0
  9. package/build/api/controllers/http/review.js +9 -0
  10. package/build/api/controllers/http/stt.js +1 -0
  11. package/build/api/controllers/http/tts.js +1 -0
  12. package/build/api/routes.js +7 -0
  13. package/build/commands/index.js +1 -0
  14. package/build/commands/review/create-review.command.js +17 -0
  15. package/build/commands/review/find-reviews.command.js +20 -0
  16. package/build/commands/review/index.js +18 -0
  17. package/build/commands/tools/stt/index.js +1 -0
  18. package/build/commands/tools/stt/retry-stt-job.command.js +14 -0
  19. package/build/commands/tools/tts/index.js +1 -0
  20. package/build/commands/tools/tts/retry-tts-job.command.js +14 -0
  21. package/build/constants/errors/errors.js +30 -0
  22. package/build/constants/index.js +1 -0
  23. package/build/constants/review/enums/index.js +17 -0
  24. package/build/constants/review/enums/review-status.enum.js +10 -0
  25. package/build/constants/review/index.js +17 -0
  26. package/build/models/index.js +1 -0
  27. package/build/models/review.schema.js +13 -0
  28. package/commands/index.ts +1 -0
  29. package/commands/review/create-review.command.ts +19 -0
  30. package/commands/review/find-reviews.command.ts +19 -0
  31. package/commands/review/index.ts +2 -0
  32. package/commands/tools/stt/index.ts +1 -0
  33. package/commands/tools/stt/retry-stt-job.command.ts +14 -0
  34. package/commands/tools/tts/index.ts +1 -0
  35. package/commands/tools/tts/retry-tts-job.command.ts +14 -0
  36. package/constants/errors/errors.ts +30 -0
  37. package/constants/index.ts +1 -0
  38. package/constants/review/enums/index.ts +1 -0
  39. package/constants/review/enums/review-status.enum.ts +6 -0
  40. package/constants/review/index.ts +1 -0
  41. package/models/index.ts +1 -0
  42. package/models/review.schema.ts +12 -0
  43. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  export const FILE_CONTROLLER = 'file' as const;
2
+ export const FILE_PUBLIC_CONTROLLER = 'public/file' as const;
2
3
 
3
4
  export const FILE_ROUTES = {
4
5
  DELETE: (uuid: string) => `${uuid}`,
@@ -35,3 +35,4 @@ export * from './user-to-task-public';
35
35
  export * from './user';
36
36
  export * from './promocode';
37
37
  export * from './ui-notification';
38
+ export * from './review';
@@ -0,0 +1,7 @@
1
+ export const REVIEW_PUBLIC_CONTROLLER = 'public/review' as const;
2
+ export const REVIEW_PRIVATE_CONTROLLER = 'private/review' as const;
3
+
4
+ export const REVIEW_ROUTES = {
5
+ CREATE: '',
6
+ FIND: 'find',
7
+ } as const;
@@ -10,4 +10,5 @@ export const STT_ROUTES = {
10
10
  UPDATE: (uuid: string) => `jobs/${uuid}`,
11
11
  DELETE: (uuid: string) => `jobs/${uuid}`,
12
12
  DELETE_ALL: 'jobs',
13
+ RETRY: (uuid: string) => `jobs/${uuid}/retry`,
13
14
  } as const;
@@ -10,4 +10,5 @@ export const TTS_ROUTES = {
10
10
  SET_REACTION: (uuid: string) => `jobs/${uuid}/reaction`,
11
11
  DELETE: (uuid: string) => `jobs/${uuid}`,
12
12
  DELETE_ALL: 'jobs',
13
+ RETRY: (uuid: string) => `jobs/${uuid}/retry`,
13
14
  } as const;
package/api/routes.ts CHANGED
@@ -184,4 +184,11 @@ export const REST_API = {
184
184
  `${ROOT}/${CONTROLLERS.TELEGRAM_AUTH_CONTROLLER}/${CONTROLLERS.TELEGRAM_AUTH_ROUTES.STATUS(uuid)}`,
185
185
  REDEEM: `${ROOT}/${CONTROLLERS.TELEGRAM_AUTH_CONTROLLER}/${CONTROLLERS.TELEGRAM_AUTH_ROUTES.REDEEM}`,
186
186
  },
187
+ REVIEW_PUBLIC: {
188
+ CREATE: `${ROOT}/${CONTROLLERS.REVIEW_PUBLIC_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.CREATE}`,
189
+ FIND: `${ROOT}/${CONTROLLERS.REVIEW_PUBLIC_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.FIND}`,
190
+ },
191
+ REVIEW_PRIVATE: {
192
+ CREATE: `${ROOT}/${CONTROLLERS.REVIEW_PRIVATE_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.CREATE}`,
193
+ },
187
194
  } as const;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FILE_ROUTES = exports.FILE_CONTROLLER = void 0;
3
+ exports.FILE_ROUTES = exports.FILE_PUBLIC_CONTROLLER = exports.FILE_CONTROLLER = void 0;
4
4
  exports.FILE_CONTROLLER = 'file';
5
+ exports.FILE_PUBLIC_CONTROLLER = 'public/file';
5
6
  exports.FILE_ROUTES = {
6
7
  DELETE: (uuid) => `${uuid}`,
7
8
  UPLOAD: 'upload',
@@ -51,3 +51,4 @@ __exportStar(require("./user-to-task-public"), exports);
51
51
  __exportStar(require("./user"), exports);
52
52
  __exportStar(require("./promocode"), exports);
53
53
  __exportStar(require("./ui-notification"), exports);
54
+ __exportStar(require("./review"), exports);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REVIEW_ROUTES = exports.REVIEW_PRIVATE_CONTROLLER = exports.REVIEW_PUBLIC_CONTROLLER = void 0;
4
+ exports.REVIEW_PUBLIC_CONTROLLER = 'public/review';
5
+ exports.REVIEW_PRIVATE_CONTROLLER = 'private/review';
6
+ exports.REVIEW_ROUTES = {
7
+ CREATE: '',
8
+ FIND: 'find',
9
+ };
@@ -12,4 +12,5 @@ exports.STT_ROUTES = {
12
12
  UPDATE: (uuid) => `jobs/${uuid}`,
13
13
  DELETE: (uuid) => `jobs/${uuid}`,
14
14
  DELETE_ALL: 'jobs',
15
+ RETRY: (uuid) => `jobs/${uuid}/retry`,
15
16
  };
@@ -12,4 +12,5 @@ exports.TTS_ROUTES = {
12
12
  SET_REACTION: (uuid) => `jobs/${uuid}/reaction`,
13
13
  DELETE: (uuid) => `jobs/${uuid}`,
14
14
  DELETE_ALL: 'jobs',
15
+ RETRY: (uuid) => `jobs/${uuid}/retry`,
15
16
  };
@@ -185,4 +185,11 @@ exports.REST_API = {
185
185
  STATUS: (uuid) => `${exports.ROOT}/${CONTROLLERS.TELEGRAM_AUTH_CONTROLLER}/${CONTROLLERS.TELEGRAM_AUTH_ROUTES.STATUS(uuid)}`,
186
186
  REDEEM: `${exports.ROOT}/${CONTROLLERS.TELEGRAM_AUTH_CONTROLLER}/${CONTROLLERS.TELEGRAM_AUTH_ROUTES.REDEEM}`,
187
187
  },
188
+ REVIEW_PUBLIC: {
189
+ CREATE: `${exports.ROOT}/${CONTROLLERS.REVIEW_PUBLIC_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.CREATE}`,
190
+ FIND: `${exports.ROOT}/${CONTROLLERS.REVIEW_PUBLIC_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.FIND}`,
191
+ },
192
+ REVIEW_PRIVATE: {
193
+ CREATE: `${exports.ROOT}/${CONTROLLERS.REVIEW_PRIVATE_CONTROLLER}/${CONTROLLERS.REVIEW_ROUTES.CREATE}`,
194
+ },
188
195
  };
@@ -45,3 +45,4 @@ __exportStar(require("./user-to-subscription"), exports);
45
45
  __exportStar(require("./user-to-task"), exports);
46
46
  __exportStar(require("./promocode"), exports);
47
47
  __exportStar(require("./ui-notification"), exports);
48
+ __exportStar(require("./review"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateReviewCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var CreateReviewCommand;
7
+ (function (CreateReviewCommand) {
8
+ CreateReviewCommand.RequestSchema = models_1.ReviewSchema.pick({
9
+ email: true,
10
+ name: true,
11
+ text: true,
12
+ rating: true,
13
+ });
14
+ CreateReviewCommand.ResponseSchema = zod_1.z.object({
15
+ data: models_1.ReviewSchema,
16
+ });
17
+ })(CreateReviewCommand || (exports.CreateReviewCommand = CreateReviewCommand = {}));
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FindReviewsCommand = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ const models_1 = require("../../models");
9
+ var FindReviewsCommand;
10
+ (function (FindReviewsCommand) {
11
+ FindReviewsCommand.RequestSchema = zod_1.default.object({
12
+ limit: zod_1.default.string().transform((val) => parseInt(val, 10)),
13
+ offset: zod_1.default.string().transform((val) => parseInt(val, 10)),
14
+ });
15
+ FindReviewsCommand.ResponseSchema = zod_1.default.object({
16
+ data: zod_1.default.array(models_1.ReviewSchema),
17
+ totalPages: zod_1.default.number(),
18
+ page: zod_1.default.number(),
19
+ });
20
+ })(FindReviewsCommand || (exports.FindReviewsCommand = FindReviewsCommand = {}));
@@ -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("./create-review.command"), exports);
18
+ __exportStar(require("./find-reviews.command"), exports);
@@ -19,6 +19,7 @@ __exportStar(require("./delete-stt-job-by-uuid.command"), exports);
19
19
  __exportStar(require("./find-stt-job-by-uuid.command"), exports);
20
20
  __exportStar(require("./find-stt-jobs.command"), exports);
21
21
  __exportStar(require("./get-stt-tool-config.command"), exports);
22
+ __exportStar(require("./retry-stt-job.command"), exports);
22
23
  __exportStar(require("./set-reaction-to-stt-job.command"), exports);
23
24
  __exportStar(require("./stt.command"), exports);
24
25
  __exportStar(require("./update-stt-job-title.command"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetrySTTJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var RetrySTTJobCommand;
7
+ (function (RetrySTTJobCommand) {
8
+ RetrySTTJobCommand.RequestParamsSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ RetrySTTJobCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.STTJobSchema,
13
+ });
14
+ })(RetrySTTJobCommand || (exports.RetrySTTJobCommand = RetrySTTJobCommand = {}));
@@ -19,6 +19,7 @@ __exportStar(require("./delete-tts-job-by-uuid.command"), exports);
19
19
  __exportStar(require("./find-tts-job-by-uuid.command"), exports);
20
20
  __exportStar(require("./find-tts-jobs.command"), exports);
21
21
  __exportStar(require("./get-tts-tool-config.command"), exports);
22
+ __exportStar(require("./retry-tts-job.command"), exports);
22
23
  __exportStar(require("./set-reaction-to-tts-job.command"), exports);
23
24
  __exportStar(require("./tts.command"), exports);
24
25
  __exportStar(require("./update-tts-job-title.command"), exports);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryTTSJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var RetryTTSJobCommand;
7
+ (function (RetryTTSJobCommand) {
8
+ RetryTTSJobCommand.RequestParamsSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ RetryTTSJobCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.TTSJobSchema,
13
+ });
14
+ })(RetryTTSJobCommand || (exports.RetryTTSJobCommand = RetryTTSJobCommand = {}));
@@ -1308,4 +1308,34 @@ exports.ERRORS = {
1308
1308
  message: 'Произошла ошибка при поиске формы',
1309
1309
  httpCode: 500,
1310
1310
  },
1311
+ TTS_RETRY_REQUEST_ERROR: {
1312
+ code: 'TTS001',
1313
+ message: 'Произошла ошибка при повторном запросе TTS',
1314
+ httpCode: 500,
1315
+ },
1316
+ STT_RETRY_REQUEST_ERROR: {
1317
+ code: 'STT001',
1318
+ message: 'Произошла ошибка при повторном запросе STT',
1319
+ httpCode: 500,
1320
+ },
1321
+ REVIEW_CREATE_ERROR: {
1322
+ code: 'A287',
1323
+ message: 'Произошла ошибка при создании отзыва',
1324
+ httpCode: 500,
1325
+ },
1326
+ REVIEW_UPDATE_ERROR: {
1327
+ code: 'A288',
1328
+ message: 'Произошла ошибка при обновлении отзыва',
1329
+ httpCode: 500,
1330
+ },
1331
+ REVIEW_DELETE_ERROR: {
1332
+ code: 'A289',
1333
+ message: 'Произошла ошибка при удалении отзыва',
1334
+ httpCode: 500,
1335
+ },
1336
+ REVIEWS_FIND_ERROR: {
1337
+ code: 'A290',
1338
+ message: 'Отзывы не найдены',
1339
+ httpCode: 404,
1340
+ },
1311
1341
  };
@@ -44,3 +44,4 @@ __exportStar(require("./unregistered-user"), exports);
44
44
  __exportStar(require("./user"), exports);
45
45
  __exportStar(require("./promocode"), exports);
46
46
  __exportStar(require("./ui-notification"), exports);
47
+ __exportStar(require("./review"), exports);
@@ -0,0 +1,17 @@
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("./review-status.enum"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REVIEW_STATUS = void 0;
4
+ var REVIEW_STATUS;
5
+ (function (REVIEW_STATUS) {
6
+ REVIEW_STATUS["NEW"] = "new";
7
+ REVIEW_STATUS["ON_MODERATION"] = "on_moderation";
8
+ REVIEW_STATUS["ACTIVE"] = "active";
9
+ REVIEW_STATUS["HIDDEN"] = "hidden";
10
+ })(REVIEW_STATUS || (exports.REVIEW_STATUS = REVIEW_STATUS = {}));
@@ -0,0 +1,17 @@
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("./enums"), exports);
@@ -56,3 +56,4 @@ __exportStar(require("./user-to-subscription.schema"), exports);
56
56
  __exportStar(require("./user.schema"), exports);
57
57
  __exportStar(require("./utm.schema"), exports);
58
58
  __exportStar(require("./ui-notification.schema"), exports);
59
+ __exportStar(require("./review.schema"), exports);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReviewSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ReviewSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ email: zod_1.z.string().email(),
8
+ name: zod_1.z.string(),
9
+ text: zod_1.z.string(),
10
+ rating: zod_1.z.number().int().step(1).min(0).max(5),
11
+ createdAt: zod_1.z.date(),
12
+ updatedAt: zod_1.z.date(),
13
+ });
package/commands/index.ts CHANGED
@@ -29,3 +29,4 @@ export * from './user-to-subscription';
29
29
  export * from './user-to-task';
30
30
  export * from './promocode';
31
31
  export * from './ui-notification';
32
+ export * from './review';
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { ReviewSchema } from '../../models';
3
+
4
+ export namespace CreateReviewCommand {
5
+ export const RequestSchema = ReviewSchema.pick({
6
+ email: true,
7
+ name: true,
8
+ text: true,
9
+ rating: true,
10
+ });
11
+
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: ReviewSchema,
16
+ });
17
+
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,19 @@
1
+ import z from 'zod';
2
+ import { ReviewSchema } from '../../models';
3
+
4
+ export namespace FindReviewsCommand {
5
+ export const RequestSchema = z.object({
6
+ limit: z.string().transform((val) => parseInt(val, 10)),
7
+ offset: z.string().transform((val) => parseInt(val, 10)),
8
+ });
9
+
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(ReviewSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,2 @@
1
+ export * from './create-review.command';
2
+ export * from './find-reviews.command';
@@ -3,6 +3,7 @@ export * from './delete-stt-job-by-uuid.command';
3
3
  export * from './find-stt-job-by-uuid.command';
4
4
  export * from './find-stt-jobs.command';
5
5
  export * from './get-stt-tool-config.command';
6
+ export * from './retry-stt-job.command';
6
7
  export * from './set-reaction-to-stt-job.command';
7
8
  export * from './stt.command';
8
9
  export * from './update-stt-job-title.command';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { STTJobSchema } from '../../../models';
3
+
4
+ export namespace RetrySTTJobCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: STTJobSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -3,6 +3,7 @@ export * from './delete-tts-job-by-uuid.command';
3
3
  export * from './find-tts-job-by-uuid.command';
4
4
  export * from './find-tts-jobs.command';
5
5
  export * from './get-tts-tool-config.command';
6
+ export * from './retry-tts-job.command';
6
7
  export * from './set-reaction-to-tts-job.command';
7
8
  export * from './tts.command';
8
9
  export * from './update-tts-job-title.command';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { TTSJobSchema } from '../../../models';
3
+
4
+ export namespace RetryTTSJobCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: TTSJobSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -1314,4 +1314,34 @@ export const ERRORS = {
1314
1314
  message: 'Произошла ошибка при поиске формы',
1315
1315
  httpCode: 500,
1316
1316
  },
1317
+ TTS_RETRY_REQUEST_ERROR: {
1318
+ code: 'TTS001',
1319
+ message: 'Произошла ошибка при повторном запросе TTS',
1320
+ httpCode: 500,
1321
+ },
1322
+ STT_RETRY_REQUEST_ERROR: {
1323
+ code: 'STT001',
1324
+ message: 'Произошла ошибка при повторном запросе STT',
1325
+ httpCode: 500,
1326
+ },
1327
+ REVIEW_CREATE_ERROR: {
1328
+ code: 'A287',
1329
+ message: 'Произошла ошибка при создании отзыва',
1330
+ httpCode: 500,
1331
+ },
1332
+ REVIEW_UPDATE_ERROR: {
1333
+ code: 'A288',
1334
+ message: 'Произошла ошибка при обновлении отзыва',
1335
+ httpCode: 500,
1336
+ },
1337
+ REVIEW_DELETE_ERROR: {
1338
+ code: 'A289',
1339
+ message: 'Произошла ошибка при удалении отзыва',
1340
+ httpCode: 500,
1341
+ },
1342
+ REVIEWS_FIND_ERROR: {
1343
+ code: 'A290',
1344
+ message: 'Отзывы не найдены',
1345
+ httpCode: 404,
1346
+ },
1317
1347
  };
@@ -28,3 +28,4 @@ export * from './unregistered-user';
28
28
  export * from './user';
29
29
  export * from './promocode';
30
30
  export * from './ui-notification';
31
+ export * from './review';
@@ -0,0 +1 @@
1
+ export * from './review-status.enum';
@@ -0,0 +1,6 @@
1
+ export enum REVIEW_STATUS {
2
+ NEW = 'new',
3
+ ON_MODERATION = 'on_moderation',
4
+ ACTIVE = 'active',
5
+ HIDDEN = 'hidden',
6
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
package/models/index.ts CHANGED
@@ -40,3 +40,4 @@ export * from './user-to-subscription.schema';
40
40
  export * from './user.schema';
41
41
  export * from './utm.schema';
42
42
  export * from './ui-notification.schema';
43
+ export * from './review.schema';
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ export const ReviewSchema = z.object({
4
+ uuid: z.string().uuid(),
5
+ email: z.string().email(),
6
+ name: z.string(),
7
+ text: z.string(),
8
+ rating: z.number().int().step(1).min(0).max(5),
9
+
10
+ createdAt: z.date(),
11
+ updatedAt: z.date(),
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.5.95",
3
+ "version": "0.5.97",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",