@corva/create-app 0.46.0-rc.0 → 0.46.0

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.
@@ -48,7 +48,6 @@ export class Api {
48
48
  .json();
49
49
 
50
50
  const app = data.find((app) => app.attributes.app_key === appKey);
51
-
52
51
  if (!app) {
53
52
  throw new Error(`App with key - ${appKey}, not exist`);
54
53
  }
@@ -300,7 +299,6 @@ export class Api {
300
299
  console.log(`v2/apps/${appId}/packages/${id}`, {
301
300
  json: { package: { status: 'published' } },
302
301
  });
303
-
304
302
  const { data } = await this.#api
305
303
  .patch(`v2/apps/${appId}/packages/${id}`, {
306
304
  json: { package: { status: 'published' } },
@@ -324,7 +322,6 @@ export class Api {
324
322
  */
325
323
  async getAppPackages(appId) {
326
324
  const { data } = await this.#api.get(`v2/apps/${appId}/packages`).json();
327
-
328
325
  return data;
329
326
  }
330
327
 
@@ -91,7 +91,6 @@ export class Notification {
91
91
  */
92
92
  getStreamLink(title, streamId) {
93
93
  const streamUrl = `${this.#prefixUrl}/config/streams/${streamId}`;
94
-
95
94
  return this._createLink(title, streamUrl);
96
95
  }
97
96
 
@@ -107,7 +106,6 @@ export class Notification {
107
106
  */
108
107
  printStreamLink(title, streamId) {
109
108
  const link = this.getStreamLink(title, streamId);
110
-
111
109
  this.print(link);
112
110
  }
113
111
 
@@ -123,7 +121,6 @@ export class Notification {
123
121
  */
124
122
  getAssetLink(title, assetId) {
125
123
  const assetUrl = `${this.#prefixUrl}/assets/${assetId}`;
126
-
127
124
  return this._createLink(title, assetUrl);
128
125
  }
129
126
 
@@ -65,7 +65,6 @@ const getAssetsListWithPrompt = (assets, notification) => {
65
65
  const mapAssetsStreamsData = (assets, streamsData) => {
66
66
  return assets.map((asset) => {
67
67
  const currentStreams = streamsData.filter((stream) => stream.asset_id === parseInt(asset.id));
68
-
69
68
  return {
70
69
  assetId: asset.id,
71
70
  assetName: asset.attributes.name,
@@ -104,7 +103,6 @@ const getAssetsStreamsWithPrompt = async (mappedAssetsStreamsData, appId, notifi
104
103
 
105
104
  if (streamsWithoutCurrentApp.length === 1) {
106
105
  mappedData.selectedStreams = streamsWithoutCurrentApp;
107
-
108
106
  continue;
109
107
  }
110
108
 
@@ -9,7 +9,6 @@ import { Notification } from '../../lib/notification.js';
9
9
  async function getVarsFromDotEnv({ dirName }) {
10
10
  try {
11
11
  const envFile = await fs.readFile(resolve(dirName, '.env'));
12
-
13
12
  return dotenv.parse(envFile);
14
13
  } catch (error) {
15
14
  return {};
@@ -45,7 +45,6 @@ export const CREATE_TASK_STEP = {
45
45
  .queueAppRun(app.id, version, interval, wellId, appDatasetsNames, streamId)
46
46
  .catch((e) => {
47
47
  console.log(e.response.body);
48
-
49
48
  throw e;
50
49
  });
51
50
 
@@ -33,7 +33,6 @@ export const GET_APP_VERSION_TASK_STEP = {
33
33
  */
34
34
  const getAppVersion = async (appId, optionAppVersion, api) => {
35
35
  logger.write('\n Checking app versions...');
36
-
37
36
  const appPackages = await api.getAppPackages(appId);
38
37
 
39
38
  if (!appPackages.length) {
@@ -69,7 +69,6 @@ export const PREPARE_DATA_TASK_STEP = {
69
69
  */
70
70
  const promptAreYouSure = async () => {
71
71
  logger.log('\n');
72
-
73
72
  const answers = await inquirer.prompt([
74
73
  {
75
74
  message:
@@ -83,7 +82,6 @@ const promptAreYouSure = async () => {
83
82
  default: false,
84
83
  },
85
84
  ]);
86
-
87
85
  return answers.option;
88
86
  };
89
87
 
@@ -104,7 +104,6 @@ const getWellWithPrompt = async (wells, api) => {
104
104
  const [well] = choices;
105
105
 
106
106
  logger.write(`\n\n${chalk.black.underline.bold(`Process well - ${chalk.green(well.name)}`)}`);
107
-
108
107
  return well.value;
109
108
  }
110
109
 
@@ -144,7 +143,6 @@ const prepareWellAndStreamData = async (assets, api, manifest) => {
144
143
 
145
144
  const wells = await api.getWellByAssetId(assetId);
146
145
  const well = await getWellWithPrompt(wells, api);
147
-
148
146
  mappedAssetsToWells.set(well.attributes.asset_id, well);
149
147
 
150
148
  logger.write('\n Loading streams...');
@@ -166,7 +164,6 @@ const prepareWellAndStreamData = async (assets, api, manifest) => {
166
164
  assetsToDelete.push(assetId);
167
165
 
168
166
  if (mappedAssetsToWells.has(assetId)) mappedAssetsToWells.delete(assetId);
169
-
170
167
  if (mappedAssetsToStreams.has(assetId)) mappedAssetsToStreams.delete(assetId);
171
168
  }
172
169
  }
@@ -16,7 +16,6 @@ export function isInGitRepository(appPath) {
16
16
  return true;
17
17
  } catch (e) {
18
18
  debug(e);
19
-
20
19
  return false;
21
20
  }
22
21
  }
@@ -33,12 +32,10 @@ export function tryGitInit(appPath) {
33
32
 
34
33
  execSync('git init', { stdio: 'ignore', cwd: appPath });
35
34
  logger.log('Initialized git repo in app');
36
-
37
35
  return true;
38
36
  } catch (e) {
39
37
  debug(e);
40
38
  console.warn('Git repo not initialized');
41
-
42
39
  return false;
43
40
  }
44
41
  }
@@ -51,7 +48,6 @@ export function tryGitCommit(appPath) {
51
48
  cwd: appPath,
52
49
  });
53
50
  logger.log('Added first git commit');
54
-
55
51
  return true;
56
52
  } catch (e) {
57
53
  // We couldn't commit in already initialized git repo,
@@ -82,7 +78,6 @@ export function shouldUseYarn(appPath) {
82
78
  return true;
83
79
  } catch (e) {
84
80
  debug(e);
85
-
86
81
  return false;
87
82
  }
88
83
  }
package/lib/main.js CHANGED
@@ -618,4 +618,4 @@ async function helpCommands(manifest, { packageManager: displayedCommand }) {
618
618
  logger.log(chalk.cyan(` ${displayedCommand} ${useYarn ? '' : 'run '}release`));
619
619
  logger.log(' Uploads the app ZIP to Corva');
620
620
  logger.log();
621
- }
621
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.46.0-rc.0",
3
+ "version": "0.46.0",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [
@@ -0,0 +1 @@
1
+ module.exports = { extends: '@corva/eslint-config-node' };
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"
@@ -0,0 +1 @@
1
+ module.exports = { extends: '@corva/eslint-config-node' };
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"
@@ -0,0 +1 @@
1
+ module.exports = { extends: '@corva/eslint-config-node' };
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"
@@ -0,0 +1 @@
1
+ "@corva/eslint-config-node/prettier"