@molecule/api-emails-ses 1.0.1 → 1.0.3

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/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-08-04T01:48:05.373Z
6
+ Generated: 2026-08-16T14:04:37.385Z
7
7
  -->
8
8
 
9
9
  # @molecule/api-emails-ses
@@ -30,7 +30,7 @@ setTransport(provider)
30
30
  ## Installation
31
31
 
32
32
  ```bash
33
- npm install @molecule/api-emails-ses @aws-sdk/client-sesv2 @aws-sdk/credential-provider-node @molecule/api-bond @molecule/api-emails @molecule/api-secrets nodemailer
33
+ npm install @molecule/api-emails-ses @aws-sdk/client-sesv2 @aws-sdk/credential-provider-node @molecule/api-bond @molecule/api-emails @molecule/api-proxy-agent @molecule/api-secrets nodemailer
34
34
  npm install -D @types/nodemailer
35
35
  ```
36
36
 
@@ -257,6 +257,7 @@ Peer dependencies:
257
257
  - `@aws-sdk/credential-provider-node`
258
258
  - `@molecule/api-bond`
259
259
  - `@molecule/api-emails`
260
+ - `@molecule/api-proxy-agent`
260
261
  - `@molecule/api-secrets`
261
262
  - `nodemailer`
262
263
 
@@ -279,6 +280,14 @@ Peer dependencies:
279
280
  transport never sets `accepted`/`rejected` (the `@types/nodemailer` typings
280
281
  claiming otherwise are drift); a resolved send means SES accepted the
281
282
  message for every envelope recipient.
283
+ - **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The AWS SDK v3
284
+ builds its own agent and reads no proxy variable, so on a host whose only
285
+ egress path is a proxy every send used to fail with a bare connection
286
+ error. The client now gets a CONNECT-capable agent through its own
287
+ `requestHandler` hook (`@molecule/api-proxy-agent`, resolved against
288
+ `AWS_SES_ENDPOINT` when set and the regional endpoint otherwise, so
289
+ `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
290
+ SDK keeps its default handler. Allowlist `*.amazonaws.com` on the proxy.
282
291
 
283
292
  ## E2E Tests
284
293
 
package/dist/index.d.ts CHANGED
@@ -24,6 +24,14 @@
24
24
  * transport never sets `accepted`/`rejected` (the `@types/nodemailer` typings
25
25
  * claiming otherwise are drift); a resolved send means SES accepted the
26
26
  * message for every envelope recipient.
27
+ * - **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The AWS SDK v3
28
+ * builds its own agent and reads no proxy variable, so on a host whose only
29
+ * egress path is a proxy every send used to fail with a bare connection
30
+ * error. The client now gets a CONNECT-capable agent through its own
31
+ * `requestHandler` hook (`@molecule/api-proxy-agent`, resolved against
32
+ * `AWS_SES_ENDPOINT` when set and the regional endpoint otherwise, so
33
+ * `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
34
+ * SDK keeps its default handler. Allowlist `*.amazonaws.com` on the proxy.
27
35
  *
28
36
  * @example
29
37
  * ```typescript
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -24,6 +24,14 @@
24
24
  * transport never sets `accepted`/`rejected` (the `@types/nodemailer` typings
25
25
  * claiming otherwise are drift); a resolved send means SES accepted the
26
26
  * message for every envelope recipient.
27
+ * - **Runs behind an outbound proxy when `HTTPS_PROXY` is set.** The AWS SDK v3
28
+ * builds its own agent and reads no proxy variable, so on a host whose only
29
+ * egress path is a proxy every send used to fail with a bare connection
30
+ * error. The client now gets a CONNECT-capable agent through its own
31
+ * `requestHandler` hook (`@molecule/api-proxy-agent`, resolved against
32
+ * `AWS_SES_ENDPOINT` when set and the regional endpoint otherwise, so
33
+ * `NO_PROXY` is honoured). With no proxy configured nothing is passed and the
34
+ * SDK keeps its default handler. Allowlist `*.amazonaws.com` on the proxy.
27
35
  *
28
36
  * @example
29
37
  * ```typescript
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,cAAc,CAAA;AACrB,OAAO,EAAoB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAWzF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,QAAO,WAS/B,CAAA;AAkBD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAU,SAAS,YAAY,KAAG,OAAO,CAAC,eAAe,CAsB7E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,cAEtB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS;oBACJ,UAAU,CAAC,eAAe;CAC3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK;oBAPA,UAAU,CAAC,eAAe;CAOd,CAAA"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,cAAc,CAAA;AACrB,OAAO,EAAoB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAErE,OAAO,UAAU,MAAM,YAAY,CAAA;AAGnC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAYzF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,QAAO,WAqB/B,CAAA;AAkBD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAU,SAAS,YAAY,KAAG,OAAO,CAAC,eAAe,CAsB7E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,cAEtB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS;oBACJ,UAAU,CAAC,eAAe;CAC3C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK;oBAPA,UAAU,CAAC,eAAe;CAOd,CAAA"}
package/dist/provider.js CHANGED
@@ -14,6 +14,7 @@ import { SendEmailCommand, SESv2Client } from '@aws-sdk/client-sesv2';
14
14
  import { defaultProvider } from '@aws-sdk/credential-provider-node';
