@forgedevstack/harbor 1.0.0 → 1.5.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 (123) hide show
  1. package/CHANGELOG.md +82 -101
  2. package/README.md +210 -794
  3. package/dist/auth/apiKey.d.ts +6 -0
  4. package/dist/auth/apiKey.d.ts.map +1 -0
  5. package/dist/auth/index.d.ts +7 -0
  6. package/dist/auth/index.d.ts.map +1 -0
  7. package/dist/auth/index.js +2 -0
  8. package/dist/auth/index.js.map +1 -0
  9. package/dist/auth/jwt.d.ts +21 -0
  10. package/dist/auth/jwt.d.ts.map +1 -0
  11. package/dist/auth/password.d.ts +6 -0
  12. package/dist/auth/password.d.ts.map +1 -0
  13. package/dist/auth/rbac.d.ts +6 -0
  14. package/dist/auth/rbac.d.ts.map +1 -0
  15. package/dist/auth/signing.d.ts +5 -0
  16. package/dist/auth/signing.d.ts.map +1 -0
  17. package/dist/auth/types/apiKey.types.d.ts +9 -0
  18. package/dist/auth/types/apiKey.types.d.ts.map +1 -0
  19. package/dist/auth/types/index.d.ts +5 -0
  20. package/dist/auth/types/index.d.ts.map +1 -0
  21. package/dist/auth/types/jwt.types.d.ts +17 -0
  22. package/dist/auth/types/jwt.types.d.ts.map +1 -0
  23. package/dist/auth/types/rbac.types.d.ts +8 -0
  24. package/dist/auth/types/rbac.types.d.ts.map +1 -0
  25. package/dist/auth/types/signing.types.d.ts +8 -0
  26. package/dist/auth/types/signing.types.d.ts.map +1 -0
  27. package/dist/cache/index.d.ts +4 -0
  28. package/dist/cache/index.d.ts.map +1 -0
  29. package/dist/cache/index.js +2 -0
  30. package/dist/cache/index.js.map +1 -0
  31. package/dist/cache/manager.d.ts +24 -0
  32. package/dist/cache/manager.d.ts.map +1 -0
  33. package/dist/cache/stores.d.ts +28 -0
  34. package/dist/cache/stores.d.ts.map +1 -0
  35. package/dist/cache/types.d.ts +23 -0
  36. package/dist/cache/types.d.ts.map +1 -0
  37. package/dist/cli/index.js +21 -22
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/core/config.d.ts.map +1 -1
  40. package/dist/core/router.d.ts +40 -2
  41. package/dist/core/router.d.ts.map +1 -1
  42. package/dist/core/server.d.ts.map +1 -1
  43. package/dist/database/connection.d.ts +1 -2
  44. package/dist/database/connection.d.ts.map +1 -1
  45. package/dist/database/index.js +2 -0
  46. package/dist/database/index.js.map +1 -0
  47. package/dist/database/model.d.ts +1 -4
  48. package/dist/database/model.d.ts.map +1 -1
  49. package/dist/docker/index.js +1 -1
  50. package/dist/http.const-BKHG1Lsj.mjs +62 -0
  51. package/dist/http.const-BKHG1Lsj.mjs.map +1 -0
  52. package/dist/http.const-Ckcy7OFp.js +2 -0
  53. package/dist/http.const-Ckcy7OFp.js.map +1 -0
  54. package/dist/index-Ca4WpLvw.js +2 -0
  55. package/dist/index-Ca4WpLvw.js.map +1 -0
  56. package/dist/index-DIVHd6rO.mjs +1054 -0
  57. package/dist/index-DIVHd6rO.mjs.map +1 -0
  58. package/dist/index.cjs.js +16 -16
  59. package/dist/index.cjs.js.map +1 -1
  60. package/dist/index.d.ts +11 -2
  61. package/dist/index.d.ts.map +1 -1
  62. package/dist/index.es.js +676 -1691
  63. package/dist/index.es.js.map +1 -1
  64. package/dist/logger-CZn7QxCl.mjs +102 -0
  65. package/dist/{logger-D7aJSi62.mjs.map → logger-CZn7QxCl.mjs.map} +1 -1
  66. package/dist/logger-D-lfaRWQ.js +3 -0
  67. package/dist/{logger-DEnWXtpk.js.map → logger-D-lfaRWQ.js.map} +1 -1
  68. package/dist/manager-CjcKb4P9.mjs +149 -0
  69. package/dist/{manager-B6vqJgEn.mjs.map → manager-CjcKb4P9.mjs.map} +1 -1
  70. package/dist/manager-DrF1vbJg.js +4 -0
  71. package/dist/{manager-B1UKMjXW.js.map → manager-DrF1vbJg.js.map} +1 -1
  72. package/dist/middleware/health.d.ts +65 -0
  73. package/dist/middleware/health.d.ts.map +1 -0
  74. package/dist/middleware/index.d.ts +5 -0
  75. package/dist/middleware/index.d.ts.map +1 -0
  76. package/dist/middleware/index.js +2 -0
  77. package/dist/middleware/index.js.map +1 -0
  78. package/dist/middleware/metrics.d.ts +68 -0
  79. package/dist/middleware/metrics.d.ts.map +1 -0
  80. package/dist/middleware/rateLimit.d.ts +52 -0
  81. package/dist/middleware/rateLimit.d.ts.map +1 -0
  82. package/dist/middleware/upload.d.ts +59 -0
  83. package/dist/middleware/upload.d.ts.map +1 -0
  84. package/dist/password-BXBkKbv3.js +2 -0
  85. package/dist/password-BXBkKbv3.js.map +1 -0
  86. package/dist/password-y4m307oa.mjs +223 -0
  87. package/dist/password-y4m307oa.mjs.map +1 -0
  88. package/dist/scheduler/index.d.ts +3 -0
  89. package/dist/scheduler/index.d.ts.map +1 -0
  90. package/dist/scheduler/index.js +2 -0
  91. package/dist/scheduler/index.js.map +1 -0
  92. package/dist/scheduler/scheduler.d.ts +30 -0
  93. package/dist/scheduler/scheduler.d.ts.map +1 -0
  94. package/dist/scheduler/types.d.ts +25 -0
  95. package/dist/scheduler/types.d.ts.map +1 -0
  96. package/dist/types/server.types.d.ts +7 -0
  97. package/dist/types/server.types.d.ts.map +1 -1
  98. package/dist/upload-9lCNnKK_.js +5 -0
  99. package/dist/upload-9lCNnKK_.js.map +1 -0
  100. package/dist/upload-DUjQiuq7.mjs +619 -0
  101. package/dist/upload-DUjQiuq7.mjs.map +1 -0
  102. package/dist/validation/index.js +1 -1
  103. package/dist/validation/index.js.map +1 -1
  104. package/dist/websocket/index.d.ts +3 -0
  105. package/dist/websocket/index.d.ts.map +1 -0
  106. package/dist/websocket/index.js +2 -0
  107. package/dist/websocket/index.js.map +1 -0
  108. package/dist/websocket/manager.d.ts +30 -0
  109. package/dist/websocket/manager.d.ts.map +1 -0
  110. package/dist/websocket/types.d.ts +27 -0
  111. package/dist/websocket/types.d.ts.map +1 -0
  112. package/package.json +58 -18
  113. package/templates/default/controllers/user.controller.ts +44 -64
  114. package/templates/default/package.json +9 -33
  115. package/templates/default/routes/index.ts +2 -12
  116. package/templates/default/routes/user.routes.ts +26 -19
  117. package/templates/default/server.ts +16 -35
  118. package/dist/logger-D7aJSi62.mjs +0 -102
  119. package/dist/logger-DEnWXtpk.js +0 -3
  120. package/dist/manager-B1UKMjXW.js +0 -4
  121. package/dist/manager-B6vqJgEn.mjs +0 -152
  122. package/dist/portal.d.ts +0 -13
  123. package/dist/portal.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,126 +1,107 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
