@vitemcp/server 1.10.3 → 1.10.4
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/dist/{OAuthProvider-DN--f3j1.d.cts → OAuthProvider-DbC_47_h.d.cts} +3 -1
- package/dist/{OAuthProvider-DN--f3j1.d.ts → OAuthProvider-DbC_47_h.d.ts} +3 -1
- package/dist/ViteMCP.cjs +3 -3
- package/dist/ViteMCP.d.cts +2 -2
- package/dist/ViteMCP.d.ts +2 -2
- package/dist/ViteMCP.js +2 -2
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-KRS3VHYI.js → chunk-3QRGEISD.js} +53 -35
- package/dist/chunk-3QRGEISD.js.map +1 -0
- package/dist/{chunk-PH2BAR5I.cjs → chunk-K2UCX3GS.cjs} +3 -3
- package/dist/{chunk-PH2BAR5I.cjs.map → chunk-K2UCX3GS.cjs.map} +1 -1
- package/dist/{chunk-IWNTAHGZ.cjs → chunk-LVPE26OW.cjs} +53 -35
- package/dist/chunk-LVPE26OW.cjs.map +1 -0
- package/dist/{chunk-EJVIGLUY.js → chunk-QYNWHXTM.js} +2 -2
- package/dist/openapi/index.cjs +12 -12
- package/dist/openapi/index.d.cts +1 -1
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-IWNTAHGZ.cjs.map +0 -1
- package/dist/chunk-KRS3VHYI.js.map +0 -1
- /package/dist/{chunk-EJVIGLUY.js.map → chunk-QYNWHXTM.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withoutTrailingSlash
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3QRGEISD.js";
|
|
4
4
|
import {
|
|
5
5
|
formatBytes,
|
|
6
6
|
ownKeysOnly,
|
|
@@ -1711,4 +1711,4 @@ export {
|
|
|
1711
1711
|
ServerState,
|
|
1712
1712
|
ViteMCP
|
|
1713
1713
|
};
|
|
1714
|
-
//# sourceMappingURL=chunk-
|
|
1714
|
+
//# sourceMappingURL=chunk-QYNWHXTM.js.map
|
package/dist/openapi/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
6
|
+
var _chunkK2UCX3GScjs = require('../chunk-K2UCX3GS.cjs');
|
|
7
|
+
require('../chunk-LVPE26OW.cjs');
|
|
8
8
|
require('../chunk-R4RK2DR2.cjs');
|
|
9
9
|
|
|
10
10
|
// src/openapi/parameters.ts
|
|
@@ -291,7 +291,7 @@ var buildBody = (binding, values, headers) => {
|
|
|
291
291
|
var buildPath = (route, values) => {
|
|
292
292
|
const unfilled = [...route.path.matchAll(/\{([^{}]*)\}/g)].filter(([, name]) => !values.has(name)).map(([placeholder]) => placeholder);
|
|
293
293
|
if (unfilled.length > 0) {
|
|
294
|
-
throw new (0,
|
|
294
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
295
295
|
`${route.method.toUpperCase()} ${route.path} cannot be called: the OpenAPI document declares no path parameter for ${unfilled.join(", ")}.`
|
|
296
296
|
);
|
|
297
297
|
}
|
|
@@ -302,7 +302,7 @@ var buildPath = (route, values) => {
|
|
|
302
302
|
const written = new Set(route.path.split("/").filter(isDotSegment));
|
|
303
303
|
const introduced = path.split("/").find((segment) => isDotSegment(segment) && !written.has(segment));
|
|
304
304
|
if (introduced !== void 0) {
|
|
305
|
-
throw new (0,
|
|
305
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
306
306
|
`${route.method.toUpperCase()} ${route.path} cannot be called with a path segment of "${introduced}": a URL resolves it as a step through the path, so the request would reach a different endpoint.`
|
|
307
307
|
);
|
|
308
308
|
}
|
|
@@ -320,7 +320,7 @@ var readResponse = async (response, options) => {
|
|
|
320
320
|
const mediaType = contentType.split(";")[0].trim().toLowerCase();
|
|
321
321
|
const label = `${route.method.toUpperCase()} ${route.path}`;
|
|
322
322
|
if (!response.ok) {
|
|
323
|
-
throw new (0,
|
|
323
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
324
324
|
`${label} failed with ${response.status} ${response.statusText}: ${truncate(
|
|
325
325
|
await response.text(),
|
|
326
326
|
2e3
|
|
@@ -332,7 +332,7 @@ var readResponse = async (response, options) => {
|
|
|
332
332
|
if (bytes.byteLength <= MAX_INLINE_MEDIA_BYTES) {
|
|
333
333
|
return mediaType.startsWith("image/") ? { data: toBase64(bytes), mimeType: mediaType, type: "image" } : { data: toBase64(bytes), mimeType: mediaType, type: "audio" };
|
|
334
334
|
}
|
|
335
|
-
throw new (0,
|
|
335
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
336
336
|
`${label} returned ${bytes.byteLength} bytes of ${contentType}, too large to return inline.`
|
|
337
337
|
);
|
|
338
338
|
}
|
|
@@ -342,7 +342,7 @@ var readResponse = async (response, options) => {
|
|
|
342
342
|
return { structuredContent: parsed };
|
|
343
343
|
}
|
|
344
344
|
if (binding.outputSchema) {
|
|
345
|
-
throw new (0,
|
|
345
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
346
346
|
`${label} declares a JSON object response but returned ${contentType || "an untyped body"}. Set \`outputSchema: false\` if this document's response schemas do not match the API.`
|
|
347
347
|
);
|
|
348
348
|
}
|
|
@@ -364,7 +364,7 @@ var setHeader = (headers, name, value) => {
|
|
|
364
364
|
try {
|
|
365
365
|
headers.set(name, value);
|
|
366
366
|
} catch (e2) {
|
|
367
|
-
throw new (0,
|
|
367
|
+
throw new (0, _chunkK2UCX3GScjs.UserError)(
|
|
368
368
|
`"${name}" is not a valid header name, or the value given for it is not a valid header value.`
|
|
369
369
|
);
|
|
370
370
|
}
|
|
@@ -471,7 +471,7 @@ var readSpecText = async (spec) => {
|
|
|
471
471
|
headers: { accept: "application/json, text/yaml, */*" }
|
|
472
472
|
});
|
|
473
473
|
if (!response.ok) {
|
|
474
|
-
await
|
|
474
|
+
await _chunkK2UCX3GScjs.cancelResponseBody.call(void 0, response);
|
|
475
475
|
throw new Error(
|
|
476
476
|
`Failed to fetch the OpenAPI document from ${spec}: ${response.status} ${response.statusText}`
|
|
477
477
|
);
|
|
@@ -1114,7 +1114,7 @@ var fromOpenAPI = async (options) => {
|
|
|
1114
1114
|
const selected = selectRoutes(extractRoutes(document), options);
|
|
1115
1115
|
const names = generateToolNames(selected, options.toolNames);
|
|
1116
1116
|
const normalizer = createSchemaNormalizer(document);
|
|
1117
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
1117
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkK2UCX3GScjs.ViteMCP)({
|
|
1118
1118
|
description: _optionalChain([document, 'access', _25 => _25.info, 'optionalAccess', _26 => _26.description]),
|
|
1119
1119
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _27 => _27.info, 'optionalAccess', _28 => _28.title]))), () => ( "OpenAPI")),
|
|
1120
1120
|
version: _nullishCoalesce(options.version, () => ( semanticVersion(_optionalChain([document, 'access', _29 => _29.info, 'optionalAccess', _30 => _30.version]))))
|
|
@@ -1153,8 +1153,8 @@ var fromOpenAPI = async (options) => {
|
|
|
1153
1153
|
route
|
|
1154
1154
|
}),
|
|
1155
1155
|
name,
|
|
1156
|
-
outputSchema: binding.outputSchema ?
|
|
1157
|
-
parameters:
|
|
1156
|
+
outputSchema: binding.outputSchema ? _chunkK2UCX3GScjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
|
|
1157
|
+
parameters: _chunkK2UCX3GScjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
|
|
1158
1158
|
timeoutMs: options.timeoutMs
|
|
1159
1159
|
});
|
|
1160
1160
|
}
|
package/dist/openapi/index.d.cts
CHANGED
|
@@ -4,7 +4,7 @@ import '@standard-schema/spec';
|
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'hono/cors';
|
|
6
6
|
import 'timers/promises';
|
|
7
|
-
import '../OAuthProvider-
|
|
7
|
+
import '../OAuthProvider-DbC_47_h.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A value that may depend on the calling request — a bearer token derived from
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import '@standard-schema/spec';
|
|
|
4
4
|
import 'hono';
|
|
5
5
|
import 'hono/cors';
|
|
6
6
|
import 'timers/promises';
|
|
7
|
-
import '../OAuthProvider-
|
|
7
|
+
import '../OAuthProvider-DbC_47_h.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A value that may depend on the calling request — a bearer token derived from
|
package/dist/openapi/index.js
CHANGED