@daghis/teamcity-mcp 0.1.2 → 0.2.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/.commitlintrc.mjs +25 -0
- package/.github/dependabot.yml +38 -0
- package/.github/workflows/ci.yml +26 -22
- package/.github/workflows/codeql.yml +1 -1
- package/.github/workflows/commitlint.yml +3 -3
- package/.github/workflows/publish.yml +22 -2
- package/AGENTS.md +61 -0
- package/CHANGELOG.md +14 -0
- package/README.md +8 -0
- package/THIRD_PARTY_NOTICES.md +58 -0
- package/dist/index.js +390 -322
- package/dist/index.js.map +4 -4
- package/dist/src/middleware/global-error-handler.d.ts.map +1 -1
- package/dist/src/teamcity/auth.d.ts.map +1 -1
- package/dist/src/teamcity-client/api/agent-api.d.ts +15 -15
- package/dist/src/teamcity-client/api/agent-pool-api.d.ts +14 -14
- package/dist/src/teamcity-client/api/agent-type-api.d.ts +1 -1
- package/dist/src/teamcity-client/api/audit-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/avatar-api.d.ts +4 -4
- package/dist/src/teamcity-client/api/build-api.d.ts +57 -57
- package/dist/src/teamcity-client/api/build-queue-api.d.ts +14 -14
- package/dist/src/teamcity-client/api/build-type-api.d.ts +109 -109
- package/dist/src/teamcity-client/api/change-api.d.ts +10 -10
- package/dist/src/teamcity-client/api/cloud-instance-api.d.ts +10 -10
- package/dist/src/teamcity-client/api/deployment-dashboard-api.d.ts +9 -9
- package/dist/src/teamcity-client/api/global-server-settings-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/group-api.d.ts +16 -16
- package/dist/src/teamcity-client/api/health-api.d.ts +4 -4
- package/dist/src/teamcity-client/api/investigation-api.d.ts +6 -6
- package/dist/src/teamcity-client/api/mute-api.d.ts +6 -6
- package/dist/src/teamcity-client/api/node-api.d.ts +6 -6
- package/dist/src/teamcity-client/api/problem-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/problem-occurrence-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/project-api.d.ts +48 -48
- package/dist/src/teamcity-client/api/role-api.d.ts +8 -8
- package/dist/src/teamcity-client/api/root-api.d.ts +4 -4
- package/dist/src/teamcity-client/api/server-api.d.ts +18 -18
- package/dist/src/teamcity-client/api/server-authentication-settings-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/test-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/test-occurrence-api.d.ts +2 -2
- package/dist/src/teamcity-client/api/user-api.d.ts +28 -28
- package/dist/src/teamcity-client/api/vcs-root-api.d.ts +14 -14
- package/dist/src/teamcity-client/api/vcs-root-instance-api.d.ts +17 -17
- package/dist/src/teamcity-client/api/versioned-settings-api.d.ts +15 -15
- package/dist/src/tools.d.ts.map +1 -1
- package/package.json +14 -13
- package/scripts/build.cjs +25 -6
- package/scripts/generate-third-party-notices.cjs +71 -0
- package/src/middleware/global-error-handler.ts +11 -0
- package/src/teamcity/auth.ts +13 -9
- package/src/tools.ts +20 -6
- package/.commitlintrc.js +0 -3
- package/TODO.md +0 -80
package/dist/index.js
CHANGED
|
@@ -11169,7 +11169,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11169
11169
|
(function detectUnsupportedEnvironment() {
|
|
11170
11170
|
var looksLikeNode = typeof process !== "undefined";
|
|
11171
11171
|
var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
11172
|
-
var looksLikeV8 =
|
|
11172
|
+
var looksLikeV8 = isFunction3(Error.captureStackTrace);
|
|
11173
11173
|
if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
|
|
11174
11174
|
console.warn("The follow-redirects package should be excluded from browser builds.");
|
|
11175
11175
|
}
|
|
@@ -11264,7 +11264,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11264
11264
|
if (!isString2(data) && !isBuffer2(data)) {
|
|
11265
11265
|
throw new TypeError("data should be a string, Buffer or Uint8Array");
|
|
11266
11266
|
}
|
|
11267
|
-
if (
|
|
11267
|
+
if (isFunction3(encoding)) {
|
|
11268
11268
|
callback = encoding;
|
|
11269
11269
|
encoding = null;
|
|
11270
11270
|
}
|
|
@@ -11284,10 +11284,10 @@ var require_follow_redirects = __commonJS({
|
|
|
11284
11284
|
}
|
|
11285
11285
|
};
|
|
11286
11286
|
RedirectableRequest.prototype.end = function(data, encoding, callback) {
|
|
11287
|
-
if (
|
|
11287
|
+
if (isFunction3(data)) {
|
|
11288
11288
|
callback = data;
|
|
11289
11289
|
data = encoding = null;
|
|
11290
|
-
} else if (
|
|
11290
|
+
} else if (isFunction3(encoding)) {
|
|
11291
11291
|
callback = encoding;
|
|
11292
11292
|
encoding = null;
|
|
11293
11293
|
}
|
|
@@ -11488,7 +11488,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11488
11488
|
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
11489
11489
|
removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
|
|
11490
11490
|
}
|
|
11491
|
-
if (
|
|
11491
|
+
if (isFunction3(beforeRedirect)) {
|
|
11492
11492
|
var responseDetails = {
|
|
11493
11493
|
headers: response.headers,
|
|
11494
11494
|
statusCode
|
|
@@ -11523,7 +11523,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11523
11523
|
options = validateUrl(input);
|
|
11524
11524
|
input = { protocol };
|
|
11525
11525
|
}
|
|
11526
|
-
if (
|
|
11526
|
+
if (isFunction3(options)) {
|
|
11527
11527
|
callback = options;
|
|
11528
11528
|
options = null;
|
|
11529
11529
|
}
|
|
@@ -11603,7 +11603,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11603
11603
|
}
|
|
11604
11604
|
function createErrorType(code, message, baseClass) {
|
|
11605
11605
|
function CustomError(properties) {
|
|
11606
|
-
if (
|
|
11606
|
+
if (isFunction3(Error.captureStackTrace)) {
|
|
11607
11607
|
Error.captureStackTrace(this, this.constructor);
|
|
11608
11608
|
}
|
|
11609
11609
|
Object.assign(this, properties || {});
|
|
@@ -11638,7 +11638,7 @@ var require_follow_redirects = __commonJS({
|
|
|
11638
11638
|
function isString2(value) {
|
|
11639
11639
|
return typeof value === "string" || value instanceof String;
|
|
11640
11640
|
}
|
|
11641
|
-
function
|
|
11641
|
+
function isFunction3(value) {
|
|
11642
11642
|
return typeof value === "function";
|
|
11643
11643
|
}
|
|
11644
11644
|
function isBuffer2(value) {
|
|
@@ -11652,49 +11652,8 @@ var require_follow_redirects = __commonJS({
|
|
|
11652
11652
|
}
|
|
11653
11653
|
});
|
|
11654
11654
|
|
|
11655
|
-
// node_modules/is-retry-allowed/index.js
|
|
11656
|
-
var require_is_retry_allowed = __commonJS({
|
|
11657
|
-
"node_modules/is-retry-allowed/index.js"(exports2, module2) {
|
|
11658
|
-
"use strict";
|
|
11659
|
-
var denyList = /* @__PURE__ */ new Set([
|
|
11660
|
-
"ENOTFOUND",
|
|
11661
|
-
"ENETUNREACH",
|
|
11662
|
-
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
|
11663
|
-
"UNABLE_TO_GET_ISSUER_CERT",
|
|
11664
|
-
"UNABLE_TO_GET_CRL",
|
|
11665
|
-
"UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
11666
|
-
"UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
11667
|
-
"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
11668
|
-
"CERT_SIGNATURE_FAILURE",
|
|
11669
|
-
"CRL_SIGNATURE_FAILURE",
|
|
11670
|
-
"CERT_NOT_YET_VALID",
|
|
11671
|
-
"CERT_HAS_EXPIRED",
|
|
11672
|
-
"CRL_NOT_YET_VALID",
|
|
11673
|
-
"CRL_HAS_EXPIRED",
|
|
11674
|
-
"ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
11675
|
-
"ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
11676
|
-
"ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
11677
|
-
"ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
11678
|
-
"OUT_OF_MEM",
|
|
11679
|
-
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
11680
|
-
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
11681
|
-
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
11682
|
-
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
11683
|
-
"CERT_CHAIN_TOO_LONG",
|
|
11684
|
-
"CERT_REVOKED",
|
|
11685
|
-
"INVALID_CA",
|
|
11686
|
-
"PATH_LENGTH_EXCEEDED",
|
|
11687
|
-
"INVALID_PURPOSE",
|
|
11688
|
-
"CERT_UNTRUSTED",
|
|
11689
|
-
"CERT_REJECTED",
|
|
11690
|
-
"HOSTNAME_MISMATCH"
|
|
11691
|
-
]);
|
|
11692
|
-
module2.exports = (error2) => !denyList.has(error2 && error2.code);
|
|
11693
|
-
}
|
|
11694
|
-
});
|
|
11695
|
-
|
|
11696
11655
|
// src/teamcity/errors.ts
|
|
11697
|
-
function
|
|
11656
|
+
function isRetryableError(error2) {
|
|
11698
11657
|
if (error2 instanceof TeamCityAPIError) {
|
|
11699
11658
|
if (error2 instanceof TeamCityNetworkError) {
|
|
11700
11659
|
return true;
|
|
@@ -11836,6 +11795,47 @@ var init_errors = __esm({
|
|
|
11836
11795
|
}
|
|
11837
11796
|
});
|
|
11838
11797
|
|
|
11798
|
+
// node_modules/is-retry-allowed/index.js
|
|
11799
|
+
var require_is_retry_allowed = __commonJS({
|
|
11800
|
+
"node_modules/is-retry-allowed/index.js"(exports2, module2) {
|
|
11801
|
+
"use strict";
|
|
11802
|
+
var denyList = /* @__PURE__ */ new Set([
|
|
11803
|
+
"ENOTFOUND",
|
|
11804
|
+
"ENETUNREACH",
|
|
11805
|
+
// SSL errors from https://github.com/nodejs/node/blob/fc8e3e2cdc521978351de257030db0076d79e0ab/src/crypto/crypto_common.cc#L301-L328
|
|
11806
|
+
"UNABLE_TO_GET_ISSUER_CERT",
|
|
11807
|
+
"UNABLE_TO_GET_CRL",
|
|
11808
|
+
"UNABLE_TO_DECRYPT_CERT_SIGNATURE",
|
|
11809
|
+
"UNABLE_TO_DECRYPT_CRL_SIGNATURE",
|
|
11810
|
+
"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",
|
|
11811
|
+
"CERT_SIGNATURE_FAILURE",
|
|
11812
|
+
"CRL_SIGNATURE_FAILURE",
|
|
11813
|
+
"CERT_NOT_YET_VALID",
|
|
11814
|
+
"CERT_HAS_EXPIRED",
|
|
11815
|
+
"CRL_NOT_YET_VALID",
|
|
11816
|
+
"CRL_HAS_EXPIRED",
|
|
11817
|
+
"ERROR_IN_CERT_NOT_BEFORE_FIELD",
|
|
11818
|
+
"ERROR_IN_CERT_NOT_AFTER_FIELD",
|
|
11819
|
+
"ERROR_IN_CRL_LAST_UPDATE_FIELD",
|
|
11820
|
+
"ERROR_IN_CRL_NEXT_UPDATE_FIELD",
|
|
11821
|
+
"OUT_OF_MEM",
|
|
11822
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
11823
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
11824
|
+
"UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
|
|
11825
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
11826
|
+
"CERT_CHAIN_TOO_LONG",
|
|
11827
|
+
"CERT_REVOKED",
|
|
11828
|
+
"INVALID_CA",
|
|
11829
|
+
"PATH_LENGTH_EXCEEDED",
|
|
11830
|
+
"INVALID_PURPOSE",
|
|
11831
|
+
"CERT_UNTRUSTED",
|
|
11832
|
+
"CERT_REJECTED",
|
|
11833
|
+
"HOSTNAME_MISMATCH"
|
|
11834
|
+
]);
|
|
11835
|
+
module2.exports = (error2) => !denyList.has(error2 && error2.code);
|
|
11836
|
+
}
|
|
11837
|
+
});
|
|
11838
|
+
|
|
11839
11839
|
// src/teamcity/build-status-manager.ts
|
|
11840
11840
|
var build_status_manager_exports = {};
|
|
11841
11841
|
__export(build_status_manager_exports, {
|
|
@@ -12661,7 +12661,7 @@ var _global = (() => {
|
|
|
12661
12661
|
})();
|
|
12662
12662
|
var isContextDefined = (context) => !isUndefined(context) && context !== _global;
|
|
12663
12663
|
function merge() {
|
|
12664
|
-
const { caseless } = isContextDefined(this) && this || {};
|
|
12664
|
+
const { caseless, skipUndefined } = isContextDefined(this) && this || {};
|
|
12665
12665
|
const result = {};
|
|
12666
12666
|
const assignValue = (val, key) => {
|
|
12667
12667
|
const targetKey = caseless && findKey(result, key) || key;
|
|
@@ -12672,7 +12672,9 @@ function merge() {
|
|
|
12672
12672
|
} else if (isArray(val)) {
|
|
12673
12673
|
result[targetKey] = val.slice();
|
|
12674
12674
|
} else {
|
|
12675
|
-
|
|
12675
|
+
if (!skipUndefined || !isUndefined(val)) {
|
|
12676
|
+
result[targetKey] = val;
|
|
12677
|
+
}
|
|
12676
12678
|
}
|
|
12677
12679
|
};
|
|
12678
12680
|
for (let i = 0, l = arguments.length; i < l; i++) {
|
|
@@ -13002,9 +13004,13 @@ AxiosError.from = (error2, code, config2, request, response, customProps) => {
|
|
|
13002
13004
|
}, (prop) => {
|
|
13003
13005
|
return prop !== "isAxiosError";
|
|
13004
13006
|
});
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
axiosError
|
|
13007
|
+
const msg = error2 && error2.message ? error2.message : "Error";
|
|
13008
|
+
const errCode = code == null && error2 ? error2.code : code;
|
|
13009
|
+
AxiosError.call(axiosError, msg, errCode, config2, request, response);
|
|
13010
|
+
if (error2 && axiosError.cause == null) {
|
|
13011
|
+
Object.defineProperty(axiosError, "cause", { value: error2, configurable: true });
|
|
13012
|
+
}
|
|
13013
|
+
axiosError.name = error2 && error2.name || "Error";
|
|
13008
13014
|
customProps && Object.assign(axiosError, customProps);
|
|
13009
13015
|
return axiosError;
|
|
13010
13016
|
};
|
|
@@ -13164,7 +13170,7 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
|
13164
13170
|
|
|
13165
13171
|
// node_modules/axios/lib/helpers/buildURL.js
|
|
13166
13172
|
function encode2(val) {
|
|
13167
|
-
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+")
|
|
13173
|
+
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+");
|
|
13168
13174
|
}
|
|
13169
13175
|
function buildURL(url2, params, options) {
|
|
13170
13176
|
if (!params) {
|
|
@@ -13461,7 +13467,7 @@ var defaults = {
|
|
|
13461
13467
|
const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
|
|
13462
13468
|
const strictJSONParsing = !silentJSONParsing && JSONRequested;
|
|
13463
13469
|
try {
|
|
13464
|
-
return JSON.parse(data);
|
|
13470
|
+
return JSON.parse(data, this.parseReviver);
|
|
13465
13471
|
} catch (e) {
|
|
13466
13472
|
if (strictJSONParsing) {
|
|
13467
13473
|
if (e.name === "SyntaxError") {
|
|
@@ -13847,7 +13853,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
|
13847
13853
|
var import_zlib = __toESM(require("zlib"), 1);
|
|
13848
13854
|
|
|
13849
13855
|
// node_modules/axios/lib/env/data.js
|
|
13850
|
-
var VERSION = "1.
|
|
13856
|
+
var VERSION = "1.12.0";
|
|
13851
13857
|
|
|
13852
13858
|
// node_modules/axios/lib/helpers/parseProtocol.js
|
|
13853
13859
|
function parseProtocol(url2) {
|
|
@@ -14246,6 +14252,57 @@ var progressEventDecorator = (total, throttled) => {
|
|
|
14246
14252
|
};
|
|
14247
14253
|
var asyncDecorator = (fn) => (...args) => utils_default.asap(() => fn(...args));
|
|
14248
14254
|
|
|
14255
|
+
// node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js
|
|
14256
|
+
function estimateDataURLDecodedBytes(url2) {
|
|
14257
|
+
if (!url2 || typeof url2 !== "string") return 0;
|
|
14258
|
+
if (!url2.startsWith("data:")) return 0;
|
|
14259
|
+
const comma = url2.indexOf(",");
|
|
14260
|
+
if (comma < 0) return 0;
|
|
14261
|
+
const meta = url2.slice(5, comma);
|
|
14262
|
+
const body = url2.slice(comma + 1);
|
|
14263
|
+
const isBase64 = /;base64/i.test(meta);
|
|
14264
|
+
if (isBase64) {
|
|
14265
|
+
let effectiveLen = body.length;
|
|
14266
|
+
const len = body.length;
|
|
14267
|
+
for (let i = 0; i < len; i++) {
|
|
14268
|
+
if (body.charCodeAt(i) === 37 && i + 2 < len) {
|
|
14269
|
+
const a = body.charCodeAt(i + 1);
|
|
14270
|
+
const b = body.charCodeAt(i + 2);
|
|
14271
|
+
const isHex = (a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102);
|
|
14272
|
+
if (isHex) {
|
|
14273
|
+
effectiveLen -= 2;
|
|
14274
|
+
i += 2;
|
|
14275
|
+
}
|
|
14276
|
+
}
|
|
14277
|
+
}
|
|
14278
|
+
let pad = 0;
|
|
14279
|
+
let idx = len - 1;
|
|
14280
|
+
const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && // '%'
|
|
14281
|
+
body.charCodeAt(j - 1) === 51 && // '3'
|
|
14282
|
+
(body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100);
|
|
14283
|
+
if (idx >= 0) {
|
|
14284
|
+
if (body.charCodeAt(idx) === 61) {
|
|
14285
|
+
pad++;
|
|
14286
|
+
idx--;
|
|
14287
|
+
} else if (tailIsPct3D(idx)) {
|
|
14288
|
+
pad++;
|
|
14289
|
+
idx -= 3;
|
|
14290
|
+
}
|
|
14291
|
+
}
|
|
14292
|
+
if (pad === 1 && idx >= 0) {
|
|
14293
|
+
if (body.charCodeAt(idx) === 61) {
|
|
14294
|
+
pad++;
|
|
14295
|
+
} else if (tailIsPct3D(idx)) {
|
|
14296
|
+
pad++;
|
|
14297
|
+
}
|
|
14298
|
+
}
|
|
14299
|
+
const groups = Math.floor(effectiveLen / 4);
|
|
14300
|
+
const bytes = groups * 3 - (pad || 0);
|
|
14301
|
+
return bytes > 0 ? bytes : 0;
|
|
14302
|
+
}
|
|
14303
|
+
return Buffer.byteLength(body, "utf8");
|
|
14304
|
+
}
|
|
14305
|
+
|
|
14249
14306
|
// node_modules/axios/lib/adapters/http.js
|
|
14250
14307
|
var zlibOptions = {
|
|
14251
14308
|
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
@@ -14388,6 +14445,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
14388
14445
|
const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
|
|
14389
14446
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
14390
14447
|
if (protocol === "data:") {
|
|
14448
|
+
if (config2.maxContentLength > -1) {
|
|
14449
|
+
const dataUrl = String(config2.url || fullPath || "");
|
|
14450
|
+
const estimated = estimateDataURLDecodedBytes(dataUrl);
|
|
14451
|
+
if (estimated > config2.maxContentLength) {
|
|
14452
|
+
return reject(new AxiosError_default(
|
|
14453
|
+
"maxContentLength size of " + config2.maxContentLength + " exceeded",
|
|
14454
|
+
AxiosError_default.ERR_BAD_RESPONSE,
|
|
14455
|
+
config2
|
|
14456
|
+
));
|
|
14457
|
+
}
|
|
14458
|
+
}
|
|
14391
14459
|
let convertedData;
|
|
14392
14460
|
if (method !== "GET") {
|
|
14393
14461
|
return settle(resolve, reject, {
|
|
@@ -14881,13 +14949,17 @@ var resolveConfig_default = (config2) => {
|
|
|
14881
14949
|
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
14882
14950
|
);
|
|
14883
14951
|
}
|
|
14884
|
-
let contentType;
|
|
14885
14952
|
if (utils_default.isFormData(data)) {
|
|
14886
14953
|
if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
|
|
14887
14954
|
headers.setContentType(void 0);
|
|
14888
|
-
} else if ((
|
|
14889
|
-
const
|
|
14890
|
-
|
|
14955
|
+
} else if (utils_default.isFunction(data.getHeaders)) {
|
|
14956
|
+
const formHeaders = data.getHeaders();
|
|
14957
|
+
const allowedHeaders = ["content-type", "content-length"];
|
|
14958
|
+
Object.entries(formHeaders).forEach(([key, val]) => {
|
|
14959
|
+
if (allowedHeaders.includes(key.toLowerCase())) {
|
|
14960
|
+
headers.set(key, val);
|
|
14961
|
+
}
|
|
14962
|
+
});
|
|
14891
14963
|
}
|
|
14892
14964
|
}
|
|
14893
14965
|
if (platform_default.hasStandardBrowserEnv) {
|
|
@@ -14967,8 +15039,11 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
|
14967
15039
|
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config2, request));
|
|
14968
15040
|
request = null;
|
|
14969
15041
|
};
|
|
14970
|
-
request.onerror = function handleError() {
|
|
14971
|
-
|
|
15042
|
+
request.onerror = function handleError(event) {
|
|
15043
|
+
const msg = event && event.message ? event.message : "Network Error";
|
|
15044
|
+
const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config2, request);
|
|
15045
|
+
err.event = event || null;
|
|
15046
|
+
reject(err);
|
|
14972
15047
|
request = null;
|
|
14973
15048
|
};
|
|
14974
15049
|
request.ontimeout = function handleTimeout() {
|
|
@@ -15143,9 +15218,17 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
|
|
|
15143
15218
|
};
|
|
15144
15219
|
|
|
15145
15220
|
// node_modules/axios/lib/adapters/fetch.js
|
|
15146
|
-
var
|
|
15147
|
-
var
|
|
15148
|
-
var
|
|
15221
|
+
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
15222
|
+
var { isFunction: isFunction2 } = utils_default;
|
|
15223
|
+
var globalFetchAPI = (({ fetch, Request, Response }) => ({
|
|
15224
|
+
fetch,
|
|
15225
|
+
Request,
|
|
15226
|
+
Response
|
|
15227
|
+
}))(utils_default.global);
|
|
15228
|
+
var {
|
|
15229
|
+
ReadableStream: ReadableStream2,
|
|
15230
|
+
TextEncoder: TextEncoder2
|
|
15231
|
+
} = utils_default.global;
|
|
15149
15232
|
var test = (fn, ...args) => {
|
|
15150
15233
|
try {
|
|
15151
15234
|
return !!fn(...args);
|
|
@@ -15153,164 +15236,202 @@ var test = (fn, ...args) => {
|
|
|
15153
15236
|
return false;
|
|
15154
15237
|
}
|
|
15155
15238
|
};
|
|
15156
|
-
var
|
|
15157
|
-
|
|
15158
|
-
const
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
return "half";
|
|
15164
|
-
}
|
|
15165
|
-
}).headers.has("Content-Type");
|
|
15166
|
-
return duplexAccessed && !hasContentType;
|
|
15167
|
-
});
|
|
15168
|
-
var DEFAULT_CHUNK_SIZE = 64 * 1024;
|
|
15169
|
-
var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
15170
|
-
var resolvers = {
|
|
15171
|
-
stream: supportsResponseStream && ((res) => res.body)
|
|
15172
|
-
};
|
|
15173
|
-
isFetchSupported && ((res) => {
|
|
15174
|
-
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
15175
|
-
!resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_, config2) => {
|
|
15176
|
-
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config2);
|
|
15177
|
-
});
|
|
15178
|
-
});
|
|
15179
|
-
})(new Response());
|
|
15180
|
-
var getBodyLength = async (body) => {
|
|
15181
|
-
if (body == null) {
|
|
15182
|
-
return 0;
|
|
15183
|
-
}
|
|
15184
|
-
if (utils_default.isBlob(body)) {
|
|
15185
|
-
return body.size;
|
|
15239
|
+
var factory = (env) => {
|
|
15240
|
+
const { fetch, Request, Response } = Object.assign({}, globalFetchAPI, env);
|
|
15241
|
+
const isFetchSupported = isFunction2(fetch);
|
|
15242
|
+
const isRequestSupported = isFunction2(Request);
|
|
15243
|
+
const isResponseSupported = isFunction2(Response);
|
|
15244
|
+
if (!isFetchSupported) {
|
|
15245
|
+
return false;
|
|
15186
15246
|
}
|
|
15187
|
-
|
|
15188
|
-
|
|
15247
|
+
const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2);
|
|
15248
|
+
const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
|
|
15249
|
+
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
15250
|
+
let duplexAccessed = false;
|
|
15251
|
+
const hasContentType = new Request(platform_default.origin, {
|
|
15252
|
+
body: new ReadableStream2(),
|
|
15189
15253
|
method: "POST",
|
|
15190
|
-
|
|
15191
|
-
|
|
15192
|
-
|
|
15193
|
-
|
|
15194
|
-
|
|
15195
|
-
return
|
|
15196
|
-
}
|
|
15197
|
-
if (utils_default.isURLSearchParams(body)) {
|
|
15198
|
-
body = body + "";
|
|
15199
|
-
}
|
|
15200
|
-
if (utils_default.isString(body)) {
|
|
15201
|
-
return (await encodeText(body)).byteLength;
|
|
15202
|
-
}
|
|
15203
|
-
};
|
|
15204
|
-
var resolveBodyLength = async (headers, body) => {
|
|
15205
|
-
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
15206
|
-
return length == null ? getBodyLength(body) : length;
|
|
15207
|
-
};
|
|
15208
|
-
var fetch_default = isFetchSupported && (async (config2) => {
|
|
15209
|
-
let {
|
|
15210
|
-
url: url2,
|
|
15211
|
-
method,
|
|
15212
|
-
data,
|
|
15213
|
-
signal,
|
|
15214
|
-
cancelToken,
|
|
15215
|
-
timeout,
|
|
15216
|
-
onDownloadProgress,
|
|
15217
|
-
onUploadProgress,
|
|
15218
|
-
responseType,
|
|
15219
|
-
headers,
|
|
15220
|
-
withCredentials = "same-origin",
|
|
15221
|
-
fetchOptions
|
|
15222
|
-
} = resolveConfig_default(config2);
|
|
15223
|
-
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
15224
|
-
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
15225
|
-
let request;
|
|
15226
|
-
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
15227
|
-
composedSignal.unsubscribe();
|
|
15254
|
+
get duplex() {
|
|
15255
|
+
duplexAccessed = true;
|
|
15256
|
+
return "half";
|
|
15257
|
+
}
|
|
15258
|
+
}).headers.has("Content-Type");
|
|
15259
|
+
return duplexAccessed && !hasContentType;
|
|
15228
15260
|
});
|
|
15229
|
-
|
|
15230
|
-
|
|
15231
|
-
|
|
15232
|
-
|
|
15233
|
-
|
|
15234
|
-
|
|
15235
|
-
|
|
15261
|
+
const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
|
|
15262
|
+
const resolvers = {
|
|
15263
|
+
stream: supportsResponseStream && ((res) => res.body)
|
|
15264
|
+
};
|
|
15265
|
+
isFetchSupported && (() => {
|
|
15266
|
+
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
|
|
15267
|
+
!resolvers[type] && (resolvers[type] = (res, config2) => {
|
|
15268
|
+
let method = res && res[type];
|
|
15269
|
+
if (method) {
|
|
15270
|
+
return method.call(res);
|
|
15271
|
+
}
|
|
15272
|
+
throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config2);
|
|
15236
15273
|
});
|
|
15237
|
-
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
const [onProgress, flush] = progressEventDecorator(
|
|
15243
|
-
requestContentLength,
|
|
15244
|
-
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
15245
|
-
);
|
|
15246
|
-
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
15247
|
-
}
|
|
15274
|
+
});
|
|
15275
|
+
})();
|
|
15276
|
+
const getBodyLength = async (body) => {
|
|
15277
|
+
if (body == null) {
|
|
15278
|
+
return 0;
|
|
15248
15279
|
}
|
|
15249
|
-
if (
|
|
15250
|
-
|
|
15280
|
+
if (utils_default.isBlob(body)) {
|
|
15281
|
+
return body.size;
|
|
15251
15282
|
}
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
method: method.toUpperCase(),
|
|
15257
|
-
headers: headers.normalize().toJSON(),
|
|
15258
|
-
body: data,
|
|
15259
|
-
duplex: "half",
|
|
15260
|
-
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
15261
|
-
});
|
|
15262
|
-
let response = await fetch(request, fetchOptions);
|
|
15263
|
-
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
15264
|
-
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
15265
|
-
const options = {};
|
|
15266
|
-
["status", "statusText", "headers"].forEach((prop) => {
|
|
15267
|
-
options[prop] = response[prop];
|
|
15268
|
-
});
|
|
15269
|
-
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
15270
|
-
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
15271
|
-
responseContentLength,
|
|
15272
|
-
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
15273
|
-
) || [];
|
|
15274
|
-
response = new Response(
|
|
15275
|
-
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15276
|
-
flush && flush();
|
|
15277
|
-
unsubscribe && unsubscribe();
|
|
15278
|
-
}),
|
|
15279
|
-
options
|
|
15280
|
-
);
|
|
15281
|
-
}
|
|
15282
|
-
responseType = responseType || "text";
|
|
15283
|
-
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
|
|
15284
|
-
!isStreamResponse && unsubscribe && unsubscribe();
|
|
15285
|
-
return await new Promise((resolve, reject) => {
|
|
15286
|
-
settle(resolve, reject, {
|
|
15287
|
-
data: responseData,
|
|
15288
|
-
headers: AxiosHeaders_default.from(response.headers),
|
|
15289
|
-
status: response.status,
|
|
15290
|
-
statusText: response.statusText,
|
|
15291
|
-
config: config2,
|
|
15292
|
-
request
|
|
15283
|
+
if (utils_default.isSpecCompliantForm(body)) {
|
|
15284
|
+
const _request = new Request(platform_default.origin, {
|
|
15285
|
+
method: "POST",
|
|
15286
|
+
body
|
|
15293
15287
|
});
|
|
15288
|
+
return (await _request.arrayBuffer()).byteLength;
|
|
15289
|
+
}
|
|
15290
|
+
if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
|
|
15291
|
+
return body.byteLength;
|
|
15292
|
+
}
|
|
15293
|
+
if (utils_default.isURLSearchParams(body)) {
|
|
15294
|
+
body = body + "";
|
|
15295
|
+
}
|
|
15296
|
+
if (utils_default.isString(body)) {
|
|
15297
|
+
return (await encodeText(body)).byteLength;
|
|
15298
|
+
}
|
|
15299
|
+
};
|
|
15300
|
+
const resolveBodyLength = async (headers, body) => {
|
|
15301
|
+
const length = utils_default.toFiniteNumber(headers.getContentLength());
|
|
15302
|
+
return length == null ? getBodyLength(body) : length;
|
|
15303
|
+
};
|
|
15304
|
+
return async (config2) => {
|
|
15305
|
+
let {
|
|
15306
|
+
url: url2,
|
|
15307
|
+
method,
|
|
15308
|
+
data,
|
|
15309
|
+
signal,
|
|
15310
|
+
cancelToken,
|
|
15311
|
+
timeout,
|
|
15312
|
+
onDownloadProgress,
|
|
15313
|
+
onUploadProgress,
|
|
15314
|
+
responseType,
|
|
15315
|
+
headers,
|
|
15316
|
+
withCredentials = "same-origin",
|
|
15317
|
+
fetchOptions
|
|
15318
|
+
} = resolveConfig_default(config2);
|
|
15319
|
+
responseType = responseType ? (responseType + "").toLowerCase() : "text";
|
|
15320
|
+
let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
|
|
15321
|
+
let request = null;
|
|
15322
|
+
const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
|
|
15323
|
+
composedSignal.unsubscribe();
|
|
15294
15324
|
});
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15325
|
+
let requestContentLength;
|
|
15326
|
+
try {
|
|
15327
|
+
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
15328
|
+
let _request = new Request(url2, {
|
|
15329
|
+
method: "POST",
|
|
15330
|
+
body: data,
|
|
15331
|
+
duplex: "half"
|
|
15332
|
+
});
|
|
15333
|
+
let contentTypeHeader;
|
|
15334
|
+
if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
|
|
15335
|
+
headers.setContentType(contentTypeHeader);
|
|
15302
15336
|
}
|
|
15303
|
-
|
|
15337
|
+
if (_request.body) {
|
|
15338
|
+
const [onProgress, flush] = progressEventDecorator(
|
|
15339
|
+
requestContentLength,
|
|
15340
|
+
progressEventReducer(asyncDecorator(onUploadProgress))
|
|
15341
|
+
);
|
|
15342
|
+
data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
|
|
15343
|
+
}
|
|
15344
|
+
}
|
|
15345
|
+
if (!utils_default.isString(withCredentials)) {
|
|
15346
|
+
withCredentials = withCredentials ? "include" : "omit";
|
|
15347
|
+
}
|
|
15348
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
|
|
15349
|
+
const resolvedOptions = {
|
|
15350
|
+
...fetchOptions,
|
|
15351
|
+
signal: composedSignal,
|
|
15352
|
+
method: method.toUpperCase(),
|
|
15353
|
+
headers: headers.normalize().toJSON(),
|
|
15354
|
+
body: data,
|
|
15355
|
+
duplex: "half",
|
|
15356
|
+
credentials: isCredentialsSupported ? withCredentials : void 0
|
|
15357
|
+
};
|
|
15358
|
+
request = isRequestSupported && new Request(url2, resolvedOptions);
|
|
15359
|
+
let response = await (isRequestSupported ? fetch(request, fetchOptions) : fetch(url2, resolvedOptions));
|
|
15360
|
+
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
15361
|
+
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
15362
|
+
const options = {};
|
|
15363
|
+
["status", "statusText", "headers"].forEach((prop) => {
|
|
15364
|
+
options[prop] = response[prop];
|
|
15365
|
+
});
|
|
15366
|
+
const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
|
|
15367
|
+
const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
|
|
15368
|
+
responseContentLength,
|
|
15369
|
+
progressEventReducer(asyncDecorator(onDownloadProgress), true)
|
|
15370
|
+
) || [];
|
|
15371
|
+
response = new Response(
|
|
15372
|
+
trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
|
|
15373
|
+
flush && flush();
|
|
15374
|
+
unsubscribe && unsubscribe();
|
|
15375
|
+
}),
|
|
15376
|
+
options
|
|
15377
|
+
);
|
|
15378
|
+
}
|
|
15379
|
+
responseType = responseType || "text";
|
|
15380
|
+
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
|
|
15381
|
+
!isStreamResponse && unsubscribe && unsubscribe();
|
|
15382
|
+
return await new Promise((resolve, reject) => {
|
|
15383
|
+
settle(resolve, reject, {
|
|
15384
|
+
data: responseData,
|
|
15385
|
+
headers: AxiosHeaders_default.from(response.headers),
|
|
15386
|
+
status: response.status,
|
|
15387
|
+
statusText: response.statusText,
|
|
15388
|
+
config: config2,
|
|
15389
|
+
request
|
|
15390
|
+
});
|
|
15391
|
+
});
|
|
15392
|
+
} catch (err) {
|
|
15393
|
+
unsubscribe && unsubscribe();
|
|
15394
|
+
if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
|
|
15395
|
+
throw Object.assign(
|
|
15396
|
+
new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config2, request),
|
|
15397
|
+
{
|
|
15398
|
+
cause: err.cause || err
|
|
15399
|
+
}
|
|
15400
|
+
);
|
|
15401
|
+
}
|
|
15402
|
+
throw AxiosError_default.from(err, err && err.code, config2, request);
|
|
15304
15403
|
}
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
|
|
15404
|
+
};
|
|
15405
|
+
};
|
|
15406
|
+
var seedCache = /* @__PURE__ */ new Map();
|
|
15407
|
+
var getFetch = (config2) => {
|
|
15408
|
+
let env = utils_default.merge.call({
|
|
15409
|
+
skipUndefined: true
|
|
15410
|
+
}, globalFetchAPI, config2 ? config2.env : null);
|
|
15411
|
+
const { fetch, Request, Response } = env;
|
|
15412
|
+
const seeds = [
|
|
15413
|
+
Request,
|
|
15414
|
+
Response,
|
|
15415
|
+
fetch
|
|
15416
|
+
];
|
|
15417
|
+
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
15418
|
+
while (i--) {
|
|
15419
|
+
seed = seeds[i];
|
|
15420
|
+
target = map.get(seed);
|
|
15421
|
+
target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env));
|
|
15422
|
+
map = target;
|
|
15423
|
+
}
|
|
15424
|
+
return target;
|
|
15425
|
+
};
|
|
15426
|
+
var adapter = getFetch();
|
|
15308
15427
|
|
|
15309
15428
|
// node_modules/axios/lib/adapters/adapters.js
|
|
15310
15429
|
var knownAdapters = {
|
|
15311
15430
|
http: http_default,
|
|
15312
15431
|
xhr: xhr_default,
|
|
15313
|
-
fetch:
|
|
15432
|
+
fetch: {
|
|
15433
|
+
get: getFetch
|
|
15434
|
+
}
|
|
15314
15435
|
};
|
|
15315
15436
|
utils_default.forEach(knownAdapters, (fn, value) => {
|
|
15316
15437
|
if (fn) {
|
|
@@ -15322,30 +15443,30 @@ utils_default.forEach(knownAdapters, (fn, value) => {
|
|
|
15322
15443
|
}
|
|
15323
15444
|
});
|
|
15324
15445
|
var renderReason = (reason) => `- ${reason}`;
|
|
15325
|
-
var isResolvedHandle = (
|
|
15446
|
+
var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false;
|
|
15326
15447
|
var adapters_default = {
|
|
15327
|
-
getAdapter: (adapters) => {
|
|
15448
|
+
getAdapter: (adapters, config2) => {
|
|
15328
15449
|
adapters = utils_default.isArray(adapters) ? adapters : [adapters];
|
|
15329
15450
|
const { length } = adapters;
|
|
15330
15451
|
let nameOrAdapter;
|
|
15331
|
-
let
|
|
15452
|
+
let adapter2;
|
|
15332
15453
|
const rejectedReasons = {};
|
|
15333
15454
|
for (let i = 0; i < length; i++) {
|
|
15334
15455
|
nameOrAdapter = adapters[i];
|
|
15335
15456
|
let id;
|
|
15336
|
-
|
|
15457
|
+
adapter2 = nameOrAdapter;
|
|
15337
15458
|
if (!isResolvedHandle(nameOrAdapter)) {
|
|
15338
|
-
|
|
15339
|
-
if (
|
|
15459
|
+
adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
|
|
15460
|
+
if (adapter2 === void 0) {
|
|
15340
15461
|
throw new AxiosError_default(`Unknown adapter '${id}'`);
|
|
15341
15462
|
}
|
|
15342
15463
|
}
|
|
15343
|
-
if (
|
|
15464
|
+
if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config2)))) {
|
|
15344
15465
|
break;
|
|
15345
15466
|
}
|
|
15346
|
-
rejectedReasons[id || "#" + i] =
|
|
15467
|
+
rejectedReasons[id || "#" + i] = adapter2;
|
|
15347
15468
|
}
|
|
15348
|
-
if (!
|
|
15469
|
+
if (!adapter2) {
|
|
15349
15470
|
const reasons = Object.entries(rejectedReasons).map(
|
|
15350
15471
|
([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
|
|
15351
15472
|
);
|
|
@@ -15355,7 +15476,7 @@ var adapters_default = {
|
|
|
15355
15476
|
"ERR_NOT_SUPPORT"
|
|
15356
15477
|
);
|
|
15357
15478
|
}
|
|
15358
|
-
return
|
|
15479
|
+
return adapter2;
|
|
15359
15480
|
},
|
|
15360
15481
|
adapters: knownAdapters
|
|
15361
15482
|
};
|
|
@@ -15379,8 +15500,8 @@ function dispatchRequest(config2) {
|
|
|
15379
15500
|
if (["post", "put", "patch"].indexOf(config2.method) !== -1) {
|
|
15380
15501
|
config2.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
15381
15502
|
}
|
|
15382
|
-
const
|
|
15383
|
-
return
|
|
15503
|
+
const adapter2 = adapters_default.getAdapter(config2.adapter || defaults_default.adapter, config2);
|
|
15504
|
+
return adapter2(config2).then(function onAdapterResolution(response) {
|
|
15384
15505
|
throwIfCancellationRequested(config2);
|
|
15385
15506
|
response.data = transformData.call(
|
|
15386
15507
|
config2,
|
|
@@ -16389,6 +16510,9 @@ function formatError(err, context) {
|
|
|
16389
16510
|
};
|
|
16390
16511
|
}
|
|
16391
16512
|
|
|
16513
|
+
// src/middleware/global-error-handler.ts
|
|
16514
|
+
init_errors();
|
|
16515
|
+
|
|
16392
16516
|
// src/utils/error-logger.ts
|
|
16393
16517
|
var ErrorLogger = class _ErrorLogger {
|
|
16394
16518
|
static instance;
|
|
@@ -16527,6 +16651,14 @@ var GlobalErrorHandler = class _GlobalErrorHandler {
|
|
|
16527
16651
|
* Transform raw errors into structured MCP errors
|
|
16528
16652
|
*/
|
|
16529
16653
|
transformError(error2, context) {
|
|
16654
|
+
if (error2 instanceof TeamCityAPIError) {
|
|
16655
|
+
return new MCPTeamCityError(
|
|
16656
|
+
this.sanitizeErrorMessage(error2.message),
|
|
16657
|
+
error2.statusCode ?? 500,
|
|
16658
|
+
error2.code,
|
|
16659
|
+
context.requestId
|
|
16660
|
+
);
|
|
16661
|
+
}
|
|
16530
16662
|
if (error2 instanceof MCPToolError) {
|
|
16531
16663
|
if (this.options.sanitizeErrors) {
|
|
16532
16664
|
const sanitizedMessage = this.sanitizeErrorMessage(error2.message);
|
|
@@ -16666,20 +16798,20 @@ function isNetworkError(error2) {
|
|
|
16666
16798
|
}
|
|
16667
16799
|
var SAFE_HTTP_METHODS = ["get", "head", "options"];
|
|
16668
16800
|
var IDEMPOTENT_HTTP_METHODS = SAFE_HTTP_METHODS.concat(["put", "delete"]);
|
|
16669
|
-
function
|
|
16801
|
+
function isRetryableError2(error2) {
|
|
16670
16802
|
return error2.code !== "ECONNABORTED" && (!error2.response || error2.response.status === 429 || error2.response.status >= 500 && error2.response.status <= 599);
|
|
16671
16803
|
}
|
|
16672
16804
|
function isSafeRequestError(error2) {
|
|
16673
16805
|
if (!error2.config?.method) {
|
|
16674
16806
|
return false;
|
|
16675
16807
|
}
|
|
16676
|
-
return
|
|
16808
|
+
return isRetryableError2(error2) && SAFE_HTTP_METHODS.indexOf(error2.config.method) !== -1;
|
|
16677
16809
|
}
|
|
16678
16810
|
function isIdempotentRequestError(error2) {
|
|
16679
16811
|
if (!error2.config?.method) {
|
|
16680
16812
|
return false;
|
|
16681
16813
|
}
|
|
16682
|
-
return
|
|
16814
|
+
return isRetryableError2(error2) && IDEMPOTENT_HTTP_METHODS.indexOf(error2.config.method) !== -1;
|
|
16683
16815
|
}
|
|
16684
16816
|
function isNetworkOrIdempotentRequestError(error2) {
|
|
16685
16817
|
return isNetworkError(error2) || isIdempotentRequestError(error2);
|
|
@@ -16826,63 +16958,14 @@ axiosRetry.isIdempotentRequestError = isIdempotentRequestError;
|
|
|
16826
16958
|
axiosRetry.isNetworkOrIdempotentRequestError = isNetworkOrIdempotentRequestError;
|
|
16827
16959
|
axiosRetry.exponentialDelay = exponentialDelay;
|
|
16828
16960
|
axiosRetry.linearDelay = linearDelay;
|
|
16829
|
-
axiosRetry.isRetryableError =
|
|
16961
|
+
axiosRetry.isRetryableError = isRetryableError2;
|
|
16830
16962
|
var esm_default = axiosRetry;
|
|
16831
16963
|
|
|
16832
|
-
// node_modules/uuid/dist/esm/stringify.js
|
|
16833
|
-
var byteToHex = [];
|
|
16834
|
-
for (let i = 0; i < 256; ++i) {
|
|
16835
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
16836
|
-
}
|
|
16837
|
-
function unsafeStringify(arr, offset = 0) {
|
|
16838
|
-
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
16839
|
-
}
|
|
16840
|
-
|
|
16841
|
-
// node_modules/uuid/dist/esm/rng.js
|
|
16842
|
-
var import_crypto2 = require("crypto");
|
|
16843
|
-
var rnds8Pool = new Uint8Array(256);
|
|
16844
|
-
var poolPtr = rnds8Pool.length;
|
|
16845
|
-
function rng() {
|
|
16846
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
16847
|
-
(0, import_crypto2.randomFillSync)(rnds8Pool);
|
|
16848
|
-
poolPtr = 0;
|
|
16849
|
-
}
|
|
16850
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
16851
|
-
}
|
|
16852
|
-
|
|
16853
|
-
// node_modules/uuid/dist/esm/native.js
|
|
16854
|
-
var import_crypto3 = require("crypto");
|
|
16855
|
-
var native_default = { randomUUID: import_crypto3.randomUUID };
|
|
16856
|
-
|
|
16857
|
-
// node_modules/uuid/dist/esm/v4.js
|
|
16858
|
-
function v4(options, buf, offset) {
|
|
16859
|
-
if (native_default.randomUUID && !buf && !options) {
|
|
16860
|
-
return native_default.randomUUID();
|
|
16861
|
-
}
|
|
16862
|
-
options = options || {};
|
|
16863
|
-
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
16864
|
-
if (rnds.length < 16) {
|
|
16865
|
-
throw new Error("Random bytes length must be >= 16");
|
|
16866
|
-
}
|
|
16867
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
16868
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
16869
|
-
if (buf) {
|
|
16870
|
-
offset = offset || 0;
|
|
16871
|
-
if (offset < 0 || offset + 16 > buf.length) {
|
|
16872
|
-
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
16873
|
-
}
|
|
16874
|
-
for (let i = 0; i < 16; ++i) {
|
|
16875
|
-
buf[offset + i] = rnds[i];
|
|
16876
|
-
}
|
|
16877
|
-
return buf;
|
|
16878
|
-
}
|
|
16879
|
-
return unsafeStringify(rnds);
|
|
16880
|
-
}
|
|
16881
|
-
var v4_default = v4;
|
|
16882
|
-
|
|
16883
16964
|
// src/teamcity/auth.ts
|
|
16965
|
+
var import_crypto2 = require("crypto");
|
|
16966
|
+
init_errors();
|
|
16884
16967
|
function generateRequestId() {
|
|
16885
|
-
return
|
|
16968
|
+
return (0, import_crypto2.randomUUID)();
|
|
16886
16969
|
}
|
|
16887
16970
|
function addRequestId(config2) {
|
|
16888
16971
|
const requestId = generateRequestId();
|
|
@@ -16901,36 +16984,6 @@ function addRequestId(config2) {
|
|
|
16901
16984
|
});
|
|
16902
16985
|
return config2;
|
|
16903
16986
|
}
|
|
16904
|
-
function extractErrorDetails(error2) {
|
|
16905
|
-
const requestId = error2.config?.requestId;
|
|
16906
|
-
if (error2.response != null) {
|
|
16907
|
-
const data = error2.response.data;
|
|
16908
|
-
return {
|
|
16909
|
-
code: data?.code ?? `HTTP_${error2.response.status}`,
|
|
16910
|
-
message: data?.message ?? error2.message,
|
|
16911
|
-
details: data?.details ?? JSON.stringify(data),
|
|
16912
|
-
requestId,
|
|
16913
|
-
statusCode: error2.response.status,
|
|
16914
|
-
originalError: error2
|
|
16915
|
-
};
|
|
16916
|
-
} else if (error2.request != null) {
|
|
16917
|
-
return {
|
|
16918
|
-
code: "NO_RESPONSE",
|
|
16919
|
-
message: "No response received from TeamCity server",
|
|
16920
|
-
details: error2.message,
|
|
16921
|
-
requestId,
|
|
16922
|
-
originalError: error2
|
|
16923
|
-
};
|
|
16924
|
-
} else {
|
|
16925
|
-
return {
|
|
16926
|
-
code: "REQUEST_SETUP_ERROR",
|
|
16927
|
-
message: "Error setting up the request",
|
|
16928
|
-
details: error2.message,
|
|
16929
|
-
requestId,
|
|
16930
|
-
originalError: error2
|
|
16931
|
-
};
|
|
16932
|
-
}
|
|
16933
|
-
}
|
|
16934
16987
|
function logResponse(response) {
|
|
16935
16988
|
const requestId = response.config?.requestId;
|
|
16936
16989
|
const meta = response.config._tcMeta;
|
|
@@ -16947,7 +17000,8 @@ function logResponse(response) {
|
|
|
16947
17000
|
return response;
|
|
16948
17001
|
}
|
|
16949
17002
|
function logAndTransformError(error2) {
|
|
16950
|
-
const
|
|
17003
|
+
const requestId = error2.config?.requestId;
|
|
17004
|
+
const tcError = TeamCityAPIError.fromAxiosError(error2, requestId);
|
|
16951
17005
|
const meta = error2.config?._tcMeta;
|
|
16952
17006
|
const duration = meta?.start ? Date.now() - meta.start : void 0;
|
|
16953
17007
|
const sanitize = (val) => {
|
|
@@ -16961,14 +17015,14 @@ function logAndTransformError(error2) {
|
|
|
16961
17015
|
}
|
|
16962
17016
|
};
|
|
16963
17017
|
error("TeamCity API request failed", void 0, {
|
|
16964
|
-
requestId:
|
|
16965
|
-
code:
|
|
16966
|
-
message: sanitize(
|
|
16967
|
-
statusCode:
|
|
16968
|
-
details: sanitize(
|
|
17018
|
+
requestId: tcError.requestId,
|
|
17019
|
+
code: tcError.code,
|
|
17020
|
+
message: sanitize(tcError.message),
|
|
17021
|
+
statusCode: tcError.statusCode,
|
|
17022
|
+
details: sanitize(tcError.details),
|
|
16969
17023
|
duration
|
|
16970
17024
|
});
|
|
16971
|
-
return Promise.reject(
|
|
17025
|
+
return Promise.reject(tcError);
|
|
16972
17026
|
}
|
|
16973
17027
|
function validateToken(token) {
|
|
16974
17028
|
if (!token || token.length === 0) {
|
|
@@ -39367,7 +39421,7 @@ var TeamCityAPI = class _TeamCityAPI {
|
|
|
39367
39421
|
retryCondition: (error2) => {
|
|
39368
39422
|
const reqId = error2?.config?.requestId;
|
|
39369
39423
|
const tcError = TeamCityAPIError.fromAxiosError(error2, reqId);
|
|
39370
|
-
return
|
|
39424
|
+
return isRetryableError(tcError);
|
|
39371
39425
|
}
|
|
39372
39426
|
});
|
|
39373
39427
|
this.axiosInstance.interceptors.request.use((config2) => addRequestId(config2));
|
|
@@ -40371,9 +40425,16 @@ var DEV_TOOLS = [
|
|
|
40371
40425
|
description: "Fetch server metrics (CPU/memory/disk/load) if available",
|
|
40372
40426
|
inputSchema: { type: "object", properties: {} },
|
|
40373
40427
|
handler: async (_args) => {
|
|
40374
|
-
|
|
40375
|
-
|
|
40376
|
-
|
|
40428
|
+
return runTool(
|
|
40429
|
+
"get_server_metrics",
|
|
40430
|
+
null,
|
|
40431
|
+
async () => {
|
|
40432
|
+
const api = TeamCityAPI.getInstance();
|
|
40433
|
+
const metrics = await api.server.getAllMetrics();
|
|
40434
|
+
return json(metrics.data);
|
|
40435
|
+
},
|
|
40436
|
+
{}
|
|
40437
|
+
);
|
|
40377
40438
|
},
|
|
40378
40439
|
mode: "full"
|
|
40379
40440
|
},
|
|
@@ -40382,9 +40443,16 @@ var DEV_TOOLS = [
|
|
|
40382
40443
|
description: "Get TeamCity server info (version, build number, state)",
|
|
40383
40444
|
inputSchema: { type: "object", properties: {} },
|
|
40384
40445
|
handler: async (_args) => {
|
|
40385
|
-
|
|
40386
|
-
|
|
40387
|
-
|
|
40446
|
+
return runTool(
|
|
40447
|
+
"get_server_info",
|
|
40448
|
+
null,
|
|
40449
|
+
async () => {
|
|
40450
|
+
const api = TeamCityAPI.getInstance();
|
|
40451
|
+
const info2 = await api.server.getServerInfo();
|
|
40452
|
+
return json(info2.data);
|
|
40453
|
+
},
|
|
40454
|
+
{}
|
|
40455
|
+
);
|
|
40388
40456
|
}
|
|
40389
40457
|
},
|
|
40390
40458
|
{
|