@corva/create-app 0.64.0-1 → 0.64.0-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.
@@ -296,6 +296,7 @@ const addTsConfigs = (root, manifest, runtime) => {
296
296
  compilerOptions: {
297
297
  inlineSourceMap: true,
298
298
  strict: false,
299
+ outDir: 'dist',
299
300
  },
300
301
  },
301
302
  WRITE_TO_JSON_OPTS,
@@ -9,6 +9,7 @@ import { appVersion } from '../options/app-version.js';
9
9
  import { envOption } from '../options/env.js';
10
10
  import { originalCwdOption } from '../options/original-cwd.js';
11
11
  import { silentOption } from '../options/silent.js';
12
+ import { cacheOption } from '../options/cache.js';
12
13
 
13
14
  export const rerunCommand = new Command('rerun')
14
15
  .description('Rerun app')
@@ -16,6 +17,7 @@ export const rerunCommand = new Command('rerun')
16
17
  .addOption(apiKeyOption)
17
18
  .addOption(envOption)
18
19
  .addOption(silentOption)
20
+ .addOption(cacheOption)
19
21
  .addOption(appVersion)
20
22
  .addOption(new Option('--assets [assets...]', 'Assets IDs list', []).conflicts('companyId'))
21
23
  .addOption(new Option('--company-id [number]', 'Company ID', []))
@@ -0,0 +1,5 @@
1
+ export const DELETE_CACHE_BEHAVIOR = 'delete';
2
+
3
+ export const OVERRIDE_CACHE_BEHAVIOR = 'override';
4
+
5
+ export const KEEP_CACHE_BEHAVIOR = 'keep';
@@ -164,18 +164,21 @@ const nodeYarnScripts = {
164
164
  test: 'yarn audit --groups dependencies && yarn unit',
165
165
  };
166
166
 
167
- const nodeTsScripts = {
168
- ...nodeNpmScripts,
167
+ const commonTsScripts = {
169
168
  'build': 'tsc -p tsconfig.build.json',
169
+ 'postbuild': 'cp manifest.json dist/manifest.json',
170
170
  'lint': 'eslint --ext .ts .',
171
171
  'lint:fix': 'eslint --ext .ts --fix .',
172
172
  };
173
173
 
174
+ const nodeTsScripts = {
175
+ ...nodeNpmScripts,
176
+ ...commonTsScripts,
177
+ };
178
+
174
179
  const nodeTsYarnScripts = {
175
180
  ...nodeYarnScripts,
176
- 'build': 'tsc -p tsconfig.build.json',
177
- 'lint': 'eslint --ext .ts .',
178
- 'lint:fix': 'eslint --ext .ts --fix .',
181
+ ...commonTsScripts,
179
182
  };
180
183
 
181
184
  const nodeNpmPackage = {
@@ -189,7 +192,10 @@ const nodeNpmPackage = {
189
192
  setupFiles: ['dotenv/config'],
190
193
  },
191
194
  prettier: '@corva/eslint-config-node/prettier',
192
- eslintConfig: { extends: '@corva/eslint-config-node' },
195
+ eslintConfig: {
196
+ root: true,
197
+ extends: '@corva/eslint-config-node',
198
+ },
193
199
  };
194
200
 
195
201
  const nodeYarnPackage = {
@@ -1,6 +1,7 @@
1
1
  import debugFn from 'debug';
2
2
  import got from 'got';
3
3
  import { StepError } from './step-error.js';
4
+ import { OVERRIDE_CACHE_BEHAVIOR, DELETE_CACHE_BEHAVIOR } from './../../constants/cache.js';
4
5
 
5
6
  const debug = debugFn('cca:api');
6
7
 
@@ -176,14 +177,17 @@ export class Api {
176
177
  *
177
178
  * @returns {object}
178
179
  */
179
- async queueAppRun(appId, version, interval, wellId, appDatasetsNames, streamId, appConnectionId) {
180
+ async queueAppRun(appId, version, interval, wellId, appDatasetsNames, streamId, appConnectionId, cache) {
180
181
  const json = {
182
+ cache_behavior: cache ? OVERRIDE_CACHE_BEHAVIOR : DELETE_CACHE_BEHAVIOR,
183
+ cache_override: JSON.parse(cache),
181
184
  app_run: {
182
185
  app_stream_id: streamId,
183
186
  well_id: wellId,
184
187
  app_version: version,
185
188
  datasets: appDatasetsNames,
186
189
  settings: {
190
+ cache,
187
191
  end: 0,
188
192
  invokes: null,
189
193
  records_per_event: 300,
@@ -19,7 +19,10 @@ export const CREATE_TASK_STEP = {
19
19
  version,
20
20
  interval,
21
21
  corvaUrl,
22
+ options,
22
23
  }) => {
24
+ const { cache } = options;
25
+
23
26
  if (!assets.length) {
24
27
  logger.write(`\n\n${chalk.yellow.bold('There is no asset ID to create a new task')}`);
25
28
  }
@@ -48,7 +51,7 @@ export const CREATE_TASK_STEP = {
48
51
  for (const connectedApp of connectedApps) {
49
52
  const extraNotification = connectedApps.length > 1 ? `(connected app ID ${connectedApp.id})` : '';
50
53
  const result = await api
51
- .queueAppRun(app.id, version, interval, wellId, appDatasetsNames, stream.id, connectedApp.id)
54
+ .queueAppRun(app.id, version, interval, wellId, appDatasetsNames, stream.id, connectedApp.id, cache)
52
55
  .catch((e) => {
53
56
  console.log(e.response.body);
54
57
 
@@ -0,0 +1,3 @@
1
+ import { Option } from 'commander';
2
+
3
+ export const cacheOption = new Option('--cache [string]', 'cache object for rerunning app');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corva/create-app",
3
- "version": "0.64.0-1",
3
+ "version": "0.64.0-2",
4
4
  "private": false,
5
5
  "description": "Create an app to use it in CORVA.AI",
6
6
  "keywords": [