ac-ses 2.0.2 → 2.0.4

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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,29 @@
1
+
2
+ ## [2.0.4](https://github.com/admiralcloud/ac-ses/compare/v2.0.3..v2.0.4) (2026-01-19 11:51:37)
3
+
4
+
5
+ ### Bug Fix
6
+
7
+ * **App:** Package updates | MP | [9efed10c6f87f63e7b1dbb612a380dc795205b96](https://github.com/admiralcloud/ac-ses/commit/9efed10c6f87f63e7b1dbb612a380dc795205b96)
8
+ Package updates
9
+ Related issues:
10
+
11
+ ## [2.0.3](https://github.com/admiralcloud/ac-ses/compare/v2.0.2..v2.0.3) (2025-05-05 17:49:00)
12
+
13
+
14
+ ### Bug Fix
15
+
16
+ * **App:** Use ACError class | MP | [43ab8d460541c151764df858067b955af81bd51c](https://github.com/admiralcloud/ac-ses/commit/43ab8d460541c151764df858067b955af81bd51c)
17
+ Use ACError class
18
+ Related issues:
19
+ ### Chores
20
+
21
+ * **App:** Updated packages | MP | [fedcbc13d147597e4e1a36f63a17822583c0bfbb](https://github.com/admiralcloud/ac-ses/commit/fedcbc13d147597e4e1a36f63a17822583c0bfbb)
22
+ Updated packages
23
+ Related issues:
24
+ * **App:** Updated packages | MP | [0267ba27664bb11e59413a1d1effce5b1db916e4](https://github.com/admiralcloud/ac-ses/commit/0267ba27664bb11e59413a1d1effce5b1db916e4)
25
+ Updated packages
26
+ Related issues:
1
27
  <a name="2.0.2"></a>
2
28
 
3
29
  ## [2.0.2](https://github.com/admiralcloud/ac-ses/compare/v2.0.1..v2.0.2) (2024-09-16 08:11:27)
package/index.js CHANGED
@@ -5,6 +5,7 @@ const quotedPrintable = require('quoted-printable')
5
5
  const utf8 = require('utf8')
6
6
 
7
7
  const { SESv2Client, SendEmailCommand } = require("@aws-sdk/client-sesv2")
8
+ const { ACError } = require('ac-custom-error')
8
9
 
9
10
  const acses = () => {
10
11
  let ses
@@ -45,8 +46,8 @@ const acses = () => {
45
46
  * @param {*} params
46
47
  */
47
48
  const prepareEmailAddress = ({ address, name }) => {
48
- if (!address) throw new Error({ message: 'ACSES.prepareEmailAddress - address_required' })
49
- if (!_.isString(address)) throw new Error({ message: 'ACSES.prepareEmailAddress - address_mustBeAString' })
49
+ if (!address) throw new ACError('ACSES.prepareEmailAddress - address_required')
50
+ if (!_.isString(address)) throw new ACError('ACSES.prepareEmailAddress - address_mustBeAString')
50
51
  let email = name ? `${name} <${address}>` : address
51
52
  return email
52
53
  }
@@ -70,7 +71,7 @@ const acses = () => {
70
71
  *
71
72
  */
72
73
  const sendEmail = async(params) => {
73
- if (!_.isObject(ses)) throw new Error('pleaseUseInitBeforeSendingEmail')
74
+ if (!_.isObject(ses)) throw new ACError('pleaseUseInitBeforeSendingEmail')
74
75
  if (!_.get(params, 'from') && defaultSender) _.set(params, 'from', defaultSender)
75
76
  const fieldCheck = [
76
77
  { field: 'from', type: _.isPlainObject, required: true },
@@ -87,8 +88,8 @@ const acses = () => {
87
88
  ]
88
89
 
89
90
  _.some(fieldCheck, (field) => {
90
- if (field.required && !_.has(params, field.field)) throw new Error(field.field + '_required')
91
- if (_.get(params, field.field) && !field.type(_.get(params, field.field))) throw new Error(field.field + '_typeInvalid')
91
+ if (field.required && !_.has(params, field.field)) throw new ACError(field.field + '_required')
92
+ if (_.get(params, field.field) && !field.type(_.get(params, field.field))) throw new ACError(field.field + '_typeInvalid')
92
93
  })
93
94
 
94
95
  const boundaryMixed = uuidV4()
@@ -0,0 +1,7 @@
1
+ {
2
+ "reporterEnabled": "spec,mocha-junit-reporter",
3
+ "mochaJunitReporterReporterOptions": {
4
+ "mochaFile": "./report.xml",
5
+ "suiteName": "Notification Services"
6
+ }
7
+ }
package/package.json CHANGED
@@ -4,27 +4,30 @@
4
4
  "license": "MIT",
5
5
  "repository": "admiralcloud/ac-ses",
6
6
  "homepage": "https://www.admiralcloud.com",
7
- "version": "2.0.2",
7
+ "version": "2.0.4",
8
8
  "dependencies": {
9
- "@aws-sdk/client-sesv2": "^3.651.1",
9
+ "@aws-sdk/client-sesv2": "^3.971.0",
10
+ "ac-custom-error": "^1.0.5",
10
11
  "lodash": "^4.17.21",
11
12
  "quoted-printable": "^1.0.1",
12
13
  "utf8": "^3.0.0",
13
- "uuid": "^10.x"
14
+ "uuid": "^11.x"
14
15
  },
15
16
  "devDependencies": {
16
- "ac-semantic-release": "^0.4.2",
17
+ "ac-semantic-release": "^0.4.8",
17
18
  "chai": "^4.5.0",
18
19
  "eslint": "9.x",
19
20
  "expect": "^29.7.0",
20
- "mocha": "^10.7.3",
21
- "mocha-jenkins-reporter": "0.4.8"
21
+ "mocha": "^11.7.5",
22
+ "mocha-junit-reporter": "^2.2.1",
23
+ "mocha-multi-reporters": "^1.5.1"
22
24
  },
23
25
  "scripts": {
24
26
  "test": "mocha --reporter spec",
25
- "test-jenkins": "JUNIT_REPORT_PATH=./report.xml mocha --colors --reporter mocha-jenkins-reporter --reporter-options junit_report_name='AC-SES'"
27
+ "test-jenkins": "JUNIT_REPORT_PATH=./report.xml mocha --colors --reporter mocha-multi-reporters --reporter-options configFile=mocha-reporter-config.json"
26
28
  },
27
29
  "engines": {
28
- "node": ">=16.0.0"
29
- }
30
+ "node": ">=20.0.0"
31
+ },
32
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
30
33
  }