quidproquo-actionprocessor-awslambda 0.1.9 → 0.1.11

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 (86) hide show
  1. package/lib/commonjs/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +2 -2
  2. package/lib/commonjs/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js.map +1 -1
  3. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.d.ts +2 -0
  4. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.js +41 -0
  5. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.js.map +1 -0
  6. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.d.ts +2 -0
  7. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.js +37 -0
  8. package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.js.map +1 -0
  9. package/lib/commonjs/getActionProcessor/core/userDirectory/index.js +3 -1
  10. package/lib/commonjs/getActionProcessor/core/userDirectory/index.js.map +1 -1
  11. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.d.ts +2 -0
  12. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js +43 -0
  13. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js.map +1 -0
  14. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.d.ts +2 -0
  15. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js +26 -0
  16. package/lib/commonjs/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js.map +1 -0
  17. package/lib/commonjs/getActionProcessor/webserver/email/index.d.ts +2 -0
  18. package/lib/commonjs/getActionProcessor/webserver/email/index.js +19 -0
  19. package/lib/commonjs/getActionProcessor/webserver/email/index.js.map +1 -0
  20. package/lib/commonjs/getActionProcessor/webserver/index.d.ts +1 -0
  21. package/lib/commonjs/getActionProcessor/webserver/index.js +3 -1
  22. package/lib/commonjs/getActionProcessor/webserver/index.js.map +1 -1
  23. package/lib/commonjs/logic/cognito/globalSignOut.d.ts +1 -0
  24. package/lib/commonjs/logic/cognito/globalSignOut.js +28 -0
  25. package/lib/commonjs/logic/cognito/globalSignOut.js.map +1 -0
  26. package/lib/commonjs/logic/cognito/index.d.ts +2 -0
  27. package/lib/commonjs/logic/cognito/index.js +2 -0
  28. package/lib/commonjs/logic/cognito/index.js.map +1 -1
  29. package/lib/commonjs/logic/cognito/refreshToken.js +10 -1
  30. package/lib/commonjs/logic/cognito/refreshToken.js.map +1 -1
  31. package/lib/commonjs/logic/cognito/revokeRefreshToken.d.ts +1 -0
  32. package/lib/commonjs/logic/cognito/revokeRefreshToken.js +33 -0
  33. package/lib/commonjs/logic/cognito/revokeRefreshToken.js.map +1 -0
  34. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.d.ts +1 -1
  35. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.js +4 -1
  36. package/lib/commonjs/logic/s3/generatePresignedUploadUrl.js.map +1 -1
  37. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.d.ts +2 -0
  38. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.js +79 -0
  39. package/lib/commonjs/logic/sesV2/buildRawMimeMessage.js.map +1 -0
  40. package/lib/commonjs/logic/sesV2/sendEmail.d.ts +2 -0
  41. package/lib/commonjs/logic/sesV2/sendEmail.js +48 -0
  42. package/lib/commonjs/logic/sesV2/sendEmail.js.map +1 -0
  43. package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +2 -2
  44. package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js.map +1 -1
  45. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.d.ts +2 -0
  46. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.js +26 -0
  47. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.js.map +1 -0
  48. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.d.ts +2 -0
  49. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.js +22 -0
  50. package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.js.map +1 -0
  51. package/lib/esm/getActionProcessor/core/userDirectory/index.js +4 -0
  52. package/lib/esm/getActionProcessor/core/userDirectory/index.js.map +1 -1
  53. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.d.ts +2 -0
  54. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js +28 -0
  55. package/lib/esm/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.js.map +1 -0
  56. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.d.ts +2 -0
  57. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js +11 -0
  58. package/lib/esm/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.js.map +1 -0
  59. package/lib/esm/getActionProcessor/webserver/email/index.d.ts +2 -0
  60. package/lib/esm/getActionProcessor/webserver/email/index.js +7 -0
  61. package/lib/esm/getActionProcessor/webserver/email/index.js.map +1 -0
  62. package/lib/esm/getActionProcessor/webserver/index.d.ts +1 -0
  63. package/lib/esm/getActionProcessor/webserver/index.js +3 -0
  64. package/lib/esm/getActionProcessor/webserver/index.js.map +1 -1
  65. package/lib/esm/logic/cognito/globalSignOut.d.ts +1 -0
  66. package/lib/esm/logic/cognito/globalSignOut.js +15 -0
  67. package/lib/esm/logic/cognito/globalSignOut.js.map +1 -0
  68. package/lib/esm/logic/cognito/index.d.ts +2 -0
  69. package/lib/esm/logic/cognito/index.js +2 -0
  70. package/lib/esm/logic/cognito/index.js.map +1 -1
  71. package/lib/esm/logic/cognito/refreshToken.js +10 -1
  72. package/lib/esm/logic/cognito/refreshToken.js.map +1 -1
  73. package/lib/esm/logic/cognito/revokeRefreshToken.d.ts +1 -0
  74. package/lib/esm/logic/cognito/revokeRefreshToken.js +20 -0
  75. package/lib/esm/logic/cognito/revokeRefreshToken.js.map +1 -0
  76. package/lib/esm/logic/s3/generatePresignedUploadUrl.d.ts +1 -1
  77. package/lib/esm/logic/s3/generatePresignedUploadUrl.js +4 -1
  78. package/lib/esm/logic/s3/generatePresignedUploadUrl.js.map +1 -1
  79. package/lib/esm/logic/sesV2/buildRawMimeMessage.d.ts +2 -0
  80. package/lib/esm/logic/sesV2/buildRawMimeMessage.js +74 -0
  81. package/lib/esm/logic/sesV2/buildRawMimeMessage.js.map +1 -0
  82. package/lib/esm/logic/sesV2/sendEmail.d.ts +2 -0
  83. package/lib/esm/logic/sesV2/sendEmail.js +37 -0
  84. package/lib/esm/logic/sesV2/sendEmail.js.map +1 -0
  85. package/lib/extension-layer/qpq-log-extension/index.js +22 -22
  86. package/package.json +25 -24
@@ -18,13 +18,13 @@ const utils_1 = require("./utils");
18
18
  // SigV4 presigned URLs cannot expire more than 7 days in the future
19
19
  const maxExpirationMs = 7 * 24 * 60 * 60 * 1000;
