quidproquo-actionprocessor-awslambda 0.0.171 → 0.0.173

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.
@@ -19,3 +19,4 @@ export declare const getBaseStackName: (qpqConfig: QPQConfig) => string;
19
19
  export declare const getInfStackName: (qpqConfig: QPQConfig) => string;
20
20
  export declare const getWebStackName: (qpqConfig: QPQConfig) => string;
21
21
  export declare const getApiStackName: (qpqConfig: QPQConfig) => string;
22
+ export declare const getBootstrapStackName: (qpqConfig: QPQConfig) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.getConfigRuntimeResourceNameFromConfig = 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.getConfigRuntimeResourceNameFromConfig = 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) => {
@@ -155,3 +155,14 @@ const getApiStackName = (qpqConfig) => {
155
155
  return `${(0, exports.getBaseStackName)(qpqConfig)}-api`;
156
156
  };
157
157
  exports.getApiStackName = getApiStackName;
158
+ const getBootstrapStackName = (qpqConfig) => {
159
+ const appName = quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig);
160
+ const environment = quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig);
161
+ const feature = quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig);
162
+ const baseName = `${appName}-${environment}`;
163
+ if (feature) {
164
+ return `${baseName}-${feature}-bs`;
165
+ }
166
+ return `${baseName}-bs`;
167
+ };
168
+ exports.getBootstrapStackName = getBootstrapStackName;
@@ -21,8 +21,14 @@ const transformHttpEventHeadersToAPIGatewayProxyResultHeaders = (headers) => {
21
21
  };
22
22
  const getProcessTransformEventParams = (serviceName) => {
23
23
  return ({ eventParams: [apiGatewayEvent, context] }) => __awaiter(void 0, void 0, void 0, function* () {
24
- // The comment here was for when we use base path as our service name, its now in the domain
25
- const path = apiGatewayEvent.path || '/'; // (apiGatewayEvent.path || '').replace(new RegExp(`^(\/${serviceName})/`), '/');
24
+ // const path = (apiGatewayEvent.path || '/').replace(new RegExp(`^(\/${serviceName})/`), '/');
25
+ // Initialize `path` by removing the service name prefix from `apiGatewayEvent.path`.
26
+ // This adjustment is necessary because the API gateway routes requests to services based on
27
+ // a base path that includes the service name. By subtracting `serviceName.length + 1` from the
28
+ // substring method's start index, we effectively strip the leading `/<serviceName>` segment,
29
+ // accounting for the leading slash. This ensures `path` reflects the intended resource location
30
+ // after the service name. Defaults to '/' if `apiGatewayEvent.path` is not provided.
31
+ const path = (apiGatewayEvent.path || '/').substring(serviceName.length + 1);
26
32
  const transformedEventParams = {
27
33
  path,
28
34
  query: Object.assign(Object.assign({}, (apiGatewayEvent.multiValueQueryStringParameters || {})), (apiGatewayEvent.queryStringParameters || {})),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.171",
3
+ "version": "0.0.173",
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.171",
51
- "quidproquo-core": "0.0.171",
52
- "quidproquo-webserver": "0.0.171"
50
+ "quidproquo-config-aws": "0.0.173",
51
+ "quidproquo-core": "0.0.173",
52
+ "quidproquo-webserver": "0.0.173"
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.171",
60
+ "quidproquo-tsconfig": "0.0.173",
61
61
  "typescript": "^4.9.3"
62
62
  }
63
- }
63
+ }