ag-common 0.0.701 → 0.0.703

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,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.sendEmails = exports.sendEmail = exports.ses = exports.setSes = void 0;
13
13
  const client_ses_1 = require("@aws-sdk/client-ses");
14
+ const log_1 = require("../../common/helpers/log");
14
15
  const setSes = (region) => {
15
16
  const raw = new client_ses_1.SESClient({ region });
16
17
  return raw;
@@ -18,7 +19,13 @@ const setSes = (region) => {
18
19
  exports.setSes = setSes;
19
20
  exports.ses = (0, exports.setSes)('ap-southeast-2');
20
21
  const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ to, message, subject, sourceArn, from, }) {
22
+ var _b;
21
23
  try {
24
+ const sourceArnRegion = (_b = sourceArn.match(':ses:(.*?):')) === null || _b === void 0 ? void 0 : _b[1];
25
+ if (sourceArn !== exports.ses.config.region && sourceArnRegion) {
26
+ (0, log_1.warn)('ses arn not equal to config regionm changing to:' + sourceArnRegion);
27
+ (0, exports.setSes)(sourceArnRegion);
28
+ }
22
29
  yield exports.ses.send(new client_ses_1.SendEmailCommand({
23
30
  Destination: {
24
31
  CcAddresses: [],
@@ -10,6 +10,7 @@ const Base = styled_1.default.div `
10
10
  padding: 0.5rem;
11
11
  border: solid 1px black;
12
12
  background-color: white;
13
+ color: black;
13
14
  `;
14
15
  const Title = styled_1.default.div `
15
16
  font-weight: bold;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.701",
2
+ "version": "0.0.703",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",