quidproquo-actionprocessor-awslambda 0.0.30 → 0.0.31
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 +0 -1
- package/lib/awsLambdaUtils.js +1 -18
- package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.d.ts +2 -2
- package/lib/getActionProcessor/core/system/getExecuteStoryActionProcessor.js +4 -5
- package/lib/getActionProcessor/core/system/index.d.ts +2 -2
- package/lib/getActionProcessor/core/system/index.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/lambdas/index.d.ts +3 -0
- package/lib/lambdas/index.js +19 -0
- package/lib/lambdas/lambdaAPIGatewayEvent.d.ts +13 -0
- package/lib/lambdas/lambdaAPIGatewayEvent.js +101 -0
- package/lib/lambdas/lambdaConfig.d.ts +4 -0
- package/lib/lambdas/lambdaConfig.js +4 -0
- package/lib/lambdas/lambdaEventBridgeEvent.d.ts +5 -0
- package/lib/lambdas/lambdaEventBridgeEvent.js +60 -0
- package/lib/types/DynamicLoader.d.ts +1 -0
- package/lib/types/DynamicLoader.js +2 -0
- package/package.json +3 -2
- package/src/awsLambdaUtils.ts +22 -0
- package/src/getActionProcessor/core/config/getConfigGetParameterActionProcessor.ts +23 -0
- package/src/getActionProcessor/core/config/getConfigGetParametersActionProcessor.ts +27 -0
- package/src/getActionProcessor/core/config/getConfigGetSecretActionProcessor.ts +23 -0
- package/src/getActionProcessor/core/config/index.ts +11 -0
- package/src/getActionProcessor/core/event/getAPIGatewayEventActionProcessor.ts +134 -0
- package/src/getActionProcessor/core/event/getEventBridgeEventActionProcessor.ts +66 -0
- package/src/getActionProcessor/core/file/getFileDeleteActionProcessor.ts +31 -0
- package/src/getActionProcessor/core/file/getFileExistsActionProcessor.ts +16 -0
- package/src/getActionProcessor/core/file/getFileListDirectoryActionProcessor.ts +28 -0
- package/src/getActionProcessor/core/file/getFileReadTextContentsActionProcessor.ts +18 -0
- package/src/getActionProcessor/core/file/getFileWriteTextContentsActionProcessor.ts +23 -0
- package/src/getActionProcessor/core/file/index.ts +15 -0
- package/src/getActionProcessor/core/index.ts +7 -0
- package/src/getActionProcessor/core/system/getExecuteStoryActionProcessor.ts +67 -0
- package/src/getActionProcessor/core/system/index.ts +6 -0
- package/src/getActionProcessor/index.ts +1 -0
- package/src/index.ts +6 -0
- package/src/lambdas/index.ts +4 -0
- package/src/lambdas/lambdaAPIGatewayEvent.ts +105 -0
- package/src/lambdas/lambdaConfig.ts +11 -0
- package/src/lambdas/lambdaEventBridgeEvent.ts +60 -0
- package/src/logic/parametersManager/getParameter.ts +13 -0
- package/src/logic/parametersManager/getParameters.ts +15 -0
- package/src/logic/s3/deleteFiles.ts +17 -0
- package/src/logic/s3/listFiles.ts +66 -0
- package/src/logic/s3/objectExists.ts +18 -0
- package/src/logic/s3/readTextFile.ts +14 -0
- package/src/logic/s3/s3Client.ts +5 -0
- package/src/logic/s3/s3Utils.ts +5 -0
- package/src/logic/s3/writeTextFile.ts +17 -0
- package/src/logic/secretsManager/getSecret.ts +13 -0
- package/src/runtimeConfig/QPQAWSLambdaConfig.ts +15 -0
- package/src/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.ts +19 -0
- package/src/types/DynamicLoader.ts +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk/client-secrets-manager';
|
|
2
|
+
|
|
3
|
+
const smClient = new SecretsManagerClient({});
|
|
4
|
+
|
|
5
|
+
export const getSecret = async (secretName: string): Promise<string> => {
|
|
6
|
+
const response = await smClient.send(
|
|
7
|
+
new GetSecretValueCommand({
|
|
8
|
+
SecretId: secretName,
|
|
9
|
+
}),
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
return response.SecretString || '';
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
+
export interface LambdaRuntimeConfig {
|
|
3
|
+
src: string;
|
|
4
|
+
runtime: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface QPQAWSLambdaConfig {
|
|
8
|
+
qpqConfig: QPQConfig;
|
|
9
|
+
|
|
10
|
+
resourceNameMap: Record<string, string>;
|
|
11
|
+
secretNameMap: Record<string, string>;
|
|
12
|
+
parameterNameMap: Record<string, string>;
|
|
13
|
+
|
|
14
|
+
lambdaRuntimeConfig?: LambdaRuntimeConfig;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QPQAWSLambdaConfig } from './QPQAWSLambdaConfig';
|
|
2
|
+
|
|
3
|
+
export const resolveResourceName = (
|
|
4
|
+
resourceName: string,
|
|
5
|
+
qpqAwsLambdaConfig: QPQAWSLambdaConfig,
|
|
6
|
+
) => {
|
|
7
|
+
return qpqAwsLambdaConfig.resourceNameMap[resourceName] || resourceName;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const resolveSecretKey = (secretName: string, qpqAwsLambdaConfig: QPQAWSLambdaConfig) => {
|
|
11
|
+
return qpqAwsLambdaConfig.secretNameMap[secretName] || secretName;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const resolveParameterKey = (
|
|
15
|
+
parameterName: string,
|
|
16
|
+
qpqAwsLambdaConfig: QPQAWSLambdaConfig,
|
|
17
|
+
) => {
|
|
18
|
+
return qpqAwsLambdaConfig.parameterNameMap[parameterName] || parameterName;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DynamicModuleLoader = (src: string) => Promise<any>;
|