@purpleschool/gptbot-tools 0.4.13 → 0.4.14-stage-2
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/greetings/commands/greeting-settlement.command.d.ts +28 -0
- package/build/greetings/commands/greeting-settlement.command.js +18 -0
- package/build/greetings/commands/index.d.ts +1 -0
- package/build/greetings/commands/index.js +17 -0
- package/build/greetings/enums/greeting-kind.enum.d.ts +6 -0
- package/build/greetings/enums/greeting-kind.enum.js +10 -0
- package/build/greetings/enums/greeting-status.enum.d.ts +6 -0
- package/build/greetings/enums/greeting-status.enum.js +10 -0
- package/build/greetings/enums/index.d.ts +2 -0
- package/build/greetings/enums/index.js +18 -0
- package/build/greetings/index.d.ts +6 -0
- package/build/greetings/index.js +22 -0
- package/build/greetings/models/greeting-config.schema.d.ts +80 -0
- package/build/greetings/models/greeting-config.schema.js +35 -0
- package/build/greetings/models/greeting-input.schema.d.ts +64 -0
- package/build/greetings/models/greeting-input.schema.js +26 -0
- package/build/greetings/models/greeting-job.schema.d.ts +103 -0
- package/build/greetings/models/greeting-job.schema.js +24 -0
- package/build/greetings/models/greeting-owner.schema.d.ts +6 -0
- package/build/greetings/models/greeting-owner.schema.js +12 -0
- package/build/greetings/models/greeting-price-data.schema.d.ts +20 -0
- package/build/greetings/models/greeting-price-data.schema.js +21 -0
- package/build/greetings/models/greeting-result.schema.d.ts +35 -0
- package/build/greetings/models/greeting-result.schema.js +19 -0
- package/build/greetings/models/index.d.ts +6 -0
- package/build/greetings/models/index.js +22 -0
- package/build/greetings/requests/greeting-execute.schema.d.ts +67 -0
- package/build/greetings/requests/greeting-execute.schema.js +11 -0
- package/build/greetings/requests/greeting-favorite-request.schema.d.ts +9 -0
- package/build/greetings/requests/greeting-favorite-request.schema.js +8 -0
- package/build/greetings/requests/greeting-identity-request.schema.d.ts +13 -0
- package/build/greetings/requests/greeting-identity-request.schema.js +10 -0
- package/build/greetings/requests/greeting-internal-execute.schema.d.ts +151 -0
- package/build/greetings/requests/greeting-internal-execute.schema.js +9 -0
- package/build/greetings/requests/greeting-internal-price-request.schema.d.ts +69 -0
- package/build/greetings/requests/greeting-internal-price-request.schema.js +10 -0
- package/build/greetings/requests/greeting-job-request.schema.d.ts +8 -0
- package/build/greetings/requests/greeting-job-request.schema.js +9 -0
- package/build/greetings/requests/greeting-list-request.schema.d.ts +16 -0
- package/build/greetings/requests/greeting-list-request.schema.js +13 -0
- package/build/greetings/requests/greeting-operation-request.schema.d.ts +8 -0
- package/build/greetings/requests/greeting-operation-request.schema.js +9 -0
- package/build/greetings/requests/greeting-price-request.schema.d.ts +64 -0
- package/build/greetings/requests/greeting-price-request.schema.js +6 -0
- package/build/greetings/requests/greeting-reaction-request.schema.d.ts +10 -0
- package/build/greetings/requests/greeting-reaction-request.schema.js +9 -0
- package/build/greetings/requests/greeting-retry.schema.d.ts +7 -0
- package/build/greetings/requests/greeting-retry.schema.js +10 -0
- package/build/greetings/requests/greeting-title-request.schema.d.ts +9 -0
- package/build/greetings/requests/greeting-title-request.schema.js +8 -0
- package/build/greetings/requests/index.d.ts +12 -0
- package/build/greetings/requests/index.js +28 -0
- package/build/greetings/responses/greeting.responses.d.ts +627 -0
- package/build/greetings/responses/greeting.responses.js +15 -0
- package/build/greetings/responses/index.d.ts +1 -0
- package/build/greetings/responses/index.js +17 -0
- package/build/greetings/routes/greetings.amqp.routes.d.ts +14 -0
- package/build/greetings/routes/greetings.amqp.routes.js +17 -0
- package/build/greetings/routes/index.d.ts +1 -0
- package/build/greetings/routes/index.js +17 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +3 -0
- package/build/tools/enums/tool-content-type.enum.d.ts +1 -0
- package/build/tools/enums/tool-content-type.enum.js +1 -0
- package/build/tools/enums/tool-type.enum.d.ts +1 -0
- package/build/tools/enums/tool-type.enum.js +1 -0
- package/build/tools/models/global-tools-config.schema.d.ts +49 -0
- package/build/tools/models/global-tools-config.schema.js +2 -0
- package/build/tools/models/tools-with-configs.schema.d.ts +122 -0
- package/build/tools/models/tools-with-configs.schema.js +5 -0
- package/build/tools/queries/get-global-tools-config.query.d.ts +88 -0
- package/build/tools/queries/get-tools-with-configs.query.d.ts +112 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GreetingSettlementSchema: z.ZodObject<{
|
|
3
|
+
owner: z.ZodObject<{
|
|
4
|
+
userId: z.ZodOptional<z.ZodUUID>;
|
|
5
|
+
unregisteredUserId: z.ZodOptional<z.ZodUUID>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
jobId: z.ZodUUID;
|
|
8
|
+
attemptId: z.ZodUUID;
|
|
9
|
+
tokenReservationId: z.ZodUUID;
|
|
10
|
+
price: z.ZodInt;
|
|
11
|
+
outcome: z.ZodEnum<{
|
|
12
|
+
COMPLETED: "COMPLETED";
|
|
13
|
+
FAILED: "FAILED";
|
|
14
|
+
}>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export type GreetingSettlement = z.infer<typeof GreetingSettlementSchema>;
|
|
17
|
+
export declare const GreetingSettlementResponseSchema: z.ZodObject<{
|
|
18
|
+
isSuccess: z.ZodBoolean;
|
|
19
|
+
data: z.ZodOptional<z.ZodType<{
|
|
20
|
+
settled: true;
|
|
21
|
+
reservationStatus: string;
|
|
22
|
+
}, unknown, z.core.$ZodTypeInternals<{
|
|
23
|
+
settled: true;
|
|
24
|
+
reservationStatus: string;
|
|
25
|
+
}, unknown>>>;
|
|
26
|
+
code: z.ZodOptional<z.ZodString>;
|
|
27
|
+
message: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingSettlementResponseSchema = exports.GreetingSettlementSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const common_1 = require("../../common");
|
|
6
|
+
const models_1 = require("../models");
|
|
7
|
+
exports.GreetingSettlementSchema = zod_1.z.strictObject({
|
|
8
|
+
owner: models_1.GreetingOwnerSchema,
|
|
9
|
+
jobId: zod_1.z.uuid(),
|
|
10
|
+
attemptId: zod_1.z.uuid(),
|
|
11
|
+
tokenReservationId: zod_1.z.uuid(),
|
|
12
|
+
price: zod_1.z.int().positive(),
|
|
13
|
+
outcome: zod_1.z.enum(['COMPLETED', 'FAILED']),
|
|
14
|
+
});
|
|
15
|
+
exports.GreetingSettlementResponseSchema = (0, common_1.ICommandResponseSchema)(zod_1.z.object({
|
|
16
|
+
settled: zod_1.z.literal(true),
|
|
17
|
+
reservationStatus: zod_1.z.string(),
|
|
18
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './greeting-settlement.command';
|
|
@@ -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("./greeting-settlement.command"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GREETING_KIND = void 0;
|
|
4
|
+
var GREETING_KIND;
|
|
5
|
+
(function (GREETING_KIND) {
|
|
6
|
+
GREETING_KIND["TEXT"] = "TEXT";
|
|
7
|
+
GREETING_KIND["SONG"] = "SONG";
|
|
8
|
+
GREETING_KIND["VIDEO"] = "VIDEO";
|
|
9
|
+
GREETING_KIND["IMAGE"] = "IMAGE";
|
|
10
|
+
})(GREETING_KIND || (exports.GREETING_KIND = GREETING_KIND = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GREETING_STATUS = void 0;
|
|
4
|
+
var GREETING_STATUS;
|
|
5
|
+
(function (GREETING_STATUS) {
|
|
6
|
+
GREETING_STATUS["PENDING"] = "PENDING";
|
|
7
|
+
GREETING_STATUS["PROCESSING"] = "PROCESSING";
|
|
8
|
+
GREETING_STATUS["COMPLETED"] = "COMPLETED";
|
|
9
|
+
GREETING_STATUS["FAILED"] = "FAILED";
|
|
10
|
+
})(GREETING_STATUS || (exports.GREETING_STATUS = GREETING_STATUS = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./greeting-kind.enum"), exports);
|
|
18
|
+
__exportStar(require("./greeting-status.enum"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./enums"), exports);
|
|
18
|
+
__exportStar(require("./routes"), exports);
|
|
19
|
+
__exportStar(require("./models"), exports);
|
|
20
|
+
__exportStar(require("./requests"), exports);
|
|
21
|
+
__exportStar(require("./commands"), exports);
|
|
22
|
+
__exportStar(require("./responses"), exports);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GREETING_KIND } from '../enums';
|
|
3
|
+
export declare const GreetingOptionSchema: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodUUID;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
order: z.ZodInt;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const GreetingModelSchema: z.ZodObject<{
|
|
9
|
+
uuid: z.ZodUUID;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
description: z.ZodOptional<z.ZodString>;
|
|
12
|
+
kind: z.ZodEnum<typeof GREETING_KIND>;
|
|
13
|
+
order: z.ZodInt;
|
|
14
|
+
sourceModelId: z.ZodUUID;
|
|
15
|
+
sourceModelType: z.ZodEnum<{
|
|
16
|
+
IMAGE: "IMAGE";
|
|
17
|
+
SONG: "SONG";
|
|
18
|
+
TEXT: "TEXT";
|
|
19
|
+
VIDEO: "VIDEO";
|
|
20
|
+
}>;
|
|
21
|
+
durations: z.ZodArray<z.ZodInt>;
|
|
22
|
+
aspectRatios: z.ZodArray<z.ZodString>;
|
|
23
|
+
defaultDuration: z.ZodNullable<z.ZodInt>;
|
|
24
|
+
defaultAspectRatio: z.ZodNullable<z.ZodString>;
|
|
25
|
+
supportsReference: z.ZodBoolean;
|
|
26
|
+
maxAttachedImages: z.ZodInt;
|
|
27
|
+
maxPromptLength: z.ZodInt;
|
|
28
|
+
maxProviderPromptLength: z.ZodOptional<z.ZodInt>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type GreetingModel = z.infer<typeof GreetingModelSchema>;
|
|
31
|
+
export declare const GreetingConfigSchema: z.ZodObject<{
|
|
32
|
+
models: z.ZodArray<z.ZodObject<{
|
|
33
|
+
uuid: z.ZodUUID;
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
description: z.ZodOptional<z.ZodString>;
|
|
36
|
+
kind: z.ZodEnum<typeof GREETING_KIND>;
|
|
37
|
+
order: z.ZodInt;
|
|
38
|
+
sourceModelId: z.ZodUUID;
|
|
39
|
+
sourceModelType: z.ZodEnum<{
|
|
40
|
+
IMAGE: "IMAGE";
|
|
41
|
+
SONG: "SONG";
|
|
42
|
+
TEXT: "TEXT";
|
|
43
|
+
VIDEO: "VIDEO";
|
|
44
|
+
}>;
|
|
45
|
+
durations: z.ZodArray<z.ZodInt>;
|
|
46
|
+
aspectRatios: z.ZodArray<z.ZodString>;
|
|
47
|
+
defaultDuration: z.ZodNullable<z.ZodInt>;
|
|
48
|
+
defaultAspectRatio: z.ZodNullable<z.ZodString>;
|
|
49
|
+
supportsReference: z.ZodBoolean;
|
|
50
|
+
maxAttachedImages: z.ZodInt;
|
|
51
|
+
maxPromptLength: z.ZodInt;
|
|
52
|
+
maxProviderPromptLength: z.ZodOptional<z.ZodInt>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
textLengths: z.ZodArray<z.ZodObject<{
|
|
55
|
+
uuid: z.ZodUUID;
|
|
56
|
+
title: z.ZodString;
|
|
57
|
+
order: z.ZodInt;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
textFormats: z.ZodArray<z.ZodObject<{
|
|
60
|
+
uuid: z.ZodUUID;
|
|
61
|
+
title: z.ZodString;
|
|
62
|
+
order: z.ZodInt;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
musicStyles: z.ZodArray<z.ZodObject<{
|
|
65
|
+
uuid: z.ZodUUID;
|
|
66
|
+
title: z.ZodString;
|
|
67
|
+
order: z.ZodInt;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
videoStyles: z.ZodArray<z.ZodObject<{
|
|
70
|
+
uuid: z.ZodUUID;
|
|
71
|
+
title: z.ZodString;
|
|
72
|
+
order: z.ZodInt;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
imageStyles: z.ZodArray<z.ZodObject<{
|
|
75
|
+
uuid: z.ZodUUID;
|
|
76
|
+
title: z.ZodString;
|
|
77
|
+
order: z.ZodInt;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type GreetingConfig = z.infer<typeof GreetingConfigSchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingConfigSchema = exports.GreetingModelSchema = exports.GreetingOptionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
exports.GreetingOptionSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.uuid(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
order: zod_1.z.int(),
|
|
10
|
+
});
|
|
11
|
+
exports.GreetingModelSchema = zod_1.z.object({
|
|
12
|
+
uuid: zod_1.z.uuid(),
|
|
13
|
+
title: zod_1.z.string(),
|
|
14
|
+
description: zod_1.z.string().optional(),
|
|
15
|
+
kind: zod_1.z.nativeEnum(enums_1.GREETING_KIND),
|
|
16
|
+
order: zod_1.z.int(),
|
|
17
|
+
sourceModelId: zod_1.z.uuid(),
|
|
18
|
+
sourceModelType: zod_1.z.enum(['TEXT', 'SONG', 'VIDEO', 'IMAGE']),
|
|
19
|
+
durations: zod_1.z.array(zod_1.z.int()),
|
|
20
|
+
aspectRatios: zod_1.z.array(zod_1.z.string()),
|
|
21
|
+
defaultDuration: zod_1.z.int().nullable(),
|
|
22
|
+
defaultAspectRatio: zod_1.z.string().nullable(),
|
|
23
|
+
supportsReference: zod_1.z.boolean(),
|
|
24
|
+
maxAttachedImages: zod_1.z.int().nonnegative(),
|
|
25
|
+
maxPromptLength: zod_1.z.int(),
|
|
26
|
+
maxProviderPromptLength: zod_1.z.int().positive().optional(),
|
|
27
|
+
});
|
|
28
|
+
exports.GreetingConfigSchema = zod_1.z.object({
|
|
29
|
+
models: zod_1.z.array(exports.GreetingModelSchema),
|
|
30
|
+
textLengths: zod_1.z.array(exports.GreetingOptionSchema),
|
|
31
|
+
textFormats: zod_1.z.array(exports.GreetingOptionSchema),
|
|
32
|
+
musicStyles: zod_1.z.array(exports.GreetingOptionSchema),
|
|
33
|
+
videoStyles: zod_1.z.array(exports.GreetingOptionSchema),
|
|
34
|
+
imageStyles: zod_1.z.array(exports.GreetingOptionSchema),
|
|
35
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GREETING_KIND } from '../enums';
|
|
3
|
+
export declare const GreetingInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
modelId: z.ZodUUID;
|
|
5
|
+
prompt: z.ZodString;
|
|
6
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
en: "en";
|
|
8
|
+
es: "es";
|
|
9
|
+
ru: "ru";
|
|
10
|
+
}>>;
|
|
11
|
+
kind: z.ZodLiteral<GREETING_KIND.TEXT>;
|
|
12
|
+
settings: z.ZodObject<{
|
|
13
|
+
lengthId: z.ZodUUID;
|
|
14
|
+
formatId: z.ZodUUID;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
17
|
+
modelId: z.ZodUUID;
|
|
18
|
+
prompt: z.ZodString;
|
|
19
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
20
|
+
en: "en";
|
|
21
|
+
es: "es";
|
|
22
|
+
ru: "ru";
|
|
23
|
+
}>>;
|
|
24
|
+
kind: z.ZodLiteral<GREETING_KIND.SONG>;
|
|
25
|
+
settings: z.ZodObject<{
|
|
26
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
27
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
28
|
+
voice: z.ZodDefault<z.ZodEnum<{
|
|
29
|
+
f: "f";
|
|
30
|
+
m: "m";
|
|
31
|
+
}>>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
modelId: z.ZodUUID;
|
|
35
|
+
prompt: z.ZodString;
|
|
36
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
37
|
+
en: "en";
|
|
38
|
+
es: "es";
|
|
39
|
+
ru: "ru";
|
|
40
|
+
}>>;
|
|
41
|
+
kind: z.ZodLiteral<GREETING_KIND.VIDEO>;
|
|
42
|
+
settings: z.ZodObject<{
|
|
43
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
44
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
45
|
+
imageUrls: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
46
|
+
duration: z.ZodInt;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
49
|
+
modelId: z.ZodUUID;
|
|
50
|
+
prompt: z.ZodString;
|
|
51
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
52
|
+
en: "en";
|
|
53
|
+
es: "es";
|
|
54
|
+
ru: "ru";
|
|
55
|
+
}>>;
|
|
56
|
+
kind: z.ZodLiteral<GREETING_KIND.IMAGE>;
|
|
57
|
+
settings: z.ZodObject<{
|
|
58
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
59
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
60
|
+
imageUrls: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
61
|
+
aspectRatio: z.ZodString;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
}, z.core.$strict>], "kind">;
|
|
64
|
+
export type GreetingInput = z.infer<typeof GreetingInputSchema>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingInputSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
const styleFields = {
|
|
7
|
+
styleId: zod_1.z.uuid().optional(),
|
|
8
|
+
customStyle: zod_1.z.string().trim().max(200).optional(),
|
|
9
|
+
};
|
|
10
|
+
const referenceFields = {
|
|
11
|
+
imageUrls: zod_1.z
|
|
12
|
+
.array(zod_1.z.url())
|
|
13
|
+
.refine((urls) => new Set(urls).size === urls.length)
|
|
14
|
+
.optional(),
|
|
15
|
+
};
|
|
16
|
+
const baseFields = {
|
|
17
|
+
modelId: zod_1.z.uuid(),
|
|
18
|
+
prompt: zod_1.z.string().trim().min(1).max(10000),
|
|
19
|
+
locale: zod_1.z.enum(['ru', 'en', 'es']).default('ru'),
|
|
20
|
+
};
|
|
21
|
+
exports.GreetingInputSchema = zod_1.z.discriminatedUnion('kind', [
|
|
22
|
+
zod_1.z.strictObject(Object.assign(Object.assign({}, baseFields), { kind: zod_1.z.literal(enums_1.GREETING_KIND.TEXT), settings: zod_1.z.strictObject({ lengthId: zod_1.z.uuid(), formatId: zod_1.z.uuid() }) })),
|
|
23
|
+
zod_1.z.strictObject(Object.assign(Object.assign({}, baseFields), { kind: zod_1.z.literal(enums_1.GREETING_KIND.SONG), settings: zod_1.z.strictObject(Object.assign(Object.assign({}, styleFields), { voice: zod_1.z.enum(['m', 'f']).default('f') })) })),
|
|
24
|
+
zod_1.z.strictObject(Object.assign(Object.assign({}, baseFields), { kind: zod_1.z.literal(enums_1.GREETING_KIND.VIDEO), settings: zod_1.z.strictObject(Object.assign(Object.assign(Object.assign({}, styleFields), referenceFields), { duration: zod_1.z.int().positive() })) })),
|
|
25
|
+
zod_1.z.strictObject(Object.assign(Object.assign({}, baseFields), { kind: zod_1.z.literal(enums_1.GREETING_KIND.IMAGE), settings: zod_1.z.strictObject(Object.assign(Object.assign(Object.assign({}, styleFields), referenceFields), { aspectRatio: zod_1.z.string().min(1) })) })),
|
|
26
|
+
]);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GREETING_KIND, GREETING_STATUS } from '../enums';
|
|
3
|
+
import { USER_REACTION } from '../../common';
|
|
4
|
+
export declare const GreetingJobSchema: z.ZodObject<{
|
|
5
|
+
uuid: z.ZodUUID;
|
|
6
|
+
isFavorite: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
reaction: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof USER_REACTION>>>;
|
|
9
|
+
kind: z.ZodEnum<typeof GREETING_KIND>;
|
|
10
|
+
modelId: z.ZodUUID;
|
|
11
|
+
input: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
modelId: z.ZodUUID;
|
|
13
|
+
prompt: z.ZodString;
|
|
14
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
15
|
+
en: "en";
|
|
16
|
+
es: "es";
|
|
17
|
+
ru: "ru";
|
|
18
|
+
}>>;
|
|
19
|
+
kind: z.ZodLiteral<GREETING_KIND.TEXT>;
|
|
20
|
+
settings: z.ZodObject<{
|
|
21
|
+
lengthId: z.ZodUUID;
|
|
22
|
+
formatId: z.ZodUUID;
|
|
23
|
+
}, z.core.$strict>;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
modelId: z.ZodUUID;
|
|
26
|
+
prompt: z.ZodString;
|
|
27
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
28
|
+
en: "en";
|
|
29
|
+
es: "es";
|
|
30
|
+
ru: "ru";
|
|
31
|
+
}>>;
|
|
32
|
+
kind: z.ZodLiteral<GREETING_KIND.SONG>;
|
|
33
|
+
settings: z.ZodObject<{
|
|
34
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
35
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
36
|
+
voice: z.ZodDefault<z.ZodEnum<{
|
|
37
|
+
f: "f";
|
|
38
|
+
m: "m";
|
|
39
|
+
}>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
+
modelId: z.ZodUUID;
|
|
43
|
+
prompt: z.ZodString;
|
|
44
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
45
|
+
en: "en";
|
|
46
|
+
es: "es";
|
|
47
|
+
ru: "ru";
|
|
48
|
+
}>>;
|
|
49
|
+
kind: z.ZodLiteral<GREETING_KIND.VIDEO>;
|
|
50
|
+
settings: z.ZodObject<{
|
|
51
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
52
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
53
|
+
imageUrls: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
54
|
+
duration: z.ZodInt;
|
|
55
|
+
}, z.core.$strict>;
|
|
56
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
|
+
modelId: z.ZodUUID;
|
|
58
|
+
prompt: z.ZodString;
|
|
59
|
+
locale: z.ZodDefault<z.ZodEnum<{
|
|
60
|
+
en: "en";
|
|
61
|
+
es: "es";
|
|
62
|
+
ru: "ru";
|
|
63
|
+
}>>;
|
|
64
|
+
kind: z.ZodLiteral<GREETING_KIND.IMAGE>;
|
|
65
|
+
settings: z.ZodObject<{
|
|
66
|
+
styleId: z.ZodOptional<z.ZodUUID>;
|
|
67
|
+
customStyle: z.ZodOptional<z.ZodString>;
|
|
68
|
+
imageUrls: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
69
|
+
aspectRatio: z.ZodString;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
}, z.core.$strict>], "kind">;
|
|
72
|
+
status: z.ZodEnum<typeof GREETING_STATUS>;
|
|
73
|
+
currentAttemptId: z.ZodUUID;
|
|
74
|
+
price: z.ZodInt;
|
|
75
|
+
result: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
kind: z.ZodLiteral<GREETING_KIND.TEXT>;
|
|
77
|
+
text: z.ZodString;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<GREETING_KIND.SONG>;
|
|
80
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
audioUrl: z.ZodURL;
|
|
84
|
+
imageUrl: z.ZodOptional<z.ZodURL>;
|
|
85
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
lyrics: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
89
|
+
kind: z.ZodLiteral<GREETING_KIND.VIDEO>;
|
|
90
|
+
video: z.ZodObject<{
|
|
91
|
+
url: z.ZodURL;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
94
|
+
kind: z.ZodLiteral<GREETING_KIND.IMAGE>;
|
|
95
|
+
image: z.ZodObject<{
|
|
96
|
+
url: z.ZodURL;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
}, z.core.$strip>], "kind">>;
|
|
99
|
+
error: z.ZodNullable<z.ZodString>;
|
|
100
|
+
createdAt: z.ZodString;
|
|
101
|
+
updatedAt: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
export type GreetingJob = z.infer<typeof GreetingJobSchema>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingJobSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
const greeting_input_schema_1 = require("./greeting-input.schema");
|
|
8
|
+
const greeting_result_schema_1 = require("./greeting-result.schema");
|
|
9
|
+
exports.GreetingJobSchema = zod_1.z.object({
|
|
10
|
+
uuid: zod_1.z.uuid(),
|
|
11
|
+
isFavorite: zod_1.z.boolean().default(false),
|
|
12
|
+
title: zod_1.z.string().nullable().optional(),
|
|
13
|
+
reaction: zod_1.z.nativeEnum(common_1.USER_REACTION).nullable().optional(),
|
|
14
|
+
kind: zod_1.z.nativeEnum(enums_1.GREETING_KIND),
|
|
15
|
+
modelId: zod_1.z.uuid(),
|
|
16
|
+
input: greeting_input_schema_1.GreetingInputSchema,
|
|
17
|
+
status: zod_1.z.nativeEnum(enums_1.GREETING_STATUS),
|
|
18
|
+
currentAttemptId: zod_1.z.uuid(),
|
|
19
|
+
price: zod_1.z.int().nonnegative(),
|
|
20
|
+
result: greeting_result_schema_1.GreetingResultSchema.nullable(),
|
|
21
|
+
error: zod_1.z.string().nullable(),
|
|
22
|
+
createdAt: zod_1.z.string(),
|
|
23
|
+
updatedAt: zod_1.z.string(),
|
|
24
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingOwnerSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.GreetingOwnerSchema = zod_1.z
|
|
6
|
+
.strictObject({
|
|
7
|
+
userId: zod_1.z.uuid().optional(),
|
|
8
|
+
unregisteredUserId: zod_1.z.uuid().optional(),
|
|
9
|
+
})
|
|
10
|
+
.refine((owner) => Boolean(owner.userId) !== Boolean(owner.unregisteredUserId), {
|
|
11
|
+
message: 'Exactly one owner is required',
|
|
12
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GREETING_KIND } from '../enums';
|
|
3
|
+
export declare const GreetingPriceDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
4
|
+
kind: z.ZodLiteral<GREETING_KIND.TEXT>;
|
|
5
|
+
modelPricing: z.ZodObject<{
|
|
6
|
+
inputPrice: z.ZodNumber;
|
|
7
|
+
outputPrice: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
effectivePromptLength: z.ZodInt;
|
|
10
|
+
calculationSnapshot: z.ZodString;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
kind: z.ZodEnum<{
|
|
13
|
+
IMAGE: GREETING_KIND.IMAGE;
|
|
14
|
+
SONG: GREETING_KIND.SONG;
|
|
15
|
+
VIDEO: GREETING_KIND.VIDEO;
|
|
16
|
+
}>;
|
|
17
|
+
price: z.ZodInt;
|
|
18
|
+
calculationSnapshot: z.ZodString;
|
|
19
|
+
}, z.core.$strip>], "kind">;
|
|
20
|
+
export type GreetingPriceData = z.infer<typeof GreetingPriceDataSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingPriceDataSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
exports.GreetingPriceDataSchema = zod_1.z.discriminatedUnion('kind', [
|
|
7
|
+
zod_1.z.object({
|
|
8
|
+
kind: zod_1.z.literal(enums_1.GREETING_KIND.TEXT),
|
|
9
|
+
modelPricing: zod_1.z.object({
|
|
10
|
+
inputPrice: zod_1.z.number().nonnegative(),
|
|
11
|
+
outputPrice: zod_1.z.number().nonnegative(),
|
|
12
|
+
}),
|
|
13
|
+
effectivePromptLength: zod_1.z.int().positive(),
|
|
14
|
+
calculationSnapshot: zod_1.z.string(),
|
|
15
|
+
}),
|
|
16
|
+
zod_1.z.object({
|
|
17
|
+
kind: zod_1.z.enum([enums_1.GREETING_KIND.SONG, enums_1.GREETING_KIND.VIDEO, enums_1.GREETING_KIND.IMAGE]),
|
|
18
|
+
price: zod_1.z.int().positive(),
|
|
19
|
+
calculationSnapshot: zod_1.z.string(),
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GREETING_KIND } from '../enums';
|
|
3
|
+
export declare const GreetingTrackSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
audioUrl: z.ZodURL;
|
|
7
|
+
imageUrl: z.ZodOptional<z.ZodURL>;
|
|
8
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
lyrics: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const GreetingResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
kind: z.ZodLiteral<GREETING_KIND.TEXT>;
|
|
13
|
+
text: z.ZodString;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
kind: z.ZodLiteral<GREETING_KIND.SONG>;
|
|
16
|
+
tracks: z.ZodArray<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
audioUrl: z.ZodURL;
|
|
20
|
+
imageUrl: z.ZodOptional<z.ZodURL>;
|
|
21
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
lyrics: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<GREETING_KIND.VIDEO>;
|
|
26
|
+
video: z.ZodObject<{
|
|
27
|
+
url: z.ZodURL;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
+
kind: z.ZodLiteral<GREETING_KIND.IMAGE>;
|
|
31
|
+
image: z.ZodObject<{
|
|
32
|
+
url: z.ZodURL;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
}, z.core.$strip>], "kind">;
|
|
35
|
+
export type GreetingResult = z.infer<typeof GreetingResultSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GreetingResultSchema = exports.GreetingTrackSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const enums_1 = require("../enums");
|
|
6
|
+
exports.GreetingTrackSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
audioUrl: zod_1.z.url(),
|
|
10
|
+
imageUrl: zod_1.z.url().optional(),
|
|
11
|
+
duration: zod_1.z.number().nonnegative().optional(),
|
|
12
|
+
lyrics: zod_1.z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
exports.GreetingResultSchema = zod_1.z.discriminatedUnion('kind', [
|
|
15
|
+
zod_1.z.object({ kind: zod_1.z.literal(enums_1.GREETING_KIND.TEXT), text: zod_1.z.string().min(1) }),
|
|
16
|
+
zod_1.z.object({ kind: zod_1.z.literal(enums_1.GREETING_KIND.SONG), tracks: zod_1.z.array(exports.GreetingTrackSchema).min(1) }),
|
|
17
|
+
zod_1.z.object({ kind: zod_1.z.literal(enums_1.GREETING_KIND.VIDEO), video: zod_1.z.object({ url: zod_1.z.url() }) }),
|
|
18
|
+
zod_1.z.object({ kind: zod_1.z.literal(enums_1.GREETING_KIND.IMAGE), image: zod_1.z.object({ url: zod_1.z.url() }) }),
|
|
19
|
+
]);
|
|
@@ -0,0 +1,22 @@
|
|
|
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("./greeting-input.schema"), exports);
|
|
18
|
+
__exportStar(require("./greeting-owner.schema"), exports);
|
|
19
|
+
__exportStar(require("./greeting-result.schema"), exports);
|
|
20
|
+
__exportStar(require("./greeting-job.schema"), exports);
|
|
21
|
+
__exportStar(require("./greeting-config.schema"), exports);
|
|
22
|
+
__exportStar(require("./greeting-price-data.schema"), exports);
|