ProtoRune.Atproto.Repo (proto_rune v0.3.0)

Copy Markdown

Low-level com.atproto.repo operations.

Create, read, update, delete, and list records in a repository. All functions require an authenticated ProtoRune.Atproto.Session.

For common Bluesky actions (posting, liking, reposting) prefer the high-level ProtoRune API, which wraps these calls with the right collections and record schemas.

Summary

Functions

Create a single new repository record. Requires auth, implemented by PDS.

Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.

Get a single record from a repository. Does not require auth.

List a range of records in a repository, matching a specific collection. Does not require auth.

Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.

Upload a blob of binary data to be stored with the account, for later reference in repository records (for example, a profile avatar). Requires auth, implemented by PDS.

Functions

create_record(session, params)

Create a single new repository record. Requires auth, implemented by PDS.

https://docs.bsky.app/docs/api/com-atproto-repo-create-record

delete_record(session, params)

Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.

https://docs.bsky.app/docs/api/com-atproto-repo-delete-record

encode_collection(col)

get_record(session, params)

Get a single record from a repository. Does not require auth.

https://docs.bsky.app/docs/api/com-atproto-repo-get-record

list_records(session, params)

List a range of records in a repository, matching a specific collection. Does not require auth.

https://docs.bsky.app/docs/api/com-atproto-repo-list-records

parse_record_schema(map)

put_record(session, params)

Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.

https://docs.bsky.app/docs/api/com-atproto-repo-put-record

upload_blob(session, data, content_type)

@spec upload_blob(map(), binary(), String.t()) :: {:ok, map()} | {:error, term()}

Upload a blob of binary data to be stored with the account, for later reference in repository records (for example, a profile avatar). Requires auth, implemented by PDS.

Returns {:ok, %{blob: blob}} where blob is a blob reference map suitable for embedding in a record.

https://docs.bsky.app/docs/api/com-atproto-repo-upload-blob

Examples

{:ok, %{blob: blob}} = Repo.upload_blob(session, image_data, "image/png")