kitstore-cli 1.0.89 → 1.0.91
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/api/client.js +13 -1
- package/package.json +1 -1
package/dist/api/client.js
CHANGED
|
@@ -4,8 +4,20 @@ exports.createApi = createApi;
|
|
|
4
4
|
const generated_1 = require("./generated");
|
|
5
5
|
const config_1 = require("../config");
|
|
6
6
|
async function createApi(options) {
|
|
7
|
+
// If server is explicitly provided in options, use it (highest priority)
|
|
8
|
+
// Otherwise, get config and use its server (which should have default-config loaded)
|
|
9
|
+
// Only fall back to localhost if all else fails
|
|
7
10
|
const cfg = await (0, config_1.getConfig)();
|
|
8
|
-
|
|
11
|
+
let basePath;
|
|
12
|
+
if (options?.server) {
|
|
13
|
+
// Explicit server option takes highest priority
|
|
14
|
+
basePath = options.server;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Use server from config (will use default-config if available)
|
|
18
|
+
basePath = cfg.server || 'http://localhost:3000';
|
|
19
|
+
}
|
|
20
|
+
// Get token from options or config
|
|
9
21
|
const token = options?.token || cfg.token;
|
|
10
22
|
const configuration = new generated_1.Configuration({
|
|
11
23
|
basePath,
|