@mapbox/mcp-server 0.2.0-dev.7 → 0.2.0-issue.11.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.
Files changed (29) hide show
  1. package/README.md +82 -4
  2. package/dist/index.js +0 -1
  3. package/dist/tools/directions-tool/DirectionsTool.d.ts +7 -32
  4. package/dist/tools/directions-tool/DirectionsTool.d.ts.map +1 -1
  5. package/dist/tools/directions-tool/DirectionsTool.js +37 -61
  6. package/dist/tools/directions-tool/DirectionsTool.js.map +1 -1
  7. package/dist/tools/directions-tool/DirectionsTool.test.js +208 -257
  8. package/dist/tools/directions-tool/DirectionsTool.test.js.map +1 -1
  9. package/dist/tools/directions-tool/cleanResponseData.d.ts +11 -0
  10. package/dist/tools/directions-tool/cleanResponseData.d.ts.map +1 -0
  11. package/dist/tools/directions-tool/cleanResponseData.js +175 -0
  12. package/dist/tools/directions-tool/cleanResponseData.js.map +1 -0
  13. package/dist/tools/directions-tool/cleanResponseData.test.d.ts +2 -0
  14. package/dist/tools/directions-tool/cleanResponseData.test.d.ts.map +1 -0
  15. package/dist/tools/directions-tool/cleanResponseData.test.js +295 -0
  16. package/dist/tools/directions-tool/cleanResponseData.test.js.map +1 -0
  17. package/dist/tools/directions-tool/formatIsoDateTime.d.ts +8 -0
  18. package/dist/tools/directions-tool/formatIsoDateTime.d.ts.map +1 -0
  19. package/dist/tools/directions-tool/formatIsoDateTime.js +17 -0
  20. package/dist/tools/directions-tool/formatIsoDateTime.js.map +1 -0
  21. package/dist/tools/directions-tool/formatIsoDateTime.test.d.ts +2 -0
  22. package/dist/tools/directions-tool/formatIsoDateTime.test.d.ts.map +1 -0
  23. package/dist/tools/directions-tool/formatIsoDateTime.test.js +26 -0
  24. package/dist/tools/directions-tool/formatIsoDateTime.test.js.map +1 -0
  25. package/dist/utils/requestUtils.d.ts.map +1 -1
  26. package/dist/utils/requestUtils.js +9 -1
  27. package/dist/utils/requestUtils.js.map +1 -1
  28. package/dist/version.json +4 -4
  29. package/package.json +2 -2
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Helper function to format ISO datetime strings according to Mapbox API requirements.
3
+ * It converts the format YYYY-MM-DDThh:mm:ss (with seconds but no timezone) to
4
+ * YYYY-MM-DDThh:mm (no seconds, no timezone) by removing the seconds part.
5
+ * Other valid formats are left unchanged.
6
+ */
7
+ export declare const formatIsoDateTime: (dateTime: string) => string;
8
+ //# sourceMappingURL=formatIsoDateTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatIsoDateTime.d.ts","sourceRoot":"","sources":["../../../src/tools/directions-tool/formatIsoDateTime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,MAWpD,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Helper function to format ISO datetime strings according to Mapbox API requirements.
3
+ * It converts the format YYYY-MM-DDThh:mm:ss (with seconds but no timezone) to
4
+ * YYYY-MM-DDThh:mm (no seconds, no timezone) by removing the seconds part.
5
+ * Other valid formats are left unchanged.
6
+ */
7
+ export const formatIsoDateTime = (dateTime) => {
8
+ // Regex for matching YYYY-MM-DDThh:mm:ss format (with seconds but no timezone)
9
+ const dateWithSecondsNoTz = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/;
10
+ if (dateWithSecondsNoTz.test(dateTime)) {
11
+ // Extract up to the minutes part only, dropping the seconds
12
+ return dateTime.substring(0, dateTime.lastIndexOf(':'));
13
+ }
14
+ // Return unchanged if it's already in a valid format
15
+ return dateTime;
16
+ };
17
+ //# sourceMappingURL=formatIsoDateTime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatIsoDateTime.js","sourceRoot":"","sources":["../../../src/tools/directions-tool/formatIsoDateTime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAU,EAAE;IAC5D,+EAA+E;IAC/E,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;IAEpE,IAAI,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,4DAA4D;QAC5D,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,qDAAqD;IACrD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=formatIsoDateTime.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatIsoDateTime.test.d.ts","sourceRoot":"","sources":["../../../src/tools/directions-tool/formatIsoDateTime.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
1
+ import { formatIsoDateTime } from './formatIsoDateTime';
2
+ describe('formatIsoDateTime', () => {
3
+ it('converts YYYY-MM-DDThh:mm:ss to YYYY-MM-DDThh:mm by removing seconds', () => {
4
+ const input = '2025-06-05T10:30:45';
5
+ const expected = '2025-06-05T10:30';
6
+ expect(formatIsoDateTime(input)).toBe(expected);
7
+ });
8
+ it('leaves YYYY-MM-DDThh:mm:ssZ format unchanged', () => {
9
+ const input = '2025-06-05T10:30:45Z';
10
+ expect(formatIsoDateTime(input)).toBe(input);
11
+ });
12
+ it('leaves YYYY-MM-DDThh:mm:ss±hh:mm format unchanged', () => {
13
+ const input = '2025-06-05T10:30:45+02:00';
14
+ expect(formatIsoDateTime(input)).toBe(input);
15
+ });
16
+ it('leaves YYYY-MM-DDThh:mm format unchanged', () => {
17
+ const input = '2025-06-05T10:30';
18
+ expect(formatIsoDateTime(input)).toBe(input);
19
+ });
20
+ it('handles edge cases with zeros in seconds', () => {
21
+ const input = '2025-06-05T10:30:00';
22
+ const expected = '2025-06-05T10:30';
23
+ expect(formatIsoDateTime(input)).toBe(expected);
24
+ });
25
+ });
26
+ //# sourceMappingURL=formatIsoDateTime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I,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"requestUtils.d.ts","sourceRoot":"","sources":["../../src/utils/requestUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB,CAuBA;AAED,wBAAgB,OAAO,SAKtB"}
1
+ {"version":3,"file":"requestUtils.d.ts","sourceRoot":"","sources":["../../src/utils/requestUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,WAAW,GAAG;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB,CAgCA;AAED,wBAAgB,OAAO,SAKtB"}
@@ -1,7 +1,15 @@
1
1
  let isPatched = false;
2
2
  let originalFetch;
3
3
  export function patchGlobalFetch(versionInfo) {
4
- originalFetch = global.fetch;
4
+ originalFetch = global.abc;
5
+ // Check if global.fetch exists, fallback to native fetch if available
6
+ // if (typeof global.fetch === 'function') {
7
+ // originalFetch = global.fetch;
8
+ // } else if (typeof fetch === 'function') {
9
+ // originalFetch = fetch;
10
+ // } else {
11
+ // throw new Error('No fetch implementation available');
12
+ // }
5
13
  const headers = {
6
14
  'User-Agent': `${versionInfo.name}/${versionInfo.version} (${versionInfo.branch}, ${versionInfo.tag}, ${versionInfo.sha})`
7
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"requestUtils.js","sourceRoot":"","sources":["../../src/utils/requestUtils.ts"],"names":[],"mappings":"AAEA,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,aAGkB,CAAC;AAEvB,MAAM,UAAU,gBAAgB,CAAC,WAAwB;IAGvD,aAAa,GAAG,MAAM,CAAC,KAAK,CA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,GAAG;KAC3H,CAAC;IACF,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,GAAG,KAAK,WAClB,KAA6B,EAC7B,IAAkB;YAElB,MAAM,YAAY,GAAgB;gBAChC,GAAG,IAAI;gBACP,OAAO,EAAE;oBACP,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;oBACxB,GAAG,OAAO;iBACX;aACF,CAAC;YACF,OAAO,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC5C,CAAC,CAAC;QACF,SAAS,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,CAAC,KAAK,GAAG,aAAa,CAAC;QAC7B,SAAS,GAAG,KAAK,CAAC;IACpB,CAAC;AACH,CAAC"}
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "sha": "fbfe37cfb8f7f74b2f5c4a4a8fc6d42015763b78",
3
- "tag": "v0.2.0-2-gfbfe37c",
4
- "branch": "add_result_type_option_for_CategorySearchTool",
5
- "version": "0.2.0-dev.7"
2
+ "sha": "d2dc8e621e50fe348bbe1e3940fc1a69d4d08823",
3
+ "tag": "v0.0.1-7-gd2dc8e6",
4
+ "branch": "test_prisma",
5
+ "version": "0.2.0"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mapbox/mcp-server",
3
- "version": "0.2.0-dev.7",
3
+ "version": "0.2.0-issue.11.0",
4
4
  "description": "Mapbox MCP server.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index-esm.js",
@@ -49,7 +49,7 @@
49
49
  "trailingComma": "none"
50
50
  },
51
51
  "engines": {
52
- "node": ">=18"
52
+ "node": ">=22"
53
53
  },
54
54
  "files": [
55
55
  "dist"