kitstore-cli 1.0.89 → 1.0.90
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 +14 -1
- package/package.json +1 -1
package/dist/api/client.js
CHANGED
|
@@ -4,8 +4,21 @@ 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
|
|
10
|
+
let basePath;
|
|
11
|
+
if (options?.server) {
|
|
12
|
+
// Explicit server option takes highest priority
|
|
13
|
+
basePath = options.server;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
// Get config to resolve server (will use default-config if available)
|
|
17
|
+
const cfg = await (0, config_1.getConfig)();
|
|
18
|
+
basePath = cfg.server || 'http://localhost:3000';
|
|
19
|
+
}
|
|
20
|
+
// Get token from options or config
|
|
7
21
|
const cfg = await (0, config_1.getConfig)();
|
|
8
|
-
const basePath = options?.server || cfg.server || 'http://localhost:3000';
|
|
9
22
|
const token = options?.token || cfg.token;
|
|
10
23
|
const configuration = new generated_1.Configuration({
|
|
11
24
|
basePath,
|