Something went wrong. Try again.
Generator for AT Protocol Lexicon RPC Java Clients
Something went wrong. Try again.
Files
- Java 100%
README.md
AT Proto Lexicon Client Generator #
A client generator for AT Proto Lexicon queries, procedures, and subscriptions for Java.
Under Development #
While this is in a usable state, some things don't work. Subscriptions aren't implemented and a lot of validation isn't implemented.
There are many expected (breaking) changes to come:
Incomplete list of things that will change:
- Anything with TODO
- Value types when they preview in JDK 28
- To the above point,
enable-previewis used and probably shouldn't be for a library. Depending on when it looks like features will land, preview features usage might be removed until they're ready.
Usage #
Example:
try (HttpClient http = HttpClient.newHttpClient()) {
ATClient at = new ATStandardHttpClient(http, new ATInMemoryCredentialStore(
new ATStandardHttpAuth(http,
URI.create("https://my-app.com"), URI.create("https://my-app.com/callback"),
AuthFullApp.PERMISSION_SET, new DID("did:web:api.bsky.app"))));
var follow = new PDSRecordWithKey<>(
new TIDKey(new TID("time")),
new Follow(ATDateTime.now(), new DID("did:blah"),
Def.of(new StrongRef(new ATURI("at://blah"), CID.of("cid")))));
CreateRecord.Output out = at.as(new ATHandle("zackrbrown.com"))
.exec(CreateRecord.procedure(new CreateRecord.InputBody(
new ATHandle("zackrbrown.com"),
follow.record(),
Def.of(CID.of("abcd")),
Def.of(follow.key()),
new NSID("com.blah"),
Def.of(Boolean.FALSE))));
} catch (NoSuchAlgorithmException | ExecutionException | InterruptedException e) {
throw new RuntimeException(e);
}
Testing #
Right now there's a single JUnit test that generates AT Proto and Bluesky lexicons.