@perk-net/perk-pushplus-sdk 1.0.1 → 1.1.0

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 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,7 @@ var Template = /* @__PURE__ */ ((Template2) => {
22
22
  Template2["JENKINS"] = "jenkins";
23
23
  Template2["ROUTE"] = "route";
24
24
  Template2["PAY"] = "pay";
25
+ Template2["FORM"] = "form";
25
26
  return Template2;
26
27
  })(Template || {});
27
28
  var SendStatus = /* @__PURE__ */ ((SendStatus2) => {
@@ -1135,7 +1136,7 @@ function resolveConfig(input) {
1135
1136
  logRequest: (_g = cfg.logRequest) != null ? _g : false,
1136
1137
  rateLimitGuardEnabled: (_h = cfg.rateLimitGuardEnabled) != null ? _h : true,
1137
1138
  rateLimitCooldownMs: (_i = cfg.rateLimitCooldownMs) != null ? _i : 0,
1138
- userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.0.1`
1139
+ userAgent: (_j = cfg.userAgent) != null ? _j : `@perk-net/perk-pushplus-sdk/1.1.0`
1139
1140
  };
1140
1141
  }
1141
1142
 
@@ -1376,6 +1377,10 @@ var SendRequestBuilder = class {
1376
1377
  this.req.pre = v;
1377
1378
  return this;
1378
1379
  }
1380
+ pushId(v) {
1381
+ this.req.pushId = v;
1382
+ return this;
1383
+ }
1379
1384
  build() {
1380
1385
  return { ...this.req };
1381
1386
  }
@@ -1425,6 +1430,10 @@ var BatchSendRequestBuilder = class {
1425
1430
  this.req.pre = v;
1426
1431
  return this;
1427
1432
  }
1433
+ pushId(v) {
1434
+ this.req.pushId = v;
1435
+ return this;
1436
+ }
1428
1437
  /** 追加一个 channel。 */
1429
1438
  channel(ch) {
1430
1439
  this.channelList.push(typeof ch === "string" ? ch : ch);