3
+ All notable changes to Harbor will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.3.1] - 2026-01-13
5
+ ## [1.5.0] - 2026-01-14
9
6
 
10
7
  ### Added
11
8
 
12
- - **Version Dropdown** - Click on version badge to see changelog history with highlights
13
- - **Project Templates Link** - Homepage now links to templates documentation
14
- - **Template Init Flag** - `harbor init --template` to initialize with full boilerplate
15
- - **Template Version Tracking** - Each project tracks Harbor and template versions
9
+ #### WebSocket Support
10
+ - `createWebSocketServer()` for real-time applications
11
+ - Room-based broadcasting
12
+ - Heartbeat/ping-pong for connection health
13
+ - Client tracking and management
14
+
15
+ #### Job Scheduler
16
+ - `createScheduler()` for task scheduling
17
+ - Cron expressions support (`scheduler.cron('0 * * * *', ...)`)
18
+ - Interval-based scheduling (`scheduler.every('5m', ...)`)
19
+ - One-time scheduling (`scheduler.at(date, ...)`)
20
+
21
+ #### Rate Limiting
22
+ - `rateLimit()` middleware with memory store
23
+ - `slidingWindowRateLimit()` for accurate limiting
24
+ - Redis store support for distributed systems
25
+ - Customizable key generation and skip logic
26
+
27
+ #### Health Checks
28
+ - `healthCheck()` endpoint with multiple checks
29
+ - Pre-built checks: MongoDB, Redis, Memory, Disk
30
+ - `customHealthCheck()` for custom health logic
31
+ - Critical vs non-critical check distinction
32
+
33
+ #### Metrics (Prometheus)
34
+ - `metricsMiddleware()` for automatic collection
35
+ - `metricsEndpoint()` for Prometheus scraping
36
+ - Counter, Gauge, Histogram metric types
37
+ - Request duration, size, and count metrics
38
+
39
+ #### File Uploads
40
+ - `upload()` middleware for multipart handling
41
+ - Disk and memory storage options
42
+ - File type and size validation
43
+ - Custom filename generation
44
+
45
+ #### Caching
46
+ - `CacheManager` with memory store
47
+ - `RedisCache` for distributed caching
48
+ - `cacheResponse()` middleware
49
+ - `cached()` function wrapper
50
+
51
+ #### Authentication
52
+ - `JWT` class for token signing/verification
53
+ - `jwtAuth()` middleware
54
+ - `apiKeyAuth()` middleware
55
+ - `requireRole()` and `requirePermission()` for RBAC
56
+ - `verifySignature()` for HMAC request signing
57
+ - Password hashing utilities
16
58
 
