@purpleschool/gptbot-tools 0.0.114 → 0.0.115

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.
@@ -1322,6 +1322,11 @@ exports.ERRORS = {
1322
1322
  message: 'Произошла ошибка при обновлении задания на генерацию изображения',
1323
1323
  httpCode: 500,
1324
1324
  },
1325
+ NOT_IN_FAILED_STATE_TO_RETRY: {
1326
+ code: 'IMAGE_GENERATION_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
1327
+ message: 'Задание на генерацию картинки не в состоянии "failed". Невозможно повторить',
1328
+ httpCode: 400,
1329
+ },
1325
1330
  },
1326
1331
  IMAGE_GENERATION_PRESET: {
1327
1332
  FIND_ERROR: {
@@ -22,3 +22,4 @@ __exportStar(require("./soft-delete-image-generation-jobs-by-criteria.command"),
22
22
  __exportStar(require("./set-reaction-to-image-generation-job.command"), exports);
23
23
  __exportStar(require("./update-image-generation-job-title.command"), exports);
24
24
  __exportStar(require("./image-generation-model"), exports);
25
+ __exportStar(require("./retry-image-generation-job.command"), exports);
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RetryImageGenerationJobCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const command_response_schema_1 = require("../../common/models/command-response.schema");
6
+ const models_1 = require("../models");
7
+ var RetryImageGenerationJobCommand;
8
+ (function (RetryImageGenerationJobCommand) {
9
+ RetryImageGenerationJobCommand.RequestSchema = zod_1.z.object({
10
+ uuid: zod_1.z.string().uuid(),
11
+ userId: zod_1.z.string().uuid().nullable().optional(),
12
+ unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
13
+ prompt: zod_1.z.string().optional(),
14
+ userBalance: zod_1.z.number(),
15
+ modelId: zod_1.z.string().uuid().optional(),
16
+ params: models_1.ImageGenerationRequestParamsSchema.optional(),
17
+ presetId: zod_1.z.string().uuid().nullable().optional(),
18
+ userHasActiveSubscriptionOrProduct: zod_1.z.boolean(),
19
+ });
20
+ RetryImageGenerationJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.ImageGenerationJobSchema);
21
+ })(RetryImageGenerationJobCommand || (exports.RetryImageGenerationJobCommand = RetryImageGenerationJobCommand = {}));
@@ -12,4 +12,5 @@ exports.IMAGE_GENERATION_AMQP_ROUTES = {
12
12
  SOFT_DELETE: 'tools.image-generation.jobs.soft-delete.rpc',
13
13
  SOFT_DELETE_ALL: 'tools.image-generation.jobs.soft-delete-all.rpc',
14
14
  GET_MODEL_BY_UUID: 'tools.image-generation.model.get-by-uuid.rpc',
15
+ RETRY: 'tools.image-generation.jobs.retry.rpc',
15
16
  };
@@ -1332,6 +1332,11 @@ export const ERRORS = {
1332
1332
  message: 'Произошла ошибка при обновлении задания на генерацию изображения',
1333
1333
  httpCode: 500,
1334
1334
  },
1335
+ NOT_IN_FAILED_STATE_TO_RETRY: {
1336
+ code: 'IMAGE_GENERATION_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
1337
+ message: 'Задание на генерацию картинки не в состоянии "failed". Невозможно повторить',
1338
+ httpCode: 400,
1339
+ },
1335
1340
  },
1336
1341
  IMAGE_GENERATION_PRESET: {
1337
1342
  FIND_ERROR: {
@@ -6,3 +6,4 @@ export * from './soft-delete-image-generation-jobs-by-criteria.command';
6
6
  export * from './set-reaction-to-image-generation-job.command';
7
7
  export * from './update-image-generation-job-title.command';
8
8
  export * from './image-generation-model';
9
+ export * from './retry-image-generation-job.command';
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { ICommandResponseSchema } from '../../common/models/command-response.schema';
3
+ import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
4
+
5
+ export namespace RetryImageGenerationJobCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ userId: z.string().uuid().nullable().optional(),
9
+ unregisteredUserId: z.string().uuid().nullable().optional(),
10
+ prompt: z.string().optional(),
11
+ userBalance: z.number(),
12
+ modelId: z.string().uuid().optional(),
13
+ params: ImageGenerationRequestParamsSchema.optional(),
14
+ presetId: z.string().uuid().nullable().optional(),
15
+ userHasActiveSubscriptionOrProduct: z.boolean(),
16
+ });
17
+ export type Request = z.infer<typeof RequestSchema>;
18
+
19
+ export const ResponseSchema = ICommandResponseSchema(ImageGenerationJobSchema);
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
@@ -9,4 +9,5 @@ export const IMAGE_GENERATION_AMQP_ROUTES = {
9
9
  SOFT_DELETE: 'tools.image-generation.jobs.soft-delete.rpc',
10
10
  SOFT_DELETE_ALL: 'tools.image-generation.jobs.soft-delete-all.rpc',
11
11
  GET_MODEL_BY_UUID: 'tools.image-generation.model.get-by-uuid.rpc',
12
+ RETRY: 'tools.image-generation.jobs.retry.rpc',
12
13
  } as const;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purpleschool/gptbot-tools",
3
- "version": "0.0.114",
3
+ "version": "0.0.115",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {