Bourse.RecordedResponseFixtures (bourse v0.1.0)

Copy Markdown View Source

Capture support and replay-exchange construction for committed reality evidence.

Replay exchanges carry the vendored market and currency caches needed by accepted-request reconstruction and focused parser tests.

Summary

Functions

Builds an offline replay exchange with fixture case options merged.

Returns the capture category for a configured target.

Captures and scrubs one configured live response fixture.

Returns every {venue, method} pair supported by the live capture pipeline.

Absolute path to a venue's static currencies cache.

Directory for recorded currencies caches.

Decodes persisted call_opts from a legacy fixture JSON map.

Root directory for committed real error recordings.

Returns the on-disk fixture filename id for a venue.

Absolute path for a legacy recorded response fixture file.

Root directory for legacy recorded response fixtures.

Infers a coarse market-type label from a fixture case (for coverage reporting).

Loads and decodes a static fixture JSON file.

Absolute path to a venue's static markets cache.

Directory for recorded markets caches.

Returns stable oracle identity fields for a configured target.

Returns the environment variables required by one capture target.

Returns corpus paths whose sensitive fields are not masked.

Recursively masks credential and account identity material in a fixture.

Root for vendored market and currency reference caches.

Functions

build_exchange!(exchange_id, case_data, file_options \\ %{})

@spec build_exchange!(String.t(), map(), map()) :: Bourse.Exchange.t()

Builds an offline replay exchange with fixture case options merged.

The market and currency reference caches supply cache-derived fields needed by accepted-request reconstruction and focused parser tests.

Raw replay market cache

:markets is populated with raw reference maps. Bourse.Exchange declares this replay shape alongside %Bourse.Market{} so callers can distinguish the two cache representations.

capture_category(exchange_id, method)

@spec capture_category(String.t(), atom()) ::
  Bourse.RecordedResponseFixtures.Capture.category() | nil

Returns the capture category for a configured target.

capture_fixture(exchange_id, method, call_opts \\ [])

@spec capture_fixture(String.t(), atom(), keyword()) ::
  {:ok, map()} | {:error, term()}

Captures and scrubs one configured live response fixture.

capture_targets()

@spec capture_targets() :: [{String.t(), atom()}]

Returns every {venue, method} pair supported by the live capture pipeline.

currencies_fixture_path(exchange_id)

@spec currencies_fixture_path(String.t()) :: String.t()

Absolute path to a venue's static currencies cache.

currencies_root()

@spec currencies_root() :: String.t()

Directory for recorded currencies caches.

decode_call_opts(fixture)

@spec decode_call_opts(map()) :: keyword()

Decodes persisted call_opts from a legacy fixture JSON map.

error_fixture_root()

@spec error_fixture_root() :: String.t()

Root directory for committed real error recordings.

fixture_file_id(exchange_id)

@spec fixture_file_id(String.t()) :: String.t()

Returns the on-disk fixture filename id for a venue.

fixture_path(exchange_id, method)

@spec fixture_path(String.t(), atom()) :: String.t()

Absolute path for a legacy recorded response fixture file.

fixture_root()

@spec fixture_root() :: String.t()

Root directory for legacy recorded response fixtures.

infer_market_type(case_data)

@spec infer_market_type(map()) :: String.t()

Infers a coarse market-type label from a fixture case (for coverage reporting).

load_fixture!(path)

@spec load_fixture!(String.t()) :: map()

Loads and decodes a static fixture JSON file.

markets_fixture_path(exchange_id)

@spec markets_fixture_path(String.t()) :: String.t()

Absolute path to a venue's static markets cache.

markets_root()

@spec markets_root() :: String.t()

Directory for recorded markets caches.

oracle_identity(exchange_id, method)

@spec oracle_identity(String.t(), atom()) :: map() | nil

Returns stable oracle identity fields for a configured target.

required_credentials(exchange_id, method)

@spec required_credentials(String.t(), atom()) :: [String.t()] | nil

Returns the environment variables required by one capture target.

safety_violations(value)

@spec safety_violations(term()) :: [String.t()]

Returns corpus paths whose sensitive fields are not masked.

scrub_fixture(value, credentials \\ nil)

@spec scrub_fixture(term(), Bourse.Credentials.t() | nil) :: term()

Recursively masks credential and account identity material in a fixture.

static_root()

@spec static_root() :: String.t()

Root for vendored market and currency reference caches.