@purpleschool/gptbot 0.12.40 → 0.12.42

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 (53) hide show
  1. package/api/controllers/http/diagrams.ts +16 -0
  2. package/api/controllers/http/html-page-builder.ts +1 -0
  3. package/api/controllers/http/index.ts +1 -0
  4. package/api/routes.ts +40 -0
  5. package/build/api/controllers/http/diagrams.js +18 -0
  6. package/build/api/controllers/http/html-page-builder.js +1 -0
  7. package/build/api/controllers/http/index.js +1 -0
  8. package/build/api/routes.js +28 -0
  9. package/build/commands/tools/diagrams/delete-all-diagrams-jobs.command.js +10 -0
  10. package/build/commands/tools/diagrams/delete-diagrams-job-by-uuid.command.js +13 -0
  11. package/build/commands/tools/diagrams/diagrams.command.js +19 -0
  12. package/build/commands/tools/diagrams/edit-diagrams-job.command.js +21 -0
  13. package/build/commands/tools/diagrams/find-diagrams-job-by-uuid.command.js +14 -0
  14. package/build/commands/tools/diagrams/find-diagrams-jobs.command.js +18 -0
  15. package/build/commands/tools/diagrams/get-diagrams-price.command.js +17 -0
  16. package/build/commands/tools/diagrams/get-diagrams-tool-config.command.js +11 -0
  17. package/build/commands/tools/diagrams/index.js +27 -0
  18. package/build/commands/tools/diagrams/retry-diagrams-job.command.js +19 -0
  19. package/build/commands/tools/diagrams/set-reaction-to-diagrams-job.command.js +28 -0
  20. package/build/commands/tools/diagrams/update-diagrams-job-title.command.js +17 -0
  21. package/build/commands/tools/html-page-builder/get-html-page-builder-price.command.js +2 -0
  22. package/build/commands/tools/index.js +1 -0
  23. package/build/constants/tool/enums/tool-content-type.enum.js +1 -0
  24. package/build/models/tools/diagrams/diagrams-chart-type.schema.js +17 -0
  25. package/build/models/tools/diagrams/diagrams-config.schema.js +10 -0
  26. package/build/models/tools/diagrams/diagrams-job.schema.js +64 -0
  27. package/build/models/tools/diagrams/diagrams-model.schema.js +41 -0
  28. package/build/models/tools/diagrams/index.js +20 -0
  29. package/build/models/tools/html-page-builder/html-page-builder-model.schema.js +0 -1
  30. package/build/models/tools/index.js +1 -0
  31. package/commands/tools/diagrams/delete-all-diagrams-jobs.command.ts +8 -0
  32. package/commands/tools/diagrams/delete-diagrams-job-by-uuid.command.ts +13 -0
  33. package/commands/tools/diagrams/diagrams.command.ts +19 -0
  34. package/commands/tools/diagrams/edit-diagrams-job.command.ts +23 -0
  35. package/commands/tools/diagrams/find-diagrams-job-by-uuid.command.ts +14 -0
  36. package/commands/tools/diagrams/find-diagrams-jobs.command.ts +18 -0
  37. package/commands/tools/diagrams/get-diagrams-price.command.ts +17 -0
  38. package/commands/tools/diagrams/get-diagrams-tool-config.command.ts +9 -0
  39. package/commands/tools/diagrams/index.ts +11 -0
  40. package/commands/tools/diagrams/retry-diagrams-job.command.ts +21 -0
  41. package/commands/tools/diagrams/set-reaction-to-diagrams-job.command.ts +33 -0
  42. package/commands/tools/diagrams/update-diagrams-job-title.command.ts +19 -0
  43. package/commands/tools/html-page-builder/get-html-page-builder-price.command.ts +2 -0
  44. package/commands/tools/index.ts +1 -0
  45. package/constants/tool/enums/tool-content-type.enum.ts +1 -0
  46. package/models/tools/diagrams/diagrams-chart-type.schema.ts +20 -0
  47. package/models/tools/diagrams/diagrams-config.schema.ts +10 -0
  48. package/models/tools/diagrams/diagrams-job.schema.ts +85 -0
  49. package/models/tools/diagrams/diagrams-model.schema.ts +47 -0
  50. package/models/tools/diagrams/index.ts +4 -0
  51. package/models/tools/html-page-builder/html-page-builder-model.schema.ts +0 -1
  52. package/models/tools/index.ts +1 -0
  53. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ export const DIAGRAMS_CONTROLLER_PRIVATE = 'private/tools/diagrams' as const;
2
+ export const DIAGRAMS_CONTROLLER_PUBLIC = 'public/tools/diagrams' as const;
3
+
4
+ export const DIAGRAMS_ROUTES = {
5
+ CONFIG: 'config',
6
+ PRICE: 'price',
7
+ EXECUTE: 'execute',
8
+ GET_JOBS: 'jobs',
9
+ GET_JOB: (uuid: string) => `jobs/${uuid}`,
10
+ EDIT: (uuid: string) => `jobs/${uuid}/edit`,
11
+ UPDATE: (uuid: string) => `jobs/${uuid}`,
12
+ SET_REACTION: (uuid: string) => `jobs/${uuid}/reaction`,
13
+ DELETE: (uuid: string) => `jobs/${uuid}`,
14
+ DELETE_ALL: 'jobs',
15
+ RETRY: (uuid: string) => `jobs/${uuid}/retry`,
16
+ } as const;
@@ -3,6 +3,7 @@ export const HTML_PAGE_BUILDER_CONTROLLER_PUBLIC = 'public/tools/html-page-build
3
3
 
