import { GetOfficesRequest, Office, City, Country, Street, Quarter, ValidateAddressRequest, ValidateAddressResponse, AddressServiceTimesRequest, AddressServiceTimesResponse, GetNearestOfficesRequest, GetNearestOfficesResponse, ShippingLabel, CreateLabelResponse, CreateLabelsResponse, DeleteLabelsResponse, UpdateLabelRequestData, UpdateLabelResponseData, UpdateLabelsRequest, UpdateLabelsResponse, CheckPossibleShipmentEditionsResponse, GroupingResponse, GroupingCancelationResponse, RequestCourierRequest, RequestCourierResponse, GetShipmentStatusesResponse, GetRequestCourierStatusResponse, GetMyAWBRequest, GetMyAWBResponse, SetITUCodeResponse, ShipmentStatus, GetClientProfilesResponse, CreateCDAgreementRequest, CreateCDAgreementResponse, ThreeWayLogisticsRequest, ThreeWayLogisticsResponse, PaymentReportRequest, PaymentReportResponse, EcontConfig, EcontApiError } from '@alphabite/econt-types'; export * from '@alphabite/econt-types'; import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios'; interface HttpClientConfig { baseURL: string; username: string; password: string; timeout?: number; maxRetries?: number; } declare class HttpClient { private client; constructor(config: HttpClientConfig); private setupInterceptors; request(config: AxiosRequestConfig): Promise>; get(url: string, config?: AxiosRequestConfig): Promise; post(url: string, data?: object, config?: AxiosRequestConfig): Promise; put(url: string, data?: object, config?: AxiosRequestConfig): Promise; delete(url: string, config?: AxiosRequestConfig): Promise; patch(url: string, data?: object, config?: AxiosRequestConfig): Promise; } /** * Base resource class that all resource classes extend from */ declare abstract class BaseResource { protected http: HttpClient; constructor(http: HttpClient); } /** * Offices resource - handles office-related operations */ declare class Offices extends BaseResource { /** * Get list of Econt offices * At least one filter is required to prevent huge responses */ list(params: GetOfficesRequest): Promise; /** * Get a specific office by code */ get(officeCode: string): Promise; /** * Get offices in a specific city */ getByCity(cityId: number): Promise; /** * Get offices in a specific country */ getByCountry(countryCode: string): Promise; /** * Get list of cities * countryCode is required to prevent huge responses */ getCities(params: { countryCode: string; cityId?: number; }): Promise; /** * Get list of countries * This endpoint returns all countries (~236) which is manageable */ getCountries(): Promise; /** * Search for streets in a city */ getStreets(cityID: number, streetName?: string): Promise; /** * Get quarters (neighborhoods) in a city */ getQuarters(cityID: number): Promise; } /** * Address resource - handles address-related operations */ declare class AddressService extends BaseResource { /** * Validate an address */ validateAddress(request: ValidateAddressRequest): Promise; /** * Get service times for an address */ addressServiceTimes(request: AddressServiceTimesRequest): Promise; /** * Find nearest offices to an address */ getNearestOffices(request: GetNearestOfficesRequest): Promise; } /** * Shipments resource - handles shipment-related operations */ declare class Shipments extends BaseResource { /** * Create a shipping label */ createLabel(label: ShippingLabel, options?: { requestCourierTimeFrom?: string; requestCourierTimeTo?: string; mode?: "calculate" | "validate" | "create" | "calculate_with_block"; }): Promise; /** * Calculate shipping cost (alias for createLabel with mode=calculate) */ calculate(label: ShippingLabel): Promise; /** * Validate label (alias for createLabel with mode=validate) */ validate(label: ShippingLabel): Promise; /** * Create multiple shipping labels */ createLabels(labels: ShippingLabel[], options?: { runAsyncAndEmailResultTo?: string; mode?: "validate" | "calculate" | "create"; }): Promise; /** * Delete/cancel labels */ deleteLabels(shipmentNumbers: string[]): Promise; /** * Update a label */ updateLabel(data: UpdateLabelRequestData): Promise; /** * Update multiple labels */ updateLabels(request: UpdateLabelsRequest): Promise; /** * Check if shipment can be edited */ checkPossibleShipmentEditions(shipmentNums: number[]): Promise; /** * Group shipments */ grouping(labels: number[]): Promise; /** * Cancel grouping */ groupingCancelation(groupLabel: number): Promise; /** * Request courier pickup */ requestCourier(request: RequestCourierRequest): Promise; /** * Get shipment statuses (tracking) */ getShipmentStatuses(shipmentNumbers: string[]): Promise; /** * Get courier request status */ getRequestCourierStatus(requestCourierIds: string[]): Promise; /** * Get AWB (Air Waybill) information */ getMyAWB(request: GetMyAWBRequest): Promise; /** * Set ITU Code for shipment */ setITUCode(awbBarcode: string, truckRegNum: string, ITU_code: string): Promise; } /** * Tracking resource - handles shipment tracking operations * Uses getShipmentStatuses endpoint */ declare class Tracking extends BaseResource { /** * Track shipments by shipment numbers */ track(shipmentNumbers: string[]): Promise; /** * Track a single shipment */ trackOne(shipmentNumber: string): Promise; } /** * Profile resource - handles profile-related operations */ declare class ProfileService extends BaseResource { /** * Get client profiles */ getClientProfiles(): Promise; /** * Create CD (Cash on Delivery) agreement */ createCDAgreement(request: CreateCDAgreementRequest): Promise; } /** * ThreeWayLogistics resource - handles 3PL operations */ declare class ThreeWayLogisticsService extends BaseResource { /** * ThreeWayLogistics operation */ threeWayLogistics(request: ThreeWayLogisticsRequest): Promise; } /** * PaymentReport resource - handles payment reporting operations */ declare class PaymentReportService extends BaseResource { /** * Get payment report */ getPaymentReport(request: PaymentReportRequest): Promise; } /** * Main Econt SDK client */ declare class EcontClient { private http; readonly offices: Offices; readonly address: AddressService; readonly shipments: Shipments; readonly tracking: Tracking; readonly profile: ProfileService; readonly threeWayLogistics: ThreeWayLogisticsService; readonly paymentReport: PaymentReportService; constructor(config: EcontConfig); } /** * Base error class for all Econt SDK errors */ declare class EcontError extends Error { constructor(message: string); } /** * Error thrown when API request fails */ declare class EcontAPIError extends EcontError { readonly statusCode?: number; readonly response?: EcontApiError; readonly requestId?: string; constructor(message: string, statusCode?: number, response?: EcontApiError, requestId?: string); static fromAxiosError(error: AxiosError): EcontAPIError; } /** * Error thrown when validation fails */ declare class EcontValidationError extends EcontError { readonly field?: string; readonly value?: string | number | boolean; constructor(message: string, field?: string, value?: string | number | boolean); } /** * Error thrown when authentication fails */ declare class EcontAuthenticationError extends EcontError { constructor(message?: string); } /** * Error thrown when rate limit is exceeded */ declare class EcontRateLimitError extends EcontError { readonly retryAfter?: number; constructor(message?: string, retryAfter?: number); } /** * Error thrown when network request fails */ declare class EcontNetworkError extends EcontError { constructor(message?: string); } export { AddressService, EcontAPIError, EcontAuthenticationError, EcontClient, EcontError, EcontNetworkError, EcontRateLimitError, EcontValidationError, Offices, PaymentReportService, ProfileService, Shipments, ThreeWayLogisticsService, Tracking };