eitri-cli 1.10.1 → 1.11.0-beta.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/eitri-cli-v2/Cargo.toml +13 -0
- package/eitri-cli-v2/config/config.dev.toml +67 -0
- package/eitri-cli-v2/config/config.loc.toml +67 -0
- package/eitri-cli-v2/config/config.prod.toml +62 -0
- package/eitri-cli-v2/config/config.runes-foundry.toml +7 -0
- package/eitri-cli-v2/config/config.test.toml +67 -0
- package/eitri-cli-v2/eitri-cli-v2.darwin-arm64.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.darwin-x64.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.linux-x64-gnu.node +0 -0
- package/eitri-cli-v2/eitri-cli-v2.win32-x64-msvc.node +0 -0
- package/index.js +4 -1
- package/package.json +1 -1
- package/src/modules/vegvisir/VegvisirService.js +1 -1
- package/src/service/Emulator/AndroidEmulatorService.js +25 -3
- package/src/service/MiniLog.js +5 -46
- package/src/service/factories/WoodCoffeeFactory.js +4 -3
- package/src/util/LibUtil.js +32 -0
- package/eitri-cli-v2/src/commands/mod.rs +0 -2
- package/eitri-cli-v2/src/commands/publish.rs +0 -35
- package/eitri-cli-v2/src/commands/run_test.rs +0 -41
- package/eitri-cli-v2/src/config/mod.rs +0 -1
- package/eitri-cli-v2/src/config/user_credentials.rs +0 -38
- package/eitri-cli-v2/src/infra/http_client.rs +0 -493
- package/eitri-cli-v2/src/infra/mod.rs +0 -1
- package/eitri-cli-v2/src/lib.rs +0 -30
- package/eitri-cli-v2/src/model/auth_response.rs +0 -8
- package/eitri-cli-v2/src/model/credentials.rs +0 -8
- package/eitri-cli-v2/src/model/eitri_conf.rs +0 -43
- package/eitri-cli-v2/src/model/mod.rs +0 -8
- package/eitri-cli-v2/src/model/process_output.rs +0 -8
- package/eitri-cli-v2/src/model/revision.rs +0 -14
- package/eitri-cli-v2/src/model/test_config.rs +0 -7
- package/eitri-cli-v2/src/model/url.rs +0 -11
- package/eitri-cli-v2/src/model/workspace_auth.rs +0 -4
- package/eitri-cli-v2/src/services/blind_guardian.rs +0 -87
- package/eitri-cli-v2/src/services/eitri_foundry.rs +0 -84
- package/eitri-cli-v2/src/services/eitri_manager.rs +0 -78
- package/eitri-cli-v2/src/services/mod.rs +0 -4
- package/eitri-cli-v2/src/services/workspace.rs +0 -49
- package/eitri-cli-v2/src/utils/convert_eitri_conf.rs +0 -98
- package/eitri-cli-v2/src/utils/mod.rs +0 -1
- package/test/Executor.js +0 -60
- package/test/Factory.js +0 -13
- package/test/Helper.js +0 -15
- package/test/_fixtures/factory.js +0 -30
- package/test/_fixtures/miniWebApp/miniapp.conf.js +0 -4
- package/test/_fixtures/miniapp.conf.js +0 -5
- package/test/_fixtures/server/HelloWorldBackend.js +0 -7
- package/test/_fixtures/src/Home.js +0 -5
- package/test/_fixtures/src/Home2.js +0 -5
- package/test/_fixtures/src/commons/util.js +0 -3
- package/test/_fixtures/src/components/TagA.jsx +0 -4
- package/test/_fixtures/src/components/TagB.jsx +0 -4
- package/test/_fixtures/src/components/TagC.jsx +0 -3
- package/test/_fixtures/src/components/TagD.jsx +0 -3
- package/test/_fixtures/src/server/foo.js +0 -7
- package/test/_fixtures/src/views/AboutTemplate.jsx +0 -14
- package/test/_fixtures/woodcoffee/miniapp.conf.js +0 -5
- package/test/ame.conf.js +0 -3
- package/test/cmd/clean.test.js +0 -66
- package/test/cmd/create.test.js +0 -252
- package/test/cmd/list.test.js +0 -74
- package/test/cmd/manage-env.test.js +0 -168
- package/test/e2e/cli.test.js +0 -473
- package/test/miniapp.conf.js +0 -3
- package/test/model/Payload.test.js +0 -35
- package/test/modules/vegvisir/VegvisirService.test.js +0 -37
- package/test/service/BlindGuardian.test.js +0 -84
- package/test/service/CheckAmeConf.test.js +0 -313
- package/test/service/Http.test.js +0 -312
- package/test/service/InviteService.test.js +0 -117
- package/test/service/MiniWebAppFactory.test.js +0 -40
- package/test/service/TagTree.test.js +0 -81
- package/test/service/TargetService.test.js +0 -48
- package/test/service/TrackingService.test.js +0 -105
- package/test/service/UserAmeConf.test.js +0 -47
- package/test/service/WoodCoffeeFactory.test.js +0 -148
- package/test/service/Workspace.test.js +0 -211
- package/test/utils/getWorkspaceId.test.js +0 -17
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
use std::{env, process::exit};
|
|
2
|
-
|
|
3
|
-
use reqwest::header::HeaderMap;
|
|
4
|
-
use serde_derive::{Deserialize, Serialize};
|
|
5
|
-
|
|
6
|
-
use crate::{
|
|
7
|
-
config::user_credentials,
|
|
8
|
-
infra::http_client::{self, HttpError},
|
|
9
|
-
model::{auth_response::AuthResponse, credentials::Credentials},
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
#[derive(Serialize, Deserialize)]
|
|
13
|
-
struct AuthenticationDTO {
|
|
14
|
-
client_id: String,
|
|
15
|
-
client_secret: String,
|
|
16
|
-
grant_type: String,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
#[allow(dead_code)]
|
|
20
|
-
pub async fn get_access_token(host: &str, uri: &str) -> Result<String, HttpError> {
|
|
21
|
-
let mut headers = HeaderMap::new();
|
|
22
|
-
headers.append("user-agent", "eitri".parse().unwrap());
|
|
23
|
-
|
|
24
|
-
let client_id = env::var("EITRI_CLI_CLIENT_ID").unwrap_or_else(|_| String::from(""));
|
|
25
|
-
let client_secret = env::var("EITRI_CLI_CLIENT_SECRET").unwrap_or_else(|_| String::from(""));
|
|
26
|
-
|
|
27
|
-
let credentials = if !client_id.is_empty() && !client_secret.is_empty() {
|
|
28
|
-
let credentials = Credentials {
|
|
29
|
-
dev_key: client_secret,
|
|
30
|
-
dev_user: client_id,
|
|
31
|
-
};
|
|
32
|
-
credentials
|
|
33
|
-
} else {
|
|
34
|
-
let credentials = match user_credentials::get_credentials() {
|
|
35
|
-
Ok(credential) => credential,
|
|
36
|
-
Err(_) => {
|
|
37
|
-
eprintln!("Erro ao ler credenciais");
|
|
38
|
-
exit(1)
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
credentials
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
let data = AuthenticationDTO {
|
|
45
|
-
client_id: credentials.dev_user,
|
|
46
|
-
client_secret: credentials.dev_key,
|
|
47
|
-
grant_type: String::from("client_credentials"),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
let url = &format!("{}/{}", host, uri);
|
|
51
|
-
|
|
52
|
-
let response = http_client::post::<AuthResponse, AuthenticationDTO>(url, data, headers).await?;
|
|
53
|
-
|
|
54
|
-
Ok(response.access_token)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
#[cfg(test)]
|
|
58
|
-
mod tests {
|
|
59
|
-
|
|
60
|
-
use super::*;
|
|
61
|
-
use httpmock::prelude::*;
|
|
62
|
-
use serde_json::json;
|
|
63
|
-
|
|
64
|
-
#[tokio::test]
|
|
65
|
-
async fn should_get_access_token() {
|
|
66
|
-
let server = MockServer::start();
|
|
67
|
-
|
|
68
|
-
server.mock(|when, then| {
|
|
69
|
-
when.method(POST).path("/blind-guardian-api/v2/o/auth");
|
|
70
|
-
then.status(200)
|
|
71
|
-
.header("content-type", "application/json; charset=UTF-8")
|
|
72
|
-
.body(
|
|
73
|
-
json!({
|
|
74
|
-
"accessToken": "123.123.123"
|
|
75
|
-
})
|
|
76
|
-
.to_string()
|
|
77
|
-
.as_bytes(),
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
let token = get_access_token(&server.url(""), "blind-guardian-api/v2/o/auth")
|
|
82
|
-
.await
|
|
83
|
-
.unwrap();
|
|
84
|
-
|
|
85
|
-
assert_eq!(token, "123.123.123")
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
use crate::{
|
|
2
|
-
infra::http_client::{self, HttpError},
|
|
3
|
-
model::{
|
|
4
|
-
process_output::ProcessOutput, test_config::TestConfig, url::Url, workspace_auth::WorkspaceAuth,
|
|
5
|
-
},
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
pub async fn run_test(
|
|
9
|
-
workspace_auth: WorkspaceAuth,
|
|
10
|
-
test_path: String,
|
|
11
|
-
url: Url,
|
|
12
|
-
) -> Result<ProcessOutput, HttpError> {
|
|
13
|
-
let access_token: String = workspace_auth.access_token;
|
|
14
|
-
let user_workspace_id: String = workspace_auth.user_workspace_id;
|
|
15
|
-
let mut headers = http_client::get_default_headers(access_token).await;
|
|
16
|
-
let url = url.get_full_url();
|
|
17
|
-
let data = TestConfig {
|
|
18
|
-
test_path: test_path,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
headers.append("workspace-id", user_workspace_id.parse().unwrap());
|
|
23
|
-
let result = http_client::post::<ProcessOutput, TestConfig>(&url, data, headers).await?;
|
|
24
|
-
|
|
25
|
-
Ok(result)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
#[cfg(test)]
|
|
29
|
-
mod tests {
|
|
30
|
-
use httpmock::prelude::*;
|
|
31
|
-
use serde_json::json;
|
|
32
|
-
|
|
33
|
-
use crate::{
|
|
34
|
-
model::{url::Url, workspace_auth::WorkspaceAuth},
|
|
35
|
-
services::eitri_foundry::run_test,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
#[tokio::test]
|
|
39
|
-
async fn should_return_test_status() {
|
|
40
|
-
let server = MockServer::start();
|
|
41
|
-
|
|
42
|
-
let result = String::from("'PASS ../storage/ad24ec72-90b0-4511-b836-e217183e31c7/react-proj/src/test/Service.test.js\n' +
|
|
43
|
-
' ✓ teste soma agora (2 ms)\n' +
|
|
44
|
-
' ✓ teste multiplicao agora\n' +
|
|
45
|
-
'\n' +
|
|
46
|
-
'Test Suites: 1 passed, 1 total\n' +
|
|
47
|
-
'Tests: 2 passed, 2 total\n' +
|
|
48
|
-
'Snapshots: 0 total\n' +
|
|
49
|
-
'Time: 0.162 s, estimated 1 s\n' +
|
|
50
|
-
'Ran all test suites'");
|
|
51
|
-
|
|
52
|
-
let mock = server.mock(|when, then| {
|
|
53
|
-
when.method(POST).path("/runes-foundry/run-test");
|
|
54
|
-
then
|
|
55
|
-
.status(200)
|
|
56
|
-
.header("content-type", "application/json; charset=UTF-8")
|
|
57
|
-
.body(
|
|
58
|
-
json!({
|
|
59
|
-
"stderr": result,
|
|
60
|
-
"stdout":"aaaaaa"
|
|
61
|
-
})
|
|
62
|
-
.to_string()
|
|
63
|
-
.as_bytes(),
|
|
64
|
-
);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
let workspace_auth = WorkspaceAuth {
|
|
68
|
-
access_token: String::from("123.123.123"),
|
|
69
|
-
user_workspace_id: String::from("xxxx"),
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
let path = String::from("");
|
|
73
|
-
let url = Url {
|
|
74
|
-
host: server.url(""),
|
|
75
|
-
path: String::from("/runes-foundry/run-test"),
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
let response = run_test(workspace_auth, path, url).await.unwrap();
|
|
79
|
-
|
|
80
|
-
assert_eq!(mock.hits(), 1);
|
|
81
|
-
assert_eq!(response.stderr, result);
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
use std::process::exit;
|
|
2
|
-
|
|
3
|
-
use serde_json::json;
|
|
4
|
-
|
|
5
|
-
use crate::{
|
|
6
|
-
infra::http_client::{self, HttpError},
|
|
7
|
-
model::revision::{GetRevisionsResult, Revision},
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
use super::blind_guardian;
|
|
11
|
-
|
|
12
|
-
pub async fn get_revision(eitri_app_id: &str, version: &str) -> Result<Revision, HttpError> {
|
|
13
|
-
let access_token = match blind_guardian::get_access_token(
|
|
14
|
-
"https://api.eitri.tech",
|
|
15
|
-
"blind-guardian-api/v2/o/auth",
|
|
16
|
-
)
|
|
17
|
-
.await
|
|
18
|
-
{
|
|
19
|
-
Ok(token) => token,
|
|
20
|
-
Err(_err) => {
|
|
21
|
-
eprintln!("Houve um erro ao autenticar-se no Eitri");
|
|
22
|
-
exit(1)
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
let headers = http_client::get_default_headers(access_token).await;
|
|
27
|
-
|
|
28
|
-
let url = format!(
|
|
29
|
-
"https://api.eitri.tech/eitri-manager-api/v2/revisions?eitriAppId={}&version={}",
|
|
30
|
-
eitri_app_id, version
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
let result = http_client::get::<GetRevisionsResult>(&url, headers).await?;
|
|
34
|
-
|
|
35
|
-
let revision = match result.revisions.first() {
|
|
36
|
-
Some(revision) => revision.clone(),
|
|
37
|
-
None => {
|
|
38
|
-
eprintln!("Versão não encontrada, certifique-se de que foi feito push-version antes de publicar a versão.");
|
|
39
|
-
exit(1)
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
Ok(revision)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
pub async fn publish_revision(
|
|
46
|
-
eitri_app_id: &str,
|
|
47
|
-
environment_id: &str,
|
|
48
|
-
message: &str,
|
|
49
|
-
) -> Result<String, HttpError> {
|
|
50
|
-
let access_token = match blind_guardian::get_access_token(
|
|
51
|
-
"https://api.eitri.tech",
|
|
52
|
-
"blind-guardian-api/v2/o/auth",
|
|
53
|
-
)
|
|
54
|
-
.await
|
|
55
|
-
{
|
|
56
|
-
Ok(token) => token,
|
|
57
|
-
Err(_err) => {
|
|
58
|
-
eprintln!("Houve um erro ao autenticar-se no Eitri");
|
|
59
|
-
exit(1)
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
let headers = http_client::get_default_headers(access_token).await;
|
|
64
|
-
|
|
65
|
-
let url = format!(
|
|
66
|
-
"https://api.eitri.tech/eitri-manager-api/revisions/{}/publish",
|
|
67
|
-
eitri_app_id
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
let data = json!({
|
|
71
|
-
"envId": environment_id,
|
|
72
|
-
"message": message
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
let result = http_client::put(&url, data, headers).await?;
|
|
76
|
-
|
|
77
|
-
Ok(result)
|
|
78
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
use std::{env, fs, path::Path, process::exit};
|
|
2
|
-
|
|
3
|
-
use crate::model::eitri_conf::EitriConf;
|
|
4
|
-
use crate::utils::convert_eitri_conf;
|
|
5
|
-
|
|
6
|
-
pub async fn read_eitri_conf() -> EitriConf {
|
|
7
|
-
let current_dir = match env::current_dir().ok() {
|
|
8
|
-
Some(it) => it,
|
|
9
|
-
None => {
|
|
10
|
-
eprintln!("Houve um erro o tentar ler o diretório atual");
|
|
11
|
-
exit(1)
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
let current_dir_str = current_dir.display().to_string();
|
|
16
|
-
let file_path = Path::new(¤t_dir_str);
|
|
17
|
-
let file_path = file_path.join("eitri-app.conf.json");
|
|
18
|
-
|
|
19
|
-
convert_eitri_conf::convert();
|
|
20
|
-
|
|
21
|
-
let content = match fs::read_to_string(file_path.display().to_string()).ok() {
|
|
22
|
-
Some(it) => it,
|
|
23
|
-
None => {
|
|
24
|
-
eprintln!("Houve um erro ao tentar ler o eitri-app.conf do projeto. Certifique-se de estar no diretório de um Eitri-App");
|
|
25
|
-
exit(1)
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
let eitri_conf: EitriConf = match serde_json::from_str(&content).ok() {
|
|
30
|
-
Some(it) => {
|
|
31
|
-
match fs::remove_file(file_path.display().to_string()) {
|
|
32
|
-
Ok(()) => (),
|
|
33
|
-
Err(_err) => {
|
|
34
|
-
eprintln!(
|
|
35
|
-
"Houve um erro ao tentar ler o eitri-app.conf do projeto. Tente novamente."
|
|
36
|
-
);
|
|
37
|
-
exit(1)
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
it
|
|
41
|
-
}
|
|
42
|
-
None => {
|
|
43
|
-
eprintln!("Houve um erro ao fazer parse do json");
|
|
44
|
-
exit(1)
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
eitri_conf
|
|
49
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
use std::env::current_dir;
|
|
2
|
-
use std::fs;
|
|
3
|
-
use std::io::Write;
|
|
4
|
-
use std::process::exit;
|
|
5
|
-
use std::{fs::File, process::Command};
|
|
6
|
-
|
|
7
|
-
static BASH_SCRIPT: &str = r#"
|
|
8
|
-
#!/bin/bash
|
|
9
|
-
|
|
10
|
-
# Atribua os argumentos a variáveis
|
|
11
|
-
js_file="eitri-app.conf.js"
|
|
12
|
-
json_file="eitri-app.conf.json"
|
|
13
|
-
|
|
14
|
-
# Verifique se o arquivo JavaScript existe
|
|
15
|
-
if [ ! -f "$js_file" ]; then
|
|
16
|
-
echo "Erro: Arquivo JavaScript não encontrado: $js_file"
|
|
17
|
-
exit 1
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
# Execute o script JavaScript para converter o objeto para JSON e redirecione a saída para o arquivo JSON
|
|
21
|
-
node -e "console.log(JSON.stringify(require('./$js_file'), null, 2))" > "$json_file"
|
|
22
|
-
|
|
23
|
-
echo "Conversão concluída. O JSON foi salvo em: $json_file"
|
|
24
|
-
"#;
|
|
25
|
-
|
|
26
|
-
static BAT_SCRIPT: &str = r#"
|
|
27
|
-
@echo off
|
|
28
|
-
|
|
29
|
-
rem Atribua os argumentos a variáveis
|
|
30
|
-
set "js_file=eitri-app.conf.js"
|
|
31
|
-
set "json_file=eitri-app.conf.json"
|
|
32
|
-
|
|
33
|
-
rem Verifique se o arquivo JavaScript existe
|
|
34
|
-
if not exist "%js_file%" (
|
|
35
|
-
echo Erro: Arquivo JavaScript não encontrado: %js_file%
|
|
36
|
-
exit /b 1
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
rem Execute o script JavaScript para converter o objeto para JSON e redirecione a saída para o arquivo JSON
|
|
40
|
-
node -e "console.log(JSON.stringify(require('./%js_file%'), null, 2))" > "%json_file%"
|
|
41
|
-
|
|
42
|
-
echo Conversão concluída. O JSON foi salvo em: %json_file%
|
|
43
|
-
"#;
|
|
44
|
-
|
|
45
|
-
#[allow(dead_code)]
|
|
46
|
-
pub fn convert() {
|
|
47
|
-
if cfg!(target_os = "windows") {
|
|
48
|
-
let temp_script = temp_bat_script();
|
|
49
|
-
println!("{temp_script}");
|
|
50
|
-
let out = Command::new("cmd")
|
|
51
|
-
.args(&["/C", &temp_script])
|
|
52
|
-
.output()
|
|
53
|
-
.expect("Falha ao converter arquivo .js e .json");
|
|
54
|
-
println!("\x1b[33mArquivo eitri-app.conf.json gerado com sucesso\x1b[0m");
|
|
55
|
-
match fs::remove_file(temp_script) {
|
|
56
|
-
Ok(it) => it,
|
|
57
|
-
Err(_err) => {
|
|
58
|
-
eprintln!("Houve um remover script temporário");
|
|
59
|
-
exit(1)
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
out
|
|
63
|
-
} else {
|
|
64
|
-
Command::new("sh")
|
|
65
|
-
.arg("-c")
|
|
66
|
-
.arg(BASH_SCRIPT)
|
|
67
|
-
.output()
|
|
68
|
-
.expect("Falha ao converter arquivo .js e .json")
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
fn temp_bat_script() -> String {
|
|
73
|
-
let dir = match current_dir() {
|
|
74
|
-
Ok(dir_path) => dir_path,
|
|
75
|
-
Err(_) => {
|
|
76
|
-
eprintln!("Houve um erro o tentar ler o diretório atual");
|
|
77
|
-
exit(1)
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
let file_path = dir.join("convert.bat");
|
|
82
|
-
let file = match File::create(file_path.to_owned()) {
|
|
83
|
-
Ok(it) => it,
|
|
84
|
-
Err(_err) => {
|
|
85
|
-
eprintln!("Houve um criar script temporário");
|
|
86
|
-
exit(1)
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
match writeln!(&file, "{BAT_SCRIPT}") {
|
|
90
|
-
Ok(it) => it,
|
|
91
|
-
Err(_err) => {
|
|
92
|
-
eprintln!("Houve um salvar script temporário");
|
|
93
|
-
exit(1)
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
file_path.to_owned().display().to_string()
|
|
98
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pub mod convert_eitri_conf;
|
package/test/Executor.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
const exec = require("child_process").exec
|
|
2
|
-
|
|
3
|
-
class Executor {
|
|
4
|
-
|
|
5
|
-
constructor(execOptions) {
|
|
6
|
-
this.listeners = {}
|
|
7
|
-
this.execOptions = execOptions
|
|
8
|
-
this.children = []
|
|
9
|
-
this.stdout = ''
|
|
10
|
-
this.child = {
|
|
11
|
-
kill: (killArg) => {
|
|
12
|
-
this.children.forEach(c => c.kill(killArg))
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exec(cmdStr, options) {
|
|
18
|
-
console.log(`Executando: ${cmdStr}`)
|
|
19
|
-
const child = exec(cmdStr, options || this.execOptions)
|
|
20
|
-
child.stdout.on('data', lines => {
|
|
21
|
-
this.stdout += lines
|
|
22
|
-
for (const listener in this.listeners) {
|
|
23
|
-
this.listeners[listener](lines)
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
child.stderr.on('data', (lines) => {
|
|
27
|
-
if (lines && lines.includes('Error:')) {
|
|
28
|
-
throw new Error(lines)
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
child.on('exit', (code) => {
|
|
32
|
-
console.log(`child process exited with code ${code}\n\tCommand: ${cmdStr}`);
|
|
33
|
-
const missing = Object.keys(this.listeners)
|
|
34
|
-
if (missing.length) {
|
|
35
|
-
this.reject(new Error(`Ainda aguardando:\n\t ${missing.join('\n\t')}`))
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
this.children.push(child)
|
|
39
|
-
return this
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async waitFor(regex) {
|
|
43
|
-
console.log('Esperando uma linha que case com', regex)
|
|
44
|
-
return new Promise((resolve, reject) => {
|
|
45
|
-
this.reject = reject
|
|
46
|
-
this.listeners[regex.toString()] = (lines) => {
|
|
47
|
-
let lineFound = lines.split('\n').find(line => regex.test(line))
|
|
48
|
-
if (lineFound) {
|
|
49
|
-
console.log(`Devolvendo resultado que casou com ${regex}:\n${lineFound}`);
|
|
50
|
-
delete this.listeners[regex.toString()]
|
|
51
|
-
resolve(lineFound)
|
|
52
|
-
} else {
|
|
53
|
-
console.log(`Ignorando child stdout:\n${lines}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
module.exports = Executor
|
package/test/Factory.js
DELETED
package/test/Helper.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const BlindGuardian = require("../src/service/BlindGuardian");
|
|
2
|
-
const Http = require("../src/service/Http");
|
|
3
|
-
|
|
4
|
-
class Helper {
|
|
5
|
-
|
|
6
|
-
static async delete(eitriAppId) {
|
|
7
|
-
console.log(`Apagando eitri app id ${eitriAppId}...`)
|
|
8
|
-
const blindGuardian = new BlindGuardian();
|
|
9
|
-
const http = new Http(blindGuardian);
|
|
10
|
-
await http.delete(`https://api.eitri.tech/eitri-manager-api/eitri-apps/${eitriAppId}`)
|
|
11
|
-
console.log(`Eitri app id ${eitriAppId} apagado.`)
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = Helper
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const getTarget = () => {
|
|
3
|
-
return {
|
|
4
|
-
id: 7,
|
|
5
|
-
name: 'CALINDRA_MOBILE',
|
|
6
|
-
minimumCliVersion: '1.16.5',
|
|
7
|
-
boilerplateUrl: 'https://github.com/Calindra/eitri-mobile-mini-app-template',
|
|
8
|
-
superAppClientLibName: 'eitri-app-client',
|
|
9
|
-
componentsLibName: 'eitri-app-components',
|
|
10
|
-
description: 'CALINDRA_MOBILE',
|
|
11
|
-
status: 'ACTIVE',
|
|
12
|
-
platform: 'mobile',
|
|
13
|
-
targetConfig: [],
|
|
14
|
-
bodyClass: 'eitri-mobile',
|
|
15
|
-
sdkSupport: 'eitri-mini-app-sdk-support',
|
|
16
|
-
default: true,
|
|
17
|
-
miniAppBoilerplateList: [
|
|
18
|
-
{
|
|
19
|
-
name: 'serverless',
|
|
20
|
-
boilerplateUrl: 'https://github.com/Calindra/eitri-mobile-mini-app-template',
|
|
21
|
-
description: 'Para uso de Eitri-App com serverless'
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
module.exports = {
|
|
29
|
-
getTarget
|
|
30
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<Window>
|
|
2
|
-
<Group>
|
|
3
|
-
<Circle icon={require('../assets/images/icon_ame.svg')} />
|
|
4
|
-
<Spacing size="sm" />
|
|
5
|
-
<Subtitle fontSize="xs" textAlign="center" color="neutralcolor-darkest">Detalhes desta versão</Subtitle>
|
|
6
|
-
<View>
|
|
7
|
-
<Subtitle textAlign="center" fontSize="xxxs" color="neutralcolor-darkest">Este Eitri-App foi desenvolvido utilizando as seguintes versões:</Subtitle>
|
|
8
|
-
<Spacing size="sm" />
|
|
9
|
-
<Paragraph textAlign="center">Versão da biblioteca de componentes: ###COMPONENTS_LIBRARY_VERSION_HIGHLIGHTER###</Paragraph>
|
|
10
|
-
<Spacing size="sm" />
|
|
11
|
-
<Paragraph textAlign="center">Versão da API de Super Client: ###SUPER_APP_CLIENT_VERSION_HIGHLIGHTER###</Paragraph>
|
|
12
|
-
</View>
|
|
13
|
-
</Group>
|
|
14
|
-
</Window>
|
package/test/ame.conf.js
DELETED