@purpleschool/gptbot 0.14.38 → 0.14.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.
- package/build/commands/ai-studio/canvas/recover-stale-nodes.command.js +1 -1
- package/build/commands/cabinet/get-user-statistics-by-month.command.js +1 -1
- package/build/commands/photo-studio/get-photo-studio-config.query.js +1 -1
- package/build/commands/team-account/get-team-account-statistics-by-month.command.js +1 -1
- package/build/commands/tools/presentation/build-blank-slide.command.js +1 -1
- package/build/commands/tools/presentation/update-presentation-slides.command.js +1 -1
- package/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.js +3 -9
- package/build/commands/user/send-telegram-notification.command.js +2 -6
- package/build/helpers/index.js +1 -0
- package/build/helpers/localized-text.schema.js +12 -0
- package/build/models/canvas-node-definition.schema.js +3 -3
- package/build/models/canvas-node.schema.js +1 -1
- package/build/models/json-value.schema.js +2 -2
- package/build/models/tools/image-generation/image-generation-model.schema.js +1 -1
- package/build/models/tools/music/music-config.schema.js +1 -1
- package/build/models/tools/presentation/slide-content.schema.js +8 -2
- package/build/models/tools/stt/stt-response.schema.js +1 -1
- package/build/models/tools/writer/writer-document-outline.schema.js +1 -0
- package/build/models/ui-notification.schema.js +2 -5
- package/commands/ai-studio/canvas/recover-stale-nodes.command.ts +1 -1
- package/commands/cabinet/get-user-statistics-by-month.command.ts +1 -1
- package/commands/photo-studio/get-photo-studio-config.query.ts +1 -1
- package/commands/team-account/get-team-account-statistics-by-month.command.ts +1 -1
- package/commands/tools/presentation/build-blank-slide.command.ts +1 -1
- package/commands/tools/presentation/update-presentation-slides.command.ts +1 -1
- package/commands/ui-notification/create-admin-broadcast-ui-notification.command.ts +3 -9
- package/commands/user/send-telegram-notification.command.ts +2 -6
- package/helpers/index.ts +1 -0
- package/helpers/localized-text.schema.ts +16 -0
- package/models/canvas-node-definition.schema.ts +3 -3
- package/models/canvas-node.schema.ts +1 -2
- package/models/json-value.schema.ts +3 -8
- package/models/tools/image-generation/image-generation-model.schema.ts +1 -1
- package/models/tools/music/music-config.schema.ts +1 -1
- package/models/tools/presentation/slide-content.schema.ts +16 -10
- package/models/tools/stt/stt-response.schema.ts +1 -1
- package/models/tools/writer/writer-document-outline.schema.ts +1 -0
- package/models/ui-notification.schema.ts +2 -5
- package/package.json +3 -3
|
@@ -10,5 +10,5 @@ var RecoverStaleNodesCommand;
|
|
|
10
10
|
maxStaleMinutes: zod_1.z.number().int().positive().default(60),
|
|
11
11
|
limit: zod_1.z.number().int().positive().default(50),
|
|
12
12
|
})
|
|
13
|
-
.
|
|
13
|
+
.prefault({});
|
|
14
14
|
})(RecoverStaleNodesCommand || (exports.RecoverStaleNodesCommand = RecoverStaleNodesCommand = {}));
|
|
@@ -18,7 +18,7 @@ var GetUserStatisticsByMonthCommand;
|
|
|
18
18
|
});
|
|
19
19
|
GetUserStatisticsByMonthCommand.UserStatisticsByMonthResponseSchema = zod_1.z.object({
|
|
20
20
|
month: zod_1.z.string(),
|
|
21
|
-
statistics: zod_1.z.
|
|
21
|
+
statistics: zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.STATISTICS_REQUEST_TYPE), zod_1.z.number()),
|
|
22
22
|
});
|
|
23
23
|
GetUserStatisticsByMonthCommand.ResponseSchema = zod_1.z.object({
|
|
24
24
|
data: zod_1.z.array(GetUserStatisticsByMonthCommand.UserStatisticsByMonthResponseSchema),
|
|
@@ -9,7 +9,7 @@ var GetPhotoStudioConfigQuery;
|
|
|
9
9
|
GetPhotoStudioConfigQuery.ConfigSchema = zod_1.z.object({
|
|
10
10
|
[constants_1.TOOL_TYPE.IMAGE_GENERATION]: models_1.ImageGenerationConfigSchema,
|
|
11
11
|
[constants_1.TOOL_TYPE.IMAGE]: models_1.ImageEditorConfigSchema,
|
|
12
|
-
actionPrices: zod_1.z.
|
|
12
|
+
actionPrices: zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_ACTION_ALIAS), zod_1.z.number().nonnegative().nullable()),
|
|
13
13
|
});
|
|
14
14
|
GetPhotoStudioConfigQuery.ResponseSchema = zod_1.z.object({
|
|
15
15
|
data: GetPhotoStudioConfigQuery.ConfigSchema,
|
|
@@ -19,7 +19,7 @@ var GetTeamAccountStatisticsByMonthCommand;
|
|
|
19
19
|
});
|
|
20
20
|
GetTeamAccountStatisticsByMonthCommand.TeamAccountStatisticsByMonthItemSchema = zod_1.z.object({
|
|
21
21
|
month: zod_1.z.string(),
|
|
22
|
-
statistics: zod_1.z.
|
|
22
|
+
statistics: zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.STATISTICS_REQUEST_TYPE), zod_1.z.number()),
|
|
23
23
|
});
|
|
24
24
|
GetTeamAccountStatisticsByMonthCommand.ResponseSchema = zod_1.z.object({
|
|
25
25
|
data: zod_1.z.array(GetTeamAccountStatisticsByMonthCommand.TeamAccountStatisticsByMonthItemSchema),
|
|
@@ -13,7 +13,7 @@ var BuildBlankSlideCommand;
|
|
|
13
13
|
order: zod_1.z.number(),
|
|
14
14
|
contentTypeId: zod_1.z.string(),
|
|
15
15
|
layoutId: zod_1.z.string(),
|
|
16
|
-
content: zod_1.z.record(zod_1.z.any()),
|
|
16
|
+
content: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
17
17
|
createdAt: zod_1.z.date(),
|
|
18
18
|
updatedAt: zod_1.z.date(),
|
|
19
19
|
}),
|
|
@@ -17,7 +17,7 @@ var UpdatePresentationSlidesCommand;
|
|
|
17
17
|
order: zod_1.z.number(),
|
|
18
18
|
contentTypeId: zod_1.z.string(),
|
|
19
19
|
layoutId: zod_1.z.string(),
|
|
20
|
-
content: zod_1.z.record(zod_1.z.any()),
|
|
20
|
+
content: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
21
21
|
createdAt: zod_1.z.date(),
|
|
22
22
|
updatedAt: zod_1.z.date(),
|
|
23
23
|
})),
|
|
@@ -2,18 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateAdminBroadcastUiNotificationCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const localized_text_schema_1 = require("../../helpers/localized-text.schema");
|
|
6
6
|
var CreateAdminBroadcastUiNotificationCommand;
|
|
7
7
|
(function (CreateAdminBroadcastUiNotificationCommand) {
|
|
8
8
|
CreateAdminBroadcastUiNotificationCommand.RequestBodySchema = zod_1.z.object({
|
|
9
|
-
title: zod_1.z.
|
|
10
|
-
|
|
11
|
-
[rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string().trim().min(1),
|
|
12
|
-
}),
|
|
13
|
-
message: zod_1.z.object({
|
|
14
|
-
[rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string().trim().min(1),
|
|
15
|
-
[rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string().trim().min(1),
|
|
16
|
-
}),
|
|
9
|
+
title: (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
|
|
10
|
+
message: (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string().trim().min(1)),
|
|
17
11
|
onlyRegistered: zod_1.z.boolean().optional(),
|
|
18
12
|
});
|
|
19
13
|
CreateAdminBroadcastUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SendTelegramNotificationCommand = void 0;
|
|
4
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
4
|
const zod_1 = require("zod");
|
|
5
|
+
const localized_text_schema_1 = require("../../helpers/localized-text.schema");
|
|
6
6
|
const models_1 = require("../../models");
|
|
7
7
|
var SendTelegramNotificationCommand;
|
|
8
8
|
(function (SendTelegramNotificationCommand) {
|
|
9
|
-
SendTelegramNotificationCommand.MessageMdSchema = zod_1.z.
|
|
10
|
-
[rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string(),
|
|
11
|
-
[rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string(),
|
|
12
|
-
[rugpt_lib_common_1.LOCALE.ES]: zod_1.z.string(),
|
|
13
|
-
});
|
|
9
|
+
SendTelegramNotificationCommand.MessageMdSchema = (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string());
|
|
14
10
|
SendTelegramNotificationCommand.RequestSchema = zod_1.z.object({
|
|
15
11
|
filters: models_1.UserFilterSchema,
|
|
16
12
|
messageMd: SendTelegramNotificationCommand.MessageMdSchema,
|
package/build/helpers/index.js
CHANGED
|
@@ -27,3 +27,4 @@ __exportStar(require("./image-generation"), exports);
|
|
|
27
27
|
__exportStar(require("./music"), exports);
|
|
28
28
|
__exportStar(require("./interior-design"), exports);
|
|
29
29
|
__exportStar(require("./query-boolean.schema"), exports);
|
|
30
|
+
__exportStar(require("./localized-text.schema"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildLocalizedTextSchema = buildLocalizedTextSchema;
|
|
4
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
function buildLocalizedTextSchema(value) {
|
|
7
|
+
const shape = Object.values(rugpt_lib_common_1.LOCALE).reduce((acc, locale) => {
|
|
8
|
+
acc[locale] = value;
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
return zod_1.z.object(shape);
|
|
12
|
+
}
|
|
@@ -68,8 +68,8 @@ exports.CanvasNodeDefinitionToolConfigSchema = zod_1.z.discriminatedUnion('nodeT
|
|
|
68
68
|
createCanvasNodeDefinitionNoConfigSchema(constants_1.CANVAS_NODE_TYPE.audioBlock),
|
|
69
69
|
]);
|
|
70
70
|
exports.PortDescriptions = zod_1.z.object({
|
|
71
|
-
inputs: zod_1.z.
|
|
72
|
-
outputs: zod_1.z.
|
|
71
|
+
inputs: zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.INPUT_OUTPUT_TYPE), zod_1.z.string()),
|
|
72
|
+
outputs: zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.INPUT_OUTPUT_TYPE), zod_1.z.string()),
|
|
73
73
|
});
|
|
74
74
|
exports.CanvasNodeDefinitionSchema = zod_1.z.object({
|
|
75
75
|
type: zod_1.z.nativeEnum(constants_1.CANVAS_NODE_TYPE),
|
|
@@ -88,4 +88,4 @@ exports.CanvasNodeDefinitionWithConfigSchema = zod_1.z.object({
|
|
|
88
88
|
nodeDefinition: exports.CanvasNodeDefinitionSchema,
|
|
89
89
|
config: exports.CanvasNodeDefinitionToolConfigSchema,
|
|
90
90
|
});
|
|
91
|
-
exports.CanvasNodeDefinitionsWithConfigsSchema = zod_1.z.
|
|
91
|
+
exports.CanvasNodeDefinitionsWithConfigsSchema = zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.CANVAS_NODE_TYPE), exports.CanvasNodeDefinitionWithConfigSchema);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CanvasNodeSchema = exports.CanvasNodeBaseSchema = exports.validateCanvasNodeOutputByType = exports.validateCanvasNodeParamsByType = exports.CanvasNodeErrorSchema = exports.CanvasNodeErrorDetailsSchema = exports.CanvasNodeOutputSchemaByType = exports.CanvasNodeParamsSchemaByType = exports.AudioBlockOutputSchema = exports.VarBlockOutputSchema = exports.NoteOutputSchema = exports.FileBlockOutputSchema = exports.VideoBlockOutputSchema = exports.ImageBlockOutputSchema = exports.TextBlockOutputSchema = exports.HtmlGenOutputSchema = exports.VarGenOutputSchema = exports.MotionControlOutputSchema = exports.ColorPaletteOutputSchema = exports.AudioGenSTTOutputSchema = exports.AudioGenTTSOutputSchema = exports.VideoGenOutputSchema = exports.ImageGenOutputSchema = exports.TextGenOutputSchema = exports.NoParamsSchema = exports.HtmlGenParamsSchema = exports.VarGenParamsSchema = exports.MotionControlParamsSchema = exports.ColorPaletteParamsSchema = exports.AudioGenParamsSchema = exports.VideoGenParamsSchema = exports.ImageGenParamsSchema = exports.TextGenParamsSchema = exports.CanvasNodePositionSchema = exports.CanvasFileRefSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
const strictObject = (shape) => zod_1.z.
|
|
6
|
+
const strictObject = (shape) => zod_1.z.strictObject(shape);
|
|
7
7
|
exports.CanvasFileRefSchema = strictObject({
|
|
8
8
|
fileId: zod_1.z.string().uuid(),
|
|
9
9
|
url: zod_1.z.string().url(),
|
|
@@ -8,6 +8,6 @@ exports.JsonValueSchema = zod_1.z.lazy(() => zod_1.z.union([
|
|
|
8
8
|
zod_1.z.boolean(),
|
|
9
9
|
zod_1.z.null(),
|
|
10
10
|
zod_1.z.array(exports.JsonValueSchema),
|
|
11
|
-
zod_1.z.record(exports.JsonValueSchema),
|
|
11
|
+
zod_1.z.record(zod_1.z.string(), exports.JsonValueSchema),
|
|
12
12
|
]));
|
|
13
|
-
exports.JsonObjectSchema = zod_1.z.record(exports.JsonValueSchema);
|
|
13
|
+
exports.JsonObjectSchema = zod_1.z.record(zod_1.z.string(), exports.JsonValueSchema);
|
|
@@ -12,7 +12,7 @@ exports.ImageGenerationModelParamsSchema = zod_1.z.object({
|
|
|
12
12
|
}),
|
|
13
13
|
zod_1.z.string(),
|
|
14
14
|
])),
|
|
15
|
-
quality: zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string())]).optional(),
|
|
15
|
+
quality: zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.string())]).optional(),
|
|
16
16
|
resolution: zod_1.z
|
|
17
17
|
.object({
|
|
18
18
|
options: zod_1.z.array(zod_1.z.nativeEnum(constants_1.IMAGE_GENERATION_RESOLUTION)),
|
|
@@ -4,7 +4,7 @@ exports.MusicConfigSchema = exports.MusicAudioActionPricesSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const music_model_schema_1 = require("./music-model.schema");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
|
7
|
-
exports.MusicAudioActionPricesSchema = zod_1.z.
|
|
7
|
+
exports.MusicAudioActionPricesSchema = zod_1.z.partialRecord(zod_1.z.nativeEnum(constants_1.MUSIC_AUDIO_ACTION_TYPE), zod_1.z.number());
|
|
8
8
|
exports.MusicConfigSchema = zod_1.z.object({
|
|
9
9
|
models: zod_1.z.array(music_model_schema_1.MusicModelSchema),
|
|
10
10
|
audioActionPrices: exports.MusicAudioActionPricesSchema,
|
|
@@ -29,6 +29,7 @@ exports.CoverSlideDataSchema = zod_1.z.object({
|
|
|
29
29
|
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
30
30
|
value: zod_1.z.string().describe('Author value from titlePage if provided'),
|
|
31
31
|
})
|
|
32
|
+
.nullable()
|
|
32
33
|
.optional(),
|
|
33
34
|
date: zod_1.z
|
|
34
35
|
.object({
|
|
@@ -37,12 +38,14 @@ exports.CoverSlideDataSchema = zod_1.z.object({
|
|
|
37
38
|
.string()
|
|
38
39
|
.describe('Date from titlePage in the "dd month yyyy" format in presentation\'s locale'),
|
|
39
40
|
})
|
|
41
|
+
.nullable()
|
|
40
42
|
.optional(),
|
|
41
43
|
email: zod_1.z
|
|
42
44
|
.object({
|
|
43
45
|
label: zod_1.z.string().describe('Localized contact/email label'),
|
|
44
46
|
value: zod_1.z.string().describe('Email value from titlePage if provided'),
|
|
45
47
|
})
|
|
48
|
+
.nullable()
|
|
46
49
|
.optional(),
|
|
47
50
|
version: zod_1.z.literal(1),
|
|
48
51
|
});
|
|
@@ -58,6 +61,7 @@ exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
|
58
61
|
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
59
62
|
value: zod_1.z.string().describe('Author value from titlePage if provided'),
|
|
60
63
|
})
|
|
64
|
+
.nullable()
|
|
61
65
|
.optional(),
|
|
62
66
|
date: zod_1.z
|
|
63
67
|
.object({
|
|
@@ -66,12 +70,14 @@ exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
|
66
70
|
.string()
|
|
67
71
|
.describe('Date from titlePage in the "dd month yyyy" format in presentation\'s locale'),
|
|
68
72
|
})
|
|
73
|
+
.nullable()
|
|
69
74
|
.optional(),
|
|
70
75
|
email: zod_1.z
|
|
71
76
|
.object({
|
|
72
77
|
label: zod_1.z.string().describe('Localized contact/email label'),
|
|
73
78
|
value: zod_1.z.string().describe('Email value from titlePage if provided'),
|
|
74
79
|
})
|
|
80
|
+
.nullable()
|
|
75
81
|
.optional(),
|
|
76
82
|
version: zod_1.z.literal(1),
|
|
77
83
|
});
|
|
@@ -179,8 +185,8 @@ exports.BarChartSlideDataSchema = zod_1.z.object({
|
|
|
179
185
|
.min(1)
|
|
180
186
|
.max(1)
|
|
181
187
|
.describe('Data series for the chart. Only one series is supported'),
|
|
182
|
-
yAxisLabel: zod_1.z.string().max(40).optional().describe('Y-axis label'),
|
|
183
|
-
unit: zod_1.z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
|
|
188
|
+
yAxisLabel: zod_1.z.string().max(40).nullable().optional().describe('Y-axis label'),
|
|
189
|
+
unit: zod_1.z.string().max(10).nullable().optional().describe('Unit symbol (%, $, etc.)'),
|
|
184
190
|
version: zod_1.z.literal(1),
|
|
185
191
|
});
|
|
186
192
|
exports.ChartSlideDataSchema = zod_1.z.object({
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STTResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.STTResponseSchema = zod_1.z.object({
|
|
6
|
-
raw: zod_1.z.
|
|
6
|
+
raw: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
7
7
|
md: zod_1.z.string(),
|
|
8
8
|
txtUrl: zod_1.z.string().optional(),
|
|
9
9
|
srtUrl: zod_1.z.string().optional(),
|
|
@@ -14,6 +14,7 @@ exports.WriterDocumentOutlineSectionSchema = zod_1.z.object({
|
|
|
14
14
|
type: zod_1.z.nativeEnum(constants_1.WRITER_DOCUMENT_SECTION_TYPE),
|
|
15
15
|
subsections: zod_1.z
|
|
16
16
|
.array(exports.WriterDocumentOutlineSubsectionSchema)
|
|
17
|
+
.nullable()
|
|
17
18
|
.optional()
|
|
18
19
|
.describe(`Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`),
|
|
19
20
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UiNotificationSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.LocalizedUiNotificationTextSchema = exports.UiNotificationBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const localized_text_schema_1 = require("../helpers/localized-text.schema");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
7
|
exports.UiNotificationBaseSchema = zod_1.z.object({
|
|
8
8
|
uuid: zod_1.z.string().uuid(),
|
|
@@ -15,10 +15,7 @@ exports.UiNotificationBaseSchema = zod_1.z.object({
|
|
|
15
15
|
endDate: zod_1.z.date().nullable(),
|
|
16
16
|
serverTime: zod_1.z.date().optional(),
|
|
17
17
|
});
|
|
18
|
-
exports.LocalizedUiNotificationTextSchema = zod_1.z.
|
|
19
|
-
[rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string(),
|
|
20
|
-
[rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string(),
|
|
21
|
-
});
|
|
18
|
+
exports.LocalizedUiNotificationTextSchema = (0, localized_text_schema_1.buildLocalizedTextSchema)(zod_1.z.string());
|
|
22
19
|
exports.ConnectTelegramBonusUiContentSchema = zod_1.z.object({
|
|
23
20
|
promocode: zod_1.z.string(),
|
|
24
21
|
bonusPercent: zod_1.z.number(),
|
|
@@ -18,7 +18,7 @@ export namespace GetUserStatisticsByMonthCommand {
|
|
|
18
18
|
|
|
19
19
|
export const UserStatisticsByMonthResponseSchema = z.object({
|
|
20
20
|
month: z.string(),
|
|
21
|
-
statistics: z.
|
|
21
|
+
statistics: z.partialRecord(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
export const ResponseSchema = z.object({
|
|
@@ -6,7 +6,7 @@ export namespace GetPhotoStudioConfigQuery {
|
|
|
6
6
|
export const ConfigSchema = z.object({
|
|
7
7
|
[TOOL_TYPE.IMAGE_GENERATION]: ImageGenerationConfigSchema,
|
|
8
8
|
[TOOL_TYPE.IMAGE]: ImageEditorConfigSchema,
|
|
9
|
-
actionPrices: z.
|
|
9
|
+
actionPrices: z.partialRecord(
|
|
10
10
|
z.nativeEnum(PHOTO_STUDIO_ACTION_ALIAS),
|
|
11
11
|
z.number().nonnegative().nullable(),
|
|
12
12
|
),
|
|
@@ -19,7 +19,7 @@ export namespace GetTeamAccountStatisticsByMonthCommand {
|
|
|
19
19
|
|
|
20
20
|
export const TeamAccountStatisticsByMonthItemSchema = z.object({
|
|
21
21
|
month: z.string(),
|
|
22
|
-
statistics: z.
|
|
22
|
+
statistics: z.partialRecord(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
export const ResponseSchema = z.object({
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { buildLocalizedTextSchema } from '../../helpers/localized-text.schema';
|
|
3
3
|
|
|
4
4
|
export namespace CreateAdminBroadcastUiNotificationCommand {
|
|
5
5
|
export const RequestBodySchema = z.object({
|
|
6
|
-
title: z.
|
|
7
|
-
|
|
8
|
-
[LOCALE.EN]: z.string().trim().min(1),
|
|
9
|
-
}),
|
|
10
|
-
message: z.object({
|
|
11
|
-
[LOCALE.RU]: z.string().trim().min(1),
|
|
12
|
-
[LOCALE.EN]: z.string().trim().min(1),
|
|
13
|
-
}),
|
|
6
|
+
title: buildLocalizedTextSchema(z.string().trim().min(1)),
|
|
7
|
+
message: buildLocalizedTextSchema(z.string().trim().min(1)),
|
|
14
8
|
onlyRegistered: z.boolean().optional(),
|
|
15
9
|
});
|
|
16
10
|
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import { buildLocalizedTextSchema } from '../../helpers/localized-text.schema';
|
|
3
3
|
import { UserFilterSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace SendTelegramNotificationCommand {
|
|
6
|
-
export const MessageMdSchema = z.
|
|
7
|
-
[LOCALE.RU]: z.string(),
|
|
8
|
-
[LOCALE.EN]: z.string(),
|
|
9
|
-
[LOCALE.ES]: z.string(),
|
|
10
|
-
});
|
|
6
|
+
export const MessageMdSchema = buildLocalizedTextSchema(z.string());
|
|
11
7
|
export type MessageMd = z.infer<typeof MessageMdSchema>;
|
|
12
8
|
|
|
13
9
|
export const RequestSchema = z.object({
|
package/helpers/index.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export function buildLocalizedTextSchema<T extends z.ZodTypeAny>(
|
|
5
|
+
value: T,
|
|
6
|
+
): z.ZodObject<Record<LOCALE, T>> {
|
|
7
|
+
const shape = Object.values(LOCALE).reduce(
|
|
8
|
+
(acc, locale) => {
|
|
9
|
+
acc[locale] = value;
|
|
10
|
+
return acc;
|
|
11
|
+
},
|
|
12
|
+
{} as Record<LOCALE, T>,
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
return z.object(shape);
|
|
16
|
+
}
|
|
@@ -82,8 +82,8 @@ export const CanvasNodeDefinitionToolConfigSchema = z.discriminatedUnion('nodeTy
|
|
|
82
82
|
export type CanvasNodeDefinitionToolConfig = z.infer<typeof CanvasNodeDefinitionToolConfigSchema>;
|
|
83
83
|
|
|
84
84
|
export const PortDescriptions = z.object({
|
|
85
|
-
inputs: z.
|
|
86
|
-
outputs: z.
|
|
85
|
+
inputs: z.partialRecord(z.nativeEnum(INPUT_OUTPUT_TYPE), z.string()),
|
|
86
|
+
outputs: z.partialRecord(z.nativeEnum(INPUT_OUTPUT_TYPE), z.string()),
|
|
87
87
|
});
|
|
88
88
|
|
|
89
89
|
export type PortDescriptionsType = z.infer<typeof PortDescriptions>;
|
|
@@ -109,7 +109,7 @@ export const CanvasNodeDefinitionWithConfigSchema = z.object({
|
|
|
109
109
|
});
|
|
110
110
|
export type CanvasNodeDefinitionWithConfig = z.infer<typeof CanvasNodeDefinitionWithConfigSchema>;
|
|
111
111
|
|
|
112
|
-
export const CanvasNodeDefinitionsWithConfigsSchema = z.
|
|
112
|
+
export const CanvasNodeDefinitionsWithConfigsSchema = z.partialRecord(
|
|
113
113
|
z.nativeEnum(CANVAS_NODE_TYPE),
|
|
114
114
|
CanvasNodeDefinitionWithConfigSchema,
|
|
115
115
|
);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { CANVAS_NODE_ERROR_KIND, CANVAS_NODE_TYPE, NODE_RUN_STATUS } from '../constants';
|
|
3
3
|
|
|
4
|
-
const strictObject = <T extends z.ZodRawShape>(shape: T)
|
|
5
|
-
z.object(shape).strict();
|
|
4
|
+
const strictObject = <T extends z.ZodRawShape>(shape: T) => z.strictObject(shape);
|
|
6
5
|
|
|
7
6
|
export const CanvasFileRefSchema = strictObject({
|
|
8
7
|
fileId: z.string().uuid(),
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
3
|
export type JsonValue =
|
|
4
|
-
| string
|
|
5
|
-
| number
|
|
6
|
-
| boolean
|
|
7
|
-
| null
|
|
8
|
-
| JsonValue[]
|
|
9
|
-
| { [key: string]: JsonValue };
|
|
4
|
+
string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue };
|
|
10
5
|
|
|
11
6
|
export const JsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>
|
|
12
7
|
z.union([
|
|
@@ -15,9 +10,9 @@ export const JsonValueSchema: z.ZodType<JsonValue> = z.lazy(() =>
|
|
|
15
10
|
z.boolean(),
|
|
16
11
|
z.null(),
|
|
17
12
|
z.array(JsonValueSchema),
|
|
18
|
-
z.record(JsonValueSchema),
|
|
13
|
+
z.record(z.string(), JsonValueSchema),
|
|
19
14
|
]),
|
|
20
15
|
);
|
|
21
16
|
|
|
22
|
-
export const JsonObjectSchema = z.record(JsonValueSchema);
|
|
17
|
+
export const JsonObjectSchema = z.record(z.string(), JsonValueSchema);
|
|
23
18
|
export type JsonObject = z.infer<typeof JsonObjectSchema>;
|
|
@@ -13,7 +13,7 @@ export const ImageGenerationModelParamsSchema = z.object({
|
|
|
13
13
|
z.string(),
|
|
14
14
|
]),
|
|
15
15
|
),
|
|
16
|
-
quality: z.union([z.string(), z.record(z.string())]).optional(),
|
|
16
|
+
quality: z.union([z.string(), z.record(z.string(), z.string())]).optional(),
|
|
17
17
|
resolution: z
|
|
18
18
|
.object({
|
|
19
19
|
options: z.array(z.nativeEnum(IMAGE_GENERATION_RESOLUTION)),
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { MusicModelSchema } from './music-model.schema';
|
|
3
3
|
import { MUSIC_AUDIO_ACTION_TYPE } from '../../../constants';
|
|
4
4
|
|
|
5
|
-
export const MusicAudioActionPricesSchema = z.
|
|
5
|
+
export const MusicAudioActionPricesSchema = z.partialRecord(
|
|
6
6
|
z.nativeEnum(MUSIC_AUDIO_ACTION_TYPE),
|
|
7
7
|
z.number(),
|
|
8
8
|
);
|
|
@@ -26,18 +26,18 @@ export type IconSlot = z.infer<typeof IconSlotSchema>;
|
|
|
26
26
|
export interface ICoverSlideDataStructure {
|
|
27
27
|
contentType: SLIDE_CONTENT_TYPE.COVER;
|
|
28
28
|
title: string;
|
|
29
|
-
author?: { label: string; value: string };
|
|
30
|
-
date?: { label: string; value: string };
|
|
31
|
-
email?: { label: string; value: string };
|
|
29
|
+
author?: { label: string; value: string } | null;
|
|
30
|
+
date?: { label: string; value: string } | null;
|
|
31
|
+
email?: { label: string; value: string } | null;
|
|
32
32
|
version: 1;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface IThankYouSlideDataStructure {
|
|
36
36
|
contentType: SLIDE_CONTENT_TYPE.THANK_YOU;
|
|
37
37
|
title: string;
|
|
38
|
-
author?: { label: string; value: string };
|
|
39
|
-
date?: { label: string; value: string };
|
|
40
|
-
email?: { label: string; value: string };
|
|
38
|
+
author?: { label: string; value: string } | null;
|
|
39
|
+
date?: { label: string; value: string } | null;
|
|
40
|
+
email?: { label: string; value: string } | null;
|
|
41
41
|
version: 1;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -95,8 +95,8 @@ export interface IBarChartSlideDataStructure {
|
|
|
95
95
|
type: SLIDE_CHART_TYPE.BAR;
|
|
96
96
|
categories: string[];
|
|
97
97
|
series: Array<{ name: string; data: number[]; type: number }>;
|
|
98
|
-
yAxisLabel?: string;
|
|
99
|
-
unit?: string;
|
|
98
|
+
yAxisLabel?: string | null;
|
|
99
|
+
unit?: string | null;
|
|
100
100
|
version: 1;
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -130,6 +130,7 @@ export const CoverSlideDataSchema = z.object({
|
|
|
130
130
|
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
131
131
|
value: z.string().describe('Author value from titlePage if provided'),
|
|
132
132
|
})
|
|
133
|
+
.nullable()
|
|
133
134
|
.optional(),
|
|
134
135
|
date: z
|
|
135
136
|
.object({
|
|
@@ -140,12 +141,14 @@ export const CoverSlideDataSchema = z.object({
|
|
|
140
141
|
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
141
142
|
),
|
|
142
143
|
})
|
|
144
|
+
.nullable()
|
|
143
145
|
.optional(),
|
|
144
146
|
email: z
|
|
145
147
|
.object({
|
|
146
148
|
label: z.string().describe('Localized contact/email label'),
|
|
147
149
|
value: z.string().describe('Email value from titlePage if provided'),
|
|
148
150
|
})
|
|
151
|
+
.nullable()
|
|
149
152
|
.optional(),
|
|
150
153
|
version: z.literal(1),
|
|
151
154
|
}) satisfies z.ZodType<ICoverSlideDataStructure>;
|
|
@@ -163,6 +166,7 @@ export const ThankYouSlideDataSchema = z.object({
|
|
|
163
166
|
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
164
167
|
value: z.string().describe('Author value from titlePage if provided'),
|
|
165
168
|
})
|
|
169
|
+
.nullable()
|
|
166
170
|
.optional(),
|
|
167
171
|
date: z
|
|
168
172
|
.object({
|
|
@@ -173,12 +177,14 @@ export const ThankYouSlideDataSchema = z.object({
|
|
|
173
177
|
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
174
178
|
),
|
|
175
179
|
})
|
|
180
|
+
.nullable()
|
|
176
181
|
.optional(),
|
|
177
182
|
email: z
|
|
178
183
|
.object({
|
|
179
184
|
label: z.string().describe('Localized contact/email label'),
|
|
180
185
|
value: z.string().describe('Email value from titlePage if provided'),
|
|
181
186
|
})
|
|
187
|
+
.nullable()
|
|
182
188
|
.optional(),
|
|
183
189
|
version: z.literal(1),
|
|
184
190
|
}) satisfies z.ZodType<IThankYouSlideDataStructure>;
|
|
@@ -316,8 +322,8 @@ export const BarChartSlideDataSchema = z.object({
|
|
|
316
322
|
.min(1)
|
|
317
323
|
.max(1)
|
|
318
324
|
.describe('Data series for the chart. Only one series is supported'),
|
|
319
|
-
yAxisLabel: z.string().max(40).optional().describe('Y-axis label'),
|
|
320
|
-
unit: z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
|
|
325
|
+
yAxisLabel: z.string().max(40).nullable().optional().describe('Y-axis label'),
|
|
326
|
+
unit: z.string().max(10).nullable().optional().describe('Unit symbol (%, $, etc.)'),
|
|
321
327
|
version: z.literal(1),
|
|
322
328
|
}) satisfies z.ZodType<IBarChartSlideDataStructure>;
|
|
323
329
|
export type BarChartSlideData = z.infer<typeof BarChartSlideDataSchema>;
|
|
@@ -16,6 +16,7 @@ export const WriterDocumentOutlineSectionSchema = z.object({
|
|
|
16
16
|
type: z.nativeEnum(WRITER_DOCUMENT_SECTION_TYPE),
|
|
17
17
|
subsections: z
|
|
18
18
|
.array(WriterDocumentOutlineSubsectionSchema)
|
|
19
|
+
.nullable()
|
|
19
20
|
.optional()
|
|
20
21
|
.describe(
|
|
21
22
|
`Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { buildLocalizedTextSchema } from '../helpers/localized-text.schema';
|
|
3
3
|
import {
|
|
4
4
|
UI_NOTIFICATION_CONDITION_OF_EXECUTION,
|
|
5
5
|
UI_NOTIFICATION_STATUS,
|
|
@@ -19,10 +19,7 @@ export const UiNotificationBaseSchema = z.object({
|
|
|
19
19
|
});
|
|
20
20
|
export type UiNotificationBase = z.infer<typeof UiNotificationBaseSchema>;
|
|
21
21
|
|
|
22
|
-
export const LocalizedUiNotificationTextSchema = z.
|
|
23
|
-
[LOCALE.RU]: z.string(),
|
|
24
|
-
[LOCALE.EN]: z.string(),
|
|
25
|
-
});
|
|
22
|
+
export const LocalizedUiNotificationTextSchema = buildLocalizedTextSchema(z.string());
|
|
26
23
|
export type LocalizedUiNotificationText = z.infer<typeof LocalizedUiNotificationTextSchema>;
|
|
27
24
|
|
|
28
25
|
export const ConnectTelegramBonusUiContentSchema = z.object({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/gptbot",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.39",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@purpleschool/rugpt-lib-common": "0.0.
|
|
16
|
-
"zod": "^
|
|
15
|
+
"@purpleschool/rugpt-lib-common": "0.0.78",
|
|
16
|
+
"zod": "^4.4.3"
|
|
17
17
|
}
|
|
18
18
|
}
|