@purpleschool/gptbot 0.9.6 → 0.9.7
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/chat/create-chat.command.js +1 -0
- package/build/commands/chat/get-last-active-chat-command.js +1 -0
- package/build/commands/message/create-text-message.command.js +0 -1
- package/build/constants/ai-model/enums/ai-model-content-type.enum.js +4 -4
- package/build/constants/index.js +0 -1
- package/build/constants/model/enums/unified-model-content-type.enum.js +1 -0
- package/build/constants/subscription/enums/subscription-feature-type.enum.js +1 -2
- package/build/models/ai-model.schema.js +1 -1
- package/build/models/chat.schema.js +1 -1
- package/build/models/prompt.schema.js +2 -0
- package/build/models/subscription-feature.schema.js +2 -11
- package/commands/chat/create-chat.command.ts +1 -0
- package/commands/chat/get-last-active-chat-command.ts +1 -0
- package/commands/message/create-text-message.command.ts +0 -1
- package/constants/ai-model/enums/ai-model-content-type.enum.ts +7 -3
- package/constants/index.ts +0 -1
- package/constants/model/enums/unified-model-content-type.enum.ts +1 -0
- package/constants/subscription/enums/subscription-feature-type.enum.ts +1 -2
- package/models/ai-model.schema.ts +7 -2
- package/models/chat.schema.ts +1 -1
- package/models/prompt.schema.ts +2 -0
- package/models/subscription-feature.schema.ts +1 -12
- package/package.json +1 -1
- package/build/constants/errors/errors.js +0 -4561
- package/build/constants/errors/index.js +0 -18
- package/build/constants/errors/verbose.js +0 -9
- package/constants/errors/errors.ts +0 -4605
- package/constants/errors/index.ts +0 -2
- package/constants/errors/verbose.ts +0 -7
|
@@ -7,6 +7,7 @@ var GetLastActiveChatCommand;
|
|
|
7
7
|
(function (GetLastActiveChatCommand) {
|
|
8
8
|
GetLastActiveChatCommand.RequestQuerySchema = models_1.ChatSchema.pick({
|
|
9
9
|
categoryId: true,
|
|
10
|
+
aIModelId: true,
|
|
10
11
|
});
|
|
11
12
|
GetLastActiveChatCommand.Response = zod_1.z.object({
|
|
12
13
|
data: models_1.ChatWithMessagesSchema,
|
|
@@ -10,7 +10,6 @@ var CreateTextMessageCommand;
|
|
|
10
10
|
text: zod_1.z.string(),
|
|
11
11
|
files: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
12
12
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)).optional().default([]),
|
|
13
|
-
aiModelId: zod_1.z.string().uuid(),
|
|
14
13
|
});
|
|
15
14
|
CreateTextMessageCommand.RequestParamSchema = models_1.ChatSchema.pick({
|
|
16
15
|
uuid: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AI_MODEL_CONTENT_TYPE = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
4
|
+
exports.AI_MODEL_CONTENT_TYPE = {
|
|
5
|
+
TEXT: 'TEXT',
|
|
6
|
+
IMAGE: 'IMAGE',
|
|
7
|
+
};
|
package/build/constants/index.js
CHANGED
|
@@ -22,7 +22,6 @@ __exportStar(require("./cloud-payments"), exports);
|
|
|
22
22
|
__exportStar(require("./course"), exports);
|
|
23
23
|
__exportStar(require("./domains"), exports);
|
|
24
24
|
__exportStar(require("./email"), exports);
|
|
25
|
-
__exportStar(require("./errors"), exports);
|
|
26
25
|
__exportStar(require("./file"), exports);
|
|
27
26
|
__exportStar(require("./form-submission"), exports);
|
|
28
27
|
__exportStar(require("./form-submission"), exports);
|
|
@@ -5,6 +5,7 @@ var UNIFIED_MODEL_CONTENT_TYPE;
|
|
|
5
5
|
(function (UNIFIED_MODEL_CONTENT_TYPE) {
|
|
6
6
|
// AI Model types
|
|
7
7
|
UNIFIED_MODEL_CONTENT_TYPE["TEXT"] = "TEXT";
|
|
8
|
+
UNIFIED_MODEL_CONTENT_TYPE["IMAGE"] = "IMAGE";
|
|
8
9
|
// Tool types
|
|
9
10
|
UNIFIED_MODEL_CONTENT_TYPE["IMAGE_EDITOR"] = "IMAGE_EDITOR";
|
|
10
11
|
UNIFIED_MODEL_CONTENT_TYPE["TEXT_TO_SPEECH"] = "TEXT_TO_SPEECH";
|
|
@@ -11,7 +11,6 @@ var SUBSCRIPTION_FEATURE_TYPE;
|
|
|
11
11
|
SUBSCRIPTION_FEATURE_TYPE["ADVANCED_TOOLS_ACCESS"] = "advanced_tools_access";
|
|
12
12
|
SUBSCRIPTION_FEATURE_TYPE["STT_MODEL_ACCESS"] = "stt_model_access";
|
|
13
13
|
SUBSCRIPTION_FEATURE_TYPE["TTS_MODEL_ACCESS"] = "tts_model_access";
|
|
14
|
-
SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_ACCESS"] = "image_generation_access";
|
|
15
14
|
SUBSCRIPTION_FEATURE_TYPE["IMAGE_GENERATION_QUOTA"] = "image_generation_quota";
|
|
16
15
|
SUBSCRIPTION_FEATURE_TYPE["TTS_QUOTA"] = "tts_quota";
|
|
17
16
|
SUBSCRIPTION_FEATURE_TYPE["STT_QUOTA"] = "stt_quota";
|
|
@@ -34,7 +33,7 @@ var SUBSCRIPTION_FEATURE_KIND;
|
|
|
34
33
|
(function (SUBSCRIPTION_FEATURE_KIND) {
|
|
35
34
|
SUBSCRIPTION_FEATURE_KIND["TEXT"] = "text";
|
|
36
35
|
SUBSCRIPTION_FEATURE_KIND["AI_MODEL"] = "ai_model";
|
|
37
|
-
SUBSCRIPTION_FEATURE_KIND["
|
|
36
|
+
SUBSCRIPTION_FEATURE_KIND["IMAGE"] = "image";
|
|
38
37
|
SUBSCRIPTION_FEATURE_KIND["TTS"] = "tts";
|
|
39
38
|
SUBSCRIPTION_FEATURE_KIND["STT"] = "stt";
|
|
40
39
|
SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
|
|
@@ -15,7 +15,7 @@ exports.AiModelSchema = zod_1.z.object({
|
|
|
15
15
|
order: zod_1.z.number(),
|
|
16
16
|
canUse: zod_1.z.optional(zod_1.z.boolean()),
|
|
17
17
|
status: zod_1.z.nativeEnum(constants_1.AI_MODEL_STATUS),
|
|
18
|
-
contentType: zod_1.z.
|
|
18
|
+
contentType: zod_1.z.enum(Object.values(constants_1.AI_MODEL_CONTENT_TYPE)),
|
|
19
19
|
features: zod_1.z.array(zod_1.z.nativeEnum(constants_1.AI_MODEL_FEATURE)),
|
|
20
20
|
iconVariants: zod_1.z.object({
|
|
21
21
|
light: zod_1.z.object({
|
|
@@ -8,7 +8,7 @@ exports.ChatSchema = zod_1.z.object({
|
|
|
8
8
|
userId: zod_1.z.nullable(zod_1.z.string().uuid()),
|
|
9
9
|
unregisteredUserId: zod_1.z.nullable(zod_1.z.string().uuid()),
|
|
10
10
|
categoryId: zod_1.z.string().uuid(),
|
|
11
|
-
aIModelId: zod_1.z.string().uuid()
|
|
11
|
+
aIModelId: zod_1.z.string().uuid(),
|
|
12
12
|
title: zod_1.z.string(),
|
|
13
13
|
chatStatus: zod_1.z.enum(Object.values(constants_1.CHAT_STATUS_ENUM)),
|
|
14
14
|
folderId: zod_1.z.string().nullable(),
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PromptSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
exports.PromptSchema = zod_1.z.object({
|
|
6
7
|
uuid: zod_1.z.string().uuid(),
|
|
7
8
|
content: zod_1.z.string(),
|
|
9
|
+
type: zod_1.z.nativeEnum(constants_1.AI_MODEL_CONTENT_TYPE),
|
|
8
10
|
topicId: zod_1.z.string().uuid().nullable(),
|
|
9
11
|
title: zod_1.z.string().nullable(),
|
|
10
12
|
createdAt: zod_1.z.date(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.
|
|
3
|
+
exports.SubscriptionFeatureSchema = exports.InteriorDesignModelAccessFeatureSchema = exports.InteriorDesignQuotaFeatureSchema = exports.ImageEditorModelAccessFeatureSchema = exports.ImageEditorQuotaFeatureSchema = exports.WriterModelAccessFeatureSchema = exports.WriterQuotaFeatureSchema = exports.MusicModelAccessFeatureSchema = exports.MusicQuotaFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
|
|
4
4
|
const constants_1 = require("../constants");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
|
|
@@ -40,14 +40,6 @@ exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exten
|
|
|
40
40
|
isAvailable: zod_1.z.boolean(),
|
|
41
41
|
maxInputLength: zod_1.z.number(),
|
|
42
42
|
});
|
|
43
|
-
exports.ImageGenerationAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
44
|
-
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
|
|
45
|
-
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
46
|
-
order: zod_1.z.number(),
|
|
47
|
-
modelId: zod_1.z.string(),
|
|
48
|
-
isAvailable: zod_1.z.boolean(),
|
|
49
|
-
maxInputLength: zod_1.z.number(),
|
|
50
|
-
});
|
|
51
43
|
exports.RequestsQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
52
44
|
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
|
|
53
45
|
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.TEXT),
|
|
@@ -82,7 +74,7 @@ exports.TtsModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.exte
|
|
|
82
74
|
modelId: zod_1.z.string(),
|
|
83
75
|
});
|
|
84
76
|
exports.ImageGenerationQuotaFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
|
|
85
|
-
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.
|
|
77
|
+
kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.IMAGE),
|
|
86
78
|
type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
|
|
87
79
|
value: zod_1.z.number(),
|
|
88
80
|
});
|
|
@@ -187,5 +179,4 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
|
|
|
187
179
|
exports.ImageEditorModelAccessFeatureSchema,
|
|
188
180
|
exports.InteriorDesignQuotaFeatureSchema,
|
|
189
181
|
exports.InteriorDesignModelAccessFeatureSchema,
|
|
190
|
-
exports.ImageGenerationAccessFeatureSchema,
|
|
191
182
|
]);
|
|
@@ -7,7 +7,6 @@ export namespace CreateTextMessageCommand {
|
|
|
7
7
|
text: z.string(),
|
|
8
8
|
files: z.array(z.string().uuid()).optional().default([]),
|
|
9
9
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)).optional().default([]),
|
|
10
|
-
aiModelId: z.string().uuid(),
|
|
11
10
|
});
|
|
12
11
|
|
|
13
12
|
export const RequestParamSchema = ChatSchema.pick({
|
package/constants/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
|
|
|
7
7
|
ADVANCED_TOOLS_ACCESS = 'advanced_tools_access',
|
|
8
8
|
STT_MODEL_ACCESS = 'stt_model_access',
|
|
9
9
|
TTS_MODEL_ACCESS = 'tts_model_access',
|
|
10
|
-
IMAGE_GENERATION_ACCESS = 'image_generation_access',
|
|
11
10
|
IMAGE_GENERATION_QUOTA = 'image_generation_quota',
|
|
12
11
|
TTS_QUOTA = 'tts_quota',
|
|
13
12
|
STT_QUOTA = 'stt_quota',
|
|
@@ -30,7 +29,7 @@ export enum SUBSCRIPTION_FEATURE_TYPE {
|
|
|
30
29
|
export enum SUBSCRIPTION_FEATURE_KIND {
|
|
31
30
|
TEXT = 'text',
|
|
32
31
|
AI_MODEL = 'ai_model',
|
|
33
|
-
|
|
32
|
+
IMAGE = 'image',
|
|
34
33
|
TTS = 'tts',
|
|
35
34
|
STT = 'stt',
|
|
36
35
|
PRESENTATIONS = 'presentations',
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
AI_MODEL_CONTENT_TYPE,
|
|
4
|
+
AI_MODEL_FEATURE,
|
|
5
|
+
AI_MODEL_STATUS,
|
|
6
|
+
TAIModelContentTypeEnum,
|
|
7
|
+
} from '../constants';
|
|
3
8
|
import { AiModelConfigSchema } from './ai-model-config.schema';
|
|
4
9
|
|
|
5
10
|
export const AiModelSchema = z.object({
|
|
@@ -13,7 +18,7 @@ export const AiModelSchema = z.object({
|
|
|
13
18
|
order: z.number(),
|
|
14
19
|
canUse: z.optional(z.boolean()),
|
|
15
20
|
status: z.nativeEnum(AI_MODEL_STATUS),
|
|
16
|
-
contentType: z.
|
|
21
|
+
contentType: z.enum(Object.values(AI_MODEL_CONTENT_TYPE) as [TAIModelContentTypeEnum]),
|
|
17
22
|
features: z.array(z.nativeEnum(AI_MODEL_FEATURE)),
|
|
18
23
|
iconVariants: z.object({
|
|
19
24
|
light: z.object({
|
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
|
-
aIModelId: z.string().uuid()
|
|
9
|
+
aIModelId: z.string().uuid(),
|
|
10
10
|
title: z.string(),
|
|
11
11
|
chatStatus: z.enum(Object.values(CHAT_STATUS_ENUM) as [TChatStatusEnum]),
|
|
12
12
|
folderId: z.string().nullable(),
|
package/models/prompt.schema.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { AI_MODEL_CONTENT_TYPE } from '../constants';
|
|
2
3
|
|
|
3
4
|
export const PromptSchema = z.object({
|
|
4
5
|
uuid: z.string().uuid(),
|
|
5
6
|
content: z.string(),
|
|
7
|
+
type: z.nativeEnum(AI_MODEL_CONTENT_TYPE),
|
|
6
8
|
topicId: z.string().uuid().nullable(),
|
|
7
9
|
title: z.string().nullable(),
|
|
8
10
|
|
|
@@ -51,16 +51,6 @@ export const AiModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
|
51
51
|
});
|
|
52
52
|
export type AiModelAccessFeature = z.infer<typeof AiModelAccessFeatureSchema>;
|
|
53
53
|
|
|
54
|
-
export const ImageGenerationAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
55
|
-
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_ACCESS),
|
|
56
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE_GENERATION),
|
|
57
|
-
order: z.number(),
|
|
58
|
-
modelId: z.string(),
|
|
59
|
-
isAvailable: z.boolean(),
|
|
60
|
-
maxInputLength: z.number(),
|
|
61
|
-
});
|
|
62
|
-
export type ImageGenerationAccessFeature = z.infer<typeof ImageGenerationAccessFeatureSchema>;
|
|
63
|
-
|
|
64
54
|
export const RequestsQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
65
55
|
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.TEXT_GENERATION_QUOTA),
|
|
66
56
|
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.TEXT),
|
|
@@ -107,7 +97,7 @@ export const TtsModelAccessFeatureSchema = SubscriptionFeatureBaseSchema.extend(
|
|
|
107
97
|
export type TtsModelAccessFeature = z.infer<typeof TtsModelAccessFeatureSchema>;
|
|
108
98
|
|
|
109
99
|
export const ImageGenerationQuotaFeatureSchema = SubscriptionFeatureBaseSchema.extend({
|
|
110
|
-
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.
|
|
100
|
+
kind: z.literal(SUBSCRIPTION_FEATURE_KIND.IMAGE),
|
|
111
101
|
type: z.literal(SUBSCRIPTION_FEATURE_TYPE.IMAGE_GENERATION_QUOTA),
|
|
112
102
|
value: z.number(),
|
|
113
103
|
});
|
|
@@ -244,7 +234,6 @@ export const SubscriptionFeatureSchema = z.union([
|
|
|
244
234
|
ImageEditorModelAccessFeatureSchema,
|
|
245
235
|
InteriorDesignQuotaFeatureSchema,
|
|
246
236
|
InteriorDesignModelAccessFeatureSchema,
|
|
247
|
-
ImageGenerationAccessFeatureSchema,
|
|
248
237
|
]);
|
|
249
238
|
|
|
250
239
|
export type SubscriptionFeature = z.infer<typeof SubscriptionFeatureSchema>;
|