quidproquo-actionprocessor-awslambda 0.0.233 → 0.0.235
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.
- package/lib/commonjs/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/config/getConfigGetSecretActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/event/utils/isAuthValid.js +3 -2
- package/lib/commonjs/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/file/getFileDeleteActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/file/getFileExistsActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileGenerateTemporarySecureUrlActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.d.ts +2 -0
- package/lib/commonjs/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js +29 -0
- package/lib/commonjs/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileReadBinaryContentsActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.js +10 -2
- package/lib/commonjs/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/file/index.js +2 -1
- package/lib/commonjs/getActionProcessor/core/graphDatabase/customActions/getActionProcessor/getGraphDatabaseForNeptuneGetEndpointsActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreGetActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/keyValueStore/getKeyValueStoreUpsertActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js +4 -4
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryAuthenticateUserActionProcessor.js +3 -2
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryChangePasswordActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryConfirmEmailVerificationActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryConfirmForgotPasswordActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryCreateUserActionProcessor.js +3 -2
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryDecodeAccessTokenActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryForgotPasswordActionProcessor.js +3 -2
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js +3 -2
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRequestEmailVerificationActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/webserver/serviceFunction/getServiceFunctionExecuteActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/webserver/webEntry/getWebEntryInvalidateCacheActionProcessor.js +2 -1
- package/lib/commonjs/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +2 -1
- package/lib/commonjs/logic/cognito/decodeAccessToken.js +2 -2
- package/lib/commonjs/logic/s3/getObjectStorageClass.d.ts +1 -0
- package/lib/commonjs/logic/s3/getObjectStorageClass.js +39 -0
- package/lib/esm/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/config/getConfigGetSecretActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/config/getConfigSetParameterActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/event/utils/isAuthValid.js +3 -2
- package/lib/esm/getActionProcessor/core/eventBus/getEventBusSendMessagesActionProcessor.js +3 -3
- package/lib/esm/getActionProcessor/core/file/getFileDeleteActionProcessor.js +2 -2
- package/lib/esm/getActionProcessor/core/file/getFileExistsActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporarySecureUrlActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.d.ts +2 -0
- package/lib/esm/getActionProcessor/core/file/getFileIsColdStorageActionProcessor.js +14 -0
- package/lib/esm/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/getFileReadBinaryContentsActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.js +11 -3
- package/lib/esm/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/file/index.js +2 -0
- package/lib/esm/getActionProcessor/core/graphDatabase/customActions/getActionProcessor/getGraphDatabaseForNeptuneGetEndpointsActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreDeleteActionProcessor.js +2 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreGetActionProcessor.js +2 -2
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreGetAllActionProcessor.js +2 -2
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreQueryActionProcessor.js +2 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreScanActionProcessor.js +2 -2
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpdateActionProcessor.js +2 -1
- package/lib/esm/getActionProcessor/core/keyValueStore/getKeyValueStoreUpsertActionProcessor.js +2 -1
- package/lib/esm/getActionProcessor/core/queue/getQueueSendMessageActionProcessor.js +2 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryAuthenticateUserActionProcessor.js +4 -3
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryChangePasswordActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryConfirmEmailVerificationActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryConfirmForgotPasswordActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryCreateUserActionProcessor.js +4 -3
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryDecodeAccessTokenActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryForgotPasswordActionProcessor.js +4 -3
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUserAttributesByUserIdActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryGetUsersByAttributeActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRefreshTokenActionProcessor.js +4 -3
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRequestEmailVerificationActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryRespondToAuthChallengeActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetPasswordActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectorySetUserAttributesActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/webserver/serviceFunction/getServiceFunctionExecuteActionProcessor.js +2 -1
- package/lib/esm/getActionProcessor/webserver/webEntry/getWebEntryInvalidateCacheActionProcessor.js +3 -2
- package/lib/esm/getActionProcessor/webserver/websocket/getWebsocketSendMessageActionProcessor.js +3 -2
- package/lib/esm/logic/cognito/decodeAccessToken.js +2 -2
- package/lib/esm/logic/s3/getObjectStorageClass.d.ts +1 -0
- package/lib/esm/logic/s3/getObjectStorageClass.js +26 -0
- package/package.json +5 -5
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryConfirmForgotPasswordActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const confirmForgotPassword_1 = require("../../../logic/cognito/confirmForgotPassword");
|
|
17
18
|
const getProcessConfirmForgotPassword = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, code, username, password }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
22
23
|
const authResponse = yield (0, confirmForgotPassword_1.confirmForgotPassword)(userPoolId, userPoolClientId, region, code, username, password);
|
|
@@ -10,16 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryCreateUserActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const createUser_1 = require("../../../logic/cognito/createUser");
|
|
17
18
|
const getProcessCreateUser = (qpqConfig) => {
|
|
18
19
|
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(payload.userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(payload.userDirectoryName, qpqConfig), region);
|
|
22
|
-
const authResponse = yield (0, createUser_1.createUser)(userPoolId,
|
|
23
|
+
const authResponse = yield (0, createUser_1.createUser)(userPoolId, quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), userPoolClientId, payload.createUserRequest);
|
|
23
24
|
return (0, quidproquo_core_1.actionResult)(authResponse);
|
|
24
25
|
});
|
|
25
26
|
};
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryDecodeAccessTokenActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const decodeValidJwt_1 = require("../../../logic/cognito/decodeValidJwt");
|
|
17
18
|
const getProcessDecodeAccessToken = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, accessToken, ignoreExpiration }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const authInfo = yield (0, decodeValidJwt_1.decodeValidJwt)(userPoolId, region, ignoreExpiration, accessToken);
|
|
22
23
|
if (!authInfo || !(authInfo === null || authInfo === void 0 ? void 0 : authInfo.username)) {
|
|
@@ -10,16 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryForgotPasswordActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const forgotPassword_1 = require("../../../logic/cognito/forgotPassword");
|
|
17
18
|
const getProcessForgotPassword = (qpqConfig) => {
|
|
18
19
|
return ({ username, userDirectoryName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
22
|
-
const authResponse = yield (0, forgotPassword_1.forgotPassword)(userPoolId, userPoolClientId,
|
|
23
|
+
const authResponse = yield (0, forgotPassword_1.forgotPassword)(userPoolId, userPoolClientId, quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), username);
|
|
23
24
|
return (0, quidproquo_core_1.actionResult)(authResponse);
|
|
24
25
|
});
|
|
25
26
|
};
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryGetUserAttributesActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const getUserAttributes_1 = require("../../../logic/cognito/getUserAttributes");
|
|
17
18
|
const getProcessGetUserAttributes = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, username }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
try {
|
|
22
23
|
const userAttributes = yield (0, getUserAttributes_1.getUserAttributes)(userPoolId, region, username);
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryGetUserAttributesByUserIdActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const getUserAttributesBySub_1 = require("../../../logic/cognito/getUserAttributesBySub");
|
|
17
18
|
const getProcessGetUserAttributesByUserId = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, userId }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userAttributes = yield (0, getUserAttributesBySub_1.getUserAttributesBySub)(userPoolId, region, userId);
|
|
22
23
|
return (0, quidproquo_core_1.actionResult)(userAttributes);
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryGetUsersActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const listPagedUsers_1 = require("../../../logic/cognito/listPagedUsers");
|
|
17
18
|
const getProcessGetUsers = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, nextPageKey }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userAttributes = yield (0, listPagedUsers_1.listPagedUsers)(userPoolId, region, nextPageKey);
|
|
22
23
|
return (0, quidproquo_core_1.actionResult)(userAttributes);
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryGetUsersByAttributeActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const listPagedUsersByAttribute_1 = require("../../../logic/cognito/listPagedUsersByAttribute");
|
|
17
18
|
const getProcessGetUsersByAttribute = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, attribueName, attribueValue, limit, nextPageKey }, _session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userAttributes = yield (0, listPagedUsersByAttribute_1.listPagedUsersByAttribute)(userPoolId, region, attribueName, attribueValue, limit, nextPageKey);
|
|
22
23
|
return (0, quidproquo_core_1.actionResult)(userAttributes);
|
|
@@ -10,19 +10,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryRefreshTokenActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const refreshToken_1 = require("../../../logic/cognito/refreshToken");
|
|
17
18
|
const getProcessRefreshToken = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, refreshToken }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
22
23
|
if (!session.decodedAccessToken || !session.decodedAccessToken.username) {
|
|
23
24
|
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.Unauthorized, 'Invalid accessToken');
|
|
24
25
|
}
|
|
25
|
-
const authResponse = yield (0, refreshToken_1.refreshToken)(userPoolId, userPoolClientId,
|
|
26
|
+
const authResponse = yield (0, refreshToken_1.refreshToken)(userPoolId, userPoolClientId, quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), session.decodedAccessToken.username, refreshToken);
|
|
26
27
|
return (0, quidproquo_core_1.actionResult)(authResponse);
|
|
27
28
|
});
|
|
28
29
|
};
|
|
@@ -10,11 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryRequestEmailVerificationActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const requestEmailVerificationCode_1 = require("../../../logic/cognito/requestEmailVerificationCode");
|
|
15
16
|
const getProcessRequestEmailVerification = (qpqConfig) => {
|
|
16
17
|
return ({ userDirectoryName, accessToken }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
const region =
|
|
18
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
18
19
|
yield (0, requestEmailVerificationCode_1.requestEmailVerificationCode)(region, accessToken);
|
|
19
20
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
20
21
|
});
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectoryRespondToAuthChallengeActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
|
|
15
16
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
@@ -41,7 +42,7 @@ const anyAuthChallengeToCognitoChallengeName = (authChallenge) => {
|
|
|
41
42
|
};
|
|
42
43
|
const getProcessRespondToAuthChallenge = (qpqConfig) => {
|
|
43
44
|
return ({ userDirectoryName, authChallenge }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
const region =
|
|
45
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
45
46
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
46
47
|
const userPoolClientId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolClientIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
47
48
|
const response = yield (0, respondToAuthChallengeChallenge_1.respondToAuthChallengeChallenge)(userPoolId, userPoolClientId, region, authChallenge.username, authChallenge.session, anyAuthChallengeToCognitoChallengeName(authChallenge), anyAuthChallengeToCognitoAttributes(authChallenge));
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectorySetPasswordActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const setUserPassword_1 = require("../../../logic/cognito/setUserPassword");
|
|
17
18
|
const getProcessSetPassword = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, newPassword, username }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
yield (0, setUserPassword_1.setUserPassword)(region, userPoolId, username, newPassword);
|
|
22
23
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserDirectorySetUserAttributesActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
15
16
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
16
17
|
const setUserAttributes_1 = require("../../../logic/cognito/setUserAttributes");
|
|
17
18
|
const getProcessSetUserAttributes = (qpqConfig) => {
|
|
18
19
|
return ({ userDirectoryName, username, userAttributes }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
21
22
|
yield (0, setUserAttributes_1.setUserAttributes)(userPoolId, region, username, userAttributes);
|
|
22
23
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
@@ -10,13 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getServiceFunctionExecuteActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
15
16
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
16
17
|
const executeLambdaByName_1 = require("../../../logic/lambda/executeLambdaByName");
|
|
17
18
|
const getProcessExecute = (qpqConfig) => {
|
|
18
19
|
return ({ functionName, service, payload, context, isAsync }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
const region =
|
|
20
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
20
21
|
const appName = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
21
22
|
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
22
23
|
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getWebEntryInvalidateCacheActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
15
16
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
@@ -17,7 +18,7 @@ const getExportedValue_1 = require("../../../logic/cloudformation/getExportedVal
|
|
|
17
18
|
const invalidateCache_1 = require("../../../logic/cloudFront/invalidateCache");
|
|
18
19
|
const getProcessInvalidateCache = (qpqConfig) => {
|
|
19
20
|
return ({ paths, webEntryName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const region =
|
|
21
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
21
22
|
const distributionId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameDistributionIdArnFromConfig)(webEntryName, qpqConfig), region);
|
|
22
23
|
yield (0, invalidateCache_1.invalidateCache)(distributionId, region, paths);
|
|
23
24
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getWebsocketSendMessageActionProcessor = void 0;
|
|
13
|
+
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
15
16
|
const awsNamingUtils_1 = require("../../../awsNamingUtils");
|
|
@@ -17,7 +18,7 @@ const websocketSendMessage_1 = require("../../../logic/apiGateway/websocketSendM
|
|
|
17
18
|
const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
|
|
18
19
|
const getProcessSendMessage = (qpqConfig) => {
|
|
19
20
|
return ({ connectionId, payload, websocketApiName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const region =
|
|
21
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
21
22
|
const apiId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameWebsocketApiIdFromConfig)(websocketApiName, qpqConfig), region);
|
|
22
23
|
try {
|
|
23
24
|
yield (0, websocketSendMessage_1.sendMessageToWebSocketConnection)(apiId, connectionId, region, payload);
|
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.decodeAccessToken = void 0;
|
|
13
|
-
const
|
|
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
17
|
const decodeAccessToken = (userDirectoryName, qpqConfig, accessToken, ignoreExpiration = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const region =
|
|
18
|
+
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
19
19
|
const userPoolId = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameUserPoolIdFromConfig)(userDirectoryName, qpqConfig), region);
|
|
20
20
|
const decodedAuthToken = yield (0, decodeValidJwt_1.decodeValidJwt)(userPoolId, region, ignoreExpiration, accessToken);
|
|
21
21
|
if (!decodedAuthToken || !(decodedAuthToken === null || decodedAuthToken === void 0 ? void 0 : decodedAuthToken.username)) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getObjectStorageClass: (bucketName: string, key: string, region: string) => Promise<'cold_storage' | 'standard'>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.getObjectStorageClass = void 0;
|
|
13
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
14
|
+
const createAwsClient_1 = require("../createAwsClient");
|
|
15
|
+
const getObjectStorageClass = (bucketName, key, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const s3Client = (0, createAwsClient_1.createAwsClient)(client_s3_1.S3Client, { region });
|
|
17
|
+
const response = yield s3Client.send(new client_s3_1.HeadObjectCommand({
|
|
18
|
+
Key: key,
|
|
19
|
+
Bucket: bucketName,
|
|
20
|
+
}));
|
|
21
|
+
// Map AWS StorageClass to our custom labels
|
|
22
|
+
switch (response.StorageClass) {
|
|
23
|
+
case 'GLACIER':
|
|
24
|
+
case 'GLACIER_IR':
|
|
25
|
+
case 'DEEP_ARCHIVE':
|
|
26
|
+
case 'ONEZONE_IA':
|
|
27
|
+
case 'EXPRESS_ONEZONE':
|
|
28
|
+
case 'OUTPOSTS':
|
|
29
|
+
case 'SNOW':
|
|
30
|
+
return 'cold_storage';
|
|
31
|
+
case 'STANDARD_IA':
|
|
32
|
+
case 'STANDARD':
|
|
33
|
+
case 'INTELLIGENT_TIERING':
|
|
34
|
+
case 'REDUCED_REDUNDANCY':
|
|
35
|
+
default:
|
|
36
|
+
return 'standard';
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
exports.getObjectStorageClass = getObjectStorageClass;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, ConfigActionType, ConfigGetParameterErrorTypeEnum, } from 'quidproquo-core';
|
|
2
3
|
import { getParameter } from '../../../logic/parametersManager/getParameter';
|
|
3
4
|
import { resolveParameterKey } from '../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils';
|
|
4
5
|
const getProcessConfigGetParameter = (qpqConfig) => {
|
|
5
6
|
return async ({ parameterName }) => {
|
|
6
7
|
const awsParameterKey = resolveParameterKey(parameterName, qpqConfig);
|
|
7
8
|
try {
|
|
8
|
-
const parameterValue = await getParameter(awsParameterKey,
|
|
9
|
+
const parameterValue = await getParameter(awsParameterKey, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig));
|
|
9
10
|
return actionResult(parameterValue);
|
|
10
11
|
}
|
|
11
12
|
catch (error) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, ConfigActionType, ConfigGetParametersErrorTypeEnum, } from 'quidproquo-core';
|
|
2
3
|
import { getParameters } from '../../../logic/parametersManager/getParameters';
|
|
3
4
|
import { resolveParameterKey } from '../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils';
|
|
4
5
|
const getProcessConfigGetParameters = (qpqConfig) => {
|
|
5
6
|
return async ({ parameterNames }) => {
|
|
6
7
|
const awsParameterKeys = parameterNames.map((pn) => resolveParameterKey(pn, qpqConfig));
|
|
7
8
|
try {
|
|
8
|
-
const parameterValues = await getParameters(awsParameterKeys,
|
|
9
|
+
const parameterValues = await getParameters(awsParameterKeys, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig));
|
|
9
10
|
return actionResult(parameterValues);
|
|
10
11
|
}
|
|
11
12
|
catch (error) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, ConfigActionType, } from 'quidproquo-core';
|
|
2
3
|
import { getSecret } from '../../../logic/secretsManager/getSecret';
|
|
3
4
|
import { resolveSecretResourceName } from './utils';
|
|
4
5
|
const getProcessConfigGetSecret = (qpqConfig) => {
|
|
5
6
|
return async ({ secretName }) => {
|
|
6
7
|
const awsSecretKey = resolveSecretResourceName(secretName, qpqConfig);
|
|
7
|
-
const secretValue = await getSecret(awsSecretKey,
|
|
8
|
+
const secretValue = await getSecret(awsSecretKey, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig));
|
|
8
9
|
return actionResult(secretValue);
|
|
9
10
|
};
|
|
10
11
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, ConfigActionType, } from 'quidproquo-core';
|
|
2
3
|
import { setParameter } from '../../../logic/parametersManager/setParameter';
|
|
3
4
|
import { resolveParameterKey } from '../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils';
|
|
4
5
|
const getProcessConfigSetParameter = (qpqConfig) => {
|
|
5
6
|
return async ({ parameterName, parameterValue }) => {
|
|
6
7
|
const awsParameterKey = resolveParameterKey(parameterName, qpqConfig);
|
|
7
|
-
await setParameter(awsParameterKey,
|
|
8
|
+
await setParameter(awsParameterKey, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), parameterValue);
|
|
8
9
|
return actionResult(void 0);
|
|
9
10
|
};
|
|
10
11
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
1
2
|
import { qpqCoreUtils } from 'quidproquo-core';
|
|
2
3
|
import { getCFExportNameUserPoolIdFromConfig, getConfigRuntimeResourceName } from '../../../../awsNamingUtils';
|
|
3
4
|
import { getApiKeys } from '../../../../logic/apiGateway/getApiKeys';
|
|
@@ -19,7 +20,7 @@ const isAuthValidForCognito = async (qpqConfig, authSettings, authHeader) => {
|
|
|
19
20
|
}
|
|
20
21
|
// Grab the user directory to auth against
|
|
21
22
|
const userDirectoryName = authSettings.userDirectoryName;
|
|
22
|
-
const region =
|
|
23
|
+
const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
23
24
|
// Resolve the user pool id
|
|
24
25
|
const userPoolId = await getExportedValue(getCFExportNameUserPoolIdFromConfig(userDirectoryName, qpqConfig), region);
|
|
25
26
|
// Verify the token
|
|
@@ -30,7 +31,7 @@ const isAuthValidForApiKeys = async (qpqConfig, authSettings, apiKeyHeader) => {
|
|
|
30
31
|
if (apiKeys.length === 0) {
|
|
31
32
|
return true;
|
|
32
33
|
}
|
|
33
|
-
const region =
|
|
34
|
+
const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
34
35
|
const application = qpqCoreUtils.getApplicationName(qpqConfig);
|
|
35
36
|
const service = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
36
37
|
const environment = qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { actionResult, EventBusActionType } from 'quidproquo-core';
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, actionResultError, ErrorTypeEnum, EventBusActionType, qpqCoreUtils, } from 'quidproquo-core';
|
|
3
3
|
import { getEventBusSnsTopicArn } from '../../../awsNamingUtils';
|
|
4
4
|
import { publishMessage } from '../../../logic/sns/publishMessage';
|
|
5
5
|
const getProcessEventBusSendMessage = (qpqConfig) => {
|
|
6
6
|
return async ({ eventBusName, eventBusMessages, context, }, session) => {
|
|
7
|
-
const region =
|
|
7
|
+
const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
8
8
|
const eventBusConfig = qpqCoreUtils.getEventBusConfigByName(eventBusName, qpqConfig);
|
|
9
9
|
if (!eventBusConfig) {
|
|
10
10
|
return actionResultError(ErrorTypeEnum.NotFound, `Event bus ${eventBusName} not found`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
2
|
import { actionResult, FileActionType } from 'quidproquo-core';
|
|
3
3
|
import { deleteFiles } from '../../../logic/s3/s3Utils';
|
|
4
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
5
5
|
const getProcessFileDelete = (qpqConfig) => {
|
|
6
6
|
return async ({ drive, filepaths }) => {
|
|
7
7
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
8
|
-
const errored = await deleteFiles(s3BucketName, filepaths,
|
|
8
|
+
const errored = await deleteFiles(s3BucketName, filepaths, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig));
|
|
9
9
|
// errored deletes are a graceful success ~ Retry
|
|
10
10
|
// if (errored.length > 0) {
|
|
11
11
|
// return actionResultError(
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, FileActionType, } from 'quidproquo-core';
|
|
2
3
|
import { objectExists } from '../../../logic/s3/s3Utils';
|
|
3
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
4
5
|
const getProcessFileExists = (qpqConfig) => {
|
|
5
6
|
return async ({ drive, filepath }) => {
|
|
6
7
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
7
|
-
return actionResult(await objectExists(s3BucketName, filepath,
|
|
8
|
+
return actionResult(await objectExists(s3BucketName, filepath, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig)));
|
|
8
9
|
};
|
|
9
10
|
};
|
|
10
11
|
export const getFileExistsActionProcessor = async (qpqConfig) => ({
|
package/lib/esm/getActionProcessor/core/file/getFileGenerateTemporarySecureUrlActionProcessor.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResultError, ErrorTypeEnum } from 'quidproquo-core';
|
|
2
3
|
import { actionResult, FileActionType } from 'quidproquo-core';
|
|
3
4
|
import { generatePresignedUrl } from '../../../logic/s3/generatePresignedUrl';
|
|
4
5
|
import { resolveStorageDriveBucketName } from './utils';
|
|
@@ -6,7 +7,7 @@ const getProcessFileGenerateTemporarySecureUrl = (qpqConfig) => {
|
|
|
6
7
|
return async ({ drive, filepath, expirationMs }) => {
|
|
7
8
|
try {
|
|
8
9
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
9
|
-
const url = await generatePresignedUrl(s3BucketName, filepath,
|
|
10
|
+
const url = await generatePresignedUrl(s3BucketName, filepath, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), expirationMs);
|
|
10
11
|
return actionResult(url);
|
|
11
12
|
}
|
|
12
13
|
catch (error) {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, FileActionType, } from 'quidproquo-core';
|
|
3
|
+
import { getObjectStorageClass } from '../../../logic/s3/getObjectStorageClass';
|
|
4
|
+
import { resolveStorageDriveBucketName } from './utils';
|
|
5
|
+
const getProcessFileIsColdStorage = (qpqConfig) => {
|
|
6
|
+
return async ({ drive, filepath }) => {
|
|
7
|
+
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
8
|
+
const isColdStorage = (await getObjectStorageClass(s3BucketName, filepath, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig))) === 'cold_storage';
|
|
9
|
+
return actionResult(isColdStorage);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export const getFileIsColdStorageActionProcessor = async (qpqConfig) => ({
|
|
13
|
+
[FileActionType.IsColdStorage]: getProcessFileIsColdStorage(qpqConfig),
|
|
14
|
+
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, FileActionType, } from 'quidproquo-core';
|
|
2
3
|
import { listFiles } from '../../../logic/s3/s3Utils';
|
|
3
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
4
5
|
const getProcessFileListDirectory = (qpqConfig) => {
|
|
5
6
|
return async ({ drive, folderPath, maxFiles, pageToken }) => {
|
|
6
7
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
7
|
-
const s3FileList = await listFiles(s3BucketName,
|
|
8
|
+
const s3FileList = await listFiles(s3BucketName, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), folderPath, maxFiles, pageToken);
|
|
8
9
|
// Add the drive onto the list
|
|
9
10
|
const fileInfos = s3FileList.fileInfos.map((s3fi) => ({
|
|
10
11
|
...s3fi,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, FileActionType, } from 'quidproquo-core';
|
|
2
3
|
import { readBinaryFile } from '../../../logic/s3/s3Utils';
|
|
3
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
4
5
|
const getProcessFileReadBinaryContents = (qpqConfig) => {
|
|
5
6
|
return async ({ drive, filepath }) => {
|
|
6
7
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
7
|
-
return actionResult(await readBinaryFile(s3BucketName, filepath,
|
|
8
|
+
return actionResult(await readBinaryFile(s3BucketName, filepath, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig)));
|
|
8
9
|
};
|
|
9
10
|
};
|
|
10
11
|
export const getFileReadBinaryContentsActionProcessor = async (qpqConfig) => ({
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, FileActionType, FileReadTextContentsErrorTypeEnum, } from 'quidproquo-core';
|
|
2
3
|
import { readTextFile } from '../../../logic/s3/s3Utils';
|
|
3
4
|
import { resolveStorageDriveBucketName } from './utils';
|
|
4
5
|
const getProcessFileReadTextContents = (qpqConfig) => {
|
|
5
6
|
return async ({ drive, filepath }) => {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
try {
|
|
8
|
+
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
9
|
+
return actionResult(await readTextFile(s3BucketName, filepath, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig)));
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
return actionResultErrorFromCaughtError(error, {
|
|
13
|
+
InvalidObjectState: () => actionResultError(FileReadTextContentsErrorTypeEnum.InvalidStorageClass, 'File is in the wrong storage class'),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
8
16
|
};
|
|
9
17
|
};
|
|
10
18
|
export const getFileReadTextContentsActionProcessor = async (qpqConfig) => ({
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
2
|
+
import { actionResult, FileActionType, } from 'quidproquo-core';
|
|
2
3
|
import { getS3BucketStorageClassFromStorageDriveTier } from '../../../awsLambdaUtils';
|
|
3
4
|
import { writeBinaryFile } from '../../../logic/s3/s3Utils';
|
|
4
5
|
import { resolveStorageDriveBucketName } from './utils';
|
|
5
6
|
const getProcessFileWriteBinaryContents = (qpqConfig) => {
|
|
6
7
|
return async ({ drive, filepath, data, storageDriveAdvancedWriteOptions }) => {
|
|
7
8
|
const s3BucketName = resolveStorageDriveBucketName(drive, qpqConfig);
|
|
8
|
-
await writeBinaryFile(s3BucketName, filepath, data,
|
|
9
|
+
await writeBinaryFile(s3BucketName, filepath, data, qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig), getS3BucketStorageClassFromStorageDriveTier(storageDriveAdvancedWriteOptions?.storageDriveTier));
|
|
9
10
|
return actionResult(void 0);
|
|
10
11
|
};
|
|
11
12
|
};
|