@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 +10 -0
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.global.js +10 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/enums.ts +2 -0
- package/src/models.ts +6 -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.0
|
|
90
|
+
userAgent: cfg.userAgent ?? `@perk-net/perk-pushplus-sdk/1.1.0`,
|
|
91
91
|
};
|
|
92
92
|
}
|
package/src/enums.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 时必传。 */
|
|
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 时必传。 */
|
|
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 {
|