@kensio/yulin 1.1.0 → 1.2.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 (424) hide show
  1. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts +2 -2
  2. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts.map +1 -1
  3. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +10 -6
  4. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js.map +1 -1
  5. package/dist/service/aws/factory/sim-aws-account-service-cache.d.ts.map +1 -1
  6. package/dist/service/aws/factory/sim-aws-account-service-cache.js +2 -0
  7. package/dist/service/aws/factory/sim-aws-account-service-cache.js.map +1 -1
  8. package/dist/service/cloudformation/cdk/s3/bucket-notifications/configuration/sim-cdk-bucket-notification-configuration.d.ts +2 -0
  9. package/dist/service/cloudformation/cdk/s3/bucket-notifications/configuration/sim-cdk-bucket-notification-configuration.d.ts.map +1 -1
  10. package/dist/service/cloudformation/cdk/s3/bucket-notifications/configuration/sim-cdk-bucket-notification-configuration.js +15 -1
  11. package/dist/service/cloudformation/cdk/s3/bucket-notifications/configuration/sim-cdk-bucket-notification-configuration.js.map +1 -1
  12. package/dist/service/cloudformation/template/condition/sim-cfn-condition-comparison.d.ts +27 -0
  13. package/dist/service/cloudformation/template/condition/sim-cfn-condition-comparison.d.ts.map +1 -0
  14. package/dist/service/cloudformation/template/condition/sim-cfn-condition-comparison.js +44 -0
  15. package/dist/service/cloudformation/template/condition/sim-cfn-condition-comparison.js.map +1 -0
  16. package/dist/service/cloudformation/template/condition/sim-cfn-condition-evaluator.d.ts +36 -0
  17. package/dist/service/cloudformation/template/condition/sim-cfn-condition-evaluator.d.ts.map +1 -0
  18. package/dist/service/cloudformation/template/condition/sim-cfn-condition-evaluator.js +68 -0
  19. package/dist/service/cloudformation/template/condition/sim-cfn-condition-evaluator.js.map +1 -0
  20. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.d.ts +45 -0
  21. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.d.ts.map +1 -0
  22. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.js +80 -0
  23. package/dist/service/cloudformation/template/condition/sim-cfn-condition-expression.js.map +1 -0
  24. package/dist/service/cloudformation/template/condition/sim-cfn-conditions.d.ts +28 -0
  25. package/dist/service/cloudformation/template/condition/sim-cfn-conditions.d.ts.map +1 -0
  26. package/dist/service/cloudformation/template/condition/sim-cfn-conditions.js +29 -0
  27. package/dist/service/cloudformation/template/condition/sim-cfn-conditions.js.map +1 -0
  28. package/dist/service/cloudformation/template/condition/sim-cfn-resource-conditions.d.ts +46 -0
  29. package/dist/service/cloudformation/template/condition/sim-cfn-resource-conditions.d.ts.map +1 -0
  30. package/dist/service/cloudformation/template/condition/sim-cfn-resource-conditions.js +94 -0
  31. package/dist/service/cloudformation/template/condition/sim-cfn-resource-conditions.js.map +1 -0
  32. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.d.ts +0 -1
  33. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.d.ts.map +1 -1
  34. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.js +2 -14
  35. package/dist/service/cloudformation/template/node/fn/find-in-map/sim-cfn-fn-find-in-map.js.map +1 -1
  36. package/dist/service/cloudformation/template/node/fn/if/sim-cfn-fn-if.d.ts +31 -0
  37. package/dist/service/cloudformation/template/node/fn/if/sim-cfn-fn-if.d.ts.map +1 -0
  38. package/dist/service/cloudformation/template/node/fn/if/sim-cfn-fn-if.js +52 -0
  39. package/dist/service/cloudformation/template/node/fn/if/sim-cfn-fn-if.js.map +1 -0
  40. package/dist/service/cloudformation/template/node/fn/select/sim-cfn-fn-select.d.ts +39 -0
  41. package/dist/service/cloudformation/template/node/fn/select/sim-cfn-fn-select.d.ts.map +1 -0
  42. package/dist/service/cloudformation/template/node/fn/select/sim-cfn-fn-select.js +82 -0
  43. package/dist/service/cloudformation/template/node/fn/select/sim-cfn-fn-select.js.map +1 -0
  44. package/dist/service/cloudformation/template/node/fn/split/sim-cfn-fn-split.d.ts +31 -0
  45. package/dist/service/cloudformation/template/node/fn/split/sim-cfn-fn-split.d.ts.map +1 -0
  46. package/dist/service/cloudformation/template/node/fn/split/sim-cfn-fn-split.js +45 -0
  47. package/dist/service/cloudformation/template/node/fn/split/sim-cfn-fn-split.js.map +1 -0
  48. package/dist/service/cloudformation/template/node/sim-cfn-list.d.ts +1 -1
  49. package/dist/service/cloudformation/template/node/sim-cfn-list.d.ts.map +1 -1
  50. package/dist/service/cloudformation/template/node/sim-cfn-list.js +3 -2
  51. package/dist/service/cloudformation/template/node/sim-cfn-list.js.map +1 -1
  52. package/dist/service/cloudformation/template/node/sim-cfn-object.d.ts.map +1 -1
  53. package/dist/service/cloudformation/template/node/sim-cfn-object.js +5 -1
  54. package/dist/service/cloudformation/template/node/sim-cfn-object.js.map +1 -1
  55. package/dist/service/cloudformation/template/parse/fn/if/sim-cfn-fn-if-parser.d.ts +19 -0
  56. package/dist/service/cloudformation/template/parse/fn/if/sim-cfn-fn-if-parser.d.ts.map +1 -0
  57. package/dist/service/cloudformation/template/parse/fn/if/sim-cfn-fn-if-parser.js +33 -0
  58. package/dist/service/cloudformation/template/parse/fn/if/sim-cfn-fn-if-parser.js.map +1 -0
  59. package/dist/service/cloudformation/template/parse/fn/select/sim-cfn-fn-select-parser.d.ts +26 -0
  60. package/dist/service/cloudformation/template/parse/fn/select/sim-cfn-fn-select-parser.d.ts.map +1 -0
  61. package/dist/service/cloudformation/template/parse/fn/select/sim-cfn-fn-select-parser.js +35 -0
  62. package/dist/service/cloudformation/template/parse/fn/select/sim-cfn-fn-select-parser.js.map +1 -0
  63. package/dist/service/cloudformation/template/parse/fn/sim-cfn-function-parser.d.ts +3 -0
  64. package/dist/service/cloudformation/template/parse/fn/sim-cfn-function-parser.d.ts.map +1 -1
  65. package/dist/service/cloudformation/template/parse/fn/sim-cfn-function-parser.js +18 -0
  66. package/dist/service/cloudformation/template/parse/fn/sim-cfn-function-parser.js.map +1 -1
  67. package/dist/service/cloudformation/template/parse/fn/split/sim-cfn-fn-split-parser.d.ts +25 -0
  68. package/dist/service/cloudformation/template/parse/fn/split/sim-cfn-fn-split-parser.d.ts.map +1 -0
  69. package/dist/service/cloudformation/template/parse/fn/split/sim-cfn-fn-split-parser.js +36 -0
  70. package/dist/service/cloudformation/template/parse/fn/split/sim-cfn-fn-split-parser.js.map +1 -0
  71. package/dist/service/cloudformation/template/resolve/sim-cfn-resolve-context.d.ts +14 -4
  72. package/dist/service/cloudformation/template/resolve/sim-cfn-resolve-context.d.ts.map +1 -1
  73. package/dist/service/cloudformation/template/resolve/sim-cfn-resolve-context.js +7 -5
  74. package/dist/service/cloudformation/template/resolve/sim-cfn-resolve-context.js.map +1 -1
  75. package/dist/service/cloudformation/template/sim-cfn-template-body-validator.d.ts.map +1 -1
  76. package/dist/service/cloudformation/template/sim-cfn-template-body-validator.js +4 -0
  77. package/dist/service/cloudformation/template/sim-cfn-template-body-validator.js.map +1 -1
  78. package/dist/service/cloudformation/template/sim-cfn-template.d.ts +14 -0
  79. package/dist/service/cloudformation/template/sim-cfn-template.d.ts.map +1 -1
  80. package/dist/service/cloudformation/template/sim-cfn-template.js +44 -12
  81. package/dist/service/cloudformation/template/sim-cfn-template.js.map +1 -1
  82. package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.d.ts +20 -0
  83. package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.d.ts.map +1 -1
  84. package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.js +32 -2
  85. package/dist/service/cloudformation/template/value/sim-cfn-template-value-resolver.js.map +1 -1
  86. package/dist/service/cloudformation/template/value/sim-cfn-unresolved-expression.d.ts +11 -0
  87. package/dist/service/cloudformation/template/value/sim-cfn-unresolved-expression.d.ts.map +1 -0
  88. package/dist/service/cloudformation/template/value/sim-cfn-unresolved-expression.js +21 -0
  89. package/dist/service/cloudformation/template/value/sim-cfn-unresolved-expression.js.map +1 -0
  90. package/dist/service/cloudformation/template/value/sim-cfn-value-path.d.ts +22 -0
  91. package/dist/service/cloudformation/template/value/sim-cfn-value-path.d.ts.map +1 -0
  92. package/dist/service/cloudformation/template/value/sim-cfn-value-path.js +92 -0
  93. package/dist/service/cloudformation/template/value/sim-cfn-value-path.js.map +1 -0
  94. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts +7 -0
  95. package/dist/service/cloudfront/command/create-distribution/create-distribution.command.d.ts.map +1 -1
  96. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +2 -0
  97. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map +1 -1
  98. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js +1 -1
  99. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map +1 -1
  100. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.d.ts +10 -1
  101. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.d.ts.map +1 -1
  102. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.js +21 -1
  103. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.js.map +1 -1
  104. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.d.ts +24 -0
  105. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.d.ts.map +1 -0
  106. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.factory.d.ts +7 -0
  107. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.factory.d.ts.map +1 -0
  108. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.factory.js +38 -0
  109. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.factory.js.map +1 -0
  110. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.js +2 -0
  111. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-dispatcher.js.map +1 -0
  112. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts +17 -0
  113. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.d.ts.map +1 -0
  114. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js +37 -0
  115. package/dist/service/cloudfront/origin/custom/sim-cf-custom-origin-request.js.map +1 -0
  116. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.d.ts +38 -0
  117. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.d.ts.map +1 -0
  118. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.js +45 -0
  119. package/dist/service/cloudfront/origin/custom/sim-cloudfront-custom-origin.js.map +1 -0
  120. package/dist/service/cloudfront/sim-cloudfront.d.ts +3 -0
  121. package/dist/service/cloudfront/sim-cloudfront.d.ts.map +1 -1
  122. package/dist/service/cloudfront/sim-cloudfront.js +4 -1
  123. package/dist/service/cloudfront/sim-cloudfront.js.map +1 -1
  124. package/dist/service/dynamodb/command/sim-dynamodb-command-handlers.d.ts +4 -0
  125. package/dist/service/dynamodb/command/sim-dynamodb-command-handlers.d.ts.map +1 -1
  126. package/dist/service/dynamodb/command/sim-dynamodb-command-handlers.js +2 -0
  127. package/dist/service/dynamodb/command/sim-dynamodb-command-handlers.js.map +1 -1
  128. package/dist/service/dynamodb/command/table/sim-dynamodb-create-table.d.ts +6 -0
  129. package/dist/service/dynamodb/command/table/sim-dynamodb-create-table.d.ts.map +1 -1
  130. package/dist/service/dynamodb/command/table/sim-dynamodb-create-table.js +11 -0
  131. package/dist/service/dynamodb/command/table/sim-dynamodb-create-table.js.map +1 -1
  132. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-table-input.d.ts +6 -5
  133. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-table-input.d.ts.map +1 -1
  134. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-table-input.js +6 -16
  135. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-table-input.js.map +1 -1
  136. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-update-input.d.ts +4 -4
  137. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-update-input.d.ts.map +1 -1
  138. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-update-input.js +4 -9
  139. package/dist/service/dynamodb/command/table/sim-dynamodb-unsimulated-update-input.js.map +1 -1
  140. package/dist/service/dynamodb/command/table/table.command.d.ts +2 -1
  141. package/dist/service/dynamodb/command/table/table.command.d.ts.map +1 -1
  142. package/dist/service/dynamodb/command/table/table.types.d.ts +4 -7
  143. package/dist/service/dynamodb/command/table/table.types.d.ts.map +1 -1
  144. package/dist/service/dynamodb/sim-dynamodb.d.ts +42 -60
  145. package/dist/service/dynamodb/sim-dynamodb.d.ts.map +1 -1
  146. package/dist/service/dynamodb/sim-dynamodb.js +48 -60
  147. package/dist/service/dynamodb/sim-dynamodb.js.map +1 -1
  148. package/dist/service/dynamodb/stream/sim-dynamodb-item-change.d.ts +34 -0
  149. package/dist/service/dynamodb/stream/sim-dynamodb-item-change.d.ts.map +1 -0
  150. package/dist/service/dynamodb/stream/sim-dynamodb-item-change.js +2 -0
  151. package/dist/service/dynamodb/stream/sim-dynamodb-item-change.js.map +1 -0
  152. package/dist/service/dynamodb/stream/sim-dynamodb-stream-activity.d.ts +42 -0
  153. package/dist/service/dynamodb/stream/sim-dynamodb-stream-activity.d.ts.map +1 -0
  154. package/dist/service/dynamodb/stream/sim-dynamodb-stream-activity.js +35 -0
  155. package/dist/service/dynamodb/stream/sim-dynamodb-stream-activity.js.map +1 -0
  156. package/dist/service/dynamodb/stream/sim-dynamodb-stream-arn.d.ts +22 -0
  157. package/dist/service/dynamodb/stream/sim-dynamodb-stream-arn.d.ts.map +1 -0
  158. package/dist/service/dynamodb/stream/sim-dynamodb-stream-arn.js +30 -0
  159. package/dist/service/dynamodb/stream/sim-dynamodb-stream-arn.js.map +1 -0
  160. package/dist/service/dynamodb/stream/sim-dynamodb-stream-images.d.ts +22 -0
  161. package/dist/service/dynamodb/stream/sim-dynamodb-stream-images.d.ts.map +1 -0
  162. package/dist/service/dynamodb/stream/sim-dynamodb-stream-images.js +27 -0
  163. package/dist/service/dynamodb/stream/sim-dynamodb-stream-images.js.map +1 -0
  164. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-keys.d.ts +15 -0
  165. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-keys.d.ts.map +1 -0
  166. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-keys.js +25 -0
  167. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-keys.js.map +1 -0
  168. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-size.d.ts +11 -0
  169. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-size.d.ts.map +1 -0
  170. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-size.js +74 -0
  171. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record-size.js.map +1 -0
  172. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record.d.ts +49 -0
  173. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record.d.ts.map +1 -0
  174. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record.js +60 -0
  175. package/dist/service/dynamodb/stream/sim-dynamodb-stream-record.js.map +1 -0
  176. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.d.ts +18 -0
  177. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.d.ts.map +1 -0
  178. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.js +31 -0
  179. package/dist/service/dynamodb/stream/sim-dynamodb-stream-sequence-numbers.js.map +1 -0
  180. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.d.ts +39 -0
  181. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.d.ts.map +1 -0
  182. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.js +64 -0
  183. package/dist/service/dynamodb/stream/sim-dynamodb-stream-shard.js.map +1 -0
  184. package/dist/service/dynamodb/stream/sim-dynamodb-stream-specification.d.ts +28 -0
  185. package/dist/service/dynamodb/stream/sim-dynamodb-stream-specification.d.ts.map +1 -0
  186. package/dist/service/dynamodb/stream/sim-dynamodb-stream-specification.js +30 -0
  187. package/dist/service/dynamodb/stream/sim-dynamodb-stream-specification.js.map +1 -0
  188. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.d.ts +26 -0
  189. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.d.ts.map +1 -0
  190. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.js +29 -0
  191. package/dist/service/dynamodb/stream/sim-dynamodb-stream-store.js.map +1 -0
  192. package/dist/service/dynamodb/stream/sim-dynamodb-stream-update.d.ts +13 -0
  193. package/dist/service/dynamodb/stream/sim-dynamodb-stream-update.d.ts.map +1 -0
  194. package/dist/service/dynamodb/stream/sim-dynamodb-stream-update.js +48 -0
  195. package/dist/service/dynamodb/stream/sim-dynamodb-stream-update.js.map +1 -0
  196. package/dist/service/dynamodb/stream/sim-dynamodb-stream-view-type.d.ts +10 -0
  197. package/dist/service/dynamodb/stream/sim-dynamodb-stream-view-type.d.ts.map +1 -0
  198. package/dist/service/dynamodb/stream/sim-dynamodb-stream-view-type.js +38 -0
  199. package/dist/service/dynamodb/stream/sim-dynamodb-stream-view-type.js.map +1 -0
  200. package/dist/service/dynamodb/stream/sim-dynamodb-stream.d.ts +74 -0
  201. package/dist/service/dynamodb/stream/sim-dynamodb-stream.d.ts.map +1 -0
  202. package/dist/service/dynamodb/stream/sim-dynamodb-stream.js +82 -0
  203. package/dist/service/dynamodb/stream/sim-dynamodb-stream.js.map +1 -0
  204. package/dist/service/dynamodb/stream/sim-dynamodb-stream.types.d.ts +24 -0
  205. package/dist/service/dynamodb/stream/sim-dynamodb-stream.types.d.ts.map +1 -0
  206. package/dist/service/dynamodb/stream/sim-dynamodb-stream.types.js +2 -0
  207. package/dist/service/dynamodb/stream/sim-dynamodb-stream.types.js.map +1 -0
  208. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-table.factory.d.ts +31 -0
  209. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-table.factory.d.ts.map +1 -0
  210. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-table.factory.js +45 -0
  211. package/dist/service/dynamodb/stream/sim-dynamodb-streamed-table.factory.js.map +1 -0
  212. package/dist/service/dynamodb/stream/sim-dynamodb-table-stream.d.ts +97 -0
  213. package/dist/service/dynamodb/stream/sim-dynamodb-table-stream.d.ts.map +1 -0
  214. package/dist/service/dynamodb/stream/sim-dynamodb-table-stream.js +135 -0
  215. package/dist/service/dynamodb/stream/sim-dynamodb-table-stream.js.map +1 -0
  216. package/dist/service/dynamodb/table/sim-dynamodb-table-description.d.ts.map +1 -1
  217. package/dist/service/dynamodb/table/sim-dynamodb-table-description.js +6 -0
  218. package/dist/service/dynamodb/table/sim-dynamodb-table-description.js.map +1 -1
  219. package/dist/service/dynamodb/table/sim-dynamodb-table-items.d.ts +33 -1
  220. package/dist/service/dynamodb/table/sim-dynamodb-table-items.d.ts.map +1 -1
  221. package/dist/service/dynamodb/table/sim-dynamodb-table-items.js +46 -1
  222. package/dist/service/dynamodb/table/sim-dynamodb-table-items.js.map +1 -1
  223. package/dist/service/dynamodb/table/sim-dynamodb-table-storage.d.ts +95 -0
  224. package/dist/service/dynamodb/table/sim-dynamodb-table-storage.d.ts.map +1 -0
  225. package/dist/service/dynamodb/table/sim-dynamodb-table-storage.js +120 -0
  226. package/dist/service/dynamodb/table/sim-dynamodb-table-storage.js.map +1 -0
  227. package/dist/service/dynamodb/table/sim-dynamodb-table-update.d.ts +2 -0
  228. package/dist/service/dynamodb/table/sim-dynamodb-table-update.d.ts.map +1 -1
  229. package/dist/service/dynamodb/table/sim-dynamodb-table-update.js +11 -6
  230. package/dist/service/dynamodb/table/sim-dynamodb-table-update.js.map +1 -1
  231. package/dist/service/dynamodb/table/sim-dynamodb-table.d.ts +33 -70
  232. package/dist/service/dynamodb/table/sim-dynamodb-table.d.ts.map +1 -1
  233. package/dist/service/dynamodb/table/sim-dynamodb-table.js +50 -93
  234. package/dist/service/dynamodb/table/sim-dynamodb-table.js.map +1 -1
  235. package/dist/service/dynamodb/table/sim-dynamodb-updatable-table.d.ts +6 -3
  236. package/dist/service/dynamodb/table/sim-dynamodb-updatable-table.d.ts.map +1 -1
  237. package/dist/service/dynamodb/time-to-live/sim-dynamodb-table-time-to-live.d.ts.map +1 -1
  238. package/dist/service/dynamodb/time-to-live/sim-dynamodb-table-time-to-live.js +5 -1
  239. package/dist/service/dynamodb/time-to-live/sim-dynamodb-table-time-to-live.js.map +1 -1
  240. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.d.ts +5 -2
  241. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.d.ts.map +1 -1
  242. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.js +13 -8
  243. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-input.js.map +1 -1
  244. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.d.ts +4 -0
  245. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.d.ts.map +1 -1
  246. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.js +32 -21
  247. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-refusals.js.map +1 -1
  248. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.d.ts +1 -6
  249. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.d.ts.map +1 -1
  250. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.js +1 -22
  251. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping-values.js.map +1 -1
  252. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.d.ts +2 -1
  253. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.d.ts.map +1 -1
  254. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.js +3 -2
  255. package/dist/service/lambda/command/event-source-mapping/create-event-source-mapping.handler.js.map +1 -1
  256. package/dist/service/lambda/event-source/poll/sim-lambda-batch-item-failures.d.ts +17 -0
  257. package/dist/service/lambda/event-source/poll/sim-lambda-batch-item-failures.d.ts.map +1 -0
  258. package/dist/service/lambda/event-source/poll/sim-lambda-batch-item-failures.js +46 -0
  259. package/dist/service/lambda/event-source/poll/sim-lambda-batch-item-failures.js.map +1 -0
  260. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-batch-response.d.ts +39 -0
  261. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-batch-response.d.ts.map +1 -0
  262. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-batch-response.js +28 -0
  263. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-batch-response.js.map +1 -0
  264. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-delivery.d.ts +33 -7
  265. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-delivery.d.ts.map +1 -1
  266. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-delivery.js +7 -6
  267. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-delivery.js.map +1 -1
  268. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.d.ts +25 -0
  269. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.d.ts.map +1 -0
  270. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.js +16 -0
  271. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller-factory.js.map +1 -0
  272. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller.d.ts +9 -69
  273. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller.d.ts.map +1 -1
  274. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller.js +1 -135
  275. package/dist/service/lambda/event-source/poll/sim-lambda-event-source-poller.js.map +1 -1
  276. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.d.ts +6 -30
  277. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.d.ts.map +1 -1
  278. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.js +9 -66
  279. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.js.map +1 -1
  280. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-delivery.d.ts +17 -0
  281. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-delivery.d.ts.map +1 -0
  282. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-delivery.js +17 -0
  283. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-delivery.js.map +1 -0
  284. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.d.ts +88 -0
  285. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.d.ts.map +1 -0
  286. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.js +132 -0
  287. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.js.map +1 -0
  288. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-polled-queue.d.ts +41 -0
  289. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-polled-queue.d.ts.map +1 -0
  290. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-polled-queue.js +60 -0
  291. package/dist/service/lambda/event-source/poll/sim-lambda-sqs-polled-queue.js.map +1 -0
  292. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.d.ts +23 -5
  293. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.d.ts.map +1 -1
  294. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.js +65 -12
  295. package/dist/service/lambda/event-source/queue/sim-lambda-sqs-event-source-arn.js.map +1 -1
  296. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.d.ts +23 -0
  297. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.d.ts.map +1 -0
  298. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.js +30 -0
  299. package/dist/service/lambda/event-source/sim-lambda-event-source-arn.js.map +1 -0
  300. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.d.ts +26 -0
  301. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.d.ts.map +1 -0
  302. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.js +35 -0
  303. package/dist/service/lambda/event-source/sim-lambda-event-source-batch-rules.js.map +1 -0
  304. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.d.ts +6 -8
  305. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.d.ts.map +1 -1
  306. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.js +6 -9
  307. package/dist/service/lambda/event-source/sim-lambda-event-source-mapping.js.map +1 -1
  308. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.d.ts +5 -5
  309. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.d.ts.map +1 -1
  310. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.js +5 -5
  311. package/dist/service/lambda/event-source/sim-lambda-event-source-pollers.js.map +1 -1
  312. package/dist/service/lambda/event-source/sim-lambda-event-source-polling-permission.d.ts +18 -0
  313. package/dist/service/lambda/event-source/sim-lambda-event-source-polling-permission.d.ts.map +1 -0
  314. package/dist/service/lambda/event-source/sim-lambda-event-source-polling-permission.js +23 -0
  315. package/dist/service/lambda/event-source/sim-lambda-event-source-polling-permission.js.map +1 -0
  316. package/dist/service/lambda/event-source/sim-lambda-event-source-role-permissions.d.ts +7 -3
  317. package/dist/service/lambda/event-source/sim-lambda-event-source-role-permissions.d.ts.map +1 -1
  318. package/dist/service/lambda/event-source/sim-lambda-event-source-role-permissions.js +13 -21
  319. package/dist/service/lambda/event-source/sim-lambda-event-source-role-permissions.js.map +1 -1
  320. package/dist/service/s3/bucket/notification/sim-s3-lambda-notification.d.ts +7 -25
  321. package/dist/service/s3/bucket/notification/sim-s3-lambda-notification.d.ts.map +1 -1
  322. package/dist/service/s3/bucket/notification/sim-s3-lambda-notification.js +10 -31
  323. package/dist/service/s3/bucket/notification/sim-s3-lambda-notification.js.map +1 -1
  324. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration-reader.d.ts +6 -10
  325. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration-reader.d.ts.map +1 -1
  326. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration-reader.js +16 -68
  327. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration-reader.js.map +1 -1
  328. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration.d.ts +17 -4
  329. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration.d.ts.map +1 -1
  330. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration.js +19 -10
  331. package/dist/service/s3/bucket/notification/sim-s3-notification-configuration.js.map +1 -1
  332. package/dist/service/s3/bucket/notification/sim-s3-notification-ids.d.ts +9 -0
  333. package/dist/service/s3/bucket/notification/sim-s3-notification-ids.d.ts.map +1 -0
  334. package/dist/service/s3/bucket/notification/sim-s3-notification-ids.js +18 -0
  335. package/dist/service/s3/bucket/notification/sim-s3-notification-ids.js.map +1 -0
  336. package/dist/service/s3/bucket/notification/sim-s3-notification-overlap.d.ts +5 -3
  337. package/dist/service/s3/bucket/notification/sim-s3-notification-overlap.d.ts.map +1 -1
  338. package/dist/service/s3/bucket/notification/sim-s3-notification-overlap.js +3 -1
  339. package/dist/service/s3/bucket/notification/sim-s3-notification-overlap.js.map +1 -1
  340. package/dist/service/s3/bucket/notification/sim-s3-notification-properties.d.ts +19 -0
  341. package/dist/service/s3/bucket/notification/sim-s3-notification-properties.d.ts.map +1 -0
  342. package/dist/service/s3/bucket/notification/sim-s3-notification-properties.js +27 -0
  343. package/dist/service/s3/bucket/notification/sim-s3-notification-properties.js.map +1 -0
  344. package/dist/service/s3/bucket/notification/sim-s3-notification.d.ts +61 -0
  345. package/dist/service/s3/bucket/notification/sim-s3-notification.d.ts.map +1 -0
  346. package/dist/service/s3/bucket/notification/sim-s3-notification.js +50 -0
  347. package/dist/service/s3/bucket/notification/sim-s3-notification.js.map +1 -0
  348. package/dist/service/s3/bucket/notification/sim-s3-queue-notification.d.ts +21 -0
  349. package/dist/service/s3/bucket/notification/sim-s3-queue-notification.d.ts.map +1 -0
  350. package/dist/service/s3/bucket/notification/sim-s3-queue-notification.js +24 -0
  351. package/dist/service/s3/bucket/notification/sim-s3-queue-notification.js.map +1 -0
  352. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-destinations.d.ts +10 -0
  353. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-destinations.d.ts.map +1 -0
  354. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-destinations.js +31 -0
  355. package/dist/service/s3/bucket/notification/sim-s3-unsimulated-notification-destinations.js.map +1 -0
  356. package/dist/service/s3/cfn/bucket/notification/sim-cfn-s3-bucket-notification-configuration.d.ts +3 -0
  357. package/dist/service/s3/cfn/bucket/notification/sim-cfn-s3-bucket-notification-configuration.d.ts.map +1 -1
  358. package/dist/service/s3/cfn/bucket/notification/sim-cfn-s3-bucket-notification-configuration.js +30 -1
  359. package/dist/service/s3/cfn/bucket/notification/sim-cfn-s3-bucket-notification-configuration.js.map +1 -1
  360. package/dist/service/s3/command/get-bucket-notification-configuration/get-bucket-notification-configuration.command.d.ts +2 -1
  361. package/dist/service/s3/command/get-bucket-notification-configuration/get-bucket-notification-configuration.command.d.ts.map +1 -1
  362. package/dist/service/s3/command/put-bucket-notification-configuration/put-bucket-notification-configuration.command.d.ts +10 -1
  363. package/dist/service/s3/command/put-bucket-notification-configuration/put-bucket-notification-configuration.command.d.ts.map +1 -1
  364. package/dist/service/s3/notification/destination/lambda/sim-aws-s3-notification-functions.d.ts +0 -4
  365. package/dist/service/s3/notification/destination/lambda/sim-aws-s3-notification-functions.d.ts.map +1 -1
  366. package/dist/service/s3/notification/destination/lambda/sim-aws-s3-notification-functions.js +1 -4
  367. package/dist/service/s3/notification/destination/lambda/sim-aws-s3-notification-functions.js.map +1 -1
  368. package/dist/service/s3/notification/destination/sim-s3-notification-destination-check.d.ts.map +1 -1
  369. package/dist/service/s3/notification/destination/sim-s3-notification-destination-check.js +6 -4
  370. package/dist/service/s3/notification/destination/sim-s3-notification-destination-check.js.map +1 -1
  371. package/dist/service/s3/notification/destination/sim-s3-notification-destination.d.ts +20 -2
  372. package/dist/service/s3/notification/destination/sim-s3-notification-destination.d.ts.map +1 -1
  373. package/dist/service/s3/notification/destination/sim-s3-service-notification-destinations.d.ts +12 -10
  374. package/dist/service/s3/notification/destination/sim-s3-service-notification-destinations.d.ts.map +1 -1
  375. package/dist/service/s3/notification/destination/sim-s3-service-notification-destinations.js +19 -17
  376. package/dist/service/s3/notification/destination/sim-s3-service-notification-destinations.js.map +1 -1
  377. package/dist/service/s3/notification/destination/sim-s3-service-principal.d.ts +8 -0
  378. package/dist/service/s3/notification/destination/sim-s3-service-principal.d.ts.map +1 -0
  379. package/dist/service/s3/notification/destination/sim-s3-service-principal.js +8 -0
  380. package/dist/service/s3/notification/destination/sim-s3-service-principal.js.map +1 -0
  381. package/dist/service/s3/notification/destination/sqs/sim-aws-s3-notification-queues.d.ts +40 -0
  382. package/dist/service/s3/notification/destination/sqs/sim-aws-s3-notification-queues.d.ts.map +1 -0
  383. package/dist/service/s3/notification/destination/sqs/sim-aws-s3-notification-queues.js +52 -0
  384. package/dist/service/s3/notification/destination/sqs/sim-aws-s3-notification-queues.js.map +1 -0
  385. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue-arn.d.ts +33 -0
  386. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue-arn.d.ts.map +1 -0
  387. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue-arn.js +64 -0
  388. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue-arn.js.map +1 -0
  389. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue.d.ts +33 -0
  390. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue.d.ts.map +1 -0
  391. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue.js +55 -0
  392. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queue.js.map +1 -0
  393. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queues.d.ts +23 -0
  394. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queues.d.ts.map +1 -0
  395. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queues.js +2 -0
  396. package/dist/service/s3/notification/destination/sqs/sim-s3-notification-queues.js.map +1 -0
  397. package/dist/service/s3/notification/destination/sqs/sim-s3-sqs-notification-destination.d.ts +40 -0
  398. package/dist/service/s3/notification/destination/sqs/sim-s3-sqs-notification-destination.d.ts.map +1 -0
  399. package/dist/service/s3/notification/destination/sqs/sim-s3-sqs-notification-destination.js +51 -0
  400. package/dist/service/s3/notification/destination/sqs/sim-s3-sqs-notification-destination.js.map +1 -0
  401. package/dist/service/s3/notification/sim-s3-notification-dispatcher.d.ts +2 -2
  402. package/dist/service/s3/notification/sim-s3-notification-dispatcher.d.ts.map +1 -1
  403. package/dist/service/s3/notification/sim-s3-notification-dispatcher.js +6 -3
  404. package/dist/service/s3/notification/sim-s3-notification-dispatcher.js.map +1 -1
  405. package/dist/service/sqs/command/authorize/sim-sqs-condition-context.d.ts.map +1 -1
  406. package/dist/service/sqs/command/authorize/sim-sqs-condition-context.js +9 -5
  407. package/dist/service/sqs/command/authorize/sim-sqs-condition-context.js.map +1 -1
  408. package/dist/service/sqs/command/authorize/sim-sqs-service-send-authorizer.d.ts +40 -0
  409. package/dist/service/sqs/command/authorize/sim-sqs-service-send-authorizer.d.ts.map +1 -0
  410. package/dist/service/sqs/command/authorize/sim-sqs-service-send-authorizer.js +40 -0
  411. package/dist/service/sqs/command/authorize/sim-sqs-service-send-authorizer.js.map +1 -0
  412. package/dist/service/sqs/command/sim-sqs-request-options.d.ts +16 -0
  413. package/dist/service/sqs/command/sim-sqs-request-options.d.ts.map +1 -1
  414. package/dist/service/sqs/command/sim-sqs-request-options.js +9 -0
  415. package/dist/service/sqs/command/sim-sqs-request-options.js.map +1 -1
  416. package/dist/service/sqs/index.d.ts +2 -2
  417. package/dist/service/sqs/index.d.ts.map +1 -1
  418. package/dist/service/sqs/index.js +2 -2
  419. package/dist/service/sqs/index.js.map +1 -1
  420. package/dist/service/sqs/queue/sim-sqs-queue-arn.d.ts +17 -2
  421. package/dist/service/sqs/queue/sim-sqs-queue-arn.d.ts.map +1 -1
  422. package/dist/service/sqs/queue/sim-sqs-queue-arn.js +9 -5
  423. package/dist/service/sqs/queue/sim-sqs-queue-arn.js.map +1 -1
  424. package/package.json +4 -4
