@purpleschool/gptbot 0.7.78 → 0.7.79
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 +0 -10
- package/build/api/controllers/http/presentation.js +0 -7
- package/build/commands/auth/register-user.command.js +18 -1
- package/build/commands/auth/vk-login.command.js +18 -1
- package/build/commands/auth/yandex-login.command.js +18 -1
- package/build/commands/product/buy-product.command.js +25 -1
- package/build/commands/subscription/buy-subscription.command.js +25 -1
- package/build/commands/telegram-auth/create-telegram-auth-link.command.js +19 -1
- package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +7 -0
- package/build/commands/tools/presentation/index.js +0 -7
- package/build/commands/tools/presentation/update-presentation.command.js +3 -4
- package/build/constants/errors/errors.js +6 -9
- package/build/constants/presentation/enums/index.js +0 -4
- package/build/constants/webmaster/enums/organization-type.enum.js +0 -1
- package/build/helpers/index.js +0 -1
- package/build/models/tools/index.js +0 -1
- package/build/models/tools/presentation/index.js +0 -1
- package/build/models/tools/presentation/presentation-config.schema.js +0 -3
- package/build/models/tools/presentation/presentation.schema.js +0 -2
- package/build/models/tools/presentation/slide-content.schema.js +20 -22
- package/build/models/tools/presentation/slide.schema.js +1 -39
- package/build/models/user-referrals.schema.js +6 -0
- package/commands/auth/register-user.command.ts +23 -1
- package/commands/auth/vk-login.command.ts +23 -1
- package/commands/auth/yandex-login.command.ts +23 -1
- package/commands/product/buy-product.command.ts +38 -9
- package/commands/subscription/buy-subscription.command.ts +38 -9
- package/commands/telegram-auth/create-telegram-auth-link.command.ts +24 -1
- package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +7 -0
- package/commands/tools/presentation/index.ts +0 -7
- package/commands/tools/presentation/update-presentation.command.ts +4 -5
- package/constants/errors/errors.ts +6 -9
- package/constants/presentation/enums/index.ts +0 -4
- package/constants/webmaster/enums/organization-type.enum.ts +0 -1
- package/helpers/index.ts +0 -1
- package/models/tools/index.ts +0 -1
- package/models/tools/presentation/index.ts +0 -1
- package/models/tools/presentation/presentation-config.schema.ts +0 -3
- package/models/tools/presentation/presentation.schema.ts +0 -2
- package/models/tools/presentation/slide-content.schema.ts +32 -119
- package/models/tools/presentation/slide.schema.ts +0 -47
- package/models/user-referrals.schema.ts +6 -0
- package/package.json +1 -1
- package/build/commands/tools/presentation/build-blank-slide.command.js +0 -21
- package/build/commands/tools/presentation/generate-and-insert-slide.command.js +0 -22
- package/build/commands/tools/presentation/presentation-generate-report.command.js +0 -17
- package/build/commands/tools/presentation/presentation-paraphrase.command.js +0 -20
- package/build/commands/tools/presentation/update-presentation-slides.command.js +0 -25
- package/build/commands/tools/presentation/update-slide-image-slot.command.js +0 -34
- package/build/commands/tools/presentation/update-slide.command.js +0 -19
- package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +0 -9
- package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +0 -8
- package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +0 -8
- package/build/constants/presentation/enums/slide-image-slot-action.enum.js +0 -8
- package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +0 -16
- package/build/helpers/presentation/index.js +0 -17
- package/build/models/tools/presentation/presentation-ai-action.schema.js +0 -27
- package/build/models/tools/presentation/slide-content-edit.schema.js +0 -129
- package/commands/tools/presentation/build-blank-slide.command.ts +0 -23
- package/commands/tools/presentation/generate-and-insert-slide.command.ts +0 -27
- package/commands/tools/presentation/presentation-generate-report.command.ts +0 -21
- package/commands/tools/presentation/presentation-paraphrase.command.ts +0 -26
- package/commands/tools/presentation/update-presentation-slides.command.ts +0 -32
- package/commands/tools/presentation/update-slide-image-slot.command.ts +0 -40
- package/commands/tools/presentation/update-slide.command.ts +0 -25
- package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +0 -5
- package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +0 -4
- package/constants/presentation/enums/presentation-ai-action-type.enum.ts +0 -4
- package/constants/presentation/enums/slide-image-slot-action.enum.ts +0 -4
- package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +0 -20
- package/helpers/presentation/index.ts +0 -1
- package/models/tools/presentation/presentation-ai-action.schema.ts +0 -33
- package/models/tools/presentation/slide-content-edit.schema.ts +0 -154
|
@@ -1,22 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,20 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,25 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,34 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,19 +0,0 @@
|
|
|
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,9 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
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 = {}));
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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);
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,129 +0,0 @@
|
|
|
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
|
-
]);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export namespace BuildBlankSlideCommand {
|
|
4
|
-
export const RequestSchema = z.object({
|
|
5
|
-
slideContentType: z.string(),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
-
|
|
10
|
-
export const ResponseSchema = z.object({
|
|
11
|
-
data: z.object({
|
|
12
|
-
uuid: z.string().uuid(),
|
|
13
|
-
order: z.number(),
|
|
14
|
-
contentTypeId: z.string(),
|
|
15
|
-
layoutId: z.string(),
|
|
16
|
-
content: z.record(z.any()),
|
|
17
|
-
createdAt: z.date(),
|
|
18
|
-
updatedAt: z.date(),
|
|
19
|
-
}),
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
23
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { SlideSchema } from '../../../models/tools/presentation';
|
|
3
|
-
import { SLIDE_CONTENT_TYPE, SLIDE_LAYOUT } from '../../../constants';
|
|
4
|
-
|
|
5
|
-
export namespace GenerateAndInsertSlideCommand {
|
|
6
|
-
export const RequestSchema = z.object({
|
|
7
|
-
contentTypeId: z.nativeEnum(SLIDE_CONTENT_TYPE),
|
|
8
|
-
prompt: z.string().max(10000).optional(),
|
|
9
|
-
title: z.string().min(1).max(80),
|
|
10
|
-
position: z.number().min(0),
|
|
11
|
-
layoutId: z.nativeEnum(SLIDE_LAYOUT).optional(),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
-
|
|
16
|
-
export const RequestParamsSchema = z.object({
|
|
17
|
-
uuid: z.string().uuid(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
21
|
-
|
|
22
|
-
export const ResponseSchema = z.object({
|
|
23
|
-
data: z.array(SlideSchema),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export namespace PresentationGenerateReportCommand {
|
|
4
|
-
export const RequestParamsSchema = z.object({
|
|
5
|
-
presentationId: z.string(),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const RequestSchema = RequestParamsSchema;
|
|
9
|
-
|
|
10
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
11
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
-
|
|
13
|
-
export const ResponseSchema = z.object({
|
|
14
|
-
data: z.object({
|
|
15
|
-
output: z.string(),
|
|
16
|
-
docxUrl: z.string(),
|
|
17
|
-
}),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export namespace PresentationParaphraseCommand {
|
|
4
|
-
export const RequestParamsSchema = z.object({
|
|
5
|
-
presentationId: z.string(),
|
|
6
|
-
slideId: z.string(),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export const RequestBodySchema = z.object({
|
|
10
|
-
selectionText: z.string().max(10000),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const RequestSchema = RequestParamsSchema.merge(RequestBodySchema);
|
|
14
|
-
|
|
15
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
16
|
-
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
17
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
-
|
|
19
|
-
export const ResponseSchema = z.object({
|
|
20
|
-
data: z.object({
|
|
21
|
-
output: z.string(),
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { SlideBulkUpdateSchema } from '../../../models/tools/presentation';
|
|
3
|
-
|
|
4
|
-
export namespace UpdatePresentationSlidesCommand {
|
|
5
|
-
export const RequestSchema = z.object({
|
|
6
|
-
data: SlideBulkUpdateSchema,
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
-
|
|
11
|
-
export const RequestParamsSchema = z.object({
|
|
12
|
-
uuid: z.string().uuid(),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
16
|
-
|
|
17
|
-
export const ResponseSchema = z.object({
|
|
18
|
-
data: z.array(
|
|
19
|
-
z.object({
|
|
20
|
-
uuid: z.string().uuid(),
|
|
21
|
-
order: z.number(),
|
|
22
|
-
contentTypeId: z.string(),
|
|
23
|
-
layoutId: z.string(),
|
|
24
|
-
content: z.record(z.any()),
|
|
25
|
-
createdAt: z.date(),
|
|
26
|
-
updatedAt: z.date(),
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
32
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { SLIDE_IMAGE_SLOT_ACTION } from '../../../constants';
|
|
3
|
-
import { SlideImageSlotSchema } from '../../../models/tools/presentation/slide-image-slot.schema';
|
|
4
|
-
|
|
5
|
-
export namespace UpdateSlideImageSlotCommand {
|
|
6
|
-
const ReplacePayload = z.object({
|
|
7
|
-
action: z.literal(SLIDE_IMAGE_SLOT_ACTION.REPLACE),
|
|
8
|
-
fileId: z.string().uuid(),
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
const GeneratePayload = z.object({
|
|
12
|
-
action: z.literal(SLIDE_IMAGE_SLOT_ACTION.GENERATE),
|
|
13
|
-
prompt: z.string().min(1).max(1000).optional(),
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const UpdateImageSlotPayloadSchema = z.discriminatedUnion('action', [
|
|
17
|
-
ReplacePayload,
|
|
18
|
-
GeneratePayload,
|
|
19
|
-
]);
|
|
20
|
-
export type UpdateImageSlotPayload = z.infer<typeof UpdateImageSlotPayloadSchema>;
|
|
21
|
-
|
|
22
|
-
export const RequestSchema = z.object({
|
|
23
|
-
payload: UpdateImageSlotPayloadSchema,
|
|
24
|
-
});
|
|
25
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
26
|
-
|
|
27
|
-
export const RequestParamsSchema = z.object({
|
|
28
|
-
presentationId: z.string().uuid(),
|
|
29
|
-
slideId: z.string().uuid(),
|
|
30
|
-
slotId: z.string().uuid().optional(),
|
|
31
|
-
});
|
|
32
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
33
|
-
|
|
34
|
-
export const ResponseSchema = z.object({
|
|
35
|
-
data: z.object({
|
|
36
|
-
imageSlot: SlideImageSlotSchema,
|
|
37
|
-
}),
|
|
38
|
-
});
|
|
39
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
40
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { SlideSchema, SlideUpdateSchema } from '../../../models/tools/presentation';
|
|
3
|
-
|
|
4
|
-
export namespace UpdateSlideCommand {
|
|
5
|
-
export const RequestParamsSchema = z.object({
|
|
6
|
-
presentationId: z.string(),
|
|
7
|
-
slideId: z.string(),
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const RequestBodySchema = z.object({
|
|
11
|
-
data: SlideUpdateSchema,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export const RequestSchema = RequestParamsSchema.merge(RequestBodySchema);
|
|
15
|
-
|
|
16
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
17
|
-
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
18
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
-
|
|
20
|
-
export const ResponseSchema = z.object({
|
|
21
|
-
data: SlideSchema,
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PRESENTATION_AI_ACTION_PRICING_TYPE } from '../../constants';
|
|
2
|
-
import { PresentationAiActionPricingRules } from '../../models/tools/presentation';
|
|
3
|
-
|
|
4
|
-
export function calculatePresentationAiActionPrice(
|
|
5
|
-
pricingRules: PresentationAiActionPricingRules,
|
|
6
|
-
selectionText: string,
|
|
7
|
-
): number {
|
|
8
|
-
switch (pricingRules.type) {
|
|
9
|
-
case PRESENTATION_AI_ACTION_PRICING_TYPE.PER_CHARACTER:
|
|
10
|
-
const characterCount = selectionText.length;
|
|
11
|
-
const price = characterCount * pricingRules.price;
|
|
12
|
-
return Math.max(1, Math.ceil(price));
|
|
13
|
-
|
|
14
|
-
case PRESENTATION_AI_ACTION_PRICING_TYPE.FLAT:
|
|
15
|
-
return Math.max(1, Math.ceil(pricingRules.price));
|
|
16
|
-
|
|
17
|
-
default:
|
|
18
|
-
throw new Error(`Unknown pricing type`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './calculate-presentation-ai-action-price.util';
|