quidproquo-actionprocessor-awslambda 0.1.10 → 0.1.12

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 (1118) hide show
  1. package/lib/commonjs/awsLambdaUtils.d.ts +6 -4
  2. package/lib/commonjs/awsLambdaUtils.js +2 -2
  3. package/lib/commonjs/awsLambdaUtils.js.map +1 -1
  4. package/lib/commonjs/awsNamingUtils.d.ts +2 -2
  5. package/lib/commonjs/awsNamingUtils.js +60 -109
  6. package/lib/commonjs/awsNamingUtils.js.map +1 -1
  7. package/lib/commonjs/getActionProcessor/core/ai/getAiPromptActionProcessor.js +2 -2
  8. package/lib/commonjs/getActionProcessor/core/ai/getAiPromptActionProcessor.js.map +1 -1
  9. package/lib/commonjs/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js +6 -6
  10. package/lib/commonjs/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js.map +1 -1
  11. package/lib/commonjs/getActionProcessor/core/ai/logic/prepareAiPromptCall.d.ts +4 -3
  12. package/lib/commonjs/getActionProcessor/core/ai/logic/prepareAiPromptCall.js.map +1 -1
  13. package/lib/commonjs/getActionProcessor/core/ai/logic/toCacheableMessages.js +1 -1
  14. package/lib/commonjs/getActionProcessor/core/ai/logic/toCacheableMessages.js.map +1 -1
  15. package/lib/commonjs/getActionProcessor/core/apiKeyValidation/getApiKeyValidationValidateActionProcessor.js +10 -8
  16. package/lib/commonjs/getActionProcessor/core/apiKeyValidation/getApiKeyValidationValidateActionProcessor.js.map +1 -1
  17. package/lib/commonjs/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +2 -2
  18. package/lib/commonjs/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js.map +1 -1
  19. package/lib/commonjs/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +2 -2
  20. package/lib/commonjs/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js.map +1 -1
  21. package/lib/commonjs/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js +2 -2
  22. package/lib/commonjs/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js.map +1 -1
  23. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.d.ts +2 -0
  24. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.js +53 -0
  25. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.js.map +1 -0
  26. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.d.ts +2 -0
  27. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.js +45 -0
  28. package/lib/commonjs/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.js.map +1 -0
  29. package/lib/commonjs/getActionProcessor/core/crypto/index.d.ts +2 -0
  30. package/lib/commonjs/{lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.js → getActionProcessor/core/crypto/index.js} +7 -5
  31. package/lib/commonjs/getActionProcessor/core/crypto/index.js.map +1 -0
  32. package/lib/commonjs/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.d.ts +2 -0
  33. package/lib/commonjs/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.js +11 -0
  34. package/lib/commonjs/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.js.map +1 -0
  35. package/lib/commonjs/getActionProcessor/core/crypto/utils/index.d.ts +2 -0
  36. package/lib/commonjs/getActionProcessor/core/crypto/utils/index.js +19 -0
  37. package/lib/commonjs/getActionProcessor/core/crypto/utils/index.js.map +1 -0
  38. package/lib/commonjs/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.d.ts +2 -0
  39. package/lib/commonjs/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.js +19 -0
  40. package/lib/commonjs/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.js.map +1 -0
  41. package/lib/commonjs/getActionProcessor/core/event/cognito/createAuthChallenge/getEventGetRecordsActionProcessor.js +2 -2
  42. package/lib/commonjs/getActionProcessor/core/event/cognito/createAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  43. package/lib/commonjs/getActionProcessor/core/event/cognito/defineAuthChallenge/getEventGetRecordsActionProcessor.js +2 -2
  44. package/lib/commonjs/getActionProcessor/core/event/cognito/defineAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  45. package/lib/commonjs/getActionProcessor/core/event/cognito/verifyAuthChallenge/getEventGetRecordsActionProcessor.js +2 -2
  46. package/lib/commonjs/getActionProcessor/core/event/cognito/verifyAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  47. package/lib/commonjs/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getEventMatchStoryActionProcessor.js.map +1 -1
  48. package/lib/commonjs/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +13 -10
  49. package/lib/commonjs/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js.map +1 -1
  50. package/lib/commonjs/getActionProcessor/core/file/getFileDeleteActionProcessor.js +4 -8
  51. package/lib/commonjs/getActionProcessor/core/file/getFileDeleteActionProcessor.js.map +1 -1
  52. package/lib/commonjs/getActionProcessor/core/file/getFileExistsActionProcessor.js +1 -1
  53. package/lib/commonjs/getActionProcessor/core/file/getFileExistsActionProcessor.js.map +1 -1
  54. package/lib/commonjs/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js +2 -1
  55. package/lib/commonjs/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js.map +1 -1
  56. package/lib/commonjs/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +2 -1
  57. package/lib/commonjs/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js.map +1 -1
  58. package/lib/commonjs/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js +2 -1
  59. package/lib/commonjs/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js.map +1 -1
  60. package/lib/commonjs/getActionProcessor/core/file/getFileWriteObjectJsonActionProcessor.js +2 -1
  61. package/lib/commonjs/getActionProcessor/core/file/getFileWriteObjectJsonActionProcessor.js.map +1 -1
  62. package/lib/commonjs/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +2 -1
  63. package/lib/commonjs/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js.map +1 -1
  64. package/lib/commonjs/getActionProcessor/core/file/utils/StorageDriveNotFoundError.d.ts +3 -0
  65. package/lib/commonjs/getActionProcessor/core/file/utils/StorageDriveNotFoundError.js +14 -0
  66. package/lib/commonjs/getActionProcessor/core/file/utils/StorageDriveNotFoundError.js.map +1 -0
  67. package/lib/commonjs/getActionProcessor/core/file/utils/index.d.ts +1 -0
  68. package/lib/commonjs/getActionProcessor/core/file/utils/index.js +1 -0
  69. package/lib/commonjs/getActionProcessor/core/file/utils/index.js.map +1 -1
  70. package/lib/commonjs/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.d.ts +5 -0
  71. package/lib/commonjs/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.js +7 -1
  72. package/lib/commonjs/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.js.map +1 -1
  73. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/converters/askConvertNeptuneQueryResultToGraphQueryResult.js +1 -1
  74. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/converters/askConvertNeptuneQueryResultToGraphQueryResult.js.map +1 -1
  75. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/AnyNeptuneResult.d.ts +4 -0
  76. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/{neptune.js → AnyNeptuneResult.js} +1 -1
  77. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/AnyNeptuneResult.js.map +1 -0
  78. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.d.ts +4 -0
  79. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.js +3 -0
  80. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.js.map +1 -0
  81. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.d.ts +4 -0
  82. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.js +3 -0
  83. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.js.map +1 -0
  84. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.d.ts +4 -0
  85. package/lib/commonjs/{lambdaHandlers/types/QpqWarmLambdaEvent.js → getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.js} +1 -1
  86. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.js.map +1 -0
  87. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.d.ts +5 -0
  88. package/lib/commonjs/{runtimeConfig/QPQAWSResourceMap.js → getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.js} +1 -1
  89. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.js.map +1 -0
  90. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.d.ts +4 -0
  91. package/lib/commonjs/{lambdas/lambda-utils/QpqWarmLambdaEvent.js → getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.js} +1 -1
  92. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.js.map +1 -0
  93. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.d.ts +7 -0
  94. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.js +3 -0
  95. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.js.map +1 -0
  96. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.d.ts +1 -0
  97. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.js +3 -0
  98. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.js.map +1 -0
  99. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/index.d.ts +8 -1
  100. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/index.js +8 -1
  101. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/index.js.map +1 -1
  102. package/lib/commonjs/getActionProcessor/core/index.d.ts +1 -0
  103. package/lib/commonjs/getActionProcessor/core/index.js +3 -1
  104. package/lib/commonjs/getActionProcessor/core/index.js.map +1 -1
  105. package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js +2 -1
  106. package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js.map +1 -1
  107. package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js +2 -2
  108. package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js.map +1 -1
  109. package/lib/commonjs/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js +13 -12
  110. package/lib/commonjs/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js.map +1 -1
  111. package/lib/commonjs/getActionProcessor/core/system/getDateNow.d.ts +1 -0
  112. package/lib/commonjs/getActionProcessor/core/system/getDateNow.js +8 -0
  113. package/lib/commonjs/getActionProcessor/core/system/getDateNow.js.map +1 -0
  114. package/lib/commonjs/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.d.ts +0 -1
  115. package/lib/commonjs/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.js +4 -5
  116. package/lib/commonjs/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.js.map +1 -1
  117. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryAuthenticateUserActionProcessor.js.map +1 -1
  118. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryCreateUserActionProcessor.js.map +1 -1
  119. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js +1 -1
  120. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js.map +1 -1
  121. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js +1 -1
  122. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js.map +1 -1
  123. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js +4 -1
  124. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js.map +1 -1
  125. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryReadAccessTokenActionProcessor.js +7 -3
  126. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryReadAccessTokenActionProcessor.js.map +1 -1
  127. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js +1 -1
  128. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js.map +1 -1
  129. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js +2 -2
  130. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js.map +1 -1
  131. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js +1 -1
  132. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js.map +1 -1
  133. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js +1 -1
  134. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js.map +1 -1
  135. package/lib/commonjs/getActionProcessor/index.js +1 -2
  136. package/lib/commonjs/getActionProcessor/index.js.map +1 -1
  137. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.d.ts +2 -0
  138. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js +43 -0
  139. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js.map +1 -0
  140. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.d.ts +2 -0
  141. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js +26 -0
  142. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js.map +1 -0
  143. package/lib/commonjs/getActionProcessor/webserver/email/index.d.ts +2 -0
  144. package/lib/commonjs/{logic/cognito/verifyJwt.js → getActionProcessor/webserver/email/index.js} +7 -8
  145. package/lib/commonjs/getActionProcessor/webserver/email/index.js.map +1 -0
  146. package/lib/commonjs/getActionProcessor/webserver/index.d.ts +2 -1
  147. package/lib/commonjs/getActionProcessor/webserver/index.js +3 -1
  148. package/lib/commonjs/getActionProcessor/webserver/index.js.map +1 -1
  149. package/lib/commonjs/getActionProcessor/webserver/serviceFunction/getServiceFunctionExecuteActionProcessor.js.map +1 -1
  150. package/lib/commonjs/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +2 -2
  151. package/lib/commonjs/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js.map +1 -1
  152. package/lib/commonjs/getLambdaEntries.d.ts +4 -0
  153. package/lib/commonjs/getLambdaEntries.js +7 -1
  154. package/lib/commonjs/getLambdaEntries.js.map +1 -1
  155. package/lib/commonjs/index.d.ts +1 -1
  156. package/lib/commonjs/index.js +4 -3
  157. package/lib/commonjs/index.js.map +1 -1
  158. package/lib/commonjs/lambdaExtensions/logExtensionPort.js +1 -1
  159. package/lib/commonjs/lambdaExtensions/logExtensionPort.js.map +1 -1
  160. package/lib/commonjs/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.d.ts +1 -1
  161. package/lib/commonjs/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.js +4 -3
  162. package/lib/commonjs/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.js.map +1 -1
  163. package/lib/commonjs/lambdaHandlers/getApiGatewayEventHandler.js +2 -4
  164. package/lib/commonjs/lambdaHandlers/getApiGatewayEventHandler.js.map +1 -1
  165. package/lib/commonjs/lambdaHandlers/getApiGatewayEventHandler_redirect.js +8 -4
  166. package/lib/commonjs/lambdaHandlers/getApiGatewayEventHandler_redirect.js.map +1 -1
  167. package/lib/commonjs/lambdaHandlers/getApiGatwayEventWebsocketWithIdentity_websocketEvent.js +2 -6
  168. package/lib/commonjs/lambdaHandlers/getApiGatwayEventWebsocketWithIdentity_websocketEvent.js.map +1 -1
  169. package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_originRequest.js +2 -6
  170. package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_originRequest.js.map +1 -1
  171. package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.d.ts +0 -19
  172. package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +6 -9
  173. package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js.map +1 -1
  174. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_createAuthChallenge.js +2 -6
  175. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_createAuthChallenge.js.map +1 -1
  176. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_customMessage.js +2 -6
  177. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_customMessage.js.map +1 -1
  178. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_defineAuthChallenge.js +2 -6
  179. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_defineAuthChallenge.js.map +1 -1
  180. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_verifyAuthChallenge.js +2 -6
  181. package/lib/commonjs/lambdaHandlers/getCustomMessageTriggerEvent_verifyAuthChallenge.js.map +1 -1
  182. package/lib/commonjs/lambdaHandlers/getEventBridgeEvent_recurringSchedule.js +3 -7
  183. package/lib/commonjs/lambdaHandlers/getEventBridgeEvent_recurringSchedule.js.map +1 -1
  184. package/lib/commonjs/lambdaHandlers/getEventBridgeEvent_stackDeploy.js +2 -6
  185. package/lib/commonjs/lambdaHandlers/getEventBridgeEvent_stackDeploy.js.map +1 -1
  186. package/lib/commonjs/lambdaHandlers/getS3Event_fileEvent.js +2 -6
  187. package/lib/commonjs/lambdaHandlers/getS3Event_fileEvent.js.map +1 -1
  188. package/lib/commonjs/lambdaHandlers/getSqsEvent_queueEvent.js +2 -6
  189. package/lib/commonjs/lambdaHandlers/getSqsEvent_queueEvent.js.map +1 -1
  190. package/lib/commonjs/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.d.ts +5 -0
  191. package/lib/commonjs/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.js +5 -0
  192. package/lib/commonjs/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.js.map +1 -1
  193. package/lib/commonjs/lambdaHandlers/helpers/getBlankStorySession.d.ts +6 -0
  194. package/lib/commonjs/lambdaHandlers/helpers/getBlankStorySession.js +13 -0
  195. package/lib/commonjs/lambdaHandlers/helpers/getBlankStorySession.js.map +1 -0
  196. package/lib/commonjs/lambdaHandlers/helpers/getLogger.d.ts +8 -0
  197. package/lib/commonjs/lambdaHandlers/helpers/{logger.js → getLogger.js} +22 -31
  198. package/lib/commonjs/lambdaHandlers/helpers/getLogger.js.map +1 -0
  199. package/lib/commonjs/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.d.ts +4 -0
  200. package/lib/commonjs/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.js +17 -13
  201. package/lib/commonjs/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.js.map +1 -1
  202. package/lib/commonjs/lambdaHandlers/helpers/index.d.ts +3 -1
  203. package/lib/commonjs/lambdaHandlers/helpers/index.js +3 -1
  204. package/lib/commonjs/lambdaHandlers/helpers/index.js.map +1 -1
  205. package/lib/commonjs/lambdaHandlers/helpers/isSnsWarmerRecord.d.ts +6 -0
  206. package/lib/commonjs/lambdaHandlers/helpers/isSnsWarmerRecord.js +23 -0
  207. package/lib/commonjs/lambdaHandlers/helpers/isSnsWarmerRecord.js.map +1 -0
  208. package/lib/commonjs/lambdaHandlers/types/QpqFunctionExecutionEvent.d.ts +7 -0
  209. package/lib/commonjs/lambdaHandlers/types/QpqFunctionExecutionEvent.js +3 -0
  210. package/lib/commonjs/lambdaHandlers/types/QpqFunctionExecutionEvent.js.map +1 -0
  211. package/lib/commonjs/lambdaHandlers/types/index.d.ts +1 -1
  212. package/lib/commonjs/lambdaHandlers/types/index.js +1 -1
  213. package/lib/commonjs/lambdaHandlers/types/index.js.map +1 -1
  214. package/lib/commonjs/lambdas/anyExecuteServiceFunctionEvent_serviceFunction.d.ts +1 -1
  215. package/lib/commonjs/lambdas/cloudFrontRequestEvent_viewerRequest.js +0 -1
  216. package/lib/commonjs/lambdas/cloudFrontRequestEvent_viewerRequest.js.map +1 -1
  217. package/lib/commonjs/lambdas/dynamicModuleLoader/dynamicModuleLoader.js.map +1 -1
  218. package/lib/commonjs/lambdas/dynamicModuleLoader/index.d.ts +0 -1
  219. package/lib/commonjs/lambdas/dynamicModuleLoader/index.js +0 -1
  220. package/lib/commonjs/lambdas/dynamicModuleLoader/index.js.map +1 -1
  221. package/lib/commonjs/lambdas/index.js +4 -0
  222. package/lib/commonjs/lambdas/index.js.map +1 -1
  223. package/lib/commonjs/logic/apiGateway/sendMessageToWebSocketConnection.d.ts +2 -0
  224. package/lib/commonjs/logic/apiGateway/{websocketSendMessage.js → sendMessageToWebSocketConnection.js} +7 -7
  225. package/lib/commonjs/logic/apiGateway/sendMessageToWebSocketConnection.js.map +1 -0
  226. package/lib/commonjs/logic/cache/memoFunc.d.ts +5 -2
  227. package/lib/commonjs/logic/cache/memoFunc.js +3 -5
  228. package/lib/commonjs/logic/cache/memoFunc.js.map +1 -1
  229. package/lib/commonjs/logic/cache/memoFuncAsync.d.ts +5 -2
  230. package/lib/commonjs/logic/cache/memoFuncAsync.js +4 -3
  231. package/lib/commonjs/logic/cache/memoFuncAsync.js.map +1 -1
  232. package/lib/commonjs/logic/cloudFront/invalidateCache.d.ts +0 -1
  233. package/lib/commonjs/logic/cloudFront/invalidateCache.js +7 -10
  234. package/lib/commonjs/logic/cloudFront/invalidateCache.js.map +1 -1
  235. package/lib/commonjs/logic/cloudformation/getExportedValue.d.ts +4 -0
  236. package/lib/commonjs/logic/cloudformation/getExportedValue.js +4 -0
  237. package/lib/commonjs/logic/cloudformation/getExportedValue.js.map +1 -1
  238. package/lib/commonjs/logic/cognito/authenticateUser.d.ts +4 -0
  239. package/lib/commonjs/logic/cognito/authenticateUser.js +8 -3
  240. package/lib/commonjs/logic/cognito/authenticateUser.js.map +1 -1
  241. package/lib/commonjs/logic/cognito/cognitoAttributeMap.d.ts +1 -9
  242. package/lib/commonjs/logic/cognito/cognitoAttributeMap.js +2 -36
  243. package/lib/commonjs/logic/cognito/cognitoAttributeMap.js.map +1 -1
  244. package/lib/commonjs/logic/cognito/confirmForgotPassword.d.ts +4 -0
  245. package/lib/commonjs/logic/cognito/confirmForgotPassword.js +5 -3
  246. package/lib/commonjs/logic/cognito/confirmForgotPassword.js.map +1 -1
  247. package/lib/commonjs/logic/cognito/createUser.d.ts +4 -0
  248. package/lib/commonjs/logic/cognito/createUser.js +9 -6
  249. package/lib/commonjs/logic/cognito/createUser.js.map +1 -1
  250. package/lib/commonjs/logic/cognito/decodeAccessToken.d.ts +11 -0
  251. package/lib/commonjs/logic/cognito/decodeAccessToken.js +24 -5
  252. package/lib/commonjs/logic/cognito/decodeAccessToken.js.map +1 -1
  253. package/lib/commonjs/logic/cognito/decodeValidJwt.d.ts +8 -2
  254. package/lib/commonjs/logic/cognito/decodeValidJwt.js +15 -9
  255. package/lib/commonjs/logic/cognito/decodeValidJwt.js.map +1 -1
  256. package/lib/commonjs/logic/cognito/forgotPassword.js +2 -6
  257. package/lib/commonjs/logic/cognito/forgotPassword.js.map +1 -1
  258. package/lib/commonjs/logic/cognito/getCognitoJwksClient.d.ts +7 -0
  259. package/lib/commonjs/logic/cognito/getCognitoJwksClient.js +15 -0
  260. package/lib/commonjs/logic/cognito/getCognitoJwksClient.js.map +1 -0
  261. package/lib/commonjs/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.d.ts +8 -0
  262. package/lib/commonjs/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.js +20 -0
  263. package/lib/commonjs/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.js.map +1 -0
  264. package/lib/commonjs/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.d.ts +7 -0
  265. package/lib/commonjs/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.js +22 -0
  266. package/lib/commonjs/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.js.map +1 -0
  267. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoStringMap.d.ts +6 -0
  268. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoStringMap.js +17 -0
  269. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoStringMap.js.map +1 -0
  270. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoUserAttributes.d.ts +4 -0
  271. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoUserAttributes.js +14 -0
  272. package/lib/commonjs/logic/cognito/getQpqAttributesFromCognitoUserAttributes.js.map +1 -0
  273. package/lib/commonjs/logic/cognito/getUserAttributes.js +5 -7
  274. package/lib/commonjs/logic/cognito/getUserAttributes.js.map +1 -1
  275. package/lib/commonjs/logic/cognito/getUserAttributesBySub.js +19 -4
  276. package/lib/commonjs/logic/cognito/getUserAttributesBySub.js.map +1 -1
  277. package/lib/commonjs/logic/cognito/getUserPoolClientSecret.d.ts +8 -0
  278. package/lib/commonjs/logic/cognito/getUserPoolClientSecret.js +20 -5
  279. package/lib/commonjs/logic/cognito/getUserPoolClientSecret.js.map +1 -1
  280. package/lib/commonjs/logic/cognito/index.js +3 -0
  281. package/lib/commonjs/logic/cognito/index.js.map +1 -1
  282. package/lib/commonjs/logic/cognito/listPagedUsers.js +2 -6
  283. package/lib/commonjs/logic/cognito/listPagedUsers.js.map +1 -1
  284. package/lib/commonjs/logic/cognito/listPagedUsersByAttribute.d.ts +5 -0
  285. package/lib/commonjs/logic/cognito/listPagedUsersByAttribute.js +8 -7
  286. package/lib/commonjs/logic/cognito/listPagedUsersByAttribute.js.map +1 -1
  287. package/lib/commonjs/logic/cognito/refreshToken.js +9 -8
  288. package/lib/commonjs/logic/cognito/refreshToken.js.map +1 -1
  289. package/lib/commonjs/logic/cognito/requestEmailVerificationCode.js +3 -8
  290. package/lib/commonjs/logic/cognito/requestEmailVerificationCode.js.map +1 -1
  291. package/lib/commonjs/logic/cognito/resolveUsernameByPreferredUsername.d.ts +5 -0
  292. package/lib/commonjs/logic/cognito/resolveUsernameByPreferredUsername.js +26 -3
  293. package/lib/commonjs/logic/cognito/resolveUsernameByPreferredUsername.js.map +1 -1
  294. package/lib/commonjs/logic/cognito/respondToAuthChallenge.d.ts +8 -0
  295. package/lib/commonjs/logic/cognito/{respondToAuthChallengeChallenge.js → respondToAuthChallenge.js} +13 -7
  296. package/lib/commonjs/logic/cognito/respondToAuthChallenge.js.map +1 -0
  297. package/lib/commonjs/logic/cognito/setUserAttributes.js +5 -5
  298. package/lib/commonjs/logic/cognito/setUserAttributes.js.map +1 -1
  299. package/lib/commonjs/logic/cognito/setUserPassword.js +2 -1
  300. package/lib/commonjs/logic/cognito/setUserPassword.js.map +1 -1
  301. package/lib/commonjs/logic/cognito/utils/CognitoUserAttribute.d.ts +5 -0
  302. package/lib/commonjs/logic/cognito/utils/CognitoUserAttribute.js +3 -0
  303. package/lib/commonjs/logic/cognito/utils/CognitoUserAttribute.js.map +1 -0
  304. package/lib/commonjs/logic/cognito/utils/buildCognitoUserFilter.d.ts +10 -0
  305. package/lib/commonjs/logic/cognito/utils/buildCognitoUserFilter.js +34 -0
  306. package/lib/commonjs/logic/cognito/utils/buildCognitoUserFilter.js.map +1 -0
  307. package/lib/commonjs/logic/cognito/utils/calculateSecretHash.d.ts +5 -0
  308. package/lib/commonjs/logic/cognito/utils/calculateSecretHash.js +6 -6
  309. package/lib/commonjs/logic/cognito/utils/calculateSecretHash.js.map +1 -1
  310. package/lib/commonjs/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.d.ts +8 -0
  311. package/lib/commonjs/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.js +23 -0
  312. package/lib/commonjs/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.js.map +1 -0
  313. package/lib/commonjs/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.d.ts +7 -0
  314. package/lib/commonjs/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.js +22 -0
  315. package/lib/commonjs/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.js.map +1 -0
  316. package/lib/commonjs/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.d.ts +9 -0
  317. package/lib/commonjs/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.js +27 -0
  318. package/lib/commonjs/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.js.map +1 -0
  319. package/lib/commonjs/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.d.ts +7 -0
  320. package/lib/commonjs/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.js +14 -0
  321. package/lib/commonjs/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.js.map +1 -0
  322. package/lib/commonjs/logic/cognito/utils/getValidCognitoUserAttributes.d.ts +7 -0
  323. package/lib/commonjs/logic/cognito/utils/getValidCognitoUserAttributes.js +10 -0
  324. package/lib/commonjs/logic/cognito/utils/getValidCognitoUserAttributes.js.map +1 -0
  325. package/lib/commonjs/logic/cognito/utils/index.d.ts +7 -1
  326. package/lib/commonjs/logic/cognito/utils/index.js +7 -1
  327. package/lib/commonjs/logic/cognito/utils/index.js.map +1 -1
  328. package/lib/commonjs/logic/cognito/utils/pageKeyToPaginationToken.d.ts +5 -0
  329. package/lib/commonjs/logic/cognito/utils/pageKeyToPaginationToken.js +5 -0
  330. package/lib/commonjs/logic/cognito/utils/pageKeyToPaginationToken.js.map +1 -1
  331. package/lib/commonjs/logic/cognito/utils/paginationTokenToPageKey.d.ts +5 -0
  332. package/lib/commonjs/logic/cognito/utils/paginationTokenToPageKey.js +5 -0
  333. package/lib/commonjs/logic/cognito/utils/paginationTokenToPageKey.js.map +1 -1
  334. package/lib/commonjs/logic/cognito/verifyUserEmail.d.ts +1 -0
  335. package/lib/commonjs/logic/cognito/verifyUserEmail.js +1 -0
  336. package/lib/commonjs/logic/cognito/verifyUserEmail.js.map +1 -1
  337. package/lib/commonjs/logic/createAwsClient.d.ts +6 -3
  338. package/lib/commonjs/logic/createAwsClient.js +7 -6
  339. package/lib/commonjs/logic/createAwsClient.js.map +1 -1
  340. package/lib/commonjs/logic/dynamo/convertDynamoMapToObject.d.ts +7 -0
  341. package/lib/commonjs/logic/dynamo/convertDynamoMapToObject.js +35 -0
  342. package/lib/commonjs/logic/dynamo/convertDynamoMapToObject.js.map +1 -0
  343. package/lib/commonjs/logic/dynamo/deleteItem.js +4 -10
  344. package/lib/commonjs/logic/dynamo/deleteItem.js.map +1 -1
  345. package/lib/commonjs/logic/dynamo/getAllItems.d.ts +2 -1
  346. package/lib/commonjs/logic/dynamo/getAllItems.js +5 -10
  347. package/lib/commonjs/logic/dynamo/getAllItems.js.map +1 -1
  348. package/lib/commonjs/logic/dynamo/getItem.d.ts +2 -2
  349. package/lib/commonjs/logic/dynamo/getItem.js +6 -18
  350. package/lib/commonjs/logic/dynamo/getItem.js.map +1 -1
  351. package/lib/commonjs/logic/dynamo/index.d.ts +2 -0
  352. package/lib/commonjs/logic/dynamo/index.js +2 -0
  353. package/lib/commonjs/logic/dynamo/index.js.map +1 -1
  354. package/lib/commonjs/logic/dynamo/putItem.d.ts +4 -4
  355. package/lib/commonjs/logic/dynamo/putItem.js +3 -20
  356. package/lib/commonjs/logic/dynamo/putItem.js.map +1 -1
  357. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildAttributeValue.d.ts +8 -0
  358. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildAttributeValue.js +40 -0
  359. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildAttributeValue.js.map +1 -0
  360. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.d.ts +9 -0
  361. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.js +84 -0
  362. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.js.map +1 -0
  363. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.d.ts +9 -0
  364. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.js +107 -0
  365. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.js.map +1 -0
  366. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.d.ts +7 -0
  367. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.js +24 -0
  368. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.js.map +1 -0
  369. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.d.ts +8 -0
  370. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.js +39 -0
  371. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.js.map +1 -0
  372. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.d.ts +7 -0
  373. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.js +23 -0
  374. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.js.map +1 -0
  375. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.d.ts +9 -0
  376. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.js +25 -0
  377. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.js.map +1 -0
  378. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.d.ts +3 -0
  379. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.js +17 -0
  380. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.js.map +1 -0
  381. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.d.ts +7 -2
  382. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.js +13 -22
  383. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.js.map +1 -1
  384. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getHash.d.ts +7 -0
  385. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getHash.js +18 -0
  386. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getHash.js.map +1 -0
  387. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getItemName.d.ts +6 -0
  388. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getItemName.js +14 -0
  389. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getItemName.js.map +1 -0
  390. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getValueName.d.ts +7 -0
  391. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getValueName.js +14 -0
  392. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/getValueName.js.map +1 -0
  393. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/index.d.ts +13 -2
  394. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/index.js +13 -2
  395. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/index.js.map +1 -1
  396. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.d.ts +2 -0
  397. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.js +8 -0
  398. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.js.map +1 -0
  399. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.d.ts +2 -0
  400. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.js +8 -0
  401. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.js.map +1 -0
  402. package/lib/commonjs/logic/dynamo/query.js +6 -10
  403. package/lib/commonjs/logic/dynamo/query.js.map +1 -1
  404. package/lib/commonjs/logic/dynamo/scan.js +6 -10
  405. package/lib/commonjs/logic/dynamo/scan.js.map +1 -1
  406. package/lib/commonjs/logic/dynamo/updateItem.d.ts +2 -1
  407. package/lib/commonjs/logic/dynamo/updateItem.js +8 -12
  408. package/lib/commonjs/logic/dynamo/updateItem.js.map +1 -1
  409. package/lib/commonjs/logic/dynamo/utils/buildDynamoKey.d.ts +8 -0
  410. package/lib/commonjs/logic/dynamo/utils/buildDynamoKey.js +20 -0
  411. package/lib/commonjs/logic/dynamo/utils/buildDynamoKey.js.map +1 -0
  412. package/lib/commonjs/logic/dynamo/{logs/utils → utils}/index.d.ts +2 -0
  413. package/lib/commonjs/logic/dynamo/{logs/utils → utils}/index.js +2 -0
  414. package/lib/commonjs/logic/dynamo/utils/index.js.map +1 -0
  415. package/lib/commonjs/logic/dynamo/utils/itemsToQpqPagedData.d.ts +3 -1
  416. package/lib/commonjs/logic/dynamo/utils/itemsToQpqPagedData.js +3 -2
  417. package/lib/commonjs/logic/dynamo/utils/itemsToQpqPagedData.js.map +1 -1
  418. package/lib/commonjs/logic/dynamo/utils/lastEvaluatedKeyToString.d.ts +3 -0
  419. package/lib/commonjs/logic/dynamo/{logs/utils → utils}/lastEvaluatedKeyToString.js +1 -0
  420. package/lib/commonjs/logic/dynamo/utils/lastEvaluatedKeyToString.js.map +1 -0
  421. package/lib/commonjs/logic/dynamo/utils/stringToLastEvaluatedKey.d.ts +8 -0
  422. package/lib/commonjs/logic/dynamo/utils/stringToLastEvaluatedKey.js +13 -0
  423. package/lib/commonjs/logic/dynamo/utils/stringToLastEvaluatedKey.js.map +1 -0
  424. package/lib/commonjs/logic/federatedModuleStore/FederatedModuleStoreManifest.d.ts +2 -2
  425. package/lib/commonjs/logic/federatedModuleStore/FederatedModuleStoreManifest.js.map +1 -1
  426. package/lib/commonjs/logic/federatedModuleStore/loadFederatedStory.d.ts +1 -1
  427. package/lib/commonjs/logic/federatedModuleStore/loadFederatedStory.js.map +1 -1
  428. package/lib/commonjs/logic/federatedModuleStore/sharedPackages.js +1 -1
  429. package/lib/commonjs/logic/federatedModuleStore/sharedPackages.js.map +1 -1
  430. package/lib/commonjs/logic/kms/decryptDataKey.d.ts +2 -0
  431. package/lib/commonjs/logic/kms/decryptDataKey.js +33 -0
  432. package/lib/commonjs/logic/kms/decryptDataKey.js.map +1 -0
  433. package/lib/commonjs/logic/kms/generateDataKey.d.ts +3 -0
  434. package/lib/commonjs/logic/kms/generateDataKey.js +34 -0
  435. package/lib/commonjs/logic/kms/generateDataKey.js.map +1 -0
  436. package/lib/commonjs/logic/kms/getCachedGeneratedDataKey.d.ts +3 -0
  437. package/lib/commonjs/logic/kms/getCachedGeneratedDataKey.js +37 -0
  438. package/lib/commonjs/logic/kms/getCachedGeneratedDataKey.js.map +1 -0
  439. package/lib/commonjs/logic/kms/getCachedUnwrappedDataKey.d.ts +2 -0
  440. package/lib/commonjs/logic/kms/getCachedUnwrappedDataKey.js +37 -0
  441. package/lib/commonjs/logic/kms/getCachedUnwrappedDataKey.js.map +1 -0
  442. package/lib/commonjs/logic/kms/toKmsEncryptionContext.d.ts +2 -0
  443. package/lib/commonjs/logic/kms/toKmsEncryptionContext.js +10 -0
  444. package/lib/commonjs/logic/kms/toKmsEncryptionContext.js.map +1 -0
  445. package/lib/commonjs/logic/lambda/executeLambdaByName.d.ts +5 -1
  446. package/lib/commonjs/logic/lambda/executeLambdaByName.js +6 -3
  447. package/lib/commonjs/logic/lambda/executeLambdaByName.js.map +1 -1
  448. package/lib/commonjs/logic/neptune/getNeptuneEndpoints.js +8 -6
  449. package/lib/commonjs/logic/neptune/getNeptuneEndpoints.js.map +1 -1
  450. package/lib/commonjs/logic/parametersManager/getParameters.js +2 -1
  451. package/lib/commonjs/logic/parametersManager/getParameters.js.map +1 -1
  452. package/lib/commonjs/logic/s3/deleteFiles.d.ts +1 -0
  453. package/lib/commonjs/logic/s3/deleteFiles.js +16 -9
  454. package/lib/commonjs/logic/s3/deleteFiles.js.map +1 -1
  455. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.d.ts +1 -0
  456. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.js +2 -31
  457. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.js.map +1 -1
  458. package/lib/commonjs/logic/s3/generatePresignedUrl.d.ts +1 -0
  459. package/lib/commonjs/logic/s3/generatePresignedUrl.js +4 -11
  460. package/lib/commonjs/logic/s3/generatePresignedUrl.js.map +1 -1
  461. package/lib/commonjs/logic/s3/listFiles.d.ts +5 -4
  462. package/lib/commonjs/logic/s3/listFiles.js +20 -27
  463. package/lib/commonjs/logic/s3/listFiles.js.map +1 -1
  464. package/lib/commonjs/logic/s3/s3Utils.d.ts +3 -0
  465. package/lib/commonjs/logic/s3/s3Utils.js +5 -0
  466. package/lib/commonjs/logic/s3/s3Utils.js.map +1 -1
  467. package/lib/commonjs/logic/secretsManager/getSecret.js +2 -3
  468. package/lib/commonjs/logic/secretsManager/getSecret.js.map +1 -1
  469. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.d.ts +2 -0
  470. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.js +79 -0
  471. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.js.map +1 -0
  472. package/lib/commonjs/logic/sesV2/sendEmail.d.ts +2 -0
  473. package/lib/commonjs/logic/sesV2/sendEmail.js +48 -0
  474. package/lib/commonjs/logic/sesV2/sendEmail.js.map +1 -0
  475. package/lib/commonjs/logic/sns/publishMessage.d.ts +7 -2
  476. package/lib/commonjs/logic/sns/publishMessage.js +11 -11
  477. package/lib/commonjs/logic/sns/publishMessage.js.map +1 -1
  478. package/lib/commonjs/logic/sqs/sendMessages.d.ts +7 -2
  479. package/lib/commonjs/logic/sqs/sendMessages.js +9 -8
  480. package/lib/commonjs/logic/sqs/sendMessages.js.map +1 -1
  481. package/lib/commonjs/runtimeConfig/LambdaRuntimeConfig.d.ts +9 -0
  482. package/lib/commonjs/runtimeConfig/LambdaRuntimeConfig.js +3 -0
  483. package/lib/commonjs/runtimeConfig/LambdaRuntimeConfig.js.map +1 -0
  484. package/lib/commonjs/runtimeConfig/index.d.ts +2 -0
  485. package/lib/commonjs/{logic/dynamo/logs → runtimeConfig}/index.js +2 -1
  486. package/lib/commonjs/runtimeConfig/index.js.map +1 -0
  487. package/lib/commonjs/runtimeConfig/resolveParameterKey.d.ts +7 -0
  488. package/lib/commonjs/runtimeConfig/resolveParameterKey.js +17 -0
  489. package/lib/commonjs/runtimeConfig/resolveParameterKey.js.map +1 -0
  490. package/lib/esm/awsLambdaUtils.d.ts +6 -4
  491. package/lib/esm/awsLambdaUtils.js +2 -2
  492. package/lib/esm/awsLambdaUtils.js.map +1 -1
  493. package/lib/esm/awsNamingUtils.d.ts +2 -2
  494. package/lib/esm/awsNamingUtils.js +53 -100
  495. package/lib/esm/awsNamingUtils.js.map +1 -1
  496. package/lib/esm/getActionProcessor/core/ai/getAiPromptActionProcessor.js +2 -2
  497. package/lib/esm/getActionProcessor/core/ai/getAiPromptActionProcessor.js.map +1 -1
  498. package/lib/esm/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js +6 -6
  499. package/lib/esm/getActionProcessor/core/ai/getAiPromptStreamActionProcessor.js.map +1 -1
  500. package/lib/esm/getActionProcessor/core/ai/logic/prepareAiPromptCall.d.ts +4 -3
  501. package/lib/esm/getActionProcessor/core/ai/logic/prepareAiPromptCall.js.map +1 -1
  502. package/lib/esm/getActionProcessor/core/ai/logic/toCacheableMessages.js +1 -1
  503. package/lib/esm/getActionProcessor/core/ai/logic/toCacheableMessages.js.map +1 -1
  504. package/lib/esm/getActionProcessor/core/apiKeyValidation/getApiKeyValidationValidateActionProcessor.js +8 -7
  505. package/lib/esm/getActionProcessor/core/apiKeyValidation/getApiKeyValidationValidateActionProcessor.js.map +1 -1
  506. package/lib/esm/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +1 -1
  507. package/lib/esm/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js.map +1 -1
  508. package/lib/esm/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +1 -1
  509. package/lib/esm/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js.map +1 -1
  510. package/lib/esm/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js +1 -1
  511. package/lib/esm/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js.map +1 -1
  512. package/lib/esm/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.d.ts +2 -0
  513. package/lib/esm/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.js +38 -0
  514. package/lib/esm/getActionProcessor/core/crypto/getCryptoDecryptActionProcessor.js.map +1 -0
  515. package/lib/esm/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.d.ts +2 -0
  516. package/lib/esm/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.js +30 -0
  517. package/lib/esm/getActionProcessor/core/crypto/getCryptoEncryptActionProcessor.js.map +1 -0
  518. package/lib/esm/getActionProcessor/core/crypto/index.d.ts +2 -0
  519. package/lib/esm/getActionProcessor/core/crypto/index.js +7 -0
  520. package/lib/esm/getActionProcessor/core/crypto/index.js.map +1 -0
  521. package/lib/esm/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.d.ts +2 -0
  522. package/lib/esm/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.js +7 -0
  523. package/lib/esm/getActionProcessor/core/crypto/utils/createKmsDataKeyProvider.js.map +1 -0
  524. package/lib/esm/getActionProcessor/core/crypto/utils/index.d.ts +2 -0
  525. package/lib/esm/getActionProcessor/core/crypto/utils/index.js +3 -0
  526. package/lib/esm/getActionProcessor/core/crypto/utils/index.js.map +1 -0
  527. package/lib/esm/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.d.ts +2 -0
  528. package/lib/esm/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.js +14 -0
  529. package/lib/esm/getActionProcessor/core/crypto/utils/resolveCryptoKeyAlias.js.map +1 -0
  530. package/lib/esm/getActionProcessor/core/event/cognito/createAuthChallenge/getEventGetRecordsActionProcessor.js +1 -1
  531. package/lib/esm/getActionProcessor/core/event/cognito/createAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  532. package/lib/esm/getActionProcessor/core/event/cognito/defineAuthChallenge/getEventGetRecordsActionProcessor.js +1 -1
  533. package/lib/esm/getActionProcessor/core/event/cognito/defineAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  534. package/lib/esm/getActionProcessor/core/event/cognito/verifyAuthChallenge/getEventGetRecordsActionProcessor.js +1 -1
  535. package/lib/esm/getActionProcessor/core/event/cognito/verifyAuthChallenge/getEventGetRecordsActionProcessor.js.map +1 -1
  536. package/lib/esm/getActionProcessor/core/event/eventBridgeEvent/recurringSchedule/getEventMatchStoryActionProcessor.js.map +1 -1
  537. package/lib/esm/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +20 -17
  538. package/lib/esm/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js.map +1 -1
  539. package/lib/esm/getActionProcessor/core/file/getFileDeleteActionProcessor.js +4 -8
  540. package/lib/esm/getActionProcessor/core/file/getFileDeleteActionProcessor.js.map +1 -1
  541. package/lib/esm/getActionProcessor/core/file/getFileExistsActionProcessor.js +1 -1
  542. package/lib/esm/getActionProcessor/core/file/getFileExistsActionProcessor.js.map +1 -1
  543. package/lib/esm/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js +2 -1
  544. package/lib/esm/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js.map +1 -1
  545. package/lib/esm/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +2 -1
  546. package/lib/esm/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js.map +1 -1
  547. package/lib/esm/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js +2 -1
  548. package/lib/esm/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js.map +1 -1
  549. package/lib/esm/getActionProcessor/core/file/getFileWriteObjectJsonActionProcessor.js +2 -1
  550. package/lib/esm/getActionProcessor/core/file/getFileWriteObjectJsonActionProcessor.js.map +1 -1
  551. package/lib/esm/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +2 -1
  552. package/lib/esm/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js.map +1 -1
  553. package/lib/esm/getActionProcessor/core/file/utils/StorageDriveNotFoundError.d.ts +3 -0
  554. package/lib/esm/getActionProcessor/core/file/utils/StorageDriveNotFoundError.js +10 -0
  555. package/lib/esm/getActionProcessor/core/file/utils/StorageDriveNotFoundError.js.map +1 -0
  556. package/lib/esm/getActionProcessor/core/file/utils/index.d.ts +1 -0
  557. package/lib/esm/getActionProcessor/core/file/utils/index.js +1 -0
  558. package/lib/esm/getActionProcessor/core/file/utils/index.js.map +1 -1
  559. package/lib/esm/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.d.ts +5 -0
  560. package/lib/esm/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.js +7 -1
  561. package/lib/esm/getActionProcessor/core/file/utils/resolveStorageDriveBucketName.js.map +1 -1
  562. package/lib/esm/getActionProcessor/core/graphDatabase/stories/converters/askConvertNeptuneQueryResultToGraphQueryResult.js +1 -1
  563. package/lib/esm/getActionProcessor/core/graphDatabase/stories/converters/askConvertNeptuneQueryResultToGraphQueryResult.js.map +1 -1
  564. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/AnyNeptuneResult.d.ts +4 -0
  565. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/AnyNeptuneResult.js +2 -0
  566. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/AnyNeptuneResult.js.map +1 -0
  567. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.d.ts +4 -0
  568. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.js +2 -0
  569. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherRequest.js.map +1 -0
  570. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.d.ts +4 -0
  571. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.js +2 -0
  572. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneCypherResponse.js.map +1 -0
  573. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.d.ts +4 -0
  574. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.js +2 -0
  575. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneGraphEntity.js.map +1 -0
  576. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.d.ts +5 -0
  577. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.js +2 -0
  578. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneNodeResult.js.map +1 -0
  579. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.d.ts +4 -0
  580. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.js +2 -0
  581. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneQueryResult.js.map +1 -0
  582. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.d.ts +7 -0
  583. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.js +2 -0
  584. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneRelationshipResult.js.map +1 -0
  585. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.d.ts +1 -0
  586. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.js +2 -0
  587. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/NeptuneScalarResult.js.map +1 -0
  588. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/index.d.ts +8 -1
  589. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/index.js +8 -1
  590. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/index.js.map +1 -1
  591. package/lib/esm/getActionProcessor/core/index.d.ts +1 -0
  592. package/lib/esm/getActionProcessor/core/index.js +3 -0
  593. package/lib/esm/getActionProcessor/core/index.js.map +1 -1
  594. package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js +1 -1
  595. package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js.map +1 -1
  596. package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js +1 -1
  597. package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js.map +1 -1
  598. package/lib/esm/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js +20 -19
  599. package/lib/esm/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js.map +1 -1
  600. package/lib/esm/getActionProcessor/core/system/getDateNow.d.ts +1 -0
  601. package/lib/esm/getActionProcessor/core/system/getDateNow.js +4 -0
  602. package/lib/esm/getActionProcessor/core/system/getDateNow.js.map +1 -0
  603. package/lib/esm/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.d.ts +0 -1
  604. package/lib/esm/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.js +2 -2
  605. package/lib/esm/getActionProcessor/core/system/getSystemExecuteStoryActionProcessor.js.map +1 -1
  606. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryAuthenticateUserActionProcessor.js.map +1 -1
  607. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryCreateUserActionProcessor.js.map +1 -1
  608. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js +1 -1
  609. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js.map +1 -1
  610. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js +1 -1
  611. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js.map +1 -1
  612. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js +4 -1
  613. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js.map +1 -1
  614. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryReadAccessTokenActionProcessor.js +7 -3
  615. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryReadAccessTokenActionProcessor.js.map +1 -1
  616. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js +1 -1
  617. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js.map +1 -1
  618. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js +2 -2
  619. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js.map +1 -1
  620. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js +1 -1
  621. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js.map +1 -1
  622. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js +1 -1
  623. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js.map +1 -1
  624. package/lib/esm/getActionProcessor/index.js +8 -9
  625. package/lib/esm/getActionProcessor/index.js.map +1 -1
  626. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.d.ts +2 -0
  627. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js +28 -0
  628. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js.map +1 -0
  629. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.d.ts +2 -0
  630. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js +11 -0
  631. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js.map +1 -0
  632. package/lib/esm/getActionProcessor/webserver/email/index.d.ts +2 -0
  633. package/lib/esm/getActionProcessor/webserver/email/index.js +7 -0
  634. package/lib/esm/getActionProcessor/webserver/email/index.js.map +1 -0
  635. package/lib/esm/getActionProcessor/webserver/index.d.ts +2 -1
  636. package/lib/esm/getActionProcessor/webserver/index.js +3 -0
  637. package/lib/esm/getActionProcessor/webserver/index.js.map +1 -1
  638. package/lib/esm/getActionProcessor/webserver/serviceFunction/getServiceFunctionExecuteActionProcessor.js.map +1 -1
  639. package/lib/esm/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +1 -1
  640. package/lib/esm/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js.map +1 -1
  641. package/lib/esm/getLambdaEntries.d.ts +4 -0
  642. package/lib/esm/getLambdaEntries.js +7 -4
  643. package/lib/esm/getLambdaEntries.js.map +1 -1
  644. package/lib/esm/index.d.ts +1 -1
  645. package/lib/esm/index.js +4 -3
  646. package/lib/esm/index.js.map +1 -1
  647. package/lib/esm/lambdaExtensions/logExtensionPort.js +1 -1
  648. package/lib/esm/lambdaExtensions/logExtensionPort.js.map +1 -1
  649. package/lib/esm/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.d.ts +1 -1
  650. package/lib/esm/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.js +4 -3
  651. package/lib/esm/lambdaHandlers/getAnyExecuteServiceFunctionEvent_serviceFunction.js.map +1 -1
  652. package/lib/esm/lambdaHandlers/getApiGatewayEventHandler.js +2 -4
  653. package/lib/esm/lambdaHandlers/getApiGatewayEventHandler.js.map +1 -1
  654. package/lib/esm/lambdaHandlers/getApiGatewayEventHandler_redirect.js +8 -4
  655. package/lib/esm/lambdaHandlers/getApiGatewayEventHandler_redirect.js.map +1 -1
  656. package/lib/esm/lambdaHandlers/getApiGatwayEventWebsocketWithIdentity_websocketEvent.js +2 -6
  657. package/lib/esm/lambdaHandlers/getApiGatwayEventWebsocketWithIdentity_websocketEvent.js.map +1 -1
  658. package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_originRequest.js +2 -6
  659. package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_originRequest.js.map +1 -1
  660. package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.d.ts +0 -19
  661. package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +5 -7
  662. package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js.map +1 -1
  663. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_createAuthChallenge.js +2 -6
  664. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_createAuthChallenge.js.map +1 -1
  665. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_customMessage.js +2 -6
  666. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_customMessage.js.map +1 -1
  667. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_defineAuthChallenge.js +2 -6
  668. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_defineAuthChallenge.js.map +1 -1
  669. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_verifyAuthChallenge.js +2 -6
  670. package/lib/esm/lambdaHandlers/getCustomMessageTriggerEvent_verifyAuthChallenge.js.map +1 -1
  671. package/lib/esm/lambdaHandlers/getEventBridgeEvent_recurringSchedule.js +3 -7
  672. package/lib/esm/lambdaHandlers/getEventBridgeEvent_recurringSchedule.js.map +1 -1
  673. package/lib/esm/lambdaHandlers/getEventBridgeEvent_stackDeploy.js +2 -6
  674. package/lib/esm/lambdaHandlers/getEventBridgeEvent_stackDeploy.js.map +1 -1
  675. package/lib/esm/lambdaHandlers/getS3Event_fileEvent.js +2 -6
  676. package/lib/esm/lambdaHandlers/getS3Event_fileEvent.js.map +1 -1
  677. package/lib/esm/lambdaHandlers/getSqsEvent_queueEvent.js +3 -7
  678. package/lib/esm/lambdaHandlers/getSqsEvent_queueEvent.js.map +1 -1
  679. package/lib/esm/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.d.ts +5 -0
  680. package/lib/esm/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.js +5 -0
  681. package/lib/esm/lambdaHandlers/helpers/dynamicModuleLoaderWarmer.js.map +1 -1
  682. package/lib/esm/lambdaHandlers/helpers/getBlankStorySession.d.ts +6 -0
  683. package/lib/esm/lambdaHandlers/helpers/getBlankStorySession.js +9 -0
  684. package/lib/esm/lambdaHandlers/helpers/getBlankStorySession.js.map +1 -0
  685. package/lib/esm/lambdaHandlers/helpers/getLogger.d.ts +8 -0
  686. package/lib/esm/lambdaHandlers/helpers/{logger.js → getLogger.js} +21 -25
  687. package/lib/esm/lambdaHandlers/helpers/getLogger.js.map +1 -0
  688. package/lib/esm/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.d.ts +4 -0
  689. package/lib/esm/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.js +19 -15
  690. package/lib/esm/lambdaHandlers/helpers/getQpqLambdaRuntimeForEvent.js.map +1 -1
  691. package/lib/esm/lambdaHandlers/helpers/index.d.ts +3 -1
  692. package/lib/esm/lambdaHandlers/helpers/index.js +3 -1
  693. package/lib/esm/lambdaHandlers/helpers/index.js.map +1 -1
  694. package/lib/esm/lambdaHandlers/helpers/isSnsWarmerRecord.d.ts +6 -0
  695. package/lib/esm/lambdaHandlers/helpers/isSnsWarmerRecord.js +19 -0
  696. package/lib/esm/lambdaHandlers/helpers/isSnsWarmerRecord.js.map +1 -0
  697. package/lib/esm/lambdaHandlers/types/QpqFunctionExecutionEvent.d.ts +7 -0
  698. package/lib/esm/lambdaHandlers/types/QpqFunctionExecutionEvent.js +2 -0
  699. package/lib/esm/lambdaHandlers/types/QpqFunctionExecutionEvent.js.map +1 -0
  700. package/lib/esm/lambdaHandlers/types/index.d.ts +1 -1
  701. package/lib/esm/lambdaHandlers/types/index.js +1 -1
  702. package/lib/esm/lambdaHandlers/types/index.js.map +1 -1
  703. package/lib/esm/lambdas/anyExecuteServiceFunctionEvent_serviceFunction.d.ts +1 -1
  704. package/lib/esm/lambdas/cloudFrontRequestEvent_viewerRequest.js +0 -1
  705. package/lib/esm/lambdas/cloudFrontRequestEvent_viewerRequest.js.map +1 -1
  706. package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoader.js.map +1 -1
  707. package/lib/esm/lambdas/dynamicModuleLoader/index.d.ts +0 -1
  708. package/lib/esm/lambdas/dynamicModuleLoader/index.js +0 -1
  709. package/lib/esm/lambdas/dynamicModuleLoader/index.js.map +1 -1
  710. package/lib/esm/lambdas/index.js +4 -0
  711. package/lib/esm/lambdas/index.js.map +1 -1
  712. package/lib/esm/logic/apiGateway/sendMessageToWebSocketConnection.d.ts +2 -0
  713. package/lib/esm/logic/apiGateway/{websocketSendMessage.js → sendMessageToWebSocketConnection.js} +7 -7
  714. package/lib/esm/logic/apiGateway/sendMessageToWebSocketConnection.js.map +1 -0
  715. package/lib/esm/logic/cache/memoFunc.d.ts +5 -2
  716. package/lib/esm/logic/cache/memoFunc.js +3 -5
  717. package/lib/esm/logic/cache/memoFunc.js.map +1 -1
  718. package/lib/esm/logic/cache/memoFuncAsync.d.ts +5 -2
  719. package/lib/esm/logic/cache/memoFuncAsync.js +4 -3
  720. package/lib/esm/logic/cache/memoFuncAsync.js.map +1 -1
  721. package/lib/esm/logic/cloudFront/invalidateCache.d.ts +0 -1
  722. package/lib/esm/logic/cloudFront/invalidateCache.js +6 -8
  723. package/lib/esm/logic/cloudFront/invalidateCache.js.map +1 -1
  724. package/lib/esm/logic/cloudformation/getExportedValue.d.ts +4 -0
  725. package/lib/esm/logic/cloudformation/getExportedValue.js +4 -0
  726. package/lib/esm/logic/cloudformation/getExportedValue.js.map +1 -1
  727. package/lib/esm/logic/cognito/authenticateUser.d.ts +4 -0
  728. package/lib/esm/logic/cognito/authenticateUser.js +7 -2
  729. package/lib/esm/logic/cognito/authenticateUser.js.map +1 -1
  730. package/lib/esm/logic/cognito/cognitoAttributeMap.d.ts +1 -9
  731. package/lib/esm/logic/cognito/cognitoAttributeMap.js +1 -38
  732. package/lib/esm/logic/cognito/cognitoAttributeMap.js.map +1 -1
  733. package/lib/esm/logic/cognito/confirmForgotPassword.d.ts +4 -0
  734. package/lib/esm/logic/cognito/confirmForgotPassword.js +5 -3
  735. package/lib/esm/logic/cognito/confirmForgotPassword.js.map +1 -1
  736. package/lib/esm/logic/cognito/createUser.d.ts +4 -0
  737. package/lib/esm/logic/cognito/createUser.js +8 -5
  738. package/lib/esm/logic/cognito/createUser.js.map +1 -1
  739. package/lib/esm/logic/cognito/decodeAccessToken.d.ts +11 -0
  740. package/lib/esm/logic/cognito/decodeAccessToken.js +22 -4
  741. package/lib/esm/logic/cognito/decodeAccessToken.js.map +1 -1
  742. package/lib/esm/logic/cognito/decodeValidJwt.d.ts +8 -2
  743. package/lib/esm/logic/cognito/decodeValidJwt.js +15 -6
  744. package/lib/esm/logic/cognito/decodeValidJwt.js.map +1 -1
  745. package/lib/esm/logic/cognito/forgotPassword.js +2 -6
  746. package/lib/esm/logic/cognito/forgotPassword.js.map +1 -1
  747. package/lib/esm/logic/cognito/getCognitoJwksClient.d.ts +7 -0
  748. package/lib/esm/logic/cognito/getCognitoJwksClient.js +9 -0
  749. package/lib/esm/logic/cognito/getCognitoJwksClient.js.map +1 -0
  750. package/lib/esm/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.d.ts +8 -0
  751. package/lib/esm/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.js +16 -0
  752. package/lib/esm/logic/cognito/getCognitoUserAttributesFromQpqUserAttributes.js.map +1 -0
  753. package/lib/esm/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.d.ts +7 -0
  754. package/lib/esm/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.js +18 -0
  755. package/lib/esm/logic/cognito/getQpqAttributeObjectFromCognitoKeyValue.js.map +1 -0
  756. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoStringMap.d.ts +6 -0
  757. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoStringMap.js +13 -0
  758. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoStringMap.js.map +1 -0
  759. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoUserAttributes.d.ts +4 -0
  760. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoUserAttributes.js +10 -0
  761. package/lib/esm/logic/cognito/getQpqAttributesFromCognitoUserAttributes.js.map +1 -0
  762. package/lib/esm/logic/cognito/getUserAttributes.js +5 -7
  763. package/lib/esm/logic/cognito/getUserAttributes.js.map +1 -1
  764. package/lib/esm/logic/cognito/getUserAttributesBySub.js +19 -4
  765. package/lib/esm/logic/cognito/getUserAttributesBySub.js.map +1 -1
  766. package/lib/esm/logic/cognito/getUserPoolClientSecret.d.ts +8 -0
  767. package/lib/esm/logic/cognito/getUserPoolClientSecret.js +17 -3
  768. package/lib/esm/logic/cognito/getUserPoolClientSecret.js.map +1 -1
  769. package/lib/esm/logic/cognito/index.js +3 -0
  770. package/lib/esm/logic/cognito/index.js.map +1 -1
  771. package/lib/esm/logic/cognito/listPagedUsers.js +3 -7
  772. package/lib/esm/logic/cognito/listPagedUsers.js.map +1 -1
  773. package/lib/esm/logic/cognito/listPagedUsersByAttribute.d.ts +5 -0
  774. package/lib/esm/logic/cognito/listPagedUsersByAttribute.js +9 -8
  775. package/lib/esm/logic/cognito/listPagedUsersByAttribute.js.map +1 -1
  776. package/lib/esm/logic/cognito/refreshToken.js +8 -7
  777. package/lib/esm/logic/cognito/refreshToken.js.map +1 -1
  778. package/lib/esm/logic/cognito/requestEmailVerificationCode.js +3 -7
  779. package/lib/esm/logic/cognito/requestEmailVerificationCode.js.map +1 -1
  780. package/lib/esm/logic/cognito/resolveUsernameByPreferredUsername.d.ts +5 -0
  781. package/lib/esm/logic/cognito/resolveUsernameByPreferredUsername.js +26 -3
  782. package/lib/esm/logic/cognito/resolveUsernameByPreferredUsername.js.map +1 -1
  783. package/lib/esm/logic/cognito/respondToAuthChallenge.d.ts +8 -0
  784. package/lib/esm/logic/cognito/{respondToAuthChallengeChallenge.js → respondToAuthChallenge.js} +10 -4
  785. package/lib/esm/logic/cognito/respondToAuthChallenge.js.map +1 -0
  786. package/lib/esm/logic/cognito/setUserAttributes.js +4 -4
  787. package/lib/esm/logic/cognito/setUserAttributes.js.map +1 -1
  788. package/lib/esm/logic/cognito/setUserPassword.js +2 -1
  789. package/lib/esm/logic/cognito/setUserPassword.js.map +1 -1
  790. package/lib/esm/logic/cognito/utils/CognitoUserAttribute.d.ts +5 -0
  791. package/lib/esm/logic/cognito/utils/CognitoUserAttribute.js +2 -0
  792. package/lib/esm/logic/cognito/utils/CognitoUserAttribute.js.map +1 -0
  793. package/lib/esm/logic/cognito/utils/buildCognitoUserFilter.d.ts +10 -0
  794. package/lib/esm/logic/cognito/utils/buildCognitoUserFilter.js +29 -0
  795. package/lib/esm/logic/cognito/utils/buildCognitoUserFilter.js.map +1 -0
  796. package/lib/esm/logic/cognito/utils/calculateSecretHash.d.ts +5 -0
  797. package/lib/esm/logic/cognito/utils/calculateSecretHash.js +6 -6
  798. package/lib/esm/logic/cognito/utils/calculateSecretHash.js.map +1 -1
  799. package/lib/esm/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.d.ts +8 -0
  800. package/lib/esm/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.js +19 -0
  801. package/lib/esm/logic/cognito/utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo.js.map +1 -0
  802. package/lib/esm/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.d.ts +7 -0
  803. package/lib/esm/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.js +18 -0
  804. package/lib/esm/logic/cognito/utils/cognitoAuthenticationResultTypeToQpqAuthenticationInfo.js.map +1 -0
  805. package/lib/esm/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.d.ts +9 -0
  806. package/lib/esm/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.js +23 -0
  807. package/lib/esm/logic/cognito/utils/cognitoChallengeNameTypeToQpqAuthenticateUserChallenge.js.map +1 -0
  808. package/lib/esm/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.d.ts +7 -0
  809. package/lib/esm/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.js +10 -0
  810. package/lib/esm/logic/cognito/utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails.js.map +1 -0
  811. package/lib/esm/logic/cognito/utils/getValidCognitoUserAttributes.d.ts +7 -0
  812. package/lib/esm/logic/cognito/utils/getValidCognitoUserAttributes.js +6 -0
  813. package/lib/esm/logic/cognito/utils/getValidCognitoUserAttributes.js.map +1 -0
  814. package/lib/esm/logic/cognito/utils/index.d.ts +7 -1
  815. package/lib/esm/logic/cognito/utils/index.js +7 -1
  816. package/lib/esm/logic/cognito/utils/index.js.map +1 -1
  817. package/lib/esm/logic/cognito/utils/pageKeyToPaginationToken.d.ts +5 -0
  818. package/lib/esm/logic/cognito/utils/pageKeyToPaginationToken.js +5 -0
  819. package/lib/esm/logic/cognito/utils/pageKeyToPaginationToken.js.map +1 -1
  820. package/lib/esm/logic/cognito/utils/paginationTokenToPageKey.d.ts +5 -0
  821. package/lib/esm/logic/cognito/utils/paginationTokenToPageKey.js +5 -0
  822. package/lib/esm/logic/cognito/utils/paginationTokenToPageKey.js.map +1 -1
  823. package/lib/esm/logic/cognito/verifyUserEmail.d.ts +1 -0
  824. package/lib/esm/logic/cognito/verifyUserEmail.js +1 -0
  825. package/lib/esm/logic/cognito/verifyUserEmail.js.map +1 -1
  826. package/lib/esm/logic/createAwsClient.d.ts +6 -3
  827. package/lib/esm/logic/createAwsClient.js +7 -6
  828. package/lib/esm/logic/createAwsClient.js.map +1 -1
  829. package/lib/esm/logic/dynamo/convertDynamoMapToObject.d.ts +7 -0
  830. package/lib/esm/logic/dynamo/convertDynamoMapToObject.js +32 -0
  831. package/lib/esm/logic/dynamo/convertDynamoMapToObject.js.map +1 -0
  832. package/lib/esm/logic/dynamo/deleteItem.js +4 -10
  833. package/lib/esm/logic/dynamo/deleteItem.js.map +1 -1
  834. package/lib/esm/logic/dynamo/getAllItems.d.ts +2 -1
  835. package/lib/esm/logic/dynamo/getAllItems.js +5 -10
  836. package/lib/esm/logic/dynamo/getAllItems.js.map +1 -1
  837. package/lib/esm/logic/dynamo/getItem.d.ts +2 -2
  838. package/lib/esm/logic/dynamo/getItem.js +6 -18
  839. package/lib/esm/logic/dynamo/getItem.js.map +1 -1
  840. package/lib/esm/logic/dynamo/index.d.ts +2 -0
  841. package/lib/esm/logic/dynamo/index.js +2 -0
  842. package/lib/esm/logic/dynamo/index.js.map +1 -1
  843. package/lib/esm/logic/dynamo/putItem.d.ts +4 -4
  844. package/lib/esm/logic/dynamo/putItem.js +3 -20
  845. package/lib/esm/logic/dynamo/putItem.js.map +1 -1
  846. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildAttributeValue.d.ts +8 -0
  847. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildAttributeValue.js +36 -0
  848. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildAttributeValue.js.map +1 -0
  849. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.d.ts +9 -0
  850. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.js +80 -0
  851. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQueryExpression.js.map +1 -0
  852. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.d.ts +9 -0
  853. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.js +103 -0
  854. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdateExpression.js.map +1 -0
  855. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.d.ts +7 -0
  856. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.js +20 -0
  857. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeNames.js.map +1 -0
  858. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.d.ts +8 -0
  859. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.js +35 -0
  860. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildExpressionAttributeValues.js.map +1 -0
  861. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.d.ts +7 -0
  862. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.js +19 -0
  863. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeNames.js.map +1 -0
  864. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.d.ts +9 -0
  865. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.js +21 -0
  866. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildUpdateExpressionAttributeValues.js.map +1 -0
  867. package/lib/esm/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.d.ts +3 -0
  868. package/lib/esm/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.js +13 -0
  869. package/lib/esm/logic/dynamo/qpqDynamoOrm/flattenKvsQueryConditions.js.map +1 -0
  870. package/lib/esm/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.d.ts +7 -2
  871. package/lib/esm/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.js +13 -22
  872. package/lib/esm/logic/dynamo/qpqDynamoOrm/getDynamoTableIndexByConfigAndQuery.js.map +1 -1
  873. package/lib/esm/logic/dynamo/qpqDynamoOrm/getHash.d.ts +7 -0
  874. package/lib/esm/logic/dynamo/qpqDynamoOrm/getHash.js +11 -0
  875. package/lib/esm/logic/dynamo/qpqDynamoOrm/getHash.js.map +1 -0
  876. package/lib/esm/logic/dynamo/qpqDynamoOrm/getItemName.d.ts +6 -0
  877. package/lib/esm/logic/dynamo/qpqDynamoOrm/getItemName.js +10 -0
  878. package/lib/esm/logic/dynamo/qpqDynamoOrm/getItemName.js.map +1 -0
  879. package/lib/esm/logic/dynamo/qpqDynamoOrm/getValueName.d.ts +7 -0
  880. package/lib/esm/logic/dynamo/qpqDynamoOrm/getValueName.js +10 -0
  881. package/lib/esm/logic/dynamo/qpqDynamoOrm/getValueName.js.map +1 -0
  882. package/lib/esm/logic/dynamo/qpqDynamoOrm/index.d.ts +13 -2
  883. package/lib/esm/logic/dynamo/qpqDynamoOrm/index.js +13 -2
  884. package/lib/esm/logic/dynamo/qpqDynamoOrm/index.js.map +1 -1
  885. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.d.ts +2 -0
  886. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.js +4 -0
  887. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsLogicalOperator.js.map +1 -0
  888. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.d.ts +2 -0
  889. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.js +4 -0
  890. package/lib/esm/logic/dynamo/qpqDynamoOrm/isKvsQueryCondition.js.map +1 -0
  891. package/lib/esm/logic/dynamo/query.js +5 -8
  892. package/lib/esm/logic/dynamo/query.js.map +1 -1
  893. package/lib/esm/logic/dynamo/scan.js +5 -8
  894. package/lib/esm/logic/dynamo/scan.js.map +1 -1
  895. package/lib/esm/logic/dynamo/updateItem.d.ts +2 -1
  896. package/lib/esm/logic/dynamo/updateItem.js +8 -12
  897. package/lib/esm/logic/dynamo/updateItem.js.map +1 -1
  898. package/lib/esm/logic/dynamo/utils/buildDynamoKey.d.ts +8 -0
  899. package/lib/esm/logic/dynamo/utils/buildDynamoKey.js +16 -0
  900. package/lib/esm/logic/dynamo/utils/buildDynamoKey.js.map +1 -0
  901. package/lib/esm/logic/dynamo/{logs/utils → utils}/index.d.ts +2 -0
  902. package/lib/esm/logic/dynamo/utils/index.js +5 -0
  903. package/lib/esm/logic/dynamo/utils/index.js.map +1 -0
  904. package/lib/esm/logic/dynamo/utils/itemsToQpqPagedData.d.ts +3 -1
  905. package/lib/esm/logic/dynamo/utils/itemsToQpqPagedData.js +2 -1
  906. package/lib/esm/logic/dynamo/utils/itemsToQpqPagedData.js.map +1 -1
  907. package/lib/esm/logic/dynamo/utils/lastEvaluatedKeyToString.d.ts +3 -0
  908. package/lib/esm/logic/dynamo/{logs/utils → utils}/lastEvaluatedKeyToString.js +1 -0
  909. package/lib/esm/logic/dynamo/utils/lastEvaluatedKeyToString.js.map +1 -0
  910. package/lib/esm/logic/dynamo/utils/stringToLastEvaluatedKey.d.ts +8 -0
  911. package/lib/esm/logic/dynamo/utils/stringToLastEvaluatedKey.js +10 -0
  912. package/lib/esm/logic/dynamo/utils/stringToLastEvaluatedKey.js.map +1 -0
  913. package/lib/esm/logic/federatedModuleStore/FederatedModuleStoreManifest.d.ts +2 -2
  914. package/lib/esm/logic/federatedModuleStore/FederatedModuleStoreManifest.js.map +1 -1
  915. package/lib/esm/logic/federatedModuleStore/loadFederatedStory.d.ts +1 -1
  916. package/lib/esm/logic/federatedModuleStore/loadFederatedStory.js.map +1 -1
  917. package/lib/esm/logic/federatedModuleStore/sharedPackages.js +1 -1
  918. package/lib/esm/logic/federatedModuleStore/sharedPackages.js.map +1 -1
  919. package/lib/esm/logic/kms/decryptDataKey.d.ts +2 -0
  920. package/lib/esm/logic/kms/decryptDataKey.js +20 -0
  921. package/lib/esm/logic/kms/decryptDataKey.js.map +1 -0
  922. package/lib/esm/logic/kms/generateDataKey.d.ts +3 -0
  923. package/lib/esm/logic/kms/generateDataKey.js +21 -0
  924. package/lib/esm/logic/kms/generateDataKey.js.map +1 -0
  925. package/lib/esm/logic/kms/getCachedGeneratedDataKey.d.ts +3 -0
  926. package/lib/esm/logic/kms/getCachedGeneratedDataKey.js +24 -0
  927. package/lib/esm/logic/kms/getCachedGeneratedDataKey.js.map +1 -0
  928. package/lib/esm/logic/kms/getCachedUnwrappedDataKey.d.ts +2 -0
  929. package/lib/esm/logic/kms/getCachedUnwrappedDataKey.js +24 -0
  930. package/lib/esm/logic/kms/getCachedUnwrappedDataKey.js.map +1 -0
  931. package/lib/esm/logic/kms/toKmsEncryptionContext.d.ts +2 -0
  932. package/lib/esm/logic/kms/toKmsEncryptionContext.js +6 -0
  933. package/lib/esm/logic/kms/toKmsEncryptionContext.js.map +1 -0
  934. package/lib/esm/logic/lambda/executeLambdaByName.d.ts +5 -1
  935. package/lib/esm/logic/lambda/executeLambdaByName.js +6 -3
  936. package/lib/esm/logic/lambda/executeLambdaByName.js.map +1 -1
  937. package/lib/esm/logic/neptune/getNeptuneEndpoints.js +7 -6
  938. package/lib/esm/logic/neptune/getNeptuneEndpoints.js.map +1 -1
  939. package/lib/esm/logic/parametersManager/getParameters.js +2 -1
  940. package/lib/esm/logic/parametersManager/getParameters.js.map +1 -1
  941. package/lib/esm/logic/s3/deleteFiles.d.ts +1 -0
  942. package/lib/esm/logic/s3/deleteFiles.js +16 -9
  943. package/lib/esm/logic/s3/deleteFiles.js.map +1 -1
  944. package/lib/esm/logic/s3/generatePresignedUploadUrl.d.ts +1 -0
  945. package/lib/esm/logic/s3/generatePresignedUploadUrl.js +2 -31
  946. package/lib/esm/logic/s3/generatePresignedUploadUrl.js.map +1 -1
  947. package/lib/esm/logic/s3/generatePresignedUrl.d.ts +1 -0
  948. package/lib/esm/logic/s3/generatePresignedUrl.js +4 -11
  949. package/lib/esm/logic/s3/generatePresignedUrl.js.map +1 -1
  950. package/lib/esm/logic/s3/listFiles.d.ts +5 -4
  951. package/lib/esm/logic/s3/listFiles.js +20 -27
  952. package/lib/esm/logic/s3/listFiles.js.map +1 -1
  953. package/lib/esm/logic/s3/s3Utils.d.ts +3 -0
  954. package/lib/esm/logic/s3/s3Utils.js +5 -0
  955. package/lib/esm/logic/s3/s3Utils.js.map +1 -1
  956. package/lib/esm/logic/secretsManager/getSecret.js +2 -3
  957. package/lib/esm/logic/secretsManager/getSecret.js.map +1 -1
  958. package/lib/esm/logic/sesV2/buildRawMimeMessage.d.ts +2 -0
  959. package/lib/esm/logic/sesV2/buildRawMimeMessage.js +74 -0
  960. package/lib/esm/logic/sesV2/buildRawMimeMessage.js.map +1 -0
  961. package/lib/esm/logic/sesV2/sendEmail.d.ts +2 -0
  962. package/lib/esm/logic/sesV2/sendEmail.js +37 -0
  963. package/lib/esm/logic/sesV2/sendEmail.js.map +1 -0
  964. package/lib/esm/logic/sns/publishMessage.d.ts +7 -2
  965. package/lib/esm/logic/sns/publishMessage.js +11 -17
  966. package/lib/esm/logic/sns/publishMessage.js.map +1 -1
  967. package/lib/esm/logic/sqs/sendMessages.d.ts +7 -2
  968. package/lib/esm/logic/sqs/sendMessages.js +9 -8
  969. package/lib/esm/logic/sqs/sendMessages.js.map +1 -1
  970. package/lib/esm/runtimeConfig/LambdaRuntimeConfig.d.ts +9 -0
  971. package/lib/esm/runtimeConfig/LambdaRuntimeConfig.js +2 -0
  972. package/lib/esm/runtimeConfig/LambdaRuntimeConfig.js.map +1 -0
  973. package/lib/esm/runtimeConfig/index.d.ts +2 -0
  974. package/lib/esm/runtimeConfig/index.js +3 -0
  975. package/lib/esm/runtimeConfig/index.js.map +1 -0
  976. package/lib/esm/runtimeConfig/resolveParameterKey.d.ts +7 -0
  977. package/lib/esm/runtimeConfig/resolveParameterKey.js +12 -0
  978. package/lib/esm/runtimeConfig/resolveParameterKey.js.map +1 -0
  979. package/lib/extension-layer/qpq-log-extension/index.js +32 -32
  980. package/package.json +28 -25
  981. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/neptune.d.ts +0 -26
  982. package/lib/commonjs/getActionProcessor/core/graphDatabase/stories/types/neptune.js.map +0 -1
  983. package/lib/commonjs/lambdaHandlers/helpers/logger.d.ts +0 -8
  984. package/lib/commonjs/lambdaHandlers/helpers/logger.js.map +0 -1
  985. package/lib/commonjs/lambdaHandlers/types/QpqWarmLambdaEvent.d.ts +0 -5
  986. package/lib/commonjs/lambdaHandlers/types/QpqWarmLambdaEvent.js.map +0 -1
  987. package/lib/commonjs/lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.d.ts +0 -1
  988. package/lib/commonjs/lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.js.map +0 -1
  989. package/lib/commonjs/lambdas/lambda-utils/QpqWarmLambdaEvent.d.ts +0 -5
  990. package/lib/commonjs/lambdas/lambda-utils/QpqWarmLambdaEvent.js.map +0 -1
  991. package/lib/commonjs/lambdas/lambdaSQSEvent.d.ts +0 -2
  992. package/lib/commonjs/lambdas/lambdaSQSEvent.js +0 -16
  993. package/lib/commonjs/lambdas/lambdaSQSEvent.js.map +0 -1
  994. package/lib/commonjs/logic/acm/findMatchingCertificates.d.ts +0 -1
  995. package/lib/commonjs/logic/acm/findMatchingCertificates.js +0 -53
  996. package/lib/commonjs/logic/acm/findMatchingCertificates.js.map +0 -1
  997. package/lib/commonjs/logic/acm/getDomainValidationOptions.d.ts +0 -2
  998. package/lib/commonjs/logic/acm/getDomainValidationOptions.js +0 -41
  999. package/lib/commonjs/logic/acm/getDomainValidationOptions.js.map +0 -1
  1000. package/lib/commonjs/logic/apiGateway/websocketSendMessage.d.ts +0 -1
  1001. package/lib/commonjs/logic/apiGateway/websocketSendMessage.js.map +0 -1
  1002. package/lib/commonjs/logic/cognito/getUser.d.ts +0 -10
  1003. package/lib/commonjs/logic/cognito/getUser.js +0 -39
  1004. package/lib/commonjs/logic/cognito/getUser.js.map +0 -1
  1005. package/lib/commonjs/logic/cognito/respondToAuthChallengeChallenge.d.ts +0 -3
  1006. package/lib/commonjs/logic/cognito/respondToAuthChallengeChallenge.js.map +0 -1
  1007. package/lib/commonjs/logic/cognito/utils/transformCognitoResponse.d.ts +0 -5
  1008. package/lib/commonjs/logic/cognito/utils/transformCognitoResponse.js +0 -48
  1009. package/lib/commonjs/logic/cognito/utils/transformCognitoResponse.js.map +0 -1
  1010. package/lib/commonjs/logic/cognito/verifyJwt.d.ts +0 -1
  1011. package/lib/commonjs/logic/cognito/verifyJwt.js.map +0 -1
  1012. package/lib/commonjs/logic/dynamo/convertObjectToDynamoMap.d.ts +0 -1
  1013. package/lib/commonjs/logic/dynamo/convertObjectToDynamoMap.js +0 -67
  1014. package/lib/commonjs/logic/dynamo/convertObjectToDynamoMap.js.map +0 -1
  1015. package/lib/commonjs/logic/dynamo/getLogByCorrelation.d.ts +0 -2
  1016. package/lib/commonjs/logic/dynamo/getLogByCorrelation.js +0 -55
  1017. package/lib/commonjs/logic/dynamo/getLogByCorrelation.js.map +0 -1
  1018. package/lib/commonjs/logic/dynamo/getLogChildrenByFromCorrelation.d.ts +0 -2
  1019. package/lib/commonjs/logic/dynamo/getLogChildrenByFromCorrelation.js +0 -65
  1020. package/lib/commonjs/logic/dynamo/getLogChildrenByFromCorrelation.js.map +0 -1
  1021. package/lib/commonjs/logic/dynamo/getPagedItemsOverRange.d.ts +0 -2
  1022. package/lib/commonjs/logic/dynamo/getPagedItemsOverRange.js +0 -68
  1023. package/lib/commonjs/logic/dynamo/getPagedItemsOverRange.js.map +0 -1
  1024. package/lib/commonjs/logic/dynamo/logs/index.d.ts +0 -1
  1025. package/lib/commonjs/logic/dynamo/logs/index.js.map +0 -1
  1026. package/lib/commonjs/logic/dynamo/logs/utils/index.js.map +0 -1
  1027. package/lib/commonjs/logic/dynamo/logs/utils/lastEvaluatedKeyToString.d.ts +0 -1
  1028. package/lib/commonjs/logic/dynamo/logs/utils/lastEvaluatedKeyToString.js.map +0 -1
  1029. package/lib/commonjs/logic/dynamo/logs/utils/stringToLastEvaluatedKey.d.ts +0 -2
  1030. package/lib/commonjs/logic/dynamo/logs/utils/stringToLastEvaluatedKey.js +0 -7
  1031. package/lib/commonjs/logic/dynamo/logs/utils/stringToLastEvaluatedKey.js.map +0 -1
  1032. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.d.ts +0 -10
  1033. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.js +0 -200
  1034. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.js.map +0 -1
  1035. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.d.ts +0 -11
  1036. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js +0 -144
  1037. package/lib/commonjs/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js.map +0 -1
  1038. package/lib/commonjs/logic/dynamo/utils/qpqPagedDataToItems.d.ts +0 -4
  1039. package/lib/commonjs/logic/dynamo/utils/qpqPagedDataToItems.js +0 -10
  1040. package/lib/commonjs/logic/dynamo/utils/qpqPagedDataToItems.js.map +0 -1
  1041. package/lib/commonjs/runtimeConfig/QPQAWSResourceMap.d.ts +0 -4
  1042. package/lib/commonjs/runtimeConfig/QPQAWSResourceMap.js.map +0 -1
  1043. package/lib/commonjs/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.d.ts +0 -4
  1044. package/lib/commonjs/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js +0 -20
  1045. package/lib/commonjs/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js.map +0 -1
  1046. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/neptune.d.ts +0 -26
  1047. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/neptune.js +0 -2
  1048. package/lib/esm/getActionProcessor/core/graphDatabase/stories/types/neptune.js.map +0 -1
  1049. package/lib/esm/lambdaHandlers/helpers/logger.d.ts +0 -8
  1050. package/lib/esm/lambdaHandlers/helpers/logger.js.map +0 -1
  1051. package/lib/esm/lambdaHandlers/types/QpqWarmLambdaEvent.d.ts +0 -5
  1052. package/lib/esm/lambdaHandlers/types/QpqWarmLambdaEvent.js +0 -2
  1053. package/lib/esm/lambdaHandlers/types/QpqWarmLambdaEvent.js.map +0 -1
  1054. package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.d.ts +0 -1
  1055. package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.js +0 -4
  1056. package/lib/esm/lambdas/dynamicModuleLoader/dynamicModuleLoaderWarmer.js.map +0 -1
  1057. package/lib/esm/lambdas/lambda-utils/QpqWarmLambdaEvent.d.ts +0 -5
  1058. package/lib/esm/lambdas/lambda-utils/QpqWarmLambdaEvent.js +0 -2
  1059. package/lib/esm/lambdas/lambda-utils/QpqWarmLambdaEvent.js.map +0 -1
  1060. package/lib/esm/lambdas/lambdaSQSEvent.d.ts +0 -2
  1061. package/lib/esm/lambdas/lambdaSQSEvent.js +0 -13
  1062. package/lib/esm/lambdas/lambdaSQSEvent.js.map +0 -1
  1063. package/lib/esm/logic/acm/findMatchingCertificates.d.ts +0 -1
  1064. package/lib/esm/logic/acm/findMatchingCertificates.js +0 -39
  1065. package/lib/esm/logic/acm/findMatchingCertificates.js.map +0 -1
  1066. package/lib/esm/logic/acm/getDomainValidationOptions.d.ts +0 -2
  1067. package/lib/esm/logic/acm/getDomainValidationOptions.js +0 -27
  1068. package/lib/esm/logic/acm/getDomainValidationOptions.js.map +0 -1
  1069. package/lib/esm/logic/apiGateway/websocketSendMessage.d.ts +0 -1
  1070. package/lib/esm/logic/apiGateway/websocketSendMessage.js.map +0 -1
  1071. package/lib/esm/logic/cognito/getUser.d.ts +0 -10
  1072. package/lib/esm/logic/cognito/getUser.js +0 -26
  1073. package/lib/esm/logic/cognito/getUser.js.map +0 -1
  1074. package/lib/esm/logic/cognito/respondToAuthChallengeChallenge.d.ts +0 -3
  1075. package/lib/esm/logic/cognito/respondToAuthChallengeChallenge.js.map +0 -1
  1076. package/lib/esm/logic/cognito/utils/transformCognitoResponse.d.ts +0 -5
  1077. package/lib/esm/logic/cognito/utils/transformCognitoResponse.js +0 -42
  1078. package/lib/esm/logic/cognito/utils/transformCognitoResponse.js.map +0 -1
  1079. package/lib/esm/logic/cognito/verifyJwt.d.ts +0 -1
  1080. package/lib/esm/logic/cognito/verifyJwt.js +0 -7
  1081. package/lib/esm/logic/cognito/verifyJwt.js.map +0 -1
  1082. package/lib/esm/logic/dynamo/convertObjectToDynamoMap.d.ts +0 -1
  1083. package/lib/esm/logic/dynamo/convertObjectToDynamoMap.js +0 -64
  1084. package/lib/esm/logic/dynamo/convertObjectToDynamoMap.js.map +0 -1
  1085. package/lib/esm/logic/dynamo/getLogByCorrelation.d.ts +0 -2
  1086. package/lib/esm/logic/dynamo/getLogByCorrelation.js +0 -40
  1087. package/lib/esm/logic/dynamo/getLogByCorrelation.js.map +0 -1
  1088. package/lib/esm/logic/dynamo/getLogChildrenByFromCorrelation.d.ts +0 -2
  1089. package/lib/esm/logic/dynamo/getLogChildrenByFromCorrelation.js +0 -50
  1090. package/lib/esm/logic/dynamo/getLogChildrenByFromCorrelation.js.map +0 -1
  1091. package/lib/esm/logic/dynamo/getPagedItemsOverRange.d.ts +0 -2
  1092. package/lib/esm/logic/dynamo/getPagedItemsOverRange.js +0 -53
  1093. package/lib/esm/logic/dynamo/getPagedItemsOverRange.js.map +0 -1
  1094. package/lib/esm/logic/dynamo/logs/index.d.ts +0 -1
  1095. package/lib/esm/logic/dynamo/logs/index.js +0 -2
  1096. package/lib/esm/logic/dynamo/logs/index.js.map +0 -1
  1097. package/lib/esm/logic/dynamo/logs/utils/index.js +0 -3
  1098. package/lib/esm/logic/dynamo/logs/utils/index.js.map +0 -1
  1099. package/lib/esm/logic/dynamo/logs/utils/lastEvaluatedKeyToString.d.ts +0 -1
  1100. package/lib/esm/logic/dynamo/logs/utils/lastEvaluatedKeyToString.js.map +0 -1
  1101. package/lib/esm/logic/dynamo/logs/utils/stringToLastEvaluatedKey.d.ts +0 -2
  1102. package/lib/esm/logic/dynamo/logs/utils/stringToLastEvaluatedKey.js +0 -4
  1103. package/lib/esm/logic/dynamo/logs/utils/stringToLastEvaluatedKey.js.map +0 -1
  1104. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.d.ts +0 -10
  1105. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.js +0 -186
  1106. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoQuery.js.map +0 -1
  1107. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.d.ts +0 -11
  1108. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js +0 -138
  1109. package/lib/esm/logic/dynamo/qpqDynamoOrm/buildDynamoUpdate.js.map +0 -1
  1110. package/lib/esm/logic/dynamo/utils/qpqPagedDataToItems.d.ts +0 -4
  1111. package/lib/esm/logic/dynamo/utils/qpqPagedDataToItems.js +0 -6
  1112. package/lib/esm/logic/dynamo/utils/qpqPagedDataToItems.js.map +0 -1
  1113. package/lib/esm/runtimeConfig/QPQAWSResourceMap.d.ts +0 -4
  1114. package/lib/esm/runtimeConfig/QPQAWSResourceMap.js +0 -2
  1115. package/lib/esm/runtimeConfig/QPQAWSResourceMap.js.map +0 -1
  1116. package/lib/esm/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.d.ts +0 -4
  1117. package/lib/esm/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js +0 -13
  1118. package/lib/esm/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"memoFuncAsync.js","sourceRoot":"","sources":["../../../../src/logic/cache/memoFuncAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAAmC;AAEnC,MAAM,KAAK,GAAG,IAAI,OAAO,EAAqB,CAAC;AAE/C;;;;;GAKG;AACI,MAAM,aAAa,GAAG,CAAoC,IAAO,EAAE,eAAuB,IAAI,EAAK,EAAE;IAC1G,OAAO,CAAC,CAAO,GAAG,IAAW,EAAE,EAAE;QAC/B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,oBAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAEnC,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC,GAAG,CAAI,QAAQ,CAAC,CAAC;QACpC,CAAC;QAED,mBAAmB;QACnB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QAEnC,oBAAoB;QACpB,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEhC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAA,CAAiB,CAAC;AACrB,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB","sourcesContent":["import NodeCache from 'node-cache';\n\nconst cache = new WeakMap<object, NodeCache>();\n\n/**\n * Memoizes a function by caching its return values.\n * @param func The function to memoize.\n * @param ttlInSeconds Time-to-live for the cached values in seconds.\n * @returns The memoized function.\n */\nexport const memoFuncAsync = <T extends (...args: any[]) => any>(func: T, ttlInSeconds: number = 3600): T => {\n return (async (...args: any[]) => {\n if (!cache.has(func)) {\n cache.set(func, new NodeCache({ stdTTL: ttlInSeconds }));\n }\n\n const cacheKey = JSON.stringify(args);\n const nodeCache = cache.get(func)!;\n\n if (nodeCache.has(cacheKey)) {\n return nodeCache.get<T>(cacheKey);\n }\n\n // Await the result\n const result = await func(...args);\n\n // and then cache it\n nodeCache.set(cacheKey, result);\n\n return result;\n }) as unknown as T;\n};\n"]}
