@purpleschool/gptbot 0.7.56 → 0.7.57-presentations

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.
Files changed (93) hide show
  1. package/api/controllers/http/presentation.ts +10 -0
  2. package/api/controllers/http/tool.ts +0 -1
  3. package/build/api/controllers/http/presentation.js +7 -0
  4. package/build/api/controllers/http/tool.js +0 -1
  5. package/build/commands/chat/check-limit.command.js +0 -1
  6. package/build/commands/chat/create-chat.command.js +1 -3
  7. package/build/commands/chat/find-chat-by-uuid.command.js +1 -1
  8. package/build/commands/chat/find-chats.command.js +1 -3
  9. package/build/commands/chat/get-last-active-chat-command.js +1 -1
  10. package/build/commands/folder/find-folder-by-uuid-with-chats.command.js +1 -3
  11. package/build/commands/tools/presentation/build-blank-slide.command.js +21 -0
  12. package/build/commands/tools/presentation/generate-and-insert-slide.command.js +22 -0
  13. package/build/commands/tools/presentation/index.js +7 -0
  14. package/build/commands/tools/presentation/presentation-generate-report.command.js +17 -0
  15. package/build/commands/tools/presentation/presentation-paraphrase.command.js +20 -0
  16. package/build/commands/tools/presentation/update-presentation-slides.command.js +25 -0
  17. package/build/commands/tools/presentation/update-presentation.command.js +4 -3
  18. package/build/commands/tools/presentation/update-slide-image-slot.command.js +34 -0
  19. package/build/commands/tools/presentation/update-slide.command.js +19 -0
  20. package/build/commands/tools/tool/index.js +0 -1
  21. package/build/constants/errors/errors.js +2 -7
  22. package/build/constants/presentation/enums/index.js +4 -0
  23. package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
  24. package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
  25. package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
  26. package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
  27. package/build/constants/subscription/enums/subscription-feature-type.enum.js +0 -3
  28. package/build/constants/transaction/enums/user-balance-status.enum.js +0 -1
  29. package/build/helpers/index.js +1 -0
  30. package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
  31. package/build/helpers/presentation/index.js +17 -0
  32. package/build/models/chat-with-messages.schema.js +9 -0
  33. package/build/models/chat.schema.js +0 -2
  34. package/build/models/index.js +1 -0
  35. package/build/models/page.schema.js +0 -2
  36. package/build/models/subscription-feature.schema.js +1 -26
  37. package/build/models/subscription.schema.js +0 -1
  38. package/build/models/tool.schema.js +1 -8
  39. package/build/models/tools/index.js +1 -0
  40. package/build/models/tools/presentation/index.js +1 -0
  41. package/build/models/tools/presentation/presentation-ai-action.schema.js +27 -0
  42. package/build/models/tools/presentation/presentation-config.schema.js +3 -0
  43. package/build/models/tools/presentation/presentation.schema.js +2 -0
  44. package/build/models/tools/presentation/slide-content-edit.schema.js +129 -0
  45. package/build/models/tools/presentation/slide-content.schema.js +22 -20
  46. package/build/models/tools/presentation/slide.schema.js +39 -1
  47. package/build/models/user-to-subscription.schema.js +0 -1
  48. package/commands/chat/check-limit.command.ts +0 -1
  49. package/commands/chat/create-chat.command.ts +2 -4
  50. package/commands/chat/find-chat-by-uuid.command.ts +2 -2
  51. package/commands/chat/find-chats.command.ts +2 -6
  52. package/commands/chat/get-last-active-chat-command.ts +2 -2
  53. package/commands/folder/find-folder-by-uuid-with-chats.command.ts +2 -6
  54. package/commands/tools/presentation/build-blank-slide.command.ts +23 -0
  55. package/commands/tools/presentation/generate-and-insert-slide.command.ts +27 -0
  56. package/commands/tools/presentation/index.ts +7 -0
  57. package/commands/tools/presentation/presentation-generate-report.command.ts +21 -0
  58. package/commands/tools/presentation/presentation-paraphrase.command.ts +26 -0
  59. package/commands/tools/presentation/update-presentation-slides.command.ts +32 -0
  60. package/commands/tools/presentation/update-presentation.command.ts +5 -4
  61. package/commands/tools/presentation/update-slide-image-slot.command.ts +40 -0
  62. package/commands/tools/presentation/update-slide.command.ts +25 -0
  63. package/commands/tools/tool/index.ts +0 -1
  64. package/constants/errors/errors.ts +2 -7
  65. package/constants/presentation/enums/index.ts +4 -0
  66. package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
  67. package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
  68. package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
  69. package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
  70. package/constants/subscription/enums/subscription-feature-type.enum.ts +0 -3
  71. package/constants/transaction/enums/user-balance-status.enum.ts +0 -1
  72. package/helpers/index.ts +1 -0
  73. package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
  74. package/helpers/presentation/index.ts +1 -0
  75. package/models/chat-with-messages.schema.ts +7 -0
  76. package/models/chat.schema.ts +0 -2
  77. package/models/index.ts +1 -0
  78. package/models/page.schema.ts +0 -2
  79. package/models/subscription-feature.schema.ts +0 -30
  80. package/models/subscription.schema.ts +0 -1
  81. package/models/tool.schema.ts +0 -13
  82. package/models/tools/index.ts +1 -0
  83. package/models/tools/presentation/index.ts +1 -0
  84. package/models/tools/presentation/presentation-ai-action.schema.ts +33 -0
  85. package/models/tools/presentation/presentation-config.schema.ts +3 -0
  86. package/models/tools/presentation/presentation.schema.ts +2 -0
  87. package/models/tools/presentation/slide-content-edit.schema.ts +154 -0
  88. package/models/tools/presentation/slide-content.schema.ts +119 -32
  89. package/models/tools/presentation/slide.schema.ts +47 -0
  90. package/models/user-to-subscription.schema.ts +0 -1
  91. package/package.json +1 -1
  92. package/build/commands/tools/tool/find-formatted-tools.command.js +0 -11
  93. package/commands/tools/tool/find-formatted-tools.command.ts +0 -11
