@kensio/yulin 1.2.0 → 1.3.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 (328) hide show
  1. package/dist/sdk/router/resolve-sim-sdk-command-router.d.ts.map +1 -1
  2. package/dist/sdk/router/resolve-sim-sdk-command-router.js +3 -0
  3. package/dist/sdk/router/resolve-sim-sdk-command-router.js.map +1 -1
  4. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +3 -2
  5. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts.map +1 -1
  6. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +7 -2
  7. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js.map +1 -1
  8. package/dist/service/aws/sim-aws-account-region-scope.d.ts +9 -1
  9. package/dist/service/aws/sim-aws-account-region-scope.d.ts.map +1 -1
  10. package/dist/service/aws/sim-aws-account-region-scope.js +10 -0
  11. package/dist/service/aws/sim-aws-account-region-scope.js.map +1 -1
  12. package/dist/service/aws/sim-aws-account.d.ts +5 -1
  13. package/dist/service/aws/sim-aws-account.d.ts.map +1 -1
  14. package/dist/service/aws/sim-aws-account.js +6 -0
  15. package/dist/service/aws/sim-aws-account.js.map +1 -1
  16. package/dist/service/aws/sim-aws-region.d.ts +5 -1
  17. package/dist/service/aws/sim-aws-region.d.ts.map +1 -1
  18. package/dist/service/aws/sim-aws-region.js +6 -0
  19. package/dist/service/aws/sim-aws-region.js.map +1 -1
  20. package/dist/service/aws/sim-aws-service-accessors.d.ts +3 -1
  21. package/dist/service/aws/sim-aws-service-accessors.d.ts.map +1 -1
  22. package/dist/service/aws/sim-aws-service-accessors.js +4 -0
  23. package/dist/service/aws/sim-aws-service-accessors.js.map +1 -1
  24. package/dist/service/cloudformation/resource/cfn/dynamodb/sim-dynamodb-table-cfn.d.ts +11 -3
  25. package/dist/service/cloudformation/resource/cfn/dynamodb/sim-dynamodb-table-cfn.d.ts.map +1 -1
  26. package/dist/service/cloudformation/resource/cfn/dynamodb/sim-dynamodb-table-cfn.js +20 -6
  27. package/dist/service/cloudformation/resource/cfn/dynamodb/sim-dynamodb-table-cfn.js.map +1 -1
  28. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-creator.d.ts.map +1 -1
  29. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-creator.js +1 -0
  30. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-creator.js.map +1 -1
  31. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-properties.d.ts +5 -0
  32. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-properties.d.ts.map +1 -1
  33. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-properties.js +7 -0
  34. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-properties.js.map +1 -1
  35. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-property-rules.d.ts +5 -4
  36. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-property-rules.d.ts.map +1 -1
  37. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-property-rules.js +16 -11
  38. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-property-rules.js.map +1 -1
  39. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream-rules.d.ts +23 -0
  40. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream-rules.d.ts.map +1 -0
  41. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream-rules.js +62 -0
  42. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream-rules.js.map +1 -0
  43. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream.d.ts +17 -0
  44. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream.d.ts.map +1 -0
  45. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream.js +24 -0
  46. package/dist/service/dynamodb/cfn/table/sim-cfn-dynamodb-table-stream.js.map +1 -0
  47. package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.d.ts +11 -0
  48. package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.d.ts.map +1 -1
  49. package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.js +13 -0
  50. package/dist/service/dynamodb/command/authorize/sim-dynamodb-authorizer.js.map +1 -1
  51. package/dist/service/dynamodb/command/stream/describe-stream/describe-stream.command.d.ts +43 -0
  52. package/dist/service/dynamodb/command/stream/describe-stream/describe-stream.command.d.ts.map +1 -0
  53. package/dist/service/dynamodb/command/stream/describe-stream/describe-stream.command.js +5 -0
  54. package/dist/service/dynamodb/command/stream/describe-stream/describe-stream.command.js.map +1 -0
  55. package/dist/service/dynamodb/command/stream/describe-stream/sim-dynamodb-describe-stream.d.ts +26 -0
  56. package/dist/service/dynamodb/command/stream/describe-stream/sim-dynamodb-describe-stream.d.ts.map +1 -0
  57. package/dist/service/dynamodb/command/stream/describe-stream/sim-dynamodb-describe-stream.js +77 -0
  58. package/dist/service/dynamodb/command/stream/describe-stream/sim-dynamodb-describe-stream.js.map +1 -0
  59. package/dist/service/dynamodb/command/stream/get-records/get-records.command.d.ts +32 -0
  60. package/dist/service/dynamodb/command/stream/get-records/get-records.command.d.ts.map +1 -0
  61. package/dist/service/dynamodb/command/stream/get-records/get-records.command.js +5 -0
  62. package/dist/service/dynamodb/command/stream/get-records/get-records.command.js.map +1 -0
  63. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-get-records.d.ts +29 -0
  64. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-get-records.d.ts.map +1 -0
  65. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-get-records.js +60 -0
  66. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-get-records.js.map +1 -0
  67. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-streams-api-record.d.ts +12 -0
  68. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-streams-api-record.d.ts.map +1 -0
  69. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-streams-api-record.js +52 -0
  70. package/dist/service/dynamodb/command/stream/get-records/sim-dynamodb-streams-api-record.js.map +1 -0
  71. package/dist/service/dynamodb/command/stream/get-shard-iterator/get-shard-iterator.command.d.ts +31 -0
  72. package/dist/service/dynamodb/command/stream/get-shard-iterator/get-shard-iterator.command.d.ts.map +1 -0
  73. package/dist/service/dynamodb/command/stream/get-shard-iterator/get-shard-iterator.command.js +5 -0
  74. package/dist/service/dynamodb/command/stream/get-shard-iterator/get-shard-iterator.command.js.map +1 -0
  75. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-get-shard-iterator.d.ts +27 -0
  76. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-get-shard-iterator.d.ts.map +1 -0
  77. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-get-shard-iterator.js +42 -0
  78. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-get-shard-iterator.js.map +1 -0
  79. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-shard-iterator-position.d.ts +11 -0
  80. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-shard-iterator-position.d.ts.map +1 -0
  81. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-shard-iterator-position.js +53 -0
  82. package/dist/service/dynamodb/command/stream/get-shard-iterator/sim-dynamodb-shard-iterator-position.js.map +1 -0
  83. package/dist/service/dynamodb/command/stream/list-streams/list-streams.command.d.ts +33 -0
  84. package/dist/service/dynamodb/command/stream/list-streams/list-streams.command.d.ts.map +1 -0
  85. package/dist/service/dynamodb/command/stream/list-streams/list-streams.command.js +5 -0
  86. package/dist/service/dynamodb/command/stream/list-streams/list-streams.command.js.map +1 -0
  87. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-list-streams.d.ts +26 -0
  88. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-list-streams.d.ts.map +1 -0
  89. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-list-streams.js +31 -0
  90. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-list-streams.js.map +1 -0
  91. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-stream-page.d.ts +28 -0
  92. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-stream-page.d.ts.map +1 -0
  93. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-stream-page.js +59 -0
  94. package/dist/service/dynamodb/command/stream/list-streams/sim-dynamodb-stream-page.js.map +1 -0
  95. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-access.d.ts +44 -0
  96. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-access.d.ts.map +1 -0
  97. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-access.js +53 -0
  98. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-access.js.map +1 -0
  99. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-command.types.d.ts +8 -0
  100. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-command.types.d.ts.map +1 -0
  101. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-command.types.js +2 -0
  102. package/dist/service/dynamodb/command/stream/sim-dynamodb-stream-command.types.js.map +1 -0
  103. package/dist/service/dynamodb/command/stream/stream.types.d.ts +84 -0
  104. package/dist/service/dynamodb/command/stream/stream.types.d.ts.map +1 -0
  105. package/dist/service/dynamodb/command/stream/stream.types.js +2 -0
  106. package/dist/service/dynamodb/command/stream/stream.types.js.map +1 -0
  107. package/dist/service/dynamodb/error/dynamodb.error.d.ts +17 -0
  108. package/dist/service/dynamodb/error/dynamodb.error.d.ts.map +1 -1
  109. package/dist/service/dynamodb/error/dynamodb.error.js +19 -0
  110. package/dist/service/dynamodb/error/dynamodb.error.js.map +1 -1
  111. package/dist/service/dynamodb/index.d.ts +1 -0
  112. package/dist/service/dynamodb/index.d.ts.map +1 -1
  113. package/dist/service/dynamodb/index.js +1 -0
  114. package/dist/service/dynamodb/index.js.map +1 -1
  115. package/dist/service/dynamodb/sdk/sim-dynamodb-streams-sdk-command-router.d.ts +24 -0
  116. package/dist/service/dynamodb/sdk/sim-dynamodb-streams-sdk-command-router.d.ts.map +1 -0
  117. package/dist/service/dynamodb/sdk/sim-dynamodb-streams-sdk-command-router.js +46 -0
  118. package/dist/service/dynamodb/sdk/sim-dynamodb-streams-sdk-command-router.js.map +1 -0
  119. package/dist/service/dynamodb/sim-dynamodb-streams.d.ts +59 -0
  120. package/dist/service/dynamodb/sim-dynamodb-streams.d.ts.map +1 -0
  121. package/dist/service/dynamodb/sim-dynamodb-streams.js +79 -0
  122. package/dist/service/dynamodb/sim-dynamodb-streams.js.map +1 -0
  123. package/dist/service/dynamodb/sim-dynamodb.d.ts +6 -3
  124. package/dist/service/dynamodb/sim-dynamodb.d.ts.map +1 -1
  125. package/dist/service/dynamodb/sim-dynamodb.js +16 -5
  126. package/dist/service/dynamodb/sim-dynamodb.js.map +1 -1
  127. package/dist/service/dynamodb/stream/sim-dynamodb-stream-position.d.ts +31 -0
  128. package/dist/service/dynamodb/stream/sim-dynamodb-stream-position.d.ts.map +1 -0
  129. package/dist/service/dynamodb/stream/sim-dynamodb-stream-position.js +13 -0
  130. package/dist/service/dynamodb/stream/sim-dynamodb-stream-position.js.map +1 -0
  131. package/dist/service/dynamodb/stream/sim-dynamodb-stream-read.d.ts +33 -0
  132. package/dist/service/dynamodb/stream/sim-dynamodb-stream-read.d.ts.map +1 -0
  133. package/dist/service/dynamodb/stream/sim-dynamodb-stream-read.js +66 -0
  134. package/dist/service/dynamodb/stream/sim-dynamodb-stream-read.js.map +1 -0
  135. package/dist/service/dynamodb/stream/sim-dynamodb-stream-retention.d.ts +17 -0
  136. package/dist/service/dynamodb/stream/sim-dynamodb-stream-retention.d.ts.map +1 -0
  137. package/dist/service/dynamodb/stream/sim-dynamodb-stream-retention.js +24 -0
  138. package/dist/service/dynamodb/stream/sim-dynamodb-stream-retention.js.map +1 -0
  139. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.d.ts +16 -0
  140. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.d.ts.map +1 -1
  141. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.js +32 -0
  142. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.js.map +1 -1
  143. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard-iterator.d.ts +25 -0
  144. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard-iterator.d.ts.map +1 -0
  145. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard-iterator.js +74 -0
  146. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard-iterator.js.map +1 -0
  147. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.d.ts +33 -0
  148. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.d.ts.map +1 -1
  149. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.js +49 -0
  150. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.js.map +1 -1
  151. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.d.ts +16 -0
  152. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.d.ts.map +1 -1
  153. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.js +25 -0
  154. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.js.map +1 -1
  155. package/dist/service/dynamodb/stream/sim-dynamodb-stream.d.ts +14 -0
  156. package/dist/service/dynamodb/stream/sim-dynamodb-stream.d.ts.map +1 -1
  157. package/dist/service/dynamodb/stream/sim-dynamodb-stream.js +18 -0
  158. package/dist/service/dynamodb/stream/sim-dynamodb-stream.js.map +1 -1
  159. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-orders.factory.d.ts +31 -0
  160. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-orders.factory.d.ts.map +1 -0
  161. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-orders.factory.js +33 -0
  162. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-orders.factory.js.map +1 -0
  163. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-properties.d.ts +14 -0
  164. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-properties.d.ts.map +1 -1
  165. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-properties.js +29 -1
  166. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-properties.js.map +1 -1
  167. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-property-rules.d.ts.map +1 -1
  168. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-property-rules.js +8 -2
  169. package/dist/service/lambda/cfn/event-source-mapping/sim-cfn-lambda-event-source-mapping-property-rules.js.map +1 -1
  170. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.d.ts +2 -0
  171. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.d.ts.map +1 -1
  172. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.js +7 -1
  173. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.js.map +1 -1
  174. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.d.ts.map +1 -1
  175. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.js +25 -7
  176. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.js.map +1 -1
  177. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.d.ts +4 -0
  178. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.d.ts.map +1 -1
  179. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.js +4 -0
  180. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.js.map +1 -1
  181. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.d.ts +5 -2
  182. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.d.ts.map +1 -1
  183. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.js +12 -8
  184. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.js.map +1 -1
  185. package/dist/service/lambda/command/event-source-mapping/sim-lambda-event-source-mapping-commands.d.ts +3 -1
  186. package/dist/service/lambda/command/event-source-mapping/sim-lambda-event-source-mapping-commands.d.ts.map +1 -1
  187. package/dist/service/lambda/command/event-source-mapping/sim-lambda-event-source-mapping-commands.js +1 -1
  188. package/dist/service/lambda/command/event-source-mapping/sim-lambda-event-source-mapping-commands.js.map +1 -1
  189. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-event-image.d.ts +23 -0
  190. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-event-image.d.ts.map +1 -0
  191. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-event-image.js +55 -0
  192. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-event-image.js.map +1 -0
  193. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-polled-stream.d.ts +27 -0
  194. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-polled-stream.d.ts.map +1 -0
  195. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-polled-stream.js +41 -0
  196. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-polled-stream.js.map +1 -0
  197. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.d.ts +42 -0
  198. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.d.ts.map +1 -0
  199. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.js +52 -0
  200. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-delivery.js.map +1 -0
  201. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event-source-poller.d.ts +77 -0
  202. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event-source-poller.d.ts.map +1 -0
  203. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event-source-poller.js +114 -0
  204. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event-source-poller.js.map +1 -0
  205. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.d.ts +21 -0
  206. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.d.ts.map +1 -0
  207. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.js +56 -0
  208. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.js.map +1 -0
  209. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.types.d.ts +78 -0
  210. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.types.d.ts.map +1 -0
  211. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.types.js +8 -0
  212. package/dist/service/lambda/event-source/poll/sim-lambda-dynamodb-stream-event.types.js.map +1 -0
  213. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.d.ts +40 -0
  214. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.d.ts.map +1 -0
  215. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.js +45 -0
  216. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.js.map +1 -0
  217. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.d.ts +5 -4
  218. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.d.ts.map +1 -1
  219. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.js +18 -5
  220. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.js.map +1 -1
  221. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.d.ts +37 -0
  222. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.d.ts.map +1 -0
  223. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.js +51 -0
  224. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.js.map +1 -0
  225. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.d.ts +29 -0
  226. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.d.ts.map +1 -0
  227. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.js +71 -0
  228. package/dist/service/lambda/event-source/poll/sim-lambda-stream-batch-response.js.map +1 -0
  229. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.d.ts +36 -0
  230. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.d.ts.map +1 -0
  231. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.js +41 -0
  232. package/dist/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.js.map +1 -0
  233. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.d.ts +65 -0
  234. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.d.ts.map +1 -0
  235. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.js +92 -0
  236. package/dist/service/lambda/event-source/poll/sim-lambda-stream-progress.js.map +1 -0
  237. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.d.ts +36 -0
  238. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.d.ts.map +1 -0
  239. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.js +47 -0
  240. package/dist/service/lambda/event-source/poll/sim-lambda-stream-retry-backoff.js.map +1 -0
  241. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.d.ts +7 -1
  242. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.d.ts.map +1 -1
  243. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.js +10 -27
  244. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.js.map +1 -1
  245. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.d.ts +24 -0
  246. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.d.ts.map +1 -0
  247. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.js +33 -0
  248. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-rules.js.map +1 -0
  249. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.d.ts +6 -4
  250. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.d.ts.map +1 -1
  251. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.js +8 -5
  252. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.js.map +1 -1
  253. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.d.ts +5 -1
  254. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.d.ts.map +1 -1
  255. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.js +8 -3
  256. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.js.map +1 -1
  257. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.d.ts +9 -0
  258. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.d.ts.map +1 -1
  259. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.js +8 -0
  260. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.js.map +1 -1
  261. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.d.ts +2 -0
  262. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.d.ts.map +1 -1
  263. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.js.map +1 -1
  264. package/dist/service/lambda/event-source/sim-lambda-event-source-reachable.d.ts +27 -0
  265. package/dist/service/lambda/event-source/sim-lambda-event-source-reachable.d.ts.map +1 -0
  266. package/dist/service/lambda/event-source/sim-lambda-event-source-reachable.js +40 -0
  267. package/dist/service/lambda/event-source/sim-lambda-event-source-reachable.js.map +1 -0
  268. package/dist/service/lambda/event-source/sim-lambda-event-source-starting-position.d.ts +60 -0
  269. package/dist/service/lambda/event-source/sim-lambda-event-source-starting-position.d.ts.map +1 -0
  270. package/dist/service/lambda/event-source/sim-lambda-event-source-starting-position.js +51 -0
  271. package/dist/service/lambda/event-source/sim-lambda-event-source-starting-position.js.map +1 -0
  272. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-positions.d.ts +31 -0
  273. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-positions.d.ts.map +1 -0
  274. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-positions.js +29 -0
  275. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-positions.js.map +1 -0
  276. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-reader.d.ts +32 -0
  277. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-reader.d.ts.map +1 -0
  278. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-reader.js +48 -0
  279. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-reader.js.map +1 -0
  280. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-shard.d.ts +28 -0
  281. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-shard.d.ts.map +1 -0
  282. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-shard.js +71 -0
  283. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-stream-shard.js.map +1 -0
  284. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-streams.d.ts +42 -0
  285. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-streams.d.ts.map +1 -0
  286. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-streams.js +55 -0
  287. package/dist/service/lambda/event-source/stream/sim-dynamodb-event-source-streams.js.map +1 -0
  288. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-attribute-value.d.ts +150 -0
  289. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-attribute-value.d.ts.map +1 -0
  290. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-attribute-value.js +2 -0
  291. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-attribute-value.js.map +1 -0
  292. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.d.ts +52 -0
  293. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.d.ts.map +1 -0
  294. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.js +88 -0
  295. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-arn.js.map +1 -0
  296. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.d.ts +25 -0
  297. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.d.ts.map +1 -0
  298. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.js +34 -0
  299. package/dist/service/lambda/event-source/stream/sim-lambda-dynamodb-stream-event-source-rules.js.map +1 -0
  300. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-delivery-context.d.ts +31 -0
  301. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-delivery-context.d.ts.map +1 -0
  302. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-delivery-context.js +33 -0
  303. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-delivery-context.js.map +1 -0
  304. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-stream-service.d.ts +73 -0
  305. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-stream-service.d.ts.map +1 -0
  306. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-stream-service.js +2 -0
  307. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-stream-service.js.map +1 -0
  308. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-streams.d.ts +148 -0
  309. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-streams.d.ts.map +1 -0
  310. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-streams.js +37 -0
  311. package/dist/service/lambda/event-source/stream/sim-lambda-event-source-streams.js.map +1 -0
  312. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade-guard.d.ts +36 -0
  313. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade-guard.d.ts.map +1 -0
  314. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade-guard.js +50 -0
  315. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade-guard.js.map +1 -0
  316. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade.error.d.ts +24 -0
  317. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade.error.d.ts.map +1 -0
  318. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade.error.js +24 -0
  319. package/dist/service/lambda/event-source/stream/sim-lambda-stream-cascade.error.js.map +1 -0
  320. package/dist/service/lambda/index.d.ts +3 -0
  321. package/dist/service/lambda/index.d.ts.map +1 -1
  322. package/dist/service/lambda/index.js +1 -0
  323. package/dist/service/lambda/index.js.map +1 -1
  324. package/dist/service/lambda/sim-lambda-commands.d.ts +2 -0
  325. package/dist/service/lambda/sim-lambda-commands.d.ts.map +1 -1
  326. package/dist/service/lambda/sim-lambda-commands.js +7 -3
  327. package/dist/service/lambda/sim-lambda-commands.js.map +1 -1
  328. package/package.json +3 -2
