maxpool 1.24.3 → 1.24.4
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/package.json +1 -1
- package/src/zai-reset-cards.js +8 -3
package/package.json
CHANGED
package/src/zai-reset-cards.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Endpoints (verified live 2026-09-30):
|
|
8
8
|
* GET /api/biz/customer-package-reset/list?targetType=PERSONAL
|
|
9
9
|
* -> data.fiveHourResets[] / weekResets[], each {recordId, grantType,
|
|
10
|
-
* expireTime 'YYYY-MM-DD HH:mm:ss' (UTC), available}
|
|
10
|
+
* expireTime 'YYYY-MM-DD HH:mm:ss' (Beijing, UTC+8), available}
|
|
11
11
|
* POST /api/biz/customer-package-reset/use
|
|
12
12
|
* body {recordId, targetType:'PERSONAL', resetType:'WEEK'|'FIVE_HOUR',
|
|
13
13
|
* requestId} -> envelope; data echoes the recordId on success
|
|
@@ -31,12 +31,17 @@ const BASE = 'https://api.z.ai/api/biz/customer-package-reset';
|
|
|
31
31
|
const LIST_URL = `${BASE}/list?targetType=PERSONAL`;
|
|
32
32
|
const USE_URL = `${BASE}/use`;
|
|
33
33
|
|
|
34
|
-
/** 'YYYY-MM-DD HH:mm:ss' (z.ai has no timezone suffix; it is UTC) -> epoch ms. */
|
|
34
|
+
/** 'YYYY-MM-DD HH:mm:ss' (z.ai has no timezone suffix; it is UTC+8) -> epoch ms. */
|
|
35
35
|
export function parseCardExpiry(s) {
|
|
36
36
|
if (!s || typeof s !== 'string') return null;
|
|
37
37
|
const m = s.match(/^(\d{4})-(\d{2})-(\d{2})[ T](\d{2}):(\d{2}):(\d{2})/);
|
|
38
38
|
if (!m) return null;
|
|
39
|
-
|
|
39
|
+
// z.ai timestamps are BEIJING time (UTC+8), not UTC. Measured 2026-10-01: a card
|
|
40
|
+
// redeemed at 16:08:43 UTC came back as lastWeekResetTime "00:08:44" next day, and
|
|
41
|
+
// the weekly window it opened ends exactly 7d after 16:08:43 UTC. Reading these as
|
|
42
|
+
// UTC put every expiry 8 hours LATE — the dying-value rule would fire 8h too late
|
|
43
|
+
// and a card would look valid for 8h after it died.
|
|
44
|
+
return Date.UTC(+m[1], +m[2] - 1, +m[3], +m[4], +m[5], +m[6]) - 8 * 3600_000;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
/** Normalize a raw card array -> [{recordId, expiresAt, expired}], available only. */
|