@purpleschool/gptbot-tools 0.2.20-stage → 0.2.22-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 (119) hide show
  1. package/build/common/models/index.js +1 -0
  2. package/build/common/models/locale.schema.js +9 -0
  3. package/build/diagrams/commands/diagrams.command.js +1 -0
  4. package/build/diagrams/commands/edit-diagrams-job.command.js +1 -0
  5. package/build/diagrams/commands/retry-diagrams-job.command.js +2 -0
  6. package/build/diagrams/models/diagrams-model.schema.js +0 -2
  7. package/build/diagrams/queries/get-diagrams-config.query.js +3 -4
  8. package/build/html-page-builder/commands/get-html-page-builder-price.command.js +17 -0
  9. package/build/html-page-builder/queries/get-html-page-builder-config.query.js +1 -2
  10. package/build/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.js +1 -0
  11. package/build/image-editor/commands/image-editor.command.js +2 -0
  12. package/build/image-editor/commands/retry-image-editor-job.command.js +2 -0
  13. package/build/image-editor/queries/get-image-editor-config.query.js +3 -2
  14. package/build/image-generation/commands/execute-image-generation.command.js +4 -2
  15. package/build/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.js +1 -0
  16. package/build/image-generation/commands/retry-image-generation-job.command.js +2 -0
  17. package/build/image-generation/models/image-generation-job.schema.js +3 -1
  18. package/build/image-generation/queries/find-image-generation-jobs.query.js +2 -2
  19. package/build/image-generation/queries/get-image-generation-config.query.js +3 -4
  20. package/build/interior-design/commands/get-interior-design-price.command.js +1 -0
  21. package/build/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.js +1 -0
  22. package/build/interior-design/commands/interior-design.command.js +1 -0
  23. package/build/interior-design/commands/retry-interior-design-job.command.js +2 -0
  24. package/build/interior-design/queries/get-interior-design-config.query.js +3 -2
  25. package/build/marketplace-card/commands/execute-marketplace-card.command.js +1 -0
  26. package/build/marketplace-card/commands/retry-marketplace-card-job.command.js +1 -0
  27. package/build/marketplace-card/queries/get-marketplace-card-config.query.js +1 -2
  28. package/build/music/commands/generate-lyrics.command.js +2 -0
  29. package/build/music/commands/generate-music.command.js +2 -0
  30. package/build/music/commands/music-model/get-music-model-by-uuid.command.js +1 -0
  31. package/build/music/commands/retry-music-job.command.js +2 -0
  32. package/build/music/queries/get-music-config.query.js +3 -2
  33. package/build/paraphrase/queries/get-paraphrase-tool-config.query.js +3 -2
  34. package/build/presentation/commands/create-presentation.command.js +1 -0
  35. package/build/presentation/commands/generate-and-insert-slide.command.js +1 -0
  36. package/build/presentation/commands/generate-slides.command.js +1 -0
  37. package/build/presentation/queries/get-presentation-config.query.js +1 -0
  38. package/build/solving-edu-task/commands/retry-solving-edu-task-job.command.js +2 -0
  39. package/build/solving-edu-task/commands/solving-edu-task.command.js +1 -0
  40. package/build/solving-edu-task/queries/get-solving-edu-task-config.query.js +1 -2
  41. package/build/spell-corrector/queries/get-spell-corrector-tool-config.query.js +3 -2
  42. package/build/stt/queries/get-stt-config.query.js +3 -2
  43. package/build/tools/enums/index.js +0 -1
  44. package/build/tools/events/tool-job-complete.event.js +2 -1
  45. package/build/tools/queries/find-all-tools.query.js +1 -0
  46. package/build/tools/queries/find-grouped-tools.query.js +1 -0
  47. package/build/tools/queries/get-global-tools-config.query.js +3 -2
  48. package/build/tools/queries/get-tools-with-configs.query.js +3 -2
  49. package/build/tts/queries/get-tts-config.query.js +3 -2
  50. package/build/video/commands/retry-video-job.command.js +2 -0
  51. package/build/video/commands/video-model/get-video-model-by-uuid.command.js +1 -0
  52. package/build/video/commands/video.command.js +2 -0
  53. package/build/video/queries/get-video-config.query.js +3 -2
  54. package/build/video-editor/commands/video-editor-model/get-video-editor-model.command.js +1 -0
  55. package/build/video-editor/queries/get-video-editor-config.query.js +3 -4
  56. package/build/writer/commands/create-writer-document.command.js +1 -0
  57. package/build/writer/commands/generate-document-outline.command.js +2 -0
  58. package/build/writer/queries/get-writer-config.query.js +1 -0
  59. package/common/models/index.ts +1 -0
  60. package/common/models/locale.schema.ts +11 -0
  61. package/diagrams/commands/diagrams.command.ts +2 -1
  62. package/diagrams/commands/edit-diagrams-job.command.ts +2 -1
  63. package/diagrams/commands/retry-diagrams-job.command.ts +2 -0
  64. package/diagrams/models/diagrams-model.schema.ts +0 -2
  65. package/diagrams/queries/get-diagrams-config.query.ts +3 -3
  66. package/html-page-builder/commands/get-html-page-builder-price.command.ts +19 -0
  67. package/html-page-builder/queries/get-html-page-builder-config.query.ts +2 -2
  68. package/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.ts +2 -1
  69. package/image-editor/commands/image-editor.command.ts +2 -0
  70. package/image-editor/commands/retry-image-editor-job.command.ts +2 -0
  71. package/image-editor/queries/get-image-editor-config.query.ts +4 -1
  72. package/image-generation/commands/execute-image-generation.command.ts +4 -2
  73. package/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.ts +2 -1
  74. package/image-generation/commands/retry-image-generation-job.command.ts +2 -0
  75. package/image-generation/models/image-generation-job.schema.ts +4 -2
  76. package/image-generation/queries/find-image-generation-jobs.query.ts +2 -2
  77. package/image-generation/queries/get-image-generation-config.query.ts +2 -2
  78. package/interior-design/commands/get-interior-design-price.command.ts +2 -1
  79. package/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.ts +2 -1
  80. package/interior-design/commands/interior-design.command.ts +2 -1
  81. package/interior-design/commands/retry-interior-design-job.command.ts +2 -0
  82. package/interior-design/queries/get-interior-design-config.query.ts +4 -1
  83. package/marketplace-card/commands/execute-marketplace-card.command.ts +2 -1
  84. package/marketplace-card/commands/retry-marketplace-card-job.command.ts +2 -1
  85. package/marketplace-card/queries/get-marketplace-card-config.query.ts +2 -2
  86. package/music/commands/generate-lyrics.command.ts +2 -0
  87. package/music/commands/generate-music.command.ts +2 -0
  88. package/music/commands/music-model/get-music-model-by-uuid.command.ts +2 -1
  89. package/music/commands/retry-music-job.command.ts +2 -0
  90. package/music/queries/get-music-config.query.ts +4 -1
  91. package/package.json +2 -1
  92. package/paraphrase/queries/get-paraphrase-tool-config.query.ts +4 -1
  93. package/presentation/commands/create-presentation.command.ts +2 -1
  94. package/presentation/commands/generate-and-insert-slide.command.ts +2 -1
  95. package/presentation/commands/generate-slides.command.ts +2 -1
  96. package/presentation/queries/get-presentation-config.query.ts +4 -1
  97. package/solving-edu-task/commands/retry-solving-edu-task-job.command.ts +2 -0
  98. package/solving-edu-task/commands/solving-edu-task.command.ts +2 -1
  99. package/solving-edu-task/queries/get-solving-edu-task-config.query.ts +2 -2
  100. package/spell-corrector/queries/get-spell-corrector-tool-config.query.ts +4 -1
  101. package/stt/queries/get-stt-config.query.ts +4 -1
  102. package/tools/enums/index.ts +0 -1
  103. package/tools/events/tool-job-complete.event.ts +3 -2
  104. package/tools/queries/find-all-tools.query.ts +4 -1
  105. package/tools/queries/find-grouped-tools.query.ts +4 -1
  106. package/tools/queries/get-global-tools-config.query.ts +4 -1
  107. package/tools/queries/get-tools-with-configs.query.ts +4 -1
  108. package/tts/queries/get-tts-config.query.ts +4 -1
  109. package/video/commands/retry-video-job.command.ts +2 -0
  110. package/video/commands/video-model/get-video-model-by-uuid.command.ts +2 -1
  111. package/video/commands/video.command.ts +2 -0
  112. package/video/queries/get-video-config.query.ts +4 -1
  113. package/video-editor/commands/video-editor-model/get-video-editor-model.command.ts +2 -1
  114. package/video-editor/queries/get-video-editor-config.query.ts +2 -2
  115. package/writer/commands/create-writer-document.command.ts +2 -1
  116. package/writer/commands/generate-document-outline.command.ts +2 -0
  117. package/writer/queries/get-writer-config.query.ts +4 -1
  118. package/build/tools/enums/job-request-origin.enum.js +0 -8
  119. package/tools/enums/job-request-origin.enum.ts +0 -4
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetTTSConfigQuery = void 0;
4
- const command_response_schema_1 = require("../../common/models/command-response.schema");
4
+ const common_1 = require("../../common");
5
5
  const models_1 = require("../models");