@@ -0,0 +1,40 @@
1
+ /**
2
+ * What a turn is taken on behalf of.
3
+ */
4
+ export interface SimLambdaEventSourcePolls {
5
+ /**
6
+ * Poll once.
7
+ */
8
+ poll(): Promise<void>;
9
+ /**
10
+ * Poll again as soon as the simulation gets to it.
11
+ */
12
+ pollNow(): void;
13
+ }
14
+ /**
15
+ * One poll at a time, remembering a wake-up that arrived during one.
16
+ *
17
+ * A stream mapping cannot have two polls overlapping. Reading a stream record
18
+ * leaves it where it is, unlike receiving a message, so a second poll reading
19
+ * from the same checkpoint would hand the same records to the function again.
20
+ *
21
+ * Dropping the second poll instead is not safe either. The poll schedule clears
22
+ * its own flag when the task starts rather than when it finishes, so a write
23
+ * landing mid-poll does schedule a further poll, and a poll that returned
24
+ * without noting it would leave those records sitting until an unrelated later
25
+ * write happened to wake the mapping.
26
+ */
27
+ export declare class SimLambdaEventSourcePollTurn {
28
+ private readonly poller;
29
+ private running;
30
+ private asked;
31
+ constructor(poller: SimLambdaEventSourcePolls);
32
+ /**
33
+ * Take a turn, or note that one was asked for while a turn is being taken.
34
+ *
35
+ * The poll asked for during a turn is scheduled once the turn is over rather
36
+ * than run here, so the two never overlap.
37
+ */
38
+ take(): Promise<void>;
39
+ }
40
+ //# sourceMappingURL=sim-lambda-event-source-poll-turn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-event-source-poll-turn.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IAEtB,YAAY,MAAM,EAAE,yBAAyB,EAE5C;IAED;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmB1B;CACF"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * One poll at a time, remembering a wake-up that arrived during one.
3
+ *
4
+ * A stream mapping cannot have two polls overlapping. Reading a stream record
5
+ * leaves it where it is, unlike receiving a message, so a second poll reading
6
+ * from the same checkpoint would hand the same records to the function again.
7
+ *
8
+ * Dropping the second poll instead is not safe either. The poll schedule clears
9
+ * its own flag when the task starts rather than when it finishes, so a write
10
+ * landing mid-poll does schedule a further poll, and a poll that returned
11
+ * without noting it would leave those records sitting until an unrelated later
12
+ * write happened to wake the mapping.
13
+ */
14
+ export class SimLambdaEventSourcePollTurn {
15
+ poller;
16
+ running = false;
17
+ asked = false;
18
+ constructor(poller) {
19
+ this.poller = poller;
20
+ }
21
+ /**
22
+ * Take a turn, or note that one was asked for while a turn is being taken.
23
+ *
24
+ * The poll asked for during a turn is scheduled once the turn is over rather
25
+ * than run here, so the two never overlap.
26
+ */
27
+ async take() {
28
+ if (this.running) {
29
+ this.asked = true;
30
+ return;
31
+ }
32
+ this.running = true;
33
+ try {
34
+ await this.poller.poll();
35
+ }
36
+ finally {
37
+ this.running = false;
38
+ if (this.asked) {
39
+ this.asked = false;
40
+ this.poller.pollNow();
41
+ }
42
+ }
43
+ }
44
+ }
45
+ //# sourceMappingURL=sim-lambda-event-source-poll-turn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-event-source-poll-turn.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poll-turn.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,4BAA4B;IACtB,MAAM,CAA4B;IAC3C,OAAO,GAAG,KAAK,CAAC;IAChB,KAAK,GAAG,KAAK,CAAC;IAEtB,YAAY,MAAiC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAElB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAC3B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YAErB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -3,12 +3,14 @@ import type { SimLambdaFunctionLookup } from "../../function/url/sim-lambda-func
3
3
  import type { SimLambdaEventSourceQueues } from "../queue/sim-lambda-event-source-queues.js";
