Yelp Fusion API adapter — business search + review fetch, emitting domain_reviews::Review directly
| Tier | infrastructure |
| Role | unclassified (baselined) |
| Path | crates/infrastructure/adapters-yelp |
| Edition | 2021 |
| Targets | infrastructure_adapters_yelp |
| Public items | 0 across 0 modules |
| Tests | 24 |
What it is for
Yelp Fusion API client adapter.
A pure API-client adapter over Yelp Fusion's business-search and review endpoints (https://api.yelp.com/v3), plus a foundation_source_ingest:: SourceIngest implementor that emits real domain_reviews::Review values.
Lifted from plumber/src/collectors/yelp.rs's YelpCollector (Gate 4.5 provenance, see CHANGELOG.md) — fetch glue only. Per this harvest's Gate 0.5 dedup finding, plumber's own models/review.rs::Review type is a full duplicate of domain-reviews's schema (ReviewSource::Yelp, source_id/source_url dedup) and does not survive; neither does the source's business_to_competitor mapping (models::Competitor, its own app-specific persistence shape) or the generic-website review-extraction module. See ingest's module doc for the full SourceIngest determination and the ingest::YelpIngest Review-construction rationale.
# Example
# async fn example() -> Result<(), infrastructure_adapters_yelp::YelpError> {
let client = infrastructure_adapters_yelp::YelpClient::from_api_key("YOUR_API_KEY")?;
let businesses = client.search_businesses("Austin, TX", "bakeries").await?;
for business in &businesses {
let reviews = client.get_reviews(&business.id).await?;
println!("{}: {} reviews", business.name, reviews.len());
}
# Ok(())
# }
Capabilities
No public items.
How to use it
From this crate's own rustdoc:
# async fn example() -> Result<(), infrastructure_adapters_yelp::YelpError> {
let client = infrastructure_adapters_yelp::YelpClient::from_api_key("YOUR_API_KEY")?;
let businesses = client.search_businesses("Austin, TX", "bakeries").await?;
for business in &businesses {
let reviews = client.get_reviews(&business.id).await?;
println!("{}: {} reviews", business.name, reviews.len());
}
# Ok(())
# }
Module structure
No public modules: the crate root is its whole surface.
Public surface
No public items.
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
YelpClient | client::YelpClient |
YelpConfig | auth::YelpConfig |
YelpError | error::YelpError |
{YelpApiError,YelpApiErrorEnvelope,YelpBusiness,YelpCategory,YelpCoordinates,YelpLocation,YelpReview,YelpReviewsResponse,YelpSearchResponse,YelpUser,} | types::{YelpApiError,YelpApiErrorEnvelope,YelpBusiness,YelpCategory,YelpCoordinates,YelpLocation,YelpReview,YelpReviewsResponse,YelpSearchResponse,YelpUser,} |
{YelpIngest,YelpIngestConfig} | ingest::{YelpIngest,YelpIngestConfig} |
Boundary
Reaches into domain, foundation.
Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-agent, infrastructure-ai, … (82 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | infrastructure |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/infrastructure/adapters-yelp |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_infrastructure["infrastructure"] --> n_domain["domain"] n_infrastructure["infrastructure"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `domain-reviews` | domain | no | always |
| `foundation-source-ingest` | foundation | no | always |
| `infrastructure-fetcher` | infrastructure | yes | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
chrono | ^0.4 | serde | no | always |
reqwest | ^0.12 | json | no | always |
rust_decimal | ^1 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
thiserror | ^2 | — | no | always |
tokio | ^1 | sync, time | no | always |
tracing | ^0.1 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | macros, rt-multi-thread, time | no | always |
wiremock | ^0.6 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["infrastructure-adapters-yelp"] SELF -->|runtime| n_domain_reviews["domain-reviews"] SELF -->|runtime| n_foundation_source_ingest["foundation-source-ingest"] SELF -->|runtime| n_infrastructure_fetcher["infrastructure-fetcher"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
| Feature | Enables | On by default |
|---|---|---|
default | secure-egress | yes |
secure-egress | dep:infrastructure-fetcher | yes |
flowchart LR n_default["default"] --> n_secure_egress["secure-egress"] n_secure_egress["secure-egress"] --> n_dep_infrastructure_fetcher["dep:infrastructure-fetcher"]
Targets
| Kind | Name | Source |
|---|---|---|
| lib | infrastructure_adapters_yelp | `src/lib.rs` |
Error model
No public error type was detected: no public item declares a type named *Error, and no public signature returns one.
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | yes |
| database access | none detected |
| network I/O | yes |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 24 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 1 |
What the tests establish, by name:
debug_does_not_leak_api_key—src/auth.rsdefault_config_is_invalid_without_a_key—src/auth.rsdisabled_config_with_a_key_is_still_invalid—src/auth.rsempty_key_is_invalid_even_if_enabled—src/auth.rsnew_with_a_key_is_valid_and_enabled—src/auth.rscreating_a_client_with_a_valid_config_succeeds—src/client.rscreating_a_client_with_an_invalid_config_fails—src/client.rsfrom_api_key_succeeds—src/client.rsget_reviews_returns_parsed_reviews—src/client.rsnon_success_status_becomes_typed_api_error—src/client.rsnon_success_status_without_json_body_falls_back_to_http_status—src/client.rsrate_limit_enforces_minimum_interval_between_requests—src/client.rssearch_businesses_sends_bearer_token_and_caller_supplied_term—src/client.rsstrict_egress_client_is_constructible—src/client.rsingest_emits_real_primitives_reviews_review_values—src/ingest.rsingest_records_error_count_and_returns_ok_on_fetch_failure—src/ingest.rsingest_with_empty_business_id_fails_fast—src/ingest.rsingest_without_source_url_leaves_it_none—src/ingest.rsname_matches_source_collectors_name—src/ingest.rsyelp_api_error_envelope_deserializes—src/types.rsyelp_business_deserializes_with_optional_fields_absent—src/types.rsyelp_review_deserializes—src/types.rsyelp_reviews_response_deserializes—src/types.rsyelp_search_response_deserializes_businesses_and_total—src/types.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 0 | 0 |
Public modules with a //! block | 0 | 0 |
Metrics
| Metric | Value |
|---|---|
| Rust source files | 6 |
| Source lines | 1040 |
| Code lines | 729 |
| Public API items | 0 |
| Public modules | 0 |
| Tests | 24 |
| Examples | 0 |
| Cargo features | 2 |
| Direct runtime dependencies | 13 |
| Workspace reverse dependencies | 0 |
pie showData
title Rust source composition
"Code" : 729
"Blank or comment" : 311
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.