Every name the machine API had before it was made module-neutral, in one
place. The rest of PhoenixKit.API knows no module (a guard test fails when
it spells one), so the day the deprecation window closes this file is
deleted and only its callers are touched: PhoenixKit.API.Paths, the
fallback in PhoenixKit.API.Config.rate_limits/0 (with
rate_limits_without_fallback/0, which exists only for it), the
Settings -> API form's write_limits, PhoenixKit.API.Problem (the four
error codes of the shop), PhoenixKit.API.Executor (the client token of a tool that
declares none) and PhoenixKit.API.Idempotency (the
credential names and markers of the old checkout links).
This module is deleted in 3.0.0. A client, a settings row or a module that still uses a name below has until then to move to the canonical one.
What it holds:
- the deprecated public paths,
/api/shop/v1and/mcp/shop(alias_paths/0):PhoenixKit.API.Pathsforwards them to the same plugs as the canonical/api/public/v1and/mcp/public, and the plugs mark every answer withdeprecation/0and aLinkto the canonical path; - the deprecated settings keys (
setting_fallback/1):PhoenixKit.API.Configreads a limit from its new key and, when that holds no valid number, from the old one. Nothing deletes or migrates the old rows; the first save of Settings -> API writes the values in effect under the new keys; - the client token of a public tool that declares none (
legacy_client_token/1): a module written beforePhoenixKit.API.Toolhad aclient_tokenfield named its anonymous caller's tokencart_token, and the executor still reads it so such a module keeps its rate limit, its idempotency scope and its danger gate; - the four error codes the shop API answered with before modules could declare
their own (
problems/0):PhoenixKit.API.Problem(and, through it, the MCP advice) uses them for as long as no enabled module declares the same code (PhoenixKit.Module.api_problems/0); - the names a module's answers carried secrets under before
Tool.credentialsexisted (credential_keys/0,credential_markers/0), whichPhoenixKit.API.Idempotencystill redacts and never stores for replay.
Summary
Functions
The deprecated public API paths, as lists of segments (the REST one, then the MCP one). Each is served by the plug of the canonical public path of its transport, and nothing publishes them: documents and headers name the canonical path only.
The output field names PhoenixKit.API.Idempotency treats as credentials besides the
ones core's rule covers.
The substrings that make any string value of an answer a credential (compared without regard to case).
The value of the Deprecation response header (RFC 9745) that every answer
on a deprecated path carries.
The input field a public tool that declares no client_token is read through, or
nil: "cart_token" when the tool's input schema has a property of that name.
The error codes the shop answered with before modules declared their own, as
%{code => %{status, title, advice}}. They apply to a code only while no enabled
module declares it.
The deprecated settings key that key replaces, or nil when key replaced
none. PhoenixKit.API.Config.int/3 reads it when key holds no valid number.
Functions
@spec alias_paths() :: [[String.t()]]
The deprecated public API paths, as lists of segments (the REST one, then the MCP one). Each is served by the plug of the canonical public path of its transport, and nothing publishes them: documents and headers name the canonical path only.
@spec credential_keys() :: [String.t()]
The output field names PhoenixKit.API.Idempotency treats as credentials besides the
ones core's rule covers.
@spec credential_markers() :: [String.t()]
The substrings that make any string value of an answer a credential (compared without regard to case).
@spec deprecation() :: String.t()
The value of the Deprecation response header (RFC 9745) that every answer
on a deprecated path carries.
@spec legacy_client_token(PhoenixKit.API.Tool.t()) :: String.t() | nil
The input field a public tool that declares no client_token is read through, or
nil: "cart_token" when the tool's input schema has a property of that name.
@spec problems() :: %{ required(atom()) => %{ status: pos_integer(), title: String.t(), advice: String.t() } }
The error codes the shop answered with before modules declared their own, as
%{code => %{status, title, advice}}. They apply to a code only while no enabled
module declares it.
The deprecated settings key that key replaces, or nil when key replaced
none. PhoenixKit.API.Config.int/3 reads it when key holds no valid number.