@gravito/echo 3.1.1 → 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 (292) 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 -348
  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 -41
  24. package/dist/atlas/src/connection/Connection.d.ts +0 -112
  25. package/dist/atlas/src/connection/ConnectionManager.d.ts +0 -180
  26. package/dist/atlas/src/connection/ReplicaConnectionPool.d.ts +0 -54
  27. package/dist/atlas/src/drivers/BunSQLDriver.d.ts +0 -32
  28. package/dist/atlas/src/drivers/BunSQLPreparedStatement.d.ts +0 -118
  29. package/dist/atlas/src/drivers/MongoDBDriver.d.ts +0 -36
  30. package/dist/atlas/src/drivers/MySQLDriver.d.ts +0 -79
  31. package/dist/atlas/src/drivers/PostgresDriver.d.ts +0 -96
  32. package/dist/atlas/src/drivers/RedisDriver.d.ts +0 -43
  33. package/dist/atlas/src/drivers/SQLiteDriver.d.ts +0 -45
  34. package/dist/atlas/src/drivers/types.d.ts +0 -260
  35. package/dist/atlas/src/errors/index.d.ts +0 -45
  36. package/dist/atlas/src/grammar/Grammar.d.ts +0 -342
  37. package/dist/atlas/src/grammar/MongoGrammar.d.ts +0 -47
  38. package/dist/atlas/src/grammar/MySQLGrammar.d.ts +0 -54
  39. package/dist/atlas/src/grammar/NullGrammar.d.ts +0 -35
  40. package/dist/atlas/src/grammar/PostgresGrammar.d.ts +0 -62
  41. package/dist/atlas/src/grammar/SQLiteGrammar.d.ts +0 -32
  42. package/dist/atlas/src/index.d.ts +0 -79
  43. package/dist/atlas/src/migration/Migration.d.ts +0 -64
  44. package/dist/atlas/src/migration/MigrationRepository.d.ts +0 -65
  45. package/dist/atlas/src/migration/Migrator.d.ts +0 -110
  46. package/dist/atlas/src/migration/index.d.ts +0 -6
  47. package/dist/atlas/src/observability/AtlasMetrics.d.ts +0 -33
  48. package/dist/atlas/src/observability/AtlasObservability.d.ts +0 -15
  49. package/dist/atlas/src/observability/AtlasTracer.d.ts +0 -12
  50. package/dist/atlas/src/observability/index.d.ts +0 -9
  51. package/dist/atlas/src/orm/Repository.d.ts +0 -247
  52. package/dist/atlas/src/orm/index.d.ts +0 -6
  53. package/dist/atlas/src/orm/model/DirtyTracker.d.ts +0 -121
  54. package/dist/atlas/src/orm/model/Model.d.ts +0 -458
  55. package/dist/atlas/src/orm/model/ModelRegistry.d.ts +0 -20
  56. package/dist/atlas/src/orm/model/concerns/HasAttributes.d.ts +0 -150
  57. package/dist/atlas/src/orm/model/concerns/HasEvents.d.ts +0 -36
  58. package/dist/atlas/src/orm/model/concerns/HasPersistence.d.ts +0 -92
  59. package/dist/atlas/src/orm/model/concerns/HasRelationships.d.ts +0 -117
  60. package/dist/atlas/src/orm/model/concerns/HasSerialization.d.ts +0 -64
  61. package/dist/atlas/src/orm/model/concerns/applyMixins.d.ts +0 -15
  62. package/dist/atlas/src/orm/model/concerns/index.d.ts +0 -12
  63. package/dist/atlas/src/orm/model/decorators.d.ts +0 -138
  64. package/dist/atlas/src/orm/model/errors.d.ts +0 -52
  65. package/dist/atlas/src/orm/model/index.d.ts +0 -10
  66. package/dist/atlas/src/orm/model/relationships.d.ts +0 -207
  67. package/dist/atlas/src/orm/model/types.d.ts +0 -12
  68. package/dist/atlas/src/orm/schema/SchemaRegistry.d.ts +0 -124
  69. package/dist/atlas/src/orm/schema/SchemaSniffer.d.ts +0 -54
  70. package/dist/atlas/src/orm/schema/index.d.ts +0 -6
  71. package/dist/atlas/src/orm/schema/types.d.ts +0 -85
  72. package/dist/atlas/src/pool/AdaptivePoolManager.d.ts +0 -98
  73. package/dist/atlas/src/pool/PoolHealthChecker.d.ts +0 -91
  74. package/dist/atlas/src/pool/PoolStrategy.d.ts +0 -129
  75. package/dist/atlas/src/pool/PoolWarmer.d.ts +0 -92
  76. package/dist/atlas/src/query/Expression.d.ts +0 -60
  77. package/dist/atlas/src/query/NPlusOneDetector.d.ts +0 -10
  78. package/dist/atlas/src/query/QueryBuilder.d.ts +0 -643
  79. package/dist/atlas/src/query/RelationshipResolver.d.ts +0 -23
  80. package/dist/atlas/src/query/clauses/GroupByClause.d.ts +0 -51
  81. package/dist/atlas/src/query/clauses/HavingClause.d.ts +0 -70
  82. package/dist/atlas/src/query/clauses/JoinClause.d.ts +0 -87
  83. package/dist/atlas/src/query/clauses/LimitClause.d.ts +0 -82
  84. package/dist/atlas/src/query/clauses/OrderByClause.d.ts +0 -69
  85. package/dist/atlas/src/query/clauses/SelectClause.d.ts +0 -71
  86. package/dist/atlas/src/query/clauses/WhereClause.d.ts +0 -167
  87. package/dist/atlas/src/query/clauses/index.d.ts +0 -11
  88. package/dist/atlas/src/schema/Blueprint.d.ts +0 -276
  89. package/dist/atlas/src/schema/ColumnDefinition.d.ts +0 -154
  90. package/dist/atlas/src/schema/ForeignKeyDefinition.d.ts +0 -37
  91. package/dist/atlas/src/schema/MigrationGenerator.d.ts +0 -45
  92. package/dist/atlas/src/schema/Schema.d.ts +0 -131
  93. package/dist/atlas/src/schema/SchemaDiff.d.ts +0 -73
  94. package/dist/atlas/src/schema/TypeGenerator.d.ts +0 -57
  95. package/dist/atlas/src/schema/TypeWriter.d.ts +0 -42
  96. package/dist/atlas/src/schema/grammars/MySQLSchemaGrammar.d.ts +0 -23
  97. package/dist/atlas/src/schema/grammars/PostgresSchemaGrammar.d.ts +0 -26
  98. package/dist/atlas/src/schema/grammars/SQLiteSchemaGrammar.d.ts +0 -28
  99. package/dist/atlas/src/schema/grammars/SchemaGrammar.d.ts +0 -97
  100. package/dist/atlas/src/schema/grammars/index.d.ts +0 -7
  101. package/dist/atlas/src/schema/index.d.ts +0 -8
  102. package/dist/atlas/src/seed/Factory.d.ts +0 -90
  103. package/dist/atlas/src/seed/Seeder.d.ts +0 -28
  104. package/dist/atlas/src/seed/SeederRunner.d.ts +0 -74
  105. package/dist/atlas/src/seed/index.d.ts +0 -6
  106. package/dist/atlas/src/sharding/ShardingManager.d.ts +0 -59
  107. package/dist/atlas/src/types/index.d.ts +0 -1182
  108. package/dist/atlas/src/utils/CursorEncoding.d.ts +0 -63
  109. package/dist/atlas/src/utils/levenshtein.d.ts +0 -9
  110. package/dist/core/src/Application.d.ts +0 -215
  111. package/dist/core/src/CommandKernel.d.ts +0 -33
  112. package/dist/core/src/ConfigManager.d.ts +0 -65
  113. package/dist/core/src/Container/RequestScopeManager.d.ts +0 -62
  114. package/dist/core/src/Container/RequestScopeMetrics.d.ts +0 -144
  115. package/dist/core/src/Container.d.ts +0 -153
  116. package/dist/core/src/ErrorHandler.d.ts +0 -66
  117. package/dist/core/src/Event.d.ts +0 -5
  118. package/dist/core/src/EventManager.d.ts +0 -123
  119. package/dist/core/src/GlobalErrorHandlers.d.ts +0 -47
  120. package/dist/core/src/GravitoServer.d.ts +0 -28
  121. package/dist/core/src/HookManager.d.ts +0 -591
  122. package/dist/core/src/Listener.d.ts +0 -4
  123. package/dist/core/src/Logger.d.ts +0 -20
  124. package/dist/core/src/PlanetCore.d.ts +0 -378
  125. package/dist/core/src/RequestContext.d.ts +0 -97
  126. package/dist/core/src/Route.d.ts +0 -36
  127. package/dist/core/src/Router.d.ts +0 -284
  128. package/dist/core/src/ServiceProvider.d.ts +0 -178
  129. package/dist/core/src/adapters/GravitoEngineAdapter.d.ts +0 -27
  130. package/dist/core/src/adapters/PhotonAdapter.d.ts +0 -175
  131. package/dist/core/src/adapters/bun/BunContext.d.ts +0 -49
  132. package/dist/core/src/adapters/bun/BunNativeAdapter.d.ts +0 -31
  133. package/dist/core/src/adapters/bun/BunRequest.d.ts +0 -31
  134. package/dist/core/src/adapters/bun/RadixNode.d.ts +0 -19
  135. package/dist/core/src/adapters/bun/RadixRouter.d.ts +0 -31
  136. package/dist/core/src/adapters/bun/types.d.ts +0 -20
  137. package/dist/core/src/adapters/photon-types.d.ts +0 -73
  138. package/dist/core/src/adapters/types.d.ts +0 -235
  139. package/dist/core/src/cli/queue-commands.d.ts +0 -6
  140. package/dist/core/src/engine/AOTRouter.d.ts +0 -129
  141. package/dist/core/src/engine/FastContext.d.ts +0 -123
  142. package/dist/core/src/engine/Gravito.d.ts +0 -136
  143. package/dist/core/src/engine/MinimalContext.d.ts +0 -100
  144. package/dist/core/src/engine/analyzer.d.ts +0 -27
  145. package/dist/core/src/engine/constants.d.ts +0 -23
  146. package/dist/core/src/engine/index.d.ts +0 -26
  147. package/dist/core/src/engine/path.d.ts +0 -26
  148. package/dist/core/src/engine/pool.d.ts +0 -83
  149. package/dist/core/src/engine/types.d.ts +0 -146
  150. package/dist/core/src/error-handling/RequestScopeErrorContext.d.ts +0 -126
  151. package/dist/core/src/events/BackpressureManager.d.ts +0 -215
  152. package/dist/core/src/events/CircuitBreaker.d.ts +0 -229
  153. package/dist/core/src/events/DeadLetterQueue.d.ts +0 -219
  154. package/dist/core/src/events/EventBackend.d.ts +0 -12
  155. package/dist/core/src/events/EventOptions.d.ts +0 -204
  156. package/dist/core/src/events/EventPriorityQueue.d.ts +0 -301
  157. package/dist/core/src/events/FlowControlStrategy.d.ts +0 -109
  158. package/dist/core/src/events/IdempotencyCache.d.ts +0 -60
  159. package/dist/core/src/events/MessageQueueBridge.d.ts +0 -184
  160. package/dist/core/src/events/PriorityEscalationManager.d.ts +0 -82
  161. package/dist/core/src/events/RetryScheduler.d.ts +0 -104
  162. package/dist/core/src/events/WorkerPool.d.ts +0 -98
  163. package/dist/core/src/events/WorkerPoolConfig.d.ts +0 -153
  164. package/dist/core/src/events/WorkerPoolMetrics.d.ts +0 -65
  165. package/dist/core/src/events/aggregation/AggregationWindow.d.ts +0 -77
  166. package/dist/core/src/events/aggregation/DeduplicationManager.d.ts +0 -135
  167. package/dist/core/src/events/aggregation/EventAggregationManager.d.ts +0 -108
  168. package/dist/core/src/events/aggregation/EventBatcher.d.ts +0 -99
  169. package/dist/core/src/events/aggregation/types.d.ts +0 -117
  170. package/dist/core/src/events/index.d.ts +0 -25
  171. package/dist/core/src/events/observability/EventMetrics.d.ts +0 -132
  172. package/dist/core/src/events/observability/EventTracer.d.ts +0 -68
  173. package/dist/core/src/events/observability/EventTracing.d.ts +0 -161
  174. package/dist/core/src/events/observability/OTelEventMetrics.d.ts +0 -332
  175. package/dist/core/src/events/observability/ObservableHookManager.d.ts +0 -108
  176. package/dist/core/src/events/observability/StreamWorkerMetrics.d.ts +0 -76
  177. package/dist/core/src/events/observability/index.d.ts +0 -24
  178. package/dist/core/src/events/observability/metrics-types.d.ts +0 -16
  179. package/dist/core/src/events/types.d.ts +0 -134
  180. package/dist/core/src/exceptions/AuthenticationException.d.ts +0 -8
  181. package/dist/core/src/exceptions/AuthorizationException.d.ts +0 -8
  182. package/dist/core/src/exceptions/CircularDependencyException.d.ts +0 -9
  183. package/dist/core/src/exceptions/GravitoException.d.ts +0 -23
  184. package/dist/core/src/exceptions/HttpException.d.ts +0 -9
  185. package/dist/core/src/exceptions/ModelNotFoundException.d.ts +0 -10
  186. package/dist/core/src/exceptions/ValidationException.d.ts +0 -22
  187. package/dist/core/src/exceptions/index.d.ts +0 -7
  188. package/dist/core/src/health/HealthProvider.d.ts +0 -67
  189. package/dist/core/src/helpers/Arr.d.ts +0 -19
  190. package/dist/core/src/helpers/Str.d.ts +0 -23
  191. package/dist/core/src/helpers/data.d.ts +0 -25
  192. package/dist/core/src/helpers/errors.d.ts +0 -34
  193. package/dist/core/src/helpers/response.d.ts +0 -41
  194. package/dist/core/src/helpers.d.ts +0 -338
  195. package/dist/core/src/http/CookieJar.d.ts +0 -51
  196. package/dist/core/src/http/cookie.d.ts +0 -29
  197. package/dist/core/src/http/middleware/BodySizeLimit.d.ts +0 -16
  198. package/dist/core/src/http/middleware/Cors.d.ts +0 -24
  199. package/dist/core/src/http/middleware/Csrf.d.ts +0 -23
  200. package/dist/core/src/http/middleware/HeaderTokenGate.d.ts +0 -28
  201. package/dist/core/src/http/middleware/SecurityHeaders.d.ts +0 -29
  202. package/dist/core/src/http/middleware/ThrottleRequests.d.ts +0 -18
  203. package/dist/core/src/http/types.d.ts +0 -374
  204. package/dist/core/src/index.d.ts +0 -88
  205. package/dist/core/src/instrumentation/index.d.ts +0 -35
  206. package/dist/core/src/instrumentation/opentelemetry.d.ts +0 -178
  207. package/dist/core/src/instrumentation/types.d.ts +0 -182
  208. package/dist/core/src/observability/Metrics.d.ts +0 -244
  209. package/dist/core/src/observability/QueueDashboard.d.ts +0 -136
  210. package/dist/core/src/reliability/DeadLetterQueueManager.d.ts +0 -350
  211. package/dist/core/src/reliability/RetryPolicy.d.ts +0 -217
  212. package/dist/core/src/reliability/index.d.ts +0 -6
  213. package/dist/core/src/router/ControllerDispatcher.d.ts +0 -12
  214. package/dist/core/src/router/RequestValidator.d.ts +0 -20
  215. package/dist/core/src/runtime.d.ts +0 -119
  216. package/dist/core/src/security/Encrypter.d.ts +0 -33
  217. package/dist/core/src/security/Hasher.d.ts +0 -29
  218. package/dist/core/src/testing/HttpTester.d.ts +0 -39
  219. package/dist/core/src/testing/TestResponse.d.ts +0 -78
  220. package/dist/core/src/testing/index.d.ts +0 -2
  221. package/dist/core/src/types/events.d.ts +0 -94
  222. package/dist/echo/src/OrbitEcho.d.ts +0 -115
  223. package/dist/echo/src/index.d.ts +0 -64
  224. package/dist/echo/src/providers/GenericProvider.d.ts +0 -53
  225. package/dist/echo/src/providers/GitHubProvider.d.ts +0 -35
  226. package/dist/echo/src/providers/StripeProvider.d.ts +0 -38
  227. package/dist/echo/src/providers/index.d.ts +0 -14
  228. package/dist/echo/src/receive/SignatureValidator.d.ts +0 -67
  229. package/dist/echo/src/receive/WebhookReceiver.d.ts +0 -185
  230. package/dist/echo/src/receive/index.d.ts +0 -2
  231. package/dist/echo/src/send/WebhookDispatcher.d.ts +0 -198
  232. package/dist/echo/src/send/index.d.ts +0 -1
  233. package/dist/echo/src/types.d.ts +0 -756
  234. package/dist/index.d.ts.map +0 -1
  235. package/dist/monitor/src/MonitorOrbit.d.ts +0 -43
  236. package/dist/monitor/src/config.d.ts +0 -106
  237. package/dist/monitor/src/health/HealthController.d.ts +0 -28
  238. package/dist/monitor/src/health/HealthRegistry.d.ts +0 -80
  239. package/dist/monitor/src/health/index.d.ts +0 -36
  240. package/dist/monitor/src/index.d.ts +0 -13
  241. package/dist/monitor/src/metrics/MetricsController.d.ts +0 -22
  242. package/dist/monitor/src/metrics/MetricsRegistry.d.ts +0 -136
  243. package/dist/monitor/src/metrics/index.d.ts +0 -11
  244. package/dist/monitor/src/tracing/TracingManager.d.ts +0 -97
  245. package/dist/monitor/src/tracing/index.d.ts +0 -10
  246. package/dist/photon/src/index.d.ts +0 -89
  247. package/dist/photon/src/middleware/binary.d.ts +0 -31
  248. package/dist/photon/src/middleware/htmx.d.ts +0 -39
  249. package/dist/photon/src/middleware/ratelimit-redis.d.ts +0 -50
  250. package/dist/photon/src/middleware/ratelimit.d.ts +0 -161
  251. package/dist/photon/src/openapi.d.ts +0 -19
  252. package/dist/providers/GenericProvider.d.ts.map +0 -1
  253. package/dist/providers/GitHubProvider.d.ts.map +0 -1
  254. package/dist/providers/StripeProvider.d.ts.map +0 -1
  255. package/dist/providers/index.d.ts.map +0 -1
  256. package/dist/receive/SignatureValidator.d.ts.map +0 -1
  257. package/dist/receive/WebhookReceiver.d.ts.map +0 -1
  258. package/dist/receive/index.d.ts.map +0 -1
  259. package/dist/send/WebhookDispatcher.d.ts.map +0 -1
  260. package/dist/send/index.d.ts.map +0 -1
  261. package/dist/types.d.ts.map +0 -1
  262. /package/dist/{echo/src/dlq → dlq}/DeadLetterQueue.d.ts +0 -0
  263. /package/dist/{echo/src/dlq → dlq}/MemoryDeadLetterQueue.d.ts +0 -0
  264. /package/dist/{echo/src/dlq → dlq}/index.d.ts +0 -0
  265. /package/dist/{echo/src/middleware → middleware}/index.d.ts +0 -0
  266. /package/dist/{echo/src/observability → observability}/index.d.ts +0 -0
  267. /package/dist/{echo/src/observability → observability}/logging/ConsoleEchoLogger.d.ts +0 -0
  268. /package/dist/{echo/src/observability → observability}/logging/EchoLogger.d.ts +0 -0
  269. /package/dist/{echo/src/observability → observability}/logging/index.d.ts +0 -0
  270. /package/dist/{echo/src/observability → observability}/metrics/MetricsProvider.d.ts +0 -0
  271. /package/dist/{echo/src/observability → observability}/metrics/NoopMetricsProvider.d.ts +0 -0
  272. /package/dist/{echo/src/observability → observability}/metrics/PrometheusMetricsProvider.d.ts +0 -0
  273. /package/dist/{echo/src/observability → observability}/metrics/index.d.ts +0 -0
  274. /package/dist/{echo/src/observability → observability}/tracing/NoopTracer.d.ts +0 -0
  275. /package/dist/{echo/src/observability → observability}/tracing/Tracer.d.ts +0 -0
  276. /package/dist/{echo/src/observability → observability}/tracing/index.d.ts +0 -0
  277. /package/dist/{echo/src/providers → providers}/LinearProvider.d.ts +0 -0
  278. /package/dist/{echo/src/providers → providers}/PaddleProvider.d.ts +0 -0
  279. /package/dist/{echo/src/providers → providers}/ShopifyProvider.d.ts +0 -0
  280. /package/dist/{echo/src/providers → providers}/SlackProvider.d.ts +0 -0
  281. /package/dist/{echo/src/providers → providers}/TwilioProvider.d.ts +0 -0
  282. /package/dist/{echo/src/providers → providers}/base/BaseProvider.d.ts +0 -0
  283. /package/dist/{echo/src/providers → providers}/base/HeaderUtils.d.ts +0 -0
  284. /package/dist/{echo/src/replay → replay}/WebhookReplayService.d.ts +0 -0
  285. /package/dist/{echo/src/replay → replay}/index.d.ts +0 -0
  286. /package/dist/{echo/src/resilience → resilience}/CircuitBreaker.d.ts +0 -0
  287. /package/dist/{echo/src/resilience → resilience}/index.d.ts +0 -0
  288. /package/dist/{echo/src/rotation → rotation}/KeyRotationManager.d.ts +0 -0
  289. /package/dist/{echo/src/rotation → rotation}/index.d.ts +0 -0
  290. /package/dist/{echo/src/storage → storage}/MemoryWebhookStore.d.ts +0 -0
  291. /package/dist/{echo/src/storage → storage}/WebhookStore.d.ts +0 -0
  292. /package/dist/{echo/src/storage → storage}/index.d.ts +0 -0
