From 6e5925965ae6885ed71299a67e82cc9286d55e10 Mon Sep 17 00:00:00 2001 From: CaoMeiYouRen <996881204@qq.com> Date: Thu, 5 Jan 2023 15:50:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=20=E9=85=B7=E6=8E=A8?= =?UTF-8?q?=E3=80=81BER=E5=88=86=E9=82=AE=E4=BB=B6=E7=B3=BB=E7=BB=9F=20?= =?UTF-8?q?=E7=9A=84=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: 由于 酷推、BER分邮件系统 已无法登陆,故不再提供接口集成 --- README.md | 19 +-------- package.json | 4 +- src/index.ts | 3 -- src/push/cool-push.ts | 70 ---------------------------------- src/push/email.ts | 89 ------------------------------------------- 5 files changed, 3 insertions(+), 182 deletions(-) delete mode 100644 src/push/cool-push.ts delete mode 100644 src/push/email.ts diff --git a/README.md b/README.md index 480154e..01b4ba2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@
-> Push All In One!支持 Server 酱、~~酷推、邮件~~、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer 等多种推送方式。 +> Push All In One!支持 Server 酱、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer 等多种推送方式。 > > 温馨提示:出于安全考虑, **所有** 推送方式请在 **服务端** 使用!请勿在 **客户端(网页端)** 使用!网页端使用还将额外产生跨域问题。 @@ -47,28 +47,13 @@ npm i push-all-in-one -S ## 使用 ```ts -import { ServerChanTurbo, CoolPush, Dingtalk, Email, WechatRobot, WechatApp, PushPlus, IGot, Qmsg, XiZhi, PushDeer } from 'push-all-in-one' +import { ServerChanTurbo, Dingtalk, WechatRobot, WechatApp, PushPlus, IGot, Qmsg, XiZhi, PushDeer } from 'push-all-in-one' // Server酱。官方文档:https://sct.ftqq.com/ const SCTKEY = 'SCTxxxxxxxxxxxxxxxxxxx' const serverChanTurbo = new ServerChanTurbo(SCTKEY) serverChanTurbo.send('你好', '你好,我很可爱') -// 【已无法登陆,3.0 版本将会移除】酷推。官方文档:https://cp.xuthus.cc/ -const SKEY = '022bxxxxxxxxxxxxxxxxxx' -const coolPush = new CoolPush(SKEY) -coolPush.send('你好,我很可爱', 'send') - -// 【已无法登陆,3.0 版本将会移除】BER分邮件系统。官方文档:https://www.kancloud.cn/yuanzhu/berfenapi/1239397 -// 如果不提供 BER_KEY 将会使用免费版本进行推送。免费接口有较多限制,请自行斟酌 -const email = new Email('xxxxxxx') -email.send({ - title: '你好', - subtitle: '这是个小标题', - desp: '你好,我很可爱', - address: '123456@example.com', -}) - // 【推荐】钉钉机器人。官方文档:https://developers.dingtalk.com/document/app/custom-robot-access const ACCESS_TOKEN = 'xxxxxxxxxxxxxxxxxx' const SECRET = 'SECxxxxxxxxxxxxxxxx' diff --git a/package.json b/package.json index 41341be..5a1c0ef 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "push-all-in-one", "version": "2.3.1", - "description": "Push All In One!支持 Server酱、酷推、邮件、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer 等多种推送方式", + "description": "Push All In One!支持 Server酱、钉钉机器人、企业微信机器人、企业微信应用、pushplus、iGot 、Qmsg、息知、PushDeer 等多种推送方式", "author": "CaoMeiYouRen", "license": "MIT", "main": "dist/index.js", @@ -18,8 +18,6 @@ "server-chan", "serverchan", "server-chan-turbo", - "CoolPush", - "email", "dingtalk", "weixin", "wechat", diff --git a/src/index.ts b/src/index.ts index 4f75a1a..7b3daf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,4 @@ -export * from './push/cool-push' export * from './push/dingtalk' -export * from './push/email' export * from './push/i-got' export * from './push/push-deer' export * from './push/push-plus' @@ -9,4 +7,3 @@ export * from './push/server-chan-turbo' export * from './push/wechat-app' export * from './push/wechat-robot' export * from './push/xi-zhi' - diff --git a/src/push/cool-push.ts b/src/push/cool-push.ts deleted file mode 100644 index a1b7bbf..0000000 --- a/src/push/cool-push.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { AxiosResponse } from 'axios' -import debug from 'debug' -import { Send } from '../interfaces/send' -import { ajax } from '@/utils/ajax' -import { warn } from '@/utils/helper' - -const Debugger = debug('push:cool-push') - -/** - * 推送类型,见 [Cool Push](https://cp.xuthus.cc/)。 - * 暂不支持 一对多推送/指定特定的qq号或者群/企业微信消息推送/钉钉群消息/邮箱消息推送' - * @deprecated - */ -export type PushType = 'send' | 'group' | 'psend' | 'pgroup' | 'wx' | 'tg' - -/** - * TODO: 移除接口 - * Cool Push QQ消息推送服务。使用说明见 [Cool Push](https://cp.xuthus.cc/) - * - * @author CaoMeiYouRen - * @date 2021-02-27 - * @export - * @class CoolPush - * @deprecated 网站已无法登陆,故不再提供接口集成,3.0 版本将会移除 - */ -export class CoolPush implements Send { - /** - * 请前往 https://cp.xuthus.cc/ 领取 - * - * @private - */ - private SKEY: string - /** - * - * @author CaoMeiYouRen - * @date 2021-02-27 - * @param SKEY 请前往 https://cp.xuthus.cc/ 领取 - */ - constructor(SKEY: string) { - this.SKEY = SKEY - Debugger('set SKEY: "%s"', SKEY) - warn('CoolPush 网站已无法登陆,故不再提供接口集成,3.0 版本将会移除') - if (!this.SKEY) { - throw new Error('SKEY 是必须的!') - } - } - /** - * - * - * @author CaoMeiYouRen - * @date 2021-02-27 - * @param content 要发送的内容 - * @param [type='send'] 推送类型 - * @returns - */ - async send(content: string, type: PushType = 'send'): Promise