AshLua.FieldNames (ash_lua v0.1.6)

Copy Markdown View Source

Exact resource field name mappings for the Lua boundary.

Summary

Functions

Rewrites only action input keys, without treating reserved call controls specially.

Returns the internal action argument atom for a Lua-facing argument name when known.

Returns the internal field atom for a Lua-facing field name when known.

Returns the internal field name as a string for Ash string-keyed inputs.

Rewrites field names in an Ash filter input tree.

Rewrites resource action input keys from Lua names to internal Ash names.

Rewrites field names in read operation descriptors like { "sum", "total" }.

Rewrites field names in a sort input.

Returns the Lua-facing name for an internal action argument.

Rewrites encoded Ash error fields to Lua-facing input names.

Returns the Lua-facing name for an internal resource field.

Returns the Lua-facing input name for an action field or argument.

Functions

to_internal_action_input(resource, arg2, input)

@spec to_internal_action_input(module(), map(), map()) :: map()

Rewrites only action input keys, without treating reserved call controls specially.

to_internal_argument_name(resource, action_name, argument_name)

@spec to_internal_argument_name(module(), atom(), atom() | String.t()) ::
  atom() | String.t()

Returns the internal action argument atom for a Lua-facing argument name when known.

to_internal_field_name(resource, field_name)

@spec to_internal_field_name(module(), atom() | String.t()) :: atom() | String.t()

Returns the internal field atom for a Lua-facing field name when known.

to_internal_field_string(resource, field_name)

@spec to_internal_field_string(module(), atom() | String.t()) :: String.t()

Returns the internal field name as a string for Ash string-keyed inputs.

to_internal_filter(resource, filter)

@spec to_internal_filter(module(), term()) :: term()

Rewrites field names in an Ash filter input tree.

to_internal_input(resource, arg2, input)

@spec to_internal_input(module(), map(), map()) :: map()

Rewrites resource action input keys from Lua names to internal Ash names.

to_internal_operation(resource, operation)

@spec to_internal_operation(module(), term()) :: term()

Rewrites field names in read operation descriptors like { "sum", "total" }.

to_internal_sort(resource, sort)

@spec to_internal_sort(module(), term()) :: term()

Rewrites field names in a sort input.

to_lua_argument_name(resource, action_name, argument_name)

@spec to_lua_argument_name(module(), atom(), atom() | String.t()) :: String.t()

Returns the Lua-facing name for an internal action argument.

to_lua_error(error_map, resource, arg3)

@spec to_lua_error(map(), module(), map()) :: map()

Rewrites encoded Ash error fields to Lua-facing input names.

to_lua_field_name(resource, field_name)

@spec to_lua_field_name(module(), atom() | String.t()) :: String.t()

Returns the Lua-facing name for an internal resource field.

to_lua_input_name(resource, action_name, action_type, input_name)

@spec to_lua_input_name(module(), atom(), atom(), atom() | String.t()) :: String.t()

Returns the Lua-facing input name for an action field or argument.