targetprocess-mcp-server 1.0.13-a → 1.0.14
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/build/index.js +24 -11
- package/build/tp.js +2 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -397,21 +397,34 @@ server.registerTool('get_bug_content', {
|
|
|
397
397
|
}],
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
};
|
|
400
|
+
let bugResult = {
|
|
401
|
+
name: bug.Name,
|
|
402
|
+
id: bug.Id,
|
|
403
|
+
description: '',
|
|
404
|
+
origin: ''
|
|
405
|
+
};
|
|
406
|
+
try {
|
|
407
|
+
const dom = new JSDOM(`<html><body><div id="content">${bug.Description}</div></body></html>`);
|
|
408
|
+
const descriptionText = dom.window.document.getElementById('content')?.textContent;
|
|
409
|
+
if (descriptionText) {
|
|
410
|
+
bugResult.description = descriptionText;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
catch (error) {
|
|
414
|
+
console.error("Error parsing bug description:", error);
|
|
415
|
+
console.error("Returning bug without description");
|
|
416
|
+
}
|
|
417
|
+
try {
|
|
418
|
+
bugResult.origin = bug.CustomFields?.find((field) => field?.Value === "Origin")?.Value;
|
|
419
|
+
}
|
|
420
|
+
catch (error) {
|
|
421
|
+
console.error("Error parsing bug origin:", error);
|
|
422
|
+
console.error("Returning bug without origin");
|
|
408
423
|
}
|
|
409
|
-
const dom = new JSDOM(`<html><body><div id="content">${description}</div></body></html>`);
|
|
410
|
-
const descriptionText = dom.window.document.getElementById('content')?.textContent;
|
|
411
424
|
return {
|
|
412
425
|
content: [{
|
|
413
426
|
type: 'text',
|
|
414
|
-
text: JSON.stringify(
|
|
427
|
+
text: JSON.stringify(bugResult)
|
|
415
428
|
}],
|
|
416
429
|
};
|
|
417
430
|
});
|
package/build/tp.js
CHANGED
|
@@ -12,7 +12,7 @@ export class TpClient {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
params(params) {
|
|
15
|
-
let _url = this.baseUrl + (params.apiVersion
|
|
15
|
+
let _url = this.baseUrl + (params.apiVersion || this.v1);
|
|
16
16
|
for (const [key, value] of Object.entries(params.pathParam)) {
|
|
17
17
|
_url += value ? `/${key}/${value}` : `/${key}`;
|
|
18
18
|
}
|
|
@@ -85,7 +85,7 @@ export class TpClient {
|
|
|
85
85
|
},
|
|
86
86
|
param: {
|
|
87
87
|
"format": "json",
|
|
88
|
-
}
|
|
88
|
+
},
|
|
89
89
|
});
|
|
90
90
|
return response;
|
|
91
91
|
}
|