@purpleschool/gptbot-tools 0.0.21 → 0.0.22
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.
- package/build/common/errors/errors.js +10 -0
- package/build/stt/commands/index.js +1 -0
- package/build/stt/commands/retry-stt-job.command.js +16 -0
- package/build/stt/routes/stt.amqp.routes.js +1 -0
- package/build/tts/commands/index.js +1 -0
- package/build/tts/commands/retry-tts-job.command.js +16 -0
- package/build/tts/commands/update-tts-job-title.command.js +0 -3
- package/build/tts/routes/tts.amqp.routes.js +1 -0
- package/common/errors/errors.ts +10 -0
- package/package.json +1 -1
- package/stt/commands/index.ts +1 -0
- package/stt/commands/retry-stt-job.command.ts +16 -0
- package/stt/routes/stt.amqp.routes.ts +1 -0
- package/tts/commands/index.ts +1 -0
- package/tts/commands/retry-tts-job.command.ts +16 -0
- package/tts/commands/update-tts-job-title.command.ts +0 -5
- package/tts/routes/tts.amqp.routes.ts +1 -0
|
@@ -170,6 +170,11 @@ exports.ERRORS = {
|
|
|
170
170
|
message: 'Произошла ошибка при удалении задания STT',
|
|
171
171
|
httpCode: 500,
|
|
172
172
|
},
|
|
173
|
+
NOT_IN_FAILED_STATE_TO_RETRY: {
|
|
174
|
+
code: 'STT_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
|
|
175
|
+
message: 'Задание STT не в состоянии "failed". Невозможно повторить',
|
|
176
|
+
httpCode: 400,
|
|
177
|
+
},
|
|
173
178
|
},
|
|
174
179
|
TTS: {
|
|
175
180
|
AI_ERROR: {
|
|
@@ -236,5 +241,10 @@ exports.ERRORS = {
|
|
|
236
241
|
message: 'Пользователь не является владельцем данного сообщения',
|
|
237
242
|
httpCode: 403,
|
|
238
243
|
},
|
|
244
|
+
NOT_IN_FAILED_STATE_TO_RETRY: {
|
|
245
|
+
code: 'TTS_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
|
|
246
|
+
message: 'Задание TTS не в состоянии "failed". Невозможно повторить',
|
|
247
|
+
httpCode: 400,
|
|
248
|
+
},
|
|
239
249
|
},
|
|
240
250
|
};
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./delete-stt-job-by-uuid.command"), exports);
|
|
18
18
|
__exportStar(require("./delete-all-stt-jobs.command"), exports);
|
|
19
|
+
__exportStar(require("./retry-stt-job.command"), exports);
|
|
19
20
|
__exportStar(require("./set-reaction-to-stt-job.command"), exports);
|
|
20
21
|
__exportStar(require("./stt.command"), exports);
|
|
21
22
|
__exportStar(require("./update-stt-job-title.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetrySTTJobCommand = 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 RetrySTTJobCommand;
|
|
8
|
+
(function (RetrySTTJobCommand) {
|
|
9
|
+
RetrySTTJobCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.string().uuid(),
|
|
11
|
+
userBalance: zod_1.z.number(),
|
|
12
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
14
|
+
});
|
|
15
|
+
RetrySTTJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.STTJobSchema);
|
|
16
|
+
})(RetrySTTJobCommand || (exports.RetrySTTJobCommand = RetrySTTJobCommand = {}));
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./delete-tts-job-by-uuid.command"), exports);
|
|
18
18
|
__exportStar(require("./delete-all-tts-jobs.command"), exports);
|
|
19
|
+
__exportStar(require("./retry-tts-job.command"), exports);
|
|
19
20
|
__exportStar(require("./set-reaction-to-tts-job.command"), exports);
|
|
20
21
|
__exportStar(require("./tts.command"), exports);
|
|
21
22
|
__exportStar(require("./update-tts-job-title.command"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryTTSJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const command_response_schema_1 = require("../../common/models/command-response.schema");
|
|
6
|
+
const tts_job_schema_1 = require("../models/tts-job.schema");
|
|
7
|
+
var RetryTTSJobCommand;
|
|
8
|
+
(function (RetryTTSJobCommand) {
|
|
9
|
+
RetryTTSJobCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.string().uuid(),
|
|
11
|
+
userBalance: zod_1.z.number(),
|
|
12
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
14
|
+
});
|
|
15
|
+
RetryTTSJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(tts_job_schema_1.TTSJobSchema);
|
|
16
|
+
})(RetryTTSJobCommand || (exports.RetryTTSJobCommand = RetryTTSJobCommand = {}));
|
|
@@ -12,8 +12,5 @@ var UpdateTTSJobTitleCommand;
|
|
|
12
12
|
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
13
13
|
title: zod_1.z.string().min(1).max(40),
|
|
14
14
|
});
|
|
15
|
-
UpdateTTSJobTitleCommand.RequestParamsSchema = zod_1.z.object({
|
|
16
|
-
uuid: zod_1.z.string(),
|
|
17
|
-
});
|
|
18
15
|
UpdateTTSJobTitleCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(tts_job_schema_1.TTSJobSchema);
|
|
19
16
|
})(UpdateTTSJobTitleCommand || (exports.UpdateTTSJobTitleCommand = UpdateTTSJobTitleCommand = {}));
|
package/common/errors/errors.ts
CHANGED
|
@@ -169,6 +169,11 @@ export const ERRORS = {
|
|
|
169
169
|
message: 'Произошла ошибка при удалении задания STT',
|
|
170
170
|
httpCode: 500,
|
|
171
171
|
},
|
|
172
|
+
NOT_IN_FAILED_STATE_TO_RETRY: {
|
|
173
|
+
code: 'STT_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
|
|
174
|
+
message: 'Задание STT не в состоянии "failed". Невозможно повторить',
|
|
175
|
+
httpCode: 400,
|
|
176
|
+
},
|
|
172
177
|
},
|
|
173
178
|
TTS: {
|
|
174
179
|
AI_ERROR: {
|
|
@@ -235,5 +240,10 @@ export const ERRORS = {
|
|
|
235
240
|
message: 'Пользователь не является владельцем данного сообщения',
|
|
236
241
|
httpCode: 403,
|
|
237
242
|
},
|
|
243
|
+
NOT_IN_FAILED_STATE_TO_RETRY: {
|
|
244
|
+
code: 'TTS_JOB.NOT_IN_FAILED_STATE_TO_RETRY',
|
|
245
|
+
message: 'Задание TTS не в состоянии "failed". Невозможно повторить',
|
|
246
|
+
httpCode: 400,
|
|
247
|
+
},
|
|
238
248
|
},
|
|
239
249
|
} as const;
|
package/package.json
CHANGED
package/stt/commands/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './delete-stt-job-by-uuid.command';
|
|
2
2
|
export * from './delete-all-stt-jobs.command';
|
|
3
|
+
export * from './retry-stt-job.command';
|
|
3
4
|
export * from './set-reaction-to-stt-job.command';
|
|
4
5
|
export * from './stt.command';
|
|
5
6
|
export * from './update-stt-job-title.command';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { STTJobSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace RetrySTTJobCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
userBalance: z.number(),
|
|
9
|
+
userId: z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
|
+
});
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const ResponseSchema = ICommandResponseSchema(STTJobSchema);
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
package/tts/commands/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './delete-tts-job-by-uuid.command';
|
|
2
2
|
export * from './delete-all-tts-jobs.command';
|
|
3
|
+
export * from './retry-tts-job.command';
|
|
3
4
|
export * from './set-reaction-to-tts-job.command';
|
|
4
5
|
export * from './tts.command';
|
|
5
6
|
export * from './update-tts-job-title.command';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace RetryTTSJobCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
userBalance: z.number(),
|
|
9
|
+
userId: z.string().uuid().nullable().optional(),
|
|
10
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
11
|
+
});
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -11,11 +11,6 @@ export namespace UpdateTTSJobTitleCommand {
|
|
|
11
11
|
});
|
|
12
12
|
export type Request = z.infer<typeof RequestSchema>;
|
|
13
13
|
|
|
14
|
-
export const RequestParamsSchema = z.object({
|
|
15
|
-
uuid: z.string(),
|
|
16
|
-
});
|
|
17
|
-
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
18
|
-
|
|
19
14
|
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
20
15
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
16
|
}
|