eitri-cli 1.1.5-alpha.1 → 1.1.5-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/.husky/commit-msg +4 -0
- package/.releaserc.json +0 -4
- package/README.md +9 -10
- package/bitbucket-pipelines.yml +3 -3
- package/commitlint.config.js +6 -0
- package/config/dev.js +1 -1
- package/index.js +12 -61
- package/package.json +8 -6
- package/src/cmd/clean.js +11 -2
- package/src/cmd/create.js +17 -7
- package/src/cmd/invite.js +4 -4
- package/src/cmd/login.js +2 -2
- package/src/cmd/push-version.js +20 -11
- package/src/cmd/start.js +10 -1
- package/src/model/Payload.js +1 -1
- package/src/modules/vegvisir/VegvisirService.js +2 -2
- package/src/modules/vegvisir/cmd/use.js +1 -1
- package/src/service/MiniLog.js +1 -1
- package/src/service/QRCodeFactory.js +2 -2
- package/src/service/Server.js +2 -2
- package/src/service/Workspace.js +1 -1
- package/src/util/AboutTemplate.jsx +1 -1
- package/src/util/UserLocalCredential.js +4 -0
- package/src/util/error-messages/invite/invite-error-messages.js +1 -1
- package/src/util/template-utils.js +2 -2
- package/test/_fixtures/factory.js +1 -1
- package/test/_fixtures/src/views/AboutTemplate.jsx +1 -1
- package/test/cmd/create.test.js +1 -1
- package/CHANGELOG.md +0 -10
- package/publisher.js +0 -59
- 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
CHANGED
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-App 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,14 +1,14 @@
|
|
|
1
1
|
image: node:18
|
|
2
2
|
pipelines:
|
|
3
3
|
branches:
|
|
4
|
-
'{
|
|
4
|
+
'{beta,master}':
|
|
5
5
|
- step:
|
|
6
|
-
name: "Generation of a new version:
|
|
6
|
+
name: "Generation of a new version: beta or stable."
|
|
7
7
|
caches:
|
|
8
8
|
- node
|
|
9
9
|
script:
|
|
10
10
|
- echo 'Start release'
|
|
11
|
-
- echo 'If there is a new version, it will be automatically published on NPM according to the channel/branch (
|
|
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
12
|
- yarn
|
|
13
13
|
- yarn run release
|
|
14
14
|
- RELEASE_VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
|
package/config/dev.js
CHANGED
package/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const run = async () => {
|
|
|
20
20
|
// Continuando como antes...
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
program.option("-v, --version", "Mostra a
|
|
23
|
+
program.option("-v, --version", "Mostra a versão da CLI").action(() => {
|
|
24
24
|
const { version } = require("./src/cmd/version");
|
|
25
25
|
version();
|
|
26
26
|
});
|
|
@@ -36,16 +36,12 @@ const run = async () => {
|
|
|
36
36
|
|
|
37
37
|
program
|
|
38
38
|
.command("create <project-name>")
|
|
39
|
-
.description(`Cria um projeto com um
|
|
39
|
+
.description(`Cria um projeto com um Eitri-App totalmente funcional.`)
|
|
40
40
|
.option(
|
|
41
41
|
"--yes",
|
|
42
|
-
"Aceita os valores default para nome titulo e
|
|
42
|
+
"Aceita os valores default para nome titulo e organização"
|
|
43
43
|
)
|
|
44
|
-
.option(
|
|
45
|
-
"--template <template-name>",
|
|
46
|
-
"Define um boilerplate para a criação do projeto"
|
|
47
|
-
)
|
|
48
|
-
.option("--target", "Define o application de execução do eitri app")
|
|
44
|
+
.option("--application", "Define o application de execução do Eitri-App")
|
|
49
45
|
.option("-v, --verbose", "Exibe mais logs")
|
|
50
46
|
.action((projectName, cmdObj) => {
|
|
51
47
|
require("./src/cmd/create")(projectName, cmdObj);
|
|
@@ -53,78 +49,33 @@ const run = async () => {
|
|
|
53
49
|
|
|
54
50
|
let startProgram = program
|
|
55
51
|
.command("start")
|
|
56
|
-
.description("Inicia o seu
|
|
57
|
-
.option(
|
|
58
|
-
"-A, --upload-all",
|
|
59
|
-
"(Obsoleto) Sobe todos os arquivos. O mesmo funcionamento é garantido usando-o ou não"
|
|
60
|
-
)
|
|
52
|
+
.description("Inicia o seu Eitri-App em um workspace online")
|
|
61
53
|
.option("-v, --verbose", "Exibe mais logs")
|
|
62
|
-
.option(
|
|
63
|
-
"-N, --new-qrcode",
|
|
64
|
-
"(Obsoleto) Novo qrcode. O mesmo funcionamento é garantido usando-o ou não"
|
|
65
|
-
)
|
|
66
|
-
.option("-Q, --old-qrcode", "QR Code legado")
|
|
67
54
|
.option("-f, --force", "Força o start")
|
|
68
55
|
.option("-S, --show-deeplink", "Exibe o deep link do workspace")
|
|
69
|
-
.option(
|
|
70
|
-
"-z, --zip",
|
|
71
|
-
"(Obsoleto) Envia os arquivos do projeto compactados para o compilador. O mesmo funcionamento é garantido usando-o ou não"
|
|
72
|
-
)
|
|
73
|
-
.option(
|
|
74
|
-
"-U, --unzip",
|
|
75
|
-
"Faz o upload descompactado, arquivo a arquivo, para o compilador"
|
|
76
|
-
)
|
|
77
|
-
.option(
|
|
56
|
+
.option(
|
|
78
57
|
"-P, --qr-printer <qrPrinter>",
|
|
79
|
-
"Indica qual programa imprimirá o QR Code. Se omitido,
|
|
80
|
-
)
|
|
81
|
-
.option("-e, --emulator", "Simula o ambiente de exibição do Mini App.")
|
|
82
|
-
.option(
|
|
83
|
-
"-c, --target-config <config>",
|
|
84
|
-
"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.",
|
|
85
|
-
"default"
|
|
86
|
-
)
|
|
87
|
-
.option(
|
|
88
|
-
"-l, --list-target-configs",
|
|
89
|
-
"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"
|
|
90
59
|
);
|
|
91
60
|
|
|
92
61
|
startProgram.action((cmdObj) => {
|
|
93
|
-
if (cmdObj.zip) {
|
|
94
|
-
console.log(
|
|
95
|
-
"Uso de -z ou --zip é redundante. O eitri-app-tools já envia para o compilador os arquivos compactados."
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (cmdObj.newQrcode) {
|
|
100
|
-
console.log(
|
|
101
|
-
"Uso de -N ou --new-qrcode é redundante. O eitri-app-tools já otimiza o Qr Code."
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (cmdObj.uploadAll) {
|
|
106
|
-
console.log(
|
|
107
|
-
"Uso de -A ou --upload-all é redundante. O eitri-app-tools já faz o envio em lote dos arquivos do projeto"
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
62
|
require("./src/cmd/start")(cmdObj);
|
|
112
63
|
});
|
|
113
64
|
|
|
114
65
|
program
|
|
115
66
|
.command("push-version")
|
|
116
67
|
.description(
|
|
117
|
-
"Cria e envia
|
|
68
|
+
"Cria e envia uma versão do Eitri-App para o Console, possibilitando também publicar em um ambiente."
|
|
118
69
|
)
|
|
119
70
|
.option("-l, --local", "Aponta para o servidor local")
|
|
120
71
|
.option("-v, --verbose", "Exibe mais logs")
|
|
121
72
|
.option(
|
|
122
73
|
"-c, --components",
|
|
123
|
-
"Publica o
|
|
74
|
+
"Publica o Eitri-App como biblioteca de components"
|
|
124
75
|
)
|
|
125
76
|
.option(
|
|
126
77
|
"-m, --message <revision-message>",
|
|
127
|
-
"Adiciona comentários
|
|
78
|
+
"Adiciona comentários na versão"
|
|
128
79
|
)
|
|
129
80
|
.option("-y, --yes", "Aceita automaticamente as respostas do prompt.")
|
|
130
81
|
.action((cmdObj) => {
|
|
@@ -134,7 +85,7 @@ const run = async () => {
|
|
|
134
85
|
program
|
|
135
86
|
.command('clean')
|
|
136
87
|
.description(
|
|
137
|
-
'Realiza a limpeza do workspace remoto do desenvolvedor. Útil quando há mal fucionamento na compilação em nuvem do
|
|
88
|
+
'Realiza a limpeza do workspace remoto do desenvolvedor. Útil quando há mal fucionamento na compilação em nuvem do Eitri-App.'
|
|
138
89
|
)
|
|
139
90
|
.option('-v, --verbose', 'Exibe mais logs')
|
|
140
91
|
.action(cmdObj => {
|
|
@@ -143,7 +94,7 @@ const run = async () => {
|
|
|
143
94
|
|
|
144
95
|
program
|
|
145
96
|
.command("self-update")
|
|
146
|
-
.description("Desinstala a
|
|
97
|
+
.description("Desinstala a versão antiga e instala a mais nova")
|
|
147
98
|
.action(() => {
|
|
148
99
|
require("child_process").execSync(
|
|
149
100
|
"npm uninstall -g eitri-cli && npm i eitri-cli -g",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eitri-cli",
|
|
3
|
-
"version": "1.1.5-
|
|
4
|
-
"description": "Command Line Interface to make \"
|
|
3
|
+
"version": "1.1.5-beta.2",
|
|
4
|
+
"description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"eitri": "index-eitri.js"
|
|
@@ -63,17 +63,19 @@
|
|
|
63
63
|
"uuid": "^7.0.2"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
+
"@commitlint/cli": "^17.7.2",
|
|
67
|
+
"@commitlint/config-conventional": "^17.7.0",
|
|
66
68
|
"@faker-js/faker": "^7.6.0",
|
|
69
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
70
|
+
"@semantic-release/git": "^10.0.1",
|
|
67
71
|
"docsify-cli": "^4.4.4",
|
|
68
72
|
"eslint": "^6.7.2",
|
|
69
73
|
"eslint-config-google": "^0.14.0",
|
|
70
|
-
"husky": "^
|
|
74
|
+
"husky": "^8.0.3",
|
|
71
75
|
"jest": "^24.9.0",
|
|
72
76
|
"lint-staged": "^9.5.0",
|
|
73
77
|
"nock": "^13.3.0",
|
|
74
|
-
"semantic-release": "^22.0.5"
|
|
75
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
76
|
-
"@semantic-release/git": "^10.0.1"
|
|
78
|
+
"semantic-release": "^22.0.5"
|
|
77
79
|
},
|
|
78
80
|
"resolutions": {
|
|
79
81
|
"lodash": "4.17.21",
|
package/src/cmd/clean.js
CHANGED
|
@@ -5,12 +5,21 @@ const config = require('../service/ConfigService')
|
|
|
5
5
|
const TargetService = require('../service/TargetService')
|
|
6
6
|
const inquirer = require('inquirer')
|
|
7
7
|
const TrackingEitriAnalytics = require('../service/TrackingEitriAnalytics')
|
|
8
|
+
const UserLocalCredential = require('../util/UserLocalCredential')
|
|
8
9
|
|
|
9
10
|
const blindGuardian = workspace.blindGuardian
|
|
10
11
|
const trackingService = new TrackingService(blindGuardian)
|
|
11
12
|
const targetService = new TargetService(workspace)
|
|
12
13
|
|
|
13
14
|
module.exports = async function clean(cmdObj) {
|
|
15
|
+
try {
|
|
16
|
+
UserLocalCredential.checkForCredentials()
|
|
17
|
+
} catch (error) {
|
|
18
|
+
const errorMessage = cmdObj?.verbose ? error : error?.message
|
|
19
|
+
console.error("\n", errorMessage, "\n")
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
try {
|
|
15
24
|
await validator.assertCommandNotRunning('clean')
|
|
16
25
|
|
|
@@ -69,7 +78,7 @@ module.exports = async function clean(cmdObj) {
|
|
|
69
78
|
|
|
70
79
|
if(httpStatus === 403) {
|
|
71
80
|
await tryExitWithFriendlyMessage()
|
|
72
|
-
printError('Acesso negado! Confira se
|
|
81
|
+
printError('Acesso negado! Confira se você está registrado como desenvolvedor deste Eitri-App.')
|
|
73
82
|
await exit()
|
|
74
83
|
}
|
|
75
84
|
if(httpStatus === 500) {
|
|
@@ -91,7 +100,7 @@ module.exports = async function clean(cmdObj) {
|
|
|
91
100
|
|
|
92
101
|
function printAvailableWebhooks(webhooks) {
|
|
93
102
|
if(!webhooks || webhooks.length === 0) return
|
|
94
|
-
console.log('\nWebhooks do
|
|
103
|
+
console.log('\nWebhooks do Eitri-App.')
|
|
95
104
|
console.table(webhooks)
|
|
96
105
|
}
|
|
97
106
|
|
package/src/cmd/create.js
CHANGED
|
@@ -16,6 +16,7 @@ const Target = require("../model/Target");
|
|
|
16
16
|
const EitriAppManager = require("../service/EitriAppManager");
|
|
17
17
|
const WoodCoffee = require("../service/factories/WoodCoffeeFactory");
|
|
18
18
|
const TrackingEitriAnalytics = require("../service/TrackingEitriAnalytics");
|
|
19
|
+
const UserLocalCredential = require("../util/UserLocalCredential");
|
|
19
20
|
|
|
20
21
|
const blindGuardian = new BlindGuardian();
|
|
21
22
|
const hashFolder = new HashFolder();
|
|
@@ -51,8 +52,17 @@ const slug = (inpt) => {
|
|
|
51
52
|
|
|
52
53
|
// eslint-disable-next-line no-unused-vars
|
|
53
54
|
module.exports = async function create(projectName, cmdObj) {
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
UserLocalCredential.checkForCredentials()
|
|
58
|
+
} catch (error) {
|
|
59
|
+
const errorMessage = cmdObj?.verbose ? error : error?.message
|
|
60
|
+
console.error("\n", errorMessage, "\n")
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
54
64
|
console.log(
|
|
55
|
-
"\x1b[34mVamos criar o seu
|
|
65
|
+
"\x1b[34mVamos criar o seu Eitri-App. Para isso basta responder algumas perguntas:\x1b[0m"
|
|
56
66
|
);
|
|
57
67
|
|
|
58
68
|
try {
|
|
@@ -102,7 +112,7 @@ async function askClientApplication() {
|
|
|
102
112
|
name: "accepted",
|
|
103
113
|
type: "rawlist",
|
|
104
114
|
message:
|
|
105
|
-
"Selecione a aplicação para qual destina-se seu
|
|
115
|
+
"Selecione a aplicação para qual destina-se seu Eitri-App:",
|
|
106
116
|
choices: cliOptions.map(createLabel),
|
|
107
117
|
},
|
|
108
118
|
]);
|
|
@@ -186,7 +196,7 @@ async function askProjMetadata(clientApplication, cmdObj, projectName) {
|
|
|
186
196
|
} catch (err) {
|
|
187
197
|
if (cmdObj.verbose) {
|
|
188
198
|
console.error(
|
|
189
|
-
"Houve uma falha durante a criação do
|
|
199
|
+
"Houve uma falha durante a criação do Eitri-App",
|
|
190
200
|
err
|
|
191
201
|
);
|
|
192
202
|
}
|
|
@@ -220,7 +230,7 @@ function createQuestions(projectName) {
|
|
|
220
230
|
{
|
|
221
231
|
type: "input",
|
|
222
232
|
name: "name",
|
|
223
|
-
message: "Digite um nome legível para seu
|
|
233
|
+
message: "Digite um nome legível para seu Eitri-App",
|
|
224
234
|
validate: nameOrTitle,
|
|
225
235
|
default: () => {
|
|
226
236
|
return projectName;
|
|
@@ -239,7 +249,7 @@ function createQuestions(projectName) {
|
|
|
239
249
|
type: "input",
|
|
240
250
|
name: "slug",
|
|
241
251
|
message:
|
|
242
|
-
"Digite um nome único para seu
|
|
252
|
+
"Digite um nome único para seu Eitri-App. Não pode conter espaços",
|
|
243
253
|
default: (currentAnswers) => {
|
|
244
254
|
return slugify(currentAnswers.name).toLowerCase();
|
|
245
255
|
},
|
|
@@ -253,7 +263,7 @@ async function askSlug(projectName) {
|
|
|
253
263
|
{
|
|
254
264
|
type: "input",
|
|
255
265
|
name: "slug",
|
|
256
|
-
message: "Outro nome único para o
|
|
266
|
+
message: "Outro nome único para o Eitri-App:",
|
|
257
267
|
validate: slug,
|
|
258
268
|
default: () => {
|
|
259
269
|
return slugify(projectName).toLowerCase();
|
|
@@ -268,7 +278,7 @@ async function askName(projectName) {
|
|
|
268
278
|
{
|
|
269
279
|
type: "input",
|
|
270
280
|
name: "name",
|
|
271
|
-
message: "Outro nome para o
|
|
281
|
+
message: "Outro nome para o Eitri-App:",
|
|
272
282
|
validate: nameOrTitle,
|
|
273
283
|
default: () => {
|
|
274
284
|
return projectName;
|
package/src/cmd/invite.js
CHANGED
|
@@ -18,11 +18,11 @@ module.exports = async function invite(email, cmdObj) {
|
|
|
18
18
|
let invites = await inviteService.findAllBySlug(slug)
|
|
19
19
|
let invite = invites.find(i => i.email === email)
|
|
20
20
|
if (!invite) {
|
|
21
|
-
console.log(`Convite inexistente para ${email} do
|
|
21
|
+
console.log(`Convite inexistente para ${email} do Eitri-App ${slug}.`)
|
|
22
22
|
process.exit(1)
|
|
23
23
|
}
|
|
24
24
|
await inviteService.remove(invite)
|
|
25
|
-
console.log(`${email} removido com sucesso do
|
|
25
|
+
console.log(`${email} removido com sucesso do Eitri-App ${slug}.`)
|
|
26
26
|
} else if (cmdObj.list) {
|
|
27
27
|
let slug = workspace.getMiniConf().slug
|
|
28
28
|
let invites = await inviteService.findAllBySlug(slug)
|
|
@@ -37,7 +37,7 @@ module.exports = async function invite(email, cmdObj) {
|
|
|
37
37
|
}
|
|
38
38
|
console.log(`${invites.length} convites`)
|
|
39
39
|
const createLabel = (inv) => {
|
|
40
|
-
return `aceitar convite do
|
|
40
|
+
return `aceitar convite do Eitri-App "${inv.slug}" enviado por ${inv.inviterEmail || 'desconhecido'}`
|
|
41
41
|
}
|
|
42
42
|
let res = await inquirer.prompt([
|
|
43
43
|
{
|
|
@@ -49,7 +49,7 @@ module.exports = async function invite(email, cmdObj) {
|
|
|
49
49
|
])
|
|
50
50
|
let inviteToAccept = invites.find(inv => createLabel(inv) === res.accepted)
|
|
51
51
|
if (inviteToAccept) {
|
|
52
|
-
console.log(`Aceitando participar do
|
|
52
|
+
console.log(`Aceitando participar do Eitri-App ${inviteToAccept.slug}...`)
|
|
53
53
|
await inviteService.accept(inviteToAccept)
|
|
54
54
|
console.log(`Convite aceito! ${emoji.lib.clinking_glasses.char}`)
|
|
55
55
|
}
|
package/src/cmd/login.js
CHANGED
|
@@ -29,10 +29,10 @@ module.exports = async function login(args) {
|
|
|
29
29
|
open(urlAdminManagerCredentialWithParams)
|
|
30
30
|
portalOpenMessage = "Aberto em seu navegador padrão"
|
|
31
31
|
} catch (error) {
|
|
32
|
-
portalOpenMessage = "Não foi possível abrir automaticamente. Copie o link e cole em seu navegador para fazer o login na Eitri
|
|
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
|
-
portalOpenMessage = "Copie o link e cole em seu navegador para fazer o login na Eitri
|
|
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)
|
package/src/cmd/push-version.js
CHANGED
|
@@ -10,6 +10,7 @@ const inquirer = require('inquirer')
|
|
|
10
10
|
const TrackingEitriAnalytics = require('../service/TrackingEitriAnalytics')
|
|
11
11
|
const VegvisirService = require('../modules/vegvisir/VegvisirService')
|
|
12
12
|
const getWorkspace = require('../util/getWorkspace')
|
|
13
|
+
const UserLocalCredential = require('../util/UserLocalCredential')
|
|
13
14
|
|
|
14
15
|
const blindGuardian = workspace.blindGuardian
|
|
15
16
|
const trackingService = new TrackingService(blindGuardian)
|
|
@@ -17,6 +18,14 @@ const targetService = new TargetService(workspace)
|
|
|
17
18
|
const vegvisirService = new VegvisirService()
|
|
18
19
|
|
|
19
20
|
module.exports = async function pushVersion(cmdObj) {
|
|
21
|
+
try {
|
|
22
|
+
UserLocalCredential.checkForCredentials()
|
|
23
|
+
} catch (error) {
|
|
24
|
+
const errorMessage = cmdObj?.verbose ? error : error?.message
|
|
25
|
+
console.error("\n", errorMessage, "\n")
|
|
26
|
+
return
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
try {
|
|
21
30
|
await validator.assertPushVersionMessage(cmdObj.message)
|
|
22
31
|
await validator.assertCommandNotRunning('push-version')
|
|
@@ -45,19 +54,19 @@ module.exports = {
|
|
|
45
54
|
"name": "Minha Empresa"
|
|
46
55
|
},
|
|
47
56
|
|
|
48
|
-
// Nome do seu
|
|
49
|
-
"name": "Meu
|
|
57
|
+
// Nome do seu Eitri-App
|
|
58
|
+
"name": "Meu Eitri-App",
|
|
50
59
|
|
|
51
|
-
// Titulo do
|
|
52
|
-
"title": "Meu super
|
|
60
|
+
// Titulo do Eitri-App
|
|
61
|
+
"title": "Meu super Eitri-App",
|
|
53
62
|
|
|
54
63
|
// Chave para gerar a ordem/qrcode de pagamento (opcional)
|
|
55
64
|
"public-key": "",
|
|
56
65
|
|
|
57
|
-
// Identificador
|
|
66
|
+
// Identificador amigável para colocar em uma url
|
|
58
67
|
"slug": "com.eitri.loja",
|
|
59
68
|
|
|
60
|
-
//
|
|
69
|
+
// Versão do Eitri-App
|
|
61
70
|
"version": "1.0.0",
|
|
62
71
|
|
|
63
72
|
${await targetService.getAppConfExampleSnippet()}
|
|
@@ -85,14 +94,14 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
85
94
|
// await logPermissionsAndOpenPrompt(addedPermissions, removedPermissions, cmdObj)
|
|
86
95
|
// console.log(separator)
|
|
87
96
|
|
|
88
|
-
console.log('Preparando os arquivos do seu
|
|
97
|
+
console.log('Preparando os arquivos do seu Eitri-App')
|
|
89
98
|
|
|
90
99
|
await workspace.uploadAll()
|
|
91
100
|
const webhooks = workspace.getWebhooks()
|
|
92
101
|
printAvailableWebhooks(webhooks)
|
|
93
102
|
console.log('')
|
|
94
103
|
console.log(separator)
|
|
95
|
-
console.log('Gerando
|
|
104
|
+
console.log('Gerando Eitri-App')
|
|
96
105
|
|
|
97
106
|
const start = Date.now()
|
|
98
107
|
let pushVersionPromise = miniLog.awaitForPushVersion()
|
|
@@ -100,8 +109,8 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
100
109
|
await pushVersionPromise
|
|
101
110
|
console.log(separator)
|
|
102
111
|
console.log('\x1b[1m\x1b[32mSucesso!!\x1b[0m');
|
|
103
|
-
console.log(`\x1b[1mA versão [${miniConf.version}] do seu
|
|
104
|
-
console.log('\x1b[1mdisponível no Eitri Console
|
|
112
|
+
console.log(`\x1b[1mA versão [${miniConf.version}] do seu Eitri-App foi enviada e está\x1b[0m`);
|
|
113
|
+
console.log('\x1b[1mdisponível no Eitri Console\x1b[0m');
|
|
105
114
|
console.log(separator)
|
|
106
115
|
|
|
107
116
|
const organization = miniConf?.organization ? Object.keys(miniConf?.organization).length !== 0 ? miniConf?.organization : "-" : {
|
|
@@ -143,7 +152,7 @@ ${await targetService.getAppConfExampleSnippet()}
|
|
|
143
152
|
|
|
144
153
|
function printAvailableWebhooks(webhooks) {
|
|
145
154
|
if(!webhooks || webhooks.length === 0) return
|
|
146
|
-
console.log('\nWebhooks do
|
|
155
|
+
console.log('\nWebhooks do Eitri-App.')
|
|
147
156
|
console.table(webhooks)
|
|
148
157
|
}
|
|
149
158
|
|
package/src/cmd/start.js
CHANGED
|
@@ -13,6 +13,7 @@ const inquirer = require('inquirer')
|
|
|
13
13
|
const TrackingEitriAnalytics = require('../service/TrackingEitriAnalytics')
|
|
14
14
|
const VegvisirService = require('../modules/vegvisir/VegvisirService')
|
|
15
15
|
const getWorkspace = require('../util/getWorkspace')
|
|
16
|
+
const UserLocalCredential = require('../util/UserLocalCredential')
|
|
16
17
|
|
|
17
18
|
const blindGuardian = workspace.blindGuardian
|
|
18
19
|
const hashFolder = workspace.hashFolder
|
|
@@ -21,6 +22,14 @@ const watcher = new Watcher(workspace, hashFolder, trackingService)
|
|
|
21
22
|
const vegvisirService = new VegvisirService()
|
|
22
23
|
|
|
23
24
|
module.exports = async function start(args) {
|
|
25
|
+
try {
|
|
26
|
+
UserLocalCredential.checkForCredentials()
|
|
27
|
+
} catch (error) {
|
|
28
|
+
const errorMessage = args?.verbose ? error : error?.message
|
|
29
|
+
console.error("\n", errorMessage, "\n")
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
try {
|
|
25
34
|
if (!args.force) {
|
|
26
35
|
await validator.assertCommandNotRunning('start')
|
|
@@ -174,5 +183,5 @@ async function listTargetConfigs(target) {
|
|
|
174
183
|
]).then(input => input)
|
|
175
184
|
|
|
176
185
|
const config = availableConfigs.find(cfg => cfg.id === res.accepted)
|
|
177
|
-
console.log(`Utilize o comando --target-config ${config.id} para iniciar o
|
|
186
|
+
console.log(`Utilize o comando --target-config ${config.id} para iniciar o Eitri-App com a configuração desejada`)
|
|
178
187
|
}
|
package/src/model/Payload.js
CHANGED
|
@@ -31,7 +31,7 @@ module.exports = class VegvisirService {
|
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
|
-
console.error("Houve um erro inesperado ao listar workspaces");
|
|
34
|
+
console.error("Houve um erro inesperado ao listar workspaces: \n", error?.message);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -70,7 +70,7 @@ module.exports = class VegvisirService {
|
|
|
70
70
|
);
|
|
71
71
|
return process.exit(0)
|
|
72
72
|
}
|
|
73
|
-
console.error("
|
|
73
|
+
console.error("Ocorreu um erro inesperado ao listar workspaces", error?.message);
|
|
74
74
|
return process.exit(0)
|
|
75
75
|
}
|
|
76
76
|
console.error(error.message)
|
|
@@ -37,7 +37,7 @@ async function writeLocalWorkspaceConfig(selectedWorkspace) {
|
|
|
37
37
|
|
|
38
38
|
if (!existsSync(oldConfPath) && !existsSync(eitriAppConfPath)) {
|
|
39
39
|
console.error(
|
|
40
|
-
"Você só pode selecionar um workspace como local dentro de um projeto de
|
|
40
|
+
"Você só pode selecionar um workspace como local dentro de um projeto de Eitri-App"
|
|
41
41
|
);
|
|
42
42
|
return;
|
|
43
43
|
}
|
package/src/service/MiniLog.js
CHANGED
|
@@ -120,7 +120,7 @@ class MiniLog {
|
|
|
120
120
|
.join('\n')
|
|
121
121
|
console.log(chalk.cyan(msg))
|
|
122
122
|
} else {
|
|
123
|
-
// A propriedade userFriendlyMessage deve ser tratada pelo
|
|
123
|
+
// A propriedade userFriendlyMessage deve ser tratada pelo Eitri-App. Logaremos da forma como o Eitri-App nos fornecer o objeto.
|
|
124
124
|
if(!data.method) {
|
|
125
125
|
console.log(`\x1b[34meitri:\x1b[0m\x1b[97m${data.msg}\x1b[0m`);
|
|
126
126
|
} else {
|
|
@@ -19,9 +19,9 @@ class QRCodeFactory {
|
|
|
19
19
|
|
|
20
20
|
async create(data, eitriAppSlug = "") {
|
|
21
21
|
console.log('==================================================')
|
|
22
|
-
console.log('Utilize o QR-Code para iniciar o seu
|
|
22
|
+
console.log('Utilize o QR-Code para iniciar o seu Eitri-App')
|
|
23
23
|
console.log('É importante utilizar o leitor de QR-Code do')
|
|
24
|
-
console.log('aplicativo à qual destina-se o seu
|
|
24
|
+
console.log('aplicativo à qual destina-se o seu Eitri-App')
|
|
25
25
|
console.log('==================================================')
|
|
26
26
|
const qrCodeTempPath = await this.tempFile(eitriAppSlug)
|
|
27
27
|
await this.createQRCodeImage(qrCodeTempPath, data)
|
package/src/service/Server.js
CHANGED
|
@@ -98,7 +98,7 @@ class Server {
|
|
|
98
98
|
ameSuperAppWebConfig.url
|
|
99
99
|
)
|
|
100
100
|
data = data.replace('##IFRAME_SRC##', finalUrl)
|
|
101
|
-
//TODO configurar o slug do
|
|
101
|
+
//TODO configurar o slug do Eitri-App corrente
|
|
102
102
|
data = data.replace('##SLUG##', slug)
|
|
103
103
|
return res.send(data)
|
|
104
104
|
}
|
|
@@ -145,7 +145,7 @@ class Server {
|
|
|
145
145
|
'##AME_SUPER_APP_SRC##',
|
|
146
146
|
ameSuperAppWebConfig.url
|
|
147
147
|
)
|
|
148
|
-
//TODO configurar o slug do
|
|
148
|
+
//TODO configurar o slug do Eitri-App corrente
|
|
149
149
|
data = data.replace('##SLUG##', slug)
|
|
150
150
|
|
|
151
151
|
res.send(data)
|
package/src/service/Workspace.js
CHANGED
|
@@ -163,7 +163,7 @@ class Workspace {
|
|
|
163
163
|
);
|
|
164
164
|
if (!fs.existsSync(miniAppConfPath)) {
|
|
165
165
|
throw new Error(
|
|
166
|
-
"Por favor, verifique se você está dentro da pasta de um projeto
|
|
166
|
+
"Por favor, verifique se você está dentro da pasta de um projeto Eitri-App."
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
169
|
this._miniConf = require(miniAppConfPath);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<Spacing size="sm" />
|
|
5
5
|
<Subtitle fontSize="xs" textAlign="center" color="neutralcolor-darkest">Detalhes desta versão</Subtitle>
|
|
6
6
|
<View>
|
|
7
|
-
<Subtitle textAlign="center" fontSize="xxxs" color="neutralcolor-darkest">Este
|
|
7
|
+
<Subtitle textAlign="center" fontSize="xxxs" color="neutralcolor-darkest">Este Eitri-App foi desenvolvido utilizando as seguintes versões:</Subtitle>
|
|
8
8
|
<Spacing size="sm" />
|
|
9
9
|
<Paragraph textAlign="center">Versão da biblioteca de componentes: ###COMPONENTS_LIBRARY_VERSION_HIGHLIGHTER###</Paragraph>
|
|
10
10
|
<Spacing size="sm" />
|
|
@@ -4,7 +4,7 @@ module.exports = function inviteErrorMessages(status) {
|
|
|
4
4
|
switch (status) {
|
|
5
5
|
case 403:
|
|
6
6
|
message =
|
|
7
|
-
'Você precisa de permissão para enviar convites nesse
|
|
7
|
+
'Você precisa de permissão para enviar convites nesse Eitri-App'
|
|
8
8
|
break
|
|
9
9
|
default:
|
|
10
10
|
message = 'Ocorreu um erro'
|
|
@@ -10,8 +10,8 @@ module.exports = {
|
|
|
10
10
|
|
|
11
11
|
getTemplateDescription: function(){
|
|
12
12
|
return [
|
|
13
|
-
{name: 'serverless', description:'Gera um exemplo de um projeto
|
|
14
|
-
{name: 'persistere', description:'Gera um exemplo de um projeto
|
|
13
|
+
{name: 'serverless', description:'Gera um exemplo de um projeto Eitri-App, integrado com serverless backend'},
|
|
14
|
+
{name: 'persistere', description:'Gera um exemplo de um projeto Eitri-App, integrado com o persistere'}
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<Spacing size="sm" />
|
|
5
5
|
<Subtitle fontSize="xs" textAlign="center" color="neutralcolor-darkest">Detalhes desta versão</Subtitle>
|
|
6
6
|
<View>
|
|
7
|
-
<Subtitle textAlign="center" fontSize="xxxs" color="neutralcolor-darkest">Este
|
|
7
|
+
<Subtitle textAlign="center" fontSize="xxxs" color="neutralcolor-darkest">Este Eitri-App foi desenvolvido utilizando as seguintes versões:</Subtitle>
|
|
8
8
|
<Spacing size="sm" />
|
|
9
9
|
<Paragraph textAlign="center">Versão da biblioteca de componentes: ###COMPONENTS_LIBRARY_VERSION_HIGHLIGHTER###</Paragraph>
|
|
10
10
|
<Spacing size="sm" />
|
package/test/cmd/create.test.js
CHANGED
package/CHANGELOG.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
## [1.1.5-alpha.1](http://bitbucket.org/smartsolutionteam/eitri-cli/compare/v1.1.4...v1.1.5-alpha.1) (2023-10-04)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* Adicionado release/npm ao .releaserc ([15a7e7d](http://bitbucket.org/smartsolutionteam/eitri-cli/commits/15a7e7d2e0648d10cf3c6f409a81ef3fc00dd383))
|
|
7
|
-
* Alterada ordem de escrita ([eafbec7](http://bitbucket.org/smartsolutionteam/eitri-cli/commits/eafbec783aa5bc6f8fdb20ff35d2a343b411f2db))
|
|
8
|
-
* alterado log ([0ec103a](http://bitbucket.org/smartsolutionteam/eitri-cli/commits/0ec103a44311bfae3044d0816ec4d9cae07a78e9))
|
|
9
|
-
* Log da versão do process.env ([716b4f6](http://bitbucket.org/smartsolutionteam/eitri-cli/commits/716b4f6f41238f0a69f6ac587e8d5171c4051dcf))
|
|
10
|
-
* teste de log de versão em novo step ([27f715d](http://bitbucket.org/smartsolutionteam/eitri-cli/commits/27f715d2709484b4c33627413f2974bfa433e2d0))
|
package/publisher.js
DELETED
|
@@ -1,59 +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
|
-
|
|
10
|
-
if (err) {
|
|
11
|
-
console.error('Error:', err);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const _BRANCHS = {
|
|
16
|
-
MASTER: "master",
|
|
17
|
-
BETA: "beta",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const branch = process.env.BITBUCKET_BRANCH
|
|
21
|
-
console.log('Current branch on build: ', branch);
|
|
22
|
-
|
|
23
|
-
const allowedBranchs = [_BRANCHS.MASTER, _BRANCHS.BETA]
|
|
24
|
-
if(!allowedBranchs?.includes(branch)){
|
|
25
|
-
console.log(`${branch} is different from ${JSON.stringify(allowedBranchs)}. Skipping...`);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const packageJson = JSON.parse(data);
|
|
30
|
-
const localVersion = packageJson.version;
|
|
31
|
-
|
|
32
|
-
if (branch === _BRANCHS.BETA && !(/beta/.test(localVersion))) {
|
|
33
|
-
console.log(`${localVersion} version does not contain the "beta" suffix in the version name. Skipping...`);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const publishedVersions = JSON.parse(execSync('npm show ' + packageJson.name + ' versions --json').toString());
|
|
38
|
-
if (publishedVersions.includes(localVersion)) {
|
|
39
|
-
console.log('There is a published version identical to the one in package.json: ', localVersion);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
console.log('Previously unpublished version. Allowed version name for publishing: ', localVersion);
|
|
44
|
-
|
|
45
|
-
const commandSuffix = branch === _BRANCHS.BETA ? "--tag beta" : "";
|
|
46
|
-
|
|
47
|
-
exec('npm run build && npm publish ' + commandSuffix, (err, stdout, stderr) => {
|
|
48
|
-
if (err) {
|
|
49
|
-
// node couldn't execute the command
|
|
50
|
-
console.log('Error:', err);
|
|
51
|
-
process.exit(2);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// the *entire* stdout and stderr (buffered)
|
|
55
|
-
console.log(`stdout: ${stdout}`);
|
|
56
|
-
console.log(`stderr: ${stderr}`);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
@@ -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