import { WBAPIError } from './base-error'; import { ValidationError } from './validation-error'; /** * Error thrown when a campaign is not found by its ID. * * This error typically occurs when: * - Campaign was deleted * - Campaign ID is incorrect * - Campaign belongs to another seller account * * @example * ```typescript * import { CampaignNotFoundError } from 'daytona-wildberries-typescript-sdk'; * * try { * await sdk.promotion.startCampaign(123456); * } catch (error) { * if (error instanceof CampaignNotFoundError) { * console.error('Campaign does not exist:', error.message); * // Verify campaign ID and try again * } * } * ``` */ export declare class CampaignNotFoundError extends WBAPIError { /** * Campaign ID that was not found */ readonly campaignId: number; /** * Creates a CampaignNotFoundError * * @param campaignId - ID of the campaign that wasn't found * @param response - API response body if available * @param requestId - Correlation ID for debugging */ constructor(campaignId: number, response?: unknown, requestId?: string); /** * Returns user-friendly error message with recovery guidance * * @returns Error message with actionable steps */ getUserMessage(): string; /** * Custom JSON serialization */ toJSON(): { name: string; message: string; statusCode: number; campaignId: number; response?: unknown; requestId?: string; }; } /** * Error thrown when bid amount is invalid or below minimum. * * This error occurs when: * - Bid is below the minimum required amount * - Bid format is incorrect * - Bid exceeds maximum allowed amount * * @example * ```typescript * import { InvalidBidError } from 'daytona-wildberries-typescript-sdk'; * * try { * await sdk.promotion.updateAuctionBids({ * bids: [{ advert_id: 123, nm_bids: [{ nm_id: 456, bid: 50, placement: 'search' }] }] * }); * } catch (error) { * if (error instanceof InvalidBidError) { * console.error(`Minimum bid is ${error.minBid}`); * // Increase bid amount and retry * } * } * ``` */ export declare class InvalidBidError extends ValidationError { /** * Minimum bid amount required (if available) */ readonly minBid?: number; /** * Maximum bid amount allowed (if applicable) */ readonly maxBid?: number; /** * Current bid amount that was rejected */ readonly currentBid?: number; /** * Creates an InvalidBidError * * @param message - Error message describing the bid validation failure * @param context - Additional context (minBid, maxBid, currentBid) * @param response - API response body if available * @param requestId - Correlation ID for debugging */ constructor(message: string, context?: { field?: string; minBid?: number; maxBid?: number; currentBid?: number; }, response?: unknown, requestId?: string); /** * Returns user-friendly error message with bid requirements * * @returns Error message with specific bid constraints */ getUserMessage(): string; /** * Custom JSON serialization */ toJSON(): { name: string; message: string; statusCode: number; fieldErrors?: Record; minBid?: number; maxBid?: number; currentBid?: number; response?: unknown; requestId?: string; }; } /** * Error thrown when campaign budget is exceeded or insufficient. * * This error occurs when: * - Requested operation would exceed campaign budget * - Insufficient funds in account for deposit * - Budget limit reached for billing period * * @example * ```typescript * import { BudgetExceededError } from 'daytona-wildberries-typescript-sdk'; * * try { * await sdk.promotion.createBudgetDeposit({ sum: 50000 }, { id: 123 }); * } catch (error) { * if (error instanceof BudgetExceededError) { * console.error(`Budget exceeded: ${error.message}`); * console.error(`Available: ${error.availableBudget}, Required: ${error.requiredBudget}`); * } * } * ``` */ export declare class BudgetExceededError extends WBAPIError { /** * Available budget amount */ readonly availableBudget?: number; /** * Required budget amount for the operation */ readonly requiredBudget?: number; /** * Creates a BudgetExceededError * * @param message - Error message describing the budget issue * @param context - Budget information (available, required) * @param response - API response body if available * @param requestId - Correlation ID for debugging */ constructor(message: string, context?: { availableBudget?: number; requiredBudget?: number; }, response?: unknown, requestId?: string); /** * Returns user-friendly error message with budget details * * @returns Error message with budget information */ getUserMessage(): string; /** * Custom JSON serialization */ toJSON(): { name: string; message: string; statusCode: number; availableBudget?: number; requiredBudget?: number; response?: unknown; requestId?: string; }; } /** * Error thrown when attempting invalid campaign state transitions. * * Campaign lifecycle states: * - `-1`: Deleted (being deleted, will complete in 10 minutes) * - `4`: Ready to launch * - `7`: Completed * - `8`: Cancelled * - `9`: Active * - `11`: Paused * * Valid transitions: * - Ready (4) → Active (9) via startCampaign() * - Active (9) → Paused (11) via pauseCampaign() * - Paused (11) → Active (9) via startCampaign() * - Active/Paused → Completed (7) via stopCampaign() * * @example * ```typescript * import { InvalidCampaignStateError } from 'daytona-wildberries-typescript-sdk'; * * try { * // Trying to start an already active campaign * await sdk.promotion.startCampaign(123); * } catch (error) { * if (error instanceof InvalidCampaignStateError) { * console.error(`Cannot ${error.attemptedAction} campaign in ${error.currentState} state`); * console.error('Valid states:', error.validStates); * } * } * ``` */ export declare class InvalidCampaignStateError extends WBAPIError { /** * Current campaign state */ readonly currentState: string; /** * Action that was attempted */ readonly attemptedAction: string; /** * List of valid states for the attempted action */ readonly validStates?: string[]; /** * Creates an InvalidCampaignStateError * * @param currentState - Current state of the campaign * @param attemptedAction - Action that was attempted (start, pause, stop, delete) * @param validStates - Optional list of valid states for this action * @param response - API response body if available * @param requestId - Correlation ID for debugging */ constructor(currentState: string, attemptedAction: string, validStates?: string[], response?: unknown, requestId?: string); /** * Returns user-friendly error message with state transition guidance * * @returns Error message with valid state transitions */ getUserMessage(): string; /** * Custom JSON serialization */ toJSON(): { name: string; message: string; statusCode: number; currentState: string; attemptedAction: string; validStates?: string[]; response?: unknown; requestId?: string; }; } //# sourceMappingURL=promotion-errors.d.ts.map