@hed-hog/core 0.0.338 → 0.0.349
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/auth/auth.controller.d.ts +1 -1
- package/dist/auth/auth.service.d.ts +1 -1
- package/dist/dashboard/dashboard/dashboard.controller.d.ts +12 -12
- package/dist/dashboard/dashboard/dashboard.service.d.ts +12 -12
- package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +3 -3
- package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +3 -3
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts +3 -3
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts +3 -3
- package/dist/dashboard/dashboard-core/dashboard-core.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-core/dashboard-core.service.d.ts +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +1 -1
- package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +1 -1
- package/dist/dashboard/dashboard-role/dashboard-role.controller.d.ts +4 -4
- package/dist/dashboard/dashboard-role/dashboard-role.service.d.ts +4 -4
- package/dist/mail-profile/mail-profile.service.js +1 -1
- package/dist/mail-profile/mail-profile.service.js.map +1 -1
- package/dist/mail-sent/mail-sent.controller.d.ts +3 -3
- package/dist/mail-sent/mail-sent.service.d.ts +3 -3
- package/dist/menu/menu.controller.d.ts +3 -3
- package/dist/menu/menu.service.d.ts +3 -3
- package/dist/profile/profile.controller.d.ts +1 -1
- package/dist/profile/profile.service.d.ts +1 -1
- package/dist/screen/screen.controller.d.ts +3 -3
- package/dist/screen/screen.service.d.ts +3 -3
- package/dist/session/session.service.d.ts +2 -0
- package/dist/session/session.service.d.ts.map +1 -1
- package/dist/session/session.service.js +9 -6
- package/dist/session/session.service.js.map +1 -1
- package/dist/user/user.controller.d.ts +2 -2
- package/dist/user/user.service.d.ts +4 -4
- package/hedhog/frontend/app/routes/page.tsx.ejs +1339 -0
- package/hedhog/frontend/messages/en.json +74 -0
- package/hedhog/frontend/messages/pt.json +74 -0
- package/package.json +4 -4
- package/src/mail-profile/mail-profile.service.ts +1 -1
- package/src/session/session.service.ts +10 -7
|
@@ -341,6 +341,80 @@
|
|
|
341
341
|
"goToNextPage": "Go to next page",
|
|
342
342
|
"goToLastPage": "Go to last page"
|
|
343
343
|
},
|
|
344
|
+
"RoutePage": {
|
|
345
|
+
"title": "Routes Management",
|
|
346
|
+
"description": "Manage HTTP routes, MCP tools, and their relationships.",
|
|
347
|
+
"routes": "Routes",
|
|
348
|
+
"home": "Home",
|
|
349
|
+
"buttonAddRoute": "Add route",
|
|
350
|
+
"buttonEditRoute": "Edit",
|
|
351
|
+
"buttonDeleteRoute": "Delete route",
|
|
352
|
+
"dialogAddRouteTitle": "Add new route",
|
|
353
|
+
"dialogAddRouteDescription": "Register an HTTP route or MCP tool and then relate roles and screens.",
|
|
354
|
+
"titleEditRoute": "Edit route",
|
|
355
|
+
"searchPlaceholder": "Search by URL, method, name, or tool...",
|
|
356
|
+
"viewMode": "View",
|
|
357
|
+
"viewModeCards": "Cards",
|
|
358
|
+
"viewModeList": "List",
|
|
359
|
+
"selectType": "Type",
|
|
360
|
+
"selectMethod": "HTTP method",
|
|
361
|
+
"allTypes": "All types",
|
|
362
|
+
"allMethods": "All methods",
|
|
363
|
+
"totalRoutes": "Total routes",
|
|
364
|
+
"httpRoutes": "HTTP routes",
|
|
365
|
+
"mcpRoutes": "MCP tools",
|
|
366
|
+
"filteredRoutes": "Results",
|
|
367
|
+
"noRoutesFound": "No routes found",
|
|
368
|
+
"emptyDescription": "Adjust the filters or create the first route to get started.",
|
|
369
|
+
"routeCreatedSuccess": "Route created successfully",
|
|
370
|
+
"routeUpdatedSuccess": "Route updated successfully",
|
|
371
|
+
"routeDeletedSuccess": "Route deleted successfully",
|
|
372
|
+
"serverError": "An error occurred. Please try again later.",
|
|
373
|
+
"tabBasicInfo": "Information",
|
|
374
|
+
"tabRoles": "Roles",
|
|
375
|
+
"tabScreens": "Screens",
|
|
376
|
+
"basicInfoTitle": "Route details",
|
|
377
|
+
"basicInfoDescription": "Define the route type and the data needed to identify it in the system.",
|
|
378
|
+
"formTypeLabel": "Type",
|
|
379
|
+
"formUrlLabel": "URL",
|
|
380
|
+
"formUrlPlaceholder": "/users/:id",
|
|
381
|
+
"formMethodLabel": "Method",
|
|
382
|
+
"formToolNameLabel": "Tool name",
|
|
383
|
+
"formToolNamePlaceholder": "core.users.routes",
|
|
384
|
+
"formNameLabel": "Display name",
|
|
385
|
+
"formNamePlaceholder": "List user routes",
|
|
386
|
+
"formOptionalNameLabel": "Internal name",
|
|
387
|
+
"formOptionalNamePlaceholder": "User read access",
|
|
388
|
+
"errorUrlRequired": "URL is required for HTTP routes",
|
|
389
|
+
"errorMethodRequired": "Method is required for HTTP routes",
|
|
390
|
+
"errorToolNameRequired": "Tool name is required for MCP routes",
|
|
391
|
+
"saveChanges": "Save changes",
|
|
392
|
+
"cancel": "Cancel",
|
|
393
|
+
"rolesTitle": "Linked roles",
|
|
394
|
+
"rolesDescription": "Enable or disable access to this route by role.",
|
|
395
|
+
"loadingRoles": "Loading roles...",
|
|
396
|
+
"searchRoles": "Search roles...",
|
|
397
|
+
"noRolesFound": "No roles found",
|
|
398
|
+
"roleAssigned": "Role linked successfully",
|
|
399
|
+
"roleRemoved": "Role removed successfully",
|
|
400
|
+
"errorAssigningRole": "Error linking role",
|
|
401
|
+
"errorRemovingRole": "Error removing role",
|
|
402
|
+
"screensTitle": "Linked screens",
|
|
403
|
+
"screensDescription": "Define which screens use or represent this route.",
|
|
404
|
+
"loadingScreens": "Loading screens...",
|
|
405
|
+
"searchScreens": "Search screens...",
|
|
406
|
+
"noScreensFound": "No screens found",
|
|
407
|
+
"screenAssigned": "Screen linked successfully",
|
|
408
|
+
"screenRemoved": "Screen removed successfully",
|
|
409
|
+
"errorAssigningScreen": "Error linking screen",
|
|
410
|
+
"errorRemovingScreen": "Error removing screen",
|
|
411
|
+
"rolesCount": "{count} roles",
|
|
412
|
+
"screensCount": "{count} screens",
|
|
413
|
+
"dialogDeleteRouteTitle": "Confirm route deletion",
|
|
414
|
+
"dialogDeleteRouteDescription": "Are you sure you want to delete this route? This action cannot be undone.",
|
|
415
|
+
"deleteRouteCancel": "Cancel",
|
|
416
|
+
"deleteRouteConfirm": "Delete route"
|
|
417
|
+
},
|
|
344
418
|
"MailPage": {
|
|
345
419
|
"breadcrumbHome": "Home",
|
|
346
420
|
"breadcrumbTitle": "Email Templates",
|
|
@@ -341,6 +341,80 @@
|
|
|
341
341
|
"goToNextPage": "Ir para próxima página",
|
|
342
342
|
"goToLastPage": "Ir para última página"
|
|
343
343
|
},
|
|
344
|
+
"RoutePage": {
|
|
345
|
+
"title": "Gerenciamento de Rotas",
|
|
346
|
+
"description": "Gerencie rotas HTTP, ferramentas MCP e seus relacionamentos.",
|
|
347
|
+
"routes": "Rotas",
|
|
348
|
+
"home": "Home",
|
|
349
|
+
"buttonAddRoute": "Adicionar rota",
|
|
350
|
+
"buttonEditRoute": "Editar",
|
|
351
|
+
"buttonDeleteRoute": "Excluir rota",
|
|
352
|
+
"dialogAddRouteTitle": "Adicionar nova rota",
|
|
353
|
+
"dialogAddRouteDescription": "Cadastre uma rota HTTP ou ferramenta MCP e depois relacione cargos e telas.",
|
|
354
|
+
"titleEditRoute": "Editar rota",
|
|
355
|
+
"searchPlaceholder": "Pesquisar por URL, método, nome ou ferramenta...",
|
|
356
|
+
"viewMode": "Visualização",
|
|
357
|
+
"viewModeCards": "Cards",
|
|
358
|
+
"viewModeList": "Lista",
|
|
359
|
+
"selectType": "Tipo",
|
|
360
|
+
"selectMethod": "Método HTTP",
|
|
361
|
+
"allTypes": "Todos os tipos",
|
|
362
|
+
"allMethods": "Todos os métodos",
|
|
363
|
+
"totalRoutes": "Total de rotas",
|
|
364
|
+
"httpRoutes": "Rotas HTTP",
|
|
365
|
+
"mcpRoutes": "Ferramentas MCP",
|
|
366
|
+
"filteredRoutes": "Resultados",
|
|
367
|
+
"noRoutesFound": "Nenhuma rota encontrada",
|
|
368
|
+
"emptyDescription": "Ajuste os filtros ou crie a primeira rota para começar.",
|
|
369
|
+
"routeCreatedSuccess": "Rota criada com sucesso",
|
|
370
|
+
"routeUpdatedSuccess": "Rota atualizada com sucesso",
|
|
371
|
+
"routeDeletedSuccess": "Rota excluída com sucesso",
|
|
372
|
+
"serverError": "Ocorreu um erro. Por favor, tente novamente mais tarde.",
|
|
373
|
+
"tabBasicInfo": "Informações",
|
|
374
|
+
"tabRoles": "Cargos",
|
|
375
|
+
"tabScreens": "Telas",
|
|
376
|
+
"basicInfoTitle": "Dados da rota",
|
|
377
|
+
"basicInfoDescription": "Defina o tipo da rota e as informações necessárias para identificá-la no sistema.",
|
|
378
|
+
"formTypeLabel": "Tipo",
|
|
379
|
+
"formUrlLabel": "URL",
|
|
380
|
+
"formUrlPlaceholder": "/users/:id",
|
|
381
|
+
"formMethodLabel": "Método",
|
|
382
|
+
"formToolNameLabel": "Nome da ferramenta",
|
|
383
|
+
"formToolNamePlaceholder": "core.users.routes",
|
|
384
|
+
"formNameLabel": "Nome de exibição",
|
|
385
|
+
"formNamePlaceholder": "Listar rotas de usuários",
|
|
386
|
+
"formOptionalNameLabel": "Nome interno",
|
|
387
|
+
"formOptionalNamePlaceholder": "Leitura de usuários",
|
|
388
|
+
"errorUrlRequired": "A URL é obrigatória para rotas HTTP",
|
|
389
|
+
"errorMethodRequired": "O método é obrigatório para rotas HTTP",
|
|
390
|
+
"errorToolNameRequired": "O nome da ferramenta é obrigatório para rotas MCP",
|
|
391
|
+
"saveChanges": "Salvar alterações",
|
|
392
|
+
"cancel": "Cancelar",
|
|
393
|
+
"rolesTitle": "Cargos vinculados",
|
|
394
|
+
"rolesDescription": "Ative ou desative o acesso desta rota por cargo.",
|
|
395
|
+
"loadingRoles": "Carregando cargos...",
|
|
396
|
+
"searchRoles": "Buscar cargos...",
|
|
397
|
+
"noRolesFound": "Nenhum cargo encontrado",
|
|
398
|
+
"roleAssigned": "Cargo associado com sucesso",
|
|
399
|
+
"roleRemoved": "Cargo removido com sucesso",
|
|
400
|
+
"errorAssigningRole": "Erro ao associar cargo",
|
|
401
|
+
"errorRemovingRole": "Erro ao remover cargo",
|
|
402
|
+
"screensTitle": "Telas vinculadas",
|
|
403
|
+
"screensDescription": "Defina quais telas utilizam ou representam esta rota.",
|
|
404
|
+
"loadingScreens": "Carregando telas...",
|
|
405
|
+
"searchScreens": "Buscar telas...",
|
|
406
|
+
"noScreensFound": "Nenhuma tela encontrada",
|
|
407
|
+
"screenAssigned": "Tela associada com sucesso",
|
|
408
|
+
"screenRemoved": "Tela removida com sucesso",
|
|
409
|
+
"errorAssigningScreen": "Erro ao associar tela",
|
|
410
|
+
"errorRemovingScreen": "Erro ao remover tela",
|
|
411
|
+
"rolesCount": "{count} cargos",
|
|
412
|
+
"screensCount": "{count} telas",
|
|
413
|
+
"dialogDeleteRouteTitle": "Confirmar exclusão da rota",
|
|
414
|
+
"dialogDeleteRouteDescription": "Tem certeza que deseja excluir esta rota? Esta ação não pode ser desfeita.",
|
|
415
|
+
"deleteRouteCancel": "Cancelar",
|
|
416
|
+
"deleteRouteConfirm": "Excluir rota"
|
|
417
|
+
},
|
|
344
418
|
"MailPage": {
|
|
345
419
|
"breadcrumbHome": "Início",
|
|
346
420
|
"breadcrumbTitle": "Templates de E-mail",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.349",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"uuid": "^11.1.0",
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
34
34
|
"@hed-hog/api-locale": "0.0.14",
|
|
35
|
-
"@hed-hog/api-types": "0.0.1",
|
|
36
|
-
"@hed-hog/api-mail": "0.0.9",
|
|
37
35
|
"@hed-hog/api-pagination": "0.0.7",
|
|
36
|
+
"@hed-hog/api-prisma": "0.0.6",
|
|
38
37
|
"@hed-hog/api": "0.0.8",
|
|
39
|
-
"@hed-hog/api-
|
|
38
|
+
"@hed-hog/api-mail": "0.0.9",
|
|
39
|
+
"@hed-hog/api-types": "0.0.1"
|
|
40
40
|
},
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
@@ -27,7 +27,7 @@ export class MailProfileService {
|
|
|
27
27
|
) {}
|
|
28
28
|
|
|
29
29
|
async list(paginationParams: PaginationDTO) {
|
|
30
|
-
const fields = ['slug', 'name', '
|
|
30
|
+
const fields = ['slug', 'name', 'from_email', 'reply_to_email'];
|
|
31
31
|
const OR = this.prismaService.createInsensitiveSearch(fields, paginationParams);
|
|
32
32
|
|
|
33
33
|
return this.paginationService.paginate(
|
|
@@ -112,7 +112,7 @@ export class SessionService {
|
|
|
112
112
|
|
|
113
113
|
const maxSessions = Number(settings['max-concurrent-sessions']) || 0;
|
|
114
114
|
if (maxSessions > 0) {
|
|
115
|
-
await this.enforceSessionLimit(session.user_id, maxSessions);
|
|
115
|
+
await this.enforceSessionLimit(session.user_id, maxSessions, true);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
const nextRefreshToken = await this.token.createOpaqueToken();
|
|
@@ -363,12 +363,13 @@ export class SessionService {
|
|
|
363
363
|
/**
|
|
364
364
|
* Enforce maximum concurrent sessions limit for a user.
|
|
365
365
|
* If the limit is reached, expires the oldest sessions to make room for new ones.
|
|
366
|
-
*
|
|
366
|
+
*
|
|
367
367
|
* @param userId - The user ID to check
|
|
368
368
|
* @param maxSessions - Maximum number of concurrent sessions allowed
|
|
369
|
+
* @param isRotation - When true, the calling flow is replacing an existing session (refresh),
|
|
370
|
+
* not adding a new one, so no extra slot needs to be freed.
|
|
369
371
|
*/
|
|
370
|
-
private async enforceSessionLimit(userId: number, maxSessions: number): Promise<void> {
|
|
371
|
-
// Count active sessions for this user
|
|
372
|
+
private async enforceSessionLimit(userId: number, maxSessions: number, isRotation = false): Promise<void> {
|
|
372
373
|
const activeSessions = await this.prisma.user_session.findMany({
|
|
373
374
|
where: {
|
|
374
375
|
user_id: userId,
|
|
@@ -385,8 +386,10 @@ export class SessionService {
|
|
|
385
386
|
}
|
|
386
387
|
});
|
|
387
388
|
|
|
388
|
-
//
|
|
389
|
-
|
|
389
|
+
// During a rotation the current session is replaced (not added), so the net change is 0.
|
|
390
|
+
// During creation a new session is added, so we need one extra free slot (+1).
|
|
391
|
+
const slotsNeeded = isRotation ? 0 : 1;
|
|
392
|
+
const sessionsToExpire = activeSessions.length - maxSessions + slotsNeeded;
|
|
390
393
|
if (sessionsToExpire > 0) {
|
|
391
394
|
const sessionIdsToExpire = activeSessions
|
|
392
395
|
.slice(0, sessionsToExpire)
|
|
@@ -399,7 +402,7 @@ export class SessionService {
|
|
|
399
402
|
}
|
|
400
403
|
},
|
|
401
404
|
data: {
|
|
402
|
-
expires_at: new Date()
|
|
405
|
+
expires_at: new Date()
|
|
403
406
|
}
|
|
404
407
|
});
|
|
405
408
|
}
|