20
20
  const getProcessFileGenerateTemporaryUploadSecureUrl = (qpqConfig) => {
21
- return (_a, session_1) => __awaiter(void 0, [_a, session_1], void 0, function* ({ drive, filepath, expirationMs, contentType, scope }, session) {
21
+ return (_a, session_1) => __awaiter(void 0, [_a, session_1], void 0, function* ({ drive, filepath, expirationMs, contentType, contentDisposition, scope }, session) {
22
22
  if (expirationMs > maxExpirationMs) {
23
23
  return (0, quidproquo_core_1.actionResultError)(quidproquo_core_2.FileGenerateTemporaryUploadSecureUrlErrorTypeEnum.ExpirationTooLong, 'Expiration exceeds the 7 day maximum for presigned URLs');
24
24
  }
25
25
  try {
26
26
  const s3BucketName = (0, utils_1.resolveStorageDriveBucketName)(drive, qpqConfig);
27
- const url = yield (0, generatePresignedUploadUrl_1.generatePresignedUploadUrl)(s3BucketName, (0, quidproquo_core_2.composeScopedFilePath)(scope, filepath), quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), expirationMs, session.correlation, contentType);
27
+ const url = yield (0, generatePresignedUploadUrl_1.generatePresignedUploadUrl)(s3BucketName, (0, quidproquo_core_2.composeScopedFilePath)(scope, filepath), quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), expirationMs, session.correlation, contentType, contentDisposition);
28
28
  return (0, quidproquo_core_2.actionResult)(url);
29
29
  }
30
30
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"getFileGenerateTemporaryUploadSecureUrlActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAC1D,qDAAmJ;AACnJ,qDAMyB;AAEzB,6FAA0F;AAC1F,mCAAwD;AAExD,oEAAoE;AACpE,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,8CAA8C,GAAG,CAAC,SAAoB,EAAuD,EAAE;IACnI,OAAO,gBAAuE,EAAE,uDAAlE,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,EAAE,OAAO;QAC1E,IAAI,YAAY,GAAG,eAAe,EAAE,CAAC;YACnC,OAAO,IAAA,mCAAiB,EACtB,mEAAiD,CAAC,iBAAiB,EACnE,yDAAyD,CAC1D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACrE,MAAM,GAAG,GAAG,MAAM,IAAA,uDAA0B,EAC1C,YAAY,EACZ,IAAA,uCAAqB,EAAC,KAAK,EAAE,QAAQ,CAAC,EACtC,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,EAC7D,YAAY,EACZ,OAAO,CAAC,WAAW,EACnB,WAAW,CACZ,CAAC;YAEF,OAAO,IAAA,8BAAY,EAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,qEAAqE;YACrE,uDAAuD;YACvD,OAAO,IAAA,kDAAgC,EAAC,KAAK,EAAE;gBAC7C,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,mCAAiB,EAAC,mEAAiD,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC;aAC/H,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,sDAAsD,GAAgC,CACjG,SAAoB,EACU,EAAE;IAAC,OAAA,CAAC;QAClC,CAAC,gCAAc,CAAC,gCAAgC,CAAC,EAAE,8CAA8C,CAAC,SAAS,CAAC;KAC7G,CAAC,CAAA;EAAA,CAAC;AAJU,QAAA,sDAAsD,0DAIhE","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { ActionProcessorList, ActionProcessorListResolver, actionResultError, actionResultErrorFromCaughtError, QPQConfig } from 'quidproquo-core';\nimport {\n actionResult,\n composeScopedFilePath,\n FileActionType,\n FileGenerateTemporaryUploadSecureUrlActionProcessor,\n FileGenerateTemporaryUploadSecureUrlErrorTypeEnum,\n} from 'quidproquo-core';\n\nimport { generatePresignedUploadUrl } from '../../../logic/s3/generatePresignedUploadUrl';\nimport { resolveStorageDriveBucketName } from './utils';\n\n// SigV4 presigned URLs cannot expire more than 7 days in the future\nconst maxExpirationMs = 7 * 24 * 60 * 60 * 1000;\n\nconst getProcessFileGenerateTemporaryUploadSecureUrl = (qpqConfig: QPQConfig): FileGenerateTemporaryUploadSecureUrlActionProcessor => {\n return async ({ drive, filepath, expirationMs, contentType, scope }, session) => {\n if (expirationMs > maxExpirationMs) {\n return actionResultError(\n FileGenerateTemporaryUploadSecureUrlErrorTypeEnum.ExpirationTooLong,\n 'Expiration exceeds the 7 day maximum for presigned URLs',\n );\n }\n\n try {\n const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);\n const url = await generatePresignedUploadUrl(\n s3BucketName,\n composeScopedFilePath(scope, filepath),\n qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig),\n expirationMs,\n session.correlation,\n contentType,\n );\n\n return actionResult(url);\n } catch (error: unknown) {\n // Name-keyed, not instanceof: under npm link / module federation the\n // error can come from another copy of quidproquo-core.\n return actionResultErrorFromCaughtError(error, {\n InvalidScopeError: (error) => actionResultError(FileGenerateTemporaryUploadSecureUrlErrorTypeEnum.InvalidScope, error.message),\n });\n }\n };\n};\n\nexport const getFileGenerateTemporaryUploadSecureUrlActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n): Promise<ActionProcessorList> => ({\n [FileActionType.GenerateTemporaryUploadSecureUrl]: getProcessFileGenerateTemporaryUploadSecureUrl(qpqConfig),\n});\n"]}
1
+ {"version":3,"file":"getFileGenerateTemporaryUploadSecureUrlActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAC1D,qDAAmJ;AACnJ,qDAMyB;AAEzB,6FAA0F;AAC1F,mCAAwD;AAExD,oEAAoE;AACpE,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,8CAA8C,GAAG,CAAC,SAAoB,EAAuD,EAAE;IACnI,OAAO,gBAA2F,EAAE,uDAAtF,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,EAAE,OAAO;QAC9F,IAAI,YAAY,GAAG,eAAe,EAAE,CAAC;YACnC,OAAO,IAAA,mCAAiB,EACtB,mEAAiD,CAAC,iBAAiB,EACnE,yDAAyD,CAC1D,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,IAAA,qCAA6B,EAAC,KAAK,EAAE,SAAS,CAAC,CAAC;YACrE,MAAM,GAAG,GAAG,MAAM,IAAA,uDAA0B,EAC1C,YAAY,EACZ,IAAA,uCAAqB,EAAC,KAAK,EAAE,QAAQ,CAAC,EACtC,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,EAC7D,YAAY,EACZ,OAAO,CAAC,WAAW,EACnB,WAAW,EACX,kBAAkB,CACnB,CAAC;YAEF,OAAO,IAAA,8BAAY,EAAC,GAAG,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,qEAAqE;YACrE,uDAAuD;YACvD,OAAO,IAAA,kDAAgC,EAAC,KAAK,EAAE;gBAC7C,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,mCAAiB,EAAC,mEAAiD,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC;aAC/H,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,sDAAsD,GAAgC,CACjG,SAAoB,EACU,EAAE;IAAC,OAAA,CAAC;QAClC,CAAC,gCAAc,CAAC,gCAAgC,CAAC,EAAE,8CAA8C,CAAC,SAAS,CAAC;KAC7G,CAAC,CAAA;EAAA,CAAC;AAJU,QAAA,sDAAsD,0DAIhE","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport { ActionProcessorList, ActionProcessorListResolver, actionResultError, actionResultErrorFromCaughtError, QPQConfig } from 'quidproquo-core';\nimport {\n actionResult,\n composeScopedFilePath,\n FileActionType,\n FileGenerateTemporaryUploadSecureUrlActionProcessor,\n FileGenerateTemporaryUploadSecureUrlErrorTypeEnum,\n} from 'quidproquo-core';\n\nimport { generatePresignedUploadUrl } from '../../../logic/s3/generatePresignedUploadUrl';\nimport { resolveStorageDriveBucketName } from './utils';\n\n// SigV4 presigned URLs cannot expire more than 7 days in the future\nconst maxExpirationMs = 7 * 24 * 60 * 60 * 1000;\n\nconst getProcessFileGenerateTemporaryUploadSecureUrl = (qpqConfig: QPQConfig): FileGenerateTemporaryUploadSecureUrlActionProcessor => {\n return async ({ drive, filepath, expirationMs, contentType, contentDisposition, scope }, session) => {\n if (expirationMs > maxExpirationMs) {\n return actionResultError(\n FileGenerateTemporaryUploadSecureUrlErrorTypeEnum.ExpirationTooLong,\n 'Expiration exceeds the 7 day maximum for presigned URLs',\n );\n }\n\n try {\n const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);\n const url = await generatePresignedUploadUrl(\n s3BucketName,\n composeScopedFilePath(scope, filepath),\n qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig),\n expirationMs,\n session.correlation,\n contentType,\n contentDisposition,\n );\n\n return actionResult(url);\n } catch (error: unknown) {\n // Name-keyed, not instanceof: under npm link / module federation the\n // error can come from another copy of quidproquo-core.\n return actionResultErrorFromCaughtError(error, {\n InvalidScopeError: (error) => actionResultError(FileGenerateTemporaryUploadSecureUrlErrorTypeEnum.InvalidScope, error.message),\n });\n }\n };\n};\n\nexport const getFileGenerateTemporaryUploadSecureUrlActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n): Promise<ActionProcessorList> => ({\n [FileActionType.GenerateTemporaryUploadSecureUrl]: getProcessFileGenerateTemporaryUploadSecureUrl(qpqConfig),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getUserDirectoryRevokeRefreshTokenActionProcessor: ActionProcessorListResolver;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getUserDirectoryRevokeRefreshTokenActionProcessor = void 0;
13
+ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
14
+ const quidproquo_core_1 = require("quidproquo-core");
15
+ const awsNamingUtils_1 = require("../../../awsNamingUtils");
16
+ const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
17
+ const revokeRefreshToken_1 = require("../../../logic/cognito/revokeRefreshToken");
18
+ const getProcessRevokeRefreshToken = (qpqConfig) => {
19
+ return (_a) => __awaiter(void 0, [_a], void 0, function* ({ userDirectoryName, refreshToken }) {
20
+ const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
21
+ const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
22
+ const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(userDirectoryName, qpqConfig), region);
23
+ try {
24
+ yield (0, revokeRefreshToken_1.revokeRefreshToken)(userPoolId, userPoolClientId, region, refreshToken);
25
+ return (0, quidproquo_core_1.actionResult)(void 0);
26
+ }
27
+ catch (error) {
28
+ return (0, quidproquo_core_1.actionResultErrorFromCaughtError)(error, {
29
+ NotAuthorizedException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.UserDirectoryRevokeRefreshTokenErrorTypeEnum.Unauthorized, 'Refresh token is invalid or already revoked'),
30
+ TooManyRequestsException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.UserDirectoryRevokeRefreshTokenErrorTypeEnum.LimitExceeded, 'Too many attempts, please try again later'),
31
+ });
32
+ }
33
+ });
34
+ };
35
+ const getUserDirectoryRevokeRefreshTokenActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
36
+ return ({
37
+ [quidproquo_core_1.UserDirectoryActionType.RevokeRefreshToken]: getProcessRevokeRefreshToken(qpqConfig),
38
+ });
39
+ });
40
+ exports.getUserDirectoryRevokeRefreshTokenActionProcessor = getUserDirectoryRevokeRefreshTokenActionProcessor;
41
+ //# sourceMappingURL=getUserDirectoryRevokeRefreshTokenActionProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserDirectoryRevokeRefreshTokenActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/userDirectory/getUserDirectoryRevokeRefreshTokenActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAC1D,qDAUyB;AAEzB,4DAAyH;AACzH,qFAAkF;AAClF,kFAA+E;AAE/E,MAAM,4BAA4B,GAAG,CAAC,SAAoB,EAAkD,EAAE;IAC5G,OAAO,KAA4C,EAAE,4CAAvC,EAAE,iBAAiB,EAAE,YAAY,EAAE;QAC/C,MAAM,MAAM,GAAG,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC;QAE7E,MAAM,UAAU,GAAG,MAAM,IAAA,mCAAgB,EAAC,IAAA,oDAAmC,EAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;QAErH,MAAM,gBAAgB,GAAG,MAAM,IAAA,mCAAgB,EAAC,IAAA,0DAAyC,EAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;QAEjI,IAAI,CAAC;YACH,MAAM,IAAA,uCAAkB,EAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;YAE7E,OAAO,IAAA,8BAAY,EAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,IAAA,kDAAgC,EAAC,KAAK,EAAE;gBAC7C,sBAAsB,EAAE,GAAG,EAAE,CAC3B,IAAA,mCAAiB,EAAC,8DAA4C,CAAC,YAAY,EAAE,6CAA6C,CAAC;gBAC7H,wBAAwB,EAAE,GAAG,EAAE,CAC7B,IAAA,mCAAiB,EAAC,8DAA4C,CAAC,aAAa,EAAE,2CAA2C,CAAC;aAC7H,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,iDAAiD,GAAgC,CAC5F,SAAoB,EACU,EAAE;IAAC,OAAA,CAAC;QAClC,CAAC,yCAAuB,CAAC,kBAAkB,CAAC,EAAE,4BAA4B,CAAC,SAAS,CAAC;KACtF,CAAC,CAAA;EAAA,CAAC;AAJU,QAAA,iDAAiD,qDAI3D","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n actionResultError,\n actionResultErrorFromCaughtError,\n QPQConfig,\n UserDirectoryActionType,\n UserDirectoryRevokeRefreshTokenActionProcessor,\n UserDirectoryRevokeRefreshTokenErrorTypeEnum,\n} from 'quidproquo-core';\n\nimport { getCFExportNameUserPoolClientIdFromConfig, getCFExportNameUserPoolIdFromConfig } from '../../../awsNamingUtils';\nimport { getExportedValue } from '../../../logic/cloudformation/getExportedValue';\nimport { revokeRefreshToken } from '../../../logic/cognito/revokeRefreshToken';\n\nconst getProcessRevokeRefreshToken = (qpqConfig: QPQConfig): UserDirectoryRevokeRefreshTokenActionProcessor => {\n return async ({ userDirectoryName, refreshToken }) => {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);\n\n const userPoolId = await getExportedValue(getCFExportNameUserPoolIdFromConfig(userDirectoryName, qpqConfig), region);\n\n const userPoolClientId = await getExportedValue(getCFExportNameUserPoolClientIdFromConfig(userDirectoryName, qpqConfig), region);\n\n try {\n await revokeRefreshToken(userPoolId, userPoolClientId, region, refreshToken);\n\n return actionResult(void 0);\n } catch (error: unknown) {\n return actionResultErrorFromCaughtError(error, {\n NotAuthorizedException: () =>\n actionResultError(UserDirectoryRevokeRefreshTokenErrorTypeEnum.Unauthorized, 'Refresh token is invalid or already revoked'),\n TooManyRequestsException: () =>\n actionResultError(UserDirectoryRevokeRefreshTokenErrorTypeEnum.LimitExceeded, 'Too many attempts, please try again later'),\n });\n }\n };\n};\n\nexport const getUserDirectoryRevokeRefreshTokenActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n): Promise<ActionProcessorList> => ({\n [UserDirectoryActionType.RevokeRefreshToken]: getProcessRevokeRefreshToken(qpqConfig),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getUserDirectorySignOutUserActionProcessor: ActionProcessorListResolver;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getUserDirectorySignOutUserActionProcessor = void 0;
13
+ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
14
+ const quidproquo_core_1 = require("quidproquo-core");
15
+ const globalSignOut_1 = require("../../../logic/cognito/globalSignOut");
16
+ const getProcessSignOutUser = (qpqConfig) => {
17
+ return (_a) => __awaiter(void 0, [_a], void 0, function* ({ accessToken }) {
18
+ const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
19
+ try {
20
+ yield (0, globalSignOut_1.globalSignOut)(accessToken, region);
21
+ return (0, quidproquo_core_1.actionResult)(void 0);
22
+ }
23
+ catch (error) {
24
+ return (0, quidproquo_core_1.actionResultErrorFromCaughtError)(error, {
25
+ NotAuthorizedException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.UserDirectorySignOutUserErrorTypeEnum.Unauthorized, 'Access token is invalid or has expired'),
26
+ TooManyRequestsException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.UserDirectorySignOutUserErrorTypeEnum.LimitExceeded, 'Too many attempts, please try again later'),
27
+ });
28
+ }
29
+ });
30
+ };
31
+ const getUserDirectorySignOutUserActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
32
+ return ({
33
+ [quidproquo_core_1.UserDirectoryActionType.SignOutUser]: getProcessSignOutUser(qpqConfig),
34
+ });
35
+ });
36
+ exports.getUserDirectorySignOutUserActionProcessor = getUserDirectorySignOutUserActionProcessor;
37
+ //# sourceMappingURL=getUserDirectorySignOutUserActionProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserDirectorySignOutUserActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/userDirectory/getUserDirectorySignOutUserActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAC1D,qDAUyB;AAEzB,wEAAqE;AAErE,MAAM,qBAAqB,GAAG,CAAC,SAAoB,EAA2C,EAAE;IAC9F,OAAO,KAAwB,EAAE,4CAAnB,EAAE,WAAW,EAAE;QAC3B,MAAM,MAAM,GAAG,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC;QAE7E,IAAI,CAAC;YACH,MAAM,IAAA,6BAAa,EAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAEzC,OAAO,IAAA,8BAAY,EAAC,KAAK,CAAC,CAAC,CAAC;QAC9B,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,OAAO,IAAA,kDAAgC,EAAC,KAAK,EAAE;gBAC7C,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,uDAAqC,CAAC,YAAY,EAAE,wCAAwC,CAAC;gBAC7I,wBAAwB,EAAE,GAAG,EAAE,CAC7B,IAAA,mCAAiB,EAAC,uDAAqC,CAAC,aAAa,EAAE,2CAA2C,CAAC;aACtH,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,0CAA0C,GAAgC,CACrF,SAAoB,EACU,EAAE;IAAC,OAAA,CAAC;QAClC,CAAC,yCAAuB,CAAC,WAAW,CAAC,EAAE,qBAAqB,CAAC,SAAS,CAAC;KACxE,CAAC,CAAA;EAAA,CAAC;AAJU,QAAA,0CAA0C,8CAIpD","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n actionResultError,\n actionResultErrorFromCaughtError,\n QPQConfig,\n UserDirectoryActionType,\n UserDirectorySignOutUserActionProcessor,\n UserDirectorySignOutUserErrorTypeEnum,\n} from 'quidproquo-core';\n\nimport { globalSignOut } from '../../../logic/cognito/globalSignOut';\n\nconst getProcessSignOutUser = (qpqConfig: QPQConfig): UserDirectorySignOutUserActionProcessor => {\n return async ({ accessToken }) => {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);\n\n try {\n await globalSignOut(accessToken, region);\n\n return actionResult(void 0);\n } catch (error: unknown) {\n return actionResultErrorFromCaughtError(error, {\n NotAuthorizedException: () => actionResultError(UserDirectorySignOutUserErrorTypeEnum.Unauthorized, 'Access token is invalid or has expired'),\n TooManyRequestsException: () =>\n actionResultError(UserDirectorySignOutUserErrorTypeEnum.LimitExceeded, 'Too many attempts, please try again later'),\n });\n }\n };\n};\n\nexport const getUserDirectorySignOutUserActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n): Promise<ActionProcessorList> => ({\n [UserDirectoryActionType.SignOutUser]: getProcessSignOutUser(qpqConfig),\n});\n"]}
@@ -26,11 +26,13 @@ const getUserDirectoryReadAccessTokenActionProcessor_1 = require("./getUserDirec
26
26
  const getUserDirectoryRefreshTokenActionProcessor_1 = require("./getUserDirectoryRefreshTokenActionProcessor");
27
27
  const getUserDirectoryRequestEmailVerificationActionProcessor_1 = require("./getUserDirectoryRequestEmailVerificationActionProcessor");
28
28
  const getUserDirectoryRespondToAuthChallengeActionProcessor_1 = require("./getUserDirectoryRespondToAuthChallengeActionProcessor");
29
+ const getUserDirectoryRevokeRefreshTokenActionProcessor_1 = require("./getUserDirectoryRevokeRefreshTokenActionProcessor");
29
30
  const getUserDirectorySetAccessTokenActionProcessor_1 = require("./getUserDirectorySetAccessTokenActionProcessor");
30
31
  const getUserDirectorySetPasswordActionProcessor_1 = require("./getUserDirectorySetPasswordActionProcessor");
31
32
  const getUserDirectorySetUserAttributesActionProcessor_1 = require("./getUserDirectorySetUserAttributesActionProcessor");
33
+ const getUserDirectorySignOutUserActionProcessor_1 = require("./getUserDirectorySignOutUserActionProcessor");
32
34
  const getUserDirectoryActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
33
- return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (yield (0, getUserDirectoryAssociateSoftwareTokenActionProcessor_1.getUserDirectoryAssociateSoftwareTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryAuthenticateUserActionProcessor_1.getUserDirectoryAuthenticateUserActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryChangePasswordActionProcessor_1.getUserDirectoryChangePasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryConfirmEmailVerificationActionProcessor_1.getUserDirectoryConfirmEmailVerificationActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryConfirmForgotPasswordActionProcessor_1.getUserDirectoryConfirmForgotPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryCreateUserActionProcessor_1.getUserDirectoryCreateUserActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryDecodeAccessTokenActionProcessor_1.getUserDirectoryDecodeAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryForgotPasswordActionProcessor_1.getUserDirectoryForgotPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUserAttributesActionProcessor_1.getUserDirectoryGetUserAttributesActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUserAttributesByUserIdActionProcessor_1.getUserDirectoryGetUserAttributesByUserIdActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUsersActionProcessor_1.getUserDirectoryGetUsersActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUsersByAttributeActionProcessor_1.getUserDirectoryGetUsersByAttributeActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryReadAccessTokenActionProcessor_1.getUserDirectoryReadAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRefreshTokenActionProcessor_1.getUserDirectoryRefreshTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRequestEmailVerificationActionProcessor_1.getUserDirectoryRequestEmailVerificationActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRespondToAuthChallengeActionProcessor_1.getUserDirectoryRespondToAuthChallengeActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetAccessTokenActionProcessor_1.getUserDirectorySetAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetPasswordActionProcessor_1.getUserDirectorySetPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetUserAttributesActionProcessor_1.getUserDirectorySetUserAttributesActionProcessor)(qpqConfig, dynamicModuleLoader))));
35
+ return (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (yield (0, getUserDirectoryAssociateSoftwareTokenActionProcessor_1.getUserDirectoryAssociateSoftwareTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryAuthenticateUserActionProcessor_1.getUserDirectoryAuthenticateUserActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryChangePasswordActionProcessor_1.getUserDirectoryChangePasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryConfirmEmailVerificationActionProcessor_1.getUserDirectoryConfirmEmailVerificationActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryConfirmForgotPasswordActionProcessor_1.getUserDirectoryConfirmForgotPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryCreateUserActionProcessor_1.getUserDirectoryCreateUserActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryDecodeAccessTokenActionProcessor_1.getUserDirectoryDecodeAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryForgotPasswordActionProcessor_1.getUserDirectoryForgotPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUserAttributesActionProcessor_1.getUserDirectoryGetUserAttributesActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUserAttributesByUserIdActionProcessor_1.getUserDirectoryGetUserAttributesByUserIdActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUsersActionProcessor_1.getUserDirectoryGetUsersActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryGetUsersByAttributeActionProcessor_1.getUserDirectoryGetUsersByAttributeActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryReadAccessTokenActionProcessor_1.getUserDirectoryReadAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRefreshTokenActionProcessor_1.getUserDirectoryRefreshTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRevokeRefreshTokenActionProcessor_1.getUserDirectoryRevokeRefreshTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRequestEmailVerificationActionProcessor_1.getUserDirectoryRequestEmailVerificationActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectoryRespondToAuthChallengeActionProcessor_1.getUserDirectoryRespondToAuthChallengeActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetAccessTokenActionProcessor_1.getUserDirectorySetAccessTokenActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetPasswordActionProcessor_1.getUserDirectorySetPasswordActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySetUserAttributesActionProcessor_1.getUserDirectorySetUserAttributesActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getUserDirectorySignOutUserActionProcessor_1.getUserDirectorySignOutUserActionProcessor)(qpqConfig, dynamicModuleLoader))));
34
36
  });
