@capawesome/cli 1.11.0 → 1.11.1
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/CHANGELOG.md +7 -0
- package/dist/utils/http-client.js +5 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.11.1](https://github.com/capawesome-team/cli/compare/v1.11.0...v1.11.1) (2025-05-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* `File must be a File object` error ([bd154a3](https://github.com/capawesome-team/cli/commit/bd154a3d418093b471d58830a7ab2e150b7d33c3))
|
|
11
|
+
|
|
5
12
|
## [1.11.0](https://github.com/capawesome-team/cli/compare/v1.10.0...v1.11.0) (2025-05-04)
|
|
6
13
|
|
|
7
14
|
|
|
@@ -18,7 +18,6 @@ const config_1 = __importDefault(require("../services/config"));
|
|
|
18
18
|
class HttpClientImpl {
|
|
19
19
|
constructor() {
|
|
20
20
|
this.baseHeaders = {
|
|
21
|
-
'Content-Type': 'application/json',
|
|
22
21
|
'User-Agent': `Capawesome CLI v${package_json_1.version}`,
|
|
23
22
|
};
|
|
24
23
|
}
|
|
@@ -26,35 +25,35 @@ class HttpClientImpl {
|
|
|
26
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
26
|
const baseUrl = yield config_1.default.getValueForKey('API_BASE_URL');
|
|
28
27
|
const urlWithHost = url.startsWith('http') ? url : baseUrl + url;
|
|
29
|
-
return axios_1.default.delete(urlWithHost, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.headers)
|
|
28
|
+
return axios_1.default.delete(urlWithHost, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.baseHeaders), config === null || config === void 0 ? void 0 : config.headers) }));
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
get(url, config) {
|
|
33
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
33
|
const baseUrl = yield config_1.default.getValueForKey('API_BASE_URL');
|
|
35
34
|
const urlWithHost = url.startsWith('http') ? url : baseUrl + url;
|
|
36
|
-
return axios_1.default.get(urlWithHost, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.headers)
|
|
35
|
+
return axios_1.default.get(urlWithHost, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.baseHeaders), config === null || config === void 0 ? void 0 : config.headers) }));
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
patch(url, data, config) {
|
|
40
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
40
|
const baseUrl = yield config_1.default.getValueForKey('API_BASE_URL');
|
|
42
41
|
const urlWithHost = url.startsWith('http') ? url : baseUrl + url;
|
|
43
|
-
return axios_1.default.patch(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.headers)
|
|
42
|
+
return axios_1.default.patch(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.baseHeaders), config === null || config === void 0 ? void 0 : config.headers) }));
|
|
44
43
|
});
|
|
45
44
|
}
|
|
46
45
|
post(url, data, config) {
|
|
47
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
47
|
const baseUrl = yield config_1.default.getValueForKey('API_BASE_URL');
|
|
49
48
|
const urlWithHost = url.startsWith('http') ? url : baseUrl + url;
|
|
50
|
-
return axios_1.default.post(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.headers)
|
|
49
|
+
return axios_1.default.post(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.baseHeaders), config === null || config === void 0 ? void 0 : config.headers) }));
|
|
51
50
|
});
|
|
52
51
|
}
|
|
53
52
|
put(url, data, config) {
|
|
54
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
54
|
const baseUrl = yield config_1.default.getValueForKey('API_BASE_URL');
|
|
56
55
|
const urlWithHost = url.startsWith('http') ? url : baseUrl + url;
|
|
57
|
-
return axios_1.default.put(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.headers)
|
|
56
|
+
return axios_1.default.put(urlWithHost, data, Object.assign(Object.assign({}, config), { headers: Object.assign(Object.assign({}, this.baseHeaders), config === null || config === void 0 ? void 0 : config.headers) }));
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
59
|
}
|
package/package.json
CHANGED