6
6
  var GetTTSConfigQuery;
7
7
  (function (GetTTSConfigQuery) {
8
- GetTTSConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.TTSConfigSchema);
8
+ GetTTSConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
+ GetTTSConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.TTSConfigSchema);
9
10
  })(GetTTSConfigQuery || (exports.GetTTSConfigQuery = GetTTSConfigQuery = {}));
@@ -5,9 +5,11 @@ const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
6
  const video_job_schema_1 = require("../models/video-job.schema");
7
7
  const models_1 = require("../models");
8
+ const common_1 = require("../../common");
8
9
  var RetryVideoJobCommand;
9
10
  (function (RetryVideoJobCommand) {
10
11
  RetryVideoJobCommand.RequestSchema = zod_1.z.object({
12
+ locale: common_1.LocaleSchema,
11
13
  uuid: zod_1.z.string().uuid(),
12
14
  userId: zod_1.z.string().uuid().nullable().optional(),
13
15
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
@@ -8,6 +8,7 @@ var GetVideoModelByUuidCommand;
8
8
  (function (GetVideoModelByUuidCommand) {
9
9
  GetVideoModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
+ locale: common_1.LocaleSchema,
11
12
  });
12
13
  GetVideoModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoModelSchema);
13
14
  })(GetVideoModelByUuidCommand || (exports.GetVideoModelByUuidCommand = GetVideoModelByUuidCommand = {}));
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VideoCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const locale_schema_1 = require("../../common/models/locale.schema");
6
7
  const tool_workspace_1 = require("../../tool-workspace");
7
8
  const tools_1 = require("../../tools");
8
9
  const video_job_schema_1 = require("../models/video-job.schema");
@@ -10,6 +11,7 @@ const models_1 = require("../models");
10
11
  var VideoCommand;
11
12
  (function (VideoCommand) {
12
13
  VideoCommand.RequestSchema = zod_1.z.object({
14
+ locale: locale_schema_1.LocaleSchema,
13
15
  userId: zod_1.z.string().uuid().nullable().optional(),
14
16
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
15
17
  workspaceId: zod_1.z.string().uuid().nullable().optional(),
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetVideoConfigQuery = void 0;
4
- const command_response_schema_1 = require("../../common/models/command-response.schema");
4
+ const common_1 = require("../../common");
5
5
  const models_1 = require("../models");
6
6
  var GetVideoConfigQuery;
7
7
  (function (GetVideoConfigQuery) {
8
- GetVideoConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoConfigSchema);
8
+ GetVideoConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
+ GetVideoConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoConfigSchema);
9
10
  })(GetVideoConfigQuery || (exports.GetVideoConfigQuery = GetVideoConfigQuery = {}));
@@ -8,6 +8,7 @@ var GetVideoEditorModelByUuidCommand;
8
8
  (function (GetVideoEditorModelByUuidCommand) {
9
9
  GetVideoEditorModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
+ locale: common_1.LocaleSchema,
11
12
  });
12
13
  GetVideoEditorModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoEditorModelSchema);
13
14
  })(GetVideoEditorModelByUuidCommand || (exports.GetVideoEditorModelByUuidCommand = GetVideoEditorModelByUuidCommand = {}));
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetVideoEditorConfigQuery = void 0;
4
- const zod_1 = require("zod");
5
- const command_response_schema_1 = require("../../common/models/command-response.schema");
4
+ const common_1 = require("../../common");
6
5
  const models_1 = require("../models");
