@purpleschool/gptbot 0.15.93 → 0.16.0-stage-2

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 (77) hide show
  1. package/build/api/controllers/http/consent.d.ts +4 -0
  2. package/build/api/controllers/http/consent.js +7 -0
  3. package/build/api/controllers/http/html-page-builder.d.ts +8 -0
  4. package/build/api/controllers/http/html-page-builder.js +11 -0
  5. package/build/api/controllers/http/index.d.ts +1 -0
  6. package/build/api/controllers/http/index.js +1 -0
  7. package/build/api/routes.d.ts +18 -0
  8. package/build/api/routes.js +18 -0
  9. package/build/commands/ai-studio/canvas-node/find-canvas-node-definitions-with-configs.query.d.ts +98 -0
  10. package/build/commands/cookie-consent/acknowledge-cookie-consent.command.d.ts +10 -0
  11. package/build/commands/cookie-consent/acknowledge-cookie-consent.command.js +27 -0
  12. package/build/commands/cookie-consent/index.d.ts +1 -0
  13. package/build/commands/cookie-consent/index.js +17 -0
  14. package/build/commands/index.d.ts +1 -0
  15. package/build/commands/index.js +1 -0
  16. package/build/commands/tools/html-page-builder/answer-html-page-builder-questions.command.d.ts +126 -0
  17. package/build/commands/tools/html-page-builder/answer-html-page-builder-questions.command.js +24 -0
  18. package/build/commands/tools/html-page-builder/execute-html-page-builder.command.d.ts +71 -3
  19. package/build/commands/tools/html-page-builder/execute-html-page-builder.command.js +17 -0
  20. package/build/commands/tools/html-page-builder/find-html-page-builder-font-by-uuid.command.d.ts +31 -0
  21. package/build/commands/tools/html-page-builder/find-html-page-builder-font-by-uuid.command.js +14 -0
  22. package/build/commands/tools/html-page-builder/find-html-page-builder-fonts.command.d.ts +38 -0
  23. package/build/commands/tools/html-page-builder/find-html-page-builder-fonts.command.js +30 -0
  24. package/build/commands/tools/html-page-builder/find-html-page-builder-presets.command.d.ts +70 -0
  25. package/build/commands/tools/html-page-builder/find-html-page-builder-presets.command.js +18 -0
  26. package/build/commands/tools/html-page-builder/find-html-page-builder-session-by-uuid.command.d.ts +63 -3
  27. package/build/commands/tools/html-page-builder/find-html-page-builder-sessions.command.d.ts +66 -6
  28. package/build/commands/tools/html-page-builder/find-html-page-builder-sessions.command.js +1 -1
  29. package/build/commands/tools/html-page-builder/find-html-page-builder-style-by-uuid.command.d.ts +23 -0
  30. package/build/commands/tools/html-page-builder/find-html-page-builder-style-by-uuid.command.js +14 -0
  31. package/build/commands/tools/html-page-builder/find-html-page-builder-styles.command.d.ts +30 -0
  32. package/build/commands/tools/html-page-builder/find-html-page-builder-styles.command.js +30 -0
  33. package/build/commands/tools/html-page-builder/get-html-page-builder-price.command.d.ts +10 -0
  34. package/build/commands/tools/html-page-builder/get-html-page-builder-price.command.js +17 -1
  35. package/build/commands/tools/html-page-builder/get-html-page-builder-tool-config.command.d.ts +98 -0
  36. package/build/commands/tools/html-page-builder/get-shared-html-page-builder-site.command.d.ts +14 -0
  37. package/build/commands/tools/html-page-builder/get-shared-html-page-builder-site.command.js +18 -0
  38. package/build/commands/tools/html-page-builder/index.d.ts +8 -0
  39. package/build/commands/tools/html-page-builder/index.js +8 -0
  40. package/build/commands/tools/html-page-builder/update-html-page-builder-session-favorite.command.d.ts +63 -3
  41. package/build/commands/tools/html-page-builder/update-html-page-builder-session-reaction.command.d.ts +124 -0
  42. package/build/commands/tools/html-page-builder/update-html-page-builder-session-reaction.command.js +32 -0
  43. package/build/commands/tools/html-page-builder/update-html-page-builder-session-title.command.d.ts +63 -3
  44. package/build/constants/tool-html-page-builder/enums/html-page-builder-catalog-sort.enum.d.ts +4 -0
  45. package/build/constants/tool-html-page-builder/enums/html-page-builder-catalog-sort.enum.js +8 -0
  46. package/build/constants/tool-html-page-builder/enums/html-page-builder-font-tag.enum.d.ts +5 -0
  47. package/build/constants/tool-html-page-builder/enums/html-page-builder-font-tag.enum.js +9 -0
  48. package/build/constants/tool-html-page-builder/enums/html-page-builder-question-type.enum.d.ts +12 -0
  49. package/build/constants/tool-html-page-builder/enums/html-page-builder-question-type.enum.js +16 -0
  50. package/build/constants/tool-html-page-builder/enums/html-page-builder-session-status.enum.d.ts +18 -0
  51. package/build/constants/tool-html-page-builder/enums/html-page-builder-session-status.enum.js +22 -0
  52. package/build/constants/tool-html-page-builder/enums/html-page-builder-style-tag.enum.d.ts +8 -0
  53. package/build/constants/tool-html-page-builder/enums/html-page-builder-style-tag.enum.js +12 -0
  54. package/build/constants/tool-html-page-builder/enums/index.d.ts +5 -1
  55. package/build/constants/tool-html-page-builder/enums/index.js +5 -1
  56. package/build/models/canvas-node-definition.schema.d.ts +294 -0
  57. package/build/models/tools/html-page-builder/html-page-builder-clarification.schema.d.ts +39 -0
  58. package/build/models/tools/html-page-builder/html-page-builder-clarification.schema.js +31 -0
  59. package/build/models/tools/html-page-builder/html-page-builder-config.schema.d.ts +109 -0
  60. package/build/models/tools/html-page-builder/html-page-builder-config.schema.js +18 -1
  61. package/build/models/tools/html-page-builder/html-page-builder-font.schema.d.ts +24 -0
  62. package/build/models/tools/html-page-builder/html-page-builder-font.schema.js +18 -0
  63. package/build/models/tools/html-page-builder/html-page-builder-job.schema.d.ts +76 -3
  64. package/build/models/tools/html-page-builder/html-page-builder-job.schema.js +42 -3
  65. package/build/models/tools/html-page-builder/html-page-builder-page.schema.d.ts +30 -0
  66. package/build/models/tools/html-page-builder/html-page-builder-page.schema.js +18 -0
  67. package/build/models/tools/html-page-builder/html-page-builder-preset.schema.d.ts +58 -0
  68. package/build/models/tools/html-page-builder/html-page-builder-preset.schema.js +22 -0
  69. package/build/models/tools/html-page-builder/html-page-builder-session.schema.d.ts +65 -5
  70. package/build/models/tools/html-page-builder/html-page-builder-session.schema.js +12 -1
  71. package/build/models/tools/html-page-builder/html-page-builder-style.schema.d.ts +16 -0
  72. package/build/models/tools/html-page-builder/html-page-builder-style.schema.js +18 -0
  73. package/build/models/tools/html-page-builder/index.d.ts +5 -0
  74. package/build/models/tools/html-page-builder/index.js +5 -0
  75. package/package.json +1 -1
  76. package/build/constants/tool-html-page-builder/enums/html-page-builder-session-stage.enum.d.ts +0 -4
  77. package/build/constants/tool-html-page-builder/enums/html-page-builder-session-stage.enum.js +0 -8
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { TOOL_JOB_STATUS, USER_REACTION } from '../../../constants';
2
+ import { TOOL_JOB_STATUS } from '../../../constants';
3
3
  export declare const HtmlPageBuilderJobParamsSchema: z.ZodObject<{
4
4
  attachedFiles: z.ZodArray<z.ZodObject<{
5
5
  uuid: z.ZodString;
@@ -12,8 +12,26 @@ export declare const HtmlPageBuilderJobParamsSchema: z.ZodObject<{
12
12
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
13
13
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
14
14
  }, z.core.$strip>>;
15
+ pagesCount: z.ZodOptional<z.ZodNumber>;
16
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
17
+ question: z.ZodString;
18
+ answer: z.ZodString;
19
+ }, z.core.$strip>>>;
15
20
  }, z.core.$strip>;
