maxpool 1.24.2 → 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/tui.js +4 -1
- package/src/zai-reset-cards.js +8 -3
package/package.json
CHANGED
package/src/tui.js
CHANGED
|
@@ -2165,8 +2165,11 @@ export class TUI {
|
|
|
2165
2165
|
if (rg?.eligible) for (const g of (rg.grants || [])) {
|
|
2166
2166
|
if (g.usableNow && !g.expired && g.endsAt != null && g.endsAt < soonest) soonest = g.endsAt;
|
|
2167
2167
|
}
|
|
2168
|
+
// Expiry is ALWAYS shown when a reset exists (owner 2026-10-01: "what is the
|
|
2169
|
+
// proper way to communicate if we have a reset, and when does it expire" —
|
|
2170
|
+
// both facts, always). Hours under 24h, days at or above.
|
|
2168
2171
|
const days = soonest === Infinity ? null : (soonest - Date.now()) / 86400_000;
|
|
2169
|
-
if (days != null
|
|
2172
|
+
if (days != null) {
|
|
2170
2173
|
suffix = days < 1 ? '~' + Math.max(1, Math.round(days * 24)) + 'h'
|
|
2171
2174
|
: '~' + Math.max(1, Math.round(days)) + 'd';
|
|
2172
2175
|
}
|
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. */
|