@kensio/yulin 1.16.1 → 1.16.2

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 (216) hide show
  1. package/dist/sdk/wire/sim-sdk-wire-operation.d.ts +12 -2
  2. package/dist/sdk/wire/sim-sdk-wire-operation.d.ts.map +1 -1
  3. package/dist/sdk/wire/sim-sdk-wire-operation.js.map +1 -1
  4. package/dist/sdk/wire/sim-sdk-wire.types.d.ts +0 -4
  5. package/dist/sdk/wire/sim-sdk-wire.types.d.ts.map +1 -1
  6. package/dist/service/aws/factory/sim-aws-lambda-collaborators.d.ts +8 -0
  7. package/dist/service/aws/factory/sim-aws-lambda-collaborators.d.ts.map +1 -1
  8. package/dist/service/aws/factory/sim-aws-lambda-collaborators.js +13 -0
  9. package/dist/service/aws/factory/sim-aws-lambda-collaborators.js.map +1 -1
  10. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.d.ts.map +1 -1
  11. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js +2 -1
  12. package/dist/service/cognito/command/auth/sim-cognito-password-sign-in.js.map +1 -1
  13. package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.d.ts.map +1 -1
  14. package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js +2 -1
  15. package/dist/service/cognito/command/hosted/sim-cognito-hosted-password-sign-in.js.map +1 -1
  16. package/dist/service/cognito/command/sim-cognito-command.types.d.ts +1 -0
  17. package/dist/service/cognito/command/sim-cognito-command.types.d.ts.map +1 -1
  18. package/dist/service/cognito/command/sim-cognito-commands.d.ts +2 -0
  19. package/dist/service/cognito/command/sim-cognito-commands.d.ts.map +1 -1
  20. package/dist/service/cognito/command/sim-cognito-commands.js +8 -0
  21. package/dist/service/cognito/command/sim-cognito-commands.js.map +1 -1
  22. package/dist/service/cognito/command/user/password-reset.command.d.ts +80 -0
  23. package/dist/service/cognito/command/user/password-reset.command.d.ts.map +1 -0
  24. package/dist/service/cognito/command/user/password-reset.command.js +2 -0
  25. package/dist/service/cognito/command/user/password-reset.command.js.map +1 -0
  26. package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.d.ts +74 -0
  27. package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.d.ts.map +1 -0
  28. package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.js +121 -0
  29. package/dist/service/cognito/command/user/sim-cognito-password-reset-commands.js.map +1 -0
  30. package/dist/service/cognito/command/user/sim-cognito-resetting-user.d.ts +34 -0
  31. package/dist/service/cognito/command/user/sim-cognito-resetting-user.d.ts.map +1 -0
  32. package/dist/service/cognito/command/user/sim-cognito-resetting-user.js +54 -0
  33. package/dist/service/cognito/command/user/sim-cognito-resetting-user.js.map +1 -0
  34. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.d.ts.map +1 -1
  35. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js +3 -3
  36. package/dist/service/cognito/command/user/sim-cognito-sign-up-commands.js.map +1 -1
  37. package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.d.ts +29 -0
  38. package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.d.ts.map +1 -0
  39. package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.js +36 -0
  40. package/dist/service/cognito/command/user/sim-cognito-unsimulated-password-reset-options.js.map +1 -0
  41. package/dist/service/cognito/error/sim-cognito.error.d.ts +23 -0
  42. package/dist/service/cognito/error/sim-cognito.error.d.ts.map +1 -1
  43. package/dist/service/cognito/error/sim-cognito.error.js +27 -0
  44. package/dist/service/cognito/error/sim-cognito.error.js.map +1 -1
  45. package/dist/service/cognito/index.d.ts +2 -1
  46. package/dist/service/cognito/index.d.ts.map +1 -1
  47. package/dist/service/cognito/index.js +2 -1
  48. package/dist/service/cognito/index.js.map +1 -1
  49. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts +6 -5
  50. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.d.ts.map +1 -1
  51. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js +18 -5
  52. package/dist/service/cognito/sdk/sim-cognito-sdk-directory-routes.js.map +1 -1
  53. package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.d.ts +26 -0
  54. package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.d.ts.map +1 -0
  55. package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.js +57 -0
  56. package/dist/service/cognito/serve/page/sim-cognito-forgot-password-page.js.map +1 -0
  57. package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts +9 -6
  58. package/dist/service/cognito/serve/page/sim-cognito-managed-login.d.ts.map +1 -1
  59. package/dist/service/cognito/serve/page/sim-cognito-managed-login.js +26 -11
  60. package/dist/service/cognito/serve/page/sim-cognito-managed-login.js.map +1 -1
  61. package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts +18 -0
  62. package/dist/service/cognito/serve/page/sim-cognito-page-paths.d.ts.map +1 -1
  63. package/dist/service/cognito/serve/page/sim-cognito-page-paths.js +23 -0
  64. package/dist/service/cognito/serve/page/sim-cognito-page-paths.js.map +1 -1
  65. package/dist/service/cognito/serve/page/sim-cognito-provider-links.d.ts +12 -0
  66. package/dist/service/cognito/serve/page/sim-cognito-provider-links.d.ts.map +1 -0
  67. package/dist/service/cognito/serve/page/sim-cognito-provider-links.js +18 -0
  68. package/dist/service/cognito/serve/page/sim-cognito-provider-links.js.map +1 -0
  69. package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.d.ts +27 -0
  70. package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.d.ts.map +1 -0
  71. package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.js +65 -0
  72. package/dist/service/cognito/serve/page/sim-cognito-reset-password-page.js.map +1 -0
  73. package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts +2 -10
  74. package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.d.ts.map +1 -1
  75. package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js +16 -21
  76. package/dist/service/cognito/serve/page/sim-cognito-sign-in-page.js.map +1 -1
  77. package/dist/service/cognito/sim-cognito-user-directory.d.ts +16 -0
  78. package/dist/service/cognito/sim-cognito-user-directory.d.ts.map +1 -1
  79. package/dist/service/cognito/sim-cognito-user-directory.js +25 -0
  80. package/dist/service/cognito/sim-cognito-user-directory.js.map +1 -1
  81. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts +9 -0
  82. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.d.ts.map +1 -1
  83. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js +14 -1
  84. package/dist/service/cognito/user-pool/auth/sim-cognito-sign-in.js.map +1 -1
  85. package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.d.ts +10 -0
  86. package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.d.ts.map +1 -1
  87. package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.js +11 -0
  88. package/dist/service/cognito/user-pool/idp/sim-cognito-federated-identity.js.map +1 -1
  89. package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.d.ts +44 -0
  90. package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.d.ts.map +1 -0
  91. package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.js +78 -0
  92. package/dist/service/cognito/user-pool/message/sim-cognito-code-delivery.js.map +1 -0
  93. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts +10 -6
  94. package/dist/service/cognito/user-pool/message/sim-cognito-message-occasion.d.ts.map +1 -1
  95. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts +5 -2
  96. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.d.ts.map +1 -1
  97. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js +5 -2
  98. package/dist/service/cognito/user-pool/message/sim-cognito-pool-messenger.js.map +1 -1
  99. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts +15 -0
  100. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.d.ts.map +1 -1
  101. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js +18 -0
  102. package/dist/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.js.map +1 -1
  103. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts +4 -1
  104. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.d.ts.map +1 -1
  105. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js +5 -2
  106. package/dist/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.js.map +1 -1
  107. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts +14 -6
  108. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.d.ts.map +1 -1
  109. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js +20 -9
  110. package/dist/service/cognito/user-pool/user/sim-cognito-user-confirmation.js.map +1 -1
  111. package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.d.ts +62 -0
  112. package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.d.ts.map +1 -0
  113. package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.js +65 -0
  114. package/dist/service/cognito/user-pool/user/sim-cognito-user-password-reset.js.map +1 -0
  115. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts +55 -11
  116. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.d.ts.map +1 -1
  117. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js +67 -10
  118. package/dist/service/cognito/user-pool/user/sim-cognito-user-status.js.map +1 -1
  119. package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts +15 -12
  120. package/dist/service/cognito/user-pool/user/sim-cognito-user.d.ts.map +1 -1
  121. package/dist/service/cognito/user-pool/user/sim-cognito-user.js +31 -20
  122. package/dist/service/cognito/user-pool/user/sim-cognito-user.js.map +1 -1
  123. package/dist/service/lambda/command/create-function/create-function.handler.d.ts +3 -0
  124. package/dist/service/lambda/command/create-function/create-function.handler.d.ts.map +1 -1
  125. package/dist/service/lambda/command/create-function/create-function.handler.js +5 -1
  126. package/dist/service/lambda/command/create-function/create-function.handler.js.map +1 -1
  127. package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts +2 -0
  128. package/dist/service/lambda/command/function/sim-lambda-function-commands.d.ts.map +1 -1
  129. package/dist/service/lambda/command/function/sim-lambda-function-commands.js.map +1 -1
  130. package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts +7 -0
  131. package/dist/service/lambda/function/code/sim-lambda-code-resolver.d.ts.map +1 -1
  132. package/dist/service/lambda/function/code/sim-lambda-code-resolver.js +1 -0
  133. package/dist/service/lambda/function/code/sim-lambda-code-resolver.js.map +1 -1
  134. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.d.ts +3 -0
  135. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.d.ts.map +1 -1
  136. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js +3 -0
  137. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code-factory.js.map +1 -1
  138. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts +6 -9
  139. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.d.ts.map +1 -1
  140. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js +3 -3
  141. package/dist/service/lambda/function/code/sim-lambda-vm-zip-code.js.map +1 -1
  142. package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.d.ts +11 -3
  143. package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.d.ts.map +1 -1
  144. package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.js +13 -8
  145. package/dist/service/lambda/function/code/vm/sdk/sim-sdk-lambda-vm-module-provider.js.map +1 -1
  146. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.d.ts +21 -2
  147. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.d.ts.map +1 -1
  148. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.js +18 -2
  149. package/dist/service/lambda/function/code/vm/sim-lambda-vm-context.js.map +1 -1
  150. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.d.ts +26 -0
  151. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.d.ts.map +1 -0
  152. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.js +17 -0
  153. package/dist/service/lambda/function/invoke/sim-lambda-host-scope.js.map +1 -0
  154. package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.d.ts +17 -0
  155. package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.d.ts.map +1 -0
  156. package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.js +43 -0
  157. package/dist/service/lambda/function/invoke/sim-lambda-outbound-clients.js.map +1 -0
  158. package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.d.ts +44 -0
  159. package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.d.ts.map +1 -0
  160. package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.js +83 -0
  161. package/dist/service/lambda/function/invoke/sim-lambda-process-outbound.js.map +1 -0
  162. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.d.ts +50 -0
  163. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.d.ts.map +1 -0
  164. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.js +83 -0
  165. package/dist/service/lambda/function/outbound/sim-lambda-aws-api-outbound.js.map +1 -0
  166. package/dist/service/lambda/function/outbound/sim-lambda-http-module.d.ts +42 -0
  167. package/dist/service/lambda/function/outbound/sim-lambda-http-module.d.ts.map +1 -0
  168. package/dist/service/lambda/function/outbound/sim-lambda-http-module.js +88 -0
  169. package/dist/service/lambda/function/outbound/sim-lambda-http-module.js.map +1 -0
  170. package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-wire-request.d.ts → outbound/sim-lambda-http-request.d.ts} +20 -7
  171. package/dist/service/lambda/function/outbound/sim-lambda-http-request.d.ts.map +1 -0
  172. package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-wire-request.js → outbound/sim-lambda-http-request.js} +27 -29
  173. package/dist/service/lambda/function/outbound/sim-lambda-http-request.js.map +1 -0
  174. package/dist/service/lambda/function/outbound/sim-lambda-http-response.d.ts +18 -0
  175. package/dist/service/lambda/function/outbound/sim-lambda-http-response.d.ts.map +1 -0
  176. package/dist/service/lambda/function/outbound/sim-lambda-http-response.js +23 -0
  177. package/dist/service/lambda/function/outbound/sim-lambda-http-response.js.map +1 -0
  178. package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-http-target.d.ts → outbound/sim-lambda-http-target.d.ts} +9 -7
  179. package/dist/service/lambda/function/outbound/sim-lambda-http-target.d.ts.map +1 -0
  180. package/dist/service/lambda/function/{code/vm/http/sim-lambda-vm-http-target.js → outbound/sim-lambda-http-target.js} +4 -38
  181. package/dist/service/lambda/function/outbound/sim-lambda-http-target.js.map +1 -0
  182. package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.d.ts +15 -0
  183. package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.d.ts.map +1 -0
  184. package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.js +38 -0
  185. package/dist/service/lambda/function/outbound/sim-lambda-outbound-fetch.js.map +1 -0
  186. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.d.ts +27 -0
  187. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.d.ts.map +1 -0
  188. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.d.ts +13 -0
  189. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.d.ts.map +1 -0
  190. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.js +107 -0
  191. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.factory.js.map +1 -0
  192. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.js +2 -0
  193. package/dist/service/lambda/function/outbound/sim-lambda-outbound-http.js.map +1 -0
  194. package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.d.ts +16 -0
  195. package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.d.ts.map +1 -0
  196. package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.js +29 -0
  197. package/dist/service/lambda/function/outbound/sim-lambda-outbound-wire.js.map +1 -0
  198. package/dist/service/lambda/function/sim-lambda-function.d.ts +12 -6
  199. package/dist/service/lambda/function/sim-lambda-function.d.ts.map +1 -1
  200. package/dist/service/lambda/function/sim-lambda-function.js +9 -10
  201. package/dist/service/lambda/function/sim-lambda-function.js.map +1 -1
  202. package/dist/service/lambda/sim-lambda-commands.d.ts +8 -0
  203. package/dist/service/lambda/sim-lambda-commands.d.ts.map +1 -1
  204. package/dist/service/lambda/sim-lambda-commands.js +2 -1
  205. package/dist/service/lambda/sim-lambda-commands.js.map +1 -1
  206. package/dist/service/rekognition/face/sim-rekognition-face-detail-builder.d.ts.map +1 -1
  207. package/dist/service/rekognition/face/sim-rekognition-face-detail-builder.js.map +1 -1
  208. package/package.json +2 -2
  209. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.d.ts +0 -27
  210. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.d.ts.map +0 -1
  211. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.js +0 -78
  212. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-module.js.map +0 -1
  213. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-target.d.ts.map +0 -1
  214. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-http-target.js.map +0 -1
  215. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-wire-request.d.ts.map +0 -1
  216. package/dist/service/lambda/function/code/vm/http/sim-lambda-vm-wire-request.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-user-directory.js","sourceRoot":"","sources":["../../../src/service/cognito/sim-cognito-user-directory.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;AASvC;;;;;;;;;;GAUG;AACH,MAAM,OAAgB,uBAAwB,SAAQ,qBAAqB;IACzE,YAAsB,UAA6C;QACjE,KAAK,CAAC,UAAU,CAAC,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,eAAe,CACnB,OAAqD,EACrD,OAAkD;QAElD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAA4C;QAE5C,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CACjB,OAAmD;QAEnD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAA4D;QAE5D,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,OAAwD,EACxD,OAAkD;QAElD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC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CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,OAA4D,EAC5D,OAAkD;QAElD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAAsD,EACtD,OAAkD;QAElD,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -27,6 +27,15 @@ export declare function requireSimCognitoEnabled(user: SimCognitoUser): void;
