ragebuttonapi 1.0.0 → 1.0.1
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/cli.js +14 -9
- package/index.js +4 -1
- package/package.json +1 -1
- package/npm-cli.tar.gz +0 -0
- package/npm-cli.zip +0 -0
package/cli.js
CHANGED
|
@@ -30,11 +30,12 @@ function loadConfig() {
|
|
|
30
30
|
return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8'));
|
|
31
31
|
}
|
|
32
32
|
} catch { /* corrupt config, treat as missing */ }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
|
|
34
|
+
// Default URL for everyone - no setup needed
|
|
35
|
+
return {
|
|
36
|
+
url: 'https://ragebutton.unaux.com',
|
|
37
|
+
apiKey: null
|
|
38
|
+
};
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
// ─── Colors (no deps, raw ANSI) ───────────────────────────────────────────────
|
|
@@ -140,10 +141,14 @@ async function cmdSetup(existing = {}) {
|
|
|
140
141
|
|
|
141
142
|
// ─── Rage command ─────────────────────────────────────────────────────────────
|
|
142
143
|
async function cmdRage(reason, cfg) {
|
|
143
|
-
if (!cfg.url
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
if (!cfg.url) {
|
|
145
|
+
console.log(`\n${err('no server url configured.')}\n`);
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
if (!cfg.apiKey) {
|
|
149
|
+
console.log(`\n${err('add ur api key:')} ${hl('rage setup')} or set RAGEBUTTON_API_KEY env var\n`);
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
147
152
|
|
|
148
153
|
// ask for reason if not provided inline
|
|
149
154
|
if (reason === null || reason === undefined) {
|
package/index.js
CHANGED
|
@@ -26,7 +26,10 @@ const https = require('https');
|
|
|
26
26
|
const http = require('http');
|
|
27
27
|
const url = require('url');
|
|
28
28
|
|
|
29
|
-
let _globalConfig = {
|
|
29
|
+
let _globalConfig = {
|
|
30
|
+
url: 'https://ragebutton.unaux.com',
|
|
31
|
+
apiKey: null
|
|
32
|
+
};
|
|
30
33
|
|
|
31
34
|
// ─── low-level request helper ────────────────────────────────────────────────
|
|
32
35
|
function request(endpoint, { method = 'GET', body = null } = {}) {
|
package/package.json
CHANGED
package/npm-cli.tar.gz
DELETED
|
Binary file
|
package/npm-cli.zip
DELETED
|
Binary file
|