@hed-hog/core 0.0.266 → 0.0.273
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/README.md +402 -0
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.controller.d.ts +15 -15
- package/dist/dashboard/dashboard-component-role/dashboard-component-role.service.d.ts +15 -15
- package/dist/dashboard/dashboard-role/dashboard-role.controller.d.ts +7 -7
- package/dist/dashboard/dashboard-role/dashboard-role.service.d.ts +7 -7
- package/dist/file/file.controller.d.ts +2 -2
- package/dist/file/file.service.d.ts +4 -4
- package/dist/install/install.module.d.ts.map +1 -1
- package/dist/install/install.module.js +2 -0
- package/dist/install/install.module.js.map +1 -1
- package/dist/install/install.service.d.ts +3 -2
- package/dist/install/install.service.d.ts.map +1 -1
- package/dist/install/install.service.js +33 -56
- package/dist/install/install.service.js.map +1 -1
- package/dist/setting/setting.service.d.ts.map +1 -1
- package/dist/setting/setting.service.js +2 -1
- package/dist/setting/setting.service.js.map +1 -1
- package/hedhog/data/dashboard_component.yaml +8 -8
- package/hedhog/data/dashboard_item.yaml +18 -18
- package/hedhog/frontend/app/dashboard/[slug]/dashboard-content.tsx.ejs +10 -8
- package/hedhog/frontend/app/dashboard/components/draggable-grid.tsx.ejs +20 -18
- package/hedhog/frontend/app/dashboard/components/widget-wrapper.tsx.ejs +6 -6
- package/hedhog/frontend/app/dashboard/dashboard.css.ejs +92 -184
- package/package.json +11 -4
- package/src/install/install.module.ts +2 -0
- package/src/install/install.service.ts +42 -65
- package/src/setting/setting.service.ts +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
# @hed-hog/core
|
|
2
|
+
|
|
3
|
+
## 1. Visão geral do módulo
|
|
4
|
+
|
|
5
|
+
O módulo `@hed-hog/core` é o núcleo do monorepo HedHog, responsável por fornecer funcionalidades centrais essenciais para o sistema, incluindo autenticação, inteligência artificial, dashboard, sistema e gerenciamento de usuários, roles, permissões e componentes de interface. Ele integra diversos submódulos que tratam desde a segurança e autenticação até a gestão de dashboards customizáveis e agentes de IA.
|
|
6
|
+
|
|
7
|
+
## 2. Escopo e responsabilidades
|
|
8
|
+
|
|
9
|
+
- Gerenciamento de autenticação e autorização, incluindo MFA, WebAuthn, recuperação de senha e sessões.
|
|
10
|
+
- Serviços de inteligência artificial para chat e agentes AI com suporte a OpenAI e Gemini.
|
|
11
|
+
- Gestão de dashboards, componentes, roles e usuários associados.
|
|
12
|
+
- Informações do sistema operacional, hardware, banco de dados e módulos instalados.
|
|
13
|
+
- Validação e manipulação de dados via DTOs e integração com Prisma ORM.
|
|
14
|
+
- Suporte a internacionalização e paginação.
|
|
15
|
+
|
|
16
|
+
## 3. Endpoints
|
|
17
|
+
|
|
18
|
+
### Módulo AI (`/ai`)
|
|
19
|
+
|
|
20
|
+
| Método | Path | Autenticação | Descrição | Parâmetros / Body | Resposta | Erros Comuns |
|
|
21
|
+
|--------|-----------------------|--------------|------------------------------------------------|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------|
|
|
22
|
+
| POST | `/ai/chat` | Autenticada | Realiza chat com IA, podendo enviar arquivo. | Body: `ChatDTO` (message, provider?, model?, systemPrompt?, file_id?)<br>File: opcional | `{ provider, model, content }` | 400: Chave API não configurada |
|
|
23
|
+
| POST | `/ai/agent` | Autenticada | Cria um agente AI. | Body: `CreateAgentDTO` (slug, provider?, model?, instructions?) | Objeto agente criado ou existente | 400: Slug já existe |
|
|
24
|
+
| GET | `/ai/agent` | Autenticada | Lista agentes AI com paginação. | Query: paginação (page, pageSize, search) | Paginação com lista de agentes | - |
|
|
25
|
+
| GET | `/ai/agent/id/:agentId` | Autenticada | Obtém agente AI por ID. | Path param: `agentId` (int) | Objeto agente | 404: Agente não encontrado |
|
|
26
|
+
| GET | `/ai/agent/:slug` | Autenticada | Obtém agente AI por slug. | Path param: `slug` (string) | Objeto agente | 404: Agente não encontrado |
|
|
27
|
+
| PATCH | `/ai/agent/:agentId` | Autenticada | Atualiza agente AI. | Path param: `agentId` (int)<br>Body: `UpdateAgentDTO` (slug?, provider?, model?, instructions?) | Objeto agente atualizado | 404: Agente não encontrado<br>400: Slug duplicado |
|
|
28
|
+
| DELETE | `/ai/agent` | Autenticada | Deleta agentes AI em lote. | Body: `DeleteDTO` (ids: number[]) | `{ count: number }` | 404: Um ou mais agentes não encontrados |
|
|
29
|
+
| POST | `/ai/agent/:slug/chat`| Autenticada | Chat com agente AI específico, com arquivo opcional. | Path param: `slug` (string)<br>Body: `ChatAgentDTO` (message, file_id?)<br>File: opcional | `{ slug, provider, model, content }` | 404: Agente não encontrado |
|
|
30
|
+
|
|
31
|
+
### Módulo Auth (`/auth`)
|
|
32
|
+
|
|
33
|
+
| Método | Path | Autenticação | Descrição | Parâmetros / Body | Resposta | Erros Comuns |
|
|
34
|
+
|--------|-------------------------------|--------------|------------------------------------------------|--------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------|
|
|
35
|
+
| GET | `/auth/verify` | Autenticada | Verifica usuário autenticado. | - | Dados do usuário autenticado | - |
|
|
36
|
+
| GET | `/auth/roles` | Pública | Retorna roles do usuário (se autenticado). | - | `{ roles: string[] }` | - |
|
|
37
|
+
| POST | `/auth/refresh` | Pública | Atualiza token de acesso usando refresh token. | Body: `{ refreshToken?: string }`<br>Cookies: `rt` opcional | `{ accessToken, refreshToken? }` | 400: Refresh token não fornecido |
|
|
38
|
+
| POST | `/auth/login` | Pública | Login com email e senha. | Body: `LoginDTO` (email, password, refreshToken?) | Tokens de acesso e refresh ou MFA requerida | 400: Acesso negado |
|
|
39
|
+
| POST | `/auth/login-email-verification` | Pública | Login via verificação por email e código. | Body: `LoginEmailVerificationDTO` (token, code) | Tokens de acesso e refresh | 400: Código inválido ou desafio não encontrado |
|
|
40
|
+
| POST | `/auth/login-email-verification-resend` | Pública | Reenvia código de verificação por email. | Body: `LoginEmailVerificationResendDTO` (token) | Novo token para verificação | 400: Token inválido ou expirado |
|
|
41
|
+
| POST | `/auth/signup` | Pública | Cadastro com email e senha. | Body: `CreateWithEmailAndPasswordDTO` | Usuário criado | - |
|
|
42
|
+
| POST | `/auth/login-code` | Pública | Login com código MFA. | Body: `LoginWithCodeDTO` (token, code, methodType?) | Tokens de acesso e refresh | 400: Código MFA inválido |
|
|
43
|
+
| POST | `/auth/login-recovery-code` | Pública | Login com código de recuperação MFA. | Body: `LoginWithRecoveryCodeDTO` (token, code) | Tokens de acesso e refresh | 400: Código de recuperação inválido|
|
|
44
|
+
| POST | `/auth/resend-mfa-code` | Pública | Reenvia código MFA por email. | Body: `ResendMfaCodeDTO` (token) | `{ success: true, hasEmailMfa: true }` | 400: Nenhum método MFA por email |
|
|
45
|
+
| POST | `/auth/webauthn/generate` | Pública | Gera opções para autenticação WebAuthn. | Body: `{ mfaToken: string }` | Opções WebAuthn | 400: WebAuthn não configurado |
|
|
46
|
+
| POST | `/auth/webauthn/verify` | Pública | Verifica autenticação WebAuthn. | Body: `{ mfaToken: string, assertionResponse: any }` | Tokens de acesso e refresh | 400: Verificação falhou |
|
|
47
|
+
| POST | `/auth/forgot` | Pública | Solicita recuperação de senha via email. | Body: `ForgetDTO` (email) | `{ success: true }` | - |
|
|
48
|
+
| POST | `/auth/logout` | Pública | Logout e invalida refresh token. | Body: `{ refreshToken?: string }`<br>Cookies: `rt` opcional | `{ success: true }` | 400: Refresh token não fornecido |
|
|
49
|
+
| POST | `/auth/forgot-reset` | Pública | Reseta senha via código de recuperação. | Body: `ResetDTO` (password, code) | Tokens de acesso e refresh | 400: Código inválido ou expirado |
|
|
50
|
+
|
|
51
|
+
### Módulo System (`/system`)
|
|
52
|
+
|
|
53
|
+
| Método | Path | Autenticação | Descrição | Parâmetros / Body | Resposta | Erros Comuns |
|
|
54
|
+
|--------|------------|--------------|---------------------------------|-------------------|------------------------------------------------------------------------------------------|--------------|
|
|
55
|
+
| GET | `/system` | Autenticada | Retorna informações do sistema. | - | Informações detalhadas do sistema operacional, hardware, banco de dados, módulos e usuários | - |
|
|
56
|
+
|
|
57
|
+
## 4. Regras de autenticação e autorização
|
|
58
|
+
|
|
59
|
+
- A maioria dos endpoints requer autenticação via token JWT.
|
|
60
|
+
- Endpoints públicos são indicados explicitamente.
|
|
61
|
+
- Controle de acesso baseado em roles e permissões.
|
|
62
|
+
- MFA (Multi-Factor Authentication) suportado via TOTP, email e códigos de recuperação.
|
|
63
|
+
- WebAuthn suportado para autenticação forte.
|
|
64
|
+
- Refresh tokens são gerenciados via cookies HTTP-only ou no corpo da requisição.
|
|
65
|
+
- Operações sensíveis (criação, atualização, deleção) requerem autenticação e permissões adequadas.
|
|
66
|
+
|
|
67
|
+
## 5. Estruturas de request/response
|
|
68
|
+
|
|
69
|
+
### DTOs principais do módulo AI
|
|
70
|
+
|
|
71
|
+
- **ChatDTO**
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
{
|
|
75
|
+
message: string; // obrigatório
|
|
76
|
+
provider?: 'openai' | 'gemini'; // opcional, padrão 'openai'
|
|
77
|
+
model?: string; // opcional
|
|
78
|
+
systemPrompt?: string; // opcional
|
|
79
|
+
file_id?: number; // opcional
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
- **ChatAgentDTO**
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
{
|
|
87
|
+
message: string; // obrigatório
|
|
88
|
+
file_id?: number; // opcional
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- **CreateAgentDTO**
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
{
|
|
96
|
+
slug: string; // obrigatório
|
|
97
|
+
provider?: 'openai' | 'gemini'; // opcional, padrão 'openai'
|
|
98
|
+
model?: string; // opcional
|
|
99
|
+
instructions?: string; // opcional
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- **UpdateAgentDTO**
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
{
|
|
107
|
+
slug?: string;
|
|
108
|
+
provider?: 'openai' | 'gemini';
|
|
109
|
+
model?: string;
|
|
110
|
+
instructions?: string;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
- **DeleteDTO**
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
{
|
|
118
|
+
ids: number[]; // array de IDs para deleção, mínimo 1 item
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### DTOs principais do módulo Auth
|
|
123
|
+
|
|
124
|
+
- **LoginDTO**
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
{
|
|
128
|
+
email: string; // obrigatório, email válido
|
|
129
|
+
password: string; // obrigatório, senha forte mínima 6 caracteres
|
|
130
|
+
refreshToken?: boolean; // opcional, padrão false
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **LoginEmailVerificationDTO**
|
|
135
|
+
|
|
136
|
+
```ts
|
|
137
|
+
{
|
|
138
|
+
token: string; // obrigatório
|
|
139
|
+
code: string; // obrigatório, código PIN
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- **LoginEmailVerificationResendDTO**
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
{
|
|
147
|
+
token: string; // obrigatório
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
- **LoginWithCodeDTO**
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
{
|
|
155
|
+
code: string; // obrigatório
|
|
156
|
+
token: string; // obrigatório, JWT
|
|
157
|
+
methodType?: 'totp' | 'email' | 'recovery'; // opcional
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
- **LoginWithRecoveryCodeDTO**
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
{
|
|
165
|
+
code: string; // obrigatório
|
|
166
|
+
token: string; // obrigatório, JWT
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- **ForgetDTO**
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
{
|
|
174
|
+
email: string; // obrigatório, email válido
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
- **ResetDTO**
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
{
|
|
182
|
+
password: string; // obrigatório, mínimo 8 caracteres
|
|
183
|
+
code: string; // obrigatório
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## 6. Erros comuns
|
|
188
|
+
|
|
189
|
+
- **400 Bad Request**
|
|
190
|
+
|
|
191
|
+
- Chave API não configurada para OpenAI ou Gemini.
|
|
192
|
+
- Slug de agente AI já existente.
|
|
193
|
+
- Código de verificação inválido ou expirado.
|
|
194
|
+
- Refresh token não fornecido.
|
|
195
|
+
- Acesso negado por credenciais inválidas.
|
|
196
|
+
- MFA não configurado ou código inválido.
|
|
197
|
+
- Tentativa de deletar itens inexistentes.
|
|
198
|
+
|
|
199
|
+
- **404 Not Found**
|
|
200
|
+
|
|
201
|
+
- Agente AI não encontrado por ID ou slug.
|
|
202
|
+
- Dashboard, componente ou relação não encontrada.
|
|
203
|
+
- Desafio (challenge) para verificação não encontrado ou expirado.
|
|
204
|
+
|
|
205
|
+
- **403 Forbidden**
|
|
206
|
+
|
|
207
|
+
- Acesso negado a dashboards ou recursos protegidos.
|
|
208
|
+
|
|
209
|
+
## 7. Banco de dados (tabelas YAML)
|
|
210
|
+
|
|
211
|
+
### ai_agent
|
|
212
|
+
|
|
213
|
+
```yaml
|
|
214
|
+
finalidade: Armazena agentes de inteligência artificial configurados no sistema.
|
|
215
|
+
colunas:
|
|
216
|
+
- id: integer, PK, auto-increment
|
|
217
|
+
- slug: string, único, não nulo
|
|
218
|
+
- provider: enum('openai', 'gemini'), não nulo
|
|
219
|
+
- model: string, nullable
|
|
220
|
+
- instructions: string, nullable
|
|
221
|
+
- external_agent_id: string, nullable
|
|
222
|
+
- created_at: timestamp, não nulo, default NOW()
|
|
223
|
+
- updated_at: timestamp, não nulo, default NOW()
|
|
224
|
+
defaults:
|
|
225
|
+
- created_at: NOW()
|
|
226
|
+
- updated_at: NOW()
|
|
227
|
+
nulabilidade:
|
|
228
|
+
- model: nullable
|
|
229
|
+
- instructions: nullable
|
|
230
|
+
- external_agent_id: nullable
|
|
231
|
+
integridade:
|
|
232
|
+
- slug único
|
|
233
|
+
indices:
|
|
234
|
+
- id (PK)
|
|
235
|
+
- slug (único)
|
|
236
|
+
enums:
|
|
237
|
+
- provider: ['openai', 'gemini']
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### user, user_mfa, user_identifier, user_session, user_activity, role, role_user, dashboard, dashboard_component, dashboard_role, dashboard_user, dashboard_item, dashboard_component_role
|
|
241
|
+
|
|
242
|
+
- Estruturas padrão para usuários, autenticação multifator, sessões, atividades, roles, dashboards e seus componentes, com relacionamentos muitos-para-muitos e suporte a internacionalização via tabelas de locale.
|
|
243
|
+
|
|
244
|
+
- Campos comuns incluem IDs, slugs, timestamps de criação e atualização, e campos específicos para configurações de MFA, tokens, e layouts de dashboards.
|
|
245
|
+
|
|
246
|
+
- Integridade referencial garantida via chaves estrangeiras.
|
|
247
|
+
|
|
248
|
+
## 8. Regras de negócio relevantes
|
|
249
|
+
|
|
250
|
+
- Agentes AI podem ser criados, atualizados e deletados, com integração direta com APIs OpenAI e Gemini.
|
|
251
|
+
|
|
252
|
+
- Chat com IA suporta anexos de arquivos, com extração de texto para PDFs e arquivos de texto.
|
|
253
|
+
|
|
254
|
+
- MFA obrigatório pode ser configurado, com suporte a email, TOTP e WebAuthn.
|
|
255
|
+
|
|
256
|
+
- Tokens de acesso e refresh são gerenciados com segurança, incluindo cookies HTTP-only.
|
|
257
|
+
|
|
258
|
+
- Dashboards são personalizados por usuário, com controle de acesso baseado em roles.
|
|
259
|
+
|
|
260
|
+
- Layouts de dashboards e widgets podem ser salvos e recuperados por usuário.
|
|
261
|
+
|
|
262
|
+
- Sistema coleta estatísticas de uso, sessões, emails enviados e segurança da conta.
|
|
263
|
+
|
|
264
|
+
- Validações rigorosas são aplicadas via DTOs e classes de validação.
|
|
265
|
+
|
|
266
|
+
## 9. Guia rápido de uso (exemplos)
|
|
267
|
+
|
|
268
|
+
### Criar agente AI
|
|
269
|
+
|
|
270
|
+
```http
|
|
271
|
+
POST /ai/agent
|
|
272
|
+
Authorization: Bearer <token>
|
|
273
|
+
Content-Type: application/json
|
|
274
|
+
|
|
275
|
+
{
|
|
276
|
+
"slug": "meu-agente",
|
|
277
|
+
"provider": "openai",
|
|
278
|
+
"model": "gpt-4o-mini",
|
|
279
|
+
"instructions": "Seja um assistente amigável."
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Resposta:
|
|
284
|
+
|
|
285
|
+
```json
|
|
286
|
+
{
|
|
287
|
+
"id": 1,
|
|
288
|
+
"slug": "meu-agente",
|
|
289
|
+
"provider": "openai",
|
|
290
|
+
"model": "gpt-4o-mini",
|
|
291
|
+
"instructions": "Seja um assistente amigável.",
|
|
292
|
+
"external_agent_id": "abc123",
|
|
293
|
+
"created_at": "2024-06-01T12:00:00Z",
|
|
294
|
+
"updated_at": "2024-06-01T12:00:00Z"
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Chat com agente AI
|
|
299
|
+
|
|
300
|
+
```http
|
|
301
|
+
POST /ai/agent/meu-agente/chat
|
|
302
|
+
Authorization: Bearer <token>
|
|
303
|
+
Content-Type: multipart/form-data
|
|
304
|
+
|
|
305
|
+
Form-data:
|
|
306
|
+
- message: "Olá, como você está?"
|
|
307
|
+
- file: (arquivo opcional)
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Resposta:
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"slug": "meu-agente",
|
|
315
|
+
"provider": "openai",
|
|
316
|
+
"model": "gpt-4o-mini",
|
|
317
|
+
"content": "Olá! Estou bem, obrigado por perguntar."
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Login com email e senha
|
|
322
|
+
|
|
323
|
+
```http
|
|
324
|
+
POST /auth/login
|
|
325
|
+
Content-Type: application/json
|
|
326
|
+
|
|
327
|
+
{
|
|
328
|
+
"email": "usuario@exemplo.com",
|
|
329
|
+
"password": "senhaSegura123"
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Resposta:
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"accessToken": "<jwt_access_token>",
|
|
338
|
+
"refreshToken": "<jwt_refresh_token>"
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### Obter informações do sistema
|
|
343
|
+
|
|
344
|
+
```http
|
|
345
|
+
GET /system
|
|
346
|
+
Authorization: Bearer <token>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
Resposta (exemplo resumido):
|
|
350
|
+
|
|
351
|
+
```json
|
|
352
|
+
{
|
|
353
|
+
"os": {
|
|
354
|
+
"name": "Linux",
|
|
355
|
+
"platform": "linux",
|
|
356
|
+
"version": "5.15.0",
|
|
357
|
+
"architecture": "x64",
|
|
358
|
+
"uptime": 123456,
|
|
359
|
+
"cpu": {
|
|
360
|
+
"model": "Intel(R) Xeon(R)",
|
|
361
|
+
"speed": 2400,
|
|
362
|
+
"physicalCores": 4,
|
|
363
|
+
"virtualCores": 8
|
|
364
|
+
},
|
|
365
|
+
"memory": {
|
|
366
|
+
"total": 17179869184,
|
|
367
|
+
"free": 8589934592
|
|
368
|
+
},
|
|
369
|
+
"disk": [
|
|
370
|
+
{
|
|
371
|
+
"filesystem": "/dev/sda1",
|
|
372
|
+
"size": 500107862016,
|
|
373
|
+
"free": 250053931008,
|
|
374
|
+
"mountpoint": "/"
|
|
375
|
+
}
|
|
376
|
+
]
|
|
377
|
+
},
|
|
378
|
+
"modules": [
|
|
379
|
+
{
|
|
380
|
+
"name": "@hedhog/core",
|
|
381
|
+
"version": "^1.0.0",
|
|
382
|
+
"latestVersion": "1.0.1",
|
|
383
|
+
"upToDate": false
|
|
384
|
+
}
|
|
385
|
+
],
|
|
386
|
+
"users": {
|
|
387
|
+
"total": 100,
|
|
388
|
+
"admin": 5,
|
|
389
|
+
"active": 80,
|
|
390
|
+
"activities": []
|
|
391
|
+
},
|
|
392
|
+
"database": {
|
|
393
|
+
"connections": 10,
|
|
394
|
+
"size": 104857600,
|
|
395
|
+
"queriesPerSecond": 50
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
Este README documenta o módulo `@hed-hog/core` com base no código-fonte e definições atuais, fornecendo uma visão técnica detalhada para desenvolvedores e integradores do sistema.
|
|
@@ -46,8 +46,8 @@ export declare class DashboardComponentRoleController {
|
|
|
46
46
|
role_id: number;
|
|
47
47
|
})[]>;
|
|
48
48
|
create(data: CreateDashboardComponentRoleDTO, locale: string): Promise<{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
role: {
|
|
50
|
+
role_locale: ({
|
|
51
51
|
locale: {
|
|
52
52
|
code: string;
|
|
53
53
|
name: string;
|
|
@@ -60,27 +60,20 @@ export declare class DashboardComponentRoleController {
|
|
|
60
60
|
} & {
|
|
61
61
|
name: string;
|
|
62
62
|
id: number;
|
|
63
|
-
description: string;
|
|
63
|
+
description: string | null;
|
|
64
64
|
created_at: Date;
|
|
65
65
|
updated_at: Date;
|
|
66
66
|
locale_id: number;
|
|
67
|
-
|
|
67
|
+
role_id: number;
|
|
68
68
|
})[];
|
|
69
69
|
} & {
|
|
70
|
-
width: number;
|
|
71
70
|
id: number;
|
|
72
71
|
created_at: Date;
|
|
73
72
|
updated_at: Date;
|
|
74
73
|
slug: string;
|
|
75
|
-
min_width: number;
|
|
76
|
-
max_width: number | null;
|
|
77
|
-
min_height: number;
|
|
78
|
-
max_height: number | null;
|
|
79
|
-
height: number;
|
|
80
|
-
is_resizable: boolean;
|
|
81
74
|
};
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
dashboard_component: {
|
|
76
|
+
dashboard_component_locale: ({
|
|
84
77
|
locale: {
|
|
85
78
|
code: string;
|
|
86
79
|
name: string;
|
|
@@ -93,17 +86,24 @@ export declare class DashboardComponentRoleController {
|
|
|
93
86
|
} & {
|
|
94
87
|
name: string;
|
|
95
88
|
id: number;
|
|
96
|
-
description: string
|
|
89
|
+
description: string;
|
|
97
90
|
created_at: Date;
|
|
98
91
|
updated_at: Date;
|
|
99
92
|
locale_id: number;
|
|
100
|
-
|
|
93
|
+
dashboard_component_id: number;
|
|
101
94
|
})[];
|
|
102
95
|
} & {
|
|
96
|
+
width: number;
|
|
103
97
|
id: number;
|
|
104
98
|
created_at: Date;
|
|
105
99
|
updated_at: Date;
|
|
106
100
|
slug: string;
|
|
101
|
+
min_width: number;
|
|
102
|
+
max_width: number | null;
|
|
103
|
+
min_height: number;
|
|
104
|
+
max_height: number | null;
|
|
105
|
+
height: number;
|
|
106
|
+
is_resizable: boolean;
|
|
107
107
|
};
|
|
108
108
|
} & {
|
|
109
109
|
id: number;
|
|
@@ -49,8 +49,8 @@ export declare class DashboardComponentRoleService {
|
|
|
49
49
|
role_id: number;
|
|
50
50
|
})[]>;
|
|
51
51
|
create(data: CreateDashboardComponentRoleDTO, locale: string): Promise<{
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
role: {
|
|
53
|
+
role_locale: ({
|
|
54
54
|
locale: {
|
|
55
55
|
code: string;
|
|
56
56
|
name: string;
|
|
@@ -63,27 +63,20 @@ export declare class DashboardComponentRoleService {
|
|
|
63
63
|
} & {
|
|
64
64
|
name: string;
|
|
65
65
|
id: number;
|
|
66
|
-
description: string;
|
|
66
|
+
description: string | null;
|
|
67
67
|
created_at: Date;
|
|
68
68
|
updated_at: Date;
|
|
69
69
|
locale_id: number;
|
|
70
|
-
|
|
70
|
+
role_id: number;
|
|
71
71
|
})[];
|
|
72
72
|
} & {
|
|
73
|
-
width: number;
|
|
74
73
|
id: number;
|
|
75
74
|
created_at: Date;
|
|
76
75
|
updated_at: Date;
|
|
77
76
|
slug: string;
|
|
78
|
-
min_width: number;
|
|
79
|
-
max_width: number | null;
|
|
80
|
-
min_height: number;
|
|
81
|
-
max_height: number | null;
|
|
82
|
-
height: number;
|
|
83
|
-
is_resizable: boolean;
|
|
84
77
|
};
|
|
85
|
-
|
|
86
|
-
|
|
78
|
+
dashboard_component: {
|
|
79
|
+
dashboard_component_locale: ({
|
|
87
80
|
locale: {
|
|
88
81
|
code: string;
|
|
89
82
|
name: string;
|
|
@@ -96,17 +89,24 @@ export declare class DashboardComponentRoleService {
|
|
|
96
89
|
} & {
|
|
97
90
|
name: string;
|
|
98
91
|
id: number;
|
|
99
|
-
description: string
|
|
92
|
+
description: string;
|
|
100
93
|
created_at: Date;
|
|
101
94
|
updated_at: Date;
|
|
102
95
|
locale_id: number;
|
|
103
|
-
|
|
96
|
+
dashboard_component_id: number;
|
|
104
97
|
})[];
|
|
105
98
|
} & {
|
|
99
|
+
width: number;
|
|
106
100
|
id: number;
|
|
107
101
|
created_at: Date;
|
|
108
102
|
updated_at: Date;
|
|
109
103
|
slug: string;
|
|
104
|
+
min_width: number;
|
|
105
|
+
max_width: number | null;
|
|
106
|
+
min_height: number;
|
|
107
|
+
max_height: number | null;
|
|
108
|
+
height: number;
|
|
109
|
+
is_resizable: boolean;
|
|
110
110
|
};
|
|
111
111
|
} & {
|
|
112
112
|
id: number;
|
|
@@ -46,8 +46,8 @@ export declare class DashboardRoleController {
|
|
|
46
46
|
dashboard_id: number;
|
|
47
47
|
})[]>;
|
|
48
48
|
create(data: CreateDashboardRoleDTO, locale: string): Promise<{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
role: {
|
|
50
|
+
role_locale: ({
|
|
51
51
|
locale: {
|
|
52
52
|
code: string;
|
|
53
53
|
name: string;
|
|
@@ -60,10 +60,11 @@ export declare class DashboardRoleController {
|
|
|
60
60
|
} & {
|
|
61
61
|
name: string;
|
|
62
62
|
id: number;
|
|
63
|
+
description: string | null;
|
|
63
64
|
created_at: Date;
|
|
64
65
|
updated_at: Date;
|
|
65
66
|
locale_id: number;
|
|
66
|
-
|
|
67
|
+
role_id: number;
|
|
67
68
|
})[];
|
|
68
69
|
} & {
|
|
69
70
|
id: number;
|
|
@@ -71,8 +72,8 @@ export declare class DashboardRoleController {
|
|
|
71
72
|
updated_at: Date;
|
|
72
73
|
slug: string;
|
|
73
74
|
};
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
dashboard: {
|
|
76
|
+
dashboard_locale: ({
|
|
76
77
|
locale: {
|
|
77
78
|
code: string;
|
|
78
79
|
name: string;
|
|
@@ -85,11 +86,10 @@ export declare class DashboardRoleController {
|
|
|
85
86
|
} & {
|
|
86
87
|
name: string;
|
|
87
88
|
id: number;
|
|
88
|
-
description: string | null;
|
|
89
89
|
created_at: Date;
|
|
90
90
|
updated_at: Date;
|
|
91
91
|
locale_id: number;
|
|
92
|
-
|
|
92
|
+
dashboard_id: number;
|
|
93
93
|
})[];
|
|
94
94
|
} & {
|
|
95
95
|
id: number;
|
|
@@ -49,8 +49,8 @@ export declare class DashboardRoleService {
|
|
|
49
49
|
dashboard_id: number;
|
|
50
50
|
})[]>;
|
|
51
51
|
create(data: CreateDashboardRoleDTO, locale: string): Promise<{
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
role: {
|
|
53
|
+
role_locale: ({
|
|
54
54
|
locale: {
|
|
55
55
|
code: string;
|
|
56
56
|
name: string;
|
|
@@ -63,10 +63,11 @@ export declare class DashboardRoleService {
|
|
|
63
63
|
} & {
|
|
64
64
|
name: string;
|
|
65
65
|
id: number;
|
|
66
|
+
description: string | null;
|
|
66
67
|
created_at: Date;
|
|
67
68
|
updated_at: Date;
|
|
68
69
|
locale_id: number;
|
|
69
|
-
|
|
70
|
+
role_id: number;
|
|
70
71
|
})[];
|
|
71
72
|
} & {
|
|
72
73
|
id: number;
|
|
@@ -74,8 +75,8 @@ export declare class DashboardRoleService {
|
|
|
74
75
|
updated_at: Date;
|
|
75
76
|
slug: string;
|
|
76
77
|
};
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
dashboard: {
|
|
79
|
+
dashboard_locale: ({
|
|
79
80
|
locale: {
|
|
80
81
|
code: string;
|
|
81
82
|
name: string;
|
|
@@ -88,11 +89,10 @@ export declare class DashboardRoleService {
|
|
|
88
89
|
} & {
|
|
89
90
|
name: string;
|
|
90
91
|
id: number;
|
|
91
|
-
description: string | null;
|
|
92
92
|
created_at: Date;
|
|
93
93
|
updated_at: Date;
|
|
94
94
|
locale_id: number;
|
|
95
|
-
|
|
95
|
+
dashboard_id: number;
|
|
96
96
|
})[];
|
|
97
97
|
} & {
|
|
98
98
|
id: number;
|
|
@@ -21,8 +21,8 @@ export declare class FileController {
|
|
|
21
21
|
filename: string;
|
|
22
22
|
created_at: Date;
|
|
23
23
|
updated_at: Date;
|
|
24
|
-
provider_id: number;
|
|
25
24
|
location: string;
|
|
25
|
+
provider_id: number;
|
|
26
26
|
mimetype_id: number;
|
|
27
27
|
}>;
|
|
28
28
|
getTempOpenURL(id: number): Promise<{
|
|
@@ -40,8 +40,8 @@ export declare class FileController {
|
|
|
40
40
|
filename: string;
|
|
41
41
|
created_at: Date;
|
|
42
42
|
updated_at: Date;
|
|
43
|
-
provider_id: number;
|
|
44
43
|
location: string;
|
|
44
|
+
provider_id: number;
|
|
45
45
|
mimetype_id: number;
|
|
46
46
|
}>;
|
|
47
47
|
delete(data: DeleteDTO, locale: string): Promise<number[]>;
|