UNPKG

coa-wx-isv

Version:

一个轻量的微信SDK服务商版 for Node.js

52 lines (51 loc) 2.5 kB
/// <reference types="node" /> import { WxIsvServiceBase } from '../libs/WxIsvServiceBase'; export declare class WxIsvMaterialService extends WxIsvServiceBase { /** * 新增临时素材 * 详见 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html * @param accessToken 接口调用凭证 * @param buffer 文件buffer * @param filename 文件name */ uploadImage(accessToken: string, buffer: Buffer, filename: string): Promise<any>; buildMultipartForm(data: { buffer: Buffer; filename: string; }): Promise<{ body: Buffer; boundary: string; }>; /** * 公众号获取永久素材 * 详见 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Get_materials_list.html * @param accessToken 接口调用凭证 * @param mediaId 要获取的素材的media_id */ getMaterial(accessToken: string, mediaId: string): Promise<any>; /** * 公众号获取素材列表 * 详见 https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/Get_materials_list.html * @param accessToken 接口调用凭证 * @param type 素材的类型,图片(image)、视频(video)、语音 (voice)、图文(news) * @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回 * @param count 返回素材的数量,取值在1到20之间 */ getMaterialList(accessToken: string, type: string, offset: number, count: number): Promise<any>; /** * 公众号通过 article_id 获取已发布文章 * 详见 https://developers.weixin.qq.com/doc/offiaccount/Publish/Get_article_from_id.html * @param accessToken 接口调用凭证 * @param articleId 要获取的草稿的article_id */ getArticle(accessToken: string, articleId: string): Promise<any>; /** * 公众号获取成功发布列表 * 详见 https://developers.weixin.qq.com/doc/offiaccount/Publish/Get_publication_records.html * @param accessToken 接口调用凭证 * @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材返回 * @param count 返回素材的数量,取值在1到20之间 * @param noContent 1 表示不返回 content 字段,0 表示正常返回,默认为 0 */ getFreePublishList(accessToken: string, offset: number, count: number, noContent: number): Promise<any>; }