UNPKG

pancake-client-sdk

Version:
125 lines (124 loc) 3.43 kB
import { MarketplaceAccount, MarketplaceSettings, SyncStatus, MarketplaceProduct, MarketplaceOrder, MarketplaceLogistics, PlatformCategory, ConnectAccountRequest, MarketplaceStats } from '../types/marketplace'; import { BaseResource } from './base'; export declare class MarketplaceResource extends BaseResource { /** * Get list of connected marketplace accounts */ listAccounts(): Promise<{ data: MarketplaceAccount[]; }>; /** * Get marketplace account by ID */ getAccount(accountId: string): Promise<MarketplaceAccount>; /** * Connect new marketplace account */ connect(data: ConnectAccountRequest): Promise<MarketplaceAccount>; /** * Disconnect marketplace account */ disconnect(accountId: string): Promise<void>; /** * Update marketplace settings */ updateSettings(accountId: string, settings: Partial<MarketplaceSettings>): Promise<MarketplaceAccount>; /** * Start sync process */ startSync(accountId: string, type: string, params?: { force?: boolean; date_range?: { from: string; to: string; }; }): Promise<SyncStatus>; /** * Get sync status */ getSyncStatus(syncId: string): Promise<SyncStatus>; /** * List marketplace products */ listProducts(accountId: string, params?: { page_size?: number; page_number?: number; status?: string; search?: string; }): Promise<{ data: MarketplaceProduct[]; }>; /** * Update marketplace product */ updateProduct(accountId: string, platformProductId: string, data: { name?: string; status?: string; variations?: { platform_id: string; stock?: number; price?: number; }[]; }): Promise<MarketplaceProduct>; /** * List marketplace orders */ listOrders(accountId: string, params?: { page_size?: number; page_number?: number; status?: string; from_date?: string; to_date?: string; }): Promise<{ data: MarketplaceOrder[]; }>; /** * Get logistics settings */ getLogistics(accountId: string): Promise<MarketplaceLogistics>; /** * Update logistics settings */ updateLogistics(accountId: string, data: { shipping_providers: { id: string; enabled: boolean; settings?: Record<string, any>; }[]; }): Promise<MarketplaceLogistics>; /** * Get platform categories */ getCategories(platform: string, params?: { parent_id?: string; level?: number; }): Promise<{ data: PlatformCategory[]; }>; /** * Get marketplace statistics */ getStats(params?: { from_date?: string; to_date?: string; platform?: string; }): Promise<MarketplaceStats>; /** * Map local product to marketplace */ mapProduct(accountId: string, data: { product_id: string; platform_product_id: string; variation_mappings?: { variation_id: string; platform_variation_id: string; }[]; }): Promise<void>; /** * Get OAuth authorization URL */ getAuthUrl(platform: string): Promise<{ auth_url: string; state: string; }>; }