@purpleschool/gptbot 0.9.31 → 0.9.32-stage-2

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 (71) hide show
  1. package/api/controllers/http/index.ts +0 -1
  2. package/api/routes.ts +0 -32
  3. package/build/api/controllers/http/index.js +0 -1
  4. package/build/api/routes.js +0 -22
  5. package/build/commands/b2b/get-b2b-documentation.command.js +1 -0
  6. package/build/commands/chat/archive-all.command.js +1 -4
  7. package/build/commands/chat/create-chat.command.js +0 -1
  8. package/build/commands/chat/find-chats.command.js +1 -1
  9. package/build/commands/chat/get-last-active-chat-command.js +0 -1
  10. package/build/commands/message/create-text-message.command.js +1 -0
  11. package/build/commands/tools/index.js +0 -1
  12. package/build/constants/ai-model/enums/index.js +0 -1
  13. package/build/constants/model/enums/unified-model-content-type.enum.js +0 -1
  14. package/build/constants/subscription/enums/subscription-feature-type.enum.js +2 -1
  15. package/build/models/ai-model.schema.js +0 -1
  16. package/build/models/chat.schema.js +1 -1
  17. package/build/models/message.schema.js +1 -0
  18. package/build/models/prompt.schema.js +0 -2
  19. package/build/models/subscription-feature.schema.js +11 -3
  20. package/build/models/tools/index.js +0 -1
  21. package/build/models/tools/stt/stt-response.schema.js +0 -2
  22. package/commands/b2b/get-b2b-documentation.command.ts +2 -0
  23. package/commands/chat/archive-all.command.ts +2 -4
  24. package/commands/chat/create-chat.command.ts +0 -1
  25. package/commands/chat/find-chats.command.ts +2 -5
  26. package/commands/chat/get-last-active-chat-command.ts +0 -1
  27. package/commands/message/create-text-message.command.ts +1 -0
  28. package/commands/tools/index.ts +0 -1
  29. package/constants/ai-model/enums/index.ts +0 -1
  30. package/constants/model/enums/unified-model-content-type.enum.ts +0 -1
  31. package/constants/subscription/enums/subscription-feature-type.enum.ts +2 -1
  32. package/models/ai-model.schema.ts +1 -7
  33. package/models/chat.schema.ts +1 -1
  34. package/models/message.schema.ts +1 -0
  35. package/models/prompt.schema.ts +0 -2
  36. package/models/subscription-feature.schema.ts +13 -7
  37. package/models/tools/index.ts +0 -1
  38. package/models/tools/stt/stt-response.schema.ts +0 -2
  39. package/package.json +1 -1
  40. package/api/controllers/http/spell-corrector.ts +0 -14
  41. package/build/api/controllers/http/spell-corrector.js +0 -16
  42. package/build/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.js +0 -8
  43. package/build/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.js +0 -11
  44. package/build/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.js +0 -14
  45. package/build/commands/tools/spell-corrector/find-spell-corrector-jobs.command.js +0 -18
  46. package/build/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.js +0 -11
  47. package/build/commands/tools/spell-corrector/index.js +0 -25
  48. package/build/commands/tools/spell-corrector/retry-spell-corrector-job.command.js +0 -14
  49. package/build/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.js +0 -28
  50. package/build/commands/tools/spell-corrector/spell-corrector.command.js +0 -15
  51. package/build/commands/tools/spell-corrector/update-spell-corrector-job-title.command.js +0 -17
  52. package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -7
  53. package/build/models/tools/spell-corrector/index.js +0 -19
  54. package/build/models/tools/spell-corrector/spell-corrector-config.schema.js +0 -9
  55. package/build/models/tools/spell-corrector/spell-corrector-job.schema.js +0 -13
  56. package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +0 -14
  57. package/commands/tools/spell-corrector/delete-all-spell-corrector-jobs.command.ts +0 -6
  58. package/commands/tools/spell-corrector/delete-spell-corrector-job-by-uuid.command.ts +0 -11
  59. package/commands/tools/spell-corrector/find-spell-corrector-job-by-uuid.command.ts +0 -16
  60. package/commands/tools/spell-corrector/find-spell-corrector-jobs.command.ts +0 -18
  61. package/commands/tools/spell-corrector/get-spell-corrector-tool-config.command.ts +0 -10
  62. package/commands/tools/spell-corrector/index.ts +0 -9
  63. package/commands/tools/spell-corrector/retry-spell-corrector-job.command.ts +0 -14
  64. package/commands/tools/spell-corrector/set-reaction-to-spell-corrector-job.command.ts +0 -33
  65. package/commands/tools/spell-corrector/spell-corrector.command.ts +0 -17
  66. package/commands/tools/spell-corrector/update-spell-corrector-job-title.command.ts +0 -19
  67. package/constants/ai-model/enums/ai-model-content-type.enum.ts +0 -7
  68. package/models/tools/spell-corrector/index.ts +0 -3
  69. package/models/tools/spell-corrector/spell-corrector-config.schema.ts +0 -7
  70. package/models/tools/spell-corrector/spell-corrector-job.schema.ts +0 -11
  71. package/models/tools/spell-corrector/spell-corrector-model.schema.ts +0 -12
