@gravito/ripple 4.0.1 → 4.0.3

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 (209) hide show
  1. package/README.md +26 -10
  2. package/dist/{ripple/src/OrbitRipple.d.ts → OrbitRipple.d.ts} +1 -0
  3. package/dist/{ripple/src/RippleServer.d.ts → RippleServer.d.ts} +32 -1
  4. package/dist/core/src/Application.d.ts +41 -0
  5. package/dist/core/src/HookManager.d.ts +33 -189
  6. package/dist/core/src/PlanetCore.d.ts +25 -1
  7. package/dist/core/src/Router.d.ts +32 -46
  8. package/dist/core/src/adapters/bun/BunContext.d.ts +6 -1
  9. package/dist/core/src/adapters/bun/BunNativeAdapter.d.ts +35 -0
  10. package/dist/core/src/adapters/bun/BunWebSocketHandler.d.ts +48 -0
  11. package/dist/core/src/adapters/bun/RadixRouter.d.ts +1 -0
  12. package/dist/core/src/adapters/bun/index.d.ts +7 -0
  13. package/dist/core/src/binary/BinaryUtils.d.ts +105 -0
  14. package/dist/core/src/binary/index.d.ts +5 -0
  15. package/dist/core/src/compat/async-local-storage.d.ts +7 -0
  16. package/dist/core/src/compat/crypto.d.ts +6 -0
  17. package/dist/core/src/engine/AOTRouter.d.ts +10 -0
  18. package/dist/core/src/engine/FastContext.d.ts +19 -1
  19. package/dist/core/src/engine/Gravito.d.ts +13 -18
  20. package/dist/core/src/engine/MinimalContext.d.ts +2 -0
  21. package/dist/core/src/engine/analyzer.d.ts +92 -6
  22. package/dist/core/src/engine/types.d.ts +3 -0
  23. package/dist/core/src/events/EventPriorityQueue.d.ts +18 -256
  24. package/dist/core/src/events/index.d.ts +12 -11
  25. package/dist/core/src/events/queue-core.d.ts +77 -0
  26. package/dist/core/src/events/task-executor.d.ts +51 -0
  27. package/dist/core/src/ffi/NativeAccelerator.d.ts +62 -0
  28. package/dist/core/src/ffi/NativeHasher.d.ts +139 -0
  29. package/dist/core/src/ffi/cbor-fallback.d.ts +96 -0
  30. package/dist/core/src/ffi/hash-fallback.d.ts +33 -0
  31. package/dist/core/src/ffi/index.d.ts +10 -0
  32. package/dist/core/src/ffi/types.d.ts +135 -0
  33. package/dist/core/src/helpers/Str.d.ts +15 -0
  34. package/dist/core/src/hooks/ActionManager.d.ts +132 -0
  35. package/dist/core/src/hooks/AsyncDetector.d.ts +84 -0
  36. package/dist/core/src/hooks/FilterManager.d.ts +71 -0
  37. package/dist/core/src/hooks/MigrationWarner.d.ts +24 -0
  38. package/dist/core/src/hooks/dlq-operations.d.ts +60 -0
  39. package/dist/core/src/hooks/types.d.ts +107 -0
  40. package/dist/core/src/http/CookieJar.d.ts +2 -2
  41. package/dist/core/src/http/types.d.ts +24 -3
  42. package/dist/core/src/index.d.ts +491 -14
  43. package/dist/core/src/observability/contracts.d.ts +137 -0
  44. package/dist/core/src/reliability/DeadLetterQueueManager.d.ts +2 -3
  45. package/dist/core/src/runtime/adapter-bun.d.ts +12 -0
  46. package/dist/core/src/runtime/adapter-deno.d.ts +12 -0
  47. package/dist/core/src/runtime/adapter-node.d.ts +12 -0
  48. package/dist/core/src/runtime/adapter-unknown.d.ts +13 -0
  49. package/dist/core/src/runtime/archive.d.ts +17 -0
  50. package/dist/core/src/runtime/compression.d.ts +21 -0
  51. package/dist/core/src/runtime/deep-equals.d.ts +56 -0
  52. package/dist/core/src/runtime/detection.d.ts +22 -0
  53. package/dist/core/src/runtime/escape.d.ts +34 -0
  54. package/dist/core/src/runtime/index.d.ts +44 -0
  55. package/dist/core/src/runtime/markdown.d.ts +44 -0
  56. package/dist/core/src/runtime/types.d.ts +436 -0
  57. package/dist/core/src/runtime-helpers.d.ts +67 -0
  58. package/dist/core/src/runtime.d.ts +10 -118
  59. package/dist/core/src/testing/HttpTester.d.ts +1 -0
  60. package/dist/core/src/transpiler-utils.d.ts +170 -0
  61. package/dist/{ripple/src/engines → engines}/BunEngine.d.ts +11 -0
  62. package/dist/index.js +1 -7502
  63. package/dist/index.js.map +3 -71
  64. package/package.json +6 -2
  65. package/dist/atlas/src/DB.d.ts +0 -348
  66. package/dist/atlas/src/OrbitAtlas.d.ts +0 -9
  67. package/dist/atlas/src/config/defineConfig.d.ts +0 -14
  68. package/dist/atlas/src/config/index.d.ts +0 -7
  69. package/dist/atlas/src/config/loadConfig.d.ts +0 -41
  70. package/dist/atlas/src/connection/Connection.d.ts +0 -112
  71. package/dist/atlas/src/connection/ConnectionManager.d.ts +0 -180
  72. package/dist/atlas/src/connection/ReplicaConnectionPool.d.ts +0 -54
  73. package/dist/atlas/src/drivers/BunSQLDriver.d.ts +0 -32
  74. package/dist/atlas/src/drivers/BunSQLPreparedStatement.d.ts +0 -118
  75. package/dist/atlas/src/drivers/MongoDBDriver.d.ts +0 -36
  76. package/dist/atlas/src/drivers/MySQLDriver.d.ts +0 -79
  77. package/dist/atlas/src/drivers/PostgresDriver.d.ts +0 -96
  78. package/dist/atlas/src/drivers/RedisDriver.d.ts +0 -43
  79. package/dist/atlas/src/drivers/SQLiteDriver.d.ts +0 -45
  80. package/dist/atlas/src/drivers/types.d.ts +0 -260
  81. package/dist/atlas/src/errors/index.d.ts +0 -45
  82. package/dist/atlas/src/grammar/Grammar.d.ts +0 -342
  83. package/dist/atlas/src/grammar/MongoGrammar.d.ts +0 -47
  84. package/dist/atlas/src/grammar/MySQLGrammar.d.ts +0 -54
  85. package/dist/atlas/src/grammar/NullGrammar.d.ts +0 -35
  86. package/dist/atlas/src/grammar/PostgresGrammar.d.ts +0 -62
  87. package/dist/atlas/src/grammar/SQLiteGrammar.d.ts +0 -32
  88. package/dist/atlas/src/index.d.ts +0 -79
  89. package/dist/atlas/src/migration/Migration.d.ts +0 -64
  90. package/dist/atlas/src/migration/MigrationRepository.d.ts +0 -65
  91. package/dist/atlas/src/migration/Migrator.d.ts +0 -110
  92. package/dist/atlas/src/migration/index.d.ts +0 -6
  93. package/dist/atlas/src/observability/AtlasMetrics.d.ts +0 -33
  94. package/dist/atlas/src/observability/AtlasObservability.d.ts +0 -15
  95. package/dist/atlas/src/observability/AtlasTracer.d.ts +0 -12
  96. package/dist/atlas/src/observability/index.d.ts +0 -9
  97. package/dist/atlas/src/orm/Repository.d.ts +0 -247
  98. package/dist/atlas/src/orm/index.d.ts +0 -6
  99. package/dist/atlas/src/orm/model/DirtyTracker.d.ts +0 -121
  100. package/dist/atlas/src/orm/model/Model.d.ts +0 -458
  101. package/dist/atlas/src/orm/model/ModelRegistry.d.ts +0 -20
  102. package/dist/atlas/src/orm/model/concerns/HasAttributes.d.ts +0 -150
  103. package/dist/atlas/src/orm/model/concerns/HasEvents.d.ts +0 -36
  104. package/dist/atlas/src/orm/model/concerns/HasPersistence.d.ts +0 -92
  105. package/dist/atlas/src/orm/model/concerns/HasRelationships.d.ts +0 -117
  106. package/dist/atlas/src/orm/model/concerns/HasSerialization.d.ts +0 -64
  107. package/dist/atlas/src/orm/model/concerns/applyMixins.d.ts +0 -15
  108. package/dist/atlas/src/orm/model/concerns/index.d.ts +0 -12
  109. package/dist/atlas/src/orm/model/decorators.d.ts +0 -138
  110. package/dist/atlas/src/orm/model/errors.d.ts +0 -52
  111. package/dist/atlas/src/orm/model/index.d.ts +0 -10
  112. package/dist/atlas/src/orm/model/relationships.d.ts +0 -207
  113. package/dist/atlas/src/orm/model/types.d.ts +0 -12
  114. package/dist/atlas/src/orm/schema/SchemaRegistry.d.ts +0 -124
  115. package/dist/atlas/src/orm/schema/SchemaSniffer.d.ts +0 -54
  116. package/dist/atlas/src/orm/schema/index.d.ts +0 -6
  117. package/dist/atlas/src/orm/schema/types.d.ts +0 -85
  118. package/dist/atlas/src/pool/AdaptivePoolManager.d.ts +0 -98
  119. package/dist/atlas/src/pool/PoolHealthChecker.d.ts +0 -91
  120. package/dist/atlas/src/pool/PoolStrategy.d.ts +0 -129
  121. package/dist/atlas/src/pool/PoolWarmer.d.ts +0 -92
  122. package/dist/atlas/src/query/Expression.d.ts +0 -60
  123. package/dist/atlas/src/query/NPlusOneDetector.d.ts +0 -10
  124. package/dist/atlas/src/query/QueryBuilder.d.ts +0 -643
  125. package/dist/atlas/src/query/RelationshipResolver.d.ts +0 -23
  126. package/dist/atlas/src/query/clauses/GroupByClause.d.ts +0 -51
  127. package/dist/atlas/src/query/clauses/HavingClause.d.ts +0 -70
  128. package/dist/atlas/src/query/clauses/JoinClause.d.ts +0 -87
  129. package/dist/atlas/src/query/clauses/LimitClause.d.ts +0 -82
  130. package/dist/atlas/src/query/clauses/OrderByClause.d.ts +0 -69
  131. package/dist/atlas/src/query/clauses/SelectClause.d.ts +0 -71
  132. package/dist/atlas/src/query/clauses/WhereClause.d.ts +0 -167
  133. package/dist/atlas/src/query/clauses/index.d.ts +0 -11
  134. package/dist/atlas/src/schema/Blueprint.d.ts +0 -276
  135. package/dist/atlas/src/schema/ColumnDefinition.d.ts +0 -154
  136. package/dist/atlas/src/schema/ForeignKeyDefinition.d.ts +0 -37
  137. package/dist/atlas/src/schema/MigrationGenerator.d.ts +0 -45
  138. package/dist/atlas/src/schema/Schema.d.ts +0 -131
  139. package/dist/atlas/src/schema/SchemaDiff.d.ts +0 -73
  140. package/dist/atlas/src/schema/TypeGenerator.d.ts +0 -57
  141. package/dist/atlas/src/schema/TypeWriter.d.ts +0 -42
  142. package/dist/atlas/src/schema/grammars/MySQLSchemaGrammar.d.ts +0 -23
  143. package/dist/atlas/src/schema/grammars/PostgresSchemaGrammar.d.ts +0 -26
  144. package/dist/atlas/src/schema/grammars/SQLiteSchemaGrammar.d.ts +0 -28
  145. package/dist/atlas/src/schema/grammars/SchemaGrammar.d.ts +0 -97
  146. package/dist/atlas/src/schema/grammars/index.d.ts +0 -7
  147. package/dist/atlas/src/schema/index.d.ts +0 -8
  148. package/dist/atlas/src/seed/Factory.d.ts +0 -90
  149. package/dist/atlas/src/seed/Seeder.d.ts +0 -28
  150. package/dist/atlas/src/seed/SeederRunner.d.ts +0 -74
  151. package/dist/atlas/src/seed/index.d.ts +0 -6
  152. package/dist/atlas/src/sharding/ShardingManager.d.ts +0 -59
  153. package/dist/atlas/src/types/index.d.ts +0 -1182
  154. package/dist/atlas/src/utils/CursorEncoding.d.ts +0 -63
  155. package/dist/atlas/src/utils/levenshtein.d.ts +0 -9
  156. package/dist/core/src/adapters/PhotonAdapter.d.ts +0 -175
  157. package/dist/core/src/adapters/photon-types.d.ts +0 -73
  158. package/dist/core/src/http/middleware/BodySizeLimit.d.ts +0 -16
  159. package/dist/core/src/http/middleware/Cors.d.ts +0 -24
  160. package/dist/core/src/http/middleware/Csrf.d.ts +0 -23
  161. package/dist/core/src/http/middleware/HeaderTokenGate.d.ts +0 -28
  162. package/dist/core/src/http/middleware/SecurityHeaders.d.ts +0 -29
  163. package/dist/core/src/http/middleware/ThrottleRequests.d.ts +0 -18
  164. package/dist/core/src/instrumentation/index.d.ts +0 -35
  165. package/dist/core/src/instrumentation/opentelemetry.d.ts +0 -178
  166. package/dist/core/src/instrumentation/types.d.ts +0 -182
  167. package/dist/core/src/observability/Metrics.d.ts +0 -244
  168. package/dist/photon/src/index.d.ts +0 -89
  169. package/dist/photon/src/middleware/binary.d.ts +0 -31
  170. package/dist/photon/src/middleware/htmx.d.ts +0 -39
  171. package/dist/photon/src/middleware/ratelimit-redis.d.ts +0 -50
  172. package/dist/photon/src/middleware/ratelimit.d.ts +0 -161
  173. package/dist/photon/src/openapi.d.ts +0 -19
  174. /package/dist/{ripple/src/channels → channels}/Channel.d.ts +0 -0
  175. /package/dist/{ripple/src/channels → channels}/ChannelManager.d.ts +0 -0
  176. /package/dist/{ripple/src/channels → channels}/index.d.ts +0 -0
  177. /package/dist/{ripple/src/drivers → drivers}/LocalDriver.d.ts +0 -0
  178. /package/dist/{ripple/src/drivers → drivers}/NATSDriver.d.ts +0 -0
  179. /package/dist/{ripple/src/drivers → drivers}/RedisDriver.d.ts +0 -0
  180. /package/dist/{ripple/src/drivers → drivers}/index.d.ts +0 -0
  181. /package/dist/{ripple/src/engines → engines}/IRippleEngine.d.ts +0 -0
  182. /package/dist/{ripple/src/engines → engines}/UWebSocketsEngine.d.ts +0 -0
  183. /package/dist/{ripple/src/engines → engines}/WsEngine.d.ts +0 -0
  184. /package/dist/{ripple/src/engines → engines}/index.d.ts +0 -0
  185. /package/dist/{ripple/src/errors → errors}/RippleError.d.ts +0 -0
  186. /package/dist/{ripple/src/errors → errors}/index.d.ts +0 -0
  187. /package/dist/{ripple/src/events → events}/BroadcastEvent.d.ts +0 -0
  188. /package/dist/{ripple/src/events → events}/BroadcastManager.d.ts +0 -0
  189. /package/dist/{ripple/src/events → events}/Broadcaster.d.ts +0 -0
  190. /package/dist/{ripple/src/events → events}/index.d.ts +0 -0
  191. /package/dist/{ripple/src/health → health}/HealthChecker.d.ts +0 -0
  192. /package/dist/{ripple/src/health → health}/index.d.ts +0 -0
  193. /package/dist/{ripple/src/index.d.ts → index.d.ts} +0 -0
  194. /package/dist/{ripple/src/logging → logging}/Logger.d.ts +0 -0
  195. /package/dist/{ripple/src/logging → logging}/index.d.ts +0 -0
  196. /package/dist/{ripple/src/middleware → middleware}/InterceptorManager.d.ts +0 -0
  197. /package/dist/{ripple/src/observability → observability}/RippleMetrics.d.ts +0 -0
  198. /package/dist/{ripple/src/reliability → reliability}/AckManager.d.ts +0 -0
  199. /package/dist/{ripple/src/serializers → serializers}/ISerializer.d.ts +0 -0
  200. /package/dist/{ripple/src/serializers → serializers}/JsonSerializer.d.ts +0 -0
  201. /package/dist/{ripple/src/serializers → serializers}/ProtobufSerializer.d.ts +0 -0
  202. /package/dist/{ripple/src/serializers → serializers}/index.d.ts +0 -0
  203. /package/dist/{ripple/src/tracking → tracking}/ConnectionTracker.d.ts +0 -0
  204. /package/dist/{ripple/src/tracking → tracking}/SessionManager.d.ts +0 -0
  205. /package/dist/{ripple/src/tracking → tracking}/index.d.ts +0 -0
  206. /package/dist/{ripple/src/types.d.ts → types.d.ts} +0 -0
  207. /package/dist/{ripple/src/utils → utils}/MessageSerializer.d.ts +0 -0
  208. /package/dist/{ripple/src/utils → utils}/TokenBucket.d.ts +0 -0
  209. /package/dist/{ripple/src/utils → utils}/index.d.ts +0 -0
