@gravito/echo 3.1.0 → 3.1.2

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 (245) hide show
  1. package/README.md +24 -9
  2. package/dist/OrbitEcho.d.ts +76 -60
  3. package/dist/index.d.ts +31 -16
  4. package/dist/index.js +1 -1596
  5. package/dist/index.js.map +3 -28
  6. package/dist/{echo/src/middleware → middleware}/RequestBufferMiddleware.d.ts +3 -3
  7. package/dist/providers/GenericProvider.d.ts +37 -19
  8. package/dist/providers/GitHubProvider.d.ts +21 -13
  9. package/dist/providers/StripeProvider.d.ts +20 -13
  10. package/dist/providers/index.d.ts +14 -4
  11. package/dist/receive/SignatureValidator.d.ts +33 -1
  12. package/dist/receive/WebhookReceiver.d.ts +139 -22
  13. package/dist/receive/index.d.ts +0 -1
  14. package/dist/send/WebhookDispatcher.d.ts +159 -16
  15. package/dist/send/index.d.ts +0 -1
  16. package/dist/types.d.ts +669 -57
  17. package/package.json +5 -2
  18. package/dist/OrbitEcho.d.ts.map +0 -1
  19. package/dist/atlas/src/DB.d.ts +0 -301
  20. package/dist/atlas/src/OrbitAtlas.d.ts +0 -9
  21. package/dist/atlas/src/config/defineConfig.d.ts +0 -14
  22. package/dist/atlas/src/config/index.d.ts +0 -7
  23. package/dist/atlas/src/config/loadConfig.d.ts +0 -48
  24. package/dist/atlas/src/connection/Connection.d.ts +0 -108
  25. package/dist/atlas/src/connection/ConnectionManager.d.ts +0 -111
  26. package/dist/atlas/src/drivers/BunSQLDriver.d.ts +0 -32
  27. package/dist/atlas/src/drivers/BunSQLPreparedStatement.d.ts +0 -118
  28. package/dist/atlas/src/drivers/MongoDBDriver.d.ts +0 -36
  29. package/dist/atlas/src/drivers/MySQLDriver.d.ts +0 -66
  30. package/dist/atlas/src/drivers/PostgresDriver.d.ts +0 -83
  31. package/dist/atlas/src/drivers/RedisDriver.d.ts +0 -43
  32. package/dist/atlas/src/drivers/SQLiteDriver.d.ts +0 -45
  33. package/dist/atlas/src/drivers/types.d.ts +0 -260
  34. package/dist/atlas/src/errors/index.d.ts +0 -45
  35. package/dist/atlas/src/grammar/Grammar.d.ts +0 -342
  36. package/dist/atlas/src/grammar/MongoGrammar.d.ts +0 -47
  37. package/dist/atlas/src/grammar/MySQLGrammar.d.ts +0 -54
  38. package/dist/atlas/src/grammar/NullGrammar.d.ts +0 -35
  39. package/dist/atlas/src/grammar/PostgresGrammar.d.ts +0 -62
  40. package/dist/atlas/src/grammar/SQLiteGrammar.d.ts +0 -32
  41. package/dist/atlas/src/index.d.ts +0 -67
  42. package/dist/atlas/src/migration/Migration.d.ts +0 -64
  43. package/dist/atlas/src/migration/MigrationRepository.d.ts +0 -65
  44. package/dist/atlas/src/migration/Migrator.d.ts +0 -110
  45. package/dist/atlas/src/migration/index.d.ts +0 -6
  46. package/dist/atlas/src/observability/AtlasMetrics.d.ts +0 -11
  47. package/dist/atlas/src/observability/AtlasObservability.d.ts +0 -15
  48. package/dist/atlas/src/observability/AtlasTracer.d.ts +0 -12
  49. package/dist/atlas/src/observability/index.d.ts +0 -9
  50. package/dist/atlas/src/orm/index.d.ts +0 -5
  51. package/dist/atlas/src/orm/model/DirtyTracker.d.ts +0 -121
  52. package/dist/atlas/src/orm/model/Model.d.ts +0 -449
  53. package/dist/atlas/src/orm/model/ModelRegistry.d.ts +0 -20
  54. package/dist/atlas/src/orm/model/concerns/HasAttributes.d.ts +0 -136
  55. package/dist/atlas/src/orm/model/concerns/HasEvents.d.ts +0 -36
  56. package/dist/atlas/src/orm/model/concerns/HasPersistence.d.ts +0 -87
  57. package/dist/atlas/src/orm/model/concerns/HasRelationships.d.ts +0 -117
  58. package/dist/atlas/src/orm/model/concerns/HasSerialization.d.ts +0 -64
  59. package/dist/atlas/src/orm/model/concerns/applyMixins.d.ts +0 -15
  60. package/dist/atlas/src/orm/model/concerns/index.d.ts +0 -12
  61. package/dist/atlas/src/orm/model/decorators.d.ts +0 -109
  62. package/dist/atlas/src/orm/model/errors.d.ts +0 -52
  63. package/dist/atlas/src/orm/model/index.d.ts +0 -10
  64. package/dist/atlas/src/orm/model/relationships.d.ts +0 -207
  65. package/dist/atlas/src/orm/model/types.d.ts +0 -12
  66. package/dist/atlas/src/orm/schema/SchemaRegistry.d.ts +0 -123
  67. package/dist/atlas/src/orm/schema/SchemaSniffer.d.ts +0 -54
  68. package/dist/atlas/src/orm/schema/index.d.ts +0 -6
  69. package/dist/atlas/src/orm/schema/types.d.ts +0 -85
  70. package/dist/atlas/src/query/Expression.d.ts +0 -60
  71. package/dist/atlas/src/query/NPlusOneDetector.d.ts +0 -10
  72. package/dist/atlas/src/query/QueryBuilder.d.ts +0 -573
  73. package/dist/atlas/src/query/clauses/GroupByClause.d.ts +0 -51
  74. package/dist/atlas/src/query/clauses/HavingClause.d.ts +0 -70
  75. package/dist/atlas/src/query/clauses/JoinClause.d.ts +0 -87
  76. package/dist/atlas/src/query/clauses/LimitClause.d.ts +0 -82
  77. package/dist/atlas/src/query/clauses/OrderByClause.d.ts +0 -69
  78. package/dist/atlas/src/query/clauses/SelectClause.d.ts +0 -71
  79. package/dist/atlas/src/query/clauses/WhereClause.d.ts +0 -167
  80. package/dist/atlas/src/query/clauses/index.d.ts +0 -11
  81. package/dist/atlas/src/schema/Blueprint.d.ts +0 -276
  82. package/dist/atlas/src/schema/ColumnDefinition.d.ts +0 -154
  83. package/dist/atlas/src/schema/ForeignKeyDefinition.d.ts +0 -37
  84. package/dist/atlas/src/schema/Schema.d.ts +0 -131
  85. package/dist/atlas/src/schema/grammars/MySQLSchemaGrammar.d.ts +0 -23
  86. package/dist/atlas/src/schema/grammars/PostgresSchemaGrammar.d.ts +0 -26
  87. package/dist/atlas/src/schema/grammars/SQLiteSchemaGrammar.d.ts +0 -28
  88. package/dist/atlas/src/schema/grammars/SchemaGrammar.d.ts +0 -97
  89. package/dist/atlas/src/schema/grammars/index.d.ts +0 -7
  90. package/dist/atlas/src/schema/index.d.ts +0 -8
  91. package/dist/atlas/src/seed/Factory.d.ts +0 -90
  92. package/dist/atlas/src/seed/Seeder.d.ts +0 -28
  93. package/dist/atlas/src/seed/SeederRunner.d.ts +0 -74
  94. package/dist/atlas/src/seed/index.d.ts +0 -6
  95. package/dist/atlas/src/types/index.d.ts +0 -1100
  96. package/dist/atlas/src/utils/levenshtein.d.ts +0 -9
  97. package/dist/core/src/Application.d.ts +0 -215
  98. package/dist/core/src/CommandKernel.d.ts +0 -33
  99. package/dist/core/src/ConfigManager.d.ts +0 -26
  100. package/dist/core/src/Container.d.ts +0 -108
  101. package/dist/core/src/ErrorHandler.d.ts +0 -63
  102. package/dist/core/src/Event.d.ts +0 -5
  103. package/dist/core/src/EventManager.d.ts +0 -123
  104. package/dist/core/src/GlobalErrorHandlers.d.ts +0 -47
  105. package/dist/core/src/GravitoServer.d.ts +0 -28
  106. package/dist/core/src/HookManager.d.ts +0 -496
  107. package/dist/core/src/Listener.d.ts +0 -4
  108. package/dist/core/src/Logger.d.ts +0 -20
  109. package/dist/core/src/PlanetCore.d.ts +0 -289
  110. package/dist/core/src/Route.d.ts +0 -36
  111. package/dist/core/src/Router.d.ts +0 -284
  112. package/dist/core/src/ServiceProvider.d.ts +0 -156
  113. package/dist/core/src/adapters/GravitoEngineAdapter.d.ts +0 -27
  114. package/dist/core/src/adapters/PhotonAdapter.d.ts +0 -171
  115. package/dist/core/src/adapters/bun/BunContext.d.ts +0 -45
  116. package/dist/core/src/adapters/bun/BunNativeAdapter.d.ts +0 -31
  117. package/dist/core/src/adapters/bun/BunRequest.d.ts +0 -31
  118. package/dist/core/src/adapters/bun/RadixNode.d.ts +0 -19
  119. package/dist/core/src/adapters/bun/RadixRouter.d.ts +0 -31
  120. package/dist/core/src/adapters/bun/types.d.ts +0 -20
  121. package/dist/core/src/adapters/photon-types.d.ts +0 -73
  122. package/dist/core/src/adapters/types.d.ts +0 -235
  123. package/dist/core/src/engine/AOTRouter.d.ts +0 -124
  124. package/dist/core/src/engine/FastContext.d.ts +0 -100
  125. package/dist/core/src/engine/Gravito.d.ts +0 -137
  126. package/dist/core/src/engine/MinimalContext.d.ts +0 -79
  127. package/dist/core/src/engine/analyzer.d.ts +0 -27
  128. package/dist/core/src/engine/constants.d.ts +0 -23
  129. package/dist/core/src/engine/index.d.ts +0 -26
  130. package/dist/core/src/engine/path.d.ts +0 -26
  131. package/dist/core/src/engine/pool.d.ts +0 -83
  132. package/dist/core/src/engine/types.d.ts +0 -143
  133. package/dist/core/src/events/CircuitBreaker.d.ts +0 -229
  134. package/dist/core/src/events/DeadLetterQueue.d.ts +0 -145
  135. package/dist/core/src/events/EventBackend.d.ts +0 -11
  136. package/dist/core/src/events/EventOptions.d.ts +0 -109
  137. package/dist/core/src/events/EventPriorityQueue.d.ts +0 -202
  138. package/dist/core/src/events/IdempotencyCache.d.ts +0 -60
  139. package/dist/core/src/events/index.d.ts +0 -14
  140. package/dist/core/src/events/observability/EventMetrics.d.ts +0 -132
  141. package/dist/core/src/events/observability/EventTracer.d.ts +0 -68
  142. package/dist/core/src/events/observability/EventTracing.d.ts +0 -161
  143. package/dist/core/src/events/observability/OTelEventMetrics.d.ts +0 -240
  144. package/dist/core/src/events/observability/ObservableHookManager.d.ts +0 -108
  145. package/dist/core/src/events/observability/index.d.ts +0 -20
  146. package/dist/core/src/events/observability/metrics-types.d.ts +0 -16
  147. package/dist/core/src/events/types.d.ts +0 -75
  148. package/dist/core/src/exceptions/AuthenticationException.d.ts +0 -8
  149. package/dist/core/src/exceptions/AuthorizationException.d.ts +0 -8
  150. package/dist/core/src/exceptions/CircularDependencyException.d.ts +0 -9
  151. package/dist/core/src/exceptions/GravitoException.d.ts +0 -23
  152. package/dist/core/src/exceptions/HttpException.d.ts +0 -9
  153. package/dist/core/src/exceptions/ModelNotFoundException.d.ts +0 -10
  154. package/dist/core/src/exceptions/ValidationException.d.ts +0 -22
  155. package/dist/core/src/exceptions/index.d.ts +0 -7
  156. package/dist/core/src/helpers/Arr.d.ts +0 -19
  157. package/dist/core/src/helpers/Str.d.ts +0 -23
  158. package/dist/core/src/helpers/data.d.ts +0 -25
  159. package/dist/core/src/helpers/errors.d.ts +0 -34
  160. package/dist/core/src/helpers/response.d.ts +0 -41
  161. package/dist/core/src/helpers.d.ts +0 -338
  162. package/dist/core/src/http/CookieJar.d.ts +0 -51
  163. package/dist/core/src/http/cookie.d.ts +0 -29
  164. package/dist/core/src/http/middleware/BodySizeLimit.d.ts +0 -16
  165. package/dist/core/src/http/middleware/Cors.d.ts +0 -24
  166. package/dist/core/src/http/middleware/Csrf.d.ts +0 -23
  167. package/dist/core/src/http/middleware/HeaderTokenGate.d.ts +0 -28
  168. package/dist/core/src/http/middleware/SecurityHeaders.d.ts +0 -29
  169. package/dist/core/src/http/middleware/ThrottleRequests.d.ts +0 -18
  170. package/dist/core/src/http/types.d.ts +0 -355
  171. package/dist/core/src/index.d.ts +0 -76
  172. package/dist/core/src/instrumentation/index.d.ts +0 -35
  173. package/dist/core/src/instrumentation/opentelemetry.d.ts +0 -178
  174. package/dist/core/src/instrumentation/types.d.ts +0 -182
  175. package/dist/core/src/reliability/DeadLetterQueueManager.d.ts +0 -316
  176. package/dist/core/src/reliability/RetryPolicy.d.ts +0 -217
  177. package/dist/core/src/reliability/index.d.ts +0 -6
  178. package/dist/core/src/router/ControllerDispatcher.d.ts +0 -12
  179. package/dist/core/src/router/RequestValidator.d.ts +0 -20
  180. package/dist/core/src/runtime.d.ts +0 -119
  181. package/dist/core/src/security/Encrypter.d.ts +0 -33
  182. package/dist/core/src/security/Hasher.d.ts +0 -29
  183. package/dist/core/src/testing/HttpTester.d.ts +0 -39
  184. package/dist/core/src/testing/TestResponse.d.ts +0 -78
  185. package/dist/core/src/testing/index.d.ts +0 -2
  186. package/dist/core/src/types/events.d.ts +0 -94
  187. package/dist/echo/src/OrbitEcho.d.ts +0 -115
  188. package/dist/echo/src/index.d.ts +0 -64
  189. package/dist/echo/src/providers/GenericProvider.d.ts +0 -53
  190. package/dist/echo/src/providers/GitHubProvider.d.ts +0 -35
  191. package/dist/echo/src/providers/StripeProvider.d.ts +0 -38
  192. package/dist/echo/src/providers/index.d.ts +0 -14
  193. package/dist/echo/src/receive/SignatureValidator.d.ts +0 -67
  194. package/dist/echo/src/receive/WebhookReceiver.d.ts +0 -185
  195. package/dist/echo/src/receive/index.d.ts +0 -2
  196. package/dist/echo/src/send/WebhookDispatcher.d.ts +0 -198
  197. package/dist/echo/src/send/index.d.ts +0 -1
  198. package/dist/echo/src/types.d.ts +0 -756
  199. package/dist/index.d.ts.map +0 -1
  200. package/dist/photon/src/index.d.ts +0 -84
  201. package/dist/photon/src/middleware/binary.d.ts +0 -31
  202. package/dist/photon/src/middleware/htmx.d.ts +0 -39
  203. package/dist/photon/src/middleware/ratelimit.d.ts +0 -157
  204. package/dist/photon/src/openapi.d.ts +0 -19
  205. package/dist/providers/GenericProvider.d.ts.map +0 -1
  206. package/dist/providers/GitHubProvider.d.ts.map +0 -1
  207. package/dist/providers/StripeProvider.d.ts.map +0 -1
  208. package/dist/providers/index.d.ts.map +0 -1
  209. package/dist/receive/SignatureValidator.d.ts.map +0 -1
  210. package/dist/receive/WebhookReceiver.d.ts.map +0 -1
  211. package/dist/receive/index.d.ts.map +0 -1
  212. package/dist/send/WebhookDispatcher.d.ts.map +0 -1
  213. package/dist/send/index.d.ts.map +0 -1
  214. package/dist/types.d.ts.map +0 -1
  215. /package/dist/{echo/src/dlq → dlq}/DeadLetterQueue.d.ts +0 -0
  216. /package/dist/{echo/src/dlq → dlq}/MemoryDeadLetterQueue.d.ts +0 -0
  217. /package/dist/{echo/src/dlq → dlq}/index.d.ts +0 -0
  218. /package/dist/{echo/src/middleware → middleware}/index.d.ts +0 -0
  219. /package/dist/{echo/src/observability → observability}/index.d.ts +0 -0
  220. /package/dist/{echo/src/observability → observability}/logging/ConsoleEchoLogger.d.ts +0 -0
  221. /package/dist/{echo/src/observability → observability}/logging/EchoLogger.d.ts +0 -0
  222. /package/dist/{echo/src/observability → observability}/logging/index.d.ts +0 -0
  223. /package/dist/{echo/src/observability → observability}/metrics/MetricsProvider.d.ts +0 -0
  224. /package/dist/{echo/src/observability → observability}/metrics/NoopMetricsProvider.d.ts +0 -0
  225. /package/dist/{echo/src/observability → observability}/metrics/PrometheusMetricsProvider.d.ts +0 -0
  226. /package/dist/{echo/src/observability → observability}/metrics/index.d.ts +0 -0
  227. /package/dist/{echo/src/observability → observability}/tracing/NoopTracer.d.ts +0 -0
  228. /package/dist/{echo/src/observability → observability}/tracing/Tracer.d.ts +0 -0
  229. /package/dist/{echo/src/observability → observability}/tracing/index.d.ts +0 -0
  230. /package/dist/{echo/src/providers → providers}/LinearProvider.d.ts +0 -0
  231. /package/dist/{echo/src/providers → providers}/PaddleProvider.d.ts +0 -0
  232. /package/dist/{echo/src/providers → providers}/ShopifyProvider.d.ts +0 -0
  233. /package/dist/{echo/src/providers → providers}/SlackProvider.d.ts +0 -0
  234. /package/dist/{echo/src/providers → providers}/TwilioProvider.d.ts +0 -0
  235. /package/dist/{echo/src/providers → providers}/base/BaseProvider.d.ts +0 -0
  236. /package/dist/{echo/src/providers → providers}/base/HeaderUtils.d.ts +0 -0
  237. /package/dist/{echo/src/replay → replay}/WebhookReplayService.d.ts +0 -0
  238. /package/dist/{echo/src/replay → replay}/index.d.ts +0 -0
  239. /package/dist/{echo/src/resilience → resilience}/CircuitBreaker.d.ts +0 -0
  240. /package/dist/{echo/src/resilience → resilience}/index.d.ts +0 -0
  241. /package/dist/{echo/src/rotation → rotation}/KeyRotationManager.d.ts +0 -0
  242. /package/dist/{echo/src/rotation → rotation}/index.d.ts +0 -0
  243. /package/dist/{echo/src/storage → storage}/MemoryWebhookStore.d.ts +0 -0
  244. /package/dist/{echo/src/storage → storage}/WebhookStore.d.ts +0 -0
  245. /package/dist/{echo/src/storage → storage}/index.d.ts +0 -0
