AtUri Module
Functions for creating, validating, and extracting data from AtUri values.
Functions and values
| Function or value |
Description
|
Full Usage:
authority atUri
Parameters:
AtUri
-
The AT-URI to extract the authority from.
Returns: string
The authority string (e.g. "did:plc:z72i7hdynmk6r22z27h6tvur" or "my-handle.bsky.social").
|
Extract the authority segment (DID or handle) from an AT-URI.
|
Full Usage:
collection atUri
Parameters:
AtUri
-
The AT-URI to extract the collection from.
Returns: string option
Some with the collection NSID string (e.g. "app.bsky.feed.post"), or None if the AT-URI has no collection segment.
|
Extract the collection NSID segment from an AT-URI, if present.
|
Full Usage:
parse s
Parameters:
string
-
An AT-URI string starting with "at://" followed by an authority (DID or handle),
and optionally a collection (NSID) and record key path segments.
Query parameters and fragments are not allowed.
Returns: Result<AtUri, string>
Ok with a validated AtUri, or Error with a message describing the validation failure.
Validation failures include: null input, exceeding 8192 characters, missing at:// prefix,
presence of query/fragment components, invalid authority (must be a valid DID or handle),
invalid collection (must be a valid NSID), invalid record key, or trailing slash.
|
Parse and validate an AT-URI string.
Example
union case Result.Ok: ResultValue: 'T -> Result<'T,'TError>
val uri: obj
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
union case Result.Error: ErrorValue: 'TError -> Result<'T,'TError>
val e: string
|
Full Usage:
rkey atUri
Parameters:
AtUri
-
The AT-URI to extract the record key from.
Returns: string option
Some with the record key string (e.g. "3k2la3b"), or None if the AT-URI has no record key segment.
|
Extract the record key segment from an AT-URI, if present.
|
Full Usage:
value arg1
Parameters:
AtUri
Returns: string
The full AT-URI string (e.g. "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3k2la3b").
|
Extract the string representation of an AT-URI.
|