quidproquo-actionprocessor-awslambda 0.0.108 → 0.0.110

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.
@@ -11,3 +11,4 @@ export declare const getCFExportNameUserPoolClientIdFromConfig: (userDirectoryNa
11
11
  export declare const getCFExportNameApiKeyIdFromConfig: (apiKeyName: string, qpqConfig: QPQConfig, serviceOverride?: string, applicationOverride?: string) => string;
12
12
  export declare const getCFExportNameSnsTopicArnFromConfig: (eventBusName: string, qpqConfig: QPQConfig, applicationOverride?: string) => string;
13
13
  export declare const getCFExportNameDistributionIdArnFromConfig: (webEntryName: string, qpqConfig: QPQConfig, serviceOverride?: string, applicationOverride?: string) => string;
14
+ export declare const getEventBusSnsTopicArn: (eventBusName: string, qpqConfig: QPQConfig, module: string, environment: string, application: string, feature?: string) => string;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = exports.getQpqRuntimeResourceNameFromConfig = exports.getQpqRuntimeResourceName = exports.getConfigRuntimeResourceNameFromConfigWithServiceOverride = exports.getConfigRuntimeResourceNameFromConfig = exports.getConfigRuntimeResourceName = exports.getGlobalQpqRuntimeResourceName = exports.getGlobalConfigRuntimeResourceName = void 0;
3
+ exports.getEventBusSnsTopicArn = exports.getCFExportNameDistributionIdArnFromConfig = exports.getCFExportNameSnsTopicArnFromConfig = exports.getCFExportNameApiKeyIdFromConfig = exports.getCFExportNameUserPoolClientIdFromConfig = exports.getCFExportNameUserPoolIdFromConfig = 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
+ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
5
6
  const getGlobalConfigRuntimeResourceName = (resourceName, application, environment, feature) => {
6
7
  const baseName = `${resourceName}-${application}-${environment}`;
7
8
  if (feature) {
@@ -91,3 +92,11 @@ const getCFExportNameDistributionIdArnFromConfig = (webEntryName, qpqConfig, ser
91
92
  return (0, exports.getQpqRuntimeResourceName)(webEntryName, application, service, environment, feature, 'distribution-id-export');
92
93
  };
93
94
  exports.getCFExportNameDistributionIdArnFromConfig = getCFExportNameDistributionIdArnFromConfig;
95
+ const getEventBusSnsTopicArn = (eventBusName, qpqConfig, module, environment, application, feature) => {
96
+ const topicName = (0, exports.getConfigRuntimeResourceName)(eventBusName, application, module, environment, feature);
97
+ const accountInfo = (0, quidproquo_config_aws_1.getAwsServiceAccountInfoByDeploymentInfo)(qpqConfig, module, environment, feature, application);
98
+ const awsAccountId = accountInfo.awsAccountId;
99
+ const region = accountInfo.awsRegion;
100
+ return `arn:aws:sns:${region}:${awsAccountId}:${topicName}`;
101
+ };
102
+ exports.getEventBusSnsTopicArn = getEventBusSnsTopicArn;
@@ -12,12 +12,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const quidproquo_core_1 = require("quidproquo-core");
13
13
  const quidproquo_core_2 = require("quidproquo-core");
14
14
  const publishMessage_1 = require("../../../logic/sns/publishMessage");
15
- const getExportedValue_1 = require("../../../logic/cloudformation/getExportedValue");
16
15
  const awsNamingUtils_1 = require("../../../awsNamingUtils");
17
16
  const getProcessEventBusSendMessage = (qpqConfig) => {
18
- return ({ eventBusName, eventBusMessages }, session) => __awaiter(void 0, void 0, void 0, function* () {
17
+ return ({ eventBusName, eventBusMessages, moduleOverride, environmentOverride, featureOverride, applicationOverride, }, session) => __awaiter(void 0, void 0, void 0, function* () {
19
18
  const region = quidproquo_core_1.qpqCoreUtils.getApplicationModuleDeployRegion(qpqConfig);
20
- const topicArn = yield (0, getExportedValue_1.getExportedValue)((0, awsNamingUtils_1.getCFExportNameSnsTopicArnFromConfig)(eventBusName, qpqConfig), region);
19
+ const topicArn = (0, awsNamingUtils_1.getEventBusSnsTopicArn)(eventBusName, qpqConfig, moduleOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig), environmentOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig), applicationOverride || quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig), featureOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig));
20
+ console.log(moduleOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig), environmentOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig), applicationOverride || quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig), featureOverride || quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig));
21
21
  yield (0, publishMessage_1.publishMessage)(topicArn, region, eventBusMessages.map((message) => {
22
22
  const eventBusMessageWithSession = Object.assign(Object.assign({}, message), { storySession: session });
23
23
  return JSON.stringify(eventBusMessageWithSession);
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.publishMessage = void 0;
13
13
  const client_sns_1 = require("@aws-sdk/client-sns");
14
14
  const publishMessage = (topicArn, region, messages) => __awaiter(void 0, void 0, void 0, function* () {
15
+ console.log(topicArn, region, JSON.stringify(messages, null, 2));
15
16
  const sqsClient = new client_sns_1.SNSClient({
16
17
  region,
17
18
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-actionprocessor-awslambda",
3
- "version": "0.0.108",
3
+ "version": "0.0.110",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -25,17 +25,17 @@
25
25
  },
26
26
  "homepage": "https://github.com/joe-coady/quidproquo#readme",
27
27
  "dependencies": {
28
- "@aws-sdk/client-api-gateway": "^3.354.0",
29
- "@aws-sdk/client-cloudformation": "^3.354.0",
30
- "@aws-sdk/client-cloudfront": "^3.354.0",
31
- "@aws-sdk/client-cognito-identity-provider": "^3.354.0",
32
- "@aws-sdk/client-dynamodb": "^3.354.0",
33
- "@aws-sdk/client-lambda": "^3.354.0",
34
- "@aws-sdk/client-s3": "^3.354.0",
35
- "@aws-sdk/client-secrets-manager": "^3.354.0",
36
- "@aws-sdk/client-sns": "^3.354.0",
37
- "@aws-sdk/client-sqs": "^3.354.0",
38
- "@aws-sdk/client-ssm": "^3.354.0",
28
+ "@aws-sdk/client-api-gateway": "^3.359.0",
29
+ "@aws-sdk/client-cloudformation": "^3.359.0",
30
+ "@aws-sdk/client-cloudfront": "^3.359.0",
31
+ "@aws-sdk/client-cognito-identity-provider": "^3.359.0",
32
+ "@aws-sdk/client-dynamodb": "^3.359.0",
33
+ "@aws-sdk/client-lambda": "^3.359.0",
34
+ "@aws-sdk/client-s3": "^3.359.0",
35
+ "@aws-sdk/client-secrets-manager": "^3.359.0",
36
+ "@aws-sdk/client-sns": "^3.359.0",
37
+ "@aws-sdk/client-sqs": "^3.359.0",
38
+ "@aws-sdk/client-ssm": "^3.359.0",
39
39
  "aws-jwt-verify": "^3.4.0",
40
40
  "aws-sdk": "^2.1322.0",
41
41
  "busboy": "^1.6.0",
@@ -44,6 +44,7 @@
44
44
  "lodash": "^4.17.21",
45
45
  "node-cache": "^5.1.2",
46
46
  "node-match-path": "^0.6.3",
47
+ "quidproquo-config-aws": "*",
47
48
  "quidproquo-core": "*",
48
49
  "quidproquo-webserver": "*"
49
50
  },