@@ -11,66 +11,537 @@ import type { GravitoConfig } from './PlanetCore';
11
11
  * @public
12
12
  */
13
13
  export declare const VERSION: string;
14
+ /**
15
+ * Bun-native HTTP adapter for Gravito.
16
+ *
17
+ * Provides high-performance HTTP handling using Bun's native Request/Response API.
18
+ * Implements the HttpAdapter interface for direct integration with Gravito applications.
19
+ *
20
+ * @see {@link GravitoEngineAdapter} for alternative adapter implementations
21
+ * @public
22
+ */
23
+ export { BunNativeAdapter } from './adapters/bun/BunNativeAdapter';
24
+ /**
25
+ * Generic HTTP adapter bridge for Gravito.
26
+ *
27
+ * Allows swapping out HTTP engines (Hono, Elysia, etc.) by implementing the HttpAdapter
28
+ * interface. Use this when you need a different runtime or framework integration.
29
+ *
30
+ * @see {@link BunNativeAdapter} for the recommended Bun-native implementation
31
+ * @public
32
+ */
14
33
  export { GravitoEngineAdapter } from './adapters/GravitoEngineAdapter';
15
- export { createGravitoAdapter, createPhotonAdapter, GravitoAdapter, PhotonAdapter, PhotonContextWrapper, PhotonRequestWrapper, } from './adapters/PhotonAdapter';
34
+ /**
35
+ * HTTP adapter type definitions and utilities.
36
+ *
37
+ * Type definitions for building custom HTTP adapters and checking adapter compatibility.
38
+ *
39
+ * @public
40
+ */
16
41
  export type { AdapterConfig, AdapterFactory, HttpAdapter, RouteDefinition } from './adapters/types';