7
6
  var GetVideoEditorConfigQuery;
8
7
  (function (GetVideoEditorConfigQuery) {
9
- GetVideoEditorConfigQuery.RequestSchema = zod_1.z.object({});
10
- GetVideoEditorConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoEditorConfigSchema);
8
+ GetVideoEditorConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
+ GetVideoEditorConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoEditorConfigSchema);
11
10
  })(GetVideoEditorConfigQuery || (exports.GetVideoEditorConfigQuery = GetVideoEditorConfigQuery = {}));
@@ -7,6 +7,7 @@ const models_1 = require("../models");
7
7
  var CreateWriterDocumentCommand;
8
8
  (function (CreateWriterDocumentCommand) {
9
9
  CreateWriterDocumentCommand.RequestSchema = zod_1.z.object({
10
+ locale: common_1.LocaleSchema,
10
11
  userId: zod_1.z.string().uuid().nullable().optional(),
11
12
  unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
12
13
  prompt: zod_1.z.string(),
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GenerateWriterDocumentOutlineCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const locale_schema_1 = require("../../common/models/locale.schema");
6
7
  const models_1 = require("../models");
7
8
  var GenerateWriterDocumentOutlineCommand;
8
9
  (function (GenerateWriterDocumentOutlineCommand) {
9
10
  GenerateWriterDocumentOutlineCommand.RequestSchema = zod_1.z.object({
10
11
  uuid: zod_1.z.string().uuid(),
12
+ locale: locale_schema_1.LocaleSchema,
11
13
  numPages: zod_1.z.number(),
12
14
  description: zod_1.z.string().nullable().optional(),
13
15
  userId: zod_1.z.string().uuid().nullable().optional(),
@@ -5,5 +5,6 @@ const common_1 = require("../../common");
5
5
  const models_1 = require("../models");
6
6
  var GetWriterConfigQuery;
7
7
  (function (GetWriterConfigQuery) {
8
+ GetWriterConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
8
9
  GetWriterConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.WriterConfigSchema);
9
10
  })(GetWriterConfigQuery || (exports.GetWriterConfigQuery = GetWriterConfigQuery = {}));
@@ -1,3 +1,4 @@
1
1
  export * from './command-response.schema';
2
2
  export * from './icon-variants.schema';
3
3
  export * from './attached-file.schema';
4
+ export * from './locale.schema';
@@ -0,0 +1,11 @@
1
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
+ import { z } from 'zod';
3
+
4
+ export const LocaleSchema = z.nativeEnum(LOCALE);
5
+
6
+ export const LocaleRequestSchema = z.object({
7
+ locale: LocaleSchema,
8
+ });
9
+
10
+ export type Locale = z.infer<typeof LocaleSchema>;
11
+ export type LocaleRequest = z.infer<typeof LocaleRequestSchema>;
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common';
2
+ import { ICommandResponseSchema, LocaleSchema } from '../../common';
3
3
  import { DiagramsJobParamsSchema, DiagramsJobSchema } from '../models';
4
4
 
5
5
  export namespace DiagramsCommand {
6
6
  export const RequestSchema = z.object({
7
+ locale: LocaleSchema,
7
8
  userId: z.string().uuid().nullable().optional(),
8
9
  unregisteredUserId: z.string().uuid().nullable().optional(),
9
10
  prompt: z.string(),
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common';
2
+ import { ICommandResponseSchema, LocaleSchema } from '../../common';
3
3
  import { DiagramsJobSchema } from '../models';
4
4
 
5
5
  export namespace EditDiagramsJobCommand {
6
6
  export const RequestSchema = z.object({
7
+ locale: LocaleSchema,
7
8
  userId: z.string().uuid().nullable().optional(),
8
9
  unregisteredUserId: z.string().uuid().nullable().optional(),
9
10
  uuid: z.string().uuid(),
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { LocaleSchema } from '../../common/models/locale.schema';
3
4
  import { DiagramsJobParamsSchema, DiagramsJobSchema } from '../models';
4
5
 
5
6
  export namespace RetryDiagramsJobCommand {
6
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
7
9
  uuid: z.string().uuid(),
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
@@ -4,8 +4,6 @@ import { IconVariantsSchema, TOOL_MODEL_STATUS } from '../../common';
4
4
  export const DiagramsModelConfigSchema = z.object({
5
5
  dataAttachment: z.object({
6
6
  supported: z.boolean(),
7
- maxFileSizeMb: z.number(),
8
- acceptedTypes: z.array(z.string()),
9
7
  }),
10
8
  });
11
9
 
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { DiagramsConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetDiagramsConfigQuery {
6
- export const Request = z.object({});
7
- export type Request = z.infer<typeof Request>;
6
+ export const RequestSchema = LocaleRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
8
  export const ResponseSchema = ICommandResponseSchema(DiagramsConfigSchema);
9
9
  export type Response = z.infer<typeof ResponseSchema>;
10
10
  }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+
4
+ export namespace GetHtmlPageBuilderPriceCommand {
5
+ export const RequestSchema = z.object({
6
+ modelId: z.string().uuid(),
7
+ userPrompt: z.string(),
8
+ sessionId: z.string().uuid().nullable().optional(),
9
+ });
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseDataSchema = z.object({
13
+ price: z.number(),
14
+ });
15
+ export type ResponseData = z.infer<typeof ResponseDataSchema>;
16
+
17
+ export const ResponseSchema = ICommandResponseSchema(ResponseDataSchema);
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { HtmlPageBuilderConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetHtmlPageBuilderConfigQuery {
6
- export const RequestSchema = z.object({});
6
+ export const RequestSchema = LocaleRequestSchema;
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
 
9
9
  export const ResponseSchema = ICommandResponseSchema(HtmlPageBuilderConfigSchema);
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ImageEditorModelSchema } from '../../models';
3
- import { ICommandResponseSchema } from '../../../common';
3
+ import { ICommandResponseSchema, LocaleSchema } from '../../../common';
4
4
 
5
5
  export namespace GetImageEditorModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
+ locale: LocaleSchema,
8
9
  });
9
10
  export type Request = z.infer<typeof RequestSchema>;
10
11
 
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { LocaleSchema } from '../../common/models/locale.schema';
3
4
  import { ImageEditorJobSchema } from '../models';
4
5
  import { AttachedFileSchema } from '../../common';
5
6
  import { TOOL_WORKSPACE_ITEM_SLOT } from '../../tool-workspace';
@@ -7,6 +8,7 @@ import { TOOL_CONTENT_TYPE } from '../../tools';
7
8
 
8
9
  export namespace ImageEditorCommand {
9
10
  export const RequestSchema = z.object({
11
+ locale: LocaleSchema,
10
12
  userId: z.string().uuid().nullable().optional(),
11
13
  unregisteredUserId: z.string().uuid().nullable().optional(),
12
14
  workspaceId: z.string().uuid().nullable().optional(),
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { ImageEditorJobParamsSchema, ImageEditorJobSchema } from '../models';
4
+ import { LocaleSchema } from '../../common';
4
5
 
5
6
  export namespace RetryImageEditorJobCommand {
6
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
7
9
  uuid: z.string().uuid(),
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { ImageEditorConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetImageEditorConfigQuery {
6
+ export const RequestSchema = LocaleRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
6
9
  export const ResponseSchema = ICommandResponseSchema(ImageEditorConfigSchema);
7
10
  export type Response = z.infer<typeof ResponseSchema>;
8
11
  }
@@ -1,17 +1,19 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { JOB_REQUEST_ORIGIN } from '../../tools';
3
+ import { LocaleSchema } from '../../common/models/locale.schema';
4
4
  import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
5
+ import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
5
6
 
6
7
  export namespace ExecuteImageGenerationCommand {
7
8
  export const RequestSchema = z.object({
9
+ locale: LocaleSchema,
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
12
  prompt: z.string(),
11
13
  modelId: z.string().uuid(),
12
14
  params: ImageGenerationRequestParamsSchema,
13
15
  presetId: z.string().uuid().nullable().optional(),
14
- origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API),
16
+ callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN).default(STATISTICS_CALL_ORIGIN.WEB),
15
17
  userHasActiveSubscriptionOrProduct: z.boolean(),
16
18
  tokenReservationId: z.string().uuid(),
17
19
  precalculatedPrice: z.number(),
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ImageGenerationModelSchema } from '../../models';
3
- import { ICommandResponseSchema } from '../../../common';
3
+ import { ICommandResponseSchema, LocaleSchema } from '../../../common';
4
4
 
5
5
  export namespace GetImageGenerationModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
+ locale: LocaleSchema,
8
9
  });
9
10
  export type Request = z.infer<typeof RequestSchema>;
10
11
 
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
4
+ import { LocaleSchema } from '../../common';
4
5
 
5
6
  export namespace RetryImageGenerationJobCommand {
6
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
7
9
  uuid: z.string().uuid(),
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { JOB_REQUEST_ORIGIN, JOB_STATUS } from '../../tools';
2
+ import { JOB_STATUS } from '../../tools';
3
3
  import { AttachedFileSchema, USER_REACTION } from '../../common';
4
4
  import { IMAGE_GENERATION_RESOLUTION } from '../enums';
5
+ import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
5
6
 
6
7
  export const ImageGenerationJobParamsSchema = z.object({
7
8
  aspectRatio: z.string(),
@@ -30,7 +31,8 @@ export const ImageGenerationJobSchema = z.object({
30
31
  userId: z.string().nullable().optional(),
31
32
  unregisteredUserId: z.string().nullable().optional(),
32
33
  isPublished: z.boolean(),
33
- origin: z.nativeEnum(JOB_REQUEST_ORIGIN),
34
+ origin: z.string(),
35
+ callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN),
34
36
  postId: z.string().nullable(),
35
37
  isDeleted: z.boolean(),
36
38
  internalError: z.string().nullable(),
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { ImageGenerationJobSchema } from '../models';
4
- import { JOB_REQUEST_ORIGIN } from '../../tools/enums/job-request-origin.enum';
4
+ import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
5
5
 
6
6
  export namespace FindImageGenerationJobsQuery {
7
7
  export const RequestSchema = z
@@ -11,7 +11,7 @@ export namespace FindImageGenerationJobsQuery {
11
11
  title: z.string().optional(),
12
12
  limit: z.coerce.number().min(1).optional(),
13
13
  offset: z.coerce.number().min(0).default(0).optional(),
14
- origin: z.nativeEnum(JOB_REQUEST_ORIGIN).optional(),
14
+ callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN).optional(),
15
15
  })
16
16
  .refine(
17
17
  (data) => {
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { ImageGenerationConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetImageGenerationConfigQuery {
6
- export const RequestSchema = z.object({});
6
+ export const RequestSchema = LocaleRequestSchema;
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
 
9
9
  export const ResponseSchema = ICommandResponseSchema(ImageGenerationConfigSchema);
@@ -1,9 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { AttachedFileSchema } from '../../common';
3
+ import { AttachedFileSchema, LocaleSchema } from '../../common';
4
4
 
5
5
  export namespace GetInteriorDesignPriceCommand {
6
6
  export const RequestSchema = z.object({
7
+ locale: LocaleSchema,
7
8
  modelId: z.string().uuid(),
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../../common';
2
+ import { ICommandResponseSchema, LocaleSchema } from '../../../common';
3
3
  import { InteriorDesignModelSchema } from '../../models';
4
4
 
5
5
  export namespace GetInteriorDesignModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
+ locale: LocaleSchema,
8
9
  });
9
10
  export type Request = z.infer<typeof RequestSchema>;
10
11
 
@@ -1,11 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { InteriorDesignJobSchema } from '../models';
4
- import { AttachedFileSchema } from '../../common';
4
+ import { AttachedFileSchema, LocaleSchema } from '../../common';
5
5
  import { INTERIOR_DESIGN_JOB_SOURCE } from '../enums';
6
6
 
7
7
  export namespace InteriorDesignCommand {
8
8
  export const RequestSchema = z.object({
9
+ locale: LocaleSchema,
9
10
  userId: z.string().uuid().nullable().optional(),
10
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
11
12
  prompt: z.string(),
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { LocaleSchema } from '../../common';
3
4
  import { InteriorDesignJobParamsSchema, InteriorDesignJobSchema } from '../models';
4
5
 
5
6
  export namespace RetryInteriorDesignJobCommand {
6
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
7
9
  uuid: z.string().uuid(),
8
10
  tokenReservationId: z.string().uuid(),
9
11
  precalculatedPrice: z.number(),
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { InteriorDesignConfigSchema } from '../models/interior-design-config.schema';
4
4
 
5
5
  export namespace GetInteriorDesignConfigQuery {
6
+ export const RequestSchema = LocaleRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
6
9
  export const ResponseSchema = ICommandResponseSchema(InteriorDesignConfigSchema);
7
10
  export type Response = z.infer<typeof ResponseSchema>;
8
11
  }
@@ -3,10 +3,11 @@ import { ICommandResponseSchema } from '../../common/models/command-response.sch
3
3
  import { MarketplaceCardJobSchema } from '../models';
4
4
  import { TOOL_CONTENT_TYPE } from '../../tools';
5
5
  import { TOOL_WORKSPACE_ITEM_SLOT } from '../../tool-workspace';
6
- import { AttachedFileSchema } from '../../common';
6
+ import { AttachedFileSchema, LocaleSchema } from '../../common';
7
7
 
8
8
  export namespace ExecuteMarketplaceCardCommand {
9
9
  export const RequestSchema = z.object({
10
+ locale: LocaleSchema,
10
11
  userId: z.string().uuid().nullable().optional(),
11
12
  unregisteredUserId: z.string().uuid().nullable().optional(),
12
13
  workspaceId: z.string().uuid().nullable().optional(),
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
- import { AttachedFileSchema } from '../../common';
3
+ import { AttachedFileSchema, LocaleSchema } from '../../common';
4
4
  import { MarketplaceCardJobSchema } from '../models';
5
5
 
6
6
  export namespace RetryMarketplaceCardJobCommand {
7
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
8
9
  uuid: z.string().uuid(),
9
10
  tokenReservationId: z.string().uuid(),
10
11
  precalculatedPrice: z.number(),
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { MarketplaceCardConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetMarketplaceCardConfigQuery {
6
- export const RequestSchema = z.object({});
6
+ export const RequestSchema = LocaleRequestSchema;
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
  export const ResponseSchema = ICommandResponseSchema(MarketplaceCardConfigSchema);
9
9
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,8 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { LocaleSchema } from '../../common/models/locale.schema';
3
4
 
4
5
  export namespace GenerateLyricsCommand {
5
6
  export const RequestSchema = z.object({
7
+ locale: LocaleSchema,
6
8
  userId: z.string().uuid().nullable().optional(),
7
9
  unregisteredUserId: z.string().uuid().nullable().optional(),
8
10
  userBalance: z.number(),
@@ -1,10 +1,12 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { LocaleSchema } from '../../common/models/locale.schema';
3
4
  import { MusicJobSchema } from '../models/music-job.schema';
4
5
  import { MusicJobParamsSchema } from '../models';
5
6
 
6
7
  export namespace GenerateMusicCommand {
7
8
  export const RequestSchema = z.object({
9
+ locale: LocaleSchema,
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
12
  modelId: z.string(),
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { MusicModelSchema } from '../../models';
3
- import { ICommandResponseSchema } from '../../../common';
3
+ import { ICommandResponseSchema, LocaleSchema } from '../../../common';
4
4
 
5
5
  export namespace GetMusicModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
+ locale: LocaleSchema,
8
9
  });
9
10
  export type Request = z.infer<typeof RequestSchema>;
10
11
 
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { MusicJobParamsSchema, MusicJobSchema } from '../models/music-job.schema';
4
+ import { LocaleSchema } from '../../common';
4
5
 
5
6
  export namespace RetryMusicJobCommand {
6
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
7
9
  uuid: z.string().uuid(),
8
10
  userId: z.string().uuid().nullable().optional(),
9
11
  unregisteredUserId: z.string().uuid().nullable().optional(),
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { MusicConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetMusicConfigQuery {
6
+ export const RequestSchema = LocaleRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
6
9
  export const ResponseSchema = ICommandResponseSchema(MusicConfigSchema);
7
10
  export type Response = z.infer<typeof ResponseSchema>;
8
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.2.20-stage",
3
+ "version": "0.2.22-stage-2",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -12,6 +12,7 @@
12
12
  "license": "ISC",
13
13
  "description": "",
14
14
  "dependencies": {
15
+ "@purpleschool/rugpt-lib-common": "^0.0.21",
15
16
  "zod": "^3.25.67"
16
17
  }
17
18
  }
@@ -1,8 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common/models/command-response.schema';
2
+ import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
3
  import { ParaphraseToolConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetParaphraseToolConfigQuery {
6
+ export const RequestSchema = LocaleRequestSchema;
7
+ export type Request = z.infer<typeof RequestSchema>;
8
+
6
9
  export const ResponseSchema = ICommandResponseSchema(ParaphraseToolConfigSchema);
7
10
  export type Response = z.infer<typeof ResponseSchema>;
8
11
  }
@@ -1,10 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema } from '../../common';
2
+ import { ICommandResponseSchema, LocaleSchema } from '../../common';
3
3
  import { PresentationSchema } from '../models';
4
4
  import { PRESENTATION_TARGET_AUDIENCE } from '../enums';
5
5
 
6
6
  export namespace CreatePresentationCommand {
7
7
  export const RequestSchema = z.object({
8
+ locale: LocaleSchema,
8
9
  userId: z.string().uuid().nullable().optional(),
9
10
  unregisteredUserId: z.string().uuid().nullable().optional(),
10
11
  templateId: z.string().uuid(),