@ahqstore/cli 0.3.5 → 0.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/Cargo.toml CHANGED
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  edition = "2021"
3
3
  name = "ahqstore_cli_rs"
4
- version = "0.3.5"
4
+ version = "0.4.1"
5
5
  description = "AHQ Store CLI"
6
6
  repository = "https://github.com/ahqstore/cli"
7
7
  homepage = "https://github.com/ahqstore/cli"
@@ -17,33 +17,36 @@ path = "src/lib.rs"
17
17
  name = "ahqstore"
18
18
  path = "src/main.rs"
19
19
 
20
+ [package.metadata.binstall]
21
+ pkg-url = "{ repo }/releases/download/{ version }/{ name }-{ target }.zip"
22
+ pkg-fmt = "zip"
23
+
20
24
  [dependencies]
21
25
  # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
22
- napi = { version = "2.12.2", default-features = false, features = [
26
+ napi = { version = "2", default-features = false, features = [
23
27
  "napi4",
24
28
  ], optional = true }
25
- napi-derive = { version = "2.12.2", optional = true }
26
- inquire = { version = "0.7.5", features = ["editor"] }
27
- chalk_rs = "1.0.1"
28
- lazy_static = "1.4.0"
29
- serde = { version = "1.0.203", features = ["derive"] }
30
- serde_json = "1.0.117"
31
- ahqstore-types = "2.0.0"
29
+ napi-derive = { version = "2", optional = true }
30
+ inquire = { version = "0", features = ["editor"] }
31
+ chalk_rs = "1"
32
+ lazy_static = "1"
33
+ serde = { version = "1", features = ["derive"] }
34
+ serde_json = "1"
35
+ ahqstore-types = "2.3.0"
32
36
  reqwest = { version = "0.12", features = ["json", "blocking"] }
33
- sha2 = "0.10.8"
34
- base64 = "0.22.1"
37
+ sha2 = "0.10"
38
+ base64 = "0.22"
35
39
  image = { version = "0.25", default-features = false, features = [
36
40
  "rayon",
37
41
  "png",
38
42
  ] }
39
- rand = "0.8.5"
43
+ rand = "0.8"
40
44
 
41
45
  [target.'cfg(unix)'.dependencies]
42
46
  openssl-sys = { version = "0.9.102", features = ["vendored"] }
43
47
 
44
-
45
48
  [build-dependencies]
46
- napi-build = { version = "2.0.1", optional = true }
49
+ napi-build = { version = "2", optional = true }
47
50
 
48
51
  [profile.release]
49
52
  lto = true
package/bundle ADDED
@@ -0,0 +1,4 @@
1
+ mkdir dist
2
+ cp ./target/release/ahqstore ./dist/ahqstore
3
+ cp ./target/release/ahqstore ./dist/ahqstore_cli_rs
4
+ zip -r ahqstore_cli_rs-$TARGET ./dist
package/bundle.ps1 ADDED
@@ -0,0 +1,4 @@
1
+ mkdir dist
2
+ cp ./target/release/ahqstore.exe ./dist/ahqstore.exe
3
+ cp ./target/release/ahqstore.exe ./dist/ahqstore_cli_rs.exe
4
+ compress-archive ./dist/* ./ahqstore_cli_rs-$env:TARGET
package/latest.md ADDED
@@ -0,0 +1,3 @@
1
+ # AHQ Store CLI v0.4.1
2
+
3
+ - Test adding cargo b(inary)install support
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ahqstore/cli",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "napi": {
5
5
  "name": "cli",
6
6
  "triples": {
@@ -39,14 +39,14 @@
39
39
  "version": "napi version"
40
40
  },
41
41
  "optionalDependencies": {
42
- "@ahqstore/cli-win32-x64-msvc": "0.3.5",
43
- "@ahqstore/cli-darwin-x64": "0.3.5",
44
- "@ahqstore/cli-linux-x64-gnu": "0.3.5",
45
- "@ahqstore/cli-darwin-arm64": "0.3.5",
46
- "@ahqstore/cli-linux-arm64-gnu": "0.3.5",
47
- "@ahqstore/cli-win32-arm64-msvc": "0.3.5",
48
- "@ahqstore/cli-win32-ia32-msvc": "0.3.5",
49
- "@ahqstore/cli-darwin-universal": "0.3.5",
50
- "@ahqstore/cli-linux-riscv64-gnu": "0.3.5"
42
+ "@ahqstore/cli-win32-x64-msvc": "0.4.1",
43
+ "@ahqstore/cli-darwin-x64": "0.4.1",
44
+ "@ahqstore/cli-linux-x64-gnu": "0.4.1",
45
+ "@ahqstore/cli-darwin-arm64": "0.4.1",
46
+ "@ahqstore/cli-linux-arm64-gnu": "0.4.1",
47
+ "@ahqstore/cli-win32-arm64-msvc": "0.4.1",
48
+ "@ahqstore/cli-win32-ia32-msvc": "0.4.1",
49
+ "@ahqstore/cli-darwin-universal": "0.4.1",
50
+ "@ahqstore/cli-linux-riscv64-gnu": "0.4.1"
51
51
  }
52
52
  }
@@ -0,0 +1,95 @@
1
+ macro_rules! f {
2
+ ($($x:tt)*) => {
3
+ format!($($x)*)
4
+ };
5
+ }
6
+
7
+ macro_rules! s {
8
+ ($($x:tt)*) => {
9
+ stringify!($($x)*)
10
+ };
11
+ }
12
+
13
+ #[macro_export]
14
+ macro_rules! windowsPlatform {
15
+ ($num: ident, $win: ident, $config: ident, $gh_r: ident, $final_config: ident, $platform: ident, $options: ident, $finder: ident) => {
16
+ $num += 1;
17
+ if let Some(platform) = $config.platform.$platform {
18
+ if !matches!(&platform, &InstallerFormat::LinuxAppImage | &InstallerFormat::AndroidApkZip) {
19
+ ERR.println(&"Invalid File Format, expected a valid windows format");
20
+ }
21
+
22
+ let Some(options) = $config.platform.$options else {
23
+ ERR.println(&f!("{} Options not found!", s!($win)));
24
+ process::exit(1);
25
+ };
26
+ let Some(finder) = $config.finder.$finder else {
27
+ ERR.println(&f!("{} Finder config not found!", s!($win)));
28
+ process::exit(1);
29
+ };
30
+
31
+ let assets = crate::app::build::find_assets(&$gh_r, &finder);
32
+
33
+ if assets.len() > 1 {
34
+ ERR.println(&f!("Multiple assets found while parsing {}", s!($win)));
35
+ process::exit(1);
36
+ }
37
+ if assets.len() == 0 {
38
+ ERR.println(&f!("No assets found while parsing {}", s!($win)));
39
+ process::exit(1);
40
+ }
41
+
42
+ $final_config.downloadUrls.insert(
43
+ $num,
44
+ DownloadUrl {
45
+ installerType: platform,
46
+ url: assets[0].browser_download_url.clone(),
47
+ },
48
+ );
49
+
50
+ $final_config.install.$win = Some(InstallerOptionsWindows {
51
+ assetId: $num,
52
+ exec: options.zip_file_exec.map_or(None, |a| Some(a.to_string())),
53
+ installerArgs: options
54
+ .exe_installer_args
55
+ .map_or(None, |a| Some(a.iter().map(|x| x.to_string()).collect())),
56
+ });
57
+ }
58
+ };
59
+ }
60
+
61
+ #[macro_export]
62
+ macro_rules! linuxPlatform {
63
+ ($num: ident, $linux: ident, $config: ident, $gh_r: ident, $final_config: ident, $platform: ident, $finder: ident) => {
64
+ $num += 1;
65
+ if let Some(platform) = $config.platform.$platform {
66
+ if !matches!(&platform, &InstallerFormat::LinuxAppImage) {
67
+ ERR.println(&"Invalid File Format, expected LinuxAppImage");
68
+ }
69
+
70
+ let Some(finder) = $config.finder.$finder else {
71
+ ERR.println(&f!("{} Finder Config not found!", s!($linux)));
72
+ process::exit(1);
73
+ };
74
+
75
+ let assets = find_assets(&$gh_r, &finder);
76
+
77
+ if assets.len() > 1 {
78
+ ERR.println(&f!("Multiple assets found while parsing {}", s!($linux)));
79
+ process::exit(1);
80
+ }
81
+
82
+ $final_config.downloadUrls.insert(
83
+ $num,
84
+ DownloadUrl {
85
+ installerType: platform,
86
+ url: assets[0].browser_download_url.clone(),
87
+ },
88
+ );
89
+
90
+ $final_config.install.$linux = Some(InstallerOptionsLinux {
91
+ assetId: $num
92
+ });
93
+ }
94
+ };
95
+ }
@@ -1,6 +1,5 @@
1
1
  use ahqstore_types::{
2
- AHQStoreApplication, DownloadUrl, InstallType, InstallerFormat, InstallerOptions,
3
- InstallerOptionsLinux, InstallerOptionsWin32, Str,
2
+ AHQStoreApplication, DownloadUrl, InstallerFormat, InstallerOptions, InstallerOptionsAndroid, InstallerOptionsLinux, InstallerOptionsWindows, Str
4
3
  };
5
4
  use lazy_static::lazy_static;
6
5
  use reqwest::blocking::{Client, ClientBuilder};
@@ -8,7 +7,7 @@ use serde::{Deserialize, Serialize};
8
7
  use serde_json::{from_str, to_string, to_string_pretty};
9
8
  use std::{collections::HashMap, env, fs, process};
10
9
 
11
- use crate::app::{ERR, WARN};
10
+ use crate::app::ERR;
12
11
 
13
12
  use super::INFO;
14
13
 
@@ -19,6 +18,9 @@ use config::*;
19
18
  use icon::*;
20
19
  use release::*;
21
20
 
21
+ #[macro_use]
22
+ mod macros;
23
+
22
24
  lazy_static! {
23
25
  pub static ref CLIENT: Client = ClientBuilder::new()
24
26
  .user_agent("AHQ Store / App Builder")
@@ -91,94 +93,96 @@ pub fn build_config(upload: bool, gh_action: bool) {
91
93
  downloadUrls: HashMap::default(),
92
94
  icon,
93
95
  displayImages,
96
+ app_page: config.source,
97
+ license_or_tos: config.license_or_tos,
94
98
  install: InstallerOptions {
95
- installType: config.platform.installType,
96
99
  linux: None,
100
+ android: None,
101
+ linuxArm64: None,
102
+ linuxArm7: None,
103
+ winarm: None,
97
104
  win32: None,
98
105
  },
99
106
  repo: config.repo,
100
107
  version,
101
- site: None,
102
- source: None
108
+ site: config.site,
109
+ source: config.redistributed,
103
110
  };
104
111
 
105
- if let Some(platform) = config.platform.win32Platform {
106
- match (&platform, &final_config.install.installType) {
107
- (&InstallerFormat::WindowsZip, _) => {}
108
- (_, &InstallType::PerUser | &InstallType::Computer) => {
109
- WARN.println(
110
- &"Setting PerUser or Computer in a non WindowsZip install type does not have any effect",
111
- );
112
- process::exit(1);
113
- }
114
- _ => {}
115
- };
116
- let Some(options) = config.platform.win32Options else {
117
- ERR.println(&"Win32 Options not found!");
118
- process::exit(1);
119
- };
120
- let Some(finder) = config.finder.windowsFinder else {
121
- ERR.println(&"Win32 Finder Config not found!");
122
- process::exit(1);
123
- };
112
+ let mut num = 0;
113
+ // Win x86_64
114
+ windowsPlatform!(num, win32, config, gh_r, final_config, winAmd64Platform, winAmd64Options, windowsAmd64Finder);
124
115
 
125
- let assets = find_assets(&gh_r, &finder);
116
+ // Win Arm64
117
+ windowsPlatform!(num, winarm, config, gh_r, final_config, winArm64Platform, winArm64Options, windowsArm64Finder);
126
118
 
127
- if assets.len() > 1 {
128
- ERR.println(&"Multiple assets found");
129
- process::exit(1);
130
- }
131
- if assets.len() == 0 {
132
- ERR.println(&"No assets found");
133
- process::exit(1);
134
- }
119
+ // Linux x86_64
120
+ linuxPlatform!(num, linux, config, gh_r, final_config, linuxAmd64Platform, linuxAmd64Finder);
135
121
 
136
- final_config.downloadUrls.insert(
137
- 1,
138
- DownloadUrl {
139
- installerType: platform,
140
- url: assets[0].browser_download_url.clone(),
141
- },
142
- );
122
+ // Linux Arm64
123
+ linuxPlatform!(num, linuxArm64, config, gh_r, final_config, linuxArm64Platform, linuxArm64Finder);
143
124
 
144
- final_config.install.win32 = Some(InstallerOptionsWin32 {
145
- assetId: 1,
146
- deps: Some(options.deps),
147
- exec: options.zip_file_exec.map_or(None, |a| Some(a.to_string())),
148
- installerArgs: options
149
- .exe_installer_args
150
- .map_or(None, |a| Some(a.iter().map(|x| x.to_string()).collect())),
151
- });
152
- }
125
+ // Linux Armv7
126
+ linuxPlatform!(num, linuxArm7, config, gh_r, final_config, linuxArm32Platform, linuxArm32Finder);
127
+
128
+ num += 1;
153
129
 
154
- if let Some(platform) = config.platform.linuxPlatform {
155
- let Some(finder) = config.finder.linuxFinder else {
156
- ERR.println(&"Linux Finder Config not found!");
130
+ // Android Universal
131
+ if let Some(platform) = config.platform.androidUniversal {
132
+ if !matches!(platform, InstallerFormat::AndroidApkZip) {
133
+ ERR.println(&"Invalid File Format, expected AndroidApkZip");
134
+ }
135
+
136
+ let Some(finder) = config.finder.androidUniversalFinder else {
137
+ ERR.println(&"Android Finder Config not found!");
157
138
  process::exit(1);
158
139
  };
159
140
 
160
141
  let assets = find_assets(&gh_r, &finder);
161
-
142
+
162
143
  if assets.len() > 1 {
163
- ERR.println(&"Multiple assets found");
144
+ ERR.println(&"Multiple assets found while parsing android");
164
145
  process::exit(1);
165
146
  }
166
147
 
167
148
  final_config.downloadUrls.insert(
168
- 2,
149
+ num,
169
150
  DownloadUrl {
170
151
  installerType: platform,
171
152
  url: assets[0].browser_download_url.clone(),
172
153
  },
173
154
  );
174
155
 
175
- final_config.install.linux = Some(InstallerOptionsLinux {
176
- assetId: 2
156
+ final_config.install.android = Some(InstallerOptionsAndroid {
157
+ assetId: num
177
158
  });
178
159
  }
179
160
 
180
- final_config.site = config.site;
181
- final_config.source = config.redistributed;
161
+ // if let Some(platform) = config.platform.linuxArm64Platform {
162
+ // let Some(finder) = config.finder.linuxFinder else {
163
+ // ERR.println(&"Linux Finder Config not found!");
164
+ // process::exit(1);
165
+ // };
166
+
167
+ // let assets = find_assets(&gh_r, &finder);
168
+
169
+ // if assets.len() > 1 {
170
+ // ERR.println(&"Multiple assets found");
171
+ // process::exit(1);
172
+ // }
173
+
174
+ // final_config.downloadUrls.insert(
175
+ // 2,
176
+ // DownloadUrl {
177
+ // installerType: platform,
178
+ // url: assets[0].browser_download_url.clone(),
179
+ // },
180
+ // );
181
+
182
+ // final_config.install.linux = Some(InstallerOptionsLinux {
183
+ // assetId: 2
184
+ // });
185
+ // }
182
186
 
183
187
  let config_file = to_string_pretty(&final_config).unwrap();
184
188
  let config_file = to_string(config_file.as_bytes()).unwrap();
@@ -1,15 +1,13 @@
1
1
  use std::process;
2
2
 
3
- use ahqstore_types::{AppRepo, InstallerFormat};
3
+ use ahqstore_types::AppRepo;
4
4
  use inquire::{
5
- list_option::ListOption,
6
5
  validator::{ErrorMessage, Validation},
7
- Editor, MultiSelect, Text,
6
+ Editor, Text,
8
7
  };
9
8
  use serde::{Deserialize, Serialize};
10
9
 
11
10
  use crate::app::{
12
- build::CLIENT,
13
11
  shared::{Config, IMetadata, IPlatform},
14
12
  ERR, INFO,
15
13
  };
@@ -78,78 +76,33 @@ pub fn inquire<'a>() -> (String, Config<'a>) {
78
76
 
79
77
  INFO.println(&"Validating author id & repo");
80
78
 
81
- let val: Option<()> = (|| {
82
- let data: ServerUserResp = CLIENT
83
- .get(format!(
84
- "https://ahqstore-server.onrender.com/users/{}",
85
- &user_id
86
- ))
87
- .send()
88
- .ok()?
89
- .json()
90
- .ok()?;
91
-
92
- if data.linked_acc.contains(&owner.into()) {
93
- return Some(());
94
- }
95
- None
96
- })();
97
-
98
- if let None = val {
99
- ERR.println(
100
- &r#"Could not validate author id with github username. It may be because:
101
- - The account id provided is not valid
102
- - The account id has developer mode disabled
103
- - The GitHub repo owner doesn't seem to be in the list of linked_accounts
104
- - The GitHub repo is invalid"#,
105
- );
106
- process::exit(1);
107
- }
108
-
109
- let validator = |input: &[ListOption<&InstallerFormat>]| {
110
- if input.len() == 0 {
111
- return Ok(Validation::Invalid(
112
- "You must select at least one target".into(),
113
- ));
114
- }
115
- if input.len() > 2 {
116
- return Ok(Validation::Invalid(
117
- "You can only select two targets".into(),
118
- ));
119
- }
120
-
121
- let flagged = vec![0, 1, 2, 3];
122
- if input
123
- .iter()
124
- .filter(|a| flagged.contains(&a.index))
125
- .collect::<Vec<_>>()
126
- .len()
127
- > 1
128
- {
129
- return Ok(Validation::Invalid(
130
- "You can only select one bundle target for a platform".into(),
131
- ));
132
- }
133
-
134
- Ok(Validation::Valid)
135
- };
136
-
137
- let Ok(platforms) = MultiSelect::new(
138
- "Which platforms do you intend to support?",
139
- vec![
140
- InstallerFormat::WindowsZip,
141
- InstallerFormat::WindowsInstallerMsi,
142
- InstallerFormat::WindowsInstallerExe,
143
- InstallerFormat::WindowsUWPMsix,
144
- InstallerFormat::LinuxAppImage,
145
- ],
146
- )
147
- .with_default(&[0])
148
- .with_validator(validator)
149
- .prompt() else {
150
- ERR.println(&"Must Select a platform");
151
- process::exit(1);
152
- };
79
+ // let val: Option<()> = (|| {
80
+ // let data: ServerUserResp = CLIENT
81
+ // .get(format!(
82
+ // "https://ahqstore-server.onrender.com/users/{}",
83
+ // &user_id
84
+ // ))
85
+ // .send()
86
+ // .ok()?
87
+ // .json()
88
+ // .ok()?;
89
+
90
+ // if data.linked_acc.contains(&owner.into()) {
91
+ // return Some(());
92
+ // }
93
+ // None
94
+ // })();
95
+
96
+ // if let None = val {
97
+ // ERR.println(
98
+ // &r#"Could not validate author id with github username. It may be because:
99
+ // - The account id provided is not valid
100
+ // - The account id has developer mode disabled
101
+ // - The GitHub repo owner doesn't seem to be in the list of linked_accounts
102
+ // - The GitHub repo is invalid"#,
103
+ // );
104
+ // process::exit(1);
105
+ // }
153
106
 
154
107
  (
155
108
  app_id.clone(),
@@ -163,7 +116,7 @@ pub fn inquire<'a>() -> (String, Config<'a>) {
163
116
  author: owner.into(),
164
117
  repo: repo.into(),
165
118
  },
166
- IPlatform::new(platforms),
119
+ IPlatform::new()
167
120
  ),
168
121
  )
169
122
  }
@@ -23,7 +23,13 @@ pub fn create(force: bool) {
23
23
  fs::write(format!("{}/icon.png", &base_img), icon).ok()?;
24
24
 
25
25
  let readme = include_str!("./readme.md");
26
- fs::write("./.ahqstore/README.md", readme).ok()
26
+ fs::write("./.ahqstore/README.md", readme).ok()?;
27
+
28
+ let readme = include_str!("./readme.es.md");
29
+ fs::write("./.ahqstore/README.es.md", readme).ok()?;
30
+
31
+ let readme = include_str!("./readme.hi.md");
32
+ fs::write("./.ahqstore/README.hi.md", readme).ok()
27
33
  })()
28
34
  .is_some();
29
35
 
@@ -0,0 +1,80 @@
1
+ # AHQ Store Cli
2
+
3
+ Edita el archivo config.json
4
+
5
+ El esquema se muestra a continuación
6
+
7
+ ## config.json
8
+
9
+ ```ts
10
+ type Platform =
11
+ // Plataformas Windows + Soporte para Actualizador y Desinstalador
12
+ | "WindowsZip"
13
+ | "WindowsInstallerMsi"
14
+
15
+ // No Implementado
16
+ | "WindowsInstallerExe"
17
+ | "WindowsUWPMsix"
18
+
19
+ // Plataforma Linux + Soporte para Actualizador y Desinstalador
20
+ | "LinuxAppImage"
21
+
22
+ // Android (En Desarrollo)
23
+ | "AndroidLinuxZip";
24
+
25
+ interface ConfigJSON {
26
+ [key: string]: {
27
+ appId: string; // ID de la aplicación proporcionado por los desarrolladores de AHQ Store
28
+ appInstalledName: string; // Nombre de la entrada en el menú de inicio + acceso directo en el escritorio
29
+ appDisplayName: string; // Nombre de la aplicación
30
+ authorId: string; // Tu ID de usuario
31
+ shortDesc: string; // Descripción corta (máximo 48 palabras)
32
+ description: string; // Descripción de la aplicación en varias líneas
33
+ repo: {
34
+ author: string; // Tu nombre de usuario en GitHub
35
+ repo: string; // URL del repositorio
36
+ };
37
+ finder: {
38
+ [platform: ""]: {
39
+ startsWith?: string; // ¿Con qué debe comenzar la aplicación empaquetada?
40
+ contains?: string; // ¿Qué debe incluir la aplicación empaquetada?
41
+ endsWith?: string; // ¿Con qué debe terminar la aplicación empaquetada?
42
+ };
43
+ };
44
+ platform: {
45
+ // Debe ser "WindowsZip"| "WindowsInstallerMsi" |"WindowsInstallerExe" | "WindowsUWPMsix"
46
+ winAmd64Platform?: Platform; // ¿Qué tipo de binario proporciona tu aplicación a AHQ Store?
47
+ winArm64Platform?: Platform; // <-- Igual que winAmd64Platform -->
48
+
49
+ linuxAmd64Platform?: Platform; // Debe ser LinuxAppImage
50
+ linuxArm64Platform?: Platform; // Debe ser LinuxAppImage
51
+ linuxArm64Platform?: Platform; // Debe ser LinuxAppImage
52
+ linuxArm32Platform?: Platform; // Debe ser LinuxAppImage
53
+
54
+ androidUniversalPlatform?: Platform; // Debe ser AndroidApkZip
55
+
56
+ winAmd64Options?: {
57
+ zip_file_exec?: string; // Exe para enlazar a través de nuestro instalador (WindowsZIP)
58
+ exe_installer_args?: string[]; // Argumentos para ejecutar tu instalador personalizado (WindowsInstallerExe)
59
+ };
60
+
61
+ winArm64Options?: {
62
+ zip_file_exec?: string; // Exe para enlazar a través de nuestro instalador (WindowsZIP)
63
+ exe_installer_args?: string[]; // Argumentos para ejecutar tu instalador personalizado (WindowsInstallerExe)
64
+ };
65
+ };
66
+ site?: string; // Sitio web de tu aplicación
67
+ source?: string; // Sitio web de tu aplicación (que contiene el código fuente)
68
+ redistributed?: string; // No puedes establecer esto
69
+ license_or_tos?: string; // Nombre de la licencia o sitio de los términos de servicio
70
+ };
71
+ }
72
+ ```
73
+
74
+ ## images/<app-id>/icon.png
75
+
76
+ El icono de tu aplicación que se incluirá en el archivo de metadatos de la aplicación
77
+
78
+ ## images/<app-id>/\*
79
+
80
+ Coloca cualquier imagen (hasta 10) que se colocará en el modal de la aplicación en AHQ Store
@@ -0,0 +1,80 @@
1
+ # AHQ Store Cli
2
+
3
+ config.json को संपादित करें
4
+
5
+ नीचे स्कीमा दिखाया गया है
6
+
7
+ ## config.json
8
+
9
+ ```ts
10
+ type Platform =
11
+ // विंडोज प्लेटफॉर्म + अपडेटर और अनइंस्टॉलर समर्थन
12
+ | "WindowsZip"
13
+ | "WindowsInstallerMsi"
14
+
15
+ // लागू नहीं किया गया
16
+ | "WindowsInstallerExe"
17
+ | "WindowsUWPMsix"
18
+
19
+ // लिनक्स प्लेटफॉर्म + अपडेटर और अनइंस्टॉलर समर्थन
20
+ | "LinuxAppImage"
21
+
22
+ // एंड्रॉइड (विकासाधीन)
23
+ | "AndroidLinuxZip";
24
+
25
+ interface ConfigJSON {
26
+ [key: string]: {
27
+ appId: string; // AHQ स्टोर DEVS द्वारा प्रदान किया गया एप्लिकेशन आईडी
28
+ appInstalledName: string; // ऐप स्टार्ट मेनू एंट्री + डेस्कटॉप शॉर्टकट नाम
29
+ appDisplayName: string; // ऐप डिस्प्ले नाम
30
+ authorId: string; // आपका यूजर आईडी
31
+ shortDesc: string; // संक्षिप्त विवरण (अधिकतम 48 शब्द)
32
+ description: string; // बहु-लाइन ऐप विवरण
33
+ repo: {
34
+ author: string; // आपका GitHub उपयोगकर्ता नाम
35
+ repo: string; // रिपो URL
36
+ };
37
+ finder: {
38
+ [platform: ""]: {
39
+ startsWith?: string; // बंडल किया गया ऐप किससे शुरू होना चाहिए?
40
+ contains?: string; // बंडल किया गया ऐप क्या शामिल होना चाहिए?
41
+ endsWith?: string; // बंडल किया गया ऐप किससे समाप्त होना चाहिए?
42
+ };
43
+ };
44
+ platform: {
45
+ // "WindowsZip"| "WindowsInstallerMsi" |"WindowsInstallerExe" | "WindowsUWPMsix" होना चाहिए
46
+ winAmd64Platform?: Platform; // आपका ऐप AHQ स्टोर को किस प्रकार का बाइनरी प्रदान करता है
47
+ winArm64Platform?: Platform; // <-- winAmd64Platform के समान -->
48
+
49
+ linuxAmd64Platform?: Platform; // LinuxAppImage होना चाहिए
50
+ linuxArm64Platform?: Platform; // LinuxAppImage होना चाहिए
51
+ linuxArm64Platform?: Platform; // LinuxAppImage होना चाहिए
52
+ linuxArm32Platform?: Platform; // LinuxAppImage होना चाहिए
53
+
54
+ androidUniversalPlatform?: Platform; // AndroidApkZip होना चाहिए
55
+
56
+ winAmd64Options?: {
57
+ zip_file_exec?: string; // हमारे इंस्टॉलर के माध्यम से लिंक करने के लिए Exe (WindowsZIP)
58
+ exe_installer_args?: string[]; // आपके कस्टम इंस्टॉलर को चलाने के लिए Args (WindowsInstallerExe)
59
+ };
60
+
61
+ winArm64Options?: {
62
+ zip_file_exec?: string; // हमारे इंस्टॉलर के माध्यम से लिंक करने के लिए Exe (WindowsZIP)
63
+ exe_installer_args?: string[]; // आपके कस्टम इंस्टॉलर को चलाने के लिए Args (WindowsInstallerExe)
64
+ };
65
+ };
66
+ site?: string; // आपके ऐप की वेबसाइट
67
+ source?: string; // आपके ऐप की वेबसाइट (जिसमें स्रोत कोड शामिल है)
68
+ redistributed?: string; // आप इसे सेट नहीं कर सकते
69
+ license_or_tos?: string; // लाइसेंस का नाम या TOS की साइट
70
+ };
71
+ }
72
+ ```
73
+
74
+ ## images/<app-id>/icon.png
75
+
76
+ आपका एप्लिकेशन आइकन जो ऐप मेटाडेटा फ़ाइल में बंडल किया जाएगा
77
+
78
+ ## images/<app-id>/\*
79
+
80
+ कोई भी छवि (अधिकतम 10) रखें जो AHQ स्टोर में ऐप मोडल में रखी जाएगी
@@ -8,7 +8,7 @@ The schema has been shown below
8
8
 
9
9
  ```ts
10
10
  type Platform =
11
- // Windows Platforms + Updater & UnInstaller Support
11
+ // Windows Platforms + Updater & Uninstaller Support
12
12
  | "WindowsZip"
13
13
  | "WindowsInstallerMsi"
14
14
 
@@ -16,10 +16,11 @@ type Platform =
16
16
  | "WindowsInstallerExe"
17
17
  | "WindowsUWPMsix"
18
18
 
19
- // Linux Platform + Updater & UnInstaller Support
20
- | "LinuxAppImage";
19
+ // Linux Platform + Updater & Uninstaller Support
20
+ | "LinuxAppImage"
21
21
 
22
- type Win32Deps = "AHQStoreAPI" | "Node21" | "Node18";
22
+ // Android (Under Development)
23
+ | "AndroidLinuxZip";
23
24
 
24
25
  interface ConfigJSON {
25
26
  [key: string]: {
@@ -34,35 +35,43 @@ interface ConfigJSON {
34
35
  repo: string; //Repo URL
35
36
  };
36
37
  finder: {
37
- windowsFinder?: {
38
- startsWith?: string; // The Windows Bundled app should startWith?
39
- contains?: string; // The Windows Bundled app should include?
40
- endsWith?: string; // The Windows Bundled app should endWith?
41
- };
42
- linuxFinder?: {
43
- startsWith?: string; // The Linux Bundled app should startWith?
44
- contains?: string; // The Linux Bundled app should include?
45
- endsWith?: string; // The Linux Bundled app should endWith?
38
+ [platform: ""]: {
39
+ startsWith?: string; // The Bundled app should startWith?
40
+ contains?: string; // The Bundled app should include?
41
+ endsWith?: string; // The Bundled app should endWith?
46
42
  };
47
43
  };
48
44
  platform: {
49
- installType: "Both" | "PerUser" | "Computer"; // Install Type
50
- win32Platform?: Platform; // What type of binary does your app provide to AHQ Store
51
- linuxPlatform?: Platform; // <-- Same as win32Platform -->
52
- win32Options?: {
53
- deps: Win32Deps[]; // Win32 Custom Deps
45
+ // Must be "WindowsZip"| "WindowsInstallerMsi" |"WindowsInstallerExe" | "WindowsUWPMsix"
46
+ winAmd64Platform?: Platform; // What type of binary does your app provide to AHQ Store
47
+ winArm64Platform?: Platform; // <-- Same as winAmd64Platform -->
48
+
49
+ linuxAmd64Platform?: Platform; // Must be LinuxAppImage
50
+ linuxArm64Platform?: Platform; // Must be LinuxAppImage
51
+ linuxArm64Platform?: Platform; // Must be LinuxAppImage
52
+ linuxArm32Platform?: Platform; // Must be LinuxAppImage
53
+
54
+ androidUniversalPlatform?: Platform; // Must be AndroidApkZip
55
+
56
+ winAmd64Options?: {
57
+ zip_file_exec?: string; // Exe to Link via our installer (WindowsZIP)
58
+ exe_installer_args?: string[]; // Args to run to your custom installer (WindowsInstallerExe)
59
+ };
60
+
61
+ winArm64Options?: {
54
62
  zip_file_exec?: string; // Exe to Link via our installer (WindowsZIP)
55
63
  exe_installer_args?: string[]; // Args to run to your custom installer (WindowsInstallerExe)
56
64
  };
57
- linuxOptions?: {};
58
65
  };
59
66
  site?: string; // Your app's website
60
- redistributed?: string; // Redistributed page (not for public)
67
+ source?: string; // Your app's website (that contains source code)
68
+ redistributed?: string; // You just **cannot** set this
69
+ license_or_tos?: string; // Name of License or site of TOS
61
70
  };
62
71
  }
63
72
  ```
64
73
 
65
- ## icon.png
74
+ ## images/<app-id>/icon.png
66
75
 
67
76
  Your application icon that'll be bundled in the app metadata file
68
77
 
@@ -1,15 +1,23 @@
1
1
  use serde::{Deserialize, Serialize};
2
2
 
3
- #[derive(Debug, Serialize, Deserialize)]
3
+ #[derive(Debug, Serialize, Deserialize, Default)]
4
4
  #[allow(non_snake_case)]
5
5
  pub struct FileFinder<'a> {
6
6
  #[serde(borrow)]
7
- pub windowsFinder: Option<Finder<'a>>,
7
+ pub windowsAmd64Finder: Option<Finder<'a>>,
8
8
  #[serde(borrow)]
9
- pub linuxFinder: Option<Finder<'a>>,
9
+ pub windowsArm64Finder: Option<Finder<'a>>,
10
+ #[serde(borrow)]
11
+ pub linuxAmd64Finder: Option<Finder<'a>>,
12
+ #[serde(borrow)]
13
+ pub linuxArm64Finder: Option<Finder<'a>>,
14
+ #[serde(borrow)]
15
+ pub linuxArm32Finder: Option<Finder<'a>>,
16
+ #[serde(borrow)]
17
+ pub androidUniversalFinder: Option<Finder<'a>>,
10
18
  }
11
19
 
12
- #[derive(Debug, Serialize, Deserialize)]
20
+ #[derive(Debug, Serialize, Deserialize, Default)]
13
21
  #[allow(non_snake_case)]
14
22
  pub struct Finder<'a> {
15
23
  #[serde(borrow)]
@@ -23,12 +31,12 @@ pub struct Finder<'a> {
23
31
  impl<'a> FileFinder<'a> {
24
32
  pub fn new() -> Self {
25
33
  Self {
26
- windowsFinder: Some(Finder {
34
+ windowsAmd64Finder: Some(Finder {
27
35
  startsWith: Some("This-is"),
28
36
  contains: Some("an"),
29
37
  endsWith: Some(".example"),
30
38
  }),
31
- linuxFinder: None,
39
+ ..Default::default()
32
40
  }
33
41
  }
34
42
  }
@@ -25,7 +25,9 @@ pub struct IMetadata<'a> {
25
25
  #[serde[borrow]]
26
26
  pub finder: FileFinder<'a>,
27
27
  pub site: Option<Str>,
28
+ pub source: Option<Str>,
28
29
  pub redistributed: Option<Str>,
30
+ pub license_or_tos: Option<Str>,
29
31
  }
30
32
 
31
33
  impl<'a> IMetadata<'a> {
@@ -53,7 +55,9 @@ impl<'a> IMetadata<'a> {
53
55
  platform,
54
56
  finder: FileFinder::new(),
55
57
  site: None,
56
- redistributed: None
58
+ source: None,
59
+ redistributed: None,
60
+ license_or_tos: None
57
61
  },
58
62
  );
59
63
 
@@ -1,69 +1,45 @@
1
- use ahqstore_types::{InstallType, InstallerFormat, Win32Deps};
1
+ use ahqstore_types::InstallerFormat;
2
2
  use serde::{Deserialize, Serialize};
3
3
 
4
4
  #[derive(Debug, Serialize, Deserialize)]
5
5
  #[allow(non_snake_case)]
6
6
  pub struct IPlatform<'a> {
7
- pub installType: InstallType,
8
- pub win32Platform: Option<InstallerFormat>,
9
- pub linuxPlatform: Option<InstallerFormat>,
7
+ pub winAmd64Platform: Option<InstallerFormat>,
8
+ pub winArm64Platform: Option<InstallerFormat>,
9
+ pub linuxAmd64Platform: Option<InstallerFormat>,
10
+ pub linuxArm64Platform: Option<InstallerFormat>,
11
+ pub linuxArm32Platform: Option<InstallerFormat>,
12
+ pub androidUniversal: Option<InstallerFormat>,
10
13
  #[serde(borrow)]
11
- pub win32Options: Option<IOWin32<'a>>,
12
- pub linuxOptions: Option<IOLinux>,
14
+ pub winAmd64Options: Option<IOWin<'a>>,
15
+ #[serde(borrow)]
16
+ pub winArm64Options: Option<IOWin<'a>>,
13
17
  }
14
18
 
15
- #[derive(Debug, Serialize, Deserialize)]
16
- pub struct IOWin32<'a> {
17
- pub deps: Vec<Win32Deps>,
19
+ #[derive(Debug, Serialize, Deserialize, Clone)]
20
+ pub struct IOWin<'a> {
18
21
  #[serde(borrow)]
19
22
  pub zip_file_exec: Option<&'a str>,
20
23
  #[serde(borrow)]
21
24
  pub exe_installer_args: Option<Vec<&'a str>>,
22
25
  }
23
26
 
24
- #[derive(Debug, Serialize, Deserialize)]
25
- pub struct IOLinux {
26
-
27
- }
28
-
29
27
  impl<'a> IPlatform<'a> {
30
- pub fn new(platforms: Vec<InstallerFormat>) -> Self {
31
- let win32 = own(
32
- platforms
33
- .iter()
34
- .find(|p| !matches!(&p, &&&InstallerFormat::LinuxAppImage)),
35
- );
36
-
37
- let linux = own(
38
- platforms
39
- .iter()
40
- .find(|p| matches!(&p, &&&InstallerFormat::LinuxAppImage)),
41
- );
28
+ pub fn new() -> Self {
29
+ let io_win = IOWin {
30
+ exe_installer_args: Some(vec![]),
31
+ zip_file_exec: None,
32
+ };
42
33
 
43
34
  Self {
44
- installType: InstallType::Computer,
45
- win32Platform: win32,
46
- linuxPlatform: linux,
47
- win32Options: Some(IOWin32 {
48
- deps: vec![],
49
- exe_installer_args: Some(vec![]),
50
- zip_file_exec: None,
51
- }),
52
- linuxOptions: Some(IOLinux { }),
35
+ winAmd64Platform: None,
36
+ winArm64Platform: None,
37
+ linuxAmd64Platform: None,
38
+ linuxArm32Platform: None,
39
+ linuxArm64Platform: None,
40
+ androidUniversal: None,
41
+ winAmd64Options: Some(io_win.clone()),
42
+ winArm64Options: Some(io_win)
53
43
  }
54
44
  }
55
- }
56
-
57
- fn own(val: Option<&InstallerFormat>) -> Option<InstallerFormat> {
58
- if let Some(v) = val {
59
- Some(match &v {
60
- &&InstallerFormat::LinuxAppImage => InstallerFormat::LinuxAppImage,
61
- &&InstallerFormat::WindowsInstallerExe => InstallerFormat::WindowsInstallerExe,
62
- &&InstallerFormat::WindowsZip => InstallerFormat::WindowsZip,
63
- &&InstallerFormat::WindowsInstallerMsi => InstallerFormat::WindowsInstallerMsi,
64
- &&InstallerFormat::WindowsUWPMsix => InstallerFormat::WindowsUWPMsix,
65
- })
66
- } else {
67
- None
68
- }
69
- }
45
+ }