@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.
package/lib/commands/create.js
CHANGED
package/lib/commands/rerun.js
CHANGED
|
@@ -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', []))
|
package/lib/constants/package.js
CHANGED
|
@@ -164,18 +164,21 @@ const nodeYarnScripts = {
|
|
|
164
164
|
test: 'yarn audit --groups dependencies && yarn unit',
|
|
165
165
|
};
|
|
166
166
|
|
|
167
|
-
const
|
|
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
|
-
|
|
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: {
|
|
195
|
+
eslintConfig: {
|
|
196
|
+
root: true,
|
|
197
|
+
extends: '@corva/eslint-config-node',
|
|
198
|
+
},
|
|
193
199
|
};
|
|
194
200
|
|
|
195
201
|
const nodeYarnPackage = {
|
package/lib/flows/lib/api.js
CHANGED
|
@@ -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
|
|