@@ -1,136 +1,2 @@
1
- import { SimLambdaEventSourceDelivery } from "./sim-lambda-event-source-delivery.js";
2
- import { SimLambdaEventSourcePollSchedule } from "./sim-lambda-event-source-poll-schedule.js";
3
- /**
4
- * Polls one event source mapping's queue and invokes its function.
5
- *
6
- * Real Lambda polls a queue continuously. Nothing in this simulation runs
7
- * continuously, so the queue says when a message has arrived and a poll is
8
- * scheduled in response. A test that awaits the simulation settling has
9
- * therefore watched the whole delivery happen, rather than having waited a
10
- * while and hoped.
11
- *
12
- * A batch the function returns from is deleted from the queue. A batch it
13
- * throws on is left there, which hides it for the visibility timeout and hands
14
- * it back afterwards, so a redrive policy eventually gives up on it exactly as
15
- * it would for any other failing consumer. That is why the poller invokes the
16
- * function directly rather than through the Invoke command: an asynchronous
17
- * invocation drops its handler error, and this one has to be seen.
18
- */
19
- export class SimLambdaEventSourcePoller {
20
- properties;
21
- delivery;
22
- schedule;
23
- stopped = false;
24
- constructor(properties) {
25
- this.properties = properties;
26
- this.delivery = new SimLambdaEventSourceDelivery(properties);
27
- this.schedule = new SimLambdaEventSourcePollSchedule({
28
- background: properties.background,
29
- poll: async () => {
30
- await this.run();
31
- },
32
- });
33
- }
34
- /**
35
- * Watch the queue this mapping polls.
36
- *
37
- * Watching starts as soon as the mapping is created, before it has finished
38
- * creating, so a message sent in between is not missed. The poll it wakes
39
- * finds a mapping that is not polling yet and does nothing, and the poll that
40
- * follows activation picks the message up.
41
- */
42
- watch() {
43
- this.properties.queues.watch(this.properties.eventSourceArn.value, this);
44
- }
45
- /**
46
- * Poll as soon as the simulation gets to it, which is what a newly enabled
47
- * mapping does with whatever is already on its queue.
48
- */
49
- pollNow() {
50
- this.schedule.now();
51
- }
52
- /**
53
- * Stop polling, as deleting the mapping does.
54
- */
55
- stop() {
56
- this.stopped = true;
57
- this.properties.queues.unwatch(this.properties.eventSourceArn.value, this);
58
- }
59
- /**
60
- * Take a message arriving on the queue as something to poll for.
61
- */
62
- messageAvailable(availableFrom) {
63
- this.schedule.at(availableFrom);
64
- }
65
- /**
66
- * Poll once: one batch, delivered and then deleted or left behind.
67
- */
68
- async run() {
69
- const simFunction = this.pollingFunction();
70
- if (simFunction === undefined) {
71
- return;
72
- }
73
- // Polling is done as the function's execution role, as on real Lambda, so
74
- // simulated IAM decides whether this mapping may read its queue.
75
- const request = {
76
- queueArn: this.properties.eventSourceArn.value,
77
- caller: { kind: "arn", arn: simFunction.roleArn },
78
- };
79
- const visibilityTimeoutSeconds = await this.properties.queues.visibilityTimeoutSeconds(request);
80
- const messages = await this.properties.queues.receive({
81
- ...request,
82
- batchSize: this.properties.mapping.batchSize,
83
- });
84
- if (messages.length === 0) {
85
- this.pollWhenSomethingComesBack();
86
- return;
87
- }
88
- const outcome = await this.delivery.to(simFunction, messages);
89
- await this.properties.queues.deleteMessages({
90
- ...request,
91
- receiptHandles: outcome.handledReceiptHandles,
92
- });
93
- this.pollAgainAfter(outcome, messages.length, visibilityTimeoutSeconds);
94
- }
95
- /**
96
- * The function this mapping delivers to, while it should be delivering.
97
- *
98
- * A mapping still being created is not polling yet, and a disabled one never
99
- * is. A function that is not there is not an error here: the mapping simply
100
- * has nothing to deliver to.
101
- */
102
- pollingFunction() {
103
- if (this.stopped || !this.properties.mapping.isPolling) {
104
- return undefined;
105
- }
106
- return this.properties.functions.find(this.properties.mapping.functionName);
107
- }
108
- /**
109
- * Look again when a message the queue could not hand out becomes
110
- * receivable.
111
- *
112
- * A mapping created while every message on its queue is in flight, or one
113
- * whose queue holds only delayed messages, has nothing to wake it otherwise.
114
- */
115
- pollWhenSomethingComesBack() {
116
- const availableFrom = this.properties.queues.nextAvailability(this.properties.eventSourceArn.value);
117
- if (availableFrom !== undefined) {
118
- this.schedule.at(availableFrom);
119
- }
120
- }
121
- /**
122
- * Decide when this mapping polls again: when a returned batch becomes
123
- * visible again, or straight away when a batch filled the request and there
124
- * may be more waiting.
125
- */
126
- pollAgainAfter(outcome, receivedCount, visibilityTimeoutSeconds) {
127
- if (outcome.hasReturnedMessages) {
128
- this.schedule.afterSeconds(visibilityTimeoutSeconds);
129
- return;
130
- }
131
- if (receivedCount >= this.properties.mapping.batchSize) {
132
- this.schedule.now();
133
- }
134
- }
135
- }
1
+ export {};
136
2
  //# sourceMappingURL=sim-lambda-event-source-poller.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-lambda-event-source-poller.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAW9F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,0BAA0B;IACpB,UAAU,CAAuC;IACjD,QAAQ,CAA+B;IACvC,QAAQ,CAAmC;IAEpD,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,UAAgD;QAC1D,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,IAAI,4BAA4B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,QAAQ,GAAG,IAAI,gCAAgC,CAAC;YACnD,UAAU,EAAE,UAAU,CAAC,UAAU;YACjC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CAAC,QAAQ,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;YAErD,OAAO;QACT,CAAC;QAED,IAAI,aAAa,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACvD,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"sim-lambda-event-source-poller.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-event-source-poller.ts"],"names":[],"mappings":""}