package/dist/types.d.ts CHANGED
@@ -1,144 +1,756 @@
1
+ import type { DeadLetterQueue } from './dlq/DeadLetterQueue';
2
+ import type { EchoLogger } from './observability/logging';
3
+ import type { MetricsProvider } from './observability/metrics';
4
+ import type { Tracer } from './observability/tracing';
5
+ import type { WebhookStore } from './storage/WebhookStore';
1
6
  /**
2
- * @fileoverview Core types for @gravito/echo webhook module
3
- * @module @gravito/echo
7
+ * Core types for the Echo module.
8
+ *
9
+ * This module defines the fundamental structures for both receiving and sending webhooks,
10
+ * ensuring a consistent interface across different providers and delivery targets.
11
+ *
12
+ * @packageDocumentation
4
13
  */
5
14
  /**
6
- * Webhook provider configuration
15
+ * Configuration for a specific webhook provider instance.
16
+ *
17
+ * This interface defines the essential security and routing parameters required to
18
+ * authenticate incoming requests from external services. It acts as a contract
19
+ * between the Echo receiver and the specific provider implementation.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const stripeConfig: WebhookProviderConfig = {
24
+ * name: 'stripe_prod',
25
+ * secret: process.env.STRIPE_WEBHOOK_SECRET,
26
+ * signatureHeader: 'stripe-signature',
27
+ * tolerance: 300 // Allow for 5 minutes of clock drift
28
+ * };
29
+ * ```
30
+ *
31
+ * @public
7
32
  */
