@beauraines/toggl-cli 0.10.6 → 0.10.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.
- package/.eslintrc.json +1 -0
- package/CHANGELOG.md +12 -0
- package/cmds/edit.mjs +5 -4
- package/package.json +2 -1
- package/utils.js +1 -1
package/.eslintrc.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.7](https://github.com/beauraines/toggl-cli/compare/v0.10.6...v0.10.7) (2023-03-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* updates app name sent with API requests ([9cf9a2b](https://github.com/beauraines/toggl-cli/commit/9cf9a2b4f6c1e638e2e3d8e251d0f15469627181))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* can edit time entries ([36cd1aa](https://github.com/beauraines/toggl-cli/commit/36cd1aa7519becda6abddee0e4e3fad37730822e))
|
|
16
|
+
|
|
5
17
|
### [0.10.6](https://github.com/beauraines/toggl-cli/compare/v0.10.5...v0.10.6) (2023-03-12)
|
|
6
18
|
|
|
7
19
|
|
package/cmds/edit.mjs
CHANGED
|
@@ -9,13 +9,14 @@ dayjs.extend(timezone)
|
|
|
9
9
|
|
|
10
10
|
export const command = 'edit'
|
|
11
11
|
// FIXME editing not working
|
|
12
|
-
export const desc =
|
|
12
|
+
export const desc = `Edits the current running time entry. Only updating the time is supported `+
|
|
13
|
+
`and the time must be parsable by dayjs, e.g. 4:50PM or '12:00 AM'.`
|
|
13
14
|
|
|
14
15
|
export const builder = {
|
|
15
16
|
d: { alias: ['description'], describe: 'Time entry name', type: 'string:' },
|
|
16
17
|
p: { alias: ['projectId', 'project'], describe: 'The case insensitive project name or project id.', type: 'string', demandOption: false },
|
|
17
|
-
s: { alias: ['start', 'startTime'], describe: 'The
|
|
18
|
-
e: { alias: ['end', 'endTime'], describe: 'The
|
|
18
|
+
s: { alias: ['start', 'startTime'], describe: 'The start time for the task, e.g. 13:00 12:45AM.', type: 'string', demandOption: false },
|
|
19
|
+
e: { alias: ['end', 'endTime'], describe: 'The end time for the task, e.g. 13:00 12:45AM.', type: 'string', demandOption: false }
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const handler = async function (argv) {
|
|
@@ -59,8 +60,8 @@ export const handler = async function (argv) {
|
|
|
59
60
|
project ? params.project_id = +project.id : undefined
|
|
60
61
|
startTime ? params.start = startTime.toISOString() : undefined
|
|
61
62
|
endTime ? params.stop = endTime.toISOString() : undefined
|
|
62
|
-
endTime ? params.duration = endTime.diff(startTime, 'seconds') : undefined
|
|
63
63
|
argv.description ? params.description = argv.description : undefined
|
|
64
|
+
debug(params)
|
|
64
65
|
const timeEntry = await client.timeEntries.update(currentTimeEntry.id, params)
|
|
65
66
|
await displayTimeEntry(timeEntry)
|
|
66
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beauraines/toggl-cli",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"dayjs": "^1.11.6",
|
|
34
|
+
"debug": "^4.3.4",
|
|
34
35
|
"dotenv": "^16.0.3",
|
|
35
36
|
"open": "^8.4.0",
|
|
36
37
|
"toggl-client": "^3.1.1",
|
package/utils.js
CHANGED
|
@@ -93,7 +93,7 @@ export const convertUtcTime = function (dateTime) {
|
|
|
93
93
|
return dayjs(dateTime).tz(tz).format('YYYY-MM-DD HH:mm')
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export const appName = 'toggl-cli
|
|
96
|
+
export const appName = '@beauraines/toggl-cli'
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Displays a time entry on the console
|