jerkjs 2.1.7 → 2.2.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +201 -4
  3. package/index.js +29 -4
  4. package/lib/core/server.js +328 -27
  5. package/lib/loader/routeLoader.js +148 -117
  6. package/lib/mvc/GenericAdapter.js +136 -0
  7. package/lib/mvc/MariaDBAdapter.js +315 -0
  8. package/lib/mvc/MemoryAdapter.js +269 -0
  9. package/lib/mvc/ModelControllerExample.js +285 -0
  10. package/lib/mvc/controllerBase.js +60 -0
  11. package/lib/mvc/modelBase.js +383 -0
  12. package/lib/mvc/modelManager.js +284 -0
  13. package/lib/mvc/userModel.js +265 -0
  14. package/lib/mvc/viewEngine.js +32 -1
  15. package/lib/utils/mimeType.js +62 -0
  16. package/package.json +5 -3
  17. package/BUG_REPORTE_COMPRESION.txt +0 -72
  18. package/JERK_FRAMEWORK_DIAGRAM.txt +0 -492
  19. package/JERK_FRAMEWORK_DIAGRAM_MERMAID.mmd +0 -124
  20. package/JERK_FRAMEWORK_DOCUMENTATION.md +0 -527
  21. package/LICENSE +0 -201
  22. package/README_EN.md +0 -230
  23. package/README_PT.md +0 -230
  24. package/docs/ARQUITECTURA_ROUTES.md +0 -140
  25. package/docs/EXTENSION_MANUAL.md +0 -955
  26. package/docs/FIREWALL_MANUAL.md +0 -416
  27. package/docs/HOOK-2.0.md +0 -512
  28. package/docs/HOOKS_REFERENCE_IMPROVED.md +0 -596
  29. package/docs/MANUAL_API_SDK.md +0 -536
  30. package/docs/MARIADB_TOKENS_IMPLEMENTATION.md +0 -110
  31. package/docs/MIDDLEWARE_MANUAL.md +0 -518
  32. package/docs/OAUTH2_GOOGLE_MANUAL.md +0 -405
  33. package/docs/ROUTING_WITHOUT_JSON_GUIDE.md +0 -454
  34. package/docs/frontend-and-sessions.md +0 -353
  35. package/docs/guia_inicio_rapido_jerkjs.md +0 -113
  36. package/examples/examples.arj +0 -0
  37. package/standard/CompressionTestController.js +0 -56
  38. package/standard/HealthController.js +0 -16
  39. package/standard/HomeController.js +0 -12
  40. package/standard/ProductController.js +0 -18
  41. package/standard/README.md +0 -47
  42. package/standard/UserController.js +0 -23
  43. package/standard/package.json +0 -22
  44. package/standard/routes.json +0 -65
  45. package/standard/server.js +0 -140
  46. package/standardA/controllers/AuthController.js +0 -82
  47. package/standardA/controllers/HomeController.js +0 -19
  48. package/standardA/controllers/UserController.js +0 -41
  49. package/standardA/server.js +0 -311
  50. package/standardA/views/auth/dashboard.html +0 -51
  51. package/standardA/views/auth/login.html +0 -47
  52. package/standardA/views/index.html +0 -32
  53. package/standardA/views/users/detail.html +0 -28
  54. package/standardA/views/users/list.html +0 -36