@@ -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) =>
@@ -2,5 +2,4 @@ export const TOOL_CONTROLLER = 'tools';
2
2
 
3
3
  export const TOOL_ROUTES = {
4
4
  FIND_ALL: 'all',
5
- GET_FORMATTED: 'formatted',
6
5
  };
@@ -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`,
@@ -4,5 +4,4 @@ exports.TOOL_ROUTES = exports.TOOL_CONTROLLER = void 0;
4
4
  exports.TOOL_CONTROLLER = 'tools';
5
5
  exports.TOOL_ROUTES = {
6
6
  FIND_ALL: 'all',
7
- GET_FORMATTED: 'formatted',
8
7
  };
@@ -11,7 +11,6 @@ var CheckLimitCommand;
11
11
  subscriptionBalance: zod_1.z.number(),
12
12
  productBalance: zod_1.z.number(),
13
13
  referralBonusBalance: zod_1.z.number(),
14
- carriedOverBalance: zod_1.z.number(),
15
14
  }),
16
15
  });
17
16
  })(CheckLimitCommand || (exports.CheckLimitCommand = CheckLimitCommand = {}));
@@ -12,8 +12,6 @@ var CreateChatCommand;
12
12
  folderId: zod_1.z.string().uuid().optional(),
13
13
  });
14
14
  CreateChatCommand.ResponseSchema = zod_1.z.object({
15
- data: models_1.ChatSchema.extend({
16
- messages: zod_1.z.array(models_1.MessageSchema),
17
- }),
15
+ data: models_1.ChatWithMessagesSchema,
18
16
  });
19
17
  })(CreateChatCommand || (exports.CreateChatCommand = CreateChatCommand = {}));
@@ -9,6 +9,6 @@ var FindChatByUUIDCommand;
9
9
  uuid: true,
10
10
  });
11
11
  FindChatByUUIDCommand.ResponseSchema = zod_1.z.object({
12
- data: models_1.ChatSchema,
12
+ data: models_1.ChatWithMessagesSchema,
13
13
  });
14
14
  })(FindChatByUUIDCommand || (exports.FindChatByUUIDCommand = FindChatByUUIDCommand = {}));
@@ -13,9 +13,7 @@ var FindChatsCommand;
13
13
  const QuerySchema = zod_1.z.intersection(models_1.ChatSchema.pick({ categoryId: true, aIModelId: true }).partial(), models_1.AiModelSchema.pick({ contentType: true }).partial());
14
14
  FindChatsCommand.RequestQuerySchema = zod_1.z.intersection(QuerySchema, PaginationQuerySchema);
15
15
  FindChatsCommand.ResponseSchema = zod_1.z.object({
16
- data: zod_1.z.array(models_1.ChatSchema.extend({
17
- messages: zod_1.z.array(models_1.MessageSchema),
18
- })),
16
+ data: zod_1.z.array(models_1.ChatSchema),
19
17
  page: zod_1.z.number(),
20
18
  totalPages: zod_1.z.number(),
21
19
  });
@@ -10,6 +10,6 @@ var GetLastActiveChatCommand;
10
10
  aIModelId: true,
11
11
  });
12
12
  GetLastActiveChatCommand.Response = zod_1.z.object({
13
- data: models_1.ChatSchema,
13
+ data: models_1.ChatWithMessagesSchema,
14
14
  });
15
15
  })(GetLastActiveChatCommand || (exports.GetLastActiveChatCommand = GetLastActiveChatCommand = {}));
@@ -17,9 +17,7 @@ var FindFolderByUuidWithChatsCommand;
17
17
  });
18
18
  FindFolderByUuidWithChatsCommand.ResponseSchema = zod_1.default.object({
19
19
  data: models_1.FolderSchema.extend({
20
- chats: zod_1.default.array(models_1.ChatSchema.extend({
21
- messages: zod_1.default.array(models_1.MessageSchema),
22
- })),
20
+ chats: zod_1.default.array(models_1.ChatSchema),
23
21
  }),
24
22
  page: zod_1.default.number(),
25
23
  totalPages: zod_1.default.number(),
@@ -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().min(1).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 = zod_1.z.object({
12
- title: zod_1.z.string(),
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 = {}));
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./find-all-tools.command"), exports);
18
- __exportStar(require("./find-formatted-tools.command"), exports);
@@ -2006,14 +2006,9 @@ exports.ERRORS = {
2006
2006
  message: 'не удалось получить статистику пользователя',
2007
2007
  httpCode: 500,
2008
2008
  },
2009
- TOOL_GET_FORMATTED_ERROR: {
2009
+ SLIDE_IMAGE_SLOT_UPDATE_ERROR: {
2010
2010
  code: 'A412',
2011
- message: 'Ошибка при получении отформатированных тулов',
2012
- httpCode: 500,
2013
- },
2014
- TOOL_FIND_ALL_ERROR: {
2015
- code: 'A413',
2016
- message: 'Ошибка при получении всех тулов',
2011
+ message: 'Произошла ошибка при обновлении изображения на слайде',
2017
2012
  httpCode: 500,
2018
2013
  },
2019
2014
  };
@@ -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 = {}));
@@ -18,8 +18,6 @@ var SUBSCRIPTION_FEATURE_TYPE;
18
18
  SUBSCRIPTION_FEATURE_TYPE["VIDEO_MODEL_ACCESS"] = "video_model_access";
19
19
  SUBSCRIPTION_FEATURE_TYPE["EXTENDED_CONTEXT"] = "extended_context";
20
20
  SUBSCRIPTION_FEATURE_TYPE["PRESENTATION_QUOTA"] = "presentation_quota";
21
- SUBSCRIPTION_FEATURE_TYPE["TOKENS"] = "tokens";
22
- SUBSCRIPTION_FEATURE_TYPE["CARRYOVER_BALANCE"] = "carryover_balance";
23
21
  })(SUBSCRIPTION_FEATURE_TYPE || (exports.SUBSCRIPTION_FEATURE_TYPE = SUBSCRIPTION_FEATURE_TYPE = {}));
24
22
  var SUBSCRIPTION_FEATURE_KIND;
25
23
  (function (SUBSCRIPTION_FEATURE_KIND) {
@@ -31,5 +29,4 @@ var SUBSCRIPTION_FEATURE_KIND;
31
29
  SUBSCRIPTION_FEATURE_KIND["PRESENTATIONS"] = "presentations";
32
30
  SUBSCRIPTION_FEATURE_KIND["VIDEO"] = "video";
33
31
  SUBSCRIPTION_FEATURE_KIND["PRESENTATION"] = "presentation";
34
- SUBSCRIPTION_FEATURE_KIND["BASE"] = "base";
35
32
  })(SUBSCRIPTION_FEATURE_KIND || (exports.SUBSCRIPTION_FEATURE_KIND = SUBSCRIPTION_FEATURE_KIND = {}));
@@ -5,7 +5,6 @@ var USER_BALANCE_STATUS;
5
5
  (function (USER_BALANCE_STATUS) {
6
6
  USER_BALANCE_STATUS["bonus_balance"] = "bonus_balance";
7
7
  USER_BALANCE_STATUS["subscription_balance"] = "subscription_balance";
8
- USER_BALANCE_STATUS["carried_over_balance"] = "carried_over_balance";
9
8
  USER_BALANCE_STATUS["product_balance"] = "product_balance";
10
9
  USER_BALANCE_STATUS["referral_bonus_balance"] = "referral_bonus_balance";
11
10
  })(USER_BALANCE_STATUS || (exports.USER_BALANCE_STATUS = USER_BALANCE_STATUS = {}));
@@ -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);
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatWithMessagesSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const chat_schema_1 = require("./chat.schema");
6
+ const message_schema_1 = require("./message.schema");
7
+ exports.ChatWithMessagesSchema = chat_schema_1.ChatSchema.extend({
8
+ messages: zod_1.z.array(message_schema_1.MessageSchema),
9
+ });
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ChatSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../constants");
6
- const message_schema_1 = require("./message.schema");
7
6
  exports.ChatSchema = zod_1.z.object({
8
7
  uuid: zod_1.z.string().uuid(),
9
8
  userId: zod_1.z.nullable(zod_1.z.string().uuid()),
@@ -12,7 +11,6 @@ exports.ChatSchema = zod_1.z.object({
12
11
  aIModelId: zod_1.z.string().uuid(),
13
12
  title: zod_1.z.string(),
14
13
  chatStatus: zod_1.z.enum(Object.values(constants_1.CHAT_STATUS_ENUM)),
15
- messages: zod_1.z.array(message_schema_1.MessageSchema),
16
14
  folderId: zod_1.z.string().nullable(),
17
15
  createdAt: zod_1.z.date(),
18
16
  updatedAt: zod_1.z.date(),
@@ -20,6 +20,7 @@ __exportStar(require("./ai-model-formatted.schema"), exports);
20
20
  __exportStar(require("./ai-model.schema"), exports);
21
21
  __exportStar(require("./ai-vendor.schema"), exports);
22
22
  __exportStar(require("./category.schema"), exports);
23
+ __exportStar(require("./chat-with-messages.schema"), exports);
23
24
  __exportStar(require("./chat.schema"), exports);
24
25
  __exportStar(require("./cloud-payments-receipt.schema"), exports);
25
26
  __exportStar(require("./course-author.schema"), exports);
@@ -14,8 +14,6 @@ exports.PageSchema = zod_1.z.object({
14
14
  categoryId: zod_1.z.string().uuid().nullable().optional(),
15
15
  aIModelId: zod_1.z.string().uuid().nullable().optional(),
16
16
  toolId: zod_1.z.string().uuid().nullable().optional(),
17
- toolOptionId: zod_1.z.string().uuid().nullable().optional(),
18
- toolTitle: zod_1.z.string().nullable(),
19
17
  type: zod_1.z.nativeEnum(constants_1.PageType),
20
18
  createdAt: zod_1.z.date(),
21
19
  updatedAt: zod_1.z.date(),
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubscriptionFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.CarryoverBalanceFeatureSchema = exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
3
+ exports.SubscriptionFeatureSchema = exports.PresentationQuotaFeatureSchema = exports.VideoModelAccessFeatureSchema = exports.VideoQuotaFeatureSchema = exports.STTQuotaFeatureSchema = exports.STTModelAccessFeatureSchema = exports.TTSQuotaFeatureSchema = exports.ImageGenerationQuotaFeatureSchema = exports.TtsModelAccessFeatureSchema = exports.AdvancedToolsAccessFeatureSchema = exports.WebSearchFeatureSchema = exports.ExtendedContextFeatureSchema = exports.MaxInputLengthFeatureSchema = exports.RequestsQuotaFeatureSchema = exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema = void 0;
4
4
  const constants_1 = require("../constants");
5
5
  const zod_1 = require("zod");
6
6
  exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
@@ -8,29 +8,6 @@ exports.SubscriptionFeatureBaseSchema = zod_1.z.object({
8
8
  type: zod_1.z.nativeEnum(constants_1.SUBSCRIPTION_FEATURE_TYPE),
9
9
  title: zod_1.z.string(),
10
10
  });
11
- const SubscriptionFeatureIconsSchema = zod_1.z.object({
12
- light: zod_1.z.object({
13
- png: zod_1.z.string(),
14
- svg: zod_1.z.string(),
15
- }),
16
- dark: zod_1.z.object({
17
- png: zod_1.z.string(),
18
- svg: zod_1.z.string(),
19
- }),
20
- });
21
- exports.TokensFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
22
- kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.BASE),
23
- type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.TOKENS),
24
- tokens: zod_1.z.number(),
25
- icons: SubscriptionFeatureIconsSchema,
26
- });
27
- exports.CarryoverBalanceFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
28
- kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.BASE),
29
- type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.CARRYOVER_BALANCE),
30
- isAvailable: zod_1.z.boolean(),
31
- tooltip: zod_1.z.string(),
32
- icons: SubscriptionFeatureIconsSchema,
33
- });
34
11
  exports.AiModelAccessFeatureSchema = exports.SubscriptionFeatureBaseSchema.extend({
35
12
  type: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_TYPE.AI_MODEL_ACCESS),
36
13
  kind: zod_1.z.literal(constants_1.SUBSCRIPTION_FEATURE_KIND.AI_MODEL),
@@ -125,6 +102,4 @@ exports.SubscriptionFeatureSchema = zod_1.z.union([
125
102
  exports.VideoModelAccessFeatureSchema,
126
103
  exports.ExtendedContextFeatureSchema,
127
104
  exports.PresentationQuotaFeatureSchema,
128
- exports.TokensFeatureSchema,
129
- exports.CarryoverBalanceFeatureSchema,
130
105
  ]);
@@ -30,7 +30,6 @@ exports.SubscriptionSchema = zod_1.z.object({
30
30
  features: zod_1.z.array(subscription_feature_schema_1.SubscriptionFeatureSchema),
31
31
  maxInputLength: zod_1.z.number(),
32
32
  maxInputTokens: zod_1.z.number(),
33
- carryoverPercent: zod_1.z.number(),
34
33
  createdAt: zod_1.z.date(),
35
34
  updatedAt: zod_1.z.date(),
36
35
  });
@@ -1,18 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToolFormattedSchema = exports.ToolSchema = void 0;
3
+ exports.ToolSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const page_schema_1 = require("./page.schema");
6
5
  exports.ToolSchema = zod_1.z.object({
7
6
  uuid: zod_1.z.string().uuid(),
8
7
  title: zod_1.z.string(),
9
8
  description: zod_1.z.string(),
10
9
  icon: zod_1.z.string(),
11
10
  order: zod_1.z.number(),
12
- contentType: zod_1.z.string(),
13
11
  });
14
- exports.ToolFormattedSchema = zod_1.z.intersection(exports.ToolSchema, zod_1.z.object({
15
- pages: zod_1.z.array(page_schema_1.PageSchema.pick({ alias: true, toolTitle: true, toolOptionId: true })
16
- .optional()
17
- .nullable()),
18
- }));
@@ -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
+ });