Crosswake. Policy. Schema
(crosswake v0.1.0)
View Source
NimbleOptions schema for Phase 1 Crosswake route policy declarations.
Summary
Types
@type commerce_declaration() :: %{ corridor: String.t() | nil, role: commerce_role() | nil }
@type commerce_role() ::
:paywall_entry | :purchase_intent | :restore_intent | :account_management
@type entry() :: :internal_only | :external
@type offline() :: :unavailable | :cached_read_only | :local_first
@type pack_kind() :: :content | :media
@type pack_requirement() :: %{ id: String.t(), version: String.t(), kind: pack_kind(), integrity: pack_integrity() | nil }
@type runtime() :: :live_view | :offline_island | :native_screen
@type security() :: :standard | :sensitive
@type validated_options() :: [ id: String.t(), runtime: runtime(), offline: offline(), entry: entry(), cache_contract: String.t() | nil, island_contract: String.t() | nil, capabilities: [String.t()], commerce: commerce_declaration() | nil, packs: [pack_requirement()], sync: [String.t()], transfers: [Crosswake.Transfer.Contracts.declaration()], security: security() ]
Functions
@spec commerce_role_values() :: [commerce_role()]
@spec schema() :: NimbleOptions.t()
@spec validate(keyword()) :: {:ok, validated_options()} | {:error, NimbleOptions.ValidationError.t()}
@spec validate!(keyword()) :: validated_options()
@spec validate_commerce_declaration(term()) :: {:ok, commerce_declaration() | nil} | {:error, String.t()}
@spec validate_pack_requirements(term()) :: {:ok, [pack_requirement()]} | {:error, String.t()}
@spec validate_transfer_declarations(term()) :: {:ok, [Crosswake.Transfer.Contracts.declaration()]} | {:error, String.t()}