@purpleschool/gptbot-tools 0.2.6-stage-2 → 0.2.7-stage

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 (79) hide show
  1. package/build/common/models/index.js +0 -1
  2. package/build/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.js +0 -1
  3. package/build/image-editor/models/image-editor-job.schema.js +1 -0
  4. package/build/image-editor/queries/get-image-editor-config.query.js +2 -3
  5. package/build/image-generation/commands/execute-image-generation.command.js +2 -2
  6. package/build/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.js +0 -1
  7. package/build/image-generation/models/image-generation-job.schema.js +2 -3
  8. package/build/image-generation/queries/find-image-generation-jobs.query.js +2 -2
  9. package/build/image-generation/queries/get-image-generation-config.query.js +4 -3
  10. package/build/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.js +0 -1
  11. package/build/interior-design/models/interior-design-job.schema.js +1 -0
  12. package/build/interior-design/queries/get-interior-design-config.query.js +2 -3
  13. package/build/marketplace-card/models/marketplace-card-job.schema.js +1 -0
  14. package/build/marketplace-card/queries/get-marketplace-card-config.query.js +2 -1
  15. package/build/music/commands/music-model/get-music-model-by-uuid.command.js +0 -1
  16. package/build/music/queries/get-music-config.query.js +2 -3
  17. package/build/paraphrase/queries/get-paraphrase-tool-config.query.js +2 -3
  18. package/build/presentation/queries/get-presentation-config.query.js +0 -1
  19. package/build/solving-edu-task/queries/get-solving-edu-task-config.query.js +2 -1
  20. package/build/spell-corrector/queries/get-spell-corrector-tool-config.query.js +2 -3
  21. package/build/stt/queries/get-stt-config.query.js +2 -3
  22. package/build/tools/enums/index.js +2 -0
  23. package/build/tools/enums/job-request-origin.enum.js +8 -0
  24. package/build/tools/enums/tool-group.enum.js +12 -0
  25. package/build/tools/events/tool-job-complete.event.js +1 -2
  26. package/build/tools/models/index.js +1 -0
  27. package/build/tools/models/tool-group.schema.js +11 -0
  28. package/build/tools/queries/find-all-tools.query.js +0 -1
  29. package/build/tools/queries/find-grouped-tools.query.js +10 -0
  30. package/build/tools/queries/get-global-tools-config.query.js +2 -3
  31. package/build/tools/queries/get-tools-with-configs.query.js +2 -3
  32. package/build/tools/queries/index.js +1 -0
  33. package/build/tools/routes/tools.aqmp.routes.js +1 -0
  34. package/build/video/commands/video-model/get-video-model-by-uuid.command.js +0 -1
  35. package/build/video/queries/get-video-config.query.js +2 -3
  36. package/build/video-editor/commands/video-editor-model/get-video-editor-model.command.js +0 -1
  37. package/build/video-editor/queries/get-video-editor-config.query.js +4 -3
  38. package/build/writer/queries/get-writer-config.query.js +0 -1
  39. package/common/models/index.ts +0 -1
  40. package/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.ts +1 -2
  41. package/image-editor/models/image-editor-job.schema.ts +1 -0
  42. package/image-editor/queries/get-image-editor-config.query.ts +1 -4
  43. package/image-generation/commands/execute-image-generation.command.ts +2 -2
  44. package/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.ts +1 -2
  45. package/image-generation/models/image-generation-job.schema.ts +3 -4
  46. package/image-generation/queries/find-image-generation-jobs.query.ts +2 -2
  47. package/image-generation/queries/get-image-generation-config.query.ts +2 -2
  48. package/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.ts +1 -2
  49. package/interior-design/models/interior-design-job.schema.ts +1 -0
  50. package/interior-design/queries/get-interior-design-config.query.ts +1 -4
  51. package/marketplace-card/models/marketplace-card-job.schema.ts +1 -0
  52. package/marketplace-card/queries/get-marketplace-card-config.query.ts +2 -2
  53. package/music/commands/music-model/get-music-model-by-uuid.command.ts +1 -2
  54. package/music/queries/get-music-config.query.ts +1 -4
  55. package/package.json +1 -2
  56. package/paraphrase/queries/get-paraphrase-tool-config.query.ts +1 -4
  57. package/presentation/queries/get-presentation-config.query.ts +1 -4
  58. package/solving-edu-task/queries/get-solving-edu-task-config.query.ts +2 -2
  59. package/spell-corrector/queries/get-spell-corrector-tool-config.query.ts +1 -4
  60. package/stt/queries/get-stt-config.query.ts +1 -4
  61. package/tools/enums/index.ts +2 -0
  62. package/tools/enums/job-request-origin.enum.ts +4 -0
  63. package/tools/enums/tool-group.enum.ts +8 -0
  64. package/tools/events/tool-job-complete.event.ts +2 -3
  65. package/tools/models/index.ts +1 -0
  66. package/tools/models/tool-group.schema.ts +11 -0
  67. package/tools/queries/find-all-tools.query.ts +1 -4
  68. package/tools/queries/find-grouped-tools.query.ts +8 -0
  69. package/tools/queries/get-global-tools-config.query.ts +1 -4
  70. package/tools/queries/get-tools-with-configs.query.ts +1 -4
  71. package/tools/queries/index.ts +1 -0
  72. package/tools/routes/tools.aqmp.routes.ts +1 -0
  73. package/video/commands/video-model/get-video-model-by-uuid.command.ts +1 -2
  74. package/video/queries/get-video-config.query.ts +1 -4
  75. package/video-editor/commands/video-editor-model/get-video-editor-model.command.ts +1 -2
  76. package/video-editor/queries/get-video-editor-config.query.ts +2 -2
  77. package/writer/queries/get-writer-config.query.ts +1 -4
  78. package/build/common/models/locale.schema.js +0 -9
  79. package/common/models/locale.schema.ts +0 -11
