fvvef121-cell/dsh-aliyun-coupon ↗★ 0

dsh-aliyun-coupon

阿里云卡券(代金券)余额图框:用只读 AccessKey 走 BSS OpenAPI 查询,在 DSH 侧栏页脚显示余额、已用与到期时间。Alibaba Cloud coupon balance card in the DSH sidebar.

Package
dsh-aliyun-coupon
Compatibility
Unverified
Version
0.1.1
License
MIT
Last updated
Oct 28, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:fvvef121-cell/dsh-aliyun-coupon

配置 AccessKey

优先级:环境变量 → AK 文件。任一路径给全 akId + akSecret 即可。

方式一(默认,推荐):写进 ~/.dsh/aliyun-coupon.json

{
  "akId": "LTAI5t...",
  "akSecret": "..."
}

可选字段:stsToken(STS 临时凭据)、endpoint(国际站填 business.ap-southeast-1.aliyuncs.com)。 兼容别名:aliyunAkId / aliyunAkSecret / AccessKeyId / AccessKeySecret。 记事本保存的 UTF-8 BOM 会被自动削掉;该文件不要进 git,也不要贴进聊天。

方式二:环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID / ALIBABA_CLOUD_ACCESS_KEY_SECRET (别名 ALIYUN_AK_ID / ALIYUN_AK_SECRET),可选 ALIBABA_CLOUD_SECURITY_TOKEN、ALIYUN_BSS_ENDPOINT。

RAM 权限(最小授权)

建一个 RAM 用户,只挂下面两个只读 Action(自定义策略即可),不要用主账号 AccessKey:

{
  "Version": "1",
  "Statement": [
    { "Effect": "Allow", "Action": ["bss:DescribeCoupon", "bss:DescribeCoupons"], "Resource": ["*"] }
  ]
}
调用Action
DescribeCouponbss:DescribeCoupon
QueryCashCouponsbss:DescribeCoupons

嫌麻烦也可以直接挂系统策略 AliyunBSSReadOnlyAccess(读权限更多,但一样花不了钱、开不了资源)。 若返回 NotApplicable,说明该身份不适用于此接口——那种情况才需要主账号 AccessKey。

可选配置

在 profile 的 cordis.patch.yml 里按 id: aliyun-coupon 覆盖:

- id: aliyun-coupon
  config:
    refreshMinutes: 10
    label: 云工开物券
键默认含义
refreshMinutes10宿主轮询间隔(1–1440 分钟)
akFile~/.dsh/aliyun-coupon.jsonAK 文件路径
endpointbusiness.aliyuncs.comBSS 端点(国际站换 business.ap-southeast-1.aliyuncs.com)
label空图框标题
fullCouponNumbersfalse是否把完整券号下发到浏览器(默认脱敏)