@purpleschool/gptbot 0.14.24 → 0.14.25
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/api/controllers/http/image-recognition.ts +15 -0
- package/api/controllers/http/index.ts +1 -0
- package/api/routes.ts +36 -0
- package/build/api/controllers/http/image-recognition.js +17 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/routes.js +24 -0
- package/build/commands/tools/image-recognition/delete-all-image-recognition-jobs.command.js +8 -0
- package/build/commands/tools/image-recognition/delete-image-recognition-job-by-uuid.command.js +11 -0
- package/build/commands/tools/image-recognition/find-image-recognition-job-by-uuid.command.js +14 -0
- package/build/commands/tools/image-recognition/find-image-recognition-jobs.command.js +24 -0
- package/build/commands/tools/image-recognition/get-image-recognition-tool-config.command.js +11 -0
- package/build/commands/tools/image-recognition/image-recognition.command.js +19 -0
- package/build/commands/tools/image-recognition/index.js +26 -0
- package/build/commands/tools/image-recognition/retry-image-recognition-job.command.js +24 -0
- package/build/commands/tools/image-recognition/set-reaction-to-image-recognition-job.command.js +28 -0
- package/build/commands/tools/image-recognition/update-image-recognition-job-favorite.command.js +17 -0
- package/build/commands/tools/image-recognition/update-image-recognition-job-title.command.js +17 -0
- package/build/commands/tools/index.js +1 -0
- package/build/constants/cabinet/enums/statistics-request-type.enum.js +1 -0
- package/build/models/tools/image-recognition/image-recognition-category.schema.js +14 -0
- package/build/models/tools/image-recognition/image-recognition-config.schema.js +10 -0
- package/build/models/tools/image-recognition/image-recognition-job.schema.js +22 -0
- package/build/models/tools/image-recognition/image-recognition-model.schema.js +25 -0
- package/build/models/tools/image-recognition/index.js +20 -0
- package/build/models/tools/index.js +1 -0
- package/commands/tools/image-recognition/delete-all-image-recognition-jobs.command.ts +6 -0
- package/commands/tools/image-recognition/delete-image-recognition-job-by-uuid.command.ts +11 -0
- package/commands/tools/image-recognition/find-image-recognition-job-by-uuid.command.ts +16 -0
- package/commands/tools/image-recognition/find-image-recognition-jobs.command.ts +24 -0
- package/commands/tools/image-recognition/get-image-recognition-tool-config.command.ts +10 -0
- package/commands/tools/image-recognition/image-recognition.command.ts +20 -0
- package/commands/tools/image-recognition/index.ts +10 -0
- package/commands/tools/image-recognition/retry-image-recognition-job.command.ts +26 -0
- package/commands/tools/image-recognition/set-reaction-to-image-recognition-job.command.ts +33 -0
- package/commands/tools/image-recognition/update-image-recognition-job-favorite.command.ts +19 -0
- package/commands/tools/image-recognition/update-image-recognition-job-title.command.ts +19 -0
- package/commands/tools/index.ts +1 -0
- package/constants/cabinet/enums/statistics-request-type.enum.ts +1 -0
- package/models/tools/image-recognition/image-recognition-category.schema.ts +14 -0
- package/models/tools/image-recognition/image-recognition-config.schema.ts +10 -0
- package/models/tools/image-recognition/image-recognition-job.schema.ts +25 -0
- package/models/tools/image-recognition/image-recognition-model.schema.ts +28 -0
- package/models/tools/image-recognition/index.ts +4 -0
- package/models/tools/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const IMAGE_RECOGNITION_CONTROLLER_PUBLIC = 'public/tools/image-recognition' as const;
|
|
2
|
+
export const IMAGE_RECOGNITION_CONTROLLER_PRIVATE = 'private/tools/image-recognition' as const;
|
|
3
|
+
|
|
4
|
+
export const IMAGE_RECOGNITION_ROUTES = {
|
|
5
|
+
CONFIG: 'config',
|
|
6
|
+
EXECUTE: 'execute',
|
|
7
|
+
GET_JOBS: 'jobs',
|
|
8
|
+
GET_JOB: (uuid: string) => `jobs/${uuid}`,
|
|
9
|
+
UPDATE: (uuid: string) => `jobs/${uuid}`,
|
|
10
|
+
UPDATE_FAVORITE: (uuid: string) => `jobs/${uuid}/favorite`,
|
|
11
|
+
SET_REACTION: (uuid: string) => `jobs/${uuid}/reaction`,
|
|
12
|
+
RETRY: (uuid: string) => `jobs/${uuid}/retry`,
|
|
13
|
+
DELETE: (uuid: string) => `jobs/${uuid}`,
|
|
14
|
+
DELETE_ALL: 'jobs',
|
|
15
|
+
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -1147,6 +1147,42 @@ export const REST_API = {
|
|
|
1147
1147
|
RETRY: (uuid: string) =>
|
|
1148
1148
|
`${ROOT}/${CONTROLLERS.IMAGE_EDITOR_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_EDITOR_ROUTES.RETRY(uuid)}`,
|
|
1149
1149
|
},
|
|
1150
|
+
IMAGE_RECOGNITION_PUBLIC: {
|
|
1151
|
+
CONFIG: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.CONFIG}`,
|
|
1152
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.EXECUTE}`,
|
|
1153
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOBS}`,
|
|
1154
|
+
GET_JOB: (uuid: string) =>
|
|
1155
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOB(uuid)}`,
|
|
1156
|
+
UPDATE: (uuid: string) =>
|
|
1157
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE(uuid)}`,
|
|
1158
|
+
UPDATE_FAVORITE: (uuid: string) =>
|
|
1159
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE_FAVORITE(uuid)}`,
|
|
1160
|
+
SET_REACTION: (uuid: string) =>
|
|
1161
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.SET_REACTION(uuid)}`,
|
|
1162
|
+
RETRY: (uuid: string) =>
|
|
1163
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.RETRY(uuid)}`,
|
|
1164
|
+
DELETE: (uuid: string) =>
|
|
1165
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE(uuid)}`,
|
|
1166
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE_ALL}`,
|
|
1167
|
+
},
|
|
1168
|
+
IMAGE_RECOGNITION_PRIVATE: {
|
|
1169
|
+
CONFIG: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.CONFIG}`,
|
|
1170
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.EXECUTE}`,
|
|
1171
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOBS}`,
|
|
1172
|
+
GET_JOB: (uuid: string) =>
|
|
1173
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOB(uuid)}`,
|
|
1174
|
+
UPDATE: (uuid: string) =>
|
|
1175
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE(uuid)}`,
|
|
1176
|
+
UPDATE_FAVORITE: (uuid: string) =>
|
|
1177
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE_FAVORITE(uuid)}`,
|
|
1178
|
+
SET_REACTION: (uuid: string) =>
|
|
1179
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.SET_REACTION(uuid)}`,
|
|
1180
|
+
RETRY: (uuid: string) =>
|
|
1181
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.RETRY(uuid)}`,
|
|
1182
|
+
DELETE: (uuid: string) =>
|
|
1183
|
+
`${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE(uuid)}`,
|
|
1184
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE_ALL}`,
|
|
1185
|
+
},
|
|
1150
1186
|
VIDEO_EDITOR_PUBLIC: {
|
|
1151
1187
|
CONFIG: `${ROOT}/${CONTROLLERS.VIDEO_EDITOR_CONTROLLER_PUBLIC}/${CONTROLLERS.VIDEO_EDITOR_ROUTES.CONFIG}`,
|
|
1152
1188
|
EXECUTE: `${ROOT}/${CONTROLLERS.VIDEO_EDITOR_CONTROLLER_PUBLIC}/${CONTROLLERS.VIDEO_EDITOR_ROUTES.EXECUTE}`,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IMAGE_RECOGNITION_ROUTES = exports.IMAGE_RECOGNITION_CONTROLLER_PRIVATE = exports.IMAGE_RECOGNITION_CONTROLLER_PUBLIC = void 0;
|
|
4
|
+
exports.IMAGE_RECOGNITION_CONTROLLER_PUBLIC = 'public/tools/image-recognition';
|
|
5
|
+
exports.IMAGE_RECOGNITION_CONTROLLER_PRIVATE = 'private/tools/image-recognition';
|
|
6
|
+
exports.IMAGE_RECOGNITION_ROUTES = {
|
|
7
|
+
CONFIG: 'config',
|
|
8
|
+
EXECUTE: 'execute',
|
|
9
|
+
GET_JOBS: 'jobs',
|
|
10
|
+
GET_JOB: (uuid) => `jobs/${uuid}`,
|
|
11
|
+
UPDATE: (uuid) => `jobs/${uuid}`,
|
|
12
|
+
UPDATE_FAVORITE: (uuid) => `jobs/${uuid}/favorite`,
|
|
13
|
+
SET_REACTION: (uuid) => `jobs/${uuid}/reaction`,
|
|
14
|
+
RETRY: (uuid) => `jobs/${uuid}/retry`,
|
|
15
|
+
DELETE: (uuid) => `jobs/${uuid}`,
|
|
16
|
+
DELETE_ALL: 'jobs',
|
|
17
|
+
};
|
|
@@ -75,6 +75,7 @@ __exportStar(require("./video"), exports);
|
|
|
75
75
|
__exportStar(require("./video-editor"), exports);
|
|
76
76
|
__exportStar(require("./writer"), exports);
|
|
77
77
|
__exportStar(require("./image-editor"), exports);
|
|
78
|
+
__exportStar(require("./image-recognition"), exports);
|
|
78
79
|
__exportStar(require("./daily-streak"), exports);
|
|
79
80
|
__exportStar(require("./cabinet"), exports);
|
|
80
81
|
__exportStar(require("./webmaster"), exports);
|
package/build/api/routes.js
CHANGED
|
@@ -826,6 +826,30 @@ exports.REST_API = {
|
|
|
826
826
|
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.IMAGE_EDITOR_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_EDITOR_ROUTES.DELETE_ALL}`,
|
|
827
827
|
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_EDITOR_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_EDITOR_ROUTES.RETRY(uuid)}`,
|
|
828
828
|
},
|
|
829
|
+
IMAGE_RECOGNITION_PUBLIC: {
|
|
830
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.CONFIG}`,
|
|
831
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.EXECUTE}`,
|
|
832
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOBS}`,
|
|
833
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOB(uuid)}`,
|
|
834
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE(uuid)}`,
|
|
835
|
+
UPDATE_FAVORITE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE_FAVORITE(uuid)}`,
|
|
836
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.SET_REACTION(uuid)}`,
|
|
837
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.RETRY(uuid)}`,
|
|
838
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE(uuid)}`,
|
|
839
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PUBLIC}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE_ALL}`,
|
|
840
|
+
},
|
|
841
|
+
IMAGE_RECOGNITION_PRIVATE: {
|
|
842
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.CONFIG}`,
|
|
843
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.EXECUTE}`,
|
|
844
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOBS}`,
|
|
845
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.GET_JOB(uuid)}`,
|
|
846
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE(uuid)}`,
|
|
847
|
+
UPDATE_FAVORITE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.UPDATE_FAVORITE(uuid)}`,
|
|
848
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.SET_REACTION(uuid)}`,
|
|
849
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.RETRY(uuid)}`,
|
|
850
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE(uuid)}`,
|
|
851
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.IMAGE_RECOGNITION_CONTROLLER_PRIVATE}/${CONTROLLERS.IMAGE_RECOGNITION_ROUTES.DELETE_ALL}`,
|
|
852
|
+
},
|
|
829
853
|
VIDEO_EDITOR_PUBLIC: {
|
|
830
854
|
CONFIG: `${exports.ROOT}/${CONTROLLERS.VIDEO_EDITOR_CONTROLLER_PUBLIC}/${CONTROLLERS.VIDEO_EDITOR_ROUTES.CONFIG}`,
|
|
831
855
|
EXECUTE: `${exports.ROOT}/${CONTROLLERS.VIDEO_EDITOR_CONTROLLER_PUBLIC}/${CONTROLLERS.VIDEO_EDITOR_ROUTES.EXECUTE}`,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAllImageRecognitionJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAllImageRecognitionJobsCommand;
|
|
6
|
+
(function (DeleteAllImageRecognitionJobsCommand) {
|
|
7
|
+
DeleteAllImageRecognitionJobsCommand.ResponseSchema = zod_1.z.void();
|
|
8
|
+
})(DeleteAllImageRecognitionJobsCommand || (exports.DeleteAllImageRecognitionJobsCommand = DeleteAllImageRecognitionJobsCommand = {}));
|
package/build/commands/tools/image-recognition/delete-image-recognition-job-by-uuid.command.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteImageRecognitionJobByUuidCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteImageRecognitionJobByUuidCommand;
|
|
6
|
+
(function (DeleteImageRecognitionJobByUuidCommand) {
|
|
7
|
+
DeleteImageRecognitionJobByUuidCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteImageRecognitionJobByUuidCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
+
})(DeleteImageRecognitionJobByUuidCommand || (exports.DeleteImageRecognitionJobByUuidCommand = DeleteImageRecognitionJobByUuidCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindImageRecognitionJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindImageRecognitionJobByUUIDCommand;
|
|
7
|
+
(function (FindImageRecognitionJobByUUIDCommand) {
|
|
8
|
+
FindImageRecognitionJobByUUIDCommand.RequestParamsSchema = models_1.ToolJobSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
FindImageRecognitionJobByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
13
|
+
});
|
|
14
|
+
})(FindImageRecognitionJobByUUIDCommand || (exports.FindImageRecognitionJobByUUIDCommand = FindImageRecognitionJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindImageRecognitionJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const helpers_1 = require("../../../helpers");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
const models_1 = require("../../../models");
|
|
8
|
+
var FindImageRecognitionJobsCommand;
|
|
9
|
+
(function (FindImageRecognitionJobsCommand) {
|
|
10
|
+
FindImageRecognitionJobsCommand.RequestQuerySchema = zod_1.z.object({
|
|
11
|
+
limit: zod_1.z.coerce.number().min(1).optional(),
|
|
12
|
+
offset: zod_1.z.coerce.number().min(0).default(0).optional(),
|
|
13
|
+
title: zod_1.z.string().optional(),
|
|
14
|
+
isFavorite: helpers_1.QueryBooleanSchema.optional(),
|
|
15
|
+
createdAtSortOrder: zod_1.z.nativeEnum(constants_1.JOB_SORT).optional().default(constants_1.JOB_SORT.DESC),
|
|
16
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS).optional(),
|
|
17
|
+
});
|
|
18
|
+
FindImageRecognitionJobsCommand.ResponseSchema = zod_1.z.object({
|
|
19
|
+
data: zod_1.z.array(models_1.ImageRecognitionJobSchema),
|
|
20
|
+
totalPages: zod_1.z.number(),
|
|
21
|
+
total: zod_1.z.number(),
|
|
22
|
+
page: zod_1.z.number(),
|
|
23
|
+
});
|
|
24
|
+
})(FindImageRecognitionJobsCommand || (exports.FindImageRecognitionJobsCommand = FindImageRecognitionJobsCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetImageRecognitionToolConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var GetImageRecognitionToolConfigCommand;
|
|
7
|
+
(function (GetImageRecognitionToolConfigCommand) {
|
|
8
|
+
GetImageRecognitionToolConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: models_1.ImageRecognitionConfigSchema,
|
|
10
|
+
});
|
|
11
|
+
})(GetImageRecognitionToolConfigCommand || (exports.GetImageRecognitionToolConfigCommand = GetImageRecognitionToolConfigCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRecognitionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var ImageRecognitionCommand;
|
|
7
|
+
(function (ImageRecognitionCommand) {
|
|
8
|
+
ImageRecognitionCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
modelId: zod_1.z.string().uuid(),
|
|
10
|
+
categoryId: zod_1.z.string().uuid(),
|
|
11
|
+
prompt: zod_1.z.string().optional(),
|
|
12
|
+
params: zod_1.z.object({
|
|
13
|
+
attachedFiles: zod_1.z.array(zod_1.z.string()).min(1),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
ImageRecognitionCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
18
|
+
});
|
|
19
|
+
})(ImageRecognitionCommand || (exports.ImageRecognitionCommand = ImageRecognitionCommand = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./delete-all-image-recognition-jobs.command"), exports);
|
|
18
|
+
__exportStar(require("./delete-image-recognition-job-by-uuid.command"), exports);
|
|
19
|
+
__exportStar(require("./find-image-recognition-job-by-uuid.command"), exports);
|
|
20
|
+
__exportStar(require("./find-image-recognition-jobs.command"), exports);
|
|
21
|
+
__exportStar(require("./get-image-recognition-tool-config.command"), exports);
|
|
22
|
+
__exportStar(require("./image-recognition.command"), exports);
|
|
23
|
+
__exportStar(require("./retry-image-recognition-job.command"), exports);
|
|
24
|
+
__exportStar(require("./set-reaction-to-image-recognition-job.command"), exports);
|
|
25
|
+
__exportStar(require("./update-image-recognition-job-favorite.command"), exports);
|
|
26
|
+
__exportStar(require("./update-image-recognition-job-title.command"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryImageRecognitionJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var RetryImageRecognitionJobCommand;
|
|
7
|
+
(function (RetryImageRecognitionJobCommand) {
|
|
8
|
+
RetryImageRecognitionJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
RetryImageRecognitionJobCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
modelId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
categoryId: zod_1.z.string().uuid().optional(),
|
|
14
|
+
prompt: zod_1.z.string().optional(),
|
|
15
|
+
params: zod_1.z
|
|
16
|
+
.object({
|
|
17
|
+
attachedFiles: zod_1.z.array(zod_1.z.string()).min(1),
|
|
18
|
+
})
|
|
19
|
+
.optional(),
|
|
20
|
+
});
|
|
21
|
+
RetryImageRecognitionJobCommand.ResponseSchema = zod_1.z.object({
|
|
22
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
23
|
+
});
|
|
24
|
+
})(RetryImageRecognitionJobCommand || (exports.RetryImageRecognitionJobCommand = RetryImageRecognitionJobCommand = {}));
|
package/build/commands/tools/image-recognition/set-reaction-to-image-recognition-job.command.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToImageRecognitionJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
var SetReactionToImageRecognitionJobCommand;
|
|
8
|
+
(function (SetReactionToImageRecognitionJobCommand) {
|
|
9
|
+
SetReactionToImageRecognitionJobCommand.RequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
12
|
+
dislikeReason: zod_1.z.string().nullable().default(null),
|
|
13
|
+
})
|
|
14
|
+
.refine((data) => {
|
|
15
|
+
if (data.reaction !== constants_1.USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}, {
|
|
20
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
21
|
+
});
|
|
22
|
+
SetReactionToImageRecognitionJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
23
|
+
uuid: zod_1.z.string().uuid(),
|
|
24
|
+
});
|
|
25
|
+
SetReactionToImageRecognitionJobCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
27
|
+
});
|
|
28
|
+
})(SetReactionToImageRecognitionJobCommand || (exports.SetReactionToImageRecognitionJobCommand = SetReactionToImageRecognitionJobCommand = {}));
|
package/build/commands/tools/image-recognition/update-image-recognition-job-favorite.command.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateImageRecognitionJobFavoriteCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var UpdateImageRecognitionJobFavoriteCommand;
|
|
7
|
+
(function (UpdateImageRecognitionJobFavoriteCommand) {
|
|
8
|
+
UpdateImageRecognitionJobFavoriteCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
isFavorite: zod_1.z.boolean(),
|
|
10
|
+
});
|
|
11
|
+
UpdateImageRecognitionJobFavoriteCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateImageRecognitionJobFavoriteCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateImageRecognitionJobFavoriteCommand || (exports.UpdateImageRecognitionJobFavoriteCommand = UpdateImageRecognitionJobFavoriteCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateImageRecognitionJobTitleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var UpdateImageRecognitionJobTitleCommand;
|
|
7
|
+
(function (UpdateImageRecognitionJobTitleCommand) {
|
|
8
|
+
UpdateImageRecognitionJobTitleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
title: zod_1.z.string().min(1).max(40).trim(),
|
|
10
|
+
});
|
|
11
|
+
UpdateImageRecognitionJobTitleCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateImageRecognitionJobTitleCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.ImageRecognitionJobSchema,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateImageRecognitionJobTitleCommand || (exports.UpdateImageRecognitionJobTitleCommand = UpdateImageRecognitionJobTitleCommand = {}));
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./tts"), exports);
|
|
|
22
22
|
__exportStar(require("./video"), exports);
|
|
23
23
|
__exportStar(require("./writer"), exports);
|
|
24
24
|
__exportStar(require("./image-editor"), exports);
|
|
25
|
+
__exportStar(require("./image-recognition"), exports);
|
|
25
26
|
__exportStar(require("./video-editor"), exports);
|
|
26
27
|
__exportStar(require("./music"), exports);
|
|
27
28
|
__exportStar(require("./image-generation"), exports);
|
|
@@ -4,6 +4,7 @@ exports.STATISTICS_REQUEST_TYPE = void 0;
|
|
|
4
4
|
var STATISTICS_REQUEST_TYPE;
|
|
5
5
|
(function (STATISTICS_REQUEST_TYPE) {
|
|
6
6
|
STATISTICS_REQUEST_TYPE["IMAGE"] = "IMAGE";
|
|
7
|
+
STATISTICS_REQUEST_TYPE["IMAGE_RECOGNITION"] = "IMAGE_RECOGNITION";
|
|
7
8
|
STATISTICS_REQUEST_TYPE["VIDEO"] = "VIDEO";
|
|
8
9
|
STATISTICS_REQUEST_TYPE["PRESENTATION"] = "PRESENTATION";
|
|
9
10
|
STATISTICS_REQUEST_TYPE["TEXT"] = "TEXT";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRecognitionCategorySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.ImageRecognitionCategorySchema = zod_1.z.object({
|
|
6
|
+
uuid: zod_1.z.string(),
|
|
7
|
+
parentId: zod_1.z.string().nullable(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
systemPrompt: zod_1.z.string(),
|
|
10
|
+
order: zod_1.z.number(),
|
|
11
|
+
status: zod_1.z.string(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRecognitionConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const image_recognition_model_schema_1 = require("./image-recognition-model.schema");
|
|
6
|
+
const image_recognition_category_schema_1 = require("./image-recognition-category.schema");
|
|
7
|
+
exports.ImageRecognitionConfigSchema = zod_1.z.object({
|
|
8
|
+
models: zod_1.z.array(image_recognition_model_schema_1.ImageRecognitionModelSchema),
|
|
9
|
+
categories: zod_1.z.array(image_recognition_category_schema_1.ImageRecognitionCategorySchema),
|
|
10
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRecognitionJobSchema = exports.ImageRecognitionJobParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
exports.ImageRecognitionJobParamsSchema = zod_1.z.object({
|
|
9
|
+
attachedFiles: zod_1.z.array(common_1.AttachedToolFileSchema),
|
|
10
|
+
});
|
|
11
|
+
exports.ImageRecognitionJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
12
|
+
title: zod_1.z.string(),
|
|
13
|
+
prompt: zod_1.z.string().nullable(),
|
|
14
|
+
categoryId: zod_1.z.string(),
|
|
15
|
+
aiOutput: zod_1.z.string().nullable(),
|
|
16
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
17
|
+
dislikeReason: zod_1.z.string().nullable(),
|
|
18
|
+
modelId: zod_1.z.string(),
|
|
19
|
+
price: zod_1.z.number(),
|
|
20
|
+
params: exports.ImageRecognitionJobParamsSchema,
|
|
21
|
+
completedAt: zod_1.z.date().nullable().optional(),
|
|
22
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ImageRecognitionModelSchema = exports.ImageRecognitionModelParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../icon-variants.schema");
|
|
6
|
+
exports.ImageRecognitionModelParamsSchema = zod_1.z.object({
|
|
7
|
+
imageAttachment: zod_1.z.object({
|
|
8
|
+
supported: zod_1.z.boolean(),
|
|
9
|
+
maxImages: zod_1.z.number(),
|
|
10
|
+
acceptedTypes: zod_1.z.array(zod_1.z.string()),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
exports.ImageRecognitionModelSchema = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string(),
|
|
15
|
+
title: zod_1.z.string(),
|
|
16
|
+
description: zod_1.z.string(),
|
|
17
|
+
aiModel: zod_1.z.string(),
|
|
18
|
+
price: zod_1.z.number(),
|
|
19
|
+
order: zod_1.z.number(),
|
|
20
|
+
status: zod_1.z.string(),
|
|
21
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
22
|
+
params: exports.ImageRecognitionModelParamsSchema,
|
|
23
|
+
createdAt: zod_1.z.date(),
|
|
24
|
+
updatedAt: zod_1.z.date(),
|
|
25
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./image-recognition-category.schema"), exports);
|
|
18
|
+
__exportStar(require("./image-recognition-config.schema"), exports);
|
|
19
|
+
__exportStar(require("./image-recognition-job.schema"), exports);
|
|
20
|
+
__exportStar(require("./image-recognition-model.schema"), exports);
|
|
@@ -23,6 +23,7 @@ __exportStar(require("./tts"), exports);
|
|
|
23
23
|
__exportStar(require("./video"), exports);
|
|
24
24
|
__exportStar(require("./writer"), exports);
|
|
25
25
|
__exportStar(require("./image-editor"), exports);
|
|
26
|
+
__exportStar(require("./image-recognition"), exports);
|
|
26
27
|
__exportStar(require("./video-editor"), exports);
|
|
27
28
|
__exportStar(require("./music"), exports);
|
|
28
29
|
__exportStar(require("./image-generation"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteImageRecognitionJobByUuidCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.void();
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema, ToolJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindImageRecognitionJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = ToolJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: ImageRecognitionJobSchema,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { QueryBooleanSchema } from '../../../helpers';
|
|
3
|
+
import { JOB_SORT, TOOL_JOB_STATUS } from '../../../constants';
|
|
4
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
5
|
+
|
|
6
|
+
export namespace FindImageRecognitionJobsCommand {
|
|
7
|
+
export const RequestQuerySchema = z.object({
|
|
8
|
+
limit: z.coerce.number().min(1).optional(),
|
|
9
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
10
|
+
title: z.string().optional(),
|
|
11
|
+
isFavorite: QueryBooleanSchema.optional(),
|
|
12
|
+
createdAtSortOrder: z.nativeEnum(JOB_SORT).optional().default(JOB_SORT.DESC),
|
|
13
|
+
status: z.nativeEnum(TOOL_JOB_STATUS).optional(),
|
|
14
|
+
});
|
|
15
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: z.array(ImageRecognitionJobSchema),
|
|
19
|
+
totalPages: z.number(),
|
|
20
|
+
total: z.number(),
|
|
21
|
+
page: z.number(),
|
|
22
|
+
});
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionConfigSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetImageRecognitionToolConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: ImageRecognitionConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace ImageRecognitionCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
modelId: z.string().uuid(),
|
|
7
|
+
categoryId: z.string().uuid(),
|
|
8
|
+
prompt: z.string().optional(),
|
|
9
|
+
params: z.object({
|
|
10
|
+
attachedFiles: z.array(z.string()).min(1),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ImageRecognitionJobSchema,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './delete-all-image-recognition-jobs.command';
|
|
2
|
+
export * from './delete-image-recognition-job-by-uuid.command';
|
|
3
|
+
export * from './find-image-recognition-job-by-uuid.command';
|
|
4
|
+
export * from './find-image-recognition-jobs.command';
|
|
5
|
+
export * from './get-image-recognition-tool-config.command';
|
|
6
|
+
export * from './image-recognition.command';
|
|
7
|
+
export * from './retry-image-recognition-job.command';
|
|
8
|
+
export * from './set-reaction-to-image-recognition-job.command';
|
|
9
|
+
export * from './update-image-recognition-job-favorite.command';
|
|
10
|
+
export * from './update-image-recognition-job-title.command';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetryImageRecognitionJobCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
modelId: z.string().uuid().optional(),
|
|
12
|
+
categoryId: z.string().uuid().optional(),
|
|
13
|
+
prompt: z.string().optional(),
|
|
14
|
+
params: z
|
|
15
|
+
.object({
|
|
16
|
+
attachedFiles: z.array(z.string()).min(1),
|
|
17
|
+
})
|
|
18
|
+
.optional(),
|
|
19
|
+
});
|
|
20
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = z.object({
|
|
23
|
+
data: ImageRecognitionJobSchema,
|
|
24
|
+
});
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToImageRecognitionJobCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
9
|
+
dislikeReason: z.string().nullable().default(null),
|
|
10
|
+
})
|
|
11
|
+
.refine(
|
|
12
|
+
(data) => {
|
|
13
|
+
if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'Dislike reason is not allowed when reaction is not DISLIKED',
|
|
20
|
+
},
|
|
21
|
+
);
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const RequestParamsSchema = z.object({
|
|
25
|
+
uuid: z.string().uuid(),
|
|
26
|
+
});
|
|
27
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
28
|
+
|
|
29
|
+
export const ResponseSchema = z.object({
|
|
30
|
+
data: ImageRecognitionJobSchema,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateImageRecognitionJobFavoriteCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
isFavorite: z.boolean(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ImageRecognitionJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionJobSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateImageRecognitionJobTitleCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
title: z.string().min(1).max(40).trim(),
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestParamsSchema = z.object({
|
|
11
|
+
uuid: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: ImageRecognitionJobSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
package/commands/tools/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const ImageRecognitionCategorySchema = z.object({
|
|
4
|
+
uuid: z.string(),
|
|
5
|
+
parentId: z.string().nullable(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
systemPrompt: z.string(),
|
|
8
|
+
order: z.number(),
|
|
9
|
+
status: z.string(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type ImageRecognitionCategory = z.infer<typeof ImageRecognitionCategorySchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ImageRecognitionModelSchema } from './image-recognition-model.schema';
|
|
3
|
+
import { ImageRecognitionCategorySchema } from './image-recognition-category.schema';
|
|
4
|
+
|
|
5
|
+
export const ImageRecognitionConfigSchema = z.object({
|
|
6
|
+
models: z.array(ImageRecognitionModelSchema),
|
|
7
|
+
categories: z.array(ImageRecognitionCategorySchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type ImageRecognitionConfig = z.infer<typeof ImageRecognitionConfigSchema>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { USER_REACTION } from '../../../constants';
|
|
3
|
+
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
|
+
import { AttachedToolFileSchema } from '../common';
|
|
5
|
+
|
|
6
|
+
export const ImageRecognitionJobParamsSchema = z.object({
|
|
7
|
+
attachedFiles: z.array(AttachedToolFileSchema),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type ImageRecognitionJobParams = z.infer<typeof ImageRecognitionJobParamsSchema>;
|
|
11
|
+
|
|
12
|
+
export const ImageRecognitionJobSchema = ToolJobSchema.extend({
|
|
13
|
+
title: z.string(),
|
|
14
|
+
prompt: z.string().nullable(),
|
|
15
|
+
categoryId: z.string(),
|
|
16
|
+
aiOutput: z.string().nullable(),
|
|
17
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
18
|
+
dislikeReason: z.string().nullable(),
|
|
19
|
+
modelId: z.string(),
|
|
20
|
+
price: z.number(),
|
|
21
|
+
params: ImageRecognitionJobParamsSchema,
|
|
22
|
+
completedAt: z.date().nullable().optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type ImageRecognitionJob = z.infer<typeof ImageRecognitionJobSchema>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
|
|
4
|
+
export const ImageRecognitionModelParamsSchema = z.object({
|
|
5
|
+
imageAttachment: z.object({
|
|
6
|
+
supported: z.boolean(),
|
|
7
|
+
maxImages: z.number(),
|
|
8
|
+
acceptedTypes: z.array(z.string()),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type ImageRecognitionModelParams = z.infer<typeof ImageRecognitionModelParamsSchema>;
|
|
13
|
+
|
|
14
|
+
export const ImageRecognitionModelSchema = z.object({
|
|
15
|
+
uuid: z.string(),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
description: z.string(),
|
|
18
|
+
aiModel: z.string(),
|
|
19
|
+
price: z.number(),
|
|
20
|
+
order: z.number(),
|
|
21
|
+
status: z.string(),
|
|
22
|
+
icons: IconVariantsSchema,
|
|
23
|
+
params: ImageRecognitionModelParamsSchema,
|
|
24
|
+
createdAt: z.date(),
|
|
25
|
+
updatedAt: z.date(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type ImageRecognitionModel = z.infer<typeof ImageRecognitionModelSchema>;
|
package/models/tools/index.ts
CHANGED