@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
@@ -1,4 +1,5 @@
1
1
  import { faker } from "@faker-js/faker";
2
+ import { SimAws } from "./sim-aws.js";
2
3
  export const DEFAULT_SIM_AWS_ACCOUNT_ID = "888888888888";
3
4
  /**
4
5
  * Container for simulated AWS services in one AWS Account.
@@ -7,25 +8,36 @@ export const DEFAULT_SIM_AWS_ACCOUNT_ID = "888888888888";
7
8
  * full Account/Region scope.
8
9
  */
9
10
  export class SimAwsAccount {
10
- accountRegionScopes;
11
+ simAws;
11
12
  accountId;
12
- constructor(accountRegionScopes, accountId = DEFAULT_SIM_AWS_ACCOUNT_ID) {
13
- this.accountRegionScopes = accountRegionScopes;
13
+ constructor(props = {}) {
14
+ const { simAws = new SimAws(), accountId = DEFAULT_SIM_AWS_ACCOUNT_ID } = props;
15
+ this.simAws = simAws;
14
16
  this.accountId = accountId;
15
17
  }
16
18
  /**
17
19
  * Get a simulated AWS Region scoped for this Account.
18
20
  */
19
21
  region(regionName) {
20
- return this.accountRegionScopes.accountRegionScope(this.accountId, regionName);
22
+ return this.simAws.accountRegionScope(this.accountId, regionName);
21
23
  }
22
24
  /**
23
- * Get an installed simulated AWS service for this Account's default Region.
24
- * The service must be installed with the appropriate installer function
25
- * first.
25
+ * Get simulated S3 for this Account's default Region.
26
26
  */
27
- service(serviceName) {
28
- return this.region().service(serviceName);
27
+ s3() {
28
+ return this.region().s3();
29
+ }
30
+ /**
31
+ * Get simulated CloudFront for this Account.
32
+ */
33
+ cloudFront() {
34
+ return this.region().cloudFront();
35
+ }
36
+ /**
37
+ * Get simulated DynamoDB for this Account's default Region.
38
+ */
39
+ dynamoDb() {
40
+ return this.region().dynamoDb();
29
41
  }
30
42
  }
31
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-account.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAiC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAIL;IACD;IAFlB,YACmB,mBAAyD,EAC1D,YAA6B,0BAA0B;QADtD,wBAAmB,GAAnB,mBAAmB,CAAsC;QAC1D,cAAS,GAAT,SAAS,CAA8C;IACtE,CAAC;IAEJ;;OAEG;IACH,MAAM,CAAC,UAA0B;QAC/B,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAChD,IAAI,CAAC,SAAS,EACd,UAAU,CACX,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAoB,CAAC;AACjE,CAAC"}
1
+ {"version":3,"file":"sim-aws-account.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAiC,CAAC;AAO5E;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACP,MAAM,CAAqC;IAC5C,SAAS,CAAkB;IAE3C,YAAY,QAA4B,EAAE;QACxC,MAAM,EAAE,MAAM,GAAG,IAAI,MAAM,EAAE,EAAE,SAAS,GAAG,0BAA0B,EAAE,GACrE,KAAK,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAA0B;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IAED;;OAEG;IACH,EAAE;QACA,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC;IAClC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAoB,CAAC;AACjE,CAAC"}
@@ -1,32 +1,46 @@
1
1
  import type { SimAwsAccountId } from "./sim-aws-account.js";
2
2
  import type { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
3
- import type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceMap } from "./sim-aws-services.js";
3
+ import type { SimS3 } from "../s3/sim-s3.js";
4
+ import type { SimCloudFront } from "../cloudfront/sim-cloudfront.js";
5
+ import type { SimDynamoDb } from "../dynamodb/index.js";
6
+ import { SimAws } from "./sim-aws.js";
4
7
  export declare const AWS_REGION_NAMES: readonly ["us-east-1", "us-east-2", "us-west-1", "us-west-2", "af-south-1", "ap-east-1", "ap-south-2", "ap-southeast-3", "ap-southeast-5", "ap-southeast-4", "ap-south-1", "ap-southeast-6", "ap-northeast-3", "ap-northeast-2", "ap-southeast-1", "ap-southeast-2", "ap-east-2", "ap-southeast-7", "ap-northeast-1", "ca-central-1", "ca-west-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-south-1", "eu-west-3", "eu-south-2", "eu-north-1", "eu-central-2", "il-central-1", "mx-central-1", "me-south-1", "me-central-1", "sa-east-1"];
5
8
  export type AwsRegionName = (typeof AWS_REGION_NAMES)[number];
6
9
  export declare const DEFAULT_SIM_AWS_REGION_NAME: "us-east-1";
10
+ interface SimAwsRegionProps {
11
+ readonly simAws?: Pick<SimAws, "accountRegionScope">;
12
+ readonly regionName?: AwsRegionName;
13
+ }
7
14
  /**
8
15
  * Container for simulated AWS services in one AWS Region.
9
16
  * The real scope is Account/Region in SimAwsAccountRegionContainer.
10
17
  * So SimAwsRegion is like an intermediate navigation handler on the way to a
11
18
  * full Account/Region scope.
12
19
  */
13
- export declare class SimAwsRegion<TServices extends SimAwsServiceMap = NoSimAwsServices> {
14
- private readonly accountRegionScopes;
20
+ export declare class SimAwsRegion {
21
+ private readonly simAws;
15
22
  readonly regionName: AwsRegionName;
16
- constructor(accountRegionScopes: SimAwsAccountRegionScopes<TServices>, regionName?: AwsRegionName);
23
+ constructor(props?: SimAwsRegionProps);
17
24
  /**
18
25
  * Get a simulated AWS Account scoped for this Region.
19
26
  */
20
- account(accountId?: SimAwsAccountId | string): SimAwsAccountRegionContainer<TServices>;
27
+ account(accountId?: SimAwsAccountId | string): SimAwsAccountRegionContainer;
28
+ /**
29
+ * Get simulated S3 for this Region's default Account.
30
+ */
31
+ s3(): SimS3;
32
+ /**
33
+ * Get simulated CloudFront for this Region's default Account.
34
+ */
35
+ cloudFront(): SimCloudFront;
21
36
  /**
22
- * Get an installed simulated AWS service for this Region's default Account.
23
- * The service must be installed with the appropriate installer function
24
- * first.
37
+ * Get simulated DynamoDB for this Region's default Account.
25
38
  */
26
- service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
39
+ dynamoDb(): SimDynamoDb;
27
40
  }
28
41
  /**
29
42
  * Choose a random AWS Region name.
30
43
  */
31
44
  export declare function makeAwsRegionName(): AwsRegionName;
45
+ export {};
32
46
  //# sourceMappingURL=sim-aws-region.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-region.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAG/B,eAAO,MAAM,gBAAgB,ghBAmCnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,2BAA2B,EAAG,WAAoB,CAAC;AAEhE;;;;;GAKG;AACH,qBAAa,YAAY,CACvB,SAAS,SAAS,gBAAgB,GAAG,gBAAgB;IAGnD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;aACpB,UAAU,EAAE,aAAa;gBADxB,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC1D,UAAU,GAAE,aAA2C;IAGzE;;OAEG;IACH,OAAO,CACL,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,GACnC,4BAA4B,CAAC,SAAS,CAAC;IAO1C;;;;OAIG;IACH,OAAO,CAAC,IAAI,SAAS,MAAM,SAAS,EAAE,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC;CAG1E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD"}
1
+ {"version":3,"file":"sim-aws-region.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEtF,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;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAO,MAAM,gBAAgB,ghBAmCnB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,2BAA2B,EAAG,WAAoB,CAAC;AAEhE,UAAU,iBAAiB;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACrD,QAAQ,CAAC,UAAU,CAAC,EAAE,aAAa,CAAC;CACrC;AAED;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;IAC5D,SAAgB,UAAU,EAAE,aAAa,CAAC;gBAE9B,KAAK,GAAE,iBAAsB;IAQzC;;OAEG;IACH,OAAO,CAAC,SAAS,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,4BAA4B;IAO3E;;OAEG;IACH,EAAE,IAAI,KAAK;IAIX;;OAEG;IACH,UAAU,IAAI,aAAa;IAI3B;;OAEG;IACH,QAAQ,IAAI,WAAW;CAGxB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,aAAa,CAEjD"}
@@ -1,4 +1,5 @@
1
1
  import { faker } from "@faker-js/faker";
2
+ import { SimAws } from "./sim-aws.js";
2
3
  export const AWS_REGION_NAMES = [
3
4
  "us-east-1",
4
5
  "us-east-2",
@@ -43,25 +44,36 @@ export const DEFAULT_SIM_AWS_REGION_NAME = "us-east-1";
43
44
  * full Account/Region scope.
44
45
  */
45
46
  export class SimAwsRegion {
46
- accountRegionScopes;
47
+ simAws;
47
48
  regionName;
48
- constructor(accountRegionScopes, regionName = DEFAULT_SIM_AWS_REGION_NAME) {
49
- this.accountRegionScopes = accountRegionScopes;
49
+ constructor(props = {}) {
50
+ const { simAws = new SimAws(), regionName = DEFAULT_SIM_AWS_REGION_NAME } = props;
51
+ this.simAws = simAws;
50
52
  this.regionName = regionName;
51
53
  }
52
54
  /**
53
55
  * Get a simulated AWS Account scoped for this Region.
54
56
  */
55
57
  account(accountId) {
56
- return this.accountRegionScopes.accountRegionScope(accountId, this.regionName);
58
+ return this.simAws.accountRegionScope(accountId, this.regionName);
57
59
  }
58
60
  /**
59
- * Get an installed simulated AWS service for this Region's default Account.
60
- * The service must be installed with the appropriate installer function
61
- * first.
61
+ * Get simulated S3 for this Region's default Account.
62
62
  */
63
- service(serviceName) {
64
- return this.account().service(serviceName);
63
+ s3() {
64
+ return this.account().s3();
65
+ }
66
+ /**
67
+ * Get simulated CloudFront for this Region's default Account.
68
+ */
69
+ cloudFront() {
70
+ return this.account().cloudFront();
71
+ }
72
+ /**
73
+ * Get simulated DynamoDB for this Region's default Account.
74
+ */
75
+ dynamoDb() {
76
+ return this.account().dynamoDb();
65
77
  }
66
78
  }
67
79
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws-region.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,WAAW;IACX,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,cAAc;IACd,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAoB,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IAIJ;IACD;IAFlB,YACmB,mBAAyD,EAC1D,aAA4B,2BAA2B;QADtD,wBAAmB,GAAnB,mBAAmB,CAAsC;QAC1D,eAAU,GAAV,UAAU,CAA6C;IACtE,CAAC;IAEJ;;OAEG;IACH,OAAO,CACL,SAAoC;QAEpC,OAAO,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAChD,SAA4B,EAC5B,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,OAAO,CAA+B,WAAiB;QACrD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"sim-aws-region.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws-region.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;I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AAC"}
@@ -1,65 +1,84 @@
1
1
  import { SimAwsAccount, type SimAwsAccountId } from "./sim-aws-account.js";
2
2
  import { type BackgroundCompleter, type BackgroundScheduler } from "../../util/background/background.js";
3
- import { SimAwsRegion, type AwsRegionName } from "./sim-aws-region.js";
4
- import type { NoSimAwsServices, SimAwsAccountRegionScopes, SimAwsServiceFactory, SimAwsServiceMap } from "./sim-aws-services.js";
3
+ import { type AwsRegionName, SimAwsRegion } from "./sim-aws-region.js";
5
4
  import { SimAwsAccountRegionContainer } from "./sim-aws-account-region-scope.js";
6
- import type { SimAwsServiceController, SimAwsServiceControllerFactory } from "../../serve/controller/sim-service-controller.js";
5
+ import type { SimAwsServiceController } from "../../serve/controller/sim-service-controller.js";
6
+ import { SimS3 } from "../s3/sim-s3.js";
7
+ import { SimCloudFront } from "../cloudfront/sim-cloudfront.js";
8
+ import { SimCloudFrontRegistry } from "../cloudfront/sim-cloud-front-registry.js";
9
+ import { SimDynamoDb } from "../dynamodb/index.js";
10
+ interface SimAwsProps {
11
+ readonly defaultAccountId?: SimAwsAccountId;
12
+ readonly defaultRegionName?: AwsRegionName;
13
+ readonly background?: BackgroundScheduler & BackgroundCompleter;
14
+ }
7
15
  /**
8
16
  * Top-level container for simulated AWS.
9
- * Contains Account scopes, Region scopes, Account/Region scopes.
10
- * Installers for each simulated service install services into the SimAws
11
- * container.
12
- * This allows for individual services to be installed as necessary, without
13
- * importing all of them from the root and requiring every AWS SDK to be
14
- * installed.
17
+ * Contains Account scopes, Region scopes, Account/Region scopes, and built-in
18
+ * simulated AWS services.
15
19
  */
16
- export declare class SimAws<TServices extends SimAwsServiceMap = NoSimAwsServices> implements SimAwsAccountRegionScopes<TServices> {
20
+ export declare class SimAws {
17
21
  readonly defaultAccountId: SimAwsAccountId;
18
- readonly defaultRegionName: "us-east-1";
19
- readonly background: BackgroundScheduler & BackgroundCompleter;
22
+ readonly defaultRegionName: AwsRegionName;
23
+ private readonly background;
20
24
  private readonly accounts;
21
25
  private readonly regions;
22
26
  private readonly accountRegionScopes;
23
- private readonly serviceFactories;
24
- private readonly serviceControllerFactories;
25
- constructor(defaultAccountId?: SimAwsAccountId, defaultRegionName?: "us-east-1", background?: BackgroundScheduler & BackgroundCompleter);
27
+ private readonly s3GlobalRegistry;
28
+ private readonly cloudFrontRegistry;
29
+ private readonly cloudFrontServices;
30
+ constructor(props?: SimAwsProps);
26
31
  /**
27
32
  * Get a simulated AWS Account.
28
33
  */
29
- account(accountId?: string): SimAwsAccount<TServices>;
34
+ account(accountId?: string): SimAwsAccount;
30
35
  /**
31
36
  * Get a simulated AWS Account Region scope.
32
37
  */
33
- region(regionName?: AwsRegionName): SimAwsRegion<TServices>;
38
+ region(regionName?: AwsRegionName): SimAwsRegion;
34
39
  /**
35
40
  * Get an Account Region scope in this simulated AWS.
36
41
  */
37
- accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer<TServices>;
42
+ accountRegionScope(accountId?: SimAwsAccountId, regionName?: AwsRegionName): SimAwsAccountRegionContainer;
43
+ /**
44
+ * Get simulated S3 in the default Account Region scope.
45
+ */
46
+ s3(): SimS3;
47
+ /**
48
+ * Get simulated CloudFront in the default Account scope.
49
+ */
50
+ cloudFront(): SimCloudFront;
51
+ /**
52
+ * Get simulated DynamoDB in the default Account Region scope.
53
+ */
54
+ dynamoDb(): SimDynamoDb;
38
55
  /**
39
- * Install a simulated AWS service factory.
56
+ * Create simulated S3 for an Account Region scope.
40
57
  */
41
- installService(serviceName: PropertyKey, factory: SimAwsServiceFactory): void;
58
+ _createS3(scope: SimAwsAccountRegionContainer): SimS3;
42
59
  /**
43
- * Install a simulated AWS HTTP service controller factory.
60
+ * Create or get simulated CloudFront for an Account scope.
44
61
  */
45
- installServiceController(serviceName: string, factory: SimAwsServiceControllerFactory): void;
62
+ _createCloudFront(scope: SimAwsAccountRegionContainer): SimCloudFront;
46
63
  /**
47
- * Create an installed simulated AWS service for an Account Region scope.
64
+ * Get the shared simulated CloudFront registry.
65
+ *
66
+ * This is intended for CloudFront service/controller wiring so request routing
67
+ * uses the same registry as CloudFront SDK command handling.
48
68
  */
49
- createService<TKey extends keyof TServices>(serviceName: TKey, scope: SimAwsAccountRegionContainer<TServices>): TServices[TKey];
69
+ _cloudFrontRegistry(): SimCloudFrontRegistry;
50
70
  /**
51
- * Create an installed simulated AWS HTTP service controller.
71
+ * Create simulated DynamoDB for an Account Region scope.
52
72
  */
53
- createServiceController(serviceName: string): SimAwsServiceController;
73
+ _createDynamoDb(scope: SimAwsAccountRegionContainer): SimDynamoDb;
54
74
  /**
55
- * Get an installed simulated AWS service in the default Account Region scope.
56
- * The service must be installed with the appropriate installer function
57
- * first.
75
+ * Create a simulated AWS HTTP service controller.
58
76
  */
59
- service<TKey extends keyof TServices>(serviceName: TKey): TServices[TKey];
77
+ _createServiceController(serviceName: string): SimAwsServiceController;
60
78
  /**
61
79
  * Wait for all outstanding background tasks to complete.
62
80
  */
63
81
  backgroundTasksComplete(): Promise<void>;
64
82
  }
83
+ export {};
65
84
  //# sourceMappingURL=sim-aws.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws.d.ts","sourceRoot":"","sources":["../../../src/service/aws/sim-aws.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EAEzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,YAAY,EACZ,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,4BAA4B,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,uBAAuB,EACvB,8BAA8B,EAC/B,MAAM,kDAAkD,CAAC;AAE1D;;;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B,CAGhC;IAEJ,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAE9D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA+B;IAElE,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAG/B;gBAEQ,KAAK,GAAE,WAAgB;IAYnC;;OAEG;IACH,OAAO,CAAC,SAAS,GAAE,MAA8B,GAAG,aAAa;IAcjE;;OAEG;IACH,MAAM,CAAC,UAAU,GAAE,aAAsC,GAAG,YAAY;IAcxE;;OAEG;IACH,kBAAkB,CAChB,SAAS,GAAE,eAAuC,EAClD,UAAU,GAAE,aAAsC,GACjD,4BAA4B;IAgB/B;;OAEG;IACH,EAAE,IAAI,KAAK;IAIX;;OAEG;IACH,UAAU,IAAI,aAAa;IAI3B;;OAEG;IACH,QAAQ,IAAI,WAAW;IAIvB;;OAEG;IACH,SAAS,CAAC,KAAK,EAAE,4BAA4B,GAAG,KAAK;IAOrD;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,4BAA4B,GAAG,aAAa;IAkBrE;;;;;OAKG;IACH,mBAAmB,IAAI,qBAAqB;IAI5C;;OAEG;IACH,eAAe,CAAC,KAAK,EAAE,4BAA4B,GAAG,WAAW;IAOjE;;OAEG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB;IAkBtE;;OAEG;IACG,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/C"}
@@ -2,14 +2,18 @@ import { DEFAULT_SIM_AWS_ACCOUNT_ID, SimAwsAccount, } from "./sim-aws-account.js
2
2
  import { BackgroundTasks, } from "../../util/background/background.js";
3
3
  import { DEFAULT_SIM_AWS_REGION_NAME, SimAwsRegion, } from "./sim-aws-region.js";
4
4
  import { SimAwsAccountRegionContainer, } from "./sim-aws-account-region-scope.js";
5
+ import { SimS3 } from "../s3/sim-s3.js";
6
+ import { SimS3GlobalRegistry } from "../s3/sim-s3-global-registry.js";
7
+ import { SimS3ServiceController } from "../s3/serve/sim-s3-controller.js";
8
+ import { SimCloudFront } from "../cloudfront/sim-cloudfront.js";
9
+ import { SimCloudFrontRegistry } from "../cloudfront/sim-cloud-front-registry.js";
10
+ import { createSimCloudFrontS3OriginResolver } from "../cloudfront/origin/sim-cloudfront-s3-origin.js";
11
+ import { SimCloudFrontServiceController } from "../cloudfront/controller/sim-cloudfront-controller.js";
12
+ import { SimDynamoDb } from "../dynamodb/index.js";
5
13
  /**
6
14
  * Top-level container for simulated AWS.
7
- * Contains Account scopes, Region scopes, Account/Region scopes.
8
- * Installers for each simulated service install services into the SimAws
9
- * container.
10
- * This allows for individual services to be installed as necessary, without
11
- * importing all of them from the root and requiring every AWS SDK to be
12
- * installed.
15
+ * Contains Account scopes, Region scopes, Account/Region scopes, and built-in
16
+ * simulated AWS services.
13
17
  */
14
18
  export class SimAws {
15
19
  defaultAccountId;
@@ -18,9 +22,11 @@ export class SimAws {
18
22
  accounts = new Map();
19
23
  regions = new Map();
20
24
  accountRegionScopes = new Map();
21
- serviceFactories = new Map();
22
- serviceControllerFactories = new Map();
23
- constructor(defaultAccountId = DEFAULT_SIM_AWS_ACCOUNT_ID, defaultRegionName = DEFAULT_SIM_AWS_REGION_NAME, background = new BackgroundTasks()) {
25
+ s3GlobalRegistry = new SimS3GlobalRegistry();
26
+ cloudFrontRegistry = new SimCloudFrontRegistry();
27
+ cloudFrontServices = new Map();
28
+ constructor(props = {}) {
29
+ const { defaultAccountId = DEFAULT_SIM_AWS_ACCOUNT_ID, defaultRegionName = DEFAULT_SIM_AWS_REGION_NAME, background = new BackgroundTasks(), } = props;
24
30
  this.defaultAccountId = defaultAccountId;
25
31
  this.defaultRegionName = defaultRegionName;
26
32
  this.background = background;
@@ -31,7 +37,10 @@ export class SimAws {
31
37
  account(accountId = this.defaultAccountId) {
32
38
  let account = this.accounts.get(accountId);
33
39
  if (account === undefined) {
34
- account = new SimAwsAccount(this, accountId);
40
+ account = new SimAwsAccount({
41
+ simAws: this,
42
+ accountId: accountId,
43
+ });
35
44
  this.accounts.set(accountId, account);
36
45
  }
37
46
  return account;
@@ -42,7 +51,10 @@ export class SimAws {
42
51
  region(regionName = this.defaultRegionName) {
43
52
  let region = this.regions.get(regionName);
44
53
  if (region === undefined) {
45
- region = new SimAwsRegion(this, regionName);
54
+ region = new SimAwsRegion({
55
+ simAws: this,
56
+ regionName,
57
+ });
46
58
  this.regions.set(regionName, region);
47
59
  }
48
60
  return region;
@@ -54,56 +66,94 @@ export class SimAws {
54
66
  const scopeKey = `${accountId}:${regionName}`;
55
67
  let accountRegionScope = this.accountRegionScopes.get(scopeKey);
56
68
  if (accountRegionScope === undefined) {
57
- accountRegionScope = new SimAwsAccountRegionContainer(this, this.account(accountId), this.region(regionName));
69
+ accountRegionScope = new SimAwsAccountRegionContainer({
70
+ simAws: this,
71
+ account: this.account(accountId),
72
+ region: this.region(regionName),
73
+ });
58
74
  this.accountRegionScopes.set(scopeKey, accountRegionScope);
59
75
  }
60
76
  return accountRegionScope;
61
77
  }
62
78
  /**
63
- * Install a simulated AWS service factory.
79
+ * Get simulated S3 in the default Account Region scope.
64
80
  */
65
- installService(serviceName, factory) {
66
- if (this.serviceFactories.has(serviceName)) {
67
- throw new Error(`Sim AWS service is already installed: ${String(serviceName)}`);
68
- }
69
- this.serviceFactories.set(serviceName, factory);
81
+ s3() {
82
+ return this.accountRegionScope().s3();
70
83
  }
71
84
  /**
72
- * Install a simulated AWS HTTP service controller factory.
85
+ * Get simulated CloudFront in the default Account scope.
73
86
  */
74
- installServiceController(serviceName, factory) {
75
- if (this.serviceControllerFactories.has(serviceName)) {
76
- throw new Error(`Sim AWS service controller is already installed: ${serviceName}`);
77
- }
78
- this.serviceControllerFactories.set(serviceName, factory);
87
+ cloudFront() {
88
+ return this.accountRegionScope().cloudFront();
79
89
  }
80
90
  /**
81
- * Create an installed simulated AWS service for an Account Region scope.
91
+ * Get simulated DynamoDB in the default Account Region scope.
82
92
  */
83
- createService(serviceName, scope) {
84
- const factory = this.serviceFactories.get(serviceName);
85
- if (factory === undefined) {
86
- throw new Error(`Sim AWS service is not installed: ${String(serviceName)}. Call installer function to install it.`);
87
- }
88
- return factory(scope);
93
+ dynamoDb() {
94
+ return this.accountRegionScope().dynamoDb();
89
95
  }
90
96
  /**
91
- * Create an installed simulated AWS HTTP service controller.
97
+ * Create simulated S3 for an Account Region scope.
92
98
  */
93
- createServiceController(serviceName) {
94
- const factory = this.serviceControllerFactories.get(serviceName);
95
- if (factory === undefined) {
96
- throw new Error(`No controller installed for simulated AWS service ${serviceName}`);
99
+ _createS3(scope) {
100
+ return new SimS3({
101
+ accountRegionScope: scope.accountRegionScope,
102
+ s3GlobalRegistry: this.s3GlobalRegistry,
103
+ });
104
+ }
105
+ /**
106
+ * Create or get simulated CloudFront for an Account scope.
107
+ */
108
+ _createCloudFront(scope) {
109
+ const { accountId } = scope.accountRegionScope;
110
+ let cloudFront = this.cloudFrontServices.get(accountId);
111
+ if (cloudFront === undefined) {
112
+ cloudFront = new SimCloudFront({
113
+ accountRegionScope: scope.accountRegionScope,
114
+ cloudFrontRegistry: this.cloudFrontRegistry,
115
+ s3OriginResolver: createSimCloudFrontS3OriginResolver(this, scope),
116
+ background: this.background,
117
+ });
118
+ this.cloudFrontServices.set(accountId, cloudFront);
97
119
  }
98
- return factory(this);
120
+ return cloudFront;
99
121
  }
100
122
  /**
101
- * Get an installed simulated AWS service in the default Account Region scope.
102
- * The service must be installed with the appropriate installer function
103
- * first.
123
+ * Get the shared simulated CloudFront registry.
124
+ *
125
+ * This is intended for CloudFront service/controller wiring so request routing
126
+ * uses the same registry as CloudFront SDK command handling.
104
127
  */
105
- service(serviceName) {
106
- return this.accountRegionScope().service(serviceName);
128
+ _cloudFrontRegistry() {
129
+ return this.cloudFrontRegistry;
130
+ }
131
+ /**
132
+ * Create simulated DynamoDB for an Account Region scope.
133
+ */
134
+ _createDynamoDb(scope) {
135
+ return new SimDynamoDb({
136
+ accountRegionScope: scope.accountRegionScope,
137
+ background: this.background,
138
+ });
139
+ }
140
+ /**
141
+ * Create a simulated AWS HTTP service controller.
142
+ */
143
+ _createServiceController(serviceName) {
144
+ switch (serviceName) {
145
+ case "s3": {
146
+ return new SimS3ServiceController({ simAws: this });
147
+ }
148
+ case "cloudFront": {
149
+ return new SimCloudFrontServiceController({
150
+ simAws: this,
151
+ });
152
+ }
153
+ default: {
154
+ throw new Error(`No controller for simulated AWS service ${serviceName}`);
155
+ }
156
+ }
107
157
  }
108
158
  /**
109
159
  * Wait for all outstanding background tasks to complete.
@@ -1 +1 @@
1
- {"version":3,"file":"sim-aws.js","sourceRoot":"","sources":["../../../src/service/aws/sim-aws.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,aAAa,GAEd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,2BAA2B,EAC3B,YAAY,GAEb,MAAM,qBAAqB,CAAC;AAO7B,OAAO,EAEL,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAM3C;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAM;IA6BC;IACA;IACA;IA5BD,QAAQ,GAAG,IAAI,GAAG,EAGhC,CAAC;IAEa,OAAO,GAAG,IAAI,GAAG,EAG/B,CAAC;IAEa,mBAAmB,GAAG,IAAI,GAAG,EAG3C,CAAC;IAEa,gBAAgB,GAAG,IAAI,GAAG,EAGxC,CAAC;IAEa,0BAA0B,GAAG,IAAI,GAAG,EAGlD,CAAC;IAEJ,YACkB,mBAAmB,0BAA0B,EAC7C,oBAAoB,2BAA2B,EAC/C,aACQ,IAAI,eAAe,EAAE;QAH7B,qBAAgB,GAAhB,gBAAgB,CAA6B;QAC7C,sBAAiB,GAAjB,iBAAiB,CAA8B;QAC/C,eAAU,GAAV,UAAU,CACmB;IAC5C,CAAC;IAEJ;;OAEG;IACH,OAAO,CAAC,YAAoB,IAAI,CAAC,gBAAgB;QAC/C,IAAI,OAAO,GAAG,IAAI,CAAC,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";
2
+ import type { SimArn } from "../../aws/arn.js";
2
3
  export interface SimCloudFrontBehavior {
3
4
  pathPattern?: string;
4
5
  targetOriginName: string;
@@ -6,6 +7,10 @@ export interface SimCloudFrontBehavior {
6
7
  cachedMethods: Set<string>;
7
8
  viewerProtocolPolicy?: "allow-all" | "redirect-to-https" | "https-only";
8
9
  originPath?: string;
10
+ functionAssociations?: {
11
+ viewerRequest?: SimArn;
12
+ viewerResponse?: SimArn;
13
+ } | undefined;
9
14
  }
10
15
  /**
11
16
  * Generate a fake SimCloudFrontBehavior.
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cloud-front-behavior.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudfront/behaviour/sim-cloud-front-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,oBAAoB,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,YAAY,CAAC;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AACD;;GAEG;AACH,eAAO,MAAM,4BAA4B,sCAQrC,CAAC"}
1
+ {"version":3,"file":"sim-cloud-front-behavior.d.ts","sourceRoot":"","sources":["../../../../src/service/cloudfront/behaviour/sim-cloud-front-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,oBAAoB,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAAG,YAAY,CAAC;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EACjB;QACE,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GACD,SAAS,CAAC;CACf;AAED;;GAEG;AACH,eAAO,MAAM,4BAA4B,sCAQrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cloud-front-behavior.js","sourceRoot":"","sources":["../../../../src/service/cloudfront/behaviour/sim-cloud-front-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAUrD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,IAAI,aAAa,CAAwB;IACvC,WAAW,EAAE,GAAG;IAChB,gBAAgB,EAAE,eAAe;IACjC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,aAAa,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,oBAAoB,EAAE,WAAW;IACjC,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC"}
1
+ {"version":3,"file":"sim-cloud-front-behavior.js","sourceRoot":"","sources":["../../../../src/service/cloudfront/behaviour/sim-cloud-front-behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAkBrD;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,IAAI,aAAa,CAAwB;IACvC,WAAW,EAAE,GAAG;IAChB,gBAAgB,EAAE,eAAe;IACjC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACxC,aAAa,EAAE,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,oBAAoB,EAAE,WAAW;IACjC,UAAU,EAAE,cAAc;CAC3B,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { CloudFrontFunction } from "../../typings/cloudfront-functions.namespace.js";
2
+ /**
3
+ * Converts between native Fetch API Request/Response objects and the
4
+ * CloudFront Function event/request/response shapes.
5
+ */
6
+ export declare class SimCffEventAdapter {
7
+ /**
8
+ * Adapt a Request into a ViewerRequestEvent.
9
+ */
10
+ toViewerRequestEvent(req: Request): CloudFrontFunction.ViewerRequestEvent;
11
+ /**
12
+ * Adapt a Request and Response into a ViewerResponseEvent.
13
+ */
14
+ toViewerResponseEvent(req: Request, res: Response): CloudFrontFunction.ViewerResponseEvent;
15
+ /**
16
+ * Adapt a viewer-request CFF result into a Request or Response.
17
+ */
18
+ fromViewerRequestResult(result: CloudFrontFunction.Request | CloudFrontFunction.Response, originalReq: Request): Request | Response;
19
+ /**
20
+ * Adapt a viewer-response CFF result into a Response.
21
+ */
22
+ fromViewerResponseResult(result: CloudFrontFunction.Response): Response;
23
+ private toCffRequest;
24
+ private toCffResponse;
25
+ private fromCffRequest;
26
+ private fromCffResponse;
27
+ private cffResponseBody;
28
+ private toCffHeaders;
29
+ private fromCffHeaders;
30
+ private toCffQueryString;
31
+ private fromCffQueryString;
32
+ private toCffCookies;
33
+ private fromCffCookies;
34
+ private isCffResponse;
35
+ }
36
+ //# sourceMappingURL=sim-cff-event-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cff-event-adapter.d.ts","sourceRoot":"","sources":["../../../../../src/service/cloudfront/cff/adapter/sim-cff-event-adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAE1F;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAAC,kBAAkB;IAazE;;OAEG;IACH,qBAAqB,CACnB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,GACZ,kBAAkB,CAAC,mBAAmB;IAczC;;OAEG;IACH,uBAAuB,CACrB,MAAM,EAAE,kBAAkB,CAAC,OAAO,GAAG,kBAAkB,CAAC,QAAQ,EAChE,WAAW,EAAE,OAAO,GACnB,OAAO,GAAG,QAAQ;IAQrB;;OAEG;IACH,wBAAwB,CAAC,MAAM,EAAE,kBAAkB,CAAC,QAAQ,GAAG,QAAQ;IAIvE,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,YAAY;IAwBpB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;CAKtB"}