@@ -17,4 +17,3 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./command-response.schema"), exports);
18
18
  __exportStar(require("./icon-variants.schema"), exports);
19
19
  __exportStar(require("./attached-file.schema"), exports);
20
- __exportStar(require("./locale.schema"), exports);
@@ -8,7 +8,6 @@ var GetImageEditorModelByUuidCommand;
8
8
  (function (GetImageEditorModelByUuidCommand) {
9
9
  GetImageEditorModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
- locale: common_1.LocaleSchema,
12
11
  });
13
12
  GetImageEditorModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ImageEditorModelSchema);
14
13
  })(GetImageEditorModelByUuidCommand || (exports.GetImageEditorModelByUuidCommand = GetImageEditorModelByUuidCommand = {}));
@@ -22,6 +22,7 @@ exports.ImageEditorJobSchema = zod_1.z.object({
22
22
  error: zod_1.z.string().nullable(),
23
23
  modelId: zod_1.z.string(),
24
24
  price: zod_1.z.number(),
25
+ previewUrl: zod_1.z.string().nullable(),
25
26
  params: exports.ImageEditorJobParamsSchema,
26
27
  imageUrls: zod_1.z.array(zod_1.z.string()).nullable(),
27
28
  attempts: zod_1.z.array(zod_1.z.any()),
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetImageEditorConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetImageEditorConfigQuery;
7
7
  (function (GetImageEditorConfigQuery) {
8
- GetImageEditorConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetImageEditorConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ImageEditorConfigSchema);
8
+ GetImageEditorConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageEditorConfigSchema);
10
9
  })(GetImageEditorConfigQuery || (exports.GetImageEditorConfigQuery = GetImageEditorConfigQuery = {}));
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ExecuteImageGenerationCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const tools_1 = require("../../tools");
6
7
  const models_1 = require("../models");
7
- const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
8
8
  var ExecuteImageGenerationCommand;
