@ahqstore/cli 0.4.3 → 0.5.2

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/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  edition = "2021"
3
3
  name = "ahqstore_cli_rs"
4
- version = "0.4.3"
4
+ version = "0.5.2"
5
5
  description = "AHQ Store CLI"
6
6
  repository = "https://github.com/ahqstore/cli"
7
7
  homepage = "https://github.com/ahqstore/cli"
@@ -32,10 +32,9 @@ chalk_rs = "1"
32
32
  lazy_static = "1"
33
33
  serde = { version = "1", features = ["derive"] }
34
34
  serde_json = "1"
35
- ahqstore-types = "2.3.0"
35
+ ahqstore-types = "3.1.0"
36
36
  reqwest = { version = "0.12", features = ["json", "blocking"] }
37
37
  sha2 = "0.10"
38
- base64 = "0.22"
39
38
  image = { version = "0.25", default-features = false, features = [
40
39
  "rayon",
41
40
  "png",
@@ -43,7 +42,7 @@ image = { version = "0.25", default-features = false, features = [
43
42
  rand = "0.8"
44
43
 
45
44
  [target.'cfg(unix)'.dependencies]
46
- openssl-sys = { version = "0.9.102", features = ["vendored"] }
45
+ openssl-sys = { version = "0.9.103", features = ["vendored"] }
47
46
 
48
47
  [build-dependencies]
49
48
  napi-build = { version = "2", optional = true }
package/README.md CHANGED
@@ -0,0 +1,25 @@
1
+ # AHQ Store CLI
2
+
3
+ Read more about it [here](https://ahqstore.github.io)
4
+
5
+ # Changelog
6
+
7
+ ## 0.5.1 23-Aug-2024 10:09PM IST
8
+
9
+ - Fix NPM Publish error
10
+
11
+ ## 0.5.0 **(I)** 23-Aug-2024 10:05PM IST
12
+
13
+ - Update to the new resources scheme (ahqstore-types v3.1.0)
14
+ - Update Dependencies
15
+
16
+ ## 0.4.x **(m)**
17
+
18
+ - Update to ahqstore-types 2.3.0
19
+
20
+ **NOTE:**
21
+
22
+ - **I** Internal Breaking Changes
23
+ - **m** Minor Breaking / Minor Addition Changes
24
+ - **B** Breaking Changes
25
+ - **P** Patch Changes
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@ahqstore/cli",
3
- "version": "0.4.3",
3
+ "version": "0.5.2",
4
+ "readme": "./README.md",
4
5
  "napi": {
5
6
  "name": "cli",
6
7
  "triples": {
@@ -16,7 +17,7 @@
16
17
  },
17
18
  "license": "MIT",
18
19
  "devDependencies": {
19
- "@napi-rs/cli": "^2.18.3"
20
+ "@napi-rs/cli": "^2.18.4"
20
21
  },
21
22
  "ava": {
22
23
  "timeout": "3m"
@@ -39,14 +40,14 @@
39
40
  "version": "napi version"
40
41
  },
41
42
  "optionalDependencies": {
42
- "@ahqstore/cli-win32-x64-msvc": "0.4.3",
43
- "@ahqstore/cli-darwin-x64": "0.4.3",
44
- "@ahqstore/cli-linux-x64-gnu": "0.4.3",
45
- "@ahqstore/cli-darwin-arm64": "0.4.3",
46
- "@ahqstore/cli-linux-arm64-gnu": "0.4.3",
47
- "@ahqstore/cli-win32-arm64-msvc": "0.4.3",
48
- "@ahqstore/cli-win32-ia32-msvc": "0.4.3",
49
- "@ahqstore/cli-darwin-universal": "0.4.3",
50
- "@ahqstore/cli-linux-riscv64-gnu": "0.4.3"
43
+ "@ahqstore/cli-win32-x64-msvc": "0.5.2",
44
+ "@ahqstore/cli-darwin-x64": "0.5.2",
45
+ "@ahqstore/cli-linux-x64-gnu": "0.5.2",
46
+ "@ahqstore/cli-darwin-arm64": "0.5.2",
47
+ "@ahqstore/cli-linux-arm64-gnu": "0.5.2",
48
+ "@ahqstore/cli-win32-arm64-msvc": "0.5.2",
49
+ "@ahqstore/cli-win32-ia32-msvc": "0.5.2",
50
+ "@ahqstore/cli-darwin-universal": "0.5.2",
51
+ "@ahqstore/cli-linux-riscv64-gnu": "0.5.2"
51
52
  }
52
53
  }
@@ -1,10 +1,9 @@
1
1
  use crate::app::ERR;
2
- use base64::engine::{general_purpose::STANDARD, Engine};
3
2
  use image::{load_from_memory_with_format as load_img, ImageFormat};
4
3
  use std::fs;
5
4
  use std::process;
6
5
 
7
- pub fn get_icon(uid: &str) -> String {
6
+ pub fn get_icon(uid: &str) -> Vec<u8> {
8
7
  let base_img = format!("./.ahqstore/images/{uid}/icon.png");
9
8
 
10
9
  let Ok(icon) = fs::read(&base_img) else {
@@ -14,10 +13,10 @@ pub fn get_icon(uid: &str) -> String {
14
13
 
15
14
  validate_png(&icon);
16
15
 
17
- STANDARD.encode(&icon)
16
+ icon
18
17
  }
19
18
 
20
- pub fn get_images(uid: &str) -> Vec<String> {
19
+ pub fn get_images(uid: &str) -> Vec<Vec<u8>> {
21
20
  let base_img = format!("./.ahqstore/images/{uid}");
22
21
 
23
22
  let Ok(image_dir) = fs::read_dir(&base_img) else {
@@ -31,7 +30,7 @@ pub fn get_images(uid: &str) -> Vec<String> {
31
30
  .map(|res| fs::read(res).expect("Unable to read bytes"))
32
31
  .map(|img| {
33
32
  validate_png(&img);
34
- return STANDARD.encode(&img);
33
+ return img;
35
34
  })
36
35
  .collect::<Vec<_>>();
37
36
 
@@ -43,7 +43,8 @@ macro_rules! windowsPlatform {
43
43
  $num,
44
44
  DownloadUrl {
45
45
  installerType: platform,
46
- url: assets[0].browser_download_url.clone(),
46
+ asset: assets[0].name.clone(),
47
+ url: "".into(),
47
48
  },
48
49
  );
49
50
 
@@ -83,7 +84,8 @@ macro_rules! linuxPlatform {
83
84
  $num,
84
85
  DownloadUrl {
85
86
  installerType: platform,
86
- url: assets[0].browser_download_url.clone(),
87
+ asset: assets[0].name.clone(),
88
+ url: "".into()
87
89
  },
88
90
  );
89
91
 
@@ -30,6 +30,7 @@ lazy_static! {
30
30
 
31
31
  #[derive(Debug, Deserialize, Serialize)]
32
32
  struct GHRelease {
33
+ pub tag_name: String,
33
34
  pub upload_url: String,
34
35
  pub assets: Vec<GHAsset>,
35
36
  }
@@ -79,20 +80,30 @@ pub fn build_config(upload: bool, gh_action: bool) {
79
80
  let (version, gh_r) = fetch_release(&repo, &r_id, &gh_token);
80
81
 
81
82
  let icon = get_icon(&config.appId);
83
+ let dspl_images = get_images(&config.appId);
84
+
85
+ let mut resources = HashMap::new();
86
+ resources.insert(0, icon);
87
+
82
88
  #[allow(non_snake_case)]
83
- let displayImages = get_images(&config.appId);
89
+ let displayImages = dspl_images.into_iter().enumerate().map(|(uid, icon)| {
90
+ resources.insert(uid as u8 + 1u8, icon);
91
+
92
+ uid as u8
93
+ }).collect();
84
94
 
85
95
  let app_id = config.appId.clone();
86
96
 
87
97
  let mut final_config: AHQStoreApplication = AHQStoreApplication {
98
+ releaseTagName: gh_r.tag_name.clone(),
88
99
  appDisplayName: config.appDisplayName,
89
100
  appId: config.appId,
90
101
  appShortcutName: config.appShortcutName,
91
102
  authorId: config.authorId,
92
103
  description: config.description,
93
104
  downloadUrls: HashMap::default(),
94
- icon,
95
105
  displayImages,
106
+ resources: Some(resources),
96
107
  app_page: config.source,
97
108
  license_or_tos: config.license_or_tos,
98
109
  install: InstallerOptions {
@@ -149,7 +160,8 @@ pub fn build_config(upload: bool, gh_action: bool) {
149
160
  num,
150
161
  DownloadUrl {
151
162
  installerType: platform,
152
- url: assets[0].browser_download_url.clone(),
163
+ asset: assets[0].name.clone(),
164
+ url: "".into()
153
165
  },
154
166
  );
155
167