@veruna/api-contracts 1.0.35 → 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 +1 -0
- package/build/controllers/chat.controllers.js +2 -1
- package/build/controllers/index.d.ts +1 -1
- package/build/controllers/index.js +2 -1
- package/build/rest-api.d.ts +1 -0
- package/build/rest-api.js +1 -0
- package/build/routes/chat.routes.d.ts +3 -0
- package/build/routes/chat.routes.js +4 -1
- package/build/routes/index.d.ts +1 -1
- package/build/routes/index.js +2 -1
- package/build/shared/constants.d.ts +6 -0
- package/build/shared/constants.js +7 -1
- 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/index.d.ts +1 -0
- package/build/v1/chat/queries/index.js +3 -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/index.d.ts +2 -0
- package/build/v1/chat/schemas/index.js +9 -1
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHAT_REG_CONTROLLER = 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
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, CHAT_REG_CONTROLLER } from './chat.controllers';
|
|
13
|
+
export { CHAT_UNREG_CONTROLLER, CHAT_REG_CONTROLLER, CHAT_HISTORY_CONTROLLER, } from './chat.controllers';
|
|
14
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_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;
|
|
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
|
*/
|
|
@@ -31,6 +31,7 @@ Object.defineProperty(exports, "CHAT_PROJECT_CONTROLLER", { enumerable: true, ge
|
|
|
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
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; } });
|
|
34
35
|
var message_controllers_1 = require("./message.controllers");
|
|
35
36
|
Object.defineProperty(exports, "MESSAGE_UNREG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_UNREG_CONTROLLER; } });
|
|
36
37
|
Object.defineProperty(exports, "MESSAGE_REG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_REG_CONTROLLER; } });
|
package/build/rest-api.d.ts
CHANGED
|
@@ -134,6 +134,7 @@ export declare const REST_API: {
|
|
|
134
134
|
readonly DELETE: (pageId: string, chatId: string) => string;
|
|
135
135
|
readonly UPDATE_TITLE: (pageId: string, chatId: string) => string;
|
|
136
136
|
};
|
|
137
|
+
readonly HISTORY: "/api/v1/chat/history";
|
|
137
138
|
};
|
|
138
139
|
readonly MESSAGE: {
|
|
139
140
|
readonly UNREG: {
|
package/build/rest-api.js
CHANGED
|
@@ -151,6 +151,7 @@ exports.REST_API = {
|
|
|
151
151
|
DELETE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/${chatId}`,
|
|
152
152
|
UPDATE_TITLE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.CHAT_REG_CONTROLLER.replace(':pageId', pageId)}/${chatId}`,
|
|
153
153
|
},
|
|
154
|
+
HISTORY: `${exports.ROOT}/${controllers_1.CHAT_HISTORY_CONTROLLER}/${routes_1.CHAT_HISTORY_ROUTES.HISTORY}`,
|
|
154
155
|
},
|
|
155
156
|
MESSAGE: {
|
|
156
157
|
UNREG: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHAT_REG_ROUTES = 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
|
*/
|
|
@@ -15,3 +15,6 @@ exports.CHAT_REG_ROUTES = {
|
|
|
15
15
|
DELETE: ':chatId',
|
|
16
16
|
UPDATE_TITLE: ':chatId',
|
|
17
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, CHAT_REG_ROUTES } from './chat.routes';
|
|
18
|
+
export { CHAT_UNREG_ROUTES, CHAT_REG_ROUTES, CHAT_HISTORY_ROUTES } from './chat.routes';
|
|
19
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_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;
|
|
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
|
*/
|
|
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "CHAT_PROJECT_ROUTES", { enumerable: true, get: f
|
|
|
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
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; } });
|
|
39
40
|
var message_routes_1 = require("./message.routes");
|
|
40
41
|
Object.defineProperty(exports, "MESSAGE_UNREG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_UNREG_ROUTES; } });
|
|
41
42
|
Object.defineProperty(exports, "MESSAGE_REG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_REG_ROUTES; } });
|
|
@@ -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
|
|
@@ -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 = {}));
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetLastActiveChatQuery = exports.GetRegChatQuery = 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
6
|
var get_reg_chat_query_1 = require("./get-reg-chat.query");
|
|
7
7
|
Object.defineProperty(exports, "GetRegChatQuery", { enumerable: true, get: function () { return get_reg_chat_query_1.GetRegChatQuery; } });
|
|
8
8
|
var get_last_active_chat_query_1 = require("./get-last-active-chat.query");
|
|
9
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
|
+
});
|
|
@@ -9,3 +9,5 @@ export { UpdateChatTitleRequestSchema } from './update-chat-title-request.schema
|
|
|
9
9
|
export type { UpdateChatTitleRequestDto } from './update-chat-title-request.schema';
|
|
10
10
|
export { DeleteChatResponseSchema } from './delete-chat-response.schema';
|
|
11
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.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.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");
|
|
@@ -15,3 +15,11 @@ var update_chat_title_request_schema_1 = require("./update-chat-title-request.sc
|
|
|
15
15
|
Object.defineProperty(exports, "UpdateChatTitleRequestSchema", { enumerable: true, get: function () { return update_chat_title_request_schema_1.UpdateChatTitleRequestSchema; } });
|
|
16
16
|
var delete_chat_response_schema_1 = require("./delete-chat-response.schema");
|
|
17
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; } });
|