@purpleschool/gptbot 0.12.18 → 0.12.20
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/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/models/tools/marketplace-card/marketplace-card-config.schema.js +1 -0
- package/build/models/tools/marketplace-card/marketplace-card-job.schema.js +12 -7
- 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/models/tools/marketplace-card/marketplace-card-config.schema.ts +1 -0
- package/models/tools/marketplace-card/marketplace-card-job.schema.ts +13 -8
- package/package.json +1 -1
|
@@ -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
|
});
|
|
@@ -12,6 +12,7 @@ exports.MarketplaceCardStylePresetSchema = zod_1.z.object({
|
|
|
12
12
|
exports.MarketplaceCardModelSchema = zod_1.z.object({
|
|
13
13
|
uuid: zod_1.z.string().uuid(),
|
|
14
14
|
price: zod_1.z.number(),
|
|
15
|
+
title: zod_1.z.string(),
|
|
15
16
|
params: zod_1.z.object({
|
|
16
17
|
imageAttachment: zod_1.z.object({
|
|
17
18
|
supported: zod_1.z.boolean(),
|
|
@@ -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
|
});
|
|
@@ -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
|
});
|
|
@@ -12,6 +12,7 @@ export type MarketplaceCardStylePreset = z.infer<typeof MarketplaceCardStylePres
|
|
|
12
12
|
export const MarketplaceCardModelSchema = z.object({
|
|
13
13
|
uuid: z.string().uuid(),
|
|
14
14
|
price: z.number(),
|
|
15
|
+
title: z.string(),
|
|
15
16
|
params: z.object({
|
|
16
17
|
imageAttachment: z.object({
|
|
17
18
|
supported: z.boolean(),
|
|
@@ -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>;
|