@seta-labs/geo 0.8.0 → 0.10.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/CHANGELOG.md +17 -0
- package/dist/index.d.ts +140 -1
- package/dist/index.js +4 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @seta-labs/geo
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
- `territory.perimetri({ lat, lng })`: the OMI zone and the municipality a point
|
|
6
|
+
falls into, each with its perimeter as a GeoJSON MultiPolygon (WGS84,
|
|
7
|
+
simplified to a couple of metres) ready to draw on a map. `zona` and `comune`
|
|
8
|
+
are null when the point is outside every perimeter. Requires Geo service
|
|
9
|
+
`0.14.0`.
|
|
10
|
+
|
|
11
|
+
## 0.9.0
|
|
12
|
+
|
|
13
|
+
- `territory.raggi(input)`: for each point and municipality (`codComune`), the
|
|
14
|
+
radius that covers the whole municipality from the point: the distance to
|
|
15
|
+
the farthest vertex of its ISTAT boundary, in metres rounded up, from the
|
|
16
|
+
latest edition that has it (a suppressed municipality keeps its last).
|
|
17
|
+
`edizione` and `raggioM` are null when no edition has the municipality. Up
|
|
18
|
+
to 100 points per call; `id` is echoed back.
|
|
19
|
+
|
|
3
20
|
## 0.8.0
|
|
4
21
|
|
|
5
22
|
- **Breaking:** `LookupCache` becomes `CachePolicy`, the cache options every
|
package/dist/index.d.ts
CHANGED
|
@@ -209,6 +209,22 @@ interface paths {
|
|
|
209
209
|
patch?: never;
|
|
210
210
|
trace?: never;
|
|
211
211
|
};
|
|
212
|
+
'/territory/perimetri': {
|
|
213
|
+
parameters: {
|
|
214
|
+
query?: never;
|
|
215
|
+
header?: never;
|
|
216
|
+
path?: never;
|
|
217
|
+
cookie?: never;
|
|
218
|
+
};
|
|
219
|
+
get: operations['TerritoryController_perimetri'];
|
|
220
|
+
put?: never;
|
|
221
|
+
post?: never;
|
|
222
|
+
delete?: never;
|
|
223
|
+
options?: never;
|
|
224
|
+
head?: never;
|
|
225
|
+
patch?: never;
|
|
226
|
+
trace?: never;
|
|
227
|
+
};
|
|
212
228
|
'/territory/resolve': {
|
|
213
229
|
parameters: {
|
|
214
230
|
query?: never;
|
|
@@ -225,6 +241,22 @@ interface paths {
|
|
|
225
241
|
patch?: never;
|
|
226
242
|
trace?: never;
|
|
227
243
|
};
|
|
244
|
+
'/territory/raggi': {
|
|
245
|
+
parameters: {
|
|
246
|
+
query?: never;
|
|
247
|
+
header?: never;
|
|
248
|
+
path?: never;
|
|
249
|
+
cookie?: never;
|
|
250
|
+
};
|
|
251
|
+
get?: never;
|
|
252
|
+
put?: never;
|
|
253
|
+
post: operations['TerritoryController_raggi'];
|
|
254
|
+
delete?: never;
|
|
255
|
+
options?: never;
|
|
256
|
+
head?: never;
|
|
257
|
+
patch?: never;
|
|
258
|
+
trace?: never;
|
|
259
|
+
};
|
|
228
260
|
'/cadastre/parcel': {
|
|
229
261
|
parameters: {
|
|
230
262
|
query?: never;
|
|
@@ -645,6 +677,21 @@ interface components {
|
|
|
645
677
|
zone: components['schemas']['TerritoryZonaQuotazioneDto'][];
|
|
646
678
|
compravendite: components['schemas']['TerritoryCompravenditaAnnoDto'][];
|
|
647
679
|
};
|
|
680
|
+
TerritoryPerimetroDto: {
|
|
681
|
+
codComune: string;
|
|
682
|
+
/** @description Null for a municipality. */
|
|
683
|
+
codZona: string | null;
|
|
684
|
+
/** @description Zone or municipality name. */
|
|
685
|
+
nome: string | null;
|
|
686
|
+
/** @description GeoJSON MultiPolygon in WGS84, simplified to a couple of metres. */
|
|
687
|
+
geometry: {
|
|
688
|
+
[key: string]: unknown;
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
TerritoryPerimetriDto: {
|
|
692
|
+
zona: components['schemas']['TerritoryPerimetroDto'] | null;
|
|
693
|
+
comune: components['schemas']['TerritoryPerimetroDto'] | null;
|
|
694
|
+
};
|
|
648
695
|
TerritoryPointDto: {
|
|
649
696
|
id: string;
|
|
650
697
|
lat: number;
|
|
@@ -674,6 +721,30 @@ interface components {
|
|
|
674
721
|
TerritoryResolveResponseDto: {
|
|
675
722
|
items: components['schemas']['TerritoryPointResultDto'][];
|
|
676
723
|
};
|
|
724
|
+
TerritoryRaggioPointDto: {
|
|
725
|
+
id: string;
|
|
726
|
+
/** @description Belfiore code of the municipality (e.g. `D969`). */
|
|
727
|
+
codComune: string;
|
|
728
|
+
lat: number;
|
|
729
|
+
lng: number;
|
|
730
|
+
};
|
|
731
|
+
TerritoryRaggiRequestDto: {
|
|
732
|
+
points: components['schemas']['TerritoryRaggioPointDto'][];
|
|
733
|
+
};
|
|
734
|
+
TerritoryRaggioDto: {
|
|
735
|
+
id: string;
|
|
736
|
+
codComune: string;
|
|
737
|
+
/**
|
|
738
|
+
* Format: date
|
|
739
|
+
* @description Boundary edition.
|
|
740
|
+
*/
|
|
741
|
+
edizione: string | null;
|
|
742
|
+
/** @description Metres, rounded up. */
|
|
743
|
+
raggioM: number | null;
|
|
744
|
+
};
|
|
745
|
+
TerritoryRaggiResponseDto: {
|
|
746
|
+
items: components['schemas']['TerritoryRaggioDto'][];
|
|
747
|
+
};
|
|
677
748
|
CadastreParcelRequestDto: {
|
|
678
749
|
lat: number;
|
|
679
750
|
lng: number;
|
|
@@ -1143,6 +1214,35 @@ interface operations {
|
|
|
1143
1214
|
};
|
|
1144
1215
|
};
|
|
1145
1216
|
};
|
|
1217
|
+
TerritoryController_perimetri: {
|
|
1218
|
+
parameters: {
|
|
1219
|
+
query: {
|
|
1220
|
+
lat: number;
|
|
1221
|
+
lng: number;
|
|
1222
|
+
};
|
|
1223
|
+
header?: never;
|
|
1224
|
+
path?: never;
|
|
1225
|
+
cookie?: never;
|
|
1226
|
+
};
|
|
1227
|
+
requestBody?: never;
|
|
1228
|
+
responses: {
|
|
1229
|
+
200: {
|
|
1230
|
+
headers: {
|
|
1231
|
+
[name: string]: unknown;
|
|
1232
|
+
};
|
|
1233
|
+
content: {
|
|
1234
|
+
'application/json': components['schemas']['TerritoryPerimetriDto'];
|
|
1235
|
+
};
|
|
1236
|
+
};
|
|
1237
|
+
/** @description Missing or invalid API key. */
|
|
1238
|
+
401: {
|
|
1239
|
+
headers: {
|
|
1240
|
+
[name: string]: unknown;
|
|
1241
|
+
};
|
|
1242
|
+
content?: never;
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
};
|
|
1146
1246
|
TerritoryController_resolve: {
|
|
1147
1247
|
parameters: {
|
|
1148
1248
|
query?: never;
|
|
@@ -1173,6 +1273,36 @@ interface operations {
|
|
|
1173
1273
|
};
|
|
1174
1274
|
};
|
|
1175
1275
|
};
|
|
1276
|
+
TerritoryController_raggi: {
|
|
1277
|
+
parameters: {
|
|
1278
|
+
query?: never;
|
|
1279
|
+
header?: never;
|
|
1280
|
+
path?: never;
|
|
1281
|
+
cookie?: never;
|
|
1282
|
+
};
|
|
1283
|
+
requestBody: {
|
|
1284
|
+
content: {
|
|
1285
|
+
'application/json': components['schemas']['TerritoryRaggiRequestDto'];
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
responses: {
|
|
1289
|
+
200: {
|
|
1290
|
+
headers: {
|
|
1291
|
+
[name: string]: unknown;
|
|
1292
|
+
};
|
|
1293
|
+
content: {
|
|
1294
|
+
'application/json': components['schemas']['TerritoryRaggiResponseDto'];
|
|
1295
|
+
};
|
|
1296
|
+
};
|
|
1297
|
+
/** @description Missing or invalid API key. */
|
|
1298
|
+
401: {
|
|
1299
|
+
headers: {
|
|
1300
|
+
[name: string]: unknown;
|
|
1301
|
+
};
|
|
1302
|
+
content?: never;
|
|
1303
|
+
};
|
|
1304
|
+
};
|
|
1305
|
+
};
|
|
1176
1306
|
CadastreController_parcel: {
|
|
1177
1307
|
parameters: {
|
|
1178
1308
|
query?: never;
|
|
@@ -1284,6 +1414,11 @@ type TerritoryStatus = ApiSchemas['TerritoryStatusDto'];
|
|
|
1284
1414
|
type TerritoryResolveRequest = ApiSchemas['TerritoryResolveRequestDto'];
|
|
1285
1415
|
type TerritoryResolveResponse = ApiSchemas['TerritoryResolveResponseDto'];
|
|
1286
1416
|
type TerritoryPointResult = ApiSchemas['TerritoryPointResultDto'];
|
|
1417
|
+
type TerritoryRaggiRequest = ApiSchemas['TerritoryRaggiRequestDto'];
|
|
1418
|
+
type TerritoryRaggiResponse = ApiSchemas['TerritoryRaggiResponseDto'];
|
|
1419
|
+
type TerritoryRaggio = ApiSchemas['TerritoryRaggioDto'];
|
|
1420
|
+
type TerritoryPerimetri = ApiSchemas['TerritoryPerimetriDto'];
|
|
1421
|
+
type TerritoryPerimetro = ApiSchemas['TerritoryPerimetroDto'];
|
|
1287
1422
|
type TerritoryOmi = ApiSchemas['TerritoryOmiDto'];
|
|
1288
1423
|
type TerritoryComune = ApiSchemas['TerritoryComuneDto'];
|
|
1289
1424
|
type TerritoryComuneDetail = ApiSchemas['TerritoryComuneDetailDto'];
|
|
@@ -1321,6 +1456,7 @@ interface PacingOptions {
|
|
|
1321
1456
|
retries?: number;
|
|
1322
1457
|
}
|
|
1323
1458
|
|
|
1459
|
+
type TerritoryPerimetriQuery = ApiPaths['/territory/perimetri']['get']['parameters']['query'];
|
|
1324
1460
|
type TerritoryComuniQuery = NonNullable<ApiPaths['/territory/comuni']['get']['parameters']['query']>;
|
|
1325
1461
|
type TerritoryQuotazioniQuery = NonNullable<ApiPaths['/territory/quotazioni']['get']['parameters']['query']>;
|
|
1326
1462
|
type TerritoryCompravenditeQuery = NonNullable<ApiPaths['/territory/compravendite']['get']['parameters']['query']>;
|
|
@@ -1355,7 +1491,10 @@ interface TerritoryClient {
|
|
|
1355
1491
|
quotazioni(query?: TerritoryQuotazioniQuery, options?: RequestOptions): Promise<TerritoryQuotazioniPage>;
|
|
1356
1492
|
compravendite(query?: TerritoryCompravenditeQuery, options?: RequestOptions): Promise<TerritoryCompravenditePage>;
|
|
1357
1493
|
comune(codComune: string, options?: RequestOptions): Promise<TerritoryComuneDetail>;
|
|
1494
|
+
/** The OMI zone and the municipality a point falls into, each with its GeoJSON perimeter. */
|
|
1495
|
+
perimetri(query: TerritoryPerimetriQuery, options?: RequestOptions): Promise<TerritoryPerimetri>;
|
|
1358
1496
|
resolve(input: TerritoryResolveRequest, options?: RequestOptions): Promise<TerritoryResolveResponse>;
|
|
1497
|
+
raggi(input: TerritoryRaggiRequest, options?: RequestOptions): Promise<TerritoryRaggiResponse>;
|
|
1359
1498
|
}
|
|
1360
1499
|
interface GeoClient {
|
|
1361
1500
|
geocode(input: GeocodeRequest, options?: LookupOptions): Promise<GeocodeResult>;
|
|
@@ -1372,4 +1511,4 @@ interface GeoClient {
|
|
|
1372
1511
|
declare function createGeoClient(options: GeoClientOptions): GeoClient;
|
|
1373
1512
|
|
|
1374
1513
|
export { ApiError, createGeoClient };
|
|
1375
|
-
export type { CachePolicy, CadastreParcelRequest, CadastreParcelResult, CadastreParcelRow, CadastreParcelsPage, CadastreParcelsQuery, GeoAdminArea, GeoClient, GeoClientOptions, GeoStreetMatch, GeocodeBatchRequest, GeocodeBatchResponse, GeocodeRequest, GeocodeResult, LookupOptions, PacingOptions, RequestOptions, ReverseGeocodeRequest, ReverseGeocodeResult, TerritoryClient, TerritoryCompravendita, TerritoryCompravenditePage, TerritoryCompravenditeQuery, TerritoryComune, TerritoryComuneDetail, TerritoryComuneRiga, TerritoryComuniPage, TerritoryComuniQuery, TerritoryDatasets, TerritoryOmi, TerritoryPointResult, TerritoryQuotazione, TerritoryQuotazioniPage, TerritoryQuotazioniQuery, TerritoryResolveRequest, TerritoryResolveResponse, TerritoryStatus, TerritoryTerritorio };
|
|
1514
|
+
export type { CachePolicy, CadastreParcelRequest, CadastreParcelResult, CadastreParcelRow, CadastreParcelsPage, CadastreParcelsQuery, GeoAdminArea, GeoClient, GeoClientOptions, GeoStreetMatch, GeocodeBatchRequest, GeocodeBatchResponse, GeocodeRequest, GeocodeResult, LookupOptions, PacingOptions, RequestOptions, ReverseGeocodeRequest, ReverseGeocodeResult, TerritoryClient, TerritoryCompravendita, TerritoryCompravenditePage, TerritoryCompravenditeQuery, TerritoryComune, TerritoryComuneDetail, TerritoryComuneRiga, TerritoryComuniPage, TerritoryComuniQuery, TerritoryDatasets, TerritoryOmi, TerritoryPerimetri, TerritoryPerimetriQuery, TerritoryPerimetro, TerritoryPointResult, TerritoryQuotazione, TerritoryQuotazioniPage, TerritoryQuotazioniQuery, TerritoryRaggiRequest, TerritoryRaggiResponse, TerritoryRaggio, TerritoryResolveRequest, TerritoryResolveResponse, TerritoryStatus, TerritoryTerritorio };
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ function codeOf(body) {
|
|
|
30
30
|
return typeof body.code === "string" ? body.code : void 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/.pnpm/@seta-labs+nestjs-cache-control@0.2.1_@nestjs+common@12.
|
|
33
|
+
// ../../node_modules/.pnpm/@seta-labs+nestjs-cache-control@0.2.1_@nestjs+common@12.4.0_class-transformer@0.5.1_cla_a761c97cc6bb49499ea6356a28f157db/node_modules/@seta-labs/nestjs-cache-control/dist/cache-policy.util.js
|
|
34
34
|
var MAX_DELTA_SECONDS = 2147483648;
|
|
35
35
|
function formatCacheControl(policy) {
|
|
36
36
|
if (!policy)
|
|
@@ -177,7 +177,9 @@ function territory(client) {
|
|
|
177
177
|
params: { path: { codComune } }
|
|
178
178
|
})
|
|
179
179
|
),
|
|
180
|
-
|
|
180
|
+
perimetri: (query, options) => data(client.GET("/territory/perimetri", { ...options, params: { query } })),
|
|
181
|
+
resolve: (input, options) => data(client.POST("/territory/resolve", { ...options, body: input })),
|
|
182
|
+
raggi: (input, options) => data(client.POST("/territory/raggi", { ...options, body: input }))
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
185
|
function createGeoClient(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seta-labs/geo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Typed Fetch client for the Seta Geo HTTP API",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@seta-geo/types": "workspace:*",
|
|
46
|
-
"@seta-labs/config": "^0.
|
|
46
|
+
"@seta-labs/config": "^0.18.0",
|
|
47
47
|
"@seta-labs/nestjs-cache-control": "0.2.1",
|
|
48
48
|
"tsup": "^9.0.0",
|
|
49
49
|
"typescript": "^6.0.3",
|
|
50
|
-
"vitest": "^5.0
|
|
50
|
+
"vitest": "^5.1.0"
|
|
51
51
|
}
|
|
52
52
|
}
|