@purpleschool/gptbot-tools 0.2.67 → 0.2.68

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 (27) hide show
  1. package/build/diagrams/commands/diagrams.command.d.ts +16 -19
  2. package/build/diagrams/commands/diagrams.command.js +1 -1
  3. package/build/diagrams/commands/edit-diagrams-job.command.d.ts +12 -17
  4. package/build/diagrams/commands/edit-diagrams-job.command.js +1 -1
  5. package/build/diagrams/commands/get-diagrams-price-calculation-data.command.d.ts +19 -1
  6. package/build/diagrams/commands/get-diagrams-price-calculation-data.command.js +2 -1
  7. package/build/diagrams/commands/retry-diagrams-job.command.d.ts +5 -17
  8. package/build/diagrams/commands/retry-diagrams-job.command.js +1 -1
  9. package/build/diagrams/commands/set-reaction-to-diagrams-job.command.d.ts +2 -16
  10. package/build/diagrams/commands/update-diagrams-job-favorite.command.d.ts +2 -16
  11. package/build/diagrams/commands/update-diagrams-job-title.command.d.ts +2 -16
  12. package/build/diagrams/models/diagrams-config.schema.d.ts +2 -0
  13. package/build/diagrams/models/diagrams-config.schema.js +2 -0
  14. package/build/diagrams/models/diagrams-job.schema.d.ts +78 -7
  15. package/build/diagrams/models/diagrams-job.schema.js +66 -12
  16. package/build/diagrams/models/diagrams-mode.enum.d.ts +4 -0
  17. package/build/diagrams/models/diagrams-mode.enum.js +8 -0
  18. package/build/diagrams/models/index.d.ts +1 -0
  19. package/build/diagrams/models/index.js +1 -0
  20. package/build/diagrams/queries/find-diagrams-job-by-uuid.query.d.ts +2 -16
  21. package/build/diagrams/queries/find-diagrams-jobs.query.d.ts +2 -16
  22. package/build/diagrams/queries/get-diagrams-config.query.d.ts +2 -0
  23. package/build/tools/models/global-tools-config.schema.d.ts +1 -0
  24. package/build/tools/models/tools-with-configs.schema.d.ts +2 -0
  25. package/build/tools/queries/get-global-tools-config.query.d.ts +2 -0
  26. package/build/tools/queries/get-tools-with-configs.query.d.ts +2 -0
  27. package/package.json +1 -1
