@veruna/api-contracts 1.0.34 → 1.0.36
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/controllers/chat.controllers.d.ts +2 -0
- package/build/controllers/chat.controllers.js +3 -1
- package/build/controllers/index.d.ts +2 -2
- package/build/controllers/index.js +4 -1
- package/build/controllers/message.controllers.d.ts +1 -0
- package/build/controllers/message.controllers.js +2 -1
- package/build/rest-api.d.ts +12 -1
- package/build/rest-api.js +12 -1
- package/build/routes/chat.routes.d.ts +10 -0
- package/build/routes/chat.routes.js +11 -1
- package/build/routes/index.d.ts +2 -2
- package/build/routes/index.js +4 -1
- package/build/routes/message.routes.d.ts +3 -0
- package/build/routes/message.routes.js +4 -1
- package/build/shared/constants.d.ts +6 -0
- package/build/shared/constants.js +7 -1
- package/build/v1/chat/chat.errors.d.ts +3 -1
- package/build/v1/chat/chat.errors.js +10 -0
- package/build/v1/chat/commands/create-reg-chat.command.d.ts +43 -0
- package/build/v1/chat/commands/create-reg-chat.command.js +18 -0
- package/build/v1/chat/commands/delete-chat.command.d.ts +16 -0
- package/build/v1/chat/commands/delete-chat.command.js +18 -0
- package/build/v1/chat/commands/index.d.ts +3 -0
- package/build/v1/chat/commands/index.js +7 -1
- package/build/v1/chat/commands/update-chat-title.command.d.ts +45 -0
- package/build/v1/chat/commands/update-chat-title.command.js +17 -0
- package/build/v1/chat/queries/get-chat-history.query.d.ts +32 -0
- package/build/v1/chat/queries/get-chat-history.query.js +17 -0
- package/build/v1/chat/queries/get-last-active-chat.query.d.ts +43 -0
- package/build/v1/chat/queries/get-last-active-chat.query.js +18 -0
- package/build/v1/chat/queries/get-reg-chat.query.d.ts +43 -0
- package/build/v1/chat/queries/get-reg-chat.query.js +18 -0
- package/build/v1/chat/queries/index.d.ts +3 -0
- package/build/v1/chat/queries/index.js +7 -1
- package/build/v1/chat/schemas/chat-history.schema.d.ts +77 -0
- package/build/v1/chat/schemas/chat-history.schema.js +75 -0
- package/build/v1/chat/schemas/chat-id-param.schema.d.ts +5 -0
- package/build/v1/chat/schemas/chat-id-param.schema.js +7 -0
- package/build/v1/chat/schemas/delete-chat-response.schema.d.ts +5 -0
- package/build/v1/chat/schemas/delete-chat-response.schema.js +7 -0
- package/build/v1/chat/schemas/index.d.ts +8 -0
- package/build/v1/chat/schemas/index.js +15 -1
- package/build/v1/chat/schemas/update-chat-title-request.schema.d.ts +5 -0
- package/build/v1/chat/schemas/update-chat-title-request.schema.js +7 -0
- package/build/v1/message/commands/create-message.command.js +1 -1
- package/build/v1/message/message.errors.d.ts +1 -0
- package/build/v1/message/message.errors.js +5 -0
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHAT_UNREG_CONTROLLER = void 0;
|
|
3
|
+
exports.CHAT_HISTORY_CONTROLLER = 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';
|
|
9
|
+
exports.CHAT_HISTORY_CONTROLLER = 'v1/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, CHAT_HISTORY_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_HISTORY_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,10 @@ 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; } });
|
|
34
|
+
Object.defineProperty(exports, "CHAT_HISTORY_CONTROLLER", { enumerable: true, get: function () { return chat_controllers_1.CHAT_HISTORY_CONTROLLER; } });
|
|
33
35
|
var message_controllers_1 = require("./message.controllers");
|
|
34
36
|
Object.defineProperty(exports, "MESSAGE_UNREG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_UNREG_CONTROLLER; } });
|
|
37
|
+
Object.defineProperty(exports, "MESSAGE_REG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_REG_CONTROLLER; } });
|
|
35
38
|
var verification_controllers_1 = require("./verification.controllers");
|
|
36
39
|
Object.defineProperty(exports, "VERIFICATION_CONTROLLER", { enumerable: true, get: function () { return verification_controllers_1.VERIFICATION_CONTROLLER; } });
|
|
@@ -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';
|
package/build/rest-api.d.ts
CHANGED
|
@@ -127,10 +127,21 @@ 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
|
+
};
|
|
137
|
+
readonly HISTORY: "/api/v1/chat/history";
|
|
130
138
|
};
|
|
131
139
|
readonly MESSAGE: {
|
|
132
140
|
readonly UNREG: {
|
|
133
|
-
readonly
|
|
141
|
+
readonly SEND: (pageId: string, chatId: string) => string;
|
|
142
|
+
};
|
|
143
|
+
readonly REG: {
|
|
144
|
+
readonly SEND: (pageId: string, chatId: string) => string;
|
|
134
145
|
};
|
|
135
146
|
};
|
|
136
147
|
readonly VERIFICATION: {
|
package/build/rest-api.js
CHANGED
|
@@ -144,10 +144,21 @@ 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
|
+
},
|
|
154
|
+
HISTORY: `${exports.ROOT}/${controllers_1.CHAT_HISTORY_CONTROLLER}/${routes_1.CHAT_HISTORY_ROUTES.HISTORY}`,
|
|
147
155
|
},
|
|
148
156
|
MESSAGE: {
|
|
149
157
|
UNREG: {
|
|
150
|
-
|
|
158
|
+
SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
|
|
159
|
+
},
|
|
160
|
+
REG: {
|
|
161
|
+
SEND: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_REG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
|
|
151
162
|
},
|
|
152
163
|
},
|
|
153
164
|
VERIFICATION: {
|
|
@@ -5,3 +5,13 @@ 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
|
+
};
|
|
15
|
+
export declare const CHAT_HISTORY_ROUTES: {
|
|
16
|
+
readonly HISTORY: "history";
|
|
17
|
+
};
|
|
@@ -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_HISTORY_ROUTES = exports.CHAT_REG_ROUTES = exports.CHAT_UNREG_ROUTES = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Chat Routes
|
|
6
6
|
*/
|
|
@@ -8,3 +8,13 @@ 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
|
+
};
|
|
18
|
+
exports.CHAT_HISTORY_ROUTES = {
|
|
19
|
+
HISTORY: 'history',
|
|
20
|
+
};
|
package/build/routes/index.d.ts
CHANGED
|
@@ -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, CHAT_HISTORY_ROUTES } from './chat.routes';
|
|
19
|
+
export { MESSAGE_UNREG_ROUTES, MESSAGE_REG_ROUTES } from './message.routes';
|
|
20
20
|
export { VERIFICATION_ROUTES } from './verification.routes';
|
package/build/routes/index.js
CHANGED
|
@@ -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_HISTORY_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,10 @@ 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; } });
|
|
39
|
+
Object.defineProperty(exports, "CHAT_HISTORY_ROUTES", { enumerable: true, get: function () { return chat_routes_1.CHAT_HISTORY_ROUTES; } });
|
|
38
40
|
var message_routes_1 = require("./message.routes");
|
|
39
41
|
Object.defineProperty(exports, "MESSAGE_UNREG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_UNREG_ROUTES; } });
|
|
42
|
+
Object.defineProperty(exports, "MESSAGE_REG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_REG_ROUTES; } });
|
|
40
43
|
var verification_routes_1 = require("./verification.routes");
|
|
41
44
|
Object.defineProperty(exports, "VERIFICATION_ROUTES", { enumerable: true, get: function () { return verification_routes_1.VERIFICATION_ROUTES; } });
|
|
@@ -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
|
+
};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MESSAGE_TEXT_MAX_LENGTH = void 0;
|
|
3
|
+
exports.MS_6_DAYS = exports.MS_PER_WEEK = exports.MS_PER_DAY = exports.MESSAGE_TEXT_MAX_LENGTH = void 0;
|
|
4
4
|
exports.MESSAGE_TEXT_MAX_LENGTH = 500000;
|
|
5
|
+
/**
|
|
6
|
+
* Time constants in milliseconds
|
|
7
|
+
*/
|
|
8
|
+
exports.MS_PER_DAY = 86400000; // 24 * 60 * 60 * 1000
|
|
9
|
+
exports.MS_PER_WEEK = 604800000; // 7 * 24 * 60 * 60 * 1000
|
|
10
|
+
exports.MS_6_DAYS = 518400000; // 6 * 24 * 60 * 60 * 1000
|
|
@@ -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,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,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
/**
|
|
4
|
+
* Get Chat History Query
|
|
5
|
+
* GET /api/v1/chat/history
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace GetChatHistoryQuery {
|
|
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
|
+
periods: z.ZodArray<z.ZodObject<{
|
|
14
|
+
type: z.ZodEnum<typeof import("../schemas").ChatPeriodType>;
|
|
15
|
+
label: z.ZodString;
|
|
16
|
+
year: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
month: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
title: z.ZodString;
|
|
21
|
+
lastMessageAt: z.ZodString;
|
|
22
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
26
|
+
hasMore: z.ZodBoolean;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
const URL: "/api/v1/chat/history";
|
|
29
|
+
const METHOD = HttpMethod.GET;
|
|
30
|
+
type RequestType = z.infer<typeof Request>;
|
|
31
|
+
type ResponseType = z.infer<typeof Response>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetChatHistoryQuery = void 0;
|
|
4
|
+
const schemas_1 = require("../schemas");
|
|
5
|
+
const http_method_1 = require("../../../shared/http-method");
|
|
6
|
+
const rest_api_1 = require("../../../rest-api");
|
|
7
|
+
/**
|
|
8
|
+
* Get Chat History Query
|
|
9
|
+
* GET /api/v1/chat/history
|
|
10
|
+
*/
|
|
11
|
+
var GetChatHistoryQuery;
|
|
12
|
+
(function (GetChatHistoryQuery) {
|
|
13
|
+
GetChatHistoryQuery.Request = schemas_1.GetChatHistoryRequestSchema;
|
|
14
|
+
GetChatHistoryQuery.Response = schemas_1.GetChatHistoryResponseSchema;
|
|
15
|
+
GetChatHistoryQuery.URL = rest_api_1.REST_API.V1.CHAT.HISTORY;
|
|
16
|
+
GetChatHistoryQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
17
|
+
})(GetChatHistoryQuery || (exports.GetChatHistoryQuery = GetChatHistoryQuery = {}));
|
|
@@ -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,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetUnregChatQuery = void 0;
|
|
3
|
+
exports.GetChatHistoryQuery = 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; } });
|
|
10
|
+
var get_chat_history_query_1 = require("./get-chat-history.query");
|
|
11
|
+
Object.defineProperty(exports, "GetChatHistoryQuery", { enumerable: true, get: function () { return get_chat_history_query_1.GetChatHistoryQuery; } });
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Chat Period Types
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ChatPeriodType {
|
|
6
|
+
TODAY = "TODAY",
|
|
7
|
+
YESTERDAY = "YESTERDAY",
|
|
8
|
+
LAST_7_DAYS = "LAST_7_DAYS",
|
|
9
|
+
MONTH = "MONTH",
|
|
10
|
+
YEAR = "YEAR"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Russian month names (1-indexed: January = index 1)
|
|
14
|
+
*/
|
|
15
|
+
export declare const MONTH_NAMES_RU: readonly ["", "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"];
|
|
16
|
+
/**
|
|
17
|
+
* Period labels
|
|
18
|
+
*/
|
|
19
|
+
export declare const PERIOD_LABELS_RU: {
|
|
20
|
+
readonly TODAY: "Сегодня";
|
|
21
|
+
readonly YESTERDAY: "Вчера";
|
|
22
|
+
readonly LAST_7_DAYS: "Последние 7 дней";
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Chat History Item Schema
|
|
26
|
+
*/
|
|
27
|
+
export declare const ChatHistoryItemSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
title: z.ZodString;
|
|
30
|
+
lastMessageAt: z.ZodString;
|
|
31
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type ChatHistoryItemDto = z.infer<typeof ChatHistoryItemSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Chat Period Schema
|
|
36
|
+
*/
|
|
37
|
+
export declare const ChatPeriodSchema: z.ZodObject<{
|
|
38
|
+
type: z.ZodEnum<typeof ChatPeriodType>;
|
|
39
|
+
label: z.ZodString;
|
|
40
|
+
year: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
month: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
lastMessageAt: z.ZodString;
|
|
46
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type ChatPeriodDto = z.infer<typeof ChatPeriodSchema>;
|
|
50
|
+
/**
|
|
51
|
+
* Get Chat History Request Schema
|
|
52
|
+
*/
|
|
53
|
+
export declare const GetChatHistoryRequestSchema: z.ZodObject<{
|
|
54
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
55
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
export type GetChatHistoryRequestDto = z.infer<typeof GetChatHistoryRequestSchema>;
|
|
58
|
+
/**
|
|
59
|
+
* Get Chat History Response Schema
|
|
60
|
+
*/
|
|
61
|
+
export declare const GetChatHistoryResponseSchema: z.ZodObject<{
|
|
62
|
+
periods: z.ZodArray<z.ZodObject<{
|
|
63
|
+
type: z.ZodEnum<typeof ChatPeriodType>;
|
|
64
|
+
label: z.ZodString;
|
|
65
|
+
year: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
month: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
chats: z.ZodArray<z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
title: z.ZodString;
|
|
70
|
+
lastMessageAt: z.ZodString;
|
|
71
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
75
|
+
hasMore: z.ZodBoolean;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
export type GetChatHistoryResponseDto = z.infer<typeof GetChatHistoryResponseSchema>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
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 = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Chat Period Types
|
|
7
|
+
*/
|
|
8
|
+
var ChatPeriodType;
|
|
9
|
+
(function (ChatPeriodType) {
|
|
10
|
+
ChatPeriodType["TODAY"] = "TODAY";
|
|
11
|
+
ChatPeriodType["YESTERDAY"] = "YESTERDAY";
|
|
12
|
+
ChatPeriodType["LAST_7_DAYS"] = "LAST_7_DAYS";
|
|
13
|
+
ChatPeriodType["MONTH"] = "MONTH";
|
|
14
|
+
ChatPeriodType["YEAR"] = "YEAR";
|
|
15
|
+
})(ChatPeriodType || (exports.ChatPeriodType = ChatPeriodType = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Russian month names (1-indexed: January = index 1)
|
|
18
|
+
*/
|
|
19
|
+
exports.MONTH_NAMES_RU = [
|
|
20
|
+
'', // index 0 unused
|
|
21
|
+
'Январь',
|
|
22
|
+
'Февраль',
|
|
23
|
+
'Март',
|
|
24
|
+
'Апрель',
|
|
25
|
+
'Май',
|
|
26
|
+
'Июнь',
|
|
27
|
+
'Июль',
|
|
28
|
+
'Август',
|
|
29
|
+
'Сентябрь',
|
|
30
|
+
'Октябрь',
|
|
31
|
+
'Ноябрь',
|
|
32
|
+
'Декабрь',
|
|
33
|
+
];
|
|
34
|
+
/**
|
|
35
|
+
* Period labels
|
|
36
|
+
*/
|
|
37
|
+
exports.PERIOD_LABELS_RU = {
|
|
38
|
+
[ChatPeriodType.TODAY]: 'Сегодня',
|
|
39
|
+
[ChatPeriodType.YESTERDAY]: 'Вчера',
|
|
40
|
+
[ChatPeriodType.LAST_7_DAYS]: 'Последние 7 дней',
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Chat History Item Schema
|
|
44
|
+
*/
|
|
45
|
+
exports.ChatHistoryItemSchema = zod_1.z.object({
|
|
46
|
+
id: zod_1.z.string().uuid(),
|
|
47
|
+
title: zod_1.z.string(),
|
|
48
|
+
lastMessageAt: zod_1.z.string().datetime(),
|
|
49
|
+
pageId: zod_1.z.string().uuid().nullable(),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Chat Period Schema
|
|
53
|
+
*/
|
|
54
|
+
exports.ChatPeriodSchema = zod_1.z.object({
|
|
55
|
+
type: zod_1.z.enum(ChatPeriodType),
|
|
56
|
+
label: zod_1.z.string(),
|
|
57
|
+
year: zod_1.z.number().int().optional(),
|
|
58
|
+
month: zod_1.z.number().int().min(1).max(12).optional(),
|
|
59
|
+
chats: zod_1.z.array(exports.ChatHistoryItemSchema),
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Get Chat History Request Schema
|
|
63
|
+
*/
|
|
64
|
+
exports.GetChatHistoryRequestSchema = zod_1.z.object({
|
|
65
|
+
limit: zod_1.z.coerce.number().int().min(1).max(100).default(20),
|
|
66
|
+
cursor: zod_1.z.string().optional(),
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* Get Chat History Response Schema
|
|
70
|
+
*/
|
|
71
|
+
exports.GetChatHistoryResponseSchema = zod_1.z.object({
|
|
72
|
+
periods: zod_1.z.array(exports.ChatPeriodSchema),
|
|
73
|
+
nextCursor: zod_1.z.string().nullable(),
|
|
74
|
+
hasMore: zod_1.z.boolean(),
|
|
75
|
+
});
|
|
@@ -3,3 +3,11 @@ 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';
|
|
12
|
+
export { ChatPeriodType, MONTH_NAMES_RU, PERIOD_LABELS_RU, ChatHistoryItemSchema, ChatPeriodSchema, GetChatHistoryRequestSchema, GetChatHistoryResponseSchema, } from './chat-history.schema';
|
|
13
|
+
export type { ChatHistoryItemDto, ChatPeriodDto, GetChatHistoryRequestDto, GetChatHistoryResponseDto, } from './chat-history.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.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;
|
|
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,17 @@ 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; } });
|
|
18
|
+
var chat_history_schema_1 = require("./chat-history.schema");
|
|
19
|
+
Object.defineProperty(exports, "ChatPeriodType", { enumerable: true, get: function () { return chat_history_schema_1.ChatPeriodType; } });
|
|
20
|
+
Object.defineProperty(exports, "MONTH_NAMES_RU", { enumerable: true, get: function () { return chat_history_schema_1.MONTH_NAMES_RU; } });
|
|
21
|
+
Object.defineProperty(exports, "PERIOD_LABELS_RU", { enumerable: true, get: function () { return chat_history_schema_1.PERIOD_LABELS_RU; } });
|
|
22
|
+
Object.defineProperty(exports, "ChatHistoryItemSchema", { enumerable: true, get: function () { return chat_history_schema_1.ChatHistoryItemSchema; } });
|
|
23
|
+
Object.defineProperty(exports, "ChatPeriodSchema", { enumerable: true, get: function () { return chat_history_schema_1.ChatPeriodSchema; } });
|
|
24
|
+
Object.defineProperty(exports, "GetChatHistoryRequestSchema", { enumerable: true, get: function () { return chat_history_schema_1.GetChatHistoryRequestSchema; } });
|
|
25
|
+
Object.defineProperty(exports, "GetChatHistoryResponseSchema", { enumerable: true, get: function () { return chat_history_schema_1.GetChatHistoryResponseSchema; } });
|
|
@@ -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.
|
|
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,
|