@kensio/yulin 1.6.1 → 1.8.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 (698) hide show
  1. package/README.md +83 -0
  2. package/dist/cli/sim-cli.d.ts +20 -0
  3. package/dist/cli/sim-cli.d.ts.map +1 -0
  4. package/dist/cli/sim-cli.js +46 -0
  5. package/dist/cli/sim-cli.js.map +1 -0
  6. package/dist/cli/watch/sim-watch-arguments.d.ts +31 -0
  7. package/dist/cli/watch/sim-watch-arguments.d.ts.map +1 -0
  8. package/dist/cli/watch/sim-watch-arguments.js +95 -0
  9. package/dist/cli/watch/sim-watch-arguments.js.map +1 -0
  10. package/dist/cli/watch/sim-watch-child-environment.d.ts +30 -0
  11. package/dist/cli/watch/sim-watch-child-environment.d.ts.map +1 -0
  12. package/dist/cli/watch/sim-watch-child-environment.js +51 -0
  13. package/dist/cli/watch/sim-watch-child-environment.js.map +1 -0
  14. package/dist/cli/watch/sim-watch-child-message.d.ts +19 -0
  15. package/dist/cli/watch/sim-watch-child-message.d.ts.map +1 -0
  16. package/dist/cli/watch/sim-watch-child-message.js +42 -0
  17. package/dist/cli/watch/sim-watch-child-message.js.map +1 -0
  18. package/dist/cli/watch/sim-watch-child-process.d.ts +22 -0
  19. package/dist/cli/watch/sim-watch-child-process.d.ts.map +1 -0
  20. package/dist/cli/watch/sim-watch-child-process.js +33 -0
  21. package/dist/cli/watch/sim-watch-child-process.js.map +1 -0
  22. package/dist/cli/watch/sim-watch-child-shutdown.d.ts +28 -0
  23. package/dist/cli/watch/sim-watch-child-shutdown.d.ts.map +1 -0
  24. package/dist/cli/watch/sim-watch-child-shutdown.js +59 -0
  25. package/dist/cli/watch/sim-watch-child-shutdown.js.map +1 -0
  26. package/dist/cli/watch/sim-watch-child.d.ts +42 -0
  27. package/dist/cli/watch/sim-watch-child.d.ts.map +1 -0
  28. package/dist/cli/watch/sim-watch-child.js +62 -0
  29. package/dist/cli/watch/sim-watch-child.js.map +1 -0
  30. package/dist/cli/watch/sim-watch-command.d.ts +22 -0
  31. package/dist/cli/watch/sim-watch-command.d.ts.map +1 -0
  32. package/dist/cli/watch/sim-watch-command.js +41 -0
  33. package/dist/cli/watch/sim-watch-command.js.map +1 -0
  34. package/dist/cli/watch/sim-watch-event-path.d.ts +27 -0
  35. package/dist/cli/watch/sim-watch-event-path.d.ts.map +1 -0
  36. package/dist/cli/watch/sim-watch-event-path.js +48 -0
  37. package/dist/cli/watch/sim-watch-event-path.js.map +1 -0
  38. package/dist/cli/watch/sim-watch-ignore.d.ts +15 -0
  39. package/dist/cli/watch/sim-watch-ignore.d.ts.map +1 -0
  40. package/dist/cli/watch/sim-watch-ignore.js +64 -0
  41. package/dist/cli/watch/sim-watch-ignore.js.map +1 -0
  42. package/dist/cli/watch/sim-watch-loop-guard.d.ts +35 -0
  43. package/dist/cli/watch/sim-watch-loop-guard.d.ts.map +1 -0
  44. package/dist/cli/watch/sim-watch-loop-guard.js +51 -0
  45. package/dist/cli/watch/sim-watch-loop-guard.js.map +1 -0
  46. package/dist/cli/watch/sim-watch-reporter.d.ts +38 -0
  47. package/dist/cli/watch/sim-watch-reporter.d.ts.map +1 -0
  48. package/dist/cli/watch/sim-watch-reporter.js +65 -0
  49. package/dist/cli/watch/sim-watch-reporter.js.map +1 -0
  50. package/dist/cli/watch/sim-watch-restarts.d.ts +30 -0
  51. package/dist/cli/watch/sim-watch-restarts.d.ts.map +1 -0
  52. package/dist/cli/watch/sim-watch-restarts.js +62 -0
  53. package/dist/cli/watch/sim-watch-restarts.js.map +1 -0
  54. package/dist/cli/watch/sim-watch-supervisor.d.ts +52 -0
  55. package/dist/cli/watch/sim-watch-supervisor.d.ts.map +1 -0
  56. package/dist/cli/watch/sim-watch-supervisor.js +128 -0
  57. package/dist/cli/watch/sim-watch-supervisor.js.map +1 -0
  58. package/dist/cli/watch/sim-watch-watcher.d.ts +69 -0
  59. package/dist/cli/watch/sim-watch-watcher.d.ts.map +1 -0
  60. package/dist/cli/watch/sim-watch-watcher.js +148 -0
  61. package/dist/cli/watch/sim-watch-watcher.js.map +1 -0
  62. package/dist/cli/yulin.d.ts +3 -0
  63. package/dist/cli/yulin.d.ts.map +1 -0
  64. package/dist/cli/yulin.js +14 -0
  65. package/dist/cli/yulin.js.map +1 -0
  66. package/dist/index.d.ts +3 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +1 -0
  69. package/dist/index.js.map +1 -1
  70. package/dist/serve/http/live-reload/sim-live-reload-client.d.ts +44 -0
  71. package/dist/serve/http/live-reload/sim-live-reload-client.d.ts.map +1 -0
  72. package/dist/serve/http/live-reload/sim-live-reload-client.js +86 -0
  73. package/dist/serve/http/live-reload/sim-live-reload-client.js.map +1 -0
  74. package/dist/serve/http/live-reload/sim-live-reload-injectable.d.ts +47 -0
  75. package/dist/serve/http/live-reload/sim-live-reload-injectable.d.ts.map +1 -0
  76. package/dist/serve/http/live-reload/sim-live-reload-injectable.js +86 -0
  77. package/dist/serve/http/live-reload/sim-live-reload-injectable.js.map +1 -0
  78. package/dist/serve/http/live-reload/sim-live-reload-injector.d.ts +22 -0
  79. package/dist/serve/http/live-reload/sim-live-reload-injector.d.ts.map +1 -0
  80. package/dist/serve/http/live-reload/sim-live-reload-injector.js +72 -0
  81. package/dist/serve/http/live-reload/sim-live-reload-injector.js.map +1 -0
  82. package/dist/serve/http/live-reload/sim-live-reload-report.d.ts +18 -0
  83. package/dist/serve/http/live-reload/sim-live-reload-report.d.ts.map +1 -0
  84. package/dist/serve/http/live-reload/sim-live-reload-report.js +27 -0
  85. package/dist/serve/http/live-reload/sim-live-reload-report.js.map +1 -0
  86. package/dist/serve/http/live-reload/sim-live-reload-script.d.ts +20 -0
  87. package/dist/serve/http/live-reload/sim-live-reload-script.d.ts.map +1 -0
  88. package/dist/serve/http/live-reload/sim-live-reload-script.js +45 -0
  89. package/dist/serve/http/live-reload/sim-live-reload-script.js.map +1 -0
  90. package/dist/serve/http/live-reload/sim-live-reload.config.d.ts +13 -0
  91. package/dist/serve/http/live-reload/sim-live-reload.config.d.ts.map +1 -0
  92. package/dist/serve/http/live-reload/sim-live-reload.config.js +25 -0
  93. package/dist/serve/http/live-reload/sim-live-reload.config.js.map +1 -0
  94. package/dist/serve/http/live-reload/sim-live-reload.d.ts +55 -0
  95. package/dist/serve/http/live-reload/sim-live-reload.d.ts.map +1 -0
  96. package/dist/serve/http/live-reload/sim-live-reload.js +84 -0
  97. package/dist/serve/http/live-reload/sim-live-reload.js.map +1 -0
  98. package/dist/serve/http/live-reload/sim-local-live-reload.d.ts +55 -0
  99. package/dist/serve/http/live-reload/sim-local-live-reload.d.ts.map +1 -0
  100. package/dist/serve/http/live-reload/sim-local-live-reload.js +80 -0
  101. package/dist/serve/http/live-reload/sim-local-live-reload.js.map +1 -0
  102. package/dist/serve/http/local-server/node-server-port-binder.d.ts +39 -0
  103. package/dist/serve/http/local-server/node-server-port-binder.d.ts.map +1 -0
  104. package/dist/serve/http/local-server/node-server-port-binder.js +71 -0
  105. package/dist/serve/http/local-server/node-server-port-binder.js.map +1 -0
  106. package/dist/serve/http/local-server/node-server-port.d.ts +10 -0
  107. package/dist/serve/http/local-server/node-server-port.d.ts.map +1 -0
  108. package/dist/serve/http/local-server/node-server-port.js +19 -0
  109. package/dist/serve/http/local-server/node-server-port.js.map +1 -0
  110. package/dist/serve/http/local-server/sim-aws-local-port.error.d.ts +13 -0
  111. package/dist/serve/http/local-server/sim-aws-local-port.error.d.ts.map +1 -0
  112. package/dist/serve/http/local-server/sim-aws-local-port.error.js +16 -0
  113. package/dist/serve/http/local-server/sim-aws-local-port.error.js.map +1 -0
  114. package/dist/serve/http/local-server/sim-aws-local-request-handler.d.ts +14 -1
  115. package/dist/serve/http/local-server/sim-aws-local-request-handler.d.ts.map +1 -1
  116. package/dist/serve/http/local-server/sim-aws-local-request-handler.js +20 -2
  117. package/dist/serve/http/local-server/sim-aws-local-request-handler.js.map +1 -1
  118. package/dist/serve/http/local-server/sim-aws-local-server.d.ts +66 -1
  119. package/dist/serve/http/local-server/sim-aws-local-server.d.ts.map +1 -1
  120. package/dist/serve/http/local-server/sim-aws-local-server.js +92 -17
  121. package/dist/serve/http/local-server/sim-aws-local-server.js.map +1 -1
  122. package/dist/serve/http/local-server/sim-aws-local.config.d.ts +2 -0
  123. package/dist/serve/http/local-server/sim-aws-local.config.d.ts.map +1 -1
  124. package/dist/serve/http/local-server/sim-aws-local.config.js +6 -0
  125. package/dist/serve/http/local-server/sim-aws-local.config.js.map +1 -1
  126. package/dist/serve/index.d.ts +4 -0
  127. package/dist/serve/index.d.ts.map +1 -1
  128. package/dist/serve/index.js +3 -0
  129. package/dist/serve/index.js.map +1 -1
  130. package/dist/service/aws/factory/sim-aws-account-region-service-builder.d.ts.map +1 -1
  131. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js +2 -2
  132. package/dist/service/aws/factory/sim-aws-account-region-service-builder.js.map +1 -1
  133. package/dist/service/aws/scope/sim-aws-scope-registry.d.ts +9 -0
  134. package/dist/service/aws/scope/sim-aws-scope-registry.d.ts.map +1 -1
  135. package/dist/service/aws/scope/sim-aws-scope-registry.js +13 -0
  136. package/dist/service/aws/scope/sim-aws-scope-registry.js.map +1 -1
  137. package/dist/service/aws/sim-aws-account-id.d.ts +27 -0
  138. package/dist/service/aws/sim-aws-account-id.d.ts.map +1 -0
  139. package/dist/service/aws/sim-aws-account-id.js +34 -0
  140. package/dist/service/aws/sim-aws-account-id.js.map +1 -0
  141. package/dist/service/aws/sim-aws-account-region-scope.d.ts +10 -0
  142. package/dist/service/aws/sim-aws-account-region-scope.d.ts.map +1 -1
  143. package/dist/service/aws/sim-aws-account-region-scope.js +18 -0
  144. package/dist/service/aws/sim-aws-account-region-scope.js.map +1 -1
  145. package/dist/service/aws/sim-aws-account.d.ts +5 -7
  146. package/dist/service/aws/sim-aws-account.d.ts.map +1 -1
  147. package/dist/service/aws/sim-aws-account.js +9 -8
  148. package/dist/service/aws/sim-aws-account.js.map +1 -1
  149. package/dist/service/aws/sim-aws-closing.d.ts +24 -0
  150. package/dist/service/aws/sim-aws-closing.d.ts.map +1 -0
  151. package/dist/service/aws/sim-aws-closing.js +7 -0
  152. package/dist/service/aws/sim-aws-closing.js.map +1 -0
  153. package/dist/service/aws/sim-aws.d.ts +34 -0
  154. package/dist/service/aws/sim-aws.d.ts.map +1 -1
  155. package/dist/service/aws/sim-aws.js +40 -0
  156. package/dist/service/aws/sim-aws.js.map +1 -1
  157. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.d.ts +44 -0
  158. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.d.ts.map +1 -0
  159. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.js +53 -0
  160. package/dist/service/cloudformation/authorize/sim-cloudformation-authorization.js.map +1 -0
  161. package/dist/service/cloudformation/command/update-stack/update-stack.handler.d.ts +7 -0
  162. package/dist/service/cloudformation/command/update-stack/update-stack.handler.d.ts.map +1 -1
  163. package/dist/service/cloudformation/command/update-stack/update-stack.handler.js +3 -1
  164. package/dist/service/cloudformation/command/update-stack/update-stack.handler.js.map +1 -1
  165. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts +19 -0
  166. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.d.ts.map +1 -1
  167. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js +40 -1
  168. package/dist/service/cloudformation/deploy/sim-cfn-template-deployer.js.map +1 -1
  169. package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.d.ts +10 -0
  170. package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.d.ts.map +1 -0
  171. package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.js +14 -0
  172. package/dist/service/cloudformation/deploy/sim-cfn-template-file-deployment.js.map +1 -0
  173. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts +29 -0
  174. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.d.ts.map +1 -1
  175. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js +13 -7
  176. package/dist/service/cloudformation/deploy/sim-cfn-template-file-loader.js.map +1 -1
  177. package/dist/service/cloudformation/deploy/sim-cfn-template-file-transform.d.ts +18 -0
  178. package/dist/service/cloudformation/deploy/sim-cfn-template-file-transform.d.ts.map +1 -0
  179. package/dist/service/cloudformation/deploy/sim-cfn-template-file-transform.js +23 -0
  180. package/dist/service/cloudformation/deploy/sim-cfn-template-file-transform.js.map +1 -0
  181. package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.d.ts +49 -0
  182. package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.d.ts.map +1 -0
  183. package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.js +59 -0
  184. package/dist/service/cloudformation/deploy/sim-cfn-template-file-updater.js.map +1 -0
  185. package/dist/service/cloudformation/index.d.ts +3 -0
  186. package/dist/service/cloudformation/index.d.ts.map +1 -1
  187. package/dist/service/cloudformation/sim-cloudformation.d.ts +39 -5
  188. package/dist/service/cloudformation/sim-cloudformation.d.ts.map +1 -1
  189. package/dist/service/cloudformation/sim-cloudformation.js +56 -14
  190. package/dist/service/cloudformation/sim-cloudformation.js.map +1 -1
  191. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts +10 -1
  192. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.d.ts.map +1 -1
  193. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js +12 -1
  194. package/dist/service/cloudformation/stack/sim-cfn-stack-resource-operations.js.map +1 -1
  195. package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts +14 -1
  196. package/dist/service/cloudformation/stack/sim-cfn-stack.d.ts.map +1 -1
  197. package/dist/service/cloudformation/stack/sim-cfn-stack.js +10 -1
  198. package/dist/service/cloudformation/stack/sim-cfn-stack.js.map +1 -1
  199. package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.d.ts +8 -0
  200. package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.d.ts.map +1 -1
  201. package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.js +9 -1
  202. package/dist/service/cloudformation/stack/update/sim-cfn-stack-updater.js.map +1 -1
  203. package/dist/service/cloudformation/watch/sim-cfn-template-file-events.d.ts +30 -0
  204. package/dist/service/cloudformation/watch/sim-cfn-template-file-events.d.ts.map +1 -0
  205. package/dist/service/cloudformation/watch/sim-cfn-template-file-events.js +51 -0
  206. package/dist/service/cloudformation/watch/sim-cfn-template-file-events.js.map +1 -0
  207. package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.d.ts +39 -0
  208. package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.d.ts.map +1 -0
  209. package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.js +74 -0
  210. package/dist/service/cloudformation/watch/sim-cfn-template-file-watch.js.map +1 -0
  211. package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.d.ts +51 -0
  212. package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.d.ts.map +1 -0
  213. package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.js +0 -0
  214. package/dist/service/cloudformation/watch/sim-cfn-template-file-watches.js.map +1 -0
  215. package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.d.ts +27 -0
  216. package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.d.ts.map +1 -0
  217. package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.js +37 -0
  218. package/dist/service/cloudformation/watch/sim-cfn-template-watch-report.js.map +1 -0
  219. package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.d.ts +45 -0
  220. package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.d.ts.map +1 -0
  221. package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.js +84 -0
  222. package/dist/service/cloudformation/watch/sim-cfn-template-watch-update.js.map +1 -0
  223. package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.d.ts +58 -0
  224. package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.d.ts.map +1 -0
  225. package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.js +2 -0
  226. package/dist/service/cloudformation/watch/sim-cfn-template-watch.type.js.map +1 -0
  227. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-admin-create-user-config.d.ts +29 -0
  228. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-admin-create-user-config.d.ts.map +1 -0
  229. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-admin-create-user-config.js +47 -0
  230. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-admin-create-user-config.js.map +1 -0
  231. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.d.ts.map +1 -1
  232. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.js +26 -8
  233. package/dist/service/cognito/cfn/user-pool/sim-cfn-cognito-user-pool-properties.js.map +1 -1
  234. package/dist/service/cognito/command/auth/sim-cognito-admin-initiate-auth.d.ts +1 -1
  235. package/dist/service/cognito/command/auth/sim-cognito-admin-initiate-auth.d.ts.map +1 -1
  236. package/dist/service/cognito/command/auth/sim-cognito-admin-initiate-auth.js +3 -2
  237. package/dist/service/cognito/command/auth/sim-cognito-admin-initiate-auth.js.map +1 -1
  238. package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.d.ts +1 -1
  239. package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.d.ts.map +1 -1
  240. package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.js +3 -2
  241. package/dist/service/cognito/command/auth/sim-cognito-admin-respond-to-challenge.js.map +1 -1
  242. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.d.ts +11 -4
  243. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.d.ts.map +1 -1
  244. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.js +11 -8
  245. package/dist/service/cognito/command/auth/sim-cognito-auth-commands.js.map +1 -1
  246. package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.d.ts +5 -1
  247. package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.d.ts.map +1 -1
  248. package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.js +7 -3
  249. package/dist/service/cognito/command/auth/sim-cognito-auth-flow-runner.js.map +1 -1
  250. package/dist/service/cognito/command/auth/sim-cognito-initiate-auth.d.ts +1 -1
  251. package/dist/service/cognito/command/auth/sim-cognito-initiate-auth.d.ts.map +1 -1
  252. package/dist/service/cognito/command/auth/sim-cognito-initiate-auth.js +3 -2
  253. package/dist/service/cognito/command/auth/sim-cognito-initiate-auth.js.map +1 -1
  254. package/dist/service/cognito/command/auth/sim-cognito-new-password-response.d.ts +11 -1
  255. package/dist/service/cognito/command/auth/sim-cognito-new-password-response.d.ts.map +1 -1
  256. package/dist/service/cognito/command/auth/sim-cognito-new-password-response.js +30 -4
  257. package/dist/service/cognito/command/auth/sim-cognito-new-password-response.js.map +1 -1
  258. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.d.ts +19 -1
  259. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.d.ts.map +1 -1
  260. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js +40 -5
  261. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js.map +1 -1
  262. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.d.ts +5 -1
  263. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.d.ts.map +1 -1
  264. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.js +15 -2
  265. package/dist/service/cognito/command/auth/sim-cognito-refresh-sign-in.js.map +1 -1
  266. package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.d.ts +1 -1
  267. package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.d.ts.map +1 -1
  268. package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.js +3 -2
  269. package/dist/service/cognito/command/auth/sim-cognito-respond-to-challenge.js.map +1 -1
  270. package/dist/service/cognito/command/auth/sim-cognito-unsimulated-auth-options.d.ts +5 -0
  271. package/dist/service/cognito/command/auth/sim-cognito-unsimulated-auth-options.d.ts.map +1 -1
  272. package/dist/service/cognito/command/auth/sim-cognito-unsimulated-auth-options.js +5 -1
  273. package/dist/service/cognito/command/auth/sim-cognito-unsimulated-auth-options.js.map +1 -1
  274. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.d.ts +6 -4
  275. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.d.ts.map +1 -1
  276. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.js +9 -4
  277. package/dist/service/cognito/command/client/sim-cognito-unsimulated-client-options.js.map +1 -1
  278. package/dist/service/cognito/command/client/sim-cognito-unsimulated-managed-login.d.ts +3 -2
  279. package/dist/service/cognito/command/client/sim-cognito-unsimulated-managed-login.d.ts.map +1 -1
  280. package/dist/service/cognito/command/client/sim-cognito-unsimulated-managed-login.js +6 -6
  281. package/dist/service/cognito/command/client/sim-cognito-unsimulated-managed-login.js.map +1 -1
  282. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-commands.d.ts +23 -3
  283. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-commands.d.ts.map +1 -1
  284. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-commands.js +35 -8
  285. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-commands.js.map +1 -1
  286. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.d.ts +2 -2
  287. package/dist/service/cognito/command/client/sim-cognito-user-pool-client-view.js +2 -2
  288. package/dist/service/cognito/command/client/user-pool-client.command.d.ts +37 -5
  289. package/dist/service/cognito/command/client/user-pool-client.command.d.ts.map +1 -1
  290. package/dist/service/cognito/command/sim-cognito-command.types.d.ts +3 -2
  291. package/dist/service/cognito/command/sim-cognito-command.types.d.ts.map +1 -1
  292. package/dist/service/cognito/command/sim-cognito-commands.d.ts +4 -0
  293. package/dist/service/cognito/command/sim-cognito-commands.d.ts.map +1 -1
  294. package/dist/service/cognito/command/sim-cognito-commands.js +33 -3
  295. package/dist/service/cognito/command/sim-cognito-commands.js.map +1 -1
  296. package/dist/service/cognito/command/sim-cognito-unsimulated-input.d.ts +5 -1
  297. package/dist/service/cognito/command/sim-cognito-unsimulated-input.d.ts.map +1 -1
  298. package/dist/service/cognito/command/sim-cognito-unsimulated-input.js +4 -0
  299. package/dist/service/cognito/command/sim-cognito-unsimulated-input.js.map +1 -1
  300. package/dist/service/cognito/command/sim-cognito-validation-data.d.ts +14 -0
  301. package/dist/service/cognito/command/sim-cognito-validation-data.d.ts.map +1 -0
  302. package/dist/service/cognito/command/sim-cognito-validation-data.js +29 -0
  303. package/dist/service/cognito/command/sim-cognito-validation-data.js.map +1 -0
  304. package/dist/service/cognito/command/user/sign-up.command.d.ts +104 -0
  305. package/dist/service/cognito/command/user/sign-up.command.d.ts.map +1 -0
  306. package/dist/service/cognito/command/user/sign-up.command.js +2 -0
  307. package/dist/service/cognito/command/user/sign-up.command.js.map +1 -0
  308. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.d.ts +104 -0
  309. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.d.ts.map +1 -0
  310. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js +186 -0
  311. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js.map +1 -0
  312. package/dist/service/cognito/command/user/sim-cognito-unsimulated-sign-up-options.d.ts +38 -0
  313. package/dist/service/cognito/command/user/sim-cognito-unsimulated-sign-up-options.d.ts.map +1 -0
  314. package/dist/service/cognito/command/user/sim-cognito-unsimulated-sign-up-options.js +49 -0
  315. package/dist/service/cognito/command/user/sim-cognito-unsimulated-sign-up-options.js.map +1 -0
  316. package/dist/service/cognito/command/user/sim-cognito-unsimulated-user-options.d.ts +15 -5
  317. package/dist/service/cognito/command/user/sim-cognito-unsimulated-user-options.d.ts.map +1 -1
  318. package/dist/service/cognito/command/user/sim-cognito-unsimulated-user-options.js +17 -9
  319. package/dist/service/cognito/command/user/sim-cognito-unsimulated-user-options.js.map +1 -1
  320. package/dist/service/cognito/command/user/sim-cognito-user-commands.d.ts +25 -12
  321. package/dist/service/cognito/command/user/sim-cognito-user-commands.d.ts.map +1 -1
  322. package/dist/service/cognito/command/user/sim-cognito-user-commands.js +42 -19
  323. package/dist/service/cognito/command/user/sim-cognito-user-commands.js.map +1 -1
  324. package/dist/service/cognito/command/user/sim-cognito-user-update-commands.d.ts.map +1 -1
  325. package/dist/service/cognito/command/user/sim-cognito-user-update-commands.js +1 -1
  326. package/dist/service/cognito/command/user/sim-cognito-user-update-commands.js.map +1 -1
  327. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.d.ts +16 -5
  328. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.d.ts.map +1 -1
  329. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.js +21 -24
  330. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-features.js.map +1 -1
  331. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-identity.d.ts +28 -0
  332. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-identity.d.ts.map +1 -0
  333. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-identity.js +42 -0
  334. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-identity.js.map +1 -0
  335. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-messaging.d.ts +21 -12
  336. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-messaging.d.ts.map +1 -1
  337. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-messaging.js +28 -36
  338. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-messaging.js.map +1 -1
  339. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-options.d.ts +8 -14
  340. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-options.d.ts.map +1 -1
  341. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-options.js +13 -25
  342. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-options.js.map +1 -1
  343. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-updates.d.ts +21 -0
  344. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-updates.d.ts.map +1 -0
  345. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-updates.js +25 -0
  346. package/dist/service/cognito/command/user-pool/sim-cognito-unsimulated-pool-updates.js.map +1 -0
  347. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-commands.d.ts +17 -2
  348. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-commands.d.ts.map +1 -1
  349. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-commands.js +35 -10
  350. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-commands.js.map +1 -1
  351. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.d.ts +10 -2
  352. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.d.ts.map +1 -1
  353. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.js +17 -5
  354. package/dist/service/cognito/command/user-pool/sim-cognito-user-pool-view.js.map +1 -1
  355. package/dist/service/cognito/command/user-pool/user-pool.command.d.ts +56 -23
  356. package/dist/service/cognito/command/user-pool/user-pool.command.d.ts.map +1 -1
  357. package/dist/service/cognito/error/sim-cognito-trigger.error.d.ts +39 -0
  358. package/dist/service/cognito/error/sim-cognito-trigger.error.d.ts.map +1 -0
  359. package/dist/service/cognito/error/sim-cognito-trigger.error.js +45 -0
  360. package/dist/service/cognito/error/sim-cognito-trigger.error.js.map +1 -0
  361. package/dist/service/cognito/error/sim-cognito.error.d.ts +22 -0
  362. package/dist/service/cognito/error/sim-cognito.error.d.ts.map +1 -1
  363. package/dist/service/cognito/error/sim-cognito.error.js +26 -0
  364. package/dist/service/cognito/error/sim-cognito.error.js.map +1 -1
  365. package/dist/service/cognito/index.d.ts +8 -1
  366. package/dist/service/cognito/index.d.ts.map +1 -1
  367. package/dist/service/cognito/index.js +7 -1
  368. package/dist/service/cognito/index.js.map +1 -1
  369. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts +6 -0
  370. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts.map +1 -1
  371. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js +22 -0
  372. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js.map +1 -1
  373. package/dist/service/cognito/sdk/sim-cognito-sdk-pool-routes.d.ts.map +1 -1
  374. package/dist/service/cognito/sdk/sim-cognito-sdk-pool-routes.js +8 -0
  375. package/dist/service/cognito/sdk/sim-cognito-sdk-pool-routes.js.map +1 -1
  376. package/dist/service/cognito/serve/sim-cognito-controller.d.ts +10 -1
  377. package/dist/service/cognito/serve/sim-cognito-controller.d.ts.map +1 -1
  378. package/dist/service/cognito/serve/sim-cognito-controller.js +48 -8
  379. package/dist/service/cognito/serve/sim-cognito-controller.js.map +1 -1
  380. package/dist/service/cognito/serve/sim-cognito-endpoint-response.d.ts +1 -1
  381. package/dist/service/cognito/serve/sim-cognito-endpoint-response.d.ts.map +1 -1
  382. package/dist/service/cognito/serve/sim-cognito-endpoint-response.js +3 -2
  383. package/dist/service/cognito/serve/sim-cognito-endpoint-response.js.map +1 -1
  384. package/dist/service/cognito/sim-cognito-identity-provider.d.ts +20 -0
  385. package/dist/service/cognito/sim-cognito-identity-provider.d.ts.map +1 -1
  386. package/dist/service/cognito/sim-cognito-identity-provider.js +17 -1
  387. package/dist/service/cognito/sim-cognito-identity-provider.js.map +1 -1
  388. package/dist/service/cognito/sim-cognito-user-directory.d.ts +16 -0
  389. package/dist/service/cognito/sim-cognito-user-directory.d.ts.map +1 -1
  390. package/dist/service/cognito/sim-cognito-user-directory.js +28 -0
  391. package/dist/service/cognito/sim-cognito-user-directory.js.map +1 -1
  392. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts +9 -0
  393. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts.map +1 -1
  394. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js +14 -1
  395. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js.map +1 -1
  396. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-factory.d.ts +2 -11
  397. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-factory.d.ts.map +1 -1
  398. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-factory.js +2 -14
  399. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-factory.js.map +1 -1
  400. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.d.ts +38 -0
  401. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.d.ts.map +1 -0
  402. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.js +36 -0
  403. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client-settings.js.map +1 -0
  404. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.d.ts +40 -20
  405. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.d.ts.map +1 -1
  406. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.js +54 -20
  407. package/dist/service/cognito/user-pool/client/sim-cognito-user-pool-client.js.map +1 -1
  408. package/dist/service/cognito/user-pool/message/sim-cognito-message-delivery.d.ts +32 -0
  409. package/dist/service/cognito/user-pool/message/sim-cognito-message-delivery.d.ts.map +1 -0
  410. package/dist/service/cognito/user-pool/message/sim-cognito-message-delivery.js +52 -0
  411. package/dist/service/cognito/user-pool/message/sim-cognito-message-delivery.js.map +1 -0
  412. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts +13 -0
  413. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts.map +1 -0
  414. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.js +2 -0
  415. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.js.map +1 -0
  416. package/dist/service/cognito/user-pool/message/sim-cognito-message-placeholders.d.ts +49 -0
  417. package/dist/service/cognito/user-pool/message/sim-cognito-message-placeholders.d.ts.map +1 -0
  418. package/dist/service/cognito/user-pool/message/sim-cognito-message-placeholders.js +58 -0
  419. package/dist/service/cognito/user-pool/message/sim-cognito-message-placeholders.js.map +1 -0
  420. package/dist/service/cognito/user-pool/message/sim-cognito-message-wording.d.ts +41 -0
  421. package/dist/service/cognito/user-pool/message/sim-cognito-message-wording.d.ts.map +1 -0
  422. package/dist/service/cognito/user-pool/message/sim-cognito-message-wording.js +39 -0
  423. package/dist/service/cognito/user-pool/message/sim-cognito-message-wording.js.map +1 -0
  424. package/dist/service/cognito/user-pool/message/sim-cognito-occasion-wording.d.ts +13 -0
  425. package/dist/service/cognito/user-pool/message/sim-cognito-occasion-wording.d.ts.map +1 -0
  426. package/dist/service/cognito/user-pool/message/sim-cognito-occasion-wording.js +32 -0
  427. package/dist/service/cognito/user-pool/message/sim-cognito-occasion-wording.js.map +1 -0
  428. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts +53 -0
  429. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts.map +1 -0
  430. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js +62 -0
  431. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js.map +1 -0
  432. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message-store.d.ts +19 -0
  433. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message-store.d.ts.map +1 -0
  434. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message-store.js +22 -0
  435. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message-store.js.map +1 -0
  436. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message.d.ts +65 -0
  437. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message.d.ts.map +1 -0
  438. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message.js +52 -0
  439. package/dist/service/cognito/user-pool/message/sim-cognito-sent-message.js.map +1 -0
  440. package/dist/service/cognito/user-pool/message/sim-cognito-verification-messages.d.ts +68 -0
  441. package/dist/service/cognito/user-pool/message/sim-cognito-verification-messages.d.ts.map +1 -0
  442. package/dist/service/cognito/user-pool/message/sim-cognito-verification-messages.js +91 -0
  443. package/dist/service/cognito/user-pool/message/sim-cognito-verification-messages.js.map +1 -0
  444. package/dist/service/cognito/user-pool/message/sim-cognito-verification-wording.d.ts +18 -0
  445. package/dist/service/cognito/user-pool/message/sim-cognito-verification-wording.d.ts.map +1 -0
  446. package/dist/service/cognito/user-pool/message/sim-cognito-verification-wording.js +31 -0
  447. package/dist/service/cognito/user-pool/message/sim-cognito-verification-wording.js.map +1 -0
  448. package/dist/service/cognito/user-pool/sim-cognito-admin-create-user-config.d.ts +41 -0
  449. package/dist/service/cognito/user-pool/sim-cognito-admin-create-user-config.d.ts.map +1 -0
  450. package/dist/service/cognito/user-pool/sim-cognito-admin-create-user-config.js +41 -0
  451. package/dist/service/cognito/user-pool/sim-cognito-admin-create-user-config.js.map +1 -0
  452. package/dist/service/cognito/user-pool/sim-cognito-auto-verified-attributes.d.ts +35 -0
  453. package/dist/service/cognito/user-pool/sim-cognito-auto-verified-attributes.d.ts.map +1 -0
  454. package/dist/service/cognito/user-pool/sim-cognito-auto-verified-attributes.js +60 -0
  455. package/dist/service/cognito/user-pool/sim-cognito-auto-verified-attributes.js.map +1 -0
  456. package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.d.ts +10 -15
  457. package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.d.ts.map +1 -1
  458. package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.js +10 -25
  459. package/dist/service/cognito/user-pool/sim-cognito-unsimulated-pool-settings.js.map +1 -1
  460. package/dist/service/cognito/user-pool/sim-cognito-user-pool-arn.d.ts +8 -0
  461. package/dist/service/cognito/user-pool/sim-cognito-user-pool-arn.d.ts.map +1 -1
  462. package/dist/service/cognito/user-pool/sim-cognito-user-pool-arn.js +9 -0
  463. package/dist/service/cognito/user-pool/sim-cognito-user-pool-arn.js.map +1 -1
  464. package/dist/service/cognito/user-pool/sim-cognito-user-pool-factory.d.ts +3 -7
  465. package/dist/service/cognito/user-pool/sim-cognito-user-pool-factory.d.ts.map +1 -1
  466. package/dist/service/cognito/user-pool/sim-cognito-user-pool-factory.js +6 -7
  467. package/dist/service/cognito/user-pool/sim-cognito-user-pool-factory.js.map +1 -1
  468. package/dist/service/cognito/user-pool/sim-cognito-user-pool-id.d.ts +24 -0
  469. package/dist/service/cognito/user-pool/sim-cognito-user-pool-id.d.ts.map +1 -1
  470. package/dist/service/cognito/user-pool/sim-cognito-user-pool-id.js +32 -0
  471. package/dist/service/cognito/user-pool/sim-cognito-user-pool-id.js.map +1 -1
  472. package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.d.ts +65 -0
  473. package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.d.ts.map +1 -0
  474. package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.js +52 -0
  475. package/dist/service/cognito/user-pool/sim-cognito-user-pool-settings.js.map +1 -0
  476. package/dist/service/cognito/user-pool/sim-cognito-user-pool.d.ts +41 -28
  477. package/dist/service/cognito/user-pool/sim-cognito-user-pool.d.ts.map +1 -1
  478. package/dist/service/cognito/user-pool/sim-cognito-user-pool.js +55 -27
  479. package/dist/service/cognito/user-pool/sim-cognito-user-pool.js.map +1 -1
  480. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-reader.d.ts +29 -0
  481. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-reader.d.ts.map +1 -0
  482. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-reader.js +80 -0
  483. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-reader.js.map +1 -0
  484. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-values.d.ts +21 -0
  485. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-values.d.ts.map +1 -0
  486. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-values.js +45 -0
  487. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override-values.js.map +1 -0
  488. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override.d.ts +54 -0
  489. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override.d.ts.map +1 -0
  490. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override.js +72 -0
  491. package/dist/service/cognito/user-pool/token/sim-cognito-claims-override.js.map +1 -0
  492. package/dist/service/cognito/user-pool/token/sim-cognito-group-override.d.ts +10 -0
  493. package/dist/service/cognito/user-pool/token/sim-cognito-group-override.d.ts.map +1 -0
  494. package/dist/service/cognito/user-pool/token/sim-cognito-group-override.js +54 -0
  495. package/dist/service/cognito/user-pool/token/sim-cognito-group-override.js.map +1 -0
  496. package/dist/service/cognito/user-pool/token/sim-cognito-reserved-claims.d.ts +23 -0
  497. package/dist/service/cognito/user-pool/token/sim-cognito-reserved-claims.d.ts.map +1 -0
  498. package/dist/service/cognito/user-pool/token/sim-cognito-reserved-claims.js +82 -0
  499. package/dist/service/cognito/user-pool/token/sim-cognito-reserved-claims.js.map +1 -0
  500. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.d.ts +26 -2
  501. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.d.ts.map +1 -1
  502. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.js +32 -7
  503. package/dist/service/cognito/user-pool/token/sim-cognito-token-issuer.js.map +1 -1
  504. package/dist/service/cognito/user-pool/trigger/sim-aws-cognito-trigger-functions.d.ts +55 -0
  505. package/dist/service/cognito/user-pool/trigger/sim-aws-cognito-trigger-functions.d.ts.map +1 -0
  506. package/dist/service/cognito/user-pool/trigger/sim-aws-cognito-trigger-functions.js +101 -0
  507. package/dist/service/cognito/user-pool/trigger/sim-aws-cognito-trigger-functions.js.map +1 -0
  508. package/dist/service/cognito/user-pool/trigger/sim-cognito-custom-message.d.ts +31 -0
  509. package/dist/service/cognito/user-pool/trigger/sim-cognito-custom-message.d.ts.map +1 -0
  510. package/dist/service/cognito/user-pool/trigger/sim-cognito-custom-message.js +73 -0
  511. package/dist/service/cognito/user-pool/trigger/sim-cognito-custom-message.js.map +1 -0
  512. package/dist/service/cognito/user-pool/trigger/sim-cognito-lambda-config.d.ts +58 -0
  513. package/dist/service/cognito/user-pool/trigger/sim-cognito-lambda-config.d.ts.map +1 -0
  514. package/dist/service/cognito/user-pool/trigger/sim-cognito-lambda-config.js +77 -0
  515. package/dist/service/cognito/user-pool/trigger/sim-cognito-lambda-config.js.map +1 -0
  516. package/dist/service/cognito/user-pool/trigger/sim-cognito-pre-sign-up-response.d.ts +28 -0
  517. package/dist/service/cognito/user-pool/trigger/sim-cognito-pre-sign-up-response.d.ts.map +1 -0
  518. package/dist/service/cognito/user-pool/trigger/sim-cognito-pre-sign-up-response.js +68 -0
  519. package/dist/service/cognito/user-pool/trigger/sim-cognito-pre-sign-up-response.js.map +1 -0
  520. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-context.d.ts +36 -0
  521. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-context.d.ts.map +1 -0
  522. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-context.js +2 -0
  523. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-context.js.map +1 -0
  524. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-event.d.ts +27 -0
  525. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-event.d.ts.map +1 -0
  526. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-event.js +69 -0
  527. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-event.js.map +1 -0
  528. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-functions.d.ts +59 -0
  529. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-functions.d.ts.map +1 -0
  530. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-functions.js +25 -0
  531. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-functions.js.map +1 -0
  532. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-invocation.d.ts +33 -0
  533. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-invocation.d.ts.map +1 -0
  534. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-invocation.js +61 -0
  535. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-invocation.js.map +1 -0
  536. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.d.ts +20 -0
  537. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.d.ts.map +1 -0
  538. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.js +46 -0
  539. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-name.js.map +1 -0
  540. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts +89 -0
  541. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts.map +1 -0
  542. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js +102 -0
  543. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js.map +1 -0
  544. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-request.d.ts +75 -0
  545. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-request.d.ts.map +1 -0
  546. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-request.js +162 -0
  547. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-request.js.map +1 -0
  548. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-response.d.ts +19 -0
  549. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-response.d.ts.map +1 -0
  550. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-response.js +38 -0
  551. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-response.js.map +1 -0
  552. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts +81 -0
  553. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts.map +1 -0
  554. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js +90 -0
  555. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js.map +1 -0
  556. package/dist/service/cognito/user-pool/user/sim-cognito-confirmation-code.d.ts +29 -0
  557. package/dist/service/cognito/user-pool/user/sim-cognito-confirmation-code.d.ts.map +1 -0
  558. package/dist/service/cognito/user-pool/user/sim-cognito-confirmation-code.js +40 -0
  559. package/dist/service/cognito/user-pool/user/sim-cognito-confirmation-code.js.map +1 -0
  560. package/dist/service/cognito/user-pool/user/sim-cognito-user-attributes.d.ts +8 -0
  561. package/dist/service/cognito/user-pool/user/sim-cognito-user-attributes.d.ts.map +1 -1
  562. package/dist/service/cognito/user-pool/user/sim-cognito-user-attributes.js +12 -0
  563. package/dist/service/cognito/user-pool/user/sim-cognito-user-attributes.js.map +1 -1
  564. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts +36 -0
  565. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts.map +1 -0
  566. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js +51 -0
  567. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js.map +1 -0
  568. package/dist/service/cognito/user-pool/user/sim-cognito-user-factory.d.ts +31 -2
  569. package/dist/service/cognito/user-pool/user/sim-cognito-user-factory.d.ts.map +1 -1
  570. package/dist/service/cognito/user-pool/user/sim-cognito-user-factory.js +31 -4
  571. package/dist/service/cognito/user-pool/user/sim-cognito-user-factory.js.map +1 -1
  572. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts +39 -8
  573. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts.map +1 -1
  574. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js +50 -7
  575. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js.map +1 -1
  576. package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts +55 -3
  577. package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts.map +1 -1
  578. package/dist/service/cognito/user-pool/user/sim-cognito-user.js +74 -5
  579. package/dist/service/cognito/user-pool/user/sim-cognito-user.js.map +1 -1
  580. package/dist/service/lambda/function/invoke/sim-lambda-handler-runner.d.ts.map +1 -1
  581. package/dist/service/lambda/function/invoke/sim-lambda-handler-runner.js +22 -1
  582. package/dist/service/lambda/function/invoke/sim-lambda-handler-runner.js.map +1 -1
  583. package/dist/service/lambda/function/sim-lambda-function-arn-parts.d.ts +30 -0
  584. package/dist/service/lambda/function/sim-lambda-function-arn-parts.d.ts.map +1 -0
  585. package/dist/service/lambda/function/sim-lambda-function-arn-parts.js +32 -0
  586. package/dist/service/lambda/function/sim-lambda-function-arn-parts.js.map +1 -0
  587. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-set-builder.d.ts +5 -0
  588. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-set-builder.d.ts.map +1 -1
  589. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-set-builder.js +13 -3
  590. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-set-builder.js.map +1 -1
  591. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-type-skip.d.ts +26 -0
  592. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-type-skip.d.ts.map +1 -0
  593. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-type-skip.js +36 -0
  594. package/dist/service/route53/cfn/record-set/build/sim-cfn-r53-record-type-skip.js.map +1 -0
  595. package/dist/service/route53/dns/answer/dns-answerer-test-query.d.ts +6 -3
  596. package/dist/service/route53/dns/answer/dns-answerer-test-query.d.ts.map +1 -1
  597. package/dist/service/route53/dns/answer/dns-answerer-test-query.js +5 -2
  598. package/dist/service/route53/dns/answer/dns-answerer-test-query.js.map +1 -1
  599. package/dist/service/route53/dns/answer/sim-route53-dns-record-answer.d.ts.map +1 -1
  600. package/dist/service/route53/dns/answer/sim-route53-dns-record-answer.js +9 -3
  601. package/dist/service/route53/dns/answer/sim-route53-dns-record-answer.js.map +1 -1
  602. package/dist/service/route53/dns/dns-record-type.d.ts +24 -7
  603. package/dist/service/route53/dns/dns-record-type.d.ts.map +1 -1
  604. package/dist/service/route53/dns/dns-record-type.js +16 -7
  605. package/dist/service/route53/dns/dns-record-type.js.map +1 -1
  606. package/dist/service/route53/dns/rdata/dns-rdata.d.ts +2 -2
  607. package/dist/service/route53/dns/rdata/dns-rdata.d.ts.map +1 -1
  608. package/dist/service/route53/dns/rdata/dns-rdata.js.map +1 -1
  609. package/dist/service/route53/hosted-zone/register-sim-route53-hosted-zone.d.ts +34 -0
  610. package/dist/service/route53/hosted-zone/register-sim-route53-hosted-zone.d.ts.map +1 -0
  611. package/dist/service/route53/hosted-zone/register-sim-route53-hosted-zone.js +35 -0
  612. package/dist/service/route53/hosted-zone/register-sim-route53-hosted-zone.js.map +1 -0
  613. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone-records.d.ts.map +1 -1
  614. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone-records.js +2 -4
  615. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone-records.js.map +1 -1
  616. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone.d.ts +7 -0
  617. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone.d.ts.map +1 -1
  618. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone.js +10 -1
  619. package/dist/service/route53/hosted-zone/sim-route53-hosted-zone.js.map +1 -1
  620. package/dist/service/route53/index.d.ts +1 -0
  621. package/dist/service/route53/index.d.ts.map +1 -1
  622. package/dist/service/route53/index.js +1 -0
  623. package/dist/service/route53/index.js.map +1 -1
  624. package/dist/service/route53/record/sim-route53-record-type.d.ts +1 -1
  625. package/dist/service/route53/record/sim-route53-record-type.d.ts.map +1 -1
  626. package/dist/service/route53/record/sim-route53-record-type.js +3 -2
  627. package/dist/service/route53/record/sim-route53-record-type.js.map +1 -1
  628. package/dist/service/route53/record/sim-route53-record-value.d.ts +9 -0
  629. package/dist/service/route53/record/sim-route53-record-value.d.ts.map +1 -0
  630. package/dist/service/route53/record/sim-route53-record-value.js +26 -0
  631. package/dist/service/route53/record/sim-route53-record-value.js.map +1 -0
  632. package/dist/service/route53/record/sim-route53-record.d.ts +15 -1
  633. package/dist/service/route53/record/sim-route53-record.d.ts.map +1 -1
  634. package/dist/service/route53/record/sim-route53-record.js +21 -1
  635. package/dist/service/route53/record/sim-route53-record.js.map +1 -1
  636. package/dist/service/route53/sim-route53.d.ts +14 -0
  637. package/dist/service/route53/sim-route53.d.ts.map +1 -1
  638. package/dist/service/route53/sim-route53.js +19 -0
  639. package/dist/service/route53/sim-route53.js.map +1 -1
  640. package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts +17 -1
  641. package/dist/service/s3/bucket/sim-s3-bucket-access.d.ts.map +1 -1
  642. package/dist/service/s3/bucket/sim-s3-bucket-access.js +22 -1
  643. package/dist/service/s3/bucket/sim-s3-bucket-access.js.map +1 -1
  644. package/dist/service/s3/index.d.ts +1 -0
  645. package/dist/service/s3/index.d.ts.map +1 -1
  646. package/dist/service/s3/mount/sim-s3-mount-directory-events.d.ts +40 -0
  647. package/dist/service/s3/mount/sim-s3-mount-directory-events.d.ts.map +1 -0
  648. package/dist/service/s3/mount/sim-s3-mount-directory-events.js +64 -0
  649. package/dist/service/s3/mount/sim-s3-mount-directory-events.js.map +1 -0
  650. package/dist/service/s3/mount/sim-s3-mount-watch.d.ts +36 -0
  651. package/dist/service/s3/mount/sim-s3-mount-watch.d.ts.map +1 -0
  652. package/dist/service/s3/mount/sim-s3-mount-watch.js +57 -0
  653. package/dist/service/s3/mount/sim-s3-mount-watch.js.map +1 -0
  654. package/dist/service/s3/mount/sim-s3-mount-watches.d.ts +42 -0
  655. package/dist/service/s3/mount/sim-s3-mount-watches.d.ts.map +1 -0
  656. package/dist/service/s3/mount/sim-s3-mount-watches.js +69 -0
  657. package/dist/service/s3/mount/sim-s3-mount-watches.js.map +1 -0
  658. package/dist/service/s3/mount/sim-s3-mount.type.d.ts +31 -0
  659. package/dist/service/s3/mount/sim-s3-mount.type.d.ts.map +1 -0
  660. package/dist/service/s3/mount/sim-s3-mount.type.js +2 -0
  661. package/dist/service/s3/mount/sim-s3-mount.type.js.map +1 -0
  662. package/dist/service/s3/notification/destination/lambda/sim-s3-notification-function-arn.d.ts +3 -3
  663. package/dist/service/s3/notification/destination/lambda/sim-s3-notification-function-arn.d.ts.map +1 -1
  664. package/dist/service/s3/notification/destination/lambda/sim-s3-notification-function-arn.js +8 -14
  665. package/dist/service/s3/notification/destination/lambda/sim-s3-notification-function-arn.js.map +1 -1
  666. package/dist/service/s3/sim-s3.d.ts +49 -64
  667. package/dist/service/s3/sim-s3.d.ts.map +1 -1
  668. package/dist/service/s3/sim-s3.js +56 -66
  669. package/dist/service/s3/sim-s3.js.map +1 -1
  670. package/dist/util/filesystem/path.d.ts +4 -0
  671. package/dist/util/filesystem/path.d.ts.map +1 -1
  672. package/dist/util/filesystem/path.js +8 -3
  673. package/dist/util/filesystem/path.js.map +1 -1
  674. package/dist/util/memo/memo.d.ts +8 -0
  675. package/dist/util/memo/memo.d.ts.map +1 -1
  676. package/dist/util/memo/memo.js +10 -0
  677. package/dist/util/memo/memo.js.map +1 -1
  678. package/dist/util/process/close-on-signal.d.ts +16 -0
  679. package/dist/util/process/close-on-signal.d.ts.map +1 -0
  680. package/dist/util/process/close-on-signal.js +54 -0
  681. package/dist/util/process/close-on-signal.js.map +1 -0
  682. package/dist/watch/index.d.ts +3 -0
  683. package/dist/watch/index.d.ts.map +1 -0
  684. package/dist/watch/index.js +2 -0
  685. package/dist/watch/index.js.map +1 -0
  686. package/dist/watch/sim-watch-runtime.d.ts +76 -0
  687. package/dist/watch/sim-watch-runtime.d.ts.map +1 -0
  688. package/dist/watch/sim-watch-runtime.js +124 -0
  689. package/dist/watch/sim-watch-runtime.js.map +1 -0
  690. package/dist/watch/sim-watch-settle.d.ts +45 -0
  691. package/dist/watch/sim-watch-settle.d.ts.map +1 -0
  692. package/dist/watch/sim-watch-settle.js +65 -0
  693. package/dist/watch/sim-watch-settle.js.map +1 -0
  694. package/dist/watch/sim-watch.config.d.ts +23 -0
  695. package/dist/watch/sim-watch.config.d.ts.map +1 -0
  696. package/dist/watch/sim-watch.config.js +59 -0
  697. package/dist/watch/sim-watch.config.js.map +1 -0
  698. package/package.json +32 -24
