@aws/durable-execution-sdk-js 0.0.0 → 1.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 (282) hide show
  1. package/README.md +412 -0
  2. package/dist/index.mjs +4771 -0
  3. package/dist/index.mjs.map +1 -0
  4. package/dist-cjs/index.js +4789 -0
  5. package/dist-cjs/index.js.map +1 -0
  6. package/dist-types/context/durable-context/durable-context.d.ts +76 -0
  7. package/dist-types/context/durable-context/durable-context.d.ts.map +1 -0
  8. package/dist-types/context/durable-context/durable-context.integration.test.d.ts +2 -0
  9. package/dist-types/context/durable-context/durable-context.integration.test.d.ts.map +1 -0
  10. package/dist-types/context/durable-context/durable-context.unit.test.d.ts +2 -0
  11. package/dist-types/context/durable-context/durable-context.unit.test.d.ts.map +1 -0
  12. package/dist-types/context/durable-context/logger-mode-aware.test.d.ts +2 -0
  13. package/dist-types/context/durable-context/logger-mode-aware.test.d.ts.map +1 -0
  14. package/dist-types/context/durable-context/logger-property.test.d.ts +2 -0
  15. package/dist-types/context/durable-context/logger-property.test.d.ts.map +1 -0
  16. package/dist-types/context/durable-context/mode-management/mode-management.d.ts +13 -0
  17. package/dist-types/context/durable-context/mode-management/mode-management.d.ts.map +1 -0
  18. package/dist-types/context/durable-context/mode-management/mode-management.test.d.ts +2 -0
  19. package/dist-types/context/durable-context/mode-management/mode-management.test.d.ts.map +1 -0
  20. package/dist-types/context/execution-context/execution-context.d.ts +9 -0
  21. package/dist-types/context/execution-context/execution-context.d.ts.map +1 -0
  22. package/dist-types/context/execution-context/execution-context.test.d.ts +2 -0
  23. package/dist-types/context/execution-context/execution-context.test.d.ts.map +1 -0
  24. package/dist-types/durable-execution-api-client/durable-execution-api-client-caching.test.d.ts +2 -0
  25. package/dist-types/durable-execution-api-client/durable-execution-api-client-caching.test.d.ts.map +1 -0
  26. package/dist-types/durable-execution-api-client/durable-execution-api-client.d.ts +29 -0
  27. package/dist-types/durable-execution-api-client/durable-execution-api-client.d.ts.map +1 -0
  28. package/dist-types/durable-execution-api-client/durable-execution-api-client.test.d.ts +2 -0
  29. package/dist-types/durable-execution-api-client/durable-execution-api-client.test.d.ts.map +1 -0
  30. package/dist-types/errors/callback-error/callback-error.test.d.ts +2 -0
  31. package/dist-types/errors/callback-error/callback-error.test.d.ts.map +1 -0
  32. package/dist-types/errors/checkpoint-errors/checkpoint-errors.d.ts +21 -0
  33. package/dist-types/errors/checkpoint-errors/checkpoint-errors.d.ts.map +1 -0
  34. package/dist-types/errors/checkpoint-errors/checkpoint-errors.test.d.ts +2 -0
  35. package/dist-types/errors/checkpoint-errors/checkpoint-errors.test.d.ts.map +1 -0
  36. package/dist-types/errors/durable-error/durable-error-coverage.test.d.ts +2 -0
  37. package/dist-types/errors/durable-error/durable-error-coverage.test.d.ts.map +1 -0
  38. package/dist-types/errors/durable-error/durable-error.d.ts +55 -0
  39. package/dist-types/errors/durable-error/durable-error.d.ts.map +1 -0
  40. package/dist-types/errors/durable-error/durable-error.test.d.ts +2 -0
  41. package/dist-types/errors/durable-error/durable-error.test.d.ts.map +1 -0
  42. package/dist-types/errors/durable-error/error-determinism.integration.test.d.ts +2 -0
  43. package/dist-types/errors/durable-error/error-determinism.integration.test.d.ts.map +1 -0
  44. package/dist-types/errors/non-deterministic-error/non-deterministic-error.d.ts +10 -0
  45. package/dist-types/errors/non-deterministic-error/non-deterministic-error.d.ts.map +1 -0
  46. package/dist-types/errors/serdes-errors/serdes-errors.d.ts +27 -0
  47. package/dist-types/errors/serdes-errors/serdes-errors.d.ts.map +1 -0
  48. package/dist-types/errors/serdes-errors/serdes-errors.test.d.ts +2 -0
  49. package/dist-types/errors/serdes-errors/serdes-errors.test.d.ts.map +1 -0
  50. package/dist-types/errors/step-errors/step-errors.d.ts +8 -0
  51. package/dist-types/errors/step-errors/step-errors.d.ts.map +1 -0
  52. package/dist-types/errors/unrecoverable-error/unrecoverable-error.d.ts +41 -0
  53. package/dist-types/errors/unrecoverable-error/unrecoverable-error.d.ts.map +1 -0
  54. package/dist-types/errors/unrecoverable-error/unrecoverable-error.test.d.ts +2 -0
  55. package/dist-types/errors/unrecoverable-error/unrecoverable-error.test.d.ts.map +1 -0
  56. package/dist-types/handlers/callback-handler/callback-promise.d.ts +5 -0
  57. package/dist-types/handlers/callback-handler/callback-promise.d.ts.map +1 -0
  58. package/dist-types/handlers/callback-handler/callback-promise.test.d.ts +2 -0
  59. package/dist-types/handlers/callback-handler/callback-promise.test.d.ts.map +1 -0
  60. package/dist-types/handlers/callback-handler/callback.d.ts +7 -0
  61. package/dist-types/handlers/callback-handler/callback.d.ts.map +1 -0
  62. package/dist-types/handlers/callback-handler/callback.test.d.ts +2 -0
  63. package/dist-types/handlers/callback-handler/callback.test.d.ts.map +1 -0
  64. package/dist-types/handlers/concurrent-execution-handler/batch-result.d.ts +35 -0
  65. package/dist-types/handlers/concurrent-execution-handler/batch-result.d.ts.map +1 -0
  66. package/dist-types/handlers/concurrent-execution-handler/batch-result.test.d.ts +2 -0
  67. package/dist-types/handlers/concurrent-execution-handler/batch-result.test.d.ts.map +1 -0
  68. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler-two-phase.test.d.ts +2 -0
  69. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler-two-phase.test.d.ts.map +1 -0
  70. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.d.ts +12 -0
  71. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.d.ts.map +1 -0
  72. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.integration.test.d.ts +2 -0
  73. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.integration.test.d.ts.map +1 -0
  74. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.replay.test.d.ts +2 -0
  75. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.replay.test.d.ts.map +1 -0
  76. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.test.d.ts +2 -0
  77. package/dist-types/handlers/concurrent-execution-handler/concurrent-execution-handler.test.d.ts.map +1 -0
  78. package/dist-types/handlers/invoke-handler/invoke-handler-two-phase.test.d.ts +2 -0
  79. package/dist-types/handlers/invoke-handler/invoke-handler-two-phase.test.d.ts.map +1 -0
  80. package/dist-types/handlers/invoke-handler/invoke-handler.d.ts +8 -0
  81. package/dist-types/handlers/invoke-handler/invoke-handler.d.ts.map +1 -0
  82. package/dist-types/handlers/invoke-handler/invoke-handler.test.d.ts +2 -0
  83. package/dist-types/handlers/invoke-handler/invoke-handler.test.d.ts.map +1 -0
  84. package/dist-types/handlers/map-handler/map-handler-two-phase.test.d.ts +2 -0
  85. package/dist-types/handlers/map-handler/map-handler-two-phase.test.d.ts.map +1 -0
  86. package/dist-types/handlers/map-handler/map-handler.d.ts +3 -0
  87. package/dist-types/handlers/map-handler/map-handler.d.ts.map +1 -0
  88. package/dist-types/handlers/map-handler/map-handler.test.d.ts +2 -0
  89. package/dist-types/handlers/map-handler/map-handler.test.d.ts.map +1 -0
  90. package/dist-types/handlers/parallel-handler/parallel-handler-two-phase.test.d.ts +2 -0
  91. package/dist-types/handlers/parallel-handler/parallel-handler-two-phase.test.d.ts.map +1 -0
  92. package/dist-types/handlers/parallel-handler/parallel-handler.d.ts +3 -0
  93. package/dist-types/handlers/parallel-handler/parallel-handler.d.ts.map +1 -0
  94. package/dist-types/handlers/parallel-handler/parallel-handler.test.d.ts +2 -0
  95. package/dist-types/handlers/parallel-handler/parallel-handler.test.d.ts.map +1 -0
  96. package/dist-types/handlers/promise-handler/promise-handler.d.ts +8 -0
  97. package/dist-types/handlers/promise-handler/promise-handler.d.ts.map +1 -0
  98. package/dist-types/handlers/promise-handler/promise-handler.test.d.ts +2 -0
  99. package/dist-types/handlers/promise-handler/promise-handler.test.d.ts.map +1 -0
  100. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler-two-phase.test.d.ts +2 -0
  101. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler-two-phase.test.d.ts.map +1 -0
  102. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler.d.ts +10 -0
  103. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler.d.ts.map +1 -0
  104. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler.test.d.ts +2 -0
  105. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-handler.test.d.ts.map +1 -0
  106. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-integration.test.d.ts +2 -0
  107. package/dist-types/handlers/run-in-child-context-handler/run-in-child-context-integration.test.d.ts.map +1 -0
  108. package/dist-types/handlers/step-handler/step-handler-two-phase.test.d.ts +2 -0
  109. package/dist-types/handlers/step-handler/step-handler-two-phase.test.d.ts.map +1 -0
  110. package/dist-types/handlers/step-handler/step-handler.d.ts +14 -0
  111. package/dist-types/handlers/step-handler/step-handler.d.ts.map +1 -0
  112. package/dist-types/handlers/step-handler/step-handler.test.d.ts +2 -0
  113. package/dist-types/handlers/step-handler/step-handler.test.d.ts.map +1 -0
  114. package/dist-types/handlers/step-handler/step-handler.timing.test.d.ts +2 -0
  115. package/dist-types/handlers/step-handler/step-handler.timing.test.d.ts.map +1 -0
  116. package/dist-types/handlers/wait-for-callback-handler/wait-for-callback-handler.d.ts +3 -0
  117. package/dist-types/handlers/wait-for-callback-handler/wait-for-callback-handler.d.ts.map +1 -0
  118. package/dist-types/handlers/wait-for-callback-handler/wait-for-callback-handler.test.d.ts +2 -0
  119. package/dist-types/handlers/wait-for-callback-handler/wait-for-callback-handler.test.d.ts.map +1 -0
  120. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler-two-phase.test.d.ts +2 -0
  121. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler-two-phase.test.d.ts.map +1 -0
  122. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.d.ts +10 -0
  123. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.d.ts.map +1 -0
  124. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.test.d.ts +2 -0
  125. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.test.d.ts.map +1 -0
  126. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.timing.test.d.ts +2 -0
  127. package/dist-types/handlers/wait-for-condition-handler/wait-for-condition-handler.timing.test.d.ts.map +1 -0
  128. package/dist-types/handlers/wait-handler/wait-handler-two-phase.test.d.ts +2 -0
  129. package/dist-types/handlers/wait-handler/wait-handler-two-phase.test.d.ts.map +1 -0
  130. package/dist-types/handlers/wait-handler/wait-handler.d.ts +9 -0
  131. package/dist-types/handlers/wait-handler/wait-handler.d.ts.map +1 -0
  132. package/dist-types/handlers/wait-handler/wait-handler.test.d.ts +2 -0
  133. package/dist-types/handlers/wait-handler/wait-handler.test.d.ts.map +1 -0
  134. package/dist-types/index.d.ts +12 -0
  135. package/dist-types/index.d.ts.map +1 -0
  136. package/dist-types/run-durable.d.ts +2 -0
  137. package/dist-types/run-durable.d.ts.map +1 -0
  138. package/dist-types/termination-manager/termination-manager-checkpoint.test.d.ts +2 -0
  139. package/dist-types/termination-manager/termination-manager-checkpoint.test.d.ts.map +1 -0
  140. package/dist-types/termination-manager/termination-manager.d.ts +15 -0
  141. package/dist-types/termination-manager/termination-manager.d.ts.map +1 -0
  142. package/dist-types/termination-manager/termination-manager.test.d.ts +2 -0
  143. package/dist-types/termination-manager/termination-manager.test.d.ts.map +1 -0
  144. package/dist-types/termination-manager/types.d.ts +26 -0
  145. package/dist-types/termination-manager/types.d.ts.map +1 -0
  146. package/dist-types/testing/create-test-checkpoint-manager.d.ts +5 -0
  147. package/dist-types/testing/create-test-checkpoint-manager.d.ts.map +1 -0
  148. package/dist-types/testing/create-test-durable-context.d.ts +32 -0
  149. package/dist-types/testing/create-test-durable-context.d.ts.map +1 -0
  150. package/dist-types/testing/mock-batch-result.d.ts +26 -0
  151. package/dist-types/testing/mock-batch-result.d.ts.map +1 -0
  152. package/dist-types/testing/mock-checkpoint-manager.d.ts +21 -0
  153. package/dist-types/testing/mock-checkpoint-manager.d.ts.map +1 -0
  154. package/dist-types/testing/mock-checkpoint.d.ts +12 -0
  155. package/dist-types/testing/mock-checkpoint.d.ts.map +1 -0
  156. package/dist-types/testing/mock-context.d.ts +10 -0
  157. package/dist-types/testing/mock-context.d.ts.map +1 -0
  158. package/dist-types/testing/test-constants.d.ts +59 -0
  159. package/dist-types/testing/test-constants.d.ts.map +1 -0
  160. package/dist-types/types/batch.d.ts +177 -0
  161. package/dist-types/types/batch.d.ts.map +1 -0
  162. package/dist-types/types/callback.d.ts +48 -0
  163. package/dist-types/types/callback.d.ts.map +1 -0
  164. package/dist-types/types/child-context.d.ts +24 -0
  165. package/dist-types/types/child-context.d.ts.map +1 -0
  166. package/dist-types/types/core.d.ts +315 -0
  167. package/dist-types/types/core.d.ts.map +1 -0
  168. package/dist-types/types/durable-context.d.ts +667 -0
  169. package/dist-types/types/durable-context.d.ts.map +1 -0
  170. package/dist-types/types/durable-execution.d.ts +192 -0
  171. package/dist-types/types/durable-execution.d.ts.map +1 -0
  172. package/dist-types/types/durable-logger.d.ts +69 -0
  173. package/dist-types/types/durable-logger.d.ts.map +1 -0
  174. package/dist-types/types/durable-promise.d.ts +80 -0
  175. package/dist-types/types/durable-promise.d.ts.map +1 -0
  176. package/dist-types/types/index.d.ts +13 -0
  177. package/dist-types/types/index.d.ts.map +1 -0
  178. package/dist-types/types/invoke.d.ts +12 -0
  179. package/dist-types/types/invoke.d.ts.map +1 -0
  180. package/dist-types/types/logger.d.ts +63 -0
  181. package/dist-types/types/logger.d.ts.map +1 -0
  182. package/dist-types/types/step.d.ts +76 -0
  183. package/dist-types/types/step.d.ts.map +1 -0
  184. package/dist-types/types/wait-condition.d.ts +46 -0
  185. package/dist-types/types/wait-condition.d.ts.map +1 -0
  186. package/dist-types/utils/checkpoint/checkpoint-ancestor-checking.test.d.ts +2 -0
  187. package/dist-types/utils/checkpoint/checkpoint-ancestor-checking.test.d.ts.map +1 -0
  188. package/dist-types/utils/checkpoint/checkpoint-error-classification.test.d.ts +2 -0
  189. package/dist-types/utils/checkpoint/checkpoint-error-classification.test.d.ts.map +1 -0
  190. package/dist-types/utils/checkpoint/checkpoint-helper.d.ts +10 -0
  191. package/dist-types/utils/checkpoint/checkpoint-helper.d.ts.map +1 -0
  192. package/dist-types/utils/checkpoint/checkpoint-integration.test.d.ts +2 -0
  193. package/dist-types/utils/checkpoint/checkpoint-integration.test.d.ts.map +1 -0
  194. package/dist-types/utils/checkpoint/checkpoint-manager.d.ts +53 -0
  195. package/dist-types/utils/checkpoint/checkpoint-manager.d.ts.map +1 -0
  196. package/dist-types/utils/checkpoint/checkpoint-queue-completion.test.d.ts +2 -0
  197. package/dist-types/utils/checkpoint/checkpoint-queue-completion.test.d.ts.map +1 -0
  198. package/dist-types/utils/checkpoint/checkpoint-stepdata-update.test.d.ts +2 -0
  199. package/dist-types/utils/checkpoint/checkpoint-stepdata-update.test.d.ts.map +1 -0
  200. package/dist-types/utils/checkpoint/checkpoint-termination.test.d.ts +2 -0
  201. package/dist-types/utils/checkpoint/checkpoint-termination.test.d.ts.map +1 -0
  202. package/dist-types/utils/checkpoint/checkpoint.test.d.ts +2 -0
  203. package/dist-types/utils/checkpoint/checkpoint.test.d.ts.map +1 -0
  204. package/dist-types/utils/constants/constants.d.ts +10 -0
  205. package/dist-types/utils/constants/constants.d.ts.map +1 -0
  206. package/dist-types/utils/context-tracker/context-tracker.d.ts +13 -0
  207. package/dist-types/utils/context-tracker/context-tracker.d.ts.map +1 -0
  208. package/dist-types/utils/context-tracker/context-tracker.test.d.ts +2 -0
  209. package/dist-types/utils/context-tracker/context-tracker.test.d.ts.map +1 -0
  210. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts +20 -0
  211. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts.map +1 -0
  212. package/dist-types/utils/duration/duration.d.ts +8 -0
  213. package/dist-types/utils/duration/duration.d.ts.map +1 -0
  214. package/dist-types/utils/duration/duration.test.d.ts +2 -0
  215. package/dist-types/utils/duration/duration.test.d.ts.map +1 -0
  216. package/dist-types/utils/error-object/error-object-coverage.test.d.ts +2 -0
  217. package/dist-types/utils/error-object/error-object-coverage.test.d.ts.map +1 -0
  218. package/dist-types/utils/error-object/error-object.d.ts +3 -0
  219. package/dist-types/utils/error-object/error-object.d.ts.map +1 -0
  220. package/dist-types/utils/error-object/error-object.test.d.ts +2 -0
  221. package/dist-types/utils/error-object/error-object.test.d.ts.map +1 -0
  222. package/dist-types/utils/logger/default-logger.d.ts +51 -0
  223. package/dist-types/utils/logger/default-logger.d.ts.map +1 -0
  224. package/dist-types/utils/logger/default-logger.test.d.ts +2 -0
  225. package/dist-types/utils/logger/default-logger.test.d.ts.map +1 -0
  226. package/dist-types/utils/logger/logger.d.ts +2 -0
  227. package/dist-types/utils/logger/logger.d.ts.map +1 -0
  228. package/dist-types/utils/logger/logger.test.d.ts +2 -0
  229. package/dist-types/utils/logger/logger.test.d.ts.map +1 -0
  230. package/dist-types/utils/logger/structured-logger-integration.test.d.ts +2 -0
  231. package/dist-types/utils/logger/structured-logger-integration.test.d.ts.map +1 -0
  232. package/dist-types/utils/replay-validation/replay-validation.d.ts +8 -0
  233. package/dist-types/utils/replay-validation/replay-validation.d.ts.map +1 -0
  234. package/dist-types/utils/replay-validation/replay-validation.test.d.ts +2 -0
  235. package/dist-types/utils/replay-validation/replay-validation.test.d.ts.map +1 -0
  236. package/dist-types/utils/retry/retry-config/index.d.ts +167 -0
  237. package/dist-types/utils/retry/retry-config/index.d.ts.map +1 -0
  238. package/dist-types/utils/retry/retry-config/index.test.d.ts +2 -0
  239. package/dist-types/utils/retry/retry-config/index.test.d.ts.map +1 -0
  240. package/dist-types/utils/retry/retry-presets/retry-presets.d.ts +35 -0
  241. package/dist-types/utils/retry/retry-presets/retry-presets.d.ts.map +1 -0
  242. package/dist-types/utils/safe-stringify/safe-stringify.d.ts +2 -0
  243. package/dist-types/utils/safe-stringify/safe-stringify.d.ts.map +1 -0
  244. package/dist-types/utils/safe-stringify/safe-stringify.test.d.ts +2 -0
  245. package/dist-types/utils/safe-stringify/safe-stringify.test.d.ts.map +1 -0
  246. package/dist-types/utils/serdes/serdes.d.ts +152 -0
  247. package/dist-types/utils/serdes/serdes.d.ts.map +1 -0
  248. package/dist-types/utils/serdes/serdes.test.d.ts +2 -0
  249. package/dist-types/utils/serdes/serdes.test.d.ts.map +1 -0
  250. package/dist-types/utils/step-id-utils/step-id-utils.d.ts +16 -0
  251. package/dist-types/utils/step-id-utils/step-id-utils.d.ts.map +1 -0
  252. package/dist-types/utils/step-id-utils/step-id-utils.test.d.ts +2 -0
  253. package/dist-types/utils/step-id-utils/step-id-utils.test.d.ts.map +1 -0
  254. package/dist-types/utils/summary-generators/summary-generators.d.ts +10 -0
  255. package/dist-types/utils/summary-generators/summary-generators.d.ts.map +1 -0
  256. package/dist-types/utils/summary-generators/summary-generators.test.d.ts +2 -0
  257. package/dist-types/utils/summary-generators/summary-generators.test.d.ts.map +1 -0
  258. package/dist-types/utils/termination-helper/active-operations-tracker.d.ts +31 -0
  259. package/dist-types/utils/termination-helper/active-operations-tracker.d.ts.map +1 -0
  260. package/dist-types/utils/termination-helper/active-operations-tracker.test.d.ts +2 -0
  261. package/dist-types/utils/termination-helper/active-operations-tracker.test.d.ts.map +1 -0
  262. package/dist-types/utils/termination-helper/termination-deferral.test.d.ts +2 -0
  263. package/dist-types/utils/termination-helper/termination-deferral.test.d.ts.map +1 -0
  264. package/dist-types/utils/termination-helper/termination-helper.d.ts +20 -0
  265. package/dist-types/utils/termination-helper/termination-helper.d.ts.map +1 -0
  266. package/dist-types/utils/termination-helper/termination-helper.test.d.ts +2 -0
  267. package/dist-types/utils/termination-helper/termination-helper.test.d.ts.map +1 -0
  268. package/dist-types/utils/wait-before-continue/wait-before-continue.d.ts +35 -0
  269. package/dist-types/utils/wait-before-continue/wait-before-continue.d.ts.map +1 -0
  270. package/dist-types/utils/wait-before-continue/wait-before-continue.test.d.ts +2 -0
  271. package/dist-types/utils/wait-before-continue/wait-before-continue.test.d.ts.map +1 -0
  272. package/dist-types/utils/wait-strategy/wait-strategy-config.d.ts +19 -0
  273. package/dist-types/utils/wait-strategy/wait-strategy-config.d.ts.map +1 -0
  274. package/dist-types/utils/wait-strategy/wait-strategy-config.test.d.ts +2 -0
  275. package/dist-types/utils/wait-strategy/wait-strategy-config.test.d.ts.map +1 -0
  276. package/dist-types/with-durable-execution-queue-completion.test.d.ts +2 -0
  277. package/dist-types/with-durable-execution-queue-completion.test.d.ts.map +1 -0
  278. package/dist-types/with-durable-execution.d.ts +75 -0
  279. package/dist-types/with-durable-execution.d.ts.map +1 -0
  280. package/dist-types/with-durable-execution.test.d.ts +2 -0
  281. package/dist-types/with-durable-execution.test.d.ts.map +1 -0
  282. package/package.json +64 -3
