Comparing version 0.8.5 to 0.8.6
@@ -86,3 +86,3 @@ "use strict"; | ||
], | ||
da: ["d - get duration of all activities", " d [d, w, m]"], | ||
da: ["da - get duration of all activities", " d [d, w, m]"], | ||
v: "v - get status", | ||
@@ -216,3 +216,26 @@ s: "s - toggle timer", | ||
d: (socket, request) => __awaiter(void 0, void 0, void 0, function* () { | ||
const activity = (request === null || request === void 0 ? void 0 : request.args[0]) || timerObj.currentActivity || undefined; | ||
const resp = yield model_1.default.getActivities({ | ||
socket, | ||
selectProperty: "title", | ||
}); | ||
if (resp.err) { | ||
socket.write(JSON.stringify({ | ||
err: true, | ||
data: "db err - listing activities durations", | ||
})); | ||
return; | ||
} | ||
const activities = resp.data; | ||
const duration = (request === null || request === void 0 ? void 0 : request.args[0]) || "d"; | ||
const activity = (request === null || request === void 0 ? void 0 : request.args[1]) || timerObj.currentActivity || undefined; | ||
const activityExists = activities.some((activityItem) => { | ||
return activityItem.title == activity; | ||
}); | ||
if (!activityExists) { | ||
socket.write(JSON.stringify({ | ||
err: true, | ||
data: `activity ${activity} does not exist`, | ||
})); | ||
return; | ||
} | ||
let message = ""; | ||
@@ -226,7 +249,7 @@ if (activity) { | ||
socket, | ||
activity: request.args[1], | ||
duration: request.args[0], | ||
activity, | ||
duration, | ||
}); | ||
// console.log(resp.data) | ||
message = `${activity}: ${utils_1.default.secToTime(resp.data)}`; | ||
message = `${activity}: ${resp.data}`; | ||
} | ||
@@ -233,0 +256,0 @@ else if (!request.args[0] || |
{ | ||
"name": "clockify", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"description": "A time tracker to make sure that you really spent the time you think you spent working, studying, etc.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43340
1044