clocktopus 1.1.0 → 1.1.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/dist/index.js +8 -0
- package/dist/lib/jira.js +8 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -201,6 +201,9 @@ program
|
|
|
201
201
|
if (!getSessionState) {
|
|
202
202
|
throw new Error('getSessionState not found in module');
|
|
203
203
|
}
|
|
204
|
+
// Verify the native addon actually works before setting up polling
|
|
205
|
+
const initialState = getSessionState();
|
|
206
|
+
console.log(chalk.gray(`Initial session state: ${initialState}`));
|
|
204
207
|
pollInterval = setInterval(async () => {
|
|
205
208
|
try {
|
|
206
209
|
const state = getSessionState();
|
|
@@ -217,6 +220,11 @@ program
|
|
|
217
220
|
}
|
|
218
221
|
catch (error) {
|
|
219
222
|
console.error('Error polling session state:', error);
|
|
223
|
+
if (pollInterval) {
|
|
224
|
+
clearInterval(pollInterval);
|
|
225
|
+
pollInterval = null;
|
|
226
|
+
console.error(chalk.red('Display monitoring disabled due to repeated errors.'));
|
|
227
|
+
}
|
|
220
228
|
}
|
|
221
229
|
}, 3000);
|
|
222
230
|
}
|
package/dist/lib/jira.js
CHANGED
|
@@ -21,7 +21,10 @@ async function jiraApiRequest(endpoint, method, body) {
|
|
|
21
21
|
return response.data;
|
|
22
22
|
}
|
|
23
23
|
catch (error) {
|
|
24
|
-
if (error
|
|
24
|
+
if (axios.isAxiosError(error)) {
|
|
25
|
+
console.error('Error making Jira API request (OAuth):', error.message, error.response?.data);
|
|
26
|
+
}
|
|
27
|
+
else if (error instanceof Error) {
|
|
25
28
|
console.error('Error making Jira API request (OAuth):', error.message);
|
|
26
29
|
}
|
|
27
30
|
return null;
|
|
@@ -49,7 +52,10 @@ async function jiraApiRequest(endpoint, method, body) {
|
|
|
49
52
|
return response.data;
|
|
50
53
|
}
|
|
51
54
|
catch (error) {
|
|
52
|
-
if (error
|
|
55
|
+
if (axios.isAxiosError(error)) {
|
|
56
|
+
console.error('Error making Jira API request:', error.message, error.response?.data);
|
|
57
|
+
}
|
|
58
|
+
else if (error instanceof Error) {
|
|
53
59
|
console.error('Error making Jira API request:', error.message);
|
|
54
60
|
}
|
|
55
61
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clocktopus",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"build": "bunx tsc",
|
|
17
17
|
"prepublishOnly": "bunx tsc",
|
|
18
|
-
"postinstall": "
|
|
18
|
+
"postinstall": "node -e \"var p=require('path').dirname(require.resolve('macos-notification-state/package.json')); require('child_process').execSync('node-gyp rebuild',{cwd:p,stdio:'inherit'})\" 2>/dev/null; node -e \"var p=require('path').dirname(require.resolve('desktop-idle/package.json')); require('child_process').execSync('node-gyp rebuild',{cwd:p,stdio:'inherit'})\" 2>/dev/null; true",
|
|
19
19
|
"lint": "eslint . --ext .ts",
|
|
20
20
|
"clock": "bun dist/index.js",
|
|
21
21
|
"monitor": "bun dist/index.js monitor",
|