@veruna/api-contracts 1.0.49 → 1.0.51
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/v1/message/commands/create-message.command.d.ts +7 -0
- package/build/v1/message/message.errors.d.ts +2 -1
- package/build/v1/message/message.errors.js +5 -0
- package/build/v1/message/schemas/message-role.enum.d.ts +2 -1
- package/build/v1/message/schemas/message-role.enum.js +1 -0
- package/build/v1/message/schemas/stream-events.schema.d.ts +20 -0
- package/build/v1/message/schemas/stream-events.schema.js +14 -1
- package/build/v1/seo-pages/admin/commands/create-page.command.d.ts +2 -0
- package/build/v1/seo-pages/admin/commands/update-page.command.d.ts +2 -0
- package/build/v1/seo-pages/admin/queries/get-page.query.d.ts +1 -0
- package/build/v1/seo-pages/public/queries/get-index-page.query.d.ts +1 -0
- package/build/v1/seo-pages/public/queries/get-page-by-alias.query.d.ts +1 -0
- package/build/v1/seo-pages/schemas/create-page-request.schema.d.ts +1 -0
- package/build/v1/seo-pages/schemas/create-page-request.schema.js +15 -2
- package/build/v1/seo-pages/schemas/page-response.schema.d.ts +2 -0
- package/build/v1/seo-pages/schemas/page-response.schema.js +1 -0
- package/build/v1/seo-pages/schemas/update-page-request.schema.d.ts +1 -0
- package/build/v1/seo-pages/schemas/update-page-request.schema.js +15 -2
- package/package.json +1 -1
|
@@ -89,6 +89,13 @@ export declare namespace CreateMessageCommand {
|
|
|
89
89
|
chatId: z.ZodString;
|
|
90
90
|
messageId: z.ZodString;
|
|
91
91
|
type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_GENERATION_START>;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
id: z.ZodNumber;
|
|
94
|
+
chatId: z.ZodString;
|
|
95
|
+
messageId: z.ZodString;
|
|
96
|
+
type: z.ZodLiteral<import("../schemas").StreamEventType.IMAGE_UPLOADED>;
|
|
97
|
+
imageUrl: z.ZodString;
|
|
98
|
+
imageIndex: z.ZodNumber;
|
|
92
99
|
}, z.core.$strip>, z.ZodObject<{
|
|
93
100
|
id: z.ZodNumber;
|
|
94
101
|
chatId: z.ZodString;
|
|
@@ -12,6 +12,7 @@ export declare enum MessageErrorCode {
|
|
|
12
12
|
AI_MODEL_NOT_FOUND = "AI_MODEL_NOT_FOUND",
|
|
13
13
|
AI_MODEL_INACTIVE = "AI_MODEL_INACTIVE",
|
|
14
14
|
AI_MODEL_NOT_AVAILABLE_FOR_UNREG = "AI_MODEL_NOT_AVAILABLE_FOR_UNREG",
|
|
15
|
-
CANNOT_RATE_USER_MESSAGE = "CANNOT_RATE_USER_MESSAGE"
|
|
15
|
+
CANNOT_RATE_USER_MESSAGE = "CANNOT_RATE_USER_MESSAGE",
|
|
16
|
+
COMPACTION_FAILED = "COMPACTION_FAILED"
|
|
16
17
|
}
|
|
17
18
|
export declare const MESSAGE_ERRORS: Record<MessageErrorCode, ErrorMetadata>;
|
|
@@ -16,6 +16,7 @@ var MessageErrorCode;
|
|
|
16
16
|
MessageErrorCode["AI_MODEL_INACTIVE"] = "AI_MODEL_INACTIVE";
|
|
17
17
|
MessageErrorCode["AI_MODEL_NOT_AVAILABLE_FOR_UNREG"] = "AI_MODEL_NOT_AVAILABLE_FOR_UNREG";
|
|
18
18
|
MessageErrorCode["CANNOT_RATE_USER_MESSAGE"] = "CANNOT_RATE_USER_MESSAGE";
|
|
19
|
+
MessageErrorCode["COMPACTION_FAILED"] = "COMPACTION_FAILED";
|
|
19
20
|
})(MessageErrorCode || (exports.MessageErrorCode = MessageErrorCode = {}));
|
|
20
21
|
exports.MESSAGE_ERRORS = {
|
|
21
22
|
[MessageErrorCode.MESSAGE_NOT_FOUND]: {
|
|
@@ -70,4 +71,8 @@ exports.MESSAGE_ERRORS = {
|
|
|
70
71
|
code: MessageErrorCode.CANNOT_RATE_USER_MESSAGE,
|
|
71
72
|
statusCode: 400,
|
|
72
73
|
},
|
|
74
|
+
[MessageErrorCode.COMPACTION_FAILED]: {
|
|
75
|
+
code: MessageErrorCode.COMPACTION_FAILED,
|
|
76
|
+
statusCode: 500,
|
|
77
|
+
},
|
|
73
78
|
};
|
|
@@ -16,6 +16,8 @@ export declare enum StreamEventType {
|
|
|
16
16
|
STEP_DONE = "step_done",
|
|
17
17
|
/** Image generation started */
|
|
18
18
|
IMAGE_GENERATION_START = "image_generation_start",
|
|
19
|
+
/** Image uploaded to S3 */
|
|
20
|
+
IMAGE_UPLOADED = "image_uploaded",
|
|
19
21
|
/** Stream completed successfully */
|
|
20
22
|
DONE = "done",
|
|
21
23
|
/** Error occurred during streaming */
|
|
@@ -114,6 +116,17 @@ export declare const StreamImageGenerationStartEventSchema: z.ZodObject<{
|
|
|
114
116
|
messageId: z.ZodString;
|
|
115
117
|
type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
|
|
116
118
|
}, z.core.$strip>;
|
|
119
|
+
/**
|
|
120
|
+
* Image uploaded event - image has been uploaded to S3
|
|
121
|
+
*/
|
|
122
|
+
export declare const StreamImageUploadedEventSchema: z.ZodObject<{
|
|
123
|
+
id: z.ZodNumber;
|
|
124
|
+
chatId: z.ZodString;
|
|
125
|
+
messageId: z.ZodString;
|
|
126
|
+
type: z.ZodLiteral<StreamEventType.IMAGE_UPLOADED>;
|
|
127
|
+
imageUrl: z.ZodString;
|
|
128
|
+
imageIndex: z.ZodNumber;
|
|
129
|
+
}, z.core.$strip>;
|
|
117
130
|
/**
|
|
118
131
|
* Discriminated union of all stream events
|
|
119
132
|
* Use `type` field to narrow the type
|
|
@@ -167,6 +180,13 @@ export declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
167
180
|
chatId: z.ZodString;
|
|
168
181
|
messageId: z.ZodString;
|
|
169
182
|
type: z.ZodLiteral<StreamEventType.IMAGE_GENERATION_START>;
|
|
183
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
184
|
+
id: z.ZodNumber;
|
|
185
|
+
chatId: z.ZodString;
|
|
186
|
+
messageId: z.ZodString;
|
|
187
|
+
type: z.ZodLiteral<StreamEventType.IMAGE_UPLOADED>;
|
|
188
|
+
imageUrl: z.ZodString;
|
|
189
|
+
imageIndex: z.ZodNumber;
|
|
170
190
|
}, z.core.$strip>, z.ZodObject<{
|
|
171
191
|
id: z.ZodNumber;
|
|
172
192
|
chatId: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StreamEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
|
|
3
|
+
exports.StreamEventSchema = exports.StreamImageUploadedEventSchema = exports.StreamImageGenerationStartEventSchema = exports.StreamStepDoneEventSchema = exports.StreamPromptGenerationEventSchema = exports.StreamImageEventSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const message_meta_schema_1 = require("./message-meta.schema");
|
|
6
6
|
const generation_step_schema_1 = require("./generation-step.schema");
|
|
@@ -21,6 +21,8 @@ var StreamEventType;
|
|
|
21
21
|
StreamEventType["STEP_DONE"] = "step_done";
|
|
22
22
|
/** Image generation started */
|
|
23
23
|
StreamEventType["IMAGE_GENERATION_START"] = "image_generation_start";
|
|
24
|
+
/** Image uploaded to S3 */
|
|
25
|
+
StreamEventType["IMAGE_UPLOADED"] = "image_uploaded";
|
|
24
26
|
/** Stream completed successfully */
|
|
25
27
|
StreamEventType["DONE"] = "done";
|
|
26
28
|
/** Error occurred during streaming */
|
|
@@ -114,6 +116,16 @@ exports.StreamStepDoneEventSchema = BaseStreamEventSchema.extend({
|
|
|
114
116
|
exports.StreamImageGenerationStartEventSchema = BaseStreamEventSchema.extend({
|
|
115
117
|
type: zod_1.z.literal(StreamEventType.IMAGE_GENERATION_START),
|
|
116
118
|
});
|
|
119
|
+
/**
|
|
120
|
+
* Image uploaded event - image has been uploaded to S3
|
|
121
|
+
*/
|
|
122
|
+
exports.StreamImageUploadedEventSchema = BaseStreamEventSchema.extend({
|
|
123
|
+
type: zod_1.z.literal(StreamEventType.IMAGE_UPLOADED),
|
|
124
|
+
/** S3 URL of the uploaded image */
|
|
125
|
+
imageUrl: zod_1.z.string().url(),
|
|
126
|
+
/** Image index (for multiple images in one message) */
|
|
127
|
+
imageIndex: zod_1.z.number().int().nonnegative(),
|
|
128
|
+
});
|
|
117
129
|
// ============================================================================
|
|
118
130
|
// Union Schema
|
|
119
131
|
// ============================================================================
|
|
@@ -128,6 +140,7 @@ exports.StreamEventSchema = zod_1.z.discriminatedUnion('type', [
|
|
|
128
140
|
exports.StreamPromptGenerationEventSchema,
|
|
129
141
|
exports.StreamStepDoneEventSchema,
|
|
130
142
|
exports.StreamImageGenerationStartEventSchema,
|
|
143
|
+
exports.StreamImageUploadedEventSchema,
|
|
131
144
|
exports.StreamDoneEventSchema,
|
|
132
145
|
exports.StreamErrorEventSchema,
|
|
133
146
|
]);
|
|
@@ -21,6 +21,7 @@ export declare namespace AdminSeoPageCreatePageCommand {
|
|
|
21
21
|
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
22
|
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
23
|
marks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
24
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
const Response: z.ZodObject<{
|
|
26
27
|
uuid: z.ZodString;
|
|
@@ -43,6 +44,7 @@ export declare namespace AdminSeoPageCreatePageCommand {
|
|
|
43
44
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
44
45
|
seoName: z.ZodNullable<z.ZodString>;
|
|
45
46
|
marks: z.ZodArray<z.ZodString>;
|
|
47
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
46
48
|
createdAt: z.ZodString;
|
|
47
49
|
updatedAt: z.ZodString;
|
|
48
50
|
}, z.core.$strip>;
|
|
@@ -21,6 +21,7 @@ export declare namespace AdminSeoPageUpdatePageCommand {
|
|
|
21
21
|
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
22
|
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
23
23
|
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
24
25
|
}, z.core.$strip>;
|
|
25
26
|
const Response: z.ZodObject<{
|
|
26
27
|
uuid: z.ZodString;
|
|
@@ -43,6 +44,7 @@ export declare namespace AdminSeoPageUpdatePageCommand {
|
|
|
43
44
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
44
45
|
seoName: z.ZodNullable<z.ZodString>;
|
|
45
46
|
marks: z.ZodArray<z.ZodString>;
|
|
47
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
46
48
|
createdAt: z.ZodString;
|
|
47
49
|
updatedAt: z.ZodString;
|
|
48
50
|
}, z.core.$strip>;
|
|
@@ -23,6 +23,7 @@ export declare namespace AdminSeoPageGetPageQuery {
|
|
|
23
23
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
24
|
seoName: z.ZodNullable<z.ZodString>;
|
|
25
25
|
marks: z.ZodArray<z.ZodString>;
|
|
26
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
26
27
|
createdAt: z.ZodString;
|
|
27
28
|
updatedAt: z.ZodString;
|
|
28
29
|
}, z.core.$strip>;
|
|
@@ -23,6 +23,7 @@ export declare namespace SeoPageGetIndexPageQuery {
|
|
|
23
23
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
24
|
seoName: z.ZodNullable<z.ZodString>;
|
|
25
25
|
marks: z.ZodArray<z.ZodString>;
|
|
26
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
26
27
|
createdAt: z.ZodString;
|
|
27
28
|
updatedAt: z.ZodString;
|
|
28
29
|
}, z.core.$strip>;
|
|
@@ -23,6 +23,7 @@ export declare namespace SeoPageGetPageByAliasQuery {
|
|
|
23
23
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
24
24
|
seoName: z.ZodNullable<z.ZodString>;
|
|
25
25
|
marks: z.ZodArray<z.ZodString>;
|
|
26
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
26
27
|
createdAt: z.ZodString;
|
|
27
28
|
updatedAt: z.ZodString;
|
|
28
29
|
hints: z.ZodArray<z.ZodObject<{
|
|
@@ -24,4 +24,5 @@ export declare const CreatePageRequestSchema: z.ZodObject<{
|
|
|
24
24
|
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
25
|
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
26
|
marks: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
27
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
28
|
}, z.core.$strip>;
|
|
@@ -53,7 +53,20 @@ exports.CreatePageRequestSchema = zod_1.z.object({
|
|
|
53
53
|
.int({ message: 'CreatePageRequest.order.invalid' })
|
|
54
54
|
.min(0, { message: 'CreatePageRequest.order.invalid' })
|
|
55
55
|
.default(0),
|
|
56
|
-
placeholder: zod_1.z
|
|
57
|
-
|
|
56
|
+
placeholder: zod_1.z
|
|
57
|
+
.string()
|
|
58
|
+
.max(500, { message: 'CreatePageRequest.placeholder.max' })
|
|
59
|
+
.nullable()
|
|
60
|
+
.optional(),
|
|
61
|
+
seoName: zod_1.z
|
|
62
|
+
.string()
|
|
63
|
+
.max(200, { message: 'CreatePageRequest.seoName.max' })
|
|
64
|
+
.nullable()
|
|
65
|
+
.optional(),
|
|
58
66
|
marks: zod_1.z.array(zod_1.z.string().max(50, { message: 'CreatePageRequest.marks.max' })).default([]),
|
|
67
|
+
prompt: zod_1.z
|
|
68
|
+
.string()
|
|
69
|
+
.max(10000, { message: 'CreatePageRequest.prompt.max' })
|
|
70
|
+
.nullable()
|
|
71
|
+
.optional(),
|
|
59
72
|
});
|
|
@@ -24,6 +24,7 @@ export declare const PageResponseSchema: z.ZodObject<{
|
|
|
24
24
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
25
25
|
seoName: z.ZodNullable<z.ZodString>;
|
|
26
26
|
marks: z.ZodArray<z.ZodString>;
|
|
27
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
27
28
|
createdAt: z.ZodString;
|
|
28
29
|
updatedAt: z.ZodString;
|
|
29
30
|
}, z.core.$strip>;
|
|
@@ -71,6 +72,7 @@ export declare const PublicPageResponseSchema: z.ZodObject<{
|
|
|
71
72
|
placeholder: z.ZodNullable<z.ZodString>;
|
|
72
73
|
seoName: z.ZodNullable<z.ZodString>;
|
|
73
74
|
marks: z.ZodArray<z.ZodString>;
|
|
75
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
74
76
|
createdAt: z.ZodString;
|
|
75
77
|
updatedAt: z.ZodString;
|
|
76
78
|
hints: z.ZodArray<z.ZodObject<{
|
|
@@ -26,6 +26,7 @@ exports.PageResponseSchema = zod_1.z.object({
|
|
|
26
26
|
placeholder: zod_1.z.string().nullable(),
|
|
27
27
|
seoName: zod_1.z.string().nullable(),
|
|
28
28
|
marks: zod_1.z.array(zod_1.z.string()),
|
|
29
|
+
prompt: zod_1.z.string().nullable(),
|
|
29
30
|
createdAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
30
31
|
updatedAt: zod_1.z.string().regex(shared_1.DATETIME_REGEX),
|
|
31
32
|
});
|
|
@@ -24,4 +24,5 @@ export declare const UpdatePageRequestSchema: z.ZodObject<{
|
|
|
24
24
|
placeholder: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
25
|
seoName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
26
26
|
marks: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
27
|
+
prompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
28
|
}, z.core.$strip>;
|
|
@@ -52,7 +52,20 @@ exports.UpdatePageRequestSchema = zod_1.z.object({
|
|
|
52
52
|
.int({ message: 'UpdatePageRequest.order.invalid' })
|
|
53
53
|
.min(0, { message: 'UpdatePageRequest.order.invalid' })
|
|
54
54
|
.optional(),
|
|
55
|
-
placeholder: zod_1.z
|
|
56
|
-
|
|
55
|
+
placeholder: zod_1.z
|
|
56
|
+
.string()
|
|
57
|
+
.max(500, { message: 'UpdatePageRequest.placeholder.max' })
|
|
58
|
+
.nullable()
|
|
59
|
+
.optional(),
|
|
60
|
+
seoName: zod_1.z
|
|
61
|
+
.string()
|
|
62
|
+
.max(200, { message: 'UpdatePageRequest.seoName.max' })
|
|
63
|
+
.nullable()
|
|
64
|
+
.optional(),
|
|
57
65
|
marks: zod_1.z.array(zod_1.z.string().max(50, { message: 'UpdatePageRequest.marks.max' })).optional(),
|
|
66
|
+
prompt: zod_1.z
|
|
67
|
+
.string()
|
|
68
|
+
.max(10000, { message: 'UpdatePageRequest.prompt.max' })
|
|
69
|
+
.nullable()
|
|
70
|
+
.optional(),
|
|
58
71
|
});
|