AshTypescript.Rpc.Codegen.RpcConfigCollector (ash_typescript v0.18.1)

Copy Markdown View Source

Collects RPC configuration from domains including resources, actions, and typed queries.

Summary

Functions

Finds the decorated entrypoint for a {resource, rpc_action} pair, so codegen can read precomputed values (e.g. exposed metadata fields) off Custom.

Gets RPC action entrypoint configs for building the spec with extension-specific metadata.

Gets RPC configuration grouped by domain, derived from entrypoints.

Gets all RPC resources and their actions from entrypoints.

Gets all RPC resources and their actions with domain and resource config context.

Gets RPC actions grouped by namespace.

Gets all typed queries from entrypoints.

Resolves the namespace for an RPC action.

Functions

entrypoint_for(resource, rpc_action)

Finds the decorated entrypoint for a {resource, rpc_action} pair, so codegen can read precomputed values (e.g. exposed metadata fields) off Custom.

get_rpc_action_entrypoint_configs(otp_app)

Gets RPC action entrypoint configs for building the spec with extension-specific metadata.

Returns a list of maps suitable for Ash.Info.Manifest.Generator.generate/1's :action_entrypoints option, with RPC config under config.ash_typescript.

get_rpc_config_by_domain(entrypoints)

Gets RPC configuration grouped by domain, derived from entrypoints.

Returns a list of tuples: {domain, rpc_config} where rpc_config contains resources with their rpc_actions and typed_queries.

get_rpc_resources_and_actions(otp_app)

Gets all RPC resources and their actions from entrypoints.

Extracts {resource, action, rpc_action} tuples from entrypoints that have config.ash_typescript populated.

get_rpc_resources_and_actions_with_context(entrypoints)

Gets all RPC resources and their actions with domain and resource config context.

Returns {resource, action, rpc_action, domain, resource_config} tuples. Skips typed-query-only entrypoints (those without an rpc_action config).

get_rpc_resources_by_namespace(entrypoints)

Gets RPC actions grouped by namespace.

Returns a map where keys are namespaces (atoms or nil for no namespace) and values are lists of {resource, action, rpc_action, domain, resource_config} tuples.

get_typed_queries(entrypoints, action_lookup)

Gets all typed queries from entrypoints.

Returns a list of tuples: {resource, action, typed_query}

resolve_namespace(domain, resource_config, rpc_action)

Resolves the namespace for an RPC action.

Namespace precedence: action > resource > domain. Returns nil if no namespace is configured at any level.