@veruna/api-contracts 1.0.36 → 1.0.38

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.
Files changed (47) hide show
  1. package/build/rest-api.d.ts +3 -0
  2. package/build/rest-api.js +3 -0
  3. package/build/routes/chat-project.routes.d.ts +1 -0
  4. package/build/routes/chat-project.routes.js +1 -0
  5. package/build/routes/message.routes.d.ts +2 -0
  6. package/build/routes/message.routes.js +2 -0
  7. package/build/v1/chat/chat.errors.d.ts +2 -1
  8. package/build/v1/chat/chat.errors.js +5 -0
  9. package/build/v1/chat/commands/create-reg-chat.command.d.ts +3 -1
  10. package/build/v1/chat/commands/create-reg-chat.command.js +1 -2
  11. package/build/v1/chat/commands/index.d.ts +1 -0
  12. package/build/v1/chat/commands/index.js +3 -1
  13. package/build/v1/chat/commands/update-chat.command.d.ts +46 -0
  14. package/build/v1/chat/commands/update-chat.command.js +17 -0
  15. package/build/v1/chat/schemas/create-chat-request.schema.d.ts +5 -0
  16. package/build/v1/chat/schemas/create-chat-request.schema.js +7 -0
  17. package/build/v1/chat/schemas/index.d.ts +4 -0
  18. package/build/v1/chat/schemas/index.js +5 -1
  19. package/build/v1/chat/schemas/update-chat-request.schema.d.ts +6 -0
  20. package/build/v1/chat/schemas/update-chat-request.schema.js +8 -0
  21. package/build/v1/chat-project/events/folder-deleted.event.d.ts +10 -0
  22. package/build/v1/chat-project/events/folder-deleted.event.js +2 -0
  23. package/build/v1/chat-project/events/index.d.ts +1 -0
  24. package/build/v1/chat-project/events/index.js +17 -0
  25. package/build/v1/chat-project/index.d.ts +1 -0
  26. package/build/v1/chat-project/index.js +1 -0
  27. package/build/v1/chat-project/queries/get-project-chats.query.d.ts +26 -0
  28. package/build/v1/chat-project/queries/get-project-chats.query.js +17 -0
  29. package/build/v1/chat-project/queries/index.d.ts +1 -0
  30. package/build/v1/chat-project/queries/index.js +1 -0
  31. package/build/v1/chat-project/schemas/get-project-chats.schema.d.ts +33 -0
  32. package/build/v1/chat-project/schemas/get-project-chats.schema.js +28 -0
  33. package/build/v1/chat-project/schemas/index.d.ts +1 -0
  34. package/build/v1/chat-project/schemas/index.js +1 -0
  35. package/build/v1/message/commands/index.d.ts +2 -0
  36. package/build/v1/message/commands/index.js +5 -1
  37. package/build/v1/message/commands/rate-message-reg.command.d.ts +14 -0
  38. package/build/v1/message/commands/rate-message-reg.command.js +13 -0
  39. package/build/v1/message/commands/rate-message-unreg.command.d.ts +14 -0
  40. package/build/v1/message/commands/rate-message-unreg.command.js +13 -0
  41. package/build/v1/message/message.errors.d.ts +3 -1
  42. package/build/v1/message/message.errors.js +10 -0
  43. package/build/v1/message/schemas/index.d.ts +2 -0
  44. package/build/v1/message/schemas/index.js +5 -1
  45. package/build/v1/message/schemas/rate-message.schema.d.ts +16 -0
  46. package/build/v1/message/schemas/rate-message.schema.js +16 -0
  47. package/package.json +1 -1
@@ -121,6 +121,7 @@ export declare const REST_API: {
121
121
  readonly GET_BY_UUID: (uuid: string) => string;
122
122
  readonly UPDATE: (uuid: string) => string;
123
123
  readonly DELETE: (uuid: string) => string;
124
+ readonly GET_CHATS: (uuid: string) => string;
124
125
  };