@@ -1,51 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{title}}</title>
5
- <meta charset="UTF-8">
6
- <style>
7
- body { font-family: Arial, sans-serif; margin: 40px; background-color: #f5f5f5; }
8
- .container { max-width: 800px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
9
- .header { background-color: #007bff; color: white; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
10
- .user-info { background-color: #f8f9fa; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
11
- .nav { margin: 20px 0; }
12
- .nav a { display: inline-block; margin-right: 15px; padding: 8px 15px; background-color: #28a745; color: white; text-decoration: none; border-radius: 3px; }
13
- .nav a:hover { background-color: #218838; }
14
- .section { margin: 20px 0; padding: 15px; border-left: 4px solid #007bff; background-color: #f8f9fa; }
15
- </style>
16
- </head>
17
- <body>
18
- <div class="container">
19
- <div class="header">
20
- <h1>{{title}}</h1>
21
- </div>
22
-
23
- <div class="user-info">
24
- <h3>Bienvenido, {{user.username}}!</h3>
25
- <p>Rol: {{user.role}}</p>
26
- </div>
27
-
28
- <div class="nav">
29
- <a href="/">Inicio</a>
30
- <a href="/users">Usuarios</a>
31
- <a href="/auth/logout">Cerrar Sesión</a>
32
- </div>
33
-
34
- <div class="section">
35
- <h2>Panel de Control</h2>
36
- <p>Este es un área protegida que solo pueden acceder usuarios autenticados.</p>
37
- <p>Aquí puedes gestionar la configuración de la aplicación, ver estadísticas y realizar tareas administrativas.</p>
38
- </div>
39
-
40
- <div class="section">
41
- <h2>Funcionalidades Disponibles</h2>
42
- <ul>
43
- <li>Administración de usuarios</li>
44
- <li>Configuración del sistema</li>
45
- <li>Visualización de estadísticas</li>
46
- <li>Registro de actividad</li>
47
- </ul>
48
- </div>
49
- </div>
50
- </body>
51
- </html>
@@ -1,47 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{title}}</title>
5
- <meta charset="UTF-8">
6
- <style>
7
- body { font-family: Arial, sans-serif; margin: 40px; background-color: #f5f5f5; }
8
- .container { max-width: 400px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
9
- .form-group { margin-bottom: 15px; }
10
- label { display: block; margin-bottom: 5px; font-weight: bold; }
11
- input[type="text"], input[type="password"] { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; }
12
- button { background-color: #007bff; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; width: 100%; }
13
- button:hover { background-color: #0056b3; }
14
- .error { color: red; margin-bottom: 15px; }
15
- .nav { margin-top: 20px; text-align: center; }
16
- .nav a { color: #007bff; text-decoration: none; }
17
- .nav a:hover { text-decoration: underline; }
18
- </style>
19
- </head>
20
- <body>
21
- <div class="container">
22
- <h1>{{title}}</h1>
23
-
24
- {{if error}}
25
- <div class="error">{{error}}</div>
26
- {{endif}}
27
-
28
- <form method="POST" action="/auth/login">
29
- <div class="form-group">
30
- <label for="username">Usuario:</label>
31
- <input type="text" id="username" name="username" required>
32
- </div>
33
-
34
- <div class="form-group">
35
- <label for="password">Contraseña:</label>
36
- <input type="password" id="password" name="password" required>
37
- </div>
38
-
39
- <button type="submit">Iniciar Sesión</button>
40
- </form>
41
-
42
- <div class="nav">
43
- <a href="/">Volver al inicio</a>
44
- </div>
45
- </div>
46
- </body>
47
- </html>
@@ -1,32 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{title}}</title>
5
- <meta charset="UTF-8">
6
- <style>
7
- body { font-family: Arial, sans-serif; margin: 40px; }
8
- .header { background-color: #f0f0f0; padding: 20px; border-radius: 5px; }
9
- .content { margin-top: 20px; }
10
- .nav { margin-top: 20px; }
11
- .nav a { display: inline-block; margin-right: 15px; padding: 8px 15px; background-color: #007bff; color: white; text-decoration: none; border-radius: 3px; }
12
- .nav a:hover { background-color: #0056b3; }
13
- </style>
14
- </head>
15
- <body>
16
- <div class="header">
17
- <h1>{{title}}</h1>
18
- <p>{{message}}</p>
19
- </div>
20
-
21
- <div class="content">
22
- <h2>Ejemplo de aplicación sin routes.json</h2>
23
- <p>Este servidor utiliza el método <code>addRoute()</code> con todas las funcionalidades equivalentes a las de <code>routes.json</code>.</p>
24
-
25
- <div class="nav">
26
- <a href="/">Inicio</a>
27
- <a href="/users">Usuarios</a>
28
- <a href="/api/data">API Data</a>
29
- </div>
30
- </div>
31
- </body>
32
- </html>
@@ -1,28 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Detalle del Usuario</title>
5
- <meta charset="UTF-8">
6
- <style>
7
- body { font-family: Arial, sans-serif; margin: 40px; }
8
- .header { background-color: #f0f0f0; padding: 20px; border-radius: 5px; }
9
- .user-info { background-color: #f9f9f9; padding: 20px; border-radius: 5px; margin-top: 20px; }
10
- .back-link { margin-top: 20px; }
11
- </style>
12
- </head>
13
- <body>
14
- <div class="header">
15
- <h1>Detalle del Usuario</h1>
16
- <div class="back-link">
17
- <a href="/users">← Volver a la lista de usuarios</a>
18
- </div>
19
- </div>
20
-
21
- <div class="user-info">
22
- <h2>{{user.name}}</h2>
23
- <p><strong>ID:</strong> {{user.id}}</p>
24
- <p><strong>Email:</strong> {{user.email}}</p>
25
- <p><strong>Registrado:</strong> {{user.registered}}</p>
26
- </div>
27
- </body>
28
- </html>
@@ -1,36 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>{{title}}</title>
5
- <meta charset="UTF-8">
6
- <style>
7
- body { font-family: Arial, sans-serif; margin: 40px; }
8
- .header { background-color: #f0f0f0; padding: 20px; border-radius: 5px; }
9
- .content { margin-top: 20px; }
10
- ul { list-style-type: none; padding: 0; }
11
- li { background-color: #f9f9f9; margin: 5px 0; padding: 10px; border-radius: 3px; }
12
- </style>
13
- </head>
14
- <body>
15
- <div class="header">
16
- <h1>{{title}}</h1>
17
- <p>{{message}}</p>
18
- </div>
19
-
20
- <div class="content">
21
- <h2>Usuarios</h2>
22
- {{if users}}
23
- <ul>
24
- {{foreach:users}}
25
- <li>
26
- <strong>{{item.name}}</strong> - {{item.email}}
27
- <br><a href="/users/{{item.id}}">Ver detalles</a>
28
- </li>
29
- {{endforeach}}
30
- </ul>
31
- {{else}}
32
- <p>No hay usuarios disponibles.</p>
33
- {{endif}}
34
- </div>
35
- </body>
36
- </html>