@postalsys/email-ai-tools 2.2.7 → 2.2.8
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/.github/VULNERABILITY_REPORT.yml +66 -66
- package/.github/workflows/release.yaml +4 -3
- package/.github/workflows/test.yaml +26 -34
- package/.ncurc.js +6 -1
- package/.prettierignore +2 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +7 -0
- package/CLAUDE.md +59 -24
- package/eslint.config.js +57 -26
- package/package.json +15 -8
- package/test/commonjs-graph.test.js +21 -0
- package/.eslintrc +0 -22
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
name:
|
|
2
|
-
description:
|
|
1
|
+
name: '@postalsys/email-ai-tools security vulnerability report'
|
|
2
|
+
description: 'Report an exploitable security vulnerability in @postalsys/email-ai-tools'
|
|
3
3
|
|
|
4
4
|
body:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Before reporting, read our
|
|
9
|
+
[Security Policy](https://github.com/postalsys/email-ai-tools/security/policy).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
Reports must demonstrate a credible security impact.
|
|
12
|
+
Technically valid bugs without a realistic attack
|
|
13
|
+
scenario belong in the regular issue tracker.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- type: textarea
|
|
24
|
-
id: attacker
|
|
25
|
-
attributes:
|
|
26
|
-
label: Attacker capabilities
|
|
27
|
-
description: |
|
|
28
|
-
What can an attacker control without already having
|
|
29
|
-
privileged access to the application or its configuration?
|
|
30
|
-
validations:
|
|
31
|
-
required: true
|
|
32
|
-
min_length: 100
|
|
33
|
-
|
|
34
|
-
- type: textarea
|
|
35
|
-
id: exploit
|
|
36
|
-
attributes:
|
|
37
|
-
label: Realistic exploitation scenario
|
|
38
|
-
description: |
|
|
39
|
-
Describe how this can be exploited in a real application.
|
|
40
|
-
Explain the prerequisites and security boundary crossed.
|
|
41
|
-
validations:
|
|
42
|
-
required: true
|
|
43
|
-
min_length: 150
|
|
44
|
-
|
|
45
|
-
- type: textarea
|
|
46
|
-
id: poc
|
|
47
|
-
attributes:
|
|
48
|
-
label: Proof of concept
|
|
49
|
-
description: Provide reproducible steps or working code.
|
|
50
|
-
validations:
|
|
51
|
-
required: true
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: summary
|
|
17
|
+
attributes:
|
|
18
|
+
label: Vulnerability summary
|
|
19
|
+
description: Describe the vulnerability and affected versions.
|
|
20
|
+
validations:
|
|
21
|
+
required: true
|
|
52
22
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
min_length: 100
|
|
23
|
+
- type: textarea
|
|
24
|
+
id: attacker
|
|
25
|
+
attributes:
|
|
26
|
+
label: Attacker capabilities
|
|
27
|
+
description: |
|
|
28
|
+
What can an attacker control without already having
|
|
29
|
+
privileged access to the application or its configuration?
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
min_length: 100
|
|
64
33
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
34
|
+
- type: textarea
|
|
35
|
+
id: exploit
|
|
36
|
+
attributes:
|
|
37
|
+
label: Realistic exploitation scenario
|
|
38
|
+
description: |
|
|
39
|
+
Describe how this can be exploited in a real application.
|
|
40
|
+
Explain the prerequisites and security boundary crossed.
|
|
41
|
+
validations:
|
|
71
42
|
required: true
|
|
72
|
-
|
|
43
|
+
min_length: 150
|
|
44
|
+
|
|
45
|
+
- type: textarea
|
|
46
|
+
id: poc
|
|
47
|
+
attributes:
|
|
48
|
+
label: Proof of concept
|
|
49
|
+
description: Provide reproducible steps or working code.
|
|
50
|
+
validations:
|
|
73
51
|
required: true
|
|
74
|
-
|
|
52
|
+
|
|
53
|
+
- type: textarea
|
|
54
|
+
id: impact
|
|
55
|
+
attributes:
|
|
56
|
+
label: Security impact
|
|
57
|
+
description: |
|
|
58
|
+
What can the attacker achieve? Who is affected?
|
|
59
|
+
Explain why this is a security vulnerability rather
|
|
60
|
+
than an ordinary bug.
|
|
61
|
+
validations:
|
|
75
62
|
required: true
|
|
63
|
+
min_length: 100
|
|
64
|
+
|
|
65
|
+
- type: checkboxes
|
|
66
|
+
id: confirmation
|
|
67
|
+
attributes:
|
|
68
|
+
label: Reporting requirements
|
|
69
|
+
options:
|
|
70
|
+
- label: I have read the Security Policy.
|
|
71
|
+
required: true
|
|
72
|
+
- label: I have verified the finding against a supported version.
|
|
73
|
+
required: true
|
|
74
|
+
- label: I have described a credible attacker-controlled scenario.
|
|
75
|
+
required: true
|
|
@@ -16,7 +16,7 @@ jobs:
|
|
|
16
16
|
outputs:
|
|
17
17
|
release_created: ${{ steps.release.outputs.release_created }}
|
|
18
18
|
steps:
|
|
19
|
-
- uses: googleapis/release-please-action@
|
|
19
|
+
- uses: googleapis/release-please-action@v5
|
|
20
20
|
id: release
|
|
21
21
|
|
|
22
22
|
publish:
|
|
@@ -27,10 +27,11 @@ jobs:
|
|
|
27
27
|
contents: read
|
|
28
28
|
id-token: write
|
|
29
29
|
steps:
|
|
30
|
-
- uses: actions/checkout@
|
|
31
|
-
- uses: actions/setup-node@
|
|
30
|
+
- uses: actions/checkout@v7
|
|
31
|
+
- uses: actions/setup-node@v7
|
|
32
32
|
with:
|
|
33
33
|
node-version: 24
|
|
34
34
|
registry-url: 'https://registry.npmjs.org'
|
|
35
|
+
package-manager-cache: false
|
|
35
36
|
- run: npm ci
|
|
36
37
|
- run: npm publish --provenance --access public
|
|
@@ -1,43 +1,35 @@
|
|
|
1
1
|
name: Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [master]
|
|
8
8
|
|
|
9
9
|
permissions:
|
|
10
|
-
|
|
10
|
+
contents: read
|
|
11
11
|
|
|
12
12
|
concurrency:
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
15
|
|
|
16
16
|
jobs:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- uses: actions/checkout@v6
|
|
37
|
-
- uses: actions/setup-node@v6
|
|
38
|
-
with:
|
|
39
|
-
node-version: 24
|
|
40
|
-
cache: 'npm'
|
|
41
|
-
- run: npm ci
|
|
42
|
-
- run: npm run lint
|
|
43
|
-
- run: npx prettier --check "**/*.{js,json,md}" --ignore-path .prettierignore
|
|
17
|
+
test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
timeout-minutes: 10
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
node-version: [20.x, 22.x, 24.x, latest]
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v7
|
|
25
|
+
- uses: actions/setup-node@v7
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
cache: npm
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm run lint
|
|
31
|
+
- run: npm run format:check
|
|
32
|
+
- run: npm test
|
|
33
|
+
- name: CommonJS dependency graph (require(esm) disabled)
|
|
34
|
+
if: matrix.node-version != '20.x'
|
|
35
|
+
run: npm run test:cjs
|
package/.ncurc.js
CHANGED
|
@@ -13,6 +13,11 @@ module.exports = {
|
|
|
13
13
|
// CommonJS builds are 10.x, 3.x and 2.x
|
|
14
14
|
'htmlparser2',
|
|
15
15
|
'domutils',
|
|
16
|
-
'dom-serializer'
|
|
16
|
+
'dom-serializer',
|
|
17
|
+
// @asamuzakjp/css-color >=4.1.2 pulls in @csstools/* which are pure ESM, so require(jsdom) fails
|
|
18
|
+
// without require(esm) (email-text-tools -> jsdom -> cssstyle -> @asamuzakjp/css-color). Held at
|
|
19
|
+
// 4.1.1 through package.json "overrides"; overrides do not propagate to consumers, EmailEngine
|
|
20
|
+
// carries its own.
|
|
21
|
+
'@asamuzakjp/css-color'
|
|
17
22
|
]
|
|
18
23
|
};
|
package/.prettierignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.2.8](https://github.com/postalsys/email-ai-tools/compare/v2.2.7...v2.2.8) (2026-10-19)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* bump libmime to 5.5.2 and email-text-tools to 2.4.26 ([ee4325c](https://github.com/postalsys/email-ai-tools/commit/ee4325ce083a30c5c43e9efa54ec5e437ffc551c))
|
|
9
|
+
|
|
3
10
|
## [2.2.7](https://github.com/postalsys/email-ai-tools/compare/v2.2.6...v2.2.7) (2026-10-18)
|
|
4
11
|
|
|
5
12
|
|
package/CLAUDE.md
CHANGED
|
@@ -11,7 +11,7 @@ which lost their only consumer when EmailEngine removed its Document Store.
|
|
|
11
11
|
|
|
12
12
|
It is published to npm and consumed by other Postal Systems projects - most
|
|
13
13
|
notably EmailEngine (`../emailengine`), where it ships inside a standalone binary
|
|
14
|
-
built with `@yao-pkg/pkg`. See **
|
|
14
|
+
built with `@yao-pkg/pkg`. See **Platform constraints** below; it constrains
|
|
15
15
|
which dependencies this library may use.
|
|
16
16
|
|
|
17
17
|
## Project Structure
|
|
@@ -55,7 +55,7 @@ which dependencies this library may use.
|
|
|
55
55
|
|
|
56
56
|
## Technology Stack
|
|
57
57
|
|
|
58
|
-
- **Runtime**: Node.js (CI tests on 22 and 24). No build step - plain CommonJS.
|
|
58
|
+
- **Runtime**: Node.js >= 20 (CI tests on 20, 22 and 24). No build step - plain CommonJS.
|
|
59
59
|
- **Module system**: CommonJS (`'use strict';`, `require`/`module.exports`).
|
|
60
60
|
- **HTTP**: `undici` (`fetch` + `Agent`) for all outbound API calls.
|
|
61
61
|
- **Token budgeting**: a character-based estimate in `lib/token-estimate.js` (no
|
|
@@ -68,12 +68,30 @@ which dependencies this library may use.
|
|
|
68
68
|
## Development Commands
|
|
69
69
|
|
|
70
70
|
```
|
|
71
|
-
npm test
|
|
72
|
-
npm run
|
|
73
|
-
npm run
|
|
74
|
-
npm run
|
|
71
|
+
npm test # Run the test suite (node --test test/*.test.js)
|
|
72
|
+
npm run test:cjs # The suite with require(esm) disabled (CommonJS graph guard)
|
|
73
|
+
npm run test:coverage # Run the suite under c8 coverage
|
|
74
|
+
npm run lint # eslint .
|
|
75
|
+
npm run lint:fix # eslint . --fix
|
|
76
|
+
npm run format # prettier --write .
|
|
77
|
+
npm run format:check # prettier --check .
|
|
78
|
+
npm run update # Refresh deps: remove node_modules + lockfile, ncu -u, npm install
|
|
75
79
|
```
|
|
76
80
|
|
|
81
|
+
Run a single test file, or a single test by name:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
node --test test/signals.test.js
|
|
85
|
+
node --test --test-name-pattern="lookalike" test/*.test.js
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
ESLint uses the shared Postal Systems flat config (`eslint.config.js`, kept
|
|
89
|
+
identical across repos except its "Repo-specific" block, which here turns off
|
|
90
|
+
`no-await-in-loop` for the intentional sequential retry loops). Prettier options
|
|
91
|
+
live in `.prettierrc.js`. CI (`.github/workflows/test.yaml`) runs lint,
|
|
92
|
+
format:check and the tests on every matrix job, plus `npm run test:cjs` on 22
|
|
93
|
+
and 24.
|
|
94
|
+
|
|
77
95
|
## Testing
|
|
78
96
|
|
|
79
97
|
- Uses the Node.js native test runner with the native `assert` module.
|
|
@@ -85,29 +103,46 @@ npm run update # Refresh deps: remove node_modules + lockfile, ncu -u, npm in
|
|
|
85
103
|
add tests that require live API credentials or network access.
|
|
86
104
|
- Run `npm test` before committing and make sure it passes.
|
|
87
105
|
|
|
88
|
-
##
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
`
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
## Platform constraints (important)
|
|
107
|
+
|
|
108
|
+
- **Node.js 20 is the minimum supported version** (`engines.node` is
|
|
109
|
+
`>=20.0.0`). Runtime code, tests and tooling must work on Node 20, 22 and 24.
|
|
110
|
+
- **Everything that reaches runtime must be genuinely CommonJS-loadable.**
|
|
111
|
+
EmailEngine bundles this library into a single executable with
|
|
112
|
+
`@yao-pkg/pkg`, which snapshots the CommonJS `require` graph at build time and
|
|
113
|
+
cannot load ES modules. `require()` of this package and of every runtime
|
|
114
|
+
dependency must work with `--no-experimental-require-module`: Node 22+ (and
|
|
115
|
+
20.19) enable require(esm) by default, which hides an ESM-only dependency
|
|
116
|
+
until the pkg binary fails. A CommonJS entry that only wraps a dynamic
|
|
117
|
+
`import()` of ESM code does not count.
|
|
118
|
+
- **How to check:** `npm run test:cjs` runs the whole suite under
|
|
119
|
+
`NODE_OPTIONS=--no-experimental-require-module`; CI runs it on Node 22 and 24.
|
|
120
|
+
`test/commonjs-graph.test.js` requires every runtime dependency, including the
|
|
121
|
+
jsdom-backed `mimeHtml` of `@postalsys/email-text-tools` that the summary code
|
|
122
|
+
never loads, so the guard sees the whole graph.
|
|
123
|
+
- **Pins:** never add or upgrade to an ESM-only dependency. Hold the last
|
|
124
|
+
CommonJS major in `.ncurc.js` (`reject` or `target`) with a one-line comment
|
|
125
|
+
explaining why; `npm run update` honors it. `nanoid`, `htmlparser2` (10.x),
|
|
126
|
+
`domutils` (3.x), `dom-serializer` (2.x) and `@asamuzakjp/css-color` are
|
|
127
|
+
rejected; `undici` is held to the 7.x line by `target` (8.x requires
|
|
128
|
+
Node >= 22.19). When `npm run update` proposes an upgrade, confirm
|
|
129
|
+
`npm run test:cjs` still passes before accepting it.
|
|
130
|
+
- **The jsdom chain:** `@postalsys/email-text-tools` -> jsdom -> cssstyle ->
|
|
131
|
+
`@asamuzakjp/css-color` >=4.1.2 pulls in `@csstools/*` v4, which are pure
|
|
132
|
+
ESM. `package.json` `"overrides"` holds `@asamuzakjp/css-color` at 4.1.1 so
|
|
133
|
+
this repo's own tests and CI exercise the CommonJS graph. Overrides do not
|
|
134
|
+
propagate to consumers: an app installing this package resolves css-color
|
|
135
|
+
itself, and EmailEngine carries its own identical override and `.ncurc.js`
|
|
136
|
+
reject.
|
|
102
137
|
|
|
103
138
|
## Dependency Management
|
|
104
139
|
|
|
105
140
|
- Use `npm run update` to bump dependencies (it runs `ncu -u` then a clean
|
|
106
141
|
install). Respect the `reject` list in `.ncurc.js`.
|
|
107
|
-
- After updating, run `npm test`, `npm run lint`, and
|
|
108
|
-
|
|
109
|
-
- Keep `package.json` versions exact (no `^`/`~` ranges)
|
|
110
|
-
convention and keep `pkg` builds reproducible.
|
|
142
|
+
- After updating, run `npm test`, `npm run lint`, and `npm run format:check`
|
|
143
|
+
to confirm nothing broke.
|
|
144
|
+
- Keep `package.json` versions exact (no `^`/`~` ranges), dev dependencies
|
|
145
|
+
included, to match the existing convention and keep `pkg` builds reproducible.
|
|
111
146
|
|
|
112
147
|
## Versioning & Releases
|
|
113
148
|
|
package/eslint.config.js
CHANGED
|
@@ -1,39 +1,70 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// Shared lint baseline for the Postal Systems / Nodemailer packages: eslint:recommended
|
|
4
|
+
// plus the rules of the retired eslint-config-nodemailer, with formatting left to Prettier.
|
|
5
|
+
// Keep this file identical across repos except for the "Repo-specific" block at the end.
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
7
|
+
const js = require('@eslint/js');
|
|
8
|
+
const prettier = require('eslint-config-prettier');
|
|
9
|
+
const globals = require('globals');
|
|
10
10
|
|
|
11
11
|
module.exports = [
|
|
12
12
|
{
|
|
13
|
-
ignores: ['node_modules/**', '
|
|
13
|
+
ignores: ['node_modules/**', 'coverage/**', 'dist/**']
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
js.configs.recommended,
|
|
16
16
|
{
|
|
17
|
+
files: ['**/*.js', '**/*.cjs'],
|
|
17
18
|
languageOptions: {
|
|
18
|
-
ecmaVersion:
|
|
19
|
-
sourceType: '
|
|
20
|
-
globals: {
|
|
21
|
-
BigInt: 'readonly'
|
|
22
|
-
}
|
|
19
|
+
ecmaVersion: 2022,
|
|
20
|
+
sourceType: 'commonjs',
|
|
21
|
+
globals: { ...globals.node }
|
|
23
22
|
},
|
|
24
23
|
rules: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
'
|
|
24
|
+
'no-await-in-loop': 'error',
|
|
25
|
+
'no-div-regex': 'error',
|
|
26
|
+
strict: ['error', 'global'],
|
|
27
|
+
eqeqeq: 'error',
|
|
28
|
+
'dot-notation': 'error',
|
|
29
|
+
curly: 'error',
|
|
30
|
+
'no-unused-expressions': ['error', { allowShortCircuit: true }],
|
|
31
|
+
'no-unused-vars': ['error', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
|
|
32
|
+
'handle-callback-err': 'error',
|
|
33
|
+
'no-new': 'error',
|
|
34
|
+
'new-cap': 'error',
|
|
35
|
+
'no-eval': 'error',
|
|
36
|
+
'no-invalid-this': 'error',
|
|
37
|
+
radix: ['error', 'always'],
|
|
38
|
+
'no-use-before-define': ['error', 'nofunc'],
|
|
39
|
+
'callback-return': ['error', ['callback', 'cb', 'done']],
|
|
40
|
+
'no-redeclare': 'error',
|
|
41
|
+
'block-scoped-var': 'error',
|
|
42
|
+
'no-sequences': 'error',
|
|
43
|
+
'no-throw-literal': 'error',
|
|
44
|
+
'no-useless-call': 'error',
|
|
45
|
+
'no-useless-concat': 'error',
|
|
46
|
+
'no-void': 'error',
|
|
47
|
+
yoda: 'error',
|
|
48
|
+
'no-var': 'error',
|
|
49
|
+
'no-bitwise': 'error',
|
|
50
|
+
'no-lonely-if': 'error',
|
|
51
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
52
|
+
'prefer-arrow-callback': 'error',
|
|
53
|
+
'object-shorthand': 'error',
|
|
54
|
+
'prefer-spread': 'error',
|
|
55
|
+
'no-prototype-builtins': 'off'
|
|
37
56
|
}
|
|
38
|
-
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
files: ['test/**'],
|
|
60
|
+
languageOptions: {
|
|
61
|
+
globals: { ...globals.node, ...globals.mocha }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
// Repo-specific: overrides go here, each with a one-line reason
|
|
65
|
+
{
|
|
66
|
+
// Retry loops (429 backoff in api-request.js, refused-parameter retry in generate-summary.js) await sequentially on purpose, 4 sites
|
|
67
|
+
rules: { 'no-await-in-loop': 'off' }
|
|
68
|
+
},
|
|
69
|
+
prettier
|
|
39
70
|
];
|
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@postalsys/email-ai-tools",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.8",
|
|
4
4
|
"description": "Summarize and risk-score email messages with an OpenAI-compatible chat model",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "node --test test/*.test.js",
|
|
8
|
+
"test:coverage": "c8 npm test",
|
|
9
|
+
"lint": "eslint .",
|
|
10
|
+
"lint:fix": "eslint . --fix",
|
|
11
|
+
"format": "prettier --write .",
|
|
12
|
+
"format:check": "prettier --check .",
|
|
8
13
|
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install",
|
|
9
|
-
"
|
|
10
|
-
"lint": "eslint ."
|
|
14
|
+
"test:cjs": "NODE_OPTIONS=--no-experimental-require-module npm test"
|
|
11
15
|
},
|
|
12
16
|
"repository": {
|
|
13
17
|
"type": "git",
|
|
@@ -21,23 +25,26 @@
|
|
|
21
25
|
},
|
|
22
26
|
"homepage": "https://github.com/postalsys/email-ai-tools#readme",
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"@eslint/eslintrc": "3.3.7",
|
|
25
28
|
"@eslint/js": "10.0.1",
|
|
29
|
+
"c8": "12.0.0",
|
|
26
30
|
"eslint": "10.13.0",
|
|
27
|
-
"eslint-config-nodemailer": "1.2.0",
|
|
28
31
|
"eslint-config-prettier": "10.1.8",
|
|
29
|
-
"
|
|
32
|
+
"globals": "17.13.0",
|
|
33
|
+
"mailparser": "3.9.47",
|
|
30
34
|
"prettier": "3.9.10"
|
|
31
35
|
},
|
|
32
36
|
"dependencies": {
|
|
33
|
-
"@postalsys/email-text-tools": "2.4.
|
|
37
|
+
"@postalsys/email-text-tools": "2.4.26",
|
|
34
38
|
"dom-serializer": "2.0.0",
|
|
35
39
|
"domutils": "3.2.2",
|
|
36
40
|
"htmlparser2": "10.1.0",
|
|
37
|
-
"libmime": "5.5.
|
|
41
|
+
"libmime": "5.5.2",
|
|
38
42
|
"tldts": "7.4.18",
|
|
39
43
|
"undici": "7.30.1"
|
|
40
44
|
},
|
|
45
|
+
"overrides": {
|
|
46
|
+
"@asamuzakjp/css-color": "4.1.1"
|
|
47
|
+
},
|
|
41
48
|
"engines": {
|
|
42
49
|
"node": ">=20.0.0"
|
|
43
50
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Loads every runtime dependency through require(), including the jsdom-backed mimeHtml getter of
|
|
4
|
+
// email-text-tools that the summary code never reaches. Under `npm run test:cjs` (require(esm)
|
|
5
|
+
// disabled) this fails as soon as anything in the runtime graph is ESM-only.
|
|
6
|
+
|
|
7
|
+
const { describe, it } = require('node:test');
|
|
8
|
+
const assert = require('node:assert/strict');
|
|
9
|
+
const { dependencies } = require('../package.json');
|
|
10
|
+
|
|
11
|
+
describe('CommonJS dependency graph', () => {
|
|
12
|
+
for (const name of Object.keys(dependencies)) {
|
|
13
|
+
it(`require('${name}') loads`, () => {
|
|
14
|
+
assert.ok(require(name));
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
it('loads the jsdom-backed mimeHtml from email-text-tools', () => {
|
|
19
|
+
assert.equal(typeof require('@postalsys/email-text-tools').mimeHtml, 'function');
|
|
20
|
+
});
|
|
21
|
+
});
|
package/.eslintrc
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": {
|
|
3
|
-
"indent": 0,
|
|
4
|
-
"quotes": 0,
|
|
5
|
-
"linebreak-style": 0,
|
|
6
|
-
"semi": 0,
|
|
7
|
-
"comma-dangle": 0,
|
|
8
|
-
"comma-style": 0,
|
|
9
|
-
"arrow-body-style": 0,
|
|
10
|
-
"arrow-parens": 0,
|
|
11
|
-
"no-await-in-loop": 0,
|
|
12
|
-
"require-atomic-updates": 0
|
|
13
|
-
},
|
|
14
|
-
"globals": {
|
|
15
|
-
"BigInt": true
|
|
16
|
-
},
|
|
17
|
-
"extends": ["nodemailer", "prettier"],
|
|
18
|
-
"parserOptions": {
|
|
19
|
-
"ecmaVersion": 2020,
|
|
20
|
-
"sourceType": "script"
|
|
21
|
-
}
|
|
22
|
-
}
|