zcode 0.1.45: the daily claim reads the feed as the current client does (#678)
The marketing feed (touch) and the claim now go out under ZCode 3.17.2's version header. jinpy666 found that under the pinned 3.16.3 the feed answers empty, while under 3.17.2 the day's banner shows, and checked it against the live API. The check-in no longer reads /billing/preview, which the v3.17 client doesn't poll (docs/marketing-touch-client.md in zai-org/ZCode@a9fe401). Reviewed at f805d97 and run there on mote: - bun test packages/zcode: 187 pass, 0 fail. - bun scripts/check.mjs: clean. - Broken by hand: with MARKETING_VERSION set back to 3.16.3, 4 tests go red (the touch and claim version pins, and the card's feed read). Not tried here: a live feed or claim. No ZCode account was in a sandbox, so the live run is jinpy666's (10 accounts: 7 captcha, 3 inactive). Reported by jinpy666 (#676), who wrote the fix.
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
// Plan就没显示"), and a coding account's gift buckets told apart from its
|
||||
// Coding Plan windows ("无法区分Coding Plan 和Start Plan的额度").
|
||||
//
|
||||
// The balance's plans are as ZCode's /billing/balance and /billing/preview
|
||||
// The balance's plans are as ZCode's /billing/balance says them
|
||||
// give them: plan_id, user_plan_id, name, status, starts_at and ends_at in
|
||||
// Unix seconds (usage.test.mjs's PREVIEW_CLAIMABLE is a real reply). Which
|
||||
// Unix seconds (usage.test.mjs's fixtures are real replies). Which
|
||||
// status a plan not started yet carries has not been seen, so these tests
|
||||
// give it both "active" and an unknown word: the plugin goes by starts_at.
|
||||
// Nothing leaves the machine: fetch is a fake.
|
||||
@@ -61,7 +61,7 @@ const bucket = (up, left, model = "GLM-5.1") => ({ plan_id: "zcode-v3-start-plan
|
||||
function zcode(balance, coding) {
|
||||
return serve(({ url }) => {
|
||||
if (url.pathname === "/api/v1/zcode-plan/billing/balance") return ok({ server_time: now, ...balance })
|
||||
if (url.pathname === "/api/v1/zcode-plan/billing/preview") return ok({ server_time: now, plans: [] })
|
||||
if (url.pathname === "/api/v1/marketing/touch") return ok({ deliveries: [] })
|
||||
if (!coding) return
|
||||
if (url.pathname === "/api/biz/subscription/list") return ok([{ productName: "GLM Coding Pro", status: "VALID" }])
|
||||
if (url.pathname === "/api/monitor/usage/quota/limit") return ok({ level: "pro", limits: [{ type: "CREDIT_LIMIT", unit: 3, number: 5, percentage: 25 }] })
|
||||
|
||||
Reference in New Issue
Block a user