@gravito/echo 3.1.1 → 4.0.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 (295) hide show
  1. package/README.md +24 -9
  2. package/dist/OrbitEcho.d.ts +76 -60
  3. package/dist/errors/EchoError.d.ts +29 -0
  4. package/dist/errors/codes.d.ts +20 -0
  5. package/dist/index.d.ts +34 -16
  6. package/dist/index.js +3 -1596
  7. package/dist/index.js.map +3 -28
  8. package/dist/{echo/src/middleware → middleware}/RequestBufferMiddleware.d.ts +3 -3
  9. package/dist/providers/GenericProvider.d.ts +37 -19
  10. package/dist/providers/GitHubProvider.d.ts +21 -13
  11. package/dist/providers/StripeProvider.d.ts +20 -13
  12. package/dist/providers/index.d.ts +14 -4
  13. package/dist/receive/SignatureValidator.d.ts +33 -1
  14. package/dist/receive/WebhookReceiver.d.ts +139 -22
  15. package/dist/receive/index.d.ts +0 -1
  16. package/dist/resilience/CircuitBreaker.d.ts +6 -0
  17. package/dist/{echo/src/resilience → resilience}/index.d.ts +2 -1
  18. package/dist/send/WebhookDispatcher.d.ts +159 -16
  19. package/dist/send/index.d.ts +0 -1
  20. package/dist/types.d.ts +671 -57
  21. package/package.json +9 -3
  22. package/dist/OrbitEcho.d.ts.map +0 -1
  23. package/dist/atlas/src/DB.d.ts +0 -348
  24. package/dist/atlas/src/OrbitAtlas.d.ts +0 -9
  25. package/dist/atlas/src/config/defineConfig.d.ts +0 -14
  26. package/dist/atlas/src/config/index.d.ts +0 -7
  27. package/dist/atlas/src/config/loadConfig.d.ts +0 -41
  28. package/dist/atlas/src/connection/Connection.d.ts +0 -112
  29. package/dist/atlas/src/connection/ConnectionManager.d.ts +0 -180
  30. package/dist/atlas/src/connection/ReplicaConnectionPool.d.ts +0 -54
  31. package/dist/atlas/src/drivers/BunSQLDriver.d.ts +0 -32
  32. package/dist/atlas/src/drivers/BunSQLPreparedStatement.d.ts +0 -118
  33. package/dist/atlas/src/drivers/MongoDBDriver.d.ts +0 -36
  34. package/dist/atlas/src/drivers/MySQLDriver.d.ts +0 -79
  35. package/dist/atlas/src/drivers/PostgresDriver.d.ts +0 -96
  36. package/dist/atlas/src/drivers/RedisDriver.d.ts +0 -43
  37. package/dist/atlas/src/drivers/SQLiteDriver.d.ts +0 -45
  38. package/dist/atlas/src/drivers/types.d.ts +0 -260
  39. package/dist/atlas/src/errors/index.d.ts +0 -45
  40. package/dist/atlas/src/grammar/Grammar.d.ts +0 -342
  41. package/dist/atlas/src/grammar/MongoGrammar.d.ts +0 -47
  42. package/dist/atlas/src/grammar/MySQLGrammar.d.ts +0 -54
  43. package/dist/atlas/src/grammar/NullGrammar.d.ts +0 -35
  44. package/dist/atlas/src/grammar/PostgresGrammar.d.ts +0 -62
  45. package/dist/atlas/src/grammar/SQLiteGrammar.d.ts +0 -32
  46. package/dist/atlas/src/index.d.ts +0 -79
  47. package/dist/atlas/src/migration/Migration.d.ts +0 -64
  48. package/dist/atlas/src/migration/MigrationRepository.d.ts +0 -65
  49. package/dist/atlas/src/migration/Migrator.d.ts +0 -110
  50. package/dist/atlas/src/migration/index.d.ts +0 -6
  51. package/dist/atlas/src/observability/AtlasMetrics.d.ts +0 -33
  52. package/dist/atlas/src/observability/AtlasObservability.d.ts +0 -15
  53. package/dist/atlas/src/observability/AtlasTracer.d.ts +0 -12
  54. package/dist/atlas/src/observability/index.d.ts +0 -9
  55. package/dist/atlas/src/orm/Repository.d.ts +0 -247
  56. package/dist/atlas/src/orm/index.d.ts +0 -6
  57. package/dist/atlas/src/orm/model/DirtyTracker.d.ts +0 -121
  58. package/dist/atlas/src/orm/model/Model.d.ts +0 -458
  59. package/dist/atlas/src/orm/model/ModelRegistry.d.ts +0 -20
  60. package/dist/atlas/src/orm/model/concerns/HasAttributes.d.ts +0 -150
  61. package/dist/atlas/src/orm/model/concerns/HasEvents.d.ts +0 -36
  62. package/dist/atlas/src/orm/model/concerns/HasPersistence.d.ts +0 -92
  63. package/dist/atlas/src/orm/model/concerns/HasRelationships.d.ts +0 -117
  64. package/dist/atlas/src/orm/model/concerns/HasSerialization.d.ts +0 -64
  65. package/dist/atlas/src/orm/model/concerns/applyMixins.d.ts +0 -15
  66. package/dist/atlas/src/orm/model/concerns/index.d.ts +0 -12
  67. package/dist/atlas/src/orm/model/decorators.d.ts +0 -138
  68. package/dist/atlas/src/orm/model/errors.d.ts +0 -52
  69. package/dist/atlas/src/orm/model/index.d.ts +0 -10
  70. package/dist/atlas/src/orm/model/relationships.d.ts +0 -207
  71. package/dist/atlas/src/orm/model/types.d.ts +0 -12
  72. package/dist/atlas/src/orm/schema/SchemaRegistry.d.ts +0 -124
  73. package/dist/atlas/src/orm/schema/SchemaSniffer.d.ts +0 -54
  74. package/dist/atlas/src/orm/schema/index.d.ts +0 -6
  75. package/dist/atlas/src/orm/schema/types.d.ts +0 -85
  76. package/dist/atlas/src/pool/AdaptivePoolManager.d.ts +0 -98
  77. package/dist/atlas/src/pool/PoolHealthChecker.d.ts +0 -91
  78. package/dist/atlas/src/pool/PoolStrategy.d.ts +0 -129
  79. package/dist/atlas/src/pool/PoolWarmer.d.ts +0 -92
  80. package/dist/atlas/src/query/Expression.d.ts +0 -60
  81. package/dist/atlas/src/query/NPlusOneDetector.d.ts +0 -10
  82. package/dist/atlas/src/query/QueryBuilder.d.ts +0 -643
  83. package/dist/atlas/src/query/RelationshipResolver.d.ts +0 -23
  84. package/dist/atlas/src/query/clauses/GroupByClause.d.ts +0 -51
  85. package/dist/atlas/src/query/clauses/HavingClause.d.ts +0 -70
  86. package/dist/atlas/src/query/clauses/JoinClause.d.ts +0 -87
  87. package/dist/atlas/src/query/clauses/LimitClause.d.ts +0 -82
  88. package/dist/atlas/src/query/clauses/OrderByClause.d.ts +0 -69
  89. package/dist/atlas/src/query/clauses/SelectClause.d.ts +0 -71
  90. package/dist/atlas/src/query/clauses/WhereClause.d.ts +0 -167
  91. package/dist/atlas/src/query/clauses/index.d.ts +0 -11
  92. package/dist/atlas/src/schema/Blueprint.d.ts +0 -276
  93. package/dist/atlas/src/schema/ColumnDefinition.d.ts +0 -154
  94. package/dist/atlas/src/schema/ForeignKeyDefinition.d.ts +0 -37
  95. package/dist/atlas/src/schema/MigrationGenerator.d.ts +0 -45
  96. package/dist/atlas/src/schema/Schema.d.ts +0 -131
  97. package/dist/atlas/src/schema/SchemaDiff.d.ts +0 -73
  98. package/dist/atlas/src/schema/TypeGenerator.d.ts +0 -57
  99. package/dist/atlas/src/schema/TypeWriter.d.ts +0 -42
  100. package/dist/atlas/src/schema/grammars/MySQLSchemaGrammar.d.ts +0 -23
  101. package/dist/atlas/src/schema/grammars/PostgresSchemaGrammar.d.ts +0 -26
  102. package/dist/atlas/src/schema/grammars/SQLiteSchemaGrammar.d.ts +0 -28
  103. package/dist/atlas/src/schema/grammars/SchemaGrammar.d.ts +0 -97
  104. package/dist/atlas/src/schema/grammars/index.d.ts +0 -7
  105. package/dist/atlas/src/schema/index.d.ts +0 -8
  106. package/dist/atlas/src/seed/Factory.d.ts +0 -90
  107. package/dist/atlas/src/seed/Seeder.d.ts +0 -28
  108. package/dist/atlas/src/seed/SeederRunner.d.ts +0 -74
  109. package/dist/atlas/src/seed/index.d.ts +0 -6
  110. package/dist/atlas/src/sharding/ShardingManager.d.ts +0 -59
  111. package/dist/atlas/src/types/index.d.ts +0 -1182
  112. package/dist/atlas/src/utils/CursorEncoding.d.ts +0 -63
  113. package/dist/atlas/src/utils/levenshtein.d.ts +0 -9
  114. package/dist/core/src/Application.d.ts +0 -215
  115. package/dist/core/src/CommandKernel.d.ts +0 -33
  116. package/dist/core/src/ConfigManager.d.ts +0 -65
  117. package/dist/core/src/Container/RequestScopeManager.d.ts +0 -62
  118. package/dist/core/src/Container/RequestScopeMetrics.d.ts +0 -144
  119. package/dist/core/src/Container.d.ts +0 -153
  120. package/dist/core/src/ErrorHandler.d.ts +0 -66
  121. package/dist/core/src/Event.d.ts +0 -5
  122. package/dist/core/src/EventManager.d.ts +0 -123
  123. package/dist/core/src/GlobalErrorHandlers.d.ts +0 -47
  124. package/dist/core/src/GravitoServer.d.ts +0 -28
  125. package/dist/core/src/HookManager.d.ts +0 -591
  126. package/dist/core/src/Listener.d.ts +0 -4
  127. package/dist/core/src/Logger.d.ts +0 -20
  128. package/dist/core/src/PlanetCore.d.ts +0 -378
  129. package/dist/core/src/RequestContext.d.ts +0 -97
  130. package/dist/core/src/Route.d.ts +0 -36
  131. package/dist/core/src/Router.d.ts +0 -284
  132. package/dist/core/src/ServiceProvider.d.ts +0 -178
  133. package/dist/core/src/adapters/GravitoEngineAdapter.d.ts +0 -27
  134. package/dist/core/src/adapters/PhotonAdapter.d.ts +0 -175
  135. package/dist/core/src/adapters/bun/BunContext.d.ts +0 -49
  136. package/dist/core/src/adapters/bun/BunNativeAdapter.d.ts +0 -31
  137. package/dist/core/src/adapters/bun/BunRequest.d.ts +0 -31
  138. package/dist/core/src/adapters/bun/RadixNode.d.ts +0 -19
  139. package/dist/core/src/adapters/bun/RadixRouter.d.ts +0 -31
  140. package/dist/core/src/adapters/bun/types.d.ts +0 -20
  141. package/dist/core/src/adapters/photon-types.d.ts +0 -73
  142. package/dist/core/src/adapters/types.d.ts +0 -235
  143. package/dist/core/src/cli/queue-commands.d.ts +0 -6
  144. package/dist/core/src/engine/AOTRouter.d.ts +0 -129
  145. package/dist/core/src/engine/FastContext.d.ts +0 -123
  146. package/dist/core/src/engine/Gravito.d.ts +0 -136
  147. package/dist/core/src/engine/MinimalContext.d.ts +0 -100
  148. package/dist/core/src/engine/analyzer.d.ts +0 -27
  149. package/dist/core/src/engine/constants.d.ts +0 -23
  150. package/dist/core/src/engine/index.d.ts +0 -26
  151. package/dist/core/src/engine/path.d.ts +0 -26
  152. package/dist/core/src/engine/pool.d.ts +0 -83
  153. package/dist/core/src/engine/types.d.ts +0 -146
  154. package/dist/core/src/error-handling/RequestScopeErrorContext.d.ts +0 -126
  155. package/dist/core/src/events/BackpressureManager.d.ts +0 -215
  156. package/dist/core/src/events/CircuitBreaker.d.ts +0 -229
  157. package/dist/core/src/events/DeadLetterQueue.d.ts +0 -219
  158. package/dist/core/src/events/EventBackend.d.ts +0 -12
  159. package/dist/core/src/events/EventOptions.d.ts +0 -204
  160. package/dist/core/src/events/EventPriorityQueue.d.ts +0 -301
  161. package/dist/core/src/events/FlowControlStrategy.d.ts +0 -109
  162. package/dist/core/src/events/IdempotencyCache.d.ts +0 -60
  163. package/dist/core/src/events/MessageQueueBridge.d.ts +0 -184
  164. package/dist/core/src/events/PriorityEscalationManager.d.ts +0 -82
  165. package/dist/core/src/events/RetryScheduler.d.ts +0 -104
  166. package/dist/core/src/events/WorkerPool.d.ts +0 -98
  167. package/dist/core/src/events/WorkerPoolConfig.d.ts +0 -153
  168. package/dist/core/src/events/WorkerPoolMetrics.d.ts +0 -65
  169. package/dist/core/src/events/aggregation/AggregationWindow.d.ts +0 -77
  170. package/dist/core/src/events/aggregation/DeduplicationManager.d.ts +0 -135
  171. package/dist/core/src/events/aggregation/EventAggregationManager.d.ts +0 -108
  172. package/dist/core/src/events/aggregation/EventBatcher.d.ts +0 -99
  173. package/dist/core/src/events/aggregation/types.d.ts +0 -117
  174. package/dist/core/src/events/index.d.ts +0 -25
  175. package/dist/core/src/events/observability/EventMetrics.d.ts +0 -132
  176. package/dist/core/src/events/observability/EventTracer.d.ts +0 -68
  177. package/dist/core/src/events/observability/EventTracing.d.ts +0 -161
  178. package/dist/core/src/events/observability/OTelEventMetrics.d.ts +0 -332
  179. package/dist/core/src/events/observability/ObservableHookManager.d.ts +0 -108
  180. package/dist/core/src/events/observability/StreamWorkerMetrics.d.ts +0 -76
  181. package/dist/core/src/events/observability/index.d.ts +0 -24
  182. package/dist/core/src/events/observability/metrics-types.d.ts +0 -16
  183. package/dist/core/src/events/types.d.ts +0 -134
  184. package/dist/core/src/exceptions/AuthenticationException.d.ts +0 -8
  185. package/dist/core/src/exceptions/AuthorizationException.d.ts +0 -8
  186. package/dist/core/src/exceptions/CircularDependencyException.d.ts +0 -9
  187. package/dist/core/src/exceptions/GravitoException.d.ts +0 -23
  188. package/dist/core/src/exceptions/HttpException.d.ts +0 -9
  189. package/dist/core/src/exceptions/ModelNotFoundException.d.ts +0 -10
  190. package/dist/core/src/exceptions/ValidationException.d.ts +0 -22
  191. package/dist/core/src/exceptions/index.d.ts +0 -7
  192. package/dist/core/src/health/HealthProvider.d.ts +0 -67
  193. package/dist/core/src/helpers/Arr.d.ts +0 -19
  194. package/dist/core/src/helpers/Str.d.ts +0 -23
  195. package/dist/core/src/helpers/data.d.ts +0 -25
  196. package/dist/core/src/helpers/errors.d.ts +0 -34
  197. package/dist/core/src/helpers/response.d.ts +0 -41
  198. package/dist/core/src/helpers.d.ts +0 -338
  199. package/dist/core/src/http/CookieJar.d.ts +0 -51
  200. package/dist/core/src/http/cookie.d.ts +0 -29
  201. package/dist/core/src/http/middleware/BodySizeLimit.d.ts +0 -16
  202. package/dist/core/src/http/middleware/Cors.d.ts +0 -24
  203. package/dist/core/src/http/middleware/Csrf.d.ts +0 -23
  204. package/dist/core/src/http/middleware/HeaderTokenGate.d.ts +0 -28
  205. package/dist/core/src/http/middleware/SecurityHeaders.d.ts +0 -29
  206. package/dist/core/src/http/middleware/ThrottleRequests.d.ts +0 -18
  207. package/dist/core/src/http/types.d.ts +0 -374
  208. package/dist/core/src/index.d.ts +0 -88
  209. package/dist/core/src/instrumentation/index.d.ts +0 -35
  210. package/dist/core/src/instrumentation/opentelemetry.d.ts +0 -178
  211. package/dist/core/src/instrumentation/types.d.ts +0 -182
  212. package/dist/core/src/observability/Metrics.d.ts +0 -244
  213. package/dist/core/src/observability/QueueDashboard.d.ts +0 -136
  214. package/dist/core/src/reliability/DeadLetterQueueManager.d.ts +0 -350
  215. package/dist/core/src/reliability/RetryPolicy.d.ts +0 -217
  216. package/dist/core/src/reliability/index.d.ts +0 -6
  217. package/dist/core/src/router/ControllerDispatcher.d.ts +0 -12
  218. package/dist/core/src/router/RequestValidator.d.ts +0 -20
  219. package/dist/core/src/runtime.d.ts +0 -119
  220. package/dist/core/src/security/Encrypter.d.ts +0 -33
  221. package/dist/core/src/security/Hasher.d.ts +0 -29
  222. package/dist/core/src/testing/HttpTester.d.ts +0 -39
  223. package/dist/core/src/testing/TestResponse.d.ts +0 -78
  224. package/dist/core/src/testing/index.d.ts +0 -2
  225. package/dist/core/src/types/events.d.ts +0 -94
  226. package/dist/echo/src/OrbitEcho.d.ts +0 -115
  227. package/dist/echo/src/index.d.ts +0 -64
  228. package/dist/echo/src/providers/GenericProvider.d.ts +0 -53
  229. package/dist/echo/src/providers/GitHubProvider.d.ts +0 -35
  230. package/dist/echo/src/providers/StripeProvider.d.ts +0 -38
  231. package/dist/echo/src/providers/index.d.ts +0 -14
  232. package/dist/echo/src/receive/SignatureValidator.d.ts +0 -67
  233. package/dist/echo/src/receive/WebhookReceiver.d.ts +0 -185
  234. package/dist/echo/src/receive/index.d.ts +0 -2
  235. package/dist/echo/src/resilience/CircuitBreaker.d.ts +0 -117
  236. package/dist/echo/src/send/WebhookDispatcher.d.ts +0 -198
  237. package/dist/echo/src/send/index.d.ts +0 -1
  238. package/dist/echo/src/types.d.ts +0 -756
  239. package/dist/index.d.ts.map +0 -1
  240. package/dist/monitor/src/MonitorOrbit.d.ts +0 -43
  241. package/dist/monitor/src/config.d.ts +0 -106
  242. package/dist/monitor/src/health/HealthController.d.ts +0 -28
  243. package/dist/monitor/src/health/HealthRegistry.d.ts +0 -80
  244. package/dist/monitor/src/health/index.d.ts +0 -36
  245. package/dist/monitor/src/index.d.ts +0 -13
  246. package/dist/monitor/src/metrics/MetricsController.d.ts +0 -22
  247. package/dist/monitor/src/metrics/MetricsRegistry.d.ts +0 -136
  248. package/dist/monitor/src/metrics/index.d.ts +0 -11
  249. package/dist/monitor/src/tracing/TracingManager.d.ts +0 -97
  250. package/dist/monitor/src/tracing/index.d.ts +0 -10
  251. package/dist/photon/src/index.d.ts +0 -89
  252. package/dist/photon/src/middleware/binary.d.ts +0 -31
  253. package/dist/photon/src/middleware/htmx.d.ts +0 -39
  254. package/dist/photon/src/middleware/ratelimit-redis.d.ts +0 -50
  255. package/dist/photon/src/middleware/ratelimit.d.ts +0 -161
  256. package/dist/photon/src/openapi.d.ts +0 -19
  257. package/dist/providers/GenericProvider.d.ts.map +0 -1
  258. package/dist/providers/GitHubProvider.d.ts.map +0 -1
  259. package/dist/providers/StripeProvider.d.ts.map +0 -1
  260. package/dist/providers/index.d.ts.map +0 -1
  261. package/dist/receive/SignatureValidator.d.ts.map +0 -1
  262. package/dist/receive/WebhookReceiver.d.ts.map +0 -1
  263. package/dist/receive/index.d.ts.map +0 -1
  264. package/dist/send/WebhookDispatcher.d.ts.map +0 -1
  265. package/dist/send/index.d.ts.map +0 -1
  266. package/dist/types.d.ts.map +0 -1
  267. /package/dist/{echo/src/dlq → dlq}/DeadLetterQueue.d.ts +0 -0
  268. /package/dist/{echo/src/dlq → dlq}/MemoryDeadLetterQueue.d.ts +0 -0
  269. /package/dist/{echo/src/dlq → dlq}/index.d.ts +0 -0
  270. /package/dist/{echo/src/middleware → middleware}/index.d.ts +0 -0
  271. /package/dist/{echo/src/observability → observability}/index.d.ts +0 -0
  272. /package/dist/{echo/src/observability → observability}/logging/ConsoleEchoLogger.d.ts +0 -0
  273. /package/dist/{echo/src/observability → observability}/logging/EchoLogger.d.ts +0 -0
  274. /package/dist/{echo/src/observability → observability}/logging/index.d.ts +0 -0
  275. /package/dist/{echo/src/observability → observability}/metrics/MetricsProvider.d.ts +0 -0
  276. /package/dist/{echo/src/observability → observability}/metrics/NoopMetricsProvider.d.ts +0 -0
  277. /package/dist/{echo/src/observability → observability}/metrics/PrometheusMetricsProvider.d.ts +0 -0
  278. /package/dist/{echo/src/observability → observability}/metrics/index.d.ts +0 -0
  279. /package/dist/{echo/src/observability → observability}/tracing/NoopTracer.d.ts +0 -0
  280. /package/dist/{echo/src/observability → observability}/tracing/Tracer.d.ts +0 -0
  281. /package/dist/{echo/src/observability → observability}/tracing/index.d.ts +0 -0
  282. /package/dist/{echo/src/providers → providers}/LinearProvider.d.ts +0 -0
  283. /package/dist/{echo/src/providers → providers}/PaddleProvider.d.ts +0 -0
  284. /package/dist/{echo/src/providers → providers}/ShopifyProvider.d.ts +0 -0
  285. /package/dist/{echo/src/providers → providers}/SlackProvider.d.ts +0 -0
  286. /package/dist/{echo/src/providers → providers}/TwilioProvider.d.ts +0 -0
  287. /package/dist/{echo/src/providers → providers}/base/BaseProvider.d.ts +0 -0
  288. /package/dist/{echo/src/providers → providers}/base/HeaderUtils.d.ts +0 -0
  289. /package/dist/{echo/src/replay → replay}/WebhookReplayService.d.ts +0 -0
  290. /package/dist/{echo/src/replay → replay}/index.d.ts +0 -0
  291. /package/dist/{echo/src/rotation → rotation}/KeyRotationManager.d.ts +0 -0
  292. /package/dist/{echo/src/rotation → rotation}/index.d.ts +0 -0
  293. /package/dist/{echo/src/storage → storage}/MemoryWebhookStore.d.ts +0 -0
  294. /package/dist/{echo/src/storage → storage}/WebhookStore.d.ts +0 -0
  295. /package/dist/{echo/src/storage → storage}/index.d.ts +0 -0
