@purpleschool/gptbot 0.7.77 → 0.7.78

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 (73) hide show
  1. package/api/controllers/http/presentation.ts +10 -0
  2. package/build/api/controllers/http/presentation.js +7 -0
  3. package/build/commands/auth/register-user.command.js +1 -18
  4. package/build/commands/auth/vk-login.command.js +1 -18
  5. package/build/commands/auth/yandex-login.command.js +1 -18
  6. package/build/commands/product/buy-product.command.js +1 -25
  7. package/build/commands/subscription/buy-subscription.command.js +1 -25
  8. package/build/commands/telegram-auth/create-telegram-auth-link.command.js +1 -19
  9. package/build/commands/telegram-profile/auth-with-telegram-web-app.command.js +0 -7
  10. package/build/commands/tools/presentation/build-blank-slide.command.js +21 -0
  11. package/build/commands/tools/presentation/generate-and-insert-slide.command.js +22 -0
  12. package/build/commands/tools/presentation/index.js +7 -0
  13. package/build/commands/tools/presentation/presentation-generate-report.command.js +17 -0
  14. package/build/commands/tools/presentation/presentation-paraphrase.command.js +20 -0
  15. package/build/commands/tools/presentation/update-presentation-slides.command.js +25 -0
  16. package/build/commands/tools/presentation/update-presentation.command.js +4 -3
  17. package/build/commands/tools/presentation/update-slide-image-slot.command.js +34 -0
  18. package/build/commands/tools/presentation/update-slide.command.js +19 -0
  19. package/build/constants/errors/errors.js +10 -2
  20. package/build/constants/presentation/enums/index.js +4 -0
  21. package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
  22. package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
  23. package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
  24. package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
  25. package/build/constants/webmaster/enums/organization-type.enum.js +1 -0
  26. package/build/helpers/index.js +1 -0
  27. package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
  28. package/build/helpers/presentation/index.js +17 -0
  29. package/build/models/tools/index.js +1 -0
  30. package/build/models/tools/presentation/index.js +1 -0
  31. package/build/models/tools/presentation/presentation-ai-action.schema.js +27 -0
  32. package/build/models/tools/presentation/presentation-config.schema.js +3 -0
  33. package/build/models/tools/presentation/presentation.schema.js +2 -0
  34. package/build/models/tools/presentation/slide-content-edit.schema.js +129 -0
  35. package/build/models/tools/presentation/slide-content.schema.js +22 -20
  36. package/build/models/tools/presentation/slide.schema.js +39 -1
  37. package/build/models/user-referrals.schema.js +0 -6
  38. package/commands/auth/register-user.command.ts +1 -23
  39. package/commands/auth/vk-login.command.ts +1 -23
  40. package/commands/auth/yandex-login.command.ts +1 -23
  41. package/commands/product/buy-product.command.ts +9 -38
  42. package/commands/subscription/buy-subscription.command.ts +9 -38
  43. package/commands/telegram-auth/create-telegram-auth-link.command.ts +1 -24
  44. package/commands/telegram-profile/auth-with-telegram-web-app.command.ts +0 -7
  45. package/commands/tools/presentation/build-blank-slide.command.ts +23 -0
  46. package/commands/tools/presentation/generate-and-insert-slide.command.ts +27 -0
  47. package/commands/tools/presentation/index.ts +7 -0
  48. package/commands/tools/presentation/presentation-generate-report.command.ts +21 -0
  49. package/commands/tools/presentation/presentation-paraphrase.command.ts +26 -0
  50. package/commands/tools/presentation/update-presentation-slides.command.ts +32 -0
  51. package/commands/tools/presentation/update-presentation.command.ts +5 -4
  52. package/commands/tools/presentation/update-slide-image-slot.command.ts +40 -0
  53. package/commands/tools/presentation/update-slide.command.ts +25 -0
  54. package/constants/errors/errors.ts +10 -2
  55. package/constants/presentation/enums/index.ts +4 -0
  56. package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
  57. package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
  58. package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
  59. package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
  60. package/constants/webmaster/enums/organization-type.enum.ts +1 -0
  61. package/helpers/index.ts +1 -0
  62. package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
  63. package/helpers/presentation/index.ts +1 -0
  64. package/models/tools/index.ts +1 -0
  65. package/models/tools/presentation/index.ts +1 -0
  66. package/models/tools/presentation/presentation-ai-action.schema.ts +33 -0
  67. package/models/tools/presentation/presentation-config.schema.ts +3 -0
  68. package/models/tools/presentation/presentation.schema.ts +2 -0
  69. package/models/tools/presentation/slide-content-edit.schema.ts +154 -0
  70. package/models/tools/presentation/slide-content.schema.ts +119 -32
  71. package/models/tools/presentation/slide.schema.ts +47 -0
  72. package/models/user-referrals.schema.ts +0 -6
  73. package/package.json +1 -1
