@beauraines/toggl-cli 0.10.14 → 0.10.16

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,20 @@
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
+ ### [0.10.16](https://github.com/beauraines/toggl-cli/compare/v0.10.15...v0.10.16) (2023-04-08)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **weekly report:** handles entries without project ([4668dbe](https://github.com/beauraines/toggl-cli/commit/4668dbe4d1cf77648209090035197691d7f3c508)), closes [#63](https://github.com/beauraines/toggl-cli/issues/63)
11
+
12
+ ### [0.10.15](https://github.com/beauraines/toggl-cli/compare/v0.10.14...v0.10.15) (2023-04-07)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **deps:** bump toggl-client from 3.2.0 to 3.3.0 ([#65](https://github.com/beauraines/toggl-cli/issues/65)) ([020de32](https://github.com/beauraines/toggl-cli/commit/020de3229d48466af935e5d42570c878427cbdfe))
18
+
5
19
  ### [0.10.14](https://github.com/beauraines/toggl-cli/compare/v0.10.13...v0.10.14) (2023-04-01)
6
20
 
7
21
 
@@ -1,5 +1,8 @@
1
1
  import Client from '../client.js'
2
2
  import { displayTimeEntry } from '../utils.js'
3
+ import debugClient from 'debug';
4
+
5
+ const debug = debugClient('toggl-cli-now');
3
6
 
4
7
  export const command = 'now'
5
8
  export const desc = 'Displays the current running time entry'
@@ -9,6 +12,7 @@ export const handler = async function (argv) {
9
12
  const client = new Client()
10
13
  const currentTimeEntry = await client.timeEntries.current()
11
14
  if (currentTimeEntry) {
15
+ debug(currentTimeEntry)
12
16
  await displayTimeEntry(currentTimeEntry)
13
17
  } else {
14
18
  console.log('There is no time entry running!')
package/cmds/edit.mjs CHANGED
@@ -9,7 +9,7 @@ import yargs from 'yargs'
9
9
  dayjs.extend(utc)
10
10
  dayjs.extend(timezone)
11
11
 
12
- const debug = debugClient('rtm-cli-edit');
12
+ const debug = debugClient('toggl-cli-edit');
13
13
 
14
14
  export const command = 'edit'
15
15
  // FIXME editing not working
package/cmds/weekly.mjs CHANGED
@@ -2,12 +2,16 @@ import Client from '../client.js'
2
2
  import chalk from 'chalk'
3
3
  import { getWorkspace, formatDuration, getProjectById } from '../utils.js'
4
4
  import dayjs from 'dayjs'
5
+ import debugClient from 'debug';
5
6
  import dur from 'dayjs/plugin/duration.js'
6
7
  import relativeTime from 'dayjs/plugin/relativeTime.js'
7
8
  import Table from 'cli-table3'
8
9
  dayjs.extend(relativeTime)
9
10
  dayjs.extend(dur)
10
11
 
12
+ const debug = debugClient('toggl-cli-week');
13
+
14
+
11
15
  export const command = 'week'
12
16
  // FIXME descriptions
13
17
  export const desc = 'Weekly project summary by day'
@@ -19,13 +23,14 @@ export const handler = async function (argv) {
19
23
 
20
24
  const params = { } // Leave this for future options, like rounding
21
25
  const weeklyReport = await client.reports.weekly(workspace.id, params)
22
-
26
+ debug(weeklyReport)
23
27
  const reportData = []
24
28
  const totals = [0, 0, 0, 0, 0, 0, 0] // ? Is there a better way to do this?
25
29
  for (const project of weeklyReport) {
26
30
  const currentProject = await getProjectById(workspace.id, project.project_id)
31
+ debug(currentProject)
27
32
  const row = {
28
- projectName: currentProject.name,
33
+ projectName: currentProject ? currentProject.name : 'No Project',
29
34
  Total: 0
30
35
  }
31
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/toggl-cli",
3
- "version": "0.10.14",
3
+ "version": "0.10.16",
4
4
  "description": "",
5
5
  "main": "cli.js",
6
6
  "bin": {