@magpie-community/opencode-zcode-auth 0.1.60 → 0.1.61
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/index.mjs +5 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1251,6 +1251,7 @@ async function personalResets(root, key) {
|
|
|
1251
1251
|
// hours and of the week, of which only those still available count (one
|
|
1252
1252
|
// run out stays listed a week, available false), each with its own end
|
|
1253
1253
|
// (each, soonest first, one with no end last) and the soonest as until.
|
|
1254
|
+
// One whose end has passed is not counted, whatever its flag says.
|
|
1254
1255
|
// null when the list can't be read, so no count is shown rather than 0,
|
|
1255
1256
|
// and when it holds none.
|
|
1256
1257
|
async function resetsOf(url, auth, headers) {
|
|
@@ -1266,8 +1267,11 @@ async function resetsOf(url, auth, headers) {
|
|
|
1266
1267
|
let n = 0
|
|
1267
1268
|
for (const x of Array.isArray(rs) ? rs : []) {
|
|
1268
1269
|
if (x?.available !== true) continue
|
|
1269
|
-
n++
|
|
1270
1270
|
const t = when(x.expireTime)
|
|
1271
|
+
// a reset past its end is no reset: the list can still flag it
|
|
1272
|
+
// available, and the vendor's page puts it among the expired
|
|
1273
|
+
if (t && t <= Date.now()) continue
|
|
1274
|
+
n++
|
|
1271
1275
|
if (t && (!until || t < until)) until = t
|
|
1272
1276
|
each.push(t ? { until: new Date(t).toISOString(), window } : { window })
|
|
1273
1277
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magpie-community/opencode-zcode-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan, and claims its gift plans daily",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./opencode.mjs",
|