35
37
  exports.getUserDirectoryActionProcessor = getUserDirectoryActionProcessor;
36
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/userDirectory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mIAAgI;AAChI,uHAAoH;AACpH,mHAAgH;AAChH,uIAAoI;AACpI,iIAA8H;AAC9H,2GAAwG;AACxG,yHAAsH;AACtH,mHAAgH;AAChH,yHAAsH;AACtH,yIAAsI;AACtI,uGAAoG;AACpG,6HAA0H;AAC1H,qHAAkH;AAClH,+GAA4G;AAC5G,uIAAoI;AACpI,mIAAgI;AAChI,mHAAgH;AAChH,6GAA0G;AAC1G,yHAAsH;AAE/G,MAAM,+BAA+B,GAAgC,CAC1E,SAAoB,EACpB,mBAAwC,EACV,EAAE;IAAC,OAAA,+QAC9B,CAAC,MAAM,IAAA,6GAAqD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC7F,CAAC,MAAM,IAAA,iGAA+C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACvF,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,iHAAuD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/F,CAAC,MAAM,IAAA,2GAAoD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC5F,CAAC,MAAM,IAAA,qFAAyC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACjF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxF,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxF,CAAC,MAAM,IAAA,mHAAwD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAChG,CAAC,MAAM,IAAA,iFAAuC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/E,CAAC,MAAM,IAAA,uGAAkD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC1F,CAAC,MAAM,IAAA,+FAA8C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACtF,CAAC,MAAM,IAAA,yFAA2C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACnF,CAAC,MAAM,IAAA,iHAAuD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/F,CAAC,MAAM,IAAA,6GAAqD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC7F,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,uFAA0C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAClF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,EAC3F,CAAA;EAAA,CAAC;AAvBU,QAAA,+BAA+B,mCAuBzC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, DynamicModuleLoader, QPQConfig } from 'quidproquo-core';\n\nimport { getUserDirectoryAssociateSoftwareTokenActionProcessor } from './getUserDirectoryAssociateSoftwareTokenActionProcessor';\nimport { getUserDirectoryAuthenticateUserActionProcessor } from './getUserDirectoryAuthenticateUserActionProcessor';\nimport { getUserDirectoryChangePasswordActionProcessor } from './getUserDirectoryChangePasswordActionProcessor';\nimport { getUserDirectoryConfirmEmailVerificationActionProcessor } from './getUserDirectoryConfirmEmailVerificationActionProcessor';\nimport { getUserDirectoryConfirmForgotPasswordActionProcessor } from './getUserDirectoryConfirmForgotPasswordActionProcessor';\nimport { getUserDirectoryCreateUserActionProcessor } from './getUserDirectoryCreateUserActionProcessor';\nimport { getUserDirectoryDecodeAccessTokenActionProcessor } from './getUserDirectoryDecodeAccessTokenActionProcessor';\nimport { getUserDirectoryForgotPasswordActionProcessor } from './getUserDirectoryForgotPasswordActionProcessor';\nimport { getUserDirectoryGetUserAttributesActionProcessor } from './getUserDirectoryGetUserAttributesActionProcessor';\nimport { getUserDirectoryGetUserAttributesByUserIdActionProcessor } from './getUserDirectoryGetUserAttributesByUserIdActionProcessor';\nimport { getUserDirectoryGetUsersActionProcessor } from './getUserDirectoryGetUsersActionProcessor';\nimport { getUserDirectoryGetUsersByAttributeActionProcessor } from './getUserDirectoryGetUsersByAttributeActionProcessor';\nimport { getUserDirectoryReadAccessTokenActionProcessor } from './getUserDirectoryReadAccessTokenActionProcessor';\nimport { getUserDirectoryRefreshTokenActionProcessor } from './getUserDirectoryRefreshTokenActionProcessor';\nimport { getUserDirectoryRequestEmailVerificationActionProcessor } from './getUserDirectoryRequestEmailVerificationActionProcessor';\nimport { getUserDirectoryRespondToAuthChallengeActionProcessor } from './getUserDirectoryRespondToAuthChallengeActionProcessor';\nimport { getUserDirectorySetAccessTokenActionProcessor } from './getUserDirectorySetAccessTokenActionProcessor';\nimport { getUserDirectorySetPasswordActionProcessor } from './getUserDirectorySetPasswordActionProcessor';\nimport { getUserDirectorySetUserAttributesActionProcessor } from './getUserDirectorySetUserAttributesActionProcessor';\n\nexport const getUserDirectoryActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n dynamicModuleLoader: DynamicModuleLoader,\n): Promise<ActionProcessorList> => ({\n ...(await getUserDirectoryAssociateSoftwareTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryAuthenticateUserActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryChangePasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryConfirmEmailVerificationActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryConfirmForgotPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryCreateUserActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryDecodeAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryForgotPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUserAttributesActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUserAttributesByUserIdActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUsersActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUsersByAttributeActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryReadAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRefreshTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRequestEmailVerificationActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRespondToAuthChallengeActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetUserAttributesActionProcessor(qpqConfig, dynamicModuleLoader)),\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/core/userDirectory/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mIAAgI;AAChI,uHAAoH;AACpH,mHAAgH;AAChH,uIAAoI;AACpI,iIAA8H;AAC9H,2GAAwG;AACxG,yHAAsH;AACtH,mHAAgH;AAChH,yHAAsH;AACtH,yIAAsI;AACtI,uGAAoG;AACpG,6HAA0H;AAC1H,qHAAkH;AAClH,+GAA4G;AAC5G,uIAAoI;AACpI,mIAAgI;AAChI,2HAAwH;AACxH,mHAAgH;AAChH,6GAA0G;AAC1G,yHAAsH;AACtH,6GAA0G;AAEnG,MAAM,+BAA+B,GAAgC,CAC1E,SAAoB,EACpB,mBAAwC,EACV,EAAE;IAAC,OAAA,2SAC9B,CAAC,MAAM,IAAA,6GAAqD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC7F,CAAC,MAAM,IAAA,iGAA+C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACvF,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,iHAAuD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/F,CAAC,MAAM,IAAA,2GAAoD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC5F,CAAC,MAAM,IAAA,qFAAyC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACjF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxF,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxF,CAAC,MAAM,IAAA,mHAAwD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAChG,CAAC,MAAM,IAAA,iFAAuC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/E,CAAC,MAAM,IAAA,uGAAkD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC1F,CAAC,MAAM,IAAA,+FAA8C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACtF,CAAC,MAAM,IAAA,yFAA2C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACnF,CAAC,MAAM,IAAA,qGAAiD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACzF,CAAC,MAAM,IAAA,iHAAuD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/F,CAAC,MAAM,IAAA,6GAAqD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC7F,CAAC,MAAM,IAAA,6FAA6C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACrF,CAAC,MAAM,IAAA,uFAA0C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAClF,CAAC,MAAM,IAAA,mGAAgD,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxF,CAAC,MAAM,IAAA,uFAA0C,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,EACrF,CAAA;EAAA,CAAC;AAzBU,QAAA,+BAA+B,mCAyBzC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, DynamicModuleLoader, QPQConfig } from 'quidproquo-core';\n\nimport { getUserDirectoryAssociateSoftwareTokenActionProcessor } from './getUserDirectoryAssociateSoftwareTokenActionProcessor';\nimport { getUserDirectoryAuthenticateUserActionProcessor } from './getUserDirectoryAuthenticateUserActionProcessor';\nimport { getUserDirectoryChangePasswordActionProcessor } from './getUserDirectoryChangePasswordActionProcessor';\nimport { getUserDirectoryConfirmEmailVerificationActionProcessor } from './getUserDirectoryConfirmEmailVerificationActionProcessor';\nimport { getUserDirectoryConfirmForgotPasswordActionProcessor } from './getUserDirectoryConfirmForgotPasswordActionProcessor';\nimport { getUserDirectoryCreateUserActionProcessor } from './getUserDirectoryCreateUserActionProcessor';\nimport { getUserDirectoryDecodeAccessTokenActionProcessor } from './getUserDirectoryDecodeAccessTokenActionProcessor';\nimport { getUserDirectoryForgotPasswordActionProcessor } from './getUserDirectoryForgotPasswordActionProcessor';\nimport { getUserDirectoryGetUserAttributesActionProcessor } from './getUserDirectoryGetUserAttributesActionProcessor';\nimport { getUserDirectoryGetUserAttributesByUserIdActionProcessor } from './getUserDirectoryGetUserAttributesByUserIdActionProcessor';\nimport { getUserDirectoryGetUsersActionProcessor } from './getUserDirectoryGetUsersActionProcessor';\nimport { getUserDirectoryGetUsersByAttributeActionProcessor } from './getUserDirectoryGetUsersByAttributeActionProcessor';\nimport { getUserDirectoryReadAccessTokenActionProcessor } from './getUserDirectoryReadAccessTokenActionProcessor';\nimport { getUserDirectoryRefreshTokenActionProcessor } from './getUserDirectoryRefreshTokenActionProcessor';\nimport { getUserDirectoryRequestEmailVerificationActionProcessor } from './getUserDirectoryRequestEmailVerificationActionProcessor';\nimport { getUserDirectoryRespondToAuthChallengeActionProcessor } from './getUserDirectoryRespondToAuthChallengeActionProcessor';\nimport { getUserDirectoryRevokeRefreshTokenActionProcessor } from './getUserDirectoryRevokeRefreshTokenActionProcessor';\nimport { getUserDirectorySetAccessTokenActionProcessor } from './getUserDirectorySetAccessTokenActionProcessor';\nimport { getUserDirectorySetPasswordActionProcessor } from './getUserDirectorySetPasswordActionProcessor';\nimport { getUserDirectorySetUserAttributesActionProcessor } from './getUserDirectorySetUserAttributesActionProcessor';\nimport { getUserDirectorySignOutUserActionProcessor } from './getUserDirectorySignOutUserActionProcessor';\n\nexport const getUserDirectoryActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n dynamicModuleLoader: DynamicModuleLoader,\n): Promise<ActionProcessorList> => ({\n ...(await getUserDirectoryAssociateSoftwareTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryAuthenticateUserActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryChangePasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryConfirmEmailVerificationActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryConfirmForgotPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryCreateUserActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryDecodeAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryForgotPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUserAttributesActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUserAttributesByUserIdActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUsersActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryGetUsersByAttributeActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryReadAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRefreshTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRevokeRefreshTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRequestEmailVerificationActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectoryRespondToAuthChallengeActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetAccessTokenActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetPasswordActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySetUserAttributesActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getUserDirectorySignOutUserActionProcessor(qpqConfig, dynamicModuleLoader)),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getEmailSendEmailActionProcessor: ActionProcessorListResolver;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getEmailSendEmailActionProcessor = void 0;
13
+ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
14
+ const quidproquo_core_1 = require("quidproquo-core");
15
+ const quidproquo_webserver_1 = require("quidproquo-webserver");
16
+ const sendEmail_1 = require("../../../logic/sesV2/sendEmail");
17
+ const getProcessSendEmail = (qpqConfig) => {
18
+ return (payload) => __awaiter(void 0, void 0, void 0, function* () {
19
+ const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
20
+ try {
21
+ const messageId = yield (0, sendEmail_1.sendEmail)(payload, region);
22
+ return (0, quidproquo_core_1.actionResult)(messageId);
23
+ }
24
+ catch (error) {
25
+ return (0, quidproquo_core_1.actionResultErrorFromCaughtError)(error, {
26
+ MessageRejected: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.MessageRejected, 'Message rejected'),
27
+ MailFromDomainNotVerifiedException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.SenderNotVerified, 'Sender domain not verified'),
28
+ AccountSuspendedException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.AccountSuspended, 'Email sending account suspended'),
29
+ SendingPausedException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.SendingPaused, 'Email sending is paused'),
30
+ TooManyRequestsException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.Throttled, 'Rate exceeded'),
31
+ LimitExceededException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.LimitExceeded, 'Sending limit exceeded'),
32
+ BadRequestException: () => (0, quidproquo_core_1.actionResultError)(quidproquo_webserver_1.EmailSendEmailErrorTypeEnum.BadRequest, 'Invalid email request'),
33
+ });
34
+ }
35
+ });
36
+ };
37
+ const getEmailSendEmailActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
38
+ return ({
39
+ [quidproquo_webserver_1.EmailActionType.SendEmail]: getProcessSendEmail(qpqConfig),
40
+ });
41
+ });
42
+ exports.getEmailSendEmailActionProcessor = getEmailSendEmailActionProcessor;
43
+ //# sourceMappingURL=getEmailSendEmailActionProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEmailSendEmailActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/webserver/email/getEmailSendEmailActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0D;AAC1D,qDAOyB;AACzB,+DAAmH;AAEnH,8DAA2D;AAE3D,MAAM,mBAAmB,GAAG,CAAC,SAAoB,EAAiC,EAAE;IAClF,OAAO,CAAO,OAAO,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,yCAAiB,CAAC,gCAAgC,CAAC,SAAS,CAAC,CAAC;QAE7E,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAA,qBAAS,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAEnD,OAAO,IAAA,8BAAY,EAAC,SAAS,CAAC,CAAC;QACjC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,IAAA,kDAAgC,EAAC,KAAK,EAAE;gBAC7C,eAAe,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,eAAe,EAAE,kBAAkB,CAAC;gBACzG,kCAAkC,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,iBAAiB,EAAE,4BAA4B,CAAC;gBACxI,yBAAyB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,gBAAgB,EAAE,iCAAiC,CAAC;gBACnI,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,aAAa,EAAE,yBAAyB,CAAC;gBACrH,wBAAwB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,SAAS,EAAE,eAAe,CAAC;gBACzG,sBAAsB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,aAAa,EAAE,wBAAwB,CAAC;gBACpH,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAA,mCAAiB,EAAC,kDAA2B,CAAC,UAAU,EAAE,uBAAuB,CAAC;aAC9G,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,gCAAgC,GAAgC,CAAO,SAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QAC1I,CAAC,sCAAe,CAAC,SAAS,CAAC,EAAE,mBAAmB,CAAC,SAAS,CAAC;KAC5D,CAAC,CAAA;EAAA,CAAC;AAFU,QAAA,gCAAgC,oCAE1C","sourcesContent":["import { qpqConfigAwsUtils } from 'quidproquo-config-aws';\nimport {\n ActionProcessorList,\n ActionProcessorListResolver,\n actionResult,\n actionResultError,\n actionResultErrorFromCaughtError,\n QPQConfig,\n} from 'quidproquo-core';\nimport { EmailActionType, EmailSendEmailActionProcessor, EmailSendEmailErrorTypeEnum } from 'quidproquo-webserver';\n\nimport { sendEmail } from '../../../logic/sesV2/sendEmail';\n\nconst getProcessSendEmail = (qpqConfig: QPQConfig): EmailSendEmailActionProcessor => {\n return async (payload) => {\n const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);\n\n try {\n const messageId = await sendEmail(payload, region);\n\n return actionResult(messageId);\n } catch (error) {\n return actionResultErrorFromCaughtError(error, {\n MessageRejected: () => actionResultError(EmailSendEmailErrorTypeEnum.MessageRejected, 'Message rejected'),\n MailFromDomainNotVerifiedException: () => actionResultError(EmailSendEmailErrorTypeEnum.SenderNotVerified, 'Sender domain not verified'),\n AccountSuspendedException: () => actionResultError(EmailSendEmailErrorTypeEnum.AccountSuspended, 'Email sending account suspended'),\n SendingPausedException: () => actionResultError(EmailSendEmailErrorTypeEnum.SendingPaused, 'Email sending is paused'),\n TooManyRequestsException: () => actionResultError(EmailSendEmailErrorTypeEnum.Throttled, 'Rate exceeded'),\n LimitExceededException: () => actionResultError(EmailSendEmailErrorTypeEnum.LimitExceeded, 'Sending limit exceeded'),\n BadRequestException: () => actionResultError(EmailSendEmailErrorTypeEnum.BadRequest, 'Invalid email request'),\n });\n }\n };\n};\n\nexport const getEmailSendEmailActionProcessor: ActionProcessorListResolver = async (qpqConfig: QPQConfig): Promise<ActionProcessorList> => ({\n [EmailActionType.SendEmail]: getProcessSendEmail(qpqConfig),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getEmailSetDeliveryStatusActionProcessor: ActionProcessorListResolver;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getEmailSetDeliveryStatusActionProcessor = void 0;
13
+ const quidproquo_core_1 = require("quidproquo-core");
14
+ const quidproquo_webserver_1 = require("quidproquo-webserver");
15
+ // Deliberately a no-op: the action's meaning is its log entry, which the admin
16
+ // action search folds into the email's entity via the messageId link key.
17
+ const getProcessSetDeliveryStatus = () => {
18
+ return () => __awaiter(void 0, void 0, void 0, function* () { return (0, quidproquo_core_1.actionResult)(undefined); });
19
+ };
20
+ const getEmailSetDeliveryStatusActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
21
+ return ({
22
+ [quidproquo_webserver_1.EmailActionType.SetDeliveryStatus]: getProcessSetDeliveryStatus(),
23
+ });
24
+ });
25
+ exports.getEmailSetDeliveryStatusActionProcessor = getEmailSetDeliveryStatusActionProcessor;
26
+ //# sourceMappingURL=getEmailSetDeliveryStatusActionProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getEmailSetDeliveryStatusActionProcessor.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/webserver/email/getEmailSetDeliveryStatusActionProcessor.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4G;AAC5G,+DAA8F;AAE9F,+EAA+E;AAC/E,0EAA0E;AAC1E,MAAM,2BAA2B,GAAG,GAA0C,EAAE;IAC9E,OAAO,GAAS,EAAE,kDAAC,OAAA,IAAA,8BAAY,EAAC,SAAS,CAAC,CAAA,GAAA,CAAC;AAC7C,CAAC,CAAC;AAEK,MAAM,wCAAwC,GAAgC,CAAO,SAAoB,EAAgC,EAAE;IAAC,OAAA,CAAC;QAClJ,CAAC,sCAAe,CAAC,iBAAiB,CAAC,EAAE,2BAA2B,EAAE;KACnE,CAAC,CAAA;EAAA,CAAC;AAFU,QAAA,wCAAwC,4CAElD","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, actionResult, QPQConfig } from 'quidproquo-core';\nimport { EmailActionType, EmailSetDeliveryStatusActionProcessor } from 'quidproquo-webserver';\n\n// Deliberately a no-op: the action's meaning is its log entry, which the admin\n// action search folds into the email's entity via the messageId link key.\nconst getProcessSetDeliveryStatus = (): EmailSetDeliveryStatusActionProcessor => {\n return async () => actionResult(undefined);\n};\n\nexport const getEmailSetDeliveryStatusActionProcessor: ActionProcessorListResolver = async (qpqConfig: QPQConfig): Promise<ActionProcessorList> => ({\n [EmailActionType.SetDeliveryStatus]: getProcessSetDeliveryStatus(),\n});\n"]}
@@ -0,0 +1,2 @@
1
+ import { ActionProcessorListResolver } from 'quidproquo-core';
2
+ export declare const getEmailActionProcessor: ActionProcessorListResolver;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.getEmailActionProcessor = void 0;
13
+ const getEmailSendEmailActionProcessor_1 = require("./getEmailSendEmailActionProcessor");
14
+ const getEmailSetDeliveryStatusActionProcessor_1 = require("./getEmailSetDeliveryStatusActionProcessor");
15
+ const getEmailActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
16
+ return (Object.assign(Object.assign({}, (yield (0, getEmailSendEmailActionProcessor_1.getEmailSendEmailActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getEmailSetDeliveryStatusActionProcessor_1.getEmailSetDeliveryStatusActionProcessor)(qpqConfig, dynamicModuleLoader))));
17
+ });
18
+ exports.getEmailActionProcessor = getEmailActionProcessor;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/getActionProcessor/webserver/email/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yFAAsF;AACtF,yGAAsG;AAE/F,MAAM,uBAAuB,GAAgC,CAClE,SAAoB,EACpB,mBAAwC,EACV,EAAE;IAAC,OAAA,iCAC9B,CAAC,MAAM,IAAA,mEAAgC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACxE,CAAC,MAAM,IAAA,mFAAwC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,EACnF,CAAA;EAAA,CAAC;AANU,QAAA,uBAAuB,2BAMjC","sourcesContent":["import { ActionProcessorList, ActionProcessorListResolver, DynamicModuleLoader, QPQConfig } from 'quidproquo-core';\n\nimport { getEmailSendEmailActionProcessor } from './getEmailSendEmailActionProcessor';\nimport { getEmailSetDeliveryStatusActionProcessor } from './getEmailSetDeliveryStatusActionProcessor';\n\nexport const getEmailActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n dynamicModuleLoader: DynamicModuleLoader,\n): Promise<ActionProcessorList> => ({\n ...(await getEmailSendEmailActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getEmailSetDeliveryStatusActionProcessor(qpqConfig, dynamicModuleLoader)),\n});\n"]}
@@ -1,3 +1,4 @@
1
+ export * from './email';
1
2
  export * from './serviceFunction';