package/README.md CHANGED
@@ -38,6 +38,7 @@ npm i -D @kensio/yulin
38
38
  ## Feature specific docs
39
39
 
40
40
  - [AWS SDK interception](./docs/sdk "Simulated AWS SDK docs")
41
+ - [Serving on localhost](./docs/serve "Serving simulated AWS on localhost docs")
41
42
  - [Simulated time](./docs/time "Simulated time docs")
42
43
 
43
44
  ## Usage
@@ -123,6 +124,17 @@ await simAws.account("111111111111").region("eu-west-2").dynamoDb().createTable(
123
124
  AWS state is simulated internally, so you can test realistic interactions with multiple AWS
124
125
  services.
125
126
 
127
+ An Account ID is a plain string wherever one is accepted. Code that wants to name the type can get a
128
+ `SimAwsAccountId` from `simAwsAccountId(...)`, which refuses anything that is not a 12-digit AWS
129
+ Account ID, or from `makeSimAwsAccountId()` when a test just needs an arbitrary one.
130
+
131
+ ```typescript
132
+ import { makeSimAwsAccountId, simAwsAccountId } from "@kensio/yulin";
133
+
134
+ const accountId = simAwsAccountId("111111111111");
135
+ const someOtherAccountId = makeSimAwsAccountId();
136
+ ```
137
+
126
138
  Each instance of `SimAws` is cheap and encapsulated so you can create them wherever you need them.
127
139
  It's fine to create a new instance of `SimAws` in every test case or in shared test setup.
128
140
 
@@ -185,6 +197,77 @@ console.log(bucketWebsiteUrl.toString());
185
197
  const res = await fetch(new URL("/foo/", bucketWebsiteUrl));
186
198
  ```
187
199
 
200
+ #### Restarting a served environment
201
+
202
+ A served environment takes an available port by default, so the URL changes every time the process
203
+ starts. Pin a port to keep the URL the same across restarts:
204
+
205
+ ```typescript
206
+ const srv = await serveSimAws({ simAws, port: 4599 });
207
+ ```
208
+
209
+ Closing the server ends the connections it is holding, so the process can exit rather than being
210
+ kept alive by a browser tab. Yulin does not install signal handlers, so call `close()` from your
211
+ own:
212
+
213
+ ```typescript
214
+ process.on("SIGTERM", () => {
215
+ srv.close();
216
+ });
217
+ ```
218
+
219
+ A restart usually overlaps the process it is replacing. `listen` waits a couple of seconds for a
220
+ pinned port that is still held, then throws `SimAwsLocalPortInUse` naming the port, which means
221
+ something other than the outgoing process owns it.
222
+
223
+ #### Reload the browser on a restart
224
+
225
+ Yulin is the only thing in the response path of a page it serves, so it can tell the browser to
226
+ reload. Turning `liveReload` on puts a small script into the HTML pages served to browsers, and the
227
+ page reloads itself when the process restarts:
228
+
229
+ ```typescript
230
+ const srv = await serveSimAws({ simAws, port: 4599, liveReload: true });
231
+ ```
232
+
233
+ `srv.reload()` reloads connected browsers for a change that needs no restart. Live reload is off by
234
+ default, since an injected page is not byte for byte what the real service returns.
235
+
236
+ Run the dev script through `yulin watch` and a save is the whole loop, with the process restarted and
237
+ the page refreshed:
238
+
239
+ ```bash
240
+ yulin watch -- tsx dev.ts
241
+ ```
242
+
243
+ It watches the working directory, plus the paths Yulin is holding that a module graph never mentions:
244
+ a directory mounted into a Bucket, and a synthesized template. See the
245
+ [serving docs](./docs/serve "Serving simulated AWS on localhost docs") for what gets the script, what
246
+ is watched, and what is not.
247
+
248
+ #### Update a stack when its template changes
249
+
250
+ A synthesized template is data rather than code, so a change to one does not need the process
251
+ restarted. Deploy it with `watch` and Yulin applies the file again whenever it changes, updating the
252
+ stack in place:
253
+
254
+ ```typescript
255
+ await simAws.cloudFormation().deployTemplateFile({
256
+ templatePath: "cdk.out/SiteStack.template.json",
257
+ watch: {
258
+ onUpdated: () => {
259
+ srv.reload();
260
+ },
261
+ },
262
+ });
263
+ ```
264
+
265
+ Resources the change left alone keep what they hold, so simulated S3, DynamoDB and SQS survive a
266
+ `cdk synth`. Under `yulin watch` the template is left to the process watching it rather than being a
267
+ reason to restart. See the
268
+ [CloudFormation docs](./docs/services/cloudformation "Simulated CloudFormation docs") for what an
269
+ update does to each resource.
270
+
188
271
  ### Control simulated time
189
272
 
190
273
  Each simulated AWS has its own clock, which you can freeze, set, or advance. This lets a test
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Thrown for a command the CLI does not have.
3
+ */
4
+ export declare class SimCliUnknownCommand extends Error {
5
+ readonly name = "SimCliUnknownCommand";
6
+ constructor(command: string);
7
+ }
8
+ /**
9
+ * The `yulin` command line.
10
+ *
11
+ * One command so far. It exists because a local dev loop needs a process
12
+ * outside the one being restarted, which is not something a library can be.
13
+ */
14
+ export declare class SimCli {
15
+ /**
16
+ * Run the CLI, and report the exit code it should leave behind.
17
+ */
18
+ run(argv: readonly string[]): Promise<number>;
19
+ }
20
+ //# sourceMappingURL=sim-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cli.d.ts","sourceRoot":"","sources":["../../src/cli/sim-cli.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,SAAyB,IAAI,0BAA0B;IAEvD,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF;AAED;;;;;GAKG;AACH,qBAAa,MAAM;IACjB;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBlD;CACF"}
@@ -0,0 +1,46 @@
1
+ import { SimWatchCommand } from "./watch/sim-watch-command.js";
2
+ const usage = `Usage: yulin <command>
3
+
4
+ Commands:
5
+ watch [options] -- <command> Run a command, and run it again when project files change
6
+
7
+ Watch options:
8
+ --inspect[=port] Run the command with an inspector, for a debugger to attach to
9
+ --settle=ms How long writes have to stop for before they count as one change
10
+ `;
11
+ /**
12
+ * Thrown for a command the CLI does not have.
13
+ */
14
+ export class SimCliUnknownCommand extends Error {
15
+ name = "SimCliUnknownCommand";
16
+ constructor(command) {
17
+ super(`Unknown command ${command}.\n\n${usage}`);
18
+ }
19
+ }
20
+ /**
21
+ * The `yulin` command line.
22
+ *
23
+ * One command so far. It exists because a local dev loop needs a process
24
+ * outside the one being restarted, which is not something a library can be.
25
+ */
26
+ export class SimCli {
27
+ /**
28
+ * Run the CLI, and report the exit code it should leave behind.
29
+ */
30
+ async run(argv) {
31
+ const [command, ...rest] = argv;
32
+ if (command === undefined) {
33
+ process.stdout.write(usage);
34
+ return 1;
35
+ }
36
+ if (["--help", "-h", "help"].includes(command)) {
37
+ process.stdout.write(usage);
38
+ return 0;
39
+ }
40
+ if (command !== "watch") {
41
+ throw new SimCliUnknownCommand(command);
42
+ }
43
+ return await new SimWatchCommand().run(rest);
44
+ }
45
+ }
46
+ //# sourceMappingURL=sim-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cli.js","sourceRoot":"","sources":["../../src/cli/sim-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,MAAM,KAAK,GAAG;;;;;;;;CAQb,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpB,IAAI,GAAG,sBAAsB,CAAC;IAEvD,YAAY,OAAe;QACzB,KAAK,CAAC,mBAAmB,OAAO,QAAQ,KAAK,EAAE,CAAC,CAAC;IACnD,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,MAAM;IACjB;;OAEG;IACH,KAAK,CAAC,GAAG,CAAC,IAAuB;QAC/B,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;QAEhC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,CAAC,CAAC;QACX,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC/C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC5B,OAAO,CAAC,CAAC;QACX,CAAC;QAED,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;YACxB,MAAM,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC1C,CAAC;QAED,OAAO,MAAM,IAAI,eAAe,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Thrown when `yulin watch` was not given something to run.
3
+ */
4
+ export declare class SimWatchUsageError extends Error {
5
+ readonly name = "SimWatchUsageError";
6
+ constructor(message: string);
7
+ }
8
+ /**
9
+ * What `yulin watch` was asked to do.
10
+ *
11
+ * Everything after `--` is the command, passed through untouched. The CLI does
12
+ * not import the command, look for an exported setup function, or care whether
13
+ * the simulation it builds came from SDK commands, a template, or several
14
+ * `SimAws` instances at once. It runs it and runs it again.
15
+ */
16
+ export declare class SimWatchArguments {
17
+ readonly command: string;
18
+ readonly commandArguments: readonly string[];
19
+ readonly inspect: string | undefined;
20
+ readonly settleMs: number | undefined;
21
+ private constructor();
22
+ /**
23
+ * Read the arguments given after `yulin watch`.
24
+ */
25
+ static parse(argv: readonly string[]): SimWatchArguments;
26
+ /**
27
+ * The command as it was written, for reporting.
28
+ */
29
+ describe(): string;
30
+ }
31
+ //# sourceMappingURL=sim-watch-arguments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-arguments.d.ts","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-arguments.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,SAAyB,IAAI,wBAAwB;IAErD,YAAY,OAAO,EAAE,MAAM,EAI1B;CACF;AAED;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAEtC,OAAO,eASN;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,iBAAiB,CAoBvD;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM,CAEjB;CACF"}
@@ -0,0 +1,95 @@
1
+ const inspectorFlags = new Set([
2
+ "--inspect",
3
+ "--inspect-brk",
4
+ "--inspect-wait",
5
+ ]);
6
+ const settleFlag = "--settle";
7
+ /**
8
+ * Thrown when `yulin watch` was not given something to run.
9
+ */
10
+ export class SimWatchUsageError extends Error {
11
+ name = "SimWatchUsageError";
12
+ constructor(message) {
13
+ super(`${message}\n\nUsage: yulin watch [--inspect[=port]] [--settle=ms] -- <command>`);
14
+ }
15
+ }
16
+ /**
17
+ * What `yulin watch` was asked to do.
18
+ *
19
+ * Everything after `--` is the command, passed through untouched. The CLI does
20
+ * not import the command, look for an exported setup function, or care whether
21
+ * the simulation it builds came from SDK commands, a template, or several
22
+ * `SimAws` instances at once. It runs it and runs it again.
23
+ */
24
+ export class SimWatchArguments {
25
+ command;
26
+ commandArguments;
27
+ inspect;
28
+ settleMs;
29
+ constructor(command, commandArguments, options) {
30
+ this.command = command;
31
+ this.commandArguments = commandArguments;
32
+ this.inspect = options.inspect;
33
+ this.settleMs = options.settleMs;
34
+ }
35
+ /**
36
+ * Read the arguments given after `yulin watch`.
37
+ */
38
+ static parse(argv) {
39
+ const separator = argv.indexOf("--");
40
+ if (separator === -1) {
41
+ throw new SimWatchUsageError("No command given. Put the command to run after --, so that its own options are not read as options to watch.");
42
+ }
43
+ const [command, ...rest] = argv.slice(separator + 1);
44
+ if (command === undefined) {
45
+ throw new SimWatchUsageError("No command given after --.");
46
+ }
47
+ return new SimWatchArguments(command, rest, optionsIn(argv.slice(0, separator)));
48
+ }
49
+ /**
50
+ * The command as it was written, for reporting.
51
+ */
52
+ describe() {
53
+ return [this.command, ...this.commandArguments].join(" ");
54
+ }
55
+ }
56
+ /**
57
+ * The options written before the separator, which are the only ones watch reads
58
+ * itself.
59
+ */
60
+ function optionsIn(given) {
61
+ let inspect;
62
+ let settleMs;
63
+ for (const option of given) {
64
+ const flag = flagOf(option);
65
+ if (inspectorFlags.has(flag)) {
66
+ inspect = option;
67
+ }
68
+ else if (flag === settleFlag) {
69
+ settleMs = settleValue(option);
70
+ }
71
+ else {
72
+ throw new SimWatchUsageError(`Unknown option ${option}.`);
73
+ }
74
+ }
75
+ return { inspect, settleMs };
76
+ }
77
+ /**
78
+ * How long a burst of writes has to go quiet, for a project whose build the
79
+ * default window does not suit.
80
+ */
81
+ function settleValue(option) {
82
+ const [, value] = option.split("=");
83
+ const milliseconds = Number(value);
84
+ if (value === undefined ||
85
+ !Number.isSafeInteger(milliseconds) ||
86
+ milliseconds < 1) {
87
+ throw new SimWatchUsageError(`${settleFlag} takes a number of milliseconds, written as ${settleFlag}=250.`);
88
+ }
89
+ return milliseconds;
90
+ }
91
+ function flagOf(option) {
92
+ const [flag = ""] = option.split("=");
93
+ return flag;
94
+ }
95
+ //# sourceMappingURL=sim-watch-arguments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-arguments.js","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-arguments.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,WAAW;IACX,eAAe;IACf,gBAAgB;CACjB,CAAC,CAAC;AACH,MAAM,UAAU,GAAG,UAAU,CAAC;AAE9B;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClB,IAAI,GAAG,oBAAoB,CAAC;IAErD,YAAY,OAAe;QACzB,KAAK,CACH,GAAG,OAAO,sEAAsE,CACjF,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAiB;IACnB,OAAO,CAAS;IAChB,gBAAgB,CAAoB;IACpC,OAAO,CAAqB;IAC5B,QAAQ,CAAqB;IAEtC,YACE,OAAe,EACf,gBAAmC,EACnC,OAAwB;QAExB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,IAAuB;QAClC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,MAAM,IAAI,kBAAkB,CAC1B,8GAA8G,CAC/G,CAAC;QACJ,CAAC;QAED,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;QAErD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,kBAAkB,CAAC,4BAA4B,CAAC,CAAC;QAC7D,CAAC;QAED,OAAO,IAAI,iBAAiB,CAC1B,OAAO,EACP,IAAI,EACJ,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CACpC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF;AAOD;;;GAGG;AACH,SAAS,SAAS,CAAC,KAAwB;IACzC,IAAI,OAA2B,CAAC;IAChC,IAAI,QAA4B,CAAC;IAEjC,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5B,IAAI,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,MAAM,CAAC;QACnB,CAAC;aAAM,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YAC/B,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,kBAAkB,CAAC,kBAAkB,MAAM,GAAG,CAAC,CAAC;QAC5D,CAAC;IACH,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,MAAc;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEnC,IACE,KAAK,KAAK,SAAS;QACnB,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;QACnC,YAAY,GAAG,CAAC,EAChB,CAAC;QACD,MAAM,IAAI,kBAAkB,CAC1B,GAAG,UAAU,+CAA+C,UAAU,OAAO,CAC9E,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,MAAM,CAAC,MAAc;IAC5B,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,30 @@
1
+ interface SimWatchChildEnvironmentProperties {
2
+ readonly cwd: string;
3
+ readonly inspect?: string | undefined;
4
+ readonly environment?: NodeJS.ProcessEnv;
5
+ }
6
+ /**
7
+ * The environment a supervised process runs in.
8
+ *
9
+ * Three things are added to the environment the supervisor was given. The
10
+ * project's own `node_modules/.bin` goes on `PATH`, so `yulin watch -- tsx
11
+ * dev.ts` works from a plain shell as well as from a package script. A marker
12
+ * says a supervisor is listening, which is what makes the runtime in the child
13
+ * report paths at all. An inspector flag goes through `NODE_OPTIONS` rather
14
+ * than on the command line, because the command being run is often not `node`
15
+ * itself.
16
+ */
17
+ export declare class SimWatchChildEnvironment {
18
+ private readonly cwd;
19
+ private readonly inspect;
20
+ private readonly environment;
21
+ constructor(properties: SimWatchChildEnvironmentProperties);
22
+ /**
23
+ * Build the environment for one run of the supervised command.
24
+ */
25
+ build(): NodeJS.ProcessEnv;
26
+ private pathWithLocalBin;
27
+ private nodeOptionsWithInspector;
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=sim-watch-child-environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-environment.d.ts","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-environment.ts"],"names":[],"mappings":"AAKA,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CAC1C;AAED;;;;;;;;;;GAUG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAEhD,YAAY,UAAU,EAAE,kCAAkC,EAKzD;IAED;;OAEG;IACH,KAAK,IAAI,MAAM,CAAC,UAAU,CAUzB;IAED,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,wBAAwB;CAKjC"}
@@ -0,0 +1,51 @@
1
+ import path from "node:path";
2
+ import { simWatchConfig } from "../../watch/sim-watch.config.js";
3
+ const nodeOptionsName = "NODE_OPTIONS";
4
+ /**
5
+ * The environment a supervised process runs in.
6
+ *
7
+ * Three things are added to the environment the supervisor was given. The
8
+ * project's own `node_modules/.bin` goes on `PATH`, so `yulin watch -- tsx
9
+ * dev.ts` works from a plain shell as well as from a package script. A marker
10
+ * says a supervisor is listening, which is what makes the runtime in the child
11
+ * report paths at all. An inspector flag goes through `NODE_OPTIONS` rather
12
+ * than on the command line, because the command being run is often not `node`
13
+ * itself.
14
+ */
15
+ export class SimWatchChildEnvironment {
16
+ cwd;
17
+ inspect;
18
+ environment;
19
+ constructor(properties) {
20
+ const { cwd, inspect, environment = process.env } = properties;
21
+ this.cwd = cwd;
22
+ this.inspect = inspect;
23
+ this.environment = environment;
24
+ }
25
+ /**
26
+ * Build the environment for one run of the supervised command.
27
+ */
28
+ build() {
29
+ return {
30
+ ...this.environment,
31
+ PATH: this.pathWithLocalBin(),
32
+ [simWatchConfig.environmentVariableName]: simWatchConfig.environmentVariableValue,
33
+ ...(this.inspect !== undefined && {
34
+ [nodeOptionsName]: this.nodeOptionsWithInspector(this.inspect),
35
+ }),
36
+ };
37
+ }
38
+ pathWithLocalBin() {
39
+ const localBin = path.join(this.cwd, "node_modules", ".bin");
40
+ const existing = this.environment["PATH"] ?? "";
41
+ if (existing.split(path.delimiter).includes(localBin)) {
42
+ return existing;
43
+ }
44
+ return `${localBin}${path.delimiter}${existing}`;
45
+ }
46
+ nodeOptionsWithInspector(inspect) {
47
+ const existing = this.environment["NODE_OPTIONS"] ?? "";
48
+ return `${existing} ${inspect}`.trim();
49
+ }
50
+ }
51
+ //# sourceMappingURL=sim-watch-child-environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-environment.js","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-environment.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,eAAe,GAAG,cAAc,CAAC;AAQvC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,wBAAwB;IAClB,GAAG,CAAS;IACZ,OAAO,CAAqB;IAC5B,WAAW,CAAoB;IAEhD,YAAY,UAA8C;QACxD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC;QAC/D,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,KAAK;QACH,OAAO;YACL,GAAG,IAAI,CAAC,WAAW;YACnB,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAC7B,CAAC,cAAc,CAAC,uBAAuB,CAAC,EACtC,cAAc,CAAC,wBAAwB;YACzC,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI;gBAChC,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC;aAC/D,CAAC;SACH,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QAEhD,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtD,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,QAAQ,EAAE,CAAC;IACnD,CAAC;IAEO,wBAAwB,CAAC,OAAe;QAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAExD,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,19 @@
1
+ import type { ChildProcess } from "node:child_process";
2
+ /**
3
+ * Whether an IPC message is one of the kind named.
4
+ */
5
+ export declare function isWatchMessage(message: unknown, type: string): boolean;
6
+ /**
7
+ * Whether an IPC message names a path to watch.
8
+ */
9
+ export declare function isWatchPathMessage(message: unknown, type: string): message is {
10
+ readonly path: string;
11
+ };
12
+ /**
13
+ * Wait for a process to send a message of one kind, and give up after a while.
14
+ *
15
+ * A process not running Yulin's runtime never answers, so this is a short wait
16
+ * rather than a requirement.
17
+ */
18
+ export declare function waitWatchMessage(childProcess: ChildProcess, type: string, withinMs: number): Promise<void>;
19
+ //# sourceMappingURL=sim-watch-child-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-message.d.ts","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,IAAI;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAQtC;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Whether an IPC message is one of the kind named.
3
+ */
4
+ export function isWatchMessage(message, type) {
5
+ return (typeof message === "object" &&
6
+ message !== null &&
7
+ "type" in message &&
8
+ message.type === type);
9
+ }
10
+ /**
11
+ * Whether an IPC message names a path to watch.
12
+ */
13
+ export function isWatchPathMessage(message, type) {
14
+ return (isWatchMessage(message, type) &&
15
+ typeof message === "object" &&
16
+ message !== null &&
17
+ "path" in message &&
18
+ typeof message.path === "string");
19
+ }
20
+ /**
21
+ * Wait for a process to send a message of one kind, and give up after a while.
22
+ *
23
+ * A process not running Yulin's runtime never answers, so this is a short wait
24
+ * rather than a requirement.
25
+ */
26
+ export async function waitWatchMessage(childProcess, type, withinMs) {
27
+ await new Promise((resolve) => {
28
+ const done = () => {
29
+ clearTimeout(timer);
30
+ childProcess.off("message", onMessage);
31
+ resolve();
32
+ };
33
+ const onMessage = (message) => {
34
+ if (isWatchMessage(message, type)) {
35
+ done();
36
+ }
37
+ };
38
+ const timer = setTimeout(done, withinMs);
39
+ childProcess.on("message", onMessage);
40
+ });
41
+ }
42
+ //# sourceMappingURL=sim-watch-child-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-message.js","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-message.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB,EAAE,IAAY;IAC3D,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,MAAM,IAAI,OAAO;QACjB,OAAO,CAAC,IAAI,KAAK,IAAI,CACtB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAgB,EAChB,IAAY;IAEZ,OAAO,CACL,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;QAC7B,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,MAAM,IAAI,OAAO;QACjB,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ,CACjC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,YAA0B,EAC1B,IAAY,EACZ,QAAgB;IAEhB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,GAAS,EAAE;YACtB,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,YAAY,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YACvC,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,MAAM,SAAS,GAAG,CAAC,OAAgB,EAAQ,EAAE;YAC3C,IAAI,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;gBAClC,IAAI,EAAE,CAAC;YACT,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAEzC,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type ChildProcess } from "node:child_process";
2
+ interface SimWatchChildProcessProperties {
3
+ readonly command: string;
4
+ readonly args: readonly string[];
5
+ readonly cwd: string;
6
+ readonly env: NodeJS.ProcessEnv;
7
+ }
8
+ /**
9
+ * A spawned command, and the two moments in its life a supervisor waits on.
10
+ *
11
+ * Standard input, output and error are the supervisor's own, so the process
12
+ * being watched prints where it would have printed if it had been started by
13
+ * hand. The fourth channel is what the runtime inside it reports paths over.
14
+ */
15
+ export declare class SimWatchChildProcess {
16
+ readonly process: ChildProcess;
17
+ readonly spawned: Promise<void>;
18
+ readonly finished: Promise<void>;
19
+ constructor(properties: SimWatchChildProcessProperties);
20
+ }
21
+ export {};
22
+ //# sourceMappingURL=sim-watch-child-process.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-process.d.ts","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAE9D,UAAU,8BAA8B;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACjC;AAED;;;;;;GAMG;AACH,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,YAAY,UAAU,EAAE,8BAA8B,EAqBrD;CACF"}
@@ -0,0 +1,33 @@
1
+ import { spawn } from "node:child_process";
2
+ /**
3
+ * A spawned command, and the two moments in its life a supervisor waits on.
4
+ *
5
+ * Standard input, output and error are the supervisor's own, so the process
6
+ * being watched prints where it would have printed if it had been started by
7
+ * hand. The fourth channel is what the runtime inside it reports paths over.
8
+ */
9
+ export class SimWatchChildProcess {
10
+ process;
11
+ spawned;
12
+ finished;
13
+ constructor(properties) {
14
+ const { command, args, cwd, env } = properties;
15
+ this.process = spawn(command, [...args], {
16
+ cwd,
17
+ env,
18
+ stdio: ["inherit", "inherit", "inherit", "ipc"],
19
+ });
20
+ this.spawned = new Promise((resolve, reject) => {
21
+ this.process.once("spawn", resolve);
22
+ this.process.once("error", (error) => {
23
+ reject(new Error(`Could not run ${command}: ${error.message}`));
24
+ });
25
+ });
26
+ this.finished = new Promise((resolve) => {
27
+ this.process.once("exit", () => {
28
+ resolve();
29
+ });
30
+ });
31
+ }
32
+ }
33
+ //# sourceMappingURL=sim-watch-child-process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-process.js","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAS9D;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IACtB,OAAO,CAAe;IACtB,OAAO,CAAgB;IACvB,QAAQ,CAAgB;IAEjC,YAAY,UAA0C;QACpD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,UAAU,CAAC;QAE/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE;YACvC,GAAG;YACH,GAAG;YACH,KAAK,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;SAChD,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAAY,EAAE,EAAE;gBAC1C,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YAClE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAC5C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE;gBAC7B,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ import type { ChildProcess } from "node:child_process";
2
+ interface SimWatchChildShutdownProperties {
3
+ readonly process: ChildProcess;
4
+ readonly finished: Promise<void>;
5
+ }
6
+ /**
7
+ * Takes a supervised process down, in the order that lets it say goodbye.
8
+ *
9
+ * A process running Yulin's runtime is warned first, so a served page hears
10
+ * that a reload is coming rather than only seeing its connection go, and is
11
+ * killed as soon as it says it has passed that on. One that does not answer,
12
+ * because it is serving nothing or is not a Yulin process at all, is killed
13
+ * when the short wait runs out. Either way it is killed, and killed harder if
14
+ * it will not go, because the port has to be free for the process replacing it.
15
+ */
16
+ export declare class SimWatchChildShutdown {
17
+ private readonly process;
18
+ private readonly finished;
19
+ constructor(properties: SimWatchChildShutdownProperties);
20
+ /**
21
+ * Stop the process, and wait until it has gone.
22
+ */
23
+ stop(): Promise<void>;
24
+ private warn;
25
+ private gone;
26
+ }
27
+ export {};
28
+ //# sourceMappingURL=sim-watch-child-shutdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-shutdown.d.ts","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-shutdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,UAAU,+BAA+B;IACvC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;;;;;;;GASG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IAEzC,YAAY,UAAU,EAAE,+BAA+B,EAItD;IAED;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAI1B;YAEa,IAAI;YA0BJ,IAAI;CAWnB"}
@@ -0,0 +1,59 @@
1
+ import { simWatchConfig, simWatchMessages, } from "../../watch/sim-watch.config.js";
2
+ import { waitWatchMessage } from "./sim-watch-child-message.js";
3
+ /**
4
+ * Takes a supervised process down, in the order that lets it say goodbye.
5
+ *
6
+ * A process running Yulin's runtime is warned first, so a served page hears
7
+ * that a reload is coming rather than only seeing its connection go, and is
8
+ * killed as soon as it says it has passed that on. One that does not answer,
9
+ * because it is serving nothing or is not a Yulin process at all, is killed
10
+ * when the short wait runs out. Either way it is killed, and killed harder if
11
+ * it will not go, because the port has to be free for the process replacing it.
12
+ */
13
+ export class SimWatchChildShutdown {
14
+ process;
15
+ finished;
16
+ constructor(properties) {
17
+ const { process: childProcess, finished } = properties;
18
+ this.process = childProcess;
19
+ this.finished = finished;
20
+ }
21
+ /**
22
+ * Stop the process, and wait until it has gone.
23
+ */
24
+ async stop() {
25
+ await this.warn();
26
+ this.process.kill("SIGTERM");
27
+ await this.gone();
28
+ }
29
+ async warn() {
30
+ if (!this.process.connected) {
31
+ return;
32
+ }
33
+ const acknowledged = Promise.race([
34
+ this.finished,
35
+ waitWatchMessage(this.process, simWatchMessages.stopped, simWatchConfig.stoppingMs),
36
+ ]);
37
+ // The channel can close between being asked whether it is open and being
38
+ // written to, because the process is free to exit in between. The callback
39
+ // is where that failure goes; without one it reaches the process as an
40
+ // error event, and a warning that could not be delivered is not a reason to
41
+ // stop taking the process down.
42
+ this.process.send({ type: simWatchMessages.stopping }, () => {
43
+ // Nothing to do about a process that has already gone.
44
+ });
45
+ await acknowledged;
46
+ }
47
+ async gone() {
48
+ const timer = setTimeout(() => {
49
+ this.process.kill("SIGKILL");
50
+ }, simWatchConfig.exitMs);
51
+ try {
52
+ await this.finished;
53
+ }
54
+ finally {
55
+ clearTimeout(timer);
56
+ }
57
+ }
58
+ }
59
+ //# sourceMappingURL=sim-watch-child-shutdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-watch-child-shutdown.js","sourceRoot":"","sources":["../../../src/cli/watch/sim-watch-child-shutdown.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,gBAAgB,GACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAOhE;;;;;;;;;GASG;AACH,MAAM,OAAO,qBAAqB;IACf,OAAO,CAAe;IACtB,QAAQ,CAAgB;IAEzC,YAAY,UAA2C;QACrD,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;QACvD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;YAChC,IAAI,CAAC,QAAQ;YACb,gBAAgB,CACd,IAAI,CAAC,OAAO,EACZ,gBAAgB,CAAC,OAAO,EACxB,cAAc,CAAC,UAAU,CAC1B;SACF,CAAC,CAAC;QAEH,yEAAyE;QACzE,2EAA2E;QAC3E,uEAAuE;QACvE,4EAA4E;QAC5E,gCAAgC;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,QAAQ,EAAE,EAAE,GAAG,EAAE;YAC1D,uDAAuD;QACzD,CAAC,CAAC,CAAC;QAEH,MAAM,YAAY,CAAC;IACrB,CAAC;IAEO,KAAK,CAAC,IAAI;QAChB,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC/B,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;QAE1B,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,QAAQ,CAAC;QACtB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;CACF"}