@purpleschool/gptbot 0.5.69 → 0.5.71
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.
- package/api/controllers/http/index.ts +3 -0
- package/api/controllers/http/tool-job.ts +5 -0
- package/api/controllers/http/tool-paraphrase.ts +8 -0
- package/api/controllers/http/tool.ts +5 -0
- package/build/api/controllers/http/index.js +3 -0
- package/build/api/controllers/http/tool-job.js +7 -0
- package/build/api/controllers/http/tool-paraphrase.js +10 -0
- package/build/api/controllers/http/tool.js +7 -0
- package/build/commands/index.js +2 -0
- package/build/commands/tool/find-all-tools.command.js +11 -0
- package/build/commands/tool/index.js +17 -0
- package/build/commands/tools-paraphrase/find-paraphrase-job-by-uuid.command.js +14 -0
- package/build/commands/tools-paraphrase/get-paraphrase-tool-config.command.js +11 -0
- package/build/commands/tools-paraphrase/index.js +19 -0
- package/build/commands/tools-paraphrase/paraphrase.command.js +18 -0
- package/build/constants/errors/errors.js +57 -3
- package/build/constants/index.js +2 -0
- package/build/constants/tool/enums/index.js +18 -0
- package/build/constants/tool/enums/tool-job-status.enum.js +9 -0
- package/build/constants/tool/enums/tool-type.enum.js +7 -0
- package/build/constants/tool/index.js +17 -0
- package/build/constants/tool-paraphrase/enums/index.js +17 -0
- package/build/constants/tool-paraphrase/enums/paraphrasing-intesity.enum.js +9 -0
- package/build/constants/tool-paraphrase/index.js +17 -0
- package/build/models/index.js +6 -0
- package/build/models/tool-job.schema.js +12 -0
- package/build/models/tool-paraphrase-config.schema.js +11 -0
- package/build/models/tool-paraphrase-job.schema.js +11 -0
- package/build/models/tool-paraphrase-model.schema.js +11 -0
- package/build/models/tool-paraphrase-style.schema.js +10 -0
- package/build/models/tool.schema.js +11 -0
- package/build/models/ui-notification.schema.js +4 -3
- package/commands/index.ts +2 -0
- package/commands/tool/find-all-tools.command.ts +10 -0
- package/commands/tool/index.ts +1 -0
- package/commands/tools-paraphrase/find-paraphrase-job-by-uuid.command.ts +16 -0
- package/commands/tools-paraphrase/get-paraphrase-tool-config.command.ts +10 -0
- package/commands/tools-paraphrase/index.ts +3 -0
- package/commands/tools-paraphrase/paraphrase.command.ts +20 -0
- package/constants/errors/errors.ts +58 -3
- package/constants/index.ts +2 -0
- package/constants/tool/enums/index.ts +2 -0
- package/constants/tool/enums/tool-job-status.enum.ts +5 -0
- package/constants/tool/enums/tool-type.enum.ts +3 -0
- package/constants/tool/index.ts +1 -0
- package/constants/tool-paraphrase/enums/index.ts +1 -0
- package/constants/tool-paraphrase/enums/paraphrasing-intesity.enum.ts +5 -0
- package/constants/tool-paraphrase/index.ts +1 -0
- package/models/index.ts +6 -0
- package/models/tool-job.schema.ts +10 -0
- package/models/tool-paraphrase-config.schema.ts +9 -0
- package/models/tool-paraphrase-job.schema.ts +9 -0
- package/models/tool-paraphrase-model.schema.ts +9 -0
- package/models/tool-paraphrase-style.schema.ts +8 -0
- package/models/tool.schema.ts +9 -0
- package/models/ui-notification.schema.ts +8 -4
- package/package.json +1 -1
|
@@ -21,6 +21,9 @@ export * from './task';
|
|
|
21
21
|
export * from './telegram-auth';
|
|
22
22
|
export * from './telegram-connect';
|
|
23
23
|
export * from './telegram-profile';
|
|
24
|
+
export * from './tool-job';
|
|
25
|
+
export * from './tool-paraphrase';
|
|
26
|
+
export * from './tool';
|
|
24
27
|
export * from './unregistered-user';
|
|
25
28
|
export * from './user-to-task-private';
|
|
26
29
|
export * from './user-to-task-public';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const PARAPHRASE_CONTROLLER_PRIVATE = 'private/tools/paraphrase' as const;
|
|
2
|
+
export const PARAPHRASE_CONTROLLER_PUBLIC = 'public/tools/paraphrase' as const;
|
|
3
|
+
|
|
4
|
+
export const PARAPHRASE_ROUTES = {
|
|
5
|
+
CONFIG: 'config',
|
|
6
|
+
EXECUTE: 'execute',
|
|
7
|
+
GET_JOB: (uuid: string) => `jobs/${uuid}`,
|
|
8
|
+
} as const;
|
|
@@ -37,6 +37,9 @@ __exportStar(require("./task"), exports);
|
|
|
37
37
|
__exportStar(require("./telegram-auth"), exports);
|
|
38
38
|
__exportStar(require("./telegram-connect"), exports);
|
|
39
39
|
__exportStar(require("./telegram-profile"), exports);
|
|
40
|
+
__exportStar(require("./tool-job"), exports);
|
|
41
|
+
__exportStar(require("./tool-paraphrase"), exports);
|
|
42
|
+
__exportStar(require("./tool"), exports);
|
|
40
43
|
__exportStar(require("./unregistered-user"), exports);
|
|
41
44
|
__exportStar(require("./user-to-task-private"), exports);
|
|
42
45
|
__exportStar(require("./user-to-task-public"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_JOB_ROUTES = exports.TOOL_JOB_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.TOOL_JOB_CONTROLLER_PRIVATE = 'private/tools/jobs';
|
|
5
|
+
exports.TOOL_JOB_ROUTES = {
|
|
6
|
+
FIND_BY_UUID: (uuid) => `${uuid}`,
|
|
7
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PARAPHRASE_ROUTES = exports.PARAPHRASE_CONTROLLER_PUBLIC = exports.PARAPHRASE_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.PARAPHRASE_CONTROLLER_PRIVATE = 'private/tools/paraphrase';
|
|
5
|
+
exports.PARAPHRASE_CONTROLLER_PUBLIC = 'public/tools/paraphrase';
|
|
6
|
+
exports.PARAPHRASE_ROUTES = {
|
|
7
|
+
CONFIG: 'config',
|
|
8
|
+
EXECUTE: 'execute',
|
|
9
|
+
GET_JOB: (uuid) => `jobs/${uuid}`,
|
|
10
|
+
};
|
package/build/commands/index.js
CHANGED
|
@@ -35,6 +35,8 @@ __exportStar(require("./task"), exports);
|
|
|
35
35
|
__exportStar(require("./telegram"), exports);
|
|
36
36
|
__exportStar(require("./telegram-auth"), exports);
|
|
37
37
|
__exportStar(require("./telegram-profile"), exports);
|
|
38
|
+
__exportStar(require("./tool"), exports);
|
|
39
|
+
__exportStar(require("./tools-paraphrase"), exports);
|
|
38
40
|
__exportStar(require("./unregistered-user"), exports);
|
|
39
41
|
__exportStar(require("./user"), exports);
|
|
40
42
|
__exportStar(require("./user-to-subscription"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAllToolsCommand = void 0;
|
|
4
|
+
const models_1 = require("../../models");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
var FindAllToolsCommand;
|
|
7
|
+
(function (FindAllToolsCommand) {
|
|
8
|
+
FindAllToolsCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.ToolSchema),
|
|
10
|
+
});
|
|
11
|
+
})(FindAllToolsCommand || (exports.FindAllToolsCommand = FindAllToolsCommand = {}));
|
|
@@ -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("./find-all-tools.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindParaphraseJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_paraphrase_job_schema_1 = require("../../models/tool-paraphrase-job.schema");
|
|
6
|
+
var FindParaphraseJobByUUIDCommand;
|
|
7
|
+
(function (FindParaphraseJobByUUIDCommand) {
|
|
8
|
+
FindParaphraseJobByUUIDCommand.RequestParamsSchema = tool_paraphrase_job_schema_1.ParaphraseToolJobSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
FindParaphraseJobByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: tool_paraphrase_job_schema_1.ParaphraseToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindParaphraseJobByUUIDCommand || (exports.FindParaphraseJobByUUIDCommand = FindParaphraseJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetParaphraseToolConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var GetParaphraseToolConfigCommand;
|
|
7
|
+
(function (GetParaphraseToolConfigCommand) {
|
|
8
|
+
GetParaphraseToolConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: models_1.ParaphraseToolConfigSchema,
|
|
10
|
+
});
|
|
11
|
+
})(GetParaphraseToolConfigCommand || (exports.GetParaphraseToolConfigCommand = GetParaphraseToolConfigCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./find-paraphrase-job-by-uuid.command"), exports);
|
|
18
|
+
__exportStar(require("./get-paraphrase-tool-config.command"), exports);
|
|
19
|
+
__exportStar(require("./paraphrase.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParaphraseCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var ParaphraseCommand;
|
|
8
|
+
(function (ParaphraseCommand) {
|
|
9
|
+
ParaphraseCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
styleId: zod_1.z.string().uuid(),
|
|
11
|
+
typeId: zod_1.z.string().uuid(),
|
|
12
|
+
prompt: zod_1.z.string().min(1).max(10000),
|
|
13
|
+
intensity: zod_1.z.nativeEnum(constants_1.PARAPHRASING_INTENSITY),
|
|
14
|
+
});
|
|
15
|
+
ParaphraseCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.ToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
})(ParaphraseCommand || (exports.ParaphraseCommand = ParaphraseCommand = {}));
|
|
@@ -23,7 +23,11 @@ exports.ERRORS = {
|
|
|
23
23
|
REGISTER_ERROR: { code: 'U01', message: 'Произошла ошибка при регистрации', httpCode: 500 },
|
|
24
24
|
REGISTER_CONFLICT: { code: 'U04', message: 'Пользователь уже зарегистрирован', httpCode: 409 },
|
|
25
25
|
USER_NOT_FOUND: { code: 'A002', message: 'Пользователь не найден', httpCode: 404 },
|
|
26
|
-
USER_CONFLICT: {
|
|
26
|
+
USER_CONFLICT: {
|
|
27
|
+
code: 'A003',
|
|
28
|
+
message: 'Пользователь с таким email уже существует',
|
|
29
|
+
httpCode: 409,
|
|
30
|
+
},
|
|
27
31
|
USER_NOT_CREATED: {
|
|
28
32
|
code: 'A004',
|
|
29
33
|
message: 'Произошла ошибка при создании пользователя',
|
|
@@ -1001,13 +1005,63 @@ exports.ERRORS = {
|
|
|
1001
1005
|
httpCode: 500,
|
|
1002
1006
|
},
|
|
1003
1007
|
UNREGISTERED_SESSION_INIT_ERROR: {
|
|
1004
|
-
code: '
|
|
1008
|
+
code: 'A226',
|
|
1005
1009
|
message: 'Произошла ошибка при инициализации сессии для незарегистрированного пользователя',
|
|
1006
1010
|
httpCode: 500,
|
|
1007
1011
|
},
|
|
1008
1012
|
EMAIL_VERIFICATION_CODE_INVALID: {
|
|
1009
|
-
code: '
|
|
1013
|
+
code: 'A227',
|
|
1010
1014
|
message: 'Ссылка для подтверждения недействительна или устарела. Пожалуйста, попробуйте позже',
|
|
1011
1015
|
httpCode: 400,
|
|
1012
1016
|
},
|
|
1017
|
+
PROMOCODE_INVALID_ERROR: {
|
|
1018
|
+
code: 'A228',
|
|
1019
|
+
message: 'Промокод не может быть применен',
|
|
1020
|
+
httpCode: 422,
|
|
1021
|
+
},
|
|
1022
|
+
TOOL_JOB_CREATE_ERROR: {
|
|
1023
|
+
code: 'A229',
|
|
1024
|
+
message: 'Произошла ошибка при создании запроса к инструменту',
|
|
1025
|
+
httpCode: 500,
|
|
1026
|
+
},
|
|
1027
|
+
PARAPHRASE_CONFIG_ERROR: {
|
|
1028
|
+
code: 'A230',
|
|
1029
|
+
message: 'Произошла ошибка при получении информации об инструменте для перефразирования текста',
|
|
1030
|
+
httpCode: 500,
|
|
1031
|
+
},
|
|
1032
|
+
TOOL_JOB_FIND_ERROR: {
|
|
1033
|
+
code: 'A231',
|
|
1034
|
+
message: 'Произошла ошибка при поиске запроса к инструменту',
|
|
1035
|
+
httpCode: 500,
|
|
1036
|
+
},
|
|
1037
|
+
TOOL_JOB_NOT_FOUND: {
|
|
1038
|
+
code: 'A232',
|
|
1039
|
+
message: 'Запрос к инструменту не найден',
|
|
1040
|
+
httpCode: 404,
|
|
1041
|
+
},
|
|
1042
|
+
TOOL_INVALID_TYPE: {
|
|
1043
|
+
code: 'A233',
|
|
1044
|
+
message: 'Неверный тип инструмента',
|
|
1045
|
+
httpCode: 400,
|
|
1046
|
+
},
|
|
1047
|
+
TOOL_JOB_UNAUTHORIZED: {
|
|
1048
|
+
code: 'A234',
|
|
1049
|
+
message: 'Пользователь не имеет доступ к данному запросу',
|
|
1050
|
+
httpCode: 401,
|
|
1051
|
+
},
|
|
1052
|
+
TOOL_FIND_ERROR: {
|
|
1053
|
+
code: 'A235',
|
|
1054
|
+
message: 'Произошла ошибка при поиске инструмента',
|
|
1055
|
+
httpCode: 500,
|
|
1056
|
+
},
|
|
1057
|
+
PARAPHRASE_SEND_REQUEST_ERROR: {
|
|
1058
|
+
code: 'A236',
|
|
1059
|
+
message: 'Произошла ошибка при отпраке запроса к инструменту для перефразирования',
|
|
1060
|
+
httpCode: 500,
|
|
1061
|
+
},
|
|
1062
|
+
PARAPHRASE_REQUEST_TOO_LONG: {
|
|
1063
|
+
code: 'A237',
|
|
1064
|
+
message: 'Превышена допустимая длина запроса к инструменту для перефразирования',
|
|
1065
|
+
httpCode: 400,
|
|
1066
|
+
},
|
|
1013
1067
|
};
|
package/build/constants/index.js
CHANGED
|
@@ -35,6 +35,8 @@ __exportStar(require("./roles"), exports);
|
|
|
35
35
|
__exportStar(require("./subscription"), exports);
|
|
36
36
|
__exportStar(require("./task"), exports);
|
|
37
37
|
__exportStar(require("./telegram"), exports);
|
|
38
|
+
__exportStar(require("./tool"), exports);
|
|
39
|
+
__exportStar(require("./tool-paraphrase"), exports);
|
|
38
40
|
__exportStar(require("./transaction"), exports);
|
|
39
41
|
__exportStar(require("./unregistered-user"), exports);
|
|
40
42
|
__exportStar(require("./user"), exports);
|
|
@@ -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("./tool-job-status.enum"), exports);
|
|
18
|
+
__exportStar(require("./tool-type.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_JOB_STATUS = void 0;
|
|
4
|
+
var TOOL_JOB_STATUS;
|
|
5
|
+
(function (TOOL_JOB_STATUS) {
|
|
6
|
+
TOOL_JOB_STATUS["PENDING"] = "pending";
|
|
7
|
+
TOOL_JOB_STATUS["COMPLETED"] = "completed";
|
|
8
|
+
TOOL_JOB_STATUS["FAILED"] = "failed";
|
|
9
|
+
})(TOOL_JOB_STATUS || (exports.TOOL_JOB_STATUS = TOOL_JOB_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);
|
|
@@ -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("./paraphrasing-intesity.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PARAPHRASING_INTENSITY = void 0;
|
|
4
|
+
var PARAPHRASING_INTENSITY;
|
|
5
|
+
(function (PARAPHRASING_INTENSITY) {
|
|
6
|
+
PARAPHRASING_INTENSITY["LOW"] = "low";
|
|
7
|
+
PARAPHRASING_INTENSITY["MEDIUM"] = "medium";
|
|
8
|
+
PARAPHRASING_INTENSITY["HIGH"] = "high";
|
|
9
|
+
})(PARAPHRASING_INTENSITY || (exports.PARAPHRASING_INTENSITY = PARAPHRASING_INTENSITY = {}));
|
|
@@ -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);
|
package/build/models/index.js
CHANGED
|
@@ -41,6 +41,12 @@ __exportStar(require("./subscription-feature.schema"), exports);
|
|
|
41
41
|
__exportStar(require("./subscription-upgrade-schema"), exports);
|
|
42
42
|
__exportStar(require("./subscription.schema"), exports);
|
|
43
43
|
__exportStar(require("./telegram-user-data.schema"), exports);
|
|
44
|
+
__exportStar(require("./tool-job.schema"), exports);
|
|
45
|
+
__exportStar(require("./tool-paraphrase-config.schema"), exports);
|
|
46
|
+
__exportStar(require("./tool-paraphrase-job.schema"), exports);
|
|
47
|
+
__exportStar(require("./tool-paraphrase-model.schema"), exports);
|
|
48
|
+
__exportStar(require("./tool-paraphrase-model.schema"), exports);
|
|
49
|
+
__exportStar(require("./tool.schema"), exports);
|
|
44
50
|
__exportStar(require("./unregistered-user.schema"), exports);
|
|
45
51
|
__exportStar(require("./user-task.schema"), exports);
|
|
46
52
|
__exportStar(require("./user-to-product.schema"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolJobSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
exports.ToolJobSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS),
|
|
9
|
+
error: zod_1.z.string().nullable(),
|
|
10
|
+
createdAt: zod_1.z.date(),
|
|
11
|
+
updatedAt: zod_1.z.date(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParaphraseToolConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_paraphrase_style_schema_1 = require("./tool-paraphrase-style.schema");
|
|
6
|
+
const tool_paraphrase_model_schema_1 = require("./tool-paraphrase-model.schema");
|
|
7
|
+
exports.ParaphraseToolConfigSchema = zod_1.z.object({
|
|
8
|
+
maxSymbols: zod_1.z.number(),
|
|
9
|
+
styles: zod_1.z.array(tool_paraphrase_style_schema_1.ParaphraseStyleSchema),
|
|
10
|
+
types: zod_1.z.array(tool_paraphrase_model_schema_1.ParaphraseModelSchema),
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParaphraseToolJobSchema = void 0;
|
|
4
|
+
const tool_job_schema_1 = require("./tool-job.schema");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
exports.ParaphraseToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
7
|
+
styleId: zod_1.z.string().uuid().nullable().optional(),
|
|
8
|
+
modelId: zod_1.z.string().uuid().nullable().optional(),
|
|
9
|
+
userInput: zod_1.z.string(),
|
|
10
|
+
aiOutput: zod_1.z.string().nullable().optional(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParaphraseModelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ParaphraseModelSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string().uuid(),
|
|
7
|
+
title: zod_1.z.string(),
|
|
8
|
+
icon: zod_1.z.string(),
|
|
9
|
+
price: zod_1.z.number(),
|
|
10
|
+
order: zod_1.z.number(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParaphraseStyleSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ParaphraseStyleSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string().uuid(),
|
|
7
|
+
title: zod_1.z.string(),
|
|
8
|
+
icon: zod_1.z.string(),
|
|
9
|
+
order: zod_1.z.number(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToolSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ToolSchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string().uuid(),
|
|
7
|
+
title: zod_1.z.string(),
|
|
8
|
+
description: zod_1.z.string(),
|
|
9
|
+
icon: zod_1.z.string(),
|
|
10
|
+
order: zod_1.z.number(),
|
|
11
|
+
});
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uiNotificationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
exports.uiNotificationSchema = zod_1.z.object({
|
|
6
7
|
uuid: zod_1.z.string().uuid(),
|
|
7
|
-
type: zod_1.z.
|
|
8
|
+
type: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_TYPE),
|
|
8
9
|
dynamicUiContent: zod_1.z.record(zod_1.z.unknown()),
|
|
9
10
|
userId: zod_1.z.string().nullable(),
|
|
10
|
-
status: zod_1.z.
|
|
11
|
-
conditionOfExecution: zod_1.z.
|
|
11
|
+
status: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_STATUS),
|
|
12
|
+
conditionOfExecution: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
12
13
|
endDate: zod_1.z.date().nullable(),
|
|
13
14
|
serverTime: zod_1.z.date().optional(),
|
|
14
15
|
});
|
package/commands/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './task';
|
|
|
19
19
|
export * from './telegram';
|
|
20
20
|
export * from './telegram-auth';
|
|
21
21
|
export * from './telegram-profile';
|
|
22
|
+
export * from './tool';
|
|
23
|
+
export * from './tools-paraphrase';
|
|
22
24
|
export * from './unregistered-user';
|
|
23
25
|
export * from './user';
|
|
24
26
|
export * from './user-to-subscription';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './find-all-tools.command';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../models/tool-paraphrase-job.schema';
|
|
3
|
+
|
|
4
|
+
export namespace FindParaphraseJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = ParaphraseToolJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: ParaphraseToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolConfigSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetParaphraseToolConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: ParaphraseToolConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../models';
|
|
3
|
+
import { PARAPHRASING_INTENSITY } from '../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace ParaphraseCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
styleId: z.string().uuid(),
|
|
8
|
+
typeId: z.string().uuid(),
|
|
9
|
+
prompt: z.string().min(1).max(10000),
|
|
10
|
+
intensity: z.nativeEnum(PARAPHRASING_INTENSITY),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -20,7 +20,11 @@ export const ERRORS = {
|
|
|
20
20
|
REGISTER_ERROR: { code: 'U01', message: 'Произошла ошибка при регистрации', httpCode: 500 },
|
|
21
21
|
REGISTER_CONFLICT: { code: 'U04', message: 'Пользователь уже зарегистрирован', httpCode: 409 },
|
|
22
22
|
USER_NOT_FOUND: { code: 'A002', message: 'Пользователь не найден', httpCode: 404 },
|
|
23
|
-
USER_CONFLICT: {
|
|
23
|
+
USER_CONFLICT: {
|
|
24
|
+
code: 'A003',
|
|
25
|
+
message: 'Пользователь с таким email уже существует',
|
|
26
|
+
httpCode: 409,
|
|
27
|
+
},
|
|
24
28
|
|
|
25
29
|
USER_NOT_CREATED: {
|
|
26
30
|
code: 'A004',
|
|
@@ -1004,14 +1008,65 @@ export const ERRORS = {
|
|
|
1004
1008
|
httpCode: 500,
|
|
1005
1009
|
},
|
|
1006
1010
|
UNREGISTERED_SESSION_INIT_ERROR: {
|
|
1007
|
-
code: '
|
|
1011
|
+
code: 'A226',
|
|
1008
1012
|
message: 'Произошла ошибка при инициализации сессии для незарегистрированного пользователя',
|
|
1009
1013
|
httpCode: 500,
|
|
1010
1014
|
},
|
|
1011
1015
|
EMAIL_VERIFICATION_CODE_INVALID: {
|
|
1012
|
-
code: '
|
|
1016
|
+
code: 'A227',
|
|
1013
1017
|
message:
|
|
1014
1018
|
'Ссылка для подтверждения недействительна или устарела. Пожалуйста, попробуйте позже',
|
|
1015
1019
|
httpCode: 400,
|
|
1016
1020
|
},
|
|
1021
|
+
PROMOCODE_INVALID_ERROR: {
|
|
1022
|
+
code: 'A228',
|
|
1023
|
+
message: 'Промокод не может быть применен',
|
|
1024
|
+
httpCode: 422,
|
|
1025
|
+
},
|
|
1026
|
+
TOOL_JOB_CREATE_ERROR: {
|
|
1027
|
+
code: 'A229',
|
|
1028
|
+
message: 'Произошла ошибка при создании запроса к инструменту',
|
|
1029
|
+
httpCode: 500,
|
|
1030
|
+
},
|
|
1031
|
+
PARAPHRASE_CONFIG_ERROR: {
|
|
1032
|
+
code: 'A230',
|
|
1033
|
+
message:
|
|
1034
|
+
'Произошла ошибка при получении информации об инструменте для перефразирования текста',
|
|
1035
|
+
httpCode: 500,
|
|
1036
|
+
},
|
|
1037
|
+
TOOL_JOB_FIND_ERROR: {
|
|
1038
|
+
code: 'A231',
|
|
1039
|
+
message: 'Произошла ошибка при поиске запроса к инструменту',
|
|
1040
|
+
httpCode: 500,
|
|
1041
|
+
},
|
|
1042
|
+
TOOL_JOB_NOT_FOUND: {
|
|
1043
|
+
code: 'A232',
|
|
1044
|
+
message: 'Запрос к инструменту не найден',
|
|
1045
|
+
httpCode: 404,
|
|
1046
|
+
},
|
|
1047
|
+
TOOL_INVALID_TYPE: {
|
|
1048
|
+
code: 'A233',
|
|
1049
|
+
message: 'Неверный тип инструмента',
|
|
1050
|
+
httpCode: 400,
|
|
1051
|
+
},
|
|
1052
|
+
TOOL_JOB_UNAUTHORIZED: {
|
|
1053
|
+
code: 'A234',
|
|
1054
|
+
message: 'Пользователь не имеет доступ к данному запросу',
|
|
1055
|
+
httpCode: 401,
|
|
1056
|
+
},
|
|
1057
|
+
TOOL_FIND_ERROR: {
|
|
1058
|
+
code: 'A235',
|
|
1059
|
+
message: 'Произошла ошибка при поиске инструмента',
|
|
1060
|
+
httpCode: 500,
|
|
1061
|
+
},
|
|
1062
|
+
PARAPHRASE_SEND_REQUEST_ERROR: {
|
|
1063
|
+
code: 'A236',
|
|
1064
|
+
message: 'Произошла ошибка при отпраке запроса к инструменту для перефразирования',
|
|
1065
|
+
httpCode: 500,
|
|
1066
|
+
},
|
|
1067
|
+
PARAPHRASE_REQUEST_TOO_LONG: {
|
|
1068
|
+
code: 'A237',
|
|
1069
|
+
message: 'Превышена допустимая длина запроса к инструменту для перефразирования',
|
|
1070
|
+
httpCode: 400,
|
|
1071
|
+
},
|
|
1017
1072
|
};
|
package/constants/index.ts
CHANGED
|
@@ -19,6 +19,8 @@ export * from './roles';
|
|
|
19
19
|
export * from './subscription';
|
|
20
20
|
export * from './task';
|
|
21
21
|
export * from './telegram';
|
|
22
|
+
export * from './tool';
|
|
23
|
+
export * from './tool-paraphrase';
|
|
22
24
|
export * from './transaction';
|
|
23
25
|
export * from './unregistered-user';
|
|
24
26
|
export * from './user';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './paraphrasing-intesity.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
package/models/index.ts
CHANGED
|
@@ -25,6 +25,12 @@ export * from './subscription-feature.schema';
|
|
|
25
25
|
export * from './subscription-upgrade-schema';
|
|
26
26
|
export * from './subscription.schema';
|
|
27
27
|
export * from './telegram-user-data.schema';
|
|
28
|
+
export * from './tool-job.schema';
|
|
29
|
+
export * from './tool-paraphrase-config.schema';
|
|
30
|
+
export * from './tool-paraphrase-job.schema';
|
|
31
|
+
export * from './tool-paraphrase-model.schema';
|
|
32
|
+
export * from './tool-paraphrase-model.schema';
|
|
33
|
+
export * from './tool.schema';
|
|
28
34
|
export * from './unregistered-user.schema';
|
|
29
35
|
export * from './user-task.schema';
|
|
30
36
|
export * from './user-to-product.schema';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_JOB_STATUS } from '../constants';
|
|
3
|
+
|
|
4
|
+
export const ToolJobSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
status: z.nativeEnum(TOOL_JOB_STATUS),
|
|
7
|
+
error: z.string().nullable(),
|
|
8
|
+
createdAt: z.date(),
|
|
9
|
+
updatedAt: z.date(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseStyleSchema } from './tool-paraphrase-style.schema';
|
|
3
|
+
import { ParaphraseModelSchema } from './tool-paraphrase-model.schema';
|
|
4
|
+
|
|
5
|
+
export const ParaphraseToolConfigSchema = z.object({
|
|
6
|
+
maxSymbols: z.number(),
|
|
7
|
+
styles: z.array(ParaphraseStyleSchema),
|
|
8
|
+
types: z.array(ParaphraseModelSchema),
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ToolJobSchema } from './tool-job.schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const ParaphraseToolJobSchema = ToolJobSchema.extend({
|
|
5
|
+
styleId: z.string().uuid().nullable().optional(),
|
|
6
|
+
modelId: z.string().uuid().nullable().optional(),
|
|
7
|
+
userInput: z.string(),
|
|
8
|
+
aiOutput: z.string().nullable().optional(),
|
|
9
|
+
});
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
import {
|
|
3
|
+
UI_NOTIFICATION_CONDITION_OF_EXECUTION,
|
|
4
|
+
UI_NOTIFICATION_STATUS,
|
|
5
|
+
UI_NOTIFICATION_TYPE,
|
|
6
|
+
} from '../constants';
|
|
3
7
|
export const uiNotificationSchema = z.object({
|
|
4
8
|
uuid: z.string().uuid(),
|
|
5
|
-
type: z.
|
|
9
|
+
type: z.nativeEnum(UI_NOTIFICATION_TYPE),
|
|
6
10
|
dynamicUiContent: z.record(z.unknown()),
|
|
7
11
|
userId: z.string().nullable(),
|
|
8
|
-
status: z.
|
|
9
|
-
conditionOfExecution: z.
|
|
12
|
+
status: z.nativeEnum(UI_NOTIFICATION_STATUS),
|
|
13
|
+
conditionOfExecution: z.nativeEnum(UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
10
14
|
endDate: z.date().nullable(),
|
|
11
15
|
serverTime: z.date().optional(),
|
|
12
16
|
});
|