2
3
  export * from './webEntry';
3
4
  export * from './websocket';
@@ -24,14 +24,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.getWebserverActionProcessor = void 0;
27
+ const email_1 = require("./email");
27
28
  const serviceFunction_1 = require("./serviceFunction");
28
29
  const webEntry_1 = require("./webEntry");
29
30
  const websocket_1 = require("./websocket");
31
+ __exportStar(require("./email"), exports);
30
32
  __exportStar(require("./serviceFunction"), exports);
31
33
  __exportStar(require("./webEntry"), exports);
32
34
  __exportStar(require("./websocket"), exports);
33
35
  const getWebserverActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
34
- return (Object.assign(Object.assign(Object.assign({}, (yield (0, webEntry_1.getWebEntryActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, serviceFunction_1.getServiceFunctionActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, websocket_1.getWebsocketActionProcessor)(qpqConfig, dynamicModuleLoader))));
36
+ return (Object.assign(Object.assign(Object.assign(Object.assign({}, (yield (0, email_1.getEmailActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, webEntry_1.getWebEntryActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, serviceFunction_1.getServiceFunctionActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, websocket_1.getWebsocketActionProcessor)(qpqConfig, dynamicModuleLoader))));
35
37
  });
36
38
  exports.getWebserverActionProcessor = getWebserverActionProcessor;
37
39
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/getActionProcessor/webserver/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAsE;AACtE,yCAAwD;AACxD,2CAA0D;AAE1D,oDAAkC;AAClC,6CAA2B;AAC3B,8CAA4B;AAIrB,MAAM,2BAA2B,GAAgC,CACtE,SAAoB,EACpB,mBAAwC,EACV,EAAE;IAAC,OAAA,+CAC9B,CAAC,MAAM,IAAA,qCAA0B,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAClE,CAAC,MAAM,IAAA,mDAAiC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACzE,CAAC,MAAM,IAAA,uCAA2B,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,EACtE,CAAA;EAAA,CAAC;AAPU,QAAA,2BAA2B,+BAOrC","sourcesContent":["import { getServiceFunctionActionProcessor } from './serviceFunction';\nimport { getWebEntryActionProcessor } from './webEntry';\nimport { getWebsocketActionProcessor } from './websocket';\n\nexport * from './serviceFunction';\nexport * from './webEntry';\nexport * from './websocket';\n\nimport { ActionProcessorList, ActionProcessorListResolver, DynamicModuleLoader, QPQConfig } from 'quidproquo-core';\n\nexport const getWebserverActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n dynamicModuleLoader: DynamicModuleLoader,\n): Promise<ActionProcessorList> => ({\n ...(await getWebEntryActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getServiceFunctionActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getWebsocketActionProcessor(qpqConfig, dynamicModuleLoader)),\n});\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/getActionProcessor/webserver/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAkD;AAClD,uDAAsE;AACtE,yCAAwD;AACxD,2CAA0D;AAE1D,0CAAwB;AACxB,oDAAkC;AAClC,6CAA2B;AAC3B,8CAA4B;AAIrB,MAAM,2BAA2B,GAAgC,CACtE,SAAoB,EACpB,mBAAwC,EACV,EAAE;IAAC,OAAA,6DAC9B,CAAC,MAAM,IAAA,+BAAuB,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAC/D,CAAC,MAAM,IAAA,qCAA0B,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GAClE,CAAC,MAAM,IAAA,mDAAiC,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,GACzE,CAAC,MAAM,IAAA,uCAA2B,EAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,EACtE,CAAA;EAAA,CAAC;AARU,QAAA,2BAA2B,+BAQrC","sourcesContent":["import { getEmailActionProcessor } from './email';\nimport { getServiceFunctionActionProcessor } from './serviceFunction';\nimport { getWebEntryActionProcessor } from './webEntry';\nimport { getWebsocketActionProcessor } from './websocket';\n\nexport * from './email';\nexport * from './serviceFunction';\nexport * from './webEntry';\nexport * from './websocket';\n\nimport { ActionProcessorList, ActionProcessorListResolver, DynamicModuleLoader, QPQConfig } from 'quidproquo-core';\n\nexport const getWebserverActionProcessor: ActionProcessorListResolver = async (\n qpqConfig: QPQConfig,\n dynamicModuleLoader: DynamicModuleLoader,\n): Promise<ActionProcessorList> => ({\n ...(await getEmailActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getWebEntryActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getServiceFunctionActionProcessor(qpqConfig, dynamicModuleLoader)),\n ...(await getWebsocketActionProcessor(qpqConfig, dynamicModuleLoader)),\n});\n"]}
@@ -0,0 +1 @@
1
+ export declare const globalSignOut: (accessToken: string, region: string) => Promise<void>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.globalSignOut = void 0;
13
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
14
+ const createAwsClient_1 = require("../createAwsClient");
15
+ // Revokes EVERY refresh token issued to the user who owns this access token. Authorized by
16
+ // the access token itself (no IAM needed, like ChangePassword). Access tokens already minted
17
+ // stay valid until they expire (stateless JWTs), so keep the access-token validity short.
18
+ const globalSignOut = (accessToken, region) => __awaiter(void 0, void 0, void 0, function* () {
19
+ const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
20
+ region,
21
+ });
22
+ const params = {
23
+ AccessToken: accessToken,
24
+ };
25
+ yield cognitoClient.send(new client_cognito_identity_provider_1.GlobalSignOutCommand(params));
26
+ });
27
+ exports.globalSignOut = globalSignOut;
28
+ //# sourceMappingURL=globalSignOut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalSignOut.js","sourceRoot":"","sources":["../../../../src/logic/cognito/globalSignOut.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gGAA2I;AAE3I,wDAAqD;AAErD,2FAA2F;AAC3F,6FAA6F;AAC7F,0FAA0F;AACnF,MAAM,aAAa,GAAG,CAAO,WAAmB,EAAE,MAAc,EAAiB,EAAE;IACxF,MAAM,aAAa,GAAG,IAAA,iCAAe,EAAC,gEAA6B,EAAE;QACnE,MAAM;KACP,CAAC,CAAC;IAEH,MAAM,MAAM,GAA8B;QACxC,WAAW,EAAE,WAAW;KACzB,CAAC;IAEF,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,uDAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7D,CAAC,CAAA,CAAC;AAVW,QAAA,aAAa,iBAUxB","sourcesContent":["import { CognitoIdentityProviderClient, GlobalSignOutCommand, GlobalSignOutCommandInput } from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\n\n// Revokes EVERY refresh token issued to the user who owns this access token. Authorized by\n// the access token itself (no IAM needed, like ChangePassword). Access tokens already minted\n// stay valid until they expire (stateless JWTs), so keep the access-token validity short.\nexport const globalSignOut = async (accessToken: string, region: string): Promise<void> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const params: GlobalSignOutCommandInput = {\n AccessToken: accessToken,\n };\n\n await cognitoClient.send(new GlobalSignOutCommand(params));\n};\n"]}
@@ -1,2 +1,4 @@
1
1
  export * from './decodeAccessToken';