@@ -1,123 +0,0 @@
1
- /**
2
- * Schema Registry
3
- * @description Central registry for table schemas with JIT sniffing and AOT locking
4
- */
5
- import type { ColumnSchema, TableSchema } from './types';
6
- /**
7
- * Schema Registry Mode
8
- */
9
- export type SchemaMode = 'jit' | 'aot';
10
- /**
11
- * Schema Registry Options
12
- */
13
- export interface SchemaRegistryOptions {
14
- /** Mode: jit (dev) or aot (prod) */
15
- mode?: SchemaMode;
16
- /** Path to schema lock file */
17
- lockPath?: string;
18
- /** Database connection name */
19
- connection?: string;
20
- /** Cache TTL in milliseconds (JIT mode) */
21
- cacheTtl?: number;
22
- }
23
- /**
24
- * Schema Registry
25
- * Central registry for table schemas
26
- *
27
- * @example
28
- * ```typescript
29
- * // Dev mode: JIT sniffing
30
- * const registry = SchemaRegistry.getInstance({ mode: 'jit' })
31
- * const schema = await registry.get('users')
32
- *
33
- * // Prod mode: AOT from lock file
34
- * SchemaRegistry.init({ mode: 'aot', lockPath: '.schema-lock.json' })
35
- * const schema = await registry.get('users')
36
- * ```
37
- */
38
- export declare class SchemaRegistry {
39
- private static instance;
40
- private cache;
41
- private sniffer;
42
- private mode;
43
- private lockPath;
44
- private cacheTtl;
45
- private _initialized;
46
- private constructor();
47
- /**
48
- * Check if registry is initialized
49
- */
50
- get isInitialized(): boolean;
51
- /**
52
- * Initialize the registry (call once at startup)
53
- */
54
- static init(options?: SchemaRegistryOptions): SchemaRegistry;
55
- /**
56
- * Get the registry instance
57
- */
58
- static getInstance(): SchemaRegistry;
59
- /**
60
- * Reset the registry (for testing)
61
- */
62
- static reset(): void;
63
- /**
64
- * Get schema for a table
65
- */
66
- get(table: string, connection?: string): Promise<TableSchema>;
67
- /**
68
- * Check if table schema exists
69
- */
70
- has(table: string): boolean;
71
- /**
72
- * Get column schema
73
- */
74
- getColumn(table: string, column: string): Promise<ColumnSchema | undefined>;
75
- /**
76
- * Check if column exists
77
- */
78
- hasColumn(table: string, column: string): Promise<boolean>;
79
- /**
80
- * Get all cached tables
81
- */
82
- getTables(): string[];
83
- /**
84
- * Invalidate cache for a specific table
85
- * Forces re-sniff on next access
86
- */
87
- invalidate(table: string): void;
88
- /**
89
- * Invalidate all cached schemas
90
- */
91
- invalidateAll(): void;
92
- /**
93
- * Force refresh schema for a table
94
- * Re-sniffs even if cached (JIT mode only)
95
- */
96
- refresh(table: string): Promise<TableSchema>;
97
- /**
98
- * Wrap a database operation with self-healing
99
- * Automatically re-sniffs schema on column-related errors and retries
100
- *
101
- * @example
102
- * ```typescript
103
- * const result = await registry.withSelfHealing('users', async () => {
104
- * return await connection.table('users').where('new_column', value).get()
105
- * })
106
- * ```
107
- */
108
- withSelfHealing<T>(table: string, operation: () => Promise<T>): Promise<T>;
109
- /**
110
- * Check if an error is schema-related
111
- */
112
- private isSchemaError;
113
- /**
114
- * Load schemas from lock file (AOT mode)
115
- */
116
- loadFromLock(path?: string): void;
117
- /**
118
- * Save schemas to lock file
119
- */
120
- saveToLock(tables: string[], path?: string): Promise<void>;
121
- private serializeTableSchema;
122
- private deserializeTableSchema;
123
- }
@@ -1,54 +0,0 @@
1
- /**
2
- * Schema Sniffer
3
- * @description Introspects database schema at runtime (JIT mode)
4
- */
5
- import type { TableSchema } from './types';
6
- /**
7
- * Schema Sniffer
8
- * Retrieves table schema from database at runtime
9
- */
10
- export declare class SchemaSniffer {
11
- private connectionName;
12
- constructor(connectionName?: string);
13
- /**
14
- * Sniff table schema from database
15
- */
16
- sniff(table: string): Promise<TableSchema>;
17
- /**
18
- * Sniff SQLite table schema
19
- */
20
- private sniffSQLite;
21
- /**
22
- * Sniff PostgreSQL table schema
23
- */
24
- private sniffPostgres;
25
- /**
26
- * Sniff MySQL table schema
27
- */
28
- private sniffMySQL;
29
- /**
30
- * Map PostgreSQL type to ColumnType
31
- */
32
- private mapPostgresType;
33
- /**
34
- * Map MySQL type to ColumnType
35
- */
36
- private mapMySQLType;
37
- private mapSQLiteType;
38
- /**
39
- * Parse default value
40
- */
41
- private parseDefault;
42
- /**
43
- * Extract length from MySQL type
44
- */
45
- private extractMySQLLength;
46
- /**
47
- * Extract enum values from MySQL type
48
- */
49
- private extractMySQLEnumValues;
50
- /**
51
- * Get driver name
52
- */
53
- private getDriverName;
54
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Schema Module Index
3
- */
4
- export { type SchemaMode, SchemaRegistry, type SchemaRegistryOptions } from './SchemaRegistry';
5
- export { SchemaSniffer } from './SchemaSniffer';
6
- export type { ColumnSchema, ColumnType, SchemaLock, SerializedColumnSchema, SerializedTableSchema, TableSchema, } from './types';
@@ -1,85 +0,0 @@
1
- /**
2
- * Schema Types
3
- * @description Type definitions for schema introspection
4
- */
5
- /**
6
- * Column data types
7
- */
8
- export type ColumnType = 'string' | 'text' | 'integer' | 'bigint' | 'smallint' | 'decimal' | 'float' | 'boolean' | 'date' | 'time' | 'datetime' | 'timestamp' | 'json' | 'jsonb' | 'uuid' | 'binary' | 'enum' | 'unknown';
9
- /**
10
- * Column schema definition
11
- */
12
- export interface ColumnSchema {
13
- /** Column name */
14
- name: string;
15
- /** Column type */
16
- type: ColumnType;
17
- /** Is nullable */
18
- nullable: boolean;
19
- /** Default value */
20
- default?: unknown;
21
- /** Is primary key */
22
- primary: boolean;
23
- /** Is unique */
24
- unique: boolean;
25
- /** Is auto-increment */
26
- autoIncrement: boolean;
27
- /** Enum values (if type is enum) */
28
- enumValues?: string[] | undefined;
29
- /** Max length (for string types) */
30
- maxLength?: number | undefined;
31
- /** Numeric precision */
32
- precision?: number | undefined;
33
- /** Numeric scale */
34
- scale?: number | undefined;
35
- }
36
- /**
37
- * Table schema definition
38
- */
39
- export interface TableSchema {
40
- /** Table name */
41
- table: string;
42
- /** Column definitions */
43
- columns: Map<string, ColumnSchema>;
44
- /** Primary key column(s) */
45
- primaryKey: string[];
46
- /** Timestamp of schema capture */
47
- capturedAt: number;
48
- }
49
- /**
50
- * Schema lock file format
51
- */
52
- export interface SchemaLock {
53
- /** Version for compatibility */
54
- version: string;
55
- /** Driver used to generate */
56
- driver: string;
57
- /** Generation timestamp */
58
- generatedAt: string;
59
- /** Table schemas */
60
- tables: Record<string, SerializedTableSchema>;
61
- }
62
- /**
63
- * Serialized table schema (for JSON storage)
64
- */
65
- export interface SerializedTableSchema {
66
- table: string;
67
- columns: SerializedColumnSchema[];
68
- primaryKey: string[];
69
- }
70
- /**
71
- * Serialized column schema (for JSON storage)
72
- */
73
- export interface SerializedColumnSchema {
74
- name: string;
75
- type: ColumnType;
76
- nullable: boolean;
77
- default?: unknown;
78
- primary: boolean;
79
- unique: boolean;
80
- autoIncrement: boolean;
81
- enumValues?: string[] | undefined;
82
- maxLength?: number | undefined;
83
- precision?: number | undefined;
84
- scale?: number | undefined;
85
- }
@@ -1,60 +0,0 @@
1
- /**
2
- * Raw SQL Expression
3
- * @description Represents a raw SQL expression that should not be escaped by the query builder.
4
- * Use this for complex SQL fragments, function calls, or database-specific syntax.
5
- */
6
- export declare class Expression {
7
- private readonly sql;
8
- private readonly bindings;
9
- /**
10
- * Create a new Expression instance
11
- *
12
- * @param sql - The raw SQL string
13
- * @param bindings - Optional array of bindings for the expression
14
- */
15
- constructor(sql: string, bindings?: unknown[]);
16
- /**
17
- * Get the raw SQL string
18
- *
19
- * @returns The SQL string
20
- */
21
- getValue(): string;
22
- /**
23
- * Get the bindings associated with this expression
24
- *
25
- * @returns Array of bindings
26
- */
27
- getBindings(): unknown[];
28
- /**
29
- * Convert the expression to its SQL string representation
30
- *
31
- * @returns The SQL string
32
- */
33
- toString(): string;
34
- }
35
- /**
36
- * Create a raw SQL expression
37
- *
38
- * @param sql - The raw SQL string
39
- * @param bindings - Optional array of bindings
40
- * @returns A new Expression instance
41
- * @example
42
- * ```typescript
43
- * DB.table('users').select(raw('COUNT(*) as total')).get()
44
- * ```
45
- */
46
- export declare function raw(sql: string, bindings?: unknown[]): Expression;
47
- /**
48
- * Tagged template literal for safe raw SQL construction
49
- *
50
- * @param strings - Template strings
51
- * @param values - Values to be used as bindings
52
- * @returns A new Expression instance with auto-generated placeholders
53
- * @example
54
- * ```typescript
55
- * const userId = 1;
56
- * const query = sql`SELECT * FROM users WHERE id = ${userId}`;
57
- * // Result: Expression { sql: "SELECT * FROM users WHERE id = ?", bindings: [1] }
58
- * ```
59
- */
60
- export declare function sql(strings: TemplateStringsArray, ...values: unknown[]): Expression;
@@ -1,10 +0,0 @@
1
- export declare class NPlusOneDetector {
2
- private static queryCounts;
3
- private static timeframe;
4
- private static threshold;
5
- private static enabled;
6
- static track(tableName: string, sql: string, structureKey: string): void;
7
- static reset(): void;
8
- static setEnabled(enabled: boolean): void;
9
- private static warn;
10
- }