@veruna/api-contracts 1.0.34 → 1.0.35

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 (42) hide show
  1. package/build/controllers/chat.controllers.d.ts +1 -0
  2. package/build/controllers/chat.controllers.js +2 -1
  3. package/build/controllers/index.d.ts +2 -2
  4. package/build/controllers/index.js +3 -1
  5. package/build/controllers/message.controllers.d.ts +1 -0
  6. package/build/controllers/message.controllers.js +2 -1
  7. package/build/rest-api.d.ts +11 -1
  8. package/build/rest-api.js +11 -1
  9. package/build/routes/chat.routes.d.ts +7 -0
  10. package/build/routes/chat.routes.js +8 -1
  11. package/build/routes/index.d.ts +2 -2
  12. package/build/routes/index.js +3 -1
  13. package/build/routes/message.routes.d.ts +3 -0
  14. package/build/routes/message.routes.js +4 -1
  15. package/build/v1/chat/chat.errors.d.ts +3 -1
  16. package/build/v1/chat/chat.errors.js +10 -0
  17. package/build/v1/chat/commands/create-reg-chat.command.d.ts +43 -0
  18. package/build/v1/chat/commands/create-reg-chat.command.js +18 -0
  19. package/build/v1/chat/commands/delete-chat.command.d.ts +16 -0
  20. package/build/v1/chat/commands/delete-chat.command.js +18 -0
  21. package/build/v1/chat/commands/index.d.ts +3 -0
  22. package/build/v1/chat/commands/index.js +7 -1
  23. package/build/v1/chat/commands/update-chat-title.command.d.ts +45 -0
  24. package/build/v1/chat/commands/update-chat-title.command.js +17 -0
  25. package/build/v1/chat/queries/get-last-active-chat.query.d.ts +43 -0
  26. package/build/v1/chat/queries/get-last-active-chat.query.js +18 -0
  27. package/build/v1/chat/queries/get-reg-chat.query.d.ts +43 -0
  28. package/build/v1/chat/queries/get-reg-chat.query.js +18 -0
  29. package/build/v1/chat/queries/index.d.ts +2 -0
  30. package/build/v1/chat/queries/index.js +5 -1
  31. package/build/v1/chat/schemas/chat-id-param.schema.d.ts +5 -0
  32. package/build/v1/chat/schemas/chat-id-param.schema.js +7 -0
  33. package/build/v1/chat/schemas/delete-chat-response.schema.d.ts +5 -0
  34. package/build/v1/chat/schemas/delete-chat-response.schema.js +7 -0
  35. package/build/v1/chat/schemas/index.d.ts +6 -0
  36. package/build/v1/chat/schemas/index.js +7 -1
  37. package/build/v1/chat/schemas/update-chat-title-request.schema.d.ts +5 -0
  38. package/build/v1/chat/schemas/update-chat-title-request.schema.js +7 -0
  39. package/build/v1/message/commands/create-message.command.js +1 -1
  40. package/build/v1/message/message.errors.d.ts +1 -0
  41. package/build/v1/message/message.errors.js +5 -0
  42. package/package.json +1 -1
@@ -2,3 +2,4 @@
2
2
  * Chat Controller paths for NestJS @Controller decorator
3
3
  */
4
4
  export declare const CHAT_UNREG_CONTROLLER: "v1/unreg/page/:pageId/chat";
5
+ export declare const CHAT_REG_CONTROLLER: "v1/page/:pageId/chat";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHAT_UNREG_CONTROLLER = void 0;
3
+ exports.CHAT_REG_CONTROLLER = exports.CHAT_UNREG_CONTROLLER = void 0;
4
4
  /**
5
5
  * Chat Controller paths for NestJS @Controller decorator
6
6
  */
7
7
  exports.CHAT_UNREG_CONTROLLER = 'v1/unreg/page/:pageId/chat';
8
+ exports.CHAT_REG_CONTROLLER = 'v1/page/:pageId/chat';
@@ -10,6 +10,6 @@ export { AI_PROVIDER_ADMIN_CONTROLLER, AI_PROVIDER_PUBLIC_CONTROLLER, } from './
10
10
  export { AI_MODEL_ADMIN_CONTROLLER, AI_MODEL_PUBLIC_CONTROLLER } from './ai-model.controllers';
11
11
  export { FILE_CONTROLLER } from './file.controllers';
12
12
  export { CHAT_PROJECT_CONTROLLER } from './chat-project.controllers';
