@mailwoman/ogc 0.0.0-stage → 11.2.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 +149 -2
- package/cli/main.ts +153 -0
- package/lib/app.ts +99 -0
- package/lib/collections.ts +159 -0
- package/lib/engine.ts +71 -0
- package/lib/format.ts +46 -0
- package/lib/html.ts +236 -0
- package/lib/index.ts +20 -0
- package/lib/projection.ts +206 -0
- package/lib/routes.ts +587 -0
- package/lib/schema.ts +296 -0
- package/out/app.d.ts +33 -0
- package/out/app.d.ts.map +1 -0
- package/out/app.js +67 -0
- package/out/app.js.map +1 -0
- package/out/cli/main.d.ts +3 -0
- package/out/cli/main.d.ts.map +1 -0
- package/out/cli/main.js +118 -0
- package/out/cli/main.js.map +1 -0
- package/out/collections.d.ts +72 -0
- package/out/collections.d.ts.map +1 -0
- package/out/collections.js +103 -0
- package/out/collections.js.map +1 -0
- package/out/engine.d.ts +65 -0
- package/out/engine.d.ts.map +1 -0
- package/out/engine.js +4 -0
- package/out/engine.js.map +1 -0
- package/out/format.d.ts +18 -0
- package/out/format.d.ts.map +1 -0
- package/out/format.js +31 -0
- package/out/format.js.map +1 -0
- package/out/html.d.ts +42 -0
- package/out/html.d.ts.map +1 -0
- package/out/html.js +153 -0
- package/out/html.js.map +1 -0
- package/out/index.d.ts +17 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +19 -0
- package/out/index.js.map +1 -0
- package/out/projection.d.ts +26 -0
- package/out/projection.d.ts.map +1 -0
- package/out/projection.js +168 -0
- package/out/projection.js.map +1 -0
- package/out/routes.d.ts +93 -0
- package/out/routes.d.ts.map +1 -0
- package/out/routes.js +429 -0
- package/out/routes.js.map +1 -0
- package/out/schema.d.ts +267 -0
- package/out/schema.d.ts.map +1 -0
- package/out/schema.js +241 -0
- package/out/schema.js.map +1 -0
- package/package.json +98 -3
package/out/schema.d.ts
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas, media types and conformance class URIs for the OGC API surface.
|
|
3
|
+
*
|
|
4
|
+
* The shapes follow the `landingPage`, `confClasses` and `link` schemas of OGC
|
|
5
|
+
* API Common Part 1 (OGC 19-072), and the `collections` and `collectionDesc`
|
|
6
|
+
* schemas of OGC API Common Part 2 (OGC 20-024).
|
|
7
|
+
* The `/search` response follows PDOK's Location API, for which OGC publishes no schema.
|
|
8
|
+
*
|
|
9
|
+
* Each schema is registered as a component, so the API definition references it by name.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "@hono/zod-openapi";
|
|
12
|
+
/**
|
|
13
|
+
* The media types this surface serves, keyed by their role.
|
|
14
|
+
*/
|
|
15
|
+
export declare const OGCMediaType: {
|
|
16
|
+
readonly JSON: "application/json";
|
|
17
|
+
readonly GeoJSON: "application/geo+json";
|
|
18
|
+
readonly HTML: "text/html";
|
|
19
|
+
readonly OpenAPI30: "application/vnd.oai.openapi+json;version=3.0";
|
|
20
|
+
};
|
|
21
|
+
export type OGCMediaType = (typeof OGCMediaType)[keyof typeof OGCMediaType];
|
|
22
|
+
/**
|
|
23
|
+
* The values the `f` query parameter accepts on every resource.
|
|
24
|
+
*/
|
|
25
|
+
export declare const OGCFormat: {
|
|
26
|
+
readonly JSON: "json";
|
|
27
|
+
readonly HTML: "html";
|
|
28
|
+
};
|
|
29
|
+
export type OGCFormat = (typeof OGCFormat)[keyof typeof OGCFormat];
|
|
30
|
+
/**
|
|
31
|
+
* The link relations the landing page emits.
|
|
32
|
+
*
|
|
33
|
+
* OGC API Common identifies the conformance relation by URI.
|
|
34
|
+
* PDOK's Location API emits both the URI and the short name, and the landing page does the same.
|
|
35
|
+
*/
|
|
36
|
+
export declare const OGCLinkRelation: {
|
|
37
|
+
readonly Self: "self";
|
|
38
|
+
readonly Alternate: "alternate";
|
|
39
|
+
readonly ServiceDesc: "service-desc";
|
|
40
|
+
readonly ServiceDoc: "service-doc";
|
|
41
|
+
readonly Conformance: "conformance";
|
|
42
|
+
readonly OGCConformance: "http://www.opengis.net/def/rel/ogc/1.0/conformance";
|
|
43
|
+
readonly Data: "data";
|
|
44
|
+
readonly OGCData: "http://www.opengis.net/def/rel/ogc/1.0/data";
|
|
45
|
+
readonly Search: "search";
|
|
46
|
+
};
|
|
47
|
+
export type OGCLinkRelation = (typeof OGCLinkRelation)[keyof typeof OGCLinkRelation];
|
|
48
|
+
/**
|
|
49
|
+
* The OGC API conformance classes this surface implements.
|
|
50
|
+
*
|
|
51
|
+
* Each one is declared only because a route serves what its requirements ask for:
|
|
52
|
+
*
|
|
53
|
+
* - `core`: HTTP 1.1, and a 400 for an unknown query parameter or an invalid `f` value.
|
|
54
|
+
* - `landing-page`: `GET /` with API definition and conformance links, `GET /conformance`, `GET /api`.
|
|
55
|
+
* - `json`: the landing page, conformance declaration and collections as `application/json`.
|
|
56
|
+
* - `html`: the same resources as HTML5 carrying every link as an `<a>`.
|
|
57
|
+
* - `oas30`: an OpenAPI 3.0 document as `service-desc` and its HTML form as `service-doc`.
|
|
58
|
+
* - `collections` (Common Part 2): `GET /collections` linked from the landing page as `data`,
|
|
59
|
+
* `GET /collections/{collectionId}` for every listed id, each with `self` and `alternate` links.
|
|
60
|
+
*/
|
|
61
|
+
export declare const OGCConformanceClass: {
|
|
62
|
+
readonly Core: "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/core";
|
|
63
|
+
readonly LandingPage: "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/landing-page";
|
|
64
|
+
readonly JSON: "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/json";
|
|
65
|
+
readonly HTML: "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/html";
|
|
66
|
+
readonly OAS30: "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf/oas30";
|
|
67
|
+
readonly Collections: "http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/collections";
|
|
68
|
+
};
|
|
69
|
+
export type OGCConformanceClass = (typeof OGCConformanceClass)[keyof typeof OGCConformanceClass];
|
|
70
|
+
/**
|
|
71
|
+
* A link object from OGC API Common's `link.yaml`.
|
|
72
|
+
*/
|
|
73
|
+
export declare const OGCLinkSchema: z.ZodObject<{
|
|
74
|
+
href: z.ZodString;
|
|
75
|
+
rel: z.ZodString;
|
|
76
|
+
type: z.ZodOptional<z.ZodString>;
|
|
77
|
+
title: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type OGCLink = z.infer<typeof OGCLinkSchema>;
|
|
80
|
+
/**
|
|
81
|
+
* The landing page from OGC API Common's `landingPage.yaml`.
|
|
82
|
+
*/
|
|
83
|
+
export declare const OGCLandingPageSchema: z.ZodObject<{
|
|
84
|
+
title: z.ZodString;
|
|
85
|
+
description: z.ZodString;
|
|
86
|
+
links: z.ZodArray<z.ZodObject<{
|
|
87
|
+
href: z.ZodString;
|
|
88
|
+
rel: z.ZodString;
|
|
89
|
+
type: z.ZodOptional<z.ZodString>;
|
|
90
|
+
title: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
export type OGCLandingPage = z.infer<typeof OGCLandingPageSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* The conformance declaration from OGC API Common's `confClasses.yaml`.
|
|
96
|
+
*/
|
|
97
|
+
export declare const OGCConformanceSchema: z.ZodObject<{
|
|
98
|
+
conformsTo: z.ZodArray<z.ZodString>;
|
|
99
|
+
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
|
+
href: z.ZodString;
|
|
101
|
+
rel: z.ZodString;
|
|
102
|
+
type: z.ZodOptional<z.ZodString>;
|
|
103
|
+
title: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
export type OGCConformance = z.infer<typeof OGCConformanceSchema>;
|
|
107
|
+
/**
|
|
108
|
+
* The query every resource accepts.
|
|
109
|
+
*
|
|
110
|
+
* The object is strict because OGC API Common's core class answers 400 to a query
|
|
111
|
+
* parameter the API definition doesn't name.
|
|
112
|
+
*/
|
|
113
|
+
export declare const OGCFormatQuerySchema: z.ZodObject<{
|
|
114
|
+
f: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
html: "html";
|
|
116
|
+
json: "json";
|
|
117
|
+
}>>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
/**
|
|
120
|
+
* One collection description, from OGC API Common Part 2's `collectionDesc.yaml`.
|
|
121
|
+
*
|
|
122
|
+
* `id` and `links` are the two members the schema requires.
|
|
123
|
+
* `itemType` is left out because it describes a `/collections/{collectionId}/items`
|
|
124
|
+
* route this surface doesn't serve.
|
|
125
|
+
*/
|
|
126
|
+
export declare const OGCCollectionSchema: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
title: z.ZodString;
|
|
129
|
+
description: z.ZodString;
|
|
130
|
+
links: z.ZodArray<z.ZodObject<{
|
|
131
|
+
href: z.ZodString;
|
|
132
|
+
rel: z.ZodString;
|
|
133
|
+
type: z.ZodOptional<z.ZodString>;
|
|
134
|
+
title: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
geometryDimension: z.ZodLiteral<0>;
|
|
137
|
+
version: z.ZodNumber;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
export type OGCCollection = z.infer<typeof OGCCollectionSchema>;
|
|
140
|
+
/**
|
|
141
|
+
* The collections list, from OGC API Common Part 2's `collections.yaml`.
|
|
142
|
+
*/
|
|
143
|
+
export declare const OGCCollectionsSchema: z.ZodObject<{
|
|
144
|
+
links: z.ZodArray<z.ZodObject<{
|
|
145
|
+
href: z.ZodString;
|
|
146
|
+
rel: z.ZodString;
|
|
147
|
+
type: z.ZodOptional<z.ZodString>;
|
|
148
|
+
title: z.ZodOptional<z.ZodString>;
|
|
149
|
+
}, z.core.$strip>>;
|
|
150
|
+
collections: z.ZodArray<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
description: z.ZodString;
|
|
154
|
+
links: z.ZodArray<z.ZodObject<{
|
|
155
|
+
href: z.ZodString;
|
|
156
|
+
rel: z.ZodString;
|
|
157
|
+
type: z.ZodOptional<z.ZodString>;
|
|
158
|
+
title: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
geometryDimension: z.ZodLiteral<0>;
|
|
161
|
+
version: z.ZodNumber;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
export type OGCCollections = z.infer<typeof OGCCollectionsSchema>;
|
|
165
|
+
/**
|
|
166
|
+
* The path parameter of `/collections/{collectionId}`.
|
|
167
|
+
*/
|
|
168
|
+
export declare const OGCCollectionPathSchema: z.ZodObject<{
|
|
169
|
+
collectionId: z.ZodString;
|
|
170
|
+
}, z.core.$strip>;
|
|
171
|
+
/**
|
|
172
|
+
* The properties of one `/search` feature.
|
|
173
|
+
*/
|
|
174
|
+
export declare const OGCSearchPropertiesSchema: z.ZodObject<{
|
|
175
|
+
display_name: z.ZodString;
|
|
176
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
177
|
+
score_unmeasured: z.ZodOptional<z.ZodString>;
|
|
178
|
+
collection_id: z.ZodString;
|
|
179
|
+
place_id: z.ZodOptional<z.ZodString>;
|
|
180
|
+
placetype: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export type OGCSearchProperties = z.infer<typeof OGCSearchPropertiesSchema>;
|
|
183
|
+
/**
|
|
184
|
+
* One `/search` feature, a GeoJSON point.
|
|
185
|
+
*/
|
|
186
|
+
export declare const OGCSearchFeatureSchema: z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"Feature">;
|
|
188
|
+
geometry: z.ZodObject<{
|
|
189
|
+
type: z.ZodLiteral<"Point">;
|
|
190
|
+
coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
properties: z.ZodObject<{
|
|
193
|
+
display_name: z.ZodString;
|
|
194
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
195
|
+
score_unmeasured: z.ZodOptional<z.ZodString>;
|
|
196
|
+
collection_id: z.ZodString;
|
|
197
|
+
place_id: z.ZodOptional<z.ZodString>;
|
|
198
|
+
placetype: z.ZodOptional<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>;
|
|
200
|
+
}, z.core.$strip>;
|
|
201
|
+
export type OGCSearchFeature = z.infer<typeof OGCSearchFeatureSchema>;
|
|
202
|
+
/**
|
|
203
|
+
* The `/search` response: a GeoJSON FeatureCollection with the members PDOK's Location API adds.
|
|
204
|
+
*/
|
|
205
|
+
export declare const OGCSearchResponseSchema: z.ZodObject<{
|
|
206
|
+
type: z.ZodLiteral<"FeatureCollection">;
|
|
207
|
+
features: z.ZodArray<z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"Feature">;
|
|
209
|
+
geometry: z.ZodObject<{
|
|
210
|
+
type: z.ZodLiteral<"Point">;
|
|
211
|
+
coordinates: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
212
|
+
}, z.core.$strip>;
|
|
213
|
+
properties: z.ZodObject<{
|
|
214
|
+
display_name: z.ZodString;
|
|
215
|
+
score: z.ZodNullable<z.ZodNumber>;
|
|
216
|
+
score_unmeasured: z.ZodOptional<z.ZodString>;
|
|
217
|
+
collection_id: z.ZodString;
|
|
218
|
+
place_id: z.ZodOptional<z.ZodString>;
|
|
219
|
+
placetype: z.ZodOptional<z.ZodString>;
|
|
220
|
+
}, z.core.$strip>;
|
|
221
|
+
}, z.core.$strip>>;
|
|
222
|
+
timeStamp: z.ZodString;
|
|
223
|
+
links: z.ZodArray<z.ZodObject<{
|
|
224
|
+
href: z.ZodString;
|
|
225
|
+
rel: z.ZodString;
|
|
226
|
+
type: z.ZodOptional<z.ZodString>;
|
|
227
|
+
title: z.ZodOptional<z.ZodString>;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
numberReturned: z.ZodNumber;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
export type OGCSearchResponse = z.infer<typeof OGCSearchResponseSchema>;
|
|
232
|
+
/**
|
|
233
|
+
* The query name that selects a collection for `/search`, in PDOK's form, such as `addresses[version]`.
|
|
234
|
+
*/
|
|
235
|
+
export declare function collectionVersionParameter(collectionID: string): string;
|
|
236
|
+
/**
|
|
237
|
+
* The query name that weights a collection for `/search`, in PDOK's form, such as `addresses[relevance]`.
|
|
238
|
+
*/
|
|
239
|
+
export declare function collectionRelevanceParameter(collectionID: string): string;
|
|
240
|
+
/**
|
|
241
|
+
* The number of `/search` features returned when the request omits `limit`.
|
|
242
|
+
*/
|
|
243
|
+
export declare const OGC_SEARCH_DEFAULT_LIMIT = 10;
|
|
244
|
+
/**
|
|
245
|
+
* The largest `limit` `/search` accepts.
|
|
246
|
+
*/
|
|
247
|
+
export declare const OGC_SEARCH_MAX_LIMIT = 50;
|
|
248
|
+
/**
|
|
249
|
+
* The version every collection reports, and the only value `<collectionId>[version]` accepts.
|
|
250
|
+
*/
|
|
251
|
+
export declare const OGC_COLLECTION_VERSION = 1;
|
|
252
|
+
/**
|
|
253
|
+
* The `/search` query for a service whose collections are `collectionIDs`.
|
|
254
|
+
*
|
|
255
|
+
* The object is strict, as on every resource, and declares each collection's two parameters.
|
|
256
|
+
* A parameter for a collection the service doesn't hold is therefore unknown and answers 400.
|
|
257
|
+
*/
|
|
258
|
+
export declare function searchQuerySchema(collectionIDs: readonly string[]): z.ZodObject<{
|
|
259
|
+
q: z.ZodOptional<z.ZodString>;
|
|
260
|
+
limit: z.ZodOptional<z.ZodString>;
|
|
261
|
+
bbox: z.ZodOptional<z.ZodString>;
|
|
262
|
+
f: z.ZodOptional<z.ZodEnum<{
|
|
263
|
+
html: "html";
|
|
264
|
+
json: "json";
|
|
265
|
+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;;;;;;;;;;;;;;;;;iBAMN,CAAA;AAE9B,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,KAAK,CAAA;AAE1C;;GAEG;AACH,eAAO,MAAM,oBAAoB,KAAK,CAAA;AAEtC;;GAEG;AACH,eAAO,MAAM,sBAAsB,IAAI,CAAA;AAEvC;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE;;;;;;;;mBAkCjE"}
|
package/out/schema.js
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* Zod schemas, media types and conformance class URIs for the OGC API surface.
|
|
5
|
+
*
|
|
6
|
+
* The shapes follow the `landingPage`, `confClasses` and `link` schemas of OGC
|
|
7
|
+
* API Common Part 1 (OGC 19-072), and the `collections` and `collectionDesc`
|
|
8
|
+
* schemas of OGC API Common Part 2 (OGC 20-024).
|
|
9
|
+
* The `/search` response follows PDOK's Location API, for which OGC publishes no schema.
|
|
10
|
+
*
|
|
11
|
+
* Each schema is registered as a component, so the API definition references it by name.
|
|
12
|
+
*/
|
|
13
|
+
import { z } from "@hono/zod-openapi";
|
|
14
|
+
import { featureCollectionSchema, featureSchema } from "@mailwoman/api-kit";
|
|
15
|
+
/**
|
|
16
|
+
* The media types this surface serves, keyed by their role.
|
|
17
|
+
*/
|
|
18
|
+
export const OGCMediaType = {
|
|
19
|
+
JSON: "application/json",
|
|
20
|
+
GeoJSON: "application/geo+json",
|
|
21
|
+
HTML: "text/html",
|
|
22
|
+
OpenAPI30: "application/vnd.oai.openapi+json;version=3.0",
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The values the `f` query parameter accepts on every resource.
|
|
26
|
+
*/
|
|
27
|
+
export const OGCFormat = {
|
|
28
|
+
JSON: "json",
|
|
29
|
+
HTML: "html",
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The link relations the landing page emits.
|
|
33
|
+
*
|
|
34
|
+
* OGC API Common identifies the conformance relation by URI.
|
|
35
|
+
* PDOK's Location API emits both the URI and the short name, and the landing page does the same.
|
|
36
|
+
*/
|
|
37
|
+
export const OGCLinkRelation = {
|
|
38
|
+
Self: "self",
|
|
39
|
+
Alternate: "alternate",
|
|
40
|
+
ServiceDesc: "service-desc",
|
|
41
|
+
ServiceDoc: "service-doc",
|
|
42
|
+
Conformance: "conformance",
|
|
43
|
+
OGCConformance: "http://www.opengis.net/def/rel/ogc/1.0/conformance",
|
|
44
|
+
Data: "data",
|
|
45
|
+
OGCData: "http://www.opengis.net/def/rel/ogc/1.0/data",
|
|
46
|
+
Search: "search",
|
|
47
|
+
};
|
|
48
|
+
const COMMON_PART_1 = "http://www.opengis.net/spec/ogcapi-common-1/1.0/conf";
|
|
49
|
+
const COMMON_PART_2 = "http://www.opengis.net/spec/ogcapi-common-2/1.0/conf";
|
|
50
|
+
/**
|
|
51
|
+
* The OGC API conformance classes this surface implements.
|
|
52
|
+
*
|
|
53
|
+
* Each one is declared only because a route serves what its requirements ask for:
|
|
54
|
+
*
|
|
55
|
+
* - `core`: HTTP 1.1, and a 400 for an unknown query parameter or an invalid `f` value.
|
|
56
|
+
* - `landing-page`: `GET /` with API definition and conformance links, `GET /conformance`, `GET /api`.
|
|
57
|
+
* - `json`: the landing page, conformance declaration and collections as `application/json`.
|
|
58
|
+
* - `html`: the same resources as HTML5 carrying every link as an `<a>`.
|
|
59
|
+
* - `oas30`: an OpenAPI 3.0 document as `service-desc` and its HTML form as `service-doc`.
|
|
60
|
+
* - `collections` (Common Part 2): `GET /collections` linked from the landing page as `data`,
|
|
61
|
+
* `GET /collections/{collectionId}` for every listed id, each with `self` and `alternate` links.
|
|
62
|
+
*/
|
|
63
|
+
export const OGCConformanceClass = {
|
|
64
|
+
Core: `${COMMON_PART_1}/core`,
|
|
65
|
+
LandingPage: `${COMMON_PART_1}/landing-page`,
|
|
66
|
+
JSON: `${COMMON_PART_1}/json`,
|
|
67
|
+
HTML: `${COMMON_PART_1}/html`,
|
|
68
|
+
OAS30: `${COMMON_PART_1}/oas30`,
|
|
69
|
+
Collections: `${COMMON_PART_2}/collections`,
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A link object from OGC API Common's `link.yaml`.
|
|
73
|
+
*/
|
|
74
|
+
export const OGCLinkSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
href: z.string(),
|
|
77
|
+
rel: z.string(),
|
|
78
|
+
type: z.string().optional(),
|
|
79
|
+
title: z.string().optional(),
|
|
80
|
+
})
|
|
81
|
+
.openapi("OGCLink");
|
|
82
|
+
/**
|
|
83
|
+
* The landing page from OGC API Common's `landingPage.yaml`.
|
|
84
|
+
*/
|
|
85
|
+
export const OGCLandingPageSchema = z
|
|
86
|
+
.object({
|
|
87
|
+
title: z.string(),
|
|
88
|
+
description: z.string(),
|
|
89
|
+
links: z.array(OGCLinkSchema),
|
|
90
|
+
})
|
|
91
|
+
.openapi("OGCLandingPage");
|
|
92
|
+
/**
|
|
93
|
+
* The conformance declaration from OGC API Common's `confClasses.yaml`.
|
|
94
|
+
*/
|
|
95
|
+
export const OGCConformanceSchema = z
|
|
96
|
+
.object({
|
|
97
|
+
conformsTo: z.array(z.string()),
|
|
98
|
+
links: z.array(OGCLinkSchema).optional(),
|
|
99
|
+
})
|
|
100
|
+
.openapi("OGCConformance");
|
|
101
|
+
const formatParameter = z.enum([OGCFormat.JSON, OGCFormat.HTML]).optional().openapi({
|
|
102
|
+
description: "The response encoding. Without it the `Accept` header decides, and JSON is the default.",
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* The query every resource accepts.
|
|
106
|
+
*
|
|
107
|
+
* The object is strict because OGC API Common's core class answers 400 to a query
|
|
108
|
+
* parameter the API definition doesn't name.
|
|
109
|
+
*/
|
|
110
|
+
export const OGCFormatQuerySchema = z.object({ f: formatParameter }).strict();
|
|
111
|
+
/**
|
|
112
|
+
* One collection description, from OGC API Common Part 2's `collectionDesc.yaml`.
|
|
113
|
+
*
|
|
114
|
+
* `id` and `links` are the two members the schema requires.
|
|
115
|
+
* `itemType` is left out because it describes a `/collections/{collectionId}/items`
|
|
116
|
+
* route this surface doesn't serve.
|
|
117
|
+
*/
|
|
118
|
+
export const OGCCollectionSchema = z
|
|
119
|
+
.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
title: z.string(),
|
|
122
|
+
description: z.string(),
|
|
123
|
+
links: z.array(OGCLinkSchema),
|
|
124
|
+
geometryDimension: z.literal(0).openapi({ description: "Every feature in the collection is a point." }),
|
|
125
|
+
version: z.number().int().openapi({
|
|
126
|
+
description: "The collection version, the value `/search` takes in `<collectionId>[version]`, as on PDOK.",
|
|
127
|
+
}),
|
|
128
|
+
})
|
|
129
|
+
.openapi("OGCCollection");
|
|
130
|
+
/**
|
|
131
|
+
* The collections list, from OGC API Common Part 2's `collections.yaml`.
|
|
132
|
+
*/
|
|
133
|
+
export const OGCCollectionsSchema = z
|
|
134
|
+
.object({
|
|
135
|
+
links: z.array(OGCLinkSchema),
|
|
136
|
+
collections: z.array(OGCCollectionSchema),
|
|
137
|
+
})
|
|
138
|
+
.openapi("OGCCollections");
|
|
139
|
+
/**
|
|
140
|
+
* The path parameter of `/collections/{collectionId}`.
|
|
141
|
+
*/
|
|
142
|
+
export const OGCCollectionPathSchema = z.object({
|
|
143
|
+
collectionId: z.string().openapi({ param: { name: "collectionId", in: "path" }, example: "addresses" }),
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* The properties of one `/search` feature.
|
|
147
|
+
*/
|
|
148
|
+
export const OGCSearchPropertiesSchema = z
|
|
149
|
+
.object({
|
|
150
|
+
display_name: z.string().openapi({ description: "A one-line label for the matched place or address." }),
|
|
151
|
+
score: z.number().nullable().openapi({
|
|
152
|
+
description: "The engine's ranking score for the match, larger ranking higher. Scores compare candidates for one part of the input and have no unit across collections. Null when the engine measured none.",
|
|
153
|
+
}),
|
|
154
|
+
score_unmeasured: z.string().optional().openapi({
|
|
155
|
+
description: "Why `score` is null. Absent when `score` holds a value.",
|
|
156
|
+
}),
|
|
157
|
+
collection_id: z.string().openapi({ description: "The collection the feature belongs to." }),
|
|
158
|
+
place_id: z.string().optional().openapi({
|
|
159
|
+
description: "The gazetteer place ID of a place or postcode, such as `wof:85975673`. Absent for an address, a street, a plus code, or a place the gazetteer gave no ID.",
|
|
160
|
+
}),
|
|
161
|
+
placetype: z.string().optional().openapi({
|
|
162
|
+
description: "The gazetteer placetype of a place or postcode, such as `locality`, `localadmin` or `postalcode`. Absent for an address, a street or a plus code.",
|
|
163
|
+
}),
|
|
164
|
+
})
|
|
165
|
+
.openapi("OGCSearchProperties");
|
|
166
|
+
/**
|
|
167
|
+
* One `/search` feature, a GeoJSON point.
|
|
168
|
+
*/
|
|
169
|
+
export const OGCSearchFeatureSchema = featureSchema(OGCSearchPropertiesSchema).openapi("OGCSearchFeature");
|
|
170
|
+
/**
|
|
171
|
+
* The `/search` response: a GeoJSON FeatureCollection with the members PDOK's Location API adds.
|
|
172
|
+
*/
|
|
173
|
+
export const OGCSearchResponseSchema = featureCollectionSchema(OGCSearchFeatureSchema)
|
|
174
|
+
.extend({
|
|
175
|
+
timeStamp: z.string().openapi({ description: "When the response was generated, as an RFC 3339 UTC timestamp." }),
|
|
176
|
+
links: z.array(OGCLinkSchema),
|
|
177
|
+
numberReturned: z.number().int(),
|
|
178
|
+
})
|
|
179
|
+
.openapi("OGCSearchResponse");
|
|
180
|
+
/**
|
|
181
|
+
* The query name that selects a collection for `/search`, in PDOK's form, such as `addresses[version]`.
|
|
182
|
+
*/
|
|
183
|
+
export function collectionVersionParameter(collectionID) {
|
|
184
|
+
return `${collectionID}[version]`;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* The query name that weights a collection for `/search`, in PDOK's form, such as `addresses[relevance]`.
|
|
188
|
+
*/
|
|
189
|
+
export function collectionRelevanceParameter(collectionID) {
|
|
190
|
+
return `${collectionID}[relevance]`;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* The number of `/search` features returned when the request omits `limit`.
|
|
194
|
+
*/
|
|
195
|
+
export const OGC_SEARCH_DEFAULT_LIMIT = 10;
|
|
196
|
+
/**
|
|
197
|
+
* The largest `limit` `/search` accepts.
|
|
198
|
+
*/
|
|
199
|
+
export const OGC_SEARCH_MAX_LIMIT = 50;
|
|
200
|
+
/**
|
|
201
|
+
* The version every collection reports, and the only value `<collectionId>[version]` accepts.
|
|
202
|
+
*/
|
|
203
|
+
export const OGC_COLLECTION_VERSION = 1;
|
|
204
|
+
/**
|
|
205
|
+
* The `/search` query for a service whose collections are `collectionIDs`.
|
|
206
|
+
*
|
|
207
|
+
* The object is strict, as on every resource, and declares each collection's two parameters.
|
|
208
|
+
* A parameter for a collection the service doesn't hold is therefore unknown and answers 400.
|
|
209
|
+
*/
|
|
210
|
+
export function searchQuerySchema(collectionIDs) {
|
|
211
|
+
const perCollection = {};
|
|
212
|
+
for (const id of collectionIDs) {
|
|
213
|
+
perCollection[collectionVersionParameter(id)] = z
|
|
214
|
+
.string()
|
|
215
|
+
.optional()
|
|
216
|
+
.openapi({
|
|
217
|
+
description: `Restrict the search to the \`${id}\` collection, with any other collection named the same way. The value is the collection version, \`${OGC_COLLECTION_VERSION}\`.`,
|
|
218
|
+
});
|
|
219
|
+
perCollection[collectionRelevanceParameter(id)] = z.string().optional().openapi({
|
|
220
|
+
description: `A number from 0 to 1, accepted for PDOK clients. It doesn't change the ranking, because the engine's scores don't compare across collections.`,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
return z
|
|
224
|
+
.object({
|
|
225
|
+
q: z.string().optional().openapi({ description: "The address or place to search for. Required." }),
|
|
226
|
+
limit: z
|
|
227
|
+
.string()
|
|
228
|
+
.optional()
|
|
229
|
+
.openapi({
|
|
230
|
+
type: "integer",
|
|
231
|
+
description: `The most features to return, from 1 to ${OGC_SEARCH_MAX_LIMIT}. The default is ${OGC_SEARCH_DEFAULT_LIMIT}.`,
|
|
232
|
+
}),
|
|
233
|
+
bbox: z.string().optional().openapi({
|
|
234
|
+
description: "Keep only features inside the box `minLon,minLat,maxLon,maxLat`, in WGS 84 longitude and latitude.",
|
|
235
|
+
}),
|
|
236
|
+
f: formatParameter,
|
|
237
|
+
...perCollection,
|
|
238
|
+
})
|
|
239
|
+
.strict();
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../lib/schema.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAA;AACrC,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAE3E;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,8CAA8C;CAChD,CAAA;AAIV;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACxB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;CACH,CAAA;AAIV;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,cAAc;IAC3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AC;IAED,OAAO,CAAC;SACN,MAAM,CAAC;QACP,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,CAAC;QAClG,KAAK,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,OAAO,CAAC;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0CAA0C,oBAAoB,oBAAoB,wBAAwB,GAAG;SAC1H,CAAC;QACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;YACnC,WAAW,EACV,oGAAoG;SACrG,CAAC;QACF,CAAC,EAAE,eAAe;QAClB,GAAG,aAAa;KAChB,CAAC;SACD,MAAM,EAAE,CAAA;AACX,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/ogc",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "11.2.0",
|
|
4
|
+
"description": "OGC API adapter for the Mailwoman engine. Serves the OGC API Common landing page, conformance declaration, API definition and collections, and forward geocoding at /search in the form of PDOK's Location API. Run it with `npx @mailwoman/ogc serve`.",
|
|
5
|
+
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/sister-software/mailwoman.git",
|
|
9
|
+
"directory": "packages/ogc"
|
|
10
|
+
},
|
|
11
|
+
"bin": "./out/cli/main.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"out/**/*.js",
|
|
14
|
+
"out/**/*.js.map",
|
|
15
|
+
"out/**/*.d.ts",
|
|
16
|
+
"out/**/*.d.ts.map",
|
|
17
|
+
"README.md",
|
|
18
|
+
"lib/**/*.ts",
|
|
19
|
+
"lib/**/*.tsx",
|
|
20
|
+
"cli/**/*.ts",
|
|
21
|
+
"!**/*.test.ts",
|
|
22
|
+
"!**/*.test.tsx"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"imports": {
|
|
26
|
+
"#cli/*": {
|
|
27
|
+
"types": "./out/cli/*.d.ts",
|
|
28
|
+
"node": "./out/cli/*.js",
|
|
29
|
+
"default": "./out/cli/*.js"
|
|
30
|
+
},
|
|
31
|
+
"#*": {
|
|
32
|
+
"types": "./out/*.d.ts",
|
|
33
|
+
"node": "./out/*.js",
|
|
34
|
+
"default": "./out/*.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"exports": {
|
|
38
|
+
"./package.json": "./package.json",
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./out/index.d.ts",
|
|
41
|
+
"node": "./out/index.js",
|
|
42
|
+
"default": "./out/index.js"
|
|
43
|
+
},
|
|
44
|
+
"./cli/*": {
|
|
45
|
+
"types": "./out/cli/*.d.ts",
|
|
46
|
+
"node": "./out/cli/*.js",
|
|
47
|
+
"default": "./out/cli/*.js"
|
|
48
|
+
},
|
|
49
|
+
"./*": {
|
|
50
|
+
"types": "./out/*.d.ts",
|
|
51
|
+
"node": "./out/*.js",
|
|
52
|
+
"default": "./out/*.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public",
|
|
57
|
+
"exports": {
|
|
58
|
+
"./package.json": "./package.json",
|
|
59
|
+
".": {
|
|
60
|
+
"types": "./out/index.d.ts",
|
|
61
|
+
"node": "./out/index.js",
|
|
62
|
+
"default": "./out/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./cli/*": {
|
|
65
|
+
"types": "./out/cli/*.d.ts",
|
|
66
|
+
"node": "./out/cli/*.js",
|
|
67
|
+
"default": "./out/cli/*.js"
|
|
68
|
+
},
|
|
69
|
+
"./*": {
|
|
70
|
+
"types": "./out/*.d.ts",
|
|
71
|
+
"node": "./out/*.js",
|
|
72
|
+
"default": "./out/*.js"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"imports": {
|
|
76
|
+
"#cli/*": {
|
|
77
|
+
"types": "./out/cli/*.d.ts",
|
|
78
|
+
"node": "./out/cli/*.js",
|
|
79
|
+
"default": "./out/cli/*.js"
|
|
80
|
+
},
|
|
81
|
+
"#*": {
|
|
82
|
+
"types": "./out/*.d.ts",
|
|
83
|
+
"node": "./out/*.js",
|
|
84
|
+
"default": "./out/*.js"
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"@hono/zod-openapi": "^1.6.3",
|
|
90
|
+
"@mailwoman/api": "11.2.0",
|
|
91
|
+
"@mailwoman/api-kit": "11.2.0",
|
|
92
|
+
"@mailwoman/codex": "11.2.0",
|
|
93
|
+
"@mailwoman/core": "11.2.0",
|
|
94
|
+
"@mailwoman/resolver": "11.2.0",
|
|
95
|
+
"@mailwoman/resolver-wof-sqlite": "11.2.0",
|
|
96
|
+
"@mailwoman/spatial": "11.2.0",
|
|
97
|
+
"hono": "^4.13.14",
|
|
98
|
+
"mailwoman": "11.2.0",
|
|
99
|
+
"zod": "^4.6.7"
|
|
100
|
+
}
|
|
6
101
|
}
|