UNPKG

ts-guoguo-mcp-server

Version:

裹裹寄件服务MCP Server - TypeScript版本,基于Model Context Protocol的寄件服务集成工具

25 lines 779 B
/** * API配置类 */ export class APIConfig { baseUrl; token; timeout; useMock; constructor(options = {}) { this.baseUrl = options.baseUrl || process.env.SHIPPING_API_BASE_URL || "https://pre-xg.cainiao.com/"; this.token = options.token || process.env.SHIPPING_API_TOKEN || "demo_token"; this.timeout = options.timeout || parseInt(process.env.SHIPPING_API_TIMEOUT || "30", 10); this.useMock = options.useMock !== undefined ? options.useMock : process.env.SHIPPING_USE_MOCK?.toLowerCase() === "true"; } /** * 获取HTTP请求头 */ get headers() { return { "token": this.token, "Content-Type": "application/json", }; } } //# sourceMappingURL=api-config.js.map