@aws/durable-execution-sdk-js 0.0.1 → 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,24 @@
1
+ import { Serdes } from "../utils/serdes/serdes";
2
+ import { DurableLogger } from "./durable-logger";
3
+ import { DurableContext } from "./durable-context";
4
+ /**
5
+ * Configuration options for child context operations
6
+ * @public
7
+ */
8
+ export interface ChildConfig<T> {
9
+ /** Serialization/deserialization configuration for child context data */
10
+ serdes?: Serdes<T>;
11
+ /** Sub-type identifier for categorizing child contexts */
12
+ subType?: string;
13
+ /** Function to generate summaries for large results (used internally by map/parallel) */
14
+ summaryGenerator?: (result: T) => string;
15
+ }
16
+ /**
17
+ * Function to be executed in a child context with isolated state
18
+ * @param context - DurableContext with isolated step counter and state tracking
19
+ * @returns Promise resolving to the child function result
20
+ *
21
+ * @public
22
+ */
23
+ export type ChildFunc<T, Logger extends DurableLogger = DurableLogger> = (context: DurableContext<Logger>) => Promise<T>;
24
+ //# sourceMappingURL=child-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-context.d.ts","sourceRoot":"","sources":["../../src/types/child-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,yEAAyE;IACzE,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACnB,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;CAC1C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,EAAE,MAAM,SAAS,aAAa,GAAG,aAAa,IAAI,CACvE,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,KAC5B,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,315 @@
1
+ import { TerminationManager } from "../termination-manager/termination-manager";
2
+ import { DurableExecutionClient } from "./durable-execution";
3
+ import { ErrorObject, Operation } from "@aws-sdk/client-lambda";
4
+ import { ActiveOperationsTracker } from "../utils/termination-helper/active-operations-tracker";
5
+ /**
6
+ * @internal
7
+ */
8
+ export declare enum DurableExecutionMode {
9
+ ExecutionMode = "ExecutionMode",
10
+ ReplayMode = "ReplayMode",
11
+ ReplaySucceededContext = "ReplaySucceededContext"
12
+ }
13
+ /**
14
+ * Input structure for durable execution invocations.
15
+ *
16
+ * This interface defines the payload structure that the durable execution service provides
17
+ * to durable functions. It contains all the necessary information for the Durable
18
+ * Execution Language SDK to:
19
+ * - Manage checkpointing and state persistence
20
+ * - Replay completed operations from previous state
21
+ *
22
+ * The input is automatically provided by the durable execution service and
23
+ * contains both execution metadata and the operation history for replay.
24
+ *
25
+ * @public
26
+ */
27
+ export interface DurableExecutionInvocationInput {
28
+ /**
29
+ * Amazon Resource Name (ARN) that uniquely identifies this durable execution instance.
30
+ */
31
+ DurableExecutionArn: string;
32
+ /**
33
+ * Unique token for the next checkpoint in this execution.
34
+ *
35
+ * This token:
36
+ * - Ensures checkpoint operations are idempotent
37
+ * - Prevents duplicate checkpoints
38
+ * - Validates that checkpoint requests belong to the current execution cycle
39
+ */
40
+ CheckpointToken: string;
41
+ /**
42
+ * Execution state including operation history and pagination information.
43
+ *
44
+ * Contains the full context needed to resume execution including:
45
+ * - All previously completed operations with their results
46
+ * - Execution metadata and step identifiers
47
+ * - Pagination markers for long operation histories
48
+ */
49
+ InitialExecutionState: {
50
+ /**
51
+ * Array of completed operations with their execution details and results.
52
+ *
53
+ * Each operation contains:
54
+ * - Operation type and subtype (STEP, WAIT, CALLBACK, etc.)
55
+ * - Unique operation identifier
56
+ * - Output results
57
+ * - Execution timestamps and status
58
+ */
59
+ Operations: Operation[];
60
+ /**
61
+ * Pagination marker for retrieving additional operation history if needed.
62
+ *
63
+ * Used when the operation history is too large to fit in a single response.
64
+ * The Durable Execution Language SDK handles pagination automatically.
65
+ */
66
+ NextMarker: string;
67
+ };
68
+ }
69
+ /**
70
+ * Status enumeration for durable execution invocation results.
71
+ *
72
+ * This enum defines the possible outcomes of a durable execution invocation,
73
+ * indicating whether the execution completed successfully, failed, or is
74
+ * continuing asynchronously.
75
+ *
76
+ * The status determines how the AWS durable execution service will handle
77
+ * the execution:
78
+ * - SUCCEEDED: Execution completed successfully with a final result
79
+ * - FAILED: Execution failed with an error that cannot be retried
80
+ * - PENDING: Execution is continuing and will be resumed later (checkpointed)
81
+ *
82
+ * @public
83
+ */
84
+ export declare enum InvocationStatus {
85
+ /**
86
+ * The durable execution completed successfully.
87
+ *
88
+ * This status indicates:
89
+ * - A final result is available (if any)
90
+ * - No further invocations are needed
91
+ * - The execution has reached its natural completion
92
+ */
93
+ SUCCEEDED = "SUCCEEDED",
94
+ /**
95
+ * The durable execution failed with an unrecoverable error.
96
+ *
97
+ * This status indicates:
98
+ * - An error occurred that cannot be automatically retried
99
+ * - Error details are provided in the response
100
+ * - No further invocations will occur
101
+ */
102
+ FAILED = "FAILED",
103
+ /**
104
+ * The durable execution is continuing asynchronously.
105
+ *
106
+ * This status indicates:
107
+ * - Execution was checkpointed and will resume later
108
+ * - Common scenarios: waiting for callbacks, retries, wait operations
109
+ * - The function may terminate while execution continues
110
+ * - Future invocations will resume from the checkpoint
111
+ */
112
+ PENDING = "PENDING"
113
+ }
114
+ /**
115
+ * Operation subtype enumeration for categorizing different types of durable operations.
116
+ *
117
+ * This enum provides fine-grained classification of durable operations beyond the
118
+ * basic operation types. Subtypes enable improved observability for specific
119
+ * operation patterns.
120
+ *
121
+ * Each subtype corresponds to a specific durable context method or execution pattern.
122
+ *
123
+ * @public
124
+ */
125
+ export declare enum OperationSubType {
126
+ /**
127
+ * A durable step operation (`context.step`).
128
+ *
129
+ * Represents atomic operations with automatic retry and checkpointing.
130
+ * Steps are the fundamental building blocks of durable executions.
131
+ */
132
+ STEP = "Step",
133
+ /**
134
+ * A wait operation (`context.wait`).
135
+ *
136
+ * Represents time-based delays that pause execution for a specified duration.
137
+ * Waits allow long-running workflows without keeping invocations active.
138
+ */
139
+ WAIT = "Wait",
140
+ /**
141
+ * A callback creation operation (`context.createCallback`).
142
+ *
143
+ * Represents the creation of a callback that external systems can complete.
144
+ * Used for human-in-the-loop workflows and external system integration.
145
+ */
146
+ CALLBACK = "Callback",
147
+ /**
148
+ * A child context operation (`context.runInChildContext`).
149
+ *
150
+ * Represents execution within an isolated child context with its own
151
+ * step counter and state tracking. Used for grouping related operations.
152
+ */
153
+ RUN_IN_CHILD_CONTEXT = "RunInChildContext",
154
+ /**
155
+ * A map operation (`context.map`).
156
+ *
157
+ * Represents parallel processing of an array of items with concurrency control
158
+ * and completion policies. Each map operation coordinates multiple iterations.
159
+ */
160
+ MAP = "Map",
161
+ /**
162
+ * An individual iteration within a map operation.
163
+ *
164
+ * Represents the processing of a single item within a `context.map` call.
165
+ * Each iteration runs in its own child context with isolated state.
166
+ */
167
+ MAP_ITERATION = "MapIteration",
168
+ /**
169
+ * A parallel execution operation (`context.parallel`).
170
+ *
171
+ * Represents concurrent execution of multiple branches with optional
172
+ * concurrency control and completion policies.
173
+ */
174
+ PARALLEL = "Parallel",
175
+ /**
176
+ * An individual branch within a parallel operation.
177
+ *
178
+ * Represents a single branch of execution within a `context.parallel` call.
179
+ * Each branch runs in its own child context with isolated state.
180
+ */
181
+ PARALLEL_BRANCH = "ParallelBranch",
182
+ /**
183
+ * A wait for callback operation (`context.waitForCallback`).
184
+ *
185
+ * Represents waiting for an external system to complete a callback,
186
+ * combining callback creation with submission logic.
187
+ */
188
+ WAIT_FOR_CALLBACK = "WaitForCallback",
189
+ /**
190
+ * A wait for condition operation (`context.waitForCondition`).
191
+ *
192
+ * Represents periodic checking of a condition until it's met,
193
+ * with configurable polling intervals and wait strategies.
194
+ */
195
+ WAIT_FOR_CONDITION = "WaitForCondition",
196
+ /**
197
+ * A chained invocation operation (`context.invoke`).
198
+ *
199
+ * Represents calling another durable function with input parameters
200
+ * and waiting for its completion. Used for function composition and workflows.
201
+ */
202
+ CHAINED_INVOKE = "ChainedInvoke"
203
+ }
204
+ /**
205
+ * Response structure for failed durable execution invocations.
206
+ * @public
207
+ */
208
+ interface DurableExecutionInvocationOutputFailed {
209
+ /** Status indicating the execution failed */
210
+ Status: InvocationStatus.FAILED;
211
+ /** Error object containing failure details and stack trace */
212
+ Error: ErrorObject;
213
+ }
214
+ /**
215
+ * Response structure for successfully completed durable execution invocations.
216
+ * @public
217
+ */
218
+ interface DurableExecutionInvocationOutputSucceeded {
219
+ /** Status indicating successful completion */
220
+ Status: InvocationStatus.SUCCEEDED;
221
+ /** Optional serialized result from the execution (undefined for void results) */
222
+ Result?: string;
223
+ }
224
+ /**
225
+ * Response structure for durable execution invocations that are continuing asynchronously.
226
+ * @public
227
+ */
228
+ interface DurableExecutionInvocationOutputPending {
229
+ /** Status indicating the execution is pending and will be resumed later */
230
+ Status: InvocationStatus.PENDING;
231
+ }
232
+ /**
233
+ * Union type representing all possible output formats for durable execution invocations.
234
+ *
235
+ * This type defines the complete response structure that durable functions return
236
+ * to the AWS Durable Execution service. The response format varies based on the
237
+ * execution outcome:
238
+ *
239
+ * **Successful Completion (`SUCCEEDED`):**
240
+ * - Contains the final execution result (if any) as a serialized string
241
+ * - Indicates the execution has completed and no further invocations are needed
242
+ * - The Result field may be undefined for void functions or large results that were checkpointed
243
+ *
244
+ * **Execution Failure (`FAILED`):**
245
+ * - Contains structured error information including message and stack trace
246
+ * - Indicates an unrecoverable error that terminates the execution
247
+ * - No further automatic retries will occur
248
+ *
249
+ * **Continued Execution (`PENDING`):**
250
+ * - Indicates the execution is continuing asynchronously
251
+ * - Common for operations involving waits, callbacks, or retries
252
+ * - The execution will be resumed in a future invocation
253
+ *
254
+ * The durable execution service uses this response to determine next steps:
255
+ * - Schedule continuation for PENDING status
256
+ * - Complete the execution for SUCCEEDED status
257
+ * - Complete the execution for FAILED status
258
+ *
259
+ * @public
260
+ */
261
+ export type DurableExecutionInvocationOutput = DurableExecutionInvocationOutputSucceeded | DurableExecutionInvocationOutputFailed | DurableExecutionInvocationOutputPending;
262
+ /**
263
+ * Type representing time durations for durable execution operations, such as
264
+ * `wait`, `retry`, and `timeout` options.
265
+ *
266
+ * **Supported Units:**
267
+ * - `days`: Number of days
268
+ * - `hours`: Number of hours
269
+ * - `minutes`: Number of minutes
270
+ * - `seconds`: Number of seconds
271
+ *
272
+ * **Usage Rules:**
273
+ * - At least one time unit must be specified
274
+ * - All numeric values must be positive integers
275
+ * - Fractional values are not supported
276
+ *
277
+ * @example
278
+ * ```typescript
279
+ * // Wait for 30 seconds
280
+ * await context.wait({ seconds: 30 });
281
+ * ```
282
+ *
283
+ * @public
284
+ */
285
+ export type Duration = {
286
+ days: number;
287
+ hours?: number;
288
+ minutes?: number;
289
+ seconds?: number;
290
+ } | {
291
+ hours: number;
292
+ minutes?: number;
293
+ seconds?: number;
294
+ } | {
295
+ minutes: number;
296
+ seconds?: number;
297
+ } | {
298
+ seconds: number;
299
+ };
300
+ /**
301
+ * @internal
302
+ */
303
+ export interface ExecutionContext {
304
+ durableExecutionClient: DurableExecutionClient;
305
+ _stepData: Record<string, Operation>;
306
+ terminationManager: TerminationManager;
307
+ durableExecutionArn: string;
308
+ activeOperationsTracker?: ActiveOperationsTracker;
309
+ requestId: string;
310
+ tenantId: string | undefined;
311
+ pendingCompletions: Set<string>;
312
+ getStepData(stepId: string): Operation | undefined;
313
+ }
314
+ export {};
315
+ //# sourceMappingURL=core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/types/core.ts"],"names":[],"mappings":"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"}