@purpleschool/gptbot 0.12.17 → 0.12.19
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/ui-notification.ts +9 -2
- package/api/routes.ts +18 -0
- package/build/api/controllers/http/ui-notification.js +9 -2
- package/build/api/routes.js +14 -0
- package/build/commands/tools/marketplace-card/execute-marketplace-card.command.js +9 -14
- package/build/commands/tools/marketplace-card/retry-marketplace-card-job.command.js +7 -13
- package/build/commands/ui-notification/delete-all-ui-notifications.command.js +12 -0
- package/build/commands/ui-notification/delete-many-ui-notifications.command.js +15 -0
- package/build/commands/ui-notification/delete-ui-notification.command.js +15 -0
- package/build/commands/ui-notification/find-ui-notifications.command.js +15 -0
- package/build/commands/ui-notification/index.js +7 -0
- package/build/commands/ui-notification/read-all-ui-notifications.command.js +12 -0
- package/build/commands/ui-notification/read-many-ui-notifications.command.js +15 -0
- package/build/commands/ui-notification/read-ui-notification.command.js +15 -0
- package/build/constants/ui-notification/enums/ui-notification-type.enum.js +1 -0
- package/build/models/tools/marketplace-card/marketplace-card-job.schema.js +12 -7
- package/build/models/ui-notification.schema.js +3 -0
- package/commands/tools/marketplace-card/execute-marketplace-card.command.ts +9 -15
- package/commands/tools/marketplace-card/retry-marketplace-card-job.command.ts +7 -14
- package/commands/ui-notification/delete-all-ui-notifications.command.ts +11 -0
- package/commands/ui-notification/delete-many-ui-notifications.command.ts +17 -0
- package/commands/ui-notification/delete-ui-notification.command.ts +17 -0
- package/commands/ui-notification/find-ui-notifications.command.ts +17 -0
- package/commands/ui-notification/index.ts +7 -0
- package/commands/ui-notification/read-all-ui-notifications.command.ts +10 -0
- package/commands/ui-notification/read-many-ui-notifications.command.ts +16 -0
- package/commands/ui-notification/read-ui-notification.command.ts +16 -0
- package/constants/ui-notification/enums/ui-notification-type.enum.ts +1 -0
- package/models/tools/marketplace-card/marketplace-card-job.schema.ts +13 -8
- package/models/ui-notification.schema.ts +3 -0
- package/package.json +1 -1
|
@@ -2,7 +2,14 @@ export const UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification' as c
|
|
|
2
2
|
export const UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification' as const;
|
|
3
3
|
|
|
4
4
|
export const UI_NOTIFICATION_ROUTES = {
|
|
5
|
+
GET_ALL: 'all',
|
|
6
|
+
READ_ALL: 'all/read',
|
|
7
|
+
DELETE_ALL: 'all/delete',
|
|
5
8
|
GET_BY_PAGE: 'by/page',
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
DELETE: (uuid: string) => `${uuid}`,
|
|
10
|
+
READ: (uuid: string) => `${uuid}/read`,
|
|
11
|
+
COMPLETE: (uuid: string) => `${uuid}/complete`,
|
|
12
|
+
CANCEL: (uuid: string) => `${uuid}/cancel`,
|
|
13
|
+
READ_MANY: 'read-many',
|
|
14
|
+
DELETE_MANY: 'delete-many',
|
|
8
15
|
} as const;
|
package/api/routes.ts
CHANGED
|
@@ -889,14 +889,32 @@ export const REST_API = {
|
|
|
889
889
|
`${ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
|
|
890
890
|
},
|
|
891
891
|
UI_NOTIFICATION_PUBLIC: {
|
|
892
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
892
893
|
GET_BY_PAGE: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
894
|
+
READ: (uuid: string) =>
|
|
895
|
+
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
|
|
896
|
+
READ_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
|
|
897
|
+
READ_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
|
|
898
|
+
DELETE: (uuid: string) =>
|
|
899
|
+
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
|
|
900
|
+
DELETE_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
|
|
901
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
|
|
893
902
|
COMPLETE: (uuid: string) =>
|
|
894
903
|
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
|
|
895
904
|
CANCEL: (uuid: string) =>
|
|
896
905
|
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
|
|
897
906
|
},
|
|
898
907
|
UI_NOTIFICATION_PRIVATE: {
|
|
908
|
+
GET_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
899
909
|
GET_BY_PAGE: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
910
|
+
READ: (uuid: string) =>
|
|
911
|
+
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
|
|
912
|
+
READ_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
|
|
913
|
+
READ_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
|
|
914
|
+
DELETE: (uuid: string) =>
|
|
915
|
+
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
|
|
916
|
+
DELETE_MANY: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
|
|
917
|
+
DELETE_ALL: `${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
|
|
900
918
|
COMPLETE: (uuid: string) =>
|
|
901
919
|
`${ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
|
|
902
920
|
CANCEL: (uuid: string) =>
|
|
@@ -4,7 +4,14 @@ exports.UI_NOTIFICATION_ROUTES = exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = exp
|
|
|
4
4
|
exports.UI_NOTIFICATION_PRIVATE_CONTROLLER = 'private/ui-notification';
|
|
5
5
|
exports.UI_NOTIFICATION_PUBLIC_CONTROLLER = 'public/ui-notification';
|
|
6
6
|
exports.UI_NOTIFICATION_ROUTES = {
|
|
7
|
+
GET_ALL: 'all',
|
|
8
|
+
READ_ALL: 'all/read',
|
|
9
|
+
DELETE_ALL: 'all/delete',
|
|
7
10
|
GET_BY_PAGE: 'by/page',
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
DELETE: (uuid) => `${uuid}`,
|
|
12
|
+
READ: (uuid) => `${uuid}/read`,
|
|
13
|
+
COMPLETE: (uuid) => `${uuid}/complete`,
|
|
14
|
+
CANCEL: (uuid) => `${uuid}/cancel`,
|
|
15
|
+
READ_MANY: 'read-many',
|
|
16
|
+
DELETE_MANY: 'delete-many',
|
|
10
17
|
};
|
package/build/api/routes.js
CHANGED
|
@@ -670,12 +670,26 @@ exports.REST_API = {
|
|
|
670
670
|
RATE: (uuid) => `${exports.ROOT}/${CONTROLLERS.MESSAGE_CONTROLLER_PRIVATE}/${CONTROLLERS.MESSAGE_PRIVATE_ROUTES.RATE(uuid)}`,
|
|
671
671
|
},
|
|
672
672
|
UI_NOTIFICATION_PUBLIC: {
|
|
673
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
673
674
|
GET_BY_PAGE: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
675
|
+
READ: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
|
|
676
|
+
READ_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
|
|
677
|
+
READ_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
|
|
678
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
|
|
679
|
+
DELETE_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
|
|
680
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
|
|
674
681
|
COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
|
|
675
682
|
CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PUBLIC_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
|
|
676
683
|
},
|
|
677
684
|
UI_NOTIFICATION_PRIVATE: {
|
|
685
|
+
GET_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_ALL}`,
|
|
678
686
|
GET_BY_PAGE: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.GET_BY_PAGE}`,
|
|
687
|
+
READ: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ(uuid)}`,
|
|
688
|
+
READ_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_MANY}`,
|
|
689
|
+
READ_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.READ_ALL}`,
|
|
690
|
+
DELETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE(uuid)}`,
|
|
691
|
+
DELETE_MANY: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_MANY}`,
|
|
692
|
+
DELETE_ALL: `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.DELETE_ALL}`,
|
|
679
693
|
COMPLETE: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.COMPLETE(uuid)}`,
|
|
680
694
|
CANCEL: (uuid) => `${exports.ROOT}/${CONTROLLERS.UI_NOTIFICATION_PRIVATE_CONTROLLER}/${CONTROLLERS.UI_NOTIFICATION_ROUTES.CANCEL(uuid)}`,
|
|
681
695
|
},
|
|
@@ -13,38 +13,33 @@ var ExecuteMarketplaceCardCommand;
|
|
|
13
13
|
workspaceToolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE).nullable().optional(),
|
|
14
14
|
workspaceSlot: zod_1.z.nativeEnum(constants_1.TOOL_WORKSPACE_ITEM_SLOT).optional(),
|
|
15
15
|
workspaceOrder: zod_1.z.number().int().min(0).optional(),
|
|
16
|
-
|
|
16
|
+
modelId: zod_1.z.string().uuid(),
|
|
17
|
+
title: zod_1.z.string().optional(),
|
|
17
18
|
subtitle: zod_1.z.string().nullable().optional(),
|
|
18
19
|
advantages: zod_1.z.array(zod_1.z.string()),
|
|
19
20
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
20
21
|
stylePresetId: zod_1.z.string().uuid().nullable().optional(),
|
|
21
|
-
|
|
22
|
+
ownStyleImageId: zod_1.z.string().uuid().nullable().optional(),
|
|
22
23
|
customStylePrompt: zod_1.z.string().nullable().optional(),
|
|
23
24
|
inputImages: zod_1.z.array(zod_1.z.string()),
|
|
24
25
|
backgroundDescription: zod_1.z.string().nullable().optional(),
|
|
25
26
|
})
|
|
26
27
|
.superRefine((data, ctx) => {
|
|
27
28
|
const hasPreset = Boolean(data.stylePresetId);
|
|
29
|
+
const hasOwnStyleImage = Boolean(data.ownStyleImageId);
|
|
28
30
|
const hasCustomPrompt = Boolean(data.customStylePrompt);
|
|
29
|
-
if (!hasPreset && !hasCustomPrompt) {
|
|
31
|
+
if (!hasPreset && !hasOwnStyleImage && !hasCustomPrompt) {
|
|
30
32
|
ctx.addIssue({
|
|
31
33
|
code: zod_1.z.ZodIssueCode.custom,
|
|
32
|
-
message: '
|
|
34
|
+
message: 'one of stylePresetId, ownStyleImageId, customStylePrompt is required',
|
|
33
35
|
path: ['customStylePrompt'],
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
|
-
if (
|
|
38
|
+
if (hasPreset && hasOwnStyleImage) {
|
|
37
39
|
ctx.addIssue({
|
|
38
40
|
code: zod_1.z.ZodIssueCode.custom,
|
|
39
|
-
message: '
|
|
40
|
-
path: [
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
if (!data.isCustom && hasCustomPrompt) {
|
|
44
|
-
ctx.addIssue({
|
|
45
|
-
code: zod_1.z.ZodIssueCode.custom,
|
|
46
|
-
message: 'customStylePrompt must be empty when isCustom is false',
|
|
47
|
-
path: ['customStylePrompt'],
|
|
41
|
+
message: 'only one of stylePresetId and ownStyleImageId can be provided',
|
|
42
|
+
path: [],
|
|
48
43
|
});
|
|
49
44
|
}
|
|
50
45
|
});
|
|
@@ -15,33 +15,27 @@ var RetryMarketplaceCardJobCommand;
|
|
|
15
15
|
advantages: zod_1.z.array(zod_1.z.string()),
|
|
16
16
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
17
17
|
stylePresetId: zod_1.z.string().uuid().nullable().optional(),
|
|
18
|
-
|
|
18
|
+
ownStyleImageId: zod_1.z.string().uuid().nullable().optional(),
|
|
19
19
|
customStylePrompt: zod_1.z.string().nullable().optional(),
|
|
20
20
|
inputImages: zod_1.z.array(zod_1.z.string()),
|
|
21
21
|
backgroundDescription: zod_1.z.string().nullable().optional(),
|
|
22
22
|
})
|
|
23
23
|
.superRefine((data, ctx) => {
|
|
24
24
|
const hasPreset = Boolean(data.stylePresetId);
|
|
25
|
+
const hasOwnStyleImage = Boolean(data.ownStyleImageId);
|
|
25
26
|
const hasCustomPrompt = Boolean(data.customStylePrompt);
|
|
26
|
-
if (!hasPreset && !hasCustomPrompt) {
|
|
27
|
+
if (!hasPreset && !hasOwnStyleImage && !hasCustomPrompt) {
|
|
27
28
|
ctx.addIssue({
|
|
28
29
|
code: zod_1.z.ZodIssueCode.custom,
|
|
29
|
-
message: '
|
|
30
|
+
message: 'one of stylePresetId, ownStyleImageId, customStylePrompt is required',
|
|
30
31
|
path: ['customStylePrompt'],
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
if (
|
|
34
|
+
if (hasPreset && hasOwnStyleImage) {
|
|
34
35
|
ctx.addIssue({
|
|
35
36
|
code: zod_1.z.ZodIssueCode.custom,
|
|
36
|
-
message: '
|
|
37
|
-
path: [
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
if (!data.isCustom && hasCustomPrompt) {
|
|
41
|
-
ctx.addIssue({
|
|
42
|
-
code: zod_1.z.ZodIssueCode.custom,
|
|
43
|
-
message: 'customStylePrompt must be empty when isCustom is false',
|
|
44
|
-
path: ['customStylePrompt'],
|
|
37
|
+
message: 'only one of stylePresetId and ownStyleImageId can be provided',
|
|
38
|
+
path: [],
|
|
45
39
|
});
|
|
46
40
|
}
|
|
47
41
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAllUiNotificationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAllUiNotificationsCommand;
|
|
6
|
+
(function (DeleteAllUiNotificationsCommand) {
|
|
7
|
+
DeleteAllUiNotificationsCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
updatedCount: zod_1.z.number().int().min(0),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
})(DeleteAllUiNotificationsCommand || (exports.DeleteAllUiNotificationsCommand = DeleteAllUiNotificationsCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteManyUiNotificationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteManyUiNotificationsCommand;
|
|
6
|
+
(function (DeleteManyUiNotificationsCommand) {
|
|
7
|
+
DeleteManyUiNotificationsCommand.RequestBodySchema = zod_1.z.object({
|
|
8
|
+
uuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
9
|
+
});
|
|
10
|
+
DeleteManyUiNotificationsCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
updatedCount: zod_1.z.number().int().min(0),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(DeleteManyUiNotificationsCommand || (exports.DeleteManyUiNotificationsCommand = DeleteManyUiNotificationsCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteUiNotificationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteUiNotificationCommand;
|
|
6
|
+
(function (DeleteUiNotificationCommand) {
|
|
7
|
+
DeleteUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
DeleteUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
isDeleted: zod_1.z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(DeleteUiNotificationCommand || (exports.DeleteUiNotificationCommand = DeleteUiNotificationCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindUiNotificationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindUiNotificationsCommand;
|
|
7
|
+
(function (FindUiNotificationsCommand) {
|
|
8
|
+
FindUiNotificationsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
+
limit: zod_1.z.coerce.number().int().min(1).optional(),
|
|
10
|
+
offset: zod_1.z.coerce.number().int().min(0).optional(),
|
|
11
|
+
});
|
|
12
|
+
FindUiNotificationsCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: zod_1.z.array(models_1.uiNotificationSchema),
|
|
14
|
+
});
|
|
15
|
+
})(FindUiNotificationsCommand || (exports.FindUiNotificationsCommand = FindUiNotificationsCommand = {}));
|
|
@@ -15,5 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./find-active-ui-notifications-by-page-and-user.command"), exports);
|
|
18
|
+
__exportStar(require("./find-ui-notifications.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-ui-notification.command"), exports);
|
|
20
|
+
__exportStar(require("./delete-many-ui-notifications.command"), exports);
|
|
21
|
+
__exportStar(require("./delete-all-ui-notifications.command"), exports);
|
|
22
|
+
__exportStar(require("./read-ui-notification.command"), exports);
|
|
23
|
+
__exportStar(require("./read-many-ui-notifications.command"), exports);
|
|
24
|
+
__exportStar(require("./read-all-ui-notifications.command"), exports);
|
|
18
25
|
__exportStar(require("./complete-ui-notification.command"), exports);
|
|
19
26
|
__exportStar(require("./cancel-ui-notification.command"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadAllUiNotificationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var ReadAllUiNotificationsCommand;
|
|
6
|
+
(function (ReadAllUiNotificationsCommand) {
|
|
7
|
+
ReadAllUiNotificationsCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
updatedCount: zod_1.z.number().int().min(0),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
})(ReadAllUiNotificationsCommand || (exports.ReadAllUiNotificationsCommand = ReadAllUiNotificationsCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadManyUiNotificationsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var ReadManyUiNotificationsCommand;
|
|
6
|
+
(function (ReadManyUiNotificationsCommand) {
|
|
7
|
+
ReadManyUiNotificationsCommand.RequestBodySchema = zod_1.z.object({
|
|
8
|
+
uuids: zod_1.z.array(zod_1.z.string().uuid()).min(1),
|
|
9
|
+
});
|
|
10
|
+
ReadManyUiNotificationsCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
updatedCount: zod_1.z.number().int().min(0),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(ReadManyUiNotificationsCommand || (exports.ReadManyUiNotificationsCommand = ReadManyUiNotificationsCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReadUiNotificationCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var ReadUiNotificationCommand;
|
|
6
|
+
(function (ReadUiNotificationCommand) {
|
|
7
|
+
ReadUiNotificationCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
ReadUiNotificationCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
isRead: zod_1.z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(ReadUiNotificationCommand || (exports.ReadUiNotificationCommand = ReadUiNotificationCommand = {}));
|
|
@@ -6,4 +6,5 @@ var UI_NOTIFICATION_TYPE;
|
|
|
6
6
|
UI_NOTIFICATION_TYPE["CONNECT_TELEGRAM_BONUS"] = "CONNECT_TELEGRAM_BONUS";
|
|
7
7
|
UI_NOTIFICATION_TYPE["SUBSCRIPTION_PAST_DUE"] = "SUBSCRIPTION_PAST_DUE";
|
|
8
8
|
UI_NOTIFICATION_TYPE["FRAUD_DETECTED"] = "FRAUD_DETECTED";
|
|
9
|
+
UI_NOTIFICATION_TYPE["PROMOCODE_OFFER"] = "PROMOCODE_OFFER";
|
|
9
10
|
})(UI_NOTIFICATION_TYPE || (exports.UI_NOTIFICATION_TYPE = UI_NOTIFICATION_TYPE = {}));
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketplaceCardJobSchema = void 0;
|
|
3
|
+
exports.MarketplaceCardJobSchema = exports.MarketplaceCardJobAttachmentsSchema = exports.AttachedFileSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../../../constants");
|
|
6
6
|
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
7
|
+
exports.AttachedFileSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string(),
|
|
9
|
+
url: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
exports.MarketplaceCardJobAttachmentsSchema = zod_1.z.object({
|
|
12
|
+
ownStyleImage: exports.AttachedFileSchema.optional().nullable(),
|
|
13
|
+
inputImages: zod_1.z.array(exports.AttachedFileSchema).optional(),
|
|
14
|
+
});
|
|
7
15
|
exports.MarketplaceCardJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
8
16
|
uuid: zod_1.z.string().uuid(),
|
|
9
|
-
title: zod_1.z.string(),
|
|
17
|
+
title: zod_1.z.string().nullable(),
|
|
10
18
|
subtitle: zod_1.z.string().nullable(),
|
|
11
19
|
reaction: zod_1.z.nativeEnum(constants_1.USER_REACTION).nullable(),
|
|
12
20
|
stylePresetId: zod_1.z.string().uuid().nullable(),
|
|
13
21
|
advantages: zod_1.z.array(zod_1.z.string()),
|
|
14
22
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
15
|
-
isCustom: zod_1.z.boolean(),
|
|
16
23
|
customStylePrompt: zod_1.z.string().nullable(),
|
|
17
|
-
inputImages: zod_1.z.array(zod_1.z.object({
|
|
18
|
-
uuid: zod_1.z.string().uuid(),
|
|
19
|
-
url: zod_1.z.string(),
|
|
20
|
-
})),
|
|
21
24
|
resultImages: zod_1.z.array(zod_1.z.string()).nullable(),
|
|
22
25
|
backgroundDescription: zod_1.z.string().nullable(),
|
|
23
26
|
price: zod_1.z.number(),
|
|
27
|
+
attachments: exports.MarketplaceCardJobAttachmentsSchema,
|
|
28
|
+
workspaceId: zod_1.z.string().nullable(),
|
|
24
29
|
});
|
|
@@ -8,6 +8,9 @@ exports.uiNotificationSchema = zod_1.z.object({
|
|
|
8
8
|
type: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_TYPE),
|
|
9
9
|
dynamicUiContent: zod_1.z.record(zod_1.z.unknown()),
|
|
10
10
|
userId: zod_1.z.string().nullable(),
|
|
11
|
+
priority: zod_1.z.number().int(),
|
|
12
|
+
isRead: zod_1.z.boolean(),
|
|
13
|
+
readAt: zod_1.z.date().nullable(),
|
|
11
14
|
status: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_STATUS),
|
|
12
15
|
conditionOfExecution: zod_1.z.nativeEnum(constants_1.UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
13
16
|
endDate: zod_1.z.date().nullable(),
|
|
@@ -10,41 +10,35 @@ export namespace ExecuteMarketplaceCardCommand {
|
|
|
10
10
|
workspaceToolType: z.nativeEnum(TOOL_CONTENT_TYPE).nullable().optional(),
|
|
11
11
|
workspaceSlot: z.nativeEnum(TOOL_WORKSPACE_ITEM_SLOT).optional(),
|
|
12
12
|
workspaceOrder: z.number().int().min(0).optional(),
|
|
13
|
-
|
|
13
|
+
modelId: z.string().uuid(),
|
|
14
|
+
title: z.string().optional(),
|
|
14
15
|
subtitle: z.string().nullable().optional(),
|
|
15
16
|
advantages: z.array(z.string()),
|
|
16
17
|
tags: z.array(z.string()),
|
|
17
18
|
stylePresetId: z.string().uuid().nullable().optional(),
|
|
18
|
-
|
|
19
|
+
ownStyleImageId: z.string().uuid().nullable().optional(),
|
|
19
20
|
customStylePrompt: z.string().nullable().optional(),
|
|
20
21
|
inputImages: z.array(z.string()),
|
|
21
22
|
backgroundDescription: z.string().nullable().optional(),
|
|
22
23
|
})
|
|
23
24
|
.superRefine((data, ctx) => {
|
|
24
25
|
const hasPreset = Boolean(data.stylePresetId);
|
|
26
|
+
const hasOwnStyleImage = Boolean(data.ownStyleImageId);
|
|
25
27
|
const hasCustomPrompt = Boolean(data.customStylePrompt);
|
|
26
28
|
|
|
27
|
-
if (!hasPreset && !hasCustomPrompt) {
|
|
29
|
+
if (!hasPreset && !hasOwnStyleImage && !hasCustomPrompt) {
|
|
28
30
|
ctx.addIssue({
|
|
29
31
|
code: z.ZodIssueCode.custom,
|
|
30
|
-
message: '
|
|
32
|
+
message: 'one of stylePresetId, ownStyleImageId, customStylePrompt is required',
|
|
31
33
|
path: ['customStylePrompt'],
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
if (
|
|
37
|
+
if (hasPreset && hasOwnStyleImage) {
|
|
36
38
|
ctx.addIssue({
|
|
37
39
|
code: z.ZodIssueCode.custom,
|
|
38
|
-
message: '
|
|
39
|
-
path: [
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!data.isCustom && hasCustomPrompt) {
|
|
44
|
-
ctx.addIssue({
|
|
45
|
-
code: z.ZodIssueCode.custom,
|
|
46
|
-
message: 'customStylePrompt must be empty when isCustom is false',
|
|
47
|
-
path: ['customStylePrompt'],
|
|
40
|
+
message: 'only one of stylePresetId and ownStyleImageId can be provided',
|
|
41
|
+
path: [],
|
|
48
42
|
});
|
|
49
43
|
}
|
|
50
44
|
});
|
|
@@ -14,36 +14,29 @@ export namespace RetryMarketplaceCardJobCommand {
|
|
|
14
14
|
advantages: z.array(z.string()),
|
|
15
15
|
tags: z.array(z.string()),
|
|
16
16
|
stylePresetId: z.string().uuid().nullable().optional(),
|
|
17
|
-
|
|
17
|
+
ownStyleImageId: z.string().uuid().nullable().optional(),
|
|
18
18
|
customStylePrompt: z.string().nullable().optional(),
|
|
19
19
|
inputImages: z.array(z.string()),
|
|
20
20
|
backgroundDescription: z.string().nullable().optional(),
|
|
21
21
|
})
|
|
22
22
|
.superRefine((data, ctx) => {
|
|
23
23
|
const hasPreset = Boolean(data.stylePresetId);
|
|
24
|
+
const hasOwnStyleImage = Boolean(data.ownStyleImageId);
|
|
24
25
|
const hasCustomPrompt = Boolean(data.customStylePrompt);
|
|
25
26
|
|
|
26
|
-
if (!hasPreset && !hasCustomPrompt) {
|
|
27
|
+
if (!hasPreset && !hasOwnStyleImage && !hasCustomPrompt) {
|
|
27
28
|
ctx.addIssue({
|
|
28
29
|
code: z.ZodIssueCode.custom,
|
|
29
|
-
message: '
|
|
30
|
+
message: 'one of stylePresetId, ownStyleImageId, customStylePrompt is required',
|
|
30
31
|
path: ['customStylePrompt'],
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
if (
|
|
35
|
+
if (hasPreset && hasOwnStyleImage) {
|
|
35
36
|
ctx.addIssue({
|
|
36
37
|
code: z.ZodIssueCode.custom,
|
|
37
|
-
message: '
|
|
38
|
-
path: [
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!data.isCustom && hasCustomPrompt) {
|
|
43
|
-
ctx.addIssue({
|
|
44
|
-
code: z.ZodIssueCode.custom,
|
|
45
|
-
message: 'customStylePrompt must be empty when isCustom is false',
|
|
46
|
-
path: ['customStylePrompt'],
|
|
38
|
+
message: 'only one of stylePresetId and ownStyleImageId can be provided',
|
|
39
|
+
path: [],
|
|
47
40
|
});
|
|
48
41
|
}
|
|
49
42
|
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteAllUiNotificationsCommand {
|
|
4
|
+
export const ResponseSchema = z.object({
|
|
5
|
+
data: z.object({
|
|
6
|
+
updatedCount: z.number().int().min(0),
|
|
7
|
+
}),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteManyUiNotificationsCommand {
|
|
4
|
+
export const RequestBodySchema = z.object({
|
|
5
|
+
uuids: z.array(z.string().uuid()).min(1),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestBodySchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
updatedCount: z.number().int().min(0),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteUiNotificationCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
isDeleted: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { uiNotificationSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindUiNotificationsCommand {
|
|
5
|
+
export const RequestQuerySchema = z.object({
|
|
6
|
+
limit: z.coerce.number().int().min(1).optional(),
|
|
7
|
+
offset: z.coerce.number().int().min(0).optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.array(uiNotificationSchema),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export * from './find-active-ui-notifications-by-page-and-user.command';
|
|
2
|
+
export * from './find-ui-notifications.command';
|
|
3
|
+
export * from './delete-ui-notification.command';
|
|
4
|
+
export * from './delete-many-ui-notifications.command';
|
|
5
|
+
export * from './delete-all-ui-notifications.command';
|
|
6
|
+
export * from './read-ui-notification.command';
|
|
7
|
+
export * from './read-many-ui-notifications.command';
|
|
8
|
+
export * from './read-all-ui-notifications.command';
|
|
2
9
|
export * from './complete-ui-notification.command';
|
|
3
10
|
export * from './cancel-ui-notification.command';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace ReadManyUiNotificationsCommand {
|
|
4
|
+
export const RequestBodySchema = z.object({
|
|
5
|
+
uuids: z.array(z.string().uuid()).min(1),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestBodySchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
updatedCount: z.number().int().min(0),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace ReadUiNotificationCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export type Request = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({
|
|
12
|
+
isRead: z.boolean(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -2,24 +2,29 @@ import { z } from 'zod';
|
|
|
2
2
|
import { USER_REACTION } from '../../../constants';
|
|
3
3
|
import { ToolJobSchema } from '../../tool-job.schema';
|
|
4
4
|
|
|
5
|
+
export const AttachedFileSchema = z.object({
|
|
6
|
+
uuid: z.string(),
|
|
7
|
+
url: z.string(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const MarketplaceCardJobAttachmentsSchema = z.object({
|
|
11
|
+
ownStyleImage: AttachedFileSchema.optional().nullable(),
|
|
12
|
+
inputImages: z.array(AttachedFileSchema).optional(),
|
|
13
|
+
});
|
|
14
|
+
|
|
5
15
|
export const MarketplaceCardJobSchema = ToolJobSchema.extend({
|
|
6
16
|
uuid: z.string().uuid(),
|
|
7
|
-
title: z.string(),
|
|
17
|
+
title: z.string().nullable(),
|
|
8
18
|
subtitle: z.string().nullable(),
|
|
9
19
|
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
10
20
|
stylePresetId: z.string().uuid().nullable(),
|
|
11
21
|
advantages: z.array(z.string()),
|
|
12
22
|
tags: z.array(z.string()),
|
|
13
|
-
isCustom: z.boolean(),
|
|
14
23
|
customStylePrompt: z.string().nullable(),
|
|
15
|
-
inputImages: z.array(
|
|
16
|
-
z.object({
|
|
17
|
-
uuid: z.string().uuid(),
|
|
18
|
-
url: z.string(),
|
|
19
|
-
}),
|
|
20
|
-
),
|
|
21
24
|
resultImages: z.array(z.string()).nullable(),
|
|
22
25
|
backgroundDescription: z.string().nullable(),
|
|
23
26
|
price: z.number(),
|
|
27
|
+
attachments: MarketplaceCardJobAttachmentsSchema,
|
|
28
|
+
workspaceId: z.string().nullable(),
|
|
24
29
|
});
|
|
25
30
|
export type MarketplaceCardJob = z.infer<typeof MarketplaceCardJobSchema>;
|
|
@@ -9,6 +9,9 @@ export const uiNotificationSchema = z.object({
|
|
|
9
9
|
type: z.nativeEnum(UI_NOTIFICATION_TYPE),
|
|
10
10
|
dynamicUiContent: z.record(z.unknown()),
|
|
11
11
|
userId: z.string().nullable(),
|
|
12
|
+
priority: z.number().int(),
|
|
13
|
+
isRead: z.boolean(),
|
|
14
|
+
readAt: z.date().nullable(),
|
|
12
15
|
status: z.nativeEnum(UI_NOTIFICATION_STATUS),
|
|
13
16
|
conditionOfExecution: z.nativeEnum(UI_NOTIFICATION_CONDITION_OF_EXECUTION),
|
|
14
17
|
endDate: z.date().nullable(),
|