@perk-net/perk-pushplus-sdk 1.0.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/index.cjs +12 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.global.js +12 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/enums.ts +6 -0
- package/src/index.ts +1 -0
- package/src/models.ts +18 -0
package/README.md
CHANGED
|
@@ -86,6 +86,16 @@ await client.send({
|
|
|
86
86
|
content: 'v1.0.0',
|
|
87
87
|
template: Template.MARKDOWN,
|
|
88
88
|
});
|
|
89
|
+
|
|
90
|
+
// push 表单:template=form 时需传 pushId(表单编码)
|
|
91
|
+
await client.send(
|
|
92
|
+
sendRequest()
|
|
93
|
+
.title('表单通知')
|
|
94
|
+
.content('您有新的表单待填写')
|
|
95
|
+
.template(Template.FORM)
|
|
96
|
+
.pushId('表单编码')
|
|
97
|
+
.build(),
|
|
98
|
+
);
|
|
89
99
|
```
|
|
90
100
|
|
|
91
101
|
### 3. 多渠道发送
|
package/dist/index.cjs
CHANGED
|
@@ -22,6 +22,9 @@ var Template = /* @__PURE__ */ ((Template2) => {
|
|
|
22
22
|
Template2["JENKINS"] = "jenkins";
|
|
23
23
|
Template2["ROUTE"] = "route";
|
|
24
24
|
Template2["PAY"] = "pay";
|
|
25
|
+
Template2["FORM"] = "form";
|
|
26
|
+
Template2["DOC"] = "doc";
|
|
27
|
+
Template2["EXCEL"] = "excel";
|
|
25
28
|
return Template2;
|
|
26
29
|
})(Template || {});
|
|
27
30
|
var SendStatus = /* @__PURE__ */ ((SendStatus2) => {
|
|
@@ -1135,7 +1138,7 @@ function resolveConfig(input) {
|
|
|
1135
1138
|
logRequest: (_g = cfg.logRequest) != null ? _g : false,
|
|
1136
1139
|
rateLimitGuardEnabled: (_h = cfg.rateLimitGuardEnabled) != null ? _h : true,
|
|
1137
1140
|
rateLimitCooldownMs: (_i = cfg.rateLimitCooldownMs) != null ? _i : 0,
|
|
1138
|
-
userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.
|
|
1141
|
+
userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.1.1`
|
|
1139
1142
|
};
|
|
1140
1143
|
}
|
|
1141
1144
|
|
|
@@ -1376,6 +1379,10 @@ var SendRequestBuilder = class {
|
|
|
1376
1379
|
this.req.pre = v;
|
|
1377
1380
|
return this;
|
|
1378
1381
|
}
|
|
1382
|
+
pushId(v) {
|
|
1383
|
+
this.req.pushId = v;
|
|
1384
|
+
return this;
|
|
1385
|
+
}
|
|
1379
1386
|
build() {
|
|
1380
1387
|
return { ...this.req };
|
|
1381
1388
|
}
|
|
@@ -1425,6 +1432,10 @@ var BatchSendRequestBuilder = class {
|
|
|
1425
1432
|
this.req.pre = v;
|
|
1426
1433
|
return this;
|
|
1427
1434
|
}
|
|
1435
|
+
pushId(v) {
|
|
1436
|
+
this.req.pushId = v;
|
|
1437
|
+
return this;
|
|
1438
|
+
}
|
|
1428
1439
|
/** 追加一个 channel。 */
|
|
1429
1440
|
channel(ch) {
|
|
1430
1441
|
this.channelList.push(typeof ch === "string" ? ch : ch);
|