8
33
  export interface WebhookProviderConfig {
9
- /** Provider name (e.g., 'stripe', 'github', 'generic') */
34
+ /**
35
+ * A unique identifier for this provider configuration instance.
36
+ * This name is used to route incoming requests to the correct security context.
37
+ */
10
38
  name: string;
11
- /** Secret for signature verification */
39
+ /**
40
+ * The cryptographic shared secret used to verify request signatures.
41
+ * Depending on the provider, this might be a signing secret or a client secret.
42
+ */
12
43
  secret: string;
13
- /** Signature header name */
44
+ /**
45
+ * The specific HTTP header name containing the signature.
46
+ * If omitted, the provider's default header (e.g., 'x-hub-signature-256' for GitHub) is used.
47
+ *
48
+ * @example 'x-paddle-signature'
49
+ */
14
50
  signatureHeader?: string;
15
- /** Timestamp validation tolerance in seconds (default: 300) */
51
+ /**
52
+ * The maximum permissible age of a webhook request in seconds.
53
+ * Used to mitigate replay attacks by ensuring the request was recently signed.
54
+ *
55
+ * @defaultValue 300
56
+ */
16
57
  tolerance?: number;
17
58
  }
18
59
  /**
19
- * Result of webhook verification
60
+ * The normalized result of a webhook authenticity and integrity check.
61
+ *
62
+ * This structure encapsulates the outcome of the verification process, providing
63
+ * both the status and the extracted data needed for subsequent processing.
64
+ *
65
+ * @public
20
66
  */