42
+ /**
43
+ * Type guard for HTTP adapter validation.
44
+ *
45
+ * @param obj - Object to check
46
+ * @returns true if object implements the HttpAdapter interface
47
+ * @example
48
+ * ```typescript
49
+ * if (isHttpAdapter(config.adapter)) {
50
+ * const adapter = config.adapter as HttpAdapter
51
+ * }
52
+ * ```
53
+ * @public
54
+ */
17
55
  export { isHttpAdapter } from './adapters/types';
18
- export type { ContentfulStatusCode, GravitoContext, GravitoErrorHandler, GravitoHandler, GravitoMiddleware, GravitoNext, GravitoNotFoundHandler, GravitoRequest, GravitoVariables, HttpMethod, StatusCode, ValidationTarget, } from './http/types';
56
+ /**
57
+ * Gravito HTTP request/response types and constants.
58
+ *
59
+ * Type definitions for HTTP methods, status codes, context objects, handlers, and middleware.
60
+ * These types are fundamental to routing and request handling in Gravito applications.
61
+ *
62
+ * @public
63
+ */
64
+ export type { ContentfulStatusCode, GravitoContext, GravitoErrorHandler, GravitoHandler, GravitoMiddleware, GravitoNext, GravitoNotFoundHandler, GravitoRequest, GravitoVariables, HttpMethod, ProxyOptions, StatusCode, ValidationTarget, } from './http/types';
65
+ /**
66
+ * Enterprise-grade application container with DI, middleware, and plugin support.
67
+ *
68
+ * Application provides a high-level abstraction for building modular Gravito apps with
69
+ * dependency injection, service configuration, middleware chains, and extensibility hooks.
70
+ * Use this for complex applications; use {@link PlanetCore} for HTTP server bootstrapping.
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * const app = new Application({ config: myConfig })
75
+ * app.register(MyOrbit)
76
+ * app.bind('myService', () => new MyService())
77
+ * ```
78
+ * @public
79
+ */
19
80
  export { Application, type ApplicationConfig } from './Application';
