import { TiktokConfig } from '../dto/request/config.request'; export declare function commonParameter(config: any, timestamp: any): string; declare function commonParameter2(config: any, timestamp: any): string; declare function objKeySort(obj: any): {}; declare function signRequest(params: Record, path: string, config: Record, body: Record): any; declare function parseParmsURL(url: any): {}; declare function genURLwithSignature(path: any, commonParam: any, config: any, body?: any): string; declare function getTimestampHoursAgo(hours: number): number; export declare function replacePackageId(path: string, packageId: string): string; declare function replacePlaceholder(path: string, placeholder: string, replacement: string): string; declare function getHeaders(config: TiktokConfig, contentType?: string): { 'Content-Type': string; 'x-tts-access-token': string | undefined; }; declare function httpPost(url: string, body: unknown, headers: Record): Promise; declare function httpGet(url: string, config: TiktokConfig): Promise; declare function getTimestamp(): number; declare function isAccessTokenValid(time: number): boolean; declare function isTokenExpired(time: number): boolean; export { httpGet, httpPost, getHeaders, getTimestamp, commonParameter2, objKeySort, signRequest, parseParmsURL, genURLwithSignature, getTimestampHoursAgo, replacePlaceholder, isAccessTokenValid, isTokenExpired, }; /** * TikTok Shop API error thrown by callTiktokApi()/callTiktokMultipart() * when the response has a non-zero `code` field, or when the underlying * HTTP request itself fails (network error, timeout, non-2xx status). */ declare class TiktokApiError extends Error { code: number | string; requestId?: string; status?: number; raw?: unknown; context?: string; cause?: unknown; constructor(options?: { code?: number | string; message?: string; requestId?: string; status?: number; raw?: unknown; context?: string; cause?: unknown; }); } type TiktokApiMethod = 'GET' | 'POST' | 'PUT' | 'DELETE'; /** * Generic authenticated TikTok Shop API call, backing the domain API * modules covering the full 155-endpoint surface added after the original * Order/Product/Authorization/Fulfillment v1/v2 APIs. * * Builds the signed request URL (including app_key, timestamp, and - when * present on config - shop_cipher/category_asset_cipher), sends body as * JSON when provided, and throws TiktokApiError on any TikTok error * response (code !== 0) or transport failure. */ declare function callTiktokApi(path: string, method: TiktokApiMethod, options: { query?: Record; body?: Record; }, config: TiktokConfig, context?: string): Promise; /** * Multipart/form-data TikTok Shop API call (used by uploadProductImage/ * uploadProductFile). Per the reference SDK's multipart signing * convention, the signature is computed with an EMPTY body component * (multipart bodies are never included in the HMAC base string, unlike * JSON-body requests via callTiktokApi()), even though the actual * multipart body is still sent over the wire. */ declare function callTiktokMultipart(path: string, fields: Record, fileFieldName: string, filename: string, config: TiktokConfig, context?: string): Promise; export { TiktokApiError, callTiktokApi, callTiktokMultipart }; /** * TikTok Shop OAuth token-exchange call (getAccessToken / refreshAccessToken). Unlike * callTiktokApi(), these endpoints authenticate via app_key/app_secret sent directly as query * parameters (matching the reference SDK's authRequest()) and do NOT use HMAC signing. */ declare function callTiktokAuthApi(path: string, method: TiktokApiMethod, query: Record, context?: string): Promise; export { callTiktokAuthApi };