@purpleschool/gptbot 0.9.30 → 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.
Files changed (63) hide show
  1. package/api/controllers/http/index.ts +1 -0
  2. package/api/controllers/http/spell-corrector.ts +14 -0
  3. package/api/routes.ts +32 -0
  4. package/build/api/controllers/http/index.js +1 -0
  5. package/build/api/controllers/http/spell-corrector.js +16 -0
  6. package/build/api/routes.js +22 -0
  7. package/build/commands/chat/create-chat.command.js +1 -0
  8. package/build/commands/chat/get-last-active-chat-command.js +1 -0
  9. package/build/commands/message/create-text-message.command.js +0 -1
  10. package/build/commands/tools/index.js +1 -0
  11. package/build/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.js +8 -0
  12. package/build/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.js +11 -0
  13. package/build/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.js +14 -0
  14. package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.js +18 -0
  15. package/build/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.js +11 -0
  16. package/build/commands/tools/spell-corrector/index.js +25 -0
  17. package/build/commands/tools/spell-corrector/retry-spell-corrector-job.command.js +14 -0
  18. package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.js +28 -0
  19. package/build/commands/tools/spell-corrector/spell-corrector.command.js +15 -0
  20. package/build/commands/tools/spell-corrector/update-spell-corrector-job-title.command.js +17 -0
  21. package/build/constants/ai-model/enums/ai-model-content-type.enum.js +4 -5
  22. package/build/constants/model/enums/unified-model-content-type.enum.js +1 -0
  23. package/build/constants/subscription/enums/subscription-feature-type.enum.js +1 -2
  24. package/build/models/ai-model.schema.js +1 -1
  25. package/build/models/chat.schema.js +1 -1
  26. package/build/models/message.schema.js +0 -1
  27. package/build/models/prompt.schema.js +2 -0
  28. package/build/models/subscription-feature.schema.js +2 -11
  29. package/build/models/tools/index.js +1 -0
  30. package/build/models/tools/spell-corrector/index.js +19 -0
  31. package/build/models/tools/spell-corrector/spell-corrector-config.schema.js +9 -0
  32. package/build/models/tools/spell-corrector/spell-corrector-job.schema.js +13 -0
  33. package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +14 -0
  34. package/build/models/tools/stt/stt-response.schema.js +2 -0
  35. package/commands/chat/create-chat.command.ts +1 -0
  36. package/commands/chat/get-last-active-chat-command.ts +1 -0
  37. package/commands/message/create-text-message.command.ts +0 -1
  38. package/commands/tools/index.ts +1 -0
  39. package/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.ts +6 -0
  40. package/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.ts +11 -0
  41. package/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.ts +16 -0
  42. package/commands/tools/spell-corrector/find-spell-corrector-jobs.command.ts +18 -0
  43. package/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.ts +10 -0
  44. package/commands/tools/spell-corrector/index.ts +9 -0
  45. package/commands/tools/spell-corrector/retry-spell-corrector-job.command.ts +14 -0
  46. package/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.ts +33 -0
  47. package/commands/tools/spell-corrector/spell-corrector.command.ts +17 -0
  48. package/commands/tools/spell-corrector/update-spell-corrector-job-title.command.ts +19 -0
  49. package/constants/ai-model/enums/ai-model-content-type.enum.ts +7 -4
  50. package/constants/model/enums/unified-model-content-type.enum.ts +1 -0
  51. package/constants/subscription/enums/subscription-feature-type.enum.ts +1 -2
  52. package/models/ai-model.schema.ts +7 -2
  53. package/models/chat.schema.ts +1 -1
  54. package/models/message.schema.ts +0 -1
  55. package/models/prompt.schema.ts +2 -0
  56. package/models/subscription-feature.schema.ts +1 -12
  57. package/models/tools/index.ts +1 -0
  58. package/models/tools/spell-corrector/index.ts +3 -0
  59. package/models/tools/spell-corrector/spell-corrector-config.schema.ts +7 -0
  60. package/models/tools/spell-corrector/spell-corrector-job.schema.ts +11 -0
  61. package/models/tools/spell-corrector/spell-corrector-model.schema.ts +12 -0
  62. package/models/tools/stt/stt-response.schema.ts +2 -0
  63. package/package.json +1 -1