27
27
  * actually missing, so an application can send it to `ConfirmSignUp`.
28
28
  */
29
29
  export declare function requireSimCognitoConfirmed(user: SimCognitoUser): void;
30
+ /**
31
+ * Refuse a sign-in by a user whose password an administrator has reset.
32
+ *
33
+ * This is checked alongside the confirmation, and for the same reason: the
34
+ * user is told what is actually missing, so an application can send it to
35
+ * `ConfirmForgotPassword` with the code the reset issued rather than back to
36
+ * the password field.
37
+ */
38
+ export declare function requireSimCognitoPasswordSet(user: SimCognitoUser): void;
30
39
  /**
31
40
  * Refuse a sign-in the user cannot make.
32
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-sign-in.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/auth/sim-cognito-sign-in.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,wBAAwB,EAChC,QAAQ,EAAE,MAAM,GACf,cAAc,CAgBhB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAInE;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAIrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN"}
1
+ {"version":3,"file":"sim-cognito-sign-in.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/auth/sim-cognito-sign-in.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,wBAAwB,EAChC,QAAQ,EAAE,MAAM,GACf,cAAc,CAgBhB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAInE;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAIrE;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAMvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,GACf,IAAI,CAQN"}
@@ -1,4 +1,4 @@
1
- import { SimCognitoNotAuthorizedException, SimCognitoUserNotConfirmedException, } from "../../error/sim-cognito.error.js";
1
+ import { SimCognitoNotAuthorizedException, SimCognitoPasswordResetRequiredException, SimCognitoUserNotConfirmedException, } from "../../error/sim-cognito.error.js";
2
2
  import { requireSimCognitoUsername } from "../user/sim-cognito-username.js";
3
3
  /**
4
4
  * Resolve the user a sign-in names, as the app client reports one that is not
@@ -44,6 +44,19 @@ export function requireSimCognitoConfirmed(user) {
44
44
  throw new SimCognitoUserNotConfirmedException("User is not confirmed.");
45
45
  }
46
46
  }
47
+ /**
48
+ * Refuse a sign-in by a user whose password an administrator has reset.
49
+ *
50
+ * This is checked alongside the confirmation, and for the same reason: the
51
+ * user is told what is actually missing, so an application can send it to
52
+ * `ConfirmForgotPassword` with the code the reset issued rather than back to
53
+ * the password field.
54
+ */
55
+ export function requireSimCognitoPasswordSet(user) {
56
+ if (user.status.mustResetPassword) {
57
+ throw new SimCognitoPasswordResetRequiredException("Password reset required for the user.");
58
+ }
59
+ }
47
60
  /**
48
61
  * Refuse a sign-in the user cannot make.
49
62
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-sign-in.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/auth/sim-cognito-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,IAAwB,EACxB,MAAgC,EAChC,QAAgB;IAEhB,MAAM,KAAK,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAElD,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,kBAAkB,EAAE,CAAC;QAC1D,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,gCAAgC,CACxC,iCAAiC,CAClC,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAoB;IAC3D,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,gCAAgC,CAAC,mBAAmB,CAAC,CAAC;IAClE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAoB;IAC7D,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,IAAI,mCAAmC,CAAC,wBAAwB,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACrC,IAAoB,EACpB,QAAgB;IAEhB,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE/B,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,gCAAgC,CACxC,iCAAiC,CAClC,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"sim-cognito-sign-in.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/auth/sim-cognito-sign-in.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,wCAAwC,EACxC,mCAAmC,GACpC,MAAM,kCAAkC,CAAC;AAI1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,IAAwB,EACxB,MAAgC,EAChC,QAAgB;IAEhB,MAAM,KAAK,GAAG,yBAAyB,CAAC,QAAQ,CAAC,CAAC;IAElD,IAAI,CAAC,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`identities`, in the shape an id token carries it.
3
4
  *
@@ -59,6 +60,15 @@ export declare class SimCognitoFederatedIdentity {
59
60
  * holds is what the token claim holds.
60
61
  */
