@purpleschool/gptbot 0.11.6 → 0.11.7

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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreatePresentationCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const presentation_1 = require("../../../models/tools/presentation");
6
+ const constants_1 = require("../../../constants");
6
7
  var CreatePresentationCommand;
7
8
  (function (CreatePresentationCommand) {
8
9
  CreatePresentationCommand.RequestSchema = zod_1.z.object({
@@ -10,6 +11,8 @@ var CreatePresentationCommand;
10
11
  slideCount: zod_1.z.number().min(1).max(20),
11
12
  templateId: zod_1.z.string().uuid(),
12
13
  languageId: zod_1.z.string().uuid(),
14
+ titlePage: presentation_1.PresentationTitlePageSchema.optional().nullable(),
15
+ targetAudience: zod_1.z.nativeEnum(constants_1.PRESENTATION_TARGET_AUDIENCE).optional(),
13
16
  });
14
17
  CreatePresentationCommand.ResponseSchema = zod_1.z.object({
15
18
  data: presentation_1.PresentationSchema,
@@ -11,6 +11,7 @@ var UpdatePresentationCommand;
11
11
  UpdatePresentationCommand.RequestBodySchema = presentation_1.PresentationSchema.pick({
12
12
  title: true,
13
13
  templateId: true,
14
+ titlePage: true,
14
15
  }).partial();
15
16
  UpdatePresentationCommand.ResponseSchema = zod_1.z.object({
16
17
  data: presentation_1.PresentationSchema,
@@ -23,3 +23,4 @@ __exportStar(require("./slide-image-slot-action.enum"), exports);
23
23
  __exportStar(require("./presentation-ai-action-type.enum"), exports);
24
24
  __exportStar(require("./presentation-ai-action-pricing-type.enum"), exports);
25
25
  __exportStar(require("./presentation-ai-action-call-status.enum"), exports);
26
+ __exportStar(require("./presentation-target-audience.enum"), exports);
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRESENTATION_TARGET_AUDIENCE = void 0;
4
+ var PRESENTATION_TARGET_AUDIENCE;
5
+ (function (PRESENTATION_TARGET_AUDIENCE) {
6
+ PRESENTATION_TARGET_AUDIENCE["NONE"] = "NONE";
7
+ PRESENTATION_TARGET_AUDIENCE["SCHOOL"] = "SCHOOL";
8
+ PRESENTATION_TARGET_AUDIENCE["UNIVERSITY"] = "UNIVERSITY";
9
+ PRESENTATION_TARGET_AUDIENCE["BUSINESS"] = "BUSINESS";
10
+ })(PRESENTATION_TARGET_AUDIENCE || (exports.PRESENTATION_TARGET_AUDIENCE = PRESENTATION_TARGET_AUDIENCE = {}));
@@ -22,3 +22,4 @@ __exportStar(require("./slide.schema"), exports);
22
22
  __exportStar(require("./slide-content.schema"), exports);
23
23
  __exportStar(require("./presentation-config.schema"), exports);
24
24
  __exportStar(require("./presentation-ai-action.schema"), exports);
25
+ __exportStar(require("./presentation-title-page.schema"), exports);
@@ -8,6 +8,7 @@ exports.PresentationTemplateSchema = zod_1.z.object({
8
8
  image: zod_1.z.string(),
9
9
  order: zod_1.z.number(),
10
10
  imagePlaceholder: zod_1.z.string(),
11
+ price: zod_1.z.number(),
11
12
  createdAt: zod_1.z.date(),
12
13
  updatedAt: zod_1.z.date(),
13
14
  });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PresentationTitlePageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PresentationTitlePageSchema = zod_1.z.object({
6
+ author: zod_1.z.string().optional().nullable(),
7
+ createdAt: zod_1.z.coerce.date().optional().nullable(),
8
+ email: zod_1.z.string().email().optional().nullable(),
9
+ });
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
5
5
  const constants_1 = require("../../../constants");
6
6
  const slide_outline_schema_1 = require("./slide-outline.schema");
7
7
  const slide_schema_1 = require("./slide.schema");
8
+ const presentation_title_page_schema_1 = require("./presentation-title-page.schema");
8
9
  exports.PresentationSchema = zod_1.z.object({
9
10
  uuid: zod_1.z.string().uuid(),
10
11
  prompt: zod_1.z.string(),
@@ -19,6 +20,8 @@ exports.PresentationSchema = zod_1.z.object({
19
20
  slideCount: zod_1.z.number(),
20
21
  lastContentUpdateAt: zod_1.z.date().nullable(),
21
22
  lastPptxExportedAt: zod_1.z.date().nullable(),
23
+ titlePage: presentation_title_page_schema_1.PresentationTitlePageSchema.nullable(),
24
+ targetAudience: zod_1.z.nativeEnum(constants_1.PRESENTATION_TARGET_AUDIENCE),
22
25
  createdAt: zod_1.z.date(),
23
26
  updatedAt: zod_1.z.date(),
24
27
  });
@@ -10,18 +10,24 @@ const constants_1 = require("../../../constants");
10
10
  exports.CoverSlideDataUserEditSchema = zod_1.default.object({
11
11
  contentType: zod_1.default.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
12
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
- }),
13
+ author: zod_1.default
14
+ .object({
15
+ label: zod_1.default.string().min(1).max(100),
16
+ value: zod_1.default.string().min(1).max(200),
17
+ })
18
+ .optional(),
19
+ date: zod_1.default
20
+ .object({
21
+ label: zod_1.default.string().min(1).max(100),
22
+ value: zod_1.default.string().min(1).max(200),
23
+ })
24
+ .optional(),
25
+ email: zod_1.default
26
+ .object({
27
+ label: zod_1.default.string().min(1).max(100),
28
+ value: zod_1.default.string().min(1).max(200),
29
+ })
30
+ .optional(),
25
31
  version: zod_1.default.literal(1),
26
32
  });
27
33
  exports.ThankYouSlideDataUserEditSchema = zod_1.default.object({
@@ -24,22 +24,26 @@ exports.IconSlotSchema = zod_1.z.object({
24
24
  exports.CoverSlideDataSchema = zod_1.z.object({
25
25
  contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
26
26
  title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
27
- author: zod_1.z.object({
27
+ author: zod_1.z
28
+ .object({
28
29
  label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
29
- value: zod_1.z
30
- .string()
31
- .describe('Literal "Author of the presentation" in presentation\'s language'),
32
- }),
33
- date: zod_1.z.object({
30
+ value: zod_1.z.string().describe('Author value from titlePage if provided'),
31
+ })
32
+ .optional(),
33
+ date: zod_1.z
34
+ .object({
34
35
  label: zod_1.z.string().describe('Literal "Date" in presentation\'s language'),
35
36
  value: zod_1.z
36
37
  .string()
37
- .describe('Date of the presentation in the "dd month yyyy" format in presentation\'s locale'),
38
- }),
39
- email: zod_1.z.object({
40
- label: zod_1.z.string().describe('Just default word "Email"'),
41
- value: zod_1.z.string().describe('Just default "email@example.com"'),
42
- }),
38
+ .describe('Date from titlePage in the "dd month yyyy" format in presentation\'s locale'),
39
+ })
40
+ .optional(),
41
+ email: zod_1.z
42
+ .object({
43
+ label: zod_1.z.string().describe('Localized contact/email label'),
44
+ value: zod_1.z.string().describe('Email value from titlePage if provided'),
45
+ })
46
+ .optional(),
43
47
  version: zod_1.z.literal(1),
44
48
  });
45
49
  exports.ThankYouSlideDataSchema = zod_1.z.object({
@@ -1,5 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { PresentationSchema } from '../../../models/tools/presentation';
2
+ import {
3
+ PresentationSchema,
4
+ PresentationTitlePageSchema,
5
+ } from '../../../models/tools/presentation';
6
+ import { PRESENTATION_TARGET_AUDIENCE } from '../../../constants';
3
7
 
4
8
  export namespace CreatePresentationCommand {
5
9
  export const RequestSchema = z.object({
@@ -7,6 +11,8 @@ export namespace CreatePresentationCommand {
7
11
  slideCount: z.number().min(1).max(20),
8
12
  templateId: z.string().uuid(),
9
13
  languageId: z.string().uuid(),
14
+ titlePage: PresentationTitlePageSchema.optional().nullable(),
15
+ targetAudience: z.nativeEnum(PRESENTATION_TARGET_AUDIENCE).optional(),
10
16
  });
11
17
 
12
18
  export type Request = z.infer<typeof RequestSchema>;
@@ -10,6 +10,7 @@ export namespace UpdatePresentationCommand {
10
10
  export const RequestBodySchema = PresentationSchema.pick({
11
11
  title: true,
12
12
  templateId: true,
13
+ titlePage: true,
13
14
  }).partial();
14
15
  export type Request = z.infer<typeof RequestBodySchema>;
15
16
 
@@ -7,3 +7,4 @@ export * from './slide-image-slot-action.enum';
7
7
  export * from './presentation-ai-action-type.enum';
8
8
  export * from './presentation-ai-action-pricing-type.enum';
9
9
  export * from './presentation-ai-action-call-status.enum';
10
+ export * from './presentation-target-audience.enum';
@@ -0,0 +1,6 @@
1
+ export enum PRESENTATION_TARGET_AUDIENCE {
2
+ NONE = 'NONE',
3
+ SCHOOL = 'SCHOOL',
4
+ UNIVERSITY = 'UNIVERSITY',
5
+ BUSINESS = 'BUSINESS',
6
+ }
@@ -6,3 +6,4 @@ export * from './slide.schema';
6
6
  export * from './slide-content.schema';
7
7
  export * from './presentation-config.schema';
8
8
  export * from './presentation-ai-action.schema';
9
+ export * from './presentation-title-page.schema';
@@ -6,6 +6,7 @@ export const PresentationTemplateSchema = z.object({
6
6
  image: z.string(),
7
7
  order: z.number(),
8
8
  imagePlaceholder: z.string(),
9
+ price: z.number(),
9
10
  createdAt: z.date(),
10
11
  updatedAt: z.date(),
11
12
  });
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+
3
+ export const PresentationTitlePageSchema = z.object({
4
+ author: z.string().optional().nullable(),
5
+ createdAt: z.coerce.date().optional().nullable(),
6
+ email: z.string().email().optional().nullable(),
7
+ });
8
+
9
+ export type PresentationTitlePage = z.infer<typeof PresentationTitlePageSchema>;
@@ -1,7 +1,12 @@
1
1
  import { z } from 'zod';
2
- import { PRESENTATION_STAGE, USER_REACTION } from '../../../constants';
2
+ import {
3
+ PRESENTATION_STAGE,
4
+ PRESENTATION_TARGET_AUDIENCE,
5
+ USER_REACTION,
6
+ } from '../../../constants';
3
7
  import { SlideOutlineSchema } from './slide-outline.schema';
4
8
  import { SlideSchema } from './slide.schema';
9
+ import { PresentationTitlePageSchema } from './presentation-title-page.schema';
5
10
 
6
11
  export const PresentationSchema = z.object({
7
12
  uuid: z.string().uuid(),
@@ -17,6 +22,8 @@ export const PresentationSchema = z.object({
17
22
  slideCount: z.number(),
18
23
  lastContentUpdateAt: z.date().nullable(),
19
24
  lastPptxExportedAt: z.date().nullable(),
25
+ titlePage: PresentationTitlePageSchema.nullable(),
26
+ targetAudience: z.nativeEnum(PRESENTATION_TARGET_AUDIENCE),
20
27
  createdAt: z.date(),
21
28
  updatedAt: z.date(),
22
29
  });
@@ -19,18 +19,24 @@ import { SLIDE_CONTENT_TYPE } from '../../../constants';
19
19
  export const CoverSlideDataUserEditSchema = z.object({
20
20
  contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
21
21
  title: z.string().max(1000),
22
- author: z.object({
23
- label: z.string().max(200),
24
- value: z.string().max(500),
25
- }),
26
- date: z.object({
27
- label: z.string().max(200),
28
- value: z.string().max(500),
29
- }),
30
- email: z.object({
31
- label: z.string().max(200),
32
- value: z.string().max(500),
33
- }),
22
+ author: z
23
+ .object({
24
+ label: z.string().min(1).max(100),
25
+ value: z.string().min(1).max(200),
26
+ })
27
+ .optional(),
28
+ date: z
29
+ .object({
30
+ label: z.string().min(1).max(100),
31
+ value: z.string().min(1).max(200),
32
+ })
33
+ .optional(),
34
+ email: z
35
+ .object({
36
+ label: z.string().min(1).max(100),
37
+ value: z.string().min(1).max(200),
38
+ })
39
+ .optional(),
34
40
  version: z.literal(1),
35
41
  }) satisfies z.ZodType<ICoverSlideDataStructure>;
36
42
 
@@ -26,9 +26,9 @@ export type IconSlot = z.infer<typeof IconSlotSchema>;
26
26
  export interface ICoverSlideDataStructure {
27
27
  contentType: SLIDE_CONTENT_TYPE.COVER;
28
28
  title: string;
29
- author: { label: string; value: string };
30
- date: { label: string; value: string };
31
- email: { label: string; value: string };
29
+ author?: { label: string; value: string };
30
+ date?: { label: string; value: string };
31
+ email?: { label: string; value: string };
32
32
  version: 1;
33
33
  }
34
34
 
@@ -125,24 +125,28 @@ export interface ITimelineSlideDataStructure {
125
125
  export const CoverSlideDataSchema = z.object({
126
126
  contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
127
127
  title: z.string().describe('Slide title in about 6 words').min(10).max(150),
128
- author: z.object({
129
- label: z.string().describe('Literal "Author" in presentation\'s language'),
130
- value: z
131
- .string()
132
- .describe('Literal "Author of the presentation" in presentation\'s language'),
133
- }),
134
- date: z.object({
135
- label: z.string().describe('Literal "Date" in presentation\'s language'),
136
- value: z
137
- .string()
138
- .describe(
139
- 'Date of the presentation in the "dd month yyyy" format in presentation\'s locale',
140
- ),
141
- }),
142
- email: z.object({
143
- label: z.string().describe('Just default word "Email"'),
144
- value: z.string().describe('Just default "email@example.com"'),
145
- }),
128
+ author: z
129
+ .object({
130
+ label: z.string().describe('Literal "Author" in presentation\'s language'),
131
+ value: z.string().describe('Author value from titlePage if provided'),
132
+ })
133
+ .optional(),
134
+ date: z
135
+ .object({
136
+ label: z.string().describe('Literal "Date" in presentation\'s language'),
137
+ value: z
138
+ .string()
139
+ .describe(
140
+ 'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
141
+ ),
142
+ })
143
+ .optional(),
144
+ email: z
145
+ .object({
146
+ label: z.string().describe('Localized contact/email label'),
147
+ value: z.string().describe('Email value from titlePage if provided'),
148
+ })
149
+ .optional(),
146
150
  version: z.literal(1),
147
151
  }) satisfies z.ZodType<ICoverSlideDataStructure>;
148
152
  export type CoverSlideData = z.infer<typeof CoverSlideDataSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.11.6",
3
+ "version": "0.11.7",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",