@purpleschool/gptbot 0.9.29 → 0.9.31
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 +1 -0
- package/api/controllers/http/spell-corrector.ts +14 -0
- package/api/routes.ts +32 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/spell-corrector.js +16 -0
- package/build/api/routes.js +22 -0
- package/build/commands/tools/index.js +1 -0
- package/build/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.js +8 -0
- package/build/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.js +11 -0
- package/build/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.js +14 -0
- package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.js +18 -0
- package/build/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.js +11 -0
- package/build/commands/tools/spell-corrector/index.js +25 -0
- package/build/commands/tools/spell-corrector/retry-spell-corrector-job.command.js +14 -0
- package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.js +28 -0
- package/build/commands/tools/spell-corrector/spell-corrector.command.js +15 -0
- package/build/commands/tools/spell-corrector/update-spell-corrector-job-title.command.js +17 -0
- package/build/models/tools/index.js +1 -0
- package/build/models/tools/spell-corrector/index.js +19 -0
- package/build/models/tools/spell-corrector/spell-corrector-config.schema.js +9 -0
- package/build/models/tools/spell-corrector/spell-corrector-job.schema.js +13 -0
- package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +14 -0
- package/build/models/tools/stt/stt-response.schema.js +2 -0
- package/commands/tools/index.ts +1 -0
- package/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.ts +6 -0
- package/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.ts +11 -0
- package/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.ts +16 -0
- package/commands/tools/spell-corrector/find-spell-corrector-jobs.command.ts +18 -0
- package/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.ts +10 -0
- package/commands/tools/spell-corrector/index.ts +9 -0
- package/commands/tools/spell-corrector/retry-spell-corrector-job.command.ts +14 -0
- package/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.ts +33 -0
- package/commands/tools/spell-corrector/spell-corrector.command.ts +17 -0
- package/commands/tools/spell-corrector/update-spell-corrector-job-title.command.ts +19 -0
- package/models/tools/index.ts +1 -0
- package/models/tools/spell-corrector/index.ts +3 -0
- package/models/tools/spell-corrector/spell-corrector-config.schema.ts +7 -0
- package/models/tools/spell-corrector/spell-corrector-job.schema.ts +11 -0
- package/models/tools/spell-corrector/spell-corrector-model.schema.ts +12 -0
- package/models/tools/stt/stt-response.schema.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const SPELL_CORRECTOR_CONTROLLER_PRIVATE = 'private/tools/spell-corrector' as const;
|
|
2
|
+
export const SPELL_CORRECTOR_CONTROLLER_PUBLIC = 'public/tools/spell-corrector' as const;
|
|
3
|
+
|
|
4
|
+
export const SPELL_CORRECTOR_ROUTES = {
|
|
5
|
+
CONFIG: 'config',
|
|
6
|
+
EXECUTE: 'execute',
|
|
7
|
+
GET_JOBS: 'jobs',
|
|
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`,
|
|
14
|
+
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -600,6 +600,38 @@ export const REST_API = {
|
|
|
600
600
|
RETRY: (uuid: string) =>
|
|
601
601
|
`${ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
602
602
|
},
|
|
603
|
+
SPELL_CORRECTOR_PUBLIC: {
|
|
604
|
+
CONFIG: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
605
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
606
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
607
|
+
GET_JOB: (uuid: string) =>
|
|
608
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
609
|
+
UPDATE: (uuid: string) =>
|
|
610
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.UPDATE(uuid)}`,
|
|
611
|
+
SET_REACTION: (uuid: string) =>
|
|
612
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.SET_REACTION(uuid)}`,
|
|
613
|
+
DELETE: (uuid: string) =>
|
|
614
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE(uuid)}`,
|
|
615
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE_ALL}`,
|
|
616
|
+
RETRY: (uuid: string) =>
|
|
617
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.RETRY(uuid)}`,
|
|
618
|
+
},
|
|
619
|
+
SPELL_CORRECTOR_PRIVATE: {
|
|
620
|
+
CONFIG: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
621
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
622
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
623
|
+
GET_JOB: (uuid: string) =>
|
|
624
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
625
|
+
UPDATE: (uuid: string) =>
|
|
626
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.UPDATE(uuid)}`,
|
|
627
|
+
SET_REACTION: (uuid: string) =>
|
|
628
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.SET_REACTION(uuid)}`,
|
|
629
|
+
DELETE: (uuid: string) =>
|
|
630
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE(uuid)}`,
|
|
631
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE_ALL}`,
|
|
632
|
+
RETRY: (uuid: string) =>
|
|
633
|
+
`${ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.RETRY(uuid)}`,
|
|
634
|
+
},
|
|
603
635
|
PRESENTATION_PUBLIC: {
|
|
604
636
|
CONFIG: `${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
|
|
605
637
|
CREATE: `${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE}`,
|
|
@@ -75,3 +75,4 @@ __exportStar(require("./image-generation"), exports);
|
|
|
75
75
|
__exportStar(require("./marketplace-card"), exports);
|
|
76
76
|
__exportStar(require("./interior-design"), exports);
|
|
77
77
|
__exportStar(require("./solving-edu-task"), exports);
|
|
78
|
+
__exportStar(require("./spell-corrector"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SPELL_CORRECTOR_ROUTES = exports.SPELL_CORRECTOR_CONTROLLER_PUBLIC = exports.SPELL_CORRECTOR_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.SPELL_CORRECTOR_CONTROLLER_PRIVATE = 'private/tools/spell-corrector';
|
|
5
|
+
exports.SPELL_CORRECTOR_CONTROLLER_PUBLIC = 'public/tools/spell-corrector';
|
|
6
|
+
exports.SPELL_CORRECTOR_ROUTES = {
|
|
7
|
+
CONFIG: 'config',
|
|
8
|
+
EXECUTE: 'execute',
|
|
9
|
+
GET_JOBS: 'jobs',
|
|
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`,
|
|
16
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -479,6 +479,28 @@ exports.REST_API = {
|
|
|
479
479
|
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.DELETE_ALL}`,
|
|
480
480
|
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.PARAPHRASE_CONTROLLER_PRIVATE}/${CONTROLLERS.PARAPHRASE_ROUTES.RETRY(uuid)}`,
|
|
481
481
|
},
|
|
482
|
+
SPELL_CORRECTOR_PUBLIC: {
|
|
483
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
484
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
485
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
486
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
487
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.UPDATE(uuid)}`,
|
|
488
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.SET_REACTION(uuid)}`,
|
|
489
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE(uuid)}`,
|
|
490
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE_ALL}`,
|
|
491
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PUBLIC}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.RETRY(uuid)}`,
|
|
492
|
+
},
|
|
493
|
+
SPELL_CORRECTOR_PRIVATE: {
|
|
494
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.CONFIG}`,
|
|
495
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.EXECUTE}`,
|
|
496
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOBS}`,
|
|
497
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.GET_JOB(uuid)}`,
|
|
498
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.UPDATE(uuid)}`,
|
|
499
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.SET_REACTION(uuid)}`,
|
|
500
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE(uuid)}`,
|
|
501
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.DELETE_ALL}`,
|
|
502
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.SPELL_CORRECTOR_CONTROLLER_PRIVATE}/${CONTROLLERS.SPELL_CORRECTOR_ROUTES.RETRY(uuid)}`,
|
|
503
|
+
},
|
|
482
504
|
PRESENTATION_PUBLIC: {
|
|
483
505
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
|
|
484
506
|
CREATE: `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE}`,
|
|
@@ -28,3 +28,4 @@ __exportStar(require("./image-generation"), exports);
|
|
|
28
28
|
__exportStar(require("./marketplace-card"), exports);
|
|
29
29
|
__exportStar(require("./interior-design"), exports);
|
|
30
30
|
__exportStar(require("./solving-edu-task"), exports);
|
|
31
|
+
__exportStar(require("./spell-corrector"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAllSpellCorrectorJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAllSpellCorrectorJobsCommand;
|
|
6
|
+
(function (DeleteAllSpellCorrectorJobsCommand) {
|
|
7
|
+
DeleteAllSpellCorrectorJobsCommand.ResponseSchema = zod_1.z.void();
|
|
8
|
+
})(DeleteAllSpellCorrectorJobsCommand || (exports.DeleteAllSpellCorrectorJobsCommand = DeleteAllSpellCorrectorJobsCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteSpellCorrectorJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteSpellCorrectorJobByUUIDCommand;
|
|
6
|
+
(function (DeleteSpellCorrectorJobByUUIDCommand) {
|
|
7
|
+
DeleteSpellCorrectorJobByUUIDCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteSpellCorrectorJobByUUIDCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
+
})(DeleteSpellCorrectorJobByUUIDCommand || (exports.DeleteSpellCorrectorJobByUUIDCommand = DeleteSpellCorrectorJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindSpellCorrectorJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindSpellCorrectorJobByUUIDCommand;
|
|
7
|
+
(function (FindSpellCorrectorJobByUUIDCommand) {
|
|
8
|
+
FindSpellCorrectorJobByUUIDCommand.RequestParamsSchema = models_1.SpellCorrectorToolJobSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
FindSpellCorrectorJobByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.SpellCorrectorToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindSpellCorrectorJobByUUIDCommand || (exports.FindSpellCorrectorJobByUUIDCommand = FindSpellCorrectorJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindSpellCorrectorJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindSpellCorrectorJobsCommand;
|
|
7
|
+
(function (FindSpellCorrectorJobsCommand) {
|
|
8
|
+
FindSpellCorrectorJobsCommand.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
|
+
FindSpellCorrectorJobsCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: zod_1.z.array(models_1.SpellCorrectorToolJobSchema),
|
|
15
|
+
totalPages: zod_1.z.number(),
|
|
16
|
+
page: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
})(FindSpellCorrectorJobsCommand || (exports.FindSpellCorrectorJobsCommand = FindSpellCorrectorJobsCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSpellCorrectorToolConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var GetSpellCorrectorToolConfigCommand;
|
|
7
|
+
(function (GetSpellCorrectorToolConfigCommand) {
|
|
8
|
+
GetSpellCorrectorToolConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: models_1.SpellCorrectorToolConfigSchema,
|
|
10
|
+
});
|
|
11
|
+
})(GetSpellCorrectorToolConfigCommand || (exports.GetSpellCorrectorToolConfigCommand = GetSpellCorrectorToolConfigCommand = {}));
|
|
@@ -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("./spell-corrector.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-spell-corrector-job-by-uuid.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-all-spell-corrector-jobs.command"), exports);
|
|
20
|
+
__exportStar(require("./set-reaction-to-spell-corrector-job.command"), exports);
|
|
21
|
+
__exportStar(require("./update-spell-corrector-job-title.command"), exports);
|
|
22
|
+
__exportStar(require("./retry-spell-corrector-job.command"), exports);
|
|
23
|
+
__exportStar(require("./find-spell-corrector-job-by-uuid.command"), exports);
|
|
24
|
+
__exportStar(require("./find-spell-corrector-jobs.command"), exports);
|
|
25
|
+
__exportStar(require("./get-spell-corrector-tool-config.command"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetrySpellCorrectorJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var RetrySpellCorrectorJobCommand;
|
|
7
|
+
(function (RetrySpellCorrectorJobCommand) {
|
|
8
|
+
RetrySpellCorrectorJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
RetrySpellCorrectorJobCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.SpellCorrectorToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(RetrySpellCorrectorJobCommand || (exports.RetrySpellCorrectorJobCommand = RetrySpellCorrectorJobCommand = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToSpellCorrectorJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
var SetReactionToSpellCorrectorJobCommand;
|
|
8
|
+
(function (SetReactionToSpellCorrectorJobCommand) {
|
|
9
|
+
SetReactionToSpellCorrectorJobCommand.RequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
12
|
+
dislikeReason: zod_1.z.string().nullable().default(null),
|
|
13
|
+
})
|
|
14
|
+
.refine((data) => {
|
|
15
|
+
if (data.reaction !== constants_1.USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}, {
|
|
20
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
21
|
+
});
|
|
22
|
+
SetReactionToSpellCorrectorJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
23
|
+
uuid: zod_1.z.string().uuid(),
|
|
24
|
+
});
|
|
25
|
+
SetReactionToSpellCorrectorJobCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
data: models_1.SpellCorrectorToolJobSchema,
|
|
27
|
+
});
|
|
28
|
+
})(SetReactionToSpellCorrectorJobCommand || (exports.SetReactionToSpellCorrectorJobCommand = SetReactionToSpellCorrectorJobCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpellCorrectorCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var SpellCorrectorCommand;
|
|
7
|
+
(function (SpellCorrectorCommand) {
|
|
8
|
+
SpellCorrectorCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
modelId: zod_1.z.string().uuid(),
|
|
10
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
11
|
+
});
|
|
12
|
+
SpellCorrectorCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: models_1.ToolJobSchema,
|
|
14
|
+
});
|
|
15
|
+
})(SpellCorrectorCommand || (exports.SpellCorrectorCommand = SpellCorrectorCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateSpellCorrectorJobTitleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var UpdateSpellCorrectorJobTitleCommand;
|
|
7
|
+
(function (UpdateSpellCorrectorJobTitleCommand) {
|
|
8
|
+
UpdateSpellCorrectorJobTitleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
title: zod_1.z.string().min(1).max(40).trim(),
|
|
10
|
+
});
|
|
11
|
+
UpdateSpellCorrectorJobTitleCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateSpellCorrectorJobTitleCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.SpellCorrectorToolJobSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateSpellCorrectorJobTitleCommand || (exports.UpdateSpellCorrectorJobTitleCommand = UpdateSpellCorrectorJobTitleCommand = {}));
|
|
@@ -29,3 +29,4 @@ __exportStar(require("./image-generation"), exports);
|
|
|
29
29
|
__exportStar(require("./marketplace-card"), exports);
|
|
30
30
|
__exportStar(require("./interior-design"), exports);
|
|
31
31
|
__exportStar(require("./solving-edu-task"), exports);
|
|
32
|
+
__exportStar(require("./spell-corrector"), exports);
|
|
@@ -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("./spell-corrector-config.schema"), exports);
|
|
18
|
+
__exportStar(require("./spell-corrector-job.schema"), exports);
|
|
19
|
+
__exportStar(require("./spell-corrector-model.schema"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpellCorrectorToolConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const spell_corrector_model_schema_1 = require("./spell-corrector-model.schema");
|
|
6
|
+
exports.SpellCorrectorToolConfigSchema = zod_1.z.object({
|
|
7
|
+
maxSymbols: zod_1.z.number(),
|
|
8
|
+
models: zod_1.z.array(spell_corrector_model_schema_1.SpellCorrectorModelSchema),
|
|
9
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpellCorrectorToolJobSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
exports.SpellCorrectorToolJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
8
|
+
modelId: zod_1.z.string().uuid().nullable().optional(),
|
|
9
|
+
userInput: zod_1.z.string(),
|
|
10
|
+
aiOutput: zod_1.z.string().nullable().optional(),
|
|
11
|
+
title: zod_1.z.string(),
|
|
12
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpellCorrectorModelSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
|
|
6
|
+
exports.SpellCorrectorModelSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
icon: zod_1.z.string(),
|
|
10
|
+
price: zod_1.z.number(),
|
|
11
|
+
order: zod_1.z.number(),
|
|
12
|
+
canUse: zod_1.z.boolean(),
|
|
13
|
+
unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
|
|
14
|
+
});
|
package/commands/tools/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteSpellCorrectorJobByUUIDCommand {
|
|
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,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindSpellCorrectorJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = SpellCorrectorToolJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: SpellCorrectorToolJobSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindSpellCorrectorJobsCommand {
|
|
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(SpellCorrectorToolJobSchema),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolConfigSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetSpellCorrectorToolConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: SpellCorrectorToolConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './spell-corrector.command';
|
|
2
|
+
export * from './delete-spell-corrector-job-by-uuid.command';
|
|
3
|
+
export * from './delete-all-spell-corrector-jobs.command';
|
|
4
|
+
export * from './set-reaction-to-spell-corrector-job.command';
|
|
5
|
+
export * from './update-spell-corrector-job-title.command';
|
|
6
|
+
export * from './retry-spell-corrector-job.command';
|
|
7
|
+
export * from './find-spell-corrector-job-by-uuid.command';
|
|
8
|
+
export * from './find-spell-corrector-jobs.command';
|
|
9
|
+
export * from './get-spell-corrector-tool-config.command';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetrySpellCorrectorJobCommand {
|
|
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: SpellCorrectorToolJobSchema,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToSpellCorrectorJobCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const RequestParamsSchema = z.object({
|
|
25
|
+
uuid: z.string().uuid(),
|
|
26
|
+
});
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: SpellCorrectorToolJobSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace SpellCorrectorCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string().uuid(),
|
|
7
|
+
prompt: z.string().min(1).max(100000),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: ToolJobSchema,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SpellCorrectorToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateSpellCorrectorJobTitleCommand {
|
|
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: SpellCorrectorToolJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
package/models/tools/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export const SpellCorrectorToolJobSchema = ToolJobSchema.extend({
|
|
6
|
+
modelId: z.string().uuid().nullable().optional(),
|
|
7
|
+
userInput: z.string(),
|
|
8
|
+
aiOutput: z.string().nullable().optional(),
|
|
9
|
+
title: z.string(),
|
|
10
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
|
|
3
|
+
|
|
4
|
+
export const SpellCorrectorModelSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
icon: z.string(),
|
|
8
|
+
price: z.number(),
|
|
9
|
+
order: z.number(),
|
|
10
|
+
canUse: z.boolean(),
|
|
11
|
+
unlockedBy: UnlockedBySchema.nullable(),
|
|
12
|
+
});
|