@corva/create-app 0.38.0-rc.0 → 0.39.0-0-test-commit-42ee519

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.
@@ -8,7 +8,7 @@ const RELEASE = {
8
8
  createZipError: 'Could not create zip archive.',
9
9
  createZipSuccess: `Zip archive has been created ${SUCCESS_ICON}`,
10
10
  getAuthToken: 'Reading auth token...',
11
- getAuthTokenError: `Could not find auth token. For UI app please run ${chalk.cyan`yarn start`} and login to Corva to fetch it.`,
11
+ getAuthTokenError: `Could not find auth token or CORVA_API_KEY in .env file.\nFor UI app please run ${chalk.cyan`yarn start`} and login to Corva to fetch it or set CORVA_API_KEY in your .env file`,
12
12
  getAppKey: 'Reading app key...',
13
13
  getAppKeyError: "Could not find app key. Please make sure it's defined in manifest.json",
14
14
  uploadApp: 'Uploading app...',
@@ -14,15 +14,16 @@ const GET_RELEASE_CONFIG_STEP = {
14
14
 
15
15
  throw e;
16
16
  });
17
- const { CORVA_API_ENV, AUTH_TOKEN } = dotenv.parse(env);
17
+ const { CORVA_API_ENV, AUTH_TOKEN, CORVA_API_KEY } = dotenv.parse(env);
18
18
 
19
- if (!AUTH_TOKEN) {
19
+ if (!AUTH_TOKEN && !CORVA_API_KEY) {
20
20
  throw new StepError(RELEASE.getAuthTokenError);
21
21
  }
22
22
 
23
23
  return {
24
24
  CORVA_API_ENV: CORVA_API_ENV || 'production',
25
25
  AUTH_TOKEN,
26
+ CORVA_API_KEY,
26
27
  };
27
28
  },
28
29
  };
@@ -8,7 +8,7 @@ const { get } = require('lodash/fp');
8
8
 
9
9
  const UPLOAD_ZIP_TO_CORVA_STEP = {
10
10
  message: RELEASE.uploadApp,
11
- fn: async ({ zipFileName, appKey, CORVA_API_ENV, AUTH_TOKEN, dirName }) => {
11
+ fn: async ({ zipFileName, appKey, CORVA_API_ENV, AUTH_TOKEN, CORVA_API_KEY, dirName }) => {
12
12
  const form = new FormData();
13
13
 
14
14
  form.append('package', createReadStream(resolve(dirName, zipFileName)), 'archive.zip');
@@ -20,7 +20,10 @@ const UPLOAD_ZIP_TO_CORVA_STEP = {
20
20
 
21
21
  await axios
22
22
  .post(uploadURL, form, {
23
- headers: { ...form.getHeaders(), Authorization: `Bearer ${AUTH_TOKEN}` },
23
+ headers: {
24
+ ...form.getHeaders(),
25
+ Authorization: AUTH_TOKEN ? `Bearer ${AUTH_TOKEN}` : `API ${CORVA_API_KEY}`,
26
+ },
24
27
  })
25
28
  .catch((e) => {
26
29
  throw new StepError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.38.0-rc.0",
3
+ "version": "0.39.0-0-test-commit-42ee519",
4
4
  "private": false,
5
5
  "description": "Create app to use it in CORVA.AI",
6
6
  "keywords": [