@purpleschool/gptbot 0.12.41 → 0.12.43
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/diagrams.ts +16 -0
- package/api/controllers/http/index.ts +2 -0
- package/api/controllers/http/order.ts +7 -0
- package/api/routes.ts +46 -0
- package/build/api/controllers/http/diagrams.js +18 -0
- package/build/api/controllers/http/index.js +2 -0
- package/build/api/controllers/http/order.js +8 -0
- package/build/api/routes.js +32 -0
- package/build/commands/index.js +1 -0
- package/build/commands/order/get-order-payment-status.command.js +16 -0
- package/build/commands/order/index.js +17 -0
- package/build/commands/tools/diagrams/delete-all-diagrams-jobs.command.js +10 -0
- package/build/commands/tools/diagrams/delete-diagrams-job-by-uuid.command.js +13 -0
- package/build/commands/tools/diagrams/diagrams.command.js +19 -0
- package/build/commands/tools/diagrams/edit-diagrams-job.command.js +21 -0
- package/build/commands/tools/diagrams/find-diagrams-job-by-uuid.command.js +14 -0
- package/build/commands/tools/diagrams/find-diagrams-jobs.command.js +18 -0
- package/build/commands/tools/diagrams/get-diagrams-price.command.js +17 -0
- package/build/commands/tools/diagrams/get-diagrams-tool-config.command.js +11 -0
- package/build/commands/tools/diagrams/index.js +27 -0
- package/build/commands/tools/diagrams/retry-diagrams-job.command.js +19 -0
- package/build/commands/tools/diagrams/set-reaction-to-diagrams-job.command.js +28 -0
- package/build/commands/tools/diagrams/update-diagrams-job-title.command.js +17 -0
- package/build/commands/tools/index.js +1 -0
- package/build/constants/tool/enums/tool-content-type.enum.js +1 -0
- package/build/models/tools/diagrams/diagrams-chart-type.schema.js +17 -0
- package/build/models/tools/diagrams/diagrams-config.schema.js +10 -0
- package/build/models/tools/diagrams/diagrams-job.schema.js +64 -0
- package/build/models/tools/diagrams/diagrams-model.schema.js +41 -0
- package/build/models/tools/diagrams/index.js +20 -0
- package/build/models/tools/index.js +1 -0
- package/commands/index.ts +1 -0
- package/commands/order/get-order-payment-status.command.ts +18 -0
- package/commands/order/index.ts +1 -0
- package/commands/tools/diagrams/delete-all-diagrams-jobs.command.ts +8 -0
- package/commands/tools/diagrams/delete-diagrams-job-by-uuid.command.ts +13 -0
- package/commands/tools/diagrams/diagrams.command.ts +19 -0
- package/commands/tools/diagrams/edit-diagrams-job.command.ts +23 -0
- package/commands/tools/diagrams/find-diagrams-job-by-uuid.command.ts +14 -0
- package/commands/tools/diagrams/find-diagrams-jobs.command.ts +18 -0
- package/commands/tools/diagrams/get-diagrams-price.command.ts +17 -0
- package/commands/tools/diagrams/get-diagrams-tool-config.command.ts +9 -0
- package/commands/tools/diagrams/index.ts +11 -0
- package/commands/tools/diagrams/retry-diagrams-job.command.ts +21 -0
- package/commands/tools/diagrams/set-reaction-to-diagrams-job.command.ts +33 -0
- package/commands/tools/diagrams/update-diagrams-job-title.command.ts +19 -0
- package/commands/tools/index.ts +1 -0
- package/constants/tool/enums/tool-content-type.enum.ts +1 -0
- package/models/tools/diagrams/diagrams-chart-type.schema.ts +20 -0
- package/models/tools/diagrams/diagrams-config.schema.ts +10 -0
- package/models/tools/diagrams/diagrams-job.schema.ts +85 -0
- package/models/tools/diagrams/diagrams-model.schema.ts +47 -0
- package/models/tools/diagrams/index.ts +4 -0
- package/models/tools/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const DIAGRAMS_CONTROLLER_PRIVATE = 'private/tools/diagrams' as const;
|
|
2
|
+
export const DIAGRAMS_CONTROLLER_PUBLIC = 'public/tools/diagrams' as const;
|
|
3
|
+
|
|
4
|
+
export const DIAGRAMS_ROUTES = {
|
|
5
|
+
CONFIG: 'config',
|
|
6
|
+
PRICE: 'price',
|
|
7
|
+
EXECUTE: 'execute',
|
|
8
|
+
GET_JOBS: 'jobs',
|
|
9
|
+
GET_JOB: (uuid: string) => `jobs/${uuid}`,
|
|
10
|
+
EDIT: (uuid: string) => `jobs/${uuid}/edit`,
|
|
11
|
+
UPDATE: (uuid: string) => `jobs/${uuid}`,
|
|
12
|
+
SET_REACTION: (uuid: string) => `jobs/${uuid}/reaction`,
|
|
13
|
+
DELETE: (uuid: string) => `jobs/${uuid}`,
|
|
14
|
+
DELETE_ALL: 'jobs',
|
|
15
|
+
RETRY: (uuid: string) => `jobs/${uuid}/retry`,
|
|
16
|
+
} as const;
|
|
@@ -52,6 +52,7 @@ export * from './daily-streak';
|
|
|
52
52
|
export * from './cabinet';
|
|
53
53
|
export * from './webmaster';
|
|
54
54
|
export * from './music';
|
|
55
|
+
export * from './order';
|
|
55
56
|
export * from './webmaster-click';
|
|
56
57
|
export * from './b2b';
|
|
57
58
|
export * from './community';
|
|
@@ -60,6 +61,7 @@ export * from './image-generation';
|
|
|
60
61
|
export * from './marketplace-card';
|
|
61
62
|
export * from './interior-design';
|
|
62
63
|
export * from './solving-edu-task';
|
|
64
|
+
export * from './diagrams';
|
|
63
65
|
export * from './team-account';
|
|
64
66
|
export * from './spell-corrector';
|
|
65
67
|
export * from './tool-workspace';
|
package/api/routes.ts
CHANGED
|
@@ -984,6 +984,14 @@ export const REST_API = {
|
|
|
984
984
|
REFUND: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.REFUND}`,
|
|
985
985
|
FIND_BY_CRITERIA: `${ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.FIND_BY_CRITERIA}`,
|
|
986
986
|
},
|
|
987
|
+
ORDER_PUBLIC: {
|
|
988
|
+
STATUS: (uuid: string) =>
|
|
989
|
+
`${ROOT}/${CONTROLLERS.ORDER_PUBLIC_CONTROLLER}/${CONTROLLERS.ORDER_ROUTES.STATUS(uuid)}`,
|
|
990
|
+
},
|
|
991
|
+
ORDER_PRIVATE: {
|
|
992
|
+
STATUS: (uuid: string) =>
|
|
993
|
+
`${ROOT}/${CONTROLLERS.ORDER_PRIVATE_CONTROLLER}/${CONTROLLERS.ORDER_ROUTES.STATUS(uuid)}`,
|
|
994
|
+
},
|
|
987
995
|
COURSE: {
|
|
988
996
|
FIND_BY_UUID: `${ROOT}/${CONTROLLERS.COURSE_CONTROLLER}/${CONTROLLERS.COURSE_ROUTES.FIND_BY_UUID}`,
|
|
989
997
|
FIND_BY_ALIAS: `${ROOT}/${CONTROLLERS.COURSE_CONTROLLER}/${CONTROLLERS.COURSE_ROUTES.FIND_BY_ALIAS}`,
|
|
@@ -1167,6 +1175,44 @@ export const REST_API = {
|
|
|
1167
1175
|
RETRY: (uuid: string) =>
|
|
1168
1176
|
`${ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.RETRY(uuid)}`,
|
|
1169
1177
|
},
|
|
1178
|
+
DIAGRAMS_PRIVATE: {
|
|
1179
|
+
CONFIG: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
|
|
1180
|
+
PRICE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
|
|
1181
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
|
|
1182
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
|
|
1183
|
+
GET_JOB: (uuid: string) =>
|
|
1184
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
|
|
1185
|
+
EDIT: (uuid: string) =>
|
|
1186
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
|
|
1187
|
+
UPDATE: (uuid: string) =>
|
|
1188
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
|
|
1189
|
+
SET_REACTION: (uuid: string) =>
|
|
1190
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
|
|
1191
|
+
DELETE: (uuid: string) =>
|
|
1192
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
|
|
1193
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
|
|
1194
|
+
RETRY: (uuid: string) =>
|
|
1195
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
|
|
1196
|
+
},
|
|
1197
|
+
DIAGRAMS_PUBLIC: {
|
|
1198
|
+
CONFIG: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
|
|
1199
|
+
PRICE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
|
|
1200
|
+
EXECUTE: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
|
|
1201
|
+
GET_JOBS: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
|
|
1202
|
+
GET_JOB: (uuid: string) =>
|
|
1203
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
|
|
1204
|
+
EDIT: (uuid: string) =>
|
|
1205
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
|
|
1206
|
+
UPDATE: (uuid: string) =>
|
|
1207
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
|
|
1208
|
+
SET_REACTION: (uuid: string) =>
|
|
1209
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
|
|
1210
|
+
DELETE: (uuid: string) =>
|
|
1211
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
|
|
1212
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
|
|
1213
|
+
RETRY: (uuid: string) =>
|
|
1214
|
+
`${ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
|
|
1215
|
+
},
|
|
1170
1216
|
TOOL_WORKSPACE_PRIVATE: {
|
|
1171
1217
|
GET_WORKSPACES: `${ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACES}`,
|
|
1172
1218
|
GET_WORKSPACE: (uuid: string) =>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DIAGRAMS_ROUTES = exports.DIAGRAMS_CONTROLLER_PUBLIC = exports.DIAGRAMS_CONTROLLER_PRIVATE = void 0;
|
|
4
|
+
exports.DIAGRAMS_CONTROLLER_PRIVATE = 'private/tools/diagrams';
|
|
5
|
+
exports.DIAGRAMS_CONTROLLER_PUBLIC = 'public/tools/diagrams';
|
|
6
|
+
exports.DIAGRAMS_ROUTES = {
|
|
7
|
+
CONFIG: 'config',
|
|
8
|
+
PRICE: 'price',
|
|
9
|
+
EXECUTE: 'execute',
|
|
10
|
+
GET_JOBS: 'jobs',
|
|
11
|
+
GET_JOB: (uuid) => `jobs/${uuid}`,
|
|
12
|
+
EDIT: (uuid) => `jobs/${uuid}/edit`,
|
|
13
|
+
UPDATE: (uuid) => `jobs/${uuid}`,
|
|
14
|
+
SET_REACTION: (uuid) => `jobs/${uuid}/reaction`,
|
|
15
|
+
DELETE: (uuid) => `jobs/${uuid}`,
|
|
16
|
+
DELETE_ALL: 'jobs',
|
|
17
|
+
RETRY: (uuid) => `jobs/${uuid}/retry`,
|
|
18
|
+
};
|
|
@@ -68,6 +68,7 @@ __exportStar(require("./daily-streak"), exports);
|
|
|
68
68
|
__exportStar(require("./cabinet"), exports);
|
|
69
69
|
__exportStar(require("./webmaster"), exports);
|
|
70
70
|
__exportStar(require("./music"), exports);
|
|
71
|
+
__exportStar(require("./order"), exports);
|
|
71
72
|
__exportStar(require("./webmaster-click"), exports);
|
|
72
73
|
__exportStar(require("./b2b"), exports);
|
|
73
74
|
__exportStar(require("./community"), exports);
|
|
@@ -76,6 +77,7 @@ __exportStar(require("./image-generation"), exports);
|
|
|
76
77
|
__exportStar(require("./marketplace-card"), exports);
|
|
77
78
|
__exportStar(require("./interior-design"), exports);
|
|
78
79
|
__exportStar(require("./solving-edu-task"), exports);
|
|
80
|
+
__exportStar(require("./diagrams"), exports);
|
|
79
81
|
__exportStar(require("./team-account"), exports);
|
|
80
82
|
__exportStar(require("./spell-corrector"), exports);
|
|
81
83
|
__exportStar(require("./tool-workspace"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ORDER_ROUTES = exports.ORDER_PRIVATE_CONTROLLER = exports.ORDER_PUBLIC_CONTROLLER = void 0;
|
|
4
|
+
exports.ORDER_PUBLIC_CONTROLLER = 'public/order';
|
|
5
|
+
exports.ORDER_PRIVATE_CONTROLLER = 'private/order';
|
|
6
|
+
exports.ORDER_ROUTES = {
|
|
7
|
+
STATUS: (uuid) => `${uuid}/status`,
|
|
8
|
+
};
|
package/build/api/routes.js
CHANGED
|
@@ -748,6 +748,12 @@ exports.REST_API = {
|
|
|
748
748
|
REFUND: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.REFUND}`,
|
|
749
749
|
FIND_BY_CRITERIA: `${exports.ROOT}/${CONTROLLERS.PAYMENT_CONTROLLER}/${CONTROLLERS.PAYMENT_ROUTES.FIND_BY_CRITERIA}`,
|
|
750
750
|
},
|
|
751
|
+
ORDER_PUBLIC: {
|
|
752
|
+
STATUS: (uuid) => `${exports.ROOT}/${CONTROLLERS.ORDER_PUBLIC_CONTROLLER}/${CONTROLLERS.ORDER_ROUTES.STATUS(uuid)}`,
|
|
753
|
+
},
|
|
754
|
+
ORDER_PRIVATE: {
|
|
755
|
+
STATUS: (uuid) => `${exports.ROOT}/${CONTROLLERS.ORDER_PRIVATE_CONTROLLER}/${CONTROLLERS.ORDER_ROUTES.STATUS(uuid)}`,
|
|
756
|
+
},
|
|
751
757
|
COURSE: {
|
|
752
758
|
FIND_BY_UUID: `${exports.ROOT}/${CONTROLLERS.COURSE_CONTROLLER}/${CONTROLLERS.COURSE_ROUTES.FIND_BY_UUID}`,
|
|
753
759
|
FIND_BY_ALIAS: `${exports.ROOT}/${CONTROLLERS.COURSE_CONTROLLER}/${CONTROLLERS.COURSE_ROUTES.FIND_BY_ALIAS}`,
|
|
@@ -880,6 +886,32 @@ exports.REST_API = {
|
|
|
880
886
|
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.DELETE_ALL}`,
|
|
881
887
|
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.SOLVING_EDU_TASK_CONTROLLER_PUBLIC}/${CONTROLLERS.SOLVING_EDU_TASK_ROUTES.RETRY(uuid)}`,
|
|
882
888
|
},
|
|
889
|
+
DIAGRAMS_PRIVATE: {
|
|
890
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
|
|
891
|
+
PRICE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
|
|
892
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
|
|
893
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
|
|
894
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
|
|
895
|
+
EDIT: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
|
|
896
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
|
|
897
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
|
|
898
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
|
|
899
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
|
|
900
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PRIVATE}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
|
|
901
|
+
},
|
|
902
|
+
DIAGRAMS_PUBLIC: {
|
|
903
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.CONFIG}`,
|
|
904
|
+
PRICE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.PRICE}`,
|
|
905
|
+
EXECUTE: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EXECUTE}`,
|
|
906
|
+
GET_JOBS: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOBS}`,
|
|
907
|
+
GET_JOB: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.GET_JOB(uuid)}`,
|
|
908
|
+
EDIT: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.EDIT(uuid)}`,
|
|
909
|
+
UPDATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.UPDATE(uuid)}`,
|
|
910
|
+
SET_REACTION: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.SET_REACTION(uuid)}`,
|
|
911
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE(uuid)}`,
|
|
912
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.DELETE_ALL}`,
|
|
913
|
+
RETRY: (uuid) => `${exports.ROOT}/${CONTROLLERS.DIAGRAMS_CONTROLLER_PUBLIC}/${CONTROLLERS.DIAGRAMS_ROUTES.RETRY(uuid)}`,
|
|
914
|
+
},
|
|
883
915
|
TOOL_WORKSPACE_PRIVATE: {
|
|
884
916
|
GET_WORKSPACES: `${exports.ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACES}`,
|
|
885
917
|
GET_WORKSPACE: (uuid) => `${exports.ROOT}/${CONTROLLERS.TOOL_WORKSPACE_CONTROLLER_PRIVATE}/${CONTROLLERS.TOOL_WORKSPACE_ROUTES.GET_WORKSPACE(uuid)}`,
|
package/build/commands/index.js
CHANGED
|
@@ -29,6 +29,7 @@ __exportStar(require("./key-value"), exports);
|
|
|
29
29
|
__exportStar(require("./message"), exports);
|
|
30
30
|
__exportStar(require("./midjourney"), exports);
|
|
31
31
|
__exportStar(require("./page"), exports);
|
|
32
|
+
__exportStar(require("./order"), exports);
|
|
32
33
|
__exportStar(require("./payment"), exports);
|
|
33
34
|
__exportStar(require("./product"), exports);
|
|
34
35
|
__exportStar(require("./question"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetOrderPaymentStatusCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
var GetOrderPaymentStatusCommand;
|
|
7
|
+
(function (GetOrderPaymentStatusCommand) {
|
|
8
|
+
GetOrderPaymentStatusCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
GetOrderPaymentStatusCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({
|
|
13
|
+
status: zod_1.z.nativeEnum(constants_1.ORDER_STATUS),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
})(GetOrderPaymentStatusCommand || (exports.GetOrderPaymentStatusCommand = GetOrderPaymentStatusCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
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("./get-order-payment-status.command"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAllDiagramsJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAllDiagramsJobsCommand;
|
|
6
|
+
(function (DeleteAllDiagramsJobsCommand) {
|
|
7
|
+
DeleteAllDiagramsJobsCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.boolean(),
|
|
9
|
+
});
|
|
10
|
+
})(DeleteAllDiagramsJobsCommand || (exports.DeleteAllDiagramsJobsCommand = DeleteAllDiagramsJobsCommand = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteDiagramsJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteDiagramsJobByUUIDCommand;
|
|
6
|
+
(function (DeleteDiagramsJobByUUIDCommand) {
|
|
7
|
+
DeleteDiagramsJobByUUIDCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteDiagramsJobByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.boolean(),
|
|
12
|
+
});
|
|
13
|
+
})(DeleteDiagramsJobByUUIDCommand || (exports.DeleteDiagramsJobByUUIDCommand = DeleteDiagramsJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var DiagramsCommand;
|
|
7
|
+
(function (DiagramsCommand) {
|
|
8
|
+
DiagramsCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
10
|
+
modelId: zod_1.z.string().uuid(),
|
|
11
|
+
params: zod_1.z.object({
|
|
12
|
+
chartTypeUuid: zod_1.z.string().uuid(),
|
|
13
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
DiagramsCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
18
|
+
});
|
|
19
|
+
})(DiagramsCommand || (exports.DiagramsCommand = DiagramsCommand = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EditDiagramsJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var EditDiagramsJobCommand;
|
|
7
|
+
(function (EditDiagramsJobCommand) {
|
|
8
|
+
EditDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
EditDiagramsJobCommand.RequestSchema = zod_1.z.object({
|
|
12
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
13
|
+
versionId: zod_1.z.string().uuid(),
|
|
14
|
+
modelId: zod_1.z.string().uuid().optional(),
|
|
15
|
+
chartTypeUuid: zod_1.z.string().uuid().optional(),
|
|
16
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
17
|
+
});
|
|
18
|
+
EditDiagramsJobCommand.ResponseSchema = zod_1.z.object({
|
|
19
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
20
|
+
});
|
|
21
|
+
})(EditDiagramsJobCommand || (exports.EditDiagramsJobCommand = EditDiagramsJobCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindDiagramsJobByUUIDCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindDiagramsJobByUUIDCommand;
|
|
7
|
+
(function (FindDiagramsJobByUUIDCommand) {
|
|
8
|
+
FindDiagramsJobByUUIDCommand.RequestParamsSchema = models_1.DiagramsJobSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
FindDiagramsJobByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
13
|
+
});
|
|
14
|
+
})(FindDiagramsJobByUUIDCommand || (exports.FindDiagramsJobByUUIDCommand = FindDiagramsJobByUUIDCommand = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindDiagramsJobsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var FindDiagramsJobsCommand;
|
|
7
|
+
(function (FindDiagramsJobsCommand) {
|
|
8
|
+
FindDiagramsJobsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
limit: zod_1.z.coerce.number().min(1).optional(),
|
|
10
|
+
offset: zod_1.z.coerce.number().min(0).default(0).optional(),
|
|
11
|
+
title: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
FindDiagramsJobsCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: zod_1.z.array(models_1.DiagramsJobSchemaResponse),
|
|
15
|
+
totalPages: zod_1.z.number(),
|
|
16
|
+
page: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
})(FindDiagramsJobsCommand || (exports.FindDiagramsJobsCommand = FindDiagramsJobsCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDiagramsPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var GetDiagramsPriceCommand;
|
|
6
|
+
(function (GetDiagramsPriceCommand) {
|
|
7
|
+
GetDiagramsPriceCommand.RequestSchema = zod_1.z.object({
|
|
8
|
+
modelId: zod_1.z.string().uuid(),
|
|
9
|
+
prompt: zod_1.z.string().min(1).max(100000),
|
|
10
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional().default([]),
|
|
11
|
+
});
|
|
12
|
+
GetDiagramsPriceCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: zod_1.z.object({
|
|
14
|
+
price: zod_1.z.number(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
})(GetDiagramsPriceCommand || (exports.GetDiagramsPriceCommand = GetDiagramsPriceCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetDiagramsToolConfigCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var GetDiagramsToolConfigCommand;
|
|
7
|
+
(function (GetDiagramsToolConfigCommand) {
|
|
8
|
+
GetDiagramsToolConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: models_1.DiagramsConfigSchema,
|
|
10
|
+
});
|
|
11
|
+
})(GetDiagramsToolConfigCommand || (exports.GetDiagramsToolConfigCommand = GetDiagramsToolConfigCommand = {}));
|
|
@@ -0,0 +1,27 @@
|
|
|
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("./diagrams.command"), exports);
|
|
18
|
+
__exportStar(require("./edit-diagrams-job.command"), exports);
|
|
19
|
+
__exportStar(require("./update-diagrams-job-title.command"), exports);
|
|
20
|
+
__exportStar(require("./set-reaction-to-diagrams-job.command"), exports);
|
|
21
|
+
__exportStar(require("./retry-diagrams-job.command"), exports);
|
|
22
|
+
__exportStar(require("./get-diagrams-price.command"), exports);
|
|
23
|
+
__exportStar(require("./delete-diagrams-job-by-uuid.command"), exports);
|
|
24
|
+
__exportStar(require("./delete-all-diagrams-jobs.command"), exports);
|
|
25
|
+
__exportStar(require("./find-diagrams-job-by-uuid.command"), exports);
|
|
26
|
+
__exportStar(require("./find-diagrams-jobs.command"), exports);
|
|
27
|
+
__exportStar(require("./get-diagrams-tool-config.command"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RetryDiagramsJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var RetryDiagramsJobCommand;
|
|
7
|
+
(function (RetryDiagramsJobCommand) {
|
|
8
|
+
RetryDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
RetryDiagramsJobCommand.RequestSchema = zod_1.z.object({
|
|
12
|
+
prompt: zod_1.z.string().optional(),
|
|
13
|
+
modelId: zod_1.z.string().uuid().optional(),
|
|
14
|
+
params: models_1.DiagramsJobRequestParamsSchema.optional(),
|
|
15
|
+
});
|
|
16
|
+
RetryDiagramsJobCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
18
|
+
});
|
|
19
|
+
})(RetryDiagramsJobCommand || (exports.RetryDiagramsJobCommand = RetryDiagramsJobCommand = {}));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SetReactionToDiagramsJobCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
var SetReactionToDiagramsJobCommand;
|
|
8
|
+
(function (SetReactionToDiagramsJobCommand) {
|
|
9
|
+
SetReactionToDiagramsJobCommand.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
|
+
SetReactionToDiagramsJobCommand.RequestParamsSchema = zod_1.z.object({
|
|
23
|
+
uuid: zod_1.z.string().uuid(),
|
|
24
|
+
});
|
|
25
|
+
SetReactionToDiagramsJobCommand.ResponseSchema = zod_1.z.object({
|
|
26
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
27
|
+
});
|
|
28
|
+
})(SetReactionToDiagramsJobCommand || (exports.SetReactionToDiagramsJobCommand = SetReactionToDiagramsJobCommand = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateDiagramsJobTitleCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var UpdateDiagramsJobTitleCommand;
|
|
7
|
+
(function (UpdateDiagramsJobTitleCommand) {
|
|
8
|
+
UpdateDiagramsJobTitleCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
title: zod_1.z.string().min(1).max(40).trim(),
|
|
10
|
+
});
|
|
11
|
+
UpdateDiagramsJobTitleCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.string().uuid(),
|
|
13
|
+
});
|
|
14
|
+
UpdateDiagramsJobTitleCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.DiagramsJobSchemaResponse,
|
|
16
|
+
});
|
|
17
|
+
})(UpdateDiagramsJobTitleCommand || (exports.UpdateDiagramsJobTitleCommand = UpdateDiagramsJobTitleCommand = {}));
|
|
@@ -31,3 +31,4 @@ __exportStar(require("./solving-edu-task"), exports);
|
|
|
31
31
|
__exportStar(require("./spell-corrector"), exports);
|
|
32
32
|
__exportStar(require("./html-page-builder"), exports);
|
|
33
33
|
__exportStar(require("./tool-workspace"), exports);
|
|
34
|
+
__exportStar(require("./diagrams"), exports);
|
|
@@ -18,4 +18,5 @@ var TOOL_CONTENT_TYPE;
|
|
|
18
18
|
TOOL_CONTENT_TYPE["MARKETPLACE_CARD_GENERATION"] = "MARKETPLACE_CARD";
|
|
19
19
|
TOOL_CONTENT_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
|
|
20
20
|
TOOL_CONTENT_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
|
|
21
|
+
TOOL_CONTENT_TYPE["DIAGRAMS"] = "DIAGRAMS";
|
|
21
22
|
})(TOOL_CONTENT_TYPE || (exports.TOOL_CONTENT_TYPE = TOOL_CONTENT_TYPE = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramsChartTypeSchemaResponse = exports.DiagramsChartTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../icon-variants.schema");
|
|
6
|
+
exports.DiagramsChartTypeSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
10
|
+
systemPrompt: zod_1.z.string(),
|
|
11
|
+
order: zod_1.z.number(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
|
15
|
+
exports.DiagramsChartTypeSchemaResponse = exports.DiagramsChartTypeSchema.omit({
|
|
16
|
+
systemPrompt: true,
|
|
17
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramsConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const diagrams_model_schema_1 = require("./diagrams-model.schema");
|
|
6
|
+
const diagrams_chart_type_schema_1 = require("./diagrams-chart-type.schema");
|
|
7
|
+
exports.DiagramsConfigSchema = zod_1.z.object({
|
|
8
|
+
models: zod_1.z.array(diagrams_model_schema_1.DiagramsModelSchemaResponse),
|
|
9
|
+
chartTypes: zod_1.z.array(diagrams_chart_type_schema_1.DiagramsChartTypeSchemaResponse),
|
|
10
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramsJobSchemaResponse = exports.DiagramsJobSchema = exports.DiagramsJobOutputSchema = exports.DiagramsJobParamsSchemaResponse = exports.DiagramsJobParamsSchema = exports.DiagramsJobRequestParamsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
exports.DiagramsJobRequestParamsSchema = zod_1.z.object({
|
|
7
|
+
chartTypeUuid: zod_1.z.string().uuid(),
|
|
8
|
+
fileIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
9
|
+
});
|
|
10
|
+
exports.DiagramsJobParamsSchema = zod_1.z.object({
|
|
11
|
+
chartTypeUuid: zod_1.z.string().uuid(),
|
|
12
|
+
data: zod_1.z
|
|
13
|
+
.array(zod_1.z.object({
|
|
14
|
+
fileId: zod_1.z.string().uuid(),
|
|
15
|
+
url: zod_1.z.string(),
|
|
16
|
+
}))
|
|
17
|
+
.optional(),
|
|
18
|
+
});
|
|
19
|
+
exports.DiagramsJobParamsSchemaResponse = zod_1.z.object({
|
|
20
|
+
chartTypeUuid: zod_1.z.string().uuid(),
|
|
21
|
+
data: zod_1.z
|
|
22
|
+
.array(zod_1.z.object({
|
|
23
|
+
fileId: zod_1.z.string().uuid(),
|
|
24
|
+
}))
|
|
25
|
+
.optional(),
|
|
26
|
+
});
|
|
27
|
+
exports.DiagramsJobOutputSchema = zod_1.z.object({
|
|
28
|
+
versions: zod_1.z.array(zod_1.z.object({
|
|
29
|
+
uuid: zod_1.z.string(),
|
|
30
|
+
htmlUrl: zod_1.z.string(),
|
|
31
|
+
createdAt: zod_1.z.string(),
|
|
32
|
+
parentUuid: zod_1.z.string().uuid().optional(),
|
|
33
|
+
})),
|
|
34
|
+
});
|
|
35
|
+
exports.DiagramsJobSchema = zod_1.z.object({
|
|
36
|
+
uuid: zod_1.z.string().uuid(),
|
|
37
|
+
prompt: zod_1.z.string(),
|
|
38
|
+
title: zod_1.z.string(),
|
|
39
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS),
|
|
40
|
+
error: zod_1.z.string().nullable(),
|
|
41
|
+
internalError: zod_1.z.string().nullable().optional(),
|
|
42
|
+
modelId: zod_1.z.string().uuid(),
|
|
43
|
+
price: zod_1.z.number(),
|
|
44
|
+
params: exports.DiagramsJobParamsSchema,
|
|
45
|
+
output: exports.DiagramsJobOutputSchema,
|
|
46
|
+
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
47
|
+
dislikeReason: zod_1.z.string().nullable(),
|
|
48
|
+
attempts: zod_1.z.array(zod_1.z.any()),
|
|
49
|
+
userId: zod_1.z.string().uuid().nullable().optional(),
|
|
50
|
+
unregisteredUserId: zod_1.z.string().uuid().nullable().optional(),
|
|
51
|
+
tokenReservationId: zod_1.z.string().uuid().nullable().optional(),
|
|
52
|
+
isDeleted: zod_1.z.boolean(),
|
|
53
|
+
createdAt: zod_1.z.date(),
|
|
54
|
+
completedAt: zod_1.z.date().nullable().optional(),
|
|
55
|
+
updatedAt: zod_1.z.date(),
|
|
56
|
+
});
|
|
57
|
+
exports.DiagramsJobSchemaResponse = exports.DiagramsJobSchema.omit({
|
|
58
|
+
internalError: true,
|
|
59
|
+
dislikeReason: true,
|
|
60
|
+
tokenReservationId: true,
|
|
61
|
+
isDeleted: true,
|
|
62
|
+
}).extend({
|
|
63
|
+
params: exports.DiagramsJobParamsSchemaResponse,
|
|
64
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DiagramsModelSchemaResponse = exports.DiagramsModelSchema = exports.DiagramsModelConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const icon_variants_schema_1 = require("../../icon-variants.schema");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
7
|
+
exports.DiagramsModelConfigSchema = zod_1.z.object({
|
|
8
|
+
dataAttachment: zod_1.z.object({
|
|
9
|
+
supported: zod_1.z.boolean(),
|
|
10
|
+
maxFileSizeMb: zod_1.z.number(),
|
|
11
|
+
acceptedTypes: zod_1.z.array(zod_1.z.string()),
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
exports.DiagramsModelSchema = zod_1.z.object({
|
|
15
|
+
uuid: zod_1.z.string().uuid(),
|
|
16
|
+
title: zod_1.z.string(),
|
|
17
|
+
description: zod_1.z.string(),
|
|
18
|
+
aiModel: zod_1.z.string(),
|
|
19
|
+
inputPrice: zod_1.z.number(),
|
|
20
|
+
outputPrice: zod_1.z.number(),
|
|
21
|
+
tokenMultiplicator: zod_1.z.number(),
|
|
22
|
+
freeTokenMultiplicator: zod_1.z.number(),
|
|
23
|
+
isPremium: zod_1.z.boolean(),
|
|
24
|
+
isNew: zod_1.z.boolean(),
|
|
25
|
+
order: zod_1.z.number(),
|
|
26
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_MODEL_STATUS),
|
|
27
|
+
icons: icon_variants_schema_1.IconVariantsSchema,
|
|
28
|
+
maxPromptLength: zod_1.z.number(),
|
|
29
|
+
maxPromptTokens: zod_1.z.number(),
|
|
30
|
+
maxContextCharacters: zod_1.z.number(),
|
|
31
|
+
config: exports.DiagramsModelConfigSchema,
|
|
32
|
+
createdAt: zod_1.z.date(),
|
|
33
|
+
updatedAt: zod_1.z.date(),
|
|
34
|
+
});
|
|
35
|
+
exports.DiagramsModelSchemaResponse = exports.DiagramsModelSchema.omit({
|
|
36
|
+
aiModel: true,
|
|
37
|
+
inputPrice: true,
|
|
38
|
+
outputPrice: true,
|
|
39
|
+
maxPromptTokens: true,
|
|
40
|
+
maxContextCharacters: true,
|
|
41
|
+
});
|
|
@@ -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("./diagrams-chart-type.schema"), exports);
|
|
18
|
+
__exportStar(require("./diagrams-config.schema"), exports);
|
|
19
|
+
__exportStar(require("./diagrams-job.schema"), exports);
|
|
20
|
+
__exportStar(require("./diagrams-model.schema"), exports);
|
|
@@ -32,3 +32,4 @@ __exportStar(require("./solving-edu-task"), exports);
|
|
|
32
32
|
__exportStar(require("./spell-corrector"), exports);
|
|
33
33
|
__exportStar(require("./html-page-builder"), exports);
|
|
34
34
|
__exportStar(require("./tool-workspace"), exports);
|
|
35
|
+
__exportStar(require("./diagrams"), exports);
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ORDER_STATUS } from '../../constants';
|
|
3
|
+
|
|
4
|
+
export namespace GetOrderPaymentStatusCommand {
|
|
5
|
+
export const RequestParamSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
status: z.nativeEnum(ORDER_STATUS),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './get-order-payment-status.command';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteDiagramsJobByUUIDCommand {
|
|
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.object({
|
|
10
|
+
data: z.boolean(),
|
|
11
|
+
});
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace DiagramsCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
prompt: z.string().min(1).max(100000),
|
|
7
|
+
modelId: z.string().uuid(),
|
|
8
|
+
params: z.object({
|
|
9
|
+
chartTypeUuid: z.string().uuid(),
|
|
10
|
+
fileIds: z.array(z.string().uuid()).optional().default([]),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: DiagramsJobSchemaResponse,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace EditDiagramsJobCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestSchema = z.object({
|
|
11
|
+
prompt: z.string().min(1).max(100000),
|
|
12
|
+
versionId: z.string().uuid(),
|
|
13
|
+
modelId: z.string().uuid().optional(),
|
|
14
|
+
chartTypeUuid: z.string().uuid().optional(),
|
|
15
|
+
fileIds: z.array(z.string().uuid()).optional().default([]),
|
|
16
|
+
});
|
|
17
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = z.object({
|
|
20
|
+
data: DiagramsJobSchemaResponse,
|
|
21
|
+
});
|
|
22
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchema, DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindDiagramsJobByUUIDCommand {
|
|
5
|
+
export const RequestParamsSchema = DiagramsJobSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: DiagramsJobSchemaResponse,
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindDiagramsJobsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
8
|
+
title: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(DiagramsJobSchemaResponse),
|
|
14
|
+
totalPages: z.number(),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace GetDiagramsPriceCommand {
|
|
4
|
+
export const RequestSchema = z.object({
|
|
5
|
+
modelId: z.string().uuid(),
|
|
6
|
+
prompt: z.string().min(1).max(100000),
|
|
7
|
+
fileIds: z.array(z.string().uuid()).optional().default([]),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.object({
|
|
13
|
+
price: z.number(),
|
|
14
|
+
}),
|
|
15
|
+
});
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsConfigSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetDiagramsToolConfigCommand {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: DiagramsConfigSchema,
|
|
7
|
+
});
|
|
8
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './diagrams.command';
|
|
2
|
+
export * from './edit-diagrams-job.command';
|
|
3
|
+
export * from './update-diagrams-job-title.command';
|
|
4
|
+
export * from './set-reaction-to-diagrams-job.command';
|
|
5
|
+
export * from './retry-diagrams-job.command';
|
|
6
|
+
export * from './get-diagrams-price.command';
|
|
7
|
+
export * from './delete-diagrams-job-by-uuid.command';
|
|
8
|
+
export * from './delete-all-diagrams-jobs.command';
|
|
9
|
+
export * from './find-diagrams-job-by-uuid.command';
|
|
10
|
+
export * from './find-diagrams-jobs.command';
|
|
11
|
+
export * from './get-diagrams-tool-config.command';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobRequestParamsSchema, DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace RetryDiagramsJobCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestSchema = z.object({
|
|
11
|
+
prompt: z.string().optional(),
|
|
12
|
+
modelId: z.string().uuid().optional(),
|
|
13
|
+
params: DiagramsJobRequestParamsSchema.optional(),
|
|
14
|
+
});
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: DiagramsJobSchemaResponse,
|
|
19
|
+
});
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
import { USER_REACTION } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export namespace SetReactionToDiagramsJobCommand {
|
|
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: DiagramsJobSchemaResponse,
|
|
31
|
+
});
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsJobSchemaResponse } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateDiagramsJobTitleCommand {
|
|
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: DiagramsJobSchemaResponse,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
package/commands/tools/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
|
|
4
|
+
export const DiagramsChartTypeSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
icons: IconVariantsSchema,
|
|
8
|
+
systemPrompt: z.string(),
|
|
9
|
+
order: z.number(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type DiagramsChartType = z.infer<typeof DiagramsChartTypeSchema>;
|
|
15
|
+
|
|
16
|
+
export const DiagramsChartTypeSchemaResponse = DiagramsChartTypeSchema.omit({
|
|
17
|
+
systemPrompt: true,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type DiagramsChartTypeResponse = z.infer<typeof DiagramsChartTypeSchemaResponse>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DiagramsModelSchemaResponse } from './diagrams-model.schema';
|
|
3
|
+
import { DiagramsChartTypeSchemaResponse } from './diagrams-chart-type.schema';
|
|
4
|
+
|
|
5
|
+
export const DiagramsConfigSchema = z.object({
|
|
6
|
+
models: z.array(DiagramsModelSchemaResponse),
|
|
7
|
+
chartTypes: z.array(DiagramsChartTypeSchemaResponse),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type DiagramsConfig = z.infer<typeof DiagramsConfigSchema>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_JOB_STATUS, USER_REACTION } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
export const DiagramsJobRequestParamsSchema = z.object({
|
|
5
|
+
chartTypeUuid: z.string().uuid(),
|
|
6
|
+
fileIds: z.array(z.string().uuid()).optional(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type DiagramsJobRequestParams = z.infer<typeof DiagramsJobRequestParamsSchema>;
|
|
10
|
+
|
|
11
|
+
export const DiagramsJobParamsSchema = z.object({
|
|
12
|
+
chartTypeUuid: z.string().uuid(),
|
|
13
|
+
data: z
|
|
14
|
+
.array(
|
|
15
|
+
z.object({
|
|
16
|
+
fileId: z.string().uuid(),
|
|
17
|
+
url: z.string(),
|
|
18
|
+
}),
|
|
19
|
+
)
|
|
20
|
+
.optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type DiagramsJobParams = z.infer<typeof DiagramsJobParamsSchema>;
|
|
24
|
+
|
|
25
|
+
export const DiagramsJobParamsSchemaResponse = z.object({
|
|
26
|
+
chartTypeUuid: z.string().uuid(),
|
|
27
|
+
data: z
|
|
28
|
+
.array(
|
|
29
|
+
z.object({
|
|
30
|
+
fileId: z.string().uuid(),
|
|
31
|
+
}),
|
|
32
|
+
)
|
|
33
|
+
.optional(),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type DiagramsJobParamsResponse = z.infer<typeof DiagramsJobParamsSchemaResponse>;
|
|
37
|
+
|
|
38
|
+
export const DiagramsJobOutputSchema = z.object({
|
|
39
|
+
versions: z.array(
|
|
40
|
+
z.object({
|
|
41
|
+
uuid: z.string(),
|
|
42
|
+
htmlUrl: z.string(),
|
|
43
|
+
createdAt: z.string(),
|
|
44
|
+
parentUuid: z.string().uuid().optional(),
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export type DiagramsJobOutput = z.infer<typeof DiagramsJobOutputSchema>;
|
|
50
|
+
|
|
51
|
+
export const DiagramsJobSchema = z.object({
|
|
52
|
+
uuid: z.string().uuid(),
|
|
53
|
+
prompt: z.string(),
|
|
54
|
+
title: z.string(),
|
|
55
|
+
status: z.nativeEnum(TOOL_JOB_STATUS),
|
|
56
|
+
error: z.string().nullable(),
|
|
57
|
+
internalError: z.string().nullable().optional(),
|
|
58
|
+
modelId: z.string().uuid(),
|
|
59
|
+
price: z.number(),
|
|
60
|
+
params: DiagramsJobParamsSchema,
|
|
61
|
+
output: DiagramsJobOutputSchema,
|
|
62
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
63
|
+
dislikeReason: z.string().nullable(),
|
|
64
|
+
attempts: z.array(z.any()),
|
|
65
|
+
userId: z.string().uuid().nullable().optional(),
|
|
66
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
67
|
+
tokenReservationId: z.string().uuid().nullable().optional(),
|
|
68
|
+
isDeleted: z.boolean(),
|
|
69
|
+
createdAt: z.date(),
|
|
70
|
+
completedAt: z.date().nullable().optional(),
|
|
71
|
+
updatedAt: z.date(),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
export type DiagramsJob = z.infer<typeof DiagramsJobSchema>;
|
|
75
|
+
|
|
76
|
+
export const DiagramsJobSchemaResponse = DiagramsJobSchema.omit({
|
|
77
|
+
internalError: true,
|
|
78
|
+
dislikeReason: true,
|
|
79
|
+
tokenReservationId: true,
|
|
80
|
+
isDeleted: true,
|
|
81
|
+
}).extend({
|
|
82
|
+
params: DiagramsJobParamsSchemaResponse,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export type DiagramsJobResponse = z.infer<typeof DiagramsJobSchemaResponse>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../icon-variants.schema';
|
|
3
|
+
import { TOOL_MODEL_STATUS } from '../../../constants';
|
|
4
|
+
|
|
5
|
+
export const DiagramsModelConfigSchema = z.object({
|
|
6
|
+
dataAttachment: z.object({
|
|
7
|
+
supported: z.boolean(),
|
|
8
|
+
maxFileSizeMb: z.number(),
|
|
9
|
+
acceptedTypes: z.array(z.string()),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type DiagramsModelConfig = z.infer<typeof DiagramsModelConfigSchema>;
|
|
14
|
+
|
|
15
|
+
export const DiagramsModelSchema = z.object({
|
|
16
|
+
uuid: z.string().uuid(),
|
|
17
|
+
title: z.string(),
|
|
18
|
+
description: z.string(),
|
|
19
|
+
aiModel: z.string(),
|
|
20
|
+
inputPrice: z.number(),
|
|
21
|
+
outputPrice: z.number(),
|
|
22
|
+
tokenMultiplicator: z.number(),
|
|
23
|
+
freeTokenMultiplicator: z.number(),
|
|
24
|
+
isPremium: z.boolean(),
|
|
25
|
+
isNew: z.boolean(),
|
|
26
|
+
order: z.number(),
|
|
27
|
+
status: z.nativeEnum(TOOL_MODEL_STATUS),
|
|
28
|
+
icons: IconVariantsSchema,
|
|
29
|
+
maxPromptLength: z.number(),
|
|
30
|
+
maxPromptTokens: z.number(),
|
|
31
|
+
maxContextCharacters: z.number(),
|
|
32
|
+
config: DiagramsModelConfigSchema,
|
|
33
|
+
createdAt: z.date(),
|
|
34
|
+
updatedAt: z.date(),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export type DiagramsModel = z.infer<typeof DiagramsModelSchema>;
|
|
38
|
+
|
|
39
|
+
export const DiagramsModelSchemaResponse = DiagramsModelSchema.omit({
|
|
40
|
+
aiModel: true,
|
|
41
|
+
inputPrice: true,
|
|
42
|
+
outputPrice: true,
|
|
43
|
+
maxPromptTokens: true,
|
|
44
|
+
maxContextCharacters: true,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type DiagramsModelResponse = z.infer<typeof DiagramsModelSchemaResponse>;
|
package/models/tools/index.ts
CHANGED