@unmap/sdk 0.21.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -74,15 +74,15 @@ A `File` goes as multipart, a plain object as GeoJSON, raw bytes as PMTiles.
74
74
  The same SDK loads from a script tag, with MapLibre already inside it:
75
75
 
76
76
  ```html
77
- <link rel="stylesheet" href="https://cdn.unmap.dev/sdk/0.21.0/unmap.css">
77
+ <link rel="stylesheet" href="https://cdn.unmap.dev/sdk/0.22.1/unmap.css">
78
78
  <div id="map" style="height: 400px"></div>
79
- <script src="https://cdn.unmap.dev/sdk/0.21.0/unmap.js"></script>
79
+ <script src="https://cdn.unmap.dev/sdk/0.22.1/unmap.js"></script>
80
80
  <script>
81
81
  unmap.createMap({ key: 'um_live_...', container: '#map', center: [-114.07, 51.05] })
82
82
  </script>
83
83
  ```
84
84
 
85
- Everything above is on the `unmap` global: `unmap.Unmap`, `unmap.Geocoder`, `unmap.Router`, `unmap.maplibregl`. Pin the exact version in production; `/sdk/0.21/` follows patches and `/sdk/latest/` follows everything.
85
+ Everything above is on the `unmap` global: `unmap.Unmap`, `unmap.Geocoder`, `unmap.Router`, `unmap.maplibregl`. Pin the exact version in production; `/sdk/0.22/` follows patches and `/sdk/latest/` follows everything.
86
86
 
87
87
  ## Options
88
88
 
