Provides introspection functions for AshTypescript.Rpc configuration.
This module generates helper functions to access RPC configuration defined in domains using the AshTypescript.Rpc DSL extension.
Summary
Functions
Gets the mapped metadata field name for an RPC action.
Gets the original metadata field name from a mapped name for an RPC action.
typescript_rpc DSL entities
An MFA or module that implements error handling for RPC operations.
An MFA or module that implements error handling for RPC operations.
Default namespace (filename) for all resources in this domain.
Default namespace (filename) for all resources in this domain.
typescript_rpc DSL options
Whether to show detailed information for raised exceptions.
Functions
Gets the mapped metadata field name for an RPC action.
If a metadata_field_names mapping is defined for the field in the RPC action, returns the mapped name. Otherwise returns the original field name.
Parameters
rpc_action- The RpcAction structfield_name- The metadata field name (atom)
Returns
The mapped field name (atom) or the original field name if no mapping exists.
Gets the original metadata field name from a mapped name for an RPC action.
This is the reverse operation of get_mapped_metadata_field_name. If a metadata_field_names mapping exists where the value matches the provided name, returns the original key. Otherwise returns the provided name unchanged.
Parameters
rpc_action- The RpcAction structmapped_field_name- The mapped metadata field name (atom)
Returns
The original field name (atom) or the provided name if no reverse mapping exists.
Examples
# With metadata_field_names: [is_valid?: :isValid, field_1: :field1]
get_original_metadata_field_name(rpc_action, :isValid) #=> :is_valid?
get_original_metadata_field_name(rpc_action, :field1) #=> :field_1
get_original_metadata_field_name(rpc_action, :other) #=> :other
typescript_rpc DSL entities
@spec typescript_rpc_error_handler(dsl_or_extended :: module() | map()) :: {:ok, mfa() | :module} | :error
An MFA or module that implements error handling for RPC operations.
@spec typescript_rpc_error_handler!(dsl_or_extended :: module() | map()) :: (mfa() | :module) | no_return()
An MFA or module that implements error handling for RPC operations.
Default namespace (filename) for all resources in this domain.
Default namespace (filename) for all resources in this domain.
typescript_rpc DSL options
Returns a map containing the and any configured or default values.
Whether to show detailed information for raised exceptions.