13
- export { CHAT_UNREG_CONTROLLER } from './chat.controllers';
14
- export { MESSAGE_UNREG_CONTROLLER } from './message.controllers';
13
+ export { CHAT_UNREG_CONTROLLER, CHAT_REG_CONTROLLER } from './chat.controllers';
14
+ export { MESSAGE_UNREG_CONTROLLER, MESSAGE_REG_CONTROLLER } from './message.controllers';
15
15
  export { VERIFICATION_CONTROLLER } from './verification.controllers';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERIFICATION_CONTROLLER = exports.MESSAGE_UNREG_CONTROLLER = exports.CHAT_UNREG_CONTROLLER = exports.CHAT_PROJECT_CONTROLLER = exports.FILE_CONTROLLER = exports.AI_MODEL_PUBLIC_CONTROLLER = exports.AI_MODEL_ADMIN_CONTROLLER = exports.AI_PROVIDER_PUBLIC_CONTROLLER = exports.AI_PROVIDER_ADMIN_CONTROLLER = exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
3
+ exports.VERIFICATION_CONTROLLER = exports.MESSAGE_REG_CONTROLLER = exports.MESSAGE_UNREG_CONTROLLER = exports.CHAT_REG_CONTROLLER = exports.CHAT_UNREG_CONTROLLER = exports.CHAT_PROJECT_CONTROLLER = exports.FILE_CONTROLLER = exports.AI_MODEL_PUBLIC_CONTROLLER = exports.AI_MODEL_ADMIN_CONTROLLER = exports.AI_PROVIDER_PUBLIC_CONTROLLER = exports.AI_PROVIDER_ADMIN_CONTROLLER = exports.SEO_PAGES_PUBLIC_CONTROLLER = exports.SEO_PAGES_ADMIN_CONTROLLER = exports.BLOG_PUBLIC_POSTS_CONTROLLER = exports.BLOG_PUBLIC_CATEGORIES_CONTROLLER = exports.BLOG_ADMIN_POSTS_CONTROLLER = exports.BLOG_ADMIN_CATEGORIES_CONTROLLER = exports.UNREG_USERS_CONTROLLER = exports.USERS_CONTROLLER = exports.AUTH_CONTROLLER = void 0;
4
4
  /**
5
5
  * Centralized exports for all controllers
6
6
  */
@@ -30,7 +30,9 @@ var chat_project_controllers_1 = require("./chat-project.controllers");
30
30
  Object.defineProperty(exports, "CHAT_PROJECT_CONTROLLER", { enumerable: true, get: function () { return chat_project_controllers_1.CHAT_PROJECT_CONTROLLER; } });
31
31
  var chat_controllers_1 = require("./chat.controllers");
32
32
  Object.defineProperty(exports, "CHAT_UNREG_CONTROLLER", { enumerable: true, get: function () { return chat_controllers_1.CHAT_UNREG_CONTROLLER; } });
33
+ Object.defineProperty(exports, "CHAT_REG_CONTROLLER", { enumerable: true, get: function () { return chat_controllers_1.CHAT_REG_CONTROLLER; } });
33
34
  var message_controllers_1 = require("./message.controllers");
