@veruna/api-contracts 1.0.36 → 1.0.37
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/rest-api.d.ts +2 -0
- package/build/rest-api.js +2 -0
- package/build/routes/message.routes.d.ts +2 -0
- package/build/routes/message.routes.js +2 -0
- package/build/v1/message/commands/index.d.ts +2 -0
- package/build/v1/message/commands/index.js +5 -1
- package/build/v1/message/commands/rate-message-reg.command.d.ts +14 -0
- package/build/v1/message/commands/rate-message-reg.command.js +13 -0
- package/build/v1/message/commands/rate-message-unreg.command.d.ts +14 -0
- package/build/v1/message/commands/rate-message-unreg.command.js +13 -0
- package/build/v1/message/message.errors.d.ts +3 -1
- package/build/v1/message/message.errors.js +10 -0
- package/build/v1/message/schemas/index.d.ts +2 -0
- package/build/v1/message/schemas/index.js +5 -1
- package/build/v1/message/schemas/rate-message.schema.d.ts +16 -0
- package/build/v1/message/schemas/rate-message.schema.js +16 -0
- package/package.json +1 -1
package/build/rest-api.d.ts
CHANGED
|
@@ -139,9 +139,11 @@ export declare const REST_API: {
|
|
|
139
139
|
readonly MESSAGE: {
|
|
140
140
|
readonly UNREG: {
|
|
141
141
|
readonly SEND: (pageId: string, chatId: string) => string;
|
|
142
|
+
readonly RATE: (pageId: string, chatId: string, messageId: string) => string;
|
|
142
143
|
};
|
|
143
144
|
readonly REG: {
|
|
144
145
|
readonly SEND: (pageId: string, chatId: string) => string;
|
|
146
|
+
readonly RATE: (pageId: string, chatId: string, messageId: string) => string;
|
|
145
147
|
};
|
|
146
148
|
};
|
|
147
149
|
readonly VERIFICATION: {
|
package/build/rest-api.js
CHANGED
|
@@ -156,9 +156,11 @@ exports.REST_API = {
|
|
|
156
156
|
MESSAGE: {
|
|
157
157
|
UNREG: {
|
|
158
158
|
SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
|
|
159
|
+
RATE: (pageId, chatId, messageId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}/${messageId}/rating`,
|
|
159
160
|
},
|
|
160
161
|
REG: {
|
|
161
162
|
SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
|
|
163
|
+
RATE: (pageId, chatId, messageId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}/${messageId}/rating`,
|
|
162
164
|
},
|
|
163
165
|
},
|
|
164
166
|
VERIFICATION: {
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = void 0;
|
|
4
4
|
exports.MESSAGE_UNREG_ROUTES = {
|
|
5
5
|
SEND: '',
|
|
6
|
+
RATE: ':messageId/rating',
|
|
6
7
|
};
|
|
7
8
|
exports.MESSAGE_REG_ROUTES = {
|
|
8
9
|
SEND: '',
|
|
10
|
+
RATE: ':messageId/rating',
|
|
9
11
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateMessageCommand = void 0;
|
|
3
|
+
exports.RateMessageUnregCommand = exports.RateMessageRegCommand = exports.CreateMessageCommand = void 0;
|
|
4
4
|
var create_message_command_1 = require("./create-message.command");
|
|
5
5
|
Object.defineProperty(exports, "CreateMessageCommand", { enumerable: true, get: function () { return create_message_command_1.CreateMessageCommand; } });
|
|
6
|
+
var rate_message_reg_command_1 = require("./rate-message-reg.command");
|
|
7
|
+
Object.defineProperty(exports, "RateMessageRegCommand", { enumerable: true, get: function () { return rate_message_reg_command_1.RateMessageRegCommand; } });
|
|
8
|
+
var rate_message_unreg_command_1 = require("./rate-message-unreg.command");
|
|
9
|
+
Object.defineProperty(exports, "RateMessageUnregCommand", { enumerable: true, get: function () { return rate_message_unreg_command_1.RateMessageUnregCommand; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace RateMessageRegCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
rating: z.ZodEnum<typeof import("..").UserRating>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
const URL: (pageId: string, chatId: string, messageId: string) => string;
|
|
11
|
+
const METHOD = HttpMethod.PATCH;
|
|
12
|
+
type RequestType = z.infer<typeof Request>;
|
|
13
|
+
type ResponseType = z.infer<typeof Response>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RateMessageRegCommand = void 0;
|
|
4
|
+
const rate_message_schema_1 = require("../schemas/rate-message.schema");
|
|
5
|
+
const rest_api_1 = require("../../../rest-api");
|
|
6
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
7
|
+
var RateMessageRegCommand;
|
|
8
|
+
(function (RateMessageRegCommand) {
|
|
9
|
+
RateMessageRegCommand.Request = rate_message_schema_1.RateMessageRequestSchema;
|
|
10
|
+
RateMessageRegCommand.Response = rate_message_schema_1.RateMessageResponseSchema;
|
|
11
|
+
RateMessageRegCommand.URL = (pageId, chatId, messageId) => rest_api_1.REST_API.V1.MESSAGE.REG.RATE(pageId, chatId, messageId);
|
|
12
|
+
RateMessageRegCommand.METHOD = http_method_1.HttpMethod.PATCH;
|
|
13
|
+
})(RateMessageRegCommand || (exports.RateMessageRegCommand = RateMessageRegCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace RateMessageUnregCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
rating: z.ZodEnum<typeof import("..").UserRating>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
const Response: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
const URL: (pageId: string, chatId: string, messageId: string) => string;
|
|
11
|
+
const METHOD = HttpMethod.PATCH;
|
|
12
|
+
type RequestType = z.infer<typeof Request>;
|
|
13
|
+
type ResponseType = z.infer<typeof Response>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RateMessageUnregCommand = void 0;
|
|
4
|
+
const rate_message_schema_1 = require("../schemas/rate-message.schema");
|
|
5
|
+
const rest_api_1 = require("../../../rest-api");
|
|
6
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
7
|
+
var RateMessageUnregCommand;
|
|
8
|
+
(function (RateMessageUnregCommand) {
|
|
9
|
+
RateMessageUnregCommand.Request = rate_message_schema_1.RateMessageRequestSchema;
|
|
10
|
+
RateMessageUnregCommand.Response = rate_message_schema_1.RateMessageResponseSchema;
|
|
11
|
+
RateMessageUnregCommand.URL = (pageId, chatId, messageId) => rest_api_1.REST_API.V1.MESSAGE.UNREG.RATE(pageId, chatId, messageId);
|
|
12
|
+
RateMessageUnregCommand.METHOD = http_method_1.HttpMethod.PATCH;
|
|
13
|
+
})(RateMessageUnregCommand || (exports.RateMessageUnregCommand = RateMessageUnregCommand = {}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ErrorMetadata } from '../../shared';
|
|
2
2
|
export declare enum MessageErrorCode {
|
|
3
|
+
MESSAGE_NOT_FOUND = "MESSAGE_NOT_FOUND",
|
|
3
4
|
CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
|
|
4
5
|
CHAT_NOT_OWNED = "CHAT_NOT_OWNED",
|
|
5
6
|
CHAT_DELETED = "CHAT_DELETED",
|
|
@@ -8,6 +9,7 @@ export declare enum MessageErrorCode {
|
|
|
8
9
|
MESSAGE_TEXT_EMPTY = "MESSAGE_TEXT_EMPTY",
|
|
9
10
|
MESSAGE_TEXT_TOO_LONG = "MESSAGE_TEXT_TOO_LONG",
|
|
10
11
|
AI_MODEL_NOT_FOUND = "AI_MODEL_NOT_FOUND",
|
|
11
|
-
AI_MODEL_INACTIVE = "AI_MODEL_INACTIVE"
|
|
12
|
+
AI_MODEL_INACTIVE = "AI_MODEL_INACTIVE",
|
|
13
|
+
CANNOT_RATE_USER_MESSAGE = "CANNOT_RATE_USER_MESSAGE"
|
|
12
14
|
}
|
|
13
15
|
export declare const MESSAGE_ERRORS: Record<MessageErrorCode, ErrorMetadata>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MESSAGE_ERRORS = exports.MessageErrorCode = void 0;
|
|
4
4
|
var MessageErrorCode;
|
|
5
5
|
(function (MessageErrorCode) {
|
|
6
|
+
MessageErrorCode["MESSAGE_NOT_FOUND"] = "MESSAGE_NOT_FOUND";
|
|
6
7
|
MessageErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
|
|
7
8
|
MessageErrorCode["CHAT_NOT_OWNED"] = "CHAT_NOT_OWNED";
|
|
8
9
|
MessageErrorCode["CHAT_DELETED"] = "CHAT_DELETED";
|
|
@@ -12,8 +13,13 @@ var MessageErrorCode;
|
|
|
12
13
|
MessageErrorCode["MESSAGE_TEXT_TOO_LONG"] = "MESSAGE_TEXT_TOO_LONG";
|
|
13
14
|
MessageErrorCode["AI_MODEL_NOT_FOUND"] = "AI_MODEL_NOT_FOUND";
|
|
14
15
|
MessageErrorCode["AI_MODEL_INACTIVE"] = "AI_MODEL_INACTIVE";
|
|
16
|
+
MessageErrorCode["CANNOT_RATE_USER_MESSAGE"] = "CANNOT_RATE_USER_MESSAGE";
|
|
15
17
|
})(MessageErrorCode || (exports.MessageErrorCode = MessageErrorCode = {}));
|
|
16
18
|
exports.MESSAGE_ERRORS = {
|
|
19
|
+
[MessageErrorCode.MESSAGE_NOT_FOUND]: {
|
|
20
|
+
code: MessageErrorCode.MESSAGE_NOT_FOUND,
|
|
21
|
+
statusCode: 404,
|
|
22
|
+
},
|
|
17
23
|
[MessageErrorCode.CHAT_NOT_FOUND]: {
|
|
18
24
|
code: MessageErrorCode.CHAT_NOT_FOUND,
|
|
19
25
|
statusCode: 404,
|
|
@@ -50,4 +56,8 @@ exports.MESSAGE_ERRORS = {
|
|
|
50
56
|
code: MessageErrorCode.AI_MODEL_INACTIVE,
|
|
51
57
|
statusCode: 400,
|
|
52
58
|
},
|
|
59
|
+
[MessageErrorCode.CANNOT_RATE_USER_MESSAGE]: {
|
|
60
|
+
code: MessageErrorCode.CANNOT_RATE_USER_MESSAGE,
|
|
61
|
+
statusCode: 400,
|
|
62
|
+
},
|
|
53
63
|
};
|
|
@@ -6,3 +6,5 @@ export { CreateMessageResponseSchema } from './create-message-response.schema';
|
|
|
6
6
|
export { MessageResponseSchema } from './message-response.schema';
|
|
7
7
|
export { StreamEventType, StreamEventSchema, StreamChunkEventSchema, StreamReasoningEventSchema, StreamDoneEventSchema, StreamErrorEventSchema, } from './stream-events.schema';
|
|
8
8
|
export { MessageMetaSchema, ReasoningMetaSchema, ReasoningDetailSchema, } from './message-meta.schema';
|
|
9
|
+
export { RateMessageRequestSchema, RateMessageResponseSchema, RateMessageParamsSchema, } from './rate-message.schema';
|
|
10
|
+
export type { RateMessageRequestDto, RateMessageResponseDto, RateMessageParamsDto, } from './rate-message.schema';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
|
|
3
|
+
exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = exports.ReasoningDetailSchema = exports.ReasoningMetaSchema = exports.MessageMetaSchema = exports.StreamErrorEventSchema = exports.StreamDoneEventSchema = exports.StreamReasoningEventSchema = exports.StreamChunkEventSchema = exports.StreamEventSchema = exports.StreamEventType = exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
|
|
4
4
|
var message_role_enum_1 = require("./message-role.enum");
|
|
5
5
|
Object.defineProperty(exports, "MessageRole", { enumerable: true, get: function () { return message_role_enum_1.MessageRole; } });
|
|
6
6
|
var message_status_enum_1 = require("./message-status.enum");
|
|
@@ -24,3 +24,7 @@ var message_meta_schema_1 = require("./message-meta.schema");
|
|
|
24
24
|
Object.defineProperty(exports, "MessageMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.MessageMetaSchema; } });
|
|
25
25
|
Object.defineProperty(exports, "ReasoningMetaSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningMetaSchema; } });
|
|
26
26
|
Object.defineProperty(exports, "ReasoningDetailSchema", { enumerable: true, get: function () { return message_meta_schema_1.ReasoningDetailSchema; } });
|
|
27
|
+
var rate_message_schema_1 = require("./rate-message.schema");
|
|
28
|
+
Object.defineProperty(exports, "RateMessageRequestSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageRequestSchema; } });
|
|
29
|
+
Object.defineProperty(exports, "RateMessageResponseSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageResponseSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "RateMessageParamsSchema", { enumerable: true, get: function () { return rate_message_schema_1.RateMessageParamsSchema; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UserRating } from './user-rating.enum';
|
|
3
|
+
export declare const RateMessageRequestSchema: z.ZodObject<{
|
|
4
|
+
rating: z.ZodEnum<typeof UserRating>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const RateMessageResponseSchema: z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const RateMessageParamsSchema: z.ZodObject<{
|
|
10
|
+
pageId: z.ZodString;
|
|
11
|
+
chatId: z.ZodString;
|
|
12
|
+
messageId: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type RateMessageRequestDto = z.infer<typeof RateMessageRequestSchema>;
|
|
15
|
+
export type RateMessageResponseDto = z.infer<typeof RateMessageResponseSchema>;
|
|
16
|
+
export type RateMessageParamsDto = z.infer<typeof RateMessageParamsSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RateMessageParamsSchema = exports.RateMessageResponseSchema = exports.RateMessageRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const user_rating_enum_1 = require("./user-rating.enum");
|
|
6
|
+
exports.RateMessageRequestSchema = zod_1.z.object({
|
|
7
|
+
rating: zod_1.z.nativeEnum(user_rating_enum_1.UserRating),
|
|
8
|
+
});
|
|
9
|
+
exports.RateMessageResponseSchema = zod_1.z.object({
|
|
10
|
+
id: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
exports.RateMessageParamsSchema = zod_1.z.object({
|
|
13
|
+
pageId: zod_1.z.string().uuid(),
|
|
14
|
+
chatId: zod_1.z.string().uuid(),
|
|
15
|
+
messageId: zod_1.z.string().uuid(),
|
|
16
|
+
});
|