21
67
  export interface WebhookVerificationResult {
22
- /** Whether the webhook is valid */
68
+ /**
69
+ * Indicates whether the cryptographic signature is valid and the request
70
+ * falls within the specified time tolerance window.
71
+ */
23
72
  valid: boolean;
24
- /** Error message if invalid */
73
+ /**
74
+ * A human-readable or machine-parsable explanation of why verification failed.
75
+ * Only populated when `valid` is false.
76
+ */
25
77
  error?: string;
26
- /** Parsed payload */
78
+ /**
79
+ * The parsed JSON payload extracted from the validated request body.
80
+ * Guaranteed to be available and authentic if `valid` is true.
81
+ */
27
82
  payload?: unknown;
28
- /** Event type (if available) */
83
+ /**
84
+ * The semantic category of the event (e.g., 'invoice.created').
85
+ * Inferred by the provider implementation during verification.
86
+ */
29
87
  eventType?: string;
30
- /** Webhook ID (if available) */
88
+ /**
89
+ * The unique ID assigned to this event by the source service.
90
+ * Used for idempotency checks and audit logging.
91
+ */
31
92
  webhookId?: string;
32
93
  }
33
94
  /**
34
- * Webhook provider interface
95
+ * Contract for implementing service-specific webhook verification and parsing.
96
+ *
97
+ * Implementations of this interface handle the low-level, service-specific details
98
+ * of signature algorithms (HMAC, RSA), timestamp header formats, and payload
99
+ * structure for specific providers like Stripe, GitHub, or Shopify.
100
+ *
101
+ * @public
35
102
  */
