@beauraines/rtm-cli 1.7.2 → 1.8.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.8.1](https://github.com/beauraines/rtm-cli/compare/v1.8.0...v1.8.1) (2023-03-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * ensures build command does not purge gitkeep ([feda117](https://github.com/beauraines/rtm-cli/commit/feda117e8abe32d7d3e25645f6d7adb8baffa6a9))
11
+ * updates eslint and pkg ([0eab5ed](https://github.com/beauraines/rtm-cli/commit/0eab5edd0581865af562a28f7e31b8ee8ebe7f67))
12
+ * updates to latest archiver ([bbb9ccb](https://github.com/beauraines/rtm-cli/commit/bbb9ccb215b6a729f0eea737eee76ab52568606c))
13
+ * updates to latest open package ([1f5f9e3](https://github.com/beauraines/rtm-cli/commit/1f5f9e39eee07712e8adb95e0388dd97d5c13876))
14
+ * updates to v4 date-format ([ceaa7c0](https://github.com/beauraines/rtm-cli/commit/ceaa7c051a041d8a1ed8eedb423b37f9caf806f2))
15
+
16
+ ## [1.8.0](https://github.com/beauraines/rtm-cli/compare/v1.7.3...v1.8.0) (2023-03-12)
17
+
18
+
19
+ ### Features
20
+
21
+ * Add ability to set/update start time ([#32](https://github.com/beauraines/rtm-cli/issues/32)) ([814064f](https://github.com/beauraines/rtm-cli/commit/814064fa7c75fed621c84fd06e022140df7577aa)), closes [beauraines/rtm-cli#16](https://github.com/beauraines/rtm-cli/issues/16)
22
+
23
+ ### [1.7.3](https://github.com/beauraines/rtm-cli/compare/v1.7.2...v1.7.3) (2023-03-12)
24
+
5
25
  ### [1.7.2](https://github.com/beauraines/rtm-cli/compare/v1.7.1...v1.7.2) (2023-03-12)
6
26
 
7
27
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Remember The Milk Command Line Interface
2
2
  ========================================
3
3
 
4
- **node module:** [rtm-cli](https://www.npmjs.com/package/rtm-cli)<br />
4
+ **node module:** [rtm-cli](https://www.npmjs.com/package/@beauraines/rtm-cli)<br />
5
5
  **GitHub repo:** [beauraines/rtm-cli](https://github.com/beauraines/rtm-cli)
6
6
 
7
7
  ---
@@ -14,7 +14,7 @@ manager.
14
14
 
15
15
  This is a fork of [dwaring87/rtm-cli](https://github.com/dwaring87/rtm-cli) so that I can maintain, modernize and add features. Your contributions are welcome!
16
16
 
17
- This fork and [beauraines/rtm-api](https://github.com/beauraines/rtm-api) include
17
+ This fork and [beauraines/rtm-api](https://github.com/beauraines/rtm-api) includes
18
18
 
19
19
  1. performance improvements
20
20
  2. rewriting to use Promises
@@ -91,6 +91,7 @@ The main usage of the program:
91
91
  renameList|mvl [oldName] [newName] Rename a List
92
92
  reset Reset cached task indices
93
93
  setUrl|su [index] [url] Set the URL of a Task
94
+ start [index] [start...] Set the Start Date of a Task
94
95
  tags|t Display all tags
95
96
  task [indices...] Display the Task details
96
97
  uncomp|unc [indices...] Mark one or more Tasks as not complete
package/build.js CHANGED
@@ -26,7 +26,7 @@ function clean() {
26
26
  console.log();
27
27
  console.log("CLEANING...");
28
28
  let files = fs.readdirSync(binPath);
29
- for ( let file of files ) {
29
+ for ( let file of files.filter(x=>x!= '.gitkeep') ) {
30
30
  fs.unlinkSync(path.normalize(binPath + '/' + file));
31
31
  }
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/rtm-cli",
3
- "version": "1.7.2",
3
+ "version": "1.8.1",
4
4
  "description": "RTM CLI",
5
5
  "keywords": [
6
6
  "rtm",
@@ -36,14 +36,15 @@
36
36
  },
37
37
  "homepage": "https://github.com/beauraines/rtm-cli#readme",
38
38
  "dependencies": {
39
+ "@beauraines/rtm-api": "^1.6.0",
39
40
  "chalk": "^4.0.0",
40
- "@beauraines/rtm-api": "^1.5.0",
41
41
  "cli-table3": "^0.6.3",
42
42
  "commander": "^2.11.0",
43
43
  "copy-paste": "^1.3.0",
44
+ "dateformat": "^4.0.0",
45
+ "debug": "^4.3.4",
44
46
  "deepmerge": "^4.0.0",
45
- "dateformat": "^3.0.2",
46
- "opn": "^5.4.0",
47
+ "open": "^8.4.2",
47
48
  "ora": "^5.0.0",
48
49
  "prompt-sync": "^4.2.0",
49
50
  "should-release": "^1.2.0",
@@ -51,7 +52,7 @@
51
52
  "window-size": "^1.1.0"
52
53
  },
53
54
  "devDependencies": {
54
- "archiver": "^2.1.0",
55
+ "archiver": "^5.3.1",
55
56
  "eslint": "^8.34.0",
56
57
  "eslint-plugin-jest": "^27.2.1",
57
58
  "jest": "^29.4.3",
package/src/cmd/notes.js CHANGED
@@ -6,6 +6,7 @@ const { prompt } = require('../utils/prompt.js');
6
6
  const finish = require('../utils/finish.js');
7
7
  const filter = require('../utils/filter')
8
8
  const { USER_CONFIG } = require('../utils/config.js');
9
+ const debug = require('debug')('rtm-cli-notes');
9
10
 
10
11
 
11
12
  let NOTES = [];
@@ -64,6 +65,7 @@ function _process(index, count=1, max=1) {
64
65
 
65
66
  // Get Task
66
67
  let filterString = filter("hasNotes:true")
68
+ // TODO this should be switched to rtmIndexFetchTask(index,filterString) like in url.js
67
69
  user.tasks.getTask(index, filterString, function(err, task) {
68
70
  if ( err ) {
69
71
  if ( err.code === -3 ) {
@@ -75,6 +77,7 @@ function _process(index, count=1, max=1) {
75
77
  }
76
78
 
77
79
  if ( task ) {
80
+ debug(task)
78
81
  NOTES.push({
79
82
  index: index,
80
83
  name: task.name,
@@ -106,6 +109,7 @@ function _processFinished(count, max) {
106
109
  let styles = config.get().styles;
107
110
 
108
111
  // Print NOTES
112
+ debug(JSON.stringify(NOTES))
109
113
  for ( let i = 0; i < NOTES.length; i++ ) {
110
114
  log.style(_pad(NOTES[i].index , NOTES.length), styles.index);
111
115
  log.style(' ');
@@ -0,0 +1,82 @@
1
+ 'use strict';
2
+
3
+ const log = require('../utils/log.js');
4
+ const config = require('../utils/config.js');
5
+ const { prompt } = require('../utils/prompt.js');
6
+
7
+ const finish = require('../utils/finish.js');
8
+
9
+
10
+ /**
11
+ * This command sets the Start Date for a Task
12
+ * @param args index due
13
+ * @param env
14
+ */
15
+ function action(args, env) {
16
+
17
+ // Prompt for Start Date
18
+ if ( args.length < 2 ) {
19
+ prompt('Task:', 'Start:', _promptFinished);
20
+ }
21
+
22
+ // Use provided args
23
+ else {
24
+ _process(args[0], args[1].join(' '));
25
+ }
26
+
27
+ }
28
+
29
+
30
+ /**
31
+ * Process the returned answers
32
+ * @private
33
+ */
34
+ function _promptFinished(answers) {
35
+ for ( let i = 0; i < answers.length; i++ ) {
36
+ let answer = answers[i];
37
+ _process(answer[0], answer[1], i+1, answers.length);
38
+ }
39
+ }
40
+
41
+
42
+ /**
43
+ * Process the request
44
+ * @private
45
+ */
46
+ function _process(task, due, count=1, max=1) {
47
+ log.spinner.start("Setting Start Date(s)...");
48
+ config.user(function(user) {
49
+
50
+ // Parse arguments
51
+ task = parseInt(task.trim());
52
+ due = due.trim();
53
+
54
+ // Set Start Date
55
+ user.tasks.setStartDate(task, due, function(err) {
56
+ if ( err ) {
57
+ log.spinner.error("Could not set Start Date for Task #" + task + " (" + err.msg + ")");
58
+ }
59
+ _processFinished(count, max);
60
+ });
61
+
62
+ });
63
+ }
64
+
65
+ /**
66
+ * Request Callback
67
+ * @private
68
+ */
69
+ function _processFinished(count, max) {
70
+ log.spinner.start("Setting Start Date [" + count + "/" + max + "]...");
71
+ if ( count === max ) {
72
+ log.spinner.success("Task(s) Updated");
73
+ return finish();
74
+ }
75
+ }
76
+
77
+
78
+ module.exports = {
79
+ command: 'start [index] [start...]',
80
+ description: 'Set the Start Date of a Task',
81
+ action: action
82
+ };
package/src/cmd/task.js CHANGED
@@ -5,6 +5,7 @@ const config = require('../utils/config.js');
5
5
  const finish = require('../utils/finish.js');
6
6
  const filter = require('../utils/filter');
7
7
  const { indexPrompt } = require('../utils/prompt')
8
+ const debug = require('debug')('rtm-cli-task');
8
9
 
9
10
 
10
11
  let TASKS = [];
@@ -75,6 +76,7 @@ module.exports = {
75
76
  };
76
77
 
77
78
  function displayTask(taskDetails) {
79
+ debug(taskDetails)
78
80
  let index = taskDetails.index;
79
81
  // eslint-disable-next-line no-unused-vars
80
82
  const { _list, list_id, taskseries_id, task_id, _index, name, priority, start, due, completed, isRecurring, isSubtask, estimate, url, tags, notes ,...otherAttributes } = taskDetails.task;
package/src/cmd/url.js CHANGED
@@ -5,7 +5,7 @@ const config = require('../utils/config.js');
5
5
  const finish = require('../utils/finish.js');
6
6
  const filter = require('../utils/filter');
7
7
  const { indexPrompt } = require('../utils/prompt')
8
- const opn = require('opn');
8
+ const open = require('open');
9
9
 
10
10
 
11
11
  let URLS = [];
@@ -68,7 +68,7 @@ async function action(args, env) {
68
68
  // Open URL
69
69
  if ( OPEN ) {
70
70
  for ( let i = 0; i < URLS.length; i++ ) {
71
- opn(URLS[i].url, {wait: false})//.then(function() {});
71
+ open(URLS[i].url, {wait: false})//.then(function() {});
72
72
  }
73
73
  }
74
74