@@ -59,3 +59,4 @@ export * from './image-generation';
59
59
  export * from './marketplace-card';
60
60
  export * from './interior-design';
61
61
  export * from './solving-edu-task';
62
+ export * from './spell-corrector';
@@ -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
+ };
@@ -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}`,
@@ -6,6 +6,7 @@ const zod_1 = require("zod");
6
6
  var CreateChatCommand;
7
7
  (function (CreateChatCommand) {
8
8
  CreateChatCommand.RequestSchema = models_1.ChatSchema.pick({
9
+ aIModelId: true,
9
10
  categoryId: true,
10
11
  }).extend({
11
12
  folderId: zod_1.z.string().uuid().optional(),
@@ -7,6 +7,7 @@ var GetLastActiveChatCommand;
7
7
  (function (GetLastActiveChatCommand) {
8
8
  GetLastActiveChatCommand.RequestQuerySchema = models_1.ChatSchema.pick({
9
9
  categoryId: true,
10
+ aIModelId: true,
10
11
  });
11
12
  GetLastActiveChatCommand.Response = zod_1.z.object({
12
13
  data: models_1.ChatWithMessagesSchema,
@@ -10,7 +10,6 @@ var CreateTextMessageCommand;
10
10
  text: zod_1.z.string(),
11
11
  files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
12
12
  features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
13
- aiModelId: zod_1.z.string().uuid(),
14
13
  });
15
14
  CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
16
15
  uuid: true,
@@ -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 = {}));
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AI_MODEL_CONTENT_TYPE = void 0;
4
- var AI_MODEL_CONTENT_TYPE;
5
- (function (AI_MODEL_CONTENT_TYPE) {
6
- AI_MODEL_CONTENT_TYPE["TEXT"] = "TEXT";
7
- AI_MODEL_CONTENT_TYPE["IMAGE"] = "IMAGE";
8
- })(AI_MODEL_CONTENT_TYPE || (exports.AI_MODEL_CONTENT_TYPE = AI_MODEL_CONTENT_TYPE = {}));
4
+ exports.AI_MODEL_CONTENT_TYPE = {
5
+ TEXT: 'TEXT',
6
+ IMAGE: 'IMAGE',
7
+ };
@@ -5,6 +5,7 @@ var UNIFIED_MODEL_CONTENT_TYPE;
5
5
  (function (UNIFIED_MODEL_CONTENT_TYPE) {
6
6
  // AI Model types
7
7
  UNIFIED_MODEL_CONTENT_TYPE["TEXT"] = "TEXT";
8
+ UNIFIED_MODEL_CONTENT_TYPE["IMAGE"] = "IMAGE";
8
9
  // Tool types
9
10
  UNIFIED_MODEL_CONTENT_TYPE["IMAGE_EDITOR"] = "IMAGE_EDITOR";
10
11
  UNIFIED_MODEL_CONTENT_TYPE["TEXT_TO_SPEECH"] = "TEXT_TO_SPEECH";
@@ -11,7 +11,6 @@ var SUBSCRIPTION_FEATURE_TYPE;
11
11
  SUBSCRIPTION_FEATURE_TYPE["ADVANCED_TOOLS_ACCESS"] = "advanced_tools_access";
12
12
  SUBSCRIPTION_FEATURE_TYPE["STT_MODEL_ACCESS"] = "stt_model_access";
13
13
  SUBSCRIPTION_FEATURE_TYPE["TTS_MODEL_ACCESS"] = "tts_model_access";
14
- SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_ACCESS"] = "image_generation_access";
15
14
  SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_QUOTA"] = "image_generation_quota";
16
15
  SUBSCRIPTION_FEATURE_TYPE["TTS_QUOTA"] = "tts_quota";
17
16
  SUBSCRIPTION_FEATURE_TYPE["STT_QUOTA"] = "stt_quota";
@@ -34,7 +33,7 @@ var SUBSCRIPTION_FEATURE_KIND;
34
33
  (function (SUBSCRIPTION_FEATURE_KIND) {
35
34
  SUBSCRIPTION_FEATURE_KIND["TEXT"] = "text";
36
35
  SUBSCRIPTION_FEATURE_KIND["AI_MODEL"] = "ai_model";
37
- SUBSCRIPTION_FEATURE_KIND["IMAGE_GENERATION"] = "image_generation";
36
+ SUBSCRIPTION_FEATURE_KIND["IMAGE"] = "image";
38
37
  SUBSCRIPTION_FEATURE_KIND["TTS"] = "tts";
39
38
  SUBSCRIPTION_FEATURE_KIND["STT"] = "stt";
40
39
  SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
@@ -15,7 +15,7 @@ exports.AiModelSchema = zod_1.z.object({
15
15
  order: zod_1.z.number(),
16
16
  canUse: zod_1.z.optional(zod_1.z.boolean()),
17
17
  status: zod_1.z.nativeEnum(constants_1.AI_MODEL_STATUS),
18
- contentType: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
18
+ contentType: zod_1.z.enum(Object.values(constants_1.AI_MODEL_CONTENT_TYPE)),
19
19
  features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
20
20
  iconVariants: zod_1.z.object({
21
21
  light: zod_1.z.object({
@@ -8,7 +8,7 @@ exports.ChatSchema = zod_1.z.object({
8
8
  userId: zod_1.z.nullable(zod_1.z.string().uuid()),
9
9
  unregisteredUserId: zod_1.z.nullable(zod_1.z.string().uuid()),
10
10
  categoryId: zod_1.z.string().uuid(),
11
- aIModelId: zod_1.z.string().uuid().nullable(),
11
+ aIModelId: zod_1.z.string().uuid(),
12
12
  title: zod_1.z.string(),
13
13
  chatStatus: zod_1.z.enum(Object.values(constants_1.CHAT_STATUS_ENUM)),
14
14
  folderId: zod_1.z.string().nullable(),
@@ -9,7 +9,6 @@ exports.MessageSchema = zod_1.z.object({
9
9
  text: zod_1.z.string().max(10000),
10
10
  chatId: zod_1.z.nullable(zod_1.z.string().uuid()),
11
11
  role: zod_1.z.string(),
12
- aiModelId: zod_1.z.string().nullable(),
13
12
  tokenUsage: zod_1.z.number(),
14
13
  userReaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
15
14
  files: zod_1.z.array(file_schema_1.FileSchema),
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PromptSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const constants_1 = require("../constants");
5
6
  exports.PromptSchema = zod_1.z.object({
6
7
  uuid: zod_1.z.string().uuid(),
7
8
  content: zod_1.z.string(),
9
+ type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
8
10
  topicId: zod_1.z.string().uuid().nullable(),
9
11
  title: zod_1.z.string().nullable(),
10
12
  createdAt: zod_1.z.date(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.ImageGenerationAccessFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
3
+ exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
4
4
  const constants_1 = require("../constants");
5
5
  const zod_1 = require("zod");
6
6
  exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
@@ -40,14 +40,6 @@ exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exten
40
40
  isAvailable: zod_1.z.boolean(),
41
41
  maxInputLength: zod_1.z.number(),
42
42
  });
43
- exports.ImageGenerationAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
44
- type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
45
- kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
46
- order: zod_1.z.number(),
47
- modelId: zod_1.z.string(),
48
- isAvailable: zod_1.z.boolean(),
49
- maxInputLength: zod_1.z.number(),
50
- });
51
43
  exports.RequestsQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
52
44
  type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
53
45
  kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.TEXT),
@@ -82,7 +74,7 @@ exports.TtsModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exte
82
74
  modelId: zod_1.z.string(),
83
75
  });
84
76
  exports.ImageGenerationQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
85
- kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
77
+ kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE),
86
78
  type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
87
79
  value: zod_1.z.number(),
88
80
  });
@@ -187,5 +179,4 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
187
179
  exports.ImageEditorModelAccessFeatureSchema,
188
180
  exports.InteriorDesignQuotaFeatureSchema,
189
181
  exports.InteriorDesignModelAccessFeatureSchema,
190
- exports.ImageGenerationAccessFeatureSchema,
191
182
  ]);
@@ -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
+ });
@@ -5,4 +5,6 @@ const zod_1 = require("zod");
5
5
  exports.STTResponseSchema = zod_1.z.object({
6
6
  raw: zod_1.z.object({}),
7
7
  md: zod_1.z.string(),
8
+ txtUrl: zod_1.z.string().optional(),
9
+ srtUrl: zod_1.z.string().optional(),
8
10
  });
@@ -3,6 +3,7 @@ import { z } from 'zod';
3
3
 
4
4
  export namespace CreateChatCommand {
5
5
  export const RequestSchema = ChatSchema.pick({
6
+ aIModelId: true,
6
7
  categoryId: true,
7
8
  }).extend({
8
9
  folderId: z.string().uuid().optional(),
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
  export namespace GetLastActiveChatCommand {
5
5
  export const RequestQuerySchema = ChatSchema.pick({
6
6
  categoryId: true,
7
+ aIModelId: true,
7
8
  });
8
9
 
9
10
  export const Response = z.object({
@@ -7,7 +7,6 @@ export namespace CreateTextMessageCommand {
7
7
  text: z.string(),
8
8
  files: z.array(z.string().uuid()).optional().default([]),
9
9
  features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
10
- aiModelId: z.string().uuid(),
11
10
  });
12
11
 
13
12
  export const RequestParamSchema = ChatSchema.pick({
@@ -12,3 +12,4 @@ export * from './image-generation';
12
12
  export * from './marketplace-card';
13
13
  export * from './interior-design';
14
14
  export * from './solving-edu-task';
15
+ export * from './spell-corrector';
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllSpellCorrectorJobsCommand {
4
+ export const ResponseSchema = z.void();
5
+ export type Response = z.infer<typeof ResponseSchema>;
6
+ }
@@ -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
+ }
@@ -1,4 +1,7 @@
1
- export enum AI_MODEL_CONTENT_TYPE {
2
- TEXT = 'TEXT',
3
- IMAGE = 'IMAGE',
4
- }
1
+ export const AI_MODEL_CONTENT_TYPE = {
2
+ TEXT: 'TEXT',
3
+ IMAGE: 'IMAGE',
4
+ } as const;
5
+
6
+ export type TAIModelContentTypeEnum =
7
+ (typeof AI_MODEL_CONTENT_TYPE)[keyof typeof AI_MODEL_CONTENT_TYPE];
@@ -1,6 +1,7 @@
1
1
  export enum UNIFIED_MODEL_CONTENT_TYPE {
2
2
  // AI Model types
3
3
  TEXT = 'TEXT',
4
+ IMAGE = 'IMAGE',
4
5
  // Tool types
5
6
  IMAGE_EDITOR = 'IMAGE_EDITOR',
6
7
  TEXT_TO_SPEECH = 'TEXT_TO_SPEECH',
@@ -7,7 +7,6 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
7
7
  ADVANCED_TOOLS_ACCESS = 'advanced_tools_access',
8
8
  STT_MODEL_ACCESS = 'stt_model_access',
9
9
  TTS_MODEL_ACCESS = 'tts_model_access',
10
- IMAGE_GENERATION_ACCESS = 'image_generation_access',
11
10
  IMAGE_GENERATION_QUOTA = 'image_generation_quota',
12
11
  TTS_QUOTA = 'tts_quota',
13
12
  STT_QUOTA = 'stt_quota',
@@ -30,7 +29,7 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
30
29
  export enum SUBSCRIPTION_FEATURE_KIND {
31
30
  TEXT = 'text',
32
31
  AI_MODEL = 'ai_model',
33
- IMAGE_GENERATION = 'image_generation',
32
+ IMAGE = 'image',
34
33
  TTS = 'tts',
35
34
  STT = 'stt',
36
35
  PRESENTATIONS = 'presentations',
@@ -1,5 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { AI_MODEL_CONTENT_TYPE, AI_MODEL_FEATURE, AI_MODEL_STATUS } from '../constants';
2
+ import {
3
+ AI_MODEL_CONTENT_TYPE,
4
+ AI_MODEL_FEATURE,
5
+ AI_MODEL_STATUS,
6
+ TAIModelContentTypeEnum,
7
+ } from '../constants';
3
8
  import { AiModelConfigSchema } from './ai-model-config.schema';
4
9
 
5
10
  export const AiModelSchema = z.object({
@@ -13,7 +18,7 @@ export const AiModelSchema = z.object({
13
18
  order: z.number(),
14
19
  canUse: z.optional(z.boolean()),
15
20
  status: z.nativeEnum(AI_MODEL_STATUS),
16
- contentType: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
21
+ contentType: z.enum(Object.values(AI_MODEL_CONTENT_TYPE) as [TAIModelContentTypeEnum]),
17
22
  features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
18
23
  iconVariants: z.object({
19
24
  light: z.object({
@@ -6,7 +6,7 @@ export const ChatSchema = z.object({
6
6
  userId: z.nullable(z.string().uuid()),
7
7
  unregisteredUserId: z.nullable(z.string().uuid()),
8
8
  categoryId: z.string().uuid(),
9
- aIModelId: z.string().uuid().nullable(),
9
+ aIModelId: z.string().uuid(),
10
10
  title: z.string(),
11
11
  chatStatus: z.enum(Object.values(CHAT_STATUS_ENUM) as [TChatStatusEnum]),
12
12
  folderId: z.string().nullable(),
@@ -7,7 +7,6 @@ export const MessageSchema = z.object({
7
7
  text: z.string().max(10000),
8
8
  chatId: z.nullable(z.string().uuid()),
9
9
  role: z.string(),
10
- aiModelId: z.string().nullable(),
11
10
  tokenUsage: z.number(),
12
11
  userReaction: z.nativeEnum(USER_REACTION).nullable(),
13
12
  files: z.array(FileSchema),
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
+ import { AI_MODEL_CONTENT_TYPE } from '../constants';
2
3
 
3
4
  export const PromptSchema = z.object({
4
5
  uuid: z.string().uuid(),
5
6
  content: z.string(),
7
+ type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
6
8
  topicId: z.string().uuid().nullable(),
7
9
  title: z.string().nullable(),
8
10
 
@@ -51,16 +51,6 @@ export const AiModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
51
51
  });
52
52
  export type AiModelAccessFeature = z.infer<typeof AiModelAccessFeatureSchema>;
53
53
 
54
- export const ImageGenerationAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
55
- type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
56
- kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
57
- order: z.number(),
58
- modelId: z.string(),
59
- isAvailable: z.boolean(),
60
- maxInputLength: z.number(),
61
- });
62
- export type ImageGenerationAccessFeature = z.infer<typeof ImageGenerationAccessFeatureSchema>;
63
-
64
54
  export const RequestsQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
65
55
  type: z.literal(SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
66
56
  kind: z.literal(SUBSCRIPTION_FEATURE_KIND.TEXT),
@@ -107,7 +97,7 @@ export const TtsModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend(
107
97
  export type TtsModelAccessFeature = z.infer<typeof TtsModelAccessFeatureSchema>;
108
98
 
109
99
  export const ImageGenerationQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
110
- kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
100
+ kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE),
111
101
  type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
112
102
  value: z.number(),
113
103
  });
@@ -244,7 +234,6 @@ export const SubscriptionFeatureSchema = z.union([
244
234
  ImageEditorModelAccessFeatureSchema,
245
235
  InteriorDesignQuotaFeatureSchema,
246
236
  InteriorDesignModelAccessFeatureSchema,
247
- ImageGenerationAccessFeatureSchema,
248
237
  ]);
249
238
 
250
239
  export type SubscriptionFeature = z.infer<typeof SubscriptionFeatureSchema>;
@@ -13,3 +13,4 @@ export * from './image-generation';
13
13
  export * from './marketplace-card';
14
14
  export * from './interior-design';
15
15
  export * from './solving-edu-task';
16
+ export * from './spell-corrector';
@@ -0,0 +1,3 @@
1
+ export * from './spell-corrector-config.schema';
2
+ export * from './spell-corrector-job.schema';
3
+ export * from './spell-corrector-model.schema';
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import { SpellCorrectorModelSchema } from './spell-corrector-model.schema';
3
+
4
+ export const SpellCorrectorToolConfigSchema = z.object({
5
+ maxSymbols: z.number(),
6
+ models: z.array(SpellCorrectorModelSchema),
7
+ });
@@ -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
+ });
@@ -3,6 +3,8 @@ import { z } from 'zod';
3
3
  export const STTResponseSchema = z.object({
4
4
  raw: z.object({}),
5
5
  md: z.string(),
6
+ txtUrl: z.string().optional(),
7
+ srtUrl: z.string().optional(),
6
8
  });
7
9
 
8
10
  export type STTResponse = z.infer<typeof STTResponseSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.9.30",
3
+ "version": "0.9.31",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",