AshLua.Surface (ash_lua v0.1.5)

Copy Markdown View Source

Annotates %Ash.Info.Manifest{} entrypoints with AshLua public surface data.

The manifest remains the API specification. AshLua stores extension-specific callable path metadata under each entrypoint's config[:ash_lua].

Summary

Functions

Returns the resource/action tuples represented by the annotated manifest.

Returns the AshLua config for an annotated entrypoint.

Returns the annotated entrypoint matching a dotted Lua callable path.

Generates the scoped Lua manifest for an AshLua.EvalActions resource.

Attaches AshLua surface metadata to an existing manifest.

Generates a manifest for an OTP app with AshLua surface metadata attached.

Deprecated compatibility alias for for_manifest/1.

Returns the Lua path segments for an annotated entrypoint.

Returns the dotted Lua path for an annotated entrypoint.

Types

surface_config()

@type surface_config() :: %{
  domain: module(),
  lua_action: String.t(),
  path: [String.t()],
  path_string: String.t(),
  path_source: :explicit | :derived
}

Functions

action_entrypoints(manifest)

@spec action_entrypoints(Ash.Info.Manifest.t()) :: [{module(), atom()}]

Returns the resource/action tuples represented by the annotated manifest.

config(entrypoint)

@spec config(Ash.Info.Manifest.Entrypoint.t()) :: surface_config() | nil

Returns the AshLua config for an annotated entrypoint.

find_action(manifest, path)

@spec find_action(Ash.Info.Manifest.t(), String.t()) ::
  {:ok, Ash.Info.Manifest.Entrypoint.t()} | :error

Compatibility alias for find_entrypoint/2.

find_entrypoint(manifest, path)

@spec find_entrypoint(Ash.Info.Manifest.t(), String.t()) ::
  {:ok, Ash.Info.Manifest.Entrypoint.t()} | :error

Returns the annotated entrypoint matching a dotted Lua callable path.

for_eval_resource(resource)

@spec for_eval_resource(module()) :: {:ok, Ash.Info.Manifest.t()}

Generates the scoped Lua manifest for an AshLua.EvalActions resource.

for_manifest(manifest)

@spec for_manifest(Ash.Info.Manifest.t()) :: Ash.Info.Manifest.t()

Attaches AshLua surface metadata to an existing manifest.

Domains with explicit lua do namespace ... end actions expose only those configured actions. Domains without explicit surface actions retain the legacy derived shape: <domain>.<resource>.<action>.

for_otp_app(otp_app, opts \\ [])

@spec for_otp_app(
  atom(),
  keyword()
) :: {:ok, Ash.Info.Manifest.t()}

Generates a manifest for an OTP app with AshLua surface metadata attached.

from_manifest(manifest)

@spec from_manifest(Ash.Info.Manifest.t()) :: Ash.Info.Manifest.t()

Deprecated compatibility alias for for_manifest/1.

path(entrypoint)

Returns the Lua path segments for an annotated entrypoint.

path_string(entrypoint)

@spec path_string(Ash.Info.Manifest.Entrypoint.t()) :: String.t()

Returns the dotted Lua path for an annotated entrypoint.