@abdarrahmanabdelnasir/relay-node 0.1.15 → 0.1.17

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.
@@ -21,7 +21,7 @@ const hmacSecret = process.env.COMMANDLESS_HMAC_SECRET;
21
21
  // Log API key for debugging (first 15 chars only)
22
22
  console.log(`[commandless] Using API key: ${apiKey.substring(0, 15)}... (full length: ${apiKey.length})`);
23
23
  console.log(`[commandless] Using BOT_ID: ${botId}`);
24
- console.log(`[commandless] Using base URL: ${baseUrl || 'https://api.commandless.app'}`);
24
+ console.log(`[commandless] Using base URL: ${baseUrl || 'https://commandless-app-production.up.railway.app'}`);
25
25
 
26
26
  const client = new Client({
27
27
  intents: [
@@ -1,12 +1,17 @@
1
1
  import { postJson } from "./http.js";
2
- const DEFAULT_BASE = "https://api.commandless.app";
2
+ const DEFAULT_BASE = "https://commandless-app-production.up.railway.app";
3
3
  export class RelayClient {
4
4
  constructor(opts) {
5
5
  this.maxRetries = 3;
6
6
  this.queue = [];
7
7
  this.sending = false;
8
8
  this.apiKey = opts.apiKey;
9
- this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE).replace(/\/$/, "");
9
+ let base = opts.baseUrl ?? DEFAULT_BASE;
10
+ // Auto-add https:// if no protocol provided
11
+ if (base && !base.match(/^https?:\/\//)) {
12
+ base = `https://${base}`;
13
+ }
14
+ this.baseUrl = base.replace(/\/$/, "");
10
15
  this.hmacSecret = opts.hmacSecret;
11
16
  this.timeoutMs = opts.timeoutMs ?? 15000;
12
17
  }
@@ -2,14 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RelayClient = void 0;
4
4
  const http_js_1 = require("./http.js");
5
- const DEFAULT_BASE = "https://api.commandless.app";
5
+ const DEFAULT_BASE = "https://commandless-app-production.up.railway.app";
6
6
  class RelayClient {
7
7
  constructor(opts) {
8
8
  this.maxRetries = 3;
9
9
  this.queue = [];
10
10
  this.sending = false;
11
11
  this.apiKey = opts.apiKey;
12
- this.baseUrl = (opts.baseUrl ?? DEFAULT_BASE).replace(/\/$/, "");
12
+ let base = opts.baseUrl ?? DEFAULT_BASE;
13
+ // Auto-add https:// if no protocol provided
14
+ if (base && !base.match(/^https?:\/\//)) {
15
+ base = `https://${base}`;
16
+ }
17
+ this.baseUrl = base.replace(/\/$/, "");
13
18
  this.hmacSecret = opts.hmacSecret;
14
19
  this.timeoutMs = opts.timeoutMs ?? 15000;
15
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abdarrahmanabdelnasir/relay-node",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",