@@ -1,54 +0,0 @@
1
- /**
2
- * MySQL Grammar
3
- * @description SQL grammar implementation for MySQL/MariaDB
4
- */
5
- import type { CompiledQuery } from '../types';
6
- import { Grammar } from './Grammar';
7
- /**
8
- * MySQL Grammar
9
- * Implements MySQL/MariaDB-specific SQL syntax
10
- */
11
- export declare class MySQLGrammar extends Grammar {
12
- /**
13
- * MySQL uses backticks for identifiers
14
- */
15
- protected wrapChar: string;
16
- /**
17
- * Get placeholder for MySQL (?)
18
- */
19
- getPlaceholder(_index: number): string;
20
- /**
21
- * Compile INSERT and return ID using LAST_INSERT_ID()
22
- */
23
- compileInsertGetId(query: CompiledQuery, values: Record<string, unknown>, _primaryKey: string): string;
24
- /**
25
- * Compile TRUNCATE for MySQL
26
- */
27
- compileTruncate(query: CompiledQuery): string;
28
- /**
29
- * MySQL-specific: Compile UPSERT using ON DUPLICATE KEY UPDATE
30
- */
31
- compileUpsert(query: CompiledQuery, values: Record<string, unknown>[], _uniqueBy: string[], update: string[]): string;
32
- /**
33
- * MySQL-specific: Compile locking clause
34
- */
35
- compileLock(mode: 'update' | 'share'): string;
36
- /**
37
- * Override offset placeholders - MySQL uses ? for all
38
- */
39
- protected offsetPlaceholders(sql: string, _offset: number): string;
40
- /**
41
- * Compile EXISTS with MySQL syntax
42
- */
43
- compileExists(query: CompiledQuery): string;
44
- /**
45
- * Override aggregate to use backticks
46
- */
47
- compileAggregate(query: CompiledQuery, aggregate: {
48
- function: string;
49
- column: string;
50
- }): string;
51
- compileJsonPath(column: string, _value: unknown): string;
52
- compileJsonContains(column: string, _value: unknown): string;
53
- compileUpdateJson(query: CompiledQuery, column: string, _value: unknown): string;
54
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * Null Grammar
3
- * @description A fallback grammar for non-SQL drivers
4
- */
5
- import type { CompiledQuery, GrammarContract } from '../types';
6
- /**
7
- * Null Grammar
8
- * Used for MongoDB, Redis, etc. where SQL compilation is not needed.
9
- */
10
- export declare class NullGrammar implements GrammarContract {
11
- compileSelect(_query: CompiledQuery): string;
12
- compileInsert(_query: CompiledQuery, _values: Record<string, unknown>[]): string;
13
- compileInsertGetId(_query: CompiledQuery, _values: Record<string, unknown>, _primaryKey: string): string;
14
- compileUpdate(_query: CompiledQuery, _values: Record<string, unknown>): string;
15
- compileDelete(_query: CompiledQuery): string;
16
- compileTruncate(_query: CompiledQuery): string;
17
- compileAggregate(_query: CompiledQuery, _aggregate: {
18
- function: string;
19
- column: string;
20
- }): string;
21
- compileExists(_query: CompiledQuery): string;
22
- getPlaceholder(_index: number): string;
23
- wrapColumn(column: string): string;
24
- wrapTable(table: string): string;
25
- quoteValue(value: unknown): string;
26
- compileLateralEagerLoad(_table: string, _foreignKey: string, _parentKeys: unknown[], _query: CompiledQuery): {
27
- sql: string;
28
- bindings: unknown[];
29
- };
30
- getStructuralKey(_query: CompiledQuery): string;
31
- compileJsonPath(column: string, _value: unknown): string;
32
- compileJsonContains(column: string, _value: unknown): string;
33
- compileUpdateJson(_query: CompiledQuery, column: string, _value: unknown): string;
34
- compileUpsert(_query: CompiledQuery, _values: Record<string, unknown>[], _uniqueBy: string[], _update: string[]): string;
35
- }
@@ -1,62 +0,0 @@
1
- /**
2
- * PostgreSQL Grammar
3
- * @description SQL grammar implementation for PostgreSQL
4
- */
5
- import type { CompiledQuery } from '../types';
6
- import { Grammar } from './Grammar';
7
- /**
8
- * PostgreSQL Grammar
9
- * Implements PostgreSQL-specific SQL syntax
10
- */
11
- export declare class PostgresGrammar extends Grammar {
12
- /**
13
- * PostgreSQL uses double quotes for identifiers
14
- */
15
- protected wrapChar: string;
16
- /**
17
- * Get placeholder for PostgreSQL ($1, $2, $3...)
18
- */
19
- getPlaceholder(index: number): string;
20
- /**
21
- * Compile INSERT and return ID using RETURNING clause
22
- */
23
- compileInsertGetId(query: CompiledQuery, values: Record<string, unknown>, primaryKey: string): string;
24
- /**
25
- * Compile INSERT with RETURNING clause for PostgreSQL
26
- */
27
- compileInsert(query: CompiledQuery, values: Record<string, unknown>[]): string;
28
- /**
29
- * Compile UPDATE with RETURNING clause for PostgreSQL
30
- */
31
- compileUpdate(query: CompiledQuery, values: Record<string, unknown>): string;
32
- /**
33
- * Compile TRUNCATE with CASCADE option for PostgreSQL
34
- */
35
- compileTruncate(query: CompiledQuery): string;
36
- /**
37
- * PostgreSQL-specific: Compile UPSERT using ON CONFLICT
38
- */
39
- compileUpsert(query: CompiledQuery, values: Record<string, unknown>[], uniqueBy: string[], update: string[]): string;
40
- /**
41
- * PostgreSQL-specific: Compile locking clause
42
- */
43
- compileLock(mode: 'update' | 'share'): string;
44
- /**
45
- * Override offset placeholders for PostgreSQL
46
- */
47
- protected offsetPlaceholders(sql: string, offset: number): string;
48
- /**
49
- * Compile a lateral eager load query for PostgreSQL
50
- */
51
- compileLateralEagerLoad(_table: string, foreignKey: string, parentKeys: unknown[], query: CompiledQuery): {
52
- sql: string;
53
- bindings: unknown[];
54
- };
55
- /**
56
- * Guess the PostgreSQL type for an array of values
57
- */
58
- protected guessType(values: unknown[]): string;
59
- compileJsonPath(column: string, path: string[]): string;
60
- compileJsonContains(column: string, _value: unknown): string;
61
- compileUpdateJson(query: CompiledQuery, column: string, _value: unknown): string;
62
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * SQLite Grammar
3
- * @description SQL grammar implementation for SQLite
4
- */
5
- import type { CompiledQuery } from '../types';
6
- import { Grammar } from './Grammar';
7
- /**
8
- * SQLite Grammar
9
- * Implements SQLite-specific SQL syntax
10
- */
11
- export declare class SQLiteGrammar extends Grammar {
12
- /**
13
- * SQLite uses double quotes for identifiers
14
- */
15
- protected wrapChar: string;
16
- /**
17
- * Get placeholder for SQLite (?)
18
- */
19
- getPlaceholder(_index: number): string;
20
- /**
21
- * Compile INSERT statement with RETURNING *
22
- */
23
- compileInsert(query: CompiledQuery, values: Record<string, unknown>[]): string;
24
- compileInsertGetId(query: CompiledQuery, values: Record<string, unknown>, primaryKey: string): string;
25
- /**
26
- * Compile TRUNCATE statement
27
- * SQLite doesn't have TRUNCATE, use DELETE FROM
28
- */
29
- compileTruncate(query: CompiledQuery): string;
30
- compileJsonPath(column: string, _value: unknown): string;
31
- compileJsonContains(_column: string, _value: unknown): string;
32
- }
@@ -1,79 +0,0 @@
1
- /**
2
- * @gravito/atlas
3
- * @description The Standard Database Orbit - Custom Query Builder & ORM for Gravito
4
- *
5
- * @example
6
- * ```typescript
7
- * import { DB } from '@gravito/atlas'
8
- *
9
- * // Configure
10
- * DB.addConnection('default', {
11
- * driver: 'postgres',
12
- * host: 'localhost',
13
- * port: 5432,
14
- * database: 'myapp',
15
- * username: 'postgres',
16
- * password: 'secret'
17
- * })
18
- *
19
- * // Query
20
- * const users = await DB.table('users')
21
- * .where('status', 'active')
22
- * .orderBy('created_at', 'desc')
23
- * .limit(10)
24
- * .get()
25
- *
26
- * // Insert
27
- * const newUser = await DB.table('users').insert({
28
- * name: 'John Doe',
29
- * email: 'john@example.com'
30
- * })
31
- *
32
- * // Update
33
- * await DB.table('users')
34
- * .where('id', 1)
35
- * .update({ name: 'Jane Doe' })
36
- *
37
- * // Transaction
38
- * await DB.transaction(async (db) => {
39
- * await db.table('accounts').where('id', 1).decrement('balance', 100)
40
- * await db.table('accounts').where('id', 2).increment('balance', 100)
41
- * })
42
- * ```
43
- */
44
- export type { AtlasConfig } from './config';
45
- export { defineConfig, fromEnv, loadConfig, loadConfigFile } from './config';
46
- export { Connection } from './connection/Connection';
47
- export { ConnectionManager } from './connection/ConnectionManager';
48
- export { ReplicaConnectionPool } from './connection/ReplicaConnectionPool';
49
- export { DB } from './DB';
50
- import { DB } from './DB';
51
- export declare const autoConfigure: typeof DB.autoConfigure;
52
- export { BunSQLDriver } from './drivers/BunSQLDriver';
53
- export { PostgresDriver } from './drivers/PostgresDriver';
54
- export { SQLiteDriver } from './drivers/SQLiteDriver';
55
- export { ConnectionError, ConstraintViolationError, DatabaseError, ForeignKeyConstraintError, NotNullConstraintError, TableNotFoundError, UniqueConstraintError, } from './errors';
56
- export { Grammar } from './grammar/Grammar';
57
- export { PostgresGrammar } from './grammar/PostgresGrammar';
58
- export type { Migration, MigrationFile, MigrationRecord, MigrationResult, MigratorOptions, } from './migration';
59
- export { MigrationRepository, Migrator } from './migration';
60
- export { OrbitAtlas } from './OrbitAtlas';
61
- export type { ColumnSchema as OrmColumnSchema, ModelAttributes, ModelConstructor, ModelStatic, RelationshipMeta, RelationType, SchemaLock, SchemaMode, SchemaRegistryOptions, TableSchema, } from './orm';
62
- export { BelongsTo, BelongsToMany, ColumnNotFoundError, column, DirtyTracker, eagerLoad, eagerLoadMany, getRelationships, HasMany, HasOne, Model, ModelNotFoundError, ModelRegistry, ModelRepository, MorphMany, MorphOne, MorphTo, NullableConstraintError, SchemaRegistry, SchemaSniffer, SoftDeletes, TypeMismatchError, version, } from './orm';
63
- export { Expression, raw } from './query/Expression';
64
- export { QueryBuilder, QueryBuilderError, RecordNotFoundError } from './query/QueryBuilder';
65
- export type { ColumnType, ForeignKeyAction, ForeignKeyDefinition, IndexDefinition } from './schema';
66
- export { Blueprint, ColumnDefinition, Schema } from './schema';
67
- export { MySQLSchemaGrammar, PostgresSchemaGrammar, SchemaGrammar, SQLiteSchemaGrammar, } from './schema/grammars';
68
- export { MigrationGenerator } from './schema/MigrationGenerator';
69
- export type { ColumnDefinition as SchemaColumnDefinition, SchemaDiffResult, } from './schema/SchemaDiff';
70
- export { SchemaDiff } from './schema/SchemaDiff';
71
- export type { ModelTypeMap, TypeGeneratorOptions } from './schema/TypeGenerator';
72
- export { TypeGenerator } from './schema/TypeGenerator';
73
- export { TypeWriter } from './schema/TypeWriter';
74
- export type { FactoryDefinition, Seeder, SeederFile, SeederRunnerOptions } from './seed';
75
- export { Factory, factory, SeederRunner } from './seed';
76
- export { type ShardingConfig, ShardingManager } from './sharding/ShardingManager';
77
- export type { AtlasConnectionEntry, BooleanOperator, CompiledQuery, ConnectionConfig, ConnectionContract, CursorPaginateResult, DriverContract, DriverType, ExecuteResult, FieldInfo, GrammarContract, HavingClause, isReadWriteConfig, JoinClause, JoinType, MySQLConfig, Operator, OrderClause, OrderDirection, PaginateResult, PoolConfig, PostgresConfig, QueryBuilderContract, QueryResult, ReadWriteConnectionConfig, SQLiteConfig, SSLConfig, WhereClause, } from './types';
78
- export type { CursorPayload } from './utils/CursorEncoding';
79
- export { buildCursorWhereClause, decodeCursor, encodeCursor, } from './utils/CursorEncoding';
@@ -1,64 +0,0 @@
1
- /**
2
- * Migration Interface
3
- * @description Contract for database migration classes
4
- */
5
- /**
6
- * Migration Interface
7
- *
8
- * All database migration classes must implement this interface.
9
- * The `up` method is used to apply changes (e.g., create tables),
10
- * while the `down` method is used to reverse those changes.
11
- *
12
- * @example
13
- * ```typescript
14
- * import { Migration, Schema } from '@gravito/atlas'
15
- *
16
- * export default class CreateUsersTable implements Migration {
17
- * async up(): Promise<void> {
18
- * await Schema.create('users', (table) => {
19
- * table.id()
20
- * table.string('email').unique()
21
- * table.timestamps()
22
- * })
23
- * }
24
- *
25
- * async down(): Promise<void> {
26
- * await Schema.dropIfExists('users')
27
- * }
28
- * }
29
- * ```
30
- */
31
- export interface Migration {
32
- /**
33
- * Run the migration (create tables, add columns, etc.)
34
- */
35
- up(): Promise<void>;
36
- /**
37
- * Reverse the migration (drop tables, remove columns, etc.)
38
- */
39
- down(): Promise<void>;
40
- }
41
- /**
42
- * Migration constructor type
43
- */
44
- export type MigrationConstructor = new () => Migration;
45
- /**
46
- * Migration record stored in the database
47
- */
48
- export interface MigrationRecord {
49
- /** Migration ID */
50
- id: number;
51
- /** Migration file name (without path) */
52
- migration: string;
53
- /** Batch number when the migration was run */
54
- batch: number;
55
- }
56
- /**
57
- * Migration file info
58
- */
59
- export interface MigrationFile {
60
- /** Migration file name (without path) */
61
- name: string;
62
- /** Full file path */
63
- path: string;
64
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * Migration Repository
3
- * @description Tracks migration execution state in the database
4
- */
5
- import type { MigrationRecord } from './Migration';
6
- /**
7
- * Migration Repository
8
- *
9
- * The MigrationRepository class manages the database table that tracks
10
- * which migrations have been executed. It provides methods for logging
11
- * migrations, retrieving the list of ran migrations, and managing batches.
12
- */
13
- export declare class MigrationRepository {
14
- private tableName;
15
- private connectionName;
16
- constructor(connectionName?: string);
17
- /**
18
- * Set the table name for migrations
19
- */
20
- setTable(table: string): this;
21
- /**
22
- * Create the migration repository table if it doesn't exist
23
- */
24
- createRepository(): Promise<void>;
25
- /**
26
- * Check if the migration repository exists
27
- */
28
- repositoryExists(): Promise<boolean>;
29
- /**
30
- * Delete the migration repository table
31
- */
32
- deleteRepository(): Promise<void>;
33
- /**
34
- * Get all ran migrations
35
- */
36
- getRan(): Promise<string[]>;
37
- /**
38
- * Get migrations for a specific batch
39
- */
40
- getMigrations(batch: number): Promise<MigrationRecord[]>;
41
- /**
42
- * Get the last batch number
43
- */
44
- getLastBatchNumber(): Promise<number>;
45
- /**
46
- * Get the next batch number
47
- */
48
- getNextBatchNumber(): Promise<number>;
49
- /**
50
- * Log that a migration was run
51
- */
52
- log(migration: string, batch: number): Promise<void>;
53
- /**
54
- * Remove a migration from the log
55
- */
56
- delete(migration: string): Promise<void>;
57
- /**
58
- * Get the last migrations (for rollback)
59
- */
60
- getLast(): Promise<MigrationRecord[]>;
61
- /**
62
- * Get the database connection
63
- */
64
- private getConnection;
65
- }
@@ -1,110 +0,0 @@
1
- /**
2
- * Migrator
3
- * @description Migration runner with support for running and rolling back migrations
4
- */
5
- /**
6
- * Migrator Options
7
- */
8
- export interface MigratorOptions {
9
- /** Path to migrations directory */
10
- path?: string;
11
- /** Database connection name */
12
- connection?: string;
13
- /** Migration table name */
14
- table?: string;
15
- }
16
- /**
17
- * Migration Result
18
- */
19
- export interface MigrationResult {
20
- /** Migrations that were run */
21
- migrations: string[];
22
- /** Batch number */
23
- batch?: number;
24
- }
25
- /**
26
- * Migrator
27
- *
28
- * The Migrator class is responsible for managing the database migration lifecycle.
29
- * It handles discovering migration files, tracking which migrations have been run
30
- * in the database, and executing the `up` or `down` methods of migration classes.
31
- *
32
- * @example
33
- * ```typescript
34
- * const migrator = new Migrator({ path: './migrations' })
35
- *
36
- * // Run all pending migrations
37
- * await migrator.run()
38
- *
39
- * // Rollback the last batch of migrations
40
- * await migrator.rollback()
41
- * ```
42
- */
43
- export declare class Migrator {
44
- private repository;
45
- private migrationsPath;
46
- private resolvedMigrations;
47
- constructor(options?: MigratorOptions);
48
- /**
49
- * Set migrations path
50
- */
51
- setPath(path: string): this;
52
- /**
53
- * Set database connection
54
- */
55
- connection(name: string): this;
56
- /**
57
- * Run all pending migrations.
58
- *
59
- * This method will identify all migration files that have not yet been
60
- * recorded in the migrations table and execute their `up` method.
61
- *
62
- * @returns A promise that resolves to the migration result.
63
- */
64
- run(): Promise<MigrationResult>;
65
- /**
66
- * Run a specific migration up
67
- */
68
- runUp(migrationName: string): Promise<void>;
69
- /**
70
- * Rollback the last batch of migrations.
71
- *
72
- * This method will identify the migrations that were part of the last
73
- * execution batch and execute their `down` method.
74
- *
75
- * @param steps The number of batches to rollback (defaults to 1).
76
- * @returns A promise that resolves to the migration result.
77
- */
78
- rollback(steps?: number): Promise<MigrationResult>;
79
- /**
80
- * Rollback all migrations
81
- */
82
- reset(): Promise<MigrationResult>;
83
- /**
84
- * Reset and re-run all migrations
85
- */
86
- fresh(): Promise<MigrationResult>;
87
- /**
88
- * Rollback and re-run the last batch
89
- */
90
- refresh(steps?: number): Promise<MigrationResult>;
91
- /**
92
- * Get migration status
93
- */
94
- status(): Promise<{
95
- ran: string[];
96
- pending: string[];
97
- }>;
98
- /**
99
- * Get all migration files from the migrations directory
100
- */
101
- private getMigrationFiles;
102
- /**
103
- * Run a single migration
104
- */
105
- private runMigration;
106
- /**
107
- * Resolve migration class from file
108
- */
109
- private resolveMigration;
110
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Migration Module Index
3
- */
4
- export type { Migration, MigrationConstructor, MigrationFile, MigrationRecord } from './Migration';
5
- export { MigrationRepository } from './MigrationRepository';
6
- export { type MigrationResult, Migrator, type MigratorOptions } from './Migrator';
@@ -1,33 +0,0 @@
1
- import { type Counter, type Histogram } from '@opentelemetry/api';
2
- export interface AtlasMetricsConfig {
3
- enabled: boolean;
4
- }
5
- export declare class AtlasMetrics {
6
- private meter;
7
- private config;
8
- private poolCallbacks;
9
- readonly operationDuration?: Histogram;
10
- readonly operationErrors?: Counter;
11
- readonly poolSize?: any;
12
- readonly poolUtilization?: any;
13
- readonly poolWaitTime?: Histogram;
14
- readonly poolAcquisitionErrors?: Counter;
15
- constructor(config: AtlasMetricsConfig);
16
- /**
17
- * Register pool statistics callback for ObservableGauge
18
- */
19
- registerPoolStatsCallback(connectionName: string, getStats: () => {
20
- idle: number;
21
- active: number;
22
- pending: number;
23
- max: number;
24
- } | null): void;
25
- /**
26
- * Record connection wait time
27
- */
28
- recordConnectionWaitTime(connectionName: string, duration: number): void;
29
- /**
30
- * Record connection acquisition error
31
- */
32
- recordConnectionAcquisitionError(connectionName: string, error: string): void;
33
- }
@@ -1,15 +0,0 @@
1
- import { AtlasMetrics, type AtlasMetricsConfig } from './AtlasMetrics';
2
- import { AtlasTracer, type AtlasTracingConfig } from './AtlasTracer';
3
- export declare class AtlasObservability {
4
- private static instance;
5
- tracer?: AtlasTracer;
6
- metrics?: AtlasMetrics;
7
- private constructor();
8
- static getInstance(): AtlasObservability;
9
- initialize(config: {
10
- tracing?: AtlasTracingConfig;
11
- metrics?: AtlasMetricsConfig;
12
- }): void;
13
- static getTracer(): AtlasTracer | undefined;
14
- static getMetrics(): AtlasMetrics | undefined;
15
- }
@@ -1,12 +0,0 @@
1
- import { type Context, type Span } from '@opentelemetry/api';
2
- export interface AtlasTracingConfig {
3
- enabled: boolean;
4
- serviceName?: string;
5
- }
6
- export declare class AtlasTracer {
7
- private tracer;
8
- private config;
9
- constructor(config: AtlasTracingConfig);
10
- startSpan(name: string, attributes?: Record<string, any>): Span | undefined;
11
- getActiveContext(): Context;
12
- }
@@ -1,9 +0,0 @@
1
- export * from './AtlasMetrics';
2
- export * from './AtlasObservability';
3
- export * from './AtlasTracer';
4
- export interface AtlasObservabilityConfig {
5
- enabled: boolean;
6
- tracing?: boolean;
7
- metrics?: boolean;
8
- serviceName?: string;
9
- }