61
62
  toAttributeValue(): string;
63
+ /**
64
+ * The `identities` attribute a federated user reports, as the one entry a
65
+ * described user carries it in.
66
+ *
67
+ * A local user has no such attribute at all, so this is a list rather than a
68
+ * single attribute: the user spreads whichever it has into the attributes it
69
+ * reports.
70
+ */
71
+ attributes(): readonly SimCognitoAttributeType[];
62
72
  }
63
73
  export {};
64
74
  //# sourceMappingURL=sim-cognito-federated-identity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-federated-identity.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/idp/sim-cognito-federated-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,qCAAqC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,qBAAa,2BAA2B;IACtC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,SAAgB,WAAW,EAAE,MAAM,CAAC;IAEpC,YAAY,UAAU,EAAE,qCAAqC,EAM5D;IAED;;;;;OAKG;IACH,OAAO,IAAI,uBAAuB,CASjC;IAED;;;;;;OAMG;IACH,gBAAgB,IAAI,MAAM,CAEzB;CACF"}
1
+ {"version":3,"file":"sim-cognito-federated-identity.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/idp/sim-cognito-federated-identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEtF;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,qCAAqC;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,qBAAa,2BAA2B;IACtC,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,SAAgB,WAAW,EAAE,MAAM,CAAC;IAEpC,YAAY,UAAU,EAAE,qCAAqC,EAM5D;IAED;;;;;OAKG;IACH,OAAO,IAAI,uBAAuB,CASjC;IAED;;;;;;OAMG;IACH,gBAAgB,IAAI,MAAM,CAEzB;IAED;;;;;;;OAOG;IACH,UAAU,IAAI,SAAS,uBAAuB,EAAE,CAE/C;CACF"}
@@ -46,5 +46,16 @@ export class SimCognitoFederatedIdentity {
46
46
  toAttributeValue() {
47
47
  return JSON.stringify([this.toClaim()]);
48
48
  }
49
+ /**
50
+ * The `identities` attribute a federated user reports, as the one entry a
51
+ * described user carries it in.
52
+ *
53
+ * A local user has no such attribute at all, so this is a list rather than a
54
+ * single attribute: the user spreads whichever it has into the attributes it
55
+ * reports.
56
+ */
57
+ attributes() {
58
+ return [{ Name: "identities", Value: this.toAttributeValue() }];
59
+ }
49
60
  }