@@ -0,0 +1,53 @@
1
+ import { OperationUpdate, Operation } from "@aws-sdk/client-lambda";
2
+ import { DurableExecutionClient } from "../../types/durable-execution";
3
+ import { TerminationManager } from "../../termination-manager/termination-manager";
4
+ import { EventEmitter } from "events";
5
+ import { DurableLogger } from "../../types/durable-logger";
6
+ import { Checkpoint } from "./checkpoint-helper";
7
+ export declare const STEP_DATA_UPDATED_EVENT = "stepDataUpdated";
8
+ interface ActiveOperationsTracker {
9
+ increment(): void;
10
+ decrement(): void;
11
+ }
12
+ export declare class CheckpointManager implements Checkpoint {
13
+ private durableExecutionArn;
14
+ private stepData;
15
+ private storage;
16
+ private terminationManager;
17
+ private activeOperationsTracker;
18
+ private stepDataEmitter;
19
+ private logger;
20
+ private pendingCompletions;
21
+ private queue;
22
+ private isProcessing;
23
+ private currentTaskToken;
24
+ private forceCheckpointPromises;
25
+ private queueCompletionResolver;
26
+ private queueCompletionTimeout;
27
+ private readonly MAX_PAYLOAD_SIZE;
28
+ private isTerminating;
29
+ private static textEncoder;
30
+ constructor(durableExecutionArn: string, stepData: Record<string, Operation>, storage: DurableExecutionClient, terminationManager: TerminationManager, activeOperationsTracker: ActiveOperationsTracker | undefined, initialTaskToken: string, stepDataEmitter: EventEmitter, logger: DurableLogger, pendingCompletions: Set<string>);
31
+ setTerminating(): void;
32
+ /**
33
+ * Checks if a step ID or any of its ancestors has a pending completion
34
+ */
35
+ hasPendingAncestorCompletion(stepId: string): boolean;
36
+ forceCheckpoint(): Promise<void>;
37
+ waitForQueueCompletion(): Promise<void>;
38
+ clearQueue(): void;
39
+ force(): Promise<void>;
40
+ checkpoint(stepId: string, data: Partial<OperationUpdate>): Promise<void>;
41
+ private hasFinishedAncestor;
42
+ private classifyCheckpointError;
43
+ private processQueue;
44
+ private notifyQueueCompletion;
45
+ private processBatch;
46
+ private updateStepDataFromCheckpointResponse;
47
+ getQueueStatus(): {
48
+ queueLength: number;
49
+ isProcessing: boolean;
50
+ };
51
+ }
52
+ export {};
53
+ //# sourceMappingURL=checkpoint-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-manager.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,SAAS,EAGV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAGnF,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAKtC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,uBAAuB,oBAAoB,CAAC;AASzD,UAAU,uBAAuB;IAC/B,SAAS,IAAI,IAAI,CAAC;IAClB,SAAS,IAAI,IAAI,CAAC;CACnB;AAED,qBAAa,iBAAkB,YAAW,UAAU;IAehD,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,uBAAuB;IAE/B,OAAO,CAAC,eAAe;IACvB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,kBAAkB;IAtB5B,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,uBAAuB,CAGvB;IACR,OAAO,CAAC,uBAAuB,CAA6B;IAC5D,OAAO,CAAC,sBAAsB,CAA+B;IAC7D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAc;IAC/C,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,MAAM,CAAC,WAAW,CAAqB;gBAGrC,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,EACnC,OAAO,EAAE,sBAAsB,EAC/B,kBAAkB,EAAE,kBAAkB,EACtC,uBAAuB,EAAE,uBAAuB,GAAG,SAAS,EACpE,gBAAgB,EAAE,MAAM,EAChB,eAAe,EAAE,YAAY,EAC7B,MAAM,EAAE,aAAa,EACrB,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC;IAKzC,cAAc,IAAI,IAAI;IAKtB;;OAEG;IACH,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAe/C,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBhC,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBtC,UAAU,IAAI,IAAI;IASnB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,UAAU,CACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAC7B,OAAO,CAAC,IAAI,CAAC;IAmDhB,OAAO,CAAC,mBAAmB;IAwB3B,OAAO,CAAC,uBAAuB;YAuDjB,YAAY;IA2G1B,OAAO,CAAC,qBAAqB;YAWf,YAAY;IA4C1B,OAAO,CAAC,oCAAoC;IAqB5C,cAAc,IAAI;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,OAAO,CAAC;KACvB;CAMF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-queue-completion.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-queue-completion.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-queue-completion.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-stepdata-update.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-stepdata-update.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-stepdata-update.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-termination.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-termination.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-termination.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Shared constants to avoid circular dependencies
3
+ */
4
+ export declare const OPERATIONS_COMPLETE_EVENT = "allOperationsComplete";
5
+ /**
6
+ * Controls whether stack traces are stored in error objects
7
+ * TODO: Accept this as configuration parameter in the future
8
+ */
9
+ export declare const STORE_STACK_TRACES = false;
10
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,yBAAyB,0BAA0B,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAQ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { TerminationManager } from "../../termination-manager/termination-manager";
2
+ import { DurableExecutionMode } from "../../types";
3
+ interface ContextInfo {
4
+ contextId: string;
5
+ parentId?: string;
6
+ attempt?: number;
7
+ durableExecutionMode?: DurableExecutionMode;
8
+ }
9
+ export declare const getActiveContext: () => ContextInfo | undefined;
10
+ export declare const runWithContext: <T>(contextId: string, parentId: string | undefined, fn: () => T, attempt?: number, durableExecutionMode?: DurableExecutionMode) => T;
11
+ export declare const validateContextUsage: (operationContextId: string | undefined, operationName: string, terminationManager: TerminationManager) => void;
12
+ export {};
13
+ //# sourceMappingURL=context-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-tracker.d.ts","sourceRoot":"","sources":["../../../src/utils/context-tracker/context-tracker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAEnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,UAAU,WAAW;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAID,eAAO,MAAM,gBAAgB,QAAO,WAAW,GAAG,SAEjD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,CAAC,EAC9B,WAAW,MAAM,EACjB,UAAU,MAAM,GAAG,SAAS,EAC5B,IAAI,MAAM,CAAC,EACX,UAAU,MAAM,EAChB,uBAAuB,oBAAoB,KAC1C,CAKF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,oBAAoB,MAAM,GAAG,SAAS,EACtC,eAAe,MAAM,EACrB,oBAAoB,kBAAkB,KACrC,IAkBF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=context-tracker.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-tracker.test.d.ts","sourceRoot":"","sources":["../../../src/utils/context-tracker/context-tracker.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { Operation } from "@aws-sdk/client-lambda";
2
+ import { DurableExecutionClient } from "../../types/durable-execution";
3
+ import { DurableExecutionInvocationInput } from "../../types";
4
+ /**
5
+ * Custom DurableExecutionInvocationInput which uses a custom durable
6
+ * execution client instead of the API-based LambdaClient.
7
+ *
8
+ * @internal
9
+ */
10
+ export declare class DurableExecutionInvocationInputWithClient implements DurableExecutionInvocationInput {
11
+ readonly durableExecutionClient: DurableExecutionClient;
12
+ readonly InitialExecutionState: {
13
+ Operations: Operation[];
14
+ NextMarker: string;
15
+ };
16
+ readonly DurableExecutionArn: string;
17
+ readonly CheckpointToken: string;
18
+ constructor(params: DurableExecutionInvocationInput, durableExecutionClient: DurableExecutionClient);
19
+ }
20
+ //# sourceMappingURL=durable-execution-invocation-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-execution-invocation-input.d.ts","sourceRoot":"","sources":["../../../src/utils/durable-execution-invocation-input/durable-execution-invocation-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAE9D;;;;;GAKG;AACH,qBAAa,yCACX,YAAW,+BAA+B;aAUxB,sBAAsB,EAAE,sBAAsB;IARhE,SAAgB,qBAAqB,EAAE;QACrC,UAAU,EAAE,SAAS,EAAE,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAC5C,SAAgB,eAAe,EAAE,MAAM,CAAC;gBAEtC,MAAM,EAAE,+BAA+B,EACvB,sBAAsB,EAAE,sBAAsB;CAMjE"}
@@ -0,0 +1,8 @@
1
+ import { Duration } from "../../types";
2
+ /**
3
+ * Converts a Duration object to total seconds
4
+ * @param duration - Duration object with at least one time unit specified
5
+ * @returns Total duration in seconds
6
+ */
7
+ export declare function durationToSeconds(duration: Duration): number;
8
+ //# sourceMappingURL=duration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/utils/duration/duration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAO5D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=duration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"duration.test.d.ts","sourceRoot":"","sources":["../../../src/utils/duration/duration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error-object-coverage.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-object-coverage.test.d.ts","sourceRoot":"","sources":["../../../src/utils/error-object/error-object-coverage.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { ErrorObject } from "@aws-sdk/client-lambda";
2
+ export declare function createErrorObjectFromError(error: unknown, data?: string): ErrorObject;
3
+ //# sourceMappingURL=error-object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-object.d.ts","sourceRoot":"","sources":["../../../src/utils/error-object/error-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAcrD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,IAAI,CAAC,EAAE,MAAM,GACZ,WAAW,CAuBb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=error-object.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-object.test.d.ts","sourceRoot":"","sources":["../../../src/utils/error-object/error-object.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { DurableLogLevel } from "../../types";
2
+ import { DurableLogger, DurableLoggingContext } from "../../types/durable-logger";
3
+ export interface LoggingExecutionContext {
4
+ durableExecutionArn: string;
5
+ requestId: string;
6
+ tenantId: string | undefined;
7
+ }
8
+ type DurableLogField = unknown;
9
+ /**
10
+ * Default logger class that outputs structured logs to console.
11
+ *
12
+ * This logger emulates the AWS Lambda Runtime Interface Client (RIC) console patching
13
+ * behavior to maintain parity with standard Lambda function logging while providing
14
+ * structured output suitable for durable execution contexts.
15
+ *
16
+ * Key RIC behavior emulation:
17
+ * - Respects AWS_LAMBDA_LOG_LEVEL environment variable for log filtering
18
+ * - Uses priority-based level filtering (DEBUG=2, INFO=3, WARN=4, ERROR=5)
19
+ * - Outputs structured JSON with timestamp, requestId, executionArn, and other metadata
20
+ * - Handles Error objects with structured error information extraction
21
+ * - Uses Node.js Console instance for proper stdout/stderr routing
22
+ * - Applies util.format for message formatting (same as console.log behavior)
23
+ *
24
+ * Individual logger methods (info, error, warn, debug) are dynamically enabled/disabled
25
+ * based on the configured log level, defaulting to no-op functions when disabled.
26
+ * This mirrors how RIC patches console methods conditionally.
27
+ */
28
+ export declare class DefaultLogger implements DurableLogger {
29
+ private consoleLogger;
30
+ private durableLoggingContext;
31
+ private executionContext;
32
+ private noOpLog;
33
+ constructor(executionContext?: LoggingExecutionContext);
34
+ private configureLogLevel;
35
+ private ensureDurableLoggingContext;
36
+ log(level: `${DurableLogLevel}`, message?: DurableLogField, ...optionalParams: DurableLogField[]): void;
37
+ info: (message?: DurableLogField, ...optionalParams: DurableLogField[]) => void;
38
+ error: (message?: DurableLogField, ...optionalParams: DurableLogField[]) => void;
39
+ warn: (message?: DurableLogField, ...optionalParams: DurableLogField[]) => void;
40
+ debug: (message?: DurableLogField, ...optionalParams: DurableLogField[]) => void;
41
+ configureDurableLoggingContext(durableLoggingContext: DurableLoggingContext): void;
42
+ }
43
+ /**
44
+ * Creates a default logger that outputs structured logs to console.
45
+ *
46
+ * @param executionContext - Optional execution context for logging
47
+ * @returns DefaultLogger instance
48
+ */
49
+ export declare const createDefaultLogger: (executionContext?: LoggingExecutionContext) => DurableLogger;
50
+ export {};
51
+ //# sourceMappingURL=default-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/default-logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAE9D,OAAO,EACL,aAAa,EACb,qBAAqB,EACtB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,KAAK,eAAe,GAAG,OAAO,CAAC;AAyH/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,aAAc,YAAW,aAAa;IACjD,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,qBAAqB,CAAgD;IAC7E,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,OAAO,CAAC,OAAO,CAAkB;gBAErB,gBAAgB,CAAC,EAAE,uBAAuB;IAkBtD,OAAO,CAAC,iBAAiB;IA8FzB,OAAO,CAAC,2BAA2B;IA4BnC,GAAG,CACD,KAAK,EAAE,GAAG,eAAe,EAAE,EAC3B,OAAO,CAAC,EAAE,eAAe,EACzB,GAAG,cAAc,EAAE,eAAe,EAAE,GACnC,IAAI;IAqBP,IAAI,EAAE,CACJ,OAAO,CAAC,EAAE,eAAe,EACzB,GAAG,cAAc,EAAE,eAAe,EAAE,KACjC,IAAI,CAAC;IACV,KAAK,EAAE,CACL,OAAO,CAAC,EAAE,eAAe,EACzB,GAAG,cAAc,EAAE,eAAe,EAAE,KACjC,IAAI,CAAC;IACV,IAAI,EAAE,CACJ,OAAO,CAAC,EAAE,eAAe,EACzB,GAAG,cAAc,EAAE,eAAe,EAAE,KACjC,IAAI,CAAC;IACV,KAAK,EAAE,CACL,OAAO,CAAC,EAAE,eAAe,EACzB,GAAG,cAAc,EAAE,eAAe,EAAE,KACjC,IAAI,CAAC;IAEV,8BAA8B,CAC5B,qBAAqB,EAAE,qBAAqB,GAC3C,IAAI;CAGR;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,mBAAmB,uBAAuB,KACzC,aAEF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=default-logger.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-logger.test.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/default-logger.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare const log: (emoji: string, message: string, data?: unknown) => void;
2
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/logger.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,SAAS,MAAM,EAAE,OAAO,OAAO,KAAG,IAIpE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logger.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.test.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/logger.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=structured-logger-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-logger-integration.test.d.ts","sourceRoot":"","sources":["../../../src/utils/logger/structured-logger-integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { Operation, OperationType } from "@aws-sdk/client-lambda";
2
+ import { OperationSubType, ExecutionContext } from "../../types";
3
+ export declare const validateReplayConsistency: (stepId: string, currentOperation: {
4
+ type: OperationType;
5
+ name: string | undefined;
6
+ subType: OperationSubType;
7
+ }, checkpointData: Operation | undefined, context: ExecutionContext) => void;
8
+ //# sourceMappingURL=replay-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-validation.d.ts","sourceRoot":"","sources":["../../../src/utils/replay-validation/replay-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIjE,eAAO,MAAM,yBAAyB,GACpC,QAAQ,MAAM,EACd,kBAAkB;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,gBAAgB,CAAC;CAC3B,EACD,gBAAgB,SAAS,GAAG,SAAS,EACrC,SAAS,gBAAgB,KACxB,IAmCF,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=replay-validation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replay-validation.test.d.ts","sourceRoot":"","sources":["../../../src/utils/replay-validation/replay-validation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,167 @@
1
+ import { RetryDecision, JitterStrategy, Duration } from "../../../types";
2
+ /**
3
+ * Configuration options for creating a retry strategy
4
+ *
5
+ * @remarks
6
+ * When neither `retryableErrors` nor `retryableErrorTypes` is specified, all errors are retried by default.
7
+ * When either is specified, only errors matching the specified criteria are retried.
8
+ * When both are specified, errors matching either criteria are retried (OR logic).
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Retry all errors (default behavior)
13
+ * createRetryStrategy({ maxAttempts: 5 })
14
+ *
15
+ * // Retry only specific error types
16
+ * createRetryStrategy({ retryableErrorTypes: [TimeoutError, NetworkError] })
17
+ *
18
+ * // Retry only errors matching message patterns
19
+ * createRetryStrategy({ retryableErrors: [/timeout/i, /connection/i] })
20
+ *
21
+ * // Retry errors matching either type OR pattern
22
+ * createRetryStrategy({
23
+ * retryableErrorTypes: [TimeoutError],
24
+ * retryableErrors: [/network/i]
25
+ * })
26
+ * ```
27
+ *
28
+ * @public
29
+ */
30
+ interface RetryStrategyConfig {
31
+ /**
32
+ * Maximum number of total attempts (including initial attempt).
33
+ * @defaultValue 3
34
+ */
35
+ maxAttempts?: number;
36
+ /**
37
+ * Initial delay before first retry.
38
+ * @defaultValue \{ seconds: 5 \}
39
+ */
40
+ initialDelay?: Duration;
41
+ /**
42
+ * Maximum delay between retries.
43
+ * @defaultValue \{ minutes: 5 \}
44
+ */
45
+ maxDelay?: Duration;
46
+ /**
47
+ * Multiplier for exponential backoff on each retry.
48
+ * @defaultValue 2
49
+ */
50
+ backoffRate?: number;
51
+ /**
52
+ * Jitter strategy to apply to retry delays.
53
+ * @defaultValue JitterStrategy.FULL
54
+ * @see {@link JitterStrategy}
55
+ */
56
+ jitter?: JitterStrategy;
57
+ /**
58
+ * List of error message patterns (strings or RegExp) that are retryable.
59
+ *
60
+ * @remarks
61
+ * - If undefined and `retryableErrorTypes` is also undefined: all errors are retried (default)
62
+ * - If specified: only errors with messages matching these patterns are retried
63
+ * - Strings are matched using `includes()`, RegExp patterns use `test()`
64
+ * - Combined with `retryableErrorTypes` using OR logic
65
+ *
66
+ * @defaultValue All errors when both filters are undefined, otherwise empty array
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * // Retry errors containing "timeout" or "connection"
71
+ * retryableErrors: ["timeout", "connection"]
72
+ *
73
+ * // Retry errors matching regex patterns (case-insensitive)
74
+ * retryableErrors: [/timeout/i, /network.*failed/i]
75
+ * ```
76
+ */
77
+ retryableErrors?: (string | RegExp)[];
78
+ /**
79
+ * List of error class types that are retryable.
80
+ *
81
+ * @remarks
82
+ * - If undefined and `retryableErrors` is also undefined: all errors are retried (default)
83
+ * - If specified: only errors that are instances of these types are retried
84
+ * - Combined with `retryableErrors` using OR logic
85
+ *
86
+ * @defaultValue Empty array
87
+ *
88
+ * @example
89
+ * ```typescript
90
+ * // Define custom error types
91
+ * class TimeoutError extends Error {}
92
+ * class NetworkError extends Error {}
93
+ *
94
+ * // Retry only these specific error types
95
+ * retryableErrorTypes: [TimeoutError, NetworkError]
96
+ * ```
97
+ */
98
+ retryableErrorTypes?: (new () => Error)[];
99
+ }
100
+ /**
101
+ * Creates a retry strategy function with exponential backoff and configurable jitter
102
+ *
103
+ * @param config - Configuration options for the retry strategy
104
+ * @returns A function that determines whether to retry and calculates delay based on error and attempt count
105
+ *
106
+ * @remarks
107
+ * The returned function takes an error and attempt count, and returns a {@link RetryDecision} indicating
108
+ * whether to retry and the delay before the next attempt.
109
+ *
110
+ * **Delay Calculation:**
111
+ * - Base delay = `initialDelay × backoffRate^(attemptsMade - 1)`
112
+ * - Capped at `maxDelay`
113
+ * - Jitter applied based on `jitter` strategy
114
+ * - Final delay rounded to nearest second, minimum 1 second
115
+ *
116
+ * **Error Filtering:**
117
+ * - If neither `retryableErrors` nor `retryableErrorTypes` is specified: all errors are retried
118
+ * - If either is specified: only matching errors are retried
119
+ * - If both are specified: errors matching either criteria are retried (OR logic)
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * // Basic usage with defaults (retry all errors, 3 attempts, exponential backoff)
124
+ * const defaultRetry = createRetryStrategy();
125
+ *
126
+ * // Custom retry with more attempts and specific delays
127
+ * const customRetry = createRetryStrategy({
128
+ * maxAttempts: 5,
129
+ * initialDelay: { seconds: 10 },
130
+ * maxDelay: { seconds: 60 },
131
+ * backoffRate: 2,
132
+ * jitter: JitterStrategy.HALF
133
+ * });
134
+ *
135
+ * // Retry only specific error types
136
+ * class TimeoutError extends Error {}
137
+ * const typeBasedRetry = createRetryStrategy({
138
+ * retryableErrorTypes: [TimeoutError]
139
+ * });
140
+ *
141
+ * // Retry only errors matching message patterns
142
+ * const patternBasedRetry = createRetryStrategy({
143
+ * retryableErrors: [/timeout/i, /connection/i, "rate limit"]
144
+ * });
145
+ *
146
+ * // Combine error types and patterns
147
+ * const combinedRetry = createRetryStrategy({
148
+ * retryableErrorTypes: [TimeoutError],
149
+ * retryableErrors: [/network/i]
150
+ * });
151
+ *
152
+ * // Use in step configuration
153
+ * await context.step('api-call', async () => {
154
+ * return await callExternalAPI();
155
+ * }, { retryStrategy: customRetry });
156
+ * ```
157
+ *
158
+ * @see {@link RetryStrategyConfig} for configuration options
159
+ * @see {@link JitterStrategy} for jitter strategies
160
+ * @see {@link RetryDecision} for return type
161
+ *
162
+ * @public
163
+ */
164
+ export declare const createRetryStrategy: (config?: RetryStrategyConfig) => (error: Error, attemptsMade: number) => RetryDecision;
165
+ export type { RetryStrategyConfig };
166
+ export { JitterStrategy };
167
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/retry/retry-config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGzE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,UAAU,mBAAmB;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,QAAQ,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IAExB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IAEtC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,CAAC,EAAE,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;CAC3C;AA2BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAQ,mBAAwB,MAa1D,OAAO,KAAK,EAAE,cAAc,MAAM,KAAG,aA0C9C,CAAC;AAEF,YAAY,EAAE,mBAAmB,EAAE,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/retry/retry-config/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Pre-configured retry strategies for common use cases
3
+ * @example
4
+ * ```typescript
5
+ * // Use default retry preset (3 attempts with exponential backoff)
6
+ * await context.step('my-step', async () => {
7
+ * return await someOperation();
8
+ * }, { retryStrategy: retryPresets.default });
9
+ *
10
+ * // Use no-retry preset (fail immediately on error)
11
+ * await context.step('critical-step', async () => {
12
+ * return await criticalOperation();
13
+ * }, { retryStrategy: retryPresets.noRetry });
14
+ * ```
15
+ *
16
+ * @public
17
+ */
18
+ export declare const retryPresets: {
19
+ /**
20
+ * Default retry strategy with exponential backoff
21
+ * - 6 total attempts (1 initial + 5 retries)
22
+ * - Initial delay: 5 seconds
23
+ * - Max delay: 60 seconds
24
+ * - Backoff rate: 2x
25
+ * - Jitter: FULL (randomizes delay between 0 and calculated delay)
26
+ * - Total max wait time less than 150 seconds (2:30)
27
+ */
28
+ default: (error: Error, attemptsMade: number) => import("../../..").RetryDecision;
29
+ /**
30
+ * No retry strategy - fails immediately on first error
31
+ * - 1 total attempt (no retries)
32
+ */
33
+ noRetry: (error: Error, attemptsMade: number) => import("../../..").RetryDecision;
34
+ };
35
+ //# sourceMappingURL=retry-presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry-presets.d.ts","sourceRoot":"","sources":["../../../../src/utils/retry/retry-presets/retry-presets.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,YAAY;IACvB;;;;;;;;OAQG;;IASH;;;OAGG;;CAIJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const safeStringify: (data: unknown) => string;
2
+ //# sourceMappingURL=safe-stringify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-stringify.d.ts","sourceRoot":"","sources":["../../../src/utils/safe-stringify/safe-stringify.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,KAAG,MA2B7C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=safe-stringify.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-stringify.test.d.ts","sourceRoot":"","sources":["../../../src/utils/safe-stringify/safe-stringify.test.ts"],"names":[],"mappings":""}