@purpleschool/gptbot-tools 0.0.63 → 0.0.64
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/common/errors/errors.js +89 -0
- package/build/presentation/commands/build-blank-slide.command.js +15 -0
- package/build/presentation/commands/generate-and-insert-slide.command.js +22 -0
- package/build/presentation/commands/index.js +7 -0
- package/build/presentation/commands/presentation-generate-report.command.js +18 -0
- package/build/presentation/commands/presentation-paraphrase.command.js +19 -0
- package/build/presentation/commands/update-presentation-slides.command.js +16 -0
- package/build/presentation/commands/update-slide-image-slot.command.js +34 -0
- package/build/presentation/commands/update-slide.command.js +17 -0
- package/build/presentation/enums/index.js +4 -0
- package/build/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
- package/build/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
- package/build/presentation/enums/presentation-ai-action-type.enum.js +8 -0
- package/build/presentation/enums/slide-image-slot-action.enum.js +8 -0
- package/build/presentation/index.js +1 -0
- package/build/presentation/models/index.js +1 -0
- package/build/presentation/models/presentation-ai-action.schema.js +27 -0
- package/build/presentation/models/presentation-config.schema.js +3 -0
- package/build/presentation/models/presentation.schema.js +4 -1
- package/build/presentation/models/slide-content-edit.schema.js +135 -0
- package/build/presentation/models/slide-content.schema.js +5 -1
- package/build/presentation/models/slide.schema.js +39 -1
- package/build/presentation/routes/presentation.routes.js +7 -0
- package/build/presentation/utils/calculate-presentation-ai-action-price.util.js +16 -0
- package/build/presentation/utils/index.js +17 -0
- package/build/tools/enums/tool-type.enum.js +1 -0
- package/common/errors/errors.ts +89 -0
- package/package.json +1 -1
- package/presentation/commands/build-blank-slide.command.ts +15 -0
- package/presentation/commands/generate-and-insert-slide.command.ts +22 -0
- package/presentation/commands/index.ts +7 -0
- package/presentation/commands/presentation-generate-report.command.ts +20 -0
- package/presentation/commands/presentation-paraphrase.command.ts +21 -0
- package/presentation/commands/update-presentation-slides.command.ts +16 -0
- package/presentation/commands/update-slide-image-slot.command.ts +39 -0
- package/presentation/commands/update-slide.command.ts +17 -0
- package/presentation/enums/index.ts +4 -0
- package/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
- package/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
- package/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
- package/presentation/enums/slide-image-slot-action.enum.ts +4 -0
- package/presentation/index.ts +1 -0
- package/presentation/models/index.ts +1 -0
- package/presentation/models/presentation-ai-action.schema.ts +30 -0
- package/presentation/models/presentation-config.schema.ts +3 -0
- package/presentation/models/presentation.schema.ts +4 -1
- package/presentation/models/slide-content-edit.schema.ts +160 -0
- package/presentation/models/slide-content.schema.ts +104 -11
- package/presentation/models/slide-image-slot.schema.ts +1 -0
- package/presentation/models/slide.schema.ts +47 -0
- package/presentation/routes/presentation.routes.ts +7 -0
- package/presentation/utils/calculate-presentation-ai-action-price.util.ts +20 -0
- package/presentation/utils/index.ts +1 -0
- package/tools/enums/tool-type.enum.ts +1 -0
|
@@ -343,6 +343,95 @@ exports.ERRORS = {
|
|
|
343
343
|
message: 'У пользователя недостаточно средств для генерации слайдов',
|
|
344
344
|
httpCode: 400,
|
|
345
345
|
},
|
|
346
|
+
CREATE_BLANK_SLIDE_ERROR: {
|
|
347
|
+
code: 'PRESENTATION.CREATE_BLANK_SLIDE_ERROR',
|
|
348
|
+
message: 'Произошла ошибка при создании пустого слайда',
|
|
349
|
+
httpCode: 500,
|
|
350
|
+
},
|
|
351
|
+
INVALID_CONTENT_TYPE_CHANGE: {
|
|
352
|
+
code: 'PRESENTATION.INVALID_CONTENT_TYPE_CHANGE',
|
|
353
|
+
message: 'Невозможно изменить тип существующего слайда',
|
|
354
|
+
httpCode: 400,
|
|
355
|
+
},
|
|
356
|
+
INVALID_SLIDE_POSITION: {
|
|
357
|
+
code: 'PRESENTATION.INVALID_SLIDE_POSITION',
|
|
358
|
+
message: 'Неверная позиция для вставки слайда',
|
|
359
|
+
httpCode: 400,
|
|
360
|
+
},
|
|
361
|
+
SLIDES_UPDATE_ERROR: {
|
|
362
|
+
code: 'PRESENTATION.SLIDES_UPDATE_ERROR',
|
|
363
|
+
message: 'Произошла ошибка при обновлении слайдов презентации',
|
|
364
|
+
httpCode: 500,
|
|
365
|
+
},
|
|
366
|
+
SLIDE_NOT_FOUND: {
|
|
367
|
+
code: 'PRESENTATION.SLIDE_NOT_FOUND',
|
|
368
|
+
message: 'Слайд не найден',
|
|
369
|
+
httpCode: 404,
|
|
370
|
+
},
|
|
371
|
+
SLIDE_IMAGE_SLOT_NOT_FOUND: {
|
|
372
|
+
code: 'PRESENTATION.SLIDE_IMAGE_SLOT_NOT_FOUND',
|
|
373
|
+
message: 'Слот изображения слайда не найден',
|
|
374
|
+
httpCode: 404,
|
|
375
|
+
},
|
|
376
|
+
SLIDE_IMAGE_UPDATE_ERROR: {
|
|
377
|
+
code: 'PRESENTATION.SLIDE_IMAGE_UPDATE_ERROR',
|
|
378
|
+
message: 'Произошла ошибка при обновлении слота изображения слайда',
|
|
379
|
+
httpCode: 500,
|
|
380
|
+
},
|
|
381
|
+
INSUFFICIENT_BALANCE_FOR_IMAGE_GENERATION: {
|
|
382
|
+
code: 'PRESENTATION.INSUFFICIENT_BALANCE_FOR_IMAGE_GENERATION',
|
|
383
|
+
message: 'У пользователя недостаточно средств для генерации изображения',
|
|
384
|
+
httpCode: 400,
|
|
385
|
+
},
|
|
386
|
+
},
|
|
387
|
+
PRESENTATION_AI_ACTION: {
|
|
388
|
+
NOT_FOUND: {
|
|
389
|
+
code: 'PRESENTATION_AI_ACTION.NOT_FOUND',
|
|
390
|
+
message: 'ИИ операция для презентации не найдено',
|
|
391
|
+
httpCode: 404,
|
|
392
|
+
},
|
|
393
|
+
PROMPT_TOO_LONG: {
|
|
394
|
+
code: 'PRESENTATION_AI_ACTION.PROMPT_TOO_LONG',
|
|
395
|
+
message: 'Превышена максимальная длина запроса',
|
|
396
|
+
httpCode: 400,
|
|
397
|
+
},
|
|
398
|
+
INSUFFICIENT_BALANCE: {
|
|
399
|
+
code: 'PRESENTATION_AI_ACTION.INSUFFICIENT_BALANCE',
|
|
400
|
+
message: 'У пользователя недостаточно средств для выполнения операции',
|
|
401
|
+
httpCode: 400,
|
|
402
|
+
},
|
|
403
|
+
AI_ERROR: {
|
|
404
|
+
code: 'PRESENTATION_AI_ACTION.AI_ERROR',
|
|
405
|
+
message: 'Произошла ошибка во время запроса к ИИ',
|
|
406
|
+
httpCode: 500,
|
|
407
|
+
},
|
|
408
|
+
SAVE_ERROR: {
|
|
409
|
+
code: 'PRESENTATION_AI_ACTION.SAVE_ERROR',
|
|
410
|
+
message: 'Произошла ошибка при сохранении ИИ операции для презентации',
|
|
411
|
+
httpCode: 500,
|
|
412
|
+
},
|
|
413
|
+
FIND_ERROR: {
|
|
414
|
+
code: 'PRESENTATION_AI_ACTION.FIND_ERROR',
|
|
415
|
+
message: 'Произошла ошибка при поиске ИИ операций для презентации',
|
|
416
|
+
httpCode: 500,
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
PRESENTATION_AI_ACTION_CALL: {
|
|
420
|
+
NOT_FOUND: {
|
|
421
|
+
code: 'PRESENTATION_AI_ACTION_CALL.NOT_FOUND',
|
|
422
|
+
message: 'Вызов ИИ операции для презентации не найден',
|
|
423
|
+
httpCode: 404,
|
|
424
|
+
},
|
|
425
|
+
SAVE_ERROR: {
|
|
426
|
+
code: 'PRESENTATION_AI_ACTION_CALL.SAVE_ERROR',
|
|
427
|
+
message: 'Произошла ошибка при сохранении вызова ИИ операции для презентации',
|
|
428
|
+
httpCode: 500,
|
|
429
|
+
},
|
|
430
|
+
FIND_ERROR: {
|
|
431
|
+
code: 'PRESENTATION_AI_ACTION_CALL.FIND_ERROR',
|
|
432
|
+
message: 'Произошла ошибка при поиске вызова ИИ операции для презентации',
|
|
433
|
+
httpCode: 500,
|
|
434
|
+
},
|
|
346
435
|
},
|
|
347
436
|
SLIDE_OUTLINE: {
|
|
348
437
|
DELETE_ERROR: {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BuildBlankSlideCommand = void 0;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const models_1 = require("../models");
|
|
8
|
+
var BuildBlankSlideCommand;
|
|
9
|
+
(function (BuildBlankSlideCommand) {
|
|
10
|
+
BuildBlankSlideCommand.RequestSchema = zod_1.z.object({
|
|
11
|
+
slideContentType: zod_1.z.nativeEnum(enums_1.SLIDE_CONTENT_TYPE),
|
|
12
|
+
layoutId: zod_1.z.nativeEnum(enums_1.SLIDE_LAYOUT).optional(),
|
|
13
|
+
});
|
|
14
|
+
BuildBlankSlideCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.SlideSchema);
|
|
15
|
+
})(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 common_1 = require("../../common");
|
|
6
|
+
const enums_1 = require("../enums");
|
|
7
|
+
const models_1 = require("../models");
|
|
8
|
+
var GenerateAndInsertSlideCommand;
|
|
9
|
+
(function (GenerateAndInsertSlideCommand) {
|
|
10
|
+
GenerateAndInsertSlideCommand.RequestSchema = zod_1.z.object({
|
|
11
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
|
+
userBalance: zod_1.z.number(),
|
|
14
|
+
presentationId: zod_1.z.string().uuid(),
|
|
15
|
+
contentTypeId: zod_1.z.nativeEnum(enums_1.SLIDE_CONTENT_TYPE),
|
|
16
|
+
prompt: zod_1.z.string().min(1).max(1000).optional(),
|
|
17
|
+
title: zod_1.z.string().max(80),
|
|
18
|
+
position: zod_1.z.number().int().min(0),
|
|
19
|
+
layoutId: zod_1.z.nativeEnum(enums_1.SLIDE_LAYOUT).optional(),
|
|
20
|
+
});
|
|
21
|
+
GenerateAndInsertSlideCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.SlideSchema.array());
|
|
22
|
+
})(GenerateAndInsertSlideCommand || (exports.GenerateAndInsertSlideCommand = GenerateAndInsertSlideCommand = {}));
|
|
@@ -14,14 +14,21 @@ 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-presentation.command"), exports);
|
|
20
21
|
__exportStar(require("./delete-slide-outline.command"), exports);
|
|
21
22
|
__exportStar(require("./generate-presentation-outline.command"), exports);
|
|
23
|
+
__exportStar(require("./generate-and-insert-slide.command"), exports);
|
|
22
24
|
__exportStar(require("./export-as-pptx.command"), exports);
|
|
23
25
|
__exportStar(require("./generate-slides.command"), exports);
|
|
24
26
|
__exportStar(require("./reposition-slide-outline.command"), exports);
|
|
25
27
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
26
28
|
__exportStar(require("./update-presentation.command"), exports);
|
|
27
29
|
__exportStar(require("./update-presentation-outline.command"), exports);
|
|
30
|
+
__exportStar(require("./update-presentation-slides.command"), exports);
|
|
31
|
+
__exportStar(require("./update-slide-image-slot.command"), exports);
|
|
32
|
+
__exportStar(require("./update-slide.command"), exports);
|
|
33
|
+
__exportStar(require("./presentation-paraphrase.command"), exports);
|
|
34
|
+
__exportStar(require("./presentation-generate-report.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationGenerateReportCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
var PresentationGenerateReportCommand;
|
|
7
|
+
(function (PresentationGenerateReportCommand) {
|
|
8
|
+
PresentationGenerateReportCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
presentationId: zod_1.z.string().uuid(),
|
|
12
|
+
userBalance: zod_1.z.number(),
|
|
13
|
+
});
|
|
14
|
+
PresentationGenerateReportCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.object({
|
|
15
|
+
output: zod_1.z.string(),
|
|
16
|
+
docxUrl: zod_1.z.string(),
|
|
17
|
+
}));
|
|
18
|
+
})(PresentationGenerateReportCommand || (exports.PresentationGenerateReportCommand = PresentationGenerateReportCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationParaphraseCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
var PresentationParaphraseCommand;
|
|
7
|
+
(function (PresentationParaphraseCommand) {
|
|
8
|
+
PresentationParaphraseCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
presentationId: zod_1.z.string().uuid(),
|
|
12
|
+
slideId: zod_1.z.string().uuid(),
|
|
13
|
+
selectionText: zod_1.z.string(),
|
|
14
|
+
userBalance: zod_1.z.number(),
|
|
15
|
+
});
|
|
16
|
+
PresentationParaphraseCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.object({
|
|
17
|
+
output: zod_1.z.string(),
|
|
18
|
+
}));
|
|
19
|
+
})(PresentationParaphraseCommand || (exports.PresentationParaphraseCommand = PresentationParaphraseCommand = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePresentationSlidesCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../models");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
var UpdatePresentationSlidesCommand;
|
|
8
|
+
(function (UpdatePresentationSlidesCommand) {
|
|
9
|
+
UpdatePresentationSlidesCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
|
+
presentationId: zod_1.z.string().uuid(),
|
|
13
|
+
data: models_1.SlideBulkUpdateSchema,
|
|
14
|
+
});
|
|
15
|
+
UpdatePresentationSlidesCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.array(models_1.SlideSchema));
|
|
16
|
+
})(UpdatePresentationSlidesCommand || (exports.UpdatePresentationSlidesCommand = UpdatePresentationSlidesCommand = {}));
|
|
@@ -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 common_1 = require("../../common");
|
|
6
|
+
const models_1 = require("../models");
|
|
7
|
+
const enums_1 = require("../enums");
|
|
8
|
+
var UpdateSlideImageSlotCommand;
|
|
9
|
+
(function (UpdateSlideImageSlotCommand) {
|
|
10
|
+
const ReplacePayload = zod_1.z.object({
|
|
11
|
+
action: zod_1.z.literal(enums_1.SLIDE_IMAGE_SLOT_ACTION.REPLACE),
|
|
12
|
+
url: zod_1.z.string().url(),
|
|
13
|
+
});
|
|
14
|
+
const GeneratePayload = zod_1.z.object({
|
|
15
|
+
action: zod_1.z.literal(enums_1.SLIDE_IMAGE_SLOT_ACTION.GENERATE),
|
|
16
|
+
prompt: zod_1.z.string().min(1).max(1000).optional(),
|
|
17
|
+
});
|
|
18
|
+
const UpdateImageSlotPayload = zod_1.z.discriminatedUnion('action', [
|
|
19
|
+
ReplacePayload,
|
|
20
|
+
GeneratePayload,
|
|
21
|
+
]);
|
|
22
|
+
UpdateSlideImageSlotCommand.RequestSchema = zod_1.z.object({
|
|
23
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
24
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
25
|
+
presentationId: zod_1.z.string().uuid(),
|
|
26
|
+
slideId: zod_1.z.string().uuid(),
|
|
27
|
+
slotId: zod_1.z.string().uuid().optional(),
|
|
28
|
+
payload: UpdateImageSlotPayload,
|
|
29
|
+
userBalance: zod_1.z.number(),
|
|
30
|
+
});
|
|
31
|
+
UpdateSlideImageSlotCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.object({
|
|
32
|
+
imageSlot: models_1.SlideImageSlotSchema,
|
|
33
|
+
}));
|
|
34
|
+
})(UpdateSlideImageSlotCommand || (exports.UpdateSlideImageSlotCommand = UpdateSlideImageSlotCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateSlideCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../models");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
var UpdateSlideCommand;
|
|
8
|
+
(function (UpdateSlideCommand) {
|
|
9
|
+
UpdateSlideCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
11
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
12
|
+
presentationId: zod_1.z.string().uuid(),
|
|
13
|
+
slideId: zod_1.z.string().uuid(),
|
|
14
|
+
data: models_1.SlideUpdateSchema,
|
|
15
|
+
});
|
|
16
|
+
UpdateSlideCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.SlideSchema);
|
|
17
|
+
})(UpdateSlideCommand || (exports.UpdateSlideCommand = UpdateSlideCommand = {}));
|
|
@@ -20,3 +20,7 @@ __exportStar(require("./slide-image-job-status.enum"), exports);
|
|
|
20
20
|
__exportStar(require("./slide-image-slot-status.enum"), exports);
|
|
21
21
|
__exportStar(require("./slide-icon-slot-status.enum"), exports);
|
|
22
22
|
__exportStar(require("./slide-layout.enum"), exports);
|
|
23
|
+
__exportStar(require("./slide-image-slot-action.enum"), exports);
|
|
24
|
+
__exportStar(require("./presentation-ai-action-call-status.enum"), exports);
|
|
25
|
+
__exportStar(require("./presentation-ai-action-type.enum"), exports);
|
|
26
|
+
__exportStar(require("./presentation-ai-action-pricing-type.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 = {}));
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./slide-outline.schema"), exports);
|
|
|
23
23
|
__exportStar(require("./slide.schema"), exports);
|
|
24
24
|
__exportStar(require("./slide-image-slot.schema"), exports);
|
|
25
25
|
__exportStar(require("./slide-content.schema"), exports);
|
|
26
|
+
__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 enums_1 = require("../enums");
|
|
6
|
+
exports.PresentationAiActionPricingRulesSchema = zod_1.z.discriminatedUnion('type', [
|
|
7
|
+
zod_1.z.object({
|
|
8
|
+
type: zod_1.z.literal(enums_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(enums_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(enums_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
|
});
|
|
@@ -18,6 +18,8 @@ exports.PresentationSchema = zod_1.z.object({
|
|
|
18
18
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
19
19
|
slideCount: zod_1.z.number(),
|
|
20
20
|
isDeleted: zod_1.z.boolean(),
|
|
21
|
+
lastContentUpdateAt: zod_1.z.date().nullable(),
|
|
22
|
+
lastPptxExportedAt: zod_1.z.date().nullable(),
|
|
21
23
|
createdAt: zod_1.z.date(),
|
|
22
24
|
updatedAt: zod_1.z.date(),
|
|
23
25
|
});
|
|
@@ -27,4 +29,5 @@ exports.PresentationWithSlidesSchema = exports.PresentationSchema.extend({
|
|
|
27
29
|
});
|
|
28
30
|
exports.PresentationUpdateSchema = exports.PresentationSchema.pick({
|
|
29
31
|
title: true,
|
|
30
|
-
|
|
32
|
+
templateId: true,
|
|
33
|
+
}).partial();
|
|
@@ -0,0 +1,135 @@
|
|
|
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 enums_1 = require("../enums");
|
|
9
|
+
const slide_content_schema_1 = require("./slide-content.schema");
|
|
10
|
+
exports.CoverSlideDataUserEditSchema = zod_1.default.object({
|
|
11
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.COVER),
|
|
12
|
+
title: zod_1.default.string().min(1).max(500),
|
|
13
|
+
author: zod_1.default.object({
|
|
14
|
+
label: zod_1.default.string().min(1).max(100),
|
|
15
|
+
value: zod_1.default.string().min(1).max(200),
|
|
16
|
+
}),
|
|
17
|
+
date: zod_1.default.object({
|
|
18
|
+
label: zod_1.default.string().min(1).max(100),
|
|
19
|
+
value: zod_1.default.string().min(1).max(200),
|
|
20
|
+
}),
|
|
21
|
+
email: zod_1.default.object({
|
|
22
|
+
label: zod_1.default.string().min(1).max(100),
|
|
23
|
+
value: zod_1.default.string().min(1).max(200),
|
|
24
|
+
}),
|
|
25
|
+
version: zod_1.default.literal(1),
|
|
26
|
+
});
|
|
27
|
+
exports.ThankYouSlideDataUserEditSchema = zod_1.default.object({
|
|
28
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
29
|
+
title: zod_1.default.string().min(1).max(500),
|
|
30
|
+
author: zod_1.default.object({
|
|
31
|
+
label: zod_1.default.string().min(1).max(100),
|
|
32
|
+
value: zod_1.default.string().min(1).max(200),
|
|
33
|
+
}),
|
|
34
|
+
date: zod_1.default.object({
|
|
35
|
+
label: zod_1.default.string().min(1).max(100),
|
|
36
|
+
value: zod_1.default.string().min(1).max(200),
|
|
37
|
+
}),
|
|
38
|
+
email: zod_1.default.object({
|
|
39
|
+
label: zod_1.default.string().min(1).max(100),
|
|
40
|
+
value: zod_1.default.string().min(1).max(200),
|
|
41
|
+
}),
|
|
42
|
+
version: zod_1.default.literal(1),
|
|
43
|
+
});
|
|
44
|
+
exports.TextSlideDataUserEditSchema = zod_1.default.object({
|
|
45
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.TEXT),
|
|
46
|
+
title: zod_1.default.string().min(1).max(500),
|
|
47
|
+
description: zod_1.default.string().min(1).max(3000),
|
|
48
|
+
version: zod_1.default.literal(1),
|
|
49
|
+
});
|
|
50
|
+
exports.StructuredListSlideDataUserEditSchema = zod_1.default.object({
|
|
51
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.STRUCTURED_LIST),
|
|
52
|
+
title: zod_1.default.string().min(1).max(500),
|
|
53
|
+
description: zod_1.default.string().min(1).max(1000),
|
|
54
|
+
list: zod_1.default
|
|
55
|
+
.array(zod_1.default.object({
|
|
56
|
+
title: zod_1.default.string().min(1).max(200),
|
|
57
|
+
description: zod_1.default.string().min(1).max(500),
|
|
58
|
+
}))
|
|
59
|
+
.min(1)
|
|
60
|
+
.max(10),
|
|
61
|
+
version: zod_1.default.literal(1),
|
|
62
|
+
});
|
|
63
|
+
exports.ContentsSlideDataUserEditSchema = zod_1.default.object({
|
|
64
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.CONTENTS),
|
|
65
|
+
title: zod_1.default.string().min(1).max(500),
|
|
66
|
+
items: zod_1.default
|
|
67
|
+
.array(zod_1.default.object({
|
|
68
|
+
pageNumber: zod_1.default.number(),
|
|
69
|
+
title: zod_1.default.string().min(1).max(500),
|
|
70
|
+
}))
|
|
71
|
+
.min(1)
|
|
72
|
+
.max(50),
|
|
73
|
+
version: zod_1.default.literal(1),
|
|
74
|
+
});
|
|
75
|
+
exports.ImageSlideDataUserEditSchema = zod_1.default.object({
|
|
76
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE),
|
|
77
|
+
title: zod_1.default.string().min(1).max(500),
|
|
78
|
+
description: zod_1.default.string().min(1).max(2000),
|
|
79
|
+
imageSlot: slide_content_schema_1.ImageSlotSchema,
|
|
80
|
+
version: zod_1.default.literal(1),
|
|
81
|
+
});
|
|
82
|
+
exports.SectionBreakSlideDataUserEditSchema = zod_1.default.object({
|
|
83
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.SECTION_BREAK),
|
|
84
|
+
title: zod_1.default.string().min(1).max(500),
|
|
85
|
+
description: zod_1.default.string().min(1).max(500),
|
|
86
|
+
version: zod_1.default.literal(1),
|
|
87
|
+
});
|
|
88
|
+
exports.TableSlideDataUserEditSchema = zod_1.default.object({
|
|
89
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.TABLE),
|
|
90
|
+
title: zod_1.default.string().min(1).max(500),
|
|
91
|
+
description: zod_1.default.string().min(1).max(1000),
|
|
92
|
+
table: zod_1.default.object({
|
|
93
|
+
columnHeaders: zod_1.default.array(zod_1.default.string().min(1).max(200)).min(1).max(20),
|
|
94
|
+
rows: zod_1.default
|
|
95
|
+
.array(zod_1.default.array(zod_1.default.string().min(1).max(500)))
|
|
96
|
+
.min(1)
|
|
97
|
+
.max(20),
|
|
98
|
+
hasRowHeaders: zod_1.default.boolean(),
|
|
99
|
+
hasSummaryRow: zod_1.default.boolean(),
|
|
100
|
+
}),
|
|
101
|
+
version: zod_1.default.literal(1),
|
|
102
|
+
});
|
|
103
|
+
exports.BarChartSlideDataUserEditSchema = zod_1.default.object({
|
|
104
|
+
type: zod_1.default.literal(slide_content_schema_1.SLIDE_CHART_TYPE.BAR),
|
|
105
|
+
categories: zod_1.default.array(zod_1.default.string().min(1).max(200)).min(1).max(50),
|
|
106
|
+
series: zod_1.default
|
|
107
|
+
.array(zod_1.default.object({
|
|
108
|
+
name: zod_1.default.string().min(1).max(200),
|
|
109
|
+
data: zod_1.default.array(zod_1.default.number()),
|
|
110
|
+
type: zod_1.default.number().min(0).max(11),
|
|
111
|
+
}))
|
|
112
|
+
.min(1)
|
|
113
|
+
.max(5),
|
|
114
|
+
yAxisLabel: zod_1.default.string().max(200).optional(),
|
|
115
|
+
unit: zod_1.default.string().max(50).optional(),
|
|
116
|
+
version: zod_1.default.literal(1),
|
|
117
|
+
});
|
|
118
|
+
exports.ChartSlideDataUserEditSchema = zod_1.default.object({
|
|
119
|
+
contentType: zod_1.default.literal(enums_1.SLIDE_CONTENT_TYPE.CHART),
|
|
120
|
+
title: zod_1.default.string().min(1).max(500),
|
|
121
|
+
description: zod_1.default.string().min(1).max(2000),
|
|
122
|
+
chart: zod_1.default.discriminatedUnion('type', [exports.BarChartSlideDataUserEditSchema]),
|
|
123
|
+
version: zod_1.default.literal(1),
|
|
124
|
+
});
|
|
125
|
+
exports.SlideContentUserEditSchema = zod_1.default.discriminatedUnion('contentType', [
|
|
126
|
+
exports.CoverSlideDataUserEditSchema,
|
|
127
|
+
exports.StructuredListSlideDataUserEditSchema,
|
|
128
|
+
exports.TextSlideDataUserEditSchema,
|
|
129
|
+
exports.ContentsSlideDataUserEditSchema,
|
|
130
|
+
exports.SectionBreakSlideDataUserEditSchema,
|
|
131
|
+
exports.ImageSlideDataUserEditSchema,
|
|
132
|
+
exports.ThankYouSlideDataUserEditSchema,
|
|
133
|
+
exports.TableSlideDataUserEditSchema,
|
|
134
|
+
exports.ChartSlideDataUserEditSchema,
|
|
135
|
+
]);
|
|
@@ -72,7 +72,11 @@ exports.StructuredListSlideDataSchema = zod_1.z.object({
|
|
|
72
72
|
list: zod_1.z
|
|
73
73
|
.array(zod_1.z.object({
|
|
74
74
|
title: zod_1.z.string().describe('2–4 words, concrete'),
|
|
75
|
-
description: zod_1.z
|
|
75
|
+
description: zod_1.z
|
|
76
|
+
.string()
|
|
77
|
+
.describe("One clear short framing sentence. DON'T CUT THE TEXT SHORT MID WORD/SENTENCE!. Generate less content if that happened")
|
|
78
|
+
.min(50)
|
|
79
|
+
.max(120),
|
|
76
80
|
}))
|
|
77
81
|
.length(4),
|
|
78
82
|
version: zod_1.z.literal(1),
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SlideSchema = void 0;
|
|
3
|
+
exports.SlideBulkUpdateSchema = exports.SlideUpdateSchema = exports.SlideSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const slide_content_schema_1 = require("./slide-content.schema");
|
|
6
6
|
const enums_1 = require("../enums");
|
|
7
7
|
const slide_icon_slot_schema_1 = require("./slide-icon-slot.schema");
|
|
8
8
|
const slide_image_slot_schema_1 = require("./slide-image-slot.schema");
|
|
9
|
+
const slide_content_edit_schema_1 = require("./slide-content-edit.schema");
|
|
9
10
|
exports.SlideSchema = zod_1.z.object({
|
|
10
11
|
uuid: zod_1.z.string().uuid(),
|
|
11
12
|
order: zod_1.z.number(),
|
|
@@ -18,3 +19,40 @@ exports.SlideSchema = zod_1.z.object({
|
|
|
18
19
|
createdAt: zod_1.z.date(),
|
|
19
20
|
updatedAt: zod_1.z.date(),
|
|
20
21
|
});
|
|
22
|
+
exports.SlideUpdateSchema = exports.SlideSchema.pick({
|
|
23
|
+
layoutId: true,
|
|
24
|
+
})
|
|
25
|
+
.extend({
|
|
26
|
+
content: slide_content_edit_schema_1.SlideContentUserEditSchema,
|
|
27
|
+
})
|
|
28
|
+
.partial();
|
|
29
|
+
exports.SlideBulkUpdateSchema = exports.SlideSchema.pick({
|
|
30
|
+
order: true,
|
|
31
|
+
contentTypeId: true,
|
|
32
|
+
layoutId: true,
|
|
33
|
+
presentationId: true,
|
|
34
|
+
})
|
|
35
|
+
.extend({
|
|
36
|
+
uuid: zod_1.z.string().uuid().optional(),
|
|
37
|
+
content: slide_content_edit_schema_1.SlideContentUserEditSchema,
|
|
38
|
+
})
|
|
39
|
+
.array()
|
|
40
|
+
.min(1, 'Must include at least one slide')
|
|
41
|
+
.refine((arr) => {
|
|
42
|
+
const orders = arr.map((s) => s.order);
|
|
43
|
+
const unique = new Set(orders);
|
|
44
|
+
if (unique.size !== orders.length)
|
|
45
|
+
return false;
|
|
46
|
+
const sorted = [...orders].sort((a, b) => a - b);
|
|
47
|
+
return sorted.every((val, idx) => val === idx);
|
|
48
|
+
}, {
|
|
49
|
+
message: 'Slide orders must be unique and sequential starting at 0',
|
|
50
|
+
path: ['order'],
|
|
51
|
+
})
|
|
52
|
+
.refine((arr) => {
|
|
53
|
+
const [firstId, ...rest] = arr.map((s) => s.presentationId);
|
|
54
|
+
return rest.every((id) => id === firstId);
|
|
55
|
+
}, {
|
|
56
|
+
message: 'All slides must belong to the same presentation',
|
|
57
|
+
path: ['presentationId'],
|
|
58
|
+
});
|
|
@@ -7,6 +7,7 @@ exports.PRESENTATION_AMQP_ROUTES = {
|
|
|
7
7
|
FIND_BY_UUID: 'tools.presentation.find-by-uuid.rpc',
|
|
8
8
|
GENERATE_PRESENTATION_OUTLINE: 'tools.presentation.generate-outline.rpc',
|
|
9
9
|
GENERATE_PRESENTATION_SLIDES: 'tools.presentation.generate-slides.rpc',
|
|
10
|
+
GENERATE_AND_INSERT_SLIDE: 'tools.presentation.generate-and-insert-slide.rpc',
|
|
10
11
|
UPDATE_PRESENTATION_OUTLINE: 'tools.presentation.update-presentation-outline.rpc',
|
|
11
12
|
LIST_PRESENTATIONS: 'tools.presentation.list-presentations.rpc',
|
|
12
13
|
DELETE_PRESENTATION: 'tools.presentation.delete-presentation.rpc',
|
|
@@ -14,6 +15,12 @@ exports.PRESENTATION_AMQP_ROUTES = {
|
|
|
14
15
|
EXPORT_AS_PPTX: 'tools.presentation.export-as-pptx.rpc',
|
|
15
16
|
UPDATE_PRESENTATION: 'tools.presentation.update-presentation.rpc',
|
|
16
17
|
DELETE_ALL_USER_PRESENTATIONS: 'tools.presentation.delete-all-user-presentations.rpc',
|
|
18
|
+
BUILD_BLANK_SLIDE: 'tools.presentation.build-blank-slide.rpc',
|
|
19
|
+
UPDATE_PRESENTATION_SLIDES: 'tools.presentation.update-presentation-slides.rpc',
|
|
20
|
+
UPDATE_SLIDE_IMAGE_SLOT: 'tools.presentation.update-slide-image-slot.rpc',
|
|
21
|
+
UPDATE_SLIDE: 'tools.presentation.update-slide.rpc',
|
|
22
|
+
PARAPHRASE: 'tools.presentation.actions.paraphrase.rpc',
|
|
23
|
+
GENERATE_REPORT: 'tools.presentation.actions.generate-report.rpc',
|
|
17
24
|
};
|
|
18
25
|
exports.PRESENTATION_SLIDE_OUTLINE_AMQP_ROUTES = {
|
|
19
26
|
REPOSITION: 'tools.presentation.slide-outline.reposition-slide-outline.rpc',
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculatePresentationAiActionPrice = calculatePresentationAiActionPrice;
|
|
4
|
+
const enums_1 = require("../enums");
|
|
5
|
+
function calculatePresentationAiActionPrice(pricingRules, selectionText) {
|
|
6
|
+
switch (pricingRules.type) {
|
|
7
|
+
case enums_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 enums_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
|
+
}
|