4
4
  export const HTML_PAGE_BUILDER_ROUTES = {
5
5
  CONFIG: 'config',
6
+ PRICE: 'price',
6
7
  EXECUTE: 'execute',
7
8
  GET_SESSIONS: 'sessions',
8
9
  GET_SESSION: (uuid: string) => `sessions/${uuid}`,
@@ -60,6 +60,7 @@ export * from './image-generation';
60
60
  export * from './marketplace-card';
61
61
  export * from './interior-design';
62
62
  export * from './solving-edu-task';
63
+ export * from './diagrams';
63
64
  export * from './team-account';
64
65
  export * from './spell-corrector';
65
66
  export * from './tool-workspace';
package/api/routes.ts CHANGED
@@ -1167,6 +1167,44 @@ export const REST_API = {
1167
1167
  RETRY: (uuid: string) =>
1168
1168
  `${ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.RETRY(uuid)}`,
1169
1169
  },
1170
+ DIAGRAMS_PRIVATE: {
1171
+ CONFIG: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
1172
+ PRICE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
1173
+ EXECUTE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
1174
+ GET_JOBS: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
1175
+ GET_JOB: (uuid: string) =>
1176
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
1177
+ EDIT: (uuid: string) =>
1178
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
1179
+ UPDATE: (uuid: string) =>
1180
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
1181
+ SET_REACTION: (uuid: string) =>
1182
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
1183
+ DELETE: (uuid: string) =>
1184
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
1185
+ DELETE_ALL: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
1186
+ RETRY: (uuid: string) =>
1187
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
1188
+ },
1189
+ DIAGRAMS_PUBLIC: {
1190
+ CONFIG: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
1191
+ PRICE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
1192
+ EXECUTE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
1193
+ GET_JOBS: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
1194
+ GET_JOB: (uuid: string) =>
1195
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
1196
+ EDIT: (uuid: string) =>
1197
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
1198
+ UPDATE: (uuid: string) =>
1199
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
1200
+ SET_REACTION: (uuid: string) =>
1201
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
1202
+ DELETE: (uuid: string) =>
1203
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
1204
+ DELETE_ALL: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
1205
+ RETRY: (uuid: string) =>
1206
+ `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
1207
+ },
1170
1208
  TOOL_WORKSPACE_PRIVATE: {
1171
1209
  GET_WORKSPACES: `${ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACES}`,
1172
1210
  GET_WORKSPACE: (uuid: string) =>
@@ -1189,6 +1227,7 @@ export const REST_API = {
1189
1227
  },
1190
1228
  HTML_PAGE_BUILDER_PRIVATE: {
1191
1229
  CONFIG: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.CONFIG}`,
1230
+ PRICE: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.PRICE}`,
1192
1231
  EXECUTE: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.EXECUTE}`,
1193
1232
  GET_SESSIONS: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSIONS}`,
1194
1233
  GET_SESSION: (uuid: string) =>
@@ -1201,6 +1240,7 @@ export const REST_API = {
1201
1240
  },
1202
1241
  HTML_PAGE_BUILDER_PUBLIC: {
1203
1242
  CONFIG: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.CONFIG}`,
1243
+ PRICE: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.PRICE}`,
1204
1244
  EXECUTE: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.EXECUTE}`,
1205
1245
  GET_SESSIONS: `${ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSIONS}`,
1206
1246
  GET_SESSION: (uuid: string) =>
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DIAGRAMS_ROUTES = exports.DIAGRAMS_CONTROLLER_PUBLIC = exports.DIAGRAMS_CONTROLLER_PRIVATE = void 0;
4
+ exports.DIAGRAMS_CONTROLLER_PRIVATE = 'private/tools/diagrams';
5
+ exports.DIAGRAMS_CONTROLLER_PUBLIC = 'public/tools/diagrams';
6
+ exports.DIAGRAMS_ROUTES = {
7
+ CONFIG: 'config',
8
+ PRICE: 'price',
9
+ EXECUTE: 'execute',
10
+ GET_JOBS: 'jobs',
11
+ GET_JOB: (uuid) => `jobs/${uuid}`,
12
+ EDIT: (uuid) => `jobs/${uuid}/edit`,
13
+ UPDATE: (uuid) => `jobs/${uuid}`,
14
+ SET_REACTION: (uuid) => `jobs/${uuid}/reaction`,
15
+ DELETE: (uuid) => `jobs/${uuid}`,
16
+ DELETE_ALL: 'jobs',
17
+ RETRY: (uuid) => `jobs/${uuid}/retry`,
18
+ };
@@ -5,6 +5,7 @@ exports.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE = 'private/tools/html-page-builder'
5
5
  exports.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC = 'public/tools/html-page-builder';
6
6
  exports.HTML_PAGE_BUILDER_ROUTES = {
7
7
  CONFIG: 'config',
8
+ PRICE: 'price',
8
9
  EXECUTE: 'execute',
9
10
  GET_SESSIONS: 'sessions',
10
11
  GET_SESSION: (uuid) => `sessions/${uuid}`,
@@ -76,6 +76,7 @@ __exportStar(require("./image-generation"), exports);
76
76
  __exportStar(require("./marketplace-card"), exports);
77
77
  __exportStar(require("./interior-design"), exports);
78
78
  __exportStar(require("./solving-edu-task"), exports);
79
+ __exportStar(require("./diagrams"), exports);
79
80
  __exportStar(require("./team-account"), exports);
80
81
  __exportStar(require("./spell-corrector"), exports);
81
82
  __exportStar(require("./tool-workspace"), exports);
@@ -880,6 +880,32 @@ exports.REST_API = {
880
880
  DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.DELETE_ALL}`,
881
881
  RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.RETRY(uuid)}`,
882
882
  },
