@yozz.app/smtp 0.1.1 → 0.1.2

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
@@ -8,7 +8,8 @@ pnpm add @yozz.app/smtp
8
8
 
9
9
  ## The seam
10
10
 
11
- `@yozz.app/smtp` speaks SMTP over any `ByteDuplex` from `@yozz.app/tls`. It knows replies, EHLO
11
+ `@yozz.app/smtp` speaks SMTP over any `ByteDuplex` (`{ read, write }`, a type it declares itself; a
12
+ `@yozz.app/tls` connection satisfies it). No runtime dependencies. It knows replies, EHLO
12
13
  keywords, AUTH PLAIN / LOGIN, the MAIL / RCPT / DATA sequence and dot-stuffing. It **never knows**
13
14
  TLS, certificates or the vault. STARTTLS is not spoken: the transport is already TLS (465).
14
15
 
package/dist/index.d.mts CHANGED
@@ -1,5 +1,14 @@
1
- import { ByteDuplex } from "@yozz.app/tls";
2
-
1
+ //#region src/transport.d.ts
2
+ /**
3
+ * What this client needs from a transport: bytes in, bytes out. Declared here rather than
4
+ * imported from `@yozz.app/tls` so the package has no runtime dependency at all; it is the same
5
+ * two-method shape, so a `TlsConnection` satisfies it structurally.
6
+ */
7
+ type ByteDuplex = {
8
+ readonly read: () => Promise<Uint8Array | null>;
9
+ readonly write: (bytes: Uint8Array) => Promise<void>;
10
+ };
11
+ //#endregion
3
12
  //#region src/reply.d.ts
4
13
  type SmtpReply = {
5
14
  readonly code: number; /** One entry per line, the `NNN-` / `NNN ` prefix removed. */
@@ -86,4 +95,4 @@ declare const formatMailbox: ({
86
95
  declare const formatDate: (date: Date) => string;
87
96
  declare const buildMessage: (input: MessageInput) => Uint8Array;
88
97
  //#endregion
89
- export { type MessageAttachment, type MessageInput, type SmtpCapabilities, type SmtpClient, type SmtpEnvelope, type SmtpFailure, type SmtpReply, type SmtpResult, buildMessage, createSmtpClient, dotStuff, encodeHeaderText, formatDate, formatMailbox };
98
+ export { type ByteDuplex, type MessageAttachment, type MessageInput, type SmtpCapabilities, type SmtpClient, type SmtpEnvelope, type SmtpFailure, type SmtpReply, type SmtpResult, buildMessage, createSmtpClient, dotStuff, encodeHeaderText, formatDate, formatMailbox };
package/dist/index.mjs CHANGED
@@ -94,6 +94,11 @@ const readReply = async (reader) => {
94
94
  };
95
95
  //#endregion
96
96
  //#region src/client.ts
97
+ /**
98
+ * SMTP client over a `ByteDuplex` (RFC 5321 + AUTH, RFC 4954). Implicit TLS is the transport's
99
+ * business; this never sees a certificate or a password store. One command in flight at a time,
100
+ * which is all SMTP allows without PIPELINING.
101
+ */
97
102
  const encoder$1 = new TextEncoder();
98
103
  const base64$1 = (bytes) => {
99
104
  let binary = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yozz.app/smtp",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Transport-agnostic SMTP client core plus an RFC 5322 message builder.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/fishballapp/yozz",
@@ -28,13 +28,11 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
- "dependencies": {
32
- "@yozz.app/tls": "0.1.1"
33
- },
34
31
  "devDependencies": {
35
32
  "@types/node": "^24.0.0",
36
33
  "tsdown": "^0.22.3",
37
- "@yozz.app/x509": "0.1.1"
34
+ "@yozz.app/tls": "0.1.2",
35
+ "@yozz.app/x509": "0.1.2"
38
36
  },
39
37
  "scripts": {
40
38
  "build": "tsdown src/index.ts --format esm --dts",