UNPKG

@warriorteam/redai-zalo-sdk

Version:

Comprehensive TypeScript/JavaScript SDK for Zalo APIs - Official Account v3.0, ZNS with Full Type Safety, Consultation Service, Broadcast Service, Group Messaging with List APIs, Social APIs, Enhanced Article Management, Promotion Service v3.0 with Multip

70 lines 2.68 kB
/** * Official Account (OA) service for Zalo API */ import { ZaloClient } from '../clients/zalo-client'; import { OAInfo, MessageQuota, QuotaMessageRequest, QuotaAsset, OAStatistics, UpdateOAProfileRequest, GMFProductType } from '../types/oa'; /** * Official Account service for managing OA information and settings */ export declare class OAService { private readonly client; private readonly endpoints; constructor(client: ZaloClient); /** * Get Official Account information */ getOAInfo(accessToken: string): Promise<OAInfo>; /** * Get detailed quota message information */ getDetailedQuotaMessage(accessToken: string, request: QuotaMessageRequest): Promise<QuotaAsset[]>; /** * Get quota for specific product type */ getQuotaByProductType(accessToken: string, productType: 'cs' | 'transaction' | 'gmf10' | 'gmf50' | 'gmf100', quotaType?: 'sub_quota' | 'purchase_quota' | 'reward_quota'): Promise<QuotaAsset[]>; /** * Get available GMF quota */ getGMFQuota(accessToken: string, gmfType?: GMFProductType): Promise<QuotaAsset[]>; /** * Get consultation message quota */ getConsultationQuota(accessToken: string): Promise<QuotaAsset[]>; /** * Get transaction message quota */ getTransactionQuota(accessToken: string): Promise<QuotaAsset[]>; /** * Update OA profile information */ updateOAProfile(accessToken: string, profileData: UpdateOAProfileRequest): Promise<boolean>; /** * Get OA statistics (if available) */ getOAStatistics(accessToken: string): Promise<OAStatistics>; /** * Lấy thông tin quota tổng quan cho tin nhắn (tổng số asset và số còn khả dụng) * Lưu ý: Zalo hiện cung cấp API chi tiết qua endpoint quota/message theo asset. * Hàm này tổng hợp đơn giản để trả về cấu trúc MessageQuota phục vụ SDK. */ getMessageQuota(accessToken: string): Promise<MessageQuota>; /** * Check if OA has sufficient quota for message type */ hasQuotaForMessageType(accessToken: string, messageType: 'cs' | 'transaction' | 'promotion', requiredCount?: number): Promise<boolean>; /** * Get quota summary for all message types */ getQuotaSummary(accessToken: string): Promise<{ consultation: QuotaAsset[]; transaction: QuotaAsset[]; gmf10: QuotaAsset[]; gmf50: QuotaAsset[]; gmf100: QuotaAsset[]; }>; /** * Validate OA access token by getting OA info */ validateOAToken(accessToken: string): Promise<boolean>; } //# sourceMappingURL=oa.service.d.ts.map