+2
-2
packages/lexicons/lex-cli/README.md
+2
-2
packages/lexicons/lex-cli/README.md
···
21
});
22
```
23
24
+
then run the tool (it automatically finds `lex.config.js` or `lex.config.ts`):
25
26
```
27
npm exec lex-cli generate
···
138
type: 'atproto',
139
mode: 'authority',
140
authority: 'atproto-lexicons.bsky.social',
141
+
pattern: ['com.atproto.*'], // optional
142
},
143
],
144
},
+1
-1
packages/lexicons/lexicon-resolver/README.md
+1
-1
packages/lexicons/lexicon-resolver/README.md
+9
-3
packages/lexicons/lexicons/README.md
+9
-3
packages/lexicons/lexicons/README.md
···
42
isNsid('com.atproto.repo.createRecord'); // true
43
44
// CID format (content identifiers)
45
-
isCid('bafyreib2rxk3rybk3aobmv5cjuql3setrnhyfnxq...'); // true
46
47
// TID format (timestamp identifiers)
48
isTid('3jzfcijpj2z2a'); // true
···
71
72
// parse any AT URI (handle or DID authority)
73
const uri = parseResourceUri('at://alice.bsky.social/app.bsky.feed.post/123');
74
-
// -> { repo: 'alice.bsky.social', collection: 'app.bsky.feed.post', rkey: '123' }
75
76
// parse canonical AT URI (DID authority only)
77
const canonical = parseCanonicalResourceUri('at://did:plc:123/app.bsky.feed.post/abc');
78
-
// -> { repo: 'did:plc:123', collection: 'app.bsky.feed.post', rkey: 'abc' }
79
```
80
81
### branded types
···
42
isNsid('com.atproto.repo.createRecord'); // true
43
44
// CID format (content identifiers)
45
+
isCid('bafyreigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi'); // true
46
47
// TID format (timestamp identifiers)
48
isTid('3jzfcijpj2z2a'); // true
···
71
72
// parse any AT URI (handle or DID authority)
73
const uri = parseResourceUri('at://alice.bsky.social/app.bsky.feed.post/123');
74
+
if (uri.ok) {
75
+
console.log(uri.value.repo); // 'alice.bsky.social'
76
+
console.log(uri.value.collection); // 'app.bsky.feed.post'
77
+
console.log(uri.value.rkey); // '123'
78
+
}
79
80
// parse canonical AT URI (DID authority only)
81
const canonical = parseCanonicalResourceUri('at://did:plc:123/app.bsky.feed.post/abc');
82
+
if (canonical.ok) {
83
+
console.log(canonical.value.repo); // 'did:plc:123'
84
+
}
85
```
86
87
### branded types