9
9
  (function (ExecuteImageGenerationCommand) {
10
10
  ExecuteImageGenerationCommand.RequestSchema = zod_1.z.object({
@@ -14,7 +14,7 @@ var ExecuteImageGenerationCommand;
14
14
  modelId: zod_1.z.string().uuid(),
15
15
  params: models_1.ImageGenerationRequestParamsSchema,
16
16
  presetId: zod_1.z.string().uuid().nullable().optional(),
17
- callOrigin: zod_1.z.nativeEnum(rugpt_lib_common_1.STATISTICS_CALL_ORIGIN).default(rugpt_lib_common_1.STATISTICS_CALL_ORIGIN.WEB),
17
+ origin: zod_1.z.nativeEnum(tools_1.JOB_REQUEST_ORIGIN).default(tools_1.JOB_REQUEST_ORIGIN.API),
18
18
  userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
19
  tokenReservationId: zod_1.z.string().uuid(),
20
20
  precalculatedPrice: zod_1.z.number(),
@@ -8,7 +8,6 @@ var GetImageGenerationModelByUuidCommand;
8
8
  (function (GetImageGenerationModelByUuidCommand) {
9
9
  GetImageGenerationModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
- locale: common_1.LocaleSchema,
12
11
  });
13
12
  GetImageGenerationModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ImageGenerationModelSchema);
14
13
  })(GetImageGenerationModelByUuidCommand || (exports.GetImageGenerationModelByUuidCommand = GetImageGenerationModelByUuidCommand = {}));
@@ -5,7 +5,6 @@ const zod_1 = require("zod");
5
5
  const tools_1 = require("../../tools");
6
6
  const common_1 = require("../../common");
7
7
  const enums_1 = require("../enums");
8
- const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
9
8
  exports.ImageGenerationJobParamsSchema = zod_1.z.object({
10
9
  aspectRatio: zod_1.z.string(),
11
10
  attachedFiles: zod_1.z.array(common_1.AttachedFileSchema),
@@ -19,6 +18,7 @@ exports.ImageGenerationJobSchema = zod_1.z.object({
19
18
  status: zod_1.z.nativeEnum(tools_1.JOB_STATUS),
20
19
  error: zod_1.z.string().nullable(),
21
20
  price: zod_1.z.number(),
21
+ previewUrl: zod_1.z.string().nullable(),
22
22
  reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
23
23
  dislikeReason: zod_1.z.string().nullable(),
24
24
  externalId: zod_1.z.string().nullable(),
@@ -30,8 +30,7 @@ exports.ImageGenerationJobSchema = zod_1.z.object({
30
30
  userId: zod_1.z.string().nullable().optional(),
31
31
  unregisteredUserId: zod_1.z.string().nullable().optional(),
32
32
  isPublished: zod_1.z.boolean(),
33
- origin: zod_1.z.string(),
34
- callOrigin: zod_1.z.nativeEnum(rugpt_lib_common_1.STATISTICS_CALL_ORIGIN),
33
+ origin: zod_1.z.nativeEnum(tools_1.JOB_REQUEST_ORIGIN),
35
34
  postId: zod_1.z.string().nullable(),
36
35
  isDeleted: zod_1.z.boolean(),
37
36
  internalError: zod_1.z.string().nullable(),
@@ -4,7 +4,7 @@ exports.FindImageGenerationJobsQuery = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const command_response_schema_1 = require("../../common/models/command-response.schema");
6
6
  const models_1 = require("../models");
7
- const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
7
+ const job_request_origin_enum_1 = require("../../tools/enums/job-request-origin.enum");
8
8
  var FindImageGenerationJobsQuery;
9
9
  (function (FindImageGenerationJobsQuery) {
10
10
  FindImageGenerationJobsQuery.RequestSchema = zod_1.z
@@ -14,7 +14,7 @@ var FindImageGenerationJobsQuery;
14
14
  title: zod_1.z.string().optional(),
15
15
  limit: zod_1.z.coerce.number().min(1).optional(),
16
16
  offset: zod_1.z.coerce.number().min(0).default(0).optional(),
17
- callOrigin: zod_1.z.nativeEnum(rugpt_lib_common_1.STATISTICS_CALL_ORIGIN).optional(),
17
+ origin: zod_1.z.nativeEnum(job_request_origin_enum_1.JOB_REQUEST_ORIGIN).optional(),
18
18
  })
19
19
  .refine((data) => {
20
20
  return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetImageGenerationConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
6
  const models_1 = require("../models");
6
7
  var GetImageGenerationConfigQuery;
7
8
  (function (GetImageGenerationConfigQuery) {
8
- GetImageGenerationConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetImageGenerationConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ImageGenerationConfigSchema);
9
+ GetImageGenerationConfigQuery.RequestSchema = zod_1.z.object({});
10
+ GetImageGenerationConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationConfigSchema);
10
11
  })(GetImageGenerationConfigQuery || (exports.GetImageGenerationConfigQuery = GetImageGenerationConfigQuery = {}));
@@ -8,7 +8,6 @@ var GetInteriorDesignModelByUuidCommand;
8
8
  (function (GetInteriorDesignModelByUuidCommand) {
9
9
  GetInteriorDesignModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
- locale: common_1.LocaleSchema,
12
11
  });
13
12
  GetInteriorDesignModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.InteriorDesignModelSchema);
14
13
  })(GetInteriorDesignModelByUuidCommand || (exports.GetInteriorDesignModelByUuidCommand = GetInteriorDesignModelByUuidCommand = {}));
@@ -22,6 +22,7 @@ exports.InteriorDesignJobSchema = zod_1.z.object({
22
22
  internalError: zod_1.z.string().nullable().optional(),
23
23
  modelId: zod_1.z.string(),
24
24
  price: zod_1.z.number(),
25
+ previewUrl: zod_1.z.string().nullable(),
25
26
  params: exports.InteriorDesignJobParamsSchema,
26
27
  imageUrls: zod_1.z.array(zod_1.z.string()).nullable(),
27
28
  attempts: zod_1.z.array(zod_1.z.any()),
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetInteriorDesignConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const interior_design_config_schema_1 = require("../models/interior-design-config.schema");
6
6
  var GetInteriorDesignConfigQuery;
7
7
  (function (GetInteriorDesignConfigQuery) {
8
- GetInteriorDesignConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetInteriorDesignConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(interior_design_config_schema_1.InteriorDesignConfigSchema);
8
+ GetInteriorDesignConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(interior_design_config_schema_1.InteriorDesignConfigSchema);
10
9
  })(GetInteriorDesignConfigQuery || (exports.GetInteriorDesignConfigQuery = GetInteriorDesignConfigQuery = {}));
@@ -22,6 +22,7 @@ exports.MarketplaceCardJobSchema = zod_1.z.object({
22
22
  tokenReservationId: zod_1.z.string().nullable().optional(),
23
23
  title: zod_1.z.string(),
24
24
  subtitle: zod_1.z.string().nullable(),
25
+ previewUrl: zod_1.z.string().nullable(),
25
26
  reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable(),
26
27
  dislikeReason: zod_1.z.string().nullable(),
27
28
  advantages: zod_1.z.array(zod_1.z.string()),
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetMarketplaceCardConfigQuery = void 0;
4
+ const zod_1 = require("zod");
4
5
  const common_1 = require("../../common");
5
6
  const models_1 = require("../models");
6
7
  var GetMarketplaceCardConfigQuery;
7
8
  (function (GetMarketplaceCardConfigQuery) {
8
- GetMarketplaceCardConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
+ GetMarketplaceCardConfigQuery.RequestSchema = zod_1.z.object({});
9
10
  GetMarketplaceCardConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.MarketplaceCardConfigSchema);
10
11
  })(GetMarketplaceCardConfigQuery || (exports.GetMarketplaceCardConfigQuery = GetMarketplaceCardConfigQuery = {}));
@@ -8,7 +8,6 @@ var GetMusicModelByUuidCommand;
8
8
  (function (GetMusicModelByUuidCommand) {
9
9
  GetMusicModelByUuidCommand.RequestSchema = zod_1.z.object({
10
10
  uuid: zod_1.z.string().uuid(),
11
- locale: common_1.LocaleSchema,
12
11
  });
13
12
  GetMusicModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.MusicModelSchema);
14
13
  })(GetMusicModelByUuidCommand || (exports.GetMusicModelByUuidCommand = GetMusicModelByUuidCommand = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetMusicConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetMusicConfigQuery;
7
7
  (function (GetMusicConfigQuery) {
8
- GetMusicConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetMusicConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.MusicConfigSchema);
8
+ GetMusicConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.MusicConfigSchema);
10
9
  })(GetMusicConfigQuery || (exports.GetMusicConfigQuery = GetMusicConfigQuery = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetParaphraseToolConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetParaphraseToolConfigQuery;
7
7
  (function (GetParaphraseToolConfigQuery) {
8
- GetParaphraseToolConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetParaphraseToolConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ParaphraseToolConfigSchema);
8
+ GetParaphraseToolConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ParaphraseToolConfigSchema);
10
9
  })(GetParaphraseToolConfigQuery || (exports.GetParaphraseToolConfigQuery = GetParaphraseToolConfigQuery = {}));
@@ -5,6 +5,5 @@ const common_1 = require("../../common");
5
5
  const models_1 = require("../models");
6
6
  var GetPresentationConfigQuery;
7
7
  (function (GetPresentationConfigQuery) {
8
- GetPresentationConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
8
  GetPresentationConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.PresentationConfigSchema);
10
9
  })(GetPresentationConfigQuery || (exports.GetPresentationConfigQuery = GetPresentationConfigQuery = {}));
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetSolvingEduTaskConfigQuery = void 0;
4
+ const zod_1 = require("zod");
4
5
  const common_1 = require("../../common");
5
6
  const models_1 = require("../models");
6
7
  var GetSolvingEduTaskConfigQuery;
7
8
  (function (GetSolvingEduTaskConfigQuery) {
8
- GetSolvingEduTaskConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
+ GetSolvingEduTaskConfigQuery.RequestSchema = zod_1.z.object({});
9
10
  GetSolvingEduTaskConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.SolvingEduTaskConfigSchema);
10
11
  })(GetSolvingEduTaskConfigQuery || (exports.GetSolvingEduTaskConfigQuery = GetSolvingEduTaskConfigQuery = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetSpellCorrectorToolConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetSpellCorrectorToolConfigQuery;
7
7
  (function (GetSpellCorrectorToolConfigQuery) {
8
- GetSpellCorrectorToolConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetSpellCorrectorToolConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.SpellCorrectorToolConfigSchema);
8
+ GetSpellCorrectorToolConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.SpellCorrectorToolConfigSchema);
10
9
  })(GetSpellCorrectorToolConfigQuery || (exports.GetSpellCorrectorToolConfigQuery = GetSpellCorrectorToolConfigQuery = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetSTTConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetSTTConfigQuery;
7
7
  (function (GetSTTConfigQuery) {
8
- GetSTTConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetSTTConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.STTConfigSchema);
8
+ GetSTTConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTConfigSchema);
10
9
  })(GetSTTConfigQuery || (exports.GetSTTConfigQuery = GetSTTConfigQuery = {}));
@@ -17,3 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./job-status.enum"), exports);
18
18
  __exportStar(require("./tool-type.enum"), exports);
19
19
  __exportStar(require("./tool-content-type.enum"), exports);
20
+ __exportStar(require("./tool-group.enum"), exports);
21
+ __exportStar(require("./job-request-origin.enum"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JOB_REQUEST_ORIGIN = void 0;
4
+ var JOB_REQUEST_ORIGIN;
5
+ (function (JOB_REQUEST_ORIGIN) {
6
+ JOB_REQUEST_ORIGIN["API"] = "api";
7
+ JOB_REQUEST_ORIGIN["B2B"] = "b2b";
8
+ })(JOB_REQUEST_ORIGIN || (exports.JOB_REQUEST_ORIGIN = JOB_REQUEST_ORIGIN = {}));
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TOOL_GROUP = void 0;
4
+ var TOOL_GROUP;
5
+ (function (TOOL_GROUP) {
6
+ TOOL_GROUP["TEXT"] = "TEXT";
7
+ TOOL_GROUP["IMAGE"] = "IMAGE";
8
+ TOOL_GROUP["AUDIO"] = "AUDIO";
9
+ TOOL_GROUP["VIDEO"] = "VIDEO";
10
+ TOOL_GROUP["EDUCATION"] = "EDUCATION";
11
+ TOOL_GROUP["DESIGN"] = "DESIGN";
12
+ })(TOOL_GROUP || (exports.TOOL_GROUP = TOOL_GROUP = {}));
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ToolJobCompleteEvent = void 0;
4
- const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
5
4
  const enums_1 = require("../enums");
6
5
  const models_1 = require("../models");
7
6
  const zod_1 = require("zod");
@@ -10,7 +9,7 @@ var ToolJobCompleteEvent;
10
9
  ToolJobCompleteEvent.PayloadSchema = zod_1.z.object({
11
10
  job: models_1.ToolJobSchema.extend({
12
11
  toolType: zod_1.z.nativeEnum(enums_1.TOOL_TYPE),
13
- callOrigin: zod_1.z.nativeEnum(rugpt_lib_common_1.STATISTICS_CALL_ORIGIN).optional(),
12
+ origin: zod_1.z.nativeEnum(enums_1.JOB_REQUEST_ORIGIN).optional(),
14
13
  }),
15
14
  });
16
15
  })(ToolJobCompleteEvent || (exports.ToolJobCompleteEvent = ToolJobCompleteEvent = {}));
@@ -16,5 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tool-job.schema"), exports);
18
18
  __exportStar(require("./tool.schema"), exports);
19
+ __exportStar(require("./tool-group.schema"), exports);
19
20
  __exportStar(require("./global-tools-config.schema"), exports);
20
21
  __exportStar(require("./tools-with-configs.schema"), exports);
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ToolGroupSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const enums_1 = require("../enums");
6
+ const tool_schema_1 = require("./tool.schema");
7
+ exports.ToolGroupSchema = zod_1.z.object({
8
+ group: zod_1.z.nativeEnum(enums_1.TOOL_GROUP),
9
+ title: zod_1.z.string(),
10
+ tools: zod_1.z.array(tool_schema_1.ToolSchema),
11
+ });
@@ -6,6 +6,5 @@ const models_1 = require("../models");
6
6
  const common_1 = require("../../common");
7
7
  var FindAllToolsQuery;
8
8
  (function (FindAllToolsQuery) {
9
- FindAllToolsQuery.RequestSchema = common_1.LocaleRequestSchema;
10
9
  FindAllToolsQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.array(models_1.ToolSchema));
11
10
  })(FindAllToolsQuery || (exports.FindAllToolsQuery = FindAllToolsQuery = {}));
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FindGroupedToolsQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../models");
6
+ const common_1 = require("../../common");
7
+ var FindGroupedToolsQuery;
8
+ (function (FindGroupedToolsQuery) {
9
+ FindGroupedToolsQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.array(models_1.ToolGroupSchema));
10
+ })(FindGroupedToolsQuery || (exports.FindGroupedToolsQuery = FindGroupedToolsQuery = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetGlobalToolsConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetGlobalToolsConfigQuery;
7
7
  (function (GetGlobalToolsConfigQuery) {
8
- GetGlobalToolsConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetGlobalToolsConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.GlobalToolsConfigSchema);
8
+ GetGlobalToolsConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.GlobalToolsConfigSchema);
10
9
  })(GetGlobalToolsConfigQuery || (exports.GetGlobalToolsConfigQuery = GetGlobalToolsConfigQuery = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetToolsWithConfigsQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetToolsWithConfigsQuery;
7
7
  (function (GetToolsWithConfigsQuery) {
8
- GetToolsWithConfigsQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetToolsWithConfigsQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.ToolsWithConfigsSchema);
8
+ GetToolsWithConfigsQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ToolsWithConfigsSchema);
10
9
  })(GetToolsWithConfigsQuery || (exports.GetToolsWithConfigsQuery = GetToolsWithConfigsQuery = {}));
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./find-all-tools.query"), exports);
18
+ __exportStar(require("./find-grouped-tools.query"), exports);
18
19
  __exportStar(require("./get-global-tools-config.query"), exports);
19
20
  __exportStar(require("./get-tools-with-configs.query"), exports);
@@ -5,6 +5,7 @@ exports.TOOLS_AMQP_ROUTES = {
5
5
  JOB_COMPLETED: 'tools.job.completed',
6
6
  JOB_FAILED: 'tools.job.failed',
7
7
  FIND_ALL: 'tools.find.all.rpc',
8
+ FIND_GROUPED: 'tools.find.grouped.rpc',
8
9
  GET_GLOBAL_TOOLS_CONFIG: 'tools.config.rpc',
9
10
  GET_TOOLS_WITH_CONFIGS: 'tools.with-configs.rpc',
10
11
  };
@@ -8,7 +8,6 @@ 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,
12
11
  });
