// Prints the draft the UI's Renew button would PUT for a listing, read from stdin (the listing JSON). import { readFileSync } from "node:fs"; import { draftFromListing } from "../../web/src/draft.ts"; import type { Listing } from "../../web/src/verify.ts"; const l = JSON.parse(readFileSync(0, "utf8")) as Listing; const title = process.argv[2]; const d = draftFromListing(l, Number(process.argv[3] ?? 30)); if (title) d.title = title; process.stdout.write(JSON.stringify(d));