2
2
  export * from './decodeValidJwt';
3
+ export * from './globalSignOut';
4
+ export * from './revokeRefreshToken';
@@ -16,4 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./decodeAccessToken"), exports);
18
18
  __exportStar(require("./decodeValidJwt"), exports);
19
+ __exportStar(require("./globalSignOut"), exports);
20
+ __exportStar(require("./revokeRefreshToken"), exports);
19
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/cognito/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,mDAAiC","sourcesContent":["export * from './decodeAccessToken';\nexport * from './decodeValidJwt';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/logic/cognito/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,mDAAiC;AACjC,kDAAgC;AAChC,uDAAqC","sourcesContent":["export * from './decodeAccessToken';\nexport * from './decodeValidJwt';\nexport * from './globalSignOut';\nexport * from './revokeRefreshToken';\n"]}
@@ -33,7 +33,16 @@ const refreshToken = (userPoolId, clientId, region, username, refreshToken) => _
33
33
  // Time we issued the request
34
34
  const issueDateTime = new Date().toISOString();
35
35
  const response = yield cognitoClient.send(new client_cognito_identity_provider_1.AdminInitiateAuthCommand(params));
36
- return (0, transformCognitoResponse_1.cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo)(response, issueDateTime);
36
+ const authResponse = (0, transformCognitoResponse_1.cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo)(response, issueDateTime);
37
+ // Cognito's REFRESH_TOKEN_AUTH flow does NOT return a refresh token — the existing one stays
38
+ // valid and is reused — so AuthenticationResult.RefreshToken is undefined here. Carry the
39
+ // caller's refresh token forward so the client keeps a usable session; without this it's
40
+ // dropped after the first refresh and the session can never refresh again. (If refresh-token
41
+ // rotation is ever enabled, Cognito DOES return a new one — then we keep that instead.)
42
+ if (authResponse.authenticationInfo && !authResponse.authenticationInfo.refreshToken) {
43
+ authResponse.authenticationInfo.refreshToken = refreshToken;
44
+ }
45
+ return authResponse;
37
46
  });