@@ -97,7 +97,7 @@ Everything above is on the `unmap` global: `unmap.Unmap`, `unmap.Geocoder`, `unm
97
97
  | `theme` | `string` | A theme code (`u…` or `ut1.`) from [unmap.dev/create](https://unmap.dev/create). |
98
98
  | `center` | `[lng, lat]` | Initial centre. |
99
99
  | `zoom` | `number` | Initial zoom. |
100
- | `projection` | `'globe' \| 'mercator'` | `'globe'` draws the map as a sphere. Defaults to `'mercator'`. |
100
+ | `projection` | `'globe' \| 'mercator'` | `'globe'` (the default) draws the map as a sphere; `'mercator'` is the flat map. |
101
101
  | `controls` | `boolean \| { position }` | Zoom and compass buttons. `true` by default; `false` for a bare canvas. |
102
102
 
103
103
  The instance exposes `.map` (MapLibre GL `Map`, only with a `container`), `.geocoder`
package/dist/index.d.ts CHANGED
@@ -726,7 +726,7 @@ interface UnmapOptions {
726
726
  overlays?: readonly string[];
727
727
  /** Composition preset. Not a style. Explicit overlays replace the profile list. */
728
728
  profile?: MapProfile;
729
- /** `"globe"` or `"mercator"`. See `@unmap/maps` `UnmapMapOptions.projection`. */
729
+ /** `"globe"` (the default) or `"mercator"`. See `@unmap/maps` `UnmapMapOptions.projection`. */
730
730
  projection?: UnmapMapOptions["projection"];
731
731
  center?: [number, number];
732
732
  zoom?: number;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/roads.ts","../src/transit.ts","../src/coverage.ts","../src/timezone.ts","../src/catalog.ts"],"sourcesContent":["import {\n createMap,\n type Map as MaplibreMap,\n type MapProfile,\n type UnmapControlsOptions,\n type UnmapMapOptions,\n} from \"@unmap/maps\";\nimport { Geocoder, Places, type IdentifyOptions, type IdentifyResponse, type QueryOptions, type QueryResponse } from \"@unmap/geocoding\";\nimport { Feedback, Roads } from \"./roads\";\nimport { Transit } from \"./transit\";\nimport { Coverage } from \"./coverage\";\nimport { Timezone } from \"./timezone\";\nimport { Byod, Catalog } from \"./catalog\";\nimport { Router } from \"@unmap/routing\";\nimport { Elevation } from \"@unmap/elevation\";\nimport type { RetryPolicy } from \"@unmap/core\";\n\nexport * from \"@unmap/geocoding\";\nexport * from \"@unmap/routing\";\nexport * from \"@unmap/elevation\";\nexport * from \"./roads\";\nexport * from \"./transit\";\nexport * from \"./coverage\";\nexport * from \"./timezone\";\nexport * from \"./catalog\";\nexport { createMap, unmapStyle, DEMO_CITIES, STYLE_NAMES, maplibregl } from \"@unmap/maps\";\nexport type {\n Map,\n UnmapMapOptions,\n UnmapControlsOptions,\n DemoCity,\n StyleName,\n StyleInput,\n Projection,\n MapProfile,\n} from \"@unmap/maps\";\n\nexport interface UnmapOptions {\n key: string;\n gateway?: string;\n /** Override the fetch implementation (tests, non-global environments). */\n fetch?: typeof fetch;\n /**\n * Retry policy shared by every client on this instance. `false` disables it.\n *\n * On by default for `429`, `502`, `503` and transport failures. `Retry-After` is on a `429`\n * other than `billing_required`, and on a container `503`. A `502` has none. A wait longer\n * than `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds`\n * instead, because a cold land or energy container asks for 60 and parking a request handler\n * for a minute is a worse surprise than an error. Feedback submissions are never retried:\n * they create a record and carry no idempotency key.\n */\n retry?: RetryPolicy | false;\n /** If provided, a map is mounted in this container. */\n container?: string | HTMLElement;\n style?: string;\n /** \"light\" or \"dark\", light by default. Applies to a bare style name; a `<style>-<mode>` string is passed through as written and `mode` does not change it. */\n mode?: string;\n /** Label language, e.g. \"fr\". Omit to follow the request's Accept-Language. */\n lang?: string;\n /** Compact `ut1.` theme code from unmap.dev/create. Wins over the path style on the gateway. */\n theme?: string;\n /** Catalog layer ids composed onto the style (`municipalities`, `survey.dls`, …). */\n overlays?: readonly string[];\n /** Composition preset. Not a style. Explicit overlays replace the profile list. */\n profile?: MapProfile;\n /** `\"globe\"` or `\"mercator\"`. See `@unmap/maps` `UnmapMapOptions.projection`. */\n projection?: UnmapMapOptions[\"projection\"];\n center?: [number, number];\n zoom?: number;\n /** On-map controls. `true` (the default) adds zoom and compass buttons; `false` adds none. */\n controls?: boolean | UnmapControlsOptions;\n}\n\n/**\n * One Stripe-style key, the whole platform. With a `container` you get a rendered map.\n * `geocoder`, `router`, `elevation`, and `timezone` are always available.\n *\n * const map = new Unmap({ key: \"um_live_...\", container: \"#map\", center: [-75.69, 45.42] });\n */\nexport class Unmap {\n readonly geocoder: Geocoder;\n readonly router: Router;\n readonly elevation: Elevation;\n /** IANA timezone and the UTC offset at an instant. One call, anywhere. */\n readonly timezone: Timezone;\n /** Canadian points of interest. Same corpus as the geocoder, in the Place shape. */\n readonly places: Places;\n /** Closures, incidents, construction and road conditions. */\n readonly roads: Roads;\n /** Report wrong data. Never metered. */\n readonly feedback: Feedback;\n /** Scheduled public-transit agencies, stops, routes and departures. */\n readonly transit: Transit;\n /**\n * Where each capability actually works. Unauthenticated and unmetered, so checking costs\n * nothing: read it before promising a user an answer, because transit routing covers only the feeds\n * marked routing-ready and road events cover two provinces.\n */\n readonly coverage: Coverage;\n /** The named Canadian layer catalog: what exists, its licence, and what it does not cover. */\n readonly layers: Catalog;\n /** Your own GeoJSON and PMTiles overlays, stored against this key. */\n readonly byod: Byod;\n readonly data: { query(opts: QueryOptions): Promise<QueryResponse> };\n readonly map?: MaplibreMap;\n\n constructor(opts: UnmapOptions) {\n this.geocoder = new Geocoder(opts);\n this.router = new Router(opts);\n this.elevation = new Elevation(opts);\n this.timezone = new Timezone(opts);\n this.places = new Places(opts);\n this.roads = new Roads(opts);\n this.feedback = new Feedback(opts);\n this.transit = new Transit(opts);\n this.coverage = new Coverage(opts);\n this.layers = new Catalog(opts);\n this.byod = new Byod(opts);\n this.data = { query: (queryOpts) => this.geocoder.queryLayer(queryOpts) };\n if (opts.container) {\n this.map = createMap({ ...opts, container: opts.container } as UnmapMapOptions);\n }\n }\n\n /** Which catalog features contain a point. See `Geocoder.identify`. */\n identify(opts: IdentifyOptions): Promise<IdentifyResponse> {\n return this.geocoder.identify(opts);\n }\n}\n\n// The shared error type and retry policy, re-exported so a caller who installed only this\n// package can `catch (e) { if (e instanceof UnmapError) }` without adding @unmap/core.\nexport { UnmapError, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * Typed clients for road events (`/incidents`, `/closures`, `/road-conditions`) and for data\n * correction (`POST /feedback`).\n *\n * These live in `@unmap/sdk` rather than in packages of their own. A twelfth and thirteenth npm\n * package would each need an entry in the changesets fixed group and a trusted publisher\n * configured on npmjs.com, which is founder work, and neither has a framework wrapper the way\n * geocoding and routing do. If a customer ever wants roads without the rest of the SDK, that is\n * the moment to split it out.\n */\n\nexport type RoadEventType =\n | \"closure\"\n | \"incident\"\n | \"construction\"\n | \"weather\"\n | \"restriction\"\n | \"ferry\"\n | \"hazard\"\n | \"special_event\"\n | \"unknown\";\n\nexport type RoadCondition =\n | \"dry\"\n | \"wet\"\n | \"snow\"\n | \"ice\"\n | \"packed_snow\"\n | \"reduced_visibility\"\n | \"travel_not_recommended\"\n | \"closed\"\n | \"unknown\";\n\nexport type RoadSeverity = \"minor\" | \"major\" | \"unknown\";\n\nexport interface AffectedRoad {\n name: string;\n direction: \"north\" | \"south\" | \"east\" | \"west\" | \"both\" | \"unknown\";\n /** True only when the publisher says closed. Never inferred from the description. */\n closed: boolean;\n from?: string;\n to?: string;\n condition: RoadCondition;\n}\n\nexport interface RoadEvent {\n /** `um:road:<jurisdiction>:<publisher id>`. */\n id: string;\n /** The publisher's own id, so a report can be taken back to them. */\n source_id: string;\n /** ISO 3166-2, e.g. `CA-BC`. */\n jurisdiction: string;\n type: RoadEventType;\n /** The publisher's own subtype strings, untranslated. */\n subtypes: string[];\n status: \"active\" | \"planned\" | \"archived\";\n severity: RoadSeverity;\n /**\n * The publisher's description, verbatim.\n *\n * Believe this over `type` when they disagree: our categories are a lossy projection of someone\n * else's taxonomy, and the sentence a driver needs is in the prose.\n */\n description: string;\n headline?: string;\n /** The worst surface condition across this event's roads. */\n condition: RoadCondition;\n roads: AffectedRoad[];\n /** GeoJSON Point or LineString, WGS84. */\n geometry: { type: string; coordinates: unknown } | null;\n starts_at: string | null;\n ends_at: string | null;\n source_updated_at: string | null;\n unmap_updated_at: string;\n source: string;\n}\n\nexport interface RoadEventsResponse {\n data: RoadEvent[];\n meta: {\n status: \"current\" | \"stale\" | \"partial\" | \"unknown\";\n attribution: string;\n unmap_updated_at: string;\n /**\n * Jurisdictions that could not be reached, each with a reason.\n *\n * **Check this.** On `/closures` an empty `data` reads as \"nothing is shut\" to someone\n * deciding whether to drive, and that is a very different answer from \"we could not reach\n * British Columbia\".\n */\n unavailable?: { jurisdiction: string; reason: string }[];\n /**\n * Feeds served from unmap's five-minute poll rather than fetched for this request (Alberta),\n * each with its age. A feed older than `max_age_seconds` is in `unavailable` instead.\n */\n polled?: {\n jurisdiction: string;\n feed: \"events\" | \"conditions\";\n polled_at: string;\n age_seconds: number;\n max_age_seconds: number;\n }[];\n };\n}\n\nexport interface RoadEventQuery {\n /** Comma-separated ISO 3166-2 codes, or an array. An uncovered code is a 400, not an empty list. */\n jurisdiction?: string | readonly string[];\n bbox?: [number, number, number, number];\n near?: [number, number];\n /** Metres from `near`. Default 25000, max 500000. */\n radius?: number;\n type?: RoadEventType | readonly RoadEventType[];\n severity?: RoadSeverity | readonly RoadSeverity[];\n status?: \"active\" | \"planned\" | \"archived\";\n /** ISO 8601. Only events the publisher changed at or after this time. */\n updated_since?: string;\n /** 1 to 500, default 100. Applied AFTER the endpoint's own narrowing. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface RoadsOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for `429`, `502`, `503` and transport failures. `false` disables it.\n *\n * On by default. `Retry-After` is on a `429` other than `billing_required`, and on a container\n * `503`. A `502` has none: routing and `/elevation` both use\n * `upstream_error`. With no header the client backs off itself. A wait longer than\n * `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds` instead.\n * See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A road events failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches this alongside\n * every other unmap client's errors. `status` and `code` carry the HTTP status and the\n * gateway's error code, and `retryAfterSeconds` comes from the `Retry-After` header.\n */\nexport class RoadsError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"RoadsError\";\n }\n}\n\nfunction list(value: string | readonly string[] | undefined): string | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value.join(\",\") : String(value);\n}\n\nasync function errorFrom(res: Response, path: string, name: string): Promise<RoadsError> {\n const fallback = `${name} ${res.status} on ${path}`;\n let body: { error?: unknown; code?: unknown } | undefined;\n try {\n body = (await res.json()) as { error?: unknown; code?: unknown };\n } catch {\n body = undefined;\n }\n const reason = typeof body?.error === \"string\" ? body.error : undefined;\n const code = typeof body?.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get(\"retry-after\") ?? null) ?? undefined;\n return new RoadsError(res.status, reason ? `${reason} (${fallback})` : fallback, code, retryAfter);\n}\n\n/**\n * Canadian road events.\n *\n * const { data, meta } = await unmap.roads.closures({ jurisdiction: \"CA-BC\" });\n *\n * A 503 means every requested jurisdiction was unreachable; the body still carries\n * `meta.unavailable`, so the thrown error is the exception rather than the information. Prefer\n * reading `meta.unavailable` on a 200 over treating an empty list as good news.\n */\nexport class Roads {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: RoadsOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n /** Every current road event. */\n incidents(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/incidents\", query);\n }\n\n /** The subset where a road is actually shut. Narrowed before `limit` is applied. */\n closures(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/closures\", query);\n }\n\n /**\n * The subset carrying a surface condition.\n *\n * Thin for British Columbia by design: its feed reports lane availability rather than the\n * surface, so unmap answers `unknown` instead of inferring a dry road from open lanes.\n */\n conditions(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/road-conditions\", query);\n }\n\n private async request(path: string, query: RoadEventQuery): Promise<RoadEventsResponse> {\n const q = new URLSearchParams({ key: this.key });\n const params: Record<string, string | undefined> = {\n jurisdiction: list(query.jurisdiction),\n bbox: query.bbox?.join(\",\"),\n near: query.near?.join(\",\"),\n radius: query.radius != null ? String(query.radius) : undefined,\n type: list(query.type),\n severity: list(query.severity),\n status: query.status,\n updated_since: query.updated_since,\n limit: query.limit != null ? String(query.limit) : undefined,\n };\n for (const [k, v] of Object.entries(params)) if (v != null && v !== \"\") q.set(k, v);\n\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${path}?${q}`,\n { signal: query.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) throw await errorFrom(res, path, \"roads\");\n return (await res.json()) as RoadEventsResponse;\n }\n}\n\n// ---------------------------------------------------------------------------------------------\n// Feedback\n// ---------------------------------------------------------------------------------------------\n\nexport type FeedbackProduct =\n | \"tiles\"\n | \"terrain\"\n | \"names\"\n | \"geocoding\"\n | \"places\"\n | \"routing\"\n | \"layers\"\n | \"transit\"\n | \"roads\"\n | \"ev\";\n\nexport type FeedbackCategory =\n | \"incorrect_location\"\n | \"incorrect_address\"\n | \"missing_place\"\n | \"wrong_place_name\"\n | \"wrong_category\"\n | \"bad_route\"\n | \"missing_road_closure\"\n | \"incorrect_road_condition\"\n | \"incorrect_transit_result\"\n | \"other\";\n\nexport interface FeedbackReport {\n product: FeedbackProduct;\n category: FeedbackCategory;\n /** Up to 2000 characters, stored exactly as written. One of this or `resultId` is required. */\n description?: string;\n /** The unmap id of the result being reported. */\n resultId?: string;\n /**\n * The request being reported.\n *\n * **Only send this with the reporter's explicit agreement.** The gateway refuses it without\n * `include_context: true`, which this sets whenever `context` is present, and that flag is\n * meant to record a person's choice rather than a client default. unmap redacts query strings\n * from its own logs; a client that attached them here would undo that.\n */\n context?: unknown;\n signal?: AbortSignal;\n}\n\nexport interface FeedbackReceipt {\n /** Quote this in a follow-up. */\n id: string;\n status: string;\n created_at: string;\n /** Whether a request context was actually kept. `false` when none was offered. */\n context_stored: boolean;\n}\n\n/**\n * Report wrong data.\n *\n * await unmap.feedback.submit({\n * product: \"geocoding\",\n * category: \"incorrect_location\",\n * description: \"17 Ave SW returns a street in Edmonton.\",\n * });\n *\n * Authenticated like everything else and **never metered**: telling us our data is wrong does not\n * cost a call. At most 200 reports per account per day.\n */\nexport class Feedback {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n\n constructor(opts: RoadsOptions) {\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n submit(report: FeedbackReport): Promise<FeedbackReceipt> {\n return this.post(\"/feedback\", {\n product: report.product,\n category: report.category,\n ...(report.description ? { description: report.description } : {}),\n ...(report.resultId ? { result_id: report.resultId } : {}),\n ...(report.context !== undefined ? { include_context: true, context: report.context } : {}),\n }, report.signal);\n }\n\n /** A report about one place. `product` and `result_id` come from the path. */\n aboutPlace(\n placeId: string,\n report: Omit<FeedbackReport, \"product\" | \"resultId\">,\n ): Promise<FeedbackReceipt> {\n return this.post(`/places/${encodeURIComponent(placeId)}/feedback`, {\n category: report.category,\n ...(report.description ? { description: report.description } : {}),\n ...(report.context !== undefined ? { include_context: true, context: report.context } : {}),\n }, report.signal);\n }\n\n private async post(path: string, body: unknown, signal?: AbortSignal): Promise<FeedbackReceipt> {\n // Deliberately NOT routed through `fetchWithRetry`, unlike every read on this client.\n //\n // A feedback submission creates a record and carries no idempotency key, so a retry after a\n // timeout or a 503 risks filing the same report twice. Retrying a read costs a round trip;\n // retrying this costs the quality programme a duplicate, and the caller is the only one who\n // knows whether their report already landed.\n const res = await this.fetchImpl(`${this.base}${path}`, {\n method: \"POST\",\n signal,\n headers: { \"content-type\": \"application/json\", authorization: `Bearer ${this.key}` },\n body: JSON.stringify(body),\n });\n if (!res.ok) throw await errorFrom(res, path, \"feedback\");\n return (await res.json()) as FeedbackReceipt;\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\nexport type TransitMetaStatus = \"current\" | \"stale\" | \"partial\" | \"unknown\";\n\nexport interface TransitMeta {\n /** Static GTFS is scheduled data. Realtime will use a different value and updated_at. */\n schedule_type: \"scheduled\";\n source?: string;\n source_updated_at?: string | null;\n source_version?: string;\n content_hash?: string | null;\n sources?: readonly {\n id: string;\n source: string;\n source_url: string;\n attribution: string;\n source_updated_at: string | null;\n source_version: string;\n content_hash: string | null;\n status: \"current\" | \"stale\" | \"unknown\";\n }[];\n unmap_updated_at: string;\n data_version?: string;\n status: TransitMetaStatus;\n attribution: string;\n}\n\nexport interface TransitResponse<T> {\n data: T;\n meta: TransitMeta;\n}\n\nexport interface TransitAgency {\n id: string;\n feed: string;\n name: string;\n url?: string;\n timezone: string;\n lang?: string;\n phone?: string;\n fare_url?: string;\n}\n\nexport interface TransitStop {\n id: string;\n feed: string;\n name: string;\n coordinates: [number, number];\n code?: string;\n description?: string;\n zone_id?: string;\n parent_station_id?: string;\n wheelchair_boarding?: 0 | 1 | 2;\n route_ids: string[];\n /** Metres from the requested point. Present only on nearbyStops. */\n distance?: number;\n}\n\nexport interface TransitRoute {\n id: string;\n feed: string;\n agency_id: string;\n short_name?: string;\n long_name?: string;\n description?: string;\n route_type: number;\n colour?: string;\n text_colour?: string;\n url?: string;\n}\n\nexport interface TransitDeparture {\n stop_id: string;\n route_id: string;\n trip_id: string;\n headsign?: string;\n arrival: string;\n departure: string;\n stop_sequence: number;\n /** 2 = phone agency; 3 = coordinate with driver. Omitted for ordinary pickup. */\n pickup_type?: 2 | 3;\n schedule_type: \"scheduled\";\n}\n\nexport interface NearbyStopsOptions {\n /** Metres. Default 1000, range 50 to 10000. */\n radius?: number;\n /** Default 20, maximum 100. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface DepartureOptions {\n /** An instant. Date values serialize to ISO; strings must include Z or an offset. Default now. */\n at?: Date | string;\n /** Minutes after at. Default 60, maximum 240. */\n window?: number;\n /** Default 50, maximum 200. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface TransitOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for `429`, `502`, `503` and transport failures. `false` disables it.\n *\n * On by default. `Retry-After` is on a `429` other than `billing_required`, and on a container\n * `503`. A `502` has none: routing and `/elevation` both use\n * `upstream_error`. With no header the client backs off itself. A wait longer than\n * `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds` instead.\n * See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A transit failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches this alongside\n * every other unmap client's errors. `status` and `code` carry the HTTP status and the\n * gateway's error code, and `retryAfterSeconds` comes from the `Retry-After` header.\n */\nexport class TransitError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"TransitError\";\n }\n}\n\n/**\n * The gateway's error body, as a `TransitError`.\n *\n * Named rather than inline since 2026-09-20: `fetchWithRetry` needs to inspect the failure to\n * decide whether to wait, and the throw needs to build the same error. Two copies of this would\n * be two chances for the retry predicate and the thrown error to disagree.\n */\nasync function errorFrom(res: Response, path: string): Promise<TransitError> {\n let body: { error?: unknown; code?: unknown } = {};\n try {\n body = (await res.json()) as typeof body;\n } catch {\n /* use the bounded fallback */\n }\n const message = typeof body.error === \"string\" ? body.error : `transit ${res.status} on ${path}`;\n const code = typeof body.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get(\"retry-after\") ?? null) ?? undefined;\n return new TransitError(res.status, message, code, retryAfter);\n}\n\n/** Static Canadian GTFS data. Scheduled departures ship before realtime. */\nexport class Transit {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: TransitOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n agencies(signal?: AbortSignal): Promise<TransitResponse<TransitAgency[]>> {\n return this.get(\"/transit/agencies\", undefined, signal);\n }\n\n nearbyStops(near: [number, number], options: NearbyStopsOptions = {}): Promise<TransitResponse<TransitStop[]>> {\n return this.get(\"/transit/stops\", {\n near: near.join(\",\"),\n radius: options.radius,\n limit: options.limit,\n }, options.signal);\n }\n\n getStop(id: string, signal?: AbortSignal): Promise<TransitResponse<TransitStop>> {\n return this.get(`/transit/stops/${encodeURIComponent(id)}`, undefined, signal);\n }\n\n getRoute(id: string, signal?: AbortSignal): Promise<TransitResponse<TransitRoute>> {\n return this.get(`/transit/routes/${encodeURIComponent(id)}`, undefined, signal);\n }\n\n departures(id: string, options: DepartureOptions = {}): Promise<TransitResponse<TransitDeparture[]>> {\n return this.get(`/transit/stops/${encodeURIComponent(id)}/departures`, {\n at: options.at instanceof Date ? options.at.toISOString() : options.at,\n window: options.window,\n limit: options.limit,\n }, options.signal);\n }\n\n private async get<T>(\n path: string,\n values?: Record<string, string | number | undefined>,\n signal?: AbortSignal,\n ): Promise<TransitResponse<T>> {\n const query = new URLSearchParams({ key: this.key });\n for (const [name, value] of Object.entries(values ?? {})) {\n if (value !== undefined) query.set(name, String(value));\n }\n const response = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${path}?${query}`,\n { signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!response.ok) throw await errorFrom(response, path);\n return await response.json() as TransitResponse<T>;\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * `GET /coverage.json` — where each capability actually works, and where it does not.\n *\n * The document is generated from the gateway's source registry rather than written by hand, so\n * it cannot claim a capability with no registered source behind it. It is also the only place\n * that answers \"is transit routing live in this city\" before you promise a user an answer:\n * routing covers only the feeds marked routing-ready, road events cover two provinces, and Places coverage is OpenStreetMap's,\n * which is thin outside cities.\n *\n * Unauthenticated and unmetered on the gateway, which is why this client takes no key: a\n * developer deciding whether to use unmap has no key yet, and a customer checking whether a gap\n * has closed should not pay a call to be told it has not.\n */\n\n/** The one path this client calls. A literal so the gateway's SDK-parity audit can see it. */\nconst COVERAGE_PATH = \"/coverage.json\";\n\n/** Freshness of a capability or a source. `unknown` means no cadence was declared. */\nexport type CoverageFreshness = \"current\" | \"stale\" | \"unknown\";\n\n/** How a source's freshness is judged, mirrored from the gateway's `FreshnessPolicy`. */\nexport interface CoverageFreshnessPolicy {\n /** ISO 8601 duration, `static`, or `unknown`. */\n interval: string;\n basis: string;\n /** When `freshness_status` stops being true, or null when staleness cannot be asked. */\n stale_after: string | null;\n}\n\n/** Where a source's data came from and when unmap last produced it. */\nexport interface CoverageProvenance {\n source_updated_at: string | null;\n unmap_updated_at: string | null;\n build_id: string | null;\n version: string;\n content_hash: string | null;\n freshness_policy: CoverageFreshnessPolicy;\n freshness_status: CoverageFreshness;\n /** Counts the producing job measured. Omitted when it measured none. */\n measurements?: Record<string, number>;\n}\n\nexport interface CoverageSource {\n id: string;\n provider: string;\n /** Bilingual, like every human-readable field in this document. */\n dataset_name: { en: string; fr: string };\n canonical_url: string;\n licence: { en: string; fr: string };\n licence_url: string;\n attribution: string;\n jurisdiction: string[];\n /** ISO 8601 duration, e.g. `P1D`. */\n refresh_interval: string;\n last_checked_at: string;\n /** Upstream's edition date, when unmap last produced the data, which build did, and how fresh that is. */\n provenance: CoverageProvenance;\n coverage: string;\n known_gaps: { en: string; fr: string };\n quality_status: string;\n /** A note on the source, in English, present only when there is one. */\n notes?: string;\n}\n\nexport interface CoverageCapability {\n /** `tiles`, `geocoding`, `routing`, `places`, `transit`, `roads`, and so on. */\n id: string;\n display_name: { en: string; fr: string };\n /** `planned` is published as honestly as `live`: a capability absent from the page reads as \"not our problem\". */\n availability: \"live\" | \"planned\";\n /** The endpoints that serve it. Empty while planned. */\n endpoints: string[];\n coverage: { en: string; fr: string };\n /** Written to be accurate rather than flattering. Read this before promising coverage to a user. */\n known_gaps: { en: string; fr: string };\n /** ISO 3166-2 subdivisions, or `CA` for national. */\n jurisdictions: string[];\n freshness_status: CoverageFreshness;\n sources: CoverageSource[];\n}\n\nexport interface CoverageDocument {\n generated_at: string;\n /** How to read the dates below, in both official languages. */\n freshness_basis: { en: string; fr: string };\n /** Schema tag of the manifests behind `provenance`, so a consumer can pin what it parses. */\n provenance_schema: string;\n capabilities: CoverageCapability[];\n /** Every jurisdiction code any source claims. */\n jurisdictions: string[];\n}\n\nexport class CoverageError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"CoverageError\";\n }\n}\n\nexport interface CoverageOptions {\n gateway?: string;\n /** Override the fetch implementation (tests, non-global environments). */\n fetch?: typeof fetch;\n retry?: RetryPolicy | false;\n}\n\n/** Where unmap works. Takes no key: the endpoint is unauthenticated and unmetered. */\nexport class Coverage {\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: CoverageOptions = {}) {\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n this.retry = opts.retry;\n }\n\n /** The whole document. Cached an hour at the edge, so polling it is cheap. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<CoverageDocument> {\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${COVERAGE_PATH}`,\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) {\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n throw new CoverageError(res.status, `coverage ${res.status}`, undefined, retryAfter);\n }\n return (await res.json()) as CoverageDocument;\n }\n\n /**\n * One capability by id, or `undefined` when the document does not describe it.\n *\n * const transit = await unmap.coverage.capability(\"transit\");\n * if (!transit?.jurisdictions.includes(\"CA-ON\")) return \"not available here yet\";\n */\n async capability(id: string, opts: { signal?: AbortSignal } = {}): Promise<CoverageCapability | undefined> {\n const doc = await this.get(opts);\n return doc.capabilities.find((c) => c.id === id);\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/** The one path this client calls. A literal so the gateway's SDK-parity audit can see it. */\nconst TIMEZONE_PATH = \"/timezone\";\n\nexport interface TimezoneResult {\n timezone: string | null;\n offset: string | null;\n offsetSeconds: number | null;\n dst: boolean | null;\n}\n\nexport interface TimezoneLookupOptions {\n /** Instant the offset is evaluated at. Omit it for the current time. */\n at?: Date;\n signal?: AbortSignal;\n}\n\nexport class TimezoneError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"TimezoneError\";\n }\n}\n\nexport interface TimezoneOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n retry?: RetryPolicy | false;\n}\n\n/**\n * IANA timezone for a coordinate.\n *\n * const zone = await unmap.timezone.lookup([-114.0719, 51.0447]);\n *\n * The coordinate is `[longitude, latitude]`, the same order as the rest of the SDK.\n * `at` selects the offset. It does not change which zone the coordinate falls in.\n */\nexport class Timezone {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: TimezoneOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n async lookup(coordinate: [number, number], opts: TimezoneLookupOptions = {}): Promise<TimezoneResult> {\n const [lon, lat] = coordinate;\n const q = new URLSearchParams({ key: this.key, lon: String(lon), lat: String(lat) });\n if (opts.at) q.set(\"at\", opts.at.toISOString());\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${TIMEZONE_PATH}?${q}`,\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) throw await errorFrom(res);\n return (await res.json()) as TimezoneResult;\n }\n}\n\nasync function errorFrom(res: Response): Promise<TimezoneError> {\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n let message = res.statusText || `timezone ${res.status}`;\n let code: string | undefined;\n try {\n const body = (await res.json()) as { error?: unknown; code?: unknown };\n if (typeof body.error === \"string\" && body.error) message = body.error;\n if (typeof body.code === \"string\") code = body.code;\n } catch {\n /* a non-JSON failure still carries the status */\n }\n return new TimezoneError(res.status, message, code, retryAfter);\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * Clients for the named Canadian layer catalog (`/layers`) and for tenant overlays (`/byod`).\n *\n * Both existed as endpoints with no client until the SDK parity audit\n * (`apps/gateway/test/sdk-parity.test.ts`) went looking and found them. They were the two entries\n * in that audit's `KNOWN_GAPS`; this closes both.\n *\n * ## Why these are the two that mattered\n *\n * `@unmap/maps` already consumes layer and overlay **tiles** through a style document, which is\n * why the gap was easy to miss: maps work. What had no client was everything *around* the tiles.\n * Nothing could ask what layers exist, what a layer's licence says, or which add-on it needs, and\n * nothing could upload an overlay without hand-rolling a multipart request.\n */\n\n// ---------------------------------------------------------------------------------------------\n// The named layer catalog\n// ---------------------------------------------------------------------------------------------\n\nexport interface LayerArchive {\n id: string;\n minzoom: number;\n maxzoom: number;\n}\n\n/**\n * The capability a gated layer's tiles need. These are capability ids (`legalLand`), not the\n * `addon-*` SKUs a customer buys (`addon-legal-land`).\n */\nexport type LayerCapability = \"legalLand\" | \"energy\" | \"agriculture\" | \"remote\" | \"mining\";\n\n/**\n * One catalog layer.\n *\n * `licence`, `attribution` and `known_gaps` are the reason to read this rather than hard-code a\n * layer id: they are the governance record, and a caller displaying a layer has to display its\n * attribution.\n */\nexport interface Layer {\n id: string;\n display_name: { en: string; fr: string };\n namespace?: \"core\" | \"survey\" | \"energy\" | \"agriculture\" | \"remote\" | \"mining\";\n /** ISO 3166 codes where coverage is VERIFIED. `coverage` carries the prose, including gaps. */\n jurisdiction?: string[];\n source?: string;\n source_url?: string;\n licence: string;\n attribution: string;\n coverage: string;\n resolution?: string;\n updated_at?: string;\n source_updated_at?: string;\n ingestion_version?: string;\n schema_version?: string;\n freshness_policy?: string;\n known_gaps?: string;\n /**\n * The capability this layer's tiles need, or null when it is core. Reading the catalog is never\n * gated; the tiles are, and answer `403` `addon_required` on a key without the add-on.\n */\n addon?: LayerCapability | null;\n archives?: LayerArchive[];\n /** Vector source-layer name inside the archive. */\n source_layer?: string;\n /** Every source-layer, present only when the archive stacks more than one (survey grids). */\n source_layers?: string[];\n}\n\n// ---------------------------------------------------------------------------------------------\n// Tenant overlays (BYOD)\n// ---------------------------------------------------------------------------------------------\n\nexport interface ByodOverlay {\n /** `ovl_` plus twelve hex characters. */\n id: string;\n name: string;\n kind: \"geojson\" | \"pmtiles\";\n bytes: number;\n createdAt: string;\n url: string;\n /** The `byod:<id>` token to pass to `overlays`. This is the field you actually want. */\n overlay: string;\n}\n\nexport interface ByodList {\n overlays: ByodOverlay[];\n /** The caps, from the server rather than from a constant here that could drift. */\n limits: { maxFiles: number; maxBytes: number; kinds: string[] };\n}\n\nexport interface CatalogOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for reads (`429`, `502`, `503` and transport failures). `false` disables it.\n * Uploads and deletes are never retried. See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A layer-catalog or overlay failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches it alongside every\n * other unmap client's errors. `code` is the gateway's: `not_found` for an unknown layer or\n * overlay id, `bad_request` for an upload the server refused (wrong type, over the size cap, or\n * over the overlay count).\n */\nexport class CatalogError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"CatalogError\";\n }\n}\n\nasync function errorFrom(res: Response, path: string): Promise<CatalogError> {\n const fallback = `catalog ${res.status} on ${path}`;\n let body: { error?: unknown; code?: unknown } | undefined;\n try {\n body = (await res.json()) as { error?: unknown; code?: unknown };\n } catch {\n body = undefined;\n }\n const reason = typeof body?.error === \"string\" ? body.error : undefined;\n const code = typeof body?.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n return new CatalogError(res.status, reason ? `${reason} (${fallback})` : fallback, code, retryAfter);\n}\n\n/** The pieces both clients share: the key, the base URL, fetch, and the read path. */\nabstract class KeyedClient {\n protected readonly key: string;\n protected readonly base: string;\n protected readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: CatalogOptions) {\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n this.retry = opts.retry;\n }\n\n protected url(path: string, values?: Record<string, string | undefined>): string {\n const query = new URLSearchParams({ key: this.key });\n for (const [name, value] of Object.entries(values ?? {})) {\n if (value !== undefined) query.set(name, value);\n }\n return `${this.base}${path}?${query}`;\n }\n\n /** A GET, retried per the policy. Throws `CatalogError` on a non-2xx. */\n protected async read(path: string, init: RequestInit, values?: Record<string, string | undefined>): Promise<Response> {\n const res = await fetchWithRetry(this.fetchImpl, this.url(path, values), init, this.retry);\n if (!res.ok) throw await errorFrom(res, path);\n return res;\n }\n}\n\n/**\n * The named Canadian layer catalog.\n *\n * const layers = await unmap.layers.list({ jurisdiction: \"CA-AB\" });\n * const parcels = await unmap.layers.get(\"survey.dls\");\n * console.log(parcels.attribution, parcels.known_gaps);\n *\n * A retired or misspelled id is a plain `404` `not_found`, the same as one that never existed:\n * the gateway keeps no aliases for renamed layers.\n */\nexport class Catalog extends KeyedClient {\n /**\n * Every catalog layer, or only those with verified coverage in `jurisdiction`.\n *\n * A country code matches its own subdivisions (`CA` includes `CA-AB`). An unknown code is an\n * empty list, not an error: the catalog has nothing there.\n */\n async list(opts: { jurisdiction?: string; signal?: AbortSignal } = {}): Promise<Layer[]> {\n const res = await this.read(\n \"/layers\",\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n { jurisdiction: opts.jurisdiction },\n );\n const body = (await res.json()) as { layers?: Layer[] } | Layer[];\n return Array.isArray(body) ? body : (body.layers ?? []);\n }\n\n /** One layer by id. Throws `CatalogError` 404 `not_found` when it does not exist. */\n async get(id: string, opts: { signal?: AbortSignal } = {}): Promise<Layer> {\n const res = await this.read(`/layers/${encodeURIComponent(id)}`, {\n signal: opts.signal,\n headers: { accept: \"application/json\" },\n });\n return (await res.json()) as Layer;\n }\n}\n\n/**\n * Tenant overlays: your own GeoJSON or PMTiles, stored against your key.\n *\n * const { overlay } = await unmap.byod.upload(file, { name: \"Service areas\" });\n * const map = new Unmap({ key, container: \"#map\", overlays: [overlay] });\n *\n * The `overlay` field on the result is the `byod:<id>` token: that is what `overlays` takes, not\n * the bare id, and returning the whole record rather than just the id is what makes that hard to\n * get wrong.\n *\n * Hard caps are the server's (10 overlays, 5 MiB each) and are reported by `list()` rather than\n * duplicated here, so a change on the server cannot leave a stale constant in the client.\n */\nexport class Byod extends KeyedClient {\n /** Overlays on this tenant, plus the server's current limits. */\n async list(opts: { signal?: AbortSignal } = {}): Promise<ByodList> {\n const res = await this.read(\"/byod\", { signal: opts.signal, headers: { accept: \"application/json\" } });\n return (await res.json()) as ByodList;\n }\n\n /** One overlay's metadata. */\n async get(id: string, opts: { signal?: AbortSignal } = {}): Promise<ByodOverlay> {\n const res = await this.read(`/byod/${encodeURIComponent(id)}`, {\n signal: opts.signal,\n headers: { accept: \"application/json\" },\n });\n return (await res.json()) as ByodOverlay;\n }\n\n /**\n * Upload an overlay.\n *\n * Accepts a `Blob`/`File`, a `GeoJSON` object, or raw bytes. The content type is chosen from\n * what was passed rather than asked for: a plain object is GeoJSON, and anything binary is\n * PMTiles unless the caller says otherwise. Getting that wrong is a 400 from the server, so\n * inferring it here removes the most likely way to fail this call.\n *\n * Never retried: an upload mints a new overlay id and carries no idempotency key, so a retry\n * after a lost response would spend a second of the ten slots on a duplicate.\n */\n async upload(\n body: Blob | ArrayBuffer | Uint8Array | Record<string, unknown>,\n opts: { name?: string; kind?: \"geojson\" | \"pmtiles\"; signal?: AbortSignal } = {},\n ): Promise<ByodOverlay> {\n let payload: BodyInit;\n let contentType: string | undefined;\n let name: string | undefined;\n\n if (typeof Blob !== \"undefined\" && body instanceof Blob) {\n // A File carries its own name, which is a better default than anything we could invent.\n const form = new FormData();\n form.append(\"file\", body);\n if (opts.name) form.append(\"name\", opts.name);\n payload = form;\n // Deliberately unset: the runtime has to add the multipart boundary, and setting\n // content-type by hand produces a request the server cannot parse.\n contentType = undefined;\n } else if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {\n payload = body as BodyInit;\n contentType = opts.kind === \"geojson\" ? \"application/geo+json\" : \"application/vnd.pmtiles\";\n name = opts.name;\n } else {\n payload = JSON.stringify(body);\n contentType = \"application/geo+json\";\n name = opts.name;\n }\n\n const res = await this.fetchImpl(this.url(\"/byod\", { name }), {\n method: \"POST\",\n signal: opts.signal,\n headers: contentType ? { \"content-type\": contentType } : undefined,\n body: payload,\n });\n if (!res.ok) throw await errorFrom(res, \"/byod\");\n return (await res.json()) as ByodOverlay;\n }\n\n /**\n * Delete an overlay.\n *\n * Never retried: a retry after a delete whose response was lost answers `404`, which would\n * report a failure for a delete that succeeded.\n */\n async delete(id: string, opts: { signal?: AbortSignal } = {}): Promise<void> {\n const path = `/byod/${encodeURIComponent(id)}`;\n const res = await this.fetchImpl(this.url(path), { method: \"DELETE\", signal: opts.signal });\n if (!res.ok) throw await errorFrom(res, path);\n }\n\n /** The stored bytes. GeoJSON parses; PMTiles is binary and belongs to MapLibre. */\n async data(id: string, opts: { signal?: AbortSignal } = {}): Promise<Response> {\n // The raw Response, not a parsed body: one of the two kinds is a binary archive that a caller\n // streams rather than reads, and guessing which they wanted would be worse than handing it over.\n return this.read(`/byod/${encodeURIComponent(id)}/data`, { signal: opts.signal });\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAKK;AACP,SAAS,UAAU,cAAkG;;;ACPrH,SAAS,iBAAiB,YAAY,gBAAgB,uBAAyC;AAmJxF,IAAM,aAAN,cAAyB,WAAW;AAAA,EACzC,YAAY,QAAgB,SAAiB,MAAe,mBAA4B;AACtF,UAAM,QAAQ,SAAS,MAAM,iBAAiB;AAC9C,SAAK,OAAO;AAAA,EACd;AACF;AAEA,SAAS,KAAK,OAAmE;AAC/E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,GAAG,IAAI,OAAO,KAAK;AAC9D;AAEA,eAAe,UAAU,KAAe,MAAc,MAAmC;AACvF,QAAM,WAAW,GAAG,IAAI,IAAI,IAAI,MAAM,OAAO,IAAI;AACjD,MAAI;AACJ,MAAI;AACF,WAAQ,MAAM,IAAI,KAAK;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAM,SAAS,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ;AAC9D,QAAM,OAAO,OAAO,MAAM,SAAS,WAAW,KAAK,OAAO;AAC1D,QAAM,aAAa,gBAAgB,IAAI,SAAS,IAAI,aAAa,KAAK,IAAI,KAAK;AAC/E,SAAO,IAAI,WAAW,IAAI,QAAQ,SAAS,GAAG,MAAM,KAAK,QAAQ,MAAM,UAAU,MAAM,UAAU;AACnG;AAWO,IAAM,QAAN,MAAY;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEjB,YAAY,MAAoB;AAC9B,SAAK,QAAQ,KAAK;AAClB,SAAK,MAAM,KAAK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IAAI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,QAAQ,IAAI;AAC9B,SAAK,OAAO,IAAI,KAAK,IAAI;AACzB,SAAK,OAAO,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,WAAW,SAAS,EAAE;AACxE,QAAI,KAAK,WAAW;AAClB,WAAK,MAAM,UAAU,EAAE,GAAG,MAAM,WAAW,KAAK,UAAU,CAAoB;AAAA,IAChF;AAAA,EACF;AAAA;AAAA,EAGA,SAAS,MAAkD;AACzD,WAAO,KAAK,SAAS,SAAS,IAAI;AAAA,EACpC;AACF;","names":["DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","createMap","UnmapError","parseRetryAfter"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/roads.ts","../src/transit.ts","../src/coverage.ts","../src/timezone.ts","../src/catalog.ts"],"sourcesContent":["import {\n createMap,\n type Map as MaplibreMap,\n type MapProfile,\n type UnmapControlsOptions,\n type UnmapMapOptions,\n} from \"@unmap/maps\";\nimport { Geocoder, Places, type IdentifyOptions, type IdentifyResponse, type QueryOptions, type QueryResponse } from \"@unmap/geocoding\";\nimport { Feedback, Roads } from \"./roads\";\nimport { Transit } from \"./transit\";\nimport { Coverage } from \"./coverage\";\nimport { Timezone } from \"./timezone\";\nimport { Byod, Catalog } from \"./catalog\";\nimport { Router } from \"@unmap/routing\";\nimport { Elevation } from \"@unmap/elevation\";\nimport type { RetryPolicy } from \"@unmap/core\";\n\nexport * from \"@unmap/geocoding\";\nexport * from \"@unmap/routing\";\nexport * from \"@unmap/elevation\";\nexport * from \"./roads\";\nexport * from \"./transit\";\nexport * from \"./coverage\";\nexport * from \"./timezone\";\nexport * from \"./catalog\";\nexport { createMap, unmapStyle, DEMO_CITIES, STYLE_NAMES, maplibregl } from \"@unmap/maps\";\nexport type {\n Map,\n UnmapMapOptions,\n UnmapControlsOptions,\n DemoCity,\n StyleName,\n StyleInput,\n Projection,\n MapProfile,\n} from \"@unmap/maps\";\n\nexport interface UnmapOptions {\n key: string;\n gateway?: string;\n /** Override the fetch implementation (tests, non-global environments). */\n fetch?: typeof fetch;\n /**\n * Retry policy shared by every client on this instance. `false` disables it.\n *\n * On by default for `429`, `502`, `503` and transport failures. `Retry-After` is on a `429`\n * other than `billing_required`, and on a container `503`. A `502` has none. A wait longer\n * than `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds`\n * instead, because a cold land or energy container asks for 60 and parking a request handler\n * for a minute is a worse surprise than an error. Feedback submissions are never retried:\n * they create a record and carry no idempotency key.\n */\n retry?: RetryPolicy | false;\n /** If provided, a map is mounted in this container. */\n container?: string | HTMLElement;\n style?: string;\n /** \"light\" or \"dark\", light by default. Applies to a bare style name; a `<style>-<mode>` string is passed through as written and `mode` does not change it. */\n mode?: string;\n /** Label language, e.g. \"fr\". Omit to follow the request's Accept-Language. */\n lang?: string;\n /** Compact `ut1.` theme code from unmap.dev/create. Wins over the path style on the gateway. */\n theme?: string;\n /** Catalog layer ids composed onto the style (`municipalities`, `survey.dls`, …). */\n overlays?: readonly string[];\n /** Composition preset. Not a style. Explicit overlays replace the profile list. */\n profile?: MapProfile;\n /** `\"globe\"` (the default) or `\"mercator\"`. See `@unmap/maps` `UnmapMapOptions.projection`. */\n projection?: UnmapMapOptions[\"projection\"];\n center?: [number, number];\n zoom?: number;\n /** On-map controls. `true` (the default) adds zoom and compass buttons; `false` adds none. */\n controls?: boolean | UnmapControlsOptions;\n}\n\n/**\n * One Stripe-style key, the whole platform. With a `container` you get a rendered map.\n * `geocoder`, `router`, `elevation`, and `timezone` are always available.\n *\n * const map = new Unmap({ key: \"um_live_...\", container: \"#map\", center: [-75.69, 45.42] });\n */\nexport class Unmap {\n readonly geocoder: Geocoder;\n readonly router: Router;\n readonly elevation: Elevation;\n /** IANA timezone and the UTC offset at an instant. One call, anywhere. */\n readonly timezone: Timezone;\n /** Canadian points of interest. Same corpus as the geocoder, in the Place shape. */\n readonly places: Places;\n /** Closures, incidents, construction and road conditions. */\n readonly roads: Roads;\n /** Report wrong data. Never metered. */\n readonly feedback: Feedback;\n /** Scheduled public-transit agencies, stops, routes and departures. */\n readonly transit: Transit;\n /**\n * Where each capability actually works. Unauthenticated and unmetered, so checking costs\n * nothing: read it before promising a user an answer, because transit routing covers only the feeds\n * marked routing-ready and road events cover two provinces.\n */\n readonly coverage: Coverage;\n /** The named Canadian layer catalog: what exists, its licence, and what it does not cover. */\n readonly layers: Catalog;\n /** Your own GeoJSON and PMTiles overlays, stored against this key. */\n readonly byod: Byod;\n readonly data: { query(opts: QueryOptions): Promise<QueryResponse> };\n readonly map?: MaplibreMap;\n\n constructor(opts: UnmapOptions) {\n this.geocoder = new Geocoder(opts);\n this.router = new Router(opts);\n this.elevation = new Elevation(opts);\n this.timezone = new Timezone(opts);\n this.places = new Places(opts);\n this.roads = new Roads(opts);\n this.feedback = new Feedback(opts);\n this.transit = new Transit(opts);\n this.coverage = new Coverage(opts);\n this.layers = new Catalog(opts);\n this.byod = new Byod(opts);\n this.data = { query: (queryOpts) => this.geocoder.queryLayer(queryOpts) };\n if (opts.container) {\n this.map = createMap({ ...opts, container: opts.container } as UnmapMapOptions);\n }\n }\n\n /** Which catalog features contain a point. See `Geocoder.identify`. */\n identify(opts: IdentifyOptions): Promise<IdentifyResponse> {\n return this.geocoder.identify(opts);\n }\n}\n\n// The shared error type and retry policy, re-exported so a caller who installed only this\n// package can `catch (e) { if (e instanceof UnmapError) }` without adding @unmap/core.\nexport { UnmapError, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * Typed clients for road events (`/incidents`, `/closures`, `/road-conditions`) and for data\n * correction (`POST /feedback`).\n *\n * These live in `@unmap/sdk` rather than in packages of their own. A twelfth and thirteenth npm\n * package would each need an entry in the changesets fixed group and a trusted publisher\n * configured on npmjs.com, which is founder work, and neither has a framework wrapper the way\n * geocoding and routing do. If a customer ever wants roads without the rest of the SDK, that is\n * the moment to split it out.\n */\n\nexport type RoadEventType =\n | \"closure\"\n | \"incident\"\n | \"construction\"\n | \"weather\"\n | \"restriction\"\n | \"ferry\"\n | \"hazard\"\n | \"special_event\"\n | \"unknown\";\n\nexport type RoadCondition =\n | \"dry\"\n | \"wet\"\n | \"snow\"\n | \"ice\"\n | \"packed_snow\"\n | \"reduced_visibility\"\n | \"travel_not_recommended\"\n | \"closed\"\n | \"unknown\";\n\nexport type RoadSeverity = \"minor\" | \"major\" | \"unknown\";\n\nexport interface AffectedRoad {\n name: string;\n direction: \"north\" | \"south\" | \"east\" | \"west\" | \"both\" | \"unknown\";\n /** True only when the publisher says closed. Never inferred from the description. */\n closed: boolean;\n from?: string;\n to?: string;\n condition: RoadCondition;\n}\n\nexport interface RoadEvent {\n /** `um:road:<jurisdiction>:<publisher id>`. */\n id: string;\n /** The publisher's own id, so a report can be taken back to them. */\n source_id: string;\n /** ISO 3166-2, e.g. `CA-BC`. */\n jurisdiction: string;\n type: RoadEventType;\n /** The publisher's own subtype strings, untranslated. */\n subtypes: string[];\n status: \"active\" | \"planned\" | \"archived\";\n severity: RoadSeverity;\n /**\n * The publisher's description, verbatim.\n *\n * Believe this over `type` when they disagree: our categories are a lossy projection of someone\n * else's taxonomy, and the sentence a driver needs is in the prose.\n */\n description: string;\n headline?: string;\n /** The worst surface condition across this event's roads. */\n condition: RoadCondition;\n roads: AffectedRoad[];\n /** GeoJSON Point or LineString, WGS84. */\n geometry: { type: string; coordinates: unknown } | null;\n starts_at: string | null;\n ends_at: string | null;\n source_updated_at: string | null;\n unmap_updated_at: string;\n source: string;\n}\n\nexport interface RoadEventsResponse {\n data: RoadEvent[];\n meta: {\n status: \"current\" | \"stale\" | \"partial\" | \"unknown\";\n attribution: string;\n unmap_updated_at: string;\n /**\n * Jurisdictions that could not be reached, each with a reason.\n *\n * **Check this.** On `/closures` an empty `data` reads as \"nothing is shut\" to someone\n * deciding whether to drive, and that is a very different answer from \"we could not reach\n * British Columbia\".\n */\n unavailable?: { jurisdiction: string; reason: string }[];\n /**\n * Feeds served from unmap's five-minute poll rather than fetched for this request (Alberta),\n * each with its age. A feed older than `max_age_seconds` is in `unavailable` instead.\n */\n polled?: {\n jurisdiction: string;\n feed: \"events\" | \"conditions\";\n polled_at: string;\n age_seconds: number;\n max_age_seconds: number;\n }[];\n };\n}\n\nexport interface RoadEventQuery {\n /** Comma-separated ISO 3166-2 codes, or an array. An uncovered code is a 400, not an empty list. */\n jurisdiction?: string | readonly string[];\n bbox?: [number, number, number, number];\n near?: [number, number];\n /** Metres from `near`. Default 25000, max 500000. */\n radius?: number;\n type?: RoadEventType | readonly RoadEventType[];\n severity?: RoadSeverity | readonly RoadSeverity[];\n status?: \"active\" | \"planned\" | \"archived\";\n /** ISO 8601. Only events the publisher changed at or after this time. */\n updated_since?: string;\n /** 1 to 500, default 100. Applied AFTER the endpoint's own narrowing. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface RoadsOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for `429`, `502`, `503` and transport failures. `false` disables it.\n *\n * On by default. `Retry-After` is on a `429` other than `billing_required`, and on a container\n * `503`. A `502` has none: routing and `/elevation` both use\n * `upstream_error`. With no header the client backs off itself. A wait longer than\n * `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds` instead.\n * See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A road events failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches this alongside\n * every other unmap client's errors. `status` and `code` carry the HTTP status and the\n * gateway's error code, and `retryAfterSeconds` comes from the `Retry-After` header.\n */\nexport class RoadsError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"RoadsError\";\n }\n}\n\nfunction list(value: string | readonly string[] | undefined): string | undefined {\n if (value === undefined) return undefined;\n return Array.isArray(value) ? value.join(\",\") : String(value);\n}\n\nasync function errorFrom(res: Response, path: string, name: string): Promise<RoadsError> {\n const fallback = `${name} ${res.status} on ${path}`;\n let body: { error?: unknown; code?: unknown } | undefined;\n try {\n body = (await res.json()) as { error?: unknown; code?: unknown };\n } catch {\n body = undefined;\n }\n const reason = typeof body?.error === \"string\" ? body.error : undefined;\n const code = typeof body?.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get(\"retry-after\") ?? null) ?? undefined;\n return new RoadsError(res.status, reason ? `${reason} (${fallback})` : fallback, code, retryAfter);\n}\n\n/**\n * Canadian road events.\n *\n * const { data, meta } = await unmap.roads.closures({ jurisdiction: \"CA-BC\" });\n *\n * A 503 means every requested jurisdiction was unreachable; the body still carries\n * `meta.unavailable`, so the thrown error is the exception rather than the information. Prefer\n * reading `meta.unavailable` on a 200 over treating an empty list as good news.\n */\nexport class Roads {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: RoadsOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n /** Every current road event. */\n incidents(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/incidents\", query);\n }\n\n /** The subset where a road is actually shut. Narrowed before `limit` is applied. */\n closures(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/closures\", query);\n }\n\n /**\n * The subset carrying a surface condition.\n *\n * Thin for British Columbia by design: its feed reports lane availability rather than the\n * surface, so unmap answers `unknown` instead of inferring a dry road from open lanes.\n */\n conditions(query: RoadEventQuery = {}): Promise<RoadEventsResponse> {\n return this.request(\"/road-conditions\", query);\n }\n\n private async request(path: string, query: RoadEventQuery): Promise<RoadEventsResponse> {\n const q = new URLSearchParams({ key: this.key });\n const params: Record<string, string | undefined> = {\n jurisdiction: list(query.jurisdiction),\n bbox: query.bbox?.join(\",\"),\n near: query.near?.join(\",\"),\n radius: query.radius != null ? String(query.radius) : undefined,\n type: list(query.type),\n severity: list(query.severity),\n status: query.status,\n updated_since: query.updated_since,\n limit: query.limit != null ? String(query.limit) : undefined,\n };\n for (const [k, v] of Object.entries(params)) if (v != null && v !== \"\") q.set(k, v);\n\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${path}?${q}`,\n { signal: query.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) throw await errorFrom(res, path, \"roads\");\n return (await res.json()) as RoadEventsResponse;\n }\n}\n\n// ---------------------------------------------------------------------------------------------\n// Feedback\n// ---------------------------------------------------------------------------------------------\n\nexport type FeedbackProduct =\n | \"tiles\"\n | \"terrain\"\n | \"names\"\n | \"geocoding\"\n | \"places\"\n | \"routing\"\n | \"layers\"\n | \"transit\"\n | \"roads\"\n | \"ev\";\n\nexport type FeedbackCategory =\n | \"incorrect_location\"\n | \"incorrect_address\"\n | \"missing_place\"\n | \"wrong_place_name\"\n | \"wrong_category\"\n | \"bad_route\"\n | \"missing_road_closure\"\n | \"incorrect_road_condition\"\n | \"incorrect_transit_result\"\n | \"other\";\n\nexport interface FeedbackReport {\n product: FeedbackProduct;\n category: FeedbackCategory;\n /** Up to 2000 characters, stored exactly as written. One of this or `resultId` is required. */\n description?: string;\n /** The unmap id of the result being reported. */\n resultId?: string;\n /**\n * The request being reported.\n *\n * **Only send this with the reporter's explicit agreement.** The gateway refuses it without\n * `include_context: true`, which this sets whenever `context` is present, and that flag is\n * meant to record a person's choice rather than a client default. unmap redacts query strings\n * from its own logs; a client that attached them here would undo that.\n */\n context?: unknown;\n signal?: AbortSignal;\n}\n\nexport interface FeedbackReceipt {\n /** Quote this in a follow-up. */\n id: string;\n status: string;\n created_at: string;\n /** Whether a request context was actually kept. `false` when none was offered. */\n context_stored: boolean;\n}\n\n/**\n * Report wrong data.\n *\n * await unmap.feedback.submit({\n * product: \"geocoding\",\n * category: \"incorrect_location\",\n * description: \"17 Ave SW returns a street in Edmonton.\",\n * });\n *\n * Authenticated like everything else and **never metered**: telling us our data is wrong does not\n * cost a call. At most 200 reports per account per day.\n */\nexport class Feedback {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n\n constructor(opts: RoadsOptions) {\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n submit(report: FeedbackReport): Promise<FeedbackReceipt> {\n return this.post(\"/feedback\", {\n product: report.product,\n category: report.category,\n ...(report.description ? { description: report.description } : {}),\n ...(report.resultId ? { result_id: report.resultId } : {}),\n ...(report.context !== undefined ? { include_context: true, context: report.context } : {}),\n }, report.signal);\n }\n\n /** A report about one place. `product` and `result_id` come from the path. */\n aboutPlace(\n placeId: string,\n report: Omit<FeedbackReport, \"product\" | \"resultId\">,\n ): Promise<FeedbackReceipt> {\n return this.post(`/places/${encodeURIComponent(placeId)}/feedback`, {\n category: report.category,\n ...(report.description ? { description: report.description } : {}),\n ...(report.context !== undefined ? { include_context: true, context: report.context } : {}),\n }, report.signal);\n }\n\n private async post(path: string, body: unknown, signal?: AbortSignal): Promise<FeedbackReceipt> {\n // Deliberately NOT routed through `fetchWithRetry`, unlike every read on this client.\n //\n // A feedback submission creates a record and carries no idempotency key, so a retry after a\n // timeout or a 503 risks filing the same report twice. Retrying a read costs a round trip;\n // retrying this costs the quality programme a duplicate, and the caller is the only one who\n // knows whether their report already landed.\n const res = await this.fetchImpl(`${this.base}${path}`, {\n method: \"POST\",\n signal,\n headers: { \"content-type\": \"application/json\", authorization: `Bearer ${this.key}` },\n body: JSON.stringify(body),\n });\n if (!res.ok) throw await errorFrom(res, path, \"feedback\");\n return (await res.json()) as FeedbackReceipt;\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\nexport type TransitMetaStatus = \"current\" | \"stale\" | \"partial\" | \"unknown\";\n\nexport interface TransitMeta {\n /** Static GTFS is scheduled data. Realtime will use a different value and updated_at. */\n schedule_type: \"scheduled\";\n source?: string;\n source_updated_at?: string | null;\n source_version?: string;\n content_hash?: string | null;\n sources?: readonly {\n id: string;\n source: string;\n source_url: string;\n attribution: string;\n source_updated_at: string | null;\n source_version: string;\n content_hash: string | null;\n status: \"current\" | \"stale\" | \"unknown\";\n }[];\n unmap_updated_at: string;\n data_version?: string;\n status: TransitMetaStatus;\n attribution: string;\n}\n\nexport interface TransitResponse<T> {\n data: T;\n meta: TransitMeta;\n}\n\nexport interface TransitAgency {\n id: string;\n feed: string;\n name: string;\n url?: string;\n timezone: string;\n lang?: string;\n phone?: string;\n fare_url?: string;\n}\n\nexport interface TransitStop {\n id: string;\n feed: string;\n name: string;\n coordinates: [number, number];\n code?: string;\n description?: string;\n zone_id?: string;\n parent_station_id?: string;\n wheelchair_boarding?: 0 | 1 | 2;\n route_ids: string[];\n /** Metres from the requested point. Present only on nearbyStops. */\n distance?: number;\n}\n\nexport interface TransitRoute {\n id: string;\n feed: string;\n agency_id: string;\n short_name?: string;\n long_name?: string;\n description?: string;\n route_type: number;\n colour?: string;\n text_colour?: string;\n url?: string;\n}\n\nexport interface TransitDeparture {\n stop_id: string;\n route_id: string;\n trip_id: string;\n headsign?: string;\n arrival: string;\n departure: string;\n stop_sequence: number;\n /** 2 = phone agency; 3 = coordinate with driver. Omitted for ordinary pickup. */\n pickup_type?: 2 | 3;\n schedule_type: \"scheduled\";\n}\n\nexport interface NearbyStopsOptions {\n /** Metres. Default 1000, range 50 to 10000. */\n radius?: number;\n /** Default 20, maximum 100. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface DepartureOptions {\n /** An instant. Date values serialize to ISO; strings must include Z or an offset. Default now. */\n at?: Date | string;\n /** Minutes after at. Default 60, maximum 240. */\n window?: number;\n /** Default 50, maximum 200. */\n limit?: number;\n signal?: AbortSignal;\n}\n\nexport interface TransitOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for `429`, `502`, `503` and transport failures. `false` disables it.\n *\n * On by default. `Retry-After` is on a `429` other than `billing_required`, and on a container\n * `503`. A `502` has none: routing and `/elevation` both use\n * `upstream_error`. With no header the client backs off itself. A wait longer than\n * `maxDelayMs` (10 s) is not slept through; the error carries `retryAfterSeconds` instead.\n * See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A transit failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches this alongside\n * every other unmap client's errors. `status` and `code` carry the HTTP status and the\n * gateway's error code, and `retryAfterSeconds` comes from the `Retry-After` header.\n */\nexport class TransitError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"TransitError\";\n }\n}\n\n/**\n * The gateway's error body, as a `TransitError`.\n *\n * Named rather than inline since 2026-09-20: `fetchWithRetry` needs to inspect the failure to\n * decide whether to wait, and the throw needs to build the same error. Two copies of this would\n * be two chances for the retry predicate and the thrown error to disagree.\n */\nasync function errorFrom(res: Response, path: string): Promise<TransitError> {\n let body: { error?: unknown; code?: unknown } = {};\n try {\n body = (await res.json()) as typeof body;\n } catch {\n /* use the bounded fallback */\n }\n const message = typeof body.error === \"string\" ? body.error : `transit ${res.status} on ${path}`;\n const code = typeof body.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get(\"retry-after\") ?? null) ?? undefined;\n return new TransitError(res.status, message, code, retryAfter);\n}\n\n/** Static Canadian GTFS data. Scheduled departures ship before realtime. */\nexport class Transit {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: TransitOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n agencies(signal?: AbortSignal): Promise<TransitResponse<TransitAgency[]>> {\n return this.get(\"/transit/agencies\", undefined, signal);\n }\n\n nearbyStops(near: [number, number], options: NearbyStopsOptions = {}): Promise<TransitResponse<TransitStop[]>> {\n return this.get(\"/transit/stops\", {\n near: near.join(\",\"),\n radius: options.radius,\n limit: options.limit,\n }, options.signal);\n }\n\n getStop(id: string, signal?: AbortSignal): Promise<TransitResponse<TransitStop>> {\n return this.get(`/transit/stops/${encodeURIComponent(id)}`, undefined, signal);\n }\n\n getRoute(id: string, signal?: AbortSignal): Promise<TransitResponse<TransitRoute>> {\n return this.get(`/transit/routes/${encodeURIComponent(id)}`, undefined, signal);\n }\n\n departures(id: string, options: DepartureOptions = {}): Promise<TransitResponse<TransitDeparture[]>> {\n return this.get(`/transit/stops/${encodeURIComponent(id)}/departures`, {\n at: options.at instanceof Date ? options.at.toISOString() : options.at,\n window: options.window,\n limit: options.limit,\n }, options.signal);\n }\n\n private async get<T>(\n path: string,\n values?: Record<string, string | number | undefined>,\n signal?: AbortSignal,\n ): Promise<TransitResponse<T>> {\n const query = new URLSearchParams({ key: this.key });\n for (const [name, value] of Object.entries(values ?? {})) {\n if (value !== undefined) query.set(name, String(value));\n }\n const response = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${path}?${query}`,\n { signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!response.ok) throw await errorFrom(response, path);\n return await response.json() as TransitResponse<T>;\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * `GET /coverage.json` — where each capability actually works, and where it does not.\n *\n * The document is generated from the gateway's source registry rather than written by hand, so\n * it cannot claim a capability with no registered source behind it. It is also the only place\n * that answers \"is transit routing live in this city\" before you promise a user an answer:\n * routing covers only the feeds marked routing-ready, road events cover two provinces, and Places coverage is OpenStreetMap's,\n * which is thin outside cities.\n *\n * Unauthenticated and unmetered on the gateway, which is why this client takes no key: a\n * developer deciding whether to use unmap has no key yet, and a customer checking whether a gap\n * has closed should not pay a call to be told it has not.\n */\n\n/** The one path this client calls. A literal so the gateway's SDK-parity audit can see it. */\nconst COVERAGE_PATH = \"/coverage.json\";\n\n/** Freshness of a capability or a source. `unknown` means no cadence was declared. */\nexport type CoverageFreshness = \"current\" | \"stale\" | \"unknown\";\n\n/** How a source's freshness is judged, mirrored from the gateway's `FreshnessPolicy`. */\nexport interface CoverageFreshnessPolicy {\n /** ISO 8601 duration, `static`, or `unknown`. */\n interval: string;\n basis: string;\n /** When `freshness_status` stops being true, or null when staleness cannot be asked. */\n stale_after: string | null;\n}\n\n/** Where a source's data came from and when unmap last produced it. */\nexport interface CoverageProvenance {\n source_updated_at: string | null;\n unmap_updated_at: string | null;\n build_id: string | null;\n version: string;\n content_hash: string | null;\n freshness_policy: CoverageFreshnessPolicy;\n freshness_status: CoverageFreshness;\n /** Counts the producing job measured. Omitted when it measured none. */\n measurements?: Record<string, number>;\n}\n\nexport interface CoverageSource {\n id: string;\n provider: string;\n /** Bilingual, like every human-readable field in this document. */\n dataset_name: { en: string; fr: string };\n canonical_url: string;\n licence: { en: string; fr: string };\n licence_url: string;\n attribution: string;\n jurisdiction: string[];\n /** ISO 8601 duration, e.g. `P1D`. */\n refresh_interval: string;\n last_checked_at: string;\n /** Upstream's edition date, when unmap last produced the data, which build did, and how fresh that is. */\n provenance: CoverageProvenance;\n coverage: string;\n known_gaps: { en: string; fr: string };\n quality_status: string;\n /** A note on the source, in English, present only when there is one. */\n notes?: string;\n}\n\nexport interface CoverageCapability {\n /** `tiles`, `geocoding`, `routing`, `places`, `transit`, `roads`, and so on. */\n id: string;\n display_name: { en: string; fr: string };\n /** `planned` is published as honestly as `live`: a capability absent from the page reads as \"not our problem\". */\n availability: \"live\" | \"planned\";\n /** The endpoints that serve it. Empty while planned. */\n endpoints: string[];\n coverage: { en: string; fr: string };\n /** Written to be accurate rather than flattering. Read this before promising coverage to a user. */\n known_gaps: { en: string; fr: string };\n /** ISO 3166-2 subdivisions, or `CA` for national. */\n jurisdictions: string[];\n freshness_status: CoverageFreshness;\n sources: CoverageSource[];\n}\n\nexport interface CoverageDocument {\n generated_at: string;\n /** How to read the dates below, in both official languages. */\n freshness_basis: { en: string; fr: string };\n /** Schema tag of the manifests behind `provenance`, so a consumer can pin what it parses. */\n provenance_schema: string;\n capabilities: CoverageCapability[];\n /** Every jurisdiction code any source claims. */\n jurisdictions: string[];\n}\n\nexport class CoverageError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"CoverageError\";\n }\n}\n\nexport interface CoverageOptions {\n gateway?: string;\n /** Override the fetch implementation (tests, non-global environments). */\n fetch?: typeof fetch;\n retry?: RetryPolicy | false;\n}\n\n/** Where unmap works. Takes no key: the endpoint is unauthenticated and unmetered. */\nexport class Coverage {\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: CoverageOptions = {}) {\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n this.retry = opts.retry;\n }\n\n /** The whole document. Cached an hour at the edge, so polling it is cheap. */\n async get(opts: { signal?: AbortSignal } = {}): Promise<CoverageDocument> {\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${COVERAGE_PATH}`,\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) {\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n throw new CoverageError(res.status, `coverage ${res.status}`, undefined, retryAfter);\n }\n return (await res.json()) as CoverageDocument;\n }\n\n /**\n * One capability by id, or `undefined` when the document does not describe it.\n *\n * const transit = await unmap.coverage.capability(\"transit\");\n * if (!transit?.jurisdictions.includes(\"CA-ON\")) return \"not available here yet\";\n */\n async capability(id: string, opts: { signal?: AbortSignal } = {}): Promise<CoverageCapability | undefined> {\n const doc = await this.get(opts);\n return doc.capabilities.find((c) => c.id === id);\n }\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/** The one path this client calls. A literal so the gateway's SDK-parity audit can see it. */\nconst TIMEZONE_PATH = \"/timezone\";\n\nexport interface TimezoneResult {\n timezone: string | null;\n offset: string | null;\n offsetSeconds: number | null;\n dst: boolean | null;\n}\n\nexport interface TimezoneLookupOptions {\n /** Instant the offset is evaluated at. Omit it for the current time. */\n at?: Date;\n signal?: AbortSignal;\n}\n\nexport class TimezoneError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"TimezoneError\";\n }\n}\n\nexport interface TimezoneOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n retry?: RetryPolicy | false;\n}\n\n/**\n * IANA timezone for a coordinate.\n *\n * const zone = await unmap.timezone.lookup([-114.0719, 51.0447]);\n *\n * The coordinate is `[longitude, latitude]`, the same order as the rest of the SDK.\n * `at` selects the offset. It does not change which zone the coordinate falls in.\n */\nexport class Timezone {\n private readonly key: string;\n private readonly base: string;\n private readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: TimezoneOptions) {\n this.retry = opts.retry;\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n }\n\n async lookup(coordinate: [number, number], opts: TimezoneLookupOptions = {}): Promise<TimezoneResult> {\n const [lon, lat] = coordinate;\n const q = new URLSearchParams({ key: this.key, lon: String(lon), lat: String(lat) });\n if (opts.at) q.set(\"at\", opts.at.toISOString());\n const res = await fetchWithRetry(\n this.fetchImpl,\n `${this.base}${TIMEZONE_PATH}?${q}`,\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n this.retry,\n );\n if (!res.ok) throw await errorFrom(res);\n return (await res.json()) as TimezoneResult;\n }\n}\n\nasync function errorFrom(res: Response): Promise<TimezoneError> {\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n let message = res.statusText || `timezone ${res.status}`;\n let code: string | undefined;\n try {\n const body = (await res.json()) as { error?: unknown; code?: unknown };\n if (typeof body.error === \"string\" && body.error) message = body.error;\n if (typeof body.code === \"string\") code = body.code;\n } catch {\n /* a non-JSON failure still carries the status */\n }\n return new TimezoneError(res.status, message, code, retryAfter);\n}\n","import { DEFAULT_GATEWAY, UnmapError, fetchWithRetry, parseRetryAfter, type RetryPolicy } from \"@unmap/core\";\n\n/**\n * Clients for the named Canadian layer catalog (`/layers`) and for tenant overlays (`/byod`).\n *\n * Both existed as endpoints with no client until the SDK parity audit\n * (`apps/gateway/test/sdk-parity.test.ts`) went looking and found them. They were the two entries\n * in that audit's `KNOWN_GAPS`; this closes both.\n *\n * ## Why these are the two that mattered\n *\n * `@unmap/maps` already consumes layer and overlay **tiles** through a style document, which is\n * why the gap was easy to miss: maps work. What had no client was everything *around* the tiles.\n * Nothing could ask what layers exist, what a layer's licence says, or which add-on it needs, and\n * nothing could upload an overlay without hand-rolling a multipart request.\n */\n\n// ---------------------------------------------------------------------------------------------\n// The named layer catalog\n// ---------------------------------------------------------------------------------------------\n\nexport interface LayerArchive {\n id: string;\n minzoom: number;\n maxzoom: number;\n}\n\n/**\n * The capability a gated layer's tiles need. These are capability ids (`legalLand`), not the\n * `addon-*` SKUs a customer buys (`addon-legal-land`).\n */\nexport type LayerCapability = \"legalLand\" | \"energy\" | \"agriculture\" | \"remote\" | \"mining\";\n\n/**\n * One catalog layer.\n *\n * `licence`, `attribution` and `known_gaps` are the reason to read this rather than hard-code a\n * layer id: they are the governance record, and a caller displaying a layer has to display its\n * attribution.\n */\nexport interface Layer {\n id: string;\n display_name: { en: string; fr: string };\n namespace?: \"core\" | \"survey\" | \"energy\" | \"agriculture\" | \"remote\" | \"mining\";\n /** ISO 3166 codes where coverage is VERIFIED. `coverage` carries the prose, including gaps. */\n jurisdiction?: string[];\n source?: string;\n source_url?: string;\n licence: string;\n attribution: string;\n coverage: string;\n resolution?: string;\n updated_at?: string;\n source_updated_at?: string;\n ingestion_version?: string;\n schema_version?: string;\n freshness_policy?: string;\n known_gaps?: string;\n /**\n * The capability this layer's tiles need, or null when it is core. Reading the catalog is never\n * gated; the tiles are, and answer `403` `addon_required` on a key without the add-on.\n */\n addon?: LayerCapability | null;\n archives?: LayerArchive[];\n /** Vector source-layer name inside the archive. */\n source_layer?: string;\n /** Every source-layer, present only when the archive stacks more than one (survey grids). */\n source_layers?: string[];\n}\n\n// ---------------------------------------------------------------------------------------------\n// Tenant overlays (BYOD)\n// ---------------------------------------------------------------------------------------------\n\nexport interface ByodOverlay {\n /** `ovl_` plus twelve hex characters. */\n id: string;\n name: string;\n kind: \"geojson\" | \"pmtiles\";\n bytes: number;\n createdAt: string;\n url: string;\n /** The `byod:<id>` token to pass to `overlays`. This is the field you actually want. */\n overlay: string;\n}\n\nexport interface ByodList {\n overlays: ByodOverlay[];\n /** The caps, from the server rather than from a constant here that could drift. */\n limits: { maxFiles: number; maxBytes: number; kinds: string[] };\n}\n\nexport interface CatalogOptions {\n key: string;\n gateway?: string;\n fetch?: typeof fetch;\n /**\n * Retry policy for reads (`429`, `502`, `503` and transport failures). `false` disables it.\n * Uploads and deletes are never retried. See `RetryPolicy` in `@unmap/core`.\n */\n retry?: RetryPolicy | false;\n}\n\n/**\n * A layer-catalog or overlay failure.\n *\n * Extends `UnmapError`, so `catch (e) { if (e instanceof UnmapError) }` catches it alongside every\n * other unmap client's errors. `code` is the gateway's: `not_found` for an unknown layer or\n * overlay id, `bad_request` for an upload the server refused (wrong type, over the size cap, or\n * over the overlay count).\n */\nexport class CatalogError extends UnmapError {\n constructor(status: number, message: string, code?: string, retryAfterSeconds?: number) {\n super(status, message, code, retryAfterSeconds);\n this.name = \"CatalogError\";\n }\n}\n\nasync function errorFrom(res: Response, path: string): Promise<CatalogError> {\n const fallback = `catalog ${res.status} on ${path}`;\n let body: { error?: unknown; code?: unknown } | undefined;\n try {\n body = (await res.json()) as { error?: unknown; code?: unknown };\n } catch {\n body = undefined;\n }\n const reason = typeof body?.error === \"string\" ? body.error : undefined;\n const code = typeof body?.code === \"string\" ? body.code : undefined;\n const retryAfter = parseRetryAfter(res.headers?.get?.(\"retry-after\") ?? null) ?? undefined;\n return new CatalogError(res.status, reason ? `${reason} (${fallback})` : fallback, code, retryAfter);\n}\n\n/** The pieces both clients share: the key, the base URL, fetch, and the read path. */\nabstract class KeyedClient {\n protected readonly key: string;\n protected readonly base: string;\n protected readonly fetchImpl: typeof fetch;\n private readonly retry: RetryPolicy | false | undefined;\n\n constructor(opts: CatalogOptions) {\n this.key = opts.key;\n this.base = (opts.gateway ?? DEFAULT_GATEWAY).replace(/\\/+$/, \"\");\n this.fetchImpl = opts.fetch ?? globalThis.fetch.bind(globalThis);\n this.retry = opts.retry;\n }\n\n protected url(path: string, values?: Record<string, string | undefined>): string {\n const query = new URLSearchParams({ key: this.key });\n for (const [name, value] of Object.entries(values ?? {})) {\n if (value !== undefined) query.set(name, value);\n }\n return `${this.base}${path}?${query}`;\n }\n\n /** A GET, retried per the policy. Throws `CatalogError` on a non-2xx. */\n protected async read(path: string, init: RequestInit, values?: Record<string, string | undefined>): Promise<Response> {\n const res = await fetchWithRetry(this.fetchImpl, this.url(path, values), init, this.retry);\n if (!res.ok) throw await errorFrom(res, path);\n return res;\n }\n}\n\n/**\n * The named Canadian layer catalog.\n *\n * const layers = await unmap.layers.list({ jurisdiction: \"CA-AB\" });\n * const parcels = await unmap.layers.get(\"survey.dls\");\n * console.log(parcels.attribution, parcels.known_gaps);\n *\n * A retired or misspelled id is a plain `404` `not_found`, the same as one that never existed:\n * the gateway keeps no aliases for renamed layers.\n */\nexport class Catalog extends KeyedClient {\n /**\n * Every catalog layer, or only those with verified coverage in `jurisdiction`.\n *\n * A country code matches its own subdivisions (`CA` includes `CA-AB`). An unknown code is an\n * empty list, not an error: the catalog has nothing there.\n */\n async list(opts: { jurisdiction?: string; signal?: AbortSignal } = {}): Promise<Layer[]> {\n const res = await this.read(\n \"/layers\",\n { signal: opts.signal, headers: { accept: \"application/json\" } },\n { jurisdiction: opts.jurisdiction },\n );\n const body = (await res.json()) as { layers?: Layer[] } | Layer[];\n return Array.isArray(body) ? body : (body.layers ?? []);\n }\n\n /** One layer by id. Throws `CatalogError` 404 `not_found` when it does not exist. */\n async get(id: string, opts: { signal?: AbortSignal } = {}): Promise<Layer> {\n const res = await this.read(`/layers/${encodeURIComponent(id)}`, {\n signal: opts.signal,\n headers: { accept: \"application/json\" },\n });\n return (await res.json()) as Layer;\n }\n}\n\n/**\n * Tenant overlays: your own GeoJSON or PMTiles, stored against your key.\n *\n * const { overlay } = await unmap.byod.upload(file, { name: \"Service areas\" });\n * const map = new Unmap({ key, container: \"#map\", overlays: [overlay] });\n *\n * The `overlay` field on the result is the `byod:<id>` token: that is what `overlays` takes, not\n * the bare id, and returning the whole record rather than just the id is what makes that hard to\n * get wrong.\n *\n * Hard caps are the server's (10 overlays, 5 MiB each) and are reported by `list()` rather than\n * duplicated here, so a change on the server cannot leave a stale constant in the client.\n */\nexport class Byod extends KeyedClient {\n /** Overlays on this tenant, plus the server's current limits. */\n async list(opts: { signal?: AbortSignal } = {}): Promise<ByodList> {\n const res = await this.read(\"/byod\", { signal: opts.signal, headers: { accept: \"application/json\" } });\n return (await res.json()) as ByodList;\n }\n\n /** One overlay's metadata. */\n async get(id: string, opts: { signal?: AbortSignal } = {}): Promise<ByodOverlay> {\n const res = await this.read(`/byod/${encodeURIComponent(id)}`, {\n signal: opts.signal,\n headers: { accept: \"application/json\" },\n });\n return (await res.json()) as ByodOverlay;\n }\n\n /**\n * Upload an overlay.\n *\n * Accepts a `Blob`/`File`, a `GeoJSON` object, or raw bytes. The content type is chosen from\n * what was passed rather than asked for: a plain object is GeoJSON, and anything binary is\n * PMTiles unless the caller says otherwise. Getting that wrong is a 400 from the server, so\n * inferring it here removes the most likely way to fail this call.\n *\n * Never retried: an upload mints a new overlay id and carries no idempotency key, so a retry\n * after a lost response would spend a second of the ten slots on a duplicate.\n */\n async upload(\n body: Blob | ArrayBuffer | Uint8Array | Record<string, unknown>,\n opts: { name?: string; kind?: \"geojson\" | \"pmtiles\"; signal?: AbortSignal } = {},\n ): Promise<ByodOverlay> {\n let payload: BodyInit;\n let contentType: string | undefined;\n let name: string | undefined;\n\n if (typeof Blob !== \"undefined\" && body instanceof Blob) {\n // A File carries its own name, which is a better default than anything we could invent.\n const form = new FormData();\n form.append(\"file\", body);\n if (opts.name) form.append(\"name\", opts.name);\n payload = form;\n // Deliberately unset: the runtime has to add the multipart boundary, and setting\n // content-type by hand produces a request the server cannot parse.\n contentType = undefined;\n } else if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) {\n payload = body as BodyInit;\n contentType = opts.kind === \"geojson\" ? \"application/geo+json\" : \"application/vnd.pmtiles\";\n name = opts.name;\n } else {\n payload = JSON.stringify(body);\n contentType = \"application/geo+json\";\n name = opts.name;\n }\n\n const res = await this.fetchImpl(this.url(\"/byod\", { name }), {\n method: \"POST\",\n signal: opts.signal,\n headers: contentType ? { \"content-type\": contentType } : undefined,\n body: payload,\n });\n if (!res.ok) throw await errorFrom(res, \"/byod\");\n return (await res.json()) as ByodOverlay;\n }\n\n /**\n * Delete an overlay.\n *\n * Never retried: a retry after a delete whose response was lost answers `404`, which would\n * report a failure for a delete that succeeded.\n */\n async delete(id: string, opts: { signal?: AbortSignal } = {}): Promise<void> {\n const path = `/byod/${encodeURIComponent(id)}`;\n const res = await this.fetchImpl(this.url(path), { method: \"DELETE\", signal: opts.signal });\n if (!res.ok) throw await errorFrom(res, path);\n }\n\n /** The stored bytes. GeoJSON parses; PMTiles is binary and belongs to MapLibre. */\n async data(id: string, opts: { signal?: AbortSignal } = {}): Promise<Response> {\n // The raw Response, not a parsed body: one of the two kinds is a binary archive that a caller\n // streams rather than reads, and guessing which they wanted would be worse than handing it over.\n return this.read(`/byod/${encodeURIComponent(id)}/data`, { signal: opts.signal });\n }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAKK;AACP,SAAS,UAAU,cAAkG;;;ACPrH,SAAS,iBAAiB,YAAY,gBAAgB,uBAAyC;AAmJxF,IAAM,aAAN,cAAyB,WAAW;AAAA,EACzC,YAAY,QAAgB,SAAiB,MAAe,mBAA4B;AACtF,UAAM,QAAQ,SAAS,MAAM,iBAAiB;AAC9C,SAAK,OAAO;AAAA,EACd;AACF;AAEA,SAAS,KAAK,OAAmE;AAC/E,MAAI,UAAU,OAAW,QAAO;AAChC,SAAO,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,GAAG,IAAI,OAAO,KAAK;AAC9D;AAEA,eAAe,UAAU,KAAe,MAAc,MAAmC;AACvF,QAAM,WAAW,GAAG,IAAI,IAAI,IAAI,MAAM,OAAO,IAAI;AACjD,MAAI;AACJ,MAAI;AACF,WAAQ,MAAM,IAAI,KAAK;AAAA,EACzB,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAM,SAAS,OAAO,MAAM,UAAU,WAAW,KAAK,QAAQ;AAC9D,QAAM,OAAO,OAAO,MAAM,SAAS,WAAW,KAAK,OAAO;AAC1D,QAAM,aAAa,gBAAgB,IAAI,SAAS,IAAI,aAAa,KAAK,IAAI,KAAK;AAC/E,SAAO,IAAI,WAAW,IAAI,QAAQ,SAAS,GAAG,MAAM,KA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AI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,OAAO,IAAI;AAC7B,SAAK,QAAQ,IAAI,MAAM,IAAI;AAC3B,SAAK,WAAW,IAAI,SAAS,IAAI;AACjC,SAAK,UAAU,IAAI,QAAQ,IAAI;AAC/B,SAAK,WAAW,IAAI,SAAS,IAAI;AACjC,SAAK,SAAS,IAAI,QAAQ,IAAI;AAC9B,SAAK,OAAO,IAAI,KAAK,IAAI;AACzB,SAAK,OAAO,EAAE,OAAO,CAAC,cAAc,KAAK,SAAS,WAAW,SAAS,EAAE;AACxE,QAAI,KAAK,WAAW;AAClB,WAAK,MAAM,UAAU,EAAE,GAAG,MAAM,WAAW,KAAK,UAAU,CAAoB;AAAA,IAChF;AAAA,EACF;AAAA;AAAA,EAGA,SAAS,MAAkD;AACzD,WAAO,KAAK,SAAS,SAAS,IAAI;AAAA,EACpC;AACF;","names":["DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","DEFAULT_GATEWAY","UnmapError","fetchWithRetry","parseRetryAfter","errorFrom","createMap","UnmapError","parseRetryAfter"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unmap/sdk",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "description": "One key, the whole unmap platform: map + geocoder + router",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "maplibre-gl": "^6.9.0",
43
- "@unmap/core": "0.21.0",
44
- "@unmap/elevation": "0.21.0",
45
- "@unmap/geocoding": "0.21.0",
46
- "@unmap/maps": "0.21.0",
47
- "@unmap/routing": "0.21.0"
43
+ "@unmap/core": "0.22.1",
44
+ "@unmap/elevation": "0.22.1",
45
+ "@unmap/geocoding": "0.22.1",
46
+ "@unmap/maps": "0.22.1",
47
+ "@unmap/routing": "0.22.1"
48
48
  },
49
49
  "devDependencies": {
50
50
  "tsup": "^8.3.0",