@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/package.json
CHANGED
package/src/config.ts
CHANGED
|
@@ -87,6 +87,6 @@ export function resolveConfig(input: PushPlusConfig | undefined | null): Resolve
|
|
|
87
87
|
logRequest: cfg.logRequest ?? false,
|
|
88
88
|
rateLimitGuardEnabled: cfg.rateLimitGuardEnabled ?? true,
|
|
89
89
|
rateLimitCooldownMs: cfg.rateLimitCooldownMs ?? 0,
|
|
90
|
-
userAgent: cfg.userAgent ?? `@perk-net/perk-pushplus-sdk/1.
|
|
90
|
+
userAgent: cfg.userAgent ?? `@perk-net/perk-pushplus-sdk/1.1.1`,
|
|
91
91
|
};
|
|
92
92
|
}
|
package/src/enums.ts
CHANGED
|
@@ -44,6 +44,12 @@ export enum Template {
|
|
|
44
44
|
ROUTE = 'route',
|
|
45
45
|
/** 支付成功通知模板。 */
|
|
46
46
|
PAY = 'pay',
|
|
47
|
+
/** 表单格式模板;发送时需传 pushId(表单编码)。 */
|
|
48
|
+
FORM = 'form',
|
|
49
|
+
/** 文档格式模板(push 文档);发送时需传 pushId。 */
|
|
50
|
+
DOC = 'doc',
|
|
51
|
+
/** 表格格式模板(push 表格);发送时需传 pushId。 */
|
|
52
|
+
EXCEL = 'excel',
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
/**
|
package/src/index.ts
CHANGED
package/src/models.ts
CHANGED
|
@@ -56,6 +56,8 @@ export interface SendRequest {
|
|
|
56
56
|
to?: string;
|
|
57
57
|
/** 预处理编码(仅会员)。 */
|
|
58
58
|
pre?: string;
|
|
59
|
+
/** push 编码;template 为 form/doc/excel 时必传。 */
|
|
60
|
+
pushId?: string;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
export class SendRequestBuilder {
|
|
@@ -72,6 +74,7 @@ export class SendRequestBuilder {
|
|
|
72
74
|
timestamp(v?: number): this { this.req.timestamp = v; return this; }
|
|
73
75
|
to(v?: string): this { this.req.to = v; return this; }
|
|
74
76
|
pre(v?: string): this { this.req.pre = v; return this; }
|
|
77
|
+
pushId(v?: string): this { this.req.pushId = v; return this; }
|
|
75
78
|
|
|
76
79
|
build(): SendRequest {
|
|
77
80
|
return { ...this.req };
|
|
@@ -104,6 +107,8 @@ export interface BatchSendRequest {
|
|
|
104
107
|
timestamp?: number;
|
|
105
108
|
to?: string;
|
|
106
109
|
pre?: string;
|
|
110
|
+
/** push 编码;template 为 form/doc/excel 时必传。 */
|
|
111
|
+
pushId?: string;
|
|
107
112
|
}
|
|
108
113
|
|
|
109
114
|
/**
|
|
@@ -127,6 +132,7 @@ export class BatchSendRequestBuilder {
|
|
|
127
132
|
timestamp(v?: number): this { this.req.timestamp = v; return this; }
|
|
128
133
|
to(v?: string): this { this.req.to = v; return this; }
|
|
129
134
|
pre(v?: string): this { this.req.pre = v; return this; }
|
|
135
|
+
pushId(v?: string): this { this.req.pushId = v; return this; }
|
|
130
136
|
|
|
131
137
|
/** 追加一个 channel。 */
|
|
132
138
|
channel(ch: Channel | string): this {
|
|
@@ -233,6 +239,14 @@ export interface AccessKeyResult {
|
|
|
233
239
|
|
|
234
240
|
/* ============================== 开放接口 - user ============================== */
|
|
235
241
|
|
|
242
|
+
/** 会员信息。 */
|
|
243
|
+
export interface VipInfo {
|
|
244
|
+
/** 是否会员;0-否,1-是。 */
|
|
245
|
+
isVip?: number;
|
|
246
|
+
/** 会员到期日。 */
|
|
247
|
+
lastDay?: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
236
250
|
export interface UserInfo {
|
|
237
251
|
openId?: string;
|
|
238
252
|
unionId?: string;
|
|
@@ -245,6 +259,10 @@ export interface UserInfo {
|
|
|
245
259
|
emailStatus?: number;
|
|
246
260
|
birthday?: string;
|
|
247
261
|
points?: number;
|
|
262
|
+
/** 会员信息。 */
|
|
263
|
+
vipInfo?: VipInfo;
|
|
264
|
+
/** 实名认证状态;0-未实名,1-已实名。 */
|
|
265
|
+
verifyStatus?: number;
|
|
248
266
|
}
|
|
249
267
|
|
|
250
268
|
export interface SendCount {
|