@corva/create-app 0.64.0-0 → 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/README.md +1 -1
- package/lib/commands/create.js +1 -0
- package/lib/commands/release.js +1 -1
- package/lib/commands/rerun.js +2 -0
- package/lib/constants/cache.js +5 -0
- package/lib/constants/package.js +12 -6
- package/lib/flows/lib/api.js +6 -2
- package/lib/flows/steps/rerun/create-task.js +4 -1
- package/lib/options/cache.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -176,7 +176,7 @@ Options:
|
|
|
176
176
|
--env [string] Environment to use (choices: "qa", "staging", "production", default: "qa")
|
|
177
177
|
--api-key [string] Pre generated API key for authorization during app upload
|
|
178
178
|
--notes [string] Add custom notes to published app
|
|
179
|
-
--label [string] Put a label on the release (choices: "BETA", "
|
|
179
|
+
--label [string] Put a label on the release (choices: "DEV", "BETA", "PROD")
|
|
180
180
|
--remove-on-fail [boolean] Remove release if it fails during deployment (default: false)
|
|
181
181
|
--silent [boolean] Only log result of the operation (default: false)
|
|
182
182
|
--remove-on-success App package (.zip) will not be deleted after upload (default: true)
|
package/lib/commands/create.js
CHANGED
package/lib/commands/release.js
CHANGED
|
@@ -22,7 +22,7 @@ export const releaseCommand = new Command('release')
|
|
|
22
22
|
.addOption(apiKeyOption)
|
|
23
23
|
.addOption(originalCwdOption)
|
|
24
24
|
.addOption(new Option('--notes [string]', 'Add custom notes to published app'))
|
|
25
|
-
.addOption(new Option('--label [string]', 'Put a label on the release').choices(['BETA', 'PROD']))
|
|
25
|
+
.addOption(new Option('--label [string]', 'Put a label on the release').choices(['DEV', 'BETA', 'PROD']))
|
|
26
26
|
.addOption(new Option('--remove-on-fail [boolean]', 'Remove release if it fails during deployment').default(false))
|
|
27
27
|
.addOption(
|
|
28
28
|
new Option('--remove-on-success [boolean]', 'App package (.zip) will not be deleted after upload').default(true),
|
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,
|
|
@@ -360,7 +364,7 @@ export class Api {
|
|
|
360
364
|
/**
|
|
361
365
|
* @param {string} appId
|
|
362
366
|
* @param {string} id
|
|
363
|
-
* @param {'BETA' | 'PROD'} label
|
|
367
|
+
* @param {'DEV' | 'BETA' | 'PROD'} label
|
|
364
368
|
*
|
|
365
369
|
* @returns { Promise<{id: number, status: string}>}
|
|
366
370
|
*/
|
|
@@ -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
|
|