36
103
  export interface WebhookProvider {
37
- /** Provider name */
104
+ /**
105
+ * The canonical type name of the provider.
106
+ * This name is used to match incoming requests to the correct implementation.
107
+ *
108
+ * @example 'stripe'
109
+ */
38
110
  readonly name: string;
39
111
  /**
40
- * Verify webhook signature
112
+ * Validates the cryptographic integrity and temporal validity of a request.
113
+ *
114
+ * This method must perform signature check and timestamp validation to prevent
115
+ * forgery and replay attacks.
116
+ *
117
+ * @param payload - The exact raw request body as received (crucial for HMAC).
118
+ * @param headers - Complete HTTP headers from the incoming request.
119
+ * @param secret - The configured secret key for the provider instance.
120
+ * @returns A promise resolving to the verification result and parsed payload.
121
+ * @throws {Error} Should only throw for unexpected internal errors, not for invalid signatures.
41
122
  */
42
123
  verify(payload: string | Buffer, headers: Record<string, string | string[] | undefined>, secret: string): Promise<WebhookVerificationResult>;
43
124
  /**
44
- * Parse the event type from payload
125
+ * Identifies the semantic event type from a validated and parsed payload.
126
+ *
127
+ * @param payload - The authentic data object returned by `verify`.
128
+ * @returns The event type string (e.g., 'customer.subscription.deleted') or undefined if unrecognized.
45
129
  */
46
130
  parseEventType?(payload: unknown): string | undefined;
47
131
  }
48
132
  /**
49
- * Webhook event handler
133
+ * A callback function triggered when a valid webhook event is matched and processed.
134
+ *
135
+ * @param event - The normalized and authenticated webhook event object.
136
+ * @public
50
137
  */
51
138
  export type WebhookHandler<T = unknown> = (event: WebhookEvent<T>) => void | Promise<void>;
52
139
  /**
53
- * Webhook event
140
+ * Normalized representation of an authenticated incoming webhook event.
141
+ *
142
+ * Echo transforms diverse provider-specific requests into this standard format,
143
+ * allowing application logic to remain decoupled from the specifics of the source service.
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * const processOrder: WebhookHandler<OrderData> = async (event) => {
148
+ * const { provider, type, payload } = event;
149
+ * console.log(`Processing ${type} from ${provider}`);
150
+ * await updateDatabase(payload.orderId);
151
+ * };
152
+ * ```
153
+ *
154
+ * @public
54
155
  */
55
156
  export interface WebhookEvent<T = unknown> {
56
- /** Provider name */
157
+ /**
158
+ * The name of the provider instance that received and verified this event.
159
+ */
57
160
  provider: string;
58
- /** Event type */
161
+ /**
162
+ * The semantic category of the event (e.g., 'payment.captured').
163
+ */
59
164
  type: string;
60
- /** Event payload */
165
+ /**
166
+ * The parsed and type-safe data payload.
167
+ */
61
168
  payload: T;
62
- /** Raw request headers */
169
+ /**
170
+ * The original HTTP headers received with the request.
171
+ */
63
172
  headers: Record<string, string | string[] | undefined>;
64
- /** Raw body */
173
+ /**
174
+ * The exact raw request body, preserved for audit trails or re-verification.
175
+ */
65
176
  rawBody: string;
66
- /** Timestamp when received */
177
+ /**
178
+ * The high-precision timestamp when the event was successfully processed by Echo.
179
+ */
67
180
  receivedAt: Date;
68
- /** Webhook ID (if available) */
181
+ /**
182
+ * The unique ID assigned by the upstream service for this event.
183
+ */
69
184
  id?: string;
70
185
  }