16
21
  export type HtmlPageBuilderJobParams = z.infer<typeof HtmlPageBuilderJobParamsSchema>;
22
+ /**
23
+ * Addresses of the published files of this generation, for reading the source as files rather than
24
+ * as one inlined document. Empty when the upload did not happen — the site itself is unaffected.
25
+ */
26
+ export declare const HtmlPageBuilderJobFilesSchema: z.ZodObject<{
27
+ stylesheet: z.ZodString;
28
+ script: z.ZodString;
29
+ pages: z.ZodArray<z.ZodObject<{
30
+ slug: z.ZodString;
31
+ url: z.ZodString;
32
+ }, z.core.$strip>>;
33
+ }, z.core.$strip>;
34
+ export type HtmlPageBuilderJobFiles = z.infer<typeof HtmlPageBuilderJobFilesSchema>;
17
35
  export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
18
36
  uuid: z.ZodUUID;
19
37
  sessionId: z.ZodUUID;
@@ -21,11 +39,40 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
21
39
  userPrompt: z.ZodString;
22
40
  title: z.ZodString;
23
41
  generatedHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ generatedPages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
43
+ slug: z.ZodString;
44
+ title: z.ZodString;
45
+ html: z.ZodString;
46
+ order: z.ZodNumber;
47
+ isHome: z.ZodBoolean;
48
+ }, z.core.$strip>>>>;
49
+ previewUrl: z.ZodOptional<z.ZodString>;
50
+ files: z.ZodOptional<z.ZodObject<{
51
+ stylesheet: z.ZodString;
52
+ script: z.ZodString;
53
+ pages: z.ZodArray<z.ZodObject<{
54
+ slug: z.ZodString;
55
+ url: z.ZodString;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>>;
24
58
  status: z.ZodEnum<typeof TOOL_JOB_STATUS>;
25
59
  error: z.ZodNullable<z.ZodString>;
26
60
  price: z.ZodNumber;
27
- reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
28
- dislikeReason: z.ZodNullable<z.ZodString>;
61
+ questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ question: z.ZodString;
64
+ type: z.ZodEnum<typeof import("../../..").HTML_PAGE_BUILDER_QUESTION_TYPE>;
65
+ options: z.ZodArray<z.ZodString>;
66
+ recommendedAnswer: z.ZodString;
67
+ allowCustomAnswer: z.ZodBoolean;
68
+ }, z.core.$strip>>>;
69
+ answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
70
+ questionId: z.ZodString;
71
+ answers: z.ZodArray<z.ZodString>;
72
+ }, z.core.$strip>>>;
73
+ styleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
74
+ fontId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
75
+ accentColor: z.ZodDefault<z.ZodString>;
29
76
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
30
77
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
31
78
  params: z.ZodObject<{
@@ -40,6 +87,11 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
40
87
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
41
88
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
42
89
  }, z.core.$strip>>;
