UNPKG

@tnwx/opencp

Version:

TTNWX 微信系开发脚手架之企业微信开放平台

95 lines (94 loc) 3.92 kB
/** * @author Javen * @copyright javendev@126.com * @description 企业微信开发平台 API */ export declare class OpenCpApi { private static getPreAuthCodeUrl; /** * 获取预授权码 */ static getPreAuthCode(): Promise<any>; private static setSessionInfoUrl; /** * 设置授权配置 * @param preAuthCode 预授权码 * @param authType 授权类型:0 正式授权, 1 测试授权。 默认值为0。注意,请确保应用在正式发布后的授权类型为“正式授权” * @param appId 允许进行授权的应用id,如1、2、3,不填或者填空数组都表示允许授权套件内所有应用(仅旧的多应用套件可传此参数,新开发者可忽略) */ static setSessionInfo(preAuthCode: string, authType?: number, appId?: Array<number>): Promise<any>; private static getPermanentCodeUrl; /** * 获取企业永久授权码 * @param authCode 临时授权码 */ static getPermanentCode(authCode: string): Promise<any>; private static getAuthInfoUrl; /** * 获取企业授权信息 * @param authCorpId 授权方corpid * @param permanentCode 永久授权码 */ static getAuthInfo(authCorpId: string, permanentCode: string): Promise<any>; private static getAdminListUrl; /** * 获取应用的管理员列表 * @param authCorpId 授权方corpid * @param agentId 授权方安装的应用agentid */ static getAdminList(authCorpId: string, agentId: string): Promise<any>; private static searchContactUrl; /** * 通讯录单个搜索 * @param authCorpId 授权方corpid * @param queryWord 搜索关键词 * @param queryType 查询类型 1:查询用户,返回用户userid列表 2:查询部门,返回部门id列表。 不填该字段或者填0代表同时查询部门跟用户 * @param agentId 应用id * @param offset 查询的偏移量 * @param limit 查询返回的最大数量,最多为50 */ static searchContact(authCorpId: string, queryWord: string, queryType: 0, agentId?: string, offset?: number, limit?: number): Promise<any>; private static batchSearchContactUrl; /** * 通讯录批量搜索 * @param authCorpId 授权方corpid * @param queryRequestList 索请求列表,每次搜索列表数量不超过50 * @param agentId 应用id */ static batchSearchContact(authCorpId: string, queryRequestList: Array<{ query_word: string; query_type?: number; offset?: number; limit?: number; }>, agentId?: string): Promise<any>; private static uploadUrl; /** * 上传临时素材 * @param mediaType 媒体文件类型 * @param filePath 文件路径 * @param accessToken AccessToken */ static upload(mediaType: string, filePath: string): Promise<any>; private static contactIdTranslateUrl; /** * 异步通讯录id转译 * @param authCorpId 授权方corpid * @param mediaIdList 需要转译的文件的media_id列表 * @param outputFileName 转译完打包的文件名,不需带后缀 */ static contactIdTranslate(authCorpId: string, mediaIdList: Array<string>, outputFileName?: string): Promise<any>; private static getBatchResultUrl; /** * 获取异步任务结果 * @param jobId 异步任务id */ static getBatchResult(jobId: string): Promise<any>; private static sortContactUrl; /** * 通讯录userid排序 * @param authCorpId 授权方corpid * @param userIdList 要排序的userid列表,最多支持1000个 * @param sortType 排序方式 0:根据姓名拼音升序排列,返回用户userid列表 1:根据姓名拼音降排列,返回用户userid列表 */ static sortContact(authCorpId: string, userIdList: Array<string>, sortType?: number): Promise<any>; }