@nocobase/plugin-mcp-server 2.1.0-alpha.10 → 2.1.0-alpha.9
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/build.config.ts +0 -1
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -6
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/http-errors/HISTORY.md +186 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/http-errors/LICENSE +23 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/http-errors/README.md +169 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/http-errors/index.js +290 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/http-errors/package.json +54 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/README.md +138 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/lib/index.d.ts +129 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/lib/index.js +182 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/lib/streams.js +105 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/package.json +70 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite/types/encodings.d.ts +423 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/raw-body/LICENSE +22 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/raw-body/README.md +223 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/raw-body/index.d.ts +85 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/raw-body/index.js +336 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/raw-body/package.json +46 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/HISTORY.md +87 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/LICENSE +23 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/README.md +139 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/codes.json +65 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/index.js +146 -0
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/statuses/package.json +49 -0
- package/dist/node_modules/light-my-request/package.json +1 -1
- package/dist/node_modules/openapi-types/package.json +1 -1
- package/dist/server/mcp-server.js +3 -4
- package/dist/server/mcp-tools.js +0 -56
- package/dist/server/plugin.d.ts +1 -10
- package/dist/server/plugin.js +4 -116
- package/package.json +2 -3
- package/dist/node_modules/fast-uri/.gitattributes +0 -2
- package/dist/node_modules/fast-uri/.github/.stale.yml +0 -21
- package/dist/node_modules/fast-uri/.github/dependabot.yml +0 -13
- package/dist/node_modules/fast-uri/.github/tests_checker.yml +0 -8
- package/dist/node_modules/fast-uri/.github/workflows/ci.yml +0 -23
- package/dist/node_modules/fast-uri/.github/workflows/package-manager-ci.yml +0 -20
- package/dist/node_modules/fast-uri/LICENSE +0 -30
- package/dist/node_modules/fast-uri/README.md +0 -125
- package/dist/node_modules/fast-uri/benchmark.js +0 -105
- package/dist/node_modules/fast-uri/index.js +0 -303
- package/dist/node_modules/fast-uri/lib/schemes.js +0 -188
- package/dist/node_modules/fast-uri/lib/scopedChars.js +0 -30
- package/dist/node_modules/fast-uri/lib/utils.js +0 -242
- package/dist/node_modules/fast-uri/package.json +0 -39
- package/dist/node_modules/fast-uri/test/.gitkeep +0 -0
- package/dist/node_modules/fast-uri/test/ajv.test.js +0 -39
- package/dist/node_modules/fast-uri/test/compatibility.test.js +0 -131
- package/dist/node_modules/fast-uri/test/equal.test.js +0 -103
- package/dist/node_modules/fast-uri/test/parse.test.js +0 -318
- package/dist/node_modules/fast-uri/test/resolve.test.js +0 -75
- package/dist/node_modules/fast-uri/test/serialize.test.js +0 -143
- package/dist/node_modules/fast-uri/test/uri-js.test.js +0 -912
- package/dist/node_modules/fast-uri/test/util.test.js +0 -23
- package/dist/node_modules/fast-uri/types/index.d.ts +0 -53
- package/dist/node_modules/fast-uri/types/index.test-d.ts +0 -17
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
2.0.2 / 2025-06-06
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
* Migrate to `String.prototype.slice()`
|
|
5
|
+
|
|
6
|
+
2.0.1 / 2021-01-03
|
|
7
|
+
==================
|
|
8
|
+
|
|
9
|
+
* Fix returning values from `Object.prototype`
|
|
10
|
+
|
|
11
|
+
2.0.0 / 2020-04-19
|
|
12
|
+
==================
|
|
13
|
+
|
|
14
|
+
* Drop support for Node.js 0.6
|
|
15
|
+
* Fix messaging casing of `418 I'm a Teapot`
|
|
16
|
+
* Remove code 306
|
|
17
|
+
* Remove `status[code]` exports; use `status.message[code]`
|
|
18
|
+
* Remove `status[msg]` exports; use `status.code[msg]`
|
|
19
|
+
* Rename `425 Unordered Collection` to standard `425 Too Early`
|
|
20
|
+
* Rename `STATUS_CODES` export to `message`
|
|
21
|
+
* Return status message for `statuses(code)` when given code
|
|
22
|
+
|
|
23
|
+
1.5.0 / 2018-03-27
|
|
24
|
+
==================
|
|
25
|
+
|
|
26
|
+
* Add `103 Early Hints`
|
|
27
|
+
|
|
28
|
+
1.4.0 / 2017-10-20
|
|
29
|
+
==================
|
|
30
|
+
|
|
31
|
+
* Add `STATUS_CODES` export
|
|
32
|
+
|
|
33
|
+
1.3.1 / 2016-11-11
|
|
34
|
+
==================
|
|
35
|
+
|
|
36
|
+
* Fix return type in JSDoc
|
|
37
|
+
|
|
38
|
+
1.3.0 / 2016-05-17
|
|
39
|
+
==================
|
|
40
|
+
|
|
41
|
+
* Add `421 Misdirected Request`
|
|
42
|
+
* perf: enable strict mode
|
|
43
|
+
|
|
44
|
+
1.2.1 / 2015-02-01
|
|
45
|
+
==================
|
|
46
|
+
|
|
47
|
+
* Fix message for status 451
|
|
48
|
+
- `451 Unavailable For Legal Reasons`
|
|
49
|
+
|
|
50
|
+
1.2.0 / 2014-09-28
|
|
51
|
+
==================
|
|
52
|
+
|
|
53
|
+
* Add `208 Already Repored`
|
|
54
|
+
* Add `226 IM Used`
|
|
55
|
+
* Add `306 (Unused)`
|
|
56
|
+
* Add `415 Unable For Legal Reasons`
|
|
57
|
+
* Add `508 Loop Detected`
|
|
58
|
+
|
|
59
|
+
1.1.1 / 2014-09-24
|
|
60
|
+
==================
|
|
61
|
+
|
|
62
|
+
* Add missing 308 to `codes.json`
|
|
63
|
+
|
|
64
|
+
1.1.0 / 2014-09-21
|
|
65
|
+
==================
|
|
66
|
+
|
|
67
|
+
* Add `codes.json` for universal support
|
|
68
|
+
|
|
69
|
+
1.0.4 / 2014-08-20
|
|
70
|
+
==================
|
|
71
|
+
|
|
72
|
+
* Package cleanup
|
|
73
|
+
|
|
74
|
+
1.0.3 / 2014-06-08
|
|
75
|
+
==================
|
|
76
|
+
|
|
77
|
+
* Add 308 to `.redirect` category
|
|
78
|
+
|
|
79
|
+
1.0.2 / 2014-03-13
|
|
80
|
+
==================
|
|
81
|
+
|
|
82
|
+
* Add `.retry` category
|
|
83
|
+
|
|
84
|
+
1.0.1 / 2014-03-12
|
|
85
|
+
==================
|
|
86
|
+
|
|
87
|
+
* Initial release
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
|
|
5
|
+
Copyright (c) 2016 Douglas Christopher Wilson <doug@somethingdoug.com>
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in
|
|
15
|
+
all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
23
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# statuses
|
|
2
|
+
|
|
3
|
+
[![NPM Version][npm-version-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
+
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
+
[![Build Status][ci-image]][ci-url]
|
|
7
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
+
[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]
|
|
9
|
+
|
|
10
|
+
HTTP status utility for node.
|
|
11
|
+
|
|
12
|
+
This module provides a list of status codes and messages sourced from
|
|
13
|
+
a few different projects:
|
|
14
|
+
|
|
15
|
+
* The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)
|
|
16
|
+
* The [Node.js project](https://nodejs.org/)
|
|
17
|
+
* The [NGINX project](https://www.nginx.com/)
|
|
18
|
+
* The [Apache HTTP Server project](https://httpd.apache.org/)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
23
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
24
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
$ npm install statuses
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## API
|
|
31
|
+
|
|
32
|
+
<!-- eslint-disable no-unused-vars -->
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
var status = require('statuses')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### status(code)
|
|
39
|
+
|
|
40
|
+
Returns the status message string for a known HTTP status code. The code
|
|
41
|
+
may be a number or a string. An error is thrown for an unknown status code.
|
|
42
|
+
|
|
43
|
+
<!-- eslint-disable no-undef -->
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
status(403) // => 'Forbidden'
|
|
47
|
+
status('403') // => 'Forbidden'
|
|
48
|
+
status(306) // throws
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### status(msg)
|
|
52
|
+
|
|
53
|
+
Returns the numeric status code for a known HTTP status message. The message
|
|
54
|
+
is case-insensitive. An error is thrown for an unknown status message.
|
|
55
|
+
|
|
56
|
+
<!-- eslint-disable no-undef -->
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
status('forbidden') // => 403
|
|
60
|
+
status('Forbidden') // => 403
|
|
61
|
+
status('foo') // throws
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### status.codes
|
|
65
|
+
|
|
66
|
+
Returns an array of all the status codes as `Integer`s.
|
|
67
|
+
|
|
68
|
+
### status.code[msg]
|
|
69
|
+
|
|
70
|
+
Returns the numeric status code for a known status message (in lower-case),
|
|
71
|
+
otherwise `undefined`.
|
|
72
|
+
|
|
73
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
status['not found'] // => 404
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### status.empty[code]
|
|
80
|
+
|
|
81
|
+
Returns `true` if a status code expects an empty body.
|
|
82
|
+
|
|
83
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
status.empty[200] // => undefined
|
|
87
|
+
status.empty[204] // => true
|
|
88
|
+
status.empty[304] // => true
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### status.message[code]
|
|
92
|
+
|
|
93
|
+
Returns the string message for a known numeric status code, otherwise
|
|
94
|
+
`undefined`. This object is the same format as the
|
|
95
|
+
[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).
|
|
96
|
+
|
|
97
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
98
|
+
|
|
99
|
+
```js
|
|
100
|
+
status.message[404] // => 'Not Found'
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### status.redirect[code]
|
|
104
|
+
|
|
105
|
+
Returns `true` if a status code is a valid redirect status.
|
|
106
|
+
|
|
107
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
status.redirect[200] // => undefined
|
|
111
|
+
status.redirect[301] // => true
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### status.retry[code]
|
|
115
|
+
|
|
116
|
+
Returns `true` if you should retry the rest.
|
|
117
|
+
|
|
118
|
+
<!-- eslint-disable no-undef, no-unused-expressions -->
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
status.retry[501] // => undefined
|
|
122
|
+
status.retry[503] // => true
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## License
|
|
126
|
+
|
|
127
|
+
[MIT](LICENSE)
|
|
128
|
+
|
|
129
|
+
[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci
|
|
130
|
+
[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci
|
|
131
|
+
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master
|
|
132
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
|
|
133
|
+
[node-version-image]: https://badgen.net/npm/node/statuses
|
|
134
|
+
[node-version-url]: https://nodejs.org/en/download
|
|
135
|
+
[npm-downloads-image]: https://badgen.net/npm/dm/statuses
|
|
136
|
+
[npm-url]: https://npmjs.org/package/statuses
|
|
137
|
+
[npm-version-image]: https://badgen.net/npm/v/statuses
|
|
138
|
+
[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge
|
|
139
|
+
[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"100": "Continue",
|
|
3
|
+
"101": "Switching Protocols",
|
|
4
|
+
"102": "Processing",
|
|
5
|
+
"103": "Early Hints",
|
|
6
|
+
"200": "OK",
|
|
7
|
+
"201": "Created",
|
|
8
|
+
"202": "Accepted",
|
|
9
|
+
"203": "Non-Authoritative Information",
|
|
10
|
+
"204": "No Content",
|
|
11
|
+
"205": "Reset Content",
|
|
12
|
+
"206": "Partial Content",
|
|
13
|
+
"207": "Multi-Status",
|
|
14
|
+
"208": "Already Reported",
|
|
15
|
+
"226": "IM Used",
|
|
16
|
+
"300": "Multiple Choices",
|
|
17
|
+
"301": "Moved Permanently",
|
|
18
|
+
"302": "Found",
|
|
19
|
+
"303": "See Other",
|
|
20
|
+
"304": "Not Modified",
|
|
21
|
+
"305": "Use Proxy",
|
|
22
|
+
"307": "Temporary Redirect",
|
|
23
|
+
"308": "Permanent Redirect",
|
|
24
|
+
"400": "Bad Request",
|
|
25
|
+
"401": "Unauthorized",
|
|
26
|
+
"402": "Payment Required",
|
|
27
|
+
"403": "Forbidden",
|
|
28
|
+
"404": "Not Found",
|
|
29
|
+
"405": "Method Not Allowed",
|
|
30
|
+
"406": "Not Acceptable",
|
|
31
|
+
"407": "Proxy Authentication Required",
|
|
32
|
+
"408": "Request Timeout",
|
|
33
|
+
"409": "Conflict",
|
|
34
|
+
"410": "Gone",
|
|
35
|
+
"411": "Length Required",
|
|
36
|
+
"412": "Precondition Failed",
|
|
37
|
+
"413": "Payload Too Large",
|
|
38
|
+
"414": "URI Too Long",
|
|
39
|
+
"415": "Unsupported Media Type",
|
|
40
|
+
"416": "Range Not Satisfiable",
|
|
41
|
+
"417": "Expectation Failed",
|
|
42
|
+
"418": "I'm a Teapot",
|
|
43
|
+
"421": "Misdirected Request",
|
|
44
|
+
"422": "Unprocessable Entity",
|
|
45
|
+
"423": "Locked",
|
|
46
|
+
"424": "Failed Dependency",
|
|
47
|
+
"425": "Too Early",
|
|
48
|
+
"426": "Upgrade Required",
|
|
49
|
+
"428": "Precondition Required",
|
|
50
|
+
"429": "Too Many Requests",
|
|
51
|
+
"431": "Request Header Fields Too Large",
|
|
52
|
+
"451": "Unavailable For Legal Reasons",
|
|
53
|
+
"500": "Internal Server Error",
|
|
54
|
+
"501": "Not Implemented",
|
|
55
|
+
"502": "Bad Gateway",
|
|
56
|
+
"503": "Service Unavailable",
|
|
57
|
+
"504": "Gateway Timeout",
|
|
58
|
+
"505": "HTTP Version Not Supported",
|
|
59
|
+
"506": "Variant Also Negotiates",
|
|
60
|
+
"507": "Insufficient Storage",
|
|
61
|
+
"508": "Loop Detected",
|
|
62
|
+
"509": "Bandwidth Limit Exceeded",
|
|
63
|
+
"510": "Not Extended",
|
|
64
|
+
"511": "Network Authentication Required"
|
|
65
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* statuses
|
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
+
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Module dependencies.
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var codes = require('./codes.json')
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Module exports.
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
module.exports = status
|
|
23
|
+
|
|
24
|
+
// status code to message map
|
|
25
|
+
status.message = codes
|
|
26
|
+
|
|
27
|
+
// status message (lower-case) to code map
|
|
28
|
+
status.code = createMessageToStatusCodeMap(codes)
|
|
29
|
+
|
|
30
|
+
// array of status codes
|
|
31
|
+
status.codes = createStatusCodeList(codes)
|
|
32
|
+
|
|
33
|
+
// status codes for redirects
|
|
34
|
+
status.redirect = {
|
|
35
|
+
300: true,
|
|
36
|
+
301: true,
|
|
37
|
+
302: true,
|
|
38
|
+
303: true,
|
|
39
|
+
305: true,
|
|
40
|
+
307: true,
|
|
41
|
+
308: true
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// status codes for empty bodies
|
|
45
|
+
status.empty = {
|
|
46
|
+
204: true,
|
|
47
|
+
205: true,
|
|
48
|
+
304: true
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// status codes for when you should retry the request
|
|
52
|
+
status.retry = {
|
|
53
|
+
502: true,
|
|
54
|
+
503: true,
|
|
55
|
+
504: true
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Create a map of message to status code.
|
|
60
|
+
* @private
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
function createMessageToStatusCodeMap (codes) {
|
|
64
|
+
var map = {}
|
|
65
|
+
|
|
66
|
+
Object.keys(codes).forEach(function forEachCode (code) {
|
|
67
|
+
var message = codes[code]
|
|
68
|
+
var status = Number(code)
|
|
69
|
+
|
|
70
|
+
// populate map
|
|
71
|
+
map[message.toLowerCase()] = status
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
return map
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Create a list of all status codes.
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
function createStatusCodeList (codes) {
|
|
83
|
+
return Object.keys(codes).map(function mapCode (code) {
|
|
84
|
+
return Number(code)
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Get the status code for given message.
|
|
90
|
+
* @private
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
function getStatusCode (message) {
|
|
94
|
+
var msg = message.toLowerCase()
|
|
95
|
+
|
|
96
|
+
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
|
|
97
|
+
throw new Error('invalid status message: "' + message + '"')
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return status.code[msg]
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Get the status message for given code.
|
|
105
|
+
* @private
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
function getStatusMessage (code) {
|
|
109
|
+
if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
|
|
110
|
+
throw new Error('invalid status code: ' + code)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return status.message[code]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get the status code.
|
|
118
|
+
*
|
|
119
|
+
* Given a number, this will throw if it is not a known status
|
|
120
|
+
* code, otherwise the code will be returned. Given a string,
|
|
121
|
+
* the string will be parsed for a number and return the code
|
|
122
|
+
* if valid, otherwise will lookup the code assuming this is
|
|
123
|
+
* the status message.
|
|
124
|
+
*
|
|
125
|
+
* @param {string|number} code
|
|
126
|
+
* @returns {number}
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
function status (code) {
|
|
131
|
+
if (typeof code === 'number') {
|
|
132
|
+
return getStatusMessage(code)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (typeof code !== 'string') {
|
|
136
|
+
throw new TypeError('code must be a number or string')
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// '403'
|
|
140
|
+
var n = parseInt(code, 10)
|
|
141
|
+
if (!isNaN(n)) {
|
|
142
|
+
return getStatusMessage(n)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return getStatusCode(code)
|
|
146
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "statuses",
|
|
3
|
+
"description": "HTTP status utility",
|
|
4
|
+
"version": "2.0.2",
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
|
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
|
+
],
|
|
9
|
+
"repository": "jshttp/statuses",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"http",
|
|
13
|
+
"status",
|
|
14
|
+
"code"
|
|
15
|
+
],
|
|
16
|
+
"files": [
|
|
17
|
+
"HISTORY.md",
|
|
18
|
+
"index.js",
|
|
19
|
+
"codes.json",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"csv-parse": "4.16.3",
|
|
24
|
+
"eslint": "7.19.0",
|
|
25
|
+
"eslint-config-standard": "14.1.1",
|
|
26
|
+
"eslint-plugin-import": "2.31.0",
|
|
27
|
+
"eslint-plugin-markdown": "1.0.2",
|
|
28
|
+
"eslint-plugin-node": "11.1.0",
|
|
29
|
+
"eslint-plugin-promise": "4.3.1",
|
|
30
|
+
"eslint-plugin-standard": "4.1.0",
|
|
31
|
+
"mocha": "8.4.0",
|
|
32
|
+
"nyc": "15.1.0",
|
|
33
|
+
"raw-body": "2.5.2",
|
|
34
|
+
"stream-to-array": "2.3.0"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">= 0.8"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "node scripts/build.js",
|
|
41
|
+
"fetch": "node scripts/fetch-apache.js && node scripts/fetch-iana.js && node scripts/fetch-nginx.js && node scripts/fetch-node.js",
|
|
42
|
+
"lint": "eslint --plugin markdown --ext js,md .",
|
|
43
|
+
"test": "mocha --reporter spec --check-leaks --bail test/",
|
|
44
|
+
"test-ci": "nyc --reporter=lcov --reporter=text npm test",
|
|
45
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test",
|
|
46
|
+
"update": "npm run fetch && npm run build",
|
|
47
|
+
"version": "node scripts/version-history.js && git add HISTORY.md"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"light-my-request","version":"6.6.0","description":"Fake HTTP injection library","main":"index.js","type":"commonjs","types":"types/index.d.ts","dependencies":{"cookie":"^1.0.1","process-warning":"^4.0.0","set-cookie-parser":"^2.6.0"},"devDependencies":{"@fastify/ajv-compiler":"^4.0.0","@fastify/pre-commit":"^2.1.0","@types/node":"^22.7.7","c8":"^10.1.2","end-of-stream":"^1.4.4","eslint":"^9.17.0","express":"^4.19.2","form-auto-content":"^3.2.1","form-data":"^4.0.0","formdata-node":"^6.0.3","multer":"^1.4.5-lts.1","neostandard":"^0.12.0","tinybench":"^3.0.0","tsd":"^0.31.0","undici":"^7.0.0"},"scripts":{"benchmark":"node benchmark/benchmark.js","coverage":"npm run unit -- --cov --coverage-report=html","lint":"eslint","lint:fix":"eslint --fix","test":"npm run lint && npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"repository":{"type":"git","url":"git+https://github.com/fastify/light-my-request.git"},"keywords":["http","inject","fake","request","server"],"author":"Tomas Della Vedova - @delvedor (http://delved.org)","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/fastify/light-my-request/issues"},"homepage":"https://github.com/fastify/light-my-request#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"_lastModified":"2026-03-
|
|
1
|
+
{"name":"light-my-request","version":"6.6.0","description":"Fake HTTP injection library","main":"index.js","type":"commonjs","types":"types/index.d.ts","dependencies":{"cookie":"^1.0.1","process-warning":"^4.0.0","set-cookie-parser":"^2.6.0"},"devDependencies":{"@fastify/ajv-compiler":"^4.0.0","@fastify/pre-commit":"^2.1.0","@types/node":"^22.7.7","c8":"^10.1.2","end-of-stream":"^1.4.4","eslint":"^9.17.0","express":"^4.19.2","form-auto-content":"^3.2.1","form-data":"^4.0.0","formdata-node":"^6.0.3","multer":"^1.4.5-lts.1","neostandard":"^0.12.0","tinybench":"^3.0.0","tsd":"^0.31.0","undici":"^7.0.0"},"scripts":{"benchmark":"node benchmark/benchmark.js","coverage":"npm run unit -- --cov --coverage-report=html","lint":"eslint","lint:fix":"eslint --fix","test":"npm run lint && npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"repository":{"type":"git","url":"git+https://github.com/fastify/light-my-request.git"},"keywords":["http","inject","fake","request","server"],"author":"Tomas Della Vedova - @delvedor (http://delved.org)","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/fastify/light-my-request/issues"},"homepage":"https://github.com/fastify/light-my-request#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"_lastModified":"2026-03-14T11:48:55.700Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"openapi-types","version":"12.1.3","description":"Types for OpenAPI documents.","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"prepare":"../../bin/tsc","test-watch":"../../bin/tsc"},"keywords":["openapi","swagger","types","typescript"],"author":"Joseph Spencer","bugs":{"url":"https://github.com/kogosoftwarellc/open-api/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Aopenapi-types"},"repository":"https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-types","homepage":"https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-types#readme","license":"MIT","gitHead":"09fed6d77536b3d7d1d38a2630a096041da773ee","_lastModified":"2026-03-
|
|
1
|
+
{"name":"openapi-types","version":"12.1.3","description":"Types for OpenAPI documents.","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"prepare":"../../bin/tsc","test-watch":"../../bin/tsc"},"keywords":["openapi","swagger","types","typescript"],"author":"Joseph Spencer","bugs":{"url":"https://github.com/kogosoftwarellc/open-api/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Aopenapi-types"},"repository":"https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-types","homepage":"https://github.com/kogosoftwarellc/open-api/tree/master/packages/openapi-types#readme","license":"MIT","gitHead":"09fed6d77536b3d7d1d38a2630a096041da773ee","_lastModified":"2026-03-14T11:48:55.787Z"}
|
|
@@ -94,10 +94,9 @@ class McpServer {
|
|
|
94
94
|
this.options = options;
|
|
95
95
|
}
|
|
96
96
|
async handlePost(ctx) {
|
|
97
|
-
var _a;
|
|
98
97
|
const body = ctx.request.body || {};
|
|
99
98
|
const sdkModules = await getMcpSdkModules();
|
|
100
|
-
const server = this.createServer(sdkModules
|
|
99
|
+
const server = this.createServer(sdkModules);
|
|
101
100
|
const transport = new sdkModules.StreamableHTTPServerTransport({
|
|
102
101
|
sessionIdGenerator: void 0
|
|
103
102
|
});
|
|
@@ -112,7 +111,7 @@ class McpServer {
|
|
|
112
111
|
}
|
|
113
112
|
ctx.respond = false;
|
|
114
113
|
}
|
|
115
|
-
createServer(sdkModules
|
|
114
|
+
createServer(sdkModules) {
|
|
116
115
|
const server = new sdkModules.McpServer(
|
|
117
116
|
{
|
|
118
117
|
name: this.options.name,
|
|
@@ -146,7 +145,7 @@ class McpServer {
|
|
|
146
145
|
if (!tool) {
|
|
147
146
|
throw new Error(`Tool not found: ${toolName}`);
|
|
148
147
|
}
|
|
149
|
-
const token =
|
|
148
|
+
const token = resolveTokenFromExtra(extra);
|
|
150
149
|
try {
|
|
151
150
|
const result = await tool.call(args, {
|
|
152
151
|
token,
|
package/dist/server/mcp-tools.js
CHANGED
|
@@ -69,61 +69,6 @@ function mergeSwagger(target, source) {
|
|
|
69
69
|
arrayMerge: (destinationArray, sourceArray) => sourceArray.concat(destinationArray)
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function resolveLocalRef(document, ref) {
|
|
73
|
-
if (!ref.startsWith("#/")) {
|
|
74
|
-
return void 0;
|
|
75
|
-
}
|
|
76
|
-
return ref.slice(2).split("/").reduce((current, segment) => current == null ? void 0 : current[segment], document);
|
|
77
|
-
}
|
|
78
|
-
function dereferenceNode(node, document, seen = /* @__PURE__ */ new Set()) {
|
|
79
|
-
if (Array.isArray(node)) {
|
|
80
|
-
return node.map((item) => dereferenceNode(item, document, seen));
|
|
81
|
-
}
|
|
82
|
-
if (!node || typeof node !== "object") {
|
|
83
|
-
return node;
|
|
84
|
-
}
|
|
85
|
-
if (typeof node.$ref === "string") {
|
|
86
|
-
if (seen.has(node.$ref)) {
|
|
87
|
-
return {};
|
|
88
|
-
}
|
|
89
|
-
const resolved = resolveLocalRef(document, node.$ref);
|
|
90
|
-
if (!resolved) {
|
|
91
|
-
return node;
|
|
92
|
-
}
|
|
93
|
-
return dereferenceNode(resolved, document, /* @__PURE__ */ new Set([...seen, node.$ref]));
|
|
94
|
-
}
|
|
95
|
-
return Object.fromEntries(Object.entries(node).map(([key, value]) => [key, dereferenceNode(value, document, seen)]));
|
|
96
|
-
}
|
|
97
|
-
function prepareSwaggerForMcpTools(document) {
|
|
98
|
-
const swagger = {
|
|
99
|
-
...document,
|
|
100
|
-
paths: {}
|
|
101
|
-
};
|
|
102
|
-
for (const [path, pathItem] of Object.entries(document.paths || {})) {
|
|
103
|
-
if (!pathItem) {
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
const nextPathItem = {
|
|
107
|
-
...pathItem
|
|
108
|
-
};
|
|
109
|
-
if (Array.isArray(pathItem.parameters)) {
|
|
110
|
-
nextPathItem.parameters = dereferenceNode(pathItem.parameters, document);
|
|
111
|
-
}
|
|
112
|
-
for (const method of ["get", "post", "put", "patch", "delete", "options", "head", "trace"]) {
|
|
113
|
-
const operation = pathItem[method];
|
|
114
|
-
if (!operation) {
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
nextPathItem[method] = {
|
|
118
|
-
...operation,
|
|
119
|
-
parameters: Array.isArray(operation.parameters) ? dereferenceNode(operation.parameters, document) : operation.parameters,
|
|
120
|
-
requestBody: operation.requestBody ? dereferenceNode(operation.requestBody, document) : operation.requestBody
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
swagger.paths[path] = nextPathItem;
|
|
124
|
-
}
|
|
125
|
-
return swagger;
|
|
126
|
-
}
|
|
127
72
|
function joinUrl(baseUrl, path) {
|
|
128
73
|
if (!baseUrl) {
|
|
129
74
|
return path;
|
|
@@ -219,7 +164,6 @@ async function collectMcpToolsFromSwagger(options) {
|
|
|
219
164
|
}
|
|
220
165
|
swagger = mergeSwagger(swagger, pluginSwagger);
|
|
221
166
|
}
|
|
222
|
-
swagger = prepareSwaggerForMcpTools(swagger);
|
|
223
167
|
const { getToolsFromOpenApi } = await import("openapi-mcp-generator");
|
|
224
168
|
const mcpTools = await getToolsFromOpenApi(swagger);
|
|
225
169
|
return mcpTools.map((tool) => {
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -9,16 +9,7 @@
|
|
|
9
9
|
import { Plugin } from '@nocobase/server';
|
|
10
10
|
export declare class PluginMcpServerServer extends Plugin {
|
|
11
11
|
private mcpServer;
|
|
12
|
-
private readonly
|
|
13
|
-
private getApiBasePath;
|
|
14
|
-
private getMcpPath;
|
|
15
|
-
private getIdpOauthPlugin;
|
|
16
|
-
private getOauthMetadata;
|
|
17
|
-
private rewriteUnauthorizedResponse;
|
|
18
|
-
private registerProtectedResourceMetadataRoute;
|
|
19
|
-
private registerIdpResource;
|
|
20
|
-
private unregisterIdpResource;
|
|
21
|
-
private registerMcpTools;
|
|
12
|
+
private readonly registerMcpTools;
|
|
22
13
|
afterAdd(): Promise<void>;
|
|
23
14
|
beforeLoad(): Promise<void>;
|
|
24
15
|
load(): Promise<void>;
|