@purpleschool/gptbot 0.9.38 → 0.9.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/b2b/get-b2b-documentation.command.js +1 -0
- package/build/commands/chat/archive-all.command.js +1 -4
- package/build/commands/chat/create-chat.command.js +0 -1
- package/build/commands/chat/find-chats.command.js +1 -1
- package/build/commands/chat/get-last-active-chat-command.js +0 -1
- package/build/commands/message/create-text-message.command.js +1 -0
- package/build/constants/ai-model/enums/index.js +0 -1
- package/build/constants/model/enums/unified-model-content-type.enum.js +0 -1
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +2 -1
- package/build/models/ai-model.schema.js +0 -1
- package/build/models/chat.schema.js +1 -1
- package/build/models/message.schema.js +1 -0
- package/build/models/prompt.schema.js +0 -2
- package/build/models/subscription-feature.schema.js +11 -3
- package/build/models/tools/video-editor/video-editor-job.schema.js +6 -1
- package/commands/b2b/get-b2b-documentation.command.ts +2 -0
- package/commands/chat/archive-all.command.ts +2 -4
- package/commands/chat/create-chat.command.ts +0 -1
- package/commands/chat/find-chats.command.ts +2 -5
- package/commands/chat/get-last-active-chat-command.ts +0 -1
- package/commands/message/create-text-message.command.ts +1 -0
- package/constants/ai-model/enums/index.ts +0 -1
- package/constants/model/enums/unified-model-content-type.enum.ts +0 -1
- package/constants/subscription/enums/subscription-feature-type.enum.ts +2 -1
- package/models/ai-model.schema.ts +1 -7
- package/models/chat.schema.ts +1 -1
- package/models/message.schema.ts +1 -0
- package/models/prompt.schema.ts +0 -2
- package/models/subscription-feature.schema.ts +13 -7
- package/models/tools/video-editor/video-editor-job.schema.ts +8 -0
- package/package.json +1 -1
- package/build/constants/ai-model/enums/ai-model-content-type.enum.js +0 -7
- 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.
|
|
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 = {}));
|
|
@@ -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 =
|
|
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["
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
]);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VideoEditorJobSchema = void 0;
|
|
3
|
+
exports.VideoEditorJobSchema = exports.VideoEditorJobParamsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../../../constants");
|
|
6
6
|
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
7
|
+
exports.VideoEditorJobParamsSchema = zod_1.z.object({
|
|
8
|
+
duration: zod_1.z.number().optional(),
|
|
9
|
+
resolution: zod_1.z.string().optional(),
|
|
10
|
+
});
|
|
7
11
|
exports.VideoEditorJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
8
12
|
title: zod_1.z.string(),
|
|
9
13
|
prompt: zod_1.z.string(),
|
|
@@ -23,6 +27,7 @@ exports.VideoEditorJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
|
23
27
|
url: zod_1.z.string(),
|
|
24
28
|
})
|
|
25
29
|
.nullable(),
|
|
30
|
+
params: exports.VideoEditorJobParamsSchema.optional(),
|
|
26
31
|
modelId: zod_1.z.string(),
|
|
27
32
|
isPublished: zod_1.z.boolean(),
|
|
28
33
|
postId: zod_1.z.string().nullable(),
|
|
@@ -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.
|
|
6
|
-
|
|
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>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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 =
|
|
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
|
|
|
@@ -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({
|
|
@@ -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
|
-
|
|
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({
|
package/models/chat.schema.ts
CHANGED
|
@@ -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
|
-
|
|
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(),
|
package/models/message.schema.ts
CHANGED
|
@@ -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),
|
package/models/prompt.schema.ts
CHANGED
|
@@ -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.
|
|
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>;
|
|
@@ -2,6 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
import { USER_REACTION } from '../../../constants';
|
|
3
3
|
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
4
|
|
|
5
|
+
export const VideoEditorJobParamsSchema = z.object({
|
|
6
|
+
duration: z.number().optional(),
|
|
7
|
+
resolution: z.string().optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type VideoEditorJobParams = z.infer<typeof VideoEditorJobParamsSchema>;
|
|
11
|
+
|
|
5
12
|
export const VideoEditorJobSchema = ToolJobSchema.extend({
|
|
6
13
|
title: z.string(),
|
|
7
14
|
prompt: z.string(),
|
|
@@ -21,6 +28,7 @@ export const VideoEditorJobSchema = ToolJobSchema.extend({
|
|
|
21
28
|
url: z.string(),
|
|
22
29
|
})
|
|
23
30
|
.nullable(),
|
|
31
|
+
params: VideoEditorJobParamsSchema.optional(),
|
|
24
32
|
modelId: z.string(),
|
|
25
33
|
isPublished: z.boolean(),
|
|
26
34
|
postId: z.string().nullable(),
|
package/package.json
CHANGED