@daghis/teamcity-mcp 1.9.3 → 1.9.5
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/.release-please-config.json +20 -0
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +54 -0
- package/dist/index.js +83 -32
- package/dist/index.js.map +3 -3
- package/eslint.config.cjs +182 -0
- package/package.json +7 -5
- package/server.json +51 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packages": {
|
|
3
|
+
".": {
|
|
4
|
+
"release-type": "node",
|
|
5
|
+
"release-as": "1.9.5",
|
|
6
|
+
"extra-files": [
|
|
7
|
+
{
|
|
8
|
+
"type": "json",
|
|
9
|
+
"path": "server.json",
|
|
10
|
+
"jsonpath": "$.version"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"type": "json",
|
|
14
|
+
"path": "server.json",
|
|
15
|
+
"jsonpath": "$.packages[0].version"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.2](https://github.com/Daghis/teamcity-mcp/compare/teamcity-mcp-v1.9.4...teamcity-mcp-v0.1.2) (2025-09-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add Codecov bundle analysis ([#28](https://github.com/Daghis/teamcity-mcp/issues/28)) ([87c3de8](https://github.com/Daghis/teamcity-mcp/commit/87c3de85af34bec5b071d82612d67ba4d5a52702))
|
|
9
|
+
* **publish:** automate mcp registry publishing ([#190](https://github.com/Daghis/teamcity-mcp/issues/190)) ([285b737](https://github.com/Daghis/teamcity-mcp/commit/285b737c5993332d8cf5e81e4db5be9864355701))
|
|
10
|
+
* **teamcity:** add runtime guards for manager responses ([#179](https://github.com/Daghis/teamcity-mcp/issues/179)) ([9d7eaef](https://github.com/Daghis/teamcity-mcp/commit/9d7eaef161e675246d317603df47f7f39407b7d8))
|
|
11
|
+
* **teamcity:** add streaming artifact downloads ([#161](https://github.com/Daghis/teamcity-mcp/issues/161)) ([b50b773](https://github.com/Daghis/teamcity-mcp/commit/b50b773ebee6f5cc85f4c53c98fef525e7098fe9)), closes [#151](https://github.com/Daghis/teamcity-mcp/issues/151)
|
|
12
|
+
* **teamcity:** add streaming artifact downloads ([#166](https://github.com/Daghis/teamcity-mcp/issues/166)) ([18830ed](https://github.com/Daghis/teamcity-mcp/commit/18830ed4805ad215518cc5a51640094adc35e31b)), closes [#151](https://github.com/Daghis/teamcity-mcp/issues/151)
|
|
13
|
+
* **tests:** add batched mcp tool execution ([#163](https://github.com/Daghis/teamcity-mcp/issues/163)) ([5f48060](https://github.com/Daghis/teamcity-mcp/commit/5f4806043b95686d5dac41a9d67515740b82a3f8)), closes [#162](https://github.com/Daghis/teamcity-mcp/issues/162)
|
|
14
|
+
* **tools:** add streaming mode to fetch_build_log ([#171](https://github.com/Daghis/teamcity-mcp/issues/171)) ([1abce69](https://github.com/Daghis/teamcity-mcp/commit/1abce69b7fa3866ac289501e2369d5d06d57d57f))
|
|
15
|
+
* **tools:** add VCS root property management tools + integration test ([#95](https://github.com/Daghis/teamcity-mcp/issues/95)) ([13bbe17](https://github.com/Daghis/teamcity-mcp/commit/13bbe178564a53564aad4fcdb99bb3f2e5db4cb8))
|
|
16
|
+
* **tools:** expose change and admin REST tools ([#112](https://github.com/Daghis/teamcity-mcp/issues/112)) ([e7f4e1e](https://github.com/Daghis/teamcity-mcp/commit/e7f4e1e74bb28572ffc3ee7a0fced6090c4f92ef))
|
|
17
|
+
* **tools:** support streaming artifacts in get_build_results ([#173](https://github.com/Daghis/teamcity-mcp/issues/173)) ([f95c5e4](https://github.com/Daghis/teamcity-mcp/commit/f95c5e4da9ffa80adc8b8f322c127a440c4524b5)), closes [#169](https://github.com/Daghis/teamcity-mcp/issues/169)
|
|
18
|
+
* **utils:** add TeamCity service message escaping ([#85](https://github.com/Daghis/teamcity-mcp/issues/85)) ([6ee3b72](https://github.com/Daghis/teamcity-mcp/commit/6ee3b72e4db065faa0e01c7046328e1d4e1375c8))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* authorize_agent uses authorizedInfo JSON endpoint (TeamCity 2025.07 compatibility) ([#83](https://github.com/Daghis/teamcity-mcp/issues/83)) ([198fd02](https://github.com/Daghis/teamcity-mcp/commit/198fd02ca8b6e89d83f87a1a94aafeadda593504)), closes [#78](https://github.com/Daghis/teamcity-mcp/issues/78)
|
|
24
|
+
* **cli:** improve npx execution; release 0.9.2 ([#61](https://github.com/Daghis/teamcity-mcp/issues/61)) ([42577c3](https://github.com/Daghis/teamcity-mcp/commit/42577c3ed78dd7e29f21f6c8138d96da49582892))
|
|
25
|
+
* **cli:** remove duplicate shebang in entrypoint; bump to 0.9.1 ([#59](https://github.com/Daghis/teamcity-mcp/issues/59)) ([740530d](https://github.com/Daghis/teamcity-mcp/commit/740530d7bfba6bc81a42f8057fd017a2f8cae14e))
|
|
26
|
+
* delete_parameter: correct endpoint + arg order ([#84](https://github.com/Daghis/teamcity-mcp/issues/84)) ([9832821](https://github.com/Daghis/teamcity-mcp/commit/9832821e65fd945ec5ff0da2b85f744f413e7782))
|
|
27
|
+
* **health:** accept empty locator; normalize category; fallback on 400 ([#76](https://github.com/Daghis/teamcity-mcp/issues/76)) ([174c8e9](https://github.com/Daghis/teamcity-mcp/commit/174c8e932301b1b2262bfb704a73c4647520d3bf)), closes [#75](https://github.com/Daghis/teamcity-mcp/issues/75)
|
|
28
|
+
* **mcp:** normalize TeamCity errors and wrap server info/metrics with runTool ([#53](https://github.com/Daghis/teamcity-mcp/issues/53)) ([2c8ab85](https://github.com/Daghis/teamcity-mcp/commit/2c8ab855a85e5faec4216a498c089e3a1a93ed7b))
|
|
29
|
+
* **release:** restore 1.9.4 version metadata ([#205](https://github.com/Daghis/teamcity-mcp/issues/205)) ([c10c436](https://github.com/Daghis/teamcity-mcp/commit/c10c4362934f3af116e7d22537481aaceceeff40))
|
|
30
|
+
* **teamcity:** expose unified adapter surface ([#129](https://github.com/Daghis/teamcity-mcp/issues/129)) ([b0b15e8](https://github.com/Daghis/teamcity-mcp/commit/b0b15e8597d5a79c064388be38c3ffe9c0e1fc09)), closes [#114](https://github.com/Daghis/teamcity-mcp/issues/114)
|
|
31
|
+
* **teamcity:** resolve nested artifact downloads ([#188](https://github.com/Daghis/teamcity-mcp/issues/188)) ([e309b90](https://github.com/Daghis/teamcity-mcp/commit/e309b90de42fe121f072fe5b549ab25df3a91aaf))
|
|
32
|
+
* **teamcity:** restore artifact rules update compatibility ([#185](https://github.com/Daghis/teamcity-mcp/issues/185)) ([1d67268](https://github.com/Daghis/teamcity-mcp/commit/1d67268e6ee837db38ab9be27a94a5f3e072ab83))
|
|
33
|
+
* **teamcity:** retain adapter api credentials ([#138](https://github.com/Daghis/teamcity-mcp/issues/138)) ([3ad31ed](https://github.com/Daghis/teamcity-mcp/commit/3ad31edf227eac904eee84ec3a80d16455ae37fc)), closes [#135](https://github.com/Daghis/teamcity-mcp/issues/135)
|
|
34
|
+
* **teamcity:** route results + problems via shared client ([#111](https://github.com/Daghis/teamcity-mcp/issues/111)) ([3797bb5](https://github.com/Daghis/teamcity-mcp/commit/3797bb57d8421e2cb243112a9b1cdfda92fff1f7))
|
|
35
|
+
* **tools:** allow manage_build_steps updates ([#182](https://github.com/Daghis/teamcity-mcp/issues/182)) ([2c6bea0](https://github.com/Daghis/teamcity-mcp/commit/2c6bea0cf6770d22068b9e4b733542a056399148))
|
|
36
|
+
* **tools:** ensure multi-ref branchSpec; remove alias logic ([#103](https://github.com/Daghis/teamcity-mcp/issues/103)) ([5012439](https://github.com/Daghis/teamcity-mcp/commit/5012439caa926422960d5ac569579a3a725732ad))
|
|
37
|
+
* **tools:** harden batch artifact streaming outputs ([#177](https://github.com/Daghis/teamcity-mcp/issues/177)) ([0874325](https://github.com/Daghis/teamcity-mcp/commit/0874325c77aa2a79050cff57fced0aeec5a55ba0))
|
|
38
|
+
* **tools:** merge build step defaults during update (199) ([#203](https://github.com/Daghis/teamcity-mcp/issues/203)) ([43a668f](https://github.com/Daghis/teamcity-mcp/commit/43a668f0bdc3b0f69c6a3bca0e2a47c49f1cd1a7))
|
|
39
|
+
* **tools:** migrate MCP handlers to unified client ([#141](https://github.com/Daghis/teamcity-mcp/issues/141)) ([bc3a909](https://github.com/Daghis/teamcity-mcp/commit/bc3a909f6eb8c30798865c8b48604aca5405efc8))
|
|
40
|
+
* **tools:** repair manage_build_steps updates ([#154](https://github.com/Daghis/teamcity-mcp/issues/154)) ([b557e44](https://github.com/Daghis/teamcity-mcp/commit/b557e4424d5129de9d3b6e3240e1a876488da040))
|
|
41
|
+
* **tools:** stabilize batch artifact downloads ([#175](https://github.com/Daghis/teamcity-mcp/issues/175)) ([91a0ec3](https://github.com/Daghis/teamcity-mcp/commit/91a0ec33ac61e680dd34393fca46914e2ba3fe7f))
|
|
42
|
+
* **tools:** update_build_config uses 'settings/artifactRules' path; add tests ([#66](https://github.com/Daghis/teamcity-mcp/issues/66)) ([8b8afc6](https://github.com/Daghis/teamcity-mcp/commit/8b8afc6f41038bcde21a50a8662f90fa4acb7e9a))
|
|
43
|
+
* trigger 1.0.2 release (no functional change) ([392be27](https://github.com/Daghis/teamcity-mcp/commit/392be27fe705d55fb8a3057120ff5e2c0a41ca8a))
|
|
44
|
+
* trigger 1.0.3 release (no functional change) ([069212a](https://github.com/Daghis/teamcity-mcp/commit/069212a181861b17e7a1d5cfda05b40c2d11e933))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Miscellaneous Chores
|
|
48
|
+
|
|
49
|
+
* release 0.1.2 ([21e2595](https://github.com/Daghis/teamcity-mcp/commit/21e25950074ed49bd3e6c571f432f27fb8bd434e))
|
|
50
|
+
|
|
51
|
+
## [1.9.4](https://github.com/Daghis/teamcity-mcp/compare/v1.9.3...v1.9.4) (2025-09-25)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* **tools:** merge build step defaults during update (199) ([#203](https://github.com/Daghis/teamcity-mcp/issues/203)) ([43a668f](https://github.com/Daghis/teamcity-mcp/commit/43a668f0bdc3b0f69c6a3bca0e2a47c49f1cd1a7))
|
|
56
|
+
|
|
3
57
|
## [1.9.3](https://github.com/Daghis/teamcity-mcp/compare/v1.9.2...v1.9.3) (2025-09-21)
|
|
4
58
|
|
|
5
59
|
|
package/dist/index.js
CHANGED
|
@@ -655,6 +655,7 @@ var import_server = require("@modelcontextprotocol/sdk/server/index.js");
|
|
|
655
655
|
var import_types = require("@modelcontextprotocol/sdk/types.js");
|
|
656
656
|
|
|
657
657
|
// src/utils/logger/index.ts
|
|
658
|
+
var import_node_fs = require("node:fs");
|
|
658
659
|
var import_winston = __toESM(require("winston"));
|
|
659
660
|
var TeamCityLogger = class _TeamCityLogger {
|
|
660
661
|
winston;
|
|
@@ -758,9 +759,8 @@ var TeamCityLogger = class _TeamCityLogger {
|
|
|
758
759
|
*/
|
|
759
760
|
ensureLogDirectory(directory) {
|
|
760
761
|
try {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
fs2.mkdirSync(directory, { recursive: true });
|
|
762
|
+
if ((0, import_node_fs.existsSync)(directory) === false) {
|
|
763
|
+
(0, import_node_fs.mkdirSync)(directory, { recursive: true });
|
|
764
764
|
}
|
|
765
765
|
} catch (error2) {
|
|
766
766
|
this.winston?.warn?.("Failed to create log directory, using current directory", { error: error2 });
|
|
@@ -922,7 +922,7 @@ function debug(message, meta) {
|
|
|
922
922
|
|
|
923
923
|
// src/tools.ts
|
|
924
924
|
var import_node_crypto = require("node:crypto");
|
|
925
|
-
var
|
|
925
|
+
var import_node_fs2 = require("node:fs");
|
|
926
926
|
var import_node_os = require("node:os");
|
|
927
927
|
var import_node_path = require("node:path");
|
|
928
928
|
var import_promises = require("node:stream/promises");
|
|
@@ -2763,7 +2763,7 @@ function formatError(err, context) {
|
|
|
2763
2763
|
}
|
|
2764
2764
|
if (err instanceof import_zod2.z.ZodError) {
|
|
2765
2765
|
error("Validation Error", err, {
|
|
2766
|
-
errors: err.
|
|
2766
|
+
errors: err.issues,
|
|
2767
2767
|
...context
|
|
2768
2768
|
});
|
|
2769
2769
|
return {
|
|
@@ -2771,7 +2771,7 @@ function formatError(err, context) {
|
|
|
2771
2771
|
error: {
|
|
2772
2772
|
message: "Validation failed",
|
|
2773
2773
|
code: "VALIDATION_ERROR",
|
|
2774
|
-
data: err.
|
|
2774
|
+
data: err.issues
|
|
2775
2775
|
}
|
|
2776
2776
|
};
|
|
2777
2777
|
}
|
|
@@ -37237,7 +37237,7 @@ var buildRandomFileName = (artifactName) => {
|
|
|
37237
37237
|
};
|
|
37238
37238
|
var sanitizePathSegments = (artifactPath, fallbackName) => {
|
|
37239
37239
|
const rawSegments = artifactPath?.split("/") ?? [];
|
|
37240
|
-
const sanitizedSegments = rawSegments.map((segment) => segment.trim()).filter((segment) => segment && segment !== "." && segment !== "..").map((segment) => segment.replace(/[^a-zA-Z0-9._-]/g, "_"));
|
|
37240
|
+
const sanitizedSegments = rawSegments.map((segment) => segment.trim()).filter((segment) => segment.length > 0 && segment !== "." && segment !== "..").map((segment) => segment.replace(/[^a-zA-Z0-9._-]/g, "_"));
|
|
37241
37241
|
if (sanitizedSegments.length === 0) {
|
|
37242
37242
|
const { sanitizedBase } = sanitizeFileName(fallbackName);
|
|
37243
37243
|
sanitizedSegments.push(sanitizedBase);
|
|
@@ -37250,7 +37250,7 @@ var ensureUniquePath = async (candidate) => {
|
|
|
37250
37250
|
const probe = async (attempt) => {
|
|
37251
37251
|
const next = attempt === 0 ? candidate : `${stem}-${attempt}${ext}`;
|
|
37252
37252
|
try {
|
|
37253
|
-
const handle = await
|
|
37253
|
+
const handle = await import_node_fs2.promises.open(next, "wx");
|
|
37254
37254
|
await handle.close();
|
|
37255
37255
|
return next;
|
|
37256
37256
|
} catch (error2) {
|
|
@@ -37264,9 +37264,10 @@ var ensureUniquePath = async (candidate) => {
|
|
|
37264
37264
|
return probe(0);
|
|
37265
37265
|
};
|
|
37266
37266
|
var resolveStreamOutputPath = async (artifact, options) => {
|
|
37267
|
-
|
|
37268
|
-
|
|
37269
|
-
|
|
37267
|
+
const { explicitOutputPath } = options;
|
|
37268
|
+
if (typeof explicitOutputPath === "string" && explicitOutputPath.length > 0) {
|
|
37269
|
+
const target = explicitOutputPath;
|
|
37270
|
+
await import_node_fs2.promises.mkdir((0, import_node_path.dirname)(target), { recursive: true });
|
|
37270
37271
|
return target;
|
|
37271
37272
|
}
|
|
37272
37273
|
if (options.outputDir) {
|
|
@@ -37279,17 +37280,17 @@ var resolveStreamOutputPath = async (artifact, options) => {
|
|
|
37279
37280
|
if (relativePath.startsWith("..") || (0, import_node_path.isAbsolute)(relativePath)) {
|
|
37280
37281
|
throw new Error("Resolved artifact path escapes the configured output directory");
|
|
37281
37282
|
}
|
|
37282
|
-
await
|
|
37283
|
+
await import_node_fs2.promises.mkdir((0, import_node_path.dirname)(candidate), { recursive: true });
|
|
37283
37284
|
return ensureUniquePath(candidate);
|
|
37284
37285
|
}
|
|
37285
37286
|
const tempFilePath = (0, import_node_path.join)((0, import_node_os.tmpdir)(), buildRandomFileName(artifact.name));
|
|
37286
|
-
await
|
|
37287
|
+
await import_node_fs2.promises.mkdir((0, import_node_path.dirname)(tempFilePath), { recursive: true });
|
|
37287
37288
|
return tempFilePath;
|
|
37288
37289
|
};
|
|
37289
37290
|
var writeArtifactStreamToDisk = async (artifact, stream, options) => {
|
|
37290
37291
|
const targetPath = await resolveStreamOutputPath(artifact, options);
|
|
37291
|
-
await (0, import_promises.pipeline)(stream, (0,
|
|
37292
|
-
const stats = await
|
|
37292
|
+
await (0, import_promises.pipeline)(stream, (0, import_node_fs2.createWriteStream)(targetPath));
|
|
37293
|
+
const stats = await import_node_fs2.promises.stat(targetPath);
|
|
37293
37294
|
return { outputPath: targetPath, bytesWritten: stats.size };
|
|
37294
37295
|
};
|
|
37295
37296
|
var buildArtifactPayload = async (artifact, encoding, options) => {
|
|
@@ -38028,9 +38029,9 @@ var DEV_TOOLS = [
|
|
|
38028
38029
|
const safeBuildId = effectiveBuildId.replace(/[^a-zA-Z0-9._-]/g, "_") || "build";
|
|
38029
38030
|
const defaultFileName = `build-log-${safeBuildId}-${startLine}-${(0, import_node_crypto.randomUUID)()}.log`;
|
|
38030
38031
|
const targetPath = typed.outputPath ?? (0, import_node_path.join)((0, import_node_os.tmpdir)(), defaultFileName);
|
|
38031
|
-
await
|
|
38032
|
-
await (0, import_promises.pipeline)(stream, (0,
|
|
38033
|
-
const stats = await
|
|
38032
|
+
await import_node_fs2.promises.mkdir((0, import_node_path.dirname)(targetPath), { recursive: true });
|
|
38033
|
+
await (0, import_promises.pipeline)(stream, (0, import_node_fs2.createWriteStream)(targetPath));
|
|
38034
|
+
const stats = await import_node_fs2.promises.stat(targetPath);
|
|
38034
38035
|
const page = Math.floor(startLine / effectivePageSize) + 1;
|
|
38035
38036
|
return json({
|
|
38036
38037
|
encoding: "stream",
|
|
@@ -40492,7 +40493,7 @@ var FULL_MODE_TOOLS = [
|
|
|
40492
40493
|
stepId: import_zod4.z.string().min(1).optional(),
|
|
40493
40494
|
name: import_zod4.z.string().optional(),
|
|
40494
40495
|
type: import_zod4.z.string().optional(),
|
|
40495
|
-
properties: import_zod4.z.record(import_zod4.z.unknown()).optional()
|
|
40496
|
+
properties: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.unknown()).optional()
|
|
40496
40497
|
}).superRefine((value, ctx) => {
|
|
40497
40498
|
if (value.action === "update" || value.action === "delete") {
|
|
40498
40499
|
if (!value.stepId || value.stepId.trim() === "") {
|
|
@@ -40504,6 +40505,16 @@ var FULL_MODE_TOOLS = [
|
|
|
40504
40505
|
}
|
|
40505
40506
|
}
|
|
40506
40507
|
});
|
|
40508
|
+
const decodeScriptContent = (key, value) => {
|
|
40509
|
+
if (key !== "script.content" && key !== "kotlinScript.content") {
|
|
40510
|
+
return value;
|
|
40511
|
+
}
|
|
40512
|
+
const normalised = value.replace(/\r\n/g, "\n");
|
|
40513
|
+
if (!normalised.includes("\\")) {
|
|
40514
|
+
return normalised;
|
|
40515
|
+
}
|
|
40516
|
+
return normalised.replace(/\\r\\n/g, "\n").replace(/\\r/g, "\n").replace(/\\n/g, "\n");
|
|
40517
|
+
};
|
|
40507
40518
|
return runTool(
|
|
40508
40519
|
"manage_build_steps",
|
|
40509
40520
|
schema,
|
|
@@ -40512,7 +40523,10 @@ var FULL_MODE_TOOLS = [
|
|
|
40512
40523
|
switch (typedArgs.action) {
|
|
40513
40524
|
case "add": {
|
|
40514
40525
|
const stepProps = Object.fromEntries(
|
|
40515
|
-
Object.entries(typedArgs.properties ?? {}).map(([k, v]) =>
|
|
40526
|
+
Object.entries(typedArgs.properties ?? {}).map(([k, v]) => {
|
|
40527
|
+
const value = String(v);
|
|
40528
|
+
return [k, decodeScriptContent(k, value)];
|
|
40529
|
+
})
|
|
40516
40530
|
);
|
|
40517
40531
|
if (typedArgs.type === "simpleRunner" && stepProps["script.content"]) {
|
|
40518
40532
|
stepProps["use.custom.script"] = stepProps["use.custom.script"] ?? "true";
|
|
@@ -40539,24 +40553,59 @@ var FULL_MODE_TOOLS = [
|
|
|
40539
40553
|
});
|
|
40540
40554
|
}
|
|
40541
40555
|
case "update": {
|
|
40556
|
+
const existingStepResponse = await adapter.modules.buildTypes.getBuildStep(
|
|
40557
|
+
typedArgs.buildTypeId,
|
|
40558
|
+
typedArgs.stepId,
|
|
40559
|
+
"id,name,type,disabled,properties(property(name,value))",
|
|
40560
|
+
{
|
|
40561
|
+
headers: {
|
|
40562
|
+
Accept: "application/json"
|
|
40563
|
+
}
|
|
40564
|
+
}
|
|
40565
|
+
);
|
|
40566
|
+
const existingStep = existingStepResponse.data;
|
|
40567
|
+
const toRecord2 = (collection) => {
|
|
40568
|
+
if (!collection || !Array.isArray(collection.property)) {
|
|
40569
|
+
return {};
|
|
40570
|
+
}
|
|
40571
|
+
const entries = collection.property.filter((item) => {
|
|
40572
|
+
return Boolean(item?.name);
|
|
40573
|
+
}).map((item) => {
|
|
40574
|
+
return [item.name, item.value != null ? String(item.value) : ""];
|
|
40575
|
+
});
|
|
40576
|
+
return Object.fromEntries(entries);
|
|
40577
|
+
};
|
|
40578
|
+
const existingProperties = toRecord2(existingStep?.properties);
|
|
40542
40579
|
const updatePayload = {};
|
|
40543
|
-
|
|
40544
|
-
|
|
40580
|
+
const mergedName = typedArgs.name ?? existingStep?.name;
|
|
40581
|
+
if (mergedName != null) {
|
|
40582
|
+
updatePayload["name"] = mergedName;
|
|
40583
|
+
}
|
|
40584
|
+
const mergedType = typedArgs.type ?? existingStep?.type;
|
|
40585
|
+
if (mergedType != null) {
|
|
40586
|
+
updatePayload["type"] = mergedType;
|
|
40545
40587
|
}
|
|
40546
|
-
if (
|
|
40547
|
-
updatePayload["
|
|
40588
|
+
if (existingStep?.disabled != null) {
|
|
40589
|
+
updatePayload["disabled"] = existingStep.disabled;
|
|
40548
40590
|
}
|
|
40549
40591
|
const rawProps = typedArgs.properties ?? {};
|
|
40550
|
-
const
|
|
40551
|
-
Object.entries(rawProps).map(([k, v]) =>
|
|
40592
|
+
const providedProps = Object.fromEntries(
|
|
40593
|
+
Object.entries(rawProps).map(([k, v]) => {
|
|
40594
|
+
const value = String(v);
|
|
40595
|
+
return [k, decodeScriptContent(k, value)];
|
|
40596
|
+
})
|
|
40552
40597
|
);
|
|
40553
|
-
|
|
40554
|
-
|
|
40555
|
-
|
|
40598
|
+
const mergedProps = {
|
|
40599
|
+
...existingProperties,
|
|
40600
|
+
...providedProps
|
|
40601
|
+
};
|
|
40602
|
+
if (mergedProps["script.content"] && mergedType === "simpleRunner") {
|
|
40603
|
+
mergedProps["use.custom.script"] = mergedProps["use.custom.script"] ?? "true";
|
|
40604
|
+
mergedProps["script.type"] = mergedProps["script.type"] ?? "customScript";
|
|
40556
40605
|
}
|
|
40557
|
-
if (Object.keys(
|
|
40606
|
+
if (Object.keys(mergedProps).length > 0) {
|
|
40558
40607
|
updatePayload["properties"] = {
|
|
40559
|
-
property: Object.entries(
|
|
40608
|
+
property: Object.entries(mergedProps).map(([name, value]) => ({ name, value }))
|
|
40560
40609
|
};
|
|
40561
40610
|
}
|
|
40562
40611
|
if (Object.keys(updatePayload).length === 0) {
|
|
@@ -40710,7 +40759,9 @@ var FULL_MODE_TOOLS = [
|
|
|
40710
40759
|
const queue = await adapter.modules.buildQueue.getAllQueuedBuilds();
|
|
40711
40760
|
const builds = queue.data?.build ?? [];
|
|
40712
40761
|
const ids = new Set(typed.buildTypeIds);
|
|
40713
|
-
const toCancel = builds.filter(
|
|
40762
|
+
const toCancel = builds.filter(
|
|
40763
|
+
(build) => typeof build.buildTypeId === "string" && ids.has(build.buildTypeId)
|
|
40764
|
+
);
|
|
40714
40765
|
for (const b of toCancel) {
|
|
40715
40766
|
if (b.id == null) continue;
|
|
40716
40767
|
await adapter.modules.buildQueue.deleteQueuedBuild(String(b.id));
|