@kensio/yulin 0.12.0 → 0.14.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 (278) hide show
  1. package/README.md +22 -24
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/serve/controller/sim-aws-service-controller-container.d.ts +6 -2
  5. package/dist/serve/controller/sim-aws-service-controller-container.d.ts.map +1 -1
  6. package/dist/serve/controller/sim-aws-service-controller-container.js +4 -2
  7. package/dist/serve/controller/sim-aws-service-controller-container.js.map +1 -1
  8. package/dist/serve/http/sim-aws-http.d.ts +5 -2
  9. package/dist/serve/http/sim-aws-http.d.ts.map +1 -1
  10. package/dist/serve/http/sim-aws-http.js +3 -4
  11. package/dist/serve/http/sim-aws-http.js.map +1 -1
  12. package/dist/serve/http/sim-aws-local-server.d.ts +10 -3
  13. package/dist/serve/http/sim-aws-local-server.d.ts.map +1 -1
  14. package/dist/serve/http/sim-aws-local-server.js +7 -7
  15. package/dist/serve/http/sim-aws-local-server.js.map +1 -1
  16. package/dist/serve/http/sim-aws-local-url.d.ts +6 -1
  17. package/dist/serve/http/sim-aws-local-url.d.ts.map +1 -1
  18. package/dist/serve/http/sim-aws-local-url.js +4 -4
  19. package/dist/serve/http/sim-aws-local-url.js.map +1 -1
  20. package/dist/service/aws/arn.d.ts +1 -1
  21. package/dist/service/aws/arn.d.ts.map +1 -1
  22. package/dist/service/aws/arn.js +1 -1
  23. package/dist/service/aws/arn.js.map +1 -1
  24. package/dist/service/aws/sim-aws-account-region-scope.d.ts +23 -9
  25. package/dist/service/aws/sim-aws-account-region-scope.d.ts.map +1 -1
  26. package/dist/service/aws/sim-aws-account-region-scope.js +23 -8
  27. package/dist/service/aws/sim-aws-account-region-scope.js.map +1 -1
  28. package/dist/service/aws/sim-aws-account.d.ts +23 -9
  29. package/dist/service/aws/sim-aws-account.d.ts.map +1 -1
  30. package/dist/service/aws/sim-aws-account.js +21 -9
  31. package/dist/service/aws/sim-aws-account.js.map +1 -1
  32. package/dist/service/aws/sim-aws-region.d.ts +23 -9
  33. package/dist/service/aws/sim-aws-region.d.ts.map +1 -1
  34. package/dist/service/aws/sim-aws-region.js +21 -9
  35. package/dist/service/aws/sim-aws-region.js.map +1 -1
  36. package/dist/service/aws/sim-aws.d.ts +49 -30
  37. package/dist/service/aws/sim-aws.d.ts.map +1 -1
  38. package/dist/service/aws/sim-aws.js +92 -42
  39. package/dist/service/aws/sim-aws.js.map +1 -1
  40. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts +5 -0
  41. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.d.ts.map +1 -1
  42. package/dist/service/cloudfront/behaviour/sim-cloud-front-behavior.js.map +1 -1
  43. package/dist/service/cloudfront/cff/adapter/sim-cff-event-adapter.d.ts +36 -0
  44. package/dist/service/cloudfront/cff/adapter/sim-cff-event-adapter.d.ts.map +1 -0
  45. package/dist/service/cloudfront/cff/adapter/sim-cff-event-adapter.js +177 -0
  46. package/dist/service/cloudfront/cff/adapter/sim-cff-event-adapter.js.map +1 -0
  47. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts +38 -0
  48. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.d.ts.map +1 -0
  49. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js +69 -0
  50. package/dist/service/cloudfront/cff/function-code-input/cff-function-code-input.js.map +1 -0
  51. package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts +48 -0
  52. package/dist/service/cloudfront/cff/sim-cloudfront-function.d.ts.map +1 -0
  53. package/dist/service/cloudfront/cff/sim-cloudfront-function.js +66 -0
  54. package/dist/service/cloudfront/cff/sim-cloudfront-function.js.map +1 -0
  55. package/dist/service/cloudfront/command/create-distribution/create-distribution.cmd.d.ts +100 -0
  56. package/dist/service/cloudfront/command/create-distribution/create-distribution.cmd.d.ts.map +1 -0
  57. package/dist/service/cloudfront/command/create-distribution/create-distribution.cmd.js +2 -0
  58. package/dist/service/cloudfront/command/create-distribution/create-distribution.cmd.js.map +1 -0
  59. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts +16 -12
  60. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.d.ts.map +1 -1
  61. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js +23 -78
  62. package/dist/service/cloudfront/command/create-distribution/create-distribution.handler.js.map +1 -1
  63. package/dist/service/cloudfront/command/create-function/create-function.cmd.d.ts +43 -0
  64. package/dist/service/cloudfront/command/create-function/create-function.cmd.d.ts.map +1 -0
  65. package/dist/service/cloudfront/command/create-function/create-function.cmd.js +5 -0
  66. package/dist/service/cloudfront/command/create-function/create-function.cmd.js.map +1 -0
  67. package/dist/service/cloudfront/command/create-function/create-function.handler.d.ts +28 -0
  68. package/dist/service/cloudfront/command/create-function/create-function.handler.d.ts.map +1 -0
  69. package/dist/service/cloudfront/command/create-function/create-function.handler.js +49 -0
  70. package/dist/service/cloudfront/command/create-function/create-function.handler.js.map +1 -0
  71. package/dist/service/cloudfront/command/get-distribution/get-distribution.cmd.d.ts +29 -0
  72. package/dist/service/cloudfront/command/get-distribution/get-distribution.cmd.d.ts.map +1 -0
  73. package/dist/service/cloudfront/command/get-distribution/get-distribution.cmd.js +2 -0
  74. package/dist/service/cloudfront/command/get-distribution/get-distribution.cmd.js.map +1 -0
  75. package/dist/service/cloudfront/command/get-distribution/get-distribution.handler.d.ts +21 -0
  76. package/dist/service/cloudfront/command/get-distribution/get-distribution.handler.d.ts.map +1 -0
  77. package/dist/service/cloudfront/command/get-distribution/get-distribution.handler.js +40 -0
  78. package/dist/service/cloudfront/command/get-distribution/get-distribution.handler.js.map +1 -0
  79. package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts +20 -4
  80. package/dist/service/cloudfront/controller/sim-cloudfront-controller.d.ts.map +1 -1
  81. package/dist/service/cloudfront/controller/sim-cloudfront-controller.js +52 -7
  82. package/dist/service/cloudfront/controller/sim-cloudfront-controller.js.map +1 -1
  83. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts +21 -0
  84. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.d.ts.map +1 -0
  85. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js +90 -0
  86. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-behavior-configurator.js.map +1 -0
  87. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts +17 -0
  88. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.d.ts.map +1 -0
  89. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js +28 -0
  90. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-distribution-configurator.js.map +1 -0
  91. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.d.ts +15 -0
  92. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.d.ts.map +1 -0
  93. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.js +26 -0
  94. package/dist/service/cloudfront/distribution/configurator/sim-cloud-front-origin-configurator.js.map +1 -0
  95. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.d.ts +23 -1
  96. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.d.ts.map +1 -1
  97. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.js +23 -1
  98. package/dist/service/cloudfront/distribution/sim-cloudfront-distribution.js.map +1 -1
  99. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts +21 -0
  100. package/dist/service/cloudfront/error/sim-cloudfront.error.d.ts.map +1 -0
  101. package/dist/service/cloudfront/error/sim-cloudfront.error.js +20 -0
  102. package/dist/service/cloudfront/error/sim-cloudfront.error.js.map +1 -0
  103. package/dist/service/cloudfront/factory/cloudfront-functions.factory.d.ts +15 -2
  104. package/dist/service/cloudfront/factory/cloudfront-functions.factory.d.ts.map +1 -1
  105. package/dist/service/cloudfront/factory/cloudfront-functions.factory.js +22 -12
  106. package/dist/service/cloudfront/factory/cloudfront-functions.factory.js.map +1 -1
  107. package/dist/service/cloudfront/index.d.ts +1 -0
  108. package/dist/service/cloudfront/index.d.ts.map +1 -1
  109. package/dist/service/cloudfront/index.js +1 -0
  110. package/dist/service/cloudfront/index.js.map +1 -1
  111. package/dist/service/cloudfront/origin/sim-cloudfront-s3-origin.d.ts +7 -4
  112. package/dist/service/cloudfront/origin/sim-cloudfront-s3-origin.d.ts.map +1 -1
  113. package/dist/service/cloudfront/origin/sim-cloudfront-s3-origin.js +5 -5
  114. package/dist/service/cloudfront/origin/sim-cloudfront-s3-origin.js.map +1 -1
  115. package/dist/service/cloudfront/resolver/sim-cloud-front-behavior-resolver.js +2 -2
  116. package/dist/service/cloudfront/resolver/sim-cloud-front-behavior-resolver.js.map +1 -1
  117. package/dist/service/cloudfront/resolver/sim-cloudfront-path-pattern.d.ts +6 -2
  118. package/dist/service/cloudfront/resolver/sim-cloudfront-path-pattern.d.ts.map +1 -1
  119. package/dist/service/cloudfront/resolver/sim-cloudfront-path-pattern.js +3 -3
  120. package/dist/service/cloudfront/resolver/sim-cloudfront-path-pattern.js.map +1 -1
  121. package/dist/service/cloudfront/router/sim-cloud-front-distro-router.d.ts +24 -2
  122. package/dist/service/cloudfront/router/sim-cloud-front-distro-router.d.ts.map +1 -1
  123. package/dist/service/cloudfront/router/sim-cloud-front-distro-router.js +61 -10
  124. package/dist/service/cloudfront/router/sim-cloud-front-distro-router.js.map +1 -1
  125. package/dist/service/cloudfront/sim-cloud-front-registry.d.ts +8 -0
  126. package/dist/service/cloudfront/sim-cloud-front-registry.d.ts.map +1 -1
  127. package/dist/service/cloudfront/sim-cloud-front-registry.js +12 -0
  128. package/dist/service/cloudfront/sim-cloud-front-registry.js.map +1 -1
  129. package/dist/service/cloudfront/sim-cloudfront.d.ts +34 -4
  130. package/dist/service/cloudfront/sim-cloudfront.d.ts.map +1 -1
  131. package/dist/service/cloudfront/sim-cloudfront.js +55 -3
  132. package/dist/service/cloudfront/sim-cloudfront.js.map +1 -1
  133. package/dist/service/cloudfront/typings/cloudfront-functions.namespace.d.ts +22 -3
  134. package/dist/service/cloudfront/typings/cloudfront-functions.namespace.d.ts.map +1 -1
  135. package/dist/service/dynamodb/command/create-table/create-table.cmd.d.ts +61 -0
  136. package/dist/service/dynamodb/command/create-table/create-table.cmd.d.ts.map +1 -0
  137. package/dist/service/dynamodb/command/create-table/create-table.cmd.js +2 -0
  138. package/dist/service/dynamodb/command/create-table/create-table.cmd.js.map +1 -0
  139. package/dist/service/dynamodb/command/create-table/create-table.handler.d.ts +10 -4
  140. package/dist/service/dynamodb/command/create-table/create-table.handler.d.ts.map +1 -1
  141. package/dist/service/dynamodb/command/create-table/create-table.handler.js +12 -11
  142. package/dist/service/dynamodb/command/create-table/create-table.handler.js.map +1 -1
  143. package/dist/service/dynamodb/command/describe-table/describe-table.cmd.d.ts +21 -0
  144. package/dist/service/dynamodb/command/describe-table/describe-table.cmd.d.ts.map +1 -0
  145. package/dist/service/dynamodb/command/describe-table/describe-table.cmd.js +2 -0
  146. package/dist/service/dynamodb/command/describe-table/describe-table.cmd.js.map +1 -0
  147. package/dist/service/dynamodb/command/describe-table/describe-table.handler.d.ts +8 -4
  148. package/dist/service/dynamodb/command/describe-table/describe-table.handler.d.ts.map +1 -1
  149. package/dist/service/dynamodb/command/describe-table/describe-table.handler.js +5 -7
  150. package/dist/service/dynamodb/command/describe-table/describe-table.handler.js.map +1 -1
  151. package/dist/service/dynamodb/command/list-tables/list-tables.cmd.d.ts +22 -0
  152. package/dist/service/dynamodb/command/list-tables/list-tables.cmd.d.ts.map +1 -0
  153. package/dist/service/dynamodb/command/list-tables/list-tables.cmd.js +2 -0
  154. package/dist/service/dynamodb/command/list-tables/list-tables.cmd.js.map +1 -0
  155. package/dist/service/dynamodb/command/list-tables/list-tables.handler.d.ts +8 -4
  156. package/dist/service/dynamodb/command/list-tables/list-tables.handler.d.ts.map +1 -1
  157. package/dist/service/dynamodb/command/list-tables/list-tables.handler.js +3 -2
  158. package/dist/service/dynamodb/command/list-tables/list-tables.handler.js.map +1 -1
  159. package/dist/service/dynamodb/command/put-item/put-item.cmd.d.ts +135 -0
  160. package/dist/service/dynamodb/command/put-item/put-item.cmd.d.ts.map +1 -0
  161. package/dist/service/dynamodb/command/put-item/put-item.cmd.js +2 -0
  162. package/dist/service/dynamodb/command/put-item/put-item.cmd.js.map +1 -0
  163. package/dist/service/dynamodb/command/put-item/put-item.handler.d.ts +8 -4
  164. package/dist/service/dynamodb/command/put-item/put-item.handler.d.ts.map +1 -1
  165. package/dist/service/dynamodb/command/put-item/put-item.handler.js +4 -7
  166. package/dist/service/dynamodb/command/put-item/put-item.handler.js.map +1 -1
  167. package/dist/service/dynamodb/error/dynamodb.error.d.ts +28 -0
  168. package/dist/service/dynamodb/error/dynamodb.error.d.ts.map +1 -0
  169. package/dist/service/dynamodb/error/dynamodb.error.js +29 -0
  170. package/dist/service/dynamodb/error/dynamodb.error.js.map +1 -0
  171. package/dist/service/dynamodb/index.d.ts +0 -1
  172. package/dist/service/dynamodb/index.d.ts.map +1 -1
  173. package/dist/service/dynamodb/index.js +0 -1
  174. package/dist/service/dynamodb/index.js.map +1 -1
  175. package/dist/service/dynamodb/item/dynamodb-item-attribute.d.ts +3 -3
  176. package/dist/service/dynamodb/item/dynamodb-item-attribute.d.ts.map +1 -1
  177. package/dist/service/dynamodb/item/dynamodb-item-attribute.js +10 -10
  178. package/dist/service/dynamodb/item/dynamodb-item-attribute.js.map +1 -1
  179. package/dist/service/dynamodb/item/dynamodb-item.d.ts +3 -3
  180. package/dist/service/dynamodb/item/dynamodb-item.d.ts.map +1 -1
  181. package/dist/service/dynamodb/item/dynamodb-item.js.map +1 -1
  182. package/dist/service/dynamodb/sim-dynamodb.d.ts +15 -7
  183. package/dist/service/dynamodb/sim-dynamodb.d.ts.map +1 -1
  184. package/dist/service/dynamodb/sim-dynamodb.js +11 -6
  185. package/dist/service/dynamodb/sim-dynamodb.js.map +1 -1
  186. package/dist/service/dynamodb/table/dynamodb-key-schema.d.ts +9 -15
  187. package/dist/service/dynamodb/table/dynamodb-key-schema.d.ts.map +1 -1
  188. package/dist/service/dynamodb/table/dynamodb-key-schema.js +29 -35
  189. package/dist/service/dynamodb/table/dynamodb-key-schema.js.map +1 -1
  190. package/dist/service/dynamodb/table/dynamodb-table.d.ts +14 -8
  191. package/dist/service/dynamodb/table/dynamodb-table.d.ts.map +1 -1
  192. package/dist/service/dynamodb/table/dynamodb-table.js +9 -7
  193. package/dist/service/dynamodb/table/dynamodb-table.js.map +1 -1
  194. package/dist/service/s3/bucket/sim-s3-bucket.d.ts +9 -6
  195. package/dist/service/s3/bucket/sim-s3-bucket.d.ts.map +1 -1
  196. package/dist/service/s3/bucket/sim-s3-bucket.js +4 -5
  197. package/dist/service/s3/bucket/sim-s3-bucket.js.map +1 -1
  198. package/dist/service/s3/bucket/website/s3-bucket-website.d.ts +2 -2
  199. package/dist/service/s3/bucket/website/s3-bucket-website.d.ts.map +1 -1
  200. package/dist/service/s3/bucket/website/s3-bucket-website.js.map +1 -1
  201. package/dist/service/s3/command/create-bucket/create-bucket.cmd.d.ts +21 -0
  202. package/dist/service/s3/command/create-bucket/create-bucket.cmd.d.ts.map +1 -0
  203. package/dist/service/s3/command/create-bucket/create-bucket.cmd.js +2 -0
  204. package/dist/service/s3/command/create-bucket/create-bucket.cmd.js.map +1 -0
  205. package/dist/service/s3/command/create-bucket/create-bucket.handler.d.ts +10 -4
  206. package/dist/service/s3/command/create-bucket/create-bucket.handler.d.ts.map +1 -1
  207. package/dist/service/s3/command/create-bucket/create-bucket.handler.js +12 -18
  208. package/dist/service/s3/command/create-bucket/create-bucket.handler.js.map +1 -1
  209. package/dist/service/s3/command/get-object/get-object.cmd.d.ts +23 -0
  210. package/dist/service/s3/command/get-object/get-object.cmd.d.ts.map +1 -0
  211. package/dist/service/s3/command/get-object/get-object.cmd.js +2 -0
  212. package/dist/service/s3/command/get-object/get-object.cmd.js.map +1 -0
  213. package/dist/service/s3/command/get-object/get-object.handler.d.ts +8 -4
  214. package/dist/service/s3/command/get-object/get-object.handler.d.ts.map +1 -1
  215. package/dist/service/s3/command/get-object/get-object.handler.js +5 -11
  216. package/dist/service/s3/command/get-object/get-object.handler.js.map +1 -1
  217. package/dist/service/s3/command/list-buckets/list-buckets.cmd.d.ts +30 -0
  218. package/dist/service/s3/command/list-buckets/list-buckets.cmd.d.ts.map +1 -0
  219. package/dist/service/s3/command/list-buckets/list-buckets.cmd.js +2 -0
  220. package/dist/service/s3/command/list-buckets/list-buckets.cmd.js.map +1 -0
  221. package/dist/service/s3/command/list-buckets/list-buckets.handler.d.ts +8 -4
  222. package/dist/service/s3/command/list-buckets/list-buckets.handler.d.ts.map +1 -1
  223. package/dist/service/s3/command/list-buckets/list-buckets.handler.js +2 -2
  224. package/dist/service/s3/command/list-buckets/list-buckets.handler.js.map +1 -1
  225. package/dist/service/s3/command/list-objects/list-objects.cmd.d.ts +36 -0
  226. package/dist/service/s3/command/list-objects/list-objects.cmd.d.ts.map +1 -0
  227. package/dist/service/s3/command/list-objects/list-objects.cmd.js +2 -0
  228. package/dist/service/s3/command/list-objects/list-objects.cmd.js.map +1 -0
  229. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts +8 -4
  230. package/dist/service/s3/command/list-objects/list-objects.handler.d.ts.map +1 -1
  231. package/dist/service/s3/command/list-objects/list-objects.handler.js +4 -7
  232. package/dist/service/s3/command/list-objects/list-objects.handler.js.map +1 -1
  233. package/dist/service/s3/command/put-bucket-website/put-bucket-website.cmd.d.ts +72 -0
  234. package/dist/service/s3/command/put-bucket-website/put-bucket-website.cmd.d.ts.map +1 -0
  235. package/dist/service/s3/command/put-bucket-website/put-bucket-website.cmd.js +2 -0
  236. package/dist/service/s3/command/put-bucket-website/put-bucket-website.cmd.js.map +1 -0
  237. package/dist/service/s3/command/put-bucket-website/put-bucket-website.handler.d.ts +8 -4
  238. package/dist/service/s3/command/put-bucket-website/put-bucket-website.handler.d.ts.map +1 -1
  239. package/dist/service/s3/command/put-bucket-website/put-bucket-website.handler.js +4 -7
  240. package/dist/service/s3/command/put-bucket-website/put-bucket-website.handler.js.map +1 -1
  241. package/dist/service/s3/command/put-object/put-object.cmd.d.ts +30 -0
  242. package/dist/service/s3/command/put-object/put-object.cmd.d.ts.map +1 -0
  243. package/dist/service/s3/command/put-object/put-object.cmd.js +2 -0
  244. package/dist/service/s3/command/put-object/put-object.cmd.js.map +1 -0
  245. package/dist/service/s3/command/put-object/put-object.handler.d.ts +8 -4
  246. package/dist/service/s3/command/put-object/put-object.handler.d.ts.map +1 -1
  247. package/dist/service/s3/command/put-object/put-object.handler.js +9 -8
  248. package/dist/service/s3/command/put-object/put-object.handler.js.map +1 -1
  249. package/dist/service/s3/error/s3.error.d.ts +42 -0
  250. package/dist/service/s3/error/s3.error.d.ts.map +1 -0
  251. package/dist/service/s3/error/s3.error.js +47 -0
  252. package/dist/service/s3/error/s3.error.js.map +1 -0
  253. package/dist/service/s3/index.d.ts +0 -1
  254. package/dist/service/s3/index.d.ts.map +1 -1
  255. package/dist/service/s3/index.js +0 -1
  256. package/dist/service/s3/index.js.map +1 -1
  257. package/dist/service/s3/object/s3-object.d.ts +7 -1
  258. package/dist/service/s3/object/s3-object.d.ts.map +1 -1
  259. package/dist/service/s3/object/s3-object.js +2 -1
  260. package/dist/service/s3/object/s3-object.js.map +1 -1
  261. package/dist/service/s3/serve/sim-s3-controller.d.ts +6 -3
  262. package/dist/service/s3/serve/sim-s3-controller.d.ts.map +1 -1
  263. package/dist/service/s3/serve/sim-s3-controller.js +4 -2
  264. package/dist/service/s3/serve/sim-s3-controller.js.map +1 -1
  265. package/dist/service/s3/serve/sim-s3-req-router.d.ts +6 -3
  266. package/dist/service/s3/serve/sim-s3-req-router.d.ts.map +1 -1
  267. package/dist/service/s3/serve/sim-s3-req-router.js +5 -3
  268. package/dist/service/s3/serve/sim-s3-req-router.js.map +1 -1
  269. package/dist/service/s3/sim-s3.d.ts +19 -9
  270. package/dist/service/s3/sim-s3.d.ts.map +1 -1
  271. package/dist/service/s3/sim-s3.js +16 -9
  272. package/dist/service/s3/sim-s3.js.map +1 -1
  273. package/dist/service/s3/storage/s3-filesystem-storage.d.ts +6 -1
  274. package/dist/service/s3/storage/s3-filesystem-storage.d.ts.map +1 -1
  275. package/dist/service/s3/storage/s3-filesystem-storage.js +10 -6
  276. package/dist/service/s3/storage/s3-filesystem-storage.js.map +1 -1
  277. package/dist/tsconfig.tsbuildinfo +1 -0
  278. package/package.json +11 -26
