@alphafox/cli 0.1.4 → 0.1.5

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.
@@ -6,7 +6,8 @@ const refresh_1 = require("../auth/refresh");
6
6
  const store_1 = require("../keychain/store");
7
7
  const allowlist_1 = require("../catalog/allowlist");
8
8
  async function apiRequest(options, env = process.env, fetchImpl = fetch) {
9
- const path = (0, allowlist_1.normalizeApiPath)(options.path);
9
+ // Keep query string for endpoints like /traders/performance?ids=...
10
+ const { path, query } = splitPathAndQuery(options.path);
10
11
  if ((0, allowlist_1.isInternalDisallowedPath)(path)) {
11
12
  throw Object.assign(new Error(`Path is internal and not allowed: ${path}`), {
12
13
  status: 403,
@@ -32,14 +33,14 @@ async function apiRequest(options, env = process.env, fetchImpl = fetch) {
32
33
  let url;
33
34
  if (path.startsWith("/api/v1")) {
34
35
  const origin = base.replace(/\/api\/v1$/, "");
35
- url = `${origin}${path}`;
36
+ url = `${origin}${path}${query}`;
36
37
  }
37
38
  else if (path.startsWith("/api/auth")) {
38
39
  const origin = base.replace(/\/api\/v1$/, "");
39
- url = `${origin}${path}`;
40
+ url = `${origin}${path}${query}`;
40
41
  }
41
42
  else {
42
- url = `${base}${path.startsWith("/") ? path : `/${path}`}`;
43
+ url = `${base}${path.startsWith("/") ? path : `/${path}`}${query}`;
43
44
  }
44
45
  const headers = {
45
46
  Accept: "application/json",
@@ -190,3 +191,15 @@ function sameAuthSite(a, b) {
190
191
  return false;
191
192
  }
192
193
  }
194
+ /** Split raw path so allowlist uses path-only while fetch keeps query. */
195
+ function splitPathAndQuery(raw) {
196
+ const trimmed = raw.trim();
197
+ const q = trimmed.indexOf("?");
198
+ if (q < 0) {
199
+ return { path: (0, allowlist_1.normalizeApiPath)(trimmed), query: "" };
200
+ }
201
+ return {
202
+ path: (0, allowlist_1.normalizeApiPath)(trimmed.slice(0, q)),
203
+ query: trimmed.slice(q),
204
+ };
205
+ }
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export declare const CLI_NAME = "alphafox";
2
2
  export declare const CLI_PACKAGE = "@alphafox/cli";
3
- export declare const CLI_VERSION = "0.1.4";
3
+ export declare const CLI_VERSION = "0.1.5";
4
4
  export declare const CLI_CONTRACT_VERSION = "2026-08-11";
package/dist/version.js CHANGED
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CLI_CONTRACT_VERSION = exports.CLI_VERSION = exports.CLI_PACKAGE = exports.CLI_NAME = void 0;
4
4
  exports.CLI_NAME = "alphafox";
5
5
  exports.CLI_PACKAGE = "@alphafox/cli";
6
- exports.CLI_VERSION = "0.1.4";
6
+ exports.CLI_VERSION = "0.1.5";
7
7
  exports.CLI_CONTRACT_VERSION = "2026-08-11";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphafox/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Alphafox CLI \u2014 Agent/Human entry for the public Application API.",
5
5
  "type": "commonjs",
6
6
  "bin": {