1
+ {"version":3,"file":"memoFuncAsync.js","sourceRoot":"","sources":["../../../../src/logic/cache/memoFuncAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAAmC;AAKnC,2EAA2E;AAC3E,MAAM,KAAK,GAAG,IAAI,OAAO,EAAsB,CAAC;AAEhD;;;;;;GAMG;AACI,MAAM,aAAa,GAAG,CAAoB,IAAO,EAAE,eAAuB,IAAI,EAAK,EAAE;IAC1F,OAAO,CAAC,CAAO,GAAG,IAAmB,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,oBAAS,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC;QAEnC,IAAI,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC,GAAG,CAAyB,QAAQ,CAAC,CAAC;QACzD,CAAC;QAED,0DAA0D;QAC1D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACnC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEhC,OAAO,MAAM,CAAC;IAChB,CAAC,CAAA,CAAiB,CAAC;AACrB,CAAC,CAAC;AAnBW,QAAA,aAAa,iBAmBxB","sourcesContent":["import NodeCache from 'node-cache';\n\n// `any` is the variance boundary that lets one signature wrap functions of any arity.\ntype AnyFunc = (...args: any[]) => any;\n\n// Keyed per wrapped function so each memoized function gets its own cache.\nconst cache = new WeakMap<AnyFunc, NodeCache>();\n\n/**\n * Memoizes an async function by its JSON-stringified arguments, caching the RESOLVED\n * value (falsy values included). A rejected promise is not cached, so failures retry.\n * @param func The function to memoize.\n * @param ttlInSeconds Time-to-live for the cached values in seconds.\n * @returns The memoized function.\n */\nexport const memoFuncAsync = <T extends AnyFunc>(func: T, ttlInSeconds: number = 3600): T => {\n return (async (...args: Parameters<T>) => {\n if (!cache.has(func)) {\n cache.set(func, new NodeCache({ stdTTL: ttlInSeconds }));\n }\n\n const cacheKey = JSON.stringify(args);\n const nodeCache = cache.get(func)!;\n\n if (nodeCache.has(cacheKey)) {\n return nodeCache.get<Awaited<ReturnType<T>>>(cacheKey);\n }\n\n // Await before caching so only resolved values are stored\n const result = await func(...args);\n nodeCache.set(cacheKey, result);\n\n return result;\n }) as unknown as T;\n};\n"]}
@@ -1,2 +1 @@
1
- export declare const getInvalidationCallerReference: (paths: string[]) => string;
2
1
  export declare const invalidateCache: (distributionId: string, region: string, paths: string[]) => Promise<void>;
@@ -12,31 +12,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.invalidateCache = exports.getInvalidationCallerReference = void 0;
15
+ exports.invalidateCache = void 0;
16
16
  const crypto_1 = __importDefault(require("crypto"));
17
17
  const client_cloudfront_1 = require("@aws-sdk/client-cloudfront");
18
18
  const createAwsClient_1 = require("../createAwsClient");
19
+ // CloudFront dedupes CreateInvalidation calls by CallerReference, so it must be unique
20
+ // per request: hash of the paths plus the current time.
19
21
  const getInvalidationCallerReference = (paths) => {
20
- const allPaths = paths.join('');
21
- // All paths as a hash
22
- const allPathHash = crypto_1.default.createHash('md5').update(allPaths).digest('hex');
23
- // Unique key is the now time with all paths hash
22
+ const allPathHash = crypto_1.default.createHash('md5').update(paths.join('')).digest('hex');
24
23
  return allPathHash + new Date().toISOString();
25
24
  };
26
- exports.getInvalidationCallerReference = getInvalidationCallerReference;
27
25
  const invalidateCache = (distributionId, region, paths) => __awaiter(void 0, void 0, void 0, function* () {
28
26
  const cloudFrontClient = (0, createAwsClient_1.createAwsClient)(client_cloudfront_1.CloudFrontClient, { region });
29
- const input = {
27
+ yield cloudFrontClient.send(new client_cloudfront_1.CreateInvalidationCommand({
30
28
  DistributionId: distributionId,
31
29
  InvalidationBatch: {
32
30
  Paths: {
33
31
  Quantity: paths.length,
34
32
  Items: paths,
35
33
  },
36
- CallerReference: (0, exports.getInvalidationCallerReference)(paths),
34
+ CallerReference: getInvalidationCallerReference(paths),
37
35
  },
38
- };
39
- yield cloudFrontClient.send(new client_cloudfront_1.CreateInvalidationCommand(input));
36
+ }));
40
37
  });
41
38
  exports.invalidateCache = invalidateCache;
42
39
  //# sourceMappingURL=invalidateCache.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalidateCache.js","sourceRoot":"","sources":["../../../../src/logic/cloudFront/invalidateCache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,kEAAyH;AAEzH,wDAAqD;AAE9C,MAAM,8BAA8B,GAAG,CAAC,KAAe,EAAU,EAAE;IACxE,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhC,sBAAsB;IACtB,MAAM,WAAW,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAE5E,iDAAiD;IACjD,OAAO,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAChD,CAAC,CAAC;AARW,QAAA,8BAA8B,kCAQzC;AAEK,MAAM,eAAe,GAAG,CAAO,cAAsB,EAAE,MAAc,EAAE,KAAe,EAAiB,EAAE;IAC9G,MAAM,gBAAgB,GAAG,IAAA,iCAAe,EAAC,oCAAgB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAmC;QAC5C,cAAc,EAAE,cAAc;QAC9B,iBAAiB,EAAE;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK,CAAC,MAAM;gBACtB,KAAK,EAAE,KAAK;aACb;YACD,eAAe,EAAE,IAAA,sCAA8B,EAAC,KAAK,CAAC;SACvD;KACF,CAAC;IAEF,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,6CAAyB,CAAC,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC,CAAA,CAAC;AAfW,QAAA,eAAe,mBAe1B","sourcesContent":["import crypto from 'crypto';\nimport { CloudFrontClient, CreateInvalidationCommand, CreateInvalidationCommandInput } from '@aws-sdk/client-cloudfront';\n\nimport { createAwsClient } from '../createAwsClient';\n\nexport const getInvalidationCallerReference = (paths: string[]): string => {\n const allPaths = paths.join('');\n\n // All paths as a hash\n const allPathHash = crypto.createHash('md5').update(allPaths).digest('hex');\n\n // Unique key is the now time with all paths hash\n return allPathHash + new Date().toISOString();\n};\n\nexport const invalidateCache = async (distributionId: string, region: string, paths: string[]): Promise<void> => {\n const cloudFrontClient = createAwsClient(CloudFrontClient, { region });\n\n const input: CreateInvalidationCommandInput = {\n DistributionId: distributionId,\n InvalidationBatch: {\n Paths: {\n Quantity: paths.length,\n Items: paths,\n },\n CallerReference: getInvalidationCallerReference(paths),\n },\n };\n\n await cloudFrontClient.send(new CreateInvalidationCommand(input));\n};\n"]}
1
+ {"version":3,"file":"invalidateCache.js","sourceRoot":"","sources":["../../../../src/logic/cloudFront/invalidateCache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,kEAAyF;AAEzF,wDAAqD;AAErD,uFAAuF;AACvF,wDAAwD;AACxD,MAAM,8BAA8B,GAAG,CAAC,KAAe,EAAU,EAAE;IACjE,MAAM,WAAW,GAAG,gBAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAElF,OAAO,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAChD,CAAC,CAAC;AAEK,MAAM,eAAe,GAAG,CAAO,cAAsB,EAAE,MAAc,EAAE,KAAe,EAAiB,EAAE;IAC9G,MAAM,gBAAgB,GAAG,IAAA,iCAAe,EAAC,oCAAgB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvE,MAAM,gBAAgB,CAAC,IAAI,CACzB,IAAI,6CAAyB,CAAC;QAC5B,cAAc,EAAE,cAAc;QAC9B,iBAAiB,EAAE;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,KAAK,CAAC,MAAM;gBACtB,KAAK,EAAE,KAAK;aACb;YACD,eAAe,EAAE,8BAA8B,CAAC,KAAK,CAAC;SACvD;KACF,CAAC,CACH,CAAC;AACJ,CAAC,CAAA,CAAC;AAfW,QAAA,eAAe,mBAe1B","sourcesContent":["import crypto from 'crypto';\nimport { CloudFrontClient, CreateInvalidationCommand } from '@aws-sdk/client-cloudfront';\n\nimport { createAwsClient } from '../createAwsClient';\n\n// CloudFront dedupes CreateInvalidation calls by CallerReference, so it must be unique\n// per request: hash of the paths plus the current time.\nconst getInvalidationCallerReference = (paths: string[]): string => {\n const allPathHash = crypto.createHash('md5').update(paths.join('')).digest('hex');\n\n return allPathHash + new Date().toISOString();\n};\n\nexport const invalidateCache = async (distributionId: string, region: string, paths: string[]): Promise<void> => {\n const cloudFrontClient = createAwsClient(CloudFrontClient, { region });\n\n await cloudFrontClient.send(\n new CreateInvalidationCommand({\n DistributionId: distributionId,\n InvalidationBatch: {\n Paths: {\n Quantity: paths.length,\n Items: paths,\n },\n CallerReference: getInvalidationCallerReference(paths),\n },\n }),\n );\n};\n"]}
@@ -1 +1,5 @@
1
+ /**
2
+ * Resolves a CloudFormation export by name, paging through ListExports. Memoized
3
+ * (1 hour) because exports are deploy-time constants; throws if the export does not exist.
4
+ */
1
5
  export declare const getExportedValue: (variableName: string, region: string) => Promise<string>;
@@ -13,6 +13,10 @@ exports.getExportedValue = void 0;
13
13
  const client_cloudformation_1 = require("@aws-sdk/client-cloudformation");
14
14
  const memoFuncAsync_1 = require("../cache/memoFuncAsync");
15
15
  const createAwsClient_1 = require("../createAwsClient");
16
+ /**
17
+ * Resolves a CloudFormation export by name, paging through ListExports. Memoized
18
+ * (1 hour) because exports are deploy-time constants; throws if the export does not exist.
19
+ */
16
20
  exports.getExportedValue = (0, memoFuncAsync_1.memoFuncAsync)((variableName, region) => __awaiter(void 0, void 0, void 0, function* () {
17
21
  var _a;
18
22
  const cloudformation = (0, createAwsClient_1.createAwsClient)(client_cloudformation_1.CloudFormationClient, { region });
@@ -1 +1 @@
1
- {"version":3,"file":"getExportedValue.js","sourceRoot":"","sources":["../../../../src/logic/cloudformation/getExportedValue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0EAAmH;AAEnH,0DAAuD;AACvD,wDAAqD;AAExC,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAAC,CAAO,YAAoB,EAAE,MAAc,EAAmB,EAAE;;IAC5G,MAAM,cAAc,GAAG,IAAA,iCAAe,EAAC,4CAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAA4B,EAAE,CAAC;IAEtD,GAAG,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,0CAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEpF,MAAM,KAAK,GAAG,MAAA,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,0CAAE,KAAK,CAAC;QACjF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,cAAc,YAAY,QAAQ,KAAK,GAAG,CAAC,CAAC;YACxD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,iBAAiB,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACjD,CAAC,QAAQ,iBAAiB,CAAC,SAAS,EAAE;IAEtC,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAA,CAAC,CAAC","sourcesContent":["import { CloudFormationClient, ListExportsCommand, ListExportsCommandInput } from '@aws-sdk/client-cloudformation';\n\nimport { memoFuncAsync } from '../cache/memoFuncAsync';\nimport { createAwsClient } from '../createAwsClient';\n\nexport const getExportedValue = memoFuncAsync(async (variableName: string, region: string): Promise<string> => {\n const cloudformation = createAwsClient(CloudFormationClient, { region });\n\n const listCommandParams: ListExportsCommandInput = {};\n\n do {\n const result = await cloudformation.send(new ListExportsCommand(listCommandParams));\n\n const value = (result.Exports || []).find((e) => e.Name === variableName)?.Value;\n if (value !== undefined) {\n console.log(`CF Found: [${variableName}] = [${value}]`);\n return value;\n }\n\n listCommandParams.NextToken = result.NextToken;\n } while (listCommandParams.NextToken);\n\n throw new Error(`CF could not find: [${variableName}]`);\n});\n"]}
1
+ {"version":3,"file":"getExportedValue.js","sourceRoot":"","sources":["../../../../src/logic/cloudformation/getExportedValue.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0EAAmH;AAEnH,0DAAuD;AACvD,wDAAqD;AAErD;;;GAGG;AACU,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAAC,CAAO,YAAoB,EAAE,MAAc,EAAmB,EAAE;;IAC5G,MAAM,cAAc,GAAG,IAAA,iCAAe,EAAC,4CAAoB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAEzE,MAAM,iBAAiB,GAA4B,EAAE,CAAC;IAEtD,GAAG,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,0CAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAEpF,MAAM,KAAK,GAAG,MAAA,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,0CAAE,KAAK,CAAC;QACjF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,CAAC,GAAG,CAAC,cAAc,YAAY,QAAQ,KAAK,GAAG,CAAC,CAAC;YACxD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,iBAAiB,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACjD,CAAC,QAAQ,iBAAiB,CAAC,SAAS,EAAE;IAEtC,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,GAAG,CAAC,CAAC;AAC1D,CAAC,CAAA,CAAC,CAAC","sourcesContent":["import { CloudFormationClient, ListExportsCommand, ListExportsCommandInput } from '@aws-sdk/client-cloudformation';\n\nimport { memoFuncAsync } from '../cache/memoFuncAsync';\nimport { createAwsClient } from '../createAwsClient';\n\n/**\n * Resolves a CloudFormation export by name, paging through ListExports. Memoized\n * (1 hour) because exports are deploy-time constants; throws if the export does not exist.\n */\nexport const getExportedValue = memoFuncAsync(async (variableName: string, region: string): Promise<string> => {\n const cloudformation = createAwsClient(CloudFormationClient, { region });\n\n const listCommandParams: ListExportsCommandInput = {};\n\n do {\n const result = await cloudformation.send(new ListExportsCommand(listCommandParams));\n\n const value = (result.Exports || []).find((e) => e.Name === variableName)?.Value;\n if (value !== undefined) {\n console.log(`CF Found: [${variableName}] = [${value}]`);\n return value;\n }\n\n listCommandParams.NextToken = result.NextToken;\n } while (listCommandParams.NextToken);\n\n throw new Error(`CF could not find: [${variableName}]`);\n});\n"]}
@@ -1,2 +1,6 @@
1
1
  import { AuthenticateUserResponse } from 'quidproquo-core';
2
+ /**
3
+ * Starts a Cognito auth flow (password auth, or CUSTOM_AUTH when isCustom) and
4
+ * returns the qpq response: either issued tokens or a pending challenge.
5
+ */
2
6
  export declare const authenticateUser: (userPoolId: string, clientId: string, region: string, isCustom: boolean, username: string, password?: string) => Promise<AuthenticateUserResponse>;
@@ -13,16 +13,21 @@ exports.authenticateUser = void 0;
13
13
  const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
14
14
  const createAwsClient_1 = require("../createAwsClient");
15
15
  const calculateSecretHash_1 = require("./utils/calculateSecretHash");
16
- const transformCognitoResponse_1 = require("./utils/transformCognitoResponse");
16
+ const cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo_1 = require("./utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo");
17
17
  const getUserPoolClientSecret_1 = require("./getUserPoolClientSecret");
18
18
  // TODO: retry for TooManyRequestsException
19
+ /**
20
+ * Starts a Cognito auth flow (password auth, or CUSTOM_AUTH when isCustom) and
21
+ * returns the qpq response: either issued tokens or a pending challenge.
22
+ */
19
23
  const authenticateUser = (userPoolId, clientId, region, isCustom, username, password) => __awaiter(void 0, void 0, void 0, function* () {
20
24
  const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
21
25
  region,
22
26
  });
23
27
  const clientSecret = yield (0, getUserPoolClientSecret_1.getUserPoolClientSecret)(userPoolId, clientId, region);
24
28
  const secretHash = (0, calculateSecretHash_1.calculateSecretHash)(username, clientId, clientSecret);
25
- // Time we issued the request
29
+ // Token expiry is computed relative to this; captured before the call so the
30
+ // derived expiresAt errs early rather than late.
26
31
  const issueDateTime = new Date().toISOString();
27
32
  const params = {
28
33
  AuthFlow: isCustom ? client_cognito_identity_provider_1.AuthFlowType.CUSTOM_AUTH : client_cognito_identity_provider_1.AuthFlowType.ADMIN_USER_PASSWORD_AUTH,
@@ -37,7 +42,7 @@ const authenticateUser = (userPoolId, clientId, region, isCustom, username, pass
37
42
  params.AuthParameters.PASSWORD = password;
38
43
  }
39
44
  const response = yield cognitoClient.send(new client_cognito_identity_provider_1.AdminInitiateAuthCommand(params));
40
- return (0, transformCognitoResponse_1.cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo)(response, issueDateTime);
45
+ return (0, cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo_1.cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo)(response, issueDateTime);
41
46
  });
42
47
  exports.authenticateUser = authenticateUser;
43
48
  //# sourceMappingURL=authenticateUser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authenticateUser.js","sourceRoot":"","sources":["../../../../src/logic/cognito/authenticateUser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAKmD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,+EAA2G;AAC3G,uEAAoE;AAEpE,2CAA2C;AAEpC,MAAM,gBAAgB,GAAG,CAC9B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAiB,EACjB,QAAgB,EAChB,QAAiB,EACkB,EAAE;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,6BAA6B;IAC7B,MAAM,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE/C,MAAM,MAAM,GAAkC;QAC5C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,+CAAY,CAAC,WAAW,CAAC,CAAC,CAAC,+CAAY,CAAC,wBAAwB;QACrF,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAElB,cAAc,EAAE;YACd,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,UAAU;SACxB;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,CAAC,cAAe,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,2DAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhF,OAAO,IAAA,kFAAuD,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC1F,CAAC,CAAA,CAAC;AApCW,QAAA,gBAAgB,oBAoC3B","sourcesContent":["import { AuthenticateUserChallenge, AuthenticateUserResponse, UserDirectoryAuthenticateUserActionPayload } from 'quidproquo-core';\n\nimport {\n AdminInitiateAuthCommand,\n AdminInitiateAuthCommandInput,\n AuthFlowType,\n CognitoIdentityProviderClient,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo } from './utils/transformCognitoResponse';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\n// TODO: retry for TooManyRequestsException\n\nexport const authenticateUser = async (\n userPoolId: string,\n clientId: string,\n region: string,\n isCustom: boolean,\n username: string,\n password?: string,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n // Time we issued the request\n const issueDateTime = new Date().toISOString();\n\n const params: AdminInitiateAuthCommandInput = {\n AuthFlow: isCustom ? AuthFlowType.CUSTOM_AUTH : AuthFlowType.ADMIN_USER_PASSWORD_AUTH,\n UserPoolId: userPoolId,\n ClientId: clientId,\n\n AuthParameters: {\n USERNAME: username,\n SECRET_HASH: secretHash,\n },\n };\n\n if (password) {\n params.AuthParameters!.PASSWORD = password;\n }\n\n const response = await cognitoClient.send(new AdminInitiateAuthCommand(params));\n\n return cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo(response, issueDateTime);\n};\n"]}
1
+ {"version":3,"file":"authenticateUser.js","sourceRoot":"","sources":["../../../../src/logic/cognito/authenticateUser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAKmD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,6IAA0I;AAC1I,uEAAoE;AAEpE,2CAA2C;AAE3C;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAC9B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAiB,EACjB,QAAgB,EAChB,QAAiB,EACkB,EAAE;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,6EAA6E;IAC7E,iDAAiD;IACjD,MAAM,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE/C,MAAM,MAAM,GAAkC;QAC5C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,+CAAY,CAAC,WAAW,CAAC,CAAC,CAAC,+CAAY,CAAC,wBAAwB;QACrF,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAElB,cAAc,EAAE;YACd,QAAQ,EAAE,QAAQ;YAClB,WAAW,EAAE,UAAU;SACxB;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,CAAC,cAAe,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,2DAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhF,OAAO,IAAA,iHAAuD,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAC1F,CAAC,CAAA,CAAC;AArCW,QAAA,gBAAgB,oBAqC3B","sourcesContent":["import { AuthenticateUserResponse } from 'quidproquo-core';\n\nimport {\n AdminInitiateAuthCommand,\n AdminInitiateAuthCommandInput,\n AuthFlowType,\n CognitoIdentityProviderClient,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo } from './utils/cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\n// TODO: retry for TooManyRequestsException\n\n/**\n * Starts a Cognito auth flow (password auth, or CUSTOM_AUTH when isCustom) and\n * returns the qpq response: either issued tokens or a pending challenge.\n */\nexport const authenticateUser = async (\n userPoolId: string,\n clientId: string,\n region: string,\n isCustom: boolean,\n username: string,\n password?: string,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n // Token expiry is computed relative to this; captured before the call so the\n // derived expiresAt errs early rather than late.\n const issueDateTime = new Date().toISOString();\n\n const params: AdminInitiateAuthCommandInput = {\n AuthFlow: isCustom ? AuthFlowType.CUSTOM_AUTH : AuthFlowType.ADMIN_USER_PASSWORD_AUTH,\n UserPoolId: userPoolId,\n ClientId: clientId,\n\n AuthParameters: {\n USERNAME: username,\n SECRET_HASH: secretHash,\n },\n };\n\n if (password) {\n params.AuthParameters!.PASSWORD = password;\n }\n\n const response = await cognitoClient.send(new AdminInitiateAuthCommand(params));\n\n return cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo(response, issueDateTime);\n};\n"]}
@@ -1,11 +1,3 @@
1
1
  import { UserAttributes } from 'quidproquo-core';
2
+ /** Maps qpq UserAttributes keys to their Cognito standard attribute names. */
2
3
  export declare const cognitoAttributeMap: Record<keyof UserAttributes, string>;
3
- export declare const getCognitoUserAttributesFromQpqUserAttributes: (userAttributes: UserAttributes) => {
4
- Name: string;
5
- Value: string;
6
- }[];
7
- export declare const getQpqAttributesFromCognitoUserAttributes: (cognitoUserAttributes: {
8
- Name: string;
9
- Value: string;
10
- }[]) => UserAttributes;
11
- export declare const getQpqAttributesFromCognitoStringMap: (cognitoUserAttributes: Record<string, string>) => UserAttributes;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getQpqAttributesFromCognitoStringMap = exports.getQpqAttributesFromCognitoUserAttributes = exports.getCognitoUserAttributesFromQpqUserAttributes = exports.cognitoAttributeMap = void 0;
3
+ exports.cognitoAttributeMap = void 0;
4
+ /** Maps qpq UserAttributes keys to their Cognito standard attribute names. */
4
5
  exports.cognitoAttributeMap = {
5
6
  email: 'email',
6
7
  emailVerified: 'email_verified',
@@ -21,39 +22,4 @@ exports.cognitoAttributeMap = {
21
22
  website: 'website',
22
23
  zoneInfo: 'zoneinfo',
23
24
  };
24
- // Flip the cognitoAttributeMap for reverse mapping
25
- const reversedCognitoAttributeMap = Object.entries(exports.cognitoAttributeMap).reduce((acc, [key, value]) => (Object.assign(Object.assign({}, acc), { [value]: key })), {});
26
- const getCognitoUserAttributesFromQpqUserAttributes = (userAttributes) => {
27
- return Object.keys(userAttributes)
28
- .map((key) => ({
29
- Name: exports.cognitoAttributeMap[key],
30
- Value: `${userAttributes[key]}`,
31
- }))
32
- .filter((attribute) => !!attribute.Name && !!attribute.Value);
33
- };
34
- exports.getCognitoUserAttributesFromQpqUserAttributes = getCognitoUserAttributesFromQpqUserAttributes;
35
- const getQpqAttributeObjectFromCognitoKeyValue = (key, value) => {
36
- const userAttributeKey = reversedCognitoAttributeMap[key];
37
- if (!userAttributeKey) {
38
- return {}; // If there's no matching key in your mapping, just return nothing
39
- }
40
- if (userAttributeKey === 'emailVerified') {
41
- // Assume the value of 'email_verified' is a string of 'true' or 'false'
42
- return { [userAttributeKey]: value === 'true' };
43
- }
44
- return { [userAttributeKey]: value };
45
- };
46
- const getQpqAttributesFromCognitoUserAttributes = (cognitoUserAttributes) => {
47
- // Map cognitoUserAttributes to your UserAttributes format
48
- const userAttributes = cognitoUserAttributes.reduce((acc, { Name, Value }) => {
49
- return Object.assign(Object.assign({}, acc), getQpqAttributeObjectFromCognitoKeyValue(Name, Value));
50
- }, {});
51
- return userAttributes;
52
- };
53
- exports.getQpqAttributesFromCognitoUserAttributes = getQpqAttributesFromCognitoUserAttributes;
54
- const getQpqAttributesFromCognitoStringMap = (cognitoUserAttributes) => {
55
- const userAttributes = Object.keys(cognitoUserAttributes).reduce((acc, key) => (Object.assign(Object.assign({}, acc), getQpqAttributeObjectFromCognitoKeyValue(key, cognitoUserAttributes[key]))), {});
56
- return userAttributes;
57
- };
58
- exports.getQpqAttributesFromCognitoStringMap = getQpqAttributesFromCognitoStringMap;
59
25
  //# sourceMappingURL=cognitoAttributeMap.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cognitoAttributeMap.js","sourceRoot":"","sources":["../../../../src/logic/cognito/cognitoAttributeMap.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAyC;IACvE,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,KAAK;IAEb,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,oBAAoB;IACvC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,mDAAmD;AACnD,MAAM,2BAA2B,GAAyC,MAAM,CAAC,OAAO,CAAC,2BAAmB,CAAC,CAAC,MAAM,CAClH,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,iCAAM,GAAG,KAAE,CAAC,KAAK,CAAC,EAAE,GAAG,IAAG,EACjD,EAAE,CACH,CAAC;AAEK,MAAM,6CAA6C,GAAG,CAAC,cAA8B,EAAE,EAAE;IAC9F,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;SAC/B,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACb,IAAI,EAAE,2BAAmB,CAAC,GAA2B,CAAC;QACtD,KAAK,EAAE,GAAG,cAAc,CAAC,GAA2B,CAAC,EAAE;KACxD,CAAC,CAAC;SACF,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC;AAPW,QAAA,6CAA6C,iDAOxD;AAEF,MAAM,wCAAwC,GAAG,CAAC,GAAW,EAAE,KAAa,EAAkB,EAAE;IAC9F,MAAM,gBAAgB,GAAG,2BAA2B,CAAC,GAAG,CAAC,CAAC;IAE1D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACtB,OAAO,EAAE,CAAC,CAAC,kEAAkE;IAC/E,CAAC;IAED,IAAI,gBAAgB,KAAK,eAAe,EAAE,CAAC;QACzC,wEAAwE;QACxE,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,KAAK,KAAK,MAAM,EAAE,CAAC;IAClD,CAAC;IAED,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC;AACvC,CAAC,CAAC;AAEK,MAAM,yCAAyC,GAAG,CAAC,qBAAwD,EAAkB,EAAE;IACpI,0DAA0D;IAC1D,MAAM,cAAc,GAAmB,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QAC3F,uCACK,GAAG,GACH,wCAAwC,CAAC,IAAI,EAAE,KAAK,CAAC,EACxD;IACJ,CAAC,EAAE,EAAoB,CAAC,CAAC;IAEzB,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAVW,QAAA,yCAAyC,6CAUpD;AAEK,MAAM,oCAAoC,GAAG,CAAC,qBAA6C,EAAkB,EAAE;IACpH,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAC9D,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,iCACT,GAAG,GACH,wCAAwC,CAAC,GAAG,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC,EAC5E,EACF,EAAoB,CACrB,CAAC;IAEF,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AAVW,QAAA,oCAAoC,wCAU/C","sourcesContent":["import { CreateUserRequest, UserAttributes } from 'quidproquo-core';\n\nexport const cognitoAttributeMap: Record<keyof UserAttributes, string> = {\n email: 'email',\n emailVerified: 'email_verified',\n userId: 'sub',\n\n address: 'address',\n birthDate: 'birthdate',\n familyName: 'family_name',\n gender: 'gender',\n givenName: 'given_name',\n locale: 'locale',\n middleName: 'middle_name',\n name: 'name',\n nickname: 'nickname',\n phoneNumber: 'phone_number',\n picture: 'picture',\n preferredUsername: 'preferred_username',\n profile: 'profile',\n website: 'website',\n zoneInfo: 'zoneinfo',\n};\n\n// Flip the cognitoAttributeMap for reverse mapping\nconst reversedCognitoAttributeMap: Record<string, keyof UserAttributes> = Object.entries(cognitoAttributeMap).reduce(\n (acc, [key, value]) => ({ ...acc, [value]: key }),\n {},\n);\n\nexport const getCognitoUserAttributesFromQpqUserAttributes = (userAttributes: UserAttributes) => {\n return Object.keys(userAttributes)\n .map((key) => ({\n Name: cognitoAttributeMap[key as keyof UserAttributes],\n Value: `${userAttributes[key as keyof UserAttributes]}`,\n }))\n .filter((attribute) => !!attribute.Name && !!attribute.Value);\n};\n\nconst getQpqAttributeObjectFromCognitoKeyValue = (key: string, value: string): UserAttributes => {\n const userAttributeKey = reversedCognitoAttributeMap[key];\n\n if (!userAttributeKey) {\n return {}; // If there's no matching key in your mapping, just return nothing\n }\n\n if (userAttributeKey === 'emailVerified') {\n // Assume the value of 'email_verified' is a string of 'true' or 'false'\n return { [userAttributeKey]: value === 'true' };\n }\n\n return { [userAttributeKey]: value };\n};\n\nexport const getQpqAttributesFromCognitoUserAttributes = (cognitoUserAttributes: { Name: string; Value: string }[]): UserAttributes => {\n // Map cognitoUserAttributes to your UserAttributes format\n const userAttributes: UserAttributes = cognitoUserAttributes.reduce((acc, { Name, Value }) => {\n return {\n ...acc,\n ...getQpqAttributeObjectFromCognitoKeyValue(Name, Value),\n };\n }, {} as UserAttributes);\n\n return userAttributes;\n};\n\nexport const getQpqAttributesFromCognitoStringMap = (cognitoUserAttributes: Record<string, string>): UserAttributes => {\n const userAttributes = Object.keys(cognitoUserAttributes).reduce(\n (acc, key) => ({\n ...acc,\n ...getQpqAttributeObjectFromCognitoKeyValue(key, cognitoUserAttributes[key]),\n }),\n {} as UserAttributes,\n );\n\n return userAttributes;\n};\n"]}
1
+ {"version":3,"file":"cognitoAttributeMap.js","sourceRoot":"","sources":["../../../../src/logic/cognito/cognitoAttributeMap.ts"],"names":[],"mappings":";;;AAEA,8EAA8E;AACjE,QAAA,mBAAmB,GAAyC;IACvE,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,KAAK;IAEb,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,aAAa;IACzB,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,YAAY;IACvB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,cAAc;IAC3B,OAAO,EAAE,SAAS;IAClB,iBAAiB,EAAE,oBAAoB;IACvC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACrB,CAAC","sourcesContent":["import { UserAttributes } from 'quidproquo-core';\n\n/** Maps qpq UserAttributes keys to their Cognito standard attribute names. */\nexport const cognitoAttributeMap: Record<keyof UserAttributes, string> = {\n email: 'email',\n emailVerified: 'email_verified',\n userId: 'sub',\n\n address: 'address',\n birthDate: 'birthdate',\n familyName: 'family_name',\n gender: 'gender',\n givenName: 'given_name',\n locale: 'locale',\n middleName: 'middle_name',\n name: 'name',\n nickname: 'nickname',\n phoneNumber: 'phone_number',\n picture: 'picture',\n preferredUsername: 'preferred_username',\n profile: 'profile',\n website: 'website',\n zoneInfo: 'zoneinfo',\n};\n"]}
@@ -1,2 +1,6 @@
1
1
  import { AuthenticateUserResponse } from 'quidproquo-core';
2
+ /**
3
+ * Confirms a forgot-password reset with the emailed code and new password, then
4
+ * signs the user straight in with it.
5
+ */
2
6
  export declare const confirmForgotPassword: (userPoolId: string, clientId: string, region: string, code: string, username: string, password: string) => Promise<AuthenticateUserResponse>;
@@ -15,6 +15,10 @@ const createAwsClient_1 = require("../createAwsClient");
15
15
  const calculateSecretHash_1 = require("./utils/calculateSecretHash");
16
16
  const authenticateUser_1 = require("./authenticateUser");
17
17
  const getUserPoolClientSecret_1 = require("./getUserPoolClientSecret");
18
+ /**
19
+ * Confirms a forgot-password reset with the emailed code and new password, then
20
+ * signs the user straight in with it.
21
+ */
18
22
  const confirmForgotPassword = (userPoolId, clientId, region, code, username, password) => __awaiter(void 0, void 0, void 0, function* () {
19
23
  const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
20
24
  region,
@@ -29,9 +33,7 @@ const confirmForgotPassword = (userPoolId, clientId, region, code, username, pas
29
33
  Username: username,
30
34
  };
31
35
  yield cognitoClient.send(new client_cognito_identity_provider_1.ConfirmForgotPasswordCommand(params));
32
- // Authenticate the user
33
- const authResponse = yield (0, authenticateUser_1.authenticateUser)(userPoolId, clientId, region, false, username, password);
34
- return authResponse;
36
+ return (0, authenticateUser_1.authenticateUser)(userPoolId, clientId, region, false, username, password);
35
37
  });
36
38
  exports.confirmForgotPassword = confirmForgotPassword;
37
39
  //# sourceMappingURL=confirmForgotPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmForgotPassword.js","sourceRoot":"","sources":["../../../../src/logic/cognito/confirmForgotPassword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAImD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,yDAAsD;AACtD,uEAAoE;AAE7D,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,QAAgB,EACmB,EAAE;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,MAAM,MAAM,GAAsC;QAChD,QAAQ,EAAE,QAAQ;QAElB,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;KACnB,CAAC;IAEF,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,+DAA4B,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnE,wBAAwB;IACxB,MAAM,YAAY,GAA6B,MAAM,IAAA,mCAAgB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAE/H,OAAO,YAAY,CAAC;AACtB,CAAC,CAAA,CAAC;AA9BW,QAAA,qBAAqB,yBA8BhC","sourcesContent":["import { AuthenticateUserResponse } from 'quidproquo-core';\n\nimport {\n CognitoIdentityProviderClient,\n ConfirmForgotPasswordCommand,\n ConfirmForgotPasswordCommandInput,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { authenticateUser } from './authenticateUser';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\nexport const confirmForgotPassword = async (\n userPoolId: string,\n clientId: string,\n region: string,\n code: string,\n username: string,\n password: string,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n const params: ConfirmForgotPasswordCommandInput = {\n ClientId: clientId,\n\n ConfirmationCode: code,\n SecretHash: secretHash,\n Password: password,\n Username: username,\n };\n\n await cognitoClient.send(new ConfirmForgotPasswordCommand(params));\n\n // Authenticate the user\n const authResponse: AuthenticateUserResponse = await authenticateUser(userPoolId, clientId, region, false, username, password);\n\n return authResponse;\n};\n"]}
1
+ {"version":3,"file":"confirmForgotPassword.js","sourceRoot":"","sources":["../../../../src/logic/cognito/confirmForgotPassword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAImD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,yDAAsD;AACtD,uEAAoE;AAEpE;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CACnC,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,QAAgB,EACmB,EAAE;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,MAAM,MAAM,GAAsC;QAChD,QAAQ,EAAE,QAAQ;QAElB,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;KACnB,CAAC;IAEF,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,+DAA4B,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnE,OAAO,IAAA,mCAAgB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AACnF,CAAC,CAAA,CAAC;AA3BW,QAAA,qBAAqB,yBA2BhC","sourcesContent":["import { AuthenticateUserResponse } from 'quidproquo-core';\n\nimport {\n CognitoIdentityProviderClient,\n ConfirmForgotPasswordCommand,\n ConfirmForgotPasswordCommandInput,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { authenticateUser } from './authenticateUser';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\n/**\n * Confirms a forgot-password reset with the emailed code and new password, then\n * signs the user straight in with it.\n */\nexport const confirmForgotPassword = async (\n userPoolId: string,\n clientId: string,\n region: string,\n code: string,\n username: string,\n password: string,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n const params: ConfirmForgotPasswordCommandInput = {\n ClientId: clientId,\n\n ConfirmationCode: code,\n SecretHash: secretHash,\n Password: password,\n Username: username,\n };\n\n await cognitoClient.send(new ConfirmForgotPasswordCommand(params));\n\n return authenticateUser(userPoolId, clientId, region, false, username, password);\n};\n"]}
@@ -1,2 +1,6 @@
1
1
  import { AuthenticateUserResponse, CreateUserRequest } from 'quidproquo-core';
2
+ /**
3
+ * Creates a Cognito user with the requested attributes, activates their password
4
+ * and signs them in, returning the authenticated session.
5
+ */
2
6
  export declare const createUser: (userPoolId: string, region: string, clientId: string, createUserRequest: CreateUserRequest) => Promise<AuthenticateUserResponse>;
@@ -13,8 +13,12 @@ exports.createUser = void 0;
13
13
  const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
14
14
  const createAwsClient_1 = require("../createAwsClient");
15
15
  const authenticateUser_1 = require("./authenticateUser");
16
- const cognitoAttributeMap_1 = require("./cognitoAttributeMap");
16
+ const getCognitoUserAttributesFromQpqUserAttributes_1 = require("./getCognitoUserAttributesFromQpqUserAttributes");
17
17
  const setUserPassword_1 = require("./setUserPassword");
18
+ /**
19
+ * Creates a Cognito user with the requested attributes, activates their password
20
+ * and signs them in, returning the authenticated session.
21
+ */
18
22
  const createUser = (userPoolId, region, clientId, createUserRequest) => __awaiter(void 0, void 0, void 0, function* () {
19
23
  var _a;
20
24
  const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
@@ -25,7 +29,9 @@ const createUser = (userPoolId, region, clientId, createUserRequest) => __awaite
25
29
  Username: createUserRequest.email,
26
30
  MessageAction: client_cognito_identity_provider_1.MessageActionType.SUPPRESS, // Don't contact the user
27
31
  DesiredDeliveryMediums: [client_cognito_identity_provider_1.DeliveryMediumType.EMAIL],
28
- UserAttributes: (0, cognitoAttributeMap_1.getCognitoUserAttributesFromQpqUserAttributes)(createUserRequest),
32
+ // createUserRequest includes password; it has no cognitoAttributeMap entry,
33
+ // so the mapper drops it rather than writing it as a user attribute.
34
+ UserAttributes: (0, getCognitoUserAttributesFromQpqUserAttributes_1.getCognitoUserAttributesFromQpqUserAttributes)(createUserRequest),
29
35
  ForceAliasCreation: false,
30
36
  };
31
37
  if (createUserRequest.phoneNumber) {
@@ -33,11 +39,8 @@ const createUser = (userPoolId, region, clientId, createUserRequest) => __awaite
33
39
  }
34
40
  const response = yield cognitoClient.send(new client_cognito_identity_provider_1.AdminCreateUserCommand(params));
35
41
  const username = ((_a = response.User) === null || _a === void 0 ? void 0 : _a.Username) || '';
36
- // Set the user's password
37
42
  yield (0, setUserPassword_1.setUserPassword)(region, userPoolId, username, createUserRequest.password);
38
- // Authenticate the user
39
- const authResponse = yield (0, authenticateUser_1.authenticateUser)(userPoolId, clientId, region, false, username, createUserRequest.password);
40
- return authResponse;
43
+ return (0, authenticateUser_1.authenticateUser)(userPoolId, clientId, region, false, username, createUserRequest.password);
41
44
  });
42
45
  exports.createUser = createUser;
43
46
  //# sourceMappingURL=createUser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createUser.js","sourceRoot":"","sources":["../../../../src/logic/cognito/createUser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAMmD;AAEnD,wDAAqD;AACrD,yDAAsD;AACtD,+DAAsF;AACtF,uDAAoD;AAE7C,MAAM,UAAU,GAAG,CACxB,UAAkB,EAClB,MAAc,EACd,QAAgB,EAChB,iBAAoC,EACD,EAAE;;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,MAAM,GAAgC;QAC1C,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,iBAAiB,CAAC,KAAK;QACjC,aAAa,EAAE,oDAAiB,CAAC,QAAQ,EAAE,yBAAyB;QACpE,sBAAsB,EAAE,CAAC,qDAAkB,CAAC,KAAK,CAAC;QAClD,cAAc,EAAE,IAAA,mEAA6C,EAAC,iBAAiB,CAAC;QAChF,kBAAkB,EAAE,KAAK;KAC1B,CAAC;IAEF,IAAI,iBAAiB,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,sBAAuB,CAAC,IAAI,CAAC,qDAAkB,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,yDAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAG,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,QAAQ,KAAI,EAAE,CAAC;IAE/C,0BAA0B;IAC1B,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEhF,wBAAwB;IACxB,MAAM,YAAY,GAA6B,MAAM,IAAA,mCAAgB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEjJ,OAAO,YAAY,CAAC;AACtB,CAAC,CAAA,CAAC;AAlCW,QAAA,UAAU,cAkCrB","sourcesContent":["import { AuthenticateUserResponse, CreateUserRequest } from 'quidproquo-core';\n\nimport {\n AdminCreateUserCommand,\n AdminCreateUserCommandInput,\n CognitoIdentityProviderClient,\n DeliveryMediumType,\n MessageActionType,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { authenticateUser } from './authenticateUser';\nimport { getCognitoUserAttributesFromQpqUserAttributes } from './cognitoAttributeMap';\nimport { setUserPassword } from './setUserPassword';\n\nexport const createUser = async (\n userPoolId: string,\n region: string,\n clientId: string,\n createUserRequest: CreateUserRequest,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const params: AdminCreateUserCommandInput = {\n UserPoolId: userPoolId,\n Username: createUserRequest.email,\n MessageAction: MessageActionType.SUPPRESS, // Don't contact the user\n DesiredDeliveryMediums: [DeliveryMediumType.EMAIL],\n UserAttributes: getCognitoUserAttributesFromQpqUserAttributes(createUserRequest),\n ForceAliasCreation: false,\n };\n\n if (createUserRequest.phoneNumber) {\n params.DesiredDeliveryMediums!.push(DeliveryMediumType.SMS);\n }\n\n const response = await cognitoClient.send(new AdminCreateUserCommand(params));\n\n const username = response.User?.Username || '';\n\n // Set the user's password\n await setUserPassword(region, userPoolId, username, createUserRequest.password);\n\n // Authenticate the user\n const authResponse: AuthenticateUserResponse = await authenticateUser(userPoolId, clientId, region, false, username, createUserRequest.password);\n\n return authResponse;\n};\n"]}
1
+ {"version":3,"file":"createUser.js","sourceRoot":"","sources":["../../../../src/logic/cognito/createUser.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAMmD;AAEnD,wDAAqD;AACrD,yDAAsD;AACtD,mHAAgH;AAChH,uDAAoD;AAEpD;;;GAGG;AACI,MAAM,UAAU,GAAG,CACxB,UAAkB,EAClB,MAAc,EACd,QAAgB,EAChB,iBAAoC,EACD,EAAE;;IACrC,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,MAAM,GAAgC;QAC1C,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,iBAAiB,CAAC,KAAK;QACjC,aAAa,EAAE,oDAAiB,CAAC,QAAQ,EAAE,yBAAyB;QACpE,sBAAsB,EAAE,CAAC,qDAAkB,CAAC,KAAK,CAAC;QAClD,4EAA4E;QAC5E,qEAAqE;QACrE,cAAc,EAAE,IAAA,6FAA6C,EAAC,iBAAiB,CAAC;QAChF,kBAAkB,EAAE,KAAK;KAC1B,CAAC;IAEF,IAAI,iBAAiB,CAAC,WAAW,EAAE,CAAC;QAClC,MAAM,CAAC,sBAAuB,CAAC,IAAI,CAAC,qDAAkB,CAAC,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,yDAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAG,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,QAAQ,KAAI,EAAE,CAAC;IAE/C,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAEhF,OAAO,IAAA,mCAAgB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AACrG,CAAC,CAAA,CAAC;AAhCW,QAAA,UAAU,cAgCrB","sourcesContent":["import { AuthenticateUserResponse, CreateUserRequest } from 'quidproquo-core';\n\nimport {\n AdminCreateUserCommand,\n AdminCreateUserCommandInput,\n CognitoIdentityProviderClient,\n DeliveryMediumType,\n MessageActionType,\n} from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { authenticateUser } from './authenticateUser';\nimport { getCognitoUserAttributesFromQpqUserAttributes } from './getCognitoUserAttributesFromQpqUserAttributes';\nimport { setUserPassword } from './setUserPassword';\n\n/**\n * Creates a Cognito user with the requested attributes, activates their password\n * and signs them in, returning the authenticated session.\n */\nexport const createUser = async (\n userPoolId: string,\n region: string,\n clientId: string,\n createUserRequest: CreateUserRequest,\n): Promise<AuthenticateUserResponse> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const params: AdminCreateUserCommandInput = {\n UserPoolId: userPoolId,\n Username: createUserRequest.email,\n MessageAction: MessageActionType.SUPPRESS, // Don't contact the user\n DesiredDeliveryMediums: [DeliveryMediumType.EMAIL],\n // createUserRequest includes password; it has no cognitoAttributeMap entry,\n // so the mapper drops it rather than writing it as a user attribute.\n UserAttributes: getCognitoUserAttributesFromQpqUserAttributes(createUserRequest),\n ForceAliasCreation: false,\n };\n\n if (createUserRequest.phoneNumber) {\n params.DesiredDeliveryMediums!.push(DeliveryMediumType.SMS);\n }\n\n const response = await cognitoClient.send(new AdminCreateUserCommand(params));\n\n const username = response.User?.Username || '';\n\n await setUserPassword(region, userPoolId, username, createUserRequest.password);\n\n return authenticateUser(userPoolId, clientId, region, false, username, createUserRequest.password);\n};\n"]}
@@ -1,2 +1,13 @@
1
1
  import { DecodedAccessToken, QPQConfig } from 'quidproquo-core';
2
+ export declare class InvalidAccessTokenError extends Error {
3
+ readonly code = "INVALID_ACCESS_TOKEN";
4
+ constructor();
5
+ }
6
+ /**
7
+ * Decodes and verifies a Cognito access token for the given user directory,
8
+ * resolving the pool id from the directory's CloudFormation export. Throws
9
+ * InvalidAccessTokenError when the token is missing or fails verification.
10
+ * With ignoreExpiration, an expired but otherwise valid token is returned with
11
+ * wasValid false.
12
+ */
2
13
  export declare const decodeAccessToken: (userDirectoryName: string, qpqConfig: QPQConfig, accessToken?: string, ignoreExpiration?: boolean) => Promise<DecodedAccessToken>;
@@ -9,21 +9,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.decodeAccessToken = void 0;
12
+ exports.decodeAccessToken = exports.InvalidAccessTokenError = void 0;
13
13
  const quidproquo_config_aws_1 = require("quidproquo-config-aws");
14
14
  const awsNamingUtils_1 = require("../../awsNamingUtils");
15
15
  const getExportedValue_1 = require("../cloudformation/getExportedValue");
16
16
  const decodeValidJwt_1 = require("./decodeValidJwt");
17
+ // decodeValidJwt returns null rather than throwing, so this throw is the
18
+ // discriminable signal callers (e.g. the SetAccessToken processor) catch to
19
+ // produce an Unauthorized result.
20
+ class InvalidAccessTokenError extends Error {
21
+ constructor() {
22
+ super('Unable to decode access token');
23
+ this.code = 'INVALID_ACCESS_TOKEN';
24
+ this.name = 'InvalidAccessTokenError';
25
+ }
26
+ }
27
+ exports.InvalidAccessTokenError = InvalidAccessTokenError;
28
+ /**
29
+ * Decodes and verifies a Cognito access token for the given user directory,
30
+ * resolving the pool id from the directory's CloudFormation export. Throws
31
+ * InvalidAccessTokenError when the token is missing or fails verification.
32
+ * With ignoreExpiration, an expired but otherwise valid token is returned with
33
+ * wasValid false.
34
+ */
17
35
  const decodeAccessToken = (userDirectoryName_1, qpqConfig_1, accessToken_1, ...args_1) => __awaiter(void 0, [userDirectoryName_1, qpqConfig_1, accessToken_1, ...args_1], void 0, function* (userDirectoryName, qpqConfig, accessToken, ignoreExpiration = false) {
18
36
  const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
19
37
  const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
20
38
  const decodedAuthToken = yield (0, decodeValidJwt_1.decodeValidJwt)(userPoolId, region, ignoreExpiration, accessToken);
21
- if (!decodedAuthToken || !(decodedAuthToken === null || decodedAuthToken === void 0 ? void 0 : decodedAuthToken.username)) {
22
- throw new Error('Unable to decode access token');
39
+ if (!(decodedAuthToken === null || decodedAuthToken === void 0 ? void 0 : decodedAuthToken.username)) {
40
+ throw new InvalidAccessTokenError();
23
41
  }
42
+ // decodeValidJwt only enforces expiry when ignoreExpiration is false, so
43
+ // recheck here to report whether an ignored-expiry token was actually valid.
24
44
  const wasValid = !ignoreExpiration || decodedAuthToken.exp > Math.floor(Date.now() / 1000);
25
- const decodedAccesToken = Object.assign(Object.assign({}, decodedAuthToken), { wasValid, userDirectory: userDirectoryName });
26
- return decodedAccesToken;
45
+ return Object.assign(Object.assign({}, decodedAuthToken), { wasValid, userDirectory: userDirectoryName });
27
46
  });
28
47
  exports.decodeAccessToken = decodeAccessToken;
29
48
  //# sourceMappingURL=decodeAccessToken.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decodeAccessToken.js","sourceRoot":"","sources":["../../../../src/logic/cognito/decodeAccessToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAG1D,yDAA2E;AAC3E,yEAAsE;AACtE,qDAAkD;AAE3C,MAAM,iBAAiB,GAAG,6DAKF,EAAE,oGAJ/B,iBAAyB,EACzB,SAAoB,EACpB,WAAoB,EACpB,mBAA4B,KAAK;IAEjC,MAAM,MAAM,GAAG,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,MAAM,IAAA,mCAAgB,EAAC,IAAA,oDAAmC,EAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAErH,MAAM,gBAAgB,GAAG,MAAM,IAAA,+BAAc,EAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;IAEjG,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,CAAA,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAE3F,MAAM,iBAAiB,mCAClB,gBAAgB,KAEnB,QAAQ,EACR,aAAa,EAAE,iBAAiB,GACjC,CAAC;IAEF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAA,CAAC;AAzBW,QAAA,iBAAiB,qBAyB5B","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { DecodedAccessToken, QPQConfig, qpqCoreUtils } from 'quidproquo-core';\n\nimport { getCFExportNameUserPoolIdFromConfig } from '../../awsNamingUtils';\nimport { getExportedValue } from '../cloudformation/getExportedValue';\nimport { decodeValidJwt } from './decodeValidJwt';\n\nexport const decodeAccessToken = async (\n userDirectoryName: string,\n qpqConfig: QPQConfig,\n accessToken?: string,\n ignoreExpiration: boolean = false,\n): Promise<DecodedAccessToken> => {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);\n const userPoolId = await getExportedValue(getCFExportNameUserPoolIdFromConfig(userDirectoryName, qpqConfig), region);\n\n const decodedAuthToken = await decodeValidJwt(userPoolId, region, ignoreExpiration, accessToken);\n\n if (!decodedAuthToken || !decodedAuthToken?.username) {\n throw new Error('Unable to decode access token');\n }\n\n const wasValid = !ignoreExpiration || decodedAuthToken.exp > Math.floor(Date.now() / 1000);\n\n const decodedAccesToken: DecodedAccessToken = {\n ...decodedAuthToken,\n\n wasValid,\n userDirectory: userDirectoryName,\n };\n\n return decodedAccesToken;\n};\n"]}
1
+ {"version":3,"file":"decodeAccessToken.js","sourceRoot":"","sources":["../../../../src/logic/cognito/decodeAccessToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAG1D,yDAA2E;AAC3E,yEAAsE;AACtE,qDAAkD;AAElD,yEAAyE;AACzE,4EAA4E;AAC5E,kCAAkC;AAClC,MAAa,uBAAwB,SAAQ,KAAK;IAGhD;QACE,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAHhC,SAAI,GAAG,sBAAsB,CAAC;QAIrC,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAPD,0DAOC;AAED;;;;;;GAMG;AACI,MAAM,iBAAiB,GAAG,6DAKF,EAAE,oGAJ/B,iBAAyB,EACzB,SAAoB,EACpB,WAAoB,EACpB,mBAA4B,KAAK;IAEjC,MAAM,MAAM,GAAG,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,MAAM,IAAA,mCAAgB,EAAC,IAAA,oDAAmC,EAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;IAErH,MAAM,gBAAgB,GAAG,MAAM,IAAA,+BAAc,EAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;IAEjG,IAAI,CAAC,CAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,QAAQ,CAAA,EAAE,CAAC;QAChC,MAAM,IAAI,uBAAuB,EAAE,CAAC;IACtC,CAAC;IAED,yEAAyE;IACzE,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAE3F,uCACK,gBAAgB,KAEnB,QAAQ,EACR,aAAa,EAAE,iBAAiB,IAChC;AACJ,CAAC,CAAA,CAAC;AAzBW,QAAA,iBAAiB,qBAyB5B","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { DecodedAccessToken, QPQConfig } from 'quidproquo-core';\n\nimport { getCFExportNameUserPoolIdFromConfig } from '../../awsNamingUtils';\nimport { getExportedValue } from '../cloudformation/getExportedValue';\nimport { decodeValidJwt } from './decodeValidJwt';\n\n// decodeValidJwt returns null rather than throwing, so this throw is the\n// discriminable signal callers (e.g. the SetAccessToken processor) catch to\n// produce an Unauthorized result.\nexport class InvalidAccessTokenError extends Error {\n readonly code = 'INVALID_ACCESS_TOKEN';\n\n constructor() {\n super('Unable to decode access token');\n this.name = 'InvalidAccessTokenError';\n }\n}\n\n/**\n * Decodes and verifies a Cognito access token for the given user directory,\n * resolving the pool id from the directory's CloudFormation export. Throws\n * InvalidAccessTokenError when the token is missing or fails verification.\n * With ignoreExpiration, an expired but otherwise valid token is returned with\n * wasValid false.\n */\nexport const decodeAccessToken = async (\n userDirectoryName: string,\n qpqConfig: QPQConfig,\n accessToken?: string,\n ignoreExpiration: boolean = false,\n): Promise<DecodedAccessToken> => {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);\n const userPoolId = await getExportedValue(getCFExportNameUserPoolIdFromConfig(userDirectoryName, qpqConfig), region);\n\n const decodedAuthToken = await decodeValidJwt(userPoolId, region, ignoreExpiration, accessToken);\n\n if (!decodedAuthToken?.username) {\n throw new InvalidAccessTokenError();\n }\n\n // decodeValidJwt only enforces expiry when ignoreExpiration is false, so\n // recheck here to report whether an ignored-expiry token was actually valid.\n const wasValid = !ignoreExpiration || decodedAuthToken.exp > Math.floor(Date.now() / 1000);\n\n return {\n ...decodedAuthToken,\n\n wasValid,\n userDirectory: userDirectoryName,\n };\n};\n"]}
@@ -1,2 +1,8 @@
1
- import { DecodedAccessToken } from 'quidproquo-core';
2
- export declare const decodeValidJwt: (userPoolId: string, region: string, ignoreExpiration: boolean, accessToken?: string) => Promise<Omit<DecodedAccessToken, "userDirectory"> | null>;
1
+ import { DecodedAccessToken, Nullable } from 'quidproquo-core';
2
+ /**
3
+ * Verifies a Cognito access token and returns its decoded qpq shape: signature is
4
+ * checked against the pool's JWKS (RS256 only), plus issuer, expiry (unless
5
+ * ignoreExpiration) and token_use. Returns null for anything that fails; failures
6
+ * are logged in summary form only, never the token itself.
7
+ */
8
+ export declare const decodeValidJwt: (userPoolId: string, region: string, ignoreExpiration: boolean, accessToken?: string) => Promise<Nullable<Omit<DecodedAccessToken, "userDirectory">>>;
@@ -8,13 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
11
  Object.defineProperty(exports, "__esModule", { value: true });
15
12
  exports.decodeValidJwt = void 0;
16
13
  const jsonwebtoken_1 = require("jsonwebtoken");
17
- const jwks_rsa_1 = __importDefault(require("jwks-rsa"));
14
+ const getCognitoJwksClient_1 = require("./getCognitoJwksClient");
15
+ /**
16
+ * Verifies a Cognito access token and returns its decoded qpq shape: signature is
17
+ * checked against the pool's JWKS (RS256 only), plus issuer, expiry (unless
18
+ * ignoreExpiration) and token_use. Returns null for anything that fails; failures
19
+ * are logged in summary form only, never the token itself.
20
+ */
18
21
  const decodeValidJwt = (userPoolId, region, ignoreExpiration, accessToken) => __awaiter(void 0, void 0, void 0, function* () {
19
22
  if (!accessToken) {
20
23
  return null;
@@ -24,22 +27,25 @@ const decodeValidJwt = (userPoolId, region, ignoreExpiration, accessToken) => __
24
27
  if (!decodedToken) {
25
28
  return null;
26
29
  }
27
- const client = (0, jwks_rsa_1.default)({
28
- jwksUri: `https://cognito-idp.${region}.amazonaws.com/${userPoolId}/.well-known/jwks.json`,
29
- });
30
+ const client = (0, getCognitoJwksClient_1.getCognitoJwksClient)(`https://cognito-idp.${region}.amazonaws.com/${userPoolId}/.well-known/jwks.json`);
30
31
  const key = yield client.getSigningKey(decodedToken.header.kid);
31
32
  const signingKey = key.getPublicKey();
32
33
  const payload = (0, jsonwebtoken_1.verify)(accessToken, signingKey, {
33
34
  algorithms: ['RS256'],
35
+ issuer: `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`,
34
36
  ignoreExpiration,
35
37
  });
36
- const decodedAccessToken = {
38
+ // An id token from the same pool passes signature verification too; only
39
+ // access tokens are acceptable here.
40
+ if (payload.token_use !== 'access') {
41
+ return null;
42
+ }
43
+ return {
37
44
  userId: payload.sub,
38
45
  username: payload.username,
39
46
  exp: payload.exp,
40
47
  wasValid: true,
41
48
  };
42
- return decodedAccessToken;
43
49
  }
44
50
  catch (e) {
45
51
  const summary = e instanceof Error ? `${e.name}: ${e.message}` : 'unknown error';
@@ -1 +1 @@
1
- {"version":3,"file":"decodeValidJwt.js","sourceRoot":"","sources":["../../../../src/logic/cognito/decodeValidJwt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,+CAA8C;AAC9C,wDAAkC;AAkB3B,MAAM,cAAc,GAAG,CAC5B,UAAkB,EAClB,MAAc,EACd,gBAAyB,EACzB,WAAoB,EACuC,EAAE;IAC7D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAA,qBAAM,EAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC;YACxB,OAAO,EAAE,uBAAuB,MAAM,kBAAkB,UAAU,wBAAwB;SAC3F,CAAC,CAAC;QAEH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAEtC,MAAM,OAAO,GAAG,IAAA,qBAAM,EAAC,WAAW,EAAE,UAAU,EAAE;YAC9C,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,gBAAgB;SACjB,CAAe,CAAC;QAEjB,MAAM,kBAAkB,GAA8C;YACpE,MAAM,EAAE,OAAO,CAAC,GAAG;YACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,QAAQ,EAAE,IAAI;SACf,CAAC;QAEF,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC;AAzCW,QAAA,cAAc,kBAyCzB","sourcesContent":["import { DecodedAccessToken } from 'quidproquo-core';\n\nimport { decode, verify } from 'jsonwebtoken';\nimport jwksClient from 'jwks-rsa';\n\n// TODO: Check whey we need this? I think you should be able to get types from the lib?\ntype JwtPayload = {\n sub: string;\n iss: string;\n client_id: string;\n origin_jti: string;\n event_id: string;\n token_use: string;\n scope: string;\n auth_time: number;\n exp: number;\n iat: number;\n jti: string;\n username: string;\n};\n\nexport const decodeValidJwt = async (\n userPoolId: string,\n region: string,\n ignoreExpiration: boolean,\n accessToken?: string,\n): Promise<Omit<DecodedAccessToken, 'userDirectory'> | null> => {\n if (!accessToken) {\n return null;\n }\n\n try {\n const decodedToken = decode(accessToken, { complete: true });\n if (!decodedToken) {\n return null;\n }\n\n const client = jwksClient({\n jwksUri: `https://cognito-idp.${region}.amazonaws.com/${userPoolId}/.well-known/jwks.json`,\n });\n\n const key = await client.getSigningKey(decodedToken.header.kid);\n const signingKey = key.getPublicKey();\n\n const payload = verify(accessToken, signingKey, {\n algorithms: ['RS256'],\n ignoreExpiration,\n }) as JwtPayload;\n\n const decodedAccessToken: Omit<DecodedAccessToken, 'userDirectory'> = {\n userId: payload.sub,\n username: payload.username,\n exp: payload.exp,\n wasValid: true,\n };\n\n return decodedAccessToken;\n } catch (e) {\n const summary = e instanceof Error ? `${e.name}: ${e.message}` : 'unknown error';\n console.log('Failed to decode jwt token:', summary);\n return null;\n }\n};\n"]}
1
+ {"version":3,"file":"decodeValidJwt.js","sourceRoot":"","sources":["../../../../src/logic/cognito/decodeValidJwt.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+CAA8C;AAE9C,iEAA8D;AAW9D;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAC5B,UAAkB,EAClB,MAAc,EACd,gBAAyB,EACzB,WAAoB,EAC0C,EAAE;IAChE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAA,qBAAM,EAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAG,IAAA,2CAAoB,EAAC,uBAAuB,MAAM,kBAAkB,UAAU,wBAAwB,CAAC,CAAC;QAEvH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAEtC,MAAM,OAAO,GAAG,IAAA,qBAAM,EAAC,WAAW,EAAE,UAAU,EAAE;YAC9C,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,MAAM,EAAE,uBAAuB,MAAM,kBAAkB,UAAU,EAAE;YACnE,gBAAgB;SACjB,CAA8B,CAAC;QAEhC,yEAAyE;QACzE,qCAAqC;QACrC,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,GAAG;YACnB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,QAAQ,EAAE,IAAI;SACf,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;QACjF,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC;AA5CW,QAAA,cAAc,kBA4CzB","sourcesContent":["import { DecodedAccessToken, Nullable } from 'quidproquo-core';\n\nimport { decode, verify } from 'jsonwebtoken';\n\nimport { getCognitoJwksClient } from './getCognitoJwksClient';\n\n// The jsonwebtoken lib types every claim as optional, so the Cognito\n// access-token claims this decoder relies on are typed here.\ntype CognitoAccessTokenPayload = {\n sub: string;\n token_use: string;\n username: string;\n exp: number;\n};\n\n/**\n * Verifies a Cognito access token and returns its decoded qpq shape: signature is\n * checked against the pool's JWKS (RS256 only), plus issuer, expiry (unless\n * ignoreExpiration) and token_use. Returns null for anything that fails; failures\n * are logged in summary form only, never the token itself.\n */\nexport const decodeValidJwt = async (\n userPoolId: string,\n region: string,\n ignoreExpiration: boolean,\n accessToken?: string,\n): Promise<Nullable<Omit<DecodedAccessToken, 'userDirectory'>>> => {\n if (!accessToken) {\n return null;\n }\n\n try {\n const decodedToken = decode(accessToken, { complete: true });\n if (!decodedToken) {\n return null;\n }\n\n const client = getCognitoJwksClient(`https://cognito-idp.${region}.amazonaws.com/${userPoolId}/.well-known/jwks.json`);\n\n const key = await client.getSigningKey(decodedToken.header.kid);\n const signingKey = key.getPublicKey();\n\n const payload = verify(accessToken, signingKey, {\n algorithms: ['RS256'],\n issuer: `https://cognito-idp.${region}.amazonaws.com/${userPoolId}`,\n ignoreExpiration,\n }) as CognitoAccessTokenPayload;\n\n // An id token from the same pool passes signature verification too; only\n // access tokens are acceptable here.\n if (payload.token_use !== 'access') {\n return null;\n }\n\n return {\n userId: payload.sub,\n username: payload.username,\n exp: payload.exp,\n wasValid: true,\n };\n } catch (e) {\n const summary = e instanceof Error ? `${e.name}: ${e.message}` : 'unknown error';\n console.log('Failed to decode jwt token:', summary);\n return null;\n }\n};\n"]}
@@ -13,6 +13,7 @@ exports.forgotPassword = void 0;
13
13
  const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
14
14
  const createAwsClient_1 = require("../createAwsClient");
15
15
  const calculateSecretHash_1 = require("./utils/calculateSecretHash");
16
+ const cognitoCodeDeliveryDetailsToQpqDeliveryDetails_1 = require("./utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails");
16
17
  const getUserPoolClientSecret_1 = require("./getUserPoolClientSecret");
17
18
  const forgotPassword = (userPoolId, clientId, region, username) => __awaiter(void 0, void 0, void 0, function* () {
18
19
  const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
@@ -29,12 +30,7 @@ const forgotPassword = (userPoolId, clientId, region, username) => __awaiter(voi
29
30
  },
30
31
  };
31
32
  const response = yield cognitoClient.send(new client_cognito_identity_provider_1.ForgotPasswordCommand(params));
32
- const deliveryInfo = {
33
- attributeName: response.CodeDeliveryDetails.AttributeName || 'email',
34
- destination: response.CodeDeliveryDetails.Destination || 'unknown@email.com',
35
- deliveryMedium: response.CodeDeliveryDetails.DeliveryMedium || 'EMAIL',
36
- };
37
- return deliveryInfo;
33
+ return (0, cognitoCodeDeliveryDetailsToQpqDeliveryDetails_1.cognitoCodeDeliveryDetailsToQpqDeliveryDetails)(response.CodeDeliveryDetails);
38
34
  });
39
35
  exports.forgotPassword = forgotPassword;
40
36
  //# sourceMappingURL=forgotPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"forgotPassword.js","sourceRoot":"","sources":["../../../../src/logic/cognito/forgotPassword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAA6I;AAE7I,wDAAqD;AACrD,qEAAkE;AAClE,uEAAoE;AAE7D,MAAM,cAAc,GAAG,CAC5B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAgB,EACwB,EAAE;IAC1C,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,MAAM,MAAM,GAA+B;QACzC,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE;YACd,aAAa,EAAE,MAAM;SACtB;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,wDAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7E,MAAM,YAAY,GAAG;QACnB,aAAa,EAAE,QAAQ,CAAC,mBAAoB,CAAC,aAAa,IAAI,OAAO;QACrE,WAAW,EAAE,QAAQ,CAAC,mBAAoB,CAAC,WAAW,IAAI,mBAAmB;QAC7E,cAAc,EAAE,QAAQ,CAAC,mBAAoB,CAAC,cAAc,IAAI,OAAO;KACvC,CAAC;IAEnC,OAAO,YAAY,CAAC;AACtB,CAAC,CAAA,CAAC;AA/BW,QAAA,cAAc,kBA+BzB","sourcesContent":["import { AuthenticationDeliveryDetails } from 'quidproquo-core';\n\nimport { CognitoIdentityProviderClient, ForgotPasswordCommand, ForgotPasswordCommandInput } from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\nexport const forgotPassword = async (\n userPoolId: string,\n clientId: string,\n region: string,\n username: string,\n): Promise<AuthenticationDeliveryDetails> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n const params: ForgotPasswordCommandInput = {\n ClientId: clientId,\n Username: username,\n SecretHash: secretHash,\n ClientMetadata: {\n userInitiated: 'true',\n },\n };\n\n const response = await cognitoClient.send(new ForgotPasswordCommand(params));\n\n const deliveryInfo = {\n attributeName: response.CodeDeliveryDetails!.AttributeName || 'email',\n destination: response.CodeDeliveryDetails!.Destination || 'unknown@email.com',\n deliveryMedium: response.CodeDeliveryDetails!.DeliveryMedium || 'EMAIL',\n } as AuthenticationDeliveryDetails;\n\n return deliveryInfo;\n};\n"]}
1
+ {"version":3,"file":"forgotPassword.js","sourceRoot":"","sources":["../../../../src/logic/cognito/forgotPassword.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAA6I;AAE7I,wDAAqD;AACrD,qEAAkE;AAClE,2HAAwH;AACxH,uEAAoE;AAE7D,MAAM,cAAc,GAAG,CAC5B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAgB,EACwB,EAAE;IAC1C,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,MAAM,IAAA,iDAAuB,EAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjF,MAAM,UAAU,GAAG,IAAA,yCAAmB,EAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;IAEzE,MAAM,MAAM,GAA+B;QACzC,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE;YACd,aAAa,EAAE,MAAM;SACtB;KACF,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,wDAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;IAE7E,OAAO,IAAA,+FAA8C,EAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACtF,CAAC,CAAA,CAAC;AAzBW,QAAA,cAAc,kBAyBzB","sourcesContent":["import { AuthenticationDeliveryDetails } from 'quidproquo-core';\n\nimport { CognitoIdentityProviderClient, ForgotPasswordCommand, ForgotPasswordCommandInput } from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { calculateSecretHash } from './utils/calculateSecretHash';\nimport { cognitoCodeDeliveryDetailsToQpqDeliveryDetails } from './utils/cognitoCodeDeliveryDetailsToQpqDeliveryDetails';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\nexport const forgotPassword = async (\n userPoolId: string,\n clientId: string,\n region: string,\n username: string,\n): Promise<AuthenticationDeliveryDetails> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n const secretHash = calculateSecretHash(username, clientId, clientSecret);\n\n const params: ForgotPasswordCommandInput = {\n ClientId: clientId,\n Username: username,\n SecretHash: secretHash,\n ClientMetadata: {\n userInitiated: 'true',\n },\n };\n\n const response = await cognitoClient.send(new ForgotPasswordCommand(params));\n\n return cognitoCodeDeliveryDetailsToQpqDeliveryDetails(response.CodeDeliveryDetails);\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import { JwksClient } from 'jwks-rsa';
2
+ /**
3
+ * Returns the JWKS client for a Cognito jwks.json uri. Memoized because jwks-rsa
4
+ * caches fetched signing keys per client instance; a fresh client per verification
5
+ * would refetch the pool's JWKS over HTTP on every call.
6
+ */
7
+ export declare const getCognitoJwksClient: (jwksUri: string) => JwksClient;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCognitoJwksClient = void 0;
7
+ const jwks_rsa_1 = __importDefault(require("jwks-rsa"));
8
+ const memoFunc_1 = require("../cache/memoFunc");
9
+ /**
10
+ * Returns the JWKS client for a Cognito jwks.json uri. Memoized because jwks-rsa
11
+ * caches fetched signing keys per client instance; a fresh client per verification
12
+ * would refetch the pool's JWKS over HTTP on every call.
13
+ */
14
+ exports.getCognitoJwksClient = (0, memoFunc_1.memoFunc)((jwksUri) => (0, jwks_rsa_1.default)({ jwksUri }));
15
+ //# sourceMappingURL=getCognitoJwksClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCognitoJwksClient.js","sourceRoot":"","sources":["../../../../src/logic/cognito/getCognitoJwksClient.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAkD;AAElD,gDAA6C;AAE7C;;;;GAIG;AACU,QAAA,oBAAoB,GAAG,IAAA,mBAAQ,EAAC,CAAC,OAAe,EAAc,EAAE,CAAC,IAAA,kBAAU,EAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC","sourcesContent":["import jwksClient, { JwksClient } from 'jwks-rsa';\n\nimport { memoFunc } from '../cache/memoFunc';\n\n/**\n * Returns the JWKS client for a Cognito jwks.json uri. Memoized because jwks-rsa\n * caches fetched signing keys per client instance; a fresh client per verification\n * would refetch the pool's JWKS over HTTP on every call.\n */\nexport const getCognitoJwksClient = memoFunc((jwksUri: string): JwksClient => jwksClient({ jwksUri }));\n"]}