opencommit 2.2.10 → 2.4.0
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/README.md +60 -44
- package/out/cli.cjs +478 -452
- package/out/github-action.cjs +20 -6
- package/package.json +2 -2
package/out/cli.cjs
CHANGED
|
@@ -22,6 +22,116 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
|
|
25
|
+
// node_modules/sisteransi/src/index.js
|
|
26
|
+
var require_src = __commonJS({
|
|
27
|
+
"node_modules/sisteransi/src/index.js"(exports, module2) {
|
|
28
|
+
"use strict";
|
|
29
|
+
var ESC = "\x1B";
|
|
30
|
+
var CSI = `${ESC}[`;
|
|
31
|
+
var beep = "\x07";
|
|
32
|
+
var cursor = {
|
|
33
|
+
to(x4, y5) {
|
|
34
|
+
if (!y5)
|
|
35
|
+
return `${CSI}${x4 + 1}G`;
|
|
36
|
+
return `${CSI}${y5 + 1};${x4 + 1}H`;
|
|
37
|
+
},
|
|
38
|
+
move(x4, y5) {
|
|
39
|
+
let ret = "";
|
|
40
|
+
if (x4 < 0)
|
|
41
|
+
ret += `${CSI}${-x4}D`;
|
|
42
|
+
else if (x4 > 0)
|
|
43
|
+
ret += `${CSI}${x4}C`;
|
|
44
|
+
if (y5 < 0)
|
|
45
|
+
ret += `${CSI}${-y5}A`;
|
|
46
|
+
else if (y5 > 0)
|
|
47
|
+
ret += `${CSI}${y5}B`;
|
|
48
|
+
return ret;
|
|
49
|
+
},
|
|
50
|
+
up: (count = 1) => `${CSI}${count}A`,
|
|
51
|
+
down: (count = 1) => `${CSI}${count}B`,
|
|
52
|
+
forward: (count = 1) => `${CSI}${count}C`,
|
|
53
|
+
backward: (count = 1) => `${CSI}${count}D`,
|
|
54
|
+
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
55
|
+
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
56
|
+
left: `${CSI}G`,
|
|
57
|
+
hide: `${CSI}?25l`,
|
|
58
|
+
show: `${CSI}?25h`,
|
|
59
|
+
save: `${ESC}7`,
|
|
60
|
+
restore: `${ESC}8`
|
|
61
|
+
};
|
|
62
|
+
var scroll = {
|
|
63
|
+
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
64
|
+
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
65
|
+
};
|
|
66
|
+
var erase = {
|
|
67
|
+
screen: `${CSI}2J`,
|
|
68
|
+
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
69
|
+
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
70
|
+
line: `${CSI}2K`,
|
|
71
|
+
lineEnd: `${CSI}K`,
|
|
72
|
+
lineStart: `${CSI}1K`,
|
|
73
|
+
lines(count) {
|
|
74
|
+
let clear = "";
|
|
75
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
76
|
+
clear += this.line + (i2 < count - 1 ? cursor.up() : "");
|
|
77
|
+
if (count)
|
|
78
|
+
clear += cursor.left;
|
|
79
|
+
return clear;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
module2.exports = { cursor, scroll, erase, beep };
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
// node_modules/picocolors/picocolors.js
|
|
87
|
+
var require_picocolors = __commonJS({
|
|
88
|
+
"node_modules/picocolors/picocolors.js"(exports, module2) {
|
|
89
|
+
var tty2 = require("tty");
|
|
90
|
+
var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
|
|
91
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
92
|
+
let string = "" + input;
|
|
93
|
+
let index = string.indexOf(close, open.length);
|
|
94
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
95
|
+
};
|
|
96
|
+
var replaceClose = (string, close, replace, index) => {
|
|
97
|
+
let start = string.substring(0, index) + replace;
|
|
98
|
+
let end = string.substring(index + close.length);
|
|
99
|
+
let nextIndex = end.indexOf(close);
|
|
100
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
101
|
+
};
|
|
102
|
+
var createColors = (enabled = isColorSupported) => ({
|
|
103
|
+
isColorSupported: enabled,
|
|
104
|
+
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
105
|
+
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
106
|
+
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
107
|
+
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
108
|
+
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
109
|
+
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
110
|
+
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
111
|
+
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
112
|
+
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
113
|
+
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
114
|
+
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
115
|
+
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
116
|
+
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
117
|
+
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
118
|
+
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
119
|
+
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
120
|
+
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
121
|
+
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
122
|
+
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
123
|
+
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
124
|
+
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
125
|
+
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
126
|
+
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
127
|
+
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
128
|
+
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
129
|
+
});
|
|
130
|
+
module2.exports = createColors();
|
|
131
|
+
module2.exports.createColors = createColors;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
25
135
|
// node_modules/ini/lib/ini.js
|
|
26
136
|
var require_ini = __commonJS({
|
|
27
137
|
"node_modules/ini/lib/ini.js"(exports, module2) {
|
|
@@ -201,116 +311,6 @@ var require_ini = __commonJS({
|
|
|
201
311
|
}
|
|
202
312
|
});
|
|
203
313
|
|
|
204
|
-
// node_modules/sisteransi/src/index.js
|
|
205
|
-
var require_src = __commonJS({
|
|
206
|
-
"node_modules/sisteransi/src/index.js"(exports, module2) {
|
|
207
|
-
"use strict";
|
|
208
|
-
var ESC = "\x1B";
|
|
209
|
-
var CSI = `${ESC}[`;
|
|
210
|
-
var beep = "\x07";
|
|
211
|
-
var cursor = {
|
|
212
|
-
to(x4, y5) {
|
|
213
|
-
if (!y5)
|
|
214
|
-
return `${CSI}${x4 + 1}G`;
|
|
215
|
-
return `${CSI}${y5 + 1};${x4 + 1}H`;
|
|
216
|
-
},
|
|
217
|
-
move(x4, y5) {
|
|
218
|
-
let ret = "";
|
|
219
|
-
if (x4 < 0)
|
|
220
|
-
ret += `${CSI}${-x4}D`;
|
|
221
|
-
else if (x4 > 0)
|
|
222
|
-
ret += `${CSI}${x4}C`;
|
|
223
|
-
if (y5 < 0)
|
|
224
|
-
ret += `${CSI}${-y5}A`;
|
|
225
|
-
else if (y5 > 0)
|
|
226
|
-
ret += `${CSI}${y5}B`;
|
|
227
|
-
return ret;
|
|
228
|
-
},
|
|
229
|
-
up: (count = 1) => `${CSI}${count}A`,
|
|
230
|
-
down: (count = 1) => `${CSI}${count}B`,
|
|
231
|
-
forward: (count = 1) => `${CSI}${count}C`,
|
|
232
|
-
backward: (count = 1) => `${CSI}${count}D`,
|
|
233
|
-
nextLine: (count = 1) => `${CSI}E`.repeat(count),
|
|
234
|
-
prevLine: (count = 1) => `${CSI}F`.repeat(count),
|
|
235
|
-
left: `${CSI}G`,
|
|
236
|
-
hide: `${CSI}?25l`,
|
|
237
|
-
show: `${CSI}?25h`,
|
|
238
|
-
save: `${ESC}7`,
|
|
239
|
-
restore: `${ESC}8`
|
|
240
|
-
};
|
|
241
|
-
var scroll = {
|
|
242
|
-
up: (count = 1) => `${CSI}S`.repeat(count),
|
|
243
|
-
down: (count = 1) => `${CSI}T`.repeat(count)
|
|
244
|
-
};
|
|
245
|
-
var erase = {
|
|
246
|
-
screen: `${CSI}2J`,
|
|
247
|
-
up: (count = 1) => `${CSI}1J`.repeat(count),
|
|
248
|
-
down: (count = 1) => `${CSI}J`.repeat(count),
|
|
249
|
-
line: `${CSI}2K`,
|
|
250
|
-
lineEnd: `${CSI}K`,
|
|
251
|
-
lineStart: `${CSI}1K`,
|
|
252
|
-
lines(count) {
|
|
253
|
-
let clear = "";
|
|
254
|
-
for (let i2 = 0; i2 < count; i2++)
|
|
255
|
-
clear += this.line + (i2 < count - 1 ? cursor.up() : "");
|
|
256
|
-
if (count)
|
|
257
|
-
clear += cursor.left;
|
|
258
|
-
return clear;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
module2.exports = { cursor, scroll, erase, beep };
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
// node_modules/picocolors/picocolors.js
|
|
266
|
-
var require_picocolors = __commonJS({
|
|
267
|
-
"node_modules/picocolors/picocolors.js"(exports, module2) {
|
|
268
|
-
var tty2 = require("tty");
|
|
269
|
-
var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
|
|
270
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
271
|
-
let string = "" + input;
|
|
272
|
-
let index = string.indexOf(close, open.length);
|
|
273
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
274
|
-
};
|
|
275
|
-
var replaceClose = (string, close, replace, index) => {
|
|
276
|
-
let start = string.substring(0, index) + replace;
|
|
277
|
-
let end = string.substring(index + close.length);
|
|
278
|
-
let nextIndex = end.indexOf(close);
|
|
279
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
280
|
-
};
|
|
281
|
-
var createColors = (enabled = isColorSupported) => ({
|
|
282
|
-
isColorSupported: enabled,
|
|
283
|
-
reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
|
|
284
|
-
bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
|
|
285
|
-
dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
|
|
286
|
-
italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
|
|
287
|
-
underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
|
|
288
|
-
inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
|
|
289
|
-
hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
|
|
290
|
-
strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
|
|
291
|
-
black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
|
|
292
|
-
red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
|
|
293
|
-
green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
|
|
294
|
-
yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
|
|
295
|
-
blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
|
|
296
|
-
magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
|
|
297
|
-
cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
|
|
298
|
-
white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
|
|
299
|
-
gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
|
|
300
|
-
bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
|
|
301
|
-
bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
|
|
302
|
-
bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
|
|
303
|
-
bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
|
|
304
|
-
bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
|
|
305
|
-
bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
|
|
306
|
-
bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
|
|
307
|
-
bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
|
|
308
|
-
});
|
|
309
|
-
module2.exports = createColors();
|
|
310
|
-
module2.exports.createColors = createColors;
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
|
|
314
314
|
// node_modules/dotenv/package.json
|
|
315
315
|
var require_package = __commonJS({
|
|
316
316
|
"node_modules/dotenv/package.json"(exports, module2) {
|
|
@@ -411,7 +411,7 @@ var require_main = __commonJS({
|
|
|
411
411
|
function _resolveHome(envPath) {
|
|
412
412
|
return envPath[0] === "~" ? path4.join(os3.homedir(), envPath.slice(1)) : envPath;
|
|
413
413
|
}
|
|
414
|
-
function
|
|
414
|
+
function config5(options) {
|
|
415
415
|
let dotenvPath = path4.resolve(process.cwd(), ".env");
|
|
416
416
|
let encoding = "utf8";
|
|
417
417
|
const debug = Boolean(options && options.debug);
|
|
@@ -451,7 +451,7 @@ var require_main = __commonJS({
|
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
var DotenvModule = {
|
|
454
|
-
config:
|
|
454
|
+
config: config5,
|
|
455
455
|
parse
|
|
456
456
|
};
|
|
457
457
|
module2.exports.config = DotenvModule.config;
|
|
@@ -1841,8 +1841,8 @@ var require_normalizeHeaderName = __commonJS({
|
|
|
1841
1841
|
var require_enhanceError = __commonJS({
|
|
1842
1842
|
"node_modules/openai/node_modules/axios/lib/core/enhanceError.js"(exports, module2) {
|
|
1843
1843
|
"use strict";
|
|
1844
|
-
module2.exports = function enhanceError(error,
|
|
1845
|
-
error.config =
|
|
1844
|
+
module2.exports = function enhanceError(error, config5, code, request, response) {
|
|
1845
|
+
error.config = config5;
|
|
1846
1846
|
if (code) {
|
|
1847
1847
|
error.code = code;
|
|
1848
1848
|
}
|
|
@@ -1886,9 +1886,9 @@ var require_createError = __commonJS({
|
|
|
1886
1886
|
"node_modules/openai/node_modules/axios/lib/core/createError.js"(exports, module2) {
|
|
1887
1887
|
"use strict";
|
|
1888
1888
|
var enhanceError = require_enhanceError();
|
|
1889
|
-
module2.exports = function createError(message,
|
|
1889
|
+
module2.exports = function createError(message, config5, code, request, response) {
|
|
1890
1890
|
var error = new Error(message);
|
|
1891
|
-
return enhanceError(error,
|
|
1891
|
+
return enhanceError(error, config5, code, request, response);
|
|
1892
1892
|
};
|
|
1893
1893
|
}
|
|
1894
1894
|
});
|
|
@@ -2117,32 +2117,32 @@ var require_xhr = __commonJS({
|
|
|
2117
2117
|
var createError = require_createError();
|
|
2118
2118
|
var transitionalDefaults = require_transitional();
|
|
2119
2119
|
var Cancel2 = require_Cancel();
|
|
2120
|
-
module2.exports = function xhrAdapter(
|
|
2120
|
+
module2.exports = function xhrAdapter(config5) {
|
|
2121
2121
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
2122
|
-
var requestData =
|
|
2123
|
-
var requestHeaders =
|
|
2124
|
-
var responseType =
|
|
2122
|
+
var requestData = config5.data;
|
|
2123
|
+
var requestHeaders = config5.headers;
|
|
2124
|
+
var responseType = config5.responseType;
|
|
2125
2125
|
var onCanceled;
|
|
2126
2126
|
function done() {
|
|
2127
|
-
if (
|
|
2128
|
-
|
|
2127
|
+
if (config5.cancelToken) {
|
|
2128
|
+
config5.cancelToken.unsubscribe(onCanceled);
|
|
2129
2129
|
}
|
|
2130
|
-
if (
|
|
2131
|
-
|
|
2130
|
+
if (config5.signal) {
|
|
2131
|
+
config5.signal.removeEventListener("abort", onCanceled);
|
|
2132
2132
|
}
|
|
2133
2133
|
}
|
|
2134
2134
|
if (utils.isFormData(requestData)) {
|
|
2135
2135
|
delete requestHeaders["Content-Type"];
|
|
2136
2136
|
}
|
|
2137
2137
|
var request = new XMLHttpRequest();
|
|
2138
|
-
if (
|
|
2139
|
-
var username =
|
|
2140
|
-
var password =
|
|
2138
|
+
if (config5.auth) {
|
|
2139
|
+
var username = config5.auth.username || "";
|
|
2140
|
+
var password = config5.auth.password ? unescape(encodeURIComponent(config5.auth.password)) : "";
|
|
2141
2141
|
requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
|
|
2142
2142
|
}
|
|
2143
|
-
var fullPath = buildFullPath2(
|
|
2144
|
-
request.open(
|
|
2145
|
-
request.timeout =
|
|
2143
|
+
var fullPath = buildFullPath2(config5.baseURL, config5.url);
|
|
2144
|
+
request.open(config5.method.toUpperCase(), buildURL2(fullPath, config5.params, config5.paramsSerializer), true);
|
|
2145
|
+
request.timeout = config5.timeout;
|
|
2146
2146
|
function onloadend() {
|
|
2147
2147
|
if (!request) {
|
|
2148
2148
|
return;
|
|
@@ -2154,7 +2154,7 @@ var require_xhr = __commonJS({
|
|
|
2154
2154
|
status: request.status,
|
|
2155
2155
|
statusText: request.statusText,
|
|
2156
2156
|
headers: responseHeaders,
|
|
2157
|
-
config:
|
|
2157
|
+
config: config5,
|
|
2158
2158
|
request
|
|
2159
2159
|
};
|
|
2160
2160
|
settle2(function _resolve(value) {
|
|
@@ -2183,31 +2183,31 @@ var require_xhr = __commonJS({
|
|
|
2183
2183
|
if (!request) {
|
|
2184
2184
|
return;
|
|
2185
2185
|
}
|
|
2186
|
-
reject(createError("Request aborted",
|
|
2186
|
+
reject(createError("Request aborted", config5, "ECONNABORTED", request));
|
|
2187
2187
|
request = null;
|
|
2188
2188
|
};
|
|
2189
2189
|
request.onerror = function handleError() {
|
|
2190
|
-
reject(createError("Network Error",
|
|
2190
|
+
reject(createError("Network Error", config5, null, request));
|
|
2191
2191
|
request = null;
|
|
2192
2192
|
};
|
|
2193
2193
|
request.ontimeout = function handleTimeout() {
|
|
2194
|
-
var timeoutErrorMessage =
|
|
2195
|
-
var transitional2 =
|
|
2196
|
-
if (
|
|
2197
|
-
timeoutErrorMessage =
|
|
2194
|
+
var timeoutErrorMessage = config5.timeout ? "timeout of " + config5.timeout + "ms exceeded" : "timeout exceeded";
|
|
2195
|
+
var transitional2 = config5.transitional || transitionalDefaults;
|
|
2196
|
+
if (config5.timeoutErrorMessage) {
|
|
2197
|
+
timeoutErrorMessage = config5.timeoutErrorMessage;
|
|
2198
2198
|
}
|
|
2199
2199
|
reject(createError(
|
|
2200
2200
|
timeoutErrorMessage,
|
|
2201
|
-
|
|
2201
|
+
config5,
|
|
2202
2202
|
transitional2.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
2203
2203
|
request
|
|
2204
2204
|
));
|
|
2205
2205
|
request = null;
|
|
2206
2206
|
};
|
|
2207
2207
|
if (utils.isStandardBrowserEnv()) {
|
|
2208
|
-
var xsrfValue = (
|
|
2208
|
+
var xsrfValue = (config5.withCredentials || isURLSameOrigin(fullPath)) && config5.xsrfCookieName ? cookies.read(config5.xsrfCookieName) : void 0;
|
|
2209
2209
|
if (xsrfValue) {
|
|
2210
|
-
requestHeaders[
|
|
2210
|
+
requestHeaders[config5.xsrfHeaderName] = xsrfValue;
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
if ("setRequestHeader" in request) {
|
|
@@ -2219,19 +2219,19 @@ var require_xhr = __commonJS({
|
|
|
2219
2219
|
}
|
|
2220
2220
|
});
|
|
2221
2221
|
}
|
|
2222
|
-
if (!utils.isUndefined(
|
|
2223
|
-
request.withCredentials = !!
|
|
2222
|
+
if (!utils.isUndefined(config5.withCredentials)) {
|
|
2223
|
+
request.withCredentials = !!config5.withCredentials;
|
|
2224
2224
|
}
|
|
2225
2225
|
if (responseType && responseType !== "json") {
|
|
2226
|
-
request.responseType =
|
|
2226
|
+
request.responseType = config5.responseType;
|
|
2227
2227
|
}
|
|
2228
|
-
if (typeof
|
|
2229
|
-
request.addEventListener("progress",
|
|
2228
|
+
if (typeof config5.onDownloadProgress === "function") {
|
|
2229
|
+
request.addEventListener("progress", config5.onDownloadProgress);
|
|
2230
2230
|
}
|
|
2231
|
-
if (typeof
|
|
2232
|
-
request.upload.addEventListener("progress",
|
|
2231
|
+
if (typeof config5.onUploadProgress === "function" && request.upload) {
|
|
2232
|
+
request.upload.addEventListener("progress", config5.onUploadProgress);
|
|
2233
2233
|
}
|
|
2234
|
-
if (
|
|
2234
|
+
if (config5.cancelToken || config5.signal) {
|
|
2235
2235
|
onCanceled = function(cancel) {
|
|
2236
2236
|
if (!request) {
|
|
2237
2237
|
return;
|
|
@@ -2240,9 +2240,9 @@ var require_xhr = __commonJS({
|
|
|
2240
2240
|
request.abort();
|
|
2241
2241
|
request = null;
|
|
2242
2242
|
};
|
|
2243
|
-
|
|
2244
|
-
if (
|
|
2245
|
-
|
|
2243
|
+
config5.cancelToken && config5.cancelToken.subscribe(onCanceled);
|
|
2244
|
+
if (config5.signal) {
|
|
2245
|
+
config5.signal.aborted ? onCanceled() : config5.signal.addEventListener("abort", onCanceled);
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
2248
|
if (!requestData) {
|
|
@@ -3498,15 +3498,15 @@ var require_http = __commonJS({
|
|
|
3498
3498
|
setProxy2(redirection, proxy, redirection.href);
|
|
3499
3499
|
};
|
|
3500
3500
|
}
|
|
3501
|
-
module2.exports = function httpAdapter2(
|
|
3501
|
+
module2.exports = function httpAdapter2(config5) {
|
|
3502
3502
|
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
|
3503
3503
|
var onCanceled;
|
|
3504
3504
|
function done() {
|
|
3505
|
-
if (
|
|
3506
|
-
|
|
3505
|
+
if (config5.cancelToken) {
|
|
3506
|
+
config5.cancelToken.unsubscribe(onCanceled);
|
|
3507
3507
|
}
|
|
3508
|
-
if (
|
|
3509
|
-
|
|
3508
|
+
if (config5.signal) {
|
|
3509
|
+
config5.signal.removeEventListener("abort", onCanceled);
|
|
3510
3510
|
}
|
|
3511
3511
|
}
|
|
3512
3512
|
var resolve = function resolve2(value) {
|
|
@@ -3519,8 +3519,8 @@ var require_http = __commonJS({
|
|
|
3519
3519
|
rejected = true;
|
|
3520
3520
|
rejectPromise(value);
|
|
3521
3521
|
};
|
|
3522
|
-
var data =
|
|
3523
|
-
var headers =
|
|
3522
|
+
var data = config5.data;
|
|
3523
|
+
var headers = config5.headers;
|
|
3524
3524
|
var headerNames = {};
|
|
3525
3525
|
Object.keys(headers).forEach(function storeLowerName(name) {
|
|
3526
3526
|
headerNames[name.toLowerCase()] = name;
|
|
@@ -3541,23 +3541,23 @@ var require_http = __commonJS({
|
|
|
3541
3541
|
} else {
|
|
3542
3542
|
return reject(createError(
|
|
3543
3543
|
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
3544
|
-
|
|
3544
|
+
config5
|
|
3545
3545
|
));
|
|
3546
3546
|
}
|
|
3547
|
-
if (
|
|
3548
|
-
return reject(createError("Request body larger than maxBodyLength limit",
|
|
3547
|
+
if (config5.maxBodyLength > -1 && data.length > config5.maxBodyLength) {
|
|
3548
|
+
return reject(createError("Request body larger than maxBodyLength limit", config5));
|
|
3549
3549
|
}
|
|
3550
3550
|
if (!headerNames["content-length"]) {
|
|
3551
3551
|
headers["Content-Length"] = data.length;
|
|
3552
3552
|
}
|
|
3553
3553
|
}
|
|
3554
3554
|
var auth = void 0;
|
|
3555
|
-
if (
|
|
3556
|
-
var username =
|
|
3557
|
-
var password =
|
|
3555
|
+
if (config5.auth) {
|
|
3556
|
+
var username = config5.auth.username || "";
|
|
3557
|
+
var password = config5.auth.password || "";
|
|
3558
3558
|
auth = username + ":" + password;
|
|
3559
3559
|
}
|
|
3560
|
-
var fullPath = buildFullPath2(
|
|
3560
|
+
var fullPath = buildFullPath2(config5.baseURL, config5.url);
|
|
3561
3561
|
var parsed = url3.parse(fullPath);
|
|
3562
3562
|
var protocol = parsed.protocol || "http:";
|
|
3563
3563
|
if (!auth && parsed.auth) {
|
|
@@ -3570,31 +3570,31 @@ var require_http = __commonJS({
|
|
|
3570
3570
|
delete headers[headerNames.authorization];
|
|
3571
3571
|
}
|
|
3572
3572
|
var isHttpsRequest = isHttps2.test(protocol);
|
|
3573
|
-
var agent = isHttpsRequest ?
|
|
3573
|
+
var agent = isHttpsRequest ? config5.httpsAgent : config5.httpAgent;
|
|
3574
3574
|
try {
|
|
3575
|
-
buildURL2(parsed.path,
|
|
3575
|
+
buildURL2(parsed.path, config5.params, config5.paramsSerializer).replace(/^\?/, "");
|
|
3576
3576
|
} catch (err) {
|
|
3577
3577
|
var customErr = new Error(err.message);
|
|
3578
|
-
customErr.config =
|
|
3579
|
-
customErr.url =
|
|
3578
|
+
customErr.config = config5;
|
|
3579
|
+
customErr.url = config5.url;
|
|
3580
3580
|
customErr.exists = true;
|
|
3581
3581
|
reject(customErr);
|
|
3582
3582
|
}
|
|
3583
3583
|
var options = {
|
|
3584
|
-
path: buildURL2(parsed.path,
|
|
3585
|
-
method:
|
|
3584
|
+
path: buildURL2(parsed.path, config5.params, config5.paramsSerializer).replace(/^\?/, ""),
|
|
3585
|
+
method: config5.method.toUpperCase(),
|
|
3586
3586
|
headers,
|
|
3587
3587
|
agent,
|
|
3588
|
-
agents: { http:
|
|
3588
|
+
agents: { http: config5.httpAgent, https: config5.httpsAgent },
|
|
3589
3589
|
auth
|
|
3590
3590
|
};
|
|
3591
|
-
if (
|
|
3592
|
-
options.socketPath =
|
|
3591
|
+
if (config5.socketPath) {
|
|
3592
|
+
options.socketPath = config5.socketPath;
|
|
3593
3593
|
} else {
|
|
3594
3594
|
options.hostname = parsed.hostname;
|
|
3595
3595
|
options.port = parsed.port;
|
|
3596
3596
|
}
|
|
3597
|
-
var proxy =
|
|
3597
|
+
var proxy = config5.proxy;
|
|
3598
3598
|
if (!proxy && proxy !== false) {
|
|
3599
3599
|
var proxyEnv = protocol.slice(0, -1) + "_proxy";
|
|
3600
3600
|
var proxyUrl = process.env[proxyEnv] || process.env[proxyEnv.toUpperCase()];
|
|
@@ -3641,28 +3641,28 @@ var require_http = __commonJS({
|
|
|
3641
3641
|
}
|
|
3642
3642
|
var transport;
|
|
3643
3643
|
var isHttpsProxy = isHttpsRequest && (proxy ? isHttps2.test(proxy.protocol) : true);
|
|
3644
|
-
if (
|
|
3645
|
-
transport =
|
|
3646
|
-
} else if (
|
|
3644
|
+
if (config5.transport) {
|
|
3645
|
+
transport = config5.transport;
|
|
3646
|
+
} else if (config5.maxRedirects === 0) {
|
|
3647
3647
|
transport = isHttpsProxy ? https2 : http2;
|
|
3648
3648
|
} else {
|
|
3649
|
-
if (
|
|
3650
|
-
options.maxRedirects =
|
|
3649
|
+
if (config5.maxRedirects) {
|
|
3650
|
+
options.maxRedirects = config5.maxRedirects;
|
|
3651
3651
|
}
|
|
3652
3652
|
transport = isHttpsProxy ? httpsFollow2 : httpFollow2;
|
|
3653
3653
|
}
|
|
3654
|
-
if (
|
|
3655
|
-
options.maxBodyLength =
|
|
3654
|
+
if (config5.maxBodyLength > -1) {
|
|
3655
|
+
options.maxBodyLength = config5.maxBodyLength;
|
|
3656
3656
|
}
|
|
3657
|
-
if (
|
|
3658
|
-
options.insecureHTTPParser =
|
|
3657
|
+
if (config5.insecureHTTPParser) {
|
|
3658
|
+
options.insecureHTTPParser = config5.insecureHTTPParser;
|
|
3659
3659
|
}
|
|
3660
3660
|
var req = transport.request(options, function handleResponse(res) {
|
|
3661
3661
|
if (req.aborted)
|
|
3662
3662
|
return;
|
|
3663
3663
|
var stream4 = res;
|
|
3664
3664
|
var lastRequest = res.req || req;
|
|
3665
|
-
if (res.statusCode !== 204 && lastRequest.method !== "HEAD" &&
|
|
3665
|
+
if (res.statusCode !== 204 && lastRequest.method !== "HEAD" && config5.decompress !== false) {
|
|
3666
3666
|
switch (res.headers["content-encoding"]) {
|
|
3667
3667
|
case "gzip":
|
|
3668
3668
|
case "compress":
|
|
@@ -3676,10 +3676,10 @@ var require_http = __commonJS({
|
|
|
3676
3676
|
status: res.statusCode,
|
|
3677
3677
|
statusText: res.statusMessage,
|
|
3678
3678
|
headers: res.headers,
|
|
3679
|
-
config:
|
|
3679
|
+
config: config5,
|
|
3680
3680
|
request: lastRequest
|
|
3681
3681
|
};
|
|
3682
|
-
if (
|
|
3682
|
+
if (config5.responseType === "stream") {
|
|
3683
3683
|
response.data = stream4;
|
|
3684
3684
|
settle2(resolve, reject, response);
|
|
3685
3685
|
} else {
|
|
@@ -3688,12 +3688,12 @@ var require_http = __commonJS({
|
|
|
3688
3688
|
stream4.on("data", function handleStreamData(chunk) {
|
|
3689
3689
|
responseBuffer.push(chunk);
|
|
3690
3690
|
totalResponseBytes += chunk.length;
|
|
3691
|
-
if (
|
|
3691
|
+
if (config5.maxContentLength > -1 && totalResponseBytes > config5.maxContentLength) {
|
|
3692
3692
|
rejected = true;
|
|
3693
3693
|
stream4.destroy();
|
|
3694
3694
|
reject(createError(
|
|
3695
|
-
"maxContentLength size of " +
|
|
3696
|
-
|
|
3695
|
+
"maxContentLength size of " + config5.maxContentLength + " exceeded",
|
|
3696
|
+
config5,
|
|
3697
3697
|
null,
|
|
3698
3698
|
lastRequest
|
|
3699
3699
|
));
|
|
@@ -3704,25 +3704,25 @@ var require_http = __commonJS({
|
|
|
3704
3704
|
return;
|
|
3705
3705
|
}
|
|
3706
3706
|
stream4.destroy();
|
|
3707
|
-
reject(createError("error request aborted",
|
|
3707
|
+
reject(createError("error request aborted", config5, "ERR_REQUEST_ABORTED", lastRequest));
|
|
3708
3708
|
});
|
|
3709
3709
|
stream4.on("error", function handleStreamError(err) {
|
|
3710
3710
|
if (req.aborted)
|
|
3711
3711
|
return;
|
|
3712
|
-
reject(enhanceError(err,
|
|
3712
|
+
reject(enhanceError(err, config5, null, lastRequest));
|
|
3713
3713
|
});
|
|
3714
3714
|
stream4.on("end", function handleStreamEnd() {
|
|
3715
3715
|
try {
|
|
3716
3716
|
var responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
|
|
3717
|
-
if (
|
|
3718
|
-
responseData = responseData.toString(
|
|
3719
|
-
if (!
|
|
3717
|
+
if (config5.responseType !== "arraybuffer") {
|
|
3718
|
+
responseData = responseData.toString(config5.responseEncoding);
|
|
3719
|
+
if (!config5.responseEncoding || config5.responseEncoding === "utf8") {
|
|
3720
3720
|
responseData = utils.stripBOM(responseData);
|
|
3721
3721
|
}
|
|
3722
3722
|
}
|
|
3723
3723
|
response.data = responseData;
|
|
3724
3724
|
} catch (err) {
|
|
3725
|
-
reject(enhanceError(err,
|
|
3725
|
+
reject(enhanceError(err, config5, err.code, response.request, response));
|
|
3726
3726
|
}
|
|
3727
3727
|
settle2(resolve, reject, response);
|
|
3728
3728
|
});
|
|
@@ -3731,17 +3731,17 @@ var require_http = __commonJS({
|
|
|
3731
3731
|
req.on("error", function handleRequestError(err) {
|
|
3732
3732
|
if (req.aborted && err.code !== "ERR_FR_TOO_MANY_REDIRECTS")
|
|
3733
3733
|
return;
|
|
3734
|
-
reject(enhanceError(err,
|
|
3734
|
+
reject(enhanceError(err, config5, null, req));
|
|
3735
3735
|
});
|
|
3736
3736
|
req.on("socket", function handleRequestSocket(socket) {
|
|
3737
3737
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
3738
3738
|
});
|
|
3739
|
-
if (
|
|
3740
|
-
var timeout = parseInt(
|
|
3739
|
+
if (config5.timeout) {
|
|
3740
|
+
var timeout = parseInt(config5.timeout, 10);
|
|
3741
3741
|
if (isNaN(timeout)) {
|
|
3742
3742
|
reject(createError(
|
|
3743
3743
|
"error trying to parse `config.timeout` to int",
|
|
3744
|
-
|
|
3744
|
+
config5,
|
|
3745
3745
|
"ERR_PARSE_TIMEOUT",
|
|
3746
3746
|
req
|
|
3747
3747
|
));
|
|
@@ -3750,35 +3750,35 @@ var require_http = __commonJS({
|
|
|
3750
3750
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
3751
3751
|
req.abort();
|
|
3752
3752
|
var timeoutErrorMessage = "";
|
|
3753
|
-
if (
|
|
3754
|
-
timeoutErrorMessage =
|
|
3753
|
+
if (config5.timeoutErrorMessage) {
|
|
3754
|
+
timeoutErrorMessage = config5.timeoutErrorMessage;
|
|
3755
3755
|
} else {
|
|
3756
|
-
timeoutErrorMessage = "timeout of " +
|
|
3756
|
+
timeoutErrorMessage = "timeout of " + config5.timeout + "ms exceeded";
|
|
3757
3757
|
}
|
|
3758
|
-
var transitional2 =
|
|
3758
|
+
var transitional2 = config5.transitional || transitionalDefaults;
|
|
3759
3759
|
reject(createError(
|
|
3760
3760
|
timeoutErrorMessage,
|
|
3761
|
-
|
|
3761
|
+
config5,
|
|
3762
3762
|
transitional2.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
3763
3763
|
req
|
|
3764
3764
|
));
|
|
3765
3765
|
});
|
|
3766
3766
|
}
|
|
3767
|
-
if (
|
|
3767
|
+
if (config5.cancelToken || config5.signal) {
|
|
3768
3768
|
onCanceled = function(cancel) {
|
|
3769
3769
|
if (req.aborted)
|
|
3770
3770
|
return;
|
|
3771
3771
|
req.abort();
|
|
3772
3772
|
reject(!cancel || cancel && cancel.type ? new Cancel2("canceled") : cancel);
|
|
3773
3773
|
};
|
|
3774
|
-
|
|
3775
|
-
if (
|
|
3776
|
-
|
|
3774
|
+
config5.cancelToken && config5.cancelToken.subscribe(onCanceled);
|
|
3775
|
+
if (config5.signal) {
|
|
3776
|
+
config5.signal.aborted ? onCanceled() : config5.signal.addEventListener("abort", onCanceled);
|
|
3777
3777
|
}
|
|
3778
3778
|
}
|
|
3779
3779
|
if (utils.isStream(data)) {
|
|
3780
3780
|
data.on("error", function handleStreamError(err) {
|
|
3781
|
-
reject(enhanceError(err,
|
|
3781
|
+
reject(enhanceError(err, config5, null, req));
|
|
3782
3782
|
}).pipe(req);
|
|
3783
3783
|
} else {
|
|
3784
3784
|
req.end(data);
|
|
@@ -3926,53 +3926,53 @@ var require_dispatchRequest = __commonJS({
|
|
|
3926
3926
|
var isCancel3 = require_isCancel();
|
|
3927
3927
|
var defaults2 = require_defaults();
|
|
3928
3928
|
var Cancel2 = require_Cancel();
|
|
3929
|
-
function throwIfCancellationRequested2(
|
|
3930
|
-
if (
|
|
3931
|
-
|
|
3929
|
+
function throwIfCancellationRequested2(config5) {
|
|
3930
|
+
if (config5.cancelToken) {
|
|
3931
|
+
config5.cancelToken.throwIfRequested();
|
|
3932
3932
|
}
|
|
3933
|
-
if (
|
|
3933
|
+
if (config5.signal && config5.signal.aborted) {
|
|
3934
3934
|
throw new Cancel2("canceled");
|
|
3935
3935
|
}
|
|
3936
3936
|
}
|
|
3937
|
-
module2.exports = function dispatchRequest2(
|
|
3938
|
-
throwIfCancellationRequested2(
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3937
|
+
module2.exports = function dispatchRequest2(config5) {
|
|
3938
|
+
throwIfCancellationRequested2(config5);
|
|
3939
|
+
config5.headers = config5.headers || {};
|
|
3940
|
+
config5.data = transformData2.call(
|
|
3941
|
+
config5,
|
|
3942
|
+
config5.data,
|
|
3943
|
+
config5.headers,
|
|
3944
|
+
config5.transformRequest
|
|
3945
3945
|
);
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3946
|
+
config5.headers = utils.merge(
|
|
3947
|
+
config5.headers.common || {},
|
|
3948
|
+
config5.headers[config5.method] || {},
|
|
3949
|
+
config5.headers
|
|
3950
3950
|
);
|
|
3951
3951
|
utils.forEach(
|
|
3952
3952
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
3953
3953
|
function cleanHeaderConfig(method) {
|
|
3954
|
-
delete
|
|
3954
|
+
delete config5.headers[method];
|
|
3955
3955
|
}
|
|
3956
3956
|
);
|
|
3957
|
-
var adapter =
|
|
3958
|
-
return adapter(
|
|
3959
|
-
throwIfCancellationRequested2(
|
|
3957
|
+
var adapter = config5.adapter || defaults2.adapter;
|
|
3958
|
+
return adapter(config5).then(function onAdapterResolution(response) {
|
|
3959
|
+
throwIfCancellationRequested2(config5);
|
|
3960
3960
|
response.data = transformData2.call(
|
|
3961
|
-
|
|
3961
|
+
config5,
|
|
3962
3962
|
response.data,
|
|
3963
3963
|
response.headers,
|
|
3964
|
-
|
|
3964
|
+
config5.transformResponse
|
|
3965
3965
|
);
|
|
3966
3966
|
return response;
|
|
3967
3967
|
}, function onAdapterRejection(reason) {
|
|
3968
3968
|
if (!isCancel3(reason)) {
|
|
3969
|
-
throwIfCancellationRequested2(
|
|
3969
|
+
throwIfCancellationRequested2(config5);
|
|
3970
3970
|
if (reason && reason.response) {
|
|
3971
3971
|
reason.response.data = transformData2.call(
|
|
3972
|
-
|
|
3972
|
+
config5,
|
|
3973
3973
|
reason.response.data,
|
|
3974
3974
|
reason.response.headers,
|
|
3975
|
-
|
|
3975
|
+
config5.transformResponse
|
|
3976
3976
|
);
|
|
3977
3977
|
}
|
|
3978
3978
|
}
|
|
@@ -3989,7 +3989,7 @@ var require_mergeConfig = __commonJS({
|
|
|
3989
3989
|
var utils = require_utils();
|
|
3990
3990
|
module2.exports = function mergeConfig3(config1, config22) {
|
|
3991
3991
|
config22 = config22 || {};
|
|
3992
|
-
var
|
|
3992
|
+
var config5 = {};
|
|
3993
3993
|
function getMergedValue(target, source) {
|
|
3994
3994
|
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
|
|
3995
3995
|
return utils.merge(target, source);
|
|
@@ -4057,9 +4057,9 @@ var require_mergeConfig = __commonJS({
|
|
|
4057
4057
|
utils.forEach(Object.keys(config1).concat(Object.keys(config22)), function computeConfigValue(prop) {
|
|
4058
4058
|
var merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
4059
4059
|
var configValue = merge2(prop);
|
|
4060
|
-
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (
|
|
4060
|
+
utils.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config5[prop] = configValue);
|
|
4061
4061
|
});
|
|
4062
|
-
return
|
|
4062
|
+
return config5;
|
|
4063
4063
|
};
|
|
4064
4064
|
}
|
|
4065
4065
|
});
|
|
@@ -4143,22 +4143,22 @@ var require_Axios = __commonJS({
|
|
|
4143
4143
|
response: new InterceptorManager2()
|
|
4144
4144
|
};
|
|
4145
4145
|
}
|
|
4146
|
-
Axios3.prototype.request = function request(configOrUrl,
|
|
4146
|
+
Axios3.prototype.request = function request(configOrUrl, config5) {
|
|
4147
4147
|
if (typeof configOrUrl === "string") {
|
|
4148
|
-
|
|
4149
|
-
|
|
4148
|
+
config5 = config5 || {};
|
|
4149
|
+
config5.url = configOrUrl;
|
|
4150
4150
|
} else {
|
|
4151
|
-
|
|
4151
|
+
config5 = configOrUrl || {};
|
|
4152
4152
|
}
|
|
4153
|
-
|
|
4154
|
-
if (
|
|
4155
|
-
|
|
4153
|
+
config5 = mergeConfig3(this.defaults, config5);
|
|
4154
|
+
if (config5.method) {
|
|
4155
|
+
config5.method = config5.method.toLowerCase();
|
|
4156
4156
|
} else if (this.defaults.method) {
|
|
4157
|
-
|
|
4157
|
+
config5.method = this.defaults.method.toLowerCase();
|
|
4158
4158
|
} else {
|
|
4159
|
-
|
|
4159
|
+
config5.method = "get";
|
|
4160
4160
|
}
|
|
4161
|
-
var transitional2 =
|
|
4161
|
+
var transitional2 = config5.transitional;
|
|
4162
4162
|
if (transitional2 !== void 0) {
|
|
4163
4163
|
validator.assertOptions(transitional2, {
|
|
4164
4164
|
silentJSONParsing: validators3.transitional(validators3.boolean),
|
|
@@ -4169,7 +4169,7 @@ var require_Axios = __commonJS({
|
|
|
4169
4169
|
var requestInterceptorChain = [];
|
|
4170
4170
|
var synchronousRequestInterceptors = true;
|
|
4171
4171
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
4172
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(
|
|
4172
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config5) === false) {
|
|
4173
4173
|
return;
|
|
4174
4174
|
}
|
|
4175
4175
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
@@ -4184,13 +4184,13 @@ var require_Axios = __commonJS({
|
|
|
4184
4184
|
var chain = [dispatchRequest2, void 0];
|
|
4185
4185
|
Array.prototype.unshift.apply(chain, requestInterceptorChain);
|
|
4186
4186
|
chain = chain.concat(responseInterceptorChain);
|
|
4187
|
-
promise = Promise.resolve(
|
|
4187
|
+
promise = Promise.resolve(config5);
|
|
4188
4188
|
while (chain.length) {
|
|
4189
4189
|
promise = promise.then(chain.shift(), chain.shift());
|
|
4190
4190
|
}
|
|
4191
4191
|
return promise;
|
|
4192
4192
|
}
|
|
4193
|
-
var newConfig =
|
|
4193
|
+
var newConfig = config5;
|
|
4194
4194
|
while (requestInterceptorChain.length) {
|
|
4195
4195
|
var onFulfilled = requestInterceptorChain.shift();
|
|
4196
4196
|
var onRejected = requestInterceptorChain.shift();
|
|
@@ -4211,22 +4211,22 @@ var require_Axios = __commonJS({
|
|
|
4211
4211
|
}
|
|
4212
4212
|
return promise;
|
|
4213
4213
|
};
|
|
4214
|
-
Axios3.prototype.getUri = function getUri(
|
|
4215
|
-
|
|
4216
|
-
return buildURL2(
|
|
4214
|
+
Axios3.prototype.getUri = function getUri(config5) {
|
|
4215
|
+
config5 = mergeConfig3(this.defaults, config5);
|
|
4216
|
+
return buildURL2(config5.url, config5.params, config5.paramsSerializer).replace(/^\?/, "");
|
|
4217
4217
|
};
|
|
4218
4218
|
utils.forEach(["delete", "get", "head", "options"], function forEachMethodNoData3(method) {
|
|
4219
|
-
Axios3.prototype[method] = function(url3,
|
|
4220
|
-
return this.request(mergeConfig3(
|
|
4219
|
+
Axios3.prototype[method] = function(url3, config5) {
|
|
4220
|
+
return this.request(mergeConfig3(config5 || {}, {
|
|
4221
4221
|
method,
|
|
4222
4222
|
url: url3,
|
|
4223
|
-
data: (
|
|
4223
|
+
data: (config5 || {}).data
|
|
4224
4224
|
}));
|
|
4225
4225
|
};
|
|
4226
4226
|
});
|
|
4227
4227
|
utils.forEach(["post", "put", "patch"], function forEachMethodWithData3(method) {
|
|
4228
|
-
Axios3.prototype[method] = function(url3, data,
|
|
4229
|
-
return this.request(mergeConfig3(
|
|
4228
|
+
Axios3.prototype[method] = function(url3, data, config5) {
|
|
4229
|
+
return this.request(mergeConfig3(config5 || {}, {
|
|
4230
4230
|
method,
|
|
4231
4231
|
url: url3,
|
|
4232
4232
|
data
|
|
@@ -16350,12 +16350,6 @@ var package_default = {
|
|
|
16350
16350
|
}
|
|
16351
16351
|
};
|
|
16352
16352
|
|
|
16353
|
-
// src/commands/config.ts
|
|
16354
|
-
var import_path = require("path");
|
|
16355
|
-
var import_ini = __toESM(require_ini(), 1);
|
|
16356
|
-
var import_fs = require("fs");
|
|
16357
|
-
var import_os = require("os");
|
|
16358
|
-
|
|
16359
16353
|
// node_modules/@clack/core/dist/index.mjs
|
|
16360
16354
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
16361
16355
|
var import_node_process = require("node:process");
|
|
@@ -17393,6 +17387,12 @@ var chalk = createChalk();
|
|
|
17393
17387
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
17394
17388
|
var source_default = chalk;
|
|
17395
17389
|
|
|
17390
|
+
// src/commands/config.ts
|
|
17391
|
+
var import_fs = require("fs");
|
|
17392
|
+
var import_ini = __toESM(require_ini(), 1);
|
|
17393
|
+
var import_os = require("os");
|
|
17394
|
+
var import_path = require("path");
|
|
17395
|
+
|
|
17396
17396
|
// src/i18n/en.json
|
|
17397
17397
|
var en_default = {
|
|
17398
17398
|
localLanguage: "english",
|
|
@@ -17676,8 +17676,21 @@ var configValidators = {
|
|
|
17676
17676
|
["OCO_MODEL" /* OCO_MODEL */](value) {
|
|
17677
17677
|
validateConfig(
|
|
17678
17678
|
"OCO_MODEL" /* OCO_MODEL */,
|
|
17679
|
-
[
|
|
17680
|
-
|
|
17679
|
+
[
|
|
17680
|
+
"gpt-3.5-turbo",
|
|
17681
|
+
"gpt-4",
|
|
17682
|
+
"gpt-3.5-turbo-16k",
|
|
17683
|
+
"gpt-3.5-turbo-0613"
|
|
17684
|
+
].includes(value),
|
|
17685
|
+
`${value} is not supported yet, use 'gpt-4', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-0613' or 'gpt-3.5-turbo' (default)`
|
|
17686
|
+
);
|
|
17687
|
+
return value;
|
|
17688
|
+
},
|
|
17689
|
+
["OCO_MESSAGE_TEMPLATE_PLACEHOLDER" /* OCO_MESSAGE_TEMPLATE_PLACEHOLDER */](value) {
|
|
17690
|
+
validateConfig(
|
|
17691
|
+
"OCO_MESSAGE_TEMPLATE_PLACEHOLDER" /* OCO_MESSAGE_TEMPLATE_PLACEHOLDER */,
|
|
17692
|
+
value.startsWith("$"),
|
|
17693
|
+
`${value} must start with $, for example: '$msg'`
|
|
17681
17694
|
);
|
|
17682
17695
|
return value;
|
|
17683
17696
|
}
|
|
@@ -17690,25 +17703,26 @@ var getConfig = () => {
|
|
|
17690
17703
|
OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH,
|
|
17691
17704
|
OCO_DESCRIPTION: process.env.OCO_DESCRIPTION === "true" ? true : false,
|
|
17692
17705
|
OCO_EMOJI: process.env.OCO_EMOJI === "true" ? true : false,
|
|
17693
|
-
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo",
|
|
17694
|
-
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en"
|
|
17706
|
+
OCO_MODEL: process.env.OCO_MODEL || "gpt-3.5-turbo-16k",
|
|
17707
|
+
OCO_LANGUAGE: process.env.OCO_LANGUAGE || "en",
|
|
17708
|
+
OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER || "$msg"
|
|
17695
17709
|
};
|
|
17696
17710
|
const configExists = (0, import_fs.existsSync)(configPath);
|
|
17697
17711
|
if (!configExists)
|
|
17698
17712
|
return configFromEnv;
|
|
17699
17713
|
const configFile = (0, import_fs.readFileSync)(configPath, "utf8");
|
|
17700
|
-
const
|
|
17701
|
-
for (const configKey of Object.keys(
|
|
17702
|
-
if (!
|
|
17703
|
-
|
|
17714
|
+
const config5 = (0, import_ini.parse)(configFile);
|
|
17715
|
+
for (const configKey of Object.keys(config5)) {
|
|
17716
|
+
if (!config5[configKey] || ["null", "undefined"].includes(config5[configKey])) {
|
|
17717
|
+
config5[configKey] = void 0;
|
|
17704
17718
|
continue;
|
|
17705
17719
|
}
|
|
17706
17720
|
try {
|
|
17707
17721
|
const validator = configValidators[configKey];
|
|
17708
17722
|
const validValue = validator(
|
|
17709
|
-
|
|
17723
|
+
config5[configKey] ?? configFromEnv[configKey]
|
|
17710
17724
|
);
|
|
17711
|
-
|
|
17725
|
+
config5[configKey] = validValue;
|
|
17712
17726
|
} catch (error) {
|
|
17713
17727
|
ce(
|
|
17714
17728
|
`'${configKey}' name is invalid, it should be either 'OCO_${configKey.toUpperCase()}' or it doesn't exist.`
|
|
@@ -17719,10 +17733,10 @@ var getConfig = () => {
|
|
|
17719
17733
|
process.exit(1);
|
|
17720
17734
|
}
|
|
17721
17735
|
}
|
|
17722
|
-
return
|
|
17736
|
+
return config5;
|
|
17723
17737
|
};
|
|
17724
17738
|
var setConfig = (keyValues) => {
|
|
17725
|
-
const
|
|
17739
|
+
const config5 = getConfig() || {};
|
|
17726
17740
|
for (const [configKey, configValue] of keyValues) {
|
|
17727
17741
|
if (!configValidators.hasOwnProperty(configKey)) {
|
|
17728
17742
|
throw new Error(`Unsupported config key: ${configKey}`);
|
|
@@ -17734,9 +17748,9 @@ var setConfig = (keyValues) => {
|
|
|
17734
17748
|
parsedConfigValue = configValue;
|
|
17735
17749
|
}
|
|
17736
17750
|
const validValue = configValidators[configKey](parsedConfigValue);
|
|
17737
|
-
|
|
17751
|
+
config5[configKey] = validValue;
|
|
17738
17752
|
}
|
|
17739
|
-
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(
|
|
17753
|
+
(0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config5), "utf8");
|
|
17740
17754
|
ce(`${source_default.green("\u2714")} Config successfully set`);
|
|
17741
17755
|
};
|
|
17742
17756
|
var configCommand = G3(
|
|
@@ -17749,9 +17763,9 @@ var configCommand = G3(
|
|
|
17749
17763
|
try {
|
|
17750
17764
|
const { mode: mode2, keyValues } = argv._;
|
|
17751
17765
|
if (mode2 === "get" /* get */) {
|
|
17752
|
-
const
|
|
17766
|
+
const config5 = getConfig() || {};
|
|
17753
17767
|
for (const key of keyValues) {
|
|
17754
|
-
ce(`${key}=${
|
|
17768
|
+
ce(`${key}=${config5[key]}`);
|
|
17755
17769
|
}
|
|
17756
17770
|
} else if (mode2 === "set" /* set */) {
|
|
17757
17771
|
await setConfig(
|
|
@@ -18703,10 +18717,7 @@ var getOpenCommitIgnore = () => {
|
|
|
18703
18717
|
return ig;
|
|
18704
18718
|
};
|
|
18705
18719
|
var getCoreHooksPath = async () => {
|
|
18706
|
-
const { stdout } = await execa("git", [
|
|
18707
|
-
"config",
|
|
18708
|
-
"core.hooksPath"
|
|
18709
|
-
]);
|
|
18720
|
+
const { stdout } = await execa("git", ["config", "core.hooksPath"]);
|
|
18710
18721
|
return stdout;
|
|
18711
18722
|
};
|
|
18712
18723
|
var getStagedFiles = async () => {
|
|
@@ -18750,11 +18761,11 @@ var gitAdd = async ({ files }) => {
|
|
|
18750
18761
|
};
|
|
18751
18762
|
var getDiff = async ({ files }) => {
|
|
18752
18763
|
const lockFiles = files.filter(
|
|
18753
|
-
(file) => file.includes(".lock") || file.includes("-lock.")
|
|
18764
|
+
(file) => file.includes(".lock") || file.includes("-lock.") || file.includes(".svg") || file.includes(".png") || file.includes(".jpg") || file.includes(".jpeg") || file.includes(".webp") || file.includes(".gif")
|
|
18754
18765
|
);
|
|
18755
18766
|
if (lockFiles.length) {
|
|
18756
18767
|
ce(
|
|
18757
|
-
`Some files are
|
|
18768
|
+
`Some files are excluded by default from 'git diff'. No commit messages are generated for this files:
|
|
18758
18769
|
${lockFiles.join(
|
|
18759
18770
|
"\n"
|
|
18760
18771
|
)}`
|
|
@@ -19218,7 +19229,7 @@ var utils_default = {
|
|
|
19218
19229
|
};
|
|
19219
19230
|
|
|
19220
19231
|
// node_modules/axios/lib/core/AxiosError.js
|
|
19221
|
-
function AxiosError(message, code,
|
|
19232
|
+
function AxiosError(message, code, config5, request, response) {
|
|
19222
19233
|
Error.call(this);
|
|
19223
19234
|
if (Error.captureStackTrace) {
|
|
19224
19235
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -19228,7 +19239,7 @@ function AxiosError(message, code, config4, request, response) {
|
|
|
19228
19239
|
this.message = message;
|
|
19229
19240
|
this.name = "AxiosError";
|
|
19230
19241
|
code && (this.code = code);
|
|
19231
|
-
|
|
19242
|
+
config5 && (this.config = config5);
|
|
19232
19243
|
request && (this.request = request);
|
|
19233
19244
|
response && (this.response = response);
|
|
19234
19245
|
}
|
|
@@ -19269,14 +19280,14 @@ var descriptors2 = {};
|
|
|
19269
19280
|
});
|
|
19270
19281
|
Object.defineProperties(AxiosError, descriptors2);
|
|
19271
19282
|
Object.defineProperty(prototype, "isAxiosError", { value: true });
|
|
19272
|
-
AxiosError.from = (error, code,
|
|
19283
|
+
AxiosError.from = (error, code, config5, request, response, customProps) => {
|
|
19273
19284
|
const axiosError = Object.create(prototype);
|
|
19274
19285
|
utils_default.toFlatObject(error, axiosError, function filter2(obj) {
|
|
19275
19286
|
return obj !== Error.prototype;
|
|
19276
19287
|
}, (prop) => {
|
|
19277
19288
|
return prop !== "isAxiosError";
|
|
19278
19289
|
});
|
|
19279
|
-
AxiosError.call(axiosError, error.message, code,
|
|
19290
|
+
AxiosError.call(axiosError, error.message, code, config5, request, response);
|
|
19280
19291
|
axiosError.cause = error;
|
|
19281
19292
|
axiosError.name = error.name;
|
|
19282
19293
|
customProps && Object.assign(axiosError, customProps);
|
|
@@ -19951,12 +19962,12 @@ var AxiosHeaders_default = AxiosHeaders;
|
|
|
19951
19962
|
|
|
19952
19963
|
// node_modules/axios/lib/core/transformData.js
|
|
19953
19964
|
function transformData(fns, response) {
|
|
19954
|
-
const
|
|
19955
|
-
const context = response ||
|
|
19965
|
+
const config5 = this || defaults_default;
|
|
19966
|
+
const context = response || config5;
|
|
19956
19967
|
const headers = AxiosHeaders_default.from(context.headers);
|
|
19957
19968
|
let data = context.data;
|
|
19958
19969
|
utils_default.forEach(fns, function transform(fn) {
|
|
19959
|
-
data = fn.call(
|
|
19970
|
+
data = fn.call(config5, data, headers.normalize(), response ? response.status : void 0);
|
|
19960
19971
|
});
|
|
19961
19972
|
headers.normalize();
|
|
19962
19973
|
return data;
|
|
@@ -19968,8 +19979,8 @@ function isCancel(value) {
|
|
|
19968
19979
|
}
|
|
19969
19980
|
|
|
19970
19981
|
// node_modules/axios/lib/cancel/CanceledError.js
|
|
19971
|
-
function CanceledError(message,
|
|
19972
|
-
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED,
|
|
19982
|
+
function CanceledError(message, config5, request) {
|
|
19983
|
+
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config5, request);
|
|
19973
19984
|
this.name = "CanceledError";
|
|
19974
19985
|
}
|
|
19975
19986
|
utils_default.inherits(CanceledError, AxiosError_default, {
|
|
@@ -20476,21 +20487,21 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
20476
20487
|
asyncExecutor(_resolve, _reject, (onDoneHandler) => onDone = onDoneHandler).catch(_reject);
|
|
20477
20488
|
});
|
|
20478
20489
|
};
|
|
20479
|
-
var http_default = isHttpAdapterSupported && function httpAdapter(
|
|
20490
|
+
var http_default = isHttpAdapterSupported && function httpAdapter(config5) {
|
|
20480
20491
|
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
|
|
20481
|
-
let { data } =
|
|
20482
|
-
const { responseType, responseEncoding } =
|
|
20483
|
-
const method =
|
|
20492
|
+
let { data } = config5;
|
|
20493
|
+
const { responseType, responseEncoding } = config5;
|
|
20494
|
+
const method = config5.method.toUpperCase();
|
|
20484
20495
|
let isDone;
|
|
20485
20496
|
let rejected = false;
|
|
20486
20497
|
let req;
|
|
20487
20498
|
const emitter = new import_events.default();
|
|
20488
20499
|
const onFinished = () => {
|
|
20489
|
-
if (
|
|
20490
|
-
|
|
20500
|
+
if (config5.cancelToken) {
|
|
20501
|
+
config5.cancelToken.unsubscribe(abort);
|
|
20491
20502
|
}
|
|
20492
|
-
if (
|
|
20493
|
-
|
|
20503
|
+
if (config5.signal) {
|
|
20504
|
+
config5.signal.removeEventListener("abort", abort);
|
|
20494
20505
|
}
|
|
20495
20506
|
emitter.removeAllListeners();
|
|
20496
20507
|
};
|
|
@@ -20502,16 +20513,16 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20502
20513
|
}
|
|
20503
20514
|
});
|
|
20504
20515
|
function abort(reason) {
|
|
20505
|
-
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null,
|
|
20516
|
+
emitter.emit("abort", !reason || reason.type ? new CanceledError_default(null, config5, req) : reason);
|
|
20506
20517
|
}
|
|
20507
20518
|
emitter.once("abort", reject);
|
|
20508
|
-
if (
|
|
20509
|
-
|
|
20510
|
-
if (
|
|
20511
|
-
|
|
20519
|
+
if (config5.cancelToken || config5.signal) {
|
|
20520
|
+
config5.cancelToken && config5.cancelToken.subscribe(abort);
|
|
20521
|
+
if (config5.signal) {
|
|
20522
|
+
config5.signal.aborted ? abort() : config5.signal.addEventListener("abort", abort);
|
|
20512
20523
|
}
|
|
20513
20524
|
}
|
|
20514
|
-
const fullPath = buildFullPath(
|
|
20525
|
+
const fullPath = buildFullPath(config5.baseURL, config5.url);
|
|
20515
20526
|
const parsed = new URL(fullPath, "http://localhost");
|
|
20516
20527
|
const protocol = parsed.protocol || supportedProtocols[0];
|
|
20517
20528
|
if (protocol === "data:") {
|
|
@@ -20521,15 +20532,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20521
20532
|
status: 405,
|
|
20522
20533
|
statusText: "method not allowed",
|
|
20523
20534
|
headers: {},
|
|
20524
|
-
config:
|
|
20535
|
+
config: config5
|
|
20525
20536
|
});
|
|
20526
20537
|
}
|
|
20527
20538
|
try {
|
|
20528
|
-
convertedData = fromDataURI(
|
|
20529
|
-
Blob:
|
|
20539
|
+
convertedData = fromDataURI(config5.url, responseType === "blob", {
|
|
20540
|
+
Blob: config5.env && config5.env.Blob
|
|
20530
20541
|
});
|
|
20531
20542
|
} catch (err) {
|
|
20532
|
-
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST,
|
|
20543
|
+
throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config5);
|
|
20533
20544
|
}
|
|
20534
20545
|
if (responseType === "text") {
|
|
20535
20546
|
convertedData = convertedData.toString(responseEncoding);
|
|
@@ -20544,21 +20555,21 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20544
20555
|
status: 200,
|
|
20545
20556
|
statusText: "OK",
|
|
20546
20557
|
headers: new AxiosHeaders_default(),
|
|
20547
|
-
config:
|
|
20558
|
+
config: config5
|
|
20548
20559
|
});
|
|
20549
20560
|
}
|
|
20550
20561
|
if (supportedProtocols.indexOf(protocol) === -1) {
|
|
20551
20562
|
return reject(new AxiosError_default(
|
|
20552
20563
|
"Unsupported protocol " + protocol,
|
|
20553
20564
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
20554
|
-
|
|
20565
|
+
config5
|
|
20555
20566
|
));
|
|
20556
20567
|
}
|
|
20557
|
-
const headers = AxiosHeaders_default.from(
|
|
20568
|
+
const headers = AxiosHeaders_default.from(config5.headers).normalize();
|
|
20558
20569
|
headers.set("User-Agent", "axios/" + VERSION, false);
|
|
20559
|
-
const onDownloadProgress =
|
|
20560
|
-
const onUploadProgress =
|
|
20561
|
-
const maxRate =
|
|
20570
|
+
const onDownloadProgress = config5.onDownloadProgress;
|
|
20571
|
+
const onUploadProgress = config5.onUploadProgress;
|
|
20572
|
+
const maxRate = config5.maxRate;
|
|
20562
20573
|
let maxUploadRate = void 0;
|
|
20563
20574
|
let maxDownloadRate = void 0;
|
|
20564
20575
|
if (utils_default.isSpecCompliantForm(data)) {
|
|
@@ -20592,15 +20603,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20592
20603
|
return reject(new AxiosError_default(
|
|
20593
20604
|
"Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",
|
|
20594
20605
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
20595
|
-
|
|
20606
|
+
config5
|
|
20596
20607
|
));
|
|
20597
20608
|
}
|
|
20598
20609
|
headers.setContentLength(data.length, false);
|
|
20599
|
-
if (
|
|
20610
|
+
if (config5.maxBodyLength > -1 && data.length > config5.maxBodyLength) {
|
|
20600
20611
|
return reject(new AxiosError_default(
|
|
20601
20612
|
"Request body larger than maxBodyLength limit",
|
|
20602
20613
|
AxiosError_default.ERR_BAD_REQUEST,
|
|
20603
|
-
|
|
20614
|
+
config5
|
|
20604
20615
|
));
|
|
20605
20616
|
}
|
|
20606
20617
|
}
|
|
@@ -20626,9 +20637,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20626
20637
|
});
|
|
20627
20638
|
}
|
|
20628
20639
|
let auth = void 0;
|
|
20629
|
-
if (
|
|
20630
|
-
const username =
|
|
20631
|
-
const password =
|
|
20640
|
+
if (config5.auth) {
|
|
20641
|
+
const username = config5.auth.username || "";
|
|
20642
|
+
const password = config5.auth.password || "";
|
|
20632
20643
|
auth = username + ":" + password;
|
|
20633
20644
|
}
|
|
20634
20645
|
if (!auth && parsed.username) {
|
|
@@ -20641,13 +20652,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20641
20652
|
try {
|
|
20642
20653
|
path4 = buildURL(
|
|
20643
20654
|
parsed.pathname + parsed.search,
|
|
20644
|
-
|
|
20645
|
-
|
|
20655
|
+
config5.params,
|
|
20656
|
+
config5.paramsSerializer
|
|
20646
20657
|
).replace(/^\?/, "");
|
|
20647
20658
|
} catch (err) {
|
|
20648
20659
|
const customErr = new Error(err.message);
|
|
20649
|
-
customErr.config =
|
|
20650
|
-
customErr.url =
|
|
20660
|
+
customErr.config = config5;
|
|
20661
|
+
customErr.url = config5.url;
|
|
20651
20662
|
customErr.exists = true;
|
|
20652
20663
|
return reject(customErr);
|
|
20653
20664
|
}
|
|
@@ -20660,42 +20671,42 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20660
20671
|
path: path4,
|
|
20661
20672
|
method,
|
|
20662
20673
|
headers: headers.toJSON(),
|
|
20663
|
-
agents: { http:
|
|
20674
|
+
agents: { http: config5.httpAgent, https: config5.httpsAgent },
|
|
20664
20675
|
auth,
|
|
20665
20676
|
protocol,
|
|
20666
20677
|
beforeRedirect: dispatchBeforeRedirect,
|
|
20667
20678
|
beforeRedirects: {}
|
|
20668
20679
|
};
|
|
20669
|
-
if (
|
|
20670
|
-
options.socketPath =
|
|
20680
|
+
if (config5.socketPath) {
|
|
20681
|
+
options.socketPath = config5.socketPath;
|
|
20671
20682
|
} else {
|
|
20672
20683
|
options.hostname = parsed.hostname;
|
|
20673
20684
|
options.port = parsed.port;
|
|
20674
|
-
setProxy(options,
|
|
20685
|
+
setProxy(options, config5.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
|
|
20675
20686
|
}
|
|
20676
20687
|
let transport;
|
|
20677
20688
|
const isHttpsRequest = isHttps.test(options.protocol);
|
|
20678
|
-
options.agent = isHttpsRequest ?
|
|
20679
|
-
if (
|
|
20680
|
-
transport =
|
|
20681
|
-
} else if (
|
|
20689
|
+
options.agent = isHttpsRequest ? config5.httpsAgent : config5.httpAgent;
|
|
20690
|
+
if (config5.transport) {
|
|
20691
|
+
transport = config5.transport;
|
|
20692
|
+
} else if (config5.maxRedirects === 0) {
|
|
20682
20693
|
transport = isHttpsRequest ? import_https.default : import_http.default;
|
|
20683
20694
|
} else {
|
|
20684
|
-
if (
|
|
20685
|
-
options.maxRedirects =
|
|
20695
|
+
if (config5.maxRedirects) {
|
|
20696
|
+
options.maxRedirects = config5.maxRedirects;
|
|
20686
20697
|
}
|
|
20687
|
-
if (
|
|
20688
|
-
options.beforeRedirects.config =
|
|
20698
|
+
if (config5.beforeRedirect) {
|
|
20699
|
+
options.beforeRedirects.config = config5.beforeRedirect;
|
|
20689
20700
|
}
|
|
20690
20701
|
transport = isHttpsRequest ? httpsFollow : httpFollow;
|
|
20691
20702
|
}
|
|
20692
|
-
if (
|
|
20693
|
-
options.maxBodyLength =
|
|
20703
|
+
if (config5.maxBodyLength > -1) {
|
|
20704
|
+
options.maxBodyLength = config5.maxBodyLength;
|
|
20694
20705
|
} else {
|
|
20695
20706
|
options.maxBodyLength = Infinity;
|
|
20696
20707
|
}
|
|
20697
|
-
if (
|
|
20698
|
-
options.insecureHTTPParser =
|
|
20708
|
+
if (config5.insecureHTTPParser) {
|
|
20709
|
+
options.insecureHTTPParser = config5.insecureHTTPParser;
|
|
20699
20710
|
}
|
|
20700
20711
|
req = transport.request(options, function handleResponse(res) {
|
|
20701
20712
|
if (req.destroyed)
|
|
@@ -20716,7 +20727,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20716
20727
|
}
|
|
20717
20728
|
let responseStream = res;
|
|
20718
20729
|
const lastRequest = res.req || req;
|
|
20719
|
-
if (
|
|
20730
|
+
if (config5.decompress !== false && res.headers["content-encoding"]) {
|
|
20720
20731
|
if (method === "HEAD" || res.statusCode === 204) {
|
|
20721
20732
|
delete res.headers["content-encoding"];
|
|
20722
20733
|
}
|
|
@@ -20749,7 +20760,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20749
20760
|
status: res.statusCode,
|
|
20750
20761
|
statusText: res.statusMessage,
|
|
20751
20762
|
headers: new AxiosHeaders_default(res.headers),
|
|
20752
|
-
config:
|
|
20763
|
+
config: config5,
|
|
20753
20764
|
request: lastRequest
|
|
20754
20765
|
};
|
|
20755
20766
|
if (responseType === "stream") {
|
|
@@ -20761,13 +20772,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20761
20772
|
responseStream.on("data", function handleStreamData(chunk) {
|
|
20762
20773
|
responseBuffer.push(chunk);
|
|
20763
20774
|
totalResponseBytes += chunk.length;
|
|
20764
|
-
if (
|
|
20775
|
+
if (config5.maxContentLength > -1 && totalResponseBytes > config5.maxContentLength) {
|
|
20765
20776
|
rejected = true;
|
|
20766
20777
|
responseStream.destroy();
|
|
20767
20778
|
reject(new AxiosError_default(
|
|
20768
|
-
"maxContentLength size of " +
|
|
20779
|
+
"maxContentLength size of " + config5.maxContentLength + " exceeded",
|
|
20769
20780
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
20770
|
-
|
|
20781
|
+
config5,
|
|
20771
20782
|
lastRequest
|
|
20772
20783
|
));
|
|
20773
20784
|
}
|
|
@@ -20777,9 +20788,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20777
20788
|
return;
|
|
20778
20789
|
}
|
|
20779
20790
|
const err = new AxiosError_default(
|
|
20780
|
-
"maxContentLength size of " +
|
|
20791
|
+
"maxContentLength size of " + config5.maxContentLength + " exceeded",
|
|
20781
20792
|
AxiosError_default.ERR_BAD_RESPONSE,
|
|
20782
|
-
|
|
20793
|
+
config5,
|
|
20783
20794
|
lastRequest
|
|
20784
20795
|
);
|
|
20785
20796
|
responseStream.destroy(err);
|
|
@@ -20788,7 +20799,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20788
20799
|
responseStream.on("error", function handleStreamError(err) {
|
|
20789
20800
|
if (req.destroyed)
|
|
20790
20801
|
return;
|
|
20791
|
-
reject(AxiosError_default.from(err, null,
|
|
20802
|
+
reject(AxiosError_default.from(err, null, config5, lastRequest));
|
|
20792
20803
|
});
|
|
20793
20804
|
responseStream.on("end", function handleStreamEnd() {
|
|
20794
20805
|
try {
|
|
@@ -20801,7 +20812,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20801
20812
|
}
|
|
20802
20813
|
response.data = responseData;
|
|
20803
20814
|
} catch (err) {
|
|
20804
|
-
reject(AxiosError_default.from(err, null,
|
|
20815
|
+
reject(AxiosError_default.from(err, null, config5, response.request, response));
|
|
20805
20816
|
}
|
|
20806
20817
|
settle(resolve, reject, response);
|
|
20807
20818
|
});
|
|
@@ -20818,18 +20829,18 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20818
20829
|
req.destroy(err);
|
|
20819
20830
|
});
|
|
20820
20831
|
req.on("error", function handleRequestError(err) {
|
|
20821
|
-
reject(AxiosError_default.from(err, null,
|
|
20832
|
+
reject(AxiosError_default.from(err, null, config5, req));
|
|
20822
20833
|
});
|
|
20823
20834
|
req.on("socket", function handleRequestSocket(socket) {
|
|
20824
20835
|
socket.setKeepAlive(true, 1e3 * 60);
|
|
20825
20836
|
});
|
|
20826
|
-
if (
|
|
20827
|
-
const timeout = parseInt(
|
|
20837
|
+
if (config5.timeout) {
|
|
20838
|
+
const timeout = parseInt(config5.timeout, 10);
|
|
20828
20839
|
if (isNaN(timeout)) {
|
|
20829
20840
|
reject(new AxiosError_default(
|
|
20830
20841
|
"error trying to parse `config.timeout` to int",
|
|
20831
20842
|
AxiosError_default.ERR_BAD_OPTION_VALUE,
|
|
20832
|
-
|
|
20843
|
+
config5,
|
|
20833
20844
|
req
|
|
20834
20845
|
));
|
|
20835
20846
|
return;
|
|
@@ -20837,15 +20848,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20837
20848
|
req.setTimeout(timeout, function handleRequestTimeout() {
|
|
20838
20849
|
if (isDone)
|
|
20839
20850
|
return;
|
|
20840
|
-
let timeoutErrorMessage =
|
|
20841
|
-
const transitional2 =
|
|
20842
|
-
if (
|
|
20843
|
-
timeoutErrorMessage =
|
|
20851
|
+
let timeoutErrorMessage = config5.timeout ? "timeout of " + config5.timeout + "ms exceeded" : "timeout exceeded";
|
|
20852
|
+
const transitional2 = config5.transitional || transitional_default;
|
|
20853
|
+
if (config5.timeoutErrorMessage) {
|
|
20854
|
+
timeoutErrorMessage = config5.timeoutErrorMessage;
|
|
20844
20855
|
}
|
|
20845
20856
|
reject(new AxiosError_default(
|
|
20846
20857
|
timeoutErrorMessage,
|
|
20847
20858
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
20848
|
-
|
|
20859
|
+
config5,
|
|
20849
20860
|
req
|
|
20850
20861
|
));
|
|
20851
20862
|
abort();
|
|
@@ -20863,7 +20874,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config4) {
|
|
|
20863
20874
|
});
|
|
20864
20875
|
data.on("close", () => {
|
|
20865
20876
|
if (!ended && !errored) {
|
|
20866
|
-
abort(new CanceledError_default("Request stream has been aborted",
|
|
20877
|
+
abort(new CanceledError_default("Request stream has been aborted", config5, req));
|
|
20867
20878
|
}
|
|
20868
20879
|
});
|
|
20869
20880
|
data.pipe(req);
|
|
@@ -20972,32 +20983,32 @@ function progressEventReducer(listener, isDownloadStream) {
|
|
|
20972
20983
|
};
|
|
20973
20984
|
}
|
|
20974
20985
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
20975
|
-
var xhr_default = isXHRAdapterSupported && function(
|
|
20986
|
+
var xhr_default = isXHRAdapterSupported && function(config5) {
|
|
20976
20987
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
20977
|
-
let requestData =
|
|
20978
|
-
const requestHeaders = AxiosHeaders_default.from(
|
|
20979
|
-
const responseType =
|
|
20988
|
+
let requestData = config5.data;
|
|
20989
|
+
const requestHeaders = AxiosHeaders_default.from(config5.headers).normalize();
|
|
20990
|
+
const responseType = config5.responseType;
|
|
20980
20991
|
let onCanceled;
|
|
20981
20992
|
function done() {
|
|
20982
|
-
if (
|
|
20983
|
-
|
|
20993
|
+
if (config5.cancelToken) {
|
|
20994
|
+
config5.cancelToken.unsubscribe(onCanceled);
|
|
20984
20995
|
}
|
|
20985
|
-
if (
|
|
20986
|
-
|
|
20996
|
+
if (config5.signal) {
|
|
20997
|
+
config5.signal.removeEventListener("abort", onCanceled);
|
|
20987
20998
|
}
|
|
20988
20999
|
}
|
|
20989
21000
|
if (utils_default.isFormData(requestData) && (node_default.isStandardBrowserEnv || node_default.isStandardBrowserWebWorkerEnv)) {
|
|
20990
21001
|
requestHeaders.setContentType(false);
|
|
20991
21002
|
}
|
|
20992
21003
|
let request = new XMLHttpRequest();
|
|
20993
|
-
if (
|
|
20994
|
-
const username =
|
|
20995
|
-
const password =
|
|
21004
|
+
if (config5.auth) {
|
|
21005
|
+
const username = config5.auth.username || "";
|
|
21006
|
+
const password = config5.auth.password ? unescape(encodeURIComponent(config5.auth.password)) : "";
|
|
20996
21007
|
requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
|
|
20997
21008
|
}
|
|
20998
|
-
const fullPath = buildFullPath(
|
|
20999
|
-
request.open(
|
|
21000
|
-
request.timeout =
|
|
21009
|
+
const fullPath = buildFullPath(config5.baseURL, config5.url);
|
|
21010
|
+
request.open(config5.method.toUpperCase(), buildURL(fullPath, config5.params, config5.paramsSerializer), true);
|
|
21011
|
+
request.timeout = config5.timeout;
|
|
21001
21012
|
function onloadend() {
|
|
21002
21013
|
if (!request) {
|
|
21003
21014
|
return;
|
|
@@ -21011,7 +21022,7 @@ var xhr_default = isXHRAdapterSupported && function(config4) {
|
|
|
21011
21022
|
status: request.status,
|
|
21012
21023
|
statusText: request.statusText,
|
|
21013
21024
|
headers: responseHeaders,
|
|
21014
|
-
config:
|
|
21025
|
+
config: config5,
|
|
21015
21026
|
request
|
|
21016
21027
|
};
|
|
21017
21028
|
settle(function _resolve(value) {
|
|
@@ -21040,31 +21051,31 @@ var xhr_default = isXHRAdapterSupported && function(config4) {
|
|
|
21040
21051
|
if (!request) {
|
|
21041
21052
|
return;
|
|
21042
21053
|
}
|
|
21043
|
-
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED,
|
|
21054
|
+
reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config5, request));
|
|
21044
21055
|
request = null;
|
|
21045
21056
|
};
|
|
21046
21057
|
request.onerror = function handleError() {
|
|
21047
|
-
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK,
|
|
21058
|
+
reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config5, request));
|
|
21048
21059
|
request = null;
|
|
21049
21060
|
};
|
|
21050
21061
|
request.ontimeout = function handleTimeout() {
|
|
21051
|
-
let timeoutErrorMessage =
|
|
21052
|
-
const transitional2 =
|
|
21053
|
-
if (
|
|
21054
|
-
timeoutErrorMessage =
|
|
21062
|
+
let timeoutErrorMessage = config5.timeout ? "timeout of " + config5.timeout + "ms exceeded" : "timeout exceeded";
|
|
21063
|
+
const transitional2 = config5.transitional || transitional_default;
|
|
21064
|
+
if (config5.timeoutErrorMessage) {
|
|
21065
|
+
timeoutErrorMessage = config5.timeoutErrorMessage;
|
|
21055
21066
|
}
|
|
21056
21067
|
reject(new AxiosError_default(
|
|
21057
21068
|
timeoutErrorMessage,
|
|
21058
21069
|
transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
|
|
21059
|
-
|
|
21070
|
+
config5,
|
|
21060
21071
|
request
|
|
21061
21072
|
));
|
|
21062
21073
|
request = null;
|
|
21063
21074
|
};
|
|
21064
21075
|
if (node_default.isStandardBrowserEnv) {
|
|
21065
|
-
const xsrfValue = (
|
|
21076
|
+
const xsrfValue = (config5.withCredentials || isURLSameOrigin_default(fullPath)) && config5.xsrfCookieName && cookies_default.read(config5.xsrfCookieName);
|
|
21066
21077
|
if (xsrfValue) {
|
|
21067
|
-
requestHeaders.set(
|
|
21078
|
+
requestHeaders.set(config5.xsrfHeaderName, xsrfValue);
|
|
21068
21079
|
}
|
|
21069
21080
|
}
|
|
21070
21081
|
requestData === void 0 && requestHeaders.setContentType(null);
|
|
@@ -21073,35 +21084,35 @@ var xhr_default = isXHRAdapterSupported && function(config4) {
|
|
|
21073
21084
|
request.setRequestHeader(key, val);
|
|
21074
21085
|
});
|
|
21075
21086
|
}
|
|
21076
|
-
if (!utils_default.isUndefined(
|
|
21077
|
-
request.withCredentials = !!
|
|
21087
|
+
if (!utils_default.isUndefined(config5.withCredentials)) {
|
|
21088
|
+
request.withCredentials = !!config5.withCredentials;
|
|
21078
21089
|
}
|
|
21079
21090
|
if (responseType && responseType !== "json") {
|
|
21080
|
-
request.responseType =
|
|
21091
|
+
request.responseType = config5.responseType;
|
|
21081
21092
|
}
|
|
21082
|
-
if (typeof
|
|
21083
|
-
request.addEventListener("progress", progressEventReducer(
|
|
21093
|
+
if (typeof config5.onDownloadProgress === "function") {
|
|
21094
|
+
request.addEventListener("progress", progressEventReducer(config5.onDownloadProgress, true));
|
|
21084
21095
|
}
|
|
21085
|
-
if (typeof
|
|
21086
|
-
request.upload.addEventListener("progress", progressEventReducer(
|
|
21096
|
+
if (typeof config5.onUploadProgress === "function" && request.upload) {
|
|
21097
|
+
request.upload.addEventListener("progress", progressEventReducer(config5.onUploadProgress));
|
|
21087
21098
|
}
|
|
21088
|
-
if (
|
|
21099
|
+
if (config5.cancelToken || config5.signal) {
|
|
21089
21100
|
onCanceled = (cancel) => {
|
|
21090
21101
|
if (!request) {
|
|
21091
21102
|
return;
|
|
21092
21103
|
}
|
|
21093
|
-
reject(!cancel || cancel.type ? new CanceledError_default(null,
|
|
21104
|
+
reject(!cancel || cancel.type ? new CanceledError_default(null, config5, request) : cancel);
|
|
21094
21105
|
request.abort();
|
|
21095
21106
|
request = null;
|
|
21096
21107
|
};
|
|
21097
|
-
|
|
21098
|
-
if (
|
|
21099
|
-
|
|
21108
|
+
config5.cancelToken && config5.cancelToken.subscribe(onCanceled);
|
|
21109
|
+
if (config5.signal) {
|
|
21110
|
+
config5.signal.aborted ? onCanceled() : config5.signal.addEventListener("abort", onCanceled);
|
|
21100
21111
|
}
|
|
21101
21112
|
}
|
|
21102
21113
|
const protocol = parseProtocol(fullPath);
|
|
21103
21114
|
if (protocol && node_default.protocols.indexOf(protocol) === -1) {
|
|
21104
|
-
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST,
|
|
21115
|
+
reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config5));
|
|
21105
21116
|
return;
|
|
21106
21117
|
}
|
|
21107
21118
|
request.send(requestData || null);
|
|
@@ -21154,41 +21165,41 @@ var adapters_default = {
|
|
|
21154
21165
|
};
|
|
21155
21166
|
|
|
21156
21167
|
// node_modules/axios/lib/core/dispatchRequest.js
|
|
21157
|
-
function throwIfCancellationRequested(
|
|
21158
|
-
if (
|
|
21159
|
-
|
|
21168
|
+
function throwIfCancellationRequested(config5) {
|
|
21169
|
+
if (config5.cancelToken) {
|
|
21170
|
+
config5.cancelToken.throwIfRequested();
|
|
21160
21171
|
}
|
|
21161
|
-
if (
|
|
21162
|
-
throw new CanceledError_default(null,
|
|
21172
|
+
if (config5.signal && config5.signal.aborted) {
|
|
21173
|
+
throw new CanceledError_default(null, config5);
|
|
21163
21174
|
}
|
|
21164
21175
|
}
|
|
21165
|
-
function dispatchRequest(
|
|
21166
|
-
throwIfCancellationRequested(
|
|
21167
|
-
|
|
21168
|
-
|
|
21169
|
-
|
|
21170
|
-
|
|
21176
|
+
function dispatchRequest(config5) {
|
|
21177
|
+
throwIfCancellationRequested(config5);
|
|
21178
|
+
config5.headers = AxiosHeaders_default.from(config5.headers);
|
|
21179
|
+
config5.data = transformData.call(
|
|
21180
|
+
config5,
|
|
21181
|
+
config5.transformRequest
|
|
21171
21182
|
);
|
|
21172
|
-
if (["post", "put", "patch"].indexOf(
|
|
21173
|
-
|
|
21183
|
+
if (["post", "put", "patch"].indexOf(config5.method) !== -1) {
|
|
21184
|
+
config5.headers.setContentType("application/x-www-form-urlencoded", false);
|
|
21174
21185
|
}
|
|
21175
|
-
const adapter = adapters_default.getAdapter(
|
|
21176
|
-
return adapter(
|
|
21177
|
-
throwIfCancellationRequested(
|
|
21186
|
+
const adapter = adapters_default.getAdapter(config5.adapter || defaults_default.adapter);
|
|
21187
|
+
return adapter(config5).then(function onAdapterResolution(response) {
|
|
21188
|
+
throwIfCancellationRequested(config5);
|
|
21178
21189
|
response.data = transformData.call(
|
|
21179
|
-
|
|
21180
|
-
|
|
21190
|
+
config5,
|
|
21191
|
+
config5.transformResponse,
|
|
21181
21192
|
response
|
|
21182
21193
|
);
|
|
21183
21194
|
response.headers = AxiosHeaders_default.from(response.headers);
|
|
21184
21195
|
return response;
|
|
21185
21196
|
}, function onAdapterRejection(reason) {
|
|
21186
21197
|
if (!isCancel(reason)) {
|
|
21187
|
-
throwIfCancellationRequested(
|
|
21198
|
+
throwIfCancellationRequested(config5);
|
|
21188
21199
|
if (reason && reason.response) {
|
|
21189
21200
|
reason.response.data = transformData.call(
|
|
21190
|
-
|
|
21191
|
-
|
|
21201
|
+
config5,
|
|
21202
|
+
config5.transformResponse,
|
|
21192
21203
|
reason.response
|
|
21193
21204
|
);
|
|
21194
21205
|
reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
|
|
@@ -21202,7 +21213,7 @@ function dispatchRequest(config4) {
|
|
|
21202
21213
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
21203
21214
|
function mergeConfig(config1, config22) {
|
|
21204
21215
|
config22 = config22 || {};
|
|
21205
|
-
const
|
|
21216
|
+
const config5 = {};
|
|
21206
21217
|
function getMergedValue(target, source, caseless) {
|
|
21207
21218
|
if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
|
|
21208
21219
|
return utils_default.merge.call({ caseless }, target, source);
|
|
@@ -21272,9 +21283,9 @@ function mergeConfig(config1, config22) {
|
|
|
21272
21283
|
utils_default.forEach(Object.keys(config1).concat(Object.keys(config22)), function computeConfigValue(prop) {
|
|
21273
21284
|
const merge2 = mergeMap[prop] || mergeDeepProperties;
|
|
21274
21285
|
const configValue = merge2(config1[prop], config22[prop], prop);
|
|
21275
|
-
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (
|
|
21286
|
+
utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config5[prop] = configValue);
|
|
21276
21287
|
});
|
|
21277
|
-
return
|
|
21288
|
+
return config5;
|
|
21278
21289
|
}
|
|
21279
21290
|
|
|
21280
21291
|
// node_modules/axios/lib/helpers/validator.js
|
|
@@ -21345,15 +21356,15 @@ var Axios = class {
|
|
|
21345
21356
|
response: new InterceptorManager_default()
|
|
21346
21357
|
};
|
|
21347
21358
|
}
|
|
21348
|
-
request(configOrUrl,
|
|
21359
|
+
request(configOrUrl, config5) {
|
|
21349
21360
|
if (typeof configOrUrl === "string") {
|
|
21350
|
-
|
|
21351
|
-
|
|
21361
|
+
config5 = config5 || {};
|
|
21362
|
+
config5.url = configOrUrl;
|
|
21352
21363
|
} else {
|
|
21353
|
-
|
|
21364
|
+
config5 = configOrUrl || {};
|
|
21354
21365
|
}
|
|
21355
|
-
|
|
21356
|
-
const { transitional: transitional2, paramsSerializer, headers } =
|
|
21366
|
+
config5 = mergeConfig(this.defaults, config5);
|
|
21367
|
+
const { transitional: transitional2, paramsSerializer, headers } = config5;
|
|
21357
21368
|
if (transitional2 !== void 0) {
|
|
21358
21369
|
validator_default.assertOptions(transitional2, {
|
|
21359
21370
|
silentJSONParsing: validators2.transitional(validators2.boolean),
|
|
@@ -21367,11 +21378,11 @@ var Axios = class {
|
|
|
21367
21378
|
serialize: validators2.function
|
|
21368
21379
|
}, true);
|
|
21369
21380
|
}
|
|
21370
|
-
|
|
21381
|
+
config5.method = (config5.method || this.defaults.method || "get").toLowerCase();
|
|
21371
21382
|
let contextHeaders;
|
|
21372
21383
|
contextHeaders = headers && utils_default.merge(
|
|
21373
21384
|
headers.common,
|
|
21374
|
-
headers[
|
|
21385
|
+
headers[config5.method]
|
|
21375
21386
|
);
|
|
21376
21387
|
contextHeaders && utils_default.forEach(
|
|
21377
21388
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
@@ -21379,11 +21390,11 @@ var Axios = class {
|
|
|
21379
21390
|
delete headers[method];
|
|
21380
21391
|
}
|
|
21381
21392
|
);
|
|
21382
|
-
|
|
21393
|
+
config5.headers = AxiosHeaders_default.concat(contextHeaders, headers);
|
|
21383
21394
|
const requestInterceptorChain = [];
|
|
21384
21395
|
let synchronousRequestInterceptors = true;
|
|
21385
21396
|
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
|
|
21386
|
-
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(
|
|
21397
|
+
if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config5) === false) {
|
|
21387
21398
|
return;
|
|
21388
21399
|
}
|
|
21389
21400
|
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
|
|
@@ -21401,14 +21412,14 @@ var Axios = class {
|
|
|
21401
21412
|
chain.unshift.apply(chain, requestInterceptorChain);
|
|
21402
21413
|
chain.push.apply(chain, responseInterceptorChain);
|
|
21403
21414
|
len = chain.length;
|
|
21404
|
-
promise = Promise.resolve(
|
|
21415
|
+
promise = Promise.resolve(config5);
|
|
21405
21416
|
while (i2 < len) {
|
|
21406
21417
|
promise = promise.then(chain[i2++], chain[i2++]);
|
|
21407
21418
|
}
|
|
21408
21419
|
return promise;
|
|
21409
21420
|
}
|
|
21410
21421
|
len = requestInterceptorChain.length;
|
|
21411
|
-
let newConfig =
|
|
21422
|
+
let newConfig = config5;
|
|
21412
21423
|
i2 = 0;
|
|
21413
21424
|
while (i2 < len) {
|
|
21414
21425
|
const onFulfilled = requestInterceptorChain[i2++];
|
|
@@ -21432,25 +21443,25 @@ var Axios = class {
|
|
|
21432
21443
|
}
|
|
21433
21444
|
return promise;
|
|
21434
21445
|
}
|
|
21435
|
-
getUri(
|
|
21436
|
-
|
|
21437
|
-
const fullPath = buildFullPath(
|
|
21438
|
-
return buildURL(fullPath,
|
|
21446
|
+
getUri(config5) {
|
|
21447
|
+
config5 = mergeConfig(this.defaults, config5);
|
|
21448
|
+
const fullPath = buildFullPath(config5.baseURL, config5.url);
|
|
21449
|
+
return buildURL(fullPath, config5.params, config5.paramsSerializer);
|
|
21439
21450
|
}
|
|
21440
21451
|
};
|
|
21441
21452
|
utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData2(method) {
|
|
21442
|
-
Axios.prototype[method] = function(url3,
|
|
21443
|
-
return this.request(mergeConfig(
|
|
21453
|
+
Axios.prototype[method] = function(url3, config5) {
|
|
21454
|
+
return this.request(mergeConfig(config5 || {}, {
|
|
21444
21455
|
method,
|
|
21445
21456
|
url: url3,
|
|
21446
|
-
data: (
|
|
21457
|
+
data: (config5 || {}).data
|
|
21447
21458
|
}));
|
|
21448
21459
|
};
|
|
21449
21460
|
});
|
|
21450
21461
|
utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData2(method) {
|
|
21451
21462
|
function generateHTTPMethod(isForm) {
|
|
21452
|
-
return function httpMethod(url3, data,
|
|
21453
|
-
return this.request(mergeConfig(
|
|
21463
|
+
return function httpMethod(url3, data, config5) {
|
|
21464
|
+
return this.request(mergeConfig(config5 || {}, {
|
|
21454
21465
|
method,
|
|
21455
21466
|
headers: isForm ? {
|
|
21456
21467
|
"Content-Type": "multipart/form-data"
|
|
@@ -21496,11 +21507,11 @@ var CancelToken = class {
|
|
|
21496
21507
|
};
|
|
21497
21508
|
return promise;
|
|
21498
21509
|
};
|
|
21499
|
-
executor(function cancel(message,
|
|
21510
|
+
executor(function cancel(message, config5, request) {
|
|
21500
21511
|
if (token.reason) {
|
|
21501
21512
|
return;
|
|
21502
21513
|
}
|
|
21503
|
-
token.reason = new CanceledError_default(message,
|
|
21514
|
+
token.reason = new CanceledError_default(message, config5, request);
|
|
21504
21515
|
resolvePromise(token.reason);
|
|
21505
21516
|
});
|
|
21506
21517
|
}
|
|
@@ -21963,8 +21974,8 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => {
|
|
|
21963
21974
|
if (!staged)
|
|
21964
21975
|
return;
|
|
21965
21976
|
ae("opencommit");
|
|
21966
|
-
const
|
|
21967
|
-
if (!
|
|
21977
|
+
const config5 = getConfig();
|
|
21978
|
+
if (!config5?.OCO_OPENAI_API_KEY) {
|
|
21968
21979
|
throw new Error(
|
|
21969
21980
|
"No OPEN_AI_API exists. Set your OPEN_AI_API=<key> in ~/.opencommit"
|
|
21970
21981
|
);
|
|
@@ -21999,16 +22010,31 @@ var trytm = async (promise) => {
|
|
|
21999
22010
|
};
|
|
22000
22011
|
|
|
22001
22012
|
// src/commands/commit.ts
|
|
22013
|
+
var config4 = getConfig();
|
|
22002
22014
|
var getGitRemotes = async () => {
|
|
22003
22015
|
const { stdout } = await execa("git", ["remote"]);
|
|
22004
22016
|
return stdout.split("\n").filter((remote) => Boolean(remote.trim()));
|
|
22005
22017
|
};
|
|
22018
|
+
var checkMessageTemplate = (extraArgs2) => {
|
|
22019
|
+
for (const key in extraArgs2) {
|
|
22020
|
+
if (extraArgs2[key].includes(config4?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER))
|
|
22021
|
+
return extraArgs2[key];
|
|
22022
|
+
}
|
|
22023
|
+
return false;
|
|
22024
|
+
};
|
|
22006
22025
|
var generateCommitMessageFromGitDiff = async (diff, extraArgs2) => {
|
|
22026
|
+
const messageTemplate = checkMessageTemplate(extraArgs2);
|
|
22007
22027
|
await assertGitRepo();
|
|
22008
22028
|
const commitSpinner = le();
|
|
22009
22029
|
commitSpinner.start("Generating the commit message");
|
|
22010
22030
|
try {
|
|
22011
|
-
|
|
22031
|
+
let commitMessage = await generateCommitMessageByDiff(diff);
|
|
22032
|
+
if (typeof messageTemplate === "string") {
|
|
22033
|
+
commitMessage = messageTemplate.replace(
|
|
22034
|
+
config4?.OCO_MESSAGE_TEMPLATE_PLACEHOLDER,
|
|
22035
|
+
commitMessage
|
|
22036
|
+
);
|
|
22037
|
+
}
|
|
22012
22038
|
commitSpinner.stop("\u{1F4DD} Commit message generated");
|
|
22013
22039
|
ce(
|
|
22014
22040
|
`Commit message:
|