@ignfab/geocontext 0.9.5 → 0.9.7
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 +349 -259
- package/dist/gpf/adminexpress.d.ts +17 -8
- package/dist/gpf/adminexpress.js +40 -17
- package/dist/gpf/adminexpress.js.map +1 -1
- package/dist/gpf/altitude.d.ts +21 -9
- package/dist/gpf/altitude.js +5 -5
- package/dist/gpf/altitude.js.map +1 -1
- package/dist/gpf/geocode.d.ts +25 -4
- package/dist/gpf/geocode.js +5 -5
- package/dist/gpf/geocode.js.map +1 -1
- package/dist/gpf/parcellaire-express.d.ts +19 -9
- package/dist/gpf/parcellaire-express.js +59 -26
- package/dist/gpf/parcellaire-express.js.map +1 -1
- package/dist/gpf/urbanisme.d.ts +24 -16
- package/dist/gpf/urbanisme.js +81 -33
- package/dist/gpf/urbanisme.js.map +1 -1
- package/dist/gpf/{wfs.js → wfs-schema-catalog.js} +1 -1
- package/dist/gpf/wfs-schema-catalog.js.map +1 -0
- package/dist/helpers/RateLimiter.d.ts +44 -0
- package/dist/helpers/RateLimiter.js +52 -0
- package/dist/helpers/RateLimiter.js.map +1 -0
- package/dist/helpers/distance.d.ts +2 -1
- package/dist/helpers/distance.js +2 -1
- package/dist/helpers/distance.js.map +1 -1
- package/dist/helpers/errors/toolError.d.ts +30 -0
- package/dist/helpers/errors/toolError.js +193 -0
- package/dist/helpers/errors/toolError.js.map +1 -0
- package/dist/helpers/errors/zodErrorMapFr.d.ts +20 -0
- package/dist/helpers/errors/zodErrorMapFr.js +191 -0
- package/dist/helpers/errors/zodErrorMapFr.js.map +1 -0
- package/dist/helpers/http.d.ts +67 -7
- package/dist/helpers/http.js +458 -84
- package/dist/helpers/http.js.map +1 -1
- package/dist/helpers/jsonSchema.d.ts +20 -2
- package/dist/helpers/jsonSchema.js +12 -0
- package/dist/helpers/jsonSchema.js.map +1 -1
- package/dist/helpers/schemas.d.ts +4 -4
- package/dist/helpers/wfs_engine/attributeFilter.d.ts +51 -0
- package/dist/helpers/wfs_engine/attributeFilter.js +258 -0
- package/dist/helpers/wfs_engine/attributeFilter.js.map +1 -0
- package/dist/helpers/wfs_engine/byId.d.ts +76 -0
- package/dist/helpers/wfs_engine/byId.js +106 -0
- package/dist/helpers/wfs_engine/byId.js.map +1 -0
- package/dist/helpers/wfs_engine/execution.d.ts +72 -0
- package/dist/helpers/wfs_engine/execution.js +95 -0
- package/dist/helpers/wfs_engine/execution.js.map +1 -0
- package/dist/helpers/wfs_engine/features.d.ts +64 -0
- package/dist/helpers/wfs_engine/features.js +138 -0
- package/dist/helpers/wfs_engine/features.js.map +1 -0
- package/dist/helpers/wfs_engine/geometry.d.ts +16 -0
- package/dist/helpers/wfs_engine/geometry.js +44 -0
- package/dist/helpers/wfs_engine/geometry.js.map +1 -0
- package/dist/helpers/wfs_engine/properties.d.ts +51 -0
- package/dist/helpers/wfs_engine/properties.js +128 -0
- package/dist/helpers/wfs_engine/properties.js.map +1 -0
- package/dist/helpers/wfs_engine/queryPreparation.d.ts +32 -0
- package/dist/helpers/wfs_engine/queryPreparation.js +149 -0
- package/dist/helpers/wfs_engine/queryPreparation.js.map +1 -0
- package/dist/helpers/wfs_engine/request.d.ts +94 -0
- package/dist/helpers/wfs_engine/request.js +197 -0
- package/dist/helpers/wfs_engine/request.js.map +1 -0
- package/dist/helpers/wfs_engine/response.d.ts +80 -0
- package/dist/helpers/wfs_engine/response.js +135 -0
- package/dist/helpers/wfs_engine/response.js.map +1 -0
- package/dist/helpers/wfs_engine/schema.d.ts +209 -0
- package/dist/helpers/{wfs_internal → wfs_engine}/schema.js +50 -10
- package/dist/helpers/wfs_engine/schema.js.map +1 -0
- package/dist/helpers/wfs_engine/spatialCql.d.ts +46 -0
- package/dist/helpers/wfs_engine/spatialCql.js +54 -0
- package/dist/helpers/wfs_engine/spatialCql.js.map +1 -0
- package/dist/helpers/wfs_engine/spatialFilter.d.ts +14 -0
- package/dist/helpers/wfs_engine/spatialFilter.js +131 -0
- package/dist/helpers/wfs_engine/spatialFilter.js.map +1 -0
- package/dist/index.js +65 -23
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +4 -1
- package/dist/logger.js.map +1 -1
- package/dist/tools/AdminexpressTool.d.ts +42 -33
- package/dist/tools/AdminexpressTool.js +19 -3
- package/dist/tools/AdminexpressTool.js.map +1 -1
- package/dist/tools/AltitudeTool.d.ts +35 -44
- package/dist/tools/AltitudeTool.js +19 -8
- package/dist/tools/AltitudeTool.js.map +1 -1
- package/dist/tools/AssietteSupTool.d.ts +51 -34
- package/dist/tools/AssietteSupTool.js +18 -2
- package/dist/tools/AssietteSupTool.js.map +1 -1
- package/dist/tools/BaseTool.d.ts +17 -0
- package/dist/tools/BaseTool.js +41 -0
- package/dist/tools/BaseTool.js.map +1 -0
- package/dist/tools/CadastreTool.d.ts +53 -33
- package/dist/tools/CadastreTool.js +18 -2
- package/dist/tools/CadastreTool.js.map +1 -1
- package/dist/tools/GeocodeTool.d.ts +53 -37
- package/dist/tools/GeocodeTool.js +17 -2
- package/dist/tools/GeocodeTool.js.map +1 -1
- package/dist/tools/GpfWfsDescribeTypeTool.d.ts +66 -94
- package/dist/tools/GpfWfsDescribeTypeTool.js +26 -15
- package/dist/tools/GpfWfsDescribeTypeTool.js.map +1 -1
- package/dist/tools/GpfWfsGetFeatureByIdTool.d.ts +89 -0
- package/dist/tools/GpfWfsGetFeatureByIdTool.js +99 -0
- package/dist/tools/GpfWfsGetFeatureByIdTool.js.map +1 -0
- package/dist/tools/GpfWfsGetFeaturesTool.d.ts +89 -123
- package/dist/tools/GpfWfsGetFeaturesTool.js +31 -144
- package/dist/tools/GpfWfsGetFeaturesTool.js.map +1 -1
- package/dist/tools/GpfWfsSearchTypesTool.d.ts +41 -32
- package/dist/tools/GpfWfsSearchTypesTool.js +18 -3
- package/dist/tools/GpfWfsSearchTypesTool.js.map +1 -1
- package/dist/tools/UrbanismeTool.d.ts +42 -33
- package/dist/tools/UrbanismeTool.js +18 -2
- package/dist/tools/UrbanismeTool.js.map +1 -1
- package/package.json +51 -24
- package/dist/gpf/wfs.js.map +0 -1
- package/dist/helpers/wfs.d.ts +0 -27
- package/dist/helpers/wfs.js +0 -55
- package/dist/helpers/wfs.js.map +0 -1
- package/dist/helpers/wfs_internal/compile.d.ts +0 -46
- package/dist/helpers/wfs_internal/compile.js +0 -595
- package/dist/helpers/wfs_internal/compile.js.map +0 -1
- package/dist/helpers/wfs_internal/request.d.ts +0 -38
- package/dist/helpers/wfs_internal/request.js +0 -92
- package/dist/helpers/wfs_internal/request.js.map +0 -1
- package/dist/helpers/wfs_internal/response.d.ts +0 -21
- package/dist/helpers/wfs_internal/response.js +0 -29
- package/dist/helpers/wfs_internal/response.js.map +0 -1
- package/dist/helpers/wfs_internal/schema.d.ts +0 -167
- package/dist/helpers/wfs_internal/schema.js.map +0 -1
- /package/dist/gpf/{wfs.d.ts → wfs-schema-catalog.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wfs-schema-catalog.js","sourceRoot":"","sources":["../../src/gpf/wfs-schema-catalog.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAElB,OAAO,EAGH,oBAAoB,EACpB,gCAAgC,GAEnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oBAAoB;AAEpB,MAAM,CAAC,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEvD,mFAAmF;AACnF,MAAM,8BAA8B,GAAG,4BAA4B,CAAC;AAEpE,sFAAsF;AACtF,MAAM,8BAA8B,GAAG;IACnC,WAAW;IACX,MAAM;IACN,OAAO;IACP,aAAa;IACb,YAAY;IACZ,OAAO;IACP,kBAAkB;CACZ,CAAC;AAEX,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,IAAI,CAAU,CAAC;AAM9D,iBAAiB;AAEjB,MAAM,OAAO,wBAAyB,SAAQ,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AAC,OAAO,GAAG,oBAAoB,CAAC;YAChC,aAAa,EAAE,CAAC,KAAmB,EAAE,EAAE,CAAC,IAAI,gCAAgC,CAAC,KAAK,EAAE,mBAAmB,CAAC;SAC3G,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,eAAe;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,4BAA4B,CAAC,KAAa,EAAE,aAAqB,EAAE;QACrE,OAAO,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE;YACxC,KAAK,EAAE,UAAU;SACpB,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAAY;QAC7B,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,WAAW,EAAE,CAAC;YACd,OAAO,WAAW,CAAC;QACvB,CAAC;QACD,MAAM,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CAEJ;AAED,4BAA4B;AAE5B,kGAAkG;AAClG,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,SAAS,EAAE;IAC9C,UAAU,EAAE,4BAA4B,EAAE;CAC7C,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameters for the RateLimiter class inspired by https://pypi.org/project/ratelimiter/
|
|
3
|
+
*/
|
|
4
|
+
interface RateLimiterOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The name of the rate limiter, used for error reporting and debugging purposes.
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* The maximum number of calls allowed during one period.
|
|
11
|
+
*/
|
|
12
|
+
maxCalls: number;
|
|
13
|
+
/**
|
|
14
|
+
* The period duration in seconds.
|
|
15
|
+
*/
|
|
16
|
+
period: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An helper class to limit the number of requests over a configurable period.
|
|
20
|
+
* It is intended to avoid over loading backend services with too many requests
|
|
21
|
+
* in a short period of time.
|
|
22
|
+
*
|
|
23
|
+
* When the limit is reached, an Error is thrown with the message "Rate limit exceeded".
|
|
24
|
+
*/
|
|
25
|
+
export declare class RateLimiter {
|
|
26
|
+
private name;
|
|
27
|
+
private maxCalls;
|
|
28
|
+
private periodMs;
|
|
29
|
+
private periodStartMs;
|
|
30
|
+
private requestsInPeriod;
|
|
31
|
+
constructor(options: RateLimiterOptions);
|
|
32
|
+
limit(): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Helper function to create a RateLimiter instance with the given parameters.
|
|
36
|
+
* This is just a convenience function to avoid having to import the RateLimiter class.
|
|
37
|
+
*
|
|
38
|
+
* @param name the name of the rate limiter, used for error reporting and debugging purposes
|
|
39
|
+
* @param maxCalls the maximum number of calls allowed during one period
|
|
40
|
+
* @param period the period duration in seconds
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare function createRateLimiter(name: string, maxCalls: number, period: number): RateLimiter;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An helper class to limit the number of requests over a configurable period.
|
|
3
|
+
* It is intended to avoid over loading backend services with too many requests
|
|
4
|
+
* in a short period of time.
|
|
5
|
+
*
|
|
6
|
+
* When the limit is reached, an Error is thrown with the message "Rate limit exceeded".
|
|
7
|
+
*/
|
|
8
|
+
export class RateLimiter {
|
|
9
|
+
name;
|
|
10
|
+
maxCalls;
|
|
11
|
+
periodMs;
|
|
12
|
+
periodStartMs;
|
|
13
|
+
requestsInPeriod;
|
|
14
|
+
constructor(options) {
|
|
15
|
+
if (!Number.isFinite(options.maxCalls) || !Number.isInteger(options.maxCalls) || options.maxCalls <= 0) {
|
|
16
|
+
throw new Error(`Invalid maxCalls for limiter ${options.name}`);
|
|
17
|
+
}
|
|
18
|
+
if (!Number.isFinite(options.period) || options.period <= 0) {
|
|
19
|
+
throw new Error(`Invalid period for limiter ${options.name}`);
|
|
20
|
+
}
|
|
21
|
+
this.name = options.name;
|
|
22
|
+
this.maxCalls = options.maxCalls;
|
|
23
|
+
this.periodMs = options.period * 1000;
|
|
24
|
+
this.periodStartMs = null;
|
|
25
|
+
this.requestsInPeriod = 0;
|
|
26
|
+
}
|
|
27
|
+
async limit() {
|
|
28
|
+
const now = Date.now();
|
|
29
|
+
// Reset the counter when entering a new period window.
|
|
30
|
+
if (this.periodStartMs === null || now - this.periodStartMs >= this.periodMs) {
|
|
31
|
+
this.periodStartMs = now;
|
|
32
|
+
this.requestsInPeriod = 0;
|
|
33
|
+
}
|
|
34
|
+
if (this.requestsInPeriod >= this.maxCalls) {
|
|
35
|
+
throw new Error(`[${this.name}] Rate limit exceeded`);
|
|
36
|
+
}
|
|
37
|
+
this.requestsInPeriod += 1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Helper function to create a RateLimiter instance with the given parameters.
|
|
42
|
+
* This is just a convenience function to avoid having to import the RateLimiter class.
|
|
43
|
+
*
|
|
44
|
+
* @param name the name of the rate limiter, used for error reporting and debugging purposes
|
|
45
|
+
* @param maxCalls the maximum number of calls allowed during one period
|
|
46
|
+
* @param period the period duration in seconds
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export function createRateLimiter(name, maxCalls, period) {
|
|
50
|
+
return new RateLimiter({ name, maxCalls, period });
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=RateLimiter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RateLimiter.js","sourceRoot":"","sources":["../../src/helpers/RateLimiter.ts"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IACZ,IAAI,CAAS;IACb,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACjB,aAAa,CAAgB;IA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CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,gBAAgB,IAAI,CAAC,CAAC;IAC/B,CAAC;CAEJ;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,QAAgB,EAAE,MAAc;IAC5E,OAAO,IAAI,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Geometry } from "geojson";
|
|
1
2
|
/**
|
|
2
3
|
* Compute approximative distance in meters between gA and gB.
|
|
3
4
|
*
|
|
@@ -6,4 +7,4 @@
|
|
|
6
7
|
* @param {object} gA GeoJSON Geometry
|
|
7
8
|
* @param {object} gB GeoJSON Geometry
|
|
8
9
|
*/
|
|
9
|
-
export default function distance(gA:
|
|
10
|
+
export default function distance(gA: Geometry, gB: Geometry): number;
|
package/dist/helpers/distance.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import GeoJSONReader from 'jsts/org/locationtech/jts/io/GeoJSONReader.js';
|
|
2
2
|
import { DistanceOp } from 'jsts/org/locationtech/jts/operation/distance.js';
|
|
3
|
+
import GeometryFactory from 'jsts/org/locationtech/jts/geom/GeometryFactory.js';
|
|
3
4
|
import turfDistance from '@turf/distance';
|
|
4
5
|
import { point as turfPoint } from '@turf/helpers';
|
|
5
6
|
/**
|
|
@@ -11,7 +12,7 @@ import { point as turfPoint } from '@turf/helpers';
|
|
|
11
12
|
* @param {object} gB GeoJSON Geometry
|
|
12
13
|
*/
|
|
13
14
|
export default function distance(gA, gB) {
|
|
14
|
-
const geojsonReader = new GeoJSONReader();
|
|
15
|
+
const geojsonReader = new GeoJSONReader(new GeometryFactory());
|
|
15
16
|
const a = geojsonReader.read(gA);
|
|
16
17
|
const b = geojsonReader.read(gB);
|
|
17
18
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distance.js","sourceRoot":"","sources":["../../src/helpers/distance.
|
|
1
|
+
{"version":3,"file":"distance.js","sourceRoot":"","sources":["../../src/helpers/distance.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+CAA+C,CAAA;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iDAAiD,CAAA;AAC5E,OAAO,eAAe,MAAM,mDAAmD,CAAA;AAE/E,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAC,KAAK,IAAI,SAAS,EAAC,MAAM,eAAe,CAAA;AAGhD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAY,EAAE,EAAY;IACvD,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,eAAe,EAAE,CAAC,CAAA;IAC9D,MAAM,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjC,MAAM,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrD,IAAK,aAAa,CAAC,MAAM,KAAK,CAAC,EAAG,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACH,OAAO,YAAY,CACf,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACnD,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACnD,EAAE,KAAK,EAAE,QAAQ,EAAE,CACtB,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized normalization for MCP tool errors.
|
|
3
|
+
*
|
|
4
|
+
* This helper converts heterogeneous runtime errors (Zod validation errors,
|
|
5
|
+
* upstream service errors, and generic exceptions) into one stable
|
|
6
|
+
* `structuredContent` contract consumed by tools through `BaseTool`.
|
|
7
|
+
*/
|
|
8
|
+
type ToolErrorItem = {
|
|
9
|
+
code: string;
|
|
10
|
+
detail: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
13
|
+
type ToolUpstreamInfo = {
|
|
14
|
+
status?: number;
|
|
15
|
+
};
|
|
16
|
+
export type ToolErrorPayload = {
|
|
17
|
+
type: string;
|
|
18
|
+
title: string;
|
|
19
|
+
detail: string;
|
|
20
|
+
errors: ToolErrorItem[];
|
|
21
|
+
upstream?: ToolUpstreamInfo;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Normalizes any runtime error into the shared MCP tool problem contract.
|
|
25
|
+
*
|
|
26
|
+
* @param error Unknown runtime error to normalize.
|
|
27
|
+
* @returns A stable payload intended for MCP `structuredContent`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function normalizeToolError(error: unknown): ToolErrorPayload;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized normalization for MCP tool errors.
|
|
3
|
+
*
|
|
4
|
+
* This helper converts heterogeneous runtime errors (Zod validation errors,
|
|
5
|
+
* upstream service errors, and generic exceptions) into one stable
|
|
6
|
+
* `structuredContent` contract consumed by tools through `BaseTool`.
|
|
7
|
+
*/
|
|
8
|
+
import { ZodError } from "zod";
|
|
9
|
+
import { ServiceResponseError } from "../http.js";
|
|
10
|
+
import { installZodErrorMapFr } from "./zodErrorMapFr.js";
|
|
11
|
+
// Install the FR Zod error map at module load so the very first parse in the
|
|
12
|
+
// process already emits localized messages.
|
|
13
|
+
installZodErrorMapFr();
|
|
14
|
+
// --- Problem Type Constants ---
|
|
15
|
+
/**
|
|
16
|
+
* Stable RFC7807-like problem type identifiers exposed in `structuredContent`.
|
|
17
|
+
*/
|
|
18
|
+
const INVALID_TOOL_PARAMS_TYPE = "urn:geocontext:problem:invalid-tool-params";
|
|
19
|
+
const UPSTREAM_INVALID_REQUEST_TYPE = "urn:geocontext:problem:upstream-invalid-request";
|
|
20
|
+
const UPSTREAM_ERROR_TYPE = "urn:geocontext:problem:upstream-error";
|
|
21
|
+
const EXECUTION_ERROR_TYPE = "urn:geocontext:problem:execution-error";
|
|
22
|
+
// --- Shared Helpers ---
|
|
23
|
+
/**
|
|
24
|
+
* Returns the most specific string segment from a Zod issue path.
|
|
25
|
+
*
|
|
26
|
+
* TODO: this is a best-effort heuristic to extract a user-friendly parameter name
|
|
27
|
+
*
|
|
28
|
+
* @param path Zod issue path.
|
|
29
|
+
* @returns Last non-empty string segment, or `undefined`.
|
|
30
|
+
*/
|
|
31
|
+
function issueName(path) {
|
|
32
|
+
for (let index = path.length - 1; index >= 0; index -= 1) {
|
|
33
|
+
const segment = path[index];
|
|
34
|
+
if (typeof segment === "string" && segment.length > 0) {
|
|
35
|
+
return segment;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Builds a compact end-user summary from normalized validation errors.
|
|
42
|
+
*
|
|
43
|
+
* @param errors Normalized validation errors.
|
|
44
|
+
* @returns A short, localized validation summary.
|
|
45
|
+
*/
|
|
46
|
+
function summarizeValidationDetail(errors) {
|
|
47
|
+
if (errors.length === 0) {
|
|
48
|
+
return "Un ou plusieurs paramètres fournis à l'outil sont invalides.";
|
|
49
|
+
}
|
|
50
|
+
const details = errors.map((error) => error.detail);
|
|
51
|
+
const firstDetails = details.slice(0, 3).join(" ");
|
|
52
|
+
const suffix = details.length > 3 ? " (et d'autres erreurs)." : "";
|
|
53
|
+
return `Paramètres invalides : ${firstDetails}${suffix}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Converts service error codes to a snake_case machine-friendly form.
|
|
57
|
+
*
|
|
58
|
+
* @param value Error code to normalize.
|
|
59
|
+
* @returns A normalized snake_case code.
|
|
60
|
+
*/
|
|
61
|
+
function toSnakeCase(value) {
|
|
62
|
+
return value
|
|
63
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1_$2")
|
|
64
|
+
.replace(/[\s\-]+/g, "_")
|
|
65
|
+
.toLowerCase();
|
|
66
|
+
}
|
|
67
|
+
// --- Zod Error Mapping ---
|
|
68
|
+
/**
|
|
69
|
+
* Converts Zod issues to normalized `errors[]` entries.
|
|
70
|
+
*
|
|
71
|
+
* Note: issue messages are expected to already be localized through
|
|
72
|
+
* `zodErrorMapFr` (installed once at module load).
|
|
73
|
+
*/
|
|
74
|
+
function normalizeZodIssues(error) {
|
|
75
|
+
const errors = [];
|
|
76
|
+
for (const issue of error.issues) {
|
|
77
|
+
if (issue.code === "unrecognized_keys") {
|
|
78
|
+
const keys = issue.keys.length > 0 ? issue.keys : ["<inconnu>"];
|
|
79
|
+
for (const key of keys) {
|
|
80
|
+
errors.push({
|
|
81
|
+
code: "unknown_parameter",
|
|
82
|
+
detail: `Le paramètre '${key}' n'est pas reconnu.`,
|
|
83
|
+
name: key,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const name = issueName(issue.path);
|
|
89
|
+
errors.push({
|
|
90
|
+
code: issue.code,
|
|
91
|
+
detail: issue.message || "Valeur invalide.",
|
|
92
|
+
...(name ? { name } : {}),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return errors;
|
|
96
|
+
}
|
|
97
|
+
// --- Upstream Error Mapping ---
|
|
98
|
+
/**
|
|
99
|
+
* Maps a `ServiceResponseError` to the shared upstream problem payload.
|
|
100
|
+
*
|
|
101
|
+
* @param error Structured upstream service error.
|
|
102
|
+
* @returns A normalized upstream problem payload.
|
|
103
|
+
*/
|
|
104
|
+
function buildUpstreamProblem(error) {
|
|
105
|
+
const status = typeof error.httpStatus === "number" ? error.httpStatus : undefined;
|
|
106
|
+
const serviceDetail = error.serviceDetail ?? error.message ?? "Erreur amont inconnue.";
|
|
107
|
+
const inferredErrorCode = /Illegal property name:/i.test(serviceDetail)
|
|
108
|
+
? "invalid_property_name"
|
|
109
|
+
: error.serviceCode
|
|
110
|
+
? toSnakeCase(error.serviceCode)
|
|
111
|
+
: "upstream_error";
|
|
112
|
+
const isInvalidRequest = status !== undefined && status >= 400 && status < 500;
|
|
113
|
+
return {
|
|
114
|
+
type: isInvalidRequest ? UPSTREAM_INVALID_REQUEST_TYPE : UPSTREAM_ERROR_TYPE,
|
|
115
|
+
title: isInvalidRequest
|
|
116
|
+
? "Requête rejetée par le service amont"
|
|
117
|
+
: "Erreur du service amont",
|
|
118
|
+
detail: `Le service distant a rejeté la requête : ${serviceDetail}`,
|
|
119
|
+
errors: [
|
|
120
|
+
{
|
|
121
|
+
code: inferredErrorCode,
|
|
122
|
+
detail: serviceDetail,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
...(status !== undefined ? { upstream: { status } } : {}),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Maps unknown runtime errors to one of the normalization categories.
|
|
130
|
+
*
|
|
131
|
+
* @param error Unknown runtime error.
|
|
132
|
+
* @returns Classified error with a normalized kind and a narrowed payload.
|
|
133
|
+
*/
|
|
134
|
+
function classifyToolError(error) {
|
|
135
|
+
if (error instanceof ZodError) {
|
|
136
|
+
return { kind: "invalid_tool_params", error };
|
|
137
|
+
}
|
|
138
|
+
if (error instanceof ServiceResponseError) {
|
|
139
|
+
return { kind: "upstream", error };
|
|
140
|
+
}
|
|
141
|
+
return { kind: "execution", error };
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Maps generic runtime errors to the shared execution problem payload.
|
|
145
|
+
*
|
|
146
|
+
* @param error Unknown runtime error.
|
|
147
|
+
* @returns A normalized execution problem payload.
|
|
148
|
+
*/
|
|
149
|
+
function buildExecutionProblem(error) {
|
|
150
|
+
const message = error instanceof Error
|
|
151
|
+
? error.message.trim()
|
|
152
|
+
: typeof error === "string"
|
|
153
|
+
? error.trim()
|
|
154
|
+
: "";
|
|
155
|
+
const detail = message.length > 0 ? message : "Erreur interne inattendue.";
|
|
156
|
+
return {
|
|
157
|
+
type: EXECUTION_ERROR_TYPE,
|
|
158
|
+
title: "Erreur d’exécution de l’outil",
|
|
159
|
+
detail,
|
|
160
|
+
errors: [
|
|
161
|
+
{
|
|
162
|
+
code: "execution_error",
|
|
163
|
+
detail,
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
// --- Public API ---
|
|
169
|
+
/**
|
|
170
|
+
* Normalizes any runtime error into the shared MCP tool problem contract.
|
|
171
|
+
*
|
|
172
|
+
* @param error Unknown runtime error to normalize.
|
|
173
|
+
* @returns A stable payload intended for MCP `structuredContent`.
|
|
174
|
+
*/
|
|
175
|
+
export function normalizeToolError(error) {
|
|
176
|
+
const classifiedError = classifyToolError(error);
|
|
177
|
+
switch (classifiedError.kind) {
|
|
178
|
+
case "invalid_tool_params": {
|
|
179
|
+
const errors = normalizeZodIssues(classifiedError.error);
|
|
180
|
+
return {
|
|
181
|
+
type: INVALID_TOOL_PARAMS_TYPE,
|
|
182
|
+
title: "Paramètres d’outil invalides",
|
|
183
|
+
detail: summarizeValidationDetail(errors),
|
|
184
|
+
errors,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
case "upstream":
|
|
188
|
+
return buildUpstreamProblem(classifiedError.error);
|
|
189
|
+
case "execution":
|
|
190
|
+
return buildExecutionProblem(classifiedError.error);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=toolError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolError.js","sourceRoot":"","sources":["../../../src/helpers/errors/toolError.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AA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,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* French Zod error map used as the global default for tool input validation.
|
|
3
|
+
*
|
|
4
|
+
* TODO: We are doing this because we are forced to use zod 3 for now
|
|
5
|
+
* and zod 3 does not support per-schema error maps. Once we upgrade to zod 4,
|
|
6
|
+
* we should refactor to use per-schema error maps and remove this global map.
|
|
7
|
+
*
|
|
8
|
+
* Goal:
|
|
9
|
+
* - keep custom schema messages intact
|
|
10
|
+
* - replace default English Zod messages with concise FR equivalents
|
|
11
|
+
*/
|
|
12
|
+
import { type ZodErrorMap } from "zod";
|
|
13
|
+
/**
|
|
14
|
+
* Global Zod error map that localizes default messages in French.
|
|
15
|
+
*/
|
|
16
|
+
export declare const zodErrorMapFr: ZodErrorMap;
|
|
17
|
+
/**
|
|
18
|
+
* Installs the FR Zod error map once per process.
|
|
19
|
+
*/
|
|
20
|
+
export declare function installZodErrorMapFr(): void;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* French Zod error map used as the global default for tool input validation.
|
|
3
|
+
*
|
|
4
|
+
* TODO: We are doing this because we are forced to use zod 3 for now
|
|
5
|
+
* and zod 3 does not support per-schema error maps. Once we upgrade to zod 4,
|
|
6
|
+
* we should refactor to use per-schema error maps and remove this global map.
|
|
7
|
+
*
|
|
8
|
+
* Goal:
|
|
9
|
+
* - keep custom schema messages intact
|
|
10
|
+
* - replace default English Zod messages with concise FR equivalents
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
// --- Internal State ---
|
|
14
|
+
let isInstalled = false;
|
|
15
|
+
// --- Shared Helpers ---
|
|
16
|
+
function issueName(path) {
|
|
17
|
+
for (let index = path.length - 1; index >= 0; index -= 1) {
|
|
18
|
+
const segment = path[index];
|
|
19
|
+
if (typeof segment === "string" && segment.length > 0) {
|
|
20
|
+
return segment;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
function describeExpectedType(expected) {
|
|
26
|
+
switch (expected) {
|
|
27
|
+
case "string":
|
|
28
|
+
return "une chaîne de caractères";
|
|
29
|
+
case "number":
|
|
30
|
+
return "un nombre";
|
|
31
|
+
case "integer":
|
|
32
|
+
return "un entier";
|
|
33
|
+
case "boolean":
|
|
34
|
+
return "un booléen";
|
|
35
|
+
case "array":
|
|
36
|
+
return "un tableau";
|
|
37
|
+
case "object":
|
|
38
|
+
return "un objet";
|
|
39
|
+
case "date":
|
|
40
|
+
return "une date";
|
|
41
|
+
default:
|
|
42
|
+
return `un type ${expected}`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function describeReceivedType(received) {
|
|
46
|
+
switch (received) {
|
|
47
|
+
case "undefined":
|
|
48
|
+
return "non défini";
|
|
49
|
+
case "null":
|
|
50
|
+
return "null";
|
|
51
|
+
case "nan":
|
|
52
|
+
return "NaN";
|
|
53
|
+
default:
|
|
54
|
+
return `de type ${received}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function formatTooSmallIssue(issue) {
|
|
58
|
+
if (issue.exact) {
|
|
59
|
+
switch (issue.type) {
|
|
60
|
+
case "string":
|
|
61
|
+
return `La valeur doit contenir exactement ${issue.minimum} caractère(s).`;
|
|
62
|
+
case "array":
|
|
63
|
+
return `La valeur doit contenir exactement ${issue.minimum} élément(s).`;
|
|
64
|
+
case "number":
|
|
65
|
+
case "bigint":
|
|
66
|
+
return `La valeur doit être exactement égale à ${issue.minimum}.`;
|
|
67
|
+
default:
|
|
68
|
+
return `La valeur doit être exactement égale à ${issue.minimum}.`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
switch (issue.type) {
|
|
72
|
+
case "string":
|
|
73
|
+
return `La valeur doit contenir au moins ${issue.minimum} caractère(s).`;
|
|
74
|
+
case "array":
|
|
75
|
+
return `La valeur doit contenir au moins ${issue.minimum} élément(s).`;
|
|
76
|
+
case "number":
|
|
77
|
+
case "bigint":
|
|
78
|
+
return `La valeur doit être au moins ${issue.minimum}.`;
|
|
79
|
+
case "set":
|
|
80
|
+
return `L'ensemble doit contenir au moins ${issue.minimum} élément(s).`;
|
|
81
|
+
case "date":
|
|
82
|
+
return "La date fournie est antérieure au minimum autorisé.";
|
|
83
|
+
default:
|
|
84
|
+
return `La valeur doit respecter une contrainte de borne (au moins ${issue.minimum}).`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function formatTooBigIssue(issue) {
|
|
88
|
+
if (issue.exact) {
|
|
89
|
+
switch (issue.type) {
|
|
90
|
+
case "string":
|
|
91
|
+
return `La valeur doit contenir exactement ${issue.maximum} caractère(s).`;
|
|
92
|
+
case "array":
|
|
93
|
+
return `La valeur doit contenir exactement ${issue.maximum} élément(s).`;
|
|
94
|
+
case "number":
|
|
95
|
+
case "bigint":
|
|
96
|
+
return `La valeur doit être exactement égale à ${issue.maximum}.`;
|
|
97
|
+
default:
|
|
98
|
+
return `La valeur doit être exactement égale à ${issue.maximum}.`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
switch (issue.type) {
|
|
102
|
+
case "string":
|
|
103
|
+
return `La valeur doit contenir au plus ${issue.maximum} caractère(s).`;
|
|
104
|
+
case "array":
|
|
105
|
+
return `La valeur doit contenir au plus ${issue.maximum} élément(s).`;
|
|
106
|
+
case "number":
|
|
107
|
+
case "bigint":
|
|
108
|
+
return `La valeur doit être au plus ${issue.maximum}.`;
|
|
109
|
+
case "set":
|
|
110
|
+
return `L'ensemble doit contenir au plus ${issue.maximum} élément(s).`;
|
|
111
|
+
case "date":
|
|
112
|
+
return "La date fournie est postérieure au maximum autorisé.";
|
|
113
|
+
default:
|
|
114
|
+
return `La valeur doit respecter une contrainte de borne (au plus ${issue.maximum}).`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// --- FR Error Map ---
|
|
118
|
+
/**
|
|
119
|
+
* Global Zod error map that localizes default messages in French.
|
|
120
|
+
*/
|
|
121
|
+
export const zodErrorMapFr = (issue, ctx) => {
|
|
122
|
+
switch (issue.code) {
|
|
123
|
+
case "too_small":
|
|
124
|
+
return { message: formatTooSmallIssue(issue) };
|
|
125
|
+
case "too_big":
|
|
126
|
+
return { message: formatTooBigIssue(issue) };
|
|
127
|
+
case "invalid_type":
|
|
128
|
+
if (issue.received === "undefined") {
|
|
129
|
+
const name = issueName(issue.path);
|
|
130
|
+
return {
|
|
131
|
+
message: name
|
|
132
|
+
? `Le paramètre '${name}' est requis.`
|
|
133
|
+
: "Un paramètre requis est manquant.",
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
message: `Type invalide : attendu ${describeExpectedType(issue.expected)}, reçu une valeur ${describeReceivedType(issue.received)}.`,
|
|
138
|
+
};
|
|
139
|
+
case "invalid_enum_value":
|
|
140
|
+
return {
|
|
141
|
+
message: `Valeur invalide. Valeurs autorisées : ${issue.options.map((option) => `'${String(option)}'`).join(", ")}.`,
|
|
142
|
+
};
|
|
143
|
+
case "invalid_string":
|
|
144
|
+
if (typeof issue.validation === "string") {
|
|
145
|
+
switch (issue.validation) {
|
|
146
|
+
case "email":
|
|
147
|
+
return { message: "Format d'email invalide." };
|
|
148
|
+
case "url":
|
|
149
|
+
return { message: "Format d'URL invalide." };
|
|
150
|
+
case "uuid":
|
|
151
|
+
return { message: "Format UUID invalide." };
|
|
152
|
+
case "datetime":
|
|
153
|
+
return { message: "Format de date/heure invalide." };
|
|
154
|
+
default:
|
|
155
|
+
return { message: `Format de chaîne invalide (${issue.validation}).` };
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if ("includes" in issue.validation) {
|
|
159
|
+
return { message: `La chaîne doit contenir '${issue.validation.includes}'.` };
|
|
160
|
+
}
|
|
161
|
+
if ("startsWith" in issue.validation) {
|
|
162
|
+
return { message: `La chaîne doit commencer par '${issue.validation.startsWith}'.` };
|
|
163
|
+
}
|
|
164
|
+
if ("endsWith" in issue.validation) {
|
|
165
|
+
return { message: `La chaîne doit se terminer par '${issue.validation.endsWith}'.` };
|
|
166
|
+
}
|
|
167
|
+
return { message: "Format de chaîne invalide." };
|
|
168
|
+
case "unrecognized_keys":
|
|
169
|
+
return {
|
|
170
|
+
message: issue.keys.length > 0
|
|
171
|
+
? `Clé(s) non reconnue(s) : ${issue.keys.map((key) => `'${key}'`).join(", ")}.`
|
|
172
|
+
: "Présence de clés non reconnues.",
|
|
173
|
+
};
|
|
174
|
+
case "custom":
|
|
175
|
+
return { message: issue.message || "Valeur invalide." };
|
|
176
|
+
default:
|
|
177
|
+
return { message: ctx.defaultError };
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
// --- Public API ---
|
|
181
|
+
/**
|
|
182
|
+
* Installs the FR Zod error map once per process.
|
|
183
|
+
*/
|
|
184
|
+
export function installZodErrorMapFr() {
|
|
185
|
+
if (isInstalled) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
z.setErrorMap(zodErrorMapFr);
|
|
189
|
+
isInstalled = true;
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=zodErrorMapFr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zodErrorMapFr.js","sourceRoot":"","sources":["../../../src/helpers/errors/zodErrorMapFr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAoB,MAAM,KAAK,CAAC;AAS1C,yBAAyB;AAEzB,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,yBAAyB;AAEzB,SAAS,SAAS,CAAC,IAAe;IAChC,KAAK,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAA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