@capawesome/cli 0.0.1 → 0.0.3
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
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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
|
+
## [0.0.3](https://github.com/capawesome-team/cli/compare/v0.0.2...v0.0.3) (2024-04-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **apps:** return bundle ID on create ([8a02925](https://github.com/capawesome-team/cli/commit/8a02925aba7580d0f96284f56478f279e84bfade))
|
|
11
|
+
* **apps:** return channel ID on create ([afec871](https://github.com/capawesome-team/cli/commit/afec8719685fc022586b78792801df575d9bf0a7))
|
|
12
|
+
|
|
13
|
+
## [0.0.2](https://github.com/capawesome-team/cli/compare/v0.0.1...v0.0.2) (2024-04-25)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* add missing shebang line ([a4c7b64](https://github.com/capawesome-team/cli/commit/a4c7b643b02cb9c74ecc8fba0b17517961aaa822))
|
|
19
|
+
|
|
5
20
|
## 0.0.1 (2024-04-25)
|
|
6
21
|
|
|
7
22
|
Initial release 🎉
|
|
@@ -29,7 +29,7 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
29
29
|
args: {
|
|
30
30
|
path: {
|
|
31
31
|
type: 'string',
|
|
32
|
-
description: 'Path to the bundle to upload. Must be a folder or zip file',
|
|
32
|
+
description: 'Path to the bundle to upload. Must be a folder (e.g. `www` or `dist`) or a zip file.',
|
|
33
33
|
},
|
|
34
34
|
appId: {
|
|
35
35
|
type: 'string',
|
|
@@ -89,8 +89,9 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
89
89
|
}
|
|
90
90
|
// Upload the bundle
|
|
91
91
|
try {
|
|
92
|
-
yield app_bundle_1.default.create({ appId: appId, formData: formData });
|
|
92
|
+
const response = yield app_bundle_1.default.create({ appId: appId, formData: formData });
|
|
93
93
|
consola_1.default.success('Bundle successfully created.');
|
|
94
|
+
consola_1.default.info(`Bundle ID: ${response.id}`);
|
|
94
95
|
}
|
|
95
96
|
catch (error) {
|
|
96
97
|
if (error instanceof axios_1.AxiosError && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
|
|
@@ -53,11 +53,12 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
53
53
|
name = yield (0, prompt_1.prompt)('Enter the name of the channel:', { type: 'text' });
|
|
54
54
|
}
|
|
55
55
|
try {
|
|
56
|
-
yield app_channel_1.default.create({
|
|
56
|
+
const response = yield app_channel_1.default.create({
|
|
57
57
|
appId,
|
|
58
58
|
name,
|
|
59
59
|
});
|
|
60
60
|
consola_1.default.success('Channel created successfully.');
|
|
61
|
+
consola_1.default.info(`Channel ID: ${response.id}`);
|
|
61
62
|
}
|
|
62
63
|
catch (error) {
|
|
63
64
|
if (error instanceof axios_1.AxiosError && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 401) {
|
package/dist/index.js
CHANGED
|
@@ -20,23 +20,24 @@ class AppBundlesServiceImpl {
|
|
|
20
20
|
}
|
|
21
21
|
create(data) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const
|
|
23
|
+
const response = yield this.httpClient.post(`/apps/${data.appId}/bundles`, data.formData, {
|
|
24
24
|
headers: Object.assign({ Authorization: `Bearer ${authorization_service_1.default.getCurrentAuthorizationToken()}` }, data.formData.getHeaders()),
|
|
25
25
|
});
|
|
26
|
-
if (!
|
|
27
|
-
throw
|
|
26
|
+
if (!response.success) {
|
|
27
|
+
throw response.error;
|
|
28
28
|
}
|
|
29
|
+
return response.data;
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
delete(data) {
|
|
32
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const
|
|
34
|
+
const response = yield this.httpClient.delete(`/apps/${data.appId}/bundles/${data.bundleId}`, {
|
|
34
35
|
headers: {
|
|
35
36
|
Authorization: `Bearer ${authorization_service_1.default.getCurrentAuthorizationToken()}`,
|
|
36
37
|
},
|
|
37
38
|
});
|
|
38
|
-
if (!
|
|
39
|
-
throw
|
|
39
|
+
if (!response.success) {
|
|
40
|
+
throw response.error;
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
}
|
|
@@ -20,19 +20,20 @@ class AppChannelsServiceImpl {
|
|
|
20
20
|
}
|
|
21
21
|
create(dto) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const
|
|
23
|
+
const response = yield this.httpClient.post(`/apps/${dto.appId}/channels`, dto, {
|
|
24
24
|
headers: {
|
|
25
25
|
Authorization: `Bearer ${authorization_service_1.default.getCurrentAuthorizationToken()}`,
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
|
-
if (!
|
|
29
|
-
throw
|
|
28
|
+
if (!response.success) {
|
|
29
|
+
throw response.error;
|
|
30
30
|
}
|
|
31
|
+
return response.data;
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
delete(data) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const
|
|
36
|
+
const response = yield this.httpClient.delete(`/apps/${data.appId}/channels`, {
|
|
36
37
|
headers: {
|
|
37
38
|
Authorization: `Bearer ${authorization_service_1.default.getCurrentAuthorizationToken()}`,
|
|
38
39
|
},
|
|
@@ -40,8 +41,8 @@ class AppChannelsServiceImpl {
|
|
|
40
41
|
name: data.name,
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
|
-
if (!
|
|
44
|
-
throw
|
|
44
|
+
if (!response.success) {
|
|
45
|
+
throw response.error;
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
}
|