UNPKG

@warriorteam/redai-zalo-sdk

Version:

Comprehensive TypeScript/JavaScript SDK for Zalo APIs - Official Account, ZNS, Consultation Service, Group Messaging, and Social APIs

52 lines 2.21 kB
/** * Main Zalo API client */ import { BaseClient } from "./base-client"; import { ZaloSDKConfig } from "../types/common"; /** * Zalo API client for making HTTP requests */ export declare class ZaloClient extends BaseClient { constructor(config: ZaloSDKConfig); /** * Make authenticated GET request to Zalo API */ apiGet<T = any>(endpoint: string, accessToken: string, params?: Record<string, any>): Promise<T>; /** * Make GET request with custom headers */ apiGetWithHeaders<T = any>(endpoint: string, headers: Record<string, string>): Promise<T>; /** * Make authenticated POST request to Zalo API */ apiPost<T = any>(endpoint: string, accessToken: string, data?: any, params?: Record<string, any>): Promise<T>; /** * Make authenticated PUT request to Zalo API */ apiPut<T = any>(endpoint: string, accessToken: string, data?: any, params?: Record<string, any>): Promise<T>; /** * Make authenticated DELETE request to Zalo API */ apiDelete<T = any>(endpoint: string, accessToken: string, params?: Record<string, any>): Promise<T>; /** * Upload file to Zalo API */ apiUploadFile<T = any>(endpoint: string, accessToken: string, file: Buffer | NodeJS.ReadableStream, filename: string, additionalFields?: Record<string, any>): Promise<T>; /** * Make POST request with FormData (for file uploads) */ apiPostFormData<T = any>(endpoint: string, accessToken: string, formData: FormData): Promise<T>; /** * Make request to OAuth endpoints (without access token) */ oauthRequest<T = any>(method: "GET" | "POST", endpoint: string, data?: any, headers?: Record<string, string>): Promise<T>; /** * Make request to ZNS API (different base URL) */ znsRequest<T = any>(method: "GET" | "POST" | "PUT" | "DELETE", endpoint: string, accessToken: string, data?: any, params?: Record<string, any>): Promise<T>; /** * Make request to OAuth endpoints with custom base URL */ oauthRequestWithUrl<T = any>(method: "GET" | "POST", url: string, data?: any, headers?: Record<string, string>): Promise<T>; } //# sourceMappingURL=zalo-client.d.ts.map