13
12
  GetVideoModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoModelSchema);
14
13
  })(GetVideoModelByUuidCommand || (exports.GetVideoModelByUuidCommand = GetVideoModelByUuidCommand = {}));
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetVideoConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
5
  const models_1 = require("../models");
6
6
  var GetVideoConfigQuery;
7
7
  (function (GetVideoConfigQuery) {
8
- GetVideoConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetVideoConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoConfigSchema);
8
+ GetVideoConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoConfigSchema);
10
9
  })(GetVideoConfigQuery || (exports.GetVideoConfigQuery = GetVideoConfigQuery = {}));
@@ -8,7 +8,6 @@ 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,
12
11
  });
13
12
  GetVideoEditorModelByUuidCommand.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoEditorModelSchema);
14
13
  })(GetVideoEditorModelByUuidCommand || (exports.GetVideoEditorModelByUuidCommand = GetVideoEditorModelByUuidCommand = {}));
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GetVideoEditorConfigQuery = void 0;
4
- const common_1 = require("../../common");
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
5
6
  const models_1 = require("../models");
6
7
  var GetVideoEditorConfigQuery;
7
8
  (function (GetVideoEditorConfigQuery) {
8
- GetVideoEditorConfigQuery.RequestSchema = common_1.LocaleRequestSchema;
9
- GetVideoEditorConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.VideoEditorConfigSchema);
9
+ GetVideoEditorConfigQuery.RequestSchema = zod_1.z.object({});
10
+ GetVideoEditorConfigQuery.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.VideoEditorConfigSchema);
10
11
  })(GetVideoEditorConfigQuery || (exports.GetVideoEditorConfigQuery = GetVideoEditorConfigQuery = {}));
