opencommit 3.0.17 → 3.0.19
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 +446 -392
- package/package.json +4 -1
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.19",
|
|
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":
|
|
@@ -30660,6 +30663,7 @@ var TestAi = class {
|
|
|
30660
30663
|
// src/commands/config.ts
|
|
30661
30664
|
var MODEL_LIST = {
|
|
30662
30665
|
openai: [
|
|
30666
|
+
"gpt-4o-mini",
|
|
30663
30667
|
"gpt-3.5-turbo",
|
|
30664
30668
|
"gpt-3.5-turbo-instruct",
|
|
30665
30669
|
"gpt-3.5-turbo-0613",
|
|
@@ -30684,7 +30688,6 @@ var MODEL_LIST = {
|
|
|
30684
30688
|
"gpt-4-32k-0613",
|
|
30685
30689
|
"gpt-4o",
|
|
30686
30690
|
"gpt-4o-2024-05-13",
|
|
30687
|
-
"gpt-4o-mini",
|
|
30688
30691
|
"gpt-4o-mini-2024-07-18"
|
|
30689
30692
|
],
|
|
30690
30693
|
anthropic: [
|
|
@@ -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 ||
|
|
30731
|
-
"You need to provide an OpenAI/Anthropic/Azure API key"
|
|
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",
|
|
30734
|
+
"You need to provide an OpenAI/Anthropic/Azure or other provider API key via `oco config set OCO_OPENAI_API_KEY=your_key`, for help refer to docs https://github.com/di-sukharev/opencommit"
|
|
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,10 @@ 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
|
-
|
|
30834
|
-
...MODEL_LIST.openai,
|
|
30835
|
-
...MODEL_LIST.anthropic,
|
|
30836
|
-
...MODEL_LIST.gemini
|
|
30837
|
-
].includes(value) || config11.OCO_AI_PROVIDER == "ollama" || config11.OCO_AI_PROVIDER == "azure" || config11.OCO_AI_PROVIDER == "test",
|
|
30844
|
+
typeof value === "string",
|
|
30838
30845
|
`${value} is not supported yet, use:
|
|
30839
30846
|
|
|
30840
30847
|
${[
|
|
@@ -30872,8 +30879,16 @@ var configValidators = {
|
|
|
30872
30879
|
["OCO_AI_PROVIDER" /* OCO_AI_PROVIDER */](value) {
|
|
30873
30880
|
validateConfig(
|
|
30874
30881
|
"OCO_AI_PROVIDER" /* OCO_AI_PROVIDER */,
|
|
30875
|
-
[
|
|
30876
|
-
|
|
30882
|
+
[
|
|
30883
|
+
"",
|
|
30884
|
+
"openai",
|
|
30885
|
+
"anthropic",
|
|
30886
|
+
"gemini",
|
|
30887
|
+
"azure",
|
|
30888
|
+
"test",
|
|
30889
|
+
"flowise"
|
|
30890
|
+
].includes(value) || value.startsWith("ollama"),
|
|
30891
|
+
`${value} is not supported yet, use 'ollama', 'anthropic', 'azure', 'gemini', 'flowise' or 'openai' (default)`
|
|
30877
30892
|
);
|
|
30878
30893
|
return value;
|
|
30879
30894
|
},
|
|
@@ -30893,6 +30908,14 @@ var configValidators = {
|
|
|
30893
30908
|
);
|
|
30894
30909
|
return value;
|
|
30895
30910
|
},
|
|
30911
|
+
["OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */](value) {
|
|
30912
|
+
validateConfig(
|
|
30913
|
+
"OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */,
|
|
30914
|
+
typeof value === "string" && value.includes(":"),
|
|
30915
|
+
"Value must be string and should include both I.P. and port number"
|
|
30916
|
+
);
|
|
30917
|
+
return value;
|
|
30918
|
+
},
|
|
30896
30919
|
["OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */](value) {
|
|
30897
30920
|
validateConfig(
|
|
30898
30921
|
"OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */,
|
|
@@ -30937,26 +30960,29 @@ var getConfig = ({
|
|
|
30937
30960
|
OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER || "openai",
|
|
30938
30961
|
OCO_GITPUSH: process.env.OCO_GITPUSH === "false" ? false : true,
|
|
30939
30962
|
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"
|
|
30963
|
+
OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT || void 0,
|
|
30964
|
+
OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE || "commit-message",
|
|
30965
|
+
OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT || ":",
|
|
30966
|
+
OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY || void 0,
|
|
30967
|
+
OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL || void 0
|
|
30942
30968
|
};
|
|
30943
30969
|
const configExists = (0, import_fs.existsSync)(configPath);
|
|
30944
30970
|
if (!configExists)
|
|
30945
30971
|
return configFromEnv;
|
|
30946
30972
|
const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
|
|
30947
|
-
const
|
|
30948
|
-
for (const configKey of Object.keys(
|
|
30949
|
-
if (["null", "undefined"].includes(
|
|
30950
|
-
|
|
30973
|
+
const config12 = (0, import_ini.parse)(configFile);
|
|
30974
|
+
for (const configKey of Object.keys(config12)) {
|
|
30975
|
+
if (["null", "undefined"].includes(config12[configKey])) {
|
|
30976
|
+
config12[configKey] = void 0;
|
|
30951
30977
|
continue;
|
|
30952
30978
|
}
|
|
30953
30979
|
try {
|
|
30954
30980
|
const validator = configValidators[configKey];
|
|
30955
30981
|
const validValue = validator(
|
|
30956
|
-
|
|
30957
|
-
|
|
30982
|
+
config12[configKey] ?? configFromEnv[configKey],
|
|
30983
|
+
config12
|
|
30958
30984
|
);
|
|
30959
|
-
|
|
30985
|
+
config12[configKey] = validValue;
|
|
30960
30986
|
} catch (error) {
|
|
30961
30987
|
ce(`Unknown '${configKey}' config option or missing validator.`);
|
|
30962
30988
|
ce(
|
|
@@ -30965,10 +30991,10 @@ var getConfig = ({
|
|
|
30965
30991
|
process.exit(1);
|
|
30966
30992
|
}
|
|
30967
30993
|
}
|
|
30968
|
-
return
|
|
30994
|
+
return config12;
|
|
30969
30995
|
};
|
|
30970
30996
|
var setConfig = (keyValues, configPath = defaultConfigPath) => {
|
|
30971
|
-
const
|
|
30997
|
+
const config12 = getConfig() || {};
|
|
30972
30998
|
for (const [configKey, configValue] of keyValues) {
|
|
30973
30999
|
if (!configValidators.hasOwnProperty(configKey)) {
|
|
30974
31000
|
throw new Error(`Unsupported config key: ${configKey}`);
|
|
@@ -30980,9 +31006,9 @@ var setConfig = (keyValues, configPath = defaultConfigPath) => {
|
|
|
30980
31006
|
parsedConfigValue = configValue;
|
|
30981
31007
|
}
|
|
30982
31008
|
const validValue = configValidators[configKey](parsedConfigValue);
|
|
30983
|
-
|
|
31009
|
+
config12[configKey] = validValue;
|
|
30984
31010
|
}
|
|
30985
|
-
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(
|
|
31011
|
+
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config12), "utf8");
|
|
30986
31012
|
ce(`${source_default.green("\u2714")} Config successfully set`);
|
|
30987
31013
|
};
|
|
30988
31014
|
var configCommand = G3(
|
|
@@ -30995,9 +31021,9 @@ var configCommand = G3(
|
|
|
30995
31021
|
try {
|
|
30996
31022
|
const { mode: mode4, keyValues } = argv._;
|
|
30997
31023
|
if (mode4 === "get" /* get */) {
|
|
30998
|
-
const
|
|
31024
|
+
const config12 = getConfig() || {};
|
|
30999
31025
|
for (const key of keyValues) {
|
|
31000
|
-
ce(`${key}=${
|
|
31026
|
+
ce(`${key}=${config12[key]}`);
|
|
31001
31027
|
}
|
|
31002
31028
|
} else if (mode4 === "set" /* set */) {
|
|
31003
31029
|
await setConfig(
|
|
@@ -31106,8 +31132,8 @@ var getPrompt = (ruleName, ruleConfig, prompt) => {
|
|
|
31106
31132
|
ce(`${source_default.red("\u2716")} No prompt handler for rule "${ruleName}".`);
|
|
31107
31133
|
return `Please manualy set the prompt for rule "${ruleName}".`;
|
|
31108
31134
|
};
|
|
31109
|
-
var inferPromptsFromCommitlintConfig = (
|
|
31110
|
-
const { rules, prompt } =
|
|
31135
|
+
var inferPromptsFromCommitlintConfig = (config12) => {
|
|
31136
|
+
const { rules, prompt } = config12;
|
|
31111
31137
|
if (!rules)
|
|
31112
31138
|
return [];
|
|
31113
31139
|
return Object.keys(rules).map(
|
|
@@ -31620,7 +31646,7 @@ var utils_default = {
|
|
|
31620
31646
|
};
|
|
31621
31647
|
|
|
31622
31648
|
// node_modules/axios/lib/core/AxiosError.js
|
|
31623
|
-
function AxiosError(message, code,
|
|
31649
|
+
function AxiosError(message, code, config12, request3, response) {
|
|
31624
31650
|
Error.call(this);
|
|
31625
31651
|
if (Error.captureStackTrace) {
|
|
31626
31652
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -31630,7 +31656,7 @@ function AxiosError(message, code, config11, request3, response) {
|
|
|
31630
31656
|
this.message = message;
|
|
31631
31657
|
this.name = "AxiosError";
|
|
31632
31658
|
code && (this.code = code);
|
|
31633
|
-
|
|
31659
|
+
config12 && (this.config = config12);
|
|
31634
31660
|
request3 && (this.request = request3);
|
|
31635
31661
|
response && (this.response = response);
|
|
31636
31662
|
}
|
|
@@ -31671,14 +31697,14 @@ var descriptors2 = {};
|
|
|
31671
31697
|
});
|
|
31672
31698
|
Object.defineProperties(AxiosError, descriptors2);
|
|
31673
31699
|
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
31674
|
-
AxiosError.from = (error, code,
|
|
31700
|
+
AxiosError.from = (error, code, config12, request3, response, customProps) => {
|
|
31675
31701
|
const axiosError = Object.create(prototype);
|
|
31676
31702
|
utils_default.toFlatObject(error, axiosError, function filter2(obj) {
|
|
31677
31703
|
return obj !== Error.prototype;
|
|
31678
31704
|
}, (prop) => {
|
|
31679
31705
|
return prop !== "isAxiosError";
|
|
31680
31706
|
});
|
|
31681
|
-
AxiosError.call(axiosError, error.message, code,
|
|
31707
|
+
AxiosError.call(axiosError, error.message, code, config12, request3, response);
|
|
31682
31708
|
axiosError.cause = error;
|
|
31683
31709
|
axiosError.name = error.name;
|
|
31684
31710
|
customProps && Object.assign(axiosError, customProps);
|
|
@@ -32374,12 +32400,12 @@ var AxiosHeaders_default = AxiosHeaders;
|
|
|
32374
32400
|
|
|
32375
32401
|
// node_modules/axios/lib/core/transformData.js
|
|
32376
32402
|
function transformData(fns, response) {
|
|
32377
|
-
const
|
|
32378
|
-
const context = response ||
|
|
32403
|
+
const config12 = this || defaults_default;
|
|
32404
|
+
const context = response || config12;
|
|
32379
32405
|
const headers = AxiosHeaders_default.from(context.headers);
|
|
32380
32406
|
let data = context.data;
|
|
32381
32407
|
utils_default.forEach(fns, function transform(fn) {
|
|
32382
|
-
data = fn.call(
|
|
32408
|
+
data = fn.call(config12, data, headers.normalize(), response ? response.status : void 0);
|
|
32383
32409
|
});
|
|
32384
32410
|
headers.normalize();
|
|
32385
32411
|
return data;
|
|
@@ -32391,8 +32417,8 @@ function isCancel(value) {
|
|
|
32391
32417
|
}
|
|
32392
32418
|
|
|
32393
32419
|
// node_modules/axios/lib/cancel/CanceledError.js
|
|
32394
|
-
function CanceledError(message,
|
|
32395
|
-
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED,
|
|
32420
|
+
function CanceledError(message, config12, request3) {
|
|
32421
|
+
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config12, request3);
|
|
32396
32422
|
this.name = "CanceledError";
|
|
32397
32423
|
}
|
|
32398
32424
|
utils_default.inherits(CanceledError, AxiosError_default, {
|
|
@@ -32924,11 +32950,11 @@ var resolveFamily = ({ address, family }) => {
|
|
|
32924
32950
|
};
|
|
32925
32951
|
};
|
|
32926
32952
|
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
32927
|
-
var http_default = isHttpAdapterSupported && function httpAdapter(
|
|
32953
|
+
var http_default = isHttpAdapterSupported && function httpAdapter(config12) {
|
|
32928
32954
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
32929
|
-
let { data, lookup, family } =
|
|
32930
|
-
const { responseType, responseEncoding } =
|
|
32931
|
-
const method =
|
|
32955
|
+
let { data, lookup, family } = config12;
|
|
32956
|
+
const { responseType, responseEncoding } = config12;
|
|
32957
|
+
const method = config12.method.toUpperCase();
|
|
32932
32958
|
let isDone;
|
|
32933
32959
|
let rejected = false;
|
|
32934
32960
|
let req;
|
|
@@ -32946,11 +32972,11 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32946
32972
|
}
|
|
32947
32973
|
const emitter = new import_events.EventEmitter();
|
|
32948
32974
|
const onFinished = () => {
|
|
32949
|
-
if (
|
|
32950
|
-
|
|
32975
|
+
if (config12.cancelToken) {
|
|
32976
|
+
config12.cancelToken.unsubscribe(abort);
|
|
32951
32977
|
}
|
|
32952
|
-
if (
|
|
32953
|
-
|
|
32978
|
+
if (config12.signal) {
|
|
32979
|
+
config12.signal.removeEventListener("abort", abort);
|
|
32954
32980
|
}
|
|
32955
32981
|
emitter.removeAllListeners();
|
|
32956
32982
|
};
|
|
@@ -32962,16 +32988,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32962
32988
|
}
|
|
32963
32989
|
});
|
|
32964
32990
|
function abort(reason) {
|
|
32965
|
-
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null,
|
|
32991
|
+
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config12, req) : reason);
|
|
32966
32992
|
}
|
|
32967
32993
|
emitter.once("abort", reject);
|
|
32968
|
-
if (
|
|
32969
|
-
|
|
32970
|
-
if (
|
|
32971
|
-
|
|
32994
|
+
if (config12.cancelToken || config12.signal) {
|
|
32995
|
+
config12.cancelToken && config12.cancelToken.subscribe(abort);
|
|
32996
|
+
if (config12.signal) {
|
|
32997
|
+
config12.signal.aborted ? abort() : config12.signal.addEventListener("abort", abort);
|
|
32972
32998
|
}
|
|
32973
32999
|
}
|
|
32974
|
-
const fullPath = buildFullPath(
|
|
33000
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
32975
33001
|
const parsed = new URL(fullPath, "http://localhost");
|
|
32976
33002
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
32977
33003
|
if (protocol === "data:") {
|
|
@@ -32981,15 +33007,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
32981
33007
|
status: 405,
|
|
32982
33008
|
statusText: "method not allowed",
|
|
32983
33009
|
headers: {},
|
|
32984
|
-
config:
|
|
33010
|
+
config: config12
|
|
32985
33011
|
});
|
|
32986
33012
|
}
|
|
32987
33013
|
try {
|
|
32988
|
-
convertedData = fromDataURI(
|
|
32989
|
-
Blob:
|
|
33014
|
+
convertedData = fromDataURI(config12.url, responseType === "blob", {
|
|
33015
|
+
Blob: config12.env && config12.env.Blob
|
|
32990
33016
|
});
|
|
32991
33017
|
} catch (err) {
|
|
32992
|
-
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST,
|
|
33018
|
+
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config12);
|
|
32993
33019
|
}
|
|
32994
33020
|
if (responseType === "text") {
|
|
32995
33021
|
convertedData = convertedData.toString(responseEncoding);
|
|
@@ -33004,21 +33030,21 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33004
33030
|
status: 200,
|
|
33005
33031
|
statusText: "OK",
|
|
33006
33032
|
headers: new AxiosHeaders_default(),
|
|
33007
|
-
config:
|
|
33033
|
+
config: config12
|
|
33008
33034
|
});
|
|
33009
33035
|
}
|
|
33010
33036
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
33011
33037
|
return reject(new AxiosError_default(
|
|
33012
33038
|
"Unsupported protocol " + protocol,
|
|
33013
33039
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33014
|
-
|
|
33040
|
+
config12
|
|
33015
33041
|
));
|
|
33016
33042
|
}
|
|
33017
|
-
const headers = AxiosHeaders_default.from(
|
|
33043
|
+
const headers = AxiosHeaders_default.from(config12.headers).normalize();
|
|
33018
33044
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
33019
|
-
const onDownloadProgress =
|
|
33020
|
-
const onUploadProgress =
|
|
33021
|
-
const maxRate =
|
|
33045
|
+
const onDownloadProgress = config12.onDownloadProgress;
|
|
33046
|
+
const onUploadProgress = config12.onUploadProgress;
|
|
33047
|
+
const maxRate = config12.maxRate;
|
|
33022
33048
|
let maxUploadRate = void 0;
|
|
33023
33049
|
let maxDownloadRate = void 0;
|
|
33024
33050
|
if (utils_default.isSpecCompliantForm(data)) {
|
|
@@ -33052,15 +33078,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33052
33078
|
return reject(new AxiosError_default(
|
|
33053
33079
|
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
33054
33080
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33055
|
-
|
|
33081
|
+
config12
|
|
33056
33082
|
));
|
|
33057
33083
|
}
|
|
33058
33084
|
headers.setContentLength(data.length, false);
|
|
33059
|
-
if (
|
|
33085
|
+
if (config12.maxBodyLength > -1 && data.length > config12.maxBodyLength) {
|
|
33060
33086
|
return reject(new AxiosError_default(
|
|
33061
33087
|
"Request body larger than maxBodyLength limit",
|
|
33062
33088
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
33063
|
-
|
|
33089
|
+
config12
|
|
33064
33090
|
));
|
|
33065
33091
|
}
|
|
33066
33092
|
}
|
|
@@ -33086,9 +33112,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33086
33112
|
});
|
|
33087
33113
|
}
|
|
33088
33114
|
let auth = void 0;
|
|
33089
|
-
if (
|
|
33090
|
-
const username =
|
|
33091
|
-
const password =
|
|
33115
|
+
if (config12.auth) {
|
|
33116
|
+
const username = config12.auth.username || "";
|
|
33117
|
+
const password = config12.auth.password || "";
|
|
33092
33118
|
auth = username + ":" + password;
|
|
33093
33119
|
}
|
|
33094
33120
|
if (!auth && parsed.username) {
|
|
@@ -33101,13 +33127,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33101
33127
|
try {
|
|
33102
33128
|
path5 = buildURL(
|
|
33103
33129
|
parsed.pathname + parsed.search,
|
|
33104
|
-
|
|
33105
|
-
|
|
33130
|
+
config12.params,
|
|
33131
|
+
config12.paramsSerializer
|
|
33106
33132
|
).replace(/^\?/, "");
|
|
33107
33133
|
} catch (err) {
|
|
33108
33134
|
const customErr = new Error(err.message);
|
|
33109
|
-
customErr.config =
|
|
33110
|
-
customErr.url =
|
|
33135
|
+
customErr.config = config12;
|
|
33136
|
+
customErr.url = config12.url;
|
|
33111
33137
|
customErr.exists = true;
|
|
33112
33138
|
return reject(customErr);
|
|
33113
33139
|
}
|
|
@@ -33120,7 +33146,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33120
33146
|
path: path5,
|
|
33121
33147
|
method,
|
|
33122
33148
|
headers: headers.toJSON(),
|
|
33123
|
-
agents: { http:
|
|
33149
|
+
agents: { http: config12.httpAgent, https: config12.httpsAgent },
|
|
33124
33150
|
auth,
|
|
33125
33151
|
protocol,
|
|
33126
33152
|
family,
|
|
@@ -33128,36 +33154,36 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33128
33154
|
beforeRedirects: {}
|
|
33129
33155
|
};
|
|
33130
33156
|
!utils_default.isUndefined(lookup) && (options.lookup = lookup);
|
|
33131
|
-
if (
|
|
33132
|
-
options.socketPath =
|
|
33157
|
+
if (config12.socketPath) {
|
|
33158
|
+
options.socketPath = config12.socketPath;
|
|
33133
33159
|
} else {
|
|
33134
33160
|
options.hostname = parsed.hostname;
|
|
33135
33161
|
options.port = parsed.port;
|
|
33136
|
-
setProxy(options,
|
|
33162
|
+
setProxy(options, config12.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
33137
33163
|
}
|
|
33138
33164
|
let transport;
|
|
33139
33165
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
33140
|
-
options.agent = isHttpsRequest ?
|
|
33141
|
-
if (
|
|
33142
|
-
transport =
|
|
33143
|
-
} else if (
|
|
33166
|
+
options.agent = isHttpsRequest ? config12.httpsAgent : config12.httpAgent;
|
|
33167
|
+
if (config12.transport) {
|
|
33168
|
+
transport = config12.transport;
|
|
33169
|
+
} else if (config12.maxRedirects === 0) {
|
|
33144
33170
|
transport = isHttpsRequest ? import_https.default : import_http.default;
|
|
33145
33171
|
} else {
|
|
33146
|
-
if (
|
|
33147
|
-
options.maxRedirects =
|
|
33172
|
+
if (config12.maxRedirects) {
|
|
33173
|
+
options.maxRedirects = config12.maxRedirects;
|
|
33148
33174
|
}
|
|
33149
|
-
if (
|
|
33150
|
-
options.beforeRedirects.config =
|
|
33175
|
+
if (config12.beforeRedirect) {
|
|
33176
|
+
options.beforeRedirects.config = config12.beforeRedirect;
|
|
33151
33177
|
}
|
|
33152
33178
|
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
33153
33179
|
}
|
|
33154
|
-
if (
|
|
33155
|
-
options.maxBodyLength =
|
|
33180
|
+
if (config12.maxBodyLength > -1) {
|
|
33181
|
+
options.maxBodyLength = config12.maxBodyLength;
|
|
33156
33182
|
} else {
|
|
33157
33183
|
options.maxBodyLength = Infinity;
|
|
33158
33184
|
}
|
|
33159
|
-
if (
|
|
33160
|
-
options.insecureHTTPParser =
|
|
33185
|
+
if (config12.insecureHTTPParser) {
|
|
33186
|
+
options.insecureHTTPParser = config12.insecureHTTPParser;
|
|
33161
33187
|
}
|
|
33162
33188
|
req = transport.request(options, function handleResponse(res) {
|
|
33163
33189
|
if (req.destroyed)
|
|
@@ -33178,7 +33204,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33178
33204
|
}
|
|
33179
33205
|
let responseStream = res;
|
|
33180
33206
|
const lastRequest = res.req || req;
|
|
33181
|
-
if (
|
|
33207
|
+
if (config12.decompress !== false && res.headers["content-encoding"]) {
|
|
33182
33208
|
if (method === "HEAD" || res.statusCode === 204) {
|
|
33183
33209
|
delete res.headers["content-encoding"];
|
|
33184
33210
|
}
|
|
@@ -33211,7 +33237,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33211
33237
|
status: res.statusCode,
|
|
33212
33238
|
statusText: res.statusMessage,
|
|
33213
33239
|
headers: new AxiosHeaders_default(res.headers),
|
|
33214
|
-
config:
|
|
33240
|
+
config: config12,
|
|
33215
33241
|
request: lastRequest
|
|
33216
33242
|
};
|
|
33217
33243
|
if (responseType === "stream") {
|
|
@@ -33223,13 +33249,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33223
33249
|
responseStream.on("data", function handleStreamData(chunk) {
|
|
33224
33250
|
responseBuffer.push(chunk);
|
|
33225
33251
|
totalResponseBytes += chunk.length;
|
|
33226
|
-
if (
|
|
33252
|
+
if (config12.maxContentLength > -1 && totalResponseBytes > config12.maxContentLength) {
|
|
33227
33253
|
rejected = true;
|
|
33228
33254
|
responseStream.destroy();
|
|
33229
33255
|
reject(new AxiosError_default(
|
|
33230
|
-
"maxContentLength size of " +
|
|
33256
|
+
"maxContentLength size of " + config12.maxContentLength + " exceeded",
|
|
33231
33257
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
33232
|
-
|
|
33258
|
+
config12,
|
|
33233
33259
|
lastRequest
|
|
33234
33260
|
));
|
|
33235
33261
|
}
|
|
@@ -33239,9 +33265,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33239
33265
|
return;
|
|
33240
33266
|
}
|
|
33241
33267
|
const err = new AxiosError_default(
|
|
33242
|
-
"maxContentLength size of " +
|
|
33268
|
+
"maxContentLength size of " + config12.maxContentLength + " exceeded",
|
|
33243
33269
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
33244
|
-
|
|
33270
|
+
config12,
|
|
33245
33271
|
lastRequest
|
|
33246
33272
|
);
|
|
33247
33273
|
responseStream.destroy(err);
|
|
@@ -33250,7 +33276,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33250
33276
|
responseStream.on("error", function handleStreamError(err) {
|
|
33251
33277
|
if (req.destroyed)
|
|
33252
33278
|
return;
|
|
33253
|
-
reject(AxiosError_default.from(err, null,
|
|
33279
|
+
reject(AxiosError_default.from(err, null, config12, lastRequest));
|
|
33254
33280
|
});
|
|
33255
33281
|
responseStream.on("end", function handleStreamEnd() {
|
|
33256
33282
|
try {
|
|
@@ -33263,7 +33289,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33263
33289
|
}
|
|
33264
33290
|
response.data = responseData;
|
|
33265
33291
|
} catch (err) {
|
|
33266
|
-
return reject(AxiosError_default.from(err, null,
|
|
33292
|
+
return reject(AxiosError_default.from(err, null, config12, response.request, response));
|
|
33267
33293
|
}
|
|
33268
33294
|
settle(resolve, reject, response);
|
|
33269
33295
|
});
|
|
@@ -33280,18 +33306,18 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33280
33306
|
req.destroy(err);
|
|
33281
33307
|
});
|
|
33282
33308
|
req.on("error", function handleRequestError(err) {
|
|
33283
|
-
reject(AxiosError_default.from(err, null,
|
|
33309
|
+
reject(AxiosError_default.from(err, null, config12, req));
|
|
33284
33310
|
});
|
|
33285
33311
|
req.on("socket", function handleRequestSocket(socket) {
|
|
33286
33312
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
33287
33313
|
});
|
|
33288
|
-
if (
|
|
33289
|
-
const timeout = parseInt(
|
|
33314
|
+
if (config12.timeout) {
|
|
33315
|
+
const timeout = parseInt(config12.timeout, 10);
|
|
33290
33316
|
if (Number.isNaN(timeout)) {
|
|
33291
33317
|
reject(new AxiosError_default(
|
|
33292
33318
|
"error trying to parse `config.timeout` to int",
|
|
33293
33319
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
33294
|
-
|
|
33320
|
+
config12,
|
|
33295
33321
|
req
|
|
33296
33322
|
));
|
|
33297
33323
|
return;
|
|
@@ -33299,15 +33325,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33299
33325
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
33300
33326
|
if (isDone)
|
|
33301
33327
|
return;
|
|
33302
|
-
let timeoutErrorMessage =
|
|
33303
|
-
const transitional2 =
|
|
33304
|
-
if (
|
|
33305
|
-
timeoutErrorMessage =
|
|
33328
|
+
let timeoutErrorMessage = config12.timeout ? "timeout of " + config12.timeout + "ms exceeded" : "timeout exceeded";
|
|
33329
|
+
const transitional2 = config12.transitional || transitional_default;
|
|
33330
|
+
if (config12.timeoutErrorMessage) {
|
|
33331
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
33306
33332
|
}
|
|
33307
33333
|
reject(new AxiosError_default(
|
|
33308
33334
|
timeoutErrorMessage,
|
|
33309
33335
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
33310
|
-
|
|
33336
|
+
config12,
|
|
33311
33337
|
req
|
|
33312
33338
|
));
|
|
33313
33339
|
abort();
|
|
@@ -33325,7 +33351,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config11) {
|
|
|
33325
33351
|
});
|
|
33326
33352
|
data.on("close", () => {
|
|
33327
33353
|
if (!ended && !errored) {
|
|
33328
|
-
abort(new CanceledError_default("Request stream has been aborted",
|
|
33354
|
+
abort(new CanceledError_default("Request stream has been aborted", config12, req));
|
|
33329
33355
|
}
|
|
33330
33356
|
});
|
|
33331
33357
|
data.pipe(req);
|
|
@@ -33421,18 +33447,18 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
33421
33447
|
};
|
|
33422
33448
|
}
|
|
33423
33449
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
33424
|
-
var xhr_default = isXHRAdapterSupported && function(
|
|
33450
|
+
var xhr_default = isXHRAdapterSupported && function(config12) {
|
|
33425
33451
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
33426
|
-
let requestData =
|
|
33427
|
-
const requestHeaders = AxiosHeaders_default.from(
|
|
33428
|
-
let { responseType, withXSRFToken } =
|
|
33452
|
+
let requestData = config12.data;
|
|
33453
|
+
const requestHeaders = AxiosHeaders_default.from(config12.headers).normalize();
|
|
33454
|
+
let { responseType, withXSRFToken } = config12;
|
|
33429
33455
|
let onCanceled;
|
|
33430
33456
|
function done() {
|
|
33431
|
-
if (
|
|
33432
|
-
|
|
33457
|
+
if (config12.cancelToken) {
|
|
33458
|
+
config12.cancelToken.unsubscribe(onCanceled);
|
|
33433
33459
|
}
|
|
33434
|
-
if (
|
|
33435
|
-
|
|
33460
|
+
if (config12.signal) {
|
|
33461
|
+
config12.signal.removeEventListener("abort", onCanceled);
|
|
33436
33462
|
}
|
|
33437
33463
|
}
|
|
33438
33464
|
let contentType;
|
|
@@ -33445,14 +33471,14 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33445
33471
|
}
|
|
33446
33472
|
}
|
|
33447
33473
|
let request3 = new XMLHttpRequest();
|
|
33448
|
-
if (
|
|
33449
|
-
const username =
|
|
33450
|
-
const password =
|
|
33474
|
+
if (config12.auth) {
|
|
33475
|
+
const username = config12.auth.username || "";
|
|
33476
|
+
const password = config12.auth.password ? unescape(encodeURIComponent(config12.auth.password)) : "";
|
|
33451
33477
|
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
33452
33478
|
}
|
|
33453
|
-
const fullPath = buildFullPath(
|
|
33454
|
-
request3.open(
|
|
33455
|
-
request3.timeout =
|
|
33479
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
33480
|
+
request3.open(config12.method.toUpperCase(), buildURL(fullPath, config12.params, config12.paramsSerializer), true);
|
|
33481
|
+
request3.timeout = config12.timeout;
|
|
33456
33482
|
function onloadend() {
|
|
33457
33483
|
if (!request3) {
|
|
33458
33484
|
return;
|
|
@@ -33466,7 +33492,7 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33466
33492
|
status: request3.status,
|
|
33467
33493
|
statusText: request3.statusText,
|
|
33468
33494
|
headers: responseHeaders,
|
|
33469
|
-
config:
|
|
33495
|
+
config: config12,
|
|
33470
33496
|
request: request3
|
|
33471
33497
|
};
|
|
33472
33498
|
settle(function _resolve(value) {
|
|
@@ -33495,33 +33521,33 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33495
33521
|
if (!request3) {
|
|
33496
33522
|
return;
|
|
33497
33523
|
}
|
|
33498
|
-
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED,
|
|
33524
|
+
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config12, request3));
|
|
33499
33525
|
request3 = null;
|
|
33500
33526
|
};
|
|
33501
33527
|
request3.onerror = function handleError() {
|
|
33502
|
-
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK,
|
|
33528
|
+
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config12, request3));
|
|
33503
33529
|
request3 = null;
|
|
33504
33530
|
};
|
|
33505
33531
|
request3.ontimeout = function handleTimeout() {
|
|
33506
|
-
let timeoutErrorMessage =
|
|
33507
|
-
const transitional2 =
|
|
33508
|
-
if (
|
|
33509
|
-
timeoutErrorMessage =
|
|
33532
|
+
let timeoutErrorMessage = config12.timeout ? "timeout of " + config12.timeout + "ms exceeded" : "timeout exceeded";
|
|
33533
|
+
const transitional2 = config12.transitional || transitional_default;
|
|
33534
|
+
if (config12.timeoutErrorMessage) {
|
|
33535
|
+
timeoutErrorMessage = config12.timeoutErrorMessage;
|
|
33510
33536
|
}
|
|
33511
33537
|
reject(new AxiosError_default(
|
|
33512
33538
|
timeoutErrorMessage,
|
|
33513
33539
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
33514
|
-
|
|
33540
|
+
config12,
|
|
33515
33541
|
request3
|
|
33516
33542
|
));
|
|
33517
33543
|
request3 = null;
|
|
33518
33544
|
};
|
|
33519
33545
|
if (platform_default.hasStandardBrowserEnv) {
|
|
33520
|
-
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(
|
|
33546
|
+
withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config12));
|
|
33521
33547
|
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
|
|
33522
|
-
const xsrfValue =
|
|
33548
|
+
const xsrfValue = config12.xsrfHeaderName && config12.xsrfCookieName && cookies_default.read(config12.xsrfCookieName);
|
|
33523
33549
|
if (xsrfValue) {
|
|
33524
|
-
requestHeaders.set(
|
|
33550
|
+
requestHeaders.set(config12.xsrfHeaderName, xsrfValue);
|
|
33525
33551
|
}
|
|
33526
33552
|
}
|
|
33527
33553
|
}
|
|
@@ -33531,35 +33557,35 @@ var xhr_default = isXHRAdapterSupported && function(config11) {
|
|
|
33531
33557
|
request3.setRequestHeader(key, val);
|
|
33532
33558
|
});
|
|
33533
33559
|
}
|
|
33534
|
-
if (!utils_default.isUndefined(
|
|
33535
|
-
request3.withCredentials = !!
|
|
33560
|
+
if (!utils_default.isUndefined(config12.withCredentials)) {
|
|
33561
|
+
request3.withCredentials = !!config12.withCredentials;
|
|
33536
33562
|
}
|
|
33537
33563
|
if (responseType && responseType !== "json") {
|
|
33538
|
-
request3.responseType =
|
|
33564
|
+
request3.responseType = config12.responseType;
|
|
33539
33565
|
}
|
|
33540
|
-
if (typeof
|
|
33541
|
-
request3.addEventListener("progress", progressEventReducer(
|
|
33566
|
+
if (typeof config12.onDownloadProgress === "function") {
|
|
33567
|
+
request3.addEventListener("progress", progressEventReducer(config12.onDownloadProgress, true));
|
|
33542
33568
|
}
|
|
33543
|
-
if (typeof
|
|
33544
|
-
request3.upload.addEventListener("progress", progressEventReducer(
|
|
33569
|
+
if (typeof config12.onUploadProgress === "function" && request3.upload) {
|
|
33570
|
+
request3.upload.addEventListener("progress", progressEventReducer(config12.onUploadProgress));
|
|
33545
33571
|
}
|
|
33546
|
-
if (
|
|
33572
|
+
if (config12.cancelToken || config12.signal) {
|
|
33547
33573
|
onCanceled = (cancel) => {
|
|
33548
33574
|
if (!request3) {
|
|
33549
33575
|
return;
|
|
33550
33576
|
}
|
|
33551
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null,
|
|
33577
|
+
reject(!cancel || cancel.type ? new CanceledError_default(null, config12, request3) : cancel);
|
|
33552
33578
|
request3.abort();
|
|
33553
33579
|
request3 = null;
|
|
33554
33580
|
};
|
|
33555
|
-
|
|
33556
|
-
if (
|
|
33557
|
-
|
|
33581
|
+
config12.cancelToken && config12.cancelToken.subscribe(onCanceled);
|
|
33582
|
+
if (config12.signal) {
|
|
33583
|
+
config12.signal.aborted ? onCanceled() : config12.signal.addEventListener("abort", onCanceled);
|
|
33558
33584
|
}
|
|
33559
33585
|
}
|
|
33560
33586
|
const protocol = parseProtocol(fullPath);
|
|
33561
33587
|
if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
|
|
33562
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST,
|
|
33588
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config12));
|
|
33563
33589
|
return;
|
|
33564
33590
|
}
|
|
33565
33591
|
request3.send(requestData || null);
|
|
@@ -33620,41 +33646,41 @@ var adapters_default = {
|
|
|
33620
33646
|
};
|
|
33621
33647
|
|
|
33622
33648
|
// node_modules/axios/lib/core/dispatchRequest.js
|
|
33623
|
-
function throwIfCancellationRequested(
|
|
33624
|
-
if (
|
|
33625
|
-
|
|
33649
|
+
function throwIfCancellationRequested(config12) {
|
|
33650
|
+
if (config12.cancelToken) {
|
|
33651
|
+
config12.cancelToken.throwIfRequested();
|
|
33626
33652
|
}
|
|
33627
|
-
if (
|
|
33628
|
-
throw new CanceledError_default(null,
|
|
33653
|
+
if (config12.signal && config12.signal.aborted) {
|
|
33654
|
+
throw new CanceledError_default(null, config12);
|
|
33629
33655
|
}
|
|
33630
33656
|
}
|
|
33631
|
-
function dispatchRequest(
|
|
33632
|
-
throwIfCancellationRequested(
|
|
33633
|
-
|
|
33634
|
-
|
|
33635
|
-
|
|
33636
|
-
|
|
33657
|
+
function dispatchRequest(config12) {
|
|
33658
|
+
throwIfCancellationRequested(config12);
|
|
33659
|
+
config12.headers = AxiosHeaders_default.from(config12.headers);
|
|
33660
|
+
config12.data = transformData.call(
|
|
33661
|
+
config12,
|
|
33662
|
+
config12.transformRequest
|
|
33637
33663
|
);
|
|
33638
|
-
if (["post", "put", "patch"].indexOf(
|
|
33639
|
-
|
|
33664
|
+
if (["post", "put", "patch"].indexOf(config12.method) !== -1) {
|
|
33665
|
+
config12.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
33640
33666
|
}
|
|
33641
|
-
const adapter = adapters_default.getAdapter(
|
|
33642
|
-
return adapter(
|
|
33643
|
-
throwIfCancellationRequested(
|
|
33667
|
+
const adapter = adapters_default.getAdapter(config12.adapter || defaults_default.adapter);
|
|
33668
|
+
return adapter(config12).then(function onAdapterResolution(response) {
|
|
33669
|
+
throwIfCancellationRequested(config12);
|
|
33644
33670
|
response.data = transformData.call(
|
|
33645
|
-
|
|
33646
|
-
|
|
33671
|
+
config12,
|
|
33672
|
+
config12.transformResponse,
|
|
33647
33673
|
response
|
|
33648
33674
|
);
|
|
33649
33675
|
response.headers = AxiosHeaders_default.from(response.headers);
|
|
33650
33676
|
return response;
|
|
33651
33677
|
}, function onAdapterRejection(reason) {
|
|
33652
33678
|
if (!isCancel(reason)) {
|
|
33653
|
-
throwIfCancellationRequested(
|
|
33679
|
+
throwIfCancellationRequested(config12);
|
|
33654
33680
|
if (reason && reason.response) {
|
|
33655
33681
|
reason.response.data = transformData.call(
|
|
33656
|
-
|
|
33657
|
-
|
|
33682
|
+
config12,
|
|
33683
|
+
config12.transformResponse,
|
|
33658
33684
|
reason.response
|
|
33659
33685
|
);
|
|
33660
33686
|
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
@@ -33668,7 +33694,7 @@ function dispatchRequest(config11) {
|
|
|
33668
33694
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
|
|
33669
33695
|
function mergeConfig(config1, config22) {
|
|
33670
33696
|
config22 = config22 || {};
|
|
33671
|
-
const
|
|
33697
|
+
const config12 = {};
|
|
33672
33698
|
function getMergedValue(target, source, caseless) {
|
|
33673
33699
|
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
33674
33700
|
return utils_default.merge.call({ caseless }, target, source);
|
|
@@ -33739,9 +33765,9 @@ function mergeConfig(config1, config22) {
|
|
|
33739
33765
|
utils_default.forEach(Object.keys(Object.assign({}, config1, config22)), function computeConfigValue(prop) {
|
|
33740
33766
|
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
33741
33767
|
const configValue = merge2(config1[prop], config22[prop], prop);
|
|
33742
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (
|
|
33768
|
+
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config12[prop] = configValue);
|
|
33743
33769
|
});
|
|
33744
|
-
return
|
|
33770
|
+
return config12;
|
|
33745
33771
|
}
|
|
33746
33772
|
|
|
33747
33773
|
// node_modules/axios/lib/helpers/validator.js
|
|
@@ -33812,9 +33838,9 @@ var Axios = class {
|
|
|
33812
33838
|
response: new InterceptorManager_default()
|
|
33813
33839
|
};
|
|
33814
33840
|
}
|
|
33815
|
-
async request(configOrUrl,
|
|
33841
|
+
async request(configOrUrl, config12) {
|
|
33816
33842
|
try {
|
|
33817
|
-
return await this._request(configOrUrl,
|
|
33843
|
+
return await this._request(configOrUrl, config12);
|
|
33818
33844
|
} catch (err) {
|
|
33819
33845
|
if (err instanceof Error) {
|
|
33820
33846
|
let dummy;
|
|
@@ -33829,15 +33855,15 @@ var Axios = class {
|
|
|
33829
33855
|
throw err;
|
|
33830
33856
|
}
|
|
33831
33857
|
}
|
|
33832
|
-
_request(configOrUrl,
|
|
33858
|
+
_request(configOrUrl, config12) {
|
|
33833
33859
|
if (typeof configOrUrl === "string") {
|
|
33834
|
-
|
|
33835
|
-
|
|
33860
|
+
config12 = config12 || {};
|
|
33861
|
+
config12.url = configOrUrl;
|
|
33836
33862
|
} else {
|
|
33837
|
-
|
|
33863
|
+
config12 = configOrUrl || {};
|
|
33838
33864
|
}
|
|
33839
|
-
|
|
33840
|
-
const { transitional: transitional2, paramsSerializer, headers } =
|
|
33865
|
+
config12 = mergeConfig(this.defaults, config12);
|
|
33866
|
+
const { transitional: transitional2, paramsSerializer, headers } = config12;
|
|
33841
33867
|
if (transitional2 !== void 0) {
|
|
33842
33868
|
validator_default.assertOptions(transitional2, {
|
|
33843
33869
|
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
@@ -33847,7 +33873,7 @@ var Axios = class {
|
|
|
33847
33873
|
}
|
|
33848
33874
|
if (paramsSerializer != null) {
|
|
33849
33875
|
if (utils_default.isFunction(paramsSerializer)) {
|
|
33850
|
-
|
|
33876
|
+
config12.paramsSerializer = {
|
|
33851
33877
|
serialize: paramsSerializer
|
|
33852
33878
|
};
|
|
33853
33879
|
} else {
|
|
@@ -33857,10 +33883,10 @@ var Axios = class {
|
|
|
33857
33883
|
}, true);
|
|
33858
33884
|
}
|
|
33859
33885
|
}
|
|
33860
|
-
|
|
33886
|
+
config12.method = (config12.method || this.defaults.method || "get").toLowerCase();
|
|
33861
33887
|
let contextHeaders = headers && utils_default.merge(
|
|
33862
33888
|
headers.common,
|
|
33863
|
-
headers[
|
|
33889
|
+
headers[config12.method]
|
|
33864
33890
|
);
|
|
33865
33891
|
headers && utils_default.forEach(
|
|
33866
33892
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
@@ -33868,11 +33894,11 @@ var Axios = class {
|
|
|
33868
33894
|
delete headers[method];
|
|
33869
33895
|
}
|
|
33870
33896
|
);
|
|
33871
|
-
|
|
33897
|
+
config12.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
33872
33898
|
const requestInterceptorChain = [];
|
|
33873
33899
|
let synchronousRequestInterceptors = true;
|
|
33874
33900
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
33875
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(
|
|
33901
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config12) === false) {
|
|
33876
33902
|
return;
|
|
33877
33903
|
}
|
|
33878
33904
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
@@ -33890,14 +33916,14 @@ var Axios = class {
|
|
|
33890
33916
|
chain.unshift.apply(chain, requestInterceptorChain);
|
|
33891
33917
|
chain.push.apply(chain, responseInterceptorChain);
|
|
33892
33918
|
len = chain.length;
|
|
33893
|
-
promise = Promise.resolve(
|
|
33919
|
+
promise = Promise.resolve(config12);
|
|
33894
33920
|
while (i3 < len) {
|
|
33895
33921
|
promise = promise.then(chain[i3++], chain[i3++]);
|
|
33896
33922
|
}
|
|
33897
33923
|
return promise;
|
|
33898
33924
|
}
|
|
33899
33925
|
len = requestInterceptorChain.length;
|
|
33900
|
-
let newConfig =
|
|
33926
|
+
let newConfig = config12;
|
|
33901
33927
|
i3 = 0;
|
|
33902
33928
|
while (i3 < len) {
|
|
33903
33929
|
const onFulfilled = requestInterceptorChain[i3++];
|
|
@@ -33921,25 +33947,25 @@ var Axios = class {
|
|
|
33921
33947
|
}
|
|
33922
33948
|
return promise;
|
|
33923
33949
|
}
|
|
33924
|
-
getUri(
|
|
33925
|
-
|
|
33926
|
-
const fullPath = buildFullPath(
|
|
33927
|
-
return buildURL(fullPath,
|
|
33950
|
+
getUri(config12) {
|
|
33951
|
+
config12 = mergeConfig(this.defaults, config12);
|
|
33952
|
+
const fullPath = buildFullPath(config12.baseURL, config12.url);
|
|
33953
|
+
return buildURL(fullPath, config12.params, config12.paramsSerializer);
|
|
33928
33954
|
}
|
|
33929
33955
|
};
|
|
33930
33956
|
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
|
|
33931
|
-
Axios.prototype[method] = function(url2,
|
|
33932
|
-
return this.request(mergeConfig(
|
|
33957
|
+
Axios.prototype[method] = function(url2, config12) {
|
|
33958
|
+
return this.request(mergeConfig(config12 || {}, {
|
|
33933
33959
|
method,
|
|
33934
33960
|
url: url2,
|
|
33935
|
-
data: (
|
|
33961
|
+
data: (config12 || {}).data
|
|
33936
33962
|
}));
|
|
33937
33963
|
};
|
|
33938
33964
|
});
|
|
33939
33965
|
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
|
|
33940
33966
|
function generateHTTPMethod(isForm) {
|
|
33941
|
-
return function httpMethod(url2, data,
|
|
33942
|
-
return this.request(mergeConfig(
|
|
33967
|
+
return function httpMethod(url2, data, config12) {
|
|
33968
|
+
return this.request(mergeConfig(config12 || {}, {
|
|
33943
33969
|
method,
|
|
33944
33970
|
headers: isForm ? {
|
|
33945
33971
|
"Content-Type": "multipart/form-data"
|
|
@@ -33985,11 +34011,11 @@ var CancelToken = class {
|
|
|
33985
34011
|
};
|
|
33986
34012
|
return promise;
|
|
33987
34013
|
};
|
|
33988
|
-
executor(function cancel(message,
|
|
34014
|
+
executor(function cancel(message, config12, request3) {
|
|
33989
34015
|
if (token.reason) {
|
|
33990
34016
|
return;
|
|
33991
34017
|
}
|
|
33992
|
-
token.reason = new CanceledError_default(message,
|
|
34018
|
+
token.reason = new CanceledError_default(message, config12, request3);
|
|
33993
34019
|
resolvePromise(token.reason);
|
|
33994
34020
|
});
|
|
33995
34021
|
}
|
|
@@ -34205,11 +34231,9 @@ if (provider === "openai" && !apiKey && command !== "config" && mode !== "set" /
|
|
|
34205
34231
|
process.exit(1);
|
|
34206
34232
|
}
|
|
34207
34233
|
var MODEL = config3?.OCO_MODEL || "gpt-3.5-turbo";
|
|
34208
|
-
if (provider === "openai" &&
|
|
34234
|
+
if (provider === "openai" && MODEL.typeof !== "string" && command !== "config" && mode !== "set" /* set */) {
|
|
34209
34235
|
ce(
|
|
34210
|
-
`${source_default.red("\u2716")} Unsupported model ${MODEL}
|
|
34211
|
-
", "
|
|
34212
|
-
)}`
|
|
34236
|
+
`${source_default.red("\u2716")} Unsupported model ${MODEL}. The model can be any string, but the current configuration is not supported.`
|
|
34213
34237
|
);
|
|
34214
34238
|
process.exit(1);
|
|
34215
34239
|
}
|
|
@@ -37254,11 +37278,9 @@ if (provider2 === "anthropic" && !apiKey2 && command2 !== "config" && mode2 !==
|
|
|
37254
37278
|
process.exit(1);
|
|
37255
37279
|
}
|
|
37256
37280
|
var MODEL2 = config5?.OCO_MODEL;
|
|
37257
|
-
if (provider2 === "anthropic" &&
|
|
37281
|
+
if (provider2 === "anthropic" && MODEL2.typeof !== "string" && command2 !== "config" && mode2 !== "set" /* set */) {
|
|
37258
37282
|
ce(
|
|
37259
|
-
`${source_default.red("\u2716")} Unsupported model ${MODEL2}
|
|
37260
|
-
", "
|
|
37261
|
-
)}`
|
|
37283
|
+
`${source_default.red("\u2716")} Unsupported model ${MODEL2}. The model can be any string, but the current configuration is not supported.`
|
|
37262
37284
|
);
|
|
37263
37285
|
process.exit(1);
|
|
37264
37286
|
}
|
|
@@ -41016,15 +41038,45 @@ var Azure = class {
|
|
|
41016
41038
|
};
|
|
41017
41039
|
var azure = new Azure();
|
|
41018
41040
|
|
|
41041
|
+
// src/engine/flowise.ts
|
|
41042
|
+
var config7 = getConfig();
|
|
41043
|
+
var FlowiseAi = class {
|
|
41044
|
+
async generateCommitMessage(messages) {
|
|
41045
|
+
const gitDiff = messages[messages.length - 1]?.content?.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
|
|
41046
|
+
const url2 = `http://${config7?.OCO_FLOWISE_ENDPOINT}/api/v1/prediction/${config7?.OCO_FLOWISE_API_KEY}`;
|
|
41047
|
+
const payload = {
|
|
41048
|
+
question: gitDiff,
|
|
41049
|
+
overrideConfig: {
|
|
41050
|
+
systemMessagePrompt: messages[0]?.content
|
|
41051
|
+
},
|
|
41052
|
+
history: messages.slice(1, -1)
|
|
41053
|
+
};
|
|
41054
|
+
try {
|
|
41055
|
+
const response = await axios_default.post(url2, payload, {
|
|
41056
|
+
headers: {
|
|
41057
|
+
"Content-Type": "application/json"
|
|
41058
|
+
}
|
|
41059
|
+
});
|
|
41060
|
+
const message = response.data;
|
|
41061
|
+
return message?.text;
|
|
41062
|
+
} catch (err) {
|
|
41063
|
+
const message = err.response?.data?.error ?? err.message;
|
|
41064
|
+
throw new Error("local model issues. details: " + message);
|
|
41065
|
+
}
|
|
41066
|
+
}
|
|
41067
|
+
};
|
|
41068
|
+
|
|
41019
41069
|
// src/utils/engine.ts
|
|
41020
41070
|
function getEngine() {
|
|
41021
|
-
const
|
|
41022
|
-
const provider4 =
|
|
41071
|
+
const config12 = getConfig();
|
|
41072
|
+
const provider4 = config12?.OCO_AI_PROVIDER;
|
|
41023
41073
|
if (provider4?.startsWith("ollama")) {
|
|
41024
41074
|
const ollamaAi = new OllamaAi();
|
|
41025
|
-
const model = provider4.
|
|
41026
|
-
if (model)
|
|
41075
|
+
const model = provider4.substring("ollama/".length);
|
|
41076
|
+
if (model) {
|
|
41027
41077
|
ollamaAi.setModel(model);
|
|
41078
|
+
ollamaAi.setUrl(config12?.OCO_OLLAMA_API_URL);
|
|
41079
|
+
}
|
|
41028
41080
|
return ollamaAi;
|
|
41029
41081
|
} else if (provider4 == "anthropic") {
|
|
41030
41082
|
return new AnthropicAi();
|
|
@@ -41034,13 +41086,15 @@ function getEngine() {
|
|
|
41034
41086
|
return new Gemini();
|
|
41035
41087
|
} else if (provider4 == "azure") {
|
|
41036
41088
|
return new Azure();
|
|
41089
|
+
} else if (provider4 == "flowise") {
|
|
41090
|
+
return new FlowiseAi();
|
|
41037
41091
|
}
|
|
41038
41092
|
return new OpenAi();
|
|
41039
41093
|
}
|
|
41040
41094
|
|
|
41041
41095
|
// src/modules/commitlint/config.ts
|
|
41042
|
-
var
|
|
41043
|
-
var translation2 = i18n[
|
|
41096
|
+
var config8 = getConfig();
|
|
41097
|
+
var translation2 = i18n[config8?.OCO_LANGUAGE || "en"];
|
|
41044
41098
|
var configureCommitlintIntegration = async (force = false) => {
|
|
41045
41099
|
const spin = le();
|
|
41046
41100
|
spin.start("Loading @commitlint configuration");
|
|
@@ -41093,15 +41147,15 @@ function removeConventionalCommitWord(message) {
|
|
|
41093
41147
|
}
|
|
41094
41148
|
|
|
41095
41149
|
// src/prompts.ts
|
|
41096
|
-
var
|
|
41097
|
-
var translation3 = i18n[
|
|
41150
|
+
var config9 = getConfig();
|
|
41151
|
+
var translation3 = i18n[config9?.OCO_LANGUAGE || "en"];
|
|
41098
41152
|
var IDENTITY = "You are to act as the author of a commit message in git.";
|
|
41099
41153
|
var INIT_MAIN_PROMPT2 = (language, fullGitMojiSpec) => ({
|
|
41100
41154
|
role: import_openai4.ChatCompletionRequestMessageRoleEnum.System,
|
|
41101
41155
|
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
|
-
${
|
|
41156
|
+
${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."}
|
|
41157
|
+
${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."}
|
|
41158
|
+
${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
41159
|
Use the present tense. Lines must not be longer than 74 characters. Use ${language} for the commit message.`
|
|
41106
41160
|
});
|
|
41107
41161
|
var INIT_DIFF_PROMPT = {
|
|
@@ -41133,12 +41187,12 @@ var INIT_DIFF_PROMPT = {
|
|
|
41133
41187
|
};
|
|
41134
41188
|
var INIT_CONSISTENCY_PROMPT = (translation4) => ({
|
|
41135
41189
|
role: import_openai4.ChatCompletionRequestMessageRoleEnum.Assistant,
|
|
41136
|
-
content: `${
|
|
41137
|
-
${
|
|
41138
|
-
${
|
|
41190
|
+
content: `${config9?.OCO_EMOJI ? `\u{1F41B} ${removeConventionalCommitWord(translation4.commitFix)}` : translation4.commitFix}
|
|
41191
|
+
${config9?.OCO_EMOJI ? `\u2728 ${removeConventionalCommitWord(translation4.commitFeat)}` : translation4.commitFeat}
|
|
41192
|
+
${config9?.OCO_DESCRIPTION ? translation4.commitDescription : ""}`
|
|
41139
41193
|
});
|
|
41140
41194
|
var getMainCommitPrompt = async (fullGitMojiSpec) => {
|
|
41141
|
-
switch (
|
|
41195
|
+
switch (config9?.OCO_PROMPT_MODULE) {
|
|
41142
41196
|
case "@commitlint":
|
|
41143
41197
|
if (!await commitlintLLMConfigExists()) {
|
|
41144
41198
|
ie(
|
|
@@ -41183,9 +41237,9 @@ function mergeDiffs(arr, maxStringLength) {
|
|
|
41183
41237
|
}
|
|
41184
41238
|
|
|
41185
41239
|
// src/generateCommitMessageFromGitDiff.ts
|
|
41186
|
-
var
|
|
41187
|
-
var MAX_TOKENS_INPUT4 =
|
|
41188
|
-
var MAX_TOKENS_OUTPUT4 =
|
|
41240
|
+
var config10 = getConfig();
|
|
41241
|
+
var MAX_TOKENS_INPUT4 = config10?.OCO_TOKENS_MAX_INPUT || 4096 /* DEFAULT_MAX_TOKENS_INPUT */;
|
|
41242
|
+
var MAX_TOKENS_OUTPUT4 = config10?.OCO_TOKENS_MAX_OUTPUT || 500 /* DEFAULT_MAX_TOKENS_OUTPUT */;
|
|
41189
41243
|
var generateCommitMessageChatCompletionPrompt = async (diff, fullGitMojiSpec) => {
|
|
41190
41244
|
const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec);
|
|
41191
41245
|
const chatContextAsCompletionRequest = [...INIT_MESSAGES_PROMPT];
|
|
@@ -41417,14 +41471,14 @@ var trytm = async (promise) => {
|
|
|
41417
41471
|
};
|
|
41418
41472
|
|
|
41419
41473
|
// src/commands/commit.ts
|
|
41420
|
-
var
|
|
41474
|
+
var config11 = getConfig();
|
|
41421
41475
|
var getGitRemotes = async () => {
|
|
41422
41476
|
const { stdout } = await execa("git", ["remote"]);
|
|
41423
41477
|
return stdout.split("\n").filter((remote) => Boolean(remote.trim()));
|
|
41424
41478
|
};
|
|
41425
41479
|
var checkMessageTemplate = (extraArgs2) => {
|
|
41426
41480
|
for (const key in extraArgs2) {
|
|
41427
|
-
if (extraArgs2[key].includes(
|
|
41481
|
+
if (extraArgs2[key].includes(config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER))
|
|
41428
41482
|
return extraArgs2[key];
|
|
41429
41483
|
}
|
|
41430
41484
|
return false;
|
|
@@ -41439,11 +41493,11 @@ var generateCommitMessageFromGitDiff = async (diff, extraArgs2, fullGitMojiSpec,
|
|
|
41439
41493
|
fullGitMojiSpec
|
|
41440
41494
|
);
|
|
41441
41495
|
const messageTemplate = checkMessageTemplate(extraArgs2);
|
|
41442
|
-
if (
|
|
41496
|
+
if (config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER && typeof messageTemplate === "string") {
|
|
41443
41497
|
const messageTemplateIndex = extraArgs2.indexOf(messageTemplate);
|
|
41444
41498
|
extraArgs2.splice(messageTemplateIndex, 1);
|
|
41445
41499
|
commitMessage = messageTemplate.replace(
|
|
41446
|
-
|
|
41500
|
+
config11?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
|
|
41447
41501
|
commitMessage
|
|
41448
41502
|
);
|
|
41449
41503
|
}
|
|
@@ -41467,7 +41521,7 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
|
|
|
41467
41521
|
ce(`${source_default.green("\u2714")} Successfully committed`);
|
|
41468
41522
|
ce(stdout);
|
|
41469
41523
|
const remotes = await getGitRemotes();
|
|
41470
|
-
if (
|
|
41524
|
+
if (config11?.OCO_GITPUSH === false)
|
|
41471
41525
|
return;
|
|
41472
41526
|
if (!remotes.length) {
|
|
41473
41527
|
const { stdout: stdout2 } = await execa("git", ["push"]);
|
|
@@ -41475,7 +41529,7 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2
|
|
|
41475
41529
|
ce(stdout2);
|
|
41476
41530
|
process.exit(0);
|
|
41477
41531
|
}
|
|
41478
|
-
if (remotes.length === 1 &&
|
|
41532
|
+
if (remotes.length === 1 && config11?.OCO_GITPUSH !== true) {
|
|
41479
41533
|
const isPushConfirmedByUser = await Q3({
|
|
41480
41534
|
message: "Do you want to run `git push`?"
|
|
41481
41535
|
});
|
|
@@ -41737,8 +41791,8 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
|
41737
41791
|
if (!staged)
|
|
41738
41792
|
return;
|
|
41739
41793
|
ae("opencommit");
|
|
41740
|
-
const
|
|
41741
|
-
if (!
|
|
41794
|
+
const config12 = getConfig();
|
|
41795
|
+
if (!config12?.OCO_OPENAI_API_KEY && !config12?.OCO_ANTHROPIC_API_KEY && !config12?.OCO_AZURE_API_KEY) {
|
|
41742
41796
|
throw new Error(
|
|
41743
41797
|
"No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit"
|
|
41744
41798
|
);
|