15
15
  import nodemailer from 'nodemailer';
16
16
  import { getLogger } from '@molecule/api-bond';
17
+ import { getProxyAgents } from '@molecule/api-proxy-agent';
17
18
  const logger = getLogger();
18
19
  /**
19
20
  * The lazily-constructed AWS SESv2 client and nodemailer transport. Both are
@@ -43,10 +44,22 @@ let _nodemailerTransport;
43
44
  */
44
45
  export const getSesClient = () => {
45
46
  if (!_ses) {
47
+ const region = process.env.AWS_SES_REGION || 'us-east-1';
48
+ const endpoint = process.env.AWS_SES_ENDPOINT;
49
+ // The AWS SDK v3 builds its own `https.Agent` and reads no proxy variable
50
+ // (`NODE_USE_ENV_PROXY` does not reach it either — it never goes through
51
+ // Node's proxy-aware paths), so on a host whose only egress path is a proxy
52
+ // every send failed with a bare connection error. `requestHandler` takes
53
+ // NodeHttpHandler OPTIONS, so the agent goes in with no `@smithy/*`
54
+ // dependency. Resolved against the endpoint actually in use so a custom
55
+ // endpoint's own NO_PROXY entry is honoured; undefined when nothing is
56
+ // proxied, leaving the SDK's default handler in place.
57
+ const proxy = getProxyAgents(endpoint || `https://email.${region}.amazonaws.com`);
46
58
  _ses = new SESv2Client({
47
- region: process.env.AWS_SES_REGION || 'us-east-1',
59
+ region,
48
60
  credentialDefaultProvider: defaultProvider,
49
- ...(process.env.AWS_SES_ENDPOINT ? { endpoint: process.env.AWS_SES_ENDPOINT } : {}),
61
+ ...(endpoint ? { endpoint } : {}),
62
+ ...(proxy ? { requestHandler: proxy } : {}),
50
63
  });
51
64
  }
52
65
  return _ses;
@@ -1 +1 @@
1
- {"version":3,"file":"provider.js","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,sEAAsE;AACtE,2EAA2E;AAC3E,oCAAoC;AACpC,OAAO,cAAc,CAAA;AACrB,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAG9C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;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AChE,4DAA4D;YAC5D,oEAAoE;YACpE,6BAA6B;YAC7B,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAa;YACpE,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAa;YAC7C,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;SAC1B,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;QAC1C,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAmB;IACtC,QAAQ;CACT,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,QAAQ,EAAE,CAAC,GAA+B,EAAE,EAAE,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;CAC5E,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,SAAS,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-emails-ses",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "AWS SES email provider for molecule.dev.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,14 +31,15 @@
31
31
  "dependencies": {
32
32
  "@aws-sdk/client-sesv2": "3.1098.0",
33
33
  "@aws-sdk/credential-provider-node": "3.972.75",
34
- "nodemailer": "9.0.3"
34
+ "@molecule/api-proxy-agent": "1.1.0",
35
+ "nodemailer": "9.1.1"
35
36
  },
36
37
  "devDependencies": {
37
38
  "@molecule/api-bond": "1.0.1",
38
39
  "@types/node": "26.1.2",
39
40
  "@types/nodemailer": "8.0.1",
40
41
  "typescript": "6.0.3",
41
- "vitest": "4.1.10"
42
+ "vitest": "4.1.11"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "@molecule/api-bond": "^1.0.1",