90
+ pagesCount: z.ZodOptional<z.ZodNumber>;
91
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
92
+ question: z.ZodString;
93
+ answer: z.ZodString;
94
+ }, z.core.$strip>>>;
43
95
  }, z.core.$strip>;
44
96
  isDeleted: z.ZodBoolean;
45
97
  createdAt: z.ZodDate;
@@ -47,3 +99,24 @@ export declare const HtmlPageBuilderJobSchema: z.ZodObject<{
47
99
  updatedAt: z.ZodDate;
48
100
  }, z.core.$strip>;
49
101
  export type HtmlPageBuilderJob = z.infer<typeof HtmlPageBuilderJobSchema>;
102
+ /**
103
+ * The generation a session points at, as the list of sites needs it: the address and the state,
104
+ * without the site itself. A list of twenty sessions must not carry twenty sites.
105
+ */
106
+ export declare const HtmlPageBuilderCurrentJobSchema: z.ZodObject<{
107
+ uuid: z.ZodUUID;
108
+ status: z.ZodEnum<typeof TOOL_JOB_STATUS>;
109
+ previewUrl: z.ZodOptional<z.ZodString>;
110
+ files: z.ZodOptional<z.ZodObject<{
111
+ stylesheet: z.ZodString;
112
+ script: z.ZodString;
113
+ pages: z.ZodArray<z.ZodObject<{
114
+ slug: z.ZodString;
115
+ url: z.ZodString;
116
+ }, z.core.$strip>>;
117
+ }, z.core.$strip>>;
118
+ error: z.ZodNullable<z.ZodString>;
119
+ createdAt: z.ZodDate;
120
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
121
+ }, z.core.$strip>;
122
+ export type HtmlPageBuilderCurrentJob = z.infer<typeof HtmlPageBuilderCurrentJobSchema>;
@@ -1,11 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HtmlPageBuilderJobSchema = exports.HtmlPageBuilderJobParamsSchema = void 0;
3
+ exports.HtmlPageBuilderCurrentJobSchema = exports.HtmlPageBuilderJobSchema = exports.HtmlPageBuilderJobFilesSchema = exports.HtmlPageBuilderJobParamsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../../../constants");
6
6
  const common_1 = require("../common");
