airborne-core-cli 0.30.1 → 0.31.0

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,42 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## airborne_core_cli-v0.4.0 - 2026-04-07
6
+ #### Features
7
+ - add update files route in smithy - (0e31956) - Yash Rajput
8
+
9
+ - - -
10
+
11
+ ## v0.30.1 - 2026-04-07
12
+ #### Miscellaneous Chores
13
+ - **(version)** v0.30.1 [skip ci] - (4a81918) - Airborne Bot
14
+
15
+ - - -
16
+
17
+ ## v0.30.0 - 2026-04-07
18
+ #### Miscellaneous Chores
19
+ - **(version)** v0.30.0 [skip ci] - (e345581) - Airborne Bot
20
+
21
+ - - -
22
+
23
+ ## v0.29.2 - 2026-04-07
24
+ #### Miscellaneous Chores
25
+ - **(version)** v0.29.2 [skip ci] - (8cd1d49) - Airborne Bot
26
+
27
+ - - -
28
+
29
+ ## v0.29.1 - 2026-04-07
30
+ #### Miscellaneous Chores
31
+ - **(version)** v0.29.1 [skip ci] - (e9670ef) - Airborne Bot
32
+
33
+ - - -
34
+
35
+ ## v0.29.0 - 2026-04-07
36
+ #### Miscellaneous Chores
37
+ - **(version)** v0.29.0 [skip ci] - (4d13783) - Airborne Bot
38
+
39
+ - - -
40
+
5
41
  ## airborne_core_cli-v0.3.0 - 2026-03-26
6
42
  #### Features
7
43
  - add platform-specific configuration and improve file processing and update smithy-cli-generator submodule - (823cfe5) - Yash Rajput
package/action.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs from "fs";
2
2
  import { promises as fsPromises } from "fs";
3
3
  import path from "path";
4
- import { CreateApplicationCommand, CreateDimensionCommand, CreateFileCommand, CreateOrganisationCommand, CreatePackageCommand, CreateReleaseCommand, DeleteDimensionCommand, GetReleaseCommand, GetUserCommand, ListDimensionsCommand, ListFileGroupsCommand, ListFilesCommand, ListOrganisationsCommand, ListPackagesCommand, ListReleasesCommand, PostLoginCommand, RequestOrganisationCommand, ServeReleaseCommand, ServeReleaseV2Command, UpdateDimensionCommand, UploadFileCommand, AirborneClient } from "airborne-server-sdk"
4
+ import { CreateApplicationCommand, CreateDimensionCommand, CreateFileCommand, CreateOrganisationCommand, CreatePackageCommand, CreateReleaseCommand, DeleteDimensionCommand, GetReleaseCommand, GetUserCommand, ListDimensionsCommand, ListFileGroupsCommand, ListFilesCommand, ListOrganisationsCommand, ListPackagesCommand, ListReleasesCommand, PostLoginCommand, RequestOrganisationCommand, ServeReleaseCommand, ServeReleaseV2Command, UpdateDimensionCommand, UpdateFileCommand, UploadFileCommand, AirborneClient } from "airborne-server-sdk"
5
5
  import { fileURLToPath } from 'url';
6
6
  import { dirname } from 'path';
7
7
 
@@ -614,6 +614,30 @@ export async function UpdateDimensionAction(paramsFile, options){
614
614
  return await client.send(command);
615
615
  }
616
616
 
617
+ export async function UpdateFileAction(paramsFile, options){
618
+ let finalOptions = {};
619
+ const requiredParams = ["file_key","tag","organisation","application","token"];
620
+
621
+ if (paramsFile && paramsFile.startsWith('@')) {
622
+ const jsonFilePath = paramsFile.slice(1);
623
+ finalOptions = mergeOptionsWithJsonFile(options, jsonFilePath, requiredParams);
624
+ } else if (paramsFile) {
625
+ throw new Error("Params file must start with @ (e.g., @params.json)");
626
+ } else {
627
+ finalOptions = options;
628
+ }
629
+
630
+ // Validate that all required options are present
631
+ validateRequiredOptions(finalOptions, requiredParams);
632
+
633
+
634
+
635
+
636
+ const client = await getClient(finalOptions.token, true);
637
+ const command = new UpdateFileCommand(finalOptions);
638
+ return await client.send(command);
639
+ }
640
+
617
641
  export async function UploadFileAction(paramsFile, options){
618
642
  let finalOptions = {};
619
643
  const requiredParams = ["file","file_path","checksum","organisation","application","token"];
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Command } from "commander";
2
2
  import path from "path";
