@purpleschool/gptbot 0.7.80 → 0.7.82
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/payment/pay.command.js +2 -0
- package/build/commands/subscription/downgrade-subscription.command.js +1 -28
- package/build/commands/subscription/get-subscriptions-summary.command.js +1 -1
- 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/cloud-payments/index.js +2 -1
- package/build/constants/errors/errors.js +21 -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/build/models/user-to-subscription.schema.js +4 -1
- package/commands/payment/pay.command.ts +2 -0
- package/commands/subscription/downgrade-subscription.command.ts +1 -31
- package/commands/subscription/get-subscriptions-summary.command.ts +2 -2
- 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/cloud-payments/index.ts +2 -0
- package/constants/errors/errors.ts +21 -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/models/user-to-subscription.schema.ts +7 -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`,
|
|
@@ -22,6 +22,7 @@ var PayCommand;
|
|
|
22
22
|
OperationType: zod_1.z.string(),
|
|
23
23
|
InvoiceId: zod_1.z.string().optional(),
|
|
24
24
|
AccountId: zod_1.z.string(),
|
|
25
|
+
Token: zod_1.z.string(),
|
|
25
26
|
})
|
|
26
27
|
.transform((data) => ({
|
|
27
28
|
transactionId: data.TransactionId,
|
|
@@ -40,6 +41,7 @@ var PayCommand;
|
|
|
40
41
|
operationType: data.OperationType,
|
|
41
42
|
invoiceId: data.InvoiceId,
|
|
42
43
|
accountId: data.AccountId,
|
|
44
|
+
token: data.Token,
|
|
43
45
|
}));
|
|
44
46
|
PayCommand.ResponseSchema = zod_1.z.object({
|
|
45
47
|
code: zod_1.z.number(),
|
|
@@ -11,34 +11,7 @@ var DowngradeSubscriptionCommand;
|
|
|
11
11
|
DowngradeSubscriptionCommand.RequestParamSchema = models_1.UserToSubscriptionSchema.pick({
|
|
12
12
|
uuid: true,
|
|
13
13
|
});
|
|
14
|
-
const IReceiptOrderSchema = zod_1.z.object({
|
|
15
|
-
items: zod_1.z.array(zod_1.z.object({
|
|
16
|
-
label: zod_1.z.string(),
|
|
17
|
-
price: zod_1.z.number(),
|
|
18
|
-
quantity: zod_1.z.number(),
|
|
19
|
-
amount: zod_1.z.number(),
|
|
20
|
-
vat: zod_1.z.number(),
|
|
21
|
-
})),
|
|
22
|
-
email: zod_1.z.string(),
|
|
23
|
-
isBso: zod_1.z.boolean(),
|
|
24
|
-
amounts: zod_1.z.object({
|
|
25
|
-
electronic: zod_1.z.number(),
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
28
14
|
DowngradeSubscriptionCommand.ResponseSchema = zod_1.z.object({
|
|
29
|
-
|
|
30
|
-
amount: zod_1.z.number(),
|
|
31
|
-
currency: zod_1.z.string(),
|
|
32
|
-
accountId: zod_1.z.string(),
|
|
33
|
-
description: zod_1.z.string(),
|
|
34
|
-
invoiceId: zod_1.z.string(),
|
|
35
|
-
email: zod_1.z.string(),
|
|
36
|
-
skin: zod_1.z.string(),
|
|
37
|
-
autoClose: zod_1.z.number(),
|
|
38
|
-
data: zod_1.z.object({
|
|
39
|
-
CloudPayments: zod_1.z.object({
|
|
40
|
-
CustomerReceipt: IReceiptOrderSchema,
|
|
41
|
-
}),
|
|
42
|
-
}),
|
|
15
|
+
isSuccess: zod_1.z.boolean(),
|
|
43
16
|
});
|
|
44
17
|
})(DowngradeSubscriptionCommand || (exports.DowngradeSubscriptionCommand = DowngradeSubscriptionCommand = {}));
|
|
@@ -7,7 +7,7 @@ var GetSubscriptionsSummaryCommand;
|
|
|
7
7
|
(function (GetSubscriptionsSummaryCommand) {
|
|
8
8
|
GetSubscriptionsSummaryCommand.ResponseSchema = zod_1.z.object({
|
|
9
9
|
features: zod_1.z.array(models_1.SubscriptionFeatureSchema),
|
|
10
|
-
subscriptions: zod_1.z.array(models_1.
|
|
10
|
+
subscriptions: zod_1.z.array(models_1.UserToSubscriptionWithDowngradeSubscriptionSchema),
|
|
11
11
|
products: zod_1.z.array(models_1.UserToProductWithProductSchema),
|
|
12
12
|
});
|
|
13
13
|
})(GetSubscriptionsSummaryCommand || (exports.GetSubscriptionsSummaryCommand = GetSubscriptionsSummaryCommand = {}));
|
|
@@ -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 = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CLOUD_PAYMENTS_GET_SUBSCRIPTION = exports.CLOUD_PAYMENTS_UPDATE = exports.CLOUD_PAYMENTS_CANCEL = exports.FORMATS = void 0;
|
|
3
|
+
exports.CLOUD_PAYMENTS_CREATE = exports.CLOUD_PAYMENTS_GET_SUBSCRIPTION = exports.CLOUD_PAYMENTS_UPDATE = exports.CLOUD_PAYMENTS_CANCEL = exports.FORMATS = void 0;
|
|
4
4
|
exports.FORMATS = {
|
|
5
5
|
UTF8: 'utf-8',
|
|
6
6
|
BASE64: 'base64',
|
|
@@ -9,3 +9,4 @@ exports.FORMATS = {
|
|
|
9
9
|
exports.CLOUD_PAYMENTS_CANCEL = 'https://api.cloudpayments.ru/subscriptions/cancel';
|
|
10
10
|
exports.CLOUD_PAYMENTS_UPDATE = 'https://api.cloudpayments.ru/subscriptions/update';
|
|
11
11
|
exports.CLOUD_PAYMENTS_GET_SUBSCRIPTION = 'https://api.cloudpayments.ru/subscriptions/get ';
|
|
12
|
+
exports.CLOUD_PAYMENTS_CREATE = 'https://api.cloudpayments.ru/subscriptions/create';
|
|
@@ -2286,9 +2286,29 @@ 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
|
},
|
|
2304
|
+
CREATE_CLOUD_PAYMENTS_SUBSCRIPTION: {
|
|
2305
|
+
code: 'A469',
|
|
2306
|
+
message: 'Не удалось создать подписку у cloud payments',
|
|
2307
|
+
httpCode: 500,
|
|
2308
|
+
},
|
|
2309
|
+
SUBSCRIPTION_ALREADY_DOWNGRADED_ERROR: {
|
|
2310
|
+
code: 'A470',
|
|
2311
|
+
message: 'Подписка уже была понижена и ожидает отключения',
|
|
2312
|
+
httpCode: 400,
|
|
2313
|
+
},
|
|
2294
2314
|
};
|
|
@@ -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
|
});
|