4
4
  import type { SimLambdaEventSourceArn } from "../sim-lambda-event-source-arn.js";
5
5
  import type { SimLambdaEventSourceMapping } from "../sim-lambda-event-source-mapping.js";
6
+ import type { SimLambdaEventSourceStreams } from "../stream/sim-lambda-event-source-streams.js";
6
7
  import type { SimLambdaEventSourcePoller } from "./sim-lambda-event-source-poller.js";
7
8
  export interface SimLambdaEventSourcePollerProperties {
8
9
  readonly mapping: SimLambdaEventSourceMapping;
9
10
  readonly eventSourceArn: SimLambdaEventSourceArn;
10
11
  readonly functions: SimLambdaFunctionLookup;
11
12
  readonly queues: SimLambdaEventSourceQueues;
13
+ readonly streams: SimLambdaEventSourceStreams;
12
14
  readonly background: BackgroundScheduler;
13
15
  }
14
16
  /**
@@ -16,10 +18,9 @@ export interface SimLambdaEventSourcePollerProperties {
16
18
  *
17
19
  * Which poller a mapping gets is decided here rather than by whoever starts
18
20
  * one, so adding a kind of source is a change here rather than a change to
19
- * everything a poller touches. There is one kind so far, so this hands the ARN
20
- * straight to the queue poller: the queue poller only accepts a queue ARN, so a
21
- * second kind of source fails to compile here rather than being polled as a
22
- * queue.
21
+ * everything a poller touches. Each poller only accepts the ARN of the source
22
+ * it polls, so a source given to the wrong one fails to compile here rather
23
+ * than being polled as something it is not.
23
24
  */
