@mailwoman/photon 5.10.1 → 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/out/routes.js ADDED
@@ -0,0 +1,174 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Route definitions + handlers for the Photon-compatible surface. The OpenAPI document is
7
+ * emitted from these definitions — no handwritten spec. Handlers parse params from the
8
+ * `legacyQuery` express-shaped view; the zod query schemas drive only the emitted document.
9
+ */
10
+ import { createRoute, z } from "@hono/zod-openapi";
11
+ import {} from "./engine.js";
12
+ import { photonToSchemaOrg } from "./projection.js";
13
+ import { PhotonMessageCollectionSchema, PhotonResponseSchema, reverseQueryParams, searchQueryParams } from "./schema.js";
14
+ const DEFAULT_LIMIT = 15;
15
+ const EMPTY = { type: "FeatureCollection", features: [] };
16
+ function asString(raw) {
17
+ return typeof raw === "string" && raw.length > 0 ? raw : undefined;
18
+ }
19
+ function asStringArray(raw) {
20
+ if (Array.isArray(raw))
21
+ return raw.filter((v) => typeof v === "string");
22
+ const s = asString(raw);
23
+ return s ? [s] : undefined;
24
+ }
25
+ /**
26
+ * Express's `req.query` shape: `string` for a single value, `string[]` for repeats. The legacy parsing helpers
27
+ * (`asString`, `asStringArray`, `Number(...)`) — and their observable degenerate behaviors (repeated `q` → 400,
28
+ * repeated `lat` → NaN → 400) — key off exactly this shape, so the handlers consume it unchanged. Do NOT dedup or
29
+ * canonicalize here: photon's repeatable params (`osm_tag`, `layer`) are contract, and its duplicate-param 400s are
30
+ * contract too (unlike libpostal, where duplicates were never-contract — see the phase-1 adjudications).
31
+ * Null-prototype, matching express-simple's req.query shape (a repeated `?__proto__=` param must create an own
32
+ * property, not reparent the object).
33
+ */
34
+ function legacyQuery(c) {
35
+ const out = Object.create(null);
36
+ for (const [key, values] of Object.entries(c.req.queries())) {
37
+ out[key] = values.length === 1 ? values[0] : values;
38
+ }
39
+ return out;
40
+ }
41
+ /**
42
+ * A friendly HTML landing page for `GET /` (#1022). Upstream komoot/photon serves no root page, so there's no wire
43
+ * contract to match — this is pure courtesy: a browser visitor (or an evaluator kicking the tires) who pastes the bare
44
+ * host in gets a one-glance orientation with clickable example queries instead of Express's `Cannot GET /` 404, which
45
+ * reads as "the service is broken". Relative example URLs so they resolve against whatever host/port serves this.
46
+ */
47
+ const ROOT_HTML = `<!doctype html>
48
+ <html lang="en">
49
+ <head>
50
+ <meta charset="utf-8">
51
+ <meta name="viewport" content="width=device-width, initial-scale=1">
52
+ <title>@mailwoman/photon</title>
53
+ <style>
54
+ :root { color-scheme: light dark }
55
+ body { font: 16px/1.6 system-ui, -apple-system, sans-serif; max-width: 42rem; margin: 3rem auto; padding: 0 1.25rem }
56
+ h1 { font-size: 1.3rem; margin: 0 0 .5rem }
57
+ code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace }
58
+ ul { padding-left: 1.2rem }
59
+ li { margin: .4rem 0 }
60
+ a { color: #2563eb }
61
+ .q { font-family: ui-monospace, SFMono-Regular, Menlo, monospace }
62
+ footer { margin-top: 2rem; font-size: .9rem; opacity: .8 }
63
+ </style>
64
+ </head>
65
+ <body>
66
+ <h1>@mailwoman/photon</h1>
67
+ <p>A Photon-compatible autocomplete geocoding API — the same <code>/api</code> and <code>/reverse</code> contract, served from a SQLite gazetteer instead of an Elasticsearch cluster.</p>
68
+ <p>Try a query:</p>
69
+ <ul>
70
+ <li><a class="q" href="/api?q=berlin&amp;limit=3">/api?q=berlin&amp;limit=3</a></li>
71
+ <li><a class="q" href="/api?q=1600+pennsylvania+ave&amp;limit=1">/api?q=1600+pennsylvania+ave&amp;limit=1</a></li>
72
+ <li><a class="q" href="/reverse?lat=52.52&amp;lon=13.405">/reverse?lat=52.52&amp;lon=13.405</a></li>
73
+ </ul>
74
+ <footer><a href="https://mailwoman.sister.software/docs/concepts/switching-from-photon">Switching from Photon</a> &middot; <a href="https://mailwoman.sister.software/demo">Live demo</a></footer>
75
+ </body>
76
+ </html>
77
+ `;
78
+ const messageContent = (description) => ({
79
+ description,
80
+ content: { "application/json": { schema: PhotonMessageCollectionSchema } },
81
+ });
82
+ const collectionResponses = {
83
+ 200: {
84
+ description: "A GeoJSON FeatureCollection (or schema.org Place[] when format=jsonld).",
85
+ content: { "application/json": { schema: PhotonResponseSchema } },
86
+ },
87
+ 400: messageContent("A required or malformed parameter."),
88
+ 500: messageContent("An unexpected engine fault. An empty FeatureCollection with a message, never a crash."),
89
+ 501: messageContent("The backing engine method is not wired for this deployment."),
90
+ };
91
+ const rootRoute = createRoute({
92
+ method: "get",
93
+ path: "/",
94
+ operationId: "getRoot",
95
+ summary: "Landing page",
96
+ tags: ["meta"],
97
+ responses: { 200: { description: "HTML landing page.", content: { "text/html": { schema: z.string() } } } },
98
+ });
99
+ const searchRoute = createRoute({
100
+ method: "get",
101
+ path: "/api",
102
+ operationId: "search",
103
+ summary: "Forward / autocomplete geocoding",
104
+ tags: ["geocoding"],
105
+ request: { query: searchQueryParams },
106
+ responses: collectionResponses,
107
+ });
108
+ const reverseRoute = createRoute({
109
+ method: "get",
110
+ path: "/reverse",
111
+ operationId: "reverse",
112
+ summary: "Reverse geocoding",
113
+ tags: ["geocoding"],
114
+ request: { query: reverseQueryParams },
115
+ responses: collectionResponses,
116
+ });
117
+ /** Register the Photon-compatible routes against an injected engine. */
118
+ export function registerPhotonRoutes(app, engine) {
119
+ app.openapi(rootRoute, (c) => c.html(ROOT_HTML));
120
+ app.openapi(searchRoute, async (c) => {
121
+ if (!engine.search)
122
+ return c.json({ ...EMPTY, message: "search not implemented" }, 501);
123
+ const q = legacyQuery(c);
124
+ const query = asString(q["q"]);
125
+ if (!query)
126
+ return c.json({ ...EMPTY, message: "q is required" }, 400);
127
+ const params = {
128
+ q: query,
129
+ limit: Number(q["limit"] ?? DEFAULT_LIMIT) || DEFAULT_LIMIT,
130
+ lang: asString(q["lang"]),
131
+ lat: q["lat"] != null ? Number(q["lat"]) : undefined,
132
+ lon: q["lon"] != null ? Number(q["lon"]) : undefined,
133
+ osmTag: asStringArray(q["osm_tag"]),
134
+ layer: asStringArray(q["layer"]),
135
+ };
136
+ const collection = await engine.search(params);
137
+ // #1052: `format=jsonld` re-serializes the SAME FeatureCollection as schema.org `Place[]` JSON-LD. The
138
+ // declared 200 schema documents only the FeatureCollection shape (matching the legacy yaml — see the
139
+ // Task 4 adjudication); the jsonld branch's differing runtime shape is a local cast at the boundary,
140
+ // never a wire-behavior change (api-kit's `openapi.ts` sets the precedent for this idiom).
141
+ if (asString(q["format"]) === "jsonld") {
142
+ return c.json(photonToSchemaOrg(collection), 200);
143
+ }
144
+ return c.json(collection, 200);
145
+ });
146
+ app.openapi(reverseRoute, async (c) => {
147
+ if (!engine.reverse)
148
+ return c.json({ ...EMPTY, message: "reverse not implemented" }, 501);
149
+ const q = legacyQuery(c);
150
+ const lat = Number(q["lat"]);
151
+ const lon = Number(q["lon"]);
152
+ if (!Number.isFinite(lat) || !Number.isFinite(lon)) {
153
+ return c.json({ ...EMPTY, message: "lat and lon are required" }, 400);
154
+ }
155
+ if (lat < -90 || lat > 90 || lon < -180 || lon > 180) {
156
+ return c.json({ ...EMPTY, message: "lat must be in [-90, 90] and lon in [-180, 180]" }, 400);
157
+ }
158
+ const params = {
159
+ lat,
160
+ lon,
161
+ limit: Number(q["limit"] ?? DEFAULT_LIMIT) || DEFAULT_LIMIT,
162
+ lang: asString(q["lang"]),
163
+ radius: q["radius"] != null ? Number(q["radius"]) : undefined,
164
+ };
165
+ const collection = await engine.reverse(params);
166
+ // #1052: `format=jsonld` re-serializes the reverse FeatureCollection as schema.org `Place[]` JSON-LD. See
167
+ // the search handler's comment above for why this is a local cast, not a wire-behavior change.
168
+ if (asString(q["format"]) === "jsonld") {
169
+ return c.json(photonToSchemaOrg(collection), 200);
170
+ }
171
+ return c.json(collection, 200);
172
+ });
173
+ }
174
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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@@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Zod wire schemas for the Photon-compatible surface. Key names and envelopes are the vendor
7
+ * contract — immutable. Query schemas are validator-proof by construction (unions accepting
8
+ * string or repeated values) with doc-exact `.openapi()` overrides: validation can never fail,
9
+ * and every wire decision stays in the handlers (see routes.ts's legacyQuery adapter).
10
+ */
11
+ import { z } from "@hono/zod-openapi";
12
+ /** Photon feature properties — OSM-derived keys; tolerant of extras (`[key: string]: unknown` on the wire type). */
13
+ export declare const PhotonPropertiesSchema: z.ZodObject<{
14
+ osm_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
15
+ osm_type: z.ZodOptional<z.ZodString>;
16
+ osm_key: z.ZodOptional<z.ZodString>;
17
+ osm_value: z.ZodOptional<z.ZodString>;
18
+ type: z.ZodOptional<z.ZodString>;
19
+ name: z.ZodOptional<z.ZodString>;
20
+ housenumber: z.ZodOptional<z.ZodString>;
21
+ street: z.ZodOptional<z.ZodString>;
22
+ postcode: z.ZodOptional<z.ZodString>;
23
+ city: z.ZodOptional<z.ZodString>;
24
+ district: z.ZodOptional<z.ZodString>;
25
+ county: z.ZodOptional<z.ZodString>;
26
+ state: z.ZodOptional<z.ZodString>;
27
+ country: z.ZodOptional<z.ZodString>;
28
+ countrycode: z.ZodOptional<z.ZodString>;
29
+ extent: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
30
+ }, z.core.$loose>;
31
+ export declare const PhotonFeatureSchema: z.ZodObject<{
32
+ type: z.ZodLiteral<"Feature">;
33
+ geometry: z.ZodObject<{
34
+ type: z.ZodLiteral<"Point">;
35
+ coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
36
+ }, z.core.$strip>;
37
+ properties: z.ZodObject<{
38
+ osm_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
39
+ osm_type: z.ZodOptional<z.ZodString>;
40
+ osm_key: z.ZodOptional<z.ZodString>;
41
+ osm_value: z.ZodOptional<z.ZodString>;
42
+ type: z.ZodOptional<z.ZodString>;
43
+ name: z.ZodOptional<z.ZodString>;
44
+ housenumber: z.ZodOptional<z.ZodString>;
45
+ street: z.ZodOptional<z.ZodString>;
46
+ postcode: z.ZodOptional<z.ZodString>;
47
+ city: z.ZodOptional<z.ZodString>;
48
+ district: z.ZodOptional<z.ZodString>;
49
+ county: z.ZodOptional<z.ZodString>;
50
+ state: z.ZodOptional<z.ZodString>;
51
+ country: z.ZodOptional<z.ZodString>;
52
+ countrycode: z.ZodOptional<z.ZodString>;
53
+ extent: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
54
+ }, z.core.$loose>;
55
+ }, z.core.$strip>;
56
+ export declare const PhotonFeatureCollectionSchema: z.ZodObject<{
57
+ type: z.ZodLiteral<"FeatureCollection">;
58
+ features: z.ZodArray<z.ZodObject<{
59
+ type: z.ZodLiteral<"Feature">;
60
+ geometry: z.ZodObject<{
61
+ type: z.ZodLiteral<"Point">;
62
+ coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
63
+ }, z.core.$strip>;
64
+ properties: z.ZodObject<{
65
+ osm_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
66
+ osm_type: z.ZodOptional<z.ZodString>;
67
+ osm_key: z.ZodOptional<z.ZodString>;
68
+ osm_value: z.ZodOptional<z.ZodString>;
69
+ type: z.ZodOptional<z.ZodString>;
70
+ name: z.ZodOptional<z.ZodString>;
71
+ housenumber: z.ZodOptional<z.ZodString>;
72
+ street: z.ZodOptional<z.ZodString>;
73
+ postcode: z.ZodOptional<z.ZodString>;
74
+ city: z.ZodOptional<z.ZodString>;
75
+ district: z.ZodOptional<z.ZodString>;
76
+ county: z.ZodOptional<z.ZodString>;
77
+ state: z.ZodOptional<z.ZodString>;
78
+ country: z.ZodOptional<z.ZodString>;
79
+ countrycode: z.ZodOptional<z.ZodString>;
80
+ extent: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
81
+ }, z.core.$loose>;
82
+ }, z.core.$strip>>;
83
+ }, z.core.$strip>;
84
+ /** The error/degenerate envelope: an EMPTY FeatureCollection carrying a message. Never `{error}` on this surface. */
85
+ export declare const PhotonMessageCollectionSchema: z.ZodObject<{
86
+ type: z.ZodLiteral<"FeatureCollection">;
87
+ features: z.ZodArray<z.ZodObject<{
88
+ type: z.ZodLiteral<"Feature">;
89
+ geometry: z.ZodObject<{
90
+ type: z.ZodLiteral<"Point">;
91
+ coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
92
+ }, z.core.$strip>;
93
+ properties: z.ZodObject<{
94
+ osm_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
95
+ osm_type: z.ZodOptional<z.ZodString>;
96
+ osm_key: z.ZodOptional<z.ZodString>;
97
+ osm_value: z.ZodOptional<z.ZodString>;
98
+ type: z.ZodOptional<z.ZodString>;
99
+ name: z.ZodOptional<z.ZodString>;
100
+ housenumber: z.ZodOptional<z.ZodString>;
101
+ street: z.ZodOptional<z.ZodString>;
102
+ postcode: z.ZodOptional<z.ZodString>;
103
+ city: z.ZodOptional<z.ZodString>;
104
+ district: z.ZodOptional<z.ZodString>;
105
+ county: z.ZodOptional<z.ZodString>;
106
+ state: z.ZodOptional<z.ZodString>;
107
+ country: z.ZodOptional<z.ZodString>;
108
+ countrycode: z.ZodOptional<z.ZodString>;
109
+ extent: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
110
+ }, z.core.$loose>;
111
+ }, z.core.$strip>>;
112
+ message: z.ZodString;
113
+ }, z.core.$strip>;
114
+ /**
115
+ * The schema.org [`GeoCoordinates`](https://schema.org/GeoCoordinates) node — mirrors `@mailwoman/annotations`'s
116
+ * `SchemaOrgGeoCoordinates` interface. Hand-modeled locally (no import from `@mailwoman/annotations`) matching this
117
+ * package's existing wire-schema convention: each surface owns its own doc-accuracy schemas rather than sharing a
118
+ * schema across the package boundary.
119
+ */
120
+ export declare const SchemaOrgGeoCoordinatesSchema: z.ZodObject<{
121
+ "@type": z.ZodLiteral<"GeoCoordinates">;
122
+ latitude: z.ZodNumber;
123
+ longitude: z.ZodNumber;
124
+ }, z.core.$strip>;
125
+ /** The schema.org [`PostalAddress`](https://schema.org/PostalAddress) node — mirrors `SchemaOrgPostalAddress`. */
126
+ export declare const SchemaOrgPostalAddressSchema: z.ZodObject<{
127
+ "@type": z.ZodLiteral<"PostalAddress">;
128
+ streetAddress: z.ZodOptional<z.ZodString>;
129
+ postOfficeBoxNumber: z.ZodOptional<z.ZodString>;
130
+ addressLocality: z.ZodOptional<z.ZodString>;
131
+ addressRegion: z.ZodOptional<z.ZodString>;
132
+ postalCode: z.ZodOptional<z.ZodString>;
133
+ addressCountry: z.ZodOptional<z.ZodString>;
134
+ }, z.core.$strip>;
135
+ /**
136
+ * The `format=jsonld` re-serialization (#1052) — mirrors `@mailwoman/annotations`'s `SchemaOrgPlace` interface, the
137
+ * shape `photonToSchemaOrg` actually produces.
138
+ */
139
+ export declare const SchemaOrgPlaceSchema: z.ZodObject<{
140
+ "@context": z.ZodLiteral<"https://schema.org">;
141
+ "@type": z.ZodLiteral<"Place">;
142
+ name: z.ZodOptional<z.ZodString>;
143
+ geo: z.ZodOptional<z.ZodObject<{
144
+ "@type": z.ZodLiteral<"GeoCoordinates">;
145
+ latitude: z.ZodNumber;
146
+ longitude: z.ZodNumber;
147
+ }, z.core.$strip>>;
148
+ address: z.ZodOptional<z.ZodObject<{
149
+ "@type": z.ZodLiteral<"PostalAddress">;
150
+ streetAddress: z.ZodOptional<z.ZodString>;
151
+ postOfficeBoxNumber: z.ZodOptional<z.ZodString>;
152
+ addressLocality: z.ZodOptional<z.ZodString>;
153
+ addressRegion: z.ZodOptional<z.ZodString>;
154
+ postalCode: z.ZodOptional<z.ZodString>;
155
+ addressCountry: z.ZodOptional<z.ZodString>;
156
+ }, z.core.$strip>>;
157
+ }, z.core.$strip>;
158
+ /**
159
+ * The real `/api` + `/reverse` 200 response union (#1052 doc accuracy): a GeoJSON FeatureCollection by default, or an
160
+ * array of schema.org `Place` JSON-LD objects when `format=jsonld` — see `routes.ts`'s handlers (`photonToSchemaOrg`).
161
+ * Doc-only; the wire behavior is unchanged.
162
+ */
163
+ export declare const PhotonResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
164
+ type: z.ZodLiteral<"FeatureCollection">;
165
+ features: z.ZodArray<z.ZodObject<{
166
+ type: z.ZodLiteral<"Feature">;
167
+ geometry: z.ZodObject<{
168
+ type: z.ZodLiteral<"Point">;
169
+ coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
170
+ }, z.core.$strip>;
171
+ properties: z.ZodObject<{
172
+ osm_id: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
173
+ osm_type: z.ZodOptional<z.ZodString>;
174
+ osm_key: z.ZodOptional<z.ZodString>;
175
+ osm_value: z.ZodOptional<z.ZodString>;
176
+ type: z.ZodOptional<z.ZodString>;
177
+ name: z.ZodOptional<z.ZodString>;
178
+ housenumber: z.ZodOptional<z.ZodString>;
179
+ street: z.ZodOptional<z.ZodString>;
180
+ postcode: z.ZodOptional<z.ZodString>;
181
+ city: z.ZodOptional<z.ZodString>;
182
+ district: z.ZodOptional<z.ZodString>;
183
+ county: z.ZodOptional<z.ZodString>;
184
+ state: z.ZodOptional<z.ZodString>;
185
+ country: z.ZodOptional<z.ZodString>;
186
+ countrycode: z.ZodOptional<z.ZodString>;
187
+ extent: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
188
+ }, z.core.$loose>;
189
+ }, z.core.$strip>>;
190
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
191
+ "@context": z.ZodLiteral<"https://schema.org">;
192
+ "@type": z.ZodLiteral<"Place">;
193
+ name: z.ZodOptional<z.ZodString>;
194
+ geo: z.ZodOptional<z.ZodObject<{
195
+ "@type": z.ZodLiteral<"GeoCoordinates">;
196
+ latitude: z.ZodNumber;
197
+ longitude: z.ZodNumber;
198
+ }, z.core.$strip>>;
199
+ address: z.ZodOptional<z.ZodObject<{
200
+ "@type": z.ZodLiteral<"PostalAddress">;
201
+ streetAddress: z.ZodOptional<z.ZodString>;
202
+ postOfficeBoxNumber: z.ZodOptional<z.ZodString>;
203
+ addressLocality: z.ZodOptional<z.ZodString>;
204
+ addressRegion: z.ZodOptional<z.ZodString>;
205
+ postalCode: z.ZodOptional<z.ZodString>;
206
+ addressCountry: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strip>>;
208
+ }, z.core.$strip>>]>;
209
+ /** `GET /api` query — documented shape; presence/parsing enforced in-handler. */
210
+ export declare const searchQueryParams: z.ZodObject<{
211
+ q: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
212
+ limit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
213
+ lang: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
214
+ lat: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
215
+ lon: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
216
+ osm_tag: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
217
+ layer: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
218
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
219
+ }, z.core.$strip>;
220
+ /** `GET /reverse` query. */
221
+ export declare const reverseQueryParams: z.ZodObject<{
222
+ lat: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
223
+ lon: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
224
+ limit: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
225
+ lang: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
226
+ radius: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
227
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
228
+ }, z.core.$strip>;
229
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAA;AAGrC,oHAAoH;AACpH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;iBAoBN,CAAA;AAE7B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;iBAAiE,CAAA;AAEjG,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBACsC,CAAA;AAEhF,qHAAqH;AACrH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMN,CAAA;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;iBAMN,CAAA;AAEpC,kHAAkH;AAClH,eAAO,MAAM,4BAA4B;;;;;;;;iBAUN,CAAA;AAEnC;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;iBAQN,CAAA;AAE3B;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEN,CAAA;AAQ3B,iFAAiF;AACjF,eAAO,MAAM,iBAAiB;;;;;;;;;iBAa5B,CAAA;AAEF,4BAA4B;AAC5B,eAAO,MAAM,kBAAkB;;;;;;;iBAO7B,CAAA"}
package/out/schema.js ADDED
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Zod wire schemas for the Photon-compatible surface. Key names and envelopes are the vendor
7
+ * contract — immutable. Query schemas are validator-proof by construction (unions accepting
8
+ * string or repeated values) with doc-exact `.openapi()` overrides: validation can never fail,
9
+ * and every wire decision stays in the handlers (see routes.ts's legacyQuery adapter).
10
+ */
11
+ import { z } from "@hono/zod-openapi";
12
+ import { featureCollectionSchema, featureSchema } from "@mailwoman/api-kit";
13
+ /** Photon feature properties — OSM-derived keys; tolerant of extras (`[key: string]: unknown` on the wire type). */
14
+ export const PhotonPropertiesSchema = z
15
+ .object({
16
+ osm_id: z.union([z.number(), z.string()]).optional(),
17
+ osm_type: z.string().optional(),
18
+ osm_key: z.string().optional(),
19
+ osm_value: z.string().optional(),
20
+ type: z.string().optional(),
21
+ name: z.string().optional(),
22
+ housenumber: z.string().optional(),
23
+ street: z.string().optional(),
24
+ postcode: z.string().optional(),
25
+ city: z.string().optional(),
26
+ district: z.string().optional(),
27
+ county: z.string().optional(),
28
+ state: z.string().optional(),
29
+ country: z.string().optional(),
30
+ countrycode: z.string().optional(),
31
+ extent: z.tuple([z.number(), z.number(), z.number(), z.number()]).optional(),
32
+ })
33
+ .loose()
34
+ .openapi("PhotonProperties");
35
+ export const PhotonFeatureSchema = featureSchema(PhotonPropertiesSchema).openapi("PhotonFeature");
36
+ export const PhotonFeatureCollectionSchema = featureCollectionSchema(PhotonFeatureSchema).openapi("PhotonFeatureCollection");
37
+ /** The error/degenerate envelope: an EMPTY FeatureCollection carrying a message. Never `{error}` on this surface. */
38
+ export const PhotonMessageCollectionSchema = z
39
+ .object({
40
+ type: z.literal("FeatureCollection"),
41
+ features: z.array(PhotonFeatureSchema),
42
+ message: z.string(),
43
+ })
44
+ .openapi("PhotonMessageCollection");
45
+ /**
46
+ * The schema.org [`GeoCoordinates`](https://schema.org/GeoCoordinates) node — mirrors `@mailwoman/annotations`'s
47
+ * `SchemaOrgGeoCoordinates` interface. Hand-modeled locally (no import from `@mailwoman/annotations`) matching this
48
+ * package's existing wire-schema convention: each surface owns its own doc-accuracy schemas rather than sharing a
49
+ * schema across the package boundary.
50
+ */
51
+ export const SchemaOrgGeoCoordinatesSchema = z
52
+ .object({
53
+ "@type": z.literal("GeoCoordinates"),
54
+ latitude: z.number(),
55
+ longitude: z.number(),
56
+ })
57
+ .openapi("SchemaOrgGeoCoordinates");
58
+ /** The schema.org [`PostalAddress`](https://schema.org/PostalAddress) node — mirrors `SchemaOrgPostalAddress`. */
59
+ export const SchemaOrgPostalAddressSchema = z
60
+ .object({
61
+ "@type": z.literal("PostalAddress"),
62
+ streetAddress: z.string().optional(),
63
+ postOfficeBoxNumber: z.string().optional(),
64
+ addressLocality: z.string().optional(),
65
+ addressRegion: z.string().optional(),
66
+ postalCode: z.string().optional(),
67
+ addressCountry: z.string().optional(),
68
+ })
69
+ .openapi("SchemaOrgPostalAddress");
70
+ /**
71
+ * The `format=jsonld` re-serialization (#1052) — mirrors `@mailwoman/annotations`'s `SchemaOrgPlace` interface, the
72
+ * shape `photonToSchemaOrg` actually produces.
73
+ */
74
+ export const SchemaOrgPlaceSchema = z
75
+ .object({
76
+ "@context": z.literal("https://schema.org"),
77
+ "@type": z.literal("Place"),
78
+ name: z.string().optional(),
79
+ geo: SchemaOrgGeoCoordinatesSchema.optional(),
80
+ address: SchemaOrgPostalAddressSchema.optional(),
81
+ })
82
+ .openapi("SchemaOrgPlace");
83
+ /**
84
+ * The real `/api` + `/reverse` 200 response union (#1052 doc accuracy): a GeoJSON FeatureCollection by default, or an
85
+ * array of schema.org `Place` JSON-LD objects when `format=jsonld` — see `routes.ts`'s handlers (`photonToSchemaOrg`).
86
+ * Doc-only; the wire behavior is unchanged.
87
+ */
88
+ export const PhotonResponseSchema = z
89
+ .union([PhotonFeatureCollectionSchema, z.array(SchemaOrgPlaceSchema)])
90
+ .openapi("PhotonResponse");
91
+ /**
92
+ * A query param that may legally repeat (or that a client may repeat without the validator being allowed to answer for
93
+ * us). Validator-proof: accepts one value or many; the doc override keeps the emitted parameter schema exact.
94
+ */
95
+ const tolerantParam = z.union([z.string(), z.array(z.string())]).optional();
96
+ /** `GET /api` query — documented shape; presence/parsing enforced in-handler. */
97
+ export const searchQueryParams = z.object({
98
+ q: tolerantParam.openapi({ type: "string", description: "The query string to search for." }),
99
+ limit: tolerantParam.openapi({ type: "integer", description: "Maximum results (default 15)." }),
100
+ lang: tolerantParam.openapi({ type: "string", description: "Preferred language." }),
101
+ lat: tolerantParam.openapi({ type: "number", description: "Location-bias latitude." }),
102
+ lon: tolerantParam.openapi({ type: "number", description: "Location-bias longitude." }),
103
+ osm_tag: tolerantParam.openapi({
104
+ type: "array",
105
+ items: { type: "string" },
106
+ description: "OSM tag filter; repeatable.",
107
+ }),
108
+ layer: tolerantParam.openapi({ type: "array", items: { type: "string" }, description: "Layer filter; repeatable." }),
109
+ format: tolerantParam.openapi({ type: "string", enum: ["geojson", "jsonld"], description: "Output format." }),
110
+ });
111
+ /** `GET /reverse` query. */
112
+ export const reverseQueryParams = z.object({
113
+ lat: tolerantParam.openapi({ type: "number", description: "Latitude." }),
114
+ lon: tolerantParam.openapi({ type: "number", description: "Longitude." }),
115
+ limit: tolerantParam.openapi({ type: "integer", description: "Maximum results (default 15)." }),
116
+ lang: tolerantParam.openapi({ type: "string", description: "Preferred language." }),
117
+ radius: tolerantParam.openapi({ type: "number", description: "Search radius in km." }),
118
+ format: tolerantParam.openapi({ type: "string", enum: ["geojson", "jsonld"], description: "Output format." }),
119
+ });
120
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../schema.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,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;IACzE,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC/F,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACnF,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtF,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;CAC7G,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/photon",
3
- "version": "5.10.1",
3
+ "version": "6.0.0",
4
4
  "description": "Photon drop-in — a Photon-compatible autocomplete/type-ahead geocoding API (GeoJSON FeatureCollection over /api + /reverse) on the Mailwoman engine. Run it with `npx @mailwoman/photon serve`.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -35,13 +35,17 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@mailwoman/ban": "5.10.1",
39
- "@mailwoman/codex": "5.10.1",
40
- "@mailwoman/neural": "5.10.1",
41
- "@mailwoman/neural-weights-en-us": "5.10.1",
42
- "@mailwoman/resolver": "5.10.1",
43
- "@mailwoman/resolver-wof-sqlite": "5.10.1",
44
- "express": "^5.2.1",
45
- "mailwoman": "5.10.1"
38
+ "@hono/zod-openapi": "^1.4.0",
39
+ "@mailwoman/annotations": "6.0.0",
40
+ "@mailwoman/api-kit": "6.0.0",
41
+ "@mailwoman/ban": "6.0.0",
42
+ "@mailwoman/codex": "6.0.0",
43
+ "@mailwoman/neural": "6.0.0",
44
+ "@mailwoman/neural-weights-en-us": "6.0.0",
45
+ "@mailwoman/resolver": "6.0.0",
46
+ "@mailwoman/resolver-wof-sqlite": "6.0.0",
47
+ "hono": "^4.12.29",
48
+ "mailwoman": "6.0.0",
49
+ "zod": "^4.4.3"
46
50
  }
47
51
  }