Capability first · transport second

OpenMeteoWeatherProvider.js

Searches and loads Open-Meteo data into complete mutable Arcane weather entities.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Searches and loads Open-Meteo data into complete mutable Arcane weather entities.

  • Artifact
    OpenMeteoWeatherProvider.js · esm
  • Classification
    public first party
  • Availability
    Browser / native WebView / server with fetch + cloud
  • Normalization
    Provider data normalized to entities; transport errors mixed.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/OpenMeteoWeatherProvider.js';

Construction creates two fetch-backed ApiModelDatabase instances and forwards their request/error events. search() and load() use Open-Meteo HTTPS by default; constructor and setEndpoints() can select caller-owned HTTP(S) endpoints. There is no global installation.

Application-facing behavior: Endpoint/event/error constants, default provider, mapForecast(); search/load methods, state-free EventTarget/on lifecycle compatibility, and dispose().

Protocol and host implementation

Open-Meteo HTTPS + per-realm globalThis.arcaneEvents authority This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
OPEN_METEO_ENDPOINTSvariable · valuevariable OPEN_METEO_ENDPOINTS
OPEN_METEO_WEATHER_EVENTSvariable · valuevariable OPEN_METEO_WEATHER_EVENTS
OPEN_METEO_WEATHER_ERRORSvariable · valuevariable OPEN_METEO_WEATHER_ERRORS
defaultdefault · classclass OpenMeteoWeatherProvider extends EventTarget
mapForecastfunctionfunction mapForecast(raw,location)raw,location
CallableKindExact public signatureParameter syntax
mapForecastexported-functionfunction mapForecast(raw,location)raw,location
MemberKindExact public declarationParameter syntax
OpenMeteoWeatherProvider.constructorconstructorconstructor({ geocodingEndpoint=OPEN_METEO_ENDPOINTS.geocoding, forecastEndpoint=OPEN_METEO_ENDPOINTS.forecast, fetchImpl=globalThis.fetch }={}){ geocodingEndpoint=OPEN_METEO_ENDPOINTS.geocoding, forecastEndpoint=OPEN_METEO_ENDPOINTS.forecast, fetchImpl=globalThis.fetch }={}
OpenMeteoWeatherProvider.addEventListenermethodaddEventListener(type,listener,options)type,listener,options
OpenMeteoWeatherProvider.removeEventListenermethodremoveEventListener(type,listener,options)type,listener,options
OpenMeteoWeatherProvider.onmethodon(type,listener,options)type,listener,options
OpenMeteoWeatherProvider.dispatchEventmethoddispatchEvent(value)value
OpenMeteoWeatherProvider.setEndpointsmethodsetEndpoints({geocoding,forecast}={}){geocoding,forecast}={}
OpenMeteoWeatherProvider.searchasync methodasync search(query,optionsValue={})query,optionsValue={}
OpenMeteoWeatherProvider.loadasync methodasync load(location,optionsValue={})location,optionsValue={}
OpenMeteoWeatherProvider.emitmethodemit(type,detail={})type,detail={}
OpenMeteoWeatherProvider.disposemethoddispose()
OpenMeteoWeatherProvider.destroymethoddestroy()

Parameter meanings and results

OPEN_METEO_ENDPOINTS exposes the default geocoding/forecast URLs. new Provider({geocodingEndpoint?,forecastEndpoint?,fetchImpl?}); setEndpoints({geocoding?,forecast?}) returns effective endpoints; search(nonblankQuery,{signal?}) resolves the complete WeatherLocation[]; load(location,{temperatureUnit?,windSpeedUnit?,precipitationUnit?,forecastDays?,signal?}) resolves WeatherSnapshot; mapForecast(raw,location) returns WeatherSnapshot.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • weather-request
  • weather-error
  • weather-locations with {locations}
  • weather-weather with {weather}

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • TypeError for a blank query or invalid Weather entity.
  • Fetch/HTTP/parser errors propagate after weather-error notification.

Availability and capabilities

Browser / native WebView / server with fetch + cloud. Provider data normalized to entities; transport errors mixed.

None; default calls use public Open-Meteo fetch endpoints. A caller-selected endpoint owns its separate browser, CORS, and network-policy authority.

Contract example

JavaScript
import Weather from '/arcane/modules/OpenMeteoWeatherProvider.js';

const weather = new Weather();
const [place] = await weather.search('Chicago');
if (place) console.log(await weather.load(place));

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.