@purpleschool/gptbot 0.7.80 → 0.7.81
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/api/controllers/http/presentation.ts +10 -0
- package/build/api/controllers/http/presentation.js +7 -0
- package/build/commands/tools/presentation/build-blank-slide.command.js +21 -0
- package/build/commands/tools/presentation/generate-and-insert-slide.command.js +22 -0
- package/build/commands/tools/presentation/index.js +7 -0
- package/build/commands/tools/presentation/presentation-generate-report.command.js +17 -0
- package/build/commands/tools/presentation/presentation-paraphrase.command.js +20 -0
- package/build/commands/tools/presentation/update-presentation-slides.command.js +25 -0
- package/build/commands/tools/presentation/update-presentation.command.js +4 -3
- package/build/commands/tools/presentation/update-slide-image-slot.command.js +34 -0
- package/build/commands/tools/presentation/update-slide.command.js +19 -0
- package/build/constants/errors/errors.js +11 -1
- package/build/constants/presentation/enums/index.js +4 -0
- package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
- package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
- package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
- package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
- package/build/helpers/index.js +1 -0
- package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
- package/build/helpers/presentation/index.js +17 -0
- package/build/models/tools/index.js +1 -0
- package/build/models/tools/presentation/index.js +1 -0
- package/build/models/tools/presentation/presentation-ai-action.schema.js +27 -0
- package/build/models/tools/presentation/presentation-config.schema.js +3 -0
- package/build/models/tools/presentation/presentation.schema.js +2 -0
- package/build/models/tools/presentation/slide-content-edit.schema.js +129 -0
- package/build/models/tools/presentation/slide-content.schema.js +22 -20
- package/build/models/tools/presentation/slide.schema.js +39 -1
- package/commands/tools/presentation/build-blank-slide.command.ts +23 -0
- package/commands/tools/presentation/generate-and-insert-slide.command.ts +27 -0
- package/commands/tools/presentation/index.ts +7 -0
- package/commands/tools/presentation/presentation-generate-report.command.ts +21 -0
- package/commands/tools/presentation/presentation-paraphrase.command.ts +26 -0
- package/commands/tools/presentation/update-presentation-slides.command.ts +32 -0
- package/commands/tools/presentation/update-presentation.command.ts +5 -4
- package/commands/tools/presentation/update-slide-image-slot.command.ts +40 -0
- package/commands/tools/presentation/update-slide.command.ts +25 -0
- package/constants/errors/errors.ts +11 -1
- package/constants/presentation/enums/index.ts +4 -0
- package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
- package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
- package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
- package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
- package/helpers/index.ts +1 -0
- package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
- package/helpers/presentation/index.ts +1 -0
- package/models/tools/index.ts +1 -0
- package/models/tools/presentation/index.ts +1 -0
- package/models/tools/presentation/presentation-ai-action.schema.ts +33 -0
- package/models/tools/presentation/presentation-config.schema.ts +3 -0
- package/models/tools/presentation/presentation.schema.ts +2 -0
- package/models/tools/presentation/slide-content-edit.schema.ts +154 -0
- package/models/tools/presentation/slide-content.schema.ts +119 -32
- package/models/tools/presentation/slide.schema.ts +47 -0
- package/package.json +1 -1
|
@@ -16,6 +16,16 @@ export const PRESENTATION_ROUTES = {
|
|
|
16
16
|
UPDATE_PRESENTATION_OUTLINE: (uuid: string) => `${uuid}/outline`,
|
|
17
17
|
UPDATE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
18
18
|
`${presentationId}/outline/${slideOutlineId}`,
|
|
19
|
+
UPDATE_PRESENTATION_SLIDES: (uuid: string) => `${uuid}/slides`,
|
|
20
|
+
GENERATE_AND_INSERT_SLIDE: (uuid: string) => `${uuid}/slides/generate-and-insert`,
|
|
21
|
+
BUILD_BLANK_SLIDE: 'slides/blank',
|
|
22
|
+
UPDATE_SLIDE_IMAGE_SLOT: (presentationId: string, slideId: string, slotId: string) =>
|
|
23
|
+
`${presentationId}/slides/${slideId}/image-slots/${slotId}`,
|
|
24
|
+
UPDATE_SLIDE: (presentationId: string, slideId: string) =>
|
|
25
|
+
`${presentationId}/slides/${slideId}`,
|
|
26
|
+
PARAPHRASE: (presentationId: string, slideId: string) =>
|
|
27
|
+
`${presentationId}/slides/${slideId}/paraphrase`,
|
|
28
|
+
GENERATE_REPORT: (presentationId: string) => `${presentationId}/generate-report`,
|
|
19
29
|
REPOSITION_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
20
30
|
`${presentationId}/outline/${slideOutlineId}/move`,
|
|
21
31
|
DELETE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
@@ -17,6 +17,13 @@ exports.PRESENTATION_ROUTES = {
|
|
|
17
17
|
GENERATE_SLIDES: (uuid) => `${uuid}/slides/generate`,
|
|
18
18
|
UPDATE_PRESENTATION_OUTLINE: (uuid) => `${uuid}/outline`,
|
|
19
19
|
UPDATE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}`,
|
|
20
|
+
UPDATE_PRESENTATION_SLIDES: (uuid) => `${uuid}/slides`,
|
|
21
|
+
GENERATE_AND_INSERT_SLIDE: (uuid) => `${uuid}/slides/generate-and-insert`,
|
|
22
|
+
BUILD_BLANK_SLIDE: 'slides/blank',
|
|
23
|
+
UPDATE_SLIDE_IMAGE_SLOT: (presentationId, slideId, slotId) => `${presentationId}/slides/${slideId}/image-slots/${slotId}`,
|
|
24
|
+
UPDATE_SLIDE: (presentationId, slideId) => `${presentationId}/slides/${slideId}`,
|
|
25
|
+
PARAPHRASE: (presentationId, slideId) => `${presentationId}/slides/${slideId}/paraphrase`,
|
|
26
|
+
GENERATE_REPORT: (presentationId) => `${presentationId}/generate-report`,
|
|
20
27
|
REPOSITION_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}/move`,
|
|
21
28
|
DELETE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}`,
|
|
22
29
|
CREATE_SLIDE_OUTLINE: (presentationId) => `${presentationId}/outline`,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuildBlankSlideCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var BuildBlankSlideCommand;
|
|
6
|
+
(function (BuildBlankSlideCommand) {
|
|
7
|
+
BuildBlankSlideCommand.RequestSchema = zod_1.z.object({
|
|
8
|
+
slideContentType: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
BuildBlankSlideCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
order: zod_1.z.number(),
|
|
14
|
+
contentTypeId: zod_1.z.string(),
|
|
15
|
+
layoutId: zod_1.z.string(),
|
|
16
|
+
content: zod_1.z.record(zod_1.z.any()),
|
|
17
|
+
createdAt: zod_1.z.date(),
|
|
18
|
+
updatedAt: zod_1.z.date(),
|
|
19
|
+
}),
|
|
20
|
+
});
|
|
21
|
+
})(BuildBlankSlideCommand || (exports.BuildBlankSlideCommand = BuildBlankSlideCommand = {}));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateAndInsertSlideCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const presentation_1 = require("../../../models/tools/presentation");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
var GenerateAndInsertSlideCommand;
|
|
8
|
+
(function (GenerateAndInsertSlideCommand) {
|
|
9
|
+
GenerateAndInsertSlideCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
contentTypeId: zod_1.z.nativeEnum(constants_1.SLIDE_CONTENT_TYPE),
|
|
11
|
+
prompt: zod_1.z.string().max(10000).optional(),
|
|
12
|
+
title: zod_1.z.string().min(1).max(80),
|
|
13
|
+
position: zod_1.z.number().min(0),
|
|
14
|
+
layoutId: zod_1.z.nativeEnum(constants_1.SLIDE_LAYOUT).optional(),
|
|
15
|
+
});
|
|
16
|
+
GenerateAndInsertSlideCommand.RequestParamsSchema = zod_1.z.object({
|
|
17
|
+
uuid: zod_1.z.string().uuid(),
|
|
18
|
+
});
|
|
19
|
+
GenerateAndInsertSlideCommand.ResponseSchema = zod_1.z.object({
|
|
20
|
+
data: zod_1.z.array(presentation_1.SlideSchema),
|
|
21
|
+
});
|
|
22
|
+
})(GenerateAndInsertSlideCommand || (exports.GenerateAndInsertSlideCommand = GenerateAndInsertSlideCommand = {}));
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./build-blank-slide.command"), exports);
|
|
17
18
|
__exportStar(require("./create-presentation.command"), exports);
|
|
18
19
|
__exportStar(require("./delete-all-user-presentations.command"), exports);
|
|
19
20
|
__exportStar(require("./delete-slide-outline.command"), exports);
|
|
@@ -23,9 +24,15 @@ __exportStar(require("./find-presentation-by-uuid.command"), exports);
|
|
|
23
24
|
__exportStar(require("./find-presentation-outline.command"), exports);
|
|
24
25
|
__exportStar(require("./find-presentations.command"), exports);
|
|
25
26
|
__exportStar(require("./generate-presentation-slides.command"), exports);
|
|
27
|
+
__exportStar(require("./generate-and-insert-slide.command"), exports);
|
|
26
28
|
__exportStar(require("./get-presentation-config.command"), exports);
|
|
27
29
|
__exportStar(require("./reposition-slide-outline.command"), exports);
|
|
28
30
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
29
31
|
__exportStar(require("./update-presentation-outline.command"), exports);
|
|
30
32
|
__exportStar(require("./update-presentation.command"), exports);
|
|
33
|
+
__exportStar(require("./update-presentation-slides.command"), exports);
|
|
34
|
+
__exportStar(require("./update-slide-image-slot.command"), exports);
|
|
31
35
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
36
|
+
__exportStar(require("./presentation-paraphrase.command"), exports);
|
|
37
|
+
__exportStar(require("./presentation-generate-report.command"), exports);
|
|
38
|
+
__exportStar(require("./update-slide.command"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationGenerateReportCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var PresentationGenerateReportCommand;
|
|
6
|
+
(function (PresentationGenerateReportCommand) {
|
|
7
|
+
PresentationGenerateReportCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
presentationId: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
PresentationGenerateReportCommand.RequestSchema = PresentationGenerateReportCommand.RequestParamsSchema;
|
|
11
|
+
PresentationGenerateReportCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
output: zod_1.z.string(),
|
|
14
|
+
docxUrl: zod_1.z.string(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
})(PresentationGenerateReportCommand || (exports.PresentationGenerateReportCommand = PresentationGenerateReportCommand = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationParaphraseCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var PresentationParaphraseCommand;
|
|
6
|
+
(function (PresentationParaphraseCommand) {
|
|
7
|
+
PresentationParaphraseCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
presentationId: zod_1.z.string(),
|
|
9
|
+
slideId: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
PresentationParaphraseCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
selectionText: zod_1.z.string().max(10000),
|
|
13
|
+
});
|
|
14
|
+
PresentationParaphraseCommand.RequestSchema = PresentationParaphraseCommand.RequestParamsSchema.merge(PresentationParaphraseCommand.RequestBodySchema);
|
|
15
|
+
PresentationParaphraseCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: zod_1.z.object({
|
|
17
|
+
output: zod_1.z.string(),
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
})(PresentationParaphraseCommand || (exports.PresentationParaphraseCommand = PresentationParaphraseCommand = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePresentationSlidesCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const presentation_1 = require("../../../models/tools/presentation");
|
|
6
|
+
var UpdatePresentationSlidesCommand;
|
|
7
|
+
(function (UpdatePresentationSlidesCommand) {
|
|
8
|
+
UpdatePresentationSlidesCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
data: presentation_1.SlideBulkUpdateSchema,
|
|
10
|
+
});
|
|
11
|
+
UpdatePresentationSlidesCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdatePresentationSlidesCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: zod_1.z.array(zod_1.z.object({
|
|
16
|
+
uuid: zod_1.z.string().uuid(),
|
|
17
|
+
order: zod_1.z.number(),
|
|
18
|
+
contentTypeId: zod_1.z.string(),
|
|
19
|
+
layoutId: zod_1.z.string(),
|
|
20
|
+
content: zod_1.z.record(zod_1.z.any()),
|
|
21
|
+
createdAt: zod_1.z.date(),
|
|
22
|
+
updatedAt: zod_1.z.date(),
|
|
23
|
+
})),
|
|
24
|
+
});
|
|
25
|
+
})(UpdatePresentationSlidesCommand || (exports.UpdatePresentationSlidesCommand = UpdatePresentationSlidesCommand = {}));
|
|
@@ -8,9 +8,10 @@ var UpdatePresentationCommand;
|
|
|
8
8
|
UpdatePresentationCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
|
-
UpdatePresentationCommand.RequestBodySchema =
|
|
12
|
-
title:
|
|
13
|
-
|
|
11
|
+
UpdatePresentationCommand.RequestBodySchema = presentation_1.PresentationSchema.pick({
|
|
12
|
+
title: true,
|
|
13
|
+
templateId: true,
|
|
14
|
+
}).partial();
|
|
14
15
|
UpdatePresentationCommand.ResponseSchema = zod_1.z.object({
|
|
15
16
|
data: presentation_1.PresentationSchema,
|
|
16
17
|
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateSlideImageSlotCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const slide_image_slot_schema_1 = require("../../../models/tools/presentation/slide-image-slot.schema");
|
|
7
|
+
var UpdateSlideImageSlotCommand;
|
|
8
|
+
(function (UpdateSlideImageSlotCommand) {
|
|
9
|
+
const ReplacePayload = zod_1.z.object({
|
|
10
|
+
action: zod_1.z.literal(constants_1.SLIDE_IMAGE_SLOT_ACTION.REPLACE),
|
|
11
|
+
fileId: zod_1.z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
const GeneratePayload = zod_1.z.object({
|
|
14
|
+
action: zod_1.z.literal(constants_1.SLIDE_IMAGE_SLOT_ACTION.GENERATE),
|
|
15
|
+
prompt: zod_1.z.string().min(1).max(1000).optional(),
|
|
16
|
+
});
|
|
17
|
+
const UpdateImageSlotPayloadSchema = zod_1.z.discriminatedUnion('action', [
|
|
18
|
+
ReplacePayload,
|
|
19
|
+
GeneratePayload,
|
|
20
|
+
]);
|
|
21
|
+
UpdateSlideImageSlotCommand.RequestSchema = zod_1.z.object({
|
|
22
|
+
payload: UpdateImageSlotPayloadSchema,
|
|
23
|
+
});
|
|
24
|
+
UpdateSlideImageSlotCommand.RequestParamsSchema = zod_1.z.object({
|
|
25
|
+
presentationId: zod_1.z.string().uuid(),
|
|
26
|
+
slideId: zod_1.z.string().uuid(),
|
|
27
|
+
slotId: zod_1.z.string().uuid().optional(),
|
|
28
|
+
});
|
|
29
|
+
UpdateSlideImageSlotCommand.ResponseSchema = zod_1.z.object({
|
|
30
|
+
data: zod_1.z.object({
|
|
31
|
+
imageSlot: slide_image_slot_schema_1.SlideImageSlotSchema,
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
})(UpdateSlideImageSlotCommand || (exports.UpdateSlideImageSlotCommand = UpdateSlideImageSlotCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateSlideCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const presentation_1 = require("../../../models/tools/presentation");
|
|
6
|
+
var UpdateSlideCommand;
|
|
7
|
+
(function (UpdateSlideCommand) {
|
|
8
|
+
UpdateSlideCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
presentationId: zod_1.z.string(),
|
|
10
|
+
slideId: zod_1.z.string(),
|
|
11
|
+
});
|
|
12
|
+
UpdateSlideCommand.RequestBodySchema = zod_1.z.object({
|
|
13
|
+
data: presentation_1.SlideUpdateSchema,
|
|
14
|
+
});
|
|
15
|
+
UpdateSlideCommand.RequestSchema = UpdateSlideCommand.RequestParamsSchema.merge(UpdateSlideCommand.RequestBodySchema);
|
|
16
|
+
UpdateSlideCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: presentation_1.SlideSchema,
|
|
18
|
+
});
|
|
19
|
+
})(UpdateSlideCommand || (exports.UpdateSlideCommand = UpdateSlideCommand = {}));
|
|
@@ -2286,8 +2286,18 @@ exports.ERRORS = {
|
|
|
2286
2286
|
message: 'Не удалось применить бонусы вебмастеру',
|
|
2287
2287
|
httpCode: 500,
|
|
2288
2288
|
},
|
|
2289
|
-
|
|
2289
|
+
SLIDE_IMAGE_SLOT_UPDATE_ERROR: {
|
|
2290
2290
|
code: 'A468',
|
|
2291
|
+
message: 'Произошла ошибка при обновлении изображения на слайде',
|
|
2292
|
+
httpCode: 500,
|
|
2293
|
+
},
|
|
2294
|
+
FILE_TYPE_NOT_SUPPORTED: {
|
|
2295
|
+
code: 'A469',
|
|
2296
|
+
message: 'Неподдерживаемый тип файла',
|
|
2297
|
+
httpCode: 400,
|
|
2298
|
+
},
|
|
2299
|
+
WEBMASTER_BALANCE_LESS_THAN_MINIMUM_ERROR: {
|
|
2300
|
+
code: 'A470',
|
|
2291
2301
|
message: 'Минимальная сумма для вывода 5000 рублей',
|
|
2292
2302
|
httpCode: 400,
|
|
2293
2303
|
},
|
|
@@ -19,3 +19,7 @@ __exportStar(require("./slide-content-type.enum"), exports);
|
|
|
19
19
|
__exportStar(require("./slide-icon-slot-status.enum"), exports);
|
|
20
20
|
__exportStar(require("./slide-image-slot.status.enum"), exports);
|
|
21
21
|
__exportStar(require("./slide-layout.enum"), exports);
|
|
22
|
+
__exportStar(require("./slide-image-slot-action.enum"), exports);
|
|
23
|
+
__exportStar(require("./presentation-ai-action-type.enum"), exports);
|
|
24
|
+
__exportStar(require("./presentation-ai-action-pricing-type.enum"), exports);
|
|
25
|
+
__exportStar(require("./presentation-ai-action-call-status.enum"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRESENTATION_AI_ACTION_CALL_STATUS = void 0;
|
|
4
|
+
var PRESENTATION_AI_ACTION_CALL_STATUS;
|
|
5
|
+
(function (PRESENTATION_AI_ACTION_CALL_STATUS) {
|
|
6
|
+
PRESENTATION_AI_ACTION_CALL_STATUS["PROCESSING"] = "processing";
|
|
7
|
+
PRESENTATION_AI_ACTION_CALL_STATUS["COMPLETED"] = "completed";
|
|
8
|
+
PRESENTATION_AI_ACTION_CALL_STATUS["FAILED"] = "failed";
|
|
9
|
+
})(PRESENTATION_AI_ACTION_CALL_STATUS || (exports.PRESENTATION_AI_ACTION_CALL_STATUS = PRESENTATION_AI_ACTION_CALL_STATUS = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRESENTATION_AI_ACTION_PRICING_TYPE = void 0;
|
|
4
|
+
var PRESENTATION_AI_ACTION_PRICING_TYPE;
|
|
5
|
+
(function (PRESENTATION_AI_ACTION_PRICING_TYPE) {
|
|
6
|
+
PRESENTATION_AI_ACTION_PRICING_TYPE["PER_CHARACTER"] = "PER_CHARACTER";
|
|
7
|
+
PRESENTATION_AI_ACTION_PRICING_TYPE["FLAT"] = "FLAT";
|
|
8
|
+
})(PRESENTATION_AI_ACTION_PRICING_TYPE || (exports.PRESENTATION_AI_ACTION_PRICING_TYPE = PRESENTATION_AI_ACTION_PRICING_TYPE = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRESENTATION_AI_ACTION_TYPE = void 0;
|
|
4
|
+
var PRESENTATION_AI_ACTION_TYPE;
|
|
5
|
+
(function (PRESENTATION_AI_ACTION_TYPE) {
|
|
6
|
+
PRESENTATION_AI_ACTION_TYPE["PARAPHRASE"] = "PARAPHRASE";
|
|
7
|
+
PRESENTATION_AI_ACTION_TYPE["GENERATE_REPORT"] = "GENERATE_REPORT";
|
|
8
|
+
})(PRESENTATION_AI_ACTION_TYPE || (exports.PRESENTATION_AI_ACTION_TYPE = PRESENTATION_AI_ACTION_TYPE = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SLIDE_IMAGE_SLOT_ACTION = void 0;
|
|
4
|
+
var SLIDE_IMAGE_SLOT_ACTION;
|
|
5
|
+
(function (SLIDE_IMAGE_SLOT_ACTION) {
|
|
6
|
+
SLIDE_IMAGE_SLOT_ACTION["REPLACE"] = "REPLACE";
|
|
7
|
+
SLIDE_IMAGE_SLOT_ACTION["GENERATE"] = "GENERATE";
|
|
8
|
+
})(SLIDE_IMAGE_SLOT_ACTION || (exports.SLIDE_IMAGE_SLOT_ACTION = SLIDE_IMAGE_SLOT_ACTION = {}));
|
package/build/helpers/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ai-model"), exports);
|
|
18
|
+
__exportStar(require("./presentation"), exports);
|
|
18
19
|
__exportStar(require("./stt"), exports);
|
|
19
20
|
__exportStar(require("./subscription"), exports);
|
|
20
21
|
__exportStar(require("./tts"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculatePresentationAiActionPrice = calculatePresentationAiActionPrice;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
function calculatePresentationAiActionPrice(pricingRules, selectionText) {
|
|
6
|
+
switch (pricingRules.type) {
|
|
7
|
+
case constants_1.PRESENTATION_AI_ACTION_PRICING_TYPE.PER_CHARACTER:
|
|
8
|
+
const characterCount = selectionText.length;
|
|
9
|
+
const price = characterCount * pricingRules.price;
|
|
10
|
+
return Math.max(1, Math.ceil(price));
|
|
11
|
+
case constants_1.PRESENTATION_AI_ACTION_PRICING_TYPE.FLAT:
|
|
12
|
+
return Math.max(1, Math.ceil(pricingRules.price));
|
|
13
|
+
default:
|
|
14
|
+
throw new Error(`Unknown pricing type`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./calculate-presentation-ai-action-price.util"), exports);
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./language"), exports);
|
|
18
18
|
__exportStar(require("./paraphrase"), exports);
|
|
19
|
+
__exportStar(require("./presentation"), exports);
|
|
19
20
|
__exportStar(require("./stt"), exports);
|
|
20
21
|
__exportStar(require("./tts"), exports);
|
|
21
22
|
__exportStar(require("./video"), exports);
|
|
@@ -21,3 +21,4 @@ __exportStar(require("./slide-outline.schema"), exports);
|
|
|
21
21
|
__exportStar(require("./slide.schema"), exports);
|
|
22
22
|
__exportStar(require("./slide-content.schema"), exports);
|
|
23
23
|
__exportStar(require("./presentation-config.schema"), exports);
|
|
24
|
+
__exportStar(require("./presentation-ai-action.schema"), exports);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationAiActionSchema = exports.PresentationAiActionPricingRulesSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
exports.PresentationAiActionPricingRulesSchema = zod_1.z.discriminatedUnion('type', [
|
|
7
|
+
zod_1.z.object({
|
|
8
|
+
type: zod_1.z.literal(constants_1.PRESENTATION_AI_ACTION_PRICING_TYPE.PER_CHARACTER),
|
|
9
|
+
price: zod_1.z.number(),
|
|
10
|
+
}),
|
|
11
|
+
zod_1.z.object({
|
|
12
|
+
type: zod_1.z.literal(constants_1.PRESENTATION_AI_ACTION_PRICING_TYPE.FLAT),
|
|
13
|
+
price: zod_1.z.number(),
|
|
14
|
+
}),
|
|
15
|
+
]);
|
|
16
|
+
exports.PresentationAiActionSchema = zod_1.z.object({
|
|
17
|
+
uuid: zod_1.z.string(),
|
|
18
|
+
type: zod_1.z.nativeEnum(constants_1.PRESENTATION_AI_ACTION_TYPE),
|
|
19
|
+
pricingRules: exports.PresentationAiActionPricingRulesSchema,
|
|
20
|
+
maxPromptLength: zod_1.z.number(),
|
|
21
|
+
aiModel: zod_1.z.string(),
|
|
22
|
+
title: zod_1.z.string(),
|
|
23
|
+
icon: zod_1.z.string(),
|
|
24
|
+
order: zod_1.z.number(),
|
|
25
|
+
createdAt: zod_1.z.date(),
|
|
26
|
+
updatedAt: zod_1.z.date(),
|
|
27
|
+
});
|
|
@@ -5,14 +5,17 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const slide_content_type_schema_1 = require("./slide-content-type.schema");
|
|
6
6
|
const language_1 = require("../language");
|
|
7
7
|
const presentation_template_schema_1 = require("./presentation-template.schema");
|
|
8
|
+
const presentation_ai_action_schema_1 = require("./presentation-ai-action.schema");
|
|
8
9
|
exports.PresentationConfigSchema = zod_1.z.object({
|
|
9
10
|
slideContentTypes: zod_1.z.array(slide_content_type_schema_1.SlideContentTypeSchema),
|
|
10
11
|
languages: zod_1.z.array(language_1.LanguageSchema),
|
|
11
12
|
templates: zod_1.z.array(presentation_template_schema_1.PresentationTemplateSchema),
|
|
13
|
+
aiActions: zod_1.z.array(presentation_ai_action_schema_1.PresentationAiActionSchema),
|
|
12
14
|
slideGenerationPrice: zod_1.z.number(),
|
|
13
15
|
maxSlides: zod_1.z.number(),
|
|
14
16
|
minSlides: zod_1.z.number(),
|
|
15
17
|
maxSlideTitleLength: zod_1.z.number(),
|
|
16
18
|
maxSlideOutlineLength: zod_1.z.number(),
|
|
17
19
|
maxPromptLength: zod_1.z.number(),
|
|
20
|
+
imageGenerationPrice: zod_1.z.number(),
|
|
18
21
|
});
|
|
@@ -15,6 +15,8 @@ exports.PresentationSchema = zod_1.z.object({
|
|
|
15
15
|
templateId: zod_1.z.string(),
|
|
16
16
|
downloadUrl: zod_1.z.string().nullable(),
|
|
17
17
|
slideCount: zod_1.z.number(),
|
|
18
|
+
lastContentUpdateAt: zod_1.z.date().nullable(),
|
|
19
|
+
lastPptxExportedAt: zod_1.z.date().nullable(),
|
|
18
20
|
createdAt: zod_1.z.date(),
|
|
19
21
|
updatedAt: zod_1.z.date(),
|
|
20
22
|
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SlideContentUserEditSchema = exports.ChartSlideDataUserEditSchema = exports.BarChartSlideDataUserEditSchema = exports.TableSlideDataUserEditSchema = exports.SectionBreakSlideDataUserEditSchema = exports.ImageSlideDataUserEditSchema = exports.ContentsSlideDataUserEditSchema = exports.StructuredListSlideDataUserEditSchema = exports.TextSlideDataUserEditSchema = exports.ThankYouSlideDataUserEditSchema = exports.CoverSlideDataUserEditSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const slide_content_schema_1 = require("./slide-content.schema");
|
|
9
|
+
const constants_1 = require("../../../constants");
|
|
10
|
+
exports.CoverSlideDataUserEditSchema = zod_1.default.object({
|
|
11
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
|
|
12
|
+
title: zod_1.default.string().max(1000),
|
|
13
|
+
author: zod_1.default.object({
|
|
14
|
+
label: zod_1.default.string().max(200),
|
|
15
|
+
value: zod_1.default.string().max(500),
|
|
16
|
+
}),
|
|
17
|
+
date: zod_1.default.object({
|
|
18
|
+
label: zod_1.default.string().max(200),
|
|
19
|
+
value: zod_1.default.string().max(500),
|
|
20
|
+
}),
|
|
21
|
+
email: zod_1.default.object({
|
|
22
|
+
label: zod_1.default.string().max(200),
|
|
23
|
+
value: zod_1.default.string().max(500),
|
|
24
|
+
}),
|
|
25
|
+
version: zod_1.default.literal(1),
|
|
26
|
+
});
|
|
27
|
+
exports.ThankYouSlideDataUserEditSchema = zod_1.default.object({
|
|
28
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
29
|
+
title: zod_1.default.string().max(1000),
|
|
30
|
+
author: zod_1.default.object({
|
|
31
|
+
label: zod_1.default.string().max(200),
|
|
32
|
+
value: zod_1.default.string().max(500),
|
|
33
|
+
}),
|
|
34
|
+
date: zod_1.default.object({
|
|
35
|
+
label: zod_1.default.string().max(200),
|
|
36
|
+
value: zod_1.default.string().max(500),
|
|
37
|
+
}),
|
|
38
|
+
email: zod_1.default.object({
|
|
39
|
+
label: zod_1.default.string().max(200),
|
|
40
|
+
value: zod_1.default.string().max(500),
|
|
41
|
+
}),
|
|
42
|
+
version: zod_1.default.literal(1),
|
|
43
|
+
});
|
|
44
|
+
exports.TextSlideDataUserEditSchema = zod_1.default.object({
|
|
45
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.TEXT),
|
|
46
|
+
title: zod_1.default.string().max(1000),
|
|
47
|
+
description: zod_1.default.string().max(5000),
|
|
48
|
+
version: zod_1.default.literal(1),
|
|
49
|
+
});
|
|
50
|
+
exports.StructuredListSlideDataUserEditSchema = zod_1.default.object({
|
|
51
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.STRUCTURED_LIST),
|
|
52
|
+
title: zod_1.default.string().max(1000),
|
|
53
|
+
description: zod_1.default.string().max(2000),
|
|
54
|
+
list: zod_1.default
|
|
55
|
+
.array(zod_1.default.object({
|
|
56
|
+
title: zod_1.default.string().max(500),
|
|
57
|
+
description: zod_1.default.string().max(1000),
|
|
58
|
+
}))
|
|
59
|
+
.max(15),
|
|
60
|
+
version: zod_1.default.literal(1),
|
|
61
|
+
});
|
|
62
|
+
exports.ContentsSlideDataUserEditSchema = zod_1.default.object({
|
|
63
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.CONTENTS),
|
|
64
|
+
title: zod_1.default.string().max(1000),
|
|
65
|
+
items: zod_1.default
|
|
66
|
+
.array(zod_1.default.object({
|
|
67
|
+
pageNumber: zod_1.default.number(),
|
|
68
|
+
title: zod_1.default.string().max(1000),
|
|
69
|
+
}))
|
|
70
|
+
.max(100),
|
|
71
|
+
version: zod_1.default.literal(1),
|
|
72
|
+
});
|
|
73
|
+
exports.ImageSlideDataUserEditSchema = zod_1.default.object({
|
|
74
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE),
|
|
75
|
+
title: zod_1.default.string().max(1000),
|
|
76
|
+
description: zod_1.default.string().max(4000),
|
|
77
|
+
imageSlot: slide_content_schema_1.ImageSlotSchema,
|
|
78
|
+
version: zod_1.default.literal(1),
|
|
79
|
+
});
|
|
80
|
+
exports.SectionBreakSlideDataUserEditSchema = zod_1.default.object({
|
|
81
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.SECTION_BREAK),
|
|
82
|
+
title: zod_1.default.string().max(1000),
|
|
83
|
+
description: zod_1.default.string().max(1000),
|
|
84
|
+
version: zod_1.default.literal(1),
|
|
85
|
+
});
|
|
86
|
+
exports.TableSlideDataUserEditSchema = zod_1.default.object({
|
|
87
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.TABLE),
|
|
88
|
+
title: zod_1.default.string().max(1000),
|
|
89
|
+
description: zod_1.default.string().max(2000),
|
|
90
|
+
table: zod_1.default.object({
|
|
91
|
+
columnHeaders: zod_1.default.array(zod_1.default.string().max(500)).max(30),
|
|
92
|
+
rows: zod_1.default.array(zod_1.default.array(zod_1.default.string().max(1000))).max(50),
|
|
93
|
+
hasRowHeaders: zod_1.default.boolean(),
|
|
94
|
+
hasSummaryRow: zod_1.default.boolean(),
|
|
95
|
+
}),
|
|
96
|
+
version: zod_1.default.literal(1),
|
|
97
|
+
});
|
|
98
|
+
exports.BarChartSlideDataUserEditSchema = zod_1.default.object({
|
|
99
|
+
type: zod_1.default.literal(slide_content_schema_1.SLIDE_CHART_TYPE.BAR),
|
|
100
|
+
categories: zod_1.default.array(zod_1.default.string().max(500)).max(100),
|
|
101
|
+
series: zod_1.default
|
|
102
|
+
.array(zod_1.default.object({
|
|
103
|
+
name: zod_1.default.string().max(500),
|
|
104
|
+
data: zod_1.default.array(zod_1.default.number()),
|
|
105
|
+
type: zod_1.default.number().min(0).max(11),
|
|
106
|
+
}))
|
|
107
|
+
.max(10),
|
|
108
|
+
yAxisLabel: zod_1.default.string().max(500).optional(),
|
|
109
|
+
unit: zod_1.default.string().max(100).optional(),
|
|
110
|
+
version: zod_1.default.literal(1),
|
|
111
|
+
});
|
|
112
|
+
exports.ChartSlideDataUserEditSchema = zod_1.default.object({
|
|
113
|
+
contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.CHART),
|
|
114
|
+
title: zod_1.default.string().max(1000),
|
|
115
|
+
description: zod_1.default.string().max(4000),
|
|
116
|
+
chart: zod_1.default.discriminatedUnion('type', [exports.BarChartSlideDataUserEditSchema]),
|
|
117
|
+
version: zod_1.default.literal(1),
|
|
118
|
+
});
|
|
119
|
+
exports.SlideContentUserEditSchema = zod_1.default.discriminatedUnion('contentType', [
|
|
120
|
+
exports.CoverSlideDataUserEditSchema,
|
|
121
|
+
exports.StructuredListSlideDataUserEditSchema,
|
|
122
|
+
exports.TextSlideDataUserEditSchema,
|
|
123
|
+
exports.ContentsSlideDataUserEditSchema,
|
|
124
|
+
exports.SectionBreakSlideDataUserEditSchema,
|
|
125
|
+
exports.ImageSlideDataUserEditSchema,
|
|
126
|
+
exports.ThankYouSlideDataUserEditSchema,
|
|
127
|
+
exports.TableSlideDataUserEditSchema,
|
|
128
|
+
exports.ChartSlideDataUserEditSchema,
|
|
129
|
+
]);
|