@@ -1,26 +1,7 @@
1
1
  import type { SimLambdaEventSourceMessage } from "../queue/sim-lambda-event-source-queues.js";
2
+ import { SimLambdaEventSourceBatchOutcome, type SimLambdaEventSourceBatchResponse } from "./sim-lambda-event-source-batch-response.js";
2
3
  /**
3
- * What became of one batch handed to a function.
4
- *
5
- * A batch is either deleted from the queue or left on it to become visible
6
- * again. Partial batch responses split it, which is the only reason this is a
7
- * pair of lists rather than a yes or no.
8
- */
9
- export declare class SimLambdaSqsBatchOutcome {
10
- readonly handled: readonly SimLambdaEventSourceMessage[];
11
- readonly returned: readonly SimLambdaEventSourceMessage[];
12
- constructor(handled: readonly SimLambdaEventSourceMessage[], returned: readonly SimLambdaEventSourceMessage[]);
13
- /**
14
- * The receipt handles of the messages to delete from the queue.
15
- */
16
- get handledReceiptHandles(): readonly string[];
17
- /**
18
- * Whether anything was left on the queue to be delivered again.
19
- */
20
- get hasReturnedMessages(): boolean;
21
- }
22
- /**
23
- * Reads what a function said about the batch it was given.
4
+ * Reads what a function said about the batch of messages it was given.
24
5
  *
25
6
  * A function that returns normally has handled the whole batch, unless the
26
7
  * mapping was told to expect a batch item failure report and the function sent
@@ -28,22 +9,17 @@ export declare class SimLambdaSqsBatchOutcome {
28
9
  * as on real Lambda: the alternative is to guess which messages the function
29
10
  * meant, and guessing wrong loses a message.
30
11
  */