81
+ /**
82
+ * Command kernel for CLI command registration and execution.
83
+ *
84
+ * Manages command handlers, argument parsing, and command lifecycle in CLI contexts.
85
+ * Typically used internally by Gravito; extend via custom commands registered with the kernel.
86
+ *
87
+ * @public
88
+ */
20
89
  export { type CommandHandler, CommandKernel } from './CommandKernel';
90
+ /**
91
+ * Configuration manager for environment-aware application settings.
92
+ *
93
+ * Provides centralized config management with support for environment variables,
94
+ * config files, defaults, and type-safe access patterns. All configs are immutable.
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const appName = config.get('APP_NAME', 'DefaultApp')
99
+ * const dbUrl = config.get('DATABASE_URL')
100
+ * ```
101
+ * @public
102
+ */
21
103
  export { ConfigManager } from './ConfigManager';
104
+ /**
105
+ * Dependency injection container for service resolution and lifecycle management.
106
+ *
107
+ * Core singleton/transient resolver with support for factory functions, constructor injection,
108
+ * and service binding. All resolved instances are immutably cached.
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * const container = new Container()
113
+ * container.bind('logger', () => new ConsoleLogger())
114
+ * const logger = container.resolve('logger')
115
+ * ```
116
+ * @public
117
+ */
22
118
  export { Container, type Factory, type ServiceKey, type ServiceMap } from './Container';
119
+ /**
120
+ * Request-scoped instance manager for HTTP request lifecycle.
121
+ *
122
+ * Manages transient services and cleanup that are tied to individual HTTP requests.
123
+ * Automatically integrates with Gravito's middleware pipeline for scope isolation.
124
+ *
125
+ * @public
126
+ */
23
127
  export { RequestScopeManager } from './Container/RequestScopeManager';
