@hed-hog/core 0.0.350 → 0.0.353
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/dist/access-log/access-log.controller.d.ts +16 -0
- package/dist/access-log/access-log.controller.d.ts.map +1 -0
- package/dist/access-log/access-log.controller.js +44 -0
- package/dist/access-log/access-log.controller.js.map +1 -0
- package/dist/access-log/access-log.interceptor.d.ts +9 -0
- package/dist/access-log/access-log.interceptor.d.ts.map +1 -0
- package/dist/access-log/access-log.interceptor.js +46 -0
- package/dist/access-log/access-log.interceptor.js.map +1 -0
- package/dist/access-log/access-log.module.d.ts +3 -0
- package/dist/access-log/access-log.module.d.ts.map +1 -0
- package/dist/access-log/access-log.module.js +29 -0
- package/dist/access-log/access-log.module.js.map +1 -0
- package/dist/access-log/access-log.service.d.ts +47 -0
- package/dist/access-log/access-log.service.d.ts.map +1 -0
- package/dist/access-log/access-log.service.js +113 -0
- package/dist/access-log/access-log.service.js.map +1 -0
- package/dist/access-log/dto/query-access-log.dto.d.ts +8 -0
- package/dist/access-log/dto/query-access-log.dto.d.ts.map +1 -0
- package/dist/access-log/dto/query-access-log.dto.js +42 -0
- package/dist/access-log/dto/query-access-log.dto.js.map +1 -0
- package/dist/auth/auth.controller.d.ts +9 -9
- package/dist/auth/auth.service.d.ts +19 -19
- package/dist/auth/auth.service.d.ts.map +1 -1
- package/dist/auth/auth.service.js +0 -4
- package/dist/auth/auth.service.js.map +1 -1
- package/dist/challenge/challenge.service.d.ts +2 -2
- package/dist/challenge/challenge.service.d.ts.map +1 -1
- package/dist/challenge/challenge.service.js +0 -1
- package/dist/challenge/challenge.service.js.map +1 -1
- package/dist/core/system.module.d.ts.map +1 -1
- package/dist/core/system.module.js +1 -0
- package/dist/core/system.module.js.map +1 -1
- package/dist/core.module.d.ts.map +1 -1
- package/dist/core.module.js +12 -0
- package/dist/core.module.js.map +1 -1
- package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +3 -3
- package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +3 -3
- package/dist/dashboard/dashboard.module.d.ts.map +1 -1
- package/dist/dashboard/dashboard.module.js +4 -1
- package/dist/dashboard/dashboard.module.js.map +1 -1
- package/dist/file/file.controller.js +0 -1
- package/dist/file/file.controller.js.map +1 -1
- package/dist/file/file.service.d.ts +65 -0
- package/dist/file/file.service.d.ts.map +1 -1
- package/dist/file/file.service.js +151 -3
- package/dist/file/file.service.js.map +1 -1
- package/dist/file/provider/abstract.provider.d.ts +8 -0
- package/dist/file/provider/abstract.provider.d.ts.map +1 -1
- package/dist/file/provider/abstract.provider.js.map +1 -1
- package/dist/file/provider/azure.provider.d.ts +4 -0
- package/dist/file/provider/azure.provider.d.ts.map +1 -1
- package/dist/file/provider/azure.provider.js +14 -0
- package/dist/file/provider/azure.provider.js.map +1 -1
- package/dist/file/provider/gcs.provider.d.ts +4 -0
- package/dist/file/provider/gcs.provider.d.ts.map +1 -1
- package/dist/file/provider/gcs.provider.js +14 -0
- package/dist/file/provider/gcs.provider.js.map +1 -1
- package/dist/file/provider/local.provider.d.ts +4 -0
- package/dist/file/provider/local.provider.d.ts.map +1 -1
- package/dist/file/provider/local.provider.js +19 -0
- package/dist/file/provider/local.provider.js.map +1 -1
- package/dist/file/provider/provider.factory.d.ts.map +1 -1
- package/dist/file/provider/provider.factory.js +3 -0
- package/dist/file/provider/provider.factory.js.map +1 -1
- package/dist/file/provider/s3.provider.d.ts +4 -0
- package/dist/file/provider/s3.provider.d.ts.map +1 -1
- package/dist/file/provider/s3.provider.js +17 -0
- package/dist/file/provider/s3.provider.js.map +1 -1
- package/dist/mcp/mcp-audit.service.d.ts +3 -1
- package/dist/mcp/mcp-audit.service.d.ts.map +1 -1
- package/dist/mcp/mcp-audit.service.js +14 -2
- package/dist/mcp/mcp-audit.service.js.map +1 -1
- package/dist/mcp/mcp.controller.d.ts +3 -1
- package/dist/mcp/mcp.controller.d.ts.map +1 -1
- package/dist/mcp/mcp.controller.js +10 -2
- package/dist/mcp/mcp.controller.js.map +1 -1
- package/dist/mcp/mcp.module.d.ts.map +1 -1
- package/dist/mcp/mcp.module.js +72 -0
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/tools/core-ai.mcp-tools.d.ts +45 -0
- package/dist/mcp/tools/core-ai.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-ai.mcp-tools.js +214 -0
- package/dist/mcp/tools/core-ai.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-dashboard-items.mcp-tools.d.ts +21 -0
- package/dist/mcp/tools/core-dashboard-items.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-dashboard-items.mcp-tools.js +89 -0
- package/dist/mcp/tools/core-dashboard-items.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-dashboard.mcp-tools.d.ts +29 -0
- package/dist/mcp/tools/core-dashboard.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-dashboard.mcp-tools.js +149 -0
- package/dist/mcp/tools/core-dashboard.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-event-webhooks.mcp-tools.d.ts +30 -0
- package/dist/mcp/tools/core-event-webhooks.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-event-webhooks.mcp-tools.js +185 -0
- package/dist/mcp/tools/core-event-webhooks.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-files.mcp-tools.d.ts +26 -0
- package/dist/mcp/tools/core-files.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-files.mcp-tools.js +140 -0
- package/dist/mcp/tools/core-files.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-integration-events.mcp-tools.d.ts +26 -0
- package/dist/mcp/tools/core-integration-events.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-integration-events.mcp-tools.js +168 -0
- package/dist/mcp/tools/core-integration-events.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts +32 -0
- package/dist/mcp/tools/core-mail-profile.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js +178 -0
- package/dist/mcp/tools/core-mail-profile.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-mail-sent.mcp-tools.d.ts +14 -0
- package/dist/mcp/tools/core-mail-sent.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-mail-sent.mcp-tools.js +106 -0
- package/dist/mcp/tools/core-mail-sent.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-mail.mcp-tools.d.ts +36 -0
- package/dist/mcp/tools/core-mail.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-mail.mcp-tools.js +184 -0
- package/dist/mcp/tools/core-mail.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-mcp-chat.mcp-tools.d.ts +21 -0
- package/dist/mcp/tools/core-mcp-chat.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-mcp-chat.mcp-tools.js +118 -0
- package/dist/mcp/tools/core-mcp-chat.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-menus.mcp-tools.d.ts +40 -0
- package/dist/mcp/tools/core-menus.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-menus.mcp-tools.js +268 -0
- package/dist/mcp/tools/core-menus.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-notifications.mcp-tools.d.ts +31 -0
- package/dist/mcp/tools/core-notifications.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-notifications.mcp-tools.js +178 -0
- package/dist/mcp/tools/core-notifications.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-profile.mcp-tools.d.ts +20 -0
- package/dist/mcp/tools/core-profile.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-profile.mcp-tools.js +111 -0
- package/dist/mcp/tools/core-profile.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-roles.mcp-tools.d.ts +70 -0
- package/dist/mcp/tools/core-roles.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-roles.mcp-tools.js +355 -0
- package/dist/mcp/tools/core-roles.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-routes.mcp-tools.d.ts +52 -0
- package/dist/mcp/tools/core-routes.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-routes.mcp-tools.js +254 -0
- package/dist/mcp/tools/core-routes.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-screens.mcp-tools.d.ts +47 -0
- package/dist/mcp/tools/core-screens.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-screens.mcp-tools.js +250 -0
- package/dist/mcp/tools/core-screens.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-sessions.mcp-tools.d.ts +20 -0
- package/dist/mcp/tools/core-sessions.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-sessions.mcp-tools.js +128 -0
- package/dist/mcp/tools/core-sessions.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-settings.mcp-tools.d.ts +25 -0
- package/dist/mcp/tools/core-settings.mcp-tools.d.ts.map +1 -1
- package/dist/mcp/tools/core-settings.mcp-tools.js +138 -0
- package/dist/mcp/tools/core-settings.mcp-tools.js.map +1 -1
- package/dist/mcp/tools/core-system.mcp-tools.d.ts +8 -0
- package/dist/mcp/tools/core-system.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-system.mcp-tools.js +40 -0
- package/dist/mcp/tools/core-system.mcp-tools.js.map +1 -0
- package/dist/mcp/tools/core-webhooks.mcp-tools.d.ts +46 -0
- package/dist/mcp/tools/core-webhooks.mcp-tools.d.ts.map +1 -0
- package/dist/mcp/tools/core-webhooks.mcp-tools.js +266 -0
- package/dist/mcp/tools/core-webhooks.mcp-tools.js.map +1 -0
- package/dist/mcp-chat/mcp-chat.controller.d.ts +1 -1
- package/dist/mcp-chat/mcp-chat.service.d.ts +25 -2
- package/dist/mcp-chat/mcp-chat.service.d.ts.map +1 -1
- package/dist/mcp-chat/mcp-chat.service.js +666 -36
- package/dist/mcp-chat/mcp-chat.service.js.map +1 -1
- package/dist/notification/notification.controller.d.ts +8 -4
- package/dist/notification/notification.controller.d.ts.map +1 -1
- package/dist/notification/notification.controller.js +12 -0
- package/dist/notification/notification.controller.js.map +1 -1
- package/dist/notification/notification.service.d.ts +19 -5
- package/dist/notification/notification.service.d.ts.map +1 -1
- package/dist/notification/notification.service.js +155 -9
- package/dist/notification/notification.service.js.map +1 -1
- package/dist/pdf/pdf.service.js +1 -1
- package/dist/pdf/pdf.service.js.map +1 -1
- package/dist/profile/profile.controller.d.ts +3 -3
- package/dist/profile/profile.controller.js +0 -1
- package/dist/profile/profile.controller.js.map +1 -1
- package/dist/profile/profile.module.d.ts.map +1 -1
- package/dist/profile/profile.module.js +1 -0
- package/dist/profile/profile.module.js.map +1 -1
- package/dist/profile/profile.service.d.ts +3 -3
- package/dist/session/session.controller.d.ts +2 -2
- package/dist/session/session.service.d.ts +6 -6
- package/dist/setting/setting.controller.d.ts +1 -1
- package/dist/setting/setting.service.d.ts +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +1 -4
- package/dist/setting/setting.service.js.map +1 -1
- package/dist/task/task.service.d.ts +1 -0
- package/dist/task/task.service.d.ts.map +1 -1
- package/dist/task/task.service.js +25 -0
- package/dist/task/task.service.js.map +1 -1
- package/dist/token/token.service.d.ts.map +1 -1
- package/dist/token/token.service.js +0 -1
- package/dist/token/token.service.js.map +1 -1
- package/dist/user/user.controller.d.ts +9 -9
- package/dist/user/user.service.d.ts +21 -21
- package/dist/webhook-integration/dto/webhook-action.dto.d.ts +22 -0
- package/dist/webhook-integration/dto/webhook-action.dto.d.ts.map +1 -0
- package/dist/webhook-integration/dto/webhook-action.dto.js +120 -0
- package/dist/webhook-integration/dto/webhook-action.dto.js.map +1 -0
- package/dist/webhook-integration/webhook-integration.controller.d.ts +7 -5
- package/dist/webhook-integration/webhook-integration.controller.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.controller.js +18 -5
- package/dist/webhook-integration/webhook-integration.controller.js.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.d.ts +14 -5
- package/dist/webhook-integration/webhook-integration.service.d.ts.map +1 -1
- package/dist/webhook-integration/webhook-integration.service.js +174 -41
- package/dist/webhook-integration/webhook-integration.service.js.map +1 -1
- package/hedhog/data/menu.yaml +15 -0
- package/hedhog/data/route.yaml +1304 -0
- package/hedhog/data/setting_group.yaml +67 -0
- package/hedhog/data/setting_subgroup.yaml +16 -0
- package/hedhog/frontend/app/access-log/page.tsx.ejs +772 -0
- package/hedhog/frontend/app/ai_agent/page.tsx.ejs +10 -3
- package/hedhog/frontend/app/dashboard/dashboard-home-tabs.tsx.ejs +33 -13
- package/hedhog/frontend/app/dashboard/management/tabs/components-tab.tsx.ejs +12 -5
- package/hedhog/frontend/app/dashboard/management/tabs/dashboards-tab.tsx.ejs +12 -5
- package/hedhog/frontend/app/integrations-webhooks/page.tsx.ejs +1817 -356
- package/hedhog/frontend/app/mcp_chat/chat-components.tsx.ejs +43 -5
- package/hedhog/frontend/app/mcp_chat/page.tsx.ejs +35 -7
- package/hedhog/frontend/app/menu/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/roles/page.tsx.ejs +18 -6
- package/hedhog/frontend/app/routes/page.tsx.ejs +9 -3
- package/hedhog/frontend/app/setting-list/page.tsx.ejs +344 -171
- package/hedhog/frontend/app/users/user-access-sheet.tsx.ejs +310 -304
- package/hedhog/frontend/app/users/user-sheet.tsx.ejs +25 -7
- package/hedhog/frontend/messages/en.json +104 -3
- package/hedhog/frontend/messages/pt.json +104 -3
- package/hedhog/table/access_log.yaml +31 -0
- package/package.json +4 -3
- package/src/access-log/access-log.controller.ts +29 -0
- package/src/access-log/access-log.interceptor.ts +38 -0
- package/src/access-log/access-log.module.ts +16 -0
- package/src/access-log/access-log.service.ts +129 -0
- package/src/access-log/dto/query-access-log.dto.ts +23 -0
- package/src/auth/auth.service.ts +0 -7
- package/src/challenge/challenge.service.ts +0 -2
- package/src/core/system.module.ts +1 -0
- package/src/core.module.ts +12 -0
- package/src/dashboard/dashboard.module.ts +4 -1
- package/src/file/file.controller.ts +14 -14
- package/src/file/file.service.ts +198 -4
- package/src/file/provider/abstract.provider.ts +10 -0
- package/src/file/provider/azure.provider.ts +24 -0
- package/src/file/provider/gcs.provider.ts +20 -0
- package/src/file/provider/local.provider.ts +30 -2
- package/src/file/provider/provider.factory.ts +3 -0
- package/src/file/provider/s3.provider.ts +22 -0
- package/src/mcp/mcp-audit.service.ts +47 -36
- package/src/mcp/mcp.controller.ts +40 -30
- package/src/mcp/mcp.module.ts +72 -0
- package/src/mcp/tools/core-ai.mcp-tools.ts +156 -0
- package/src/mcp/tools/core-dashboard-items.mcp-tools.ts +63 -0
- package/src/mcp/tools/core-dashboard.mcp-tools.ts +103 -0
- package/src/mcp/tools/core-event-webhooks.mcp-tools.ts +134 -0
- package/src/mcp/tools/core-files.mcp-tools.ts +105 -0
- package/src/mcp/tools/core-integration-events.mcp-tools.ts +118 -0
- package/src/mcp/tools/core-mail-profile.mcp-tools.ts +128 -0
- package/src/mcp/tools/core-mail-sent.mcp-tools.ts +76 -0
- package/src/mcp/tools/core-mail.mcp-tools.ts +130 -0
- package/src/mcp/tools/core-mcp-chat.mcp-tools.ts +81 -0
- package/src/mcp/tools/core-menus.mcp-tools.ts +197 -0
- package/src/mcp/tools/core-notifications.mcp-tools.ts +128 -0
- package/src/mcp/tools/core-profile.mcp-tools.ts +74 -0
- package/src/mcp/tools/core-roles.mcp-tools.ts +288 -0
- package/src/mcp/tools/core-routes.mcp-tools.ts +196 -0
- package/src/mcp/tools/core-screens.mcp-tools.ts +186 -0
- package/src/mcp/tools/core-sessions.mcp-tools.ts +97 -0
- package/src/mcp/tools/core-settings.mcp-tools.ts +171 -53
- package/src/mcp/tools/core-system.mcp-tools.ts +19 -0
- package/src/mcp/tools/core-webhooks.mcp-tools.ts +199 -0
- package/src/mcp-chat/mcp-chat.service.ts +887 -38
- package/src/notification/notification.controller.ts +20 -8
- package/src/notification/notification.service.ts +209 -9
- package/src/pdf/pdf.service.ts +1 -1
- package/src/profile/profile.controller.ts +1 -1
- package/src/profile/profile.module.ts +1 -0
- package/src/setting/setting.service.ts +8 -11
- package/src/task/task.service.ts +31 -0
- package/src/token/token.service.ts +0 -2
- package/src/webhook-integration/dto/webhook-action.dto.ts +96 -0
- package/src/webhook-integration/webhook-integration.controller.ts +124 -103
- package/src/webhook-integration/webhook-integration.service.ts +267 -64
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.CoreMenusMcpTools = void 0;
|
|
24
|
+
const common_1 = require("@nestjs/common");
|
|
25
|
+
const api_pagination_1 = require("@hed-hog/api-pagination");
|
|
26
|
+
const menu_service_1 = require("../../menu/menu.service");
|
|
27
|
+
const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
|
|
28
|
+
let CoreMenusMcpTools = class CoreMenusMcpTools {
|
|
29
|
+
constructor(menuService) {
|
|
30
|
+
this.menuService = menuService;
|
|
31
|
+
}
|
|
32
|
+
async getSystemMenu(_args, context) {
|
|
33
|
+
return this.menuService.getSystemMenu(context.locale, context.userId);
|
|
34
|
+
}
|
|
35
|
+
async getMenuStats(_args, _context) {
|
|
36
|
+
return this.menuService.stats();
|
|
37
|
+
}
|
|
38
|
+
async listAllMenus(_args, context) {
|
|
39
|
+
return this.menuService.listAll(context.locale);
|
|
40
|
+
}
|
|
41
|
+
async listMenus(args, context) {
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
|
+
return this.menuService.list(context.locale, {
|
|
44
|
+
page: (_a = args.page) !== null && _a !== void 0 ? _a : 1,
|
|
45
|
+
pageSize: (_b = args.pageSize) !== null && _b !== void 0 ? _b : 20,
|
|
46
|
+
search: (_c = args.search) !== null && _c !== void 0 ? _c : '',
|
|
47
|
+
sortField: (_d = args.sortField) !== null && _d !== void 0 ? _d : 'id',
|
|
48
|
+
sortOrder: (_e = args.sortOrder) !== null && _e !== void 0 ? _e : 'asc',
|
|
49
|
+
fields: '',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async getMenu(args, context) {
|
|
53
|
+
return this.menuService.get(context.locale, args.menuId);
|
|
54
|
+
}
|
|
55
|
+
async createMenu(args, context) {
|
|
56
|
+
return this.menuService.create(context.locale, args);
|
|
57
|
+
}
|
|
58
|
+
async updateMenu(args, context) {
|
|
59
|
+
const { menuId } = args, data = __rest(args, ["menuId"]);
|
|
60
|
+
return this.menuService.update(context.locale, { id: menuId, data: data });
|
|
61
|
+
}
|
|
62
|
+
async deleteMenus(args, context) {
|
|
63
|
+
return this.menuService.delete(context.locale, { ids: args.ids });
|
|
64
|
+
}
|
|
65
|
+
async updateMenuOrder(args, context) {
|
|
66
|
+
return this.menuService.updateOrder(context.locale, { ids: args.ids });
|
|
67
|
+
}
|
|
68
|
+
async listMenuRoles(args, context) {
|
|
69
|
+
var _a, _b;
|
|
70
|
+
return this.menuService.listRoles(context.locale, args.menuId, {
|
|
71
|
+
page: (_a = args.page) !== null && _a !== void 0 ? _a : 1,
|
|
72
|
+
pageSize: (_b = args.pageSize) !== null && _b !== void 0 ? _b : 20,
|
|
73
|
+
search: '',
|
|
74
|
+
sortField: 'id',
|
|
75
|
+
sortOrder: api_pagination_1.PageOrderDirection.Asc,
|
|
76
|
+
fields: '',
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async updateMenuRoles(args, context) {
|
|
80
|
+
return this.menuService.updateRoles(context.locale, args.menuId, { ids: args.ids });
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.CoreMenusMcpTools = CoreMenusMcpTools;
|
|
84
|
+
__decorate([
|
|
85
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
86
|
+
name: 'core.menus.system',
|
|
87
|
+
description: 'Returns the system menu for the authenticated user.',
|
|
88
|
+
inputSchema: { type: 'object', properties: {} },
|
|
89
|
+
readOnly: true,
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], CoreMenusMcpTools.prototype, "getSystemMenu", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
97
|
+
name: 'core.menus.stats',
|
|
98
|
+
description: 'Returns menu statistics. Admin only.',
|
|
99
|
+
inputSchema: { type: 'object', properties: {} },
|
|
100
|
+
readOnly: true,
|
|
101
|
+
}),
|
|
102
|
+
__metadata("design:type", Function),
|
|
103
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
104
|
+
__metadata("design:returntype", Promise)
|
|
105
|
+
], CoreMenusMcpTools.prototype, "getMenuStats", null);
|
|
106
|
+
__decorate([
|
|
107
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
108
|
+
name: 'core.menus.all',
|
|
109
|
+
description: 'Returns all menus as a flat list (no pagination). Admin only.',
|
|
110
|
+
inputSchema: { type: 'object', properties: {} },
|
|
111
|
+
readOnly: true,
|
|
112
|
+
}),
|
|
113
|
+
__metadata("design:type", Function),
|
|
114
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
115
|
+
__metadata("design:returntype", Promise)
|
|
116
|
+
], CoreMenusMcpTools.prototype, "listAllMenus", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
119
|
+
name: 'core.menus.list',
|
|
120
|
+
description: 'Lists menus with pagination. Admin only.',
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
page: { type: 'number', description: 'Page number (default: 1)' },
|
|
125
|
+
pageSize: { type: 'number', description: 'Items per page (default: 20)' },
|
|
126
|
+
search: { type: 'string', description: 'Search term' },
|
|
127
|
+
sortField: { type: 'string', description: 'Field to sort by' },
|
|
128
|
+
sortOrder: { type: 'string', enum: ['asc', 'desc'], description: 'Sort direction' },
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
readOnly: true,
|
|
132
|
+
}),
|
|
133
|
+
__metadata("design:type", Function),
|
|
134
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
135
|
+
__metadata("design:returntype", Promise)
|
|
136
|
+
], CoreMenusMcpTools.prototype, "listMenus", null);
|
|
137
|
+
__decorate([
|
|
138
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
139
|
+
name: 'core.menus.get',
|
|
140
|
+
description: 'Returns a single menu by ID. Admin only.',
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
menuId: { type: 'number', description: 'Menu ID' },
|
|
145
|
+
},
|
|
146
|
+
required: ['menuId'],
|
|
147
|
+
},
|
|
148
|
+
readOnly: true,
|
|
149
|
+
}),
|
|
150
|
+
__metadata("design:type", Function),
|
|
151
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
152
|
+
__metadata("design:returntype", Promise)
|
|
153
|
+
], CoreMenusMcpTools.prototype, "getMenu", null);
|
|
154
|
+
__decorate([
|
|
155
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
156
|
+
name: 'core.menus.create',
|
|
157
|
+
description: 'Creates a new menu item. Admin only.',
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: 'object',
|
|
160
|
+
properties: {
|
|
161
|
+
slug: { type: 'string', description: 'Menu slug' },
|
|
162
|
+
url: { type: 'string', description: 'Target URL' },
|
|
163
|
+
icon: { type: 'string', description: 'Icon identifier' },
|
|
164
|
+
order: { type: 'number', description: 'Display order' },
|
|
165
|
+
menu_id: { type: 'number', description: 'Parent menu ID' },
|
|
166
|
+
locale: { type: 'object', description: 'Locale translations, e.g. {"en": {"name": "Dashboard"}}' },
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
172
|
+
__metadata("design:returntype", Promise)
|
|
173
|
+
], CoreMenusMcpTools.prototype, "createMenu", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
176
|
+
name: 'core.menus.update',
|
|
177
|
+
description: 'Updates an existing menu item by ID. Admin only.',
|
|
178
|
+
inputSchema: {
|
|
179
|
+
type: 'object',
|
|
180
|
+
properties: {
|
|
181
|
+
menuId: { type: 'number', description: 'Menu ID' },
|
|
182
|
+
slug: { type: 'string', description: 'New slug' },
|
|
183
|
+
url: { type: 'string', description: 'New URL' },
|
|
184
|
+
icon: { type: 'string', description: 'New icon' },
|
|
185
|
+
order: { type: 'number', description: 'New display order' },
|
|
186
|
+
menu_id: { type: 'number', description: 'New parent menu ID' },
|
|
187
|
+
locale: { type: 'object', description: 'Updated locale translations' },
|
|
188
|
+
},
|
|
189
|
+
required: ['menuId'],
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
__metadata("design:type", Function),
|
|
193
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
194
|
+
__metadata("design:returntype", Promise)
|
|
195
|
+
], CoreMenusMcpTools.prototype, "updateMenu", null);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
198
|
+
name: 'core.menus.delete',
|
|
199
|
+
description: 'Deletes one or more menu items by their IDs. Admin only.',
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: 'object',
|
|
202
|
+
properties: {
|
|
203
|
+
ids: { type: 'array', items: { type: 'number' }, description: 'Menu IDs to delete' },
|
|
204
|
+
},
|
|
205
|
+
required: ['ids'],
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
__metadata("design:type", Function),
|
|
209
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
210
|
+
__metadata("design:returntype", Promise)
|
|
211
|
+
], CoreMenusMcpTools.prototype, "deleteMenus", null);
|
|
212
|
+
__decorate([
|
|
213
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
214
|
+
name: 'core.menus.order',
|
|
215
|
+
description: 'Updates the display order of menus. Admin only.',
|
|
216
|
+
inputSchema: {
|
|
217
|
+
type: 'object',
|
|
218
|
+
properties: {
|
|
219
|
+
ids: { type: 'array', items: { type: 'number' }, description: 'Menu IDs in the desired order' },
|
|
220
|
+
},
|
|
221
|
+
required: ['ids'],
|
|
222
|
+
},
|
|
223
|
+
}),
|
|
224
|
+
__metadata("design:type", Function),
|
|
225
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
226
|
+
__metadata("design:returntype", Promise)
|
|
227
|
+
], CoreMenusMcpTools.prototype, "updateMenuOrder", null);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
230
|
+
name: 'core.menus.roles.list',
|
|
231
|
+
description: 'Lists roles assigned to a menu. Admin only.',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
menuId: { type: 'number', description: 'Menu ID' },
|
|
236
|
+
page: { type: 'number', description: 'Page number (default: 1)' },
|
|
237
|
+
pageSize: { type: 'number', description: 'Items per page (default: 20)' },
|
|
238
|
+
},
|
|
239
|
+
required: ['menuId'],
|
|
240
|
+
},
|
|
241
|
+
readOnly: true,
|
|
242
|
+
}),
|
|
243
|
+
__metadata("design:type", Function),
|
|
244
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
245
|
+
__metadata("design:returntype", Promise)
|
|
246
|
+
], CoreMenusMcpTools.prototype, "listMenuRoles", null);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
249
|
+
name: 'core.menus.roles.update',
|
|
250
|
+
description: 'Replaces all roles assigned to a menu. Admin only.',
|
|
251
|
+
inputSchema: {
|
|
252
|
+
type: 'object',
|
|
253
|
+
properties: {
|
|
254
|
+
menuId: { type: 'number', description: 'Menu ID' },
|
|
255
|
+
ids: { type: 'array', items: { type: 'number' }, description: 'Role IDs to assign' },
|
|
256
|
+
},
|
|
257
|
+
required: ['menuId', 'ids'],
|
|
258
|
+
},
|
|
259
|
+
}),
|
|
260
|
+
__metadata("design:type", Function),
|
|
261
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
262
|
+
__metadata("design:returntype", Promise)
|
|
263
|
+
], CoreMenusMcpTools.prototype, "updateMenuRoles", null);
|
|
264
|
+
exports.CoreMenusMcpTools = CoreMenusMcpTools = __decorate([
|
|
265
|
+
(0, common_1.Injectable)(),
|
|
266
|
+
__metadata("design:paramtypes", [menu_service_1.MenuService])
|
|
267
|
+
], CoreMenusMcpTools);
|
|
268
|
+
//# sourceMappingURL=core-menus.mcp-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-menus.mcp-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/core-menus.mcp-tools.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,4DAA6D;AAC7D,0DAAsD;AACtD,yEAA2D;AAIpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,WAAwB;QAAxB,gBAAW,GAAX,WAAW,CAAa;IAAG,CAAC;IAQnD,AAAN,KAAK,CAAC,aAAa,CAAC,KAA0B,EAAE,OAAmB;QACjE,OAAO,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,CAAC;IAQK,AAAN,KAAK,CAAC,YAAY,CAAC,KAA0B,EAAE,QAAoB;QACjE,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAQK,AAAN,KAAK,CAAC,YAAY,CAAC,KAA0B,EAAE,OAAmB;QAChE,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;IAiBK,AAAN,KAAK,CAAC,SAAS,CACb,IAAmG,EACnG,OAAmB;;QAEnB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC3C,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,CAAC;YACpB,QAAQ,EAAE,MAAA,IAAI,CAAC,QAAQ,mCAAI,EAAE;YAC7B,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,EAAE;YACzB,SAAS,EAAE,MAAA,I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AE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,oBAAoB,EAAE;aACrF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;SAC5B;KACF,CAAC;;;;wDAGD;4BA5LU,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAE+B,0BAAW;GAD1C,iBAAiB,CA6L7B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { NotificationService } from '../../notification/notification.service';
|
|
2
|
+
import { McpContext } from '../types/mcp-context.type';
|
|
3
|
+
export declare class CoreNotificationsMcpTools {
|
|
4
|
+
private readonly notificationService;
|
|
5
|
+
constructor(notificationService: NotificationService);
|
|
6
|
+
listNotifications(args: {
|
|
7
|
+
page?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
}, context: McpContext): Promise<any>;
|
|
10
|
+
getUnreadCount(_args: Record<string, any>, context: McpContext): Promise<any>;
|
|
11
|
+
markRead(args: {
|
|
12
|
+
id: number;
|
|
13
|
+
}, context: McpContext): Promise<any>;
|
|
14
|
+
markAllRead(_args: Record<string, any>, context: McpContext): Promise<any>;
|
|
15
|
+
createNotification(args: {
|
|
16
|
+
userId: number;
|
|
17
|
+
title: string;
|
|
18
|
+
message: string;
|
|
19
|
+
type?: string;
|
|
20
|
+
}, _context: McpContext): Promise<any>;
|
|
21
|
+
deleteNotification(args: {
|
|
22
|
+
id: number;
|
|
23
|
+
}, context: McpContext): Promise<any>;
|
|
24
|
+
deleteAllNotifications(_args: Record<string, any>, context: McpContext): Promise<any>;
|
|
25
|
+
updateProgress(args: {
|
|
26
|
+
id: number;
|
|
27
|
+
progress: number;
|
|
28
|
+
status?: string;
|
|
29
|
+
}, context: McpContext): Promise<any>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=core-notifications.mcp-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-notifications.mcp-tools.d.ts","sourceRoot":"","sources":["../../../src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AAG,CAAC;IAiBrF,cAAc,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;CAMjH"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CoreNotificationsMcpTools = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const notification_service_1 = require("../../notification/notification.service");
|
|
15
|
+
const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
|
|
16
|
+
let CoreNotificationsMcpTools = class CoreNotificationsMcpTools {
|
|
17
|
+
constructor(notificationService) {
|
|
18
|
+
this.notificationService = notificationService;
|
|
19
|
+
}
|
|
20
|
+
async listNotifications(args, context) {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return this.notificationService.list(context.userId, {
|
|
23
|
+
page: (_a = args.page) !== null && _a !== void 0 ? _a : 1,
|
|
24
|
+
pageSize: (_b = args.pageSize) !== null && _b !== void 0 ? _b : 20,
|
|
25
|
+
search: '',
|
|
26
|
+
sortField: 'id',
|
|
27
|
+
sortOrder: 'desc',
|
|
28
|
+
fields: '',
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
async getUnreadCount(_args, context) {
|
|
32
|
+
return this.notificationService.unreadCount(context.userId);
|
|
33
|
+
}
|
|
34
|
+
async markRead(args, context) {
|
|
35
|
+
return this.notificationService.markRead(context.userId, args.id);
|
|
36
|
+
}
|
|
37
|
+
async markAllRead(_args, context) {
|
|
38
|
+
return this.notificationService.markAllRead(context.userId);
|
|
39
|
+
}
|
|
40
|
+
async createNotification(args, _context) {
|
|
41
|
+
return this.notificationService.create(args);
|
|
42
|
+
}
|
|
43
|
+
async deleteNotification(args, context) {
|
|
44
|
+
return this.notificationService.delete(context.userId, args.id);
|
|
45
|
+
}
|
|
46
|
+
async deleteAllNotifications(_args, context) {
|
|
47
|
+
return this.notificationService.deleteAll(context.userId);
|
|
48
|
+
}
|
|
49
|
+
async updateProgress(args, context) {
|
|
50
|
+
return this.notificationService.updateProgress(context.userId, args.id, {
|
|
51
|
+
progress: args.progress,
|
|
52
|
+
success: args.status === 'failed' ? false : args.status === 'completed' ? true : undefined,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.CoreNotificationsMcpTools = CoreNotificationsMcpTools;
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
59
|
+
name: 'core.notifications.list',
|
|
60
|
+
description: 'Lists notifications for the authenticated user.',
|
|
61
|
+
inputSchema: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
properties: {
|
|
64
|
+
page: { type: 'number', description: 'Page number (default: 1)' },
|
|
65
|
+
pageSize: { type: 'number', description: 'Items per page (default: 20)' },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
readOnly: true,
|
|
69
|
+
}),
|
|
70
|
+
__metadata("design:type", Function),
|
|
71
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
72
|
+
__metadata("design:returntype", Promise)
|
|
73
|
+
], CoreNotificationsMcpTools.prototype, "listNotifications", null);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
76
|
+
name: 'core.notifications.unread-count',
|
|
77
|
+
description: 'Returns the unread notification count for the authenticated user.',
|
|
78
|
+
inputSchema: { type: 'object', properties: {} },
|
|
79
|
+
readOnly: true,
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", Function),
|
|
82
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
83
|
+
__metadata("design:returntype", Promise)
|
|
84
|
+
], CoreNotificationsMcpTools.prototype, "getUnreadCount", null);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
87
|
+
name: 'core.notifications.mark-read',
|
|
88
|
+
description: 'Marks a specific notification as read.',
|
|
89
|
+
inputSchema: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
properties: {
|
|
92
|
+
id: { type: 'number', description: 'Notification ID' },
|
|
93
|
+
},
|
|
94
|
+
required: ['id'],
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
__metadata("design:type", Function),
|
|
98
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
99
|
+
__metadata("design:returntype", Promise)
|
|
100
|
+
], CoreNotificationsMcpTools.prototype, "markRead", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
103
|
+
name: 'core.notifications.mark-all-read',
|
|
104
|
+
description: 'Marks all notifications as read for the authenticated user.',
|
|
105
|
+
inputSchema: { type: 'object', properties: {} },
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], CoreNotificationsMcpTools.prototype, "markAllRead", null);
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
113
|
+
name: 'core.notifications.create',
|
|
114
|
+
description: 'Creates a new notification for a user. Admin only.',
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: 'object',
|
|
117
|
+
properties: {
|
|
118
|
+
userId: { type: 'number', description: 'Target user ID' },
|
|
119
|
+
title: { type: 'string', description: 'Notification title' },
|
|
120
|
+
message: { type: 'string', description: 'Notification message' },
|
|
121
|
+
type: { type: 'string', description: 'Notification type (e.g. info, success, error)' },
|
|
122
|
+
},
|
|
123
|
+
required: ['userId', 'title', 'message'],
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
__metadata("design:type", Function),
|
|
127
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
128
|
+
__metadata("design:returntype", Promise)
|
|
129
|
+
], CoreNotificationsMcpTools.prototype, "createNotification", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
132
|
+
name: 'core.notifications.delete',
|
|
133
|
+
description: 'Deletes a specific notification for the authenticated user.',
|
|
134
|
+
inputSchema: {
|
|
135
|
+
type: 'object',
|
|
136
|
+
properties: {
|
|
137
|
+
id: { type: 'number', description: 'Notification ID' },
|
|
138
|
+
},
|
|
139
|
+
required: ['id'],
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
__metadata("design:type", Function),
|
|
143
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
144
|
+
__metadata("design:returntype", Promise)
|
|
145
|
+
], CoreNotificationsMcpTools.prototype, "deleteNotification", null);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
148
|
+
name: 'core.notifications.delete-all',
|
|
149
|
+
description: 'Deletes all notifications for the authenticated user.',
|
|
150
|
+
inputSchema: { type: 'object', properties: {} },
|
|
151
|
+
}),
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
154
|
+
__metadata("design:returntype", Promise)
|
|
155
|
+
], CoreNotificationsMcpTools.prototype, "deleteAllNotifications", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
158
|
+
name: 'core.notifications.update-progress',
|
|
159
|
+
description: 'Updates the progress of a notification (e.g. for background job tracking).',
|
|
160
|
+
inputSchema: {
|
|
161
|
+
type: 'object',
|
|
162
|
+
properties: {
|
|
163
|
+
id: { type: 'number', description: 'Notification ID' },
|
|
164
|
+
progress: { type: 'number', description: 'Progress value (0-100)' },
|
|
165
|
+
status: { type: 'string', description: 'Status (e.g. in_progress, completed, failed)' },
|
|
166
|
+
},
|
|
167
|
+
required: ['id', 'progress'],
|
|
168
|
+
},
|
|
169
|
+
}),
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
172
|
+
__metadata("design:returntype", Promise)
|
|
173
|
+
], CoreNotificationsMcpTools.prototype, "updateProgress", null);
|
|
174
|
+
exports.CoreNotificationsMcpTools = CoreNotificationsMcpTools = __decorate([
|
|
175
|
+
(0, common_1.Injectable)(),
|
|
176
|
+
__metadata("design:paramtypes", [notification_service_1.NotificationService])
|
|
177
|
+
], CoreNotificationsMcpTools);
|
|
178
|
+
//# sourceMappingURL=core-notifications.mcp-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-notifications.mcp-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/core-notifications.mcp-tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kFAA8E;AAC9E,yEAA2D;AAIpD,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA6B,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;IAAG,CAAC;IAcnE,AAAN,KAAK,CAAC,iBAAiB,CAAC,IAA0C,EAAE,OAAmB;;QACrF,OAAO,IAAI,CAAC,mBAAmB,CA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,IAAA,4BAAO,EAAC;QACP,IAAI,EAAE,oCAAoC;QAC1C,WAAW,EAAE,4EAA4E;QACzF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;gBACtD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;gBACnE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8CAA8C,EAAE;aACxF;YACD,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC;SAC7B;KACF,CAAC;;;;+DAMD;oCAxHU,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAEuC,0CAAmB;GAD1D,yBAAyB,CAyHrC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ProfileService } from '../../profile/profile.service';
|
|
2
|
+
import { McpContext } from '../types/mcp-context.type';
|
|
3
|
+
export declare class CoreProfileMcpTools {
|
|
4
|
+
private readonly profileService;
|
|
5
|
+
constructor(profileService: ProfileService);
|
|
6
|
+
getProfile(_args: Record<string, any>, context: McpContext): Promise<any>;
|
|
7
|
+
updateProfile(args: {
|
|
8
|
+
name?: string;
|
|
9
|
+
}, context: McpContext): Promise<any>;
|
|
10
|
+
updatePreferences(args: {
|
|
11
|
+
theme?: string;
|
|
12
|
+
language?: string;
|
|
13
|
+
}, context: McpContext): Promise<any>;
|
|
14
|
+
getMfaMethods(_args: Record<string, any>, context: McpContext): Promise<any>;
|
|
15
|
+
changePassword(args: {
|
|
16
|
+
currentPassword: string;
|
|
17
|
+
newPassword: string;
|
|
18
|
+
}, context: McpContext): Promise<any>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=core-profile.mcp-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-profile.mcp-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/core-profile.mcp-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,qBACa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,cAAc;IAQrD,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAczE,aAAa,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAezE,iBAAiB,CAAC,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAUjG,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;IAgB5E,cAAc,CAAC,IAAI,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC;CAGhH"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CoreProfileMcpTools = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const profile_service_1 = require("../../profile/profile.service");
|
|
15
|
+
const mcp_tool_decorator_1 = require("../decorators/mcp-tool.decorator");
|
|
16
|
+
let CoreProfileMcpTools = class CoreProfileMcpTools {
|
|
17
|
+
constructor(profileService) {
|
|
18
|
+
this.profileService = profileService;
|
|
19
|
+
}
|
|
20
|
+
async getProfile(_args, context) {
|
|
21
|
+
return this.profileService.getProfile(context.userId);
|
|
22
|
+
}
|
|
23
|
+
async updateProfile(args, context) {
|
|
24
|
+
return this.profileService.update(context.userId, { name: args.name });
|
|
25
|
+
}
|
|
26
|
+
async updatePreferences(args, context) {
|
|
27
|
+
return this.profileService.updatePreferences(context.locale, context.userId, args);
|
|
28
|
+
}
|
|
29
|
+
async getMfaMethods(_args, context) {
|
|
30
|
+
return this.profileService.getMFAMethods(context.userId);
|
|
31
|
+
}
|
|
32
|
+
async changePassword(args, context) {
|
|
33
|
+
return this.profileService.changePassword(context.locale, context.userId, args);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
exports.CoreProfileMcpTools = CoreProfileMcpTools;
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
39
|
+
name: 'core.profile.get',
|
|
40
|
+
description: 'Returns the authenticated user profile.',
|
|
41
|
+
inputSchema: { type: 'object', properties: {} },
|
|
42
|
+
readOnly: true,
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
46
|
+
__metadata("design:returntype", Promise)
|
|
47
|
+
], CoreProfileMcpTools.prototype, "getProfile", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
50
|
+
name: 'core.profile.update',
|
|
51
|
+
description: 'Updates the authenticated user profile name.',
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: 'object',
|
|
54
|
+
properties: {
|
|
55
|
+
name: { type: 'string', description: 'New display name' },
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", Function),
|
|
60
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
61
|
+
__metadata("design:returntype", Promise)
|
|
62
|
+
], CoreProfileMcpTools.prototype, "updateProfile", null);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
65
|
+
name: 'core.profile.update-preferences',
|
|
66
|
+
description: 'Updates authenticated user preferences such as theme and language.',
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: 'object',
|
|
69
|
+
properties: {
|
|
70
|
+
theme: { type: 'string', description: 'UI theme (e.g. dark, light)' },
|
|
71
|
+
language: { type: 'string', description: 'Locale code (e.g. en, pt-BR)' },
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
__metadata("design:type", Function),
|
|
76
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
77
|
+
__metadata("design:returntype", Promise)
|
|
78
|
+
], CoreProfileMcpTools.prototype, "updatePreferences", null);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
81
|
+
name: 'core.profile.mfa.list',
|
|
82
|
+
description: 'Returns the MFA methods configured for the authenticated user.',
|
|
83
|
+
inputSchema: { type: 'object', properties: {} },
|
|
84
|
+
readOnly: true,
|
|
85
|
+
}),
|
|
86
|
+
__metadata("design:type", Function),
|
|
87
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
88
|
+
__metadata("design:returntype", Promise)
|
|
89
|
+
], CoreProfileMcpTools.prototype, "getMfaMethods", null);
|
|
90
|
+
__decorate([
|
|
91
|
+
(0, mcp_tool_decorator_1.McpTool)({
|
|
92
|
+
name: 'core.profile.change-password',
|
|
93
|
+
description: 'Changes the password of the authenticated user.',
|
|
94
|
+
inputSchema: {
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: {
|
|
97
|
+
currentPassword: { type: 'string', description: 'Current password' },
|
|
98
|
+
newPassword: { type: 'string', description: 'New password (must meet strength requirements)' },
|
|
99
|
+
},
|
|
100
|
+
required: ['currentPassword', 'newPassword'],
|
|
101
|
+
},
|
|
102
|
+
}),
|
|
103
|
+
__metadata("design:type", Function),
|
|
104
|
+
__metadata("design:paramtypes", [Object, Object]),
|
|
105
|
+
__metadata("design:returntype", Promise)
|
|
106
|
+
], CoreProfileMcpTools.prototype, "changePassword", null);
|
|
107
|
+
exports.CoreProfileMcpTools = CoreProfileMcpTools = __decorate([
|
|
108
|
+
(0, common_1.Injectable)(),
|
|
109
|
+
__metadata("design:paramtypes", [profile_service_1.ProfileService])
|
|
110
|
+
], CoreProfileMcpTools);
|
|
111
|
+
//# sourceMappingURL=core-profile.mcp-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-profile.mcp-tools.js","sourceRoot":"","sources":["../../../src/mcp/tools/core-profile.mcp-tools.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mEAA+D;AAC/D,yEAA2D;AAIpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAQzD,AAAN,KAAK,CAAC,UAAU,CAAC,KAA0B,EAAE,OAAmB;QAC9D,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC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