50
61
  //# sourceMappingURL=sim-cognito-federated-identity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-federated-identity.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/idp/sim-cognito-federated-identity.ts"],"names":[],"mappings":"AAkCA;;;;;;;;GAQG;AACH,MAAM,OAAO,2BAA2B;IACtB,MAAM,CAAS;IACf,YAAY,CAAS;IACrB,YAAY,CAAS;IACrB,MAAM,CAAgB;IACtB,WAAW,CAAS;IAEpC,YAAY,UAAiD;QAC3D,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACpD,CAAC;IAED;;;;;OAKG;IACH,OAAO;QACL,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SACtC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF"}
1
+ {"version":3,"file":"sim-cognito-federated-identity.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/idp/sim-cognito-federated-identity.ts"],"names":[],"mappings":"AAoCA;;;;;;;;GAQG;AACH,MAAM,OAAO,2BAA2B;IACtB,MAAM,CAAS;IACf,YAAY,CAAS;IACrB,YAAY,CAAS;IACrB,MAAM,CAAgB;IACtB,WAAW,CAAS;IAEpC,YAAY,UAAiD;QAC3D,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACpD,CAAC;IAED;;;;;OAKG;IACH,OAAO;QACL,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;SACtC,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;OAOG;IACH,UAAU;QACR,OAAO,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IAClE,CAAC;CACF"}
@@ -0,0 +1,44 @@
1
+ import type { SimCognitoMessageDelivery } from "./sim-cognito-message-delivery.js";
2
+ import type { SimCognitoMessageMedium } from "./sim-cognito-sent-message.js";
3
+ /**
4
+ * Where a pool sent a code, as the operation that sent it reports it back.
5
+ *
6
+ * https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_CodeDeliveryDetailsType.html
7
+ */
8
+ export interface SimCognitoCodeDeliveryDetailsType {
9
+ readonly Destination?: string | undefined;
10
+ readonly DeliveryMedium?: string | undefined;
11
+ readonly AttributeName?: string | undefined;
12
+ }
13
+ /**
14
+ * The details a pool answers with for a message it has just sent.
15
+ *
16
+ * Real Cognito reports where a code went without reporting the address it went
17
+ * to, so the destination is masked. That masking is what makes the response
18
+ * safe to show a browser: an application prints it to say which address to go
19
+ * and look at, and someone who guessed the username learns nothing from it.
20
+ *
21
+ * The masked shape here follows real Cognito's rather than being read back
22
+ * from a live account, so assert that a destination came back and which
23
+ * medium carried it rather than on the mask itself.
24
+ */
25
+ export declare function simCognitoCodeDelivery(delivery: SimCognitoMessageDelivery): SimCognitoCodeDeliveryDetailsType;
26
+ /**
27
+ * The details a pool answers a reset for a user it does not hold with.
28
+ *
29
+ * An app client with `PreventUserExistenceErrors` of `ENABLED` answers a
30
+ * `ForgotPassword` naming an unknown user as though a code had gone out, which
31
+ * is what stops the operation being used to find out who has an account. Real
32
+ * Cognito makes up a destination for it, and so does this: there is no address
33
+ * behind it, so the username the request supplied is what gets masked.
34
+ */
35
+ export declare function simCognitoHiddenCodeDelivery(username: string): SimCognitoCodeDeliveryDetailsType;
36
+ /**
37
+ * One address with all but its first character and its last dotted part
38
+ * hidden, which is how Cognito writes an address it will not report.
39
+ *
40
+ * A phone number keeps its last four digits instead, because that is the part
41
+ * a person recognises their own number by.
42
+ */
43
+ export declare function simCognitoMaskedDestination(recipient: string, medium: SimCognitoMessageMedium): string;
44
+ //# sourceMappingURL=sim-cognito-code-delivery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cognito-code-delivery.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-code-delivery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAE7E;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAeD;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,yBAAyB,GAClC,iCAAiC,CASnC;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,GACf,iCAAiC,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAMR"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * How many characters of a phone number Cognito leaves showing.
3
+ */
4
+ const shownDigits = 4;
5
+ /**
6
+ * The attribute each medium is reached by, which is what a response names.
7
+ */
8
+ const attributeNames = {
9
+ EMAIL: "email",
10
+ SMS: "phone_number",
11
+ };
12
+ /**
13
+ * The details a pool answers with for a message it has just sent.
14
+ *
15
+ * Real Cognito reports where a code went without reporting the address it went
16
+ * to, so the destination is masked. That masking is what makes the response
17
+ * safe to show a browser: an application prints it to say which address to go
18
+ * and look at, and someone who guessed the username learns nothing from it.
19
+ *
20
+ * The masked shape here follows real Cognito's rather than being read back
21
+ * from a live account, so assert that a destination came back and which
22
+ * medium carried it rather than on the mask itself.
23
+ */
24
+ export function simCognitoCodeDelivery(delivery) {
25
+ return {
26
+ Destination: simCognitoMaskedDestination(delivery.recipient, delivery.medium),
27
+ DeliveryMedium: delivery.medium,
28
+ AttributeName: attributeNames[delivery.medium],
29
+ };
30
+ }
31
+ /**
32
+ * The details a pool answers a reset for a user it does not hold with.
33
+ *
34
+ * An app client with `PreventUserExistenceErrors` of `ENABLED` answers a
35
+ * `ForgotPassword` naming an unknown user as though a code had gone out, which
36
+ * is what stops the operation being used to find out who has an account. Real
37
+ * Cognito makes up a destination for it, and so does this: there is no address
38
+ * behind it, so the username the request supplied is what gets masked.
39
+ */
40
+ export function simCognitoHiddenCodeDelivery(username) {
41
+ return {
42
+ Destination: simCognitoMaskedDestination(username, "EMAIL"),
43
+ DeliveryMedium: "EMAIL",
44
+ AttributeName: attributeNames.EMAIL,
45
+ };
46
+ }
47
+ /**
48
+ * One address with all but its first character and its last dotted part
49
+ * hidden, which is how Cognito writes an address it will not report.
50
+ *
51
+ * A phone number keeps its last four digits instead, because that is the part
52
+ * a person recognises their own number by.
53
+ */
54
+ export function simCognitoMaskedDestination(recipient, medium) {
55
+ if (medium === "SMS") {
56
+ return maskedNumber(recipient);
57
+ }
58
+ return maskedAddress(recipient);
59
+ }
60
+ function maskedNumber(number) {
61
+ const shown = number.slice(-shownDigits);
62
+ return `${"*".repeat(Math.max(number.length - shownDigits, 0))}${shown}`;
63
+ }
64
+ function maskedAddress(address) {
65
+ const at = address.indexOf("@");
66
+ if (at === -1) {
67
+ return maskedPart(address);
68
+ }
69
+ const domain = address.slice(at + 1);
70
+ const dot = domain.indexOf(".");
71
+ const host = dot === -1 ? domain : domain.slice(0, dot);
72
+ const tail = dot === -1 ? "" : domain.slice(dot);
73
+ return `${maskedPart(address.slice(0, at))}@${maskedPart(host)}${tail}`;
74
+ }
75
+ function maskedPart(part) {
76
+ return `${part.slice(0, 1)}***`;
77
+ }
78
+ //# sourceMappingURL=sim-cognito-code-delivery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sim-cognito-code-delivery.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-code-delivery.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB;;GAEG;AACH,MAAM,cAAc,GAAsD;IACxE,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,cAAc;CACpB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAmC;IAEnC,OAAO;QACL,WAAW,EAAE,2BAA2B,CACtC,QAAQ,CAAC,SAAS,EAClB,QAAQ,CAAC,MAAM,CAChB;QACD,cAAc,EAAE,QAAQ,CAAC,MAAM;QAC/B,aAAa,EAAE,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAgB;IAEhB,OAAO;QACL,WAAW,EAAE,2BAA2B,CAAC,QAAQ,EAAE,OAAO,CAAC;QAC3D,cAAc,EAAE,OAAO;QACvB,aAAa,EAAE,cAAc,CAAC,KAAK;KACpC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CACzC,SAAiB,EACjB,MAA+B;IAE/B,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACrB,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;IAED,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;AAClC,C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ions this simulation reaches: a user signing itself
5
- * up, that user asking for another code, an administrator creating a user, and
6
- * a sign-in being challenged for a code sent by text message. Real Cognito
7
- * sends on more of them, a password reset among them, which is not simulated
8
- * here.
4
+ * These are the five occasions this simulation reaches: a user signing itself
5
+ * up, that user asking for another code, an administrator creating a user, a
6
+ * sign-in being challenged for a code sent by text message, and a password
7
+ * being reset. Real Cognito sends on more of them, an attribute being verified
8
+ * among them, which is not simulated here.
9
+ *
10
+ * `ForgotPassword` covers the reset an administrator starts as well as the one
11
+ * the user asks for, because real Cognito sends both under the one
12
+ * `CustomMessage_ForgotPassword` trigger source.
9
13
  *