@@ -15,6 +15,8 @@ exports.PresentationSchema = zod_1.z.object({
15
15
  templateId: zod_1.z.string(),
16
16
  downloadUrl: zod_1.z.string().nullable(),
17
17
  slideCount: zod_1.z.number(),
18
+ lastContentUpdateAt: zod_1.z.date().nullable(),
19
+ lastPptxExportedAt: zod_1.z.date().nullable(),
18
20
  createdAt: zod_1.z.date(),
19
21
  updatedAt: zod_1.z.date(),
20
22
  });
@@ -0,0 +1,129 @@
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
+ ]);
@@ -19,9 +19,7 @@ exports.IconSlotSchema = zod_1.z.object({
19
19
  .string()
20
20
  .uuid()
21
21
  .describe('Generate a valid uuid for icon slot, that will be used for future lookups'),
22
- prompt: zod_1.z
23
- .string()
24
- .describe('Icons are stored locally. Provide a search query for a fitting icon. MUST BE IN ENGLISH'),
22
+ prompt: zod_1.z.string().describe('Provide a search query for an fitting icon. MUST BE IN ENGLISH'),
25
23
  });
26
24
  exports.CoverSlideDataSchema = zod_1.z.object({
27
25
  contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
@@ -46,15 +44,17 @@ exports.CoverSlideDataSchema = zod_1.z.object({
46
44
  });
47
45
  exports.ThankYouSlideDataSchema = zod_1.z.object({
48
46
  contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.THANK_YOU),
49
- title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
47
+ title: zod_1.z
48
+ .string()
49
+ .describe('"Thank you for your attention" in presentation\'s language')
50
+ .min(10)
51
+ .max(150),
50
52
  author: zod_1.z.object({
51
- label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
52
- value: zod_1.z
53
- .string()
54
- .describe('Literal "Author of the presentation" in presentation\'s language'),
53
+ label: zod_1.z.string().describe('"Author" in presentation\'s language'),
54
+ value: zod_1.z.string().describe('"Author of the presentation" in presentation\'s language'),
55
55
  }),
56
56
  date: zod_1.z.object({
57
- label: zod_1.z.string().describe('Literal "Date" in presentation\'s language'),
57
+ label: zod_1.z.string().describe('"Date" in presentation\'s language'),
58
58
  value: zod_1.z
59
59
  .string()
60
60
  .describe('Date of the presentation in the "dd month yyyy" format in presentation\'s locale'),
@@ -82,9 +82,9 @@ exports.TextSlideDataSchema = zod_1.z.object({
82
82
  title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
83
83
  description: zod_1.z
84
84
  .string()
85
- .describe('Fairly long textual description of the point presented in the title. A couple of paragraphs.')
85
+ .describe("Fairly long textual description of the point presented in the title. A couple of paragraphs. Consider maximum amount of text to be 600 characters. Don't cut the text short.")
86
86
  .min(300)
87
- .max(500),
87
+ .max(600),
88
88
  version: zod_1.z.literal(1),
89
89
  });
90
90
  exports.ContentsSlideDataSchema = zod_1.z.object({
@@ -137,9 +137,9 @@ exports.TableSlideDataSchema = zod_1.z.object({
137
137
  .max(10)
138
138
  .describe('Array of column header labels'),
139
139
  rows: zod_1.z
140
- .array(zod_1.z.array(zod_1.z.string().min(1).max(150)))
141
- .min(2)
142
- .max(10)
140
+ .array(zod_1.z.array(zod_1.z.string().min(1).max(75)))
141
+ .min(3)
142
+ .max(4)
143
143
  .describe('Table rows; each row must have exactly the same number of cells as columnHeaders'),
144
144
  hasRowHeaders: zod_1.z.boolean().describe('If table needs special row headers, set this to true'),
145
145
  hasSummaryRow: zod_1.z.boolean().describe('If table needs a summary row, set this to true'),
@@ -150,13 +150,15 @@ exports.TableSlideDataSchema = zod_1.z.object({
150
150
  exports.BarChartSlideDataSchema = zod_1.z.object({
151
151
  type: zod_1.z.literal(SLIDE_CHART_TYPE.BAR),
152
152
  categories: zod_1.z
153
- .array(zod_1.z.string().min(1).max(12))
153
+ .array(zod_1.z.string())
154
154
  .min(1)
155
155
  .max(12)
156
156
  .describe('Category labels (e.g., months, products, regions)'),
157
157
  series: zod_1.z
158
158
  .array(zod_1.z.object({
159
- name: zod_1.z.string().min(1).max(12).describe('Series name for legend'),
159
+ name: zod_1.z
160
+ .string()
161
+ .describe('Series name for legend. Try to include measurements if needed'),
160
162
  data: zod_1.z.array(zod_1.z.number()).describe('Values corresponding to categories'),
161
163
  type: zod_1.z
162
164
  .number()
@@ -165,16 +167,16 @@ exports.BarChartSlideDataSchema = zod_1.z.object({
165
167
  .describe('Series type. Used to discriminate colors when applying theme'),
166
168
  }))
167
169
  .min(1)
168
- .max(12)
169
- .describe('Data series for the chart'),
170
+ .max(1)
171
+ .describe('Data series for the chart. Only one series is supported'),
170
172
  yAxisLabel: zod_1.z.string().max(40).optional().describe('Y-axis label'),
171
173
  unit: zod_1.z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
172
174
  version: zod_1.z.literal(1),
173
175
  });
174
176
  exports.ChartSlideDataSchema = zod_1.z.object({
175
177
  contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.CHART),
176
- title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(200),
177
- description: zod_1.z.string().describe("Information on slide's topic").min(10).max(400),
178
+ title: zod_1.z.string().describe('Slide title in about 2-6 words').max(100),
179
+ description: zod_1.z.string().describe("Information on slide's topic").max(600),
178
180
  chart: zod_1.z.discriminatedUnion('type', [exports.BarChartSlideDataSchema]),
179
181
  version: zod_1.z.literal(1),
180
182
  });
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SlideSchema = void 0;
3
+ exports.SlideBulkUpdateSchema = exports.SlideUpdateSchema = exports.SlideSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const slide_content_schema_1 = require("./slide-content.schema");
6
6
  const constants_1 = require("../../../constants");
7
7
  const slide_icon_slot_schema_1 = require("./slide-icon-slot.schema");
8
8
  const slide_image_slot_schema_1 = require("./slide-image-slot.schema");
9
+ const slide_content_edit_schema_1 = require("./slide-content-edit.schema");
9
10
  exports.SlideSchema = zod_1.z.object({
10
11
  uuid: zod_1.z.string().uuid(),
11
12
  order: zod_1.z.number(),
@@ -18,3 +19,40 @@ exports.SlideSchema = zod_1.z.object({
18
19
  createdAt: zod_1.z.date(),
19
20
  updatedAt: zod_1.z.date(),
20
21
  });
22
+ exports.SlideUpdateSchema = exports.SlideSchema.pick({
23
+ layoutId: true,
24
+ })
25
+ .extend({
26
+ content: slide_content_edit_schema_1.SlideContentUserEditSchema,
27
+ })
28
+ .partial();
29
+ exports.SlideBulkUpdateSchema = exports.SlideSchema.pick({
30
+ order: true,
31
+ contentTypeId: true,
32
+ layoutId: true,
33
+ presentationId: true,
34
+ })
35
+ .extend({
36
+ uuid: zod_1.z.string().uuid().optional(),
37
+ content: slide_content_edit_schema_1.SlideContentUserEditSchema,
38
+ })
39
+ .array()
40
+ .min(1, 'Must include at least one slide')
41
+ .refine((arr) => {
42
+ const orders = arr.map((s) => s.order);
43
+ const unique = new Set(orders);
44
+ if (unique.size !== orders.length)
45
+ return false;
46
+ const sorted = [...orders].sort((a, b) => a - b);
47
+ return sorted.every((val, idx) => val === idx);
48
+ }, {
49
+ message: 'Slide orders must be unique and sequential starting at 0',
50
+ path: ['order'],
51
+ })
52
+ .refine((arr) => {
53
+ const [firstId, ...rest] = arr.map((s) => s.presentationId);
54
+ return rest.every((id) => id === firstId);
55
+ }, {
56
+ message: 'All slides must belong to the same presentation',
57
+ path: ['presentationId'],
58
+ });
@@ -12,10 +12,4 @@ exports.UserReferralsSchema = zod_1.default.object({
12
12
  .string()
13
13
  .transform((date) => new Date(date))
14
14
  .optional(),
15
- admitadUid: zod_1.default.string().optional(),
16
- admitadClickDate: zod_1.default
17
- .string()
18
- .datetime()
19
- .transform((date) => new Date(date))
20
- .optional(),
21
15
  });
@@ -5,30 +5,8 @@ export namespace RegisterUserCommand {
5
5
  export const RequestSchema = UserSchema.pick({ email: true, password: true })
6
6
  .extend({
7
7
  utm: UtmSchema.optional(),
8
- marketingConsent: z.boolean().default(false),
9
8
  })
10
- .merge(UserReferralsSchema)
11
- .refine(
12
- (data) => {
13
- const hasAdmitadUid = !!data.admitadUid;
14
- const hasAdmitadClickDate = !!data.admitadClickDate;
15
- return hasAdmitadUid === hasAdmitadClickDate;
16
- },
17
- {
18
- message: 'admitadUid and admitadClickDate must be provided together',
19
- path: ['admitadUid'],
20
- },
21
- )
22
- .refine(
23
- (data) => {
24
- if (!data.admitadClickDate) return true;
25
- return new Date(data.admitadClickDate).getTime() <= Date.now();
26
- },
27
- {
28
- message: 'admitadClickDate cannot be in the future',
29
- path: ['admitadClickDate'],
30
- },
31
- );
9
+ .merge(UserReferralsSchema);
32
10
 
33
11
  export type Request = z.infer<typeof RequestSchema>;
34
12
 
@@ -8,30 +8,8 @@ export namespace VKLoginCommand {
8
8
  code_verifier: z.string(),
9
9
  device_id: z.string(),
10
10
  state: z.string(),
11
- marketingConsent: z.boolean().default(false),
12
11
  })
13
- .merge(UserReferralsSchema)
14
- .refine(
15
- (data) => {
16
- const hasAdmitadUid = !!data.admitadUid;
17
- const hasAdmitadClickDate = !!data.admitadClickDate;
18
- return hasAdmitadUid === hasAdmitadClickDate;
19
- },
20
- {
21
- message: 'admitadUid and admitadClickDate must be provided together',
22
- path: ['admitadUid'],
23
- },
24
- )
25
- .refine(
26
- (data) => {
27
- if (!data.admitadClickDate) return true;
28
- return new Date(data.admitadClickDate).getTime() <= Date.now();
29
- },
30
- {
31
- message: 'admitadClickDate cannot be in the future',
32
- path: ['admitadClickDate'],
33
- },
34
- );
12
+ .merge(UserReferralsSchema);
35
13
 
36
14
  export type Request = z.infer<typeof RequestSchema>;
37
15
 
@@ -6,30 +6,8 @@ export namespace YandexLoginCommand {
6
6
  .object({
7
7
  code: z.string(),
8
8
  code_verifier: z.string(),
9
- marketingConsent: z.boolean().default(false),
10
9
  })
11
- .merge(UserReferralsSchema)
12
- .refine(
13
- (data) => {
14
- const hasAdmitadUid = !!data.admitadUid;
15
- const hasAdmitadClickDate = !!data.admitadClickDate;
16
- return hasAdmitadUid === hasAdmitadClickDate;
17
- },
18
- {
19
- message: 'admitadUid and admitadClickDate must be provided together',
20
- path: ['admitadUid'],
21
- },
22
- )
23
- .refine(
24
- (data) => {
25
- if (!data.admitadClickDate) return true;
26
- return new Date(data.admitadClickDate).getTime() <= Date.now();
27
- },
28
- {
29
- message: 'admitadClickDate cannot be in the future',
30
- path: ['admitadClickDate'],
31
- },
32
- );
10
+ .merge(UserReferralsSchema);
33
11
 
34
12
  export type Request = z.infer<typeof RequestSchema>;
35
13
 
@@ -32,44 +32,15 @@ export namespace BuyProductCommand {
32
32
  }),
33
33
  });
34
34
 
35
- export const RequestFastSchema = z
36
- .object({
37
- email: z.string().email(),
38
- partnerId: z.string().uuid().optional(),
39
- promocode: z.string().optional(),
40
- webmasterAlias: z.string().optional(),
41
- webmasterReferralProvidedAt: z
42
- .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
43
- .optional(),
44
- admitadUid: z.string().optional(),
45
- admitadClickDate: z
46
- .string()
47
- .datetime()
48
- .transform((date) => new Date(date))
49
- .optional(),
50
- marketingConsent: z.boolean().default(false),
51
- })
52
- .refine(
53
- (data) => {
54
- const hasAdmitadUid = !!data.admitadUid;
55
- const hasAdmitadClickDate = !!data.admitadClickDate;
56
- return hasAdmitadUid === hasAdmitadClickDate;
57
- },
58
- {
59
- message: 'admitadUid and admitadClickDate must be provided together',
60
- path: ['admitadUid'],
61
- },
62
- )
63
- .refine(
64
- (data) => {
65
- if (!data.admitadClickDate) return true;
66
- return new Date(data.admitadClickDate).getTime() <= Date.now();
67
- },
68
- {
69
- message: 'admitadClickDate cannot be in the future',
70
- path: ['admitadClickDate'],
71
- },
72
- );
35
+ export const RequestFastSchema = z.object({
36
+ email: z.string().email(),
37
+ partnerId: z.string().uuid().optional(),
38
+ promocode: z.string().optional(),
39
+ webmasterAlias: z.string().optional(),
40
+ webmasterReferralProvidedAt: z
41
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
42
+ .optional(),
43
+ });
73
44
 
74
45
  export type RequestFast = z.infer<typeof RequestFastSchema>;
75
46
  export const ResponseSchema = z.object({
@@ -12,44 +12,15 @@ export namespace BuySubscriptionCommand {
12
12
  });
13
13
 
14
14
  export type Request = z.infer<typeof RequestSchema>;
15
- export const RequestFastSchema = z
16
- .object({
17
- email: z.string().email(),
18
- partnerId: z.string().uuid().optional(),
19
- promocode: z.string().optional(),
20
- webmasterAlias: z.string().optional(),
21
- webmasterReferralProvidedAt: z
22
- .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
23
- .optional(),
24
- admitadUid: z.string().optional(),
25
- admitadClickDate: z
26
- .string()
27
- .datetime()
28
- .transform((date) => new Date(date))
29
- .optional(),
30
- marketingConsent: z.boolean().default(false),
31
- })
32
- .refine(
33
- (data) => {
34
- const hasAdmitadUid = !!data.admitadUid;
35
- const hasAdmitadClickDate = !!data.admitadClickDate;
36
- return hasAdmitadUid === hasAdmitadClickDate;
37
- },
38
- {
39
- message: 'admitadUid and admitadClickDate must be provided together',
40
- path: ['admitadUid'],
41
- },
42
- )
43
- .refine(
44
- (data) => {
45
- if (!data.admitadClickDate) return true;
46
- return new Date(data.admitadClickDate).getTime() <= Date.now();
47
- },
48
- {
49
- message: 'admitadClickDate cannot be in the future',
50
- path: ['admitadClickDate'],
51
- },
52
- );
15
+ export const RequestFastSchema = z.object({
16
+ email: z.string().email(),
17
+ partnerId: z.string().uuid().optional(),
18
+ promocode: z.string().optional(),
19
+ webmasterAlias: z.string().optional(),
20
+ webmasterReferralProvidedAt: z
21
+ .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
22
+ .optional(),
23
+ });
53
24
 
54
25
  export type RequestFast = z.infer<typeof RequestFastSchema>;
55
26
 
@@ -2,30 +2,7 @@ import { z } from 'zod';
2
2
  import { UserReferralsSchema } from '../../models';
3
3
 
4
4
  export namespace CreateTelegramAuthLinkCommand {
5
- export const RequestSchema = UserReferralsSchema.extend({
6
- marketingConsent: z.boolean().default(false),
7
- })
8
- .refine(
9
- (data) => {
10
- const hasAdmitadUid = !!data.admitadUid;
11
- const hasAdmitadClickDate = !!data.admitadClickDate;
12
- return hasAdmitadUid === hasAdmitadClickDate;
13
- },
14
- {
15
- message: 'admitadUid and admitadClickDate must be provided together',
16
- path: ['admitadUid'],
17
- },
18
- )
19
- .refine(
20
- (data) => {
21
- if (!data.admitadClickDate) return true;
22
- return new Date(data.admitadClickDate).getTime() <= Date.now();
23
- },
24
- {
25
- message: 'admitadClickDate cannot be in the future',
26
- path: ['admitadClickDate'],
27
- },
28
- );
5
+ export const RequestSchema = UserReferralsSchema;
29
6
 
30
7
  export type Request = z.infer<typeof RequestSchema>;
31
8
 
@@ -11,13 +11,6 @@ export namespace AuthWithTelegramWebAppCommand {
11
11
  .preprocess((val) => (typeof val === 'string' ? new Date(val) : val), z.date())
12
12
  .optional(),
13
13
  utm: UtmSchema.optional(),
14
- admitadUid: z.string().optional(),
15
- admitadClickDate: z
16
- .string()
17
- .datetime()
18
- .transform((date) => new Date(date))
19
- .optional(),
20
- marketingConsent: z.boolean().default(false),
21
14
  });
22
15
 
23
16
  export type Request = z.infer<typeof RequestBodySchema>;
@@ -0,0 +1,23 @@
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
+ }
@@ -0,0 +1,27 @@
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,3 +1,4 @@
1
+ export * from './build-blank-slide.command';
1
2
  export * from './create-presentation.command';
2
3
  export * from './delete-all-user-presentations.command';
3
4
  export * from './delete-slide-outline.command';
@@ -7,9 +8,15 @@ export * from './find-presentation-by-uuid.command';
7
8
  export * from './find-presentation-outline.command';
8
9
  export * from './find-presentations.command';
9
10
  export * from './generate-presentation-slides.command';
11
+ export * from './generate-and-insert-slide.command';
10
12
  export * from './get-presentation-config.command';
11
13
  export * from './reposition-slide-outline.command';
12
14
  export * from './update-slide-outline.command';
13
15
  export * from './update-presentation-outline.command';
14
16
  export * from './update-presentation.command';
17
+ export * from './update-presentation-slides.command';
18
+ export * from './update-slide-image-slot.command';
15
19
  export * from './update-slide-outline.command';
20
+ export * from './presentation-paraphrase.command';
21
+ export * from './presentation-generate-report.command';
22
+ export * from './update-slide.command';
@@ -0,0 +1,21 @@
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
+ }