eitri-cli 1.15.0 → 1.16.0-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.
@@ -44,8 +44,10 @@ pipelines:
44
44
  caches:
45
45
  - node
46
46
  script:
47
+ - mkdir -p ~/.eitri/workspaces
48
+ - cp -r eitri-cli-v2/tests/fixtures/fake-workspace ~/.eitri/workspaces/workspace
47
49
  - cd eitri-cli-v2
48
- - cargo test -- --test-threads=1
50
+ - cargo test -- --test-threads=1 --nocapture
49
51
  - step: &macOSCrossCompile
50
52
  image:
51
53
  name: 343482176926.dkr.ecr.us-east-1.amazonaws.com/eitri-base-cli-pipeline:macos
@@ -35,6 +35,12 @@ log = "0.4.21"
35
35
  env_logger = "0.11.3"
36
36
  crossterm = "0.27.0"
37
37
  spinners = "4.1.1"
38
+ regex = "1.10.4"
39
+ walkdir = "2.5.0"
40
+ zip = "2.1.0"
41
+ sha1 = "0.10.6"
42
+ file-hashing = "0.1.2"
43
+ qr2term = "0.3.1"
38
44
 
39
45
  [dependencies.uuid]
40
46
  version = "1.8.0"
@@ -23,6 +23,10 @@ run_test_path = "/runes-foundry/run-test"
23
23
  share_path = "/foundry/share"
24
24
  clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
+ setup = "/v2/workspace/setup"
27
+ version = "/version"
28
+ upload_all = "/uploadAll"
29
+ file_upload = "/fileupload"
26
30
 
27
31
  [foundry.libs]
28
32
  update_libs_endpoint_version = "application/vnd.workspace.api.v2+json"
@@ -23,6 +23,11 @@ run_test_path = "/runes-foundry/run-test"
23
23
  share_path = "/runes-foundry/share"
24
24
  clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
+ setup = "/v2/workspace/setup"
27
+ version = "/version"
28
+ upload_all = "/uploadAll"
29
+ file_upload = "/fileupload"
30
+
26
31
 
27
32
  [foundry.libs]
28
33
  update_libs_endpoint_version = "application/vnd.workspace.api.v2+json"
@@ -23,6 +23,11 @@ run_test_path = "/foundry/run-test"
23
23
  share_path = "/foundry/share"
24
24
  clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
+ setup = "/v2/workspace/setup"
27
+ version = "/version"
28
+ upload_all = "/uploadAll"
29
+ file_upload = "/fileupload"
30
+
26
31
 
27
32
  [foundry.libs]
28
33
  update_libs_endpoint_version = "application/vnd.workspace.api.v2+json"
@@ -7,3 +7,7 @@ run_test_path = "/runes-foundry/run-test"
7
7
  share_path = "/runes-foundry/share"
8
8
  clean_path = "/sources"
9
9
  shared_tags_json_path = "/user/:workspaceId/index.json"
10
+ setup = "/v2/workspace/setup"
11
+ version = "/version"
12
+ upload_all = "/uploadAll"
13
+ file_upload = "/fileupload"
@@ -17,12 +17,17 @@ url = "https://api.eitri.tech/share-api/share"
17
17
 
18
18
  [foundry]
19
19
  url = "https://api.eitri.tech"
20
- base_path = "/runes-foundry"
21
- target_path = "/runes-foundry/targets"
22
- run_test_path = "/runes-foundry/run-test"
20
+ base_path = "/foundry"
21
+ target_path = "/foundry/targets"
22
+ run_test_path = "/foundry/run-test"
23
23
  share_path = "/foundry/share"
24
24
  clean_path = "/sources"
25
25
  shared_tags_json_path = "/user/:workspaceId/index.json"
26
+ setup = "/v2/workspace/setup"
27
+ version = "/version"
28
+ upload_all = "/uploadAll"
29
+ file_upload = "/fileupload"
30
+
26
31
 
27
32
  [foundry.libs]
28
33
  update_libs_endpoint_version = "application/vnd.workspace.api.v2+json"
