quidproquo-actionprocessor-awslambda 0.0.51 → 0.0.52
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/awsLambdaUtils.d.ts +2 -0
- package/lib/awsLambdaUtils.js +8 -1
- package/lib/getActionProcessor/core/config/getConfigGetParameterActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/config/getConfigGetParametersActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/config/getConfigGetSecretActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/config/getConfigGetSecretActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/config/index.d.ts +1 -2
- package/lib/getActionProcessor/core/config/index.js +1 -1
- package/lib/getActionProcessor/core/file/getFileDeleteActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileDeleteActionProcessor.js +8 -8
- package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/getFileReadBinaryContentsActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileReadBinaryContentsActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileWriteBinaryContentsActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.d.ts +1 -2
- package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +5 -6
- package/lib/getActionProcessor/core/file/index.d.ts +1 -2
- package/lib/getActionProcessor/core/file/index.js +1 -1
- package/lib/runtimeConfig/QPQAWSResourceMap.d.ts +0 -5
- package/lib/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.d.ts +4 -4
- package/lib/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js +7 -6
- package/package.json +1 -1
package/lib/awsLambdaUtils.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
1
2
|
export declare const randomGuid: () => string;
|
|
2
3
|
export interface UrlMatch {
|
|
3
4
|
didMatch: boolean;
|
|
4
5
|
params: Record<string, string> | null;
|
|
5
6
|
}
|
|
6
7
|
export declare const matchUrl: (path: string, url: string) => UrlMatch;
|
|
8
|
+
export declare const getRuntimeResourceName: (resourceName: string, qpqConfig: QPQConfig, resourceType?: string) => string;
|
package/lib/awsLambdaUtils.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.matchUrl = exports.randomGuid = void 0;
|
|
3
|
+
exports.getRuntimeResourceName = exports.matchUrl = exports.randomGuid = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
5
|
const node_match_path_1 = require("node-match-path");
|
|
6
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
6
7
|
const randomGuid = () => {
|
|
7
8
|
return (0, crypto_1.randomUUID)();
|
|
8
9
|
};
|
|
@@ -17,3 +18,9 @@ const matchUrl = (path, url) => {
|
|
|
17
18
|
};
|
|
18
19
|
};
|
|
19
20
|
exports.matchUrl = matchUrl;
|
|
21
|
+
const getRuntimeResourceName = (resourceName, qpqConfig, resourceType = '') => {
|
|
22
|
+
const service = quidproquo_core_1.qpqCoreUtils.getAppName(qpqConfig);
|
|
23
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getAppFeature(qpqConfig);
|
|
24
|
+
return `${resourceName}-${service}-${environment}${resourceType}`;
|
|
25
|
+
};
|
|
26
|
+
exports.getRuntimeResourceName = getRuntimeResourceName;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ConfigGetParameterActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/Config/GetParameter": ConfigGetParameterActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,18 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const getParameter_1 = require("../../../logic/parametersManager/getParameter");
|
|
16
|
-
const getProcessConfigGetParameter = (qpqConfig
|
|
15
|
+
const getProcessConfigGetParameter = (qpqConfig) => {
|
|
17
16
|
return ({ parameterName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const awsParameterKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(parameterName,
|
|
19
|
-
const parameterValue = yield (0, getParameter_1.getParameter)(awsParameterKey,
|
|
17
|
+
const awsParameterKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(parameterName, qpqConfig);
|
|
18
|
+
const parameterValue = yield (0, getParameter_1.getParameter)(awsParameterKey, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
19
|
return (0, quidproquo_core_1.actionResult)(parameterValue);
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.default = (qpqConfig
|
|
22
|
+
exports.default = (qpqConfig) => {
|
|
24
23
|
return {
|
|
25
|
-
[quidproquo_core_1.ConfigActionType.GetParameter]: getProcessConfigGetParameter(qpqConfig
|
|
24
|
+
[quidproquo_core_1.ConfigActionType.GetParameter]: getProcessConfigGetParameter(qpqConfig),
|
|
26
25
|
};
|
|
27
26
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ConfigGetParametersActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/Config/GetParameters": ConfigGetParametersActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,18 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const getParameters_1 = require("../../../logic/parametersManager/getParameters");
|
|
16
|
-
const getProcessConfigGetParameters = (qpqConfig
|
|
15
|
+
const getProcessConfigGetParameters = (qpqConfig) => {
|
|
17
16
|
return ({ parameterNames }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const awsParameterKeys = parameterNames.map((pn) => (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(pn,
|
|
19
|
-
const parameterValues = yield (0, getParameters_1.getParameters)(awsParameterKeys,
|
|
17
|
+
const awsParameterKeys = parameterNames.map((pn) => (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(pn, qpqConfig));
|
|
18
|
+
const parameterValues = yield (0, getParameters_1.getParameters)(awsParameterKeys, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
19
|
return (0, quidproquo_core_1.actionResult)(parameterValues);
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.default = (qpqConfig
|
|
22
|
+
exports.default = (qpqConfig) => {
|
|
24
23
|
return {
|
|
25
|
-
[quidproquo_core_1.ConfigActionType.GetParameters]: getProcessConfigGetParameters(qpqConfig
|
|
24
|
+
[quidproquo_core_1.ConfigActionType.GetParameters]: getProcessConfigGetParameters(qpqConfig),
|
|
26
25
|
};
|
|
27
26
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ConfigGetSecretActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/Config/GetSecret": ConfigGetSecretActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,18 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const getSecret_1 = require("../../../logic/secretsManager/getSecret");
|
|
16
|
-
const getProcessConfigActionType = (qpqConfig
|
|
15
|
+
const getProcessConfigActionType = (qpqConfig) => {
|
|
17
16
|
return ({ secretName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const awsSecretKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveSecretKey)(secretName,
|
|
19
|
-
const secretValue = yield (0, getSecret_1.getSecret)(awsSecretKey,
|
|
17
|
+
const awsSecretKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveSecretKey)(secretName, qpqConfig);
|
|
18
|
+
const secretValue = yield (0, getSecret_1.getSecret)(awsSecretKey, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
19
|
return (0, quidproquo_core_1.actionResult)(secretValue);
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.default = (qpqConfig
|
|
22
|
+
exports.default = (qpqConfig) => {
|
|
24
23
|
return {
|
|
25
|
-
[quidproquo_core_1.ConfigActionType.GetSecret]: getProcessConfigActionType(qpqConfig
|
|
24
|
+
[quidproquo_core_1.ConfigActionType.GetSecret]: getProcessConfigActionType(qpqConfig),
|
|
26
25
|
};
|
|
27
26
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/Config/GetSecret": import("quidproquo-core").ConfigGetSecretActionProcessor;
|
|
5
4
|
"@quidproquo-core/Config/GetParameters": import("quidproquo-core").ConfigGetParametersActionProcessor;
|
|
6
5
|
"@quidproquo-core/Config/GetParameter": import("quidproquo-core").ConfigGetParameterActionProcessor;
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const getConfigGetParameterActionProcessor_1 = __importDefault(require("./getConfigGetParameterActionProcessor"));
|
|
7
7
|
const getConfigGetParametersActionProcessor_1 = __importDefault(require("./getConfigGetParametersActionProcessor"));
|
|
8
8
|
const getConfigGetSecretActionProcessor_1 = __importDefault(require("./getConfigGetSecretActionProcessor"));
|
|
9
|
-
exports.default = (qpqConfig
|
|
9
|
+
exports.default = (qpqConfig) => (Object.assign(Object.assign(Object.assign({}, (0, getConfigGetParameterActionProcessor_1.default)(qpqConfig)), (0, getConfigGetParametersActionProcessor_1.default)(qpqConfig)), (0, getConfigGetSecretActionProcessor_1.default)(qpqConfig)));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
-
import { QPQAWSResourceMap } from '../../../runtimeConfig/QPQAWSResourceMap';
|
|
3
2
|
import { FileDeleteActionProcessor } from 'quidproquo-core';
|
|
4
|
-
declare const _default: (qpqConfig: QPQConfig
|
|
3
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
5
4
|
"@quidproquo-core/File/Delete": FileDeleteActionProcessor;
|
|
6
5
|
};
|
|
7
6
|
export default _default;
|
|
@@ -9,14 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
13
|
-
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
|
+
const quidproquo_core_2 = require("quidproquo-core");
|
|
15
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileDelete = (qpqConfig
|
|
16
|
+
const getProcessFileDelete = (qpqConfig) => {
|
|
17
17
|
return ({ drive, filepaths }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
const errored = yield (0, s3Utils_1.deleteFiles)(s3BucketName, filepaths,
|
|
18
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
19
|
+
const errored = yield (0, s3Utils_1.deleteFiles)(s3BucketName, filepaths, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
20
|
// errored deletes are a graceful success ~ Retry
|
|
21
21
|
// if (errored.length > 0) {
|
|
22
22
|
// return actionResultError(
|
|
@@ -24,9 +24,9 @@ const getProcessFileDelete = (qpqConfig, awsResourceMap) => {
|
|
|
24
24
|
// `Could not delete files ${errored.length}`,
|
|
25
25
|
// );
|
|
26
26
|
// }
|
|
27
|
-
return (0,
|
|
27
|
+
return (0, quidproquo_core_2.actionResult)(errored);
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
exports.default = (qpqConfig
|
|
31
|
-
[
|
|
30
|
+
exports.default = (qpqConfig) => ({
|
|
31
|
+
[quidproquo_core_2.FileActionType.Delete]: getProcessFileDelete(qpqConfig),
|
|
32
32
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileExistsActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/Exists": FileExistsActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,15 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileExists = (qpqConfig
|
|
15
|
+
const getProcessFileExists = (qpqConfig) => {
|
|
17
16
|
return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.objectExists)(s3BucketName, filepath,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.objectExists)(s3BucketName, filepath, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig)));
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
|
-
exports.default = (qpqConfig
|
|
23
|
-
[quidproquo_core_1.FileActionType.Exists]: getProcessFileExists(qpqConfig
|
|
21
|
+
exports.default = (qpqConfig) => ({
|
|
22
|
+
[quidproquo_core_1.FileActionType.Exists]: getProcessFileExists(qpqConfig),
|
|
24
23
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileListDirectoryActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/ListDirectory": FileListDirectoryActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,13 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileListDirectory = (qpqConfig
|
|
15
|
+
const getProcessFileListDirectory = (qpqConfig) => {
|
|
17
16
|
return ({ drive, folderPath, maxFiles, pageToken }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
const s3FileList = yield (0, s3Utils_1.listFiles)(s3BucketName,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
const s3FileList = yield (0, s3Utils_1.listFiles)(s3BucketName, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig), folderPath, maxFiles, pageToken);
|
|
20
19
|
// Add the drive onto the list
|
|
21
20
|
const fileInfos = s3FileList.fileInfos.map((s3fi) => (Object.assign(Object.assign({}, s3fi), { drive: drive })));
|
|
22
21
|
return (0, quidproquo_core_1.actionResult)({
|
|
@@ -25,6 +24,6 @@ const getProcessFileListDirectory = (qpqConfig, awsResourceMap) => {
|
|
|
25
24
|
});
|
|
26
25
|
});
|
|
27
26
|
};
|
|
28
|
-
exports.default = (qpqConfig
|
|
29
|
-
[quidproquo_core_1.FileActionType.ListDirectory]: getProcessFileListDirectory(qpqConfig
|
|
27
|
+
exports.default = (qpqConfig) => ({
|
|
28
|
+
[quidproquo_core_1.FileActionType.ListDirectory]: getProcessFileListDirectory(qpqConfig),
|
|
30
29
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileReadBinaryContentsActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/ReadBinaryContents": FileReadBinaryContentsActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,15 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileReadBinaryContents = (qpqConfig
|
|
15
|
+
const getProcessFileReadBinaryContents = (qpqConfig) => {
|
|
17
16
|
return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readBinaryFile)(s3BucketName, filepath,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readBinaryFile)(s3BucketName, filepath, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig)));
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
|
-
exports.default = (qpqConfig
|
|
23
|
-
[quidproquo_core_1.FileActionType.ReadBinaryContents]: getProcessFileReadBinaryContents(qpqConfig
|
|
21
|
+
exports.default = (qpqConfig) => ({
|
|
22
|
+
[quidproquo_core_1.FileActionType.ReadBinaryContents]: getProcessFileReadBinaryContents(qpqConfig),
|
|
24
23
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileReadTextContentsActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/ReadTextContents": FileReadTextContentsActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,15 +10,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileReadTextContents = (qpqConfig
|
|
15
|
+
const getProcessFileReadTextContents = (qpqConfig) => {
|
|
17
16
|
return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readTextFile)(s3BucketName, filepath,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readTextFile)(s3BucketName, filepath, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig)));
|
|
20
19
|
});
|
|
21
20
|
};
|
|
22
|
-
exports.default = (qpqConfig
|
|
23
|
-
[quidproquo_core_1.FileActionType.ReadTextContents]: getProcessFileReadTextContents(qpqConfig
|
|
21
|
+
exports.default = (qpqConfig) => ({
|
|
22
|
+
[quidproquo_core_1.FileActionType.ReadTextContents]: getProcessFileReadTextContents(qpqConfig),
|
|
24
23
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileWriteBinaryContentsActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/WriteBinaryContents": FileWriteBinaryContentsActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,16 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileWriteBinaryContents = (qpqConfig
|
|
15
|
+
const getProcessFileWriteBinaryContents = (qpqConfig) => {
|
|
17
16
|
return ({ drive, filepath, data }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
yield (0, s3Utils_1.writeBinaryFile)(s3BucketName, filepath, data,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
yield (0, s3Utils_1.writeBinaryFile)(s3BucketName, filepath, data, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
19
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.default = (qpqConfig
|
|
24
|
-
[quidproquo_core_1.FileActionType.WriteBinaryContents]: getProcessFileWriteBinaryContents(qpqConfig
|
|
22
|
+
exports.default = (qpqConfig) => ({
|
|
23
|
+
[quidproquo_core_1.FileActionType.WriteBinaryContents]: getProcessFileWriteBinaryContents(qpqConfig),
|
|
25
24
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FileWriteTextContentsActionProcessor, QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/WriteTextContents": FileWriteTextContentsActionProcessor;
|
|
5
4
|
};
|
|
6
5
|
export default _default;
|
|
@@ -10,16 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
-
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
15
14
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
16
|
-
const getProcessFileWriteTextContents = (qpqConfig
|
|
15
|
+
const getProcessFileWriteTextContents = (qpqConfig) => {
|
|
17
16
|
return ({ drive, filepath, data }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive,
|
|
19
|
-
yield (0, s3Utils_1.writeTextFile)(s3BucketName, filepath, data,
|
|
17
|
+
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, qpqConfig);
|
|
18
|
+
yield (0, s3Utils_1.writeTextFile)(s3BucketName, filepath, data, quidproquo_core_1.qpqCoreUtils.getDeployRegion(qpqConfig));
|
|
20
19
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
21
20
|
});
|
|
22
21
|
};
|
|
23
|
-
exports.default = (qpqConfig
|
|
24
|
-
[quidproquo_core_1.FileActionType.WriteTextContents]: getProcessFileWriteTextContents(qpqConfig
|
|
22
|
+
exports.default = (qpqConfig) => ({
|
|
23
|
+
[quidproquo_core_1.FileActionType.WriteTextContents]: getProcessFileWriteTextContents(qpqConfig),
|
|
25
24
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
-
|
|
3
|
-
declare const _default: (qpqConfig: QPQConfig, awsResourceMap: QPQAWSResourceMap) => {
|
|
2
|
+
declare const _default: (qpqConfig: QPQConfig) => {
|
|
4
3
|
"@quidproquo-core/File/WriteBinaryContents": import("quidproquo-core").FileWriteBinaryContentsActionProcessor;
|
|
5
4
|
"@quidproquo-core/File/ReadBinaryContents": import("quidproquo-core").FileReadBinaryContentsActionProcessor;
|
|
6
5
|
"@quidproquo-core/File/WriteTextContents": import("quidproquo-core").FileWriteTextContentsActionProcessor;
|
|
@@ -10,4 +10,4 @@ const getFileReadTextContentsActionProcessor_1 = __importDefault(require("./getF
|
|
|
10
10
|
const getFileWriteTextContentsActionProcessor_1 = __importDefault(require("./getFileWriteTextContentsActionProcessor"));
|
|
11
11
|
const getFileReadBinaryContentsActionProcessor_1 = __importDefault(require("./getFileReadBinaryContentsActionProcessor"));
|
|
12
12
|
const getFileWriteBinaryContentsActionProcessor_1 = __importDefault(require("./getFileWriteBinaryContentsActionProcessor"));
|
|
13
|
-
exports.default = (qpqConfig
|
|
13
|
+
exports.default = (qpqConfig) => (Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (0, getFileDeleteActionProcessor_1.default)(qpqConfig)), (0, getFileExistsActionProcessor_1.default)(qpqConfig)), (0, getFileListDirectoryActionProcessor_1.default)(qpqConfig)), (0, getFileReadTextContentsActionProcessor_1.default)(qpqConfig)), (0, getFileWriteTextContentsActionProcessor_1.default)(qpqConfig)), (0, getFileReadBinaryContentsActionProcessor_1.default)(qpqConfig)), (0, getFileWriteBinaryContentsActionProcessor_1.default)(qpqConfig)));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const resolveResourceName: (resourceName: string,
|
|
3
|
-
export declare const resolveSecretKey: (secretName: string,
|
|
4
|
-
export declare const resolveParameterKey: (parameterName: string,
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
+
export declare const resolveResourceName: (resourceName: string, qpqConfig: QPQConfig) => string;
|
|
3
|
+
export declare const resolveSecretKey: (secretName: string, qpqConfig: QPQConfig) => string;
|
|
4
|
+
export declare const resolveParameterKey: (parameterName: string, qpqConfig: QPQConfig) => string;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveParameterKey = exports.resolveSecretKey = exports.resolveResourceName = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const awsLambdaUtils_1 = require("../awsLambdaUtils");
|
|
5
|
+
const resolveResourceName = (resourceName, qpqConfig) => {
|
|
6
|
+
return (0, awsLambdaUtils_1.getRuntimeResourceName)(resourceName, qpqConfig);
|
|
6
7
|
};
|
|
7
8
|
exports.resolveResourceName = resolveResourceName;
|
|
8
|
-
const resolveSecretKey = (secretName,
|
|
9
|
-
return
|
|
9
|
+
const resolveSecretKey = (secretName, qpqConfig) => {
|
|
10
|
+
return (0, awsLambdaUtils_1.getRuntimeResourceName)(secretName, qpqConfig);
|
|
10
11
|
};
|
|
11
12
|
exports.resolveSecretKey = resolveSecretKey;
|
|
12
|
-
const resolveParameterKey = (parameterName,
|
|
13
|
-
return
|
|
13
|
+
const resolveParameterKey = (parameterName, qpqConfig) => {
|
|
14
|
+
return (0, awsLambdaUtils_1.getRuntimeResourceName)(parameterName, qpqConfig);
|
|
14
15
|
};
|
|
15
16
|
exports.resolveParameterKey = resolveParameterKey;
|