@codejeet/oadm 0.0.6 → 0.0.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +9 -2
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -64,8 +64,9 @@ program
64
64
  program
65
65
  .command('inbox')
66
66
  .option('--unread', 'Only unread', false)
67
- .option('--sent', 'Show sent messages (outbox)', false)
68
- .option('--all', 'Show both received and sent', false)
67
+ .option('--received', 'Show received messages only (inbox)', false)
68
+ .option('--sent', 'Show sent messages only (outbox)', false)
69
+ .option('--all', 'Show both received and sent (default)', false)
69
70
  .option('--since <timestamp>', 'Only messages since timestamp (ISO 8601 or unix)', '')
70
71
  .option('--limit <count>', 'Max messages to return (cap 200)', '')
71
72
  .option('--json', 'JSON output', false)
@@ -76,9 +77,15 @@ program
76
77
  throw new Error('not_logged_in');
77
78
  if (opts.sent && opts.all)
78
79
  throw new Error('conflicting_flags_sent_all');
80
+ if (opts.sent && opts.received)
81
+ throw new Error('conflicting_flags_sent_received');
82
+ if (opts.all && opts.received)
83
+ throw new Error('conflicting_flags_all_received');
79
84
  const q = new URLSearchParams();
80
85
  if (opts.unread)
81
86
  q.set('unread', '1');
87
+ if (opts.received)
88
+ q.set('received', '1');
82
89
  if (opts.sent)
83
90
  q.set('sent', '1');
84
91
  if (opts.all)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codejeet/oadm",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "oadm": "dist/cli.js"