38
47
  exports.refreshToken = refreshToken;
39
48
  //# sourceMappingURL=refreshToken.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"refreshToken.js","sourceRoot":"","sources":["../../../../src/logic/cognito/refreshToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAKmD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,+EAA2G;AAC3G,uEAAoE;AAE7D,MAAM,YAAY,GAAG,CAC1B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAgB,EAChB,YAAoB,EACe,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,GAAkC;QAC5C,QAAQ,EAAE,+CAAY,CAAC,kBAAkB;QACzC,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAElB,cAAc,EAAE;YACd,aAAa,EAAE,YAAY;YAC3B,WAAW,EAAE,UAAU;SACxB;KACF,CAAC;IAEF,6BAA6B;IAC7B,MAAM,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,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;AA9BW,QAAA,YAAY,gBA8BvB","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/transformCognitoResponse';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\nexport const refreshToken = async (\n userPoolId: string,\n clientId: string,\n region: string,\n username: string,\n refreshToken: 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: AdminInitiateAuthCommandInput = {\n AuthFlow: AuthFlowType.REFRESH_TOKEN_AUTH,\n UserPoolId: userPoolId,\n ClientId: clientId,\n\n AuthParameters: {\n REFRESH_TOKEN: refreshToken,\n SECRET_HASH: secretHash,\n },\n };\n\n // Time we issued the request\n const issueDateTime = new Date().toISOString();\n const response = await cognitoClient.send(new AdminInitiateAuthCommand(params));\n\n return cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo(response, issueDateTime);\n};\n"]}
