@mailwoman/photon 5.10.0 → 6.0.0

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
@@ -3,9 +3,19 @@
3
3
  A **Photon-compatible autocomplete geocoding API** over the [Mailwoman](https://mailwoman.sister.software) engine — search-as-you-type, returning GeoJSON `FeatureCollection`s. Where [`@mailwoman/nominatim`](../nominatim) is structured lookup, this is the type-ahead front door. No Elasticsearch.
4
4
 
5
5
  ```bash
6
- npx @mailwoman/photon serve --port 2322 --data <gazetteer-or-bundle>
6
+ # One-time data fetch (worldwide candidate gazetteer, ~1.4 GB):
7
+ mkdir -p "${MAILWOMAN_DATA_ROOT:-/tmp/mailwoman-data}/wof"
8
+ curl -fSL https://public.sister.software/mailwoman/gazetteer/2026-07-07a/candidate.db \
9
+ -o "${MAILWOMAN_DATA_ROOT:-/tmp/mailwoman-data}/wof/candidate.db"
10
+
11
+ MAILWOMAN_DATA_ROOT="${MAILWOMAN_DATA_ROOT:-/tmp/mailwoman-data}" \
12
+ npx @mailwoman/photon serve --port 2322
13
+ # or point at your own data: --candidate-db <path> / $MAILWOMAN_CANDIDATE_DB
7
14
  ```
8
15
 
16
+ Prefer to try before self-hosting? A hosted trial endpoint runs at
17
+ **https://photon.sister.software** (`/api` + `/reverse`, conservative rate limits).
18
+
9
19
  ```bash
10
20
  curl "http://localhost:2322/api?q=1600 penn&limit=5&lat=38.9&lon=-77"
11
21
  curl "http://localhost:2322/reverse?lat=38.8977&lon=-77.0365"
@@ -13,28 +23,28 @@ curl "http://localhost:2322/reverse?lat=38.8977&lon=-77.0365"
13
23
 
14
24
  ## Endpoints
15
25
 
16
- | Endpoint | Photon contract |
17
- | ---------- | -------------------------------------------------- |
18
- | `/api` | forward / autocomplete → GeoJSON FeatureCollection |
19
- | `/reverse` | `lat`/`lon` → GeoJSON FeatureCollection |
26
+ | Endpoint | Photon contract |
27
+ | --------------- | ---------------------------------------------------- |
28
+ | `/api` | forward / autocomplete → GeoJSON FeatureCollection |
29
+ | `/reverse` | `lat`/`lon` → GeoJSON FeatureCollection |
30
+ | `/openapi.json` | emitted OpenAPI 3.1 document for `/api` + `/reverse` |
20
31
 
21
32
  Backed by Mailwoman's FST autocomplete tier (#190/#587) + parse → resolve.
22
33
 
23
34
  ## Library use
24
35
 
25
36
  ```ts
26
- import express from "express"
27
- import { createPhotonRouter, type PhotonEngine } from "@mailwoman/photon"
37
+ import { serveNode } from "@mailwoman/api-kit"
38
+ import { createPhotonApp, type PhotonEngine } from "@mailwoman/photon"
28
39
 
29
- const engine: PhotonEngine = {
30
- /* search, reverse — backed by your Mailwoman pipeline */
31
- }
32
- express().use(createPhotonRouter(engine)).listen(2322)
40
+ const engine: PhotonEngine = {/* search, reverse — backed by your Mailwoman pipeline */}
41
+ const app = createPhotonApp(engine)
42
+ serveNode({ fetch: app.fetch, port: 2322, hostname: "0.0.0.0" })
33
43
  ```
34
44
 
35
45
  ## CORS
36
46
 
37
- Map widgets (`leaflet-control-geocoder`, `@openrunner/photon-geocoder`) call this cross-origin from the browser, so the server sends permissive CORS by default — `Access-Control-Allow-Origin: *` and a `204` answer to preflight `OPTIONS`, matching upstream Photon. Behind a reverse proxy that already sets the headers, turn it off with `--no-cors` (or `createPhotonRouter(engine, { cors: false })`).
47
+ Map widgets (`leaflet-control-geocoder`, `@openrunner/photon-geocoder`) call this cross-origin from the browser, so the server sends permissive CORS by default — `Access-Control-Allow-Origin: *` and a `204` answer to preflight `OPTIONS`, matching upstream Photon. Behind a reverse proxy that already sets the headers, turn it off with `--no-cors` (or `createPhotonApp(engine, { cors: false })`).
38
48
 
39
49
  ## Status
40
50
 
package/out/app.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The Photon-compatible Hono app: CORS + error safety net + routes + the emitted OpenAPI
7
+ * document. Engine-agnostic — the CLI wires the real engine; tests inject fixtures.
8
+ */
9
+ import { OpenAPIHono } from "@hono/zod-openapi";
10
+ import { type OpenAPIDocInfo } from "@mailwoman/api-kit";
11
+ import type { PhotonEngine } from "./engine.ts";
12
+ /** Options for {@link createPhotonApp}. */
13
+ export interface PhotonAppOptions {
14
+ /**
15
+ * Emit permissive CORS headers (`Access-Control-Allow-Origin: *`) on every response and answer preflight `OPTIONS`
16
+ * with `204`. Default `true` — upstream komoot/photon serves permissive CORS, and the map-widget use case
17
+ * (leaflet-control-geocoder, @openrunner/photon-geocoder, …) needs it: a browser's cross-origin XHR is blocked
18
+ * without it (#1017). Set `false` when a reverse proxy already owns the CORS headers.
19
+ */
20
+ cors?: boolean;
21
+ }
22
+ /**
23
+ * The document info stamped into the emitted OpenAPI document. Exported (not inlined) so the CLI's `openapi` subcommand
24
+ * can call `emitOpenAPIDocuments` with the SAME info the mounted `/openapi.json` route (below, via
25
+ * {@link attachOpenAPIDocs}) uses — one source of truth, no risk of the two drifting.
26
+ */
27
+ export declare const PHOTON_DOC_INFO: OpenAPIDocInfo;
28
+ /** Build the Photon-compatible app around an injected {@link PhotonEngine}. */
29
+ export declare function createPhotonApp(engine: PhotonEngine, options?: PhotonAppOptions): OpenAPIHono;
30
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,cAqB7B,CAAA;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,CAiBjG"}
package/out/app.js ADDED
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The Photon-compatible Hono app: CORS + error safety net + routes + the emitted OpenAPI
7
+ * document. Engine-agnostic — the CLI wires the real engine; tests inject fixtures.
8
+ */
9
+ import { OpenAPIHono } from "@hono/zod-openapi";
10
+ import { attachOpenAPIDocs } from "@mailwoman/api-kit";
11
+ import packageJson from "@mailwoman/photon/package.json" with { type: "json" };
12
+ import { cors } from "hono/cors";
13
+ import { registerPhotonRoutes } from "./routes.js";
14
+ /**
15
+ * The document info stamped into the emitted OpenAPI document. Exported (not inlined) so the CLI's `openapi` subcommand
16
+ * can call `emitOpenAPIDocuments` with the SAME info the mounted `/openapi.json` route (below, via
17
+ * {@link attachOpenAPIDocs}) uses — one source of truth, no risk of the two drifting.
18
+ */
19
+ export const PHOTON_DOC_INFO = {
20
+ title: packageJson.name,
21
+ version: packageJson.version,
22
+ description: packageJson.description,
23
+ license: { name: "AGPL-3.0-only OR LicenseRef-Commercial", identifier: "AGPL-3.0-only" },
24
+ contact: { name: "Sister Software", url: "https://mailwoman.sister.software" },
25
+ externalDocs: {
26
+ description: "Switching from Photon",
27
+ url: "https://mailwoman.sister.software/docs/concepts/switching-from-photon",
28
+ },
29
+ servers: [
30
+ {
31
+ url: "http://{host}:{port}",
32
+ variables: { host: { default: "127.0.0.1" }, port: { default: "2322" } },
33
+ },
34
+ ],
35
+ security: [],
36
+ tags: [
37
+ { name: "geocoding", description: "Forward autocomplete and reverse geocoding." },
38
+ { name: "meta", description: "Health and deploy-time operations." },
39
+ ],
40
+ };
41
+ /** Build the Photon-compatible app around an injected {@link PhotonEngine}. */
42
+ export function createPhotonApp(engine, options = {}) {
43
+ const app = new OpenAPIHono();
44
+ // Browser-embedded widgets need CORS or their cross-origin XHR is blocked before the request completes (#1017).
45
+ // GET-only — photon has no mutating routes, so unlike libpostal's CORS there is no POST in the methods list.
46
+ if (options.cors !== false) {
47
+ app.use(cors({ origin: "*", allowMethods: ["GET", "OPTIONS"], allowHeaders: ["*"], maxAge: 86400 }));
48
+ }
49
+ // Safety net: malformed input or an engine fault returns an empty FeatureCollection, never a crash (photon's
50
+ // envelope — NOT `{error}`, which is the libpostal/nominatim shape).
51
+ app.onError((_error, c) => c.json({ type: "FeatureCollection", features: [], message: "internal error" }, 500));
52
+ registerPhotonRoutes(app, engine);
53
+ attachOpenAPIDocs(app, PHOTON_DOC_INFO);
54
+ return app;
55
+ }
56
+ //# sourceMappingURL=app.js.map
package/out/app.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAuB,MAAM,oBAAoB,CAAA;AAC3E,OAAO,WAAW,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAalD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC9C,KAAK,EAAE,WAAW,CAAC,IAAI;IACvB,OAAO,EAAE,WAAW,CAAC,OAAO;IAC5B,WAAW,EAAE,WAAW,CAAC,WAAW;IACpC,OAAO,EAAE,EAAE,IAAI,EAAE,wCAAwC,EAAE,UAAU,EAAE,eAAe,EAAE;IACxF,OAAO,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,mCAAmC,EAAE;IAC9E,YAAY,EAAE;QACb,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE,uEAAuE;KAC5E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"node:path";
18
18
  import { parseArgs } from "node:util";
19
+ import { printOpenAPIDocument, serveNode } from "@mailwoman/api-kit";
19
20
  import { matchCountry } from "@mailwoman/codex/country";
20
21
  import { NeuralAddressClassifier } from "@mailwoman/neural";
21
22
  import { createWOFResolver } from "@mailwoman/resolver";
22
23
  import { geocodeAddress, ShardProvider } from "mailwoman/geocode-core";
23
24
  import { createResolverBackend, mailwomanDataRoot, resolveCandidateDBPath, wofShardPaths, } from "mailwoman/resolver-backend";
24
- import { createPhotonRouter, photonCollection, photonFeature, photonForwardCollection, photonOSMTags, } from "./index.js";
25
+ import { createPhotonApp, PHOTON_DOC_INFO, photonCollection, photonFeature, photonForwardCollection, photonOSMTags, } from "./index.js";
25
26
  /** WOF placetype → Photon property key. */
26
27
  const PLACETYPE_TO_KEY = {
27
28
  street: "street",
@@ -54,8 +55,36 @@ async function serve() {
54
55
  // Candidate gazetteer = worldwide resolution (see @mailwoman/nominatim). --candidate-db /
55
56
  // $MAILWOMAN_CANDIDATE_DB, else auto-use one fetched to `<data-root>/wof/candidate.db`; absent → admin-only.
56
57
  const conventionCandidate = join(mailwomanDataRoot(), "wof", "candidate.db");
58
+ // #1009 kin: an EXPLICIT --candidate-db that doesn't exist must error loudly, not silently fall
59
+ // back to whatever ambient data-root file happens to be present (a typo'd path would serve the
60
+ // wrong gazetteer without a word).
61
+ if (values["candidate-db"] && !existsSync(values["candidate-db"])) {
62
+ console.error(`✗ --candidate-db not found: ${values["candidate-db"]}`);
63
+ process.exit(1);
64
+ }
57
65
  const candidateDb = resolveCandidateDBPath(values["candidate-db"]) ??
58
66
  (existsSync(conventionCandidate) ? conventionCandidate : undefined);
67
+ // #1009: fail FRIENDLY before the resolver throws its internal "resolveShards: at least one shard
68
+ // is required" — a stranger's first `npx @mailwoman/photon serve` must say exactly what data is
69
+ // missing and the one command that fixes it. Kept in sync with the docs' hosted-artifact layout
70
+ // (mailwoman.sister.software/docs/switching/photon — the maintained pointer).
71
+ if (!candidateDb && wofPaths.length === 0) {
72
+ console.error([
73
+ "✗ no gazetteer data found — the endpoint needs a resolver database to answer queries.",
74
+ "",
75
+ " Fastest path (worldwide resolution, ~1.4 GB, byte-range friendly):",
76
+ ` mkdir -p ${join(mailwomanDataRoot(), "wof")}`,
77
+ ` curl -fSL https://public.sister.software/mailwoman/gazetteer/2026-07-07a/candidate.db \\`,
78
+ ` -o ${conventionCandidate}`,
79
+ "",
80
+ " Then re-run `serve` (the file is auto-detected at that path), or point at your own:",
81
+ " --candidate-db <path> / $MAILWOMAN_CANDIDATE_DB (candidate gazetteer)",
82
+ " $MAILWOMAN_WOF_DB / <data-root>/wof/*.db (admin WOF distribution)",
83
+ "",
84
+ " Docs: https://mailwoman.sister.software/docs/switching/photon",
85
+ ].join("\n"));
86
+ process.exit(1);
87
+ }
59
88
  const classifier = await NeuralAddressClassifier.loadFromWeights({ locale: "en-US" });