883
+ DIAGRAMS_PRIVATE: {
884
+ CONFIG: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
885
+ PRICE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
886
+ EXECUTE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
887
+ GET_JOBS: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
888
+ GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
889
+ EDIT: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
890
+ UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
891
+ SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
892
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
893
+ DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
894
+ RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
895
+ },
896
+ DIAGRAMS_PUBLIC: {
897
+ CONFIG: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
898
+ PRICE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
899
+ EXECUTE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
900
+ GET_JOBS: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
901
+ GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
902
+ EDIT: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
903
+ UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
904
+ SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
905
+ DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
906
+ DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
907
+ RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
908
+ },
883
909
  TOOL_WORKSPACE_PRIVATE: {
884
910
  GET_WORKSPACES: `${exports.ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACES}`,
885
911
  GET_WORKSPACE: (uuid) => `${exports.ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACE(uuid)}`,
@@ -896,6 +922,7 @@ exports.REST_API = {
896
922
  },
897
923
  HTML_PAGE_BUILDER_PRIVATE: {
898
924
  CONFIG: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.CONFIG}`,
925
+ PRICE: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.PRICE}`,
899
926
  EXECUTE: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.EXECUTE}`,
900
927
  GET_SESSIONS: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSIONS}`,
901
928
  GET_SESSION: (uuid) => `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PRIVATE}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSION(uuid)}`,
@@ -905,6 +932,7 @@ exports.REST_API = {
905
932
  },
