@earntori/cli 0.1.1 → 0.1.2
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/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ function out(o, human) { console.log(json ? JSON.stringify(o, null, 2) : human);
|
|
|
21
21
|
function die(msg) { console.error(json ? JSON.stringify({ error: msg }) : `\u2717 ${msg}`); process.exit(1); }
|
|
22
22
|
const usd = (c) => `$${(c / 100).toFixed(2)}`;
|
|
23
23
|
async function api(cfg, method, path, body) {
|
|
24
|
-
const r = await fetch(`${cfg.base}${path}`, { method, headers: { Authorization: `Bearer ${cfg.token}`, "Content-Type": "application/json", "User-Agent": "@earntori/cli/0.1.
|
|
24
|
+
const r = await fetch(`${cfg.base}${path}`, { method, headers: { Authorization: `Bearer ${cfg.token}`, "Content-Type": "application/json", "User-Agent": "@earntori/cli/0.1.2" }, body: body ? JSON.stringify(body) : undefined });
|
|
25
25
|
const t = await r.text();
|
|
26
26
|
let j = null;
|
|
27
27
|
try {
|
|
@@ -106,8 +106,7 @@ async function stats() {
|
|
|
106
106
|
`Redemptions routed: ${s.redemptionsRouted}\n` +
|
|
107
107
|
`External rewards: ${s.external.issued} issued \u00B7 ${s.external.paid} paid \u00B7 ${s.external.unconfirmed} unconfirmed\n` +
|
|
108
108
|
`\nDeveloper program \u2014 credits earned: ${usd(s.program.creditsEarnedCents)}\n` +
|
|
109
|
-
` starter ${m.starter ? "\u2713" : "\u00B7"} first reward claimed ${m.firstRewardClaimed ? "\u2713" : "\u00B7"} first redemption routed ${m.firstRedemptionRouted ? "\u2713" : "\u00B7"}`
|
|
110
|
-
(s.program.blocked ? `\n ${s.program.blocked} payout(s) blocked by fraud rails` : ""));
|
|
109
|
+
` starter ${m.starter ? "\u2713" : "\u00B7"} first reward claimed ${m.firstRewardClaimed ? "\u2713" : "\u00B7"} first redemption routed ${m.firstRedemptionRouted ? "\u2713" : "\u00B7"}`);
|
|
111
110
|
}
|
|
112
111
|
function logout() { if (existsSync(CONFIG))
|
|
113
112
|
unlinkSync(CONFIG); out({ ok: true }, "\u2713 Signed out"); }
|