128
+ /**
129
+ * Request scope metrics collection and analysis.
130
+ *
131
+ * Tracks memory usage, instance counts, and lifecycle metrics for request-scoped services.
132
+ * Provides observability into container behavior and potential memory leaks.
133
+ *
134
+ * @public
135
+ */
24
136
  export { RequestScopeMetrics, RequestScopeMetricsCollector, type RequestScopeObserver, } from './Container/RequestScopeMetrics';
137
+ /**
138
+ * CLI queue command registration utilities.
139
+ *
140
+ * Provides helpers for registering queue-related commands (queue:work, queue:retry, etc.)
141
+ * into the Gravito CLI framework.
142
+ *
143
+ * @public
144
+ */
25
145
  export { registerQueueCommands } from './cli/queue-commands';
146
+ /**
147
+ * Centralized HTTP error handler with status code management.
148
+ *
149
+ * Converts HTTP status codes to error responses with appropriate messages.
150
+ * Used internally by the HTTP layer and exception handlers.
151
+ *
152
+ * @public
153
+ */
26
154
  export { codeFromStatus, ErrorHandler, type ErrorHandlerDeps, messageFromStatus, } from './ErrorHandler';
155
+ /**
156
+ * Event manager for application-level event dispatching and listener registration.
157
+ *
158
+ * Provides type-safe event system with support for synchronous listeners and
159
+ * async queue-based listeners. Integrates with the event queue infrastructure.
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * core.events.listen(UserCreated, SendWelcomeEmail)
164
+ * await core.events.dispatch(new UserCreated(user))
165
+ * ```
166
+ * @public
167
+ */
27
168
  export { EventManager } from './EventManager';
169
+ /**
170
+ * Request scope error handling utilities for memory safety.
171
+ *
172
+ * Provides cleanup functions, leak detection, and error context extraction
173
+ * to prevent memory leaks and ensure proper resource disposal on request completion.
174
+ * Use these in custom middleware or error handlers for enhanced reliability.
175
+ *
176
+ * @public
177
+ */
28
178
  export { cleanupRequestScopeOnError, detectRequestScopeLeaks, extractRequestScopeErrorContext, RequestScopeCleanupError, type RequestScopeErrorContext, withRequestScopeCleanup, } from './error-handling/RequestScopeErrorContext';
29
- export type { CircuitBreakerOptions, DLQEntry, DLQFilter, EventBackend, EventOptions, EventTask, } from './events';
30
- export { CircuitBreaker, CircuitBreakerState, DEFAULT_EVENT_OPTIONS, DeadLetterQueue, EventPriorityQueue, } from './events';
179
+ /**
180
+ * High-reliability event queue infrastructure with backpressure, circuit breaking, and flow control.
181
+ *
182
+ * Complete async event processing system with queue prioritization, retry logic, dead-letter queue,
183
+ * worker pool management, backpressure handling, and circuit breaker patterns for system stability.
184
+ * Handles millions of events with guaranteed delivery and failure recovery.
185
+ *
186
+ * Key components:
187
+ * - EventPriorityQueue: Multi-priority async queue with backpressure
188
+ * - CircuitBreaker: Fault tolerance with automatic recovery
189
+ * - DeadLetterQueue: Failed event capture and replay
190
+ * - WorkerPool: Concurrent task execution with metrics
191
+ * - BackpressureManager: Flow control to prevent overload
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * const queue = new EventPriorityQueue(config)
196
+ * await queue.enqueue('high-priority', task)
197
+ * const metrics = queue.metrics()
198
+ * ```
199
+ * @public
200
+ */
201
+ export type { BackpressureConfig, BackpressureDecision, BackpressureMetricsSnapshot, BackpressureStrategy, CircuitBreakerMetrics, CircuitBreakerMetricsRecorder, CircuitBreakerOptions, DeadLetterDecision, DLQEntry, DLQEntryCallback, DLQEntrySource, DLQFilter, EventBackend, EventOptions, EventQueueConfig, EventTask, FlowControlContext, FlowControlStrategy, MultiPriorityQueueDepth, PriorityStatistics, RetrySchedulerConfig, WindowAdjustment, WorkerPoolConfig, WorkerPoolStats, WorkerStats, } from './events';
202
+ export { BackpressureManager, BackpressureState, CircuitBreaker, CircuitBreakerState, CompositeStrategy, DEFAULT_EVENT_OPTIONS, DeadLetterQueue, EventPriorityQueue, IdempotencyCache, PriorityEscalationManager, PriorityRebalanceStrategy, QueueDepthStrategy, RateLimitStrategy, RetryScheduler, StarvationProtectionStrategy, WorkerPool, WorkerPoolMetrics, } from './events';
203
+ /**
204
+ * Event system observability and metrics collection.
205
+ *
206
+ * Built-in tracing, metrics, and performance monitoring for event queues and workers.
207
+ * Provides hooks into queue operations for custom instrumentation via OpenTelemetry.
208
+ *
209
+ * @public
210
+ */
31
211
  export type { EventTracingConfig, ObservabilityConfig, QueueDepthCallback, } from './events/observability';
32
212
  export { EventMetrics, EventTracer, EventTracing, getEventTracing, ObservableHookManager, OTelEventMetrics, } from './events/observability';
