eitri-cli 1.1.4-beta.1 → 1.1.5-beta.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/.releaserc.json +31 -0
- package/README.md +9 -10
- package/bitbucket-pipelines.yml +14 -12
- package/config/prod-eitri.js +9 -11
- package/index.js +29 -140
- package/package.json +8 -3
- package/src/cmd/clean.js +0 -40
- package/src/cmd/login.js +6 -6
- package/src/cmd/push-version.js +8 -4
- package/src/cmd/validate.js +0 -6
- package/src/cmd/version.js +3 -3
- package/src/modules/vegvisir/VegvisirCommand.js +3 -1
- package/src/service/EitriAppService.js +49 -0
- package/src/service/Http.js +1 -1
- package/src/service/MiniLog.js +18 -1
- package/src/service/Workspace.js +13 -73
- package/test/cmd/create.test.js +1 -1
- package/publisher.js +0 -53
- package/targetMobileStickyness.md +0 -47
- package/targetWebStickyness.md +0 -40
- package/thinQrCode.md +0 -58
- package/v1.5.0.md +0 -3
package/.releaserc.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"master",
|
|
4
|
+
{
|
|
5
|
+
"name": "beta",
|
|
6
|
+
"prerelease": true
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"plugins": [
|
|
10
|
+
"@semantic-release/commit-analyzer",
|
|
11
|
+
"@semantic-release/release-notes-generator",
|
|
12
|
+
"@semantic-release/npm",
|
|
13
|
+
"@semantic-release/git",
|
|
14
|
+
[
|
|
15
|
+
"@semantic-release/changelog",
|
|
16
|
+
{
|
|
17
|
+
"changelogFile": "CHANGELOG.md"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"@semantic-release/git",
|
|
22
|
+
{
|
|
23
|
+
"assets": [
|
|
24
|
+
"CHANGELOG.md",
|
|
25
|
+
"package.json"
|
|
26
|
+
],
|
|
27
|
+
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
]
|
|
31
|
+
}
|
package/README.md
CHANGED
|
@@ -1,49 +1,48 @@
|
|
|
1
1
|
# Eitri
|
|
2
2
|
|
|
3
|
-
CLI
|
|
4
|
-
Eitri-apps são partes integrantes da plataforma eitri de desenvolvimento mobile.
|
|
3
|
+
CLI for developing apps. Eitri-apps are integral parts of the Eitri mobile development platform.
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
## Available commands.
|
|
7
6
|
|
|
8
7
|
```bash
|
|
9
8
|
eitri
|
|
10
9
|
```
|
|
11
|
-
|
|
10
|
+
Show the list of available commands.
|
|
12
11
|
|
|
13
12
|
---
|
|
14
13
|
```bash
|
|
15
14
|
eitri login
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
Requests your credentials for authentication in the CLI.
|
|
19
18
|
|
|
20
19
|
---
|
|
21
20
|
```bash
|
|
22
21
|
eitri create my-eitri-app
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
Create an Eitri project with a name.
|
|
26
25
|
|
|
27
26
|
---
|
|
28
27
|
```bash
|
|
29
28
|
eitri start
|
|
30
29
|
```
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
Start your eitri-app in a development workspace.
|
|
33
32
|
|
|
34
33
|
---
|
|
35
34
|
```bash
|
|
36
35
|
eitri push-version
|
|
37
36
|
```
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
Submit a version of the eitri-app for review by a reviewer in the console before it is published to an environment.
|
|
40
39
|
|
|
41
40
|
---
|
|
42
41
|
```bash
|
|
43
42
|
eitri self-update
|
|
44
43
|
```
|
|
45
44
|
|
|
46
|
-
|
|
45
|
+
Update the eitri-cli itself to the latest version.
|
|
47
46
|
|
|
48
47
|
---
|
|
49
48
|
|
|
@@ -51,4 +50,4 @@ Atualiza a própria eitri-cli para a versão mais recente
|
|
|
51
50
|
<details>
|
|
52
51
|
<summary><b>v1.0.0</b></summary>
|
|
53
52
|
<p>Nasce eitri-cli!</p>
|
|
54
|
-
</details>
|
|
53
|
+
</details>
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
image: node:18
|
|
2
2
|
pipelines:
|
|
3
|
-
default:
|
|
4
|
-
- step: &npmPublish
|
|
5
|
-
name: Publicação no NPM
|
|
6
|
-
caches:
|
|
7
|
-
- node
|
|
8
|
-
script:
|
|
9
|
-
- yarn
|
|
10
|
-
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
|
11
|
-
- node publisher.js
|
|
12
|
-
|
|
13
3
|
branches:
|
|
14
|
-
master:
|
|
15
|
-
- step:
|
|
4
|
+
'{beta,master}':
|
|
5
|
+
- step:
|
|
6
|
+
name: "Generation of a new version: beta or stable."
|
|
7
|
+
caches:
|
|
8
|
+
- node
|
|
9
|
+
script:
|
|
10
|
+
- echo 'Start release'
|
|
11
|
+
- echo 'If there is a new version, it will be automatically published on NPM according to the channel/branch (beta or master (stable)).'
|
|
12
|
+
- yarn
|
|
13
|
+
- yarn run release
|
|
14
|
+
- RELEASE_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
|
|
15
|
+
- node -e "const fs = require('fs'); const packageJson = JSON.parse(fs.readFileSync('package.json')); packageJson.version = process.env.RELEASE_VERSION; fs.writeFileSync('package.json', JSON.stringify(packageJson, null, 4));"
|
|
16
|
+
- echo 'New release'
|
|
17
|
+
- echo $RELEASE_VERSION
|
package/config/prod-eitri.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const HOST = "prod.eitri.calindra.com.br";
|
|
3
3
|
const packageJson = require("../package.json");
|
|
4
4
|
const path = require("path");
|
|
5
|
-
const
|
|
5
|
+
const FOUNDRY_CONTEXT_PATH = process.env.FOUNDRY_CONTEXT_PATH ?? 'foundry'
|
|
6
6
|
|
|
7
7
|
const config = {
|
|
8
8
|
userAgent: packageJson.name,
|
|
@@ -15,17 +15,17 @@ const config = {
|
|
|
15
15
|
.replace(".js", ".")}conf.js`,
|
|
16
16
|
},
|
|
17
17
|
doc: {
|
|
18
|
-
createUrl: `https://admin.${
|
|
18
|
+
createUrl: `https://admin.${HOST}/docs`,
|
|
19
19
|
},
|
|
20
20
|
blindGuardian: {
|
|
21
|
-
url: `https://${
|
|
21
|
+
url: `https://${HOST}/blind-guardian-api`,
|
|
22
22
|
},
|
|
23
23
|
shareApi: {
|
|
24
|
-
url: `https://${
|
|
24
|
+
url: `https://${HOST}/share-api/share`,
|
|
25
25
|
},
|
|
26
26
|
workspace: {
|
|
27
27
|
url: `https://${HOST}`,
|
|
28
|
-
basePath:
|
|
28
|
+
basePath: FOUNDRY_CONTEXT_PATH,
|
|
29
29
|
targetPath: "/foundry/targets",
|
|
30
30
|
target: {
|
|
31
31
|
knownTargets: [
|
|
@@ -42,8 +42,6 @@ const config = {
|
|
|
42
42
|
v2Header: "application/vnd.workspace.api.v2+json",
|
|
43
43
|
},
|
|
44
44
|
colossus: {
|
|
45
|
-
// url: 'https://colossus.lab.calindra.com.br/colossus-api/v1',
|
|
46
|
-
// url: 'https://a32bcb528a6a.ngrok.io/colossus-api/v1',
|
|
47
45
|
url: `https://${HOST}/workspace/server`,
|
|
48
46
|
|
|
49
47
|
// pasta do miniapp dentro de src
|
|
@@ -62,11 +60,11 @@ const config = {
|
|
|
62
60
|
url: "https://prod.eitri.calindra.com.br/workspace/share",
|
|
63
61
|
},
|
|
64
62
|
miniLog: {
|
|
65
|
-
url: `https://${
|
|
63
|
+
url: `https://${HOST}/mini-log/rooms`,
|
|
66
64
|
path: "/mini-log/socket.io",
|
|
67
65
|
},
|
|
68
66
|
managerApi: {
|
|
69
|
-
url: `https://${
|
|
67
|
+
url: `https://${HOST}/miniapp-manager-api`,
|
|
70
68
|
invites: {
|
|
71
69
|
send: "/p/invites",
|
|
72
70
|
slug: "/p/invites/s/:slug",
|
|
@@ -79,10 +77,10 @@ const config = {
|
|
|
79
77
|
},
|
|
80
78
|
},
|
|
81
79
|
eitriManager: {
|
|
82
|
-
url: `https://${
|
|
80
|
+
url: `https://${HOST}/eitri-manager-api`,
|
|
83
81
|
},
|
|
84
82
|
workspaceManager: {
|
|
85
|
-
url: `https://${
|
|
83
|
+
url: `https://${HOST}`,
|
|
86
84
|
path: "/workspace-manager/socket.io",
|
|
87
85
|
contextPath: "/workspace-manager",
|
|
88
86
|
},
|
package/index.js
CHANGED
|
@@ -20,12 +20,10 @@ const run = async () => {
|
|
|
20
20
|
// Continuando como antes...
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
program
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
version()
|
|
28
|
-
})
|
|
23
|
+
program.option("-v, --version", "Mostra a versão da CLI").action(() => {
|
|
24
|
+
const { version } = require("./src/cmd/version");
|
|
25
|
+
version();
|
|
26
|
+
});
|
|
29
27
|
|
|
30
28
|
program
|
|
31
29
|
.command("login")
|
|
@@ -38,18 +36,12 @@ const run = async () => {
|
|
|
38
36
|
|
|
39
37
|
program
|
|
40
38
|
.command("create <project-name>")
|
|
41
|
-
.description(
|
|
42
|
-
`Cria um projeto com um mini app totalmente funcional. Mais detalhes em ${config?.doc?.createUrl}`
|
|
43
|
-
)
|
|
39
|
+
.description(`Cria um projeto com um eitri app totalmente funcional.`)
|
|
44
40
|
.option(
|
|
45
41
|
"--yes",
|
|
46
|
-
"Aceita os valores default para nome titulo e
|
|
42
|
+
"Aceita os valores default para nome titulo e organização"
|
|
47
43
|
)
|
|
48
|
-
.option(
|
|
49
|
-
"--template <template-name>",
|
|
50
|
-
"Define um boilerplate para a criação do projeto"
|
|
51
|
-
)
|
|
52
|
-
.option("--target", "Define a plataforma de execução do Mini App")
|
|
44
|
+
.option("--application", "Define o application de execução do eitri app")
|
|
53
45
|
.option("-v, --verbose", "Exibe mais logs")
|
|
54
46
|
.action((projectName, cmdObj) => {
|
|
55
47
|
require("./src/cmd/create")(projectName, cmdObj);
|
|
@@ -57,163 +49,60 @@ const run = async () => {
|
|
|
57
49
|
|
|
58
50
|
let startProgram = program
|
|
59
51
|
.command("start")
|
|
60
|
-
.description("Inicia o seu
|
|
61
|
-
.option(
|
|
62
|
-
"-A, --upload-all",
|
|
63
|
-
"(Obsoleto) Sobe todos os arquivos. O mesmo funcionamento é garantido usando-o ou não"
|
|
64
|
-
)
|
|
52
|
+
.description("Inicia o seu eitri app em um workspace online")
|
|
65
53
|
.option("-v, --verbose", "Exibe mais logs")
|
|
66
|
-
.option(
|
|
67
|
-
"-N, --new-qrcode",
|
|
68
|
-
"(Obsoleto) Novo qrcode. O mesmo funcionamento é garantido usando-o ou não"
|
|
69
|
-
)
|
|
70
|
-
.option("-Q, --old-qrcode", "QR Code legado")
|
|
71
54
|
.option("-f, --force", "Força o start")
|
|
72
55
|
.option("-S, --show-deeplink", "Exibe o deep link do workspace")
|
|
73
|
-
.option(
|
|
74
|
-
"-z, --zip",
|
|
75
|
-
"(Obsoleto) Envia os arquivos do projeto compactados para o compilador. O mesmo funcionamento é garantido usando-o ou não"
|
|
76
|
-
)
|
|
77
|
-
.option(
|
|
78
|
-
"-U, --unzip",
|
|
79
|
-
"Faz o upload descompactado, arquivo a arquivo, para o compilador"
|
|
80
|
-
)
|
|
81
|
-
.option(
|
|
56
|
+
.option(
|
|
82
57
|
"-P, --qr-printer <qrPrinter>",
|
|
83
|
-
"Indica qual programa imprimirá o QR Code. Se omitido,
|
|
84
|
-
)
|
|
85
|
-
.option("-e, --emulator", "Simula o ambiente de exibição do Mini App.")
|
|
86
|
-
.option(
|
|
87
|
-
"-c, --target-config <config>",
|
|
88
|
-
"Define uma configuração específica para o target do mini-app. Visite nossa documentação on-line para conhecer os cenários em que é necessário utilizar um target-config.",
|
|
89
|
-
"default"
|
|
90
|
-
)
|
|
91
|
-
.option(
|
|
92
|
-
"-l, --list-target-configs",
|
|
93
|
-
"Exibe lista de configurações cadastradas para o target do miniapp"
|
|
58
|
+
"Indica qual programa imprimirá o QR Code. Se omitido, exibe o QrCode no terminal. Valores válidos: terminal|chrome|msedge|firefox"
|
|
94
59
|
);
|
|
95
60
|
|
|
96
61
|
startProgram.action((cmdObj) => {
|
|
97
|
-
if (cmdObj.zip) {
|
|
98
|
-
console.log(
|
|
99
|
-
"Uso de -z ou --zip é redundante. O eitri-app-tools já envia para o compilador os arquivos compactados."
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (cmdObj.newQrcode) {
|
|
104
|
-
console.log(
|
|
105
|
-
"Uso de -N ou --new-qrcode é redundante. O eitri-app-tools já otimiza o Qr Code."
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (cmdObj.uploadAll) {
|
|
110
|
-
console.log(
|
|
111
|
-
"Uso de -A ou --upload-all é redundante. O eitri-app-tools já faz o envio em lote dos arquivos do projeto"
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
62
|
require("./src/cmd/start")(cmdObj);
|
|
116
63
|
});
|
|
117
64
|
|
|
118
|
-
// program
|
|
119
|
-
// .command('test-initialization-params <initializationParams>')
|
|
120
|
-
// .description('Passa parâmetros em querystring para a inicialização do mini app. ex: "stringChave1=stringValor1&stringChave2=stringValor2..."')
|
|
121
|
-
// .option('-Q, --old-qrcode', 'QR Code legado')
|
|
122
|
-
// .option('-N, --new-qrcode', '(Obsoleto) Novo qrcode')
|
|
123
|
-
// .option('-S, --show-deeplink', 'Exibe o deep link do workspace')
|
|
124
|
-
// .option('-V, --verbose', 'Exibe mais logs')
|
|
125
|
-
// .action((initializationParams, cmdObj) => {
|
|
126
|
-
// if (cmdObj.newQrcode) {
|
|
127
|
-
// console.log('Uso de -N ou --new-qrcode é redundante. O "eitri" já otimiza o Qr Code.')
|
|
128
|
-
// }
|
|
129
|
-
|
|
130
|
-
// require('./src/cmd/test-initialization-params')(initializationParams, cmdObj)
|
|
131
|
-
// })
|
|
132
|
-
|
|
133
|
-
// program
|
|
134
|
-
// .command('order-details <orderId>')
|
|
135
|
-
// .description('Abre o mini app na tela de detalhes da ordem')
|
|
136
|
-
// .option('-l, --local', 'Aponta para o servidor local')
|
|
137
|
-
// .option('-A, --upload-all', 'Sobe todos os arquivos')
|
|
138
|
-
// .action((orderId, cmdObj) => {
|
|
139
|
-
// require('./src/cmd/order-details')(orderId, cmdObj)
|
|
140
|
-
// })
|
|
141
|
-
|
|
142
65
|
program
|
|
143
66
|
.command("push-version")
|
|
144
67
|
.description(
|
|
145
|
-
"Cria e envia
|
|
68
|
+
"Cria e envia uma versão do eitri-app para o Console, possibilitando também publicar em um ambiente."
|
|
146
69
|
)
|
|
147
70
|
.option("-l, --local", "Aponta para o servidor local")
|
|
148
71
|
.option("-v, --verbose", "Exibe mais logs")
|
|
149
72
|
.option(
|
|
150
73
|
"-c, --components",
|
|
151
|
-
"Publica o
|
|
74
|
+
"Publica o eitri app como biblioteca de components"
|
|
152
75
|
)
|
|
153
76
|
.option(
|
|
154
77
|
"-m, --message <revision-message>",
|
|
155
|
-
"Adiciona comentários
|
|
78
|
+
"Adiciona comentários na versão"
|
|
156
79
|
)
|
|
157
80
|
.option("-y, --yes", "Aceita automaticamente as respostas do prompt.")
|
|
158
81
|
.action((cmdObj) => {
|
|
159
82
|
require("./src/cmd/push-version")(cmdObj);
|
|
160
83
|
});
|
|
161
84
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
85
|
+
program
|
|
86
|
+
.command('clean')
|
|
87
|
+
.description(
|
|
88
|
+
'Realiza a limpeza do workspace remoto do desenvolvedor. Útil quando há mal fucionamento na compilação em nuvem do eitri app.'
|
|
89
|
+
)
|
|
90
|
+
.option('-v, --verbose', 'Exibe mais logs')
|
|
91
|
+
.action(cmdObj => {
|
|
92
|
+
require('./src/cmd/clean')(cmdObj)
|
|
93
|
+
})
|
|
171
94
|
|
|
172
95
|
program
|
|
173
96
|
.command("self-update")
|
|
174
|
-
.description("Desinstala a
|
|
97
|
+
.description("Desinstala a versão antiga e instala a mais nova")
|
|
175
98
|
.action(() => {
|
|
176
|
-
require(
|
|
177
|
-
|
|
178
|
-
{stdio:
|
|
179
|
-
)
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
// program
|
|
183
|
-
// .command('open-share <share-id>')
|
|
184
|
-
// .description('Abre um compartilhamento do share-api')
|
|
185
|
-
// .action((shareId, cmdObj) =>
|
|
186
|
-
// require('./src/cmd/open-share')(shareId, cmdObj)
|
|
187
|
-
// )
|
|
188
|
-
|
|
189
|
-
// program
|
|
190
|
-
// .command('tail-logs <email>')
|
|
191
|
-
// .description('Para ler logs de prod do email')
|
|
192
|
-
// .action((email, cmdObj) => {
|
|
193
|
-
// require('./src/cmd/tail-logs')(email, cmdObj)
|
|
194
|
-
// })
|
|
195
|
-
|
|
196
|
-
// program
|
|
197
|
-
// .command('invite [email]')
|
|
198
|
-
// .option('--remove', 'Remove o desenvolvedor')
|
|
199
|
-
// .option('--list', 'Lista todos os desenvolvedores')
|
|
200
|
-
// .option('--accept', 'Aceita um convite')
|
|
201
|
-
// .option('-v, --verbose', 'Exibe mais logs')
|
|
202
|
-
// .description('Convida um desenvolvedor para contribuir com o seu miniapp')
|
|
203
|
-
// .action((email, cmdObj) => require('./src/cmd/invite')(email, cmdObj))
|
|
204
|
-
|
|
205
|
-
// program
|
|
206
|
-
// .command('list')
|
|
207
|
-
// .description('Lista as opções de um determinado comando')
|
|
208
|
-
// .option('--template', 'exibe os tipos de templates disponíveis, para gerar um exemplo de projeto.')
|
|
209
|
-
// .action((cmdObj) =>
|
|
210
|
-
// require('./src/cmd/list')(cmdObj))
|
|
211
|
-
|
|
212
|
-
// if (!process.argv.slice(2).length) {
|
|
213
|
-
// program.outputHelp()
|
|
214
|
-
// }
|
|
99
|
+
require("child_process").execSync(
|
|
100
|
+
"npm uninstall -g eitri-cli && npm i eitri-cli -g",
|
|
101
|
+
{ stdio: "inherit" }
|
|
102
|
+
);
|
|
103
|
+
});
|
|
215
104
|
|
|
216
|
-
program.addCommand(VegvisirCommand())
|
|
105
|
+
program.addCommand(VegvisirCommand())
|
|
217
106
|
|
|
218
107
|
if (
|
|
219
108
|
process.argv.length > 2 &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eitri-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-beta.1",
|
|
4
4
|
"description": "Command Line Interface to make \"eitri app\" with code and fire.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"test-eitri": "NODE_APP_INSTANCE=eitri jest --detectOpenHandles",
|
|
11
11
|
"linter": "./node_modules/.bin/eslint --fix ./src/**/*.js",
|
|
12
12
|
"docsify:run": "cd docsify && docsify serve",
|
|
13
|
-
"build": "echo \"no build\""
|
|
13
|
+
"build": "echo \"no build\"",
|
|
14
|
+
"release": "semantic-release",
|
|
15
|
+
"release:dry": "semantic-release --dry-run"
|
|
14
16
|
},
|
|
15
17
|
"engines": {
|
|
16
18
|
"node": ">=16.0.0",
|
|
@@ -68,7 +70,10 @@
|
|
|
68
70
|
"husky": "^3.1.0",
|
|
69
71
|
"jest": "^24.9.0",
|
|
70
72
|
"lint-staged": "^9.5.0",
|
|
71
|
-
"nock": "^13.3.0"
|
|
73
|
+
"nock": "^13.3.0",
|
|
74
|
+
"semantic-release": "^22.0.5",
|
|
75
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
76
|
+
"@semantic-release/git": "^10.0.1"
|
|
72
77
|
},
|
|
73
78
|
"resolutions": {
|
|
74
79
|
"lodash": "4.17.21",
|
package/src/cmd/clean.js
CHANGED
|
@@ -12,46 +12,7 @@ const targetService = new TargetService(workspace)
|
|
|
12
12
|
|
|
13
13
|
module.exports = async function clean(cmdObj) {
|
|
14
14
|
try {
|
|
15
|
-
const start = Date.now()
|
|
16
15
|
await validator.assertCommandNotRunning('clean')
|
|
17
|
-
let miniConf = workspace.getMiniConf()
|
|
18
|
-
let validateResult = checkErros(miniConf)
|
|
19
|
-
|
|
20
|
-
if (!validateResult.isSuccess()) {
|
|
21
|
-
console.log(
|
|
22
|
-
'Por favor, verifique atentamente os erros exibidos acima. Siga o exemplo abaixo: ' +
|
|
23
|
-
`
|
|
24
|
-
module.exports = {
|
|
25
|
-
|
|
26
|
-
// Dados da sua empresa
|
|
27
|
-
organization: {
|
|
28
|
-
"name": "Minha Empresa"
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
// Nome do seu mini app
|
|
32
|
-
"name": "Meu Mini App",
|
|
33
|
-
|
|
34
|
-
// Titulo do mini app, que vai em baixo do botao na pagina de transacoes
|
|
35
|
-
"title": "Meu super mini app",
|
|
36
|
-
|
|
37
|
-
// Chave para gerar a ordem/qrcode de pagamento (opcional)
|
|
38
|
-
"public-key": "",
|
|
39
|
-
|
|
40
|
-
// Identificador amigavel para colocar em uma url
|
|
41
|
-
"slug": "com.eitri.loja",
|
|
42
|
-
|
|
43
|
-
// Versao do mini app
|
|
44
|
-
"version": "1.0.0",
|
|
45
|
-
|
|
46
|
-
${await targetService.getAppConfExampleSnippet()}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
`
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
}
|
|
55
16
|
|
|
56
17
|
blindGuardian.readConf()
|
|
57
18
|
workspace.setServerUrl(config.get('workspace').url)
|
|
@@ -63,7 +24,6 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
63
24
|
|
|
64
25
|
console.log('[1] Limpo.')
|
|
65
26
|
|
|
66
|
-
await track(miniConf, start)
|
|
67
27
|
TrackingEitriAnalytics.sendEvent({
|
|
68
28
|
command: "clean",
|
|
69
29
|
success: true,
|
package/src/cmd/login.js
CHANGED
|
@@ -6,13 +6,13 @@ const Server = require('../service/Server')
|
|
|
6
6
|
|
|
7
7
|
module.exports = async function login(args) {
|
|
8
8
|
try {
|
|
9
|
-
console.log("
|
|
9
|
+
console.log("\n\n")
|
|
10
10
|
|
|
11
11
|
const {openPortalAnwser} = await inquirer.prompt([
|
|
12
12
|
{
|
|
13
13
|
type: 'confirm',
|
|
14
14
|
name: 'openPortalAnwser',
|
|
15
|
-
message: ' Podemos
|
|
15
|
+
message: ' Podemos redirecioná-lo para o login?',
|
|
16
16
|
},
|
|
17
17
|
])
|
|
18
18
|
|
|
@@ -24,19 +24,19 @@ module.exports = async function login(args) {
|
|
|
24
24
|
let portalOpenMessage = ""
|
|
25
25
|
|
|
26
26
|
if (openPortalAnwser) {
|
|
27
|
-
console.log("\n", "
|
|
27
|
+
console.log("\n", "Redirecionando...")
|
|
28
28
|
try {
|
|
29
29
|
open(urlAdminManagerCredentialWithParams)
|
|
30
|
-
portalOpenMessage = "
|
|
30
|
+
portalOpenMessage = "Aberto em seu navegador padrão"
|
|
31
31
|
} catch (error) {
|
|
32
|
-
portalOpenMessage = "Não foi possível abrir
|
|
32
|
+
portalOpenMessage = "Não foi possível abrir automaticamente. Copie o link e cole em seu navegador para fazer o login na Eitri CLI. " + urlAdminManagerCredentialWithParams
|
|
33
33
|
}
|
|
34
34
|
} else {
|
|
35
35
|
portalOpenMessage = "Copie o link e cole em seu navegador para fazer o login na Eitri CLI. " + urlAdminManagerCredentialWithParams
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
console.log("\n", portalOpenMessage)
|
|
39
|
-
console.log("\n\n Aguardando
|
|
39
|
+
console.log("\n\n Aguardando autenticação...")
|
|
40
40
|
} catch (error) {
|
|
41
41
|
await TrackingEitriAnalytics.sendEvent({
|
|
42
42
|
command: "login",
|
package/src/cmd/push-version.js
CHANGED
|
@@ -72,7 +72,7 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
72
72
|
const separator = '======================================================================='
|
|
73
73
|
blindGuardian.readConf()
|
|
74
74
|
workspace.setServerUrl(config.get('workspace').url)
|
|
75
|
-
console.log('Conectando
|
|
75
|
+
console.log('Conectando ao Eitri...')
|
|
76
76
|
await workspace.init()
|
|
77
77
|
const userWorkspace = await getWorkspace()
|
|
78
78
|
await miniLog.connect(userWorkspace.id)
|
|
@@ -101,16 +101,20 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
101
101
|
console.log(separator)
|
|
102
102
|
console.log('\x1b[1m\x1b[32mSucesso!!\x1b[0m');
|
|
103
103
|
console.log(`\x1b[1mA versão [${miniConf.version}] do seu eitri-app foi gerada e está\x1b[0m`);
|
|
104
|
-
console.log('\x1b[1mdisponível no Eitri
|
|
104
|
+
console.log('\x1b[1mdisponível no Eitri Console para aprovação\x1b[0m');
|
|
105
105
|
console.log(separator)
|
|
106
106
|
|
|
107
|
+
const organization = miniConf?.organization ? Object.keys(miniConf?.organization).length !== 0 ? miniConf?.organization : "-" : {
|
|
108
|
+
id: miniConf?.organizationId
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
await TrackingEitriAnalytics.sendEvent({
|
|
108
112
|
command: "push-version",
|
|
109
113
|
success: true,
|
|
110
114
|
data: {
|
|
111
115
|
eitriApp: {
|
|
112
116
|
...miniConf,
|
|
113
|
-
organization
|
|
117
|
+
organization
|
|
114
118
|
},
|
|
115
119
|
target,
|
|
116
120
|
startDate: `${start}`,
|
|
@@ -125,7 +129,7 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
125
129
|
} else if (e && e.message) {
|
|
126
130
|
console.log(`\x1b[1m\x1b[31m${e.message}\x1b[0m`);
|
|
127
131
|
} else {
|
|
128
|
-
console.log(`\x1b[1m\x1b[31mNão será possível continuar por enquanto.
|
|
132
|
+
console.log(`\x1b[1m\x1b[31mNão será possível continuar por enquanto. Ocorreu um erro.\x1b[0m`);
|
|
129
133
|
}
|
|
130
134
|
|
|
131
135
|
await TrackingEitriAnalytics.sendEvent({
|
package/src/cmd/validate.js
CHANGED
|
@@ -73,12 +73,6 @@ module.exports.validate = function (miniConf) {
|
|
|
73
73
|
let isversionvalid = checkAmeVersion(miniConf)
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
if (!miniConf.organization) {
|
|
77
|
-
validateResult.addError(
|
|
78
|
-
'Por Favor, preencha o campo \'organization\' (Utilize apenas caracteres maiusculo, minusculo e espaco. Ex: \'Minha Empresa\').'
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
76
|
if (!miniConf.name) {
|
|
83
77
|
validateResult.addError(
|
|
84
78
|
'Por Favor, preencha o campo \'name\' (Utilize apenas caracteres maiusculo, minusculo e espaco. Ex: \'Meu Mini App\').'
|
package/src/cmd/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('path')
|
|
2
2
|
const { execSync } = require('child_process')
|
|
3
|
-
|
|
3
|
+
const semver = require('semver')
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Loga a versao de um pacote npm
|
|
@@ -8,13 +8,13 @@ const { execSync } = require('child_process')
|
|
|
8
8
|
function version() {
|
|
9
9
|
let packageJson = require(path.resolve(__dirname, '..', '..', 'package.json'))
|
|
10
10
|
let publishedVersion = getVersion(packageJson.name)
|
|
11
|
-
if (packageJson.version
|
|
11
|
+
if (semver.lt(packageJson.version, publishedVersion)) {
|
|
12
12
|
console.log(packageJson.version)
|
|
13
13
|
console.log(
|
|
14
14
|
`\n> Você está usando a versão ${packageJson.version}, temos uma nova versão: ${publishedVersion}!`
|
|
15
15
|
)
|
|
16
16
|
console.log(
|
|
17
|
-
`> Para atualizar use o comando:
|
|
17
|
+
`> Para atualizar use o comando: eitri self-update`
|
|
18
18
|
)
|
|
19
19
|
} else {
|
|
20
20
|
console.log(packageJson.version)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
const commander = require("commander");
|
|
2
2
|
|
|
3
3
|
module.exports = function VegvisirCommand() {
|
|
4
|
-
const workspaceCommand = commander.command("workspace")
|
|
4
|
+
const workspaceCommand = commander.command("workspace")
|
|
5
|
+
.description("Gerencia os workspaces do desenvolvedor, para mais informações execute 'eitri workspace --help'")
|
|
6
|
+
|
|
5
7
|
workspaceCommand
|
|
6
8
|
.command("list")
|
|
7
9
|
.description("Lista os workspaces do usuário")
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const { writeFile, rename } = require("fs/promises");
|
|
2
|
+
const chalk = require("chalk");
|
|
3
|
+
const path = require('path')
|
|
4
|
+
const {existsSync} = require('fs')
|
|
5
|
+
module.exports = class EitriAppService {
|
|
6
|
+
validEitriConf(eitriConf) {
|
|
7
|
+
const requiredFields = ["id", "applicationId", "organizationId"];
|
|
8
|
+
let isValid = true;
|
|
9
|
+
for (const field of requiredFields) {
|
|
10
|
+
if (!eitriConf[field]) isValid = false;
|
|
11
|
+
}
|
|
12
|
+
return isValid;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async writeEitriConf(remoteEitriConf, localEitriConf, folder2WatchPath) {
|
|
16
|
+
if (!remoteEitriConf) return;
|
|
17
|
+
|
|
18
|
+
const eitriAppConfPath = path.resolve(
|
|
19
|
+
folder2WatchPath,
|
|
20
|
+
"../eitri-app.conf.js"
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
if (!existsSync(eitriAppConfPath)) {
|
|
24
|
+
console.warn(
|
|
25
|
+
chalk.yellow.underline.bold(
|
|
26
|
+
"Renomeando arquivo de configuração de miniapp.conf.js -> eitri-app.conf.js",
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
const miniAppConfPath = path.resolve(
|
|
30
|
+
folder2WatchPath,
|
|
31
|
+
"../miniapp.conf.js"
|
|
32
|
+
);
|
|
33
|
+
await rename(miniAppConfPath, eitriAppConfPath);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
let updatedEitriConf = {
|
|
37
|
+
...localEitriConf,
|
|
38
|
+
...remoteEitriConf,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const eitriConf = `module.exports = ${JSON.stringify(
|
|
42
|
+
updatedEitriConf,
|
|
43
|
+
null,
|
|
44
|
+
'\t'
|
|
45
|
+
)}`;
|
|
46
|
+
|
|
47
|
+
await writeFile(eitriAppConfPath, eitriConf, "utf8");
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/service/Http.js
CHANGED
|
@@ -50,7 +50,7 @@ class Http {
|
|
|
50
50
|
|
|
51
51
|
getCookieSession(url) {
|
|
52
52
|
return new Promise((resolve, reject) => {
|
|
53
|
-
jar.getCookies(url, function (err, cookies) {
|
|
53
|
+
jar.getCookies(url, { allPaths: true }, function (err, cookies) {
|
|
54
54
|
if (err) return reject(err)
|
|
55
55
|
resolve(cookies.find((cookie) => cookie))
|
|
56
56
|
})
|
package/src/service/MiniLog.js
CHANGED
|
@@ -121,12 +121,29 @@ class MiniLog {
|
|
|
121
121
|
console.log(chalk.cyan(msg))
|
|
122
122
|
} else {
|
|
123
123
|
// A propriedade userFriendlyMessage deve ser tratada pelo miniapp. Logaremos da forma como o miniapp nos fornecer o objeto.
|
|
124
|
-
|
|
124
|
+
if(!data.method) {
|
|
125
|
+
console.log(`\x1b[34meitri:\x1b[0m\x1b[97m${data.msg}\x1b[0m`);
|
|
126
|
+
} else {
|
|
127
|
+
const message = this._colorizeMessage(data.msg, data.method)
|
|
128
|
+
console[data.method](`\x1b[34meitri:\x1b[0m${message}`);
|
|
129
|
+
}
|
|
125
130
|
}
|
|
126
131
|
if (data.stopCLI) {
|
|
127
132
|
process.exit(1)
|
|
128
133
|
}
|
|
129
134
|
}
|
|
135
|
+
|
|
136
|
+
_colorizeMessage(message, method) {
|
|
137
|
+
const colorizedMessage = {
|
|
138
|
+
log: chalk.hex("#95DB00")(message),
|
|
139
|
+
warn: chalk.yellow(message),
|
|
140
|
+
error: chalk.red(message),
|
|
141
|
+
info: chalk.green(message),
|
|
142
|
+
debug: chalk.blue(message),
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
return colorizedMessage[method] || colorizedMessage.log
|
|
146
|
+
}
|
|
130
147
|
}
|
|
131
148
|
|
|
132
149
|
module.exports = MiniLog
|
package/src/service/Workspace.js
CHANGED
|
@@ -18,7 +18,6 @@ const packageJson = require(path.resolve(
|
|
|
18
18
|
const tempFolderPath = require("../util/os").OS_MAPPER;
|
|
19
19
|
const TargetService = require("../service/TargetService");
|
|
20
20
|
const WatcherOpts = require("../enum/WatcherOpts");
|
|
21
|
-
const { default: axios } = require("../../node_modules/axios/index");
|
|
22
21
|
const ipv4 = require("../util/ipv4");
|
|
23
22
|
const { compressToBase64 } = require("lz-string");
|
|
24
23
|
const Buffer = require("buffer");
|
|
@@ -26,7 +25,10 @@ const DEFAULT_ENV = "dev";
|
|
|
26
25
|
const cliProgress = require("cli-progress");
|
|
27
26
|
const EitriAppManager = require("./EitriAppManager");
|
|
28
27
|
const getWorkspace = require("../util/getWorkspace");
|
|
28
|
+
const EitriAppService = require("./EitriAppService");
|
|
29
|
+
|
|
29
30
|
class Workspace {
|
|
31
|
+
|
|
30
32
|
constructor(blindGuardian, hashFolder) {
|
|
31
33
|
this.config = config.get("workspace");
|
|
32
34
|
this.basePath = this.config.basePath;
|
|
@@ -51,6 +53,11 @@ class Workspace {
|
|
|
51
53
|
*/
|
|
52
54
|
this.progressBar;
|
|
53
55
|
this.progressBarCounter = 0;
|
|
56
|
+
/**
|
|
57
|
+
* @type {EitriAppService}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
this.eitriAppService = new EitriAppService();
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
getTargets() {
|
|
@@ -211,7 +218,11 @@ class Workspace {
|
|
|
211
218
|
|
|
212
219
|
const setupData = setupResponse.data;
|
|
213
220
|
|
|
214
|
-
const { state, target: remoteTarget } = setupData;
|
|
221
|
+
const { state, target: remoteTarget, eitriConf: remoteEitriConf } = setupData;
|
|
222
|
+
|
|
223
|
+
if(!this.eitriAppService.validEitriConf(miniConf)) {
|
|
224
|
+
await this.eitriAppService.writeEitriConf(remoteEitriConf, miniConf, this.folder2watch);
|
|
225
|
+
}
|
|
215
226
|
|
|
216
227
|
this.printLibsVersion(state);
|
|
217
228
|
|
|
@@ -952,77 +963,6 @@ class Workspace {
|
|
|
952
963
|
return results;
|
|
953
964
|
}
|
|
954
965
|
|
|
955
|
-
//TODO: ESSE MÉTODO DEVE SER APAGADO, QUANDO NÃO EXISTIR MAIS O COMANDO PUBLISH
|
|
956
|
-
async publish(publishMessage) {
|
|
957
|
-
const miniConf = this.getMiniConf();
|
|
958
|
-
const formData = new FormData();
|
|
959
|
-
|
|
960
|
-
formData.append("miniAppName", miniConf.name || "sem nome");
|
|
961
|
-
formData.append("miniAppSlug", miniConf.slug || "sem-slug");
|
|
962
|
-
formData.append("miniAppTitle", miniConf.title || "Sem Titulo");
|
|
963
|
-
formData.append(
|
|
964
|
-
"miniAppVersion",
|
|
965
|
-
miniConf.miniAppVersion || miniConf.version || "0.1.0"
|
|
966
|
-
);
|
|
967
|
-
formData.append("organizationName", miniConf.organization.name);
|
|
968
|
-
formData.append("publishMessage", publishMessage || "");
|
|
969
|
-
|
|
970
|
-
const url = `${this.serverUrl}/${this.basePath}/publish?async=true`;
|
|
971
|
-
await this.http.postForm(url, formData);
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
async build(buildMessage) {
|
|
975
|
-
const miniConf = this.getMiniConf();
|
|
976
|
-
const formData = new FormData();
|
|
977
|
-
|
|
978
|
-
formData.append("miniAppName", miniConf.name || "sem nome");
|
|
979
|
-
formData.append("miniAppSlug", miniConf.slug || "sem-slug");
|
|
980
|
-
formData.append("miniAppTitle", miniConf.title || "Sem Titulo");
|
|
981
|
-
formData.append(
|
|
982
|
-
"miniAppVersion",
|
|
983
|
-
miniConf.miniAppVersion || miniConf.version || "v1"
|
|
984
|
-
);
|
|
985
|
-
formData.append("organizationName", miniConf.organization.name);
|
|
986
|
-
formData.append("publishMessage", buildMessage || "");
|
|
987
|
-
|
|
988
|
-
const url = `${this.serverUrl}/${this.basePath}/publish?async=true`;
|
|
989
|
-
await this.http.postForm(url, formData);
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
/**
|
|
993
|
-
* @deprecated Prefira {@link Workspace#pushVersionAsJson}
|
|
994
|
-
*/
|
|
995
|
-
async pushVersionAsForm(buildMessage) {
|
|
996
|
-
const miniConf = this.getMiniConf();
|
|
997
|
-
const formData = new FormData();
|
|
998
|
-
|
|
999
|
-
let attrValue;
|
|
1000
|
-
|
|
1001
|
-
formData.append("miniAppName", miniConf.name || "sem nome");
|
|
1002
|
-
formData.append("miniAppSlug", miniConf.slug || "sem-slug");
|
|
1003
|
-
formData.append("miniAppTitle", miniConf.title || "Sem Titulo");
|
|
1004
|
-
formData.append(
|
|
1005
|
-
"miniAppVersion",
|
|
1006
|
-
miniConf.miniAppVersion || miniConf.version || "v1"
|
|
1007
|
-
);
|
|
1008
|
-
formData.append("organizationName", miniConf.organization.name);
|
|
1009
|
-
formData.append("miniAppSubSetName", miniConf.name);
|
|
1010
|
-
formData.append("miniAppSubSetTitle", miniConf.title);
|
|
1011
|
-
if ((attrValue = miniConf["eitri-app-components"]))
|
|
1012
|
-
formData.append("cliComponentsVersion", attrValue);
|
|
1013
|
-
if ((attrValue = miniConf["eitri-app-client"]))
|
|
1014
|
-
formData.append("cliSuperAppClientVersion", attrValue);
|
|
1015
|
-
if ((attrValue = packageJson.version))
|
|
1016
|
-
formData.append("cliVersion", attrValue);
|
|
1017
|
-
if ((attrValue = buildMessage))
|
|
1018
|
-
formData.append("publishMessage", attrValue);
|
|
1019
|
-
if ((attrValue = miniConf.privacy))
|
|
1020
|
-
formData.append("privacy", JSON.stringify(attrValue));
|
|
1021
|
-
|
|
1022
|
-
const url = `${this.serverUrl}/${this.basePath}/publish?async=true`;
|
|
1023
|
-
await this.http.postForm(url, formData);
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
966
|
async pushVersionAsJson(args) {
|
|
1027
967
|
let headers = {};
|
|
1028
968
|
if (this.config.apiVersion && this.config.apiVersion.v2Header) {
|
package/test/cmd/create.test.js
CHANGED
package/publisher.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { execSync, exec } = require('child_process');
|
|
4
|
-
|
|
5
|
-
publishAsNeeded();
|
|
6
|
-
|
|
7
|
-
function publishAsNeeded() {
|
|
8
|
-
fs.readFile(path.join(__dirname, 'package.json'), 'utf8', (err, data) => {
|
|
9
|
-
if (err) {
|
|
10
|
-
console.error('Error:', err);
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
let packageJson = JSON.parse(data);
|
|
14
|
-
let localVersion = packageJson.version;
|
|
15
|
-
let publishedVersions = JSON.parse(execSync('npm show ' + packageJson.name + ' versions --json').toString());
|
|
16
|
-
if (publishedVersions.includes(localVersion)) {
|
|
17
|
-
console.log('published version is the same of package.json:', localVersion);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
console.log('publishing new version', localVersion, '...');
|
|
22
|
-
|
|
23
|
-
const branch = process.env.BITBUCKET_BRANCH
|
|
24
|
-
console.log('current branch on build', branch);
|
|
25
|
-
|
|
26
|
-
//apenas beta e alpha pode ser publicado fora da master
|
|
27
|
-
if("master" !== branch && !(/beta|alpha/.test(localVersion))){
|
|
28
|
-
console.log('main channel out of master branch SKIPPED...');
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let commandSuffix = "";
|
|
33
|
-
|
|
34
|
-
if(/beta/.test(localVersion)) {
|
|
35
|
-
commandSuffix = "--tag beta";
|
|
36
|
-
} else if(/alpha/.test(localVersion)) {
|
|
37
|
-
commandSuffix = "--tag alpha";
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
exec('npm run build && npm publish ' + commandSuffix, (err, stdout, stderr) => {
|
|
41
|
-
if (err) {
|
|
42
|
-
// node couldn't execute the command
|
|
43
|
-
console.log('Error:', err);
|
|
44
|
-
process.exit(2);
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// the *entire* stdout and stderr (buffered)
|
|
49
|
-
console.log(`stdout: ${stdout}`);
|
|
50
|
-
console.log(`stderr: ${stderr}`);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
```plantuml
|
|
2
|
-
@startuml
|
|
3
|
-
autonumber
|
|
4
|
-
title Fluxo de Stickyness para mobile
|
|
5
|
-
|
|
6
|
-
participant Developer
|
|
7
|
-
participant SuperApp
|
|
8
|
-
participant AmeAppTools
|
|
9
|
-
participant ALB
|
|
10
|
-
participant AmeCliReloader1
|
|
11
|
-
participant AmeCliReloader2
|
|
12
|
-
participant AmeCliReloader3
|
|
13
|
-
participant ShareApi
|
|
14
|
-
|
|
15
|
-
Developer->AmeAppTools: start()
|
|
16
|
-
AmeAppTools->AmeAppTools: cookie = loadCookie('~/.ame.cookie.json')
|
|
17
|
-
AmeAppTools->AmeAppTools: bootstrapUrl = bootstrapUrl.append(cookie)
|
|
18
|
-
AmeAppTools->AmeAppTools: data = buildQrCodeData(bootstrapUrl)
|
|
19
|
-
AmeAppTools->ALB: saveQrCodeData(data, cookie)
|
|
20
|
-
ALB->ALB: chooseWorkspaceInstance(cookie)
|
|
21
|
-
note over ALB
|
|
22
|
-
Se o Cookie veio vazio o ALB seleciona o AmeCliReloader1
|
|
23
|
-
Se o Cookie veio preenchido o ALB seleciona a instancia definida no cookie
|
|
24
|
-
end note
|
|
25
|
-
ALB->AmeCliReloader1: saveQrCodeData(data)
|
|
26
|
-
AmeCliReloader1->ShareApi: saveQrCodeData(data)
|
|
27
|
-
ShareApi-->AmeCliReloader1:
|
|
28
|
-
AmeCliReloader1-->ALB:
|
|
29
|
-
ALB-->AmeAppTools: cookie
|
|
30
|
-
AmeAppTools->ALB: uploadSourceCode(cookie, 'foo.js')
|
|
31
|
-
ALB->ALB: chooseWorkspaceInstance(cookie)
|
|
32
|
-
ALB->AmeCliReloader1: uploadSourceCode()
|
|
33
|
-
ALB<--AmeCliReloader1
|
|
34
|
-
ALB->ALB: Se o cookie expirou um novo será gerado
|
|
35
|
-
ALB-->AmeAppTools: cookie
|
|
36
|
-
AmeAppTools->AmeAppTools: save(cookie, '~/.ame.cookie.json')
|
|
37
|
-
AmeAppTools->AmeAppTools: showQrCode()
|
|
38
|
-
Developer->SuperApp: scanQrCode()
|
|
39
|
-
SuperApp->ShareApi: data = getQrCodeData()
|
|
40
|
-
SuperApp->ALB: getMiniApp(data.bootstrapUrl)
|
|
41
|
-
ALB->ALB: chooseWorkpaceInstance(bootstrapUrl.query('cid'))
|
|
42
|
-
ALB->AmeCliReloader1: getMiniApp(data.bootstrapUrl)
|
|
43
|
-
AmeCliReloader1-->ALB: html do miniapp
|
|
44
|
-
ALB-->SuperApp: html do miniapp
|
|
45
|
-
SuperApp->SuperApp: Exibe miniapp
|
|
46
|
-
@enduml
|
|
47
|
-
```
|
package/targetWebStickyness.md
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
```plantuml
|
|
2
|
-
@startuml
|
|
3
|
-
autonumber
|
|
4
|
-
title Fluxo de Stickyness para Web
|
|
5
|
-
|
|
6
|
-
participant Developer
|
|
7
|
-
participant SuperApp
|
|
8
|
-
participant AmeAppTools
|
|
9
|
-
participant Emulator
|
|
10
|
-
participant ALB
|
|
11
|
-
participant AmeCliReloader1
|
|
12
|
-
participant AmeCliReloader2
|
|
13
|
-
participant AmeCliReloader3
|
|
14
|
-
|
|
15
|
-
Developer->AmeAppTools: start()
|
|
16
|
-
AmeAppTools->AmeAppTools: cookie = loadCookie('~/.ame.cookie.json')
|
|
17
|
-
AmeAppTools->AmeAppTools: bootstrapUrl = bootstrapUrl.append(cookie)
|
|
18
|
-
AmeAppTools->ALB: uploadSourceCode(cookie, 'foo.js')
|
|
19
|
-
ALB->ALB: chooseWorkspaceInstance(cookie)
|
|
20
|
-
note over ALB
|
|
21
|
-
Se o Cookie veio vazio o ALB seleciona o AmeCliReloader1
|
|
22
|
-
Se o Cookie veio preenchido o ALB seleciona a instancia definida no cookie
|
|
23
|
-
end note
|
|
24
|
-
ALB->AmeCliReloader1: uploadSourceCode()
|
|
25
|
-
AmeCliReloader1-->ALB:
|
|
26
|
-
ALB->ALB: Se o cookie expirou um novo será gerado
|
|
27
|
-
ALB-->AmeAppTools: cookie
|
|
28
|
-
AmeAppTools->AmeAppTools: save(cookie, '~/.ame.cookie.json')
|
|
29
|
-
AmeAppTools->Emulator: openEmulator(bootstrapUrl)
|
|
30
|
-
Emulator->Emulator: abre url no iframe
|
|
31
|
-
Emulator->AmeAppTools: request pelo próprio localhost
|
|
32
|
-
AmeAppTools->AmeAppTools: troca o host
|
|
33
|
-
AmeAppTools->ALB: getMiniApp(cookie, bootstrapUrl)
|
|
34
|
-
ALB->AmeCliReloader1: getMiniApp(bootstrapUrl)
|
|
35
|
-
AmeCliReloader1-->ALB: html do miniapp
|
|
36
|
-
ALB-->AmeAppTools: html do miniapp + cookie
|
|
37
|
-
AmeAppTools-->Emulator: html do miniapp
|
|
38
|
-
Emulator->Emulator: Exibe miniapp
|
|
39
|
-
@enduml
|
|
40
|
-
```
|
package/thinQrCode.md
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
```plantuml
|
|
2
|
-
@startuml
|
|
3
|
-
autonumber
|
|
4
|
-
title Fluxo de Notificação
|
|
5
|
-
|
|
6
|
-
participant Developer
|
|
7
|
-
participant AmeAppTools
|
|
8
|
-
participant SuperApp
|
|
9
|
-
participant AmeCliReloader
|
|
10
|
-
participant ShareApi
|
|
11
|
-
|
|
12
|
-
Developer->AmeAppTools: start()
|
|
13
|
-
AmeAppTools->AmeCliReloader: uploadSourceCode()
|
|
14
|
-
AmeAppTools->AmeAppTools: setupQrCodeConfig()
|
|
15
|
-
note over AmeAppTools
|
|
16
|
-
- Atribui dados conhecidos
|
|
17
|
-
do miniapp no ame.conf;
|
|
18
|
-
- Atribui as permissions ( XX );
|
|
19
|
-
- Monta a url de leitura
|
|
20
|
-
do share-api;
|
|
21
|
-
- Monta url para abrir o
|
|
22
|
-
miniapp (bootstrapUrl).
|
|
23
|
-
end note
|
|
24
|
-
AmeAppTools->AmeCliReloader: saveState(qrCodeConfig)
|
|
25
|
-
AmeCliReloader->ShareApi: saveState(qrCodeConfig)
|
|
26
|
-
AmeCliReloader<--ShareApi: qrCodeConfigId
|
|
27
|
-
AmeAppTools<--AmeCliReloader: qrCodeConfigId
|
|
28
|
-
AmeAppTools->AmeAppTools: showQrCode(workspaceUrl, qrCodeConfigId)
|
|
29
|
-
Developer->SuperApp: readQrCode()
|
|
30
|
-
SuperApp->SuperApp: extractQrCodeConfigId(shareApiUrl)
|
|
31
|
-
note over SuperApp
|
|
32
|
-
Obtém o id do qrcode (no share-api) da url
|
|
33
|
-
/workspace/share/<qrCodeConfigId>?environment=[dev|hml|prd]
|
|
34
|
-
end note
|
|
35
|
-
SuperApp->AmeCliReloader: getMiniAppData(qrCodeConfigId)
|
|
36
|
-
AmeCliReloader->ShareApi: getState(qrCodeConfigId)
|
|
37
|
-
AmeCliReloader<--ShareApi: qrCodeConfig
|
|
38
|
-
AmeCliReloader->AmeCliReloader: createMiniAppData(qrCodeConfig)
|
|
39
|
-
SuperApp<--AmeCliReloader: miniAppData
|
|
40
|
-
' SuperApp->SuperApp: replaceHost(miniAppData.bootstrapUrl)
|
|
41
|
-
' note left
|
|
42
|
-
' Troca o host do ambiente definido na CLI
|
|
43
|
-
' pelo host do ambiente definido no flavor.
|
|
44
|
-
' end note
|
|
45
|
-
SuperApp->MiniAppManager: findBySlug(miniAppData.slug)
|
|
46
|
-
SuperApp<--MiniAppManager: miniapp do envronment configurado no flavor do qual serao lidas as permissions
|
|
47
|
-
SuperApp->AmeCliReloader: openWorkspace(miniAppData.bootstrapUrl) // host definido na cli
|
|
48
|
-
AmeCliReloader-->SuperApp: home page
|
|
49
|
-
@enduml
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Easy SIM usa captura automática e deposito
|
|
53
|
-
Doações só captura automática
|
|
54
|
-
Delivery só deposito automático
|
|
55
|
-
|
|
56
|
-
PUT https://api.dev.amedigital.com/api/wallet/user/payments/{id}/cancel
|
|
57
|
-
|
|
58
|
-
PUT https://api.dev.amedigital.com/api/wallet/user/payments/{id}/capture
|
package/v1.5.0.md
DELETED