906
933
  HTML_PAGE_BUILDER_PUBLIC: {
907
934
  CONFIG: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.CONFIG}`,
935
+ PRICE: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.PRICE}`,
908
936
  EXECUTE: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.EXECUTE}`,
909
937
  GET_SESSIONS: `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSIONS}`,
910
938
  GET_SESSION: (uuid) => `${exports.ROOT}/${CONTROLLERS.HTML_PAGE_BUILDER_CONTROLLER_PUBLIC}/${CONTROLLERS.HTML_PAGE_BUILDER_ROUTES.GET_SESSION(uuid)}`,
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteAllDiagramsJobsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteAllDiagramsJobsCommand;
6
+ (function (DeleteAllDiagramsJobsCommand) {
7
+ DeleteAllDiagramsJobsCommand.ResponseSchema = zod_1.z.object({
8
+ data: zod_1.z.boolean(),
9
+ });
10
+ })(DeleteAllDiagramsJobsCommand || (exports.DeleteAllDiagramsJobsCommand = DeleteAllDiagramsJobsCommand = {}));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteDiagramsJobByUUIDCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var DeleteDiagramsJobByUUIDCommand;
6
+ (function (DeleteDiagramsJobByUUIDCommand) {
7
+ DeleteDiagramsJobByUUIDCommand.RequestParamsSchema = zod_1.z.object({
8
+ uuid: zod_1.z.string().uuid(),
9
+ });
10
+ DeleteDiagramsJobByUUIDCommand.ResponseSchema = zod_1.z.object({
11
+ data: zod_1.z.boolean(),
12
+ });
13
+ })(DeleteDiagramsJobByUUIDCommand || (exports.DeleteDiagramsJobByUUIDCommand = DeleteDiagramsJobByUUIDCommand = {}));
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagramsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var DiagramsCommand;
7
+ (function (DiagramsCommand) {
8
+ DiagramsCommand.RequestSchema = zod_1.z.object({
9
+ prompt: zod_1.z.string().min(1).max(100000),
10
+ modelId: zod_1.z.string().uuid(),
11
+ params: zod_1.z.object({
12
+ chartTypeUuid: zod_1.z.string().uuid(),
13
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
14
+ }),
15
+ });
16
+ DiagramsCommand.ResponseSchema = zod_1.z.object({
17
+ data: models_1.DiagramsJobSchemaResponse,
18
+ });
19
+ })(DiagramsCommand || (exports.DiagramsCommand = DiagramsCommand = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EditDiagramsJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var EditDiagramsJobCommand;
7
+ (function (EditDiagramsJobCommand) {
8
+ EditDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ EditDiagramsJobCommand.RequestSchema = zod_1.z.object({
12
+ prompt: zod_1.z.string().min(1).max(100000),
13
+ versionId: zod_1.z.string().uuid(),
14
+ modelId: zod_1.z.string().uuid().optional(),
15
+ chartTypeUuid: zod_1.z.string().uuid().optional(),
16
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
17
+ });
18
+ EditDiagramsJobCommand.ResponseSchema = zod_1.z.object({
19
+ data: models_1.DiagramsJobSchemaResponse,
20
+ });
21
+ })(EditDiagramsJobCommand || (exports.EditDiagramsJobCommand = EditDiagramsJobCommand = {}));
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindDiagramsJobByUUIDCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var FindDiagramsJobByUUIDCommand;
7
+ (function (FindDiagramsJobByUUIDCommand) {
8
+ FindDiagramsJobByUUIDCommand.RequestParamsSchema = models_1.DiagramsJobSchema.pick({
9
+ uuid: true,
10
+ });
11
+ FindDiagramsJobByUUIDCommand.ResponseSchema = zod_1.z.object({
12
+ data: models_1.DiagramsJobSchemaResponse,
13
+ });
14
+ })(FindDiagramsJobByUUIDCommand || (exports.FindDiagramsJobByUUIDCommand = FindDiagramsJobByUUIDCommand = {}));
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindDiagramsJobsCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var FindDiagramsJobsCommand;
7
+ (function (FindDiagramsJobsCommand) {
8
+ FindDiagramsJobsCommand.RequestQuerySchema = zod_1.z.object({
9
+ limit: zod_1.z.coerce.number().min(1).optional(),
10
+ offset: zod_1.z.coerce.number().min(0).default(0).optional(),
11
+ title: zod_1.z.string().optional(),
12
+ });
13
+ FindDiagramsJobsCommand.ResponseSchema = zod_1.z.object({
14
+ data: zod_1.z.array(models_1.DiagramsJobSchemaResponse),
15
+ totalPages: zod_1.z.number(),
16
+ page: zod_1.z.number(),
17
+ });
18
+ })(FindDiagramsJobsCommand || (exports.FindDiagramsJobsCommand = FindDiagramsJobsCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetDiagramsPriceCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ var GetDiagramsPriceCommand;
6
+ (function (GetDiagramsPriceCommand) {
7
+ GetDiagramsPriceCommand.RequestSchema = zod_1.z.object({
8
+ modelId: zod_1.z.string().uuid(),
9
+ prompt: zod_1.z.string().min(1).max(100000),
10
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
11
+ });
12
+ GetDiagramsPriceCommand.ResponseSchema = zod_1.z.object({
13
+ data: zod_1.z.object({
14
+ price: zod_1.z.number(),
15
+ }),
16
+ });
17
+ })(GetDiagramsPriceCommand || (exports.GetDiagramsPriceCommand = GetDiagramsPriceCommand = {}));
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetDiagramsToolConfigCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var GetDiagramsToolConfigCommand;
7
+ (function (GetDiagramsToolConfigCommand) {
8
+ GetDiagramsToolConfigCommand.ResponseSchema = zod_1.z.object({
9
+ data: models_1.DiagramsConfigSchema,
10
+ });
11
+ })(GetDiagramsToolConfigCommand || (exports.GetDiagramsToolConfigCommand = GetDiagramsToolConfigCommand = {}));
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./diagrams.command"), exports);
18
+ __exportStar(require("./edit-diagrams-job.command"), exports);
19
+ __exportStar(require("./update-diagrams-job-title.command"), exports);
20
+ __exportStar(require("./set-reaction-to-diagrams-job.command"), exports);
21
+ __exportStar(require("./retry-diagrams-job.command"), exports);
22
+ __exportStar(require("./get-diagrams-price.command"), exports);
23
+ __exportStar(require("./delete-diagrams-job-by-uuid.command"), exports);
24
+ __exportStar(require("./delete-all-diagrams-jobs.command"), exports);
25
+ __exportStar(require("./find-diagrams-job-by-uuid.command"), exports);
26
+ __exportStar(require("./find-diagrams-jobs.command"), exports);
27
+ __exportStar(require("./get-diagrams-tool-config.command"), exports);
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryDiagramsJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var RetryDiagramsJobCommand;
7
+ (function (RetryDiagramsJobCommand) {
8
+ RetryDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ RetryDiagramsJobCommand.RequestSchema = zod_1.z.object({
12
+ prompt: zod_1.z.string().optional(),
13
+ modelId: zod_1.z.string().uuid().optional(),
14
+ params: models_1.DiagramsJobRequestParamsSchema.optional(),
15
+ });
16
+ RetryDiagramsJobCommand.ResponseSchema = zod_1.z.object({
17
+ data: models_1.DiagramsJobSchemaResponse,
18
+ });
19
+ })(RetryDiagramsJobCommand || (exports.RetryDiagramsJobCommand = RetryDiagramsJobCommand = {}));
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetReactionToDiagramsJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ const constants_1 = require("../../../constants");
7
+ var SetReactionToDiagramsJobCommand;
8
+ (function (SetReactionToDiagramsJobCommand) {
9
+ SetReactionToDiagramsJobCommand.RequestSchema = zod_1.z
10
+ .object({
11
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
12
+ dislikeReason: zod_1.z.string().nullable().default(null),
13
+ })
14
+ .refine((data) => {
15
+ if (data.reaction !== constants_1.USER_REACTION.DISLIKED && data.dislikeReason) {
16
+ return false;
17
+ }
18
+ return true;
19
+ }, {
20
+ message: 'Dislike reason is not allowed when reaction is not DISLIKED',
21
+ });
22
+ SetReactionToDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
23
+ uuid: zod_1.z.string().uuid(),
24
+ });
25
+ SetReactionToDiagramsJobCommand.ResponseSchema = zod_1.z.object({
26
+ data: models_1.DiagramsJobSchemaResponse,
27
+ });
28
+ })(SetReactionToDiagramsJobCommand || (exports.SetReactionToDiagramsJobCommand = SetReactionToDiagramsJobCommand = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateDiagramsJobTitleCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../../models");
6
+ var UpdateDiagramsJobTitleCommand;
7
+ (function (UpdateDiagramsJobTitleCommand) {
8
+ UpdateDiagramsJobTitleCommand.RequestSchema = zod_1.z.object({
9
+ title: zod_1.z.string().min(1).max(40).trim(),
10
+ });
11
+ UpdateDiagramsJobTitleCommand.RequestParamsSchema = zod_1.z.object({
12
+ uuid: zod_1.z.string().uuid(),
13
+ });
14
+ UpdateDiagramsJobTitleCommand.ResponseSchema = zod_1.z.object({
15
+ data: models_1.DiagramsJobSchemaResponse,
16
+ });
17
+ })(UpdateDiagramsJobTitleCommand || (exports.UpdateDiagramsJobTitleCommand = UpdateDiagramsJobTitleCommand = {}));
@@ -6,6 +6,8 @@ var GetHtmlPageBuilderPriceCommand;
6
6
  (function (GetHtmlPageBuilderPriceCommand) {
7
7
  GetHtmlPageBuilderPriceCommand.RequestSchema = zod_1.z.object({
8
8
  modelId: zod_1.z.string().uuid(),
9
+ userPrompt: zod_1.z.string(),
10
+ sessionId: zod_1.z.string().uuid().nullable().optional(),
9
11
  });
10
12
  GetHtmlPageBuilderPriceCommand.ResponseSchema = zod_1.z.object({
11
13
  data: zod_1.z.object({
@@ -31,3 +31,4 @@ __exportStar(require("./solving-edu-task"), exports);
31
31
  __exportStar(require("./spell-corrector"), exports);
32
32
  __exportStar(require("./html-page-builder"), exports);
33
33
  __exportStar(require("./tool-workspace"), exports);
34
+ __exportStar(require("./diagrams"), exports);
@@ -18,4 +18,5 @@ var TOOL_CONTENT_TYPE;
18
18
  TOOL_CONTENT_TYPE["MARKETPLACE_CARD_GENERATION"] = "MARKETPLACE_CARD";
19
19
  TOOL_CONTENT_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
20
20
  TOOL_CONTENT_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
21
+ TOOL_CONTENT_TYPE["DIAGRAMS"] = "DIAGRAMS";
21
22
  })(TOOL_CONTENT_TYPE || (exports.TOOL_CONTENT_TYPE = TOOL_CONTENT_TYPE = {}));
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagramsChartTypeSchemaResponse = exports.DiagramsChartTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ exports.DiagramsChartTypeSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ title: zod_1.z.string(),
9
+ icons: icon_variants_schema_1.IconVariantsSchema,
10
+ systemPrompt: zod_1.z.string(),
11
+ order: zod_1.z.number(),
12
+ createdAt: zod_1.z.date(),
13
+ updatedAt: zod_1.z.date(),
14
+ });
15
+ exports.DiagramsChartTypeSchemaResponse = exports.DiagramsChartTypeSchema.omit({
16
+ systemPrompt: true,
17
+ });
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagramsConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const diagrams_model_schema_1 = require("./diagrams-model.schema");
6
+ const diagrams_chart_type_schema_1 = require("./diagrams-chart-type.schema");
7
+ exports.DiagramsConfigSchema = zod_1.z.object({
8
+ models: zod_1.z.array(diagrams_model_schema_1.DiagramsModelSchemaResponse),
9
+ chartTypes: zod_1.z.array(diagrams_chart_type_schema_1.DiagramsChartTypeSchemaResponse),
10
+ });
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagramsJobSchemaResponse = exports.DiagramsJobSchema = exports.DiagramsJobOutputSchema = exports.DiagramsJobParamsSchemaResponse = exports.DiagramsJobParamsSchema = exports.DiagramsJobRequestParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const constants_1 = require("../../../constants");
6
+ exports.DiagramsJobRequestParamsSchema = zod_1.z.object({
7
+ chartTypeUuid: zod_1.z.string().uuid(),
8
+ fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
9
+ });
10
+ exports.DiagramsJobParamsSchema = zod_1.z.object({
11
+ chartTypeUuid: zod_1.z.string().uuid(),
12
+ data: zod_1.z
13
+ .array(zod_1.z.object({
14
+ fileId: zod_1.z.string().uuid(),
15
+ url: zod_1.z.string(),
16
+ }))
17
+ .optional(),
18
+ });
19
+ exports.DiagramsJobParamsSchemaResponse = zod_1.z.object({
20
+ chartTypeUuid: zod_1.z.string().uuid(),
21
+ data: zod_1.z
22
+ .array(zod_1.z.object({
23
+ fileId: zod_1.z.string().uuid(),
24
+ }))
25
+ .optional(),
26
+ });
27
+ exports.DiagramsJobOutputSchema = zod_1.z.object({
28
+ versions: zod_1.z.array(zod_1.z.object({
29
+ uuid: zod_1.z.string(),
30
+ htmlUrl: zod_1.z.string(),
31
+ createdAt: zod_1.z.string(),
32
+ parentUuid: zod_1.z.string().uuid().optional(),
33
+ })),
34
+ });
35
+ exports.DiagramsJobSchema = zod_1.z.object({
36
+ uuid: zod_1.z.string().uuid(),
37
+ prompt: zod_1.z.string(),
38
+ title: zod_1.z.string(),
39
+ status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS),
40
+ error: zod_1.z.string().nullable(),
41
+ internalError: zod_1.z.string().nullable().optional(),
42
+ modelId: zod_1.z.string().uuid(),
43
+ price: zod_1.z.number(),
44
+ params: exports.DiagramsJobParamsSchema,
45
+ output: exports.DiagramsJobOutputSchema,
46
+ reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
47
+ dislikeReason: zod_1.z.string().nullable(),
48
+ attempts: zod_1.z.array(zod_1.z.any()),
49
+ userId: zod_1.z.string().uuid().nullable().optional(),
50
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
51
+ tokenReservationId: zod_1.z.string().uuid().nullable().optional(),
52
+ isDeleted: zod_1.z.boolean(),
53
+ createdAt: zod_1.z.date(),
54
+ completedAt: zod_1.z.date().nullable().optional(),
55
+ updatedAt: zod_1.z.date(),
56
+ });
57
+ exports.DiagramsJobSchemaResponse = exports.DiagramsJobSchema.omit({
58
+ internalError: true,
59
+ dislikeReason: true,
60
+ tokenReservationId: true,
61
+ isDeleted: true,
62
+ }).extend({
63
+ params: exports.DiagramsJobParamsSchemaResponse,
64
+ });
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiagramsModelSchemaResponse = exports.DiagramsModelSchema = exports.DiagramsModelConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const icon_variants_schema_1 = require("../../icon-variants.schema");
6
+ const constants_1 = require("../../../constants");
7
+ exports.DiagramsModelConfigSchema = zod_1.z.object({
8
+ dataAttachment: zod_1.z.object({
9
+ supported: zod_1.z.boolean(),
10
+ maxFileSizeMb: zod_1.z.number(),
11
+ acceptedTypes: zod_1.z.array(zod_1.z.string()),
12
+ }),
13
+ });
14
+ exports.DiagramsModelSchema = zod_1.z.object({
15
+ uuid: zod_1.z.string().uuid(),
16
+ title: zod_1.z.string(),
17
+ description: zod_1.z.string(),
18
+ aiModel: zod_1.z.string(),
19
+ inputPrice: zod_1.z.number(),
20
+ outputPrice: zod_1.z.number(),
21
+ tokenMultiplicator: zod_1.z.number(),
22
+ freeTokenMultiplicator: zod_1.z.number(),
23
+ isPremium: zod_1.z.boolean(),
24
+ isNew: zod_1.z.boolean(),
25
+ order: zod_1.z.number(),
26
+ status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
27
+ icons: icon_variants_schema_1.IconVariantsSchema,
28
+ maxPromptLength: zod_1.z.number(),
29
+ maxPromptTokens: zod_1.z.number(),
30
+ maxContextCharacters: zod_1.z.number(),
31
+ config: exports.DiagramsModelConfigSchema,
32
+ createdAt: zod_1.z.date(),
33
+ updatedAt: zod_1.z.date(),
34
+ });
35
+ exports.DiagramsModelSchemaResponse = exports.DiagramsModelSchema.omit({
36
+ aiModel: true,
37
+ inputPrice: true,
38
+ outputPrice: true,
39
+ maxPromptTokens: true,
40
+ maxContextCharacters: true,
41
+ });
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./diagrams-chart-type.schema"), exports);
18
+ __exportStar(require("./diagrams-config.schema"), exports);
19
+ __exportStar(require("./diagrams-job.schema"), exports);
20
+ __exportStar(require("./diagrams-model.schema"), exports);
@@ -8,7 +8,6 @@ exports.HtmlPageBuilderModelSchema = zod_1.z.object({
8
8
  uuid: zod_1.z.string(),
9
9
  title: zod_1.z.string(),
10
10
  description: zod_1.z.string(),
11
- price: zod_1.z.number(),
12
11
  order: zod_1.z.number(),
13
12
  status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
14
13
  icons: icon_variants_schema_1.IconVariantsSchema,
@@ -32,3 +32,4 @@ __exportStar(require("./solving-edu-task"), exports);
32
32
  __exportStar(require("./spell-corrector"), exports);
33
33
  __exportStar(require("./html-page-builder"), exports);
34
34
  __exportStar(require("./tool-workspace"), exports);
35
+ __exportStar(require("./diagrams"), exports);
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllDiagramsJobsCommand {
4
+ export const ResponseSchema = z.object({
5
+ data: z.boolean(),
6
+ });
7
+ export type Response = z.infer<typeof ResponseSchema>;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteDiagramsJobByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.object({
10
+ data: z.boolean(),
11
+ });
12
+ export type Response = z.infer<typeof ResponseSchema>;
13
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace DiagramsCommand {
5
+ export const RequestSchema = z.object({
6
+ prompt: z.string().min(1).max(100000),
7
+ modelId: z.string().uuid(),
8
+ params: z.object({
9
+ chartTypeUuid: z.string().uuid(),
10
+ fileIds: z.array(z.string().uuid()).optional().default([]),
11
+ }),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: DiagramsJobSchemaResponse,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace EditDiagramsJobCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ prompt: z.string().min(1).max(100000),
12
+ versionId: z.string().uuid(),
13
+ modelId: z.string().uuid().optional(),
14
+ chartTypeUuid: z.string().uuid().optional(),
15
+ fileIds: z.array(z.string().uuid()).optional().default([]),
16
+ });
17
+ export type Request = z.infer<typeof RequestSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: DiagramsJobSchemaResponse,
21
+ });
22
+ export type Response = z.infer<typeof ResponseSchema>;
23
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchema, DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace FindDiagramsJobByUUIDCommand {
5
+ export const RequestParamsSchema = DiagramsJobSchema.pick({
6
+ uuid: true,
7
+ });
8
+ export type Request = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const ResponseSchema = z.object({
11
+ data: DiagramsJobSchemaResponse,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace FindDiagramsJobsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().min(1).optional(),
7
+ offset: z.coerce.number().min(0).default(0).optional(),
8
+ title: z.string().optional(),
9
+ });
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(DiagramsJobSchemaResponse),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace GetDiagramsPriceCommand {
4
+ export const RequestSchema = z.object({
5
+ modelId: z.string().uuid(),
6
+ prompt: z.string().min(1).max(100000),
7
+ fileIds: z.array(z.string().uuid()).optional().default([]),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.object({
13
+ price: z.number(),
14
+ }),
15
+ });
16
+ export type Response = z.infer<typeof ResponseSchema>;
17
+ }
@@ -0,0 +1,9 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsConfigSchema } from '../../../models';
3
+
4
+ export namespace GetDiagramsToolConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: DiagramsConfigSchema,
7
+ });
8
+ export type Response = z.infer<typeof ResponseSchema>;
9
+ }
@@ -0,0 +1,11 @@
1
+ export * from './diagrams.command';
2
+ export * from './edit-diagrams-job.command';
3
+ export * from './update-diagrams-job-title.command';
4
+ export * from './set-reaction-to-diagrams-job.command';
5
+ export * from './retry-diagrams-job.command';
6
+ export * from './get-diagrams-price.command';
7
+ export * from './delete-diagrams-job-by-uuid.command';
8
+ export * from './delete-all-diagrams-jobs.command';
9
+ export * from './find-diagrams-job-by-uuid.command';
10
+ export * from './find-diagrams-jobs.command';
11
+ export * from './get-diagrams-tool-config.command';
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobRequestParamsSchema, DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace RetryDiagramsJobCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestSchema = z.object({
11
+ prompt: z.string().optional(),
12
+ modelId: z.string().uuid().optional(),
13
+ params: DiagramsJobRequestParamsSchema.optional(),
14
+ });
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ data: DiagramsJobSchemaResponse,
19
+ });
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchemaResponse } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToDiagramsJobCommand {
6
+ export const RequestSchema = z
7
+ .object({
8
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
9
+ dislikeReason: z.string().nullable().default(null),
10
+ })
11
+ .refine(
12
+ (data) => {
13
+ if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
14
+ return false;
15
+ }
16
+ return true;
17
+ },
18
+ {
19
+ message: 'Dislike reason is not allowed when reaction is not DISLIKED',
20
+ },
21
+ );
22
+ export type Request = z.infer<typeof RequestSchema>;
23
+
24
+ export const RequestParamsSchema = z.object({
25
+ uuid: z.string().uuid(),
26
+ });
27
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
28
+
29
+ export const ResponseSchema = z.object({
30
+ data: DiagramsJobSchemaResponse,
31
+ });
32
+ export type Response = z.infer<typeof ResponseSchema>;
33
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsJobSchemaResponse } from '../../../models';
3
+
4
+ export namespace UpdateDiagramsJobTitleCommand {
5
+ export const RequestSchema = z.object({
6
+ title: z.string().min(1).max(40).trim(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const RequestParamsSchema = z.object({
11
+ uuid: z.string().uuid(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: DiagramsJobSchemaResponse,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -3,6 +3,8 @@ import { z } from 'zod';
3
3
  export namespace GetHtmlPageBuilderPriceCommand {
4
4
  export const RequestSchema = z.object({
5
5
  modelId: z.string().uuid(),
6
+ userPrompt: z.string(),
7
+ sessionId: z.string().uuid().nullable().optional(),
6
8
  });
7
9
  export type Request = z.infer<typeof RequestSchema>;
8
10
 
@@ -15,3 +15,4 @@ export * from './solving-edu-task';
15
15
  export * from './spell-corrector';
16
16
  export * from './html-page-builder';
17
17
  export * from './tool-workspace';
18
+ export * from './diagrams';
@@ -14,4 +14,5 @@ export enum TOOL_CONTENT_TYPE {
14
14
  MARKETPLACE_CARD_GENERATION = 'MARKETPLACE_CARD',
15
15
  SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
16
16
  SPELL_CORRECTOR = 'SPELL_CORRECTOR',
17
+ DIAGRAMS = 'DIAGRAMS',
17
18
  }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
+
4
+ export const DiagramsChartTypeSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ title: z.string(),
7
+ icons: IconVariantsSchema,
8
+ systemPrompt: z.string(),
9
+ order: z.number(),
10
+ createdAt: z.date(),
11
+ updatedAt: z.date(),
12
+ });
13
+
14
+ export type DiagramsChartType = z.infer<typeof DiagramsChartTypeSchema>;
15
+
16
+ export const DiagramsChartTypeSchemaResponse = DiagramsChartTypeSchema.omit({
17
+ systemPrompt: true,
18
+ });
19
+
20
+ export type DiagramsChartTypeResponse = z.infer<typeof DiagramsChartTypeSchemaResponse>;
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { DiagramsModelSchemaResponse } from './diagrams-model.schema';
3
+ import { DiagramsChartTypeSchemaResponse } from './diagrams-chart-type.schema';
4
+
5
+ export const DiagramsConfigSchema = z.object({
6
+ models: z.array(DiagramsModelSchemaResponse),
7
+ chartTypes: z.array(DiagramsChartTypeSchemaResponse),
8
+ });
9
+
10
+ export type DiagramsConfig = z.infer<typeof DiagramsConfigSchema>;
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_JOB_STATUS, USER_REACTION } from '../../../constants';
3
+
4
+ export const DiagramsJobRequestParamsSchema = z.object({
5
+ chartTypeUuid: z.string().uuid(),
6
+ fileIds: z.array(z.string().uuid()).optional(),
7
+ });
8
+
9
+ export type DiagramsJobRequestParams = z.infer<typeof DiagramsJobRequestParamsSchema>;
10
+
11
+ export const DiagramsJobParamsSchema = z.object({
12
+ chartTypeUuid: z.string().uuid(),
13
+ data: z
14
+ .array(
15
+ z.object({
16
+ fileId: z.string().uuid(),
17
+ url: z.string(),
18
+ }),
19
+ )
20
+ .optional(),
21
+ });
22
+
23
+ export type DiagramsJobParams = z.infer<typeof DiagramsJobParamsSchema>;
24
+
25
+ export const DiagramsJobParamsSchemaResponse = z.object({
26
+ chartTypeUuid: z.string().uuid(),
27
+ data: z
28
+ .array(
29
+ z.object({
30
+ fileId: z.string().uuid(),
31
+ }),
32
+ )
33
+ .optional(),
34
+ });
35
+
36
+ export type DiagramsJobParamsResponse = z.infer<typeof DiagramsJobParamsSchemaResponse>;
37
+
38
+ export const DiagramsJobOutputSchema = z.object({
39
+ versions: z.array(
40
+ z.object({
41
+ uuid: z.string(),
42
+ htmlUrl: z.string(),
43
+ createdAt: z.string(),
44
+ parentUuid: z.string().uuid().optional(),
45
+ }),
46
+ ),
47
+ });
48
+
49
+ export type DiagramsJobOutput = z.infer<typeof DiagramsJobOutputSchema>;
50
+
51
+ export const DiagramsJobSchema = z.object({
52
+ uuid: z.string().uuid(),
53
+ prompt: z.string(),
54
+ title: z.string(),
55
+ status: z.nativeEnum(TOOL_JOB_STATUS),
56
+ error: z.string().nullable(),
57
+ internalError: z.string().nullable().optional(),
58
+ modelId: z.string().uuid(),
59
+ price: z.number(),
60
+ params: DiagramsJobParamsSchema,
61
+ output: DiagramsJobOutputSchema,
62
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
63
+ dislikeReason: z.string().nullable(),
64
+ attempts: z.array(z.any()),
65
+ userId: z.string().uuid().nullable().optional(),
66
+ unregisteredUserId: z.string().uuid().nullable().optional(),
67
+ tokenReservationId: z.string().uuid().nullable().optional(),
68
+ isDeleted: z.boolean(),
69
+ createdAt: z.date(),
70
+ completedAt: z.date().nullable().optional(),
71
+ updatedAt: z.date(),
72
+ });
73
+
74
+ export type DiagramsJob = z.infer<typeof DiagramsJobSchema>;
75
+
76
+ export const DiagramsJobSchemaResponse = DiagramsJobSchema.omit({
77
+ internalError: true,
78
+ dislikeReason: true,
79
+ tokenReservationId: true,
80
+ isDeleted: true,
81
+ }).extend({
82
+ params: DiagramsJobParamsSchemaResponse,
83
+ });
84
+
85
+ export type DiagramsJobResponse = z.infer<typeof DiagramsJobSchemaResponse>;
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import { IconVariantsSchema } from '../../icon-variants.schema';
3
+ import { TOOL_MODEL_STATUS } from '../../../constants';
4
+
5
+ export const DiagramsModelConfigSchema = z.object({
6
+ dataAttachment: z.object({
7
+ supported: z.boolean(),
8
+ maxFileSizeMb: z.number(),
9
+ acceptedTypes: z.array(z.string()),
10
+ }),
11
+ });
12
+
13
+ export type DiagramsModelConfig = z.infer<typeof DiagramsModelConfigSchema>;
14
+
15
+ export const DiagramsModelSchema = z.object({
16
+ uuid: z.string().uuid(),
17
+ title: z.string(),
18
+ description: z.string(),
19
+ aiModel: z.string(),
20
+ inputPrice: z.number(),
21
+ outputPrice: z.number(),
22
+ tokenMultiplicator: z.number(),
23
+ freeTokenMultiplicator: z.number(),
24
+ isPremium: z.boolean(),
25
+ isNew: z.boolean(),
26
+ order: z.number(),
27
+ status: z.nativeEnum(TOOL_MODEL_STATUS),
28
+ icons: IconVariantsSchema,
29
+ maxPromptLength: z.number(),
30
+ maxPromptTokens: z.number(),
31
+ maxContextCharacters: z.number(),
32
+ config: DiagramsModelConfigSchema,
33
+ createdAt: z.date(),
34
+ updatedAt: z.date(),
35
+ });
36
+
37
+ export type DiagramsModel = z.infer<typeof DiagramsModelSchema>;
38
+
39
+ export const DiagramsModelSchemaResponse = DiagramsModelSchema.omit({
40
+ aiModel: true,
41
+ inputPrice: true,
42
+ outputPrice: true,
43
+ maxPromptTokens: true,
44
+ maxContextCharacters: true,
45
+ });
46
+
47
+ export type DiagramsModelResponse = z.infer<typeof DiagramsModelSchemaResponse>;
@@ -0,0 +1,4 @@
1
+ export * from './diagrams-chart-type.schema';
2
+ export * from './diagrams-config.schema';
3
+ export * from './diagrams-job.schema';
4
+ export * from './diagrams-model.schema';
@@ -6,7 +6,6 @@ export const HtmlPageBuilderModelSchema = z.object({
6
6
  uuid: z.string(),
7
7
  title: z.string(),
8
8
  description: z.string(),
9
- price: z.number(),
10
9
  order: z.number(),
11
10
  status: z.nativeEnum(TOOL_MODEL_STATUS),
12
11
  icons: IconVariantsSchema,
@@ -16,3 +16,4 @@ export * from './solving-edu-task';
16
16
  export * from './spell-corrector';
17
17
  export * from './html-page-builder';
18
18
  export * from './tool-workspace';
19
+ export * from './diagrams';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot",
3
- "version": "0.12.40",
3
+ "version": "0.12.42",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",