213
+ /**
214
+ * Observability provider contracts for monitoring and tracing.
215
+ *
216
+ * Abstract interfaces for building custom observability integrations with
217
+ * OpenTelemetry, monitoring systems, or custom tracing implementations.
218
+ * Concrete implementations are provided by @gravito/monitor.
219
+ *
220
+ * @see https://github.com/gravitojs/gravito-monitor
221
+ * @public
222
+ */
223
+ export type { EventMetricsRecorder, EventTracingProvider, ObservabilityProvider, TracingSpan, WorkerMetricsProvider, } from './observability/contracts';
224
+ /**
225
+ * No-operation observability provider for testing and development.
226
+ *
227
+ * Returns a noop provider that satisfies the ObservabilityProvider interface
228
+ * without performing actual tracing or metrics collection. Useful for development
229
+ * environments or when observability is not needed.
230
+ *
231
+ * @returns A noop ObservabilityProvider instance
232
+ * @public
233
+ */
234
+ export { createNoOpObservabilityProvider } from './observability/contracts';
235
+ /**
236
+ * Real-time queue dashboard for monitoring event processing.
237
+ *
238
+ * Provides a web-based and CLI dashboard for monitoring queue depth, worker status,
239
+ * error rates, throughput, and other metrics. Useful for operational visibility
240
+ * and debugging queue performance issues.
241
+ *
242
+ * @public
243
+ */
33
244
  export { type DashboardSnapshot, type ErrorStats, type JobEvent, QueueDashboard, type QueueDashboardConfig, type QueueMetrics, type WorkerMetrics as QueueWorkerMetrics, } from './observability/QueueDashboard';
245
+ /**
246
+ * Built-in HTTP exception classes for common error scenarios.
247
+ *
248
+ * Pre-defined exception classes (BadRequestException, UnauthorizedException, NotFoundException, etc.)
249
+ * that automatically map to correct HTTP status codes. Extend HttpException for custom domain errors.
250
+ *
251
+ * @public
252
+ */
34
253
  export * from './exceptions';
254
+ /**
255
+ * Global process error handler registration for uncaught exceptions and rejections.
256
+ *
257
+ * Registers handlers for process-level errors (unhandledRejection, uncaughtException) that occur
258
+ * outside of HTTP request context. Enables centralized error reporting, logging, and recovery.
259
+ *
260
+ * @example
261
+ * ```typescript
262
+ * registerGlobalErrorHandlers({
263
+ * onUnhandledRejection: (error) => logger.error('Rejection:', error),
264
+ * onUncaughtException: (error) => process.exit(1),
265
+ * })
266
+ * ```
267
+ * @public
268
+ */
35
269
  export { type GlobalErrorHandlersMode, type GlobalProcessErrorHandlerContext, type GlobalProcessErrorKind, type RegisterGlobalErrorHandlersOptions, registerGlobalErrorHandlers, } from './GlobalErrorHandlers';
270
+ /**
271
+ * Gravito server bootstrap and lifecycle management.
272
+ *
273
+ * Provides the main server instance with configuration, port binding, graceful shutdown,
274
+ * and signal handling. Use {@link PlanetCore} for most applications; use GravitoServer
275
+ * when you need lower-level HTTP server control.
276
+ *
277
+ * @public
278
+ */
36
279
  export { type GravitoManifest, GravitoServer } from './GravitoServer';
280
+ /**
281
+ * Hook system for extensibility and event-driven architecture.
282
+ *
283
+ * Provides action hooks (filters) and listener hooks (listeners) that allow plugins
284
+ * and custom code to tap into framework lifecycle events. Supports async handlers
285
+ * and conditional execution.
286
+ *
287
+ * @example
288
+ * ```typescript
289
+ * const hooks = new HookManager()
290
+ * hooks.addAction('user:created', async (user) => {
291
+ * await sendWelcomeEmail(user)
292
+ * })
293
+ * ```
294
+ * @public
295
+ */
37
296
  export type { ActionCallback, FilterCallback, ListenerInfo, ListenerOptions } from './HookManager';
38
297
  export { HookManager, type HookManagerConfig } from './HookManager';
298
+ /**
299
+ * Application health check provider for readiness and liveness probes.
300
+ *
301
+ * Enables custom health checks for database connectivity, cache availability, and other
302
+ * dependencies. Integrates with Kubernetes and load balancer health endpoints.
303
+ *
304
+ * @public
305
+ */
39
306
  export type { HealthCheck, HealthCheckResult } from './health/HealthProvider';
40
307
  export { HealthProvider } from './health/HealthProvider';
41
308
  export type { DumpOptions } from './helpers';
309
+ /**
310
+ * Developer-friendly utility functions and helper classes.
311
+ *
312
+ * Collection of utilities for common tasks: array/string manipulation (Arr, Str),
313
+ * value resolution (value, tap), assertions (abort, throwIf, throwUnless),
314
+ * debugging (dump, dd), and service access (app, config, env, logger, router).
315
+ *
316
+ * @public
317
+ */
42
318
  export { Arr, abort, abortIf, abortUnless, app, blank, config, DumpDieError, dd, dump, env, filled, hasApp, logger, router, Str, setApp, tap, throwIf, throwUnless, value, } from './helpers';
319
+ /**
320
+ * Helper utilities for data transformation and validation.
321
+ * @public
322
+ */
43
323
  export * from './helpers/data';
324
+ /**
325
+ * Error creation and handling helpers.
326
+ * @public
327
+ */
44
328
  export * from './helpers/errors';
329
+ /**
330
+ * HTTP response building helpers.
331
+ * @public
332
+ */
45
333
  export * from './helpers/response';
334
+ /**
335
+ * Cookie jar and cookie management utilities.
336
+ *
337
+ * Provides CookieJar class for cookie-set operations and helper functions
338
+ * (getCookie, setCookie, deleteCookie) for cookie manipulation in requests/responses.
339
+ *
340
+ * @example
341
+ * ```typescript
342
+ * setCookie(ctx, 'sessionId', token, { httpOnly: true, sameSite: 'Strict' })
343
+ * const value = getCookie(ctx, 'sessionId')
344
+ * ```
345
+ * @public
346
+ */
46
347
  export { CookieJar, type CookieOptions } from './http/CookieJar';
47
348
  export { deleteCookie, getCookie, setCookie } from './http/cookie';
