|
1 | 1 | # @coreyburns/node-fdd |
2 | 2 |
|
3 | | -The official CLI toolchain for composing, packing, and cryptographically signing Formatted Data Document (`.fdd`) layouts natively from your Node endpoint. |
4 | | - |
5 | | -The `.fdd` MIME type is a zero-JS interactive document specification meant to replace visual-first static PDFs natively by routing HTML rendering via declarative logic rules binding Cryptographic VC Payloads directly to your canvas. |
| 3 | +Official CLI & API toolchain for the OpenFDD (`.fdd`) format — zero-dependency, Node 18+. |
6 | 4 |
|
7 | 5 | --- |
8 | 6 |
|
9 | | -## ⚡ Global Installation |
| 7 | +## Installation |
| 8 | + |
10 | 9 | ```bash |
11 | 10 | npm install -g @coreyburns/node-fdd |
12 | 11 | ``` |
13 | 12 |
|
14 | | -## 🛠 Operation Workflows |
15 | | -The OpenFDD compiler requires you to merge standard HTML Templates with a Cryptographic Data Payload into a secure FDD Container. |
| 13 | +--- |
16 | 14 |
|
17 | | -### 1. Generating & Packing an `.fdd` Context |
18 | | -Wrap your immutable schema, an optional mutable tracking schema (like `user-notes.json`), and the presentation layout using `fdd-pack`. |
| 15 | +## CLI Commands |
19 | 16 |
|
20 | 17 | ```bash |
21 | | -fdd-pack template.html fdd-data.json user-notes.json output.fdd |
| 18 | +# Generate an Ed25519 keypair |
| 19 | +fdd-identity keygen [./outDir] |
| 20 | + |
| 21 | +# Generate a did.json for /.well-known/did.json hosting |
| 22 | +fdd-identity did <public.pem> <domain> |
| 23 | + |
| 24 | +# Pack + sign an .fdd container in one step |
| 25 | +fdd-sign pack <template.html> <data.json> <private.pem> <did:web:domain> [output.fdd] |
| 26 | + |
| 27 | +# Extract structured data from an .fdd (no OCR, no DOM) |
| 28 | +fdd-sign parse <file.fdd> |
| 29 | + |
| 30 | +# Verify an .fdd signature against its did:web issuer |
| 31 | +fdd-sign verify <file.fdd> |
| 32 | + |
| 33 | +# Legacy: sign a raw JSON file only |
| 34 | +fdd-sign sign <data.json> <private.pem> [output.json] |
| 35 | + |
| 36 | +# Legacy: pack without signing |
| 37 | +fdd-pack <template.html> <data.json> [mutable.json] [output.fdd] |
22 | 38 | ``` |
23 | 39 |
|
24 | | -### 2. Cryptographic Binding (Issuing) |
25 | | -Officially binding a document enforces an Ed25519 trace mathematically tied to the JSON tree to ensure massive Verifiable Credential integrity mathematically. |
| 40 | +--- |
26 | 41 |
|
27 | | -```bash |
28 | | -fdd-sign path/to/privateKey.pem fdd-data.json |
| 42 | +## API — did:web Workflow |
| 43 | + |
| 44 | +```javascript |
| 45 | +import { generateIdentity, createDidDocument } from '@coreyburns/node-fdd/identity'; |
| 46 | +import { signFdd, parse, verify } from '@coreyburns/node-fdd'; |
| 47 | + |
| 48 | +// 1. One-time setup |
| 49 | +const identity = generateIdentity(); |
| 50 | +const didDoc = createDidDocument(identity.publicKeyBase64, 'bank.com'); |
| 51 | +// Host didDoc at https://bank.com/.well-known/did.json |
| 52 | + |
| 53 | +// 2. Issue a document |
| 54 | +const fddString = signFdd(transactionData, htmlTemplate, identity.privateKeyPem, 'did:web:bank.com'); |
| 55 | + |
| 56 | +// 3. Consume (recipient server) |
| 57 | +const { valid, issuer } = await verify(fddString); |
| 58 | +if (valid) { |
| 59 | + const { vc, mutable } = parse(fddString); |
| 60 | +} |
29 | 61 | ``` |
30 | 62 |
|
31 | | -## 🌍 Ecosystem Links |
32 | | -* [OpenFDD Specification (GitHub)](https://github.com/Spuds0588/open-fdd) |
33 | | -* [Read the Web Manifesto](https://spuds0588.github.io/open-fdd/site/index.html) |
| 63 | +--- |
| 64 | + |
| 65 | +## Ecosystem Links |
| 66 | + |
| 67 | +- [OpenFDD Specification (GitHub)](https://github.com/Spuds0588/open-fdd) |
| 68 | +- [Web Manifesto](https://spuds0588.github.io/open-fdd/site/index.html) |
0 commit comments