@@ -6,14 +6,25 @@ export declare namespace DiagramsCommand {
6
6
  unregisteredUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
7
  prompt: z.ZodString;
8
8
  modelId: z.ZodString;
9
- params: z.ZodObject<{
10
- chartTypeUuid: z.ZodString;
9
+ params: z.ZodPipe<z.ZodObject<{
10
+ mode: z.ZodType<import("..").DIAGRAMS_MODE, unknown, z.core.$ZodTypeInternals<import("..").DIAGRAMS_MODE, unknown>>;
11
11
  data: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
12
  fileId: z.ZodString;
13
13
  url: z.ZodString;
14
14
  fileType: z.ZodOptional<z.ZodEnum<typeof import("../..").FILE_TYPE>>;
15
15
  }, z.core.$strip>>>;
16
- }, z.core.$strip>;
16
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
17
+ accentColor: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>, z.ZodTransform<import("..").DiagramsChartParams | import("..").DiagramsReportParams, {
19
+ mode: import("..").DIAGRAMS_MODE;
20
+ data?: {
21
+ fileId: string;
22
+ url: string;
23
+ fileType?: import("../..").FILE_TYPE | undefined;
24
+ }[] | undefined;
25
+ chartTypeUuid?: string | undefined;
26
+ accentColor?: string | undefined;
27
+ }>>;
17
28
  tokenReservationId: z.ZodString;
18
29
  precalculatedPrice: z.ZodNumber;
19
30
  mock: z.ZodOptional<z.ZodBoolean>;
@@ -30,14 +41,7 @@ export declare namespace DiagramsCommand {
30
41
  internalError?: string | null | undefined;
31
42
  modelId: string;
32
43
  price: number;
33
- params: {
34
- chartTypeUuid: string;
35
- data?: {
36
- fileId: string;
37
- url: string;
38
- fileType?: import("../..").FILE_TYPE | undefined;
39
- }[] | undefined;
40
- };
44
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
41
45
  output: {
42
46
  versions: {
43
47
  uuid: string;
@@ -66,14 +70,7 @@ export declare namespace DiagramsCommand {
66
70
  internalError?: string | null | undefined;
67
71
  modelId: string;
68
72
  price: number;
69
- params: {
70
- chartTypeUuid: string;
71
- data?: {
72
- fileId: string;
73
- url: string;
74
- fileType?: import("../..").FILE_TYPE | undefined;
75
- }[] | undefined;
76
- };
73
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
77
74
  output: {
78
75
  versions: {
79
76
  uuid: string;
@@ -12,7 +12,7 @@ var DiagramsCommand;
12
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
13
  prompt: zod_1.z.string(),
14
14
  modelId: zod_1.z.string().uuid(),
15
- params: models_1.DiagramsJobParamsSchema,
15
+ params: models_1.DiagramsNewJobParamsSchema,
16
16
  tokenReservationId: zod_1.z.string().uuid(),
17
17
  precalculatedPrice: zod_1.z.number(),
18
18
  mock: zod_1.z.boolean().optional(),
@@ -9,7 +9,16 @@ export declare namespace EditDiagramsJobCommand {
9
9
  prompt: z.ZodString;
10
10
  parentVersionUuid: z.ZodString;
11
11
  modelId: z.ZodOptional<z.ZodString>;
12
- chartTypeUuid: z.ZodOptional<z.ZodString>;
12
+ params: z.ZodOptional<z.ZodObject<{
13
+ mode: z.ZodOptional<z.ZodEnum<typeof import("..").DIAGRAMS_MODE>>;
14
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
15
+ accentColor: z.ZodOptional<z.ZodString>;
16
+ data: z.ZodOptional<z.ZodArray<z.ZodObject<{
17
+ fileId: z.ZodString;
18
+ url: z.ZodString;
19
+ fileType: z.ZodOptional<z.ZodEnum<typeof import("../..").FILE_TYPE>>;
20
+ }, z.core.$strip>>>;
21
+ }, z.core.$strip>>;
13
22
  tokenReservationId: z.ZodString;
14
23
  precalculatedPrice: z.ZodNumber;
15
24
  data: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -29,14 +38,7 @@ export declare namespace EditDiagramsJobCommand {
29
38
  internalError?: string | null | undefined;
30
39
  modelId: string;
31
40
  price: number;
32
- params: {
33
- chartTypeUuid: string;
34
- data?: {
35
- fileId: string;
36
- url: string;
37
- fileType?: import("../..").FILE_TYPE | undefined;
38
- }[] | undefined;
39
- };
41
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
40
42
  output: {
41
43
  versions: {
42
44
  uuid: string;
@@ -65,14 +67,7 @@ export declare namespace EditDiagramsJobCommand {
65
67
  internalError?: string | null | undefined;
66
68
  modelId: string;
67
69
  price: number;
68
- params: {
69
- chartTypeUuid: string;
70
- data?: {
71
- fileId: string;
72
- url: string;
73
- fileType?: import("../..").FILE_TYPE | undefined;
74
- }[] | undefined;
75
- };
70
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
76
71
  output: {
77
72
  versions: {
78
73
  uuid: string;
@@ -15,7 +15,7 @@ var EditDiagramsJobCommand;
15
15
  prompt: zod_1.z.string(),
16
16
  parentVersionUuid: zod_1.z.string().uuid(),
17
17
  modelId: zod_1.z.string().uuid().optional(),
18
- chartTypeUuid: zod_1.z.string().uuid().optional(),
18
+ params: models_1.DiagramsJobParamsUpdateSchema.optional(),
19
19
  tokenReservationId: zod_1.z.string().uuid(),
20
20
  precalculatedPrice: zod_1.z.number(),
21
21
  data: zod_1.z
@@ -2,7 +2,25 @@ import { z } from 'zod';
2
2
  export declare namespace GetDiagramsPriceCalculationDataCommand {
3
3
  const RequestSchema: z.ZodObject<{
4
4
  modelId: z.ZodString;
5
- chartTypeUuid: z.ZodString;
5
+ params: z.ZodPipe<z.ZodObject<{
6
+ mode: z.ZodType<import("..").DIAGRAMS_MODE, unknown, z.core.$ZodTypeInternals<import("..").DIAGRAMS_MODE, unknown>>;
7
+ data: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
+ fileId: z.ZodString;
9
+ url: z.ZodString;
10
+ fileType: z.ZodOptional<z.ZodEnum<typeof import("../..").FILE_TYPE>>;
11
+ }, z.core.$strip>>>;
12
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
13
+ accentColor: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>, z.ZodTransform<import("..").DiagramsChartParams | import("..").DiagramsReportParams, {
15
+ mode: import("..").DIAGRAMS_MODE;
16
+ data?: {
17
+ fileId: string;
18
+ url: string;
19
+ fileType?: import("../..").FILE_TYPE | undefined;
20
+ }[] | undefined;
21
+ chartTypeUuid?: string | undefined;
22
+ accentColor?: string | undefined;
23
+ }>>;
6
24
  dataTextLength: z.ZodOptional<z.ZodNumber>;
7
25
  jobId: z.ZodOptional<z.ZodString>;
8
26
  parentVersionUuid: z.ZodOptional<z.ZodString>;
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetDiagramsPriceCalculationDataCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const common_1 = require("../../common");
6
+ const models_1 = require("../models");
6
7
  var GetDiagramsPriceCalculationDataCommand;
7
8
  (function (GetDiagramsPriceCalculationDataCommand) {
8
9
  GetDiagramsPriceCalculationDataCommand.RequestSchema = zod_1.z.object({
9
10
  modelId: zod_1.z.string().uuid(),
10
- chartTypeUuid: zod_1.z.string().uuid(),
11
+ params: models_1.DiagramsJobParamsSchema,
11
12
  dataTextLength: zod_1.z.number().int().nonnegative().optional(),
12
13
  jobId: zod_1.z.string().uuid().optional(),
13
14
  parentVersionUuid: zod_1.z.string().uuid().optional(),
@@ -8,7 +8,9 @@ export declare namespace RetryDiagramsJobCommand {
8
8
  prompt: z.ZodOptional<z.ZodString>;
9
9
  modelId: z.ZodOptional<z.ZodString>;
10
10
  params: z.ZodOptional<z.ZodObject<{
11
- chartTypeUuid: z.ZodString;
11
+ mode: z.ZodOptional<z.ZodEnum<typeof import("..").DIAGRAMS_MODE>>;
12
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
13
+ accentColor: z.ZodOptional<z.ZodString>;
12
14
  data: z.ZodOptional<z.ZodArray<z.ZodObject<{
13
15
  fileId: z.ZodString;
14
16
  url: z.ZodString;
@@ -31,14 +33,7 @@ export declare namespace RetryDiagramsJobCommand {
31
33
  internalError?: string | null | undefined;
32
34
  modelId: string;
33
35
  price: number;
34
- params: {
35
- chartTypeUuid: string;
36
- data?: {
37
- fileId: string;
38
- url: string;
39
- fileType?: import("../..").FILE_TYPE | undefined;
40
- }[] | undefined;
41
- };
36
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
42
37
  output: {
43
38
  versions: {
44
39
  uuid: string;
@@ -67,14 +62,7 @@ export declare namespace RetryDiagramsJobCommand {
67
62
  internalError?: string | null | undefined;
68
63
  modelId: string;
69
64
  price: number;
70
- params: {
71
- chartTypeUuid: string;
72
- data?: {
73
- fileId: string;
74
- url: string;
75
- fileType?: import("../..").FILE_TYPE | undefined;
76
- }[] | undefined;
77
- };
65
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
78
66
  output: {
79
67
  versions: {
80
68
  uuid: string;
@@ -14,7 +14,7 @@ var RetryDiagramsJobCommand;
14
14
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
15
15
  prompt: zod_1.z.string().optional(),
16
16
  modelId: zod_1.z.string().uuid().optional(),
17
- params: models_1.DiagramsJobParamsSchema.optional(),
17
+ params: models_1.DiagramsJobParamsUpdateSchema.optional(),
18
18
  tokenReservationId: zod_1.z.string().uuid(),
19
19
  precalculatedPrice: zod_1.z.number(),
20
20
  mock: zod_1.z.boolean().optional(),
@@ -20,14 +20,7 @@ export declare namespace SetReactionToDiagramsJobCommand {
20
20
  internalError?: string | null | undefined;
21
21
  modelId: string;
22
22
  price: number;
23
- params: {
24
- chartTypeUuid: string;
25
- data?: {
26
- fileId: string;
27
- url: string;
28
- fileType?: import("../..").FILE_TYPE | undefined;
29
- }[] | undefined;
30
- };
23
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
31
24
  output: {
32
25
  versions: {
33
26
  uuid: string;
@@ -56,14 +49,7 @@ export declare namespace SetReactionToDiagramsJobCommand {
56
49
  internalError?: string | null | undefined;
57
50
  modelId: string;
58
51
  price: number;
59
- params: {
60
- chartTypeUuid: string;
61
- data?: {
62
- fileId: string;
63
- url: string;
64
- fileType?: import("../..").FILE_TYPE | undefined;
65
- }[] | undefined;
66
- };
52
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
67
53
  output: {
68
54
  versions: {
69
55
  uuid: string;
@@ -18,14 +18,7 @@ export declare namespace UpdateDiagramsJobFavoriteCommand {
18
18
  internalError?: string | null | undefined;
19
19
  modelId: string;
20
20
  price: number;
21
- params: {
22
- chartTypeUuid: string;
23
- data?: {
24
- fileId: string;
25
- url: string;
26
- fileType?: import("../..").FILE_TYPE | undefined;
27
- }[] | undefined;
28
- };
21
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
29
22
  output: {
30
23
  versions: {
31
24
  uuid: string;
@@ -54,14 +47,7 @@ export declare namespace UpdateDiagramsJobFavoriteCommand {
54
47
  internalError?: string | null | undefined;
55
48
  modelId: string;
56
49
  price: number;
57
- params: {
58
- chartTypeUuid: string;
59
- data?: {
60
- fileId: string;
61
- url: string;
62
- fileType?: import("../..").FILE_TYPE | undefined;
63
- }[] | undefined;
64
- };
50
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
65
51
  output: {
66
52
  versions: {
67
53
  uuid: string;
@@ -22,14 +22,7 @@ export declare namespace UpdateDiagramsJobTitleCommand {
22
22
  internalError?: string | null | undefined;
23
23
  modelId: string;
24
24
  price: number;
25
- params: {
26
- chartTypeUuid: string;
27
- data?: {
28
- fileId: string;
29
- url: string;
30
- fileType?: import("../..").FILE_TYPE | undefined;
31
- }[] | undefined;
32
- };
25
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
33
26
  output: {
34
27
  versions: {
35
28
  uuid: string;
@@ -58,14 +51,7 @@ export declare namespace UpdateDiagramsJobTitleCommand {
58
51
  internalError?: string | null | undefined;
59
52
  modelId: string;
60
53
  price: number;
61
- params: {
62
- chartTypeUuid: string;
63
- data?: {
64
- fileId: string;
65
- url: string;
66
- fileType?: import("../..").FILE_TYPE | undefined;
67
- }[] | undefined;
68
- };
54
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
69
55
  output: {
70
56
  versions: {
71
57
  uuid: string;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { DIAGRAMS_MODE } from './diagrams-mode.enum';
2
3
  export declare const DiagramsConfigSchema: z.ZodObject<{
3
4
  models: z.ZodArray<z.ZodObject<{
4
5
  uuid: z.ZodString;
@@ -52,5 +53,6 @@ export declare const DiagramsConfigSchema: z.ZodObject<{
52
53
  createdAt: z.ZodDate;
53
54
  updatedAt: z.ZodDate;
54
55
  }, z.core.$strip>>;
56
+ modes: z.ZodArray<z.ZodEnum<typeof DIAGRAMS_MODE>>;
55
57
  }, z.core.$strip>;
56
58
  export type DiagramsConfig = z.infer<typeof DiagramsConfigSchema>;
@@ -4,7 +4,9 @@ exports.DiagramsConfigSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const diagrams_model_schema_1 = require("./diagrams-model.schema");
6
6
  const diagrams_chart_type_schema_1 = require("./diagrams-chart-type.schema");
7
+ const diagrams_mode_enum_1 = require("./diagrams-mode.enum");
7
8
  exports.DiagramsConfigSchema = zod_1.z.object({
8
9
  models: zod_1.z.array(diagrams_model_schema_1.DiagramsModelSchema),
9
10
  chartTypes: zod_1.z.array(diagrams_chart_type_schema_1.DiagramsChartTypeSchema),
11
+ modes: zod_1.z.array(zod_1.z.nativeEnum(diagrams_mode_enum_1.DIAGRAMS_MODE)),
10
12
  });
@@ -1,15 +1,74 @@
1
1
  import { z } from 'zod';
2
- import { JOB_STATUS } from '../../tools';
2
+ import { JOB_STATUS } from '../../tools/enums/job-status.enum';
3
3
  import { FILE_TYPE, USER_REACTION } from '../../common';
4
- export declare const DiagramsJobParamsSchema: z.ZodObject<{
5
- chartTypeUuid: z.ZodString;
4
+ import { DIAGRAMS_MODE } from './diagrams-mode.enum';
5
+ export declare const DiagramsModeSchema: z.ZodEnum<typeof DIAGRAMS_MODE>;
6
+ export declare const DiagramsReportAccentColorSchema: z.ZodString;
7
+ export declare const DiagramsJobDataSchema: z.ZodOptional<z.ZodArray<z.ZodObject<{
8
+ fileId: z.ZodString;
9
+ url: z.ZodString;
10
+ fileType: z.ZodOptional<z.ZodEnum<typeof FILE_TYPE>>;
11
+ }, z.core.$strip>>>;
12
+ type DiagramsJobData = z.infer<typeof DiagramsJobDataSchema>;
13
+ export type DiagramsChartParams = {
14
+ mode: DIAGRAMS_MODE.CHART;
15
+ data: DiagramsJobData;
16
+ chartTypeUuid: string;
17
+ };
18
+ export type DiagramsReportParams = {
19
+ mode: DIAGRAMS_MODE.REPORT;
20
+ data: DiagramsJobData;
21
+ accentColor: string;
22
+ };
23
+ export type DiagramsJobParams = DiagramsChartParams | DiagramsReportParams;
24
+ export declare const DiagramsNewJobParamsSchema: z.ZodPipe<z.ZodObject<{
25
+ mode: z.ZodType<DIAGRAMS_MODE, unknown, z.core.$ZodTypeInternals<DIAGRAMS_MODE, unknown>>;
26
+ data: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
+ fileId: z.ZodString;
28
+ url: z.ZodString;
29
+ fileType: z.ZodOptional<z.ZodEnum<typeof FILE_TYPE>>;
30
+ }, z.core.$strip>>>;
31
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
32
+ accentColor: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strip>, z.ZodTransform<DiagramsChartParams | DiagramsReportParams, {
34
+ mode: DIAGRAMS_MODE;
35
+ data?: {
36
+ fileId: string;
37
+ url: string;
38
+ fileType?: FILE_TYPE | undefined;
39
+ }[] | undefined;
40
+ chartTypeUuid?: string | undefined;
41
+ accentColor?: string | undefined;
42
+ }>>;
43
+ export declare const DiagramsJobParamsSchema: z.ZodPipe<z.ZodObject<{
44
+ mode: z.ZodType<DIAGRAMS_MODE, unknown, z.core.$ZodTypeInternals<DIAGRAMS_MODE, unknown>>;
45
+ data: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ fileId: z.ZodString;
47
+ url: z.ZodString;
48
+ fileType: z.ZodOptional<z.ZodEnum<typeof FILE_TYPE>>;
49
+ }, z.core.$strip>>>;
50
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
51
+ accentColor: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>, z.ZodTransform<DiagramsChartParams | DiagramsReportParams, {
53
+ mode: DIAGRAMS_MODE;
54
+ data?: {
55
+ fileId: string;
56
+ url: string;
57
+ fileType?: FILE_TYPE | undefined;
58
+ }[] | undefined;
59
+ chartTypeUuid?: string | undefined;
60
+ accentColor?: string | undefined;
61
+ }>>;
62
+ export declare const DiagramsJobParamsUpdateSchema: z.ZodObject<{
63
+ mode: z.ZodOptional<z.ZodEnum<typeof DIAGRAMS_MODE>>;
64
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
65
+ accentColor: z.ZodOptional<z.ZodString>;
6
66
  data: z.ZodOptional<z.ZodArray<z.ZodObject<{
7
67
  fileId: z.ZodString;
8
68
  url: z.ZodString;
9
69
  fileType: z.ZodOptional<z.ZodEnum<typeof FILE_TYPE>>;
10
70
  }, z.core.$strip>>>;
11
71
  }, z.core.$strip>;
12
- export type DiagramsJobParams = z.infer<typeof DiagramsJobParamsSchema>;
13
72
  export declare const DiagramsJobOutputSchema: z.ZodObject<{
14
73
  versions: z.ZodArray<z.ZodObject<{
15
74
  uuid: z.ZodString;
@@ -28,14 +87,25 @@ export declare const DiagramsJobSchema: z.ZodObject<{
28
87
  internalError: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
88
  modelId: z.ZodString;
30
89
  price: z.ZodNumber;
31
- params: z.ZodObject<{
32
- chartTypeUuid: z.ZodString;
90
+ params: z.ZodPipe<z.ZodObject<{
91
+ mode: z.ZodType<DIAGRAMS_MODE, unknown, z.core.$ZodTypeInternals<DIAGRAMS_MODE, unknown>>;
33
92
  data: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
93
  fileId: z.ZodString;
35
94
  url: z.ZodString;
36
95
  fileType: z.ZodOptional<z.ZodEnum<typeof FILE_TYPE>>;
37
96
  }, z.core.$strip>>>;
38
- }, z.core.$strip>;
97
+ chartTypeUuid: z.ZodOptional<z.ZodString>;
98
+ accentColor: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>, z.ZodTransform<DiagramsChartParams | DiagramsReportParams, {
100
+ mode: DIAGRAMS_MODE;
101
+ data?: {
102
+ fileId: string;
103
+ url: string;
104
+ fileType?: FILE_TYPE | undefined;
105
+ }[] | undefined;
106
+ chartTypeUuid?: string | undefined;
107
+ accentColor?: string | undefined;
108
+ }>>;
39
109
  output: z.ZodObject<{
40
110
  versions: z.ZodArray<z.ZodObject<{
41
111
  uuid: z.ZodString;
@@ -57,3 +127,4 @@ export declare const DiagramsJobSchema: z.ZodObject<{
57
127
  updatedAt: z.ZodDate;
58
128
  }, z.core.$strip>;
59
129
  export type DiagramsJob = z.infer<typeof DiagramsJobSchema>;
130
+ export {};
@@ -1,18 +1,72 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DiagramsJobSchema = exports.DiagramsJobOutputSchema = exports.DiagramsJobParamsSchema = void 0;
3
+ exports.DiagramsJobSchema = exports.DiagramsJobOutputSchema = exports.DiagramsJobParamsUpdateSchema = exports.DiagramsJobParamsSchema = exports.DiagramsNewJobParamsSchema = exports.DiagramsJobDataSchema = exports.DiagramsReportAccentColorSchema = exports.DiagramsModeSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const tools_1 = require("../../tools");
5
+ const job_status_enum_1 = require("../../tools/enums/job-status.enum");
6
6
  const common_1 = require("../../common");
7
- exports.DiagramsJobParamsSchema = zod_1.z.object({
8
- chartTypeUuid: zod_1.z.string().uuid(),
9
- data: zod_1.z
10
- .array(zod_1.z.object({
11
- fileId: zod_1.z.string().uuid(),
12
- url: zod_1.z.string(),
13
- fileType: zod_1.z.nativeEnum(common_1.FILE_TYPE).optional(),
14
- }))
15
- .optional(),
7
+ const diagrams_mode_enum_1 = require("./diagrams-mode.enum");
8
+ exports.DiagramsModeSchema = zod_1.z.nativeEnum(diagrams_mode_enum_1.DIAGRAMS_MODE);
9
+ exports.DiagramsReportAccentColorSchema = zod_1.z
10
+ .string()
11
+ .regex(/^#[0-9a-fA-F]{6}$/, 'Expected a hexadecimal color in #RRGGBB format');
12
+ exports.DiagramsJobDataSchema = zod_1.z
13
+ .array(zod_1.z.object({
14
+ fileId: zod_1.z.string().uuid(),
15
+ url: zod_1.z.string(),
16
+ fileType: zod_1.z.nativeEnum(common_1.FILE_TYPE).optional(),
17
+ }))
18
+ .optional();
19
+ const createDiagramsJobParamsSchema = (mode) => zod_1.z
20
+ .object({
21
+ mode,
22
+ data: exports.DiagramsJobDataSchema,
23
+ chartTypeUuid: zod_1.z.string().uuid().optional(),
24
+ accentColor: exports.DiagramsReportAccentColorSchema.optional(),
25
+ })
26
+ .superRefine((params, ctx) => {
27
+ if (params.mode === diagrams_mode_enum_1.DIAGRAMS_MODE.CHART && !params.chartTypeUuid) {
28
+ ctx.addIssue({
29
+ code: zod_1.z.ZodIssueCode.custom,
30
+ message: 'chartTypeUuid is required for chart mode',
31
+ path: ['chartTypeUuid'],
32
+ });
33
+ }
34
+ if (params.mode === diagrams_mode_enum_1.DIAGRAMS_MODE.REPORT && !params.accentColor) {
35
+ ctx.addIssue({
36
+ code: zod_1.z.ZodIssueCode.custom,
37
+ message: 'accentColor is required for report mode',
38
+ path: ['accentColor'],
39
+ });
40
+ }
41
+ })
42
+ .transform((params) => {
43
+ if (params.mode === diagrams_mode_enum_1.DIAGRAMS_MODE.REPORT) {
44
+ if (!params.accentColor) {
45
+ throw new Error('accentColor is required for report mode');
46
+ }
47
+ return {
48
+ mode: diagrams_mode_enum_1.DIAGRAMS_MODE.REPORT,
49
+ accentColor: params.accentColor,
50
+ data: params.data,
51
+ };
52
+ }
53
+ if (!params.chartTypeUuid) {
54
+ throw new Error('chartTypeUuid is required for chart mode');
55
+ }
56
+ return {
57
+ mode: diagrams_mode_enum_1.DIAGRAMS_MODE.CHART,
58
+ chartTypeUuid: params.chartTypeUuid,
59
+ data: params.data,
60
+ };
61
+ });
62
+ exports.DiagramsNewJobParamsSchema = createDiagramsJobParamsSchema(exports.DiagramsModeSchema);
63
+ // Jobs persisted before modes existed are chart jobs.
64
+ exports.DiagramsJobParamsSchema = createDiagramsJobParamsSchema(exports.DiagramsModeSchema.default(diagrams_mode_enum_1.DIAGRAMS_MODE.CHART));
65
+ exports.DiagramsJobParamsUpdateSchema = zod_1.z.object({
66
+ mode: exports.DiagramsModeSchema.optional(),
67
+ chartTypeUuid: zod_1.z.string().uuid().optional(),
68
+ accentColor: exports.DiagramsReportAccentColorSchema.optional(),
69
+ data: exports.DiagramsJobDataSchema,
16
70
  });
17
71
  exports.DiagramsJobOutputSchema = zod_1.z.object({
18
72
  versions: zod_1.z.array(zod_1.z.object({
@@ -26,7 +80,7 @@ exports.DiagramsJobSchema = zod_1.z.object({
26
80
  uuid: zod_1.z.string(),
27
81
  prompt: zod_1.z.string(),
28
82
  title: zod_1.z.string(),
29
- status: zod_1.z.nativeEnum(tools_1.JOB_STATUS),
83
+ status: zod_1.z.nativeEnum(job_status_enum_1.JOB_STATUS),
30
84
  error: zod_1.z.string().nullable(),
31
85
  internalError: zod_1.z.string().nullable().optional(),
32
86
  modelId: zod_1.z.string(),
@@ -0,0 +1,4 @@
1
+ export declare enum DIAGRAMS_MODE {
2
+ CHART = "chart",
3
+ REPORT = "report"
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DIAGRAMS_MODE = void 0;
4
+ var DIAGRAMS_MODE;
5
+ (function (DIAGRAMS_MODE) {
6
+ DIAGRAMS_MODE["CHART"] = "chart";
7
+ DIAGRAMS_MODE["REPORT"] = "report";
8
+ })(DIAGRAMS_MODE || (exports.DIAGRAMS_MODE = DIAGRAMS_MODE = {}));
@@ -2,3 +2,4 @@ export * from './diagrams-config.schema';
2
2
  export * from './diagrams-chart-type.schema';
3
3
  export * from './diagrams-job.schema';
4
4
  export * from './diagrams-model.schema';
5
+ export * from './diagrams-mode.enum';
@@ -18,3 +18,4 @@ __exportStar(require("./diagrams-config.schema"), exports);
18
18
  __exportStar(require("./diagrams-chart-type.schema"), exports);
19
19
  __exportStar(require("./diagrams-job.schema"), exports);
20
20
  __exportStar(require("./diagrams-model.schema"), exports);
21
+ __exportStar(require("./diagrams-mode.enum"), exports);
@@ -17,14 +17,7 @@ export declare namespace FindDiagramsJobByUuidQuery {
17
17
  internalError?: string | null | undefined;
18
18
  modelId: string;
19
19
  price: number;
20
- params: {
21
- chartTypeUuid: string;
22
- data?: {
23
- fileId: string;
24
- url: string;
25
- fileType?: import("../..").FILE_TYPE | undefined;
26
- }[] | undefined;
27
- };
20
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
28
21
  output: {
29
22
  versions: {
30
23
  uuid: string;
@@ -53,14 +46,7 @@ export declare namespace FindDiagramsJobByUuidQuery {
53
46
  internalError?: string | null | undefined;
54
47
  modelId: string;
55
48
  price: number;
56
- params: {
57
- chartTypeUuid: string;
58
- data?: {
59
- fileId: string;
60
- url: string;
61
- fileType?: import("../..").FILE_TYPE | undefined;
62
- }[] | undefined;
63
- };
49
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
64
50
  output: {
65
51
  versions: {
66
52
  uuid: string;
@@ -24,14 +24,7 @@ export declare namespace FindDiagramsJobsQuery {
24
24
  internalError?: string | null | undefined;
25
25
  modelId: string;
26
26
  price: number;
27
- params: {
28
- chartTypeUuid: string;
29
- data?: {
30
- fileId: string;
31
- url: string;
32
- fileType?: import("../..").FILE_TYPE | undefined;
33
- }[] | undefined;
34
- };
27
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
35
28
  output: {
36
29
  versions: {
37
30
  uuid: string;
@@ -65,14 +58,7 @@ export declare namespace FindDiagramsJobsQuery {
65
58
  internalError?: string | null | undefined;
66
59
  modelId: string;
67
60
  price: number;
68
- params: {
69
- chartTypeUuid: string;
70
- data?: {
71
- fileId: string;
72
- url: string;
73
- fileType?: import("../..").FILE_TYPE | undefined;
74
- }[] | undefined;
75
- };
61
+ params: import("..").DiagramsChartParams | import("..").DiagramsReportParams;
76
62
  output: {
77
63
  versions: {
78
64
  uuid: string;
@@ -59,6 +59,7 @@ export declare namespace GetDiagramsConfigQuery {
59
59
  createdAt: Date;
60
60
  updatedAt: Date;
61
61
  }[];
62
+ modes: import("..").DIAGRAMS_MODE[];
62
63
  }, unknown, z.core.$ZodTypeInternals<{
63
64
  models: {
64
65
  uuid: string;
@@ -112,6 +113,7 @@ export declare namespace GetDiagramsConfigQuery {
112
113
  createdAt: Date;
113
114
  updatedAt: Date;
114
115
  }[];
116
+ modes: import("..").DIAGRAMS_MODE[];
115
117
  }, unknown>>>;
116
118
  code: z.ZodOptional<z.ZodString>;
117
119
  message: z.ZodOptional<z.ZodString>;
@@ -874,6 +874,7 @@ export declare const GlobalToolsConfigSchema: z.ZodObject<{
874
874
  createdAt: z.ZodDate;
875
875
  updatedAt: z.ZodDate;
876
876
  }, z.core.$strip>>;
877
+ modes: z.ZodArray<z.ZodEnum<typeof import("../..").DIAGRAMS_MODE>>;
877
878
  }, z.core.$strip>;
878
879
  HTML_PAGE_BUILDER: z.ZodObject<{
879
880
  models: z.ZodArray<z.ZodObject<{
@@ -1054,6 +1054,7 @@ export declare const ToolWithConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<
1054
1054
  createdAt: z.ZodDate;
1055
1055
  updatedAt: z.ZodDate;
1056
1056
  }, z.core.$strip>>;
1057
+ modes: z.ZodArray<z.ZodEnum<typeof import("../..").DIAGRAMS_MODE>>;
1057
1058
  }, z.core.$strip>;
1058
1059
  }, z.core.$strip>, z.ZodObject<{
1059
1060
  uuid: z.ZodString;
@@ -2257,6 +2258,7 @@ export declare const ToolsWithConfigsSchema: z.ZodArray<z.ZodDiscriminatedUnion<
2257
2258
  createdAt: z.ZodDate;
2258
2259
  updatedAt: z.ZodDate;
2259
2260
  }, z.core.$strip>>;
2261
+ modes: z.ZodArray<z.ZodEnum<typeof import("../..").DIAGRAMS_MODE>>;
2260
2262
  }, z.core.$strip>;
2261
2263
  }, z.core.$strip>, z.ZodObject<{
2262
2264
  uuid: z.ZodString;
@@ -881,6 +881,7 @@ export declare namespace GetGlobalToolsConfigQuery {
881
881
  createdAt: Date;
882
882
  updatedAt: Date;
883
883
  }[];
884
+ modes: import("../..").DIAGRAMS_MODE[];
884
885
  };
885
886
  HTML_PAGE_BUILDER: {
886
887
  models: {
@@ -1867,6 +1868,7 @@ export declare namespace GetGlobalToolsConfigQuery {
1867
1868
  createdAt: Date;
1868
1869
  updatedAt: Date;
1869
1870
  }[];
1871
+ modes: import("../..").DIAGRAMS_MODE[];
1870
1872
  };
1871
1873
  HTML_PAGE_BUILDER: {
1872
1874
  models: {
@@ -1060,6 +1060,7 @@ export declare namespace GetToolsWithConfigsQuery {
1060
1060
  createdAt: Date;
1061
1061
  updatedAt: Date;
1062
1062
  }[];
1063
+ modes: import("../..").DIAGRAMS_MODE[];
1063
1064
  };
1064
1065
  } | {
1065
1066
  uuid: string;
@@ -2261,6 +2262,7 @@ export declare namespace GetToolsWithConfigsQuery {
2261
2262
  createdAt: Date;
2262
2263
  updatedAt: Date;
2263
2264
  }[];
2265
+ modes: import("../..").DIAGRAMS_MODE[];
2264
2266
  };
2265
2267
  } | {
2266
2268
  uuid: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.2.67",
3
+ "version": "0.2.68",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "files": [