48
- export { type BodySizeLimitOptions, bodySizeLimit } from './http/middleware/BodySizeLimit';
49
- export { type CorsOptions, type CorsOrigin, cors } from './http/middleware/Cors';
50
- export { type CsrfOptions, csrfProtection, getCsrfToken } from './http/middleware/Csrf';
51
- export { createHeaderGate, type HeaderTokenGateOptions, type RequireHeaderTokenOptions, requireHeaderToken, } from './http/middleware/HeaderTokenGate';
52
- export { type HstsOptions, type SecurityHeadersOptions, securityHeaders, } from './http/middleware/SecurityHeaders';
53
- export { ThrottleRequests } from './http/middleware/ThrottleRequests';
54
- export * as instrumentation from './instrumentation';
55
- export { DEFAULT_CONFIG as OTEL_DEFAULT_CONFIG, getMeter, getOpenTelemetrySDK, getTracer as getOtelTracer, isOpenTelemetryInitialized, type MetricsConfig as OtelMetricsConfig, type MetricsExporter, type OpenTelemetryConfig, type OpenTelemetrySDK, OTEL_ENV_VARS, resetOpenTelemetry, setupOpenTelemetry, shutdownOpenTelemetry, type TracingConfig as OtelTracingConfig, type TracingExporter, } from './instrumentation';
349
+ /**
350
+ * Event listener interface for asynchronous event handling.
351
+ *
352
+ * Listeners handle dispatched events synchronously or asynchronously. Implement ShouldQueue
353
+ * to enable queue-based execution with retry and delay support.
354
+ *
355
+ * @public
356
+ */
56
357
  export type { Listener, ShouldQueue } from './Listener';
358
+ /**
359
+ * Structured logging interface and default console implementation.
360
+ *
361
+ * Standard PSR-3-inspired logger interface (debug, info, warn, error methods)
362
+ * enables swapping implementations (Winston, Pino, etc.). ConsoleLogger provides
363
+ * a basic console-based implementation suitable for development.
364
+ *
365
+ * @public
366
+ */
57
367
  export type { Logger } from './Logger';
58
368
  export { ConsoleLogger } from './Logger';
369
+ /**
370
+ * Main application kernel and HTTP server bootstrap.
371
+ *
372
+ * PlanetCore is the entry point for Gravito applications. It handles service registration,
373
+ * middleware setup, route definitions, event binding, and server lifecycle. Use PlanetCore.boot()
374
+ * to initialize a complete application.
375
+ *
376
+ * @example
377
+ * ```typescript
378
+ * const core = await PlanetCore.boot(config)
379
+ * core.listen(3000)
380
+ * ```
381
+ * @public
382
+ */
59
383
  export { type CacheService, type ErrorHandlerContext, type GravitoConfig, type GravitoOrbit, PlanetCore, type ViewService, } from './PlanetCore';
384
+ /**
385
+ * Request context carrier for per-request state and data.
386
+ *
387
+ * Provides type-safe storage for request-scoped data (user, tracing context, etc.)
388
+ * with automatic cleanup. Integrates with request scope management.
389
+ *
390
+ * @public
391
+ */
60
392
  export { RequestContext, type RequestContextData, } from './RequestContext';
393
+ /**
394
+ * HTTP route definition and registration.
395
+ *
396
+ * Route represents a single HTTP route with its handler, middleware, and metadata.
397
+ * Use Router to register routes; Route provides the chainable registration API.
398
+ *
399
+ * @public
400
+ */
61
401
  export { Route } from './Route';
402
+ /**
403
+ * HTTP routing system with controller and handler support.
404
+ *
405
+ * Provides fluent API for route registration (GET, POST, etc.), middleware attachment,
406
+ * route groups, and controller method dispatch. Supports form request validation,
407
+ * domain constraints, and nested groups.
408
+ *
409
+ * @example
410
+ * ```typescript
411
+ * router.get('/users', [UserController, 'index'])
412
+ * router.post('/users', UserStoreRequest, [UserController, 'store'])
413
+ *
414
+ * router.group({ prefix: '/api' }, (r) => {
415
+ * r.get('/posts', [PostController, 'index'])
416
+ * })
417
+ * ```
418
+ * @public
419
+ */
62
420
  export { type ControllerClass, FORM_REQUEST_SYMBOL, type FormRequestClass, type FormRequestLike, RouteGroup, type RouteHandler, type RouteOptions, Router, } from './Router';
421
+ /**
422
+ * Dead-letter queue management and retry policy configuration.
423
+ *
424
+ * Handles failed events that cannot be processed. Provides DLQ inspection, replay,
425
+ * and filtering. Integrates with RetryScheduler for automatic retries.
426
+ *
427
+ * @public
428
+ */
63
429
  export type { DLQManagerFilter, DLQRecord, DLQStats, RetryPolicy } from './reliability';
64
430
  export { DeadLetterQueueManager, getDefaultRetryPolicy, getPresetRetryPolicy, RetryEngine, } from './reliability';
431
+ /**
432
+ * Service provider for application bootstrap and service registration.
433
+ *
434
+ * Base class for extending Gravito with custom service bindings, event listeners,
435
+ * and middleware registration. Providers are automatically loaded during application boot.
436
+ *
437
+ * @example
438
+ * ```typescript
439
+ * class MyServiceProvider extends ServiceProvider {
440
+ * register() {
441
+ * this.app.bind('cache', () => new RedisCache())
442
+ * }
443
+ * boot() {
444
+ * const cache = this.app.resolve('cache')
445
+ * }
446
+ * }
447
+ * ```
448
+ * @public
449
+ */
65
450
  export { ServiceProvider } from './ServiceProvider';
451
+ /**
452
+ * Encryption service for secure data handling.
453
+ *
454
+ * Provides AES-256 encryption for sensitive data with key derivation from app key.
455
+ * Automatically handles IV generation and verification.
456
+ *
457
+ * @public
458
+ */
66
459
  export { Encrypter, type EncrypterOptions } from './security/Encrypter';
