feat(records)!: record and custom-XRPC ergonomics, Bluesky helpers on client.Bsky #122
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of the v0.7.0 update cycle (wave 4). Custom records, custom XRPC and the facade.
Records
interface IAtProtoRecord { static abstract Nsid Collection { get; } }soclient.GetCollection<T>()no longer restates the NSID.GetCollection<T>(Nsid)remains for dynamic cases and throws ifTdeclares a different collection.createdAtno longer fabricates "now", which a laterPutAsyncwould persist.CreateAsyncfills it only when unset.RecordRef(AtUri Uri, Cid Cid, CommitMeta? Commit)and oneRecordView<T>(AtUri Uri, Cid? Cid, T Value), returned by every write and every typed read. This replaces the three "record reference" shapes and two "typed record" shapes and removes the name clash withEmbed.RecordView.RecordCollection<T>deserializes each record once, notJsonElementthenT. AddFindAsync(returnsnullonRecordNotFound);ExistsAsyncbecomesFindAsync(...) is not null.Custom XRPC and extensibility
QueryAsync<TOut>(Nsid, XrpcParams?, XrpcCallOptions?, ct),ProcedureAsync<TIn, TOut>(…),ProcedureAsync<TIn>(…)andProcedureAsync(Nsid, …). Mark the anonymous-object-parameters overload[RequiresUnreferencedCode], or drop it.IXrpcTransport Transport) so third-party lexicon packages can build sub-clients that share the client's transport and session.EnsureAuthenticatedthrowsXrpcAuthenticationExceptionwith a neutral message, since it also covers OAuth users.Facade
Move the Bluesky helpers to
client.Bskywith typed arguments:PostAsync(RichText, PostOptions?), whereRichTextis a record with implicit conversion fromstring;LikeAsync(StrongRef)/RepostAsync(StrongRef)/FollowAsync(Did);DeleteRecordAsync(AtUri)in place of Unlike/UndoRepost/Unfollow/DeletePost, validating that the collection and rkey are present;UpdateProfileAsync, as reworked in #115.RichTextBuilder.Build()returnsRichText.Take firehose construction off
AtProtoClient: removeCreateFirehoseClient/CreateFirehoseConsumer/RelayUrl. Streaming clients are built independently of a user-session client.Remove the forwarders nothing uses, now covered by
XrpcCallOptions. ConsolidateAtProtoClientBuilderagainst the options and constructors, keeping one obvious construction path.Merge duplicate definitions:
SessionResponsevsSession;CreatePdsAccountRequest⊂CreateAccountRequest;BlobLink/CidLink;TeamMemberProfile→ProfileViewDetailed;GetRecordResponse.CHANGELOG
Breaking changeswith a migration note per moved or renamed member.