package/README.md CHANGED
@@ -16,11 +16,9 @@ Create and interact directly with a simulated AWS:
16
16
 
17
17
  ```typescript
18
18
  import { SimAws } from "@kensio/yulin";
19
- import { installSimDynamoDb } from "@kensio/yulin/dynamodb"
20
19
  import { CreateTableCommand } from "@aws-sdk/client-dynamodb";
21
20
 
22
21
  const simAws = new SimAws();
23
- installSimDynamoDb(simAws);
24
22
 
25
23
  // Default Account and Region.
26
24
  await simAws.service("dynamoDb").createTable(
@@ -65,7 +63,6 @@ You can listen on a port to serve your simulated AWS on localhost:
65
63
 
66
64
  ```typescript
67
65
  import { SimAws } from "@kensio/yulin";
68
- import { installSimS3 } from "@kensio/yulin/s3";
69
66
  import { serveSimAws } from "@kensio/yulin/serve";
70
67
  import {
71
68
  CreateBucketCommand,
@@ -74,19 +71,20 @@ import {
74
71
  } from "@aws-sdk/client-s3";
75
72
 
76
73
  const simAws = new SimAws();
77
- installSimS3(simAws);
78
- const srv = await serveSimAws(simAws); // Chooses available port on localhost.
74
+ const srv = await serveSimAws({ simAws }); // Chooses available port on localhost.
79
75
 
80
- const simS3 = simAws.region("eu-west-2").service("s3");
76
+ const simS3 = simAws.region("eu-west-2").s3();
81
77
  await simS3.createBucket(new CreateBucketCommand({ Bucket: "foo-site" }));
82
- await simS3.putBucketWebsite(new PutBucketWebsiteCommand({
83
- Bucket: "foo-site",
84
- WebsiteConfiguration: {
85
- IndexDocument: {
86
- Suffix: "index.html",
78
+ await simS3.putBucketWebsite(
79
+ new PutBucketWebsiteCommand({
80
+ Bucket: "foo-site",
81
+ WebsiteConfiguration: {
82
+ IndexDocument: {
83
+ Suffix: "index.html",
84
+ },
87
85
  },
88
- },
89
- }));
86
+ }),
87
+ );
90
88
  await simS3.putObject(
91
89
  new PutObjectCommand({
92
90
  Bucket: "foo-site",
@@ -115,17 +113,17 @@ involved. This is what "isolated" refers to.
115
113
 
116
114
  This "isolated system" approach to testing has a few advantages:
117
115
 
118
- - Tests run fast as everything is in memory with no real networking.
119
- - Test set-up is fast and uncomplicated, as there are no containers or extra
120
- dependencies to manage.
121
- - It's straightforward to use multiple other mocks and simulators alongside
122
- yulin, such as [nock](https://github.com/nock/nock), as yulin makes no
123
- assumptions about the environment.
124
- - You can control everything in each isolated test process, such as controlling
125
- the current time, even when multiple different AWS services are simulated.
126
- - One test can cover **meaningful system behaviour** across multiple AWS
127
- services and applications, such as Lambdas sending events to SQS queues to be
128
- picked up by other Lambdas, or DynamoDB streams triggering Lambdas.
116
+ - Tests run fast as everything is in memory with no real networking.
117
+ - Test set-up is fast and uncomplicated, as there are no containers or extra
118
+ dependencies to manage.
119
+ - It's straightforward to use multiple other mocks and simulators alongside
120
+ yulin, such as [nock](https://github.com/nock/nock), as yulin makes no
121
+ assumptions about the environment.
122
+ - You can control everything in each isolated test process, such as controlling
123
+ the current time, even when multiple different AWS services are simulated.
124
+ - One test can cover **meaningful system behaviour** across multiple AWS
125
+ services and applications, such as Lambdas sending events to SQS queues to be
126
+ picked up by other Lambdas, or DynamoDB streams triggering Lambdas.
129
127
 
130
128
  That last point is the most important. The motivation behind yulin is to enable
131
129
  efficient tests that cover the logical behaviour of a system. That is in
package/dist/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export { SimAws } from "./service/aws/sim-aws.js";
2
2
  export { SimAwsAccount } from "./service/aws/sim-aws-account.js";
3
3
  export { SimAwsRegion } from "./service/aws/sim-aws-region.js";
4
4
  export { SimAwsAccountRegionContainer } from "./service/aws/sim-aws-account-region-scope.js";
5
- export type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap, } from "./service/aws/sim-aws-services.js";
6
5
  export type { AwsRegionName } from "./service/aws/sim-aws-region.js";
7
6
  export type { SimAwsAccountId } from "./service/aws/sim-aws-account.js";
8
7
  export type { SimAwsAccountRegionScope } from "./service/aws/sim-aws-account-region-scope.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,YAAY,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACxE,YAAY,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC"}
@@ -1,15 +1,19 @@
1
- import type { SimAws } from "../../service/aws/sim-aws.js";
1
+ import { SimAws } from "../../service/aws/sim-aws.js";
2
2
  import type { SimAwsServiceController } from "./sim-service-controller.js";
3
+ interface SimAwsServiceControllerContainerProps {
4
+ readonly simAws?: SimAws;
5
+ }
3
6
  /**
4
7
  * Registry for simulated AWS localhost service controllers.
5
8
  */
6
9
  export declare class SimAwsServiceControllerContainer {
7
10
  private readonly simAws;
8
11
  private readonly controllers;
9
- constructor(simAws: SimAws);
12
+ constructor(props?: SimAwsServiceControllerContainerProps);
10
13
  /**
11
14
  * Get the singleton controller for a simulated AWS service.
12
15
  */
13
16
  controllerForService(service: string): SimAwsServiceController;
14
17
  }
18
+ export {};
15
19
  //# sourceMappingURL=sim-aws-service-controller-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-service-controller-container.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;GAEG;AACH,qBAAa,gCAAgC;IAG/B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuC;gBAEtC,MAAM,EAAE,MAAM;IAE3C;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB;CAK/D"}
1
+ {"version":3,"file":"sim-aws-service-controller-container.d.ts","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,UAAU,qCAAqC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,gCAAgC;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuC;gBAEvD,KAAK,GAAE,qCAA0C;IAK7D;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB;CAK/D"}
@@ -1,3 +1,4 @@
1
+ import { SimAws } from "../../service/aws/sim-aws.js";
1
2
  import { Memo } from "../../util/memo/memo.js";
2
3
  /**
3
4
  * Registry for simulated AWS localhost service controllers.
@@ -5,14 +6,15 @@ import { Memo } from "../../util/memo/memo.js";
5
6
  export class SimAwsServiceControllerContainer {
6
7
  simAws;
7
8
  controllers = new Memo();
8
- constructor(simAws) {
9
+ constructor(props = {}) {
10
+ const { simAws = new SimAws() } = props;
9
11
  this.simAws = simAws;
10
12
  }
11
13
  /**
12
14
  * Get the singleton controller for a simulated AWS service.
13
15
  */
14
16
  controllerForService(service) {
15
- return this.controllers.getOrCreate(service, () => this.simAws.createServiceController(service));
17
+ return this.controllers.getOrCreate(service, () => this.simAws._createServiceController(service));
16
18
  }
17
19
  }
18
20
  //# sourceMappingURL=sim-aws-service-controller-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-service-controller-container.js","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAGd;IAFZ,WAAW,GAAG,IAAI,IAAI,EAA2B,CAAC;IAEnE,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;OAEG;IACH,oBAAoB,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,CAChD,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"sim-aws-service-controller-container.js","sourceRoot":"","sources":["../../../src/serve/controller/sim-aws-service-controller-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAO/C;;GAEG;AACH,MAAM,OAAO,gCAAgC;IAC1B,MAAM,CAAS;IACf,WAAW,GAAG,IAAI,IAAI,EAA2B,CAAC;IAEnE,YAAY,QAA+C,EAAE;QAC3D,MAAM,EAAE,MAAM,GAAG,IAAI,MAAM,EAAE,EAAE,GAAG,KAAK,CAAC;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,OAAe;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE,CAChD,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAC9C,CAAC;IACJ,CAAC;CACF"}
@@ -1,12 +1,14 @@
1
1
  import { SimAws } from "../../service/aws/sim-aws.js";
2
+ interface SimAwsHttpProps {
3
+ readonly simAws?: SimAws;
4
+ }
2
5
  /**
3
6
  * HTTP interface for sending requests into a simulated AWS environment.
4
7
  */
5
8
  export declare class SimAwsHttp {
6
- readonly simAws: SimAws;
7
9
  private readonly serviceResolver;
8
10
  private readonly controllers;
9
- constructor(simAws?: SimAws);
11
+ constructor(props?: SimAwsHttpProps);
10
12
  /**
11
13
  * Send a Fetch API request to simulated AWS.
12
14
  */
@@ -17,4 +19,5 @@ export declare class SimAwsHttp {
17
19
  handleRequest(request: Request): Promise<Response>;
18
20
  private hostnameFromRequest;
19
21
  }
22
+ export {};
20
23
  //# sourceMappingURL=sim-aws-http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-http.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD;;GAEG;AACH,qBAAa,UAAU;aAIO,MAAM,EAAE,MAAM;IAH1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;IACpE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmC;gBAEnC,MAAM,GAAE,MAAqB;IAIzD;;OAEG;IACG,KAAK,CACT,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAC7B,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC;IAIpB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IA8BxD,OAAO,CAAC,mBAAmB;CAS5B"}
1
+ {"version":3,"file":"sim-aws-http.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-http.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD,UAAU,eAAe;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAoC;IACpE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmC;gBAEnD,KAAK,GAAE,eAAoB;IAKvC;;OAEG;IACG,KAAK,CACT,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,EAC7B,IAAI,CAAC,EAAE,WAAW,GACjB,OAAO,CAAC,QAAQ,CAAC;IAIpB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IA8BxD,OAAO,CAAC,mBAAmB;CAS5B"}
@@ -5,12 +5,11 @@ import { SimAws } from "../../service/aws/sim-aws.js";
5
5
  * HTTP interface for sending requests into a simulated AWS environment.
6
6
  */
7
7
  export class SimAwsHttp {
8
- simAws;
9
8
  serviceResolver = new SimAwsLocalServiceResolver();
10
9
  controllers;
11
- constructor(simAws = new SimAws()) {
12
- this.simAws = simAws;
13
- this.controllers = new SimAwsServiceControllerContainer(simAws);
10
+ constructor(props = {}) {
11
+ const { simAws = new SimAws() } = props;
12
+ this.controllers = new SimAwsServiceControllerContainer({ simAws });
14
13
  }
15
14
  /**
16
15
  * Send a Fetch API request to simulated AWS.
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-http.js","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EAAE,gCAAgC,EAAE,MAAM,uDAAuD,CAAC;AACzG,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,UAAU;IAIO;IAHX,eAAe,GAAG,IAAI,0BAA0B,EAAE,CAAC;IACnD,WAAW,CAAmC;IAE/D,YAA4B,SAAiB,IAAI,MAAM,EAAE;QAA7B,WAAM,GAAN,MAAM,CAAuB;QACvD,IAAI,CAAC,WAAW,GAAG,IAAI,gCAAgC,CAAC,MAAM,CAAC,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,CACT,KAA6B,EAC7B,IAAkB;QAElB,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAAgB;QAClC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;YACnD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC3B,OAAO,IAAI,QAAQ,CAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YAChE,CAAC;YAED,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B,OAAO,IAAI,QAAQ,CACjB,KAAK,YAAY,KAAK;gBACpB,CAAC,CAAC,GAAG,KAAK,CAAC,OAAO,IAAI;gBACtB,CAAC,CAAC,yBAAyB,EAC7B,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,mBAAmB,CAAC,OAAgB;QAC1C,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QAE7D,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -1,13 +1,15 @@
1
1
  import { SimAws } from "../../service/aws/sim-aws.js";
2
+ interface SimAwsLocalServerProps {
3
+ readonly simAws?: SimAws;
4
+ }
2
5
  /**
3
6
  * Local HTTP server for a simulated AWS environment.
4
7
  * Useful for local integration testing and local development.
5
8
  */
6
9
  export declare class SimAwsLocalServer {
7
- readonly simAws: SimAws;
8
10
  private readonly simAwsHttp;
9
11
  private readonly server;
10
- constructor(simAws?: SimAws);
12
+ constructor(props?: SimAwsLocalServerProps);
11
13
  /**
12
14
  * Start serving simulated AWS services on localhost.
13
15
  */
@@ -34,8 +36,13 @@ export declare class SimAwsLocalServer {
34
36
  private nodeRequestHeaders;
35
37
  private sendFetchResponse;
36
38
  }
39
+ interface ServeSimAwsProps {
40
+ readonly simAws?: SimAws;
41
+ readonly port?: number;
42
+ }
37
43
  /**
38
44
  * Serve a simulated AWS environment on localhost.
39
45
  */
40
- export declare function serveSimAws(simAws?: SimAws, port?: number): Promise<SimAwsLocalServer>;
46
+ export declare function serveSimAws(props?: ServeSimAwsProps): Promise<SimAwsLocalServer>;
47
+ export {};
41
48
  //# sourceMappingURL=sim-aws-local-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-local-server.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAOtD;;;GAGG;AACH,qBAAa,iBAAiB;aAIA,MAAM,EAAE,MAAM;IAH1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEJ,MAAM,GAAE,MAAqB;IAOzD;;OAEG;IACG,MAAM,CAAC,IAAI,GAAE,MAAoC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvE;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAYjB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG;YAIpB,gBAAgB;YA4BhB,aAAa;IAU3B,OAAO,CAAC,yBAAyB;IAmBjC,OAAO,CAAC,kBAAkB;YAsBZ,iBAAiB;CAiBhC;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,MAAM,GAAE,MAAqB,EAC7B,IAAI,GAAE,MAAoC,GACzC,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
1
+ {"version":3,"file":"sim-aws-local-server.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMtD,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,KAAK,GAAE,sBAA2B;IAQ9C;;OAEG;IACG,MAAM,CAAC,IAAI,GAAE,MAAoC,GAAG,OAAO,CAAC,IAAI,CAAC;IAMvE;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAYjB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG;YAIpB,gBAAgB;YA4BhB,aAAa;IAU3B,OAAO,CAAC,yBAAyB;IAmBjC,OAAO,CAAC,kBAAkB;YAsBZ,iBAAiB;CAiBhC;AAED,UAAU,gBAAgB;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,KAAK,GAAE,gBAAqB,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAI5B"}
@@ -9,12 +9,11 @@ import { SimAwsLocalUrl } from "./sim-aws-local-url.js";
9
9
  * Useful for local integration testing and local development.
10
10
  */
11
11
  export class SimAwsLocalServer {
12
- simAws;
13
12
  simAwsHttp;
14
13
  server;
15
- constructor(simAws = new SimAws()) {
16
- this.simAws = simAws;
17
- this.simAwsHttp = new SimAwsHttp(simAws);
14
+ constructor(props = {}) {
15
+ const { simAws = new SimAws() } = props;
16
+ this.simAwsHttp = new SimAwsHttp({ simAws });
18
17
  this.server = http.createServer((request, response) => {
19
18
  void this.handleRequest(request, response);
20
19
  });
@@ -57,7 +56,7 @@ export class SimAwsLocalServer {
57
56
  * Adapt a simulated AWS URL for this local server instance.
58
57
  */
59
58
  localUrl(input) {
60
- return new SimAwsLocalUrl(input, this.port).toURL();
59
+ return new SimAwsLocalUrl({ input, port: this.port }).toURL();
61
60
  }
62
61
  async waitForListening() {
63
62
  /* v8 ignore if -- cannot happen in practice */
@@ -132,8 +131,9 @@ export class SimAwsLocalServer {
132
131
  /**
133
132
  * Serve a simulated AWS environment on localhost.
134
133
  */
135
- export async function serveSimAws(simAws = new SimAws(), port = simAwsLocalConf.defaultPort) {
136
- const server = new SimAwsLocalServer(simAws);
134
+ export async function serveSimAws(props = {}) {
135
+ const { simAws = new SimAws(), port = simAwsLocalConf.defaultPort } = props;
136
+ const server = new SimAwsLocalServer({ simAws });
137
137
  return server.listen(port);
138
138
  }
139
139
  //# sourceMappingURL=sim-aws-local-server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-local-server.js","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-server.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAIZ,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAIA;IAHX,UAAU,CAAa;IACvB,MAAM,CAAS;IAEhC,YAA4B,SAAiB,IAAI,MAAM,EAAE;QAA7B,WAAM,GAAN,MAAM,CAAuB;QACvD,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACpD,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,OAAe,eAAe,CAAC,WAAW;QACrD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC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0B,EAAE;IAE5B,MAAM,EAAE,MAAM,GAAG,IAAI,MAAM,EAAE,EAAE,IAAI,GAAG,eAAe,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,10 +1,14 @@
1
+ interface SimAwsLocalUrlProps {
2
+ readonly input: string | URL;
3
+ readonly port?: string;
4
+ }
1
5
  /**
2
6
  * Local URL for a simulated AWS service.
3
7
  */
4
8
  export declare class SimAwsLocalUrl {
5
9
  static readonly localhostSuffix: string;
6
10
  private readonly url;
7
- constructor(input: string | URL, port?: string);
11
+ constructor(props: SimAwsLocalUrlProps);
8
12
  /**
9
13
  * Convert to a URL instance.
10
14
  */
@@ -19,4 +23,5 @@ export declare class SimAwsLocalUrl {
19
23
  withoutLocalhostSuffix(): URL;
20
24
  private localHostname;
21
25
  }
26
+ export {};
22
27
  //# sourceMappingURL=sim-aws-local-url.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-local-url.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-url.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,cAAc;IACzB,gBAAuB,eAAe,SAAkC;IAExE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBAEd,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM;IAS9C;;OAEG;IACH,KAAK,IAAI,GAAG;IAIZ;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,sBAAsB,IAAI,GAAG;IAM7B,OAAO,CAAC,aAAa;CAgBtB"}
1
+ {"version":3,"file":"sim-aws-local-url.d.ts","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-url.ts"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,qBAAa,cAAc;IACzB,gBAAuB,eAAe,SAAkC;IAExE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;gBAEd,KAAK,EAAE,mBAAmB;IAStC;;OAEG;IACH,KAAK,IAAI,GAAG;IAIZ;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,sBAAsB,IAAI,GAAG;IAM7B,OAAO,CAAC,aAAa;CAgBtB"}
@@ -5,12 +5,12 @@ import { simAwsLocalConf } from "./sim-aws-local.conf.js";
5
5
  export class SimAwsLocalUrl {
6
6
  static localhostSuffix = `.${simAwsLocalConf.hostname}`;
7
7
  url;
8
- constructor(input, port) {
9
- this.url = new URL(input);
8
+ constructor(props) {
9
+ this.url = new URL(props.input);
10
10
  this.url.protocol = "http:";
11
11
  this.url.hostname = this.localHostname(this.url.hostname);
12
- if (port !== undefined) {
13
- this.url.port = port;
12
+ if (props.port !== undefined) {
13
+ this.url.port = props.port;
14
14
  }
15
15
  }
16
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-local-url.js","sourceRoot":"","sources":["../../../src/serve/http/sim-aws-local-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,cAAc;IAClB,MAAM,CAAU,eAAe,GAAG,IAAI,eAAe,CAAC,QAAQ,EAAE,CAAC;IAEvD,GAAG,CAAM;IAE1B,YAAY,KAAmB,EAAE,IAAa;QAC5C,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,aA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D,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,eAAe,EAAE,CAAC;QAC9E,CAAC;QAED,OAAO,GAAG,QAAQ,GAAG,cAAc,CAAC,eAAe,EAAE,CAAC;IACxD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type AwsRegionName } from "./sim-aws-region.js";
2
2
  import { type SimAwsAccountId } from "./sim-aws-account.js";
3
3
  export type SimArnServiceName = string;
4
- export type SimArn = `arn:aws:${SimArnServiceName}:${AwsRegionName}:${SimAwsAccountId}:${string}/${string}`;
4
+ export type SimArn = `arn:aws:${SimArnServiceName}:${AwsRegionName | ""}:${SimAwsAccountId}:${string}/${string}`;
5
5
  export interface SimArnComponents {
6
6
  partition: "aws";
7
7
  service: SimArnServiceName;
@@ -1 +1 @@
1
- {"version":3,"file":"arn.d.ts","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,MAAM,GAChB,WAAW,iBAAiB,IAAI,aAAa,IAAI,eAAe,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAEzF,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAGxE"}
1
+ {"version":3,"file":"arn.d.ts","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAqB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAI9B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,MAAM,GAChB,WAAW,iBAAiB,IAAI,aAAa,GAAG,EAAE,IAAI,eAAe,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE9F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAaD;;GAEG;AACH,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAGxE"}
@@ -2,7 +2,7 @@ import { makeAwsRegionName } from "./sim-aws-region.js";
2
2
  import { makeSimAwsAccountId, } from "./sim-aws-account.js";
3
3
  import { DynamicFactory } from "@kensio/part-factory";
4
4
  import { faker } from "@faker-js/faker";
5
- const defaultSimArnServiceNames = ["s3", "dynamodb"];
5
+ const defaultSimArnServiceNames = ["cloudfront", "dynamodb", "s3"];
6
6
  const simArnComponentsFactory = new DynamicFactory(() => ({
7
7
  partition: "aws",
8
8
  service: faker.helpers.arrayElement(defaultSimArnServiceNames),
@@ -1 +1 @@
1
- {"version":3,"file":"arn.js","sourceRoot":"","sources":["../../../src/service/aws/arn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EACL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,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AE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,yBAAyB,CAAC;IAC9D,MAAM,EAAE,iBAAiB,EAAE;IAC3B,SAAS,EAAE,mBAAmB,EAAE;IAChC,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;CACtD,CAAC,CAAC,CAAC;AAEJ;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,SAAqC;IAC9D,MAAM,UAAU,GAAG,uBAAuB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,OAAO,OAAO,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,OAAO,IAAI,UAAU,CAAC,MAAM,IAAI,UAAU,CAAC,SAAS,IAAI,UAAU,CAAC,YAAY,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;AAC9J,CAAC"}
@@ -1,26 +1,39 @@
1
1
  import { type SimAwsAccount, type SimAwsAccountId } from "./sim-aws-account.js";
2
2
  import { type AwsRegionName, type SimAwsRegion } from "./sim-aws-region.js";
3
- import type { NoSimAwsServices, SimAwsServiceMap } from "./sim-aws-services.js";
4
3
  import { SimAws } from "./sim-aws.js";
5
4
  import { DynamicFactory } from "@kensio/part-factory";
5
+ import type { SimS3 } from "../s3/sim-s3.js";
6
+ import type { SimCloudFront } from "../cloudfront/sim-cloudfront.js";
7
+ import type { SimDynamoDb } from "../dynamodb/index.js";
6
8
  export type SimAccountRegionScopeKey = `${SimAwsAccountId}:${AwsRegionName}`;
9
+ interface SimAwsAccountRegionContainerProps {
10
+ readonly simAws?: SimAws;
11
+ readonly account?: SimAwsAccount;
12
+ readonly region?: SimAwsRegion;
13
+ }
7
14
  /**
8
15
  * Combined simulated AWS Account and Region scope.
9
16
  * This is the real Account/Region scope container for simulated services.
10
17
  */
11
- export declare class SimAwsAccountRegionContainer<TServices extends SimAwsServiceMap = NoSimAwsServices> {
18
+ export declare class SimAwsAccountRegionContainer {
12
19
  private readonly simAws;
13
- readonly account: SimAwsAccount<TServices>;
14
- readonly region: SimAwsRegion<TServices>;
20
+ readonly account: SimAwsAccount;
21
+ readonly region: SimAwsRegion;
15
22
  private readonly memo;
16
23
  readonly accountRegionScope: SimAwsAccountRegionScope;
17
- constructor(simAws?: SimAws<TServices>, account?: SimAwsAccount<TServices>, region?: SimAwsRegion<TServices>);
24
+ constructor(props?: SimAwsAccountRegionContainerProps);
25
+ /**
26
+ * Get simulated S3 for this account and region.
27
+ */
28
+ s3(): SimS3;
29
+ /**
30
+ * Get simulated CloudFront for this account.
31
+ */
32
+ cloudFront(): SimCloudFront;
18
33
  /**
19
- * Get an installed simulated AWS service for this account and region.
20
- * The service must be installed with the appropriate installer function
21
- * first.
34
+ * Get simulated DynamoDB for this account and region.
22
35
  */
23
- service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
36
+ dynamoDb(): SimDynamoDb;
24
37
  }
25
38
  export interface SimAwsAccountRegionScope {
26
39
  accountId: SimAwsAccountId;
@@ -30,4 +43,5 @@ export interface SimAwsAccountRegionScope {
30
43
  * Generates fake simulated AWS resource scopes.
31
44
  */
32
45
  export declare const simAwsAccountRegionScopeFactory: DynamicFactory<SimAwsAccountRegionScope>;
46
+ export {};
33
47
  //# sourceMappingURL=sim-aws-account-region-scope.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-account-region-scope.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,wBAAwB,GAAG,GAAG,eAAe,IAAI,aAAa,EAAE,CAAC;AAE7E;;;GAGG;AACH,qBAAa,4BAA4B,CACvC,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAOnD,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC;aACjC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC;IAPjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAE5C,SAAgB,kBAAkB,EAAE,wBAAwB,CAAC;gBAG1C,MAAM,GAAE,MAAM,CAAC,SAAS,CAA2B,EACpD,OAAO,GAAE,aAAa,CAAC,SAAS,CAAyB,EACzD,MAAM,GAAE,YAAY,CAAC,SAAS,CAAwB;IAQxE;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAK1E;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,0CAIvC,CAAC"}
1
+ {"version":3,"file":"sim-aws-account-region-scope.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,MAAM,wBAAwB,GAAG,GAAG,eAAe,IAAI,aAAa,EAAE,CAAC;AAE7E,UAAU,iCAAiC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;CAChC;AAED;;;GAGG;AACH,qBAAa,4BAA4B;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,SAAgB,MAAM,EAAE,YAAY,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAE5C,SAAgB,kBAAkB,EAAE,wBAAwB,CAAC;gBAEjD,KAAK,GAAE,iCAAsC;IAiBzD;;OAEG;IACH,EAAE,IAAI,KAAK;IAIX;;OAEG;IACH,UAAU,IAAI,aAAa;IAM3B;;OAEG;IACH,QAAQ,IAAI,WAAW;CAKxB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,aAAa,CAAC;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,0CAIvC,CAAC"}
@@ -13,22 +13,37 @@ export class SimAwsAccountRegionContainer {
13
13
  region;
14
14
  memo = new Memo();
15
15
  accountRegionScope;
16
- constructor(simAws = new SimAws(), account = this.simAws.account(), region = this.simAws.region()) {
16
+ constructor(props = {}) {
17
+ const { simAws = new SimAws(), account, region } = props;
17
18
  this.simAws = simAws;
18
- this.account = account;
19
- this.region = region;
19
+ this.account =
20
+ account ??
21
+ this.simAws.account(account?.accountId);
22
+ this.region =
23
+ region ??
24
+ this.simAws.region(region?.regionName);
20
25
  this.accountRegionScope = {
21
26
  accountId: this.account.accountId,
22
27
  regionName: this.region.regionName,
23
28
  };
24
29
  }
25
30
  /**
26
- * Get an installed simulated AWS service for this account and region.
27
- * The service must be installed with the appropriate installer function
28
- * first.
31
+ * Get simulated S3 for this account and region.
29
32
  */
30
- service(serviceName) {
31
- return this.memo.getOrCreate(String(serviceName), () => this.simAws.createService(serviceName, this));
33
+ s3() {
34
+ return this.memo.getOrCreate("s3", () => this.simAws._createS3(this));
35
+ }
36
+ /**
37
+ * Get simulated CloudFront for this account.
38
+ */
39
+ cloudFront() {
40
+ return this.memo.getOrCreate("cloudFront", () => this.simAws._createCloudFront(this));
41
+ }
42
+ /**
43
+ * Get simulated DynamoDB for this account and region.
44
+ */
45
+ dynamoDb() {
46
+ return this.memo.getOrCreate("dynamoDb", () => this.simAws._createDynamoDb(this));
32
47
  }
33
48
  }
34
49
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-account-region-scope.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD;;;GAGG;AACH,MAAM,OAAO,4BAA4B;IAQpB;IACD;IACA;IAPD,IAAI,GAAG,IAAI,IAAI,EAAW,CAAC;IAE5B,kBAAkB,CAA2B;IAE7D,YACmB,SAA4B,IAAI,MAAM,EAAa,EACpD,UAAoC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EACzD,SAAkC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QAFrD,WAAM,GAAN,MAAM,CAA6C;QACpD,YAAO,GAAP,OAAO,CAAkD;QACzD,WAAM,GAAN,MAAM,CAAgD;QAEtE,IAAI,CAAC,kBAAkB,GAAG;YACxB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;SACnC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,CACrD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,IAAI,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF;AAOD;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,IAAI,cAAc,CAA2B,GAAG,EAAE,CAAC,CAAC;IAClD,SAAS,EAAE,mBAAmB,EAAE;IAChC,UAAU,EAAE,iBAAiB,EAAE;CAChC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"sim-aws-account-region-scope.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account-region-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAatD;;;GAGG;AACH,MAAM,OAAO,4BAA4B;IACtB,MAAM,CAAS;IAChB,OAAO,CAAgB;IACvB,MAAM,CAAe;IACpB,IAAI,GAAG,IAAI,IAAI,EAAW,CAAC;IAE5B,kBAAkB,CAA2B;IAE7D,YAAY,QAA2C,EAAE;QACvD,MAAM,EAAE,MAAM,GAAG,IAAI,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAEzD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO;YACV,OAAO;gBACP,IAAI,CAAC,MAAM,CAAC,OAAO,CAAE,OAAqC,EAAE,SAAS,CAAC,CAAC;QACzE,IAAI,CAAC,MAAM;YACT,MAAM;gBACN,IAAI,CAAC,MAAM,CAAC,MAAM,CAAE,MAAmC,EAAE,UAAU,CAAC,CAAC;QAEvE,IAAI,CAAC,kBAAkB,GAAG;YACxB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;SACnC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,EAAE;QACA,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,GAAG,EAAE,CAC9C,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,CACpC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,EAAE,CAC5C,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAClC,CAAC;IACJ,CAAC;CACF;AAOD;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,IAAI,cAAc,CAA2B,GAAG,EAAE,CAAC,CAAC;IAClD,SAAS,EAAE,mBAAmB,EAAE;IAChC,UAAU,EAAE,iBAAiB,EAAE;CAChC,CAAC,CAAC,CAAC"}
@@ -1,32 +1,46 @@
1
1
  import type { AwsRegionName } from "./sim-aws-region.js";
2
2
  import type { Brand } from "../../util/brand.type.js";
3
- import type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap } from "./sim-aws-services.js";
4
3
  import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
4
+ import type { SimS3 } from "../s3/sim-s3.js";
5
+ import type { SimCloudFront } from "../cloudfront/sim-cloudfront.js";
6
+ import type { SimDynamoDb } from "../dynamodb/index.js";
7
+ import { SimAws } from "./sim-aws.js";
5
8
  export type SimAwsAccountId = Brand<string, "SimAwsAccountId">;
6
9
  export declare const DEFAULT_SIM_AWS_ACCOUNT_ID: SimAwsAccountId;
10
+ interface SimAwsAccountProps {
11
+ readonly simAws?: Pick<SimAws, "accountRegionScope">;
12
+ readonly accountId?: SimAwsAccountId;
13
+ }
7
14
  /**
8
15
  * Container for simulated AWS services in one AWS Account.
9
16
  * The real scope is Account/Region in SimAwsAccountRegionContainer.
10
17
  * So SimAwsAccount is like an intermediate navigation handler on the way to a
11
18
  * full Account/Region scope.
12
19
  */
13
- export declare class SimAwsAccount<TServices extends SimAwsServiceMap = NoSimAwsServices> {
14
- private readonly accountRegionScopes;
20
+ export declare class SimAwsAccount {
21
+ private readonly simAws;
15
22
  readonly accountId: SimAwsAccountId;
16
- constructor(accountRegionScopes: SimAwsAccountRegionScopes<TServices>, accountId?: SimAwsAccountId);
23
+ constructor(props?: SimAwsAccountProps);
17
24
  /**
18
25
  * Get a simulated AWS Region scoped for this Account.
19
26
  */
20
- region(regionName?: AwsRegionName): SimAwsAccountRegionContainer<TServices>;
27
+ region(regionName?: AwsRegionName): SimAwsAccountRegionContainer;
28
+ /**
29
+ * Get simulated S3 for this Account's default Region.
30
+ */
31
+ s3(): SimS3;
32
+ /**
33
+ * Get simulated CloudFront for this Account.
34
+ */
35
+ cloudFront(): SimCloudFront;
21
36
  /**
22
- * Get an installed simulated AWS service for this Account's default Region.
23
- * The service must be installed with the appropriate installer function
24
- * first.
37
+ * Get simulated DynamoDB for this Account's default Region.
25
38
  */
26
- service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
39
+ dynamoDb(): SimDynamoDb;
27
40
  }
28
41
  /**
29
42
  * Generate a fake AWS Account ID.
30
43
  */
31
44
  export declare function makeSimAwsAccountId(): SimAwsAccountId;
45
+ export {};
32
46
  //# sourceMappingURL=sim-aws-account.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-account.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAGtF,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE/D,eAAO,MAAM,0BAA0B,EAAqB,eAAe,CAAC;AAE5E;;;;;GAKG;AACH,qBAAa,aAAa,CACxB,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAGnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,SAAS,EAAE,eAAe;gBADzB,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC1D,SAAS,GAAE,eAA4C;IAGzE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,EAAE,aAAa,GAAG,4BAA4B,CAAC,SAAS,CAAC;IAO3E;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAG1E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,CAErD"}
1
+ {"version":3,"file":"sim-aws-account.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,O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