1
+ {"version":3,"file":"refreshToken.js","sourceRoot":"","sources":["../../../../src/logic/cognito/refreshToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,gGAKmD;AAEnD,wDAAqD;AACrD,qEAAkE;AAClE,+EAA2G;AAC3G,uEAAoE;AAE7D,MAAM,YAAY,GAAG,CAC1B,UAAkB,EAClB,QAAgB,EAChB,MAAc,EACd,QAAgB,EAChB,YAAoB,EACe,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,GAAkC;QAC5C,QAAQ,EAAE,+CAAY,CAAC,kBAAkB;QACzC,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,QAAQ;QAElB,cAAc,EAAE;YACd,aAAa,EAAE,YAAY;YAC3B,WAAW,EAAE,UAAU;SACxB;KACF,CAAC;IAEF,6BAA6B;IAC7B,MAAM,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,2DAAwB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEhF,MAAM,YAAY,GAAG,IAAA,kFAAuD,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAEtG,6FAA6F;IAC7F,0FAA0F;IAC1F,yFAAyF;IACzF,6FAA6F;IAC7F,wFAAwF;IACxF,IAAI,YAAY,CAAC,kBAAkB,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;QACrF,YAAY,CAAC,kBAAkB,CAAC,YAAY,GAAG,YAAY,CAAC;IAC9D,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC,CAAA,CAAC;AAzCW,QAAA,YAAY,gBAyCvB","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/transformCognitoResponse';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\nexport const refreshToken = async (\n userPoolId: string,\n clientId: string,\n region: string,\n username: string,\n refreshToken: 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: AdminInitiateAuthCommandInput = {\n AuthFlow: AuthFlowType.REFRESH_TOKEN_AUTH,\n UserPoolId: userPoolId,\n ClientId: clientId,\n\n AuthParameters: {\n REFRESH_TOKEN: refreshToken,\n SECRET_HASH: secretHash,\n },\n };\n\n // Time we issued the request\n const issueDateTime = new Date().toISOString();\n const response = await cognitoClient.send(new AdminInitiateAuthCommand(params));\n\n const authResponse = cognitoAdminInitiateAuthResponseToQpqAuthenticationInfo(response, issueDateTime);\n\n // Cognito's REFRESH_TOKEN_AUTH flow does NOT return a refresh token — the existing one stays\n // valid and is reused — so AuthenticationResult.RefreshToken is undefined here. Carry the\n // caller's refresh token forward so the client keeps a usable session; without this it's\n // dropped after the first refresh and the session can never refresh again. (If refresh-token\n // rotation is ever enabled, Cognito DOES return a new one — then we keep that instead.)\n if (authResponse.authenticationInfo && !authResponse.authenticationInfo.refreshToken) {\n authResponse.authenticationInfo.refreshToken = refreshToken;\n }\n\n return authResponse;\n};\n"]}
@@ -0,0 +1 @@
1
+ export declare const revokeRefreshToken: (userPoolId: string, clientId: string, region: string, refreshToken: string) => Promise<void>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.revokeRefreshToken = void 0;
13
+ const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
14
+ const createAwsClient_1 = require("../createAwsClient");
15
+ const getUserPoolClientSecret_1 = require("./getUserPoolClientSecret");
16
+ // Revokes a single refresh token (and its access-token lineage) via Cognito RevokeToken.
17
+ // The app client has a secret (same one the refresh flow uses), so it must be supplied.
18
+ // Requires token revocation to be enabled on the app client (the CDK default) — a disabled
19
+ // client surfaces as UnsupportedOperationException/UnsupportedTokenTypeException.
20
+ const revokeRefreshToken = (userPoolId, clientId, region, refreshToken) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const cognitoClient = (0, createAwsClient_1.createAwsClient)(client_cognito_identity_provider_1.CognitoIdentityProviderClient, {
22
+ region,
23
+ });
24
+ const clientSecret = yield (0, getUserPoolClientSecret_1.getUserPoolClientSecret)(userPoolId, clientId, region);
25
+ const params = {
26
+ Token: refreshToken,
27
+ ClientId: clientId,
28
+ ClientSecret: clientSecret,
29
+ };
30
+ yield cognitoClient.send(new client_cognito_identity_provider_1.RevokeTokenCommand(params));
31
+ });
32
+ exports.revokeRefreshToken = revokeRefreshToken;
33
+ //# sourceMappingURL=revokeRefreshToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revokeRefreshToken.js","sourceRoot":"","sources":["../../../../src/logic/cognito/revokeRefreshToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gGAAuI;AAEvI,wDAAqD;AACrD,uEAAoE;AAEpE,yFAAyF;AACzF,wFAAwF;AACxF,2FAA2F;AAC3F,kFAAkF;AAC3E,MAAM,kBAAkB,GAAG,CAAO,UAAkB,EAAE,QAAgB,EAAE,MAAc,EAAE,YAAoB,EAAiB,EAAE;IACpI,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;IAEjF,MAAM,MAAM,GAA4B;QACtC,KAAK,EAAE,YAAY;QACnB,QAAQ,EAAE,QAAQ;QAClB,YAAY,EAAE,YAAY;KAC3B,CAAC;IAEF,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,qDAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAA,CAAC;AAdW,QAAA,kBAAkB,sBAc7B","sourcesContent":["import { CognitoIdentityProviderClient, RevokeTokenCommand, RevokeTokenCommandInput } from '@aws-sdk/client-cognito-identity-provider';\n\nimport { createAwsClient } from '../createAwsClient';\nimport { getUserPoolClientSecret } from './getUserPoolClientSecret';\n\n// Revokes a single refresh token (and its access-token lineage) via Cognito RevokeToken.\n// The app client has a secret (same one the refresh flow uses), so it must be supplied.\n// Requires token revocation to be enabled on the app client (the CDK default) — a disabled\n// client surfaces as UnsupportedOperationException/UnsupportedTokenTypeException.\nexport const revokeRefreshToken = async (userPoolId: string, clientId: string, region: string, refreshToken: string): Promise<void> => {\n const cognitoClient = createAwsClient(CognitoIdentityProviderClient, {\n region,\n });\n\n const clientSecret = await getUserPoolClientSecret(userPoolId, clientId, region);\n\n const params: RevokeTokenCommandInput = {\n Token: refreshToken,\n ClientId: clientId,\n ClientSecret: clientSecret,\n };\n\n await cognitoClient.send(new RevokeTokenCommand(params));\n};\n"]}
@@ -1 +1 @@
1
- export declare const generatePresignedUploadUrl: (bucketName: string, objectKey: string, region: string, expirationMs: number, correlationId?: string, contentType?: string) => Promise<string>;
1
+ export declare const generatePresignedUploadUrl: (bucketName: string, objectKey: string, region: string, expirationMs: number, correlationId?: string, contentType?: string, contentDisposition?: string) => Promise<string>;
@@ -43,7 +43,7 @@ const createAwsClient_1 = require("../createAwsClient");
43
43
  // fields: presignedPost.fields
44
44
  // };
45
45
  // };