460
+ /**
461
+ * Event base class and broadcast channel types.
462
+ *
463
+ * Event is the base class for application events. Implement ShouldBroadcast
464
+ * to enable real-time broadcasting to connected clients.
465
+ *
466
+ * @example
467
+ * ```typescript
468
+ * class UserCreated extends Event {
469
+ * constructor(public user: User) { super() }
470
+ * }
471
+ * ```
472
+ * @public
473
+ */
67
474
  export type { Channel, ShouldBroadcast } from './types/events';
68
475
  export { Event } from './types/events';
476
+ /**
477
+ * Testing utilities and test helpers for unit and integration tests.
478
+ * @public
479
+ */
69
480
  export * from './testing';
70
- export { createSqliteDatabase, getPasswordAdapter, getRuntimeAdapter, getRuntimeEnv, type RuntimeAdapter, type RuntimeFileStat, type RuntimeKind, type RuntimePasswordAdapter, type RuntimeProcess, type RuntimeServeConfig, type RuntimeServer, type RuntimeSpawnOptions, type RuntimeSqliteDatabase, type RuntimeSqliteStatement, } from './runtime';
481
+ /**
482
+ * Runtime abstraction layer for cross-platform compatibility (Bun, Node, Deno).
483
+ *
484
+ * Provides adapters for file I/O, compression, markdown rendering, password hashing,
485
+ * SQLite database, and archive operations. Automatically detects runtime and loads
486
+ * the appropriate implementation. Ensures code portability across Bun, Node.js, and Deno.
487
+ *
488
+ * @example
489
+ * ```typescript
490
+ * const adapter = getRuntimeAdapter()
491
+ * const fs = adapter.fs
492
+ * const data = await fs.readText('file.txt')
493
+ * ```
494
+ * @public
495
+ */
496
+ export { type ArchiveCreateOptions, type ArchiveEntry, type ArchiveExtractOptions, type ArchiveFileInfo, type ArchiveFromDirectoryOptions, archiveFromDirectory, type CompressionOptions, createHtmlRenderCallbacks, createSqliteDatabase, type EscapeHtmlFn, getArchiveAdapter, getCompressionAdapter, getEscapeHtml, getMarkdownAdapter, getPasswordAdapter, getRuntimeAdapter, getRuntimeEnv, getRuntimeKind, type MarkdownRenderCallbacks, type MarkdownRenderOptions, type RuntimeAdapter, type RuntimeArchiveAdapter, type RuntimeCompressionAdapter, type RuntimeFileSink, type RuntimeFileStat, type RuntimeKind, type RuntimeMarkdownAdapter, type RuntimePasswordAdapter, type RuntimeProcess, type RuntimeProcessOutput, type RuntimeResourceUsage, type RuntimeServeConfig, type RuntimeServer, type RuntimeSpawnOptions, type RuntimeSpawnSyncResult, type RuntimeSqliteDatabase, type RuntimeSqliteStatement, resetRuntimeAdapter, toUint8Array, } from './runtime';
497
+ /**
498
+ * Runtime helper functions for file system operations.
499
+ *
500
+ * Convenience functions for common file operations: read/write/append/rename,
501
+ * directory creation/reading, JSON parsing, and recursive deletion.
502
+ * All functions abstract away platform differences.
503
+ *
504
+ * @public
505
+ */
506
+ export { getDefaultRuntimeAdapter, runtimeAppendFile, runtimeCreateFileSink, runtimeMkdir, runtimeReadDir, runtimeReadJSON, runtimeReadText, runtimeRemoveRecursive, runtimeRename, runtimeStatFull, runtimeWriteFileExclusive, } from './runtime-helpers';
507
+ /**
508
+ * Binary data utilities and deep equality comparison.
509
+ *
510
+ * BinaryUtils provides utilities for binary data handling. Deep equality checking
511
+ * enables structural comparison of complex objects across runtime environments.
512
+ *
513
+ * @public
514
+ */
515
+ export { BinaryUtils } from './binary';
516
+ /**
517
+ * Deep equality comparison for complex objects and values.
518
+ *
519
+ * Provides customizable deep equality checking that handles circular references,
520
+ * custom equality functions, and type-specific comparisons.
521
+ *
522
+ * @public
523
+ */
524
+ export type { DeepEqualsFn, DeepEqualsOptions } from './runtime/deep-equals';
525
+ export { getDeepEquals } from './runtime/deep-equals';
526
+ /**
527
+ * Native Bun HTTP engine for maximum performance.
528
+ *
529
+ * High-performance standalone HTTP server implementation using Bun's native APIs.
530
+ * Available via @gravito/core/engine import path for direct usage without PlanetCore.
531
+ * Use this when you need raw performance and are targeting Bun runtime.
532
+ *
533
+ * @see {@link PlanetCore} for the full-featured application framework
534
+ * @public
535
+ */
71
536
  export * as engine from './engine';
72
537
  /**
73
- * Configure your Gravito application
538
+ * Configure your Gravito application with type safety.
539
+ *
540
+ * Helper function that validates and returns application configuration.
541
+ * Enables IDE autocomplete and type checking for GravitoConfig.
542
+ *
543
+ * @param config - Application configuration object
544
+ * @returns The same config object, type-validated
74
545
  *
75
546
  * @example
76
547
  * ```typescript
@@ -84,5 +555,11 @@ export * as engine from './engine';
84
555
  *
85
556
  * const core = await PlanetCore.boot(config)
86
557
  * ```
558
+ * @public
87
559
  */
88
560
  export declare function defineConfig(config: GravitoConfig): GravitoConfig;
561
+ /**
562
+ * Bun platform-specific adapters and utilities.
563
+ * @public
564
+ */
565
+ export * from './adapters/bun/index';