@purpleschool/gptbot 0.9.37 → 0.9.39

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 (33) hide show
  1. package/build/commands/b2b/get-b2b-documentation.command.js +1 -0
  2. package/build/commands/chat/archive-all.command.js +1 -4
  3. package/build/commands/chat/create-chat.command.js +0 -1
  4. package/build/commands/chat/find-chats.command.js +1 -1
  5. package/build/commands/chat/get-last-active-chat-command.js +0 -1
  6. package/build/commands/message/create-text-message.command.js +1 -0
  7. package/build/constants/ai-model/enums/index.js +0 -1
  8. package/build/constants/model/enums/unified-model-content-type.enum.js +0 -1
  9. package/build/constants/subscription/enums/subscription-feature-type.enum.js +2 -1
  10. package/build/models/ai-model.schema.js +0 -1
  11. package/build/models/chat.schema.js +1 -1
  12. package/build/models/message.schema.js +1 -0
  13. package/build/models/prompt.schema.js +0 -2
  14. package/build/models/subscription-feature.schema.js +11 -3
  15. package/build/models/tools/spell-corrector/spell-corrector-model.schema.js +3 -0
  16. package/commands/b2b/get-b2b-documentation.command.ts +2 -0
  17. package/commands/chat/archive-all.command.ts +2 -4
  18. package/commands/chat/create-chat.command.ts +0 -1
  19. package/commands/chat/find-chats.command.ts +2 -5
  20. package/commands/chat/get-last-active-chat-command.ts +0 -1
  21. package/commands/message/create-text-message.command.ts +1 -0
  22. package/constants/ai-model/enums/index.ts +0 -1
  23. package/constants/model/enums/unified-model-content-type.enum.ts +0 -1
  24. package/constants/subscription/enums/subscription-feature-type.enum.ts +2 -1
  25. package/models/ai-model.schema.ts +1 -7
  26. package/models/chat.schema.ts +1 -1
  27. package/models/message.schema.ts +1 -0
  28. package/models/prompt.schema.ts +0 -2
  29. package/models/subscription-feature.schema.ts +13 -7
  30. package/models/tools/spell-corrector/spell-corrector-model.schema.ts +3 -0
  31. package/package.json +1 -1
  32. package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -7
  33. package/constants/ai-model/enums/ai-model-content-type.enum.ts +0 -7
@@ -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,
@@ -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
  ]);
@@ -2,13 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SpellCorrectorModelSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
5
6
  const unlocked_by_subscription_schema_1 = require("../../unlocked-by-subscription.schema");
6
7
  exports.SpellCorrectorModelSchema = zod_1.z.object({
7
8
  uuid: zod_1.z.string().uuid(),
8
9
  title: zod_1.z.string(),
10
+ description: zod_1.z.string(),
9
11
  icon: zod_1.z.string(),
10
12
  price: zod_1.z.number(),
11
13
  order: zod_1.z.number(),
12
14
  canUse: zod_1.z.boolean(),
15
+ icons: icon_variants_schema_1.IconVariantsSchema,
13
16
  unlockedBy: unlocked_by_subscription_schema_1.UnlockedBySchema.nullable(),
14
17
  });
@@ -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({
@@ -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>;
@@ -1,12 +1,15 @@
1
1
  import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
2
3
  import { UnlockedBySchema } from '../../unlocked-by-subscription.schema';
3
4
 
4
5
  export const SpellCorrectorModelSchema = z.object({
5
6
  uuid: z.string().uuid(),
6
7
  title: z.string(),
8
+ description: z.string(),
7
9
  icon: z.string(),
8
10
  price: z.number(),
9
11
  order: z.number(),
10
12
  canUse: z.boolean(),
13
+ icons: IconVariantsSchema,
11
14
  unlockedBy: UnlockedBySchema.nullable(),
12
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.9.37",
3
+ "version": "0.9.39",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -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,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];