@veruna/api-contracts 1.0.24 → 1.0.26
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/index.d.ts +1 -0
- package/build/controllers/index.js +3 -1
- package/build/controllers/message.controllers.d.ts +1 -0
- package/build/controllers/message.controllers.js +4 -0
- package/build/rest-api.d.ts +7 -1
- package/build/rest-api.js +7 -1
- package/build/routes/chat.routes.d.ts +2 -1
- package/build/routes/chat.routes.js +2 -1
- package/build/routes/index.d.ts +1 -0
- package/build/routes/index.js +3 -1
- package/build/routes/message.routes.d.ts +3 -0
- package/build/routes/message.routes.js +6 -0
- package/build/shared/constants.d.ts +1 -0
- package/build/shared/constants.js +4 -0
- package/build/shared/index.d.ts +1 -0
- package/build/shared/index.js +1 -0
- package/build/v1/ai/ai.errors.d.ts +16 -0
- package/build/v1/ai/ai.errors.js +72 -0
- package/build/v1/ai/index.d.ts +1 -0
- package/build/v1/ai/index.js +17 -0
- package/build/v1/chat/commands/create-unreg-chat.command.d.ts +32 -0
- package/build/v1/chat/commands/create-unreg-chat.command.js +18 -0
- package/build/v1/chat/commands/index.d.ts +1 -1
- package/build/v1/chat/commands/index.js +3 -3
- package/build/v1/chat/index.d.ts +1 -0
- package/build/v1/chat/index.js +1 -0
- package/build/v1/chat/queries/get-unreg-chat.query.d.ts +32 -0
- package/build/v1/chat/queries/get-unreg-chat.query.js +18 -0
- package/build/v1/chat/queries/index.d.ts +1 -0
- package/build/v1/chat/queries/index.js +5 -0
- package/build/v1/chat/schemas/chat-response.schema.d.ts +0 -1
- package/build/v1/chat/schemas/chat-status.enum.d.ts +1 -0
- package/build/v1/chat/schemas/chat-status.enum.js +1 -0
- package/build/v1/chat/schemas/chat-with-messages-response.schema.d.ts +21 -0
- package/build/v1/chat/schemas/chat-with-messages-response.schema.js +16 -0
- package/build/v1/chat/schemas/index.d.ts +1 -1
- package/build/v1/chat/schemas/index.js +3 -1
- package/build/v1/index.d.ts +2 -0
- package/build/v1/index.js +2 -0
- package/build/v1/message/commands/create-message.command.d.ts +15 -0
- package/build/v1/message/commands/create-message.command.js +13 -0
- package/build/v1/message/commands/index.d.ts +1 -0
- package/build/v1/message/commands/index.js +5 -0
- package/build/v1/message/index.d.ts +3 -0
- package/build/v1/message/index.js +19 -0
- package/build/v1/message/message.errors.d.ts +12 -0
- package/build/v1/message/message.errors.js +48 -0
- package/build/v1/message/schemas/create-message-request.schema.d.ts +5 -0
- package/build/v1/message/schemas/create-message-request.schema.js +9 -0
- package/build/v1/message/schemas/create-message-response.schema.d.ts +4 -0
- package/build/v1/message/schemas/create-message-response.schema.js +7 -0
- package/build/v1/message/schemas/index.d.ts +6 -0
- package/build/v1/message/schemas/index.js +15 -0
- package/build/v1/message/schemas/message-response.schema.d.ts +14 -0
- package/build/v1/message/schemas/message-response.schema.js +17 -0
- package/build/v1/message/schemas/message-role.enum.d.ts +6 -0
- package/build/v1/message/schemas/message-role.enum.js +10 -0
- package/build/v1/message/schemas/message-status.enum.d.ts +6 -0
- package/build/v1/message/schemas/message-status.enum.js +10 -0
- package/build/v1/message/schemas/user-rating.enum.d.ts +4 -0
- package/build/v1/message/schemas/user-rating.enum.js +8 -0
- package/package.json +1 -1
- package/build/v1/chat/commands/get-or-create-unreg-chat.command.d.ts +0 -22
- package/build/v1/chat/commands/get-or-create-unreg-chat.command.js +0 -18
|
@@ -11,3 +11,4 @@ export { AI_MODEL_ADMIN_CONTROLLER, AI_MODEL_PUBLIC_CONTROLLER, } from './ai-mod
|
|
|
11
11
|
export { FILE_CONTROLLER } from './file.controllers';
|
|
12
12
|
export { CHAT_PROJECT_CONTROLLER } from './chat-project.controllers';
|
|
13
13
|
export { CHAT_UNREG_CONTROLLER } from './chat.controllers';
|
|
14
|
+
export { MESSAGE_UNREG_CONTROLLER } from './message.controllers';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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;
|
|
4
4
|
/**
|
|
5
5
|
* Centralized exports for all controllers
|
|
6
6
|
*/
|
|
@@ -30,3 +30,5 @@ 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
|
+
var message_controllers_1 = require("./message.controllers");
|
|
34
|
+
Object.defineProperty(exports, "MESSAGE_UNREG_CONTROLLER", { enumerable: true, get: function () { return message_controllers_1.MESSAGE_UNREG_CONTROLLER; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MESSAGE_UNREG_CONTROLLER: "v1/unreg/page/:pageId/chat/:chatId/message";
|
package/build/rest-api.d.ts
CHANGED
|
@@ -106,7 +106,13 @@ export declare const REST_API: {
|
|
|
106
106
|
};
|
|
107
107
|
readonly CHAT: {
|
|
108
108
|
readonly UNREG: {
|
|
109
|
-
readonly
|
|
109
|
+
readonly GET: (pageId: string) => string;
|
|
110
|
+
readonly CREATE: (pageId: string) => string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
readonly MESSAGE: {
|
|
114
|
+
readonly UNREG: {
|
|
115
|
+
readonly CREATE: (pageId: string, chatId: string) => string;
|
|
110
116
|
};
|
|
111
117
|
};
|
|
112
118
|
};
|
package/build/rest-api.js
CHANGED
|
@@ -123,7 +123,13 @@ exports.REST_API = {
|
|
|
123
123
|
},
|
|
124
124
|
CHAT: {
|
|
125
125
|
UNREG: {
|
|
126
|
-
|
|
126
|
+
GET: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_UNREG_CONTROLLER.replace(':pageId', pageId)}`,
|
|
127
|
+
CREATE: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_UNREG_CONTROLLER.replace(':pageId', pageId)}`,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
MESSAGE: {
|
|
131
|
+
UNREG: {
|
|
132
|
+
CREATE: (pageId, chatId) => `${exports.ROOT}/${controllers_1.MESSAGE_UNREG_CONTROLLER.replace(':pageId', pageId).replace(':chatId', chatId)}`,
|
|
127
133
|
},
|
|
128
134
|
},
|
|
129
135
|
},
|
package/build/routes/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ 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
18
|
export { CHAT_UNREG_ROUTES } from './chat.routes';
|
|
19
|
+
export { MESSAGE_UNREG_ROUTES } from './message.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.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.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;
|
|
4
4
|
/**
|
|
5
5
|
* Centralized exports for all routes
|
|
6
6
|
*/
|
|
@@ -35,3 +35,5 @@ 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
|
+
var message_routes_1 = require("./message.routes");
|
|
39
|
+
Object.defineProperty(exports, "MESSAGE_UNREG_ROUTES", { enumerable: true, get: function () { return message_routes_1.MESSAGE_UNREG_ROUTES; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MESSAGE_TEXT_MAX_LENGTH = 500000;
|
package/build/shared/index.d.ts
CHANGED
package/build/shared/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ErrorMetadata } from '../../shared';
|
|
2
|
+
export declare enum AIErrorCode {
|
|
3
|
+
GENERATION_FAILED = "GENERATION_FAILED",
|
|
4
|
+
GENERATION_TIMEOUT = "GENERATION_TIMEOUT",
|
|
5
|
+
CONTENT_FILTERED = "CONTENT_FILTERED",
|
|
6
|
+
CONTEXT_TOO_LONG = "CONTEXT_TOO_LONG",
|
|
7
|
+
MODEL_NOT_FOUND = "MODEL_NOT_FOUND",
|
|
8
|
+
MODEL_UNAVAILABLE = "MODEL_UNAVAILABLE",
|
|
9
|
+
NO_SUITABLE_MODEL = "NO_SUITABLE_MODEL",
|
|
10
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
11
|
+
COST_LIMIT_EXCEEDED = "COST_LIMIT_EXCEEDED",
|
|
12
|
+
PROVIDER_ERROR = "PROVIDER_ERROR",
|
|
13
|
+
PROVIDER_RATE_LIMIT = "PROVIDER_RATE_LIMIT",
|
|
14
|
+
PROVIDER_TIMEOUT = "PROVIDER_TIMEOUT"
|
|
15
|
+
}
|
|
16
|
+
export declare const AI_ERRORS: Record<AIErrorCode, ErrorMetadata>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AI_ERRORS = exports.AIErrorCode = void 0;
|
|
4
|
+
var AIErrorCode;
|
|
5
|
+
(function (AIErrorCode) {
|
|
6
|
+
// Generation
|
|
7
|
+
AIErrorCode["GENERATION_FAILED"] = "GENERATION_FAILED";
|
|
8
|
+
AIErrorCode["GENERATION_TIMEOUT"] = "GENERATION_TIMEOUT";
|
|
9
|
+
AIErrorCode["CONTENT_FILTERED"] = "CONTENT_FILTERED";
|
|
10
|
+
AIErrorCode["CONTEXT_TOO_LONG"] = "CONTEXT_TOO_LONG";
|
|
11
|
+
// Model
|
|
12
|
+
AIErrorCode["MODEL_NOT_FOUND"] = "MODEL_NOT_FOUND";
|
|
13
|
+
AIErrorCode["MODEL_UNAVAILABLE"] = "MODEL_UNAVAILABLE";
|
|
14
|
+
AIErrorCode["NO_SUITABLE_MODEL"] = "NO_SUITABLE_MODEL";
|
|
15
|
+
// Billing
|
|
16
|
+
AIErrorCode["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
17
|
+
AIErrorCode["COST_LIMIT_EXCEEDED"] = "COST_LIMIT_EXCEEDED";
|
|
18
|
+
// Provider
|
|
19
|
+
AIErrorCode["PROVIDER_ERROR"] = "PROVIDER_ERROR";
|
|
20
|
+
AIErrorCode["PROVIDER_RATE_LIMIT"] = "PROVIDER_RATE_LIMIT";
|
|
21
|
+
AIErrorCode["PROVIDER_TIMEOUT"] = "PROVIDER_TIMEOUT";
|
|
22
|
+
})(AIErrorCode || (exports.AIErrorCode = AIErrorCode = {}));
|
|
23
|
+
exports.AI_ERRORS = {
|
|
24
|
+
[AIErrorCode.GENERATION_FAILED]: {
|
|
25
|
+
code: AIErrorCode.GENERATION_FAILED,
|
|
26
|
+
statusCode: 500,
|
|
27
|
+
},
|
|
28
|
+
[AIErrorCode.GENERATION_TIMEOUT]: {
|
|
29
|
+
code: AIErrorCode.GENERATION_TIMEOUT,
|
|
30
|
+
statusCode: 504,
|
|
31
|
+
},
|
|
32
|
+
[AIErrorCode.CONTENT_FILTERED]: {
|
|
33
|
+
code: AIErrorCode.CONTENT_FILTERED,
|
|
34
|
+
statusCode: 400,
|
|
35
|
+
},
|
|
36
|
+
[AIErrorCode.CONTEXT_TOO_LONG]: {
|
|
37
|
+
code: AIErrorCode.CONTEXT_TOO_LONG,
|
|
38
|
+
statusCode: 400,
|
|
39
|
+
},
|
|
40
|
+
[AIErrorCode.MODEL_NOT_FOUND]: {
|
|
41
|
+
code: AIErrorCode.MODEL_NOT_FOUND,
|
|
42
|
+
statusCode: 404,
|
|
43
|
+
},
|
|
44
|
+
[AIErrorCode.MODEL_UNAVAILABLE]: {
|
|
45
|
+
code: AIErrorCode.MODEL_UNAVAILABLE,
|
|
46
|
+
statusCode: 503,
|
|
47
|
+
},
|
|
48
|
+
[AIErrorCode.NO_SUITABLE_MODEL]: {
|
|
49
|
+
code: AIErrorCode.NO_SUITABLE_MODEL,
|
|
50
|
+
statusCode: 400,
|
|
51
|
+
},
|
|
52
|
+
[AIErrorCode.INSUFFICIENT_BALANCE]: {
|
|
53
|
+
code: AIErrorCode.INSUFFICIENT_BALANCE,
|
|
54
|
+
statusCode: 402,
|
|
55
|
+
},
|
|
56
|
+
[AIErrorCode.COST_LIMIT_EXCEEDED]: {
|
|
57
|
+
code: AIErrorCode.COST_LIMIT_EXCEEDED,
|
|
58
|
+
statusCode: 402,
|
|
59
|
+
},
|
|
60
|
+
[AIErrorCode.PROVIDER_ERROR]: {
|
|
61
|
+
code: AIErrorCode.PROVIDER_ERROR,
|
|
62
|
+
statusCode: 502,
|
|
63
|
+
},
|
|
64
|
+
[AIErrorCode.PROVIDER_RATE_LIMIT]: {
|
|
65
|
+
code: AIErrorCode.PROVIDER_RATE_LIMIT,
|
|
66
|
+
statusCode: 429,
|
|
67
|
+
},
|
|
68
|
+
[AIErrorCode.PROVIDER_TIMEOUT]: {
|
|
69
|
+
code: AIErrorCode.PROVIDER_TIMEOUT,
|
|
70
|
+
statusCode: 504,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai.errors';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai.errors"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
/**
|
|
4
|
+
* Create Unreg Chat Command
|
|
5
|
+
* POST /api/v1/unreg/page/:pageId/chat
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace CreateUnregChatCommand {
|
|
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
|
+
createdAt: z.ZodString;
|
|
25
|
+
updatedAt: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
const URL: (pageId: string) => string;
|
|
29
|
+
const METHOD = HttpMethod.POST;
|
|
30
|
+
type RequestType = z.infer<typeof Request>;
|
|
31
|
+
type ResponseType = z.infer<typeof Response>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateUnregChatCommand = 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 Unreg Chat Command
|
|
10
|
+
* POST /api/v1/unreg/page/:pageId/chat
|
|
11
|
+
*/
|
|
12
|
+
var CreateUnregChatCommand;
|
|
13
|
+
(function (CreateUnregChatCommand) {
|
|
14
|
+
CreateUnregChatCommand.Request = zod_1.z.object({});
|
|
15
|
+
CreateUnregChatCommand.Response = schemas_1.ChatWithMessagesResponseSchema;
|
|
16
|
+
CreateUnregChatCommand.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.UNREG.CREATE(pageId);
|
|
17
|
+
CreateUnregChatCommand.METHOD = http_method_1.HttpMethod.POST;
|
|
18
|
+
})(CreateUnregChatCommand || (exports.CreateUnregChatCommand = CreateUnregChatCommand = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { CreateUnregChatCommand } from './create-unreg-chat.command';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
3
|
+
exports.CreateUnregChatCommand = void 0;
|
|
4
|
+
var create_unreg_chat_command_1 = require("./create-unreg-chat.command");
|
|
5
|
+
Object.defineProperty(exports, "CreateUnregChatCommand", { enumerable: true, get: function () { return create_unreg_chat_command_1.CreateUnregChatCommand; } });
|
package/build/v1/chat/index.d.ts
CHANGED
package/build/v1/chat/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./schemas"), exports);
|
|
18
18
|
__exportStar(require("./commands"), exports);
|
|
19
|
+
__exportStar(require("./queries"), exports);
|
|
19
20
|
__exportStar(require("./chat.errors"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
/**
|
|
4
|
+
* Get Unreg Chat Query
|
|
5
|
+
* GET /api/v1/unreg/page/:pageId/chat
|
|
6
|
+
*/
|
|
7
|
+
export declare namespace GetUnregChatQuery {
|
|
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
|
+
createdAt: z.ZodString;
|
|
25
|
+
updatedAt: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
const URL: (pageId: string) => string;
|
|
29
|
+
const METHOD = HttpMethod.GET;
|
|
30
|
+
type RequestType = z.infer<typeof Request>;
|
|
31
|
+
type ResponseType = z.infer<typeof Response>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUnregChatQuery = 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 Unreg Chat Query
|
|
10
|
+
* GET /api/v1/unreg/page/:pageId/chat
|
|
11
|
+
*/
|
|
12
|
+
var GetUnregChatQuery;
|
|
13
|
+
(function (GetUnregChatQuery) {
|
|
14
|
+
GetUnregChatQuery.Request = zod_1.z.object({});
|
|
15
|
+
GetUnregChatQuery.Response = schemas_1.ChatWithMessagesResponseSchema;
|
|
16
|
+
GetUnregChatQuery.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.UNREG.GET(pageId);
|
|
17
|
+
GetUnregChatQuery.METHOD = http_method_1.HttpMethod.GET;
|
|
18
|
+
})(GetUnregChatQuery || (exports.GetUnregChatQuery = GetUnregChatQuery = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { GetUnregChatQuery } from './get-unreg-chat.query';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetUnregChatQuery = void 0;
|
|
4
|
+
var get_unreg_chat_query_1 = require("./get-unreg-chat.query");
|
|
5
|
+
Object.defineProperty(exports, "GetUnregChatQuery", { enumerable: true, get: function () { return get_unreg_chat_query_1.GetUnregChatQuery; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ChatStatus } from './chat-status.enum';
|
|
3
|
+
export declare const ChatWithMessagesResponseSchema: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodString;
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
status: z.ZodEnum<typeof ChatStatus>;
|
|
7
|
+
pageId: z.ZodNullable<z.ZodString>;
|
|
8
|
+
folderId: z.ZodNullable<z.ZodString>;
|
|
9
|
+
createdAt: z.ZodString;
|
|
10
|
+
updatedAt: z.ZodString;
|
|
11
|
+
messages: z.ZodArray<z.ZodObject<{
|
|
12
|
+
uuid: z.ZodString;
|
|
13
|
+
role: z.ZodEnum<typeof import("../..").MessageRole>;
|
|
14
|
+
status: z.ZodEnum<typeof import("../..").MessageStatus>;
|
|
15
|
+
content: z.ZodString;
|
|
16
|
+
aiModelId: z.ZodNullable<z.ZodString>;
|
|
17
|
+
userRating: z.ZodNullable<z.ZodEnum<typeof import("../..").UserRating>>;
|
|
18
|
+
createdAt: z.ZodString;
|
|
19
|
+
updatedAt: z.ZodString;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatWithMessagesResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const chat_status_enum_1 = require("./chat-status.enum");
|
|
6
|
+
const message_response_schema_1 = require("../../message/schemas/message-response.schema");
|
|
7
|
+
exports.ChatWithMessagesResponseSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
title: zod_1.z.string(),
|
|
10
|
+
status: zod_1.z.nativeEnum(chat_status_enum_1.ChatStatus),
|
|
11
|
+
pageId: zod_1.z.string().uuid().nullable(),
|
|
12
|
+
folderId: zod_1.z.string().uuid().nullable(),
|
|
13
|
+
createdAt: zod_1.z.string(),
|
|
14
|
+
updatedAt: zod_1.z.string(),
|
|
15
|
+
messages: zod_1.z.array(message_response_schema_1.MessageResponseSchema),
|
|
16
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ChatStatus } from './chat-status.enum';
|
|
2
2
|
export { ChatResponseSchema } from './chat-response.schema';
|
|
3
|
-
export
|
|
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';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PageIdParamSchema = exports.ChatResponseSchema = exports.ChatStatus = void 0;
|
|
3
|
+
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");
|
|
7
7
|
Object.defineProperty(exports, "ChatResponseSchema", { enumerable: true, get: function () { return chat_response_schema_1.ChatResponseSchema; } });
|
|
8
|
+
var chat_with_messages_response_schema_1 = require("./chat-with-messages-response.schema");
|
|
9
|
+
Object.defineProperty(exports, "ChatWithMessagesResponseSchema", { enumerable: true, get: function () { return chat_with_messages_response_schema_1.ChatWithMessagesResponseSchema; } });
|
|
8
10
|
var page_id_param_schema_1 = require("./page-id-param.schema");
|
|
9
11
|
Object.defineProperty(exports, "PageIdParamSchema", { enumerable: true, get: function () { return page_id_param_schema_1.PageIdParamSchema; } });
|
package/build/v1/index.d.ts
CHANGED
package/build/v1/index.js
CHANGED
|
@@ -25,3 +25,5 @@ __exportStar(require("./ai-provider"), exports);
|
|
|
25
25
|
__exportStar(require("./ai-model"), exports);
|
|
26
26
|
__exportStar(require("./chat-project"), exports);
|
|
27
27
|
__exportStar(require("./chat"), exports);
|
|
28
|
+
__exportStar(require("./message"), exports);
|
|
29
|
+
__exportStar(require("./ai"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
+
export declare namespace CreateMessageCommand {
|
|
4
|
+
const Request: z.ZodObject<{
|
|
5
|
+
aiModelId: z.ZodString;
|
|
6
|
+
text: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
const Response: z.ZodObject<{
|
|
9
|
+
messageId: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
const URL: (pageId: string, chatId: string) => string;
|
|
12
|
+
const METHOD = HttpMethod.POST;
|
|
13
|
+
type RequestType = z.infer<typeof Request>;
|
|
14
|
+
type ResponseType = z.infer<typeof Response>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateMessageCommand = 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
|
+
var CreateMessageCommand;
|
|
8
|
+
(function (CreateMessageCommand) {
|
|
9
|
+
CreateMessageCommand.Request = schemas_1.CreateMessageRequestSchema;
|
|
10
|
+
CreateMessageCommand.Response = schemas_1.CreateMessageResponseSchema;
|
|
11
|
+
CreateMessageCommand.URL = (pageId, chatId) => rest_api_1.REST_API.V1.MESSAGE.UNREG.CREATE(pageId, chatId);
|
|
12
|
+
CreateMessageCommand.METHOD = http_method_1.HttpMethod.POST;
|
|
13
|
+
})(CreateMessageCommand || (exports.CreateMessageCommand = CreateMessageCommand = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CreateMessageCommand } from './create-message.command';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateMessageCommand = void 0;
|
|
4
|
+
var create_message_command_1 = require("./create-message.command");
|
|
5
|
+
Object.defineProperty(exports, "CreateMessageCommand", { enumerable: true, get: function () { return create_message_command_1.CreateMessageCommand; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./schemas"), exports);
|
|
18
|
+
__exportStar(require("./commands"), exports);
|
|
19
|
+
__exportStar(require("./message.errors"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ErrorMetadata } from '../../shared';
|
|
2
|
+
export declare enum MessageErrorCode {
|
|
3
|
+
CHAT_NOT_FOUND = "CHAT_NOT_FOUND",
|
|
4
|
+
CHAT_NOT_OWNED = "CHAT_NOT_OWNED",
|
|
5
|
+
CHAT_DELETED = "CHAT_DELETED",
|
|
6
|
+
INVALID_PAGE_ID = "INVALID_PAGE_ID",
|
|
7
|
+
MESSAGE_TEXT_EMPTY = "MESSAGE_TEXT_EMPTY",
|
|
8
|
+
MESSAGE_TEXT_TOO_LONG = "MESSAGE_TEXT_TOO_LONG",
|
|
9
|
+
AI_MODEL_NOT_FOUND = "AI_MODEL_NOT_FOUND",
|
|
10
|
+
AI_MODEL_INACTIVE = "AI_MODEL_INACTIVE"
|
|
11
|
+
}
|
|
12
|
+
export declare const MESSAGE_ERRORS: Record<MessageErrorCode, ErrorMetadata>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MESSAGE_ERRORS = exports.MessageErrorCode = void 0;
|
|
4
|
+
var MessageErrorCode;
|
|
5
|
+
(function (MessageErrorCode) {
|
|
6
|
+
MessageErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
|
|
7
|
+
MessageErrorCode["CHAT_NOT_OWNED"] = "CHAT_NOT_OWNED";
|
|
8
|
+
MessageErrorCode["CHAT_DELETED"] = "CHAT_DELETED";
|
|
9
|
+
MessageErrorCode["INVALID_PAGE_ID"] = "INVALID_PAGE_ID";
|
|
10
|
+
MessageErrorCode["MESSAGE_TEXT_EMPTY"] = "MESSAGE_TEXT_EMPTY";
|
|
11
|
+
MessageErrorCode["MESSAGE_TEXT_TOO_LONG"] = "MESSAGE_TEXT_TOO_LONG";
|
|
12
|
+
MessageErrorCode["AI_MODEL_NOT_FOUND"] = "AI_MODEL_NOT_FOUND";
|
|
13
|
+
MessageErrorCode["AI_MODEL_INACTIVE"] = "AI_MODEL_INACTIVE";
|
|
14
|
+
})(MessageErrorCode || (exports.MessageErrorCode = MessageErrorCode = {}));
|
|
15
|
+
exports.MESSAGE_ERRORS = {
|
|
16
|
+
[MessageErrorCode.CHAT_NOT_FOUND]: {
|
|
17
|
+
code: MessageErrorCode.CHAT_NOT_FOUND,
|
|
18
|
+
statusCode: 404,
|
|
19
|
+
},
|
|
20
|
+
[MessageErrorCode.CHAT_NOT_OWNED]: {
|
|
21
|
+
code: MessageErrorCode.CHAT_NOT_OWNED,
|
|
22
|
+
statusCode: 403,
|
|
23
|
+
},
|
|
24
|
+
[MessageErrorCode.CHAT_DELETED]: {
|
|
25
|
+
code: MessageErrorCode.CHAT_DELETED,
|
|
26
|
+
statusCode: 410,
|
|
27
|
+
},
|
|
28
|
+
[MessageErrorCode.INVALID_PAGE_ID]: {
|
|
29
|
+
code: MessageErrorCode.INVALID_PAGE_ID,
|
|
30
|
+
statusCode: 400,
|
|
31
|
+
},
|
|
32
|
+
[MessageErrorCode.MESSAGE_TEXT_EMPTY]: {
|
|
33
|
+
code: MessageErrorCode.MESSAGE_TEXT_EMPTY,
|
|
34
|
+
statusCode: 400,
|
|
35
|
+
},
|
|
36
|
+
[MessageErrorCode.MESSAGE_TEXT_TOO_LONG]: {
|
|
37
|
+
code: MessageErrorCode.MESSAGE_TEXT_TOO_LONG,
|
|
38
|
+
statusCode: 400,
|
|
39
|
+
},
|
|
40
|
+
[MessageErrorCode.AI_MODEL_NOT_FOUND]: {
|
|
41
|
+
code: MessageErrorCode.AI_MODEL_NOT_FOUND,
|
|
42
|
+
statusCode: 404,
|
|
43
|
+
},
|
|
44
|
+
[MessageErrorCode.AI_MODEL_INACTIVE]: {
|
|
45
|
+
code: MessageErrorCode.AI_MODEL_INACTIVE,
|
|
46
|
+
statusCode: 400,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateMessageRequestSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_1 = require("../../../shared");
|
|
6
|
+
exports.CreateMessageRequestSchema = zod_1.z.object({
|
|
7
|
+
aiModelId: zod_1.z.string().uuid(),
|
|
8
|
+
text: zod_1.z.string().min(1).max(shared_1.MESSAGE_TEXT_MAX_LENGTH),
|
|
9
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MessageRole } from './message-role.enum';
|
|
2
|
+
export { MessageStatus } from './message-status.enum';
|
|
3
|
+
export { UserRating } from './user-rating.enum';
|
|
4
|
+
export { CreateMessageRequestSchema } from './create-message-request.schema';
|
|
5
|
+
export { CreateMessageResponseSchema } from './create-message-response.schema';
|
|
6
|
+
export { MessageResponseSchema } from './message-response.schema';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageResponseSchema = exports.CreateMessageResponseSchema = exports.CreateMessageRequestSchema = exports.UserRating = exports.MessageStatus = exports.MessageRole = void 0;
|
|
4
|
+
var message_role_enum_1 = require("./message-role.enum");
|
|
5
|
+
Object.defineProperty(exports, "MessageRole", { enumerable: true, get: function () { return message_role_enum_1.MessageRole; } });
|
|
6
|
+
var message_status_enum_1 = require("./message-status.enum");
|
|
7
|
+
Object.defineProperty(exports, "MessageStatus", { enumerable: true, get: function () { return message_status_enum_1.MessageStatus; } });
|
|
8
|
+
var user_rating_enum_1 = require("./user-rating.enum");
|
|
9
|
+
Object.defineProperty(exports, "UserRating", { enumerable: true, get: function () { return user_rating_enum_1.UserRating; } });
|
|
10
|
+
var create_message_request_schema_1 = require("./create-message-request.schema");
|
|
11
|
+
Object.defineProperty(exports, "CreateMessageRequestSchema", { enumerable: true, get: function () { return create_message_request_schema_1.CreateMessageRequestSchema; } });
|
|
12
|
+
var create_message_response_schema_1 = require("./create-message-response.schema");
|
|
13
|
+
Object.defineProperty(exports, "CreateMessageResponseSchema", { enumerable: true, get: function () { return create_message_response_schema_1.CreateMessageResponseSchema; } });
|
|
14
|
+
var message_response_schema_1 = require("./message-response.schema");
|
|
15
|
+
Object.defineProperty(exports, "MessageResponseSchema", { enumerable: true, get: function () { return message_response_schema_1.MessageResponseSchema; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MessageRole } from './message-role.enum';
|
|
3
|
+
import { MessageStatus } from './message-status.enum';
|
|
4
|
+
import { UserRating } from './user-rating.enum';
|
|
5
|
+
export declare const MessageResponseSchema: z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
role: z.ZodEnum<typeof MessageRole>;
|
|
8
|
+
status: z.ZodEnum<typeof MessageStatus>;
|
|
9
|
+
content: z.ZodString;
|
|
10
|
+
aiModelId: z.ZodNullable<z.ZodString>;
|
|
11
|
+
userRating: z.ZodNullable<z.ZodEnum<typeof UserRating>>;
|
|
12
|
+
createdAt: z.ZodString;
|
|
13
|
+
updatedAt: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageResponseSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const message_role_enum_1 = require("./message-role.enum");
|
|
6
|
+
const message_status_enum_1 = require("./message-status.enum");
|
|
7
|
+
const user_rating_enum_1 = require("./user-rating.enum");
|
|
8
|
+
exports.MessageResponseSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
role: zod_1.z.nativeEnum(message_role_enum_1.MessageRole),
|
|
11
|
+
status: zod_1.z.nativeEnum(message_status_enum_1.MessageStatus),
|
|
12
|
+
content: zod_1.z.string(),
|
|
13
|
+
aiModelId: zod_1.z.string().uuid().nullable(),
|
|
14
|
+
userRating: zod_1.z.nativeEnum(user_rating_enum_1.UserRating).nullable(),
|
|
15
|
+
createdAt: zod_1.z.string(),
|
|
16
|
+
updatedAt: zod_1.z.string(),
|
|
17
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageRole = void 0;
|
|
4
|
+
var MessageRole;
|
|
5
|
+
(function (MessageRole) {
|
|
6
|
+
MessageRole["SYSTEM"] = "system";
|
|
7
|
+
MessageRole["AI"] = "ai";
|
|
8
|
+
MessageRole["PROMO"] = "promo";
|
|
9
|
+
MessageRole["USER"] = "user";
|
|
10
|
+
})(MessageRole || (exports.MessageRole = MessageRole = {}));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageStatus = void 0;
|
|
4
|
+
var MessageStatus;
|
|
5
|
+
(function (MessageStatus) {
|
|
6
|
+
MessageStatus["NEW"] = "new";
|
|
7
|
+
MessageStatus["GENERATING"] = "generating";
|
|
8
|
+
MessageStatus["GENERATED"] = "generated";
|
|
9
|
+
MessageStatus["ERROR"] = "error";
|
|
10
|
+
})(MessageStatus || (exports.MessageStatus = MessageStatus = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRating = void 0;
|
|
4
|
+
var UserRating;
|
|
5
|
+
(function (UserRating) {
|
|
6
|
+
UserRating["LIKE"] = "like";
|
|
7
|
+
UserRating["DISLIKE"] = "dislike";
|
|
8
|
+
})(UserRating || (exports.UserRating = UserRating = {}));
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { HttpMethod } from '../../../shared/http-method';
|
|
3
|
-
/**
|
|
4
|
-
* Get or Create Unreg Chat Command
|
|
5
|
-
* PUT /api/v1/unreg/page/:pageId/chat
|
|
6
|
-
*/
|
|
7
|
-
export declare namespace GetOrCreateUnregChatCommand {
|
|
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
|
-
}, z.core.$strip>;
|
|
18
|
-
const URL: (pageId: string) => string;
|
|
19
|
-
const METHOD = HttpMethod.PUT;
|
|
20
|
-
type RequestType = z.infer<typeof Request>;
|
|
21
|
-
type ResponseType = z.infer<typeof Response>;
|
|
22
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetOrCreateUnregChatCommand = 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 or Create Unreg Chat Command
|
|
10
|
-
* PUT /api/v1/unreg/page/:pageId/chat
|
|
11
|
-
*/
|
|
12
|
-
var GetOrCreateUnregChatCommand;
|
|
13
|
-
(function (GetOrCreateUnregChatCommand) {
|
|
14
|
-
GetOrCreateUnregChatCommand.Request = zod_1.z.object({});
|
|
15
|
-
GetOrCreateUnregChatCommand.Response = schemas_1.ChatResponseSchema;
|
|
16
|
-
GetOrCreateUnregChatCommand.URL = (pageId) => rest_api_1.REST_API.V1.CHAT.UNREG.GET_OR_CREATE(pageId);
|
|
17
|
-
GetOrCreateUnregChatCommand.METHOD = http_method_1.HttpMethod.PUT;
|
|
18
|
-
})(GetOrCreateUnregChatCommand || (exports.GetOrCreateUnregChatCommand = GetOrCreateUnregChatCommand = {}));
|