atproto tools in zig zat.dev
sdk atproto zig

docs: simplify changelog

+2 -73
+2 -73
CHANGELOG.md
··· 2 2 3 3 ## 0.1.0 4 4 5 - first feature release. adds protocol-level enums for firehose consumption. 6 - 7 - ### what's new 8 - 9 - **sync types** - enums from `com.atproto.sync.subscribeRepos` lexicon: 5 + sync types for firehose consumption: 10 6 11 7 - `CommitAction` - `.create`, `.update`, `.delete` 12 8 - `EventKind` - `.commit`, `.sync`, `.identity`, `.account`, `.info` 13 9 - `AccountStatus` - `.takendown`, `.suspended`, `.deleted`, `.deactivated`, `.desynchronized`, `.throttled` 14 10 15 - these integrate with zig's `std.json` for automatic parsing. define struct fields as enums instead of strings, and get exhaustive switch checking. 16 - 17 - ### migration 18 - 19 - if you're currently doing string comparisons: 20 - 21 - ```zig 22 - // before: string comparisons everywhere 23 - const TapRecord = struct { 24 - action: []const u8, 25 - collection: []const u8, 26 - // ... 27 - }; 28 - 29 - if (mem.eql(u8, rec.action, "create") or mem.eql(u8, rec.action, "update")) { 30 - // handle upsert 31 - } else if (mem.eql(u8, rec.action, "delete")) { 32 - // handle delete 33 - } 34 - ``` 35 - 36 - switch to enum fields: 37 - 38 - ```zig 39 - // after: type-safe enums 40 - const TapRecord = struct { 41 - action: zat.CommitAction, // parsed automatically by std.json 42 - collection: []const u8, 43 - // ... 44 - }; 45 - 46 - switch (rec.action) { 47 - .create, .update => processUpsert(rec), 48 - .delete => processDelete(rec), 49 - } 50 - ``` 51 - 52 - the compiler enforces exhaustive handling - if AT Protocol adds a new action, your code won't compile until you handle it. 53 - 54 - **this is backwards compatible.** your existing code continues to work. adopt the new types when you're ready. 55 - 56 - ### library overview 57 - 58 - zat provides zig primitives for AT Protocol: 59 - 60 - | feature | description | 61 - |---------|-------------| 62 - | string primitives | `Tid`, `Did`, `Handle`, `Nsid`, `Rkey`, `AtUri` - parsing and validation | 63 - | did resolution | resolve `did:plc` and `did:web` to documents | 64 - | handle resolution | resolve handles to DIDs via HTTP well-known | 65 - | xrpc client | call AT Protocol endpoints (queries and procedures) | 66 - | sync types | enums for firehose consumption | 67 - | json helpers | navigate nested json without verbose if-chains | 68 - | jwt verification | verify service auth tokens (ES256, ES256K) | 69 - | multibase/multicodec | decode public keys from DID documents | 70 - 71 - ### install 72 - 73 - ```bash 74 - zig fetch --save https://tangled.sh/zzstoatzz.io/zat/archive/main 75 - ``` 76 - 77 - ```zig 78 - // build.zig 79 - const zat = b.dependency("zat", .{}).module("zat"); 80 - exe.root_module.addImport("zat", zat); 81 - ``` 11 + these integrate with `std.json` for automatic parsing. 82 12 83 13 ## 0.0.2 84 14 ··· 87 17 88 18 ## 0.0.1 89 19 90 - - initial release 91 20 - string primitives (Tid, Did, Handle, Nsid, Rkey, AtUri) 92 21 - did/handle resolution 93 22 - json helpers