opencommit 3.0.17 → 3.0.18
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/out/cli.cjs +444 -386
- package/package.json +5 -2
package/out/cli.cjs
CHANGED
|
@@ -1239,8 +1239,8 @@ var require_normalizeHeaderName = __commonJS({
|
|
|
1239
1239
|
var require_enhanceError = __commonJS({
|
|
1240
1240
|
"node_modules/openai/node_modules/axios/lib/core/enhanceError.js"(exports, module2) {
|
|
1241
1241
|
"use strict";
|
|
1242
|
-
module2.exports = function enhanceError(error,
|
|
1243
|
-
error.config =
|
|
1242
|
+
module2.exports = function enhanceError(error, config12, code, request3, response) {
|
|
1243
|
+
error.config = config12;
|
|
1244
1244
|
if (code) {
|
|
1245
1245
|
error.code = code;
|
|
1246
1246
|
}
|
|
@@ -1284,9 +1284,9 @@ var require_createError = __commonJS({
|
|
|
1284
1284
|
"node_modules/openai/node_modules/axios/lib/core/createError.js"(exports, module2) {
|
|
1285
1285
|
"use strict";
|
|
1286
1286
|
var enhanceError = require_enhanceError();
|
|
1287
|
-
module2.exports = function createError(message,
|
|
1287
|
+
module2.exports = function createError(message, config12, code, request3, response) {
|
|
1288
1288
|
var error = new Error(message);
|
|
1289
|
-
return enhanceError(error,
|
|
1289
|
+
return enhanceError(error, config12, code, request3, response);
|
|
1290
1290
|
};
|
|
1291
1291
|
}
|
|
1292
1292
|
});
|
|
@@ -1515,32 +1515,32 @@ var require_xhr = __commonJS({
|
|
|
1515
1515
|
var createError = require_createError();
|
|
1516
1516
|
var transitionalDefaults = require_transitional();
|
|
1517
1517
|
var Cancel2 = require_Cancel();
|
|
1518
|
-
module2.exports = function xhrAdapter(
|
|
1518
|
+
module2.exports = function xhrAdapter(config12) {
|
|
1519
1519
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
1520
|
-
var requestData =
|
|
1521
|
-
var requestHeaders =
|
|
1522
|
-
var responseType =
|
|
1520
|
+
var requestData = config12.data;
|
|
1521
|
+
var requestHeaders = config12.headers;
|
|
1522
|
+
var responseType = config12.responseType;
|
|
1523
1523
|
var onCanceled;
|
|
1524
1524
|
function done() {
|
|
1525
|
-
if (
|
|
1526
|
-
|
|
1525
|
+
if (config12.cancelToken) {
|
|
1526
|
+
config12.cancelToken.unsubscribe(onCanceled);
|
|
1527
1527
|
}
|
|
1528
|
-
if (
|
|
1529
|
-
|
|
1528
|
+
if (config12.signal) {
|
|
1529
|
+
config12.signal.removeEventListener("abort", onCanceled);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
if (utils.isFormData(requestData)) {
|
|
1533
1533
|
delete requestHeaders["Content-Type"];
|
|
1534
1534
|
}
|
|
1535
1535
|
var request3 = new XMLHttpRequest();
|
|
1536
|
-
if (
|
|
1537
|
-
var username =
|
|
1538
|
-
var password =
|
|
1536
|
+
if (config12.auth) {
|
|
1537
|
+
var username = config12.auth.username || "";
|
|
1538
|
+
var password = config12.auth.password ? unescape(encodeURIComponent(config12.auth.password)) : "";
|
|
1539
1539
|
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
1540
1540
|
}
|
|
1541
|
-
var fullPath = buildFullPath2(
|
|
1542
|
-
request3.open(
|
|
1543
|
-
request3.timeout =
|
|
1541
|
+
var fullPath = buildFullPath2(config12.baseURL, config12.url);
|
|
1542
|
+
request3.open(config12.method.toUpperCase(), buildURL2(fullPath, config12.params, config12.paramsSerializer), true);
|
|
1543
|
+
request3.timeout = config12.timeout;
|
|
1544
1544
|
function onloadend() {
|
|
1545
1545
|
if (!request3) {
|
|
1546
1546
|
return;
|
|
@@ -1552,7 +1552,7 @@ var require_xhr = __commonJS({
|
|
|
1552
1552
|
status: request3.status,
|
|
1553
1553
|
statusText: request3.statusText,
|
|
1554
1554
|
headers: responseHeaders,
|
|
1555
|
-
config:
|
|
1555
|
+
config: config12,
|
|
1556
1556
|
request: request3
|
|
1557
1557
|
};
|
|
1558
1558
|
settle2(function _resolve(value) {
|
|
@@ -1581,31 +1581,31 @@ var require_xhr = __commonJS({
|
|
|
1581
1581
|
if (!request3) {
|
|
1582
1582
|
return;
|
|
1583
1583
|
}
|
|
1584
|
-
reject(createError("Request aborted",
|
|
1584
|
+
reject(createError("Request aborted", config12, "ECONNABORTED", request3));
|
|
1585
1585
|
request3 = null;
|
|
1586
1586
|
};
|
|
1587
1587
|
request3.onerror = function handleError() {
|
|
1588
|
-
reject(createError("Network Error",
|
|
1588
|
+
reject(createError("Network Error", config12, null, request3));
|
|
1589
1589
|
request3 = null;
|
|
1590
1590
|
};
|
|
1591
1591
|
request3.ontimeout = function handleTimeout() {
|
|
1592
|
-
var timeoutErrorMessage =
|
|
1593
|
-
var transitional2 =
|
|
1594
|
-
if (
|
|
1595
|
-
timeoutErrorMessage =
|
|
1592
|
+
var timeoutErrorMessage = config12.timeout ? "timeout of " + config12.timeout + "ms exceeded" : "timeout exceeded";
|
|
1593
|
+
var transitional2 = config12.transitional || transitionalDefaults;
|
|
1594
|
+
if (config12.timeoutErrorMessage) {
|
|
1595
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
1596
1596
|
}
|
|
1597
1597
|
reject(createError(
|
|
1598
1598
|
timeoutErrorMessage,
|
|
1599
|
-
|
|
1599
|
+
config12,
|
|
1600
1600
|
transitional2.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
1601
1601
|
request3
|
|
1602
1602
|
));
|
|
1603
1603
|
request3 = null;
|
|
1604
1604
|
};
|
|
1605
1605
|
if (utils.isStandardBrowserEnv()) {
|
|
1606
|
-
var xsrfValue = (
|
|
1606
|
+
var xsrfValue = (config12.withCredentials || isURLSameOrigin(fullPath)) && config12.xsrfCookieName ? cookies.read(config12.xsrfCookieName) : void 0;
|
|
1607
1607
|
if (xsrfValue) {
|
|
1608
|
-
requestHeaders[
|
|
1608
|
+
requestHeaders[config12.xsrfHeaderName] = xsrfValue;
|
|
1609
1609
|
}
|
|
1610
1610
|
}
|
|
1611
1611
|
if ("setRequestHeader" in request3) {
|
|
@@ -1617,19 +1617,19 @@ var require_xhr = __commonJS({
|
|
|
1617
1617
|
}
|
|
1618
1618
|
});
|
|
1619
1619
|
}
|
|
1620
|
-
if (!utils.isUndefined(
|
|
1621
|
-
request3.withCredentials = !!
|
|
1620
|
+
if (!utils.isUndefined(config12.withCredentials)) {
|
|
1621
|
+
request3.withCredentials = !!config12.withCredentials;
|
|
1622
1622
|
}
|
|
1623
1623
|
if (responseType && responseType !== "json") {
|
|
1624
|
-
request3.responseType =
|
|
1624
|
+
request3.responseType = config12.responseType;
|
|
1625
1625
|
}
|
|
1626
|
-
if (typeof
|
|
1627
|
-
request3.addEventListener("progress",
|
|
1626
|
+
if (typeof config12.onDownloadProgress === "function") {
|
|
1627
|
+
request3.addEventListener("progress", config12.onDownloadProgress);
|
|
1628
1628
|
}
|
|
1629
|
-
if (typeof
|
|
1630
|
-
request3.upload.addEventListener("progress",
|
|
1629
|
+
if (typeof config12.onUploadProgress === "function" && request3.upload) {
|
|
1630
|
+
request3.upload.addEventListener("progress", config12.onUploadProgress);
|
|
1631
1631
|
}
|
|
1632
|
-
if (
|
|
1632
|
+
if (config12.cancelToken || config12.signal) {
|
|
1633
1633
|
onCanceled = function(cancel) {
|
|
1634
1634
|
if (!request3) {
|
|
1635
1635
|
return;
|
|
@@ -1638,9 +1638,9 @@ var require_xhr = __commonJS({
|
|
|
1638
1638
|
request3.abort();
|
|
1639
1639
|
request3 = null;
|
|
1640
1640
|
};
|
|
1641
|
-
|
|
1642
|
-
if (
|
|
1643
|
-
|
|
1641
|
+
config12.cancelToken && config12.cancelToken.subscribe(onCanceled);
|
|
1642
|
+
if (config12.signal) {
|
|
1643
|
+
config12.signal.aborted ? onCanceled() : config12.signal.addEventListener("abort", onCanceled);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
1646
|
if (!requestData) {
|
|
@@ -2936,15 +2936,15 @@ var require_http = __commonJS({
|
|
|
2936
2936
|
setProxy2(redirection, proxy, redirection.href);
|
|
2937
2937
|
};
|
|
2938
2938
|
}
|
|
2939
|
-
module2.exports = function httpAdapter2(
|
|
2939
|
+
module2.exports = function httpAdapter2(config12) {
|
|
2940
2940
|
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
2941
2941
|
var onCanceled;
|
|
2942
2942
|
function done() {
|
|
2943
|
-
if (
|
|
2944
|
-
|
|
2943
|
+
if (config12.cancelToken) {
|
|
2944
|
+
config12.cancelToken.unsubscribe(onCanceled);
|
|
2945
2945
|
}
|
|
2946
|
-
if (
|
|
2947
|
-
|
|
2946
|
+
if (config12.signal) {
|
|
2947
|
+
config12.signal.removeEventListener("abort", onCanceled);
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
2950
|
var resolve = function resolve2(value) {
|
|
@@ -2957,8 +2957,8 @@ var require_http = __commonJS({
|
|
|
2957
2957
|
rejected = true;
|
|
2958
2958
|
rejectPromise(value);
|
|
2959
2959
|
};
|
|
2960
|
-
var data =
|
|
2961
|
-
var headers =
|
|
2960
|
+
var data = config12.data;
|
|
2961
|
+
var headers = config12.headers;
|
|
2962
2962
|
var headerNames = {};
|
|
2963
2963
|
Object.keys(headers).forEach(function storeLowerName(name) {
|
|
2964
2964
|
headerNames[name.toLowerCase()] = name;
|
|
@@ -2979,23 +2979,23 @@ var require_http = __commonJS({
|
|
|
2979
2979
|
} else {
|
|
2980
2980
|
return reject(createError(
|
|
2981
2981
|
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
2982
|
-
|
|
2982
|
+
config12
|
|
2983
2983
|
));
|
|
2984
2984
|
}
|
|
2985
|
-
if (
|
|
2986
|
-
return reject(createError("Request body larger than maxBodyLength limit",
|
|
2985
|
+
if (config12.maxBodyLength > -1 && data.length > config12.maxBodyLength) {
|
|
2986
|
+
return reject(createError("Request body larger than maxBodyLength limit", config12));
|
|
2987
2987
|
}
|
|
2988
2988
|
if (!headerNames["content-length"]) {
|
|
2989
2989
|
headers["Content-Length"] = data.length;
|
|
2990
2990
|
}
|
|
2991
2991
|
}
|
|
2992
2992
|
var auth = void 0;
|
|
2993
|
-
if (
|
|
2994
|
-
var username =
|
|
2995
|
-
var password =
|
|
2993
|
+
if (config12.auth) {
|
|
2994
|
+
var username = config12.auth.username || "";
|
|
2995
|
+
var password = config12.auth.password || "";
|
|
2996
2996
|
auth = username + ":" + password;
|
|
2997
2997
|
}
|
|
2998
|
-
var fullPath = buildFullPath2(
|
|
2998
|
+
var fullPath = buildFullPath2(config12.baseURL, config12.url);
|
|
2999
2999
|
var parsed = url2.parse(fullPath);
|
|
3000
3000
|
var protocol = parsed.protocol || "http:";
|
|
3001
3001
|
if (!auth && parsed.auth) {
|
|
@@ -3008,31 +3008,31 @@ var require_http = __commonJS({
|
|
|
3008
3008
|
delete headers[headerNames.authorization];
|
|
3009
3009
|
}
|
|
3010
3010
|
var isHttpsRequest = isHttps2.test(protocol);
|
|
3011
|
-
var agent = isHttpsRequest ?
|
|
3011
|
+
var agent = isHttpsRequest ? config12.httpsAgent : config12.httpAgent;
|
|
3012
3012
|
try {
|
|
3013
|
-
buildURL2(parsed.path,
|
|
3013
|
+
buildURL2(parsed.path, config12.params, config12.paramsSerializer).replace(/^\?/, "");
|
|
3014
3014
|
} catch (err) {
|
|
3015
3015
|
var customErr = new Error(err.message);
|
|
3016
|
-
customErr.config =
|
|
3017
|
-
customErr.url =
|
|
3016
|
+
customErr.config = config12;
|
|
3017
|
+
customErr.url = config12.url;
|
|
3018
3018
|
customErr.exists = true;
|
|
3019
3019
|
reject(customErr);
|
|
3020
3020
|
}
|
|
3021
3021
|
var options = {
|
|
3022
|
-
path: buildURL2(parsed.path,
|
|
3023
|
-
method:
|
|
3022
|
+
path: buildURL2(parsed.path, config12.params, config12.paramsSerializer).replace(/^\?/, ""),
|
|
3023
|
+
method: config12.method.toUpperCase(),
|
|
3024
3024
|
headers,
|
|
3025
3025
|
agent,
|
|
3026
|
-
agents: { http:
|
|
3026
|
+
agents: { http: config12.httpAgent, https: config12.httpsAgent },
|
|
3027
3027
|
auth
|
|
3028
3028
|
};
|
|
3029
|
-
if (
|
|
3030
|
-
options.socketPath =
|
|
3029
|
+
if (config12.socketPath) {
|
|
3030
|
+
options.socketPath = config12.socketPath;
|
|
3031
3031
|
} else {
|
|
3032
3032
|
options.hostname = parsed.hostname;
|
|
3033
3033
|
options.port = parsed.port;
|
|
3034
3034
|
}
|
|
3035
|
-
var proxy =
|
|
3035
|
+
var proxy = config12.proxy;
|
|
3036
3036
|
if (!proxy && proxy !== false) {
|
|
3037
3037
|
var proxyEnv = protocol.slice(0, -1) + "_proxy";
|
|
3038
3038
|
var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
|
|
@@ -3079,28 +3079,28 @@ var require_http = __commonJS({
|
|
|
3079
3079
|
}
|
|
3080
3080
|
var transport;
|
|
3081
3081
|
var isHttpsProxy = isHttpsRequest && (proxy ? isHttps2.test(proxy.protocol) : true);
|
|
3082
|
-
if (
|
|
3083
|
-
transport =
|
|
3084
|
-
} else if (
|
|
3082
|
+
if (config12.transport) {
|
|
3083
|
+
transport = config12.transport;
|
|
3084
|
+
} else if (config12.maxRedirects === 0) {
|
|
3085
3085
|
transport = isHttpsProxy ? https3 : http3;
|
|
3086
3086
|
} else {
|
|
3087
|
-
if (
|
|
3088
|
-
options.maxRedirects =
|
|
3087
|
+
if (config12.maxRedirects) {
|
|
3088
|
+
options.maxRedirects = config12.maxRedirects;
|
|
3089
3089
|
}
|
|
3090
3090
|
transport = isHttpsProxy ? httpsFollow2 : httpFollow2;
|
|
3091
3091
|
}
|
|
3092
|
-
if (
|
|
3093
|
-
options.maxBodyLength =
|
|
3092
|
+
if (config12.maxBodyLength > -1) {
|
|
3093
|
+
options.maxBodyLength = config12.maxBodyLength;
|
|
3094
3094
|
}
|
|
3095
|
-
if (
|
|
3096
|
-
options.insecureHTTPParser =
|
|
3095
|
+
if (config12.insecureHTTPParser) {
|
|
3096
|
+
options.insecureHTTPParser = config12.insecureHTTPParser;
|
|
3097
3097
|
}
|
|
3098
3098
|
var req = transport.request(options, function handleResponse(res) {
|
|
3099
3099
|
if (req.aborted)
|
|
3100
3100
|
return;
|
|
3101
3101
|
var stream4 = res;
|
|
3102
3102
|
var lastRequest = res.req || req;
|
|
3103
|
-
if (res.statusCode !== 204 && lastRequest.method !== "HEAD" &&
|
|
3103
|
+
if (res.statusCode !== 204 && lastRequest.method !== "HEAD" && config12.decompress !== false) {
|
|
3104
3104
|
switch (res.headers["content-encoding"]) {
|
|
3105
3105
|
case "gzip":
|
|
3106
3106
|
case "compress":
|
|
@@ -3114,10 +3114,10 @@ var require_http = __commonJS({
|
|
|
3114
3114
|
status: res.statusCode,
|
|
3115
3115
|
statusText: res.statusMessage,
|
|
3116
3116
|
headers: res.headers,
|
|
3117
|
-
config:
|
|
3117
|
+
config: config12,
|
|
3118
3118
|
request: lastRequest
|
|
3119
3119
|
};
|
|
3120
|
-
if (
|
|
3120
|
+
if (config12.responseType === "stream") {
|
|
3121
3121
|
response.data = stream4;
|
|
3122
3122
|
settle2(resolve, reject, response);
|
|
3123
3123
|
} else {
|
|
@@ -3126,12 +3126,12 @@ var require_http = __commonJS({
|
|
|
3126
3126
|
stream4.on("data", function handleStreamData(chunk) {
|
|
3127
3127
|
responseBuffer.push(chunk);
|
|
3128
3128
|
totalResponseBytes += chunk.length;
|
|
3129
|
-
if (
|
|
3129
|
+
if (config12.maxContentLength > -1 && totalResponseBytes > config12.maxContentLength) {
|
|
3130
3130
|
rejected = true;
|
|
3131
3131
|
stream4.destroy();
|
|
3132
3132
|
reject(createError(
|
|
3133
|
-
"maxContentLength size of " +
|
|
3134
|
-
|
|
3133
|
+
"maxContentLength size of " + config12.maxContentLength + " exceeded",
|
|
3134
|
+
config12,
|
|
3135
3135
|
null,
|
|
3136
3136
|
lastRequest
|
|
3137
3137
|
));
|
|
@@ -3142,25 +3142,25 @@ var require_http = __commonJS({
|
|
|
3142
3142
|
return;
|
|
3143
3143
|
}
|
|
3144
3144
|
stream4.destroy();
|
|
3145
|
-
reject(createError("error request aborted",
|
|
3145
|
+
reject(createError("error request aborted", config12, "ERR_REQUEST_ABORTED", lastRequest));
|
|
3146
3146
|
});
|
|
3147
3147
|
stream4.on("error", function handleStreamError(err) {
|
|
3148
3148
|
if (req.aborted)
|
|
3149
3149
|
return;
|
|
3150
|
-
reject(enhanceError(err,
|
|
3150
|
+
reject(enhanceError(err, config12, null, lastRequest));
|
|
3151
3151
|
});
|
|
3152
3152
|
stream4.on("end", function handleStreamEnd() {
|
|
3153
3153
|
try {
|
|
3154
3154
|
var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
3155
|
-
if (
|
|
3156
|
-
responseData = responseData.toString(
|
|
3157
|
-
if (!
|
|
3155
|
+
if (config12.responseType !== "arraybuffer") {
|
|
3156
|
+
responseData = responseData.toString(config12.responseEncoding);
|
|
3157
|
+
if (!config12.responseEncoding || config12.responseEncoding === "utf8") {
|
|
3158
3158
|
responseData = utils.stripBOM(responseData);
|
|
3159
3159
|
}
|
|
3160
3160
|
}
|
|
3161
3161
|
response.data = responseData;
|
|
3162
3162
|
} catch (err) {
|
|
3163
|
-
reject(enhanceError(err,
|
|
3163
|
+
reject(enhanceError(err, config12, err.code, response.request, response));
|
|
3164
3164
|
}
|
|
3165
3165
|
settle2(resolve, reject, response);
|
|
3166
3166
|
});
|
|
@@ -3169,17 +3169,17 @@ var require_http = __commonJS({
|
|
|
3169
3169
|
req.on("error", function handleRequestError(err) {
|
|
3170
3170
|
if (req.aborted && err.code !== "ERR_FR_TOO_MANY_REDIRECTS")
|
|
3171
3171
|
return;
|
|
3172
|
-
reject(enhanceError(err,
|
|
3172
|
+
reject(enhanceError(err, config12, null, req));
|
|
3173
3173
|
});
|
|
3174
3174
|
req.on("socket", function handleRequestSocket(socket) {
|
|
3175
3175
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
3176
3176
|
});
|
|
3177
|
-
if (
|
|
3178
|
-
var timeout = parseInt(
|
|
3177
|
+
if (config12.timeout) {
|
|
3178
|
+
var timeout = parseInt(config12.timeout, 10);
|
|
3179
3179
|
if (isNaN(timeout)) {
|
|
3180
3180
|
reject(createError(
|
|
3181
3181
|
"error trying to parse `config.timeout` to int",
|
|
3182
|
-
|
|
3182
|
+
config12,
|
|
3183
3183
|
"ERR_PARSE_TIMEOUT",
|
|
3184
3184
|
req
|
|
3185
3185
|
));
|
|
@@ -3188,35 +3188,35 @@ var require_http = __commonJS({
|
|
|
3188
3188
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
3189
3189
|
req.abort();
|
|
3190
3190
|
var timeoutErrorMessage = "";
|
|
3191
|
-
if (
|
|
3192
|
-
timeoutErrorMessage =
|
|
3191
|
+
if (config12.timeoutErrorMessage) {
|
|
3192
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
3193
3193
|
} else {
|
|
3194
|
-
timeoutErrorMessage = "timeout of " +
|
|
3194
|
+
timeoutErrorMessage = "timeout of " + config12.timeout + "ms exceeded";
|
|
3195
3195
|
}
|
|
3196
|
-
var transitional2 =
|
|
3196
|
+
var transitional2 = config12.transitional || transitionalDefaults;
|
|
3197
3197
|
reject(createError(
|
|
3198
3198
|
timeoutErrorMessage,
|
|
3199
|
-
|
|
3199
|
+
config12,
|
|
3200
3200
|
transitional2.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
3201
3201
|
req
|
|
3202
3202
|
));
|
|
3203
3203
|
});
|
|
3204
3204
|
}
|
|
3205
|
-
if (
|
|
3205
|
+
if (config12.cancelToken || config12.signal) {
|
|
3206
3206
|
onCanceled = function(cancel) {
|
|
3207
3207
|
if (req.aborted)
|
|
3208
3208
|
return;
|
|
3209
3209
|
req.abort();
|
|
3210
3210
|
reject(!cancel || cancel && cancel.type ? new Cancel2("canceled") : cancel);
|
|
3211
3211
|
};
|
|
3212
|
-
|
|
3213
|
-
if (
|
|
3214
|
-
|
|
3212
|
+
config12.cancelToken && config12.cancelToken.subscribe(onCanceled);
|
|
3213
|
+
if (config12.signal) {
|
|
3214
|
+
config12.signal.aborted ? onCanceled() : config12.signal.addEventListener("abort", onCanceled);
|
|
3215
3215
|
}
|
|
3216
3216
|
}
|
|
3217
3217
|
if (utils.isStream(data)) {
|
|
3218
3218
|
data.on("error", function handleStreamError(err) {
|
|
3219
|
-
reject(enhanceError(err,
|
|
3219
|
+
reject(enhanceError(err, config12, null, req));
|
|
3220
3220
|
}).pipe(req);
|
|
3221
3221
|
} else {
|
|
3222
3222
|
req.end(data);
|
|
@@ -3364,53 +3364,53 @@ var require_dispatchRequest = __commonJS({
|
|
|
3364
3364
|
var isCancel3 = require_isCancel();
|
|
3365
3365
|
var defaults2 = require_defaults();
|
|
3366
3366
|
var Cancel2 = require_Cancel();
|
|
3367
|
-
function throwIfCancellationRequested2(
|
|
3368
|
-
if (
|
|
3369
|
-
|
|
3367
|
+
function throwIfCancellationRequested2(config12) {
|
|
3368
|
+
if (config12.cancelToken) {
|
|
3369
|
+
config12.cancelToken.throwIfRequested();
|
|
3370
3370
|
}
|
|
3371
|
-
if (
|
|
3371
|
+
if (config12.signal && config12.signal.aborted) {
|
|
3372
3372
|
throw new Cancel2("canceled");
|
|
3373
3373
|
}
|
|
3374
3374
|
}
|
|
3375
|
-
module2.exports = function dispatchRequest2(
|
|
3376
|
-
throwIfCancellationRequested2(
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3375
|
+
module2.exports = function dispatchRequest2(config12) {
|
|
3376
|
+
throwIfCancellationRequested2(config12);
|
|
3377
|
+
config12.headers = config12.headers || {};
|
|
3378
|
+
config12.data = transformData2.call(
|
|
3379
|
+
config12,
|
|
3380
|
+
config12.data,
|
|
3381
|
+
config12.headers,
|
|
3382
|
+
config12.transformRequest
|
|
3383
3383
|
);
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3384
|
+
config12.headers = utils.merge(
|
|
3385
|
+
config12.headers.common || {},
|
|
3386
|
+
config12.headers[config12.method] || {},
|
|
3387
|
+
config12.headers
|
|
3388
3388
|
);
|
|
3389
3389
|
utils.forEach(
|
|
3390
3390
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
3391
3391
|
function cleanHeaderConfig(method) {
|
|
3392
|
-
delete
|
|
3392
|
+
delete config12.headers[method];
|
|
3393
3393
|
}
|
|
3394
3394
|
);
|
|
3395
|
-
var adapter =
|
|
3396
|
-
return adapter(
|
|
3397
|
-
throwIfCancellationRequested2(
|
|
3395
|
+
var adapter = config12.adapter || defaults2.adapter;
|
|
3396
|
+
return adapter(config12).then(function onAdapterResolution(response) {
|
|
3397
|
+
throwIfCancellationRequested2(config12);
|
|
3398
3398
|
response.data = transformData2.call(
|
|
3399
|
-
|
|
3399
|
+
config12,
|
|
3400
3400
|
response.data,
|
|
3401
3401
|
response.headers,
|
|
3402
|
-
|
|
3402
|
+
config12.transformResponse
|
|
3403
3403
|
);
|
|
3404
3404
|
return response;
|
|
3405
3405
|
}, function onAdapterRejection(reason) {
|
|
3406
3406
|
if (!isCancel3(reason)) {
|
|
3407
|
-
throwIfCancellationRequested2(
|
|
3407
|
+
throwIfCancellationRequested2(config12);
|
|
3408
3408
|
if (reason && reason.response) {
|
|
3409
3409
|
reason.response.data = transformData2.call(
|
|
3410
|
-
|
|
3410
|
+
config12,
|
|
3411
3411
|
reason.response.data,
|
|
3412
3412
|
reason.response.headers,
|
|
3413
|
-
|
|
3413
|
+
config12.transformResponse
|
|
3414
3414
|
);
|
|
3415
3415
|
}
|
|
3416
3416
|
}
|
|
@@ -3427,7 +3427,7 @@ var require_mergeConfig = __commonJS({
|
|
|
3427
3427
|
var utils = require_utils();
|
|
3428
3428
|
module2.exports = function mergeConfig3(config1, config22) {
|
|
3429
3429
|
config22 = config22 || {};
|
|
3430
|
-
var
|
|
3430
|
+
var config12 = {};
|
|
3431
3431
|
function getMergedValue(target, source) {
|
|
3432
3432
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
3433
3433
|
return utils.merge(target, source);
|
|
@@ -3495,9 +3495,9 @@ var require_mergeConfig = __commonJS({
|
|
|
3495
3495
|
utils.forEach(Object.keys(config1).concat(Object.keys(config22)), function computeConfigValue(prop) {
|
|
3496
3496
|
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
3497
3497
|
var configValue = merge2(prop);
|
|
3498
|
-
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (
|
|
3498
|
+
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config12[prop] = configValue);
|
|
3499
3499
|
});
|
|
3500
|
-
return
|
|
3500
|
+
return config12;
|
|
3501
3501
|
};
|
|
3502
3502
|
}
|
|
3503
3503
|
});
|
|
@@ -3581,22 +3581,22 @@ var require_Axios = __commonJS({
|
|
|
3581
3581
|
response: new InterceptorManager2()
|
|
3582
3582
|
};
|
|
3583
3583
|
}
|
|
3584
|
-
Axios3.prototype.request = function request3(configOrUrl,
|
|
3584
|
+
Axios3.prototype.request = function request3(configOrUrl, config12) {
|
|
3585
3585
|
if (typeof configOrUrl === "string") {
|
|
3586
|
-
|
|
3587
|
-
|
|
3586
|
+
config12 = config12 || {};
|
|
3587
|
+
config12.url = configOrUrl;
|
|
3588
3588
|
} else {
|
|
3589
|
-
|
|
3589
|
+
config12 = configOrUrl || {};
|
|
3590
3590
|
}
|
|
3591
|
-
|
|
3592
|
-
if (
|
|
3593
|
-
|
|
3591
|
+
config12 = mergeConfig3(this.defaults, config12);
|
|
3592
|
+
if (config12.method) {
|
|
3593
|
+
config12.method = config12.method.toLowerCase();
|
|
3594
3594
|
} else if (this.defaults.method) {
|
|
3595
|
-
|
|
3595
|
+
config12.method = this.defaults.method.toLowerCase();
|
|
3596
3596
|
} else {
|
|
3597
|
-
|
|
3597
|
+
config12.method = "get";
|
|
3598
3598
|
}
|
|
3599
|
-
var transitional2 =
|
|
3599
|
+
var transitional2 = config12.transitional;
|
|
3600
3600
|
if (transitional2 !== void 0) {
|
|
3601
3601
|
validator.assertOptions(transitional2, {
|
|
3602
3602
|
silentJSONParsing: validators3.transitional(validators3.boolean),
|
|
@@ -3607,7 +3607,7 @@ var require_Axios = __commonJS({
|
|
|
3607
3607
|
var requestInterceptorChain = [];
|
|
3608
3608
|
var synchronousRequestInterceptors = true;
|
|
3609
3609
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
3610
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(
|
|
3610
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config12) === false) {
|
|
3611
3611
|
return;
|
|
3612
3612
|
}
|
|
3613
3613
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
@@ -3622,13 +3622,13 @@ var require_Axios = __commonJS({
|
|
|
3622
3622
|
var chain = [dispatchRequest2, void 0];
|
|
3623
3623
|
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
3624
3624
|
chain = chain.concat(responseInterceptorChain);
|
|
3625
|
-
promise = Promise.resolve(
|
|
3625
|
+
promise = Promise.resolve(config12);
|
|
3626
3626
|
while (chain.length) {
|
|
3627
3627
|
promise = promise.then(chain.shift(), chain.shift());
|
|
3628
3628
|
}
|
|
3629
3629
|
return promise;
|
|
3630
3630
|
}
|
|
3631
|
-
var newConfig =
|
|
3631
|
+
var newConfig = config12;
|
|
3632
3632
|
while (requestInterceptorChain.length) {
|
|
3633
3633
|
var onFulfilled = requestInterceptorChain.shift();
|
|
3634
3634
|
var onRejected = requestInterceptorChain.shift();
|
|
@@ -3649,22 +3649,22 @@ var require_Axios = __commonJS({
|
|
|
3649
3649
|
}
|
|
3650
3650
|
return promise;
|
|
3651
3651
|
};
|
|
3652
|
-
Axios3.prototype.getUri = function getUri(
|
|
3653
|
-
|
|
3654
|
-
return buildURL2(
|
|
3652
|
+
Axios3.prototype.getUri = function getUri(config12) {
|
|
3653
|
+
config12 = mergeConfig3(this.defaults, config12);
|
|
3654
|
+
return buildURL2(config12.url, config12.params, config12.paramsSerializer).replace(/^\?/, "");
|
|
3655
3655
|
};
|
|
3656
3656
|
utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
3657
|
-
Axios3.prototype[method] = function(url2,
|
|
3658
|
-
return this.request(mergeConfig3(
|
|
3657
|
+
Axios3.prototype[method] = function(url2, config12) {
|
|
3658
|
+
return this.request(mergeConfig3(config12 || {}, {
|
|
3659
3659
|
method,
|
|
3660
3660
|
url: url2,
|
|
3661
|
-
data: (
|
|
3661
|
+
data: (config12 || {}).data
|
|
3662
3662
|
}));
|
|
3663
3663
|
};
|
|
3664
3664
|
});
|
|
3665
3665
|
utils.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
3666
|
-
Axios3.prototype[method] = function(url2, data,
|
|
3667
|
-
return this.request(mergeConfig3(
|
|
3666
|
+
Axios3.prototype[method] = function(url2, data, config12) {
|
|
3667
|
+
return this.request(mergeConfig3(config12 || {}, {
|
|
3668
3668
|
method,
|
|
3669
3669
|
url: url2,
|
|
3670
3670
|
data
|
|
@@ -14799,7 +14799,7 @@ var require_main = __commonJS({
|
|
|
14799
14799
|
return { parsed: parsedAll };
|
|
14800
14800
|
}
|
|
14801
14801
|
}
|
|
14802
|
-
function
|
|
14802
|
+
function config12(options) {
|
|
14803
14803
|
if (_dotenvKey(options).length === 0) {
|
|
14804
14804
|
return DotenvModule.configDotenv(options);
|
|
14805
14805
|
}
|
|
@@ -14866,7 +14866,7 @@ var require_main = __commonJS({
|
|
|
14866
14866
|
configDotenv,
|
|
14867
14867
|
_configVault,
|
|
14868
14868
|
_parseVault,
|
|
14869
|
-
config:
|
|
14869
|
+
config: config12,
|
|
14870
14870
|
decrypt,
|
|
14871
14871
|
parse,
|
|
14872
14872
|
populate
|
|
@@ -28111,7 +28111,7 @@ function G3(t2, e3) {
|
|
|
28111
28111
|
// package.json
|
|
28112
28112
|
var package_default = {
|
|
28113
28113
|
name: "opencommit",
|
|
28114
|
-
version: "3.0.
|
|
28114
|
+
version: "3.0.18",
|
|
28115
28115
|
description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}",
|
|
28116
28116
|
keywords: [
|
|
28117
28117
|
"git",
|
|
@@ -28209,6 +28209,9 @@ var package_default = {
|
|
|
28209
28209
|
ini: "^3.0.1",
|
|
28210
28210
|
inquirer: "^9.1.4",
|
|
28211
28211
|
openai: "^3.2.1"
|
|
28212
|
+
},
|
|
28213
|
+
overrides: {
|
|
28214
|
+
"whatwg-url": "13.0.0"
|
|
28212
28215
|
}
|
|
28213
28216
|
};
|
|
28214
28217
|
|
|
@@ -30567,8 +30570,8 @@ var vi_VN_default = {
|
|
|
30567
30570
|
// src/i18n/zh_CN.json
|
|
30568
30571
|
var zh_CN_default = {
|
|
30569
30572
|
localLanguage: "\u7B80\u4F53\u4E2D\u6587",
|
|
30570
|
-
commitFix: "
|
|
30571
|
-
commitFeat: "
|
|
30573
|
+
commitFix: "fix(server.ts)\uFF1A\u5C06\u7AEF\u53E3\u53D8\u91CF\u4ECE\u5C0F\u5199port\u6539\u4E3A\u5927\u5199PORT",
|
|
30574
|
+
commitFeat: "feat(server.ts)\uFF1A\u6DFB\u52A0\u5BF9process.env.PORT\u73AF\u5883\u53D8\u91CF\u7684\u652F\u6301",
|
|
30572
30575
|
commitDescription: "\u73B0\u5728\u7AEF\u53E3\u53D8\u91CF\u88AB\u547D\u540D\u4E3APORT\uFF0C\u8FD9\u63D0\u9AD8\u4E86\u547D\u540D\u7EA6\u5B9A\u7684\u4E00\u81F4\u6027\uFF0C\u56E0\u4E3APORT\u662F\u4E00\u4E2A\u5E38\u91CF\u3002\u73AF\u5883\u53D8\u91CF\u7684\u652F\u6301\u4F7F\u5E94\u7528\u7A0B\u5E8F\u66F4\u52A0\u7075\u6D3B\uFF0C\u56E0\u4E3A\u5B83\u73B0\u5728\u53EF\u4EE5\u901A\u8FC7process.env.PORT\u73AF\u5883\u53D8\u91CF\u5728\u4EFB\u4F55\u53EF\u7528\u7AEF\u53E3\u4E0A\u8FD0\u884C\u3002"
|
|
30573
30576
|
};
|
|
30574
30577
|
|
|
@@ -30640,8 +30643,8 @@ var TEST_MOCK_TYPES = [
|
|
|
30640
30643
|
];
|
|
30641
30644
|
var TestAi = class {
|
|
30642
30645
|
async generateCommitMessage(_messages) {
|
|
30643
|
-
const
|
|
30644
|
-
switch (
|
|
30646
|
+
const config12 = getConfig();
|
|
30647
|
+
switch (config12?.OCO_TEST_MOCK_TYPE) {
|
|
30645
30648
|
case "commit-message":
|
|
30646
30649
|
return "fix(testAi.ts): test commit message";
|
|
30647
30650
|
case "prompt-module-commitlint-config":
|
|
@@ -30722,47 +30725,55 @@ var validateConfig = (key, condition, validationMessage) => {
|
|
|
30722
30725
|
}
|
|
30723
30726
|
};
|
|
30724
30727
|
var configValidators = {
|
|
30725
|
-
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value,
|
|
30726
|
-
if (
|
|
30728
|
+
["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config12 = {}) {
|
|
30729
|
+
if (config12.OCO_AI_PROVIDER == "gemini")
|
|
30727
30730
|
return value;
|
|
30728
30731
|
validateConfig(
|
|
30729
30732
|
"OpenAI API_KEY",
|
|
30730
|
-
value ||
|
|
30733
|
+
value || config12.OCO_ANTHROPIC_API_KEY || config12.OCO_AI_PROVIDER.startsWith("ollama") || config12.OCO_AZURE_API_KEY || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
|
|
30731
30734
|
"You need to provide an OpenAI/Anthropic/Azure API key"
|
|
30732
30735
|
);
|
|
30733
30736
|
validateConfig(
|
|
30734
30737
|
"OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */,
|
|
30735
|
-
value.startsWith("sk-") ||
|
|
30738
|
+
value.startsWith("sk-") || config12.OCO_AI_PROVIDER != "openai",
|
|
30736
30739
|
'Must start with "sk-" for openai provider'
|
|
30737
30740
|
);
|
|
30738
30741
|
return value;
|
|
30739
30742
|
},
|
|
30740
|
-
["OCO_AZURE_API_KEY" /* OCO_AZURE_API_KEY */](value,
|
|
30743
|
+
["OCO_AZURE_API_KEY" /* OCO_AZURE_API_KEY */](value, config12 = {}) {
|
|
30741
30744
|
validateConfig(
|
|
30742
30745
|
"ANTHROPIC_API_KEY",
|
|
30743
|
-
value ||
|
|
30746
|
+
value || config12.OCO_OPENAI_API_KEY || config12.OCO_AZURE_API_KEY || config12.OCO_AI_PROVIDER == "ollama" || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
|
|
30744
30747
|
"You need to provide an OpenAI/Anthropic/Azure API key"
|
|
30745
30748
|
);
|
|
30746
30749
|
return value;
|
|
30747
30750
|
},
|
|
30748
|
-
["OCO_GEMINI_API_KEY" /* OCO_GEMINI_API_KEY */](value,
|
|
30749
|
-
if (
|
|
30751
|
+
["OCO_GEMINI_API_KEY" /* OCO_GEMINI_API_KEY */](value, config12 = {}) {
|
|
30752
|
+
if (config12.OCO_AI_PROVIDER != "gemini")
|
|
30750
30753
|
return value;
|
|
30751
30754
|
validateConfig(
|
|
30752
30755
|
"Gemini API Key",
|
|
30753
|
-
value ||
|
|
30756
|
+
value || config12.OCO_GEMINI_API_KEY || config12.OCO_AI_PROVIDER == "test",
|
|
30754
30757
|
"You need to provide an Gemini API key"
|
|
30755
30758
|
);
|
|
30756
30759
|
return value;
|
|
30757
30760
|
},
|
|
30758
|
-
["OCO_ANTHROPIC_API_KEY" /* OCO_ANTHROPIC_API_KEY */](value,
|
|
30761
|
+
["OCO_ANTHROPIC_API_KEY" /* OCO_ANTHROPIC_API_KEY */](value, config12 = {}) {
|
|
30759
30762
|
validateConfig(
|
|
30760
30763
|
"ANTHROPIC_API_KEY",
|
|
30761
|
-
value ||
|
|
30764
|
+
value || config12.OCO_OPENAI_API_KEY || config12.OCO_AI_PROVIDER == "ollama" || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
|
|
30762
30765
|
"You need to provide an OpenAI/Anthropic API key"
|
|
30763
30766
|
);
|
|
30764
30767
|
return value;
|
|
30765
30768
|
},
|
|
30769
|
+
["OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */](value, config12 = {}) {
|
|
30770
|
+
validateConfig(
|
|
30771
|
+
"OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */,
|
|
30772
|
+
value || config12.OCO_AI_PROVIDER != "flowise",
|
|
30773
|
+
"You need to provide a flowise API key"
|
|
30774
|
+
);
|
|
30775
|
+
return value;
|
|
30776
|
+
},
|
|
30766
30777
|
["OCO_DESCRIPTION" /* OCO_DESCRIPTION */](value) {
|
|
30767
30778
|
validateConfig(
|
|
30768
30779
|
"OCO_DESCRIPTION" /* OCO_DESCRIPTION */,
|
|
@@ -30827,14 +30838,14 @@ var configValidators = {
|
|
|
30827
30838
|
);
|
|
30828
30839
|
return value;
|
|
30829
30840
|
},
|
|
30830
|
-
["OCO_MODEL" /* OCO_MODEL */](value,
|
|
30841
|
+
["OCO_MODEL" /* OCO_MODEL */](value, config12 = {}) {
|
|
30831
30842
|
validateConfig(
|
|
30832
30843
|
"OCO_MODEL" /* OCO_MODEL */,
|
|
30833
30844
|
[
|
|
30834
30845
|
...MODEL_LIST.openai,
|
|
30835
30846
|
...MODEL_LIST.anthropic,
|
|
30836
30847
|
...MODEL_LIST.gemini
|
|
30837
|
-
].includes(value) ||
|
|
30848
|
+
].includes(value) || config12.OCO_AI_PROVIDER == "ollama" || config12.OCO_AI_PROVIDER == "azure" || config12.OCO_AI_PROVIDER == "test" || config12.OCO_AI_PROVIDER == "flowise",
|
|
30838
30849
|
`${value} is not supported yet, use:
|
|
30839
30850
|
|
|
30840
30851
|
${[
|
|
@@ -30872,8 +30883,16 @@ var configValidators = {
|
|
|
30872
30883
|
["OCO_AI_PROVIDER" /* OCO_AI_PROVIDER */](value) {
|
|
30873
30884
|
validateConfig(
|
|
30874
30885
|
"OCO_AI_PROVIDER" /* OCO_AI_PROVIDER */,
|
|
30875
|
-
[
|
|
30876
|
-
|
|
30886
|
+
[
|
|
30887
|
+
"",
|
|
30888
|
+
"openai",
|
|
30889
|
+
"anthropic",
|
|
30890
|
+
"gemini",
|
|
30891
|
+
"azure",
|
|
30892
|
+
"test",
|
|
30893
|
+
"flowise"
|
|
30894
|
+
].includes(value) || value.startsWith("ollama"),
|
|
30895
|
+
`${value} is not supported yet, use 'ollama', 'anthropic', 'azure', 'gemini', 'flowise' or 'openai' (default)`
|
|
30877
30896
|
);
|
|
30878
30897
|
return value;
|
|
30879
30898
|
},
|
|
@@ -30893,6 +30912,14 @@ var configValidators = {
|
|
|
30893
30912
|
);
|
|
30894
30913
|
return value;
|
|
30895
30914
|
},
|
|
30915
|
+
["OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */](value) {
|
|
30916
|
+
validateConfig(
|
|
30917
|
+
"OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */,
|
|
30918
|
+
typeof value === "string" && value.includes(":"),
|
|
30919
|
+
"Value must be string and should include both I.P. and port number"
|
|
30920
|
+
);
|
|
30921
|
+
return value;
|
|
30922
|
+
},
|
|
30896
30923
|
["OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */](value) {
|
|
30897
30924
|
validateConfig(
|
|
30898
30925
|
"OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */,
|
|
@@ -30937,26 +30964,29 @@ var getConfig = ({
|
|
|
30937
30964
|
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai",
|
|
30938
30965
|
OCO_GITPUSH: process.env.OCO_GITPUSH === "false" ? false : true,
|
|
30939
30966
|
OCO_ONE_LINE_COMMIT: process.env.OCO_ONE_LINE_COMMIT === "true" ? true : false,
|
|
30940
|
-
OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT ||
|
|
30941
|
-
OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE || "commit-message"
|
|
30967
|
+
OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT || void 0,
|
|
30968
|
+
OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE || "commit-message",
|
|
30969
|
+
OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT || ":",
|
|
30970
|
+
OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY || void 0,
|
|
30971
|
+
OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL || void 0
|
|
30942
30972
|
};
|
|
30943
30973
|
const configExists = (0, import_fs.existsSync)(configPath);
|
|
30944
30974
|
if (!configExists)
|
|
30945
30975
|
return configFromEnv;
|
|
30946
30976
|
const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
|
|
30947
|
-
const
|
|
30948
|
-
for (const configKey of Object.keys(
|
|
30949
|
-
if (["null", "undefined"].includes(
|
|
30950
|
-
|
|
30977
|
+
const config12 = (0, import_ini.parse)(configFile);
|
|
30978
|
+
for (const configKey of Object.keys(config12)) {
|
|
30979
|
+
if (["null", "undefined"].includes(config12[configKey])) {
|
|
30980
|
+
config12[configKey] = void 0;
|
|
30951
30981
|
continue;
|
|
30952
30982
|
}
|
|
30953
30983
|
try {
|
|
30954
30984
|
const validator = configValidators[configKey];
|
|
30955
30985
|
const validValue = validator(
|
|
30956
|
-
|
|
30957
|
-
|
|
30986
|
+
config12[configKey] ?? configFromEnv[configKey],
|
|
30987
|
+
config12
|
|
30958
30988
|
);
|
|
30959
|
-
|
|
30989
|
+
config12[configKey] = validValue;
|
|
30960
30990
|
} catch (error) {
|
|
30961
30991
|
ce(`Unknown '${configKey}' config option or missing validator.`);
|
|
30962
30992
|
ce(
|
|
@@ -30965,10 +30995,10 @@ var getConfig = ({
|
|
|
30965
30995
|
process.exit(1);
|
|
30966
30996
|
}
|
|
30967
30997
|
}
|
|
30968
|
-
return
|
|
30998
|
+
return config12;
|
|
30969
30999
|
};
|
|
30970
31000
|
var setConfig = (keyValues, configPath = defaultConfigPath) => {
|
|
30971
|
-
const
|
|
31001
|
+
const config12 = getConfig() || {};
|
|
30972
31002
|
for (const [configKey, configValue] of keyValues) {
|
|
30973
31003
|
if (!configValidators.hasOwnProperty(configKey)) {
|
|
30974
31004
|
throw new Error(`Unsupported config key: ${configKey}`);
|
|
@@ -30980,9 +31010,9 @@ var setConfig = (keyValues, configPath = defaultConfigPath) => {
|
|
|
30980
31010
|
parsedConfigValue = configValue;
|
|
30981
31011
|
}
|
|
30982
31012
|
const validValue = configValidators[configKey](parsedConfigValue);
|
|
30983
|
-
|
|
31013
|
+
config12[configKey] = validValue;
|
|
30984
31014
|
}
|
|
30985
|
-
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(
|
|
31015
|
+
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config12), "utf8");
|
|
30986
31016
|
ce(`${source_default.green("\u2714")} Config successfully set`);
|
|
30987
31017
|
};
|
|
30988
31018
|
var configCommand = G3(
|
|
@@ -30995,9 +31025,9 @@ var configCommand = G3(
|
|
|
30995
31025
|
try {
|
|
30996
31026
|
const { mode: mode4, keyValues } = argv._;
|
|
30997
31027
|
if (mode4 === "get" /* get */) {
|
|
30998
|
-
const
|
|
31028
|
+
const config12 = getConfig() || {};
|
|
30999
31029
|
for (const key of keyValues) {
|
|
31000
|
-
ce(`${key}=${
|
|
31030
|
+
ce(`${key}=${config12[key]}`);
|
|
31001
31031
|
}
|
|
31002
31032
|
} else if (mode4 === "set" /* set */) {
|
|
31003
31033
|
await setConfig(
|
|
@@ -31106,8 +31136,8 @@ var getPrompt = (ruleName, ruleConfig, prompt) => {
|
|
|
31106
31136
|
ce(`${source_default.red("\u2716")} No prompt handler for rule "${ruleName}".`);
|
|
31107
31137
|
return `Please manualy set the prompt for rule "${ruleName}".`;
|
|
31108
31138
|
};
|
|
31109
|
-
var inferPromptsFromCommitlintConfig = (
|
|
31110
|
-
const { rules, prompt } =
|
|
31139
|
+
var inferPromptsFromCommitlintConfig = (config12) => {
|
|
31140
|
+
const { rules, prompt } = config12;
|
|
31111
31141
|
if (!rules)
|
|
31112
31142
|
return [];
|
|
31113
31143
|
return Object.keys(rules).map(
|
|
@@ -31620,7 +31650,7 @@ var utils_default = {
|
|
|
31620
31650
|
};
|
|
31621
31651
|
|
|
31622
31652
|
// node_modules/axios/lib/core/AxiosError.js
|
|
31623
|
-
function AxiosError(message, code,
|
|
31653
|
+
function AxiosError(message, code, config12, request3, response) {
|
|
31624
31654
|
Error.call(this);
|
|
31625
31655
|
if (Error.captureStackTrace) {
|
|
31626
31656
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -31630,7 +31660,7 @@ function AxiosError(message, code, config11, request3, response) {
|
|
|
31630
31660
|
this.message = message;
|
|
31631
31661
|
this.name = "AxiosError";
|
|
31632
31662
|
code && (this.code = code);
|
|
31633
|
-
|
|
31663
|
+
config12 && (this.config = config12);
|
|
31634
31664
|
request3 && (this.request = request3);
|
|
31635
31665
|
response && (this.response = response);
|
|
31636
31666
|
}
|
|
@@ -31671,14 +31701,14 @@ var descriptors2 = {};
|
|
|
31671
31701
|
});
|
|
31672
31702
|
Object.defineProperties(AxiosError, descriptors2);
|
|
31673
31703
|
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
31674
|
-
AxiosError.from = (error, code,
|
|
31704
|
+
AxiosError.from = (error, code, config12, request3, response, customProps) => {
|
|
31675
31705
|
const axiosError = Object.create(prototype);
|
|
31676
31706
|
utils_default.toFlatObject(error, axiosError, function filter2(obj) {
|
|
31677
31707
|
return obj !== Error.prototype;
|
|
31678
31708
|
}, (prop) => {
|
|
31679
31709
|
return prop !== "isAxiosError";
|
|
31680
31710
|
});
|
|
31681
|
-
AxiosError.call(axiosError, error.message, code,
|
|
31711
|
+
AxiosError.call(axiosError, error.message, code, config12, request3, response);
|
|
31682
31712
|
axiosError.cause = error;
|
|
31683
31713
|
axiosError.name = error.name;
|
|
31684
31714
|
customProps && Object.assign(axiosError, customProps);
|
|
@@ -32374,12 +32404,12 @@ var AxiosHeaders_default = AxiosHeaders;
|
|
|
32374
32404
|
|
|
32375
32405
|
// node_modules/axios/lib/core/transformData.js
|
|
32376
32406
|
function transformData(fns, response) {
|
|
32377
|
-
const
|
|
32378
|
-
const context = response ||
|
|
32407
|
+
const config12 = this || defaults_default;
|
|
32408
|
+
const context = response || config12;
|
|
32379
32409
|
const headers = AxiosHeaders_default.from(context.headers);
|
|
32380
32410
|
let data = context.data;
|
|
32381
32411
|
utils_default.forEach(fns, function transform(fn) {
|
|
32382
|
-
data = fn.call(
|
|
32412
|
+
data = fn.call(config12, data, headers.normalize(), response ? response.status : void 0);
|
|
32383
32413
|
});
|
|
32384
32414
|
headers.normalize();
|
|
32385
32415
|
return data;
|
|
@@ -32391,8 +32421,8 @@ function isCancel(value) {
|
|
|
32391
32421
|
}
|
|
32392
32422
|
|
|
32393
32423
|
// node_modules/axios/lib/cancel/CanceledError.js
|
|
32394
|
-
function CanceledError(message,
|
|
32395
|
-
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED,
|
|
32424
|
+
function CanceledError(message, config12, request3) {
|
|
32425
|
+
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config12, request3);
|
|
32396
32426
|
this.name = "CanceledError";
|
|
32397
32427
|
}
|
|
32398
32428
|
utils_default.inherits(CanceledError, AxiosError_default, {
|
|
@@ -32924,11 +32954,11 @@ var resolveFamily = ({ address, family }) => {
|
|
|
32924
32954
|
};
|
|
32925
32955
|
};
|
|
32926
32956
|
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
32927
|
-
var http_default = isHttpAdapterSupported && function httpAdapter(
|
|
32957
|
+
var http_default = isHttpAdapterSupported && function httpAdapter(config12) {
|
|
32928
32958
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
32929
|
-
let { data, lookup, family } =
|
|
32930
|
-
const { responseType, responseEncoding } =
|
|
32931
|
-
const method =
|
|
32959
|
+
let { data, lookup, family } = config12;
|
|
32960
|
+
const { responseType, responseEncoding } = config12;
|
|
32961
|
+
const method = config12.method.toUpperCase();
|
|
32932
32962
|
let isDone;
|
|
32933
32963
|
let rejected = false;
|
|
32934
32964
|
let req;
|
|
@@ -32946,11 +32976,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32946
32976
|
}
|
|
32947
32977
|
const emitter = new import_events.EventEmitter();
|
|
32948
32978
|
const onFinished = () => {
|
|
32949
|
-
if (
|
|
32950
|
-
|
|
32979
|
+
if (config12.cancelToken) {
|
|
32980
|
+
config12.cancelToken.unsubscribe(abort);
|
|
32951
32981
|
}
|
|
32952
|
-
if (
|
|
32953
|
-
|
|
32982
|
+
if (config12.signal) {
|
|
32983
|
+
config12.signal.removeEventListener("abort", abort);
|
|
32954
32984
|
}
|
|
32955
32985
|
emitter.removeAllListeners();
|
|
32956
32986
|
};
|
|
@@ -32962,16 +32992,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32962
32992
|
}
|
|
32963
32993
|
});
|
|
32964
32994
|
function abort(reason) {
|
|
32965
|
-
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null,
|
|
32995
|
+
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config12, req) : reason);
|
|
32966
32996
|
}
|
|
32967
32997
|
emitter.once("abort", reject);
|
|
32968
|
-
if (
|
|
32969
|
-
|
|
32970
|
-
if (
|
|
32971
|
-
|
|
32998
|
+
if (config12.cancelToken || config12.signal) {
|
|
32999
|
+
config12.cancelToken && config12.cancelToken.subscribe(abort);
|
|
33000
|
+
if (config12.signal) {
|
|
33001
|
+
config12.signal.aborted ? abort() : config12.signal.addEventListener("abort", abort);
|
|
32972
33002
|
}
|
|
32973
33003
|
}
|
|
32974
|
-
const fullPath = buildFullPath(
|
|
33004
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
32975
33005
|
const parsed = new URL(fullPath, "http://localhost");
|
|
32976
33006
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
32977
33007
|
if (protocol === "data:") {
|
|
@@ -32981,15 +33011,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32981
33011
|
status: 405,
|
|
32982
33012
|
statusText: "method not allowed",
|
|
32983
33013
|
headers: {},
|
|
32984
|
-
config:
|
|
33014
|
+
config: config12
|
|
32985
33015
|
});
|
|
32986
33016
|
}
|
|
32987
33017
|
try {
|
|
32988
|
-
convertedData = fromDataURI(
|
|
32989
|
-
Blob:
|
|
33018
|
+
convertedData = fromDataURI(config12.url, responseType === "blob", {
|
|
33019
|
+
Blob: config12.env && config12.env.Blob
|
|
32990
33020
|
});
|
|
32991
33021
|
} catch (err) {
|
|
32992
|
-
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST,
|
|
33022
|
+
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config12);
|
|
32993
33023
|
}
|
|
32994
33024
|
if (responseType === "text") {
|
|
32995
33025
|
convertedData = convertedData.toString(responseEncoding);
|
|
@@ -33004,21 +33034,21 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33004
33034
|
status: 200,
|
|
33005
33035
|
statusText: "OK",
|
|
33006
33036
|
headers: new AxiosHeaders_default(),
|
|
33007
|
-
config:
|
|
33037
|
+
config: config12
|
|
33008
33038
|
});
|
|
33009
33039
|
}
|
|
33010
33040
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
33011
33041
|
return reject(new AxiosError_default(
|
|
33012
33042
|
"Unsupported protocol " + protocol,
|
|
33013
33043
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33014
|
-
|
|
33044
|
+
config12
|
|
33015
33045
|
));
|
|
33016
33046
|
}
|
|
33017
|
-
const headers = AxiosHeaders_default.from(
|
|
33047
|
+
const headers = AxiosHeaders_default.from(config12.headers).normalize();
|
|
33018
33048
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
33019
|
-
const onDownloadProgress =
|
|
33020
|
-
const onUploadProgress =
|
|
33021
|
-
const maxRate =
|
|
33049
|
+
const onDownloadProgress = config12.onDownloadProgress;
|
|
33050
|
+
const onUploadProgress = config12.onUploadProgress;
|
|
33051
|
+
const maxRate = config12.maxRate;
|
|
33022
33052
|
let maxUploadRate = void 0;
|
|
33023
33053
|
let maxDownloadRate = void 0;
|
|
33024
33054
|
if (utils_default.isSpecCompliantForm(data)) {
|
|
@@ -33052,15 +33082,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33052
33082
|
return reject(new AxiosError_default(
|
|
33053
33083
|
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
33054
33084
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33055
|
-
|
|
33085
|
+
config12
|
|
33056
33086
|
));
|
|
33057
33087
|
}
|
|
33058
33088
|
headers.setContentLength(data.length, false);
|
|
33059
|
-
if (
|
|
33089
|
+
if (config12.maxBodyLength > -1 && data.length > config12.maxBodyLength) {
|
|
33060
33090
|
return reject(new AxiosError_default(
|
|
33061
33091
|
"Request body larger than maxBodyLength limit",
|
|
33062
33092
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33063
|
-
|
|
33093
|
+
config12
|
|
33064
33094
|
));
|
|
33065
33095
|
}
|
|
33066
33096
|
}
|
|
@@ -33086,9 +33116,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33086
33116
|
});
|
|
33087
33117
|
}
|
|
33088
33118
|
let auth = void 0;
|
|
33089
|
-
if (
|
|
33090
|
-
const username =
|
|
33091
|
-
const password =
|
|
33119
|
+
if (config12.auth) {
|
|
33120
|
+
const username = config12.auth.username || "";
|
|
33121
|
+
const password = config12.auth.password || "";
|
|
33092
33122
|
auth = username + ":" + password;
|
|
33093
33123
|
}
|
|
33094
33124
|
if (!auth && parsed.username) {
|
|
@@ -33101,13 +33131,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33101
33131
|
try {
|
|
33102
33132
|
path5 = buildURL(
|
|
33103
33133
|
parsed.pathname + parsed.search,
|
|
33104
|
-
|
|
33105
|
-
|
|
33134
|
+
config12.params,
|
|
33135
|
+
config12.paramsSerializer
|
|
33106
33136
|
).replace(/^\?/, "");
|
|
33107
33137
|
} catch (err) {
|
|
33108
33138
|
const customErr = new Error(err.message);
|
|
33109
|
-
customErr.config =
|
|
33110
|
-
customErr.url =
|
|
33139
|
+
customErr.config = config12;
|
|
33140
|
+
customErr.url = config12.url;
|
|
33111
33141
|
customErr.exists = true;
|
|
33112
33142
|
return reject(customErr);
|
|
33113
33143
|
}
|
|
@@ -33120,7 +33150,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33120
33150
|
path: path5,
|
|
33121
33151
|
method,
|
|
33122
33152
|
headers: headers.toJSON(),
|
|
33123
|
-
agents: { http:
|
|
33153
|
+
agents: { http: config12.httpAgent, https: config12.httpsAgent },
|
|
33124
33154
|
auth,
|
|
33125
33155
|
protocol,
|
|
33126
33156
|
family,
|
|
@@ -33128,36 +33158,36 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33128
33158
|
beforeRedirects: {}
|
|
33129
33159
|
};
|
|
33130
33160
|
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
33131
|
-
if (
|
|
33132
|
-
options.socketPath =
|
|
33161
|
+
if (config12.socketPath) {
|
|
33162
|
+
options.socketPath = config12.socketPath;
|
|
33133
33163
|
} else {
|
|
33134
33164
|
options.hostname = parsed.hostname;
|
|
33135
33165
|
options.port = parsed.port;
|
|
33136
|
-
setProxy(options,
|
|
33166
|
+
setProxy(options, config12.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
33137
33167
|
}
|
|
33138
33168
|
let transport;
|
|
33139
33169
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
33140
|
-
options.agent = isHttpsRequest ?
|
|
33141
|
-
if (
|
|
33142
|
-
transport =
|
|
33143
|
-
} else if (
|
|
33170
|
+
options.agent = isHttpsRequest ? config12.httpsAgent : config12.httpAgent;
|
|
33171
|
+
if (config12.transport) {
|
|
33172
|
+
transport = config12.transport;
|
|
33173
|
+
} else if (config12.maxRedirects === 0) {
|
|
33144
33174
|
transport = isHttpsRequest ? import_https.default : import_http.default;
|
|
33145
33175
|
} else {
|
|
33146
|
-
if (
|
|
33147
|
-
options.maxRedirects =
|
|
33176
|
+
if (config12.maxRedirects) {
|
|
33177
|
+
options.maxRedirects = config12.maxRedirects;
|
|
33148
33178
|
}
|
|
33149
|
-
if (
|
|
33150
|
-
options.beforeRedirects.config =
|
|
33179
|
+
if (config12.beforeRedirect) {
|
|
33180
|
+
options.beforeRedirects.config = config12.beforeRedirect;
|
|
33151
33181
|
}
|
|
33152
33182
|
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
33153
33183
|
}
|
|
33154
|
-
if (
|
|
33155
|
-
options.maxBodyLength =
|
|
33184
|
+
if (config12.maxBodyLength > -1) {
|
|
33185
|
+
options.maxBodyLength = config12.maxBodyLength;
|
|
33156
33186
|
} else {
|
|
33157
33187
|
options.maxBodyLength = Infinity;
|
|
33158
33188
|
}
|
|
33159
|
-
if (
|
|
33160
|
-
options.insecureHTTPParser =
|
|
33189
|
+
if (config12.insecureHTTPParser) {
|
|
33190
|
+
options.insecureHTTPParser = config12.insecureHTTPParser;
|
|
33161
33191
|
}
|
|
33162
33192
|
req = transport.request(options, function handleResponse(res) {
|
|
33163
33193
|
if (req.destroyed)
|
|
@@ -33178,7 +33208,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33178
33208
|
}
|
|
33179
33209
|
let responseStream = res;
|
|
33180
33210
|
const lastRequest = res.req || req;
|
|
33181
|
-
if (
|
|
33211
|
+
if (config12.decompress !== false && res.headers["content-encoding"]) {
|
|
33182
33212
|
if (method === "HEAD" || res.statusCode === 204) {
|
|
33183
33213
|
delete res.headers["content-encoding"];
|
|
33184
33214
|
}
|
|
@@ -33211,7 +33241,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33211
33241
|
status: res.statusCode,
|
|
33212
33242
|
statusText: res.statusMessage,
|
|
33213
33243
|
headers: new AxiosHeaders_default(res.headers),
|
|
33214
|
-
config:
|
|
33244
|
+
config: config12,
|
|
33215
33245
|
request: lastRequest
|
|
33216
33246
|
};
|
|
33217
33247
|
if (responseType === "stream") {
|
|
@@ -33223,13 +33253,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33223
33253
|
responseStream.on("data", function handleStreamData(chunk) {
|
|
33224
33254
|
responseBuffer.push(chunk);
|
|
33225
33255
|
totalResponseBytes += chunk.length;
|
|
33226
|
-
if (
|
|
33256
|
+
if (config12.maxContentLength > -1 && totalResponseBytes > config12.maxContentLength) {
|
|
33227
33257
|
rejected = true;
|
|
33228
33258
|
responseStream.destroy();
|
|
33229
33259
|
reject(new AxiosError_default(
|
|
33230
|
-
"maxContentLength size of " +
|
|
33260
|
+
"maxContentLength size of " + config12.maxContentLength + " exceeded",
|
|
33231
33261
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
33232
|
-
|
|
33262
|
+
config12,
|
|
33233
33263
|
lastRequest
|
|
33234
33264
|
));
|
|
33235
33265
|
}
|
|
@@ -33239,9 +33269,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33239
33269
|
return;
|
|
33240
33270
|
}
|
|
33241
33271
|
const err = new AxiosError_default(
|
|
33242
|
-
"maxContentLength size of " +
|
|
33272
|
+
"maxContentLength size of " + config12.maxContentLength + " exceeded",
|
|
33243
33273
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
33244
|
-
|
|
33274
|
+
config12,
|
|
33245
33275
|
lastRequest
|
|
33246
33276
|
);
|
|
33247
33277
|
responseStream.destroy(err);
|
|
@@ -33250,7 +33280,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33250
33280
|
responseStream.on("error", function handleStreamError(err) {
|
|
33251
33281
|
if (req.destroyed)
|
|
33252
33282
|
return;
|
|
33253
|
-
reject(AxiosError_default.from(err, null,
|
|
33283
|
+
reject(AxiosError_default.from(err, null, config12, lastRequest));
|
|
33254
33284
|
});
|
|
33255
33285
|
responseStream.on("end", function handleStreamEnd() {
|
|
33256
33286
|
try {
|
|
@@ -33263,7 +33293,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33263
33293
|
}
|
|
33264
33294
|
response.data = responseData;
|
|
33265
33295
|
} catch (err) {
|
|
33266
|
-
return reject(AxiosError_default.from(err, null,
|
|
33296
|
+
return reject(AxiosError_default.from(err, null, config12, response.request, response));
|
|
33267
33297
|
}
|
|
33268
33298
|
settle(resolve, reject, response);
|
|
33269
33299
|
});
|
|
@@ -33280,18 +33310,18 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33280
33310
|
req.destroy(err);
|
|
33281
33311
|
});
|
|
33282
33312
|
req.on("error", function handleRequestError(err) {
|
|
33283
|
-
reject(AxiosError_default.from(err, null,
|
|
33313
|
+
reject(AxiosError_default.from(err, null, config12, req));
|
|
33284
33314
|
});
|
|
33285
33315
|
req.on("socket", function handleRequestSocket(socket) {
|
|
33286
33316
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
33287
33317
|
});
|
|
33288
|
-
if (
|
|
33289
|
-
const timeout = parseInt(
|
|
33318
|
+
if (config12.timeout) {
|
|
33319
|
+
const timeout = parseInt(config12.timeout, 10);
|
|
33290
33320
|
if (Number.isNaN(timeout)) {
|
|
33291
33321
|
reject(new AxiosError_default(
|
|
33292
33322
|
"error trying to parse `config.timeout` to int",
|
|
33293
33323
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
33294
|
-
|
|
33324
|
+
config12,
|
|
33295
33325
|
req
|
|
33296
33326
|
));
|
|
33297
33327
|
return;
|
|
@@ -33299,15 +33329,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33299
33329
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
33300
33330
|
if (isDone)
|
|
33301
33331
|
return;
|
|
33302
|
-
let timeoutErrorMessage =
|
|
33303
|
-
const transitional2 =
|
|
33304
|
-
if (
|
|
33305
|
-
timeoutErrorMessage =
|
|
33332
|
+
let timeoutErrorMessage = config12.timeout ? "timeout of " + config12.timeout + "ms exceeded" : "timeout exceeded";
|
|
33333
|
+
const transitional2 = config12.transitional || transitional_default;
|
|
33334
|
+
if (config12.timeoutErrorMessage) {
|
|
33335
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
33306
33336
|
}
|
|
33307
33337
|
reject(new AxiosError_default(
|
|
33308
33338
|
timeoutErrorMessage,
|
|
33309
33339
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
33310
|
-
|
|
33340
|
+
config12,
|
|
33311
33341
|
req
|
|
33312
33342
|
));
|
|
33313
33343
|
abort();
|
|
@@ -33325,7 +33355,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33325
33355
|
});
|
|
33326
33356
|
data.on("close", () => {
|
|
33327
33357
|
if (!ended && !errored) {
|
|
33328
|
-
abort(new CanceledError_default("Request stream has been aborted",
|
|
33358
|
+
abort(new CanceledError_default("Request stream has been aborted", config12, req));
|
|
33329
33359
|
}
|
|
33330
33360
|
});
|
|
33331
33361
|
data.pipe(req);
|
|
@@ -33421,18 +33451,18 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
33421
33451
|
};
|
|
33422
33452
|
}
|
|
33423
33453
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
33424
|
-
var xhr_default = isXHRAdapterSupported && function(
|
|
33454
|
+
var xhr_default = isXHRAdapterSupported && function(config12) {
|
|
33425
33455
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
33426
|
-
let requestData =
|
|
33427
|
-
const requestHeaders = AxiosHeaders_default.from(
|
|
33428
|
-
let { responseType, withXSRFToken } =
|
|
33456
|
+
let requestData = config12.data;
|
|
33457
|
+
const requestHeaders = AxiosHeaders_default.from(config12.headers).normalize();
|
|
33458
|
+
let { responseType, withXSRFToken } = config12;
|
|
33429
33459
|
let onCanceled;
|
|
33430
33460
|
function done() {
|
|
33431
|
-
if (
|
|
33432
|
-
|
|
33461
|
+
if (config12.cancelToken) {
|
|
33462
|
+
config12.cancelToken.unsubscribe(onCanceled);
|
|
33433
33463
|
}
|
|
33434
|
-
if (
|
|
33435
|
-
|
|
33464
|
+
if (config12.signal) {
|
|
33465
|
+
config12.signal.removeEventListener("abort", onCanceled);
|
|
33436
33466
|
}
|
|
33437
33467
|
}
|
|
33438
33468
|
let contentType;
|
|
@@ -33445,14 +33475,14 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33445
33475
|
}
|
|
33446
33476
|
}
|
|
33447
33477
|
let request3 = new XMLHttpRequest();
|
|
33448
|
-
if (
|
|
33449
|
-
const username =
|
|
33450
|
-
const password =
|
|
33478
|
+
if (config12.auth) {
|
|
33479
|
+
const username = config12.auth.username || "";
|
|
33480
|
+
const password = config12.auth.password ? unescape(encodeURIComponent(config12.auth.password)) : "";
|
|
33451
33481
|
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
33452
33482
|
}
|
|
33453
|
-
const fullPath = buildFullPath(
|
|
33454
|
-
request3.open(
|
|
33455
|
-
request3.timeout =
|
|
33483
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
33484
|
+
request3.open(config12.method.toUpperCase(), buildURL(fullPath, config12.params, config12.paramsSerializer), true);
|
|
33485
|
+
request3.timeout = config12.timeout;
|
|
33456
33486
|
function onloadend() {
|
|
33457
33487
|
if (!request3) {
|
|
33458
33488
|
return;
|
|
@@ -33466,7 +33496,7 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33466
33496
|
status: request3.status,
|
|
33467
33497
|
statusText: request3.statusText,
|
|
33468
33498
|
headers: responseHeaders,
|
|
33469
|
-
config:
|
|
33499
|
+
config: config12,
|
|
33470
33500
|
request: request3
|
|
33471
33501
|
};
|
|
33472
33502
|
settle(function _resolve(value) {
|
|
@@ -33495,33 +33525,33 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33495
33525
|
if (!request3) {
|
|
33496
33526
|
return;
|
|
33497
33527
|
}
|
|
33498
|
-
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED,
|
|
33528
|
+
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config12, request3));
|
|
33499
33529
|
request3 = null;
|
|
33500
33530
|
};
|
|
33501
33531
|
request3.onerror = function handleError() {
|
|
33502
|
-
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK,
|
|
33532
|
+
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config12, request3));
|
|
33503
33533
|
request3 = null;
|
|
33504
33534
|
};
|
|
33505
33535
|
request3.ontimeout = function handleTimeout() {
|
|
33506
|
-
let timeoutErrorMessage =
|
|
33507
|
-
const transitional2 =
|
|
33508
|
-
if (
|
|
33509
|
-
timeoutErrorMessage =
|
|
33536
|
+
let timeoutErrorMessage = config12.timeout ? "timeout of " + config12.timeout + "ms exceeded" : "timeout exceeded";
|
|
33537
|
+
const transitional2 = config12.transitional || transitional_default;
|
|
33538
|
+
if (config12.timeoutErrorMessage) {
|
|
33539
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
33510
33540
|
}
|
|
33511
33541
|
reject(new AxiosError_default(
|
|
33512
33542
|
timeoutErrorMessage,
|
|
33513
33543
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
33514
|
-
|
|
33544
|
+
config12,
|
|
33515
33545
|
request3
|
|
33516
33546
|
));
|
|
33517
33547
|
request3 = null;
|
|
33518
33548
|
};
|
|
33519
33549
|
if (platform_default.hasStandardBrowserEnv) {
|
|
33520
|
-
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(
|
|
33550
|
+
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config12));
|
|
33521
33551
|
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
|
|
33522
|
-
const xsrfValue =
|
|
33552
|
+
const xsrfValue = config12.xsrfHeaderName && config12.xsrfCookieName && cookies_default.read(config12.xsrfCookieName);
|
|
33523
33553
|
if (xsrfValue) {
|
|
33524
|
-
requestHeaders.set(
|
|
33554
|
+
requestHeaders.set(config12.xsrfHeaderName, xsrfValue);
|
|
33525
33555
|
}
|
|
33526
33556
|
}
|
|
33527
33557
|
}
|
|
@@ -33531,35 +33561,35 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33531
33561
|
request3.setRequestHeader(key, val);
|
|
33532
33562
|
});
|
|
33533
33563
|
}
|
|
33534
|
-
if (!utils_default.isUndefined(
|
|
33535
|
-
request3.withCredentials = !!
|
|
33564
|
+
if (!utils_default.isUndefined(config12.withCredentials)) {
|
|
33565
|
+
request3.withCredentials = !!config12.withCredentials;
|
|
33536
33566
|
}
|
|
33537
33567
|
if (responseType && responseType !== "json") {
|
|
33538
|
-
request3.responseType =
|
|
33568
|
+
request3.responseType = config12.responseType;
|
|
33539
33569
|
}
|
|
33540
|
-
if (typeof
|
|
33541
|
-
request3.addEventListener("progress", progressEventReducer(
|
|
33570
|
+
if (typeof config12.onDownloadProgress === "function") {
|
|
33571
|
+
request3.addEventListener("progress", progressEventReducer(config12.onDownloadProgress, true));
|
|
33542
33572
|
}
|
|
33543
|
-
if (typeof
|
|
33544
|
-
request3.upload.addEventListener("progress", progressEventReducer(
|
|
33573
|
+
if (typeof config12.onUploadProgress === "function" && request3.upload) {
|
|
33574
|
+
request3.upload.addEventListener("progress", progressEventReducer(config12.onUploadProgress));
|
|
33545
33575
|
}
|
|
33546
|
-
if (
|
|
33576
|
+
if (config12.cancelToken || config12.signal) {
|
|
33547
33577
|
onCanceled = (cancel) => {
|
|
33548
33578
|
if (!request3) {
|
|
33549
33579
|
return;
|
|
33550
33580
|
}
|
|
33551
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null,
|
|
33581
|
+
reject(!cancel || cancel.type ? new CanceledError_default(null, config12, request3) : cancel);
|
|
33552
33582
|
request3.abort();
|
|
33553
33583
|
request3 = null;
|
|
33554
33584
|
};
|
|
33555
|
-
|
|
33556
|
-
if (
|
|
33557
|
-
|
|
33585
|
+
config12.cancelToken && config12.cancelToken.subscribe(onCanceled);
|
|
33586
|
+
if (config12.signal) {
|
|
33587
|
+
config12.signal.aborted ? onCanceled() : config12.signal.addEventListener("abort", onCanceled);
|
|
33558
33588
|
}
|
|
33559
33589
|
}
|
|
33560
33590
|
const protocol = parseProtocol(fullPath);
|
|
33561
33591
|
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
33562
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST,
|
|
33592
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config12));
|
|
33563
33593
|
return;
|
|
33564
33594
|
}
|
|
33565
33595
|
request3.send(requestData || null);
|
|
@@ -33620,41 +33650,41 @@ var adapters_default = {
|
|
|
33620
33650
|
};
|
|
33621
33651
|
|
|
33622
33652
|
// node_modules/axios/lib/core/dispatchRequest.js
|
|
33623
|
-
function throwIfCancellationRequested(
|
|
33624
|
-
if (
|
|
33625
|
-
|
|
33653
|
+
function throwIfCancellationRequested(config12) {
|
|
33654
|
+
if (config12.cancelToken) {
|
|
33655
|
+
config12.cancelToken.throwIfRequested();
|
|
33626
33656
|
}
|
|
33627
|
-
if (
|
|
33628
|
-
throw new CanceledError_default(null,
|
|
33657
|
+
if (config12.signal && config12.signal.aborted) {
|
|
33658
|
+
throw new CanceledError_default(null, config12);
|
|
33629
33659
|
}
|
|
33630
33660
|
}
|
|
33631
|
-
function dispatchRequest(
|
|
33632
|
-
throwIfCancellationRequested(
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
33636
|
-
|
|
33661
|
+
function dispatchRequest(config12) {
|
|
33662
|
+
throwIfCancellationRequested(config12);
|
|
33663
|
+
config12.headers = AxiosHeaders_default.from(config12.headers);
|
|
33664
|
+
config12.data = transformData.call(
|
|
33665
|
+
config12,
|
|
33666
|
+
config12.transformRequest
|
|
33637
33667
|
);
|
|
33638
|
-
if (["post", "put", "patch"].indexOf(
|
|
33639
|
-
|
|
33668
|
+
if (["post", "put", "patch"].indexOf(config12.method) !== -1) {
|
|
33669
|
+
config12.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
33640
33670
|
}
|
|
33641
|
-
const adapter = adapters_default.getAdapter(
|
|
33642
|
-
return adapter(
|
|
33643
|
-
throwIfCancellationRequested(
|
|
33671
|
+
const adapter = adapters_default.getAdapter(config12.adapter || defaults_default.adapter);
|
|
33672
|
+
return adapter(config12).then(function onAdapterResolution(response) {
|
|
33673
|
+
throwIfCancellationRequested(config12);
|
|
33644
33674
|
response.data = transformData.call(
|
|
33645
|
-
|
|
33646
|
-
|
|
33675
|
+
config12,
|
|
33676
|
+
config12.transformResponse,
|
|
33647
33677
|
response
|
|
33648
33678
|
);
|
|
33649
33679
|
response.headers = AxiosHeaders_default.from(response.headers);
|
|
33650
33680
|
return response;
|
|
33651
33681
|
}, function onAdapterRejection(reason) {
|
|
33652
33682
|
if (!isCancel(reason)) {
|
|
33653
|
-
throwIfCancellationRequested(
|
|
33683
|
+
throwIfCancellationRequested(config12);
|
|
33654
33684
|
if (reason && reason.response) {
|
|
33655
33685
|
reason.response.data = transformData.call(
|
|
33656
|
-
|
|
33657
|
-
|
|
33686
|
+
config12,
|
|
33687
|
+
config12.transformResponse,
|
|
33658
33688
|
reason.response
|
|
33659
33689
|
);
|
|
33660
33690
|
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
@@ -33668,7 +33698,7 @@ function dispatchRequest(config11) {
|
|
|
33668
33698
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
|
|
33669
33699
|
function mergeConfig(config1, config22) {
|
|
33670
33700
|
config22 = config22 || {};
|
|
33671
|
-
const
|
|
33701
|
+
const config12 = {};
|
|
33672
33702
|
function getMergedValue(target, source, caseless) {
|
|
33673
33703
|
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
33674
33704
|
return utils_default.merge.call({ caseless }, target, source);
|
|
@@ -33739,9 +33769,9 @@ function mergeConfig(config1, config22) {
|
|
|
33739
33769
|
utils_default.forEach(Object.keys(Object.assign({}, config1, config22)), function computeConfigValue(prop) {
|
|
33740
33770
|
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
33741
33771
|
const configValue = merge2(config1[prop], config22[prop], prop);
|
|
33742
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (
|
|
33772
|
+
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config12[prop] = configValue);
|
|
33743
33773
|
});
|
|
33744
|
-
return
|
|
33774
|
+
return config12;
|
|
33745
33775
|
}
|
|
33746
33776
|
|
|
33747
33777
|
// node_modules/axios/lib/helpers/validator.js
|
|
@@ -33812,9 +33842,9 @@ var Axios = class {
|
|
|
33812
33842
|
response: new InterceptorManager_default()
|
|
33813
33843
|
};
|
|
33814
33844
|
}
|
|
33815
|
-
async request(configOrUrl,
|
|
33845
|
+
async request(configOrUrl, config12) {
|
|
33816
33846
|
try {
|
|
33817
|
-
return await this._request(configOrUrl,
|
|
33847
|
+
return await this._request(configOrUrl, config12);
|
|
33818
33848
|
} catch (err) {
|
|
33819
33849
|
if (err instanceof Error) {
|
|
33820
33850
|
let dummy;
|
|
@@ -33829,15 +33859,15 @@ var Axios = class {
|
|
|
33829
33859
|
throw err;
|
|
33830
33860
|
}
|
|
33831
33861
|
}
|
|
33832
|
-
_request(configOrUrl,
|
|
33862
|
+
_request(configOrUrl, config12) {
|
|
33833
33863
|
if (typeof configOrUrl === "string") {
|
|
33834
|
-
|
|
33835
|
-
|
|
33864
|
+
config12 = config12 || {};
|
|
33865
|
+
config12.url = configOrUrl;
|
|
33836
33866
|
} else {
|
|
33837
|
-
|
|
33867
|
+
config12 = configOrUrl || {};
|
|
33838
33868
|
}
|
|
33839
|
-
|
|
33840
|
-
const { transitional: transitional2, paramsSerializer, headers } =
|
|
33869
|
+
config12 = mergeConfig(this.defaults, config12);
|
|
33870
|
+
const { transitional: transitional2, paramsSerializer, headers } = config12;
|
|
33841
33871
|
if (transitional2 !== void 0) {
|
|
33842
33872
|
validator_default.assertOptions(transitional2, {
|
|
33843
33873
|
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
@@ -33847,7 +33877,7 @@ var Axios = class {
|
|
|
33847
33877
|
}
|
|
33848
33878
|
if (paramsSerializer != null) {
|
|
33849
33879
|
if (utils_default.isFunction(paramsSerializer)) {
|
|
33850
|
-
|
|
33880
|
+
config12.paramsSerializer = {
|
|
33851
33881
|
serialize: paramsSerializer
|
|
33852
33882
|
};
|
|
33853
33883
|
} else {
|
|
@@ -33857,10 +33887,10 @@ var Axios = class {
|
|
|
33857
33887
|
}, true);
|
|
33858
33888
|
}
|
|
33859
33889
|
}
|
|
33860
|
-
|
|
33890
|
+
config12.method = (config12.method || this.defaults.method || "get").toLowerCase();
|
|
33861
33891
|
let contextHeaders = headers && utils_default.merge(
|
|
33862
33892
|
headers.common,
|
|
33863
|
-
headers[
|
|
33893
|
+
headers[config12.method]
|
|
33864
33894
|
);
|
|
33865
33895
|
headers && utils_default.forEach(
|
|
33866
33896
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
@@ -33868,11 +33898,11 @@ var Axios = class {
|
|
|
33868
33898
|
delete headers[method];
|
|
33869
33899
|
}
|
|
33870
33900
|
);
|
|
33871
|
-
|
|
33901
|
+
config12.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
33872
33902
|
const requestInterceptorChain = [];
|
|
33873
33903
|
let synchronousRequestInterceptors = true;
|
|
33874
33904
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
33875
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(
|
|
33905
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config12) === false) {
|
|
33876
33906
|
return;
|
|
33877
33907
|
}
|
|
33878
33908
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
@@ -33890,14 +33920,14 @@ var Axios = class {
|
|
|
33890
33920
|
chain.unshift.apply(chain, requestInterceptorChain);
|
|
33891
33921
|
chain.push.apply(chain, responseInterceptorChain);
|
|
33892
33922
|
len = chain.length;
|
|
33893
|
-
promise = Promise.resolve(
|
|
33923
|
+
promise = Promise.resolve(config12);
|
|
33894
33924
|
while (i3 < len) {
|
|
33895
33925
|
promise = promise.then(chain[i3++], chain[i3++]);
|
|
33896
33926
|
}
|
|
33897
33927
|
return promise;
|
|
33898
33928
|
}
|
|
33899
33929
|
len = requestInterceptorChain.length;
|
|
33900
|
-
let newConfig =
|
|
33930
|
+
let newConfig = config12;
|
|
33901
33931
|
i3 = 0;
|
|
33902
33932
|
while (i3 < len) {
|
|
33903
33933
|
const onFulfilled = requestInterceptorChain[i3++];
|
|
@@ -33921,25 +33951,25 @@ var Axios = class {
|
|
|
33921
33951
|
}
|
|
33922
33952
|
return promise;
|
|
33923
33953
|
}
|
|
33924
|
-
getUri(
|
|
33925
|
-
|
|
33926
|
-
const fullPath = buildFullPath(
|
|
33927
|
-
return buildURL(fullPath,
|
|
33954
|
+
getUri(config12) {
|
|
33955
|
+
config12 = mergeConfig(this.defaults, config12);
|
|
33956
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
33957
|
+
return buildURL(fullPath, config12.params, config12.paramsSerializer);
|
|
33928
33958
|
}
|
|
33929
33959
|
};
|
|
33930
33960
|
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
33931
|
-
Axios.prototype[method] = function(url2,
|
|
33932
|
-
return this.request(mergeConfig(
|
|
33961
|
+
Axios.prototype[method] = function(url2, config12) {
|
|
33962
|
+
return this.request(mergeConfig(config12 || {}, {
|
|
33933
33963
|
method,
|
|
33934
33964
|
url: url2,
|
|
33935
|
-
data: (
|
|
33965
|
+
data: (config12 || {}).data
|
|
33936
33966
|
}));
|
|
33937
33967
|
};
|
|
33938
33968
|
});
|
|
33939
33969
|
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
33940
33970
|
function generateHTTPMethod(isForm) {
|
|
33941
|
-
return function httpMethod(url2, data,
|
|
33942
|
-
return this.request(mergeConfig(
|
|
33971
|
+
return function httpMethod(url2, data, config12) {
|
|
33972
|
+
return this.request(mergeConfig(config12 || {}, {
|
|
33943
33973
|
method,
|
|
33944
33974
|
headers: isForm ? {
|
|
33945
33975
|
"Content-Type": "multipart/form-data"
|
|
@@ -33985,11 +34015,11 @@ var CancelToken = class {
|
|
|
33985
34015
|
};
|
|
33986
34016
|
return promise;
|
|
33987
34017
|
};
|
|
33988
|
-
executor(function cancel(message,
|
|
34018
|
+
executor(function cancel(message, config12, request3) {
|
|
33989
34019
|
if (token.reason) {
|
|
33990
34020
|
return;
|
|
33991
34021
|
}
|
|
33992
|
-
token.reason = new CanceledError_default(message,
|
|
34022
|
+
token.reason = new CanceledError_default(message, config12, request3);
|
|
33993
34023
|
resolvePromise(token.reason);
|
|
33994
34024
|
});
|
|
33995
34025
|
}
|
|
@@ -34205,11 +34235,9 @@ if (provider === "openai" && !apiKey && command !== "config" && mode !== "set" /
|
|
|
34205
34235
|
process.exit(1);
|
|
34206
34236
|
}
|
|
34207
34237
|
var MODEL = config3?.OCO_MODEL || "gpt-3.5-turbo";
|
|
34208
|
-
if (provider === "openai" &&
|
|
34238
|
+
if (provider === "openai" && MODEL.typeof !== "string" && command !== "config" && mode !== "set" /* set */) {
|
|
34209
34239
|
ce(
|
|
34210
|
-
`${source_default.red("\u2716")} Unsupported model ${MODEL}
|
|
34211
|
-
", "
|
|
34212
|
-
)}`
|
|
34240
|
+
`${source_default.red("\u2716")} Unsupported model ${MODEL}. The model can be any string, but the current configuration is not supported.`
|
|
34213
34241
|
);
|
|
34214
34242
|
process.exit(1);
|
|
34215
34243
|
}
|
|
@@ -37254,11 +37282,9 @@ if (provider2 === "anthropic" && !apiKey2 && command2 !== "config" && mode2 !==
|
|
|
37254
37282
|
process.exit(1);
|
|
37255
37283
|
}
|
|
37256
37284
|
var MODEL2 = config5?.OCO_MODEL;
|
|
37257
|
-
if (provider2 === "anthropic" &&
|
|
37285
|
+
if (provider2 === "anthropic" && MODEL2.typeof !== "string" && command2 !== "config" && mode2 !== "set" /* set */) {
|
|
37258
37286
|
ce(
|
|
37259
|
-
`${source_default.red("\u2716")} Unsupported model ${MODEL2}
|
|
37260
|
-
", "
|
|
37261
|
-
)}`
|
|
37287
|
+
`${source_default.red("\u2716")} Unsupported model ${MODEL2}. The model can be any string, but the current configuration is not supported.`
|
|
37262
37288
|
);
|
|
37263
37289
|
process.exit(1);
|
|
37264
37290
|
}
|
|
@@ -41016,15 +41042,45 @@ var Azure = class {
|
|
|
41016
41042
|
};
|
|
41017
41043
|
var azure = new Azure();
|
|
41018
41044
|
|
|
41045
|
+
// src/engine/flowise.ts
|
|
41046
|
+
var config7 = getConfig();
|
|
41047
|
+
var FlowiseAi = class {
|
|
41048
|
+
async generateCommitMessage(messages) {
|
|
41049
|
+
const gitDiff = messages[messages.length - 1]?.content?.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
|
|
41050
|
+
const url2 = `http://${config7?.OCO_FLOWISE_ENDPOINT}/api/v1/prediction/${config7?.OCO_FLOWISE_API_KEY}`;
|
|
41051
|
+
const payload = {
|
|
41052
|
+
question: gitDiff,
|
|
41053
|
+
overrideConfig: {
|
|
41054
|
+
systemMessagePrompt: messages[0]?.content
|
|
41055
|
+
},
|
|
41056
|
+
history: messages.slice(1, -1)
|
|
41057
|
+
};
|
|
41058
|
+
try {
|
|
41059
|
+
const response = await axios_default.post(url2, payload, {
|
|
41060
|
+
headers: {
|
|
41061
|
+
"Content-Type": "application/json"
|
|
41062
|
+
}
|
|
41063
|
+
});
|
|
41064
|
+
const message = response.data;
|
|
41065
|
+
return message?.text;
|
|
41066
|
+
} catch (err) {
|
|
41067
|
+
const message = err.response?.data?.error ?? err.message;
|
|
41068
|
+
throw new Error("local model issues. details: " + message);
|
|
41069
|
+
}
|
|
41070
|
+
}
|
|
41071
|
+
};
|
|
41072
|
+
|
|
41019
41073
|
// src/utils/engine.ts
|
|
41020
41074
|
function getEngine() {
|
|
41021
|
-
const
|
|
41022
|
-
const provider4 =
|
|
41075
|
+
const config12 = getConfig();
|
|
41076
|
+
const provider4 = config12?.OCO_AI_PROVIDER;
|
|
41023
41077
|
if (provider4?.startsWith("ollama")) {
|
|
41024
41078
|
const ollamaAi = new OllamaAi();
|
|
41025
|
-
const model = provider4.
|
|
41026
|
-
if (model)
|
|
41079
|
+
const model = provider4.substring("ollama/".length);
|
|
41080
|
+
if (model) {
|
|
41027
41081
|
ollamaAi.setModel(model);
|
|
41082
|
+
ollamaAi.setUrl(config12?.OCO_OLLAMA_API_URL);
|
|
41083
|
+
}
|
|
41028
41084
|
return ollamaAi;
|
|
41029
41085
|
} else if (provider4 == "anthropic") {
|
|
41030
41086
|
return new AnthropicAi();
|
|
@@ -41034,13 +41090,15 @@ function getEngine() {
|
|
|
41034
41090
|
return new Gemini();
|
|
41035
41091
|
} else if (provider4 == "azure") {
|
|
41036
41092
|
return new Azure();
|
|
41093
|
+
} else if (provider4 == "flowise") {
|
|
41094
|
+
return new FlowiseAi();
|
|
41037
41095
|
}
|
|
41038
41096
|
return new OpenAi();
|
|
41039
41097
|
}
|
|
41040
41098
|
|
|
41041
41099
|
// src/modules/commitlint/config.ts
|
|
41042
|
-
var
|
|
41043
|
-
var translation2 = i18n[
|
|
41100
|
+
var config8 = getConfig();
|
|
41101
|
+
var translation2 = i18n[config8?.OCO_LANGUAGE || "en"];
|
|
41044
41102
|
var configureCommitlintIntegration = async (force = false) => {
|
|
41045
41103
|
const spin = le();
|
|
41046
41104
|
spin.start("Loading @commitlint configuration");
|
|
@@ -41093,15 +41151,15 @@ function removeConventionalCommitWord(message) {
|
|
|
41093
41151
|
}
|
|
41094
41152
|
|
|
41095
41153
|
// src/prompts.ts
|
|
41096
|
-
var
|
|
41097
|
-
var translation3 = i18n[
|
|
41154
|
+
var config9 = getConfig();
|
|
41155
|
+
var translation3 = i18n[config9?.OCO_LANGUAGE || "en"];
|
|
41098
41156
|
var IDENTITY = "You are to act as the author of a commit message in git.";
|
|
41099
41157
|
var INIT_MAIN_PROMPT2 = (language, fullGitMojiSpec) => ({
|
|
41100
41158
|
role: import_openai4.ChatCompletionRequestMessageRoleEnum.System,
|
|
41101
41159
|
content: `${IDENTITY} Your mission is to create clean and comprehensive commit messages as per the ${fullGitMojiSpec ? "GitMoji specification" : "conventional commit convention"} and explain WHAT were the changes and mainly WHY the changes were done. I'll send you an output of 'git diff --staged' command, and you are to convert it into a commit message.
|
|
41102
|
-
${
|
|
41103
|
-
${
|
|
41104
|
-
${
|
|
41160
|
+
${config9?.OCO_EMOJI ? `Use GitMoji convention to preface the commit. Here are some help to choose the right emoji (emoji, description): \u{1F41B}, Fix a bug; \u2728, Introduce new features; \u{1F4DD}, Add or update documentation; \u{1F680}, Deploy stuff; \u2705, Add, update, or pass tests; \u267B\uFE0F, Refactor code; \u2B06\uFE0F, Upgrade dependencies; \u{1F527}, Add or update configuration files; \u{1F310}, Internationalization and localization; \u{1F4A1}, Add or update comments in source code; ${fullGitMojiSpec ? "\u{1F3A8}, Improve structure / format of the code; \u26A1\uFE0F, Improve performance; \u{1F525}, Remove code or files; \u{1F691}\uFE0F, Critical hotfix; \u{1F484}, Add or update the UI and style files; \u{1F389}, Begin a project; \u{1F512}\uFE0F, Fix security issues; \u{1F510}, Add or update secrets; \u{1F516}, Release / Version tags; \u{1F6A8}, Fix compiler / linter warnings; \u{1F6A7}, Work in progress; \u{1F49A}, Fix CI Build; \u2B07\uFE0F, Downgrade dependencies; \u{1F4CC}, Pin dependencies to specific versions; \u{1F477}, Add or update CI build system; \u{1F4C8}, Add or update analytics or track code; \u2795, Add a dependency; \u2796, Remove a dependency; \u{1F528}, Add or update development scripts; \u270F\uFE0F, Fix typos; \u{1F4A9}, Write bad code that needs to be improved; \u23EA\uFE0F, Revert changes; \u{1F500}, Merge branches; \u{1F4E6}\uFE0F, Add or update compiled files or packages; \u{1F47D}\uFE0F, Update code due to external API changes; \u{1F69A}, Move or rename resources (e.g.: files, paths, routes); \u{1F4C4}, Add or update license; \u{1F4A5}, Introduce breaking changes; \u{1F371}, Add or update assets; \u267F\uFE0F, Improve accessibility; \u{1F37B}, Write code drunkenly; \u{1F4AC}, Add or update text and literals; \u{1F5C3}\uFE0F, Perform database related changes; \u{1F50A}, Add or update logs; \u{1F507}, Remove logs; \u{1F465}, Add or update contributor(s); \u{1F6B8}, Improve user experience / usability; \u{1F3D7}\uFE0F, Make architectural changes; \u{1F4F1}, Work on responsive design; \u{1F921}, Mock things; \u{1F95A}, Add or update an easter egg; \u{1F648}, Add or update a .gitignore file; \u{1F4F8}, Add or update snapshots; \u2697\uFE0F, Perform experiments; \u{1F50D}\uFE0F, Improve SEO; \u{1F3F7}\uFE0F, Add or update types; \u{1F331}, Add or update seed files; \u{1F6A9}, Add, update, or remove feature flags; \u{1F945}, Catch errors; \u{1F4AB}, Add or update animations and transitions; \u{1F5D1}\uFE0F, Deprecate code that needs to be cleaned up; \u{1F6C2}, Work on code related to authorization, roles and permissions; \u{1FA79}, Simple fix for a non-critical issue; \u{1F9D0}, Data exploration/inspection; \u26B0\uFE0F, Remove dead code; \u{1F9EA}, Add a failing test; \u{1F454}, Add or update business logic; \u{1FA7A}, Add or update healthcheck; \u{1F9F1}, Infrastructure related changes; \u{1F9D1}\u200D\u{1F4BB}, Improve developer experience; \u{1F4B8}, Add sponsorships or money related infrastructure; \u{1F9F5}, Add or update code related to multithreading or concurrency; \u{1F9BA}, Add or update code related to validation." : ""}` : "Do not preface the commit with anything. Conventional commit keywords:fix, feat, build, chore, ci, docs, style, refactor, perf, test."}
|
|
41161
|
+
${config9?.OCO_DESCRIPTION ? `Add a short description of WHY the changes are done after the commit message. Don't start it with "This commit", just describe the changes.` : "Don't add any descriptions to the commit, only commit message."}
|
|
41162
|
+
${config9?.OCO_ONE_LINE_COMMIT ? "Craft a concise commit message that encapsulates all changes made, with an emphasis on the primary updates. If the modifications share a common theme or scope, mention it succinctly; otherwise, leave the scope out to maintain focus. The goal is to provide a clear and unified overview of the changes in a one single message, without diverging into a list of commit per file change." : ""}
|
|
41105
41163
|
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
|
|
41106
41164
|
});
|
|
41107
41165
|
var INIT_DIFF_PROMPT = {
|
|
@@ -41133,12 +41191,12 @@ var INIT_DIFF_PROMPT = {
|
|
|
41133
41191
|
};
|
|
41134
41192
|
var INIT_CONSISTENCY_PROMPT = (translation4) => ({
|
|
41135
41193
|
role: import_openai4.ChatCompletionRequestMessageRoleEnum.Assistant,
|
|
41136
|
-
content: `${
|
|
41137
|
-
${
|
|
41138
|
-
${
|
|
41194
|
+
content: `${config9?.OCO_EMOJI ? `\u{1F41B} ${removeConventionalCommitWord(translation4.commitFix)}` : translation4.commitFix}
|
|
41195
|
+
${config9?.OCO_EMOJI ? `\u2728 ${removeConventionalCommitWord(translation4.commitFeat)}` : translation4.commitFeat}
|
|
41196
|
+
${config9?.OCO_DESCRIPTION ? translation4.commitDescription : ""}`
|
|
41139
41197
|
});
|
|
41140
41198
|
var getMainCommitPrompt = async (fullGitMojiSpec) => {
|
|
41141
|
-
switch (
|
|
41199
|
+
switch (config9?.OCO_PROMPT_MODULE) {
|
|
41142
41200
|
case "@commitlint":
|
|
41143
41201
|
if (!await commitlintLLMConfigExists()) {
|
|
41144
41202
|
ie(
|
|
@@ -41183,9 +41241,9 @@ function mergeDiffs(arr, maxStringLength) {
|
|
|
41183
41241
|
}
|
|
41184
41242
|
|
|
41185
41243
|
// src/generateCommitMessageFromGitDiff.ts
|
|
41186
|
-
var
|
|
41187
|
-
var MAX_TOKENS_INPUT4 =
|
|
41188
|
-
var MAX_TOKENS_OUTPUT4 =
|
|
41244
|
+
var config10 = getConfig();
|
|
41245
|
+
var MAX_TOKENS_INPUT4 = config10?.OCO_TOKENS_MAX_INPUT || 4096 /* DEFAULT_MAX_TOKENS_INPUT */;
|
|
41246
|
+
var MAX_TOKENS_OUTPUT4 = config10?.OCO_TOKENS_MAX_OUTPUT || 500 /* DEFAULT_MAX_TOKENS_OUTPUT */;
|
|
41189
41247
|
var generateCommitMessageChatCompletionPrompt = async (diff, fullGitMojiSpec) => {
|
|
41190
41248
|
const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec);
|
|
41191
41249
|
const chatContextAsCompletionRequest = [...INIT_MESSAGES_PROMPT];
|
|
@@ -41417,14 +41475,14 @@ var trytm = async (promise) => {
|
|
|
41417
41475
|
};
|
|
41418
41476
|
|
|
41419
41477
|
// src/commands/commit.ts
|
|
41420
|
-
var
|
|
41478
|
+
var config11 = getConfig();
|
|
41421
41479
|
var getGitRemotes = async () => {
|
|
41422
41480
|
const { stdout } = await execa("git", ["remote"]);
|
|
41423
41481
|
return stdout.split("\n").filter((remote) => Boolean(remote.trim()));
|
|
41424
41482
|
};
|
|
41425
41483
|
var checkMessageTemplate = (extraArgs2) => {
|
|
41426
41484
|
for (const key in extraArgs2) {
|
|
41427
|
-
if (extraArgs2[key].includes(
|
|
41485
|
+
if (extraArgs2[key].includes(config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER))
|
|
41428
41486
|
return extraArgs2[key];
|
|
41429
41487
|
}
|
|
41430
41488
|
return false;
|
|
@@ -41439,11 +41497,11 @@ var generateCommitMessageFromGitDiff = async (diff, extraArgs2, fullGitMojiSpec,
|
|
|
41439
41497
|
fullGitMojiSpec
|
|
41440
41498
|
);
|
|
41441
41499
|
const messageTemplate = checkMessageTemplate(extraArgs2);
|
|
41442
|
-
if (
|
|
41500
|
+
if (config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER && typeof messageTemplate === "string") {
|
|
41443
41501
|
const messageTemplateIndex = extraArgs2.indexOf(messageTemplate);
|
|
41444
41502
|
extraArgs2.splice(messageTemplateIndex, 1);
|
|
41445
41503
|
commitMessage = messageTemplate.replace(
|
|
41446
|
-
|
|
41504
|
+
config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
|
|
41447
41505
|
commitMessage
|
|
41448
41506
|
);
|
|
41449
41507
|
}
|
|
@@ -41467,7 +41525,7 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
|
|
|
41467
41525
|
ce(`${source_default.green("\u2714")} Successfully committed`);
|
|
41468
41526
|
ce(stdout);
|
|
41469
41527
|
const remotes = await getGitRemotes();
|
|
41470
|
-
if (
|
|
41528
|
+
if (config11?.OCO_GITPUSH === false)
|
|
41471
41529
|
return;
|
|
41472
41530
|
if (!remotes.length) {
|
|
41473
41531
|
const { stdout: stdout2 } = await execa("git", ["push"]);
|
|
@@ -41475,7 +41533,7 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
|
|
|
41475
41533
|
ce(stdout2);
|
|
41476
41534
|
process.exit(0);
|
|
41477
41535
|
}
|
|
41478
|
-
if (remotes.length === 1 &&
|
|
41536
|
+
if (remotes.length === 1 && config11?.OCO_GITPUSH !== true) {
|
|
41479
41537
|
const isPushConfirmedByUser = await Q3({
|
|
41480
41538
|
message: "Do you want to run `git push`?"
|
|
41481
41539
|
});
|
|
@@ -41737,8 +41795,8 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
|
41737
41795
|
if (!staged)
|
|
41738
41796
|
return;
|
|
41739
41797
|
ae("opencommit");
|
|
41740
|
-
const
|
|
41741
|
-
if (!
|
|
41798
|
+
const config12 = getConfig();
|
|
41799
|
+
if (!config12?.OCO_OPENAI_API_KEY && !config12?.OCO_ANTHROPIC_API_KEY && !config12?.OCO_AZURE_API_KEY) {
|
|
41742
41800
|
throw new Error(
|
|
41743
41801
|
"No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit"
|
|
41744
41802
|
);
|