@purpleschool/gptbot 0.8.12 → 0.8.15
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/paraphrase.ts +6 -0
- package/api/routes.ts +20 -0
- package/build/api/controllers/http/paraphrase.js +6 -0
- package/build/api/routes.js +12 -0
- package/build/commands/subscription/create-custom-subscription-plan.command.js +1 -1
- package/build/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.js +8 -0
- package/build/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.js +11 -0
- package/build/commands/tools/paraphrase/find-paraphrase-jobs.command.js +18 -0
- package/build/commands/tools/paraphrase/index.js +7 -1
- package/build/commands/tools/paraphrase/retry-paraphrase-job.command.js +14 -0
- package/build/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.js +18 -0
- package/build/commands/tools/paraphrase/update-paraphrase-job-title.command.js +17 -0
- package/build/constants/errors/errors.js +20 -0
- package/build/constants/tool/enums/tool-job-status.enum.js +1 -0
- package/build/models/tools/paraphrase/paraphrase-job.schema.js +3 -0
- package/commands/subscription/create-custom-subscription-plan.command.ts +1 -1
- package/commands/tools/paraphrase/delete-all-paraphrase-jobs.command.ts +6 -0
- package/commands/tools/paraphrase/delete-paraphrase-job-by-uuid.command.ts +11 -0
- package/commands/tools/paraphrase/find-paraphrase-jobs.command.ts +18 -0
- package/commands/tools/paraphrase/index.ts +7 -1
- package/commands/tools/paraphrase/retry-paraphrase-job.command.ts +14 -0
- package/commands/tools/paraphrase/set-reaction-to-paraphrase-job.command.ts +20 -0
- package/commands/tools/paraphrase/update-paraphrase-job-title.command.ts +19 -0
- package/constants/errors/errors.ts +20 -0
- package/constants/tool/enums/tool-job-status.enum.ts +1 -0
- package/models/tools/paraphrase/paraphrase-job.schema.ts +3 -0
- package/package.json +1 -1
|
@@ -4,5 +4,11 @@ export const PARAPHRASE_CONTROLLER_PUBLIC = 'public/tools/paraphrase' as const;
|
|
|
4
4
|
export const PARAPHRASE_ROUTES = {
|
|
5
5
|
CONFIG: 'config',
|
|
6
6
|
EXECUTE: 'execute',
|
|
7
|
+
GET_JOBS: 'jobs',
|
|
7
8
|
GET_JOB: (uuid: string) => `jobs/${uuid}`,
|
|
9
|
+
UPDATE: (uuid: string) => `jobs/${uuid}`,
|
|
10
|
+
SET_REACTION: (uuid: string) => `jobs/${uuid}/reaction`,
|
|
11
|
+
DELETE: (uuid: string) => `jobs/${uuid}`,
|
|
12
|
+
DELETE_ALL: 'jobs',
|
|
13
|
+
RETRY: (uuid: string) => `jobs/${uuid}/retry`,
|
|
8
14
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -530,14 +530,34 @@ export const REST_API = {
|
|
|
530
530
|
PARAPHRASE_PUBLIC: {
|
|
531
531
|
CONFIG: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
|
|
532
532
|
EXECUTE: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
|
|
533
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
|
|
533
534
|
GET_JOB: (uuid: string) =>
|
|
534
535
|
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
|
|
536
|
+
UPDATE: (uuid: string) =>
|
|
537
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.UPDATE(uuid)}`,
|
|
538
|
+
SET_REACTION: (uuid: string) =>
|
|
539
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.SET_REACTION(uuid)}`,
|
|
540
|
+
DELETE: (uuid: string) =>
|
|
541
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE(uuid)}`,
|
|
542
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE_ALL}`,
|
|
543
|
+
RETRY: (uuid: string) =>
|
|
544
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
535
545
|
},
|
|
536
546
|
PARAPHRASE_PRIVATE: {
|
|
537
547
|
CONFIG: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
|
|
538
548
|
EXECUTE: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
|
|
549
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
|
|
539
550
|
GET_JOB: (uuid: string) =>
|
|
540
551
|
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
|
|
552
|
+
UPDATE: (uuid: string) =>
|
|
553
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.UPDATE(uuid)}`,
|
|
554
|
+
SET_REACTION: (uuid: string) =>
|
|
555
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.SET_REACTION(uuid)}`,
|
|
556
|
+
DELETE: (uuid: string) =>
|
|
557
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE(uuid)}`,
|
|
558
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE_ALL}`,
|
|
559
|
+
RETRY: (uuid: string) =>
|
|
560
|
+
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
541
561
|
},
|
|
542
562
|
PRESENTATION_PUBLIC: {
|
|
543
563
|
CONFIG: `${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
|
|
@@ -6,5 +6,11 @@ exports.PARAPHRASE_CONTROLLER_PUBLIC = 'public/tools/paraphrase';
|
|
|
6
6
|
exports.PARAPHRASE_ROUTES = {
|
|
7
7
|
CONFIG: 'config',
|
|
8
8
|
EXECUTE: 'execute',
|
|
9
|
+
GET_JOBS: 'jobs',
|
|
9
10
|
GET_JOB: (uuid) => `jobs/${uuid}`,
|
|
11
|
+
UPDATE: (uuid) => `jobs/${uuid}`,
|
|
12
|
+
SET_REACTION: (uuid) => `jobs/${uuid}/reaction`,
|
|
13
|
+
DELETE: (uuid) => `jobs/${uuid}`,
|
|
14
|
+
DELETE_ALL: 'jobs',
|
|
15
|
+
RETRY: (uuid) => `jobs/${uuid}/retry`,
|
|
10
16
|
};
|
package/build/api/routes.js
CHANGED
|
@@ -432,12 +432,24 @@ exports.REST_API = {
|
|
|
432
432
|
PARAPHRASE_PUBLIC: {
|
|
433
433
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
|
|
434
434
|
EXECUTE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
|
|
435
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
|
|
435
436
|
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
|
|
437
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.UPDATE(uuid)}`,
|
|
438
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.SET_REACTION(uuid)}`,
|
|
439
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE(uuid)}`,
|
|
440
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE_ALL}`,
|
|
441
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PUBLIC}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
436
442
|
},
|
|
437
443
|
PARAPHRASE_PRIVATE: {
|
|
438
444
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.CONFIG}`,
|
|
439
445
|
EXECUTE: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.EXECUTE}`,
|
|
446
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOBS}`,
|
|
440
447
|
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.GET_JOB(uuid)}`,
|
|
448
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.UPDATE(uuid)}`,
|
|
449
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.SET_REACTION(uuid)}`,
|
|
450
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE(uuid)}`,
|
|
451
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE_ALL}`,
|
|
452
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
441
453
|
},
|
|
442
454
|
PRESENTATION_PUBLIC: {
|
|
443
455
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
|
|
@@ -19,6 +19,6 @@ var CreateCustomSubscriptionPlanCommand;
|
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
21
21
|
CreateCustomSubscriptionPlanCommand.ResponseSchema = zod_1.z.object({
|
|
22
|
-
data: models_1.SubscriptionSchema,
|
|
22
|
+
data: zod_1.z.array(models_1.SubscriptionSchema),
|
|
23
23
|
});
|
|
24
24
|
})(CreateCustomSubscriptionPlanCommand || (exports.CreateCustomSubscriptionPlanCommand = CreateCustomSubscriptionPlanCommand = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAllParaphraseJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAllParaphraseJobsCommand;
|
|
6
|
+
(function (DeleteAllParaphraseJobsCommand) {
|
|
7
|
+
DeleteAllParaphraseJobsCommand.ResponseSchema = zod_1.z.void();
|
|
8
|
+
})(DeleteAllParaphraseJobsCommand || (exports.DeleteAllParaphraseJobsCommand = DeleteAllParaphraseJobsCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteParaphraseJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteParaphraseJobByUUIDCommand;
|
|
6
|
+
(function (DeleteParaphraseJobByUUIDCommand) {
|
|
7
|
+
DeleteParaphraseJobByUUIDCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteParaphraseJobByUUIDCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
+
})(DeleteParaphraseJobByUUIDCommand || (exports.DeleteParaphraseJobByUUIDCommand = DeleteParaphraseJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindParaphraseJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindParaphraseJobsCommand;
|
|
7
|
+
(function (FindParaphraseJobsCommand) {
|
|
8
|
+
FindParaphraseJobsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
limit: zod_1.z.coerce.number().min(1).optional(),
|
|
10
|
+
offset: zod_1.z.coerce.number().min(0).default(0).optional(),
|
|
11
|
+
title: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
FindParaphraseJobsCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: zod_1.z.array(models_1.ParaphraseToolJobSchema),
|
|
15
|
+
totalPages: zod_1.z.number(),
|
|
16
|
+
page: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
})(FindParaphraseJobsCommand || (exports.FindParaphraseJobsCommand = FindParaphraseJobsCommand = {}));
|
|
@@ -14,6 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./paraphrase.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-paraphrase-job-by-uuid.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-all-paraphrase-jobs.command"), exports);
|
|
20
|
+
__exportStar(require("./set-reaction-to-paraphrase-job.command"), exports);
|
|
21
|
+
__exportStar(require("./update-paraphrase-job-title.command"), exports);
|
|
22
|
+
__exportStar(require("./retry-paraphrase-job.command"), exports);
|
|
17
23
|
__exportStar(require("./find-paraphrase-job-by-uuid.command"), exports);
|
|
24
|
+
__exportStar(require("./find-paraphrase-jobs.command"), exports);
|
|
18
25
|
__exportStar(require("./get-paraphrase-tool-config.command"), exports);
|
|
19
|
-
__exportStar(require("./paraphrase.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryParaphraseJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var RetryParaphraseJobCommand;
|
|
7
|
+
(function (RetryParaphraseJobCommand) {
|
|
8
|
+
RetryParaphraseJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
RetryParaphraseJobCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.ParaphraseToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(RetryParaphraseJobCommand || (exports.RetryParaphraseJobCommand = RetryParaphraseJobCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToParaphraseJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
var SetReactionToParaphraseJobCommand;
|
|
8
|
+
(function (SetReactionToParaphraseJobCommand) {
|
|
9
|
+
SetReactionToParaphraseJobCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
11
|
+
});
|
|
12
|
+
SetReactionToParaphraseJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
13
|
+
uuid: zod_1.z.string().uuid(),
|
|
14
|
+
});
|
|
15
|
+
SetReactionToParaphraseJobCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.ParaphraseToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
})(SetReactionToParaphraseJobCommand || (exports.SetReactionToParaphraseJobCommand = SetReactionToParaphraseJobCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateParaphraseJobTitleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var UpdateParaphraseJobTitleCommand;
|
|
7
|
+
(function (UpdateParaphraseJobTitleCommand) {
|
|
8
|
+
UpdateParaphraseJobTitleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
title: zod_1.z.string().min(1).max(40).trim(),
|
|
10
|
+
});
|
|
11
|
+
UpdateParaphraseJobTitleCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateParaphraseJobTitleCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ParaphraseToolJobSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateParaphraseJobTitleCommand || (exports.UpdateParaphraseJobTitleCommand = UpdateParaphraseJobTitleCommand = {}));
|
|
@@ -2462,4 +2462,24 @@ exports.ERRORS = {
|
|
|
2462
2462
|
message: 'Статус не удовлетворительный',
|
|
2463
2463
|
httpCode: 400,
|
|
2464
2464
|
},
|
|
2465
|
+
PARAPHRASE_JOB_DELETE_ERROR: {
|
|
2466
|
+
code: 'A503',
|
|
2467
|
+
message: 'Произошла ошибка при удалении задачи перефразирования',
|
|
2468
|
+
httpCode: 500,
|
|
2469
|
+
},
|
|
2470
|
+
PARAPHRASE_SET_REACTION_ERROR: {
|
|
2471
|
+
code: 'A504',
|
|
2472
|
+
message: 'Произошла ошибка при установке оценки задачи перефразирования',
|
|
2473
|
+
httpCode: 500,
|
|
2474
|
+
},
|
|
2475
|
+
PARAPHRASE_UPDATE_TITLE_ERROR: {
|
|
2476
|
+
code: 'A505',
|
|
2477
|
+
message: 'Произошла ошибка при обновлении названия задачи перефразирования',
|
|
2478
|
+
httpCode: 500,
|
|
2479
|
+
},
|
|
2480
|
+
PARAPHRASE_RETRY_REQUEST_ERROR: {
|
|
2481
|
+
code: 'A506',
|
|
2482
|
+
message: 'Произошла ошибка при повторном запросе перефразирования',
|
|
2483
|
+
httpCode: 500,
|
|
2484
|
+
},
|
|
2465
2485
|
};
|
|
@@ -4,6 +4,7 @@ exports.TOOL_JOB_STATUS = void 0;
|
|
|
4
4
|
var TOOL_JOB_STATUS;
|
|
5
5
|
(function (TOOL_JOB_STATUS) {
|
|
6
6
|
TOOL_JOB_STATUS["PENDING"] = "pending";
|
|
7
|
+
TOOL_JOB_STATUS["PROCESSING"] = "processing";
|
|
7
8
|
TOOL_JOB_STATUS["COMPLETED"] = "completed";
|
|
8
9
|
TOOL_JOB_STATUS["FAILED"] = "failed";
|
|
9
10
|
})(TOOL_JOB_STATUS || (exports.TOOL_JOB_STATUS = TOOL_JOB_STATUS = {}));
|
|
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ParaphraseToolJobSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
6
7
|
exports.ParaphraseToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
7
8
|
styleId: zod_1.z.string().uuid().nullable().optional(),
|
|
8
9
|
modelId: zod_1.z.string().uuid().nullable().optional(),
|
|
9
10
|
userInput: zod_1.z.string(),
|
|
11
|
+
title: zod_1.z.string(),
|
|
12
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
10
13
|
aiOutput: zod_1.z.string().nullable().optional(),
|
|
11
14
|
});
|
|
@@ -19,7 +19,7 @@ export namespace CreateCustomSubscriptionPlanCommand {
|
|
|
19
19
|
export type Request = z.infer<typeof RequestSchema>;
|
|
20
20
|
|
|
21
21
|
export const ResponseSchema = z.object({
|
|
22
|
-
data: SubscriptionSchema,
|
|
22
|
+
data: z.array(SubscriptionSchema),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteParaphraseJobByUUIDCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindParaphraseJobsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(ParaphraseToolJobSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export * from './paraphrase.command';
|
|
2
|
+
export * from './delete-paraphrase-job-by-uuid.command';
|
|
3
|
+
export * from './delete-all-paraphrase-jobs.command';
|
|
4
|
+
export * from './set-reaction-to-paraphrase-job.command';
|
|
5
|
+
export * from './update-paraphrase-job-title.command';
|
|
6
|
+
export * from './retry-paraphrase-job.command';
|
|
1
7
|
export * from './find-paraphrase-job-by-uuid.command';
|
|
8
|
+
export * from './find-paraphrase-jobs.command';
|
|
2
9
|
export * from './get-paraphrase-tool-config.command';
|
|
3
|
-
export * from './paraphrase.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetryParaphraseJobCommand {
|
|
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: ParaphraseToolJobSchema,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToParaphraseJobCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestParamsSchema = z.object({
|
|
12
|
+
uuid: z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = z.object({
|
|
17
|
+
data: ParaphraseToolJobSchema,
|
|
18
|
+
});
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ParaphraseToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateParaphraseJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(40).trim(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ParaphraseToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -2470,4 +2470,24 @@ export const ERRORS = {
|
|
|
2470
2470
|
message: 'Статус не удовлетворительный',
|
|
2471
2471
|
httpCode: 400,
|
|
2472
2472
|
},
|
|
2473
|
+
PARAPHRASE_JOB_DELETE_ERROR: {
|
|
2474
|
+
code: 'A503',
|
|
2475
|
+
message: 'Произошла ошибка при удалении задачи перефразирования',
|
|
2476
|
+
httpCode: 500,
|
|
2477
|
+
},
|
|
2478
|
+
PARAPHRASE_SET_REACTION_ERROR: {
|
|
2479
|
+
code: 'A504',
|
|
2480
|
+
message: 'Произошла ошибка при установке оценки задачи перефразирования',
|
|
2481
|
+
httpCode: 500,
|
|
2482
|
+
},
|
|
2483
|
+
PARAPHRASE_UPDATE_TITLE_ERROR: {
|
|
2484
|
+
code: 'A505',
|
|
2485
|
+
message: 'Произошла ошибка при обновлении названия задачи перефразирования',
|
|
2486
|
+
httpCode: 500,
|
|
2487
|
+
},
|
|
2488
|
+
PARAPHRASE_RETRY_REQUEST_ERROR: {
|
|
2489
|
+
code: 'A506',
|
|
2490
|
+
message: 'Произошла ошибка при повторном запросе перефразирования',
|
|
2491
|
+
httpCode: 500,
|
|
2492
|
+
},
|
|
2473
2493
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
3
4
|
|
|
4
5
|
export const ParaphraseToolJobSchema = ToolJobSchema.extend({
|
|
5
6
|
styleId: z.string().uuid().nullable().optional(),
|
|
6
7
|
modelId: z.string().uuid().nullable().optional(),
|
|
7
8
|
userInput: z.string(),
|
|
9
|
+
title: z.string(),
|
|
10
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
8
11
|
aiOutput: z.string().nullable().optional(),
|
|
9
12
|
});
|