import { UserService } from '../UserService'; import type { ICommand } from './ICommand'; type GetSDKConfigParams = { key?: string; }; export class GetSDKConfigCommand implements ICommand { async execute(params?: GetSDKConfigParams): Promise { try { const service = new UserService(); const key = params?.key?.trim(); if (key) { const value = await service.getConfig(key); return JSON.stringify({ [key]: value, }); } const configs = await service.getAllConfig(); return JSON.stringify(configs); } catch (error) { console.error('GetSDKConfigCommand failed', error); return JSON.stringify({}); } } }