quidproquo-actionprocessor-awslambda 0.0.43 → 0.0.45
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/getActionProcessor/core/config/getConfigGetParameterActionProcessor.js +2 -1
- package/lib/getActionProcessor/core/config/getConfigGetParametersActionProcessor.js +2 -1
- package/lib/getActionProcessor/core/config/getConfigGetSecretActionProcessor.js +2 -1
- package/lib/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.js +4 -7
- package/lib/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.d.ts +10 -0
- package/lib/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.js +77 -0
- package/lib/getActionProcessor/core/event/getEventBridgeEventActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/event/getEventBridgeEventActionProcessor.js +0 -2
- package/lib/getActionProcessor/core/file/getFileDeleteActionProcessor.js +2 -1
- package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/file/getFileExistsActionProcessor.js +3 -2
- package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/file/getFileListDirectoryActionProcessor.js +3 -2
- package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.js +3 -2
- package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.d.ts +1 -1
- package/lib/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.js +3 -2
- package/lib/getActionProcessor/core/index.d.ts +1 -0
- package/lib/getActionProcessor/core/index.js +3 -1
- package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +1 -4
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/logic/parametersManager/getParameter.d.ts +1 -1
- package/lib/logic/parametersManager/getParameter.js +4 -2
- package/lib/logic/parametersManager/getParameters.d.ts +1 -1
- package/lib/logic/parametersManager/getParameters.js +2 -2
- package/lib/logic/s3/deleteFiles.d.ts +1 -1
- package/lib/logic/s3/deleteFiles.js +4 -6
- package/lib/logic/s3/listFiles.d.ts +1 -1
- package/lib/logic/s3/listFiles.js +4 -6
- package/lib/logic/s3/objectExists.d.ts +1 -1
- package/lib/logic/s3/objectExists.js +4 -6
- package/lib/logic/s3/readTextFile.d.ts +1 -1
- package/lib/logic/s3/readTextFile.js +3 -6
- package/lib/logic/s3/writeTextFile.d.ts +1 -1
- package/lib/logic/s3/writeTextFile.js +3 -6
- package/lib/logic/secretsManager/getSecret.d.ts +1 -1
- package/lib/logic/secretsManager/getSecret.js +4 -2
- package/package.json +2 -2
- package/lib/logic/s3/s3Client.d.ts +0 -3
- package/lib/logic/s3/s3Client.js +0 -5
|
@@ -10,12 +10,13 @@ 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");
|
|
13
14
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const getParameter_1 = require("../../../logic/parametersManager/getParameter");
|
|
15
16
|
const getProcessConfigGetParameter = (runtimeConfig) => {
|
|
16
17
|
return ({ parameterName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const awsParameterKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(parameterName, runtimeConfig);
|
|
18
|
-
const parameterValue = yield (0, getParameter_1.getParameter)(awsParameterKey);
|
|
19
|
+
const parameterValue = yield (0, getParameter_1.getParameter)(awsParameterKey, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig));
|
|
19
20
|
return (0, quidproquo_core_1.actionResult)(parameterValue);
|
|
20
21
|
});
|
|
21
22
|
};
|
|
@@ -10,12 +10,13 @@ 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");
|
|
13
14
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const getParameters_1 = require("../../../logic/parametersManager/getParameters");
|
|
15
16
|
const getProcessConfigGetParameters = (runtimeConfig) => {
|
|
16
17
|
return ({ parameterNames }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const awsParameterKeys = parameterNames.map((pn) => (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveParameterKey)(pn, runtimeConfig));
|
|
18
|
-
const parameterValues = yield (0, getParameters_1.getParameters)(awsParameterKeys);
|
|
19
|
+
const parameterValues = yield (0, getParameters_1.getParameters)(awsParameterKeys, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig));
|
|
19
20
|
return (0, quidproquo_core_1.actionResult)(parameterValues);
|
|
20
21
|
});
|
|
21
22
|
};
|
|
@@ -10,12 +10,13 @@ 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");
|
|
13
14
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const getSecret_1 = require("../../../logic/secretsManager/getSecret");
|
|
15
16
|
const getProcessConfigActionType = (runtimeConfig) => {
|
|
16
17
|
return ({ secretName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const awsSecretKey = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveSecretKey)(secretName, runtimeConfig);
|
|
18
|
-
const secretValue = yield (0, getSecret_1.getSecret)(awsSecretKey);
|
|
19
|
+
const secretValue = yield (0, getSecret_1.getSecret)(awsSecretKey, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig));
|
|
19
20
|
return (0, quidproquo_core_1.actionResult)(secretValue);
|
|
20
21
|
});
|
|
21
22
|
};
|
|
@@ -3,7 +3,7 @@ import { HTTPEventParams } from 'quidproquo-webserver';
|
|
|
3
3
|
import { Context, APIGatewayProxyResult } from 'aws-lambda';
|
|
4
4
|
declare const _default: (config: QPQConfig) => {
|
|
5
5
|
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[import("aws-lambda").APIGatewayProxyEvent, Context], HTTPEventParams<any>>;
|
|
6
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<APIGatewayProxyResult>;
|
|
6
|
+
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<any, any, APIGatewayProxyResult>;
|
|
7
7
|
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<HTTPEventParams<any>>;
|
|
8
8
|
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<HTTPEventParams<any>>;
|
|
9
9
|
};
|
|
@@ -15,7 +15,6 @@ const awsLambdaUtils_1 = require("../../../awsLambdaUtils");
|
|
|
15
15
|
const getProcessTransformEventParams = (appName) => {
|
|
16
16
|
return ({ eventParams: [apiGatewayEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
const path = (apiGatewayEvent.path || '').replace(new RegExp(`^(\/${appName})/`), '/');
|
|
18
|
-
console.log('getProcessTransformEventParams', JSON.stringify(apiGatewayEvent));
|
|
19
18
|
return (0, quidproquo_core_1.actionResult)({
|
|
20
19
|
path,
|
|
21
20
|
query: Object.assign(Object.assign({}, (apiGatewayEvent.multiValueQueryStringParameters || {})), (apiGatewayEvent.queryStringParameters || {})),
|
|
@@ -30,13 +29,11 @@ const getProcessTransformEventParams = (appName) => {
|
|
|
30
29
|
const getProcessTransformResponseResult = (configs) => {
|
|
31
30
|
// We might need to JSON.stringify the body.
|
|
32
31
|
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
-
|
|
34
|
-
// if !valid actionResultError
|
|
35
|
-
console.log('getProcessTransformResponseResult', JSON.stringify(payload));
|
|
32
|
+
var _a;
|
|
36
33
|
return (0, quidproquo_core_1.actionResult)({
|
|
37
|
-
statusCode: payload.response.
|
|
38
|
-
body: payload.response.
|
|
39
|
-
headers: Object.assign(Object.assign({ 'Content-Type': 'application/json' }, quidproquo_webserver_1.qpqWebServerUtils.getCorsHeaders(configs, {}, payload.transformedEventParams.headers)), (payload.response.headers || {})),
|
|
34
|
+
statusCode: payload.response.statusCode,
|
|
35
|
+
body: payload.response.body,
|
|
36
|
+
headers: Object.assign(Object.assign({ 'Content-Type': 'application/json' }, quidproquo_webserver_1.qpqWebServerUtils.getCorsHeaders(configs, {}, payload.transformedEventParams.headers)), (((_a = payload === null || payload === void 0 ? void 0 : payload.response) === null || _a === void 0 ? void 0 : _a.headers) || {})),
|
|
40
37
|
});
|
|
41
38
|
});
|
|
42
39
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { QPQConfig, EventMatchStoryActionProcessor, EventTransformEventParamsActionProcessor, EventTransformResponseResultActionProcessor, EventAutoRespondActionProcessor } from 'quidproquo-core';
|
|
2
|
+
import { SeoEventParams, SeoEventResponse } from 'quidproquo-webserver';
|
|
3
|
+
import { CloudFrontRequestEvent, Context } from 'aws-lambda';
|
|
4
|
+
declare const _default: (config: QPQConfig) => {
|
|
5
|
+
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[CloudFrontRequestEvent, Context], SeoEventParams<any>>;
|
|
6
|
+
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<SeoEventResponse, SeoEventParams<any>, SeoEventResponse>;
|
|
7
|
+
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<SeoEventParams<any>>;
|
|
8
|
+
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<SeoEventParams<any>>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
|
+
const awsLambdaUtils_1 = require("../../../awsLambdaUtils");
|
|
15
|
+
const getProcessTransformEventParams = () => {
|
|
16
|
+
return ({ eventParams: [cloudFrontRequestEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const cfRecordRequest = cloudFrontRequestEvent.Records[0].cf.request;
|
|
18
|
+
const headers = Object.keys(cfRecordRequest.headers).reduce((acc, header) => (Object.assign(Object.assign({}, acc), { [header]: cfRecordRequest.headers[header][0].value })), {});
|
|
19
|
+
return (0, quidproquo_core_1.actionResult)({
|
|
20
|
+
body: cfRecordRequest.body,
|
|
21
|
+
correlation: context.awsRequestId,
|
|
22
|
+
method: cfRecordRequest.method,
|
|
23
|
+
path: cfRecordRequest.uri,
|
|
24
|
+
sourceIp: cfRecordRequest.clientIp,
|
|
25
|
+
headers: headers,
|
|
26
|
+
// TODO: query string support
|
|
27
|
+
query: {},
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const getProcessTransformResponseResult = (configs) => {
|
|
32
|
+
return ({ response }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
return (0, quidproquo_core_1.actionResult)(response);
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const getProcessAutoRespond = () => {
|
|
37
|
+
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
return (0, quidproquo_core_1.actionResult)(null);
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const getProcessMatchStory = (seoConfigs) => {
|
|
42
|
+
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
/// Sort the routes by string length
|
|
44
|
+
// Note: We may need to filter variable routes out {} as the variables are length independent
|
|
45
|
+
const sortedSeoConfigs = seoConfigs.sort((a, b) => {
|
|
46
|
+
if (a.path.length < b.path.length)
|
|
47
|
+
return -1;
|
|
48
|
+
if (a.path.length > b.path.length)
|
|
49
|
+
return 1;
|
|
50
|
+
return 0;
|
|
51
|
+
});
|
|
52
|
+
// Find the most relevant match
|
|
53
|
+
const matchedSeoConfig = sortedSeoConfigs
|
|
54
|
+
.map((r) => ({
|
|
55
|
+
match: (0, awsLambdaUtils_1.matchUrl)(r.path, payload.transformedEventParams.path),
|
|
56
|
+
route: r,
|
|
57
|
+
}))
|
|
58
|
+
.find((m) => m.match.didMatch);
|
|
59
|
+
if (!matchedSeoConfig) {
|
|
60
|
+
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, 'seo not found');
|
|
61
|
+
}
|
|
62
|
+
return (0, quidproquo_core_1.actionResult)({
|
|
63
|
+
src: matchedSeoConfig.route.src,
|
|
64
|
+
runtime: matchedSeoConfig.route.runtime,
|
|
65
|
+
options: matchedSeoConfig.match.params || {},
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
exports.default = (config) => {
|
|
70
|
+
const seoConfigs = quidproquo_webserver_1.qpqWebServerUtils.getAllSeo(config);
|
|
71
|
+
return {
|
|
72
|
+
[quidproquo_core_1.EventActionType.TransformEventParams]: getProcessTransformEventParams(),
|
|
73
|
+
[quidproquo_core_1.EventActionType.TransformResponseResult]: getProcessTransformResponseResult(config),
|
|
74
|
+
[quidproquo_core_1.EventActionType.AutoRespond]: getProcessAutoRespond(),
|
|
75
|
+
[quidproquo_core_1.EventActionType.MatchStory]: getProcessMatchStory(seoConfigs),
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -3,7 +3,7 @@ import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
|
3
3
|
import { EventBridgeEvent, Context } from 'aws-lambda';
|
|
4
4
|
declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
|
|
5
5
|
"@quidproquo-core/event/TransformEventParams": EventTransformEventParamsActionProcessor<[EventBridgeEvent<any, any>, Context], ScheduledEventParams<any>>;
|
|
6
|
-
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<any>;
|
|
6
|
+
"@quidproquo-core/event/TransformResponseResult": EventTransformResponseResultActionProcessor<any, any, any>;
|
|
7
7
|
"@quidproquo-core/event/AutoRespond": EventAutoRespondActionProcessor<ScheduledEventParams<any>>;
|
|
8
8
|
"@quidproquo-core/event/MatchStory": EventMatchStoryActionProcessor<ScheduledEventParams<any>>;
|
|
9
9
|
};
|
|
@@ -29,8 +29,6 @@ const getProcessAutoRespond = () => {
|
|
|
29
29
|
};
|
|
30
30
|
const getProcessMatchStory = (lambdaRuntimeConfig) => {
|
|
31
31
|
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
-
console.log('Trying to match story');
|
|
33
|
-
console.log(JSON.stringify(lambdaRuntimeConfig));
|
|
34
32
|
if (!lambdaRuntimeConfig) {
|
|
35
33
|
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, 'event runtime not found');
|
|
36
34
|
}
|
|
@@ -9,13 +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");
|
|
12
13
|
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
13
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
15
16
|
const getProcessFileDelete = (runtimeConfig) => {
|
|
16
17
|
return ({ drive, filepaths }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
|
|
18
|
-
const errored = yield (0, s3Utils_1.deleteFiles)(s3BucketName, filepaths);
|
|
19
|
+
const errored = yield (0, s3Utils_1.deleteFiles)(s3BucketName, filepaths, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig));
|
|
19
20
|
// errored deletes are a graceful success ~ Retry
|
|
20
21
|
// if (errored.length > 0) {
|
|
21
22
|
// return actionResultError(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
2
1
|
import { FileExistsActionProcessor } from 'quidproquo-core';
|
|
2
|
+
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
3
3
|
declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
|
|
4
4
|
"@quidproquo-core/File/Exists": FileExistsActionProcessor;
|
|
5
5
|
};
|
|
@@ -9,13 +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 qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
13
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
|
+
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
15
16
|
const getProcessFileExists = (runtimeConfig) => {
|
|
16
17
|
return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
|
|
18
|
-
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.objectExists)(s3BucketName, filepath));
|
|
19
|
+
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.objectExists)(s3BucketName, filepath, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig)));
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
exports.default = (runtimeConfig) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
2
1
|
import { FileListDirectoryActionProcessor } from 'quidproquo-core';
|
|
2
|
+
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
3
3
|
declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
|
|
4
4
|
"@quidproquo-core/File/ListDirectory": FileListDirectoryActionProcessor;
|
|
5
5
|
};
|
|
@@ -9,13 +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 qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
13
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
|
+
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
15
16
|
const getProcessFileListDirectory = (runtimeConfig) => {
|
|
16
17
|
return ({ drive, folderPath, maxFiles, pageToken }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
|
|
18
|
-
const s3FileList = yield (0, s3Utils_1.listFiles)(s3BucketName, folderPath, maxFiles, pageToken);
|
|
19
|
+
const s3FileList = yield (0, s3Utils_1.listFiles)(s3BucketName, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig), folderPath, maxFiles, pageToken);
|
|
19
20
|
// Add the drive onto the list
|
|
20
21
|
const fileInfos = s3FileList.fileInfos.map((s3fi) => (Object.assign(Object.assign({}, s3fi), { drive: drive })));
|
|
21
22
|
return (0, quidproquo_core_1.actionResult)({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
2
1
|
import { FileReadTextContentsActionProcessor } from 'quidproquo-core';
|
|
2
|
+
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
3
3
|
declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
|
|
4
4
|
"@quidproquo-core/File/ReadTextContents": FileReadTextContentsActionProcessor;
|
|
5
5
|
};
|
|
@@ -9,13 +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 qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
13
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
|
+
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
15
16
|
const getProcessFileReadTextContents = (runtimeConfig) => {
|
|
16
17
|
return ({ drive, filepath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
|
|
18
|
-
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readTextFile)(s3BucketName, filepath));
|
|
19
|
+
return (0, quidproquo_core_1.actionResult)(yield (0, s3Utils_1.readTextFile)(s3BucketName, filepath, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig)));
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
exports.default = (runtimeConfig) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
2
1
|
import { FileWriteTextContentsActionProcessor } from 'quidproquo-core';
|
|
2
|
+
import { QPQAWSLambdaConfig } from '../../../runtimeConfig/QPQAWSLambdaConfig';
|
|
3
3
|
declare const _default: (runtimeConfig: QPQAWSLambdaConfig) => {
|
|
4
4
|
"@quidproquo-core/File/WriteTextContents": FileWriteTextContentsActionProcessor;
|
|
5
5
|
};
|
|
@@ -9,13 +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 qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
13
12
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
13
|
+
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
|
+
const qpqAwsLambdaRuntimeConfigUtils_1 = require("../../../runtimeConfig/qpqAwsLambdaRuntimeConfigUtils");
|
|
14
15
|
const s3Utils_1 = require("../../../logic/s3/s3Utils");
|
|
15
16
|
const getProcessFileWriteTextContents = (runtimeConfig) => {
|
|
16
17
|
return ({ drive, filepath, data }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
18
|
const s3BucketName = (0, qpqAwsLambdaRuntimeConfigUtils_1.resolveResourceName)(drive, runtimeConfig);
|
|
18
|
-
yield (0, s3Utils_1.writeTextFile)(s3BucketName, filepath, data);
|
|
19
|
+
yield (0, s3Utils_1.writeTextFile)(s3BucketName, filepath, data, quidproquo_webserver_1.qpqWebServerUtils.getDeployRegion(runtimeConfig.qpqConfig));
|
|
19
20
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
20
21
|
});
|
|
21
22
|
};
|
|
@@ -2,6 +2,7 @@ export { default as getConfigGetSecretActionProcessor } from './config/getConfig
|
|
|
2
2
|
export { default as getConfigGetParameterActionProcessor } from './config/getConfigGetParameterActionProcessor';
|
|
3
3
|
export { default as getConfigGetParametersActionProcessor } from './config/getConfigGetParametersActionProcessor';
|
|
4
4
|
export { default as getAPIGatewayEventActionProcessor } from './event/getAPIGatewayEventActionProcessor';
|
|
5
|
+
export { default as getCloudFrontOriginRequestEventActionProcessor } from './event/getCloudFrontOriginRequestEventActionProcessor';
|
|
5
6
|
export { default as getEventBridgeEventActionProcessor } from './event/getEventBridgeEventActionProcessor';
|
|
6
7
|
export { default as getSystemActionProcessor } from './system';
|
|
7
8
|
export { default as getFileActionProcessor } from './file';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getEventBridgeEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
|
|
6
|
+
exports.getFileActionProcessor = exports.getSystemActionProcessor = exports.getEventBridgeEventActionProcessor = exports.getCloudFrontOriginRequestEventActionProcessor = exports.getAPIGatewayEventActionProcessor = exports.getConfigGetParametersActionProcessor = exports.getConfigGetParameterActionProcessor = exports.getConfigGetSecretActionProcessor = void 0;
|
|
7
7
|
var getConfigGetSecretActionProcessor_1 = require("./config/getConfigGetSecretActionProcessor");
|
|
8
8
|
Object.defineProperty(exports, "getConfigGetSecretActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetSecretActionProcessor_1).default; } });
|
|
9
9
|
var getConfigGetParameterActionProcessor_1 = require("./config/getConfigGetParameterActionProcessor");
|
|
@@ -12,6 +12,8 @@ var getConfigGetParametersActionProcessor_1 = require("./config/getConfigGetPara
|
|
|
12
12
|
Object.defineProperty(exports, "getConfigGetParametersActionProcessor", { enumerable: true, get: function () { return __importDefault(getConfigGetParametersActionProcessor_1).default; } });
|
|
13
13
|
var getAPIGatewayEventActionProcessor_1 = require("./event/getAPIGatewayEventActionProcessor");
|
|
14
14
|
Object.defineProperty(exports, "getAPIGatewayEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getAPIGatewayEventActionProcessor_1).default; } });
|
|
15
|
+
var getCloudFrontOriginRequestEventActionProcessor_1 = require("./event/getCloudFrontOriginRequestEventActionProcessor");
|
|
16
|
+
Object.defineProperty(exports, "getCloudFrontOriginRequestEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getCloudFrontOriginRequestEventActionProcessor_1).default; } });
|
|
15
17
|
var getEventBridgeEventActionProcessor_1 = require("./event/getEventBridgeEventActionProcessor");
|
|
16
18
|
Object.defineProperty(exports, "getEventBridgeEventActionProcessor", { enumerable: true, get: function () { return __importDefault(getEventBridgeEventActionProcessor_1).default; } });
|
|
17
19
|
var system_1 = require("./system");
|
|
@@ -32,10 +32,7 @@ const getProcessExecuteStory = (dynamicModuleLoader) => {
|
|
|
32
32
|
if (storyResult.error) {
|
|
33
33
|
return (0, quidproquo_core_1.actionResultError)(storyResult.error.errorType, `story error! in ${payload.src}::${payload.runtime} -> [${storyResult.error.errorText}]`, storyResult.error.errorStack);
|
|
34
34
|
}
|
|
35
|
-
return (0, quidproquo_core_1.actionResult)(
|
|
36
|
-
result: storyResult.result,
|
|
37
|
-
session: storyResult.session,
|
|
38
|
-
});
|
|
35
|
+
return (0, quidproquo_core_1.actionResult)(storyResult.result);
|
|
39
36
|
});
|
|
40
37
|
};
|
|
41
38
|
exports.default = (dynamicModuleLoader) => {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -31,3 +31,4 @@ __exportStar(require("./getActionProcessor"), exports);
|
|
|
31
31
|
exports.awsLambdaUtils = __importStar(require("./awsLambdaUtils"));
|
|
32
32
|
__exportStar(require("./runtimeConfig/QPQAWSLambdaConfig"), exports);
|
|
33
33
|
__exportStar(require("./types/DynamicLoader"), exports);
|
|
34
|
+
__exportStar(require("./logic/parametersManager/getParameter"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getParameter: (parameterName: string) => Promise<string>;
|
|
1
|
+
export declare const getParameter: (parameterName: string, region: string) => Promise<string>;
|
|
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getParameter = void 0;
|
|
13
13
|
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
14
|
-
const
|
|
15
|
-
const getParameter = (parameterName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const getParameter = (parameterName, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
15
|
var _a;
|
|
16
|
+
const smClient = new client_ssm_1.SSMClient({
|
|
17
|
+
region,
|
|
18
|
+
});
|
|
17
19
|
const response = yield smClient.send(new client_ssm_1.GetParameterCommand({
|
|
18
20
|
Name: parameterName,
|
|
19
21
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getParameters: (parameterNames: string[]) => Promise<string[]>;
|
|
1
|
+
export declare const getParameters: (parameterNames: string[], region: string) => Promise<string[]>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getParameters = void 0;
|
|
13
13
|
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const getParameters = (parameterNames, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const smClient = new client_ssm_1.SSMClient({ region });
|
|
16
16
|
const response = yield smClient.send(new client_ssm_1.GetParametersCommand({
|
|
17
17
|
Names: parameterNames,
|
|
18
18
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const deleteFiles: (drive: string, filepaths: string[]) => Promise<string[]>;
|
|
1
|
+
export declare const deleteFiles: (drive: string, filepaths: string[], region: string) => Promise<string[]>;
|
|
@@ -8,14 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.deleteFiles = void 0;
|
|
16
13
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
17
|
-
const
|
|
18
|
-
const deleteFiles = (drive, filepaths) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const client_s3_2 = require("@aws-sdk/client-s3");
|
|
15
|
+
const deleteFiles = (drive, filepaths, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const s3Client = new client_s3_1.S3Client({ region });
|
|
19
17
|
const bucketParams = {
|
|
20
18
|
Bucket: drive,
|
|
21
19
|
Delete: {
|
|
@@ -23,7 +21,7 @@ const deleteFiles = (drive, filepaths) => __awaiter(void 0, void 0, void 0, func
|
|
|
23
21
|
Objects: filepaths.map((fp) => ({ Key: fp })),
|
|
24
22
|
},
|
|
25
23
|
};
|
|
26
|
-
const response = yield
|
|
24
|
+
const response = yield s3Client.send(new client_s3_2.DeleteObjectsCommand(bucketParams));
|
|
27
25
|
return (response.Errors || []).map((e) => e.Key || '');
|
|
28
26
|
});
|
|
29
27
|
exports.deleteFiles = deleteFiles;
|
|
@@ -7,4 +7,4 @@ export interface S3FileList {
|
|
|
7
7
|
fileInfos: S3FileInfo[];
|
|
8
8
|
pageToken?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const listFiles: (drive: string, folder?: string, maxKeys?: number, pageToken?: string) => Promise<S3FileList>;
|
|
10
|
+
export declare const listFiles: (drive: string, region: string, folder?: string, maxKeys?: number, pageToken?: string) => Promise<S3FileList>;
|
|
@@ -8,15 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.listFiles = void 0;
|
|
16
13
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
14
|
+
const client_s3_2 = require("@aws-sdk/client-s3");
|
|
17
15
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
18
|
-
const
|
|
19
|
-
const listFiles = (drive, folder = '', maxKeys = 1000, pageToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const listFiles = (drive, region, folder = '', maxKeys = 1000, pageToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
17
|
const validatedPrefix = `${folder}${folder.endsWith(quidproquo_core_1.filePathDelimiter) || !folder ? '' : quidproquo_core_1.filePathDelimiter}`;
|
|
21
18
|
const bucketParams = {
|
|
22
19
|
Bucket: drive,
|
|
@@ -27,7 +24,8 @@ const listFiles = (drive, folder = '', maxKeys = 1000, pageToken) => __awaiter(v
|
|
|
27
24
|
};
|
|
28
25
|
// Declare truncated as a flag that the while loop is based on.
|
|
29
26
|
let files = [];
|
|
30
|
-
const
|
|
27
|
+
const s3Client = new client_s3_1.S3Client({ region });
|
|
28
|
+
const response = yield s3Client.send(new client_s3_2.ListObjectsV2Command(bucketParams));
|
|
31
29
|
if (response.CommonPrefixes && !bucketParams.ContinuationToken) {
|
|
32
30
|
files = [
|
|
33
31
|
...files,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const objectExists: (bucketName: string, key: string) => Promise<boolean>;
|
|
1
|
+
export declare const objectExists: (bucketName: string, key: string, region: string) => Promise<boolean>;
|
|
@@ -8,16 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.objectExists = void 0;
|
|
16
13
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
17
|
-
const
|
|
18
|
-
const objectExists = (bucketName, key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const client_s3_2 = require("@aws-sdk/client-s3");
|
|
15
|
+
const objectExists = (bucketName, key, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
16
|
try {
|
|
20
|
-
const
|
|
17
|
+
const s3Client = new client_s3_1.S3Client({ region });
|
|
18
|
+
yield s3Client.send(new client_s3_2.HeadObjectCommand({
|
|
21
19
|
Key: key,
|
|
22
20
|
Bucket: bucketName,
|
|
23
21
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const readTextFile: (bucketName: string, key: string) => Promise<string>;
|
|
1
|
+
export declare const readTextFile: (bucketName: string, key: string, region: string) => Promise<string>;
|
|
@@ -8,16 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.readTextFile = void 0;
|
|
16
13
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
17
|
-
const
|
|
18
|
-
const readTextFile = (bucketName, key) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
|
+
const readTextFile = (bucketName, key, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
15
|
var _a;
|
|
20
|
-
const
|
|
16
|
+
const s3Client = new client_s3_1.S3Client({ region });
|
|
17
|
+
const response = yield s3Client.send(new client_s3_1.GetObjectCommand({
|
|
21
18
|
Key: key,
|
|
22
19
|
Bucket: bucketName,
|
|
23
20
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const writeTextFile: (bucketName: string, key: string, data: string) => Promise<void>;
|
|
1
|
+
export declare const writeTextFile: (bucketName: string, key: string, data: string, region: string) => Promise<void>;
|
|
@@ -8,15 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.writeTextFile = void 0;
|
|
16
13
|
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
yield
|
|
14
|
+
const writeTextFile = (bucketName, key, data, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const s3Client = new client_s3_1.S3Client({ region });
|
|
16
|
+
yield s3Client.send(new client_s3_1.PutObjectCommand({
|
|
20
17
|
Key: key,
|
|
21
18
|
Bucket: bucketName,
|
|
22
19
|
Body: Buffer.from(data),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getSecret: (secretName: string) => Promise<string>;
|
|
1
|
+
export declare const getSecret: (secretName: string, region: string) => Promise<string>;
|
|
@@ -11,8 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getSecret = void 0;
|
|
13
13
|
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
14
|
+
const getSecret = (secretName, region) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
const smClient = new client_secrets_manager_1.SecretsManagerClient({
|
|
16
|
+
region,
|
|
17
|
+
});
|
|
16
18
|
const response = yield smClient.send(new client_secrets_manager_1.GetSecretValueCommand({
|
|
17
19
|
SecretId: secretName,
|
|
18
20
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-awslambda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
12
|
"clean": "npx rimraf lib",
|
|
13
13
|
"build": "npm run clean && tsc",
|
|
14
|
-
"watch": "
|
|
14
|
+
"watch": "tsc -w"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
package/lib/logic/s3/s3Client.js
DELETED