125
126
  readonly CHAT: {
126
127
  readonly UNREG: {
@@ -139,9 +140,11 @@ export declare const REST_API: {
139
140
  readonly MESSAGE: {
140
141
  readonly UNREG: {
141
142
  readonly SEND: (pageId: string, chatId: string) => string;
143
+ readonly RATE: (pageId: string, chatId: string, messageId: string) => string;
142
144
  };
143
145
  readonly REG: {
144
146
  readonly SEND: (pageId: string, chatId: string) => string;
147
+ readonly RATE: (pageId: string, chatId: string, messageId: string) => string;
145
148
  };
146
149
  };
147
150
  readonly VERIFICATION: {
package/build/rest-api.js CHANGED
@@ -138,6 +138,7 @@ exports.REST_API = {
138
138
  GET_BY_UUID: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}`,
139
139
  UPDATE: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}`,
140
140
  DELETE: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}`,
141
+ GET_CHATS: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}/chats`,
141
142
  },
142
143
  CHAT: {
143
144
  UNREG: {
@@ -156,9 +157,11 @@ exports.REST_API = {
156
157
  MESSAGE: {
157
158
  UNREG: {
158
159
  SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
160
+ RATE: (pageId, chatId, messageId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}/${messageId}/rating`,
159
161
  },
160
162
  REG: {
161
163
  SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
164
+ RATE: (pageId, chatId, messageId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}/${messageId}/rating`,
162
165
  },
163
166
  },
164
167
  VERIFICATION: {
@@ -8,4 +8,5 @@ export declare const CHAT_PROJECT_ROUTES: {
8
8
  readonly GET_BY_UUID: ":uuid";
9
9
  readonly UPDATE: ":uuid";
10
10
  readonly DELETE: ":uuid";
11
+ readonly GET_CHATS: ":uuid/chats";
11
12
  };
@@ -11,4 +11,5 @@ exports.CHAT_PROJECT_ROUTES = {
11
11
  GET_BY_UUID: ':uuid', // GET /projects/:uuid
12
12
  UPDATE: ':uuid', // PATCH /projects/:uuid
13
13
  DELETE: ':uuid', // DELETE /projects/:uuid
14
+ GET_CHATS: ':uuid/chats', // GET /projects/:uuid/chats
14
15
  };
@@ -1,6 +1,8 @@
1
1
  export declare const MESSAGE_UNREG_ROUTES: {
2
2
  readonly SEND: "";
3
+ readonly RATE: ":messageId/rating";
3
4
  };
4
5
  export declare const MESSAGE_REG_ROUTES: {
5
6
  readonly SEND: "";
7
+ readonly RATE: ":messageId/rating";
6
8
  };
@@ -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
  };
@@ -4,6 +4,7 @@ export declare enum ChatErrorCode {
4
4
  PAGE_ID_REQUIRED = "PAGE_ID_REQUIRED",
5
5
  CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
6
6
  CHAT_ALREADY_DELETED = "CHAT_ALREADY_DELETED",
7
- TITLE_REQUIRED = "TITLE_REQUIRED"
7
+ TITLE_REQUIRED = "TITLE_REQUIRED",
8
+ FOLDER_NOT_FOUND = "FOLDER_NOT_FOUND"
8
9
  }
9
10
  export declare const CHAT_ERRORS: Record<ChatErrorCode, ErrorMetadata>;
@@ -8,6 +8,7 @@ var ChatErrorCode;
8
8
  ChatErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
9
9
  ChatErrorCode["CHAT_ALREADY_DELETED"] = "CHAT_ALREADY_DELETED";
10
10
  ChatErrorCode["TITLE_REQUIRED"] = "TITLE_REQUIRED";
11
+ ChatErrorCode["FOLDER_NOT_FOUND"] = "FOLDER_NOT_FOUND";
11
12
  })(ChatErrorCode || (exports.ChatErrorCode = ChatErrorCode = {}));
12
13
  exports.CHAT_ERRORS = {
13
14
  [ChatErrorCode.PAGE_NOT_FOUND]: {
@@ -30,4 +31,8 @@ exports.CHAT_ERRORS = {
30
31
  code: ChatErrorCode.TITLE_REQUIRED,
31
32
  statusCode: 400,
32
33
  },
34
+ [ChatErrorCode.FOLDER_NOT_FOUND]: {
35
+ code: ChatErrorCode.FOLDER_NOT_FOUND,
36
+ statusCode: 404,
37
+ },
33
38
  };
@@ -5,7 +5,9 @@ import { HttpMethod } from '../../../shared/http-method';
5
5
  * POST /api/v1/page/:pageId/chat
6
6
  */
7
7
  export declare namespace CreateRegChatCommand {
8
- const Request: z.ZodObject<{}, z.core.$strip>;
8
+ const Request: z.ZodObject<{
9
+ folderId: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strip>;
9
11
  const Response: z.ZodObject<{
10
12
  uuid: z.ZodString;
11
13
  title: z.ZodString;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateRegChatCommand = void 0;
4
- const zod_1 = require("zod");
5
4
  const schemas_1 = require("../schemas");
6
5
  const rest_api_1 = require("../../../rest-api");
7
6
  const http_method_1 = require("../../../shared/http-method");
@@ -11,7 +10,7 @@ const http_method_1 = require("../../../shared/http-method");
11
10
  */
12
11
  var CreateRegChatCommand;
13
12
  (function (CreateRegChatCommand) {
14
- CreateRegChatCommand.Request = zod_1.z.object({});
13
+ CreateRegChatCommand.Request = schemas_1.CreateChatRequestSchema;
15
14
  CreateRegChatCommand.Response = schemas_1.ChatWithMessagesResponseSchema;
16
15
  CreateRegChatCommand.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.REG.CREATE(pageId);
17
16
  CreateRegChatCommand.METHOD = http_method_1.HttpMethod.POST;
@@ -2,3 +2,4 @@ export { CreateUnregChatCommand } from './create-unreg-chat.command';
2
2
  export { CreateRegChatCommand } from './create-reg-chat.command';
3
3
  export { DeleteChatCommand } from './delete-chat.command';
4
4
  export { UpdateChatTitleCommand } from './update-chat-title.command';
5
+ export { UpdateChatCommand } from './update-chat.command';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UpdateChatTitleCommand = exports.DeleteChatCommand = exports.CreateRegChatCommand = exports.CreateUnregChatCommand = void 0;
3
+ exports.UpdateChatCommand = exports.UpdateChatTitleCommand = exports.DeleteChatCommand = exports.CreateRegChatCommand = exports.CreateUnregChatCommand = void 0;
4
4
  var create_unreg_chat_command_1 = require("./create-unreg-chat.command");
5
5
  Object.defineProperty(exports, "CreateUnregChatCommand", { enumerable: true, get: function () { return create_unreg_chat_command_1.CreateUnregChatCommand; } });
6
6
  var create_reg_chat_command_1 = require("./create-reg-chat.command");
@@ -9,3 +9,5 @@ var delete_chat_command_1 = require("./delete-chat.command");
9
9
  Object.defineProperty(exports, "DeleteChatCommand", { enumerable: true, get: function () { return delete_chat_command_1.DeleteChatCommand; } });
10
10
  var update_chat_title_command_1 = require("./update-chat-title.command");
11
11
  Object.defineProperty(exports, "UpdateChatTitleCommand", { enumerable: true, get: function () { return update_chat_title_command_1.UpdateChatTitleCommand; } });
12
+ var update_chat_command_1 = require("./update-chat.command");
13
+ Object.defineProperty(exports, "UpdateChatCommand", { enumerable: true, get: function () { return update_chat_command_1.UpdateChatCommand; } });
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Update Chat Command
5
+ * PATCH /api/v1/page/:pageId/chat/:chatId
6
+ */
7
+ export declare namespace UpdateChatCommand {
8
+ const Request: z.ZodObject<{
9
+ title: z.ZodOptional<z.ZodString>;
10
+ folderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ }, z.core.$strip>;
12
+ const Response: z.ZodObject<{
13
+ uuid: z.ZodString;
14
+ title: z.ZodString;
15
+ status: z.ZodEnum<typeof import("../schemas").ChatStatus>;
16
+ pageId: z.ZodNullable<z.ZodString>;
17
+ folderId: z.ZodNullable<z.ZodString>;
18
+ createdAt: z.ZodString;
19
+ updatedAt: z.ZodString;
20
+ messages: z.ZodArray<z.ZodObject<{
21
+ uuid: z.ZodString;
22
+ role: z.ZodEnum<typeof import("../..").MessageRole>;
23
+ status: z.ZodEnum<typeof import("../..").MessageStatus>;
24
+ content: z.ZodString;
25
+ aiModelId: z.ZodNullable<z.ZodString>;
26
+ userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
27
+ meta: z.ZodNullable<z.ZodObject<{
28
+ reasoning: z.ZodOptional<z.ZodObject<{
29
+ content: z.ZodString;
30
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
31
+ type: z.ZodString;
32
+ text: z.ZodString;
33
+ format: z.ZodOptional<z.ZodString>;
34
+ index: z.ZodOptional<z.ZodNumber>;
35
+ }, z.core.$strip>>>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>>;
38
+ createdAt: z.ZodString;
39
+ updatedAt: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>;
42
+ const URL: (pageId: string, chatId: string) => string;
43
+ const METHOD = HttpMethod.PATCH;
44
+ type RequestType = z.infer<typeof Request>;
45
+ type ResponseType = z.infer<typeof Response>;
46
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateChatCommand = void 0;
4
+ const schemas_1 = require("../schemas");
5
+ const rest_api_1 = require("../../../rest-api");
6
+ const http_method_1 = require("../../../shared/http-method");
7
+ /**
8
+ * Update Chat Command
9
+ * PATCH /api/v1/page/:pageId/chat/:chatId
10
+ */
11
+ var UpdateChatCommand;
12
+ (function (UpdateChatCommand) {
13
+ UpdateChatCommand.Request = schemas_1.UpdateChatRequestSchema;
14
+ UpdateChatCommand.Response = schemas_1.ChatWithMessagesResponseSchema;
15
+ UpdateChatCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.CHAT.REG.UPDATE_TITLE(pageId, chatId);
16
+ UpdateChatCommand.METHOD = http_method_1.HttpMethod.PATCH;
17
+ })(UpdateChatCommand || (exports.UpdateChatCommand = UpdateChatCommand = {}));
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const CreateChatRequestSchema: z.ZodObject<{
3
+ folderId: z.ZodOptional<z.ZodString>;
4
+ }, z.core.$strip>;
5
+ export type CreateChatRequestDto = z.infer<typeof CreateChatRequestSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateChatRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.CreateChatRequestSchema = zod_1.z.object({
6
+ folderId: zod_1.z.string().uuid().optional(),
7
+ });
@@ -7,6 +7,10 @@ export { ChatIdParamSchema } from './chat-id-param.schema';
7
7
  export type { ChatIdParamDto } from './chat-id-param.schema';
8
8
  export { UpdateChatTitleRequestSchema } from './update-chat-title-request.schema';
9
9
  export type { UpdateChatTitleRequestDto } from './update-chat-title-request.schema';
10
+ export { CreateChatRequestSchema } from './create-chat-request.schema';
11
+ export type { CreateChatRequestDto } from './create-chat-request.schema';
12
+ export { UpdateChatRequestSchema } from './update-chat-request.schema';
13
+ export type { UpdateChatRequestDto } from './update-chat-request.schema';
10
14
  export { DeleteChatResponseSchema } from './delete-chat-response.schema';
11
15
  export type { DeleteChatResponseDto } from './delete-chat-response.schema';
12
16
  export { ChatPeriodType, MONTH_NAMES_RU, PERIOD_LABELS_RU, ChatHistoryItemSchema, ChatPeriodSchema, GetChatHistoryRequestSchema, GetChatHistoryResponseSchema, } from './chat-history.schema';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetChatHistoryResponseSchema = exports.GetChatHistoryRequestSchema = exports.ChatPeriodSchema = exports.ChatHistoryItemSchema = exports.PERIOD_LABELS_RU = exports.MONTH_NAMES_RU = exports.ChatPeriodType = exports.DeleteChatResponseSchema = exports.UpdateChatTitleRequestSchema = exports.ChatIdParamSchema = exports.PageIdParamSchema = exports.ChatWithMessagesResponseSchema = exports.ChatResponseSchema = exports.ChatStatus = void 0;
3
+ exports.GetChatHistoryResponseSchema = exports.GetChatHistoryRequestSchema = exports.ChatPeriodSchema = exports.ChatHistoryItemSchema = exports.PERIOD_LABELS_RU = exports.MONTH_NAMES_RU = exports.ChatPeriodType = exports.DeleteChatResponseSchema = exports.UpdateChatRequestSchema = exports.CreateChatRequestSchema = exports.UpdateChatTitleRequestSchema = exports.ChatIdParamSchema = exports.PageIdParamSchema = exports.ChatWithMessagesResponseSchema = exports.ChatResponseSchema = exports.ChatStatus = void 0;
4
4
  var chat_status_enum_1 = require("./chat-status.enum");
5
5
  Object.defineProperty(exports, "ChatStatus", { enumerable: true, get: function () { return chat_status_enum_1.ChatStatus; } });
6
6
  var chat_response_schema_1 = require("./chat-response.schema");
@@ -13,6 +13,10 @@ var chat_id_param_schema_1 = require("./chat-id-param.schema");
13
13
  Object.defineProperty(exports, "ChatIdParamSchema", { enumerable: true, get: function () { return chat_id_param_schema_1.ChatIdParamSchema; } });
14
14
  var update_chat_title_request_schema_1 = require("./update-chat-title-request.schema");
15
15
  Object.defineProperty(exports, "UpdateChatTitleRequestSchema", { enumerable: true, get: function () { return update_chat_title_request_schema_1.UpdateChatTitleRequestSchema; } });
16
+ var create_chat_request_schema_1 = require("./create-chat-request.schema");
17
+ Object.defineProperty(exports, "CreateChatRequestSchema", { enumerable: true, get: function () { return create_chat_request_schema_1.CreateChatRequestSchema; } });
18
+ var update_chat_request_schema_1 = require("./update-chat-request.schema");
19
+ Object.defineProperty(exports, "UpdateChatRequestSchema", { enumerable: true, get: function () { return update_chat_request_schema_1.UpdateChatRequestSchema; } });
16
20
  var delete_chat_response_schema_1 = require("./delete-chat-response.schema");
17
21
  Object.defineProperty(exports, "DeleteChatResponseSchema", { enumerable: true, get: function () { return delete_chat_response_schema_1.DeleteChatResponseSchema; } });
18
22
  var chat_history_schema_1 = require("./chat-history.schema");
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export declare const UpdateChatRequestSchema: z.ZodObject<{
3
+ title: z.ZodOptional<z.ZodString>;
4
+ folderId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ }, z.core.$strip>;
6
+ export type UpdateChatRequestDto = z.infer<typeof UpdateChatRequestSchema>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateChatRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.UpdateChatRequestSchema = zod_1.z.object({
6
+ title: zod_1.z.string().min(1).max(40).optional(),
7
+ folderId: zod_1.z.string().uuid().nullable().optional(),
8
+ });
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Folder Deleted Event
3
+ * Published when a chat project (folder) is deleted
4
+ * Chat module listens to this event and clears folderId from all chats
5
+ */
6
+ export interface FolderDeletedEventPayload {
7
+ folderId: string;
8
+ userId: string;
9
+ occurredAt: Date;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from './folder-deleted.event';
@@ -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("./folder-deleted.event"), exports);
@@ -2,3 +2,4 @@ export * from './chat-project.errors';
2
2
  export * from './schemas';
3
3
  export * from './commands';
4
4
  export * from './queries';
5
+ export * from './events';
@@ -18,3 +18,4 @@ __exportStar(require("./chat-project.errors"), exports);
18
18
  __exportStar(require("./schemas"), exports);
19
19
  __exportStar(require("./commands"), exports);
20
20
  __exportStar(require("./queries"), exports);
21
+ __exportStar(require("./events"), exports);
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Get Project Chats Query
5
+ * GET /api/v1/chat-projects/:uuid/chats
6
+ */
7
+ export declare namespace ChatProjectGetChatsQuery {
8
+ const Request: z.ZodObject<{
9
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
10
+ cursor: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ const Response: z.ZodObject<{
13
+ chats: z.ZodArray<z.ZodObject<{
14
+ id: z.ZodString;
15
+ title: z.ZodString;
16
+ lastMessageAt: z.ZodString;
17
+ pageId: z.ZodNullable<z.ZodString>;
18
+ }, z.core.$strip>>;
19
+ nextCursor: z.ZodNullable<z.ZodString>;
20
+ hasMore: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ const URL: (uuid: string) => string;
23
+ const METHOD = HttpMethod.GET;
24
+ type RequestType = z.infer<typeof Request>;
25
+ type ResponseType = z.infer<typeof Response>;
26
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatProjectGetChatsQuery = void 0;
4
+ const schemas_1 = require("../schemas");
5
+ const rest_api_1 = require("../../../rest-api");
6
+ const http_method_1 = require("../../../shared/http-method");
7
+ /**
8
+ * Get Project Chats Query
9
+ * GET /api/v1/chat-projects/:uuid/chats
10
+ */
11
+ var ChatProjectGetChatsQuery;
12
+ (function (ChatProjectGetChatsQuery) {
13
+ ChatProjectGetChatsQuery.Request = schemas_1.GetProjectChatsRequestSchema;
14
+ ChatProjectGetChatsQuery.Response = schemas_1.GetProjectChatsResponseSchema;
15
+ ChatProjectGetChatsQuery.URL = (uuid) => rest_api_1.REST_API.V1.CHAT_PROJECT.GET_CHATS(uuid);
16
+ ChatProjectGetChatsQuery.METHOD = http_method_1.HttpMethod.GET;
17
+ })(ChatProjectGetChatsQuery || (exports.ChatProjectGetChatsQuery = ChatProjectGetChatsQuery = {}));
@@ -1,2 +1,3 @@
1
1
  export * from './get-project.query';
2
2
  export * from './get-projects.query';
3
+ export * from './get-project-chats.query';
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-project.query"), exports);
18
18
  __exportStar(require("./get-projects.query"), exports);
19
+ __exportStar(require("./get-project-chats.query"), exports);
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Project Chat Item Schema
4
+ */
5
+ export declare const ProjectChatItemSchema: z.ZodObject<{
6
+ id: z.ZodString;
7
+ title: z.ZodString;
8
+ lastMessageAt: z.ZodString;
9
+ pageId: z.ZodNullable<z.ZodString>;
10
+ }, z.core.$strip>;
11
+ export type ProjectChatItemDto = z.infer<typeof ProjectChatItemSchema>;
12
+ /**
13
+ * Get Project Chats Request Schema
14
+ */
15
+ export declare const GetProjectChatsRequestSchema: z.ZodObject<{
16
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
17
+ cursor: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type GetProjectChatsRequestDto = z.infer<typeof GetProjectChatsRequestSchema>;
20
+ /**
21
+ * Get Project Chats Response Schema
22
+ */
23
+ export declare const GetProjectChatsResponseSchema: z.ZodObject<{
24
+ chats: z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ title: z.ZodString;
27
+ lastMessageAt: z.ZodString;
28
+ pageId: z.ZodNullable<z.ZodString>;
29
+ }, z.core.$strip>>;
30
+ nextCursor: z.ZodNullable<z.ZodString>;
31
+ hasMore: z.ZodBoolean;
32
+ }, z.core.$strip>;
33
+ export type GetProjectChatsResponseDto = z.infer<typeof GetProjectChatsResponseSchema>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetProjectChatsResponseSchema = exports.GetProjectChatsRequestSchema = exports.ProjectChatItemSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Project Chat Item Schema
7
+ */
8
+ exports.ProjectChatItemSchema = zod_1.z.object({
9
+ id: zod_1.z.string().uuid(),
10
+ title: zod_1.z.string(),
11
+ lastMessageAt: zod_1.z.string().datetime(),
12
+ pageId: zod_1.z.string().uuid().nullable(),
13
+ });
14
+ /**
15
+ * Get Project Chats Request Schema
16
+ */
17
+ exports.GetProjectChatsRequestSchema = zod_1.z.object({
18
+ limit: zod_1.z.coerce.number().int().min(1).max(100).default(20),
19
+ cursor: zod_1.z.string().optional(),
20
+ });
21
+ /**
22
+ * Get Project Chats Response Schema
23
+ */
24
+ exports.GetProjectChatsResponseSchema = zod_1.z.object({
25
+ chats: zod_1.z.array(exports.ProjectChatItemSchema),
26
+ nextCursor: zod_1.z.string().nullable(),
27
+ hasMore: zod_1.z.boolean(),
28
+ });
@@ -3,3 +3,4 @@ export * from './create-project-request.schema';
3
3
  export * from './update-project-request.schema';
4
4
  export * from './project-response.schema';
5
5
  export * from './route-params.schema';
6
+ export * from './get-project-chats.schema';
@@ -19,3 +19,4 @@ __exportStar(require("./create-project-request.schema"), exports);
19
19
  __exportStar(require("./update-project-request.schema"), exports);
20
20
  __exportStar(require("./project-response.schema"), exports);
21
21
  __exportStar(require("./route-params.schema"), exports);
22
+ __exportStar(require("./get-project-chats.schema"), exports);
@@ -1 +1,3 @@
1
1
  export { CreateMessageCommand } from './create-message.command';
2
+ export { RateMessageRegCommand } from './rate-message-reg.command';
3
+ export { RateMessageUnregCommand } from './rate-message-unreg.command';
@@ -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
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",