@@ -3,6 +3,10 @@
3
3
 
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
+ export interface StartArguments {
7
+ shared?: boolean
8
+ verbose?: boolean
9
+ }
6
10
  export interface EitriLibsArguments {
7
11
  bifrost?: boolean
8
12
  luminus?: boolean
@@ -11,6 +15,7 @@ export function publish(environment: string, message: string): Promise<void>
11
15
  export function runTest(userJwt: string, userWorkspaceId: string, testPath: string): Promise<void>
12
16
  export function eitriLibs(eitriLibsArgs: EitriLibsArguments): Promise<void>
13
17
  export function doctor(): Promise<void>
18
+ export function start(args: StartArguments): Promise<void>
14
19
  export namespace app {
15
20
  export function start(): Promise<void>
16
21
  export function appLogs(): Promise<void>
@@ -295,11 +295,12 @@ if (!nativeBinding) {
295
295
  throw new Error(`Failed to load native binding`)
296
296
  }
297
297
 
298
- const { publish, runTest, eitriLibs, doctor, app, workspace } = nativeBinding
298
+ const { publish, runTest, eitriLibs, doctor, start, app, workspace } = nativeBinding
299
299
 
300
300
  module.exports.publish = publish
301
301
  module.exports.runTest = runTest
302
302
  module.exports.eitriLibs = eitriLibs
303
303
  module.exports.doctor = doctor
304
+ module.exports.start = start
304
305
  module.exports.app = app
305
306
  module.exports.workspace = workspace
package/index.js CHANGED
@@ -80,12 +80,24 @@ const run = async () => {
80
80
  "-e, --emulator <platform>",
81
81
  "Abre o Eitri-App no emulador, desde que seja definido qual plataforma será aberto, android ou ios."
82
82
  )
83
- .option("-sh, --shared", "Executa o Eitri-App no modo compartilhável.");
83
+ .option("-sh, --shared", "Executa o Eitri-App no modo compartilhável.")
84
84
 
85
85
  startProgram.action((cmdObj) => {
86
+ if (process.env.FT_START_V2 === "true") {
87
+ require('./eitri-cli-v2/eitri-cli-v2.linux-x64-gnu.node').start(cmdObj);
88
+ return;
89
+ }
86
90
  require("./src/cmd/start")(cmdObj);
87
91
  });
88
92
 
93
+ program
94
+ .command('test-initialization-params <initializationParams>')
95
+ .option("-v, --verbose", "Exibe mais logs")
96
+ .description('Define parâmetros na query string para inicializar o Eitri-App. Exemplo: stringChave1=stringValor1&stringChave2=stringValor2...')
97
+ .action((initializationParams, cmdObj) => {
98
+ require('./src/cmd/test-initialization-params')(initializationParams, cmdObj)
99
+ })
100
+
89
101
  program
90
102
  .command("push-version")
91
103
  .description(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eitri-cli",
3
- "version": "1.15.0",
3
+ "version": "1.16.0-beta.1",
4
4
  "description": "Command Line Interface to make \"Eitri-App\" with code and fire.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -377,9 +377,9 @@ class Workspace {
377
377
  return bootstrapBaseUrl;
378
378
  }
379
379
 
380
- async getNewWorkspaceURL(args, setupConfig) {
380
+ async getNewWorkspaceURL(args, setupConfig, eitriAppConf) {
381
381
  const qrCodeConfig = await this.getQrCodeConfig(args, setupConfig);
382
- const stateData = await this.saveShareState(qrCodeConfig);
382
+ const stateData = await this.saveShareState(qrCodeConfig, eitriAppConf);
383
383
  const stateId = stateData.id;
384
384
  const miniAppUrl = `${this.qrCodeUrl}/${stateId}`;
385
385
  return {
@@ -391,11 +391,16 @@ class Workspace {
391
391
  };
392
392
  }
393
393
 
394
- async saveShareState(qrCodeConfig) {
394
+ async saveShareState(qrCodeConfig, eitriAppConf) {
395
395
  const createWorkspaceStateUrl = `${this.serverUrl}/${this.basePath}/share`;
396
396
  const requestBody = {
397
397
  id: uuidv4(),
398
- state: qrCodeConfig,
398
+ state: {
399
+ ...qrCodeConfig,
400
+ eitriAppId: eitriAppConf?.id || "",
401
+ organizationId: eitriAppConf?.organizationId || "",
402
+ applicationId: eitriAppConf?.applicationId || "",
403
+ },
399
404
  };
400
405
  const response = await this.http.post(
401
406
  createWorkspaceStateUrl,
@@ -19,9 +19,11 @@ function QRCodeStarter(
19
19
  this.setupConfig = setupConfig;
20
20
 
21
21
  this.startServer = async function () {
22
+ const eitriAppConf = this.workspace._miniConf;
22
23
  const workspaceURLConfig = await this.workspace.getNewWorkspaceURL(
23
24
  this.args,
24
- this.setupConfig
25
+ this.setupConfig,
26
+ eitriAppConf
25
27
  );
26
28
  const fullUrl = workspaceURLConfig.miniAppUrl
27
29
  if (this.args.verbose) {
@@ -46,7 +46,7 @@ function WebAppStarter(args, trackingService, watcher, workspace, targetConfig )
46
46
  const libsInfoForGA = this.args.libsInfoForGA
47
47
  TrackService.track(miniConf, this.trackingService, libsInfoForGA)
48
48
 
49
- const {miniAppConf} = await this.workspace.getNewWorkspaceURL(this.args, this.targetConfig)
49
+ const {miniAppConf} = await this.workspace.getNewWorkspaceURL(this.args, this.targetConfig, miniConf)
50
50
  const { slug } = miniConf
51
51
 
52
52
  if(this.args.emulator){