# `Incant.Service.Session`
[🔗](https://github.com/elixir-vibe/incant/blob/v0.1.1/lib/incant/service/session.ex#L1)

Admin UI session for one discovered Incant service entry.

A session wraps `%Incant.Service.Entry{}` and exposes admin-shaped operations
without leaking SafeRPC operation tuples or Incant service request structs into
LiveView/rendering code.

# `surface`

```elixir
@type surface() :: map()
```

# `t`

```elixir
@type t() :: %Incant.Service.Session{context: map(), entry: Incant.Service.Entry.t()}
```

# `contract`

```elixir
@spec contract(t()) :: Incant.Admin.Contract.t()
```

Returns the loaded transport-safe admin contract.

# `fetch_surface`

```elixir
@spec fetch_surface(t(), String.t() | atom(), keyword()) ::
  {:ok, surface()} | {:error, term()}
```

Fetches a surface by id from the loaded contract.

# `index`

```elixir
@spec index(t(), String.t() | atom(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}
```

Indexes a remote resource surface.

# `list_surfaces`

```elixir
@spec list_surfaces(
  t(),
  keyword()
) :: [surface()]
```

Lists all surfaces from the loaded contract.

# `new`

```elixir
@spec new(
  Incant.Service.Entry.t(),
  keyword()
) :: t()
```

Builds a session for a discovered service entry.

# `read`

```elixir
@spec read(t(), String.t() | atom(), term(), map(), keyword()) ::
  {:ok, term()} | {:error, term()}
```

Reads one remote resource item.

# `run_action`

```elixir
@spec run_action(
  t(),
  String.t() | atom(),
  String.t() | atom(),
  map(),
  map(),
  keyword()
) ::
  {:ok, Incant.ActionResult.t()} | {:error, term()}
```

Runs an action on a remote resource surface.

# `run_widget`

```elixir
@spec run_widget(
  t(),
  String.t() | atom(),
  String.t() | atom(),
  map(),
  map(),
  keyword()
) ::
  {:ok, term()} | {:error, term()}
```

Runs a remote dashboard widget query.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