31
- export declare class SimLambdaSqsBatchResponse {
32
- private readonly reportsBatchItemFailures;
12
+ export declare class SimLambdaSqsBatchResponse implements SimLambdaEventSourceBatchResponse {
13
+ private readonly batchItemFailures;
33
14
  constructor(reportsBatchItemFailures: boolean);
34
15
  /**
35
16
  * What became of a batch the function returned from.
36
17
  */
37
- handled(messages: readonly SimLambdaEventSourceMessage[], result: unknown): SimLambdaSqsBatchOutcome;
18
+ handled(messages: readonly SimLambdaEventSourceMessage[], result: unknown): SimLambdaEventSourceBatchOutcome;
38
19
  /**
39
20
  * What becomes of a batch the function threw on: the whole of it goes back.
40
21
  */
41
- failed(messages: readonly SimLambdaEventSourceMessage[]): SimLambdaSqsBatchOutcome;
42
- /**
43
- * The message ids a batch item failure report names, or undefined when the
44
- * function reported none.
45
- */
46
- private reportedFailureIds;
22
+ failed(messages: readonly SimLambdaEventSourceMessage[]): SimLambdaEventSourceBatchOutcome;
47
23
  private namesBatchMessages;
48
24
  }
49
25
  //# sourceMappingURL=sim-lambda-sqs-batch-response.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-lambda-sqs-batch-response.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAE9F;;;;;;GAMG;AACH,qBAAa,wBAAwB;IACnC,SAAgB,OAAO,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAChE,SAAgB,QAAQ,EAAE,SAAS,2BAA2B,EAAE,CAAC;IAEjE,YACE,OAAO,EAAE,SAAS,2BAA2B,EAAE,EAC/C,QAAQ,EAAE,SAAS,2BAA2B,EAAE,EAIjD;IAED;;OAEG;IACH,IAAI,qBAAqB,IAAI,SAAS,MAAM,EAAE,CAE7C;IAED;;OAEG;IACH,IAAI,mBAAmB,IAAI,OAAO,CAEjC;CACF;AAED;;;;;;;;GAQG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAU;IAEnD,YAAY,wBAAwB,EAAE,OAAO,EAE5C;IAED;;OAEG;IACH,OAAO,CACL,QAAQ,EAAE,SAAS,2BAA2B,EAAE,EAChD,MAAM,EAAE,OAAO,GACd,wBAAwB,CAe1B;IAED;;OAEG;IACH,MAAM,CACJ,QAAQ,EAAE,SAAS,2BAA2B,EAAE,GAC/C,wBAAwB,CAE1B;IAED;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,kBAAkB;CAQ3B"}
1
+ {"version":3,"file":"sim-lambda-sqs-batch-response.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AAE9F,OAAO,EACL,gCAAgC,EAChC,KAAK,iCAAiC,EACvC,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;GAQG;AACH,qBAAa,yBAA0B,YAAW,iCAAiC;IACjF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;IAE/D,YAAY,wBAAwB,EAAE,OAAO,EAI5C;IAED;;OAEG;IACH,OAAO,CACL,QAAQ,EAAE,SAAS,2BAA2B,EAAE,EAChD,MAAM,EAAE,OAAO,GACd,gCAAgC,CAelC;IAED;;OAEG;IACH,MAAM,CACJ,QAAQ,EAAE,SAAS,2BAA2B,EAAE,GAC/C,gCAAgC,CAElC;IAED,OAAO,CAAC,kBAAkB;CAQ3B"}
@@ -1,33 +1,7 @@
1
- import { isRecord } from "../../../../util/type-guard/record.js";
1
+ import { SimLambdaBatchItemFailures } from "./sim-lambda-batch-item-failures.js";
2
+ import { SimLambdaEventSourceBatchOutcome, } from "./sim-lambda-event-source-batch-response.js";
2
3
  /**
3
- * What became of one batch handed to a function.
4
- *
5
- * A batch is either deleted from the queue or left on it to become visible
6
- * again. Partial batch responses split it, which is the only reason this is a
7
- * pair of lists rather than a yes or no.
8
- */
9
- export class SimLambdaSqsBatchOutcome {
10
- handled;
11
- returned;
12
- constructor(handled, returned) {
13
- this.handled = handled;
14
- this.returned = returned;
15
- }
16
- /**
17
- * The receipt handles of the messages to delete from the queue.
18
- */
19
- get handledReceiptHandles() {
20
- return this.handled.map((message) => message.ReceiptHandle);
21
- }
22
- /**
23
- * Whether anything was left on the queue to be delivered again.
24
- */
25
- get hasReturnedMessages() {
26
- return this.returned.length > 0;
27
- }
28
- }
29
- /**
30
- * Reads what a function said about the batch it was given.
4
+ * Reads what a function said about the batch of messages it was given.
31
5
  *
32
6
  * A function that returns normally has handled the whole batch, unless the
33
7
  * mapping was told to expect a batch item failure report and the function sent
@@ -36,62 +10,31 @@ export class SimLambdaSqsBatchOutcome {
36
10
  * meant, and guessing wrong loses a message.
37
11
  */
38
12
  export class SimLambdaSqsBatchResponse {
39
- reportsBatchItemFailures;
13
+ batchItemFailures;
40
14
  constructor(reportsBatchItemFailures) {
41
- this.reportsBatchItemFailures = reportsBatchItemFailures;
15
+ this.batchItemFailures = new SimLambdaBatchItemFailures(reportsBatchItemFailures);
42
16
  }
43
17
  /**
44
18
  * What became of a batch the function returned from.
45
19
  */
46
20
  handled(messages, result) {
47
- const failedIds = this.reportedFailureIds(result);
21
+ const failedIds = this.batchItemFailures.idsIn(result);
48
22
  if (failedIds === undefined) {
49
- return new SimLambdaSqsBatchOutcome(messages, []);
23
+ return new SimLambdaEventSourceBatchOutcome(messages, []);
50
24
  }
51
25
  if (!this.namesBatchMessages(failedIds, messages)) {
52
26
  return this.failed(messages);
53
27
  }
54
- return new SimLambdaSqsBatchOutcome(messages.filter((message) => !failedIds.includes(message.MessageId)), messages.filter((message) => failedIds.includes(message.MessageId)));
28
+ return new SimLambdaEventSourceBatchOutcome(messages.filter((message) => !failedIds.includes(message.MessageId)), messages.filter((message) => failedIds.includes(message.MessageId)));
55
29
  }
56
30
  /**
57
31
  * What becomes of a batch the function threw on: the whole of it goes back.
58
32
  */
59
33
  failed(messages) {
60
- return new SimLambdaSqsBatchOutcome([], messages);
61
- }
62
- /**
63
- * The message ids a batch item failure report names, or undefined when the
64
- * function reported none.
65
- */
66
- reportedFailureIds(result) {
67
- if (!this.reportsBatchItemFailures || !isRecord(result)) {
68
- return undefined;
69
- }
70
- const reported = result["batchItemFailures"];
71
- if (!Array.isArray(reported) || reported.length === 0) {
72
- return undefined;
73
- }
74
- return reported.map((failure) => itemIdentifier(failure));
34
+ return new SimLambdaEventSourceBatchOutcome([], messages);
75
35
  }
76
36
  namesBatchMessages(failedIds, messages) {
77
37
  return failedIds.every((failedId) => messages.some((message) => message.MessageId === failedId));
78
38
  }
79
39
  }
80
- /**
81
- * The message id one reported failure names.
82
- *
83
- * An entry naming nothing is reported as an empty id, which no message has, so
84
- * the whole batch goes back. That is what real Lambda does with a malformed
85
- * report rather than dropping the entry.
86
- */
87
- function itemIdentifier(failure) {
88
- if (!isRecord(failure)) {
89
- return "";
90
- }
91
- const identifier = failure["itemIdentifier"];
92
- if (typeof identifier !== "string") {
93
- return "";
94
- }
95
- return identifier;
96
- }
97
40
  //# sourceMappingURL=sim-lambda-sqs-batch-response.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-lambda-sqs-batch-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAGjE;;;;;;GAMG;AACH,MAAM,OAAO,wBAAwB;IACnB,OAAO,CAAyC;IAChD,QAAQ,CAAyC;IAEjE,YACE,OAA+C,EAC/C,QAAgD;QAEhD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;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AAmB,CAAC,CAAC;QAE7C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACrE,CAAC;IAEO,kBAAkB,CACxB,SAA4B,EAC5B,QAAgD;QAEhD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAClC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC,CAC3D,CAAC;IACJ,CAAC;CACF;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,OAAgB;IACtC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QACnC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"sim-lambda-sqs-batch-response.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-batch-response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EACL,gCAAgC,GAEjC,MAAM,6CAA6C,CAAC;AAErD;;;;;;;;GAQG;AACH,MAAM,OAAO,yBAAyB;IACnB,iBAAiB,CAA6B;IAE/D,YAAY,wBAAiC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,IAAI,0BAA0B,CACrD,wBAAwB,CACzB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,OAAO,CACL,QAAgD,EAChD,MAAe;QAEf,MAAM,SAAS,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAEvD,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO,IAAI,gCAAgC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAC5D,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;QAED,OAAO,IAAI,gCAAgC,CACzC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EACpE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CACpE,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CACJ,QAAgD;QAEhD,OAAO,IAAI,gCAAgC,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC;IAEO,kBAAkB,CACxB,SAA4B,EAC5B,QAAgD;QAEhD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAClC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,QAAQ,CAAC,CAC3D,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,17 @@
1
+ import type { SimLambdaSqsEventSourceArn } from "../queue/sim-lambda-sqs-event-source-arn.js";
2
+ import type { SimLambdaEventSourceMapping } from "../sim-lambda-event-source-mapping.js";
3
+ import { SimLambdaEventSourceDelivery } from "./sim-lambda-event-source-delivery.js";
4
+ interface SimLambdaSqsDeliveryProperties {
5
+ readonly mapping: SimLambdaEventSourceMapping;
6
+ readonly eventSourceArn: SimLambdaSqsEventSourceArn;
7
+ }
8
+ /**
9
+ * The delivery an SQS mapping hands its batches over with.
10
+ *
11
+ * What the event looks like and what the function's return value means are both
12
+ * the queue's, so they are put together here and handed to the delivery, which
13
+ * knows neither.
14
+ */
15
+ export declare function makeSimLambdaSqsDelivery(properties: SimLambdaSqsDeliveryProperties): SimLambdaEventSourceDelivery;
16
+ export {};
17
+ //# sourceMappingURL=sim-lambda-sqs-delivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-sqs-delivery.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAIrF,UAAU,8BAA8B;IACtC,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,0BAA0B,CAAC;CACrD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,8BAA8B,GACzC,4BAA4B,CAO9B"}
@@ -0,0 +1,17 @@
1
+ import { SimLambdaEventSourceDelivery } from "./sim-lambda-event-source-delivery.js";
2
+ import { SimLambdaSqsBatchResponse } from "./sim-lambda-sqs-batch-response.js";
3
+ import { SimLambdaSqsEventBuilder } from "./sim-lambda-sqs-event.js";
4
+ /**
5
+ * The delivery an SQS mapping hands its batches over with.
6
+ *
7
+ * What the event looks like and what the function's return value means are both
8
+ * the queue's, so they are put together here and handed to the delivery, which
9
+ * knows neither.
10
+ */
11
+ export function makeSimLambdaSqsDelivery(properties) {
12
+ return new SimLambdaEventSourceDelivery({
13
+ eventBuilder: new SimLambdaSqsEventBuilder(properties.eventSourceArn),
14
+ batchResponse: new SimLambdaSqsBatchResponse(properties.mapping.reportsBatchItemFailures),
15
+ });
16
+ }
17
+ //# sourceMappingURL=sim-lambda-sqs-delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-sqs-delivery.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-delivery.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAOrE;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA0C;IAE1C,OAAO,IAAI,4BAA4B,CAAC;QACtC,YAAY,EAAE,IAAI,wBAAwB,CAAC,UAAU,CAAC,cAAc,CAAC;QACrE,aAAa,EAAE,IAAI,yBAAyB,CAC1C,UAAU,CAAC,OAAO,CAAC,wBAAwB,CAC5C;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,88 @@
1
+ import type { BackgroundScheduler } from "../../../../util/background/background.js";
2
+ import type { SimLambdaFunctionLookup } from "../../function/url/sim-lambda-function-lookup.js";
3
+ import type { SimLambdaEventSourceQueues, SimLambdaEventSourceQueueWatcher } from "../queue/sim-lambda-event-source-queues.js";
4
+ import type { SimLambdaSqsEventSourceArn } from "../queue/sim-lambda-sqs-event-source-arn.js";
5
+ import type { SimLambdaEventSourceMapping } from "../sim-lambda-event-source-mapping.js";
6
+ import type { SimLambdaEventSourcePoller } from "./sim-lambda-event-source-poller.js";
7
+ interface SimLambdaSqsEventSourcePollerProperties {
8
+ readonly mapping: SimLambdaEventSourceMapping;
9
+ readonly eventSourceArn: SimLambdaSqsEventSourceArn;
10
+ readonly functions: SimLambdaFunctionLookup;
11
+ readonly queues: SimLambdaEventSourceQueues;
12
+ readonly background: BackgroundScheduler;
13
+ }
14
+ /**
15
+ * Polls one event source mapping's queue and invokes its function.
16
+ *
17
+ * Real Lambda polls a queue continuously. Nothing in this simulation runs
18
+ * continuously, so the queue says when a message has arrived and a poll is
19
+ * scheduled in response. A test that awaits the simulation settling has
20
+ * therefore watched the whole delivery happen, rather than having waited a
21
+ * while and hoped.
22
+ *
23
+ * A batch the function returns from is deleted from the queue. A batch it
24
+ * throws on is left there, which hides it for the visibility timeout and hands
25
+ * it back afterwards, so a redrive policy eventually gives up on it exactly as
26
+ * it would for any other failing consumer. That is why the poller invokes the
27
+ * function directly rather than through the Invoke command: an asynchronous
28
+ * invocation drops its handler error, and this one has to be seen.
29
+ */
30
+ export declare class SimLambdaSqsEventSourcePoller implements SimLambdaEventSourcePoller, SimLambdaEventSourceQueueWatcher {
31
+ private readonly mapping;
32
+ private readonly functions;
33
+ private readonly queue;
34
+ private readonly delivery;
35
+ private readonly schedule;
36
+ private stopped;
37
+ constructor(properties: SimLambdaSqsEventSourcePollerProperties);
38
+ /**
39
+ * Watch the queue this mapping polls.
40
+ *
41
+ * Watching starts as soon as the mapping is created, before it has finished
42
+ * creating, so a message sent in between is not missed. The poll it wakes
43
+ * finds a mapping that is not polling yet and does nothing, and the poll that
44
+ * follows activation picks the message up.
45
+ */
46
+ watch(): void;
47
+ /**
48
+ * Poll as soon as the simulation gets to it, which is what a newly enabled
49
+ * mapping does with whatever is already on its queue.
50
+ */
51
+ pollNow(): void;
52
+ /**
53
+ * Stop polling, as deleting the mapping does.
54
+ */
55
+ stop(): void;
56
+ /**
57
+ * Take a message arriving on the queue as something to poll for.
58
+ */
59
+ messageAvailable(availableFrom: Date): void;
60
+ /**
61
+ * Poll once: one batch, delivered and then deleted or left behind.
62
+ */
63
+ private run;
64
+ /**
65
+ * The function this mapping delivers to, while it should be delivering.
66
+ *
67
+ * A mapping still being created is not polling yet, and a disabled one never
68
+ * is. A function that is not there is not an error here: the mapping simply
69
+ * has nothing to deliver to.
70
+ */
71
+ private pollingFunction;
72
+ /**
73
+ * Look again when a message the queue could not hand out becomes
74
+ * receivable.
75
+ *
76
+ * A mapping created while every message on its queue is in flight, or one
77
+ * whose queue holds only delayed messages, has nothing to wake it otherwise.
78
+ */
79
+ private pollWhenSomethingComesBack;
80
+ /**
81
+ * Decide when this mapping polls again: when a returned batch becomes
82
+ * visible again, or straight away when a batch filled the request and there
83
+ * may be more waiting.
84
+ */
85
+ private pollAgainAfter;
86
+ }
87
+ export {};
88
+ //# sourceMappingURL=sim-lambda-sqs-event-source-poller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-sqs-event-source-poller.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAErF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,KAAK,EACV,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAC9F,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAIzF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAItF,UAAU,uCAAuC;IAC/C,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,cAAc,EAAE,0BAA0B,CAAC;IACpD,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,6BACX,YAAW,0BAA0B,EAAE,gCAAgC;IAEvE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA0B;IAChD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+B;IACxD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;IAE5D,OAAO,CAAC,OAAO,CAAS;IAExB,YAAY,UAAU,EAAE,uCAAuC,EAc9D;IAED;;;;;;;OAOG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,CAEd;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,CAGX;IAED;;OAEG;IACH,gBAAgB,CAAC,aAAa,EAAE,IAAI,GAAG,IAAI,CAE1C;IAED;;OAEG;YACW,GAAG;IA0BjB;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAQvB;;;;;;OAMG;IACH,OAAO,CAAC,0BAA0B;IAQlC;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAevB"}
@@ -0,0 +1,132 @@
1
+ import { SimLambdaEventSourcePollSchedule } from "./sim-lambda-event-source-poll-schedule.js";
2
+ import { makeSimLambdaSqsDelivery } from "./sim-lambda-sqs-delivery.js";
3
+ import { SimLambdaSqsPolledQueue } from "./sim-lambda-sqs-polled-queue.js";
4
+ /**
5
+ * Polls one event source mapping's queue and invokes its function.
6
+ *
7
+ * Real Lambda polls a queue continuously. Nothing in this simulation runs
8
+ * continuously, so the queue says when a message has arrived and a poll is
9
+ * scheduled in response. A test that awaits the simulation settling has
10
+ * therefore watched the whole delivery happen, rather than having waited a
11
+ * while and hoped.
12
+ *
13
+ * A batch the function returns from is deleted from the queue. A batch it
14
+ * throws on is left there, which hides it for the visibility timeout and hands
15
+ * it back afterwards, so a redrive policy eventually gives up on it exactly as
16
+ * it would for any other failing consumer. That is why the poller invokes the
17
+ * function directly rather than through the Invoke command: an asynchronous
18
+ * invocation drops its handler error, and this one has to be seen.
19
+ */
20
+ export class SimLambdaSqsEventSourcePoller {
21
+ mapping;
22
+ functions;
23
+ queue;
24
+ delivery;
25
+ schedule;
26
+ stopped = false;
27
+ constructor(properties) {
28
+ this.mapping = properties.mapping;
29
+ this.functions = properties.functions;
30
+ this.queue = new SimLambdaSqsPolledQueue(properties.queues, properties.eventSourceArn.value);
31
+ this.delivery = makeSimLambdaSqsDelivery(properties);
32
+ this.schedule = new SimLambdaEventSourcePollSchedule({
33
+ background: properties.background,
34
+ poll: async () => {
35
+ await this.run();
36
+ },
37
+ });
38
+ }
39
+ /**
40
+ * Watch the queue this mapping polls.
41
+ *
42
+ * Watching starts as soon as the mapping is created, before it has finished
43
+ * creating, so a message sent in between is not missed. The poll it wakes
44
+ * finds a mapping that is not polling yet and does nothing, and the poll that
45
+ * follows activation picks the message up.
46
+ */
47
+ watch() {
48
+ this.queue.watch(this);
49
+ }
50
+ /**
51
+ * Poll as soon as the simulation gets to it, which is what a newly enabled
52
+ * mapping does with whatever is already on its queue.
53
+ */
54
+ pollNow() {
55
+ this.schedule.now();
56
+ }
57
+ /**
58
+ * Stop polling, as deleting the mapping does.
59
+ */
60
+ stop() {
61
+ this.stopped = true;
62
+ this.queue.unwatch(this);
63
+ }
64
+ /**
65
+ * Take a message arriving on the queue as something to poll for.
66
+ */
67
+ messageAvailable(availableFrom) {
68
+ this.schedule.at(availableFrom);
69
+ }
70
+ /**
71
+ * Poll once: one batch, delivered and then deleted or left behind.
72
+ */
73
+ async run() {
74
+ const simFunction = this.pollingFunction();
75
+ if (simFunction === undefined) {
76
+ return;
77
+ }
78
+ // Polling is done as the function's execution role, as on real Lambda, so
79
+ // simulated IAM decides whether this mapping may read its queue.
80
+ const { roleArn } = simFunction;
81
+ const timeout = await this.queue.visibilityTimeoutSeconds(roleArn);
82
+ const messages = await this.queue.receive(roleArn, this.mapping.batchSize);
83
+ if (messages.length === 0) {
84
+ this.pollWhenSomethingComesBack();
85
+ return;
86
+ }
87
+ const outcome = await this.delivery.to(simFunction, messages);
88
+ await this.queue.deleteMessages(roleArn, outcome.handledReceiptHandles);
89
+ this.pollAgainAfter(outcome, messages.length, timeout);
90
+ }
91
+ /**
92
+ * The function this mapping delivers to, while it should be delivering.
93
+ *
94
+ * A mapping still being created is not polling yet, and a disabled one never
95
+ * is. A function that is not there is not an error here: the mapping simply
96
+ * has nothing to deliver to.
97
+ */
98
+ pollingFunction() {
99
+ if (this.stopped || !this.mapping.isPolling) {
100
+ return undefined;
101
+ }
102
+ return this.functions.find(this.mapping.functionName);
103
+ }
104
+ /**
105
+ * Look again when a message the queue could not hand out becomes
106
+ * receivable.
107
+ *
108
+ * A mapping created while every message on its queue is in flight, or one
109
+ * whose queue holds only delayed messages, has nothing to wake it otherwise.
110
+ */
111
+ pollWhenSomethingComesBack() {
112
+ const availableFrom = this.queue.nextAvailability();
113
+ if (availableFrom !== undefined) {
114
+ this.schedule.at(availableFrom);
115
+ }
116
+ }
117
+ /**
118
+ * Decide when this mapping polls again: when a returned batch becomes
119
+ * visible again, or straight away when a batch filled the request and there
120
+ * may be more waiting.
121
+ */
122
+ pollAgainAfter(outcome, receivedCount, visibilityTimeoutSeconds) {
123
+ if (outcome.hasReturnedMessages) {
124
+ this.schedule.afterSeconds(visibilityTimeoutSeconds);
125
+ return;
126
+ }
127
+ if (receivedCount >= this.mapping.batchSize) {
128
+ this.schedule.now();
129
+ }
130
+ }
131
+ }
132
+ //# sourceMappingURL=sim-lambda-sqs-event-source-poller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-sqs-event-source-poller.js","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-event-source-poller.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAE9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAU3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,6BAA6B;IAGvB,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C;QAEhC,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAChC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,wBAAwB,CAAC,CAAC;YAErD,OAAO;QACT,CAAC;QAED,IAAI,aAAa,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YAC5C,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ import type { SimLambdaEventSourceMessage, SimLambdaEventSourceQueues, SimLambdaEventSourceQueueWatcher } from "../queue/sim-lambda-event-source-queues.js";
2
+ /**
3
+ * The one queue a mapping polls.
4
+ *
5
+ * Every call names the same queue, and the ones a poll makes are all made as
6
+ * the function's execution role, so both are fixed here rather than written out
7
+ * at each call. Simulated IAM still decides each one, exactly as real IAM does.
8
+ */
9
+ export declare class SimLambdaSqsPolledQueue {
10
+ private readonly queues;
11
+ private readonly queueArn;
12
+ constructor(queues: SimLambdaEventSourceQueues, queueArn: string);
13
+ /**
14
+ * Watch for messages arriving on the queue.
15
+ */
16
+ watch(watcher: SimLambdaEventSourceQueueWatcher): void;
17
+ /**
18
+ * Stop watching the queue.
19
+ */
20
+ unwatch(watcher: SimLambdaEventSourceQueueWatcher): void;
21
+ /**
22
+ * When the earliest message the queue cannot hand out yet becomes
23
+ * receivable.
24
+ */
25
+ nextAvailability(): Date | undefined;
26
+ /**
27
+ * How long a received message stays hidden, and by asking, whether the queue
28
+ * is there to be polled at all.
29
+ */
30
+ visibilityTimeoutSeconds(roleArn: string): Promise<number>;
31
+ /**
32
+ * Take up to a batch of messages off the queue.
33
+ */
34
+ receive(roleArn: string, batchSize: number): Promise<readonly SimLambdaEventSourceMessage[]>;
35
+ /**
36
+ * Delete the messages the function handled.
37
+ */
38
+ deleteMessages(roleArn: string, receiptHandles: readonly string[]): Promise<void>;
39
+ private requestAs;
40
+ }
41
+ //# sourceMappingURL=sim-lambda-sqs-polled-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-lambda-sqs-polled-queue.d.ts","sourceRoot":"","sources":["../../../../../src/service/lambda/event-source/poll/sim-lambda-sqs-polled-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAE3B,0BAA0B,EAC1B,gCAAgC,EACjC,MAAM,4CAA4C,CAAC;AAEpD;;;;;;GAMG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,YAAY,MAAM,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,EAG/D;IAED;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,CAErD;IAED;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,CAEvD;IAED;;;OAGG;IACH,gBAAgB,IAAI,IAAI,GAAG,SAAS,CAEnC;IAED;;;OAGG;IACG,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE/D;IAED;;OAEG;IACG,OAAO,CACX,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,2BAA2B,EAAE,CAAC,CAEjD;IAED;;OAEG;IACG,cAAc,CAClB,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,OAAO,CAAC,IAAI,CAAC,CAKf;IAED,OAAO,CAAC,SAAS;CAGlB"}