ag-common 0.0.703 → 0.0.704

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,6 +1,6 @@
1
1
  import { SESClient } from '@aws-sdk/client-ses';
2
2
  export declare const setSes: (region: string) => SESClient;
3
- export declare const ses: SESClient;
3
+ export declare let ses: SESClient;
4
4
  export interface ISendEmail {
5
5
  to: string;
6
6
  message: string;
@@ -14,6 +14,7 @@ const client_ses_1 = require("@aws-sdk/client-ses");
14
14
  const log_1 = require("../../common/helpers/log");
15
15
  const setSes = (region) => {
16
16
  const raw = new client_ses_1.SESClient({ region });
17
+ exports.ses = raw;
17
18
  return raw;
18
19
  };
19
20
  exports.setSes = setSes;
@@ -23,7 +24,7 @@ const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ to, messa
23
24
  try {
24
25
  const sourceArnRegion = (_b = sourceArn.match(':ses:(.*?):')) === null || _b === void 0 ? void 0 : _b[1];
25
26
  if (sourceArn !== exports.ses.config.region && sourceArnRegion) {
26
- (0, log_1.warn)('ses arn not equal to config regionm changing to:' + sourceArnRegion);
27
+ (0, log_1.warn)('ses arn not equal to config region changing to:' + sourceArnRegion);
27
28
  (0, exports.setSes)(sourceArnRegion);
28
29
  }
29
30
  yield exports.ses.send(new client_ses_1.SendEmailCommand({
@@ -50,6 +51,7 @@ const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ to, messa
50
51
  return {};
51
52
  }
52
53
  catch (e) {
54
+ (0, log_1.warn)('ses send error:' + JSON.stringify(e));
53
55
  return { error: e.toString() };
54
56
  }
55
57
  });
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.703",
2
+ "version": "0.0.704",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",