@icepanel/sdk 0.0.39 → 0.0.40
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.
|
@@ -51,13 +51,19 @@ class IcePanelClient extends Client_1.IcePanelClient {
|
|
|
51
51
|
updatedOptions.baseUrl = () => __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
const baseUrl = options.baseUrl ? yield core.Supplier.get(options.baseUrl) : undefined;
|
|
53
53
|
if (baseUrl) {
|
|
54
|
-
|
|
54
|
+
const url = new URL(baseUrl);
|
|
55
|
+
url.pathname = `/${options.apiVersion}`;
|
|
56
|
+
return url.toString();
|
|
55
57
|
}
|
|
56
58
|
const environment = options.environment ? yield core.Supplier.get(options.environment) : undefined;
|
|
57
59
|
if (environment) {
|
|
58
|
-
|
|
60
|
+
const url = new URL(`https://api.${environment}.icepanel.cloud`);
|
|
61
|
+
url.pathname = `/${options.apiVersion}`;
|
|
62
|
+
return url.toString();
|
|
59
63
|
}
|
|
60
|
-
|
|
64
|
+
const url = new URL(`https://api.icepanel.io`);
|
|
65
|
+
url.pathname = `/${options.apiVersion}`;
|
|
66
|
+
return url.toString();
|
|
61
67
|
});
|
|
62
68
|
if (options.apiKey) {
|
|
63
69
|
updatedOptions.headers = Object.assign(Object.assign({}, updatedOptions.headers), { 'X-API-Key': options.apiKey });
|
|
@@ -15,13 +15,19 @@ export class IcePanelClient extends Client {
|
|
|
15
15
|
updatedOptions.baseUrl = () => __awaiter(this, void 0, void 0, function* () {
|
|
16
16
|
const baseUrl = options.baseUrl ? yield core.Supplier.get(options.baseUrl) : undefined;
|
|
17
17
|
if (baseUrl) {
|
|
18
|
-
|
|
18
|
+
const url = new URL(baseUrl);
|
|
19
|
+
url.pathname = `/${options.apiVersion}`;
|
|
20
|
+
return url.toString();
|
|
19
21
|
}
|
|
20
22
|
const environment = options.environment ? yield core.Supplier.get(options.environment) : undefined;
|
|
21
23
|
if (environment) {
|
|
22
|
-
|
|
24
|
+
const url = new URL(`https://api.${environment}.icepanel.cloud`);
|
|
25
|
+
url.pathname = `/${options.apiVersion}`;
|
|
26
|
+
return url.toString();
|
|
23
27
|
}
|
|
24
|
-
|
|
28
|
+
const url = new URL(`https://api.icepanel.io`);
|
|
29
|
+
url.pathname = `/${options.apiVersion}`;
|
|
30
|
+
return url.toString();
|
|
25
31
|
});
|
|
26
32
|
if (options.apiKey) {
|
|
27
33
|
updatedOptions.headers = Object.assign(Object.assign({}, updatedOptions.headers), { 'X-API-Key': options.apiKey });
|