@purpleschool/student-works 1.2.2 → 1.3.1

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 (121) hide show
  1. package/api/controller/http/index.ts +1 -0
  2. package/api/controller/http/presentation.ts +37 -0
  3. package/api/routes.ts +90 -0
  4. package/build/api/controller/http/index.js +1 -0
  5. package/build/api/controller/http/presentation.js +33 -0
  6. package/build/api/routes.js +52 -0
  7. package/build/commands/index.js +1 -0
  8. package/build/commands/presentation/build-blank-slide.command.js +16 -0
  9. package/build/commands/presentation/create-presentation.command.js +17 -0
  10. package/build/commands/presentation/delete-all-user-presentations.command.js +9 -0
  11. package/build/commands/presentation/delete-presentation.command.js +11 -0
  12. package/build/commands/presentation/delete-slide-outline.command.js +12 -0
  13. package/build/commands/presentation/export-presentation-as-pptx.command.js +17 -0
  14. package/build/commands/presentation/find-presentation-by-uuid.command.js +14 -0
  15. package/build/commands/presentation/find-presentation-outline.command.js +14 -0
  16. package/build/commands/presentation/find-presentations.command.js +18 -0
  17. package/build/commands/presentation/generate-and-insert-slide.command.js +22 -0
  18. package/build/commands/presentation/generate-presentation-slides.command.js +14 -0
  19. package/build/commands/presentation/get-presentation-config.command.js +11 -0
  20. package/build/commands/presentation/index.js +39 -0
  21. package/build/commands/presentation/presentation-generate-report.command.js +17 -0
  22. package/build/commands/presentation/presentation-paraphrase.command.js +20 -0
  23. package/build/commands/presentation/reposition-slide-outline.command.js +15 -0
  24. package/build/commands/presentation/set-reaction-to-presentation.command.js +28 -0
  25. package/build/commands/presentation/update-presentation-outline.command.js +15 -0
  26. package/build/commands/presentation/update-presentation-slides.command.js +25 -0
  27. package/build/commands/presentation/update-presentation.command.js +18 -0
  28. package/build/commands/presentation/update-slide-image-slot.command.js +34 -0
  29. package/build/commands/presentation/update-slide-outline.command.js +23 -0
  30. package/build/commands/presentation/update-slide.command.js +19 -0
  31. package/build/constants/errors/errors.js +236 -0
  32. package/build/constants/index.js +1 -0
  33. package/build/constants/presentation/enums/index.js +26 -0
  34. package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
  35. package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
  36. package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
  37. package/build/constants/presentation/enums/presentation-stage.enum.js +14 -0
  38. package/build/constants/presentation/enums/slide-content-type.enum.js +16 -0
  39. package/build/constants/presentation/enums/slide-icon-slot-status.enum.js +10 -0
  40. package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
  41. package/build/constants/presentation/enums/slide-image-slot.status.enum.js +10 -0
  42. package/build/constants/presentation/enums/slide-layout.enum.js +8 -0
  43. package/build/constants/presentation/index.js +18 -0
  44. package/build/constants/presentation/maps/index.js +17 -0
  45. package/build/constants/presentation/maps/slide-layout-map.constant.js +17 -0
  46. package/build/helpers/index.js +1 -0
  47. package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
  48. package/build/helpers/presentation/index.js +17 -0
  49. package/build/models/index.js +1 -0
  50. package/build/models/language.schema.js +11 -0
  51. package/build/models/presentation/index.js +24 -0
  52. package/build/models/presentation/pptx-export-payload.schema.js +216 -0
  53. package/build/models/presentation/presentation-ai-action.schema.js +27 -0
  54. package/build/models/presentation/presentation-config.schema.js +21 -0
  55. package/build/models/presentation/presentation-template.schema.js +13 -0
  56. package/build/models/presentation/presentation.schema.js +28 -0
  57. package/build/models/presentation/slide-content-edit.schema.js +146 -0
  58. package/build/models/presentation/slide-content-type.schema.js +14 -0
  59. package/build/models/presentation/slide-content.schema.js +358 -0
  60. package/build/models/presentation/slide-icon-slot.schema.js +15 -0
  61. package/build/models/presentation/slide-image-slot.schema.js +16 -0
  62. package/build/models/presentation/slide-outline.schema.js +50 -0
  63. package/build/models/presentation/slide.schema.js +58 -0
  64. package/commands/index.ts +1 -0
  65. package/commands/presentation/build-blank-slide.command.ts +18 -0
  66. package/commands/presentation/create-presentation.command.ts +19 -0
  67. package/commands/presentation/delete-all-user-presentations.command.ts +9 -0
  68. package/commands/presentation/delete-presentation.command.ts +13 -0
  69. package/commands/presentation/delete-slide-outline.command.ts +12 -0
  70. package/commands/presentation/export-presentation-as-pptx.command.ts +20 -0
  71. package/commands/presentation/find-presentation-by-uuid.command.ts +16 -0
  72. package/commands/presentation/find-presentation-outline.command.ts +16 -0
  73. package/commands/presentation/find-presentations.command.ts +18 -0
  74. package/commands/presentation/generate-and-insert-slide.command.ts +27 -0
  75. package/commands/presentation/generate-presentation-slides.command.ts +16 -0
  76. package/commands/presentation/get-presentation-config.command.ts +10 -0
  77. package/commands/presentation/index.ts +23 -0
  78. package/commands/presentation/presentation-generate-report.command.ts +21 -0
  79. package/commands/presentation/presentation-paraphrase.command.ts +26 -0
  80. package/commands/presentation/reposition-slide-outline.command.ts +17 -0
  81. package/commands/presentation/set-reaction-to-presentation.command.ts +33 -0
  82. package/commands/presentation/update-presentation-outline.command.ts +18 -0
  83. package/commands/presentation/update-presentation-slides.command.ts +32 -0
  84. package/commands/presentation/update-presentation.command.ts +21 -0
  85. package/commands/presentation/update-slide-image-slot.command.ts +40 -0
  86. package/commands/presentation/update-slide-outline.command.ts +26 -0
  87. package/commands/presentation/update-slide.command.ts +25 -0
  88. package/constants/errors/errors.ts +236 -0
  89. package/constants/index.ts +1 -0
  90. package/constants/presentation/enums/index.ts +10 -0
  91. package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
  92. package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
  93. package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
  94. package/constants/presentation/enums/presentation-stage.enum.ts +13 -0
  95. package/constants/presentation/enums/slide-content-type.enum.ts +12 -0
  96. package/constants/presentation/enums/slide-icon-slot-status.enum.ts +6 -0
  97. package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
  98. package/constants/presentation/enums/slide-image-slot.status.enum.ts +6 -0
  99. package/constants/presentation/enums/slide-layout.enum.ts +4 -0
  100. package/constants/presentation/index.ts +2 -0
  101. package/constants/presentation/maps/index.ts +1 -0
  102. package/constants/presentation/maps/slide-layout-map.constant.ts +15 -0
  103. package/helpers/index.ts +1 -0
  104. package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
  105. package/helpers/presentation/index.ts +1 -0
  106. package/models/index.ts +1 -0
  107. package/models/language.schema.ts +9 -0
  108. package/models/presentation/index.ts +8 -0
  109. package/models/presentation/pptx-export-payload.schema.ts +246 -0
  110. package/models/presentation/presentation-ai-action.schema.ts +30 -0
  111. package/models/presentation/presentation-config.schema.ts +20 -0
  112. package/models/presentation/presentation-template.schema.ts +11 -0
  113. package/models/presentation/presentation.schema.ts +29 -0
  114. package/models/presentation/slide-content-edit.schema.ts +175 -0
  115. package/models/presentation/slide-content-type.schema.ts +13 -0
  116. package/models/presentation/slide-content.schema.ts +571 -0
  117. package/models/presentation/slide-icon-slot.schema.ts +13 -0
  118. package/models/presentation/slide-image-slot.schema.ts +14 -0
  119. package/models/presentation/slide-outline.schema.ts +58 -0
  120. package/models/presentation/slide.schema.ts +66 -0
  121. package/package.json +2 -2
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PPTXExportPayloadSchema = exports.PPTXSlideSchema = exports.SlideBackground = exports.PPTXShapeSchema = exports.PPTXChevronShapeSchema = exports.PPTXTableShapeSchema = exports.PPTXTableRowSchema = exports.PPTXTableCellSchema = exports.PPTXCustomShapeSchema = exports.PPTXPictureBoxSchema = exports.PPTXTextBoxSchema = exports.PPTXParagraphSchema = exports.PPTXFontSchema = exports.PPTXPositionSchema = exports.PPTXMarginSchema = exports.PPTXFillSchema = exports.PPTXShadowSchema = exports.PPTX_CUSTOM_SHAPE_TYPE = exports.PPTX_SHADOW_TYPE = exports.PPTX_FILL_TYPE = exports.PPTX_BORDER_TYPE = exports.PPTX_OBJECT_FIT = exports.PPTX_V_ALIGN = exports.PPTX_H_ALIGN = exports.PPTX_ARROW_TYPE = exports.PPTX_CHEVRON_DIRECTION = exports.PPTX_SHAPE_TYPE = void 0;
4
+ const zod_1 = require("zod");
5
+ var PPTX_SHAPE_TYPE;
6
+ (function (PPTX_SHAPE_TYPE) {
7
+ PPTX_SHAPE_TYPE["TEXT_BOX"] = "text_box";
8
+ PPTX_SHAPE_TYPE["PICTURE_BOX"] = "picture_box";
9
+ PPTX_SHAPE_TYPE["CUSTOM_SHAPE"] = "custom_shape";
10
+ PPTX_SHAPE_TYPE["TABLE"] = "table";
11
+ PPTX_SHAPE_TYPE["CHEVRON"] = "chevron";
12
+ })(PPTX_SHAPE_TYPE || (exports.PPTX_SHAPE_TYPE = PPTX_SHAPE_TYPE = {}));
13
+ var PPTX_CHEVRON_DIRECTION;
14
+ (function (PPTX_CHEVRON_DIRECTION) {
15
+ PPTX_CHEVRON_DIRECTION["RIGHT"] = "right";
16
+ PPTX_CHEVRON_DIRECTION["LEFT"] = "left";
17
+ PPTX_CHEVRON_DIRECTION["UP"] = "up";
18
+ PPTX_CHEVRON_DIRECTION["DOWN"] = "down";
19
+ })(PPTX_CHEVRON_DIRECTION || (exports.PPTX_CHEVRON_DIRECTION = PPTX_CHEVRON_DIRECTION = {}));
20
+ var PPTX_ARROW_TYPE;
21
+ (function (PPTX_ARROW_TYPE) {
22
+ PPTX_ARROW_TYPE["RIGHT"] = "rightArrow";
23
+ PPTX_ARROW_TYPE["LEFT"] = "leftArrow";
24
+ PPTX_ARROW_TYPE["UP"] = "upArrow";
25
+ PPTX_ARROW_TYPE["DOWN"] = "downArrow";
26
+ })(PPTX_ARROW_TYPE || (exports.PPTX_ARROW_TYPE = PPTX_ARROW_TYPE = {}));
27
+ var PPTX_H_ALIGN;
28
+ (function (PPTX_H_ALIGN) {
29
+ PPTX_H_ALIGN["LEFT"] = "left";
30
+ PPTX_H_ALIGN["CENTER"] = "center";
31
+ PPTX_H_ALIGN["RIGHT"] = "right";
32
+ PPTX_H_ALIGN["JUSTIFY"] = "justify";
33
+ })(PPTX_H_ALIGN || (exports.PPTX_H_ALIGN = PPTX_H_ALIGN = {}));
34
+ var PPTX_V_ALIGN;
35
+ (function (PPTX_V_ALIGN) {
36
+ PPTX_V_ALIGN["TOP"] = "top";
37
+ PPTX_V_ALIGN["MIDDLE"] = "middle";
38
+ PPTX_V_ALIGN["BOTTOM"] = "bottom";
39
+ })(PPTX_V_ALIGN || (exports.PPTX_V_ALIGN = PPTX_V_ALIGN = {}));
40
+ var PPTX_OBJECT_FIT;
41
+ (function (PPTX_OBJECT_FIT) {
42
+ PPTX_OBJECT_FIT["COVER"] = "cover";
43
+ PPTX_OBJECT_FIT["CONTAIN"] = "contain";
44
+ PPTX_OBJECT_FIT["CROP"] = "crop";
45
+ })(PPTX_OBJECT_FIT || (exports.PPTX_OBJECT_FIT = PPTX_OBJECT_FIT = {}));
46
+ var PPTX_BORDER_TYPE;
47
+ (function (PPTX_BORDER_TYPE) {
48
+ PPTX_BORDER_TYPE["SOLID"] = "solid";
49
+ PPTX_BORDER_TYPE["NONE"] = "none";
50
+ PPTX_BORDER_TYPE["DASH"] = "dash";
51
+ })(PPTX_BORDER_TYPE || (exports.PPTX_BORDER_TYPE = PPTX_BORDER_TYPE = {}));
52
+ var PPTX_FILL_TYPE;
53
+ (function (PPTX_FILL_TYPE) {
54
+ PPTX_FILL_TYPE["SOLID"] = "solid";
55
+ PPTX_FILL_TYPE["NONE"] = "none";
56
+ })(PPTX_FILL_TYPE || (exports.PPTX_FILL_TYPE = PPTX_FILL_TYPE = {}));
57
+ var PPTX_SHADOW_TYPE;
58
+ (function (PPTX_SHADOW_TYPE) {
59
+ PPTX_SHADOW_TYPE["OUTER"] = "outer";
60
+ PPTX_SHADOW_TYPE["INNER"] = "inner";
61
+ PPTX_SHADOW_TYPE["NONE"] = "none";
62
+ })(PPTX_SHADOW_TYPE || (exports.PPTX_SHADOW_TYPE = PPTX_SHADOW_TYPE = {}));
63
+ var PPTX_CUSTOM_SHAPE_TYPE;
64
+ (function (PPTX_CUSTOM_SHAPE_TYPE) {
65
+ PPTX_CUSTOM_SHAPE_TYPE["ROUND_RECT"] = "roundRect";
66
+ })(PPTX_CUSTOM_SHAPE_TYPE || (exports.PPTX_CUSTOM_SHAPE_TYPE = PPTX_CUSTOM_SHAPE_TYPE = {}));
67
+ exports.PPTXShadowSchema = zod_1.z.object({
68
+ type: zod_1.z.nativeEnum(PPTX_SHADOW_TYPE),
69
+ opacity: zod_1.z.number().min(0).max(100).optional().describe('percents, range 0-100'),
70
+ color: zod_1.z.string().optional().describe('hex color'),
71
+ blur: zod_1.z.number().min(0).max(100).optional().describe('degrees, range 0-100'),
72
+ angle: zod_1.z.number().min(0).max(359).optional().describe('degrees, range 0-359'),
73
+ offset: zod_1.z.number().min(0).max(200).optional().describe('points, range 0-200'),
74
+ rotateWithShape: zod_1.z.boolean().optional().describe('whether or not to rotate shadow with shape'),
75
+ });
76
+ exports.PPTXFillSchema = zod_1.z.object({
77
+ color: zod_1.z.string(),
78
+ type: zod_1.z.nativeEnum(PPTX_FILL_TYPE),
79
+ transparency: zod_1.z.number().min(0).max(100).optional().describe('percents, range 0-100'),
80
+ alpha: zod_1.z.number().min(0).max(1).optional().describe('range 0-1'),
81
+ });
82
+ exports.PPTXMarginSchema = zod_1.z.union([
83
+ zod_1.z.number(),
84
+ zod_1.z.tuple([zod_1.z.number(), zod_1.z.number(), zod_1.z.number(), zod_1.z.number()]),
85
+ ]);
86
+ // Common
87
+ exports.PPTXPositionSchema = zod_1.z.object({
88
+ height: zod_1.z.number(),
89
+ width: zod_1.z.number(),
90
+ top: zod_1.z.number(),
91
+ left: zod_1.z.number(),
92
+ });
93
+ exports.PPTXFontSchema = zod_1.z.object({
94
+ bold: zod_1.z.boolean().optional(),
95
+ color: zod_1.z.string(),
96
+ name: zod_1.z.string(),
97
+ size: zod_1.z.number(),
98
+ lineHeight: zod_1.z
99
+ .union([
100
+ zod_1.z.object({
101
+ percent: zod_1.z.number(),
102
+ }),
103
+ zod_1.z.object({
104
+ px: zod_1.z.number(),
105
+ }),
106
+ ])
107
+ .optional(),
108
+ });
109
+ // Textual
110
+ exports.PPTXParagraphSchema = zod_1.z.object({
111
+ alignment: zod_1.z.nativeEnum(PPTX_H_ALIGN),
112
+ font: exports.PPTXFontSchema,
113
+ valign: zod_1.z.nativeEnum(PPTX_V_ALIGN).optional(),
114
+ margin: exports.PPTXMarginSchema.optional(),
115
+ rotate: zod_1.z.number().optional(),
116
+ text: zod_1.z.string(),
117
+ });
118
+ exports.PPTXTextBoxSchema = zod_1.z.object({
119
+ type: zod_1.z.literal(PPTX_SHAPE_TYPE.TEXT_BOX),
120
+ position: exports.PPTXPositionSchema,
121
+ paragraphs: zod_1.z.array(exports.PPTXParagraphSchema),
122
+ });
123
+ // Picture
124
+ exports.PPTXPictureBoxSchema = zod_1.z.object({
125
+ type: zod_1.z.literal(PPTX_SHAPE_TYPE.PICTURE_BOX),
126
+ position: exports.PPTXPositionSchema,
127
+ borderRadius: zod_1.z.array(zod_1.z.number()).optional(),
128
+ objectFit: zod_1.z.nativeEnum(PPTX_OBJECT_FIT),
129
+ data: zod_1.z.union([
130
+ zod_1.z.object({
131
+ base64: zod_1.z
132
+ .string()
133
+ .describe('Base64 encoded image in "image/{mimeType};base64,{bas64}" format'),
134
+ }),
135
+ zod_1.z.object({
136
+ path: zod_1.z.string().describe('URL to image'),
137
+ }),
138
+ ]),
139
+ });
140
+ // CustomShape
141
+ exports.PPTXCustomShapeSchema = zod_1.z.object({
142
+ type: zod_1.z.literal(PPTX_SHAPE_TYPE.CUSTOM_SHAPE),
143
+ customShapeType: zod_1.z.nativeEnum(PPTX_CUSTOM_SHAPE_TYPE).optional(),
144
+ position: exports.PPTXPositionSchema,
145
+ borderRadius: zod_1.z.number(),
146
+ fill: exports.PPTXFillSchema.optional(),
147
+ shadow: exports.PPTXShadowSchema.optional(),
148
+ });
149
+ // Table
150
+ exports.PPTXTableCellSchema = zod_1.z.object({
151
+ text: zod_1.z.string().optional(),
152
+ font: exports.PPTXFontSchema.optional(),
153
+ fill: zod_1.z
154
+ .object({
155
+ color: zod_1.z.string(),
156
+ type: zod_1.z.nativeEnum(PPTX_FILL_TYPE),
157
+ transparency: zod_1.z.number().min(0).max(100).optional().describe('percents, range 0-100'),
158
+ })
159
+ .optional(),
160
+ align: zod_1.z.nativeEnum(PPTX_H_ALIGN).optional(),
161
+ valign: zod_1.z.nativeEnum(PPTX_V_ALIGN).optional(),
162
+ colspan: zod_1.z.number().int().optional(),
163
+ rowspan: zod_1.z.number().int().optional(),
164
+ margin: exports.PPTXMarginSchema.optional(),
165
+ });
166
+ exports.PPTXTableRowSchema = zod_1.z.array(exports.PPTXTableCellSchema);
167
+ exports.PPTXTableShapeSchema = zod_1.z.object({
168
+ type: zod_1.z.literal(PPTX_SHAPE_TYPE.TABLE),
169
+ position: exports.PPTXPositionSchema,
170
+ rows: zod_1.z.array(exports.PPTXTableRowSchema),
171
+ columnWidths: zod_1.z.array(zod_1.z.number()).optional(),
172
+ headerRows: zod_1.z.number().int().min(0).optional(),
173
+ border: zod_1.z.object({
174
+ type: zod_1.z.nativeEnum(PPTX_BORDER_TYPE),
175
+ color: zod_1.z.string(),
176
+ px: zod_1.z.number(),
177
+ }),
178
+ });
179
+ // Chevron
180
+ exports.PPTXChevronShapeSchema = zod_1.z.object({
181
+ type: zod_1.z.literal(PPTX_SHAPE_TYPE.CHEVRON),
182
+ direction: zod_1.z.nativeEnum(PPTX_CHEVRON_DIRECTION).default(PPTX_CHEVRON_DIRECTION.RIGHT),
183
+ position: exports.PPTXPositionSchema,
184
+ fill: exports.PPTXFillSchema.optional(),
185
+ text: zod_1.z.string().optional(),
186
+ font: exports.PPTXFontSchema.optional(),
187
+ align: zod_1.z
188
+ .nativeEnum(PPTX_H_ALIGN)
189
+ .optional()
190
+ .default('center'),
191
+ valign: zod_1.z
192
+ .nativeEnum(PPTX_V_ALIGN)
193
+ .optional()
194
+ .default('middle'),
195
+ });
196
+ // Overview
197
+ exports.PPTXShapeSchema = zod_1.z.discriminatedUnion('type', [
198
+ exports.PPTXTextBoxSchema,
199
+ exports.PPTXPictureBoxSchema,
200
+ exports.PPTXCustomShapeSchema,
201
+ exports.PPTXTableShapeSchema,
202
+ exports.PPTXChevronShapeSchema,
203
+ ]);
204
+ exports.SlideBackground = zod_1.z.union([
205
+ exports.PPTXFillSchema,
206
+ zod_1.z.object({
207
+ path: zod_1.z.string(),
208
+ }),
209
+ ]);
210
+ exports.PPTXSlideSchema = zod_1.z.object({
211
+ background: exports.SlideBackground.optional(),
212
+ shapes: zod_1.z.array(exports.PPTXShapeSchema),
213
+ });
214
+ exports.PPTXExportPayloadSchema = zod_1.z.object({
215
+ slides: zod_1.z.array(exports.PPTXSlideSchema),
216
+ });
@@ -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
+ });
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PresentationConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const slide_content_type_schema_1 = require("./slide-content-type.schema");
6
+ const presentation_template_schema_1 = require("./presentation-template.schema");
7
+ const presentation_ai_action_schema_1 = require("./presentation-ai-action.schema");
8
+ const language_schema_1 = require("../language.schema");
9
+ exports.PresentationConfigSchema = zod_1.z.object({
10
+ slideContentTypes: zod_1.z.array(slide_content_type_schema_1.SlideContentTypeSchema),
11
+ languages: zod_1.z.array(language_schema_1.LanguageSchema),
12
+ templates: zod_1.z.array(presentation_template_schema_1.PresentationTemplateSchema),
13
+ aiActions: zod_1.z.array(presentation_ai_action_schema_1.PresentationAiActionSchema),
14
+ slideGenerationPrice: zod_1.z.number(),
15
+ maxSlides: zod_1.z.number(),
16
+ minSlides: zod_1.z.number(),
17
+ maxSlideTitleLength: zod_1.z.number(),
18
+ maxSlideOutlineLength: zod_1.z.number(),
19
+ maxPromptLength: zod_1.z.number(),
20
+ imageGenerationPrice: zod_1.z.number(),
21
+ });
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PresentationTemplateSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PresentationTemplateSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ title: zod_1.z.string(),
8
+ image: zod_1.z.string(),
9
+ order: zod_1.z.number(),
10
+ imagePlaceholder: zod_1.z.string(),
11
+ createdAt: zod_1.z.date(),
12
+ updatedAt: zod_1.z.date(),
13
+ });
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PresentationWithSlidesSchema = exports.PresentationSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const slide_outline_schema_1 = require("./slide-outline.schema");
6
+ const slide_schema_1 = require("./slide.schema");
7
+ const constants_1 = require("../../constants");
8
+ exports.PresentationSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ prompt: zod_1.z.string(),
11
+ stage: zod_1.z.nativeEnum(constants_1.PRESENTATION_STAGE),
12
+ title: zod_1.z.string(),
13
+ thumbnail: zod_1.z.string(),
14
+ languageId: zod_1.z.string(),
15
+ templateId: zod_1.z.string(),
16
+ downloadUrl: zod_1.z.string().nullable(),
17
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
18
+ dislikeReason: zod_1.z.string().nullable(),
19
+ slideCount: zod_1.z.number(),
20
+ lastContentUpdateAt: zod_1.z.date().nullable(),
21
+ lastPptxExportedAt: zod_1.z.date().nullable(),
22
+ createdAt: zod_1.z.date(),
23
+ updatedAt: zod_1.z.date(),
24
+ });
25
+ exports.PresentationWithSlidesSchema = exports.PresentationSchema.extend({
26
+ outline: zod_1.z.array(slide_outline_schema_1.SlideOutlineSchema),
27
+ slides: zod_1.z.array(slide_schema_1.SlideSchema),
28
+ });
@@ -0,0 +1,146 @@
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.TimelineSlideDataUserEditSchema = 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.TimelineSlideDataUserEditSchema = zod_1.default.object({
120
+ contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.TIMELINE),
121
+ title: zod_1.default.string().min(1).max(500),
122
+ description: zod_1.default.string().min(1).max(1000),
123
+ timeline: zod_1.default.object({
124
+ events: zod_1.default
125
+ .array(zod_1.default.object({
126
+ date: zod_1.default.string().min(1).max(100),
127
+ title: zod_1.default.string().min(1).max(200),
128
+ description: zod_1.default.string().min(1).max(500),
129
+ }))
130
+ .min(2)
131
+ .max(10),
132
+ }),
133
+ version: zod_1.default.literal(1),
134
+ });
135
+ exports.SlideContentUserEditSchema = zod_1.default.discriminatedUnion('contentType', [
136
+ exports.CoverSlideDataUserEditSchema,
137
+ exports.StructuredListSlideDataUserEditSchema,
138
+ exports.TextSlideDataUserEditSchema,
139
+ exports.ContentsSlideDataUserEditSchema,
140
+ exports.SectionBreakSlideDataUserEditSchema,
141
+ exports.ImageSlideDataUserEditSchema,
142
+ exports.ThankYouSlideDataUserEditSchema,
143
+ exports.TableSlideDataUserEditSchema,
144
+ exports.ChartSlideDataUserEditSchema,
145
+ exports.TimelineSlideDataUserEditSchema,
146
+ ]);
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SlideContentTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../constants");
6
+ exports.SlideContentTypeSchema = zod_1.z.object({
7
+ id: zod_1.z.nativeEnum(constants_1.SLIDE_CONTENT_TYPE),
8
+ title: zod_1.z.string(),
9
+ layouts: zod_1.z.array(zod_1.z.nativeEnum(constants_1.SLIDE_LAYOUT)),
10
+ order: zod_1.z.number(),
11
+ icon: zod_1.z.string(),
12
+ createdAt: zod_1.z.date(),
13
+ updatedAt: zod_1.z.date(),
14
+ });