10
14
  * `SimCognitoTriggerOccasion.customMessage` turns one of these into the
11
15
  * occasion the `CustomMessage` trigger fires for.
12
16
  */
13
- export type SimCognitoMessageOccasion = "SignUp" | "ResendCode" | "AdminCreateUser" | "Authentication";
17
+ export type SimCognitoMessageOccasion = "SignUp" | "ResendCode" | "AdminCreateUser" | "Authentication" | "ForgotPassword";
14
18
  //# sourceMappingURL=sim-cognito-message-occasion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-message-occasion.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-message-occasion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,CAAC"}
1
+ {"version":3,"file":"sim-cognito-message-occasion.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-message-occasion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,YAAY,GACZ,iBAAiB,GACjB,gBAAgB,GAChB,gBAAgB,CAAC"}
@@ -3,6 +3,7 @@ import type { SimCognitoUserPoolClient } from "../client/sim-cognito-user-pool-c
3
3
  import type { SimCognitoUserPool } from "../sim-cognito-user-pool.js";
4
4
  import type { SimCognitoUserPoolTriggers } from "../trigger/sim-cognito-user-pool-triggers.js";
5
5
  import type { SimCognitoUser } from "../user/sim-cognito-user.js";
6
+ import { SimCognitoMessageDelivery } from "./sim-cognito-message-delivery.js";
6
7
  import type { SimCognitoMessageOccasion } from "./sim-cognito-message-occasion.js";
