@aws/durable-execution-sdk-js 0.0.1 → 1.0.1

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 (284) hide show
  1. package/README.md +365 -0
  2. package/dist/index.mjs +4628 -0
  3. package/dist/index.mjs.map +1 -0
  4. package/dist-cjs/index.js +4646 -0
  5. package/dist-cjs/index.js.map +1 -0
  6. package/dist-types/context/durable-context/durable-context.d.ts +70 -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 +61 -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 +9 -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 +6 -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 +13 -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 +7 -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 +6 -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 +5 -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-comparison.test.d.ts +2 -0
  129. package/dist-types/handlers/wait-handler/wait-handler-comparison.test.d.ts.map +1 -0
  130. package/dist-types/handlers/wait-handler/wait-handler-two-phase.test.d.ts +2 -0
  131. package/dist-types/handlers/wait-handler/wait-handler-two-phase.test.d.ts.map +1 -0
  132. package/dist-types/handlers/wait-handler/wait-handler.d.ts +8 -0
  133. package/dist-types/handlers/wait-handler/wait-handler.d.ts.map +1 -0
  134. package/dist-types/handlers/wait-handler/wait-handler.test.d.ts +2 -0
  135. package/dist-types/handlers/wait-handler/wait-handler.test.d.ts.map +1 -0
  136. package/dist-types/index.d.ts +12 -0
  137. package/dist-types/index.d.ts.map +1 -0
  138. package/dist-types/run-durable.d.ts +2 -0
  139. package/dist-types/run-durable.d.ts.map +1 -0
  140. package/dist-types/termination-manager/termination-manager-checkpoint.test.d.ts +2 -0
  141. package/dist-types/termination-manager/termination-manager-checkpoint.test.d.ts.map +1 -0
  142. package/dist-types/termination-manager/termination-manager.d.ts +15 -0
  143. package/dist-types/termination-manager/termination-manager.d.ts.map +1 -0
  144. package/dist-types/termination-manager/termination-manager.test.d.ts +2 -0
  145. package/dist-types/termination-manager/termination-manager.test.d.ts.map +1 -0
  146. package/dist-types/termination-manager/types.d.ts +26 -0
  147. package/dist-types/termination-manager/types.d.ts.map +1 -0
  148. package/dist-types/testing/create-test-checkpoint-manager.d.ts +5 -0
  149. package/dist-types/testing/create-test-checkpoint-manager.d.ts.map +1 -0
  150. package/dist-types/testing/create-test-durable-context.d.ts +32 -0
  151. package/dist-types/testing/create-test-durable-context.d.ts.map +1 -0
  152. package/dist-types/testing/mock-batch-result.d.ts +26 -0
  153. package/dist-types/testing/mock-batch-result.d.ts.map +1 -0
  154. package/dist-types/testing/mock-checkpoint-manager.d.ts +20 -0
  155. package/dist-types/testing/mock-checkpoint-manager.d.ts.map +1 -0
  156. package/dist-types/testing/mock-checkpoint.d.ts +13 -0
  157. package/dist-types/testing/mock-checkpoint.d.ts.map +1 -0
  158. package/dist-types/testing/mock-context.d.ts +10 -0
  159. package/dist-types/testing/mock-context.d.ts.map +1 -0
  160. package/dist-types/testing/test-constants.d.ts +59 -0
  161. package/dist-types/testing/test-constants.d.ts.map +1 -0
  162. package/dist-types/types/batch.d.ts +185 -0
  163. package/dist-types/types/batch.d.ts.map +1 -0
  164. package/dist-types/types/callback.d.ts +48 -0
  165. package/dist-types/types/callback.d.ts.map +1 -0
  166. package/dist-types/types/child-context.d.ts +24 -0
  167. package/dist-types/types/child-context.d.ts.map +1 -0
  168. package/dist-types/types/core.d.ts +313 -0
  169. package/dist-types/types/core.d.ts.map +1 -0
  170. package/dist-types/types/durable-context.d.ts +669 -0
  171. package/dist-types/types/durable-context.d.ts.map +1 -0
  172. package/dist-types/types/durable-execution.d.ts +192 -0
  173. package/dist-types/types/durable-execution.d.ts.map +1 -0
  174. package/dist-types/types/durable-logger.d.ts +69 -0
  175. package/dist-types/types/durable-logger.d.ts.map +1 -0
  176. package/dist-types/types/durable-promise.d.ts +80 -0
  177. package/dist-types/types/durable-promise.d.ts.map +1 -0
  178. package/dist-types/types/index.d.ts +15 -0
  179. package/dist-types/types/index.d.ts.map +1 -0
  180. package/dist-types/types/invoke.d.ts +12 -0
  181. package/dist-types/types/invoke.d.ts.map +1 -0
  182. package/dist-types/types/logger.d.ts +63 -0
  183. package/dist-types/types/logger.d.ts.map +1 -0
  184. package/dist-types/types/operation-lifecycle-state.d.ts +27 -0
  185. package/dist-types/types/operation-lifecycle-state.d.ts.map +1 -0
  186. package/dist-types/types/operation-lifecycle.d.ts +27 -0
  187. package/dist-types/types/operation-lifecycle.d.ts.map +1 -0
  188. package/dist-types/types/step.d.ts +76 -0
  189. package/dist-types/types/step.d.ts.map +1 -0
  190. package/dist-types/types/wait-condition.d.ts +46 -0
  191. package/dist-types/types/wait-condition.d.ts.map +1 -0
  192. package/dist-types/utils/checkpoint/checkpoint-ancestor.test.d.ts +2 -0
  193. package/dist-types/utils/checkpoint/checkpoint-ancestor.test.d.ts.map +1 -0
  194. package/dist-types/utils/checkpoint/checkpoint-central-termination.test.d.ts +2 -0
  195. package/dist-types/utils/checkpoint/checkpoint-central-termination.test.d.ts.map +1 -0
  196. package/dist-types/utils/checkpoint/checkpoint-error-classification.test.d.ts +2 -0
  197. package/dist-types/utils/checkpoint/checkpoint-error-classification.test.d.ts.map +1 -0
  198. package/dist-types/utils/checkpoint/checkpoint-helper.d.ts +47 -0
  199. package/dist-types/utils/checkpoint/checkpoint-helper.d.ts.map +1 -0
  200. package/dist-types/utils/checkpoint/checkpoint-integration.test.d.ts +2 -0
  201. package/dist-types/utils/checkpoint/checkpoint-integration.test.d.ts.map +1 -0
  202. package/dist-types/utils/checkpoint/checkpoint-manager.d.ts +78 -0
  203. package/dist-types/utils/checkpoint/checkpoint-manager.d.ts.map +1 -0
  204. package/dist-types/utils/checkpoint/checkpoint-queue-completion.test.d.ts +2 -0
  205. package/dist-types/utils/checkpoint/checkpoint-queue-completion.test.d.ts.map +1 -0
  206. package/dist-types/utils/checkpoint/checkpoint-stepdata-update.test.d.ts +2 -0
  207. package/dist-types/utils/checkpoint/checkpoint-stepdata-update.test.d.ts.map +1 -0
  208. package/dist-types/utils/checkpoint/checkpoint-termination.test.d.ts +2 -0
  209. package/dist-types/utils/checkpoint/checkpoint-termination.test.d.ts.map +1 -0
  210. package/dist-types/utils/checkpoint/checkpoint.test.d.ts +2 -0
  211. package/dist-types/utils/checkpoint/checkpoint.test.d.ts.map +1 -0
  212. package/dist-types/utils/constants/constants.d.ts +9 -0
  213. package/dist-types/utils/constants/constants.d.ts.map +1 -0
  214. package/dist-types/utils/context-tracker/context-tracker.d.ts +13 -0
  215. package/dist-types/utils/context-tracker/context-tracker.d.ts.map +1 -0
  216. package/dist-types/utils/context-tracker/context-tracker.test.d.ts +2 -0
  217. package/dist-types/utils/context-tracker/context-tracker.test.d.ts.map +1 -0
  218. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts +22 -0
  219. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.d.ts.map +1 -0
  220. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.test.d.ts +2 -0
  221. package/dist-types/utils/durable-execution-invocation-input/durable-execution-invocation-input.test.d.ts.map +1 -0
  222. package/dist-types/utils/duration/duration.d.ts +8 -0
  223. package/dist-types/utils/duration/duration.d.ts.map +1 -0
  224. package/dist-types/utils/duration/duration.test.d.ts +2 -0
  225. package/dist-types/utils/duration/duration.test.d.ts.map +1 -0
  226. package/dist-types/utils/error-object/error-object-coverage.test.d.ts +2 -0
  227. package/dist-types/utils/error-object/error-object-coverage.test.d.ts.map +1 -0
  228. package/dist-types/utils/error-object/error-object.d.ts +3 -0
  229. package/dist-types/utils/error-object/error-object.d.ts.map +1 -0
  230. package/dist-types/utils/error-object/error-object.test.d.ts +2 -0
  231. package/dist-types/utils/error-object/error-object.test.d.ts.map +1 -0
  232. package/dist-types/utils/logger/default-logger.d.ts +51 -0
  233. package/dist-types/utils/logger/default-logger.d.ts.map +1 -0
  234. package/dist-types/utils/logger/default-logger.test.d.ts +2 -0
  235. package/dist-types/utils/logger/default-logger.test.d.ts.map +1 -0
  236. package/dist-types/utils/logger/logger.d.ts +2 -0
  237. package/dist-types/utils/logger/logger.d.ts.map +1 -0
  238. package/dist-types/utils/logger/logger.test.d.ts +2 -0
  239. package/dist-types/utils/logger/logger.test.d.ts.map +1 -0
  240. package/dist-types/utils/logger/structured-logger-integration.test.d.ts +2 -0
  241. package/dist-types/utils/logger/structured-logger-integration.test.d.ts.map +1 -0
  242. package/dist-types/utils/replay-validation/replay-validation.d.ts +8 -0
  243. package/dist-types/utils/replay-validation/replay-validation.d.ts.map +1 -0
  244. package/dist-types/utils/replay-validation/replay-validation.test.d.ts +2 -0
  245. package/dist-types/utils/replay-validation/replay-validation.test.d.ts.map +1 -0
  246. package/dist-types/utils/retry/retry-config/index.d.ts +167 -0
  247. package/dist-types/utils/retry/retry-config/index.d.ts.map +1 -0
  248. package/dist-types/utils/retry/retry-config/index.test.d.ts +2 -0
  249. package/dist-types/utils/retry/retry-config/index.test.d.ts.map +1 -0
  250. package/dist-types/utils/retry/retry-presets/retry-presets.d.ts +35 -0
  251. package/dist-types/utils/retry/retry-presets/retry-presets.d.ts.map +1 -0
  252. package/dist-types/utils/safe-stringify/safe-stringify.d.ts +2 -0
  253. package/dist-types/utils/safe-stringify/safe-stringify.d.ts.map +1 -0
  254. package/dist-types/utils/safe-stringify/safe-stringify.test.d.ts +2 -0
  255. package/dist-types/utils/safe-stringify/safe-stringify.test.d.ts.map +1 -0
  256. package/dist-types/utils/serdes/serdes.d.ts +152 -0
  257. package/dist-types/utils/serdes/serdes.d.ts.map +1 -0
  258. package/dist-types/utils/serdes/serdes.test.d.ts +2 -0
  259. package/dist-types/utils/serdes/serdes.test.d.ts.map +1 -0
  260. package/dist-types/utils/step-id-utils/step-id-utils.d.ts +16 -0
  261. package/dist-types/utils/step-id-utils/step-id-utils.d.ts.map +1 -0
  262. package/dist-types/utils/step-id-utils/step-id-utils.test.d.ts +2 -0
  263. package/dist-types/utils/step-id-utils/step-id-utils.test.d.ts.map +1 -0
  264. package/dist-types/utils/summary-generators/summary-generators.d.ts +10 -0
  265. package/dist-types/utils/summary-generators/summary-generators.d.ts.map +1 -0
  266. package/dist-types/utils/summary-generators/summary-generators.test.d.ts +2 -0
  267. package/dist-types/utils/summary-generators/summary-generators.test.d.ts.map +1 -0
  268. package/dist-types/utils/termination-helper/termination-deferral.test.d.ts +2 -0
  269. package/dist-types/utils/termination-helper/termination-deferral.test.d.ts.map +1 -0
  270. package/dist-types/utils/termination-helper/termination-helper.d.ts +11 -0
  271. package/dist-types/utils/termination-helper/termination-helper.d.ts.map +1 -0
  272. package/dist-types/utils/termination-helper/termination-helper.test.d.ts +2 -0
  273. package/dist-types/utils/termination-helper/termination-helper.test.d.ts.map +1 -0
  274. package/dist-types/utils/wait-strategy/wait-strategy-config.d.ts +19 -0
  275. package/dist-types/utils/wait-strategy/wait-strategy-config.d.ts.map +1 -0
  276. package/dist-types/utils/wait-strategy/wait-strategy-config.test.d.ts +2 -0
  277. package/dist-types/utils/wait-strategy/wait-strategy-config.test.d.ts.map +1 -0
  278. package/dist-types/with-durable-execution-queue-completion.test.d.ts +2 -0
  279. package/dist-types/with-durable-execution-queue-completion.test.d.ts.map +1 -0
  280. package/dist-types/with-durable-execution.d.ts +75 -0
  281. package/dist-types/with-durable-execution.d.ts.map +1 -0
  282. package/dist-types/with-durable-execution.test.d.ts +2 -0
  283. package/dist-types/with-durable-execution.test.d.ts.map +1 -0
  284. package/package.json +69 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-ancestor.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-ancestor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-central-termination.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-central-termination.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-central-termination.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-error-classification.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-error-classification.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-error-classification.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ import { OperationUpdate } from "@aws-sdk/client-lambda";