71
186
  /**
72
- * Outgoing webhook payload
187
+ * A snapshot of a raw HTTP request before body parsing occurs.
188
+ *
189
+ * This is used by middleware to prevent upstream body parsers from modifying the
190
+ * raw request body, which would otherwise invalidate cryptographic signatures.
191
+ *
192
+ * @public
193
+ */
194
+ export interface BufferedRequest {
195
+ /**
196
+ * The exact raw body as received from the socket.
197
+ */
198
+ rawBody: string | Buffer;
199
+ /**
200
+ * A lazily-evaluated parsed version of the body if requested by handlers.
201
+ */
202
+ parsedBody?: unknown;
203
+ /**
204
+ * The original request headers.
205
+ */
206
+ headers: Record<string, string | string[] | undefined>;
207
+ /**
208
+ * The timestamp when the request entered the buffer.
209
+ */
210
+ bufferedAt: Date;
211
+ }
212
+ /**
213
+ * Operational settings for the request buffering mechanism.
214
+ *
215
+ * @public
216
+ */
217
+ export interface RequestBufferConfig {
218
+ /**
219
+ * Whether to activate the buffering middleware.
220
+ * @defaultValue true
221
+ */
222
+ enabled?: boolean;
223
+ /**
224
+ * The maximum size of the request body allowed to be buffered (in bytes).
225
+ * Prevents memory exhaustion attacks.
226
+ * @defaultValue 10485760 (10MB)
227
+ */
228
+ maxBodySize?: number;
229
+ /**
230
+ * List of MIME types that should bypass the buffering logic.
231
+ * Useful for large file uploads or binary streams.
232
+ * @defaultValue ['multipart/form-data', 'application/octet-stream']
233
+ */
234
+ skipContentTypes?: string[];
235
+ }
236
+ /**
237
+ * The current operational state of a circuit breaker.
238
+ *
239
+ * - `CLOSED`: Healthy state, allowing all requests through.
240
+ * - `OPEN`: Failing state, blocking all requests to prevent cascading failure.
241
+ * - `HALF_OPEN`: Recovery state, allowing a limited number of test requests.
242
+ *
243
+ * @public
244
+ */
245
+ export type CircuitBreakerState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
246
+ /**
247
+ * Resilience configuration for outgoing webhook delivery.
248
+ *
249
+ * Protects downstream consumers from being overwhelmed during outages and prevents
250
+ * the dispatcher from wasting resources on doomed requests.
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * const cbConfig: CircuitBreakerConfig = {
255
+ * failureThreshold: 10,
256
+ * windowSize: 30000, // 30 seconds
257
+ * openTimeout: 60000 // Stay open for 1 minute
258
+ * };
259
+ * ```
260
+ *
261
+ * @public
262
+ */
263
+ export interface CircuitBreakerConfig {
264
+ /**
265
+ * Whether to enable circuit breaking for the dispatcher.
266
+ * @defaultValue true
267
+ */
268
+ enabled?: boolean;
269
+ /**
270
+ * Number of consecutive failures required to trip the circuit to `OPEN`.
271
+ * @defaultValue 5
272
+ */
273
+ failureThreshold?: number;
274
+ /**
275
+ * Number of consecutive successes required in `HALF_OPEN` to return to `CLOSED`.
276
+ * @defaultValue 2
277
+ */
278
+ successThreshold?: number;
279
+ /**
280
+ * The rolling time window (in ms) within which failures are counted.
281
+ * @defaultValue 60000 (1 minute)
282
+ */
283
+ windowSize?: number;
284
+ /**
285
+ * Duration (in ms) to wait in `OPEN` state before transitioning to `HALF_OPEN`.
286
+ * @defaultValue 30000 (30 seconds)
287
+ */
288
+ openTimeout?: number;
289
+ /**
290
+ * Callback executed when the circuit trips to `OPEN`.
291
+ */
292
+ onOpen?: (target: string) => void;
293
+ /**
294
+ * Callback executed when the circuit enters `HALF_OPEN` state.
295
+ */
296
+ onHalfOpen?: (target: string) => void;
297
+ /**
298
+ * Callback executed when the circuit returns to `CLOSED` state.
299
+ */
300
+ onClose?: (target: string) => void;
301
+ }
302
+ /**
303
+ * Real-time operational metrics for a specific circuit breaker instance.
304
+ *
305
+ * Provides visibility into the health and traffic patterns of a downstream
306
+ * webhook target.
307
+ *
308
+ * @public
309
+ */
310
+ export interface CircuitBreakerMetrics {
311
+ /**
312
+ * The current state of the circuit (CLOSED, OPEN, or HALF_OPEN).
313
+ */
314
+ state: CircuitBreakerState;
315
+ /**
316
+ * The total number of failed requests recorded within the current time window.
317
+ */
318
+ failures: number;
319
+ /**
320
+ * The total number of successful requests recorded within the current time window.
321
+ */
322
+ successes: number;
323
+ /**
324
+ * The exact time when the most recent failure occurred.
325
+ */
326
+ lastFailureAt?: Date;
327
+ /**
328
+ * The exact time when the most recent success occurred.
329
+ */
330
+ lastSuccessAt?: Date;
331
+ /**
332
+ * If the circuit is currently `OPEN`, this is the timestamp when it tripped.
333
+ */
334
+ openedAt?: Date;
335
+ }
336
+ /**
337
+ * Metadata and value for a single version of a provider's secret key.
338
+ *
339
+ * Echo supports multiple concurrent keys per provider to facilitate zero-downtime
340
+ * key rotation. The receiver will attempt verification with all active keys.
341
+ *
342
+ * @public
343
+ */
344
+ export interface ProviderKeyEntry {
345
+ /**
346
+ * The raw cryptographic secret key value.
347
+ */
348
+ key: string;
349
+ /**
350
+ * The timestamp when this key becomes eligible for use in verification.
351
+ */
352
+ activeFrom: Date;
353
+ /**
354
+ * The timestamp when this key should no longer be used.
355
+ * If omitted, the key remains valid indefinitely until manually removed.
356
+ */
357
+ expiresAt?: Date;
358
+ /**
359
+ * Whether this key is the primary (current) secret.
360
+ * New configurations or rotations should generally promote a new key to primary.
361
+ */
362
+ isPrimary: boolean;
363
+ /**
364
+ * A unique identifier for this key version (e.g., a timestamp or serial).
365
+ */
366
+ version: string;
367
+ }
368
+ /**
369
+ * Policy settings for managing the lifecycle of webhook secrets.
370
+ *
371
+ * Key rotation allows you to replace compromised or aging secrets without
372
+ * dropping incoming webhooks from services that may still be using the old key.
373
+ *
374
+ * @public
375
+ */
376
+ export interface KeyRotationConfig {
377
+ /**
378
+ * Whether to enable the multi-key verification logic and rotation manager.
379
+ * @defaultValue false
380
+ */
381
+ enabled?: boolean;
382
+ /**
383
+ * Automatically purge keys that have passed their `expiresAt` date.
384
+ * @defaultValue true
385
+ */
386
+ autoCleanup?: boolean;
387
+ /**
388
+ * The duration (in ms) to keep an old key active after a new primary key is promoted.
389
+ * Prevents race conditions during the propagation of the new secret.
390
+ * @defaultValue 86400000 (24 hours)
391
+ */
392
+ gracePeriod?: number;
393
+ /**
394
+ * An optional asynchronous function to fetch keys from an external vault (e.g., AWS Secrets Manager).
395
+ */
396
+ keyProvider?: (providerName: string) => Promise<ProviderKeyEntry[]>;
397
+ /**
398
+ * Callback executed whenever a new key is successfully rotated.
399
+ */
400
+ onRotate?: (providerName: string, newKey: ProviderKeyEntry) => void;
401
+ }
402
+ /**
403
+ * Configuration for a provider that includes advanced key rotation settings.
404
+ *
405
+ * Extends the basic provider configuration with a list of historical and future keys.
406
+ *
407
+ * @public
408
+ */
409
+ export interface WebhookProviderConfigWithRotation extends WebhookProviderConfig {
410
+ /**
411
+ * Collection of valid keys for this provider.
412
+ */
413
+ keys?: ProviderKeyEntry[];
414
+ /**
415
+ * Specific rotation overrides for this provider.
416
+ */
417
+ rotation?: KeyRotationConfig;
418
+ }
419
+ /**
420
+ * Structure representing an intent to dispatch a webhook to an external target.
421
+ *
422
+ * @example
423
+ * ```typescript
424
+ * const payload: WebhookPayload = {
425
+ * url: 'https://customer-api.com/hooks',
426
+ * event: 'order.shipped',
427
+ * data: { trackingNumber: 'XYZ123' },
428
+ * timestamp: new Date()
429
+ * };
430
+ * ```
431
+ *
432
+ * @public
73
433
  */