17
59
  ### Changed
60
+ - Server now has `.use()`, `.get()`, `.post()`, etc. methods
61
+ - Server `.listen()` method for simpler startup
62
+ - Auto-start disabled by default
18
63
 
19
- - Navbar version badge now shows dropdown with all versions
20
- - Sidebar version badge now shows dropdown with changelog
21
- - Hero code block centered properly
22
- - Docs navigation uses React Router (no page reload)
23
-
24
- ## [1.3.0] - 2026-01-13
64
+ ## [1.4.0] - 2026-01-14
25
65
 
26
66
  ### Added
27
-
28
- - **Project Scaffolding CLI** - New `harbor create <project-name>` command:
29
- - Full boilerplate with routes, controllers, services, models, types, utils, constants
30
- - Pre-configured ESLint, TypeScript, and Vitest
31
- - Example User CRUD implementation
32
- - Environment configuration with `.env.example`
33
- - Clean architecture with `index.ts` exports
34
-
35
- - **Subpath Exports** - Enhanced package exports for better tree-shaking:
36
- - `import { ... } from 'harbor'` - Main exports
37
- - `import { Schema, model, connect } from 'harbor/database'` - Database-specific
38
- - `import { ... } from 'harbor/validations'` - Validation utilities
39
- - `import { ... } from 'harbor/docker'` - Docker management
40
- - `import { ... } from 'harbor/utils'` - Utility functions
41
-
42
- - **GitHub Integration** - Added repository links:
43
- - Repository: https://github.com/yaghobieh/Harbor
44
- - Homepage and issue tracker configured in package.json
67
+ - `route.get()`, `route.post()` syntax for routes
68
+ - Express-like convenience methods on server
69
+ - ForgeStack branding and organization
45
70
 
46
71
  ### Changed
72
+ - Package renamed to `@forgestack/harbor`
73
+ - Auto-start now defaults to false
47
74
 
48
- - **Portal Improvements**:
49
- - Navbar is now solid (not floating/transparent)
50
- - Added copy button to all code blocks with visual feedback
51
- - Light/Dark mode toggle with system option
52
- - Restructured all components with `index.ts`, `ComponentName.tsx`, `types.ts` pattern
53
- - All GitHub links now point to official repository
75
+ ## [1.3.0] - 2026-01-13
54
76
 
55
- - Portal version updated to 1.3.0
56
- - CLI version updated to 1.2.0
77
+ ### Added
78
+ - Full MongoDB ODM (Mongoose replacement)
79
+ - Schema, Model, Query with all methods
80
+ - Connection management
81
+ - Hooks (pre, post) support
82
+ - Virtual fields
83
+ - Indexes
57
84
 