7
8
  interface SimCognitoPoolMessengerProperties {
8
9
  readonly triggers: SimCognitoUserPoolTriggers;
@@ -45,9 +46,11 @@ export declare class SimCognitoPoolMessenger {
45
46
  * `CustomMessage` trigger first so that a handler can write its own.
46
47
  *
47
48
  * A pool with nowhere to write to sends nothing, as one does on real
48
- * Cognito, rather than recording a message addressed to no one.
49
+ * Cognito, rather than recording a message addressed to no one. Where a
50
+ * message did go out, the answer says where, because an operation reporting
51
+ * `CodeDeliveryDetails` has nowhere else to read that from.
49
52
  */
50
- send(request: SimCognitoMessageRequest): Promise<void>;
53
+ send(request: SimCognitoMessageRequest): Promise<SimCognitoMessageDelivery | undefined>;
51
54
  }
52
55
  export {};
53
56
  //# sourceMappingURL=sim-cognito-pool-messenger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-pool-messenger.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-pool-messenger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAKnF,UAAU,iCAAiC;IACzC,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAC;IAC9C,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AO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAKnF,UAAU,iCAAiC;IACzC,QAAQ,CAAC,QAAQ,EAAE,0BAA0B,CAAC;IAC9C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;CAC1B;AAED;;GAEG;AACH,UAAU,wBAAwB;IAChC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,yBAAyB,CAAC;IAE7C;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CACxE;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IAEjC,YAAY,UAAU,EAAE,iCAAiC,EAGxD;IAED;;;;;;;;OAQG;IACG,IAAI,CACR,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC,CA8ChD;CACF"}
@@ -27,12 +27,14 @@ export class SimCognitoPoolMessenger {
27
27
  * `CustomMessage` trigger first so that a handler can write its own.
28
28
  *
29
29
  * A pool with nowhere to write to sends nothing, as one does on real
30
- * Cognito, rather than recording a message addressed to no one.
30
+ * Cognito, rather than recording a message addressed to no one. Where a
31
+ * message did go out, the answer says where, because an operation reporting
32
+ * `CodeDeliveryDetails` has nowhere else to read that from.
31
33
  */
32
34
  async send(request) {
33
35
  const delivery = SimCognitoMessageDelivery.forOccasion(request.pool, request.user, request.occasion);
34
36
  if (delivery === undefined) {
35
- return;
37
+ return undefined;
36
38
  }
37
39
  const { medium } = delivery;
38
40
  const custom = await this.triggers.customMessage(SimCognitoTriggerOccasion.customMessage(request.occasion), {
@@ -57,6 +59,7 @@ export class SimCognitoPoolMessenger {
57
59
  occasion: request.occasion,
58
60
  sentDate: this.clock.now(),
59
61
  }));
62
+ return delivery;
60
63
  }
61
64
  }
62
65
  //# sourceMappingURL=sim-cognito-pool-messenger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-pool-messenger.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-pool-messenger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AA0BtE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,uBAAuB;IACjB,QAAQ,CAA6B;IACrC,KAAK,CAAW;IAEjC,YAAY,UAA6C;QACvD,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAChC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAiC;QAC1C,MAAM,QAAQ,GAAG,yBAAyB,CAAC,WAAW,CACpD,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,QAAQ,CACjB,CAAC;QAEF,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO;QACT,CAAC;QAED,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;QAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,aAAa,CAC9C,yBAAyB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,EACzD;YACE,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,cAAc,EAAE,OAAO,CAAC,cAAc;SACvC,CACF,CAAC;QACF,MAAM,MAAM,GAAG,yBAAyB,CACtC,OAAO,CAAC,IAAI,EACZ,OAAO,CAAC,QAAQ,EAChB,MAAM,CACP,CAAC;QACF,qEAAqE;QACrE,oBAAoB;QACpB,MAAM,YAAY,GAAG,IAAI,6BAA6B,CAAC;YACrD,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ;YAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;SACnB,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAElD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC1B,IAAI,qBAAqB,CAAC;YACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ;YAC/B,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SAC3B,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"sim-cognito-pool-messenger.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/message/sim-cognito-pool-messenger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,6B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,IAAI;SACnB,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAElD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAC1B,IAAI,qBAAqB,CAAC;YACxB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ;YAC/B,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,MAAM;YACN,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SAC3B,CAAC,CACH,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -33,6 +33,14 @@ export declare class SimCognitoTriggerOccasion {
33
33
  * Cognito.
34
34
  */
35
35
  static readonly confirmSignUp: SimCognitoTriggerOccasion;
36
+ /**
37
+ * A user reaching `CONFIRMED` by finishing a password reset.
38
+ *
39
+ * Real Cognito runs `PostConfirmation` for `ConfirmForgotPassword` as well
40
+ * as for a sign-up, under a source of its own, so a handler that creates a
41
+ * profile record on first confirmation can tell the two apart.
42
+ */
43
+ static readonly confirmForgotPassword: SimCognitoTriggerOccasion;
36
44
  /**
37
45
  * A sign-in, before the user's password is checked.
38
46
  */
@@ -74,6 +82,13 @@ export declare class SimCognitoTriggerOccasion {
74
82
  * The invitation an admin-created user is sent.
75
83
  */
76
84
  static readonly customMessageAdminCreateUser: SimCognitoTriggerOccasion;
85
+ /**
86
+ * The code a user resetting a forgotten password is sent.
87
+ *
88
+ * `AdminResetUserPassword` reports this source too, because real Cognito has
89
+ * none of its own for the reset an administrator starts.
90
+ */
91
+ static readonly customMessageForgotPassword: SimCognitoTriggerOccasion;
77
92
  /**
78
93
  * The code a sign-in challenged for a second factor is sent.
79
94
  */
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-trigger-occasion.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,gBAAuB,MAAM,4BAG3B;IAEF;;;;;;OAMG;IACH,gBAAuB,eAAe,4BAGpC;IAEF;;;;;;OAMG;IACH,gBAAuB,aAAa,4BAGlC;IAEF;;OAEG;IACH,gBAAuB,iBAAiB,4BAGtC;IAEF;;OAEG;IACH,gBAAuB,kBAAkB,4BAGvC;IAEF;;OAEG;IACH,gBAAuB,eAAe,4BAGpC;IAEF;;;;;;;OAOG;IACH,gBAAuB,0BAA0B,4BAI7C;IAEJ;;;;;;OAMG;IACH,gBAAuB,sBAAsB,4BAG3C;IAEF;;OAEG;IACH,gBAAuB,mBAAmB,4BAGxC;IAEF;;OAEG;IACH,gBAAuB,uBAAuB,4BAC+B;IAE7E;;OAEG;IACH,gBAAuB,4BAA4B,4BAI/C;IAEJ;;OAEG;IACH,gBAAuB,2BAA2B,4BAI9C;IAEJ,SAAgB,OAAO,EAAE,qBAAqB,CAAC;IAC/C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,eAGN;IAED;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAClB,QAAQ,EAAE,yBAAyB,GAClC,yBAAyB,CAe3B;CACF"}
1
+ {"version":3,"file":"sim-cognito-trigger-occasion.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E;;;;;;;;;;;GAWG;AACH,qBAAa,yBAAyB;IACpC;;OAEG;IACH,gBAAuB,MAAM,4BAG3B;IAEF;;;;;;OAMG;IACH,gBAAuB,eAAe,4BAGpC;IAEF;;;;;;OAMG;IACH,gBAAuB,aAAa,4BAGlC;IAEF;;;;;;OAMG;IACH,gBAAuB,qBAAqB,4BAG1C;IAEF;;OAEG;IACH,gBAAuB,iBAAiB,4BAGtC;IAEF;;OAEG;IACH,gBAAuB,kBAAkB,4BAGvC;IAEF;;OAEG;IACH,gBAAuB,eAAe,4BAGpC;IAEF;;;;;;;OAOG;IACH,gBAAuB,0BAA0B,4BAI7C;IAEJ;;;;;;OAMG;IACH,gBAAuB,sBAAsB,4BAG3C;IAEF;;OAEG;IACH,gBAAuB,mBAAmB,4BAGxC;IAEF;;OAEG;IACH,gBAAuB,uBAAuB,4BAC+B;IAE7E;;OAEG;IACH,gBAAuB,4BAA4B,4BAI/C;IAEJ;;;;;OAKG;IACH,gBAAuB,2BAA2B,4BAI9C;IAEJ;;OAEG;IACH,gBAAuB,2BAA2B,4BAI9C;IAEJ,SAAgB,OAAO,EAAE,qBAAqB,CAAC;IAC/C,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,eAGN;IAED;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAClB,QAAQ,EAAE,yBAAyB,GAClC,yBAAyB,CAkB3B;CACF"}
@@ -31,6 +31,14 @@ export class SimCognitoTriggerOccasion {
31
31
  * Cognito.
32
32
  */
33
33
  static confirmSignUp = new SimCognitoTriggerOccasion("PostConfirmation", "PostConfirmation_ConfirmSignUp");
34
+ /**
35
+ * A user reaching `CONFIRMED` by finishing a password reset.
36
+ *
37
+ * Real Cognito runs `PostConfirmation` for `ConfirmForgotPassword` as well
38
+ * as for a sign-up, under a source of its own, so a handler that creates a
39
+ * profile record on first confirmation can tell the two apart.
40
+ */
41
+ static confirmForgotPassword = new SimCognitoTriggerOccasion("PostConfirmation", "PostConfirmation_ConfirmForgotPassword");
34
42
  /**
35
43
  * A sign-in, before the user's password is checked.
36
44
  */
@@ -72,6 +80,13 @@ export class SimCognitoTriggerOccasion {
72
80
  * The invitation an admin-created user is sent.
73
81
  */
74
82
  static customMessageAdminCreateUser = new SimCognitoTriggerOccasion("CustomMessage", "CustomMessage_AdminCreateUser");
83
+ /**
84
+ * The code a user resetting a forgotten password is sent.
85
+ *
86
+ * `AdminResetUserPassword` reports this source too, because real Cognito has
87
+ * none of its own for the reset an administrator starts.
88
+ */
89
+ static customMessageForgotPassword = new SimCognitoTriggerOccasion("CustomMessage", "CustomMessage_ForgotPassword");
75
90
  /**
76
91
  * The code a sign-in challenged for a second factor is sent.
77
92
  */
@@ -103,6 +118,9 @@ export class SimCognitoTriggerOccasion {
103
118
  case "Authentication": {
104
119
  return this.customMessageAuthentication;
105
120
  }
121
+ case "ForgotPassword": {
122
+ return this.customMessageForgotPassword;
123
+ }
106
124
  }
107
125
  }
108
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-trigger-occasion.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAU,MAAM,GAAG,IAAI,yBAAyB,CAC3D,WAAW,EACX,kBAAkB,CACnB,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,CAAU,eAAe,GAAG,IAAI,yBAAyB,CACpE,WAAW,EACX,2BAA2B,CAC5B,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,CAAU,aAAa,GAAG,IAAI,yBAAyB,CAClE,kBAAkB,EAClB,gCAAgC,CACjC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,iBAAiB,GAAG,IAAI,yBAAyB,CACtE,mBAAmB,EACnB,kCAAkC,CACnC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,kBAAkB,GAAG,IAAI,yBAAyB,CACvE,oBAAoB,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C;YACD,KAAK,gBAAgB,EAAE,CAAC;gBACtB,OAAO,IAAI,CAAC,2BAA2B,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"sim-cognito-trigger-occasion.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-trigger-occasion.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,yBAAyB;IACpC;;OAEG;IACI,MAAM,CAAU,MAAM,GAAG,IAAI,yBAAyB,CAC3D,WAAW,EACX,kBAAkB,CACnB,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,CAAU,eAAe,GAAG,IAAI,yBAAyB,CACpE,WAAW,EACX,2BAA2B,CAC5B,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,CAAU,aAAa,GAAG,IAAI,yBAAyB,CAClE,kBAAkB,EAClB,gCAAgC,CACjC,CAAC;IAEF;;;;;;OAMG;IACI,MAAM,CAAU,qBAAqB,GAAG,IAAI,yBAAyB,CAC1E,kBAAkB,EAClB,wCAAwC,CACzC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,iBAAiB,GAAG,IAAI,yBAAyB,CACtE,mBAAmB,EACnB,kCAAkC,CACnC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,kBAAkB,GAAG,IAAI,yBAAyB,CACvE,oBAAoB,EACpB,mCAAmC,CACpC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,eAAe,GAAG,IAAI,yBAAyB,CACpE,oBAAoB,EACpB,gCAAgC,CACjC,CAAC;IAEF;;;;;;;OAOG;IACI,MAAM,CAAU,0BAA0B,GAC/C,IAAI,yBAAyB,CAC3B,oBAAoB,EACpB,sCAAsC,CACvC,CAAC;IAEJ;;;;;;OAMG;IACI,MAAM,CAAU,sBAAsB,GAAG,IAAI,yBAAyB,CAC3E,oBAAoB,EACpB,+BAA+B,CAChC,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,mBAAmB,GAAG,IAAI,yBAAyB,CACxE,eAAe,EACf,sBAAsB,CACvB,CAAC;IAEF;;OAEG;IACI,MAAM,CAAU,uBAAuB,GAC5C,IAAI,yBAAyB,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAC;IAE7E;;OAEG;IACI,MAAM,CAAU,4BAA4B,GACjD,IAAI,yBAAyB,CAC3B,eAAe,EACf,+BAA+B,CAChC,CAAC;IAEJ;;;;;OAKG;IACI,MAAM,CAAU,2BAA2B,GAChD,IAAI,yBAAyB,CAC3B,eAAe,EACf,8BAA8B,CAC/B,CAAC;IAEJ;;OAEG;IACI,MAAM,CAAU,2BAA2B,GAChD,IAAI,yBAAyB,CAC3B,eAAe,EACf,8BAA8B,CAC/B,CAAC;IAEY,OAAO,CAAwB;IAC/B,MAAM,CAAS;IAE/B,YAAoB,OAA8B,EAAE,MAAc;QAChE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,aAAa,CAClB,QAAmC;QAEnC,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,QAAQ,EAAE,CAAC;gBACd,OAAO,IAAI,CAAC,mBAAmB,CAAC;YAClC,CAAC;YACD,KAAK,YAAY,EAAE,CAAC;gBAClB,OAAO,IAAI,CAAC,uBAAuB,CAAC;YACtC,CAAC;YACD,KAAK,iBAAiB,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC,4BAA4B,CAAC;YAC3C,CAAC;YACD,KAAK,gBAAgB,EAAE,CAAC;gBACtB,OAAO,IAAI,CAAC,2BAA2B,CAAC;YAC1C,CAAC;YACD,KAAK,gBAAgB,EAAE,CAAC;gBACtB,OAAO,IAAI,CAAC,2BAA2B,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -39,8 +39,11 @@ export declare class SimCognitoUserPoolTriggers {
39
39
  * request without undoing the confirmation: the user stays confirmed, exactly
40
40
  * as on real Cognito. `AdminCreateUser` never reaches here, as it never
41
41
  * reaches it on real Cognito.
42
+ *
43
+ * The occasion is what tells a sign-up being confirmed from a password being
44
+ * reset, which real Cognito reports as two sources of the one trigger.
42
45
  */
43
- postConfirmation(context: SimCognitoTriggerContext): Promise<void>;
46
+ postConfirmation(occasion: SimCognitoTriggerOccasion, context: SimCognitoTriggerContext): Promise<void>;
44
47
  /**
45
48
  * Run the `CustomMessage` trigger, if the pool has one, and read what it
46
49
  * wrote.
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-user-pool-triggers.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAErF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,UAAU,oCAAoC;IAC5C,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwC;IAExE,YAAY,UAAU,EAAE,oCAAoC,EAE3D;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CACb,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,2BAA2B,CAAC,CAItC;IAED;;;;;;;OAOG;IACG,gBAAgB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvE;IAED;;;;;;;;OAQG;IACG,aAAa,CACjB,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAIlC;IAED;;;;;;OAMG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE;IAED;;;;;;OAMG;IACG,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzE;IAED;;;;;;;OAOG;IACG,kBAAkB,CACtB,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CAInC;CACF"}
1
+ {"version":3,"file":"sim-cognito-user-pool-triggers.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAErF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,UAAU,oCAAoC;IAC5C,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,qBAAa,0BAA0B;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA8B;IACzD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAwC;IAExE,YAAY,UAAU,EAAE,oCAAoC,EAE3D;IAED;;;;;;;;;;;OAWG;IACG,SAAS,CACb,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,2BAA2B,CAAC,CAItC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IACG,aAAa,CACjB,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC,CAIlC;IAED;;;;;;OAMG;IACG,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxE;IAED;;;;;;OAMG;IACG,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKzE;IAED;;;;;;;OAOG;IACG,kBAAkB,CACtB,QAAQ,EAAE,yBAAyB,EACnC,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,wBAAwB,CAAC,CAInC;CACF"}
@@ -39,9 +39,12 @@ export class SimCognitoUserPoolTriggers {
39
39
  * request without undoing the confirmation: the user stays confirmed, exactly
40
40
  * as on real Cognito. `AdminCreateUser` never reaches here, as it never
41
41
  * reaches it on real Cognito.
42
+ *
43
+ * The occasion is what tells a sign-up being confirmed from a password being
44
+ * reset, which real Cognito reports as two sources of the one trigger.
42
45
  */
43
- async postConfirmation(context) {
44
- await this.invocation.run(SimCognitoTriggerOccasion.confirmSignUp, context);
46
+ async postConfirmation(occasion, context) {
47
+ await this.invocation.run(occasion, context);
45
48
  }
46
49
  /**
47
50
  * Run the `CustomMessage` trigger, if the pool has one, and read what it
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-user-pool-triggers.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAA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AyB,CAAC,kBAAkB,EAC5C,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,kBAAkB,CACtB,QAAmC,EACnC,OAAiC;QAEjC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAC9B,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"sim-cognito-user-pool-triggers.js","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/trigger/sim-cognito-user-pool-triggers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAM9E;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA0B;IACpB,UAAU,CAA8B;IACxC,eAAe,GAAG,IAAI,8BAA8B,EAAE,CAAC;IAExE,YAAY,UAAgD;QAC1D,IAAI,CAAC,UAAU,GAAG,IAAI,2BAA2B,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,SAAS,CACb,QAAmC,EACnC,OAAiC;QAEjC,OAAO,IAAI,2BAA2B,CACpC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,gBAAgB,CACpB,QAAmC,EACnC,OAAiC;QAEjC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,aAAa,CACjB,QAAmC,EACnC,OAAiC;QAEjC,OAAO,IAAI,uBAAuB,CAChC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,iBAAiB,CAAC,OAAiC;QACvD,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACvB,yBAAyB,CAAC,iBAAiB,EAC3C,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAiC;QACxD,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CACvB,yBAAyB,CAAC,kBAAkB,EAC5C,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,kBAAkB,CACtB,QAAmC,EACnC,OAAiC;QAEjC,OAAO,IAAI,CAAC,eAAe,CAAC,IAAI,CAC9B,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,CAC7C,CAAC;IACJ,CAAC;CACF"}
@@ -1,11 +1,13 @@
1
1
  import type { SimCognitoUserStatus } from "./sim-cognito-user-status.js";
2
2
  /**
3
- * The confirmation one user has outstanding.
3
+ * The code one user has outstanding.
4
4
  *
5
- * A user that signed itself up holds a code until it confirms, and a user that
6
- * did not holds none. Keeping the code and what it answers together is the
7
- * same modelling choice `SimCognitoUserPassword` makes: the user asks whether
8
- * a candidate is right, rather than reading the value out to compare it.
5
+ * A user that signed itself up holds one until it confirms, a user that asked
6
+ * to reset a forgotten password holds one until it sets the new one, and a
7
+ * user doing neither holds none. Keeping the code and what it answers together
8
+ * is the same modelling choice `SimCognitoUserPassword` makes: the user asks
9
+ * whether a candidate is right, rather than reading the value out to compare
10
+ * it.
9
11
  *
10
12
  * The value is readable, unlike a password, because nothing here delivers the
11
13
  * message that would carry it.
@@ -25,11 +27,17 @@ export declare class SimCognitoUserConfirmation {
25
27
  * Follow the user to a status.
26
28
  *
27
29
  * A user waiting to be confirmed holds a code, and one that has left
28
- * `UNCONFIRMED` has spent it: a code confirms one sign-up and no more.
30
+ * `UNCONFIRMED` has spent it: a code confirms one sign-up and no more. A
31
+ * user an administrator has sent to `RESET_REQUIRED` is issued its code
32
+ * after the move, because the code is what the reset is answered with.
29
33
  */
30
34
  settle(status: SimCognitoUserStatus): void;
31
35
  /**
32
36
  * Refuse a candidate that is not the code outstanding.
37
+ *
38
+ * A user holding no code at all is refused as having an expired one, which
39
+ * is what real Cognito answers a code that has already been spent with.
40
+ * Nothing here ages a code out, so that is the only way to reach it.
33
41
  */
34
42
  require(candidate: string | undefined): void;
35
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sim-cognito-user-confirmation.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/user/sim-cognito-user-confirmation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,qBAAa,0BAA0B;;IAGrC,YAAY,MAAM,EAAE,oBAAoB,EAEvC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAIzC;IAED;;OAEG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAM3C;CACF"}
1
+ {"version":3,"file":"sim-cognito-user-confirmation.d.ts","sourceRoot":"","sources":["../../../../../src/service/cognito/user-pool/user/sim-cognito-user-confirmation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE;;;;;;;;;;;;GAYG;AACH,qBAAa,0BAA0B;;IAGrC,YAAY,MAAM,EAAE,oBAAoB,EAEvC;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,GAAG,SAAS,CAE7B;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAIzC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAY3C;CACF"}
@@ -1,12 +1,14 @@
1
- import { SimCognitoCodeMismatchException } from "../../error/sim-cognito.error.js";
1
+ import { SimCognitoCodeMismatchException, SimCognitoExpiredCodeException, } from "../../error/sim-cognito.error.js";
2
2
  import { SimCognitoConfirmationCode } from "./sim-cognito-confirmation-code.js";
3
3
  /**
4
- * The confirmation one user has outstanding.
4
+ * The code one user has outstanding.
5
5
  *
6
- * A user that signed itself up holds a code until it confirms, and a user that
7
- * did not holds none. Keeping the code and what it answers together is the
8
- * same modelling choice `SimCognitoUserPassword` makes: the user asks whether
9
- * a candidate is right, rather than reading the value out to compare it.
6
+ * A user that signed itself up holds one until it confirms, a user that asked
7
+ * to reset a forgotten password holds one until it sets the new one, and a
8
+ * user doing neither holds none. Keeping the code and what it answers together
9
+ * is the same modelling choice `SimCognitoUserPassword` makes: the user asks
10
+ * whether a candidate is right, rather than reading the value out to compare
11
+ * it.
10
12
  *
11
13
  * The value is readable, unlike a password, because nothing here delivers the
12
14
  * message that would carry it.
@@ -32,18 +34,27 @@ export class SimCognitoUserConfirmation {
32
34
  * Follow the user to a status.
33
35
  *
34
36
  * A user waiting to be confirmed holds a code, and one that has left
35
- * `UNCONFIRMED` has spent it: a code confirms one sign-up and no more.
37
+ * `UNCONFIRMED` has spent it: a code confirms one sign-up and no more. A
38
+ * user an administrator has sent to `RESET_REQUIRED` is issued its code
39
+ * after the move, because the code is what the reset is answered with.
36
40
  */
37
41
  settle(status) {
38
- this.#code = status.isUnconfirmed
42
+ this.#code = status.holdsCode
39
43
  ? SimCognitoConfirmationCode.issue()
40
44
  : undefined;
41
45
  }
42
46
  /**
43
47
  * Refuse a candidate that is not the code outstanding.
48
+ *
49
+ * A user holding no code at all is refused as having an expired one, which
50
+ * is what real Cognito answers a code that has already been spent with.
51
+ * Nothing here ages a code out, so that is the only way to reach it.
44
52
  */
45
53
  require(candidate) {
46
- if (this.#code?.matches(candidate) !== true) {
54
+ if (this.#code === undefined) {
55
+ throw new SimCognitoExpiredCodeException("Invalid code provided, please request a code again.");
56
+ }
57
+ if (!this.#code.matches(candidate)) {
47
58
  throw new SimCognitoCodeMismatchException("Invalid verification code provided, please try again.");
48
59
  }
49
60
  }