An experimental TypeSpec syntax for Lexicon
56
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add com.atproto.server.defs lexicon

Port server.defs with inviteCode and inviteCodeUse:
- Integer type (int32)
- Boolean type
- Arrays with same-namespace refs
- datetime format

Tests passing (19/19)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

+62
+24
typelex-emitter/test/scenarios/com-atproto-server-defs/input/main.tsp
··· 1 + import "@typelex/emitter"; 2 + 3 + namespace com.atproto.server { 4 + model InviteCode { 5 + code: string; 6 + available: int32; 7 + disabled: boolean; 8 + forAccount: string; 9 + createdBy: string; 10 + 11 + @lexFormat("datetime") 12 + createdAt: string; 13 + 14 + uses: InviteCodeUse[]; 15 + } 16 + 17 + model InviteCodeUse { 18 + @lexFormat("did") 19 + usedBy: string; 20 + 21 + @lexFormat("datetime") 22 + usedAt: string; 23 + } 24 + }
+38
typelex-emitter/test/scenarios/com-atproto-server-defs/output/com/atproto/server/defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.atproto.server.defs", 4 + "defs": { 5 + "inviteCode": { 6 + "type": "object", 7 + "required": [ 8 + "code", 9 + "available", 10 + "disabled", 11 + "forAccount", 12 + "createdBy", 13 + "createdAt", 14 + "uses" 15 + ], 16 + "properties": { 17 + "code": { "type": "string" }, 18 + "available": { "type": "integer" }, 19 + "disabled": { "type": "boolean" }, 20 + "forAccount": { "type": "string" }, 21 + "createdBy": { "type": "string" }, 22 + "createdAt": { "type": "string", "format": "datetime" }, 23 + "uses": { 24 + "type": "array", 25 + "items": { "type": "ref", "ref": "#inviteCodeUse" } 26 + } 27 + } 28 + }, 29 + "inviteCodeUse": { 30 + "type": "object", 31 + "required": ["usedBy", "usedAt"], 32 + "properties": { 33 + "usedBy": { "type": "string", "format": "did" }, 34 + "usedAt": { "type": "string", "format": "datetime" } 35 + } 36 + } 37 + } 38 + }