// Replaces @blocklet/js-sdk — simple axios wrapper without blocklet auth
import axios from 'axios';

export function createAxios(config: any = {}, _requestParams?: any) {
  return axios.create({
    timeout: 30000,
    ...config,
  });
}

// getBlockletSDK returns an SDK-like object with common API methods
export function getBlockletSDK() {
  const client = createAxios();
  return {
    user: {
      getUserPublicInfo: async (_did: string) => ({ data: null }),
      getProfile: async () => ({ data: null }),
      getPrivacy: async () => ({ data: [] }),
      getUserPrivacyConfig: async () => ({ data: [] }),
      updateProfile: async (_data: any) => ({ data: null }),
      updatePrivacy: async (_data: any) => ({ data: null }),
      logout: async (_opts?: any) => ({}),
    },
    notification: {
      getNotifications: async () => ({ data: [] }),
      markAsRead: async () => ({}),
    },
    session: {
      getSession: async () => ({ data: { user: null } }),
    },
    client,
    api: client,
  };
}

// BlockletSDK class used by did-space-react
export class BlockletSDK {
  static create() {
    return getBlockletSDK();
  }
}

export default { createAxios, getBlockletSDK, BlockletSDK };
