@notionhq/notion-mcp-server 1.7.0 → 1.8.1

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/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "mcp",
7
7
  "server"
8
8
  ],
9
- "version": "1.7.0",
9
+ "version": "1.8.1",
10
10
  "license": "MIT",
11
11
  "type": "module",
12
12
  "scripts": {
@@ -986,8 +986,7 @@
986
986
  "type": "object",
987
987
  "properties": {
988
988
  "content": {
989
- "type": "string",
990
- "maxLength": 2000
989
+ "type": "string"
991
990
  },
992
991
  "link": {
993
992
  "type": [
@@ -1041,8 +1040,7 @@
1041
1040
  "type": "object",
1042
1041
  "properties": {
1043
1042
  "content": {
1044
- "type": "string",
1045
- "maxLength": 2000
1043
+ "type": "string"
1046
1044
  },
1047
1045
  "link": {
1048
1046
  "type": [
@@ -1252,8 +1250,7 @@
1252
1250
  "type": "object",
1253
1251
  "properties": {
1254
1252
  "content": {
1255
- "type": "string",
1256
- "maxLength": 2000
1253
+ "type": "string"
1257
1254
  },
1258
1255
  "link": {
1259
1256
  "type": [
@@ -1406,8 +1403,7 @@
1406
1403
  ],
1407
1404
  "properties": {
1408
1405
  "content": {
1409
- "type": "string",
1410
- "maxLength": 2000
1406
+ "type": "string"
1411
1407
  }
1412
1408
  }
1413
1409
  }
@@ -1528,8 +1524,7 @@
1528
1524
  "type": "object",
1529
1525
  "properties": {
1530
1526
  "content": {
1531
- "type": "string",
1532
- "maxLength": 2000
1527
+ "type": "string"
1533
1528
  },
1534
1529
  "link": {
1535
1530
  "type": [
@@ -1620,8 +1615,7 @@
1620
1615
  "type": "object",
1621
1616
  "properties": {
1622
1617
  "content": {
1623
- "type": "string",
1624
- "maxLength": 2000
1618
+ "type": "string"
1625
1619
  },
1626
1620
  "link": {
1627
1621
  "type": [
@@ -1665,8 +1659,7 @@
1665
1659
  "type": "object",
1666
1660
  "properties": {
1667
1661
  "content": {
1668
- "type": "string",
1669
- "maxLength": 2000
1662
+ "type": "string"
1670
1663
  },
1671
1664
  "link": {
1672
1665
  "type": [
@@ -3,6 +3,7 @@ import OpenAPIClientAxios from 'openapi-client-axios'
3
3
  import type { AxiosInstance } from 'axios'
4
4
  import FormData from 'form-data'
5
5
  import fs from 'fs'
6
+ import { Headers } from './polyfill-headers'
6
7
  import { isFileUploadParameter } from '../openapi/file-upload'
7
8
 
8
9
  export type HttpClientConfig = {
@@ -0,0 +1,42 @@
1
+ /*
2
+ * The Headers class was supported in Node.js starting with version 18, which was released on April 19, 2022.
3
+ * We need to have a polyfill ready to work for old Node versions.
4
+ * See more at https://github.com/makenotion/notion-mcp-server/issues/32
5
+ * */
6
+ class PolyfillHeaders {
7
+ private headers: Map<string, string[]> = new Map();
8
+
9
+ constructor(init?: Record<string, string>) {
10
+ if (init) {
11
+ Object.entries(init).forEach(([key, value]) => {
12
+ this.append(key, value);
13
+ });
14
+ }
15
+ }
16
+
17
+ public append(name: string, value: string): void {
18
+ const key = name.toLowerCase();
19
+
20
+ if (!this.headers.has(key)) {
21
+ this.headers.set(key, []);
22
+ }
23
+
24
+ this.headers.get(key)!.push(value);
25
+ }
26
+
27
+ public get(name: string): string | null {
28
+ const key = name.toLowerCase();
29
+
30
+ if (!this.headers.has(key)) {
31
+ return null;
32
+ }
33
+
34
+ return this.headers.get(key)!.join(', ');
35
+ }
36
+ }
37
+
38
+ const GlobalHeaders = typeof global !== 'undefined' && 'Headers' in global
39
+ ? (global as any).Headers
40
+ : undefined;
41
+
42
+ export const Headers = (GlobalHeaders || PolyfillHeaders);