@vitemcp/server 1.9.16 → 1.9.17
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-DNKBMBPU.d.cts → OAuthProvider-STkC4R2N.d.cts} +39 -1
- package/dist/{OAuthProvider-DNKBMBPU.d.ts → OAuthProvider-STkC4R2N.d.ts} +39 -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 +17 -3
- package/dist/auth/index.d.ts +17 -3
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-PXH56Q3F.js → chunk-4BX2CT5Z.js} +139 -18
- package/dist/chunk-4BX2CT5Z.js.map +1 -0
- package/dist/{chunk-LZTRZ62V.js → chunk-B3LLXB6O.js} +3 -3
- package/dist/{chunk-LZTRZ62V.js.map → chunk-B3LLXB6O.js.map} +1 -1
- package/dist/{chunk-HDJEH7NK.cjs → chunk-TNT3APOK.cjs} +4 -4
- package/dist/{chunk-HDJEH7NK.cjs.map → chunk-TNT3APOK.cjs.map} +1 -1
- package/dist/{chunk-TWYBLPRQ.cjs → chunk-ZEYQBA72.cjs} +158 -37
- package/dist/chunk-ZEYQBA72.cjs.map +1 -0
- 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-PXH56Q3F.js.map +0 -1
- package/dist/chunk-TWYBLPRQ.cjs.map +0 -1
package/dist/openapi/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('../chunk-
|
|
6
|
+
var _chunkTNT3APOKcjs = require('../chunk-TNT3APOK.cjs');
|
|
7
|
+
require('../chunk-ZEYQBA72.cjs');
|
|
8
8
|
require('../chunk-QPVEGWOL.cjs');
|
|
9
9
|
|
|
10
10
|
// src/openapi/parameters.ts
|
|
@@ -287,7 +287,7 @@ var buildBody = (binding, values, headers) => {
|
|
|
287
287
|
var buildPath = (route, values) => {
|
|
288
288
|
const unfilled = [...route.path.matchAll(/\{([^{}]*)\}/g)].filter(([, name]) => !values.has(name)).map(([placeholder]) => placeholder);
|
|
289
289
|
if (unfilled.length > 0) {
|
|
290
|
-
throw new (0,
|
|
290
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
291
291
|
`${route.method.toUpperCase()} ${route.path} cannot be called: the OpenAPI document declares no path parameter for ${unfilled.join(", ")}.`
|
|
292
292
|
);
|
|
293
293
|
}
|
|
@@ -298,7 +298,7 @@ var buildPath = (route, values) => {
|
|
|
298
298
|
const written = new Set(route.path.split("/").filter(isDotSegment));
|
|
299
299
|
const introduced = path.split("/").find((segment) => isDotSegment(segment) && !written.has(segment));
|
|
300
300
|
if (introduced !== void 0) {
|
|
301
|
-
throw new (0,
|
|
301
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
302
302
|
`${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.`
|
|
303
303
|
);
|
|
304
304
|
}
|
|
@@ -316,7 +316,7 @@ var readResponse = async (response, options) => {
|
|
|
316
316
|
const mediaType = contentType.split(";")[0].trim().toLowerCase();
|
|
317
317
|
const label = `${route.method.toUpperCase()} ${route.path}`;
|
|
318
318
|
if (!response.ok) {
|
|
319
|
-
throw new (0,
|
|
319
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
320
320
|
`${label} failed with ${response.status} ${response.statusText}: ${truncate(
|
|
321
321
|
await response.text(),
|
|
322
322
|
2e3
|
|
@@ -328,7 +328,7 @@ var readResponse = async (response, options) => {
|
|
|
328
328
|
if (bytes.byteLength <= MAX_INLINE_MEDIA_BYTES) {
|
|
329
329
|
return mediaType.startsWith("image/") ? { data: toBase64(bytes), mimeType: mediaType, type: "image" } : { data: toBase64(bytes), mimeType: mediaType, type: "audio" };
|
|
330
330
|
}
|
|
331
|
-
throw new (0,
|
|
331
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
332
332
|
`${label} returned ${bytes.byteLength} bytes of ${contentType}, too large to return inline.`
|
|
333
333
|
);
|
|
334
334
|
}
|
|
@@ -338,7 +338,7 @@ var readResponse = async (response, options) => {
|
|
|
338
338
|
return { structuredContent: parsed };
|
|
339
339
|
}
|
|
340
340
|
if (binding.outputSchema) {
|
|
341
|
-
throw new (0,
|
|
341
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
342
342
|
`${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.`
|
|
343
343
|
);
|
|
344
344
|
}
|
|
@@ -360,7 +360,7 @@ var setHeader = (headers, name, value) => {
|
|
|
360
360
|
try {
|
|
361
361
|
headers.set(name, value);
|
|
362
362
|
} catch (e2) {
|
|
363
|
-
throw new (0,
|
|
363
|
+
throw new (0, _chunkTNT3APOKcjs.UserError)(
|
|
364
364
|
`"${name}" is not a valid header name, or the value given for it is not a valid header value.`
|
|
365
365
|
);
|
|
366
366
|
}
|
|
@@ -467,7 +467,7 @@ var readSpecText = async (spec) => {
|
|
|
467
467
|
headers: { accept: "application/json, text/yaml, */*" }
|
|
468
468
|
});
|
|
469
469
|
if (!response.ok) {
|
|
470
|
-
await
|
|
470
|
+
await _chunkTNT3APOKcjs.cancelResponseBody.call(void 0, response);
|
|
471
471
|
throw new Error(
|
|
472
472
|
`Failed to fetch the OpenAPI document from ${spec}: ${response.status} ${response.statusText}`
|
|
473
473
|
);
|
|
@@ -1106,7 +1106,7 @@ var fromOpenAPI = async (options) => {
|
|
|
1106
1106
|
const selected = selectRoutes(extractRoutes(document), options);
|
|
1107
1107
|
const names = generateToolNames(selected, options.toolNames);
|
|
1108
1108
|
const normalizer = createSchemaNormalizer(document);
|
|
1109
|
-
const server = _nullishCoalesce(options.server, () => ( new (0,
|
|
1109
|
+
const server = _nullishCoalesce(options.server, () => ( new (0, _chunkTNT3APOKcjs.ViteMCP)({
|
|
1110
1110
|
description: _optionalChain([document, 'access', _25 => _25.info, 'optionalAccess', _26 => _26.description]),
|
|
1111
1111
|
name: _nullishCoalesce(_nullishCoalesce(options.name, () => ( _optionalChain([document, 'access', _27 => _27.info, 'optionalAccess', _28 => _28.title]))), () => ( "OpenAPI")),
|
|
1112
1112
|
version: _nullishCoalesce(options.version, () => ( semanticVersion(_optionalChain([document, 'access', _29 => _29.info, 'optionalAccess', _30 => _30.version]))))
|
|
@@ -1145,8 +1145,8 @@ var fromOpenAPI = async (options) => {
|
|
|
1145
1145
|
route
|
|
1146
1146
|
}),
|
|
1147
1147
|
name,
|
|
1148
|
-
outputSchema: binding.outputSchema ?
|
|
1149
|
-
parameters:
|
|
1148
|
+
outputSchema: binding.outputSchema ? _chunkTNT3APOKcjs.jsonSchemaAdapter.call(void 0, binding.outputSchema) : void 0,
|
|
1149
|
+
parameters: _chunkTNT3APOKcjs.jsonSchemaAdapter.call(void 0, binding.inputSchema),
|
|
1150
1150
|
timeoutMs: options.timeoutMs
|
|
1151
1151
|
});
|
|
1152
1152
|
}
|
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-STkC4R2N.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-STkC4R2N.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