@seta-labs/geo 0.1.0-next.1 → 0.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/CHANGELOG.md +15 -0
- package/README.md +19 -5
- package/dist/index.d.ts +96 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @seta-labs/geo
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- New `cadastreParcel({ lat, lng })` on `POST /cadastre/parcel`: what the AdE
|
|
6
|
+
cadastral map finds under a point (`tipologia`, the cadastral fields with
|
|
7
|
+
blanks cleared, the `raw` answer), served from the shared store when known.
|
|
8
|
+
A `503` with `code: 'CADASTRE_BLOCKED'` carries `Retry-After`.
|
|
9
|
+
- New type aliases `CadastreParcelRequest` and `CadastreParcelResult`.
|
|
10
|
+
|
|
11
|
+
## 0.1.0
|
|
12
|
+
|
|
13
|
+
- Promote the SDK from `0.1.0-next.1` to the ordinary `latest` npm channel.
|
|
14
|
+
The Geo 0.4.10 HTTP contract, public SDK interfaces and runtime behavior are unchanged.
|
|
15
|
+
- SDK releases publish only to npm. Consumers update their exact dependency
|
|
16
|
+
version and lockfile explicitly, then verify and release independently.
|
|
17
|
+
|
|
3
18
|
## 0.1.0-next.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ retain their own concurrency and retry policy.
|
|
|
49
49
|
| `geocode` | `GeocodeRequest` |
|
|
50
50
|
| `geocodeBatch` | `GeocodeBatchRequest` |
|
|
51
51
|
| `reverseGeocode` | `ReverseGeocodeRequest` |
|
|
52
|
+
| `cadastreParcel` | `CadastreParcelRequest` |
|
|
52
53
|
| `territory.status`, `territory.datasets` | options only |
|
|
53
54
|
| `territory.comuni` | optional `TerritoryComuniQuery` |
|
|
54
55
|
| `territory.quotazioni` | optional `TerritoryQuotazioniQuery` |
|
|
@@ -57,23 +58,36 @@ retain their own concurrency and retry policy.
|
|
|
57
58
|
| `territory.resolve` | `TerritoryResolveRequest` |
|
|
58
59
|
|
|
59
60
|
The package exports `createGeoClient`, `ApiError`, client/options interfaces,
|
|
60
|
-
query types and the generated geocode/territory request and response aliases.
|
|
61
|
+
query types and the generated geocode/cadastre/territory request and response aliases.
|
|
61
62
|
The three service health routes are intentionally outside this SDK surface.
|
|
62
63
|
OpenAPI remains authoritative: TypeScript provides static types, not runtime
|
|
63
64
|
validation of received data. `include` may be omitted and defaults to `best`
|
|
64
65
|
on the service.
|
|
65
66
|
|
|
66
67
|
HTTP errors are `ApiError`; their body is JSON when parseable, otherwise text,
|
|
67
|
-
or `undefined` for an empty response.
|
|
68
|
+
or `undefined` for an empty response. A `503` from `cadastreParcel` with
|
|
69
|
+
`code: 'CADASTRE_BLOCKED'` means the cadastral map is refusing calls: its
|
|
70
|
+
`Retry-After` header (and `retryAfterSeconds` in the body) says when to ask
|
|
71
|
+
again. Network failures, aborts and JSON parsing
|
|
68
72
|
errors retain their native types. Every Geo success operation requires a JSON
|
|
69
73
|
result: an unexpected empty/204 success raises `SyntaxError`. The SDK logs no
|
|
70
74
|
body, URL or credential automatically.
|
|
71
75
|
|
|
72
|
-
Versioning is independent from the service.
|
|
76
|
+
Versioning is independent from the service. SDK `0.1.0`
|
|
73
77
|
uses the HTTP contract of Geo service `0.4.10`. Declarations are bundled from the
|
|
74
78
|
repository's generated types; installing the SDK needs no private workspace
|
|
75
79
|
package. Distribution is public npm; the retained license is `UNLICENSED`.
|
|
76
80
|
|
|
77
81
|
The SDK remains on `0.x` until an explicit decision to graduate to `1.0`.
|
|
78
|
-
|
|
79
|
-
does not
|
|
82
|
+
Ordinary releases use the `latest` npm channel, without a prerelease suffix.
|
|
83
|
+
Publishing the SDK does not deploy Geo or update, merge or release any consumer.
|
|
84
|
+
|
|
85
|
+
Update explicitly from the consumer package directory:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
pnpm add @seta-labs/geo@latest --save-exact
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
`latest` selects the version at update time; the manifest records that exact
|
|
92
|
+
numeric version. Commit it together with the lockfile after the consumer's
|
|
93
|
+
checks pass, and release the consumer independently.
|
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,22 @@ interface paths {
|
|
|
111
111
|
patch?: never;
|
|
112
112
|
trace?: never;
|
|
113
113
|
};
|
|
114
|
+
'/cadastre/parcel': {
|
|
115
|
+
parameters: {
|
|
116
|
+
query?: never;
|
|
117
|
+
header?: never;
|
|
118
|
+
path?: never;
|
|
119
|
+
cookie?: never;
|
|
120
|
+
};
|
|
121
|
+
get?: never;
|
|
122
|
+
put?: never;
|
|
123
|
+
post: operations['CadastreController_parcel'];
|
|
124
|
+
delete?: never;
|
|
125
|
+
options?: never;
|
|
126
|
+
head?: never;
|
|
127
|
+
patch?: never;
|
|
128
|
+
trace?: never;
|
|
129
|
+
};
|
|
114
130
|
'/territory/status': {
|
|
115
131
|
parameters: {
|
|
116
132
|
query?: never;
|
|
@@ -390,6 +406,36 @@ interface components {
|
|
|
390
406
|
[key: string]: unknown;
|
|
391
407
|
}[] | null;
|
|
392
408
|
};
|
|
409
|
+
CadastreParcelRequestDto: {
|
|
410
|
+
lat: number;
|
|
411
|
+
lng: number;
|
|
412
|
+
};
|
|
413
|
+
CadastreParcelResultDto: {
|
|
414
|
+
/** @description Canonical cache key: "lat,lng" rounded to 5 decimals (~1 m). */
|
|
415
|
+
query: string;
|
|
416
|
+
/**
|
|
417
|
+
* @description What lies under the point, verbatim from the map: PARTICELLA, STRADA, …
|
|
418
|
+
* @example PARTICELLA
|
|
419
|
+
*/
|
|
420
|
+
tipologia: string;
|
|
421
|
+
/** @example B885 */
|
|
422
|
+
codComune: string | null;
|
|
423
|
+
/** @description Null when the map gives none: blanks and "null" strings are cleared. */
|
|
424
|
+
sezione: string | null;
|
|
425
|
+
/** @example 36 */
|
|
426
|
+
foglio: string | null;
|
|
427
|
+
/** @example G */
|
|
428
|
+
allegato: string | null;
|
|
429
|
+
sviluppo: string | null;
|
|
430
|
+
/** @example 5101 */
|
|
431
|
+
particella: string | null;
|
|
432
|
+
/** @description The map answer exactly as returned (blank SEZIONE and "null" strings included). */
|
|
433
|
+
raw: {
|
|
434
|
+
[key: string]: unknown;
|
|
435
|
+
};
|
|
436
|
+
/** @description True when the answer came from the cache, no map call. */
|
|
437
|
+
cached: boolean;
|
|
438
|
+
};
|
|
393
439
|
TerritoryStatusDto: {
|
|
394
440
|
/** @description Latest OMI publication loaded (`YYYY-S`), null while no supply is loaded. */
|
|
395
441
|
semestre: string | null;
|
|
@@ -714,6 +760,51 @@ interface operations {
|
|
|
714
760
|
};
|
|
715
761
|
};
|
|
716
762
|
};
|
|
763
|
+
CadastreController_parcel: {
|
|
764
|
+
parameters: {
|
|
765
|
+
query?: never;
|
|
766
|
+
header?: never;
|
|
767
|
+
path?: never;
|
|
768
|
+
cookie?: never;
|
|
769
|
+
};
|
|
770
|
+
requestBody: {
|
|
771
|
+
content: {
|
|
772
|
+
'application/json': components['schemas']['CadastreParcelRequestDto'];
|
|
773
|
+
};
|
|
774
|
+
};
|
|
775
|
+
responses: {
|
|
776
|
+
/** @description What the AdE cadastral map finds under the point: a parcel, a street, … */
|
|
777
|
+
200: {
|
|
778
|
+
headers: {
|
|
779
|
+
[name: string]: unknown;
|
|
780
|
+
};
|
|
781
|
+
content: {
|
|
782
|
+
'application/json': components['schemas']['CadastreParcelResultDto'];
|
|
783
|
+
};
|
|
784
|
+
};
|
|
785
|
+
/** @description Missing or invalid API key. */
|
|
786
|
+
401: {
|
|
787
|
+
headers: {
|
|
788
|
+
[name: string]: unknown;
|
|
789
|
+
};
|
|
790
|
+
content?: never;
|
|
791
|
+
};
|
|
792
|
+
/** @description CADASTRE_UNAVAILABLE or CADASTRE_INVALID_REPLY: the map gave no answer. */
|
|
793
|
+
502: {
|
|
794
|
+
headers: {
|
|
795
|
+
[name: string]: unknown;
|
|
796
|
+
};
|
|
797
|
+
content?: never;
|
|
798
|
+
};
|
|
799
|
+
/** @description CADASTRE_BLOCKED: the map is refusing calls; Retry-After says when to try again. */
|
|
800
|
+
503: {
|
|
801
|
+
headers: {
|
|
802
|
+
[name: string]: unknown;
|
|
803
|
+
};
|
|
804
|
+
content?: never;
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
};
|
|
717
808
|
TerritoryController_status: {
|
|
718
809
|
parameters: {
|
|
719
810
|
query?: never;
|
|
@@ -951,6 +1042,8 @@ type GeocodeResult = ApiSchemas['GeocodeResultDto'];
|
|
|
951
1042
|
type GeocodeBatchResponse = ApiSchemas['GeocodeBatchResponseDto'];
|
|
952
1043
|
type ReverseGeocodeRequest = ApiSchemas['ReverseGeocodeRequestDto'];
|
|
953
1044
|
type ReverseGeocodeResult = ApiSchemas['ReverseGeocodeResultDto'];
|
|
1045
|
+
type CadastreParcelRequest = ApiSchemas['CadastreParcelRequestDto'];
|
|
1046
|
+
type CadastreParcelResult = ApiSchemas['CadastreParcelResultDto'];
|
|
954
1047
|
type TerritoryStatus = ApiSchemas['TerritoryStatusDto'];
|
|
955
1048
|
type TerritoryResolveRequest = ApiSchemas['TerritoryResolveRequestDto'];
|
|
956
1049
|
type TerritoryResolveResponse = ApiSchemas['TerritoryResolveResponseDto'];
|
|
@@ -993,10 +1086,12 @@ interface GeoClient {
|
|
|
993
1086
|
geocode(input: GeocodeRequest, options?: RequestOptions): Promise<GeocodeResult>;
|
|
994
1087
|
geocodeBatch(input: GeocodeBatchRequest, options?: RequestOptions): Promise<GeocodeBatchResponse>;
|
|
995
1088
|
reverseGeocode(input: ReverseGeocodeRequest, options?: RequestOptions): Promise<ReverseGeocodeResult>;
|
|
1089
|
+
/** What the AdE cadastral map finds under a point; 503 `CADASTRE_BLOCKED` carries Retry-After. */
|
|
1090
|
+
cadastreParcel(input: CadastreParcelRequest, options?: RequestOptions): Promise<CadastreParcelResult>;
|
|
996
1091
|
territory: TerritoryClient;
|
|
997
1092
|
}
|
|
998
1093
|
|
|
999
1094
|
declare function createGeoClient(options: GeoClientOptions): GeoClient;
|
|
1000
1095
|
|
|
1001
1096
|
export { ApiError, createGeoClient };
|
|
1002
|
-
export type { GeoClient, GeoClientOptions, GeocodeBatchRequest, GeocodeBatchResponse, GeocodeRequest, GeocodeResult, RequestOptions, ReverseGeocodeRequest, ReverseGeocodeResult, TerritoryClient, TerritoryCompravendita, TerritoryCompravenditePage, TerritoryCompravenditeQuery, TerritoryComune, TerritoryComuneDetail, TerritoryComuneRiga, TerritoryComuniPage, TerritoryComuniQuery, TerritoryDatasets, TerritoryOmi, TerritoryPointResult, TerritoryQuotazione, TerritoryQuotazioniPage, TerritoryQuotazioniQuery, TerritoryResolveRequest, TerritoryResolveResponse, TerritoryStatus };
|
|
1097
|
+
export type { CadastreParcelRequest, CadastreParcelResult, GeoClient, GeoClientOptions, GeocodeBatchRequest, GeocodeBatchResponse, GeocodeRequest, GeocodeResult, RequestOptions, ReverseGeocodeRequest, ReverseGeocodeResult, TerritoryClient, TerritoryCompravendita, TerritoryCompravenditePage, TerritoryCompravenditeQuery, TerritoryComune, TerritoryComuneDetail, TerritoryComuneRiga, TerritoryComuniPage, TerritoryComuniQuery, TerritoryDatasets, TerritoryOmi, TerritoryPointResult, TerritoryQuotazione, TerritoryQuotazioniPage, TerritoryQuotazioniQuery, TerritoryResolveRequest, TerritoryResolveResponse, TerritoryStatus };
|
package/dist/index.js
CHANGED
|
@@ -70,6 +70,7 @@ function createGeoClient(options) {
|
|
|
70
70
|
geocode: (input, request) => data(client.POST("/geocode", { ...request, body: input })),
|
|
71
71
|
geocodeBatch: (input, request) => data(client.POST("/geocode/batch", { ...request, body: input })),
|
|
72
72
|
reverseGeocode: (input, request) => data(client.POST("/geocode/reverse", { ...request, body: input })),
|
|
73
|
+
cadastreParcel: (input, request) => data(client.POST("/cadastre/parcel", { ...request, body: input })),
|
|
73
74
|
territory: territory(client)
|
|
74
75
|
};
|
|
75
76
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seta-labs/geo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Typed Fetch client for the Seta Geo HTTP API",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public",
|
|
31
|
-
"tag": "
|
|
31
|
+
"tag": "latest",
|
|
32
32
|
"provenance": false
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|