@@ -5,6 +5,5 @@ 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;
9
8
  GetWriterConfigQuery.ResponseSchema = (0, common_1.ICommandResponseSchema)(models_1.WriterConfigSchema);
10
9
  })(GetWriterConfigQuery || (exports.GetWriterConfigQuery = GetWriterConfigQuery = {}));
@@ -1,4 +1,3 @@
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';
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { ImageEditorModelSchema } from '../../models';
3
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
3
+ import { ICommandResponseSchema } 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,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -23,6 +23,7 @@ export const ImageEditorJobSchema = z.object({
23
23
  error: z.string().nullable(),
24
24
  modelId: z.string(),
25
25
  price: z.number(),
26
+ previewUrl: z.string().nullable(),
26
27
  params: ImageEditorJobParamsSchema,
27
28
  imageUrls: z.array(z.string()).nullable(),
28
29
  attempts: z.array(z.any()),
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
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
-
9
6
  export const ResponseSchema = ICommandResponseSchema(ImageEditorConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { JOB_REQUEST_ORIGIN } from '../../tools';
3
4
  import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
4
- import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
5
5
 
6
6
  export namespace ExecuteImageGenerationCommand {
7
7
  export const RequestSchema = z.object({
@@ -11,7 +11,7 @@ export namespace ExecuteImageGenerationCommand {
11
11
  modelId: z.string().uuid(),
12
12
  params: ImageGenerationRequestParamsSchema,
13
13
  presetId: z.string().uuid().nullable().optional(),
14
- callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN).default(STATISTICS_CALL_ORIGIN.WEB),
14
+ origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API),
15
15
  userHasActiveSubscriptionOrProduct: z.boolean(),
16
16
  tokenReservationId: z.string().uuid(),
17
17
  precalculatedPrice: z.number(),
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { ImageGenerationModelSchema } from '../../models';
3
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
3
+ import { ICommandResponseSchema } 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,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -1,8 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { JOB_STATUS } from '../../tools';
2
+ import { JOB_REQUEST_ORIGIN, 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';
6
5
 
7
6
  export const ImageGenerationJobParamsSchema = z.object({
8
7
  aspectRatio: z.string(),
@@ -19,6 +18,7 @@ export const ImageGenerationJobSchema = z.object({
19
18
  status: z.nativeEnum(JOB_STATUS),
20
19
  error: z.string().nullable(),
21
20
  price: z.number(),
21
+ previewUrl: z.string().nullable(),
22
22
  reaction: z.nativeEnum(USER_REACTION).nullable(),
23
23
  dislikeReason: z.string().nullable(),
24
24
  externalId: z.string().nullable(),
@@ -30,8 +30,7 @@ export const ImageGenerationJobSchema = z.object({
30
30
  userId: z.string().nullable().optional(),
31
31
  unregisteredUserId: z.string().nullable().optional(),
32
32
  isPublished: z.boolean(),
33
- origin: z.string(),
34
- callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN),
33
+ origin: z.nativeEnum(JOB_REQUEST_ORIGIN),
35
34
  postId: z.string().nullable(),
36
35
  isDeleted: z.boolean(),
37
36
  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 { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
4
+ import { JOB_REQUEST_ORIGIN } from '../../tools/enums/job-request-origin.enum';
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
- callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN).optional(),
14
+ origin: z.nativeEnum(JOB_REQUEST_ORIGIN).optional(),
15
15
  })
16
16
  .refine(
17
17
  (data) => {
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { ImageGenerationConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetImageGenerationConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
6
+ export const RequestSchema = z.object({});
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
 
9
9
  export const ResponseSchema = ICommandResponseSchema(ImageGenerationConfigSchema);
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
2
+ import { ICommandResponseSchema } 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,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -23,6 +23,7 @@ export const InteriorDesignJobSchema = z.object({
23
23
  internalError: z.string().nullable().optional(),
24
24
  modelId: z.string(),
25
25
  price: z.number(),
26
+ previewUrl: z.string().nullable(),
26
27
  params: InteriorDesignJobParamsSchema,
27
28
  imageUrls: z.array(z.string()).nullable(),
28
29
  attempts: z.array(z.any()),
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
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
-
9
6
  export const ResponseSchema = ICommandResponseSchema(InteriorDesignConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -28,6 +28,7 @@ export const MarketplaceCardJobSchema = z.object({
28
28
  tokenReservationId: z.string().nullable().optional(),
29
29
  title: z.string(),
30
30
  subtitle: z.string().nullable(),
31
+ previewUrl: z.string().nullable(),
31
32
  reaction: z.nativeEnum(USER_REACTION).nullable(),
32
33
  dislikeReason: z.string().nullable(),
33
34
  advantages: z.array(z.string()),
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common';
3
3
  import { MarketplaceCardConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetMarketplaceCardConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
6
+ export const RequestSchema = z.object({});
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,11 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { MusicModelSchema } from '../../models';
3
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
3
+ import { ICommandResponseSchema } 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,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
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
-
9
6
  export const ResponseSchema = ICommandResponseSchema(MusicConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.2.6-stage-2",
3
+ "version": "0.2.7-stage",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {
@@ -12,7 +12,6 @@
12
12
  "license": "ISC",
13
13
  "description": "",
14
14
  "dependencies": {
15
- "@purpleschool/rugpt-lib-common": "^0.0.21",
16
15
  "zod": "^3.25.67"
17
16
  }
18
17
  }
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
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
-
9
6
  export const ResponseSchema = ICommandResponseSchema(ParaphraseToolConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common';
3
3
  import { PresentationConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetPresentationConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(PresentationConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common';
3
3
  import { SolvingEduTaskConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetSolvingEduTaskConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
6
+ export const RequestSchema = z.object({});
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
 
9
9
  export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskConfigSchema);
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { SpellCorrectorToolConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetSpellCorrectorToolConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(SpellCorrectorToolConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { STTConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetSTTConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(STTConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,3 +1,5 @@
1
1
  export * from './job-status.enum';
2
2
  export * from './tool-type.enum';
3
3
  export * from './tool-content-type.enum';
4
+ export * from './tool-group.enum';
5
+ export * from './job-request-origin.enum';
@@ -0,0 +1,4 @@
1
+ export enum JOB_REQUEST_ORIGIN {
2
+ API = 'api',
3
+ B2B = 'b2b',
4
+ }
@@ -0,0 +1,8 @@
1
+ export enum TOOL_GROUP {
2
+ TEXT = 'TEXT',
3
+ IMAGE = 'IMAGE',
4
+ AUDIO = 'AUDIO',
5
+ VIDEO = 'VIDEO',
6
+ EDUCATION = 'EDUCATION',
7
+ DESIGN = 'DESIGN',
8
+ }
@@ -1,5 +1,4 @@
1
- import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
2
- import { TOOL_TYPE } from '../enums';
1
+ import { JOB_REQUEST_ORIGIN, TOOL_TYPE } from '../enums';
3
2
  import { ToolJobSchema } from '../models';
4
3
  import { z } from 'zod';
5
4
 
@@ -7,7 +6,7 @@ export namespace ToolJobCompleteEvent {
7
6
  export const PayloadSchema = z.object({
8
7
  job: ToolJobSchema.extend({
9
8
  toolType: z.nativeEnum(TOOL_TYPE),
10
- callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN).optional(),
9
+ origin: z.nativeEnum(JOB_REQUEST_ORIGIN).optional(),
11
10
  }),
12
11
  });
13
12
 
@@ -1,4 +1,5 @@
1
1
  export * from './tool-job.schema';
2
2
  export * from './tool.schema';
3
+ export * from './tool-group.schema';
3
4
  export * from './global-tools-config.schema';
4
5
  export * from './tools-with-configs.schema';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { TOOL_GROUP } from '../enums';
3
+ import { ToolSchema } from './tool.schema';
4
+
5
+ export const ToolGroupSchema = z.object({
6
+ group: z.nativeEnum(TOOL_GROUP),
7
+ title: z.string(),
8
+ tools: z.array(ToolSchema),
9
+ });
10
+
11
+ export type ToolGroup = z.infer<typeof ToolGroupSchema>;
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { ToolSchema } from '../models';
3
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
3
+ import { ICommandResponseSchema } from '../../common';
4
4
 
5
5
  export namespace FindAllToolsQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(z.array(ToolSchema));
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import { ToolGroupSchema } from '../models';
3
+ import { ICommandResponseSchema } from '../../common';
4
+
5
+ export namespace FindGroupedToolsQuery {
6
+ export const ResponseSchema = ICommandResponseSchema(z.array(ToolGroupSchema));
7
+ export type Response = z.infer<typeof ResponseSchema>;
8
+ }
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { GlobalToolsConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetGlobalToolsConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(GlobalToolsConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { ToolsWithConfigsSchema } from '../models';
4
4
 
5
5
  export namespace GetToolsWithConfigsQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(ToolsWithConfigsSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,3 +1,4 @@
1
1
  export * from './find-all-tools.query';
2
+ export * from './find-grouped-tools.query';
2
3
  export * from './get-global-tools-config.query';
3
4
  export * from './get-tools-with-configs.query';
@@ -2,6 +2,7 @@ export const TOOLS_AMQP_ROUTES = {
2
2
  JOB_COMPLETED: 'tools.job.completed',
3
3
  JOB_FAILED: 'tools.job.failed',
4
4
  FIND_ALL: 'tools.find.all.rpc',
5
+ FIND_GROUPED: 'tools.find.grouped.rpc',
5
6
  GET_GLOBAL_TOOLS_CONFIG: 'tools.config.rpc',
6
7
  GET_TOOLS_WITH_CONFIGS: 'tools.with-configs.rpc',
7
8
  };
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
2
  import { VideoModelSchema } from '../../models';
3
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
3
+ import { ICommandResponseSchema } from '../../../common';
4
4
 
5
5
  export namespace GetVideoModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
- locale: LocaleSchema,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { VideoConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetVideoConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(VideoConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,11 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleSchema } from '../../../common';
2
+ import { ICommandResponseSchema } from '../../../common';
3
3
  import { VideoEditorModelSchema } from '../../models';
4
4
 
5
5
  export namespace GetVideoEditorModelByUuidCommand {
6
6
  export const RequestSchema = z.object({
7
7
  uuid: z.string().uuid(),
8
- locale: LocaleSchema,
9
8
  });
10
9
  export type Request = z.infer<typeof RequestSchema>;
11
10
 
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
3
  import { VideoEditorConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetVideoEditorConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
6
+ export const RequestSchema = z.object({});
7
7
  export type Request = z.infer<typeof RequestSchema>;
8
8
 
9
9
  export const ResponseSchema = ICommandResponseSchema(VideoEditorConfigSchema);
@@ -1,11 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { ICommandResponseSchema, LocaleRequestSchema } from '../../common';
2
+ import { ICommandResponseSchema } from '../../common';
3
3
  import { WriterConfigSchema } from '../models';
4
4
 
5
5
  export namespace GetWriterConfigQuery {
6
- export const RequestSchema = LocaleRequestSchema;
7
- export type Request = z.infer<typeof RequestSchema>;
8
-
9
6
  export const ResponseSchema = ICommandResponseSchema(WriterConfigSchema);
10
7
  export type Response = z.infer<typeof ResponseSchema>;
11
8
  }
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocaleRequestSchema = exports.LocaleSchema = void 0;
4
- const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
5
- const zod_1 = require("zod");
6
- exports.LocaleSchema = zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE);
7
- exports.LocaleRequestSchema = zod_1.z.object({
8
- locale: exports.LocaleSchema,
9
- });
@@ -1,11 +0,0 @@
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>;