{"version":3,"file":"index.cjs","names":["message: string","status: number","code?: string","data?: any","validationErrors: any[]","interceptor: T","interceptors: T[]","interceptor: RequestInterceptor","interceptor: ResponseInterceptor","interceptor: ErrorInterceptor","url: string","options: RequestOptions","ctx: RequestInterceptorContext","response: Response","ctx: ResponseInterceptorContext","error: Error","response: Response | null","currentError: Error | void","ctx: ErrorInterceptorContext","token: string","logger: {\n    log: (message: string) => void\n  }","config: ClientConfig","path: string","query?: Record<string, string | number | boolean>","body: unknown","requestType: RequestContentType","response: Response","originalPath: string","finalUrl: string","requestOptions: RequestOptions","errorData: FollowAPIErrorResponse | null","contentType: string","textResponse","options: RequestOptions","response: Response | null","defaultHeaders: Record<string, string>","options?: Omit<RequestOptions, \"method\">","body?: unknown","options?: Omit<RequestOptions, \"method\" | \"body\">","formData: FormData | Record<string, unknown>","options?: Omit<RequestOptions, \"method\" | \"body\" | \"requestType\">","config: Partial<ClientConfig>","headers: Record<string, string>","fetchInstance: typeof fetch","method: HTTPMethod","path: string","options: {\n    /** Fields that should be sent as query parameters */\n    query?: readonly string[]\n    /** Fields that should be sent as request body */\n    body?: readonly string[]\n    input?: TInput\n    response?: TResponse\n    requestType?: RequestContentType\n    responseType?: ResponseContentType\n  }","params: string[]","definition: {\n  name: string\n  prefix?: string\n  routes: TRoutes\n}","path: string","routes: NestedRoutes","flattened: Record<string, RouteDefinition>","value: any","client: HttpClient","routes: Map<string, RouteDefinition>","target: any","propKey: string | symbol","prefix: string","routeKey: string","route: RouteDefinition","args: RouteArgs","params: Record<string, string>","query: Record<string, string | number | boolean>","body: unknown","bodyData: Record<string, any>","requestOptions: RequestOptions","module: ModuleDefinition<any>","module","config: FollowClientConfig","token: string","headers: Record<string, string>","fetchInstance: typeof fetch","config: Partial<FollowClientConfig>","path: string","options?: RequestOptions","requests: readonly [...T]","config?: Partial<FollowClientConfig>","interceptor: RequestInterceptor","interceptor: ResponseInterceptor","interceptor: ErrorInterceptor","response: ResponseStruct<T>","response: ResponseStruct<any>"],"sources":["../src/types/errors.ts","../src/client/interceptors.ts","../src/client/base.ts","../src/shared/define-module.ts","../src/modules/achievement/index.ts","../src/modules/admin/index.ts","../src/modules/ai/index.ts","../src/modules/boosts/index.ts","../src/modules/categories/index.ts","../src/modules/collections/index.ts","../src/modules/data/index.ts","../src/modules/discover/index.ts","../src/modules/entries/index.ts","../src/modules/feeds/index.ts","../src/modules/inboxes/index.ts","../src/modules/invitations/index.ts","../src/modules/lists/index.ts","../src/modules/mcp/index.ts","../src/modules/messaging/index.ts","../src/modules/probes/index.ts","../src/modules/profiles/index.ts","../src/modules/reads/index.ts","../src/modules/referrals/index.ts","../src/modules/rsshub/index.ts","../src/modules/settings/index.ts","../src/modules/status/index.ts","../src/modules/subscriptions/index.ts","../src/modules/trending/index.ts","../src/modules/upload/index.ts","../src/modules/wallets/index.ts","../src/modules/registry.ts","../src/shared/route-resolver.ts","../src/client/proxy.ts","../src/client/core.ts","../src/helper/index.ts","../src/modules/actions/index.ts"],"sourcesContent":["/**\n * Base error class for all Follow API errors\n */\nexport class FollowAPIError extends Error {\n  constructor(\n    message: string,\n    public status: number,\n    public code?: string,\n    public data?: any,\n  ) {\n    super(message)\n    this.name = \"FollowAPIError\"\n  }\n}\n\nexport class NetworkError extends Error {\n  constructor(message: string) {\n    super(message)\n    this.name = \"NetworkError\"\n  }\n}\n/**\n * Authentication error for Follow API\n */\nexport class FollowAuthError extends FollowAPIError {\n  constructor(message = \"Authentication required\", data?: any) {\n    super(message, 401, \"AUTH_REQUIRED\", data)\n    this.name = \"FollowAuthError\"\n  }\n}\n\n/**\n * Validation error for Follow API requests\n */\nexport class FollowValidationError extends FollowAPIError {\n  constructor(\n    message: string,\n    public validationErrors: any[],\n  ) {\n    super(message, 400, \"VALIDATION_ERROR\")\n    this.name = \"FollowValidationError\"\n    this.data = validationErrors\n  }\n}\n\n/**\n * Network timeout error\n */\nexport class FollowTimeoutError extends FollowAPIError {\n  constructor(message = \"Request timeout\") {\n    super(message, 408, \"TIMEOUT_ERROR\")\n    this.name = \"FollowTimeoutError\"\n  }\n}\n","import type { RequestOptions } from \"../types\"\n\n/**\n * Base context object shared by all interceptors\n */\ninterface BaseInterceptorContext {\n  url: string\n  options: RequestOptions\n}\n\n/**\n * Context object passed to request interceptors\n */\nexport interface RequestInterceptorContext extends BaseInterceptorContext {}\n\n/**\n * Context object passed to response interceptors\n */\nexport interface ResponseInterceptorContext extends BaseInterceptorContext {\n  response: Response\n}\n\n/**\n * Context object passed to error interceptors\n */\nexport interface ErrorInterceptorContext extends BaseInterceptorContext {\n  response: Response | null\n  error: Error\n}\n\n/**\n * Request interceptor function type\n */\nexport type RequestInterceptor = (\n  ctx: RequestInterceptorContext,\n) =>\n  | Promise<{ url: string, options: RequestOptions }> |\n  { url: string, options: RequestOptions }\n\n/**\n * Response interceptor function type\n */\nexport type ResponseInterceptor = (\n  ctx: ResponseInterceptorContext,\n) => Promise<Response> | Response\n\n/**\n * Error interceptor function type\n */\nexport type ErrorInterceptor = (\n  ctx: ErrorInterceptorContext,\n) => Promise<Error | void> | Error | void\n\n/**\n * Interceptor manager for handling request/response middleware\n */\nexport class InterceptorManager {\n  private requestInterceptors: RequestInterceptor[] = []\n  private responseInterceptors: ResponseInterceptor[] = []\n  private errorInterceptors: ErrorInterceptor[] = []\n\n  /**\n   * Generic method to add an interceptor to any array and return a cleanup function\n   */\n  private addInterceptor<T>(interceptor: T, interceptors: T[]): () => void {\n    interceptors.push(interceptor)\n    return () => {\n      const index = interceptors.indexOf(interceptor)\n      if (index !== -1) {\n        interceptors.splice(index, 1)\n      }\n    }\n  }\n\n  /**\n   * Add a request interceptor\n   */\n  addRequestInterceptor(interceptor: RequestInterceptor): () => void {\n    return this.addInterceptor(interceptor.bind(null), this.requestInterceptors)\n  }\n\n  /**\n   * Add a response interceptor\n   */\n  addResponseInterceptor(interceptor: ResponseInterceptor): () => void {\n    return this.addInterceptor(interceptor.bind(null), this.responseInterceptors)\n  }\n\n  /**\n   * Add an error interceptor\n   */\n  addErrorInterceptor(interceptor: ErrorInterceptor): () => void {\n    return this.addInterceptor(interceptor.bind(null), this.errorInterceptors)\n  }\n\n  /**\n   * Process request through all request interceptors\n   */\n  async processRequest(\n    url: string,\n    options: RequestOptions,\n  ): Promise<{ url: string, options: RequestOptions }> {\n    let currentUrl = url\n    let currentOptions = options\n\n    for (const interceptor of this.requestInterceptors) {\n      const ctx: RequestInterceptorContext = {\n        url: currentUrl,\n        options: currentOptions,\n      }\n      const result = (await interceptor(ctx)) || ctx\n      currentUrl = result.url\n      currentOptions = result.options\n    }\n\n    return { url: currentUrl, options: currentOptions }\n  }\n\n  /**\n   * Process response through all response interceptors\n   */\n  async processResponse(\n    response: Response,\n    url: string,\n    options: RequestOptions,\n  ): Promise<Response> {\n    let currentResponse = response\n\n    for (const interceptor of this.responseInterceptors) {\n      const ctx: ResponseInterceptorContext = {\n        url,\n        options,\n        response: currentResponse,\n      }\n      const returnedResponse = await interceptor(ctx)\n      if (returnedResponse instanceof Response) {\n        currentResponse = returnedResponse\n      }\n      // If interceptor returns undefined, it means the response should not be modified\n    }\n\n    return currentResponse\n  }\n\n  /**\n   * Process error through all error interceptors\n   */\n  async processError(\n    error: Error,\n    response: Response | null,\n    url: string,\n    options: RequestOptions,\n  ): Promise<Error | void> {\n    let currentError: Error | void = error\n\n    for (const interceptor of this.errorInterceptors) {\n      const ctx: ErrorInterceptorContext = {\n        url,\n        options,\n        response,\n        error: currentError || error,\n      }\n      const result = await interceptor(ctx)\n      if (result !== undefined) {\n        currentError = result\n      } else {\n        // If interceptor returns undefined, it means the error should be handled/suppressed\n        currentError = undefined\n        break\n      }\n    }\n\n    return currentError\n  }\n\n  /**\n   * Clear all interceptors\n   */\n  clear(): void {\n    this.requestInterceptors = []\n    this.responseInterceptors = []\n    this.errorInterceptors = []\n  }\n}\n\n/**\n * Common interceptors for Follow API\n */\nexport const commonInterceptors = {\n  /**\n   * Add authentication token to requests\n   */\n  addAuthToken: (token: string): RequestInterceptor => {\n    return (ctx) => {\n      return {\n        url: ctx.url,\n        options: {\n          ...ctx.options,\n          headers: {\n            ...ctx.options.headers,\n            Authorization: `Bearer ${token}`,\n          },\n        },\n      }\n    }\n  },\n\n  /**\n   * Log all requests\n   */\n  logRequests: (logger: {\n    log: (message: string) => void\n  }): RequestInterceptor => {\n    return (ctx) => {\n      logger.log(`Request: ${ctx.options.method || \"GET\"} ${ctx.url}`)\n      return { url: ctx.url, options: ctx.options }\n    }\n  },\n\n  /**\n   * Log all responses\n   */\n  logResponses: (logger: {\n    log: (message: string) => void\n  }): ResponseInterceptor => {\n    return (ctx) => {\n      logger.log(\n        `Response: ${ctx.response.status} ${ctx.options.method || \"GET\"} ${ctx.url}`,\n      )\n      return ctx.response\n    }\n  },\n\n  /**\n   * Retry failed requests\n   */\n  retryOnError: (maxRetries = 3, delay = 1000): ErrorInterceptor => {\n    const retryCount = new WeakMap<Error, number>()\n\n    return async (ctx) => {\n      const currentRetries = retryCount.get(ctx.error) || 0\n\n      if (currentRetries < maxRetries) {\n        retryCount.set(ctx.error, currentRetries + 1)\n\n        // Wait before retry\n        await new Promise((resolve) =>\n          setTimeout(resolve, delay * (currentRetries + 1)),\n        )\n\n        // Return undefined to indicate retry should happen\n        return\n      }\n\n      // Max retries exceeded, return the error\n      return ctx.error\n    }\n  },\n}\n","import type {\n  ClientConfig,\n  FollowAPIErrorResponse,\n  FollowAPIResponse,\n  RequestContentType,\n  RequestOptions,\n} from \"../types\"\nimport {\n  FollowAPIError,\n  FollowAuthError,\n  FollowTimeoutError,\n  FollowValidationError,\n} from \"../types/errors\"\nimport { InterceptorManager } from \"./interceptors\"\n\n/**\n * Core HTTP client for Follow API using native fetch\n */\nexport class HttpClient {\n  private config: Required<ClientConfig>\n  private fetchInstance: typeof fetch\n  private interceptors: InterceptorManager\n\n  constructor(config: ClientConfig) {\n    this.config = {\n      timeout: 30000,\n      headers: {},\n      credentials: \"include\",\n      fetch: globalThis.fetch,\n      ...config,\n    }\n    this.fetchInstance = this.config.fetch\n    this.interceptors = new InterceptorManager()\n  }\n\n  /**\n   * Build URL with query parameters\n   */\n  private buildURL(\n    path: string,\n    query?: Record<string, string | number | boolean>,\n  ): string {\n    const url = new URL(path, this.config.baseURL)\n\n    if (query) {\n      Object.entries(query).forEach(([key, value]) => {\n        if (value !== undefined && value !== null) {\n          url.searchParams.append(key, String(value))\n        }\n      })\n    }\n\n    return url.toString()\n  }\n\n  /**\n   * Process request body based on content type\n   */\n  private processRequestBody(\n    body: unknown,\n    requestType: RequestContentType = \"json\",\n  ): { processedBody: BodyInit | undefined, headers: Record<string, string> } {\n    if (!body) {\n      return { processedBody: undefined, headers: {} }\n    }\n\n    switch (requestType) {\n      case \"json\": {\n        return {\n          processedBody: JSON.stringify(body),\n          headers: { \"Content-Type\": \"application/json\" },\n        }\n      }\n\n      case \"formData\": {\n        if (body instanceof FormData) {\n          return { processedBody: body, headers: {} }\n        }\n        if (typeof body === \"object\" && body !== null) {\n          const formData = new FormData()\n          Object.entries(body).forEach(([key, value]) => {\n            if (value instanceof File || value instanceof Blob) {\n              formData.append(key, value)\n            } else if (value !== undefined && value !== null) {\n              formData.append(key, String(value))\n            }\n          })\n          return { processedBody: formData, headers: {} }\n        }\n        throw new Error(\"Invalid body type for formData request\")\n      }\n\n      case \"text\": {\n        return {\n          processedBody: typeof body === \"string\" ? body : String(body),\n          headers: { \"Content-Type\": \"text/plain\" },\n        }\n      }\n\n      case \"blob\": {\n        if (body instanceof Blob) {\n          return { processedBody: body, headers: {} }\n        }\n        throw new Error(\"Body must be a Blob for blob request type\")\n      }\n\n      case \"arrayBuffer\": {\n        if (body instanceof ArrayBuffer) {\n          return {\n            processedBody: body,\n            headers: { \"Content-Type\": \"application/octet-stream\" },\n          }\n        }\n        throw new Error(\n          \"Body must be an ArrayBuffer for arrayBuffer request type\",\n        )\n      }\n\n      default: {\n        throw new Error(`Unsupported request type: ${requestType}`)\n      }\n    }\n  }\n\n  /**\n   * Handle response parsing and error handling\n   */\n  private async handleResponse<T>(\n    response: Response,\n    originalPath: string,\n    finalUrl: string,\n    requestOptions: RequestOptions,\n  ): Promise<T> {\n    const contentType = response.headers.get(\"content-type\") || \"\"\n\n    if (!response.ok) {\n      let errorData: FollowAPIErrorResponse | null = null\n\n      // Try to parse error response\n      if (contentType.includes(\"application/json\")) {\n        try {\n          errorData = await response.json()\n        } catch {\n          // Fall back to status text if JSON parsing fails\n          errorData = { code: response.status, message: response.statusText }\n        }\n      } else {\n        errorData = { code: response.status, message: response.statusText }\n      }\n\n      // Extract pathname from final URL for error context\n      const finalPathname = new URL(finalUrl).pathname\n\n      // Create detailed error context\n      const requestContext = {\n        originalPath,\n        finalPathname,\n        method: requestOptions.method || \"GET\",\n        query: requestOptions.query,\n        body: requestOptions.body,\n        headers: requestOptions.headers,\n      }\n\n      const contextStr = `${requestContext.method} ${finalPathname} (original: ${originalPath})`\n      const argsStr = JSON.stringify(\n        {\n          query: requestContext.query,\n          body: requestContext.body,\n          headers: requestContext.headers,\n        },\n        null,\n        2,\n      )\n\n      // Handle specific error types\n      if (response.status === 401) {\n        throw new FollowAuthError(\n          `${errorData?.message || \"Authentication required\"}\\nRequest: ${contextStr}\\nArgs: ${argsStr}`,\n          errorData,\n        )\n      }\n\n      if (response.status === 400 && errorData?.data) {\n        throw new FollowValidationError(\n          `${errorData.message || \"Validation error\"}\\nRequest: ${contextStr}\\nArgs: ${argsStr}`,\n          Array.isArray(errorData.data) ? errorData.data : [errorData.data],\n        )\n      }\n\n      throw new FollowAPIError(\n        `${errorData?.message || response.statusText}\\nRequest: ${contextStr}\\nArgs: ${argsStr}`,\n        response.status,\n        errorData?.code?.toString(),\n        errorData?.data,\n      )\n    }\n\n    // Handle successful responses based on content type\n    return this.parseResponseByContentType<T>(\n      response,\n      contentType,\n    )\n  }\n\n  /**\n   * Parse response based on content type\n   */\n  private async parseResponseByContentType<T>(\n    response: Response,\n    contentType: string,\n  ): Promise<T> {\n    // Handle event stream\n    if (contentType.includes(\"text/event-stream\")) {\n      return response as unknown as T\n    }\n\n    // Handle JSON responses\n    if (contentType.includes(\"application/json\")) {\n      const jsonResponse = await response.json()\n\n      // Handle Follow API response format\n      if (typeof jsonResponse === \"object\" && \"code\" in jsonResponse) {\n        const apiResponse = jsonResponse as FollowAPIResponse<T>\n\n        return apiResponse as unknown as T\n      }\n\n      return jsonResponse\n    }\n\n    // Handle blob responses\n    if (\n      contentType.includes(\"application/octet-stream\") ||\n      contentType.includes(\"image/\") ||\n      contentType.includes(\"video/\") ||\n      contentType.includes(\"audio/\")\n    ) {\n      const blobResponse = await response.blob()\n      return blobResponse as unknown as T\n    }\n\n    // Handle text responses\n    if (contentType.includes(\"text/\")) {\n      const textResponse = await response.text()\n      return textResponse as T\n    }\n\n    // Default to arrayBuffer for unknown binary types\n    if (contentType.includes(\"application/\")) {\n      const arrayBufferResponse = await response.arrayBuffer()\n      return arrayBufferResponse as unknown as T\n    }\n\n    // Fallback to text\n    const textResponse = await response.text()\n    return textResponse as T\n  }\n\n  /**\n   * Make an HTTP request\n   */\n  async request<T>(path: string, options: RequestOptions = {}): Promise<T> {\n    let currentUrl = this.buildURL(path, options.query)\n    let currentOptions = options\n    let response: Response | null = null\n\n    try {\n      // Process request interceptors\n      const interceptedRequest = await this.interceptors.processRequest(\n        currentUrl,\n        currentOptions,\n      )\n      currentUrl = interceptedRequest.url\n      currentOptions = interceptedRequest.options\n\n      const timeout = currentOptions.timeout || this.config.timeout\n\n      // Create abort controller for timeout\n      const controller = new AbortController()\n      const timeoutId = setTimeout(() => controller.abort(), timeout)\n\n      // Combine signals if user provided one\n      let { signal } = controller\n      if (currentOptions.signal) {\n        const combinedController = new AbortController()\n        const cleanup = () => {\n          clearTimeout(timeoutId)\n          combinedController.abort()\n        }\n\n        currentOptions.signal.addEventListener(\"abort\", cleanup)\n        controller.signal.addEventListener(\"abort\", cleanup)\n\n        signal = combinedController.signal\n      }\n\n      // Process request body based on content type\n      const { processedBody, headers: bodyHeaders } = this.processRequestBody(\n        currentOptions.body,\n        currentOptions.requestType,\n      )\n\n      const defaultHeaders: Record<string, string> = processedBody ?\n          {} :\n          { \"Content-Type\": \"application/json\" }\n\n      response = await this.fetchInstance(currentUrl, {\n        method: currentOptions.method || \"GET\",\n        headers: {\n          ...defaultHeaders,\n          ...this.config.headers,\n          ...bodyHeaders,\n          ...currentOptions.headers,\n        },\n        credentials: this.config.credentials,\n        body: processedBody,\n        signal,\n      })\n\n      clearTimeout(timeoutId)\n\n      // Process response interceptors\n      const interceptedResponse = await this.interceptors.processResponse(\n        response,\n        currentUrl,\n        currentOptions,\n      )\n\n      return this.handleResponse<T>(\n        interceptedResponse,\n        path,\n        currentUrl,\n        currentOptions,\n      )\n    } catch (error) {\n      const processedError = await this.interceptors.processError(\n        error instanceof Error ? error : new Error(\"Unknown error\"),\n        response,\n        currentUrl,\n        currentOptions,\n      )\n\n      if (processedError) {\n        throw processedError\n      }\n\n      // Handle specific error types\n      if (error instanceof DOMException && error.name === \"AbortError\") {\n        throw new FollowTimeoutError(\"Request timeout\")\n      }\n\n      // Re-throw our custom errors\n      if (error instanceof FollowAPIError) {\n        throw error\n      }\n\n      throw error\n    }\n  }\n\n  /**\n   * Convenience methods for different HTTP verbs\n   */\n  async get<T>(\n    path: string,\n    options?: Omit<RequestOptions, \"method\">,\n  ): Promise<T> {\n    return this.request<T>(path, { ...options, method: \"GET\" })\n  }\n\n  async post<T>(\n    path: string,\n    body?: unknown,\n    options?: Omit<RequestOptions, \"method\" | \"body\">,\n  ): Promise<T> {\n    return this.request<T>(path, { ...options, method: \"POST\", body })\n  }\n\n  async put<T>(\n    path: string,\n    body?: unknown,\n    options?: Omit<RequestOptions, \"method\" | \"body\">,\n  ): Promise<T> {\n    return this.request<T>(path, { ...options, method: \"PUT\", body })\n  }\n\n  async patch<T>(\n    path: string,\n    body?: unknown,\n    options?: Omit<RequestOptions, \"method\" | \"body\">,\n  ): Promise<T> {\n    return this.request<T>(path, { ...options, method: \"PATCH\", body })\n  }\n\n  /**\n   * Convenience method for form data uploads\n   */\n  async postForm<T>(\n    path: string,\n    formData: FormData | Record<string, unknown>,\n    options?: Omit<RequestOptions, \"method\" | \"body\" | \"requestType\">,\n  ): Promise<T> {\n    return this.request<T>(path, {\n      ...options,\n      method: \"POST\",\n      body: formData,\n      requestType: \"formData\",\n    })\n  }\n\n  /**\n   * Convenience method for event stream responses\n   */\n  async getStream(\n    path: string,\n    options?: Omit<RequestOptions, \"method\">,\n  ): Promise<Response> {\n    return this.request<Response>(path, { ...options, method: \"GET\" })\n  }\n\n  async delete<T>(\n    path: string,\n    options?: Omit<RequestOptions, \"method\">,\n  ): Promise<T> {\n    return this.request<T>(path, { ...options, method: \"DELETE\" })\n  }\n\n  /**\n   * Update client configuration\n   */\n  setConfig(config: Partial<ClientConfig>): void {\n    this.config = { ...this.config, ...config }\n    if (config.fetch) {\n      this.fetchInstance = config.fetch\n    }\n  }\n\n  /**\n   * Set additional headers\n   */\n  setHeaders(headers: Record<string, string>): void {\n    this.config.headers = { ...this.config.headers, ...headers }\n  }\n\n  /**\n   * Set custom fetch instance\n   */\n  setFetch(fetchInstance: typeof fetch): void {\n    this.fetchInstance = fetchInstance\n    this.config.fetch = fetchInstance\n  }\n\n  /**\n   * Get current configuration (readonly)\n   */\n  getConfig(): Readonly<Required<ClientConfig>> {\n    return { ...this.config }\n  }\n\n  /**\n   * Get interceptor manager for advanced usage\n   */\n  getInterceptors(): InterceptorManager {\n    return this.interceptors\n  }\n}\n","/* eslint-disable @typescript-eslint/no-empty-object-type */\nimport type {\n  HTTPMethod,\n  RequestContentType,\n  ResponseContentType,\n} from \"../types\"\n\n/**\n * Route definition with type annotations\n */\nexport interface RouteDefinition<TInput = any, TResponse = any> {\n  method: HTTPMethod\n  path: string\n  params?: readonly string[]\n  /** Fields that should be sent as query parameters */\n  query?: readonly string[]\n  /** Fields that should be sent as request body */\n  body?: readonly string[]\n  input?: TInput\n  response?: TResponse\n  requestType?: RequestContentType\n  responseType?: ResponseContentType\n}\n\n/**\n * Nested routes structure - supports any depth of nesting\n */\nexport type NestedRoutes = {\n  [key: string]: RouteDefinition | NestedRoutes\n}\n\n/**\n * Module definition interface\n */\nexport interface ModuleDefinition<TRoutes extends NestedRoutes> {\n  name: string\n  prefix?: string\n  routes: TRoutes\n  api: ModuleAPI<TRoutes>\n}\n\n/**\n * Fetch options for route requests\n */\ninterface FetchOptions {\n  headers?: Record<string, string>\n  timeout?: number\n  signal?: AbortSignal\n}\n\n/**\n * Check if arguments are required\n */\ntype IsRequired<TInput> = [TInput] extends [never] ?\n  false :\n    {} extends TInput ?\n      false :\n      true\n\n/**\n * Route function with proper argument requirements\n */\nexport type RouteFunction<TInput, TResponse> =\n  IsRequired<TInput> extends true ?\n      (args: TInput, options?: FetchOptions) => Promise<TResponse> :\n      (args?: TInput, options?: FetchOptions) => Promise<TResponse>\n\n/**\n * Generate API types from route structure\n */\nexport type ModuleAPI<TRoutes> = {\n  [K in keyof TRoutes]: TRoutes[K] extends RouteDefinition<\n    infer TInput,\n    infer TResponse\n  > ?\n    RouteFunction<TInput, TResponse> :\n    TRoutes[K] extends NestedRoutes ?\n      ModuleAPI<TRoutes[K]> :\n      never;\n}\n\n/**\n * Legacy route args interface for backward compatibility\n */\nexport interface LegacyRouteArgs {\n  params?: Record<string, string>\n  query?: Record<string, string | number | boolean>\n  body?: unknown\n  headers?: Record<string, string>\n  timeout?: number\n  signal?: AbortSignal\n}\n\n/**\n * Helper function to define a single route with proper type inference\n */\nexport function defineRoute<TInput = never, TResponse = never>(\n  method: HTTPMethod,\n  path: string,\n  options: {\n    /** Fields that should be sent as query parameters */\n    query?: readonly string[]\n    /** Fields that should be sent as request body */\n    body?: readonly string[]\n    input?: TInput\n    response?: TResponse\n    requestType?: RequestContentType\n    responseType?: ResponseContentType\n  } = {},\n): RouteDefinition<TInput, TResponse> {\n  // Extract parameters from path string\n  const params = extractParamsFromPath(path)\n\n  return {\n    method,\n    path,\n    params: params.length > 0 ? params : undefined,\n    query: options.query,\n    body: options.body,\n    input: options.input,\n    response: options.response,\n    requestType: options.requestType,\n    responseType: options.responseType,\n  }\n}\n\n/**\n * Extract parameter names from a path string\n * e.g. \"/users/{userId}/posts\" -> [\"userId\"]\n */\nfunction extractParamsFromPath(path: string): string[] {\n  const paramRegex = /\\{([^}]+)\\}/g\n  const params: string[] = []\n  let match\n\n  while ((match = paramRegex.exec(path)) !== null) {\n    params.push(match[1])\n  }\n\n  return params\n}\n\n/**\n * Helper type to infer params from path string\n */\nexport type InferParams<T extends string> =\n  T extends `${string}{${infer Param}}${infer Rest}` ?\n    { [K in Param]: string } & InferParams<Rest> :\n      {}\n\n/**\n * Define a module with routes and metadata\n */\nexport function defineModule<TRoutes extends NestedRoutes>(definition: {\n  name: string\n  prefix?: string\n  routes: TRoutes\n}): ModuleDefinition<TRoutes> {\n  return {\n    ...definition,\n    api: {} as ModuleAPI<TRoutes>, // Will be created by proxy\n  }\n}\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  AuditAchievementRequest,\n  AuditAchievementResponse,\n  CheckAchievementRequest,\n  CheckAchievementResponse,\n  ClaimAchievementRequest,\n  ClaimAchievementResponse,\n  ListAchievementsRequest,\n  ListAchievementsResponse,\n} from \"./types\"\n\n/**\n * Achievement module for user achievement management\n */\nexport const achievementModule = defineModule({\n  name: \"achievement\",\n  prefix: \"/achievement\",\n  routes: {\n    // List user achievements\n    list: defineRoute<ListAchievementsRequest, ListAchievementsResponse>(\n      \"GET\",\n      \"/\",\n    ),\n\n    // Claim/receive achievement reward\n    claim: defineRoute<ClaimAchievementRequest, ClaimAchievementResponse>(\n      \"PUT\",\n      \"/\",\n    ),\n\n    // Check achievement status\n    check: defineRoute<CheckAchievementRequest, CheckAchievementResponse>(\n      \"POST\",\n      \"/check\",\n    ),\n\n    // Submit achievement for audit\n    audit: defineRoute<AuditAchievementRequest, AuditAchievementResponse>(\n      \"POST\",\n      \"/audit\",\n    ),\n  },\n})\n\n// Export the API type\nexport type AchievementAPI = typeof achievementModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  AffectedUsersInput,\n  AffectedUsersResponse,\n  CleanRequest,\n  CleanResponse,\n  FeatureFlagListResponse,\n  FeatureFlagResponse,\n  FeatureFlagUpdateInput,\n  FeatureStatsInput,\n  FeatureStatsResponse,\n  MessageResponse,\n  MintRequest,\n  MintResponse,\n  RemoveOverrideInput,\n  UserOverrideInput,\n} from \"./types\"\n\n/**\n * Admin module definition with nested routes\n */\nexport const adminModule = defineModule({\n  name: \"admin\",\n  prefix: \"/admin\",\n  routes: {\n    // Feature flags management (nested)\n    featureFlags: {\n      list: defineRoute<never, FeatureFlagListResponse>(\n        \"GET\",\n        \"/feature-flags\",\n      ),\n\n      update: defineRoute<FeatureFlagUpdateInput, FeatureFlagResponse>(\n        \"PUT\",\n        \"/feature-flags/{name}\",\n      ),\n\n      override: defineRoute<UserOverrideInput, MessageResponse>(\n        \"POST\",\n        \"/feature-flags/{name}/overrides\",\n      ),\n\n      removeOverride: defineRoute<RemoveOverrideInput, MessageResponse>(\n        \"DELETE\",\n        \"/feature-flags/{name}/overrides/{userId}\",\n      ),\n\n      stats: defineRoute<FeatureStatsInput, FeatureStatsResponse>(\n        \"GET\",\n        \"/feature-flags/{name}/stats\",\n      ),\n\n      affectedUsers: defineRoute<AffectedUsersInput, AffectedUsersResponse>(\n        \"GET\",\n        \"/feature-flags/{name}/affected-users\",\n      ),\n    },\n\n    // Clean operations (nested)\n    clean: {\n      execute: defineRoute<CleanRequest, CleanResponse>(\"POST\", \"/clean\"),\n    },\n\n    // Mint operations (nested)\n    mint: {\n      execute: defineRoute<MintRequest, MintResponse>(\"POST\", \"/mintdscsafr\"),\n    },\n  },\n})\n\n// Export the API type\nexport type AdminAPI = typeof adminModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  ChatRequest,\n  ChatResponse,\n  ConfigResponse,\n  DailyRequest,\n  DailyResponse,\n  SummaryRequest,\n  SummaryResponse,\n  TitleRequest,\n  TitleResponse,\n  TranslationRequest,\n  TranslationResponse,\n  UsageRequest,\n  UsageResponse,\n} from \"./types\"\n\n/**\n * AI module definition with nested AI-powered features\n */\nexport const aiModule = defineModule({\n  name: \"ai\",\n  prefix: \"/ai\",\n  routes: {\n    // AI chat interface - streaming response\n    chat: defineRoute<ChatRequest, ChatResponse>(\"POST\", \"/chat\"),\n\n    // Content summarization\n    summary: defineRoute<SummaryRequest, SummaryResponse>(\"GET\", \"/summary\"),\n\n    // Content translation\n    translation: defineRoute<TranslationRequest, TranslationResponse>(\n      \"GET\",\n      \"/translation\",\n    ),\n\n    // Title generation for chat/content\n    summaryTitle: defineRoute<TitleRequest, TitleResponse>(\n      \"POST\",\n      \"/summary-title\",\n    ),\n\n    // Daily summaries\n    daily: defineRoute<DailyRequest, DailyResponse>(\"GET\", \"/daily\"),\n\n    usage: defineRoute<UsageRequest, UsageResponse>(\"GET\", \"/usage\"),\n\n    // AI chat configuration\n    config: defineRoute<never, ConfigResponse>(\"GET\", \"/chat/config\"),\n  },\n})\n\n// Export the API type\nexport type AIAPI = typeof aiModule.api\n\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  BoostFeedRequest,\n  BoostFeedResponse,\n  GetFeedBoostersRequest,\n  GetFeedBoostersResponse,\n  GetFeedBoostLevelRequest,\n  GetFeedBoostLevelResponse,\n} from \"./types\"\n\n/**\n * Boosts module for content boosting with power tokens\n */\nexport const boostsModule = defineModule({\n  name: \"boosts\",\n  prefix: \"/boosts\",\n  routes: {\n    // Get boost level information for a feed\n    getFeedBoostLevel: defineRoute<\n      GetFeedBoostLevelRequest,\n      GetFeedBoostLevelResponse\n    >(\"GET\", \"/\"),\n\n    // Boost a feed with power tokens\n    boostFeed: defineRoute<BoostFeedRequest, BoostFeedResponse>(\"POST\", \"/\"),\n\n    // Get list of users who boosted a feed\n    getFeedBoosters: defineRoute<\n      GetFeedBoostersRequest,\n      GetFeedBoostersResponse\n    >(\"GET\", \"/boosters\"),\n  },\n})\n\n// Export the API type\nexport type BoostsAPI = typeof boostsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CategoriesGetQuery,\n  CategoriesGetResponse,\n  CategoryDeleteRequest,\n  CategoryDeleteResponse,\n  CategoryPatchRequest,\n  CategoryPatchResponse,\n} from \"./types\"\n\n/**\n * Categories module definition - Subscription categorization\n */\nexport const categoriesModule = defineModule({\n  name: \"categories\",\n  prefix: \"/categories\",\n  routes: {\n    // Get user categories\n    get: defineRoute<CategoriesGetQuery, CategoriesGetResponse>(\"GET\", \"/\"),\n\n    // Update category for subscription\n    update: defineRoute<CategoryPatchRequest, CategoryPatchResponse>(\n      \"PATCH\",\n      \"/\",\n    ),\n\n    // Delete category\n    delete: defineRoute<CategoryDeleteRequest, CategoryDeleteResponse>(\n      \"DELETE\",\n      \"/\",\n    ),\n  },\n})\n\n// Export the API type\nexport type CategoriesAPI = typeof categoriesModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CollectionCheckQuery,\n  CollectionCheckResponse,\n  CollectionCreateRequest,\n  CollectionCreateResponse,\n  CollectionDeleteRequest,\n  CollectionDeleteResponse,\n} from \"./types\"\n\n/**\n * Collections module definition - Content collections management\n */\nexport const collectionsModule = defineModule({\n  name: \"collections\",\n  prefix: \"/collections\",\n  routes: {\n    // Check if entry is in collection\n    get: defineRoute<CollectionCheckQuery, CollectionCheckResponse>(\"GET\", \"/\"),\n\n    // Add entry to collection\n    post: defineRoute<CollectionCreateRequest, CollectionCreateResponse>(\n      \"POST\",\n      \"/\",\n    ),\n\n    // Remove entry from collection\n    delete: defineRoute<CollectionDeleteRequest, CollectionDeleteResponse>(\n      \"DELETE\",\n      \"/\",\n    ),\n  },\n})\n\n// Export the API type\nexport type CollectionsAPI = typeof collectionsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type { ExportDataRequest, ExportDataResponse } from \"./types\"\n\n/**\n * Data module for data export operations\n */\nexport const dataModule = defineModule({\n  name: \"data\",\n  prefix: \"/data\",\n  routes: {\n    // Export user data\n    export: defineRoute<ExportDataRequest, ExportDataResponse>(\"GET\", \"/g\"),\n  },\n})\n\n// Export the API type\nexport type DataAPI = typeof dataModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  DiscoverRequest,\n  DiscoverResponse,\n  RSSHubAnalyticsQuery,\n  RSSHubAnalyticsResponse,\n  RSSHubResponse,\n  RSSHubRouteQuery,\n  RSSHubRouteResponse,\n} from \"./types\"\n\n/**\n * Discover module definition - Feed and list discovery\n */\nexport const discoverModule = defineModule({\n  name: \"discover\",\n  prefix: \"/discover\",\n  routes: {\n    // Main discovery endpoint\n    discover: defineRoute<DiscoverRequest, DiscoverResponse>(\"POST\", \"/\"),\n\n    // RSSHub integration endpoints\n    rsshub: defineRoute<never, RSSHubResponse>(\"GET\", \"/rsshub\"),\n\n    rsshubRoute: defineRoute<RSSHubRouteQuery, RSSHubRouteResponse>(\n      \"GET\",\n      \"/rsshub-route\",\n    ),\n\n    rsshubAnalytics: defineRoute<RSSHubAnalyticsQuery, RSSHubAnalyticsResponse>(\n      \"GET\",\n      \"/rsshub-analytics\",\n    ),\n  },\n})\n\n// Export the API type\nexport type DiscoverAPI = typeof discoverModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import type { SuccessResponse } from \"@/types\"\n\nimport { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CheckNewEntriesQuery,\n  CheckNewEntriesResponse,\n  EntryGetByIdResponse,\n  EntryGetQuery,\n  EntryListRequest,\n  EntryListResponse,\n  EntryPreviewRequest,\n  EntryPreviewResponse,\n  EntryReadabilityRequest,\n  EntryReadabilityResponse,\n  EntryStreamRequest,\n  InboxEntryGetQuery,\n  InboxEntryGetResponse,\n  InboxListEntryRequestInput,\n  InboxListEntryResponse,\n  InboxRemoveInput,\n  ReadHistoriesInput,\n  ReadHistoriesResponse,\n} from \"./types\"\n\n/**\n * Entries module definition with nested routes\n */\nexport const entriesModule = defineModule({\n  name: \"entries\",\n  prefix: \"/entries\",\n  routes: {\n    // Basic entry operations\n    get: defineRoute<EntryGetQuery, EntryGetByIdResponse>(\"GET\", \"/\"),\n    list: defineRoute<EntryListRequest, EntryListResponse>(\"POST\", \"/\"),\n\n    preview: defineRoute<EntryPreviewRequest, EntryPreviewResponse>(\n      \"POST\",\n      \"/preview\",\n    ),\n    readability: defineRoute<EntryReadabilityRequest, EntryReadabilityResponse>(\n      \"POST\",\n      \"/readability\",\n    ),\n\n    stream: defineRoute<EntryStreamRequest, Response>(\"POST\", \"/stream\"),\n\n    // Check for new entries\n    checkNew: defineRoute<CheckNewEntriesQuery, CheckNewEntriesResponse>(\n      \"GET\",\n      \"/check-new\",\n    ),\n\n    // Read histories\n    readHistories: defineRoute<ReadHistoriesInput, ReadHistoriesResponse>(\n      \"GET\",\n      \"/{id}/read-histories\",\n    ),\n\n    // Inbox operations (nested)\n    inbox: {\n      get: defineRoute<InboxEntryGetQuery, InboxEntryGetResponse>(\n        \"GET\",\n        \"/inbox\",\n      ),\n\n      list: defineRoute<InboxListEntryRequestInput, InboxListEntryResponse>(\n        \"POST\",\n        \"/inbox\",\n      ),\n\n      delete: defineRoute<InboxRemoveInput, SuccessResponse>(\n        \"DELETE\",\n        \"/inbox\",\n      ),\n    },\n  },\n})\n\n// Export the API type\nexport type EntriesAPI = typeof entriesModule.api\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  FeedAnalyticsQuery,\n  FeedAnalyticsResponse,\n  FeedClaimChallengeRequest,\n  FeedClaimChallengeResponse,\n  FeedClaimListQuery,\n  FeedClaimListResponse,\n  FeedClaimMessageRequest,\n  FeedClaimMessageResponse,\n  FeedGetQuery,\n  FeedGetResponse,\n  FeedRefreshRequest,\n  FeedRefreshResponse,\n  FeedResetRequest,\n  FeedResetResponse,\n} from \"./types\"\n\n/**\n * Feeds module definition with nested routes\n */\nexport const feedsModule = defineModule({\n  name: \"feeds\",\n  prefix: \"/feeds\",\n  routes: {\n    // Basic feed operations\n    get: defineRoute<FeedGetQuery, FeedGetResponse>(\"GET\", \"/\"),\n\n    refresh: defineRoute<FeedRefreshRequest, FeedRefreshResponse>(\n      \"POST\",\n      \"/refresh\",\n    ),\n\n    analytics: defineRoute<FeedAnalyticsQuery, FeedAnalyticsResponse>(\n      \"GET\",\n      \"/analytics\",\n    ),\n\n    reset: defineRoute<FeedResetRequest, FeedResetResponse>(\"POST\", \"/reset\"),\n\n    // Feed claiming operations (nested)\n    claim: {\n      challenge: defineRoute<\n        FeedClaimChallengeRequest,\n        FeedClaimChallengeResponse\n      >(\"POST\", \"/claim/challenge\"),\n\n      list: defineRoute<FeedClaimListQuery, FeedClaimListResponse>(\n        \"GET\",\n        \"/claim/list\",\n      ),\n\n      message: defineRoute<FeedClaimMessageRequest, FeedClaimMessageResponse>(\n        \"POST\",\n        \"/claim/message\",\n      ),\n    },\n  },\n})\n\n// Export the API type\nexport type FeedsAPI = typeof feedsModule.api\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  InboxCreateRequest,\n  InboxCreateResponse,\n  InboxDeleteRequest,\n  InboxDeleteResponse,\n  InboxEmailRequest,\n  InboxEmailResponse,\n  InboxGetQuery,\n  InboxGetResponse,\n  InboxListResponse,\n  InboxUpdateRequest,\n  InboxUpdateResponse,\n  InboxWebhookRequest,\n  InboxWebhookResponse,\n} from \"./types\"\n\n/**\n * Inboxes module definition - Email inboxes management\n */\nexport const inboxesModule = defineModule({\n  name: \"inboxes\",\n  prefix: \"/inboxes\",\n  routes: {\n    // Get specific inbox by handle\n    get: defineRoute<InboxGetQuery, InboxGetResponse>(\"GET\", \"/\"),\n\n    // List user's inboxes\n    list: defineRoute<never, InboxListResponse>(\"GET\", \"/list\"),\n\n    // Create new inbox\n    post: defineRoute<InboxCreateRequest, InboxCreateResponse>(\"POST\", \"/\"),\n\n    // Update inbox\n    put: defineRoute<InboxUpdateRequest, InboxUpdateResponse>(\"PUT\", \"/\"),\n\n    // Delete inbox\n    delete: defineRoute<InboxDeleteRequest, InboxDeleteResponse>(\"DELETE\", \"/\"),\n\n    // Email operations\n    email: defineRoute<InboxEmailRequest, InboxEmailResponse>(\"POST\", \"/email\"),\n\n    // Webhook operations\n    webhook: defineRoute<InboxWebhookRequest, InboxWebhookResponse>(\n      \"POST\",\n      \"/webhook\",\n    ),\n  },\n})\n\n// Export the API type\nexport type InboxesAPI = typeof inboxesModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CreateInvitationRequest,\n  CreateInvitationResponse,\n  GetInvitationLimitationResponse,\n  GetInvitationsListResponse,\n  UseInvitationRequest,\n  UseInvitationResponse,\n} from \"./types\"\n\n/**\n * Invitations module for managing invitation codes\n */\nexport const invitationsModule = defineModule({\n  name: \"invitations\",\n  prefix: \"/invitations\",\n  routes: {\n    // Get current invitation limit for user\n    getLimitation: defineRoute<never, GetInvitationLimitationResponse>(\n      \"GET\",\n      \"/limitation\",\n    ),\n\n    // List all invitations created by user\n    list: defineRoute<never, GetInvitationsListResponse>(\"GET\", \"/\"),\n\n    // Create new invitation code\n    create: defineRoute<CreateInvitationRequest, CreateInvitationResponse>(\n      \"POST\",\n      \"/new\",\n    ),\n\n    // Use/redeem invitation code\n    use: defineRoute<UseInvitationRequest, UseInvitationResponse>(\n      \"POST\",\n      \"/use\",\n    ),\n  },\n})\n\n// Export the API type\nexport type InvitationsAPI = typeof invitationsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type { EmptyResponse } from \"../../types\"\nimport type {\n  CreateListRequest,\n  DiscoverListsResponse,\n  DiscoverQuery,\n  ExportInput,\n  ExportResponse,\n  GetAnalyticsInput,\n  ImportListRequest,\n  ListAnalyticsResponse,\n  ListResponse,\n  ListsQuery,\n  ListsResponse,\n  RemoveFeedInput,\n  TrendingListsResponse,\n  TrendingQuery,\n} from \"./types\"\n\n/**\n * Lists module definition with nested routes\n */\nexport const listsModule = defineModule({\n  name: \"lists\",\n  prefix: \"/lists\",\n  routes: {\n    // Basic list operations\n    list: defineRoute<ListsQuery, ListsResponse>(\"GET\", \"/\"),\n    create: defineRoute<CreateListRequest, ListResponse>(\"POST\", \"/\"),\n\n    removeFeed: defineRoute<RemoveFeedInput, EmptyResponse>(\n      \"DELETE\",\n      \"/{id}/feeds/{feedId}\",\n    ),\n\n    // List discovery\n    discover: defineRoute<DiscoverQuery, DiscoverListsResponse>(\n      \"GET\",\n      \"/discover\",\n    ),\n\n    trending: defineRoute<TrendingQuery, TrendingListsResponse>(\n      \"GET\",\n      \"/trending\",\n    ),\n\n    // List import/export\n    import: defineRoute<ImportListRequest, ListResponse>(\"POST\", \"/import\"),\n\n    export: defineRoute<ExportInput, ExportResponse>(\"GET\", \"/{id}/export\"),\n\n    // List analytics\n    getAnalytics: defineRoute<GetAnalyticsInput, ListAnalyticsResponse>(\n      \"GET\",\n      \"/{id}/analytics\",\n    ),\n  },\n})\n\n// Export the API type\nexport type ListsAPI = typeof listsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  ConnectionParams,\n  CreateConnectionRequest,\n  CreateConnectionResponse,\n  DeleteConnectionResponse,\n  GetConnectionsResponse,\n  GetToolsResponse,\n  RefreshToolsRequest,\n  RefreshToolsResponse,\n  UpdateConnectionRequest,\n  UpdateConnectionResponse,\n} from \"./types\"\n\n/**\n * MCP (Model Context Protocol) module definition\n * Handles MCP server connections and tool management\n */\nexport const mcpModule = defineModule({\n  name: \"mcp\",\n  prefix: \"/mcp\",\n  routes: {\n    // Connection management\n    createConnection: defineRoute<CreateConnectionRequest, CreateConnectionResponse>(\n      \"POST\",\n      \"/connections\",\n    ),\n\n    updateConnection: defineRoute<UpdateConnectionRequest, UpdateConnectionResponse>(\n      \"PUT\",\n      \"/connections/{connectionId}\",\n    ),\n\n    getConnections: defineRoute<never, GetConnectionsResponse>(\n      \"GET\",\n      \"/connections\",\n    ),\n\n    deleteConnection: defineRoute<ConnectionParams, DeleteConnectionResponse>(\n      \"DELETE\",\n      \"/connections/{connectionId}\",\n    ),\n\n    // Tool management\n    getTools: defineRoute<ConnectionParams, GetToolsResponse>(\n      \"GET\",\n      \"/connections/{connectionId}/tools\",\n    ),\n\n    refreshTools: defineRoute<RefreshToolsRequest, RefreshToolsResponse>(\n      \"POST\",\n      \"/tools/refresh\",\n    ),\n\n  },\n})\n\n// Export the API type\nexport type McpAPI = typeof mcpModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CreateMessagingTokenRequest,\n  CreateMessagingTokenResponse,\n  DeleteMessagingTokenRequest,\n  DeleteMessagingTokenResponse,\n  GetMessagingTokensResponse,\n} from \"./types\"\n\n/**\n * Messaging module for push notification management\n */\nexport const messagingModule = defineModule({\n  name: \"messaging\",\n  prefix: \"/messaging\",\n  routes: {\n    // List messaging tokens for user\n    getTokens: defineRoute<never, GetMessagingTokensResponse>(\"GET\", \"/\"),\n\n    // Create or update messaging token\n    createToken: defineRoute<\n      CreateMessagingTokenRequest,\n      CreateMessagingTokenResponse\n    >(\"POST\", \"/\"),\n\n    // Remove messaging token\n    deleteToken: defineRoute<\n      DeleteMessagingTokenRequest,\n      DeleteMessagingTokenResponse\n    >(\"DELETE\", \"/\"),\n  },\n})\n\n// Export the API type\nexport type MessagingAPI = typeof messagingModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CheckBullMQRequest,\n  CheckBullMQResponse,\n  CheckPostgreSQLResponse,\n  CheckRedisResponse,\n  GetRSSHubAnalyticsRequest,\n  GetRSSHubAnalyticsResponse,\n} from \"./types\"\n\n/**\n * Probes module for health checks and system monitoring\n */\nexport const probesModule = defineModule({\n  name: \"probes\",\n  prefix: \"/probes\",\n  routes: {\n    // Check PostgreSQL database health\n    checkPostgreSQL: defineRoute<never, CheckPostgreSQLResponse>(\n      \"GET\",\n      \"/postgresql\",\n    ),\n\n    // Check Redis health\n    checkRedis: defineRoute<never, CheckRedisResponse>(\"GET\", \"/redis\"),\n\n    // Check BullMQ queue status\n    checkBullMQ: defineRoute<CheckBullMQRequest, CheckBullMQResponse>(\n      \"GET\",\n      \"/bullmq\",\n    ),\n\n    // Get RSS Hub analytics\n    getRSSHubAnalytics: defineRoute<\n      GetRSSHubAnalyticsRequest,\n      GetRSSHubAnalyticsResponse\n    >(\"GET\", \"/rsshub\"),\n  },\n})\n\n// Export the API type\nexport type ProbesAPI = typeof probesModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  GetProfileRequest,\n  GetProfileResponse,\n  GetProfilesBatchRequest,\n  GetProfilesBatchResponse,\n} from \"./types\"\n\n/**\n * Profiles module for user profile management\n */\nexport const profilesModule = defineModule({\n  name: \"profiles\",\n  prefix: \"/profiles\",\n  routes: {\n    // Get single profile by ID or handle\n    getProfile: defineRoute<GetProfileRequest, GetProfileResponse>(\"GET\", \"/\"),\n\n    // Get multiple profiles by IDs\n    getBatch: defineRoute<GetProfilesBatchRequest, GetProfilesBatchResponse>(\n      \"POST\",\n      \"/batch\",\n    ),\n  },\n})\n\n// Export the API type\nexport type ProfilesAPI = typeof profilesModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  MarkAllAsReadRequest,\n  MarkAllAsReadResponse,\n  MarkAsReadRequest,\n  MarkAsUnreadRequest,\n  ReadOperationResponse,\n  ReadStatusQuery,\n  ReadStatusResponse,\n  TotalUnreadCountResponse,\n} from \"./types\"\n\n/**\n * Reads module definition with nested routes\n */\nexport const readsModule = defineModule({\n  name: \"reads\",\n  prefix: \"/reads\",\n  routes: {\n    // Basic read operations\n    get: defineRoute<ReadStatusQuery, ReadStatusResponse>(\"GET\", \"/\"),\n\n    markAsRead: defineRoute<MarkAsReadRequest, ReadOperationResponse>(\n      \"POST\",\n      \"/\",\n    ),\n\n    markAsUnread: defineRoute<MarkAsUnreadRequest, ReadOperationResponse>(\n      \"DELETE\",\n      \"/\",\n    ),\n\n    markAllAsRead: defineRoute<MarkAllAsReadRequest, MarkAllAsReadResponse>(\n      \"POST\",\n      \"/all\",\n    ),\n\n    getTotalCount: defineRoute<never, TotalUnreadCountResponse>(\n      \"GET\",\n      \"/total-count\",\n    ),\n  },\n})\n\n// Export the API type\nexport type ReadsAPI = typeof readsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  GetReferralDaysRequest,\n  GetReferralDaysResponse,\n  GetReferralsResponse,\n  VerifyReceiptRequest,\n  VerifyReceiptResponse,\n} from \"./types\"\n\n/**\n * Referrals module for referral system management\n */\nexport const referralsModule = defineModule({\n  name: \"referrals\",\n  prefix: \"/referrals\",\n  routes: {\n    // Get user referrals\n    getReferrals: defineRoute<never, GetReferralsResponse>(\"GET\", \"/\"),\n\n    // Get referral cycle days by code\n    getDays: defineRoute<GetReferralDaysRequest, GetReferralDaysResponse>(\n      \"GET\",\n      \"/days\",\n    ),\n\n    // Verify Apple Pay receipt\n    verifyReceipt: defineRoute<VerifyReceiptRequest, VerifyReceiptResponse>(\n      \"POST\",\n      \"/verify-receipt\",\n    ),\n  },\n})\n\n// Export the API type\nexport type ReferralsAPI = typeof referralsModule.api\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  CreateRSSHubInstanceRequest,\n  CreateRSSHubInstanceResponse,\n  DeleteRSSHubInstanceRequest,\n  DeleteRSSHubInstanceResponse,\n  GetRSSHubInstanceRequest,\n  GetRSSHubInstanceResponse,\n  GetRSSHubInstancesListResponse,\n  GetRSSHubStatusResponse,\n  UseRSSHubInstanceRequest,\n  UseRSSHubInstanceResponse,\n} from \"./types\"\n\n/**\n * RSSHub module for RSSHub instance management\n */\nexport const rsshubModule = defineModule({\n  name: \"rsshub\",\n  prefix: \"/rsshub\",\n  routes: {\n    // Create or update RSSHub instance\n    createInstance: defineRoute<\n      CreateRSSHubInstanceRequest,\n      CreateRSSHubInstanceResponse\n    >(\"POST\", \"/\"),\n\n    // List available RSSHub instances\n    listInstances: defineRoute<never, GetRSSHubInstancesListResponse>(\n      \"GET\",\n      \"/list\",\n    ),\n\n    // Delete RSSHub instance\n    deleteInstance: defineRoute<\n      DeleteRSSHubInstanceRequest,\n      DeleteRSSHubInstanceResponse\n    >(\"DELETE\", \"/\"),\n\n    // Purchase/use RSSHub instance\n    useInstance: defineRoute<\n      UseRSSHubInstanceRequest,\n      UseRSSHubInstanceResponse\n    >(\"POST\", \"/use\"),\n\n    // Get specific RSSHub instance\n    getInstance: defineRoute<\n      GetRSSHubInstanceRequest,\n      GetRSSHubInstanceResponse\n    >(\"GET\", \"/\"),\n\n    // Get user's RSSHub usage status\n    getStatus: defineRoute<never, GetRSSHubStatusResponse>(\"GET\", \"/status\"),\n  },\n})\n\n// Export the API type\nexport type RSSHubAPI = typeof rsshubModule.api\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  SettingsGetQuery,\n  SettingsGetResponse,\n  SettingsUpdateInput,\n  SettingsUpdateResponse,\n} from \"./types\"\n\n/**\n * Settings module definition with nested routes\n */\nexport const settingsModule = defineModule({\n  name: \"settings\",\n  prefix: \"/settings\",\n  routes: {\n    // Basic settings operations\n    get: defineRoute<SettingsGetQuery, SettingsGetResponse>(\"GET\", \"/\"),\n\n    update: defineRoute<SettingsUpdateInput, SettingsUpdateResponse>(\n      \"PATCH\",\n      \"/{tab}\",\n    ),\n  },\n})\n\n// Export the API type\nexport type SettingsAPI = typeof settingsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type { GetStatusConfigsResponse } from \"./types\"\n\n/**\n * Status module for system status and configuration\n */\nexport const statusModule = defineModule({\n  name: \"status\",\n  prefix: \"/status\",\n  routes: {\n    // Get system status configurations\n    getConfigs: defineRoute<never, GetStatusConfigsResponse>(\"GET\", \"/configs\"),\n  },\n})\n\n// Export the API type\nexport type StatusAPI = typeof statusModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  SubscriptionBatchRequest,\n  SubscriptionBatchResponse,\n  SubscriptionCreateRequest,\n  SubscriptionCreateResponse,\n  SubscriptionDeleteRequest,\n  SubscriptionDeleteResponse,\n  SubscriptionExportQuery,\n  SubscriptionExportResponse,\n  SubscriptionGetQuery,\n  SubscriptionGetResponse,\n  SubscriptionImportResponse,\n  SubscriptionParseOpmlResponse,\n  SubscriptionUpdateRequest,\n  SubscriptionUpdateResponse,\n} from \"./types\"\n\n/**\n * Subscriptions module definition with nested routes\n */\nexport const subscriptionsModule = defineModule({\n  name: \"subscriptions\",\n  prefix: \"/subscriptions\",\n  routes: {\n    // Basic subscription operations\n    get: defineRoute<SubscriptionGetQuery, SubscriptionGetResponse>(\"GET\", \"/\"),\n\n    create: defineRoute<SubscriptionCreateRequest, SubscriptionCreateResponse>(\n      \"POST\",\n      \"/\",\n    ),\n\n    update: defineRoute<SubscriptionUpdateRequest, SubscriptionUpdateResponse>(\n      \"PATCH\",\n      \"/\",\n    ),\n\n    delete: defineRoute<SubscriptionDeleteRequest, SubscriptionDeleteResponse>(\n      \"DELETE\",\n      \"/\",\n    ),\n\n    // Batch patch operations\n    batchUpdate: defineRoute<SubscriptionBatchRequest, SubscriptionBatchResponse>(\n      \"PATCH\",\n      \"/batch\",\n    ),\n\n    // OPML operations\n    import: defineRoute<FormData, SubscriptionImportResponse>(\n      \"POST\",\n      \"/import\",\n    ),\n\n    export: defineRoute<SubscriptionExportQuery, SubscriptionExportResponse>(\n      \"GET\",\n      \"/export\",\n    ),\n\n    parseOpml: defineRoute<ArrayBuffer, SubscriptionParseOpmlResponse>(\n      \"POST\",\n      \"/parse-opml\",\n    ),\n  },\n})\n\n// Export the API type\nexport type SubscriptionsAPI = typeof subscriptionsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  GetTrendingFeedsRequest,\n  GetTrendingFeedsResponse,\n} from \"./types\"\n\n/**\n * Trending module for discovering trending feeds\n */\nexport const trendingModule = defineModule({\n  name: \"trending\",\n  prefix: \"/trending\",\n  routes: {\n    // Get trending feeds with analytics\n    getFeeds: defineRoute<GetTrendingFeedsRequest, GetTrendingFeedsResponse>(\n      \"GET\",\n      \"/feeds\",\n    ),\n  },\n})\n\n// Export the API type\nexport type TrendingAPI = typeof trendingModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  UploadAvatarRequest,\n  UploadAvatarResponse,\n  UploadChatAttachmentRequest,\n  UploadChatAttachmentResponse,\n} from \"./types\"\n\n/**\n * Upload module for file uploads\n */\nexport const uploadModule = defineModule({\n  name: \"upload\",\n  prefix: \"/upload\",\n  routes: {\n    // Upload avatar image\n    uploadAvatar: defineRoute<UploadAvatarRequest, UploadAvatarResponse>(\n      \"POST\",\n      \"/avatar\",\n      { requestType: \"formData\" },\n    ),\n    // Upload chat attachment file (md, images, txt, pdf)\n    uploadChatAttachment: defineRoute<UploadChatAttachmentRequest, UploadChatAttachmentResponse>(\n      \"POST\",\n      \"/chat-attachment\",\n      { requestType: \"formData\" },\n    ),\n  },\n})\n\n// Export the API type\nexport type UploadAPI = typeof uploadModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  AirdropClaimResponse,\n  AirdropGetResponse,\n  AirdropUpdateResponse,\n  ClaimCheckResponse,\n  ClaimDailyResponse,\n  PowerPriceResponse,\n  TipRequest,\n  TipResponse,\n  TransactionQuery,\n  TransactionsGetResponse,\n  WalletRankingQuery,\n  WalletRankingResponse,\n  WalletsGetResponse,\n  WalletsPostResponse,\n  WalletsRefreshResponse,\n  WithdrawRequest,\n  WithdrawResponse,\n} from \"./types\"\n\n/**\n * Wallets module definition - Web3 wallet operations and transactions\n */\nexport const walletsModule = defineModule({\n  name: \"wallets\",\n  prefix: \"/wallets\",\n  routes: {\n    // Basic wallet operations\n    get: defineRoute<never, WalletsGetResponse>(\"GET\", \"/\"),\n\n    post: defineRoute<never, WalletsPostResponse>(\"POST\", \"/\"),\n\n    refresh: defineRoute<never, WalletsRefreshResponse>(\"POST\", \"/refresh\"),\n\n    ranking: defineRoute<WalletRankingQuery, WalletRankingResponse>(\n      \"GET\",\n      \"/ranking\",\n    ),\n\n    powerPrice: defineRoute<never, PowerPriceResponse>(\"GET\", \"/power-price\"),\n\n    // Transaction operations (nested)\n    transactions: {\n      get: defineRoute<TransactionQuery, TransactionsGetResponse>(\n        \"GET\",\n        \"/transactions\",\n      ),\n\n      tip: defineRoute<TipRequest, TipResponse>(\"POST\", \"/transactions/tip\"),\n\n      claimDaily: defineRoute<never, ClaimDailyResponse>(\n        \"POST\",\n        \"/transactions/claim-daily\",\n      ),\n\n      withdraw: defineRoute<WithdrawRequest, WithdrawResponse>(\n        \"POST\",\n        \"/transactions/withdraw\",\n      ),\n\n      claimCheck: defineRoute<never, ClaimCheckResponse>(\n        \"GET\",\n        \"/transactions/claim-check\",\n      ),\n    },\n\n    // Airdrop operations (nested)\n    airdrop: {\n      get: defineRoute<never, AirdropGetResponse>(\"GET\", \"/airdrop\"),\n\n      claim: defineRoute<never, AirdropClaimResponse>(\"POST\", \"/airdrop\"),\n\n      update: defineRoute<never, AirdropUpdateResponse>(\"PUT\", \"/airdrop\"),\n    },\n  },\n})\n\n// Export the API type\nexport type WalletsAPI = typeof walletsModule.api\n\n// Re-export types for external consumption\nexport type * from \"./types\"\n","import { achievementModule } from \"./achievement\"\nimport { adminModule } from \"./admin\"\nimport { aiModule } from \"./ai\"\nimport { boostsModule } from \"./boosts\"\nimport { categoriesModule } from \"./categories\"\nimport { collectionsModule } from \"./collections\"\nimport { dataModule } from \"./data\"\nimport { discoverModule } from \"./discover\"\nimport { entriesModule } from \"./entries\"\nimport { feedsModule } from \"./feeds\"\nimport { inboxesModule } from \"./inboxes\"\nimport { invitationsModule } from \"./invitations\"\nimport { listsModule } from \"./lists\"\nimport { mcpModule } from \"./mcp\"\nimport { messagingModule } from \"./messaging\"\nimport { probesModule } from \"./probes\"\nimport { profilesModule } from \"./profiles\"\nimport { readsModule } from \"./reads\"\nimport { referralsModule } from \"./referrals\"\nimport { rsshubModule } from \"./rsshub\"\nimport { settingsModule } from \"./settings\"\nimport { statusModule } from \"./status\"\nimport { subscriptionsModule } from \"./subscriptions\"\nimport { trendingModule } from \"./trending\"\nimport { uploadModule } from \"./upload\"\nimport { walletsModule } from \"./wallets\"\n\n/**\n * Central module registry\n * All modules now use the new unified system\n */\nexport const moduleRegistry = {\n  achievement: achievementModule,\n  admin: adminModule,\n  ai: aiModule,\n  boosts: boostsModule,\n  categories: categoriesModule,\n  collections: collectionsModule,\n  data: dataModule,\n  discover: discoverModule,\n  entries: entriesModule,\n  feeds: feedsModule,\n  inboxes: inboxesModule,\n  invitations: invitationsModule,\n  lists: listsModule,\n  mcp: mcpModule,\n  messaging: messagingModule,\n  profiles: profilesModule,\n  probes: probesModule,\n  reads: readsModule,\n  referrals: referralsModule,\n  rsshub: rsshubModule,\n  settings: settingsModule,\n  status: statusModule,\n  subscriptions: subscriptionsModule,\n  trending: trendingModule,\n  upload: uploadModule,\n  wallets: walletsModule,\n} as const\n\n/**\n * Type definition for the module registry\n */\nexport type ModuleRegistry = typeof moduleRegistry\n\n/**\n * Generate API types from the registry\n */\nexport type ModuleAPIs = {\n  [K in keyof ModuleRegistry]: ModuleRegistry[K][\"api\"]\n}\n","import type { NestedRoutes, RouteDefinition } from \"./define-module\"\n\n/**\n * Route resolution utilities\n */\nexport class RouteResolver {\n  /**\n   * Resolve path by combining prefix and route path\n   */\n  static resolvePath(prefix = \"\", path: string): string {\n    // Remove trailing slashes from prefix\n    const cleanPrefix = prefix.replace(/\\/+$/, \"\")\n    // Remove leading slashes from path\n    const cleanPath = path.replace(/^\\/+/, \"\")\n\n    if (!cleanPath) {\n      return cleanPrefix || \"/\"\n    }\n\n    return cleanPrefix ? `${cleanPrefix}/${cleanPath}` : `/${cleanPath}`\n  }\n\n  /**\n   * Flatten nested routes into a flat structure for proxy consumption\n   */\n  static flattenRoutes(\n    routes: NestedRoutes,\n    prefix = \"\",\n    parentKey = \"\",\n  ): Record<string, RouteDefinition> {\n    const flattened: Record<string, RouteDefinition> = {}\n\n    for (const [key, value] of Object.entries(routes)) {\n      const routeKey = parentKey ? `${parentKey}.${key}` : key\n\n      if (this.isRouteDefinition(value)) {\n        // This is a route definition, resolve the full path\n        flattened[routeKey] = {\n          ...value,\n          path: this.resolvePath(prefix, value.path),\n        }\n      } else {\n        // This is a nested route group, recurse\n        const nestedFlattened = this.flattenRoutes(\n          value as NestedRoutes,\n          prefix,\n          routeKey,\n        )\n        Object.assign(flattened, nestedFlattened)\n      }\n    }\n\n    return flattened\n  }\n\n  /**\n   * Type guard to check if a value is a RouteDefinition\n   */\n  private static isRouteDefinition(value: any): value is RouteDefinition {\n    return (\n      value && typeof value === \"object\" && \"method\" in value && \"path\" in value\n    )\n  }\n}\n","import type { ModuleDefinition } from \"../shared/define-module\"\nimport { RouteResolver } from \"../shared/route-resolver\"\nimport type {\n  HTTPMethod,\n  RequestContentType,\n  RequestOptions,\n  ResponseContentType,\n} from \"../types\"\nimport type { HttpClient } from \"./base\"\n\n/**\n * Route function arguments for legacy compatibility\n */\nexport interface LegacyRouteArgs {\n  params?: Record<string, string>\n  query?: Record<string, string | number | boolean>\n  body?: unknown\n  headers?: Record<string, string>\n  timeout?: number\n  signal?: AbortSignal\n}\n\n/**\n * Route function arguments with flattened input\n */\nexport interface RouteArgs extends Record<string, any> {\n  headers?: Record<string, string>\n  timeout?: number\n  signal?: AbortSignal\n}\n\n/**\n * Route function type\n */\nexport type RouteFunction<T = any> = (args?: RouteArgs) => Promise<T>\n\n/**\n * Route definition for API endpoints (from module system)\n */\nexport interface RouteDefinition {\n  method: HTTPMethod\n  path: string\n  params?: readonly string[]\n  /** Fields that should be sent as query parameters */\n  query?: readonly string[]\n  /** Fields that should be sent as request body */\n  body?: readonly string[]\n  requestType?: RequestContentType\n  responseType?: ResponseContentType\n}\n\n/**\n * Dynamic proxy handler for API routes\n */\nexport class APIProxyHandler {\n  private routes: Map<string, RouteDefinition>\n  private client: HttpClient\n\n  constructor(client: HttpClient, routes: Map<string, RouteDefinition>) {\n    this.client = client\n    this.routes = routes\n  }\n\n  /**\n   * Proxy get trap that creates route functions dynamically\n   */\n  get(target: any, propKey: string | symbol): any {\n    const routeKey = String(propKey)\n\n    // Handle special properties\n    if (routeKey === \"constructor\" || routeKey === \"prototype\") {\n      return target[propKey]\n    }\n\n    // Handle nested routes (e.g., feeds.claim.challenge)\n    if (routeKey.includes(\".\")) {\n      return this.handleNestedRoute(routeKey)\n    }\n\n    const route = this.routes.get(routeKey)\n\n    if (!route) {\n      // For nested routes, return a proxy that continues the chain\n      if (this.hasNestedRoute(routeKey)) {\n        return this.createNestedProxy(routeKey)\n      }\n\n      throw new Error(`Route '${routeKey}' not found`)\n    }\n\n    return this.createRouteFunction(route)\n  }\n\n  /**\n   * Check if a route key has nested routes\n   */\n  private hasNestedRoute(prefix: string): boolean {\n    for (const routeKey of this.routes.keys()) {\n      if (routeKey.startsWith(`${prefix}.`)) {\n        return true\n      }\n    }\n    return false\n  }\n\n  /**\n   * Create a nested proxy for route chains\n   */\n  private createNestedProxy(prefix: string): any {\n    const nestedRoutes = new Map<string, RouteDefinition>()\n\n    // Find all routes that start with the prefix\n    for (const [routeKey, route] of this.routes.entries()) {\n      if (routeKey.startsWith(`${prefix}.`)) {\n        const nestedKey = routeKey.slice(Math.max(0, prefix.length + 1))\n        nestedRoutes.set(nestedKey, route)\n      }\n    }\n\n    return new Proxy({}, new APIProxyHandler(this.client, nestedRoutes))\n  }\n\n  /**\n   * Handle nested route calls\n   */\n  private handleNestedRoute(routeKey: string): RouteFunction {\n    const route = this.routes.get(routeKey)\n\n    if (!route) {\n      throw new Error(`Nested route '${routeKey}' not found`)\n    }\n\n    return this.createRouteFunction(route)\n  }\n\n  /**\n   * Create a route function from a route definition\n   */\n  private createRouteFunction(route: RouteDefinition): RouteFunction {\n    return async (args: RouteArgs = {}) => {\n      const { headers, timeout, signal, ...inputArgs } = args\n\n      // Check if this is using the old API structure (legacy compatibility)\n\n      const params: Record<string, string> = {}\n      const query: Record<string, string | number | boolean> = {}\n      let body: unknown\n\n      // Handle new flattened API structure\n      const flattenedArgs = { ...inputArgs }\n\n      // Extract parameters from flattenedArgs based on route definition\n      if (route.params) {\n        route.params.forEach((param) => {\n          if (flattenedArgs[param] !== undefined) {\n            params[param] = String(flattenedArgs[param])\n            // Remove param from flattenedArgs to avoid duplication\n            delete flattenedArgs[param]\n          }\n        })\n      }\n\n      // Extract query parameters based on route definition\n      if (route.query) {\n        route.query.forEach((field) => {\n          if (flattenedArgs[field] !== undefined) {\n            query[field] = flattenedArgs[field]\n            // Remove from flattenedArgs to avoid duplication\n            delete flattenedArgs[field]\n          }\n        })\n      }\n\n      // Extract body parameters based on route definition\n      if (route.body) {\n        const bodyData: Record<string, any> = {}\n        route.body.forEach((field) => {\n          if (flattenedArgs[field] !== undefined) {\n            bodyData[field] = flattenedArgs[field]\n            // Remove from flattenedArgs to avoid duplication\n            delete flattenedArgs[field]\n          }\n        })\n        if (Object.keys(bodyData).length > 0) {\n          body = bodyData\n        }\n      }\n\n      // Handle remaining fields with fallback logic (backward compatibility)\n      // For GET requests, remaining args go to query\n      // For POST/PUT/PATCH/DELETE requests, remaining args go to body\n      // Filter out undefined values\n      const remainingFields = Object.keys(flattenedArgs).filter(\n        (key) => flattenedArgs[key] !== undefined,\n      )\n      if (remainingFields.length > 0) {\n        const remainingData = Object.fromEntries(\n          remainingFields.map((key) => [key, flattenedArgs[key]]),\n        )\n\n        if (route.method === \"GET\") {\n          Object.assign(query, remainingData)\n        } else {\n          // For non-GET requests, merge remaining args into body\n          if (body && typeof body === \"object\") {\n            Object.assign(body, remainingData)\n          } else {\n            body = remainingData\n          }\n        }\n      }\n\n      // Build URL with parameters\n      let url = route.path\n      if (route.params) {\n        route.params.forEach((param) => {\n          const value = params[param]\n          if (value !== undefined) {\n            url = url.replace(`{${param}}`, encodeURIComponent(value))\n          }\n        })\n      }\n\n      // Build request options\n      const requestOptions: RequestOptions = {\n        method: route.method,\n        headers,\n        timeout,\n        signal,\n        requestType: route.requestType,\n      }\n\n      // Add query parameters if they exist\n      if (Object.keys(query).length > 0) {\n        requestOptions.query = query\n      }\n\n      // Add body if it exists\n      if (body !== undefined) {\n        requestOptions.body = body\n      }\n\n      return this.client.request(url, requestOptions)\n    }\n  }\n}\n\n/**\n * Create a typed API proxy from a module definition\n */\nexport function createAPIProxy<T extends Record<string, any>>(\n  client: HttpClient,\n  module: ModuleDefinition<any>,\n): T {\n  // Flatten nested routes and apply prefix\n  const flatRoutes = RouteResolver.flattenRoutes(module.routes, module.prefix)\n\n  const routeMap = new Map(Object.entries(flatRoutes))\n  return new Proxy({}, new APIProxyHandler(client, routeMap)) as T\n}\n\n// Legacy functions removed - new module system only\n","import type { ModuleAPIs } from \"../modules/registry\"\nimport { moduleRegistry } from \"../modules/registry\"\nimport type { ClientConfig, RequestOptions } from \"../types\"\nimport { HttpClient } from \"./base\"\nimport type {\n  ErrorInterceptor,\n  RequestInterceptor,\n  ResponseInterceptor,\n} from \"./interceptors\"\nimport { commonInterceptors } from \"./interceptors\"\nimport { createAPIProxy } from \"./proxy\"\n\n/**\n * Configuration options for the Follow Client\n */\nexport interface FollowClientConfig extends Partial<ClientConfig> {\n  // Additional SDK-specific configuration\n  enableDefaultInterceptors?: boolean\n  authToken?: string\n}\n\nexport class FollowClient {\n  private httpClient: HttpClient\n\n  public api: ModuleAPIs = {} as ModuleAPIs\n\n  constructor(config: FollowClientConfig = {}) {\n    // Initialize HTTP client with proper defaults\n    this.httpClient = new HttpClient({\n      baseURL: config.baseURL || \"https://api.folo.is\",\n      timeout: config.timeout || 30000,\n      headers: config.headers || {},\n      credentials: config.credentials || \"include\",\n      fetch: config.fetch || globalThis.fetch.bind(globalThis),\n    })\n\n    // Initialize API route groups\n    this.initializeRoutes()\n\n    // Setup default interceptors if enabled\n    if (config.enableDefaultInterceptors) {\n      this.setupDefaultInterceptors()\n    }\n\n    // Set auth token if provided\n    if (config.authToken) {\n      this.setAuthToken(config.authToken)\n    }\n  }\n\n  /**\n   * Initialize API route groups with proper typing\n   */\n  private initializeRoutes(): void {\n    // Automatically initialize all modules from registry\n    for (const [moduleName, moduleDefinition] of Object.entries(\n      moduleRegistry,\n    )) {\n      (this.api as any)[moduleName] = createAPIProxy(this.httpClient, moduleDefinition)\n    }\n  }\n\n  /**\n   * Setup default interceptors\n   */\n  private setupDefaultInterceptors(): void {\n    const interceptors = this.httpClient.getInterceptors()\n\n    // Add default logging interceptor\n    interceptors.addRequestInterceptor(\n      commonInterceptors.logRequests({ log: console.info }),\n    )\n\n    interceptors.addResponseInterceptor(\n      commonInterceptors.logResponses({ log: console.info }),\n    )\n  }\n\n  /**\n   * Set authentication token for API requests\n   */\n  setAuthToken(token: string): void {\n    this.httpClient.setHeaders({ Authorization: `Bearer ${token}` })\n  }\n\n  /**\n   * Remove authentication token\n   */\n  removeAuthToken(): void {\n    const currentHeaders = this.httpClient.getConfig().headers\n    const { Authorization, ...newHeaders } = currentHeaders\n    this.httpClient.setHeaders(newHeaders)\n  }\n\n  /**\n   * Set custom headers for API requests\n   */\n  setHeaders(headers: Record<string, string>): void {\n    this.httpClient.setHeaders(headers)\n  }\n\n  /**\n   * Set custom fetch instance\n   */\n  setFetch(fetchInstance: typeof fetch): void {\n    this.httpClient.setFetch(fetchInstance)\n  }\n\n  /**\n   * Update client configuration\n   */\n  updateConfig(config: Partial<FollowClientConfig>): void {\n    this.httpClient.setConfig(config)\n  }\n\n  /**\n   * Get current configuration (readonly)\n   */\n  getConfig(): Readonly<Required<ClientConfig>> {\n    return this.httpClient.getConfig()\n  }\n\n  /**\n   * Make a custom HTTP request using the underlying HTTP client\n   * This allows direct access to the HTTP client for custom requests\n   */\n  async request<T>(path: string, options?: RequestOptions): Promise<T> {\n    return this.httpClient.request<T>(path, options)\n  }\n\n  /**\n   * Batch multiple requests\n   */\n  async batch<T extends readonly any[]>(\n    requests: readonly [...T],\n  ): Promise<{ [K in keyof T]: Awaited<T[K]> }> {\n    return Promise.all(requests) as any\n  }\n\n  /**\n   * Create a new instance with different configuration\n   */\n  clone(config?: Partial<FollowClientConfig>): FollowClient {\n    const currentConfig = this.getConfig()\n    return new FollowClient({\n      ...currentConfig,\n      ...config,\n    })\n  }\n\n  /**\n   * Add request interceptor\n   */\n  addRequestInterceptor(interceptor: RequestInterceptor): () => void {\n    return this.httpClient.getInterceptors().addRequestInterceptor(interceptor)\n  }\n\n  /**\n   * Add response interceptor\n   */\n  addResponseInterceptor(interceptor: ResponseInterceptor): () => void {\n    return this.httpClient.getInterceptors().addResponseInterceptor(interceptor)\n  }\n\n  /**\n   * Add error interceptor\n   */\n  addErrorInterceptor(interceptor: ErrorInterceptor): () => void {\n    return this.httpClient.getInterceptors().addErrorInterceptor(interceptor)\n  }\n}\n","import type { ErrorResponse, ResponseStruct, SuccessResponse } from \"@/types\"\n\n/**\n * Type guard to check if response is successful\n */\nexport function isSuccessResponse<T>(\n  response: ResponseStruct<T>,\n): response is SuccessResponse<T> {\n  return response.code === 0\n}\n\n/**\n * Type guard to check if response is an error\n */\nexport function isErrorResponse(\n  response: ResponseStruct<any>,\n): response is ErrorResponse {\n  return response.code !== 0\n}\n\n/**\n * Extract data from successful response, throw error if unsuccessful\n */\nexport function extractResponseData<T>(response: ResponseStruct<T>): T {\n  if (isSuccessResponse(response)) {\n    return response.data\n  }\n  throw new Error(response.message || `API error with code: ${response.code}`)\n}\n","import { defineModule, defineRoute } from \"../../shared/define-module\"\nimport type {\n  ActionsGetResponse,\n  ActionsPutRequest,\n  ActionsPutResponse,\n} from \"./types\"\n\n/**\n * Actions module definition - User automation rules\n */\nexport const actionsModule = defineModule({\n  name: \"actions\",\n  prefix: \"/actions\",\n  routes: {\n    // Get user actions/automation rules\n    get: defineRoute<never, ActionsGetResponse>(\"GET\", \"/\"),\n\n    // Update user actions/automation rules\n    put: defineRoute<ActionsPutRequest, ActionsPutResponse>(\"PUT\", \"/\"),\n  },\n})\n\n// Export the API type\nexport type ActionsAPI = typeof actionsModule.api\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YACEA,SACOC,QACAC,MACAC,MACP;AACA,QAAM,QAAQ;EAJP;EACA;EACA;AAGP,OAAK,OAAO;CACb;AACF;AAED,IAAa,eAAb,cAAkC,MAAM;CACtC,YAAYH,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;CACb;AACF;;;;AAID,IAAa,kBAAb,cAAqC,eAAe;CAClD,YAAY,UAAU,2BAA2BG,MAAY;AAC3D,QAAM,SAAS,KAAK,iBAAiB,KAAK;AAC1C,OAAK,OAAO;CACb;AACF;;;;AAKD,IAAa,wBAAb,cAA2C,eAAe;CACxD,YACEH,SACOI,kBACP;AACA,QAAM,SAAS,KAAK,mBAAmB;EAFhC;AAGP,OAAK,OAAO;AACZ,OAAK,OAAO;CACb;AACF;;;;AAKD,IAAa,qBAAb,cAAwC,eAAe;CACrD,YAAY,UAAU,mBAAm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