3
- import { CreateApplicationAction, CreateDimensionAction, CreateFileAction, CreateOrganisationAction, CreatePackageAction, CreateReleaseAction, DeleteDimensionAction, GetReleaseAction, GetUserAction, ListDimensionsAction, ListFileGroupsAction, ListFilesAction, ListOrganisationsAction, ListPackagesAction, ListReleasesAction, PostLoginAction, RequestOrganisationAction, ServeReleaseAction, ServeReleaseV2Action, UpdateDimensionAction, UploadFileAction } from "./action.js";
3
+ import { CreateApplicationAction, CreateDimensionAction, CreateFileAction, CreateOrganisationAction, CreatePackageAction, CreateReleaseAction, DeleteDimensionAction, GetReleaseAction, GetUserAction, ListDimensionsAction, ListFileGroupsAction, ListFilesAction, ListOrganisationsAction, ListPackagesAction, ListReleasesAction, PostLoginAction, RequestOrganisationAction, ServeReleaseAction, ServeReleaseV2Action, UpdateDimensionAction, UpdateFileAction, UploadFileAction } from "./action.js";
4
4
  import { promises as fsPromises } from "fs";
5
5
  import fs from "fs";
6
6
  import { fileURLToPath } from 'url';
@@ -116,7 +116,7 @@ function printColoredJSON(obj, indent = 2) {
116
116
  const program = new Command()
117
117
  .name("airborne-core-cli")
118
118
  .description("Command-line interface for Airborne OTA operations")
119
- .version("0.30.1");
119
+ .version("0.31.0");
120
120
 
121
121
  program
122
122
  .command("CreateApplication")
@@ -1634,6 +1634,79 @@ JSON file format (params.json):
1634
1634
  });
1635
1635
 
1636
1636
 
1637
+ program
1638
+ .command("UpdateFile")
1639
+ .argument('[params_file]', 'JSON file containing all parameters (use @params.json format)')
1640
+ .option("--file_key <file_key>", "file_key parameter")
1641
+ .option("--tag <tag>", "tag parameter")
1642
+ .option("--organisation <organisation>", "organisation parameter")
1643
+ .option("--application <application>", "application parameter")
1644
+ .option("--token <token>", "Bearer token for authentication")
1645
+ .description(`
1646
+ Update file operation:
1647
+
1648
+ Usage 1 - Individual options:
1649
+ $ airborne-core-cli UpdateFile \\
1650
+ --file_key <file_key> \\
1651
+ --tag <tag> \\
1652
+ --organisation <organisation> \\
1653
+ --application <application> \\
1654
+ --token <string>
1655
+
1656
+ Usage 2 - JSON file:
1657
+ airborne-core-cli UpdateFile @file.json
1658
+
1659
+ Usage 3 - Mixed Usage:
1660
+ $ airborne-core-cli UpdateFile @params.json --file_key <value> --tag <value> --token <value>
1661
+
1662
+ Parameters:
1663
+ --file_key <string> (required) : The file key in the path (e.g., "$file_path@version:$version_number" or "$file_path@tag:$tag")
1664
+ --tag <string> (required) : New tag to update the file with
1665
+ --organisation <string> (required) : Name of the organisation
1666
+ --application <string> (required) : Name of the application
1667
+ --token <string> (required) : Bearer token for authentication
1668
+
1669
+ `)
1670
+ .usage('<action> [options]')
1671
+ .addHelpText('after', `
1672
+ Examples:
1673
+
1674
+ 1. Using individual options:
1675
+ $ airborne-core-cli UpdateFile \\
1676
+ --file_key <file_key> \\
1677
+ --tag <tag> \\
1678
+ --organisation <organisation> \\
1679
+ --application <application> \\
1680
+ --token <string>
1681
+
1682
+ 2. Using JSON file:
1683
+ $ airborne-core-cli UpdateFile @params.json
1684
+
1685
+ 3. Mixed approach (JSON file + CLI overrides):
1686
+ $ airborne-core-cli UpdateFile @params.json --file_key <value> --tag <value> --token <value>
1687
+
1688
+ JSON file format (params.json):
1689
+ {
1690
+ "file_key": "example_file_key",
1691
+ "tag": "example_tag",
1692
+ "organisation": "example_organisation",
1693
+ "application": "example_application",
1694
+ "token": "your_bearer_token_here"
1695
+ }`)
1696
+ .action(async (paramsFile, options) => {
1697
+ try {
1698
+
1699
+ const output = await UpdateFileAction(paramsFile, options);
1700
+ console.log(printColoredJSON(output));
1701
+ process.exit(0);
1702
+ } catch (err) {
1703
+ console.error("Error message:", err.message);
1704
+ console.error("Error executing:", printColoredJSON(err));
1705
+ process.exit(1);
1706
+ }
1707
+ });
1708
+
1709
+
1637
1710
  program
1638
1711
  .command("UploadFile")
1639
1712
  .argument('[params_file]', 'JSON file containing all parameters (use @params.json format)')
@@ -1677,7 +1750,7 @@ Parameters:
1677
1750
  --file_path <string> (required) : Path where the file will be stored on sdk
1678
1751
  --tag <string> (optional) : tag to identify the file
1679
1752
  --checksum <string> (required) : SHA-256 digest of the file, encoded in Base64, used by the server to verify the integrity of the uploaded file
1680
- --organisation <string> (required)
1753
+ --organisation <string> (required) : Name of the organisation
1681
1754
  --application <string> (required) : Name of the application
1682
1755
  --token <string> (required) : Bearer token for authentication
1683
1756
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airborne-core-cli",
3
- "version": "0.30.1",
3
+ "version": "0.31.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "airborne-core-cli": "bin.js"