@veruna/api-contracts 1.0.23 → 1.0.24

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.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Chat Controller paths for NestJS @Controller decorator
3
+ */
4
+ export declare const CHAT_UNREG_CONTROLLER: "v1/unreg/page/:pageId/chat";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_UNREG_CONTROLLER = void 0;
4
+ /**
5
+ * Chat Controller paths for NestJS @Controller decorator
6
+ */
7
+ exports.CHAT_UNREG_CONTROLLER = 'v1/unreg/page/:pageId/chat';
@@ -10,3 +10,4 @@ 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';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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
  */
@@ -28,3 +28,5 @@ var file_controllers_1 = require("./file.controllers");
28
28
  Object.defineProperty(exports, "FILE_CONTROLLER", { enumerable: true, get: function () { return file_controllers_1.FILE_CONTROLLER; } });
29
29
  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
+ var chat_controllers_1 = require("./chat.controllers");
32
+ Object.defineProperty(exports, "CHAT_UNREG_CONTROLLER", { enumerable: true, get: function () { return chat_controllers_1.CHAT_UNREG_CONTROLLER; } });
@@ -104,5 +104,10 @@ export declare const REST_API: {
104
104
  readonly UPDATE: (uuid: string) => string;
105
105
  readonly DELETE: (uuid: string) => string;
106
106
  };
107
+ readonly CHAT: {
108
+ readonly UNREG: {
109
+ readonly GET_OR_CREATE: (pageId: string) => string;
110
+ };
111
+ };
107
112
  };
108
113
  };
