quidproquo-actionprocessor-awslambda 0.0.52 → 0.0.53
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 -2
- package/lib/awsLambdaUtils.js +1 -8
- package/lib/awsNamingUtils.d.ts +3 -0
- package/lib/awsNamingUtils.js +19 -0
- package/lib/getActionProcessor/core/event/getCloudFrontOriginRequestEventActionProcessor.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/runtimeConfig/qpqAwsLambdaRuntimeConfigUtils.js +4 -4
- package/package.json +1 -1
package/lib/awsLambdaUtils.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { QPQConfig } from 'quidproquo-core';
|
|
2
1
|
export declare const randomGuid: () => string;
|
|
3
2
|
export interface UrlMatch {
|
|
4
3
|
didMatch: boolean;
|
|
5
4
|
params: Record<string, string> | null;
|
|
6
5
|
}
|
|
7
6
|
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,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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");
|
|
7
6
|
const randomGuid = () => {
|
|
8
7
|
return (0, crypto_1.randomUUID)();
|
|
9
8
|
};
|
|
@@ -18,9 +17,3 @@ const matchUrl = (path, url) => {
|
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
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;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { QPQConfig } from 'quidproquo-core';
|
|
2
|
+
export declare const getConfigRuntimeResourceName: (resourceName: string, qpqConfig: QPQConfig, resourceType?: string) => string;
|
|
3
|
+
export declare const getQpqRuntimeResourceName: (resourceName: string, qpqConfig: QPQConfig, resourceType?: string) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceName = void 0;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
|
+
const getConfigRuntimeResourceName = (resourceName, qpqConfig, resourceType = '') => {
|
|
6
|
+
const service = quidproquo_core_1.qpqCoreUtils.getAppName(qpqConfig);
|
|
7
|
+
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationEnvironment(qpqConfig);
|
|
8
|
+
const feature = quidproquo_core_1.qpqCoreUtils.getApplicationFeature(qpqConfig);
|
|
9
|
+
if (feature) {
|
|
10
|
+
return `${resourceName}-${service}-${environment}-${feature}`;
|
|
11
|
+
}
|
|
12
|
+
return `${resourceName}-${service}-${environment}`;
|
|
13
|
+
};
|
|
14
|
+
exports.getConfigRuntimeResourceName = getConfigRuntimeResourceName;
|
|
15
|
+
const getQpqRuntimeResourceName = (resourceName, qpqConfig, resourceType = '') => {
|
|
16
|
+
const name = (0, exports.getConfigRuntimeResourceName)(resourceName, qpqConfig, resourceType);
|
|
17
|
+
return `${name}-qpq`;
|
|
18
|
+
};
|
|
19
|
+
exports.getQpqRuntimeResourceName = getQpqRuntimeResourceName;
|
|
@@ -17,7 +17,7 @@ const getProcessTransformEventParams = (qpqConfig) => {
|
|
|
17
17
|
const cfRecordRequest = cloudFrontRequestEvent.Records[0].cf.request;
|
|
18
18
|
const headers = Object.keys(cfRecordRequest.headers).reduce((acc, header) => (Object.assign(Object.assign({}, acc), { [header]: cfRecordRequest.headers[header][0].value })), {});
|
|
19
19
|
return (0, quidproquo_core_1.actionResult)({
|
|
20
|
-
domain: quidproquo_webserver_1.qpqWebServerUtils.
|
|
20
|
+
domain: quidproquo_webserver_1.qpqWebServerUtils.getBaseDomainName(qpqConfig),
|
|
21
21
|
body: cfRecordRequest.body,
|
|
22
22
|
correlation: context.awsRequestId,
|
|
23
23
|
method: cfRecordRequest.method,
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './getActionProcessor';
|
|
2
2
|
export * as awsLambdaUtils from './awsLambdaUtils';
|
|
3
|
+
export * as awsNamingUtils from './awsNamingUtils';
|
|
3
4
|
export * from './runtimeConfig/QPQAWSResourceMap';
|
|
4
5
|
export * from './types/DynamicLoader';
|
|
5
6
|
export * from './logic/parametersManager/getParameter';
|
package/lib/index.js
CHANGED
|
@@ -26,9 +26,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.awsLambdaUtils = void 0;
|
|
29
|
+
exports.awsNamingUtils = exports.awsLambdaUtils = void 0;
|
|
30
30
|
__exportStar(require("./getActionProcessor"), exports);
|
|
31
31
|
exports.awsLambdaUtils = __importStar(require("./awsLambdaUtils"));
|
|
32
|
+
exports.awsNamingUtils = __importStar(require("./awsNamingUtils"));
|
|
32
33
|
__exportStar(require("./runtimeConfig/QPQAWSResourceMap"), exports);
|
|
33
34
|
__exportStar(require("./types/DynamicLoader"), exports);
|
|
34
35
|
__exportStar(require("./logic/parametersManager/getParameter"), exports);
|
|
@@ -1,16 +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
|
|
4
|
+
const awsNamingUtils_1 = require("../awsNamingUtils");
|
|
5
5
|
const resolveResourceName = (resourceName, qpqConfig) => {
|
|
6
|
-
return (0,
|
|
6
|
+
return (0, awsNamingUtils_1.getConfigRuntimeResourceName)(resourceName, qpqConfig);
|
|
7
7
|
};
|
|
8
8
|
exports.resolveResourceName = resolveResourceName;
|
|
9
9
|
const resolveSecretKey = (secretName, qpqConfig) => {
|
|
10
|
-
return (0,
|
|
10
|
+
return (0, awsNamingUtils_1.getConfigRuntimeResourceName)(secretName, qpqConfig);
|
|
11
11
|
};
|
|
12
12
|
exports.resolveSecretKey = resolveSecretKey;
|
|
13
13
|
const resolveParameterKey = (parameterName, qpqConfig) => {
|
|
14
|
-
return (0,
|
|
14
|
+
return (0, awsNamingUtils_1.getConfigRuntimeResourceName)(parameterName, qpqConfig);
|
|
15
15
|
};
|
|
16
16
|
exports.resolveParameterKey = resolveParameterKey;
|