@trawlme/cli 1.8.0 → 1.9.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.
- package/dist/commands/scraps.js +5 -5
- package/package.json +1 -1
package/dist/commands/scraps.js
CHANGED
|
@@ -98,14 +98,14 @@ scraps
|
|
|
98
98
|
.requiredOption('-t, --title <title>', 'Scrap title')
|
|
99
99
|
.option('-u, --url <url>', 'Target URL')
|
|
100
100
|
.option('-r, --request <request>', 'Request/query')
|
|
101
|
-
.option('-
|
|
101
|
+
.option('-d, --description <text>', 'Scrap description')
|
|
102
102
|
.action(async (opts) => {
|
|
103
103
|
const spinner = ora('Creating scrap…').start();
|
|
104
104
|
const data = await api.post('/api/scraps', {
|
|
105
105
|
title: opts.title,
|
|
106
106
|
...(opts.url && { url: opts.url }),
|
|
107
107
|
request: opts.request || '',
|
|
108
|
-
|
|
108
|
+
...(opts.description !== undefined && { description: opts.description }),
|
|
109
109
|
});
|
|
110
110
|
spinner.succeed(`Scrap created: ${chalk.bold(data._id)}`);
|
|
111
111
|
console.log(chalk.dim(` Title: ${data.title}`));
|
|
@@ -117,7 +117,7 @@ scraps
|
|
|
117
117
|
.option('-t, --title <title>', 'New title')
|
|
118
118
|
.option('-u, --url <url>', 'New target URL')
|
|
119
119
|
.option('-r, --request <request>', 'New request')
|
|
120
|
-
.option('-
|
|
120
|
+
.option('-d, --description <text>', 'New description')
|
|
121
121
|
.option('--cron <expression>', 'Cron expression (empty string to disable)')
|
|
122
122
|
.option('--no-cron', 'Disable cron (set to null)')
|
|
123
123
|
.option('--alert <email>', 'Failure alert email (empty string to clear)')
|
|
@@ -133,8 +133,8 @@ scraps
|
|
|
133
133
|
body.url = opts.url;
|
|
134
134
|
if (opts.request !== undefined)
|
|
135
135
|
body.request = opts.request;
|
|
136
|
-
if (opts.
|
|
137
|
-
body.
|
|
136
|
+
if (opts.description !== undefined)
|
|
137
|
+
body.description = opts.description;
|
|
138
138
|
if (opts.cron === false)
|
|
139
139
|
body.cron = null;
|
|
140
140
|
else if (typeof opts.cron === 'string')
|