package/build/rest-api.js CHANGED
@@ -121,5 +121,10 @@ exports.REST_API = {
121
121
  UPDATE: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}`,
122
122
  DELETE: (uuid) => `${exports.ROOT}/${controllers_1.CHAT_PROJECT_CONTROLLER}/${uuid}`,
123
123
  },
124
+ CHAT: {
125
+ UNREG: {
126
+ GET_OR_CREATE: (pageId) => `${exports.ROOT}/${controllers_1.CHAT_UNREG_CONTROLLER.replace(':pageId', pageId)}`,
127
+ },
128
+ },
124
129
  },
125
130
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Chat Routes
3
+ */
4
+ export declare const CHAT_UNREG_ROUTES: {
5
+ readonly GET_OR_CREATE: "";
6
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_UNREG_ROUTES = void 0;
4
+ /**
5
+ * Chat Routes
6
+ */
7
+ exports.CHAT_UNREG_ROUTES = {
8
+ GET_OR_CREATE: '',
9
+ };
@@ -15,3 +15,4 @@ 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';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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
  */
@@ -33,3 +33,5 @@ var file_routes_1 = require("./file.routes");
33
33
  Object.defineProperty(exports, "FILE_ROUTES", { enumerable: true, get: function () { return file_routes_1.FILE_ROUTES; } });
34
34
  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
+ var chat_routes_1 = require("./chat.routes");
37
+ Object.defineProperty(exports, "CHAT_UNREG_ROUTES", { enumerable: true, get: function () { return chat_routes_1.CHAT_UNREG_ROUTES; } });
@@ -0,0 +1,7 @@
1
+ import { ErrorMetadata } from '../../shared';
2
+ export declare enum ChatErrorCode {
3
+ PAGE_NOT_FOUND = "PAGE_NOT_FOUND",
4
+ PAGE_ID_REQUIRED = "PAGE_ID_REQUIRED",
5
+ CHAT_NOT_FOUND = "CHAT_NOT_FOUND"
6
+ }
7
+ export declare const CHAT_ERRORS: Record<ChatErrorCode, ErrorMetadata>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CHAT_ERRORS = exports.ChatErrorCode = void 0;
4
+ var ChatErrorCode;
5
+ (function (ChatErrorCode) {
6
+ ChatErrorCode["PAGE_NOT_FOUND"] = "PAGE_NOT_FOUND";
7
+ ChatErrorCode["PAGE_ID_REQUIRED"] = "PAGE_ID_REQUIRED";
8
+ ChatErrorCode["CHAT_NOT_FOUND"] = "CHAT_NOT_FOUND";
9
+ })(ChatErrorCode || (exports.ChatErrorCode = ChatErrorCode = {}));
10
+ exports.CHAT_ERRORS = {
11
+ [ChatErrorCode.PAGE_NOT_FOUND]: {
12
+ code: ChatErrorCode.PAGE_NOT_FOUND,
13
+ statusCode: 404,
14
+ },
15
+ [ChatErrorCode.PAGE_ID_REQUIRED]: {
16
+ code: ChatErrorCode.PAGE_ID_REQUIRED,
17
+ statusCode: 400,
18
+ },
19
+ [ChatErrorCode.CHAT_NOT_FOUND]: {
20
+ code: ChatErrorCode.CHAT_NOT_FOUND,
21
+ statusCode: 404,
22
+ },
23
+ };
@@ -0,0 +1,22 @@
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
+ }
@@ -0,0 +1,18 @@
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 = {}));
@@ -0,0 +1 @@
1
+ export { GetOrCreateUnregChatCommand } from './get-or-create-unreg-chat.command';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOrCreateUnregChatCommand = void 0;
4
+ var get_or_create_unreg_chat_command_1 = require("./get-or-create-unreg-chat.command");
5
+ Object.defineProperty(exports, "GetOrCreateUnregChatCommand", { enumerable: true, get: function () { return get_or_create_unreg_chat_command_1.GetOrCreateUnregChatCommand; } });
@@ -0,0 +1,3 @@
1
+ export * from './schemas';
2
+ export * from './commands';
3
+ export * from './chat.errors';
@@ -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("./chat.errors"), exports);
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ import { ChatStatus } from './chat-status.enum';
3
+ export declare const ChatResponseSchema: 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
+ }, z.core.$strip>;
12
+ export type ChatResponseDto = z.infer<typeof ChatResponseSchema>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatResponseSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const chat_status_enum_1 = require("./chat-status.enum");
6
+ exports.ChatResponseSchema = zod_1.z.object({
7
+ uuid: zod_1.z.string().uuid(),
8
+ title: zod_1.z.string(),
9
+ status: zod_1.z.nativeEnum(chat_status_enum_1.ChatStatus),
10
+ pageId: zod_1.z.string().uuid().nullable(),
11
+ folderId: zod_1.z.string().uuid().nullable(),
12
+ createdAt: zod_1.z.string(),
13
+ updatedAt: zod_1.z.string(),
14
+ });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Chat status enum
3
+ */
4
+ export declare enum ChatStatus {
5
+ NEW = "new",
6
+ ACTIVE = "active",
7
+ DELETED = "deleted"
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChatStatus = void 0;
4
+ /**
5
+ * Chat status enum
6
+ */
7
+ var ChatStatus;
8
+ (function (ChatStatus) {
9
+ ChatStatus["NEW"] = "new";
10
+ ChatStatus["ACTIVE"] = "active";
11
+ ChatStatus["DELETED"] = "deleted";
12
+ })(ChatStatus || (exports.ChatStatus = ChatStatus = {}));
@@ -0,0 +1,5 @@
1
+ export { ChatStatus } from './chat-status.enum';
2
+ export { ChatResponseSchema } from './chat-response.schema';
3
+ export type { ChatResponseDto } from './chat-response.schema';
4
+ export { PageIdParamSchema } from './page-id-param.schema';
5
+ export type { PageIdParamDto } from './page-id-param.schema';
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageIdParamSchema = exports.ChatResponseSchema = exports.ChatStatus = void 0;
4
+ var chat_status_enum_1 = require("./chat-status.enum");
5
+ Object.defineProperty(exports, "ChatStatus", { enumerable: true, get: function () { return chat_status_enum_1.ChatStatus; } });
6
+ var chat_response_schema_1 = require("./chat-response.schema");
7
+ Object.defineProperty(exports, "ChatResponseSchema", { enumerable: true, get: function () { return chat_response_schema_1.ChatResponseSchema; } });
8
+ var page_id_param_schema_1 = require("./page-id-param.schema");
9
+ Object.defineProperty(exports, "PageIdParamSchema", { enumerable: true, get: function () { return page_id_param_schema_1.PageIdParamSchema; } });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const PageIdParamSchema: z.ZodObject<{
3
+ pageId: z.ZodString;
4
+ }, z.core.$strip>;
5
+ export type PageIdParamDto = z.infer<typeof PageIdParamSchema>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PageIdParamSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.PageIdParamSchema = zod_1.z.object({
6
+ pageId: zod_1.z.string().uuid(),
7
+ });
@@ -8,3 +8,4 @@ export * from './seo-pages';
8
8
  export * from './ai-provider';
9
9
  export * from './ai-model';
10
10
  export * from './chat-project';
11
+ export * from './chat';
package/build/v1/index.js CHANGED
@@ -24,3 +24,4 @@ __exportStar(require("./seo-pages"), exports);
24
24
  __exportStar(require("./ai-provider"), exports);
25
25
  __exportStar(require("./ai-model"), exports);
26
26
  __exportStar(require("./chat-project"), exports);
27
+ __exportStar(require("./chat"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veruna/api-contracts",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "API contracts for Veruna project - Zod schemas, types, and paths",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",