atproto_space
Sans-io types, JSON codecs, and XRPC URL/body builders for
com.atproto.space.* lifecycle, record CRUD, and delegation token calls.
Types
Record pointer returned by createRecord and putRecord.
pub type CreatedRecord {
CreatedRecord(uri: uri.SpaceRecordUri, cid: String)
}
Constructors
-
CreatedRecord(uri: uri.SpaceRecordUri, cid: String)
Short-lived delegation token returned by getDelegationToken.
pub type DelegationToken {
DelegationToken(token: String)
}
Constructors
-
DelegationToken(token: String)
Options for com.atproto.space.listRecords.
pub type ListRecordsOptions {
ListRecordsOptions(
collection: option.Option(String),
limit: option.Option(Int),
reverse: Bool,
exclude_values: Bool,
)
}
Constructors
-
ListRecordsOptions( collection: option.Option(String), limit: option.Option(Int), reverse: Bool, exclude_values: Bool, )
Access-control policy for a space.
pub type Policy {
PersonalSpace
MemberSpace(members: List(did.Did))
ManagedSpace(manager: String)
UnknownPolicy(type_: String, raw: dynamic.Dynamic)
}
Constructors
-
PersonalSpaceOwner-only access (
com.atproto.personalspace.policy). -
MemberSpace(members: List(did.Did))Group access governed by a member list (
com.atproto.memberspace.policy). -
ManagedSpace(manager: String)Access delegated to a managing service (
com.atproto.managedspace.policy). -
UnknownPolicy(type_: String, raw: dynamic.Dynamic)Fallback for policy
$types not modeled here.rawkeeps the decoded JSON object so unknown fields survive round-trips and can still be decoded.
Space metadata returned by createSpace, getSpace, and updateSpace.
pub type SpaceInfo {
SpaceInfo(space: uri.SpaceUri, policy: Policy)
}
Constructors
-
SpaceInfo(space: uri.SpaceUri, policy: Policy)
Values
pub fn create_record_body(
space: uri.SpaceUri,
repo: did.Did,
collection: String,
rkey: option.Option(String),
record: json.Json,
) -> json.Json
pub fn create_record_url(pds: String) -> String
pub fn create_space_body(
space_type: String,
skey: option.Option(String),
policy: Policy,
) -> json.Json
pub fn create_space_url(pds: String) -> String
pub fn created_record_decoder() -> decode.Decoder(CreatedRecord)
Decode a CreatedRecord response ({uri, cid}).
pub fn default_list_options() -> ListRecordsOptions
Default listRecords options: all collections, server default page limit,
forward order, values included. Update fields with
ListRecordsOptions(..default_list_options(), ...).
pub fn delegation_token_decoder() -> decode.Decoder(
DelegationToken,
)
Decode a DelegationToken response ({token}).
pub fn delete_record_body(
target: uri.SpaceRecordUri,
) -> json.Json
pub fn delete_record_url(pds: String) -> String
pub fn delete_space_body(space: uri.SpaceUri) -> json.Json
pub fn delete_space_url(pds: String) -> String
pub fn encode_policy(policy: Policy) -> json.Json
Encode a Policy to its lexicon JSON union representation.
pub fn get_delegation_token_url(
pds: String,
space: uri.SpaceUri,
aud: option.Option(String),
) -> String
pub fn get_record_url(
pds: String,
target: uri.SpaceRecordUri,
) -> String
pub fn get_space_url(pds: String, space: uri.SpaceUri) -> String
pub fn list_page_decoder(
row_decoder: decode.Decoder(a),
) -> decode.Decoder(#(List(a), option.Option(String)))
Decode one page of a listRecords response ({records, cursor?}).
pub fn list_records_url(
pds: String,
space: uri.SpaceUri,
repo: did.Did,
options: ListRecordsOptions,
cursor: option.Option(String),
) -> String
pub const managed_space_policy_type: String
pub const member_space_policy_type: String
pub const personal_space_policy_type: String
pub fn policy_decoder() -> decode.Decoder(Policy)
Decode a space policy union object by $type (accepting both bare NSIDs
and #main refs).
pub fn put_record_body(
target: uri.SpaceRecordUri,
record: json.Json,
) -> json.Json
pub fn put_record_url(pds: String) -> String
pub fn space_info_decoder() -> decode.Decoder(SpaceInfo)
Decode a SpaceInfo response ({space, policy}).
pub fn update_space_body(
space: uri.SpaceUri,
policy: Policy,
) -> json.Json
pub fn update_space_url(pds: String) -> String