@devitek/mailsink-cli 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/bin.mjs +2816 -0
- package/dist/mcp-CN6V5uOE.mjs +98 -0
- package/dist/migrate-MfcW916y.mjs +567 -0
- package/dist/migrations/0000_init.sql +330 -0
- package/dist/migrations/0001_fk_indexes_and_simulation_defaults.sql +8 -0
- package/dist/migrations/0002_jobs_failed_at_and_message_indexes.sql +7 -0
- package/dist/migrations/0003_api_log_response_headers.sql +1 -0
- package/dist/migrations/meta/0000_snapshot.json +2431 -0
- package/dist/migrations/meta/0001_snapshot.json +2493 -0
- package/dist/migrations/meta/0002_snapshot.json +2520 -0
- package/dist/migrations/meta/0003_snapshot.json +2526 -0
- package/dist/migrations/meta/_journal.json +34 -0
- package/package.json +68 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Devitek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @devitek/mailsink-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Command line for [Mailsink](https://github.com/Devitek/mailsink), the email sink for staging
|
|
4
|
+
and CI: create an ephemeral workspace, wait for an email, simulate bounces and purge, from a
|
|
5
|
+
shell script or a CI pipeline, without writing HTTP calls.
|
|
6
|
+
|
|
7
|
+
- Built on the TypeScript SDK [`@devitek/mailsink`](https://www.npmjs.com/package/@devitek/mailsink).
|
|
8
|
+
- Versioned with the Mailsink server: `x.y.z` matches server `x.y.z`.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npx @devitek/mailsink-cli --help
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Node 20+. The piloting commands need no database driver. `mailsink migrate` needs
|
|
17
|
+
`drizzle-orm`, `pg` and `@electric-sql/pglite` (optional peer dependencies): run it from the
|
|
18
|
+
Mailsink Docker image, where they are installed.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
export MAILSINK_URL=http://localhost:3000 MAILSINK_ADMIN_KEY=change-me
|
|
24
|
+
|
|
25
|
+
# An ephemeral workspace with a Resend connection; credentials printed as .env lines
|
|
26
|
+
npx @devitek/mailsink-cli workspace create --ephemeral --ttl 1h --connection resend:app >> .env
|
|
27
|
+
|
|
28
|
+
# Wait for an email (exit code 3 on timeout), print it as JSON
|
|
29
|
+
npx @devitek/mailsink-cli wait --to jane@example.com --subject Welcome --timeout 10s --json
|
|
30
|
+
|
|
31
|
+
# Every recipient matching *+bounce@* hard bounces, then back to the defaults
|
|
32
|
+
npx @devitek/mailsink-cli override set --rule '*+bounce@*=hard_bounce'
|
|
33
|
+
npx @devitek/mailsink-cli override reset
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
| Command | Purpose |
|
|
37
|
+
|---|---|
|
|
38
|
+
| `workspace create \| list \| delete` | Manage workspaces (Admin key) |
|
|
39
|
+
| `wait` | Wait for a matching email |
|
|
40
|
+
| `override set \| reset` | Temporary simulation settings |
|
|
41
|
+
| `purge` | Delete the captured messages |
|
|
42
|
+
| `mcp` | MCP server over stdio, proxied to the instance |
|
|
43
|
+
| `migrate` | Apply the database migrations |
|
|
44
|
+
|
|
45
|
+
Settings come from flags or from `MAILSINK_URL`, `MAILSINK_ADMIN_KEY`, `MAILSINK_KEY` and
|
|
46
|
+
`MAILSINK_WORKSPACE`. Exit codes: `0` success, `1` failure, `2` invalid command line, `3`
|
|
47
|
+
`wait` timed out.
|
|
48
|
+
|
|
49
|
+
Full guide: [docs/guides/cli.md](https://github.com/Devitek/mailsink/blob/main/docs/guides/cli.md).
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|