58
85
  ## [1.2.0] - 2026-01-12
59
86
 
60
87
  ### Added
88
+ - Simplified router API with `GET()`, `POST()`, etc.
89
+ - Removed need for `.build()` on routes
90
+ - CLI for project scaffolding
61
91
 
62
- - **MongoDB ODM (Mongoose Replacement)** - Complete database module that replaces Mongoose:
63
- - `connect()` / `disconnect()` - MongoDB connection management with events
64
- - `Schema` class - Mongoose-compatible schema definition with all field types
65
- - `model()` function - Create models from schemas
66
- - **All Query Methods**: `find()`, `findOne()`, `findById()`, `create()`, `insertMany()`, `updateOne()`, `updateMany()`, `findOneAndUpdate()`, `findByIdAndUpdate()`, `deleteOne()`, `deleteMany()`, `findOneAndDelete()`, `findByIdAndDelete()`, `countDocuments()`, `estimatedDocumentCount()`, `aggregate()`, `distinct()`, `exists()`
67
- - **Query Builder**: `.where()`, `.select()`, `.sort()`, `.limit()`, `.skip()`, `.lean()`, `.populate()`, `.gt()`, `.gte()`, `.lt()`, `.lte()`, `.in()`, `.nin()`, `.ne()`, `.regex()`, `.exists()`, `.or()`, `.and()`, `.nor()`
68
- - **Schema Features**: virtuals, instance methods, static methods, pre/post hooks (middleware)
69
- - **Index Management**: `createIndex()`, `createIndexes()`, `listIndexes()`, `dropIndex()`
70
- - **Transactions**: `startSession()`, `withTransaction()`
71
- - `Types.ObjectId` - ObjectId type support
72
-
73
- - **Database Translations** - Added i18n support for all database operations (English & Hebrew)
74
-
75
- - **Comprehensive Documentation**:
76
- - Updated README.md with full MongoDB documentation
77
- - Added Database examples to portal
78
- - API reference for all database methods
79
-
80
- ### Changed
81
-
82
- - Portal version updated to 1.2.0
83
- - Portal now includes Database tab in code examples
84
- - Features section now highlights MongoDB ODM capability
85
-
86
- ## [1.1.0] - 2026-01-12
92
+ ## [1.1.0] - 2026-01-11
87
93
 
88
94
  ### Added
95
+ - HTTP request logger (Morgan alternative)
96
+ - i18n support for translations
97
+ - Docker manager
89
98
 
90
- - **Simplified Route API** - New `GET`, `POST`, `PUT`, `PATCH`, `DELETE` functions that don't require `.build()`
91
- - **i18n/Translation System** - Full internationalization support with `t()`, `setLocale()`, includes English and Hebrew
92
- - **Morgan-like HTTP Logger** - In-house `httpLogger()` middleware with formats: tiny, short, dev, combined, common
93
- - **React Portal** - Complete React-based documentation portal with proper component structure
94
- - `route()` function for creating routes with any HTTP method
95
- - Skip functions for HTTP logger: `successOnly`, `healthChecks`, `staticFiles`, `paths`
96
-
97
- ### Changed
98
-
99
- - `RouteBuilder.handler()` now returns `RouteDefinition` directly (no need to call `.build()`)
100
- - Portal converted from static HTML to React project with components, constants, types pattern
101
-
102
- ## [1.0.0] - 2026-01-12
99
+ ## [1.0.0] - 2026-01-10
103
100
 
104
101
  ### Added
105
-
106
- - Initial release of Harbor
107
- - Fast server creation with `createServer()`
108
- - Route management with `RouteBuilder` fluent API
109
- - Pre and post function middleware support
110
- - Request validation with schema definitions
111
- - MongoDB-compatible validation with `MongoValidator`
112
- - Custom validation adapter support
113
- - Config-driven error handling
114
- - CORS middleware with configurable options
115
- - Body parser with size limits
116
- - Request timeout handling
117
- - Docker container management
118
- - Docker Compose integration
119
- - Changelog manager for version tracking
120
- - API Portal documentation generator
121
- - CLI tools for project initialization
122
- - TypeScript-first with full type definitions
123
- - Graceful shutdown handling
124
- - Environment variable overrides
125
- - Comprehensive logging system
126
-
102
+ - Initial release
103
+ - `createServer()` for quick server setup
104
+ - Route management with pre/post functions
105
+ - Validation system
106
+ - Error handling with config
107
+ - Logger integration