74
434
  export interface WebhookPayload<T = unknown> {
75
- /** Target URL */
435
+ /**
436
+ * The fully-qualified destination URL for the HTTP POST request.
437
+ */
76
438
  url: string;
77
- /** Event type */
439
+ /**
440
+ * The semantic name of the event being broadcast.
441
+ */
78
442
  event: string;
79
- /** Payload data */
443
+ /**
444
+ * The data payload to be serialized as JSON in the request body.
445
+ */
80
446
  data: T;
81
- /** Optional webhook ID */
447
+ /**
448
+ * An optional unique ID for this specific delivery attempt (for idempotency).
449
+ */
82
450
  id?: string;
83
- /** Optional timestamp */
451
+ /**
452
+ * The timestamp when the underlying event actually occurred.
453
+ */
84
454
  timestamp?: Date;
85
455
  }
86
456
  /**
87
- * Webhook delivery result
457
+ * Detailed outcome of a single webhook delivery attempt.
458
+ *
459
+ * @public
88
460
  */
89
461
  export interface WebhookDeliveryResult {
90
- /** Whether delivery was successful */
462
+ /**
463
+ * True if the destination server returned a success status code (2xx).
464
+ */
91
465
  success: boolean;
92
- /** HTTP status code */
466
+ /**
467
+ * The numeric HTTP status code returned by the target server.
468
+ */
93
469
  statusCode?: number;
94
- /** Response body */
470
+ /**
471
+ * The raw response body returned by the target server.
472
+ */
95
473
  body?: string;
96
- /** Error message if failed */
474
+ /**
475
+ * A descriptive error message if the network request or server returned an error.
476
+ */
97
477
  error?: string;
98
- /** Attempt number */
478
+ /**
479
+ * The sequence number of this delivery attempt (starts at 1).
480
+ */
99
481
  attempt: number;
100
- /** Time taken in ms */
482
+ /**
483
+ * Total wall-clock time taken for the HTTP request in milliseconds.
484
+ */
101
485
  duration: number;
102
- /** Timestamp */
486
+ /**
487
+ * The exact timestamp when this delivery result was recorded.
488
+ */
103
489
  deliveredAt: Date;
104
490
  }
105
491
  /**
106
- * Retry strategy configuration
492
+ * Strategy settings for handling failed delivery attempts with exponential backoff.
493
+ *
494
+ * @public
107
495
  */
108
496
  export interface RetryConfig {
109
- /** Maximum retry attempts (default: 3) */
497
+ /**
498
+ * Maximum number of times to try delivering the webhook before giving up.
499
+ * @defaultValue 3
500
+ */
110
501
  maxAttempts?: number;
111
- /** Initial delay in ms (default: 1000) */
502
+ /**
503
+ * Initial delay (in ms) before the first retry attempt.
504
+ * @defaultValue 1000
505
+ */
112
506
  initialDelay?: number;
113
- /** Backoff multiplier (default: 2) */
507
+ /**
508
+ * The factor by which the delay increases after each failed attempt.
509
+ * @defaultValue 2
510
+ */
114
511
  backoffMultiplier?: number;
115
- /** Maximum delay in ms (default: 300000 = 5 minutes) */
512
+ /**
513
+ * The absolute maximum delay (in ms) between retry attempts.
514
+ * @defaultValue 300000 (5 minutes)
515
+ */
116
516
  maxDelay?: number;
117
- /** HTTP status codes to retry (default: [408, 429, 500, 502, 503, 504]) */
517
+ /**
518
+ * List of HTTP status codes that should trigger a retry attempt.
519
+ * Codes not in this list (like 400 Bad Request) are considered terminal failures.
520
+ *
521
+ * @example [500, 502, 503, 504, 429]
522
+ */
118
523
  retryableStatuses?: number[];
119
524
  }
120
525
  /**
121
- * Webhook dispatcher configuration
526
+ * Security and policy configuration for the outgoing webhook dispatcher.
527
+ *
528
+ * Use this interface to define how your application signs and delivers events
529
+ * to external consumers, ensuring both reliability and authenticity.
530
+ *
531
+ * @public
122
532
  */
123
533
  export interface WebhookDispatcherConfig {
124
- /** Secret for signing outgoing webhooks */
534
+ /**
535
+ * Global secret key used to sign all outgoing webhook payloads.
536
+ * Consumers use this to verify the request originated from your application.
537
+ */
125
538
  secret: string;
126
- /** Retry configuration */
539
+ /**
540
+ * Custom retry policy for handling transient delivery failures.
541
+ */
127
542
  retry?: RetryConfig;
128
- /** Request timeout in ms (default: 30000) */
543
+ /**
544
+ * The maximum time (in ms) to wait for the target server to respond.
545
+ * @defaultValue 30000
546
+ */
129
547
  timeout?: number;
130
- /** User agent string */
548
+ /**
549
+ * Custom string sent in the `User-Agent` HTTP header.
550
+ */
131
551
  userAgent?: string;
552
+ /**
553
+ * Operational settings for the circuit breaker mechanism.
554
+ * @since v1.1
555
+ */
556
+ circuitBreaker?: CircuitBreakerConfig;
557
+ }
558
+ /**
559
+ * Execution parameters for parallel or high-volume webhook dispatch operations.
560
+ *
561
+ * @public
562
+ */
563
+ export interface BatchDispatchOptions {
564
+ /**
565
+ * The maximum number of requests to execute simultaneously.
566
+ * Balancing performance vs. source/target rate limits.
567
+ * @defaultValue 5
568
+ */
569
+ concurrency?: number;
570
+ /**
571
+ * If true, the batch process will abort immediately if any single delivery fails.
572
+ * @defaultValue false
573
+ */
574
+ stopOnFirstFailure?: boolean;
132
575
  }
