ProtoRune.Lexicon (proto_rune v0.1.2)
Type definitions for the Intermediate Representation (IR) of AT Protocol Lexicons. This structure serves as a bridge between raw lexicon JSON and generated Elixir code.
Summary
Types
@type array_type() :: {:array, type: field_type(), constraints: [{:max_length, pos_integer()}]}
@type definition() :: record() | object() | query() | procedure() | subscription()
@type definition_type() :: :record | :object | :query | :procedure
@type field() :: {name :: String.t(), type :: field_type(), description :: String.t() | nil}
@type field_type() :: primitive_type() | array_type() | union_type() | reference_type()
@type io() :: %{ encoding: String.t(), description: String.t() | nil, schema: object() | reference_type() | union_type() }
@type key_type() :: :tid | :literal | :nsid | :any
@type module_path() :: [String.t()]
@type primitive_type() :: {:string, string_constraints()} | {:integer, number_constraints()} | {:boolean, []} | {:datetime, []}
@type procedure() :: %{ parameters: parameters() | nil, output: io() | nil, input: io() | nil, errors: [error()] }
@type query() :: %{ parameters: parameters() | nil, output: io() | nil, errors: [error()] }
@type string_constraints() :: [ max_length: pos_integer(), max_graphemes: pos_integer(), format: string_format() ]
@type string_format() :: :datetime | :language | :did | :handle | :at_uri | :nsid
@type subscription() :: %{ parameters: parameters(), errors: [error()], message: %{schema: union_type(), description: String.t() | nil} }
@type t() :: %{ lexicon: integer(), id: String.t(), description: String.t() | nil, type: definition_type(), module_path: module_path(), definitions: %{required(String.t()) => definition()} }
@type union_type() :: {:union, types: [reference_type()], description: String.t() | nil}