@capawesome/cli 1.4.0 → 1.4.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/README.md +36 -1
- package/dist/commands/apps/bundles/create.js +25 -16
- package/dist/services/update.js +1 -1
- 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.4.1](https://github.com/capawesome-team/cli/compare/v1.4.0...v1.4.1) (2025-02-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **bundles:** add retry mechanism for file upload on failure ([86a62da](https://github.com/capawesome-team/cli/commit/86a62daa2ae50d691791714ef6a5812a6e87dc4b))
|
|
11
|
+
|
|
5
12
|
## [1.4.0](https://github.com/capawesome-team/cli/compare/v1.3.2...v1.4.0) (2025-01-29)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -10,6 +10,16 @@ The Capawesome Cloud CLI can be installed globally via npm:
|
|
|
10
10
|
npm install -g @capawesome/cli
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
The Capawesome Cloud CLI can be invoked with the `capawesome` command.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx capawesome <command> [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You can find a list of available commands in the [Command Reference](https://capawesome.io/cloud/cli/).
|
|
22
|
+
|
|
13
23
|
## Help
|
|
14
24
|
|
|
15
25
|
The Capawesome Cloud CLI ships with command documentation that is accessible with the `--help` flag.
|
|
@@ -18,10 +28,35 @@ The Capawesome Cloud CLI ships with command documentation that is accessible wit
|
|
|
18
28
|
npx capawesome --help
|
|
19
29
|
```
|
|
20
30
|
|
|
31
|
+
## Development
|
|
32
|
+
|
|
33
|
+
Run the following commands to get started with development:
|
|
34
|
+
|
|
35
|
+
1. Clone the repository:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/capawesome-team/cli.git
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. Install dependencies:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
3. Copy the `.capawesomerc.example` file to `.capawesomerc`
|
|
48
|
+
4. Run your first command:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm start -- --help
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Note:** The `--` is required to pass arguments to the script.
|
|
55
|
+
|
|
21
56
|
## Changelog
|
|
22
57
|
|
|
23
58
|
See [CHANGELOG](./CHANGELOG.md).
|
|
24
59
|
|
|
25
60
|
## License
|
|
26
61
|
|
|
27
|
-
See [LICENSE](./LICENSE.md).
|
|
62
|
+
See [LICENSE](./LICENSE.md).
|
|
@@ -245,23 +245,31 @@ exports.default = (0, citty_1.defineCommand)({
|
|
|
245
245
|
}),
|
|
246
246
|
});
|
|
247
247
|
const uploadFile = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
248
|
+
try {
|
|
249
|
+
// Generate checksum
|
|
250
|
+
const hash = yield (0, hash_1.createHash)(options.fileBuffer);
|
|
251
|
+
// Sign the bundle
|
|
252
|
+
let signature;
|
|
253
|
+
if (options.privateKeyBuffer) {
|
|
254
|
+
signature = yield (0, signature_1.createSignature)(options.privateKeyBuffer, options.fileBuffer);
|
|
255
|
+
}
|
|
256
|
+
// Create the multipart upload
|
|
257
|
+
return yield app_bundle_files_1.default.create({
|
|
258
|
+
appId: options.appId,
|
|
259
|
+
appBundleId: options.appBundleId,
|
|
260
|
+
checksum: hash,
|
|
261
|
+
fileBuffer: options.fileBuffer,
|
|
262
|
+
fileName: options.fileName,
|
|
263
|
+
href: options.href,
|
|
264
|
+
signature,
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
if (options.retryOnFailure) {
|
|
269
|
+
return uploadFile(Object.assign(Object.assign({}, options), { retryOnFailure: false }));
|
|
270
|
+
}
|
|
271
|
+
throw error;
|
|
254
272
|
}
|
|
255
|
-
// Create the multipart upload
|
|
256
|
-
return app_bundle_files_1.default.create({
|
|
257
|
-
appId: options.appId,
|
|
258
|
-
appBundleId: options.appBundleId,
|
|
259
|
-
checksum: hash,
|
|
260
|
-
fileBuffer: options.fileBuffer,
|
|
261
|
-
fileName: options.fileName,
|
|
262
|
-
href: options.href,
|
|
263
|
-
signature,
|
|
264
|
-
});
|
|
265
273
|
});
|
|
266
274
|
const uploadFiles = (options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
267
275
|
// Generate the manifest file
|
|
@@ -288,6 +296,7 @@ const uploadFiles = (options) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
288
296
|
fileName,
|
|
289
297
|
href,
|
|
290
298
|
privateKeyBuffer: options.privateKeyBuffer,
|
|
299
|
+
retryOnFailure: true,
|
|
291
300
|
});
|
|
292
301
|
yield uploadNextFile();
|
|
293
302
|
});
|
package/dist/services/update.js
CHANGED
package/package.json
CHANGED