2
+ import { OperationLifecycleState } from "../../types/operation-lifecycle-state";
3
+ import { OperationMetadata, OperationInfo } from "../../types/operation-lifecycle";
4
+ export interface Checkpoint {
5
+ checkpoint(stepId: string, data: Partial<OperationUpdate>): Promise<void>;
6
+ forceCheckpoint?(): Promise<void>;
7
+ force?(): Promise<void>;
8
+ setTerminating?(): void;
9
+ hasPendingAncestorCompletion?(stepId: string): boolean;
10
+ waitForQueueCompletion(): Promise<void>;
11
+ markAncestorFinished(stepId: string): void;
12
+ /**
13
+ * Update operation lifecycle state
14
+ * @param stepId - The operation ID
15
+ * @param state - The new lifecycle state
16
+ * @param options - Optional metadata (required on first call) and endTimestamp
17
+ */
18
+ markOperationState(stepId: string, state: OperationLifecycleState, options?: {
19
+ metadata?: OperationMetadata;
20
+ endTimestamp?: Date;
21
+ }): void;
22
+ /**
23
+ * Wait for retry timer to expire, then poll for status change
24
+ * @param stepId - The operation ID
25
+ */
26
+ waitForRetryTimer(stepId: string): Promise<void>;
27
+ /**
28
+ * Wait for status change (external event like callback, invoke, wait)
29
+ * @param stepId - The operation ID
30
+ */
31
+ waitForStatusChange(stepId: string): Promise<void>;
32
+ /**
33
+ * Mark operation as awaited (IDLE_NOT_AWAITED → IDLE_AWAITED transition)
34
+ * @param stepId - The operation ID
35
+ */
36
+ markOperationAwaited(stepId: string): void;
37
+ /**
38
+ * Get current lifecycle state of an operation
39
+ * @param stepId - The operation ID
40
+ */
41
+ getOperationState(stepId: string): OperationLifecycleState | undefined;
42
+ /**
43
+ * Get all operations (for debugging/testing)
44
+ */
45
+ getAllOperations(): Map<string, OperationInfo>;
46
+ }
47
+ //# sourceMappingURL=checkpoint-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-helper.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,aAAa,EACd,MAAM,iCAAiC,CAAC;AAEzC,MAAM,WAAW,UAAU;IAEzB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,eAAe,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,cAAc,CAAC,IAAI,IAAI,CAAC;IACxB,4BAA4B,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACvD,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAI3C;;;;;OAKG;IACH,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,iBAAiB,CAAC;QAC7B,YAAY,CAAC,EAAE,IAAI,CAAC;KACrB,GACA,IAAI,CAAC;IAER;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD;;;OAGG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3C;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,GAAG,SAAS,CAAC;IAEvE;;OAEG;IACH,gBAAgB,IAAI,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CAChD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkpoint-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkpoint-integration.test.d.ts","sourceRoot":"","sources":["../../../src/utils/checkpoint/checkpoint-integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,78 @@
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
+ import { OperationLifecycleState, OperationInfo, OperationMetadata } from "../../types";
8
+ export declare const STEP_DATA_UPDATED_EVENT = "stepDataUpdated";
9
+ export declare class CheckpointManager implements Checkpoint {
10
+ private durableExecutionArn;
11
+ private stepData;
12
+ private storage;
13
+ private terminationManager;
14
+ private stepDataEmitter;
15
+ private logger;
16
+ private finishedAncestors;
17
+ private queue;
18
+ private isProcessing;
19
+ private currentTaskToken;
20
+ private forceCheckpointPromises;
21
+ private queueCompletionResolver;
22
+ private readonly MAX_PAYLOAD_SIZE;
23
+ private isTerminating;
24
+ private static textEncoder;
25
+ private operations;
26
+ private terminationTimer;
27
+ private terminationReason;
28
+ private readonly TERMINATION_COOLDOWN_MS;
29
+ constructor(durableExecutionArn: string, stepData: Record<string, Operation>, storage: DurableExecutionClient, terminationManager: TerminationManager, initialTaskToken: string, stepDataEmitter: EventEmitter, logger: DurableLogger, finishedAncestors: Set<string>);
30
+ setTerminating(): void;
31
+ /**
32
+ * Mark an ancestor as finished (for run-in-child-context operations)
33
+ */
34
+ markAncestorFinished(stepId: string): void;
35
+ /**
36
+ * Extract parent ID from hierarchical stepId (e.g., "1-2-3" -\> "1-2")
37
+ */
38
+ private getParentId;
39
+ /**
40
+ * Checks if any ancestor of the given stepId is finished
41
+ * Only applies to operations that are descendants of run-in-child-context operations
42
+ */
43
+ private hasFinishedAncestor;
44
+ forceCheckpoint(): Promise<void>;
45
+ waitForQueueCompletion(): Promise<void>;
46
+ clearQueue(): void;
47
+ force(): Promise<void>;
48
+ checkpoint(stepId: string, data: Partial<OperationUpdate>): Promise<void>;
49
+ private classifyCheckpointError;
50
+ private processQueue;
51
+ private notifyQueueCompletion;
52
+ private processBatch;
53
+ private updateStepDataFromCheckpointResponse;
54
+ private resolveWaitingOperation;
55
+ getQueueStatus(): {
56
+ queueLength: number;
57
+ isProcessing: boolean;
58
+ };
59
+ markOperationState(stepId: string, state: OperationLifecycleState, options?: {
60
+ metadata?: OperationMetadata;
61
+ endTimestamp?: Date;
62
+ }): void;
63
+ waitForRetryTimer(stepId: string): Promise<void>;
64
+ waitForStatusChange(stepId: string): Promise<void>;
65
+ markOperationAwaited(stepId: string): void;
66
+ getOperationState(stepId: string): OperationLifecycleState | undefined;
67
+ getAllOperations(): Map<string, OperationInfo>;
68
+ private cleanupOperation;
69
+ private cleanupAllOperations;
70
+ private checkAndTerminate;
71
+ private abortTermination;
72
+ private scheduleTermination;
73
+ private executeTermination;
74
+ private determineTerminationReason;
75
+ private startTimerWithPolling;
76
+ private forceRefreshAndCheckStatus;
77
+ }
78
+ //# 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":"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"}
@@ -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,9 @@
1
+ /**
2
+ * Shared constants to avoid circular dependencies
3
+ */
4
+ /**
5
+ * Controls whether stack traces are stored in error objects
6
+ * TODO: Accept this as configuration parameter in the future
7
+ */
8
+ export declare const STORE_STACK_TRACES = false;
9
+ //# 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;;;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,22 @@
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 | undefined;
15
+ };
16
+ readonly DurableExecutionArn: string;
17
+ readonly CheckpointToken: string;
18
+ constructor(params: DurableExecutionInvocationInput, durableExecutionClient: DurableExecutionClient);
19
+ static isInstance(event: unknown): event is DurableExecutionInvocationInputWithClient;
20
+ get [Symbol.toStringTag](): string;
21
+ }
22
+ //# 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,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACjC,CAAC;IACF,SAAgB,mBAAmB,EAAE,MAAM,CAAC;IAC5C,SAAgB,eAAe,EAAE,MAAM,CAAC;gBAEtC,MAAM,EAAE,+BAA+B,EACvB,sBAAsB,EAAE,sBAAsB;IAOhE,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,yCAAyC;IAerD,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=durable-execution-invocation-input.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-execution-invocation-input.test.d.ts","sourceRoot":"","sources":["../../../src/utils/durable-execution-invocation-input/durable-execution-invocation-input.test.ts"],"names":[],"mappings":""}
@@ -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":""}