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 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
- return {};
34
- }
35
-
36
- function saveConfig(cfg) {
37
- fs.writeFileSync(CONFIG_PATH, JSON.stringify(cfg, null, 2), { mode: 0o600 });
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 || !cfg.apiKey) {
144
- console.log(`\n${err('not configured yet fr.')} run ${hl('rage setup')} first.\n`);
145
- process.exit(1);
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 = { url: null, apiKey: null };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ragebuttonapi",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "official npm package + cli for RAGEBUTTONAPI™ — register developer rage from ur terminal or node app. no account needed for anon rages.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/npm-cli.tar.gz DELETED
Binary file
package/npm-cli.zip DELETED
Binary file