133
576
  /**
134
- * OrbitEcho module configuration
577
+ * Detailed report of a batch dispatch operation's success and failure rates.
578
+ *
579
+ * @public
580
+ */
581
+ export interface BatchDispatchResult {
582
+ /**
583
+ * The total number of webhook payloads processed in this batch.
584
+ */
585
+ total: number;
586
+ /**
587
+ * Number of payloads that were successfully delivered (HTTP 2xx).
588
+ */
589
+ succeeded: number;
590
+ /**
591
+ * Number of payloads that failed delivery after all retries.
592
+ */
593
+ failed: number;
594
+ /**
595
+ * Individual delivery results mapped to their corresponding payloads.
596
+ */
597
+ results: Array<{
598
+ payload: WebhookPayload;
599
+ result: WebhookDeliveryResult;
600
+ }>;
601
+ }
602
+ /**
603
+ * Filter and execution parameters for replaying historical webhook events.
604
+ *
605
+ * Replay is useful for testing, recovery from consumer outages, or
606
+ * synchronizing data after a code update.
607
+ *
608
+ * @public
609
+ */
610
+ export interface ReplayOptions {
611
+ /**
612
+ * Specific event IDs to re-send. If provided, other filters are ignored.
613
+ */
614
+ eventIds?: string[];
615
+ /**
616
+ * Temporal range for selecting events from storage.
617
+ */
618
+ timeRange?: {
619
+ from: Date;
620
+ to: Date;
621
+ };
622
+ /**
623
+ * Limit replay to a specific provider instance.
624
+ */
625
+ provider?: string;
626
+ /**
627
+ * Limit replay to a specific semantic event type.
628
+ */
629
+ eventType?: string;
630
+ /**
631
+ * If true, logs the actions without actually sending any network requests.
632
+ */
633
+ dryRun?: boolean;
634
+ /**
635
+ * Redirect the replayed events to a different URL instead of the original one.
636
+ */
637
+ targetUrl?: string;
638
+ }
639
+ /**
640
+ * Summary outcome of a mass event replay operation.
641
+ *
642
+ * @public
643
+ */
644
+ export interface ReplayResult {
645
+ /**
646
+ * Total number of events matching the replay filters.
647
+ */
648
+ total: number;
649
+ /**
650
+ * Number of events that were successfully re-dispatched.
651
+ */
652
+ replayed: number;
653
+ /**
654
+ * Number of events that were intentionally skipped (e.g., due to duplicate filters).
655
+ */
656
+ skipped: number;
657
+ /**
658
+ * Number of events that encountered errors during the replay attempt.
659
+ */
660
+ failed: number;
661
+ /**
662
+ * Detailed audit log for each event considered in the replay.
663
+ */
664
+ events: Array<{
665
+ eventId: string;
666
+ status: 'replayed' | 'skipped' | 'failed';
667
+ result?: WebhookDeliveryResult;
668
+ error?: string;
669
+ }>;
670
+ }
671
+ /**
672
+ * Integration points for external monitoring and diagnostic tools.
673
+ *
674
+ * Echo is designed to be fully observable, allowing you to plug in
675
+ * Prometheus, OpenTelemetry, or custom logging solutions.
676
+ *
677
+ * @public
678
+ */
679
+ export interface EchoObservabilityConfig {
680
+ /**
681
+ * Provider for collecting counters, histograms, and health metrics.
682
+ */
683
+ metrics?: MetricsProvider;
684
+ /**
685
+ * Distributed tracer for tracking the full lifecycle of a webhook request.
686
+ */
687
+ tracer?: Tracer;
688
+ /**
689
+ * Logger for recording security events and operational warnings.
690
+ */
691
+ logger?: EchoLogger;
692
+ }
693
+ /**
694
+ * The root configuration object for the OrbitEcho module.
695
+ *
696
+ * This structure defines the entire security, reliability, and persistence
697
+ * architecture for webhooks within a Gravito application.
698
+ *
699
+ * @example
700
+ * ```typescript
701
+ * const echoConfig: EchoConfig = {
702
+ * providers: {
703
+ * stripe: { name: 'stripe', secret: 'whsec_...' }
704
+ * },
705
+ * dispatcher: {
706
+ * secret: 'my-app-outbound-secret',
707
+ * retry: { maxAttempts: 5 }
708
+ * },
709
+ * store: new MyDatabaseStore(),
710
+ * basePath: '/v1/webhooks'
711
+ * };
712
+ * ```
713
+ *
714
+ * @public
135
715
  */
136
716
  export interface EchoConfig {
137
- /** Registered webhook providers */
138
- providers?: Record<string, WebhookProviderConfig>;
139
- /** Dispatcher configuration for outgoing webhooks */
717
+ /**
718
+ * A registry of named provider configurations for authenticating incoming events.
719
+ */
720
+ providers?: Record<string, WebhookProviderConfig | WebhookProviderConfigWithRotation>;
721
+ /**
722
+ * Settings for signing and reliably delivering outgoing webhooks.
723
+ */
140
724
  dispatcher?: WebhookDispatcherConfig;
141
- /** Base path for webhook endpoints (default: '/webhooks') */
725
+ /**
726
+ * The root URL path where Echo will mount its internal webhook handlers.
727
+ * @defaultValue '/webhooks'
728
+ */
142
729
  basePath?: string;
730
+ /**
731
+ * The persistence engine used for auditing, idempotency, and replay.
732
+ */
733
+ store?: WebhookStore;
734
+ /**
735
+ * The queue implementation for handling permanently failed events.
736
+ */
737
+ deadLetterQueue?: DeadLetterQueue;
738
+ /**
739
+ * Default performance and concurrency settings for bulk operations.
740
+ */
741
+ batch?: BatchDispatchOptions;
742
+ /**
743
+ * Settings for metrics, tracing, and logging.
744
+ */
745
+ observability?: EchoObservabilityConfig;
746
+ /**
747
+ * Advanced middleware settings for body preservation and integrity.
748
+ * @since 1.1.0
749
+ */
750
+ requestBuffer?: RequestBufferConfig;
751
+ /**
752
+ * Central policy settings for dynamic secret lifecycle management.
753
+ * @since 1.2.0
754
+ */
755
+ keyRotation?: KeyRotationConfig;
143
756
  }
144
- //# sourceMappingURL=types.d.ts.map