修改后台权限
This commit is contained in:
53
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts
generated
vendored
Normal file
53
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* AJV-based JSON Schema validator provider
|
||||
*/
|
||||
import Ajv from 'ajv';
|
||||
import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js';
|
||||
/**
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use with default AJV instance (recommended)
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // Use with custom AJV instance
|
||||
* import { Ajv } from 'ajv';
|
||||
* const ajv = new Ajv({ strict: true, allErrors: true });
|
||||
* const validator = new AjvJsonSchemaValidator(ajv);
|
||||
* ```
|
||||
*/
|
||||
export declare class AjvJsonSchemaValidator implements jsonSchemaValidator {
|
||||
private _ajv;
|
||||
/**
|
||||
* Create an AJV validator
|
||||
*
|
||||
* @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use default configuration (recommended for most cases)
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // Or provide custom AJV instance for advanced configuration
|
||||
* import { Ajv } from 'ajv';
|
||||
* import addFormats from 'ajv-formats';
|
||||
*
|
||||
* const ajv = new Ajv({ validateFormats: true });
|
||||
* addFormats(ajv);
|
||||
* const validator = new AjvJsonSchemaValidator(ajv);
|
||||
* ```
|
||||
*/
|
||||
constructor(ajv?: Ajv);
|
||||
/**
|
||||
* Create a validator for the given JSON Schema
|
||||
*
|
||||
* The validator is compiled once and can be reused multiple times.
|
||||
* If the schema has an $id, it will be cached by AJV automatically.
|
||||
*
|
||||
* @param schema - Standard JSON Schema object
|
||||
* @returns A validator function that validates input data
|
||||
*/
|
||||
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
||||
}
|
||||
//# sourceMappingURL=ajv-provider.d.ts.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ajv-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAgBtH;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,YAAW,mBAAmB;IAC9D,OAAO,CAAC,IAAI,CAAM;IAElB;;;;;;;;;;;;;;;;;;;OAmBG;gBACS,GAAG,CAAC,EAAE,GAAG;IAIrB;;;;;;;;OAQG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAyBlE"}
|
||||
87
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
generated
vendored
Normal file
87
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
/**
|
||||
* AJV-based JSON Schema validator provider
|
||||
*/
|
||||
import Ajv from 'ajv';
|
||||
import _addFormats from 'ajv-formats';
|
||||
function createDefaultAjvInstance() {
|
||||
const ajv = new Ajv({
|
||||
strict: false,
|
||||
validateFormats: true,
|
||||
validateSchema: false,
|
||||
allErrors: true
|
||||
});
|
||||
const addFormats = _addFormats;
|
||||
addFormats(ajv);
|
||||
return ajv;
|
||||
}
|
||||
/**
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use with default AJV instance (recommended)
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // Use with custom AJV instance
|
||||
* import { Ajv } from 'ajv';
|
||||
* const ajv = new Ajv({ strict: true, allErrors: true });
|
||||
* const validator = new AjvJsonSchemaValidator(ajv);
|
||||
* ```
|
||||
*/
|
||||
export class AjvJsonSchemaValidator {
|
||||
/**
|
||||
* Create an AJV validator
|
||||
*
|
||||
* @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use default configuration (recommended for most cases)
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // Or provide custom AJV instance for advanced configuration
|
||||
* import { Ajv } from 'ajv';
|
||||
* import addFormats from 'ajv-formats';
|
||||
*
|
||||
* const ajv = new Ajv({ validateFormats: true });
|
||||
* addFormats(ajv);
|
||||
* const validator = new AjvJsonSchemaValidator(ajv);
|
||||
* ```
|
||||
*/
|
||||
constructor(ajv) {
|
||||
this._ajv = ajv ?? createDefaultAjvInstance();
|
||||
}
|
||||
/**
|
||||
* Create a validator for the given JSON Schema
|
||||
*
|
||||
* The validator is compiled once and can be reused multiple times.
|
||||
* If the schema has an $id, it will be cached by AJV automatically.
|
||||
*
|
||||
* @param schema - Standard JSON Schema object
|
||||
* @returns A validator function that validates input data
|
||||
*/
|
||||
getValidator(schema) {
|
||||
// Check if schema has $id and is already compiled/cached
|
||||
const ajvValidator = '$id' in schema && typeof schema.$id === 'string'
|
||||
? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema))
|
||||
: this._ajv.compile(schema);
|
||||
return (input) => {
|
||||
const valid = ajvValidator(input);
|
||||
if (valid) {
|
||||
return {
|
||||
valid: true,
|
||||
data: input,
|
||||
errorMessage: undefined
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
valid: false,
|
||||
data: undefined,
|
||||
errorMessage: this._ajv.errorsText(ajvValidator.errors)
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=ajv-provider.js.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ajv-provider.js","sourceRoot":"","sources":["../../../src/validation/ajv-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,WAAW,MAAM,aAAa,CAAC;AAGtC,SAAS,wBAAwB;IAC7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC;QAChB,MAAM,EAAE,KAAK;QACb,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,KAAK;QACrB,SAAS,EAAE,IAAI;KAClB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,WAAoD,CAAC;IACxE,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhB,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,sBAAsB;IAG/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,GAAS;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,wBAAwB,EAAE,CAAC;IAClD,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAI,MAAsB;QAClC,yDAAyD;QACzD,MAAM,YAAY,GACd,KAAK,IAAI,MAAM,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;YAC7C,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;YAChE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpC,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YAElC,IAAI,KAAK,EAAE,CAAC;gBACR,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;iBAC1D,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ"}
|
||||
51
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts
generated
vendored
Normal file
51
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Cloudflare Worker-compatible JSON Schema validator provider
|
||||
*
|
||||
* This provider uses @cfworker/json-schema for validation without code generation,
|
||||
* making it compatible with edge runtimes like Cloudflare Workers that restrict
|
||||
* eval and new Function.
|
||||
*/
|
||||
import type { JsonSchemaType, JsonSchemaValidator, jsonSchemaValidator } from './types.js';
|
||||
/**
|
||||
* JSON Schema draft version supported by @cfworker/json-schema
|
||||
*/
|
||||
export type CfWorkerSchemaDraft = '4' | '7' | '2019-09' | '2020-12';
|
||||
/**
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use with default configuration (2020-12, shortcircuit)
|
||||
* const validator = new CfWorkerJsonSchemaValidator();
|
||||
*
|
||||
* // Use with custom configuration
|
||||
* const validator = new CfWorkerJsonSchemaValidator({
|
||||
* draft: '2020-12',
|
||||
* shortcircuit: false // Report all errors
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export declare class CfWorkerJsonSchemaValidator implements jsonSchemaValidator {
|
||||
private shortcircuit;
|
||||
private draft;
|
||||
/**
|
||||
* Create a validator
|
||||
*
|
||||
* @param options - Configuration options
|
||||
* @param options.shortcircuit - If true, stop validation after first error (default: true)
|
||||
* @param options.draft - JSON Schema draft version to use (default: '2020-12')
|
||||
*/
|
||||
constructor(options?: {
|
||||
shortcircuit?: boolean;
|
||||
draft?: CfWorkerSchemaDraft;
|
||||
});
|
||||
/**
|
||||
* Create a validator for the given JSON Schema
|
||||
*
|
||||
* Unlike AJV, this validator is not cached internally
|
||||
*
|
||||
* @param schema - Standard JSON Schema object
|
||||
* @returns A validator function that validates input data
|
||||
*/
|
||||
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
||||
}
|
||||
//# sourceMappingURL=cfworker-provider.d.ts.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cfworker-provider.d.ts","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAA6B,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,qBAAa,2BAA4B,YAAW,mBAAmB;IACnE,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,KAAK,CAAsB;IAEnC;;;;;;OAMG;gBACS,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,mBAAmB,CAAA;KAAE;IAK7E;;;;;;;OAOG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAsBlE"}
|
||||
65
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js
generated
vendored
Normal file
65
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Cloudflare Worker-compatible JSON Schema validator provider
|
||||
*
|
||||
* This provider uses @cfworker/json-schema for validation without code generation,
|
||||
* making it compatible with edge runtimes like Cloudflare Workers that restrict
|
||||
* eval and new Function.
|
||||
*/
|
||||
import { Validator } from '@cfworker/json-schema';
|
||||
/**
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // Use with default configuration (2020-12, shortcircuit)
|
||||
* const validator = new CfWorkerJsonSchemaValidator();
|
||||
*
|
||||
* // Use with custom configuration
|
||||
* const validator = new CfWorkerJsonSchemaValidator({
|
||||
* draft: '2020-12',
|
||||
* shortcircuit: false // Report all errors
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export class CfWorkerJsonSchemaValidator {
|
||||
/**
|
||||
* Create a validator
|
||||
*
|
||||
* @param options - Configuration options
|
||||
* @param options.shortcircuit - If true, stop validation after first error (default: true)
|
||||
* @param options.draft - JSON Schema draft version to use (default: '2020-12')
|
||||
*/
|
||||
constructor(options) {
|
||||
this.shortcircuit = options?.shortcircuit ?? true;
|
||||
this.draft = options?.draft ?? '2020-12';
|
||||
}
|
||||
/**
|
||||
* Create a validator for the given JSON Schema
|
||||
*
|
||||
* Unlike AJV, this validator is not cached internally
|
||||
*
|
||||
* @param schema - Standard JSON Schema object
|
||||
* @returns A validator function that validates input data
|
||||
*/
|
||||
getValidator(schema) {
|
||||
// Cast to the cfworker Schema type - our JsonSchemaType is structurally compatible
|
||||
const validator = new Validator(schema, this.draft, this.shortcircuit);
|
||||
return (input) => {
|
||||
const result = validator.validate(input);
|
||||
if (result.valid) {
|
||||
return {
|
||||
valid: true,
|
||||
data: input,
|
||||
errorMessage: undefined
|
||||
};
|
||||
}
|
||||
else {
|
||||
return {
|
||||
valid: false,
|
||||
data: undefined,
|
||||
errorMessage: result.errors.map(err => `${err.instanceLocation}: ${err.error}`).join('; ')
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=cfworker-provider.js.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/cfworker-provider.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"cfworker-provider.js","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,2BAA2B;IAIpC;;;;;;OAMG;IACH,YAAY,OAAiE;QACzE,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAI,MAAsB;QAClC,mFAAmF;QACnF,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,MAAoD,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAErH,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7F,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ"}
|
||||
29
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts
generated
vendored
Normal file
29
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* JSON Schema validation
|
||||
*
|
||||
* This module provides configurable JSON Schema validation for the MCP SDK.
|
||||
* Choose a validator based on your runtime environment:
|
||||
*
|
||||
* - AjvJsonSchemaValidator: Best for Node.js (default, fastest)
|
||||
* Import from: @modelcontextprotocol/sdk/validation/ajv
|
||||
* Requires peer dependencies: ajv, ajv-formats
|
||||
*
|
||||
* - CfWorkerJsonSchemaValidator: Best for edge runtimes
|
||||
* Import from: @modelcontextprotocol/sdk/validation/cfworker
|
||||
* Requires peer dependency: @cfworker/json-schema
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // For Node.js with AJV
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // For Cloudflare Workers
|
||||
* import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker';
|
||||
* const validator = new CfWorkerJsonSchemaValidator();
|
||||
* ```
|
||||
*
|
||||
* @module validation
|
||||
*/
|
||||
export type { JsonSchemaType, JsonSchemaValidator, JsonSchemaValidatorResult, jsonSchemaValidator } from './types.js';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
||||
29
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js
generated
vendored
Normal file
29
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* JSON Schema validation
|
||||
*
|
||||
* This module provides configurable JSON Schema validation for the MCP SDK.
|
||||
* Choose a validator based on your runtime environment:
|
||||
*
|
||||
* - AjvJsonSchemaValidator: Best for Node.js (default, fastest)
|
||||
* Import from: @modelcontextprotocol/sdk/validation/ajv
|
||||
* Requires peer dependencies: ajv, ajv-formats
|
||||
*
|
||||
* - CfWorkerJsonSchemaValidator: Best for edge runtimes
|
||||
* Import from: @modelcontextprotocol/sdk/validation/cfworker
|
||||
* Requires peer dependency: @cfworker/json-schema
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // For Node.js with AJV
|
||||
* import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
|
||||
* const validator = new AjvJsonSchemaValidator();
|
||||
*
|
||||
* // For Cloudflare Workers
|
||||
* import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/cfworker';
|
||||
* const validator = new CfWorkerJsonSchemaValidator();
|
||||
* ```
|
||||
*
|
||||
* @module validation
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
|
||||
65
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts
generated
vendored
Normal file
65
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
import type { JSONSchema } from 'json-schema-typed';
|
||||
/**
|
||||
* JSON Schema type definition (JSON Schema Draft 2020-12)
|
||||
*
|
||||
* This uses the object form of JSON Schema (excluding boolean schemas).
|
||||
* While `true` and `false` are valid JSON Schemas, this SDK uses the
|
||||
* object form for practical type safety.
|
||||
*
|
||||
* Re-exported from json-schema-typed for convenience.
|
||||
* @see https://json-schema.org/draft/2020-12/json-schema-core.html
|
||||
*/
|
||||
export type JsonSchemaType = JSONSchema.Interface;
|
||||
/**
|
||||
* Result of a JSON Schema validation operation
|
||||
*/
|
||||
export type JsonSchemaValidatorResult<T> = {
|
||||
valid: true;
|
||||
data: T;
|
||||
errorMessage: undefined;
|
||||
} | {
|
||||
valid: false;
|
||||
data: undefined;
|
||||
errorMessage: string;
|
||||
};
|
||||
/**
|
||||
* A validator function that validates data against a JSON Schema
|
||||
*/
|
||||
export type JsonSchemaValidator<T> = (input: unknown) => JsonSchemaValidatorResult<T>;
|
||||
/**
|
||||
* Provider interface for creating validators from JSON Schemas
|
||||
*
|
||||
* This is the main extension point for custom validator implementations.
|
||||
* Implementations should:
|
||||
* - Support JSON Schema Draft 2020-12 (or be compatible with it)
|
||||
* - Return validator functions that can be called multiple times
|
||||
* - Handle schema compilation/caching internally
|
||||
* - Provide clear error messages on validation failure
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* class MyValidatorProvider implements jsonSchemaValidator {
|
||||
* getValidator<T>(schema: JsonSchemaType<T>): JsonSchemaValidator<T> {
|
||||
* // Compile/cache validator from schema
|
||||
* return (input: unknown) => {
|
||||
* // Validate input against schema
|
||||
* if (valid) {
|
||||
* return { valid: true, data: input as T, errorMessage: undefined };
|
||||
* } else {
|
||||
* return { valid: false, data: undefined, errorMessage: 'Error details' };
|
||||
* }
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export interface jsonSchemaValidator {
|
||||
/**
|
||||
* Create a validator for the given JSON Schema
|
||||
*
|
||||
* @param schema - Standard JSON Schema object
|
||||
* @returns A validator function that can be called multiple times
|
||||
*/
|
||||
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T>;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IACjC;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC;IAAC,YAAY,EAAE,SAAS,CAAA;CAAE,GACjD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,cAAc,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnE"}
|
||||
2
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js
generated
vendored
Normal file
2
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js.map
generated
vendored
Normal file
1
node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/validation/types.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user