@purpleschool/gptbot-tools 0.2.3-stage → 0.2.4-stage
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/marketplace-card/commands/execute-marketplace-card.command.js +3 -2
- package/build/marketplace-card/commands/retry-marketplace-card-job.command.js +3 -2
- package/build/marketplace-card/models/marketplace-card-job.schema.js +7 -3
- package/build/marketplace-card/models/marketplace-card-style-preset.schema.js +0 -2
- package/build/tool-workspace/commands/index.js +1 -0
- package/build/tool-workspace/commands/soft-delete-all-tool-workspaces-by-tool-type.command.js +22 -0
- package/build/tool-workspace/routes/tool-workspace.amqp.routes.js +1 -0
- package/marketplace-card/commands/execute-marketplace-card.command.ts +3 -2
- package/marketplace-card/commands/retry-marketplace-card-job.command.ts +3 -2
- package/marketplace-card/models/marketplace-card-job.schema.ts +10 -3
- package/marketplace-card/models/marketplace-card-style-preset.schema.ts +0 -2
- package/package.json +1 -1
- package/tool-workspace/commands/index.ts +1 -0
- package/tool-workspace/commands/soft-delete-all-tool-workspaces-by-tool-type.command.ts +26 -0
- package/tool-workspace/routes/tool-workspace.amqp.routes.ts +1 -0
|
@@ -6,6 +6,7 @@ const command_response_schema_1 = require("../../common/models/command-response.
|
|
|
6
6
|
const models_1 = require("../models");
|
|
7
7
|
const tools_1 = require("../../tools");
|
|
8
8
|
const tool_workspace_1 = require("../../tool-workspace");
|
|
9
|
+
const common_1 = require("../../common");
|
|
9
10
|
var ExecuteMarketplaceCardCommand;
|
|
10
11
|
(function (ExecuteMarketplaceCardCommand) {
|
|
11
12
|
ExecuteMarketplaceCardCommand.RequestSchema = zod_1.z.object({
|
|
@@ -23,9 +24,9 @@ var ExecuteMarketplaceCardCommand;
|
|
|
23
24
|
advantages: zod_1.z.array(zod_1.z.string()),
|
|
24
25
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
25
26
|
stylePresetId: zod_1.z.string().uuid().nullable(),
|
|
26
|
-
|
|
27
|
+
ownStyleImage: common_1.AttachedFileSchema.optional().nullable(),
|
|
27
28
|
customStylePrompt: zod_1.z.string().nullable().optional(),
|
|
28
|
-
inputImages: zod_1.z.array(
|
|
29
|
+
inputImages: zod_1.z.array(common_1.AttachedFileSchema).optional(),
|
|
29
30
|
backgroundDescription: zod_1.z.string().nullable().optional(),
|
|
30
31
|
}),
|
|
31
32
|
precalculatedPrice: zod_1.z.number(),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RetryMarketplaceCardJobCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const command_response_schema_1 = require("../../common/models/command-response.schema");
|
|
6
|
+
const common_1 = require("../../common");
|
|
6
7
|
const models_1 = require("../models");
|
|
7
8
|
var RetryMarketplaceCardJobCommand;
|
|
8
9
|
(function (RetryMarketplaceCardJobCommand) {
|
|
@@ -17,9 +18,9 @@ var RetryMarketplaceCardJobCommand;
|
|
|
17
18
|
advantages: zod_1.z.array(zod_1.z.string()).optional(),
|
|
18
19
|
tags: zod_1.z.array(zod_1.z.string()).optional(),
|
|
19
20
|
stylePresetId: zod_1.z.string().uuid().nullable().optional(),
|
|
20
|
-
isCustom: zod_1.z.boolean().optional(),
|
|
21
21
|
customStylePrompt: zod_1.z.string().nullable().optional(),
|
|
22
|
-
|
|
22
|
+
ownStyleImage: common_1.AttachedFileSchema.optional().nullable(),
|
|
23
|
+
inputImages: zod_1.z.array(common_1.AttachedFileSchema).optional(),
|
|
23
24
|
backgroundDescription: zod_1.z.string().nullable().optional(),
|
|
24
25
|
});
|
|
25
26
|
RetryMarketplaceCardJobCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(models_1.MarketplaceCardJobSchema);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MarketplaceCardJobSchema = void 0;
|
|
3
|
+
exports.MarketplaceCardJobSchema = exports.MarketplaceCardJobAttachmentsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const common_1 = require("../../common");
|
|
6
6
|
const tools_1 = require("../../tools");
|
|
7
|
+
exports.MarketplaceCardJobAttachmentsSchema = zod_1.z.object({
|
|
8
|
+
ownStyleImage: common_1.AttachedFileSchema.optional().nullable(),
|
|
9
|
+
inputImages: zod_1.z.array(common_1.AttachedFileSchema).optional(),
|
|
10
|
+
});
|
|
7
11
|
exports.MarketplaceCardJobSchema = zod_1.z.object({
|
|
8
12
|
uuid: zod_1.z.string().uuid(),
|
|
9
13
|
status: zod_1.z.nativeEnum(tools_1.JOB_STATUS),
|
|
@@ -18,12 +22,12 @@ exports.MarketplaceCardJobSchema = zod_1.z.object({
|
|
|
18
22
|
advantages: zod_1.z.array(zod_1.z.string()),
|
|
19
23
|
tags: zod_1.z.array(zod_1.z.string()),
|
|
20
24
|
stylePresetId: zod_1.z.string().uuid().nullable(),
|
|
21
|
-
isCustom: zod_1.z.boolean(),
|
|
22
25
|
customStylePrompt: zod_1.z.string().nullable(),
|
|
23
|
-
inputImages: zod_1.z.array(zod_1.z.string()),
|
|
24
26
|
resultImages: zod_1.z.array(zod_1.z.string()),
|
|
25
27
|
backgroundDescription: zod_1.z.string().nullable(),
|
|
26
28
|
price: zod_1.z.number(),
|
|
29
|
+
workspaceId: zod_1.z.string().uuid().nullable(),
|
|
30
|
+
attachments: exports.MarketplaceCardJobAttachmentsSchema,
|
|
27
31
|
modelId: zod_1.z.string().uuid(),
|
|
28
32
|
userId: zod_1.z.string().nullable().optional(),
|
|
29
33
|
unregisteredUserId: zod_1.z.string().nullable().optional(),
|
|
@@ -5,9 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
exports.MarketplaceCardStylePresetSchema = zod_1.z.object({
|
|
6
6
|
uuid: zod_1.z.string().uuid(),
|
|
7
7
|
title: zod_1.z.string(),
|
|
8
|
-
description: zod_1.z.string(),
|
|
9
8
|
previewImageUrl: zod_1.z.string(),
|
|
10
|
-
systemPrompt: zod_1.z.string(),
|
|
11
9
|
order: zod_1.z.number(),
|
|
12
10
|
isActive: zod_1.z.boolean(),
|
|
13
11
|
});
|
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./update-tool-workspace.command"), exports);
|
|
18
18
|
__exportStar(require("./soft-delete-tool-workspace.command"), exports);
|
|
19
|
+
__exportStar(require("./soft-delete-all-tool-workspaces-by-tool-type.command"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SoftDeleteAllToolWorkspacesByToolTypeCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const command_response_schema_1 = require("../../common/models/command-response.schema");
|
|
6
|
+
const tools_1 = require("../../tools");
|
|
7
|
+
var SoftDeleteAllToolWorkspacesByToolTypeCommand;
|
|
8
|
+
(function (SoftDeleteAllToolWorkspacesByToolTypeCommand) {
|
|
9
|
+
SoftDeleteAllToolWorkspacesByToolTypeCommand.RequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
toolType: zod_1.z.nativeEnum(tools_1.TOOL_CONTENT_TYPE),
|
|
12
|
+
userId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
unregisteredUserId: zod_1.z.string().uuid().optional(),
|
|
14
|
+
})
|
|
15
|
+
.refine((data) => {
|
|
16
|
+
return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
|
|
17
|
+
}, {
|
|
18
|
+
message: 'At least userId or unregisteredUserId must be present',
|
|
19
|
+
path: ['userId', 'unregisteredUserId'],
|
|
20
|
+
});
|
|
21
|
+
SoftDeleteAllToolWorkspacesByToolTypeCommand.ResponseSchema = (0, command_response_schema_1.ICommandResponseSchema)(zod_1.z.object({ success: zod_1.z.boolean() }));
|
|
22
|
+
})(SoftDeleteAllToolWorkspacesByToolTypeCommand || (exports.SoftDeleteAllToolWorkspacesByToolTypeCommand = SoftDeleteAllToolWorkspacesByToolTypeCommand = {}));
|
|
@@ -4,6 +4,7 @@ exports.TOOL_WORKSPACE_AMQP_ROUTES = void 0;
|
|
|
4
4
|
exports.TOOL_WORKSPACE_AMQP_ROUTES = {
|
|
5
5
|
UPDATE: 'tools.workspace.update.rpc',
|
|
6
6
|
SOFT_DELETE: 'tools.workspace.soft-delete.rpc',
|
|
7
|
+
SOFT_DELETE_ALL_BY_TOOL_TYPE: 'tools.workspace.soft-delete-all-by-tool-type.rpc',
|
|
7
8
|
GET: 'tools.workspace.get.rpc',
|
|
8
9
|
LIST: 'tools.workspace.list.rpc',
|
|
9
10
|
};
|
|
@@ -3,6 +3,7 @@ import { ICommandResponseSchema } from '../../common/models/command-response.sch
|
|
|
3
3
|
import { MarketplaceCardJobSchema } from '../models';
|
|
4
4
|
import { TOOL_CONTENT_TYPE } from '../../tools';
|
|
5
5
|
import { TOOL_WORKSPACE_ITEM_SLOT } from '../../tool-workspace';
|
|
6
|
+
import { AttachedFileSchema } from '../../common';
|
|
6
7
|
|
|
7
8
|
export namespace ExecuteMarketplaceCardCommand {
|
|
8
9
|
export const RequestSchema = z.object({
|
|
@@ -20,9 +21,9 @@ export namespace ExecuteMarketplaceCardCommand {
|
|
|
20
21
|
advantages: z.array(z.string()),
|
|
21
22
|
tags: z.array(z.string()),
|
|
22
23
|
stylePresetId: z.string().uuid().nullable(),
|
|
23
|
-
|
|
24
|
+
ownStyleImage: AttachedFileSchema.optional().nullable(),
|
|
24
25
|
customStylePrompt: z.string().nullable().optional(),
|
|
25
|
-
inputImages: z.array(
|
|
26
|
+
inputImages: z.array(AttachedFileSchema).optional(),
|
|
26
27
|
backgroundDescription: z.string().nullable().optional(),
|
|
27
28
|
}),
|
|
28
29
|
precalculatedPrice: z.number(),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { AttachedFileSchema } from '../../common';
|
|
3
4
|
import { MarketplaceCardJobSchema } from '../models';
|
|
4
5
|
|
|
5
6
|
export namespace RetryMarketplaceCardJobCommand {
|
|
@@ -14,9 +15,9 @@ export namespace RetryMarketplaceCardJobCommand {
|
|
|
14
15
|
advantages: z.array(z.string()).optional(),
|
|
15
16
|
tags: z.array(z.string()).optional(),
|
|
16
17
|
stylePresetId: z.string().uuid().nullable().optional(),
|
|
17
|
-
isCustom: z.boolean().optional(),
|
|
18
18
|
customStylePrompt: z.string().nullable().optional(),
|
|
19
|
-
|
|
19
|
+
ownStyleImage: AttachedFileSchema.optional().nullable(),
|
|
20
|
+
inputImages: z.array(AttachedFileSchema).optional(),
|
|
20
21
|
backgroundDescription: z.string().nullable().optional(),
|
|
21
22
|
});
|
|
22
23
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { USER_REACTION } from '../../common';
|
|
2
|
+
import { AttachedFileSchema, USER_REACTION } from '../../common';
|
|
3
3
|
import { JOB_STATUS } from '../../tools';
|
|
4
4
|
|
|
5
|
+
export const MarketplaceCardJobAttachmentsSchema = z.object({
|
|
6
|
+
ownStyleImage: AttachedFileSchema.optional().nullable(),
|
|
7
|
+
inputImages: z.array(AttachedFileSchema).optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type MarketplaceCardJobAttachments = z.infer<typeof MarketplaceCardJobAttachmentsSchema>;
|
|
11
|
+
|
|
5
12
|
export const MarketplaceCardJobSchema = z.object({
|
|
6
13
|
uuid: z.string().uuid(),
|
|
7
14
|
status: z.nativeEnum(JOB_STATUS),
|
|
@@ -16,12 +23,12 @@ export const MarketplaceCardJobSchema = z.object({
|
|
|
16
23
|
advantages: z.array(z.string()),
|
|
17
24
|
tags: z.array(z.string()),
|
|
18
25
|
stylePresetId: z.string().uuid().nullable(),
|
|
19
|
-
isCustom: z.boolean(),
|
|
20
26
|
customStylePrompt: z.string().nullable(),
|
|
21
|
-
inputImages: z.array(z.string()),
|
|
22
27
|
resultImages: z.array(z.string()),
|
|
23
28
|
backgroundDescription: z.string().nullable(),
|
|
24
29
|
price: z.number(),
|
|
30
|
+
workspaceId: z.string().uuid().nullable(),
|
|
31
|
+
attachments: MarketplaceCardJobAttachmentsSchema,
|
|
25
32
|
modelId: z.string().uuid(),
|
|
26
33
|
userId: z.string().nullable().optional(),
|
|
27
34
|
unregisteredUserId: z.string().nullable().optional(),
|
|
@@ -3,9 +3,7 @@ import { z } from 'zod';
|
|
|
3
3
|
export const MarketplaceCardStylePresetSchema = z.object({
|
|
4
4
|
uuid: z.string().uuid(),
|
|
5
5
|
title: z.string(),
|
|
6
|
-
description: z.string(),
|
|
7
6
|
previewImageUrl: z.string(),
|
|
8
|
-
systemPrompt: z.string(),
|
|
9
7
|
order: z.number(),
|
|
10
8
|
isActive: z.boolean(),
|
|
11
9
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TOOL_CONTENT_TYPE } from '../../tools';
|
|
4
|
+
|
|
5
|
+
export namespace SoftDeleteAllToolWorkspacesByToolTypeCommand {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
toolType: z.nativeEnum(TOOL_CONTENT_TYPE),
|
|
9
|
+
userId: z.string().uuid().optional(),
|
|
10
|
+
unregisteredUserId: z.string().uuid().optional(),
|
|
11
|
+
})
|
|
12
|
+
.refine(
|
|
13
|
+
(data) => {
|
|
14
|
+
return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
message: 'At least userId or unregisteredUserId must be present',
|
|
18
|
+
path: ['userId', 'unregisteredUserId'],
|
|
19
|
+
},
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = ICommandResponseSchema(z.object({ success: z.boolean() }));
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export const TOOL_WORKSPACE_AMQP_ROUTES = {
|
|
2
2
|
UPDATE: 'tools.workspace.update.rpc',
|
|
3
3
|
SOFT_DELETE: 'tools.workspace.soft-delete.rpc',
|
|
4
|
+
SOFT_DELETE_ALL_BY_TOOL_TYPE: 'tools.workspace.soft-delete-all-by-tool-type.rpc',
|
|
4
5
|
GET: 'tools.workspace.get.rpc',
|
|
5
6
|
LIST: 'tools.workspace.list.rpc',
|
|
6
7
|
} as const;
|