@purpleschool/gptbot-tools 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/presentation/constants/slide-layout-map.constant.js +1 -1
- package/build/presentation/enums/slide-content-type.enum.js +1 -1
- package/build/presentation/models/slide-content.schema.js +26 -13
- package/package.json +1 -1
- package/presentation/constants/slide-layout-map.constant.ts +1 -1
- package/presentation/enums/slide-content-type.enum.ts +1 -1
- package/presentation/models/slide-content.schema.ts +34 -21
|
@@ -9,7 +9,7 @@ exports.SLIDE_LAYOUT_MAP = new Map([
|
|
|
9
9
|
[enums_1.SLIDE_CONTENT_TYPE.TEXT, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1, slide_layout_enum_1.SLIDE_LAYOUT.TYPE_2]],
|
|
10
10
|
[enums_1.SLIDE_CONTENT_TYPE.SECTION_BREAK, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
11
11
|
[enums_1.SLIDE_CONTENT_TYPE.CONTENTS, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
12
|
-
[enums_1.SLIDE_CONTENT_TYPE.
|
|
12
|
+
[enums_1.SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
13
13
|
[enums_1.SLIDE_CONTENT_TYPE.THANK_YOU, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
14
14
|
[enums_1.SLIDE_CONTENT_TYPE.TABLE, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
15
15
|
[enums_1.SLIDE_CONTENT_TYPE.CHART, [slide_layout_enum_1.SLIDE_LAYOUT.TYPE_1]],
|
|
@@ -8,7 +8,7 @@ var SLIDE_CONTENT_TYPE;
|
|
|
8
8
|
SLIDE_CONTENT_TYPE["SECTION_BREAK"] = "SECTION_BREAK";
|
|
9
9
|
SLIDE_CONTENT_TYPE["STRUCTURED_LIST"] = "STRUCTURED_LIST";
|
|
10
10
|
SLIDE_CONTENT_TYPE["CONTENTS"] = "CONTENTS";
|
|
11
|
-
SLIDE_CONTENT_TYPE["
|
|
11
|
+
SLIDE_CONTENT_TYPE["TEXT_WITH_IMAGE"] = "TEXT_WITH_IMAGE";
|
|
12
12
|
SLIDE_CONTENT_TYPE["THANK_YOU"] = "THANK_YOU";
|
|
13
13
|
SLIDE_CONTENT_TYPE["TABLE"] = "TABLE";
|
|
14
14
|
SLIDE_CONTENT_TYPE["CHART"] = "CHART";
|
|
@@ -25,7 +25,7 @@ exports.IconSlotSchema = zod_1.z.object({
|
|
|
25
25
|
});
|
|
26
26
|
exports.CoverSlideDataSchema = zod_1.z.object({
|
|
27
27
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.COVER),
|
|
28
|
-
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(
|
|
28
|
+
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
29
29
|
author: zod_1.z.object({
|
|
30
30
|
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
31
31
|
value: zod_1.z
|
|
@@ -42,10 +42,11 @@ exports.CoverSlideDataSchema = zod_1.z.object({
|
|
|
42
42
|
label: zod_1.z.string().describe('Just default word "Email"'),
|
|
43
43
|
value: zod_1.z.string().describe('Just default "email@example.com"'),
|
|
44
44
|
}),
|
|
45
|
+
version: zod_1.z.literal(1),
|
|
45
46
|
});
|
|
46
47
|
exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
47
48
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
48
|
-
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(
|
|
49
|
+
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
49
50
|
author: zod_1.z.object({
|
|
50
51
|
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
51
52
|
value: zod_1.z
|
|
@@ -62,28 +63,29 @@ exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
|
62
63
|
label: zod_1.z.string().describe('Just default word "Email"'),
|
|
63
64
|
value: zod_1.z.string().describe('Just default "email@example.com"'),
|
|
64
65
|
}),
|
|
66
|
+
version: zod_1.z.literal(1),
|
|
65
67
|
});
|
|
66
68
|
exports.StructuredListSlideDataSchema = zod_1.z.object({
|
|
67
69
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.STRUCTURED_LIST),
|
|
68
|
-
title: zod_1.z.string().describe('Slide title, 2–6 words'),
|
|
70
|
+
title: zod_1.z.string().describe('Slide title, 2–6 words').max(150),
|
|
69
71
|
description: zod_1.z.string().describe('One short framing sentence'),
|
|
70
72
|
list: zod_1.z
|
|
71
73
|
.array(zod_1.z.object({
|
|
72
74
|
title: zod_1.z.string().describe('2–4 words, concrete'),
|
|
73
|
-
description: zod_1.z
|
|
74
|
-
.string()
|
|
75
|
-
.describe('One clear short framing sentence, explains the point, 8–14 words'),
|
|
75
|
+
description: zod_1.z.string().describe('One clear short framing sentence').max(100),
|
|
76
76
|
}))
|
|
77
77
|
.length(4),
|
|
78
|
+
version: zod_1.z.literal(1),
|
|
78
79
|
});
|
|
79
80
|
exports.TextSlideDataSchema = zod_1.z.object({
|
|
80
81
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.TEXT),
|
|
81
|
-
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(
|
|
82
|
+
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
82
83
|
description: zod_1.z
|
|
83
84
|
.string()
|
|
84
85
|
.describe('Fairly long textual description of the point presented in the title. A couple of paragraphs.')
|
|
85
86
|
.min(300)
|
|
86
|
-
.max(
|
|
87
|
+
.max(500),
|
|
88
|
+
version: zod_1.z.literal(1),
|
|
87
89
|
});
|
|
88
90
|
exports.ContentsSlideDataSchema = zod_1.z.object({
|
|
89
91
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.CONTENTS),
|
|
@@ -93,24 +95,32 @@ exports.ContentsSlideDataSchema = zod_1.z.object({
|
|
|
93
95
|
.min(10)
|
|
94
96
|
.max(200),
|
|
95
97
|
items: zod_1.z
|
|
96
|
-
.array(zod_1.z.
|
|
98
|
+
.array(zod_1.z.object({
|
|
99
|
+
pageNumber: zod_1.z.number().describe('Page number of the slide'),
|
|
100
|
+
title: zod_1.z.string().min(1).describe('Title of the slide on said page'),
|
|
101
|
+
}))
|
|
97
102
|
.min(1)
|
|
98
103
|
.describe('List of slide titles. Must be relevant and generated after all the slides are generated'),
|
|
104
|
+
version: zod_1.z.literal(1),
|
|
99
105
|
});
|
|
100
|
-
exports.ImageSlideDataSchema = zod_1.z
|
|
101
|
-
|
|
106
|
+
exports.ImageSlideDataSchema = zod_1.z
|
|
107
|
+
.object({
|
|
108
|
+
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE),
|
|
102
109
|
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
103
110
|
description: zod_1.z
|
|
104
111
|
.string()
|
|
105
|
-
.describe("
|
|
112
|
+
.describe("Text that elaborates on the title and doesn't just describe the image")
|
|
106
113
|
.min(10)
|
|
107
114
|
.max(500),
|
|
108
115
|
imageSlot: exports.ImageSlotSchema,
|
|
109
|
-
|
|
116
|
+
version: zod_1.z.literal(1),
|
|
117
|
+
})
|
|
118
|
+
.describe('Slide that contains a title, description of the title');
|
|
110
119
|
exports.SectionBreakSlideDataSchema = zod_1.z.object({
|
|
111
120
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.SECTION_BREAK),
|
|
112
121
|
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
113
122
|
description: zod_1.z.string().describe('Description of the slide in about 6 words').min(10).max(200),
|
|
123
|
+
version: zod_1.z.literal(1),
|
|
114
124
|
});
|
|
115
125
|
exports.TableSlideDataSchema = zod_1.z.object({
|
|
116
126
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.TABLE),
|
|
@@ -134,6 +144,7 @@ exports.TableSlideDataSchema = zod_1.z.object({
|
|
|
134
144
|
hasRowHeaders: zod_1.z.boolean().describe('If table needs special row headers, set this to true'),
|
|
135
145
|
hasSummaryRow: zod_1.z.boolean().describe('If table needs a summary row, set this to true'),
|
|
136
146
|
}),
|
|
147
|
+
version: zod_1.z.literal(1),
|
|
137
148
|
});
|
|
138
149
|
// Charts
|
|
139
150
|
exports.BarChartSlideDataSchema = zod_1.z.object({
|
|
@@ -158,12 +169,14 @@ exports.BarChartSlideDataSchema = zod_1.z.object({
|
|
|
158
169
|
.describe('Data series for the chart'),
|
|
159
170
|
yAxisLabel: zod_1.z.string().max(40).optional().describe('Y-axis label'),
|
|
160
171
|
unit: zod_1.z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
|
|
172
|
+
version: zod_1.z.literal(1),
|
|
161
173
|
});
|
|
162
174
|
exports.ChartSlideDataSchema = zod_1.z.object({
|
|
163
175
|
contentType: zod_1.z.literal(enums_1.SLIDE_CONTENT_TYPE.CHART),
|
|
164
176
|
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
165
177
|
description: zod_1.z.string().describe("Information on slide's topic").min(10).max(400),
|
|
166
178
|
chart: zod_1.z.discriminatedUnion('type', [exports.BarChartSlideDataSchema]),
|
|
179
|
+
version: zod_1.z.literal(1),
|
|
167
180
|
});
|
|
168
181
|
exports.SlideContentSchema = zod_1.z.discriminatedUnion('contentType', [
|
|
169
182
|
exports.CoverSlideDataSchema,
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ export const SLIDE_LAYOUT_MAP = new Map<SLIDE_CONTENT_TYPE, SLIDE_LAYOUT[]>([
|
|
|
7
7
|
[SLIDE_CONTENT_TYPE.TEXT, [SLIDE_LAYOUT.TYPE_1, SLIDE_LAYOUT.TYPE_2]],
|
|
8
8
|
[SLIDE_CONTENT_TYPE.SECTION_BREAK, [SLIDE_LAYOUT.TYPE_1]],
|
|
9
9
|
[SLIDE_CONTENT_TYPE.CONTENTS, [SLIDE_LAYOUT.TYPE_1]],
|
|
10
|
-
[SLIDE_CONTENT_TYPE.
|
|
10
|
+
[SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE, [SLIDE_LAYOUT.TYPE_1]],
|
|
11
11
|
[SLIDE_CONTENT_TYPE.THANK_YOU, [SLIDE_LAYOUT.TYPE_1]],
|
|
12
12
|
[SLIDE_CONTENT_TYPE.TABLE, [SLIDE_LAYOUT.TYPE_1]],
|
|
13
13
|
[SLIDE_CONTENT_TYPE.CHART, [SLIDE_LAYOUT.TYPE_1]],
|
|
@@ -29,7 +29,7 @@ export type IconSlot = z.infer<typeof IconSlotSchema>;
|
|
|
29
29
|
|
|
30
30
|
export const CoverSlideDataSchema = z.object({
|
|
31
31
|
contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
|
|
32
|
-
title: z.string().describe('Slide title in about 6 words').min(10).max(
|
|
32
|
+
title: z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
33
33
|
author: z.object({
|
|
34
34
|
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
35
35
|
value: z
|
|
@@ -48,12 +48,13 @@ export const CoverSlideDataSchema = z.object({
|
|
|
48
48
|
label: z.string().describe('Just default word "Email"'),
|
|
49
49
|
value: z.string().describe('Just default "email@example.com"'),
|
|
50
50
|
}),
|
|
51
|
+
version: z.literal(1),
|
|
51
52
|
});
|
|
52
53
|
export type CoverSlideData = z.infer<typeof CoverSlideDataSchema>;
|
|
53
54
|
|
|
54
55
|
export const ThankYouSlideDataSchema = z.object({
|
|
55
56
|
contentType: z.literal(SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
56
|
-
title: z.string().describe('Slide title in about 6 words').min(10).max(
|
|
57
|
+
title: z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
57
58
|
author: z.object({
|
|
58
59
|
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
59
60
|
value: z
|
|
@@ -72,36 +73,37 @@ export const ThankYouSlideDataSchema = z.object({
|
|
|
72
73
|
label: z.string().describe('Just default word "Email"'),
|
|
73
74
|
value: z.string().describe('Just default "email@example.com"'),
|
|
74
75
|
}),
|
|
76
|
+
version: z.literal(1),
|
|
75
77
|
});
|
|
76
78
|
export type ThankYouSlideData = z.infer<typeof ThankYouSlideDataSchema>;
|
|
77
79
|
|
|
78
80
|
export const StructuredListSlideDataSchema = z.object({
|
|
79
81
|
contentType: z.literal(SLIDE_CONTENT_TYPE.STRUCTURED_LIST),
|
|
80
|
-
title: z.string().describe('Slide title, 2–6 words'),
|
|
82
|
+
title: z.string().describe('Slide title, 2–6 words').max(150),
|
|
81
83
|
description: z.string().describe('One short framing sentence'),
|
|
82
84
|
list: z
|
|
83
85
|
.array(
|
|
84
86
|
z.object({
|
|
85
87
|
title: z.string().describe('2–4 words, concrete'),
|
|
86
|
-
description: z
|
|
87
|
-
.string()
|
|
88
|
-
.describe('One clear short framing sentence, explains the point, 8–14 words'),
|
|
88
|
+
description: z.string().describe('One clear short framing sentence').max(100),
|
|
89
89
|
}),
|
|
90
90
|
)
|
|
91
91
|
.length(4),
|
|
92
|
+
version: z.literal(1),
|
|
92
93
|
});
|
|
93
94
|
export type StructuredListSlideData = z.infer<typeof StructuredListSlideDataSchema>;
|
|
94
95
|
|
|
95
96
|
export const TextSlideDataSchema = z.object({
|
|
96
97
|
contentType: z.literal(SLIDE_CONTENT_TYPE.TEXT),
|
|
97
|
-
title: z.string().describe('Slide title in about 6 words').min(10).max(
|
|
98
|
+
title: z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
98
99
|
description: z
|
|
99
100
|
.string()
|
|
100
101
|
.describe(
|
|
101
102
|
'Fairly long textual description of the point presented in the title. A couple of paragraphs.',
|
|
102
103
|
)
|
|
103
104
|
.min(300)
|
|
104
|
-
.max(
|
|
105
|
+
.max(500),
|
|
106
|
+
version: z.literal(1),
|
|
105
107
|
});
|
|
106
108
|
export type TextSlideData = z.infer<typeof TextSlideDataSchema>;
|
|
107
109
|
|
|
@@ -115,32 +117,40 @@ export const ContentsSlideDataSchema = z.object({
|
|
|
115
117
|
.min(10)
|
|
116
118
|
.max(200),
|
|
117
119
|
items: z
|
|
118
|
-
.array(
|
|
120
|
+
.array(
|
|
121
|
+
z.object({
|
|
122
|
+
pageNumber: z.number().describe('Page number of the slide'),
|
|
123
|
+
title: z.string().min(1).describe('Title of the slide on said page'),
|
|
124
|
+
}),
|
|
125
|
+
)
|
|
119
126
|
.min(1)
|
|
120
127
|
.describe(
|
|
121
128
|
'List of slide titles. Must be relevant and generated after all the slides are generated',
|
|
122
129
|
),
|
|
130
|
+
version: z.literal(1),
|
|
123
131
|
});
|
|
124
132
|
export type ContentsSlideData = z.infer<typeof ContentsSlideDataSchema>;
|
|
125
133
|
|
|
126
|
-
export const ImageSlideDataSchema = z
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
"
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
})
|
|
134
|
+
export const ImageSlideDataSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
contentType: z.literal(SLIDE_CONTENT_TYPE.TEXT_WITH_IMAGE),
|
|
137
|
+
title: z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
138
|
+
description: z
|
|
139
|
+
.string()
|
|
140
|
+
.describe("Text that elaborates on the title and doesn't just describe the image")
|
|
141
|
+
.min(10)
|
|
142
|
+
.max(500),
|
|
143
|
+
imageSlot: ImageSlotSchema,
|
|
144
|
+
version: z.literal(1),
|
|
145
|
+
})
|
|
146
|
+
.describe('Slide that contains a title, description of the title');
|
|
138
147
|
export type ImageSlideData = z.infer<typeof ImageSlideDataSchema>;
|
|
139
148
|
|
|
140
149
|
export const SectionBreakSlideDataSchema = z.object({
|
|
141
150
|
contentType: z.literal(SLIDE_CONTENT_TYPE.SECTION_BREAK),
|
|
142
151
|
title: z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
143
152
|
description: z.string().describe('Description of the slide in about 6 words').min(10).max(200),
|
|
153
|
+
version: z.literal(1),
|
|
144
154
|
});
|
|
145
155
|
export type SectionBreakSlideData = z.infer<typeof SectionBreakSlideDataSchema>;
|
|
146
156
|
|
|
@@ -168,6 +178,7 @@ export const TableSlideDataSchema = z.object({
|
|
|
168
178
|
hasRowHeaders: z.boolean().describe('If table needs special row headers, set this to true'),
|
|
169
179
|
hasSummaryRow: z.boolean().describe('If table needs a summary row, set this to true'),
|
|
170
180
|
}),
|
|
181
|
+
version: z.literal(1),
|
|
171
182
|
});
|
|
172
183
|
export type TableSlideData = z.infer<typeof TableSlideDataSchema>;
|
|
173
184
|
|
|
@@ -196,6 +207,7 @@ export const BarChartSlideDataSchema = z.object({
|
|
|
196
207
|
.describe('Data series for the chart'),
|
|
197
208
|
yAxisLabel: z.string().max(40).optional().describe('Y-axis label'),
|
|
198
209
|
unit: z.string().max(10).optional().describe('Unit symbol (%, $, etc.)'),
|
|
210
|
+
version: z.literal(1),
|
|
199
211
|
});
|
|
200
212
|
export type BarChartSlideData = z.infer<typeof BarChartSlideDataSchema>;
|
|
201
213
|
|
|
@@ -204,6 +216,7 @@ export const ChartSlideDataSchema = z.object({
|
|
|
204
216
|
title: z.string().describe('Slide title in about 6 words').min(10).max(200),
|
|
205
217
|
description: z.string().describe("Information on slide's topic").min(10).max(400),
|
|
206
218
|
chart: z.discriminatedUnion('type', [BarChartSlideDataSchema]),
|
|
219
|
+
version: z.literal(1),
|
|
207
220
|
});
|
|
208
221
|
export type ChartSlideData = z.infer<typeof ChartSlideDataSchema>;
|
|
209
222
|
|