@@ -59,4 +59,3 @@ 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';
package/api/routes.ts CHANGED
@@ -600,38 +600,6 @@ 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
- },
635
603
  PRESENTATION_PUBLIC: {
636
604
  CONFIG: `${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
637
605
  CREATE: `${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE}`,
@@ -75,4 +75,3 @@ __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);
@@ -479,28 +479,6 @@ 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
- },
504
482
  PRESENTATION_PUBLIC: {
505
483
  CONFIG: `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CONFIG}`,
506
484
  CREATE: `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE}`,
@@ -76,6 +76,7 @@ var GetB2bDocumentationCommand;
76
76
  });
77
77
  const B2bDocImageModelSchema = models_1.ImageGenerationModelSchema.extend({
78
78
  aiModel: zod_1.z.string(),
79
+ iconVariants: models_1.IconVariantsSchema,
79
80
  });
80
81
  GetB2bDocumentationCommand.ReferencesSchema = zod_1.z
81
82
  .object({
@@ -2,11 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ArchiveAllCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../../constants");
6
5
  var ArchiveAllCommand;
7
6
  (function (ArchiveAllCommand) {
8
- ArchiveAllCommand.RequestSchema = zod_1.z.object({
9
- type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
10
- });
7
+ ArchiveAllCommand.RequestSchema = zod_1.z.void();
11
8
  ArchiveAllCommand.ResponseSchema = zod_1.z.void();
12
9
  })(ArchiveAllCommand || (exports.ArchiveAllCommand = ArchiveAllCommand = {}));
@@ -6,7 +6,6 @@ const zod_1 = require("zod");
6
6
  var CreateChatCommand;
7
7
  (function (CreateChatCommand) {
8
8
  CreateChatCommand.RequestSchema = models_1.ChatSchema.pick({
9
- aIModelId: true,
10
9
  categoryId: true,
11
10
  }).extend({
12
11
  folderId: zod_1.z.string().uuid().optional(),
@@ -10,7 +10,7 @@ var FindChatsCommand;
10
10
  offset: zod_1.z.coerce.number().min(0).default(0),
11
11
  title: zod_1.z.string().optional(),
12
12
  });
13
- const QuerySchema = zod_1.z.intersection(models_1.ChatSchema.pick({ categoryId: true, aIModelId: true }).partial(), models_1.AiModelSchema.pick({ contentType: true }).partial());
13
+ const QuerySchema = models_1.ChatSchema.pick({ categoryId: true, lastUsedAiModelId: true }).partial();
14
14
  FindChatsCommand.RequestQuerySchema = zod_1.z.intersection(QuerySchema, PaginationQuerySchema);
15
15
  FindChatsCommand.ResponseSchema = zod_1.z.object({
16
16
  data: zod_1.z.array(models_1.ChatSchema),
@@ -7,7 +7,6 @@ var GetLastActiveChatCommand;
7
7
  (function (GetLastActiveChatCommand) {
8
8
  GetLastActiveChatCommand.RequestQuerySchema = models_1.ChatSchema.pick({
9
9
  categoryId: true,
10
- aIModelId: true,
11
10
  });
12
11
  GetLastActiveChatCommand.Response = zod_1.z.object({
13
12
  data: models_1.ChatWithMessagesSchema,
@@ -10,6 +10,7 @@ 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(),
13
14
  });
14
15
  CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
15
16
  uuid: true,
@@ -28,4 +28,3 @@ __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);
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ai-model-config-selector-type.enum"), exports);
18
- __exportStar(require("./ai-model-content-type.enum"), exports);
19
18
  __exportStar(require("./ai-model-feature.enum"), exports);
20
19
  __exportStar(require("./ai-model-status.enum"), exports);
21
20
  __exportStar(require("./ai-model-strategy.enum"), exports);
@@ -5,7 +5,6 @@ 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";
9
8
  // Tool types
10
9
  UNIFIED_MODEL_CONTENT_TYPE["IMAGE_EDITOR"] = "IMAGE_EDITOR";
11
10
  UNIFIED_MODEL_CONTENT_TYPE["TEXT_TO_SPEECH"] = "TEXT_TO_SPEECH";
@@ -11,6 +11,7 @@ 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";
14
15
  SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_QUOTA"] = "image_generation_quota";
15
16
  SUBSCRIPTION_FEATURE_TYPE["TTS_QUOTA"] = "tts_quota";
16
17
  SUBSCRIPTION_FEATURE_TYPE["STT_QUOTA"] = "stt_quota";
@@ -33,7 +34,7 @@ var SUBSCRIPTION_FEATURE_KIND;
33
34
  (function (SUBSCRIPTION_FEATURE_KIND) {
34
35
  SUBSCRIPTION_FEATURE_KIND["TEXT"] = "text";
35
36
  SUBSCRIPTION_FEATURE_KIND["AI_MODEL"] = "ai_model";
36
- SUBSCRIPTION_FEATURE_KIND["IMAGE"] = "image";
37
+ SUBSCRIPTION_FEATURE_KIND["IMAGE_GENERATION"] = "image_generation";
37
38
  SUBSCRIPTION_FEATURE_KIND["TTS"] = "tts";
38
39
  SUBSCRIPTION_FEATURE_KIND["STT"] = "stt";
39
40
  SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
@@ -15,7 +15,6 @@ 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.enum(Object.values(constants_1.AI_MODEL_CONTENT_TYPE)),
19
18
  features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
20
19
  iconVariants: zod_1.z.object({
21
20
  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(),
11
+ lastUsedAiModelId: zod_1.z.string().uuid().nullable(),
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,6 +9,7 @@ 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(),
12
13
  tokenUsage: zod_1.z.number(),
13
14
  userReaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
14
15
  files: zod_1.z.array(file_schema_1.FileSchema),
@@ -2,11 +2,9 @@
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");
6
5
  exports.PromptSchema = zod_1.z.object({
7
6
  uuid: zod_1.z.string().uuid(),
8
7
  content: zod_1.z.string(),
9
- type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
10
8
  topicId: zod_1.z.string().uuid().nullable(),
11
9
  title: zod_1.z.string().nullable(),
12
10
  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.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.ImageGenerationAccessFeatureSchema = 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({
@@ -36,7 +36,14 @@ exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exten
36
36
  kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.AI_MODEL),
37
37
  order: zod_1.z.number(),
38
38
  modelId: zod_1.z.string(),
39
- contentType: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
39
+ isAvailable: zod_1.z.boolean(),
40
+ maxInputLength: zod_1.z.number(),
41
+ });
42
+ exports.ImageGenerationAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
43
+ type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
44
+ kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
45
+ order: zod_1.z.number(),
46
+ modelId: zod_1.z.string(),
40
47
  isAvailable: zod_1.z.boolean(),
41
48
  maxInputLength: zod_1.z.number(),
42
49
  });
@@ -74,7 +81,7 @@ exports.TtsModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exte
74
81
  modelId: zod_1.z.string(),
75
82
  });
76
83
  exports.ImageGenerationQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
77
- kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE),
84
+ kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
78
85
  type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
79
86
  value: zod_1.z.number(),
80
87
  });
@@ -179,4 +186,5 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
179
186
  exports.ImageEditorModelAccessFeatureSchema,
180
187
  exports.InteriorDesignQuotaFeatureSchema,
181
188
  exports.InteriorDesignModelAccessFeatureSchema,
189
+ exports.ImageGenerationAccessFeatureSchema,
182
190
  ]);
@@ -29,4 +29,3 @@ __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);
@@ -5,6 +5,4 @@ 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(),
10
8
  });
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  import { AI_MODEL_FEATURE } from '../../constants';
3
3
  import {
4
4
  AiModelSchema,
5
+ IconVariantsSchema,
5
6
  ImageGenerationModelSchema,
6
7
  JsonObjectSchema,
7
8
  JsonValueSchema,
@@ -93,6 +94,7 @@ export namespace GetB2bDocumentationCommand {
93
94
 
94
95
  const B2bDocImageModelSchema = ImageGenerationModelSchema.extend({
95
96
  aiModel: z.string(),
97
+ iconVariants: IconVariantsSchema,
96
98
  });
97
99
 
98
100
  export const ReferencesSchema = z
@@ -1,10 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { AI_MODEL_CONTENT_TYPE } from '../../constants';
3
2
 
4
3
  export namespace ArchiveAllCommand {
5
- export const RequestSchema = z.object({
6
- type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
7
- });
4
+ export const RequestSchema = z.void();
5
+ export type Request = z.infer<typeof ResponseSchema>;
8
6
 
9
7
  export const ResponseSchema = z.void();
10
8
  export type Response = z.infer<typeof ResponseSchema>;
@@ -3,7 +3,6 @@ import { z } from 'zod';
3
3
 
4
4
  export namespace CreateChatCommand {
5
5
  export const RequestSchema = ChatSchema.pick({
6
- aIModelId: true,
7
6
  categoryId: true,
8
7
  }).extend({
9
8
  folderId: z.string().uuid().optional(),
@@ -1,4 +1,4 @@
1
- import { AiModelSchema, ChatSchema } from '../../models';
1
+ import { ChatSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatsCommand {
@@ -8,10 +8,7 @@ export namespace FindChatsCommand {
8
8
  title: z.string().optional(),
9
9
  });
10
10
 
11
- const QuerySchema = z.intersection(
12
- ChatSchema.pick({ categoryId: true, aIModelId: true }).partial(),
13
- AiModelSchema.pick({ contentType: true }).partial(),
14
- );
11
+ const QuerySchema = ChatSchema.pick({ categoryId: true, lastUsedAiModelId: true }).partial();
15
12
 
16
13
  export const RequestQuerySchema = z.intersection(QuerySchema, PaginationQuerySchema);
17
14
 
@@ -4,7 +4,6 @@ import { z } from 'zod';
4
4
  export namespace GetLastActiveChatCommand {
5
5
  export const RequestQuerySchema = ChatSchema.pick({
6
6
  categoryId: true,
7
- aIModelId: true,
8
7
  });
9
8
 
10
9
  export const Response = z.object({
@@ -7,6 +7,7 @@ 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(),
10
11
  });
11
12
 
12
13
  export const RequestParamSchema = ChatSchema.pick({
@@ -12,4 +12,3 @@ 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';
@@ -1,5 +1,4 @@
1
1
  export * from './ai-model-config-selector-type.enum';
2
- export * from './ai-model-content-type.enum';
3
2
  export * from './ai-model-feature.enum';
4
3
  export * from './ai-model-status.enum';
5
4
  export * from './ai-model-strategy.enum';
@@ -1,7 +1,6 @@
1
1
  export enum UNIFIED_MODEL_CONTENT_TYPE {
2
2
  // AI Model types
3
3
  TEXT = 'TEXT',
4
- IMAGE = 'IMAGE',
5
4
  // Tool types
6
5
  IMAGE_EDITOR = 'IMAGE_EDITOR',
7
6
  TEXT_TO_SPEECH = 'TEXT_TO_SPEECH',
@@ -7,6 +7,7 @@ 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',
10
11
  IMAGE_GENERATION_QUOTA = 'image_generation_quota',
11
12
  TTS_QUOTA = 'tts_quota',
12
13
  STT_QUOTA = 'stt_quota',
@@ -29,7 +30,7 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
29
30
  export enum SUBSCRIPTION_FEATURE_KIND {
30
31
  TEXT = 'text',
31
32
  AI_MODEL = 'ai_model',
32
- IMAGE = 'image',
33
+ IMAGE_GENERATION = 'image_generation',
33
34
  TTS = 'tts',
34
35
  STT = 'stt',
35
36
  PRESENTATIONS = 'presentations',
@@ -1,10 +1,5 @@
1
1
  import { z } from 'zod';
2
- import {
3
- AI_MODEL_CONTENT_TYPE,
4
- AI_MODEL_FEATURE,
5
- AI_MODEL_STATUS,
6
- TAIModelContentTypeEnum,
7
- } from '../constants';
2
+ import { AI_MODEL_FEATURE, AI_MODEL_STATUS } from '../constants';
8
3
  import { AiModelConfigSchema } from './ai-model-config.schema';
9
4
 
10
5
  export const AiModelSchema = z.object({
@@ -18,7 +13,6 @@ export const AiModelSchema = z.object({
18
13
  order: z.number(),
19
14
  canUse: z.optional(z.boolean()),
20
15
  status: z.nativeEnum(AI_MODEL_STATUS),
21
- contentType: z.enum(Object.values(AI_MODEL_CONTENT_TYPE) as [TAIModelContentTypeEnum]),
22
16
  features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
23
17
  iconVariants: z.object({
24
18
  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(),
9
+ lastUsedAiModelId: z.string().uuid().nullable(),
10
10
  title: z.string(),
11
11
  chatStatus: z.enum(Object.values(CHAT_STATUS_ENUM) as [TChatStatusEnum]),
12
12
  folderId: z.string().nullable(),
@@ -7,6 +7,7 @@ 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(),
10
11
  tokenUsage: z.number(),
11
12
  userReaction: z.nativeEnum(USER_REACTION).nullable(),
12
13
  files: z.array(FileSchema),
@@ -1,10 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { AI_MODEL_CONTENT_TYPE } from '../constants';
3
2
 
4
3
  export const PromptSchema = z.object({
5
4
  uuid: z.string().uuid(),
6
5
  content: z.string(),
7
- type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
8
6
  topicId: z.string().uuid().nullable(),
9
7
  title: z.string().nullable(),
10
8
 
@@ -1,8 +1,4 @@
1
- import {
2
- AI_MODEL_CONTENT_TYPE,
3
- SUBSCRIPTION_FEATURE_KIND,
4
- SUBSCRIPTION_FEATURE_TYPE,
5
- } from '../constants';
1
+ import { SUBSCRIPTION_FEATURE_KIND, SUBSCRIPTION_FEATURE_TYPE } from '../constants';
6
2
  import { z } from 'zod';
7
3
 
8
4
  export const SubscriptionFeatureBaseSchema = z.object({
@@ -45,12 +41,21 @@ export const AiModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
45
41
  kind: z.literal(SUBSCRIPTION_FEATURE_KIND.AI_MODEL),
46
42
  order: z.number(),
47
43
  modelId: z.string(),
48
- contentType: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
49
44
  isAvailable: z.boolean(),
50
45
  maxInputLength: z.number(),
51
46
  });
52
47
  export type AiModelAccessFeature = z.infer<typeof AiModelAccessFeatureSchema>;
53
48
 
49
+ export const ImageGenerationAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
50
+ type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
51
+ kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
52
+ order: z.number(),
53
+ modelId: z.string(),
54
+ isAvailable: z.boolean(),
55
+ maxInputLength: z.number(),
56
+ });
57
+ export type ImageGenerationAccessFeature = z.infer<typeof ImageGenerationAccessFeatureSchema>;
58
+
54
59
  export const RequestsQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
55
60
  type: z.literal(SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
56
61
  kind: z.literal(SUBSCRIPTION_FEATURE_KIND.TEXT),
@@ -97,7 +102,7 @@ export const TtsModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend(
97
102
  export type TtsModelAccessFeature = z.infer<typeof TtsModelAccessFeatureSchema>;
98
103
 
99
104
  export const ImageGenerationQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
100
- kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE),
105
+ kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
101
106
  type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
102
107
  value: z.number(),
103
108
  });
@@ -234,6 +239,7 @@ export const SubscriptionFeatureSchema = z.union([
234
239
  ImageEditorModelAccessFeatureSchema,
235
240
  InteriorDesignQuotaFeatureSchema,
236
241
  InteriorDesignModelAccessFeatureSchema,
242
+ ImageGenerationAccessFeatureSchema,
237
243
  ]);
238
244
 
239
245
  export type SubscriptionFeature = z.infer<typeof SubscriptionFeatureSchema>;
@@ -13,4 +13,3 @@ 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';
@@ -3,8 +3,6 @@ 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(),
8
6
  });
9
7
 
10
8
  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.31",
3
+ "version": "0.9.32-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,14 +0,0 @@
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;
@@ -1,16 +0,0 @@
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
- };
@@ -1,8 +0,0 @@
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 = {}));
@@ -1,11 +0,0 @@
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 = {}));
@@ -1,14 +0,0 @@
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 = {}));
@@ -1,18 +0,0 @@
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 = {}));
@@ -1,11 +0,0 @@
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 = {}));
@@ -1,25 +0,0 @@
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);
@@ -1,14 +0,0 @@
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 = {}));
@@ -1,28 +0,0 @@
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 = {}));
@@ -1,15 +0,0 @@
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 = {}));
@@ -1,17 +0,0 @@
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,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AI_MODEL_CONTENT_TYPE = void 0;
4
- exports.AI_MODEL_CONTENT_TYPE = {
5
- TEXT: 'TEXT',
6
- IMAGE: 'IMAGE',
7
- };
@@ -1,19 +0,0 @@
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);
@@ -1,9 +0,0 @@
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
- });
@@ -1,13 +0,0 @@
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
- });
@@ -1,14 +0,0 @@
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
- });
@@ -1,6 +0,0 @@
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
- }
@@ -1,11 +0,0 @@
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
- }
@@ -1,16 +0,0 @@
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
- }
@@ -1,18 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
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';
@@ -1,14 +0,0 @@
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
- }
@@ -1,33 +0,0 @@
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
- }
@@ -1,17 +0,0 @@
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
- }
@@ -1,19 +0,0 @@
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,7 +0,0 @@
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,3 +0,0 @@
1
- export * from './spell-corrector-config.schema';
2
- export * from './spell-corrector-job.schema';
3
- export * from './spell-corrector-model.schema';
@@ -1,7 +0,0 @@
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
- });
@@ -1,11 +0,0 @@
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
- });
@@ -1,12 +0,0 @@
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
- });