24
25
  export declare function makeSimLambdaEventSourcePoller(properties: SimLambdaEventSourcePollerProperties): SimLambdaEventSourcePoller;
25
26
  //# sourceMappingURL=sim-lambda-event-source-poller-factory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-lambda-event-source-poller-factory.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGtF,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,uBAAuB,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,oCAAoC,GAC/C,0BAA0B,CAI5B"}
1
+ {"version":3,"file":"sim-lambda-event-source-poller-factory.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAC7F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAEhG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAGtF,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,uBAAuB,CAAC;IACjD,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,oCAAoC,GAC/C,0BAA0B,CAkB5B"}
@@ -1,16 +1,29 @@
1
+ import { SimLambdaDynamoDbStreamEventSourcePoller } from "./sim-lambda-dynamodb-stream-event-source-poller.js";
1
2
  import { SimLambdaSqsEventSourcePoller } from "./sim-lambda-sqs-event-source-poller.js";
2
3
  /**
3
4
  * The poller for the kind of event source a mapping names.
4
5
  *
5
6
  * Which poller a mapping gets is decided here rather than by whoever starts
6
7
  * one, so adding a kind of source is a change here rather than a change to
7
- * everything a poller touches. There is one kind so far, so this hands the ARN
8
- * straight to the queue poller: the queue poller only accepts a queue ARN, so a
9
- * second kind of source fails to compile here rather than being polled as a
10
- * queue.
8
+ * everything a poller touches. Each poller only accepts the ARN of the source
9
+ * it polls, so a source given to the wrong one fails to compile here rather
10
+ * than being polled as something it is not.
11
11
  */