34
35
  Object.defineProperty(exports, "MESSAGE_UNREG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_UNREG_CONTROLLER; } });
36
+ Object.defineProperty(exports, "MESSAGE_REG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_REG_CONTROLLER; } });
35
37
  var verification_controllers_1 = require("./verification.controllers");
36
38
  Object.defineProperty(exports, "VERIFICATION_CONTROLLER", { enumerable: true, get: function () { return verification_controllers_1.VERIFICATION_CONTROLLER; } });
@@ -1 +1,2 @@
1
1
  export declare const MESSAGE_UNREG_CONTROLLER: "v1/unreg/page/:pageId/chat/:chatId/message";
2
+ export declare const MESSAGE_REG_CONTROLLER: "v1/page/:pageId/chat/:chatId/message";
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGE_UNREG_CONTROLLER = void 0;
3
+ exports.MESSAGE_REG_CONTROLLER = exports.MESSAGE_UNREG_CONTROLLER = void 0;
4
4
  exports.MESSAGE_UNREG_CONTROLLER = 'v1/unreg/page/:pageId/chat/:chatId/message';
5
+ exports.MESSAGE_REG_CONTROLLER = 'v1/page/:pageId/chat/:chatId/message';
@@ -127,10 +127,20 @@ export declare const REST_API: {
127
127
  readonly GET: (pageId: string) => string;
128
128
  readonly CREATE: (pageId: string) => string;
129
129
  };
130
+ readonly REG: {
131
+ readonly CREATE: (pageId: string) => string;
132
+ readonly GET_LAST_ACTIVE: (pageId: string) => string;
133
+ readonly GET_BY_ID: (pageId: string, chatId: string) => string;
134
+ readonly DELETE: (pageId: string, chatId: string) => string;
135
+ readonly UPDATE_TITLE: (pageId: string, chatId: string) => string;
136
+ };
130
137
  };
131
138
  readonly MESSAGE: {
132
139
  readonly UNREG: {
133
- readonly CREATE: (pageId: string, chatId: string) => string;
140
+ readonly SEND: (pageId: string, chatId: string) => string;
141
+ };
142
+ readonly REG: {
143
+ readonly SEND: (pageId: string, chatId: string) => string;
134
144
  };
135
145
  };
136
146
  readonly VERIFICATION: {
package/build/rest-api.js CHANGED
@@ -144,10 +144,20 @@ exports.REST_API = {
144
144
  GET: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_UNREG_CONTROLLER.replace(':pageId', pageId)}`,
145
145
  CREATE: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_UNREG_CONTROLLER.replace(':pageId', pageId)}`,
146
146
  },
147
+ REG: {
148
+ CREATE: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}`,
149
+ GET_LAST_ACTIVE: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/last-active`,
150
+ GET_BY_ID: (pageId, chatId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/${chatId}`,
151
+ DELETE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/${chatId}`,
152
+ UPDATE_TITLE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/${chatId}`,
153
+ },
147
154
  },
148
155
  MESSAGE: {
149
156
  UNREG: {
150
- CREATE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
157
+ SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
158
+ },
159
+ REG: {
160
+ SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
151
161
  },
152
162
  },
153
163
  VERIFICATION: {
@@ -5,3 +5,10 @@ export declare const CHAT_UNREG_ROUTES: {
5
5
  readonly GET: "";
6
6
  readonly CREATE: "";
7
7
  };
8
+ export declare const CHAT_REG_ROUTES: {
9
+ readonly CREATE: "";
10
+ readonly GET_LAST_ACTIVE: "last-active";
11
+ readonly GET_BY_ID: ":chatId";
12
+ readonly DELETE: ":chatId";
13
+ readonly UPDATE_TITLE: ":chatId";
14
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CHAT_UNREG_ROUTES = void 0;
3
+ exports.CHAT_REG_ROUTES = exports.CHAT_UNREG_ROUTES = void 0;
4
4
  /**
5
5
  * Chat Routes
6
6
  */
@@ -8,3 +8,10 @@ exports.CHAT_UNREG_ROUTES = {
8
8
  GET: '',
9
9
  CREATE: '',
10
10
  };
11
+ exports.CHAT_REG_ROUTES = {
12
+ CREATE: '',
13
+ GET_LAST_ACTIVE: 'last-active',
14
+ GET_BY_ID: ':chatId',
15
+ DELETE: ':chatId',
16
+ UPDATE_TITLE: ':chatId',
17
+ };
@@ -15,6 +15,6 @@ export { AI_MODEL_ADMIN_ROUTES } from './ai-model-admin.routes';
15
15
  export { AI_MODEL_PUBLIC_ROUTES } from './ai-model-public.routes';
16
16
  export { FILE_ROUTES } from './file.routes';
17
17
  export { CHAT_PROJECT_ROUTES } from './chat-project.routes';
18
- export { CHAT_UNREG_ROUTES } from './chat.routes';
19
- export { MESSAGE_UNREG_ROUTES } from './message.routes';
18
+ export { CHAT_UNREG_ROUTES, CHAT_REG_ROUTES } from './chat.routes';
19
+ export { MESSAGE_UNREG_ROUTES, MESSAGE_REG_ROUTES } from './message.routes';
20
20
  export { VERIFICATION_ROUTES } from './verification.routes';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VERIFICATION_ROUTES = exports.MESSAGE_UNREG_ROUTES = exports.CHAT_UNREG_ROUTES = exports.CHAT_PROJECT_ROUTES = exports.FILE_ROUTES = exports.AI_MODEL_PUBLIC_ROUTES = exports.AI_MODEL_ADMIN_ROUTES = exports.AI_PROVIDER_PUBLIC_ROUTES = exports.AI_PROVIDER_ADMIN_ROUTES = exports.SEO_PAGES_PUBLIC_ROUTES = exports.SEO_PAGES_ADMIN_ROUTES = exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
3
+ exports.VERIFICATION_ROUTES = exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = exports.CHAT_REG_ROUTES = exports.CHAT_UNREG_ROUTES = exports.CHAT_PROJECT_ROUTES = exports.FILE_ROUTES = exports.AI_MODEL_PUBLIC_ROUTES = exports.AI_MODEL_ADMIN_ROUTES = exports.AI_PROVIDER_PUBLIC_ROUTES = exports.AI_PROVIDER_ADMIN_ROUTES = exports.SEO_PAGES_PUBLIC_ROUTES = exports.SEO_PAGES_ADMIN_ROUTES = exports.BLOG_PUBLIC_POSTS_ROUTES = exports.BLOG_PUBLIC_CATEGORIES_ROUTES = exports.BLOG_ADMIN_POSTS_ROUTES = exports.BLOG_ADMIN_CATEGORIES_ROUTES = exports.UNREG_USERS_ROUTES = exports.USERS_ROUTES = exports.AUTH_ROUTES = void 0;
4
4
  /**
5
5
  * Centralized exports for all routes
6
6
  */
@@ -35,7 +35,9 @@ var chat_project_routes_1 = require("./chat-project.routes");
35
35
  Object.defineProperty(exports, "CHAT_PROJECT_ROUTES", { enumerable: true, get: function () { return chat_project_routes_1.CHAT_PROJECT_ROUTES; } });
36
36
  var chat_routes_1 = require("./chat.routes");
37
37
  Object.defineProperty(exports, "CHAT_UNREG_ROUTES", { enumerable: true, get: function () { return chat_routes_1.CHAT_UNREG_ROUTES; } });
38
+ Object.defineProperty(exports, "CHAT_REG_ROUTES", { enumerable: true, get: function () { return chat_routes_1.CHAT_REG_ROUTES; } });
38
39
  var message_routes_1 = require("./message.routes");
39
40
  Object.defineProperty(exports, "MESSAGE_UNREG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_UNREG_ROUTES; } });
41
+ Object.defineProperty(exports, "MESSAGE_REG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_REG_ROUTES; } });
40
42
  var verification_routes_1 = require("./verification.routes");
41
43
  Object.defineProperty(exports, "VERIFICATION_ROUTES", { enumerable: true, get: function () { return verification_routes_1.VERIFICATION_ROUTES; } });
@@ -1,3 +1,6 @@
1
1
  export declare const MESSAGE_UNREG_ROUTES: {
2
2
  readonly SEND: "";
3
3
  };
4
+ export declare const MESSAGE_REG_ROUTES: {
5
+ readonly SEND: "";
6
+ };
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MESSAGE_UNREG_ROUTES = void 0;
3
+ exports.MESSAGE_REG_ROUTES = exports.MESSAGE_UNREG_ROUTES = void 0;
4
4
  exports.MESSAGE_UNREG_ROUTES = {
5
5
  SEND: '',
6
6
  };
7
+ exports.MESSAGE_REG_ROUTES = {
8
+ SEND: '',
9
+ };
@@ -2,6 +2,8 @@ import { ErrorMetadata } from '../../shared';
2
2
  export declare enum ChatErrorCode {
3
3
  PAGE_NOT_FOUND = "PAGE_NOT_FOUND",
4
4
  PAGE_ID_REQUIRED = "PAGE_ID_REQUIRED",
5
- CHAT_NOT_FOUND = "CHAT_NOT_FOUND"
5
+ CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
6
+ CHAT_ALREADY_DELETED = "CHAT_ALREADY_DELETED",
7
+ TITLE_REQUIRED = "TITLE_REQUIRED"
6
8
  }
7
9
  export declare const CHAT_ERRORS: Record<ChatErrorCode, ErrorMetadata>;
@@ -6,6 +6,8 @@ var ChatErrorCode;
6
6
  ChatErrorCode["PAGE_NOT_FOUND"] = "PAGE_NOT_FOUND";
7
7
  ChatErrorCode["PAGE_ID_REQUIRED"] = "PAGE_ID_REQUIRED";
8
8
  ChatErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
9
+ ChatErrorCode["CHAT_ALREADY_DELETED"] = "CHAT_ALREADY_DELETED";
10
+ ChatErrorCode["TITLE_REQUIRED"] = "TITLE_REQUIRED";
9
11
  })(ChatErrorCode || (exports.ChatErrorCode = ChatErrorCode = {}));
10
12
  exports.CHAT_ERRORS = {
11
13
  [ChatErrorCode.PAGE_NOT_FOUND]: {
@@ -20,4 +22,12 @@ exports.CHAT_ERRORS = {
20
22
  code: ChatErrorCode.CHAT_NOT_FOUND,
21
23
  statusCode: 404,
22
24
  },
25
+ [ChatErrorCode.CHAT_ALREADY_DELETED]: {
26
+ code: ChatErrorCode.CHAT_ALREADY_DELETED,
27
+ statusCode: 400,
28
+ },
29
+ [ChatErrorCode.TITLE_REQUIRED]: {
30
+ code: ChatErrorCode.TITLE_REQUIRED,
31
+ statusCode: 400,
32
+ },
23
33
  };
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Create Reg Chat Command
5
+ * POST /api/v1/page/:pageId/chat
6
+ */
7
+ export declare namespace CreateRegChatCommand {
8
+ const Request: z.ZodObject<{}, z.core.$strip>;
9
+ const Response: z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ title: z.ZodString;
12
+ status: z.ZodEnum<typeof import("../schemas").ChatStatus>;
13
+ pageId: z.ZodNullable<z.ZodString>;
14
+ folderId: z.ZodNullable<z.ZodString>;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ messages: z.ZodArray<z.ZodObject<{
18
+ uuid: z.ZodString;
19
+ role: z.ZodEnum<typeof import("../..").MessageRole>;
20
+ status: z.ZodEnum<typeof import("../..").MessageStatus>;
21
+ content: z.ZodString;
22
+ aiModelId: z.ZodNullable<z.ZodString>;
23
+ userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
24
+ meta: z.ZodNullable<z.ZodObject<{
25
+ reasoning: z.ZodOptional<z.ZodObject<{
26
+ content: z.ZodString;
27
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ type: z.ZodString;
29
+ text: z.ZodString;
30
+ format: z.ZodOptional<z.ZodString>;
31
+ index: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strip>>>;
33
+ }, z.core.$strip>>;
34
+ }, z.core.$strip>>;
35
+ createdAt: z.ZodString;
36
+ updatedAt: z.ZodString;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>;
39
+ const URL: (pageId: string) => string;
40
+ const METHOD = HttpMethod.POST;
41
+ type RequestType = z.infer<typeof Request>;
42
+ type ResponseType = z.infer<typeof Response>;
43
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateRegChatCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../schemas");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ /**
9
+ * Create Reg Chat Command
10
+ * POST /api/v1/page/:pageId/chat
11
+ */
12
+ var CreateRegChatCommand;
13
+ (function (CreateRegChatCommand) {
14
+ CreateRegChatCommand.Request = zod_1.z.object({});
15
+ CreateRegChatCommand.Response = schemas_1.ChatWithMessagesResponseSchema;
16
+ CreateRegChatCommand.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.REG.CREATE(pageId);
17
+ CreateRegChatCommand.METHOD = http_method_1.HttpMethod.POST;
18
+ })(CreateRegChatCommand || (exports.CreateRegChatCommand = CreateRegChatCommand = {}));
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Delete Chat Command
5
+ * DELETE /api/v1/page/:pageId/chat/:chatId
6
+ */
7
+ export declare namespace DeleteChatCommand {
8
+ const Request: z.ZodObject<{}, z.core.$strip>;
9
+ const Response: z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ }, z.core.$strip>;
12
+ const URL: (pageId: string, chatId: string) => string;
13
+ const METHOD = HttpMethod.DELETE;
14
+ type RequestType = z.infer<typeof Request>;
15
+ type ResponseType = z.infer<typeof Response>;
16
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteChatCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../schemas");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ /**
9
+ * Delete Chat Command
10
+ * DELETE /api/v1/page/:pageId/chat/:chatId
11
+ */
12
+ var DeleteChatCommand;
13
+ (function (DeleteChatCommand) {
14
+ DeleteChatCommand.Request = zod_1.z.object({});
15
+ DeleteChatCommand.Response = schemas_1.DeleteChatResponseSchema;
16
+ DeleteChatCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.CHAT.REG.DELETE(pageId, chatId);
17
+ DeleteChatCommand.METHOD = http_method_1.HttpMethod.DELETE;
18
+ })(DeleteChatCommand || (exports.DeleteChatCommand = DeleteChatCommand = {}));
@@ -1 +1,4 @@
1
1
  export { CreateUnregChatCommand } from './create-unreg-chat.command';
2
+ export { CreateRegChatCommand } from './create-reg-chat.command';
3
+ export { DeleteChatCommand } from './delete-chat.command';
4
+ export { UpdateChatTitleCommand } from './update-chat-title.command';
@@ -1,5 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateUnregChatCommand = void 0;
3
+ 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
+ var create_reg_chat_command_1 = require("./create-reg-chat.command");
7
+ Object.defineProperty(exports, "CreateRegChatCommand", { enumerable: true, get: function () { return create_reg_chat_command_1.CreateRegChatCommand; } });
8
+ var delete_chat_command_1 = require("./delete-chat.command");
9
+ Object.defineProperty(exports, "DeleteChatCommand", { enumerable: true, get: function () { return delete_chat_command_1.DeleteChatCommand; } });
10
+ var update_chat_title_command_1 = require("./update-chat-title.command");
11
+ Object.defineProperty(exports, "UpdateChatTitleCommand", { enumerable: true, get: function () { return update_chat_title_command_1.UpdateChatTitleCommand; } });
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Update Chat Title Command
5
+ * PATCH /api/v1/page/:pageId/chat/:chatId
6
+ */
7
+ export declare namespace UpdateChatTitleCommand {
8
+ const Request: z.ZodObject<{
9
+ title: z.ZodString;
10
+ }, z.core.$strip>;
11
+ const Response: z.ZodObject<{
12
+ uuid: z.ZodString;
13
+ title: z.ZodString;
14
+ status: z.ZodEnum<typeof import("../schemas").ChatStatus>;
15
+ pageId: z.ZodNullable<z.ZodString>;
16
+ folderId: z.ZodNullable<z.ZodString>;
17
+ createdAt: z.ZodString;
18
+ updatedAt: z.ZodString;
19
+ messages: z.ZodArray<z.ZodObject<{
20
+ uuid: z.ZodString;
21
+ role: z.ZodEnum<typeof import("../..").MessageRole>;
22
+ status: z.ZodEnum<typeof import("../..").MessageStatus>;
23
+ content: z.ZodString;
24
+ aiModelId: z.ZodNullable<z.ZodString>;
25
+ userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
26
+ meta: z.ZodNullable<z.ZodObject<{
27
+ reasoning: z.ZodOptional<z.ZodObject<{
28
+ content: z.ZodString;
29
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ type: z.ZodString;
31
+ text: z.ZodString;
32
+ format: z.ZodOptional<z.ZodString>;
33
+ index: z.ZodOptional<z.ZodNumber>;
34
+ }, z.core.$strip>>>;
35
+ }, z.core.$strip>>;
36
+ }, z.core.$strip>>;
37
+ createdAt: z.ZodString;
38
+ updatedAt: z.ZodString;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ const URL: (pageId: string, chatId: string) => string;
42
+ const METHOD = HttpMethod.PATCH;
43
+ type RequestType = z.infer<typeof Request>;
44
+ type ResponseType = z.infer<typeof Response>;
45
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateChatTitleCommand = 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 Title Command
9
+ * PATCH /api/v1/page/:pageId/chat/:chatId
10
+ */
11
+ var UpdateChatTitleCommand;
12
+ (function (UpdateChatTitleCommand) {
13
+ UpdateChatTitleCommand.Request = schemas_1.UpdateChatTitleRequestSchema;
14
+ UpdateChatTitleCommand.Response = schemas_1.ChatWithMessagesResponseSchema;
15
+ UpdateChatTitleCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.CHAT.REG.UPDATE_TITLE(pageId, chatId);
16
+ UpdateChatTitleCommand.METHOD = http_method_1.HttpMethod.PATCH;
17
+ })(UpdateChatTitleCommand || (exports.UpdateChatTitleCommand = UpdateChatTitleCommand = {}));
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Get Last Active Chat Query
5
+ * GET /api/v1/page/:pageId/chat/last-active
6
+ */
7
+ export declare namespace GetLastActiveChatQuery {
8
+ const Request: z.ZodObject<{}, z.core.$strip>;
9
+ const Response: z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ title: z.ZodString;
12
+ status: z.ZodEnum<typeof import("../schemas").ChatStatus>;
13
+ pageId: z.ZodNullable<z.ZodString>;
14
+ folderId: z.ZodNullable<z.ZodString>;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ messages: z.ZodArray<z.ZodObject<{
18
+ uuid: z.ZodString;
19
+ role: z.ZodEnum<typeof import("../..").MessageRole>;
20
+ status: z.ZodEnum<typeof import("../..").MessageStatus>;
21
+ content: z.ZodString;
22
+ aiModelId: z.ZodNullable<z.ZodString>;
23
+ userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
24
+ meta: z.ZodNullable<z.ZodObject<{
25
+ reasoning: z.ZodOptional<z.ZodObject<{
26
+ content: z.ZodString;
27
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ type: z.ZodString;
29
+ text: z.ZodString;
30
+ format: z.ZodOptional<z.ZodString>;
31
+ index: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strip>>>;
33
+ }, z.core.$strip>>;
34
+ }, z.core.$strip>>;
35
+ createdAt: z.ZodString;
36
+ updatedAt: z.ZodString;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>;
39
+ const URL: (pageId: string) => string;
40
+ const METHOD = HttpMethod.GET;
41
+ type RequestType = z.infer<typeof Request>;
42
+ type ResponseType = z.infer<typeof Response>;
43
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetLastActiveChatQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../schemas");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ /**
9
+ * Get Last Active Chat Query
10
+ * GET /api/v1/page/:pageId/chat/last-active
11
+ */
12
+ var GetLastActiveChatQuery;
13
+ (function (GetLastActiveChatQuery) {
14
+ GetLastActiveChatQuery.Request = zod_1.z.object({});
15
+ GetLastActiveChatQuery.Response = schemas_1.ChatWithMessagesResponseSchema;
16
+ GetLastActiveChatQuery.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.REG.GET_LAST_ACTIVE(pageId);
17
+ GetLastActiveChatQuery.METHOD = http_method_1.HttpMethod.GET;
18
+ })(GetLastActiveChatQuery || (exports.GetLastActiveChatQuery = GetLastActiveChatQuery = {}));
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import { HttpMethod } from '../../../shared/http-method';
3
+ /**
4
+ * Get Reg Chat Query
5
+ * GET /api/v1/page/:pageId/chat/:chatId
6
+ */
7
+ export declare namespace GetRegChatQuery {
8
+ const Request: z.ZodObject<{}, z.core.$strip>;
9
+ const Response: z.ZodObject<{
10
+ uuid: z.ZodString;
11
+ title: z.ZodString;
12
+ status: z.ZodEnum<typeof import("../schemas").ChatStatus>;
13
+ pageId: z.ZodNullable<z.ZodString>;
14
+ folderId: z.ZodNullable<z.ZodString>;
15
+ createdAt: z.ZodString;
16
+ updatedAt: z.ZodString;
17
+ messages: z.ZodArray<z.ZodObject<{
18
+ uuid: z.ZodString;
19
+ role: z.ZodEnum<typeof import("../..").MessageRole>;
20
+ status: z.ZodEnum<typeof import("../..").MessageStatus>;
21
+ content: z.ZodString;
22
+ aiModelId: z.ZodNullable<z.ZodString>;
23
+ userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
24
+ meta: z.ZodNullable<z.ZodObject<{
25
+ reasoning: z.ZodOptional<z.ZodObject<{
26
+ content: z.ZodString;
27
+ details: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ type: z.ZodString;
29
+ text: z.ZodString;
30
+ format: z.ZodOptional<z.ZodString>;
31
+ index: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strip>>>;
33
+ }, z.core.$strip>>;
34
+ }, z.core.$strip>>;
35
+ createdAt: z.ZodString;
36
+ updatedAt: z.ZodString;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>;
39
+ const URL: (pageId: string, chatId: string) => string;
40
+ const METHOD = HttpMethod.GET;
41
+ type RequestType = z.infer<typeof Request>;
42
+ type ResponseType = z.infer<typeof Response>;
43
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetRegChatQuery = void 0;
4
+ const zod_1 = require("zod");
5
+ const schemas_1 = require("../schemas");
6
+ const rest_api_1 = require("../../../rest-api");
7
+ const http_method_1 = require("../../../shared/http-method");
8
+ /**
9
+ * Get Reg Chat Query
10
+ * GET /api/v1/page/:pageId/chat/:chatId
11
+ */
12
+ var GetRegChatQuery;
13
+ (function (GetRegChatQuery) {
14
+ GetRegChatQuery.Request = zod_1.z.object({});
15
+ GetRegChatQuery.Response = schemas_1.ChatWithMessagesResponseSchema;
16
+ GetRegChatQuery.URL = (pageId, chatId) => rest_api_1.REST_API.V1.CHAT.REG.GET_BY_ID(pageId, chatId);
17
+ GetRegChatQuery.METHOD = http_method_1.HttpMethod.GET;
18
+ })(GetRegChatQuery || (exports.GetRegChatQuery = GetRegChatQuery = {}));
@@ -1 +1,3 @@
1
1
  export { GetUnregChatQuery } from './get-unreg-chat.query';
2
+ export { GetRegChatQuery } from './get-reg-chat.query';
3
+ export { GetLastActiveChatQuery } from './get-last-active-chat.query';
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetUnregChatQuery = void 0;
3
+ exports.GetLastActiveChatQuery = exports.GetRegChatQuery = exports.GetUnregChatQuery = void 0;
4
4
  var get_unreg_chat_query_1 = require("./get-unreg-chat.query");
5
5
  Object.defineProperty(exports, "GetUnregChatQuery", { enumerable: true, get: function () { return get_unreg_chat_query_1.GetUnregChatQuery; } });
6
+ var get_reg_chat_query_1 = require("./get-reg-chat.query");
7
+ Object.defineProperty(exports, "GetRegChatQuery", { enumerable: true, get: function () { return get_reg_chat_query_1.GetRegChatQuery; } });
8
+ var get_last_active_chat_query_1 = require("./get-last-active-chat.query");
9
+ Object.defineProperty(exports, "GetLastActiveChatQuery", { enumerable: true, get: function () { return get_last_active_chat_query_1.GetLastActiveChatQuery; } });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const ChatIdParamSchema: z.ZodObject<{
3
+ chatId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export type ChatIdParamDto = z.infer<typeof ChatIdParamSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatIdParamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ChatIdParamSchema = zod_1.z.object({
6
+ chatId: zod_1.z.string().uuid(),
7
+ });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const DeleteChatResponseSchema: z.ZodObject<{
3
+ uuid: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export type DeleteChatResponseDto = z.infer<typeof DeleteChatResponseSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DeleteChatResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.DeleteChatResponseSchema = zod_1.z.object({
6
+ uuid: zod_1.z.string().uuid(),
7
+ });
@@ -3,3 +3,9 @@ export { ChatResponseSchema } from './chat-response.schema';
3
3
  export { ChatWithMessagesResponseSchema } from './chat-with-messages-response.schema';
4
4
  export { PageIdParamSchema } from './page-id-param.schema';
5
5
  export type { PageIdParamDto } from './page-id-param.schema';
6
+ export { ChatIdParamSchema } from './chat-id-param.schema';
7
+ export type { ChatIdParamDto } from './chat-id-param.schema';
8
+ export { UpdateChatTitleRequestSchema } from './update-chat-title-request.schema';
9
+ export type { UpdateChatTitleRequestDto } from './update-chat-title-request.schema';
10
+ export { DeleteChatResponseSchema } from './delete-chat-response.schema';
11
+ export type { DeleteChatResponseDto } from './delete-chat-response.schema';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageIdParamSchema = exports.ChatWithMessagesResponseSchema = exports.ChatResponseSchema = exports.ChatStatus = void 0;
3
+ exports.DeleteChatResponseSchema = 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");
@@ -9,3 +9,9 @@ var chat_with_messages_response_schema_1 = require("./chat-with-messages-respons
9
9
  Object.defineProperty(exports, "ChatWithMessagesResponseSchema", { enumerable: true, get: function () { return chat_with_messages_response_schema_1.ChatWithMessagesResponseSchema; } });
10
10
  var page_id_param_schema_1 = require("./page-id-param.schema");
11
11
  Object.defineProperty(exports, "PageIdParamSchema", { enumerable: true, get: function () { return page_id_param_schema_1.PageIdParamSchema; } });
12
+ var chat_id_param_schema_1 = require("./chat-id-param.schema");
13
+ Object.defineProperty(exports, "ChatIdParamSchema", { enumerable: true, get: function () { return chat_id_param_schema_1.ChatIdParamSchema; } });
14
+ var update_chat_title_request_schema_1 = require("./update-chat-title-request.schema");
15
+ Object.defineProperty(exports, "UpdateChatTitleRequestSchema", { enumerable: true, get: function () { return update_chat_title_request_schema_1.UpdateChatTitleRequestSchema; } });
16
+ var delete_chat_response_schema_1 = require("./delete-chat-response.schema");
17
+ Object.defineProperty(exports, "DeleteChatResponseSchema", { enumerable: true, get: function () { return delete_chat_response_schema_1.DeleteChatResponseSchema; } });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const UpdateChatTitleRequestSchema: z.ZodObject<{
3
+ title: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export type UpdateChatTitleRequestDto = z.infer<typeof UpdateChatTitleRequestSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateChatTitleRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.UpdateChatTitleRequestSchema = zod_1.z.object({
6
+ title: zod_1.z.string().min(1).max(40),
7
+ });
@@ -46,7 +46,7 @@ var CreateMessageCommand;
46
46
  CreateMessageCommand.ChunkEvent = schemas_1.StreamChunkEventSchema;
47
47
  CreateMessageCommand.DoneEvent = schemas_1.StreamDoneEventSchema;
48
48
  CreateMessageCommand.ErrorEvent = schemas_1.StreamErrorEventSchema;
49
- CreateMessageCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.MESSAGE.UNREG.CREATE(pageId, chatId);
49
+ CreateMessageCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.MESSAGE.UNREG.SEND(pageId, chatId);
50
50
  CreateMessageCommand.METHOD = http_method_1.HttpMethod.POST;
51
51
  /** Response content type */
52
52
  CreateMessageCommand.CONTENT_TYPE = 'application/x-ndjson';
@@ -3,6 +3,7 @@ export declare enum MessageErrorCode {
3
3
  CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
4
4
  CHAT_NOT_OWNED = "CHAT_NOT_OWNED",
5
5
  CHAT_DELETED = "CHAT_DELETED",
6
+ CHAT_STREAM_IN_PROGRESS = "CHAT_STREAM_IN_PROGRESS",
6
7
  INVALID_PAGE_ID = "INVALID_PAGE_ID",
7
8
  MESSAGE_TEXT_EMPTY = "MESSAGE_TEXT_EMPTY",
8
9
  MESSAGE_TEXT_TOO_LONG = "MESSAGE_TEXT_TOO_LONG",
@@ -6,6 +6,7 @@ var MessageErrorCode;
6
6
  MessageErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
7
7
  MessageErrorCode["CHAT_NOT_OWNED"] = "CHAT_NOT_OWNED";
8
8
  MessageErrorCode["CHAT_DELETED"] = "CHAT_DELETED";
9
+ MessageErrorCode["CHAT_STREAM_IN_PROGRESS"] = "CHAT_STREAM_IN_PROGRESS";
9
10
  MessageErrorCode["INVALID_PAGE_ID"] = "INVALID_PAGE_ID";
10
11
  MessageErrorCode["MESSAGE_TEXT_EMPTY"] = "MESSAGE_TEXT_EMPTY";
11
12
  MessageErrorCode["MESSAGE_TEXT_TOO_LONG"] = "MESSAGE_TEXT_TOO_LONG";
@@ -25,6 +26,10 @@ exports.MESSAGE_ERRORS = {
25
26
  code: MessageErrorCode.CHAT_DELETED,
26
27
  statusCode: 410,
27
28
  },
29
+ [MessageErrorCode.CHAT_STREAM_IN_PROGRESS]: {
30
+ code: MessageErrorCode.CHAT_STREAM_IN_PROGRESS,
31
+ statusCode: 409,
32
+ },
28
33
  [MessageErrorCode.INVALID_PAGE_ID]: {
29
34
  code: MessageErrorCode.INVALID_PAGE_ID,
30
35
  statusCode: 400,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
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",