60
89
  const backend = createResolverBackend(resolverMod, { wofPaths, candidateDb });
61
90
  const resolver = createWOFResolver(backend);
@@ -95,6 +124,9 @@ async function serve() {
95
124
  // parsed housenumber + street so photonForwardProperties decorates it `type: house` (matching upstream Photon)
96
125
  // instead of inheriting the admin locality's `type: city`. The admin tier (a locality centroid) never does.
97
126
  const houseGrade = result.resolution_tier === "address_point" || result.resolution_tier === "interpolated";
127
+ // #1050: the street-centroid tier is STREET-GRADE — full assembled street name in `name`,
128
+ // highway/street osm tags (the parallel of the #1041 house treatment).
129
+ const streetGrade = result.resolution_tier === "street";
98
130
  const primary = {
99
131
  lat: result.lat,
100
132
  lon: result.lon,
@@ -102,6 +134,7 @@ async function serve() {
102
134
  country: country ? { name: country.canonical, code: country.iso2 } : undefined,
103
135
  places: result.hierarchy.map((h) => ({ tag: h.tag, name: h.name })),
104
136
  ...(houseGrade ? { house: { number: result.house_number, street: result.street } } : {}),
137
+ ...(streetGrade ? { street: { name: result.street } } : {}),
105
138
  };
106
139
  // #1016: candidates[0] is the primary itself; its ranked alternatives (Springfield MA/IL/…) become the
107
140
  // extra features, up to the requested `limit`. Each alternative is a single resolved place.
@@ -139,18 +172,44 @@ async function serve() {
139
172
  return photonCollection([photonFeature(deepest.lon, deepest.lat, properties)]);
140
173
  },
141
174
  };
142
- const express = (await import("express")).default;
143
- express()
144
- .use(createPhotonRouter(engine, { cors: values.cors }))
145
- .listen(port, host, () => {
146
- console.error(`[@mailwoman/photon] listening on http://${host}:${port}`);
147
- console.error(` wof: ${adminDBPath ?? "(none found — set MAILWOMAN_WOF_DB)"}`);
148
- console.error(candidateDb
149
- ? ` resolver: candidate gazetteer (worldwide) — ${candidateDb}`
150
- : ` resolver: admin-only (US-optimized) — point --candidate-db / $MAILWOMAN_CANDIDATE_DB at a candidate gazetteer for worldwide`);
151
- console.error(` cors: ${values.cors ? "enabled (Access-Control-Allow-Origin: *)" : "disabled (--no-cors)"}`);
152
- console.error(` endpoints: GET /api GET /reverse`);
175
+ const app = createPhotonApp(engine, { cors: values.cors });
176
+ serveNode({
177
+ fetch: app.fetch,
178
+ port,
179
+ hostname: host,
180
+ onListen: () => {
181
+ console.error(`[@mailwoman/photon] listening on http://${host}:${port}`);
182
+ console.error(` wof: ${adminDBPath ?? "(none found — set MAILWOMAN_WOF_DB)"}`);
183
+ console.error(candidateDb
184
+ ? ` resolver: candidate gazetteer (worldwide) — ${candidateDb}`
185
+ : ` resolver: admin-only (US-optimized) — point --candidate-db / $MAILWOMAN_CANDIDATE_DB at a candidate gazetteer for worldwide`);
186
+ console.error(` cors: ${values.cors ? "enabled (Access-Control-Allow-Origin: *)" : "disabled (--no-cors)"}`);
187
+ console.error(` endpoints: GET /api GET /reverse GET /openapi.json`);
188
+ },
189
+ });
190
+ }
191
+ /**
192
+ * `openapi` — print (or `--out`-write) the emitted OpenAPI document for this surface. Builds the app around an
193
+ * all-optional stub {@link PhotonEngine} (`{}` — every route answers 501 under this stub, but the document itself only
194
+ * reflects the ROUTE TABLE, not handler behavior) so this NEVER boots the neural classifier or opens a gazetteer DB:
195
+ * pure route-table introspection, fast regardless of data-root state. `--flavor 3.0` prints the 3.0.3 diet instead of
196
+ * the default 3.1.0.
197
+ */
198
+ function openapi() {
199
+ const { values } = parseArgs({
200
+ options: {
201
+ flavor: { type: "string", default: "3.1" },
202
+ out: { type: "string" },
203
+ },
204
+ allowPositionals: true,
153
205
  });
206
+ if (values.flavor !== "3.1" && values.flavor !== "3.0") {
207
+ console.error(`✗ --flavor must be "3.1" or "3.0" (got "${values.flavor}")`);
208
+ console.error("Usage: mailwoman-photon openapi [--flavor 3.1|3.0] [--out <path>]");
209
+ process.exit(1);
210
+ }
211
+ const app = createPhotonApp({});
212
+ printOpenAPIDocument(app, PHOTON_DOC_INFO, values);
154
213
  }
155
214
  // Subcommand dispatch via parseArgs (strict:false — the per-command parsers own their flags).
156
215
  const command = parseArgs({ strict: false, allowPositionals: true }).positionals[0];
@@ -158,8 +217,15 @@ switch (command) {
158
217
  case "serve":
159
218
  await serve();
160
219
  break;
220
+ case "openapi":
221
+ openapi();
222
+ break;
161
223
  default:
162
- console.error("Usage: mailwoman-photon serve [--port 2322] [--host 0.0.0.0] [--candidate-db <path>] [--no-cors]");
224
+ console.error([
225
+ "Usage: mailwoman-photon <command>",
226
+ " serve [--port 2322] [--host 0.0.0.0] [--candidate-db <path>] [--no-cors]",
227
+ " openapi [--flavor 3.1|3.0] [--out <path>]",
228
+ ].join("\n"));
163
229
  process.exit(command ? 1 : 0);
164
230
  }
165
231
  //# sourceMappingURL=cli.js.map
package/out/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,uBAA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CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/B,CAAC"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The Photon engine contract + wire types the router delegates to. Feature/collection
7
+ * construction lives here too (`photonFeature`, `photonCollection`) since every projection
8
+ * builds on them; the RESOLVED-place → {@link PhotonProperties} projection itself lives in
9
+ * `projection.ts`.
10
+ */
11
+ /**
12
+ * Photon feature properties — OSM-derived tag names, populated from Mailwoman's `ComponentTag` / resolved place.
13
+ * `extent` is `[minLon, maxLat, maxLon, minLat]` per Photon's convention.
14
+ */
15
+ export interface PhotonProperties {
16
+ osm_id?: number | string;
17
+ osm_type?: string;
18
+ osm_key?: string;
19
+ osm_value?: string;
20
+ type?: string;
21
+ name?: string;
22
+ housenumber?: string;
23
+ street?: string;
24
+ postcode?: string;
25
+ city?: string;
26
+ district?: string;
27
+ county?: string;
28
+ state?: string;
29
+ country?: string;
30
+ countrycode?: string;
31
+ extent?: [number, number, number, number];
32
+ [key: string]: unknown;
33
+ }
34
+ /** A Photon result feature: a GeoJSON Point with {@link PhotonProperties}. */
35
+ export interface PhotonFeature {
36
+ type: "Feature";
37
+ geometry: {
38
+ type: "Point";
39
+ coordinates: [number, number];
40
+ };
41
+ properties: PhotonProperties;
42
+ }
43
+ /** The Photon response envelope — a GeoJSON FeatureCollection. */
44
+ export interface PhotonFeatureCollection {
45
+ type: "FeatureCollection";
46
+ features: PhotonFeature[];
47
+ }
48
+ /** Parsed `/api` (forward / autocomplete) parameters. */
49
+ export interface PhotonSearchParams {
50
+ q: string;
51
+ limit: number;
52
+ lang?: string;
53
+ /** Location bias. */
54
+ lat?: number;
55
+ lon?: number;
56
+ bbox?: [number, number, number, number];
57
+ osmTag?: string[];
58
+ layer?: string[];
59
+ }
60
+ /** Parsed `/reverse` parameters. */
61
+ export interface PhotonReverseParams {
62
+ lat: number;
63
+ lon: number;
64
+ limit: number;
65
+ lang?: string;
66
+ radius?: number;
67
+ }
68
+ /**
69
+ * The engine the router delegates to. Each method is optional; a missing one answers `501`. The real implementation
70
+ * backs `/api` with the FST autocomplete tier + parse→resolve, and `/reverse` with the `WOFReverseGeocoder`.
71
+ */
72
+ export interface PhotonEngine {
73
+ search?(params: PhotonSearchParams): Promise<PhotonFeatureCollection>;
74
+ reverse?(params: PhotonReverseParams): Promise<PhotonFeatureCollection>;
75
+ }
76
+ /** Build a Photon `Feature` from a coordinate + properties. */
77
+ export declare function photonFeature(lon: number, lat: number, properties: PhotonProperties): PhotonFeature;
78
+ /** Wrap features in a Photon `FeatureCollection`. */
79
+ export declare function photonCollection(features: PhotonFeature[]): PhotonFeatureCollection;
80
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM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D;AAC/D,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,aAAa,CAEnG;AAED,qDAAqD;AACrD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,uBAAuB,CAEnF"}
package/out/engine.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The Photon engine contract + wire types the router delegates to. Feature/collection
7
+ * construction lives here too (`photonFeature`, `photonCollection`) since every projection
8
+ * builds on them; the RESOLVED-place → {@link PhotonProperties} projection itself lives in
9
+ * `projection.ts`.
10
+ */
11
+ /** Build a Photon `Feature` from a coordinate + properties. */
12
+ export function photonFeature(lon, lat, properties) {
13
+ return { type: "Feature", geometry: { type: "Point", coordinates: [lon, lat] }, properties };
14
+ }
15
+ /** Wrap features in a Photon `FeatureCollection`. */
16
+ export function photonCollection(features) {
17
+ return { type: "FeatureCollection", features };
18
+ }
19
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.js","sourceRoot":"","sources":["../engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyEH,+DAA+D;AAC/D,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,GAAW,EAAE,UAA4B;IACnF,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,UAAU,EAAE,CAAA;AAC7F,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,gBAAgB,CAAC,QAAyB;IACzD,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,CAAA;AAC/C,CAAC"}
package/out/index.d.ts CHANGED
@@ -9,156 +9,17 @@
9
9
  * prefixes. It maps onto Mailwoman's shipped FST autocomplete tier (#190/#587) + parse →
10
10
  * resolve.
11
11
  *
12
- * Like its sibling, the package is engine-agnostic: {@link createPhotonRouter} takes a
12
+ * Like its siblings, the package is engine-agnostic: {@link createPhotonApp} takes a
13
13
  * {@link PhotonEngine}; the CLI wires the real engine. Implementation is staged on the epic (#801
14
14
  * / the Photon child); routes whose engine method is absent answer `501`.
15
- */
16
- import { Router } from "express";
17
- /**
18
- * Photon feature properties — OSM-derived tag names, populated from Mailwoman's `ComponentTag` / resolved place.
19
- * `extent` is `[minLon, maxLat, maxLon, minLat]` per Photon's convention.
20
- */
21
- export interface PhotonProperties {
22
- osm_id?: number | string;
23
- osm_type?: string;
24
- osm_key?: string;
25
- osm_value?: string;
26
- type?: string;
27
- name?: string;
28
- housenumber?: string;
29
- street?: string;
30
- postcode?: string;
31
- city?: string;
32
- district?: string;
33
- county?: string;
34
- state?: string;
35
- country?: string;
36
- countrycode?: string;
37
- extent?: [number, number, number, number];
38
- [key: string]: unknown;
39
- }
40
- /** A Photon result feature: a GeoJSON Point with {@link PhotonProperties}. */
41
- export interface PhotonFeature {
42
- type: "Feature";
43
- geometry: {
44
- type: "Point";
45
- coordinates: [number, number];
46
- };
47
- properties: PhotonProperties;
48
- }
49
- /** The Photon response envelope — a GeoJSON FeatureCollection. */
50
- export interface PhotonFeatureCollection {
51
- type: "FeatureCollection";
52
- features: PhotonFeature[];
53
- }
54
- /** Parsed `/api` (forward / autocomplete) parameters. */
55
- export interface PhotonSearchParams {
56
- q: string;
57
- limit: number;
58
- lang?: string;
59
- /** Location bias. */
60
- lat?: number;
61
- lon?: number;
62
- bbox?: [number, number, number, number];
63
- osmTag?: string[];
64
- layer?: string[];
65
- }
66
- /** Parsed `/reverse` parameters. */
67
- export interface PhotonReverseParams {
68
- lat: number;
69
- lon: number;
70
- limit: number;
71
- lang?: string;
72
- radius?: number;
73
- }
74
- /**
75
- * The engine the router delegates to. Each method is optional; a missing one answers `501`. The real implementation
76
- * backs `/api` with the FST autocomplete tier + parse→resolve, and `/reverse` with the `WOFReverseGeocoder`.
77
- */
78
- export interface PhotonEngine {
79
- search?(params: PhotonSearchParams): Promise<PhotonFeatureCollection>;
80
- reverse?(params: PhotonReverseParams): Promise<PhotonFeatureCollection>;
81
- }
82
- /** Options for {@link createPhotonRouter}. */
83
- export interface PhotonRouterOptions {
84
- /**
85
- * Emit permissive CORS headers (`Access-Control-Allow-Origin: *`) on every response and answer preflight `OPTIONS`
86
- * with `204`. Default `true` — upstream komoot/photon serves permissive CORS, and the map-widget use case
87
- * (leaflet-control-geocoder, @openrunner/photon-geocoder, …) needs it: a browser's cross-origin XHR is blocked
88
- * without it (#1017). Set `false` when a reverse proxy already owns the CORS headers.
89
- */
90
- cors?: boolean;
91
- }
92
- /**
93
- * Build the Photon-compatible router around an injected {@link PhotonEngine}. Param parsing lives here; the feature
94
- * _projection_ (resolved place → {@link PhotonProperties}) is the staged work.
95
- */
96
- export declare function createPhotonRouter(engine: PhotonEngine, options?: PhotonRouterOptions): Router;
97
- /** Build a Photon `Feature` from a coordinate + properties. */
98
- export declare function photonFeature(lon: number, lat: number, properties: PhotonProperties): PhotonFeature;
99
- /** Wrap features in a Photon `FeatureCollection`. */
100
- export declare function photonCollection(features: PhotonFeature[]): PhotonFeatureCollection;
101
- /**
102
- * The resolved-place info a forward `/api` result carries: the admin ladder (MOST-SPECIFIC first) with GAZETTEER names,
103
- * the coordinate, the resolved country, and the postcode. {@link photonForwardProperties} projects it onto Photon's
104
- * schema. #1014 — decorate from the resolved place, not the parsed input span.
105
- */
106
- export interface PhotonForwardInput {
107
- lat: number;
108
- lon: number;
109
- postcode?: string | null;
110
- /** The resolved country, mapped by the caller (ISO2 → canonical name via `@mailwoman/codex`). */
111
- country?: {
112
- name?: string;
113
- code?: string;
114
- } | null;
115
- /** Resolved admin ancestry, most-specific first, each carrying the gazetteer's canonical name (not the parsed span). */
116
- places: ReadonlyArray<{
117
- tag: string;
118
- name: string;
119
- }>;
120
- /**
121
- * A HOUSE-GRADE result (#1041): set only when the resolver produced a specific building coordinate — the
122
- * `address_point` (rooftop) or `interpolated` tier fired, NOT an admin centroid. {@link photonForwardProperties} then
123
- * re-tags the schema `osm_key: place` / `osm_value: house` / `type: house` and surfaces the parsed `housenumber` +
124
- * `street`, matching upstream komoot/photon's own bare-address-point shape (verified against `photon.komoot.io`: a
125
- * residential rooftop returns `{osm_key:"place", osm_value:"house", type:"house", housenumber, street}` with NO
126
- * `name`). Absent → the result keeps its admin-ancestry schema. Without it a rooftop reads as `type: city` and a
127
- * client zooms to city scale (or paints a city marker) on a doorstep match — the #1041 regression.
128
- */
129
- house?: {
130
- number?: string | null;
131
- street?: string | null;
132
- } | null;
133
- }
134
- /**
135
- * The Photon `osm_key`/`osm_value`/`type` for a resolved tag or WOF placetype (`locality`, `region`, `country`, …),
136
- * falling back to a safe default so the fields are always present. Shared by the forward projection and `/reverse` so
137
- * the two endpoints report a place the SAME way. #1014.
138
- */
139
- export declare function photonOSMTags(tagOrPlacetype: string): {
140
- osm_key: string;
141
- osm_value: string;
142
- type: string;
143
- };
144
- /**
145
- * Project a resolved forward result into Photon properties — decorating from the RESOLVED gazetteer place (proper-cased
146
- * names + ancestry + country), NOT the parsed input span, and ALWAYS emitting `osm_key`/`osm_value`/`type` so Photon
147
- * client libraries (leaflet-control-geocoder, @openrunner/photon-geocoder) never dereference undefined. #1014.
148
- */
149
- export declare function photonForwardProperties(input: PhotonForwardInput): PhotonProperties;
150
- /** {@link photonForwardProperties}, wrapped as a Photon Point `Feature` at the resolved coordinate. #1014. */
151
- export declare function photonForwardFeature(input: PhotonForwardInput): PhotonFeature;
152
- /** The winning place plus its ranked alternatives — the input to {@link photonForwardCollection}. #1016. */
153
- export interface PhotonForwardResult {
154
- /** The winning place, with full admin ancestry (from the resolved hierarchy). */
155
- primary: PhotonForwardInput;
156
- /** Ranked alternative places (Springfield MA / IL / …), each a single-place input; excludes the primary. */
157
- alternatives: PhotonForwardInput[];
158
- }
159
- /**
160
- * Assemble a Photon `FeatureCollection` honoring `limit` (#1016): the primary feature first, then ranked alternatives,
161
- * capped at `limit`. `limit` floors to 1 (Photon always returns at least the best match).
162
- */
163
- export declare function photonForwardCollection(result: PhotonForwardResult, limit: number): PhotonFeatureCollection;
15
+ *
16
+ * The Hono app (CORS + error envelope + the emitted OpenAPI document) lives in `app.ts`; route
17
+ * definitions + handlers in `routes.ts`; wire types + the engine contract in `engine.ts`; the
18
+ * resolved-place → Photon-schema projection in `projection.ts`; the zod wire schemas in
19
+ * `schema.ts`.
20
+ */
21
+ export * from "./app.ts";
22
+ export * from "./engine.ts";
23
+ export * from "./projection.ts";
24
+ export * from "./schema.ts";
164
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAuB,MAAM,EAAE,MAAM,SAAS,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,CAAC,MAAM,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