12
12
  export function makeSimLambdaEventSourcePoller(properties) {
13
13
  const { eventSourceArn } = properties;
14
- return new SimLambdaSqsEventSourcePoller({ ...properties, eventSourceArn });
14
+ switch (eventSourceArn.kind) {
15
+ case "sqs": {
16
+ return new SimLambdaSqsEventSourcePoller({
17
+ ...properties,
18
+ eventSourceArn,
19
+ });
20
+ }
21
+ case "dynamodb-stream": {
22
+ return new SimLambdaDynamoDbStreamEventSourcePoller({
23
+ ...properties,
24
+ eventSourceArn,
25
+ });
26
+ }
27
+ }
15
28
  }
16
29
  //# sourceMappingURL=sim-lambda-event-source-poller-factory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-lambda-event-source-poller-factory.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAUxF;;;;;;;;;GASG;AACH,MAAM,UAAU,8BAA8B,CAC5C,UAAgD;IAEhD,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;IAEtC,OAAO,IAAI,6BAA6B,CAAC,EAAE,GAAG,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;AAC9E,CAAC"}
1
+ {"version":3,"file":"sim-lambda-event-source-poller-factory.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wCAAwC,EAAE,MAAM,qDAAqD,CAAC;AAE/G,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAWxF;;;;;;;;GAQG;AACH,MAAM,UAAU,8BAA8B,CAC5C,UAAgD;IAEhD,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC;IAEtC,QAAQ,cAAc,CAAC,IAAI,EAAE,CAAC;QAC5B,KAAK,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,6BAA6B,CAAC;gBACvC,GAAG,UAAU;gBACb,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QAED,KAAK,iBAAiB,EAAE,CAAC;YACvB,OAAO,IAAI,wCAAwC,CAAC;gBAClD,GAAG,UAAU;gBACb,cAAc;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { SimLambdaEventSourceStreamPosition } from "../stream/sim-lambda-event-source-streams.js";
2
+ /**
3
+ * What became of one batch of stream records handed to a function.
4
+ *
5
+ * A queue batch splits into the messages that were handled and the ones that
6
+ * go back, because each message is deleted or returned on its own. A stream
7
+ * batch does not split. The mapping holds one place on the shard, so the answer
8
+ * is one place: either the batch is finished with, or reading goes back to a
9
+ * record and everything from there is delivered again.
10
+ */
11
+ export declare class SimLambdaStreamBatchOutcome {
12
+ readonly isHandled: boolean;
13
+ private readonly rewindTo;
14
+ private constructor();
15
+ /**
16
+ * A batch the function took in full.
17
+ */
18
+ static handled(): SimLambdaStreamBatchOutcome;
19
+ /**
20
+ * A batch the function did not take, which is read again from where it was.
21
+ */
22
+ static failed(): SimLambdaStreamBatchOutcome;
23
+ /**
24
+ * A batch the function reported failing partway through, which is read again
25
+ * from the record it named.
26
+ */
27
+ static failedFrom(sequenceNumber: string): SimLambdaStreamBatchOutcome;
28
+ /**
29
+ * Where the next read starts when the batch goes back.
30
+ *
31
+ * A batch that failed whole goes back to where it was read from, which is the
32
+ * place handed in. One the function reported on goes back to the record it
33
+ * named, which may be behind or ahead of that place.
34
+ */
35
+ retryPosition(readFrom: SimLambdaEventSourceStreamPosition): SimLambdaEventSourceStreamPosition;
36
+ }
37
+ //# sourceMappingURL=sim-lambda-stream-batch-outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-batch-outcome.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AAEvG;;;;;;;;GAQG;AACH,qBAAa,2BAA2B;IACtC,SAAgB,SAAS,EAAE,OAAO,CAAC;IAEnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAE9C,OAAO,eAGN;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,IAAI,2BAA2B,CAE5C;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,IAAI,2BAA2B,CAE3C;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,2BAA2B,CAErE;IAED;;;;;;OAMG;IACH,aAAa,CACX,QAAQ,EAAE,kCAAkC,GAC3C,kCAAkC,CAQpC;CACF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * What became of one batch of stream records handed to a function.
3
+ *
4
+ * A queue batch splits into the messages that were handled and the ones that
5
+ * go back, because each message is deleted or returned on its own. A stream
6
+ * batch does not split. The mapping holds one place on the shard, so the answer
7
+ * is one place: either the batch is finished with, or reading goes back to a
8
+ * record and everything from there is delivered again.
9
+ */
10
+ export class SimLambdaStreamBatchOutcome {
11
+ isHandled;
12
+ rewindTo;
13
+ constructor(isHandled, rewindTo) {
14
+ this.isHandled = isHandled;
15
+ this.rewindTo = rewindTo;
16
+ }
17
+ /**
18
+ * A batch the function took in full.
19
+ */
20
+ static handled() {
21
+ return new SimLambdaStreamBatchOutcome(true, undefined);
22
+ }
23
+ /**
24
+ * A batch the function did not take, which is read again from where it was.
25
+ */
26
+ static failed() {
27
+ return new SimLambdaStreamBatchOutcome(false, undefined);
28
+ }
29
+ /**
30
+ * A batch the function reported failing partway through, which is read again
31
+ * from the record it named.
32
+ */
33
+ static failedFrom(sequenceNumber) {
34
+ return new SimLambdaStreamBatchOutcome(false, sequenceNumber);
35
+ }
36
+ /**
37
+ * Where the next read starts when the batch goes back.
38
+ *
39
+ * A batch that failed whole goes back to where it was read from, which is the
40
+ * place handed in. One the function reported on goes back to the record it
41
+ * named, which may be behind or ahead of that place.
42
+ */
43
+ retryPosition(readFrom) {
44
+ const sequenceNumber = this.rewindTo;
45
+ if (sequenceNumber === undefined) {
46
+ return readFrom;
47
+ }
48
+ return { kind: "sequence", sequenceNumber };
49
+ }
50
+ }
51
+ //# sourceMappingURL=sim-lambda-stream-batch-outcome.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-batch-outcome.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-batch-outcome.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,OAAO,2BAA2B;IACtB,SAAS,CAAU;IAElB,QAAQ,CAAqB;IAE9C,YAAoB,SAAkB,EAAE,QAA4B;QAClE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO;QACZ,OAAO,IAAI,2BAA2B,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM;QACX,OAAO,IAAI,2BAA2B,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,UAAU,CAAC,cAAsB;QACtC,OAAO,IAAI,2BAA2B,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;OAMG;IACH,aAAa,CACX,QAA4C;QAE5C,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC;QAErC,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;IAC9C,CAAC;CACF"}
@@ -0,0 +1,29 @@
1
+ import type { SimLambdaEventSourceStreamRecord } from "../stream/sim-lambda-event-source-streams.js";
2
+ import { SimLambdaStreamBatchOutcome } from "./sim-lambda-stream-batch-outcome.js";
3
+ /**
4
+ * Reads what a function said about the batch of stream records it was given.
5
+ *
6
+ * A sibling of the queue's batch response rather than a variation on it, and
7
+ * the rule is the one AWS states for a stream: the lowest sequence number the
8
+ * report names becomes the checkpoint, and everything from there is delivered
9
+ * again. Records after it that the function did handle are delivered again too,
10
+ * which is why a stream consumer has to be idempotent.
11
+ *
12
+ * A report naming a record that was not in the batch returns the whole batch,
13
+ * as it does for a queue: the alternative is to guess which record was meant,
14
+ * and guessing wrong on a stream skips records rather than repeating them.
15
+ */
16
+ export declare class SimLambdaStreamBatchResponse {
17
+ private readonly batchItemFailures;
18
+ constructor(reportsBatchItemFailures: boolean);
19
+ /**
20
+ * What became of a batch the function returned from.
21
+ */
22
+ handled(records: readonly SimLambdaEventSourceStreamRecord[], result: unknown): SimLambdaStreamBatchOutcome;
23
+ /**
24
+ * What becomes of a batch the function threw on: the whole of it is read
25
+ * again.
26
+ */
27
+ failed(): SimLambdaStreamBatchOutcome;
28
+ }
29
+ //# sourceMappingURL=sim-lambda-stream-batch-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-batch-response.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-batch-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAErG,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;IAE/D,YAAY,wBAAwB,EAAE,OAAO,EAI5C;IAED;;OAEG;IACH,OAAO,CACL,OAAO,EAAE,SAAS,gCAAgC,EAAE,EACpD,MAAM,EAAE,OAAO,GACd,2BAA2B,CAc7B;IAED;;;OAGG;IACH,MAAM,IAAI,2BAA2B,CAEpC;CACF"}
@@ -0,0 +1,71 @@
1
+ import { SimLambdaBatchItemFailures } from "./sim-lambda-batch-item-failures.js";
2
+ import { SimLambdaStreamBatchOutcome } from "./sim-lambda-stream-batch-outcome.js";
3
+ /**
4
+ * Reads what a function said about the batch of stream records it was given.
5
+ *
6
+ * A sibling of the queue's batch response rather than a variation on it, and
7
+ * the rule is the one AWS states for a stream: the lowest sequence number the
8
+ * report names becomes the checkpoint, and everything from there is delivered
9
+ * again. Records after it that the function did handle are delivered again too,
10
+ * which is why a stream consumer has to be idempotent.
11
+ *
12
+ * A report naming a record that was not in the batch returns the whole batch,
13
+ * as it does for a queue: the alternative is to guess which record was meant,
14
+ * and guessing wrong on a stream skips records rather than repeating them.
15
+ */
16
+ export class SimLambdaStreamBatchResponse {
17
+ batchItemFailures;
18
+ constructor(reportsBatchItemFailures) {
19
+ this.batchItemFailures = new SimLambdaBatchItemFailures(reportsBatchItemFailures);
20
+ }
21
+ /**
22
+ * What became of a batch the function returned from.
23
+ */
24
+ handled(records, result) {
25
+ const failedIds = this.batchItemFailures.idsIn(result);
26
+ if (failedIds === undefined) {
27
+ return SimLambdaStreamBatchOutcome.handled();
28
+ }
29
+ const rewindTo = rewindPoint(failedIds, sequenceNumbersOf(records));
30
+ if (rewindTo === undefined) {
31
+ return this.failed();
32
+ }
33
+ return SimLambdaStreamBatchOutcome.failedFrom(rewindTo);
34
+ }
35
+ /**
36
+ * What becomes of a batch the function threw on: the whole of it is read
37
+ * again.
38
+ */
39
+ failed() {
40
+ return SimLambdaStreamBatchOutcome.failed();
41
+ }
42
+ }
43
+ /**
44
+ * The sequence numbers a batch's records can be named by, in stream order.
45
+ *
46
+ * A record carrying none is left out rather than given an empty name, so a
47
+ * report entry with no identifier names nothing and the whole batch goes back.
48
+ */
49
+ function sequenceNumbersOf(records) {
50
+ return records.flatMap((record) => {
51
+ const sequenceNumber = record.dynamodb?.SequenceNumber;
52
+ if (sequenceNumber === undefined || sequenceNumber === "") {
53
+ return [];
54
+ }
55
+ return [sequenceNumber];
56
+ });
57
+ }
58
+ /**
59
+ * The record a report sends the mapping back to, or undefined for a report it
60
+ * cannot be trusted.
61
+ *
62
+ * The batch is in stream order, so the first record the report names is the
63
+ * lowest sequence number it named.
64
+ */
65
+ function rewindPoint(failedIds, sequenceNumbers) {
66
+ if (failedIds.some((failedId) => !sequenceNumbers.includes(failedId))) {
67
+ return undefined;
68
+ }
69
+ return sequenceNumbers.find((sequenceNumber) => failedIds.includes(sequenceNumber));
70
+ }
71
+ //# sourceMappingURL=sim-lambda-stream-batch-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-batch-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-batch-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAEnF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,4BAA4B;IACtB,iBAAiB,CAA6B;IAE/D,YAAY,wBAAiC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,IAAI,0BAA0B,CACrD,wBAAwB,CACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CACL,OAAoD,EACpD,MAAe;QAEf,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEvD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,2BAA2B,CAAC,OAAO,EAAE,CAAC;QAC/C,CAAC;QAED,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC;QAEpE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,CAAC;QAED,OAAO,2BAA2B,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,MAAM;QACJ,OAAO,2BAA2B,CAAC,MAAM,EAAE,CAAC;IAC9C,CAAC;CACF;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACxB,OAAoD;IAEpD,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QAChC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC;QAEvD,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,KAAK,EAAE,EAAE,CAAC;YAC1D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,SAAS,WAAW,CAClB,SAA4B,EAC5B,eAAkC;IAElC,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;QACtE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE,CAC7C,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CACnC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { SimLambdaEventSourceStartingPosition } from "../sim-lambda-event-source-starting-position.js";
2
+ import type { SimLambdaEventSourceStreamPosition } from "../stream/sim-lambda-event-source-streams.js";
3
+ import type { SimLambdaStreamBatchOutcome } from "./sim-lambda-stream-batch-outcome.js";
4
+ /**
5
+ * How far along its stream one mapping has got.
6
+ *
7
+ * This is the difference between a stream and a queue. A queue hands a message
8
+ * out and hides it, so a failed batch is the queue's problem afterwards. A
9
+ * stream hands out a place, and the reader is the only thing that remembers it,
10
+ * so a batch that failed is read again from exactly where it was. The
11
+ * checkpoint therefore only moves when a batch is finished with: handled, or
12
+ * discarded after its retries.
13
+ */
14
+ export declare class SimLambdaStreamCheckpoint {
15
+ #private;
16
+ constructor(startingPosition: SimLambdaEventSourceStartingPosition);
17
+ /**
18
+ * Where the next read starts.
19
+ */
20
+ get position(): SimLambdaEventSourceStreamPosition;
21
+ /**
22
+ * Move past a batch that is finished with.
23
+ */
24
+ advanceTo(position: SimLambdaEventSourceStreamPosition): void;
25
+ /**
26
+ * Take a batch the function did not finish.
27
+ *
28
+ * A batch that failed whole is read again from where it was. One the function
29
+ * reported failing partway through moves the checkpoint to the record it
30
+ * named, so that record and everything after it goes over again, including
31
+ * the records after it that the function did handle. The records before it
32
+ * are finished with.
33
+ */
34
+ retry(outcome: SimLambdaStreamBatchOutcome): void;
35
+ }
36
+ //# sourceMappingURL=sim-lambda-stream-checkpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-checkpoint.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,iDAAiD,CAAC;AAC5G,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,8CAA8C,CAAC;AACvG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAExF;;;;;;;;;GASG;AACH,qBAAa,yBAAyB;;IAGpC,YAAY,gBAAgB,EAAE,oCAAoC,EAEjE;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,kCAAkC,CAEjD;IAED;;OAEG;IACH,SAAS,CAAC,QAAQ,EAAE,kCAAkC,GAAG,IAAI,CAE5D;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CAEhD;CACF"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * How far along its stream one mapping has got.
3
+ *
4
+ * This is the difference between a stream and a queue. A queue hands a message
5
+ * out and hides it, so a failed batch is the queue's problem afterwards. A
6
+ * stream hands out a place, and the reader is the only thing that remembers it,
7
+ * so a batch that failed is read again from exactly where it was. The
8
+ * checkpoint therefore only moves when a batch is finished with: handled, or
9
+ * discarded after its retries.
10
+ */
11
+ export class SimLambdaStreamCheckpoint {
12
+ #position;
13
+ constructor(startingPosition) {
14
+ this.#position = { kind: "starting", startingPosition };
15
+ }
16
+ /**
17
+ * Where the next read starts.
18
+ */
19
+ get position() {
20
+ return this.#position;
21
+ }
22
+ /**
23
+ * Move past a batch that is finished with.
24
+ */
25
+ advanceTo(position) {
26
+ this.#position = position;
27
+ }
28
+ /**
29
+ * Take a batch the function did not finish.
30
+ *
31
+ * A batch that failed whole is read again from where it was. One the function
32
+ * reported failing partway through moves the checkpoint to the record it
33
+ * named, so that record and everything after it goes over again, including
34
+ * the records after it that the function did handle. The records before it
35
+ * are finished with.
36
+ */
37
+ retry(outcome) {
38
+ this.#position = outcome.retryPosition(this.#position);
39
+ }
40
+ }
41
+ //# sourceMappingURL=sim-lambda-stream-checkpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-checkpoint.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-checkpoint.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,MAAM,OAAO,yBAAyB;IACpC,SAAS,CAAqC;IAE9C,YAAY,gBAAsD;QAChE,IAAI,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;IAC1D,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,QAA4C;QACpD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAoC;QACxC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,65 @@
1
+ import type { BackgroundScheduler, BackgroundTask } from "../../../../util/background/background.js";
2
+ import type { SimLambdaEventSourceMapping } from "../sim-lambda-event-source-mapping.js";
3
+ import type { SimLambdaEventSourceStreamBatch, SimLambdaEventSourceStreamPosition } from "../stream/sim-lambda-event-source-streams.js";
4
+ import type { SimLambdaStreamBatchOutcome } from "./sim-lambda-stream-batch-outcome.js";
5
+ interface SimLambdaStreamProgressProperties {
6
+ readonly mapping: SimLambdaEventSourceMapping;
7
+ readonly background: BackgroundScheduler;
8
+ readonly poll: BackgroundTask;
9
+ }
10
+ /**
11
+ * How far along its stream one mapping has got, and what it does next.
12
+ *
13
+ * The two belong together because they are the same decision. A batch the
14
+ * function took moves the checkpoint and the mapping reads on; a batch it threw
15
+ * on leaves the checkpoint where it is and the mapping tries the same records
16
+ * again after a wait; a batch it reported failing partway through moves the
17
+ * checkpoint back to the record it named. Nothing behind a failing batch is
18
+ * read until it is through, which is what it means for a stream mapping to
19
+ * block its shard.
20
+ */
21
+ export declare class SimLambdaStreamProgress {
22
+ private readonly checkpoint;
23
+ private readonly backoff;
24
+ private readonly schedule;
25
+ constructor(properties: SimLambdaStreamProgressProperties);
26
+ /**
27
+ * Poll as soon as the simulation gets to it.
28
+ */
29
+ pollNow(): void;
30
+ /**
31
+ * Where the next read starts.
32
+ */
33
+ get position(): SimLambdaEventSourceStreamPosition;
34
+ /**
35
+ * Take a read that came back with nothing.
36
+ *
37
+ * The place is still worth keeping: it is what a starting position of LATEST
38
+ * resolves to, so the mapping settles on one place to read on from rather
39
+ * than working out a new one each time.
40
+ */
41
+ caughtUp(batch: SimLambdaEventSourceStreamBatch): void;
42
+ /**
43
+ * Take what became of a batch: move past it, or wait and try it again.
44
+ */
45
+ after(outcome: SimLambdaStreamBatchOutcome, batch: SimLambdaEventSourceStreamBatch): void;
46
+ /**
47
+ * Move past a batch the function took, and read on.
48
+ */
49
+ handled(batch: SimLambdaEventSourceStreamBatch): void;
50
+ /**
51
+ * Wait and hand a failed batch over again, or give up on it.
52
+ *
53
+ * Giving up discards the records and carries on with the stream, which is
54
+ * what AWS does when a stream mapping's error handling runs out. Parking the
55
+ * shard instead would be a simulator invention.
56
+ *
57
+ * A report naming a record moves the checkpoint before the wait, so what goes
58
+ * over again is the batch from that record on. The attempts are still counted
59
+ * against the same limit: a batch that keeps failing partway through has as
60
+ * many tries as one that keeps failing whole.
61
+ */
62
+ failed(outcome: SimLambdaStreamBatchOutcome, batch: SimLambdaEventSourceStreamBatch): void;
63
+ }
64
+ export {};
65
+ //# sourceMappingURL=sim-lambda-stream-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-progress.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,KAAK,EACV,+BAA+B,EAC/B,kCAAkC,EACnC,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAIxF,UAAU,iCAAiC;IACzC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;CAC/B;AAED;;;;;;;;;;GAUG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;IACvD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;IAC7D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAE5D,YAAY,UAAU,EAAE,iCAAiC,EASxD;IAED;;OAEG;IACH,OAAO,IAAI,IAAI,CAEd;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,kCAAkC,CAEjD;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,+BAA+B,GAAG,IAAI,CAErD;IAED;;OAEG;IACH,KAAK,CACH,OAAO,EAAE,2BAA2B,EACpC,KAAK,EAAE,+BAA+B,GACrC,IAAI,CAQN;IAED;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,+BAA+B,GAAG,IAAI,CAOpD;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAO,EAAE,2BAA2B,EACpC,KAAK,EAAE,+BAA+B,GACrC,IAAI,CASN;CACF"}
@@ -0,0 +1,92 @@
1
+ import { assertDefined } from "../../../../util/type-guard/defined.js";
2
+ import { SimLambdaEventSourcePollSchedule } from "./sim-lambda-event-source-poll-schedule.js";
3
+ import { SimLambdaStreamCheckpoint } from "./sim-lambda-stream-checkpoint.js";
4
+ import { SimLambdaStreamRetryBackoff } from "./sim-lambda-stream-retry-backoff.js";
5
+ /**
6
+ * How far along its stream one mapping has got, and what it does next.
7
+ *
8
+ * The two belong together because they are the same decision. A batch the
9
+ * function took moves the checkpoint and the mapping reads on; a batch it threw
10
+ * on leaves the checkpoint where it is and the mapping tries the same records
11
+ * again after a wait; a batch it reported failing partway through moves the
12
+ * checkpoint back to the record it named. Nothing behind a failing batch is
13
+ * read until it is through, which is what it means for a stream mapping to
14
+ * block its shard.
15
+ */
16
+ export class SimLambdaStreamProgress {
17
+ checkpoint;
18
+ backoff = new SimLambdaStreamRetryBackoff();
19
+ schedule;
20
+ constructor(properties) {
21
+ // A stream mapping is refused at creation unless it names a starting
22
+ // position, so one that has got this far without one is the simulator
23
+ // having gone wrong rather than a request having been wrong.
24
+ const { startingPosition } = properties.mapping;
25
+ assertDefined(startingPosition, "DynamoDB stream mapping start position");
26
+ this.checkpoint = new SimLambdaStreamCheckpoint(startingPosition);
27
+ this.schedule = new SimLambdaEventSourcePollSchedule(properties);
28
+ }
29
+ /**
30
+ * Poll as soon as the simulation gets to it.
31
+ */
32
+ pollNow() {
33
+ this.schedule.now();
34
+ }
35
+ /**
36
+ * Where the next read starts.
37
+ */
38
+ get position() {
39
+ return this.checkpoint.position;
40
+ }
41
+ /**
42
+ * Take a read that came back with nothing.
43
+ *
44
+ * The place is still worth keeping: it is what a starting position of LATEST
45
+ * resolves to, so the mapping settles on one place to read on from rather
46
+ * than working out a new one each time.
47
+ */
48
+ caughtUp(batch) {
49
+ this.checkpoint.advanceTo(batch.next);
50
+ }
51
+ /**
52
+ * Take what became of a batch: move past it, or wait and try it again.
53
+ */
54
+ after(outcome, batch) {
55
+ if (outcome.isHandled) {
56
+ this.handled(batch);
57
+ return;
58
+ }
59
+ this.failed(outcome, batch);
60
+ }
61
+ /**
62
+ * Move past a batch the function took, and read on.
63
+ */
64
+ handled(batch) {
65
+ this.backoff.reset();
66
+ this.checkpoint.advanceTo(batch.next);
67
+ if (!batch.drained) {
68
+ this.schedule.now();
69
+ }
70
+ }
71
+ /**
72
+ * Wait and hand a failed batch over again, or give up on it.
73
+ *
74
+ * Giving up discards the records and carries on with the stream, which is
75
+ * what AWS does when a stream mapping's error handling runs out. Parking the
76
+ * shard instead would be a simulator invention.
77
+ *
78
+ * A report naming a record moves the checkpoint before the wait, so what goes
79
+ * over again is the batch from that record on. The attempts are still counted
80
+ * against the same limit: a batch that keeps failing partway through has as
81
+ * many tries as one that keeps failing whole.
82
+ */
83
+ failed(outcome, batch) {
84
+ if (this.backoff.isExhausted) {
85
+ this.handled(batch);
86
+ return;
87
+ }
88
+ this.checkpoint.retry(outcome);
89
+ this.schedule.afterSeconds(this.backoff.nextSeconds());
90
+ }
91
+ }
92
+ //# sourceMappingURL=sim-lambda-stream-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-stream-progress.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-stream-progress.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAMvE,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAE9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAQnF;;;;;;;;;;GAUG;AACH,MAAM,OAAO,uBAAuB;IACjB,UAAU,CAA4B;IACtC,OAAO,GAAG,IAAI,2BAA2B,EAAE,CAAC;IAC5C,QAAQ,CAAmC;IAE5D,YAAY,UAA6C;QACvD,qEAAqE;QACrE,sEAAsE;QACtE,6DAA6D;QAC7D,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;QAChD,aAAa,CAAC,gBAAgB,EAAE,wCAAwC,CAAC,CAAC;QAE1E,IAAI,CAAC,UAAU,GAAG,IAAI,yBAAyB,CAAC,gBAAgB,CAAC,CAAC;QAClE,IAAI,CAAC,QAAQ,GAAG,IAAI,gCAAgC,CAAC,UAAU,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,OAAO;QACL,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,KAAsC;QAC7C,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,KAAK,CACH,OAAoC,EACpC,KAAsC;QAEtC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,KAAsC;QAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEtC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,OAAoC,EACpC,KAAsC;QAEtC,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC7B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YAEpB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}