quidproquo-actionprocessor-awslambda 0.0.177 → 0.0.179
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { QPQConfig, ResourceName } from 'quidproquo-core';
|
|
1
|
+
import { QPQConfig, ResourceName, CrossModuleOwner } from 'quidproquo-core';
|
|
2
2
|
export declare const getGlobalConfigRuntimeResourceName: (resourceName: string, application: string, environment: string, feature?: string) => string;
|
|
3
3
|
export declare const getGlobalQpqRuntimeResourceName: (resourceName: string, application: string, environment: string, feature?: string, resourceType?: string) => string;
|
|
4
4
|
export declare const getConfigRuntimeResourceName: (resourceName: string, application: string, service: string, environment: string, feature?: string) => string;
|
|
5
5
|
export declare const getConfigRuntimeBootstrapResourceName: (resourceName: string, application: string, environment: string, feature?: string) => string;
|
|
6
6
|
export declare const getConfigRuntimeResourceNameFromConfig: (resourceName: string, qpqConfig: QPQConfig) => string;
|
|
7
|
+
export declare const resolveConfigRuntimeResourceNameFromConfig: (resourceName: string, qpqConfig: QPQConfig, owner?: CrossModuleOwner) => string;
|
|
7
8
|
export declare const getConfigRuntimeBootstrapResourceNameFromConfig: (resourceName: string, qpqConfig: QPQConfig) => string;
|
|
8
9
|
export declare const getConfigRuntimeResourceNameFromConfigWithServiceOverride: (resourceName: string, qpqConfig: QPQConfig, serviceOverride?: string) => string;
|
|
9
10
|
export declare const getQpqRuntimeResourceName: (resourceName: string, application: string, service: string, environment: string, feature?: string, resourceType?: string) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBootstrapStackName = exports.getApiStackName = exports.getWebStackName = exports.getInfStackName = exports.getBaseStackName = exports.getEventBusSnsTopicArn = exports.getCFExportNameWebsocketApiIdFromConfig = exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameCachePolicyIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = exports.getKvsDynamoTableNameFromConfig = exports.getQpqRuntimeResourceNameFromConfig = exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceNameFromConfigWithServiceOverride = exports.getConfigRuntimeBootstrapResourceNameFromConfig = exports.getConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeBootstrapResourceName = exports.getConfigRuntimeResourceName = exports.getGlobalQpqRuntimeResourceName = exports.getGlobalConfigRuntimeResourceName = void 0;
|
|
3
|
+
exports.getBootstrapStackName = exports.getApiStackName = exports.getWebStackName = exports.getInfStackName = exports.getBaseStackName = exports.getEventBusSnsTopicArn = exports.getCFExportNameWebsocketApiIdFromConfig = exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameCachePolicyIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = exports.getKvsDynamoTableNameFromConfig = exports.getQpqRuntimeResourceNameFromConfig = exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceNameFromConfigWithServiceOverride = exports.getConfigRuntimeBootstrapResourceNameFromConfig = exports.resolveConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeBootstrapResourceName = exports.getConfigRuntimeResourceName = exports.getGlobalQpqRuntimeResourceName = exports.getGlobalConfigRuntimeResourceName = void 0;
|
|
4
4
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
5
5
|
const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
6
6
|
const getGlobalConfigRuntimeResourceName = (resourceName, application, environment, feature) => {
|
|
@@ -40,6 +40,14 @@ const getConfigRuntimeResourceNameFromConfig = (resourceName, qpqConfig) => {
|
|
|
40
40
|
return (0, exports.getConfigRuntimeResourceName)(resourceName, application, service, environment, feature);
|
|
41
41
|
};
|
|
42
42
|
exports.getConfigRuntimeResourceNameFromConfig = getConfigRuntimeResourceNameFromConfig;
|
|
43
|
+
const resolveConfigRuntimeResourceNameFromConfig = (resourceName, qpqConfig, owner) => {
|
|
44
|
+
const application = (owner === null || owner === void 0 ? void 0 : owner.application) || quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
45
|
+
const service = (owner === null || owner === void 0 ? void 0 : owner.module) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
46
|
+
const environment = (owner === null || owner === void 0 ? void 0 : owner.environment) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
47
|
+
const feature = (owner === null || owner === void 0 ? void 0 : owner.feature) || quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
|
|
48
|
+
return (0, exports.getConfigRuntimeResourceName)(resourceName, application, service, environment, feature);
|
|
49
|
+
};
|
|
50
|
+
exports.resolveConfigRuntimeResourceNameFromConfig = resolveConfigRuntimeResourceNameFromConfig;
|
|
43
51
|
const getConfigRuntimeBootstrapResourceNameFromConfig = (resourceName, qpqConfig) => {
|
|
44
52
|
const application = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
|
|
45
53
|
const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
|
|
@@ -28,9 +28,8 @@ const memoFuncAsync = (func, ttlInSeconds = 3600) => {
|
|
|
28
28
|
}
|
|
29
29
|
const cacheKey = JSON.stringify(args);
|
|
30
30
|
const nodeCache = cache.get(func);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return cachedValue;
|
|
31
|
+
if (nodeCache.has(cacheKey)) {
|
|
32
|
+
return nodeCache.get(cacheKey);
|
|
34
33
|
}
|
|
35
34
|
try {
|
|
36
35
|
// Await the result and then cache it
|
|
@@ -39,8 +38,6 @@ const memoFuncAsync = (func, ttlInSeconds = 3600) => {
|
|
|
39
38
|
return result;
|
|
40
39
|
}
|
|
41
40
|
catch (err) {
|
|
42
|
-
// If an error occurs, cache the error
|
|
43
|
-
nodeCache.set(cacheKey, err);
|
|
44
41
|
throw err; // re-throw the error to be caught by caller
|
|
45
42
|
}
|
|
46
43
|
}));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveParameterKey = exports.resolveSecretKey = exports.resolveResourceName = void 0;
|
|
4
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
4
5
|
const awsNamingUtils_1 = require("../awsNamingUtils");
|
|
5
6
|
const resolveResourceName = (resourceName, qpqConfig) => {
|
|
6
7
|
return (0, awsNamingUtils_1.getConfigRuntimeResourceNameFromConfig)(resourceName, qpqConfig);
|
|
@@ -11,6 +12,8 @@ const resolveSecretKey = (secretName, qpqConfig) => {
|
|
|
11
12
|
};
|
|
12
13
|
exports.resolveSecretKey = resolveSecretKey;
|
|
13
14
|
const resolveParameterKey = (parameterName, qpqConfig) => {
|
|
14
|
-
|
|
15
|
+
var _a, _b;
|
|
16
|
+
const secretConfig = quidproquo_core_1.qpqCoreUtils.getParameterConfig(parameterName, qpqConfig);
|
|
17
|
+
return (0, awsNamingUtils_1.getConfigRuntimeResourceNameFromConfigWithServiceOverride)(((_a = secretConfig.owner) === null || _a === void 0 ? void 0 : _a.resourceNameOverride) || parameterName, qpqConfig, (_b = secretConfig.owner) === null || _b === void 0 ? void 0 : _b.module);
|
|
15
18
|
};
|
|
16
19
|
exports.resolveParameterKey = resolveParameterKey;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-awslambda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.179",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"types": "./lib/commonjs/index.d.ts",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"lodash": "^4.17.21",
|
|
48
48
|
"node-cache": "^5.1.2",
|
|
49
49
|
"node-match-path": "^0.6.3",
|
|
50
|
-
"quidproquo-config-aws": "0.0.
|
|
51
|
-
"quidproquo-core": "0.0.
|
|
52
|
-
"quidproquo-webserver": "0.0.
|
|
50
|
+
"quidproquo-config-aws": "0.0.179",
|
|
51
|
+
"quidproquo-core": "0.0.179",
|
|
52
|
+
"quidproquo-webserver": "0.0.179"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/aws-lambda": "^8.10.109",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@types/jsonwebtoken": "^9.0.2",
|
|
58
58
|
"@types/lodash": "^4.14.194",
|
|
59
59
|
"@types/node": "^18.11.9",
|
|
60
|
-
"quidproquo-tsconfig": "0.0.
|
|
60
|
+
"quidproquo-tsconfig": "0.0.179",
|
|
61
61
|
"typescript": "^4.9.3"
|
|
62
62
|
}
|
|
63
63
|
}
|