46
- const generatePresignedUploadUrl = (bucketName, objectKey, region, expirationMs, correlationId, contentType) => __awaiter(void 0, void 0, void 0, function* () {
46
+ const generatePresignedUploadUrl = (bucketName, objectKey, region, expirationMs, correlationId, contentType, contentDisposition) => __awaiter(void 0, void 0, void 0, function* () {
47
47
  // WHEN_REQUIRED disables the SDK v3 default request checksum (CRC32). Otherwise the
48
48
  // presigner bakes an empty-body checksum (x-amz-checksum-crc32=AAAAAA==) into the signed
49
49
  // URL, which never matches the real body the browser PUTs — S3 then rejects the upload and
@@ -56,6 +56,9 @@ const generatePresignedUploadUrl = (bucketName, objectKey, region, expirationMs,
56
56
  Bucket: bucketName,
57
57
  Key: objectKey,
58
58
  ContentType: contentType,
59
+ // Signed into the URL: the client's PUT must send the matching Content-Disposition header, and
60
+ // S3 stores it so later GETs serve it back (e.g. 'inline' to preview a PDF instead of downloading).
61
+ ContentDisposition: contentDisposition,
59
62
  Metadata: Object.assign(Object.assign({}, (correlationId && { 'correlation-id': correlationId })), { 'upload-timestamp': Date.now().toString() }),
60
63
  });
61
64
  const url = yield (0, s3_request_presigner_1.getSignedUrl)(s3Client, putObjectCommand, {
@@ -1 +1 @@
1
- {"version":3,"file":"generatePresignedUploadUrl.js","sourceRoot":"","sources":["../../../../src/logic/s3/generatePresignedUploadUrl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgE;AAChE,wEAA6D;AAE7D,oEAAoE;AACpE,wDAAqD;AAErD,wDAAwD;AACxD,wBAAwB;AACxB,uBAAuB;AACvB,oBAAoB;AACpB,0BAA0B;AAC1B,qCAAqC;AACrC,sCAAsC;AACtC,mEAAmE;AACnE,4DAA4D;AAE5D,kCAAkC;AAElC,8CAA8C;AAC9C,uBAAuB;AACvB,6DAA6D;AAC7D,MAAM;AAEN,iDAAiD;AACjD,wBAAwB;AACxB,kEAAkE;AAClE,MAAM;AAEN,gEAAgE;AAChE,0BAA0B;AAC1B,sBAAsB;AACtB,8BAA8B;AAC9B,gDAAgD;AAChD,QAAQ;AAER,aAAa;AACb,8BAA8B;AAC9B,mCAAmC;AACnC,OAAO;AACP,KAAK;AAEE,MAAM,0BAA0B,GAAG,CACxC,UAAkB,EAClB,SAAiB,EACjB,MAAc,EACd,YAAoB,EACpB,aAAsB,EACtB,WAAoB,EACH,EAAE;IACnB,oFAAoF;IACpF,yFAAyF;IACzF,2FAA2F;IAC3F,+FAA+F;IAC/F,MAAM,QAAQ,GAAG,IAAA,iCAAe,EAAC,oBAAQ,EAAE;QACzC,MAAM;QACN,0BAA0B,EAAE,eAAe;KAC5C,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,IAAI,4BAAgB,CAAC;QAC5C,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,SAAS;QACd,WAAW,EAAE,WAAW;QAExB,QAAQ,kCACH,CAAC,aAAa,IAAI,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC,KACzD,kBAAkB,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,GAC1C;KACF,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,IAAA,mCAAY,EAAC,QAAQ,EAAE,gBAAgB,EAAE;QACzD,SAAS,EAAE,YAAY,GAAG,IAAI;KAC/B,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAA,CAAC;AAjCW,QAAA,0BAA0B,8BAiCrC","sourcesContent":["import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';\nimport { getSignedUrl } from '@aws-sdk/s3-request-presigner';\n\n// import { createPresignedPost } from '@aws-sdk/s3-presigned-post';\nimport { createAwsClient } from '../createAwsClient';\n\n// export const generatePresignedUploadFormUrl = async (\n// bucketName: string,\n// objectKey: string,\n// region: string,\n// expirationMs: number,\n// contentType: string | undefined,\n// maxSizeBytes?: number | undefined\n// ): Promise<{ url: string; fields: Record<string, string> }> => {\n// const s3Client = createAwsClient(S3Client, { region });\n\n// const conditions: any[] = [];\n\n// // Add content type condition if provided\n// if (contentType) {\n// conditions.push(['eq', '$Content-Type', contentType]);\n// }\n\n// // Add file size limit condition if provided\n// if (maxSizeBytes) {\n// conditions.push(['content-length-range', 0, maxSizeBytes]);\n// }\n\n// const presignedPost = await createPresignedPost(s3Client, {\n// Bucket: bucketName,\n// Key: objectKey,\n// Conditions: conditions,\n// Expires: Math.floor(expirationMs / 1000),\n// });\n\n// return {\n// url: presignedPost.url,\n// fields: presignedPost.fields\n// };\n// };\n\nexport const generatePresignedUploadUrl = async (\n bucketName: string,\n objectKey: string,\n region: string,\n expirationMs: number,\n correlationId?: string,\n contentType?: string,\n): Promise<string> => {\n // WHEN_REQUIRED disables the SDK v3 default request checksum (CRC32). Otherwise the\n // presigner bakes an empty-body checksum (x-amz-checksum-crc32=AAAAAA==) into the signed\n // URL, which never matches the real body the browser PUTs — S3 then rejects the upload and\n // the failure surfaces in the browser as a CORS error (the error response has no ACAO header).\n const s3Client = createAwsClient(S3Client, {\n region,\n requestChecksumCalculation: 'WHEN_REQUIRED',\n });\n\n const putObjectCommand = new PutObjectCommand({\n Bucket: bucketName,\n Key: objectKey,\n ContentType: contentType,\n\n Metadata: {\n ...(correlationId && { 'correlation-id': correlationId }),\n 'upload-timestamp': Date.now().toString(),\n },\n });\n\n const url = await getSignedUrl(s3Client, putObjectCommand, {\n expiresIn: expirationMs / 1000,\n });\n\n return url;\n};\n"]}
1
+ {"version":3,"file":"generatePresignedUploadUrl.js","sourceRoot":"","sources":["../../../../src/logic/s3/generatePresignedUploadUrl.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAAgE;AAChE,wEAA6D;AAE7D,oEAAoE;AACpE,wDAAqD;AAErD,wDAAwD;AACxD,wBAAwB;AACxB,uBAAuB;AACvB,oBAAoB;AACpB,0BAA0B;AAC1B,qCAAqC;AACrC,sCAAsC;AACtC,mEAAmE;AACnE,4DAA4D;AAE5D,kCAAkC;AAElC,8CAA8C;AAC9C,uBAAuB;AACvB,6DAA6D;AAC7D,MAAM;AAEN,iDAAiD;AACjD,wBAAwB;AACxB,kEAAkE;AAClE,MAAM;AAEN,gEAAgE;AAChE,0BAA0B;AAC1B,sBAAsB;AACtB,8BAA8B;AAC9B,gDAAgD;AAChD,QAAQ;AAER,aAAa;AACb,8BAA8B;AAC9B,mCAAmC;AACnC,OAAO;AACP,KAAK;AAEE,MAAM,0BAA0B,GAAG,CACxC,UAAkB,EAClB,SAAiB,EACjB,MAAc,EACd,YAAoB,EACpB,aAAsB,EACtB,WAAoB,EACpB,kBAA2B,EACV,EAAE;IACnB,oFAAoF;IACpF,yFAAyF;IACzF,2FAA2F;IAC3F,+FAA+F;IAC/F,MAAM,QAAQ,GAAG,IAAA,iCAAe,EAAC,oBAAQ,EAAE;QACzC,MAAM;QACN,0BAA0B,EAAE,eAAe;KAC5C,CAAC,CAAC;IAEH,MAAM,gBAAgB,GAAG,IAAI,4BAAgB,CAAC;QAC5C,MAAM,EAAE,UAAU;QAClB,GAAG,EAAE,SAAS;QACd,WAAW,EAAE,WAAW;QACxB,+FAA+F;QAC/F,oGAAoG;QACpG,kBAAkB,EAAE,kBAAkB;QAEtC,QAAQ,kCACH,CAAC,aAAa,IAAI,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC,KACzD,kBAAkB,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,GAC1C;KACF,CAAC,CAAC;IAEH,MAAM,GAAG,GAAG,MAAM,IAAA,mCAAY,EAAC,QAAQ,EAAE,gBAAgB,EAAE;QACzD,SAAS,EAAE,YAAY,GAAG,IAAI;KAC/B,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAA,CAAC;AArCW,QAAA,0BAA0B,8BAqCrC","sourcesContent":["import { PutObjectCommand, S3Client } from '@aws-sdk/client-s3';\nimport { getSignedUrl } from '@aws-sdk/s3-request-presigner';\n\n// import { createPresignedPost } from '@aws-sdk/s3-presigned-post';\nimport { createAwsClient } from '../createAwsClient';\n\n// export const generatePresignedUploadFormUrl = async (\n// bucketName: string,\n// objectKey: string,\n// region: string,\n// expirationMs: number,\n// contentType: string | undefined,\n// maxSizeBytes?: number | undefined\n// ): Promise<{ url: string; fields: Record<string, string> }> => {\n// const s3Client = createAwsClient(S3Client, { region });\n\n// const conditions: any[] = [];\n\n// // Add content type condition if provided\n// if (contentType) {\n// conditions.push(['eq', '$Content-Type', contentType]);\n// }\n\n// // Add file size limit condition if provided\n// if (maxSizeBytes) {\n// conditions.push(['content-length-range', 0, maxSizeBytes]);\n// }\n\n// const presignedPost = await createPresignedPost(s3Client, {\n// Bucket: bucketName,\n// Key: objectKey,\n// Conditions: conditions,\n// Expires: Math.floor(expirationMs / 1000),\n// });\n\n// return {\n// url: presignedPost.url,\n// fields: presignedPost.fields\n// };\n// };\n\nexport const generatePresignedUploadUrl = async (\n bucketName: string,\n objectKey: string,\n region: string,\n expirationMs: number,\n correlationId?: string,\n contentType?: string,\n contentDisposition?: string,\n): Promise<string> => {\n // WHEN_REQUIRED disables the SDK v3 default request checksum (CRC32). Otherwise the\n // presigner bakes an empty-body checksum (x-amz-checksum-crc32=AAAAAA==) into the signed\n // URL, which never matches the real body the browser PUTs — S3 then rejects the upload and\n // the failure surfaces in the browser as a CORS error (the error response has no ACAO header).\n const s3Client = createAwsClient(S3Client, {\n region,\n requestChecksumCalculation: 'WHEN_REQUIRED',\n });\n\n const putObjectCommand = new PutObjectCommand({\n Bucket: bucketName,\n Key: objectKey,\n ContentType: contentType,\n // Signed into the URL: the client's PUT must send the matching Content-Disposition header, and\n // S3 stores it so later GETs serve it back (e.g. 'inline' to preview a PDF instead of downloading).\n ContentDisposition: contentDisposition,\n\n Metadata: {\n ...(correlationId && { 'correlation-id': correlationId }),\n 'upload-timestamp': Date.now().toString(),\n },\n });\n\n const url = await getSignedUrl(s3Client, putObjectCommand, {\n expiresIn: expirationMs / 1000,\n });\n\n return url;\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import { EmailSendEmailActionPayload } from 'quidproquo-webserver';
2
+ export declare const buildRawMimeMessage: (payload: EmailSendEmailActionPayload, boundarySeed?: string) => string;