@intx/mime 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 ADDED
@@ -0,0 +1,32 @@
1
+ # @intx/mime
2
+
3
+ RFC 2822 message assembly and parsing. Builds multipart/signed
4
+ messages with PGP detached signatures, parses inbound wire bytes
5
+ back into structured parts, and owns the JMAP-shaped envelope the
6
+ rest of the mail pipeline depends on.
7
+
8
+ Consumed by `@intx/mail-memory` (in-process transport),
9
+ `@intx/storage-isogit` (mail audit log), and `@intx/harness`
10
+ (sidecar mail-tool plumbing).
11
+
12
+ ```ts
13
+ import {
14
+ parseHeaderSection,
15
+ parseMultipart,
16
+ extractBoundary,
17
+ } from "@intx/mime";
18
+
19
+ const { headers, bodyOffset } = parseHeaderSection(rawMessageBytes);
20
+ const contentType = headers.get("content-type");
21
+ if (contentType === undefined) throw new Error("missing Content-Type");
22
+ const boundary = extractBoundary(contentType);
23
+ if (boundary === undefined) throw new Error("missing boundary parameter");
24
+ const parts = parseMultipart(rawMessageBytes.subarray(bodyOffset), boundary);
25
+ ```
26
+
27
+ For outbound mail the builder layer is the entry point:
28
+ `createOutboundMessage` produces a structured envelope,
29
+ `assembleSignedContent` canonicalises the signed body, and
30
+ `assembleMessage` joins the signed content with a detached
31
+ signature from `createDetachedSignatureFromProvider` into wire
32
+ bytes.
package/package.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "@intx/mime",
3
+ "version": "0.1.2",
4
+ "license": "LGPL-2.1-only",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./src/index.ts",
9
+ "default": "./src/index.ts"
10
+ }
11
+ },
12
+ "dependencies": {
13
+ "@intx/crypto-node": "0.0.0",
14
+ "@intx/types": "0.0.0",
15
+ "arktype": "^2.1.29"
16
+ }
17
+ }