7
+ const html_page_builder_clarification_schema_1 = require("./html-page-builder-clarification.schema");
8
+ const html_page_builder_page_schema_1 = require("./html-page-builder-page.schema");
7
9
  exports.HtmlPageBuilderJobParamsSchema = zod_1.z.object({
8
10
  attachedFiles: zod_1.z.array(common_1.AttachedToolFileSchema),
11
+ pagesCount: zod_1.z.number().int().positive().optional(),
12
+ clarifications: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationBriefSchema.default([]),
13
+ });
14
+ /**
15
+ * Addresses of the published files of this generation, for reading the source as files rather than
16
+ * as one inlined document. Empty when the upload did not happen — the site itself is unaffected.
17
+ */
18
+ exports.HtmlPageBuilderJobFilesSchema = zod_1.z.object({
19
+ // Shared stylesheet of the site; empty for a single-page result that keeps its CSS inline
20
+ stylesheet: zod_1.z.string(),
21
+ // Shared script of the site; empty when the site has no JS
22
+ script: zod_1.z.string(),
23
+ pages: zod_1.z.array(zod_1.z.object({ slug: zod_1.z.string(), url: zod_1.z.string() })),
9
24
  });
10
25
  exports.HtmlPageBuilderJobSchema = zod_1.z.object({
11
26
  uuid: zod_1.z.uuid(),
@@ -14,11 +29,22 @@ exports.HtmlPageBuilderJobSchema = zod_1.z.object({
14
29
  userPrompt: zod_1.z.string(),
15
30
  title: zod_1.z.string(),
16
31
  generatedHtml: zod_1.z.string().nullable().optional(),
32
+ generatedPages: html_page_builder_page_schema_1.HtmlPageBuilderGeneratedPagesSchema.nullable().optional(),
33
+ /** Public URL of the home page of this generation, ready to be opened in an iframe */
34
+ previewUrl: zod_1.z.string().optional(),
35
+ /** The same publication read as separate files */
36
+ files: exports.HtmlPageBuilderJobFilesSchema.optional(),
17
37
  status: zod_1.z.enum(constants_1.TOOL_JOB_STATUS),
18
38
  error: zod_1.z.string().nullable(),
19
39
  price: zod_1.z.number(),
20
- reaction: zod_1.z.enum(constants_1.USER_REACTION).nullable(),
21
- dislikeReason: zod_1.z.string().nullable(),
40
+ /** Questions the model asked before this generation */
41
+ questions: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationQuestionsSchema.default([]),
42
+ /** What the user answered; empty is legal — skipped questions fall back to the recommendation */
43
+ answers: html_page_builder_clarification_schema_1.HtmlPageBuilderClarificationAnswersSchema.default([]),
44
+ /** Design this generation was made with; the prompts behind style and font stay in the tool */
45
+ styleId: zod_1.z.string().nullable().optional(),
46
+ fontId: zod_1.z.string().nullable().optional(),
47
+ accentColor: zod_1.z.string().default(''),
22
48
  userId: zod_1.z.string().nullable().optional(),
23
49
  unregisteredUserId: zod_1.z.string().nullable().optional(),
24
50
  params: exports.HtmlPageBuilderJobParamsSchema,
@@ -27,3 +53,16 @@ exports.HtmlPageBuilderJobSchema = zod_1.z.object({
27
53
  completedAt: zod_1.z.date().nullable().optional(),
28
54
  updatedAt: zod_1.z.date(),
29
55
  });
56
+ /**
57
+ * The generation a session points at, as the list of sites needs it: the address and the state,
58
+ * without the site itself. A list of twenty sessions must not carry twenty sites.
59
+ */
60
+ exports.HtmlPageBuilderCurrentJobSchema = zod_1.z.object({
61
+ uuid: zod_1.z.uuid(),
62
+ status: zod_1.z.enum(constants_1.TOOL_JOB_STATUS),
63
+ previewUrl: zod_1.z.string().optional(),
64
+ files: exports.HtmlPageBuilderJobFilesSchema.optional(),
65
+ error: zod_1.z.string().nullable(),
66
+ createdAt: zod_1.z.date(),
67
+ completedAt: zod_1.z.date().nullable().optional(),
68
+ });
@@ -0,0 +1,30 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A page of a site. Pages are not stored on their own: a site is the snapshot held by the
4
+ * generation the session points at, so a page has no identity of its own and no timestamps —
5
+ * the job it belongs to is the version.
6
+ */
7
+ export declare const HtmlPageBuilderPageSchema: z.ZodObject<{
8
+ slug: z.ZodString;
9
+ title: z.ZodString;
10
+ html: z.ZodString;
11
+ order: z.ZodNumber;
12
+ isHome: z.ZodBoolean;
13
+ }, z.core.$strip>;
14
+ export type HtmlPageBuilderPage = z.infer<typeof HtmlPageBuilderPageSchema>;
15
+ export declare const HtmlPageBuilderGeneratedPageSchema: z.ZodObject<{
16
+ slug: z.ZodString;
17
+ title: z.ZodString;
18
+ html: z.ZodString;
19
+ order: z.ZodNumber;
20
+ isHome: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ export type HtmlPageBuilderGeneratedPage = z.infer<typeof HtmlPageBuilderGeneratedPageSchema>;
23
+ export declare const HtmlPageBuilderGeneratedPagesSchema: z.ZodArray<z.ZodObject<{
24
+ slug: z.ZodString;
25
+ title: z.ZodString;
26
+ html: z.ZodString;
27
+ order: z.ZodNumber;
28
+ isHome: z.ZodBoolean;
29
+ }, z.core.$strip>>;
30
+ export type HtmlPageBuilderGeneratedPages = z.infer<typeof HtmlPageBuilderGeneratedPagesSchema>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderGeneratedPagesSchema = exports.HtmlPageBuilderGeneratedPageSchema = exports.HtmlPageBuilderPageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * A page of a site. Pages are not stored on their own: a site is the snapshot held by the
7
+ * generation the session points at, so a page has no identity of its own and no timestamps —
8
+ * the job it belongs to is the version.
9
+ */
10
+ exports.HtmlPageBuilderPageSchema = zod_1.z.object({
11
+ slug: zod_1.z.string(),
12
+ title: zod_1.z.string(),
13
+ html: zod_1.z.string(),
14
+ order: zod_1.z.number(),
15
+ isHome: zod_1.z.boolean(),
16
+ });
17
+ exports.HtmlPageBuilderGeneratedPageSchema = exports.HtmlPageBuilderPageSchema;
18
+ exports.HtmlPageBuilderGeneratedPagesSchema = zod_1.z.array(exports.HtmlPageBuilderGeneratedPageSchema);
@@ -0,0 +1,58 @@
1
+ import { z } from 'zod';
2
+ export declare const HtmlPageBuilderPresetSchema: z.ZodObject<{
3
+ uuid: z.ZodUUID;
4
+ code: z.ZodString;
5
+ title: z.ZodString;
6
+ prompt: z.ZodString;
7
+ icons: z.ZodObject<{
8
+ light: z.ZodObject<{
9
+ svg: z.ZodString;
10
+ png: z.ZodString;
11
+ }, z.core.$strip>;
12
+ dark: z.ZodObject<{
13
+ svg: z.ZodString;
14
+ png: z.ZodString;
15
+ }, z.core.$strip>;
16
+ }, z.core.$strip>;
17
+ styleId: z.ZodUUID;
18
+ fontId: z.ZodUUID;
19
+ style: z.ZodOptional<z.ZodObject<{
20
+ uuid: z.ZodUUID;
21
+ code: z.ZodString;
22
+ title: z.ZodString;
23
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ previewUrl: z.ZodString;
25
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ tags: z.ZodArray<z.ZodEnum<typeof import("../../..").HTML_PAGE_BUILDER_STYLE_TAG>>;
27
+ popularity: z.ZodNumber;
28
+ order: z.ZodNumber;
29
+ createdAt: z.ZodCoercedDate<unknown>;
30
+ updatedAt: z.ZodCoercedDate<unknown>;
31
+ }, z.core.$strip>>;
32
+ font: z.ZodOptional<z.ZodObject<{
33
+ uuid: z.ZodUUID;
34
+ code: z.ZodString;
35
+ title: z.ZodString;
36
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ icons: z.ZodObject<{
38
+ light: z.ZodObject<{
39
+ svg: z.ZodString;
40
+ png: z.ZodString;
41
+ }, z.core.$strip>;
42
+ dark: z.ZodObject<{
43
+ svg: z.ZodString;
44
+ png: z.ZodString;
45
+ }, z.core.$strip>;
46
+ }, z.core.$strip>;
47
+ tags: z.ZodArray<z.ZodEnum<typeof import("../../..").HTML_PAGE_BUILDER_FONT_TAG>>;
48
+ popularity: z.ZodNumber;
49
+ order: z.ZodNumber;
50
+ createdAt: z.ZodCoercedDate<unknown>;
51
+ updatedAt: z.ZodCoercedDate<unknown>;
52
+ }, z.core.$strip>>;
53
+ pagesCount: z.ZodNumber;
54
+ order: z.ZodNumber;
55
+ createdAt: z.ZodCoercedDate<unknown>;
56
+ updatedAt: z.ZodCoercedDate<unknown>;
57
+ }, z.core.$strip>;
58
+ export type HtmlPageBuilderPreset = z.infer<typeof HtmlPageBuilderPresetSchema>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderPresetSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ const html_page_builder_font_schema_1 = require("./html-page-builder-font.schema");
7
+ const html_page_builder_style_schema_1 = require("./html-page-builder-style.schema");
8
+ exports.HtmlPageBuilderPresetSchema = zod_1.z.object({
9
+ uuid: zod_1.z.uuid(),
10
+ code: zod_1.z.string(),
11
+ title: zod_1.z.string(),
12
+ prompt: zod_1.z.string(),
13
+ icons: icon_variants_schema_1.IconVariantsSchema,
14
+ styleId: zod_1.z.uuid(),
15
+ fontId: zod_1.z.uuid(),
16
+ style: html_page_builder_style_schema_1.HtmlPageBuilderStyleSchema.optional(),
17
+ font: html_page_builder_font_schema_1.HtmlPageBuilderFontSchema.optional(),
18
+ pagesCount: zod_1.z.number(),
19
+ order: zod_1.z.number(),
20
+ createdAt: zod_1.z.coerce.date(),
21
+ updatedAt: zod_1.z.coerce.date(),
22
+ });
@@ -1,11 +1,30 @@
1
1
  import { z } from 'zod';
2
- import { TOOL_JOB_STATUS } from '../../../constants';
2
+ import { HTML_PAGE_BUILDER_SESSION_STATUS, USER_REACTION } from '../../../constants';
3
3
  export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
4
4
  uuid: z.ZodUUID;
5
5
  title: z.ZodString;
6
- status: z.ZodEnum<typeof TOOL_JOB_STATUS>;
6
+ status: z.ZodEnum<typeof HTML_PAGE_BUILDER_SESSION_STATUS>;
7
7
  currentHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ currentJobId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ currentJob: z.ZodOptional<z.ZodNullable<z.ZodObject<{
10
+ uuid: z.ZodUUID;
11
+ status: z.ZodEnum<typeof import("../../..").TOOL_JOB_STATUS>;
12
+ previewUrl: z.ZodOptional<z.ZodString>;
13
+ files: z.ZodOptional<z.ZodObject<{
14
+ stylesheet: z.ZodString;
15
+ script: z.ZodString;
16
+ pages: z.ZodArray<z.ZodObject<{
17
+ slug: z.ZodString;
18
+ url: z.ZodString;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>>;
21
+ error: z.ZodNullable<z.ZodString>;
22
+ createdAt: z.ZodDate;
23
+ completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
24
+ }, z.core.$strip>>>;
8
25
  lastUsedModelId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
26
+ reaction: z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>;
27
+ dislikeReason: z.ZodNullable<z.ZodString>;
9
28
  jobs: z.ZodArray<z.ZodObject<{
10
29
  uuid: z.ZodUUID;
11
30
  sessionId: z.ZodUUID;
@@ -13,11 +32,40 @@ export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
13
32
  userPrompt: z.ZodString;
14
33
  title: z.ZodString;
15
34
  generatedHtml: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
- status: z.ZodEnum<typeof TOOL_JOB_STATUS>;
35
+ generatedPages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
36
+ slug: z.ZodString;
37
+ title: z.ZodString;
38
+ html: z.ZodString;
39
+ order: z.ZodNumber;
40
+ isHome: z.ZodBoolean;
41
+ }, z.core.$strip>>>>;
42
+ previewUrl: z.ZodOptional<z.ZodString>;
43
+ files: z.ZodOptional<z.ZodObject<{
44
+ stylesheet: z.ZodString;
45
+ script: z.ZodString;
46
+ pages: z.ZodArray<z.ZodObject<{
47
+ slug: z.ZodString;
48
+ url: z.ZodString;
49
+ }, z.core.$strip>>;
50
+ }, z.core.$strip>>;
51
+ status: z.ZodEnum<typeof import("../../..").TOOL_JOB_STATUS>;
17
52
  error: z.ZodNullable<z.ZodString>;
18
53
  price: z.ZodNumber;
19
- reaction: z.ZodNullable<z.ZodEnum<typeof import("../../..").USER_REACTION>>;
20
- dislikeReason: z.ZodNullable<z.ZodString>;
54
+ questions: z.ZodDefault<z.ZodArray<z.ZodObject<{
55
+ id: z.ZodString;
56
+ question: z.ZodString;
57
+ type: z.ZodEnum<typeof import("../../..").HTML_PAGE_BUILDER_QUESTION_TYPE>;
58
+ options: z.ZodArray<z.ZodString>;
59
+ recommendedAnswer: z.ZodString;
60
+ allowCustomAnswer: z.ZodBoolean;
61
+ }, z.core.$strip>>>;
62
+ answers: z.ZodDefault<z.ZodArray<z.ZodObject<{
63
+ questionId: z.ZodString;
64
+ answers: z.ZodArray<z.ZodString>;
65
+ }, z.core.$strip>>>;
66
+ styleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
67
+ fontId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
68
+ accentColor: z.ZodDefault<z.ZodString>;
21
69
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
22
70
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
23
71
  params: z.ZodObject<{
@@ -32,12 +80,24 @@ export declare const HtmlPageBuilderSessionSchema: z.ZodObject<{
32
80
  content: z.ZodNullable<z.ZodOptional<z.ZodString>>;
33
81
  contentLength: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
34
82
  }, z.core.$strip>>;
83
+ pagesCount: z.ZodOptional<z.ZodNumber>;
84
+ clarifications: z.ZodDefault<z.ZodArray<z.ZodObject<{
85
+ question: z.ZodString;
86
+ answer: z.ZodString;
87
+ }, z.core.$strip>>>;
35
88
  }, z.core.$strip>;
36
89
  isDeleted: z.ZodBoolean;
37
90
  createdAt: z.ZodDate;
38
91
  completedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
39
92
  updatedAt: z.ZodDate;
40
93
  }, z.core.$strip>>;
94
+ pages: z.ZodArray<z.ZodObject<{
95
+ slug: z.ZodString;
96
+ title: z.ZodString;
97
+ html: z.ZodString;
98
+ order: z.ZodNumber;
99
+ isHome: z.ZodBoolean;
100
+ }, z.core.$strip>>;
41
101
  userId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
102
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
103
  isFavorite: z.ZodBoolean;
@@ -4,13 +4,24 @@ exports.HtmlPageBuilderSessionSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../../../constants");
6
6
  const html_page_builder_job_schema_1 = require("./html-page-builder-job.schema");
7
+ const html_page_builder_page_schema_1 = require("./html-page-builder-page.schema");
7
8
  exports.HtmlPageBuilderSessionSchema = zod_1.z.object({
8
9
  uuid: zod_1.z.uuid(),
9
10
  title: zod_1.z.string(),
10
- status: zod_1.z.enum(constants_1.TOOL_JOB_STATUS),
11
+ /** The only progress signal the client has: it polls the session and renders the phase */
12
+ status: zod_1.z.enum(constants_1.HTML_PAGE_BUILDER_SESSION_STATUS),
13
+ /** @deprecated use `pages` — kept as the HTML of the home page for canvas consumers */
11
14
  currentHtml: zod_1.z.string().nullable().optional(),
15
+ /** The generation currently on screen; `pages` is its snapshot */
16
+ currentJobId: zod_1.z.string().nullable().optional(),
17
+ /** Address and state of that generation, without the site itself — what a list of sites needs */
18
+ currentJob: html_page_builder_job_schema_1.HtmlPageBuilderCurrentJobSchema.nullable().optional(),
12
19
  lastUsedModelId: zod_1.z.uuid().nullable().optional(),
20
+ /** How the user rates this site; on the session, next to `isFavorite` */
21
+ reaction: zod_1.z.enum(constants_1.USER_REACTION).nullable(),
22
+ dislikeReason: zod_1.z.string().nullable(),
13
23
  jobs: zod_1.z.array(html_page_builder_job_schema_1.HtmlPageBuilderJobSchema),
24
+ pages: zod_1.z.array(html_page_builder_page_schema_1.HtmlPageBuilderPageSchema),
14
25
  userId: zod_1.z.string().nullable().optional(),
15
26
  unregisteredUserId: zod_1.z.string().nullable().optional(),
16
27
  isFavorite: zod_1.z.boolean(),
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { HTML_PAGE_BUILDER_STYLE_TAG } from '../../../constants';
3
+ export declare const HtmlPageBuilderStyleSchema: z.ZodObject<{
4
+ uuid: z.ZodUUID;
5
+ code: z.ZodString;
6
+ title: z.ZodString;
7
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ previewUrl: z.ZodString;
9
+ thumbnailUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ tags: z.ZodArray<z.ZodEnum<typeof HTML_PAGE_BUILDER_STYLE_TAG>>;
11
+ popularity: z.ZodNumber;
12
+ order: z.ZodNumber;
13
+ createdAt: z.ZodCoercedDate<unknown>;
14
+ updatedAt: z.ZodCoercedDate<unknown>;
15
+ }, z.core.$strip>;
16
+ export type HtmlPageBuilderStyle = z.infer<typeof HtmlPageBuilderStyleSchema>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HtmlPageBuilderStyleSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ exports.HtmlPageBuilderStyleSchema = zod_1.z.object({
7
+ uuid: zod_1.z.uuid(),
8
+ code: zod_1.z.string(),
9
+ title: zod_1.z.string(),
10
+ description: zod_1.z.string().nullable().optional(),
11
+ previewUrl: zod_1.z.string(),
12
+ thumbnailUrl: zod_1.z.string().nullable().optional(),
13
+ tags: zod_1.z.array(zod_1.z.enum(constants_1.HTML_PAGE_BUILDER_STYLE_TAG)),
14
+ popularity: zod_1.z.number(),
15
+ order: zod_1.z.number(),
16
+ createdAt: zod_1.z.coerce.date(),
17
+ updatedAt: zod_1.z.coerce.date(),
18
+ });
@@ -1,4 +1,9 @@
1
+ export * from './html-page-builder-clarification.schema';
1
2
  export * from './html-page-builder-config.schema';
3
+ export * from './html-page-builder-font.schema';
2
4
  export * from './html-page-builder-job.schema';
3
5
  export * from './html-page-builder-model.schema';
6
+ export * from './html-page-builder-page.schema';
7
+ export * from './html-page-builder-preset.schema';
4
8
  export * from './html-page-builder-session.schema';
9
+ export * from './html-page-builder-style.schema';
@@ -14,7 +14,12 @@ 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("./html-page-builder-clarification.schema"), exports);
17
18
  __exportStar(require("./html-page-builder-config.schema"), exports);
19
+ __exportStar(require("./html-page-builder-font.schema"), exports);
18
20
  __exportStar(require("./html-page-builder-job.schema"), exports);
19
21
  __exportStar(require("./html-page-builder-model.schema"), exports);
22
+ __exportStar(require("./html-page-builder-page.schema"), exports);
23
+ __exportStar(require("./html-page-builder-preset.schema"), exports);
20
24
  __exportStar(require("./html-page-builder-session.schema"), exports);
25
+ __exportStar(require("./html-page-builder-style.schema"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.15.93",
3
+ "version": "0.16.0-stage-2",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -1,4 +0,0 @@
1
- export declare enum HTML_PAGE_BUILDER_SESSION_STAGE {
2
- BUILD = "BUILD",
3
- REFINE = "REFINE"
4
- }
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HTML_PAGE_BUILDER_SESSION_STAGE = void 0;
4
- var HTML_PAGE_BUILDER_SESSION_STAGE;
5
- (function (HTML_PAGE_BUILDER_SESSION_STAGE) {
6
- HTML_PAGE_BUILDER_SESSION_STAGE["BUILD"] = "BUILD";
7
- HTML_PAGE_BUILDER_SESSION_STAGE["REFINE"] = "REFINE";
8
- })(HTML_PAGE_BUILDER_SESSION_STAGE || (exports.HTML_PAGE_BUILDER_SESSION_STAGE = HTML_PAGE_BUILDER_SESSION_STAGE = {}));